diff --git a/.env.example b/.env.example index d51e8a3..73877b8 100644 --- a/.env.example +++ b/.env.example @@ -1,30 +1,14 @@ # GitHub Configuration GITHUB_TOKEN=ghp_your_github_personal_access_token_here +GITHUB_API_URL=https://api.github.com +GITHUB_TIMEOUT=30 -# LLM Provider (openai, anthropic, or local) +# LLM Provider (openai, anthropic, or local) — nested LLM_* schema LLM_PROVIDER=openai - -# OpenAI Configuration (if using OpenAI) -OPENAI_API_KEY=sk-your_openai_api_key_here -OPENAI_MODEL=gpt-4-turbo-preview - -# Anthropic Configuration (if using Anthropic) -ANTHROPIC_API_KEY=sk-ant-your_anthropic_api_key_here -ANTHROPIC_MODEL=claude-3-opus-20240229 - -# Database (SQLite by default, or PostgreSQL connection string) -DATABASE_URL=sqlite:///./autonomous_agent.db +LLM_API_KEY=sk-your-llm-api-key-here +LLM_MODEL=gpt-4-turbo-preview +LLM_TEMPERATURE=0.2 +LLM_MAX_TOKENS=4000 # Automation Level (manual, semi-auto, full-auto) AUTOMATION_LEVEL=semi-auto - -# Logging -LOG_LEVEL=INFO -LOG_FILE=logs/agent.log - -# Rate Limiting -GITHUB_API_RATE_LIMIT=5000 -LLM_API_RATE_LIMIT=100 - -# Audit Log Retention (days) -AUDIT_RETENTION_DAYS=90 diff --git a/.github/scripts/generate_rollback_manifest.py b/.github/scripts/generate_rollback_manifest.py index 54dcb7a..c7c9de9 100644 --- a/.github/scripts/generate_rollback_manifest.py +++ b/.github/scripts/generate_rollback_manifest.py @@ -7,7 +7,7 @@ """ import os -from datetime import datetime, timezone +from datetime import UTC, datetime def main(): @@ -17,7 +17,7 @@ def main(): author = os.environ.get("AUTHOR", "unknown") files_changed = os.environ.get("FILES_CHANGED", "").split() - timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC") + timestamp = datetime.now(UTC).strftime("%Y-%m-%d %H:%M UTC") path = "docs/ROLLBACK.md" os.makedirs("docs", exist_ok=True) diff --git a/.github/scripts/llm_router.py b/.github/scripts/llm_router.py index 0ae284f..3132b2a 100644 --- a/.github/scripts/llm_router.py +++ b/.github/scripts/llm_router.py @@ -36,7 +36,7 @@ class LLMRouter: Decision Matrix: - format, lint, doc, triage, changelog, summarize, label, classify, rename, comment_simple, security LOW → Local (Llama-70B) - - security MEDIUM, review/test_generation <200 lines, complexity 10-20 → Moderate (try local, fall back to cloud) + - security MEDIUM, review/test_generation <200 lines, complexity 5-20 → Moderate (try local, fall back to cloud) - refactor, architecture, multi_file, review >200 lines → Cloud (GPT-4-Turbo) - security HIGH/CRITICAL → Cloud (GPT-4) """ @@ -89,9 +89,9 @@ def classify(self, task_type: str, context: dict) -> TaskComplexity: score = context.get("score", 0) if score > 20: return TaskComplexity.COMPLEX - if score > 10: + if score >= 5: return TaskComplexity.MODERATE - return TaskComplexity.SIMPLE # simple functions → local + return TaskComplexity.SIMPLE # trivial functions → local if task_type in ["refactor", "architecture", "multi_file"]: return TaskComplexity.COMPLEX diff --git a/.github/workflows/ai_agent_workflow.yml b/.github/workflows/ai_agent_workflow.yml index e1465a4..41a53a9 100644 --- a/.github/workflows/ai_agent_workflow.yml +++ b/.github/workflows/ai_agent_workflow.yml @@ -57,7 +57,7 @@ jobs: - name: Run tests with coverage run: | - pytest --cov=core --cov=agents --cov=autopilot --cov=.github/scripts --cov-report=xml --cov-report=term -v + pytest --cov=autonomous_agent --cov=core --cov=agents --cov=overseer --cov=autopilot --cov=monitoring --cov-report=xml --cov-report=term -v - name: Upload coverage if: matrix.python-version == '3.11' @@ -66,6 +66,14 @@ jobs: file: ./coverage.xml fail_ci_if_error: false + - name: Upload coverage XML for regression check + if: matrix.python-version == '3.11' + uses: actions/upload-artifact@v6 + with: + name: coverage-xml + path: coverage.xml + retention-days: 7 + code-quality: runs-on: ubuntu-latest steps: @@ -151,3 +159,40 @@ jobs: curl -s -X POST https://gadgetlab.app.n8n.cloud/webhook/ci-feedback \ -H 'Content-Type: application/json' \ -d "{\"repo\":\"${REPO}\",\"conclusion\":\"${CONCLUSION}\",\"run_url\":\"${RUN_URL}\",\"workflow_name\":\"${WORKFLOW}\",\"run_id\":\"${RUN_ID}\"}" || true + + # Alert on coverage regression via the repo's regression_alert module. + # Runs monitoring/regression_alert.py against coverage.xml from the test job + # and posts to Slack (#drc-recommendations) when coverage drops below the floor. + regression-check: + needs: [test] + runs-on: ubuntu-latest + if: github.event_name == 'push' || !github.event.pull_request.draft + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Download coverage artifact + uses: actions/download-artifact@v7 + with: + name: coverage-xml + path: . + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Extract coverage % and run regression check + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + run: | + if [ ! -f coverage.xml ]; then + echo "coverage.xml not found — skipping regression check" + exit 0 + fi + COV=$(python -c "import xml.etree.ElementTree as ET; r=ET.parse('coverage.xml').getroot(); print(f\"{float(r.get('line-rate',0))*100:.2f}\")") + echo "Current coverage: ${COV}%" + python monitoring/regression_alert.py --coverage "$COV" || echo "::warning::Coverage regression detected — see Slack #drc-recommendations" diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 9a55085..77c7fd5 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -27,7 +27,7 @@ jobs: - name: Commit if changed run: | git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add CHANGELOG.md if ! git diff --staged --quiet; then git commit -m "chore: update CHANGELOG [skip ci]" diff --git a/.github/workflows/code-quality-optimized.yml b/.github/workflows/code-quality-optimized.yml index 6fce3b5..168c120 100644 --- a/.github/workflows/code-quality-optimized.yml +++ b/.github/workflows/code-quality-optimized.yml @@ -154,10 +154,12 @@ jobs: - name: Run optimized pytest run: | pytest \ + --cov=autonomous_agent \ --cov=core \ --cov=agents \ + --cov=overseer \ --cov=autopilot \ - --cov=.github/scripts \ + --cov=monitoring \ --cov-report=xml \ --cov-report=term-missing \ --cov-report=html \ diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..190b403 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,46 @@ +name: CodeQL Security Analysis + +# GitHub-hosted CodeQL is free for public repositories (this repo went public 2026-06-27). +# This runs REAL semantic code analysis (not just Bandit's pattern grep) and uploads +# results to the GitHub Security tab. `security_scan.yml` uploads Bandit's SARIF under +# the `bandit` category; this workflow uploads CodeQL's under the `codeql` category so +# both engines appear side-by-side in code scanning. + +permissions: + contents: read + security-events: write + actions: read + pull-requests: read + +on: + push: + branches: [main, develop] + pull_request: + types: [opened, synchronize, reopened] + branches: [main] + schedule: + - cron: '17 3 * * 1' # Weekly Monday 03:17 UTC — randomized minute to avoid the top-of-hour stampede + workflow_dispatch: + +jobs: + analyze: + name: Analyze (Python + JavaScript) + runs-on: ubuntu-latest + timeout-minutes: 360 + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: python, javascript + # Build-mode 'none' — pure source analysis, no compilation needed for this repo. + # JS analysis covers the .github/scripts automation + landing/ Next.js app. + queries: security-and-quality + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: codeql + upload: true diff --git a/.github/workflows/daily-summary.yml b/.github/workflows/daily-summary.yml new file mode 100644 index 0000000..05a799e --- /dev/null +++ b/.github/workflows/daily-summary.yml @@ -0,0 +1,60 @@ +name: Daily Repository Summary (Autopilot) + +# Runs autopilot/autopilot.py to produce DAILY_SUMMARY.md for the configured +# repos (see autopilot/config.yaml). The script is a standalone CLI that was +# previously undocumented/idle; this workflow makes the documented +# "daily summaries" feature actually run on a schedule. +# +# Security: runs with the default GITHUB_TOKEN (contents: write on this repo, +# plus read on the other labgadget015-dotcom repos via the token's account +# scopes). No secrets are echoed. Output is committed back to the repo so the +# summary is visible in the file tree. + +on: + schedule: + # Daily at 06:17 UTC (off-round minute to avoid the top-of-hour stampede) + - cron: '17 6 * * *' + workflow_dispatch: + +permissions: + contents: write + +jobs: + daily-summary: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # Need a real branch so we can commit the summary back + ref: ${{ github.ref }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyyaml python-dotenv PyGithub + + - name: Generate daily summary + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd autopilot + python autopilot.py --config config.yaml --output ../DAILY_SUMMARY.md + + - name: Commit summary + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + if [ -n "$(git status --porcelain DAILY_SUMMARY.md)" ]; then + git add DAILY_SUMMARY.md + git commit -m "docs: daily summary $(date -u +'%Y-%m-%d') [skip ci]" + git push + else + echo "No summary changes — nothing to commit" + fi diff --git a/.github/workflows/drc-token-rotation-alert.yml b/.github/workflows/drc-token-rotation-alert.yml new file mode 100644 index 0000000..ac1a1e7 --- /dev/null +++ b/.github/workflows/drc-token-rotation-alert.yml @@ -0,0 +1,133 @@ +name: DRC Token Rotation Alert + +# Mirrors pat-rotation-alert.yml but for the static x-gadgetlab-token shared +# secret between the n8n GitHub Event Router and the DRC Agent Loop. The token +# lives ONLY as embedded literals in two n8n nodes (no GitHub secret, no hard +# expiry), so the only safe signal is "days since last rotation" against a +# chosen max-age policy. Rotation is MANUAL and requires Gadget to log into n8n +# (sessions expire 30-60 min; autosave fails silently with 401) and edit + publish +# both nodes. See SECRETS_ROTATION.md for the exact steps. + +on: + schedule: + # Run on the 1st of every month at 09:30 UTC (offset from the PAT check) + - cron: '30 9 1 * *' + workflow_dispatch: + +env: + LAST_ROTATED: "2026-07-06" # update after every manual rotation + MAX_AGE_DAYS: "180" # recommend rotating the DRC token every ~6 months + +jobs: + check-drc-token-age: + runs-on: ubuntu-latest + steps: + - name: Calculate days until DRC token is due for rotation + id: age + run: | + LAST_TS=$(date -d "$LAST_ROTATED" +%s) + NOW_TS=$(date +%s) + DAYS_SINCE=$(( (NOW_TS - LAST_TS) / 86400 )) + DAYS_UNTIL_DUE=$(( MAX_AGE_DAYS - DAYS_SINCE )) + echo "days_since=$DAYS_SINCE" >> "$GITHUB_OUTPUT" + echo "days_until_due=$DAYS_UNTIL_DUE" >> "$GITHUB_OUTPUT" + echo "last_rotated=$LAST_ROTATED" >> "$GITHUB_OUTPUT" + echo "DRC token last rotated $LAST_ROTATED — $DAYS_SINCE days ago, $DAYS_UNTIL_DUE days until due (max age $MAX_AGE_DAYS)" + + - name: Determine urgency level + id: urgency + run: | + DAYS=${{ steps.age.outputs.days_until_due }} + if [ "$DAYS" -le 7 ]; then + echo "level=CRITICAL" >> "$GITHUB_OUTPUT" + echo "emoji=🚨" >> "$GITHUB_OUTPUT" + elif [ "$DAYS" -le 14 ]; then + echo "level=HIGH" >> "$GITHUB_OUTPUT" + echo "emoji=⚠️" >> "$GITHUB_OUTPUT" + elif [ "$DAYS" -le 30 ]; then + echo "level=MEDIUM" >> "$GITHUB_OUTPUT" + echo "emoji=🔔" >> "$GITHUB_OUTPUT" + elif [ "$DAYS" -le 90 ]; then + echo "level=LOW" >> "$GITHUB_OUTPUT" + echo "emoji=ℹ️" >> "$GITHUB_OUTPUT" + else + echo "level=OK" >> "$GITHUB_OUTPUT" + echo "emoji=✅" >> "$GITHUB_OUTPUT" + fi + + - name: Post Slack alert (if within 90-day window) + if: ${{ steps.age.outputs.days_until_due <= 90 || github.event_name == 'workflow_dispatch' }} + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + DAYS_SINCE: ${{ steps.age.outputs.days_since }} + DAYS_UNTIL_DUE: ${{ steps.age.outputs.days_until_due }} + LAST: ${{ steps.age.outputs.last_rotated }} + LEVEL: ${{ steps.urgency.outputs.level }} + EMOJI: ${{ steps.urgency.outputs.emoji }} + REPO: ${{ github.repository }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + if [ -z "$SLACK_WEBHOOK_URL" ]; then + echo "SLACK_WEBHOOK_URL not set — skipping Slack notification" + exit 0 + fi + curl -s -X POST "$SLACK_WEBHOOK_URL" \ + -H 'Content-Type: application/json' \ + -d "{ + \"text\": \"${EMOJI} *DRC x-gadgetlab-token Rotation Due — ${LEVEL}*\", + \"blocks\": [ + { + \"type\": \"header\", + \"text\": {\"type\": \"plain_text\", \"text\": \"${EMOJI} DRC Token Rotation — ${LEVEL}\"} + }, + { + \"type\": \"section\", + \"fields\": [ + {\"type\": \"mrkdwn\", \"text\": \"*Repository:*\\n${REPO}\"}, + {\"type\": \"mrkdwn\", \"text\": \"*Last rotated:*\\n${LAST}\"}, + {\"type\": \"mrkdwn\", \"text\": \"*Days since:*\\n${DAYS_SINCE}\"}, + {\"type\": \"mrkdwn\", \"text\": \"*Days until due:*\\n${DAYS_UNTIL_DUE}\"}, + {\"type\": \"mrkdwn\", \"text\": \"*Action Required:*\\nRotate the x-gadgetlab-token in n8n (2 nodes) + publish, or the DRC Agent Loop rejects all real traffic\"} + ] + }, + { + \"type\": \"actions\", + \"elements\": [ + { + \"type\": \"button\", + \"text\": {\"type\": \"plain_text\", \"text\": \"View Workflow Run\"}, + \"url\": \"${RUN_URL}\" + }, + { + \"type\": \"button\", + \"text\": {\"type\": \"plain_text\", \"text\": \"n8n Console\"}, + \"url\": \"https://gadgetlab.app.n8n.cloud\" + } + ] + } + ] + }" || echo "Slack notification failed (non-fatal)" + + - name: Write job summary + run: | + DAYS_SINCE=${{ steps.age.outputs.days_since }} + DAYS_UNTIL_DUE=${{ steps.age.outputs.days_until_due }} + LAST=${{ steps.age.outputs.last_rotated }} + LEVEL=${{ steps.urgency.outputs.level }} + EMOJI=${{ steps.urgency.outputs.emoji }} + echo "## ${EMOJI} DRC Token Rotation Status: ${LEVEL}" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "| Field | Value |" >> "$GITHUB_STEP_SUMMARY" + echo "|-------|-------|" >> "$GITHUB_STEP_SUMMARY" + echo "| Last rotated | \`${LAST}\` |" >> "$GITHUB_STEP_SUMMARY" + echo "| Days since | **${DAYS_SINCE}** |" >> "$GITHUB_STEP_SUMMARY" + echo "| Days until due (max age ${MAX_AGE_DAYS}) | **${DAYS_UNTIL_DUE}** |" >> "$GITHUB_STEP_SUMMARY" + echo "| Alert level | ${LEVEL} |" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "**Action:** Log into n8n, update the \`x-gadgetlab-token\` literal in BOTH the Event Router 'Forward to Agent Loop' node and the DRC Agent Loop 'Prepare Input' node to the same new value, publish both, and update \`LAST_ROTATED\` here. See SECRETS_ROTATION.md." >> "$GITHUB_STEP_SUMMARY" + + - name: Fail on critical age + if: ${{ steps.age.outputs.days_until_due <= 7 }} + run: | + echo "::error::DRC token is ${{ steps.age.outputs.days_since }} days old and ${{ steps.age.outputs.days_until_due }} days from due — ROTATE IMMEDIATELY" + exit 1 diff --git a/.gitignore b/.gitignore index 75e39d7..d45edcc 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,45 @@ coverage.xml mcp_server/ .vercel .env* + +# Auto-generated install/setup spam (one-click installers, marketing .txt) — keep repo clean +CLICK_ME_TO_INSTALL.txt +CONFIGURE_*.txt +CONFIGURE_*.bat +CORRECT_INSTALL_COMMANDS.txt +DIAGNOSE.bat +DOUBLE_CLICK_ME.bat +*Executive Summary*.txt +finalize_setup.bat +FIX_NOW.txt +HOW_TO_GET_TOKENS.txt +INDEX.txt +INSTALLATION_COMPLETE_SUMMARY.txt +INSTALL_NOW.bat +PRE_INSTALLATION_CHECKLIST.txt +run_installation.bat +run_install.bat +run_master_install.bat +SIMPLE_INSTALL.bat +SIMPLE_TEST_STEPS.txt +start.bat +START_INSTALLATION*.txt +TEST_INSTALLATION.bat +*_REPORT.md +*_SUMMARY.md +*_ANALYSIS.md +VERIFICATION*.md +EXECUTION*.md +DEPLOYMENT*.md +FINAL_VERIFICATION*.md +IMPLEMENTATION*.md +ENHANCEMENT*.md +COPILOT_*REPORT.md +INSTALLATION_*.md +WHAT_NOW.md +NEXT_STEPS.md +QUICK_START*.md +README_INSTALL.md +START_HERE.md +# Unrelated business docs accidentally committed +Ai docs/ diff --git a/Ai docs/1. AI-Powered Circular-as-a-Service.txt b/Ai docs/1. AI-Powered Circular-as-a-Service.txt deleted file mode 100644 index 4d70c75..0000000 --- a/Ai docs/1. AI-Powered Circular-as-a-Service.txt +++ /dev/null @@ -1,538 +0,0 @@ -1. AI-Powered Circular-as-a-Service (CaaS) -Core Concept - -Industrial assets are no longer sold; they are tracked, maintained, refurbished, and redeployed using AI and IoT to maximize lifecycle value and minimize waste. - -Primary Persona - -Sarah – Sustainability Director - -KPIs: Net-zero targets, Scope 3 emissions reduction, cost per unit output. - -Frustrations: - -Overbuying inventory - -Waste disposal costs - -Poor visibility into asset usage - -Buying Trigger: - -ESG reporting pressure - -Carbon taxation or regulation - -Procurement cost reduction mandate - -Business Model Canvas -Customer Segments - -Manufacturing firms - -Logistics providers - -Construction companies - -Retail distribution networks - -Early adopters: - -Firms with ESG commitments - -Companies managing large fleets of reusable equipment - -Value Proposition - -Reduce material costs by 20–40% - -Predictive maintenance reduces downtime - -Automated ESG reporting for compliance - -Subscription access instead of capital expenditure - -Functional Value: - -Asset uptime optimization - -Inventory reduction - -Emotional Value: - -Sustainability leadership - -Reduced operational stress - -Channels - -Direct enterprise sales - -Sustainability consulting partners - -Industry trade shows - -Integration with procurement software - -Customer Relationships - -Dedicated account managers - -Data dashboards for operations and sustainability teams - -Quarterly optimization reviews - -Revenue Streams - -Asset subscription fees - -Maintenance and refurbishment service fees - -Analytics dashboard subscription - -Residual material recovery revenue - -Premium carbon reporting module - -Key Activities - -IoT monitoring and analytics - -Predictive maintenance modeling - -Reverse logistics coordination - -Refurbishment operations - -ESG reporting automation - -Key Resources - -IoT-enabled asset fleet - -Lifecycle analytics platform - -Repair/refurbishment facilities - -Logistics network - -Sustainability reporting algorithms - -Key Partners - -IoT hardware manufacturers - -Logistics companies - -Recycling/refurbishment partners - -Sustainability certification bodies - -Cost Structure - -Asset procurement - -Warehouse and refurbishment operations - -Cloud infrastructure - -Logistics - -Sales and customer success - -Lean Validation Roadmap - -Iteration 1: MVP - -Lease one high-value asset category (e.g., pallets or industrial containers) - -Simple dashboard with usage tracking - -Metrics: - -Asset utilization rate - -Customer renewal rate - -Cost savings vs purchase baseline - -Iteration 2 - -Predictive maintenance AI - -Automated replacement scheduling - -Metrics: - -Downtime reduction - -Maintenance cost per asset - -Iteration 3 - -Fully automated reverse logistics - -Carbon footprint reporting - -Metrics: - -Emissions saved per client - -Lifecycle extension % - -Long-Term Moat - -Proprietary lifecycle datasets - -Network effects in refurbishment and recovery - -Integration into procurement workflows - -2. Agentic AI Workflow Platform -Core Concept - -Autonomous AI agents that plan, execute, and monitor complex business workflows rather than simply responding to prompts. - -Primary Persona - -Mark – Operations Manager - -KPIs: Cycle time, error rate, operational cost - -Frustrations: - -Manual reporting - -Spreadsheet workflows - -Delays in approvals - -Buying Trigger: - -Headcount reduction targets - -Need to scale operations without hiring - -Business Model Canvas -Customer Segments - -Mid-market enterprises - -Logistics firms - -Finance departments - -Procurement teams - -Early adopters: - -Companies already using RPA but hitting limitations - -Value Proposition - -Automate entire workflows, not just tasks - -Reduce operational cost by 30–60% - -Real-time decision automation - -Channels - -SaaS self-serve onboarding - -Enterprise sales - -API partnerships - -Customer Relationships - -Bot onboarding specialists - -Playbook templates - -AI training support - -Revenue Streams - -Usage-based pricing (per action) - -Workflow subscription bundles - -Enterprise licenses - -Premium analytics module - -Key Activities - -Agent orchestration platform development - -Model fine-tuning - -Integration with enterprise systems - -Monitoring and guardrails - -Key Resources - -Agent orchestration engine - -Workflow templates - -Integration APIs - -Observability dashboards - -Key Partners - -Cloud providers - -ERP and CRM vendors - -Data providers - -Cost Structure - -Compute costs - -Engineering - -Integration support - -Sales - -Lean Validation Roadmap - -Iteration 1 - -One workflow: invoice processing - -Metrics: - -Processing time reduction - -Error rate vs human baseline - -Iteration 2 - -Multi-step workflows (procurement or reporting) - -Metrics: - -End-to-end cycle time - -Cost per workflow - -Iteration 3 - -Autonomous decision-making within guardrails - -Metrics: - -Percentage of tasks fully automated - -ROI per customer - -Long-Term Moat - -Workflow training datasets - -Integration ecosystem - -Switching costs through embedded processes - -3. Hyper-Personalized Digital Twin Health & Wellness -Core Concept - -AI creates a dynamic predictive model of an individual’s health, combining wearable data, lifestyle inputs, and biomarkers. - -Primary Persona - -Jamie – High-Performance Executive - -KPIs: Energy levels, stress, sleep quality, longevity - -Frustrations: - -Generic health advice - -Lack of early warning signals - -Buying Trigger: - -Health scare - -Executive performance coaching - -Business Model Canvas -Customer Segments - -Professionals aged 30–60 - -Athletes and biohackers - -Corporate wellness programs - -Value Proposition - -Predictive health insights - -Personalized nutrition and recovery guidance - -Early anomaly detection - -Channels - -Mobile app - -Wearable integrations - -Corporate wellness partnerships - -Customer Relationships - -AI coaching assistant - -Monthly progress reports - -Personalized recommendations - -Revenue Streams - -Premium subscription - -Advanced diagnostics modules - -Corporate wellness licensing - -Partner commissions (labs, supplements, coaching) - -Key Activities - -Health data modeling - -Personalization algorithms - -Regulatory compliance - -Behavioral coaching design - -Key Resources - -AI health models - -Data privacy infrastructure - -Wearable integrations - -Clinical advisors - -Key Partners - -Wearable manufacturers - -Labs and diagnostics providers - -Insurance companies - -Cost Structure - -Data storage and compute - -App development - -Compliance and legal - -Customer acquisition - -Lean Validation Roadmap - -Iteration 1 - -Sleep and activity tracking - -Metrics: - -Daily active users - -Retention rate - -Iteration 2 - -Nutrition and metabolic predictions - -Metrics: - -Engagement time - -Behavior change rates - -Iteration 3 - -Stress and mental performance modeling - -Metrics: - -NPS - -Long-term retention - -Long-Term Moat - -Longitudinal health datasets - -Personalization models that improve over time - -Switching costs due to historical data - -Cross-Model Execution Framework (Critical for Success) -Step 1: Define Assumptions - -Test: - -Is the problem painful? - -Are customers willing to pay? - -Is the solution 10× better? - -Tools: - -Landing pages - -Pilot programs - -Concierge MVPs - -Step 2: Build–Measure–Learn Loop - -Every 4–8 weeks: - -Release small feature - -Measure behavior - -Decide: - -Scale - -Improve - -Pivot - -Step 3: Metrics That Matter - -For all three: - -CAC vs LTV - -Retention - -Time to value - -Expansion revenue - -Strategic Insight: Which Model Has the Highest 2026 Potential? - -Fastest to Revenue: Agentic AI workflows -Largest Long-Term Moat: Circular-as-a-Service -Highest Consumer Scale: Digital Twin wellness diff --git a/Ai docs/1. How can we optimize the AI model.txt b/Ai docs/1. How can we optimize the AI model.txt deleted file mode 100644 index 3f86e06..0000000 --- a/Ai docs/1. How can we optimize the AI model.txt +++ /dev/null @@ -1,50 +0,0 @@ -1. How can we optimize the AI model for faster performance? -2. What are the key data sources to improve model accuracy? -3. How can we enhance the SaaS platform’s user experience? -4. What pricing experiments can we run to maximize revenue? -5. How can we automate customer onboarding more effectively? -6. What partnerships can accelerate go-to-market strategy? -7. How can we leverage AI for personalized business model recommendations? -8. What feedback loops can improve AI predictions? -9. How can we reduce AI hallucinations in model outputs? -10. What industry benchmarks should we use for model validation? -11. How can we expand our template library faster? -12. What are the most profitable customer segments to target? -13. How can we improve retention through AI-driven insights? -14. What new features will help upsell Pro to Enterprise users? -15. How can we streamline the advisory add-on process? -16. What integrations are most requested by users? -17. How can we enhance the AI model’s explainability? -18. What security measures can we implement for enterprise clients? -19. How can we optimize the freemium tier for better conversions? -20. What training do our clients need to maximize platform value? -21. How can we measure the ROI of AI-driven business models? -22. What new markets can we enter using our current tech stack? -23. How can we automate the continuous learning loop for AI models? -24. What metrics should we track to monitor AI performance? -25. How can we localize the platform for international clients? -26. What customer success strategies will drive renewals? -27. How can we improve the human-in-the-loop review process? -28. What are the best practices for AI model risk management? -29. How can we optimize cloud infrastructure costs? -30. What content marketing initiatives will attract more users? -31. How can we create a stronger community around the platform? -32. What additional revenue streams can we explore? -33. How can we improve the knowledge graph for better predictions? -34. What role-based access controls are needed for enterprises? -35. How can we streamline the API onboarding process? -36. What AI simulations can enhance scenario planning? -37. How can we better tailor AI outputs to specific industries? -38. What governance frameworks should we adopt for compliance? -39. How can we use AI to identify emerging market trends? -40. What are the optimal pricing tiers based on usage patterns? -41. How can we improve the accuracy of churn prediction models? -42. What new consulting service offerings can we introduce? -43. How can we enhance collaboration features in the platform? -44. What are the most effective training and workshop formats? -45. How can we optimize AI model deployment pipelines? -46. What KPIs best reflect customer satisfaction and success? -47. How can we improve the scalability of AI processing? -48. What data privacy enhancements are most critical? -49. How can we increase the adoption of the enterprise API? -50. What AI-driven insights can help clients achieve faster growth? diff --git a/Ai docs/AI Home Assistant Business Model and Strategy (1).pdf b/Ai docs/AI Home Assistant Business Model and Strategy (1).pdf deleted file mode 100644 index 11e631e..0000000 Binary files a/Ai docs/AI Home Assistant Business Model and Strategy (1).pdf and /dev/null differ diff --git a/Ai docs/AI Home Assistant Business Model and Strategy (2).pdf b/Ai docs/AI Home Assistant Business Model and Strategy (2).pdf deleted file mode 100644 index 11e631e..0000000 Binary files a/Ai docs/AI Home Assistant Business Model and Strategy (2).pdf and /dev/null differ diff --git a/Ai docs/AI Home Assistant Business Model and Strategy.pdf b/Ai docs/AI Home Assistant Business Model and Strategy.pdf deleted file mode 100644 index 11e631e..0000000 Binary files a/Ai docs/AI Home Assistant Business Model and Strategy.pdf and /dev/null differ diff --git a/Ai docs/AI-powered consulting platform.pdf b/Ai docs/AI-powered consulting platform.pdf deleted file mode 100644 index 994d020..0000000 Binary files a/Ai docs/AI-powered consulting platform.pdf and /dev/null differ diff --git a/Ai docs/Act as a state-of-the-art (1).pdf b/Ai docs/Act as a state-of-the-art (1).pdf deleted file mode 100644 index 2a755d6..0000000 Binary files a/Ai docs/Act as a state-of-the-art (1).pdf and /dev/null differ diff --git a/Ai docs/Act as a state-of-the-art (2).pdf b/Ai docs/Act as a state-of-the-art (2).pdf deleted file mode 100644 index 2a755d6..0000000 Binary files a/Ai docs/Act as a state-of-the-art (2).pdf and /dev/null differ diff --git a/Ai docs/Act as a state-of-the-art.pdf b/Ai docs/Act as a state-of-the-art.pdf deleted file mode 100644 index 2a755d6..0000000 Binary files a/Ai docs/Act as a state-of-the-art.pdf and /dev/null differ diff --git a/Ai docs/GA4 + BigQuery + Webflow + Stripe.pdf b/Ai docs/GA4 + BigQuery + Webflow + Stripe.pdf deleted file mode 100644 index e70da86..0000000 Binary files a/Ai docs/GA4 + BigQuery + Webflow + Stripe.pdf and /dev/null differ diff --git a/Ai docs/Next 48 Hours - Action Plan (1).pdf b/Ai docs/Next 48 Hours - Action Plan (1).pdf deleted file mode 100644 index 34aa824..0000000 Binary files a/Ai docs/Next 48 Hours - Action Plan (1).pdf and /dev/null differ diff --git a/Ai docs/Next 48 Hours - Action Plan.pdf b/Ai docs/Next 48 Hours - Action Plan.pdf deleted file mode 100644 index 34aa824..0000000 Binary files a/Ai docs/Next 48 Hours - Action Plan.pdf and /dev/null differ diff --git a/Ai docs/Perplexity buss.html b/Ai docs/Perplexity buss.html deleted file mode 100644 index fdb05a1..0000000 --- a/Ai docs/Perplexity buss.html +++ /dev/null @@ -1,469 +0,0 @@ - - -Perplexity
I currently can't directly type into the document for you, but I can guide you step-by-step. Let’s begin by adding a title, such as “AI Adoption Services Business Plan.” Then we’ll create headings for each important section: Target Market, Core Offers, Priorities, Growth Plan, and Action Steps. I’ll help you fill in details under each heading. Ready to get the title in place first?
Waking up...
Say something...
Muted
diff --git a/Ai docs/Perplexity buss_files/index-AO5YUTXc.js.download b/Ai docs/Perplexity buss_files/index-AO5YUTXc.js.download deleted file mode 100644 index 5d413b9..0000000 --- a/Ai docs/Perplexity buss_files/index-AO5YUTXc.js.download +++ /dev/null @@ -1,1146 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-avoQQ9qh.js","assets/vite-5mULU2Sf.js","assets/agent-B4SD4dZE.js","assets/platform-BFHE8Ozi.js","assets/vendors-Uf9WzPBH.js","assets/LocationPermissionModal-C7z1rtlp.js","assets/i18n-Ex1XiscZ.js","assets/icons-lm0x-2iG.js","assets/react-query-IUEyoar6.js","assets/platform-components-CfpzMod3.js","assets/lexical-D_7aXiGd.js","assets/mapbox-gl-BYD-OPEL.js","assets/mapbox-gl-B9eh9OLo.css","assets/FileUploadModal-cgKFfF_8.js","assets/capabilities-BVuvQB3C.js","assets/useFileDirectory-D3RsbgUN.js","assets/Progress-96ZthlNt.js","assets/CometDownloadInstructionsModal-DBWRpG-q.js","assets/SheetModal-CT4I1FwL.js","assets/CollectionSelectModal-Dnx1hIwa.js","assets/OnboardingModal-11-eSP6q.js","assets/CombinedPaywall-Czk2gkkl.js","assets/useNavigateToPayment-C9oE1y3-.js","assets/usePersistentPromoCode-DSlcpp-K.js","assets/enterpriseTiers-C7ko_dqp.js","assets/tierContent-BLBmi90N.js","assets/useUserPreviousSubscriptionQuery-DJrt5kvC.js","assets/USDSpan-xP72Jd1w.js","assets/MarkSpinner-Hdt8Lk_P.js","assets/phoneNumberUtils-BDcRU5bn.js","assets/IntlPhoneInput-IZ2-8rLJ.js","assets/IntlPhoneInput-C5Iq5FTb.css","assets/AppDownloadQRSkeleton-C17OF41p.js","assets/useStudentReferralRewards-C72auek4.js","assets/shared-BKTVuA_7.js","assets/useStudentTrialEligibility-DiTNaMOw.js","assets/StudentReferralsContent-ZDi9cM76.js","assets/PurchaseConfirmationToast-DCwXfCB7.js","assets/EntityItemImage-DM_D4W_u.js","assets/use-unmount-effect-CwjOM8ln.js","assets/ThreadLossAversionModal-B2OYxFRx.js","assets/LoginModalInner-D9SvCia9.js","assets/test-ids-eafHCGHU.js","assets/cleanQueryRedirect-ChEJWtcm.js","assets/CompanyDataPrivacyModal-CbhDlntY.js","assets/PricingTableModal-CugDLvHX.js","assets/MapModal-CRxa-ZnV.js","assets/Gallery-O-Bq7Nun.js","assets/ShoppingOnboardingModal-bhtnMnb0.js","assets/shared-qpQ0L8G5.js","assets/shoppingQueries-CgkBrRFy.js","assets/ShoppingPaymentBillingBox-C5AKRbRq.js","assets/ShoppingPaymentInnerV2-qO0dJrOC.js","assets/react-stripe.esm-myx5NJdk.js","assets/useStripePromise-CTEpLGm_.js","assets/useCreateSetupIntentAndCustomerSession-D9yIzamy.js","assets/ShoppingQuantityRow-CPfIug1e.js","assets/Shimmer-UrAwTT63.js","assets/PurchaseDetailsModal-B9P3ml3w.js","assets/SpaceSettingsModal-C37tT37Q.js","assets/MemoryListModal-B6YFeHJx.js","assets/memoryQueries-bP8rKZN4.js","assets/MemoryDetailModal-Cz0x7afO.js","assets/HotelRoomDetailsModal-CnYWwlO3.js","assets/PaymentModal-lwcZCukl.js","assets/PaymentPage-C_919qgu.js","assets/MeetingDefaultsModal-CwkmKxKs.js","assets/AvailabilityModal-DzKBk9Ia.js","assets/ProMessageModal-CoBlFBeC.js","assets/SubSuccessModal-BQP8YCY4.js","assets/PerksList-Cb_jDmOd.js","assets/ReferralErrorModal-Dw7Cs0NQ.js","assets/ReferralSuccessModal-D_bXwVjv.js","assets/IncentiveProModal-WA50q5PW.js","assets/StudentReferralsModal-xKhJkkC9.js","assets/SheerIDModal-DEOxydlg.js","assets/BraintreeSubscriptionModal-DMCMkX0U.js","assets/RestaurantBookingModal-9XsyjsyP.js","assets/PlaceModal-daWQ7pmB.js","assets/EntityItemImageFadeCarousel-Bb6b96lb.js","assets/EntityItemReviewSummary-B-LNii_r.js","assets/ImageGallery-BboHXXq-.js","assets/ImageGallerySidebar-DXzv2-r1.js","assets/ImageGenerationUtils-DBesDuxt.js","assets/SheerIdRedirectModal-Drnyj97z.js","assets/EnterprisePremiumSecureUpgradeModal-COOXV9oP.js","assets/ShortcutModal-BYQi4lAc.js","assets/SharepointSiteModal-BEjchnjp.js","assets/SharepointSiteSelector-BJdOegq3.js","assets/MCPServerModal-BByRaphG.js","assets/MemberSetTierModal-CAwhXWS_.js","assets/MCPServiceToolsModal-0f_zDLnc.js","assets/SettingsRow-COP2OGpm.js","assets/OrgInviteModal-Ditv8VCG.js","assets/OnboardingTOSCheckbox-De-wAMnd.js","assets/useSubmitOnboardingProfile-d69I24_r.js","assets/RequestAccessModal-DXSIFSRU.js","assets/SpaceContextModal-SO-KrLF7.js","assets/LoginModal-COSzC1CN.js","assets/AnnouncementImageModal-pqZOIFHg.js","assets/FullscreenUpsellModal-CZn4Al_i.js","assets/ShoppingTryOnOnboardingModal-X9DmFFhQ.js","assets/ShoppingTryOnOnboardingComponents-DXGchqjR.js","assets/GeneratedMediaLoader-CHKBfOq3.js","assets/useTrackGeneratedAssetView-iSiPSsir.js","assets/useShoppingTryOn-CaUZ3TzZ.js","assets/CheckSourcesModal-B_93cFgV.js","assets/GmailModals-TiO0hR9e.js","assets/EmailAssistantDisconnectWarningModal-DnJK1tGv.js","assets/CalendarSelectionModal-Z1AJ_OXE.js","assets/connectorQueries-DEanPcJv.js","assets/DeleteAllMemoriesModal-CVnLcdBB.js","assets/DeleteMemoryModal-CJIndnid.js","assets/PersonalSearchSettingsMain-CB832-ot.js","assets/WatchlistModal-B-vXq55x.js","assets/AvatarManagementModal-Co2ygqU8.js","assets/useGetUserTryOnPhoto-XiI_FXAm.js","assets/InstallGateModal-sF8t2bC6.js","assets/DowngradeModal-CdY3vXv_.js","assets/PlanDisplay-EcoyelS2.js","assets/UpgradeModal-BCjLeS8I.js","assets/SubModalButton-kDwXG15V.js","assets/KeyboardShortcutHelperModal-DLqN6rlz.js","assets/KeyboardShortcutEditorModal-DXad0cI3.js","assets/AskPermissionsModal-DLjsg8Od.js","assets/DebugStreamSideEffects-DuVqhbJP.js","assets/DebugDisplay-CZVQU7PW.js","assets/_restricted/restricted-feature-debug-D3x5lJcJ.js","assets/RenderToolbar-C5ynPNuq.js","assets/DebugModeActivator-CtinMZPC.js","assets/UberOnePromoBanner-BLqN5RUP.js","assets/SiteBanner-BQE_ptMF.js","assets/DiscountCodeBanner-Bhysavsw.js","assets/PartnerBanner-Do89sQrD.js","assets/OrgBillingBanner-DeY0r0em.js","assets/useOrgBilling-BhVjeC44.js","assets/OrgInvitationBanner-DCWi9huO.js","assets/AppBannerUpsell-BnwL8F-o.js","assets/CometDownloadBannerUpsell-CRT87q6N.js","assets/MobileSidebar-hLO3FIYJ.js","assets/MicrosoftFilePickerModal-BXFn4rPd.js","assets/BoxFilePickerModal-EAoF4aIB.js","assets/MentionsPlugin-BVJrrw2Q.js","assets/AutoLinkPlugin-cSWPmotH.js","assets/LinkPlugin-DFP_8rAL.js","assets/ConnectorsEnableModal-CUStDn-Z.js","assets/VoiceToVoiceModal-BqYk1RoR.js","assets/VoiceToVoiceTopControls-CX0XHXuR.js","assets/useVoiceViewState-CZoJuH0Z.js","assets/three-S-EeQeNm.js","assets/index-kR08Osiu.js","assets/SidePDFViewer-B5_L2N0Y.js","assets/SearchSideContent-Rrb7hudg.js","assets/SideMeetingTranscriptViewer-BEF17i8w.js","assets/SlideConverter-o123-qAo.js","assets/pptxgen.es-RTyDt0G5.js","assets/abap-BiKYM7nu.js","assets/abnf-8KHBl4SU.js","assets/actionscript-BDfgnI_2.js","assets/ada-pT0wE1jT.js","assets/agda-BVgYyS_B.js","assets/al-DYI_knPF.js","assets/antlr4-Dcs8y6-e.js","assets/apacheconf-BeuGc_UW.js","assets/apex-C46QKnqF.js","assets/sql-CJATM1Qp.js","assets/apl-D3CFL3-O.js","assets/applescript-UKM8t7IT.js","assets/aql-JdJXKSA1.js","assets/arduino-Cgk25tM9.js","assets/cpp-BdJVwJpi.js","assets/c-kgVuzdLE.js","assets/arff-BvtRHTjx.js","assets/asciidoc-hH46k-cj.js","assets/asm6502-Ce01JAP9.js","assets/asmatmel-73kokPNV.js","assets/aspnet-DSiaQID1.js","assets/csharp-Cd5Udg29.js","assets/autohotkey-B_uQtKf0.js","assets/autoit-EdcKUAIu.js","assets/avisynth-B5LB8Vdx.js","assets/avro-idl-DFr56LZ2.js","assets/bash-DmK8JH5Y.js","assets/bash-CefCgV5_.js","assets/basic-GQNZVm0I.js","assets/basic-DBS9NaGG.js","assets/batch-q5qLUxNp.js","assets/bbcode-DIQpPCpQ.js","assets/bicep-43qgYCRB.js","assets/birb-WL4Wzs1I.js","assets/bison-DgNGY4MZ.js","assets/bnf-CwU415oh.js","assets/brainfuck-BRUtMqwa.js","assets/brightscript-CvEhDk7S.js","assets/bro-CqltG-l9.js","assets/bsl-DUqbypHr.js","assets/c-N_EB2bYK.js","assets/cfscript-CeuFWGtU.js","assets/chaiscript-YpFdQwm4.js","assets/cil-BTpaFQxw.js","assets/clike-C0ZDHdrY.js","assets/clike-B5tY_8Hg.js","assets/clojure-nHglC_Wr.js","assets/cmake-CkGrNXqP.js","assets/cobol-CpeWJsGx.js","assets/coffeescript-BmyGALDp.js","assets/concurnas-AGPXgTy3.js","assets/coq-B1vh1X6h.js","assets/cpp-BrdR8lzA.js","assets/crystal-DMB1xqN1.js","assets/ruby-DYsn9XfW.js","assets/csharp-Dz-Duhoj.js","assets/cshtml-Dao_x5sm.js","assets/csp-rN0ct5mE.js","assets/css-extras-CH38hCE0.js","assets/css-C3pUjfuw.js","assets/css-CF9HHZb0.js","assets/csv-CMjGkfuc.js","assets/cypher-BSXied6R.js","assets/d-7giuCMwV.js","assets/dart-f2r0fR5P.js","assets/dataweave-BNTQwt_0.js","assets/dax-9u0VVHGx.js","assets/dhall-BnOlrm1O.js","assets/diff-CbyOnxIb.js","assets/django-BoROLrA7.js","assets/markup-templating-BxAVv-bL.js","assets/dns-zone-file-BZz70gag.js","assets/docker-DDluW8dt.js","assets/dot-qujU4Da1.js","assets/ebnf-CcQ_JImo.js","assets/editorconfig-BbwhooPy.js","assets/eiffel-B3J5PQxF.js","assets/ejs-W0BSwUjI.js","assets/elixir-DP_8UBXK.js","assets/elm-iqtDCABP.js","assets/erb-deIh2UEF.js","assets/erlang-4tX_bnUx.js","assets/etlua-CWJxZlBl.js","assets/lua-DER4jxlW.js","assets/excel-formula-BQj21DBh.js","assets/factor-BH7igz5o.js","assets/false-Qh-wnXyD.js","assets/firestore-security-rules-CKhRlNBp.js","assets/flow-DJdu3gfB.js","assets/fortran-BHu4hUHY.js","assets/fsharp-BiNyUor_.js","assets/ftl-D6bVz-y_.js","assets/gap-DjhzPH1Z.js","assets/gcode-DJBtEOur.js","assets/gdscript-C_X-7y6o.js","assets/gedcom-CH5a7-zs.js","assets/gherkin-CLD9Z44w.js","assets/git-DirbeLrE.js","assets/glsl-DwU_K1Bf.js","assets/gml-CQQxmZvv.js","assets/gn-wrWPxerG.js","assets/go-module-CjFP3WFY.js","assets/go-ZYzi8OLl.js","assets/graphql-BcLwhGtH.js","assets/groovy-DumHeXpg.js","assets/haml-CqSzOsbr.js","assets/handlebars-Bry2_rsG.js","assets/haskell-yUNIp-7d.js","assets/haskell-Ds42Eazu.js","assets/haxe-Dp4DyQmv.js","assets/hcl-B5qkLEyl.js","assets/hlsl-DrSY44_J.js","assets/hoon-CkQC4q2d.js","assets/hpkp-riVsYbz6.js","assets/hsts-DpYC61yC.js","assets/http-Dx-uCaT1.js","assets/ichigojam-B7XQrlmu.js","assets/icon-fmySfNA1.js","assets/icu-message-format-Oq1AuWLS.js","assets/idris-BBQY5hR_.js","assets/iecst-BXBc121A.js","assets/ignore-Btt-DzVm.js","assets/inform7-BOWBWzGd.js","assets/ini--jhBb2pg.js","assets/io-D2xfJyua.js","assets/j-DzsdI1Bx.js","assets/java-s-m7kerV.js","assets/java-BxMbkJZ_.js","assets/javadoc-BjkiGsEF.js","assets/javadoclike-myFApC35.js","assets/javadoclike-DCDpBfFy.js","assets/javascript-C5bRWOCC.js","assets/javascript-D8vYUPHd.js","assets/javastacktrace-D8SvwBYG.js","assets/jexl-CuibVysa.js","assets/jolie-G2r1IH4x.js","assets/jq-CSp-T5V6.js","assets/js-extras-DzfpmWre.js","assets/js-templates-deUmuJZ-.js","assets/jsdoc-CzzeaHoB.js","assets/typescript-CVO-8GEc.js","assets/json-DkUPYY4u.js","assets/json-BESjz4hO.js","assets/json5-kaAIKBom.js","assets/jsonp-NFZGtYU-.js","assets/jsstacktrace-z4GMPjy-.js","assets/jsx-CHRn7QrA.js","assets/jsx-CWP8P1mH.js","assets/julia-CtD-2MpL.js","assets/keepalived-CFt0jL3j.js","assets/keyman-B9DoVDwq.js","assets/kotlin-Dq-NDvL5.js","assets/kumir-CJqEisv6.js","assets/kusto-BgQKkaWx.js","assets/latex-BT8SOs-A.js","assets/latte-C8JT4Qb7.js","assets/php-iTdQntIy.js","assets/less-BD_NHSLb.js","assets/lilypond-AQaE6Na0.js","assets/scheme-Cscf027c.js","assets/liquid-y7RSJ3Wl.js","assets/lisp-BC_0scWg.js","assets/livescript-iy-NHZ_h.js","assets/llvm-BfiEgsxO.js","assets/log-cps16LLM.js","assets/lolcode-3zmtClDS.js","assets/lua-DI565xS0.js","assets/magma-ba7Qn7K1.js","assets/makefile-BqSQ4nmN.js","assets/markdown-Cze8MKhj.js","assets/markup-templating-C-QmJhjg.js","assets/markup-Dt-xKA80.js","assets/markup-BONeskWm.js","assets/matlab-CacUYSDq.js","assets/maxscript-Cm15dTB4.js","assets/mel-BFRmaBUW.js","assets/mermaid-_TlUmfQf.js","assets/mizar-BoN7zgqH.js","assets/mongodb-Do1oT-rg.js","assets/monkey-DS3nr7fk.js","assets/moonscript-Cwqh5x__.js","assets/n1ql-BgI_6bQf.js","assets/n4js-oXh14UQA.js","assets/nand2tetris-hdl-CGF6E--X.js","assets/naniscript-Dv0ErN1f.js","assets/nasm-CdhriaSD.js","assets/neon-6Qw1Wpr8.js","assets/nevod-Do308_dN.js","assets/nginx-CioVUANG.js","assets/nim-BiZFPqzz.js","assets/nix-DLWyfiVz.js","assets/nsis-B_mA8Mf4.js","assets/objectivec-CFn4OO_F.js","assets/ocaml-B365KzYr.js","assets/opencl-CPm34rhj.js","assets/openqasm-CDj9ArmH.js","assets/oz-BYXLbj-G.js","assets/parigp-D0QktAhQ.js","assets/parser-qO2_EI6v.js","assets/pascal-De5eNwWX.js","assets/pascaligo-Bf8O7ebQ.js","assets/pcaxis-BcwaB2L7.js","assets/peoplecode-Dk2Gnb3n.js","assets/perl-DRKm4LVK.js","assets/php-extras-DBoPtocT.js","assets/php-BSKv2GXV.js","assets/phpdoc-BJjHK9Yc.js","assets/plsql-Bb_hLNuA.js","assets/powerquery-C5qk80xF.js","assets/powershell-BG0DpRp-.js","assets/processing-w7DFlyH_.js","assets/prolog-B2BVxulM.js","assets/promql-B3KvaVJb.js","assets/properties-BE8Ews0J.js","assets/protobuf-CBHBbdUG.js","assets/psl-aD6jMMeP.js","assets/pug-DI-93Lan.js","assets/puppet-DxN-4n9f.js","assets/pure-_2x0TJjK.js","assets/purebasic-C8Ir77ii.js","assets/purescript-DWCP7Rhr.js","assets/python-B3k5tM49.js","assets/q-LJLqXf0_.js","assets/qml-DgsxaMQP.js","assets/qore-DumyY0ow.js","assets/qsharp-ClAsZa-1.js","assets/r-DHwkVKGw.js","assets/racket-DcBksMCk.js","assets/reason-BXtuBfki.js","assets/regex-Bmn5L_4e.js","assets/rego-CZsdWqMW.js","assets/renpy-XPjsxRDO.js","assets/rest-DD2JcNUu.js","assets/rip-B2ScZnvu.js","assets/roboconf-XMvWjvgI.js","assets/robotframework-BivGgTMI.js","assets/ruby-DQG1k7eY.js","assets/rust-CY08bKn6.js","assets/sas-1PTlKbzw.js","assets/sass-RllDMjGg.js","assets/scala-D1OpbE39.js","assets/scheme-BbtNtDr-.js","assets/scss-DgCxV9gf.js","assets/shell-session-1LvomK4i.js","assets/smali-CXX5Nw4b.js","assets/smalltalk-CkWNQdr2.js","assets/smarty-D9yobX_8.js","assets/sml-CtZ57qc6.js","assets/solidity-CkABSbax.js","assets/solution-file-K7E94G8T.js","assets/soy-CiMQleff.js","assets/sparql-B28RxTei.js","assets/turtle-Ro1R6Je7.js","assets/splunk-spl-w0Cel-ic.js","assets/sqf-BBYZJCt5.js","assets/sql-CwRJh8Sp.js","assets/squirrel-CEzvQBK5.js","assets/stan-S3CZTrL_.js","assets/stylus-BG4_ZnaL.js","assets/swift-ByheDo_6.js","assets/systemd-6CBk_Ow2.js","assets/t4-cs-DHZvgPUG.js","assets/t4-templating-B5EzSFYT.js","assets/t4-templating-DUeWWaCj.js","assets/t4-vb-B_6qRhT8.js","assets/vbnet-BhrUc4aD.js","assets/tap-DjTT3CuE.js","assets/yaml-pHjxJgpq.js","assets/tcl-BM9U6SkZ.js","assets/textile-XOvB5RBz.js","assets/toml-BO0aGyy4.js","assets/tremor-Bk9M5xQH.js","assets/tsx-BcjbSAGh.js","assets/tt2-BHaQqFiG.js","assets/turtle-CdxJK1CJ.js","assets/twig-CxFOkn0v.js","assets/typescript-CVqiKcu1.js","assets/typoscript-spRf2Ox1.js","assets/unrealscript-D2PIC4ZQ.js","assets/uorazor-xrDEXG6p.js","assets/uri-CwPh3EwT.js","assets/v-CJIzMR4B.js","assets/vala-WpTbVsFT.js","assets/vbnet-UNQqH4vF.js","assets/velocity-DsPfPeeX.js","assets/verilog-NpK4_zqq.js","assets/vhdl-DiFKlg1X.js","assets/vim-SyhS9sNH.js","assets/visual-basic-DSiTvEtK.js","assets/warpscript-CTRBwGjg.js","assets/wasm-CBCDYs2M.js","assets/web-idl-BfdeEL3H.js","assets/wiki-CouGhrmq.js","assets/wolfram-CejGEkud.js","assets/wren-BTo1kC3F.js","assets/xeora-mFujPPPh.js","assets/xml-doc-DpZbWR7e.js","assets/xojo-C9xNSycu.js","assets/xquery-C7CsuD6b.js","assets/yaml-DxQv1G_M.js","assets/yang-BXpPxQeP.js","assets/zig-KxZlFBGb.js","assets/core-ChuWtB-i.js","assets/CitationModal-xGSoPI-X.js","assets/GroupedCitationModal-fX8EbFKD.js","assets/index-D3QwY6q7.js","assets/katex-CmGQIWW6.js","assets/katex-DIrX_gBg.css","assets/AnimatedWorkflowHeader-BTftkQn2.js","assets/ProgressHeader-DPfao__N.js","assets/FinanceScreenshotBuilderModal-D6XaL_R6.js","assets/HourlyTemperature-tAkrBajN.js","assets/index-BeHSIIJJ.js","assets/ConnectorAuthorizationPrompt-BPug_Ihh.js","assets/ThreadEntryFooter-CtAVhJnA.js","assets/StructuredAnswerInlineBlock-VE6UCq82.js","assets/useFailedImagesStore-BMqPnEKZ.js","assets/CarouselPrimitives-BnyJSL-4.js","assets/useShoppingWidget-CzJ9HY-C.js","assets/useInViewEffect-BVcyohMu.js","assets/TimeAgoTooltip-Bdo7TVS7.js","assets/useUpdateThreadAccess-c7p0V5Qu.js","assets/Related-Dwf5MNnK.js","assets/RelatedQueryList-DPyA4iUo.js","assets/index-BJ7BuCsS.js","assets/StudyModeRelated-DzWz27K7.js","assets/ThreadContentResponse-DsqMwMTf.js","assets/AnswerComparisonModal-BGcMfXsd.js","assets/ThreadEntryDebugTiming-MjQ6oliY.js","assets/DebugModal-Doimq5Wl.js","assets/ShoppingMode-bLl6K_BC.js","assets/useGenerativeRefinement-DfZVdIHh.js","assets/ModesNullState-Bi8kzRXh.js","assets/HotelsMode-0lP3cqJK.js","assets/SharedAnswerModeMap-B75Zy4hD.js","assets/JobsMode-BLsZFsP8.js","assets/VideosMode-LCMQNgtx.js","assets/useMediaSearch-8IDXLus-.js","assets/ImagesMode-TKrgDVir.js","assets/MapsMode-DN82XtAo.js","assets/AssetsMode-CtABsBZo.js","assets/VoiceToVoiceContent-PkkJnLa8.js","assets/VoiceToVoiceFloating-Dsg0wzwC.js"])))=>i.map(i=>d[i]); -import{g as hr,P as NU,C as Lfe,e as Wa,l as Z,R as xn,n as Ffe,p as y7,r as zt,f as Bfe,h as mn,j as x7,k as Ufe,m as RU,o as Ll,q as DU,t as Qp,v as lo,w as Ln,S as _a,x as jU,y as Vfe,z as v7,A as WS,B as wt,D as td,E as IU,$ as Vi,G as Dn,H as Hfe,I as zfe,M as Wfe,J as Ie,c as Ft,K as Se,N as Ee,O as Gfe,Q as PU,F as OU,T as $fe,u as Qi,U as qfe,V as Wc,W as Hi,X as iu,L as xt,Y as Hn,Z as Kfe,_ as Yfe,a0 as Vy,a1 as Qfe,a2 as Xfe,a3 as Zfe,a4 as Jfe,a5 as eme,a6 as tme,a7 as nme,a8 as rme,a9 as sme,aa as b7,ab as _7,ac as ome,ad as ame,ae as w7,af as C7,ag as LU,ah as ime,ai as fM,aj as lme,ak as S7,al as cme,am as ume,an as dme,ao as FU,ap as BU,aq as nd,ar as fme,as as UU,at as mme,a as pme,au as hme,av as gme,aw as R0,ax as yme,ay as E7,b as xme,az as vme}from"./platform-BFHE8Ozi.js";import{R as T,r as d,m as Sf,j as l,q as Ef,n as Er,v as Xi,u as bme,a as mM,_ as kr,c as We,o as Ro,w as _me,x as wme,y as Cme,z as Sme,A as k7,d as z,e as qh,b as VU,h as HU,B as zU,C as Eme,t as hx,D as kme,E as no,F as Hy,G as Kh,H as Yh,l as Mme,I as vd,J as M7,K as Tme}from"./vendors-Uf9WzPBH.js";import{_ as q,g as uo,c as rd,a as Qh}from"./vite-5mULU2Sf.js";import{A as ye,u as gt,Q as be,k as $l,a as Xt,b as It,c as WU,d as pM,e as GU,P as Ame,f as Nme}from"./react-query-IUEyoar6.js";import{c as Rme,_ as Dme,S as jme,u as on,i as $U,M as Ime,a as Pme,b as ql,E as Ar,r as Do,s as Ome,R as qU,P as Lme,C as Fme,A as Bme,T as Ume,I as Jt,d as gx,e as Vme,G as Hme,f as Vs,g as En,h as Xp,j as Js,k as Mt,l as ls,m as nt,n as fo,o as kf,p as yx,q as xx,t as Hr,v as vx,w as Gc,D as bx,x as hM,y as zme,z as gM,B as jo,L as GS,F as _x,H as wa,J as Hs,K as wx,N as yM,O as Vo,Q as Wme,U as Gme,V as KU,W as Ct,X as $me,Y as qme,Z as D0,$ as Kme,a0 as Yme,a1 as xM,a2 as YU,a3 as Qme,a4 as QU,a5 as XU,a6 as Xme,a7 as ZU,a8 as Zme,a9 as Jme,aa as epe,ab as tpe,ac as T7,ad as npe,ae as Xh,af as JU,ag as rpe,ah as spe,ai as ope,aj as vM,ak as eV,al as ape,am as ipe,an as lpe,ao as cpe}from"./platform-components-CfpzMod3.js";import{g as tV,D as bM,u as J,d as Ue,a as $S,b as upe,f as nV,c as W,e as dpe,S as x_,s as fpe,h as mpe,M as Ne,F as v_,i as A7,j as N7,k as ppe,l as qS,m as hpe,n as R7}from"./i18n-Ex1XiscZ.js";import{a as gpe,b as _M,d as wM,e as ype,$ as B,I as ft,L as hl,T as ge,f as xpe,g as CM,h as Zh,i as vpe,j as bpe,c as li,k as rV,l as _pe,m as wpe,n as Cpe,o as SM,p as sV,q as Spe,r as Epe,s as oV,t as aV,u as D7,v as kpe,w as Mpe,x as Tpe,y as Ape,z as Npe,A as Rpe,B as Dpe,C as jpe,D as Ipe,E as Ppe,F as Ope,G as Lpe,H as Fpe,J as Bpe,K as Upe,M as j7,N as I7,O as Vpe,P as iV,Q as Hpe,R as P7}from"./icons-lm0x-2iG.js";import{p as zpe,u as Wpe,A as Gpe,R as lV,L as $pe,j as qpe,a as Kpe,T as gl,I as KS,Z as YS,e as b_,K as bm,t as _m,E as Ta,b as Aa,c as O7,f as __,d as w_,g as vi,y as Ype,m as Qpe,h as Xpe,i as Zpe,k as L7,_ as Jpe,l as F7,n as B7,o as wm,q as U7,w as V7,P as ehe,r as the,s as nhe,S as H7,x as z7,v as rhe,z as she,B as ohe,D as ahe,C as ihe,F as lhe,G as che,H as uhe,M as dhe,J as fhe,N as mhe,O as phe,Q as hhe}from"./lexical-D_7aXiGd.js";import"./mapbox-gl-BYD-OPEL.js";(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 o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const ghe=["grey","teal","brown","maroon","red","orange","gold","yellow","green","blue","purple"],cV=e=>{if(!e)return null;try{const n=JSON.parse(e)?.name;if(n&&ghe.includes(n))return n}catch{}return null};function yhe(){const e=hr("colorSchemeTheme"),t=hr("colorScheme"),n=cV(e);n&&(document.documentElement.dataset.theme=n),t&&(document.documentElement.dataset.colorScheme=t)}yhe();const xhe=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,uV=T.memo(()=>(d.useEffect(()=>{const e=t=>{t.ctrlKey&&t.preventDefault()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}},[]),null));uV.displayName="ZoomPreventer";const Sn={DEFAULT:1250,LOW:2500,MEDIUM:5e3,HIGH:1e4,VERY_HIGH:3e4,EXTREMELY_HIGH:9e4,NONE:0},Kl=2,Ze=e=>{const t=e?.productionMs??Sn.DEFAULT;e?.devMs??Sn.HIGH;const n=e?.clientSideMs??Sn.MEDIUM;return typeof window<"u"?n:t};function vhe(e){return Rme(e)}const de=Dme(vhe);class j0{static getItem(t){try{return window.localStorage.getItem(t)}catch{return null}}static setItem(t,n){try{return window.localStorage.setItem(t,n),!0}catch{return!1}}}function je(){const e=d.useContext(jme);if(!e)throw new Error("useSession must be used within a SessionProvider");return e}class kc extends NU{name="CometError"}const Cm={SELECTED:"SELECTED",REVIEWED:"REVIEWED",REVIEWING:"REVIEWING",UNSORTED:"UNSORTED"},C_={HISTORY:"HISTORY",OPEN_TABS:"OPEN_TABS",RECENTLY_CLOSED_TABS:"RECENTLY_CLOSED_TABS"},bd={COPILOT:"COPILOT",ARTICLE:"ARTICLE",NOTEPAD:"NOTEPAD"},dV={MEETING_TRANSCRIPT:"MEETING_TRANSCRIPT"},Qs={LOGIN:"LOGIN",OPEN_PERMALINK:"OPEN_PERMALINK",DOWNLOAD_COMET:"DOWNLOAD_COMET",CREATE_SHORTCUT:"CREATE_SHORTCUT",UPGRADE_TO_ENTERPRISE:"UPGRADE_TO_ENTERPRISE",WAIT_FOR_CANVAS_GENERATION_CONFIRMATION:"WAIT_FOR_CANVAS_GENERATION_CONFIRMATION",WAIT_FOR_BROWSER_AGENT_CONFIRMATION:"WAIT_FOR_BROWSER_AGENT_CONFIRMATION",DAILY_QUESTIONS_FEATURE_ENTRYPOINTS:"DAILY_QUESTIONS_FEATURE_ENTRYPOINTS"},Ns={IN_THREAD:"IN_THREAD",SIDEBAR:"SIDEBAR",MODAL:"MODAL",IN_THREAD_BOTTOM:"IN_THREAD_BOTTOM",IN_THREAD_INPUT:"IN_THREAD_INPUT",SIDE_CARD:"SIDE_CARD",BANNER:"BANNER",COMET_NTP_BANNER:"COMET_NTP_BANNER"},nn={PRO_UPGRADE:"PRO_UPGRADE",SIGN_UP_OR_LOGIN:"SIGN_UP_OR_LOGIN",REWRITE_ANSWER:"REWRITE_ANSWER",PERMALINK:"PERMALINK",CONNECTOR:"CONNECTOR",THREAD_TO_SPACE:"THREAD_TO_SPACE",SET_DEFAULT_BROWSER:"SET_DEFAULT_BROWSER",COMET_DOWNLOAD:"COMET_DOWNLOAD",IMAGE_ANNOUNCEMENT_MODAL:"IMAGE_ANNOUNCEMENT_MODAL",MERGE_AUTH_CONNECTOR:"MERGE_AUTH_CONNECTOR",SHORTCUT_MODAL:"SHORTCUT_MODAL",OPEN_SHEERID_MODAL:"OPEN_SHEERID_MODAL",CONTINUE_GENERATION:"CONTINUE_GENERATION",NO_CANVAS_GENERATION:"NO_CANVAS_GENERATION",SKIP_BROWSER_AGENT:"SKIP_BROWSER_AGENT",ALLOW_BROWSER_AGENT_ONCE:"ALLOW_BROWSER_AGENT_ONCE",ALWAYS_ALLOW_BROWSER_AGENT:"ALWAYS_ALLOW_BROWSER_AGENT",LANGUAGE_LEARNING_FLASHCARDS:"LANGUAGE_LEARNING_FLASHCARDS",LANGUAGE_LEARNING_VOICE_TUTOR:"LANGUAGE_LEARNING_VOICE_TUTOR",VIRTUAL_TRY_ON_ONBOARDING_MODAL:"VIRTUAL_TRY_ON_ONBOARDING_MODAL",COMET_DOWNLOAD_1MO_PRO_INCENTIVE:"COMET_DOWNLOAD_1MO_PRO_INCENTIVE",TOGGLE_SOURCES:"TOGGLE_SOURCES",FULLSCREEN_MODAL:"FULLSCREEN_MODAL",ALLOW_CONNECTOR_AUTH:"ALLOW_CONNECTOR_AUTH"},Sm={PRIMARY_COLOR:"PRIMARY_COLOR",SECONDARY_COLOR:"SECONDARY_COLOR",MAX_COLOR:"MAX_COLOR",INVERTED:"INVERTED"},Pr={STATUS_UNSPECIFIED:"STATUS_UNSPECIFIED",PENDING:"PENDING",COMPLETED:"COMPLETED",FAILED:"FAILED",STAGED:"STAGED",REWRITING:"REWRITING",RESUMING:"RESUMING",BLOCKED:"BLOCKED"},QS={NONE:"NONE",INCOGNITO:"INCOGNITO"},oxt={FULL:"FULL",STREAMING:"STREAMING"},ta={IN_PROGRESS:"IN_PROGRESS",DONE:"DONE"},axt={FINANCE:"FINANCE"},ixt={CALENDAR_EVENT:"CALENDAR_EVENT",PLACE_CARD:"PLACE_CARD",SHOPPING_CARD:"SHOPPING_CARD",CALENDAR_ACTION:"CALENDAR_ACTION",MOVIE_TV_CARD:"MOVIE_TV_CARD",BROWSER_AGENT_CONFIRMATION:"BROWSER_AGENT_CONFIRMATION"},la={SELECTION_STATUS_UNSPECIFIED:"SELECTION_STATUS_UNSPECIFIED",UNSELECTED:"UNSELECTED",SELECTED:"SELECTED",TIE:"TIE"},hs={ANSWER_MODE_TYPE_UNSPECIFIED:"ANSWER_MODE_TYPE_UNSPECIFIED",HOTELS:"HOTELS",SHOPPING:"SHOPPING",JOBS:"JOBS",IMAGE:"IMAGE",VIDEO:"VIDEO",ANSWER:"ANSWER",SOURCES:"SOURCES",MAPS:"MAPS",ASSETS:"ASSETS",APPS:"APPS",SEARCH:"SEARCH",CHAT:"CHAT"},at={CODE_ASSET:"CODE_ASSET",CHART:"CHART",CODE_FILE:"CODE_FILE",APP:"APP",GENERATED_IMAGE:"GENERATED_IMAGE",GENERATED_VIDEO:"GENERATED_VIDEO",PDF_FILE:"PDF_FILE",SLIDES:"SLIDES",DOCX_FILE:"DOCX_FILE",XLSX_FILE:"XLSX_FILE",QUIZ:"QUIZ",FLASHCARDS:"FLASHCARDS",DOC_FILE:"DOC_FILE"},bhe={MCP_SERVER_TYPE_LOCAL:"MCP_SERVER_TYPE_LOCAL"},lxt={PENDING:"PENDING"},S_={BROWSER_HISTORY:"BROWSER_HISTORY",OPEN_TAB:"OPEN_TAB",RECENTLY_CLOSED_TAB:"RECENTLY_CLOSED_TAB"};function EM(){const e=Us();return e?!e.device_id:!1}function Nn(){return!!(Us()&&!EM())}function Io(){const e=Us();return!!(e?.android_version||e?.ios_version)}function fV(){const e=hr(Lfe);if(e)try{return JSON.parse(e)}catch{return}}const Us=Sf(fV,()=>Math.floor(Date.now()/(6*1e4))),_he=(e,t="selected_by_user_text")=>e?` -<${t}> -${new Date(e.timestamp).toLocaleString()} -${e.text} -`:"",whe=(e,t,n,r)=>{if(!e)return[];const s=t.actions.getUserSelection(),o=_he(s),a=[];if(n.status==="fulfilled"){const i=n.value?.contents||(n.value?.content?[n.value.content]:[]);for(const{markdown:c="",url:u="",title:f="",og_meta:m={},pdp_data:p,id:h}of i){const g=o;a.push({content:[c.slice(0,r-g.length)+g],url:u,title:f,content_type:"markdown",content_origin:"current_tab",og_title:m?.title,og_description:m?.description,pdp_data:p,tab_id:String(h)})}}else a.push({content:[],url:t.sidecarSourceTab.url,title:t.sidecarSourceTab.title,tab_id:String(t.sidecarSourceTab.tabId),content_type:"markdown",content_origin:"current_tab"}),t.sidecarSourceTab.secondaryTab&&a.push({content:[],url:t.sidecarSourceTab.secondaryTab.url,title:t.sidecarSourceTab.secondaryTab.title,tab_id:String(t.sidecarSourceTab.secondaryTab.tabId),content_type:"markdown",content_origin:"current_tab"});return a},Che=(e,t,n)=>{const r=[];return e.forEach(s=>{const o=t.status==="fulfilled"&&t.value.contents?.find(a=>a.id===s.id);if(!o){r.push({tab_id:String(s.id),content:[],url:s.url,title:"",content_type:"markdown",content_origin:"open_tab"});return}r.push({tab_id:String(o.id),content:[(o.markdown??"").slice(0,n)],url:o.url??"",title:o.title??"",content_type:"markdown",content_origin:"open_tab",og_title:o.og_meta?.title,og_description:o.og_meta?.description,pdp_data:o.pdp_data})}),r},She=e=>e.map(({url:t,title:n,snippet:r,site_name:s,sitelinks:o})=>({url:t,title:n,snippet:r,is_navigational:!0,site_name:s??null,sitelinks:o?.map(({title:a,url:i,snippet:c})=>({title:a,url:i,snippet:c??null}))??null})),mV=async({clientPayloadCacheKey:e,cometBrowser:t,maxChars:n,includeSidecar:r,attachedTabs:s,reason:o,cometState:a,requestId:i,navigationResults:c=[]})=>{if(!t)return;const u=[],f=new Set,m=Us(),p={contextType:"runtime",queryContextTimeMs:0,processContextTimeMs:0,getNavigationItemsTimeMs:null,filteredItemsCount:null,version:m.browser_version,mainExtVersion:m.agent_extension_version},h=Wa({context_type:p?.contextType,browser_version:p?.version,main_ext_version:p?.mainExtVersion,content_type:p?.contentType});try{Z.info("fetching sidecar context",{request_id:i});const[g,y]=await Promise.allSettled([r?t.GetSidecarContext({key:e,request_id:i}):Promise.resolve(void 0),s.length?t.GetContent({key:e,pages:[...s],request_id:i}):Promise.resolve({contents:[]})]);whe(r,a,g,n).forEach(_=>{const w=_.tab_id??"-1";f.has(w)||(f.add(w),u.push(_))}),s.length&&Che(s,y,n).forEach(w=>{const S=w.tab_id??"-1";f.has(S)||(f.add(S),u.push(w))}),p.queryContextTimeMs=performance.now()-h.getStartTimeFromTimeOrigin(),Z.info("sending sidecar context",{request_id:i});const{error:v,response:b}=await de.POST("/rest/browser/client_payload",o,{backOffTime:100,numRetries:2,timeoutMs:Sn.HIGH,body:{client_payload_cache_key:e,client_context:u||[],...c.length>0&&{client_search_results:She(c)},metadata:p},headers:{[xn]:i}});if(h.addTiming("browser.client_context.overall_time_ms"),v)throw new ye("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:e},cause:v,status:b.status??0})}catch(g){Z.error("Error sending client payload for cache key ",e,g,{request_id:i})}},Ehe=async({url:e,cometBrowser:t,stepUuid:n,extraHeaders:r,reason:s})=>{const o=t.openTab({url:e,key:n,request_id:r[xn]});await Ti(o,n,r,s)},X1=async(e,t,n)=>{try{const{error:r,response:s}=await de.POST("/rest/browser/tool_failure",n,{body:{client_payload_cache_key:e.clientPayloadCacheKey,error_type:e.errorType,error_msg:e.errorMsg},backOffTime:100,numRetries:2,headers:t,timeoutMs:Sn.MEDIUM});if(r)throw new ye("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:e.clientPayloadCacheKey},cause:r,status:s.status??0})}catch(r){Z.error("Error while sending a failure of tool",r,{request_id:t[xn]})}},Ti=async(e,t,n,r)=>{try{const s=await e,{error:o,response:a}=await de.POST("/rest/browser/tool_result",r,{body:{client_payload_cache_key:t,payload:s},backOffTime:100,numRetries:2,headers:n,timeoutMs:Sn.MEDIUM});if(o)throw new ye("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:t},cause:o,status:a.status??0})}catch(s){const a=s&&s.message||`sendToolResult error: ${s}`,i="errorType"in s?s:{errorType:"unhandled",errorMsg:a};return Z.error("Error while sending tool result",i.errorType,i.errorMsg,{request_id:n[xn]}),X1({clientPayloadCacheKey:t,...i},n,r)}},XS={red:"red",maroon:"blue",orange:"cyan",teal:"green",grey:"grey",brown:"orange",green:"pink",gold:"purple",purple:"red",blue:"yellow"},W7=Object.fromEntries(Object.entries(XS).map(([e,t])=>[t,e])),pV=e=>W7[e]??W7.grey;async function khe(e,t,n,r,s){const o=Promise.allSettled(e.map(async a=>t.groupTabs({tabIds:a.tab_ids,collapsed:a.collapsed,color:XS[a.color]??XS.grey,groupId:a.group_id,title:a.title},n,r[xn]??"unknown"))).then(a=>({groups:a.map(i=>{if(i.status=="fulfilled"&&i.value.is_success)return{...i.value.tabGroup,color:pV(i.value.tabGroup.color)}}).filter(i=>i!==void 0)}));await Ti(o,n,r,s)}async function Mhe(e,t,n,r,s){const o=t.closeTabs({tabIds:e.tab_ids},n,r[xn]??"unknown");await Ti(o,n,r,s)}async function The(e,t,n,r,s){const o={[S_.OPEN_TAB]:C_.OPEN_TABS,[S_.RECENTLY_CLOSED_TAB]:C_.RECENTLY_CLOSED_TABS,[S_.BROWSER_HISTORY]:C_.HISTORY},a=e.browser_content_sources.map(c=>o[c]).filter(Boolean),i=t.SearchBrowser({closed_tabs_max_results:e.max_results,history_max_results:e.max_results,open_tabs_max_results:e.max_results,request_id:r[xn]??"unknown",key:n,queries:Array.isArray(e.queries)?[...e.queries]:[],sources:a,start_time:e.start_time?Date.now()-y7(e.start_time):void 0,end_time:e.end_time?Date.now()-y7(e.end_time):void 0});await Ti(i,n,r,s)}async function G7({result:e,key:t,reason:n}){try{await de.POST("/rest/browser/initial_history_summary",n,{body:{key:t,data:e},backOffTime:100,numRetries:2,timeoutMs:Sn.MEDIUM,headers:{"Content-Type":"application/json"}})}catch(r){Z.error("Error sending client payload for cache key ",r)}}function Ahe({entropyBrowser:e,browserHistorySummaryNumDays:t,browserHistorySummaryMaxResults:n,reason:r}){const{addTiming:s}=Wa(),o=crypto.randomUUID();return e.getInitialHistorySummary(o,t,n).then(a=>{s("web.frontend.comet_history_summary_v2"),G7({result:a,key:o,reason:r})}).catch(()=>{G7({result:{open_tabs_results:[],history_results:[],closed_tabs_results:[]},key:o,reason:r})}),o}const Nhe=async({entropyBrowser:e,url:t})=>{const n=await e.getQuickActions("get-quick-actions-for-sidecar-suggests");return n.is_success?n.buttons.map(({prompt:r})=>({query:r,image:Zp(t)})):[]},Rhe=/^\w+:\/\//;let Z1=null;const Dhe=()=>{if(!Nn()||Z1!==null)return;const e=new Image;e.onerror=()=>{Z1=!1,console.warn("[Comet] chrome://favicon/ is not supported. Using our backend as fallback.")},e.onload=()=>{Z1=!0},e.src="chrome://favicon/"},Zp=(e,t=64,n="3x")=>{if(!Z1)return`https://www.perplexity.ai/rest/browser/favicon?url=${Ffe(e)}`;const r=Rhe.test(e)?e:`https://${e}`;let s;try{s=decodeURIComponent(r)}catch{s=r}const o=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/'/g,"\\'").replace(/\s/g,"\\ ");return`chrome://favicon/size/${t}@${n}/${o}`},hp=(e,t)=>t.dxt_name?e?.find(n=>n.name===t.dxt_name)?.manifest:void 0,ro=(e,t)=>t?[e,t].sort().join("-"):e.toString(),jhe=(e,t)=>t?[ro(e,t),e.toString(),t.toString()]:[e.toString()],Ihe=["homepage_widget","comet_magic_link","comet_quick_action","comet_selection","try-assistant","comet_assistant_popup","try-assistant-onboarding","spotlight","inline-assistant"],kM=e=>e?Ihe.includes(e):!1,Phe={personal_search:!1,skip_search:!1,widget_type:"GENERAL",hide_nav:!1,image_generation:!1,time_widget:!1,hide_sources:!1,mhe_predictions:{skip_search:!1,image_generation_intent:!1,time_widget:!1,sports_intent:!1,places_search_intent:!1,shopping_intent:!1,movie_lists_intent:!1,image_preview:!1,video_preview:!1,nav_intent:!1,study_intent:!1,personal_search:!1,weather_widget:!1,finance_widget_gating:!1,calculator_widget:!1,comet_nav_widget:!1,comet_nav_widget_combined_target:!1},mhe_predictions_full:{skip_search:{is_true:!1,probability:0,threshold:0},image_generation_intent:{is_true:!1,probability:0,threshold:0},time_widget:{is_true:!1,probability:0,threshold:0},sports_intent:{is_true:!1,probability:0,threshold:0},places_search_intent:{is_true:!1,probability:0,threshold:0},shopping_intent:{is_true:!1,probability:0,threshold:0},movie_lists_intent:{is_true:!1,probability:0,threshold:0},image_preview:{is_true:!1,probability:0,threshold:0},video_preview:{is_true:!1,probability:0,threshold:0},nav_intent:{is_true:!1,probability:0,threshold:0},study_intent:{is_true:!1,probability:0,threshold:0},personal_search:{is_true:!1,probability:0,threshold:0},skip_personal_search:{is_true:!1,probability:0,threshold:0},weather_widget:{is_true:!1,probability:0,threshold:0},finance_widget_gating:{is_true:!1,probability:0,threshold:0},calculator_widget:{is_true:!1,probability:0,threshold:0},comet_nav_widget:{is_true:!1,probability:0,threshold:0},comet_nav_widget_combined_target:{is_true:!1,probability:0,threshold:0}}},MM=600,Ohe=async(e,t=MM)=>{const{data:n}=await de.POST("/rest/browser/classify","mobile_search_injection",{body:{query:e},timeoutMs:t});return n?.results},hV=e=>!e.isFetching&&e.data===!1,Lhe=e=>e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button===1,gV=({adapter:e,url:t,reason:n,event:r,onError:s,onSuccess:o,tabId:a,navigationHistory:i})=>{if(!Lhe(r)){r.preventDefault();{const c=e.getStore().getState().sidecarSourceTab.tabId;Fhe({adapter:e,url:t,reason:n,tabId:c,navigationHistory:i??!0});return}}},Fhe=({adapter:e,url:t,reason:n,tabId:r,navigationHistory:s})=>{const o=async()=>{if(r===-1)return!1;try{const i=await e.openTab({tabId:r,request_id:n,url:t,navigation_history:s??!0});if(!i.is_success)return!1;const{result:c}=i;return!(c.url!==t&&!c.url?.includes(t))}catch{return!1}};(async()=>{await o()||window.open(t,"_blank")})()},Bhe=e=>{const t=e.indexOf("/search");return t!==-1?e.substring(t):e},yV="entropy",Uhe="browser_ios",Vhe="browser_android",xV=()=>{const e=Us();return e?.ios_version?Uhe:e?.android_version?Vhe:yV},$7=e=>{const t=Math.floor(e.origin.x),n=Math.floor(e.origin.y),r=Math.floor(e.size.width),s=Math.floor(e.size.height);return`${t}-${n}-${r}-${s}`};function Hhe({cometAdapter:e,urlSearchParams:t}){const n=t??new URLSearchParams(window.location.search),r=n.get("action"),s=n.get("is_editable");return r?(e.getStore().getState().actions.setInlineAssistantParams({action:r,isWritingMode:s==="true"}),!0):!1}const Gt={tiny:"tiny",small:"small",regular:"regular",large:"large",xl:"xl",none:"none"};var lt;(function(e){e.RETRY_BUTTON="retryButton",e.PRO_PAGE="proPage",e.SHARE_DROPDOWN="shareDropdown",e.PRICING_TABLE="pricingTable",e.TRY_COPILOT="tryCopilot",e.TRY_RESEARCH="tryResearch",e.TRY_LABS="tryLabs",e.PRO_HOVER_CARD_BUTTON="proHoverCardButton",e.PRO_REASONING_SELECTOR="proReasoningSelector",e.LIBRARY_PAGE="libraryPage",e.SPACES_PAGE="spacesPage",e.SPACES_LANDING="spacesLanding",e.SPACES_TEMPLATES="spacesTemplates",e.DISCOVER_TOPICS="discoverTopics",e.COLLECTIONS="collections",e.SPACES="spaces",e.THREAD_SOCIAL="threadSocial",e.MOBILE_SIGNUP="mobileSignup",e.RELATED_QUERIES="relatedQueries",e.FILE_UPLOAD="fileUpload",e.SPACES_FILE_UPLOAD="spacesFileUpload",e.TRY_PRO="tryPro",e.HOMEPAGE_FREE_PLAN_UPSELL="homepageFreePlanUpsell",e.LOGIN_BUTTON="loginButton",e.SIGNUP_BUTTON="signupButton",e.LOGIN_BUTTON_HEADER="loginButtonHeader",e.SIGNUP_BUTTON_HEADER="signupButtonHeader",e.FLOATING_SIGNUP="floatingSignup",e.SIDEBAR_LOGIN_AD="sidebarLoginAd",e.SIDEBAR_PRO_UPSELL="sidebarProUpsell",e.SIDE_TEXT_PRO_UPSELL="sideTextProUpsell",e.VISITOR_GATE="visitorGate",e.SHARED_THREAD_LOGIN_GATE="sharedThreadLoginGate",e.SHARED_THREAD_INSTALL_GATE="sharedThreadInstallGate",e.REQUEST_ACCESS_LOGIN_GATE="requestAccessLoginGate",e.GENERATE_IMAGE="generateImage",e.PPLX_API_PAGE="pplxApiPage",e.FILES_PAGE="filesPage",e.PURCHASES_PAGE="purchasesPage",e.GOOGLE_ONETAP_HOME="oneTapHome",e.GOOGLE_ONETAP_THREAD="oneTapThread",e.GOOGLE_ONETAP_PAGE="oneTapPage",e.GOOGLE_ONETAP_DISCOVER="oneTapDiscover",e.GOOGLE_ONETAP_UNKNOWN="oneTap",e.ONBOARDING="onboarding",e.EMAIL_ASSISTANT_ONBOARDING="emailAssistantOnboarding",e.EMAIL_ASSISTANT_SETTINGS="emailAssistantSettings",e.NEXTAUTH_SIGNIN_PAGE="nextauthSignInPage",e.DISCOUNT_CODE_BANNER="discountCodeBanner",e.PARTNER_CODE="partnerCode",e.ARTICLE_NEW="articleNew",e.THREAD_TO_ARTICLE="threadToArticle",e.ORG_CREATE="orgCreate",e.ORG_PANEL="orgPanel",e.LOSS_AVERSION_MODAL="lossAversionModal",e.NEW_THREAD_BUTTON="newThreadButton",e.NEW_THREAD_SHORTCUT="newThreadShortcut",e.DISCOVER_BUTTON="discoverButton",e.THREAD_BOOKMARK_BUTTON="threadBookmarkButton",e.PAGE_BOOKMARK_BUTTON="pageBookmarkButton",e.DISCOVER_FEED_BOOKMARK_BUTTON="discoverFeedBookmarkButton",e.BACK_TO_SCHOOL="backToSchool",e.WELCOME_BACK="welcomeBack",e.LEFT_HAND_NAV="leftHandNav",e.SETTINGS="settings",e.PRO_FEATURE_LIMIT_BANNER="proFeatureLimitBanner",e.BUY_FROM_MERCHANT_BUTTON="buyFromMerchantButton",e.FINANCE_WATCHLIST="financeWatchlist",e.DOWNLOAD_COMET="downloadComet",e.GROW_COMET="growComet",e.GROW_COMET_AFFILIATE="growCometAffiliate",e.GROW_COMET_STUDENTS="growCometStudents",e.GROW_COMET_STUDENTS_COUNTRY="growCometStudentsCountry",e.PARTNER_COMET="partnerComet",e.COMET_ONBOARDING="cometOnboarding",e.PROMO_REDEMPTION="promoRedemption",e.CONNECTORS_PAGE="connectorsPage",e.MARKETING_LANDING_PAGE="marketingLandingPage",e.FINANCE_TRANSCRIPT="financeTranscript",e.FINANCE_RESEARCH="financeResearch",e.LJJ_LANDING_PAGE="ljjLandingPage",e.STUDENT_REFERRAL_LANDING_PAGE="studentReferralLandingPage",e.VOICE_TO_VOICE_BUTTON="voiceToVoiceButton",e.PRO_PERKS="proPerks",e.REFERRAL_PAGE="referralPage",e.HOTEL_BOOKING_PAGE="hotelBookingPage",e.SOURCES_VIEW_MORE="sourcesViewMore",e.SPORTS_WATCHLIST="sportsWatchlist",e.IMAGE_GENERATION_IN_THREAD="imageGenerationInThread",e.AUTO_UPGRADE_TO_PRO="autoUpgradeToPro",e.UNSPECIFIED_GENERALIZED_UPSELL="unspecifiedGeneralizedUpsell",e.MILESTONE_ACHIEVED="milestoneAchieved",e.PRO_PERKS_PARTNER_PAGE="proPerksPartnerPage",e.STUDENT_LANDING_PAGE="studentLandingPage",e.TASKS_PAGE="tasksPage",e.MAX_URL_PAYWALL="maxUrlPaywall",e.MODEL_SELECTOR="modelSelector",e.DISCOVER_FEED_LIKE_BUTTON="discoverFeedLikeButton",e.DISCOVER_FEED_DISLIKE_BUTTON="discoverFeedDislikeButton",e.DISCOVER_FEED_TASK_WIDGET="discoverFeedTaskWidget",e.SIDEBAR_BOTTOM_POPOVER="sidebarBottomPopover",e.HOME_SIDEBAR="homeSidebar",e.UPGRADE_MODAL="upgradeModal",e.MAX_PAGE="maxPage",e.COMET_INVITE="cometInvite",e.LOGIN_FOR_COMET_AGENT_QUERIES_IN_THREAD="loginForCometAgentQueriesInThread",e.COMET_AGENT_QUERIES_RATE_LIMITED_IN_THREAD="cometAgentQueriesRateLimitedInThread",e.PRO_UPGRADE_IN_SIDE_HOMEPAGE="proUpgradeInSideHomepage",e.MISSING_OUT_ON_PRO_IN_THREAD="missingOutOnProInThread",e.VIDEO_GENERATION_IN_THREAD="videoGenerationInThread",e.RESEARCH_UPSELL_IN_THREAD="researchUpsellInThread",e.STUDENT_VERIFICATION_UPSELL="studentVerificationUpsell",e.STUDENT_VERIFICATION_PAGE="studentVerificationPage",e.TRY_ASSISTANT_BUTTON="tryAssistantButton",e.COMET_NTP="cometNTP",e.EMAIL_ASSISTANT_GATE="emailAssistantGate",e.ENTERPRISE_BILLING_BANNER="enterpriseBillingBanner",e.ENTERPRISE_MAX_UPSELL="enterpriseMaxUpsell",e.CANVAS_GENERATION_IN_THREAD="canvasGenerationInThread",e.BROWSER_AGENT_CONFIRMATION_IN_THREAD="browserAgentConfirmationInThread",e.CLASSROOM_UPLOAD="classroomUpload",e.CLASSROOM_SPACED_REPETITION="classroomSpacedRepetition",e.ENTERPRISE_UPSELL_URL_HANDLER="enterpriseUpsellUrlHandler",e.PREMIUM_SOURCE_TOOLTIP="premiumSourceTooltip"})(lt||(lt={}));var os;(function(e){e[e.OWNER_ONLY=0]="OWNER_ONLY",e[e.PRIVATE_READ=1]="PRIVATE_READ",e[e.PUBLIC_READ=2]="PUBLIC_READ",e[e.PUBLIC_PUBLISHED=3]="PUBLIC_PUBLISHED",e[e.ORG_READ=4]="ORG_READ",e[e.COLLECTION_READ=5]="COLLECTION_READ"})(os||(os={}));var Fd;(function(e){e.SEARCH_V2_NAVIGATE="search_v2_navigate",e.WEB_RESULTS="web_results",e.COMET="comet"})(Fd||(Fd={}));const cxt={default:{termsOfService:"https://www.perplexity.com/hub/legal/terms-of-service",enterpriseTermsOfService:"https://www.perplexity.com/hub/legal/enterprise-terms-of-service",privacyPolicy:"https://www.perplexity.com/hub/legal/privacy-policy"},"ja-JP":{termsOfService:"https://www.perplexity.com/ja/hub/legal/terms-of-service",privacyPolicy:"https://www.perplexity.com/ja/hub/legal/privacy-policy"}},Mc=4e4,vV=2e3,uxt=8e3,zhe=10,dxt=10,Whe=5e3,Ghe=50,q7=10,K7=1024*1024,TM=3,AM=500,Yl="2.18",$he="default",NM="windowsapp",qhe="ios",Khe="android",Y7=["audio/midi","audio/x-midi","application/zip","application/x-tar","application/x-bzip","application/vnd.rar"],RM=[".bash",".bat",".c",".coffee",".conf",".config",".cpp",".cs",".css",".csv",".cxx",".dart",".diff",".doc",".docx",".fish",".go",".h",".hpp",".htm",".html",".in",".ini",".ipynb",".java",".js",".json",".jsx",".ksh",".kt",".kts",".latex",".less",".log",".lua",".m",".markdown",".md",".pdf",".php",".pl",".pm",".pptx",".py",".r",".R",".rb",".rmd",".rs",".scala",".sh",".sql",".swift",".t",".tex",".text",".toml",".ts",".tsx",".txt",".xlsx",".xml",".yaml",".yml",".zsh"],bV=RM.join(","),_V=[".jpeg",".jpg",".jpe",".jp2",".png",".gif",".bmp",".tiff",".tif",".svg",".webp",".ico",".avif",".heic",".heif"],wV=[".mp3",".wav",".aiff",".ogg",".flac",".mp4",".mpeg",".mov",".avi",".flv",".mpg",".webm",".wmv",".3gp"],Yhe=_V.join(","),CV=[...RM,..._V],Qhe=CV.join(","),Xhe=[...RM,...wV],Zhe=Xhe.join(","),Jhe=[...CV,...wV],ege=Jhe.join(","),fxt="",mxt=os.PUBLIC_READ,pxt=os.PRIVATE_READ,Q7=os.PRIVATE_READ,hxt="https://chrome.google.com/webstore/detail/perplexity-ai-search/bnaffjbjpgiagpondjlnneblepbdchol",gxt="https://pplx.ai/mac",yxt="https://www.perplexity.com/comet",DM="login-source",X7="login-new",tge=4,Z7="pplx.tracked_singular_user_subscribed_paying",J7="pplx.tracked_singular_user_subscribed_paying_enterprise",SV=5,xxt="/static/images/file-search-upsell-demo.png",vxt="file-search-upsell-demo",EV="/static/images/data-connectors/factset/factset-avatar.svg",kV="FactSet",MV="/static/images/data-connectors/crunchbase/crunchbase-avatar.svg",nge="Crunchbase",Bd="/static/images/data-connectors/wiley/wiley-avatar.svg",rge="Wiley API",TV="Wiley",jM="/static/images/data-connectors/cbinsights/cbinsights-avatar.svg",AV="CB Insights",IM="/static/images/data-connectors/pitchbook/pitchbook-avatar.svg",NV="PitchBook",PM="/static/images/data-connectors/statista/statista-avatar.svg",RV="Statista",sge="Finance",OM="/static/images/data-connectors/google/google-drive-avatar.svg",DV="/static/images/data-connectors/google/gmail-avatar.svg",oge="Gmail",LM="Google Drive",Cx="/static/images/data-connectors/google/gcal-gmail-avatar.svg",jV="Gmail with Calendar",I0="Microsoft",FM="/static/images/data-connectors/microsoft/onedrive-avatar.svg",BM="OneDrive",UM="/static/images/data-connectors/microsoft/sharepoint-avatar.svg",VM="SharePoint",HM="/static/images/data-connectors/dropbox/dropbox-avatar.svg",zM="Dropbox",Sx="/static/images/data-connectors/box/box-avatar.svg",WM="Box",Ex="/static/images/data-connectors/notion/notion-avatar.svg",GM="Notion",kx="/static/images/data-connectors/linear/linear-avatar.svg",$M="Linear",Mx="/static/images/data-connectors/slack/slack-avatar.svg",qM="Slack (deprecated)",KM="Slack",Tx="/static/images/data-connectors/github/github-avatar.svg",YM="GitHub",Ax="/static/images/data-connectors/asana/asana-avatar.svg",Ud="Asana",Nx="/static/images/data-connectors/atlassian/atlassian-avatar.svg",QM="Atlassian",XM="/static/images/data-connectors/jira/jira-avatar.svg",ZM="Jira",JM="/static/images/data-connectors/confluence/confluence-avatar.svg",e4="Confluence",t4="/static/images/data-connectors/microsoft/teams-avatar.svg",n4="Microsoft Teams",IV="submit-query",sd="search-model-change",yl="source-selection-change",eR="panel-visibility",PV="windows-app",bxt=PV,_xt="If4YwAeizGHdB3eOhX2JxYcjeCgy0N9c",Jp=`${PV}/ask/input`,wxt="https://dl.todesktop.com/25020447d4kq915",E_="pplx.windowsApp.microphonePermission",age={silenceThreshold:30,silenceDuration:5e3},zy="pplx.upload-privacy-accepted",OV=["answer_modes","media_items","knowledge_cards","inline_entity_cards","place_widgets","finance_widgets","prediction_market_widgets","sports_widgets","flight_status_widgets","news_widgets","shopping_widgets","jobs_widgets","search_result_widgets","inline_images","inline_assets","placeholder_cards","diff_blocks","inline_knowledge_cards","entity_group_v2","refinement_filters","canvas_mode","maps_preview","answer_tabs","price_comparison_widgets","preserve_latex","in_context_suggestions"],tR=["google_drive","onedrive","sharepoint","dropbox","box"],LV=["google_drive","onedrive","sharepoint","dropbox","box"],FV="Outlook",r4="/static/images/data-connectors/microsoft/outlook-avatar.svg",s4="Zoom",o4="/static/images/data-connectors/zoom/zoom-avatar.svg",Cxt="org-upgrade-in-progress";function ige(e){const t=new Uint8Array(e);return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("")}async function lge(e){const n=new TextEncoder().encode(e);return await crypto.subtle.digest("SHA-256",n)}async function BV(e){const t=await lge(e);return ige(t)}async function cge(e){return`match_${await BV(e)}`}const uge=async({reason:e})=>{try{const{data:t,error:n}=await de.POST("/rest/attribution/comet/session",e,{timeoutMs:Ze(),numRetries:1});if(n)throw n;return{success:t.success}}catch(t){return Z.error("Failed to start Comet session",t),{success:!1}}},dge=async({eventName:e,reason:t})=>{try{const{data:n,error:r}=await de.POST("/rest/attribution/comet/event/{event_name}",t,{timeoutMs:Ze(),params:{path:{event_name:e}}});if(r)throw r;return{success:n?.success??!1}}catch(n){return Z.error("Failed to send Comet event",n),{success:!1}}},UV=zt("SingularAttributionContext",{sendQueryEventSingular:()=>Promise.resolve(),maybeSendNthQueryEventSingular:()=>Promise.resolve(),sendSubscribedEventSingular:()=>Promise.resolve(),sendAppDownloadClickedEventSingular:()=>Promise.resolve(),sendResurrectedActivationEventSingular:()=>Promise.resolve(),sendCometDownloadPageLoadEventSingular:()=>Promise.resolve(),sendCometDownloadPageSignInEventSingular:()=>Promise.resolve(),sendCometDownloadedEventSingular:()=>Promise.resolve(),sendCometDownloadButtonClickedEventSingular:()=>Promise.resolve(),sendCometWaitlistButtonClickedEventSingular:()=>Promise.resolve(),sendCometDownloadLinkEmailEventSingular:()=>Promise.resolve(),sendSubscribedMaxEventSingular:()=>Promise.resolve(),sendAssistantConnectorClickedEventSingular:()=>Promise.resolve(),sendEmailAssistantTrialEnrolledEventSingular:()=>Promise.resolve(),sendAssistantPaywallPageVisitEventSingular:()=>Promise.resolve(),sendAssistantStartFreeTrialClickedEventSingular:()=>Promise.resolve(),sendAssistantUpgradeToMaxClickedEventSingular:()=>Promise.resolve(),sendAssistantUpgradeToProClickedEventSingular:()=>Promise.resolve(),sendAssistantPaywallDismissedEventSingular:()=>Promise.resolve(),sendAssistantConnectPageVisitEventSingular:()=>Promise.resolve(),sendAssistantGreetingPageVisitEventSingular:()=>Promise.resolve(),sendAssistantCalendarSelectionPageVisitEventSingular:()=>Promise.resolve(),sendAssistantTimeSettingsPageVisitEventSingular:()=>Promise.resolve(),sendAssistantAutoLabelPageVisitEventSingular:()=>Promise.resolve(),sendAssistantAutoDraftPageVisitEventSingular:()=>Promise.resolve(),sendAssistantCompletePageVisitEventSingular:()=>Promise.resolve(),sendAssistantOnboardingEmailSentEventSingular:()=>Promise.resolve(),sendStudyHubPageVisitedEventSingular:()=>Promise.resolve(),sendChatWithTutorClickedEventSingular:()=>Promise.resolve(),sendPracticeQuestionsClickedEventSingular:()=>Promise.resolve(),sendStudyGuideClickedEventSingular:()=>Promise.resolve(),sendFlashcardsClickedEventSingular:()=>Promise.resolve(),sendOnePagerClickedEventSingular:()=>Promise.resolve(),sendSpacedRepetitionClickedEventSingular:()=>Promise.resolve(),sendMaterialsUploadedEventSingular:()=>Promise.resolve(),sendStudyHubActivatedEventSingular:()=>Promise.resolve(),sendThirdStudyHubEngagementEventSingular:()=>Promise.resolve(),sendFifthStudyHubEngagementEventSingular:()=>Promise.resolve(),sendTenthStudyHubEngagementEventSingular:()=>Promise.resolve(),setMatchIdWithEmail:()=>Promise.resolve()}),nR={1:"activated",3:"true activated",5:"quality activated",10:"super activated"},rR={1:"first comet query",3:"third comet query"},fge="ai.testing.perplexity",mge="ai.perplexity",VV=async(e,t)=>{if(!e)return null;const n=new Date;n.setMilliseconds(0);const r=`${e}-${n.toISOString()}-${t}`;return await BV(r)},pge="perplexity_ai_039eb8fb",hge="1e0179ca95965b57a3e91c1cf3049b64",gge=async({productId:e,visitorId:t,userId:n})=>{const{SingularConfig:r,singularSdk:s}=await q(async()=>{const{SingularConfig:c,singularSdk:u}=await import("./singular-sdk-C08EBV6K.js").then(f=>f.s);return{SingularConfig:c,singularSdk:u}},[]),o=new r(pge,hge,e);n&&o.withCustomUserId(n),s.init(o);const a="initialized singular",i=await VV(t,a);return s.event(a,{visitorId:t,eventId:i}),s},yge=({children:e})=>{const{session:t}=je(),n=hr(Bfe),{env:{isProduction:r,isStaging:s},device:{isMobile:o}}=on(),a=d.useRef([]),i=d.useRef([]),c=mn(),[u,f]=d.useState(void 0);d.useEffect(()=>{const y=t?.user?.id,x=r||s?mge:fge;n&&gge({userId:y,productId:x,visitorId:n}).then(v=>{!v||(f({sdk:v}),!y||!Nn())||x7()>1||uge({reason:"comet attribution"})})},[r,s,t?.user?.id,n]);const m=d.useCallback(async(y,x)=>{if(!u){a.current.push({name:y,extraArguments:x});return}if(!n)return;const v=await VV(n,y),b={...x,visitorId:n,eventId:v,isMobile:o};i.current.includes(y)||(u.sdk.event(y,b),i.current.push(y))},[u,n,o]),p=d.useCallback(async({isCometBrowser:y})=>{const x=Ufe(),v=x7(),b=RU();x&&nR[x]&&await m(nR[x]),v&&rR[v]&&await m(rR[v]),y&&b===1&&dge({eventName:"activated",reason:"comet attribution"})},[m]),h=d.useCallback(async y=>{if(!u)return;const x=await cge(y);u.sdk.setMatchID(x)},[u]),g=d.useCallback(async y=>{await m("user sign in",{isNewUser:y}),t?.user?.id&&u&&u.sdk.login(t.user.id)},[t?.user?.id,u,m]);return d.useEffect(()=>{u&&a.current.length>0&&(a.current.filter((x,v,b)=>v===b.findIndex(_=>_.name===x.name)).forEach(({name:x,extraArguments:v})=>{m(x,v)}),a.current=[])},[u,m]),d.useEffect(()=>{if(c?.get(DM)&&c?.get(X7)){const y=c?.get(X7)==="true";g(y),y?(m("new user sign in"),t?.user?.email&&h(t.user.email)):m("existing user sign in"),Nn()&&m("comet user sign in")}},[c,g,m,t?.user?.email,h]),d.useEffect(()=>{t?.user?.subscription_tier&&t?.user?.payment_tier==="paid"&&(j0.getItem(Z7)||(m("user subscribed paying"),j0.setItem(Z7,"true")),t?.user?.subscription_source==="enterprise"&&!j0.getItem(J7)&&(m("user subscribed paying enterprise"),j0.setItem(J7,"true")))},[t?.user?.subscription_tier,t?.user?.payment_tier,t?.user?.subscription_source,m]),l.jsx(UV.Provider,{value:d.useMemo(()=>({sendQueryEventSingular:()=>m("query submitted"),maybeSendNthQueryEventSingular:p,sendSubscribedEventSingular:()=>m("user subscribed"),sendAppDownloadClickedEventSingular:y=>m("app download button clicked",{origin:y}),sendResurrectedActivationEventSingular:()=>m("resurrected activated"),sendCometDownloadPageLoadEventSingular:y=>m(`${y} page loaded`),sendCometDownloadPageSignInEventSingular:y=>m(`${y} page signed in`),sendCometDownloadedEventSingular:()=>m("download-comet comet downloaded"),sendCometDownloadButtonClickedEventSingular:y=>m(`${y} download button clicked`),sendCometWaitlistButtonClickedEventSingular:y=>m(`${y} waitlist button clicked`),sendCometDownloadLinkEmailEventSingular:y=>m(`${y} send download link`),sendSubscribedMaxEventSingular:()=>m("user subscribed max"),sendAssistantConnectorClickedEventSingular:y=>m("assistant connector clicked",{connectorType:y}),sendEmailAssistantTrialEnrolledEventSingular:()=>m("email assistant trial enrolled"),sendAssistantPaywallPageVisitEventSingular:()=>m("assistant paywall page visit"),sendAssistantStartFreeTrialClickedEventSingular:()=>m("assistant start trial clicked"),sendAssistantUpgradeToMaxClickedEventSingular:()=>m("assistant upgrade max clicked"),sendAssistantUpgradeToProClickedEventSingular:()=>m("assistant upgrade pro clicked"),sendAssistantPaywallDismissedEventSingular:()=>m("assistant paywall dismissed"),sendAssistantConnectPageVisitEventSingular:()=>m("assistant connect page visit"),sendAssistantGreetingPageVisitEventSingular:()=>m("assistant greeting page visit"),sendAssistantCalendarSelectionPageVisitEventSingular:()=>m("assistant cal selection visit"),sendAssistantTimeSettingsPageVisitEventSingular:()=>m("assistant time settings visit"),sendAssistantAutoLabelPageVisitEventSingular:()=>m("assistant auto label page visit"),sendAssistantAutoDraftPageVisitEventSingular:()=>m("assistant auto draft page visit"),sendAssistantCompletePageVisitEventSingular:()=>m("assistant complete page visit"),sendAssistantOnboardingEmailSentEventSingular:()=>m("assistant onboarding email sent"),sendStudyHubPageVisitedEventSingular:()=>m("study hub page visited"),sendChatWithTutorClickedEventSingular:()=>m("chat with tutor clicked"),sendPracticeQuestionsClickedEventSingular:()=>m("practice questions clicked"),sendStudyGuideClickedEventSingular:()=>m("study guide clicked"),sendFlashcardsClickedEventSingular:()=>m("flashcards clicked"),sendOnePagerClickedEventSingular:()=>m("one pager clicked"),sendSpacedRepetitionClickedEventSingular:()=>m("spaced repetition clicked"),sendMaterialsUploadedEventSingular:()=>m("materials uploaded"),sendStudyHubActivatedEventSingular:()=>m("study hub activated"),sendThirdStudyHubEngagementEventSingular:()=>m("third study hub engagement"),sendFifthStudyHubEngagementEventSingular:()=>m("fifth study hub engagement"),sendTenthStudyHubEngagementEventSingular:()=>m("tenth study hub engagement"),setMatchIdWithEmail:h}),[m,p,h]),children:e})},a4=()=>{const e=d.useContext(UV);if(!e)throw new Error("useSingularAttribution must be used within SingularAttributionContext");return e};let Au;async function HV(){return Au||(Au=new Promise(e=>{const t=new URL("/ws",window.location.origin);t.protocol="wss:";const n=new WebSocket(t);n.addEventListener("error",()=>{try{n.close()}finally{Au=void 0}}),n.addEventListener("close",()=>{Au=void 0}),n.addEventListener("open",()=>{e(n)})}),Au)}const xge="/rest/event/analytics";function zV(e){return typeof navigator.sendBeacon!="function"?!1:navigator.sendBeacon(xge,new Blob([JSON.stringify(e)],{type:"application/json; charset=UTF-8"}))}function WV(){const e={};try{navigator.hardwareConcurrency&&(e.hardwareConcurrency=navigator.hardwareConcurrency);const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const r=n[3];r&&(e.architecture=r),globalThis.screen.colorDepth&&(e.colorDepth=globalThis.screen.colorDepth),globalThis.screen.width&&globalThis.screen.height&&(e.screenSize=`${globalThis.screen.width}x${globalThis.screen.height}`)}catch{}return e}const vge=WV(),bge=768,_ge=`(max-width: ${bge}px)`;function wge(){return typeof window>"u"?!1:window.matchMedia(_ge).matches}function Cge(){return wge()?"mweb":"web"}const Sge=(e={},t)=>{const n=Date.now(),r=Cge(),s={...e,isStandaloneApp:!1,timestamp:n,isBrowserExtension:!1,timeZone:bM,isPro:t?.subscription_status&&t?.subscription_status!=="none",userId:t?.id,deviceInfo:vge,web_platform:r},o=globalThis.location.pathname+globalThis.location.search,a=!!getComputedStyle(document.documentElement).getPropertyValue("--arc-palette-title"),i=WV();let c;return s.internalReferrer?c=s.internalReferrer:c=document.referrer,(globalThis.matchMedia("(display-mode: standalone)").matches||globalThis.matchMedia("(display-mode: minimal-ui)").matches||globalThis.navigator?.standalone)&&(s.isStandaloneApp=!0),{eventData:s,pathnameAndParams:o,isArcBrowser:a,deviceInfo:i,referrer:c}};function GV(e){const{name:t,data:n,user:r,source:s}=e,{eventData:o,pathnameAndParams:a,deviceInfo:i,referrer:c,isArcBrowser:u}=Sge(n,r);return a.startsWith("/search/render")?void 0:{event_name:t,event_data:o,url:a,referrer:c,language:tV(),screen:Rx(),hostname:globalThis.location.hostname,device_info:i,is_arc_browser:u,source:s}}function Li(e){const t=GV(e);t&&(zV(t)||(Ll("web.browser.analytics.send_event_failed"),HV().then(n=>{n.send(JSON.stringify(t))})))}function Ege(e){const t=e.map(n=>GV(n)).filter(n=>n!==void 0);t.length!==0&&(zV(t)||(Ll("web.browser.analytics.send_event_failed"),HV().then(n=>{n.send(JSON.stringify(t))})))}function Rx(){return`${globalThis.screen.width}x${globalThis.screen.height}`}const kge=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)")?.matches?"dark":"light";function Mge(){const[e,t]=d.useState(kge);return d.useEffect(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)"),r=s=>{t(s.matches?"dark":"light")};return n?.addEventListener("change",r),()=>{n?.removeEventListener("change",r)}},[]),e}const i4=zt("ColorSchemeContext",null),k_="colorScheme",$V=T.memo(function({children:t,initialOverrideColorScheme:n}){const r=Mge(),{value:s,refetch:o}=DU(k_),[a,i]=d.useState(n),c=d.useMemo(()=>Ef(p=>{const h=p;h?document.documentElement.dataset.colorScheme=h:delete document.documentElement.dataset.colorScheme},100),[]),u=d.useCallback(p=>{p?lo(k_,p):Qp(k_),o()},[o]),f=d.useCallback(p=>{i(p)},[i]),m=a??s??r;return d.useEffect(()=>{c(m)},[m,c]),l.jsx(i4.Provider,{value:{colorScheme:m,isSystemColorScheme:!a&&!s,setUserPreferredColorScheme:u,setOverrideColorScheme:f},children:t})});$V.displayName="ColorSchemeProvider";function Tge(){return d.useContext(i4)}function Ss(){const e=d.useContext(i4);if(!e)throw new Error("Attempted to access ColorSchemeContext from useColorScheme() without adding to the tree.");return e}const Age=768,qV=`(max-width: ${Age}px)`;function sR(){return typeof window>"u"?!1:window.matchMedia(qV).matches}function ci(e={}){const t=Ln(),{device:{isWindowsApp:n}}=on(),r=d.useMemo(()=>!!(n&&t?.includes(Jp)),[n,t]),{evaluateOnInit:s=!1}=e,o=KV(),a=Nge(),[i,c]=d.useState(()=>o||a?!0:s?sR():!1);return d.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(qV);function f(){c(u.matches)}return u.addEventListener("change",f),()=>{u.removeEventListener("change",f)}},[o]),d.useEffect(()=>{s||c(sR())},[s]),i&&!r}function KV(e=!1){const{device:{isMobile:t}}=on();return t??e}function Nge(e=!1){const{device:{isAndroid:t}}=on();return t??e}function Re(e={}){const t=Ln(),{device:{isWindowsApp:n}}=on(),r=ci(e),s=d.useMemo(()=>!!(n&&t?.includes(Jp)),[n,t]),o=d.useMemo(()=>r&&!s,[r,s]),a=KV();return d.useMemo(()=>({isMobileStyle:o,isMobileUserAgent:a}),[o,a])}function oR({flag:e,override:t,defaultValue:n,isServer:r=!1}){if(!t)return{shouldUseOverride:!1,value:null};try{if(typeof n=="boolean")return{shouldUseOverride:!0,value:t==="true"};if(typeof n=="number")return{shouldUseOverride:!0,value:Number(t)};if(typeof n=="object")try{return{shouldUseOverride:!0,value:JSON.parse(t)}}catch(s){return Z.warn(`[Eppo ${r?"Server ":""}Override]`,`Failed to parse JSON override for flag "${e}"`,{override:t,error:s}),{shouldUseOverride:!0,value:n}}return{shouldUseOverride:!0,value:t}}catch(s){return Z.error(`[Eppo ${r?"Server ":""}Override] Error:`,s),{shouldUseOverride:!0,value:n}}}let Em;async function Rge({apiKey:e,logAssignment:t}){if(Em)return Em;const{init:n}=await q(async()=>{const{init:r}=await import("./index-avoQQ9qh.js").then(s=>s.i);return{init:r}},__vite__mapDeps([0,1]));try{return Em=n({apiKey:e,assignmentLogger:{logAssignment:t}}),await Em,Z.info("[Eppo Experiments] Primary key initialization successful"),Em}catch(r){throw Z.error("[Eppo Experiments] Primary key failed",r),r}}const YV="eppo_overrides",QV="eppo_overrides",Dge=e=>e?e.endsWith("@perplexity.ai"):!1,jge=e=>{const t={};return e.forEach((n,r)=>{if(r.startsWith("eppo_")){const s=r.replace("eppo_","");t[s]=n??""}}),t},Ige=e=>{let t=!0;const n=JSON.stringify(e);try{lo(QV,n)}catch{t=!1}return t=_a.setItem(YV,n),t},Pge=(e,t,n)=>{if(typeof window>"u"||n&&!Dge(e))return!1;const r=jge(t);return Object.keys(r).length===0?!1:Ige(r)};function aR(){try{const e=hr(QV);if(e)return JSON.parse(e);const t=_a.getItem(YV);return t?JSON.parse(t):{}}catch{return{}}}const Oge=(e,t)=>{const n=d.useRef(void 0);Er(n.current,t)||(n.current=t),d.useLayoutEffect(e,[n.current])},Lge={getEppoTypedVariationAsync:function(){return Promise.resolve(void 0)},getEppoTypedVariationSync:function(){return null},keysRequiringRerender:[],addKeyRequiringRerender:()=>null,removeKeyRequiringRerender:()=>null},l4=zt("EppoExperimentsContext",Lge),Fge="experiment assignment",J1="failed_open_to_default_value";function iR(e){if(!e||typeof e!="string")return;const t=e.trim();if(t==="")return;const n=t.split("@");if(!(n.length!==2||!n[0]||!n[1]))return n[1]}const Bge=(e,t,n,r)=>s=>Li({name:Fge,data:{subjectType:s.subjectAttributes.subjectType,pagePropsHostname:r,colorScheme:n,isPerplexityBrowser:e,...s},user:{id:t?.user?.id,subscription_status:t?.user?.subscription_status}});function M_(e){const n=wt.keys().filter(r=>r.startsWith(e));n.length>1&&(Z.warn("[Eppo Experiments] Wiping duplicate Eppo keys",{keys:n}),n.forEach(r=>{wt.removeItem(r)}))}const Uge=({children:e,hostname:t,session:n,cfCountry:r})=>{const s=!!n?.user,o=jU(),a=Vfe(),i=Nn(),[c,u]=d.useState([]),{env:{isProduction:f,isStaging:m,deployName:p},device:{isWindowsApp:h}}=on(),y=f||m?"a2yUBlJ1tebb5g2II8WD1CzbVUszCSk3.ZWg9bnhqMGc3LmUuZXBwby5jbG91ZCZjcz1ueGowZzc":"KphAz1VUxSQKAZxlw1PwMdZNRia-a4B3.ZWg9bnhqMGc3LmUuZXBwby5jbG91ZCZjcz1ueGowZzc",{colorScheme:x}=Ss(),v=d.useRef(void 0),b=mn(),[_,w]=d.useState(!1),{locale:S}=J(),{isMobileStyle:C}=Re(),E=d.useRef(void 0),N=d.useCallback(R=>{Bge(i,n,x,t)(R)},[n,i,x,t]);d.useEffect(()=>{if(_||!b)return;Pge(n?.user?.email,b,f)&&w(!0)},[b,n?.user?.email,_,f]);const k=d.useCallback(({userId:R,visitorId:j,sessionId:L,subjectType:U,stableId:O,extraAttributes:$,cometDeviceId:G})=>{let H;return O?H=O:U==="user_nextauth_id"?H=R:U==="visitor_id"?H=j??void 0:U==="session_id"?H=L??void 0:U==="context_uuid"?H=$?.context_uuid:U==="comet_device_id"&&(H=G),H},[]),I=d.useCallback(function({flag:R,subjectType:j,isUserLoggedIn:L,stableId:U,userId:O,visitorId:$,sessionId:G,cometDeviceId:H,extraAttributes:Q,defaultValue:Y}){return Math.random()<.01&&Z.error("[Eppo Experiments]","No subject key found",{flag:R,subject_type:j,is_user_logged_in:L,has_stable_id:!!U,has_session_user_id:!!O,has_visitor_id:!!$,has_session_id:!!G,has_context_uuid:!!Q?.context_uuid,has_comet_device_id:!!H,execution_context:typeof window<"u"?"client":"server",document_ready_state:typeof document<"u"?document.readyState:"unknown",eppo_provider_result:J1}),Y},[]),M=d.useCallback(({primaryApiKey:R,logAssignment:j})=>(v.current||(M_("eppo-configuration-"),M_("eppo-configuration-meta-"),M_("eppo-configuration-assignment-"),v.current=Rge({apiKey:R,logAssignment:j}),v.current.then(L=>{E.current=L})),v.current),[]),A=d.useCallback(async function(R,{flag:j,subjectType:L,stableId:U,defaultValue:O,extraAttributes:$}){if(L==="user_nextauth_id"&&!s)return O;const G=Us()?.device_id??void 0,H=Io(),Q=i&&!H,Y=k({userId:n?.user?.id,visitorId:o,sessionId:a,subjectType:L,stableId:U,extraAttributes:$,cometDeviceId:G});if(!Y)return I({flag:j,subjectType:L,isUserLoggedIn:s,stableId:U,userId:n?.user?.id,visitorId:o,sessionId:a,cometDeviceId:G,extraAttributes:$,defaultValue:O});const te=aR(),{shouldUseOverride:se,value:ae}=oR({flag:j,override:te[j],defaultValue:O});if(se)return ae??O;const X=await M({primaryApiKey:y,logAssignment:N});try{const ee=n?.user?.email??void 0,le=iR(ee);return R(X,j,Y,{subjectType:L,visitorId:o??void 0,sessionId:a??void 0,userEmail:ee,userEmailDomain:le,userId:n?.user?.id??void 0,appApiClient:WS(C,h),cfCountry:r,locale:S,isComet:i,isCometDesktop:Q,isCometMobile:H,deployName:p,cometDeviceId:G,...v7(),...$??{}},O)}catch{return Z.error("[Eppo Experiments] Error calling eppoFn",{flag:j,subjectKey:Y,eppo_provider_result:J1}),O}},[s,i,k,n?.user?.id,n?.user?.email,o,a,y,I,N,C,h,r,S,p,M]),D=d.useCallback(function(R,{flag:j,subjectType:L,stableId:U,defaultValue:O,extraAttributes:$}){if(L==="user_nextauth_id"&&!s)return O;const G=Us()?.device_id??void 0,H=Io(),Q=i&&!H,Y=k({userId:n?.user?.id,visitorId:o,sessionId:a,subjectType:L,stableId:U,extraAttributes:$,cometDeviceId:G});if(!Y)return I({flag:j,subjectType:L,isUserLoggedIn:s,stableId:U,userId:n?.user?.id,visitorId:o,sessionId:a,cometDeviceId:G,extraAttributes:$,defaultValue:O});const te=aR(),{shouldUseOverride:se,value:ae}=oR({flag:j,override:te[j],defaultValue:O});if(se)return ae??O;if(M({primaryApiKey:y,logAssignment:N}),!E.current)return null;try{const X=n?.user?.email??void 0,ee=iR(X);return R(E.current,j,Y,{subjectType:L,visitorId:o??void 0,sessionId:a??void 0,userEmail:X,userEmailDomain:ee,userId:n?.user?.id??void 0,appApiClient:WS(C,h),cfCountry:r,locale:S,isComet:i,isCometDesktop:Q,isCometMobile:H,deployName:p,cometDeviceId:G,...v7(),...$??{}},O)}catch{return Z.error("[Eppo Experiments] Error calling eppoFn",{flag:j,subjectKey:Y,eppo_provider_result:J1}),O}},[s,i,k,n?.user?.id,n?.user?.email,o,a,y,I,N,C,h,r,S,p,M]),P=d.useCallback(R=>{u(j=>j.includes(R)?j:[...j,R])},[]),F=R=>{u(j=>j.includes(R)?j.filter(L=>L!==R):j)};return l.jsx(l4.Provider,{value:{getEppoTypedVariationAsync:A,getEppoTypedVariationSync:D,keysRequiringRerender:c,addKeyRequiringRerender:P,removeKeyRequiringRerender:F},children:e})};function Vge(e,t){if(e)for(const{condition:n,result:r}of e)try{if(n())return r}catch(s){Z.error("[Eppo Experiments] Error evaluating short-circuit case",{flag:t,error:s})}}function Mf(e,t){const n=d.useContext(l4);if(!n)throw new Error("useGetEppoJSONVariation must be used within EppoExperimentsContext");const{getEppoTypedVariationAsync:r,getEppoTypedVariationSync:s}=n,{skip:o,shortCircuitCases:a,...i}=e,c=o?void 0:Vge(a,e.flag),[u,f]=d.useState(void 0),[m,p]=d.useState(()=>o?!0:c!==void 0?!1:!s(t,i)),[h,g]=d.useState(()=>o?i.defaultValue:c!==void 0?c:s(t,i)??i.defaultValue),y=d.useRef(e),x=d.useCallback(async()=>{const{skip:v,shortCircuitCases:b,..._}=y.current;try{return r(t,_)}catch(w){return Z.error("[Eppo Experiments]","Error calling getEppoTypedVariationAsync",{flag:_.flag,error:w,eppo_provider_result:J1}),_.defaultValue}},[r,t]);return Oge(()=>{if(y.current=e,o){p(!1);return}if(c!==void 0){g(c),p(!1);return}const v=s(t,i);v!==null?(g(v),p(!1)):(p(!0),r(t,i).then(b=>g(b),f).finally(()=>p(!1)))},[r,s,e]),{value:h,loading:m,error:u,fetchVariation:x}}const XV=(e,...t)=>e.getJSONAssignment(...t);function Tf(e){return Mf(e,XV)}function Hge(e,t){const n={...e,subjectType:"context_uuid",extraAttributes:{...e.extraAttributes,context_uuid:t}};return Mf(n,XV)}const zge=(e,...t)=>e.getStringAssignment(...t);function Wge(e){return Mf(e,zge)}const Gge=(e,...t)=>e.getBooleanAssignment(...t);function qt(e){return Mf(e,Gge)}const $ge=(e,...t)=>e.getNumericAssignment(...t);function qge(e){return Mf(e,$ge)}const Kge=(e,...t)=>e.getIntegerAssignment(...t);function c4(e){return Mf(e,Kge)}function Yge(e){return Tf({...e,subjectType:"visitor_id",skip:!1})}function Dx(e){return qt({...e,subjectType:"visitor_id",skip:!1})}const u4=()=>{const e=d.useContext(l4);if(!e)throw new Error("useEppoExperiments must be used within EppoExperimentsContext");return e},ZV=(e,t)=>{const{value:n,loading:r}=qt({flag:"comet-mcp-enabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Qge=(e,t)=>{const{value:n,loading:r}=c4({flag:"comet-mobile-classifier-timeout",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Xge=async({entryUUID:e,params:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/entry/should-show-feedback/{entry_uuid}",n,{params:{path:{entry_uuid:e}},body:t,timeoutMs:Ze({productionMs:500,devMs:1e3,clientSideMs:1e3}),numRetries:0});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r?.should_show_feedback??!1}catch(r){return Z.error("Failed to check if should show feedback",r),!1}},Zge=async({slugOrUUID:e,headers:t,options:n,numRetries:r=0,reason:s})=>{const o="getThreadByUUID";if(!e||e==="undefined"||e==="new"){Z.log(`Tried to ${o} with bad slugOrUUID: ${e}`);return}const a=n?.withParentInfo,i=n?.version??Yl,c=n?.source??$he,u=n?.limit??0,f=n?.offset??0,m=n?.fromFirst,p=n?.supportedBlockUseCases??[],h=n?.cursor??null;try{const{data:g,error:y,response:x}=await de.GET("/rest/thread/{entry_uuid_or_slug}",s,{params:{path:{entry_uuid_or_slug:e},query:{with_parent_info:a,with_schematized_response:!0,version:i,source:c,limit:u,offset:f,from_first:m,supported_block_use_cases:p,cursor:h}},timeoutMs:Sn.HIGH,numRetries:r,headers:t});if(!g||y)throw new ye("API_CLIENTS_ERROR",{cause:y,status:x.status??0});return g}catch(g){throw Z.error("Failed to get thread by uuid",g),g}},Sxt=async({entryUUID:e,selectedText:t,beforeContext:n,afterContext:r,callback:s,reason:o})=>{await de.SSE("/rest/sse/check-sources",o,{params:{entry_uuid_or_slug:e,selected_text:t,before_context:n,after_context:r},handlers:{message:a=>s(a)}})},Ext=async({entryUUID:e,params:t,reason:n})=>{if(e)try{const{error:r,response:s}=await de.POST("/rest/entry/label-entry/{entry_uuid}",n,{params:{path:{entry_uuid:e}},body:t,timeoutMs:Ze({productionMs:5e3}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){Z.error(r)}},kxt=async({entry_uuid:e,format:t,reason:n})=>{const{data:r,error:s,response:o}=await de.POST("/rest/entry/export",n,{body:{entry_uuid:e,format:t},timeoutMs:Ze({productionMs:6e3}),numRetries:1});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r},Mxt=async({slugOrUUID:e,reason:t})=>{const{error:n,response:r}=await de.POST("/rest/thread/request-access/{entry_uuid_or_slug}",t,{params:{path:{entry_uuid_or_slug:e}}});if(n)throw new ye("API_CLIENTS_ERROR",{cause:n,status:r.status??0})},lu=async({entryUUID:e,reason:t})=>{try{const{error:n}=await de.POST("/rest/sse/perplexity_terminate",t,{headers:{"content-type":"application/json"},body:{entry_uuid:e},timeoutMs:Ze({productionMs:5e3}),numRetries:1});return!n}catch(n){return Z.error("Failed to terminate entry",n),!1}},Txt=async({entryUUID:e,reason:t})=>{try{await de.POST("/rest/sse/perplexity_skip_search",t,{headers:{"content-type":"application/json"},body:{entry_uuid:e}})}catch(n){Z.error("Failed to skip search",n)}},Jge=async({entryUUID:e,clarification:t,reason:n})=>{try{await de.POST("/rest/sse/perplexity_clarifying_answer",n,{headers:{"content-type":"application/json"},body:{entry_uuid:e,clarification:t},timeoutMs:Ze({productionMs:5e3}),numRetries:0})}catch(r){Z.error("Failed to give clarifying answer",r)}},e0e=async({entryUUID:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/entry/should-show-recruitment-banner/{entry_uuid}",t,{params:{path:{entry_uuid:e}},body:void 0,timeoutMs:Ze({productionMs:500,devMs:1e3,clientSideMs:1e3}),numRetries:0});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n?.should_show_recruitment_banner??!1}catch(n){return Z.error("Failed to check if should show recruitment banner",n),!1}},eh=async({contextUUID:e,stepUUID:t,result:n,reason:r})=>{try{const{error:s,response:o}=await de.POST("/rest/sse/pro_search_step_result",r,{body:{context_uuid:e,step_uuid:t,result:n},timeoutMs:Ze({productionMs:5e3}),numRetries:0});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0})}catch(s){Z.error(s)}},t0e=async({entryUUID:e,params:t,siblingUUID:n,reason:r})=>{const{error:s,response:o}=await de.POST("/rest/entry/set-entry-selection/{entry_uuid}",r,{params:{path:{entry_uuid:e}},body:{selection_status:t,sibling_uuid:n},timeoutMs:Ze({productionMs:5e3}),numRetries:1});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0})},n0e=async({entryUUID:e,sourceType:t,reason:n})=>{try{const{error:r,response:s}=await de.POST("/rest/sources/skip",n,{body:{entry_uuid:e,source_type:t},timeoutMs:Ze({productionMs:5e3}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){throw Z.error("Failed to skip source",r),r}},lR=Object.freeze({version:"",minVersion:0,webResourcesBuild:""});function Ml(){return typeof window<"u"?window.__PPL_CONFIG__??lR:lR}const JV="comet-sidecar-threads-by-id",Ca=()=>!!Us(),jx=e=>!(e.defaultPrevented||!Nn()||e.ctrlKey||e.metaKey),r0e=e=>{const t=wt.getItem(JV);if(t){const n=JSON.parse(t);for(const[r,{url:s,updatedAt:o}]of Object.entries(n))e.getState().actions.setSidecarUrlById(r,s,o)}},cR=e=>{const t=e.getState().sidecarUrlById,n={};t.forEach((r,s)=>{s!=="-1"&&(r.url==="/sidecar/"||r.url==="/sidecar"||(n[s]={url:r.url,updatedAt:r.updatedAt}))}),wt.setItem(JV,JSON.stringify(n))},s0e=(e,t)=>{const n=e.getState().sidecarSourceTab,r=ro(n.tabId,n.secondaryTab?.tabId),s=e.getState().sidecarUrlById.get(r)?.url;!s||new URL(window.location.href).pathname===s||t.replace(s,"Sidecar thread restored from cache")};let eH=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,s=n.length;r{this.events[e]=this.events[e]?.filter(n=>t!==n)}}});const o0e="npclhjbddhklpbnacpjloidibaggcgon",a0e="entropy-agent-extension-main";function i0e(){return{sendMessage:()=>Promise.reject(new kc("MOBILE_BROWSER_ERROR")),sendMessageToPort:()=>()=>{},isConnected:()=>!1}}function uR({onMessage:e,extensionId:t,name:n}){if(Io())return i0e();const r=1;let s,o,a=!1,i=!1,c=!1,u=0;const f=()=>{s&&clearTimeout(s),u++,s=setTimeout(h,1e3)},m=()=>{o=void 0,u>r&&Nn()&&!i&&(Z.warn("Disconnected. Attempting to reconnect...",{extensionId:t}),i=!0),f()},p=()=>{if(o){o.onMessage.removeListener(e),o.onDisconnect.removeListener(m),clearTimeout(s);try{o.disconnect()}catch{}o=void 0}};function h(){if(p(),typeof chrome>"u"||!chrome.runtime){Nn()&&(a||(Z.error("Comet browser is missing chrome.runtime",{extensionId:t}),a=!0),f());return}try{o=chrome.runtime.connect(t,{name:n}),o.onMessage.addListener(e),o.onDisconnect.addListener(m),a=!1,i=!1,c=!1,u>r&&Nn()&&Z.info("Extension reconnected successfully",{extensionId:t,reconnect_attempts:u}),u=0}catch(g){o=void 0,f(),Z.error("Failed to connect to extension",{err:g,extensionId:t})}}return Nn()&&(h(),td("web.frontend.comet_extension_connected",{extensionId:t,startTime:IU(),duration:performance.now()})),{sendMessage:g=>(!o&&u>r&&Nn()&&!c&&(Z.warn("Attempting to send message while main port is not connected",{extensionId:t}),c=!0),l0e(t,g)),sendMessageToPort:g=>{if(!Nn())return()=>{};!o&&u>r&&!c&&(Z.warn("Attempting to send message to port while main port is not connected",{extensionId:t}),c=!0);const y=chrome.runtime.connect(t,{name:`${n}_${crypto.randomUUID()}`});return y.postMessage(g),()=>{try{y.disconnect()}catch{}}},isConnected:()=>!!o}}async function l0e(e,t){return new Promise((n,r)=>{if(EM()){r(new kc("INCOGNITO_BROWSER_ERROR"));return}if(!Nn()){r(new kc("INVALID_BROWSER_ERROR"));return}if(typeof chrome>"u"||!chrome.runtime){r(new kc("MISSING_RUNTIME_ERROR",{details:{extensionId:e,messageType:typeof t=="object"&&t!==null&&"type"in t?t.type:void 0,message:t}}));return}chrome.runtime.sendMessage(e,t,s=>{if(chrome.runtime.lastError){r(new kc("RUNTIME_LAST_ERROR",{message:chrome.runtime.lastError.message,cause:chrome.runtime.lastError,details:{extensionId:e,messageType:typeof t=="object"&&t!==null&&"type"in t?t.type:void 0,message:t}}));return}n(s)})})}class c0e{requests=new Map;bridge;get isAvailable(){if(!(typeof window>"u"))return window.cometBridge!=null}constructor(){this.bridge=new Proxy({},{get:(t,n)=>r=>{const s=crypto.randomUUID(),o={request_id:s,[n]:r??{}};return new Promise((a,i)=>{this.requests.set(s,c=>{"error"in c?i(new Error(String(c.error))):a(c)}),window.cometBridge?.postMessage(JSON.stringify(o))})}}),this.startListenMessages()}startListenMessages(){window.cometBridge&&(window.cometBridge.onmessage=t=>{const n=t.data;if(n)try{const r=JSON.parse(n),s=this.requests.get(r.request_id);s?(this.requests.delete(r.request_id),s(r)):(console.warn("No callback found for requestId",r.request_id,r),Z.warn("No callback found for requestId",r.request_id,r))}catch(r){console.warn("Failed to parse bridge response",n,r),Z.warn("Failed to parse bridge response",n,r)}})}}class dR{bridge;get isAvailable(){if(!(typeof window>"u"))return window.webkit?.messageHandlers?.cometBridge!=null}constructor(){this.bridge=new Proxy({},{get:(t,n)=>async r=>{const o={request_id:crypto.randomUUID(),[n]:r??{}},a=await window.webkit?.messageHandlers?.cometBridge?.postMessage(JSON.stringify(o));if(!a)throw new Error("No response from cometBridge");return JSON.parse(a)}})}}const ey="mcp_tools_settings_v1";function u0e(){return Xi((e,t)=>({platformInfo:void 0,sidecarSourceTab:{url:"/",title:"",tabId:-1,secondaryTab:null},sidecarAutoOpenedThreads:{},screenshotToolEnabled:!0,sidecarUrlById:new Map,tasksState:{},navigationResults:{},classifierResults:{},omniboxInput:{},navigationMeta:{},taskScreenshots:{},taskComputerActions:{},userSelection:void 0,userSelectionByThreadId:new Map,mcpStdioServers:void 0,mcpTools:void 0,mcpDisabledServers:void 0,installedDxts:void 0,taskTabs:void 0,mcpToolsSettings:void 0,pendingTasks:new Map,inlineAssistantParams:{action:void 0,isWritingMode:!1,canInsert:!0},inlineAssistantDraggableRegions:new Map,actions:{setPlatformInfo:n=>{e({platformInfo:n})},setSidecarUrlById:(n,r,s)=>{const o=t().sidecarUrlById;o.set(n,{url:r,updatedAt:s??Date.now()}),e({sidecarUrlById:o})},deleteSidecarUrlById:n=>{const r=t().sidecarUrlById;r.delete(n),e({sidecarUrlById:r})},setSourceTab:n=>{const r=t().sidecarSourceTab;if(Er(r,n))return;let s=!0;try{const i=new URL(n.url);s=!((i.protocol==="chrome:"||i.protocol==="comet:")&&i.hostname!=="newtab")}catch{}const o=r.tabId===n.tabId&&r.secondaryTab?.tabId===n.secondaryTab?.tabId,a=r.url!==n.url;if(o&&a){const i=ro(r.tabId,r.secondaryTab?.tabId);e(c=>{const u=new Map(c.userSelectionByThreadId);return u.delete(i),{sidecarSourceTab:n,screenshotToolEnabled:s,userSelectionByThreadId:u}})}else e({sidecarSourceTab:n,screenshotToolEnabled:s})},setSidecarAutoOpened:(n,r)=>{const s=t().sidecarAutoOpenedThreads;if(n)e({sidecarAutoOpenedThreads:{...s,[r]:!0}});else{const{[r]:o,...a}=s;e({sidecarAutoOpenedThreads:a})}},setLastOmniboxInput:(n,r)=>{e(s=>({omniboxInput:{...s.omniboxInput,[n]:r}}))},addNavigationResults:(n,{results:r,classifierResult:s,...o})=>{r?.length&&e(a=>{const i={navigationResults:{...a.navigationResults,[n]:r}};return s&&(i.classifierResults={...a.classifierResults,[n]:s}),o&&!a.navigationMeta[n]&&(i.navigationMeta={...a.navigationMeta,[n]:o}),i})},addTaskScreenshot:(n,r)=>{e(s=>({taskScreenshots:{...s.taskScreenshots,[n]:[...s.taskScreenshots[n]||[],r.startsWith("data:image/")?r:`data:image/png;base64,${r}`]}}))},addComputerAction:(n,r)=>{e(s=>({taskComputerActions:{...s.taskComputerActions,[n]:[...s.taskComputerActions[n]||[],r]}}))},setTaskState:(n,r)=>{e(s=>{const o={...s.tasksState};return r===void 0?delete o[n]:o[n]={is_paused:r},{tasksState:o}})},setUserSelection:n=>{{const r=t(),s=ro(r.sidecarSourceTab.tabId,r.sidecarSourceTab.secondaryTab?.tabId);e(o=>{const a=new Map(o.userSelectionByThreadId);return a.set(s,n),{userSelectionByThreadId:a}})}},clearUserSelection:()=>{{const n=t(),r=ro(n.sidecarSourceTab.tabId,n.sidecarSourceTab.secondaryTab?.tabId);e(s=>{const o=new Map(s.userSelectionByThreadId);return o.delete(r),{userSelectionByThreadId:o}})}},getUserSelection:()=>{const n=t();{const r=ro(n.sidecarSourceTab.tabId,n.sidecarSourceTab.secondaryTab?.tabId);return n.userSelectionByThreadId?.get(r)}},setMcpStdioServers:n=>{e({mcpStdioServers:n})},setMcpTools:(n,r)=>{e(s=>({mcpTools:{...s.mcpTools,[n]:r}}))},removeMcpTools:n=>{e(r=>{const s={...r.mcpTools};return delete s[n],{mcpTools:s}})},setMcpDisabledServers:n=>{e({mcpDisabledServers:n}),wt.setItem("mcp_disabled_servers_v1",JSON.stringify(Array.from(n)))},setMcpToolsSettings:n=>{e({mcpToolsSettings:n}),wt.setItem(ey,JSON.stringify(n))},setMcpToolEnabled:(n,r,s)=>{e(o=>{const a=o.mcpToolsSettings||{},i={...a[n]||{}},c=i[r]??{enabled:!0},u={...i,[r]:{...c,enabled:s}},f={...a,[n]:u};return wt.setItem(ey,JSON.stringify(f)),{mcpToolsSettings:f}})},renameMcpServerInToolsSettings:(n,r)=>{e(s=>{const o=s.mcpToolsSettings||{};if(!o[n]||n===r)return s;const a={...o},i=o[n];return a[r]={...i},delete a[n],wt.setItem(ey,JSON.stringify(a)),{mcpToolsSettings:a}})},setInstalledDxts:n=>{e({installedDxts:n})},setTaskTabs:n=>{e({taskTabs:n})},setPendingTask:(n,r)=>{e(s=>{const o=new Map(s.pendingTasks);return o.set(n,r),{pendingTasks:o}})},deletePendingTask:n=>{e(r=>{const s=new Map(r.pendingTasks);return s.delete(n),{pendingTasks:s}})},getPendingTask:n=>t().pendingTasks.get(n),setInlineAssistantParams:n=>{e(r=>({inlineAssistantParams:{...r.inlineAssistantParams,...n}}))},setInlineAssistantDraggableRegion:n=>{const r=$7(n),s=Math.floor(n.origin.x),o=Math.floor(n.origin.y),a=Math.floor(n.size.width),i=Math.floor(n.size.height);e(c=>{const u=new Map(c.inlineAssistantDraggableRegions);return u.set(r,{origin:{x:s,y:o},size:{width:a,height:i}}),{inlineAssistantDraggableRegions:u}})},removeInlineAssistantDraggableRegion:n=>{const r=$7(n);e(s=>{const o=new Map(s.inlineAssistantDraggableRegions);return o.delete(r),{inlineAssistantDraggableRegions:o}})}}}))}const d0e="mcjlamohcooanphmebaiigheeeoplihb",f0e="streamId",m0e=Object.freeze([]);class p0e{tools;mobileProxy=new dR;isTestDebugMode=!1;platform="web";store=u0e();mainExtension;agentExtension;taskTeardowns=new Map;emitter=eH();pendingServerRename;classifierApiTimeoutMs=MM;mobileAgentModule;constructor(){const t=Us();t?.android_version&&(this.platform="android"),t?.ios_version&&(this.platform="ios"),this.mainExtension=uR({onMessage:this.handleMessage,extensionId:d0e,name:"entropy_client_context"}),this.agentExtension=uR({onMessage:this.handleAgentExtensionMessage,extensionId:o0e,name:a0e}),this.tools=h0e(this.agentExtension),this.platform==="web"?this.mainExtension.sendMessage({type:"INIT"}).then(n=>{n&&(this.isTestDebugMode=!!n.isTestDebugMode)},n=>{if(Nn())throw n}):(this.mobileProxy=this.platform==="android"?new c0e:new dR,this.mobileAgentModule=q(()=>import("./agent-B4SD4dZE.js"),__vite__mapDeps([2,3,4,1])),this.fetchCurrentPageTab().catch(n=>{Z.error("[cometMobile] Error fetchCurrentPageTab",{error:n})})),Dhe()}getStore(){return this.store}getMobileProxy(){return this.mobileProxy}setClassifierApiTimeoutMs(t){this.classifierApiTimeoutMs=t}isAgentAvailable(){return this.platform!=="web"?!0:this.agentExtension.isConnected()}async openNewTab(t){const n=new URL(t);n.searchParams.delete("erp"),n.pathname=n.pathname.replace("/sidecar",""),await this.openTab({url:n.toString(),request_id:"openNewTab",key:"openNewTab",navigation_history:!1})}async moveSidecarToThread(t){try{return(await this.agentExtension.sendMessage({type:"MOVE_SIDECAR_TO_THREAD",payload:{tab_id:t}})).success}catch(n){return Z.error("MOVE_SIDECAR_TO_THREAD failed",n),!1}}_getNavigationResults(t){return this.store.getState().navigationResults[t]??m0e}async closeSideCar(t={}){return this.send({type:"HIDE_SIDECAR",payload:t})}async openTab(t){if(this.platform!=="web"){const s=(await this.mobileProxy?.bridge.tabs_create({url:t.url,hidden:!1})).tab;return{is_success:!0,_metadata:{time:1},result:{tab_id:s.id,url:s.url,title:s.title,last_accessed:s.last_accessed}}}return{is_success:!0,result:(await this.tools.OpenTab({key:t.key??"unknown",request_id:t.request_id??"unknown",url:t.url,tab_id:t.tabId,navigation_history:t.navigation_history})).tab}}async fetchMobileSearchResults(t,n){const[r,s]=await Promise.all([this.mobileProxy.bridge.fetch_navigation_search_results({query:t,stream_id:n}),Ohe(t,this.classifierApiTimeoutMs).catch(o=>(Z.error("Classifier API call failed, using defaults",{error:o,query:t,streamId:n}),Phe))]);return{...r.nav_search_response,classifierResult:s}}async fetchNavigationResults(t,n){if(this.platform==="web"){const r=await this.send({type:"NAV_SEARCH",payload:{query:t,streamId:n}});if(!r.is_success)throw new Error("Failed to inject search results");return r}else return{...await this.fetchMobileSearchResults(t,n),_metadata:void 0}}async injectSearchResults(t,n,r={},s){try{const o=Wa(),a={streamId:n,...r};Ll("web.frontend.comet_navigation_run_inject",a);const i=await this.fetchNavigationResults(t,n);if(s&&s({count:i.results?.length??0}),this.store.getState().actions.addNavigationResults(n,i),this.platform!=="web"&&i.results?.length){const p=this.store.getState();mV({clientPayloadCacheKey:`nav-${n}`,cometBrowser:this,reason:"mobile_search_injection",navigationResults:i.results,maxChars:5e4,includeSidecar:!1,attachedTabs:[],cometState:p}).catch(h=>{Z.error("Failed to save mobile navigation results",{streamId:n,error:h})})}const u={type:i.type??"unknown",...a};o.addTiming("web.frontend.comet_navigation_search_results",u);const f=o.getAbsoluteStartTime(),m={...u,startTime:f};i.searchTime&&td("web.frontend.comet_navigation_search_time",{duration:i.searchTime,...m}),i.classifyTime&&td("web.frontend.comet_navigation_classify_time",{duration:i.classifyTime,...m}),i.networkingTime&&td("web.frontend.comet_navigation_networking_time",{duration:i.networkingTime,...m}),this.platform==="web"&&i._metadata?.time&&td("web.frontend.comet_navigation_extension_processing",{duration:i._metadata.time,...m})}catch(o){Z.error(new kc("NAV_RESULTS_INJECTION_FAILED",{details:{streamId:n},cause:o}))}}async getIsCometDefaultBrowser(t){try{const n=await this.send({type:"GET_IS_DEFAULT_BROWSER",key:t});return n.is_success?n.isDefault:null}catch{return null}}async setCometAsDefaultBrowser(t){return this.send({type:"SET_AS_DEFAULT_BROWSER",key:t})}async getDidSkipCookieImportOnboarding(t){const r=(await this.send({type:"GET_ONBOARDING_IMPORT_STATUS",key:t})).importStatus==="NOT_IMPORTED";return Z.info("[getDidSkipCookieImportOnboarding]",r),r}notifyUserStateChanged(t){this.send({type:"USER_STATE_CHANGED",payload:t}).catch(()=>{})}subscribeCometNavigate(t){const n=r=>{const s=new URL(r.detail.url);Hhe({cometAdapter:this,urlSearchParams:s.searchParams}),delete window.pplxNavIntentEvent,Ll("comet_navigate");const o="/search/new";s.pathname==="/search"&&s.searchParams.has("q")&&(s.pathname=o);let a=o;if(a="/sidecar"+o,s.pathname===a){const i=crypto.randomUUID();s.searchParams.set(f0e,i);const c=r.detail.text||"";this.store.getState().actions.setLastOmniboxInput(i,c)}t({url:s})};return window.pplxNavIntentEvent&&n(window.pplxNavIntentEvent),document.addEventListener("comet-navigate",n),()=>{document.removeEventListener("comet-navigate",n)}}subscribeToAgentStepUpdate(){const t=n=>{this.sendThreadStatusToMobile({status:"working",streamId:n.detail.streamId,displayDataId:n.detail.stepAction,allowClarifications:!0})};return document.addEventListener("comet-agent-step-update",t),()=>{document.removeEventListener("comet-agent-step-update",t)}}subscribeToCometQuery(t){const n=r=>{const s=r.detail.query;delete window.pplxCometQuery,t(s,{source:r.detail.source})};return window.pplxCometQuery&&n(window.pplxCometQuery),document.addEventListener("comet-query",n),()=>{document.removeEventListener("comet-query",n)}}getLastOmniboxInput(t){return this.store.getState().omniboxInput[t]}async getCookies(){if(this.platform!=="web")return{base64_cookies:(await this.mobileProxy.bridge.agent_get_cookies()).base64_cookies};throw new Error("getCookies is only available on mobile platforms")}async searchTabs(t){if(this.platform!=="web"){const{tabs:r}=await this.mobileProxy.bridge.tabs_query();return{is_success:!0,tabs:r.map(s=>({tabId:s.id,title:s.title??"",url:s.url,isCurrent:!1,lastAccess:s.last_accessed??0,snippet:""})),_metadata:{time:1}}}return{is_success:!0,tabs:(await this.tools.SearchBrowser({queries:[],sources:["OPEN_TABS"],key:t,history_max_results:0,open_tabs_max_results:500,closed_tabs_max_results:0,request_id:t})).open_tabs_results.map(r=>({...r,tabId:r.tab_id,lastAccess:r.last_accessed}))}}async ungroupTabs(t,n,r){return{is_success:!0,tabIds:(await this.tools.UngroupTabs({group_ids:t.groupIds,tab_ids:t.tabIds,key:n,request_id:r})).ungrouped_tabs.map(o=>({id:o.tab_id,error:o.error})),groupIds:t.groupIds.map(o=>({id:o}))}}showNotification(){this.send({type:"SHOW_NOTIFICATION"}).catch(()=>{})}hideInlineAssistant(){this.send({type:"CLOSE_INLINE_ASSISTANT"}).catch(()=>{})}setInlineAssistantContentsSize(t){this.send({type:"SET_INLINE_ASSISTANT_CONTENTS_SIZE",payload:{size:t}}).catch(()=>{})}setInlineAssistantDraggableRegions(t){this.send({type:"SET_INLINE_ASSISTANT_DRAGGABLE_REGIONS",payload:{regions:t}}).catch(()=>{})}addInlineAssistantDraggableRegion(t){this.store.getState().actions.setInlineAssistantDraggableRegion(t);const n=Array.from(this.store.getState().inlineAssistantDraggableRegions.values());this.setInlineAssistantDraggableRegions(n)}removeInlineAssistantDraggableRegion(t){this.store.getState().actions.removeInlineAssistantDraggableRegion(t);const n=Array.from(this.store.getState().inlineAssistantDraggableRegions.values());this.setInlineAssistantDraggableRegions(n)}sendThreadStatusToMobile(t){const{status:n,streamId:r,text:s,displayDataId:o,allowClarifications:a}=t;this.mobileProxy.bridge.thread_status({type:n,text:s,stream_id:r,display_data_id:o,allow_clarifications:a??!1}).catch(i=>{Z.error("Failed to send thread status to mobile bridge",i)})}sendVoiceStatusToMobile(t){const{status:n,text:r}=t;this.mobileProxy.bridge.voice_status({type:n,text:r}).catch(s=>{Z.error("Failed to send voice status to mobile bridge",s)})}openUserSettings(){this.platform!=="web"&&this.mobileProxy.bridge.open_user_settings().catch(t=>{Z.error("Failed to open user settings on mobile",t)})}setNativeInputVisibility(t){this.platform!=="web"&&this.mobileProxy.bridge.set_native_input_visibility({visible:t}).catch(n=>{Z.error("Failed to set native input visibility",n)})}openNativeSheet(t){this.platform!=="web"&&this.mobileProxy.bridge.app_navigate({target:t}).catch(n=>{Z.error(`Failed to open native ${t} sheet`,n)})}subscribeToMobileCommands(t){const n=r=>{r.detail.cmd==="update-context"?this.store.getState().actions.setSourceTab({secondaryTab:null,tabId:r.detail.tab.id,title:r.detail.tab.title,url:r.detail.tab.url}):t?t(r.detail):r.detail.cmd==="stop"&&r.detail.subject==="thread"?this.emitter.emit("BROWSER_TASK_STOP"):Z.warn("[comet-mobile] Unknown mobile command",r.detail.cmd)};return document.addEventListener("comet-mobile-cmd",n),()=>{document.removeEventListener("comet-mobile-cmd",n)}}setTabProgress(t){this.send({type:"SET_TAB_PROGRESS",payload:t}).catch(()=>{})}voiceAssistantPushVoiceLevel(t){this.send({type:"VOICE_ASSISTANT_PUSH_VOICE_LEVEL",payload:{levels:t}}).catch(()=>{})}voiceAssistantChangeSpeakerRole(t){this.send({type:"VOICE_ASSISTANT_CHANGE_SPEAKER_ROLE",payload:{role:t}}).catch(()=>{})}voiceAssistantNotifyConnected(){this.send({type:"VOICE_ASSISTANT_NOTIFY_CONNECTED"}).catch(()=>{})}voiceAssistantNotifyDisconnected(){this.send({type:"VOICE_ASSISTANT_NOTIFY_DISCONNECTED"}).catch(()=>{})}voiceAssistantStop(){this.send({type:"VOICE_ASSISTANT_STOP"}).catch(()=>{})}voiceAssistantShowWindow(){this.send({type:"VOICE_ASSISTANT_SHOW_WINDOW"}).catch(()=>{})}voiceAssistantHideWindow(){this.send({type:"VOICE_ASSISTANT_HIDE_WINDOW"}).catch(()=>{})}voiceAssistantSetDraggableRegions(t){this.send({type:"VOICE_ASSISTANT_SET_DRAGGABLE_REGIONS",payload:{regions:t}}).catch(()=>{})}async searchTabGroups(t,n,r){return{is_success:!0,results:(await this.tools.SearchTabGroups({queries:t.queries,request_id:r,key:n})).tab_groups.map(o=>({...o,color:o.color,tabs:o.tabs.map(a=>({...a,tabId:a.tab_id,isCurrent:a.is_current_tab??!1}))}))}}showFeedbackForm(){this.send({type:"SHOW_FEEDBACK_FORM"}).catch(()=>{})}subscribeScreenshotCaptured(t){return this.emitter.on("SCREENSHOT_CAPTURED",t)}handleAgentExtensionMessage=t=>{try{Vi(t).with({type:"SCREENSHOT_CAPTURED"},async({payload:{screenshot:n}})=>{const s=await(await fetch(n)).blob(),o=new File([s],"screenshot.png",{type:s.type});Z.info("Screenshot captured"),this.emitter.emit("SCREENSHOT_CAPTURED",o)}).with({type:"BROWSER_TASK_PROGRESS_SCREENSHOT"},async({payload:{screenshot:n,taskUuid:r}})=>{this.store.getState().actions.addTaskScreenshot(r,n)}).with({type:"ACTION_STARTED"},({payload:{uuid:n,action:r}})=>{this.store.getState().actions.addComputerAction(n,{action:r.action?.toLowerCase(),text:r.text,duration:r.duration})}).with({type:"BROWSER_TASK_PROGRESS"},({payload:{taskUuid:n,progress:r}})=>{const s=this.store.getState().actions.getPendingTask(n);s?.onProgress&&s.onProgress(r),this.emitter.emit("BROWSER_TASK_PROGRESS",n,r)}).with({type:"BROWSER_TASK_COMPLETE"},({payload:{taskUuid:n,result:r}})=>{const s=this.store.getState().actions.getPendingTask(n);s&&(this.store.getState().actions.deletePendingTask(n),s.resolve(r)),this.emitter.emit("BROWSER_TASK_COMPLETE",n,r)}).with({type:"BROWSER_TASK_STOP"},({payload:n})=>{Z.info("Browser task stopped"),this.emitter.emit("BROWSER_TASK_STOP",n.entryId)}).with({type:"BROWSER_TASK_PAUSE_RESUME_FRONTEND"},({payload:n})=>{Z.info("Browser task paused/resumed"),this.store.getState().actions.setTaskState(n.task_uuid,n.is_paused)}).with({type:"AGENT_TASK_FAILURE"},({payload:{taskUuid:n,extraHeaders:r,error:s}})=>{const o=this.store.getState().actions.getPendingTask(n);o&&(this.store.getState().actions.deletePendingTask(n),o.reject(new Error(s))),X1({clientPayloadCacheKey:n,errorType:s,errorMsg:"Agent task failure."},r,"CometAdapter").catch(a=>{Z.error("Error sending tool failure",a)})}).with({type:"USER_SELECTION_CAPTURED"},({payload:{selection:n}})=>{this.store.getState().actions.setUserSelection(n)}).with({type:"MOVE_THREAD_TO_SIDECAR"},({payload:{url:n,task_tab_ids:r,entry_id:s,thread_url_slug:o,auto_opened:a}})=>{if(a!==void 0){const u=this.store.getState().sidecarSourceTab,f=ro(u.tabId,u.secondaryTab?.tabId);this.store.getState().actions.setSidecarAutoOpened(a,f)}let i,c;o?(c=new URL(window.location.href),c.pathname="/sidecar/search/"+o,i=c.toString()):s?(c=new URL(window.location.href),c.pathname="/sidecar/search/"+s,i=c.toString()):(c=new URL(n),c.pathname="/sidecar"+Bhe(c.pathname),i=c.toString()),r.forEach(u=>{const f=ro(u,void 0);this.store.getState().actions.setSidecarUrlById(f,c.pathname)}),!(o&&window.location.pathname.includes(o))&&document.dispatchEvent(new CustomEvent("comet-navigate",{detail:{url:i,text:""}}))}).with({type:"GET_TASK_TABS"},({payload:{tabs:n}})=>{this.store.getState().actions.setTaskTabs(n)}).with({type:"MCP_STDIO_SERVER_CHANGED"},({payload:{serverName:n,changes:r,server:s}})=>{this.handleMcpStdioServerChanged(n,r,s)}).with({type:"MCP_PERSISTED_STDIO_SERVERS_LOADED"},()=>{this.handleMcpPersistedStdioServersLoaded()}).with({type:"MCP_STDIO_SERVER_ADDED"},({payload:{server:n}})=>{this.handleMcpStdioServerAdded(n)}).with({type:"MCP_STDIO_SERVER_REMOVED"},({payload:{serverName:n}})=>{this.handleMcpStdioServerRemoved(n)}).otherwise(n=>{Z.log("Unknown message type",n)})}catch(n){Z.error("Error parsing entropy message",n)}};async fetchOpenedTabs(){const t=await this.searchTabs("fetch_opened_tabs");return t.is_success?t.tabs.filter(n=>(n.url.startsWith("https://")||n.url.startsWith("file://"))&&!n.isCurrent).sort((n,r)=>r.lastAccess-n.lastAccess):[]}async getPersonalSuggestions(t,n){return this.send({type:"GET_PERSONAL_SUGGESTIONS",payload:t,key:n})}async getTopMostVisitedUrls(t,n){return this.send({type:"GET_TOP_MOST_VISITED_URLS",payload:t,key:n})}getQuickActions(t){return this.send({type:"GET_QUICK_ACTIONS",key:t})}async getInitialHistorySummary(t,n,r){return this.SearchBrowser({queries:[],sources:["HISTORY"],key:"initial-history-summary",request_id:t,start_time:n*24*60*60*1e3,history_max_results:r,open_tabs_max_results:r,closed_tabs_max_results:r})}async getHistorySummary(t,n=[],r=14,s=20){return this.SearchBrowser({queries:n,sources:["HISTORY"],key:t,request_id:"",start_time:r*24*60*60*1e3,history_max_results:s,open_tabs_max_results:s,closed_tabs_max_results:s})}async GetContent(t){return this.platform!=="web"?{contents:(await Promise.allSettled(t.pages.map(async r=>r.id?(await this.mobileProxy.bridge.tabs_get_content({id:r.id})).tab_content:(await this.mobileProxy.bridge.tabs_get_url_content({url:r.url})).tab_content))).map(r=>r.status==="fulfilled"?r.value:void 0).filter(r=>r!==void 0).map(r=>({html:"",id:r.id,url:r.url,title:r.title??"",og_meta:r.og_meta??{},markdown:r.markdown??""}))}:this.tools.GetContent(t)}async GetVisibleTabScreenshot(t){return this.tools.GetVisibleTabScreenshot(t)}async SearchBrowser(t){if(this.platform!=="web"){const n=t.sources.includes("HISTORY")?Promise.allSettled((t.queries.length?t.queries:[""]).map(async a=>await this.mobileProxy.bridge.history_search({text:a,max_results:t.history_max_results,start_time:t.start_time,end_time:t.end_time}))):[],[{tabs:r},s]=await Promise.all([t.sources.includes("OPEN_TABS")?this.mobileProxy.bridge.tabs_query():{tabs:[]},n]),o=s.map(a=>a.status==="fulfilled"?a.value.history_items:[]).flat().map(a=>({title:a.title??"",url:a.url,last_accessed:a.last_visit_time??Date.now(),visit_count:a.visit_count??1}));return{closed_tabs_results:[],history_results:o,open_tabs_results:r.map(a=>({tab_id:a.id,title:a.title??"",url:a.url,last_accessed:a.last_accessed??0}))}}return this.tools.SearchBrowser(t)}async GetSidecarContext(t){if(this.platform!=="web"){const r=(await this.mobileProxy.bridge.tabs_query()).tabs.sort((a,i)=>(i.last_accessed??-1)-(a.last_accessed??-1))[0];if(!r)return{content:void 0,contents:void 0};const s=(await this.mobileProxy.bridge.tabs_get_content({id:r?.id})).tab_content,o={id:s.id,html:"",markdown:s.markdown,og_meta:s.og_meta,title:s.title,url:s.url};return{content:o,contents:[o]}}return this.tools.GetSidecarContext(t)}async closeTabs(t,n,r){if(this.platform!=="web"){const{tabs:o}=await this.mobileProxy.bridge.tabs_query(),a=t.tabIds??[],i=o.filter(c=>a.includes(c.id));return i.forEach(c=>{this.mobileProxy.bridge.tabs_close({id:c.id})}),{is_success:!0,result:i.map(c=>({id:c.id,url:c.url,title:c.title??""}))}}return{is_success:!0,result:(await this.tools.CloseTabs({tab_ids:t.tabIds??[],key:n,request_id:r})).tabs.map(o=>({id:o.tab_id,...o}))}}async groupTabs(t,n,r){const s=await this.tools.GroupTabs({...t,tab_ids:t.tabIds,group_id:t.groupId,key:n,request_id:r});if(!s.tab_group)throw new Error("[GroupTabs] Tab group not found");return{is_success:!0,tabGroup:{id:s.tab_group.id,title:s.tab_group.title,collapsed:s.tab_group.collapsed??!1,color:s.tab_group.color}}}async maybeSendSearchResult(t,n,r){if(!this.isTestDebugMode||!t)return;const o=[...t.web_results??[],...t.extra_web_results??[]].map(a=>({name:a.name,snippet:a.snippet,url:a.url,isClientContext:!!a.is_client_context}));return this.send({type:"PERPLEXITY_SEARCH_RESULT",payload:{answer:t.answer,webResults:o,isPending:r,steps:n.map(a=>a.step_type)}})}submitTask(t,n){return new Promise((r,s)=>{const o=t.entryId,a=t.uuid;this.store.getState().actions.setPendingTask(a,{entryId:t.entryId,uuid:t.uuid,resolve:r,reject:s,onProgress:n});const i=this.taskTeardowns.get(o)??[];if(this.taskTeardowns.set(o,i),this.platform!=="web"){let c=!1;try{const u=JSON.parse(t.extra_headers);typeof u.use_native_agent=="boolean"&&(c=u.use_native_agent)}catch{}if(c){const u=Us();Z.info("[comet] Starting native agent",{entryId:o,uuid:t.uuid,platform:this.platform,task:t.task,androidVersion:u?.android_version}),i.push(f=>{Z.info("[comet] Native agent task finished",{entryId:o,uuid:t.uuid,platform:this.platform,reason:f,task:t.task,androidVersion:u?.android_version}),this.mobileProxy.bridge.agent_stop({entry_id:o}).catch(m=>{Z.error("[comet] Native agent stop failed",{error:m,entryId:o,platform:this.platform,uuid:t.uuid,task:t.task,androidVersion:u?.android_version})}),this.store.getState().actions.setTaskState(t.uuid,void 0)}),this.mobileProxy.bridge.agent_start({task:t.task,start_url:t.start_url,uuid:t.uuid,tab_id:t.tab_id,base_url:t.base_url,extra_headers:t.extra_headers,entry_id:t.entryId}).then(f=>{f.success?r({message:"Native agent started",success:!0}):s(new Error("Native agent failed to start"))}).catch(f=>{Z.error("[comet] Native agent start failed",{error:f}),s(f)});return}this.mobileAgentModule.then(async({startAgent:u})=>{try{const f=await u(t,this.mobileProxy.bridge,(m,p)=>{this.store.getState().actions.addTaskScreenshot(p,m)},(m,p)=>{this.store.getState().actions.addComputerAction(m,{action:p.action?.toLowerCase(),text:p.text,duration:p.duration})});i.push(m=>{f(m),this.store.getState().actions.setTaskState(t.uuid,void 0)}),r({message:"Mobile task started",success:!0})}catch(f){Z.error("[comet] Mobile agent failed to start",{error:f});const m=this.store.getState().actions.getPendingTask(a);m&&(this.store.getState().actions.deletePendingTask(a),m.reject(f instanceof Error?f:new Error(String(f))));let p={};try{p=JSON.parse(t.extra_headers)}catch{}X1({clientPayloadCacheKey:a,errorType:"unhandled",errorMsg:f instanceof Error?f.message:String(f)},p,"CometAdapter").catch(h=>{Z.error("Error sending tool failure",h)}),s(f)}}).catch(u=>{Z.error("[comet] Mobile agent module failed to load",{error:u}),s(u)});return}this.agentExtension.sendMessage(t).then(()=>{i.push(c=>{this.agentExtension.sendMessage({type:"CLEANUP_AGENT_TASKS",payload:{entryId:t.entryId,reason:c}})})}).catch(c=>{let u={};try{u=JSON.parse(t.extra_headers)}catch{}Z.error("[comet] Unhandled error while submitting task",c),X1({clientPayloadCacheKey:a,errorType:c,errorMsg:"Agent task start failure."},u,"CometAdapter").catch(f=>{Z.error("Error sending tool failure",f)})})})}async moveThreadToSidecar({activeTaskUuid:t,entryId:n,isMissionControl:r,isSubagent:s,reason:o,animate:a,takeFocus:i,autoOpened:c=!0}){try{return(await this.agentExtension.sendMessage({type:"MOVE_THREAD_TO_SIDECAR",payload:{active_task_uuid:t,is_mission_control:r,is_subagent:s,entry_id:n,animate:a,takeFocus:i,auto_opened:c}})).success}catch(u){return Z.error(new kc("MOVE_THREAD_TO_SIDECAR_FAILED",{cause:u,message:`Failed to move thread to sidecar for ${o}`})),!1}}getTaskTabs(){this.agentExtension.sendMessage({type:"GET_TASK_TABS"})}async sendMissionControlStatus(t){await this.agentExtension.sendMessage({type:"MISSION_CONTROL_STATUS",payload:t})}async makeTaskVisible(t){const n=await this.agentExtension.sendMessage({type:"MAKE_TASK_VISIBLE",payload:{task_uuid:t}});if(n.tab_ids){const r=new URL(window.location.href).pathname;n.tab_ids.forEach(s=>{this.store.getState().actions.setSidecarUrlById(ro(s,void 0),r)})}}cleanupTasks(t,n){if(!t)return;const r=this.taskTeardowns.get(t);if(!r){this.platform==="web"?this.agentExtension.sendMessage({type:"CLEANUP_AGENT_TASKS",payload:{entryId:t,reason:n}}):this.mobileProxy.bridge.agent_stop({entry_id:t}).catch(s=>{Z.error("[comet] Native agent stop failed",{error:s,entryId:t})});return}r.forEach(s=>s(n)),this.taskTeardowns.delete(t)}captureSourceTabScreenshotV2({sourceTabUrl:t=""}){this.agentExtension.sendMessage({type:"CAPTURE_SCREENSHOT_V2",payload:{tabId:void 0,sourceTabUrl:t}})}deactivateScreenshotTool(){this.agentExtension.sendMessage({type:"DEACTIVATE_SCREENSHOT_TOOL",payload:{tabId:void 0}})}subscribeToSidecarBrowserTaskStop(t){return this.emitter.on("BROWSER_TASK_STOP",t)}subscribeForceSubmitQuery(t){return this.emitter.on("FORCE_SUBMIT_QUERY",t)}subscribeQuickActionButtonFired(t){return this.emitter.on("QUICK_ACTION_BUTTON_FIRED",t)}subscribeVoiceAssistantStarted(t){return this.emitter.on("VOICE_ASSISTANT_STARTED",t)}subscribeVoiceAssistantStopped(t){return this.emitter.on("VOICE_ASSISTANT_STOPPED",t)}getMcpTools(t){return this.sendToAgent({type:"GET_MCP_TOOLS",payload:{serverName:t}})}callMcpTool(t,n){return this.sendToAgent({type:"CALL_MCP_TOOL",payload:t,context:n})}getMcpStdioServers(){const t=this.sendToAgent({type:"GET_STDIO_MCP_SERVERS",payload:void 0});return t.then(n=>{this.getStore().getState().actions.setMcpStdioServers(n)}).catch(()=>{}),t}addMcpStdioServer(t){return this.sendToAgent({type:"ADD_STDIO_MCP_SERVER",payload:t})}async updateMcpStdioServer(t,n){try{return await this.sendToAgent({type:"UPDATE_STDIO_MCP_SERVER",payload:{existingServerName:t,updates:n}})}catch(r){if(!(r instanceof Error)||!r.message.startsWith("Error in invocation of perplexity.mcp.updateStdioServer")&&!r.message.startsWith("chrome.perplexity.mcp.updateStdioServer is not a function"))throw r;return n.name&&n.name!==t?this.pendingServerRename={oldName:t,newName:n.name}:this.pendingServerRename=void 0,await this.removeMcpStdioServer(t,!0),this.addMcpStdioServer(n)}}async removeMcpStdioServer(t,n){await this.sendToAgent({type:"REMOVE_STDIO_MCP_SERVER",payload:{name:t}}),this.clearStateAfterRemovingMcpServer(t,n)}installDxt(t){return this.sendToAgent({type:"INSTALL_DXT",payload:{url:t}})}async uninstallDxt(t){await this.sendToAgent({type:"UNINSTALL_DXT",payload:{name:t}}),this.clearStateAfterRemovingMcpServer(t)}getInstalledDxts(){const t=this.sendToAgent({type:"GET_INSTALLED_DXT"});return t.then(n=>{this.getStore().getState().actions.setInstalledDxts(n)}).catch(()=>{}),t}async refreshDxtAndMcpState(){await Promise.all([this.getMcpStdioServers(),this.getInstalledDxts()])}async hasPermission(t){try{return await this.sendToAgent({type:"HAS_PERMISSION",payload:{permission:t}})}catch{return null}}async requestPermission(t){try{return await this.sendToAgent({type:"REQUEST_PERMISSION",payload:{permission:t}})}catch{return null}}handleMcpStdioServerChanged(t,n,r){const s=this.getStore().getState(),o=s.mcpStdioServers??[],a=o.findIndex(c=>c.name===t);if(a===-1)return;const i=[...o];i[a]=r,s.actions.setMcpStdioServers(i)}async handleMcpPersistedStdioServersLoaded(){await this.getMcpStdioServers()}handleMcpStdioServerAdded(t){const n=this.getStore().getState(),r=n.mcpStdioServers??[];if(r.findIndex(a=>a.name===t.name)!==-1)return;const o=[...r,t];n.actions.setMcpStdioServers(o)}handleMcpStdioServerRemoved(t){const n=this.getStore().getState(),s=(n.mcpStdioServers??[]).filter(o=>o.name!==t);n.actions.setMcpStdioServers(s)}async fetchCurrentPageTab(){if(this.platform==="web")return;const n=(await this.mobileProxy.bridge.tabs_query()).tabs.sort((r,s)=>(s.last_accessed??-1)-(r.last_accessed??-1))[0];n&&this.store.getState().actions.setSourceTab({tabId:n.id,title:n.title??"",url:n.url,secondaryTab:null})}async send(t){return this.mainExtension.sendMessage(t).then(n=>(n.is_success=!n.errorType,n))}async sendToAgent(t){return this.agentExtension.sendMessage(t).then(n=>{if(!n.success)throw new Error(n.error);return n.response})}handleMessage=t=>{try{Vi(t).with({type:"UPDATE_SOURCE_TAB"},r=>{this.store.getState().actions.setSourceTab(r.payload),r.payload.url!==this.store.getState().sidecarSourceTab.url&&this.store.getState().actions.clearUserSelection()}).with({type:"FORCE_SUBMIT_QUERY"},r=>{this.isTestDebugMode&&this.emitter.emit("FORCE_SUBMIT_QUERY",r.payload)}).with({type:"QUICK_ACTION_BUTTON_FIRED"},()=>{this.emitter.emit("QUICK_ACTION_BUTTON_FIRED")}).with({type:"VOICE_ASSISTANT_STARTED"},()=>{this.emitter.emit("VOICE_ASSISTANT_STARTED")}).with({type:"VOICE_ASSISTANT_STOPPED"},()=>{this.emitter.emit("VOICE_ASSISTANT_STOPPED")}).with({type:"EDITABLE_ELEMENT_FOCUS_STATE"},r=>{this.store.getState().actions.setInlineAssistantParams({canInsert:r.payload.canInsert})}).with({type:"INIT"},r=>{this.isTestDebugMode=!!r.payload.isTestDebugMode,this.store.getState().actions.setPlatformInfo(r.payload.platform);const s=this.store.getState().actions;s.setSourceTab({tabId:r.payload.sourceTabId??-1,url:r.payload.sourceTabUrl??"",title:r.payload.sourceTabTitle??"",secondaryTab:r.payload.sourceSecondaryTab??null}),r.payload.selection&&s.setUserSelection(r.payload.selection)}).otherwise(r=>{Z.log("Unknown message type",r)})}catch(n){Z.error("Error parsing entropy message",n)}};clearStateAfterRemovingMcpServer(t,n){const r=this.getStore().getState(),s=r.mcpDisabledServers??new Set;if(s.has(t)){const a=new Set(s);a.delete(t),r.actions.setMcpDisabledServers(a)}if(n&&!this.pendingServerRename)return;if(this.pendingServerRename&&this.pendingServerRename.oldName===t){r.actions.renameMcpServerInToolsSettings(this.pendingServerRename.oldName,this.pendingServerRename.newName),this.pendingServerRename=void 0;return}const o=r.mcpToolsSettings??{};if(o[t]){const a={...o};delete a[t],r.actions.setMcpToolsSettings(a)}}async getPrivacyInfo(t){try{const n=await this.send({type:"GET_PRIVACY_INFO",key:t});return n.is_success?n:null}catch{return null}}async insertInlineAssistantSelection(t,n){try{return(await this.agentExtension.sendMessage({type:"INSERT_INLINE_TEXT",payload:{text:n},key:t})).success}catch{return!1}}async getSiteOnboardingStatus(t){try{const n=await this.mainExtension.sendMessage({type:"GET_SITE_ONBOARDING_STATUS",key:t});return n.started===null?void 0:n.started}catch{return}}async setSiteOnboardingStatus(t,n){try{await this.mainExtension.sendMessage({type:"SET_SITE_ONBOARDING_STATUS",key:t,payload:{started:n}})}catch{}}}const h0e=e=>new Proxy({},{get(t,n){return r=>e.sendMessage({type:"CALL_TOOL",method:n,request:r}).then(({success:s,response:o})=>{if(!s)throw o;return o}).catch(s=>{throw Z.error("Error calling tool",s),"errorType"in s?s:{errorType:"unhandled",errorMsg:"Proxy error."}})}});class g0e{mobileProxy;cometAdapter;_shouldUseMobileProxyForMCP=null;constructor(t,n){this.mobileProxy=t,this.cometAdapter=n}get shouldUseMobileProxyForMCP(){if(this._shouldUseMobileProxyForMCP===null)if(Io())this._shouldUseMobileProxyForMCP=!0;else if(Nn())this._shouldUseMobileProxyForMCP=!1;else{const t=this.mobileProxy.isAvailable;t!==void 0&&(this._shouldUseMobileProxyForMCP=t)}return this._shouldUseMobileProxyForMCP??!1}async getMcpTools(t){if(this.shouldUseMobileProxyForMCP){const n=this.mobileProxy.bridge.get_mcp_tools({server_name:t});return n.catch(r=>{Z.error("get_mcp_tools failed:",r)}),n.then(r=>r.tools)}return this.cometAdapter.getMcpTools(t)}async callMcpTool(t,n){if(this.shouldUseMobileProxyForMCP){const r=this.mobileProxy.bridge.call_mcp_tool({params:t});return r.catch(s=>{Z.error("call_mcp_tool failed:",s)}),r.then(s=>({content:s.result}))}return this.cometAdapter.callMcpTool(t,n)}async getMcpStdioServers(){if(this.shouldUseMobileProxyForMCP){const t=this.mobileProxy.bridge.get_mcp_servers();return t.catch(n=>{Z.error("get_mcp_servers failed:",n)}),t.then(n=>(this.cometAdapter.getStore().getState().actions.setMcpStdioServers(n.servers),n.servers))}return this.cometAdapter.getMcpStdioServers()}async getInstalledDxts(){return this.shouldUseMobileProxyForMCP?[]:this.cometAdapter.getInstalledDxts()}async refreshDxtAndMcpState(){await Promise.all([this.getMcpStdioServers(),this.getInstalledDxts()])}initializeFromWindowTools(t){try{if(!t?.servers)return;const n=this.cometAdapter.getStore();Object.entries(t.servers).forEach(([r,s])=>{s&&Array.isArray(s)&&n.getState().actions.setMcpTools(r,s)})}catch(n){Z.error("Failed to initialize MCP tools from window",n)}}}const tH="native_bridge";function y0e(e){try{const t=JSON.parse(e);return{info_version:typeof t.info_version=="string"?t.info_version:void 0,local_mcp:{call:t.local_mcp?.call===!0,edit:t.local_mcp?.edit===!0}}}catch(t){Z.warn("[NativeClientCapabilities] Invalid JSON",t);return}}const x0e=Sf(function(){const t=hr(tH);if(t)return y0e(t)},()=>Math.floor(Date.now()/(3600*1e3)));function v0e(){return!!hr(tH)}const b0e=Sf(function(){const t=x0e();if(t)return t;if(!Io()&&Nn())return{info_version:"1",local_mcp:{call:!0,edit:!0}}},()=>Math.floor(Date.now()/(3600*1e3))),_0e=Symbol(),nH=Symbol(),Jm="a",rH="f",fR="p",sH="c",oH="t",aH="h",ty="w",iH="o",lH="k";let w0e=(e,t)=>new Proxy(e,t);const ZS=Object.getPrototypeOf,mR=new WeakMap,C0e=e=>e&&(mR.has(e)?mR.get(e):ZS(e)===Object.prototype||ZS(e)===Array.prototype),pR=e=>typeof e=="object"&&e!==null,S0e=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(t=>!t.configurable&&!t.writable),E0e=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create(ZS(e),t)},k0e=(e,t)=>{const n={[rH]:t};let r=!1;const s=(i,c)=>{if(!r){let u=n[Jm].get(e);if(u||(u={},n[Jm].set(e,u)),i===ty)u[ty]=!0;else{let f=u[i];f||(f=new Set,u[i]=f),f.add(c)}}},o=()=>{r=!0,n[Jm].delete(e)},a={get(i,c){return c===nH?e:(s(lH,c),uH(Reflect.get(i,c),n[Jm],n[sH],n[oH]))},has(i,c){return c===_0e?(o(),!0):(s(aH,c),Reflect.has(i,c))},getOwnPropertyDescriptor(i,c){return s(iH,c),Reflect.getOwnPropertyDescriptor(i,c)},ownKeys(i){return s(ty),Reflect.ownKeys(i)}};return t&&(a.set=a.deleteProperty=()=>!1),[a,n]},cH=e=>e[nH]||e,uH=(e,t,n,r)=>{if(!C0e(e))return e;let s=r&&r.get(e);if(!s){const c=cH(e);S0e(c)?s=[c,E0e(c)]:s=[c],r?.set(e,s)}const[o,a]=s;let i=n&&n.get(o);return(!i||i[1][rH]!==!!a)&&(i=k0e(o,!!a),i[1][fR]=w0e(a||o,i[0]),n&&n.set(o,i)),i[1][Jm]=t,i[1][sH]=n,i[1][oH]=r,i[1][fR]},M0e=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((s,o)=>s!==r[o])},JS=(e,t,n,r,s=Object.is)=>{if(s(e,t))return!1;if(!pR(e)||!pR(t))return!0;const o=n.get(cH(e));if(!o)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let a=null;for(const i of o[aH]||[])if(a=Reflect.has(e,i)!==Reflect.has(t,i),a)return a;if(o[ty]===!0){if(a=M0e(e,t),a)return a}else for(const i of o[iH]||[]){const c=!!Reflect.getOwnPropertyDescriptor(e,i),u=!!Reflect.getOwnPropertyDescriptor(t,i);if(a=c!==u,a)return a}for(const i of o[lH]||[])if(a=JS(e[i],t[i],n,r,s),a)return a;if(a===null)throw new Error("invalid used");return a},dH=e=>()=>{const[,n]=d.useReducer(u=>u+1,0),r=d.useMemo(()=>new WeakMap,[]),s=d.useRef(),o=d.useRef();d.useEffect(()=>{s.current!==o.current&&JS(s.current,o.current,r,new WeakMap)&&(s.current=o.current,n())});const a=d.useCallback(u=>(o.current=u,s.current&&s.current!==u&&!JS(s.current,u,r,new WeakMap)?s.current:(s.current=u,u)),[r]),i=e(a),c=d.useMemo(()=>new WeakMap,[]);return uH(i,r,c)};function d4(e){const t=zt(e,null),{useSelector:n,useStore:r,useTrackedState:s}=fH(t,e);return{Context:t,useSelector:n,useStore:r,useTrackedState:s}}function fH(e,t){const n=()=>{const o=T.useContext(e);if(!o)throw new Error(`This hook must be used within ${t}.Provider`);return o},r=o=>n()(o),s=dH(r);return{useSelector:r,useStore:n,useTrackedState:s}}function T0e(e,t){const n=new Set,r={source:void 0,derived:void 0},s=()=>{const a=e.getState();return(r.derived===void 0||r.source!==a)&&(r.source=a,r.derived=t(a)),r.derived},o=e.subscribe((a,i)=>{const c=t(a),u=t(i);n.forEach(f=>f(c,u)),r.source=a,r.derived=c});return[{getState:s,getInitialState:()=>t(e.getInitialState()),subscribe:a=>(n.add(a),()=>n.delete(a))},o]}function A0e(e,t){const[n,r]=d.useMemo(()=>T0e(e,t),[e,t]);return d.useEffect(()=>()=>r(),[r]),n}function N0e(e,t){const n=A0e(e,t);return d.useMemo(()=>{const r=s=>bme(n,s);return{useSelector:r,useProxy:dH(r)}},[n])}const Jh=(e,t)=>{const n=zt(e,null),r=i=>{const[c]=T.useState(()=>i.initialValue?t(i?.initialValue):t(void 0));return l.jsx(n.Provider,{value:c,children:i.children})},{useSelector:s,useStore:o,useTrackedState:a}=fH(n,e);return{useSelector:s,useStore:o,useTrackedState:a,Context:n,Provider:r}},bo=new p0e,Wy=new g0e(bo.getMobileProxy(),bo),{Provider:R0e,useTrackedState:D0e}=Jh("CometContext",()=>bo.getStore()),mH=zt("EntropyBrowserContext",void 0),pH=zt("McpAdapterContext",void 0),j0e=({children:e})=>{const t=Dn(),n=Hfe(),r=Nn(),{session:s,status:o}=je(),{variation:a,loading:i}=Qge(MM),c=v0e();d.useLayoutEffect(()=>{c&&window.initialMCPTools!=null&&(Wy.initializeFromWindowTools(window.initialMCPTools),window.initialMCPTools=void 0)},[c]),d.useEffect(()=>{i||bo.setClassifierApiTimeoutMs(a)},[a,i]);const u=s?.user?.id,f=s?.user?.subscription_tier;d.useEffect(()=>{if(r)switch(o){case"authenticated":return u?bo.notifyUserStateChanged({status:o,userId:u,subscriptionTier:f??"free"}):void 0;case"unauthenticated":return bo.notifyUserStateChanged({status:o})}},[o,u,f,r]),d.useMemo(()=>{},[]),d.useLayoutEffect(()=>{const h=Ml();h.erp&&(document.documentElement.dataset.erp=h.erp);const g=bo.subscribeCometNavigate(({url:_})=>{if(_.origin===window.location.origin&&_.pathname.startsWith(t.base)&&(_.pathname=_.pathname.replace(t.base,""),n(_.pathname))){const w=_.searchParams.toString(),S=`${_.pathname}${w?`?${w}`:""}`;t.push(S,void 0,"Comet navigate");return}{Z.error("Invalid soft navigation in Sidecar",{url:_}),bo.openTab({url:_.toString()});return}}),y=bo.getStore(),x=setInterval(()=>{y.getState().sidecarUrlById.forEach((w,S)=>{w.updatedAt{if(Er(_.sidecarSourceTab,w.sidecarSourceTab))return;const S=_.sidecarSourceTab,C=ro(v.tabId,v.secondaryTab?.tabId),E=ro(S.tabId,S.secondaryTab?.tabId);if(E===C)return;const N=new URL(window.location.href).pathname;jhe(v.tabId,v.secondaryTab?.tabId).forEach(A=>{y.getState().actions.setSidecarUrlById(A,N)});const M=y.getState().sidecarUrlById.get(E)?.url??"/";v=S,M!==N&&(t.replace(M,"Sidecar source tab changed"),cR(y))});return()=>{clearInterval(x),g(),b()}},[t,n]),d.useEffect(()=>bo.subscribeToSidecarBrowserTaskStop(h=>{h&&(lu({entryUUID:h,reason:"terminate-from-comet-adapter"}),bo.cleanupTasks(h,"query_stopped"))}),[]);const{variation:m}=ZV(!1),p=r?m:c;return l.jsx(R0e,{children:l.jsx(mH.Provider,{value:bo,children:l.jsxs(pH.Provider,{value:Wy,children:[e,p&&l.jsx(P0e,{})]})})})};function ln(e=!0){const t=d.useContext(mH);if(!t&&e)throw new Error("useEntropyBrowser must be used inside EntropyBrowserProvider");return t}function I0e(e=!0){const t=d.useContext(pH);if(!t&&e)throw new Error("useMcpAdapter must be used inside EntropyBrowserProvider");return t}const zn=D0e,P0e=()=>{const e=zn();return d.useEffect(()=>{Wy.refreshDxtAndMcpState().catch(()=>{})},[]),d.useEffect(()=>{if(!e.mcpDisabledServers)try{const t=wt.getItem("mcp_disabled_servers_v1"),n=t?JSON.parse(t):[];e.actions.setMcpDisabledServers(new Set(n))}catch{e.actions.setMcpDisabledServers(new Set)}},[e.mcpDisabledServers,e.actions]),d.useEffect(()=>{if(!e.mcpToolsSettings)try{const t=wt.getItem(ey),n=t?JSON.parse(t):{};e.actions.setMcpToolsSettings(n)}catch{e.actions.setMcpToolsSettings({})}},[e.mcpToolsSettings,e.actions]),l.jsx(l.Fragment,{children:e.mcpStdioServers?.map(t=>l.jsx(O0e,{server:t},t.name))})},O0e=({server:e})=>{const t=zn(),{data:n}=gt({queryKey:be.makeQueryKey("comet/mcp_tools",e.name),queryFn:async()=>(await Wy.getMcpTools(e.name).catch(()=>[])).map(s=>({...s,mcp_server:e.name,mcp_server_type:bhe.MCP_SERVER_TYPE_LOCAL,app:e.name})),enabled:!!e.name});return d.useEffect(()=>{if(n)return t.actions.setMcpTools(e.name,n),()=>{t.actions.removeMcpTools(e.name)}},[n,t.actions,e.name]),null},hH=T.memo(function(){const{session:t}=je(),n=d.useMemo(()=>{if(t)return{id:t.user.id,name:t.user.name,email:t.user.email,isPro:!!t.user.subscription_status&&t.user.subscription_status!=="none"}},[t]);if(!n)return null;const r=$U(globalThis.navigator?.userAgent??"");return l.jsxs(l.Fragment,{children:[l.jsx(zfe,{session:n,isWindowsApp:r}),l.jsx(Wfe,{session:n,isWindowsApp:r})]})});hH.displayName="Instrumentation";async function L0e(){try{return(await(await fetch("/cdn-cgi/trace")).text()).split(` -`).reduce((n,r)=>{const[s,o]=r.split("=");return n[s]=o??"",n},{loc:"US"})}catch(e){return Z.error("Error getting Cloudflare trace",e),{loc:"US"}}}function Ix(){const{data:e}=gt({queryKey:be.makeEphemeralQueryKey("cloudflare-trace"),queryFn:L0e,staleTime:6e4});return d.useMemo(()=>e?.loc??"US",[e])}const F0e=({children:e,hostname:t})=>{const{session:n}=je(),r=Ix();return l.jsx(Uge,{hostname:t,session:n??void 0,cfCountry:r,children:e})},B0e="useModalContext must be used within a ModalProvider";function Ho(){const e=d.useContext(Ime);return Pme(e,B0e),e}var ie;(function(e){e.DEFAULT="turbo",e.PPLX_PRO_UPGRADED="pplx_pro_upgraded",e.PRO="pplx_pro",e.SONAR="experimental",e.GPT_4o="gpt4o",e.GPT_4_1="gpt41",e.GPT_5_1="gpt51",e.GPT_5_2="gpt52",e.CLAUDE_2="claude2",e.GEMINI_2_5_PRO="gemini25pro",e.GEMINI_3_0_PRO="gemini30pro",e.GEMINI_3_0_FLASH="gemini30flash",e.GEMINI_3_0_FLASH_HIGH="gemini30flash_high",e.GROK="grok",e.PPLX_REASONING="pplx_reasoning",e.CLAUDE_3_7_SONNET_THINKING="claude37sonnetthinking",e.O4_MINI="o4mini",e.GPT_5_1_THINKING="gpt51_thinking",e.GPT_5_2_THINKING="gpt52_thinking",e.CLAUDE_4_0_OPUS="claude40opus",e.CLAUDE_4_1_OPUS="claude41opus",e.CLAUDE_4_5_OPUS="claude45opus",e.CLAUDE_4_0_OPUS_THINKING="claude40opusthinking",e.CLAUDE_4_1_OPUS_THINKING="claude41opusthinking",e.CLAUDE_4_5_OPUS_THINKING="claude45opusthinking",e.CLAUDE_4_5_SONNET="claude45sonnet",e.CLAUDE_4_5_SONNET_THINKING="claude45sonnetthinking",e.KIMI_K2_THINKING="kimik2thinking",e.GROK_4="grok4",e.GROK_4_NON_THINKING="grok4nonthinking",e.GROK_4_1_REASONING="grok41reasoning",e.GROK_4_1_NON_REASONING="grok41nonreasoning",e.PPLX_SONAR_INTERNAL_TESTING="pplx_sonar_internal_testing",e.PPLX_SONAR_INTERNAL_TESTING_V2="pplx_sonar_internal_testing_v2",e.ALPHA="pplx_alpha",e.BETA="pplx_beta",e.STUDY="pplx_study"})(ie||(ie={}));var tt;(function(e){e.GPT_4="gpt4",e.CLAUDE_3_OPUS="claude3opus",e.CLAUDE_3_5_HAIKU="claude35haiku",e.GEMINI="gemini",e.LLAMA_X_LARGE="llama_x_large",e.MISTRAL="mistral",e.GROK2="grok2",e.COPILOT="copilot",e.O3_MINI="o3mini",e.CLAUDE_OMBRE_EAP="claude_ombre_eap",e.CLAUDE_LACE_EAP="claude_lace_eap",e.R1="r1",e.GAMMA="pplx_gamma",e.O3="o3",e.GEMINI_2_FLASH="gemini2flash",e.GPT_5="gpt5",e.GPT_5_THINKING="gpt5_thinking",e.GPT5_PRO="gpt5_pro",e.O3_PRO="o3pro",e.O3_PRO_RESEARCH="o3pro_research",e.O3_PRO_LABS="o3pro_labs",e.TESTING_MODEL_C="testing_model_c",e.O3_RESEARCH="o3_research",e.CLAUDE40SONNET_RESEARCH="claude40sonnet_research",e.CLAUDE40SONNETTHINKING_RESEARCH="claude40sonnetthinking_research",e.CLAUDE40OPUS_RESEARCH="claude40opus_research",e.CLAUDE40OPUSTHINKING_RESEARCH="claude40opusthinking_research",e.O3_LABS="o3_labs",e.CLAUDE40SONNETTHINKING_LABS="claude40sonnetthinking_labs",e.CLAUDE40OPUSTHINKING_LABS="claude40opusthinking_labs"})(tt||(tt={}));var oe;(function(e){e.SEARCH="search",e.RESEARCH="research",e.STUDIO="studio",e.STUDY="study"})(oe||(oe={}));const U0e=[ie.DEFAULT,ie.PRO],th=e=>U0e.includes(e);var cr;(function(e){e.PRO="pro",e.MAX="max"})(cr||(cr={}));const gH={[ie.DEFAULT]:oe.SEARCH,[ie.PPLX_PRO_UPGRADED]:oe.SEARCH,[ie.PRO]:oe.SEARCH,[ie.SONAR]:oe.SEARCH,[ie.CLAUDE_2]:oe.SEARCH,[ie.CLAUDE_4_5_SONNET]:oe.SEARCH,[ie.CLAUDE_4_5_SONNET_THINKING]:oe.SEARCH,[ie.KIMI_K2_THINKING]:oe.SEARCH,[ie.GPT_4o]:oe.SEARCH,[ie.GPT_4_1]:oe.SEARCH,[ie.GPT_5_1]:oe.SEARCH,[ie.GPT_5_2]:oe.SEARCH,[ie.GEMINI_2_5_PRO]:oe.SEARCH,[ie.GEMINI_3_0_PRO]:oe.SEARCH,[ie.GEMINI_3_0_FLASH]:oe.SEARCH,[ie.GEMINI_3_0_FLASH_HIGH]:oe.SEARCH,[ie.GROK]:oe.SEARCH,[ie.PPLX_REASONING]:oe.SEARCH,[ie.CLAUDE_3_7_SONNET_THINKING]:oe.SEARCH,[ie.CLAUDE_4_0_OPUS]:oe.SEARCH,[ie.CLAUDE_4_0_OPUS_THINKING]:oe.SEARCH,[ie.CLAUDE_4_1_OPUS]:oe.SEARCH,[ie.CLAUDE_4_1_OPUS_THINKING]:oe.SEARCH,[ie.CLAUDE_4_5_OPUS]:oe.SEARCH,[ie.CLAUDE_4_5_OPUS_THINKING]:oe.SEARCH,[ie.GROK_4]:oe.SEARCH,[ie.GROK_4_NON_THINKING]:oe.SEARCH,[ie.GROK_4_1_REASONING]:oe.SEARCH,[ie.GROK_4_1_NON_REASONING]:oe.SEARCH,[ie.GPT_5_1_THINKING]:oe.SEARCH,[ie.GPT_5_2_THINKING]:oe.SEARCH,[ie.PPLX_SONAR_INTERNAL_TESTING]:oe.SEARCH,[ie.PPLX_SONAR_INTERNAL_TESTING_V2]:oe.SEARCH,[tt.TESTING_MODEL_C]:oe.SEARCH,[tt.GPT_5_THINKING]:oe.SEARCH,[tt.GPT_5]:oe.SEARCH,[tt.GPT5_PRO]:oe.SEARCH,[tt.GPT_4]:oe.SEARCH,[tt.CLAUDE_3_OPUS]:oe.SEARCH,[tt.CLAUDE_3_5_HAIKU]:oe.SEARCH,[tt.GEMINI]:oe.SEARCH,[tt.LLAMA_X_LARGE]:oe.SEARCH,[tt.MISTRAL]:oe.SEARCH,[tt.GROK2]:oe.SEARCH,[tt.COPILOT]:oe.SEARCH,[tt.O3_MINI]:oe.SEARCH,[tt.CLAUDE_OMBRE_EAP]:oe.SEARCH,[tt.CLAUDE_LACE_EAP]:oe.SEARCH,[tt.R1]:oe.SEARCH,[tt.GAMMA]:oe.SEARCH,[tt.O3]:oe.SEARCH,[tt.GEMINI_2_FLASH]:oe.SEARCH,[tt.O3_PRO]:oe.SEARCH,[tt.O3_PRO_RESEARCH]:oe.RESEARCH,[tt.O3_PRO_LABS]:oe.STUDIO,[tt.O3_RESEARCH]:oe.RESEARCH,[tt.CLAUDE40SONNET_RESEARCH]:oe.RESEARCH,[tt.CLAUDE40SONNETTHINKING_RESEARCH]:oe.RESEARCH,[tt.CLAUDE40OPUS_RESEARCH]:oe.RESEARCH,[tt.CLAUDE40OPUSTHINKING_RESEARCH]:oe.RESEARCH,[tt.O3_LABS]:oe.STUDIO,[tt.CLAUDE40SONNETTHINKING_LABS]:oe.STUDIO,[tt.CLAUDE40OPUSTHINKING_LABS]:oe.STUDIO,[ie.ALPHA]:oe.RESEARCH,[ie.O4_MINI]:oe.RESEARCH,[ie.BETA]:oe.STUDIO,[ie.STUDY]:oe.STUDY},sn=(e,t=oe.SEARCH)=>e&&gH[e]||t,yH={[oe.SEARCH]:ype,[oe.RESEARCH]:wM,[oe.STUDIO]:_M,[oe.STUDY]:gpe},e3=e=>yH[e],V0e={...yH,[oe.SEARCH]:B("search")},H0e=e=>V0e[e],z0e={auto:{model:ie.DEFAULT,mode:oe.SEARCH},reasoning:{model:ie.PPLX_REASONING,mode:oe.SEARCH},deep_research:{model:ie.ALPHA,mode:oe.RESEARCH}},xH=e=>typeof e=="string"&&e in gH,W0e=e=>xH(e)?e:void 0,hR=Object.values(oe),G0e=[{search_model:ie.SONAR,has_new_tag:!1,subscription_tier:cr.PRO},{search_model:ie.CLAUDE_4_5_SONNET,has_new_tag:!0,subscription_tier:cr.PRO},{search_model:ie.CLAUDE_4_5_SONNET_THINKING,has_new_tag:!0,is_reasoning_model:!0,subscription_tier:cr.PRO},{search_model:ie.CLAUDE_4_1_OPUS_THINKING,has_new_tag:!1,is_reasoning_model:!0,subscription_tier:cr.MAX},{search_model:ie.GEMINI_2_5_PRO,has_new_tag:!1,subscription_tier:cr.PRO},{search_model:ie.GPT_5_1,has_new_tag:!0,subscription_tier:cr.PRO},{search_model:ie.GPT_5_1_THINKING,has_new_tag:!0,is_reasoning_model:!0,subscription_tier:cr.PRO},{search_model:ie.GROK_4,has_new_tag:!1,is_reasoning_model:!0,subscription_tier:cr.PRO}],Axt=e=>e?[tt.GPT_5_THINKING,ie.GROK_4,ie.GROK_4_1_REASONING,ie.CLAUDE_4_0_OPUS_THINKING,ie.CLAUDE_4_1_OPUS_THINKING,ie.CLAUDE_4_5_OPUS_THINKING,tt.O3_PRO,tt.GPT5_PRO].includes(e):!1,f4=Jh("AskInputContext",()=>Xi((e,t)=>({activeMenu:null,fileUploadUpsellTooltipOpen:!1,suggestions:Ie,blankStateSuggestions:{[oe.SEARCH]:null,[oe.RESEARCH]:null,[oe.STUDIO]:null,[oe.STUDY]:null},showSuggestDropdown:!1,browserAgentAllowOnceFromToggle:!1,forceEnableBrowserAgent:!1,actions:{onActiveMenuChange:n=>{e({activeMenu:n})},setFileUploadUpsellTooltipOpen:n=>{e({fileUploadUpsellTooltipOpen:n})},setSuggestions:n=>{e({suggestions:n})},setBlankStateSuggestions:(n,r)=>{const s=t().blankStateSuggestions;e({blankStateSuggestions:{...s,[r]:n}})},setShowSuggestDropdown:n=>{e({showSuggestDropdown:n})},setBrowserAgentAllowOnce:n=>{e({browserAgentAllowOnceFromToggle:n})},setForceEnableBrowserAgent:n=>{e({forceEnableBrowserAgent:n})}},inputRef:d.createRef()}))),$c=f4.Provider,$0e=f4.useSelector,q0e=f4.useTrackedState,Po=()=>$0e(e=>e.actions),Kr=q0e,K0e={pro:"pro",max:"max"},Y0e=e=>Object.keys(K0e).includes(e);function Bt(){const{session:e}=je(),t=e?.user?.subscription_status??"none",n=t==="active"||t==="trialing"||t==="white_glove_past_due",r=e?.user?.subscription_tier,s=Y0e(r)?r:void 0,o=n&&(s==="pro"||!s),a=n&&s==="max",i=o||a,c=n?e?.user?.subscription_source:"none",u=n&&c==="enterprise",f=u&&(s==="pro"||!s),m=u&&s==="max";return d.useMemo(()=>({isPro:o,isMax:a,hasAccessToProFeatures:i,hasActiveSubscription:n,subscriptionSource:c,subscriptionStatus:t,subscriptionTier:s,isEnterprise:u,isEnterprisePro:f,isEnterpriseMax:m}),[i,a,o,n,c,t,s,u,f,m])}const gR=1e9;function Q0e(e,t){const{event_entity:n,event_type:r,value_upper_bound:s,value_lower_bound:o}=e;let a="";return r==="STOCK_PRICE_TARGET"?o!=null?a=t.formatMessage({defaultMessage:"goes below ${value}",id:"RKgpKR3E99"},{value:o}):s!=null?a=t.formatMessage({defaultMessage:"goes above ${value}",id:"8eV5ClXcpi"},{value:s}):a=t.formatMessage({defaultMessage:"price target",id:"vnTdzDaohg"}):r==="STOCK_PRICE_MOVEMENT"?o!=null?a=t.formatMessage({defaultMessage:"drops {percent}%+",id:"Vl3IJiE9mt"},{percent:Math.abs(o)}):s!=null?a=t.formatMessage({defaultMessage:"rises {percent}%+",id:"EK4T00JAfI"},{percent:s}):a=t.formatMessage({defaultMessage:"price movement",id:"Pcu8sUjesQ"}):a=t.formatMessage({defaultMessage:"event triggers",id:"LpIhmla5ty"}),{kind:n,friendly:a,isRecurring:!1}}var t3=["MO","TU","WE","TH","FR","SA","SU"],ys=(function(){function e(t,n){if(n===0)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=n}return e.fromStr=function(t){return new e(t3.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=t3[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e})(),yr=function(e){return e!=null},Pa=function(e){return typeof e=="number"},yR=function(e){return typeof e=="string"&&t3.includes(e)},so=Array.isArray,ui=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var n=[],r=e;r>0,r.length>t?String(r):(t=t-r.length,t>n.length&&(n+=cn(n,t/n.length)),n.slice(0,t)+String(r))}var Z0e=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},_o=function(e,t){var n=e%t;return n*t<0?n+t:n},T_=function(e,t){return{div:Math.floor(e/t),mod:_o(e,t)}},Fa=function(e){return!yr(e)||e.length===0},Ir=function(e){return!Fa(e)},An=function(e,t){return Ir(e)&&e.indexOf(t)!==-1},qc=function(e,t,n,r,s,o){return r===void 0&&(r=0),s===void 0&&(s=0),o===void 0&&(o=0),new Date(Date.UTC(e,t-1,n,r,s,o))},J0e=[31,28,31,30,31,30,31,31,30,31,30,31],vH=1e3*60*60*24,bH=9999,_H=qc(1970,1,1),e1e=[6,0,1,2,3,4,5],gp=function(e){return e%4===0&&e%100!==0||e%400===0},wH=function(e){return e instanceof Date},ep=function(e){return wH(e)&&!isNaN(e.getTime())},t1e=function(e,t){var n=e.getTime(),r=t.getTime(),s=n-r;return Math.round(s/vH)},n3=function(e){return t1e(e,_H)},CH=function(e){return new Date(_H.getTime()+e*vH)},n1e=function(e){var t=e.getUTCMonth();return t===1&&gp(e.getUTCFullYear())?29:J0e[t]},Vd=function(e){return e1e[e.getUTCDay()]},xR=function(e,t){var n=qc(e,t+1,1);return[Vd(n),n1e(n)]},SH=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},r3=function(e){var t=new Date(e.getTime());return t},vR=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(n)return!0;if(r)return!1}else if(this.method==="before"){if(r)return!1}else if(this.method==="after")return n?!0:(this.add(t),!1);return this.add(t)},e.prototype.add=function(t){return this._result.push(t),!0},e.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e})(),_R=(function(e){mM(t,e);function t(n,r,s){var o=e.call(this,n,r)||this;return o.iterator=s,o}return t.prototype.add=function(n){return this.iterator(n,this._result.length)?(this._result.push(n),!0):!1},t})(od),Gy={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},wR=function(e,t){return e.indexOf(t)!==-1},s1e=function(e){return e.toString()},o1e=function(e,t,n){return"".concat(t," ").concat(n,", ").concat(e)},Zi=(function(){function e(t,n,r,s){if(n===void 0&&(n=s1e),r===void 0&&(r=Gy),s===void 0&&(s=o1e),this.text=[],this.language=r||Gy,this.gettext=n,this.dateFormatter=s,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort(function(f,m){return f-m}),a.sort(function(f,m){return m-f}),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(yr(this.origOptions.byweekday)){var i=so(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(i);this.byweekday={allWeeks:i.filter(function(f){return!f.n}),someWeeks:i.filter(function(f){return!!f.n}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var u=function(f,m){return f.weekday-m.weekday};this.byweekday.allWeeks.sort(u),this.byweekday.someWeeks.sort(u),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){var n=!0;if(!(t.options.freq in e.IMPLEMENTED)||t.origOptions.until&&t.origOptions.count)return!1;for(var r in t.origOptions){if(wR(["dtstart","tzid","wkst","freq"],r))return!0;if(!wR(e.IMPLEMENTED[t.options.freq],r))return!1}return n},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[et.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},e.prototype.MINUTELY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},e.prototype.DAILY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(this.options.interval===1&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},e.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},e.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},e.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},e.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(t){t=parseInt(t.toString(),10);var n,r=this.gettext;if(t===-1)return r("last");var s=Math.abs(t);switch(s){case 1:case 21:case 31:n=s+r("st");break;case 2:case 22:n=s+r("nd");break;case 3:case 23:n=s+r("rd");break;default:n=s+r("th")}return t<0?n+" "+r("last"):n},e.prototype.monthtext=function(t){return this.language.monthNames[t-1]},e.prototype.weekdaytext=function(t){var n=Pa(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[n]},e.prototype.plural=function(t){return t%100!==1},e.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},e.prototype.list=function(t,n,r,s){var o=this;s===void 0&&(s=","),so(t)||(t=[t]);var a=function(c,u,f){for(var m="",p=0;pt[0].length)&&(t=o,n=s)}if(t!=null&&(this.text=this.text.substr(t[0].length),this.text===""&&(this.done=!0)),t==null){this.done=!0,this.symbol=null,this.value=null;return}}while(n==="SKIP");return this.symbol=n,this.value=t,!0},e.prototype.accept=function(t){if(this.symbol===t){if(this.value){var n=this.value;return this.nextSymbol(),n}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},e})();function EH(e,t){t===void 0&&(t=Gy);var n={},r=new a1e(t.tokens);if(!r.start(e))return null;return s(),n;function s(){r.expect("every");var p=r.acceptNumber();if(p&&(n.interval=parseInt(p[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=et.DAILY,r.nextSymbol()&&(a(),m());break;case"weekday(s)":n.freq=et.WEEKLY,n.byweekday=[et.MO,et.TU,et.WE,et.TH,et.FR],r.nextSymbol(),a(),m();break;case"week(s)":n.freq=et.WEEKLY,r.nextSymbol()&&(o(),a(),m());break;case"hour(s)":n.freq=et.HOURLY,r.nextSymbol()&&(o(),m());break;case"minute(s)":n.freq=et.MINUTELY,r.nextSymbol()&&(o(),m());break;case"month(s)":n.freq=et.MONTHLY,r.nextSymbol()&&(o(),m());break;case"year(s)":n.freq=et.YEARLY,r.nextSymbol()&&(o(),m());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=et.WEEKLY;var h=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[et[h]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var g=c();if(!g)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(et[g]),r.nextSymbol()}a(),f(),m();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=et.YEARLY,n.bymonth=[i()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=i();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}o(),m();break;default:throw new Error("Unknown symbol")}}function o(){var p=r.accept("on"),h=r.accept("the");if(p||h)do{var g=u(),y=c(),x=i();if(g)y?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(et[y].nth(g))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(g),r.accept("day(s)"));else if(y)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(et[y]);else if(r.symbol==="weekday(s)")r.nextSymbol(),n.byweekday||(n.byweekday=[et.MO,et.TU,et.WE,et.TH,et.FR]);else if(r.symbol==="week(s)"){r.nextSymbol();var v=r.acceptNumber();if(!v)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(v[0],10)];r.accept("comma");){if(v=r.acceptNumber(),!v)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(v[0],10))}}else if(x)r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(x);else return}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function a(){var p=r.accept("at");if(p)do{var h=r.acceptNumber();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(h[0],10)];r.accept("comma");){if(h=r.acceptNumber(),!h)throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(h[0],10))}}while(r.accept("comma")||r.accept("at"))}function i(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function u(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var p=parseInt(r.value[1],10);if(p<-366||p>366)throw new Error("Nth out of range: "+p);return r.nextSymbol(),r.accept("last")?-p:p;default:return!1}}function f(){r.accept("on"),r.accept("the");var p=u();if(p)for(n.bymonthday=[p],r.nextSymbol();r.accept("comma");){if(p=u(),!p)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(p),r.nextSymbol()}}function m(){if(r.symbol==="until"){var p=Date.parse(r.text);if(!p)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(p)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}var un;(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(un||(un={}));function h4(e){return e12){var r=Math.floor(this.month/12),s=_o(this.month,12);this.month=s,this.year+=r,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(n,r){r>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-r))+n*7:this.day+=-(this.getWeekday()-r)+n*7,this.fixDay()},t.prototype.addDaily=function(n){this.day+=n,this.fixDay()},t.prototype.addHours=function(n,r,s){for(r&&(this.hour+=Math.floor((23-this.hour)/n)*n);;){this.hour+=n;var o=T_(this.hour,24),a=o.div,i=o.mod;if(a&&(this.hour=i,this.addDaily(a)),Fa(s)||An(s,this.hour))break}},t.prototype.addMinutes=function(n,r,s,o){for(r&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/n)*n);;){this.minute+=n;var a=T_(this.minute,60),i=a.div,c=a.mod;if(i&&(this.minute=c,this.addHours(i,!1,s)),(Fa(s)||An(s,this.hour))&&(Fa(o)||An(o,this.minute)))break}},t.prototype.addSeconds=function(n,r,s,o,a){for(r&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/n)*n);;){this.second+=n;var i=T_(this.second,60),c=i.div,u=i.mod;if(c&&(this.second=u,this.addMinutes(c,!1,s,o)),(Fa(s)||An(s,this.hour))&&(Fa(o)||An(o,this.minute))&&(Fa(a)||An(a,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var n=xR(this.year,this.month-1)[1];if(!(this.day<=n))for(;this.day>n;){if(this.day-=n,++this.month,this.month===13&&(this.month=1,++this.year,this.year>bH))return;n=xR(this.year,this.month-1)[1]}}},t.prototype.add=function(n,r){var s=n.freq,o=n.interval,a=n.wkst,i=n.byhour,c=n.byminute,u=n.bysecond;switch(s){case un.YEARLY:return this.addYears(o);case un.MONTHLY:return this.addMonths(o);case un.WEEKLY:return this.addWeekly(o,a);case un.DAILY:return this.addDaily(o);case un.HOURLY:return this.addHours(o,r,i);case un.MINUTELY:return this.addMinutes(o,r,i,c);case un.SECONDLY:return this.addSeconds(o,r,i,c,u)}},t})($y);function kH(e){for(var t=[],n=Object.keys(e),r=0,s=n;r=-366&&r<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||Ir(t.byweekno)||Ir(t.byyearday)||t.bymonthday||Ir(t.bymonthday)||yr(t.byweekday)||yr(t.byeaster)))switch(t.freq){case et.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case et.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case et.WEEKLY:t.byweekday=[Vd(t.dtstart)];break}if(yr(t.bymonth)&&!so(t.bymonth)&&(t.bymonth=[t.bymonth]),yr(t.byyearday)&&!so(t.byyearday)&&Pa(t.byyearday)&&(t.byyearday=[t.byyearday]),!yr(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if(so(t.bymonthday)){for(var s=[],o=[],n=0;n0?s.push(r):r<0&&o.push(r)}t.bymonthday=s,t.bynmonthday=o}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(yr(t.byweekno)&&!so(t.byweekno)&&(t.byweekno=[t.byweekno]),!yr(t.byweekday))t.bynweekday=null;else if(Pa(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(yR(t.byweekday))t.byweekday=[ys.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof ys)!t.byweekday.n||t.freq>et.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var a=[],i=[],n=0;net.MONTHLY?a.push(c.weekday):i.push([c.weekday,c.n])}t.byweekday=Ir(a)?a:null,t.bynweekday=Ir(i)?i:null}return yr(t.byhour)?Pa(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq=4?(f=0,u=i.yearlen+_o(a-t.wkst,7)):u=r-f;for(var m=Math.floor(u/7),p=_o(u,7),h=Math.floor(m+p/4),g=0;g0&&y<=h){var x=void 0;y>1?(x=f+(y-1)*7,f!==c&&(x-=7-c)):x=f;for(var v=0;v<7&&(i.wnomask[x]=1,x++,i.wdaymask[x]!==t.wkst);v++);}}if(An(t.byweekno,1)){var x=f+h*7;if(f!==c&&(x-=7-c),x=4?(w=0,C=S+_o(_-t.wkst,7)):C=r-f,b=Math.floor(52+_o(C,7)/4)}if(An(t.byweekno,b))for(var x=0;xo)return bi(e);if(b>=n){var _=kR(b,t);if(!e.accept(_)||i&&(--i,!i))return bi(e)}}else for(var v=h;vo)return bi(e);if(b>=n){var _=kR(b,t);if(!e.accept(_)||i&&(--i,!i))return bi(e)}}}if(t.interval===0||(c.add(t,y),c.year>bH))return bi(e);h4(r)||(f=u.gettimeset(r)(c.hour,c.minute,c.second,0)),u.rebuild(c.year,c.month)}}function L1e(e,t,n){var r=n.bymonth,s=n.byweekno,o=n.byweekday,a=n.byeaster,i=n.bymonthday,c=n.bynmonthday,u=n.byyearday;return Ir(r)&&!An(r,e.mmask[t])||Ir(s)&&!e.wnomask[t]||Ir(o)&&!An(o,e.wdaymask[t])||Ir(e.nwdaymask)&&!e.nwdaymask[t]||a!==null&&!An(e.eastermask,t)||(Ir(i)||Ir(c))&&!An(i,e.mdaymask[t])&&!An(c,e.nmdaymask[t])||Ir(u)&&(t=e.yearlen&&!An(u,t+1-e.yearlen)&&!An(u,-e.nextyearlen+t-e.yearlen))}function kR(e,t){return new Ky(e,t.tzid).rezonedDate()}function bi(e){return e.getValue()}function F1e(e,t,n,r,s){for(var o=!1,a=t;a=et.HOURLY&&Ir(s)&&!An(s,t.hour)||r>=et.MINUTELY&&Ir(o)&&!An(o,t.minute)||r>=et.SECONDLY&&Ir(a)&&!An(a,t.second)?[]:e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}var oa={MO:new ys(0),TU:new ys(1),WE:new ys(2),TH:new ys(3),FR:new ys(4),SA:new ys(5),SU:new ys(6)},g4={freq:un.YEARLY,dtstart:null,interval:1,wkst:oa.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},U1e=Object.keys(g4),et=(function(){function e(t,n){t===void 0&&(t={}),n===void 0&&(n=!1),this._cache=n?null:new x1e,this.origOptions=kH(t);var r=d1e(t).parsedOptions;this.options=r}return e.parseText=function(t,n){return EH(t,n)},e.fromText=function(t,n){return i1e(t,n)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return MH(t,this.options)},e.prototype._cacheGet=function(t,n){return this._cache?this._cache._cacheGet(t,n):!1},e.prototype._cacheAdd=function(t,n,r){if(this._cache)return this._cache._cacheAdd(t,n,r)},e.prototype.all=function(t){if(t)return this._iter(new _R("all",{},t));var n=this._cacheGet("all");return n===!1&&(n=this._iter(new od("all",{})),this._cacheAdd("all",n)),n},e.prototype.between=function(t,n,r,s){if(r===void 0&&(r=!1),!ep(t)||!ep(n))throw new Error("Invalid date passed in to RRule.between");var o={before:n,after:t,inc:r};if(s)return this._iter(new _R("between",o,s));var a=this._cacheGet("between",o);return a===!1&&(a=this._iter(new od("between",o)),this._cacheAdd("between",a,o)),a},e.prototype.before=function(t,n){if(n===void 0&&(n=!1),!ep(t))throw new Error("Invalid date passed in to RRule.before");var r={dt:t,inc:n},s=this._cacheGet("before",r);return s===!1&&(s=this._iter(new od("before",r)),this._cacheAdd("before",s,r)),s},e.prototype.after=function(t,n){if(n===void 0&&(n=!1),!ep(t))throw new Error("Invalid date passed in to RRule.after");var r={dt:t,inc:n},s=this._cacheGet("after",r);return s===!1&&(s=this._iter(new od("after",r)),this._cacheAdd("after",s,r)),s},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return o3(this.origOptions)},e.prototype.toText=function(t,n,r){return l1e(this,t,n,r)},e.prototype.isFullyConvertibleToText=function(){return c1e(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=un.YEARLY,e.MONTHLY=un.MONTHLY,e.WEEKLY=un.WEEKLY,e.DAILY=un.DAILY,e.HOURLY=un.HOURLY,e.MINUTELY=un.MINUTELY,e.SECONDLY=un.SECONDLY,e.MO=oa.MO,e.TU=oa.TU,e.WE=oa.WE,e.TH=oa.TH,e.FR=oa.FR,e.SA=oa.SA,e.SU=oa.SU,e.parseString=s3,e.optionsToString=o3,e})();function V1e(e,t,n,r,s,o){var a={},i=e.accept;function c(p,h){n.forEach(function(g){g.between(p,h,!0).forEach(function(y){a[Number(y)]=!0})})}s.forEach(function(p){var h=new Ky(p,o).rezonedDate();a[Number(h)]=!0}),e.accept=function(p){var h=Number(p);return isNaN(h)?i.call(this,p):!a[h]&&(c(new Date(h-1),new Date(h+1)),!a[h])?(a[h]=!0,i.call(this,p)):!0},e.method==="between"&&(c(e.args.after,e.args.before),e.accept=function(p){var h=Number(p);return a[h]?!0:(a[h]=!0,i.call(this,p))});for(var u=0;u1||s.length||o.length||a.length){var f=new Y1e(u);return f.dtstart(i),f.tzid(c||void 0),r.forEach(function(p){f.rrule(new et(A_(p,i,c),u))}),s.forEach(function(p){f.rdate(p)}),o.forEach(function(p){f.exrule(new et(A_(p,i,c),u))}),a.forEach(function(p){f.exdate(p)}),t.compatible&&t.dtstart&&f.rdate(i),f}var m=r[0]||{};return new et(A_(m,m.dtstart||t.dtstart||i,m.tzid||t.tzid||c),u)}function TR(e,t){return t===void 0&&(t={}),z1e(e,W1e(t))}function A_(e,t,n){return kr(kr({},e),{dtstart:t,tzid:n})}function W1e(e){var t=[],n=Object.keys(e),r=Object.keys(MR);if(n.forEach(function(s){An(r,s)||t.push(s)}),t.length)throw new Error("Invalid options: "+t.join(", "));return kr(kr({},MR),e)}function G1e(e){if(e.indexOf(":")===-1)return{name:"RRULE",value:e};var t=Z0e(e,":",1),n=t[0],r=t[1];return{name:n,value:r}}function $1e(e){var t=G1e(e),n=t.name,r=t.value,s=n.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:r}}function q1e(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var n=e.split(` -`),r=0;r0&&s[0]===" "?(n[r-1]+=s.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function K1e(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function AR(e,t){return K1e(t),e.split(",").map(function(n){return p4(n)})}function NR(e){var t=this;return function(n){if(n!==void 0&&(t["_".concat(e)]=n),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var r=0;r{switch(e.kind){case"ONCE":return new Date(e.year,e.month,e.day,e.hour,e.minute);case"DAILY":return new Date(2e3,0,1,e.hour,e.minute);case"WEEKLY":return new Date(2e3,0,2+e.dayOfWeek,e.hour,e.minute);case"MONTHLY":return new Date(2e3,0,e.day,e.hour,e.minute);case"YEARLY":return new Date(2e3,e.month,e.day,e.hour,e.minute);case"WEEKDAYS":return new Date(2e3,0,1,e.hour,e.minute)}};function y4(e,t){const n=new Date;switch(e.kind){case"ONCE":{const r=new Date(e.year,e.month,e.day,e.hour,e.minute);return r>n?r:n}case"DAILY":return new et({freq:et.DAILY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byhour:e.hour,byminute:e.minute}).after(n)||n;case"WEEKLY":{const r=e.dayOfWeek===0?et.SU:e.dayOfWeek-1;return new et({freq:et.WEEKLY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byweekday:r,byhour:e.hour,byminute:e.minute}).after(n)||n}case"MONTHLY":return new et({freq:et.MONTHLY,dtstart:new Date(n.getFullYear(),n.getMonth(),1,e.hour,e.minute),bymonthday:e.day,byhour:e.hour,byminute:e.minute}).after(n)||n;case"YEARLY":return new et({freq:et.YEARLY,dtstart:new Date(n.getFullYear(),0,1,e.hour,e.minute),bymonth:e.month+1,bymonthday:e.day,byhour:e.hour,byminute:e.minute}).after(n)||n;case"WEEKDAYS":return new et({freq:et.WEEKLY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byweekday:[et.MO,et.TU,et.WE,et.TH,et.FR],byhour:e.hour,byminute:e.minute}).after(n)||n;default:return n}}function X1e(e,t){const n=Q1e(e);switch(e.kind){case"ONCE":return t.formatDate(n,{dateStyle:"medium",timeStyle:"short"});case"DAILY":return t.formatTime(n,{timeStyle:"short"});case"WEEKLY":return t.formatDate(n,{weekday:"short",hour:"numeric",minute:"numeric"});case"MONTHLY":return t.formatMessage({defaultMessage:"Day {day}, {time}",id:"grA/MDsLjr"},{day:n.getDate().toString(),time:t.formatTime(n,{timeStyle:"short"})});case"YEARLY":return t.formatDate(n,{hour:"numeric",minute:"numeric",day:"numeric",month:"short"});case"WEEKDAYS":return t.formatTime(n,{timeStyle:"short"})}}const Ru=Ue({kindOnce:{defaultMessage:"Once",id:"DqTQOpG2Me"},kindDaily:{defaultMessage:"Daily",id:"zxvhnETmn2"},kindWeekly:{defaultMessage:"Weekly",id:"/clOBUs/wZ"},kindWeekdays:{defaultMessage:"Every weekday",id:"8Hjql2wdJG"},kindMonthly:{defaultMessage:"Monthly",id:"wYsv4ZHu+B"},kindYearly:{defaultMessage:"Yearly",id:"dqD39hnoA/"}}),Z1e={ONCE:Ru.kindOnce,DAILY:Ru.kindDaily,WEEKLY:Ru.kindWeekly,MONTHLY:Ru.kindMonthly,YEARLY:Ru.kindYearly,WEEKDAYS:Ru.kindWeekdays};function Gr(){const e=new Date;return e.setHours(e.getHours()+1,e.getMinutes(),0,0),{kind:"ONCE",minute:e.getMinutes(),hour:e.getHours(),day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),dayOfWeek:e.getDay()}}function J1e(e="",t=ie.PRO,n=["web"]){return{title:"",prompt:e,schedule:Gr(),searchModel:t,sources:n,expiryDate:void 0,defaultExpiryDate:AH(t)}}function eye(e,t){return t.formatMessage(Z1e[e])}const tye=()=>Intl.DateTimeFormat().resolvedOptions().timeZone;function nye(e){switch(e.kind){case"ONCE":return new Date(e.year,e.month,e.day,e.hour,e.minute);default:return new Date}}function rye(e){switch(e.kind){case"ONCE":return"FREQ=DAILY;COUNT=1";case"DAILY":return`FREQ=DAILY;BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"WEEKLY":return`FREQ=WEEKLY;BYDAY=${["SU","MO","TU","WE","TH","FR","SA"][e.dayOfWeek]};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"MONTHLY":return`FREQ=MONTHLY;BYMONTHDAY=${e.day};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"YEARLY":return`FREQ=YEARLY;BYMONTH=${e.month+1};BYMONTHDAY=${e.day};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"WEEKDAYS":return`FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=${e.hour};BYMINUTE=${e.minute}`}}function yp(e){const t=nye(e);return{start_at:nV(t),rrule:rye(e),tzid:tye()}}function TH(e){if(!(e===null||!e))return nV(e)}function Yy(e){const t=new Date(e.start_at),n={kind:"ONCE",minute:t.getMinutes(),hour:t.getHours(),day:t.getDate(),month:t.getMonth(),year:t.getFullYear(),dayOfWeek:t.getDay()};if(e.rrule.includes("FREQ=DAILY;COUNT=1"))return n;const r=et.parseString(e.rrule),s=f=>Array.isArray(f)?f[0]:f,o=s(r.byhour),a=s(r.byminute),i=s(r.bymonth),c=s(r.bymonthday),u=s(r.byweekday);switch(r.freq){case et.DAILY:return o===void 0||a===void 0?(Z.error("DAILY schedule missing required BYHOUR or BYMINUTE parameter"),{...n}):{...n,kind:"DAILY",hour:o,minute:a};case et.WEEKLY:{if(u===void 0||o===void 0||a===void 0)return Z.error("WEEKLY schedule missing required parameters"),{...n};if(Array.isArray(r.byweekday)&&r.byweekday.length===5)return{...n,kind:"WEEKDAYS",hour:o,minute:a};const f=u.weekday===6?0:u.weekday+1;return{...n,kind:"WEEKLY",dayOfWeek:f,hour:o,minute:a}}case et.MONTHLY:return c===void 0||o===void 0||a===void 0?(Z.error("MONTHLY schedule missing required BYMONTHDAY parameter"),{...n}):{...n,kind:"MONTHLY",day:c,hour:o,minute:a};case et.YEARLY:return i===void 0||c===void 0||o===void 0||a===void 0?(Z.error("YEARLY schedule missing required BYMONTH parameter"),{...n}):{...n,kind:"YEARLY",month:i-1,day:c,hour:o,minute:a}}return Z.error("Invalid task schedule"),{...n}}function sye({expiryDate:e,schedule:t,defaultExpiryDate:n}){return e===null||!e||!t?e:y4(t)>e?n??null:e}function oye(e,t){return(e===ie.BETA||e===ie.ALPHA)&&(t.kind==="DAILY"||t.kind==="WEEKLY"||t.kind==="WEEKDAYS")}function AH(e,t){if(!(!t||!oye(e,t))&&(e===ie.BETA||e===ie.ALPHA)){const n=y4(t);return(s=>{switch(s){case"DAILY":return $S(n,14);case"WEEKLY":return upe(n,14);case"WEEKDAYS":return $S(n,21);case"ONCE":case"MONTHLY":case"YEARLY":return;default:Ft(s)}})(t.kind)}}var Xe;(function(e){e.SCHEDULED="scheduled",e.PRICE_ALERT="priceAlert",e.SHORTCUT="shortcut"})(Xe||(Xe={}));var pr;(function(e){e.TARGET_PRICE="targetPrice",e.MOVEMENT_AMOUNT="movementAmount"})(pr||(pr={}));const Ql={should_send_email:!0,should_send_in_app:!0,should_send_push:!0},aye=e=>{const t=e.enrichments?e.enrichments.space??null:void 0;return{id:e.task_id,type:iye(e),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),expiryDate:e.end_at?new Date(e.end_at):void 0,title:e.task_name,prompt:e.task_data.task_prompt,status:e.status,nextRun:new Date(e.next_trigger_intended_time),scheduleInfo:{start_at:e.start_at,rrule:e.trigger_condition_schedule,tzid:e.tzid},subscription:e.event_subscription,searchModel:e.task_data?.task_params?.model_preference||"pplx_pro",sources:e.task_data?.task_params?.sources||["web"],notificationSettings:e.notification_settings||Ql,collectionUuid:e.collection_uuid,space:t,userId:e.user_task_context?.user_nextauth_id??null}},iye=e=>{switch(e.scheduler_type){case"EVENT_PUSH":return"ALERT";case"POLL":return"SCHEDULE";case"SHORTCUT":return"SHORTCUT";default:return null}};function lye({intl:e,triggerType:t}){switch(t){case Xe.SCHEDULED:return e.formatMessage({defaultMessage:"Scheduled task",id:"dG8VrMkuAT"});case Xe.PRICE_ALERT:return e.formatMessage({defaultMessage:"Price alert",id:"XMapyUiPpV"});case Xe.SHORTCUT:return e.formatMessage({defaultMessage:"Shortcut",id:"tceWOrncgz"});default:Ft(t)}}function cye({intl:e,triggerType:t,actionPerformed:n}){const r=uye({intl:e,actionPerformed:n});switch(t){case Xe.SCHEDULED:return e.formatMessage({defaultMessage:"Task has been {actionDisplayName}",id:"dztI4FIBBf"},{actionDisplayName:r});case Xe.PRICE_ALERT:return e.formatMessage({defaultMessage:"Price alert has been {actionDisplayName}",id:"ApBHuTxt1D"},{actionDisplayName:r});case Xe.SHORTCUT:return e.formatMessage({defaultMessage:"Shortcut has been {actionDisplayName}",id:"oprPa0O7KY"},{actionDisplayName:r});default:Ft(t)}}function uye({intl:e,actionPerformed:t}){switch(t){case"created":return e.formatMessage({defaultMessage:"created",id:"lr7wlbGcN2"});case"updated":return e.formatMessage({defaultMessage:"updated",id:"fM7xZh2bri"});case"paused":return e.formatMessage({defaultMessage:"paused",id:"onIpArq3j6"});case"resumed":return e.formatMessage({defaultMessage:"resumed",id:"NUz1enNtoA"});case"deleted":return e.formatMessage({defaultMessage:"deleted",id:"GBLHN+CxXe"});case"copied":return e.formatMessage({defaultMessage:"copied",id:"JZWZSAD5l1"});case"skipped":return e.formatMessage({defaultMessage:"skipped",id:"yrhXAwV22L"});default:Ft(t)}}const dye=1e9,IR=-1e9;function fye(e){return{trigger:{type:Xe.SCHEDULED,schedule:e.schedule},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources??eg()},status:"ACTIVE",notificationSettings:Ql}}function mye({selectedTask:e}){if(!e||e.type===null)return null;switch(e.type){case"SCHEDULE":return{id:e.id,trigger:{type:Xe.SCHEDULED,schedule:Yy(e.scheduleInfo),expiryDate:e.expiryDate},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status,notificationSettings:e.notificationSettings??Ql,collectionUuid:e.collectionUuid};case"ALERT":switch(e.subscription?.event_type){case"STOCK_PRICE_TARGET":return{id:e.id,trigger:{type:Xe.PRICE_ALERT,alertType:pr.TARGET_PRICE,price:(e.subscription.value_lower_bound??IR)<0?e.subscription.value_upper_bound??dye:e.subscription.value_lower_bound??IR,currency:"usd",symbol:e.subscription.event_entity??""},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};case"STOCK_PRICE_MOVEMENT":return{id:e.id,trigger:{type:Xe.PRICE_ALERT,alertType:pr.MOVEMENT_AMOUNT,percentageDecimalLowerBound:(e.subscription.value_lower_bound??0)/100,percentageDecimalUpperBound:(e.subscription.value_upper_bound??0)/100,symbol:e.subscription.event_entity??""},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};default:throw new Error("Unhandled subscription.event_type: "+e.subscription?.event_type)}case"SHORTCUT":return{id:e.id,trigger:{type:Xe.SHORTCUT,shortcut:e.title},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};default:Ft(e.type)}}function x4(e=!0){return{trigger:{type:Xe.SCHEDULED,schedule:Gr()},query:{searchModel:e?ie.PRO:ie.DEFAULT,prompt:"",sources:eg()},status:"ACTIVE",notificationSettings:Ql}}function pye({symbol:e=""}={symbol:""}){return{trigger:{type:Xe.PRICE_ALERT,alertType:pr.TARGET_PRICE,price:0,currency:"usd",symbol:e},query:{prompt:"",searchModel:ie.PRO,sources:eg()},status:"ACTIVE"}}function v4(e){if(e.trigger.type!==Xe.SCHEDULED)return e;const t=AH(e.query.searchModel,e.trigger.schedule),n=sye({expiryDate:e.trigger.expiryDate,schedule:e.trigger.schedule,defaultExpiryDate:t});return e.id?{...e,trigger:{...e.trigger,expiryDate:n}}:{...e,trigger:{...e.trigger,schedule:{...e.trigger.schedule},expiryDate:n,defaultExpiryDate:t}}}function eg(){return["web"]}var er;(function(e){e.GOOGLE_DRIVE="GOOGLE_DRIVE",e.ONEDRIVE="ONEDRIVE",e.SHAREPOINT="SHAREPOINT",e.DROPBOX="DROPBOX",e.BOX="BOX",e.WILEY="WILEY",e.GCAL="GCAL",e.GENERATED_IMAGE="GENERATED_IMAGE",e.GENERATED_VIDEO="GENERATED_VIDEO",e.NOTION_MCP="NOTION_MCP",e.OUTLOOK="OUTLOOK",e.LINEAR="LINEAR",e.LINEAR_ALT="LINEAR_ALT",e.SLACK="SLACK",e.GITHUB_MCP_DIRECT="GITHUB_MCP_DIRECT",e.ASANA_MCP_DIRECT="ASANA_MCP_DIRECT",e.ASANA_MCP_MERGE="ASANA_MCP_MERGE",e.ATLASSIAN_MCP_DIRECT="ATLASSIAN_MCP_DIRECT",e.LOCAL="LOCAL",e.SLACK_DIRECT="SLACK_DIRECT",e.JIRA_MCP_MERGE="JIRA_MCP_MERGE",e.CONFLUENCE_MCP_MERGE="CONFLUENCE_MCP_MERGE",e.MICROSOFT_TEAMS_MCP_MERGE="MICROSOFT_TEAMS_MCP_MERGE",e.FACTSET="FACTSET",e.ZOOM="ZOOM"})(er||(er={}));const hye=[er.GOOGLE_DRIVE,er.ONEDRIVE,er.SHAREPOINT,er.DROPBOX,er.BOX],gye=e=>[...hye,...e],Nxt=e=>be.makeQueryKey("get_prices",{subscription_tier:e}),cu=(e={})=>be.makeQueryKey("get_user_settings",e),Qy=()=>be.makeQueryKey("get_rate_limits",{}),yye=()=>be.makeQueryKey("get_user_profile",{}),xye=()=>be.makeQueryKey("get_user_promotions",{}),vye=e=>be.makeQueryKey("get_special_profile",{profile_name:e}),a3=e=>be.makeQueryKey("get_homepage_upsells",{isHomepage:e}),bye=()=>be.makeQueryKey("get_ntp_upsells",{}),mc=(e="you")=>be.makeQueryKey("list_feed",{topic:e}),b4=()=>be.makeQueryKey("userOrgData",{}),Rxt=e=>be.makeQueryKey("get_premium_secure_eligibility",{orgUuid:e}),_ye=()=>be.makeQueryKey("pendingInvitation"),sa=e=>be.makeQueryKey("get_collection",{collection_slug:e.slice(-22)}),_4=e=>be.makeQueryKey("list_collection_threads",e?.slice(-22)),_d=e=>e?[..._4(e.collection_slug),e.filter_by_user,e.filter_by_shared_threads]:be.makeQueryKey("list_collection_threads"),Zt=()=>be.makeQueryKey("list_user_collections",{}),Px=e=>e?be.makeQueryKey("list_ask_threads",e):be.makeQueryKey("list_ask_threads"),wye=Px,Dxt=()=>be.makeQueryKey("shoppingOrders",{}),Cye=()=>be.makeQueryKey("userTryOnPhoto",{}),Sye=()=>be.makeQueryKey("shoppingTryOnBackgroundGeneration"),jxt=e=>be.makeQueryKey("productTryOn",{productImageUrl:e}),Eye="getOrganizationUsers",Ixt=e=>be.makeQueryKey(Eye,"members"),kye=e=>be.makeQueryKey("get_thread_by_uuid",{uuid:e}),Mye=e=>be.makeQueryKey("get_article_by_uuid",{uuid:e}),Pxt=()=>be.makeQueryKey("customer_shopping_info",{}),w4=e=>be.makeQueryKey("articleResults",{frontend_context_uuid:e}),PR=e=>be.makeQueryKey("article-slug",e),C4=(e,t=!1)=>be.makeQueryKey(t?"list_file_directory_infinite":"list_file_directory",e.file_repository_type,e.owner_id),S4=(e,t,n,r=0,s,o=!1)=>be.makeQueryKey(...be.unmakeQueryKey(C4({file_repository_type:e,owner_id:t},o)),n,...o?[]:[r],s),i3="connector-files",l3="connector-files-infinite",OR=(e,t)=>e?be.makeQueryKey(t?l3:i3,e):be.makeQueryKey(t?l3:i3),Oxt=e=>be.makeQueryKey("get_sharepoint_sites_infinite",e??{}),Lxt=()=>be.makeQueryKey("get_filters",{}),Fxt=e=>e!==void 0?be.makeQueryKey("memories",e):be.makeQueryKey("memories"),rh=(e,t)=>be.makeQueryKey("file_exists",e,...t?[t]:[]),P0=e=>be.makeQueryKey("download-image-url",...e?[e]:[]),NH=e=>be.makeQueryKey("user-task",e),xp=e=>be.makeQueryKey("user-tasks"),Tye=e=>e!==void 0?be.makeQueryKey("space-tasks",e):be.makeQueryKey("space-tasks"),Aye=()=>be.makeQueryKey("check-edu-institution"),tp=()=>be.makeQueryKey("list_spaces_mentions"),Nye=()=>be.makeQueryKey("upgrade-subscription-preview"),Rye=()=>be.makeQueryKey("subscription-changes"),Dye=()=>be.makeQueryKey("task_shortcuts_mentions"),Bxt=e=>be.makeQueryKey("task_shortcuts_copy",e),Uxt=()=>be.makeQueryKey("braintree-subscription-details"),jye="get_repository_upload_states",Iye=e=>be.makeQueryKey(jye,e),Vxt=()=>be.makeQueryKey("get_seat_info"),Pye="space-file-errors",Hxt=e=>be.makeQueryKey(Pye,e),zxt=be.makeQueryKey("third-party-personalization-status"),Wxt=()=>be.makeQueryKey("paypal_client_token",{}),Oye=()=>be.makeQueryKey("emailAssistantConfig"),Lye=e=>e?be.makeQueryKey("emailAssistantScopes",e):be.makeQueryKey("emailAssistantScopes"),RH=e=>be.makeEphemeralQueryKey("navigationResults",e),Gxt=e=>e?be.makeQueryKey("availableCalendars",e):be.makeQueryKey("availableCalendars"),km=()=>be.makeQueryKey("spaces","list","all"),Fye=()=>be.makeQueryKey("org_pinned_spaces_query_key"),E4=/(\[\d{1,3}\])/,DH=/(\[\d{1,3},\s*\{ts:.*\}\])/,vp=new RegExp(E4.source+"|"+DH.source),k4=(e,t)=>{if(vp.test(e))if(E4.test(e)){const n=parseInt(e.substring(1,e.length-1))-1,r=t?.[n]??null;return r||void 0}else{const n=e.indexOf(","),r=parseInt(e.substring(1,n))-1,s=t?.[r]??null;if(!s)return;if(!s.url){Z.warn("[parseCitation] web_result has no url",{web_result:s});return}return s.url=Bye(s.url,e),s}},Bye=(e,t)=>{const n=e.split("&")[0],r=t.indexOf(":");if(r===-1)return n;const s=t.indexOf("}"),o=t.substring(r+1,s);return n+`&t=${o}`};function sh(e,t){const n={};for(const r of e){const s=t(r);Object.prototype.hasOwnProperty.call(n,s)?n[s].push(r):Object.defineProperty(n,s,{value:[r],configurable:!0,enumerable:!0,writable:!0})}return n}const M4={web:"web",scholar:"scholar",social:"social",edgar:"edgar",wiley:"wiley",org:"org",my_files:"my_files",crunchbase:"crunchbase",factset:"factset",google_drive:"google_drive",onedrive:"onedrive",sharepoint:"sharepoint",dropbox:"dropbox",box:"box",notion_mcp:"notion_mcp",outlook:"outlook",linear:"linear",linear_alt:"linear_alt",slack:"slack",github_mcp_direct:"github_mcp_direct",asana_mcp_direct:"asana_mcp_direct",asana_mcp_merge:"asana_mcp_merge",atlassian_mcp_direct:"atlassian_mcp_direct",slack_direct:"slack_direct",jira_mcp_merge:"jira_mcp_merge",confluence_mcp_merge:"confluence_mcp_merge",microsoft_teams_mcp_merge:"microsoft_teams_mcp_merge",wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere",space:"space",gcal:"gcal",sports:"sports",zoom:"zoom"},Uye=Object.values(M4).filter(e=>e!=="wiley"),Vye=["linear","linear_alt","slack","notion_mcp","github_mcp_direct","asana_mcp_direct","asana_mcp_merge","atlassian_mcp_direct","slack_direct","jira_mcp_merge","confluence_mcp_merge","microsoft_teams_mcp_merge","wiley_mcp_cashmere","cbinsights_mcp_cashmere","pitchbook_mcp_cashmere","statista_mcp_cashmere"],Hye={wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere"},ga=e=>Uye.includes(e),Ox=e=>Array.isArray(e)?e.filter(ga):[],zye=e=>Array.isArray(e)?e.filter(ga).filter(t=>Vye.includes(t)):[],tg=e=>e?Object.keys(Hye).includes(e):!1,jH=e=>e?.entity_group_type!=="CALENDAR_ACTION"&&!!e?.entities?.length,IH=e=>{const t=!!e?.multiple_choice_quiz_card_block?.questions?.length,n=!!e?.flash_card_section_block;return t||n},LR=e=>!!(e.chunks&&e.chunks.length>0),FR=e=>!!(e.answer&&e.answer.length>0),BR=e=>!!e.structured_answer_blocks?.some(t=>t.markdown_block?.chunks?.length||t.entity_list_block?.chunks?.length),UR=e=>!!e.structured_answer_blocks?.some(t=>t.markdown_block?.answer?.length||t.entity_list_block?.text?.length||jH(t.entity_group_block)),VR=e=>!!e.structured_answer_blocks?.some(t=>IH(t.inline_entity_block)),HR=e=>!!e.structured_answer_blocks?.some(t=>t.inline_entity_block?.media_block?.generated_media_items?.some(n=>n.status==="COMPLETED")),Wye=e=>!!e.structured_answer_blocks?.some(t=>t.inline_entity_block?.media_block?.media_items?.some(n=>n.image||n.medium==="image"||n.medium==="video"));class Yt{static hasContent(t){return LR(t)||FR(t)||BR(t)||UR(t)||HR(t)||Wye(t)||VR(t)}static hasAnswer(t,n){const r=HR(t)&&n;return LR(t)||FR(t)||BR(t)||UR(t)||r||VR(t)}static isPerplexityMessage(t){return t?.blocks!==void 0}static isPerplexityArticleSection(t){return t?.message!==void 0}static isArticleSection(t){return t?.article_info!==void 0}static mergePlaceBlocks(t){const n=t.filter(a=>!!a);if(!n.length)return;const[r,...s]=n;return Object.assign({},r,...s.map(a=>({review_summary:a.review_summary})))}static mergeMediaBlocks(t){const n=t.filter(s=>!!s);return n.length?{media_items:n.flatMap(s=>s?.media_items||[]),generated_media_items:n[n.length-1].generated_media_items||[],progress:n[n.length-1].progress}:void 0}static mergeShoppingBlocks(t){const n=t.filter(a=>!!a);if(!n.length)return;const[r,...s]=n;return Object.assign({},r,...s.map(a=>({review_summary:a.review_summary})))}static mergeEntityListItems(t){const n=sh(t,s=>s.index),r=[];return Object.values(n).forEach(s=>{const o=s[0];r.push({title:o.title,text:s.map(({text:a})=>a).join(""),chunks:s.flatMap(a=>a.chunks),chunk_starting_offset:0,index:o.index,awaiting_backfill:s.reduce((a,i)=>i.awaiting_backfill??a,!1),place_block:Yt.mergePlaceBlocks(s.map(a=>a.place_block)),shopping_block:Yt.mergeShoppingBlocks(s.map(a=>a.shopping_block))})}),r}static parseStructuredAnswerBlocks(t){if(!this.isPerplexityMessage(t)||!t.structured_answer_block_usages?.length)return null;const n=sh(t.blocks,s=>s.intended_usage),r=[];return t.structured_answer_block_usages.forEach(s=>{const o=n[s];if(!o)return;const{markdownBlocks:a,placeBlocks:i,mediaBlocks:c,shoppingPreviewBlocks:u,entityListBlocks:f,jobsPreviewBlocks:m,hotelsPreviewBlocks:p,placesPreviewBlocks:h,knowledgeCardsBlocks:g,calendarEventBlocks:y,entityGroupBlocks:x,entityGroupV2Blocks:v,assetsPreviewBlocks:b,assetsInlineBlocks:_,shoppingBlocks:w,placeholderBlocks:S,multipleChoiceQuizCardBlocks:C,flashCardSectionBlocks:E,jsonBlocks:N}=o.reduce((k,I)=>(I.markdown_block?k.markdownBlocks.push(I.markdown_block):I.inline_entity_block?.place_block?k.placeBlocks.push(I.inline_entity_block.place_block):I.inline_entity_block?.media_block?k.mediaBlocks.push(I.inline_entity_block.media_block):I.inline_entity_block?.shopping_preview_block?k.shoppingPreviewBlocks.push(I.inline_entity_block.shopping_preview_block):I.entity_list_block?k.entityListBlocks.push(I.entity_list_block):I.inline_entity_block?.jobs_preview_block?k.jobsPreviewBlocks.push(I.inline_entity_block.jobs_preview_block):I.inline_entity_block?.hotels_preview_block?k.hotelsPreviewBlocks.push(I.inline_entity_block.hotels_preview_block):I.inline_entity_block?.places_preview_block?k.placesPreviewBlocks.push(I.inline_entity_block.places_preview_block):I.inline_entity_block?.knowledge_card_block?k.knowledgeCardsBlocks.push(I.inline_entity_block.knowledge_card_block):I.inline_entity_block?.calendar_event_block?k.calendarEventBlocks.push(I.inline_entity_block.calendar_event_block):I.entity_group_block?k.entityGroupBlocks.push(I.entity_group_block):I.entity_group_v2_block?k.entityGroupV2Blocks.push(I.entity_group_v2_block):I.inline_entity_block?.assets_preview_block?k.assetsPreviewBlocks.push(I.inline_entity_block.assets_preview_block):I.inline_entity_block?.assets_inline_block?k.assetsInlineBlocks.push(I.inline_entity_block.assets_inline_block):I.inline_entity_block?.shopping_block?k.shoppingBlocks.push(I.inline_entity_block?.shopping_block):I.inline_entity_block?.placeholder_block?k.placeholderBlocks.push(I.inline_entity_block?.placeholder_block):I.inline_entity_block?.multiple_choice_quiz_card_block?k.multipleChoiceQuizCardBlocks.push(I.inline_entity_block.multiple_choice_quiz_card_block):I.inline_entity_block?.flash_card_section_block?k.flashCardSectionBlocks.push(I.inline_entity_block.flash_card_section_block):I.json_block&&k.jsonBlocks.push(I.json_block),k),{markdownBlocks:[],placeBlocks:[],mediaBlocks:[],shoppingPreviewBlocks:[],entityListBlocks:[],jobsPreviewBlocks:[],hotelsPreviewBlocks:[],placesPreviewBlocks:[],knowledgeCardsBlocks:[],calendarEventBlocks:[],entityGroupBlocks:[],entityGroupV2Blocks:[],assetsPreviewBlocks:[],assetsInlineBlocks:[],shoppingBlocks:[],placeholderBlocks:[],multipleChoiceQuizCardBlocks:[],flashCardSectionBlocks:[],jsonBlocks:[]});if(a.length){const k=a[a.length-1],I=a.flatMap(M=>M.chunks);r.push({intended_usage:s,markdown_block:{answer:I.join(""),chunks:I,chunk_starting_offset:0,progress:k.progress,media_items:a.flatMap(M=>M.media_items||[]),inline_token_annotations:a.flatMap(M=>M.inline_token_annotations||[])}})}if(u.length&&r.push({intended_usage:s,inline_entity_block:{shopping_preview_block:u[u.length-1]}}),m.length&&r.push({intended_usage:s,inline_entity_block:{jobs_preview_block:m[m.length-1]}}),p.length&&r.push({intended_usage:s,inline_entity_block:{hotels_preview_block:p[p.length-1]}}),h.length&&r.push({intended_usage:s,inline_entity_block:{places_preview_block:h[h.length-1]}}),i.length&&r.push({intended_usage:s,inline_entity_block:{place_block:Yt.mergePlaceBlocks(i)}}),c.length&&r.push({intended_usage:s,inline_entity_block:{media_block:Yt.mergeMediaBlocks(c)}}),f.length&&r.push({intended_usage:s,entity_list_block:{text:f.map(({text:k})=>k).join(""),chunks:f.flatMap(k=>k.chunks),chunk_starting_offset:0,entities:Yt.mergeEntityListItems(f.flatMap(k=>k.entities))}}),g.length&&r.push({intended_usage:s,inline_entity_block:{knowledge_card_block:g[g.length-1]}}),y.length&&r.push({intended_usage:s,inline_entity_block:{calendar_event_block:y[y.length-1]}}),x.length&&r.push({intended_usage:s,entity_group_block:{entities:x[x.length-1].entities,entity_group_type:x[x.length-1].entity_group_type}}),v.length){const k=v[v.length-1];r.push({intended_usage:s,entity_group_v2_block:k})}b.length&&r.push({intended_usage:s,inline_entity_block:{assets_preview_block:b[b.length-1]}}),_.length&&r.push({intended_usage:s,inline_entity_block:{assets_inline_block:_[_.length-1]}}),w.length&&r.push({intended_usage:s,inline_entity_block:{shopping_block:this.mergeShoppingBlocks(w)}}),S.length&&r.push({intended_usage:s,inline_entity_block:{placeholder_block:S[S.length-1]}}),C.length&&r.push({intended_usage:s,inline_entity_block:{multiple_choice_quiz_card_block:C[C.length-1]}}),E.length&&r.push({intended_usage:s,inline_entity_block:{flash_card_section_block:E[E.length-1]}}),N.length&&r.push({intended_usage:s,json_block:N[N.length-1]})}),r}static parseAskTextField(t){if(!this.isPerplexityMessage(t))return this.legacyParseBackendOutputStr(t.text);if(!t.blocks?.length)return null;const n={answer:""};n.structured_answer_blocks=Yt.parseStructuredAnswerBlocks(t);const r=t.blocks?.filter(o=>o.intended_usage==="ask_text"&&o.markdown_block).map(o=>o.markdown_block);if(r.length>0){const o=r.flatMap(a=>a.chunks);n.chunks=o,n.answer=o.join("")}const s=t.blocks?.filter(o=>o.intended_usage==="web_results"&&o.web_result_block).flatMap(o=>o.web_result_block.web_results);return s.length>0&&(n.web_results=s),n}static legacyParseBackendOutputStr(t){let n=null;try{if(n=JSON.parse(t??""),Array.isArray(n)){const r=n[n.length-1];r.step_type=="FINAL"&&r?.content?.answer!=null&&(n=JSON.parse(r.content.answer))}}catch{return null}return n}static isStatusPending(t){return t.status?.toLowerCase()===Pr.PENDING.toLowerCase()}static isStatusBlocked(t){return t.status?.toLowerCase()===Pr.BLOCKED.toLowerCase()}static isStatusFailed(t){return t.status?.toLowerCase()===Pr.FAILED.toLowerCase()}static isStatusCompleted(t){return t.status?.toLowerCase()===Pr.COMPLETED.toLowerCase()}static isCopilotMode(t){return t.mode?.toLowerCase()===bd.COPILOT.toLowerCase()}static isArticleMode(t){return this.isPerplexityMessage(t)?t?.mode===bd.ARTICLE:this.isPerplexityArticleSection(t)?t?.message?.mode===bd.ARTICLE:t?.mode==="article"}static isSourceListType(t){return Array.isArray(t)&&t.every(n=>Object.values(M4).includes(n))}static hasUnspecifiedSelectionStatus(t){return t?.selection_status===la.SELECTION_STATUS_UNSPECIFIED}static hasMultipleSiblingEntries(t,n){return n?t.filter(s=>s.side_by_side_metadata?.sibling_uuid===n).length>1:!1}}function Gye(e){return e||{connectors:[]}}const zR=e=>({hasLoadedSettings:!0,pagesLimit:e?.pages_limit??0,uploadLimit:e?.upload_limit,defaultImageGenerationModel:e?.default_image_generation_model??"default",defaultVideoGenerationModel:e?.default_video_generation_model??"default",articleImageUploadLimit:e?.article_image_upload_limit??0,maxFilesPerUser:e?.max_files_per_user??0,maxFilesPerRepository:e?.max_files_per_repository??0,queryCount:e?.query_count??0,queryCountCopilot:e?.query_count_copilot??0,queryCountMobile:e?.query_count_mobile??0,hasAiProfile:e?.has_ai_profile??!1,referralCode:e?.referral_code??"",referralNumSuccess:e?.referral_num_success??0,referralNumCoupons:e?.referral_num_coupons??0,disableTraining:e?.disable_training??!1,isSidebarCollapsed:e?.is_sidebar_collapsed??!1,isSidebarPinned:e?.is_sidebar_pinned??!1,sidebarHiddenHubs:e?.sidebar_hidden_hubs??[],subscriptionTier:e?.subscription_tier??e?.subscription_tier??"null",stripeStatus:e?.stripe_status??"none",revenuecatStatus:e?.revenuecat_status??"none",revenuecatSource:e?.revenuecat_source??"none",createLimit:e?.create_limit??0,notifStatus:e?.notif_status??"daily",emailStatus:e?.email_status??"daily",hasDataRetentionWarning:e?.has_data_retention_warning??!1,allowArticleCreation:e?.allow_article_creation??!1,isVerified:e?.is_verified??!1,connectors:Gye(e?.connectors),connectorLimits:e?.connector_limits??{global_file_count:void 0,repo_type_limits:void 0,max_file_size_mb:void 0,max_attachment_file_size_mb:void 0},alwaysAllowBrowserAgent:e?.always_allow_browser_agent??!1,hasAcceptedApiTerms:e?.has_accepted_api_terms??!1,sources:e?.sources??{source_to_limit:{}}});function $ye(e,t){return e?e.place_widget_block&&t.place_widget_block?{...t,place_widget_block:{...e.place_widget_block,review_summary:t.place_widget_block.review_summary}}:e.shopping_widget_block&&t.shopping_widget_block?{...t,shopping_widget_block:{...e.shopping_widget_block,review_summary:t.shopping_widget_block.review_summary}}:t:t}var c3;(function(e){e.SAVE_PROFILE="save_profile",e.DELETE_PROFILE="delete_profile",e.TOGGLE_DISABLED="toggle_disabled"})(c3||(c3={}));const qye=async({profileName:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/auth/get_special_profile",t,{params:{query:{profile_name:e}},timeoutMs:1500,numRetries:1});if(n||!r)throw new ye("API_CLIENTS_ERROR",{message:`Failed to get special profile ${e}`,cause:n,status:s.status??0});return{unlimitedProSearch:!!r.unlimited_pro_search,maxModelSelection:!!r.max_model_selection,unlimitedResearch:!!r.unlimited_research,fileUpload:!!r.file_upload}}catch(n){return Z.error(n),{unlimitedProSearch:!1,maxModelSelection:!1,unlimitedResearch:!1,fileUpload:!1}}},$xt=async({reason:e})=>{try{const{error:t,data:n,response:r}=await de.GET("/rest/user/subscription/refresh",e,{timeoutMs:Ze(),headers:{"X-Perplexity-CSRF-Protection":"1"}});if(t)throw new ye("API_CLIENTS_ERROR",{message:"Failed to refresh subscription status",cause:t,status:r.status??0});return n}catch(t){return Z.error(t),null}},PH={has_profile:!1,disabled:!1,bio:"",location:"",response_language:"",location_lng:"",location_lat:"",use_memory:!1,use_search_history:!1,language:""},Kye=async({headers:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/user/get_user_ai_profile",t,{timeoutMs:1500,numRetries:Kl,headers:e});if(n||!r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get user profile",cause:n,status:s.status??0});return r}catch(n){return Z.error(n),PH}},OH=async({skipConnectorPickerCredentials:e=!0,headers:t,reason:n})=>{try{const{error:r,data:s,response:o}=await de.GET("/rest/user/settings",n,{params:{query:{skip_connector_picker_credentials:e}},timeoutMs:1500,numRetries:Kl,headers:t});if(r||!s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get user settings",cause:r,status:o.status??0});return zR(s)}catch(r){return Z.error(r),zR({})}},qxt=async({type:e,value:t,reason:n})=>{const r=e==="memory"?{use_memory:t}:{use_search_history:t},{error:s,data:o,response:a}=await de.POST("/rest/user/save_user_ai_profile",n,{timeoutMs:Ze(),numRetries:1,headers:{"content-type":"application/json"},body:{action:c3.SAVE_PROFILE,updated_profile:{...r,version:Yl}}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to update personal search settings",cause:s,status:a.status??0});return o},Kxt=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/user/previous-subscription",e,{timeoutMs:3e3,numRetries:1});if(t)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get user previous subscription",cause:t,status:r.status??0});return n},Yxt=async({filters:e,skipToken:t,reason:n})=>{const{error:r,data:s,response:o}=await de.POST("/rest/connectors/sharepoint/sites",n,{body:{filters:e,skip_token:t},timeoutMs:Ze({productionMs:500}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch sharepoint sites",cause:r,status:o.status??0});return{sites:s.sites,skipToken:s.skip_token}};function Yye(e,t){return gt({enabled:!!e,queryKey:vye(e),queryFn:async()=>qye({profileName:e,reason:t})})}const Qye=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/user/info",e,{timeoutMs:1500,numRetries:Kl});if(t||!n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get user info",cause:t,status:r.status??0});return{isEnterprise:n.is_enterprise,isGov:n.is_gov,isStudent:n.is_student}},Xye=["user-info"],WR={isEnterprise:!1,isGov:!1,isStudent:!1},T4=({enabled:e,reason:t})=>{const n=gt({enabled:e??!0,queryKey:Xye,queryFn:async()=>Qye({reason:t}),placeholderData:WR}),r=n.data??WR;return d.useMemo(()=>({query:n,...r}),[n,r])};function Qr(){const{query:e}=T4({enabled:!0,reason:"user-capabilities"}),t=e.data?.isGov,n=t?"us_government_or_military":"",{data:r}=Yye(n,"user-capabilities");return d.useMemo(()=>{const o={unlimitedProSearch:!!r?.unlimitedProSearch,maxModelSelection:!!r?.maxModelSelection,unlimitedResearch:!!r?.unlimitedResearch,fileUpload:!!r?.fileUpload};return{isGovernmentRequestOrigin:t,specialCapabilities:o}},[t,r])}const LH=()=>{const{isGovernmentRequestOrigin:e}=Qr();return e===void 0},Qxt=async({source:e,locale:t,headers:n,reason:r})=>{try{const{data:s,error:o,response:a}=await de.POST("/rest/enterprise/customer-portal",r,{body:{origin:e,locale:t},timeoutMs:7500,headers:{...n,"Content-Type":"application/json"}});if(o)throw new ye("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:r}});if(s.status!=="success")throw new ye("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:r}});return s.url}catch(s){return Z.error(s),null}},Xxt=async({interval:e,subscriptionTier:t,origin:n,locale:r,reason:s,orgDraftUuid:o})=>{const a=Rx(),{data:i,error:c,response:u}=await de.POST("/rest/enterprise/checkout-session",s,{body:{referral_code:null,discount_code:null,origin:n,tier:e,locale:r,subscription_tier:t,org_draft_uuid:o??null},timeoutMs:3500,headers:{...a?{"Screen-Dimensions":a}:{}}});if(c)throw new ye("API_CLIENTS_ERROR",{cause:c,status:u.status??0,details:{reason:s}});return i},Zxt=async({interval:e,subscriptionTier:t,origin:n,locale:r,collectionMethod:s,billingAddress:o,reason:a,orgDraftUuid:i})=>{const c=Rx(),{data:u,error:f,response:m}=await de.POST("/rest/enterprise/subscription",a,{body:{collection_method:s,origin:n,locale:r,subscription_interval:e,subscription_tier:t,billing_address:o,org_draft_uuid:i??null},timeoutMs:1e4,headers:{...c?{"Screen-Dimensions":c}:{}}});if(f)throw new ye("API_CLIENTS_ERROR",{cause:f,status:m.status??0,details:{reason:a}});return u};var u3;(function(e){e.ON_PLATFORM="on_platform",e.OFF_PLATFORM="off_platform"})(u3||(u3={}));const Zye=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/user/pending-invitation",t,{headers:e,timeoutMs:Ze({productionMs:2e3}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n.pending_invitation??null}catch(n){return Z.error(n),null}},Jye=async({headers:e,reason:t})=>{const n={organization:void 0,org_user:void 0,is_in_organization:!1,pending_invitation:null};try{const{data:r,error:s,response:o}=await de.GET("/rest/enterprise/user/organization",t,{headers:e,timeoutMs:Ze({productionMs:2e3}),numRetries:1});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0,details:{reason:t}});return r.status!=="success",r}catch(r){return Z.error(r),n}},Jxt=async({inviteUUID:e,headers:t,reason:n})=>{try{const{data:r,error:s}=await de.GET("/rest/enterprise/organization/invite/{org_invite_uuid}",n,{params:{path:{org_invite_uuid:e}},headers:t,timeoutMs:Ze({productionMs:2e3}),numRetries:1}),o=s||r,a=o?.detail?{...o.detail}:o;if(a?.status!=="success")return a;const i=a?.invite?.subscription_tier??null;return{status:a?.status??"unknown",userEmail:a?.invite?.user_email??"",uuid:a?.invite?.uuid??"",orgDisplayName:a?.org_display_name??"",tncAcceptanceMethod:a?.tnc_acceptance_method??u3.ON_PLATFORM,tncAccepted:a?.tnc_accepted??!1,subscriptionTier:i}}catch(r){return Z.error(r),null}},evt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/subscription/refresh",t,{headers:e,timeoutMs:4e3});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return{subscriptionStatus:n?.subscription_status??null}}catch(n){return Z.error(n),null}},tvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/premium-secure-eligibility",t,{headers:e,timeoutMs:Ze({productionMs:2e3}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n}catch(n){return Z.error(n),null}},nvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/premium-secure-billing-update",t,{headers:{...e,"Content-Type":"application/json"},timeoutMs:Ze({productionMs:2e3}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n}catch(n){return Z.error(n),null}},rvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/subscription-info",t,{headers:e,timeoutMs:Ze({productionMs:2e3}),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get org subscription info",n),null}},FH=async({uuid:e,success:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/sse/perplexity_connector_auth_response",n,{body:{result:{tool_uuid:e,success:t}},backOffTime:100,numRetries:1,headers:{"Content-Type":"application/json"}});if(r?.status!=="success")throw new ye("API_CLIENTS_ERROR",{message:"Failed to post perplexity connector auth response",cause:s,status:o.status??0});return!0}catch(r){return Z.error("Failed to post perplexity connector auth response",r),!1}},svt=async({orgInviteUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/invite/{org_invite_uuid}/accept",t,{params:{path:{org_invite_uuid:e}},timeoutMs:Ze({productionMs:2e3})});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t,orgInviteUUID:e}});return n},ovt=async({orgInviteUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/invite/{org_invite_uuid}/decline",t,{params:{path:{org_invite_uuid:e}},timeoutMs:Ze({productionMs:2e3})});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t,orgInviteUUID:e}});return n},avt=async({openInviteLinkUuid:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/enterprise/organization/shareable-invite/{open_invite_link_uuid}",n,{params:{path:{open_invite_link_uuid:e}},headers:t,timeoutMs:Ze({productionMs:2e3}),numRetries:1});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0,details:{reason:n,openInviteLinkUuid:e}});return r},ivt=async({openInviteLinkUuid:e,headers:t,reason:n})=>{try{const{error:r,data:s,response:o}=await de.POST("/rest/enterprise/organization/shareable-invite/join/{open_invite_link_uuid}",n,{params:{path:{open_invite_link_uuid:e}},headers:{"content-type":"application/json",...t},timeoutMs:3e3});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:o.status??0});return s}catch(r){throw Z.error(r),r}},uu=()=>{const{session:e}=je(),t=e?.user?.org_uuid;return!!(t&&t!=="none")};function mo({shouldRefetchOnMount:e=!0,forceFetch:t=!1,reason:n}){const r=uu(),{data:s,refetch:o,isSuccess:a,isFetching:i}=gt({enabled:t||r,queryKey:b4(),queryFn:()=>Jye({reason:n}),placeholderData:$l,refetchOnMount:e});return d.useMemo(()=>({orgUser:s?.org_user,isAdmin:s?.org_user?.role==="ADMIN",organization:s?.organization,isEnterprise:r,refetch:o,isLoading:!s&&i,isFetching:i,isSuccess:a}),[s,r,i,a,o])}const e2e=()=>{const{organization:e,isEnterprise:t,isLoading:n}=mo({reason:"check-upsell-enterprise-consent"});return n?!0:t?!e?.settings?.product_communications_enabled:!1},A4="pplx.chosen-locale",d3="pplx.la-status",BH="pplx.source-selection-v3",GR="pplx.prefers-metric",UH="pplx.default-search-session",t2e="pplx.utm-source",VH="pplx.pt",HH=400,n2e=30,r2e=7,s2e=e=>{lo(A4,e,{expires:HH})},o2e=()=>hr(A4),a2e=()=>{Qp(A4)},i2e=e=>{lo(d3,e,{})},N_=(e,t)=>{const n=`${BH}-${t}`;lo(n,JSON.stringify(e),{expires:r2e})},l2e=e=>{const t=`${BH}-${e}`,n=hr(t);return n?JSON.parse(n):null},c2e=()=>{lo("pplx.has-discovered-space-mentions","true",{expires:HH})},u2e=e=>{lo(UH,e,{expires:n2e})},d2e=()=>hr(UH),f2e=()=>hr(t2e),lvt=()=>hr(VH),m2e=e=>{lo(VH,e)},p2e=()=>d2e()==="firefox"?!0:typeof window>"u"?!1:new URL(window.location.href).searchParams.get("pc")==="firefox",$R="partnerships",h2e=()=>f2e()===$R?!0:typeof window>"u"?!1:new URL(window.location.href).searchParams.get("utm_source")===$R,Hd=d.memo(({isSamsungBrowser:e,isWindowsApp:t,isIPad:n,isComet:r,isFirefoxDefaultSearch:s,isPartnershipCampaign:o,isGovernment:a,isEnterpriseWithoutConsent:i,children:c})=>{const u=Ca(),f=p2e(),m=h2e(),{isGovernmentRequestOrigin:p}=Qr(),{device:{isWindowsApp:h,isSamsungBrowser:g,isIPad:y}}=on(),x=LH(),v=e2e();return d.useMemo(()=>!!(r&&u||t&&h||e&&g||n&&y||s&&f||o&&m||a&&(x||p)||i&&v),[u,h,g,y,r,e,t,n,s,f,o,m,a,p,x,i,v])?null:c});Hd.displayName="OmitUpsellIf";const zH=["ppl-ai-file-upload","ppl-ai-sandbox-file-upload","ppl-ai-experimental-file-upload"],g2e=e=>zH.some(t=>e.url.includes(`${t}.s3.amazonaws.com/web/direct-files`));var f3;(function(e){e.token_limit_exceeded="token_limit_exceeded",e.parsing_error="parsing_error",e.unknown_error="unknown_error",e.unauthorized="unauthorized",e.no_data_received="no_data_received",e.file_type_not_supported="file_type_not_supported",e.image_failed_moderation="image_failed_moderation"})(f3||(f3={}));var ad;(function(e){e.generic_upload_error="generic_upload_error",e.unsupported_type="unsupported_type",e.too_large="too_large",e.too_small="too_small",e.no_name="no_name",e.failed_moderation="failed_moderation",e.rate_limited="rate_limited",e.over_file_count="over_file_count",e.over_image_count="over_image_count",e.attachments_disabled_by_organization="attachments_disabled_by_organization"})(ad||(ad={}));const ny=e=>{if(Nf(e))return"application/pdf";const n=e.split("?")[0].split("#")[0].split(".").pop()?.toLowerCase();return n&&{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",jp2:"image/jp2",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",svg:"image/svg+xml",webp:"image/webp",ico:"image/x-icon",avif:"image/avif",heic:"image/heic",heif:"image/heif",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",txt:"text/plain",csv:"text/csv",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",md:"text/markdown"}[n]||"application/octet-stream"},y2e=e=>{const t=e.file_metadata?.file_repository_type;return e.is_attachment&&!t&&!e.meta_data?.file_uuid},x2e=e=>{if(!e)return!1;try{return new URL(e).hostname.includes("s3.amazonaws.com")}catch{return!1}},go=Ue({token_limit_exceeded:{id:"cnFlyTXVDl",defaultMessage:"File {filename} exceeds the model's token limit."},parsing_error:{id:"RdRRX8+YG/",defaultMessage:"Failed to parse file {filename}."},file_type_not_supported:{id:"IaflMSTTq6",defaultMessage:"File type not supported for {filename}."},unknown_error:{id:"zhy7qBi3Eu",defaultMessage:"Unknown error for file {filename}."},unauthorized:{id:"6bOe+cTUhc",defaultMessage:"User not authorised to access file {filename}."},no_data_received:{id:"34PXW7VvKh",defaultMessage:"No data received for file {filename}."},generic_upload_error:{id:"xVFvYDY5wK",defaultMessage:"File upload failed"},unsupported_type:{id:"VUOyYEDS96",defaultMessage:"The file type you uploaded is not supported."},too_large:{id:"XBcIjOYq8V",defaultMessage:"File too large: {max} maximum."},too_small:{id:"ZUyiNCx0Aw",defaultMessage:"File too small."},no_name:{id:"IkAmckATMw",defaultMessage:"File name is required."},image_failed_moderation:{id:"YCCLnMQDPb",defaultMessage:"File {filename} failed moderation."},failed_moderation:{id:"hnN6c9ExET",defaultMessage:"File upload failed moderation."},rate_limited:{id:"el7NlqcDQZ",defaultMessage:"You have reached the daily upload limit for your plan."},over_file_count:{id:"2+5sg16GUy",defaultMessage:"You are allowed up to {maxNumFiles, plural, one {# file} other {# files}} at once."},over_image_count:{id:"FIudmpgA1s",defaultMessage:"You are allowed up to {maxNumImages, plural, one {# image} other {# images}} at once."},attachments_disabled_by_organization:{id:"3N0C1GH7jP",defaultMessage:"Your organization has disabled attachments."}}),ng=e=>{if(e.startsWith("/rest/connectors/wiley/"))return"WILEY";if(e.includes("drive.google.com")||e.includes("connectors/google-drive")||e.includes("docs.google.com"))return"GOOGLE_DRIVE";if(e.includes("onedrive.live.com")||e.includes("1drv.ms")||e.includes("connectors/onedrive"))return"ONEDRIVE";if(e.includes(".sharepoint.com")||e.includes("connectors/sharepoint"))return"SHAREPOINT";if(e.includes("dropbox.com/preview")||e.includes("connectors/dropbox"))return"DROPBOX";if(e.includes("app.box.com/file")||e.includes("connectors/box"))return"BOX"},WH=e=>{const t=e.meta_data?.connection_type??e.file_metadata?.connector_type;return t||ng(e.url)},rg=e=>!!e?.meta_data?.patent_name||!!e?.url&&Nf(e.url),N4=e=>rg(e)?e?.meta_data?.patent_name:void 0,m3=e=>!!(e?.meta_data?.connection_type&&e?.meta_data.connection_type!=="LOCAL")||e.is_attachment&&!!ng(e.url),Lx=e=>zH.some(n=>e.includes(`${n}.s3.amazonaws.com/web/direct-files`))||wd(e)||Nf(e),Xl=e=>e.is_attachment&&Lx(e.url),GH=e=>e.trim().replace(/\/+$/,"").replace(/^(?:https?:\/\/)?(?:www\.)?/,""),cvt=e=>!!new RegExp("^((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,})(\\/[\\w\\-._~:/@!$&'()*+,;=%.]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e);function Ur(e){const t=/(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(?:\.[a-zA-Z]{2,})?|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d+)?/,n=e.match(t);return n&&n.length>0?n[1]||n[0]:"unknown"}function sg(e){const t=Ur(e);return t==="unknown"?"unknown":t.replace(/\.[^.]*$/,"")}function Kc(e){return e.includes("calendar.google.com")||e.includes("google.com/calendar")?"https://calendar.google.com":e.includes("mail.google.com")||e.includes("google.com/mail")?"https://mail.google.com":_2e(e)?"www.perplexity.ai":Ur(e)}function uvt(e){return e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`}function Ji(e){const t=["(?:youtube?\\.com\\/","(?:[^/\\n\\s]+\\/\\S+\\/","|(?:v|e(?:mbed)?)\\/","|\\S*?[?&]v=",")","|youtu\\.be\\/",")([a-zA-Z0-9_-]{11})"].join(""),n=new RegExp(t),r=e.match(n);if(r&&r[1].length==11)return r[1]}function wd(e){return e.startsWith("https://pplx-res.cloudinary.com/")||e.startsWith("https://api.cloudinary.com/v1_1/pplx/image/download")}function Nf(e){const t=e.startsWith("https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf"),n=S2e(e)&&e.includes("/rest/file-repository/patents/");return t||n}function dvt(e){return e.includes("code-interpreter-files.s3.amazonaws.com")||e.includes("pplx_code_interpreter")}function fvt(e){return e.includes("user-gen-media-assets")}function qR(e){return e.replace(/\/s--[^/]+--\/v\d+\//,"/")}function R4(e){return!Xl(e)&&!!e.url&&!Ji(e.url)&&!wd(e.url)&&!e.is_memory}const du=e=>{try{const r=new URL(e).pathname.replace(/^\//,"").split("/"),s=r[r.length-1];return decodeURIComponent(s)}catch{return"File"}},$H=e=>{const t=e,n=t.indexOf("/"),r=Math.max(23,n+16);return t.length>r?t.substring(0,r-1)+"…":t},v2e=(e,t)=>`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent([e,t].filter(Boolean).join(", "))}`,b2e=(e,t)=>`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([e,t].filter(Boolean).join(", "))}`;function mvt(e){return e.includes("https://openai.com/index/image-generation-api/")}function _2e(e){return e.startsWith("chrome://")||e.startsWith("chrome-extension://")||e.startsWith("browser-extension://")||e.startsWith("browser://")||e.startsWith("comet://")}const pvt=e=>e.replace("comet://","chrome://"),Fx=e=>{if(!e)return null;try{return new URL(e)}catch{return null}},w2e=async e=>{const t=[];return await Promise.all(e.map(async n=>{await new Promise(r=>setTimeout(r,Math.random()*500));try{(await fetch(n,{method:"HEAD"})).ok&&t.push(n)}catch(r){console.debug(`URL ${n} is not reachable:`,r)}})),t};async function*C2e(e,t=5){let n=1,r=0;for(;r0&&(yield o,n=t)}}const D4=e=>{try{const t=new URL(e);return["AWSAccessKeyId","Signature","Expires"].every(n=>t.searchParams.has(n))}catch{return!1}},p3=e=>{if(!e)return"";const t=e.indexOf("?");return(t===-1?e:e.substring(0,t)).replace(/\/+$/,"")},S2e=e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}};let KR=0;class Mm{eventTime=-1;setOnce(){return this.eventTime==-1?(this.eventTime=Date.now(),!0):!1}timeSinceTimestamp(t){return this.eventTime===-1||t==null?-1:this.eventTimet?(Z.log(`TimeMarker.timeBeforeTimestamp found inconsistency: mytime ${this.eventTime}, next: ${t}`),-1):t-this.eventTime}wasSet(){return this.eventTime!=-1}}const E2e={firstServerResponseReceived:!1,firstLLMTokenReceived:!1,isPerplexityBrowser:!1},Zl=new Map,k2e=(e,{hasLLMToken:t,hasSearchResults:n,hasSources:r},s)=>{M2e(e,s),T2e(e,t,s),A2e(e,n),N2e(e,r)},M2e=(e,t)=>{const n=Zl.get(e);if(!n||n.firstServerResponseReceived||!n.submitTimestamp||!n.startFirstServerResponseMarker?.setOnce())return;n.firstServerResponseReceived=!0;const{queryStr:r,isFollowup:s,queryParams:o}=n,a=I2e(e);a>0&&Li({name:"query first server response",data:{startFirstServerResponseElapsed:a,queryStr:r,isFollowup:s,mode:o?.mode??"unknown",isPerplexityBrowser:n.isPerplexityBrowser},user:t??void 0})},T2e=(e,t,n)=>{const r=Zl.get(e);if(!r||r.firstLLMTokenReceived||!t||!r.startLLMTokenMarker?.setOnce())return;r.firstLLMTokenReceived=!0;const{queryStr:s,isFollowup:o,queryParams:a}=r,i=P2e(e);i>0&&Li({name:"query first llm token",data:{startLLMTokenElapsed:i,queryStr:s,isFollowup:o,mode:a?.mode??"unknown",isPerplexityBrowser:r.isPerplexityBrowser},user:n??void 0})},A2e=(e,t)=>{const n=Zl.get(e);if(n){if(!t)return}else return;n.firstSearchResultsMarker?.setOnce()},N2e=(e,t)=>{const n=Zl.get(e);if(n){if(!t)return}else return;n.firstSourcesMarker?.setOnce()},R2e=({latencies:e,isMobile:t})=>{Ll("web.frontend.autosuggest_latency",{latencies:e,isMobile:t})},R_=(e,t)=>e?NM:t??void 0,np=e=>{if(e)return NM;const t=Us();if(t?.android_version)return"browser_android_mweb";if(t?.ios_version)return"browser_ios_mweb"},YR=(e,{session:t,source:n,name:r})=>{const s=Zl.get(e);s&&(s.endStreamTimestamp||(s.endStreamTimestamp=Date.now(),Li({name:r,data:s,user:{id:t?.user?.id,subscription_status:t?.user?.subscription_status},source:n})))},D2e=e=>Fx(e)?.host??"",j2e=(e,{name:t,queryStr:n,queryParams:r,isFollowup:s,frontendUUID:o,isPerplexityBrowser:a,session:i,browserVersion:c,source:u,connectors:f,mentions:m,inlineAssistantAction:p})=>{KR+=1;const h={...E2e};h.submissionType=t,h.submitTimestamp=Date.now(),h.queryStr=n,h.queryParams=r,h.frontendUUID=o,h.submissionCount=KR,h.isFollowup=s,h.startFirstServerResponseMarker=new Mm,h.startLLMTokenMarker=new Mm,h.firstSearchResultsMarker=new Mm,h.firstSourcesMarker=new Mm,h.firstSourcesRenderMarker=new Mm,h.isPerplexityBrowser=a,h.browserVersion=c,h.enabledConnectors=f?.enabled,h.disabledConnectors=f?.disabled,h.referrer=document.referrer,h.inlineAssistantAction=p;const g=m?.filter(v=>v.type==="tab"&&v.url)??[];h.attachedTabsDomains=[...new Set(g.map(v=>D2e(v.url)).filter(Boolean))],h.attachedTabsCount=g.length;const y=m?.filter(v=>v.type==="space")??[];h.mentionedSpacesCount=y.length;const x=m?.filter(v=>v.type==="shortcut")??[];h.mentionedShortcutsCount=x.length,Zl.set(e,h),Li({name:"submit query",data:h,user:i?.user??void 0,source:u})},I2e=e=>{const t=Zl.get(e);let n=-1;return t&&(n=t.startFirstServerResponseMarker?.timeSinceTimestamp(t.submitTimestamp)??-1),n},P2e=e=>{const t=Zl.get(e);let n=-1;return t&&(n=t.startLLMTokenMarker?.timeSinceTimestamp(t.submitTimestamp)??-1),n};var QR;(function(e){e.FLASHCARD="FLASHCARD",e.QUIZ="QUIZ"})(QR||(QR={}));const Ke=e=>{const{device:{isWindowsApp:t}}=on(),n=d.useRef(new Set),r=d.useCallback((i,c={})=>{const u=np(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]),s=d.useCallback(i=>{const c=np(t),u=i.map(({name:f,data:m})=>({name:f,data:m,source:c,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}}));Ege(u)},[t,e?.user?.id,e?.user?.subscription_status]),o=d.useCallback((i,c)=>{const u=np(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]),a=d.useCallback((i,c={})=>{if(n.current.has(i))return;n.current.add(i);const u=np(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]);return d.useMemo(()=>({trackEvent:r,trackEventTyped:o,trackEventOnce:a,trackEventBatch:s}),[r,s,o,a])},Ut=T.memo(()=>l.jsx("div",{className:"bg-backdrop/70 fixed inset-0 z-[999] flex items-center justify-center backdrop-blur-sm",children:l.jsx(ql,{})}));Ut.displayName="ModalLoader";const qH=zt("ModalStateContext",{currentOpenModals:[],currentOpenedModal:null,openModal:()=>{},openStackedModal:()=>{},updateModal:()=>{},closeModal:()=>{}}),O2e=()=>{const e=d.useContext(qH);if(!e)throw new Error("useModalState must be used within ModalContext");return e},gn=()=>{const e=O2e(),t=Ho(),n=d.useMemo(()=>{const s=e.currentOpenedModal??t.legacyIdentifiers.currentOpenModal??null,o=[];o.push(...e.currentOpenModals);for(const a of t.legacyIdentifiers.currentOpenModals)o.push({modalName:a,arg:{}});return{openModal:e.openModal,closeModal:e.closeModal,openStackedModal:e.openStackedModal,updateModal:e.updateModal,currentOpenedModal:s,currentOpenModals:o}},[e.closeModal,e.openModal,e.openStackedModal,e.updateModal,e.currentOpenModals,e.currentOpenedModal,t.legacyIdentifiers.currentOpenModal,t.legacyIdentifiers.currentOpenModals]),r=d.useMemo(()=>{const s=e.currentOpenedModal??t.legacyIdentifiers.currentOpenModal??void 0,o=new Set(t.legacyIdentifiers.currentOpenModals);for(const a of e.currentOpenModals)o.add(a.modalName);return{openModal:t.openModal,openStackedModal:t.openStackedModal,legacyIdentifiers:{currentOpenModal:s,currentOpenModals:o}}},[e.currentOpenModals,e.currentOpenedModal,t.legacyIdentifiers.currentOpenModal,t.legacyIdentifiers.currentOpenModals,t.openModal,t.openStackedModal]);return{legacy:n,updated:r}},KH=zt("ModalInternalContext",{canOutsideClickClose:!0}),YH=T.memo(()=>l.jsx("p",{children:"An error has occurred"}));YH.displayName="ErrorFallback";const L2e=Se(async()=>{const{LocationPermissionModal:e}=await Ee(()=>q(()=>import("./LocationPermissionModal-C7z1rtlp.js"),__vite__mapDeps([5,4,1,6,3,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),F2e=Se(async()=>{const{FileUploadModal:e}=await Ee(()=>q(()=>import("./FileUploadModal-cgKFfF_8.js"),__vite__mapDeps([13,4,1,8,3,9,6,7,14,15,16,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),B2e=Se(async()=>{const{CometDownloadInstructionsModal:e}=await Ee(()=>q(()=>import("./CometDownloadInstructionsModal-DBWRpG-q.js"),__vite__mapDeps([17,4,1,6,3,18,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),U2e=Se(async()=>{const{CollectionSelectModal:e}=await Ee(()=>q(()=>import("./CollectionSelectModal-Dnx1hIwa.js"),__vite__mapDeps([19,4,1,6,3,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),V2e=Se(async()=>{const{OnboardingModal:e}=await Ee(()=>q(()=>import("./OnboardingModal-11-eSP6q.js").then(t=>t.a),__vite__mapDeps([20,4,1,6,3,21,22,23,24,9,7,8,25,26,27,28,16,29,30,10,11,12,31,32,33,34,35,36])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),H2e=Se(async()=>{const{PurchaseConfirmationToast:e}=await Ee(()=>q(()=>import("./PurchaseConfirmationToast-DCwXfCB7.js"),__vite__mapDeps([37,4,1,6,3,38,7,39,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),z2e=Se(async()=>{const{ThreadLossAversionModal:e}=await Ee(()=>q(()=>import("./ThreadLossAversionModal-B2OYxFRx.js"),__vite__mapDeps([40,4,1,6,3,41,7,42,9,8,43,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),W2e=Se(async()=>{const{CompanyDataPrivacyModal:e}=await Ee(()=>q(()=>import("./CompanyDataPrivacyModal-CbhDlntY.js"),__vite__mapDeps([44,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),G2e=Se(async()=>{const{PricingTableModal:e}=await Ee(()=>q(()=>import("./PricingTableModal-CugDLvHX.js"),__vite__mapDeps([45,4,1,3,6,21,22,23,24,9,7,8,25,26,27,28,18,10,11,12])));return{default:e}}),$2e=Se(async()=>{const{MapModal:e}=await Ee(()=>q(()=>import("./MapModal-CRxa-ZnV.js"),__vite__mapDeps([46,4,1,7,47,6,3,9,8,10,11,12])));return{default:e}}),q2e=Se(async()=>{const{ShoppingOnboardingModal:e}=await Ee(()=>q(()=>import("./ShoppingOnboardingModal-bhtnMnb0.js"),__vite__mapDeps([48,4,1,6,3,49,8,9,7,50,51,52,53,54,55,56,57,39,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),K2e=Se(async()=>{const{PurchaseDetailsModal:e}=await Ee(()=>q(()=>import("./PurchaseDetailsModal-B9P3ml3w.js"),__vite__mapDeps([58,4,1,6,3,9,7,8,50,51,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Y2e=Se(async()=>{const{SpaceSettingsModal:e}=await Ee(()=>q(()=>import("./SpaceSettingsModal-C37tT37Q.js"),__vite__mapDeps([59,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Q2e=Se(async()=>{const{MemoryListModal:e}=await Ee(()=>q(()=>import("./MemoryListModal-B6YFeHJx.js"),__vite__mapDeps([60,4,1,6,3,7,61,8,9,10,11,12])));return{default:e}}),X2e=Se(async()=>{const{MemoryDetailModal:e}=await Ee(()=>q(()=>import("./MemoryDetailModal-Cz0x7afO.js"),__vite__mapDeps([62,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}}),Z2e=Se(async()=>{const{HotelRoomDetailsModal:e}=await Ee(()=>q(()=>import("./HotelRoomDetailsModal-CnYWwlO3.js"),__vite__mapDeps([63,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),J2e=Se(async()=>{const{PaymentModal:e}=await Ee(()=>q(()=>import("./PaymentModal-lwcZCukl.js"),__vite__mapDeps([64,4,1,8,3,9,6,7,23,65,25,24,57,54,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),exe=Se(async()=>{const{MeetingDefaultsModal:e}=await Ee(()=>q(()=>import("./MeetingDefaultsModal-CwkmKxKs.js"),__vite__mapDeps([66,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),txe=Se(async()=>{const{AvailabilityModal:e}=await Ee(()=>q(()=>import("./AvailabilityModal-DzKBk9Ia.js"),__vite__mapDeps([67,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),nxe=Se(async()=>{const{ProMessageModal:e}=await Ee(()=>q(()=>import("./ProMessageModal-CoBlFBeC.js"),__vite__mapDeps([68,4,1,7,3,8,9,6,10,11,12])));return{default:e}}),rxe=Se(async()=>Ee(()=>q(()=>import("./SubSuccessModal-BQP8YCY4.js"),__vite__mapDeps([69,4,1,8,3,9,6,7,70,24,10,11,12])))),sxe=Se(async()=>Ee(()=>q(()=>import("./ReferralErrorModal-Dw7Cs0NQ.js"),__vite__mapDeps([71,4,1,6,3,34,7,8,9,10,11,12])))),oxe=Se(async()=>Ee(()=>q(()=>import("./ReferralSuccessModal-D_bXwVjv.js"),__vite__mapDeps([72,4,1,6,3,33,8,9,7,34,35,26,10,11,12])))),axe=Se(async()=>Ee(()=>q(()=>import("./IncentiveProModal-WA50q5PW.js"),__vite__mapDeps([73,4,1,6,3,8,9,7,10,11,12])))),ixe=Se(async()=>{const{StudentReferralsModal:e}=await Ee(()=>q(()=>import("./StudentReferralsModal-xKhJkkC9.js"),__vite__mapDeps([74,4,1,8,3,9,6,7,36,33,34,35,26,28,10,11,12])));return{default:e}}),lxe=Se(async()=>{const{SheerIDModal:e}=await Ee(()=>q(()=>import("./SheerIDModal-DEOxydlg.js"),__vite__mapDeps([75,4,1,6,3,35,26,8,9,7,28,10,11,12])));return{default:e}}),cxe=Se(async()=>Ee(()=>q(()=>import("./BraintreeSubscriptionModal-DMCMkX0U.js"),__vite__mapDeps([76,4,1,8,3,9,6,7,10,11,12])))),uxe=Se(async()=>{const{RestaurantBookingModal:e}=await Ee(()=>q(()=>import("./RestaurantBookingModal-9XsyjsyP.js"),__vite__mapDeps([77,4,1,78,6,3,79,38,7,80,42,81,82,9,83,47,8,10,11,12,29])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),dxe=Se(async()=>Ee(()=>q(()=>import("./SheerIdRedirectModal-Drnyj97z.js"),__vite__mapDeps([84,4,1,6,3,8,9,7,10,11,12])))),fxe=Se(async()=>{const{EnterprisePremiumSecureUpgradeModal:e}=await Ee(()=>q(()=>import("./EnterprisePremiumSecureUpgradeModal-COOXV9oP.js"),__vite__mapDeps([85,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),mxe=Se(async()=>{const{ShortcutModal:e}=await Ee(()=>q(()=>import("./ShortcutModal-BYQi4lAc.js"),__vite__mapDeps([86,4,1,8,3,9,6,7,10,11,12])));return{default:e}}),pxe=Se(async()=>Ee(()=>q(()=>Promise.resolve().then(()=>d1t),void 0))),hxe=Se(async()=>{const{AutomationModal:e}=await Ee(()=>q(()=>Promise.resolve().then(()=>Sst),void 0));return{default:e}}),gxe=Se(async()=>{const{FinanceAlertModal:e}=await Ee(()=>q(()=>Promise.resolve().then(()=>Tst),void 0));return{default:e}}),yxe=Se(async()=>{const{SharepointSiteModal:e}=await Ee(()=>q(()=>import("./SharepointSiteModal-BEjchnjp.js"),__vite__mapDeps([87,4,1,6,3,88,8,9,7,10,11,12])));return{default:e}}),xxe=Se(async()=>{const{MCPServerModal:e}=await Ee(()=>q(()=>import("./MCPServerModal-BByRaphG.js"),__vite__mapDeps([89,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),vxe=Se(async()=>{const{MemberSetTierModal:e}=await Ee(()=>q(()=>import("./MemberSetTierModal-CAwhXWS_.js"),__vite__mapDeps([90,4,1,6,3,70,7,8,9,24,57,10,11,12])));return{default:e}}),bxe=Se(async()=>{const{MCPServiceToolsModal:e}=await Ee(()=>q(()=>import("./MCPServiceToolsModal-0f_zDLnc.js"),__vite__mapDeps([91,4,1,6,3,92,8,9,7,10,11,12])));return{default:e}}),_xe=Se(async()=>{const{PlaceModal:e}=await Ee(()=>q(()=>import("./PlaceModal-daWQ7pmB.js"),__vite__mapDeps([78,4,1,6,3,79,38,7,80,42,81,82,9,83,47,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),XR=Se(async()=>{const{OrgInviteModal:e}=await Ee(()=>q(()=>import("./OrgInviteModal-Ditv8VCG.js"),__vite__mapDeps([93,4,1,8,3,9,6,7,94,95,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),wxe=Se(async()=>{const{RequestAccessModal:e}=await Ee(()=>q(()=>import("./RequestAccessModal-DXSIFSRU.js"),__vite__mapDeps([96,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Cxe=Se(async()=>{const{SpaceContextModal:e}=await Ee(()=>q(()=>import("./SpaceContextModal-SO-KrLF7.js"),__vite__mapDeps([97,4,1,8,3,9,6,7,15,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Sxe=Se(async()=>{const{LoginModal:e}=await Ee(()=>q(()=>import("./LoginModal-COSzC1CN.js"),__vite__mapDeps([98,4,1,6,3,41,7,42,9,8,43,18,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Exe=Se(async()=>{const{AnnouncementImageModal:e}=await Ee(()=>q(()=>import("./AnnouncementImageModal-pqZOIFHg.js"),__vite__mapDeps([99,4,1,3,7,8,9,6,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),kxe=Se(async()=>{const{FullscreenUpsellModal:e}=await Ee(()=>q(()=>import("./FullscreenUpsellModal-CZn4Al_i.js"),__vite__mapDeps([100,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Mxe=Se(async()=>{const{ShoppingTryOnOnboardingModal:e}=await Ee(()=>q(()=>import("./ShoppingTryOnOnboardingModal-X9DmFFhQ.js"),__vite__mapDeps([101,4,1,6,3,102,9,7,103,104,105,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Txe=Se(async()=>{const{CheckSourcesModal:e}=await Ee(()=>q(()=>import("./CheckSourcesModal-B_93cFgV.js"),__vite__mapDeps([106,1,4,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Axe=Se(async()=>{const{MemorySearchHistoryModal:e}=await Ee(()=>q(()=>Promise.resolve().then(()=>Tqe),void 0));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Nxe=Se(async()=>{const{GmailFailedPermissionsModal:e}=await Ee(()=>q(()=>import("./GmailModals-TiO0hR9e.js"),__vite__mapDeps([107,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Rxe=Se(async()=>{const{EmailAssistantDisconnectWarningModal:e}=await Ee(()=>q(()=>import("./EmailAssistantDisconnectWarningModal-DnJK1tGv.js"),__vite__mapDeps([108,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Dxe=Se(async()=>{const{CalendarSelectionModal:e}=await Ee(()=>q(()=>import("./CalendarSelectionModal-Z1AJ_OXE.js"),__vite__mapDeps([109,4,1,8,3,9,6,7,110,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),jxe=Se(async()=>{const{DeleteAllMemoriesModal:e}=await Ee(()=>q(()=>import("./DeleteAllMemoriesModal-CVnLcdBB.js"),__vite__mapDeps([111,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Ixe=Se(async()=>{const{DeleteMemoryModal:e}=await Ee(()=>q(()=>import("./DeleteMemoryModal-CJIndnid.js"),__vite__mapDeps([112,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Pxe=Se(async()=>{const{ThirdPartyPersonalizationModal:e}=await Ee(()=>q(()=>import("./PersonalSearchSettingsMain-CB832-ot.js"),__vite__mapDeps([113,4,1,8,3,9,6,7,92,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Oxe=Se(async()=>{const{WatchlistModal:e}=await Ee(()=>q(()=>import("./WatchlistModal-B-vXq55x.js"),__vite__mapDeps([114,1,4,8,3,9,6,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Lxe=Se(async()=>{const{AvatarManagementModal:e}=await Ee(()=>q(()=>import("./AvatarManagementModal-Co2ygqU8.js"),__vite__mapDeps([115,4,1,8,3,9,6,7,105,116,50,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})});Se(async()=>{const{InstallGateModal:e}=await Ee(()=>q(()=>import("./InstallGateModal-sF8t2bC6.js"),__vite__mapDeps([117,4,1,6,3,41,7,42,9,8,43,32,18,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})});const Fxe=Se(async()=>{const{DowngradeModal:e}=await Ee(()=>q(()=>import("./DowngradeModal-CdY3vXv_.js"),__vite__mapDeps([118,4,1,6,3,119,27,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Bxe=Se(async()=>{const{UpgradeModal:e}=await Ee(()=>q(()=>import("./UpgradeModal-BCjLeS8I.js"),__vite__mapDeps([120,4,1,8,3,9,6,7,65,25,24,57,119,27,121,26,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})});function Uxe(e){return e?{[e.modalName]:e.arg}:{}}const QH=T.memo(({})=>{const{currentOpenModals:e}=gn().legacy,[t,n]=d.useState(e.length);d.useEffect(()=>{setTimeout(()=>{n(e.length)},100)},[e.length]);const r=t!=e.length;return e.map((s,o)=>l.jsx(XH,{modal:s,canOutsideClickClose:!r&&o+1==e.length},o))});QH.displayName="Modals";const XH=T.memo(({modal:e,canOutsideClickClose:t})=>{const n=d.useMemo(()=>({canOutsideClickClose:t}),[t]);return l.jsx(KH.Provider,{value:n,children:l.jsx(ZH,{modal:e})})});XH.displayName="SingleModalWrapper";const ZH=T.memo(({modal:e})=>{const{closeModal:t}=gn().legacy,{hasActiveSubscription:n}=Bt(),r=e.modalName,{pricingModal:s,loginModal:o,installModal:a,cometDownloadInstructionsModal:i,requestAccessModal:c,collectionSelectModal:u,spaceSettings:f,companyDataPrivacyModal:m,checkSourcesModal:p,mapModal:h,purchaseConfirmationModal:g,shoppingOnboardingModal:y,shoppingOrderDetailsModal:x,lossAversionModal:v,spaceUploadFilesModal:b,spaceContextModal:_,locationPermissionModal:w,watchlistModal:S,deleteMemoryModal:C,memoryDetailModal:E,hotelRoomDetailsModal:N,memoryListModal:k,proSubscriptionPaymentModal:I,proMessageModal:M,memorySearchHistoryModal:A,gmailFailedPermissionsModal:D,emailAssistantDisconnectWarningModal:P,calendarSelectionModal:F,subSuccessModal:R,incentiveProModal:j,restaurantBookingModal:L,sheerIdRedirectModal:U,enterprisePremiumSecureUpgradeModal:O,taskShortcutModal:$,financeAlertModal:G,scheduledTaskModal:H,automationModal:Q,referralSuccessModal:Y,sharepointSiteModal:te,avatarManagementModal:se,shoppingTryOnOnboardingModal:ae,braintreeSubscriptionModal:X,announcementImageModal:ee,fullscreenUpsellModal:le,studentReferrals:re,sheerIdModal:ce,meetingDefaultsModal:ue,availabilityModal:pe,mcpServerModal:xe,mcpServiceToolsModal:he,memberSetTierModal:_e,placeModal:ke,thirdPartyPersonalizationModal:De,orgInviteModal:Ce}=Uxe(e),{session:Be}=je(),{trackEvent:we}=Ke(Be);return l.jsxs(l.Fragment,{children:[r==="loginModal"&&o?.origin&&l.jsx(Sxe,{pitchMessage:o?.pitchMessage,origin:o.origin,isOpen:r==="loginModal",experimentalImageDesign:o.experimentalImageDesign,sheetModalDesign:o.sheetModalDesign,closeModal:t,closeCallback:o?.closeCallback,overrideRedirectUrl:o?.overrideRedirectUrl,disallowedMethods:o?.disallowedMethods,loginButtonsStyle:o?.loginButtonsStyle,renderCloseButton:o?.renderCloseButton,preEnteredEmail:o?.preEnteredEmail,autoFocus:o?.autoFocus}),!1,r==="cometDownloadInstructionsModal"&&i&&i.requestedPlatform&&l.jsx(B2e,{isOpen:r==="cometDownloadInstructionsModal",onClose:t,requestedPlatform:i.requestedPlatform}),r==="pricingModal"&&s&&l.jsx(G2e,{isOpen:r==="pricingModal",pitchMessage:s?.pitchMessage,closeModal:t,origin:s.origin,showFreeTier:s.showFreeTier,defaultSegment:s.defaultSegment,segments:s.segments}),r==="collectionSelectModal"&&u?.entryUUID&&l.jsx(U2e,{isOpen:r==="collectionSelectModal",currentCollection:u.currentCollection,entryUUID:u.entryUUID,searchTerm:u.searchTerm,frontendContextUUID:u.frontendContextUUID,closeModal:t}),r==="spaceSettings"&&l.jsx(Y2e,{isOpen:r==="spaceSettings",existingSpace:f?.existingSpace,closeModal:t}),r==="spaceUploadFilesModal"&&b&&l.jsx(F2e,{...b,connectionTypes:gye(["LOCAL"]),isOpen:r==="spaceUploadFilesModal",closeModal:t}),r==="spaceContextModal"&&l.jsx(Cxe,{isOpen:r==="spaceContextModal",closeModal:t,collectionSlug:_?.collectionSlug}),r==="requestAccessModal"&&c?.uuidOrSlug&&l.jsx(wxe,{isOpen:r==="requestAccessModal",onClose:t,uuidOrSlug:c.uuidOrSlug}),r==="mapModal"&&l.jsx(Ar,{fallback:YH,children:l.jsx($2e,{isOpen:r==="mapModal",closeModal:t,locations:h&&h.locations,header:h.header,entryUUID:h.entryUUID,searchByLocationOverride:h?.searchByLocationOverride})}),r==="companyDataPrivacyModal"&&l.jsx(W2e,{organizationName:m.organizationName,isOpen:r==="companyDataPrivacyModal",closeModal:t,onContinue:m.onContinue}),r==="checkSourcesModal"&&p&&l.jsx(Txe,{isOpen:r==="checkSourcesModal",onClose:t,entryUUID:p.entryUUID,frontendContextUUID:p.frontendContextUUID,contextUUID:p.contextUUID,webResults:p.webResults,extendedBeforeContext:p.extendedBeforeContext,beforeContext:p.beforeContext,selectedText:p.selectedText,afterContext:p.afterContext,state:p?.state}),r==="onboardingModal"&&l.jsx(V2e,{isOpen:r==="onboardingModal",closeModal:t}),r==="lossAversionModal"&&v&&l.jsx(z2e,{isOpen:r==="lossAversionModal",onClose:()=>{t(),v.callback?.()},origin:v.origin}),r==="shoppingOnboardingModal"&&y&&l.jsx(q2e,{isOpen:r==="shoppingOnboardingModal",onClose:t,onContinue:y.onContinue,flowType:y.flowType}),r==="shoppingOrderDetailsModal"&&l.jsx(K2e,{isOpen:r==="shoppingOrderDetailsModal",onClose:t,item:x?.item,userIntercomHash:x?.userIntercomHash}),r==="purchaseConfirmationModal"&&g&&l.jsx(H2e,{isOpen:r==="purchaseConfirmationModal",onClose:t,order:g.order}),r==="watchlistModal"&&S&&l.jsx(Oxe,{isOpen:r==="watchlistModal",onClose:t,watchlistType:S.watchlistType,origin:S.origin}),r==="locationPermissionModal"&&w&&l.jsx(L2e,{isOpen:r==="locationPermissionModal",onClose:t,onPermissionGranted:w.onPermissionGranted??Ro,origin:w.origin}),r==="deleteMemoryModal"&&l.jsx(Ixe,{isOpen:r==="deleteMemoryModal",onClose:t,memoryId:C?.memoryId,onDeleteSuccess:C?.onDeleteSuccess}),r==="deleteAllMemoriesModal"&&l.jsx(jxe,{isOpen:r==="deleteAllMemoriesModal",onClose:t}),r==="hotelRoomDetailsModal"&&N&&l.jsx(Z2e,{isOpen:r==="hotelRoomDetailsModal",onClose:t,...N}),r==="memoryListModal"&&l.jsx(Q2e,{isOpen:r==="memoryListModal",onClose:t,isMemoryEnabled:k?.isMemoryEnabled??!1}),r==="memoryDetailModal"&&E&&l.jsx(X2e,{isOpen:r==="memoryDetailModal",onClose:t,memoryKey:E.memoryKey,displayValue:E.displayValue}),r==="thirdPartyPersonalizationModal"&&De&&l.jsx(Pxe,{isOpen:r==="thirdPartyPersonalizationModal",onClose:t,...De}),r==="proSubscriptionPaymentModal"&&I&&l.jsx(J2e,{isOpen:r==="proSubscriptionPaymentModal",onClose:t,...I}),r==="proMessageModal"&&M&&l.jsx(nxe,{isOpen:r==="proMessageModal",onClose:t,...M}),r==="memorySearchHistoryModal"&&l.jsx(Axe,{isOpen:r==="memorySearchHistoryModal",onClose:t,snippet:A?.snippet??"",type:A?.type??"memory",url:A?.url??"",memoryKey:A?.memoryKey,entryUuid:A?.entryUuid,title:A?.title,timestamp:A?.timestamp}),r==="gmailFailedPermissionsModal"&&D&&l.jsx(Nxe,{isOpen:r==="gmailFailedPermissionsModal",onContinue:D.onContinue??Ro,onClose:t}),r==="emailAssistantDisconnectWarningModal"&&P&&l.jsx(Rxe,{isOpen:r==="emailAssistantDisconnectWarningModal",connectorName:P.connectorName,onContinue:P.onContinue,onClose:t}),r==="calendarSelectionModal"&&F&&l.jsx(Dxe,{isOpen:r==="calendarSelectionModal",connectorType:F.connectorType,onClose:t}),r==="subSuccessModal"&&R&&l.jsx(rxe,{isOpen:r==="subSuccessModal",onClose:t,flowType:R.flowType,upgradeMax:R.upgradeMax,subscriptionTier:R.subscriptionTier,confirmationRedirectsToHomepage:R.confirmationRedirectsToHomepage}),r==="referralErrorModal"&&l.jsx(sxe,{isOpen:r==="referralErrorModal",onClose:t}),r==="referralSuccessModal"&&Y&&l.jsx(oxe,{isOpen:r==="referralSuccessModal",onClose:t,monthsAwarded:Y.monthsAwarded}),r==="incentiveProModal"&&l.jsx(axe,{isOpen:r==="incentiveProModal",onClose:t,...j}),r==="braintreeSubscriptionModal"&&X&&l.jsx(cxe,{isOpen:r==="braintreeSubscriptionModal",onClose:t,origin:X.origin}),r==="sheerIdRedirectModal"&&U&&l.jsx(dxe,{isOpen:r==="sheerIdRedirectModal",onContinue:()=>{t(),Do(U.sheerIdUrl,"sheerIdRedirectModal")},onCancel:t}),r==="upgradeModal"&&l.jsx(Bxe,{isOpen:r==="upgradeModal",onClose:t}),r==="downgradeModal"&&l.jsx(Fxe,{isOpen:r==="downgradeModal",onClose:t}),r==="restaurantBookingModal"&&L&&l.jsx(uxe,{isOpen:r==="restaurantBookingModal",onClose:t,...L}),r==="enterprisePremiumSecureUpgradeModal"&&l.jsx(fxe,{isOpen:r==="enterprisePremiumSecureUpgradeModal",onClose:t,onUpgradeSuccess:O?.onUpgradeSuccess}),r==="taskShortcutModal"&&$&&l.jsx(mxe,{open:r==="taskShortcutModal",onClose:()=>{t(),$.onClose?.()},onCreated:$.onCreated,source:$.source,shortcut:$.shortcut}),r==="financeAlertModal"&&G&&l.jsx(gxe,{isOpen:r==="financeAlertModal",onClose:()=>{t(),G.onClose?.()},symbol:G.symbol,task:G.task}),r==="scheduledTaskModal"&&H&&l.jsx($c,{children:l.jsx(pxe,{open:r==="scheduledTaskModal",onClose:()=>{t(),H.onClose?.()},onSuccess:H.onSuccess,source:H.source,initial:H.initial,prefill:H.prefill})}),r==="automationModal"&&Q&&l.jsx($c,{children:l.jsx(hxe,{open:r==="automationModal",onClose:()=>{t(),Q.onClose?.()},source:Q.source,initialConfiguration:Q.initial?mye({selectedTask:Q.initial}):Q.prefill?fye(Q.prefill):Q.initialConfiguration||x4(n),onSave:$e=>{Q.onSuccess?.($e),t(),Q.onClose?.()},errorMessage:Q.errorMessage,trackEvent:we,canEditSpace:Q.canEditSpace,canDelete:Q.canDelete})}),r==="sharepointSiteModal"&&te&&l.jsx(yxe,{isOpen:r==="sharepointSiteModal",onClose:t,onSelectSite:te.onSelectSite}),r==="avatarManagementModal"&&se&&l.jsx(Lxe,{isOpen:r==="avatarManagementModal",onClose:t,config:se??{source:"settings"}}),r==="shoppingTryOnOnboardingModal"&&l.jsx(Mxe,{isOpen:r==="shoppingTryOnOnboardingModal",onClose:ae?.onClose||t,onSuccessfulOnboarding:ae?.onSuccessfulOnboarding||(()=>{})}),r==="announcementImageModal"&&ee&&l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,isPartnershipCampaign:!0,children:l.jsx(Exe,{onClose:t,announcementImageModal:ee})}),r==="fullscreenUpsellModal"&&le&&l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,isPartnershipCampaign:!0,children:l.jsx(kxe,{onClose:t,fullscreenUpsellModal:le})}),r==="studentReferrals"&&l.jsx(ixe,{isOpen:r==="studentReferrals",verificationId:re?.verificationId}),r==="sheerIdModal"&&l.jsx(lxe,{isOpen:r==="sheerIdModal",onClose:()=>{ce?.onClose?.(),t()},onVerificationSuccess:$e=>{ce?.onSuccess?.($e),t()},type:ce?.type||"student"}),r==="meetingDefaultsModal"&&l.jsx(exe,{currentDuration:ue?.currentDuration,currentBuffer:ue?.currentBuffer,onSave:ue?.onSave}),r==="availabilityModal"&&l.jsx(txe,{currentAvailability:pe?.currentAvailability,onSave:pe?.onSave}),r==="mcpServerModal"&&xe&&l.jsx(xxe,{isOpen:r==="mcpServerModal",onClose:t,server:xe.server,onSave:xe.onSave,onDelete:xe.onDelete}),r==="mcpServiceToolsModal"&&he&&l.jsx(bxe,{isOpen:r==="mcpServiceToolsModal",onClose:t,server:he.server,onEditServer:he.onEditServer,onToggleToolEnabled:he.onToggleToolEnabled}),r==="memberSetTierModal"&&_e&&l.jsx(vxe,{isOpen:r==="memberSetTierModal",..._e,onClose:()=>{t(),_e.onClose?.()}}),r==="placeModal"&&ke&&l.jsx(_xe,{isOpen:r==="placeModal",onClose:t,place:ke.place,mode:ke.mode,entryUUID:ke.entryUUID,contextUUID:ke.contextUUID}),r==="orgInviteModal"&&Ce&&(Ce.invitationUUID?l.jsx(XR,{invitationUUID:Ce.invitationUUID,isNewUser:Ce.isNewUser,onClose:t}):l.jsx(XR,{openInviteLinkUUID:Ce.openInviteLinkUUID,isNewUser:Ce.isNewUser,onClose:t}))]})});ZH.displayName="SingleModal";function Vt(){const{status:e}=je(),t=e==="authenticated";return d.useEffect(()=>{t&&Gfe()},[t]),t}const JH=()=>{const e=d.useCallback(r=>{i2e(r)},[]),t=hr(d3),n=d.useCallback(()=>Qp(d3),[]);return d.useMemo(()=>({lossAversionStatus:t,setLossAversionStatus:e,unsetLossAversion:n}),[t,e,n])},Vxe=()=>{const{lossAversionStatus:e,setLossAversionStatus:t}=JH(),n=Ln(),r=Vt(),s=d.useMemo(()=>!r&&e==="allowed"&&n?.startsWith("/search"),[r,e,n]),{openModal:o}=gn().legacy,a=d.useCallback(({args:i,openModalOverride:c})=>{c?c("lossAversionModal",i):o("lossAversionModal",i),t("cooldown")},[o,t]);return d.useMemo(()=>({shouldShowLossAversionModal:s,handleOpenLossAversion:a}),[s,a])},Hxe=Se(async()=>{const{KeyboardShortcutHelperModal:e}=await Ee(()=>q(()=>import("./KeyboardShortcutHelperModal-DLqN6rlz.js"),__vite__mapDeps([122,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),zxe=Se(async()=>{const{KeyboardShortcutEditorModal:e}=await Ee(()=>q(()=>import("./KeyboardShortcutEditorModal-DXad0cI3.js"),__vite__mapDeps([123,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Wxe=({children:e})=>{const[t,n]=d.useState([]),r=d.useMemo(()=>t.at(-1)?.modalName??null,[t]),{session:s}=je(),{trackEvent:o}=Ke(s),{device:{isMacOS:a,isWindowsApp:i}}=on(),{shouldShowLossAversionModal:c,handleOpenLossAversion:u}=Vxe(),f=Dn(),{openModal:m}=Ho(),p=d.useCallback((b,_)=>{n(()=>[{modalName:b,arg:_}])},[]),h=d.useCallback((b,_)=>{n(w=>[...w,{modalName:b,arg:_}])},[]),g=d.useCallback((b,_)=>{n(w=>{const S=w.findLastIndex(C=>C.modalName==b);if(S!=-1){const C=w.slice();return C[S]={modalName:b,arg:_},C}else return w})},[]),y=d.useCallback(()=>{n(b=>b.slice(0,b.length-1))},[]),x=d.useMemo(()=>({currentOpenModals:t,currentOpenedModal:r,openModal:p,openStackedModal:h,updateModal:g,closeModal:y}),[t,p,h,g,y,r]),v=d.useCallback(b=>{if(a?b.metaKey&&b.key==="k":b.ctrlKey&&b.key==="i")b.preventDefault(),c?u({args:{origin:lt.NEW_THREAD_SHORTCUT,callback:()=>{o("quick ask keyboard shortcut",{}),f.push("/",void 0,"Quick ask keyboard shortcut (loss aversion)")}},openModalOverride:p}):(o("quick ask keyboard shortcut",{}),f.push("/",void 0,"Quick ask keyboard shortcut"));else if(a?b.metaKey&&b.key==="/":b.ctrlKey&&b.key==="/")b.preventDefault(),i?m(zxe,{legacyIdentifier:"keyboardShortcutEditorModal"}):m(Hxe,{legacyIdentifier:"keyboardShortcutHelperModal"});else if(i&&b.ctrlKey&&b.key==="d"){b.preventDefault();const _=new CustomEvent("toggleDictation");document.dispatchEvent(_)}},[a,i,c,u,p,m,o,f]);return d.useEffect(()=>(document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}),[v]),l.jsxs(qH.Provider,{value:x,children:[e,l.jsx(QH,{})]})};function Gxe(){return null}async function $xe(){"serviceWorker"in navigator&&await navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister())))}const ez=T.memo(function(){return d.useEffect(()=>{{$xe();return}},[]),null});ez.displayName="ServiceWorker";const qxe=async({file:e,fileSource:t="default",forceImage:n=!1,reason:r})=>{const s=await de.POST("/rest/uploads/create_upload_url",r,{body:{filename:e.name,content_type:e.type,source:t,file_size:e.size,force_image:n},timeoutMs:Sn.MEDIUM,retries:2});return s.data?s.data:null},Kxe=async({filesWithUuids:e,fileSource:t="default",forceImage:n=!1,reason:r})=>{const s={};e.forEach(({uuid:a,file:i})=>{s[a]={filename:i.name,content_type:i.type,source:t,file_size:i.size,force_image:n}});const o=await de.POST("/rest/uploads/batch_create_upload_urls",r,{body:{files:s},timeoutMs:Sn.MEDIUM,retries:2});return o.data?o.data.results:null},Yxe=async({remote_file_id:e,connection_type:t,source:n,reason:r})=>{const s=await de.POST("/rest/connectors/attachments/upload",r,{body:{remote_file_id:e,connection_type:t,source:n??"default"},timeoutMs:Sn.VERY_HIGH,retries:2});return s.data?s.data:null};async function Qxe({request:e,reason:t}){return new Promise((n,r)=>{de.SSE("/rest/sse/attachment_processing/subscribe",t,{params:e,handlers:{message:s=>{n(s)}}}).catch(r)})}const Jo=e=>{try{return JSON.parse(e)}catch{return{}}};function Xxe({reason:e}){const t=Nn(),n=ln(),r=d.useCallback(async(s,o,a)=>{if(Z.info("browserStep",s),s.browser_open_tab_content){const i=s.browser_open_tab_content,c=Jo(i.extra_headers);Z.info("browserTool: browser_open_tab",{tool:i},{request_id:c[xn]}),await Ehe({url:i.url,cometBrowser:n,stepUuid:s.uuid,extraHeaders:Jo(i.extra_headers),reason:e})}else if(s.search_browser_content){const i=s.search_browser_content,c=Jo(i.extra_headers);Z.info("browserTool: search_browser",{tool:i},{request_id:c[xn]}),await The(i,n,s.uuid,c,e)}else if(s.browser_close_tabs_content){const i=s.browser_close_tabs_content,c=i.payload;if(!c){Z.error("[useExecuteBrowserTool] browser_close_tabs_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const u=Jo(i.extra_headers);Z.info("browserTool: browser_close_tabs",{tool:i},{request_id:u[xn]}),await Mhe(c,n,s.uuid,u,e)}else if(s.browser_group_tabs_content){const i=s.browser_group_tabs_content,c=i.payloads,u=Jo(i.extra_headers);Z.info("browserTool: browser_group_tabs",{tool:i},{request_id:u[xn]}),await khe(c,n,s.uuid,u,e)}else if(s.entropy_request_content){const i=s.entropy_request_content,c=i.extra_headers,u=Jo(c)[xn];Z.info("browserTool: entropy_request",{tool:i},{request_id:u}),i.tasks.forEach(f=>{Z.info("[comet] Submitting agent task",{task_id:f.uuid,entry_uuid:o,request_id:u}),n.submitTask({action:"startAgentFromPerplexity",type:"START_AGENT",extra_headers:c,base_url:i.base_url,entryId:o,...f,use_current_page:f.use_current_page&&!0,capture_screenshot:!f.use_current_page&&!f.tab_id,is_mission_control:window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants")||i.is_mission_control,thread_url_slug:a})})}else if(s.get_url_content_content){const i=s.get_url_content_content,c=Jo(i.extra_headers);if(Z.info("browserTool: get_url_content",{tool:i},{request_id:c[xn]}),!t)return;const u={...i,key:s.uuid,request_id:c[xn],pages:[...i.pages||[]]},f=n.GetContent(u);await Ti(f,s.uuid,{request_id:c[xn]??""},e)}else if(s.browser_ungroup_content){const i=s.browser_ungroup_content;if(!i.payload){Z.error("[useExecuteBrowserTool] browser_ungroup_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const c={groupIds:i.payload.group_ids,tabIds:i.payload.tab_ids},u=Jo(i.extra_headers),f=n.ungroupTabs(c,s.uuid,u[xn]??"").then(m=>{if(!m.is_success)throw m;return{group_ids:m.groupIds,tab_ids:m.tabIds}});await Ti(f,s.uuid,{request_id:u[xn]??""},e)}else if(s.browser_search_tab_groups_content){const i=s.browser_search_tab_groups_content,c=i.payload;if(!c){Z.error("[useExecuteBrowserTool] browser_search_tab_groups_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const u=Jo(i.extra_headers),f=n.searchTabGroups(c,s.uuid,u[xn]??"").then(m=>{if(!m.is_success)throw m;return{results:m.results.map(p=>({...p,color:pV(p.color)}))}});await Ti(f,s.uuid,{request_id:u[xn]??""},e)}else if(s.browser_get_visible_tab_screenshot_content){const i=s.browser_get_visible_tab_screenshot_content,c=Jo(i.extra_headers),u=n.GetVisibleTabScreenshot({key:s.uuid,request_id:c[xn]??"",...i}).then(async f=>{const p=await(await fetch(f.data_url)).blob(),h=new File([p],"screenshot."+(i.format??"png"),{type:p.type}),g=await qxe({file:h,forceImage:!0,reason:e,fileSource:"entropy"});if(!g||!g?.fields||!g.s3_bucket_url)throw new Error("Failed to create upload URL");const y=new FormData;Object.entries(g.fields).forEach(([b,_])=>{y.append(b,_)}),y.append("file",h);const x=await fetch(g.s3_bucket_url,{method:"POST",body:y});if(!x.ok)throw new Error(`Failed to upload screenshot: ${x.statusText}`);const v=await x.json();if(!v.secure_url)throw Z.error("[GetVisibleTabScreenshot] Upload did not return a secure URL",{response:v}),new Error("Upload did not return a secure URL");return{screenshot_url:v.secure_url}});await Ti(u,s.uuid,{request_id:c[xn]??""},e)}else if(s.browser_get_cookies_content){const i=s.browser_get_cookies_content,c=Jo(i.extra_headers);Z.info("browserTool: browser_get_cookies",{tool:i},{request_id:c[xn]}),await Ti(n.getCookies(),s.uuid,{request_id:c[xn]??""},e)}else Z.error("[useExecuteBrowserTool] Unknown browser tool step",{browserStep:s},{reason:e,backend_uuid:o})},[n,t,e]);return d.useMemo(()=>({executeBrowserTool:r}),[r])}const Zxe={SSE:(...e)=>Ome(...e)};var Xy;(function(e){e[e.NONE=0]="NONE",e[e.READER=1]="READER",e[e.WRITER=2]="WRITER",e[e.EDITOR=5]="EDITOR",e[e.ADMIN=3]="ADMIN",e[e.OWNER=4]="OWNER",e[e.OWNER_DEFAULT_BOOKMARKS=6]="OWNER_DEFAULT_BOOKMARKS",e[e.INVITED_READER=11]="INVITED_READER",e[e.INVITED_WRITER=12]="INVITED_WRITER",e[e.INVITED_EDITOR=15]="INVITED_EDITOR",e[e.INVITED_ADMIN=13]="INVITED_ADMIN"})(Xy||(Xy={}));function Jxe(e){return e>=Xy.WRITER&&e{const E=e.trim(),N=JSON.stringify([{step_type:"INITIAL_QUERY",content:{query:""},uuid:""}]),k=t?{title:c?.article_info?.title??b,url_slug:(c&&"thread_url_slug"in c?c.thread_url_slug:void 0)??_,mode:((c&&"mode"in c?c.mode:void 0)??p)?.toUpperCase()}:void 0,I=s&&Jxe(s.user_permission)?s:void 0;return{parent_info:void 0,plan:void 0,summary:void 0,form:void 0,reasoning_plan:void 0,status:"PENDING",reconnectable:!0,final:!1,query_str:E,query_source:S,backend_uuid:g?"":n??"",bookmark_state:s?"BOOKMARKED":"NOT_BOOKMARKED",context_uuid:"",frontend_context_uuid:i??a??"",uuid:r??v,frontend_uuid:r??v,...t?{parent_info:k}:{},author_username:void 0,author_image:void 0,search_focus:y.length===0?"writing":"internet",search_recency_filter:x??void 0,sources:{sources:y},num_sources_display:void 0,personalized:h,attachments:m,blocks:[],social_info:{like_count:0,view_count:0,fork_count:0,user_likes:!1},mode:"COPILOT",text:N??void 0,collection_info:I,is_related_query_result:o??!1,related_queries:[],media_items:[],widget_data:[],widget_intents:[],knowledge_cards:[],related_query_items:[],sources_list:[],answer_modes:[],is_nav_suggestions_disabled:u,structured_answer_block_usages:[],display_model:w,model_preference:w,side_by_side_metadata:C}},nz="DEFAULT_SEARCH_PLACEHOLDER",tve=(e={})=>{const t=e.uuid??e.frontend_uuid??crypto.randomUUID();return{status:"PENDING",parent_info:void 0,query_str:"",backend_uuid:nz,author_username:void 0,author_image:void 0,search_focus:"internet",display_model:"turbo",personalized:!1,attachments:[],social_info:{like_count:0,view_count:0,fork_count:0,user_likes:!1},text:void 0,collection_info:void 0,image_completions:[],is_related_query_result:!1,final:!1,sources:{sources:["web"]},should_index:!1,updated_datetime:new Date().toISOString(),thread_access:0,thread_url_slug:"",expiry_time:void 0,privacy_state:void 0,context_uuid:"",related_queries:[],media_items:[],widget_data:[],blocks:[],message_mode:"MESSAGE_MODE_UNSPECIFIED",widget_intents:[],knowledge_cards:[],plan:void 0,reasoning_plan:void 0,summary:void 0,form:void 0,sources_list:[],related_query_items:[],answer_modes:[],structured_answer_block_usages:[],...e,frontend_context_uuid:e.frontend_context_uuid??crypto.randomUUID(),frontend_uuid:t,uuid:t,attachment_processing_progress:[]}};var nve=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)s.hasOwnProperty(o)&&(r[o]=s[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),rve=Object.prototype.hasOwnProperty;function h3(e,t){return rve.call(e,t)}function g3(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function vc(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function rz(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function x3(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&c[f-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&p===void 0&&(u[h]===void 0?p=c.slice(0,f).join("/"):f==m-1&&(p=t.path),p!==void 0&&g(t,0,e,p)),f++,Array.isArray(u)){if(h==="-")h=u.length;else{if(n&&!y3(h))throw new ar("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);y3(h)&&(h=~~h)}if(f>=m){if(n&&t.op==="add"&&h>u.length)throw new ar("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var a=ove[t.op].call(t,u,h,e);if(a.test===!1)throw new ar("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(f>=m){var a=id[t.op].call(t,u,h,e);if(a.test===!1)throw new ar("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[h],n&&f0)throw new ar('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ar("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ar("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&x3(e.value))throw new ar("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var s=e.path.split("/").length,o=r.split("/").length;if(s!==o+1&&s!==o)throw new ar("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new ar("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},i=oz([a],n);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new ar("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ar("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function oz(e,t,n){try{if(!Array.isArray(e))throw new ar("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Bx(oo(t),oo(e),n||!0);else{n=n||Jy;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function I4(e,t,n,r,s){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=g3(t),a=g3(e),i=!1,c=a.length-1;c>=0;c--){var u=a[c],f=e[u];if(h3(t,u)&&!(t[u]===void 0&&f!==void 0&&Array.isArray(t)===!1)){var m=t[u];typeof f=="object"&&f!=null&&typeof m=="object"&&m!=null&&Array.isArray(f)===Array.isArray(m)?I4(f,m,n,r+"/"+vc(u),s):f!==m&&(s&&n.push({op:"test",path:r+"/"+vc(u),value:oo(f)}),n.push({op:"replace",path:r+"/"+vc(u),value:oo(m)}))}else Array.isArray(e)===Array.isArray(t)?(s&&n.push({op:"test",path:r+"/"+vc(u),value:oo(f)}),n.push({op:"remove",path:r+"/"+vc(u)}),i=!0):(s&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!i&&o.length==a.length))for(var c=0;c[r.intended_usage,r]));for(const r of t)if(r.diff_block){const s=r.diff_block.field,o=n.get(r.intended_usage)?.[s]??PU,a=r.diff_block.patches??Ie,i=Bx(o,a,!1,!1).newDocument;n.set(r.intended_usage,{intended_usage:r.intended_usage,[s]:i})}else n.set(r.intended_usage,r);return Array.from(n.values())}class Fl extends NU{name="PplxStreamError"}const sr=eH();function xve(e,t,n){return e.reduce((r,s)=>s(r,n),t)}const vve=(e,t)=>e&&_me(e,n=>n!=null);function ry(e){return e?!e.resume_entry_uuid:!1}function bve(e,t){const n={minuteCount:0,hourCount:0,minuteWindow:Math.floor(Date.now()/6e4),hourWindow:Math.floor(Date.now()/36e5)};return async(...r)=>{const s=Date.now(),o=Math.floor(s/(60*1e3)),a=Math.floor(s/(3600*1e3));return o!==n.minuteWindow&&(n.minuteCount=0,n.minuteWindow=o),a!==n.hourWindow&&(n.hourCount=0,n.hourWindow=a),n.minuteCount>=t.perMinute?{allowed:!1}:n.hourCount>=t.perHour?{allowed:!1}:(n.minuteCount++,n.hourCount++,{allowed:!0,result:await e(...r)})}}function az(e,t,n){const r=[...e],s=r.findIndex(a=>a.id===t),o=r[s];if(o){if(o.entryIds.includes(n))return e;r[s]={...o,entryIds:[...o.entryIds,n]}}else r.push({id:t,entryIds:[n]});return r}const _ve="2.18",b3=Object.freeze([]),zd=new Map;function zi(e,t){return t?e.streams[t]:void 0}function P4(e,t){const n=Object.values(e.streams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.entryId===t&&e.activeStreams.includes(o.id.description))return o}}function iz(e,t){const n=Object.values(e.streams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.threadId===t&&e.activeStreams.includes(o.id.description))return o}}const lz=50,wve=100,JR=1e3;function D_(e,t,n){const r=zi(e,t);if(!r||!e.activeStreams.includes(t))return{newState:e};let s;if(r.threadId){const p=e.threads.find(h=>h.id===r.threadId)?.entryIds?.[0]??void 0;s=p?e.entries[p]?.thread_url_slug:void 0}const o=xve(e.middlewares,n,s);if(!o)return{newState:e};const a=o.context_uuid,i=o.backend_uuid,c=o.uuid,f=!!!(r.entryId&&r.isReconnect&&e.erroredStreams[r.entryId])&&(!r.threadId||!r.entryId);if(i===nz||i===tz)return{newState:{streams:{...e.streams,[t]:{...r,placeholderChunk:o}}}};if(o.status===Pr.PENDING&&o.blocks?.length===0||o.status===Pr.RESUMING)return{newState:{..._3(e,o,{isFirstMessage:f,placeholderChunk:r.placeholderChunk,streamId:r.id.description}),streams:{...e.streams,[t]:{...r,threadId:o.context_uuid,entryId:i,extraEntryId:c,placeholderChunk:o}}},status:o.status};if(!a||!i)return{newState:e};let m=r;f&&(m={...r,threadId:a,entryId:i,extraEntryId:c});try{return{newState:{..._3(e,o,{isFirstMessage:f,placeholderChunk:r.placeholderChunk,streamId:r.id.description}),streams:{...e.streams,[t]:m}},status:o.status}}catch(p){return r?.abortController?.abort("Failed to ingest message"),{newState:cz(e,t,new Fl("STREAM_FAILED_INGEST_ERROR",{cause:p,details:{request_id:t,backend_uuid:r?.entryId??"unknown"}})),status:Pr.FAILED}}}function _3(e,t,{isFirstMessage:n,placeholderChunk:r,streamId:s}){const o=t.context_uuid,a=t.backend_uuid;let i=Array.from(e.threads);const c={...e.entries};if(i.length>=wve){const f=i[0];if(i=i.slice(1),f)for(const m of f.entryIds)delete c[m]}if(i=az(i,o,a),t.status===Pr.COMPLETED)c[a]=t;else if(t.blocks){let f=c[a];f&&f.uuid!==t.uuid?f=r:f||(f=r);const m=f?.frontend_context_uuid??t.frontend_context_uuid??s,p=f?.frontend_uuid??t.frontend_uuid??s,h=f?.query_str??t.query_str,g=f?.connector_auth_info!=null&&!("connector_auth_info"in t)&&!n,y={...f??{},...t,frontend_context_uuid:m,frontend_uuid:p,query_str:h,...g&&{connector_auth_info:void 0},blocks:yve(n?b3:f?.blocks??b3,t.blocks)};c[a]=y}const u=zd.get(a);return zd.set(a,{start:u?.start??Date.now(),latest:Date.now(),attempts:u?.attempts??1}),{threads:i,entries:c}}function cz(e,t,n){Z.error("Error in reading stream",n);const r=zi(e,t);if(!r)return e;const s=r?.entryId;if(!s)return e;const o={...e.entries[s],status:Pr.FAILED},{promise:a,abortController:i,...c}=r;return{activeStreams:e.activeStreams.filter(u=>u!==t),erroredStreams:{...e.erroredStreams,[s]:{...c,code:n instanceof OU?n.code:void 0}},entries:{...e.entries,[s]:o}}}const e9=Object.freeze([vve]);function og(e,t){return(e.threads.find(r=>r.id===t.threadId)?.entryIds.map(r=>e.entries[r])??b3).filter(r=>r!=null)}function Cve(e,t){const n=zi(e,t);n&&(zd.delete(n.entryId??""),sr.emit("completed",{stream:n,thread:og(e,n),message:n.entryId?e.entries[n.entryId]:void 0}))}function Sve(e,t,n,r){const s=zi(e,t);s&&sr.emit("progress",{stream:s,thread:og(e,s),message:e.entries[n.backend_uuid]??n,isFirstMessage:r})}function Eve(e,t,n){const r=zi(e,t);r&&sr.emit("error",{stream:r,thread:og(e,r),message:r.entryId?e.entries[r.entryId]:void 0,error:n,messageStreamMeta:zd.get(r.entryId??"")})}function kve(e,t,n,r){const s=zi(e,t);s&&sr.emit("created",{stream:s,thread:og(e,s),message:s.entryId?e.entries[s.entryId]:void 0,query:n,params:r})}function Mve(e,t){const n=zi(e,t);n&&sr.emit("aborted",{stream:n,thread:og(e,n),message:n.entryId?e.entries[n.entryId]:void 0})}const Tve=(e,t)=>({threads:[],entries:{},activeStreams:[],erroredStreams:{},middlewares:e9,streams:{},actions:{getEntryById:n=>t().entries[n],createStream:n=>t().actions.createBackwardsCompatibleStream(n,{reason:"create-stream",timer:Wa(void 0,{nowFromTimeOrigin:performance.now()})}).id,retryStream:n=>{const r=t().entries[n];if(!r)return!1;const s=t().erroredStreams[n];if(!s)return!1;const o=s.placeholderChunk?.query_str;if(!o)return!1;if(e(a=>{const{entries:i,threads:c}=a,{[n]:u,...f}=i,m=Array.from(c),p=c.findIndex(h=>h.entryIds.includes(n));return p===-1?a:(m.splice(p,1,{id:m[p].id,entryIds:m[p].entryIds}),{threads:m,entries:f})}),!ry(s.params))throw new Error("Stream params are not SubmitParams so cannot retry");return!!t().actions.createBackwardsCompatibleStream({query_str:o,params:{...s.params,existing_entry_uuid:n,query_source:"retry",frontend_context_uuid:r.frontend_context_uuid}},{placeholderChunk:s.placeholderChunk,timer:Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:"retry-stream"})},reconnectStream:n=>{const r=P4(t(),n);if(r&&r.promise&&r.abortController&&!r.abortController.signal.aborted)return r.id;const s=t().entries[n],o=s?.cursor,a=t().actions.createBackwardsCompatibleStream({query_str:"",params:{resume_entry_uuid:n,cursor:o}},{isReconnect:!0,timer:Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:"reconnect-stream"});e(c=>D_(c,a.id.description,{...s,status:Pr.PENDING}).newState,void 0,"ingestPlaceholderChunk");const i=zd.get(n);return zd.set(n,{start:i?.start??Date.now(),latest:i?.latest??Date.now(),attempts:(i?.attempts??0)+1}),a.id},createBackwardsCompatibleStream:(n,{isReconnect:r,placeholderChunk:s,onFirstMessageReceived:o,timer:a,reason:i})=>{const c=Array.from(t().activeStreams),u={...t().streams};if(c.length>=lz){const x=c.shift();try{x&&(u[x]?.abortController?.abort("Forced abort"),u[x]={...u[x],promise:null,abortController:null})}catch(v){Z.error("Failed to abort stream",new Fl("STREAM_FAILED_ABORT_ERROR",{cause:v,details:{request_id:x??"unknown",backend_uuid:"unknown"}}))}}const f=n.params?.frontend_uuid??crypto.randomUUID(),m=new AbortController,p={id:{description:f},promise:Promise.resolve(),abortController:m,isReconnect:r,entryId:n.params?.resume_entry_uuid,params:n.params,timer:a},h={message:async x=>{const v=zi(t(),f);if(v?.abortController?.signal.aborted)return;let b=!1;v?.threadId||(b=!0,o?.(x)),e(_=>{const{newState:w,status:S}=D_(_,f,x);if(S===Pr.FAILED&&v&&v.entryId){const{promise:C,abortController:E,...N}=v;return{...w,erroredStreams:{..._.erroredStreams,[v.entryId]:N}}}return w},void 0,"ingest"),v&&Sve(t(),f,x,b)}},g=n.params?.query_source==="default_search",y={[xn]:f};return Z.info("Starting stream",{request_id:f}),p.promise=(r?Zxe.SSE("/rest/sse/perplexity_ask/reconnect/{resume_entry_uuid}",i,{path:{resume_entry_uuid:n.params?.resume_entry_uuid??""},params:{cursor:n.params?.cursor},signal:m.signal,handlers:h,headers:y}):de.SSE("/rest/sse/perplexity_ask",i,{params:{...n,params:{...n.params,version:_ve}},signal:m.signal,handlers:h,metrics:{omnisearch:g},timer:a,headers:y})).then(()=>Cve(t(),f),x=>{const v=t(),b=zi(v,f);b&&(e(_=>cz(_,f,new Fl("STREAM_FAILED_STREAM_ERROR",{cause:x,details:{request_id:f,backend_uuid:b.entryId??"unknown"}})),void 0,"handleStreamError"),Eve(v,f,x))}).finally(()=>{e(({activeStreams:x,streams:v})=>({streams:{...v,[f]:{...v[f],promise:null,abortController:null}},activeStreams:x.filter(b=>b!==f)}),void 0,"cleanupBackwardsCompatibleStream")}),c.push(f),e({activeStreams:c,streams:{...u,[f]:p}},void 0,"createBackwardsCompatibleStream"),kve(t(),f,n.query_str,n.params),p.abortController?.signal.addEventListener("abort",()=>{Mve(t(),f)}),s&&e(x=>D_(x,f,s).newState,void 0,"ingestPlaceholderChunk"),p},setMiddlewares:n=>{e(()=>({middlewares:[...e9,...n]}))}}}),O4=Jh("StreamStateContext",()=>Xi()(wme(Tve))),ah=O4.useSelector,uz=O4.useStore,Ave=()=>{const e=uz(),t=d.useMemo(()=>bve(e.getState().actions.reconnectStream,{perMinute:20,perHour:120}),[e]);return d.useEffect(()=>{function n(){const a=e.getState(),i=new Set(a.activeStreams),c=new Set(Object.values(a.streams).filter(u=>i.has(u.id.description)).map(u=>u.entryId));Object.values(a.entries).forEach(u=>{const f=u.frontend_uuid?e.getState().streams[u.frontend_uuid]:void 0;f&&f.abortController?.signal.aborted||u?.reconnectable&&i.size{clearInterval(r),window.removeEventListener("online",s,!0),window.removeEventListener("offline",o,!0)}},[t,e]),null},dz=T.memo(({children:e})=>l.jsxs(O4.Provider,{children:[l.jsx(Ave,{}),e]}));dz.displayName="StreamStateProvider";const Nve=()=>ah(e=>e.actions.createBackwardsCompatibleStream),Rve=()=>ah(e=>e.actions.reconnectStream),Dve=()=>ah(e=>e.actions.retryStream),fz=e=>{const t=ah(s=>s.activeStreams),n=ah(s=>s.streams),r=Object.values(n).find(s=>s.id.description===e);return!!(r&&t.includes(r?.id.description))},zs=()=>uz(),jve=()=>{const e=zs();return d.useCallback((t,n)=>{t&&e.setState(r=>{const s=r.entries[t],o=P4(r,t);if(o&&o.promise&&o.abortController&&!o.abortController.signal.aborted&&Z.error("Attempting to mutate entries while stream is active"),!s||!n)return r;const a=n(s);return a?{...r,entries:{...r.entries,[t]:a}}:r},void 0,"mutateEntry")},[e])},Ive=()=>{const e=zs();return d.useCallback((t,n,{terminateStream:r=!0}={})=>{t&&e.setState(s=>{if(!t)return s;iz(s,t)&&r&&Z.error("Attempting to mutate entries while stream is active");const a=s.threads.findIndex(p=>p.id===t);if(a===-1)return s;const i=s.threads[a];if(!i)return s;const u=i.entryIds.map(p=>s.entries[p]).filter(p=>p!=null),f=n?.(u);if(!f)return s;const m=Array.from(s.threads);return m.splice(a,1,{...i,entryIds:f.map(p=>p.backend_uuid)}),{...s,entries:{...s.entries,...f.reduce((p,h)=>(p[h.backend_uuid]=h,p),{})},threads:m}},void 0,"mutateEntries")},[e])},Pve=()=>{const e=zs();return d.useCallback(t=>{t&&e.setState(n=>{const r=n.entries[t],s=P4(n,t);if(s&&s.promise&&s.abortController&&!s.abortController.signal.aborted&&s.abortController?.abort("Forced abort"),!r)return n;const o={...n.entries};delete o[t];const a=n.threads.map(i=>{const c=i.entryIds.indexOf(t);if(c===-1)return i;const u=[...i.entryIds];if(u.splice(c,1),!!u.length)return{...i,entryIds:u}}).filter(i=>!!i);return{...n,entries:o,threads:a}},void 0,"deleteEntry")},[e])},Ove=()=>{const e=zs();return d.useCallback(t=>{t&&e.setState(n=>{if(!t)return n;const r=iz(n,t);r&&r.abortController?.abort("Forced abort");const s=n.threads.findIndex(u=>u.id===t);if(s===-1)return n;const o=n.threads[s];if(!o)return n;const a=o.entryIds;let i;a.length?(i={...n.entries},a.forEach(u=>delete i[u])):i=n.entries;const c=n.threads.filter(u=>u.id!==t);return{...n,entries:i,threads:c}},void 0,"deleteEntries")},[e])};function Lve(e){const t=zs(),n=Object.values(t.getState().erroredStreams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.entryId===e)return o}}const mz=T.memo(({middlewares:e})=>{const t=zs();return d.useLayoutEffect(()=>{t.getState().actions.setMiddlewares(e)},[e,t]),null});mz.displayName="MiddlewareRegistry";function L4(){const e=zs();return d.useCallback(t=>e.getState().streams[t]?.timer,[e])}function Fve(){const e=zs();return d.useCallback(()=>e.getState().activeStreams.length>0,[e])}const pz=T.memo(function(){const{executeBrowserTool:t}=Xxe({reason:"StreamMiddlewares"}),n=d.useCallback((s,o)=>{if(!s||!s.browser_tool)return s;t(s.browser_tool,s.backend_uuid,o)},[t]),r=d.useMemo(()=>[n],[n]);return l.jsx(mz,{middlewares:r})});pz.displayName="StreamMiddlewares";const Bve=10,F4=Bve,hz=F4*10,Uve=hz*10+F4,Wd="all_results",Vve=({slugOrUUID:e,enabled:t,isSidecar:n,reason:r})=>{const s=Xt(),o=d.useCallback(async(a,i,c=[])=>{const u=await Zge({slugOrUUID:a,options:{withParentInfo:!0,supportedBlockUseCases:[...OV],limit:i?hz:F4,fromFirst:!0,cursor:i},numRetries:Kl,reason:r});if(!u?.entries?.length||u.status!=="success")return c;const f=be.makeQueryKey(Wd,a),m=u.entries;return c.push(...m),s.setQueryData(f,p=>{const h=new Map,g=y=>h.set(y.backend_uuid,y);return p?.forEach(g),m.forEach(g),Array.from(h.values())}),u.next_cursor&&c.length!!(i instanceof ye&&i.status===403&&n&&a<2),queryFn:async()=>await o(e,null,[])})},B4=()=>{const e=Xt();return d.useCallback((t,n)=>{!n&&!t||[be.makeQueryKey(Wd,t?.thread_url_slug||n?.at(0)?.thread_url_slug||""),be.makeQueryKey(Wd,t?.backend_uuid||n?.at(0)?.backend_uuid||"")].forEach(r=>{if(be.unmakeQueryKey(r).at(-1)){if(t){const s=e.getQueryData(r)??[],o=n?.some(i=>i.backend_uuid===t?.backend_uuid),a=s.findIndex(i=>i.backend_uuid===t?.backend_uuid);if(a!==-1){const i=[...s];i[a]=t,e.setQueryData(r,i);return}else if(o&&a===-1){const i=[...s,t];e.setQueryData(r,i);return}}if(n&&!t){const s=[...n];e.setQueryData(r,s);return}e.invalidateQueries({queryKey:r})}})},[e])},gz=()=>{const e=Xt();return d.useCallback(t=>{t?e.getQueriesData({queryKey:be.makeQueryKey(Wd),exact:!1})?.forEach(([n,r])=>{if(!r)return;const s=r.filter(o=>o.backend_uuid!==t&&o.thread_url_slug!==t);s.length!==r.length&&(s.length?e.setQueryData(n,s):e.removeQueries({queryKey:n,exact:!0}))}):e.removeQueries({queryKey:be.makeQueryKey(Wd),exact:!1})},[e])},yz=({windowsAppOnly:e=!0}={})=>{const[t,n]=d.useState(()=>globalThis.Notification?globalThis.Notification.permission:"denied"),{device:{isWindowsApp:r}}=on();d.useEffect(()=>{globalThis.Notification&&globalThis.Notification.permission!==t&&n(globalThis.Notification.permission)},[t]);const s=d.useCallback(async()=>{if(globalThis.Notification){if(t==="granted")return!0;if(t==="denied")return!1;const a=await globalThis.Notification.requestPermission();return n(a),a==="granted"}return!1},[t]),o=d.useCallback(async({title:a,body:i,icon:c="https://r2cdn.perplexity.ai/pplx-desktop-icon.png",onClick:u})=>{if(!(e&&!r||!await s())&&globalThis.Notification){const m=new globalThis.Notification(a,{body:i,icon:c});u&&(m.onclick=()=>{u(),window.focus()})}},[e,r,s]);return d.useMemo(()=>({sendNotification:o,requestPermission:s,permission:t,isWindowsApp:r}),[r,t,s,o])};function Hve(){const e=Xt();return d.useCallback(()=>{e.invalidateQueries({queryKey:Qy()})},[e])}const zve=(e,t)=>{const{value:n,loading:r}=Tf({flag:"sapi-ranking-navigate",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Wve=async({query:e,userIdentity:t,queryClient:n,reason:r,sapiSearchNavigateConfig:s})=>{try{const o=s?[`sapi-ranking-navigate-cfg=${JSON.stringify(s)}`]:[],c=(await(await $fe({resource:"https://suggest.perplexity.ai/search/v2/navigate",method:"POST",options:{headers:{"content-type":"application/json","X-Client-Name":"agi_ui_navigate_v2","X-Client-Env":"production"}},body:JSON.stringify({query:e,user_identity:{lang:t.lang,country:t.country,ab_active_tests:o}}),timeoutMs:1e3,reason:r})).json())?.hit;c&&n.setQueryData(RH(e),c)}catch(o){Z.error("Failed to fetch navigational search results:",o)}},Gve=35,$ve=()=>{const e=Xt(),t=Ix(),{variation:n,loading:r}=zve({});return d.useCallback(({query:s,params:o,reason:a})=>{const i=s.length<=Gve,c=!!o.last_backend_uuid,u=o.attachments,f=o.sources,m=o.model_preference==="pplx_study";if(i&&!c&&u.length===0&&f&&f.length>0&&!m){const h={lang:o.language,country:t};Wve({query:s,userIdentity:h,queryClient:e,reason:a,sapiSearchNavigateConfig:r?void 0:n})}},[e,t,n,r])};var Rs;(function(e){e.EXPOSURE="sbs exposure",e.JUDGMENT="sbs judgment",e.BANNER="sbs banner"})(Rs||(Rs={}));const e2=-1,qve="sbs_analytics_",Kve=e=>{const t=e?.experiment_override;return t?JSON.stringify(t):""},Yve=(e,t)=>{const n=e.side_by_side_metadata;return{displayPosition:t,experimentRole:n?.experiment_role||`entry_${t}`,entryUUID:e.backend_uuid,experimentOverride:Kve(n)}},xz=(e,t)=>`${qve}${e}_${t}`,j_=(e,t)=>{try{const n=xz(e,t);return wt.getItem(n)==="true"}catch(n){return Z.error("Error checking localStorage for SBS event:",n),!1}},I_=(e,t)=>{try{const n=xz(e,t);wt.setItem(n,"true")}catch(n){Z.error("Error setting localStorage for SBS event:",n)}},Qve=({results:e,session:t,trackEvent:n})=>{const r=d.useCallback(()=>{if(!e[0])return null;const c=e[0].side_by_side_metadata;if(!c?.sibling_uuid)return null;const u=c.experiment_override,f=u&&Object.keys(u)[0]||"";return{evaluationUUID:c.sibling_uuid,experimentVariationKey:f,evaluatorID:t?.user?.id||t?.user?.email||"anonymous"}},[e,t?.user?.id,t?.user?.email]),s=d.useCallback(c=>{try{const u=r();if(!u)return null;let f,m;if(c===e2)f=e2,m=void 0;else if(f=c,f>=0&&f{h.backend_uuid&&h.side_by_side_metadata?.execution_log&&(p[h.backend_uuid]=h.side_by_side_metadata.execution_log)}),{eventType:Rs.JUDGMENT,timestampMs:Date.now(),eventData:{evaluationUUID:u.evaluationUUID,evaluatorID:u.evaluatorID,experimentVariationKey:u.experimentVariationKey,experimentRoles:e.map(h=>h.side_by_side_metadata?.experiment_role||`entry_${e.indexOf(h)}`),preferredPosition:f,entryUUID:m,executionLogs:p}}}catch(u){return Z.error("Failed to build SBS judgment payload:",u),null}},[r,e]),o=d.useCallback(c=>{try{const u=r();if(!u||j_(u.evaluationUUID,Rs.JUDGMENT))return;const f=s(c);f&&(n(Rs.JUDGMENT,f),I_(u.evaluationUUID,Rs.JUDGMENT))}catch(u){Z.error("Failed to track SBS judgment:",u)}},[r,s,n]),a=d.useCallback(()=>{try{const c=r();if(!c||j_(c.evaluationUUID,Rs.BANNER))return;const u={eventType:Rs.BANNER,timestampMs:Date.now(),eventData:{evaluationUUID:c.evaluationUUID,evaluatorID:c.evaluatorID,experimentVariationKey:c.experimentVariationKey,experimentRoles:e.map(f=>f.side_by_side_metadata?.experiment_role||`entry_${e.indexOf(f)}`)}};n(Rs.BANNER,u),I_(c.evaluationUUID,Rs.BANNER)}catch(c){Z.error("Failed to track SBS banner exposure:",c)}},[r,e,n]),i=d.useCallback(()=>{try{const c=r();if(!c||j_(c.evaluationUUID,Rs.EXPOSURE))return;const u={eventType:Rs.EXPOSURE,timestampMs:Date.now(),eventData:{evaluationUUID:c.evaluationUUID,evaluatorID:c.evaluatorID,experimentVariationKey:c.experimentVariationKey,entries:e.map(Yve)}};n(Rs.EXPOSURE,u),I_(c.evaluationUUID,Rs.EXPOSURE)}catch(c){Z.error("Failed to track SBS exposure:",c)}},[r,e,n]);return d.useMemo(()=>({trackJudgment:o,trackBannerExposure:a,trackSBSExposure:i}),[o,a,i])},Xve=({enabled:e,reason:t})=>{const{locale:n}=J(),r=n?{"accept-language":n}:{},s=async()=>Kye({headers:r,reason:t}),o=Vt(),{data:a}=gt({enabled:o?typeof e>"u"?!0:e:!1,queryKey:yye(),queryFn:s});return a??PH},Zve=e=>e?.context_uuid??void 0,Jve=e=>e?.frontend_context_uuid??void 0,ebe=e=>e?.thread_title??"",tbe=e=>e?.query_str??void 0,nbe=e=>e?.search_focus??void 0,rbe=e=>e.sources?.sources??void 0,sbe=e=>e?.author_id??void 0,obe=e=>e?.author_username??void 0,abe=e=>e?.author_image??void 0,ibe=e=>{if(e.parent_info)return e.parent_info},lbe=e=>e?.mode??null,cbe=e=>e?.personalized??void 0,ube=e=>e?.collection_info??void 0,dbe=e=>e?.bookmark_state??void 0,fbe=e=>e?.thread_access??void 0,mbe=e=>e?.thread_url_slug??void 0,pbe=e=>e?.updated_datetime??void 0,hbe=e=>e?.expiry_time??null,gbe=e=>e?.privacy_state??void 0,w3=e=>({forkCount:e?.fork_count??0,likeCount:e?.like_count??0,viewCount:e?.view_count??0,userLikes:e?.user_likes??!1}),ybe={},P_=e=>e?{author_id:sbe(e),author_image:abe(e),author_username:obe(e),bookmarkState:dbe(e),collection:ube(e),contextUUID:Zve(e),expiry_time:hbe(e)??void 0,first_query:tbe(e),focus:nbe(e),frontendContextUUID:Jve(e),mode:lbe(e)??void 0,parent_info:ibe(e)??void 0,personalized:cbe(e)??void 0,privacy_state:gbe(e)??void 0,rwToken:e.read_write_token,sources:rbe(e)??void 0,text_completed:!1,thread_access:fbe(e)??void 0,thread_url_slug:mbe(e),title:ebe(e),updated_datetime:pbe(e)}:ybe;function xbe({entries:e,threads:t,streams:n,currentStreamId:r,currentThreadId:s}){const o=r?n[r]:void 0,a=o?.threadId??s;if(a){const i=t.find(c=>c.id===a);if(i){const c=i.entryIds.map(u=>e[u]).filter(u=>u!=null);return o?.placeholderChunk&&!o.entryId&&c.push(o.placeholderChunk),c}}return o?.placeholderChunk?[o.placeholderChunk]:[]}const ag=zt("ResultsContext",null),vbe=({children:e})=>{const t=zs(),[n,r]=d.useState(),[s,o]=d.useState(),a=d.useCallback(p=>{if(r(p),p){const{streams:h}=t.getState(),g=Object.values(h).find(y=>y.threadId===p);o(g?.id.description)}},[t]),i=d.useCallback(p=>{if(o(p),p){const h=t.getState().streams[p];h?.threadId&&r(h.threadId)}},[t]),c=d.useMemo(()=>({setCurrentThreadId:a,setCurrentStreamId:i,clear:()=>{a(void 0),i(void 0)}}),[a,i]),u=d.useCallback(p=>{const h=xbe({entries:p.entries,threads:p.threads,streams:p.streams,currentStreamId:s,currentThreadId:n}),g=Cme(h),y=Sme(h),x=h.find(v=>Yt.isStatusPending(v));return{results:h,firstResult:g,lastResult:y,inFlightEntry:x,inFlight:!!x,inFlightLatest:h.length>0&&y!==void 0&&Yt.isStatusPending(y),socialStats:w3(g?.social_info),resultsLength:h.length}},[n,s]),f=N0e(t,u),m=d.useMemo(()=>({...f,actions:c,currentThreadId:n,currentStreamId:s}),[n,s,f,c]);return l.jsx(ag.Provider,{value:m,children:e})};function an(){const e=d.useContext(ag);if(!e)throw new Error("useResults must be used within a ResultsProvider");return e.useProxy()}function U4(e){const t=d.useContext(ag);if(!t)throw new Error("useResultsSelector must be used within a ResultsProvider");return t.useSelector(e)}function Ux(){const e=d.useContext(ag);if(!e)throw new Error("useResultsActions must be used within a ResultsProvider");return e.actions}const V4=()=>{const e=d.useContext(ag),t=Ive(),n=B4();return d.useCallback(r=>t(e?.currentThreadId,s=>{const o=r(s);if(o)return n(void 0,o),o}),[t,e?.currentThreadId,n])},vz=()=>{const e=jve(),t=B4();return d.useCallback((n,r)=>{e(n,s=>{const o=r(s);if(o)return t(o,void 0),o})},[e,t])},qr={[oe.SEARCH]:Ue({askInputPlaceholder:{defaultMessage:"Ask anything…",id:"AUouhaZgFv"},name:{defaultMessage:"Search",id:"xmcVZ0BU63"},description:{defaultMessage:"Fast answers to everyday questions",id:"5Y9Hg4e+zB"}}),[oe.RESEARCH]:Ue({askInputPlaceholder:{defaultMessage:"Research anything…",id:"PITzDLgm5P"},name:{defaultMessage:"Research",id:"JEe7dVso7F"},description:{defaultMessage:"Deep research on any topic",id:"uH6f+eH2OS"}}),[oe.STUDIO]:Ue({askInputPlaceholder:{defaultMessage:"Create anything…",id:"pmtrj6Tjm9"},name:{defaultMessage:"Labs",id:"ylFNoY79wa"},description:{defaultMessage:"Create projects from scratch",id:"nH9rAkplC/"}}),[oe.STUDY]:Ue({askInputPlaceholder:{defaultMessage:"Study anything…",id:"UOEDdZ+cnD"},name:{defaultMessage:"Learn",id:"IbrSk1x1M4"},description:{defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"}})},Jn={[ie.DEFAULT]:Ue({name:{defaultMessage:"Best",id:"PzlMqGwwkm"},description:{defaultMessage:"Adapts to each query",id:"SsTMNu/s/A"}}),[ie.PRO]:Ue({name:{defaultMessage:"Best",id:"PzlMqGwwkm"},description:{defaultMessage:"Automatically selects the best model based on the query",id:"3ZgFQznYO0"}}),[ie.PPLX_PRO_UPGRADED]:Ue({name:{defaultMessage:"Pro",id:"R/eOkjWqNU"},description:{defaultMessage:"Automatically selects the most responsive model based on the query",id:"DuOz+H05Us"}}),[ie.SONAR]:Ue({name:{defaultMessage:"Sonar",id:"sT9VX563o6"},description:{defaultMessage:"Perplexity's latest model",id:"ZBUx6ziNIY"}}),[ie.GPT_4o]:Ue({name:{defaultMessage:"GPT-4o",id:"nebbHBgxX/"},description:{defaultMessage:"OpenAI's versatile model",id:"zdAw82CyOA"}}),[ie.GPT_4_1]:Ue({name:{defaultMessage:"GPT-4.1",id:"+LPr/f6Fal"},description:{defaultMessage:"OpenAI's advanced model",id:"+uCLZVt7uh"}}),[tt.GPT_5]:Ue({name:{defaultMessage:"GPT-5",id:"VfhmdGpVc7"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[ie.GPT_5_1]:Ue({name:{defaultMessage:"GPT-5.1",id:"uOMpo0agAL"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[tt.GPT_5_THINKING]:Ue({name:{defaultMessage:"GPT-5 Thinking",id:"/IA3KV+qFr"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[ie.GPT_5_1_THINKING]:Ue({name:{defaultMessage:"GPT-5.1 Thinking",id:"74//SO976H"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[tt.GPT5_PRO]:Ue({name:{defaultMessage:"GPT-5 Pro",id:"GwvubEn/BR"},description:{defaultMessage:"OpenAI's latest, most powerful reasoning model",id:"3Z57hOWKDd"}}),[ie.GPT_5_2]:Ue({name:{defaultMessage:"GPT-5.2",id:"X26Ei/S8vd"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[ie.GPT_5_2_THINKING]:Ue({name:{defaultMessage:"GPT-5.2 Thinking",id:"9NodtkoSox"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[ie.CLAUDE_2]:Ue({name:{defaultMessage:"Claude Sonnet 4.0",id:"4UrgPEhdwq"},description:{defaultMessage:"Anthropic's advanced model",id:"b5CqfvLw4b"}}),[ie.GEMINI_2_5_PRO]:Ue({name:{defaultMessage:"Gemini 2.5 Pro",id:"hec4NYL1Ib"},description:{defaultMessage:"Google's latest model",id:"XBL8FigIeX"}}),[ie.GEMINI_3_0_PRO]:Ue({name:{defaultMessage:"Gemini 3 Pro",id:"UK0QXlryM2"},description:{defaultMessage:"Google's most advanced model",id:"fz0xqlVIaF"}}),[ie.GEMINI_3_0_FLASH]:Ue({name:{defaultMessage:"Gemini 3 Flash",id:"wBxtNZNdaJ"},description:{defaultMessage:"Google's fast model",id:"Vm1k26HpRd"}}),[ie.GEMINI_3_0_FLASH_HIGH]:Ue({name:{defaultMessage:"Gemini 3 Flash Thinking",id:"WGU4v3vcgP"},description:{defaultMessage:"Google's fast model",id:"Vm1k26HpRd"}}),[ie.GROK]:Ue({name:{defaultMessage:"Grok 3 Beta",id:"Ybq0GDRm0J"},description:{defaultMessage:"xAI's Grok 3 model",id:"gwIHPQy1c/"}}),[ie.PPLX_REASONING]:Ue({name:{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"},description:{defaultMessage:"Advanced problem solving",id:"4J0akc6m53"}}),[ie.CLAUDE_3_7_SONNET_THINKING]:Ue({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[ie.CLAUDE_4_0_OPUS]:Ue({name:{defaultMessage:"Claude Opus 4.0",id:"fwViXd5wrs"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_0_OPUS_THINKING]:Ue({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_1_OPUS]:Ue({name:{defaultMessage:"Claude Opus 4.1",id:"aq+8T//8S9"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_1_OPUS_THINKING]:Ue({name:{defaultMessage:"Claude Opus 4.1 Thinking",id:"Vd2LxNSW/4"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_5_OPUS]:Ue({name:{defaultMessage:"Claude Opus 4.5",id:"c8oGQdxIXE"},description:{defaultMessage:"Anthropic's most advanced model",id:"4l6C+Dcw8g"}}),[ie.CLAUDE_4_5_OPUS_THINKING]:Ue({name:{defaultMessage:"Claude Opus 4.5 Thinking",id:"oBSH9hOxZC"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_5_SONNET]:Ue({name:{defaultMessage:"Claude Sonnet 4.5",id:"TreRV15OSF"},description:{defaultMessage:"Anthropic's fast model",id:"zkLN9uB0Ho"}}),[ie.CLAUDE_4_5_SONNET_THINKING]:Ue({name:{defaultMessage:"Claude Sonnet 4.5 Thinking",id:"POJuSUD1gU"},description:{defaultMessage:"Anthropic's newest reasoning model",id:"MIjO2w9Cui"}}),[ie.KIMI_K2_THINKING]:Ue({name:{defaultMessage:"Kimi K2 Thinking",id:"IIsFX2aoN0"},description:{defaultMessage:"Moonshot AI's latest model",id:"/JWHGx0t9p"}}),[ie.GROK_4]:Ue({name:{defaultMessage:"Grok 4",id:"+Y775fAOqr"},description:{defaultMessage:"xAI's reasoning model",id:"tYRPjba3cL"}}),[ie.GROK_4_NON_THINKING]:Ue({name:{defaultMessage:"Grok 4",id:"+Y775fAOqr"},description:{defaultMessage:"xAI's advanced model",id:"av1iNKEP7e"}}),[ie.GROK_4_1_REASONING]:Ue({name:{defaultMessage:"Grok 4.1",id:"gWMQFuyUxZ"},description:{defaultMessage:"xAI's latest model",id:"e2CghRZC7d"}}),[ie.GROK_4_1_NON_REASONING]:Ue({name:{defaultMessage:"Grok 4.1",id:"gWMQFuyUxZ"},description:{defaultMessage:"xAI's latest model",id:"e2CghRZC7d"}}),[tt.O3_PRO]:Ue({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's powerful reasoning model",id:"BodLv+J6l0"}}),[ie.O4_MINI]:Ue({name:{defaultMessage:"o4-mini",id:"BwwjXFHgz7"},description:{defaultMessage:"OpenAI's latest reasoning model",id:"VKonAfIZbf"}}),[ie.PPLX_SONAR_INTERNAL_TESTING]:Ue({name:{defaultMessage:"Sonar Testing - Alpha",id:"2oa4bWRfNL"},description:{defaultMessage:"Sonar model alpha variant",id:"EvwN/e7vAD"}}),[ie.PPLX_SONAR_INTERNAL_TESTING_V2]:Ue({name:{defaultMessage:"Sonar Testing - Beta",id:"VNsK+ZGei/"},description:{defaultMessage:"Sonar model beta variant",id:"Dzfl36DNyM"}}),[ie.ALPHA]:Ue({name:{defaultMessage:"Research",id:"JEe7dVso7F"},description:{defaultMessage:"Fast and thorough for routine research",id:"v/MuahlVJE"}}),[ie.BETA]:Ue({name:{defaultMessage:"Labs",id:"ylFNoY79wa"},description:{defaultMessage:"Multi-step tasks with advanced troubleshooting",id:"Sf0AeuilA5"}}),[ie.STUDY]:Ue({name:{defaultMessage:"Study",id:"UTFsoN8Z1P"},description:{defaultMessage:"Fast model for routine research",id:"prWIV9FsWt"}}),[tt.O3_MINI]:Ue({name:{defaultMessage:"o3-mini",id:"GdJwPgWWId"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[tt.GROK2]:Ue({name:{defaultMessage:"Grok-2",id:"9X3jPx+0vk"},description:{defaultMessage:"xAI's latest model",id:"e2CghRZC7d"}}),[tt.GPT_4]:Ue({name:{defaultMessage:"GPT-4",id:"6TGiMlP7f4"},description:{defaultMessage:"OpenAI's previous generation model",id:"U3OQoJ211e"}}),[tt.CLAUDE_3_OPUS]:Ue({name:{defaultMessage:"Claude 3 Opus",id:"gLSCHWGsu1"},description:{defaultMessage:"Anthropic's previous generation model",id:"hAevdn8yGl"}}),[tt.CLAUDE_3_5_HAIKU]:Ue({name:{defaultMessage:"Claude 3.5 Haiku",id:"zEJWYa05R2"},description:{defaultMessage:"Anthropic's smaller model",id:"pQia6E7J8i"}}),[tt.GEMINI]:Ue({name:{defaultMessage:"Gemini",id:"XoqZkcqFZ/"},description:{defaultMessage:"Previous version of Google's Gemini model",id:"9C0LtRWLFh"}}),[tt.LLAMA_X_LARGE]:Ue({name:{defaultMessage:"Llama X Large",id:"2zxgnSWUyX"},description:{defaultMessage:"Meta's large Llama model",id:"+95UnVOxgQ"}}),[tt.MISTRAL]:Ue({name:{defaultMessage:"Mistral",id:"dUBSpMbbs4"},description:{defaultMessage:"Mistral AI model",id:"rYRyt8I2Zr"}}),[tt.COPILOT]:Ue({name:{defaultMessage:"Copilot",id:"b3QbnXgawD"},description:{defaultMessage:"Legacy Pro Search",id:"pg83InaW1o"}}),[tt.CLAUDE_OMBRE_EAP]:Ue({name:{defaultMessage:"Claude Ombre",id:"F12IlTx8R1"},description:{defaultMessage:"Anthropic's research preview",id:"LKt7UBXwdw"}}),[tt.CLAUDE_LACE_EAP]:Ue({name:{defaultMessage:"Claude Lace",id:"8ydOdGYWef"},description:{defaultMessage:"Anthropic's opus research preview",id:"GHW8xWfe9i"}}),[tt.R1]:Ue({name:{defaultMessage:"R1 1776",id:"e8N3MYqmIQ"},description:{defaultMessage:"Perplexity's unbiased reasoning model",id:"R5Tg1hC1um"}}),[tt.GAMMA]:Ue({name:{defaultMessage:"Gamma",id:"Wb9IyuuCJO"},description:{defaultMessage:"Fast model for routine research",id:"prWIV9FsWt"}}),[tt.O3]:Ue({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[tt.GEMINI_2_FLASH]:Ue({name:{defaultMessage:"Gemini 2.5 Pro",id:"hec4NYL1Ib"},description:{defaultMessage:"Google's latest model",id:"XBL8FigIeX"}}),[tt.TESTING_MODEL_C]:Ue({name:{defaultMessage:"Testing Model C",id:"sgSu9ApFvP"},description:{defaultMessage:"Debug model for testing",id:"AG6p6ERvyn"}}),[tt.O3_RESEARCH]:Ue({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[tt.O3_PRO_RESEARCH]:Ue({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's most powerful reasoning model",id:"1ntkiZj5rM"}}),[tt.CLAUDE40SONNET_RESEARCH]:Ue({name:{defaultMessage:"Claude Sonnet 4.0",id:"4UrgPEhdwq"},description:{defaultMessage:"Anthropic's advanced model",id:"b5CqfvLw4b"}}),[tt.CLAUDE40SONNETTHINKING_RESEARCH]:Ue({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[tt.CLAUDE40OPUS_RESEARCH]:Ue({name:{defaultMessage:"Claude Opus 4.0",id:"fwViXd5wrs"},description:{defaultMessage:"Anthropic's most advanced model",id:"4l6C+Dcw8g"}}),[tt.CLAUDE40OPUSTHINKING_RESEARCH]:Ue({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's advanced reasoning model",id:"RwUx0WhdZb"}}),[tt.O3_LABS]:Ue({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[tt.O3_PRO_LABS]:Ue({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's most powerful reasoning model",id:"1ntkiZj5rM"}}),[tt.CLAUDE40SONNETTHINKING_LABS]:Ue({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[tt.CLAUDE40OPUSTHINKING_LABS]:Ue({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's advanced reasoning model",id:"RwUx0WhdZb"}})},bbe=[{label:Jn[ie.SONAR].name,description:Jn[ie.SONAR].description,nonReasoningModel:ie.SONAR,reasoningModel:null,hasNewTag:!1,subscriptionTier:cr.PRO},{label:Jn[ie.GEMINI_3_0_FLASH].name,description:Jn[ie.GEMINI_3_0_FLASH].description,nonReasoningModel:ie.GEMINI_3_0_FLASH,reasoningModel:ie.GEMINI_3_0_FLASH_HIGH,hasNewTag:!1,subscriptionTier:cr.PRO},{label:Jn[ie.GEMINI_3_0_PRO].name,description:Jn[ie.GEMINI_3_0_PRO].description,nonReasoningModel:null,reasoningModel:ie.GEMINI_3_0_PRO,hasNewTag:!1,subscriptionTier:cr.PRO},{label:Jn[ie.GPT_5_2].name,description:Jn[ie.GPT_5_2].description,nonReasoningModel:ie.GPT_5_2,reasoningModel:ie.GPT_5_2_THINKING,hasNewTag:!1,subscriptionTier:cr.PRO},{label:Jn[ie.CLAUDE_4_5_SONNET].name,description:Jn[ie.CLAUDE_4_5_SONNET].description,nonReasoningModel:ie.CLAUDE_4_5_SONNET,reasoningModel:ie.CLAUDE_4_5_SONNET_THINKING,hasNewTag:!1,subscriptionTier:cr.PRO},{label:Jn[ie.CLAUDE_4_5_OPUS].name,description:Jn[ie.CLAUDE_4_5_OPUS].description,nonReasoningModel:ie.CLAUDE_4_5_OPUS,reasoningModel:ie.CLAUDE_4_5_OPUS_THINKING,hasNewTag:!1,subscriptionTier:cr.MAX},{label:Jn[ie.GROK_4_1_NON_REASONING].name,description:Jn[ie.GROK_4_1_NON_REASONING].description,nonReasoningModel:ie.GROK_4_1_NON_REASONING,reasoningModel:ie.GROK_4_1_REASONING,hasNewTag:!1,subscriptionTier:cr.PRO},{label:Jn[ie.KIMI_K2_THINKING].name,description:Jn[ie.KIMI_K2_THINKING].description,nonReasoningModel:null,reasoningModel:ie.KIMI_K2_THINKING,hasNewTag:!1,subscriptionTier:cr.PRO,textOnlyModel:!0,subheading:W({defaultMessage:"Hosted in the US",id:"5F33MSbZ40"})}],_be=e=>e.reduce((t,n)=>(n.nonReasoningModel&&(t[n.nonReasoningModel]=n),n.reasoningModel&&(t[n.reasoningModel]=n),t),{}),H4=()=>{const e=d.useMemo(()=>bbe,[]),t=d.useMemo(()=>_be(e),[e]),n=d.useCallback(r=>t[r],[t]);return d.useMemo(()=>({models:e,getModelConfig:n}),[e,n])},wbe=(e,t,n)=>{const{value:r,loading:s}=c4({flag:"remove-reasoning-model-selection",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Cbe=()=>{const{variation:e,loading:t}=wbe(0);return d.useMemo(()=>({hours:e,loading:t,enabled:e>0}),[e,t])};function Sbe(e){try{const t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}}function Ebe({getPreferredSearchModelUpdatedAt:e,setPreferredSearchModelUpdatedAt:t}){const{hours:n,loading:r,enabled:s}=Cbe();return d.useMemo(()=>{const o=e();if(r||!s)return{shouldAutoDisableReasoning:!1};if(!o)return{shouldAutoDisableReasoning:!1};const a=Sbe(o);return a?{shouldAutoDisableReasoning:(new Date().getTime()-a.getTime())/(1e3*60*60)>=n}:(t(new Date().toISOString()),{shouldAutoDisableReasoning:!1})},[n,r,s,e,t])}const kbe=(e=!1,t,n)=>{const{value:r,loading:s}=qt({flag:"search-model-menu-rewrite",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Mbe="search-model-menu-redesign-enabled",bz=()=>{const[e,t]=Qi(Mbe,!1),{variation:n,loading:r}=kbe(!1);return d.useEffect(()=>{r||t(n)},[n,r,t]),{isSearchModelMenuRewriteEnabled:e}},_z="v1",Tbe={config_schema:_z,models:[ie.SONAR],config:[{label:"Sonar",description:"Perplexity's fast model",non_reasoning_model:ie.SONAR,reasoning_model:null,has_new_tag:!1,subscription_tier:cr.PRO,text_only_model:!1}]},wz=e=>{const t=e.config.reduce((i,c)=>(c.non_reasoning_model&&i.set(c.non_reasoning_model,c),c.reasoning_model&&i.set(c.reasoning_model,c),i),new Map),n=i=>t.get(i);function r(i,c){return n(i)?.label??c}function s(i,c){return n(i)?.description??c}function o(i,c){return n(i)?.subheading??c}function a(i){return typeof i=="string"&&t.has(i)}return{...e,getModelConfig:n,getModelLabel:r,getModelDescription:s,getModelSubheading:o,isSearchModel:a}},Abe=()=>be.makeQueryKey("search-models-config"),Nbe=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/models/config",e,{params:{query:{config_schema:_z}},timeoutMs:Ze(),numRetries:Kl});if(t)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch models",cause:t,status:r.status??0});const s=wz(n);return{...n,...s}},Rbe=wz(Tbe),Cz=({reason:e,enabled:t=!0})=>{const n=gt({queryFn:()=>Nbe({reason:e}),queryKey:Abe(),placeholderData:Rbe,enabled:t}),r=n.data;return d.useMemo(()=>({query:n,...r}),[n,r])},Dbe=()=>{const e="use-is-search-model",{isSearchModelMenuRewriteEnabled:t}=bz(),{isSearchModel:n}=Cz({reason:e,enabled:t});return d.useCallback(r=>t?n(r):xH(r),[n,t])},Sz="pplx.local-user-settings.";function Gd(e,t){return Qi(`${Sz}${e}`,t)}const jbe=1;function ig(){const e=Dbe(),[t,n]=Gd("preferredSearchModelUpdatedAt",void 0),[r,s,o]=Gd(`preferredSearchModels-v${jbe}`,PU),[a,i]=d.useState(r),c=d.useCallback(m=>{s(m),i(m)},[s]),u=d.useRef(!0),f=d.useCallback((m,p)=>{c(h=>{const g={...h};return p?g[m]=p:m&&delete g[m],g})},[c]);return d.useEffect(()=>{if(u.current){u.current=!1;return}n(new Date().toISOString())},[a.search,n]),d.useEffect(()=>{function m(){if(document.visibilityState!=="visible")return;const p=o();i(h=>{let g=!1;const y={...h};for(const[x,v]of Object.entries(p)){const b=x,_=h[b];e(v)&&v!==_&&(y[b]=v,g=!0)}return g?y:h})}return document.addEventListener("visibilitychange",m),()=>{document.removeEventListener("visibilitychange",m)}},[e,i,o]),d.useMemo(()=>({preferredSearchModels:a,preferredSearchModelUpdatedAt:t,setPreferredSearchModel:f,setPreferredSearchModelUpdatedAt:n}),[a,t,f,n])}const Ibe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"use-rate-limit-status-endpoint",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Pbe=async({reason:e})=>{const{error:t,data:n}=await de.GET("/rest/rate-limit/all",e);if(t||!n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get rate limits",cause:t,status:0});return n},Obe=async({reason:e})=>{const{error:t,data:n}=await de.GET("/rest/rate-limit/status",e);if(t||!n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get rate limit statuses",cause:t,status:0});return n},Lbe={remaining_pro:0,remaining_research:0,remaining_labs:0,sources:{source_to_limit:{}},model_specific_limits:{}},Fbe={modes:{pro_search:{available:!1,remaining_detail:{kind:"exact",remaining:0}},research:{available:!1,remaining_detail:{kind:"exact",remaining:0}},labs:{available:!1,remaining_detail:{kind:"exact",remaining:0}}},sources:{}},Bbe=({enabled:e,reason:t,refetchOnMount:n="always"})=>{const r=Vt(),s=Xt(),{session:o}=je(),a=o?.user?.email?{userEmail:o.user.email}:void 0,{variation:i,loading:c}=Ibe(!1,a),u=gt({enabled:r&&e&&!c,queryKey:Qy(),queryFn:async()=>i?{status:await Obe({reason:t})}:{legacy:await Pbe({reason:t})},refetchOnMount:n}),f=d.useCallback(()=>{s.invalidateQueries({queryKey:Qy()})},[s]);return d.useMemo(()=>({...u,legacyLimits:u.data?.legacy??(i?void 0:Lbe),statusLimits:u.data?.status??(i?Fbe:void 0),hasLoadedRateLimits:u.isSuccess&&!u.isFetching&&!!u.data,refresh:f}),[u,i,f])},t9={hasLoadedSettings:!1,pagesLimit:0,uploadLimit:void 0,articleImageUploadLimit:0,defaultImageGenerationModel:"default",defaultVideoGenerationModel:"default",maxFilesPerUser:0,maxFilesPerRepository:0,queryCount:0,queryCountCopilot:0,queryCountMobile:0,hasAiProfile:!1,referralCode:"",referralNumSuccess:0,referralNumCoupons:0,disableTraining:!1,isSidebarCollapsed:!1,isSidebarPinned:!1,sidebarHiddenHubs:[],subscriptionTier:void 0,stripeStatus:"none",revenuecatStatus:"none",revenuecatSource:"none",createLimit:0,notifStatus:"",emailStatus:"",hasDataRetentionWarning:!1,allowArticleCreation:!1,isVerified:!1,connectors:{connectors:[]},connectorLimits:{global_file_count:void 0,repo_type_limits:void 0,max_file_size_mb:void 0,max_attachment_file_size_mb:void 0},alwaysAllowBrowserAgent:!1,hasAcceptedApiTerms:!1,sources:{source_to_limit:{}}},Ube=()=>{const e=hr("isCollapsed"),{device:{isWindowsApp:t}}=on();return e===null?t:e==="true"},Sa=({enabled:e,reason:t,refetchOnMount:n,skipConnectorPickerCredentials:r=!0})=>{const{locale:s}=J(),o=Vt(),a=Ube(),i=s?{"accept-language":s}:{},c=()=>OH({headers:i,reason:t,skipConnectorPickerCredentials:r}),{data:u,refetch:f,isLoading:m,isStale:p}=gt({enabled:o?typeof e>"u"?!0:e:!1,queryKey:cu({skipConnectorPickerCredentials:r}),queryFn:c,refetchOnMount:n,placeholderData:t9});d.useEffect(()=>{u&&qfe({queryCount:u.queryCount,queryCountCopilot:u.queryCountCopilot,queryCountMobile:u.queryCountMobile})},[u]);const h=d.useMemo(()=>({...u??t9,isSidebarCollapsed:a}),[u,a]);return d.useMemo(()=>({...h,refetch:f,isLoading:m,isStale:p}),[h,f,m,p])},Vbe=["presentpicker"],Ez=e=>e?Vbe.includes(e):!1;function Hbe(e){const t=mn(),n=Vt(),{hasAccessToProFeatures:r}=Bt(),{session:s}=je(),{trackEvent:o}=Ke(s),{preferredSearchModels:a,preferredSearchModelUpdatedAt:i,setPreferredSearchModel:c,setPreferredSearchModelUpdatedAt:u}=ig(),{getModelConfig:f}=H4(),m=t?.get("copilot"),p=t?.get("pro"),h=t?.get("utm_source"),g=m==="false"||p==="false",y=!g&&(m==="true"||p==="true"||Ez(h??void 0)),x=a[oe.SEARCH];d.useEffect(()=>{x&&(sn(x)!==oe.SEARCH?(Wc.warn(`Resetting preferred search model from ${x} to ${ie.PRO}`),a[oe.SEARCH]=ie.PRO,c(oe.SEARCH,ie.PRO)):x===ie.DEFAULT&&r&&c(oe.SEARCH,void 0))},[r,x,a,c]);const v=d.useCallback(()=>i,[i]),{shouldAutoDisableReasoning:b}=Ebe({getPreferredSearchModelUpdatedAt:v,setPreferredSearchModelUpdatedAt:u});d.useEffect(()=>{if(!b||!x)return;const C=f(x);C&&C.nonReasoningModel&&C.reasoningModel===x&&c(oe.SEARCH,C.nonReasoningModel)},[b,c,f,x]);const _=t?.get("model_id")==="pplx_alpha"?null:t?.get("model_id");let w;_&&(_==="deep_research"?w=ie.ALPHA:Object.values(ie).includes(_)&&(w=_));let S;return g?S=ie.DEFAULT:w?S=w:y&&(S=ie.PRO),S&&w&&w==S&&o("search mode utm",{mode:sn(S)}),d.useMemo(()=>{let C=ie.DEFAULT;return n?S||(C=a[oe.SEARCH]??(r?ie.PRO:ie.DEFAULT),C):C},[n,S,a,r])}function Du(e){return{available:e>0,exactCount:e}}function O_(e){return{available:e.available,exactCount:e.remaining_detail.kind==="exact"?e.remaining_detail.remaining:void 0}}const kz={isCopilot:!1,sources:["web"],gpt4Limit:{available:!1,exactCount:0},pplxAlphaLimit:{available:!1,exactCount:0},pplxBetaLimit:{available:!1,exactCount:0},modelSpecificLimits:{},uploadRateLimit:void 0,createLimit:0,recency:null,askInputReasoningMode:!1,askInputReasoningModelPreference:null,setAskInputReasoningMode:()=>{},setAskInputReasoningModelPreference:()=>{},setConfiguredModel(){},setSources:()=>{},setIsCopilot:()=>{},decrementCreateLimit:()=>{},setModelSpecificLimits:()=>{},setRecency:()=>{},setUploadRateLimit:()=>{},configuredModel:ie.DEFAULT,configuredSearchMode:oe.SEARCH,setConfiguredSearchMode(){}},Mz=zt("ThreadConfigContext",kz),zbe=({children:e,shouldFetchSettings:t})=>{const r=Sa({enabled:t,reason:"thread-settings-provider"}),{isMax:s}=Bt(),{statusLimits:o,legacyLimits:a,hasLoadedRateLimits:i}=Bbe({enabled:t,reason:"thread_settings_provider_mount"}),c=Hbe(),u=d.useMemo(()=>o?{proLimit:O_(o.modes.pro_search),researchLimit:O_(o.modes.research),labsLimit:O_(o.modes.labs),modelSpecificLimits:{}}:a?{proLimit:Du(a.remaining_pro??0),researchLimit:Du(a.remaining_research??0),labsLimit:Du(a.remaining_labs??0),modelSpecificLimits:a.model_specific_limits??{}}:null,[o,a]),[f,m]=d.useState({...kz,gpt4Limit:Du(u?.proLimit.exactCount??0),pplxAlphaLimit:Du(u?.researchLimit.exactCount??0),pplxBetaLimit:Du(u?.labsLimit.exactCount??0),modelSpecificLimits:u?.modelSpecificLimits??{},configuredModel:c,configuredSearchMode:sn(c)});d.useEffect(()=>{m(C=>C.configuredModel===c?C:{...C,configuredModel:c,configuredSearchMode:sn(c,C.configuredSearchMode)})},[c]);const p=d.useCallback(C=>m(E=>({...E,configuredModel:C,configuredSearchMode:sn(C,E.configuredSearchMode)})),[]),h=d.useCallback(()=>{p(ie.DEFAULT)},[p]),g=d.useCallback(C=>{m(E=>({...E,sources:C}))},[]),y=d.useCallback(C=>{m(E=>({...E,recency:C}))},[]),x=d.useCallback(C=>{m(E=>({...E,askInputReasoningModelPreference:C,askInputReasoningMode:!!C}))},[]),v=d.useCallback(C=>{m(E=>({...E,askInputReasoningMode:C}))},[]);d.useEffect(()=>{r.createLimit!==null&&m(C=>({...C,createLimit:r.createLimit}))},[r.createLimit]),d.useEffect(()=>{r.uploadLimit!==null&&r.uploadLimit!==void 0&&m(C=>({...C,uploadRateLimit:r.uploadLimit}))},[r.uploadLimit]),d.useEffect(()=>{u&&m(C=>({...C,gpt4Limit:u.proLimit,pplxAlphaLimit:u.researchLimit,pplxBetaLimit:u.labsLimit,modelSpecificLimits:u.modelSpecificLimits}))},[u,f.gpt4Limit.available,f.pplxAlphaLimit.available,f.pplxBetaLimit.available]),d.useEffect(()=>{if(!i||!u)return;const C=u.proLimit.available,E=u.researchLimit.available,N=u.labsLimit.available,k=f.configuredModel;(k!==ie.DEFAULT&&!C||sn(k)===oe.RESEARCH&&!E&&!s||sn(k)===oe.STUDIO&&!N&&!s)&&h(),(f.askInputReasoningMode||f.askInputReasoningModelPreference)&&!C&&h()},[u,h,i,f.askInputReasoningMode,f.askInputReasoningModelPreference,f.configuredModel,s]);const b=d.useCallback(()=>{const C=Math.max(f.createLimit-1,0);m(E=>({...E,createLimit:C}))},[f.createLimit]),_=d.useCallback((C=1)=>{if(f.uploadRateLimit==null)return;const E=Math.max(f.uploadRateLimit-C,0);m(N=>({...N,uploadRateLimit:E}))},[f.uploadRateLimit]),S={...f,setConfiguredModel:p,setSources:g,decrementCreateLimit:b,setUploadRateLimit:_,setModelSpecificLimits:C=>{m(E=>({...E,modelSpecificLimits:C}))},setRecency:y,askInputReasoningMode:f.askInputReasoningMode,isCopilot:f.configuredModel!==ie.DEFAULT,setAskInputReasoningMode:v,setAskInputReasoningModelPreference:x,configuredSearchMode:f.configuredSearchMode,setConfiguredSearchMode:C=>{m(E=>({...E,configuredSearchMode:C}))}};return l.jsx(Mz.Provider,{value:S,children:e})},Fn=()=>{const e=d.useContext(Mz);if(!e)throw new Error("useThreadConfig must be used within ThreadSettingsContext");return e};function zo(){const{configuredModel:e,configuredSearchMode:t}=Fn();return d.useMemo(()=>t||(e===ie.DEFAULT?oe.SEARCH:sn(e)),[t,e])}const Tz=e=>[...e].sort((t,n)=>t.backend_uuid.localeCompare(n.backend_uuid,void 0,{sensitivity:"base"})),z4=e=>{if(!e.length)return[];const t=new Map;return e.forEach(n=>{if(n.side_by_side_metadata?.sibling_uuid&&n.side_by_side_metadata?.selection_status===la.UNSELECTED)return;const r=n.side_by_side_metadata?.sibling_uuid??n.backend_uuid;t.has(r)||t.set(r,[]),t.get(r).push(n)}),[...t.values()].map(n=>{const r=Tz(n);return r[0]?.side_by_side_metadata?.selection_status===la.TIE?[r[0]]:r})};function Wbe(){const{session:e}=je(),{trackEvent:t}=Ke(e),{locale:n}=J(),[r,s]=d.useState(x_.includes(n)?n:dpe),o=o2e();return o?x_.includes(o)?r!==o&&s(o):a2e():r!==n&&x_.includes(n)&&s(n),d.useMemo(()=>({locale:r,hasChosenLocale:!!o,saveLocale(a){s(a),s2e(a),t("set locale cookie",{locale:a})}}),[r,o,t])}const Gbe="side-by-side-experiments";function $be(e,t={}){const{value:n,loading:r,error:s}=Hge({flag:Gbe,defaultValue:{side_by_side_config:{}},subjectType:"context_uuid",extraAttributes:t},e);return d.useMemo(()=>({sideBySideOverrides:n,loading:r,error:s}),[n,r,s])}const fa=()=>crypto.randomUUID();fa();const hvt=(e,t)=>{const n=new URL(e);return n.searchParams.delete("source"),n.searchParams.delete("s"),t&&(n.hash=t),n.searchParams.sort(),n.href};function Az(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qbe(e,t){try{const n=new Date(e.replace(/-/g,"/")).toLocaleString(t,{weekday:"long",hour:"numeric",minute:"numeric",hour12:!0});return Az(n)}catch(n){console.log(n)}return null}function Kbe(e,t,n="short"){const s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].indexOf(e.toLowerCase());if(s===-1)return"";const o=new Date,a=new Date(o.setDate(o.getDate()-o.getDay()+s)),i=Intl.DateTimeFormat(t,{weekday:n}).format(a);return Az(i)}function Ybe(e){return e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:12})}function gvt(e,t,n){const r=typeof e=="string"?new URL(e):e,s=r.searchParams;return s.set(t,n),r.search=s.toString(),r.toString()}const Qbe=e=>{let t;if(typeof e=="string"){if(t=parseFloat(e),isNaN(t))throw new Error("Invalid input: not a number")}else if(typeof e=="number")t=e;else throw new Error("Invalid input: not a string or number");return t.toLocaleString("en-US")},Xbe=/\[(\d{1,3})(,\s*\{ts:\d+\})?\]/g,Zbe=/(\n*^(("""+|'''+|```+)[A-Za-z0-9]*|#+ .*)$|^- |\*\*|\$\$|\||`|[-|]{3,})/gm;function Jbe(e){return e.replace(Xbe,"")}function e_e(e){return e.replace(Zbe,"")}function sy(e,t){const n=Jbe(e_e(e)).trim();if(n.length<=t)return n;{const r=n.slice(0,t).trim(),s=r.lastIndexOf(" ");return s*2>t&&se?.startsWith(C3)??!1,n_e=[],r_e={isEnabled:!1,sbsVariations:n_e,isLoading:!1,error:null,incrementTriggerCount:()=>{},triggerCount:0},s_e="sbsMaxTriggerCntPerThread";function o_e(e,t,n,r,s,o,a,i,c,u){const{isPro:f,isMax:m,hasAccessToProFeatures:p}=e,{isEnterprise:h=!1}=t,g=f||m||h||p,y=f||m||p,x=s?.localeObj?.language||n?.language||null,v=r?.toLowerCase()||null,b=h?"ENTERPRISE":"INDIVIDUAL",_=typeof window<"u"&&window.navigator.userAgent.includes("Mobile");return{isPriority:g,isSubscribed:y,language:x,country:i,searchFocus:v,userCategory:b,isFollowUp:!!u,isMobile:_,appApiClient:"web",configuredModel:c,[s_e]:o,turnCount:a}}const a_e=e=>{try{if(!e||!e.side_by_side_config)return!1;const t=e.side_by_side_config;if(!t||typeof t!="object")return!1;const n=!!(t.experiment_flag&&typeof t.experiment_flag=="string"&&t.experiment_flag.length>0),r=!!(t.variations&&Array.isArray(t.variations)&&t.variations.length>0);return n||r}catch{return!1}},i_e=e=>{if(!e||!e.side_by_side_config)return[];const t=e.side_by_side_config;if(!t.experiment_flag||!t.variations||!Array.isArray(t.variations))return[];if(t.variations.length===0)return[];const n=[],r=fa(),s=t.experiment_flag;let o=!1;return t.variations.forEach(a=>{if(!a||!a.identifier)return;const i=a.is_control===!0;i&&(o=!0);const c=i?`${C3}${s}:${a.identifier}`:`${s}:${a.identifier}`,u={[s]:a.attributes_override??{}};n.push({sibling_uuid:r,experiment_role:c,experiment_override:u})}),!o&&Hi(n)&&(n[0].experiment_role=`${C3}${s}:${t.variations[0]?.identifier}`),n},n9=e=>{try{const t=_a.getItem(`${Nz}_${e}`);return t?parseInt(t,10):0}catch{return 0}},l_e=(e,t)=>{try{_a.setItem(`${Nz}_${e}`,t.toString())}catch{}};function c_e({frontendContextUUID:e,disableSideBySide:t=!1}){const n=zo(),{sources:r,configuredModel:s}=Fn();zye(r||[]);const{results:o}=an(),a=d.useMemo(()=>!o||o.length===0?1:z4(o).length+1,[o]),i=Bt(),c=mo({reason:"sbs-experiment-attributes"}),u=Xve({reason:"sbs-experiment-attributes"}),f=Wbe(),m=Ix(),{session:p}=je(),h=Nn()||!0;p?.user?.email?.endsWith("@perplexity.ai"),t=t||n===oe.STUDIO||n===oe.RESEARCH||h;const[g,y]=d.useState(()=>e?n9(e):0),x=e?o_e(i,c,u,n,f,g,a,m??null,s,e):{},{sideBySideOverrides:v,loading:b,error:_}=$be(e||"",x),w=_?String(_):null,S=a_e(v);d.useEffect(()=>{if(e){const E=n9(e);y(Math.max(0,E))}else y(0)},[e]),d.useEffect(()=>{S&&e&&g>0&&l_e(e,g)},[e,g,S]);const C=d.useCallback(()=>{S&&y(E=>Math.max(0,E+1))},[S]);return d.useMemo(()=>{if(t||!S||w)return r_e;const E=i_e(v);return{isEnabled:S,sbsVariations:E,isLoading:b,error:w,incrementTriggerCount:C,triggerCount:g}},[t,w,C,S,b,v,g])}const u_e=async(e,t,n,r)=>{const s=(o,a)=>{r(i=>i.filter(c=>t.some(u=>u.backend_uuid===c.backend_uuid)?c.backend_uuid===o.backend_uuid:!0).map(c=>c.backend_uuid===o.backend_uuid?{...c,side_by_side_metadata:c.side_by_side_metadata?{...c.side_by_side_metadata,selection_status:a}:void 0}:c))};try{const o=t.map((c,u)=>{let f;return e===e2?f=la.TIE:f=u===e?la.SELECTED:la.UNSELECTED,t0e({entryUUID:c.backend_uuid,params:f,siblingUUID:n,reason:"user-sbs-selection"}).catch(m=>{throw Z.error(`Failed to update selection for entry ${c.backend_uuid}:`,m),m})});await Promise.all(o);let a,i;if(e===e2?(a=Tz(t)[0],i=la.TIE):(a=t[e],i=la.SELECTED),!a)throw new Error("No target result found");s(a,i)}catch(o){throw Z.error("Failed to update entry selection:",o),o}},d_e=Object.freeze({}),Rf=({reason:e,enabled:t=!0,skipConnectorPickerCredentials:n=!0})=>{const{connectors:r}=Sa({reason:e,enabled:t,skipConnectorPickerCredentials:n}),s=d.useMemo(()=>r?.connectors?.length?r.connectors.reduce((o,a)=>(o[a.name]=a,o),{}):d_e,[r]);return d.useMemo(()=>({connectorsMap:s}),[s])},Rz=({reason:e,enabled:t=!0})=>{const{connectors:n,isLoading:r,isStale:s,refetch:o}=Sa({reason:e,enabled:t}),{connectorsMap:a}=Rf({reason:e,enabled:t}),i=d.useMemo(()=>(n?.connectors??[]).filter(f=>tR.includes(f.name)&&a[f.name]&&a[f.name].connected),[a,n]),c=d.useMemo(()=>(n?.connectors??[]).filter(f=>!tR.includes(f.name)&&a[f.name]&&a[f.name].connected),[a,n]),u=d.useMemo(()=>(n?.connectors??[]).filter(f=>a[f.name]&&a[f.name].connected),[a,n]);return d.useMemo(()=>({enabledFileConnectors:i,enabledNonFileConnectors:c,enabledConnectors:u,isConnectorsLoading:r,isConnectorsStale:s,refetchConnectors:o}),[u,i,c,r,s,o])},Dz=({reason:e})=>{const{connectors:t}=Sa({reason:e}),{connectorsMap:n}=Rf({reason:e}),r=d.useMemo(()=>(t?.connectors??[]).filter(o=>(o.name==="google_drive"||o.name==="onedrive"||o.name==="sharepoint"||o.name==="dropbox"||o.name==="box")&&!n[o.name]?.connected),[n,t]),s=d.useMemo(()=>(t?.connectors??[]).filter(o=>!n[o.name]?.connected),[n,t]);return d.useMemo(()=>({disabledFileConnectors:r,disabledConnectors:s}),[s,r])},f_e=({reason:e})=>{const t=Rz({reason:e}),n=Dz({reason:e});return d.useMemo(()=>{const r=k7([...t.enabledConnectors,...t.enabledFileConnectors,...t.enabledNonFileConnectors].map(o=>o.name)),s=k7([...n.disabledConnectors,...n.disabledFileConnectors].map(o=>o.name));return{enabled:r,disabled:s}},[t,n])},yvt=async({headers:e={},params:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/collections/list_user_collections",n,{params:{query:{limit:t.limit,offset:t.offset,version:Yl}},timeoutMs:Ze(),headers:e});if(s||!r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to list user collections",cause:s,status:o.status??0});return r},m_e=async({headers:e={},params:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/collections/get_collection",n,{params:{query:t},headers:e,timeoutMs:Ze()});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get collection",cause:s,status:o.status??0});if(!r?.status||r?.status==="failed")throw new ye("API_CLIENTS_ERROR",{message:"Failed to get collection",cause:r,status:o.status??0});return r}catch(r){Z.error(r);return}},p_e=async({headers:e={},params:t,reason:n})=>{try{const{error:r,response:s}=await de.PUT("/rest/collections/{collection_uuid}/access",n,{params:{path:{collection_uuid:t.collection_uuid}},headers:e,body:{updated_access:t.updated_access},timeoutMs:Ze()});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to update collection access",cause:r,status:s.status??0})}catch(r){Z.error(r)}},O0=async({params:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/collections/upsert_thread_collection",t,{body:e});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to upsert thread collection",cause:r,status:s.status??0});return n}catch{return}},r9=async({collectionUUID:e,entryUUID:t,reason:n})=>{try{const{error:r,response:s}=await de.DELETE("/rest/collections/remove_collection_thread",n,{params:{query:{collection_uuid:e,entry_uuid:t}}});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to remove thread from collection",cause:r,status:s.status??0})}catch{return}},W4=({collectionSlug:e,reason:t,enabled:n=!!e})=>{const r=async()=>e?await m_e({params:{collection_slug:e,version:Yl},reason:t})??null:null,{data:s,isLoading:o}=gt({enabled:n,queryKey:sa(e??""),queryFn:r,placeholderData:$l});return d.useMemo(()=>({collection:s??void 0,isLoading:o}),[s,o])},Vx=({reason:e,collectionSlugOverride:t,collectionUuidOverride:n})=>{const r=Ln(),s=iu(),{firstResult:o}=an(),a=o?.collection_info?.uuid,i=r?.includes("/search/")&&!!a,c=t??(Array.isArray(s?.slug)?s.slug[0]:s?.slug),{collection:u}=W4({collectionSlug:c,reason:e,enabled:!n}),f=d.useMemo(()=>{let m,p;return i?(m="COLLECTION",p=a??""):r?.includes("/collections")||r?.includes("/spaces")||r?.includes("/study-hub")?(m="COLLECTION",p=n||u?.uuid||""):(m="ORG",p=""),{file_repository_type:m,owner_id:p}},[i,r,a,n,u?.uuid]);return d.useMemo(()=>({fileRepoInfo:f}),[f])},G4=10,xvt=20,vvt=G4*41+46,S3=async({request:e,reason:t})=>{const{fileRepositoryInfo:n,limit:r,offset:s,searchTerm:o,fileStates:a,email:i}=e;try{let c;a.includes("COMPLETE")?c={file_repository_info:n,limit:r,offset:s??0,search_term:o,file_states_in_filter:a}:c={file_repository_info:n,limit:r,offset:s??0,search_term:o,file_states_in_filter:a,email_in_filter:[i]};const{data:u,error:f,response:m}=await de.POST("/rest/file-repository/list-files",t,{headers:{"content-type":"application/json"},body:c,timeoutMs:Ze(),numRetries:1});if(f)throw new ye("API_CLIENTS_ERROR",{cause:f,status:m.status??0});return{files:u?.files??[],numTotalFiles:u?.num_total_files??0}}catch(c){return Z.error(c),null}},h_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/get-file-upload-urls",t,{body:e,timeoutMs:5e3,numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get fileUploadUrl",cause:r,status:s.status??0});return n},bvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/list",t,{body:e,timeoutMs:Ze(),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get connector files",cause:r,status:s.status??0});return n},_vt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/delete",t,{body:e,timeoutMs:Ze(),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to delete connector files",cause:r,status:s.status??0});return n},wvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/resync",t,{body:e,timeoutMs:Ze(),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to resync connector files",cause:r,status:s.status??0});return n},g_e=async({request:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/uploads",t,{headers:{"content-type":"application/json"},body:e,timeoutMs:Ze(),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n??null}catch(n){return Z.error(n),null}};async function jz({request:e,reason:t}){return new Promise((n,r)=>{de.SSE("/rest/sse/index_files",t,{params:e,headers:{"content-type":"application/json",accept:"text/event-stream"},handlers:{message:s=>{s.status==="success"?n():r(new Error("Indexing failed"))}}}).catch(r)})}const Iz={keyProp:0,message:null,variant:"success",timeout:null,description:void 0,isVisible:!1,ctaText:void 0,ctaOnClick:void 0,openToast:()=>{},closeToast:()=>{}},Pz=zt("ToastStateContext",Iz),Oz=T.memo(({children:e})=>{const[t,n]=d.useState(Iz),r=d.useCallback(({message:a,variant:i,timeout:c,description:u,ctaText:f,ctaOnClick:m,handleClick:p,iconOverride:h,position:g="top"})=>{n(y=>({...y,message:a,variant:i,timeout:c,description:u,ctaText:f,ctaOnClick:m,handleClick:p,iconOverride:h,position:g??"top",isVisible:!0,keyProp:(y.keyProp||0)+1}))},[]),s=d.useCallback(()=>{n(a=>({...a,isVisible:!1}))},[]),o=d.useMemo(()=>({...t,openToast:r,closeToast:s}),[t,r,s]);return l.jsx(Pz.Provider,{value:o,children:e})});Oz.displayName="ToastStateProvider";const pn=()=>{const e=d.useContext(Pz);if(!e)throw new Error("useToastState must be used within ToastContext");return e},y_e=({fileRepoInfo:e,reason:t})=>{const{$t:n}=J(),r=Xt(),s=C4(e),{openToast:o}=pn(),{session:a}=je(),i=a?.user?.email??"",c=It({mutationFn:async u=>{if(!u.nextURL)throw new Error("File must have a url");const{data:f,error:m,response:p}=await de.POST("/rest/file-repository/move-attachment-to-persistent-file-path",t,{body:{file_repository_info:e,file_url:u.nextURL},timeoutMs:Sn.MEDIUM,retries:2});if(m||!f)throw new ye("API_CLIENTS_ERROR",{message:"Failed to save file persistently",cause:m,status:p.status??0});return await jz({request:{file_repository_info:e,file_index_params:[{file_s3_url:f.file_url_params.s3_object_url,file_size:u.file.size,filename:u.file.name,file_uuid:f.file_url_params.file_uuid,replace_existing:!1}]},reason:t}),f},onSuccess:(u,f)=>{const m={name:f.file.name,file_s3_url:u.file_url_params.s3_object_url,file_uuid:u.file_url_params.file_uuid,file_title:f.file.name,file_description:null,uploadedBy:i,date:new Date().toLocaleString(),state:"COMPLETE",size:f.file.size,isOptimistic:!0};r.setQueriesData({queryKey:s},h=>{if(!h)return h;const g=h.completedFiles||[];return{...h,completedFiles:[...g,m]}});const p=rh(e.owner_id,f.file.name);r.invalidateQueries({queryKey:p}),o({message:n({defaultMessage:"Saved file",id:"2HZW5WnkV3"}),variant:"success",timeout:3})},onError:(u,f)=>{o({message:n({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),Z.error("Error saving file with name",f.file.name,u)},onSettled:async()=>{await r.invalidateQueries({queryKey:s})}});return d.useMemo(()=>({saveFile:c.mutate,isLoading:c.isPending}),[c.isPending,c.mutate])},Lz=({fileRepoInfo:e,fileName:t,reason:n,enabled:r=!0})=>{const{session:s}=je();return gt({queryKey:rh(e.owner_id,t),refetchOnMount:!0,queryFn:async()=>((await S3({request:{fileRepositoryInfo:e,limit:G4,offset:0,searchTerm:t,fileStates:["COMPLETE"],email:s?.user?.email??""},reason:n}))?.files.length??0)>0,enabled:r&&e.file_repository_type==="COLLECTION"&&!!e.owner_id&&t.length>0})},x_e=async({entryUUIDs:e,rwToken:t,reason:n})=>{const{error:r,response:s}=await de.DELETE("/rest/thread",n,{body:{entry_uuids:e,read_write_token:t??""}});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to delete threads",cause:r,status:s.status??0})},v_e=async({entryUUID:e,rwToken:t,callback:n,reason:r})=>{n?.();const{error:s,response:o}=await de.DELETE("/rest/thread/delete_thread_by_entry_uuid",r,{body:{entry_uuid:e,read_write_token:t??""}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to delete thread",cause:s,status:o.status??0})},b_e=async({backendUUID:e,url:t,rwToken:n,reason:r})=>{if(!n)return;const{data:s,error:o,response:a}=await de.PUT("/rest/thread/entry/remove_widget",r,{timeoutMs:Ze(),body:{entry_uuid:e,read_write_token:n,url:t}});if(o)throw new ye("API_CLIENTS_ERROR",{message:"Error removing widget from entry",cause:o,status:a.status??0});return s},__e={box:"box",dropbox:"dropbox",gcal:"gcal",google_drive:"google_drive",linear:"linear",onedrive:"onedrive",outlook:"outlook",sharepoint:"sharepoint",zoom:"zoom"},Fz=e=>Object.keys(__e).includes(e),Bz=async({name:e,referrer:t,referrerId:n,redirectPath:r,redirectOrigin:s,unauthedRedirectPath:o,autoClose:a,reason:i})=>{try{const{data:c,error:u,response:f}=await de.GET(`/rest/connectors/${e}/connect`,i,{timeoutMs:Ze(),numRetries:1,reason:i,params:{query:{referrer:t,referrer_id:n,redirect_path:r,redirect_origin:s,unauthed_redirect_path:o,auto_close:a}}});if(u)throw new ye("API_CLIENTS_ERROR",{message:"Failed to initiate OAuth flow",cause:u,status:f.status??0});return c.redirect_url??null}catch(c){return Z.error("Error fetching factset OAuth redirect URL:",c),null}},s9=async({connectorName:e,reason:t,autoDeleteEmailAssistant:n=!1,connectionUUID:r})=>{const s=`disconnectConnector:${e}`;try{const{data:o,error:a,response:i}=await de.GET("/rest/connectors/{connector_id}/disconnect",t,{timeoutMs:Ze({productionMs:500}),numRetries:1,reason:t,params:{path:{connector_id:e},query:{auto_delete_email_assistant:n,connection_uuid:r}}});if(a)throw new ye("API_CLIENTS_ERROR",{message:"Failed to disconnect connector",cause:a,status:i.status??0});return o}catch(o){return Z.log(`Error in ${s}:`,o),null}},w_e=async({connectionUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/connections/{uuid}/update",t,{params:{path:{uuid:e}},body:{disconnect:!0}});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to disconnect file connector",cause:r,status:s.status??0});return n},C_e=async({connectionUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/connections/{uuid}/delete",t,{params:{path:{uuid:e}}});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to disconnect file connector and delete files",cause:r,status:s.status??0});return n},Cvt=async({connectorName:e,fileIds:t,fileRepoInfo:n,folder_ids:r=Ie,reason:s})=>{const{error:o,data:a,response:i}=e==="sharepoint"?await de.POST(`/rest/connectors/${e}/files`,s,{body:{file_ids:t,file_repository_info:n,drive_ids:r}}):await de.POST(`/rest/connectors/${e}/files`,s,{body:{file_ids:t,file_repository_info:n,folder_ids:r}});if(o)throw new ye("API_CLIENTS_ERROR",{cause:o,status:i.status??0});return a},S_e=async({reason:e})=>{const{data:t,error:n,response:r}=await de.POST("/rest/connectors/box/picker",e);if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to refresh box picker credentials",cause:n,status:r.status??0});return t},E_e=async({connectionType:e,content:t,reason:n})=>{const{data:r,error:s,response:o}=await de.POST("/rest/connectors/picker/log",n,{body:{connection_type:e,content:t}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed log connector picker",cause:s,status:o.status??0});return r},k_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/delete-files",t,{body:e});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to delete files",cause:r,status:s.status??0});return n};class $4 extends Error{constructor(){super("Downloads are disabled"),this.name="DownloadsDisabledError"}}class q4 extends Error{constructor(){super("PDF downloads are restricted"),this.name="PdfUntrustedOriginError"}}class K4 extends Error{constructor(){super("This file belongs to a different organization"),this.name="UserNotInFileOrgError"}}const Uz=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/download",t,{body:e,timeoutMs:2e3,numRetries:1});if(r){if(r.detail&&typeof r.detail=="object"&&"error_details"in r.detail){if(r.detail.error_details==="DOWNLOADS_DISABLED")throw new $4;if(r.detail.error_details==="PDF_UNTRUSTED_ORIGIN")throw new q4;if(r.detail.error_details==="USER_NOT_IN_FILE_ORG")throw new K4}throw new ye("API_CLIENTS_ERROR",{message:"Failed to download file",cause:r,status:s.status??0})}return n},M_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/download-attachment",t,{body:e,timeoutMs:2e3,numRetries:1});if(r){if(r.detail&&typeof r.detail=="object"&&"error_details"in r.detail){if(r.detail.error_details==="DOWNLOADS_DISABLED")throw new $4;if(r.detail.error_details==="PDF_UNTRUSTED_ORIGIN")throw new q4;if(r.detail.error_details==="USER_NOT_IN_FILE_ORG")throw new K4}throw new ye("API_CLIENTS_ERROR",{message:"Failed to download attachment",cause:r,status:s.status??0})}return n},Vz=e=>{const{accessLevel:t,enableWebByDefault:n,...r}=e;return{...r,access:t,enable_web_by_default:n}},T_e=async({collectionUuid:e,changes:t,reason:n})=>{const r=Vz(t),{data:s,error:o,response:a}=await de.POST("/rest/collections/edit_collection/{collection_uuid}",n,{params:{path:{collection_uuid:e}},body:r,timeoutMs:Ze()});if(o||!s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to edit collection",cause:o,status:a.status??0});const i=s,{access:c,...u}=i;return c!==void 0?{...u,accessLevel:c}:u},o9=async({params:e,reason:t})=>{const n=Vz(e);e.template_id&&(n.template_id=e.template_id);const{data:r,error:s,response:o}=await de.POST("/rest/collections/create_collection",t,{body:n,timeoutMs:Ze()});if(s||!r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to create collection",cause:s,status:o.status??0});return r},Svt=async({entryUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/entry/convert-to-report/{entry_uuid}",t,{params:{path:{entry_uuid:e}},timeoutMs:Ze()});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to convert entry to report",cause:r,status:s.status??0});return n},A_e=async({collectionUuid:e,reason:t})=>{const{error:n,response:r}=await de.DELETE("/rest/collections/delete_collection/{collection_uuid}",t,{params:{path:{collection_uuid:e}},timeoutMs:Ze(),numRetries:1});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to delete collection",cause:n,status:r.status??0})},N_e=async({contextUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/thread/mark_viewed/{context_uuid}",t,{params:{path:{context_uuid:e}},timeoutMs:Ze(),numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to mark thread as viewed",cause:r,status:s.status??0});return n},Evt=async({contextUUID:e,action:t,rwToken:n,reason:r})=>{const{data:s,error:o,response:a}=await de.POST("/rest/thread/reply/simulated",r,{body:{context_uuid:e,read_write_token:n,action:t},timeoutMs:Sn.HIGH});if(o)throw new ye("API_CLIENTS_ERROR",{message:"Error simulating turn",cause:o,status:a.status??0});if(!s)throw new ye("API_CLIENTS_ERROR",{message:"No data returned from reply simulated",status:0});const i={...s.message,parent_info:s.message.parent_info||{}};return{...s,message:i}},Hz={type:"remote_mcp",transport:"sse",source:"direct",status:"enabled"},kvt=async({request:e,reason:t})=>{const n={display_name:e.display_name,description:e.description,url:e.url,auth_type:e.auth_type,authorization_endpoint:e.authorization_endpoint??null,token_endpoint:e.token_endpoint??null,revocation_endpoint:e.revocation_endpoint??null,scope:e.scope??null,client_id:e.client_id??null,client_secret:e.client_secret??null,api_key:e.api_key??null,...Hz},{data:r,error:s,response:o}=await de.POST("/rest/connectors",t,{body:n,timeoutMs:Ze()});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to create remote MCP connector",cause:s,status:o.status??0});return r},Mvt=async({request:e,reason:t})=>{const n=new FormData,r={display_name:e.display_name,description:e.description,url:e.url,auth_type:e.auth_type,authorization_endpoint:e.authorization_endpoint??null,token_endpoint:e.token_endpoint??null,revocation_endpoint:e.revocation_endpoint??null,scope:e.scope??null,client_id:e.client_id??null,client_secret:e.client_secret??null,api_key:e.api_key??null,...Hz};n.append("request",JSON.stringify(r)),n.append("icon",e.icon_file);const{data:s,error:o,response:a}=await de.POST("/rest/connectors/with-icon",t,{body:n,timeoutMs:Ze()});if(o)throw new ye("API_CLIENTS_ERROR",{message:"Failed to create remote MCP connector with icon",cause:o,status:a.status??0});return s},R_e=({fileRepositoryType:e,offset:t,searchTerm:n,ownerId:r,reason:s})=>{const{$t:o}=J(),a=Xt(),i=iu(),{openToast:c}=pn(),u=uu(),f=b4(),m=S4(e,r,G4,t,n),p=rh(r),h=Array.isArray(i?.slug)?i.slug[0]:i?.slug,g=h?sa(h):void 0,y=e==="USER"||e==="ORG"||e==="COLLECTION"&&!!r;return{...It({mutationFn:async v=>{if(!y){c({message:o({defaultMessage:"Unable to delete files.",id:"QYfmPDehhb"}),variant:"error",timeout:3});return}return k_e({request:{file_uuids:v,file_repository_info:{file_repository_type:e,owner_id:r}},reason:s})},onMutate:async v=>{await a.cancelQueries({queryKey:m});const b=a.getQueryData(m);return b&&a.setQueryData(m,_=>({..._,completedFiles:_.completedFiles.filter(w=>!v.includes(w.file_uuid)),processingFiles:_.processingFiles.filter(w=>!v.includes(w.file_uuid)),failedFiles:_.failedFiles.filter(w=>!v.includes(w.file_uuid)),numTotalFiles:Math.max((_.numTotalFiles||0)-v.length,0)})),{previousData:b}},onSuccess:()=>{u&&a.invalidateQueries({queryKey:f}),a.invalidateQueries({queryKey:m}),h&&a.invalidateQueries({queryKey:g}),a.invalidateQueries({queryKey:p})},onError:(v,b,_)=>{_?.previousData&&a.setQueryData(m,_.previousData),c({message:o({defaultMessage:"Failed to delete file",id:"aJlra1/tgY"}),variant:"error",timeout:3})}}),isDeleteEnabled:y}},t2=async({fileRepositoryType:e,ownerId:t,limit:n,offset:r,searchTerm:s,email:o,reason:a})=>{const[i,c]=await Promise.all([S3({request:{fileRepositoryInfo:{file_repository_type:e,owner_id:t},limit:n,offset:r,searchTerm:s,fileStates:["COMPLETE"],email:o},reason:a}),S3({request:{fileRepositoryInfo:{file_repository_type:e,owner_id:t},limit:100,offset:0,searchTerm:"",fileStates:["PROCESSING","FAILED"],email:o},reason:a})]),u=f=>({name:f.filename,file_uuid:f.file_uuid,file_s3_url:f.file_s3_url??"",file_title:f.file_title,file_description:f.file_description,uploadedBy:f.uploaded_by,state:f.file_state,size:f.file_size??0,date:new Date(f.time_created).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"}),error:f.error??void 0,isOptimistic:!1});if(i||c){const f=i?.files?.map(u)||[],m=c?.files?.map(u)||[];return{completedFiles:f,processingFiles:m.filter(p=>p.state==="PROCESSING"),failedFiles:m.filter(p=>p.state==="FAILED"),numTotalFiles:i?.numTotalFiles||0}}return{completedFiles:[],processingFiles:[],failedFiles:[],numTotalFiles:0}},Tvt=({fileRepositoryType:e,limit:t,offset:n,searchTerm:r,ownerId:s,reason:o})=>{const a=Xt(),{session:i}=je(),c=i?.user?.email??"",{isEnterprise:u}=mo({reason:o}),f=!!(e==="COLLECTION"&&s||e==="ORG"&&u),m=S4(e,s,t,n,r),p=gt({queryKey:m,queryFn:()=>f?t2({fileRepositoryType:e,ownerId:s,limit:t,offset:n,searchTerm:r,email:c,reason:o}):Promise.reject(),enabled:f,placeholderData:$l,staleTime:300*1e3,gcTime:600*1e3});return d.useEffect(()=>{f&&(p.data?.numTotalFiles??0)>n+t&&a.prefetchQuery({queryKey:m,queryFn:()=>t2({fileRepositoryType:e,ownerId:s,limit:t,offset:n+t,searchTerm:r,email:c,reason:o}),staleTime:300*1e3,gcTime:600*1e3})},[m,f,a,e,t,n,r,p.data?.numTotalFiles,c,s,o]),p},Avt=({fileRepositoryType:e,limit:t,searchTerm:n,ownerId:r,reason:s})=>{const{session:o}=je(),a=o?.user?.email??"",{isEnterprise:i}=mo({reason:s}),c=!!(e==="COLLECTION"&&r||e==="ORG"&&i),u=S4(e,r,t,void 0,n,!0);return WU({enabled:c,initialPageParam:0,queryKey:u,queryFn:({pageParam:m})=>!c||m===void 0?Promise.reject():t2({fileRepositoryType:e,ownerId:r,limit:t,offset:m,searchTerm:n,email:a,reason:s}),getNextPageParam:(m,p)=>{const g=p.length*t+t;if(!(g>=m.numTotalFiles))return g}})},D_e=({initialIntervalMs:e,maxIntervalMs:t=6e4,timeoutMs:n=9e5})=>{const r=d.useRef(null);return{getInterval:()=>{if(r.current===null)return r.current=Date.now(),e;const a=Date.now()-r.current,i=Math.floor(a/6e4);if(a>=n)return!1;let c=e;for(let u=0;u{r.current=null}}},j_e=5e3,I_e=6e4,P_e=({reason:e,fileRepoInfo:t,enablePolling:n=!1,forceActivePolling:r=!1})=>{const s=Iye(t),{getInterval:o,reset:a}=D_e({initialIntervalMs:j_e}),{data:i}=gt({queryKey:s,queryFn:()=>g_e({request:{file_repository_info:t},reason:e}),refetchInterval:c=>{if(!n)return a(),!1;const{pending_files:u=0}=c.state.data?.summary??{};return u===0&&!r?(a(),I_e):o()},refetchIntervalInBackground:!1,staleTime:fpe(30)});return{total:i?.summary?.total_files??0,pending:i?.summary?.pending_files??0,errors:i?.summary?.error_files??0,uploads:i?.summary?.total_uploads??0}},O_e=({fileRepoInfo:e,reason:t,enablePolling:n=!0})=>{const{isMonitoryingFileRepository:r,getLocalProgress:s,clearLocalFileUploads:o}=qz(),a=Xt(),[i,c]=d.useState(!1),[u,f]=d.useState(0),[m,p]=d.useState(0),[h,g]=d.useState(0),{total:y,pending:x,errors:v}=P_e({enablePolling:n,forceActivePolling:r(e),fileRepoInfo:e,reason:t}),b=s(e),_=u+m,w=x+b.pending,S=v+b.errors,C=_-w;return d.useEffect(()=>{y>u&&f(y),b.total>m&&p(b.total),S>h&&g(S);const E=u>0||m>0,N=y===0,k=b.pending===0;E&&N&&k&&!i&&(c(!0),o(e),a.invalidateQueries({queryKey:OR()}),a.invalidateQueries({queryKey:OR(void 0,!0)})),i&&(y>0||b.pending>0)&&(c(!1),f(0),p(0),g(0))},[y,b.total,b.pending,S,u,m,h,i,a,e,o]),{total:_,pending:w,errors:h,uploaded:C,isFinished:i}},Y4={tension:700,friction:50},L_e={tension:300,friction:30},F_e=d.lazy(async()=>{const{animated:e,useTransition:t}=await q(async()=>{const{animated:r,useTransition:s}=await Promise.resolve().then(()=>y8);return{animated:r,useTransition:s}},void 0);function n({isVisible:r,children:s,className:o,onDestroyed:a}){return t(r,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{...Y4,clamp:!0},onDestroyed:a})((c,u)=>u?l.jsx(e.div,{style:c,className:o,children:s}):null)}return{default:n}});function B_e(e){return l.jsx(d.Suspense,{fallback:null,children:l.jsx(F_e,{...e})})}function zz(e){const[t,n]=d.useState(e),[r,s]=d.useState(e?"enter":"idle"),[o,a]=d.useState(!1);d.useLayoutEffect(()=>{e?t||(n(!0),s("enter")):t&&s("exit")},[e,t]),d.useLayoutEffect(()=>{r==="idle"&&!o&&a(!0)},[r,o]);const i=d.useCallback(()=>{r==="enter"?s("idle"):r==="exit"&&n(!1)},[r]);return{isPresent:t,animationState:r,isInitialEnter:r==="enter"&&!o,handleAnimationEnd:i}}d.lazy(async()=>{const{animated:e,useSpring:t}=await q(async()=>{const{animated:r,useSpring:s}=await Promise.resolve().then(()=>y8);return{animated:r,useSpring:s}},void 0);function n({isVisible:r,children:s,className:o}){const{isPresent:a,animationState:i,handleAnimationEnd:c}=zz(r),u=d.useRef(null),[f,m]=d.useState(null);d.useLayoutEffect(()=>{if(u.current&&a){const y=u.current.scrollHeight;m(y)}},[s,a]);const g=t({to:i==="exit"?{height:0,opacity:0}:{height:f??0,opacity:1},from:{height:0,opacity:0},immediate:!(f!==null),config:{...Y4,clamp:!0},onRest:c});return a?l.jsx(e.div,{style:{overflow:"hidden",position:"relative",...g},className:o,children:l.jsx("div",{ref:u,children:s})}):null}return{default:n}});const U_e=d.lazy(async()=>{const{animated:e,useSpring:t}=await q(async()=>{const{animated:s,useSpring:o}=await Promise.resolve().then(()=>y8);return{animated:s,useSpring:o}},void 0),n={top:{enter:{transform:"translateY(0px)"},exit:{transform:"translateY(-3px)"}},bottom:{enter:{transform:"translateY(0px)"},exit:{transform:"translateY(3px)"}},left:{enter:{transform:"translateX(0px)"},exit:{transform:"translateX(-3px)"}},right:{enter:{transform:"translateX(0px)"},exit:{transform:"translateX(3px)"}}};function r({isVisible:s,children:o,className:a,side:i="bottom"}){const{isPresent:c,animationState:u,isInitialEnter:f,handleAnimationEnd:m}=zz(s),p=n[i],h=t({to:u==="exit"?{...p.exit,opacity:0}:{...p.enter,opacity:1},from:{...p.exit,opacity:0},immediate:f,reset:u==="enter"&&!f,config:{...Y4,clamp:!0},onRest:m});return c?l.jsx(e.div,{style:{position:"relative",...h},className:a,children:o}):null}return{default:r}});function V_e(e){return l.jsx(d.Suspense,{fallback:null,children:l.jsx(U_e,{...e})})}const Hx={Fade:B_e,Slide:V_e},zx={transparent:"transparent",subtle:"subtle",subtler:"subtler",background:"background"},H_e="border-subtlest ring-subtlest divide-subtlest",K=T.memo(({variant:e=zx.transparent,className:t,onClick:n,onMouseOver:r,onMouseLeave:s,children:o,id:a,bgHover:i,style:c,testId:u,as:f="div",ref:m,noBorder:p,...h})=>{const g=T.useMemo(()=>{const y={transparent:"bg-transparent",super:"bg-super",superBorder:"border border-super",superLight:"bg-super/10",subtle:"bg-subtle",subtler:"bg-subtler",red:"bg-caution",background:"bg-base",underlay:"bg-underlay",offsetLoading:"bg-subtlest animate-pulse",textColor:"bg-inverse",orange:"bg-attention",raised:"bg-raised dark:bg-offset",raisedOffset:"bg-raisedOffset",max:"bg-max",maxBorder:"border border-max"},x={subtle:"md:hover:!bg-subtle",subtler:"md:hover:!bg-subtler",raisedOffset:"md:hover:!bg-raisedOffset",transparent:"md:hover:!bg-transparent",super:"md:hover:!bg-super"};return z(t,!p&&e!=="maxBorder"&&e!=="superBorder"&&H_e,i?"transition duration-normal":"",y[e]||y.transparent,i&&x[i]||"")},[i,t,e,p]);return T.createElement(f,{id:a,ref:m,className:g,onClick:n,onMouseOver:r,onMouseLeave:s,style:c,"data-testid":u,...h},o)});K.displayName="Box";const z_e={micro:"font-sans text-2xs font-normal",tiny:"font-sans text-xs font-medium",tinyRegular:"font-sans text-xs font-normal",tinyBold:"font-sans text-xs font-bold",extraSmall:"font-sans text-[13px]",small:"font-sans text-sm",smallBold:"font-sans text-sm font-medium",smallExtraBold:"font-sans text-sm font-extrabold",base:"font-sans text-base",baseSemi:"font-sans text-base font-medium",tinyMono:"font-mono text-2xs md:text-xs",smallMono:"font-mono text-sm",smallCaps:"text-2xs md:text-xs tracking-wide font-mono leading-none uppercase","section-title":"font-display text-lg font-medium","page-title":"font-display font-medium text-2xl",display:"font-display text-4xl lg:text-[2.8rem] !leading-[1.2]","entry-title":"font-display text-pretty text-xl lg:text-3xl font-medium","entry-title-100":"font-display text-pretty text-xl lg:text-3xl font-medium","entry-title-200":"font-display text-lg lg:text-xl font-medium","entry-title-300":"font-sans text-pretty font-medium"},W_e={default:"text-foreground",defaultInverted:"text-inverse",light:"text-quiet ",ultraLight:"text-quietest",red:"text-caution",yellow:"text-yellow-600 dark:text-yellow-400",super:"text-super",white:"text-white",positive:"text-positive",negative:"text-negative",max:"text-max"},G_e=(e,t,n)=>t||(e==="page-title"?"h1":e==="entry-title"?"h2":n?"span":"div"),$_e=(e,t,n,r,s)=>{const o=z_e[e],a=W_e[t];return z(s,o,a,n?"text-center block":"",r?"hover:text-super":"","selection:bg-super/50 selection:text-foreground dark:selection:bg-super/10 dark:selection:text-super")},V=T.memo(({children:e,variant:t="base",color:n="default",textCenter:r,className:s,inline:o,superHover:a,testId:i,as:c,ref:u,...f})=>{const m=d.useMemo(()=>G_e(t,c,o),[t,c,o]),p=d.useMemo(()=>$_e(t,n,r,a,s),[s,n,r,t,a]);return T.createElement(m,{className:p,"data-testid":i,ref:u,...f},e)});V.displayName="TextBlock";const q_e={[Gt.tiny]:"xs",[Gt.small]:"sm",[Gt.regular]:"base",[Gt.large]:"lg",[Gt.xl]:"xl",[Gt.none]:"base"},K_e={[Gt.tiny]:hl.xs,[Gt.small]:hl.sm,[Gt.regular]:hl.base,[Gt.large]:hl.lg,[Gt.xl]:hl.xl,[Gt.none]:hl.base},bp=T.memo(({icon:e,showClicked:t=!1,buttonSize:n,iconClassName:r})=>typeof e=="string"?l.jsx(ft,{name:t?B("check"):e,size:K_e[n],className:r}):l.jsx(ge,{icon:t?B("check"):e,size:q_e[n]||"base",className:r}));bp.displayName="BaseIcon";const Wz=T.memo(({className:e,textClassName:t,text:n,shortcut:r=Ie,...s})=>l.jsxs("div",{className:z("gap-x-sm bg-dark dark:border-subtler flex max-w-[280px] items-center rounded-md px-2 py-1.5 shadow-sm dark:border",e),...s,children:[typeof n=="string"?l.jsx(V,{variant:"tiny",color:"white",className:t,children:n}):n,r.length>0&&l.jsx("div",{className:"gap-xs flex",children:r.map(o=>l.jsx(V,{variant:"smallCaps",className:"border-subtlest bg-subtle px-xs py-two min-w-6 rounded border text-center shadow-sm",children:l.jsx("span",{className:"text-light",children:o})},o))})]}));Wz.displayName="TooltipBody";const Oo=T.memo(({tooltipText:e,tooltipLayout:t="top",tooltipAlign:n,children:r,keyboardShortcut:s,showTooltip:o=!0,className:a="",asChild:i=!1,testId:c,offset:u=8,closeOnClick:f=!0,bodyClassName:m,bodyTextClassName:p,arrowClassName:h,open:g,onOpenChange:y,delayDuration:x})=>o?l.jsxs(qU,{open:g,onOpenChange:y,delayDuration:x,children:[l.jsx(Lme,{children:l.jsxs(Fme,{side:t,align:n,sideOffset:u,className:z(t==="bottom"&&"data-[state=closed]:animate-slideUpAndFadeOut data-[state=delayed-open]:animate-slideDownAndFadeIn",t==="top"&&"data-[state=closed]:animate-slideDownAndFadeOut data-[state=delayed-open]:animate-slideUpAndFadeIn",t==="left"&&"data-[state=closed]:animate-slideRightAndFadeOut data-[state=delayed-open]:animate-slideLeftAndFadeIn",t==="right"&&"data-[state=closed]:animate-slideLeftAndFadeOut data-[state=delayed-open]:animate-slideRightAndFadeIn",a),onPointerDownOutside:f?void 0:b=>{b.preventDefault()},children:[l.jsx(Wz,{text:e,shortcut:s,"data-test-id":c,className:m,textClassName:p}),h&&l.jsx(Bme,{width:12,height:6,className:z("overflow-hidden translate-y-[-2px] [clip-path:inset(1px_1px_0px_1px)] fill-[oklch(var(--dark-background-base-color))] dark:stroke-[1.5px] dark:stroke-subtler",h)})]})}),l.jsx(Ume,{asChild:i,onClick:f?void 0:b=>{b.preventDefault()},children:r})]}):l.jsx(l.Fragment,{children:r}));Oo.displayName="TooltipWrapper";const Y_e=2e3,Q_e=1e3,a9={[Gt.tiny]:{height:"h-6",text:"text-xs",padding:"px-2",iconWrapperSize:"size-3.5",baselineShift:"-mb-px"},[Gt.small]:{height:"h-8",text:"text-sm",padding:"px-2.5",iconWrapperSize:"size-4",baselineShift:"-mb-px"},[Gt.regular]:{height:"h-10",text:"text-base",padding:"px-3",iconWrapperSize:"size-5",baselineShift:"mb-[-2px]"},[Gt.large]:{height:"h-14",text:"text-lg",padding:"px-5",iconWrapperSize:"size-7",baselineShift:"mb-[-3px]"}},Gz=e=>a9[e]||a9[Gt.regular],i9=({children:e,buttonSize:t=Gt.regular})=>l.jsx("div",{className:z("flex shrink-0 items-center justify-center",Gz(t).iconWrapperSize),children:e}),Q4=d.memo(e=>{const{text:t,textClassName:n="",size:r=Gt.regular,disabled:s=!1,fullWidth:o,fullWidthMobile:a,layout:i="center",type:c="button",noWrap:u=!0,onClick:f=Ro,onMouseDown:m,href:p,target:h,extraCSS:g,icon:y,iconClassName:x,pill:v=!1,noRounded:b=!1,toolTip:_,keyboardShortcut:w,tooltipLayout:S="top",tooltipProps:C,badge:E,chevron:N,isLoading:k,loadingVariant:I="spin",leadingComponent:M,trailingComponent:A,maxWidth:D,chevronIcon:P=B("chevron-down"),clickFeedback:F=!1,debounce:R=!1,testId:j,ariaLabel:L,variant:U,autoFocus:O,noPadding:$=!1,ref:G,...H}=e,[Q,Y]=d.useState(!1),[te,se]=d.useState(!1),[ae,X]=d.useState(s),ee=d.useMemo(()=>Gz(r),[r]);d.useEffect(()=>{X(R&&te||s)},[R,te,s]);const le=De=>{(!R||!te)&&(se(!0),setTimeout(()=>se(!1),Q_e),f(De)),F&&(Y(!0),setTimeout(()=>Y(!1),Y_e))},re=!!t,ce=d.useMemo(()=>z(g,"font-sans focus:outline-none outline-none outline-transparent transition duration-300 ease-out select-none items-center relative group/button font-semimedium",{"justify-center text-center items-center":i==="center","justify-start":i==="left","rounded-none":b,"rounded-lg":!v&&!b,"rounded-full":v&&!b,"cursor-default opacity-50":ae,"cursor-pointer active:scale-[0.97] active:duration-150 active:ease-outExpo origin-center":!ae,"whitespace-nowrap":u,"break-words":!u,"flex w-full":o,"inline-flex":!o&&!a,"flex w-full md:inline-flex md:w-auto":a,[ee.text]:!0,[ee.height]:!0,[ee.padding]:re,[v?"aspect-square":"aspect-[9/8]"]:!re&&!N&&!E&&!(y&&M)}),[E,ee,N,ae,g,o,a,re,y,i,M,b,u,v]),ue=d.useMemo(()=>z("flex items-center min-w-0 gap-two",{"flex-col":i==="stacked","justify-center":i==="center","justify-left":i==="left","justify-between":i==="split","w-full":o,"gap-sm":i==="stacked"}),[o,i]),pe=d.useMemo(()=>i==="stacked"||r===Gt.regular&&!re||r===Gt.large&&re?16:14,[i,r,re]),xe=l.jsxs("div",{className:ue,style:{maxWidth:D},children:[M&&l.jsx("div",{children:M}),k&&l.jsx(i9,{buttonSize:r,children:I==="spin"?l.jsx(ql,{size:pe}):I==="pulse"?l.jsx("div",{className:z("relative flex items-center justify-center",U==="primary"?"text-inverse":"text-super"),children:l.jsxs("div",{className:"relative scale-[0.8]",children:[l.jsx(bp,{icon:B("circle-filled"),buttonSize:r}),l.jsx(bp,{icon:B("circle-filled"),buttonSize:r,iconClassName:"duration-1200 absolute inset-0 animate-ping"})]})}):null}),!k&&y&&l.jsx(i9,{buttonSize:r,children:l.jsx(bp,{icon:y,showClicked:Q,buttonSize:r,iconClassName:x})}),t&&l.jsx("div",{className:z("relative truncate text-center",{"px-1":!$,"leading-loose":i!=="stacked","leading-none":i==="stacked"},ee.baselineShift,n),children:t}),E&&l.jsxs("span",{children:[" · ",E]}),N&&l.jsx(ge,{size:"xs",icon:P,className:"shrink-0 opacity-50"}),A]});let he;y&&!t&&_&&(he=_);const _e=d.useMemo(()=>({WebkitTapHighlightColor:"transparent"}),[]);let ke;return p!==void 0?ke=l.jsx(xt,{"data-testid":j,role:"button","aria-label":L??he,href:p,className:ce,target:h,onClick:f,onMouseDown:m,style:_e,...H,ref:G,children:xe}):ke=l.jsx("button",{"data-testid":j,"aria-label":L??he,type:c,disabled:ae,onClick:le,onMouseDown:m,className:ce,...H,ref:G,children:xe}),w||_?l.jsx(Oo,{tooltipText:_??"",keyboardShortcut:w,tooltipLayout:S,...C,asChild:!0,children:ke}):ke});Q4.displayName="ButtonBase";const rt=d.memo(({variant:e="common",noPadding:t,noXPadding:n,extraCSS:r,...s})=>{const o=d.useMemo(()=>z("focus-visible:bg-subtle",{"!p-0 !h-auto hover:!bg-transparent":t},{"!px-0 hover:!bg-transparent":n},{super:"hover:bg-subtle text-super dark:hover:bg-subtle",primary:"hover:bg-subtle text-foreground dark:hover:bg-subtle",common:"hover:bg-subtle text-quiet hover:text-foreground dark:hover:bg-subtle",positive:"text-quiet hover:bg-subtle hover:text-super",positiveSelected:"text-super hover:bg-subtle hover:text-super",negative:"text-quiet hover:bg-subtle hover:text-caution",negativeSelected:"text-caution dark:text-caution hover:bg-subtle hover:text-caution",noBackground:"text-quiet hover:text-foreground",noHover:"text-quiet cursor-default",subtle:"text-foreground bg-subtle"}[e],r),[r,e,t,n]);return l.jsx(Q4,{testId:s.testId,extraCSS:o,...s})});rt.displayName="TextButton";const Jl=T.memo(({children:e,portalTarget:t})=>{const[n,r]=d.useState(!1);return d.useEffect(()=>(r(!0),()=>r(!1)),[]),n?qh.createPortal(e,t||document.body):null});Jl.displayName="Portal";const Yc=T.memo(({keyProp:e=0,message:t,variant:n,description:r,ctaText:s,ctaOnClick:o,closeOnCtaClick:a=!0,isVisible:i=!1,timeout:c,handleClick:u,handleClose:f,onTimeout:m=Ro,position:p="top",iconOverride:h,...g})=>{const[y,x]=d.useState(i);d.useEffect(()=>{x(i)},[i]);const v=c!=null&&c>0;d.useEffect(()=>{let S;return i&&v&&(S=setTimeout(()=>{x(!1),m()},c*1e3)),()=>{clearTimeout(S)}},[y,c,i,m,v]);const b=d.useCallback(()=>{x(!1),f?.()},[f]),_=d.useCallback(()=>{o?.(),a&&b()},[o,b,a]),w=d.useMemo(()=>{if(h)return h;switch(n){case"success":return B("circle-check");case"error":return B("alert-circle");case"refresh":return B("refresh");case"warning":return B("alert-circle")}},[h,n]);return l.jsx(Jl,{children:l.jsx("div",{className:z(`right-toastHMargin erp-sidecar:top-[114px] fixed ${p==="top"?"top-toastVMargin":"bottom-toastVMargin"} z-30 flex items-center justify-center`,{"cursor-pointer":u}),children:l.jsx(Hx.Slide,{isVisible:y,side:"right",children:l.jsx("div",{...g,children:l.jsxs(K,{variant:"raised",className:z("gap-x-sm p-md shadow-overlay flex items-center rounded-lg",{"cursor-pointer":n==="refresh"}),onClick:u??Ro,children:[l.jsx(K,{variant:"subtler",className:"p-sm dark:bg-subtle rounded-md",children:l.jsx(V,{variant:"smallBold",color:n==="error"?"red":n==="warning"?"yellow":"super",children:l.jsx(Jt,{icon:w,size:"small"})})}),l.jsxs(K,{className:"flex-1",children:[l.jsx(V,{variant:"small",color:"default",children:t}),r&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"mt-1 whitespace-pre-line",children:r})]}),s&&o&&l.jsx(rt,{text:s,variant:"subtle",onClick:_,size:"small",extraCSS:"ml-xl"}),!v&&l.jsx(rt,{variant:"primary",size:"tiny",icon:B("x"),onClick:b,extraCSS:"ml-sm",noPadding:!0})]})},e)})})})});Yc.displayName="Toast";const X_e=({fileRepoInfo:e,collectionSlug:t,onClose:n})=>{const r="upload-progress-toast",{$t:s}=J(),o=Dn(),{total:a,pending:i,errors:c,isFinished:u}=O_e({fileRepoInfo:e,reason:r,enablePolling:!0}),f=s({defaultMessage:"See files",id:"p+DFrrlLh2"}),m=d.useCallback(()=>{switch(e.file_repository_type){case"USER":o.push("/account/files");break;case"ORG":o.push("/account/org/files");break;case"COLLECTION":if(!t){Wc.error("Collection slug is not set",{fileRepoInfo:e});return}o.push(`/spaces/${t}?showUploadModal`);break;default:Wc.warn("Unsupported file repository type",{fileRepoInfo:e})}},[e,o,t]);if(!a)return null;if(u){const y=s({defaultMessage:"{total, number} files synced",id:"1rpVYk4ZN/"},{total:a}),x=s({defaultMessage:"Ready to search",id:"n813XUWD4Q"});return l.jsx(Yc,{message:y,description:x,variant:"success",iconOverride:B("circle-check"),ctaText:f,ctaOnClick:m,isVisible:!0,handleClose:n,timeout:null})}const p=Math.round((a-i)/a*100),h=s({defaultMessage:"Syncing {total, plural, one {# file} other {# files}}",id:"bAaiOcNQKr"},{total:a}),g=isNaN(p)?"":c===0?s({defaultMessage:"{percentage, number}% complete",id:"1rUNFit3re"},{percentage:p}):s({defaultMessage:"{percentage, number}% complete with {errors, plural, one {# error} other {# errors}}",id:"WewISkdOck"},{percentage:p,errors:c});return l.jsx(Yc,{message:h,description:g,variant:"success",iconOverride:B("refresh"),ctaText:f,ctaOnClick:m,closeOnCtaClick:!1,isVisible:!0,handleClose:n,timeout:null})},ol=(e,t)=>e.file_repository_type===t.file_repository_type&&e.owner_id===t.owner_id,Z_e=e=>{const t=e.filter(s=>s.status==="uploading").length,n=e.filter(s=>s.status==="failed").length;return{total:e.length,pending:t,errors:n}},$z=zt("UploadProgressContext",null),qz=()=>{const e=d.useContext($z);if(!e)throw new Error("useUploadProgress must be used within an UploadProgressProvider");return e},Kz=T.memo(({children:e})=>{const[t,n]=d.useState([]),r=d.useCallback(({fileRepoInfo:x,collectionSlug:v})=>{n(b=>b.some(w=>ol(w.fileRepoInfo,x)&&w.collectionSlug===v)?b:[...b,{id:b.length+1,fileRepoInfo:x,collectionSlug:v,localFileUploads:[],progressBarVisible:!1}])},[]),s=d.useCallback(x=>{n(v=>v.filter(b=>b.id!==x))},[]),o=d.useCallback(x=>t.some(v=>ol(v.fileRepoInfo,x)),[t]),a=d.useCallback(({fileRepoInfo:x,visible:v})=>{n(b=>b.map(_=>ol(_.fileRepoInfo,x)?{..._,progressBarVisible:v}:_))},[]),i=d.useCallback(({fileRepoInfo:x,fileId:v})=>{n(b=>b.map(_=>ol(_.fileRepoInfo,x)?{..._,localFileUploads:[..._.localFileUploads,{fileId:v,status:"uploading"}]}:_))},[]),c=d.useCallback(x=>{n(v=>v.map(b=>ol(b.fileRepoInfo,x)?{...b,localFileUploads:[]}:b))},[]),u=d.useCallback(({fileRepoInfo:x,fileId:v,status:b})=>{n(_=>_.map(w=>{if(!ol(w.fileRepoInfo,x))return w;const S=w.localFileUploads.map(C=>C.fileId===v?{...C,status:b}:C);return{...w,localFileUploads:S}}))},[]),f=d.useCallback(({fileRepoInfo:x,fileId:v})=>{n(b=>b.map(_=>{if(!ol(_.fileRepoInfo,x))return _;const w=_.localFileUploads.filter(S=>S.fileId!==v);return{..._,localFileUploads:w}}))},[]),m=d.useCallback(x=>{const v=t.find(b=>ol(b.fileRepoInfo,x));return v?Z_e(v.localFileUploads):{total:0,pending:0,errors:0}},[t]),p=d.useMemo(()=>({startMonitoring:r,isMonitoryingFileRepository:o,setProgressBarVisible:a,addLocalFileUpload:i,updateLocalFileUploadStatus:u,removeLocalFileUpload:f,clearLocalFileUploads:c,getLocalProgress:m}),[r,o,a,i,u,f,c,m]),h=t.at(-1),g=h&&!h.progressBarVisible,y=d.useCallback(()=>{h?.id&&s(h.id)},[h?.id,s]);return l.jsxs($z.Provider,{value:p,children:[e,g&&h&&l.jsx(X_e,{fileRepoInfo:h.fileRepoInfo,collectionSlug:h.collectionSlug,onClose:y})]})});Kz.displayName="UploadProgressProvider";const Si="__temp__",l9=10,J_e=async(e,t)=>{const s=new FormData;Object.entries(t.fields).forEach(([a,i])=>{s.append(a,i)}),s.append("file",e);let o=null;for(let a=0;a<1;a++)try{a>0&&await new Promise(c=>setTimeout(c,2e3));const i=await fetch(t.s3_bucket_url,{method:"POST",body:s});if(Z.info("S3 upload response received",{fileUrl:t.s3_bucket_url,fileUuid:t.file_uuid,status:i.status,statusText:i.statusText,ok:i.ok}),!i.ok)throw new Error(`HTTP error ${i.status}: ${i.statusText}`);return}catch(i){o=i instanceof Error?i:new Error(String(i)),Z.error("S3 upload error",{fileUuid:t.file_uuid,attempt:a,errorMessage:o.message,errorName:o.name,errorStack:o.stack})}throw new Error(`UPLOAD_FAILED after 1 attempts: ${o?.message||"Unknown error"}`)},ewe=({fileRepoInfo:e,setTotalFilesUploading:t,replaceExisting:n,reason:r,onLocalFileUploadSuccess:s})=>{const{$t:o}=J(),a=Xt(),i=b4(),c=iu(),u=Array.isArray(c?.slug)?c.slug[0]:c?.slug,f=u?sa(u):void 0,{openToast:m}=pn(),{session:p}=je(),h=p?.user?.email??"",g=Sa({reason:r}),{addLocalFileUpload:y,updateLocalFileUploadStatus:x}=qz(),v=C4(e),b=be.makeQueryKey("list_file_directory_infinite",e.file_repository_type,e.owner_id),_=e.file_repository_type==="USER"||e.file_repository_type==="ORG"||e.file_repository_type==="COLLECTION"&&!!e.owner_id&&e.owner_id!==Si;return{...It({mutationFn:async S=>{if(!_){m({message:o({defaultMessage:"Unable to upload files.",id:"GrtfijFWiu"}),variant:"error",timeout:3});return}t(S.length);const C=new Map;S.forEach(E=>{const N=crypto.randomUUID();C.set(E.name,N),y({fileRepoInfo:e,fileId:N})});for(let E=0;E({filename:D.name,content_type:D.type,file_size:D.size})),file_repository_info:e},reason:r}),I=k.limits_reached[0];if(I==="FILE_REPOSITORY_LIMIT_EXCEEDED"){const D=g.connectorLimits?.repo_type_limits?.[e.file_repository_type].max_files??g.maxFilesPerRepository;m({message:o({defaultMessage:"You have reached the file limit of {limit} files per repository.",id:"J0uyf2gB1u"},{limit:D}),variant:"error",timeout:3});break}else if(I==="USER_FILE_LIMIT_EXCEEDED"){const D=g.maxFilesPerUser;m({message:o({defaultMessage:"You've reached your total file limit of {limit} files across My Files and all Spaces. Delete some files or upgrade your plan to add more",id:"3CuAQ4xs/C"},{limit:D}),variant:"error",timeout:3});break}const A=(await Promise.allSettled(k.file_url_params.map((D,P)=>D&&N[P]?{fileUploadUrlInfo:D,file:N[P]}:null).filter(D=>D!==null).map(async({fileUploadUrlInfo:D,file:P})=>{const F=C.get(P.name);try{return await J_e(P,D),Z.info("S3 upload completed successfully",{fileUuid:D.file_uuid}),{file_s3_url:D.s3_object_url,filename:P.name,file_size:P.size,file_uuid:D.file_uuid,replace_existing:n}}catch(R){F&&x({fileRepoInfo:e,fileId:F,status:"failed"});const j=R instanceof Error?{message:R.message,name:R.name,stack:R.stack}:{error:String(R)};throw Z.error("Upload promise caught error",{fileUuid:D.file_uuid,...j}),m({message:o({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),R}}))).filter(D=>D.status==="fulfilled").map(D=>D.value);if(Z.info("Starting file indexing",{fileCount:A.length,fileUuids:A.map(D=>D.file_uuid)}),A.length>0&&(await jz({request:{file_repository_info:e,file_index_params:A},reason:r}),A.forEach(D=>{const P=C.get(D.filename);P&&x({fileRepoInfo:e,fileId:P,status:"success"})})),k.limits_reached.length>0)break}},onMutate:async S=>{await a.cancelQueries({queryKey:v});const C=a.getQueryData(v),E=S.map(N=>({name:N.name,file_s3_url:"",file_title:null,file_description:null,file_uuid:crypto.randomUUID(),uploadedBy:h,state:"PROCESSING",size:N.size,date:new Date().toLocaleString(),isOptimistic:!0}));return a.setQueriesData({queryKey:v},N=>N&&{...N,processingFiles:[...N.processingFiles||[],...E]}),{previousData:C,optimisticFiles:E,uploadedFilesCount:S.length}},onError:(S,C,E)=>{m({message:o({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),E?.previousData&&a.setQueriesData({queryKey:v},E.previousData)},onSettled:()=>{a.invalidateQueries({queryKey:v}),a.invalidateQueries({queryKey:b}),a.invalidateQueries({queryKey:be.makeQueryKey(i3)}),a.invalidateQueries({queryKey:be.makeQueryKey(l3)}),e.file_repository_type==="ORG"&&a.invalidateQueries({queryKey:i}),u&&a.invalidateQueries({queryKey:f})},onSuccess:()=>{s?.()}}),isUploadEnabled:_}},twe=async({thread_uuid:e,format:t,filename:n,reason:r})=>{const{data:s,error:o,response:a}=await de.POST("/rest/thread/export",r,{body:{thread_uuid:e,format:t,filename:n},timeoutMs:Ze({productionMs:Sn.VERY_HIGH,clientSideMs:Sn.VERY_HIGH,devMs:Sn.VERY_HIGH})});if(o)throw new ye("API_CLIENTS_ERROR",{message:"Failed to export thread",cause:o,status:a.status??0});return s},Nvt=async(e,t)=>{const{error:n,response:r}=await de.PUT("/rest/thread/{entry_uuid_or_slug}","remove-thread-expiry",{params:{path:{entry_uuid_or_slug:e}},body:{expired:!1}});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to remove thread expiry",cause:n,status:r.status??0})},nwe=({fileRepoInfo:e,fileExists:t,reason:n})=>{const{openToast:r}=pn(),{session:s}=je(),o=d.useMemo(()=>s?.user?.email??"",[s]),a=Xt(),{mutate:i}=ewe({fileRepoInfo:e,setTotalFilesUploading:()=>1,replaceExisting:t,reason:n}),{mutateAsync:c}=R_e({fileRepositoryType:e.file_repository_type,offset:0,searchTerm:"",ownerId:e.owner_id,reason:n}),u=d.useCallback(async(m,p)=>{try{if(!m||!p)return;const h=await twe({thread_uuid:m,format:"md",filename:p,reason:n}),g=atob(h.file_content_64),y=new Array(g.length);for(let _=0;_{try{const h=(await t2({fileRepositoryType:e.file_repository_type,limit:10,offset:0,searchTerm:"",email:o,ownerId:e.owner_id,reason:n}))?.completedFiles.find(g=>g.name.includes(m??""));if(!h?.file_uuid)return;await c([h.file_uuid]),a.setQueryData(rh(e.owner_id,m),!1),r({message:"File removed from space",variant:"success",timeout:3})}catch(p){r({message:`Failed to remove from space: ${p}`,variant:"error",timeout:3})}},[c,r,a,e.owner_id,o,n,e.file_repository_type]);return d.useMemo(()=>({saveThreadToSpace:u,removeThreadFromSpace:f}),[f,u])},rwe=/^\/b\//;function Yz(e){return e&&rwe.test(e)}function swe(e){return e?new URL(window.location.href).pathname.endsWith(`/search/${e}`):!1}function owe(e){return e?.startsWith("/collections")||e?.startsWith("/spaces")}const Qz=({serverName:e,iconUrl:t,size:n="md",border:r=!1})=>t?l.jsx("img",{src:t,alt:`${e} Logo`,className:z("object-contain",n==="sm"&&"size-5",n==="md"&&"p-xs size-12",r&&"ring-subtlest rounded-md ring-1")}):l.jsx(ft,{name:B("box"),className:z(n==="sm"&&"size-4",n==="md"&&"p-xs size-12",r&&"ring-subtlest rounded-md ring-1")}),awe=()=>typeof window<"u"&&window.location?.origin?window.location.origin:"https://www.perplexity.ai",c9=e=>{const t=awe();return Fx(`${t}${e}`)?.href||`${t}${e}`},iwe=()=>[{id:"imessage",icon_url:c9("/static/mcpb/imessage.png"),download_url:c9("/static/mcpb/imessage_v0.0.10.mcpb"),manifest:{$schema:"https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",dxt_version:"0.1",name:"imessage",display_name:"Messages",version:"0.0.10",description:"Send and read messages using Apple's Messages app",long_description:`This tool lets Perplexity work with your Mac's Messages app. You can send messages, read messages, and ask Perplexity to help you understand what's important. - -It uses Mac system features to connect to Messages. Your Mac will ask for permission before it can access Messages or Contacts. This is not made by Apple.`,license:"MIT",author:{name:"Perplexity Inc",email:"support@perplexity.ai",url:"https://www.perplexity.ai/"},homepage:"https://www.perplexity.ai/",icon:"icon.png",tools:[{name:"list_contacts",description:'List contacts. When query is provided, search for contacts by name. Use it first to get a handle id, phone numbers, or emails. This tool is more preferred to be used first than "list_chats" tool. If this tool returns empty results, try to use "list_chats" tool to find a contact.'},{name:"list_chats",description:"List chats from Messages. When query is provided, search for chats by phone number (preferrable) or chat name (if phone number is not available)."},{name:"create_chat",description:"Create a new chat with a specific contact"},{name:"read_chat",description:"Read Messages from a specific chat"},{name:"send_imessage",description:"Send a Message to specific chat"}],server:{type:"node",entry_point:"server/index.js",mcp_config:{command:"node",args:["${__dirname}/server/index.js"],env:{HOME:"${HOME}"}}},compatibility:{comet:">=139.0.0",platforms:["darwin"],runtimes:{node:">=22.0.0"},permissions:{full_disk_access:!0,contacts:{for_tools:["list_contacts"]}}}}}],X4=()=>{const e=zn(),t=d.useMemo(()=>{if(!e.platformInfo)return;const{isMac:n,isWindows:r,isLinux:s}=e.platformInfo;if(n)return"darwin";if(r)return"win32";if(s)return"linux"},[e.platformInfo]);return gt({queryKey:be.makeQueryKey("comet/available_dxts",t),queryFn:async()=>iwe().filter(n=>n.manifest.compatibility?.platforms?t&&n.manifest.compatibility.platforms.includes(t):!0)})},Xz=(e,t)=>t.dxt_name?e?.find(n=>n.id===t.dxt_name)?.icon_url:void 0,Zz=e=>Object.fromEntries(Object.entries(e.compatibility?.permissions??{}).filter(([t,n])=>!!n).map(([t,n])=>typeof n=="object"?[t,n]:[t,{}])),E3=e=>Object.entries(Zz(e)).filter(([,{for_tools:t}])=>!t).map(([t])=>t),lwe=({cometState:e})=>d.useMemo(()=>{if(!e.installedDxts)return[];const t=e.installedDxts.flatMap(({manifest:n})=>E3(n));return Array.from(new Set(t))},[e.installedDxts]),cwe=Se(async()=>{const{AskPermissionsModal:e}=await Ee(()=>q(()=>import("./AskPermissionsModal-DLjsg8Od.js"),__vite__mapDeps([124,4,1,6,3,9,7,8,10,11,12])));return{default:e}}),Df=()=>{const e=zn(),{openModal:t}=Ho(),{data:n}=X4(),r=lwe({cometState:e}),s=ln(),o=pM({queries:r.map(v=>({queryKey:be.makeQueryKey("comet/permission",v),queryFn:()=>s.hasPermission(v)}))}).map(v=>v.data),i=d.useMemo(()=>{let v;return b=>(Hn(v,b)||(v=b),v)},[])(o),c=d.useMemo(()=>new Set(e.mcpStdioServers?.filter(v=>{const b=hp(e.installedDxts,v);return(b?E3(b):[]).some(S=>{const C=r.indexOf(S);return C!==-1&&i[C]===!1})}).map(v=>v.name)),[e.mcpStdioServers,e.installedDxts,r,i]),u=d.useMemo(()=>Object.fromEntries(e.mcpStdioServers?.map(v=>{const b=hp(e.installedDxts,v),_=Xz(n,v),w=b?.display_name??b?.name??v.name,S=c.has(v.name);return[v.name,{icon:void 0,avatar:l.jsx(Qz,{serverName:w,iconUrl:_,size:"sm"}),text:w,disabled:v.status!=="running"||!v.tools_count||S,description:"",type:"toggle",iconUrl:_}]})??[]),[e.mcpStdioServers,e.installedDxts,n,c]),f=d.useCallback((v,b)=>{if(!c.has(v)){b();return}const _=e.mcpStdioServers?.find(S=>S.name===v);if(!_)return;const w=hp(e.installedDxts,_);w&&t(cwe,{serverName:v,permissions:E3(w),onPermissionsGranted:b,legacyIdentifier:"__NONE__"})},[e.mcpStdioServers,e.installedDxts,c,t]),m=d.useCallback(v=>{const b=new Set(e.mcpStdioServers?.map(_=>_.name)??[]);v.forEach(_=>b.delete(_)),e.actions.setMcpDisabledServers(b)},[e.actions,e.mcpStdioServers]),p=d.useCallback(v=>{f(v,()=>{const _=e.mcpDisabledServers??new Set,w=new Set(_);_.has(v)?w.delete(v):w.add(v),e.actions.setMcpDisabledServers(w)})},[e.actions,e.mcpDisabledServers,f]),h=d.useCallback(v=>{f(v,()=>{const _=e.mcpDisabledServers??new Set,w=new Set(_);w.delete(v),e.actions.setMcpDisabledServers(w)})},[e.actions,e.mcpDisabledServers,f]),g=d.useCallback(v=>{const b=e.mcpDisabledServers??new Set,_=new Set(b);_.add(v),e.actions.setMcpDisabledServers(_)},[e.actions,e.mcpDisabledServers]),y=d.useMemo(()=>new Set([...e.mcpDisabledServers??[],...c]),[e.mcpDisabledServers,c]),x=d.useCallback(v=>v in u&&!y?.has(v),[u,y]);return d.useMemo(()=>({cometMcpSources:u,setCometMcpSources:m,toggleCometMcpSource:p,addCometMcpSource:h,removeCometMcpSource:g,hasCometMcpSource:x,cometMcpDisabledServers:y}),[u,m,p,h,g,x,y])},L0={startTime:-1,timer:Wa()},ju={startTime:-1,modules:new Set},Wx=zt("PerformanceContext",{markTTV:()=>{},addPageTiming:()=>{},getPageStartTime:()=>0,getPageTimer:()=>Wa(),addPageTimingOnce:()=>{}});function uwe({children:e}){const{startTimeFromTimeOriginRef:t}=Dn(),{markTTV:n}=Kfe(),r=d.useCallback(()=>(L0.startTime!==t.current&&(L0.startTime=t.current,L0.timer=Wa(void 0,{nowFromTimeOrigin:t.current})),L0.timer),[t]),s=d.useMemo(()=>({markTTV:()=>n(t.current),addPageTiming:(o,a={})=>r().addTiming(o,a),addPageTimingOnce:(o,a={})=>r().addTimingOnce(o,a),getPageStartTime:()=>t.current,getPageTimer:r}),[n,t,r]);return l.jsx(Wx.Provider,{value:s,children:e})}function Z4(){const{getPageStartTime:e}=d.useContext(Wx);return e}function dwe(){const{getPageTimer:e}=d.useContext(Wx);return e}const Jz=zt("PagePerformanceContext",{markTTV:()=>{}});function u9({children:e,modules:t}){const{markTTV:n,addPageTimingOnce:r,getPageStartTime:s}=d.useContext(Wx),o=s(),a=d.useCallback(c=>{t.includes(c)&&(ju.startTime!==o&&(ju.startTime=o,ju.modules=new Set),!ju.modules.has(c)&&(r(`web.ttv.${c}`),ju.modules.add(c),t.every(u=>ju.modules.has(u))&&n()))},[r,o,t,n]),i=d.useMemo(()=>({markTTV:a}),[a]);return l.jsx(Jz.Provider,{value:i,children:e})}function fwe(){const{markTTV:e}=d.useContext(Jz);return e}function jf(e,t={}){const n=fwe();d.useEffect(()=>{t.skip||n(e)},[n,e,t.skip])}function Gx(){const{isEnterprise:e}=mo({reason:"max-tier"}),{value:t,loading:n}=qt({flag:"max-upsell",defaultValue:!1,subjectType:"visitor_id",extraAttributes:{isEnterprise:e??!1}});return d.useMemo(()=>({isMaxUpsellEnabled:e?!0:t,loading:n}),[t,n,e])}function el(){const{firstResult:e}=an();return e?.read_write_token}const d9=(e,t,n)=>{e.addTimingOnce(t,{source:"comet_extension",...n})},eW=()=>{const e=Nn(),t=ln(),n=L4(),r=d.useCallback(s=>{const o=!!s.last_backend_uuid;return sn(s.model_preference)===oe.RESEARCH||(sn(s.model_preference),oe.STUDIO),(s.sources?.some(i=>i==="web")??!0)&&e&&!o&&!1},[e]);return d.useCallback((s,o,a)=>{if(!s||!r(o))return;const i=n(a);i&&(d9(i,"web.frontend.comet_navigation_request_sent_ms"),t.injectSearchResults(s,a,{},c=>{d9(i,"web.frontend.comet_navigation_results_received_ms",{count:c.count})}))},[t,r,n])},mwe="pplx_backend_flag_overrides",pwe=()=>{try{const e=hr(mwe);return e?JSON.parse(e):{}}catch{return{}}},hwe=e=>{try{return new URL(e),!0}catch{return!1}},gwe=({isCometBrowser:e,isMobile:t,isWindowsApp:n,clientPayloadUUID:r})=>e?{source:xV(),client_payload_cache_key:r}:{source:WS(t,n)},ywe=({inPageOverride:e,dslQuery:t,existingEntryUUID:n,existingUuid:r,deletedUrls:s,redoSearch:o,collection:a,isRelatedQuery:i,isSponsored:c,relatedQueryUUID:u,inDomain:f,inPage:m,newFrontendContextUUID:p,promptSource:h,querySource:g,timeFromFirstType:y,utmSource:x,disableWidgets:v,isNavSuggestionsDisabled:b,entropyBrowser:_,clientPayloadUUID:w,isIncognito:S,modelPreferenceSubmit:C,lastBackendUUID:E,deviceLocation:N,newAttachments:k,threadMetadataRwToken:I,forceNew:M,finalSources:A,finalRecency:D,mode:P,frontendUUID:F,isWindowsApp:R,isMobile:j,browserHistorySummaryNumDays:L,mentions:U,reason:O,side_by_side_metadata:$,skipSearchEnabled:G,browserHistorySummaryMaxResults:H,sidecarTabId:Q,sidecarUrl:Y,sidecarTitle:te,sidecarSecondaryTabId:se,sidecarSecondaryUrl:ae,sidecarSecondaryTitle:X,isFirstEntry:ee,alwaysSearchOverride:le,overrideNoSearch:re,cometIsMissionControl:ce,mcpTools:ue,refinementFiltersMetadata:pe,browserAgentAllowOnceFromToggle:xe,forceEnableBrowserAgent:he,inlineMode:_e,canonicalPageContext:ke})=>{const De=N?{location_lat:N.latitude,location_lng:N.longitude}:null,Be=Ml().erp,we=Ca(),$e=pwe();Object.keys($e).length>0&&Z.info("Sending backend flag overrides to API",{overrideCount:Object.keys($e).length,flagKeys:Object.keys($e),flagValues:$e});const yt=gwe({isCometBrowser:we,isMobile:j,isWindowsApp:R,clientPayloadUUID:w});let me=!1,ve="",Ae="",Ge,ht=!1,mt;ht=!0,mt=g==="followup"?"followup-sidecar":"sidecar";const Qe=_e;let Tt=S,Ye;if(we){Ye={rendering_place:Be,sidecar_tab_id:Q,sidecar_url:Y,sidecar_title:te,sidecar_secondary_tab_id:se,sidecar_secondary_url:ae,sidecar_secondary_title:X};const Me=EM(),Ve=_.isAgentAvailable();if(me=Ve&&!Me,Ve?Me&&Z.info("[comet] Local search disabled - incognito mode",{reason:"incognito_mode",frontendUUID:F}):Z.info("[comet] Local search disabled - agent not available",{reason:"agent_not_available",frontendUUID:F}),ee&&(Ae=_.getLastOmniboxInput(F)??"",Me||(ve=Ahe({entropyBrowser:_,browserHistorySummaryNumDays:L,browserHistorySummaryMaxResults:H,reason:O}))),g==="default_search"&&(hwe(Ae)&&(me=!1,mt="default_search",Z.info("[comet] Local search disabled due to URL input in omnibox",{lastOmniboxInput:Ae})),!Ae)){const ct=Fx(document.referrer);(!ct||ct.origin!==location.origin||ct.pathname!=="/.well-known/comet-omnibox-text"&&ct.pathname!=="/onboarding-comet")&&(me=!1,mt="default_search",Z.info("[comet] Local search disabled due to unsecure referer",{lastOmniboxInput:Ae,parsedReferrer:ct}))}}else g==="default_search"&&(Ge="external_url");return{last_backend_uuid:E??void 0,read_write_token:M?void 0:I,existing_entry_uuid:M?void 0:n,deleted_urls:s??void 0,attachments:k,language:tV(),timezone:bM,in_page:e??m,in_domain:f,search_focus:A.length===0?"writing":"internet",sources:A,search_recency_filter:D,frontend_uuid:r??F,redo_search:o,mode:P,target_collection_uuid:a?.uuid,model_preference:C??void 0,is_related_query:i??!1,is_sponsored:c??!1,related_query_uuid:u,frontend_context_uuid:p??void 0,prompt_source:h??void 0,query_source:mt??g??"",browser_history_summary_key:ve||void 0,is_incognito:Tt,time_from_first_type:y??void 0,local_search_enabled:me,use_schematized_api:!0,send_back_text_in_streaming_api:!1,supported_block_use_cases:OV,utm_source:x,client_coordinates:De,mentions:U,dsl_query:t,skip_search_enabled:G,is_nav_suggestions_disabled:b||ht,...g==="followup"?{followup_source:"link"}:{},...yt,...v?{disable_widgets:v}:{},always_search_override:le??!1,override_no_search:re??!1,comet_info:Ye,...$&&{side_by_side_metadata:$},client_search_results_cache_key:we&&F?`nav-${F}`:void 0,comet_is_mission_control:ce,mcp_tools:ue,risky_query_source:Ge,should_ask_for_mcp_tool_confirmation:!0,refinement_filters_metadata:pe,experiment_overrides:Object.keys($e).length>0?$e:void 0,browser_agent_allow_once_from_toggle:xe,force_enable_browser_agent:he,supported_features:["browser_agent_permission_banner_v1.1"],...Qe,canonical_page_context:ke}},xwe=async({reason:e})=>{try{const{data:t,error:n}=await de.POST("/rest/incentives/comet-activation",e,{timeoutMs:Ze()});if(n)throw n;return t}catch(t){return Z.error("Failed to handle comet activation incentive",t),null}},vwe=async({eventName:e,isDeferred:t,clickId:n,nextauthUserId:r,reason:s})=>{try{const{data:o,error:a,response:i}=await de.POST("/rest/attribution/dub/lead",s,{timeoutMs:Ze(),body:{event_name:e,is_deferred:t,click_id:n,nextauth_user_id:r}});if(a)throw new ye("API_CLIENTS_ERROR",{cause:a,status:i.status??0});return{success:o?.success??!1}}catch(o){return Z.error("Failed to save post install redirect",o),{success:!1}}},bwe=async({reason:e,flowType:t,trialExtensionId:n})=>{try{const{error:r,response:s}=await de.POST("/rest/attribution/comet/1mo-promo/mark-eligible",e,{timeoutMs:Ze(),body:{flow_type:t,trial_extension_id:n}});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){Z.error("Failed to mark user as eligible for Comet 1mo promo",r)}},_we=()=>_a.setItem("signUpBannerDismissed","reset"),wwe=2,Cwe=10,Swe=({response:e,isUserLoggedIn:t,submissionCount:n,session:r,queryCountMobile:s,isWindowsApp:o,addKeyRequiringRerender:a,setSubmissionCount:i,trackEvent:c,setShouldShowProductFeedback:u,setFeedbackEntryUUID:f,setShouldShowRecruitmentBanner:m,sendQueryEventSingular:p,maybeSendNthQueryEventSingular:h,recruitmentBannerEnabled:g,reason:y})=>{const x=Ca();if(x&&Yfe(t),e?.backend_uuid){const b=e.backend_uuid;Xge({entryUUID:e.backend_uuid,params:{query:e.query_str||"",sources:e.sources?.sources??[]},reason:y}).then(_=>{u(_),_&&c("query feedback shown",{entry_uuid:b})}),g&&e0e({entryUUID:b,reason:y}).then(_=>{m(_),_&&c("power user recruitment banner shown",{})}),f(b)}!t&&n===wwe-1&&(_we(),a("floating-signup")),t&&r?.user?.id&&s===0&&n===Cwe-1&&a("floating-mobile-download"),o?a("floating-milestone-refetch-legacy"):t&&a("floating-milestone-refetch"),i(n+1),p(),h({isCometBrowser:x});const v=RU();x&&v===1?(vwe({eventName:"activated",isDeferred:!1,clickId:null,nextauthUserId:r?.user?.id??null,reason:"comet attribution"}),xwe({reason:"comet activation incentive"}),c("first comet query finished",{})):x&&v===3&&c("third comet query finished",{})},Ewe="pplx.is-incognito";function J4(){const{value:e,setCookie:t}=DU(Ewe);return d.useMemo(()=>({isIncognitoLocal:e==="true",setIsIncognito:n=>{t(String(n))}}),[e,t])}const n2={DEFAULT:"DEFAULT",GOVERNMENT:"GOVERNMENT"},tW=({reason:e})=>{const{organization:t}=mo({reason:e}),{isGovernmentRequestOrigin:n}=Qr(),r=t?.settings?.always_incognito,{isIncognitoLocal:s}=J4(),o=r||(s??n??!1),a=n?n2.GOVERNMENT:n2.DEFAULT;return{isIncognito:o,incognitoType:a}},kwe=({inPage:e})=>e?window.getSelection()?.toString():void 0;function Mwe(){const{value:e}=qge({flag:"client-context-max-chars",subjectType:"visitor_id",defaultValue:5e4});return e}const Twe=(e,t,n)=>{const{value:r,loading:s}=c4({flag:"max-file-upload-count",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function eT(){const{variation:e}=Twe(10);return e}const Awe=({isFollowup:e,isInSameThread:t,sourcesOverride:n,firstResultSources:r,firstResultRecency:s,defaultSources:o,defaultRecency:a})=>n?{finalSources:n,finalRecency:a}:!e||!t?{finalSources:o,finalRecency:a}:{finalSources:Array.isArray(r)?r:[],finalRecency:s},Nwe=1e3*60*30,nW=()=>{const[e,t]=Qi("locationMetadata",void 0),n=d.useCallback((s,o)=>{t({location:s,permissionState:o,updatedAt:Date.now()}),s?(lo("lat",s.latitude.toString()),lo("long",s.longitude.toString())):(Qp("lat"),Qp("long"))},[t]),r=Date.now()-(e?.updatedAt??0)>Nwe;return d.useEffect(()=>{if(wt.removeItem("deviceLocation"),!navigator.geolocation||!("permissions"in navigator)||!r)return;const s=()=>{navigator.geolocation.getCurrentPosition(o=>{n({latitude:o.coords.latitude,longitude:o.coords.longitude},"granted")},()=>{n(void 0,"denied")},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})};navigator.permissions.query({name:"geolocation"}).then(o=>{o.state==="granted"?s():n(void 0,o.state),o.addEventListener("change",()=>{o.state==="denied"?n(void 0,"denied"):o.state==="granted"&&s()})}).catch(()=>{})},[n,t,r]),d.useMemo(()=>({location:e?.location,permissionState:e?.permissionState,isPreciseLocationEnabled:e?.permissionState==="granted"&&!isNaN(e?.location?.latitude??0)&&!isNaN(e?.location?.longitude??0)}),[e?.location,e?.permissionState])},_p=/(.*?)<\/q>/s;function $x(e){if(!e)return{quote:null,actualQuery:null};if(!_p.test(e))return{quote:null,actualQuery:e};const r=e.match(_p)?.[1]||null,s=e.replace(_p,"").trim();return{quote:r,actualQuery:s}}function Rwe(e,t){const n=t.trim();return n?_p.test(e)?e.replace(_p,`${n}`):e.length===0?n:`${n} ${e}`:e}const Dwe={submitQuery:()=>{Z.error("submitQuery must be used within PerplexityQueryStateProvider")},handleBotStep:()=>{Z.error("handleBotStep must be used within PerplexityQueryStateProvider")},deleteLastResult:()=>{Z.error("deleteLastResult must be used within PerplexityQueryStateProvider")},shouldShowProductFeedback:!1,shouldShowRecruitmentBanner:!1,feedbackEntryUUID:null,quote:null,setQuote:()=>{},updateLocalStatePostStream:()=>{}},jwe=3,Iwe=6,Pwe=2,rW=zt("PplxQueryStateContext",Dwe),Owe=(e,t,n,r,s)=>{if(!(n&&!r)&&!(e&&!t))return r?r.backend_uuid:s},Lwe=({children:e,shouldFetchSettings:t})=>{const n="perplexity-query-state-provider",r=Dn(),{session:s}=je(),{trackEvent:o}=Ke(s),a=ln(),{location:i}=nW(),[c,u]=d.useState(null),{device:{isWindowsApp:f,isMobile:m,isSamsungBrowser:p}}=on(),h=zo(),g=dwe(),{sources:y,recency:x,isCopilot:v,setAskInputReasoningMode:b,setAskInputReasoningModelPreference:_,configuredModel:w}=Fn(),{specialCapabilities:S}=Qr(),C=el(),{firstResult:E,lastResult:N}=an(),{setCurrentStreamId:k}=Ux(),{hasAiProfile:I,queryCountMobile:M}=Sa({enabled:t,reason:n}),[A,D]=d.useState(!1),[P,F]=d.useState(!1),[R,j]=d.useState(null),L=Vt(),{addKeyRequiringRerender:U}=u4(),{value:O}=qt({flag:"skip-search-button",subjectType:"visitor_id",defaultValue:!1}),$=Mwe(),{isIncognito:G}=tW({reason:n}),[H,Q]=d.useState(0),{sendQueryEventSingular:Y,maybeSendNthQueryEventSingular:te,sendResurrectedActivationEventSingular:se}=a4(),ae=zn(),{cometMcpDisabledServers:X}=Df(),ee=Nve(),{value:le}=Dx({flag:"power-user-recruitment-banner",defaultValue:!1}),{isMaxUpsellEnabled:re}=Gx(),{isMax:ce}=Bt(),{value:{max_results:ue,num_days:pe}}=Yge({flag:"browser-history-summary-settings",defaultValue:{max_results:500,num_days:7}}),xe=eT(),he=eW(),_e=d.useCallback(({rawQuery:we,dslQuery:$e,fork:yt,inPageOverride:me,copilotOverride:ve,existingEntryUUID:Ae,existingUuid:Ge,deletedUrls:ht,redoSearch:mt,attachments:Qe,collection:Tt,modelPreferenceOverride:Ye,isRelatedQuery:Me,isSponsored:Ve,relatedQueryUUID:ct,inDomain:vt,inPage:Dt,newFrontendContextUUID:ot,existingFrontendContextUUID:$t,promptSource:fn,querySource:ut,sourcesOverride:bt,submitFromArticleOverride:jt,timeFromFirstType:pt,utmSource:Kt,disableWidgets:ur,isNavSuggestionsDisabled:Xn,deviceLocation:_n,shouldRedirectToBackendUUID:nr,onThreadSlugReceived:Xr,incognitoOverride:Zo,mentions:uc=[],shouldUsePageStartTime:ds,side_by_side_metadata:fe,frontendUUID:Fe=crypto.randomUUID(),alwaysSearchOverride:Le,overrideNoSearch:dt,cometIsMissionControl:it,refinementFiltersMetadata:At,browserAgentAllowOnceFromToggle:Gn,forceEnableBrowserAgent:dr,canonicalPageContext:$n})=>{if(we.trim().length===0&&!c){Z.error("Submit failed: empty query");return}const Zn=uc.filter(en=>en.type==="tab").map(en=>({id:Number(en.id),url:en.url}));if(!L&&!p&&!S.unlimitedProSearch){const en=H+1;m&&!Vy()?en%Pwe===1&&U("visitor-gate"):en%Iwe===0?U("visitor-gate-ii"):en%jwe===0&&U("visitor-gate")}const Wr=!!ot,Ms=[...new Set([...Qe??[]])].slice(0,xe).filter(en=>!ht?.includes(en)),Su=!0,dc=Nn()&&Su,hm=dc?fa():void 0,_0=(ve??v)||Su,w0="copilot";let Zr=w??ie.DEFAULT;Zr===ie.DEFAULT&&S.unlimitedProSearch&&(Zr=ie.PRO),(h===oe.RESEARCH||h===oe.STUDIO||h===oe.STUDY)&&(Zr=h===oe.RESEARCH?ie.ALPHA:h===oe.STUDIO?ie.BETA:ie.STUDY,re&&ce&&(Zr=w));const fs=G0e.some(en=>en.is_reasoning_model&&en.search_model===Zr);Ye?Zr=Ye:(b(fs),fs||_(null));const Eu=Owe(Wr,yt??!1,E?.backend_uuid===Ae,jt??null,N?.backend_uuid??null);Qfe(),Xfe(()=>{o("resurrected activated"),se()}),sn(Zr)===oe.RESEARCH?Zfe():sn(Zr)===oe.STUDIO&&Jfe();const gi=!!Eu,yi=E?.frontend_context_uuid===$t,gm=Awe({isFollowup:gi,isInSameThread:yi,sourcesOverride:bt,firstResultSources:E?.sources?.sources,firstResultRecency:E?.search_recency_filter,defaultSources:y??[],defaultRecency:x??null}),{finalRecency:C0,finalSources:S0}=gm;let ym;ae.mcpTools&&(ym=Object.entries(ae.mcpTools).filter(([en])=>!X?.has(en)).flatMap(([en,Tu])=>{const A0=ae.mcpToolsSettings?.[en]??{};return Tu.filter(fc=>{const N0=fc.tool?.name??fc.id??"",vm=A0[N0];return vm?vm.enabled!==!1:!0})}));const E0=kwe({inPage:me??Dt})||c,ku=(E0?Rwe(we,E0):we).trim();if(!ku){Z.error("Submit failed: empty query");return}const xi=Ae==E?.backend_uuid||!Eu,k0=eve({rawQuery:ku,fork:yt,existingEntryUUID:Ae,existingUuid:Ge,collection:Tt,isRelatedQuery:Me,newFrontendContextUUID:ot,existingFrontendContextUUID:$t,submitFromArticleOverride:jt,isNavSuggestionsDisabled:Xn,isCopilot:_0,modelPreferenceSubmit:Zr,newAttachments:Ms,firstResultFrontendContextUUID:E?.frontend_context_uuid,isPersonalized:I,forceNew:Wr,querySource:ut,lastResultBackendUUID:N?.backend_uuid,finalSources:S0,finalRecency:C0??void 0,uuid:Fe,threadMetadataTitle:E?.thread_title,threadMetadataThreadUrlSlug:E?.thread_url_slug,side_by_side_metadata:fe}),Mu=ywe({redoSearch:mt,collection:Tt,dslQuery:$e,isRelatedQuery:Me,isSponsored:Ve,relatedQueryUUID:ct,inDomain:vt,inPage:Dt,newFrontendContextUUID:ot,promptSource:fn,querySource:ut,timeFromFirstType:pt,utmSource:Kt,disableWidgets:ur,isNavSuggestionsDisabled:Xn,isWindowsApp:f,isIncognito:Zo??G,modelPreferenceSubmit:Zr,clientPayloadUUID:hm,lastBackendUUID:Eu,deviceLocation:_n=_n??i,newAttachments:Ms,threadMetadataRwToken:C,forceNew:Wr,finalSources:S0,finalRecency:C0,mode:w0,frontendUUID:Fe,entropyBrowser:a,existingEntryUUID:Ae,deletedUrls:ht,browserHistorySummaryNumDays:pe,mentions:uc,side_by_side_metadata:fe,reason:n,skipSearchEnabled:O,browserHistorySummaryMaxResults:ue,sidecarTabId:ae.sidecarSourceTab.tabId,sidecarTitle:ae.sidecarSourceTab.title,sidecarUrl:ae.sidecarSourceTab.url,sidecarSecondaryTabId:ae.sidecarSourceTab.secondaryTab?.tabId,sidecarSecondaryUrl:ae.sidecarSourceTab.secondaryTab?.url,sidecarSecondaryTitle:ae.sidecarSourceTab.secondaryTab?.title,isFirstEntry:xi,alwaysSearchOverride:Le,overrideNoSearch:dt,cometIsMissionControl:it,mcpTools:ym,refinementFiltersMetadata:At,browserAgentAllowOnceFromToggle:Gn,forceEnableBrowserAgent:dr,canonicalPageContext:$n,inlineMode:void 0,isMobile:m});ot&&he(ku,Mu,Mu.frontend_uuid),u(null);const M0={params:{...Mu,version:Yl},query_str:ku};function T0(en){if(Xr){if(Yt.isStatusFailed(en))throw new Fl("STREAM_FAILED_FIRST_CHUNK_ERROR",{message:"failed status on first message",details:{request_id:en.frontend_uuid??"unknown",backend_uuid:en.backend_uuid}});if(!en.thread_url_slug)throw new Fl("STREAM_FAILED_FIRST_CHUNK_ERROR",{message:"thread_url_slug is required on first message",details:{request_id:en.frontend_uuid??"unknown",backend_uuid:en.backend_uuid}});Xr(en.thread_url_slug)}nr&&r.push(`/search/${en.thread_url_slug}`)}const xm=ee(M0,{onFirstMessageReceived:T0,placeholderChunk:{...k0,backend_uuid:Ae||tz},timer:ds?g():Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:n});dc&&hm&&mV({clientPayloadCacheKey:hm,cometBrowser:a,maxChars:$,attachedTabs:Zn,includeSidecar:Su,reason:n,cometState:ae,requestId:xm.id.description}),k(xm.id.description)},[c,L,p,S.unlimitedProSearch,xe,v,w,h,E?.backend_uuid,E?.frontend_context_uuid,E?.sources?.sources,E?.search_recency_filter,E?.thread_title,E?.thread_url_slug,N?.backend_uuid,y,x,ae,I,f,G,i,C,a,pe,O,ue,ee,g,k,H,m,U,re,ce,b,_,o,se,X,he,r,$]),ke=d.useCallback(we=>{Swe({response:we,isUserLoggedIn:L,submissionCount:H,session:s??void 0,queryCountMobile:M,isWindowsApp:f,addKeyRequiringRerender:U,setSubmissionCount:Q,setShouldShowProductFeedback:D,setShouldShowRecruitmentBanner:F,setFeedbackEntryUUID:j,trackEvent:o,sendQueryEventSingular:Y,maybeSendNthQueryEventSingular:te,recruitmentBannerEnabled:le,reason:n})},[U,L,f,M,Y,te,s,H,o,le]),De=V4(),Ce=gz(),Be=d.useCallback(async()=>{const we=N?.backend_uuid;!we||!C||(o("delete last result",{entryUUID:we}),await de.DELETE("/rest/entry/delete-ask-entry/{entry_uuid}",n,{params:{path:{entry_uuid:we}},body:{read_write_token:C}}),Ce(we),De($e=>{if(!$e)return;const yt=$e??[];if(yt.length<1){r.push("/",void 0,"Delete last result");return}return yt.slice(0,-1)}))},[N?.backend_uuid,C,o,De,Ce,r]);return l.jsx(rW.Provider,{value:{submitQuery:_e,deleteLastResult:Be,shouldShowProductFeedback:A,feedbackEntryUUID:R,quote:c,setQuote:u,shouldShowRecruitmentBanner:P,updateLocalStatePostStream:ke},children:e})},Wo=()=>{const e=d.useContext(rW);if(!e)throw new Error("usePerplexityQueryState must be used within PerplexityQueryStateContext");return e},tT="comet_mcp_";function Za(e){return e.startsWith(tT)}function If(e){return e.replace(tT,"")}function sW(e){return`${tT}${e}`}const nT=({enabled:e=!0}={})=>{const n=Sa({reason:"use-source-limits",enabled:e}),r=Xt(),s=d.useCallback(i=>{if(Za(i))return{monthlyLimit:1/0,remaining:1/0};const{monthly_limit:c=0,remaining:u=0}=n.sources.source_to_limit[i]??{};return{monthlyLimit:c??1/0,remaining:u??1/0}},[n.sources.source_to_limit]),o=d.useCallback(i=>{const{remaining:c=0}=s(i);return c===0},[s]),a=d.useCallback(async()=>{if(Object.values(n.sources.source_to_limit).some(({monthly_limit:c})=>c!==null)){if(!e){r.invalidateQueries({queryKey:cu()});return}await n.refetch()}},[n,e,r]);return d.useMemo(()=>({getSourceLimit:s,getSourceLimited:o,checkSourceLimits:a}),[s,o,a])};function ec(e){const t=d.useRef(void 0);return d.useEffect(()=>{t.current=e},[e]),t.current}const rT="pplx.activeQuery";function oW(){const e=_a.getItem(rT);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Fwe(e){_a.setItem(rT,JSON.stringify(e))}function Bwe(){_a.removeItem(rT)}const aW=Jh("QueryInputStateContext",()=>Xi(e=>({userInput:"",userInputJson:void 0,hasStartedTyping:!1,shouldTriggerFocus:!1,actions:{restoreInput:()=>{const t=oW();t.rawQuery&&e({userInput:t.rawQuery,userInputJson:t.rawQueryJson})},setUserInput:(t,n)=>{e({userInput:t,userInputJson:n}),Fwe({rawQuery:t,rawQueryJson:n})},setHasStartedTyping:t=>e({hasStartedTyping:t}),setStartTypingTime:t=>e({startTypingTime:t}),resetInput:()=>{e({userInput:"",userInputJson:void 0}),Bwe()},markInputAsSubmitted:()=>{e({userInput:"",userInputJson:void 0,startTypingTime:void 0})},setShouldTriggerFocus:t=>{e({shouldTriggerFocus:t})}}}))),Uwe=aW.Provider,Pf=aW.useSelector,iW=T.memo(()=>{const{setUserInput:e,resetInput:t}=qx(),n=Ln(),r=ec(n);return d.useLayoutEffect(()=>{const s=oW();s.rawQuery&&e(s.rawQuery,s.rawQueryJson)},[e]),d.useLayoutEffect(()=>{!r||r===n||r==="/"&&n?.startsWith("/search/new")||r.startsWith("/search/new")&&n?.startsWith("/search")||r.startsWith("/search/new")&&n==="/"||t()},[n,r,t]),null});iW.displayName="QueryInputSideEffects";const lW=()=>Pf(e=>e.userInput),cW=()=>Pf(e=>e.userInputJson),uW=()=>Pf(e=>e.hasStartedTyping),Vwe=()=>Pf(e=>e.startTypingTime),Hwe=()=>Pf(e=>e.shouldTriggerFocus),qx=()=>Pf(e=>e.actions);var as;(function(e){e[e.NONE=0]="NONE",e[e.READER=1]="READER",e[e.WRITER=2]="WRITER",e[e.EDITOR=5]="EDITOR",e[e.ADMIN=3]="ADMIN",e[e.OWNER=4]="OWNER",e[e.OWNER_DEFAULT_BOOKMARKS=6]="OWNER_DEFAULT_BOOKMARKS",e[e.INVITED_READER=11]="INVITED_READER",e[e.INVITED_WRITER=12]="INVITED_WRITER",e[e.INVITED_EDITOR=15]="INVITED_EDITOR",e[e.INVITED_ADMIN=13]="INVITED_ADMIN"})(as||(as={}));function zwe(){return[as.INVITED_READER,as.INVITED_WRITER,as.INVITED_EDITOR,as.INVITED_ADMIN]}function Rvt(e){return e===as.OWNER||e===as.OWNER_DEFAULT_BOOKMARKS}function Dvt(e){return e===as.OWNER_DEFAULT_BOOKMARKS}function jvt(e){return e>=as.WRITER&&e=as.READER&&e{const{DebugStreamSideEffects:e}=await Ee(()=>q(()=>import("./DebugStreamSideEffects-DuVqhbJP.js"),__vite__mapDeps([125,4,1,8,3,9,6,7,126,127,10,11,12])));return{default:e}},{restricted:!0}),dW=T.memo(function(){const t="stream-side-effects",n=Dn(),r=Nn(),{session:s}=je(),{trackEvent:o}=Ke(s),{$t:a}=J(),i=$U(globalThis.navigator?.userAgent),{sendNotification:c}=yz({windowsAppOnly:!1}),u=eW(),f=$ve(),{addKeyRequiringRerender:m}=u4(),p=Ml(),h=ln(),g=Io(),y=typeof window<"u"&&(window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants")),{fileRepoInfo:x}=Vx({reason:t}),{firstResult:v}=an(),b=v?.thread_url_slug,{data:_}=Lz({fileRepoInfo:x,fileName:b??"",reason:t}),{saveThreadToSpace:w}=nwe({fileRepoInfo:x,fileExists:_??!0,reason:t}),S=B4(),{resetInput:C,restoreInput:E}=qx(),N=lW(),k=d.useRef(N);k.current=N;const I=f_e({reason:t}),M=Xt(),A=Hve(),{updateLocalStatePostStream:D}=Wo(),{checkSourceLimits:P}=nT({enabled:!1}),F=zn();return d.useLayoutEffect(()=>sr.on("created",async({stream:R,query:j,params:L})=>{if(R.isReconnect||!j||!L)return;if(ry(L)&&L.side_by_side_metadata){const{experiment_role:$}=L.side_by_side_metadata;if(!t_e($))return}const U=Us(),O=R_(i,p.erp);j2e(R.id,{name:"perplexity_ask",queryStr:j,queryParams:L,isFollowup:ry(L)&&(L.query_source==="followup"||L.query_source==="followup-sidecar"||L.query_source==="followup-mobile-sidecar"),isPerplexityBrowser:r,frontendUUID:L.frontend_uuid??"",session:s??void 0,browserVersion:U?.browser_version,source:O,connectors:I,mentions:"mentions"in L?L.mentions:[],inlineAssistantAction:F.inlineAssistantParams.action}),h?.setTabProgress(!0),g&&h.sendThreadStatusToMobile({status:"working",streamId:R.id.description})}),[r,i,s,I,p.erp,h,g,F.inlineAssistantParams.action]),d.useLayoutEffect(()=>sr.on("progress",({stream:R,message:j})=>{const{blocks:L,status:U,telemetry_data:O}=j,$=L?.some(Q=>!!Q?.markdown_block?.chunks?.length),G=L?.some(Q=>!!Q?.web_result_block?.web_results?.length),H=L?.some(Q=>!!Q?.sources_mode_block?.rows?.length);if(O){const{has_displayed_search_results:Q,has_first_output_token:Y,has_first_token:te,has_widget_data:se,first_widget_type:ae,country:X,is_followup:ee,source:le,engine_mode:re,search_implementation_mode:ce,has_useful_renderable_content:ue,region:pe}=O,xe={country:X,is_followup:ee,source:le,engine_mode:re,search_implementation_mode:ce,region:pe};Q&&R.timer.addTimingOnce("web.frontend.first_search_results_latency_ms",xe),Y&&R.timer.addTimingOnce("web.frontend.first_output_token_latency_ms",xe),te&&R.timer.addTimingOnce("web.frontend.first_token_latency_ms",xe),se&&R.timer.addTimingOnce("web.frontend.first_widget_data_latency_ms",{...xe,first_widget_type:ae}),ue&&R.timer.addTimingOnce("web.frontend.first_useful_renderable_content_latency_ms",xe)}k2e(R.id,{hasLLMToken:$,hasSearchResults:G,hasSources:H},{id:s?.user?.id,subscription_status:s?.user?.subscription_status}),U===Pr.FAILED&&Z.error(new Fl("STREAM_FAILED_CHUNK_ERROR",{details:{request_id:R.id.description,backend_uuid:R.entryId??"unknown"}}),{message:j})}),[s?.user?.id,s?.user?.subscription_status]),d.useLayoutEffect(()=>sr.on("progress",({stream:R,isFirstMessage:j})=>{j&&R.placeholderChunk&&R.placeholderChunk.query_source&&!k.current&&C()}),[C]),d.useLayoutEffect(()=>sr.on("completed",({stream:R})=>{const j=Ml(),L=R_(i,j.erp);YR(R.id,{name:"SUCCESSFUL response",session:s??void 0,source:L})}),[s,i]),d.useLayoutEffect(()=>{const R=({thread:L,message:U})=>{U&&S(U,L)},j=[sr.on("progress",R),sr.on("completed",R),sr.on("error",R),sr.on("aborted",R)];return()=>{j.forEach(L=>L())}},[S]),d.useLayoutEffect(()=>sr.on("completed",({stream:R,thread:j})=>{if(!R.threadId||!R.entryId)return;const L=j?.find(O=>O?.uuid===R.id.description||O?.backend_uuid===R.entryId);let U;sn(L?.display_model)===oe.RESEARCH?U=a({defaultMessage:"Your report is ready",id:"CEIDgftq5U"}):sn(L?.display_model)===oe.STUDIO&&(U=a({defaultMessage:"Your project is ready",id:"UXOU5ST+Nc"})),$we({lastResponse:L,backend_uuid:R.entryId,trackEvent:o,sendNotification:c,notificationText:U,cometAdapter:h,isMissionControl:y})}),[a,o,c,h,y]),d.useLayoutEffect(()=>sr.on("completed",async({stream:R})=>{!b||!R.entryId||_&&await w(R.entryId,b)}),[_,w,b]),d.useLayoutEffect(()=>{const R=({stream:U})=>{const{id:O}=U,$=Ml(),G=R_(i,$.erp),Y=new URL(window.location.href).pathname.replace("/search/new/","");YR(O,{name:"FAILED response",session:s??void 0,source:G}),Y===O.description&&(E(),n.replace(`/?error=${Cd.ThreadStreamError}`,"StreamSideEffects")),h?.setTabProgress(!1)},j=sr.on("error",R),L=sr.on("aborted",R);return()=>{j(),L()}},[s,i,E,n,h]),d.useLayoutEffect(()=>sr.on("created",({query:R,params:j,stream:{isReconnect:L,id:U}})=>{if(!(!R||!j||L||!ry(j))){if(r){u(R,{model_preference:j.model_preference,last_backend_uuid:"last_backend_uuid"in j?j.last_backend_uuid:void 0,sources:j.sources,override_no_search:j.override_no_search},U.description);return}f({query:R,params:j,reason:"streamEvents.on(created)"})}}),[u,f,r]),d.useEffect(()=>{if(!r)return;const R=[sr.on("completed",({stream:j})=>{h.cleanupTasks(j.entryId,"stream_completed"),g&&h.sendThreadStatusToMobile({status:"ready",streamId:j.id.description})}),sr.on("aborted",({stream:j})=>{h.cleanupTasks(j.entryId,"stream_aborted"),g&&h.sendThreadStatusToMobile({status:"ready",streamId:j.id.description})}),sr.on("error",({stream:j,message:L})=>{(L&&!L.reconnectable||j.abortController?.signal.aborted)&&h.cleanupTasks(j.entryId,"stream_error"),g&&h.sendThreadStatusToMobile({status:"error",streamId:j.id.description})})];return()=>{R.forEach(j=>j())}},[h,g,r]),d.useEffect(()=>sr.on("completed",async({message:R,thread:j})=>{if(!R||(D(R),R.collection_info?.slug&&M.invalidateQueries({queryKey:_4(R.collection_info.slug),exact:!1}),A(),P(),swe(R.thread_url_slug)))return;const L=!!R.parent_info,U=j.findIndex(O=>O.uuid===R.uuid)>0;(L||!U)&&(m("floating-signup"),M.invalidateQueries({queryKey:Px(),refetchType:"all"}))}),[M,i,m,A,D,P]),null});dW.displayName="StreamSideEffects";const fW=T.memo(function(){const{pendingTasks:t,navigationMeta:n}=zn();return l.jsx(Gwe,{pendingTasks:t,navigationMeta:n})});fW.displayName="DebugStreamSideEffects";function $we({lastResponse:e,backend_uuid:t,trackEvent:n,notificationText:r,sendNotification:s,cometAdapter:o,isMissionControl:a}){if(!t)return Z.error(new Error("No backend_uuid found in response")),!1;if(!e)return Z.error(new Error("No last response found in query client")),!1;if((sn(e.display_model)===oe.RESEARCH||sn(e.display_model)===oe.STUDIO)&&r&&s&&document.visibilityState!=="visible"&&s({title:r,body:e.query_str,onClick:()=>{window.focus()}}),e.blocks){e.blocks.filter(c=>c.intended_usage?.endsWith("_markdown")).forEach(c=>{c.markdown_block?.media_items&&n&&c.markdown_block.media_items.forEach(u=>{n("inline image rendered",{image_url:u.image,entryUUID:t})})});const i=e.blocks.find(c=>c.intended_usage==="knowledge_cards")?.knowledge_card_block?.knowledge_cards?.[0];i&&n&&n("knowledge card in results",{entryUUID:t,name:i.title,id:i.id,type:i.card_type})}return o?.setTabProgress(!1),a||o?.showNotification(),!0}const mW=Jh("VoiceSessionStoreContext",()=>Xi(e=>({isActive:!1,setIsActive:t=>e({isActive:t})}))),qwe=mW.Provider,Kwe=()=>mW.useStore();function Ywe(){const e=Kwe();return d.useCallback(()=>e.getState().isActive,[e])}const pW=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"refresh-manager",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function Qwe(){if(typeof window>"u")return!1;const e=window;return!!(e?.webkit?.messageHandlers?.pplx?.postMessage||e?.Android?.pplx?.postMessage)}function hW({type:e,data:t}){if(typeof window>"u")return!1;const n=window,r={type:e,data:t};return n?.webkit?.messageHandlers?.pplx?.postMessage?(n.webkit.messageHandlers.pplx.postMessage(r),!0):n?.Android?.pplx?.postMessage?(n.Android.pplx.postMessage(r),!0):!1}function Xwe({query:e}){return hW({type:"pplx.ask",data:{query:e}})}const gW=zt("CanonicalPageContext",{inApp:!1,preferredColorScheme:null,deviceId:null,appVersion:null,isIOS:!1,isAndroid:!1,client:null}),Zwe=T.memo(({children:e,inApp:t})=>{const n=mn(),r=Ln(),s=n?.get("mobile.deviceId")||null,o=n?.get("mobile.appVersion")||null,a=n?.get("mobile.preferredColorScheme")||null,i=n?.get("mobile.client")||null,c=i==="ios",u=i==="android";return d.useEffect(()=>{if(!r?.startsWith("/app")||!n)return;const f=["mobile.","version"],m=new URL(window.location.href.replace("/app",""));m.searchParams.forEach((p,h)=>{f.some(g=>h.startsWith(g))&&m.searchParams.delete(h)}),m.searchParams.set("referrer","canonical"),hW({type:"pplx.url.share",data:{url:m.href}})},[r,n]),l.jsx(gW.Provider,{value:{inApp:t,preferredColorScheme:a,deviceId:s,appVersion:o,isIOS:c,isAndroid:u,client:i},children:e})});Zwe.displayName="CanonicalPageProvider";function Ea(){return d.useContext(gW)}const Sd={cacheName:{prefix:"pplx",suffix:"v2",runtime:"runtime",html:"html"}},Jwe=[Sd.cacheName.prefix,Sd.cacheName.html,Sd.cacheName.suffix].join("-"),eCe=[Sd.cacheName.prefix,Sd.cacheName.runtime,Sd.cacheName.suffix].join("-");async function yW(){if("serviceWorker"in navigator){await caches.delete(Jwe),await caches.delete(eCe);return}}const xW=1e3*60,L_=60*xW,tCe=xW/2,m9="internal-refresh",nCe={isOutdated:()=>!1,canRefresh:()=>!1,refresh:async()=>!1,channel:null},vW=zt("RefreshContext",{outdated:!1,refresh:async()=>!1,canRefresh:()=>!1,channel:null}),bW=T.memo(({children:e,enabled:t,buildVersion:n,ref:r})=>{const s=Fve(),o=Ywe(),{env:{isLocalhost:a}}=on(),i=d.useRef(n),c=d.useRef(!1),[u,f]=d.useState(0),m=d.useRef(null);m.current??=typeof BroadcastChannel<"u"?new BroadcastChannel(m9):null;const p=t&&c.current,h=d.useCallback(async()=>{try{const v=fV()?.comet_web_resources_extension_version;if(a||c.current||!t||!v)return;const b=v;if(Ll("build_version_refresh_check_version",{isCometSidecarClient:!0,currentVersion:n,latestVersion:b}),!n&&b){i.current=b;return}n&&b&&b!==n&&(c.current=!0,f(Date.now()+Math.random()*L_))}catch{Z.log("Error getting build version")}},[n,t,a]),g=d.useCallback(()=>!(!p||!u||document.hidden||s()||o()||Date.now(){if(!p||!u)return!1;if(!b&&!g())return!0;try{await yW()}catch{Z.log("Error clearing service worker runtime cache")}try{await GU()}catch{Z.log("Error clearing persisted cache")}return Ll("build_version_refresh"),m.current?.postMessage(m9),v?Do(v,"Build version refresh (redirect)"):gx("Build version refresh (reload)"),!1},[g,p,u]),x=d.useMemo(()=>Ef(h,tCe,{maxWait:L_,leading:!1,trailing:!0}),[h]);return d.useEffect(()=>{document.addEventListener("visibilitychange",x),window.addEventListener("focus",x),window.addEventListener("keydown",x),window.addEventListener("mousedown",x);const v=setInterval(h,L_);return()=>{document.removeEventListener("visibilitychange",x),window.removeEventListener("focus",x),window.removeEventListener("keydown",x),window.removeEventListener("mousedown",x),clearInterval(v)}},[x,h]),d.useEffect(()=>{const v=m.current;return()=>{v&&v.close()}},[]),d.useImperativeHandle(r,()=>({isOutdated:()=>p,canRefresh:()=>g(),refresh:async v=>await y(v),channel:m.current})),l.jsx(vW.Provider,{value:d.useMemo(()=>({outdated:p,refresh:y,canRefresh:g,channel:m.current}),[p,y,g]),children:e})});bW.displayName="RefreshProvider";const _W=()=>d.useContext(vW);var ea={},p9;function rCe(){if(p9)return ea;p9=1;var e=ea&&ea.__awaiter||function(s,o,a,i){function c(u){return u instanceof a?u:new a(function(f){f(u)})}return new(a||(a=Promise))(function(u,f){function m(g){try{h(i.next(g))}catch(y){f(y)}}function p(g){try{h(i.throw(g))}catch(y){f(y)}}function h(g){g.done?u(g.value):c(g.value).then(m,p)}h((i=i.apply(s,o||[])).next())})};Object.defineProperty(ea,"__esModule",{value:!0}),ea.identify=ea.subscribe=ea.publish=void 0;const t=(s,o)=>{window.todesktop.ipc.publish(s,o)};ea.publish=t;const n=(s,o)=>window.todesktop.ipc.subscribe(s,o);ea.subscribe=n;const r=()=>e(void 0,void 0,void 0,function*(){return window.todesktop.ipc.identify()});return ea.identify=r,ea}var h9=rCe();const lg=()=>{const{device:{isWindowsApp:e}}=on(),t=d.useRef({}),n=d.useRef({}),r=d.useCallback((o,a)=>{if(e)try{h9.publish(o,a)}catch{try{if(typeof BroadcastChannel<"u"){let c=t.current[o];c||(c=new BroadcastChannel(o),t.current[o]=c),c.postMessage(a)}else Z.warn("Neither IPC publish nor BroadcastChannel are available in this runtime")}catch(c){Z.warn("Error using BroadcastChannel: ",c)}}},[e]),s=d.useCallback((o,a)=>{if(e)try{return h9.subscribe(o,a)}catch{try{if(typeof BroadcastChannel<"u"){let c=t.current[o];c||(c=new BroadcastChannel(o),t.current[o]=c);let u=n.current[o];u||(u=new Set,n.current[o]=u);const f=m=>{a(m.data)};return u.add(a),c.addEventListener("message",f),()=>{c.removeEventListener("message",f),u.delete(a),u.size===0&&(c.close(),delete t.current[o],delete n.current[o])}}Z.warn("Neither IPC subscribe nor BroadcastChannel are available in this runtime");return}catch(c){Z.warn("Error using BroadcastChannel: ",c);return}}},[e]);return d.useMemo(()=>({safeWindowsIpcPublish:r,safeWindowsIpcSubscribe:s}),[r,s])},Kx=()=>{const{device:{isWindowsApp:e}}=on(),[t,n]=d.useState(void 0);return d.useEffect(()=>{e&&q(()=>import("./index-DxZN0OQK.js"),[]).then(r=>n(r))},[e]),t},wW=zt("WindowsAppPanelContext",null),sCe=({children:e})=>{const t=d.useRef(null),n=d.useRef(!1),r=Ln(),{device:{isWindowsApp:s}}=on(),[o,a]=d.useState(!1),i=Kx(),{safeWindowsIpcPublish:c,safeWindowsIpcSubscribe:u}=lg(),f=!!(s&&r?.includes(Jp));d.useEffect(()=>{if(!f)return;const x=u(eR,v=>{a(v)});return()=>{x?.()}},[f,u]);const m=d.useCallback(async()=>{if(!i)return;const x=await i.nativeWindow.isVisible({ref:t.current}),v=b=>{a(b),c(eR,b)};return v(x),i.nativeWindow.on("show",()=>v(!0),{ref:t.current}),i.nativeWindow.on("hide",()=>v(!1),{ref:t.current}),()=>{try{t.current&&(i.nativeWindow.removeAllListeners("show",{ref:t.current}),i.nativeWindow.removeAllListeners("hide",{ref:t.current}))}catch(b){Z.warn("Error removing window listeners during cleanup",b)}}},[t,i,c]),p=d.useCallback(async()=>{if(!i)return!1;if(n.current)return Z.info("Already creating window, skipping"),!1;if(t.current)try{return await i.nativeWindow.isVisible({ref:t.current}),Z.info("Existing window is still valid, skipping creation"),!0}catch{Z.warn("Existing window reference is invalid, will create new window"),t.current=null}try{Z.info("Starting panel window creation"),n.current=!0;const x=await i.nativeWindow.create({width:720,height:350,transparent:!0,show:!1,frame:!1,alwaysOnTop:!0,type:"panel"});if(!x)throw new Error("Failed to create window - no window reference returned");const v=await i.nativeWindow.getWebContents({ref:x});if(!v)throw new Error("Failed to get web contents");const b=await i.views.create({webPreferences:{nodeIntegration:!0,contextIsolation:!1}});if(!b)throw new Error("Failed to create view");await i.nativeWindow.setBrowserView({ref:x,viewRef:b});const _=new URL(Jp,window.location.origin).toString();await i.webContents.loadURL({ref:v},_),t.current=x;const w=await m();if(w){const S=t.current;i.nativeWindow.on("close",w,{ref:S})}return i.nativeWindow.on("close",()=>{},{ref:x,preventDefault:!0}),!0}catch(x){return Z.error("Error creating panel window: ",x),t.current=null,!1}finally{n.current=!1}},[m,i]),h=d.useCallback(async()=>{if(!i)return!1;try{if(!t.current)return Z.info("No panel window to hide"),!1;try{return await i.nativeWindow.hide({ref:t.current}),!0}catch(x){return Z.warn("Error hiding panel, window may be invalid",x),t.current=null,!1}}catch(x){return Z.warn("Error in hidePanel: ",x),!1}},[i]),g=d.useCallback(async()=>{if(i)try{if(t.current){if(o){Z.info("Panel window is already visible, skipping centering");return}}else if(!await p())return;const x=await i.screen.getCursorScreenPoint(),v=(await i.screen.getDisplayNearestPoint(x)).bounds,[b=0,_]=await i.nativeWindow.getSize({ref:t.current});await i.nativeWindow.setPosition({ref:t.current},Math.round(v.x+(v.width-b)/2),Math.round(v.y+v.height*.3)),await i.nativeWindow.show({ref:t.current}),await i.nativeWindow.focus({ref:t.current})}catch(x){Z.warn("Error showing panel: ",x)}},[p,o,i]),y={isVisible:o,isWindowsAppPanelView:f,handleShowPanel:g,handleHidePanel:h,createPanelWindow:p};return l.jsx(wW.Provider,{value:y,children:e})},Yx=()=>{const e=d.useContext(wW);if(!e)throw new Error("useWindowsAppPanel must be used within a WindowsAppPanelProvider");return e},oCe="pplx.hasUpdated",CW=T.memo(()=>{const{outdated:e,refresh:t}=_W(),{openToast:n}=pn(),{isWindowsAppPanelView:r}=Yx(),{inApp:s}=Ea(),{$t:o}=J(),a=Ca(),[i,c]=eme(oCe,!1),{variation:u,loading:f}=pW(!1),m=!f&&!u;return d.useEffect(()=>{i&&!r&&!s&&(c(!1),n({message:o({defaultMessage:"Updated to latest version",id:"5SFf7ytcaw"}),variant:"success",timeout:4}))},[]),d.useEffect(()=>{if(!m||!e)return;!a&&c(!0);let p=!1;return(async function h(){const g=await t();p||g&&(await new Promise(y=>setTimeout(y,60*1e3)),h())})(),()=>{p=!0}},[m,a,f,e,t,c]),null});CW.displayName="IdleRefresh";const aCe=1440*60*1e3,SW=T.memo(()=>{const{outdated:e,refresh:t,canRefresh:n,channel:r}=_W(),{openToast:s,closeToast:o}=pn(),{$t:a}=J(),[i,c]=d.useState(!1),u=e&&n(),{variation:f,loading:m}=pW(!1),p=!m&&f;return d.useEffect(()=>{},[r,e,p]),d.useEffect(()=>{if(!p||!i)return;const h=()=>{document.visibilityState==="visible"&&(o(),t(void 0,!0))};return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[o,t,i,p]),d.useEffect(()=>{if(!p||!u)return;const h=setTimeout(()=>s({variant:"refresh",message:a({defaultMessage:"Updates ready",id:"xk0yItSc/n"}),description:a({defaultMessage:"Click to update",id:"b3O/fzAfH4"}),handleClick:()=>t(void 0,!0),timeout:null}),aCe);return()=>clearTimeout(h)},[s,a,t,u,p]),null});SW.displayName="RefreshManager";var Tn;(function(e){e.MACOS="macos",e.WINDOWS="windows"})(Tn||(Tn={}));var Kn;(function(e){e.NEW_THREAD="NEW_THREAD",e.STOP_GENERATING="STOP_GENERATING",e.TOGGLE_INCOGNITO="TOGGLE_INCOGNITO",e.SHOW_SHORTCUTS="SHOW_SHORTCUTS",e.FOCUS_ASK_INPUT="FOCUS_ASK_INPUT",e.TOGGLE_DICTATION="TOGGLE_DICTATION",e.TOGGLE_V2V="TOGGLE_V2V"})(Kn||(Kn={}));const Lvt="keyboard-shortcuts",iCe=(e,t,n=!1)=>[{type:Kn.NEW_THREAD,label:e.formatMessage({defaultMessage:"New Thread",id:"76XSxT3hV8"}),macos:["⌘","K"],windows:t?["Ctrl","Shift","P"]:["Ctrl","I"],editable:!0,global:!0},{type:Kn.TOGGLE_V2V,label:e.formatMessage({defaultMessage:"Toggle Voice Mode",id:"ulahVrf1h4"}),macos:["⌘","Shift","B"],windows:["Ctrl","Shift","B"],editable:!0,global:!0,requiresAuth:!0,windowsAppOnly:!0},{type:Kn.TOGGLE_DICTATION,label:e.formatMessage({defaultMessage:"Toggle Voice Dictation",id:"tWip/8rlIv"}),macos:["⌘","D"],windows:["Ctrl","D"],editable:!1,windowsAppOnly:!0},{type:Kn.TOGGLE_INCOGNITO,label:e.formatMessage({defaultMessage:"Toggle Incognito",id:"YNMg3vd9IG"}),macos:["⌘",";"],windows:["Ctrl",";"],editable:!1},{type:Kn.SHOW_SHORTCUTS,label:e.formatMessage({defaultMessage:"Show Shortcuts",id:"8o6rUVckYq"}),macos:["⌘","/"],windows:["Ctrl","/"],editable:!1},{type:Kn.FOCUS_ASK_INPUT,label:e.formatMessage({defaultMessage:"Focus Ask Input",id:"RP5ybIk9wM"}),macos:["⌘","J"],windows:["Ctrl","J"],editable:!1}].filter(s=>(!s.requiresAuth||n)&&(!s.windowsAppOnly||t)),lCe={Meta:"⌘",Shift:"⇧",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Enter:"⏎",Period:".",Semicolon:";",Slash:"/",Escape:"Esc"},cCe={"⌘":"Meta","⇧":"Shift","↑":"ArrowUp","↓":"ArrowDown","←":"ArrowLeft","→":"ArrowRight","⏎":"Enter"},uCe=(e,t=Tn.MACOS)=>e==="Meta"?t===Tn.WINDOWS?"Win":"⌘":lCe[e]||e,g9=e=>e==="Win"?"Meta":cCe[e]||e,cg=({reason:e})=>{const{connectorsMap:t}=Rf({reason:e});return d.useMemo(()=>({isAllowed:n=>!!t[n],isConnected:n=>t[n]?.connected===!0,getConnectionType:n=>t[n]?.connection_type??null}),[t])},dCe=["web","scholar","social","edgar","org","my_files"],Wi=e=>dCe.includes(e),Qx={web:{type:"web",icon:B("world"),label:e=>e.formatMessage({defaultMessage:"Web",id:"B6CB3748fZ"}),description:e=>e.formatMessage({defaultMessage:"Search across the entire Internet",id:"L+Gw+J7uDs"})},scholar:{type:"scholar",icon:B("school"),label:e=>e.formatMessage({defaultMessage:"Academic",id:"mbxIJyT8C5"}),description:e=>e.formatMessage({defaultMessage:"Search academic papers",id:"IVRQQmrqTD"})},social:{type:"social",icon:B("social"),label:e=>e.formatMessage({defaultMessage:"Social",id:"qOLogguG/7"}),description:e=>e.formatMessage({defaultMessage:"Discussions and opinions",id:"g9xPuArp4v"})},edgar:{type:"edgar",icon:B("report-money"),label:()=>sge,description:e=>e.formatMessage({defaultMessage:"Search SEC filings",id:"7Xro7ObMcr"})},org:{type:"org",icon:B("files"),label:e=>e.formatMessage({defaultMessage:"Org files",id:"iWDsD738/m"}),description:e=>e.formatMessage({defaultMessage:"Search files from your organization",id:"Ak5CW53mGi"})},my_files:{type:"my_files",icon:B("file-export"),label:e=>e.formatMessage({defaultMessage:"My files",id:"bYbrKKlKgS"}),description:e=>e.formatMessage({defaultMessage:"Search my files",id:"EYmiG70whM"})}},fCe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"connectors-direct-api-search",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},mCe="BYPASS",pCe=()=>{const e=uu(),{variation:t}=fCe(!1,{connectionType:mCe}),n=d.useMemo(()=>({web:!0,scholar:!0,social:!0,edgar:!0,org:e,my_files:t&&e}),[e,t]),r=d.useCallback(s=>n[s],[n]);return d.useMemo(()=>({isAllowed:r}),[r])},r2=e=>{switch(e){case"GOOGLE_DRIVE":return LM;case"ONEDRIVE":return BM;case"SHAREPOINT":return VM;case"DROPBOX":return zM;case"BOX":return WM;case"WILEY":return rge;case"GCAL":return jV;case"NOTION_MCP":return GM;case"LINEAR":case"LINEAR_ALT":return $M;case"SLACK":return qM;case"SLACK_DIRECT":return KM;case"GITHUB_MCP_DIRECT":return YM;case"ASANA_MCP_DIRECT":return Ud;case"ASANA_MCP_MERGE":return Ud;case"ATLASSIAN_MCP_DIRECT":return QM;case"JIRA_MCP_MERGE":return ZM;case"CONFLUENCE_MCP_MERGE":return e4;case"MICROSOFT_TEAMS_MCP_MERGE":return n4;case"OUTLOOK":return FV;case"FACTSET":return kV;case"ZOOM":return s4;default:return""}},Of=e=>{switch(e){case"crunchbase":return MV;case"factset":return EV;case"wiley":return Bd;case"google_drive":return OM;case"onedrive":return FM;case"sharepoint":return UM;case"gcal":return Cx;case"dropbox":return HM;case"box":return Sx;case"gmail":return DV;case"notion_mcp":return Ex;case"outlook":return r4;case"linear":case"linear_alt":return kx;case"slack":case"slack_direct":return Mx;case"github_mcp_direct":return Tx;case"asana_mcp_direct":case"asana_mcp_merge":return Ax;case"atlassian_mcp_direct":return Nx;case"jira_mcp_merge":return XM;case"confluence_mcp_merge":return JM;case"microsoft_teams_mcp_merge":return t4;case"wiley_mcp_cashmere":return Bd;case"cbinsights_mcp_cashmere":return jM;case"pitchbook_mcp_cashmere":return IM;case"statista_mcp_cashmere":return PM;case"zoom":return o4;default:return null}};function Fvt(e){if(e===0)return"0 bytes";const t=1024,n=["bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.ceil(e/Math.pow(t,r))+" "+n[r]}const EW=e=>{if(!e)return;const t=e.lastIndexOf(".");if(!(t<=0||t===e.length-1))return e.substring(t+1).toLowerCase()},hCe=200,k3=(e,t={})=>{const{maxLength:n=hCe,replacement:r=" ",fallback:s="file"}=t;if(!e)return s;const o=e.lastIndexOf("."),a=o>0&&o|]/g,r).trim(),i||(i=s),i.length+c.length>n){const u=n-c.length;if(u>0)i=i.substring(0,u).trim();else return s+c}return i+c},Bvt=e=>{const t=e.file_metadata.file_type;return t==="FOLDER"||t==="DATABASE"||t==="WORKSPACE"||t==="PAGE"};function Uvt(e){const t=e.file_metadata.file_type;return t==="FOLDER"||t==="DATABASE"||t==="WORKSPACE"?B("folder-filled"):B("file")}const gCe=e=>{switch(e){case"GOOGLE_DRIVE":return OM;case"ONEDRIVE":return FM;case"SHAREPOINT":return UM;case"DROPBOX":return HM;case"BOX":return Sx;case"GCAL":return Cx;case"NOTION_MCP":return Ex;case"OUTLOOK":return r4;case"LINEAR":case"LINEAR_ALT":return kx;case"SLACK":case"SLACK_DIRECT":return Mx;case"GITHUB_MCP_DIRECT":return Tx;case"ASANA_MCP_DIRECT":case"ASANA_MCP_MERGE":return Ax;case"ATLASSIAN_MCP_DIRECT":return Nx;case"JIRA_MCP_MERGE":return XM;case"CONFLUENCE_MCP_MERGE":return JM;case"MICROSOFT_TEAMS_MCP_MERGE":return t4;case"ZOOM":return o4;default:return null}},yCe={crunchbase:"crunchbase",factset:"factset",wiley:"wiley",google_drive:"google_drive",onedrive:"onedrive",sharepoint:"sharepoint",gcal:"gcal",dropbox:"dropbox",box:"box",notion_mcp:"notion_mcp",outlook:"outlook",linear:"linear",linear_alt:"linear_alt",slack:"slack",slack_direct:"slack_direct",github_mcp_direct:"github_mcp_direct",asana_mcp_direct:"asana_mcp_direct",asana_mcp_merge:"asana_mcp_merge",atlassian_mcp_direct:"atlassian_mcp_direct",jira_mcp_merge:"jira_mcp_merge",confluence_mcp_merge:"confluence_mcp_merge",microsoft_teams_mcp_merge:"microsoft_teams_mcp_merge",wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere",zoom:"zoom",edgar:"edgar"},fu=e=>Object.keys(yCe).includes(e)||e==="gmail",M3=e=>{switch(e){case"crunchbase":return MV;case"factset":return EV;case"wiley":return Bd;case"google_drive":return OM;case"onedrive":return FM;case"sharepoint":return UM;case"gcal":return Cx;case"dropbox":return HM;case"box":return Sx;case"gmail":return DV;case"notion_mcp":return Ex;case"outlook":return r4;case"linear":case"linear_alt":return kx;case"slack":case"slack_direct":return Mx;case"github_mcp_direct":return Tx;case"asana_mcp_direct":case"asana_mcp_merge":return Ax;case"atlassian_mcp_direct":return Nx;case"jira_mcp_merge":return XM;case"confluence_mcp_merge":return JM;case"microsoft_teams_mcp_merge":return t4;case"wiley_mcp_cashmere":return Bd;case"cbinsights_mcp_cashmere":return jM;case"pitchbook_mcp_cashmere":return IM;case"statista_mcp_cashmere":return PM;case"zoom":return o4;default:return null}},Tc=e=>{switch(e){case"crunchbase":return nge;case"factset":return kV;case"google_drive":return LM;case"onedrive":return BM;case"sharepoint":return VM;case"gcal":return jV;case"dropbox":return zM;case"box":return WM;case"gmail":return oge;case"notion_mcp":return GM;case"outlook":return FV;case"linear":case"linear_alt":return $M;case"slack":return qM;case"slack_direct":return KM;case"github_mcp_direct":return YM;case"asana_mcp_direct":return Ud;case"asana_mcp_merge":return Ud;case"atlassian_mcp_direct":return QM;case"jira_mcp_merge":return ZM;case"confluence_mcp_merge":return e4;case"microsoft_teams_mcp_merge":return n4;case"wiley_mcp_cashmere":return TV;case"cbinsights_mcp_cashmere":return AV;case"pitchbook_mcp_cashmere":return NV;case"statista_mcp_cashmere":return RV;case"zoom":return s4;default:return e}},xCe=e=>{switch(e){case"GOOGLE_DRIVE":return LM;case"ONEDRIVE":return BM;case"SHAREPOINT":return VM;case"DROPBOX":return zM;case"BOX":return WM;case"NOTION_MCP":return GM;case"LINEAR":case"LINEAR_ALT":return $M;case"SLACK":return qM;case"SLACK_DIRECT":return KM;case"GITHUB_MCP_DIRECT":return YM;case"ASANA_MCP_DIRECT":return Ud;case"ASANA_MCP_MERGE":return Ud;case"ATLASSIAN_MCP_DIRECT":return QM;case"JIRA_MCP_MERGE":return ZM;case"CONFLUENCE_MCP_MERGE":return e4;case"MICROSOFT_TEAMS_MCP_MERGE":return n4;case"ZOOM":return s4;default:return""}},Vvt=(e,t)=>new Date(e+"Z").toLocaleString(t,{month:"numeric",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}),Hvt=(e,t,n)=>{switch(e){case"RECEIVED":case"QUEUED":case"RATE_LIMITED":return{label:t.formatMessage({id:"Cnm0QAkWnp",defaultMessage:"Queued"})};case"SYNCING":return{label:t.formatMessage({id:"eOnwqs6QFY",defaultMessage:"Syncing"})};case"EVALUATING_RESYNC":case"READY":return{label:t.formatMessage({id:"IZFEUgrg25",defaultMessage:"Ready"})};case"SYNC_ERROR":return vCe(n,t)}},vCe=(e,t)=>{if(!e)return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"An unknown error occurred while syncing this file",id:"FrOCoiVasC"})};switch(e){case"INVALID_FILE_SIZE":return{label:t.formatMessage({id:"fTNSna6r/X",defaultMessage:"File too large"}),description:t.formatMessage({defaultMessage:"File size exceeds the maximum allowed limit",id:"NTNLSYG0+u"}),suggestion:t.formatMessage({defaultMessage:"Try uploading a smaller file or contact support to increase your limit",id:"k2ucsfBcdH"})};case"INVALID_FILE_TYPE":return{label:t.formatMessage({id:"+FiyOTaUCW",defaultMessage:"Not supported"}),description:t.formatMessage({defaultMessage:"File type is not supported",id:"NMMfOTMPPN"}),suggestion:t.formatMessage({defaultMessage:"Check the list of supported file formats and convert your file if needed",id:"2zDaBv+l45"})};case"BAD_FILE":return{label:t.formatMessage({id:"+FiyOTaUCW",defaultMessage:"Not supported"}),description:t.formatMessage({defaultMessage:"File is corrupted or cannot be read",id:"2DRBESYiY3"}),suggestion:t.formatMessage({defaultMessage:"Try re-uploading the file or check if it opens correctly on your device",id:"XMnV6UR4G5"})};case"TOKEN_LIMIT_EXCEEDED":return{label:t.formatMessage({id:"t7EERfdOMB",defaultMessage:"Content too long"}),description:t.formatMessage({defaultMessage:"File content exceeds the token limit for processing",id:"S5ij+lXT2m"}),suggestion:t.formatMessage({defaultMessage:"Try splitting the file into smaller parts or contact support",id:"eu5ByuYBzE"})};case"FAILED_MODERATION":return{label:t.formatMessage({id:"+0cMy9/Uvq",defaultMessage:"Content policy violation"}),description:t.formatMessage({defaultMessage:"File content does not meet our content policy",id:"5+WSrKKHWX"}),suggestion:t.formatMessage({defaultMessage:"Review the file content and try again with appropriate content",id:"T+5YJmz9Uu"})};case"FILE_ALREADY_EXISTS":return{label:t.formatMessage({id:"rj9KIiC1cY",defaultMessage:"File already exists"}),description:t.formatMessage({defaultMessage:"A file with this name already exists",id:"v6hLP22U9C"}),suggestion:t.formatMessage({defaultMessage:"Rename the file or remove the existing file first",id:"lHS2xLoVfC"})};case"FAILED_TO_PARSE_FILE":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to process the file contents",id:"+JPkVmVP/P"}),suggestion:t.formatMessage({defaultMessage:"This is likely a temporary issue. Try resyncing the file.",id:"x2TrdA7gdq"})};case"FAILED_TO_INDEX_FILE":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to index the file for search",id:"VZXlZSjnzh"}),suggestion:t.formatMessage({defaultMessage:"This is likely a temporary issue. Try resyncing the file.",id:"x2TrdA7gdq"})};case"FILE_DOWNLOAD_ERROR":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to download the file from the source",id:"WQEt2fv0+0"}),suggestion:t.formatMessage({defaultMessage:"Check your connection permissions and try resyncing",id:"oMx/8oRlEl"})};case"RATE_LIMIT_RETRIES_EXCEEDED":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Rate limit exceeded after multiple retries",id:"x/gkqQmJpB"}),suggestion:t.formatMessage({defaultMessage:"Please wait a few minutes and try resyncing the file",id:"9178BZbGzP"})};case"AUTOSYNC_FAILED":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Automatic sync failed",id:"W/IGnlqOCp"}),suggestion:t.formatMessage({defaultMessage:"Try manually resyncing the file",id:"t77201iPJg"})};default:return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"An error occurred while syncing this file",id:"layd6ZWzub"})}}},kW=(e,t)=>{if(t==="WILEY")return r2(t);if(t||e.is_memory||e.is_conversation_history)return e.name&&e.name.trim()?e.name:void 0},MW=e=>e.isFile,TW=e=>e.isDirectory,bCe=async(e,t=zhe)=>{const n=[e],r=[];for(;n.length>0;){const s=n.pop();if(s){if(MW(s)){const o=await new Promise(a=>{s.file(a)});if(r.push(o),r.length>t)return r}else if(TW(s)){const o=s.createReader(),a=await new Promise(i=>o.readEntries(i));n.push(...a)}}}return r},_Ce=e=>e?e.toLowerCase().replace(/[\s-]/g,"_").replace(/([a-z])([A-Z])/g,"$1_$2").replace(/^_+|_+$/g,"").replace(/_+/g,"_"):"",AW=e=>e.replace(/_/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase()),sT=e=>{if(!e)return null;try{const t=parseInt(e,16);return String.fromCodePoint(t)}catch{return null}},wCe=(e,t=60)=>{if(e.length<=t)return e;const n="…",r=t-n.length,s=Math.ceil(r/2),o=Math.floor(r/2);return e.substring(0,s)+n+e.substring(e.length-o)},NW=({cometMcpSources:e})=>{const t=J();return d.useCallback(r=>{const s=AW(r);if(Wi(r))return Qx[r].label(t);if(Za(r)){const o=If(r);return e[o]?.text??o}return fu(r)?Tc(r)??s:s},[t,e])},CCe=(e,{getSourceLabel:t})=>e.sort((n,r)=>{const s=t(n),o=t(r);return s.localeCompare(o)}),SCe=e=>e.sort((t,n)=>{const r=Wi(t),s=Wi(n);return r&&!s?-1:!r&&s?1:0}),ECe=e=>e.sort((t,n)=>t==="web"&&n!=="web"?-1:t!=="web"&&n==="web"?1:0),kCe=["space","sports","my_files"];function RW(e){return kCe.includes(e)}const MCe=[CCe,SCe,ECe],oT=({isConnectorAllowed:e,omittedSources:t=[],omitCometMcpSources:n=!1})=>{const{cometMcpSources:r}=Df(),s=NW({cometMcpSources:r}),{isAllowed:o}=pCe(),a=d.useCallback(u=>{const f=If(u);return Object.keys(r).includes(f)},[r]),i=d.useCallback(u=>RW(u)||t.includes(u)?!1:Wi(u)?o(u):fu(u)?e(u):Za(u)?n?!1:a(u):(Wc.error(`[useSources] Unknown source type: ${u}`),!1),[e,a,o,t,n]),c=d.useMemo(()=>{const u=Object.keys(r).map(m=>sW(m)).filter(Za).filter(i),f=Object.keys(M4).filter(ga).filter(i);return MCe.reduce((m,p)=>p(m,{getSourceLabel:s}),[...f,...u])},[i,r,s]);return d.useMemo(()=>({sources:c,isSourceAllowed:i}),[c,i])};function ug({defaultSource:e,reason:t}){const{sources:n,setSources:r,setRecency:s}=Fn(),o=mn(),{fileRepoInfo:a}=Vx({reason:t}),{isLoading:i}=mo({reason:t}),{device:{isWindowsApp:c}}=on(),{safeWindowsIpcPublish:u,safeWindowsIpcSubscribe:f}=lg(),{isAllowed:m}=cg({reason:t}),{sources:p}=oT({isConnectorAllowed:m}),h=a.file_repository_type==="COLLECTION",g=h?`space-${a.owner_id}`:"home",y=iu(),x=Array.isArray(y?.slug)?y.slug[0]:y?.slug,{collection:v,isLoading:b}=W4({collectionSlug:x,reason:t}),_=b?void 0:v?.enable_web_by_default,w=d.useRef(f);d.useEffect(()=>{w.current=f},[f]);const S=d.useRef(Math.random().toString(36).substring(7)),C=d.useCallback(A=>{let D=[];return n?.includes(A)?(D=n.filter(P=>P!==A),A==="web"&&(n.includes("crunchbase")&&(D=n.filter(P=>P!=="crunchbase"&&P!=="web")),s?.(null))):(D=[...n||[]],A==="crunchbase"&&!D.includes("web")&&D.push("web"),D.push(A)),h&&N_(D,g),r(D),c&&u(yl,{type:yl,sources:D,windowId:S.current}),D},[h,g,r,s,n,c,u]),E=d.useCallback(A=>{n?.includes(A)||C(A)},[n,C]),N=d.useCallback(A=>{n?.includes(A)&&C(A)},[n,C]),k=d.useCallback(A=>n?.includes(A)??!1,[n]),I=d.useCallback(A=>{const D=[...A];D.includes("crunchbase")&&!D.includes("web")&&D.push("web"),h&&N_(D,g),r(D),c&&u(yl,{type:yl,sources:D,windowId:S.current})},[h,c,g,u,r]);d.useEffect(()=>{if(!c)return;const A=w.current(yl,D=>{D.type===yl&&D.windowId!==S.current&&r(D.sources)});return()=>{A?.()}},[c,r,n]);const M=d.useMemo(()=>{if(b)return new Set([]);if(h)return _?new Set(["web"]):new Set([]);if(e)return new Set([e]);const D=(o?.get("sources")??"web").split(",").map(P=>P.trim()).filter(ga);return new Set(D||["web"])},[h,b,_,o,e]);return d.useEffect(()=>{if(i)return;let A=h?l2e(g)||[...M]:[...M];if(h&&_&&!A.includes("web")?A.push("web"):h&&!_&&A.includes("web")&&(A=A.filter(P=>P!=="web")),JSON.stringify(n||[])!==JSON.stringify(A)){const P=A.filter(F=>p.includes(F));h&&N_(P,g),r(P)}},[i,h,_]),d.useMemo(()=>({DEFAULT_SOURCES:M,sources:n,isSpace:h,isSpaceEnableWebByDefault:_,toggleSource:C,setSources:r,addSource:E,removeSource:N,hasSource:k,overwriteSources:I}),[M,n,h,_,I,C,r,E,N,k])}const TCe=[];function DW({useThreadSources:e,reason:t="use-global-available-sources"}){const{sources:n,setSources:r}=ug({reason:t}),{cometMcpSources:s,cometMcpDisabledServers:o,setCometMcpSources:a}=Df(),{firstResult:i}=an(),c=i?.sources?.sources??TCe,u=d.useMemo(()=>e?c.filter(ga):n,[e,c,n]),f=d.useMemo(()=>{const g=Object.keys(s).filter(y=>!o?.has(y)).map(y=>sW(y));return[...u,...g]},[u,s,o]),m=d.useCallback(g=>{const y=g.filter(Za),x=g.filter(ga);a(y.map(v=>If(v))),r(x)},[r,a]),p=d.useCallback(g=>{f.includes(g)||m([...f,g])},[f,m]),h=d.useCallback(g=>{f.includes(g)&&m(f.filter(y=>y!==g))},[f,m]);return{sources:f,setSources:m,addSource:p,removeSource:h}}const ACe=({reason:e})=>{const{safeWindowsIpcPublish:t}=lg(),{device:{isWindowsApp:n}}=on(),r=Vt(),{isPro:s}=Bt(),{DEFAULT_SOURCES:o}=ug({reason:e}),a=Kx(),i=d.useRef(t),{setIsIncognito:c}=J4();d.useEffect(()=>{i.current=t},[t]);const u=d.useCallback(()=>{Do("/?voice-mode=true","Voice mode")},[]),f=d.useCallback(()=>{Do("/?v2v=true","V2V mode")},[]),m=d.useCallback(g=>{const y=g.searchParams,x=y.get("q"),v=y.get("incognito"),_=(y.get("sources")??"").split(",").map(C=>C.trim()).filter(ga),w=y.get("search_mode"),S=w?z0e[w]:void 0;v!==null&&c(v==="true"),_&&t(yl,{type:yl,sources:_}),S?.model&&S?.mode&&t(sd,{type:sd,model:S.model,searchMode:S.mode}),x&&i.current(IV,{query:x,promptSource:"user",querySource:"windows-app-shortcut",incognitoOverride:v,sourcesOverride:_??[]})},[t,c]),p=d.useCallback(g=>{const y=g.searchParams,x=y.get("type"),v=y.get("callback");if(!x||!v)return;const b=x.split(","),_=new URLSearchParams;b.forEach(S=>{switch(S){case"sources":_.set("sources",Array.from(o).join(","));break;case"search-modes":_.set("search-modes",Object.values(oe).join(","));break;case"sign-in":_.set("sign-in",r?"true":"false");break;case"subscription":_.set("subscription",s?"true":"false");break}});const w=`${v}?${_.toString()}`;window.open(w,"_blank")},[r,s,o]),h=d.useMemo(()=>new Map([["voice-mode",u],["v2v",f],["search",g=>m(g)],["request",g=>p(g)]]),[u,f,m,p]);d.useEffect(()=>{if(!n||!a)return;const g=a.app.on("openProtocolURL",(x,v)=>{const b=new URL(v.url);for(const[_,w]of h)if(b.toString().includes(_)){v.preventDefault(),w(b);break}}),y=async()=>{await(await g)()};return()=>{y()}},[n,h,a])},T3="keyboard-shortcuts",NCe=(e,t)=>{const n={[Kn.NEW_THREAD]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]},[Kn.STOP_GENERATING]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]},[Kn.TOGGLE_INCOGNITO]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]},[Kn.SHOW_SHORTCUTS]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]},[Kn.FOCUS_ASK_INPUT]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]},[Kn.TOGGLE_DICTATION]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]},[Kn.TOGGLE_V2V]:{[Tn.MACOS]:[],[Tn.WINDOWS]:[]}},r=iCe(e,t);[Kn.NEW_THREAD,Kn.TOGGLE_V2V].forEach(s=>{const o=r.find(a=>a.type===s);o&&(n[s]={[Tn.MACOS]:o.macos,[Tn.WINDOWS]:o.windows})});try{const s=wt.getItem(T3);if(s){const o=JSON.parse(s);[Kn.NEW_THREAD,Kn.TOGGLE_V2V].forEach(a=>{const i=o.find(c=>c.type===a);i&&(n[a]={[Tn.MACOS]:i.macos,[Tn.WINDOWS]:i.windows})})}}catch(s){Z.warn("Error reading keyboard shortcuts:",s)}return n},RCe=(e,t)=>Xi(n=>({globalShortcuts:NCe(e,t),setShortcut:(r,s,o)=>n(a=>{const i={...a.globalShortcuts,[r]:{...a.globalShortcuts[r],[s]:o}};try{const c=wt.getItem(T3),f=(c?JSON.parse(c):[]).map(m=>m.type===r?{...m,[s]:o}:m);wt.setItem(T3,JSON.stringify(f))}catch(c){Z.warn("Error saving keyboard shortcuts:",c)}return{globalShortcuts:i}})}));let F_=null;const A3=e=>{const{device:{isWindowsApp:t}}=on(),n=J();return F_||(F_=RCe(n,t)),F_(e)},DCe=()=>{const{handleShowPanel:e}=Yx(),t=A3(c=>c.setShortcut),n=Kx(),r=A3(c=>c.globalShortcuts),s=d.useCallback(async()=>{if(!n)return;const c=await jW();if(!c)return;await n.nativeWindow.show({ref:c}),await n.nativeWindow.focus({ref:c});const u=new CustomEvent("toggleVoiceToVoice");document.dispatchEvent(u)},[n]),o=d.useCallback(async(c,u)=>{try{const f=Array.isArray(c)?c.join("+"):c;let m;switch(u){case Kn.NEW_THREAD:m=e;break;case Kn.TOGGLE_V2V:m=s;break;default:return Z.warn(`No handler registered for shortcut type: ${u}`),!1}return f&&f.trim()!==""&&await n?.globalShortcut.unregister(f),await n?.globalShortcut.register(f,m),!0}catch(f){return Z.warn("Error registering shortcut:",f),!1}},[e,s,n]),a=d.useCallback(async(c,u,f)=>{try{const m=c.join("+"),p=u.join("+");if(m===p)return;m&&m.trim()!==""&&await n?.globalShortcut.unregister(m),await o(p,f)&&t(f,Tn.WINDOWS,u)}catch(m){Z.error("Error updating global shortcut:",m)}},[o,t,n]),i=d.useCallback(async c=>{const u=c.join("+");u&&u.trim()!==""&&await n?.globalShortcut.unregister(u)},[n]);return d.useMemo(()=>({shortcuts:r,registerShortcut:o,updateGlobalShortcut:a,unregisterShortcut:i}),[o,r,i,a])},jW=Sf(async()=>{const{object:e}=await q(async()=>{const{object:n}=await import("./index-DxZN0OQK.js");return{object:n}},[]);let t=await e.retrieve({id:"TJmK6yKBLiw389HLDdYy5"});return t||(t=await e.retrieve({id:"C195F2RyYDhfB93QW7vui"})),t}),jCe=({children:e})=>{const t="windows-app-provider-inner",{device:{isWindowsApp:n}}=on(),r=Ln(),s=n&&!r?.includes(Jp),{submitQuery:o}=Wo(),{isCopilot:a}=Fn(),{createPanelWindow:i,handleHidePanel:c}=Yx(),u=Vt(),f=Kx(),m=d.useRef(o),p=d.useRef(a),{safeWindowsIpcSubscribe:h}=lg();d.useEffect(()=>{m.current=o},[o]),ACe({reason:t}),d.useEffect(()=>{p.current=a},[a]);const{shortcuts:g,registerShortcut:y,unregisterShortcut:x}=DCe();d.useEffect(()=>{s&&(i(),c())},[s,i,c]);const v=d.useCallback(async b=>{const _=async(E=500)=>{const N=new AbortController,k=setTimeout(()=>N.abort(),E);try{const I=new Promise(M=>{f?.nativeWindow.isVisible().then(A=>{if(A){clearTimeout(k),M(!0);return}f?.nativeWindow.on("show",()=>{clearTimeout(k),M(!0)})})});return await Promise.race([I,new Promise(M=>{N.signal.addEventListener("abort",()=>M(!1))})])}catch(I){return Z.warn("Error ensuring window is ready",{error:I}),!1}finally{clearTimeout(k);try{f?.nativeWindow.removeAllListeners("show")}catch(I){Z.warn("Error removing show listeners during cleanup",I)}}},w=await jW();if(await f?.nativeWindow.show({ref:w}),await f?.nativeWindow.focus({ref:w}),!await _())return;const S=b.query.trim();if(!S?.trim())return;const C=fa();m.current({rawQuery:S,copilotOverride:p.current?!0:void 0,attachments:b.attachments,collection:null,newFrontendContextUUID:C,promptSource:b.promptSource??"user",querySource:b.querySource??"home",timeFromFirstType:b.timeFromFirstType,shouldRedirectToBackendUUID:!0})},[f]);return d.useEffect(()=>{if(!s)return;const b=h(IV,_=>{v(_)});return()=>{b?.()}},[s,v,h]),d.useEffect(()=>{if(!s)return;const b=[Kn.NEW_THREAD,...u?[Kn.TOGGLE_V2V]:[]];return b.forEach(_=>{const S=g[_][Tn.WINDOWS].map(g9);y(S,_)}),()=>{b.forEach(_=>{const S=g[_][Tn.WINDOWS].map(g9);x(S)})}},[y,s,g,u,x]),l.jsx(l.Fragment,{children:e})},ICe=({children:e})=>l.jsx(sCe,{children:l.jsx(jCe,{children:e})}),IW=T.memo(()=>{const{message:e,variant:t,description:n,ctaText:r,ctaOnClick:s,isVisible:o,timeout:a,handleClick:i,closeToast:c,position:u,iconOverride:f,keyProp:m}=pn(),p=d.useCallback(()=>{t==="refresh"&&i===void 0?window.location.reload():i&&i()},[t,i]);return l.jsx(Yc,{keyProp:m,isVisible:o,variant:t,message:e,description:n,ctaText:r,ctaOnClick:s,timeout:a,handleClick:p,onTimeout:c,position:u,iconOverride:f},m)});IW.displayName="Toasts";function PCe(e={}){const{isMobileStyle:t,isMobileUserAgent:n}=Re(),{isSidecarBuild:r="1",isInlineAssistantBuild:s=""}=e;return d.useMemo(()=>({isMobileStyle:r||s?!1:t,isMobileUserAgent:n}),[t,n,r,s])}const PW=T.memo(({children:e,colorScheme:t,logger:n,getSpriteUrl:r,renderModals:s})=>{const{isMobileStyle:o,isMobileUserAgent:a}=PCe();return l.jsx(Vme,{isMobileStyle:o,isMobileUserAgent:a,renderModals:s,logger:n,children:l.jsx(xpe,{src:r,children:l.jsx($V,{initialOverrideColorScheme:t,children:l.jsxs(Oz,{children:[e,l.jsx(IW,{})]})})})})});PW.displayName="GlobalUXProvider";Se(async()=>{const{RenderToolbar:e}=await Ee(()=>q(()=>import("./RenderToolbar-C5ynPNuq.js"),__vite__mapDeps([128,1,4])));return{default:e}});Se(async()=>{const{ReactQueryDevtools:e}=await Ee(()=>q(()=>import("./index-Ds5yF1gS.js"),[]));return{default:e}});const OCe=Se(async()=>{const{DebugModeActivator:e}=await Ee(()=>q(()=>import("./DebugModeActivator-CtinMZPC.js"),__vite__mapDeps([129,4,1,127,3])));return{default:e}},{restricted:!0}),LCe=({children:e,hostname:t,buildVersion:n,buildVersionRefresh:r,spaRoutes:s,shouldOpenNonSpaRouteInNewTab:o,base:a,idleRefresh:i})=>{const c=Ln(),u=d.useRef(nCe),{env:{isSingleTenant:f}}=on(),{status:m}=je();if(f){if(m==="loading")return null;if(m==="unauthenticated")return Do("/auth/signin","Single tenant requires login"),null}return l.jsx(tme,{ssrPath:c??"/",ssrSearch:"",base:a,children:l.jsx(nme,{spaRoutes:s,openNonSpaRouteInNewTab:o,appRef:u,children:l.jsx(uwe,{children:l.jsxs(Uwe,{children:[l.jsx(hH,{}),l.jsxs(Ame,{buildVersion:n,allowPersist:!0,children:[l.jsx(PW,{logger:Z,renderModals:!1,children:l.jsx(Kz,{children:l.jsxs(F0e,{hostname:t,children:[l.jsx(Gxe,{}),l.jsx(j0e,{children:l.jsx(dz,{children:l.jsx(vbe,{children:l.jsx(zbe,{shouldFetchSettings:!0,children:l.jsx(yge,{children:l.jsx(Lwe,{shouldFetchSettings:!1,children:l.jsx(ICe,{children:l.jsx(Wxe,{children:l.jsxs(qwe,{children:[l.jsxs(bW,{buildVersion:n,enabled:r||i,ref:u,children:[i&&l.jsx(CW,{}),l.jsx(SW,{})]}),l.jsx(dW,{}),l.jsx(pz,{}),typeof window<"u"&&l.jsx(iW,{}),l.jsx(fW,{}),l.jsx(ez,{}),l.jsx(OCe,{}),e,l.jsx(Hme,{logger:Z})]})})})})})})})})})]})})}),!1]})]})})})})},FCe=["49a618ae-2fee-4bac-9150-81c466a49187"];function BCe(e){let t=e;t=t.replace(/^\^/,"").replace(/\$$/,""),t=t.replace(/\\\//g,"/");const n=[],r=t.match(/^\/\(([^)]+\|[^)]+)\)/);if(r){const h=r[1]?.split("|").map(g=>`/${g}`);n.push({type:"alternation",value:"",optional:!1,alternatives:h}),t=t.substring(r[0].length)}else{const h=t.match(/^([^(]+)/);if(h&&h[1]){const g=h[1];n.push({type:"literal",value:g,optional:!1}),t=t.substring(g.length)}}let s=t,o=0,a=0;const i=100;for(;s.length>0&&a++([^)]+)\)\)\?/);if(h){const[_,w,S]=h,C=S===w;n.push({type:C?"literal":"param",value:C?`/${w}`:`/:${w}`,optional:!0,paramName:C?void 0:w}),s=s.substring(_.length);continue}const g=s.match(/^\(\?:\/\(\?<(\w+)>([^)]+)\)\)/);if(g){const[_,w,S]=g,C=S===w;n.push({type:C?"literal":"param",value:C?`/${w}`:`/:${w}`,optional:!1,paramName:C?void 0:w}),s=s.substring(_.length);continue}const y=s.match(/^\/?\(([^)]+)\)\?/),x=s.match(/^\(\?:\/\(([^)]+)\)\)\?/),v=y||x;if(v){const[_]=v;o++,n.push({type:"param",value:`/:param${o}`,optional:!0,paramName:`param${o}`}),s=s.substring(_.length);continue}const b=s.match(/^\/?\?+/);if(b&&b[0].length>0){s=s.substring(b[0].length);continue}break}const c=[],u=n.find(h=>h.type==="alternation"),f=n.filter(h=>h.type!=="alternation"),m=u?u.alternatives.map(h=>`/${h}`):[""];for(const h of m){const g=f.filter(b=>b.optional),y=f.filter(b=>!b.optional),x=g.some(b=>b.paramName?.startsWith("param"));if(g.every(b=>b.paramName?.startsWith("param"))&&x){const b=g.length;for(let _=0;_<=b;_++){let w=h;for(const S of y)w+=S.value;for(let S=0;S<_;S++)w+=g[S]?.value??"";w=w.replace(/\/+/g,"/"),w=w.replace(/\/\?/g,""),w=w||"/",c.push(w)}}else{const b=g.length,_=Math.pow(2,b);for(let w=0;w<_;w++){let S=h;for(const C of y)S+=C.value;for(let C=0;C{const y=h.split("/").filter(Boolean),x=g.split("/").filter(Boolean);if(y.length!==x.length)return x.length-y.length;for(let v=0;v"u")return;const o=e.version,a=e.env??"local",i=Us(),c=t?.email?.endsWith("@perplexity.ai"),u=a==="local",f=a==="testing"||u||i||c?100:1,m=u||c?100:0;if(!FCe.includes(t?.org_uuid??"")){rme({applicationId:HCe,clientToken:x9,version:o,env:a,debug:u,sessionSampleRate:100,sessionReplaySampleRate:m,beforeSend:(g,y)=>{if(g.context&&zCe(y,g)){const x=y.response?.headers?.get(UCe);x&&(g.context.region=x);const v=y.response,b=v?ome(v):void 0;b&&(g.context.normalizedPath=b)}if(n&&g.view.url&&g.context)try{const x=new URL(g.view.url).pathname,v=ame(x,r),b=w7(n,v);if(b)if(b.route.startsWith("^")){const _=w7(BCe(b.route),v);_&&(g.context.normalizedName=C7(_.route,r))}else g.context.normalizedName=C7(b.route,r)}catch{}return!0}}),sme({clientToken:x9,version:o,env:a,debug:u,sessionSampleRate:f});const h=typeof navigator<"u"&&"serviceWorker"in navigator&&!!navigator.serviceWorker.controller;if(b7({useServiceWorker:h,webResourcesBuild:"2026.1.7.906"}),_7({useServiceWorker:h,webResourcesBuild:"2026.1.7.906"}),i){const g={cometAgentExtensionVersion:i?.agent_extension_version,cometDeviceId:i.device_id,cometMainExtensionVersion:i.extension_version,cometVersion:i?.browser_version,erp:e.erp,cometAndroidVersion:i?.android_version,cometIosVersion:i?.ios_version};b7(g),_7(g)}td("web.frontend.module_exec_start",{startTime:IU(),duration:VCe})}y9=!0}function zCe(e,t){return t.type==="resource"&&t.resource.type==="fetch"&&"response"in e}const LW="^\\/search(?:\\/(?new))?(?:\\/(?.+))?$",FW=["ask-input"],WCe=["thread-title"],GCe=e=>{const t=[];if(!e)return t;const n=r=>{if(r.type==="mention"){const o=r.props;o.variant==="source"&&t.push(o.uuid)}"children"in r&&Array.isArray(r.children)&&r.children.forEach(n)};return n(e),t},BW=e=>{const t=[];if(!e)return{dslQuery:void 0,mentions:t};let n=0;const r=s=>{let o="";if(s.type==="text"&&"text"in s)o=s.text;else if(s.type==="linebreak")o=` -`;else{if((s.type==="link"||s.type==="autolink")&&"url"in s)return o=`[${"children"in s&&Array.isArray(s.children)&&s.children.map(r).reduce((i,c)=>(i+=c,i),"")||""}](${s.url})`,o;if(s.type==="mention"){const i=s.props;if(i.variant==="tab")return t.push({id:i.uuid,url:i.url??"",type:i.variant}),n++,o=``,o;if(i.variant==="space")return t.push({id:i.uuid,url:"",type:i.variant}),o="",o;if(i.variant==="shortcut")return t.push({id:i.uuid,url:"",type:i.variant}),o=i.queryText??"",o;if(i.variant==="source")return t.push({id:i.uuid,url:"",type:"sources"}),o="",o}}return"children"in s&&Array.isArray(s.children)?s.children.map(r).reduce((a,i)=>(a+=i,a),o):o};return{dslQuery:r(e)||void 0,mentions:t}};function UW({onSubmit:e,immediate:t=!0}){const n=lW(),r=cW(),s=uW(),o=Vwe(),{setUserInput:a,setHasStartedTyping:i,setStartTypingTime:c,markInputAsSubmitted:u}=qx(),f=d.useRef(!1);d.useEffect(()=>()=>{f.current&&(u(),f.current=!1)},[u,t]);const m=d.useCallback(h=>{Z.info("ask input submitted");const g=o?performance.now()-o:void 0,{dslQuery:y,mentions:x}=BW(h.json?.root);e?.({timeFromFirstType:g,...h,dslQuery:y,mentions:h.mentions??x}),t?u():f.current=!0},[t,u,e,o]),p=d.useCallback((h,g)=>{!s&&h&&i(!0),o||c(performance.now()),a(h,g)},[s,a,i,o,c]);return[n,r,d.useMemo(()=>({onChange:p,onSubmit:m,setUserInput:a}),[p,m,a])]}const aT=3e3;function $Ce({handleSubmitQuery:e,isHomepage:t,contextUuid:n,disableSideBySide:r=!1}){const{isEnabled:s,sbsVariations:o,incrementTriggerCount:a}=c_e({frontendContextUUID:n,disableSideBySide:r});return d.useCallback(c=>{s?(a(),o.forEach(u=>{const{experiment_override:f,sibling_uuid:m,experiment_role:p}=u,h={experiment_role:p,sibling_uuid:m,experiment_override:f,selection_status:la.SELECTION_STATUS_UNSPECIFIED,execution_log:{}},g={...c,newFrontendContextUUID:n,side_by_side_metadata:h};e(g)})):e(c)},[e,s,o,a,t,n])}const qCe=()=>{const{session:e}=je(),{trackEvent:t}=Ke(e),n=Dn(),r="clicked spaces ad",s=d.useCallback(async a=>{a.preventDefault(),t(r,{source:"createSpaceSidebar"}),n.push("/spaces/templates")},[t,n]),o=d.useCallback(async()=>{t("space mentioned in query"),c2e()},[t]);return d.useMemo(()=>({handleCreateSpaceSidebarAdClick:s,handleSubmitQueryWithMention:o}),[s,o])};function KCe({collection:e,onSubmit:t,redirectToNewThread:n=!0,csrRedirect:r=!1}){const{$t:s}=J(),{isCopilot:o}=Fn(),{submitQuery:a}=Wo(),{clear:i}=Ux(),c=Dn(),u=zo(),{handleSubmitQueryWithMention:f}=qCe(),m=d.useMemo(()=>fa(),[]),p=d.useCallback(w=>{if(w.query.trim()==="")return;t?.(w),w.mentions&&w.mentions.some(E=>E.type==="space")&&f();const S=w.newFrontendContextUUID??fa(),C=fa();n&&(i(),a({rawQuery:w.query,dslQuery:w.dslQuery,mentions:w.mentions,copilotOverride:o?!0:void 0,attachments:w.attachments,collection:e||null,newFrontendContextUUID:S,promptSource:w.promptSource||"user",querySource:w.querySource,timeFromFirstType:w.timeFromFirstType,modelPreferenceOverride:w.modelPreferenceOverride,browserAgentAllowOnceFromToggle:w.browserAgentAllowOnceFromToggle,forceEnableBrowserAgent:w.forceEnableBrowserAgent,shouldRedirectToBackendUUID:!r,...w.side_by_side_metadata&&{side_by_side_metadata:w.side_by_side_metadata},frontendUUID:C,...w.canonicalPageContext&&{canonicalPageContext:w.canonicalPageContext},onThreadSlugReceived:E=>{if(!r)return;const N=window.location.pathname;N.startsWith(`${c.base}/search/`)&&LU(N.split("/").pop())&&c.replace(`/search/${E}`,"Home ask input")}}),r&&c.push(`/search/new/${C}`,void 0,"Home ask input"))},[t,n,i,a,o,e,r,c,f]),h=$Ce({handleSubmitQuery:p,isHomepage:!0,contextUuid:m}),g=d.useRef(!1),y=d.useCallback(w=>{g.current||(g.current=!0,setTimeout(()=>g.current=!1,aT),h(w))},[h]),[x,v,b]=UW({onSubmit:y,immediate:!r}),_=s(qr[u].askInputPlaceholder);return[x,v,d.useMemo(()=>({...b,placeholder:_}),[b,_])]}const YCe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"sidecar-privacy-education",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},QCe=({platform:e,miniInstaller:t}={})=>{e=e??"mac_arm64";const n={channel:"stable",platform:e};(t??e.includes("win"))&&(n.mini="1");const s=new URLSearchParams(n),o=new URL("https://www.perplexity.ai/rest/browser/download");return o.search=s.toString(),o},XCe="COMET_USER",ZCe=async()=>{try{const{data:e,error:t,response:n}=await de.GET("/rest/homepage-widgets/upsell","get upsells",{timeoutMs:Ze(),headers:{"X-Current-Path":window.location.pathname}});if(t)throw new ye("API_CLIENTS_ERROR",{cause:t,status:n.status??0});return{upsell_information:e?.upsell_information??null,product_banner_information:e?.product_banner_information??null}}catch(e){return Z.error("Error getting homepage upsells",{error:e}),{upsell_information:null,product_banner_information:null}}},cl=async e=>{try{const{data:t,error:n,response:r}=await de.POST("/rest/sse/blocking_event_response","send blocking event response",{body:{response:e},timeoutMs:Ze()});if(n)throw new ye("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t?.status==="completed"}catch(t){return Z.error("Error sending blocking event response",{error:t,response:e}),!1}},JCe=async e=>{try{const{error:t,response:n}=await de.POST("/rest/homepage-widgets/upsell/add-to-cohort","add user to cohort",{body:{cohort:e},timeoutMs:Ze()});if(t)throw new ye("API_CLIENTS_ERROR",{cause:t,status:n.status??0});return n.ok}catch(t){return Z.error("Error adding user to cohort",{error:t,cohort:e}),!1}},eSe=async()=>JCe(XCe),tSe=e=>{e.invalidateQueries({queryKey:a3(!0)}),e.invalidateQueries({queryKey:a3(!1)}),e.invalidateQueries({queryKey:bye()})},zvt=e=>{tSe(e),e.invalidateQueries({queryKey:cu()}),e.invalidateQueries({queryKey:Qy()})},nSe=({isUnsupportedDevice:e,isWindows:t})=>{const{session:n}=je(),{trackEvent:r}=Ke(n),{sendCometDownloadedEventSingular:s,sendCometDownloadButtonClickedEventSingular:o}=a4(),{openToast:a}=pn(),{openModal:i}=gn().legacy,{$t:c}=J(),u=d.useCallback(async(h,g)=>{a({message:c({defaultMessage:"Comet is downloading",id:"hCO9dUOI91"}),description:c({defaultMessage:"Check your browser's downloads to open the Comet installer.",id:"hRzUheg7aj"}),iconOverride:B("download"),variant:"success",timeout:5}),h||i("cometDownloadInstructionsModal",{requestedPlatform:g})},[a,c,i]),f=d.useCallback(async(h,{upsellName:g,partnerCode:y,preventDownloadInstructionsModal:x})=>{u(x,h),ime(),r("click download comet",{requestedPlatform:h,upsellName:g,installPartner:y}),s(),setTimeout(()=>Do(QCe({platform:h}).href,"Comet download"),250)},[r,s,u]),m=d.useCallback(async({upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y})=>{if(!e)return await eSe(),t?f("win_x64",{upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y}):f("mac_arm64",{upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y})},[f,t,e]),p=d.useCallback(({upsellName:h,partnerCode:g})=>{o("download-comet"),m({upsellName:h,partnerCode:g})},[o,m]);return{handleDownload:m,handleDownloadClick:p}},rSe=(e,t)=>{const{value:n,loading:r}=qt({flag:"maybe-student-domains-regex",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},sSe=async({reason:e,headers:t})=>{try{const{data:n}=await de.GET("/rest/academic/check-edu-institution",e,{timeoutMs:Sn.HIGH,headers:t});return n}catch(n){return Z.error("Failed to check institution",n),null}},oSe=({reason:e})=>gt({queryKey:Aye(),queryFn:()=>sSe({reason:e})}),aSe=({reason:e})=>{const{isStudent:t}=T4({reason:e}),{variation:n,loading:r}=rSe(!1),{data:s,isLoading:o}=oSe({reason:e});return d.useMemo(()=>o||r?{isLoading:!0,signals:{isVerifiedStudent:null,isPossibleStudentByEmail:null,isPossibleStudentByIP:null}}:{isLoading:!1,signals:{isVerifiedStudent:!!t,isPossibleStudentByEmail:!!n,isPossibleStudentByIP:!!s?.institution}},[o,r,n,t,s?.institution])},VW=()=>{const{openModal:e}=gn().legacy,{isMobileUserAgent:t}=Re(),n=Io(),r=d.useCallback(({origin:s,sheetModalVariant:o,closeCallback:a})=>{!t||n||e("installModal",{origin:s,sheetModalVariant:o,closeCallback:a})},[n,t,e]);return d.useMemo(()=>({openInstallUpsell:r}),[r])},di=({enabled:e})=>{const{openModal:t}=gn().legacy,{keysRequiringRerender:n,removeKeyRequiringRerender:r}=u4(),{isMobileUserAgent:s}=Re(),o=Vt(),{openInstallUpsell:a}=VW(),i=d.useCallback(({title:u,description:f,origin:m,image:p,imageAlt:h,closeCallback:g,loginButtonsStyle:y})=>{},[e,t,o]),c=d.useCallback(({title:u,description:f,origin:m,sheetModalVariant:p,closeCallback:h,overrideRedirectUrl:g,disallowedMethods:y,overrideMobileVariant:x=!1})=>{},[e,s,t,o]);return d.useEffect(()=>{e&&(n.includes("visitor-gate")&&(s&&!Vy()?a({origin:lt.VISITOR_GATE,sheetModalVariant:"inset-centered-sheet"}):c({origin:lt.VISITOR_GATE,sheetModalVariant:"bottom-sheet-gradient"}),r("visitor-gate")),n.includes("visitor-gate-ii")&&(s&&!Vy()?a({origin:lt.VISITOR_GATE,sheetModalVariant:"inset-centered-sheet"}):c({origin:lt.VISITOR_GATE}),r("visitor-gate-ii")))},[e,c,n,r,s,a]),d.useMemo(()=>({openVisitorLoginUpsell:c,openVisitorLoginImageUpsell:i}),[i,c])},iSe={currentStep:null,currentIndex:0,steps:[],handleNext:()=>null,handleComplete:()=>null,insertStep:()=>null,insertStepAndNavigate:()=>null,experimentVariationsMeta:{},setCurrentIndex:()=>null},HW=zt("MultiStepContext",iSe),Wvt=({steps:e,experimentVariationsMeta:t,handleFinish:n,initialIndex:r=0,children:s})=>{const[o,a]=d.useState(r),[i,c]=d.useState(e),[u,f]=d.useState(null),[m,p]=d.useState(t),{session:h}=je(),{trackEventTyped:g}=Ke(h);d.useEffect(()=>{c(e)},[e]),d.useEffect(()=>{p(t)},[t]),d.useEffect(()=>{i[o]!==void 0&&g("step visited",{step:i[o],experimentVariationsMeta:m})},[o,m,i,g]),d.useEffect(()=>{if(u!==null){if(a(u),f(null),i[o]===void 0||i[u]===void 0)return;g("step transition",{sourceStep:i[o],destinationStep:i[u],isFinish:!1,experimentVariationsMeta:m})}},[o,m,u,i,g]);const y=(w,S)=>{const C=[...i];C.splice(S,0,w),c(C)},x=(w,S)=>{y(w,S),f(S)},v=()=>{if(i.length)if(o===i.length-1){if(n?.(),i[o]===void 0)return;g("step transition",{sourceStep:i[o],isFinish:!0,experimentVariationsMeta:m})}else{if(a(o+1),i[o]===void 0||i[o+1]===void 0)return;g("step transition",{sourceStep:i[o],destinationStep:i[o+1],isFinish:!1,experimentVariationsMeta:m})}},b=()=>{n?.(),i[o]!==void 0&&g("step transition",{sourceStep:i[o],isFinish:!0,experimentVariationsMeta:m})},_=d.useMemo(()=>i[o],[o,i]);return l.jsx(HW.Provider,{value:{currentStep:_,insertStep:y,insertStepAndNavigate:x,handleNext:v,handleComplete:b,currentIndex:o,steps:i,setCurrentIndex:a,experimentVariationsMeta:m},children:s})};function lSe(){const e=d.useContext(HW);if(!e)throw new Error("useMultiStep must be used within MultiStepContext");return e}const cSe=({searchParams:e,cleanRedirect:t})=>{if(!e)return null;const r=e.get("redirect");let s=null;try{s=r&&new URL(r).searchParams.get(DM)}catch{return null}return s?s===lt.GROW_COMET_STUDENTS_COUNTRY?lt.GROW_COMET_STUDENTS_COUNTRY:s===lt.GROW_COMET_STUDENTS?lt.GROW_COMET_STUDENTS:null:null},uSe=()=>{const e=mn();return d.useMemo(()=>{const t=e?.get(DM),n=!!cSe({searchParams:e,cleanRedirect:!1}),r=t===lt.STUDENT_REFERRAL_LANDING_PAGE,s=t===lt.STUDENT_LANDING_PAGE,o=t===lt.GROW_COMET_STUDENTS_COUNTRY;return{loginSource:t,isFromStudentCometGrowth:n,isFromStudentCometGrowthCountry:o,isFromStudentReferral:r,isFromStudentLanding:s,isFromStudentFlow:n||r||s||o}},[e])},dSe=(e,t)=>t.isFromStudentCometGrowthCountry?lt.GROW_COMET_STUDENTS_COUNTRY:t.isFromStudentCometGrowth?lt.GROW_COMET_STUDENTS:t.isFromStudentReferral?lt.STUDENT_REFERRAL_LANDING_PAGE:t.isFromStudentLanding?lt.STUDENT_LANDING_PAGE:e,fSe=({origin:e,customCallbacks:t})=>{const{$t:n}=J(),r=Vt(),{session:s}=je(),{trackEvent:o}=Ke(s),{openVisitorLoginUpsell:a}=di({enabled:!r}),{insertStepAndNavigate:i,currentIndex:c,handleComplete:u}=lSe(),{openModal:f}=gn().legacy,m=uSe(),h=mn()?.get("redirect"),{signals:g,isLoading:y}=aSe({reason:"combined_paywall"}),x=d.useCallback(w=>{if(w){if(m.isFromStudentCometGrowth){u();return}typeof window<"u"&&window.location.pathname==="/onboarding"?(_a.setItem("student_verification_id",w),i("onboarding-student-referrals",c+1)):setTimeout(()=>{f("studentReferrals",{verificationId:w})},150)}},[i,c,f,m,u]),v=d.useCallback(w=>{o("sheerid form redirect",{verificationLocationSource:dSe(e,m),verificationRoleType:w}),f("sheerIdModal",{type:w,onSuccess:t?.onSuccess??x,onClose:t?.onClose})},[x,e,o,m,f,t]),b=d.useCallback(w=>{if(!r){a({title:n({defaultMessage:"Sign in to unlock Education Pro",id:"UNeU1Y4Zdu"}),origin:m.loginSource??e,disallowedMethods:["apple"],overrideRedirectUrl:h??void 0});return}v(w)},[r,v,a,n,m.loginSource,e,h]),_=m.isFromStudentFlow||!!g.isVerifiedStudent||!!g.isPossibleStudentByEmail||!!g.isPossibleStudentByIP;return{isLoading:!!y,isVerifiedStudent:!!g.isVerifiedStudent,handleStudentTierClick:b,handleVerificationSuccess:x,shouldDefaultToStudent:_,signals:g}},mSe=`__merge-ah-script__${crypto.randomUUID()}`;async function pSe(){return fM({id:mSe,src:"https://ah-cdn.merge.dev/initialize.js"})}function hSe(e){const t=d.useCallback(async()=>{const r=e?.linkToken;if(!r)throw new Error("Link token is required");await pSe(),await new Promise(s=>{window.AgentHandlerLink.initialize({...e,linkToken:r,enable_telemetry:!1,onReady:()=>s()})})},[e]);return d.useCallback(async()=>{await t(),window.AgentHandlerLink&&window.AgentHandlerLink.openLink(e)},[e,t])}function gSe({url:e,openInNewTab:t}){if(t){window.open(e,"_blank");return}Do(e,"Enabling connector")}const iT=({reason:e})=>{const t=mn(),n=t?.get("referrer"),r=t?.get("referrerId"),{$t:s}=J(),{openToast:o}=pn(),a=d.useCallback(async({connectorName:i,redirectPath:c,customReferrer:u,customReferrerId:f,redirectOrigin:m,unauthedRedirectPath:p,openInNewTab:h=!1})=>{const g=await Bz({name:i,referrer:u??n??void 0,referrerId:f??r??void 0,redirectPath:c??void 0,redirectOrigin:m,unauthedRedirectPath:p??void 0,reason:e});if(!g){o({message:s({defaultMessage:"Unable to start connection.",id:"SPIzcd/Xa2"}),variant:"error",timeout:3});return}gSe({url:g,openInNewTab:h})},[e,n,r,s,o]);return d.useMemo(()=>({handleConnect:a}),[a])},v9="/account/connectors",b9={GCAL_CONNECT:"gcal_connect",CONNECTOR_COMPLETE:"connector_complete"},ySe={UPSELL_CONNECTOR:"upsell-connector-channel"},Gvt={GOOGLE:"google",OUTLOOK:"outlook"},$vt={GCAL:"gcal"},oy="writable-spaces",Tm="recentCollections",xSe=e=>e?.toLowerCase(),ay=e=>xSe(e.status)==="pending",vSe=e=>e.find(t=>ay(t)&&t.backend_uuid),bSe=e=>!!(e&&Hi(e)&&"blocks"in e[0]),_Se=async({slugOrUUID:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/article/{article_uuid_or_slug}",n,{params:{path:{article_uuid_or_slug:e}},headers:t,timeoutMs:Ze({productionMs:3e3}),numRetries:1});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get article",cause:s,status:o.status??0});if(r.status!=="success")throw new ye("API_CLIENTS_ERROR",{message:"Failed to get article - not successful",cause:r,status:o.status??0});return r.entries},_9=e=>e[0]?.article_info?{title:e[0].article_info.title||"",summary:e[0].article_info.summary||"",suggested_sections:e[0].article_info.suggested_sections||[],audience:e[0].article_info.audience||"anyone",read_time:e[0].article_info.read_time,emphasize_sources:e[0].article_info.emphasize_sources??!1,num_sections:e.length}:null,wSe={isBlocksApi:!1,article:[],heroSection:void 0,isLoading:!1,isPublished:!1,isOrgInternal:!1,inFlight:!1,inFlightLatest:!1,currentlyStreamingSection:void 0,socialStats:{forkCount:0,likeCount:0,viewCount:0,userLikes:!1},threadMetadata:{rwToken:void 0,contextUUID:void 0,frontendContextUUID:void 0,title:void 0,first_query:void 0,focus:void 0,author_id:void 0,author_username:void 0,author_image:void 0,parent_info:void 0,mode:void 0,personalized:!1,collection:void 0,thread_access:0,thread_url_slug:void 0,updated_datetime:void 0,expiry_time:void 0,privacy_state:QS.NONE},articleMetadata:{title:"",summary:"",suggested_sections:[],audience:"anyone",read_time:0,emphasize_sources:!1,num_sections:0},articleMedia:[],articleWebResults:[],relatedPages:[],articleLocalState:{isEditModeEnabled:!1,setEditModeEnabled:()=>{},isCreating:!1,setIsCreating:()=>{},isTitleVisible:!0,setTitleVisible:()=>{},clickedImage:null,setClickedImage:()=>{},clickedImageIndex:0,isRewritingSection:!1,setRewritingSection:()=>{}},refetch:()=>{}},zW=zt("ArticleResultsContext",wSe),CSe=T.memo(({relatedPages:e=Ie,children:t,slug:n})=>{const r="article-results-provider",[s,o]=d.useState(!1),[a,i]=d.useState(!1),[c,u]=d.useState(null),[f,m]=d.useState(!0),[p,h]=d.useState(!1),{isEnterprise:g}=mo({reason:r}),y=Xt(),v=mn()?.get("newFrontendContextUUID"),[b,_]=d.useState(y.getQueryData(PR(n||"")));d.useEffect(()=>{if(v){_(v);return}const G=y.getQueryData(PR(n||""));_(G)},[v,y,n]);const{data:w,isLoading:S}=gt({enabled:!!n&&n!=="new",queryKey:w4(b||""),queryFn:()=>_Se({slugOrUUID:n,reason:r}),refetchOnMount:!0,placeholderData:$l}),C=bSe(w),E=d.useMemo(()=>{if(!w||C)return;const G=w[w.length-1];return{inFlight:w.some(ay),inFlightLatest:G&&ay(G)}},[w,C]),N=E?.inFlight??!1,k=E?.inFlightLatest??!1,I=d.useMemo(()=>{if(!(!w||C))return vSe(w)},[w,C]),M=d.useMemo(()=>{if(!w||w.length===0)return null;const G=w[0];if(ay(G))return null;const H=G.social_info;return H?w3(H):w3()},[w]),A=d.useMemo(()=>!w||w.length===0?P_():P_(w[0]),[w]),D=d.useMemo(()=>w?_9(w):null,[w]),P=d.useMemo(()=>{const G=[];return w?.forEach(H=>{if(H.article_info.layout==="media-only"){const Y=(H.article_info.user_selected_media_items??[])?.filter(te=>te.medium==="image");G.push(...Y)}else{const Q=H?.media_items??[],Y=H?.featured_images??[];H.article_info.layout!=="text"&&(Hi(Y)&&Y[0].medium==="image"?G.push(Y[0]):Hi(Q)&&Q[0].medium==="image"&&G.push(Q[0]))}}),G},[w]),F=d.useMemo(()=>{if(!c)return 0;const G=P.findIndex(H=>H?.image===c?.image);return G>-1?G:0},[c,P]),R=d.useMemo(()=>{const G=new Map;return!w||w.length===0?[]:(w?.forEach(H=>{const Q=Yt.parseAskTextField(H);Q?.web_results&&Q.web_results.forEach(Y=>{G.has(Y.url)?G.get(Y.url).count+=1:G.set(Y.url,{...Y,count:1})})}),Array.from(G.values()).sort((H,Q)=>Q.count-H.count).map(H=>({...H,count:void 0})))},[w]),j={isEditModeEnabled:s,setEditModeEnabled:o,isTitleVisible:f,setTitleVisible:m,isCreating:a,setIsCreating:i,clickedImage:c,setClickedImage:u,clickedImageIndex:F,isRewritingSection:p,setRewritingSection:h},L=A??P_(),U=g&&!!L.collection&&L.thread_access===os.COLLECTION_READ,O=!!g&&L.thread_access===os.ORG_READ,$=U||O||L.thread_access===os.PUBLIC_READ;return l.jsx(zW.Provider,{value:{isBlocksApi:C,article:w??[],isLoading:S,heroSection:w?.[0],lastSection:w?.[w.length-1],socialStats:M,isPublished:$,isOrgInternal:O,inFlight:N,inFlightLatest:k,currentlyStreamingSection:I,threadMetadata:L,articleMetadata:D??_9([]),articleLocalState:j,articleMedia:P,articleWebResults:R,relatedPages:e},children:t})});CSe.displayName="ArticleResultsProvider";const SSe=()=>{const e=d.useContext(zW);if(!e)throw new Error("useArticleResults must be used within ArticleResultsContext");return e},WW={searchTerm:"",updateUserInput:e=>{}},ESe=zt("UserInputStateContext",WW),GW=()=>{const e=d.useContext(ESe);return e||WW};function kSe(e){return typeof e=="object"&&e!==null&&"pages"in e&&Array.isArray(e.pages)&&"pageParams"in e&&Array.isArray(e.pageParams)}const MSe=(e,t)=>e.getQueryData(["results"])?.find(r=>r.frontend_context_uuid===t)?.collection_info,TSe=(e,t)=>e.getQueryData(w4(t))?.find(r=>r.frontend_context_uuid===t)?.collection_info,ASe=(e,t,n)=>{e.setQueryData(w4(t),r=>r&&r.map(n))},NSe=[os.OWNER_ONLY,os.PRIVATE_READ,os.COLLECTION_READ],w9=(e,t,n,r,s)=>{const{entryUUID:o,frontendContextUUID:a,newCollectionUUID:i,newCollectionTitle:c,newCollectionEmoji:u,newCollectionSlug:f,newCollectionAccess:m,newCollectionUserPermission:p}=t,h={collection_info:{uuid:i,title:c,emoji:u,slug:f,access:m,user_permission:p},bookmark_state:"BOOKMARKED"};a&&(s(g=>g?g.map(y=>y.frontend_context_uuid===a?{...y,...h}:y):[]),e.setQueryData(be.makeQueryKey(r,{frontend_context_uuid:a}),g=>g?g.map(y=>y.frontend_context_uuid===a?{...y,...h}:y):[])),e.setQueryData(n,g=>{g=g||{pages:[],pageParams:[]};const y=g.pages.map(x=>x.map(v=>v.uuid===o?{...v,collection:{...v.collection,...h.collection_info}}:v));return{...g,pages:y}})},RSe=({reason:e})=>{const{searchTerm:t}=GW(),n=Xt(),{isEnterprise:r}=mo({reason:e}),{threadMetadata:s}=SSe(),o=el(),a=Ln();let i="results";const c=Px({search_term:t??""}),u=wye({search_term:t??""});let f=c,m=kye,p=MSe;const h=V4();let g=d.useCallback((A,D,P)=>{h(F=>F&&F.map(P))},[h]);(a?.startsWith("/page")||a?.startsWith("/discover"))&&(i="articleResults",f=u,m=Mye,p=TSe,g=ASe);const y=d.useCallback(A=>{const D=!o&&!s?.rwToken;!r||D||h(P=>{if(P)return P.map(F=>{let R=!1,j=os.PRIVATE_READ;return A==="add"?(R=NSe.includes(F.thread_access??null),j=Yt.isArticleMode(F)?os.PRIVATE_READ:os.COLLECTION_READ):(R=F.thread_access!==os.COLLECTION_READ,j=os.PRIVATE_READ),{...F,thread_access:R?F.thread_access:j}})})},[o,s?.rwToken,r,h]),{mutate:x}=It({mutationFn:async({title:A,description:D,emoji:P,instructions:F,accessLevel:R,existingCollection:j,enableWebByDefault:L,closeModal:U})=>(U(),T_e({collectionUuid:j.uuid,changes:{title:A,description:D,emoji:P,instructions:F,accessLevel:R,enableWebByDefault:L},reason:e})),onMutate:async A=>{const D=sa(A.existingCollection.slug);await n.cancelQueries({queryKey:D});const P=n.getQueryData(D);return n.setQueryData(D,F=>({...F,title:A.title,description:A.description,emoji:A.emoji,instructions:A.instructions,access:A.accessLevel,enable_web_by_default:A.enableWebByDefault})),{previousCollection:P}},onSettled:(A,D,P,F)=>{const R=sa(P.existingCollection.slug);D?n.setQueryData(R,F?.previousCollection):(n.setQueryData(R,j=>({...j,...A})),n.setQueryData(Zt(),j=>j?.pages?{...j,pages:j.pages.map(L=>L.map(U=>U.uuid===P.existingCollection.uuid?{...U,...A}:U))}:j),n.invalidateQueries({queryKey:km()}),n.invalidateQueries({queryKey:tp()}),n.invalidateQueries({queryKey:be.makeQueryKey(oy)}))}}),{mutate:v}=It({mutationFn:async({accessLevel:A,collectionUuid:D})=>{await p_e({params:{collection_uuid:D,updated_access:A},reason:e})},onMutate:async A=>{const D=sa(A.collectionSlug);await n.cancelQueries({queryKey:D});const P=n.getQueryData(D);return n.setQueryData(D,F=>({...F,access:A.accessLevel})),{previousCollection:P}},onSettled:async(A,D,P,F)=>{D?n.setQueryData(Zt(),F?.previousCollection):(await n.invalidateQueries({queryKey:Fye()}),await n.invalidateQueries({queryKey:sa(P.collectionSlug)}),n.invalidateQueries({queryKey:km()}))}}),{mutate:b}=It({mutationFn:async({entryUUID:A,title:D,description:P,emoji:F,instructions:R,accessLevel:j,callback:L,frontendContextUUID:U})=>{const O=await o9({params:{title:D,description:P,emoji:F,instructions:R,accessLevel:j},reason:e});return await O0({params:{new_collection_uuid:O.uuid,entry_uuid:A,return_collection:!1,return_thread:!1},reason:e}),L(O),y("add"),{title:D,description:P,emoji:F,instructions:R,accessLevel:j,newCollection:O}},onMutate:async({entryUUID:A,frontendContextUUID:D,...P})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Zt()});const F=n.getQueryData(f),R=n.getQueryData(Zt());n.setQueryData(Zt(),L=>{L=L||{pages:[],pageParams:[]};const U=(L&&L.pages&&L.pages[0])??[],$={...U?.length>0?U[0]:[],...P,uuid:Si,thread_count:1};return{...L,pages:[[$,...U]]}}),n.setQueryData(f,L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>$.uuid===A?{...$,collection:{...$.collection,description:P.description,uuid:Si,title:P.title,emoji:P.emoji}}:$));return{...L,pages:U}}),n.setQueryData(m(A),L=>{const U=L?.collection_info??{};return{...L,collection_info:{...U,uuid:Si,description:P.description,title:P.title,emoji:P.emoji}}});let j=null;return D&&(j=p(n,D)??null,g(n,D,L=>L.frontend_context_uuid===D?{...L,collection_info:{...L.collection_info,uuid:Si,title:P.title,emoji:P.emoji},bookmark_state:"BOOKMARKED"}:L)),{previousThreads:F,previousCollections:R,previousCollectionInfo:j}},onSettled:(A,D,P,F)=>{D?(n.setQueryData(f,F.previousThreads),n.setQueryData(Zt(),F.previousCollections),P.frontendContextUUID&&g(n,P.frontendContextUUID,R=>R.frontend_context_uuid===P.frontendContextUUID?{...R,collection_info:F?.previousCollectionInfo??null,bookmark_state:F?.previousCollectionInfo?"BOOKMARKED":"NOT_BOOKMARKED"}:R)):(n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:Zt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Tm)}),n.invalidateQueries({queryKey:tp()}),n.invalidateQueries({queryKey:km()}),P.frontendContextUUID&&g(n,P.frontendContextUUID,R=>R.frontend_context_uuid===P.frontendContextUUID?{...R,collection_info:{...R.collection_info,uuid:A?.newCollection?.uuid,title:A?.newCollection?.title,emoji:A?.newCollection?.emoji,slug:A?.newCollection?.slug},bookmark_state:"BOOKMARKED"}:R))}}),{mutate:_}=It({mutationFn:async({title:A,description:D,emoji:P,instructions:F,accessLevel:R,template_id:j,callback:L})=>{const U=await o9({params:{title:A,description:D,emoji:P,instructions:F,accessLevel:R,template_id:j},reason:e});return L(U),{collection:U}},onMutate:async({...A})=>{n.setQueryData(Zt(),D=>{D=D||{pages:[],pageParams:[]};const P=D.pages[0]||[],F={...P.length>0?P[0]:{},...A,uuid:Si,thread_count:0};return{...D,pages:[[F,...P]]}})},onSuccess:async()=>{n.refetchQueries({queryKey:Zt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Tm)}),n.invalidateQueries({queryKey:tp()}),n.invalidateQueries({queryKey:km()}),n.invalidateQueries({queryKey:be.makeQueryKey(oy)})}}),{mutate:w}=It({mutationFn:async({entryUUID:A})=>{const D=await O0({params:{entry_uuid:A,upsert_type:"bookmark",return_collection:!0,return_thread:!1},reason:e});return y("add"),D},onMutate:async({entryUUID:A,topic:D})=>{const P=n.getQueryData(mc(D));let F;for(const R of P?.pages??[])for(const j of R.threads)if(j.uuid===A){F=j.collection;break}return n.setQueryData(mc(D),R=>{if(R)return{pageParams:R.pageParams,pages:R.pages.map(j=>({...j,threads:j.threads.map(L=>({...L,collection:L.uuid===A?{uuid:Si,title:"Bookmarks",emoji:"1f516",slug:Si}:L.collection}))}))}}),{previousCollection:F}},onSettled:(A,D,P,F)=>{const{entryUUID:R,topic:j}=P;if(D||!A)F?.previousCollection&&n.setQueryData(mc(j),L=>{if(L)return{pageParams:L.pageParams,pages:L.pages.map(U=>({...U,threads:U.threads.map(O=>({...O,collection:O.uuid===R?F.previousCollection:O.collection}))}))}});else{const{updated_collection:L}=A,{uuid:U,title:O,emoji:$,slug:G}=L;n.setQueryData(mc(j),H=>{if(H)return{pageParams:H.pageParams,pages:H.pages.map(Q=>({...Q,threads:Q.threads.map(Y=>({...Y,collection:Y.uuid===R?{uuid:U,title:O,emoji:$,slug:G}:Y.collection}))}))}})}}}),{mutate:S}=It({mutationFn:async({entryUUID:A,topic:D,oldCollectionUUID:P})=>(await r9({collectionUUID:P,entryUUID:A,reason:e}),{topic:D}),onMutate:async({entryUUID:A,topic:D})=>{const P=n.getQueryData(mc(D));let F;for(const R of P?.pages??[])for(const j of R.threads)if(j.uuid===A){F=j.collection;break}return n.setQueryData(mc(D),R=>{if(R)return{pageParams:R.pageParams,pages:R.pages.map(j=>({...j,threads:j.threads.map(L=>({...L,collection:L.uuid===A?void 0:L.collection}))}))}}),{previousCollection:F}},onSettled:(A,D,P,F)=>{const{entryUUID:R,topic:j}=P;D&&F?.previousCollection&&n.setQueryData(mc(j),L=>{if(L)return{pageParams:L.pageParams,pages:L.pages.map(U=>({...U,threads:U.threads.map(O=>({...O,collection:O.uuid===R?F.previousCollection:O.collection}))}))}})}}),{mutate:C}=It({mutationFn:async({entryUUID:A,frontendContextUUID:D})=>{const P=await O0({params:{entry_uuid:A,upsert_type:"bookmark",return_collection:!0,return_thread:!1},reason:e});return y("add"),{response:P,entryUUID:A,frontendContextUUID:D}},onMutate:async({frontendContextUUID:A})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Zt()}),h(D=>D&&D.map(P=>P.frontend_context_uuid===A?{...P,bookmark_state:"BOOKMARKED",collection_info:{uuid:null,title:"Bookmarks",emoji:"1f516",slug:null,access:null,user_permission:as.OWNER_DEFAULT_BOOKMARKS}}:P))},onSettled:async(A,D)=>{if(!A||!A.response?.updated_collection)return;const P=A.response.updated_collection,F=A.entryUUID,R=A.frontendContextUUID,{uuid:j,title:L,emoji:U=null,slug:O,access:$,user_permission:G}=P;await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Zt()}),w9(n,{entryUUID:F,frontendContextUUID:R,newCollectionUUID:j,newCollectionTitle:L,newCollectionEmoji:U,newCollectionSlug:O,newCollectionAccess:$,newCollectionUserPermission:G},f,i,h),n.invalidateQueries({queryKey:Zt()}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:R})})}}),{mutate:E}=It({mutationFn:async({entryUUID:A,currentCollectionUUID:D,newCollectionTitle:P,newCollectionUUID:F,newCollectionSlug:R,newCollectionAccess:j,closeModal:L,callback:U})=>{if(F!==Si)return L(),await O0({params:{new_collection_uuid:F,entry_uuid:A,return_collection:!1,return_thread:!1},reason:e}),U?.(),y("add"),{entryUUID:A,currentCollectionUUID:D,newCollectionTitle:P,newCollectionUUID:F,newCollectionSlug:R,newCollectionAccess:j,closeModal:L}},onMutate:async({entryUUID:A,frontendContextUUID:D,currentCollectionUUID:P,newCollectionUUID:F,newCollectionTitle:R,newCollectionEmoji:j,newCollectionSlug:L,newCollectionAccess:U,newCollectionUserPermission:O})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Zt()});const $=n.getQueryData(f),G=n.getQueryData(Zt());return w9(n,{entryUUID:A,frontendContextUUID:D,newCollectionUUID:F,newCollectionTitle:R,newCollectionEmoji:j,newCollectionSlug:L,newCollectionAccess:U,newCollectionUserPermission:O},f,i,h),n.setQueryData(Zt(),H=>{H=H||{pages:[],pageParams:[]};const Q=H.pages.map(Y=>Y.map(te=>te.uuid===P?{...te,thread_count:te.thread_count-1}:te.uuid===F?{...te,thread_count:te.thread_count+1}:te));return{...H,pages:Q}}),{previousThread:$,previousCollections:G}},onSettled:(A,D,P,F)=>{if(D)n.setQueryData(f,F.previousThread),n.setQueryData(Zt(),F.previousCollections);else{const R=_d({collection_slug:P.existingCollectionSlug??""}),j=_d({collection_slug:P.newCollectionSlug});n.invalidateQueries({queryKey:sa(P.newCollectionSlug)}),n.invalidateQueries({queryKey:R}),n.refetchQueries({queryKey:j}),n.refetchQueries({queryKey:m(P.entryUUID)}),n.invalidateQueries({queryKey:Zt()}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:P.frontendContextUUID})}),n.invalidateQueries({queryKey:be.makeQueryKey(Tm)})}}}),{mutate:N}=It({mutationFn:async({entryUUID:A,oldCollectionUUID:D,callback:P})=>{if(D)return await r9({collectionUUID:D,entryUUID:A,reason:e}),P?.(),y("remove"),{entryUUID:A,oldCollectionUUID:D}},onMutate:async({entryUUID:A,oldCollectionUUID:D,frontendContextUUID:P,collectionSlug:F})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Zt()});const R=n.getQueryData(f),j=n.getQueryData(Zt());return P&&(h(L=>L?L.map(U=>U.frontend_context_uuid===P?{...U,collection_info:void 0,bookmark_state:"NOT_BOOKMARKED"}:U):[]),n.setQueryData(be.makeQueryKey(i,{frontend_context_uuid:P}),L=>L?L.map(U=>U.frontend_context_uuid===P?{...U,collection_info:null,bookmark_state:"NOT_BOOKMARKED"}:U):[])),n.setQueryData(f,L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>A===$.uuid&&$.collection?.uuid===D?{...$,collection:null}:$));return{...L,pages:U}}),n.setQueryData(Zt(),L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>$.uuid===D?{...$,thread_count:$.thread_count-1}:$));return n.setQueryData(m(A),O=>O&&Array.isArray(O.pages)?{...O,pages:O.pages.map($=>$.map(G=>G.uuid===A?{...G,collection_info:null}:G))}:{...O,collection_info:null}),{...L,pages:U}}),F&&n.setQueriesData({queryKey:_4(F),exact:!1},L=>kSe(L)?{...L,pages:L.pages.map(U=>U.filter(O=>O.uuid!==A))}:L),{previousThreads:R,previousCollections:j}},onError:(A,D,P)=>{P&&(n.setQueryData(f,P.previousThreads),n.setQueryData(Zt(),P.previousCollections))},onSuccess:(A,D)=>{if(n.invalidateQueries({queryKey:m(D.entryUUID)}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:Zt()}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(Tm)}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:D.frontendContextUUID})}),D.collectionSlug){const P=_d({collection_slug:D.collectionSlug});n.invalidateQueries({queryKey:P}),n.invalidateQueries({queryKey:sa(D.collectionSlug)})}}}),{mutate:k}=It({mutationFn:async A=>{await A_e({collectionUuid:A,reason:e})},onSuccess:(A,D)=>{n.invalidateQueries({queryKey:Zt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Tm)}),n.invalidateQueries({queryKey:tp()}),n.invalidateQueries({queryKey:km()}),n.invalidateQueries({queryKey:be.makeQueryKey(oy)}),n.invalidateQueries({queryKey:xp()}),n.setQueryData(Zt(),P=>!P||!P.pages?P:{...P,pages:P.pages.map(F=>F.filter(R=>R.uuid!==D))})}}),{mutate:I}=It({mutationFn:async({collectionUuid:A,link:D,reason:P})=>{const{data:F,error:R,response:j}=await de.POST("/rest/collections/focused_web_config/links",P,{timeoutMs:Ze(),body:{collection_uuid:A,link:D},numRetries:1});if(R)throw new ye("API_CLIENTS_ERROR",{cause:R,status:j.status??0,details:{reason:P}});return F},onSettled:(A,D,P,F)=>{n.invalidateQueries({queryKey:sa(P.collectionSlug)})}}),{mutate:M}=It({mutationFn:async({collectionUuid:A,link:D,reason:P})=>{const{error:F,response:R}=await de.DELETE("/rest/collections/focused_web_config/links",P,{body:{collection_uuid:A,link:D},timeoutMs:Ze(),numRetries:1});if(F)throw new ye("API_CLIENTS_ERROR",{cause:F,status:R.status??0})},onSettled:(A,D,P,F)=>{n.invalidateQueries({queryKey:sa(P.collectionSlug)})}});return d.useMemo(()=>({updateCollectionInfo:x,updateCollectionAccessLevel:v,createCollectionForThread:b,createCollection:_,bookmarkFromFeed:w,removeBookmarkFromFeed:S,firstTimeBookmark:C,swapThreadCollection:E,removeThreadFromCollection:N,deleteCollection:k,addLink:I,removeLink:M}),[I,w,b,_,k,C,S,M,N,E,v,x])},DSe=()=>{const{$t:e}=J(),t=Dn(),{createCollection:n,createCollectionForThread:r}=RSe({reason:"create-new-space"}),s=d.useCallback(()=>{const a=e({defaultMessage:"New Space",id:"t5xj3BH/Ni"});n({title:a,description:"",emoji:"",instructions:"",accessLevel:Q7,enableWebByDefault:!0,callback:i=>{t.push(`/spaces/${i.slug}`)}})},[n,e,t]),o=d.useCallback((a,i)=>{const c=e({defaultMessage:"New Space",id:"t5xj3BH/Ni"});r({title:c,description:"",emoji:"",instructions:"",accessLevel:Q7,enableWebByDefault:!0,entryUUID:a,frontendContextUUID:i,callback:u=>{t.push(`/spaces/${u.slug}`)}})},[r,e,t]);return d.useMemo(()=>({handleCreateNewSpace:s,handleCreateNewSpaceForThread:o}),[s,o])};function jSe({reason:e}){const t=Xt(),n=cu();return It({mutationKey:["publishArticleMutation"],mutationFn:async({connectorName:r,connectionUUID:s,deleteFiles:o,autoDeleteEmailAssistant:a})=>a?await s9({connectorName:r,reason:e,autoDeleteEmailAssistant:a,connectionUUID:s}):s&&!o?await w_e({connectionUUID:s,reason:e}):s&&o?await C_e({connectionUUID:s,reason:e}):await s9({connectorName:r,reason:e,autoDeleteEmailAssistant:a}),onSettled:async(r,s,o)=>{await t.refetchQueries({queryKey:n}),o.autoDeleteEmailAssistant&&(await t.invalidateQueries({queryKey:Oye()}),await t.invalidateQueries({queryKey:Lye()}))},onMutate:async({connectorName:r,connectionUUID:s})=>{t.setQueryData(n,o=>{if(!o)return o;const a=o.connectors.connectors.map(i=>i.name===r&&(!s||i.connection_uuid===s)?{...i,connected:!1}:i);return{...o,connectors:{connectors:a}}})}})}const lT=async e=>{try{const{error:t}=await de.POST("/rest/homepage-widgets/upsell/interacted","homepage upsell interaction tracking",{body:{upsell_name:e.upsellName,upsell_instance_identifier:e.upsellInstanceIdentifier||null,interaction_type:e.interactionType||null},timeoutMs:Ze(),numRetries:1});t&&Z.error("Failed to mark upsell as interacted",{upsellName:e.upsellName,upsellInstanceIdentifier:e.upsellInstanceIdentifier,interactionType:e.interactionType,error:t})}catch(t){Z.error("Error marking upsell as interacted",{upsellName:e.upsellName,upsellInstanceIdentifier:e.upsellInstanceIdentifier,interactionType:e.interactionType,error:t})}},mu=()=>{const e=Vt(),{isMax:t}=Bt(),{openModal:n}=gn().legacy,r=ln(!1);return d.useCallback(o=>{if(!e){Z.warn("User is not logged in, skipping paywall upsell",o);return}if(t){Z.warn("User is on Max tier, skipping paywall upsell",o);return}if(Io()){if(!r){Z.error("Comet adapter not available in mobile Comet browser context");return}r.openNativeSheet("upgrade");return}n("pricingModal",o)},[e,n,t,r])};class $W extends Error{constructor(){super("Failed to open popup window")}}function ISe(e){const{url:t,name:n,options:r="width=600,height=700,popup=1",pollIntervalMs:s=500}=e;return new Promise((o,a)=>{const i=window.open(t,n,r);if(!i){a(new $W);return}const c=setInterval(()=>{i.closed&&(clearInterval(c),o())},s)})}const PSe={logged_out_image_generation:lt.IMAGE_GENERATION_IN_THREAD,logged_out_video_generation:lt.VIDEO_GENERATION_IN_THREAD,subscription_upgrade_video_generation:lt.VIDEO_GENERATION_IN_THREAD,missing_out_on_pro:lt.MISSING_OUT_ON_PRO_IN_THREAD,auto_upgrade_to_pro:lt.AUTO_UPGRADE_TO_PRO,pro_feature_limit_queries:lt.PRO_FEATURE_LIMIT_BANNER,pro_feature_limit_files:lt.PRO_FEATURE_LIMIT_BANNER,login_for_comet_agent_queries:lt.LOGIN_FOR_COMET_AGENT_QUERIES_IN_THREAD,comet_agent_queries_rate_limited:lt.COMET_AGENT_QUERIES_RATE_LIMITED_IN_THREAD,pro_upgrade:lt.PRO_UPGRADE_IN_SIDE_HOMEPAGE,max_feature_limit_labs_queries:lt.PRO_FEATURE_LIMIT_BANNER,enterprise_max_side:lt.ENTERPRISE_MAX_UPSELL,logged_out_canvas_generation:lt.CANVAS_GENERATION_IN_THREAD,free_user_canvas_generation:lt.CANVAS_GENERATION_IN_THREAD,pro_user_canvas_generation:lt.CANVAS_GENERATION_IN_THREAD,wait_for_browser_agent_confirmation:lt.BROWSER_AGENT_CONFIRMATION_IN_THREAD,research_upsell:lt.RESEARCH_UPSELL_IN_THREAD},Tl=({upsellInformation:e,inFlight:t,options:n})=>{const r="upsell",s=Vt(),{openVisitorLoginUpsell:o}=di({enabled:!s}),{session:a}=je(),{trackEvent:i}=Ke(a),{lastResult:c}=an(),{openModal:u,closeModal:f}=gn().legacy,m=Xt();Ca();const p="?handle_upsell=true",{submitQuery:h}=Wo(),g=ln(),{handleVerificationSuccess:y}=fSe({origin:lt.STUDENT_VERIFICATION_UPSELL}),x="sidecar_thread",{subscriptionTier:v}=Bt(),{device:{isWindowsOS:b,isMacOS:_}}=on(),w=Dn(),{handleConnect:S}=iT({reason:r}),{mutateAsync:C}=jSe({reason:r}),{handleCreateNewSpaceForThread:E}=DSe(),{connectors:N}=Sa({reason:r}),{overwriteSources:k,sources:I}=ug({reason:r}),{handleDownloadClick:M}=nSe({isWindows:b,isUnsupportedDevice:!_&&!b}),A=mu(),{openToast:D}=pn(),{$t:P}=J(),F=e?.cta_information?.merge_auth_token,j=hSe({linkToken:(ae=>{if(ae)try{return JSON.parse(ae)}catch{return ae}})(F),onSuccess:()=>{if(e?.cta===nn.MERGE_AUTH_CONNECTOR)return L();if(e?.cta===nn.ALLOW_CONNECTOR_AUTH)return U()}}),L=d.useCallback(()=>{const ae=e?.cta_information?.merge_auth_callback_uuid;ae&&FH({uuid:ae,success:!0,reason:"Account successfully connected"}),w.push(window.location.pathname+p)},[w,e,p]),U=d.useCallback(()=>{const ae=e?.backend_uuid||c?.backend_uuid;cl({uuid:ae,event_type:"CONNECTOR_AUTH",connector_auth_action:!0})},[e,c?.backend_uuid]),O=d.useCallback(async ae=>{const X=ae.cta_information?.connector_auth_url,ee=ae.backend_uuid||c?.backend_uuid;if(!X){Z.error("[ALLOW_CONNECTOR_AUTH] Connector auth URL is not defined",{upsellInformation:ae});return}if(!ee){Z.error("[ALLOW_CONNECTOR_AUTH] Backend UUID is not defined",{upsellInformation:ae});return}try{await ISe({url:X,name:"connector-auth"}),await cl({uuid:ee,event_type:"CONNECTOR_AUTH",connector_auth_action:!0}),n?.hideUpsell?.()}catch(le){le instanceof $W&&D({message:P({defaultMessage:"Failed to open popup window",id:"qLj32oAyS7"}),variant:"error",timeout:null}),Z.error("[ALLOW_CONNECTOR_AUTH] Connector auth failed",{upsellInformation:ae,error:le})}},[c?.backend_uuid,n,P,D]),$=d.useCallback(async ae=>{if(!ae.cta_information?.merge_auth_token){Z.error("[ALLOW_CONNECTOR_AUTH] Merge auth token is not defined",{upsellInformation:ae}),D({message:P({defaultMessage:"Failed to start authentication",id:"VykWDR53do"}),variant:"error",timeout:null});return}j()},[D,P,j]),G=d.useCallback(async ae=>ae.cta_information?.merge_auth_token?$(ae):O(ae),[$,O]),H=d.useCallback(async()=>{try{await g.setCometAsDefaultBrowser("set_default_browser")}catch{}},[g]);d.useEffect(()=>{const ae=new BroadcastChannel(ySe.UPSELL_CONNECTOR);return ae.onmessage=X=>{X.data.type===b9.CONNECTOR_COMPLETE&&(window.focus(),Do(window.location.pathname+p,"Connector complete"))},()=>{ae.close()}},[p]);const Q=d.useCallback(()=>{if(!e)return;switch(e.app_location){case Ns.MODAL:i("upsell modal opened",{entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.IN_THREAD:case Ns.IN_THREAD_BOTTOM:case Ns.IN_THREAD_INPUT:i("thread upsell banner clicked",{entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata,cta:e.cta});break;case Ns.SIDEBAR:case Ns.SIDE_CARD:i("side upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.BANNER:i("banner upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.COMET_NTP_BANNER:i("ntp banner upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break}const ae=e.app_location===Ns.MODAL?"upsell viewed":"upsell clicked";i(ae,{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata,cta:e.cta})},[c,i,e,x,v]),Y=d.useCallback(()=>{c?.query_str&&h({rawQuery:c.query_str,existingEntryUUID:c.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:c.frontend_context_uuid,promptSource:"user",querySource:"rewrite-upsell",attachments:[],modelPreferenceOverride:e?.cta_information?.model_preference??"pplx_pro"})},[c,h,e]),te=d.useCallback(()=>{if(!e)return;const{permalink_new_tab:ae,permalink:X}=e.cta_information??{};X&&(ae?window.open(X,"_blank"):Do(X,"Upsell permalink"))},[e]);return d.useCallback(()=>{if(!e)return;const ae=e.cta===nn.SHORTCUT_MODAL?e.cta_information?.recommended_shortcut?.name:void 0;lT({upsellName:e.name,upsellInstanceIdentifier:ae,interactionType:"click"}),Q();const X=PSe[e.name]??lt.UNSPECIFIED_GENERALIZED_UPSELL;let ee=c?.thread_url_slug?`/search/${c.thread_url_slug}${p}`:void 0;(window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants"))&&(ee=`/b/assistants${p}`);const re=c?.thread_url_slug?`/search/${c.thread_url_slug}`:void 0;switch(e.cta){case nn.SIGN_UP_OR_LOGIN:return;case nn.PRO_UPGRADE:{if((e.app_location===Ns.IN_THREAD||e.app_location===Ns.IN_THREAD_BOTTOM||e.app_location===Ns.IN_THREAD_INPUT)&&Io()){g.openNativeSheet("upgrade");break}A({pitchMessage:e.cta_information?.upgrade_paywall_title?{title:e.cta_information.upgrade_paywall_title}:void 0,origin:X,defaultSegment:e.upsell_type===Qs.UPGRADE_TO_ENTERPRISE?"business":void 0});break}case nn.THREAD_TO_SPACE:{if(!c?.backend_uuid)return;E(c?.backend_uuid,c?.frontend_context_uuid);break}case nn.CONNECTOR:{const ce=e.cta_information?.connector_type;if(ce==="gcal")window.open(`${window.location.origin}${v9}?connector_type=${b9.GCAL_CONNECT}`,"_blank");else if(ce){const pe=N?.connectors?.find(xe=>xe.connection_type===ce)?.name;if(!pe||!Fz(pe)){w.push(v9);break}S({connectorName:pe,redirectPath:ee,unauthedRedirectPath:re})}else Z.error("Unhandled upsell connector type",{connectorType:ce});break}case nn.REWRITE_ANSWER:t&&c?.backend_uuid?lu({entryUUID:c?.backend_uuid,reason:"rewrite-upsell"}).catch(()=>{Z.error("Error terminating entry")}).finally(Y):Y();break;case nn.PERMALINK:{te();break}case nn.SET_DEFAULT_BROWSER:{H();break}case nn.IMAGE_ANNOUNCEMENT_MODAL:{if(!e.image_asset||!e.image_asset_low_res||!e.button_text)return;let ce=e.cta;e.upsell_type===Qs.DOWNLOAD_COMET?ce=nn.COMET_DOWNLOAD:e.upsell_type===Qs.OPEN_PERMALINK&&(ce=nn.PERMALINK),u("announcementImageModal",{imageUrlHd:e.image_asset,imageUrlLowRes:e.image_asset_low_res,title:e.title??"",description:e.description??"",upsellInformation:{...e,cta:ce}});break}case nn.COMET_DOWNLOAD:{M({upsellName:e.name});break}case nn.COMET_DOWNLOAD_1MO_PRO_INCENTIVE:{const ce=e.cta_information?.flow_type,ue=e.cta_information?.trial_extension_id;ce&&ue&&bwe({reason:"comet_upsell_clicked",flowType:ce,trialExtensionId:ue}),M({upsellName:e.name});break}case nn.MERGE_AUTH_CONNECTOR:{F&&j();break}case nn.SHORTCUT_MODAL:{const ce=e.cta_information?.recommended_shortcut;u("taskShortcutModal",{source:"thread_upsell_create",onCreated:n?.hideUpsell,shortcut:ce?{title:ce.name,prompt:ce.prompt}:void 0});break}case nn.VIRTUAL_TRY_ON_ONBOARDING_MODAL:{u("shoppingTryOnOnboardingModal",{onSuccessfulOnboarding:ce=>{m.setQueryData(Cye(),{try_on_photo_url:ce}),m.setQueryData(Sye(),!1),D({message:P({defaultMessage:"Avatar updated successfully!",id:"tjpCN5PY48"}),variant:"success",timeout:3})},onClose:()=>{f()}});break}case nn.OPEN_SHEERID_MODAL:{i("sheerid form redirect",{verificationLocationSource:lt.STUDENT_VERIFICATION_UPSELL,verificationRoleType:"student"}),u("sheerIdModal",{onSuccess:y,type:"student"});break}case nn.CONTINUE_GENERATION:{if(e.upsell_type===Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"CANVAS_GENERATION_CONFIRMATION",canvas_generation_action:!0}).then(()=>{n?.hideUpsell?.()}).catch(ue=>{Z.error("Error sending canvas confirmation",{error:ue})})}break}case nn.NO_CANVAS_GENERATION:{if(e.upsell_type===Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"CANVAS_GENERATION_CONFIRMATION",canvas_generation_action:!1}).then(()=>{n?.hideUpsell?.()}).catch(ue=>{Z.error("Error sending canvas cancellation",{error:ue})})}break}case nn.SKIP_BROWSER_AGENT:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"SKIP"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent skip",{error:ue}),D({message:P({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case nn.ALLOW_BROWSER_AGENT_ONCE:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"ALLOW_ONCE"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent allow once",{error:ue}),D({message:P({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case nn.ALWAYS_ALLOW_BROWSER_AGENT:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"ALWAYS_ALLOW"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent always allow",{error:ue}),D({message:P({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case nn.TOGGLE_SOURCES:{const ce=e.cta_information?.sources_to_toggle;if(ce&&ce.length>0){const ue=Ox(ce);if(ue.length>0){const pe=I||[],xe=ue.filter(he=>!pe.includes(he));if(xe.length>0){const he=[...pe,...xe];k(he)}}n?.hideUpsell?.()}break}case nn.FULLSCREEN_MODAL:{u("fullscreenUpsellModal",{upsellInformation:e});break}case nn.ALLOW_CONNECTOR_AUTH:{G(e);break}}},[g,e,Q,c?.thread_url_slug,c?.backend_uuid,c?.frontend_context_uuid,p,o,A,u,t,E,N?.connectors,S,C,Y,te,H,M,y,F,j,n,i,P,D,f,m,w,k,I,G])},qW=({enabled:e=!0}={})=>{const n=Ln()==="/",{data:r,isLoading:s,isError:o}=gt({enabled:e,queryKey:a3(n),queryFn:ZCe,staleTime:1/0,gcTime:1/0});return{upsellInformation:r?.upsell_information??null,productBanner:r?.product_banner_information??null,isLoading:s,isError:o}},Ks={pro:vpe,collection:Zh,research:wM,labs:_M,comet_login:CM,invite:B("mail"),pro_perks:B("heart-handshake"),app:B("layout-collage"),slides:B("presentation"),document:B("file"),plaintext:B("file"),canvas:B("file"),advanced_models:B("cpu")},OSe=()=>{const{upsellInformation:e}=qW(),{session:t}=je(),{trackEvent:n,trackEventOnce:r}=Ke(t),s=Tl({upsellInformation:e??void 0}),[o,a]=d.useState(!1);d.useEffect(()=>{e&&e.app_location==="BANNER"&&(a(!0),r("banner upsell viewed",{upsellName:e.name,upsellType:e.upsell_type,upsellUuid:e.upsell_uuid,eventMetadata:e.event_metadata}),r("upsell viewed",{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,upsellName:e.name,upsellType:e.upsell_type,eventMetadata:e.event_metadata}))},[e,r]);const i=d.useCallback(()=>{e&&(n("banner upsell dismissed",{upsellName:e.name,upsellType:e.upsell_type,upsellUuid:e.upsell_uuid,eventMetadata:e.event_metadata}),n("upsell dismissed",{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,upsellName:e.name,upsellType:e.upsell_type,eventMetadata:e.event_metadata}),a(!1),lT({upsellName:e.name,interactionType:"dismiss"}))},[e,n]),c=d.useMemo(()=>{if(e&&e.icon_reference&&e.icon_reference in Ks)return Ks[e.icon_reference]},[e]);return d.useMemo(()=>({show:o&&!!e,onDismiss:i,onClick:s,icon:c,title:e?.title,actionLabel:e?.button_text}),[i,s,o,c,e])},C9={RAMP:"Welcome Ramp members. Your 6 month Perplexity Pro free trial starts now!",FREEATT:"Welcome ATT Employees. Your complimentary 1-year subscription starts now!",FREEAWS:"Welcome AWS Employees. Your complimentary 1-year subscription starts now!",RABBIT:"Welcome r1 owners. Your complimentary 1-year Perplexity Pro subscription starts now!",FREEUT:"Welcome UT Staff. Your complimentary 1-year Perplexity Pro subscription starts now!",FREEDATABRICKS:"Welcome Databricks team. Your complimentary 1-year Perplexity Pro subscription starts now!",FREESRA:"Welcome SRA team. Your complimentary 1-year Perplexity Pro subscription starts now!",HBSTECH:"Welcome HBS Tech Conference Attendees. Your complimentary 6 month Perplexity Pro subscription starts now!",HBSSTAFF:"Welcome HBS Tech Conference Attendees. Your complimentary 1 year Perplexity Pro subscription starts now!",FREENEWSROOM:"Welcome Friends! Your complimentary 1-year Perplexity Pro subscription starts now!",FREEINKITT:"Welcome Inkitt Writers! Your complimentary 1-year subscription to Perplexity Pro starts now!",FREETIME:"Welcome Time team! Your complimentary 1-year subscription to Perplexity Pro starts now!",FREETMOBILE:"Welcome T-Mobile team! Your complimentary 1-year subscription to Perplexity Pro starts now!","11LABS":"Welcome! Your complimentary 3-month subscription to Perplexity Pro starts now!",FREECAVS:"Welcome Cavs team! Your complimentary 1-year Perplexity Pro subscription starts now!",NOTHING6:"Welcome Nothing owners. Your complimentary 6-month Perplexity Pro subscription starts now!",FREENOTHING6:"Welcome Nothing owners. Your complimentary 6-month Perplexity Pro subscription starts now!",NOTHING1:"Welcome Nothing owners. Your complimentary 1-year Perplexity Pro subscription starts now!",FREENOTHING1:"Welcome Nothing owners. Your complimentary 1-year Perplexity Pro subscription starts now!",HOOHACKS:"Welcome HooHacks Community. Your 1-year Perplexity Pro free trial starts now!",NJED:"Welcome NJ ED Community. Your 1-year Perplexity Pro free trial starts now!",COPYAI:"Welcome Copy AI customers! Your 6-month complimentary Perplexity Pro subscription starts now!",RAYCAST6:"Welcome Raycast users! Your 6-month complimentary Perplexity Pro subscription starts now!",RAYCAST3:"Welcome Raycast users! Your 3-month complimentary Perplexity Pro subscription starts now!",FREEMAGENTALOVE:"Welcome Deutsche Telekom! Your complimentary 1-year Perplexity Pro subscription starts now!",FREEPPLXVIP:"Welcome friend of Perplexity! Your complimentary 1-year Perplexity Pro subscription starts now.",FREEUTA1:"Welcome UTA team! Your complimentray 1-year Perplexity Pro subscription starts now.",DT:"Willkommen Deutsche Telekom Kunde! Sie erhalten dank Magenta Moments ein kostenloses 1-Jahres-Abonnement für Perplexity Pro.",MY:"Welcome! Your complimentary 1-year Perplexity Pro subscription starts now."},F0="pplx.discount_code",B_="pplx.discount_code_expiry",LSe=()=>{const[e,t]=d.useState(null),[n,r]=d.useState(null),s=Dn(),o=mn(),a=Ln(),i=o?.get("discount_code"),{$t:c}=J(),u=Array.isArray(i)?i[0]:i,[f,m]=d.useState(u||null),{hasAccessToProFeatures:p}=Bt(),h=d.useCallback(()=>{wt.removeItem(F0),wt.removeItem(B_),r(null),t(null)},[]),g=d.useCallback(()=>{h(),m(null)},[h]),y=d.useCallback(()=>{if(n&&e)return;const b=wt.getItem(F0);b?.startsWith("REPLIT")?(t("/static/images/replit.svg"),r("/static/images/replit_dark.svg")):b?.startsWith("BREX")?(t("/static/images/brex.svg"),r("/static/images/brex_dark.svg")):(r(null),t(null))},[n,e]),x=d.useCallback(()=>{const b=wt.getItem(F0),_=wt.getItem(B_);if(p){h();return}if(!(!b&&!u)){if(_&&new Date(_){for(const _ in C9)if(b&&b.startsWith(_))return C9[_];return c({defaultMessage:"Redeem your promo code {discountCode}. Get started",id:"Vapo/CiOwF"},{discountCode:b})},[c]);return d.useEffect(()=>{x()},[u,x]),d.useMemo(()=>({discountCode:f,setDiscountCode:m,partnerLogoDark:n,partnerLogoLight:e,message:v(f??""),clearDiscountCode:g}),[g,f,v,n,e])},FSe=()=>{const{status:e}=je(),t=LH(),{isGovernmentRequestOrigin:n}=Qr(),{isEnterprise:r}=Bt();return{isLoading:e==="loading"||t,isEnterpriseOrGovtUser:r||n===!0}},BSe=()=>be.makeQueryKey("get_experiments_attributes",{}),USe=async({reason:e,headers:t={}})=>{try{const{data:n,error:r}=await de.GET("/rest/experiments/attributes",e,{headers:t,timeoutMs:Ze({productionMs:2e3}),numRetries:1});return r?(Z.error("Failed to fetch experiment attributes",{error:r,reason:e}),null):n??null}catch(n){return Z.error("Error fetching experiment attributes",{error:n,reason:e}),null}},VSe=()=>{const e=Vt(),{data:t,isLoading:n,error:r}=gt({queryKey:BSe(),queryFn:()=>USe({reason:"check if user is an existing comet user"}),staleTime:300*1e3,gcTime:300*1e3,enabled:e,retry:!1});return{isExistingCometUser:d.useMemo(()=>{if(t)return t.server_is_comet_eligible===!1},[t]),isLoading:n,error:r}},HSe=async({reason:e})=>{try{const{data:t,error:n,response:r}=await de.GET("/rest/user/promotions",e,{timeoutMs:Ze({productionMs:2e3})});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch user promotions",cause:n,status:r.status??0});return t}catch{return{campaign:null,offer:null,institution:null}}},qvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/billing/get-customer-portal",t,{headers:e,timeoutMs:3e3});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get customer portal",cause:r,status:s.status??0});if(n.status!=="success")throw new ye("API_CLIENTS_ERROR",{message:"Failed to get customer portal",cause:r,status:s.status??0});return n.url}catch{return null}};async function zSe({currency:e,reason:t,subscriptionTier:n}){const{data:r,error:s,response:o}=await de.GET("/rest/stripe/prices",t,{timeoutMs:Sn.NONE,params:{query:{currency:e,subscription_tier:n}}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch prices",cause:s,status:o.status??0});return r}const Kvt=({currency:e,reason:t,subscriptionTier:n})=>gt({queryKey:be.makeQueryKey("prices",e,n),queryFn:()=>zSe({currency:e,reason:t,subscriptionTier:n}),gcTime:300*1e3,staleTime:120*1e3}),Yvt=async({request:e,reason:t})=>{const n=Rx(),r={"content-type":"application/json",...n?{"Screen-Dimensions":n}:{}};try{const{data:s,error:o,response:a}=await de.POST("/rest/stripe/checkout-session",t,{body:{referral_code:e.referralCode,discount_code:e.discountCode,origin:e.origin,tier:e.tier,locale:e.locale,embedded:e.embedded??!1,subscription_tier:e.subscriptionTier,success_redirect_url:e.success_redirect_url},timeoutMs:5e3,headers:r,reason:t});if(o)throw new ye("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:t}});return{subscriptionStatus:s.subscription_status,status:s.status,url:s.url??null,clientSecret:s.client_secret??void 0,errorCode:s.error_code??void 0,subscriptionTier:e.subscriptionTier}}catch{return}},Qvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/create-setup-intent-and-customer-session",t,{timeoutMs:Ze({productionMs:3e3}),headers:e});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return{customerId:n.customer_id,clientSecret:n.client_secret,customerSessionClientSecret:n.customer_session_client_secret}}catch{return}},WSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/stripe/upgrade-subscription-preview",t,{headers:{"content-type":"application/json",...e},timeoutMs:Sn.HIGH});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch upgrade subscription preview",cause:r,status:s.status??0});return n},GSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/stripe/downgrade-subscription-preview",t,{headers:{"content-type":"application/json",...e},timeoutMs:Sn.HIGH});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch downgrade subscription preview",cause:r,status:s.status??0});return n},Xvt=({reason:e,enabled:t})=>gt({queryKey:Nye(),queryFn:()=>WSe({reason:e}),gcTime:0,staleTime:0,enabled:t}),Zvt=({reason:e})=>gt({queryKey:be.makeQueryKey("downgrade-subscription-preview"),queryFn:()=>GSe({reason:e}),gcTime:0,staleTime:0}),$Se=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/upgrade-subscription",t,{headers:{"content-type":"application/json",...e},timeoutMs:Sn.HIGH});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to upgrade subscription",cause:r,status:s.status??0});return n},Jvt=({reason:e},t)=>{const n="useUpgradeSubscription";return It({retry:!1,mutationFn:()=>$Se({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},qSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/downgrade-subscription",t,{headers:{"content-type":"application/json",...e},timeoutMs:Sn.HIGH});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to downgrade subscription",cause:r,status:s.status??0});return n},ebt=({reason:e},t)=>{const n="useDowngradeSubscription";return It({mutationFn:()=>qSe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},KSe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/stripe/subscription-changes",e,{headers:{"content-type":"application/json"},timeoutMs:Sn.HIGH});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to fetch subscription changes",cause:n,status:r.status??0});return t},tbt=({reason:e,enabled:t})=>gt({queryKey:Rye(),queryFn:()=>KSe({reason:e}),gcTime:0,staleTime:0,enabled:t}),YSe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.POST("/rest/stripe/cancel-downgrade-subscription",e,{headers:{"content-type":"application/json"},timeoutMs:Sn.HIGH});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to cancel downgrade",cause:n,status:r.status??0});return t},nbt=({reason:e},t)=>{const n="useCancelDowngrade";return It({retry:!1,mutationFn:()=>YSe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},rbt=async({paymentMethodUUID:e,optedIn:t})=>{const n="visa-opt-in-submit",{data:r,error:s,response:o}=await de.POST("/rest/billing/personalization/update",n,{body:{enabled:t,payment_method_uuid:e}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to redeem visa",cause:s,status:o.status??0});return r},sbt=async()=>{const{data:e,error:t}=await de.GET("/rest/billing/braintree/subscription-details","braintree-modal-fetch-details",{timeoutMs:5e3});if(t)throw t;return e},obt=async({payment_method_type:e})=>{const{data:t,error:n}=await de.POST("/rest/billing/braintree/cancel-subscription","braintree-modal-cancel",{timeoutMs:5e3,body:{payment_method_type:e}});if(n)throw n;return t},abt=async({payment_method_type:e})=>{const{data:t,error:n}=await de.POST("/rest/billing/braintree/renew-subscription","braintree-modal-renew",{timeoutMs:3e3,body:{payment_method_type:e}});if(n)throw n;return t},QSe=({reason:e})=>{const{$t:t}=J(),{data:n,isLoading:r}=gt({queryKey:xye(),queryFn:()=>HSe({reason:e})}),s=!!n?.institution;let o=n?.offer?.discount_str??void 0;!o&&s&&(o=t({defaultMessage:"$4.99",id:"ngR/pJs1LV"}));const a=n?.offer?.discount_type??void 0;return d.useMemo(()=>({userPromotionsLoading:r,discountPrice:o,discountType:a,showStudentDiscountContent:s,campaignId:n?.campaign?.id,institution:n?.institution}),[n?.campaign?.id,n?.institution,o,a,r,s])};function XSe(){const[e,t]=Qi("pplx.partner_banner",null);return[e,t]}function ZSe(){const[e,t]=Qi("pplx.partner_discount_code",null);return[e,t]}const JSe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"org-invitation-banner",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function e3e({reason:e,enabled:t=!0}){const{variation:n}=JSe(!1),r=Vt(),s=uu(),o=r&&!s&&t&&n,{data:a,isLoading:i}=gt({enabled:o,queryKey:_ye(),queryFn:()=>Zye({reason:e}),staleTime:600*1e3,gcTime:3600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!1});return{pendingInvitation:a??null,isLoading:i}}const t3e="back_to_school_winner",n3e="EDUFREEYEAR",r3e=Se(async()=>{const{UberOnePromoBanner:e}=await Ee(()=>q(()=>import("./UberOnePromoBanner-BLqN5RUP.js"),__vite__mapDeps([130,4,1,6,3,131,9,7,8,10,11,12])));return{default:e}}),s3e=Se(async()=>{const{DiscountCodeBanner:e}=await Ee(()=>q(()=>import("./DiscountCodeBanner-Bhysavsw.js"),__vite__mapDeps([132,4,1,6,3,22,131,9,7,8,10,11,12])));return{default:e}}),S9=Se(async()=>{const{PartnerBanner:e}=await Ee(()=>q(()=>import("./PartnerBanner-Do89sQrD.js"),__vite__mapDeps([133,4,1,8,3,9,6,7,131,10,11,12])));return{default:e}}),o3e=Se(async()=>{const{OrgUpgradeBillingBanner:e}=await Ee(()=>q(()=>import("./OrgBillingBanner-DeY0r0em.js"),__vite__mapDeps([134,4,1,6,3,135,131,9,7,8,10,11,12])));return{default:e}}),a3e=Se(async()=>{const{OrgInvitationBanner:e}=await Ee(()=>q(()=>import("./OrgInvitationBanner-DCWi9huO.js"),__vite__mapDeps([136,4,1,6,3,131,9,7,8,10,11,12])));return{default:e}}),i3e=Se(async()=>{const{AppBannerUpsell:e}=await Ee(()=>q(()=>import("./AppBannerUpsell-BnwL8F-o.js"),__vite__mapDeps([137,4,1,131,9,3,6,7,8,10,11,12])));return{default:e}}),l3e=Se(async()=>{const{CometDownloadBannerUpsell:e}=await Ee(()=>q(()=>import("./CometDownloadBannerUpsell-CRT87q6N.js"),__vite__mapDeps([138,4,1,6,3,131,9,7,8,10,11,12])));return{default:e}}),c3e=e=>["/onboarding/org/create"].includes(e);function u3e(){const e="app-banner-inner",{isMobileUserAgent:t}=Re(),{message:n,discountCode:r,clearDiscountCode:s}=LSe(),{hasAccessToProFeatures:o,isEnterprise:a}=Bt(),i=uu(),[c]=XSe(),[u]=ZSe(),f=Ln(),{organization:m,orgUser:p}=mo({reason:e}),{pendingInvitation:h}=e3e({reason:e}),g=i&&!a,y=p?.role==="ADMIN",{isLoading:x,isEnterpriseOrGovtUser:v}=FSe(),b=mn(),w=QSe({reason:e}).campaignId===t3e,[S,C]=Qi("pplx.back_to_school_winner_banner_dismissed",!1),{show:E,title:N,actionLabel:k}=OSe(),{productBanner:I}=qW(),{isExistingCometUser:M,isLoading:A}=VSe();return x||A?null:f==="/"&&I?.name==="comet_download_banner"&&I?.app_location===Ns.BANNER&&I?.title&&I?.button_text&&!v&&!M?l.jsx(l3e,{title:I.title,actionLabel:I.button_text}):E&&N&&k?l.jsx(i3e,{}):h&&!m&&!p?l.jsx(a3e,{orgName:h.organization_name,invitationUUID:h.invitation_uuid}):y&&g&&!c3e(f??"")&&!t?l.jsx(o3e,{orgStripeStatus:m?.stripe_status}):/(^\/$)|(^\/search)/.test(f??"")&&c?l.jsx(S9,{partnerCode:c,partnerDiscountCode:u}):r&&!o&&!c?l.jsx(s3e,{message:n,discountCode:r,clearDiscountCode:s}):b?.get("utm_campaign")==="morningbrew_083024"&&b?.get("utm_source")==="newsletter"?l.jsx(r3e,{}):w&&!S?l.jsx(S9,{partnerCode:"edu",partnerDiscountCode:n3e,bannerVariant:"orange",onClose:()=>{C(!0)}}):null}const Qc={"fill-foreground":"--foreground-color","fill-quiet":"--foreground-quiet-color","fill-inverse":"--foreground-inverse-color","fill-light":"--dark-foreground-color","fill-dark":"--light-foreground-color","fill-super":"--super-color","fill-caution":"--caution-color","fill-max":"--max-color","stroke-foreground":"--foreground-color","stroke-quiet":"--foreground-quiet-color","stroke-subtler":"--foreground-subtler-color","stroke-inverse":"--foreground-inverse-color","stroke-light":"--dark-foreground-color","stroke-dark":"--light-foreground-color","stroke-super":"--super-color","stroke-caution":"--caution-color"},KW=T.memo(({lineColor:e,width:t,fillColor:n,...r})=>{const s=z("h-auto group",t),o=Qc[n]||"--foreground-color",a=Qc[e]||"--foreground-color";return l.jsx("div",{className:s,style:{"--logo-fill":`oklch(var(${o}))`,"--logo-stroke":`oklch(var(${a}))`},...r,children:l.jsx("svg",{viewBox:"0 0 400 91",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-full"})})})});KW.displayName="Full";const YW=T.memo(({width:e,fillColor:t,...n})=>{const r=z("h-auto group",e),s=Qc[t]||"--foreground-color";return l.jsx("div",{className:r,style:{color:`oklch(var(${s}))`},...n,children:l.jsx("svg",{viewBox:"0 0 1456 187",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-labs"})})})});YW.displayName="Labs";const QW=T.memo(({fillColor:e,width:t,...n})=>{const r=z("h-auto group",t),s=Qc[e]||"--foreground-color";return l.jsx("div",{className:r,style:{color:`oklch(var(${s}))`},...n,children:l.jsx("svg",{viewBox:"0 0 30 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-auto w-full",children:l.jsx("use",{href:"#pplx-logo-mark"})})})});QW.displayName="Mark";const XW=T.memo(({width:e="w-14",fillColor:t="fill-max",svgClassName:n,...r})=>{const s=z("h-auto group",e),o=Qc[t]||"--max-color";return l.jsx("div",{className:s,style:{color:`oklch(var(${o}))`},...r,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 99 36",className:n,children:l.jsx("use",{href:"#pplx-logo-max"})})})});XW.displayName="Max";const ZW=T.memo(({width:e="w-10",sizeVariant:t="regular",fillColor:n="fill-super",svgClassName:r,...s})=>{const o=z("h-auto group",e),a=Qc[n]||"--super-color",i=t==="small"?"pplx-logo-pro-small":"pplx-logo-pro";return l.jsx("div",{className:o,style:{color:`oklch(var(${a}))`},...s,children:t==="small"?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1102.02 529.46",className:r,children:l.jsx("use",{href:`#${i}`})}):l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 804.75 382.36",className:r,children:l.jsx("use",{href:`#${i}`})})})});ZW.displayName="Pro";const JW=T.memo(({width:e,fillColor:t,isPro:n,isMax:r,isEnterprise:s,...o})=>{const a=z("h-auto group",e),i=Qc[t]||"--foreground-color";return s&&n?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--super-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 797 82",children:l.jsx("use",{href:"#pplx-logo-word-ent-pro"})})}):s&&r?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--max-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 797 82",children:l.jsx("use",{href:"#pplx-logo-word-ent-max"})})}):n?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--super-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 3913.07 632",children:l.jsx("use",{href:"#pplx-logo-word-pro"})})}):r?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--max-color))"},...o,children:l.jsx("svg",{viewBox:"0 0 485 74",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-word-max"})})}):l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`},...o,children:l.jsx("svg",{viewBox:"0 0 962 202",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-word"})})})});JW.displayName="Word";const d3e={tiny:"w-4 md:w-6",small:"",md:"w-10","md-large":"w-20",large:"w-24",xl:"w-36"},f3e="w-6 md:w-8",$d=T.memo(({size:e="large",includeEffects:t=!1,isPro:n=!1,isMax:r=!1,isEnterprise:s=!1,variant:o="full",color:a="foreground",...i})=>{let c="w-28 md:w-[140px]";e==="tiny"?c="w-14 md:w-16":e==="small"?c="w-24":e==="large"?c="w-40 md:w-52":e==="xl"&&(c=s?"w-72":"w-64");const u=d3e?.[e]||f3e;let f="w-6";e==="large"?f="w-12":e==="md-large"?f="w-8":e==="xl"&&(f="w-36");const m=z("",{"stroke-foreground":a==="foreground","stroke-quiet":a==="quiet","stroke-super":a==="super"||a==="mixed","stroke-caution":a==="caution","stroke-light":a==="white","stroke-inverse":a==="background","group-hover:stroke-super transition-colors duration-300":t}),p=z({"fill-foreground":a==="foreground"||a==="mixed","fill-quiet":a==="quiet","fill-super":a==="super","fill-caution":a==="caution","fill-light":a==="white","fill-inverse":a==="background","group-hover:fill-super transition-colors duration-300":t});return o==="pro"?l.jsx(ZW,{width:f,fillColor:p,...i}):o==="max"?l.jsx(XW,{width:f,...i}):o==="mark"?l.jsx("div",{className:z({"transition-all duration-300 ease-in-out hover:scale-105":t}),children:l.jsx(QW,{fillColor:p,width:u,...i})}):o==="text"?l.jsx(JW,{fillColor:p,width:c,isPro:n,isMax:r,isEnterprise:s,...i}):o==="full"?l.jsx(KW,{fillColor:p,lineColor:m,width:c,...i}):o==="labs"?l.jsx(YW,{width:c,fillColor:p,...i}):null});$d.displayName="Logo";const m3e="https://perplexity.sng.link/A6awk/ppas?_smtype=3&pvid=",ibt="https://perplexity.sng.link/A6awk/rcv6y?_smtype=3&pvid=",p3e=({origin:e,linkPrefix:t=m3e,isCanonicalDeeplink:n=!1})=>{const r=jU(),[s,o]=d.useState(t),{sendAppDownloadClickedEventSingular:a}=a4(),i=Ln(),c=d.useMemo(()=>{const f=new URLSearchParams;return f.set("origin",e),r&&f.set("pvid",r),i&&f.set("pathname",i),f.toString()},[r,e,i]);d.useEffect(()=>{(async()=>{const{singularSdk:m}=await q(async()=>{const{singularSdk:g}=await import("./singular-sdk-C08EBV6K.js").then(y=>y.s);return{singularSdk:g}},[]);for(;!m._isInitialized;)await new Promise(g=>setTimeout(g,100));let p=null;if(i){const g=i.startsWith("/")?i.slice(1):i;n?p=`${S7}//canonical-page?url=https://www.perplexity.ai/app/${g}`:p=`${S7}//${g}`}const h=m.buildWebToAppLink(`${t}${r}&_ios_dl=${encodeURIComponent(p??"")}&_android_dl=${encodeURIComponent(p??"")}`,p,c,p);o(h)})()},[r,i,c,t,n]);const u=d.useCallback(()=>{lme(),a(e),Do(s,"Singular download app")},[s,e,a]);return d.useMemo(()=>({downloadAppLink:s,handleAppDownloadClicked:u}),[s,u])};function h3e(e,t){d.useEffect(()=>{if(typeof window>"u")return;const r=window.cookieStore;if(!r)return;const s=o=>{const a=o.deleted.find(c=>c.name===e),i=o.changed.find(c=>c.name===e);if(a||i){t(i??null);return}};return r.addEventListener("change",s),()=>{r.removeEventListener("change",s)}},[e,t])}const eG=()=>{const e=d.useCallback(n=>{const r=document.documentElement,s=n??hr("colorSchemeTheme"),o=cV(s);o?r.setAttribute("data-theme",o):r.removeAttribute("data-theme")},[]),t=d.useMemo(()=>Ef(e,100),[e]);h3e("colorSchemeTheme",n=>{t(n?.value)}),d.useEffect(()=>{e()},[e])},tG=zt("AppLayoutContext",void 0),g3e=()=>{const e=d.useContext(tG);if(!e)throw new Error("useAppLayout must be used within an AppLayoutProvider");return e},y3e=({children:e})=>{const[t,n]=d.useState(!1);return eG(),l.jsx(tG.Provider,{value:{isMobileSidebarOpen:t,setMobileSidebarOpen:n},children:e})},x3e=({className:e})=>{const{inApp:t}=Ea(),{isMobileSidebarOpen:n,setMobileSidebarOpen:r}=g3e();return t?null:l.jsx(rt,{icon:B("menu-2"),pill:!0,onClick:()=>r(!n),extraCSS:e})},ze=d.memo(e=>{const{variant:t="common",disabled:n,extraCSS:r,...s}=e,{buttonClass:o}=d.useMemo(()=>{const a={disabled:"bg-subtle text-quiet",primary:"bg-super text-inverse hover:opacity-80",primaryGhost:"border border-super/20 bg-super/10 hover:bg-super/20 hover:border-super/30 text-super",common:"bg-subtle text-foreground md:hover:text-quiet",border:"border border-subtler text-quiet md:hover:border-subtle md:hover:text-quiet hover:bg-subtler bg-base",inverted:"bg-inverse text-inverse hover:opacity-80",rejecter:"border border-subtlest text-caution dark:hover:text-foreground hover:bg-caution/30 hover:border-caution/20 bg-base",rejected:"bg-caution hover:opacity-50 text-white",orange:"bg-attention text-white hover:opacity-50",maxGold:"bg-max dark:text-inverse hover:opacity-80"},i=n?a.disabled:a[t];return{buttonClass:z(i,r)}},[t,n,r]);return l.jsx(Q4,{extraCSS:o,disabled:n,variant:t,...s})});ze.displayName="Button";const v3e=T.memo(({})=>{const{$t:e}=J(),{session:t}=je(),{trackEvent:n}=Ke(t),r=d.useCallback(()=>{n("click logo",{})},[n]),{device:{isIOS:s}}=on(),{handleAppDownloadClicked:o}=p3e({origin:"mobile-header"}),a=d.useMemo(()=>s?bpe:B("brand-android"),[s]);return l.jsx(K,{variant:"background",className:"px-sm h-headerHeight sticky inset-x-0 top-0 z-10 flex w-full items-center md:mb-0",children:l.jsxs("div",{className:"gap-x-sm pl-xs flex w-full items-center justify-between md:hidden",children:[l.jsxs("div",{className:"gap-x-sm flex items-center",children:[l.jsx(x3e,{className:"-ml-sm"}),l.jsx(xt,{href:"/",onClick:r,children:l.jsx($d,{variant:"text",size:"small"})})]}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx("div",{className:"animate-in fade-in duration-300",children:l.jsx(ze,{size:"small",pill:!0,variant:"primary",icon:a,text:e({defaultMessage:"Open in App",id:"fo3x6hDxdZ"}),onClick:o})})})]})})});v3e.displayName="MobileProductHeader";const E9=200,cT=zt("ScrollContainerRefContext",null),b3e=({children:e,scrollContainerRef:t})=>l.jsx(cT.Provider,{value:{scrollContainerRef:t},children:e}),ka=()=>{const e=d.useContext(cT);if(!e)throw new Error("useScrollContainerRef must be used within a ScrollContainerRefProvider");return e},nG=T.memo(e=>{const{children:t,inRenderingPlace:n}=e,s=Ml().erp;return n&&n===s||!n&&s!==void 0?null:l.jsx(l.Fragment,{children:t})});nG.displayName="HideInEntropy";const _3e=()=>{const{locale:e}=J();return mpe(e)==="rtl"};Se(async()=>{const{MobileSidebar:e}=await Ee(()=>q(()=>import("./MobileSidebar-hLO3FIYJ.js"),__vite__mapDeps([139,4,1,9,3,6,7,8,10,11,12])));return{default:e}});const w3e=({children:e,ref:t})=>{const n=d.useRef(null);return l.jsx(y3e,{children:l.jsx(b3e,{scrollContainerRef:n,children:l.jsx(K,{variant:"background",children:l.jsx("div",{className:"isolate flex h-dvh",ref:t,children:e})})})})},C3e=({children:e,fillHeight:t=!0,hasSidebar:n,ref:r})=>{const[s]=Gd("isSidebarPinned",!1),{isMobileStyle:o}=Re({evaluateOnInit:!0}),a=Ln(),i=n&&!Yz(a),c=s&&!o&&i,u=_3e(),f=d.useMemo(()=>u?{paddingRight:c?E9:0}:{paddingLeft:c?E9:0},[u,c]);return l.jsxs("div",{style:{...f,transition:"padding-left 0.2s cubic-bezier(0.16, 1, 0.3, 1), padding-right 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},className:"erp-tab:p-0 md:gap-xs erp-tab:gap-0 isolate flex h-auto max-h-screen min-w-0 grow flex-col",ref:r,children:[l.jsx(nG,{inRenderingPlace:"sidecar",children:l.jsx(u3e,{})}),l.jsxs(K,{variant:"background",className:"@container/main relative isolate min-h-0 flex-1 overflow-clip bg-clip-border",children:[l.jsx("div",{className:z("mx-auto flex w-full flex-col",{"h-full":t}),children:e}),l.jsx(K,{className:z("rounded-inherit pointer-events-none absolute inset-0 z-20 hidden md:dark:block",i&&"md:!border-y-0 md:!border-r-0")})]})]})},Xx=({children:e,className:t,childrenWidth:n,containerClassName:r=""})=>{const{isMobileUserAgent:s}=Re(),o=Vi(n).with("small",()=>"max-w-screen-sm px-md md:px-lg").with("default",()=>"max-w-screen-md px-md md:px-lg").with("static",()=>"max-w-screen-lg px-md py-lg md:px-xl").with("large",()=>"max-w-threadWidth px-md md:px-lg").with("none",()=>"max-w-none").otherwise(()=>"max-w-screen-md px-md md:px-lg"),i=d.useContext(cT)?.scrollContainerRef;return l.jsx("div",{ref:i,className:z("scrollable-container flex flex-1 basis-0 overflow-auto [scrollbar-gutter:stable]",{"scrollbar-subtle":!s},t),children:l.jsx("div",{className:z("mx-auto size-full",o,r),children:e})})};function rG(e){const t=e+"CollectionProvider",[n,r]=Vs(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:x,children:v}=y,b=T.useRef(null),_=T.useRef(new Map).current;return l.jsx(s,{scope:x,itemMap:_,collectionRef:b,children:v})};a.displayName=t;const i=e+"CollectionSlot",c=Xp(i),u=T.forwardRef((y,x)=>{const{scope:v,children:b}=y,_=o(i,v),w=En(x,_.collectionRef);return l.jsx(c,{ref:w,children:b})});u.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=Xp(f),h=T.forwardRef((y,x)=>{const{scope:v,children:b,..._}=y,w=T.useRef(null),S=En(x,w),C=o(f,v);return T.useEffect(()=>(C.itemMap.set(w,{ref:w,..._}),()=>void C.itemMap.delete(w))),l.jsx(p,{[m]:"",ref:S,children:b})});h.displayName=f;function g(y){const x=o(e+"CollectionConsumer",y);return T.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const _=Array.from(b.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((C,E)=>_.indexOf(C.ref.current)-_.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},g,r]}var S3e=d.createContext(void 0);function Lf(e){const t=d.useContext(S3e);return e||t||"ltr"}var U_=0;function uT(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??k9()),document.body.insertAdjacentElement("beforeend",e[1]??k9()),U_++,()=>{U_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),U_--}},[])}function k9(){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 V_="focusScope.autoFocusOnMount",H_="focusScope.autoFocusOnUnmount",M9={bubbles:!1,cancelable:!0},E3e="FocusScope",Zx=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=d.useState(null),u=Js(s),f=Js(o),m=d.useRef(null),p=En(t,y=>c(y)),h=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let y=function(_){if(h.paused||!i)return;const w=_.target;i.contains(w)?m.current=w:ul(m.current,{select:!0})},x=function(_){if(h.paused||!i)return;const w=_.relatedTarget;w!==null&&(i.contains(w)||ul(m.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&ul(i)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const b=new MutationObserver(v);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),b.disconnect()}}},[r,i,h.paused]),d.useEffect(()=>{if(i){A9.add(h);const y=document.activeElement;if(!i.contains(y)){const v=new CustomEvent(V_,M9);i.addEventListener(V_,u),i.dispatchEvent(v),v.defaultPrevented||(k3e(R3e(sG(i)),{select:!0}),document.activeElement===y&&ul(i))}return()=>{i.removeEventListener(V_,u),setTimeout(()=>{const v=new CustomEvent(H_,M9);i.addEventListener(H_,f),i.dispatchEvent(v),v.defaultPrevented||ul(y??document.body,{select:!0}),i.removeEventListener(H_,f),A9.remove(h)},0)}}},[i,u,f,h]);const g=d.useCallback(y=>{if(!n&&!r||h.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const b=y.currentTarget,[_,w]=M3e(b);_&&w?!y.shiftKey&&v===w?(y.preventDefault(),n&&ul(_,{select:!0})):y.shiftKey&&v===_&&(y.preventDefault(),n&&ul(w,{select:!0})):v===b&&y.preventDefault()}},[n,r,h.paused]);return l.jsx(Mt.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});Zx.displayName=E3e;function k3e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ul(r,{select:t}),document.activeElement!==n)return}function M3e(e){const t=sG(e),n=T9(t,e),r=T9(t.reverse(),e);return[n,r]}function sG(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 T9(e,t){for(const n of e)if(!T3e(n,{upTo:t}))return n}function T3e(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 A3e(e){return e instanceof HTMLInputElement&&"select"in e}function ul(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A3e(e)&&t&&e.select()}}var A9=N3e();function N3e(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=N9(e,t),e.unshift(t)},remove(t){e=N9(e,t),e[0]?.resume()}}}function N9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function R3e(e){return e.filter(t=>t.tagName!=="A")}var z_="rovingFocusGroup.onEntryFocus",D3e={bubbles:!1,cancelable:!0},dg="RovingFocusGroup",[N3,oG,j3e]=rG(dg),[I3e,tc]=Vs(dg,[j3e]),[P3e,O3e]=I3e(dg),aG=d.forwardRef((e,t)=>l.jsx(N3.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(N3.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(L3e,{...e,ref:t})})}));aG.displayName=dg;var L3e=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=e,p=d.useRef(null),h=En(t,p),g=Lf(o),[y,x]=fo({prop:a,defaultProp:i??null,onChange:c,caller:dg}),[v,b]=d.useState(!1),_=Js(u),w=oG(n),S=d.useRef(!1),[C,E]=d.useState(0);return d.useEffect(()=>{const N=p.current;if(N)return N.addEventListener(z_,_),()=>N.removeEventListener(z_,_)},[_]),l.jsx(P3e,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:y,onItemFocus:d.useCallback(N=>x(N),[x]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>E(N=>N+1),[]),onFocusableItemRemove:d.useCallback(()=>E(N=>N-1),[]),children:l.jsx(Mt.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:nt(e.onMouseDown,()=>{S.current=!0}),onFocus:nt(e.onFocus,N=>{const k=!S.current;if(N.target===N.currentTarget&&k&&!v){const I=new CustomEvent(z_,D3e);if(N.currentTarget.dispatchEvent(I),!I.defaultPrevented){const M=w().filter(R=>R.focusable),A=M.find(R=>R.active),D=M.find(R=>R.id===y),F=[A,D,...M].filter(Boolean).map(R=>R.ref.current);cG(F,f)}}S.current=!1}),onBlur:nt(e.onBlur,()=>b(!1))})})}),iG="RovingFocusGroupItem",lG=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...i}=e,c=ls(),u=o||c,f=O3e(iG,n),m=f.currentTabStopId===u,p=oG(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:y}=f;return d.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),l.jsx(N3.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(Mt.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:nt(e.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:nt(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:nt(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=U3e(x,f.orientation,f.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=p().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")_.reverse();else if(v==="prev"||v==="next"){v==="prev"&&_.reverse();const w=_.indexOf(x.currentTarget);_=f.loop?V3e(_,w+1):_.slice(w+1)}setTimeout(()=>cG(_))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:y!=null}):a})})});lG.displayName=iG;var F3e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B3e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function U3e(e,t,n){const r=B3e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return F3e[r]}function cG(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function V3e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jx=aG,ev=lG,H3e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Iu=new WeakMap,B0=new WeakMap,U0={},W_=0,uG=function(e){return e&&(e.host||uG(e.parentNode))},z3e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uG(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})},W3e=function(e,t,n,r){var s=z3e(t,Array.isArray(e)?e:[e]);U0[n]||(U0[n]=new WeakMap);var o=U0[n],a=[],i=new Set,c=new Set(s),u=function(m){!m||i.has(m)||(i.add(m),u(m.parentNode))};s.forEach(u);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(p){if(i.has(p))f(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",y=(Iu.get(p)||0)+1,x=(o.get(p)||0)+1;Iu.set(p,y),o.set(p,x),a.push(p),y===1&&g&&B0.set(p,!0),x===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),i.clear(),W_++,function(){a.forEach(function(m){var p=Iu.get(m)-1,h=o.get(m)-1;Iu.set(m,p),o.set(m,h),p||(B0.has(m)||m.removeAttribute(r),B0.delete(m)),h||m.removeAttribute(n)}),W_--,W_||(Iu=new WeakMap,Iu=new WeakMap,B0=new WeakMap,U0={})}},dT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=H3e(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),W3e(r,s,n,"aria-hidden")):function(){return null}},iy="right-scroll-bar-position",ly="width-before-scroll-bar",G3e="with-scroll-bars-hidden",$3e="--removed-body-scroll-bar-size";function G_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function q3e(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var K3e=typeof window<"u"?d.useLayoutEffect:d.useEffect,R9=new WeakMap;function Y3e(e,t){var n=q3e(null,function(r){return e.forEach(function(s){return G_(s,r)})});return K3e(function(){var r=R9.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(i){o.has(i)||G_(i,null)}),o.forEach(function(i){s.has(i)||G_(i,a)})}R9.set(n,e)},[e]),n}function Q3e(e){return e}function X3e(e,t){t===void 0&&(t=Q3e);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(i){return o(i)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(o),a=n}var c=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return s}function Z3e(e){e===void 0&&(e={});var t=X3e(null);return t.options=kr({async:!0,ssr:!1},e),t}var dG=function(e){var t=e.sideCar,n=VU(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,kr({},n))};dG.isSideCarExport=!0;function J3e(e,t){return e.useMedium(t),dG}var fG=Z3e(),$_=function(){},tv=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:$_,onWheelCapture:$_,onTouchMoveCapture:$_}),s=r[0],o=r[1],a=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,_=VU(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,S=Y3e([n,t]),C=kr(kr({},_),s);return d.createElement(d.Fragment,null,f&&d.createElement(w,{sideCar:fG,removeScrollBar:u,shards:m,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:b}),a?d.cloneElement(d.Children.only(i),kr(kr({},C),{ref:S})):d.createElement(v,kr({},C,{className:c,ref:S}),i))});tv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tv.classNames={fullWidth:ly,zeroRight:iy};var eEe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tEe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=eEe();return t&&e.setAttribute("nonce",t),e}function nEe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rEe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sEe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tEe())&&(nEe(t,n),rEe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oEe=function(){var e=sEe();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mG=function(){var e=oEe(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},aEe={left:0,top:0,right:0,gap:0},q_=function(e){return parseInt(e||"",10)||0},iEe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[q_(n),q_(r),q_(s)]},lEe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aEe;var t=iEe(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])}},cEe=mG(),Ed="data-scroll-locked",uEe=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),` - .`.concat(G3e,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(i,"px ").concat(r,`; - } - body[`).concat(Ed,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(i,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(iy,` { - right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(ly,` { - margin-right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(iy," .").concat(iy,` { - right: 0 `).concat(r,`; - } - - .`).concat(ly," .").concat(ly,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Ed,`] { - `).concat($3e,": ").concat(i,`px; - } -`)},D9=function(){var e=parseInt(document.body.getAttribute(Ed)||"0",10);return isFinite(e)?e:0},dEe=function(){d.useEffect(function(){return document.body.setAttribute(Ed,(D9()+1).toString()),function(){var e=D9()-1;e<=0?document.body.removeAttribute(Ed):document.body.setAttribute(Ed,e.toString())}},[])},fEe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;dEe();var o=d.useMemo(function(){return lEe(s)},[s]);return d.createElement(cEe,{styles:uEe(o,!t,s,n?"":"!important")})},R3=!1;if(typeof window<"u")try{var V0=Object.defineProperty({},"passive",{get:function(){return R3=!0,!0}});window.addEventListener("test",V0,V0),window.removeEventListener("test",V0,V0)}catch{R3=!1}var Pu=R3?{passive:!1}:!1,mEe=function(e){return e.tagName==="TEXTAREA"},pG=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!mEe(e)&&n[t]==="visible")},pEe=function(e){return pG(e,"overflowY")},hEe=function(e){return pG(e,"overflowX")},j9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=hG(e,r);if(s){var o=gG(e,r),a=o[1],i=o[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gEe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},yEe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hG=function(e,t){return e==="v"?pEe(t):hEe(t)},gG=function(e,t){return e==="v"?gEe(t):yEe(t)},xEe=function(e,t){return e==="h"&&t==="rtl"?-1:1},vEe=function(e,t,n,r,s){var o=xEe(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,c=t.contains(i),u=!1,f=a>0,m=0,p=0;do{var h=gG(e,i),g=h[0],y=h[1],x=h[2],v=y-x-o*g;(g||v)&&hG(e,i)&&(m+=v,p+=g),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(p)<1)&&(u=!0),u},H0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},I9=function(e){return[e.deltaX,e.deltaY]},P9=function(e){return e&&"current"in e?e.current:e},bEe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_Ee=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},wEe=0,Ou=[];function CEe(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),s=d.useState(wEe++)[0],o=d.useState(mG)[0],a=d.useRef(e);d.useEffect(function(){a.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=We([e.lockRef.current],(e.shards||[]).map(P9),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=d.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=H0(y),b=n.current,_="deltaX"in y?y.deltaX:b[0]-v[0],w="deltaY"in y?y.deltaY:b[1]-v[1],S,C=y.target,E=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in y&&E==="h"&&C.type==="range")return!1;var N=j9(E,C);if(!N)return!0;if(N?S=E:(S=E==="v"?"h":"v",N=j9(E,C)),!N)return!1;if(!r.current&&"changedTouches"in y&&(_||w)&&(r.current=S),!S)return!0;var k=r.current||S;return vEe(k,x,y,k==="h"?_:w)},[]),c=d.useCallback(function(y){var x=y;if(!(!Ou.length||Ou[Ou.length-1]!==o)){var v="deltaY"in x?I9(x):H0(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&bEe(S.delta,v)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var _=(a.current.shards||[]).map(P9).filter(Boolean).filter(function(S){return S.contains(x.target)}),w=_.length>0?i(x,_[0]):!a.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),u=d.useCallback(function(y,x,v,b){var _={name:y,delta:x,target:v,should:b,shadowParent:SEe(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),f=d.useCallback(function(y){n.current=H0(y),r.current=void 0},[]),m=d.useCallback(function(y){u(y.type,I9(y),y.target,i(y,e.lockRef.current))},[]),p=d.useCallback(function(y){u(y.type,H0(y),y.target,i(y,e.lockRef.current))},[]);d.useEffect(function(){return Ou.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Pu),document.addEventListener("touchmove",c,Pu),document.addEventListener("touchstart",f,Pu),function(){Ou=Ou.filter(function(y){return y!==o}),document.removeEventListener("wheel",c,Pu),document.removeEventListener("touchmove",c,Pu),document.removeEventListener("touchstart",f,Pu)}},[]);var h=e.removeScrollBar,g=e.inert;return d.createElement(d.Fragment,null,g?d.createElement(o,{styles:_Ee(s)}):null,h?d.createElement(fEe,{gapMode:e.gapMode}):null)}function SEe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const EEe=J3e(fG,CEe);var fg=d.forwardRef(function(e,t){return d.createElement(tv,kr({},e,{ref:t,sideCar:EEe}))});fg.classNames=tv.classNames;var D3=["Enter"," "],kEe=["ArrowDown","PageUp","Home"],yG=["ArrowUp","PageDown","End"],MEe=[...kEe,...yG],TEe={ltr:[...D3,"ArrowRight"],rtl:[...D3,"ArrowLeft"]},AEe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mg="Menu",[ih,NEe,REe]=rG(mg),[pu,xG]=Vs(mg,[REe,kf,tc]),pg=kf(),vG=tc(),[bG,nc]=pu(mg),[DEe,hg]=pu(mg),_G=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,i=pg(t),[c,u]=d.useState(null),f=d.useRef(!1),m=Js(o),p=Lf(s);return d.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),l.jsx(yx,{...i,children:l.jsx(bG,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:u,children:l.jsx(DEe,{scope:t,onClose:d.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};_G.displayName=mg;var jEe="MenuAnchor",fT=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=pg(n);return l.jsx(xx,{...s,...r,ref:t})});fT.displayName=jEe;var mT="MenuPortal",[IEe,wG]=pu(mT,{forceMount:void 0}),CG=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=nc(mT,t);return l.jsx(IEe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(vx,{asChild:!0,container:s,children:r})})})};CG.displayName=mT;var To="MenuContent",[PEe,pT]=pu(To),SG=d.forwardRef((e,t)=>{const n=wG(To,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=nc(To,e.__scopeMenu),a=hg(To,e.__scopeMenu);return l.jsx(ih.Provider,{scope:e.__scopeMenu,children:l.jsx(Hr,{present:r||o.open,children:l.jsx(ih.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(OEe,{...s,ref:t}):l.jsx(LEe,{...s,ref:t})})})})}),OEe=d.forwardRef((e,t)=>{const n=nc(To,e.__scopeMenu),r=d.useRef(null),s=En(t,r);return d.useEffect(()=>{const o=r.current;if(o)return dT(o)},[]),l.jsx(hT,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:nt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),LEe=d.forwardRef((e,t)=>{const n=nc(To,e.__scopeMenu);return l.jsx(hT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),FEe=Xp("MenuContent.ScrollLock"),hT=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...y}=e,x=nc(To,n),v=hg(To,n),b=pg(n),_=vG(n),w=NEe(n),[S,C]=d.useState(null),E=d.useRef(null),N=En(t,E,x.onContentChange),k=d.useRef(0),I=d.useRef(""),M=d.useRef(0),A=d.useRef(null),D=d.useRef("right"),P=d.useRef(0),F=g?fg:d.Fragment,R=g?{as:FEe,allowPinchZoom:!0}:void 0,j=U=>{const O=I.current+U,$=w().filter(se=>!se.disabled),G=document.activeElement,H=$.find(se=>se.ref.current===G)?.textValue,Q=$.map(se=>se.textValue),Y=QEe(Q,O,H),te=$.find(se=>se.textValue===Y)?.ref.current;(function se(ae){I.current=ae,window.clearTimeout(k.current),ae!==""&&(k.current=window.setTimeout(()=>se(""),1e3))})(O),te&&setTimeout(()=>te.focus())};d.useEffect(()=>()=>window.clearTimeout(k.current),[]),uT();const L=d.useCallback(U=>D.current===A.current?.side&&ZEe(U,A.current?.area),[]);return l.jsx(PEe,{scope:n,searchRef:I,onItemEnter:d.useCallback(U=>{L(U)&&U.preventDefault()},[L]),onItemLeave:d.useCallback(U=>{L(U)||(E.current?.focus(),C(null))},[L]),onTriggerLeave:d.useCallback(U=>{L(U)&&U.preventDefault()},[L]),pointerGraceTimerRef:M,onPointerGraceIntentChange:d.useCallback(U=>{A.current=U},[]),children:l.jsx(F,{...R,children:l.jsx(Zx,{asChild:!0,trapped:s,onMountAutoFocus:nt(o,U=>{U.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(bx,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,children:l.jsx(Jx,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:nt(c,U=>{v.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(hM,{role:"menu","aria-orientation":"vertical","data-state":VG(x.open),"data-radix-menu-content":"",dir:v.dir,...b,...y,ref:N,style:{outline:"none",...y.style},onKeyDown:nt(y.onKeyDown,U=>{const $=U.target.closest("[data-radix-menu-content]")===U.currentTarget,G=U.ctrlKey||U.altKey||U.metaKey,H=U.key.length===1;$&&(U.key==="Tab"&&U.preventDefault(),!G&&H&&j(U.key));const Q=E.current;if(U.target!==Q||!MEe.includes(U.key))return;U.preventDefault();const te=w().filter(se=>!se.disabled).map(se=>se.ref.current);yG.includes(U.key)&&te.reverse(),KEe(te)}),onBlur:nt(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(k.current),I.current="")}),onPointerMove:nt(e.onPointerMove,lh(U=>{const O=U.target,$=P.current!==U.clientX;if(U.currentTarget.contains(O)&&$){const G=U.clientX>P.current?"right":"left";D.current=G,P.current=U.clientX}}))})})})})})})});SG.displayName=To;var BEe="MenuGroup",gT=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Mt.div,{role:"group",...r,ref:t})});gT.displayName=BEe;var UEe="MenuLabel",EG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Mt.div,{...r,ref:t})});EG.displayName=UEe;var s2="MenuItem",O9="menu.itemSelect",nv=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=d.useRef(null),a=hg(s2,e.__scopeMenu),i=pT(s2,e.__scopeMenu),c=En(t,o),u=d.useRef(!1),f=()=>{const m=o.current;if(!n&&m){const p=new CustomEvent(O9,{bubbles:!0,cancelable:!0});m.addEventListener(O9,h=>r?.(h),{once:!0}),zme(m,p),p.defaultPrevented?u.current=!1:a.onClose()}};return l.jsx(kG,{...s,ref:c,disabled:n,onClick:nt(e.onClick,f),onPointerDown:m=>{e.onPointerDown?.(m),u.current=!0},onPointerUp:nt(e.onPointerUp,m=>{u.current||m.currentTarget?.click()}),onKeyDown:nt(e.onKeyDown,m=>{const p=i.searchRef.current!=="";n||p&&m.key===" "||D3.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});nv.displayName=s2;var kG=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=pT(s2,n),i=vG(n),c=d.useRef(null),u=En(t,c),[f,m]=d.useState(!1),[p,h]=d.useState("");return d.useEffect(()=>{const g=c.current;g&&h((g.textContent??"").trim())},[o.children]),l.jsx(ih.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:l.jsx(ev,{asChild:!0,...i,focusable:!r,children:l.jsx(Mt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:nt(e.onPointerMove,lh(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:nt(e.onPointerLeave,lh(g=>a.onItemLeave(g))),onFocus:nt(e.onFocus,()=>m(!0)),onBlur:nt(e.onBlur,()=>m(!1))})})})}),VEe="MenuCheckboxItem",MG=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(DG,{scope:e.__scopeMenu,checked:n,children:l.jsx(nv,{role:"menuitemcheckbox","aria-checked":o2(n)?"mixed":n,...s,ref:t,"data-state":vT(n),onSelect:nt(s.onSelect,()=>r?.(o2(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MG.displayName=VEe;var TG="MenuRadioGroup",[HEe,zEe]=pu(TG,{value:void 0,onValueChange:()=>{}}),AG=d.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Js(r);return l.jsx(HEe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(gT,{...s,ref:t})})});AG.displayName=TG;var NG="MenuRadioItem",RG=d.forwardRef((e,t)=>{const{value:n,...r}=e,s=zEe(NG,e.__scopeMenu),o=n===s.value;return l.jsx(DG,{scope:e.__scopeMenu,checked:o,children:l.jsx(nv,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":vT(o),onSelect:nt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});RG.displayName=NG;var yT="MenuItemIndicator",[DG,WEe]=pu(yT,{checked:!1}),jG=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=WEe(yT,n);return l.jsx(Hr,{present:r||o2(o.checked)||o.checked===!0,children:l.jsx(Mt.span,{...s,ref:t,"data-state":vT(o.checked)})})});jG.displayName=yT;var GEe="MenuSeparator",IG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Mt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});IG.displayName=GEe;var $Ee="MenuArrow",PG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=pg(n);return l.jsx(gM,{...s,...r,ref:t})});PG.displayName=$Ee;var xT="MenuSub",[qEe,OG]=pu(xT),LG=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,o=nc(xT,t),a=pg(t),[i,c]=d.useState(null),[u,f]=d.useState(null),m=Js(s);return d.useEffect(()=>(o.open===!1&&m(!1),()=>m(!1)),[o.open,m]),l.jsx(yx,{...a,children:l.jsx(bG,{scope:t,open:r,onOpenChange:m,content:u,onContentChange:f,children:l.jsx(qEe,{scope:t,contentId:ls(),triggerId:ls(),trigger:i,onTriggerChange:c,children:n})})})};LG.displayName=xT;var rp="MenuSubTrigger",FG=d.forwardRef((e,t)=>{const n=nc(rp,e.__scopeMenu),r=hg(rp,e.__scopeMenu),s=OG(rp,e.__scopeMenu),o=pT(rp,e.__scopeMenu),a=d.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},f=d.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return d.useEffect(()=>f,[f]),d.useEffect(()=>{const m=i.current;return()=>{window.clearTimeout(m),c(null)}},[i,c]),l.jsx(fT,{asChild:!0,...u,children:l.jsx(kG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":VG(n.open),...e,ref:Gc(t,s.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:nt(e.onPointerMove,lh(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:nt(e.onPointerLeave,lh(m=>{f();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,g=h==="right",y=g?-5:5,x=p[g?"left":"right"],v=p[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+y,y:m.clientY},{x,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x,y:p.bottom}],side:h}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:nt(e.onKeyDown,m=>{const p=o.searchRef.current!=="";e.disabled||p&&m.key===" "||TEe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});FG.displayName=rp;var BG="MenuSubContent",UG=d.forwardRef((e,t)=>{const n=wG(To,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=nc(To,e.__scopeMenu),a=hg(To,e.__scopeMenu),i=OG(BG,e.__scopeMenu),c=d.useRef(null),u=En(t,c);return l.jsx(ih.Provider,{scope:e.__scopeMenu,children:l.jsx(Hr,{present:r||o.open,children:l.jsx(ih.Slot,{scope:e.__scopeMenu,children:l.jsx(hT,{id:i.contentId,"aria-labelledby":i.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:nt(e.onFocusOutside,f=>{f.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:nt(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:nt(e.onKeyDown,f=>{const m=f.currentTarget.contains(f.target),p=AEe[a.dir].includes(f.key);m&&p&&(o.onOpenChange(!1),i.trigger?.focus(),f.preventDefault())})})})})})});UG.displayName=BG;function VG(e){return e?"open":"closed"}function o2(e){return e==="indeterminate"}function vT(e){return o2(e)?"indeterminate":e?"checked":"unchecked"}function KEe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function YEe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QEe(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=YEe(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function XEe(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;or!=p>r&&n<(m-u)*(r-f)/(p-f)+u&&(s=!s)}return s}function ZEe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return XEe(n,t)}function lh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var JEe=_G,eke=fT,tke=CG,nke=SG,rke=gT,ske=EG,oke=nv,ake=MG,ike=AG,lke=RG,cke=jG,uke=IG,dke=PG,fke=LG,mke=FG,pke=UG,rv="DropdownMenu",[hke]=Vs(rv,[xG]),cs=xG(),[gke,HG]=hke(rv),zG=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=cs(t),u=d.useRef(null),[f,m]=fo({prop:s,defaultProp:o??!1,onChange:a,caller:rv});return l.jsx(gke,{scope:t,triggerId:ls(),triggerRef:u,contentId:ls(),open:f,onOpenChange:m,onOpenToggle:d.useCallback(()=>m(p=>!p),[m]),modal:i,children:l.jsx(JEe,{...c,open:f,onOpenChange:m,dir:r,modal:i,children:n})})};zG.displayName=rv;var WG="DropdownMenuTrigger",GG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=HG(WG,n),a=cs(n);return l.jsx(eke,{asChild:!0,...a,children:l.jsx(Mt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Gc(t,o.triggerRef),onPointerDown:nt(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:nt(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});GG.displayName=WG;var yke="DropdownMenuPortal",$G=e=>{const{__scopeDropdownMenu:t,...n}=e,r=cs(t);return l.jsx(tke,{...r,...n})};$G.displayName=yke;var qG="DropdownMenuContent",KG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=HG(qG,n),o=cs(n),a=d.useRef(!1);return l.jsx(nke,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:nt(e.onCloseAutoFocus,i=>{a.current||s.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:nt(e.onInteractOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.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)"}})});KG.displayName=qG;var xke="DropdownMenuGroup",YG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(rke,{...s,...r,ref:t})});YG.displayName=xke;var vke="DropdownMenuLabel",QG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(ske,{...s,...r,ref:t})});QG.displayName=vke;var bke="DropdownMenuItem",XG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(oke,{...s,...r,ref:t})});XG.displayName=bke;var _ke="DropdownMenuCheckboxItem",ZG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(ake,{...s,...r,ref:t})});ZG.displayName=_ke;var wke="DropdownMenuRadioGroup",Cke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(ike,{...s,...r,ref:t})});Cke.displayName=wke;var Ske="DropdownMenuRadioItem",Eke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(lke,{...s,...r,ref:t})});Eke.displayName=Ske;var kke="DropdownMenuItemIndicator",Mke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(cke,{...s,...r,ref:t})});Mke.displayName=kke;var Tke="DropdownMenuSeparator",JG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(uke,{...s,...r,ref:t})});JG.displayName=Tke;var Ake="DropdownMenuArrow",Nke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(dke,{...s,...r,ref:t})});Nke.displayName=Ake;var Rke=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:o}=e,a=cs(t),[i,c]=fo({prop:r,defaultProp:o??!1,onChange:s,caller:"DropdownMenuSub"});return l.jsx(fke,{...a,open:i,onOpenChange:c,children:n})},Dke="DropdownMenuSubTrigger",e$=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(mke,{...s,...r,ref:t})});e$.displayName=Dke;var jke="DropdownMenuSubContent",t$=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(pke,{...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)"}})});t$.displayName=jke;var Ike=zG,Pke=GG,n$=$G,Oke=KG,Lke=YG,Fke=QG,r$=XG,s$=ZG,Bke=JG,Uke=Rke,Vke=e$,Hke=t$;const zke=li("",{variants:{disabled:{false:"text-foreground",true:"text-quiet"},highlighted:{false:"",true:"bg-subtle"},shouldShowFocusRing:{false:"",true:"interactable"},isInteractable:{false:"",true:"reset hover:bg-subtler cursor-pointer"},rounded:{false:"",true:"rounded-lg"}},defaultVariants:{disabled:!1,highlighted:!1,shouldShowFocusRing:!1,isInteractable:!1,rounded:!1}});function Wke(e){return typeof e=="string"}function a2(e){return typeof e=="string"||typeof e=="function"}function o$({ref:e,children:t,leadingAccessory:n,trailingAccessory:r,subtitle:s,disabled:o=!1,highlighted:a=!1,shouldShowFocusRing:i=!1,rounded:c=!1,className:u,role:f,href:m,target:p,rel:h,...g}){const y=!!f,x=!!m,v=!m&&f==="button",b=z(u,"w-full gap-sm px-sm flex select-none items-center py-1.5 font-sans text-[13px] leading-loose",zke({disabled:o,highlighted:a,shouldShowFocusRing:i,isInteractable:y&&!o,rounded:c})),_=l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:Wke(n)?"flex shrink-0 items-center":"shrink-0 self-start pt-[0.275rem]",children:a2(n)?l.jsx(Jt,{icon:n,size:"small"}):n}),l.jsx("div",{className:"flex-1",children:l.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[t,s&&l.jsx("span",{className:"text-quiet whitespace-pre-wrap pb-1 text-[11px] leading-tight",children:s})]})}),r&&l.jsx("div",{className:"ml-auto flex self-start pt-[0.275rem]",children:a2(r)?l.jsx(Jt,{icon:r,size:"small"}):r})]});if(v)return l.jsx(jo,{ref:e,type:"button",disabled:o,className:b,...g,children:_});if(x){if(o)return l.jsx("span",{ref:e,role:f,className:z("reset",b),...g,children:_});const{onClick:w,...S}=g;return l.jsx(GS,{ref:e,role:f,href:m,target:p,rel:h,__dangerousDoNotUseShouldApplyFocusIndicator:f==="link",className:b,__dangerousDoNotUseOnClick:w,...S,children:_})}return l.jsx("div",{ref:e,role:f,className:b,...g,children:_})}function lbt(e){return l.jsx(o$,{...e})}const j3=o$,Gke={tiny:"tiny",small:"tiny",default:"tiny",large:"small"},L9=e=>{const t=wx(e),{showChevron:n=!0}=e;return z(t,{"justify-between":n})},$ke=({variant:e})=>z("ml-1","shrink-0",{"text-quiet":e==="tonal"});function qke({ref:e,children:t,icon:n,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,variant:i="primary",size:c="default",disabled:u=!1,onClick:f,leadingAccessory:m,rounded:p=!1,showChevron:h=!0,tooltipSide:g="top",tooltipAlign:y="center",__dangerousHtmlProps:x={},...v}){const b=_x(e),_=wa(v),w=Gke[c];if(n){const S=l.jsxs(jo,{ref:b,..._,disabled:u,className:L9({variant:i,size:c,disabled:u,fullWidth:!1,rounded:p,showChevron:h}),onClick:f,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,...x,children:[l.jsx(Jt,{icon:n,size:c}),h&&l.jsx("div",{className:"ml-1 shrink-0",children:l.jsx(Jt,{icon:B("chevron-down"),size:c})})]});return u?S:l.jsx(Hs,{content:r,side:g,align:y,children:S})}return l.jsxs(jo,{ref:b,..._,disabled:u,className:L9({variant:i,size:c,disabled:u,fullWidth:!0,showChevron:h}),onClick:f,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,...x,children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[m&&l.jsx("div",{className:"mr-1 shrink-0",children:a2(m)?l.jsx(Jt,{icon:m,size:c}):m}),l.jsx("span",{className:z("text-box-trim-both","truncate",{"pl-1":m,"pr-1":!0,"min-w-0":!0}),children:t})]}),h&&l.jsx("div",{className:$ke({variant:i}),children:l.jsx(Jt,{icon:B("chevron-down"),size:w})})]})}function bT(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var sv="Checkbox",[Kke]=Vs(sv),[Yke,_T]=Kke(sv);function Qke(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:a,name:i,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:m}=e,[p,h]=fo({prop:n,defaultProp:s??!1,onChange:c,caller:sv}),[g,y]=d.useState(null),[x,v]=d.useState(null),b=d.useRef(!1),_=g?!!a||!!g.closest("form"):!0,w={checked:p,disabled:o,setChecked:h,control:g,setControl:y,name:i,form:a,value:f,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Al(s)?!1:s,isFormControl:_,bubbleInput:x,setBubbleInput:v};return l.jsx(Yke,{scope:t,...w,children:Xke(m)?m(w):r})}var a$="CheckboxTrigger",i$=d.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:a,disabled:i,checked:c,required:u,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=_T(a$,e),y=En(s,f),x=d.useRef(c);return d.useEffect(()=>{const v=o?.form;if(v){const b=()=>m(x.current);return v.addEventListener("reset",b),()=>v.removeEventListener("reset",b)}},[o,m]),l.jsx(Mt.button,{type:"button",role:"checkbox","aria-checked":Al(c)?"mixed":c,"aria-required":u,"data-state":d$(c),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:y,onKeyDown:nt(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:nt(n,v=>{m(b=>Al(b)?!0:!b),g&&h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})});i$.displayName=a$;var wT=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:c,onCheckedChange:u,form:f,...m}=e;return l.jsx(Qke,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:i,required:a,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:p})=>l.jsxs(l.Fragment,{children:[l.jsx(i$,{...m,ref:t,__scopeCheckbox:n}),p&&l.jsx(u$,{__scopeCheckbox:n})]})})});wT.displayName=sv;var l$="CheckboxIndicator",CT=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=_T(l$,n);return l.jsx(Hr,{present:r||Al(o.checked)||o.checked===!0,children:l.jsx(Mt.span,{"data-state":d$(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});CT.displayName=l$;var c$="CheckboxBubbleInput",u$=d.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:i,disabled:c,name:u,value:f,form:m,bubbleInput:p,setBubbleInput:h}=_T(c$,e),g=En(n,h),y=bT(o),x=yM(r);d.useEffect(()=>{const b=p;if(!b)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(y!==o&&S){const E=new Event("click",{bubbles:C});b.indeterminate=Al(o),S.call(b,Al(o)?!1:o),b.dispatchEvent(E)}},[p,y,o,s]);const v=d.useRef(Al(o)?!1:o);return l.jsx(Mt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:i,disabled:c,name:u,value:f,form:m,...t,tabIndex:-1,ref:g,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});u$.displayName=c$;function Xke(e){return typeof e=="function"}function Al(e){return e==="indeterminate"}function d$(e){return Al(e)?"indeterminate":e?"checked":"unchecked"}const Zke=li("reset interactable flex select-none items-center justify-center rounded border border-solid transition-colors duration-150",{variants:{size:{large:"size-6",default:"size-[18px]",small:"size-[14px]"},disabled:{false:"cursor-pointer",true:"cursor-default opacity-50"},checked:{false:"border-subtle bg-background",true:"border-super bg-super"}},compoundVariants:[{checked:!1,disabled:!1,class:"hover:border-subtle hover:bg-subtle"},{checked:!0,disabled:!1,class:"hover:opacity-80"}],defaultVariants:{size:"default",disabled:!1,checked:!1}});function Jke({checked:e=!1,onCheckedChange:t,"aria-label":n,size:r="default",disabled:s=!1,tabIndex:o=0}){return l.jsx(wT,{checked:e,onCheckedChange:t,disabled:s,"aria-label":n,className:Zke({size:r,disabled:s,checked:e}),tabIndex:o,children:l.jsx(CT,{className:"text-inverse flex items-center justify-center",children:l.jsx(ft,{name:B("check"),size:r==="small"?14:16})})})}const e5e=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function Ja({ref:e,children:t,leadingAccessory:n,trailingAccessory:r,subtitle:s,role:o="menuitem",...a}){const i=wa(a),c=i["data-disabled"]===""||i["data-disabled"]==="true"||a["aria-disabled"]===!0||a["aria-disabled"]==="true",u=i["data-highlighted"]===""||i["data-highlighted"]==="true"||i["data-state"]==="open",f=!e5e.has(o);return l.jsx(j3,{ref:e,role:o,disabled:c,highlighted:u,shouldShowFocusRing:f,leadingAccessory:n,trailingAccessory:r,subtitle:s,rounded:!0,className:z(a.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...i,children:t})}function t5e({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Vo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||n(!t)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>l.jsx(Jke,{checked:t,onCheckedChange:n,disabled:s,"aria-label":"",size:"small",tabIndex:c?-1:0}),[t,s,c,n]);return c?l.jsx(Ja,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"checkbox","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(s$,{asChild:!0,disabled:s,checked:t,onCheckedChange:n,onSelect:u,textValue:r,...i,children:l.jsx(Ja,{leadingAccessory:o,trailingAccessory:p,subtitle:a,children:e})})}function n5e({label:e,children:t}){const{isMobileStyle:n}=Vo(),r=d.useId();return n?l.jsxs("div",{role:"group","aria-labelledby":r,children:[l.jsx("div",{id:r,className:"text-foreground font-medium p-2 text-xs",children:e}),l.jsx("div",{children:t})]}):l.jsxs(Lke,{children:[l.jsx(Fke,{className:"text-foreground font-medium p-2 text-xs",children:e}),t]})}const f$=d.createContext(null);function r5e(){return d.useContext(f$)}function s5e({children:e,close:t}){const n={close:t};return l.jsx(f$.Provider,{value:n,children:e})}const m$=d.createContext(null);function p$(){return d.useContext(m$)}function o5e(){return p$()?.closeMobileMenu}function I3({children:e,submenus:t}){const r={closeMobileMenu:r5e()?.close,submenus:t??{closeAll:()=>{},register:()=>{},unregister:()=>{}}};return l.jsx(m$.Provider,{value:r,children:e})}const a5e=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function h$({ref:e,className:t,children:n,role:r="menuitem",asChild:s,disabled:o,onSelect:a,textValue:i,...c}){const u=!a5e.has(r),f=z("reset flex",{interactable:u,"pointer-events-none":o},t);return l.jsx(r$,{ref:e,disabled:o,onSelect:a,textValue:i,asChild:s,className:f,...s?{}:{role:r},...c,children:n})}function i5e({children:e,textValue:t,disabled:n,onSelect:r,leadingAccessory:s,trailingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Vo(),u=o5e(),f=d.useCallback(()=>{if(!n)return r(),!0},[n,r]),m=d.useCallback(()=>{f()&&u?.()},[f,u]),p=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(),u?.())},[f,u]);return c?l.jsx(Ja,{leadingAccessory:s,trailingAccessory:o,subtitle:a,role:"button",tabIndex:n?-1:0,onClick:m,onKeyDown:p,"aria-disabled":n,...i,children:e}):l.jsx(h$,{disabled:n,onSelect:f,textValue:t,asChild:!0,...i,children:l.jsx(Ja,{leadingAccessory:s,trailingAccessory:o,subtitle:a,children:e})})}const l5e=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function F9({ref:e,href:t,target:n,rel:r,children:s,leadingAccessory:o,trailingAccessory:a,subtitle:i,role:c="menuitem",...u}){const f=wa(u),m=f["data-disabled"]===""||f["data-disabled"]==="true"||u["aria-disabled"]===!0||u["aria-disabled"]==="true",p=f["data-highlighted"]===""||f["data-highlighted"]==="true",h=!l5e.has(c);return t?l.jsx(j3,{ref:e,role:"menuitem",href:t,target:n,rel:r,disabled:m,highlighted:p,shouldShowFocusRing:h,leadingAccessory:o,trailingAccessory:a,subtitle:i,rounded:!0,className:z(u.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...f,children:s}):l.jsx(j3,{ref:e,role:"menuitem",disabled:m,highlighted:p,shouldShowFocusRing:h,leadingAccessory:o,trailingAccessory:a,subtitle:i,rounded:!0,className:z(u.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...f,children:s})}function c5e({children:e,disabled:t,href:n,...r}){const{isMobileStyle:s}=Vo();return s?l.jsx(F9,{href:n,"aria-disabled":t,role:"link",...r,children:e}):l.jsx(r$,{asChild:!0,disabled:t,children:l.jsx(F9,{href:n,...r,children:e})})}function u5e(e,[t,n]){return Math.min(n,Math.max(t,e))}function d5e(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var ST="ScrollArea",[g$]=Vs(ST),[f5e,Go]=g$(ST),y$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[i,c]=d.useState(null),[u,f]=d.useState(null),[m,p]=d.useState(null),[h,g]=d.useState(null),[y,x]=d.useState(null),[v,b]=d.useState(0),[_,w]=d.useState(0),[S,C]=d.useState(!1),[E,N]=d.useState(!1),k=En(t,M=>c(M)),I=Lf(s);return l.jsx(f5e,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:i,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:E,onScrollbarYEnabledChange:N,onCornerWidthChange:b,onCornerHeightChange:w,children:l.jsx(Mt.div,{dir:I,...a,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});y$.displayName=ST;var x$="ScrollAreaViewport",v$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=Go(x$,n),i=d.useRef(null),c=En(t,i,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(Mt.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});v$.displayName=x$;var fi="ScrollAreaScrollbar",b$=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Go(fi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,i=e.orientation==="horizontal";return d.useEffect(()=>(i?o(!0):a(!0),()=>{i?o(!1):a(!1)}),[i,o,a]),s.type==="hover"?l.jsx(m5e,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(p5e,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(_$,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx(ET,{...r,ref:t}):null});b$.displayName=fi;var m5e=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Go(fi,e.__scopeScrollArea),[o,a]=d.useState(!1);return d.useEffect(()=>{const i=s.scrollArea;let c=0;if(i){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(Hr,{present:n||o,children:l.jsx(_$,{"data-state":o?"visible":"hidden",...r,ref:t})})}),p5e=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Go(fi,e.__scopeScrollArea),o=e.orientation==="horizontal",a=av(()=>c("SCROLL_END"),100),[i,c]=d5e("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 d.useEffect(()=>{if(i==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,s.scrollHideDelay,c]),d.useEffect(()=>{const u=s.viewport,f=o?"scrollLeft":"scrollTop";if(u){let m=u[f];const p=()=>{const h=u[f];m!==h&&(c("SCROLL"),a()),m=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[s.viewport,o,c,a]),l.jsx(Hr,{present:n||i!=="hidden",children:l.jsx(ET,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:nt(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:nt(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),_$=d.forwardRef((e,t)=>{const n=Go(fi,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=d.useState(!1),i=e.orientation==="horizontal",c=av(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=Go(fi,e.__scopeScrollArea),o=d.useRef(null),a=d.useRef(0),[i,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=E$(i.viewport,i.content),f={...r,sizes:i,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function m(p,h){return _5e(p,a.current,i,h)}return n==="horizontal"?l.jsx(h5e,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,h=B9(p,i,s.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=m(p,s.dir))}}):n==="vertical"?l.jsx(g5e,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,h=B9(p,i);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=m(p))}}):null}),h5e=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Go(fi,e.__scopeScrollArea),[a,i]=d.useState(),c=d.useRef(null),u=En(t,c,o.onScrollbarXChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),l.jsx(C$,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ov(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,m)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),M$(p,m)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:l2(a.paddingLeft),paddingEnd:l2(a.paddingRight)}})}})}),g5e=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Go(fi,e.__scopeScrollArea),[a,i]=d.useState(),c=d.useRef(null),u=En(t,c,o.onScrollbarYChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),l.jsx(C$,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ov(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,m)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),M$(p,m)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:l2(a.paddingTop),paddingEnd:l2(a.paddingBottom)}})}})}),[y5e,w$]=g$(fi),C$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=e,h=Go(fi,n),[g,y]=d.useState(null),x=En(t,k=>y(k)),v=d.useRef(null),b=d.useRef(""),_=h.viewport,w=r.content-r.viewport,S=Js(f),C=Js(c),E=av(m,10);function N(k){if(v.current){const I=k.clientX-v.current.left,M=k.clientY-v.current.top;u({x:I,y:M})}}return d.useEffect(()=>{const k=I=>{const M=I.target;g?.contains(M)&&S(I,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,g,w,S]),d.useEffect(C,[r,C]),qd(g,E),qd(h.content,E),l.jsx(y5e,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Js(o),onThumbPointerUp:Js(a),onThumbPositionChange:C,onThumbPointerDown:Js(i),children:l.jsx(Mt.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:nt(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),v.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),N(k))}),onPointerMove:nt(e.onPointerMove,N),onPointerUp:nt(e.onPointerUp,k=>{const I=k.target;I.hasPointerCapture(k.pointerId)&&I.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),i2="ScrollAreaThumb",S$=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=w$(i2,e.__scopeScrollArea);return l.jsx(Hr,{present:n||s.hasThumb,children:l.jsx(x5e,{ref:t,...r})})}),x5e=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=Go(i2,n),a=w$(i2,n),{onThumbPositionChange:i}=a,c=En(t,m=>a.onThumbChange(m)),u=d.useRef(void 0),f=av(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const m=o.viewport;if(m){const p=()=>{if(f(),!u.current){const h=w5e(m,i);u.current=h,i()}};return i(),m.addEventListener("scroll",p),()=>m.removeEventListener("scroll",p)}},[o.viewport,f,i]),l.jsx(Mt.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(e.onPointerDownCapture,m=>{const h=m.target.getBoundingClientRect(),g=m.clientX-h.left,y=m.clientY-h.top;a.onThumbPointerDown({x:g,y})}),onPointerUp:nt(e.onPointerUp,a.onThumbPointerUp)})});S$.displayName=i2;var kT="ScrollAreaCorner",v5e=d.forwardRef((e,t)=>{const n=Go(kT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(b5e,{...e,ref:t}):null});v5e.displayName=kT;var b5e=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Go(kT,n),[o,a]=d.useState(0),[i,c]=d.useState(0),u=!!(o&&i);return qd(s.scrollbarX,()=>{const f=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(f),c(f)}),qd(s.scrollbarY,()=>{const f=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(f),a(f)}),u?l.jsx(Mt.div,{...r,ref:t,style:{width:o,height:i,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function l2(e){return e?parseInt(e,10):0}function E$(e,t){const n=e/t;return isNaN(n)?0:n}function ov(e){const t=E$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _5e(e,t,n,r="ltr"){const s=ov(n),o=s/2,a=t||o,i=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-i,f=n.content-n.viewport,m=r==="ltr"?[0,f]:[f*-1,0];return k$([c,u],m)(e)}function B9(e,t,n="ltr"){const r=ov(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,i=o-r,c=n==="ltr"?[0,a]:[a*-1,0],u=u5e(e,c);return k$([0,a],[0,i])(u)}function k$(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 M$(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,i=n.top!==o.top;(a||i)&&t(),n=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function av(e,t){const n=Js(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function qd(e,t){const n=Js(t);Wme(()=>{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])}var T$=y$,A$=v$,P3=b$,O3=S$;function L3({children:e,maxHeight:t,className:n="",onScroll:r}){const s=d.useCallback(()=>{r?.()},[r]);return l.jsxs(T$,{className:z("w-full overflow-hidden group",n),children:[l.jsx(A$,{className:"w-full",style:t?{maxHeight:t}:void 0,onScroll:s,children:e}),l.jsx(P3,{forceMount:!0,orientation:"vertical",className:"flex flex-col p-px duration-150 opacity-0 group-hover:opacity-100 data-[state=visible]:opacity-100",children:l.jsx(O3,{className:"relative rounded-full duration-quick !w-[5px] bg-[color:oklch(var(--foreground-color)/0.15)] before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:size-full before:min-w-[10px] before:min-h-[10px]"})})]})}function C5e(){const e=d.useRef(new Map),t=d.useCallback((s,o)=>{e.current.set(s,o)},[]),n=d.useCallback(s=>{e.current.delete(s)},[]);return{closeAll:d.useCallback(()=>{e.current.forEach(s=>s())},[]),register:t,unregister:n}}function S5e(e){const t=p$(),n=d.useId();d.useEffect(()=>{if(t)return t.submenus.register(n,e),()=>{t.submenus.unregister(n)}},[t,n,e])}function N$({children:e,maxHeightPx:t=300,minWidthPx:n,maxWidthPx:r}){const s=C5e(),o=d.useCallback(()=>{s.closeAll()},[s]),a=cme(o,100),i=`min(calc(var(--radix-dropdown-menu-content-available-height) - 16px), ${t}px)`;return l.jsx(I3,{submenus:s,children:l.jsx("div",{className:"bg-base shadow-overlay border-subtlest p-xs rounded-lg",style:{maxWidth:r,minWidth:n},children:l.jsx(L3,{maxHeight:i,onScroll:a,children:e})})})}var E5e="Separator",U9="horizontal",k5e=["horizontal","vertical"],R$=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=U9,...s}=e,o=M5e(r)?r:U9,i=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Mt.div,{"data-orientation":o,...i,...s,ref:t})});R$.displayName=E5e;function M5e(e){return k5e.includes(e)}var T5e=R$;const V9="border-subtlest my-xs mx-sm border-t first:hidden last:hidden";function A5e(){const{isMobileStyle:e}=Vo();return e?l.jsx(T5e,{className:V9}):l.jsx(Bke,{className:V9})}const N5e=4,R5e=-4;function D5e(){return z("data-[state=open]:animate-slideLeftAndFadeIn","data-[state=closed]:animate-slideLeftAndFadeOut")}function j5e({isOpen:e,onToggle:t,triggerElement:n,children:r,disabled:s=!1,minWidthPx:o,maxHeightPx:a=300,maxWidthPx:i}){const{isMobileStyle:c}=Vo(),[u,f]=d.useState(!1),m=e??u,p=d.useCallback(x=>{s||(t?t(x):f(x))},[s,t]),h=d.useCallback(()=>{t?t(!1):f(!1)},[t]);S5e(h);const g=d.useCallback(()=>{p(!m)},[p,m]),y=d.useCallback(x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),g())},[g]);if(c){const x=d.cloneElement(n,{disabled:s,onClick:g,onKeyDown:y,isExpanded:m});return l.jsxs("div",{children:[x,m&&l.jsx("div",{className:"border-subtlest ml-sm pl-md mt-xs flex flex-col gap-px border-l-2",children:r})]})}return l.jsxs(Uke,{open:m,onOpenChange:p,children:[l.jsx(Vke,{asChild:!0,disabled:s,children:n}),l.jsx(n$,{children:l.jsx(Hke,{sideOffset:N5e,alignOffset:R5e,className:D5e(),children:l.jsx(N$,{minWidthPx:o,maxHeightPx:a,maxWidthPx:i,children:r})})})]})}function I5e({children:e,disabled:t,leadingAccessory:n,subtitle:r,isExpanded:s,...o}){const{isMobileStyle:a}=Vo();return a?l.jsx(Ja,{leadingAccessory:n,trailingAccessory:l.jsx("div",{className:z("transition-transform",{"rotate-90":s}),children:l.jsx(Jt,{icon:B("chevron-right"),size:"small"})}),subtitle:r,role:"button",tabIndex:t?-1:0,"aria-disabled":t,"aria-expanded":s,...o,children:e}):l.jsx(Ja,{leadingAccessory:n,trailingAccessory:l.jsx(Jt,{icon:B("chevron-right"),size:"small"}),subtitle:r,"aria-disabled":t,...o,children:e})}var iv="Switch",[P5e]=Vs(iv),[O5e,L5e]=P5e(iv),D$=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:c="on",onCheckedChange:u,form:f,...m}=e,[p,h]=d.useState(null),g=En(t,_=>h(_)),y=d.useRef(!1),x=p?f||!!p.closest("form"):!0,[v,b]=fo({prop:s,defaultProp:o??!1,onChange:u,caller:iv});return l.jsxs(O5e,{scope:n,checked:v,disabled:i,children:[l.jsx(Mt.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":O$(v),"data-disabled":i?"":void 0,disabled:i,value:c,...m,ref:g,onClick:nt(e.onClick,_=>{b(w=>!w),x&&(y.current=_.isPropagationStopped(),y.current||_.stopPropagation())})}),x&&l.jsx(P$,{control:p,bubbles:!y.current,name:r,value:c,checked:v,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});D$.displayName=iv;var j$="SwitchThumb",I$=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=L5e(j$,n);return l.jsx(Mt.span,{"data-state":O$(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});I$.displayName=j$;var F5e="SwitchBubbleInput",P$=d.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),i=En(a,o),c=bT(n),u=yM(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});P$.displayName=F5e;function O$(e){return e?"checked":"unchecked"}var B5e=D$,U5e=I$;const V5e=li(z("reset interactable relative inline-block shrink-0 rounded-full shadow-inset-xs","transition-colors duration-150"),{variants:{size:{large:"h-[26px] w-11",default:"h-[22px] w-9",small:"h-[14px] w-6"},disabled:{false:"cursor-pointer",true:"cursor-default opacity-50"},checked:{false:"bg-inverse/45 dark:bg-inverse/20",true:"bg-super dark:bg-super/85"}},compoundVariants:[],defaultVariants:{size:"default",disabled:!1,checked:!1}}),H5e=li(z("pointer-events-none absolute block rounded-full","bg-base dark:bg-inverse","before:content-[''] before:absolute before:inset-0 before:rounded-full before:bg-base dark:before:bg-white dark:before:shadow-md","transition-transform before:transition-opacity duration-150 before:duration-150"),{variants:{size:{large:"size-5 data-[state=checked]:translate-x-[18px] left-three top-three",default:"size-4 data-[state=checked]:translate-x-[14px] left-three top-three",small:"size-2.5 data-[state=checked]:translate-x-[10px] left-two top-two"},disabled:{false:"",true:"before:opacity-20"},checked:{false:"",true:""}},compoundVariants:[],defaultVariants:{size:"default",disabled:!1,checked:!1}});function gg({ref:e,checked:t=!1,onCheckedChange:n,"aria-label":r,size:s="default",disabled:o=!1,tabIndex:a=0,...i}){const c=_x(e),u=wa(i);return l.jsx(B5e,{ref:c,...u,checked:t,onCheckedChange:n,disabled:o,"aria-label":r,className:V5e({size:s,disabled:o,checked:t}),tabIndex:a,children:l.jsx(U5e,{className:H5e({size:s,disabled:o,checked:t})})})}function z5e({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Vo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||n(!t)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>l.jsx(gg,{checked:t,onCheckedChange:n,disabled:s,"aria-label":"",size:"small",tabIndex:c?-1:0}),[t,s,c,n]);return c?l.jsx(Ja,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"switch","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(s$,{asChild:!0,disabled:s,checked:t,onCheckedChange:n,onSelect:u,textValue:r,...i,children:l.jsx(Ja,{leadingAccessory:o,trailingAccessory:p,subtitle:a,children:e})})}var lv="Dialog",[L$]=Vs(lv),[W5e,Ma]=L$(lv),F$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,i=d.useRef(null),c=d.useRef(null),[u,f]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:lv});return l.jsx(W5e,{scope:t,triggerRef:i,contentRef:c,contentId:ls(),titleId:ls(),descriptionId:ls(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(m=>!m),[f]),modal:a,children:n})};F$.displayName=lv;var B$="DialogTrigger",U$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(B$,n),o=En(t,s.triggerRef);return l.jsx(Mt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":AT(s.open),...r,ref:o,onClick:nt(e.onClick,s.onOpenToggle)})});U$.displayName=B$;var MT="DialogPortal",[G5e,V$]=L$(MT,{forceMount:void 0}),H$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ma(MT,t);return l.jsx(G5e,{scope:t,forceMount:n,children:d.Children.map(r,a=>l.jsx(Hr,{present:n||o.open,children:l.jsx(vx,{asChild:!0,container:s,children:a})}))})};H$.displayName=MT;var c2="DialogOverlay",z$=d.forwardRef((e,t)=>{const n=V$(c2,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ma(c2,e.__scopeDialog);return o.modal?l.jsx(Hr,{present:r||o.open,children:l.jsx(q5e,{...s,ref:t})}):null});z$.displayName=c2;var $5e=Xp("DialogOverlay.RemoveScroll"),q5e=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(c2,n);return l.jsx(fg,{as:$5e,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Mt.div,{"data-state":AT(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xc="DialogContent",W$=d.forwardRef((e,t)=>{const n=V$(Xc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ma(Xc,e.__scopeDialog);return l.jsx(Hr,{present:r||o.open,children:o.modal?l.jsx(K5e,{...s,ref:t}):l.jsx(Y5e,{...s,ref:t})})});W$.displayName=Xc;var K5e=d.forwardRef((e,t)=>{const n=Ma(Xc,e.__scopeDialog),r=d.useRef(null),s=En(t,n.contentRef,r);return d.useEffect(()=>{const o=r.current;if(o)return dT(o)},[]),l.jsx(G$,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:nt(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&o.preventDefault()}),onFocusOutside:nt(e.onFocusOutside,o=>o.preventDefault())})}),Y5e=d.forwardRef((e,t)=>{const n=Ma(Xc,e.__scopeDialog),r=d.useRef(!1),s=d.useRef(!1);return l.jsx(G$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),G$=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,i=Ma(Xc,n),c=d.useRef(null),u=En(t,c);return uT(),l.jsxs(l.Fragment,{children:[l.jsx(Zx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(bx,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":AT(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Q5e,{titleId:i.titleId}),l.jsx(Z5e,{contentRef:c,descriptionId:i.descriptionId})]})]})}),TT="DialogTitle",$$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(TT,n);return l.jsx(Mt.h2,{id:s.titleId,...r,ref:t})});$$.displayName=TT;var q$="DialogDescription",K$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(q$,n);return l.jsx(Mt.p,{id:s.descriptionId,...r,ref:t})});K$.displayName=q$;var Y$="DialogClose",Q$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(Y$,n);return l.jsx(Mt.button,{type:"button",...r,ref:t,onClick:nt(e.onClick,()=>s.onOpenChange(!1))})});Q$.displayName=Y$;function AT(e){return e?"open":"closed"}var X$="DialogTitleWarning",[cbt,Z$]=Gme(X$,{contentName:Xc,titleName:TT,docsSlug:"dialog"}),Q5e=({titleId:e})=>{const t=Z$(X$),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 d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},X5e="DialogDescriptionWarning",Z5e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Z$(X5e).contentName}}.`;return d.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},NT=F$,J$=U$,RT=H$,DT=z$,jT=W$,eq=$$,ubt=K$,tq=Q$;function J5e({modal:e,props:t}){const{openStackedModal:n}=Ho(),r=d.useRef(null);return d.useEffect(()=>{if(e)return r.current=n(e,t),()=>{r.current&&(r.current.closeModal(),r.current=null)}},[e,n,t]),null}const eMe=d.memo(J5e),tMe=()=>null,nMe=tMe,rMe={onClose:()=>{},legacyIdentifier:"__NONE__"};function sMe(){return z("fixed inset-0","bg-black/50","data-[state=open]:animate-fadeIn","data-[state=closed]:animate-fadeOut")}function oMe(){return z("bg-base","fixed inset-x-0 bottom-0","pb-lg","flex flex-col","max-h-[90vh]","shadow-lg","data-[state=open]:animate-slideUpAndFadeIn","data-[state=closed]:animate-slideDownAndFadeOut")}function nq({isOpen:e,onToggle:t,triggerElement:n,children:r}){const s=d.useCallback(()=>t(!1),[t]);return l.jsx(s5e,{close:s,children:l.jsxs(NT,{open:e,onOpenChange:t,children:[l.jsx(J$,{asChild:!0,children:n}),l.jsxs(RT,{children:[l.jsx(DT,{className:sMe()}),l.jsxs(jT,{className:oMe(),"aria-describedby":void 0,children:[l.jsx(KU,{children:l.jsx(eq,{})}),l.jsxs("div",{className:"px-md pt-14 flex-1 overflow-y-auto",children:[l.jsx(eMe,{modal:nMe,props:rMe}),r]}),l.jsx("div",{className:"absolute top-md right-md z-10",children:l.jsx(tq,{asChild:!0,children:l.jsx(Ct,{icon:B("x"),variant:"text",size:"default",rounded:!0,"aria-label":"Close"})})})]})]})]})})}function aMe({isOpen:e,onToggle:t,onOpen:n}){const r=d.useRef(e);return d.useEffect(()=>{e&&!r.current&&n?.(),r.current=e},[e,n]),{handleToggle:d.useCallback(o=>{o&&!r.current&&e===void 0&&n?.(),r.current=o,t?.(o)},[e,n,t])}}const iMe=e=>l.jsx("span",{className:z(["text-super"],{"opacity-0":!e}),children:l.jsx(Jt,{icon:B("check"),size:"small"})});function lMe({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Vo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||t||n(!0)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>iMe(t),[t]);return c?l.jsx(Ja,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"radio","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(h$,{onSelect:u,className:"focus:outline-none",children:l.jsx(Ja,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"radio","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e})})}const cMe=4,uMe=8;function dMe({isOpen:e,onToggle:t,onOpen:n,triggerElement:r,children:s,minWidthPx:o,maxHeightPx:a=300,maxWidthPx:i,offset:c=cMe,align:u="start",modal:f=!1,portalTargetElement:m,__dangerouslySetZIndex:p}){const{isMobileStyle:h}=Vo(),{handleToggle:g}=aMe({isOpen:e,onToggle:t,onOpen:n});return h?l.jsx(nq,{isOpen:e,onToggle:g,triggerElement:r,children:l.jsx(I3,{children:s})}):l.jsx(I3,{children:l.jsxs(Ike,{open:e,onOpenChange:g,modal:f,children:[l.jsx(Pke,{asChild:!0,children:r}),l.jsx(n$,{container:m,children:l.jsx(Oke,{align:u,sideOffset:c,className:fMe({zIndex:mMe(m)?p:void 0}),collisionPadding:uMe,children:l.jsx(N$,{minWidthPx:o,maxHeightPx:a,maxWidthPx:i,children:s})})})]})})}const _t=Object.assign(dMe,{Button:qke,Item:i5e,CheckboxItem:t5e,LinkItem:c5e,RadioItem:lMe,Separator:A5e,SwitchItem:z5e,Submenu:j5e,SubmenuItem:I5e,Group:n5e});function fMe({zIndex:e}){return z("origin-[var(--radix-dropdown-menu-content-transform-origin)]","data-[state=open]:animate-scaleAndFadeIn","data-[state=closed]:animate-scaleAndFadeOut",{"z-10":e===10})}function mMe(e){return e!=null&&e!==document.body}const pMe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"cf-ping",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},cy="recentItems";async function hMe({reason:e}){try{const{error:t}=await de.GET("/rest/ping",e);if(t)throw t;return}catch(t){Z.error("Failed to ping.",t);return}}async function gMe({reason:e}){try{const{data:t,error:n,response:r}=await de.GET("/rest/thread/list_recent",e);if(n||!t)throw new ye("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t}catch(t){throw Z.error("Failed to get recent threads.",t),t}}const yMe=({reason:e})=>{const{variation:t}=pMe(!1),n=d.useRef(t);n.current=t;const{isIncognito:r}=tW({reason:e}),{inFlightLatest:s}=an(),{session:o}=je(),a=o?.user?.email,{data:i,refetch:c,isLoading:u}=gt({queryKey:be.makeQueryKey(cy,a),queryFn:async()=>{if(!a||r)return Ie;const f=await gMe({reason:e});return n.current&&hMe({reason:e}),f}});return d.useEffect(()=>{s||c({cancelRefetch:!1})},[s,c]),d.useMemo(()=>!a||r?{data:[],isLoading:!1}:{data:i??Ie,isLoading:u},[i,a,r,u])};function xMe({activeStreams:e,streams:t,threads:n,entries:r}){return Array.from(e).reverse().map(s=>{const o=t[s];if(!o)return;const a=o.threadId;if(!a)return;const c=n.find(f=>f.id===a)?.entryIds?.[0];if(!c)return;const u=r[c];if(u)return{id:a,slug:u.thread_url_slug,title:u.thread_title??u.query_str??o.placeholderChunk?.query_str??"",rwToken:u.read_write_token,lastUpdated:u.updated_datetime,contextUUID:u.context_uuid,collectionInfo:u.collection_info,displayModel:u.display_model,entryUUID:u.uuid,socialInfo:u.social_info,focus:u.search_focus,mode:u.mode,source:u.source,streamCreatedAt:u.stream_created_at}}).filter(s=>s!=null)}function vMe(){const e=zs(),{activeStreams:t,streams:n,threads:r,entries:s}=e.getState();return d.useMemo(()=>{const o=xMe({activeStreams:t,streams:n,threads:r,entries:s}),a=new Set;return o.filter(i=>!i.slug||a.has(i.slug)?!1:(a.add(i.slug),!0))},[t,n,r,s])}function bMe({reason:e}){const{data:t,isLoading:n}=yMe({reason:e}),r=vMe();return d.useMemo(()=>({isLoading:n,data:[...r.filter(s=>!t.some(o=>o.link.split("/").pop()===s.slug)).filter(s=>!t.some(o=>o.uuid===s.id)).filter(s=>s.slug!==null).map(s=>({uuid:s.id,variant:"thread",link:`/search/${s.slug}`,title:s.title??"",isStreaming:!0,unread:!1})),...t]}),[t,r,n])}const _Me=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"close-sidecar-on-open-in-new-tab",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},wMe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"sidecar-back-to-thread-button",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function F3(e){return e&&"is_widget"in e&&e.is_widget===!0}function CMe(e){return e&&"card_type"in e}function H9(e){return"is_code_interpreter"in e&&e.is_code_interpreter===!0&&e.is_image}const cv=({reason:e})=>{const t=Xt(),{searchTerm:n}=GW(),r=Px({search_term:n??""}),s=gz(),o=Pve(),a=Ove(),i=zs(),c=vz(),u=el(),{mutate:f}=It({mutationKey:["removeWidget"],mutationFn:async({entryUUID:g,data:y})=>F3(y)?b_e({backendUUID:g,url:y.url,rwToken:u,reason:e}):Promise.resolve(),onMutate:async({entryUUID:g,data:y})=>{await t.cancelQueries({queryKey:be.makeQueryKey("results")}),c(g,x=>F3(y)?{...x,widget_data:x.widget_data?.filter(v=>v.url!==y.url)}:x)}}),{mutate:m}=It({mutationFn:async g=>{try{const{error:y,response:x}=await de.DELETE("/rest/thread/delete_all_threads",e,{body:{delete_all:g==="all"},timeoutMs:0});if(y)throw new ye("API_CLIENTS_ERROR",{cause:y,status:x.status??0})}catch(y){Z.error(y)}},onMutate:async g=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:Zt()});const y=t.getQueryData(r),x=t.getQueryData(Zt()),v=[];return g==="all"?(t.setQueryData(Zt(),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.map(S=>({...S,thread_count:0})));return{...b,pages:_}}),t.setQueryData(r,b=>({...b,pages:[]}))):g==="standalone"&&t.setQueryData(r,b=>({...b,pages:b.pages.map(_=>_.filter(w=>w.collection?.uuid?!0:(v.push(w.uuid),!1)))})),{previousThreads:y,previousCollections:x,deletedUUIDs:v}},onSettled:(g,y,x,v)=>{y?(t.setQueryData(r,v?.previousThreads),t.setQueryData(Zt(),v?.previousCollections)):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:Zt()}),t.invalidateQueries({queryKey:_d()}),t.invalidateQueries({queryKey:be.makeQueryKey(cy)}),x==="all"?(s(),i.getState().threads.forEach(b=>a(b.id))):x==="standalone"&&v?.deletedUUIDs.forEach(b=>{o(b),s(b)}))}}),{mutate:p}=It({mutationFn:async({entryUUID:g,callback:y})=>{y?.(),await v_e({entryUUID:g,rwToken:u,callback:y,reason:e})},onMutate:async({entryUUID:g,collectionSlug:y})=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:Zt()});const x=t.getQueryData(r),v=t.getQueryData(Zt());return t.setQueryData(r,b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.filter(S=>S.uuid!==g));return{...b,pages:_}}),y&&(t.setQueryData(Zt(),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.map(S=>S.slug===y?{...S,thread_count:S.thread_count-1}:S));return{...b,pages:_}}),t.setQueryData(_d({collection_slug:y}),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.filter(S=>S.uuid!==g));return{...b,pages:_}})),{previousThreads:x,previousCollections:v}},onSettled:(g,y,{entryUUID:x},v)=>{y?(t.setQueryData(r,v?.previousThreads),t.setQueryData(Zt(),v?.previousCollections)):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:Zt()}),t.invalidateQueries({queryKey:_d()}),t.invalidateQueries({queryKey:be.makeQueryKey(cy)}),o(x),s(x))}}),{mutate:h}=It({mutationFn:async({entryUUIDs:g,callback:y})=>{y?.(),await x_e({entryUUIDs:g,rwToken:u,reason:e})},onMutate:async({entryUUIDs:g})=>{await t.cancelQueries({queryKey:r});const y=t.getQueryData(r),x=t.getQueryData(Zt());return t.setQueryData(r,v=>{v=v||{pages:[],pageParams:[]};const b=v.pages.map(_=>_.filter(w=>!g.includes(w.uuid)));return{...v,pages:b}}),{previousThreads:y,previousCollections:x}},onSettled:(g,y,{entryUUIDs:x},v)=>{y?t.setQueryData(r,v?.previousThreads):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:be.makeQueryKey(cy)}),x.forEach(b=>{o(b),s(b)}))}});return d.useMemo(()=>({removeWidgetFromEntry:f,deleteAllThreads:m,deleteThread:p,deleteThreads:h}),[m,p,h,f])},rq=/\[([^\]]+)\]\(((?:\([^)]*\)|[^()])*)\)/g,SMe=e=>e?e.replace(rq,"$1"):"",EMe=e=>{if(!e)return{displayTitle:"",links:[]};const t=[];let n="",r=0,s=0,o;const a=new RegExp(rq);for(;(o=a.exec(e))!==null;){const i=o[1],c=o[2],u=o.index;if(n+=e.substring(r,u),s+=u-r,i){const f=s;n+=i,s+=i.length;const m=s;c&&t.push({url:c,startOffset:f,endOffset:m})}r=a.lastIndex}return n+=e.substring(r),{displayTitle:n,links:t}},sq=T.memo(function(){const t=ln(),{inFlight:n}=an(),{$t:r}=J(),{session:s}=je(),{trackEvent:o}=Ke(s),a=d.useCallback(async()=>{const i=t.getStore().getState().sidecarSourceTab.tabId;o("sidecar button clicked",{buttonType:"back_to_thread"}),await t.moveSidecarToThread(i)},[t,o]);return l.jsx(Ct,{variant:"text",size:"small",disabled:n,icon:B("arrow-bar-to-left"),"aria-label":r({defaultMessage:"Back to thread",id:"C1eDCaAWRL",description:"Return sidecar query to the thread tab."}),onClick:a})});sq.displayName="BackToThreadButton";const kMe=5,MMe=()=>{const{device:{isMacOS:e}}=on(),t=A3(o=>o.globalShortcuts[Kn.NEW_THREAD]),n=e?Tn.MACOS:Tn.WINDOWS,r=d.useMemo(()=>t[n],[n,t]),s=d.useMemo(()=>r.map(o=>uCe(o)),[r]);return d.useMemo(()=>s.join(e?"":"+"),[e,s])},oq=T.memo(function(){const{$t:t}=J(),{session:n}=je(),{trackEvent:r}=Ke(n),s=Dn(),o=MMe(),a=d.useCallback(()=>{r("sidecar button clicked",{buttonType:"new_thread"}),s.push("/")},[r,s]);return l.jsx(Ct,{variant:"text",size:"small",icon:B("pencil-plus"),"aria-label":`${t({defaultMessage:"New thread",id:"ITYqY7w9pw"})} (${o})`,onClick:a})});oq.displayName="NewThreadButton";const aq=T.memo(function({ref:t,disableOpenInTab:n}){const{$t:r}=J(),{data:s,isLoading:o}=bMe({reason:"sidecar-controls-library"}),{session:a}=je(),{trackEvent:i}=Ke(a),{inFlight:c,results:u}=an(),{deleteThread:f}=cv({reason:"sidecar-controls-library"}),m=Ln(),p=Dn(),[h,g]=d.useState(()=>new Set),y=ln(),x=zn(),{variation:v}=_Me(!1),b=d.useMemo(()=>(s??[]).filter(E=>!h.has(E.uuid)).slice(0,kMe),[s,h]),_=d.useCallback(E=>{i("sidecar button clicked",{buttonType:"delete_thread"}),g(N=>new Set([...N,E.uuid])),f({entryUUID:E.uuid,callback:()=>{E.link===m&&p.push("/")}})},[f,m,p,i]),w=d.useCallback(async()=>{const E=x.sidecarSourceTab.tabId;v&&y.closeSideCar({tabId:E}).catch(()=>{}),y.openNewTab(location.href),i("sidecar button clicked",{buttonType:"open_in_tab"})},[y,i,v,x.sidecarSourceTab.tabId]),S=d.useCallback(()=>{i("sidecar library clicked",{type:"opened"}),i("sidecar button clicked",{buttonType:"library"})},[i]),C=d.useMemo(()=>s?.find(E=>!h.has(E.uuid)&&(E.link===m||u.some(N=>N.backend_uuid===E.uuid))),[s,h,m,u]);return l.jsxs(_t,{triggerElement:l.jsx(Ct,{variant:"text",size:"small",disabled:o||!s.length,icon:B("dots"),"aria-label":r({defaultMessage:"Menu",id:"/wFZYLAHuk",description:"Show Perplexity threads library."}),ref:t}),minWidthPx:240,maxWidthPx:240,maxHeightPx:400,align:"end",onOpen:S,children:[!n&&l.jsxs(l.Fragment,{children:[l.jsx(_t.Item,{disabled:c,leadingAccessory:B("external-link"),onSelect:w,children:r({defaultMessage:"Open in new tab",id:"Kl9f3MwImT",description:"Open the Perplexity sidebar in a new tab."})}),C&&l.jsx(_t.Item,{leadingAccessory:B("trash"),onSelect:()=>_(C),children:r({defaultMessage:"Delete thread",id:"2WxP2iMtPx"})}),l.jsx(_t.Separator,{})]}),b.map(E=>{const N=u.some(k=>k.backend_uuid===E.uuid);return l.jsx(_t.LinkItem,{href:E.link,className:"group/item",trailingAccessory:N?l.jsx(Jt,{icon:B("check"),size:"small"}):void 0,onSelect:()=>{i("sidecar library clicked",{type:"selected"})},children:l.jsx("span",{className:"line-clamp-1",children:SMe(E.title)})},E.uuid)}),l.jsx(_t.LinkItem,{href:"/library",className:"text-quiet",onSelect:()=>{i("sidecar library clicked",{type:"view_all"})},children:r({defaultMessage:"View all…",id:"yr9iXqRRXf"})})]})});aq.displayName="ShowLibraryButton";const iq=T.memo(function({disableNewThread:t,disableOpenInTab:n}){const r=d.useRef(null),[s,o]=d.useState(!1),a=zn(),{variation:i}=wMe(!1),c=d.useMemo(()=>ro(a.sidecarSourceTab.tabId,a.sidecarSourceTab.secondaryTab?.tabId),[a.sidecarSourceTab.tabId,a.sidecarSourceTab.secondaryTab?.tabId]),u=a.sidecarAutoOpenedThreads[c]??!1,f=i&&u,m=d.useCallback(()=>{s&&r.current?.focus()},[s,r]);return d.useEffect(()=>{const p=g=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(g.key)&&o(!0)},h=()=>{o(!1)};return window.addEventListener("keydown",p),window.addEventListener("click",h),()=>{window.removeEventListener("keydown",p),window.removeEventListener("click",h)}},[]),l.jsx("div",{className:"relative z-20",children:l.jsxs(K,{variant:"background",className:"py-sm px-md h-headerHeight relative flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:f&&l.jsx(sq,{})}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{className:"size-0 appearance-none opacity-0",onFocus:m}),!t&&l.jsx(oq,{}),l.jsx(aq,{ref:r,disableOpenInTab:n})]})]})})});iq.displayName="SideCarNavBar";const TMe=({children:e,fixed:t=!1})=>{const[n,r]=d.useState(!1),{scrollContainerRef:s}=ka();return d.useLayoutEffect(()=>{const o=s?.current;if(!o)return;o.scrollTop>0&&r(!0)},[s]),d.useEffect(()=>{const o=s?.current;if(!o)return;const a=()=>{const u=o.scrollTop;r(u>0)},c=o===document.documentElement?window:o;return c.addEventListener("scroll",a,{passive:!0}),()=>c.removeEventListener("scroll",a)},[s]),l.jsxs(l.Fragment,{children:[e,l.jsx("div",{className:z("border-subtlest top-headerHeight pointer-events-none inset-x-0 z-[2] h-px border-b transition-opacity duration-200",t?"fixed":"absolute"),style:{opacity:n?1:0}})]})},Ff=T.memo(({children:e,withoutHeader:t,disableNewThread:n,disableOpenInTab:r})=>(eG(),l.jsx(w3e,{children:l.jsxs(C3e,{children:[!t&&l.jsx(TMe,{children:l.jsx(iq,{disableNewThread:n,disableOpenInTab:r})}),l.jsx(Xx,{childrenWidth:"none",children:e})]})})));Ff.displayName="Layout";const ch=d.createContext({});function yg(e){const t=d.useRef(null);return t.current===null&&(t.current=e()),t.current}const IT=typeof window<"u",uv=IT?d.useLayoutEffect:d.useEffect,dv=d.createContext(null);function PT(e,t){e.indexOf(t)===-1&&e.push(t)}function xg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Gi=(e,t,n)=>n>t?t:n{};const $i={},lq=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function cq(e){return typeof e=="object"&&e!==null}const uq=e=>/^0[^.\s]+$/u.test(e);function LT(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ao=e=>e,AMe=(e,t)=>n=>t(e(n)),vg=(...e)=>e.reduce(AMe),Kd=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class FT{constructor(){this.subscriptions=[]}add(t){return PT(this.subscriptions,t),()=>xg(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;oe*1e3,Ga=e=>e/1e3;function dq(e,t){return t?e*(1e3/t):0}const NMe=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},fq=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,RMe=1e-7,DMe=12;function jMe(e,t,n,r,s){let o,a,i=0;do a=t+(n-t)/2,o=fq(a,r,s)-e,o>0?n=a:t=a;while(Math.abs(o)>RMe&&++ijMe(o,0,1,e,n);return o=>o===0||o===1?o:fq(s(o),t,r)}const mq=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pq=e=>t=>1-e(1-t),hq=tl(.33,1.53,.69,.99),BT=pq(hq),gq=mq(BT),yq=e=>(e*=2)<1?.5*BT(e):.5*(2-Math.pow(2,-10*(e-1))),UT=e=>1-Math.sin(Math.acos(e)),xq=pq(UT),vq=mq(UT),IMe=tl(.42,0,1,1),Yd=tl(0,0,.58,1),$a=tl(.42,0,.58,1),bq=e=>Array.isArray(e)&&typeof e[0]!="number";function _q(e,t){return bq(e)?e[NMe(0,e.length,t)]:e}const wq=e=>Array.isArray(e)&&typeof e[0]=="number",PMe={linear:Ao,easeIn:IMe,easeInOut:$a,easeOut:Yd,circIn:UT,circInOut:vq,circOut:xq,backIn:BT,backInOut:gq,backOut:hq,anticipate:yq},OMe=e=>typeof e=="string",z9=e=>{if(wq(e)){OT(e.length===4);const[t,n,r,s]=e;return tl(t,n,r,s)}else if(OMe(e))return PMe[e];return e},z0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function LMe(e,t){let n=new Set,r=new Set,s=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function c(f){a.has(f)&&(u.schedule(f),e()),f(i)}const u={schedule:(f,m=!1,p=!1)=>{const g=p&&s?n:r;return m&&a.add(f),g.has(f)||g.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(i=f,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,o&&(o=!1,u.process(f))}};return u}const FMe=40;function Cq(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=z0.reduce((_,w)=>(_[w]=LMe(o),_),{}),{setup:i,read:c,resolveKeyframes:u,preUpdate:f,update:m,preRender:p,render:h,postRender:g}=a,y=()=>{const _=$i.useManualTiming?s.timestamp:performance.now();n=!1,$i.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(_-s.timestamp,FMe),1)),s.timestamp=_,s.isProcessing=!0,i.process(s),c.process(s),u.process(s),f.process(s),m.process(s),p.process(s),h.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:z0.reduce((_,w)=>{const S=a[w];return _[w]=(C,E=!1,N=!1)=>(n||x(),S.schedule(C,E,N)),_},{}),cancel:_=>{for(let w=0;w(uy===void 0&&Os.set($r.isProcessing||$i.useManualTiming?$r.timestamp:performance.now()),uy),set:e=>{uy=e,queueMicrotask(BMe)}},Sq=e=>t=>typeof t=="string"&&t.startsWith(e),VT=Sq("--"),UMe=Sq("var(--"),HT=e=>UMe(e)?VMe.test(e.split("/*")[0].trim()):!1,VMe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},uh={...Bf,transform:e=>Gi(0,1,e)},W0={...Bf,default:1},wp=e=>Math.round(e*1e5)/1e5,zT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HMe(e){return e==null}const zMe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,WT=(e,t)=>n=>!!(typeof n=="string"&&zMe.test(n)&&n.startsWith(e)||t&&!HMe(n)&&Object.prototype.hasOwnProperty.call(n,t)),Eq=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,a,i]=r.match(zT);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(a),alpha:i!==void 0?parseFloat(i):1}},WMe=e=>Gi(0,255,e),Y_={...Bf,transform:e=>Math.round(WMe(e))},Ac={test:WT("rgb","red"),parse:Eq("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Y_.transform(e)+", "+Y_.transform(t)+", "+Y_.transform(n)+", "+wp(uh.transform(r))+")"};function GMe(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const B3={test:WT("#"),parse:GMe,transform:Ac.transform},bg=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),dl=bg("deg"),qa=bg("%"),St=bg("px"),$Me=bg("vh"),qMe=bg("vw"),W9={...qa,parse:e=>qa.parse(e)/100,transform:e=>qa.transform(e*100)},ld={test:WT("hsl","hue"),parse:Eq("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qa.transform(wp(t))+", "+qa.transform(wp(n))+", "+wp(uh.transform(r))+")"},vr={test:e=>Ac.test(e)||B3.test(e)||ld.test(e),parse:e=>Ac.test(e)?Ac.parse(e):ld.test(e)?ld.parse(e):B3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ac.transform(e):ld.transform(e),getAnimatableNone:e=>{const t=vr.parse(e);return t.alpha=0,vr.transform(t)}},KMe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function YMe(e){return isNaN(e)&&typeof e=="string"&&(e.match(zT)?.length||0)+(e.match(KMe)?.length||0)>0}const kq="number",Mq="color",QMe="var",XMe="var(",G9="${}",ZMe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function dh(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(ZMe,c=>(vr.test(c)?(r.color.push(o),s.push(Mq),n.push(vr.parse(c))):c.startsWith(XMe)?(r.var.push(o),s.push(QMe),n.push(c)):(r.number.push(o),s.push(kq),n.push(parseFloat(c))),++o,G9)).split(G9);return{values:n,split:i,indexes:r,types:s}}function Tq(e){return dh(e).values}function Aq(e){const{split:t,types:n}=dh(e),r=t.length;return s=>{let o="";for(let a=0;atypeof e=="number"?0:vr.test(e)?vr.getAnimatableNone(e):e;function e4e(e){const t=Tq(e);return Aq(e)(t.map(JMe))}const Bl={test:YMe,parse:Tq,createTransformer:Aq,getAnimatableNone:e4e};function Q_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function t4e({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,a=0;if(!t)s=o=a=n;else{const i=n<.5?n*(1+t):n+t-n*t,c=2*n-i;s=Q_(c,i,e+1/3),o=Q_(c,i,e),a=Q_(c,i,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}function u2(e,t){return n=>n>0?t:e}const Qn=(e,t,n)=>e+(t-e)*n,X_=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},n4e=[B3,Ac,ld],r4e=e=>n4e.find(t=>t.test(e));function $9(e){const t=r4e(e);if(!t)return!1;let n=t.parse(e);return t===ld&&(n=t4e(n)),n}const q9=(e,t)=>{const n=$9(e),r=$9(t);if(!n||!r)return u2(e,t);const s={...n};return o=>(s.red=X_(n.red,r.red,o),s.green=X_(n.green,r.green,o),s.blue=X_(n.blue,r.blue,o),s.alpha=Qn(n.alpha,r.alpha,o),Ac.transform(s))},U3=new Set(["none","hidden"]);function s4e(e,t){return U3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function o4e(e,t){return n=>Qn(e,t,n)}function GT(e){return typeof e=="number"?o4e:typeof e=="string"?HT(e)?u2:vr.test(e)?q9:l4e:Array.isArray(e)?Nq:typeof e=="object"?vr.test(e)?q9:a4e:u2}function Nq(e,t){const n=[...e],r=n.length,s=e.map((o,a)=>GT(o)(o,t[a]));return o=>{for(let a=0;a{for(const o in r)n[o]=r[o](s);return n}}function i4e(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Bl.createTransformer(t),r=dh(e),s=dh(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?U3.has(e)&&!s.values.length||U3.has(t)&&!r.values.length?s4e(e,t):vg(Nq(i4e(r,s),s.values),n):u2(e,t)};function Rq(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Qn(e,t,n):GT(e)(e,t)}const c4e=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>On.update(t,n),stop:()=>qi(t),now:()=>$r.isProcessing?$r.timestamp:Os.now()}},Dq=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o=d2?1/0:t}function jq(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min($T(r),d2);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:Ga(s)}}const u4e=5;function Iq(e,t,n){const r=Math.max(t-u4e,0);return dq(n-e(r),t-r)}const ir={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Z_=.001;function d4e({duration:e=ir.duration,bounce:t=ir.bounce,velocity:n=ir.velocity,mass:r=ir.mass}){let s,o,a=1-t;a=Gi(ir.minDamping,ir.maxDamping,a),e=Gi(ir.minDuration,ir.maxDuration,Ga(e)),a<1?(s=u=>{const f=u*a,m=f*e,p=f-n,h=V3(u,a),g=Math.exp(-m);return Z_-p/h*g},o=u=>{const m=u*a*e,p=m*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-m),y=V3(Math.pow(u,2),a);return(-s(u)+Z_>0?-1:1)*((p-h)*g)/y}):(s=u=>{const f=Math.exp(-u*e),m=(u-n)*e+1;return-Z_+f*m},o=u=>{const f=Math.exp(-u*e),m=(n-u)*(e*e);return f*m});const i=5/e,c=m4e(s,o,i);if(e=ma(e),isNaN(c))return{stiffness:ir.stiffness,damping:ir.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const f4e=12;function m4e(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function g4e(e){let t={velocity:ir.velocity,stiffness:ir.stiffness,damping:ir.damping,mass:ir.mass,isResolvedFromDuration:!1,...e};if(!K9(e,h4e)&&K9(e,p4e))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Gi(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ir.mass,stiffness:s,damping:o}}else{const n=d4e(e);t={...t,...n,mass:ir.mass},t.isResolvedFromDuration=!0}return t}function fh(e=ir.visualDuration,t=ir.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],i={done:!1,value:o},{stiffness:c,damping:u,mass:f,duration:m,velocity:p,isResolvedFromDuration:h}=g4e({...n,velocity:-Ga(n.velocity||0)}),g=p||0,y=u/(2*Math.sqrt(c*f)),x=a-o,v=Ga(Math.sqrt(c/f)),b=Math.abs(x)<5;r||(r=b?ir.restSpeed.granular:ir.restSpeed.default),s||(s=b?ir.restDelta.granular:ir.restDelta.default);let _;if(y<1){const S=V3(v,y);_=C=>{const E=Math.exp(-y*v*C);return a-E*((g+y*v*x)/S*Math.sin(S*C)+x*Math.cos(S*C))}}else if(y===1)_=S=>a-Math.exp(-v*S)*(x+(g+v*x)*S);else{const S=v*Math.sqrt(y*y-1);_=C=>{const E=Math.exp(-y*v*C),N=Math.min(S*C,300);return a-E*((g+y*v*x)*Math.sinh(N)+S*x*Math.cosh(N))/S}}const w={calculatedDuration:h&&m||null,next:S=>{const C=_(S);if(h)i.done=S>=m;else{let E=S===0?g:0;y<1&&(E=S===0?ma(g):Iq(_,S,C));const N=Math.abs(E)<=r,k=Math.abs(a-C)<=s;i.done=N&&k}return i.value=i.done?a:C,i},toString:()=>{const S=Math.min($T(w),d2),C=Dq(E=>w.next(S*E).value,S,30);return S+"ms "+C},toTransition:()=>{}};return w}fh.applyToOptions=e=>{const t=jq(e,100,fh);return e.ease=t.ease,e.duration=ma(t.duration),e.type="keyframes",e};function H3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:a,min:i,max:c,restDelta:u=.5,restSpeed:f}){const m=e[0],p={done:!1,value:m},h=N=>i!==void 0&&Nc,g=N=>i===void 0?c:c===void 0||Math.abs(i-N)-y*Math.exp(-N/r),_=N=>v+b(N),w=N=>{const k=b(N),I=_(N);p.done=Math.abs(k)<=u,p.value=p.done?v:I};let S,C;const E=N=>{h(p.value)&&(S=N,C=fh({keyframes:[p.value,g(p.value)],velocity:Iq(_,N,p.value),damping:s,stiffness:o,restDelta:u,restSpeed:f}))};return E(0),{calculatedDuration:null,next:N=>{let k=!1;return!C&&S===void 0&&(k=!0,w(N),E(N)),S!==void 0&&N>=S?C.next(N-S):(!k&&w(N),p)}}}function y4e(e,t,n){const r=[],s=n||$i.mix||Rq,o=e.length-1;for(let a=0;at[0];if(o===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const i=y4e(t,r,s),c=i.length,u=f=>{if(a&&f1)for(;mu(Gi(e[0],e[o-1],f)):u}function Oq(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Kd(0,t,r);e.push(Qn(n,1,s))}}function Lq(e){const t=[0];return Oq(t,e.length-1),t}function x4e(e,t){return e.map(n=>n*t)}function v4e(e,t){return e.map(()=>t||$a).splice(0,e.length-1)}function Cp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=bq(r)?r.map(z9):z9(r),o={done:!1,value:t[0]},a=x4e(n&&n.length===t.length?n:Lq(t),e),i=Pq(a,t,{ease:Array.isArray(s)?s:v4e(t,s)});return{calculatedDuration:e,next:c=>(o.value=i(c),o.done=c>=e,o)}}const b4e=e=>e!==null;function qT(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(b4e),i=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const _4e={decay:H3,inertia:H3,tween:Cp,keyframes:Cp,spring:fh};function Fq(e){typeof e.type=="string"&&(e.type=_4e[e.type])}class KT{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const w4e=e=>e/100;class YT extends KT{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Os.now()&&this.tick(Os.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Fq(t);const{type:n=Cp,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:a=0}=t;let{keyframes:i}=t;const c=n||Cp;c!==Cp&&typeof i[0]!="number"&&(this.mixKeyframes=vg(w4e,Rq(i[0],i[1])),i=[0,100]);const u=c({...t,keyframes:i});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...i].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=$T(u));const{calculatedDuration:f}=u;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:i,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:f,repeat:m,repeatType:p,repeatDelay:h,type:g,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let _=this.currentTime,w=r;if(m){const N=Math.min(this.currentTime,s)/i;let k=Math.floor(N),I=N%1;!I&&N>=1&&(I=1),I===1&&k--,k=Math.min(k,m+1),!!(k%2)&&(p==="reverse"?(I=1-I,h&&(I-=h/i)):p==="mirror"&&(w=a)),_=Gi(0,1,I)*i}const S=b?{done:!1,value:f[0]}:w.next(_);o&&(S.value=o(S.value));let{done:C}=S;!b&&c!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return E&&g!==H3&&(S.value=qT(f,this.options,x,this.speed)),y&&y(S.value),E&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Ga(this.calculatedDuration)}get time(){return Ga(this.currentTime)}set time(t){t=ma(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Os.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Ga(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=c4e,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Os.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function C4e(e){for(let t=1;te*180/Math.PI,z3=e=>{const t=Nc(Math.atan2(e[1],e[0]));return W3(t)},S4e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:z3,rotateZ:z3,skewX:e=>Nc(Math.atan(e[1])),skewY:e=>Nc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},W3=e=>(e=e%360,e<0&&(e+=360),e),Y9=z3,Q9=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),X9=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),E4e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Q9,scaleY:X9,scale:e=>(Q9(e)+X9(e))/2,rotateX:e=>W3(Nc(Math.atan2(e[6],e[5]))),rotateY:e=>W3(Nc(Math.atan2(-e[2],e[0]))),rotateZ:Y9,rotate:Y9,skewX:e=>Nc(Math.atan(e[4])),skewY:e=>Nc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function G3(e){return e.includes("scale")?1:0}function $3(e,t){if(!e||e==="none")return G3(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=E4e,s=n;else{const i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=S4e,s=i}if(!s)return G3(t);const o=r[t],a=s[1].split(",").map(M4e);return typeof o=="function"?o(a):a[o]}const k4e=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return $3(n,t)};function M4e(e){return parseFloat(e.trim())}const Uf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vf=new Set(Uf),Z9=e=>e===Bf||e===St,T4e=new Set(["x","y","z"]),A4e=Uf.filter(e=>!T4e.has(e));function N4e(e){const t=[];return A4e.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Oc={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>$3(t,"x"),y:(e,{transform:t})=>$3(t,"y")};Oc.translateX=Oc.x;Oc.translateY=Oc.y;const Lc=new Set;let q3=!1,K3=!1,Y3=!1;function Bq(){if(K3){const e=Array.from(Lc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=N4e(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,a])=>{r.getValue(o)?.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}K3=!1,q3=!1,Lc.forEach(e=>e.complete(Y3)),Lc.clear()}function Uq(){Lc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(K3=!0)})}function R4e(){Y3=!0,Uq(),Bq(),Y3=!1}class QT{constructor(t,n,r,s,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Lc.add(this),q3||(q3=!0,On.read(Uq),On.resolveKeyframes(Bq))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s?.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const i=r.readValue(n,a);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}C4e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Lc.delete(this)}cancel(){this.state==="scheduled"&&(Lc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const D4e=e=>e.startsWith("--");function j4e(e,t,n){D4e(t)?e.style.setProperty(t,n):e.style[t]=n}const I4e=LT(()=>window.ScrollTimeline!==void 0),P4e={};function O4e(e,t){const n=LT(e);return()=>P4e[t]??n()}const Vq=O4e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,J9={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sp([0,.65,.55,1]),circOut:sp([.55,0,1,.45]),backIn:sp([.31,.01,.66,-.59]),backOut:sp([.33,1.53,.69,.99])};function Hq(e,t){if(e)return typeof e=="function"?Vq()?Dq(e,t):"ease-out":wq(e)?sp(e):Array.isArray(e)?e.map(n=>Hq(n,t)||J9.easeOut):J9[e]}function L4e(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:i="easeOut",times:c}={},u=void 0){const f={[t]:n};c&&(f.offset=c);const m=Hq(i,s);Array.isArray(m)&&(f.easing=m);const p={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return u&&(p.pseudoElement=u),e.animate(f,p)}function XT(e){return typeof e=="function"&&"applyToOptions"in e}function F4e({type:e,...t}){return XT(e)&&Vq()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class B4e extends KT{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:i,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=t,OT(typeof t.type!="string");const u=F4e(t);this.animation=L4e(n,r,s,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const f=qT(s,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(f):j4e(n,r,f),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ga(Number(t))}get time(){return Ga(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ma(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&I4e()?(this.animation.timeline=t,Ao):n(this)}}const zq={anticipate:yq,backInOut:gq,circInOut:vq};function U4e(e){return e in zq}function V4e(e){typeof e.ease=="string"&&U4e(e.ease)&&(e.ease=zq[e.ease])}const eD=10;class H4e extends B4e{constructor(t){V4e(t),Fq(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const i=new YT({...a,autoplay:!1}),c=ma(this.finishedTime??this.time);n.setWithVelocity(i.sample(c-eD).value,i.sample(c).value,eD),i.stop()}}const tD=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Bl.test(e)||e==="0")&&!e.startsWith("url("));function z4e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function q4e(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return $4e()&&n&&G4e.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}const K4e=40;class Y4e extends KT{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",keyframes:i,name:c,motionValue:u,element:f,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Os.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:a,name:c,motionValue:u,element:f,...m},h=f?.KeyframeResolver||QT;this.keyframeResolver=new h(i,(g,y,x)=>this.onKeyframesResolved(g,y,p,!x),c,u,f),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:i,delay:c,isHandoff:u,onUpdate:f}=r;this.resolvedAt=Os.now(),W4e(t,o,a,i)||(($i.instantAnimations||!c)&&f?.(qT(t,r,n)),t[0]=t[t.length-1],Q3(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>K4e?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!u&&q4e(p)?new H4e({...p,element:p.motionValue.owner.current}):new YT(p);h.finished.then(()=>this.notifyFinished()).catch(Ao),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),R4e()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Q4e{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;rr.attachTimeline(t));return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class X4e extends Q4e{then(t,n){return this.finished.finally(t).then(()=>{})}}const Z4e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function J4e(e){const t=Z4e.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Wq(e,t,n=1){const[r,s]=J4e(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return lq(a)?parseFloat(a):a}return HT(s)?Wq(s,t,n+1):s}function ZT(e,t){return e?.[t]??e?.default??e}const Gq=new Set(["width","height","top","left","right","bottom",...Uf]),eTe={test:e=>e==="auto",parse:e=>e},$q=e=>t=>t.test(e),qq=[Bf,St,qa,dl,qMe,$Me,eTe],nD=e=>qq.find($q(e));function tTe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||uq(e):!0}const nTe=new Set(["brightness","contrast","saturate","opacity"]);function rTe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(zT)||[];if(!r)return e;const s=n.replace(r,"");let o=nTe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const sTe=/\b([a-z-]*)\(.*?\)/gu,X3={...Bl,getAnimatableNone:e=>{const t=e.match(sTe);return t?t.map(rTe).join(" "):e}},rD={...Bf,transform:Math.round},oTe={rotate:dl,rotateX:dl,rotateY:dl,rotateZ:dl,scale:W0,scaleX:W0,scaleY:W0,scaleZ:W0,skew:dl,skewX:dl,skewY:dl,distance:St,translateX:St,translateY:St,translateZ:St,x:St,y:St,z:St,perspective:St,transformPerspective:St,opacity:uh,originX:W9,originY:W9,originZ:St},JT={borderWidth:St,borderTopWidth:St,borderRightWidth:St,borderBottomWidth:St,borderLeftWidth:St,borderRadius:St,radius:St,borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomRightRadius:St,borderBottomLeftRadius:St,width:St,maxWidth:St,height:St,maxHeight:St,top:St,right:St,bottom:St,left:St,padding:St,paddingTop:St,paddingRight:St,paddingBottom:St,paddingLeft:St,margin:St,marginTop:St,marginRight:St,marginBottom:St,marginLeft:St,backgroundPositionX:St,backgroundPositionY:St,...oTe,zIndex:rD,fillOpacity:uh,strokeOpacity:uh,numOctaves:rD},aTe={...JT,color:vr,backgroundColor:vr,outlineColor:vr,fill:vr,stroke:vr,borderColor:vr,borderTopColor:vr,borderRightColor:vr,borderBottomColor:vr,borderLeftColor:vr,filter:X3,WebkitFilter:X3},Kq=e=>aTe[e];function Yq(e,t){let n=Kq(e);return n!==X3&&(n=Bl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const iTe=new Set(["auto","none","0"]);function lTe(e,t,n){let r=0,s;for(;r{t.getValue(i).set(c)}),this.resolveNoneKeyframes()}}function Qq(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Xq=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Zq(e){return cq(e)&&"offsetHeight"in e}const sD=30,uTe=e=>!isNaN(parseFloat(e)),Sp={current:void 0};class dTe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=Os.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Os.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=uTe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new FT);const r=this.events[t].add(n);return t==="change"?()=>{r(),On.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Sp.current&&Sp.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Os.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>sD)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sD);return dq(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zc(e,t){return new dTe(e,t)}const{schedule:eA}=Cq(queueMicrotask,!1),na={x:!1,y:!1};function Jq(){return na.x||na.y}function fTe(e){return e==="x"||e==="y"?na[e]?null:(na[e]=!0,()=>{na[e]=!1}):na.x||na.y?null:(na.x=na.y=!0,()=>{na.x=na.y=!1})}function eK(e,t){const n=Qq(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function oD(e){return!(e.pointerType==="touch"||Jq())}function mTe(e,t,n={}){const[r,s,o]=eK(e,n),a=i=>{if(!oD(i))return;const{target:c}=i,u=t(c,i);if(typeof u!="function"||!c)return;const f=m=>{oD(m)&&(u(m),c.removeEventListener("pointerleave",f))};c.addEventListener("pointerleave",f,s)};return r.forEach(i=>{i.addEventListener("pointerenter",a,s)}),o}const tK=(e,t)=>t?e===t?!0:tK(e,t.parentElement):!1,tA=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,pTe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hTe(e){return pTe.has(e.tagName)||e.tabIndex!==-1}const dy=new WeakSet;function aD(e){return t=>{t.key==="Enter"&&e(t)}}function J_(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const gTe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=aD(()=>{if(dy.has(n))return;J_(n,"down");const s=aD(()=>{J_(n,"up")}),o=()=>J_(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function iD(e){return tA(e)&&!Jq()}function yTe(e,t,n={}){const[r,s,o]=eK(e,n),a=i=>{const c=i.currentTarget;if(!iD(i))return;dy.add(c);const u=t(c,i),f=(h,g)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",p),dy.has(c)&&dy.delete(c),iD(h)&&typeof u=="function"&&u(h,{success:g})},m=h=>{f(h,c===window||c===document||n.useGlobalTarget||tK(c,h.target))},p=h=>{f(h,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",p,s)};return r.forEach(i=>{(n.useGlobalTarget?window:i).addEventListener("pointerdown",a,s),Zq(i)&&(i.addEventListener("focus",u=>gTe(u,s)),!hTe(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),o}function nA(e){return cq(e)&&"ownerSVGElement"in e}function nK(e){return nA(e)&&e.tagName==="svg"}function xTe(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],o=e[2+n],a=e[3+n],i=Pq(s,o,a);return t?i(r):i}const Lr=e=>!!(e&&e.getVelocity),vTe=[...qq,vr,Bl],bTe=e=>vTe.find($q(e)),fv=d.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class _Te extends d.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Zq(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function wTe({children:e,isPresent:t,anchorX:n,root:r}){const s=d.useId(),o=d.useRef(null),a=d.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=d.useContext(fv);return d.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:m,right:p}=a.current;if(t||!o.current||!c||!u)return;const h=n==="left"?`left: ${m}`:`right: ${p}`;o.current.dataset.motionPopId=s;const g=document.createElement("style");i&&(g.nonce=i);const y=r??document.head;return y.appendChild(g),g.sheet&&g.sheet.insertRule(` - [data-motion-pop-id="${s}"] { - position: absolute !important; - width: ${c}px !important; - height: ${u}px !important; - ${h}px !important; - top: ${f}px !important; - } - `),()=>{y.contains(g)&&y.removeChild(g)}},[t]),l.jsx(_Te,{isPresent:t,childRef:o,sizeRef:a,children:d.cloneElement(e,{ref:o})})}const CTe=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:a,anchorX:i,root:c})=>{const u=yg(STe),f=d.useId();let m=!0,p=d.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:h=>{u.set(h,!0);for(const g of u.values())if(!g)return;r&&r()},register:h=>(u.set(h,!1),()=>u.delete(h))}),[n,u,r]);return o&&m&&(p={...p}),d.useMemo(()=>{u.forEach((h,g)=>u.set(g,!1))},[n]),d.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(wTe,{isPresent:n,anchorX:i,root:c,children:e})),l.jsx(dv.Provider,{value:p,children:e})};function STe(){return new Map}function rK(e=!0){const t=d.useContext(dv);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=d.useId();d.useEffect(()=>{if(e)return s(o)},[e]);const a=d.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,a]:[!0]}const G0=e=>e.key||"";function lD(e){const t=[];return d.Children.forEach(e,n=>{d.isValidElement(n)&&t.push(n)}),t}const kt=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:a=!1,anchorX:i="left",root:c})=>{const[u,f]=rK(a),m=d.useMemo(()=>lD(e),[e]),p=a&&!u?[]:m.map(G0),h=d.useRef(!0),g=d.useRef(m),y=yg(()=>new Map),[x,v]=d.useState(m),[b,_]=d.useState(m);uv(()=>{h.current=!1,g.current=m;for(let C=0;C{const E=G0(C),N=a&&!u?!1:m===b||p.includes(E),k=()=>{if(y.has(E))y.set(E,!0);else return;let I=!0;y.forEach(M=>{M||(I=!1)}),I&&(S?.(),_(g.current),a&&f?.(),r&&r())};return l.jsx(CTe,{isPresent:N,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:N?void 0:k,anchorX:i,children:C},E)})})},ETe=d.createContext(null);function kTe(){const e=d.useRef(!1);return uv(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function MTe(){const e=kTe(),[t,n]=d.useState(0),r=d.useCallback(()=>{e.current&&n(t+1)},[t]);return[d.useCallback(()=>On.postRender(r),[r]),t]}const TTe=e=>!e.isLayoutDirty&&e.willUpdate(!1);function cD(){const e=new Set,t=new WeakMap,n=()=>e.forEach(TTe);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const s=t.get(r);s&&(s(),t.delete(r)),n()},dirty:n}}const sK=e=>e===!0,ATe=e=>sK(e===!0)||e==="id",_g=({children:e,id:t,inherit:n=!0})=>{const r=d.useContext(ch),s=d.useContext(ETe),[o,a]=MTe(),i=d.useRef(null),c=r.id||s;i.current===null&&(ATe(n)&&c&&(t=t?c+"-"+t:c),i.current={id:t,group:sK(n)&&r.group||cD()});const u=d.useMemo(()=>({...i.current,forceRender:o}),[a]);return l.jsx(ch.Provider,{value:u,children:e})},oK=d.createContext({strict:!1}),uD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Qd={};for(const e in uD)Qd[e]={isEnabled:t=>uD[e].some(n=>!!t[n])};function NTe(e){for(const t in e)Qd[t]={...Qd[t],...e[t]}}const RTe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function f2(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||RTe.has(e)}let aK=e=>!f2(e);function DTe(e){typeof e=="function"&&(aK=t=>t.startsWith("on")?!f2(t):e(t))}try{DTe(require("@emotion/is-prop-valid").default)}catch{}function jTe(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(aK(s)||n===!0&&f2(s)||!t&&!f2(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const mv=d.createContext({});function pv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function mh(e){return typeof e=="string"||Array.isArray(e)}const rA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sA=["initial",...rA];function hv(e){return pv(e.animate)||sA.some(t=>mh(e[t]))}function iK(e){return!!(hv(e)||e.variants)}function ITe(e,t){if(hv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||mh(n)?n:void 0,animate:mh(r)?r:void 0}}return e.inherit!==!1?t:{}}function PTe(e){const{initial:t,animate:n}=ITe(e,d.useContext(mv));return d.useMemo(()=>({initial:t,animate:n}),[dD(t),dD(n)])}function dD(e){return Array.isArray(e)?e.join(" "):e}const ph={};function OTe(e){for(const t in e)ph[t]=e[t],VT(t)&&(ph[t].isCSSVariable=!0)}function lK(e,{layout:t,layoutId:n}){return Vf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ph[e]||e==="opacity")}const LTe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},FTe=Uf.length;function BTe(e,t,n){let r="",s=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}});function cK(e,t,n){for(const r in t)!Lr(t[r])&&!lK(r,n)&&(e[r]=t[r])}function UTe({transformTemplate:e},t){return d.useMemo(()=>{const n=aA();return oA(n,t,e),Object.assign({},n.vars,n.style)},[t])}function VTe(e,t){const n=e.style||{},r={};return cK(r,n,e),Object.assign(r,UTe(e,t)),r}function HTe(e,t){const n={},r=VTe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const zTe={offset:"stroke-dashoffset",array:"stroke-dasharray"},WTe={offset:"strokeDashoffset",array:"strokeDasharray"};function GTe(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?zTe:WTe;e[o.offset]=St.transform(-r);const a=St.transform(t),i=St.transform(n);e[o.array]=`${a} ${i}`}function uK(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...i},c,u,f){if(oA(e,i,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:p}=e;m.transform&&(p.transform=m.transform,delete m.transform),(p.transform||m.transformOrigin)&&(p.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),p.transform&&(p.transformBox=f?.transformBox??"fill-box",delete m.transformBox),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&>e(m,s,o,a,!1)}const dK=()=>({...aA(),attrs:{}}),fK=e=>typeof e=="string"&&e.toLowerCase()==="svg";function $Te(e,t,n,r){const s=d.useMemo(()=>{const o=dK();return uK(o,t,fK(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};cK(o,e.style,e),s.style={...o,...s.style}}return s}const qTe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function iA(e){return typeof e!="string"||e.includes("-")?!1:!!(qTe.indexOf(e)>-1||/[A-Z]/u.test(e))}function KTe(e,t,n,{latestValues:r},s,o=!1){const i=(iA(e)?$Te:HTe)(t,r,s,e),c=jTe(t,typeof e=="string",o),u=e!==d.Fragment?{...c,...i,ref:n}:{},{children:f}=t,m=d.useMemo(()=>Lr(f)?f.get():f,[f]);return d.createElement(e,{...u,children:m})}function fD(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function lA(e,t,n,r){if(typeof t=="function"){const[s,o]=fD(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=fD(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function fy(e){return Lr(e)?e.get():e}function YTe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:QTe(n,r,s,e),renderState:t()}}function QTe(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=fy(o[p]);let{initial:a,animate:i}=e;const c=hv(e),u=iK(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),i===void 0&&(i=t.animate));let f=n?n.initial===!1:!1;f=f||a===!1;const m=f?i:a;if(m&&typeof m!="boolean"&&!pv(m)){const p=Array.isArray(m)?m:[m];for(let h=0;h(t,n)=>{const r=d.useContext(mv),s=d.useContext(dv),o=()=>YTe(e,t,r,s);return n?o():yg(o)};function cA(e,t,n){const{style:r}=e,s={};for(const o in r)(Lr(r[o])||t.style&&Lr(t.style[o])||lK(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(s[o]=r[o]);return s}const XTe=mK({scrapeMotionValuesFromProps:cA,createRenderState:aA});function pK(e,t,n){const r=cA(e,t,n);for(const s in e)if(Lr(e[s])||Lr(t[s])){const o=Uf.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const ZTe=mK({scrapeMotionValuesFromProps:pK,createRenderState:dK}),JTe=Symbol.for("motionComponentSymbol");function cd(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eAe(e,t,n){return d.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):cd(n)&&(n.current=r))},[t])}const uA=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),tAe="framerAppearId",hK="data-"+uA(tAe),gK=d.createContext({});function nAe(e,t,n,r,s){const{visualElement:o}=d.useContext(mv),a=d.useContext(oK),i=d.useContext(dv),c=d.useContext(fv).reducedMotion,u=d.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:i,blockInitialAnimation:i?i.initial===!1:!1,reducedMotionConfig:c}));const f=u.current,m=d.useContext(gK);f&&!f.projection&&s&&(f.type==="html"||f.type==="svg")&&rAe(u.current,n,s,m);const p=d.useRef(!1);d.useInsertionEffect(()=>{f&&p.current&&f.update(n,i)});const h=n[hK],g=d.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return uv(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),d.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),f.enteringChildren=void 0)}),f}function rAe(e,t,n,r){const{layoutId:s,layout:o,drag:a,dragConstraints:i,layoutScroll:c,layoutRoot:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:yK(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!a||i&&cd(i),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u})}function yK(e){if(e)return e.options.allowProjection!==!1?e.projection:yK(e.parent)}function ew(e,{forwardMotionProps:t=!1}={},n,r){n&&NTe(n);const s=iA(e)?ZTe:XTe;function o(i,c){let u;const f={...d.useContext(fv),...i,layoutId:sAe(i)},{isStatic:m}=f,p=PTe(i),h=s(i,m);if(!m&&IT){oAe();const g=aAe(f);u=g.MeasureLayout,p.visualElement=nAe(e,h,f,r,g.ProjectionNode)}return l.jsxs(mv.Provider,{value:p,children:[u&&p.visualElement?l.jsx(u,{visualElement:p.visualElement,...f}):null,KTe(e,i,eAe(h,p.visualElement,c),h,m,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=d.forwardRef(o);return a[JTe]=e,a}function sAe({layoutId:e}){const t=d.useContext(ch).id;return t&&e!==void 0?t+"-"+e:e}function oAe(e,t){d.useContext(oK).strict}function aAe(e){const{drag:t,layout:n}=Qd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function iAe(e,t){if(typeof Proxy>"u")return ew;const n=new Map,r=(o,a)=>ew(o,a,e,t),s=(o,a)=>r(o,a);return new Proxy(s,{get:(o,a)=>a==="create"?r:(n.has(a)||n.set(a,ew(a,void 0,e,t)),n.get(a))})}function xK({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function lAe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cAe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function tw(e){return e===void 0||e===1}function Z3({scale:e,scaleX:t,scaleY:n}){return!tw(e)||!tw(t)||!tw(n)}function bc(e){return Z3(e)||vK(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function vK(e){return mD(e.x)||mD(e.y)}function mD(e){return e&&e!=="0%"}function m2(e,t,n){const r=e-n,s=t*r;return n+s}function pD(e,t,n,r,s){return s!==void 0&&(e=m2(e,s,r)),m2(e,n,r)+t}function J3(e,t=0,n=1,r,s){e.min=pD(e.min,t,n,r,s),e.max=pD(e.max,t,n,r,s)}function bK(e,{x:t,y:n}){J3(e.x,t.translate,t.scale,t.originPoint),J3(e.y,n.translate,n.scale,n.originPoint)}const hD=.999999999999,gD=1.0000000000001;function uAe(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,a;for(let i=0;ihD&&(t.x=1),t.yhD&&(t.y=1)}function ud(e,t){e.min=e.min+t,e.max=e.max+t}function yD(e,t,n,r,s=.5){const o=Qn(e.min,e.max,s);J3(e,t,n,o,r)}function dd(e,t){yD(e.x,t.x,t.scaleX,t.scale,t.originX),yD(e.y,t.y,t.scaleY,t.scale,t.originY)}function _K(e,t){return xK(cAe(e.getBoundingClientRect(),t))}function dAe(e,t,n){const r=_K(e,n),{scroll:s}=t;return s&&(ud(r.x,s.offset.x),ud(r.y,s.offset.y)),r}const xD=()=>({translate:0,scale:1,origin:0,originPoint:0}),fd=()=>({x:xD(),y:xD()}),vD=()=>({min:0,max:0}),or=()=>({x:vD(),y:vD()}),p2={current:null},dA={current:!1};function wK(){if(dA.current=!0,!!IT)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>p2.current=e.matches;e.addEventListener("change",t),t()}else p2.current=!1}const hh=new WeakMap;function fAe(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Lr(s))e.addValue(r,s);else if(Lr(o))e.addValue(r,Zc(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Zc(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const bD=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class CK{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=QT,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Os.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),dA.current||wK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:p2.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Vf.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&On.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qd){const n=Qd[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):or()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Zc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(lq(r)||uq(r))?r=parseFloat(r):!bTe(r)&&Bl.test(n)&&(r=Yq(t,n)),this.setBaseTarget(t,Lr(r)?r.get():r)),Lr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=lA(this.props,n,this.presenceContext?.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Lr(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new FT),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){eA.render(this.render)}}class SK extends CK{constructor(){super(...arguments),this.KeyframeResolver=cTe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Lr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function EK(e,{style:t,vars:n},r,s){const o=e.style;let a;for(a in t)o[a]=t[a];s?.applyProjectionStyles(o,r);for(a in n)o.setProperty(a,n[a])}function mAe(e){return window.getComputedStyle(e)}class kK extends SK{constructor(){super(...arguments),this.type="html",this.renderInstance=EK}readValueFromInstance(t,n){if(Vf.has(n))return this.projection?.isProjecting?G3(n):k4e(t,n);{const r=mAe(t),s=(VT(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _K(t,n)}build(t,n,r){oA(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return cA(t,n,r)}}const MK=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function pAe(e,t,n,r){EK(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(MK.has(s)?s:uA(s),t.attrs[s])}class TK extends SK{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=or}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vf.has(n)){const r=Kq(n);return r&&r.default||0}return n=MK.has(n)?n:uA(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return pK(t,n,r)}build(t,n,r){uK(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){pAe(t,n,r,s)}mount(t){this.isSVGTag=fK(t.tagName),super.mount(t)}}const hAe=(e,t)=>iA(e)?new TK(t):new kK(t,{allowProjection:e!==d.Fragment});function kd(e,t,n){const r=e.getProps();return lA(r,t,n!==void 0?n:r.custom,e)}const eE=e=>Array.isArray(e);function gAe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Zc(n))}function yAe(e){return eE(e)?e[e.length-1]||0:e}function xAe(e,t){const n=kd(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const a in o){const i=yAe(o[a]);gAe(e,a,i)}}function vAe(e){return!!(Lr(e)&&e.add)}function tE(e,t){const n=e.getValue("willChange");if(vAe(n))return n.add(t);if(!n&&$i.WillChange){const r=new $i.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function AK(e){return e.props[hK]}const bAe=e=>e!==null;function _Ae(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(bAe),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const wAe={type:"spring",stiffness:500,damping:25,restSpeed:10},CAe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),SAe={type:"keyframes",duration:.8},EAe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kAe=(e,{keyframes:t})=>t.length>2?SAe:Vf.has(e)?e.startsWith("scale")?CAe(t[1]):wAe:EAe;function MAe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:a,repeatDelay:i,from:c,elapsed:u,...f}){return!!Object.keys(f).length}const fA=(e,t,n,r={},s,o)=>a=>{const i=ZT(r,e)||{},c=i.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ma(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{a(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:o?void 0:s};MAe(i)||Object.assign(f,kAe(e,f)),f.duration&&(f.duration=ma(f.duration)),f.repeatDelay&&(f.repeatDelay=ma(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let m=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Q3(f),f.delay===0&&(m=!0)),($i.instantAnimations||$i.skipAnimations)&&(m=!0,Q3(f),f.delay=0),f.allowFlatten=!i.type&&!i.ease,m&&!o&&t.get()!==void 0){const p=_Ae(f.keyframes,i);if(p!==void 0){On.update(()=>{f.onUpdate(p),f.onComplete()});return}}return i.isSync?new YT(f):new Y4e(f)};function TAe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function mA(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...i}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in i){const m=e.getValue(f,e.latestValues[f]??null),p=i[f];if(p===void 0||u&&TAe(u,f))continue;const h={delay:n,...ZT(o||{},f)},g=m.get();if(g!==void 0&&!m.isAnimating&&!Array.isArray(p)&&p===g&&!h.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const v=AK(e);if(v){const b=window.MotionHandoffAnimation(v,f,On);b!==null&&(h.startTime=b,y=!0)}}tE(e,f),m.start(fA(f,m,p,e.shouldReduceMotion&&Gq.has(f)?{type:!1}:h,e,y));const x=m.animation;x&&c.push(x)}return a&&Promise.all(c).then(()=>{On.update(()=>{a&&xAe(e,a)})}),c}function NK(e,t,n,r=0,s=1){const o=Array.from(e).sort((u,f)=>u.sortNodePosition(f)).indexOf(t),a=e.size,i=(a-1)*r;return typeof n=="function"?n(o,a):s===1?o*r:i-o*r}function nE(e,t,n={}){const r=kd(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(mA(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=s;return AAe(e,t,c,u,f,m,n)}:()=>Promise.resolve(),{when:i}=s;if(i){const[c,u]=i==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function AAe(e,t,n=0,r=0,s=0,o=1,a){const i=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),i.push(nE(c,t,{...a,delay:n+(typeof r=="function"?0:r)+NK(e.variantChildren,c,r,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(i)}function NAe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>nE(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=nE(e,t,n);else{const s=typeof t=="function"?kd(e,t,n.custom):t;r=Promise.all(mA(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function RK(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:n,options:r})=>NAe(e,n,r)))}function PAe(e){let t=IAe(e),n=_D(),r=!0;const s=c=>(u,f)=>{const m=kd(e,f,c==="exit"?e.presenceContext?.custom:void 0);if(m){const{transition:p,transitionEnd:h,...g}=m;u={...u,...g,...h}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=DK(e.parent)||{},m=[],p=new Set;let h={},g=1/0;for(let x=0;xg&&w,k=!1;const I=Array.isArray(_)?_:[_];let M=I.reduce(s(v),{});S===!1&&(M={});const{prevResolvedValues:A={}}=b,D={...A,...M},P=j=>{N=!0,p.has(j)&&(k=!0,p.delete(j)),b.needsAnimating[j]=!0;const L=e.getValue(j);L&&(L.liveStyle=!1)};for(const j in D){const L=M[j],U=A[j];if(h.hasOwnProperty(j))continue;let O=!1;eE(L)&&eE(U)?O=!RK(L,U):O=L!==U,O?L!=null?P(j):p.add(j):L!==void 0&&p.has(j)?P(j):b.protectedKeys[j]=!0}b.prevProp=_,b.prevResolvedValues=M,b.isActive&&(h={...h,...M}),r&&e.blockInitialAnimation&&(N=!1);const F=C&&E;N&&(!F||k)&&m.push(...I.map(j=>{const L={type:v};if(typeof j=="string"&&r&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,O=kd(U,j);if(U.enteringChildren&&O){const{delayChildren:$}=O.transition||{};L.delay=NK(U.enteringChildren,e,$)}}return{animation:j,options:L}}))}if(p.size){const x={};if(typeof u.initial!="boolean"){const v=kd(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(x.transition=v.transition)}p.forEach(v=>{const b=e.getBaseTarget(v),_=e.getValue(v);_&&(_.liveStyle=!0),x[v]=b??null}),m.push({animation:x})}let y=!!m.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(m):Promise.resolve()}function i(c,u){if(n[c].isActive===u)return Promise.resolve();e.variantChildren?.forEach(m=>m.animationState?.setActive(c,u)),n[c].isActive=u;const f=a(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:i,setAnimateFunction:o,getState:()=>n,reset:()=>{n=_D(),r=!0}}}function OAe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!RK(t,e):!1}function pc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _D(){return{animate:pc(!0),whileInView:pc(),whileHover:pc(),whileTap:pc(),whileDrag:pc(),whileFocus:pc(),exit:pc()}}class rc{constructor(t){this.isMounted=!1,this.node=t}update(){}}class LAe extends rc{constructor(t){super(t),t.animationState||(t.animationState=PAe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();pv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let FAe=0;class BAe extends rc{constructor(){super(...arguments),this.id=FAe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UAe={animation:{Feature:LAe},exit:{Feature:BAe}};function gh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wg(e){return{point:{x:e.pageX,y:e.pageY}}}const VAe=e=>t=>tA(t)&&e(t,wg(t));function Ep(e,t,n,r){return gh(e,t,VAe(n),r)}const jK=1e-4,HAe=1-jK,zAe=1+jK,IK=.01,WAe=0-IK,GAe=0+IK;function bs(e){return e.max-e.min}function $Ae(e,t,n){return Math.abs(e-t)<=n}function wD(e,t,n,r=.5){e.origin=r,e.originPoint=Qn(t.min,t.max,e.origin),e.scale=bs(n)/bs(t),e.translate=Qn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=HAe&&e.scale<=zAe||isNaN(e.scale))&&(e.scale=1),(e.translate>=WAe&&e.translate<=GAe||isNaN(e.translate))&&(e.translate=0)}function kp(e,t,n,r){wD(e.x,t.x,n.x,r?r.originX:void 0),wD(e.y,t.y,n.y,r?r.originY:void 0)}function CD(e,t,n){e.min=n.min+t.min,e.max=e.min+bs(t)}function qAe(e,t,n){CD(e.x,t.x,n.x),CD(e.y,t.y,n.y)}function SD(e,t,n){e.min=t.min-n.min,e.max=e.min+bs(t)}function Mp(e,t,n){SD(e.x,t.x,n.x),SD(e.y,t.y,n.y)}function xo(e){return[e("x"),e("y")]}const PK=({current:e})=>e?e.ownerDocument.defaultView:null,ED=(e,t)=>Math.abs(e-t);function KAe(e,t){const n=ED(e.x,t.x),r=ED(e.y,t.y);return Math.sqrt(n**2+r**2)}class OK{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=rw(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=KAe(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:y}=p,{timestamp:x}=$r;this.history.push({...y,timestamp:x});const{onStart:v,onMove:b}=this.handlers;h||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=nw(h,this.transformPagePoint),On.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=rw(p.type==="pointercancel"?this.lastMoveEventInfo:nw(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),y&&y(p,v)},!tA(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const i=wg(t),c=nw(i,this.transformPagePoint),{point:u}=c,{timestamp:f}=$r;this.history=[{...u,timestamp:f}];const{onSessionStart:m}=n;m&&m(t,rw(c,this.history)),this.removeListeners=vg(Ep(this.contextWindow,"pointermove",this.handlePointerMove),Ep(this.contextWindow,"pointerup",this.handlePointerUp),Ep(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function nw(e,t){return t?{point:t(e.point)}:e}function kD(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rw({point:e},t){return{point:e,delta:kD(e,LK(t)),offset:kD(e,YAe(t)),velocity:QAe(t,.1)}}function YAe(e){return e[0]}function LK(e){return e[e.length-1]}function QAe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=LK(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>ma(t)));)n--;if(!r)return{x:0,y:0};const o=Ga(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function XAe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Qn(n,e,r.max):Math.min(e,n)),e}function MD(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ZAe(e,{top:t,left:n,bottom:r,right:s}){return{x:MD(e.x,n,s),y:MD(e.y,t,r)}}function TD(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Kd(t.min,t.max-r,e.min):r>s&&(n=Kd(e.min,e.max-s,t.min)),Gi(0,1,n)}function t6e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const rE=.35;function n6e(e=rE){return e===!1?e=0:e===!0&&(e=rE),{x:AD(e,"left","right"),y:AD(e,"top","bottom")}}function AD(e,t,n){return{min:ND(e,t),max:ND(e,n)}}function ND(e,t){return typeof e=="number"?e:e[t]||0}const r6e=new WeakMap;class s6e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=or(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=m=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(wg(m).point)},a=(m,p)=>{const{drag:h,dragPropagation:g,onDragStart:y}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fTe(h),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xo(v=>{let b=this.getAxisMotionValue(v).get()||0;if(qa.test(b)){const{projection:_}=this.visualElement;if(_&&_.layout){const w=_.layout.layoutBox[v];w&&(b=bs(w)*(parseFloat(b)/100))}}this.originPoint[v]=b}),y&&On.postRender(()=>y(m,p)),tE(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},i=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:y,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=p;if(g&&this.currentDirection===null){this.currentDirection=o6e(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),x&&x(m,p)},c=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p,this.stop(m,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>xo(m=>this.getAnimationState(m)==="paused"&&this.getAxisMotionValue(m).animation?.play()),{dragSnapToOrigin:f}=this.getProps();this.panSession=new OK(t,{onSessionStart:o,onStart:a,onMove:i,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:PK(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&On.postRender(()=>i(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!$0(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=XAe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&cd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ZAe(r.layoutBox,t):this.constraints=!1,this.elastic=n6e(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&xo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=t6e(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!cd(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=dAe(r,s.root,this.visualElement.getTransformPagePoint());let a=JAe(s.layout.layoutBox,o);if(n){const i=n(lAe(a));this.hasMutatedConstraints=!!i,i&&(a=xK(i))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),c=this.constraints||{},u=xo(f=>{if(!$0(f,n,this.currentDirection))return;let m=c&&c[f]||{};a&&(m={min:0,max:0});const p=s?200:1e6,h=s?40:1e7,g={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(f,g)});return Promise.all(u).then(i)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return tE(this.visualElement,t),r.start(fA(t,r,0,n,this.visualElement,!1))}stopAnimation(){xo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xo(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){xo(n=>{const{drag:r}=this.getProps();if(!$0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:i}=s.layout.layoutBox[n];o.set(t[n]-Qn(a,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!cd(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};xo(a=>{const i=this.getAxisMotionValue(a);if(i&&this.constraints!==!1){const c=i.get();s[a]=e6e({min:c,max:c},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),xo(a=>{if(!$0(a,t,null))return;const i=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];i.set(Qn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;r6e.set(this.visualElement,this);const t=this.visualElement.current,n=Ep(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();cd(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),On.read(r);const a=gh(window,"resize",()=>this.scalePositionWithinConstraints()),i=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(xo(f=>{const m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=c[f].translate,m.set(m.get()+c[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:a=rE,dragMomentum:i=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function $0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function o6e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class a6e extends rc{constructor(t){super(t),this.removeGroupControls=Ao,this.removeListeners=Ao,this.controls=new s6e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ao}unmount(){this.removeGroupControls(),this.removeListeners()}}const RD=e=>(t,n)=>{e&&On.postRender(()=>e(t,n))};class i6e extends rc{constructor(){super(...arguments),this.removePointerDownListener=Ao}onPointerDown(t){this.session=new OK(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:PK(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:RD(t),onStart:RD(n),onMove:r,onEnd:(o,a)=>{delete this.session,s&&On.postRender(()=>s(o,a))}}}mount(){this.removePointerDownListener=Ep(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const my={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function DD(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Am={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(St.test(e))e=parseFloat(e);else return e;const n=DD(e,t.target.x),r=DD(e,t.target.y);return`${n}% ${r}%`}},l6e={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Bl.parse(e);if(s.length>5)return r;const o=Bl.createTransformer(e),a=typeof s[0]!="number"?1:0,i=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=i,s[1+a]/=c;const u=Qn(i,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),o(s)}};let sw=!1;class c6e extends d.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;OTe(u6e),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),sw&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),my.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:a}=r;return a&&(a.isPresent=o,sw=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||On.postRender(()=>{const i=a.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),eA.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;sw=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function FK(e){const[t,n]=rK(),r=d.useContext(ch);return l.jsx(c6e,{...e,layoutGroup:r,switchLayoutGroup:d.useContext(gK),isPresent:t,safeToRemove:n})}const u6e={borderRadius:{...Am,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Am,borderTopRightRadius:Am,borderBottomLeftRadius:Am,borderBottomRightRadius:Am,boxShadow:l6e};function BK(e,t,n){const r=Lr(e)?e:Zc(e);return r.start(fA("",r,t,n)),r.animation}const d6e=(e,t)=>e.depth-t.depth;class f6e{constructor(){this.children=[],this.isDirty=!1}add(t){PT(this.children,t),this.isDirty=!0}remove(t){xg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(d6e),this.isDirty=!1,this.children.forEach(t)}}function m6e(e,t){const n=Os.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(qi(r),e(o-t))};return On.setup(r,!0),()=>qi(r)}const UK=["TopLeft","TopRight","BottomLeft","BottomRight"],p6e=UK.length,jD=e=>typeof e=="string"?parseFloat(e):e,ID=e=>typeof e=="number"||St.test(e);function h6e(e,t,n,r,s,o){s?(e.opacity=Qn(0,n.opacity??1,g6e(r)),e.opacityExit=Qn(t.opacity??1,0,y6e(r))):o&&(e.opacity=Qn(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(Kd(e,t,r))}function OD(e,t){e.min=t.min,e.max=t.max}function yo(e,t){OD(e.x,t.x),OD(e.y,t.y)}function LD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function FD(e,t,n,r,s){return e-=t,e=m2(e,1/n,r),s!==void 0&&(e=m2(e,1/s,r)),e}function x6e(e,t=0,n=1,r=.5,s,o=e,a=e){if(qa.test(t)&&(t=parseFloat(t),t=Qn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let i=Qn(o.min,o.max,r);e===o&&(i-=t),e.min=FD(e.min,t,n,i,s),e.max=FD(e.max,t,n,i,s)}function BD(e,t,[n,r,s],o,a){x6e(e,t[n],t[r],t[s],t.scale,o,a)}const v6e=["x","scaleX","originX"],b6e=["y","scaleY","originY"];function UD(e,t,n,r){BD(e.x,t,v6e,n?n.x:void 0,r?r.x:void 0),BD(e.y,t,b6e,n?n.y:void 0,r?r.y:void 0)}function VD(e){return e.translate===0&&e.scale===1}function HK(e){return VD(e.x)&&VD(e.y)}function HD(e,t){return e.min===t.min&&e.max===t.max}function _6e(e,t){return HD(e.x,t.x)&&HD(e.y,t.y)}function zD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zK(e,t){return zD(e.x,t.x)&&zD(e.y,t.y)}function WD(e){return bs(e.x)/bs(e.y)}function GD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class w6e{constructor(){this.members=[]}add(t){PT(this.members,t),t.scheduleRender()}remove(t){if(xg(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function C6e(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,a=n?.z||0;if((s||o||a)&&(r=`translate3d(${s}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:f,rotateX:m,rotateY:p,skewX:h,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),f&&(r+=`rotate(${f}deg) `),m&&(r+=`rotateX(${m}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const i=e.x.scale*t.x,c=e.y.scale*t.y;return(i!==1||c!==1)&&(r+=`scale(${i}, ${c})`),r||"none"}const ow=["","X","Y","Z"],S6e=1e3;let E6e=0;function aw(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function WK(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=AK(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",On,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&WK(r)}function GK({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},i=t?.()){this.id=E6e++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(T6e),this.nodes.forEach(D6e),this.nodes.forEach(j6e),this.nodes.forEach(A6e)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;On.read(()=>{m=window.innerWidth}),e(a,()=>{const h=window.innerWidth;h!==m&&(m=h,this.root.updateBlockedByResize=!0,f&&f(),f=m6e(p,250),my.hasAnimatedSinceResize&&(my.hasAnimatedSinceResize=!1,this.nodes.forEach(KD)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&u&&(i||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||F6e,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!zK(this.targetLayout,h),b=!m&&p;if(this.options.layoutRoot||this.resumeFrom||b||m&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...ZT(g,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(f,b)}else m||KD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(I6e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&WK(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!bs(this.snapshot.measuredBox.x)&&!bs(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=w/1e3;YD(m.x,a.x,S),YD(m.y,a.y,S),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mp(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),O6e(this.relativeTarget,this.relativeTargetOrigin,p,S),_&&_6e(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=or()),yo(_,this.relativeTarget)),y&&(this.animationValues=f,h6e(f,u,this.latestValues,S,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=On.update(()=>{my.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Zc(0)),this.currentAnimation=BK(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:i=>{this.mixTargetDelta(i),a.onUpdate&&a.onUpdate(i)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(S6e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:i,target:c,layout:u,latestValues:f}=a;if(!(!i||!c||!u)){if(this!==a&&this.layout&&u&&$K(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||or();const m=bs(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+m;const p=bs(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}yo(i,c),dd(i,f),kp(this.projectionDeltaWithTransform,this.layoutCorrected,i,f)}}registerSharedNode(a,i){this.sharedNodes.has(a)||this.sharedNodes.set(a,new w6e),this.sharedNodes.get(a).add(i);const u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:i,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let i=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(i=!0),!i)return;const u={};c.z&&aw("z",a,u,this.animationValues);for(let f=0;fa.currentAnimation?.stop()),this.root.nodes.forEach($D),this.root.sharedNodes.clear()}}}function k6e(e){e.updateLayout()}function M6e(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?xo(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],p=bs(m);m.min=n[f].min,m.max=m.min+p}):$K(s,t.layoutBox,n)&&xo(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],p=bs(n[f]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=fd();kp(a,n,t.layoutBox);const i=fd();o?kp(i,e.applyTransform(r,!0),t.measuredBox):kp(i,n,t.layoutBox);const c=!HK(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:p}=f;if(m&&p){const h=or();Mp(h,t.layoutBox,m.layoutBox);const g=or();Mp(g,n,p.layoutBox),zK(h,g)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:i,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function T6e(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function A6e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function N6e(e){e.clearSnapshot()}function $D(e){e.clearMeasurements()}function qD(e){e.isLayoutDirty=!1}function R6e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function KD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function D6e(e){e.resolveTargetDelta()}function j6e(e){e.calcProjection()}function I6e(e){e.resetSkewAndRotation()}function P6e(e){e.removeLeadSnapshot()}function YD(e,t,n){e.translate=Qn(t.translate,0,n),e.scale=Qn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QD(e,t,n,r){e.min=Qn(t.min,n.min,r),e.max=Qn(t.max,n.max,r)}function O6e(e,t,n,r){QD(e.x,t.x,n.x,r),QD(e.y,t.y,n.y,r)}function L6e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const F6e={duration:.45,ease:[.4,0,.1,1]},XD=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ZD=XD("applewebkit/")&&!XD("chrome/")?Math.round:Ao;function JD(e){e.min=ZD(e.min),e.max=ZD(e.max)}function B6e(e){JD(e.x),JD(e.y)}function $K(e,t,n){return e==="position"||e==="preserve-aspect"&&!$Ae(WD(t),WD(n),.2)}function U6e(e){return e!==e.root&&e.scroll?.wasRoot}const V6e=GK({attachResizeListener:(e,t)=>gh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),iw={current:void 0},qK=GK({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!iw.current){const e=new V6e({});e.mount(window),e.setOptions({layoutScroll:!0}),iw.current=e}return iw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),H6e={pan:{Feature:i6e},drag:{Feature:a6e,ProjectionNode:qK,MeasureLayout:FK}};function ej(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&On.postRender(()=>o(t,wg(t)))}class z6e extends rc{mount(){const{current:t}=this.node;t&&(this.unmount=mTe(t,(n,r)=>(ej(this.node,r,"Start"),s=>ej(this.node,s,"End"))))}unmount(){}}class W6e extends rc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=vg(gh(this.node.current,"focus",()=>this.onFocus()),gh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tj(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&On.postRender(()=>o(t,wg(t)))}class G6e extends rc{mount(){const{current:t}=this.node;t&&(this.unmount=yTe(t,(n,r)=>(tj(this.node,r,"Start"),(s,{success:o})=>tj(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const sE=new WeakMap,lw=new WeakMap,$6e=e=>{const t=sE.get(e.target);t&&t(e)},q6e=e=>{e.forEach($6e)};function K6e({root:e,...t}){const n=e||document;lw.has(n)||lw.set(n,{});const r=lw.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(q6e,{root:e,...t})),r[s]}function Y6e(e,t,n){const r=K6e(t);return sE.set(e,n),r.observe(e),()=>{sE.delete(e),r.unobserve(e)}}const Q6e={some:0,all:1};class X6e extends rc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Q6e[s]},i=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),p=u?f:m;p&&p(c)};return Y6e(this.node.current,a,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Z6e(t,n))&&this.startObserver()}unmount(){}}function Z6e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const J6e={inView:{Feature:X6e},tap:{Feature:G6e},focus:{Feature:W6e},hover:{Feature:z6e}},eNe={layout:{ProjectionNode:qK,MeasureLayout:FK}},tNe={...UAe,...J6e,...H6e,...eNe},Te=iAe(tNe,hAe);function pA(e){const t=yg(()=>Zc(e)),{isStatic:n}=d.useContext(fv);if(n){const[,r]=d.useState(e);d.useEffect(()=>t.on("change",r),[])}return t}function KK(e,t){const n=pA(t()),r=()=>n.set(t());return r(),uv(()=>{const s=()=>On.preRender(r,!1,!0),o=e.map(a=>a.on("change",s));return()=>{o.forEach(a=>a()),qi(r)}}),n}function nNe(e){Sp.current=[],e();const t=KK(Sp.current,e);return Sp.current=void 0,t}function op(e,t,n,r){if(typeof e=="function")return nNe(e);const s=typeof t=="function"?t:xTe(t,n,r);return Array.isArray(e)?nj(e,s):nj([e],([o])=>s(o))}function nj(e,t){const n=yg(()=>[]);return KK(e,()=>{n.length=0;const r=e.length;for(let s=0;st&&s.at{const k=uNe(w),{delay:I=0,times:M=Lq(k),type:A="keyframes",repeat:D,repeatType:P,repeatDelay:F=0,...R}=S;let{ease:j=t.ease||"easeOut",duration:L}=S;const U=typeof I=="function"?I(E,N):I,O=k.length,$=XT(A)?A:s?.[A||"keyframes"];if(O<=2&&$){let Y=100;if(O===2&&mNe(k)){const ae=k[1]-k[0];Y=Math.abs(ae)}const te={...R};L!==void 0&&(te.duration=ma(L));const se=jq(te,Y,$);j=se.ease,L=se.duration}L??(L=o);const G=m+U;M.length===1&&M[0]===0&&(M[1]=1);const H=M.length-k.length;if(H>0&&Oq(M,H),k.length===1&&k.unshift(null),D){L=rNe(L,D);const Y=[...k],te=[...M];j=Array.isArray(j)?[...j]:[j];const se=[...j];for(let ae=0;ae{for(const y in h){const x=h[y];x.sort(iNe);const v=[],b=[],_=[];for(let S=0;Stypeof e=="number",mNe=e=>e.every(fNe);function pNe(e,t){return e in t}class hNe extends CK{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(pNe(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return or()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function gNe(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=nA(e)&&!nK(e)?new TK(t):new kK(t);n.mount(e),hh.set(e,n)}function yNe(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new hNe(t);n.mount(e),hh.set(e,n)}function xNe(e,t){return Lr(e)||typeof e=="number"||typeof e=="string"&&!gA(t)}function QK(e,t,n,r){const s=[];if(xNe(e,t))s.push(BK(e,gA(t)&&t.default||t,n&&(n.default||n)));else{const o=YK(e,t,r),a=o.length;for(let i=0;i{r.push(...QK(i,o,a))}),r}function bNe(e){return Array.isArray(e)&&e.some(Array.isArray)}function _Ne(e){function t(n,r,s){let o=[];bNe(n)?o=vNe(n,r,e):o=QK(n,r,s,e);const a=new X4e(o);return e&&(e.animations.push(a),a.finished.then(()=>{xg(e.animations,a)})),a}return t}const wNe=_Ne();function XK(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const CNe=({children:e,className:t,delimiter:n="·",...r})=>{const s=T.Children.toArray(e),o=s.map((a,i)=>{if(T.isValidElement(a)&&a.type===ZK){const c=a.props.id;return l.jsxs(T.Fragment,{children:[a,i!==s.length-1&&l.jsxs(V,{className:"inline-flex !text-inherit",children:[" ",n," "]})]},c)}return null});return l.jsx("div",{className:`gap-sm flex items-center ${t}`,...r,children:o})},ZK=({children:e})=>l.jsx(l.Fragment,{children:e}),ya=CNe,Vn=ZK,JK=T.memo(({onClick:e,testId:t="close-button",size:n="small",variant:r="common",className:s="right-sm top-sm absolute",ariaLabel:o="Close"})=>l.jsx("div",{className:s,children:l.jsx(rt,{testId:t,variant:r,pill:!0,size:n,onClick:e,icon:B("x"),ariaLabel:o})}));JK.displayName="CloseButton";const yA=T.memo(e=>{const{children:t,trigger:n,...r}=e;return l.jsxs(NT,{...r,children:[n&&l.jsx(J$,{asChild:!0,children:n}),l.jsx(kt,{children:r.open&&l.jsx(RT,{forceMount:!0,children:t})})]})});yA.displayName="ControlledDialog";function SNe(e){const[t,n]=d.useState(!1),[r,s]=d.useState(!1),o=d.useMemo(()=>e?.isEnabled??!0,[e?.isEnabled]),a=d.useMemo(()=>o&&!t&&!r,[o,t,r]);return d.useMemo(()=>({canShow:a,handleConfirm(){n(!1),s(!0),e?.onConfirm()},handleCancel(){n(!1),s(!1)},isShowing:t,show(){n(!0)}}),[a,t,e])}const eY=zt("ConfirmCloseModalContext",{canShow:!1,handleCancel(){},handleConfirm(){},isShowing:!1,show(){}}),tY=T.memo(function(t){const{children:n,trigger:r,value:s}=t;return l.jsx(eY.Provider,{value:s,children:l.jsx(yA,{onOpenChange:s.handleCancel,open:s.isShowing,trigger:r,children:n})})});tY.displayName="ConfirmCloseModalDialog";function fbt(){const e=d.useContext(eY);if(!e)throw new Error("useConfirmCloseModalContext() used outside of provider.");return e}const ENe=250,xA=T.memo(({animationClassName:e,children:t,isOpen:n=!1,transparent:r=!1,canOutsideClickClose:s=!0,onBeforeClose:o,onClose:a,onIsClosing:i,childVariant:c="default",center:u=!0,shouldClose:f=!1,disableAnimation:m=!1,testId:p,removeScroll:h=!0,shards:g=[],delayClose:y=!0,variant:x="default",portalTarget:v,includeBlur:b=!0,forceColorScheme:_})=>{const w=d.useRef(null),S=d.useRef(null),C=d.useRef(null),[E,N]=d.useState(!1),k=d.useRef(!1),I=d.useCallback(j=>{E||o?.()===!1||(y?(N(!0),i?.(),setTimeout(()=>{a?.(j),N(!1)},ENe)):(N(!0),a?.(j),N(!1)))},[E,o,y,i,a]);d.useEffect(()=>{f&&!E&&I("closed")},[f,E,I]);const M=d.useCallback(j=>{r&&!s?j.stopPropagation():j.target===w.current&&I("backdrop")},[r,s,I]),A=d.useCallback(j=>{const L=j.target;if(L instanceof Element){if(S.current===L||S.current?.contains(L))return;const U=L.closest('[data-type="portal"]');if(U&&U!==C.current&&!r)return}N(!1),I("clickaway")},[I,r]);d.useEffect(()=>{if(n&&r&&s)return document.addEventListener("click",A),()=>{document.removeEventListener("click",A)}},[n,r,A,s]);const D=d.useCallback(j=>{j.key==="Escape"&&I("escape")},[I]);d.useEffect(()=>(n&&document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}),[n,D]);const P=d.useMemo(()=>z("duration-200 fill-mode-both",{"animate-in fade-in zoom-in-[0.98] ease-in":["default","large","small","hide-chrome","full-sheet"].includes(c),"zoom-out-[0.98] fade-out animate-out ease-out":["default","hide-chrome","full-sheet","large","small"].includes(c)&&E,"fixed bottom-0 left-0":c==="bottom-left-sheet","fixed top-0 right-0 left-0":c==="side-sheet","fixed bottom-0 left-0 right-0":c==="bottom-sheet"},e),[e,c,E]),F=z("items-stretch md:items-center",{"fill-mode-both fixed inset-0":!r,"bg-backdrop/70":x==="default"||x==="default-less-blur","bg-lightbox/95":x==="lightbox","animate-in fade-in ease-outExpo duration-200":!E&&!m,"animate-out fade-out ease-inExpo duration-200":E&&!m},{"backdrop-blur-md":b&&x==="lightbox","backdrop-blur-sm":b&&x==="default","backdrop-blur-[0.5px]":b&&x==="default-less-blur"}),R=d.useMemo(()=>n?l.jsxs(fg,{removeScrollBar:!1,enabled:h,allowPinchZoom:!0,shards:g,children:[l.jsx("div",{className:F}),l.jsx("div",{ref:w,onPointerDown:j=>{k.current=j.target===w.current},onPointerUp:j=>{k.current&&M(j),k.current=!1},className:z({"fixed inset-0 overflow-y-auto":!r,"flex items-center justify-center":u}),"data-test-id":p,children:l.jsx("div",{ref:S,className:P,children:t})})]}):null,[n,t,r,u,p,M,P,S,w,h,g,F]);return l.jsx(Jl,{portalTarget:v,children:l.jsx("div",{ref:C,"data-type":"portal","data-color-scheme":_,children:R})})});xA.displayName="Overlay";const po=T.memo(({title:e,subtitle:t,subtitleClassname:n,centerTitle:r,children:s,actionList:o=Ie,variant:a="default",onClose:i,noPadding:c=!1,onIsClosing:u,titleContent:f,footerContent:m,icon:p,overlayVariant:h,titleLeadingButtonProps:g,confirmOnClose:y,titleTextVariant:x="page-title",headerClassname:v,closeButtonClassname:b="right-0 top-sm absolute",footerClassname:_,renderCloseButton:w=!0,fixedTitle:S,modalClassname:C,modalContentClassname:E,modalElementProps:N,includeBlur:k=!0,isOpen:I,ref:M,wrapperClassname:A,forceColorScheme:D,...P})=>{const F=d.useRef(null),R=d.useRef(null),j=d.useRef(null),L=d.useRef(null),[U,O]=d.useState(!1),[$,G]=d.useState(!1),[H,Q]=d.useState(!1);d.useEffect(()=>{I&&!H?Q(!0):!I&&H&&!U&&O(!0)},[I,H,U]);const Y=d.useMemo(()=>!!y,[y]),te=SNe({isEnabled:Y,onConfirm(){G(!0),O(!0)}}),se=d.useMemo(()=>z(C,"bg-base shadow-md overflow-y-auto scrollbar-subtle fill-mode-both",{"md:rounded-xl md:min-w-[600px] max-w-screen-sm shadow-md dark:border dark:border-subtlest relative h-full max-h-[100vh] md:max-h-[95vh] overflow-auto md:w-full":a==="default","min-h-0 max-h-[70vh] rounded-t-xl bottom-0 left-0 right-0 flex flex-col":a==="bottom-left-sheet","w-screen md:h-screen h-[100dvh] flex flex-col":a==="full-sheet","w-screen min-h-[60dvh] md:min-h-[60vh] shadow-overlay max-h-[96dvh] md:max-h-[96vh] flex flex-col fixed bottom-0 left-0 right-0":a==="bottom-sheet","h-screen w-[40vw] min-w-[500px] shadow-overlay top-0 right-0 fixed flex flex-col":a==="side-sheet","animate-in slide-in-from-right ease-outExpo":a==="side-sheet"&&!$,"animate-out slide-out-to-right ease-inExpo":a==="side-sheet"&&$,"animate-in slide-in-from-bottom ease-in":["bottom-left-sheet","bottom-sheet"].includes(a)&&!$,"animate-out slide-out-to-bottom ease-out":["bottom-left-sheet","bottom-sheet"].includes(a)&&$,"max-h-[100vh] w-[90vw] rounded-l-xl flex flex-col":a==="wide","h-[95vh] w-[95vw] rounded-xl flex flex-col":a==="full","md:rounded-lg md:min-w-[600px] max-w-screen-lg shadow-md relative overflow-auto max-h-[100vh]":a==="large","md:rounded-lg md:min-w-[500px] max-w-screen-lg shadow-md relative overflow-auto max-h-[100vh]":a==="medium","md:rounded-lg md:max-w-[440px] shadow-md relative overflow-auto max-h-[100vh]":a==="small","md:rounded-lg md:max-w-[350px] shadow-md relative overflow-auto max-h-[100vh]":a==="thin"}),[a,$,C]),ae=d.useMemo(()=>a==="bottom-left-sheet"||a==="bottom-sheet",[a]),X=d.useMemo(()=>z("grow flex flex-col justify-center shrink-0",{"md:pt-md":e===void 0&&!f,"md:pb-lg":o?.length===0,"p-sm":!c&&!ae,"p-0":c,"pb-lg":ae},E),[o?.length,c,e,E,f,ae]),ee=d.useMemo(()=>o.map((he,_e)=>d.createElement(nY,{...he,idx:_e,key:_e,confirmCloseModal:te})),[o,te]);d.useImperativeHandle(M,()=>({scrollContainerRef:F,headerRef:R,contentRef:j,footerRef:L}),[F,R,L]);const le=d.useCallback(()=>{u?.(),G(!0)},[u]),re=d.useCallback(he=>{G(!1),O(!1),Q(!1),i?.(he)},[i]),ce=d.useCallback(()=>{if(te?.canShow){te.show();return}O(!0)},[te]),ue=d.useCallback(()=>te?.canShow?(te.show(),!1):!0,[te]),{canOutsideClickClose:pe}=d.useContext(KH),xe=d.useMemo(()=>l.jsxs(l.Fragment,{children:[l.jsx("div",{children:a==="hide-chrome"?l.jsx("div",{children:s}):l.jsxs(Te.div,{animate:{scale:te.isShowing?.955:1},className:se,transition:{duration:.2,ease:tl(.16,1,.3,1)},ref:F,...N,children:[l.jsx("div",{className:"right-sm top-sm fixed z-[23] md:absolute"}),l.jsxs(K,{className:z(A,"px-md pb-md flex min-h-0 w-screen grow flex-col md:w-[unset] md:grow-[unset]",{"h-full":!S,"h-auto !grow":S}),children:[l.jsxs(K,{variant:"background",className:z(v,"pt-md sticky top-0 z-[22] w-full shrink-0",{"text-center":r,"h-10":!e&&!f}),ref:R,children:[l.jsxs("div",{className:"p-sm flex items-center gap-1.5",children:[g&&l.jsx(rt,{extraCSS:"-ml-sm",...g,size:"small",variant:"common"}),p?l.jsx(ge,{icon:p,className:"text-foreground -ml-xs shrink-0",size:"xl"}):null,e&&l.jsx(V,{variant:x,className:z("text-pretty",{"line-clamp-1 leading-none":p,"line-clamp-3":!p,"pt-lg grow":r,"mr-lg":!r}),children:e}),!e&&f,w&&l.jsx(JK,{onClick:ce,testId:"close-modal",className:b})]}),t&&l.jsx(V,{variant:"base",color:"light",className:z("mt-xs p-sm line-clamp-3 text-pretty",n),children:t})]}),s&&l.jsx("div",{className:X,ref:j,children:s}),(ee?.length>0||m)&&l.jsxs(K,{variant:"background",className:z("gap-x-sm p-sm pt-lg bottom-0 z-10 flex items-center",{"justify-end":!m},{"justify-between":m},{sticky:!0},_),ref:L,children:[m&&l.jsx("div",{className:"flex-1",children:m}),ee]})]})]})}),Y&&l.jsx(tY,{value:te,children:y})]}),[ee,r,s,b,te,y,X,S,_,m,ce,v,p,Y,se,N,w,t,n,e,f,g,x,a,A]);return l.jsx(xA,{forceColorScheme:D,includeBlur:k,childVariant:a,shouldClose:U,onBeforeClose:ue,onIsClosing:le,onClose:re,variant:h,isOpen:H,canOutsideClickClose:pe,...P,children:xe})});po.displayName="Modal";const nY=T.memo(({idx:e,text:t,onClick:n,variant:r,disabled:s,isLoading:o,testId:a,icon:i,shouldShowConfirmDialog:c,buttonClassname:u,tooltipText:f,confirmCloseModal:m})=>{const p=d.useCallback(y=>{if(y.stopPropagation(),r&&c&&m.canShow){m.show();return}n?.()},[m,n,c,r]),h={key:e,text:t,disabled:s,isLoading:o,testId:a,chevronIcon:i,extraCSS:u},g=d.createElement(ze,{fullWidthMobile:!0,variant:r||void 0,...h,onClick:p,key:h.key});return f?l.jsx(Oo,{tooltipText:f,tooltipLayout:"top",children:g}):g});nY.displayName="ButtonFactory";const mbt=Object.freeze(Object.defineProperty({__proto__:null,default:po},Symbol.toStringTag,{value:"Module"})),kNe=1080,aj=1e4;function Tr(e){return typeof e=="string"?ny(e).startsWith("image/"):e.type.startsWith("image/")}const rY=(e,t=32)=>`https://www.google.com/s2/favicons?sz=${t}&domain=${e}`,MNe=(e,t,n)=>{const r=Math.min(e,t);let s=e,o=t;if(r>n){const i=n/r;s=Math.round(e*i),o=Math.round(t*i)}const a=Math.max(s,o);if(a>aj){const i=aj/a;s=Math.max(1,Math.round(s*i)),o=Math.max(1,Math.round(o*i))}return{width:s,height:o}},TNe=(e,t=kNe,n=.98)=>new Promise((r,s)=>{if(!Tr(e)){s(new Error("File is not an image."));return}const o=document.createElement("canvas"),a=o.getContext("2d",{alpha:!0,colorSpace:"srgb"}),i=new Image,c=URL.createObjectURL(e);if(!a){s(new Error("Could not get canvas context"));return}a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",i.onload=()=>{const u=MNe(i.width,i.height,t);o.width=u.width,o.height=u.height;const f="image/jpeg",m=n;a.fillStyle="#fff",a.fillRect(0,0,o.width,o.height),a.drawImage(i,0,0,u.width,u.height),o.toBlob(p=>{if(!p){s(new Error("Failed to create blob from canvas"));return}const g=e.name.replace(/\.[^/.]+$/,"")+".jpg",y=new File([p],g,{type:f});URL.revokeObjectURL(c),r(y)},f,m)},i.onerror=()=>{URL.revokeObjectURL(c),s(new Error("Failed to load image."))},i.src=c}),ANe={"my.apps.factset.com":"www.factset.com"},Lo=T.memo(({domain:e,overrideIconUrl:t,size:n=16,hideBorder:r=!1,className:s,...o})=>{const a=ANe[e]||e,i=rY(a,128),c=d.useMemo(()=>t||i,[t,i]),[u,f]=d.useState(!0);d.useEffect(()=>{f(!0)},[c]);const m=d.useMemo(()=>({width:n,height:n}),[n]),p=d.useMemo(()=>({width:n*.7,height:n*.7}),[n]);return l.jsxs("div",{style:{width:n,height:n},className:z("relative shrink-0 overflow-hidden rounded-full",s),...o,children:[u?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:z("rounded-inherit absolute inset-0",!r&&"bg-white")}),l.jsx("img",{className:"relative block",src:c,alt:`${e} favicon`,width:n,height:n,onLoad:h=>{const g=h.target,y=t!==void 0||g.naturalWidth!==16||g.naturalHeight!==16;f(y||e!==a)},onError:()=>{f(!1)},style:{width:n,height:n}})]}):l.jsx(K,{variant:"subtle",style:m,className:"inline-flex items-center justify-center",children:l.jsx(ge,{icon:B("world"),className:"text-quietest relative block",style:p})}),!r&&l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-[black]/10 dark:border-transparent"})]})});Lo.displayName="CitationFavicon";function NNe(e,t,n=2){if(e==null)return"";const r=e.includes(".")?e.slice(e.lastIndexOf(".")):"",s=e.substring(0,e.length-r.length);return s.length>t?s.substring(0,t-r.length-3)+".".repeat(n)+r:s+r}const hu=e=>{try{return(new URL(e).pathname.split("/").pop()||"").split(".").pop()?.toLowerCase()}catch{return e.split(".").pop()?.toLowerCase()}},sY=e=>e.file.type.includes("image"),RNe=e=>e.file.type==="application/pdf",DNe=e=>e.file.type==="text/csv"||e.file.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",jNe=e=>e.file.type==="text/plain"||e.file.type==="application/msword"||e.file.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e.file.type==="text/markdown",oE={txt:"text/plain",pdf:"application/pdf",jpeg:"image/jpeg",jpg:"image/jpeg",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",md:"text/markdown",png:"image/png",csv:"text/csv"},INe=e=>{if(e<0)throw new Error("Number of bytes cannot be negative");const t=["B","KB","MB","GB"];let n=0,r=e;for(;r>=1e3&&n!!(hu(e)===vo.PDF||Nf(e)),oY=e=>{const t=hu(e);if(Nf(e))return B("file-type-pdf");switch(t){case vo.TXT:return B("file-text");case vo.MARKDOWN:return B("file-text");case vo.PDF:return B("file-type-pdf");case vo.XLSX:return B("file-spreadsheet");case vo.CSV:return B("file-type-csv");case vo.DOCX:return B("file-type-doc");case vo.PPTX:return B("file-type-ppt");case vo.JPG:case vo.JPEG:case vo.PNG:return B("photo");default:return B("file")}},Hf=e=>e?.file_metadata?.file_source===dV.MEETING_TRANSCRIPT;function vA(e,t){return!1}const PNe={[er.GOOGLE_DRIVE]:B("brand-google-drive"),[er.ONEDRIVE]:B("brand-onedrive"),[er.SHAREPOINT]:B("brand-windows"),[er.DROPBOX]:Cpe,[er.BOX]:wpe,[er.GENERATED_IMAGE]:B("photo"),[er.GENERATED_VIDEO]:B("slideshow"),[er.WILEY]:_pe,[er.LOCAL]:B("file")},bA=T.memo(({url:e,mcpServerSource:t,isConversationHistory:n,isMemory:r,isInlineAttachment:s,connectionType:o,isAttachment:a,patentName:i,isClientContext:c,isMeetingTranscript:u})=>{const f=d.useMemo(()=>{const m=Kc(e),p=a?oY(e):null,h=t?Of(t):null;if(n)return l.jsx(ge,{icon:B("list-search"),size:"xs"});if(i)return l.jsx(rV,{className:"size-3.5"});if(r)return l.jsx(ge,{icon:B("bubble-text"),size:"xs"});if(u)return l.jsx(ge,{icon:B("microphone"),size:"xs"});if(o){const g=PNe[o];return g?l.jsx(ge,{icon:g}):l.jsx(Lo,{domain:m,overrideIconUrl:h||void 0})}else return s?l.jsx(ge,{icon:B("paperclip"),size:"xs"}):a?l.jsx(ge,{icon:p||B("file"),size:"xs"}):c?l.jsx(ge,{icon:B("hourglass-high"),size:"xs"}):l.jsx(Lo,{domain:m,overrideIconUrl:h||void 0})},[e,a,t,n,i,r,u,o,s,c]);return l.jsx("div",{className:"flex size-4 items-center justify-center",children:f})});bA.displayName="Icon";const _A=T.memo(({url:e,source:t,isAttachment:n,connectionType:r,isConversationHistory:s,patentName:o})=>{const a=J(),i=d.useMemo(()=>{if(s)return a.formatMessage({defaultMessage:"library",id:"B7J+pmy9R5"});if(o)return o;if(t!=null)return t;let c;return n?c=du(e):r?c=r2(r):c=Ur(e),c.replace(/\.[^.]*$/,"")},[e,t,n,r,s,o,a]);return l.jsx(l.Fragment,{children:i})});_A.displayName="Source";const aY=T.memo(({url:e,source:t,isAttachment:n,isClientContext:r,variant:s="small",color:o="default",truncate:a=!0,className:i,connectionType:c,mcpServerSource:u,isInlineAttachment:f,isMemory:m,patentName:p,isConversationHistory:h,name:g,snippet:y,isMeetingTranscript:x,...v})=>l.jsxs(K,{className:"flex items-center gap-x-1.5 min-w-0",children:[l.jsx(V,{variant:s,className:"relative flex-none",color:m||h?"light":o,children:l.jsx(bA,{url:e,source:t,mcpServerSource:u,isConversationHistory:h,isMemory:m,isInlineAttachment:f,connectionType:c,isAttachment:n,patentName:p,isClientContext:r,isMeetingTranscript:x})}),g&&l.jsx(V,{variant:s,color:o,...v,className:z(i,"min-w-0 truncate"),children:g}),l.jsx(V,{variant:s,color:g?"light":o,className:z("truncate min-w-0 grow break-all leading-none transition-all duration-300",{"max-w-[150px]":t!=null&&a},i),...v,children:l.jsx(_A,{url:e,source:t,isAttachment:n,connectionType:c,isMemory:m,isConversationHistory:h,patentName:p})})]}));aY.displayName="CitationDomainRoot";const xa=Object.assign(aY,{Icon:bA,Source:_A}),gu=T.memo(({isOpen:e,onClose:t,imgProps:n,alt:r,width:s,height:o,origin:a,onDownload:i,footer:c})=>{const{url:u,name:f,showCitation:m=!0}=a||{},p=ci(),h=d.useCallback(g=>{g.stopPropagation(),i?.()},[i]);return l.jsxs(po,{onClose:t,isOpen:e,variant:"hide-chrome",disableAnimation:!1,removeScroll:!p,modalClassname:"z-[100]",children:[l.jsx("div",{className:"flex h-screen w-screen place-content-center",onClick:t,children:l.jsxs("div",{className:z("gap-md p-md md:p-lg flex w-full flex-col",{"md:pb-md":m&&(u||i)}),children:[l.jsx("div",{className:"relative grow",children:l.jsx("div",{className:"absolute inset-0 size-full",children:l.jsx("img",{width:s,height:o,...n,alt:r,className:"size-full object-contain"})})}),m&&(u||i)?l.jsxs("div",{className:"gap-sm flex w-full flex-row justify-center",children:[u&&l.jsx(xt,{href:u,target:"_blank",children:l.jsxs(K,{variant:"subtle",className:"gap-x-xs p-sm flex items-center rounded-full",children:[l.jsx(xa,{url:u,source:f,isAttachment:!1}),l.jsx(V,{variant:"small",className:"pr-xs",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"xs"})})]})}),i&&l.jsx(K,{as:"button",onClick:h,variant:"subtle",className:"gap-x-xs p-sm flex !aspect-square w-9 items-center justify-center rounded-full",children:l.jsx(ge,{icon:B("download"),size:"sm"})})]}):null,c]})}),l.jsx(ze,{onClick:t,icon:B("x"),extraCSS:"!fixed top-md right-md shadow-sm",size:"small",pill:!0,ariaLabel:"Close"})]})});gu.displayName="LightboxImage";const $o=T.memo(({src:e,lightboxSrc:t,alt:n,fadeIn:r,fallbackSrc:s,fallback:o,hasShadow:a=!1,includeLightBoxModal:i=!0,lightboxFooter:c,origin:u,draggable:f=!0,imageClassName:m,maskClassName:p,containerClassName:h,rounded:g="md",onClick:y,AIProps:x,authorName:v,authorUrl:b,onLoad:_,onFail:w,softBlockSaveImage:S=!1,imageRef:C,imageProps:E,testId:N,onDownload:k,...I})=>{const[M,A]=d.useState(!1),[D,P]=d.useState(!1),[F,R]=d.useState(!1),j=d.useRef(null),{isAI:L,AILabel:U}=x||{isAI:!1,AILabel:""},O=d.useRef(Date.now()),$=d.useCallback(ee=>{A(!0),w?.({isConnected:ee.currentTarget.isConnected,loadTime:Date.now()-O.current})},[w]),G=d.useCallback(()=>{P(!0),_?.()},[P,_]);d.useEffect(()=>{if(j.current){if(j.current.complete){G();return}j.current.src||(j.current.src=e)}},[e,G,j]);const H=z(m,"transition-all ease-in-out",{"opacity-100 duration-200 scale-100":D&&r,"opacity-0 scale-[0.98]":!D&&r,"hidden opacity-0":M&&!s,"max-h-[90vh]":i,"cursor-zoom-in hover:shadow-lg duration-200 ":i&&!F}),Q=d.useMemo(()=>({className:H,src:e,alt:n,onError:$,onClick:()=>R(!0),...E}),[n,H,E,$,e]),Y=d.useMemo(()=>({ref:j,onLoad:G,...Q}),[G,Q]),te=d.useMemo(()=>({...Q,src:t??e}),[t,Q,e]),se=d.useCallback(ee=>{ee.stopPropagation()},[]),ae=l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"tiny",color:"white",className:"px-xs py-two h-5 rounded-md bg-black/60 opacity-0 transition-all group-hover:opacity-100",children:l.jsxs(ya,{className:"gap-xs",children:[l.jsx(Vn,{id:"authorName",children:v}),b?l.jsx(Vn,{id:"authorDomain",children:Ur(b)}):null]})}),l.jsx("div",{className:"size-xs bg-black/60 opacity-0 transition-all group-hover:opacity-100"})]}),X=d.useCallback(()=>R(!1),[]);if(M){if(s&&j.current)j.current.src=s;else if(o!==void 0)return o}return l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:y,className:h,"data-testid":N,children:l.jsxs("div",{className:z("bg-subtler group relative size-full overflow-hidden",p,{"shadow-md":a&&D,"transition-all duration-200 ease-in-out hover:scale-[1.02] hover:shadow-lg":a,"rounded-sm":g==="sm","rounded-md":g==="md",rounded:g===!0}),children:[L&&l.jsxs("div",{className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:[l.jsx("div",{children:l.jsx(V,{variant:"tiny",color:"white",className:"gap-x-two px-xs py-two flex h-5 items-center rounded-md bg-black/60 opacity-0 transition-all group-hover:opacity-100",children:l.jsx("span",{children:U})})}),l.jsx("div",{className:"size-xs bg-black/60 opacity-0 transition-all group-hover:opacity-100"}),l.jsx("div",{children:l.jsx(V,{variant:"tiny",color:"white",className:"gap-x-two p-two flex h-5 items-center rounded-md bg-black/60",children:l.jsx(ge,{icon:B("cpu-2"),size:"xs"})})})]}),v&&(b?l.jsx(xt,{href:b??"",target:"_blank",onClick:se,className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:ae}):l.jsx("div",{onClick:se,className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:ae})),S&&!L&&l.jsx("div",{className:"absolute inset-0",onClick:i?()=>R(!0):void 0}),l.jsx("img",{width:I.width,height:I.height,alt:n,...Y,ref:XK([C,j]),draggable:f})]})}),i&&l.jsx(gu,{onClose:X,isOpen:F,imgProps:te,origin:u,width:I.width,height:I.height,alt:n,onDownload:k,footer:c})]})});$o.displayName="Image";const iY=T.memo(({uploadedFiles:e,onRemoveFile:t,ref:n})=>l.jsxs("div",{ref:n,className:"gap-x-sm scrollbar-none flex snap-x snap-mandatory overflow-x-auto",children:[l.jsx("div",{className:"w-xs shrink-0"}),e.map((r,s)=>l.jsx(lY,{uploadedFile:r,onRemoveFile:t},s)),l.jsx("div",{className:"w-xs shrink-0"})]}));iY.displayName="UploadedFilesList";const lY=T.memo(({uploadedFile:e,onRemoveFile:t})=>{const n="uploaded-files-list",{session:r}=je(),{trackEvent:s}=Ke(r),o=e.status==="uploading",{$t:a}=J(),{fileRepoInfo:i}=Vx({reason:n}),{saveFile:c,isLoading:u}=y_e({fileRepoInfo:i,reason:n}),{data:f}=Lz({fileRepoInfo:i,fileName:e.file.name,reason:n}),m=Object.values(vo),p=hu(e.file.name),g=p&&!Tr(e.file.name)&&m.includes(p)&&x2e(e.nextURL),y=i.file_repository_type==="COLLECTION"&&!o&&g,x=d.useMemo(()=>a(f?{defaultMessage:"File exists in Space",id:"pD1m2AH9FU"}:{defaultMessage:"Save attachment to Space",id:"/Pbth8CiTs"}),[f,a]),v=d.useMemo(()=>sY(e)?B("photo"):RNe(e)?B("pdf"):DNe(e)?B("file-spreadsheet"):jNe(e)?B("file-text"):B("file"),[e]),b=d.useCallback(()=>{s("remove attachment clicked"),e.nextURL&&t?.(e.nextURL,e.file_uuid??"")},[s,e,t]),_=d.useCallback(()=>c(e),[c,e]);return l.jsxs("div",{className:z("scroll-mx-md px-sm py-xs border-subtlest bg-subtler dark:bg-subtle gap-x-md flex h-[48px] w-fit snap-start items-center justify-between rounded-lg",{"opacity-70":o}),children:[l.jsxs("div",{className:"gap-x-md flex items-center",children:[e.thumbnailSource&&!o?l.jsx($o,{alt:e.file.name,src:e.thumbnailSource,containerClassName:"size-8 shrink-0",imageClassName:"w-full h-full object-cover object-center",rounded:"md",includeLightBoxModal:!1}):l.jsx("div",{className:"bg-subtle dark:bg-subtler flex size-8 items-center justify-center rounded-lg","data-testid":o?"file-loading-icon":"file-type-icon",children:l.jsx(ge,{icon:o?B("loader-2"):v,size:"sm",color:"#64645F",className:o?"animate-spin":void 0})}),l.jsxs("div",{className:"flex-col",children:[l.jsx(V,{variant:"tiny",color:"light",className:"text-nowrap",children:NNe(e.file.name,30)}),e.file.size>0&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"text-nowrap",children:INe(e.file.size)})]})]}),l.jsxs("div",{className:"gap-x-sm flex items-center",children:[y&&l.jsx(rt,{icon:B("device-floppy"),size:"tiny",onClick:_,disabled:f||u,variant:"common",toolTip:x,isLoading:u,pill:!0,noPadding:!0}),e.nextURL&&l.jsx(rt,{icon:B("x"),size:"tiny",testId:"remove-uploaded-file",onClick:b,variant:"common",pill:!0,noPadding:!0})]})]})});lY.displayName="UploadedFilePreview";const ONe=new Set(["super","textColor","max","orange"]),LNe=new Set(["red"]),FNe=e=>ONe.has(e)?"defaultInverted":LNe.has(e)?"white":e==="maxBorder"?"max":e==="superBorder"?"super":"default",cY=T.memo(({text:e,variant:t="super",boxProps:n,textProps:r})=>{const s=FNe(t);return l.jsx(K,{variant:t,...n,className:z("px-xs rounded-badge -mt-px box-border inline-flex",n?.className),children:l.jsx(V,{variant:"tiny",className:"leading-4",color:s,inline:!0,...r,children:e})})});cY.displayName="Badge";const nl=T.memo(({children:e,orientation:t="vertical",showScrollIndicator:n=!0,thumbClassName:r="",className:s,viewportRef:o,viewportClassName:a,showIndicatorOnHover:i=!0,onScroll:c})=>{const f="before:content-[''] before:absolute before:top-[50%] before:left-[50%] before:translate-x-[-50%] before:translate-y-[-50%] before:w-[100%] before:h-[100%] before:min-w-[10px] before:min-h-[10px]"+" rounded-full bg-subtle duration-quick relative",m=z("flex flex-col p-px duration-150",{"data-[state=visible]:opacity-100":n,"pointer-events-none":!n,"opacity-0":i,"opacity-100":!i});return l.jsxs(T$,{className:z("w-full overflow-hidden",s),children:[l.jsx(A$,{className:z("size-full",a),ref:o,onScroll:c,children:e}),["vertical","both"].includes(t)&&l.jsx(P3,{forceMount:!0,orientation:"vertical",className:m,children:l.jsx(O3,{className:`!w-[5px] ${f} ${r}`})}),["horizontal","both"].includes(t)&&l.jsx(P3,{forceMount:!0,orientation:"horizontal",className:m,children:l.jsx(O3,{className:`!h-[5px] ${f} ${r}`})})]})}),BNe=T.memo(({scrollRef:e,buttonProps:t,children:n,className:r})=>{const s=d.useCallback(()=>{e.current?.scrollTo({left:e.current?.scrollLeft-e.current?.scrollWidth/3,behavior:"smooth"})},[e]),o=d.useCallback(()=>{e.current?.scrollTo({left:e.current?.scrollLeft+e.current?.scrollWidth/3,behavior:"smooth"})},[e]);return l.jsxs(K,{className:r,children:[l.jsx(rt,{pill:!0,icon:B("chevron-left"),onClick:s,...t}),n,l.jsx(rt,{pill:!0,icon:B("chevron-right"),onClick:o,...t})]})});BNe.displayName="ScrollAreaArrows";nl.displayName="ScrollArea";const yh=T.memo(({items:e,grid:t,cols:n=1,disableScrollArea:r=!1,disableHoverStyles:s=!1})=>{const o=d.useMemo(()=>t&&n>1?{display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:"1px"}:void 0,[t,n]),a=({children:i})=>o?l.jsx("div",{role:"menu",style:o,children:i}):r?l.jsx("div",{role:"menu",className:"p-xs flex flex-col gap-px",children:i}):l.jsx(nl,{showIndicatorOnHover:!1,className:"p-xs",children:l.jsx("div",{role:"menu",className:"flex flex-col gap-px",children:i})});return l.jsx(a,{children:e.map((i,c)=>i.type==="separator"?l.jsx(Rc,{...i},c):l.jsx(Rc,{disableHoverStyles:s,...i},c))})});yh.displayName="Menu";var UNe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],aE=UNe.join(","),uY=typeof Element>"u",xh=uY?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,h2=!uY&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},g2=function e(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",a=o||n&&t&&e(t.parentNode);return a},VNe=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},HNe=function(t,n,r){if(g2(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(aE));return n&&xh.call(t,aE)&&s.unshift(t),s=s.filter(r),s},zNe=function e(t,n,r){for(var s=[],o=Array.from(t);o.length;){var a=o.shift();if(!g2(a,!1))if(a.tagName==="SLOT"){var i=a.assignedElements(),c=i.length?i:a.children,u=e(c,!0,r);r.flatten?s.push.apply(s,u):s.push({scopeParent:a,candidates:u})}else{var f=xh.call(a,aE);f&&r.filter(a)&&(n||!t.includes(a))&&s.push(a);var m=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!g2(m,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(m&&p){var h=e(m===!0?a.children:m.children,!0,r);r.flatten?s.push.apply(s,h):s.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return s},dY=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fY=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||VNe(t))&&!dY(t)?0:t.tabIndex},WNe=function(t,n){var r=fY(t);return r<0&&n&&!dY(t)?0:r},GNe=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},mY=function(t){return t.tagName==="INPUT"},$Ne=function(t){return mY(t)&&t.type==="hidden"},qNe=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},KNe=function(t,n){for(var r=0;rsummary:first-of-type"),a=o?t.parentElement:t;if(xh.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof s=="function"){for(var i=t;t;){var c=t.parentElement,u=h2(t);if(c&&!c.shadowRoot&&s(c)===!0)return ij(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=i}if(ZNe(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ij(t);return!1},e8e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},r8e=function e(t){var n=[],r=[];return t.forEach(function(s,o){var a=!!s.scopeParent,i=a?s.scopeParent:s,c=WNe(i,a),u=a?e(s.candidates):i;c===0?a?n.push.apply(n,u):n.push(i):r.push({documentOrder:o,tabIndex:c,item:s,isScope:a,content:u})}),r.sort(GNe).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},pY=function(t,n){n=n||{};var r;return n.getShadowRoot?r=zNe([t],n.includeContainer,{filter:lj.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:n8e}):r=HNe(t,n.includeContainer,lj.bind(null,n)),r8e(r)};function s8e(){return/apple/i.test(navigator.vendor)}function o8e(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function a8e(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&$me(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wA(e){return e?.ownerDocument||document}var i8e=typeof document<"u",l8e=function(){},Nl=i8e?d.useLayoutEffect:l8e;const c8e={...HU},u8e=c8e.useInsertionEffect,d8e=u8e||(e=>e());function f8e(e){const t=d.useRef(()=>{});return d8e(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gY(e,t){const n=pY(e,hY()),r=n.length;if(r===0)return;const s=o8e(wA(e)),o=n.indexOf(s),a=o===-1?t===1?0:r-1:o+t;return n[a]}function m8e(e){return gY(wA(e).body,1)||e}function p8e(e){return gY(wA(e).body,-1)||e}function cw(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!a8e(n,r)}function h8e(e){pY(e,hY()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function cj(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const g8e={...HU};let uj=!1,y8e=0;const dj=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+y8e++;function x8e(){const[e,t]=d.useState(()=>uj?dj():void 0);return Nl(()=>{e==null&&t(dj())},[]),d.useEffect(()=>{uj=!0},[]),e}const v8e=g8e.useId,CA=v8e||x8e,b8e=d.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:s},middlewareData:{arrow:o,shift:a}},width:i=14,height:c=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:m,stroke:p,d:h,style:{transform:g,...y}={},...x}=t,v=CA(),[b,_]=d.useState(!1);if(Nl(()=>{if(!s)return;Kme(s).direction==="rtl"&&_(!0)},[s]),!s)return null;const[w,S]=r.split("-"),C=w==="top"||w==="bottom";let E=m;(C&&a!=null&&a.x||!C&&a!=null&&a.y)&&(E=null);const N=f*2,k=N/2,I=i/2*(u/-8+1),M=c/2*u/4,A=!!h,D=E&&S==="end"?"bottom":"top";let P=E&&S==="end"?"right":"left";E&&b&&(P=S==="end"?"left":"right");const F=o?.x!=null?E||o.x:"",R=o?.y!=null?E||o.y:"",j=h||"M0,0"+(" H"+i)+(" L"+(i-I)+","+(c-M))+(" Q"+i/2+","+c+" "+I+","+(c-M))+" Z",L={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[w];return l.jsxs("svg",{...x,"aria-hidden":!0,ref:n,width:A?i:i+N,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[P]:F,[D]:R,[w]:C||A?"100%":"calc(100% - "+N/2+"px)",transform:[L,g].filter(U=>!!U).join(" "),...y},children:[N>0&&l.jsx("path",{clipPath:"url(#"+v+")",fill:"none",stroke:p,strokeWidth:N+(h?0:1),d:j}),l.jsx("path",{stroke:N&&!h?x.fill:"none",d:j}),l.jsx("clipPath",{id:v,children:l.jsx("rect",{x:-k,y:k*(A?-1:1),width:i+N,height:i})})]})});function _8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const w8e=d.createContext(null),C8e=d.createContext(null),S8e=()=>{var e;return((e=d.useContext(w8e))==null?void 0:e.id)||null},E8e=()=>d.useContext(C8e);function yY(e){return"data-floating-ui-"+e}const xY={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},fj=d.forwardRef(function(t,n){const[r,s]=d.useState();Nl(()=>{s8e()&&s("button")},[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[yY("focus-guard")]:"",style:xY};return l.jsx("span",{...t,...o})}),vY=d.createContext(null),mj=yY("portal");function k8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=CA(),s=T8e(),[o,a]=d.useState(null),i=d.useRef(null);return Nl(()=>()=>{o?.remove(),queueMicrotask(()=>{i.current=null})},[o]),Nl(()=>{if(!r||i.current)return;const c=t?document.getElementById(t):null;if(!c)return;const u=document.createElement("div");u.id=r,u.setAttribute(mj,""),c.appendChild(u),i.current=u,a(u)},[t,r]),Nl(()=>{if(n===null||!r||i.current)return;let c=n||s?.portalNode;c&&!Yme(c)&&(c=c.current),c=c||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,c.appendChild(u));const f=document.createElement("div");f.id=r,f.setAttribute(mj,""),c=u||c,c.appendChild(f),i.current=f,a(f)},[t,n,r,s]),o}function M8e(e){const{children:t,id:n,root:r,preserveTabOrder:s=!0}=e,o=k8e({id:n,root:r}),[a,i]=d.useState(null),c=d.useRef(null),u=d.useRef(null),f=d.useRef(null),m=d.useRef(null),p=a?.modal,h=a?.open,g=!!a&&!a.modal&&a.open&&s&&!!(r||o);return d.useEffect(()=>{if(!o||!s||p)return;function y(x){o&&cw(x)&&(x.type==="focusin"?cj:h8e)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,s,p]),d.useEffect(()=>{o&&(h||cj(o))},[h,o]),l.jsxs(vY.Provider,{value:d.useMemo(()=>({preserveTabOrder:s,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:m,portalNode:o,setFocusManagerState:i}),[s,o]),children:[g&&o&&l.jsx(fj,{"data-type":"outside",ref:c,onFocus:y=>{if(cw(y,o)){var x;(x=f.current)==null||x.focus()}else{const v=a?a.domReference:null,b=p8e(v);b?.focus()}}}),g&&o&&l.jsx("span",{"aria-owns":o.id,style:xY}),o&&qh.createPortal(t,o),g&&o&&l.jsx(fj,{"data-type":"outside",ref:u,onFocus:y=>{if(cw(y,o)){var x;(x=m.current)==null||x.focus()}else{const v=a?a.domReference:null,b=m8e(v);b?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const T8e=()=>d.useContext(vY);function A8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=CA(),o=d.useRef({}),[a]=d.useState(()=>_8e()),i=S8e()!=null,[c,u]=d.useState(r.reference),f=f8e((h,g,y)=>{o.current.openEvent=h?g:void 0,a.emit("openchange",{open:h,event:g,reason:y,nested:i}),n?.(h,g,y)}),m=d.useMemo(()=>({setPositionReference:u}),[]),p=d.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return d.useMemo(()=>({dataRef:o,open:t,onOpenChange:f,elements:p,events:a,floatingId:s,refs:m}),[t,f,p,a,s,m])}function bY(e){e===void 0&&(e={});const{nodeId:t}=e,n=A8e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[o,a]=d.useState(null),[i,c]=d.useState(null),f=s?.domReference||o,m=d.useRef(null),p=E8e();Nl(()=>{f&&(m.current=f)},[f]);const h=qme({...e,elements:{...s,...i&&{reference:i}}}),g=d.useCallback(_=>{const w=D0(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;c(w),h.refs.setReference(w)},[h.refs]),y=d.useCallback(_=>{(D0(_)||_===null)&&(m.current=_,a(_)),(D0(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!D0(_))&&h.refs.setReference(_)},[h.refs]),x=d.useMemo(()=>({...h.refs,setReference:y,setPositionReference:g,domReference:m}),[h.refs,y,g]),v=d.useMemo(()=>({...h.elements,domReference:f}),[h.elements,f]),b=d.useMemo(()=>({...h,...r,refs:x,elements:v,nodeId:t}),[h,x,v,t,r]);return Nl(()=>{r.dataRef.current.floatingContext=b;const _=p?.nodesRef.current.find(w=>w.id===t);_&&(_.context=b)}),d.useMemo(()=>({...h,context:b,refs:x,elements:v}),[h,x,v,b])}class N8e{static detectOverflowOptions={padding:8};static offsetMiddleware=xM({mainAxis:4,crossAxis:0});static shiftMiddleware=YU({limiter:Qme(),...this.detectOverflowOptions});static flipMiddleware=QU(this.detectOverflowOptions);static sizeMiddleware(t={matchTargetWidth:!1},n=!0){return XU({...this.detectOverflowOptions,apply({availableHeight:r,rects:s,elements:o}){n&&(o.floating.style.maxHeight=`${r}px`),(t.matchTargetWidth??!0)&&(o.floating.style.width=`${s.reference.width}px`)}})}static defaultMiddleWare(t={avoidCollisions:!0,matchTargetWidth:!1}){const n=t.avoidCollisions??!0,r=t.avoidPositionCollisions!==void 0?t.avoidPositionCollisions:n,s=t.avoidSizeCollisions!==void 0?t.avoidSizeCollisions:n;return[this.offsetMiddleware,r&&this.shiftMiddleware,r&&this.flipMiddleware,this.sizeMiddleware({matchTargetWidth:t.matchTargetWidth},s)].filter(Boolean)}}const R8e=130,zf=T.memo(({content:e,contentClassName:t="",children:n,delayTime:r=200,isOpen:s,hoverOpen:o,hoverOpenDelay:a=0,placement:i="bottom-end",matchTargetWidth:c=!1,childrenClassName:u,testId:f,overlayProps:m,onOpen:p,onClose:h,disableAnimation:g,hasInteractiveContent:y=!1,avoidCollisions:x=!0,avoidPositionCollisions:v,avoidSizeCollisions:b,customFloatingUIOptions:_,disableShadow:w,floatingElementProps:S,arrowClassName:C,borderRadius:E="rounded-xl",sideOffset:N=4,forceDarkMode:k=!1,onContentMouseEnter:I,onContentMouseLeave:M})=>{const A=d.useRef(null),D=d.useRef(null),P=d.useMemo(()=>{const we=N8e.defaultMiddleWare({avoidCollisions:x,avoidPositionCollisions:v,avoidSizeCollisions:b,matchTargetWidth:c});return N!==4&&(we[0]=xM({mainAxis:N,crossAxis:0})),C&&we.push(Xme({element:A})),we},[x,v,b,c,C,N]),{refs:F,floatingStyles:R,placement:j,context:L}=bY({strategy:"fixed",placement:i,middleware:P,whileElementsMounted:(...we)=>ZU(...we),..._}),[U,O]=d.useState(!1),$=d.useRef(U),[G,H]=d.useState(!1),Q=d.useRef(G),[Y,te]=d.useState(!1),se=s!==void 0,[ae,X]=d.useState(!1),ee=d.useMemo(()=>se?s:ae,[se,s,ae]),le=d.useCallback(we=>{we.stopPropagation()},[]),re=d.useCallback(()=>{ee||(p?.(),se||X(!0))},[se,ee,p]),ce=d.useCallback(()=>{te(we=>ee&&!we?(h?.(),se||X(!1),g?!1:(setTimeout(()=>{te(!1)},R8e),!0)):we)},[se,ee,h,g]),ue=d.useCallback(()=>{ee?ce():re()},[ce,re,ee]),pe=d.useCallback(()=>{setTimeout(()=>{!Q.current&&!$.current&&ce()},r)},[r,ce,Q,$]),xe=d.useCallback(()=>{setTimeout(()=>{if(se&&h){h();return}ce()},0)},[se,h,ce]),he=d.useCallback(()=>{$.current=!0,O(!0),D.current&&(clearTimeout(D.current),D.current=null),a>0?D.current=setTimeout(()=>{re()},a):re()},[re,a]),_e=d.useCallback(()=>{$.current=!1,O(!1),D.current&&(clearTimeout(D.current),D.current=null),pe()},[pe]),ke=d.useCallback(()=>{o&&(Q.current=!0,H(!0)),I?.()},[o,I]),De=d.useCallback(()=>{o&&(Q.current=!1,H(!1),pe()),M?.()},[o,pe,M]),Ce=d.useCallback(we=>{we.stopPropagation(),ue()},[ue]),Be=d.useMemo(()=>({transform:"translateY(-1px)"}),[]);return d.useEffect(()=>()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),l.jsxs(l.Fragment,{children:[l.jsx("span",{onMouseEnter:o?he:void 0,onMouseLeave:o?_e:void 0,onPointerEnter:o?he:void 0,onPointerLeave:o?_e:void 0,ref:F.setReference,onMouseDown:le,onClick:o?void 0:Ce,className:u,"data-test-id":f,children:n}),e?l.jsx(xA,{isOpen:ee||Y,onClose:xe,transparent:!0,childVariant:"clean",disableAnimation:g,delayClose:!1,...m,children:l.jsx("div",{className:"absolute inset-x-0 top-0","data-color-scheme":k?"dark":void 0,children:l.jsx("div",{className:"flex",ref:F.setFloating,onMouseEnter:ke,onMouseLeave:De,onPointerEnter:ke,onPointerLeave:De,onClick:we=>{y&&we.stopPropagation()},style:R,...S,children:l.jsxs(K,{variant:"background",className:z({"shadow-overlay":!w},"flex min-h-0 min-w-0","data-[placement=bottom-end]:origin-top-right data-[placement=bottom-start]:origin-top-left data-[placement=top-end]:origin-bottom-right data-[placement=top-start]:origin-bottom-left",{"duration-150":!g,"animate-out fade-out zoom-out-[0.97] ease-in":Y&&!g,"p-xs animate-in fade-in zoom-in-[0.97] ease-out":!g},t,E),"data-placement":j,children:[e,C&&l.jsx(b8e,{ref:A,context:L,className:C,style:Be})]})})})}):null]})});zf.displayName="Popover";const Ws=T.memo(({isOpen:e,hoverOpen:t=!1,children:n,items:r,placement:s,disabled:o=!1,grid:a,onOpen:i,title:c,onClose:u,isMobileStyle:f,boxProps:m,modalProps:p,popoverProps:h,cols:g=1,footer:y=null,contentClassName:x="",wrapperClassName:v,header:b,preMenuContent:_,alwaysShowChildren:w,size:S,showFooterOnMobile:C=!1,isMax:E=!1})=>{const[N,k]=d.useState(!1),I=e!==void 0,M=I?e:N,A=d.useCallback(()=>{if(!M&&!o){const j=i?.()??!0;!I&&j&&k(!0)}},[o,I,i,M]),D=d.useCallback(()=>{M&&!o&&(u?.(),I||k(!1))},[o,I,u,M]),P=d.useMemo(()=>r.map(j=>({...j,size:S??(f?Gt.regular:void 0),onClick:L=>{!o&&"onClick"in j&&(j.onClick?.(L),j.type==="toggle"||j.type==="multiSelect"||D())}})),[o,D,r,S,f]),F=d.useMemo(()=>{const{className:j,...L}=m||{};return l.jsx(K,{className:z("flex max-h-[80vh] min-h-0 min-w-[160px] flex-col",{"max-w-[250px]":!a,"gap-two grid max-w-lg":a,"max-super-override":E},j),...L,children:l.jsxs("div",{className:"flex h-full flex-col",children:[b&&l.jsx(K,{className:"mb-sm mx-sm flex-shrink-0 border-b",children:b}),c&&l.jsx(K,{className:"mb-sm mx-sm flex-shrink-0 border-b",children:l.jsx(V,{variant:"smallBold",className:"py-sm mb-1",children:c})}),l.jsxs(nl,{orientation:"vertical",showIndicatorOnHover:!1,className:"min-h-0 flex-1 overflow-auto",children:[_,l.jsx(yh,{items:P,grid:a,cols:g,disableScrollArea:!0}),y]})]})})},[m,g,y,a,b,P,c,_,E]);return r.every(j=>j.show===!1)?w?n:null:f?l.jsxs(l.Fragment,{children:[l.jsx(po,{variant:"bottom-left-sheet",actionList:Ie,isOpen:M,onClose:D,footerContent:C&&y?y:void 0,footerClassname:C&&y?"!pt-0 pb-5 sticky bottom-0":void 0,wrapperClassname:C&&y?"!pb-0":void 0,...p,children:l.jsx(K,{className:z("divide-y",{"max-super-override":E}),children:l.jsx(yh,{items:P,grid:a})})}),l.jsx("span",{className:v,onClick:t?void 0:j=>{j.stopPropagation(),A()},children:n})]}):l.jsx(zf,{...h,hoverOpen:t,isOpen:M,placement:s,onClose:D,onOpen:A,contentClassName:x,childrenClassName:v,content:F,hasInteractiveContent:!0,children:n})});Ws.displayName="DropDownMenu";const Wf=T.memo(({children:e,className:t,disabled:n,onClick:r,onMouseDown:s,onMouseEnter:o,onMouseMove:a,testId:i,rounded:c,href:u,focused:f,disableHoverStyles:m=!1,target:p="_blank",tooltipText:h,tooltipLayout:g="right",tooltipDelayDuration:y,active:x=!1,role:v="menuitem"})=>{const b=d.useRef(null),_=ci(),w=l.jsx("div",{className:z("duration-quick relative select-none rounded-lg transition-all","px-sm py-1.5 md:h-full",{"hover:bg-subtler cursor-pointer":!n&&!m,"cursor-pointer":!n&&m,rounded:c,"bg-subtler":f}),children:e}),S=z("group/item md:h-full",t);d.useEffect(()=>{b.current&&f&&b.current.scrollIntoView({behavior:"instant",block:"nearest"})},[f]);const C=v==="menuitemradio"||v==="menuitemcheckbox"?x?"true":"false":void 0;return u&&!n?l.jsx(xt,{href:u,target:p,className:S,onClick:r,"data-testid":i,children:w}):l.jsx(Oo,{tooltipText:h,showTooltip:!_&&!!h,tooltipLayout:g,delayDuration:y,offset:12,asChild:!0,children:l.jsx("div",{role:v,"aria-checked":C,ref:b,"data-testid":i,className:S,onClick:n?void 0:r,onMouseDown:n?void 0:s,onMouseEnter:n?void 0:o,onMouseMove:n?void 0:a,children:w})})});Wf.displayName="MenuItemWrapper";const D8e=({icon:e,avatar:t,destructive:n})=>{if(t)return t;if(!e)return null;const r=z({"!text-caution":n},"opacity-90");return l.jsx(ge,{icon:e,className:r,size:"sm"})},j8e=/\bgap(-[xy])?-/,I8e={[Gt.small]:"extraSmall",[Gt.tiny]:"tiny"},Gf=T.memo(({customDescriptionNode:e,customTextNode:t,text:n,description:r,icon:s,avatar:o,label:a,badge:i,link:c,onLinkClick:u,size:f=Gt.small,color:m="default",badgeVariant:p="super",destructive:h,leftElement:g,rightElement:y,bottomElement:x,textTrailingElement:v,className:b="",preserveLeftIconSpace:_=!1,textClassName:w})=>{const S=s||o;return l.jsxs("div",{className:z("flex",b,j8e.test(b)?"":"gap-sm"),children:[(S||_)&&l.jsx("div",{className:"flex",children:l.jsx(V,{color:m,className:z("flex size-5 justify-center leading-none",{"-mt-one":o}),children:!_||S?l.jsx(D8e,{icon:s,avatar:o,destructive:h}):null})}),g,l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[t||l.jsxs(V,{variant:I8e[f]??"baseSemi",color:m,className:z("flex items-center gap-x-1.5",{"!text-caution":h}),children:[l.jsx("span",{className:w,children:n}),v,i&&l.jsx(cY,{text:i,variant:p})]}),e||r&&l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:r}),c&&l.jsx(V,{variant:"tinyRegular",color:"super",onClick:u,children:c}),x]}),a&&l.jsx(V,{className:"mt-one whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:a})]}),y]})});Gf.displayName="BaseMenuItem";const SA=T.memo(e=>{const{active:t,show:n=!0,className:r,rounded:s,color:o="default",activeColor:a="super",badgeVariant:i="super",disabled:c,href:u,onClick:f,onMouseDown:m,onMouseEnter:p,onMouseMove:h,testId:g,rightElement:y,focused:x,preserveRightElementSpace:v=!0,disableHoverStyles:b=!1,target:_,tooltipText:w,tooltipLayout:S,tooltipDelayDuration:C,role:E}=e;if(!n)return null;let N=o;c?N="ultraLight":t&&(N=a);const k=y??l.jsx(V,{color:N,className:"size-5",children:l.jsx(ft,{name:B("check"),size:hl.sm,className:t?"opacity-100":"opacity-0","aria-hidden":!t})});return l.jsx(Wf,{className:r,disabled:c,onClick:f,onMouseDown:m,onMouseEnter:p,onMouseMove:h,testId:g,rounded:s,href:u,focused:x,disableHoverStyles:b,target:_,tooltipText:w,tooltipLayout:S,tooltipDelayDuration:C,role:E,active:t,children:l.jsx(Gf,{...e,color:N,badgeVariant:i,rightElement:v?k:y})})});SA.displayName="DefaultMenuItem";const _Y=T.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,selected:f,active:m,disableHoverStyles:p=!1,tooltipText:h,tooltipLayout:g,tooltipDelayDuration:y,iconVariant:x="checkbox",disableActiveStyles:v=!1}=e;let b=r;s?b="ultraLight":(m||f)&&!v&&(b="super");const _=d.useMemo(()=>x==="check"?l.jsx(V,{color:f&&!v?"super":b,className:"size-5",children:l.jsx(ft,{name:B("check"),size:hl.sm,className:f?"opacity-100":"opacity-0","aria-hidden":!f})}):l.jsx(V,{color:f&&!v?"super":b,children:l.jsx(Jt,{icon:f?B("square-check"):B("square"),size:"small"})}),[b,f,x,v]);return l.jsx(Wf,{className:t,disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,rounded:n,disableHoverStyles:p,tooltipText:h,tooltipLayout:g,tooltipDelayDuration:y,children:l.jsx(Gf,{...e,color:b,rightElement:_})})});_Y.displayName="MultiSelectMenuItem";const EA=T.memo(e=>{const{className:t,rounded:n,color:r="default",activeColor:s="super",switchVariant:o="super",disabled:a,onClick:i,onMouseDown:c,onMouseEnter:u,onMouseMove:f,testId:m,selected:p,active:h,rightElement:g,disableHoverStyles:y=!1,tooltipText:x,tooltipLayout:v,tooltipDelayDuration:b}=e,{$t:_}=J();let w=r;a?w="ultraLight":(h||p)&&(w=s);const S=d.useMemo(()=>l.jsxs("div",{className:z("gap-x-sm flex items-start pt-0.5",{"max-super-override":o==="max"}),children:[g,l.jsx(gg,{checked:p,onCheckedChange:Ro,disabled:a,size:"small","aria-label":x||_({defaultMessage:"Toggle option",id:"z+oW4dt4hh"})})]}),[_,a,g,p,o,x]);return l.jsx(Wf,{className:t,disabled:a,onClick:i,onMouseDown:c,onMouseEnter:u,onMouseMove:f,testId:m,rounded:n,disableHoverStyles:y,tooltipText:x,tooltipLayout:v,tooltipDelayDuration:b,children:l.jsx(Gf,{...e,color:w,rightElement:S})})});EA.displayName="ToggleMenuItem";const wY=T.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,selected:f,active:m,showIconLeft:p=!1,disableHoverStyles:h=!1,tooltipText:g,tooltipLayout:y,tooltipDelayDuration:x}=e;let v=r;(m||f)&&(v="super");const b=l.jsx(V,{color:f?v:"ultraLight",className:z("flex pt-0.5 leading-none",{"opacity-50":s}),children:l.jsx(Jt,{icon:f?B("circle-filled"):B("circle"),size:"small"})});return l.jsx(Wf,{className:t,disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,rounded:n,disableHoverStyles:h,tooltipText:g,tooltipLayout:y,tooltipDelayDuration:x,children:l.jsx(Gf,{...e,rightElement:p?void 0:b,leftElement:p?b:void 0})})});wY.displayName="RadioMenuItem";const CY=T.memo(e=>{const{text:t,show:n,className:r}=e;return n?l.jsxs(l.Fragment,{children:[l.jsx(K,{className:z("sm:mx-sm my-sm border-b first:hidden",r)}),t&&l.jsx(K,{variant:"background",className:"sm:mx-sm mt-xs mb-sm pr-sm",children:l.jsx(V,{className:"w-max",variant:"tinyMono",color:"light",children:t})})]}):null});CY.displayName="MenuItemSeparator";const SY=T.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onMouseDown:o,onMouseEnter:a,onMouseMove:i,testId:c,submenu:u,active:f,disableHoverStyles:m=!1,isSubmenuOpen:p,onSubmenuOpen:h,onSubmenuClose:g,menuWidth:y="200px",isMax:x=!1}=e;let v=r;s?v="ultraLight":f&&(v="super");const b=d.useMemo(()=>l.jsx(V,{color:"light",children:l.jsx(Jt,{icon:B("chevron-right"),size:"small"})}),[]),_=d.useMemo(()=>({className:"min-w-0",style:{width:y}}),[y]),w=d.useMemo(()=>({hasInteractiveContent:!0}),[]);return l.jsx(Ws,{isOpen:p,items:u,placement:"right-end",onOpen:h,onClose:g,isMobileStyle:!1,hoverOpen:!0,boxProps:_,popoverProps:w,isMax:x,children:l.jsx(Wf,{className:t,disabled:s,onMouseDown:o,onMouseEnter:a,onMouseMove:i,testId:c,rounded:n,disableHoverStyles:m,children:l.jsx(Gf,{...e,color:v,rightElement:b})})})});SY.displayName="NestedMenuItem";const Rc=T.memo(e=>{switch(e.type){case"default":{const{type:t,...n}=e;return l.jsx(SA,{...n,role:n.role||"menuitem"})}case"multiSelect":{const{type:t,...n}=e;return l.jsx(_Y,{...n,role:"menuitemcheckbox"})}case"toggle":{const{type:t,...n}=e;return l.jsx(EA,{...n,role:"menuitemcheckbox"})}case"radio":{const{type:t,...n}=e;return l.jsx(wY,{...n,role:"menuitemradio"})}case"separator":{const{type:t,...n}=e;return l.jsx(CY,{...n})}case"nested":{const{type:t,...n}=e;return l.jsx(SY,{...n})}case"custom":return l.jsx(l.Fragment,{children:e.children})}});Rc.displayName="MenuItem";const EY=e=>e.map((t,n)=>{switch(t.type){case"default":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(_t.Item,{onSelect:s,leadingAccessory:r,trailingAccessory:t.rightElement,disabled:t.disabled,children:t.text},n)}case"separator":return l.jsx(_t.Separator,{},n);case"nested":{const r=t.avatar?()=>t.avatar:t.icon;return l.jsx(_t.Submenu,{triggerElement:l.jsx(_t.SubmenuItem,{leadingAccessory:r,disabled:t.disabled,children:t.text}),children:EY(t.submenu)},n)}case"multiSelect":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(_t.CheckboxItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"toggle":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(_t.SwitchItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"radio":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(_t.CheckboxItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"custom":return l.jsx(T.Fragment,{children:t.children},n);default:Ft(t)}}),kY=T.memo(({children:e,isOpen:t,onOpen:n,onClose:r,connectorMenuItems:s})=>{const o=d.useCallback(a=>{a?n():r()},[n,r]);return s.length<=1?e:l.jsx(_t,{triggerElement:e,isOpen:t,onToggle:o,children:EY(s)})});kY.displayName="AttachmentSelector";const kA="/account",hbt=()=>`${kA}/details`,P8e=()=>kA,O8e=({mode:e})=>{const t=Ln(),n=iu(),r=d.useMemo(()=>t?.startsWith("/collections")||t?.startsWith("/spaces")?"space":t?.startsWith("/search")?"thread":t?.startsWith("/settings")?null:"ask",[t]),s=d.useMemo(()=>n===null?null:t?.startsWith("/collections")||t?.startsWith("/spaces")?n.slug?typeof n.slug=="string"?n.slug:n.slug[0]??null:null:t?.startsWith("/search")?t.split("/").pop()??null:t?.startsWith("/settings")?null:e??null,[t,n,e]),o=P8e(),a=d.useMemo(()=>{const i=`${o}/connectors`,c=new URLSearchParams;if(r){const u=Array.isArray(s)?s[0]:s;c.append("referrer",r),u&&c.append("referrerId",u)}return i+"?"+c.toString()},[r,s,o]);return d.useMemo(()=>({referrer:r,referrerId:s,redirectPath:a}),[a,r,s])},L8e=Se(async()=>{const{MicrosoftFilePickerModal:e}=await Ee(()=>q(()=>import("./MicrosoftFilePickerModal-BXFn4rPd.js"),__vite__mapDeps([140,4,1,6,3,88,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),F8e=Se(async()=>{const{BoxFilePickerModal:e}=await Ee(()=>q(()=>import("./BoxFilePickerModal-EAoF4aIB.js"),__vite__mapDeps([141,4,1,3,8,9,6,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),MA=T.memo(({isOpen:e,fileType:t,tooltip:n,onOpen:r,onClose:s,onFilePickerOpen:o,onFilePickerClose:a,areFileAttachmentsAllowed:i,fileUploadErrorMessage:c,fileUploadWarningMessage:u,activeConnector:f=null,uploadedFiles:m=Ie,handleStartUpload:p,handleFileInput:h,isBoxFilePickerOpen:g=!1,handleCloseBoxFilePicker:y,cleanupBoxFilePicker:x,microsoftFilePickerOptions:v=null,handleCloseMicrosoftFilePicker:b,handleSelectSharepointSite:_,isMicrosoftFilePickerOpen:w=!1,fileInputRef:S,isAudioVideoFilesEnabled:C=!1,setAttachmentErrorMessage:E})=>{const N="file-upload-button",{$t:k}=J(),I=d.useRef(!1),[M,A]=B8e(),D=ci(),P=Vt(),{uploadRateLimit:F}=Fn(),{hasActiveSubscription:R}=Bt(),j=F??(R?AM:TM),L=d.useCallback(we=>we.preventDefault(),[]),{session:U}=je(),{trackEvent:O}=Ke(U),{referrer:$,referrerId:G}=O8e({mode:"file"}),{connectorsMap:H}=Rf({reason:N}),{enabledFileConnectors:Q}=Rz({reason:N}),{disabledFileConnectors:Y}=Dz({reason:N}),te=d.useMemo(()=>H?.onedrive?.connected||H?.sharepoint?.connected,[H?.onedrive?.connected,H?.sharepoint?.connected]),se=d.useCallback(()=>{switch(t){case"image":return k({defaultMessage:"images",id:"HVUWg4/ofn"});case"all":return k({defaultMessage:"files",id:"l17U7PEF+6"});default:return k({defaultMessage:"text or PDF files",id:"XFh9ob267W"})}},[k,t]),ae=d.useCallback(()=>{switch(t){case"image":return Yhe;case"all":return C?ege:Qhe;default:return C?Zhe:bV}},[t,C]),X=d.useCallback(we=>{we?O("attempt connector file attachment",{connectorName:we}):O("opened file selector",{}),p?.(we)},[p,O]),{handleConnect:ee}=iT({reason:N}),[le,re]=d.useState(!1),ce=d.useMemo(()=>{const we={type:"default",text:k({defaultMessage:"Local files",id:"xMmQ4F7z3A"}),size:"small",icon:B("file-upload"),onMouseDown:L,onClick:()=>X("local")},$e=Q.map(yt=>{const me=yt.name;return{type:"default",text:Tc(me)??"",avatar:l.jsx("img",{src:M3(me)??"",alt:Tc(me),width:20,height:20}),onMouseDown:L,onClick:()=>X(me),show:LV.includes(yt.name)}});return Y.length>0&&!D&&$e.push({type:"nested",submenu:Y.map(yt=>({type:"default",size:"small",text:Tc(yt.name),avatar:l.jsx("img",{src:M3(yt.name)??"",alt:Tc(yt.name),width:20,height:20}),rightElement:l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"sm"})}),onClick:()=>ee({connectorName:yt.name,customReferrer:$??void 0,customReferrerId:G??void 0})})),isSubmenuOpen:le,onSubmenuOpen:()=>re(!0),onSubmenuClose:()=>re(!1),text:k({defaultMessage:"Connect files",id:"geEGjFxpOA"}),icon:B("share"),onMouseDown:L}),[we,...$e]},[k,Q,Y,L,X,le,ee,$,G,D]),ue=d.useCallback(()=>{i&&(ce.length<=1||m.length>0?X(f??void 0):r?.())},[ce,m,f,X,r,i]),pe=d.useCallback(()=>{s?.()},[s]),xe=d.useMemo(()=>{if(n)return n;let we=`${k({defaultMessage:"Attach",id:"Ye0Clmvfec"})} ${se()}`;return P?i?j!=null&&j>0&&j<=100?we+=`. ${k({defaultMessage:"{remaining} left today",id:"V9HtlcGCOC"},{remaining:j})}`:hr(zy)&&(we=k({defaultMessage:"Files attached to threads are retained for 7 days",id:"hTclTOMwb7"})):we=k({defaultMessage:"File attachments are disabled by your organization",id:"HmmaBNCmcH"}):we+=`. ${k({defaultMessage:"Sign in to attach files",id:"Ei6nUBg77Q"})}`,we},[k,i,j,se,P,n]);d.useEffect(()=>{const we=()=>{I.current&&(a?.(),I.current=!1)};return window.addEventListener("focus",we),()=>window.removeEventListener("focus",we)},[a]);const he=d.useCallback(()=>b?.(),[b]),_e=d.useCallback(()=>y?.(),[y]),ke=d.useCallback(we=>_?.(we),[_]),De=d.useCallback(()=>x?.(),[x]),Ce=d.useCallback(()=>{E?.("")},[E]),Be=d.useCallback(we=>{ce.length<=1?ue():we.stopPropagation()},[ce.length,ue]);return l.jsxs("div",{className:"flex items-center",children:[l.jsx(kY,{connectorMenuItems:ce,isOpen:e,onOpen:ue,onClose:pe,children:l.jsx(Ct,{variant:"text",size:"small",icon:B("paperclip"),disabled:!i,onClick:Be,"aria-label":xe,tooltipOpen:M||e,tooltipOnOpenChange:A})}),l.jsx("input",{type:"file",multiple:!0,"data-testid":"file-upload-input",onClick:()=>{I.current=!0,o?.()},ref:S,onChange:we=>{I.current=!1,h?.(we.target.files?Array.from(we.target.files):Ie)},accept:ae(),style:{display:"none"}}),te&&w&&l.jsx(L8e,{options:v,isOpen:w,onClose:he,onSelectSite:ke}),H?.box?.connected&&g&&l.jsx(F8e,{isOpen:g,onClose:_e,cleanupPicker:De}),l.jsx(Yc,{isVisible:!!c,variant:"error",message:c??"",handleClose:Ce,timeout:null}),l.jsx(Yc,{isVisible:!!u&&!c,variant:"warning",message:u??"",timeout:4})]})});MA.displayName="FileUploadButton";function B8e(){const{fileUploadUpsellTooltipOpen:e}=Kr(),{setFileUploadUpsellTooltipOpen:t}=Po(),[n,r]=d.useState(!1);return d.useEffect(()=>{e&&r(!0)},[e]),d.useEffect(()=>{n&&t(!1)},[n,t]),d.useMemo(()=>[n,r],[n])}var lr;(function(e){e[e.FOCUS=0]="FOCUS",e[e.SOURCES=1]="SOURCES",e[e.RECENCY=2]="RECENCY",e[e.PRO_MODEL_PREFERENCE=3]="PRO_MODEL_PREFERENCE",e[e.ATTACHMENTS=4]="ATTACHMENTS",e[e.SEARCH_MODEL_SELECTOR=5]="SEARCH_MODEL_SELECTOR",e[e.UNIFIED_SOURCES=6]="UNIFIED_SOURCES",e[e.SIDECAR_ATTACHMENTS=7]="SIDECAR_ATTACHMENTS",e[e.SEARCH_MODEL_MENU=8]="SEARCH_MODEL_MENU"})(lr||(lr={}));function U8e({isSignedIn:e,tooltip:t,onSelect:n}){const{$t:r}=J(),s=l.jsx(_t.Item,{leadingAccessory:B("paperclip"),disabled:!e,onSelect:n,children:r({defaultMessage:"File",id:"gyrIElu9qY"})});return t?l.jsx(Hs,{content:t,side:"right",children:s}):s}function V8e({onSelect:e}){const{$t:t}=J();return l.jsx(_t.Item,{leadingAccessory:B("capture"),onSelect:e,children:t({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})})}function H8e({isFollowUp:e}){const{$t:t}=J(),{forceEnableBrowserAgent:n}=Kr(),{setForceEnableBrowserAgent:r}=Po(),s=d.useCallback(()=>{r(!n)},[n,r]);return e?null:l.jsx(Hs,{content:t({defaultMessage:"Let Comet Assistant navigate and interact with websites",id:"Htf0TtbEpJ"}),side:"right",children:l.jsx(_t.Item,{leadingAccessory:B("click"),onSelect:s,children:t({defaultMessage:"Browse for me",id:"E8hFVZyoUg"})})})}function z8e({isFollowUp:e}){const{$t:t}=J(),{forceEnableBrowserAgent:n}=Kr(),{setForceEnableBrowserAgent:r}=Po(),[s,o]=d.useState(!1),a=d.useCallback(()=>{r(!1)},[r]),i=d.useCallback(()=>{o(!0)},[]),c=d.useCallback(()=>{o(!1)},[]);return!n||e?null:l.jsx("div",{onMouseEnter:i,onMouseLeave:c,children:l.jsx(rt,{text:t({defaultMessage:"Browse for me",id:"E8hFVZyoUg"}),size:"small",variant:"subtle",onClick:a,icon:s?B("x"):B("click")})})}const MY=T.memo(({handleFileInput:e,onFilePickerOpen:t,screenshotToolEnabled:n=!1,isFollowUp:r=!1})=>{const{$t:s}=J(),{sidecarSourceTab:{url:o}}=zn(),a=ln(),i=d.useRef(null),{activeMenu:c}=Kr(),{onActiveMenuChange:u}=Po(),f=Vt(),{uploadRateLimit:m}=Fn(),{hasActiveSubscription:p}=Bt(),h=m??(p?AM:TM);d.useEffect(()=>{if(n)return a.subscribeScreenshotCaptured(C=>{e?.([C],"local")})},[a,e,n]);const g=d.useCallback(()=>{a.captureSourceTabScreenshotV2({sourceTabUrl:o})},[a,o]),y=d.useCallback(()=>{i.current?.click()},[]),x=c===lr.SIDECAR_ATTACHMENTS,v=d.useCallback(()=>{u(lr.SIDECAR_ATTACHMENTS),t?.()},[u,t]),b=d.useCallback(()=>{u(null)},[u]),_=d.useMemo(()=>{if(f){if(h!=null&&h>0&&h<=100)return s({defaultMessage:"{remaining} left today",id:"V9HtlcGCOC"},{remaining:h});if(hr(zy))return s({defaultMessage:"Files are retained for 7 days",id:"HLjpKDpzE3"})}else return s({defaultMessage:"Sign in to attach files",id:"Ei6nUBg77Q"})},[s,f,h]),w=d.useMemo(()=>l.jsx(Ct,{variant:"secondary",size:"small",icon:B("plus"),"aria-label":s({defaultMessage:"Add files or select tools",id:"iTP/u4WRPO"})}),[s]),S=d.useCallback(C=>{C?v():b()},[v,b]);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"hidden",children:l.jsx(MA,{isOpen:!1,fileType:"all",areFileAttachmentsAllowed:!0,handleFileInput:e,onFilePickerOpen:t,fileInputRef:i})}),l.jsxs(_t,{triggerElement:w,align:"start",isOpen:x,onToggle:S,children:[l.jsx(U8e,{isSignedIn:f,tooltip:_,onSelect:y}),n&&l.jsx(V8e,{onSelect:g}),l.jsx(_t.Separator,{}),l.jsx(H8e,{isFollowUp:r})]}),l.jsx(z8e,{isFollowUp:r})]})});MY.displayName="SidecarAttachmentsMenuButton";const TA=T.memo(({className:e,color:t})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:t||"currentColor",viewBox:"0 0 66 24",className:e,children:[l.jsx("path",{d:"M33.569 17.032a1.919 1.919 0 0 1-.799-1.593c0-1.277.935-1.982 2.857-2.157l4.956-.473v.134c0 .784-.127 1.492-.378 2.105a3.958 3.958 0 0 1-1.012 1.456c-.834.753-1.993 1.15-3.354 1.15-.94 0-1.724-.215-2.27-.622Z"}),l.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M60.756 1.398c1.886.991 3.382 2.457 4.443 4.353 1.03 1.813 1.55 3.918 1.55 6.257 0 2.339-.521 4.444-1.55 6.257a10.934 10.934 0 0 1-2.475 3.027l-7.77-9.445 5.845-7.145V3.92h-3.135l-.076.096-4.626 5.837h-.009l-4.626-5.837-.075-.096h-3.136v.782l5.847 7.146-5.847 7.145v.782h3.136l.075-.095 4.626-5.837h.01l7.214 9.087-.017.01c-1.293.703-1.948 1.06-3.755 1.06H.25V1.862C.25.834 1.085 0 2.113 0h52.932c2.063 0 3.985.482 5.711 1.398ZM27.842 19.773V9.272c0-1.69-.55-3.073-1.59-4.002-.954-.851-2.28-1.301-3.834-1.301-1.375 0-2.54.306-3.463.91-.62.407-1.137.946-1.572 1.642a.1.1 0 0 1-.175-.008 4.35 4.35 0 0 0-1.35-1.605c-.864-.624-1.97-.94-3.285-.94-2.436 0-3.62.89-4.327 1.824-.059.077-.181.038-.181-.06V4.32H5.063v15.452h3.09V10.71c0-1.377.358-2.442 1.064-3.166.65-.665 1.597-1.017 2.74-1.017.967 0 1.712.26 2.215.772.488.499.736 1.221.736 2.148v10.326h3.09V10.71c0-1.377.358-2.442 1.063-3.165.65-.666 1.597-1.018 2.74-1.018.967 0 1.712.26 2.215.773.489.498.736 1.221.736 2.148v10.325h3.09Zm15.8 0 .001-10.003c0-1.821-.64-3.32-1.85-4.334-1.146-.96-2.862-1.468-4.72-1.468-1.856 0-3.49.467-4.723 1.35-1.213.87-2.003 2.096-2.254 3.557-.057.331-.04.736-.04.736h3.008l.027-.22c.122-.963.521-1.708 1.185-2.213.669-.51 1.587-.768 2.738-.768s2.038.27 2.636.8c.619.55.933 1.391.933 2.502v.682l-5.356.507c-3.577.344-5.547 1.997-5.547 4.656 0 1.375.564 2.531 1.63 3.346 1.023.781 2.436 1.194 4.088 1.194 1.43 0 2.66-.304 3.656-.903a5.177 5.177 0 0 0 1.408-1.237c.059-.075.179-.033.179.063v1.753h3.002Z"})]}));TA.displayName="MaxBadge";const AA=T.memo(({className:e})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 51 24",className:e,children:[l.jsx("path",{d:"M35.069 7.954c-1.723 1.74-1.706 6.368 0 8.121 1.597 1.799 5.273 1.817 6.855 0 .873-.922 1.315-2.417 1.315-4.075 0-1.66-.442-3.144-1.317-4.048-1.584-1.853-5.256-1.834-6.853.002Z"}),l.jsx("path",{fillRule:"evenodd",d:"m48.958 5.715-.009-.015a10.792 10.792 0 0 0-4.387-4.301l-.01-.006C42.81.47 40.861 0 38.761 0H1.905C.866 0 .002.84 0 1.88V24h3.818V4.359h3.245v1.284c0 .132.161.196.252.1 2.987-3.275 9.077-2.319 11.216 1.723.725 1.234 1.092 2.759 1.092 4.534.102 4.584-3.017 8.265-7.55 8.235-2.031 0-3.629-.79-4.757-1.978a.146.146 0 0 0-.253.1V24h31.7c2.1 0 4.045-.468 5.78-1.39l.011-.005a10.795 10.795 0 0 0 4.394-4.302l.009-.016C49.98 16.483 50.5 14.368 50.5 12s-.52-4.482-1.543-6.285ZM30.112 7.42a24.93 24.93 0 0 1-.86-.003c-1.338-.02-2.845-.041-3.676.819-.549.54-.827 1.468-.827 2.759v8.809h-3.243V4.359h3.243v1.284c0 .148.194.202.271.077.314-.506.65-.852 1.012-1.05.616-.353 1.462-.532 2.514-.532h1.566V7.42Zm8.399 12.814c-4.77.033-8.068-3.395-7.973-8.235 0-1.716.348-3.21 1.033-4.442 2.714-5.062 11.157-5.068 13.852-.002.704 1.234 1.06 2.729 1.06 4.444.08 4.807-3.207 8.268-7.972 8.235Z",clipRule:"evenodd"}),l.jsx("path",{d:"M16.378 12c0 1.657-.442 3.153-1.314 4.075-1.583 1.816-5.26 1.798-6.857 0-1.706-1.753-1.722-6.381 0-8.121 1.597-1.836 5.27-1.855 6.854-.003.875.904 1.317 2.39 1.317 4.049Z"})]}));AA.displayName="ProBadge";const py=T.memo(({isMax:e,className:t})=>e?l.jsx("div",{style:{"--mode-color":"oklch(var(--max-color))"},children:l.jsx(TA,{className:`text-max ${t||""}`})}):l.jsx("div",{style:{"--mode-color":"oklch(var(--super-color))"},children:l.jsx(AA,{className:`text-super ${t||""}`})}));py.displayName="SearchModeBadge";function $f(){const{isMax:e,isPro:t}=Bt(),{isMaxUpsellEnabled:n}=Gx(),{gpt4Limit:r,pplxAlphaLimit:s,pplxBetaLimit:o}=Fn();return d.useMemo(()=>i=>{let c=!1;return i===oe.RESEARCH?c=!r.available||!s.available:c=!r.available||!o.available,n&&!e&&t&&c&&(i===oe.RESEARCH||i===oe.STUDIO)},[n,e,t,r,s,o])}function gv(){const{gpt4Limit:e,pplxAlphaLimit:t,pplxBetaLimit:n}=Fn(),{specialCapabilities:r}=Qr(),s=Vt(),{hasAccessToProFeatures:o,isMax:a}=Bt(),i=$f(),{results:c}=an(),u=!r.unlimitedProSearch&&!e.available&&!o,f=!r.unlimitedResearch&&(!e.available||!t.available),m=!e.available||!n.available,{isStudent:p}=T4({reason:"study-mode-access"}),h=d.useMemo(()=>c.some(g=>g.display_model===ie.STUDY),[c]);return d.useCallback(g=>{const y=sn(g),x=y===oe.SEARCH&&!th(g);if(g===ie.DEFAULT)return!0;if(s)return sn(g)===oe.STUDY&&!p&&!h?!1:a?!0:u||sn(g)===oe.RESEARCH&&f||sn(g)===oe.STUDIO&&m||i(y)?!1:!(!o&&x&&!r.unlimitedProSearch);{const v=r.unlimitedProSearch&&sn(g)===oe.SEARCH&&!i(y),b=r.unlimitedResearch&&sn(g)===oe.RESEARCH&&!i(y);return v||b}},[u,f,m,o,r.unlimitedProSearch,r.unlimitedResearch,s,i,a,p,h])}function qf(){const{$t:e}=J(),t=Vt(),{openVisitorLoginUpsell:n}=di({enabled:!t}),r=$f(),s=gv(),o=mu(),{specialCapabilities:a}=Qr(),i=d.useCallback((u,f)=>{const m=sn(u);if(u===ie.DEFAULT&&!f)return!1;const p=s(u)===!1||f;if(t)if(p){const h={[oe.SEARCH]:e({defaultMessage:"Want more {copilot}?",id:"Kf+JzdHL3c"},{copilot:"Pro Search"}),[oe.RESEARCH]:e({defaultMessage:"Want more Research?",id:"4cKm89wwuR"}),[oe.STUDIO]:e({defaultMessage:"Try Perplexity Labs",id:"y2BN7EwBoA"}),[oe.STUDY]:e({defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"})},g={[oe.SEARCH]:e({defaultMessage:"With {pplx} {pro}, get as many as you want",id:"jRMiP6Ut4n"},{pplx:"Perplexity",pro:"Pro"}),[oe.RESEARCH]:r(m)?e({defaultMessage:"Upgrade to Max for enhanced access to Perplexity Research.",id:"7fqjw8mo2u"}):e({defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"}),[oe.STUDIO]:r(m)?e({defaultMessage:"Upgrade to Max for enhanced access to Perplexity Labs.",id:"vETcCWwvBb"}):e({defaultMessage:"Exclusive access for subscribers",id:"1LB4QwRSMw"}),[oe.STUDY]:e({defaultMessage:"Ask questions and learn",id:"8RzCMAs2/c"})},y=h[m??oe.SEARCH],x=g[m??oe.SEARCH],b={[oe.SEARCH]:lt.TRY_COPILOT,[oe.RESEARCH]:lt.TRY_RESEARCH,[oe.STUDIO]:lt.TRY_LABS}[m??oe.SEARCH]??lt.TRY_COPILOT;return o({pitchMessage:{title:y,description:x},origin:b}),!0}else return!1;else{if(u===ie.PRO&&a.unlimitedProSearch)return!1;const h={[oe.SEARCH]:e({defaultMessage:"Sign in to access Pro Search",id:"AARKXJYL5U"}),[oe.RESEARCH]:e({defaultMessage:"Sign in to access Perplexity Research",id:"D/01NxLK/G"}),[oe.STUDIO]:e({defaultMessage:"Sign in to try Perplexity Labs",id:"xJYMyIruMK"}),[oe.STUDY]:e({defaultMessage:"Sign in to access Perplexity Learn",id:"K0eM+R/Zew"})},g={[oe.SEARCH]:e({defaultMessage:"10x as many citations in answers",id:"D0fULpN8/D"}),[oe.RESEARCH]:e({defaultMessage:"Deep research and analysis on any topic",id:"vZzVhXmhZo"}),[oe.STUDIO]:e({defaultMessage:"Create projects from scratch, exclusive access for subscribers",id:"STPFx+8/sC"}),[oe.STUDY]:e({defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"})},y=h[m??oe.SEARCH],x=g[m??oe.SEARCH];return n({title:y,description:x,origin:lt.TRY_PRO}),!0}},[e,s,t,o,n,r,a.unlimitedProSearch]),c=d.useCallback(u=>s(u)?!1:(t?o({pitchMessage:{title:e({defaultMessage:"Choose a model",id:"fXlc3idTcy"}),description:e({defaultMessage:"With Perplexity Pro, you get access to all the latest AI models in one subscription",id:"gqUZUJex7f"})},origin:lt.MODEL_SELECTOR}):n({title:e({defaultMessage:"Sign in to choose a model",id:"BhbQUiYsTB"}),description:e({defaultMessage:"Access the latest AI models from Perplexity, OpenAI, Anthropic (Claude), Google Gemini and more",id:"DDVABeGeBG"}),origin:lt.MODEL_SELECTOR}),!0),[s,t,o,n,e]);return d.useMemo(()=>({gateSearchModeSelection:i,gateSearchModelSelection:c}),[i,c])}const W8e=()=>{const{gpt4Limit:e}=Fn(),{specialCapabilities:t}=Qr(),{hasAccessToProFeatures:n}=Bt();return d.useCallback(()=>!t.unlimitedProSearch&&(!e.available||!n)?ie.DEFAULT:ie.PRO,[e,n,t.unlimitedProSearch])};function G8e(){const e=zo(),{setPreferredSearchModel:t}=ig(),{setConfiguredModel:n,setConfiguredSearchMode:r}=Fn(),{gateSearchModelSelection:s}=qf(),o=W8e();return d.useCallback((a=o(),i=e)=>{s(a)||(t(i,a),n(a),r(i))},[e,s,o,t,n,r])}function Kf(){const e=G8e(),{device:{isWindowsApp:t}}=on(),{safeWindowsIpcPublish:n,safeWindowsIpcSubscribe:r}=lg(),s=d.useRef(e);d.useEffect(()=>{s.current=e},[e]);const o=d.useRef(r);return d.useEffect(()=>{o.current=r},[r]),d.useEffect(()=>{if(!t)return;const i=o.current(sd,c=>{c.type===sd&&s.current(c.model,c.searchMode)});return()=>{i?.()}},[t]),d.useCallback((i,c)=>{n(sd,{type:sd,model:i,searchMode:c}),s.current(i,c)},[n])}function Tp(e){if(e.exactCount!==void 0&&e.exactCount>=0&&e.exactCount<=10)return e.exactCount}function Ai(e){switch(e){case oe.SEARCH:return ie.PRO;case oe.RESEARCH:return ie.ALPHA;case oe.STUDIO:return ie.BETA;case oe.STUDY:return ie.STUDY;default:return ie.PRO}}const TY=T.memo(e=>{const{isFollowUp:t,value:n,onChange:r,buttonSize:s="small",variant:o="primaryGhost"}=e,a=$f(),{$t:i}=J(),c=Kf(),u=zo(),f=d.useMemo(()=>n!==void 0?sn(n):u,[n,u]),{isMax:m,hasAccessToProFeatures:p}=Bt(),h=Vt(),{gpt4Limit:g,pplxAlphaLimit:y,pplxBetaLimit:x}=Fn(),{specialCapabilities:v}=Qr(),{preferredSearchModels:b,setPreferredSearchModel:_}=ig(),w=ci(),S=gv(),{isMaxUpsellEnabled:C}=Gx(),[E,N]=d.useState(()=>{const F=b[oe.SEARCH];return v.unlimitedProSearch?!0:F===ie.DEFAULT?!1:h});E&&!g.available&&!v.unlimitedProSearch&&N(!1);const{gateSearchModeSelection:k}=qf(),I=d.useCallback(()=>{k(ie.BETA,!0)},[k]),M=d.useCallback(F=>k(F?ie.PRO:ie.DEFAULT)?(N(!1),_(oe.SEARCH,ie.DEFAULT),!1):(N(F),_(oe.SEARCH,F?ie.PRO:ie.DEFAULT),F),[_,k]),A=d.useCallback(F=>{let R;switch(F){case oe.SEARCH:{E?R=b[F]??Ai(F):R=ie.DEFAULT;break}case oe.RESEARCH:{C?R=b[F]??Ai(F):R=Ai(F);break}case oe.STUDIO:{C?R=b[F]??Ai(F):R=Ai(F);break}default:{R=ie.DEFAULT;break}}if(!S(R)){k(R);return}r?r(R):c(R,F)},[C,E,r,b,c,S,k]),D=d.useMemo(()=>{const F=Tp(g),R=Tp(y),j=Tp(x);function L(O,$){return{active:f===O,description:i(qr[O].description),icon:e3(O),onClick(){A(O)},text:i(qr[O].name),type:"default",...$}}const U=[];return U.push(L(oe.SEARCH,{customDescriptionNode:p?void 0:l.jsxs(l.Fragment,{children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(Ne,{...qr[oe.SEARCH].description})}),l.jsxs("div",{className:"gap-md flex flex-col",children:[l.jsx("hr",{className:"border-subtler bg-subtler -mr-5 mt-3"}),l.jsxs("div",{className:"gap-sm -mr-5 flex items-start justify-between",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx("button",{onClick:()=>{k(v.unlimitedProSearch?ie.PRO:ie.SONAR)},type:"button",children:l.jsx(V,{className:"font-medium underline",color:"super",variant:"tiny",children:l.jsx(Ne,{defaultMessage:"Try Pro Search",id:"akAejIEhqZ"})})}),l.jsx(py,{isMax:m,className:"h-2.5"})]}),l.jsx(V,{className:"italic",color:"super",variant:"tinyRegular",children:l.jsx(Ne,{defaultMessage:"Advanced search with 10x the sources",id:"MZLTMODV37"})}),h&&F!==void 0&&!m&&l.jsx(V,{className:"mt-1 font-light",color:"super",variant:"tinyRegular",children:l.jsx(Ne,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:F}})})]}),l.jsx(AY,{isProSearchEnabled:E,selectSearchModel:c,selectedSearchMode:f,setIsProSearchEnabled:M})]})]})]}),customTextNode:l.jsx(V,{variant:"smallBold",children:l.jsx(Ne,{...qr[oe.SEARCH].name})})})),U.push(L(oe.RESEARCH,{customTextNode:l.jsxs("div",{className:"gap-sm mt-px flex items-center",children:[l.jsx(V,{variant:"smallBold",children:l.jsx(Ne,{...qr[oe.RESEARCH].name})}),l.jsx(py,{isMax:m||a(oe.RESEARCH),className:"h-2.5"})]}),customDescriptionNode:l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(Ne,{...qr[oe.RESEARCH].description})}),h&&R!==void 0&&!m&&l.jsxs("div",{children:[l.jsx(V,{color:"super",variant:"tinyRegular",children:l.jsx(Ne,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:R}})}),a(oe.RESEARCH)&&l.jsx(ze,{onClick:I,variant:"common",size:"small",fullWidth:!0,extraCSS:"mt-sm",text:i({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})})]})]})})),U.push(L(oe.STUDIO,{customTextNode:l.jsxs("div",{className:"gap-sm mt-px flex items-center",children:[l.jsx(V,{variant:"smallBold",children:l.jsx(Ne,{...qr[oe.STUDIO].name})}),l.jsx(py,{isMax:m||a(oe.STUDIO),className:"h-2.5"})]}),customDescriptionNode:l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(Ne,{...qr[oe.STUDIO].description})}),h&&j!==void 0&&!m&&l.jsxs("div",{children:[l.jsx(V,{color:"max",variant:"tinyRegular",children:l.jsx(Ne,{defaultMessage:"{limit, plural, one {# query remaining this month} other {# queries remaining this month}}",id:"wlPH+sOjjI",values:{limit:j}})}),a(oe.STUDIO)&&l.jsx(ze,{onClick:I,variant:"common",size:"small",fullWidth:!0,extraCSS:"mt-sm",text:i({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})})]})]})})),U},[p,m,h,g,E,c,f,M,y,a,I,i,x,A,k,v.unlimitedProSearch]),P=d.useMemo(()=>l.jsx(ge,{icon:B("chevron-down"),size:"xs",className:z("-mx-xs -mb-two opacity-50",{"-ml-sm":t})}),[t]);return l.jsx(Ws,{isMobileStyle:w,items:D,placement:"bottom-start",children:l.jsx(ze,{icon:e3(f),size:s,text:t?l.jsx(l.Fragment,{children:"​"}):i(qr[f].name),variant:o,trailingComponent:P})})});TY.displayName="SearchModeDropdownMenu";const AY=T.memo(({isProSearchEnabled:e,selectSearchModel:t,selectedSearchMode:n,setIsProSearchEnabled:r})=>{const{$t:s}=J(),o=d.useCallback(i=>{r(i)&&n===oe.SEARCH&&t(i?ie.PRO:ie.DEFAULT)},[t,n,r]),a=d.useMemo(()=>({onClick(i){i.stopPropagation()}}),[]);return l.jsx(gg,{checked:e,onCheckedChange:o,"aria-label":s({defaultMessage:"Enable Pro Search",id:"4oWk17uURl"}),...a})});AY.displayName="SwitchFactory";function pj(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function ei({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const s=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=d.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),i=d.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),c=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,f=d.useRef(!1);d.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[m,p,h]=d.useMemo(()=>{const v=()=>{if(!i.current.element)return;const{left:b,top:_,width:w,height:S,bottom:C,right:E,x:N,y:k}=i.current.element.getBoundingClientRect(),I={left:b,top:_,width:w,height:S,bottom:C,right:E,x:N,y:k};i.current.element instanceof HTMLElement&&r&&(I.height=i.current.element.offsetHeight,I.width=i.current.element.offsetWidth),Object.freeze(I),f.current&&!Y8e(i.current.lastBounds,I)&&a(i.current.lastBounds=I)};return[v,u?pj(v,u):v,c?pj(v,c):v]},[a,r,c,u]);function g(){i.current.scrollContainers&&(i.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",h,!0)),i.current.scrollContainers=null),i.current.resizeObserver&&(i.current.resizeObserver.disconnect(),i.current.resizeObserver=null),i.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",i.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",i.current.orientationHandler))}function y(){i.current.element&&(i.current.resizeObserver=new s(h),i.current.resizeObserver.observe(i.current.element),t&&i.current.scrollContainers&&i.current.scrollContainers.forEach(v=>v.addEventListener("scroll",h,{capture:!0,passive:!0})),i.current.orientationHandler=()=>{h()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",i.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",i.current.orientationHandler))}const x=v=>{!v||v===i.current.element||(g(),i.current.element=v,i.current.scrollContainers=NY(v),y())};return q8e(h,!!t),$8e(p),d.useEffect(()=>{g(),y()},[t,h,p]),d.useEffect(()=>g,[]),[x,o,m]}function $8e(e){d.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function q8e(e,t){d.useEffect(()=>{if(t){const n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[e,t])}function NY(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:s}=window.getComputedStyle(e);return[n,r,s].some(o=>o==="auto"||o==="scroll")&&t.push(e),[...t,...NY(e.parentElement)]}const K8e=["x","y","top","bottom","left","right","width","height"],Y8e=(e,t)=>K8e.every(n=>e[n]===t[n]),Xd=[.4,0,.2,1],hj=10,RY=T.memo(e=>{const{children:t,tooltipContent:n,triggeredSearchModeElement:r,isOpen:s,setIsOpen:o}=e,{showSuggestDropdown:a}=Kr(),[i,c]=d.useState(!1),u=s!==void 0?s:i,f=o||c,m=d.useRef(0),[p,h]=ei(),[g,y]=ei(),v=d.useCallback(()=>{const{left:E=0,width:N=0}=r?.getBoundingClientRect()??{};return h.width===0||E===0?0:E-h.left+N/2-hj/2},[h,r])();let b=v!==0;v!==0&&v!==m.current&&(b=m.current!==0,m.current=v);const _=d.useCallback(E=>{E||(m.current=0),f(E)},[f]),w=d.useCallback(E=>{E.preventDefault()},[]),S=d.useCallback(()=>{f(!1)},[f]),C=d.useCallback(E=>{E.preventDefault()},[]);return l.jsx(Zme,{delayDuration:a?1e3:400,skipDelayDuration:100,children:l.jsxs(qU,{onOpenChange:_,open:u,children:[l.jsx(Jme,{asChild:!0,className:"focus:outline-none",onBlur:S,onClick:w,onPointerDown:C,children:t}),l.jsx(epe,{children:l.jsx(tpe,{className:"group/tooltip-content data-[state=closed]:animate-slideDownAndFadeOut data-[state=delayed-open]:animate-slideUpAndFadeIn ease-outExpo duration-300","data-color-scheme":"dark",sideOffset:4,side:"bottom",ref:p,children:l.jsxs(Te.div,{className:"bg-base shadow-overlay flex w-72 flex-col rounded-lg",animate:{height:y.height||void 0},transition:{duration:.05,ease:Xd},children:[l.jsxs(Te.div,{className:'absolute left-0 group-data-[side="bottom"]/tooltip-content:top-0 group-data-[side="top"]/tooltip-content:bottom-0',animate:{opacity:m.current?1:void 0,x:b?v:void 0},initial:{opacity:0},transition:{duration:.05,ease:Xd},style:{x:v,width:hj},children:[l.jsx(T7,{className:"fill-inverse"}),l.jsx(T7,{className:"fill-inverse -translate-y-px scale-[99%]"})]}),l.jsx("div",{className:"relative overflow-hidden",children:l.jsx("div",{className:"whitespace-normal",ref:g,children:n})})]})})})]})})});RY.displayName="SearchModeTooltip";const DY={[oe.SEARCH]:ie.DEFAULT,[oe.RESEARCH]:ie.ALPHA,[oe.STUDIO]:ie.BETA,[oe.STUDY]:ie.DEFAULT},yv=T.memo(e=>{const{children:t,className:n,searchMode:r,...s}=e,{gateSearchModeSelection:o}=qf();return l.jsx("button",{className:z("group",n),onClick:()=>{o(DY[r],!0)},type:"button",...s,children:l.jsx(V,{className:"!text-[var(--mode-color)] underline decoration-transparent transition-[text-decoration-color] group-hover:decoration-[var(--mode-color)]",variant:"smallBold",children:t})})});yv.displayName="SearchModeTooltipUpgradeButton";const xv=T.memo(e=>{const{badgeNode:t,color:n,enabledText:r,isEnabled:s,upgradeButton:o,isMaxUpsell:a=!1}=e;return l.jsxs("div",{className:"gap-sm flex items-center",style:{"--mode-color":n==="super"?"oklch(var(--super-color))":"oklch(var(--max-color))"},children:[t,s?l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(V,{className:"!text-[var(--mode-color)]",variant:"smallBold",children:r}),!a&&l.jsx(ft,{name:B("check"),className:"text-[var(--mode-color)]",size:18})]}):l.jsx(l.Fragment,{children:o})]})});xv.displayName="SearchModeTooltipFooter";const jY=T.memo(e=>{const{searchMode:t}=e,{$t:n}=J(),r=Vt(),{hasAccessToProFeatures:s}=Bt(),{gateSearchModeSelection:o}=qf(),a=$f(),{specialCapabilities:i}=Qr(),c=d.useCallback(()=>{o(DY[t],!0)},[o,t]);return a(t)?l.jsx(ze,{onClick:c,variant:"maxGold",size:"small",fullWidth:!0,text:n({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})}):i.unlimitedProSearch||i.unlimitedResearch||r&&s||t===oe.STUDY?null:l.jsx(ze,{onClick:c,variant:"primary",size:"small",fullWidth:!0,testId:"upgrade-to-pro-button",text:r?l.jsx(Ne,{defaultMessage:"Upgrade to Pro",id:"5N04mo7WNC"}):l.jsx(Ne,{defaultMessage:"Sign in for access",id:"w6mjA9GP58"})})});jY.displayName="SearchModeTooltipUpsellButton";const Cg=T.memo(e=>{const{footerNode:t,includeNewBadge:n,searchMode:r}=e,{$t:s}=J();return l.jsxs("div",{className:"p-md flex flex-col gap-4",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs("div",{className:"relative",children:[l.jsx(V,{className:"text-box-trim-both",variant:"smallExtraBold",children:s(qr[r].name)}),n&&l.jsx(K,{className:"absolute -right-1 -top-1 rounded-md px-2 py-1",variant:"subtle",children:l.jsx(V,{variant:"tiny",children:l.jsx(Ne,{defaultMessage:"New",id:"bW7B87wFFp"})})})]}),l.jsx(V,{variant:"small",className:"text-pretty",children:s(qr[r].description)})]}),l.jsx("hr",{className:"border-subtler bg-subtler"}),l.jsx("div",{className:"gap-xs flex flex-col",children:t}),l.jsx(jY,{searchMode:r})]})});Cg.displayName="SearchModeTooltipContentContainer";const vv=T.memo(({isMaxUpsell:e=!1})=>{const{isMax:t,isPro:n}=Bt();return t||e?l.jsx(TA,{className:"text-max h-3"}):n?l.jsx(AA,{className:"text-super h-3"}):null});vv.displayName="SearchModeBadge";const NA=({isMax:e,isPro:t,isMaxUpsell:n=!1})=>e||n?"max":"super",IY=T.memo(e=>{const{isToggleActive:t,onToggleChange:n}=e,{$t:r}=J(),s=Vt(),{hasAccessToProFeatures:o,isMax:a,isPro:i}=Bt(),{gpt4Limit:c}=Fn(),{specialCapabilities:u,isGovernmentRequestOrigin:f}=Qr(),m=(()=>{if(!s&&!u.unlimitedProSearch)return null;if(o||u.unlimitedProSearch)return f?l.jsx(Ne,{defaultMessage:"Unlimited access for government",id:"0JftsQv9MC"}):l.jsx(Ne,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"});const v=Tp(c);return v!==void 0?l.jsx(Ne,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:v}}):null})(),p=d.useMemo(()=>l.jsx(vv,{}),[]),h=d.useMemo(()=>({onClick(v){v.stopPropagation()}}),[]),g=d.useMemo(()=>l.jsx(yv,{searchMode:oe.SEARCH,children:l.jsx(Ne,{defaultMessage:"Try Pro Search",id:"akAejIEhqZ"})}),[]),y=d.useMemo(()=>l.jsx(Ne,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[]),x=d.useMemo(()=>l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:"gap-xs flex w-full flex-col",children:[l.jsx(xv,{badgeNode:p,color:NA({isMax:a,isPro:i}),enabledText:y,isEnabled:o||u.unlimitedProSearch,upgradeButton:g}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(Ne,{defaultMessage:"Advanced search with 10x the sources; powered by top models",id:"IKFeqUH+w0"})}),m&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:m})]}),!o&&!u.unlimitedProSearch&&n&&l.jsx(gg,{checked:t,onCheckedChange:n,"aria-label":r({defaultMessage:"Enable Pro Search",id:"4oWk17uURl"}),...h})]}),[p,a,i,y,o,u.unlimitedProSearch,g,m,n,t,r,h]);return l.jsx(Cg,{footerNode:x,searchMode:oe.SEARCH})});IY.displayName="ProSearchModeTooltip";const PY=T.memo(()=>{const e=Vt(),{hasAccessToProFeatures:t,isMax:n,isPro:r}=Bt(),{gpt4Limit:s,pplxAlphaLimit:o}=Fn(),{specialCapabilities:a,isGovernmentRequestOrigin:i}=Qr(),c=$f(),u=c(oe.RESEARCH),f=(()=>{if(!e&&!a.unlimitedResearch)return null;const y=s.exactCount!==void 0&&o.exactCount!==void 0?Math.min(s.exactCount,o.exactCount):void 0;if(y!==void 0&&y<0||c(oe.RESEARCH))return null;if(a.unlimitedResearch&&i)return l.jsx(Ne,{defaultMessage:"Unlimited access for government",id:"0JftsQv9MC"});if(n)return l.jsx(Ne,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"});const x=Tp(o);return x!==void 0?l.jsx(Ne,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:x}}):l.jsx(Ne,{defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"})})(),m=d.useMemo(()=>l.jsx(vv,{isMaxUpsell:u}),[u]),p=d.useMemo(()=>u?l.jsx(Ne,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(Ne,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[u]),h=d.useMemo(()=>l.jsx(yv,{searchMode:oe.RESEARCH,children:e?u?l.jsx(Ne,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(Ne,{defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"}):l.jsx(Ne,{defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"})}),[e,u]),g=d.useMemo(()=>l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(xv,{badgeNode:m,color:NA({isMax:n,isPro:r,isMaxUpsell:u}),enabledText:p,isEnabled:t||a.unlimitedResearch,upgradeButton:h,isMaxUpsell:u}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(Ne,{defaultMessage:"In-depth reports with more sources, charts, and advanced reasoning",id:"9V0OqZ9HGl"})}),f&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:f})]}),[m,p,t,n,r,u,f,h,a.unlimitedResearch]);return l.jsx(Cg,{footerNode:g,searchMode:oe.RESEARCH})});PY.displayName="ResearchModeTooltip";const OY=T.memo(()=>{const e=Vt(),{hasAccessToProFeatures:t,isMax:n,isPro:r}=Bt(),{pplxBetaLimit:s}=Fn(),o=$f(),a=o(oe.STUDIO),i=e?t?!s.available||o(oe.STUDIO)?null:n?l.jsx(Ne,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"}):s.exactCount?l.jsx(Ne,{defaultMessage:"{limit, plural, one {# query remaining this month} other {# queries remaining this month}}",id:"wlPH+sOjjI",values:{limit:s.exactCount}}):null:l.jsx(Ne,{defaultMessage:"Upgrade to get access",id:"eRbSgHbjUP"}):null,c=d.useMemo(()=>l.jsx(vv,{isMaxUpsell:a}),[a]),u=d.useMemo(()=>a?l.jsx(Ne,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(Ne,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[a]),f=d.useMemo(()=>l.jsx(yv,{searchMode:oe.STUDIO,children:e?a?l.jsx(Ne,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(Ne,{defaultMessage:"Access for subscribers only",id:"Ez3b/pzas/"}):l.jsx(Ne,{defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"})}),[e,a]),m=d.useMemo(()=>l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(xv,{badgeNode:c,color:NA({isMax:n,isPro:r,isMaxUpsell:a}),enabledText:u,isEnabled:t,upgradeButton:f,isMaxUpsell:a}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:a?l.jsx(Ne,{defaultMessage:"Draft, design, deliver your ideas.",id:"I1aIhz4l3D"}):l.jsx(Ne,{defaultMessage:"Turn your ideas into completed docs, slides, dashboards, and more",id:"WRu1tcOhoj"})}),i&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:i})]}),[c,u,t,n,r,a,i,f]);return l.jsx(Cg,{footerNode:m,searchMode:oe.STUDIO,includeNewBadge:!0})});OY.displayName="StudioModeTooltip";const LY=T.memo(()=>{const e=T.useMemo(()=>l.jsx("div",{children:l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(Ne,{defaultMessage:"Interactive learning and study tools that guide you toward deeper understanding beyond quick answers. ",id:"ZRKKxSc+oV"})})}),[]);return l.jsx(Cg,{footerNode:e,searchMode:oe.STUDY,includeNewBadge:!0})});LY.displayName="StudyModeTooltip";const FY=()=>{const{base:e}=Dn(),t=Ln();return t===(e||"/")||t?.startsWith("/welcome")||t?.startsWith("/finance")};var RA="Radio",[Q8e,BY]=Vs(RA),[X8e,Z8e]=Q8e(RA),UY=d.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:o,disabled:a,value:i="on",onCheck:c,form:u,...f}=e,[m,p]=d.useState(null),h=En(t,x=>p(x)),g=d.useRef(!1),y=m?u||!!m.closest("form"):!0;return l.jsxs(X8e,{scope:n,checked:s,disabled:a,children:[l.jsx(Mt.button,{type:"button",role:"radio","aria-checked":s,"data-state":WY(s),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:h,onClick:nt(e.onClick,x=>{s||c?.(),y&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),y&&l.jsx(zY,{control:m,bubbles:!g.current,name:r,value:i,checked:s,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});UY.displayName=RA;var VY="RadioIndicator",HY=d.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,o=Z8e(VY,n);return l.jsx(Hr,{present:r||o.checked,children:l.jsx(Mt.span,{"data-state":WY(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});HY.displayName=VY;var J8e="RadioBubbleInput",zY=d.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),i=En(a,o),c=bT(n),u=yM(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),l.jsx(Mt.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});zY.displayName=J8e;function WY(e){return e?"checked":"unchecked"}var e7e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],bv="RadioGroup",[t7e]=Vs(bv,[tc,BY]),GY=tc(),$Y=BY(),[n7e,r7e]=t7e(bv),qY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:o,required:a=!1,disabled:i=!1,orientation:c,dir:u,loop:f=!0,onValueChange:m,...p}=e,h=GY(n),g=Lf(u),[y,x]=fo({prop:o,defaultProp:s??null,onChange:m,caller:bv});return l.jsx(n7e,{scope:n,name:r,required:a,disabled:i,value:y,onValueChange:x,children:l.jsx(Jx,{asChild:!0,...h,orientation:c,dir:g,loop:f,children:l.jsx(Mt.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:g,...p,ref:t})})})});qY.displayName=bv;var KY="RadioGroupItem",YY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,o=r7e(KY,n),a=o.disabled||r,i=GY(n),c=$Y(n),u=d.useRef(null),f=En(t,u),m=o.value===s.value,p=d.useRef(!1);return d.useEffect(()=>{const h=y=>{e7e.includes(y.key)&&(p.current=!0)},g=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),l.jsx(ev,{asChild:!0,...i,focusable:!a,active:m,children:l.jsx(UY,{disabled:a,required:o.required,checked:m,...c,...s,name:o.name,ref:f,onCheck:()=>o.onValueChange(s.value),onKeyDown:nt(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:nt(s.onFocus,()=>{p.current&&u.current?.click()})})})});YY.displayName=KY;var s7e="RadioGroupIndicator",QY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=$Y(n);return l.jsx(HY,{...s,...r,ref:t})});QY.displayName=s7e;const o7e=e=>{const t=hr(e);if(!t)return 0;const n=parseInt(t);return isNaN(n)?1:n},gj=(e,t)=>{lo(e,t.toString(),{expires:365})},a7e=({cueKey:e,impressionsLimit:t,enabled:n})=>{const[r,s]=d.useState(!1),[o,a]=d.useState(0);d.useEffect(()=>{if(!n){s(!1);return}const c=o7e(e);a(c),c{gj(e,t),a(t),s(!1)},[e,t]);return d.useMemo(()=>({shouldShow:r,currentCount:o,setReachedImpressions:i}),[r,o,i])},i7e={xs:"px-xs py-xxs",sm:"px-sm py-xs"},l7e=e=>{switch(e){case"common":return{background:"dark bg-base",titleText:"!text-light font-semibold",subtitleText:"!text-light mt-xxs opacity-90",arrow:"dark fill-base [&>path]:stroke-subtler dark:[&>path]:stroke-1 [clip-path:inset(1px_1px_0px_1px)]",borderRadius:"rounded-md"};default:return{background:"!bg-super !shadow-none",titleText:"!text-inverse",subtitleText:"!text-inverse mt-xs opacity-90",arrow:"fill-super",borderRadius:"rounded-md"}}},_v=T.memo(({cueKey:e,title:t,subtitle:n,children:r,enabled:s,impressionsLimit:o=1,variant:a="primary",size:i="xs",placement:c="bottom",sideOffset:u=10,className:f})=>{const[m,p]=d.useState(!1),{shouldShow:h}=a7e({cueKey:e,impressionsLimit:o,enabled:s}),g=l7e(a),y=h&&!m,x=()=>!t&&!n?null:l.jsxs("div",{className:z(i7e[i],f),children:[t&&l.jsx(V,{variant:"tiny",className:g.titleText,children:t}),n&&l.jsx(V,{variant:"tiny",className:g.subtitleText,children:n})]}),v=d.useCallback(()=>{p(!0)},[]),b=d.useMemo(()=>({removeScroll:!1,animationClassName:"z-[2000]"}),[]);return l.jsx(zf,{content:x(),contentClassName:g.background,arrowClassName:g.arrow,borderRadius:g.borderRadius,isOpen:s&&y,onClose:v,placement:c,sideOffset:u,overlayProps:b,children:r})});_v.displayName="Cue";const DA=T.memo(e=>{const{className:t="",layoutKey:n="",options:r,value:s,backgroundClassName:o="",radioGroupIndicatorClassName:a="",variant:i="default",areCuesEnabled:c=!1,...u}=e,f=(()=>{switch(i){case"subtle":return"";case"default":return"bg-white dark:bg-black dark:bg-gradient-to-b dark:from-super/20 dark:to-super/20";default:Ft(i)}})(),{$t:m}=J(),p=d.useMemo(()=>({study:m({defaultMessage:"Learn Mode",id:"vuxvUxbYvn"})}),[m]),h=d.useMemo(()=>r.map(y=>{const x=y.value===s;return l.jsx(_v,{cueKey:`segmented-control-${y.value}`,enabled:!!p[y.value]&&c,placement:"top",title:p[y.value],children:l.jsxs(YY,{...y.elementProps,"aria-label":y.label,disabled:y.disabled??void 0,className:"segmented-control group/segmented-control relative focus:outline-none",value:y.value,children:[x&&l.jsx(QY,{asChild:!0,className:z("pointer-events-none absolute inset-0 z-0 block",f,"border-super dark:border-super/30 border","rounded-lg","shadow-super/30 dark:shadow-super/5 shadow-[0_1px_3px_0]","dark:text-super","transition-colors duration-300","group-focus-visible/segmented-control:border-dashed",a),children:l.jsx(Te.div,{layoutId:`segmented-control-active-indicator-${n}`,transition:{duration:.1}})}),y.children]})},y.value)}),[r,s,p,c,f,a,n]),g=(()=>{switch(i){case"subtle":return"bg-subtle";case"default":return"bg-super/10 dark:bg-black/[0.18]";default:Ft(i)}})();return l.jsxs(qY,{...u,className:z("group relative isolate flex h-fit",t),value:s,children:[l.jsx("div",{className:z("absolute inset-0",g,"dark:border dark:border-black/[0.04]","rounded-[10px]","transition-colors duration-300",o)}),l.jsx("div",{className:"p-two flex shrink-0 items-center",children:h})]})});DA.displayName="SegmentedControl";const jA=T.memo(e=>{const{className:t="",isActiveOption:n,icon:r,label:s,activeColor:o="text-super"}=e,a=z("transition-colors duration-300",{[o]:n,"text-quiet group-hover/segmented-control:text-foreground":!n});return l.jsxs("div",{className:z("relative z-10 flex h-8 min-w-9 items-center justify-center",{"py-xs gap-xs px-2.5":n||s},t),children:[r&&l.jsx(bp,{buttonSize:"small",icon:r,iconClassName:z(a),showClicked:!1}),s&&l.jsx("div",{className:z("px-two font-sans text-sm leading-[1.125rem]",a),children:s})]})});jA.displayName="SegmentedControlOption";const XY=T.memo(e=>{const{isFollowUp:t,layoutKey:n,value:r,onChange:s,className:o,variant:a}=e,i=zo(),c=d.useMemo(()=>r!==void 0?sn(r):i,[r,i]),{$t:u}=J(),f=Kf(),m=Ln(),{inputRef:p}=Kr(),{gpt4Limit:h}=Fn(),{specialCapabilities:g}=Qr(),y=FY(),x=uW(),{currentOpenedModal:v}=gn().legacy,{preferredSearchModels:b,setPreferredSearchModel:_}=ig(),[w,S]=d.useState(oe.SEARCH),C=d.useRef(null),[E,N]=d.useState(!1),k=d.useRef(null);d.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const{gateSearchModeSelection:I}=qf(),[M,A]=d.useState(!1);d.useEffect(()=>{if(!h.available&&!g.unlimitedProSearch)A(!1);else if(g.unlimitedProSearch)A(!0);else if(h.available){const G=b[oe.SEARCH];G&&G!==ie.DEFAULT&&A(!0)}},[h.available,g.unlimitedProSearch,b]);const D=d.useCallback(G=>I(G?ie.PRO:ie.DEFAULT)?(A(!1),_(oe.SEARCH,ie.DEFAULT),!1):(A(G),_(oe.SEARCH,G?ie.PRO:ie.DEFAULT),G),[_,I]),P=d.useCallback(G=>{switch(G){case oe.SEARCH:return M?b[G]??Ai(G):ie.DEFAULT;case oe.RESEARCH:return b[G]??Ai(G);case oe.STUDIO:return b[G]??Ai(G);case oe.STUDY:return ie.STUDY}},[M,b]),F=gv(),R=F(ie.STUDY),j=d.useCallback(G=>{const H=P(G);F(H)?(s?s(H):f(H,G),p.current?.focus(),N(!1)):I(H)},[F,I,P,p,s,f,N]),L=d.useCallback(G=>{if(D(G),c===oe.SEARCH){const H=G?ie.PRO:ie.DEFAULT;s?s(H):f(H)}},[s,f,c,D]),U=d.useMemo(()=>{const G=R?hR:hR.filter(Q=>Q!==oe.STUDY);function H(Q){const{searchMode:Y}=Q,te=P(Y),se=G.length<3&&!t;return{children:l.jsx("div",{children:l.jsx(jA,{label:se?l.jsx(Ne,{...qr[Y].name}):void 0,icon:e3(Y),isActiveOption:c===Y})}),elementProps:{"aria-label":u(qr[Y].name),"aria-disabled":F(te)===!1?!0:void 0,onPointerEnter(ae){k.current&&clearTimeout(k.current),C.current=ae.currentTarget,S(Y),k.current=setTimeout(()=>{N(!0)},800)},onPointerLeave(){k.current&&(clearTimeout(k.current),k.current=null)},onClick(){k.current&&(clearTimeout(k.current),k.current=null),p.current?.focus(),N(!1)}},label:u(qr[Y].name),value:Y}}return G.map(Q=>H({searchMode:Q}))},[P,t,u,c,F,p,R]);let O;switch(w){case oe.SEARCH:{O=l.jsx(IY,{isToggleActive:M,onToggleChange:L});break}case oe.RESEARCH:{O=l.jsx(PY,{});break}case oe.STUDIO:{O=l.jsx(OY,{});break}case oe.STUDY:{O=l.jsx(LY,{});break}}const $=d.useCallback(G=>{G.target.tagName===document.activeElement?.tagName&&(C.current=G.target,S(c),N(!0))},[c]);return l.jsx(RY,{tooltipContent:O,triggeredSearchModeElement:C.current,isOpen:E,setIsOpen:N,children:l.jsx(DA,{layoutKey:`segmented-search-mode-selector_${n??m}`,options:U,onFocus:$,onValueChange:j,value:c,className:o,variant:a,areCuesEnabled:y&&!x&&!v})})});XY.displayName="SegmentedSearchModeSelector";const ZY="(pointer: coarse)";function yj(){return typeof window>"u"?!1:window.matchMedia(ZY).matches}function c7e(){const e=ci(),[t,n]=d.useState(()=>yj()||e);return d.useLayoutEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(ZY);function s(){n(yj())}return r.addEventListener("change",s),s(),function(){r.removeEventListener("change",s)}},[]),t}const JY=T.memo(({isFollowUp:e,layoutKey:t,value:n,onChange:r,className:s,buttonSize:o,variant:a="default"})=>{const i=c7e(),c=ci();if(i||c){const u=(()=>{switch(a){case"default":return"primaryGhost";case"subtle":return"common"}})();return l.jsx(TY,{isFollowUp:e,value:n,onChange:r,buttonSize:o,variant:u})}else return l.jsx(XY,{isFollowUp:e,layoutKey:t,value:n,onChange:r,className:s,variant:a})});JY.displayName="SearchModeSelector";const u7e=T.memo(({size:e,inverse:t,incognitoType:n=n2.DEFAULT})=>l.jsx(K,{variant:"background",className:z("w-lg text-foreground flex aspect-square shrink-0 items-center justify-center rounded-full border",{"!w-[24px]":e==="small","!w-[16px]":e==="tiny"},{"!bg-inverse !text-inverse border-0":t}),children:n===n2.GOVERNMENT?l.jsx("svg",{width:e==="tiny"?"10":e==="small"?"12":"16",height:"auto",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fill:"currentColor",d:"M2.75 12.5h2.5v-7h1.5v7h2.5v-7h1.5v7h2.5v-7h1.5v7H16V14H0v-1.5h1.25v-7h1.5zM16 3v1.5H0V3l8-3z"})}):l.jsx("svg",{width:e==="tiny"?"12":e==="small"?"16":"24",height:"auto",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1927 4.54688C11.4375 4.71875 11.651 4.86458 12 4.86458C12.3453 4.86458 12.5529 4.72184 12.7993 4.55235L12.8073 4.54688L12.8084 4.54609C13.152 4.31187 13.5635 4.03125 14.5 4.03125C16.0885 4.03125 17.2083 6.30729 17.9375 8.6875C20.401 9.14062 22 9.875 22 10.6979C22 11.4427 20.6979 12.1094 18.6354 12.5677C18.6562 12.776 18.6667 12.9844 18.6667 13.1979C18.6667 14.0833 18.4948 14.9271 18.1823 15.6979H18.1965C17.2165 18.1697 14.8115 19.9169 12 19.9169C9.18854 19.9169 6.78355 18.1697 5.80356 15.6979H5.81771C5.50521 14.9271 5.33333 14.0833 5.33333 13.1979C5.33333 12.9844 5.34375 12.776 5.36458 12.5677C3.30208 12.1094 2 11.4427 2 10.6979C2 9.875 3.59896 9.14062 6.0625 8.6875C6.79167 6.30729 7.91146 4.03125 9.5 4.03125C10.4365 4.03125 10.848 4.31187 11.1916 4.54609L11.1927 4.54688ZM14.2708 15.6979H14.9167C16.0677 15.6979 17 14.7656 17 13.6146V12.8646C15.5312 13.0781 13.8229 13.1979 12 13.1979C10.1771 13.1979 8.46875 13.0781 7 12.8646V13.6146C7 14.7656 7.93229 15.6979 9.08333 15.6979H9.73437C10.5885 15.6979 11.3542 15.1458 11.625 14.3333C11.7448 13.9687 12.2604 13.9687 12.3802 14.3333C12.651 15.1458 13.4115 15.6979 14.2708 15.6979Z",fill:"currentColor"})})}));u7e.displayName="IncognitoIcon";function vh(){return vh=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.jsx(V,{variant:"tiny",children:l.jsx("span",{className:"text-caution",children:e})}));nQ.displayName="FormError";const wv=T.memo(({label:e,labelVariant:t="smallBold",subtitle:n,errorText:r,isOptional:s=!1,withMargin:o=!0,optionalLabel:a="optional",testId:i})=>e||r||n?l.jsxs("div",{className:z({"mb-sm":o}),"data-test-id":i,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[(e||n)&&l.jsx("label",{htmlFor:e,children:l.jsx("div",{className:"gap-y-xs flex flex-col",children:e&&l.jsxs("div",{className:"gap-x-xs flex",children:[l.jsx(V,{variant:t,className:"select-none",children:e}),s&&l.jsx(V,{variant:"small",color:"light",children:`(${a})`})]})})}),r&&l.jsx(nQ,{text:r})]}),n&&l.jsx(V,{variant:"small",color:"light",children:n})]}):null);wv.displayName="FormItemHeader";class Ls{static isEnterKey(t){return t.code==="Enter"||t.key==="Enter"||t.keyCode===13}static isEnterKeyWithoutShift(t){return this.isEnterKey(t)&&!t.shiftKey}static isArrowDown(t){return t.key==="ArrowDown"}static isArrowUp(t){return t.key==="ArrowUp"}static isEscapeKey(t){return t.key==="Escape"}static isTabKey(t){return t.key==="Tab"}static isOnlySlashKey(t){return t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey}static isCtrlOrCmdJ(t){return(t.metaKey||t.ctrlKey)&&t.key==="j"}}const bh=(e,t)=>{if(Ls.isEnterKeyWithoutShift(e)){if(t.isComposing||e.keyCode===229){e.preventDefault();return}if(t.isMobileUserAgent||t.allowEnterNewlines)return;e.preventDefault()}t.onKeyDown?.(e)},PA=e=>{e(!0)},OA=e=>{setTimeout(()=>{e(!1)},0)};var Ap;(function(e){e.INLINE="inline",e.LABEL="label"})(Ap||(Ap={}));const k7e=({onClear:e})=>l.jsx(rt,{icon:B("x"),pill:!0,onClick:e,size:Gt.small}),M7e=["email","tel"],co=T.memo(({type:e,className:t,wrapperClassName:n,value:r,name:s,maxLength:o,errorText:a,errorPlacement:i=Ap.INLINE,disabled:c=!1,required:u=!1,autoFocus:f=!1,placeholder:m="",rightItems:p=Ie,onChange:h,onClear:g,onBlur:y,onFocus:x,onPaste:v,onKeyDown:b,isLoading:_,inlineEditBlock:w,label:S,subtitle:C,isOptional:E,isMobileUserAgent:N,labelMargin:k=!0,testId:I,variant:M,disable1pass:A,ClearIcon:D=k7e,enterKeyHint:P,size:F,ref:R,colorVariant:j="default",min:L,max:U,spellCheck:O})=>{const $=ec(c),G=d.useRef(null),[H,Q]=d.useState(!1),[Y,te]=d.useState(!1),se=d.useRef(H);se.current=H,d.useEffect(()=>{!N&&f&&G.current?.focus()},[N,G,f]),d.useEffect(()=>{$!==c&&!c&&!N&&f&&setTimeout(()=>{G.current?.focus()},200)});const ae=d.useMemo(()=>z({"border-r mr-sm pr-xs border-subtler":p.length!=0}),[p.length]),X=d.useMemo(()=>{const De=(()=>{switch(j){case"default":return"bg-base dark:bg-subtler";case"subtle":return"bg-subtle";default:Ft(j)}})(),Ce=z("w-full outline-none focus:outline-none focus:ring-subtler font-sans flex items-center","text-foreground caret-super selection:bg-super/50 dark:selection:bg-super/10 dark:selection:text-super",De,"border border-subtler focus:ring-1 placeholder-quieter","duration-200 transition-all","rounded-lg",{"ring-subtler ring-1":H},t),Be=z({"py-xs px-sm text-xs placeholder:text-xs":F==="xs","py-sm px-sm text-sm placeholder:text-sm":F==="sm","py-lg px-xl text-lg placeholder:text-base":F==="lg","pl-[40px]":e==="search","!font-mono md:text-base":M==="monospace","!text-3xl !placeholder:text-3xl !font-medium":M==="page-title","py-sm md:text-sm px-md placeholder:text-sm":!F&&!M}),we=z({"pr-xs":p.length===0&&F==="xs","pr-sm":p.length===0&&F==="sm","pr-md":p.length===0&&!F,"pr-lg":p.length===0&&F==="lg","pr-[49px] md:pr-[59px]":p.length===1,"pr-[128px] md:pr-[138px]":p.length===2});return z(Ce,Be,we)},[H,t,F,e,M,p.length,j]),ee=!!a,le=!ee&&!!o&&!!r&&r.length>o,re=d.useMemo(()=>e==="search"?l.jsx("div",{className:"absolute left-3 flex items-center rounded-l-lg",children:l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("search")})})}):null,[e]),ce=d.useMemo(()=>{const De=i===Ap.INLINE&ⅇreturn l.jsxs("div",{className:"right-sm gap-sm absolute flex items-center rounded-full",children:[_?l.jsx(V,{color:"light",className:"mr-xs",children:l.jsx(ql,{})}):null,De&&l.jsx(K,{className:"mr-sm",children:l.jsx(V,{color:"red",variant:"tiny",children:a})}),le&&l.jsx(K,{className:"mr-sm",children:o&&r&&l.jsx(V,{color:"red",variant:"tiny",children:o-r.length})}),g&&l.jsx("div",{className:ae,children:l.jsx(D,{onClear:g,inputValue:r})}),p.map((Ce,Be)=>l.jsx(ze,{...Ce.buttonProps,size:Ce.buttonProps.size,disabled:Ce.buttonProps.disabled||ee||le,pill:!0},Be))]})},[i,ee,_,a,le,o,r,g,ae,D,p]),ue=d.useCallback(()=>{if(G.current){const De=G.current.value.length;G.current.focus();try{G.current.setSelectionRange(De,De)}catch{}}},[]),pe=d.useCallback(De=>{x?.(De.nativeEvent),Q(!0)},[x]),xe=d.useCallback(De=>{y?.(De.nativeEvent),Q(!1)},[y]);d.useImperativeHandle(R,()=>{const De=G.current;return De.focusAtEnd=ue,De.isFocused=()=>se.current,De.inLine=()=>!0,De.append=Ce=>{G.current&&(G.current.value+=Ce)},De.scrollToEnd=()=>{G.current&&(G.current.scrollTop=G.current.scrollHeight)},De.trim=()=>{G.current&&(G.current.value=G.current.value.trim())},De.element=()=>G.current,De},[ue]),d.useEffect(()=>{f&&!N&&ue()},[f,ue,N]);const he=d.useCallback(De=>{h?.(De.target.value)},[h]),_e=d.useCallback(De=>{bh(De.nativeEvent,{isMobileUserAgent:N,isComposing:Y,onKeyDown:b})},[b,N,Y]),ke=i===Ap.LABEL?a:void 0;return l.jsxs("div",{className:n,children:[l.jsx(wv,{label:S,subtitle:C,isOptional:E,errorText:ke,withMargin:k}),l.jsx("div",{className:"rounded-full",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{type:e,ref:G,autoFocus:f,placeholder:m,disabled:c,value:r,required:u,name:s??S,onChange:he,onKeyDown:_e,onCompositionStart:()=>PA(te),onCompositionEnd:()=>OA(te),onBlur:xe,onFocus:pe,onPaste:v,className:X,autoComplete:M7e.includes(e??"")?e:"off","data-test-id":I,"data-1p-ignore":A,enterKeyHint:P,min:L,max:U,spellCheck:O,maxLength:o}),re,ce]})}),w&&l.jsx("div",{className:"mt-sm flex justify-end",children:w})]})});co.displayName="Input";const T7e=250,rQ=T.memo(({className:e,textClassName:t,iconClassName:n,emojiClassName:r,text:s,icon:o,color:a,truncate:i,variant:c,tooltipText:u})=>{const f=d.useMemo(()=>{if(o)switch(o.type){case"emoji":return l.jsx("span",{className:z("inline-block select-none",r),children:o.char});case"icon":{const m=o.icon;return l.jsx(ge,{icon:m,className:z("text-quiet inline-block shrink-0 rounded-sm",n)})}case"image":return l.jsx("i",{className:z("inline-block shrink-0 select-none rounded-sm bg-cover bg-center bg-no-repeat",n),style:{backgroundImage:`url(${o.url})`,fontSize:"0.78rem"}})}return null},[n,r,o]);return l.jsx(Oo,{tooltipText:u,showTooltip:!!u,children:l.jsxs("span",{className:z("inline-flex min-w-0 items-center align-baseline",{"max-w-[168px]":i==="small","max-w-[208px]":i==="medium","max-w-[250px]":i==="large"},e),spellCheck:!1,children:[f,l.jsx(V,{className:z("inline-block min-w-0 truncate",t),color:a,as:"span",variant:c,children:s})]})})});rQ.displayName="MentionNodeTextContent";const sQ=T.memo(e=>l.jsx(rQ,{...e,className:"px-sm border-subtlest bg-subtler dark:bg-subtle rounded-md border-[0.2px]",textClassName:"leading-[1.3]",iconClassName:"mr-1 h-[0.88rem] w-[0.88rem]",emojiClassName:"mr-1 text-[0.80rem]",truncate:"large"}));sQ.displayName="MentionNodeDecorator";function A7e(e){const t=e.textContent,n=e.getAttribute("data-mention-uuid"),r=e.getAttribute("data-mention-variant"),s=e.getAttribute("data-mention-url")??void 0,o=e.getAttribute("data-mention-query-text")??void 0;return t!==null&&n!==null&&r!==null?{node:oQ({uuid:n,variant:r,text:t,url:s,queryText:o})}:null}class Cv extends zpe{__props;static getType(){return"mention"}static clone(t){return new Cv(t.__props,t.__key)}static importJSON(t){return oQ(t.props).updateFromJSON(t)}constructor(t,n){super(n),this.__props=t}exportJSON(){return{...super.exportJSON(),props:this.__props}}createDOM(){return document.createElement("span")}isIsolated(){return!0}updateDOM(){return!1}decorate(){return l.jsx(sQ,{text:this.__props.text,icon:this.__props.icon,tooltipText:sy(this.__props.queryText??"",T7e)})}getTextContent(){switch(this.__props.variant){case"shortcut":return this.__props.queryText??"";case"tab":return this.__props.url?`[${this.__props.text||this.__props.url}](${this.__props.url})`:this.__props.text;case"space":case"source":default:return this.__props.text}}exportDOM(){const t=document.createElement("span");return t.setAttribute("data-mention-uuid",this.__props.uuid),t.setAttribute("data-mention-variant",this.__props.variant),t.setAttribute("data-mention-url",this.__props.url??""),t.textContent=this.__props.text,{element:t}}static importDOM(){return{span:t=>!t.hasAttribute("data-mention-uuid")||!t.hasAttribute("data-mention-variant")?null:{conversion:A7e,priority:4}}}}function oQ(e){return Wpe(new Cv(e))}const aQ=[Cv,Gpe,lV],iQ=[...$pe],iE=(()=>{try{return new RegExp("(?{if(!e)return"";const n=Kpe({namespace:"text-value",nodes:aQ});return n.update(()=>{const r=gl();r.clear(),iE?lE(e):r.append(KS().append(YS(e)))},{discrete:!0}),n.read(()=>gl().getTextContent())},lE=(e,t)=>{qpe(e.replace(/\\/g,"\\\\"),iQ,t,!0)},Nm=e=>{if(!e||!e.root)return"";const t=n=>{let r="";if(n.type==="text"&&"text"in n)r=n.text;else if(n.type==="linebreak")r=` -`;else{if((n.type==="link"||n.type==="autolink")&&"url"in n)return r=`[${"children"in n&&Array.isArray(n.children)&&n.children.map(t).reduce((o,a)=>(o+=a,o),"")||""}](${n.url})`,r;if(n.type==="mention"){const o=n.props;if(o.variant==="tab")return r=`[${o.text||o.url}](${o.url})`,r;if(o.variant==="shortcut")return r=o.queryText??"",r;if(o.variant==="source"||o.variant==="space")return r=`@${o.text}`,r}}return"children"in n&&Array.isArray(n.children)?n.children.map(t).reduce((s,o)=>(s+=o,s),r):r};return t(e.root)},br={outerWrapper:{base:["bg-raised","w-full","outline-none","flex","items-center","border","rounded-2xl"],darkMode:"dark:bg-offset",transition:"duration-75 transition-all"},inputWrapper:{base:"overflow-hidden relative flex h-full w-full",expanded:["col-start-1","col-end-4","pb-3"],compact:["flex-grow","flex-shrink","p-sm","order-1"],disabled:"opacity-50 pointer-events-none cursor-not-allowed"},inputElement:["overflow-auto","max-h-[45vh]","lg:max-h-[40vh]","sm:max-h-[25vh]","outline-none","font-sans","resize-none","caret-super","selection:bg-super/30","selection:text-foreground","dark:selection:bg-super/10","dark:selection:text-super","text-foreground","bg-transparent","placeholder-quieter","placeholder:select-none","scrollbar-subtle"],attribution:{left:{base:["gap-sm","flex"],expanded:"col-start-1 row-start-2 -ml-two",compact:"order-0 ml-px"},right:{base:["flex","items-center","justify-self-end"],expanded:"col-start-3 row-start-2",compact:"order-2 mr-px"}},placeholder:{base:["absolute","inset-0","pointer-events-none","select-none","text-quieter"],compact:"p-sm"}},R7e=({isActive:e,isHighlighted:t})=>t?"border-super dark:border-super/85":e?"border-subtle":"border-subtler",D7e=({hasShadow:e,hasQuote:t})=>e&&!t?"shadow-sm dark:shadow-md shadow-super/10 dark:shadow-black/10":"",lQ=T.memo(({quote:e,onClear:t})=>e?l.jsx("div",{className:"py-sm bg-subtler dark:bg-base animate-slideDownAndFadeIn z-[49] mx-3 rounded-lg px-3",children:l.jsxs("div",{className:"gap-sm flex items-start",children:[l.jsx(V,{color:"light",className:"mt-px flex items-center pt-1",variant:"tinyRegular",children:l.jsx(ge,{icon:B("quote-filled"),size:"xs",className:"rotate-180"})}),l.jsx(V,{className:"py-xs line-clamp-3 flex-1 overflow-hidden text-ellipsis",variant:"tinyRegular",color:"light",children:e}),l.jsx("div",{className:"shrink-0",children:l.jsx(rt,{icon:B("x"),onClick:t,size:"tiny",pill:!0,toolTip:"Clear quote"})})]})}):null);lQ.displayName="QuotePreview";function Cj(e){return!!(e.closest("button")||e.closest("a")||e.closest('[role="link"]')||e.closest('[role="button"]')||e.closest('[role="menuitem"]')||e.closest('[role="menuitemcheckbox"]'))}const j7e=Se(async()=>{const{HistoryPlugin:e}=await Ee(()=>q(()=>import("./lexical-D_7aXiGd.js").then(t=>t.a0),__vite__mapDeps([10,4,1])));return{default:e}}),I7e=Se(async()=>{const{OnChangePlugin:e}=await Ee(()=>q(()=>import("./lexical-D_7aXiGd.js").then(t=>t.a1),__vite__mapDeps([10,4,1])));return{default:e}}),P7e=Se(async()=>{const{EditorRefPlugin:e}=await Ee(()=>q(()=>import("./lexical-D_7aXiGd.js").then(t=>t.a2),__vite__mapDeps([10,4,1])));return{default:e}}),O7e=Se(async()=>{const{default:e}=await Ee(()=>q(()=>import("./MentionsPlugin-BVJrrw2Q.js"),__vite__mapDeps([142,4,1,6,3,10,8,9,7,11,12])));return{default:e}}),L7e=Se(async()=>{const{default:e}=await Ee(()=>q(()=>import("./AutoLinkPlugin-cSWPmotH.js"),__vite__mapDeps([143,4,1,10,3,8,9,6,7,11,12])));return{default:e}}),F7e=Se(async()=>{const{default:e}=await Ee(()=>q(()=>import("./LinkPlugin-DFP_8rAL.js"),__vite__mapDeps([144,4,1,10])));return{default:e}}),B7e=Se(async()=>{const{MarkdownShortcutPlugin:e}=await Ee(()=>q(()=>import("./lexical-D_7aXiGd.js").then(t=>t.a3),__vite__mapDeps([10,4,1])));return{default:e}});function U7e(e,t){switch(t.type){case"SET_EXPANDED":return{...e,isExpanded:t.payload};case"SET_ACTIVE":return{...e,isActive:t.payload};case"SET_COMPOSING":return{...e,isComposing:t.payload};default:return e}}const Sg=zt("ResizableInputContext",{state:{isExpanded:!0,isActive:!1,isComposing:!1},dispatch:()=>{}}),cQ=(e,t,n,r,s)=>{d.useEffect(()=>{const o=n?15:40;e&&e.length>o||e?.includes(` -`)?s(!0):r!==(t==="expanded")&&s(t==="expanded")},[e,t,n,r,s])},LA=T.memo(({initialLayout:e="expanded",wrapperClass:t,size:n,hasShadow:r,isHighlighted:s,isMobileUserAgent:o,quote:a,setQuote:i,attachmentsList:c,inputWarnings:u,children:f,inputRef:m,ref:p})=>{const[h,g]=d.useReducer(U7e,{isExpanded:e==="expanded",isActive:!1,isComposing:!1}),{isActive:y,isExpanded:x}=h,v=d.useMemo(()=>{const S=R7e({isActive:y,isHighlighted:s}),C=D7e({hasShadow:r,hasQuote:!!a});return z(...br.outerWrapper.base,br.outerWrapper.darkMode,br.outerWrapper.transition,t,S,C,{"px-0 pt-3 pb-3":n==="large"&&x,"py-sm px-0":n==="large"&&!x})},[y,t,r,a,n,x,s]),b=d.useCallback(S=>{if(o)return;const C=S.target;Cj(C)||m?.current?.focus()},[m,o]),_=d.useCallback(S=>{if(o)return;const C=S.target;if(Cj(C))return;const E=m?.current?.element();E&&C!==E&&!E.contains(C)&&S.preventDefault()},[m,o]),w=d.useCallback(()=>i?.(null),[i]);return l.jsx(Sg.Provider,{value:{state:h,dispatch:g},children:l.jsx("div",{className:"relative rounded-2xl",ref:p,onClick:b,onMouseDownCapture:_,children:l.jsxs("div",{className:z(v,"gap-y-md grid items-center"),children:[(u||a||c)&&l.jsxs("div",{className:z({"pt-xs":!x},"gap-y-sm grid items-center"),children:[u,a&&l.jsx(lQ,{quote:a,onClear:w}),c]}),l.jsx("div",{className:z({"px-3":n==="large"&&!x,"px-3.5":n==="large"&&x,flex:!x,"grid-rows-1fr-auto grid grid-cols-3":x}),children:f})]})})})});LA.displayName="ResizeableInputWrapper";const V7e=({autoFocus:e=!1,placeholder:t="",disableInput:n=!1,value:r,initialLayout:s="expanded",minRows:o,maxRows:a,onChange:i,onClick:c,onBlur:u,onFocus:f,onKeyDown:m,onPaste:p,isMobileStyle:h,isMobileUserAgent:g,testId:y,id:x,ref:v})=>{const{state:b,dispatch:_}=d.useContext(Sg),{isActive:w,isComposing:S,isExpanded:C}=b,E=d.useRef(w);E.current=w;const N=ec(n),k=d.useRef(null),I=d.useMemo(()=>z(br.inputWrapper.base,{[br.inputWrapper.expanded.join(" ")]:C,[br.inputWrapper.compact.join(" ")]:!C,[br.inputWrapper.disabled]:n}),[n,C]),M=d.useMemo(()=>z(...br.inputElement,"w-full"),[]),A=d.useCallback(Y=>{_({type:"SET_EXPANDED",payload:Y})},[_]),D=d.useCallback(Y=>{_({type:"SET_ACTIVE",payload:Y})},[_]),P=d.useCallback(Y=>{_({type:"SET_COMPOSING",payload:Y})},[_]),F=d.useCallback(Y=>{f?.(Y.nativeEvent),D(!0)},[f,D]),R=d.useCallback(Y=>{u?.(Y.nativeEvent)!==!1&&D(!1)},[u,D]),j=d.useCallback(()=>{if(k.current){const Y=k.current.value.length;k.current.focus(),k.current.setSelectionRange(Y,Y),k.current.scrollTop=k.current.scrollHeight}},[]),L=d.useCallback(Y=>{if(!k?.current)return!0;const te=k.current,{selectionStart:se,selectionEnd:ae,value:X}=te;if(se!==ae)return!1;const ee=document.createElement("div"),le=window.getComputedStyle(te);ee.style.position="absolute",ee.style.visibility="hidden",ee.style.whiteSpace=le.whiteSpace,ee.style.wordWrap=le.wordWrap,ee.style.font=le.font,ee.style.padding=le.padding,ee.style.border=le.border,ee.style.width=te.offsetWidth+"px",ee.style.lineHeight=le.lineHeight,document.body.appendChild(ee);try{const re=parseInt(le.lineHeight)||24,ce=X.substring(0,se);ee.textContent=ce;const ue=ee.offsetHeight;return Y==="first"?ue<=re:(ee.textContent=X,ee.offsetHeight-ue{c?.(Y.nativeEvent)},[c]),O=d.useCallback(Y=>{bh(Y.nativeEvent,{isMobileUserAgent:g,isComposing:S,onKeyDown:m})},[m,S,g]),$=d.useCallback(()=>PA(P),[P]),G=d.useCallback(()=>OA(P),[P]),H=d.useCallback(Y=>{p?.(Y.nativeEvent)},[p]),Q=d.useCallback(Y=>{i?.(Y.target.value)},[i]);return d.useImperativeHandle(v,()=>{const Y=k.current;return Y.focusAtEnd=j,Y.isFocused=()=>E.current,Y.inLine=L,Y.append=te=>{k.current&&(k.current.value+=te)},Y.scrollToEnd=()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},Y.trim=()=>{k.current&&(k.current.value=k.current.value.trim())},Y.element=()=>k.current,Y},[j,L]),d.useEffect(()=>{!g&&k.current&&e&&(requestAnimationFrame(j),D(!0))},[g,k,e,D,j]),d.useEffect(()=>{N!==n&&!n&&!g&&e&&setTimeout(()=>{k.current?.focus()},200)}),cQ(r,s,h,C,A),l.jsx("div",{className:I,children:l.jsx(tQ,{ref:k,placeholder:t,minRows:o,maxRows:a,value:r,onClick:U,onChange:Q,onKeyDown:O,onBlur:R,onCompositionStart:$,onCompositionEnd:G,onFocus:F,onPaste:H,className:M,autoComplete:"off","data-test-id":y,rows:o,id:x,disabled:n,"data-1p-ignore":!0})})},hy="external-update",uQ="focus",H7e="blur",z7e=new Set([hy,uQ,H7e]),W7e=({autoFocus:e=!1,placeholder:t="",placeholderClassName:n,disableInput:r=!1,value:s,initialLayout:o="expanded",json:a,minRows:i,onChange:c,onClick:u,onBlur:f,onFocus:m,onKeyDown:p,onPaste:h,isMobileStyle:g,isMobileUserAgent:y,testId:x,id:v,namespace:b="ResizableLexicalInput",mentionTypeaheadOptions:_=Ie,onMentionMenuOpen:w,onMentionMenuClose:S,onTriggerTypeahead:C,ref:E})=>{const N=d.useRef(null),[k,I]=d.useState(null),{state:M,dispatch:A}=d.useContext(Sg),{isActive:D,isComposing:P,isExpanded:F}=M,R=d.useRef(P),j=d.useRef(D),L=d.useRef(""),U=d.useRef(null),O=d.useRef(e),$=d.useRef(null),G=d.useRef(c),H=d.useRef(u),Q=d.useRef(f),Y=d.useRef(m),te=d.useRef(p),se=d.useRef(h);G.current=c,H.current=u,Q.current=f,Y.current=m,te.current=p,se.current=h,R.current=P,j.current=D,O.current=e;const ae=ec(r),X=d.useMemo(()=>z(br.inputWrapper.base,{[br.inputWrapper.expanded.join(" ")]:F,[br.inputWrapper.compact.join(" ")]:!F}),[F]),ee=d.useMemo(()=>z(...br.inputElement,"size-full"),[]),le=d.useMemo(()=>z(...br.placeholder.base,{[br.placeholder.compact]:!F},n),[F,n]),re=d.useCallback(Me=>A({type:"SET_EXPANDED",payload:Me}),[A]),ce=d.useCallback(Me=>A({type:"SET_ACTIVE",payload:Me}),[A]),ue=d.useCallback(Me=>A({type:"SET_COMPOSING",payload:Me}),[A]),pe=d.useCallback(Me=>{Z.error(Me)},[]),xe=d.useCallback(Me=>{Y.current?.(Me),ce(!0)},[ce]),he=d.useCallback(Me=>{Q.current?.(Me)!==!1&&ce(!1)},[ce]),_e=d.useCallback(Me=>{se.current?.(Me)},[]),ke=d.useCallback(Me=>{H.current?.(Me)},[]),De=d.useCallback((Me,Ve,ct)=>{const vt=[...ct];let Dt;vt.length>0&&vt.every(ot=>z7e.has(ot))||(Dt===void 0&&(Dt=Nm(Me.toJSON())),L.current=Dt??"",U.current=Me.toJSON(),G.current?.(L.current,U.current))},[]),Ce=d.useCallback(()=>ue(!0),[ue]),Be=d.useCallback(()=>ue(!1),[ue]),we=d.useCallback(Me=>{bh(Me,{isMobileUserAgent:y,isComposing:R.current,onKeyDown:te.current})},[y]),$e=d.useCallback(()=>k?.update(()=>{b_(uQ),gl().selectEnd()}),[k]),yt=d.useCallback(Me=>k?.update(()=>{const Ve=gl(),ct=Ve.getLastChild();if(bm(ct)){const vt=YS(Me);ct.append(vt),Ve.selectEnd()}}),[k]),me=d.useCallback(()=>k?.update(()=>{const Ve=gl().getLastChild();if(bm(Ve)){const ct=Ve.getFirstChild();if(_m(ct)){const Dt=ct.getTextContent(),ot=Dt.trimStart();Dt.length-Dt.trimStart().length&&ct.spliceText(0,Dt.length,ot,!0)}const vt=Ve.getLastChild();if(_m(vt)){const Dt=vt.getTextContent(),ot=Dt.trimEnd();Dt.length-ot.length&&vt.spliceText(0,Dt.length,ot,!0)}}}),[k]),ve=d.useCallback(Me=>k?k.getEditorState().read(()=>{const Ve=Ta();if(!Aa(Ve))return!0;if(!Ve.isCollapsed())return!1;const ct=window.getSelection();if(!ct||ct.rangeCount===0)return!0;const vt=ct.getRangeAt(0);let Dt=vt.getBoundingClientRect();if(Dt.width===0&&Dt.height===0){const fn=document.createTextNode("​");vt.insertNode(fn),Dt=vt.getBoundingClientRect(),fn.remove()}const ot=k.getElementByKey(gl().getFirstChild()?.getKey()??"")?.getBoundingClientRect();if(!ot)return!0;const $t=4;return Me==="first"?Math.abs(Dt.top-ot.top)<=$t:Math.abs(Dt.bottom-ot.bottom)<=$t}):!0,[k]),Ae=d.useCallback(()=>{w?.()},[w]),Ge=d.useCallback(()=>{S?.()},[S]),ht=d.useCallback(Me=>{k||ke(Me.nativeEvent)},[k,ke]);d.useImperativeHandle(E,()=>({append:yt,trim:me,focusAtEnd:$e,isFocused:()=>j.current,inLine:ve,focus:()=>k?.focus(),blur:()=>k?.blur(),scrollIntoView:Me=>k?.getRootElement()?.scrollIntoView(Me),scrollToEnd:()=>k?.getRootElement()?.scrollIntoView({block:"end",behavior:"auto"}),element:()=>N?.current,get scrollHeight(){return k?.getRootElement()?.scrollHeight??0},get value(){return Nm(k?.getEditorState()?.toJSON())},set value(Me){throw new Error("setValue is not supported in Lexical")},get json(){return k?.getEditorState().toJSON()}}),[yt,$e,me,k,ve]),cQ(s,o,g,F,re),d.useEffect(()=>{!y&&k&&e&&(requestAnimationFrame($e),ce(!0))},[y,e,ce,k,$e]),d.useEffect(()=>{ae!==r&&!r&&!y&&e&&setTimeout(()=>$e(),200)}),d.useEffect(()=>k?.registerRootListener((Me,Ve)=>{Me&&(Me.addEventListener("focus",xe),Me.addEventListener("blur",he),Me.addEventListener("compositionstart",Ce),Me.addEventListener("compositionend",Be),Me.addEventListener("keydown",we),Me.addEventListener("paste",_e),Me.addEventListener("click",ke)),Ve&&(Ve.removeEventListener("focus",xe),Ve.removeEventListener("blur",he),Ve.removeEventListener("compositionstart",Ce),Ve.removeEventListener("compositionend",Be),Ve.removeEventListener("keydown",we),Ve.removeEventListener("paste",_e),Ve.removeEventListener("click",ke))}),[he,ke,Be,xe,we,_e,Ce,k]),d.useLayoutEffect(()=>{k&&k.setEditable(!r)},[r,k]),d.useLayoutEffect(()=>{k&&(s&&a&&!Er(a,U.current)?Promise.resolve().then(()=>{k.setEditorState(k.parseEditorState(a),{tag:hy}),O.current&&$e(),U.current=k.getEditorState().toJSON(),L.current=Nm(U.current)}):s&&L.current!==s?(k.update(()=>{b_(hy);const Me=gl();Me.clear(),iE?lE(s):Me.append(YS(s)),O.current&&Me.selectEnd()},{discrete:!0}),U.current=k.getEditorState().toJSON(),L.current=Nm(U.current)):!s&&L.current!==s&&(k.update(()=>{b_(hy);const Me=gl();Me.clear(),O.current?Me.selectEnd():k.getRootElement()!==document.activeElement&&O7(null)},{discrete:!0}),U.current=k.getEditorState().toJSON(),L.current=Nm(U.current)))},[s,a,k,$e]),d.useEffect(()=>{const Me=k?.registerCommand(__,ut=>{const bt=Ta();if(Aa(bt)&&bt.isCollapsed()){const jt=bt.anchor,pt=jt.getNode(),Kt=Xn=>{let _n=Xn,nr=_n.getParent();for(;nr&&!bm(nr)&&!z7(nr);)_n=nr,nr=_n.getParent();return _n},ur=Xn=>!Xn||!wm(Xn)||!Xn.isIsolated()?!1:(Xn.remove(),!0);if(bm(pt)){const _n=bt.getNodes()[0];if(ut){if(_n){if(_n.getNextSibling()===null&&ur(_n))return!0;const nr=_n.getPreviousSibling();if(ur(nr))return!0}}else if(ur(_n))return!0}else if(pt){const Xn=Kt(pt);if(ut){if(jt.offset===0){const nr=Xn.getPreviousSibling();if(ur(nr))return!0}}else{const _n=_m(pt)?pt.getTextContentSize():0;if(jt.offset===_n){const Xr=Xn.getNextSibling();if(ur(Xr))return!0}}}}return Aa(bt)?(bt.deleteCharacter(ut),!0):w_(bt)?(bt.deleteNodes(),!0):!1},vi),Ve=k?.registerCommand(Ype,ut=>{const bt=Ta();return Aa(bt)?(bt.deleteWord(ut),!0):!1},vi),ct=k?.registerCommand(Qpe,ut=>{const bt=Ta();return Aa(bt)?(bt.deleteLine(ut),!0):!1},vi),vt=k?.registerCommand(Xpe,()=>{const ut=Ta();return Aa(ut)?(ut.removeText(),!0):!1},vi),Dt=k?.registerCommand(Zpe,ut=>{const bt=Ta();if(typeof ut=="string")bt!==null&&bt.insertText(ut);else{if(bt===null)return!1;const jt=ut.dataTransfer;if(jt!==null)L7(jt,bt,k);else if(Aa(bt)){const pt=ut.data;return pt&&bt.insertText(pt),!0}}return!0},vi),ot=k?.registerCommand(Jpe,ut=>{if("clipboardData"in ut){const jt=ut.clipboardData?.getData("text/plain");if(jt&&jt.length>Mc)return ut.preventDefault(),!0}const bt=Ta();return Aa(bt)?(ut.preventDefault(),k.update(()=>{const jt=Ta(),pt=F7(ut,InputEvent)||F7(ut,KeyboardEvent)?null:"clipboardData"in ut?ut.clipboardData:null;if(pt&&jt){const{types:Kt}=pt;if(Kt.includes("text/html")||Kt.includes("application/x-lexical-editor")||pt.files.length>0||!iE)L7(pt,jt,k);else{const ur=jt.clone(),Xn=KS();lE(pt.getData("text/plain"),Xn);const _n=[];Xn.getChildren().forEach(nr=>{bm(nr)?(_n.length&&_n.push(B7()),nr.getChildren().forEach(Xr=>{(_m(Xr)||wm(Xr)||U7(Xr)||V7(Xr))&&_n.push(Xr)})):_n.push(nr)}),O7(ur),ehe(k,_n,ur)}}},{tag:the}),!0):!1},vi),$t=k?.registerCommand(nhe,ut=>{const bt=H7(ut.target);if(wm(bt))return!1;const jt=Ta();if(Aa(jt)){const{anchor:pt}=jt,Kt=pt.getNode();if(jt.isCollapsed()&&pt.offset===0&&!z7(Kt)&&rhe(Kt).getIndent()>0)return ut.preventDefault(),k.dispatchCommand(she,void 0);if(ohe&&navigator.language==="ko-KR")return!1}else if(!w_(jt))return!1;return ut.preventDefault(),k.dispatchCommand(__,!0)},vi),fn=k?.registerCommand(ahe,ut=>{const bt=H7(ut.target);if(wm(bt))return!1;const jt=Ta();return Aa(jt)||w_(jt)?(ut.preventDefault(),k.dispatchCommand(__,!1)):!1},vi);return k?.registerNodeTransform(ihe,ut=>{ut.getFormat()!==0&&ut.setFormat(0)}),k?.registerNodeTransform(lhe,ut=>{if(ut.getChildrenSize()>1){const bt=ut.getChildren(),jt=KS();bt.forEach(pt=>{che(pt)&&(jt.getChildren().length&&jt.append(B7()),pt.getChildren().forEach(Kt=>{(_m(Kt)||wm(Kt)||U7(Kt)||V7(Kt))&&jt.append(Kt)}))}),ut.clear().append(jt).selectEnd()}}),k?.registerNodeTransform(uhe,ut=>{const bt=ut.getParent();bt instanceof lV&&(ut.getChildren().forEach(pt=>{bt.append(pt)}),ut.remove())}),()=>{Me?.(),Ve?.(),ct?.(),vt?.(),Dt?.(),ot?.(),$t?.(),fn?.()}},[k,_e]),d.useEffect(()=>{const Me=k?.registerCommand(dhe,Ve=>!Ve||$.current&&!$.current.canSubmit()?!1:(bh(Ve,{isMobileUserAgent:y,isComposing:R.current,onKeyDown:te.current}),Ve.defaultPrevented),vi);return()=>{Me?.()}},[k,Ge,y]);const mt=d.useMemo(()=>({namespace:b,onError:pe,nodes:aQ,theme:{link:"text-super hover:underline",text:{strikethrough:"line-through"}},editable:!r}),[b,pe,r]),Qe=d.useMemo(()=>({minHeight:`${(i??1)*1.5}em`}),[i]),Tt=d.useMemo(()=>l.jsx("div",{className:le,children:t}),[t,le]),Ye=d.useMemo(()=>l.jsx(fhe,{className:ee,"aria-placeholder":t,placeholder:Tt,"data-test-id":x,id:v}),[v,t,Tt,ee,x]);return d.useMemo(()=>l.jsx("div",{className:X,children:l.jsx("div",{className:"w-full",style:Qe,ref:N,onClick:ht,children:l.jsxs(mhe,{initialConfig:mt,children:[l.jsx(phe,{contentEditable:Ye,ErrorBoundary:Ar}),l.jsx(j7e,{}),l.jsx(I7e,{onChange:De,ignoreSelectionChange:!0}),l.jsx(P7e,{editorRef:I}),l.jsx(O7e,{ref:$,onClose:Ge,onOpen:Ae,options:_,onTrigger:C}),l.jsx(L7e,{}),l.jsx(F7e,{}),l.jsx(hhe,{}),l.jsx(B7e,{transformers:iQ})]})})}),[X,Qe,ht,mt,Ye,De,Ge,Ae,_,C])},FA=e=>{const t=e.useLexical?W7e:V7e;return l.jsx(t,{...e})},dQ=T.memo(({children:e})=>{const{state:t}=d.useContext(Sg),{isExpanded:n}=t;return e!==null?l.jsx("div",{className:z(...br.attribution.left.base,{[br.attribution.left.expanded]:n,[br.attribution.left.compact]:!n}),children:e}):null});dQ.displayName="LeftAttribution";const cE=T.memo(({isLoading:e,children:t})=>{const{state:n}=d.useContext(Sg),{isExpanded:r}=n;return l.jsxs("div",{className:z(...br.attribution.right.base,{[br.attribution.right.expanded]:r,[br.attribution.right.compact]:!r}),children:[e?l.jsx(V,{color:"light",className:"mr-3",children:l.jsx(ge,{icon:B("loader-2"),size:"xs",className:"animate-spin"})}):null,t]})});cE.displayName="RightAttribution";const G7e=({showFileUpload:e,handleFileInput:t,onFilePickerOpen:n,screenshotToolEnabled:r,isFollowUp:s})=>!e||!t?null:l.jsx(MY,{handleFileInput:t,onFilePickerOpen:n,screenshotToolEnabled:r,isFollowUp:s}),$7e=({showIncognitoHint:e,showSearchModeSelector:t=!0,isFollowUp:n,layoutKey:r,showFileUpload:s=!1,handleFileInput:o,onFilePickerOpen:a})=>{const{screenshotToolEnabled:i}=zn();return l.jsx(dQ,{children:l.jsx("div",{className:"gap-xs flex items-center",children:l.jsx(G7e,{showFileUpload:s,handleFileInput:o,onFilePickerOpen:a,screenshotToolEnabled:i,isFollowUp:n})})})},fQ=T.memo($7e);fQ.displayName="AskInputLeftAttribution";const q7e=({uploadedFiles:e,selectedModel:t,onModelSwitch:n})=>{const{$t:r}=J(),{hasAccessToProFeatures:s}=Bt(),{openToast:o}=pn(),{getModelConfig:a}=H4(),i=d.useRef(null);d.useEffect(()=>{const c=e?.some(h=>Tr(h.file.name))??!1,f=a(t)?.textOnlyModel===!0;if(!c||!f){i.current=null;return}if(i.current===t)return;const m=r({defaultMessage:"{modelName} does not support images. Switched to the default best model.",id:"Dtdtsbnc5W"},{modelName:r(Jn[t].name)});o({message:m,variant:"warning",timeout:null});const p=s?ie.PRO:ie.DEFAULT;i.current=t,n(p)},[e,t,a,o,r,n,s])},K7e=(e,t)=>{const{value:n,loading:r}=Tf({flag:"model-outage-on-model-selector-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Lu=Ue({reasoning:{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"},max:{defaultMessage:"max",id:"+LmzMnWE+j"},new:{defaultMessage:"new",id:"qlTe+eC7Ec"},research:{defaultMessage:"Research",id:"JEe7dVso7F"},labs:{defaultMessage:"Labs",id:"ylFNoY79wa"}}),Y7e=W({defaultMessage:"Temporary degraded performance",id:"Kc/pdbXoxJ"}),Q7e=W({defaultMessage:"{modelName} is a text only model. Remove image attachments to use this model.",id:"8Z6XFIwTW6"}),X7e=e=>{const{label:t,subheading:n,nonReasoningModel:r,reasoningModel:s,selected:o,variant:a,badgeText:i,notice:c,onChange:u,tooltipText:f,disabled:m}=e,{$t:p}=J(),h=d.useCallback(()=>{if(m)return;const _=r??s;if(!_){Wc.error("ModelMenuItem: No model to select",{searchModel:r,reasoningModel:s});return}u(_)},[u,r,s,m]),g=d.useCallback(()=>{!s||!r||u(s===o?r:s)},[u,s,r,o]),y=!r,x=o===r||o===s,v=p({defaultMessage:"{modelName} does not support images. Remove image attachments to use this model.",id:"SQsP6RyVGS"},{modelName:t}),b=y?v:void 0;return l.jsxs(K,{variant:x?"subtler":void 0,className:"rounded-lg",children:[l.jsx(SA,{text:t,description:n,role:"menuitem",active:x,activeColor:a,badge:i,badgeVariant:a==="max"?"maxBorder":"superBorder",onClick:h,tooltipText:f,disabled:m}),x&&c&&l.jsx(V,{className:"max-w-44 px-2 py-1 text-left",variant:"tinyRegular",color:"red",children:c}),x&&s&&l.jsx(EA,{selected:o===s,text:p({defaultMessage:"With reasoning",id:"xwd+5Brxnr"}),role:"menuitem",active:o===s,activeColor:a,onClick:g,disabled:y,tooltipText:b,switchVariant:a})]})},mQ=({currentModel:e,onModelSelect:t,origin:n,disableTextOnlyModels:r=!1})=>{const s="use-model-menu-items-with-reasoning",{$t:o}=J(),{isMax:a,isPro:i,hasAccessToProFeatures:c}=Bt(),{organization:u}=mo({reason:s}),{isMaxUpsellEnabled:f}=Gx(),{specialCapabilities:m}=Qr(),p=Vt(),{openVisitorLoginUpsell:h}=di({enabled:!p}),g=mu(),y=d.useRef(null),{models:x,getModelConfig:v}=H4(),{modelSpecificLimits:b}=Fn(),{variation:_}=K7e({}),w=m.maxModelSelection||f||a,S=u?.settings?.disabled_model_preferences??Ie,C=d.useCallback(D=>{y.current=D,t(D)},[t]),E=d.useCallback(D=>D&&S.includes(D),[S]),N=d.useCallback(D=>th(D)||v(D)!==void 0,[v]),k=d.useMemo(()=>({type:"custom",text:o(Jn[ie.PRO].name),children:l.jsx(Rc,{type:"default",size:"small",text:o(Jn[ie.PRO].name),tooltipText:o(Jn[ie.PRO].description),active:th(e),onClick:()=>{C(ie.PRO)}})}),[e,C,o]),I=d.useMemo(()=>{const D=o({defaultMessage:"Upgrade for best models",id:"sy/65ilMNl"}),P=o({defaultMessage:"Get access to premium models by upgrading your subscription.",id:"20F8GxfYaR"});return{type:"custom",text:D,children:l.jsx(Rc,{type:"default",size:"small",text:D,tooltipText:P,onClick:()=>{if(!p){const F=new URL(window.location.href);F.searchParams.set("upsell","models"),h({title:o({defaultMessage:"Sign in to choose a model",id:"BhbQUiYsTB"}),description:o({defaultMessage:"Access the latest AI models from Perplexity, OpenAI, Anthropic (Claude), Google Gemini and more",id:"DDVABeGeBG"}),origin:lt.MODEL_SELECTOR,overrideRedirectUrl:F.toString()});return}g({pitchMessage:{title:o({defaultMessage:"Upgrade to choose a model",id:"BhzpKf2MS5"}),description:o({defaultMessage:"With Perplexity Pro, you get access to all the latest AI models in one subscription",id:"gqUZUJex7f"})},origin:n??lt.MODEL_SELECTOR})}})}},[o,p,h,g,n]),M=c?k:I,A=d.useMemo(()=>{const D={type:"separator",show:!0},F=x.filter(R=>!(!w&&R.subscriptionTier===cr.MAX||E(R.nonReasoningModel)&&E(R.reasoningModel))).map(R=>{const j=E(R.nonReasoningModel)?null:R.nonReasoningModel,L=E(R.reasoningModel)?null:R.reasoningModel;if(!j&&!L)return null;const O=!!(j&&_[j]||L&&_[L])?o(Y7e):void 0,$=r&&R.textOnlyModel===!0,G=$?o(Q7e,{modelName:o(R.label)}):o(R.description),H=()=>{if(R.subheading)return o(R.subheading);if(i&&R.subscriptionTier===cr.MAX&&[R.nonReasoningModel,R.reasoningModel].filter(X=>X!==null).some(X=>(b?.[X]??0)>0))return o({defaultMessage:"Trial access with Pro plan",id:"52XybSYuLP"})},Q=R.subscriptionTier===cr.MAX,Y=Q?"max":"super",te=Q?Lu.max:R.hasNewTag?Lu.new:void 0;return{type:"custom",text:o(R.label),children:l.jsx(X7e,{label:o(R.label),subheading:H(),selected:e,nonReasoningModel:j,reasoningModel:L,notice:O,variant:Y,badgeText:te?o(te):void 0,onChange:C,tooltipText:G,disabled:$})}}).filter(R=>R!==null);if(n===lt.RETRY_BUTTON){const R={type:"custom",text:o(Lu.research),children:l.jsx(Rc,{type:"default",size:"small",icon:wM,text:o(Lu.research),active:e===ie.ALPHA,onClick:()=>C(ie.ALPHA)})},j={type:"custom",text:o(Lu.labs),children:l.jsx(Rc,{type:"default",size:"small",text:o(Lu.labs),icon:_M,active:e===ie.BETA,onClick:()=>C(ie.BETA)})};return[R,j,D,M,...F]}return[M,D,...F]},[o,n,e,w,E,_,C,x,M,r,i,b]);return d.useMemo(()=>({menuItems:A,isSupportedModel:N}),[A,N])},Z7e=Ue({chooseModel:{defaultMessage:"Choose a model",id:"fXlc3idTcy"}}),pQ=d.memo(({isOpen:e,onOpen:t,onClose:n,selectedModel:r,onModelChange:s,uploadedFiles:o})=>{const{$t:a}=J(),{isMax:i}=Bt(),{onActiveMenuChange:c}=Po(),{activeMenu:u}=Kr(),f=zo(),{configuredModel:m}=Fn(),p=Kf(),{isMobileStyle:h}=Re(),g=f===oe.SEARCH,y=d.useCallback(F=>{p(F,f)},[p,f]),x=d.useCallback(()=>{c(lr.SEARCH_MODEL_SELECTOR)},[c]),v=d.useCallback(()=>{c(null)},[c]),b=r??m,_=s??y,w=e??u===lr.SEARCH_MODEL_SELECTOR,S=t??x,C=n??v,N=!!mn()?.get("openSearchModeSelector");d.useEffect(()=>{N&&x()},[N,x]);const k=d.useCallback(F=>p(F,f),[p,f]);q7e({uploadedFiles:o,selectedModel:b,onModelSwitch:k});const I=d.useMemo(()=>o?.some(F=>Tr(F.file.name))??!1,[o]),{menuItems:M}=mQ({currentModel:b,onModelSelect:_,disableTextOnlyModels:I}),A=d.useMemo(()=>th(b),[b]),D=d.useMemo(()=>({className:z("max-h-[40vh]",{"max-super-override":i})}),[i]),P=d.useCallback(()=>l.jsx("span",{className:z({"text-super":!A}),children:l.jsx(Jt,{icon:B("cpu"),size:"small"})}),[A]);return l.jsx(Hx.Slide,{isVisible:g,children:l.jsx(Ws,{placement:"bottom-end",boxProps:D,items:M,isMobileStyle:h,isOpen:w,onOpen:S,onClose:C,children:l.jsx(Ct,{variant:"text",size:"small",icon:P,"aria-label":a(A?Z7e.chooseModel:Jn[b].name)})})})});pQ.displayName="SearchModelSelector";const hQ=T.memo(({children:e,focusItems:t,placement:n,width:r="200px",isMobileStyle:s,isOpen:o=!1,onOpen:a,onClose:i,menuType:c=lr.FOCUS,isSpace:u=!1})=>{const{$t:f}=J(),{isMax:m}=Bt(),p=J(),h=d.useMemo(()=>{switch(c){case lr.RECENCY:return f({defaultMessage:"Choose recency",id:"qyxEklVz9W"});case lr.SOURCES:default:return f({defaultMessage:"Choose sources",id:"5HzLAl6K6z"})}},[c,f]),g=d.useCallback(_=>{_?.stopPropagation(),a?.()},[a]),y=d.useCallback(()=>{i?.()},[i]),x=d.useMemo(()=>l.jsx("div",{className:"gap-x-xs p-sm bg-subtle flex items-center justify-center rounded-t-xl text-center",children:l.jsx(V,{color:"light",variant:"tinyRegular",children:l.jsxs("div",{className:"gap-x-sm flex items-center",children:[l.jsx(ge,{icon:Zh,size:"xs"}),p.formatMessage({defaultMessage:"Search includes all context from this space.",id:"uhJN0zDnSy"})]})})}),[p]),v=d.useMemo(()=>({width:r}),[r]),b=d.useMemo(()=>l.jsxs(K,{className:z("flex flex-col",{"max-h-[37vh]":u,"max-h-[42vh]":!u,"max-super-override":m}),style:v,children:[u&&c===lr.SOURCES&&x,l.jsx(nl,{orientation:"vertical",showIndicatorOnHover:!1,className:z("min-h-0 flex-1 overflow-auto",{"p-xs":u&&c===lr.SOURCES}),children:l.jsx(yh,{items:t,disableScrollArea:!0})})]}),[x,t,u,c,v,m]);return s?l.jsxs(l.Fragment,{children:[l.jsx(po,{title:h,titleTextVariant:"baseSemi",variant:"bottom-left-sheet",actionList:Ie,isOpen:o,onClose:y,noPadding:!0,children:l.jsx(yh,{textColor:"light",items:t})}),l.jsx("span",{onClick:g,children:e})]}):l.jsx(zf,{isFileSearchEnabled:!0,isOpen:o,placement:n,onClose:y,onOpen:g,avoidSizeCollisions:!1,contentClassName:u&&c===lr.SOURCES?"!p-0":"",content:b,hasInteractiveContent:!0,children:e})});hQ.displayName="FocusDropdown";const gQ=T.memo(({isOpen:e,onOpen:t,onClose:n})=>{const r="recency-switcher",{$t:s}=J(),o=J(),{isMobileStyle:a}=Re(),i=iu(),{session:c}=je(),{trackEvent:u}=Ke(c),{sources:f,recency:m,setRecency:p}=Fn(),h=Array.isArray(i?.slug)?i.slug[0]:i?.slug,{collection:g}=W4({collectionSlug:h,reason:r}),y=g?.focused_web_config?.link_configs??Ie,x=f&&f.includes("web"),v=f&&y.length>0,b=!x&&!v,w=f&&f.includes("crunchbase")?!0:b,S=d.useCallback(N=>{p(N),u("search recency click",{recency:N}),n()},[u,p,n]),C=d.useMemo(()=>[{value:null,label:s({defaultMessage:"All Time",id:"52UMW3b1Z0"})},{value:"DAY",label:s({defaultMessage:"Today",id:"zWgbGgjUUg"})},{value:"WEEK",label:s({defaultMessage:"Last Week",id:"P3YB9A5Yho"})},{value:"MONTH",label:s({defaultMessage:"Last Month",id:"cfMkrE1iIn"})},{value:"YEAR",label:s({defaultMessage:"Last Year",id:"7PhUtcTRXC"})}],[s]),E=d.useMemo(()=>C.map(N=>({type:"default",text:N.label,active:m===N.value,onClick:()=>S(N.value)})),[C,m,S]);return l.jsx(hQ,{focusItems:E,placement:"bottom-start",width:"200px",isMobileStyle:a,isOpen:e,onOpen:t,onClose:n,menuType:lr.RECENCY,children:l.jsx(rt,{toolTip:o.formatMessage({defaultMessage:"Set recency for web search",id:"3/OG+oV8gT"}),size:"small",icon:B("clock"),disabled:w})})});gQ.displayName="RecencySwitcher";function yQ(e,t){const n=e===t.non_reasoning_model||e===t.reasoning_model,r=e===t.reasoning_model;return{selected:n,reasoning:r}}const xQ=d.memo(({modelConfig:e})=>{const{isMax:t}=Bt();if(e.has_new_tag){const n=l.jsx(uE,{children:l.jsx(Ne,{defaultMessage:"new",id:"qlTe+eC7Ec"})});return e.subscription_tier==="max"?l.jsx("span",{className:"max-super-override",children:n}):n}return e.subscription_tier==="max"&&!t?l.jsx("span",{className:"max-super-override",children:l.jsx(uE,{children:l.jsx(Ne,{defaultMessage:"max",id:"+LmzMnWE+j"})})}):null});xQ.displayName="SearchModelMenuItemBadge";const uE=d.memo(({children:e})=>l.jsx("div",{className:"px-xs rounded-badge -mt-px box-border inline-flex border-super border text-super text-xs leading-4 font-medium",children:e}));uE.displayName="Badge";const vQ=d.memo(({checked:e,onCheckedChange:t,modelConfig:n,...r})=>{const{$t:s}=J(),o=d.useMemo(()=>!n?.non_reasoning_model||!n?.reasoning_model,[n]);if(o){const a=s({defaultMessage:"{modelName} does not support reasoning",id:"WDQ/SkrhHE"},{modelName:n.label??"This model"}),i=s({defaultMessage:"{modelName} is a reasoning-only model",id:"VZp68/aGTi"},{modelName:n.label??"This model"}),c=e?i:a;return l.jsx(Hs,{content:c,side:"left",children:l.jsx(Sj,{checked:e,onCheckedChange:t,disabled:o})})}return l.jsx(Sj,{checked:e,onCheckedChange:t,disabled:o,...r})});vQ.displayName="SearchModelReasoningMenuItem";const Sj=({checked:e,onCheckedChange:t,disabled:n,...r})=>l.jsx(_t.SwitchItem,{checked:e,onCheckedChange:t,disabled:n,...r,children:l.jsx(Ne,{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"})}),BA=d.memo(({selection:e,modelConfig:t,onSelect:n,...r})=>{const{isMax:s}=Bt(),o=e.selected&&t.reasoning_model,a=d.useCallback(()=>{const u=t.non_reasoning_model??t.reasoning_model;if(!u){Z.warn("[SearchModelMenuItem] No model to select",{modelConfig:t});return}n(u)},[t,n]),i=d.useCallback(u=>{const f=u?t.reasoning_model:t.non_reasoning_model;if(!f){Z.warn("[SearchModelMenuItem] No model to select for reasoning change",{modelConfig:t,reasoning:u});return}n(f)},[t,n]),c=l.jsxs("div",{className:z("rounded-lg",{"bg-subtle":e.selected}),children:[l.jsx(_t.RadioItem,{checked:e.selected,onCheckedChange:a,subtitle:t.subheading??void 0,...r,children:l.jsxs("div",{className:"flex items-center gap-sm",children:[l.jsx("span",{className:z({"text-super":e.selected,"max-super-override":s}),children:t.label}),l.jsx(xQ,{modelConfig:t})]})}),o&&l.jsx(vQ,{checked:e.reasoning,modelConfig:t,onCheckedChange:i})]});return t.description?l.jsx(Hs,{content:t.description,side:"left",children:l.jsx("div",{children:c})}):c});BA.displayName="SearchModelMenuItem";const Ej=Ue({bestLabel:{defaultMessage:"Best",id:"PzlMqGwwkm"},bestDescription:{defaultMessage:"Automatically selected best model",id:"K44CS/0jKm"}}),bQ=d.memo(({selectedModel:e,onModelChange:t})=>{const{$t:n}=J(),{hasAccessToProFeatures:r}=Bt(),s=Vt(),{openVisitorLoginUpsell:o}=di({enabled:!s}),a=mu(),i=d.useMemo(()=>l.jsx(_t.Item,{onSelect:()=>{if(!s){const f=new URL(window.location.href);f.searchParams.set("upsell","models"),o({title:n({defaultMessage:"Sign in to choose a model",id:"BhbQUiYsTB"}),description:n({defaultMessage:"Access the latest AI models from Perplexity, OpenAI, Anthropic (Claude), Google Gemini and more",id:"DDVABeGeBG"}),origin:lt.MODEL_SELECTOR,overrideRedirectUrl:f.toString()});return}a({pitchMessage:{title:n({defaultMessage:"Upgrade to choose a model",id:"BhzpKf2MS5"}),description:n({defaultMessage:"With Perplexity Pro, you get access to all the latest AI models in one subscription",id:"gqUZUJex7f"})},origin:lt.MODEL_SELECTOR})},children:n({defaultMessage:"Upgrade for best models",id:"sy/65ilMNl"})}),[n,s,o,a]),c=d.useMemo(()=>({label:n(Ej.bestLabel),non_reasoning_model:ie.PRO,reasoning_model:null,description:n(Ej.bestDescription),has_new_tag:!1,subscription_tier:null,text_only_model:!1}),[n]),u=d.useMemo(()=>l.jsx(BA,{selection:yQ(e,c),modelConfig:c,onSelect:t}),[e,c,t]);return r?u:i});bQ.displayName="SearchModelMenuItemBest";const J7e=200,kj=Ue({chooseModel:{defaultMessage:"Choose model",id:"+mvQfVYQ1f"},selectedModel:{defaultMessage:"Selected model",id:"O+3LDIMB/r"}}),_Q=d.memo(({isOpen:e,onToggle:t,model:n,onModelChange:r})=>{const s="search-model-menu",[o,a]=d.useState(!1),{$t:i}=J(),{config:c,getModelLabel:u}=Cz({reason:s}),f=th(n),{gateSearchModelSelection:m}=qf(),p=e??o,h=t??a,g=d.useCallback(()=>l.jsx("span",{className:z({"text-super":!f}),children:l.jsx(Jt,{icon:B("cpu"),size:"small"})}),[f]),y=d.useCallback(v=>{m(v)||r(v)},[m,r]),x=d.useMemo(()=>l.jsx(Ct,{variant:"text",size:"small",icon:g,"aria-label":f?i(kj.chooseModel):u(n,i(kj.selectedModel))}),[i,u,g,f,n]);return l.jsxs(_t,{isOpen:p,onToggle:h,minWidthPx:J7e,triggerElement:x,children:[l.jsx(bQ,{selectedModel:n,onModelChange:y}),l.jsx(_t.Separator,{}),c.map(v=>l.jsx(BA,{selection:yQ(n,v),modelConfig:v,onSelect:y},v.label))]})});_Q.displayName="SearchModelMenu";function eRe(e){for(var t=[],n=1;n1?!0:(t.preventDefault&&t.preventDefault(),!1)}var Tj=nRe&&window.navigator&&window.navigator.platform&&/iP(ad|hone|od)/.test(window.navigator.platform),Fu=new Map,Aj=typeof document=="object"?document:void 0,q0=!1;const rRe=Aj?function(t,n){t===void 0&&(t=!0);var r=d.useRef(Aj.body);n=n||r;var s=function(a){var i=Fu.get(a);i?Fu.set(a,{counter:i.counter+1,initialOverflow:i.initialOverflow}):(Fu.set(a,{counter:1,initialOverflow:a.style.overflow}),Tj?q0||(eRe(document,"touchmove",Mj,{passive:!1}),q0=!0):a.style.overflow="hidden")},o=function(a){var i=Fu.get(a);i&&(i.counter===1?(Fu.delete(a),Tj?(a.ontouchmove=null,q0&&(tRe(document,"touchmove",Mj),q0=!1)):a.style.overflow=i.initialOverflow):Fu.set(a,{counter:i.counter-1,initialOverflow:i.initialOverflow}))};d.useEffect(function(){var a=dE(n.current);a&&(t?s(a):o(a))},[t,n.current]),d.useEffect(function(){var a=dE(n.current);if(a)return function(){o(a)}},[])}:function(t,n){},Nj="google-drive-picker-gapi-script",Rj="google-identity-services-script",sRe=Sf(async function(){if(!document.getElementById(Rj))return new Promise((t,n)=>{const r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.id=Rj,r.onload=()=>t(),r.onerror=n,document.body.appendChild(r)})}),oRe=Sf(async function(){if(!document.getElementById(Nj))return new Promise((t,n)=>{const r=document.createElement("script");r.src="https://apis.google.com/js/api.js",r.id=Nj,r.onload=()=>{window.gapi.load("picker",{callback:t,onerror:n})},r.onerror=n,document.body.appendChild(r)})}),aRe=["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/drive.metadata.readonly"].join(" "),iRe=["application/vnd.google-apps.file","application/vnd.google-apps.folder","application/vnd.google-apps.document","application/vnd.google-apps.presentation","application/vnd.google-apps.spreadsheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","application/pdf","text/csv","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/markdown"],lRe=["text/plain","application/pdf","text/csv","text/markdown","image/png","image/jpeg","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.google-apps.document","application/vnd.google-apps.presentation","application/vnd.google-apps.spreadsheet"],cRe=["audio/mpeg","audio/wav","audio/aiff","audio/ogg","audio/flac","audio/mp3","video/mp4","video/mpeg","video/mov","video/avi","video/x-flv","video/mpg","video/webm","video/wmv","video/3gpp","video/quicktime"],wQ=({isAudioVideoFilesEnabled:e,onError:t})=>{const[n,r]=d.useState(!1),{openToast:s}=pn(),{$t:o}=J();rRe(n);const a=d.useCallback((c,u)=>{const f=window.google?.picker,m=p=>{p.action===f.Action.PICKED?u.onPicked&&u.onPicked(p.docs??Ie):(p.action===f.Action.CANCEL||p.action===f.Action.ERROR)&&(p.action===f.Action.CANCEL&&u.onCancel&&u.onCancel(),r(!1))};if(f)try{const p=new f.DocsView().setIncludeFolders(!0).setSelectFolderEnabled(!0).setMode(f.DocsViewMode.LIST),h=new f.ViewGroup(p);let g=u.mode==="source"?iRe:lRe;g=e?g.concat(cRe):g,new f.PickerBuilder().setSize(1051,650).addViewGroup(h).setSelectableMimeTypes(g.join(",")).enableFeature(f.Feature.MULTISELECT_ENABLED).setOAuthToken(c).setCallback(m).build().setVisible(!0),r(!0)}catch{t?.()}},[e,t]),i=d.useCallback(async c=>{try{await Promise.all([oRe(),sRe()])}catch{t?.();return}window.google.accounts.oauth2.initTokenClient({client_id:c.clientId,login_hint:c.loginHint,scope:aRe,prompt:"none",callback:f=>{if(f.error!==void 0)throw new Error(f.error);if(!f.access_token){s({message:o({defaultMessage:"Failed to open Google Drive file picker. If this problem persists, please try reconnecting your Google Drive account.",id:"UK5gaMQa5o"}),variant:"error",timeout:5}),Z.warn("[Google Drive Picker] No access token received."),t?.();return}try{a(f.access_token,c)}catch(m){console.log(m)}}}).requestAccessToken()},[a,t,o,s]);return d.useMemo(()=>({openPicker:i}),[i])},uRe=({connectorId:e,onFilesSelected:t})=>{const n="sources-menu-attach-file-connector",{openPicker:r}=dRe({onSelectFiles:t,reason:n}),s=d.useCallback(()=>{switch(e){case"google_drive":r();break;default:throw new Error(`Connector ${e} not implemented`)}},[e,r]);return d.useMemo(()=>({openFilePicker:s}),[s])},dRe=({onSelectFiles:e,reason:t})=>{const{connectorsMap:n}=Rf({reason:t,skipConnectorPickerCredentials:!1}),{openPicker:r}=wQ({isAudioVideoFilesEnabled:!0}),s=d.useCallback(()=>{r({clientId:n?.google_drive?.picker_credentials?.client_id??"",loginHint:n?.google_drive?.connection_display_name??"",mode:"attachment",onPicked:e})},[r,e,n]);return d.useMemo(()=>({openPicker:s}),[s])},UA=T.memo(({size:e="medium",user:t,showEdit:n,onChange:r,anon:s,altText:o,defaultIcon:a=B("user-filled"),rounded:i=!0,showBackground:c=!0,showProBadge:u,showMaxBadge:f,className:m,badgeProps:p})=>{const h=s?B("sunglasses-filled"):a,g=d.useCallback(()=>{const y=document.createElement("input");y.type="file",y.accept="image/*",y.onchange=x=>{const v=x.target.files?.[0];if(v){const b=new FileReader;b.onload=_=>{r&&r(_.target?.result)},b.readAsDataURL(v)}},y.click()},[r]);return l.jsx("div",{className:z("text-inverse relative",m),children:l.jsxs("div",{className:z("relative flex aspect-square shrink-0 items-center justify-center",c?"bg-subtler":"bg-transparent",{"rounded-full":i,"size-3":e==="tiny","size-4":e==="mini","size-5":e==="small","size-6":e==="base","size-8":e==="medium","size-10":e==="large","size-20":e==="xlarge","ring-super border-inverse border-2 ring-[1.5px]":u,"ring-max border-inverse border-2 ring-[1.5px]":f}),children:[p?.show&&l.jsx("div",{className:z("absolute right-0 top-0 size-3 -translate-y-1/4 translate-x-1/4 select-none rounded-full border-2",p?.className)}),t&&!s?l.jsx("img",{alt:o??"User avatar",className:z("size-full object-cover",{"rounded-full":i}),src:t}):l.jsx(V,{color:"light",className:"flex items-center justify-center",children:l.jsx(ft,{name:h,className:"size-[65%]"})}),n&&e!=="small"&&l.jsx("div",{className:"bg-base absolute -bottom-1 -right-2 rounded-full",children:l.jsx(ze,{ariaLabel:"Edit avatar",variant:t?"common":"primary",size:e!=="xlarge"?"tiny":"small",pill:!0,icon:t?B("edit"):B("plus"),onClick:g})}),u&&l.jsx("div",{className:z("absolute top-full mt-[-6px] w-[24px] rounded-r-full bg-current p-[1.5px] [&>div]:w-full",{"opacity-0":e==="small"},{"w-lg mt-[-10px]":e==="xlarge"}),children:l.jsx($d,{size:"tiny",color:"super",variant:"pro",isPro:!0})}),f&&l.jsx("div",{className:z("absolute left-1/2 top-full mt-[-6px] flex w-[28px] -translate-x-1/2 items-center justify-center rounded-r-full bg-current p-[1.5px] [&>div]:w-full",{"opacity-0":e==="small"},{"w-xl mt-[-10px]":e==="xlarge"}),children:l.jsx($d,{size:"small",variant:"max",isMax:!0})})]})})});UA.displayName="Avatar";const fRe=({cometMcpSources:e})=>{const t=J();return d.useCallback(r=>{if(Wi(r))return Qx[r].icon;if(fu(r))return mRe(r,t);if(Za(r)){const s=If(r);return()=>e[s]?.avatar}},[t,e])};function mRe(e,t){const n=Of(e);if(!n)return;const r=Tc(e),s=t.formatMessage({id:"egoZUguuZl",defaultMessage:"{name} logo"},{name:r});return()=>l.jsx(UA,{user:n,size:"mini",rounded:!1,showBackground:!1,altText:s})}const sc=()=>{const{cometMcpSources:e}=Df(),t=NW({cometMcpSources:e}),n=fRe({cometMcpSources:e});return d.useMemo(()=>({getSourceLabel:t,getSourceIcon:n}),[t,n])},CQ=T.memo(({connectorId:e,connected:t})=>{const n="sources-menu-attach-file-connector",{getSourceLabel:r,getSourceIcon:s}=sc(),{handleConnect:o}=iT({reason:n}),a=Ln(),{openFilePicker:i}=uRe({connectorId:e,onFilesSelected:()=>{throw new Error("Not implemented")}}),c=d.useCallback(()=>{if(!t){o({connectorName:e,redirectPath:a||void 0,unauthedRedirectPath:a||void 0});return}i()},[t,e,o,a,i]),u=r(e),f=s(e),m=t?void 0:l.jsx(Jt,{icon:B("arrow-up-right"),size:"small"});return l.jsx(_t.Item,{onSelect:c,leadingAccessory:f,trailingAccessory:m,children:u})});CQ.displayName="SourcesMenuAttachFileConnector";const SQ=zt("SourcesMenuFileInputContext",null);function pRe(){const e=d.useContext(SQ);if(!e)throw new Error("useSourcesMenuFileInput must be used within SourcesMenuFileInputProvider");return e}const EQ=T.memo(({children:e})=>{const t=d.useRef(null),n=d.useCallback(()=>{t.current?.click()},[]),r=d.useCallback(o=>{const a=o.target.files;if(a&&a.length>0)throw new Error("Not implemented");t.current&&(t.current.value="")},[]),s=d.useMemo(()=>({open:n}),[n]);return l.jsxs(SQ.Provider,{value:s,children:[l.jsx("input",{ref:t,type:"file",multiple:!0,accept:bV,style:{display:"none"},onChange:r}),e]})});EQ.displayName="SourcesMenuFileInputProvider";const hRe={defaultMessage:"Local files",id:"xMmQ4F7z3A"},fE=T.memo(({label:e=hRe})=>{const{open:t}=pRe();return l.jsx(_t.Item,{onSelect:t,leadingAccessory:B("paperclip"),children:l.jsx(Ne,{...e})})});fE.displayName="SourcesMenuAttachLocalFileMenuItem";function gRe(e){return e!=null}const Dj=W({defaultMessage:"Attach a file",id:"ydgifDAqLp"}),kQ=d.memo(()=>{const{connectorsMap:e}=Rf({reason:"sources-menu"}),t=d.useMemo(()=>LV.map(n=>{const r=e[n];return!r||!Fz(r.name)?null:l.jsx(CQ,{connectorId:r.name,connected:r.connected},n)}).filter(gRe),[e]);return t.length===0?l.jsx(fE,{label:Dj}):l.jsxs(_t.Submenu,{triggerElement:l.jsx(_t.SubmenuItem,{leadingAccessory:B("paperclip"),children:l.jsx(Ne,{...Dj})}),children:[l.jsx(fE,{}),t]})});kQ.displayName="SourcesMenuAttachFileMenuItem";const yRe=(e,t)=>{const n=t?.isOverlapping??!1,r=t?.stackDirection??"left";if(!e.length)return l.jsx(ge,{icon:SM,size:"sm"});const s=Math.max(1,t?.maxVisuals??3),o=f=>{if(!(!n||f))switch(t?.size){case"sm":return"-0.25rem";case"md":return"-0.375rem";case"lg":return"-0.5rem";case"xl":return"-0.625rem";default:return}},a=()=>{const f=z("relative flex items-center justify-center",{"rounded-full":t?.shape==="circle"||!t?.shape,"rounded-none":t?.shape==="square","size-4":t?.size==="sm","size-5":t?.size==="md","size-6":t?.size==="lg","size-7":t?.size==="xl"});return!n||!e||!(e.length>1||(t?.alwaysApplyOverlappingStyles??!1))?f:z(f,t?.overlappingClassName??"bg-base ring-subtlest",{"ring-1":t?.size==="sm"||t?.size==="md","ring-2":t?.size==="lg"||t?.size==="xl"})},i=(t?.showRemainderCount??!0)&&e.length>s,c=s===1&&e.length>1&&i?0:i?s-1:Math.min(s,e.length),u=e.slice(0,c).map((f,m)=>l.jsx("div",{className:a(),style:{zIndex:r==="left"?e.length-m-1:e.length+m,marginLeft:o(m===0)},children:f},m));return l.jsxs("div",{className:z("isolate",t?.containerClass??"my-xs flex items-center"),children:[l.jsxs("div",{className:t?.innerClassName??z("flex items-center",{"gap-2":!n}),children:[u,i&&l.jsx("div",{className:z(a(),{"mx-1":c===0}),style:{zIndex:r==="left"?-1:e.length+s,marginLeft:o(c===0)},children:l.jsxs(V,{variant:"tinyMono",color:"light",inline:!0,children:["+",e.length-c]})})]}),t?.rightText&&l.jsx("div",{className:"ml-2",children:t.rightText})]})},xRe=5;function vRe(e){return e!=null}const MQ=T.memo(({sources:e,size:t="default"})=>{const{getSourceIcon:n}=sc();if(e.length>0){const r=o=>{const a=n(o);return a?l.jsx(Jt,{icon:a,size:t},o):null},s=e.map(r).filter(vRe);return yRe(s,{isOverlapping:!0,maxVisuals:xRe,size:"md",stackDirection:"right",overlappingClassName:"overflow-hidden bg-base ring-subtlest"})}return l.jsx(Jt,{icon:SM,size:t})});MQ.displayName="SourcesMenuButtonContent";const TQ=T.memo(({sources:e,tooltip:t,size:n="default",disabled:r=!1,...s})=>{const{$t:o}=J(),a=wx({variant:"text",disabled:r,size:n,iconOnly:e.length===1}),i=l.jsx(jo,{"aria-label":o({defaultMessage:"Sources",id:"fhwTpAcBLC"}),className:a,disabled:r,...s,children:l.jsx(MQ,{sources:e,size:n})});return t?l.jsx(Hs,{content:t,children:i}):i});TQ.displayName="SourcesMenuButton";const AQ=d.memo(({source:e,enabled:t,onToggle:n})=>{const{cometMcpSources:r}=Df(),{getSourceLabel:s,getSourceIcon:o}=sc(),a=If(e),i=r[a];i||Z.error(`Server config not found for comet MCP source: ${e}`);const c=s(e),u=o(e),f=i?.description,m=l.jsx(_t.SwitchItem,{leadingAccessory:u,checked:t,onCheckedChange:n,disabled:i?.disabled,children:c});return f?l.jsx(Hs,{content:f,side:"right",children:m}):m});AQ.displayName="SourcesMenuItemCometMcpSource";var y2;(function(e){e.CONNECTED="connected",e.DISCONNECTED="disconnected"})(y2||(y2={}));const NQ={linear_alt:{name:"Linear",tagline:W({defaultMessage:"Plan and track projects, issues, and team workflows in Linear",id:"6u9Zf65BGW"}),bullets:[W({defaultMessage:"Search across Linear issues, projects, and teams",id:"MicGE6HssU"}),W({defaultMessage:"Create and update Linear issues and projects",id:"scUqB1LbKr"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Linear whenever you query in Perplexity",id:"b/8mLQxIqE"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.linear.app",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167711-linear-connector-for-enterprise-pro",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12167711-linear-connector-for-enterprise-pro",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},google_drive:{name:"Google Drive",tagline:W({defaultMessage:"Get in-depth answers from your Google Drive content",id:"CDmY5AQsRD"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Google Drive files are automatically synced to Perplexity",id:"k0B4qzv3NH"}),W({defaultMessage:"File and folder selection is based on your existing Google Drive permissions",id:"J1Fu/3n3pb"})],consumerBullets:[W({defaultMessage:"Attach files from Google Drive to your query",id:"aUk7jts0tb"})],connectedBullets:[W({defaultMessage:"File and folder selection is based on your existing Google Drive permissions",id:"J1Fu/3n3pb"}),W({defaultMessage:"Opt into High-Precision Search for even more comprehensive answers",id:"5Q/lMIa53X"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://drive.google.com",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12870620-connecting-perplexity-with-google-drive",documentationUrl:null,footnote:null},sharepoint:{name:"SharePoint",tagline:W({defaultMessage:"Get in-depth answers from your SharePoint content",id:"H/XGo2cLQi"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your SharePoint files are automatically synced to Perplexity",id:"3asA6JKlOn"}),W({defaultMessage:"File and folder selection is based on your existing SharePoint permissions",id:"m2/iFnRhkg"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://microsoft.sharepoint.com/",supportUrl:null,documentationUrl:null,footnote:null},onedrive:{name:"OneDrive",tagline:W({defaultMessage:"Get in-depth answers from your OneDrive content",id:"6HI2ZlxJGV"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your OneDrive files are automatically synced to Perplexity",id:"gCHhNKes4R"}),W({defaultMessage:"File and folder selection is based on your existing OneDrive permissions",id:"YCVPoXax40"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage",documentationUrl:null,supportUrl:null,footnote:null},box:{name:"Box",tagline:W({defaultMessage:"Get in-depth answers from your Box content",id:"vj5W7AIDE6"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Box files are automatically synced to Perplexity",id:"tkl3HRlwOf"}),W({defaultMessage:"File and folder selection is based on your existing Box permissions",id:"LuX1iT7lFa"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.box.com/",documentationUrl:null,supportUrl:null,footnote:null},dropbox:{name:"Dropbox",tagline:W({defaultMessage:"Get in-depth answers from your Dropbox content",id:"+RPvqEE51/"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Dropbox files are automatically synced to Perplexity",id:"Qnsbs8527p"}),W({defaultMessage:"File and folder selection is based on your existing Dropbox permissions",id:"kzOZ3ZFcW4"})],consumerBullets:[W({defaultMessage:"Attach files from Dropbox to your query",id:"E/rzAALT5B"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.dropbox.com/",documentationUrl:null,supportUrl:null,footnote:null},notion_mcp:{name:"Notion",tagline:W({defaultMessage:"Search and create content on your Notion pages",id:"rXdfDrSVlj"}),bullets:[W({defaultMessage:"Search across your pages and data ",id:"Ib2j2yH5wv"}),W({defaultMessage:"Create new pages in your teamspace from Perplexity",id:"Ltbp+B60OB"}),W({defaultMessage:"Update your data on existing pages directly from Perplexity",id:"ldpNlZAKLQ"}),W({defaultMessage:"Data is retrieved from and written back to Notion whenever you query in Perplexity",id:"nbLEAiWYzT"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.notion.so/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167654-notion-connector-for-enterprise-pro",footnote:null},github_mcp_direct:{name:"GitHub",tagline:W({defaultMessage:"Search and manage your GitHub repositories",id:"67uxBLu4RH"}),bullets:[W({defaultMessage:"Search, analyze, and summarize your repositories and issues",id:"hi8CvW/ld8"}),W({defaultMessage:"Create, update, and manage issues and pull requests ",id:"6eZgVvjZEw"}),W({defaultMessage:"Monitor workflows ",id:"EduR5immBI"}),W({defaultMessage:"Search and manage notifications to streamline communication",id:"+zOuCOpAH8"}),W({defaultMessage:"Data is retrieved from and written back to GitHub whenever you query in Perplexity",id:"9EQO9mj0sd"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://github.com/",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12275669-github-connector-for-enterprise",documentationUrl:null,footnote:null},asana_mcp_direct:{name:"Asana",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Asana",id:"9AhVP0Y+6c"}),bullets:[W({defaultMessage:"Search across Asana tasks, projects, and teams",id:"GKC+Sx/2dm"}),W({defaultMessage:"Create and update Asana tasks and projects",id:"TnQ0Far/ZY"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Asana whenever you query in Perplexity",id:"9NNVAEg7U3"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://asana.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",footnote:null},asana_mcp_merge:{name:"Asana",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Asana",id:"9AhVP0Y+6c"}),bullets:[W({defaultMessage:"Search across Asana tasks, projects, and teams",id:"GKC+Sx/2dm"}),W({defaultMessage:"Create and update Asana tasks and projects",id:"TnQ0Far/ZY"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Asana whenever you query in Perplexity",id:"9NNVAEg7U3"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://asana.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},atlassian_mcp_direct:{name:"Atlassian",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Atlassian",id:"OKCrVfJwqD"}),bullets:[W({defaultMessage:"Search across Atlassian tasks, projects, and teams",id:"3UDuuWRtR5"}),W({defaultMessage:"Create and update Atlassian tasks and projects",id:"u+44P4c8w+"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Atlassian whenever you query in Perplexity",id:"7gmOJCXim3"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/collections/15347354-app-connectors",footnote:null},jira_mcp_merge:{name:"Jira",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Jira",id:"DBNOet3M55"}),bullets:[W({defaultMessage:"Search across Jira tasks, projects, and teams",id:"nWIt8qYQz1"}),W({defaultMessage:"Create and update Jira tasks and projects",id:"mUCQ5Z26EF"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Jira whenever you query in Perplexity",id:"CfzDXfmKKD"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524825-connecting-perplexity-with-jira",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524825-connecting-perplexity-with-jira",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},confluence_mcp_merge:{name:"Confluence",tagline:W({defaultMessage:"Search and create content on your Confluence pages",id:"7maYua4COa"}),bullets:[W({defaultMessage:"Search across your pages and data ",id:"Ib2j2yH5wv"}),W({defaultMessage:"Create new pages in your teamspace from Perplexity",id:"Ltbp+B60OB"}),W({defaultMessage:"Update your data on existing pages directly from Perplexity",id:"ldpNlZAKLQ"}),W({defaultMessage:"Data is retrieved from and written back to Confluence whenever you query in Perplexity",id:"Ifp49Im16y"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524852-connecting-perplexity-with-confluence",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524852-connecting-perplexity-with-confluence",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},microsoft_teams_mcp_merge:{name:"Microsoft Teams",tagline:W({defaultMessage:"Search and send messages in Microsoft Teams",id:"Rfl+yanh+2"}),bullets:[W({defaultMessage:"Search across Microsoft Teams messages and channels",id:"LF+Ow88sFq"}),W({defaultMessage:"Send and receive messages in Microsoft Teams",id:"1t8qQ+bxf2"}),W({defaultMessage:"Data is retrieved from and written back to Microsoft Teams whenever you query in Perplexity",id:"+bTrwFjG66"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://teams.microsoft.com",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12674820-microsoft-teams-connector",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12674820-microsoft-teams-connector",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},slack_direct:{name:"Slack",tagline:W({defaultMessage:"Search and post messages across your Slack workspace",id:"eGJ5wb/MzJ"}),bullets:[W({defaultMessage:"Search messages across DMs, private channels, and public channels you have access to in Slack",id:"Om6FOnY7N3"}),W({defaultMessage:"Post messages directly to Slack",id:"UOgLjThccO"}),W({defaultMessage:"Data is retrieved from and written back to Slack whenever you run a query in Perplexity",id:"Fy/OA6Fd79"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://slack.com",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167980-using-the-connector-for-slack",documentationUrl:null,footnote:null},gcal:{name:"Gmail with Calendar",tagline:W({defaultMessage:"Search, create, and manage your emails and calendar events",id:"R3VofVJjT+"}),bullets:[W({defaultMessage:"Search your Gmail and calendar",id:"GCr38D/MA3"}),W({defaultMessage:"Draft and send emails",id:"rMtvi6WyKE"}),W({defaultMessage:"Manage and monitor emails and events",id:"p70DVe/3eQ"}),W({defaultMessage:"Create and update calendar events",id:"ZLhGXocN5/"}),W({defaultMessage:"Data is retrieved from and written back to Gmail and Gcal whenever you query in Perplexity",id:"HsjdaQ7NYa"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://accounts.google.com/InteractiveLogin?emr=1<mpl=default&nojavascript=1&rm=false&service=mail&ss=1",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12168040-connecting-perplexity-with-gmail-and-google-calendar",footnote:null},outlook:{name:"Outlook",tagline:W({defaultMessage:"Search your emails and calendar events",id:"zNVRcAj90b"}),bullets:[W({defaultMessage:"Search your Outlook e-mail and calendar",id:"z5Tw6ljNsF"}),W({defaultMessage:"Manage and monitor emails and events",id:"p70DVe/3eQ"}),W({defaultMessage:"Data is retrieved from and written back to Outlook whenever you query in Perplexity",id:"xX8KEtSv2M"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.microsoft.com/en-us/microsoft-365/outlook/log-in",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12301355-connecting-perplexity-with-outlook-com",footnote:null},zoom:{name:"Zoom",tagline:W({defaultMessage:"Create and manage your Zoom meetings",id:"92puu01bno"}),bullets:[W({defaultMessage:"Create and schedule Zoom meetings",id:"Hg2Nbj5f0/"}),W({defaultMessage:"Manage your Zoom meeting settings",id:"Tb/8DnYiVx"}),W({defaultMessage:"Data is retrieved from and written back to Zoom whenever you query in Perplexity",id:"91ZZe8Fgz9"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://zoom.us",documentationUrl:null,supportUrl:null,footnote:null},factset:{name:"FactSet",tagline:W({defaultMessage:"Access financial data and research from FactSet",id:"csQI8CVJ2n"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.factset.com",documentationUrl:null,supportUrl:null,footnote:null},crunchbase:{name:"Crunchbase",tagline:W({defaultMessage:"Access company and startup data from Crunchbase",id:"K/lfyKAVXx"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.crunchbase.com",documentationUrl:null,supportUrl:null,footnote:null},wiley:{name:"Wiley",tagline:W({defaultMessage:"Access academic research and publications from Wiley",id:"EpMrMGNDQ2"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.wiley.com",documentationUrl:null,supportUrl:null,footnote:null},edgar:{name:"EDGAR",tagline:W({defaultMessage:"Access SEC filings and corporate reports",id:"njDhAKsJmy"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.sec.gov/edgar",documentationUrl:null,supportUrl:null,footnote:null},linear:{name:"Linear",tagline:W({defaultMessage:"Get in-depth answers from your Linear content",id:"TDJJ2nF0Dy"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.linear.app",documentationUrl:null,supportUrl:null,footnote:null},slack:{name:"Slack",tagline:W({defaultMessage:"Get in-depth answers from your Slack content",id:"XRQBjZFm1m"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://slack.com",documentationUrl:null,supportUrl:null,footnote:null},wiley_mcp_cashmere:{name:"Wiley",tagline:W({defaultMessage:"Access academic research and publications from Wiley",id:"EpMrMGNDQ2"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.wiley.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},cbinsights_mcp_cashmere:{name:"CB Insights",tagline:W({defaultMessage:"Access market intelligence and company data",id:"ey7oCLYTbw"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.cbinsights.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},pitchbook_mcp_cashmere:{name:"PitchBook",tagline:W({defaultMessage:"Access private capital market data",id:"JWsOkBIFuV"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.pitchbook.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},statista_mcp_cashmere:{name:"Statista",tagline:W({defaultMessage:"Access market and consumer data",id:"XJHKfhIMA3"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.statista.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}}},bRe=e=>e in NQ,_Re=(e,t=y2.DISCONNECTED)=>{const{$t:n}=J(),r=uu(),{data:s}=X4(),o=d.useMemo(()=>s?.find(a=>a.id===e),[s,e]);return d.useMemo(()=>{if(bRe(e)){const{websiteUrl:a,documentationUrl:i,tagline:c,supportUrl:u="https://www.perplexity.ai/help-center/en/articles/10672063-introduction-to-file-connectors-for-enterprise-organizations",footnote:f,consumerBullets:m,bullets:p,connectedBullets:h}=NQ[e],g=[{label:"Website",url:a,icon:B("link")}];i&&g.push({label:"Documentation",url:i,icon:B("book")}),u&&g.push({label:"Support",url:u,icon:B("help")});let y=p;return t===y2.CONNECTED&&h?y=h:!r&&m&&(y=m),{name:Tc(e),tagline:c?n(c):null,footnote:f?{link:f.link,text:n(f.text)}:null,bullets:y.map(x=>n(x)),links:g}}if(o){const{name:a,display_name:i,description:c,long_description:u,homepage:f}=o.manifest,m=[];return f&&m.push({label:"Website",url:f,icon:B("link")}),{name:i??a,tagline:c,footnote:null,bullets:u?.split(` -`).map(p=>p.trim()).filter(Boolean)??[],links:m}}return{name:e,tagline:null,footnote:null,bullets:[],links:[]}},[n,e,r,o,t])},wRe=Se(async()=>{const{ConnectorsEnableModal:e}=await Ee(()=>q(()=>import("./ConnectorsEnableModal-CUStDn-Z.js"),__vite__mapDeps([145,4,1,8,3,9,6,7,14,110,10,11,12])));return{default:e}}),RQ=T.memo(({source:e,enabled:t,onToggle:n})=>{const r=mu(),{tagline:s}=_Re(e),o=d.useCallback(()=>{r({origin:lt.SOURCES_VIEW_MORE})},[r]),a=l.jsx(CRe,{source:e,enabled:t,onToggle:n,handleOpenPaywall:o});return s?l.jsx(Hs,{content:s,side:"right",children:l.jsx("span",{children:a})}):a});RQ.displayName="SourcesMenuItemConnector";const CRe=({source:e,enabled:t,onToggle:n,handleOpenPaywall:r})=>{const s="sources-menu-item-connector",{isConnected:o,getConnectionType:a}=cg({reason:s}),{openModal:i}=Ho(),{getSourceLabel:c,getSourceIcon:u}=sc(),f=o(e),m=c(e),p=u(e),h=d.useCallback(()=>{i(wRe,{connectorName:e,connectorAvatar:M3(e),connectionType:a(e),referrer:"ask",openInNewTab:!0,reason:s,legacyIdentifier:"__NONE__",handleOpenPaywall:r})},[i,e,s,a,r]);if(!f){const g=l.jsx(Jt,{icon:B("arrow-up-right"),size:"small"});return l.jsx(_t.Item,{leadingAccessory:p,trailingAccessory:g,onSelect:h,children:m})}return l.jsx(_t.SwitchItem,{leadingAccessory:p,checked:t,onCheckedChange:n,children:m})};var uw,Sv="HoverCard",[DQ]=Vs(Sv,[kf]),Ev=kf(),[SRe,kv]=DQ(Sv),jQ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:o,openDelay:a=700,closeDelay:i=300}=e,c=Ev(t),u=d.useRef(0),f=d.useRef(0),m=d.useRef(!1),p=d.useRef(!1),[h,g]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:Sv}),y=d.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>g(!0),a)},[a,g]),x=d.useCallback(()=>{clearTimeout(u.current),!m.current&&!p.current&&(f.current=window.setTimeout(()=>g(!1),i))},[i,g]),v=d.useCallback(()=>g(!1),[g]);return d.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),l.jsx(SRe,{scope:t,open:h,onOpenChange:g,onOpen:y,onClose:x,onDismiss:v,hasSelectionRef:m,isPointerDownOnContentRef:p,children:l.jsx(yx,{...c,children:n})})};jQ.displayName=Sv;var IQ="HoverCardTrigger",PQ=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=kv(IQ,n),o=Ev(n);return l.jsx(xx,{asChild:!0,...o,children:l.jsx(Mt.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:nt(e.onPointerEnter,v2(s.onOpen)),onPointerLeave:nt(e.onPointerLeave,v2(s.onClose)),onFocus:nt(e.onFocus,s.onOpen),onBlur:nt(e.onBlur,s.onClose),onTouchStart:nt(e.onTouchStart,a=>a.preventDefault())})})});PQ.displayName=IQ;var VA="HoverCardPortal",[ERe,kRe]=DQ(VA,{forceMount:void 0}),OQ=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,o=kv(VA,t);return l.jsx(ERe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(vx,{asChild:!0,container:s,children:r})})})};OQ.displayName=VA;var x2="HoverCardContent",LQ=d.forwardRef((e,t)=>{const n=kRe(x2,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,o=kv(x2,e.__scopeHoverCard);return l.jsx(Hr,{present:r||o.open,children:l.jsx(MRe,{"data-state":o.open?"open":"closed",...s,onPointerEnter:nt(e.onPointerEnter,v2(o.onOpen)),onPointerLeave:nt(e.onPointerLeave,v2(o.onClose)),ref:t})})});LQ.displayName=x2;var MRe=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,...i}=e,c=kv(x2,n),u=Ev(n),f=d.useRef(null),m=En(t,f),[p,h]=d.useState(!1);return d.useEffect(()=>{if(p){const g=document.body;return uw=g.style.userSelect||g.style.webkitUserSelect,g.style.userSelect="none",g.style.webkitUserSelect="none",()=>{g.style.userSelect=uw,g.style.webkitUserSelect=uw}}},[p]),d.useEffect(()=>{if(f.current){const g=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",g),()=>{document.removeEventListener("pointerup",g),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),d.useEffect(()=>{f.current&&ARe(f.current).forEach(y=>y.setAttribute("tabindex","-1"))}),l.jsx(bx,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:nt(o,g=>{g.preventDefault()}),onDismiss:c.onDismiss,children:l.jsx(hM,{...u,...i,onPointerDown:nt(i.onPointerDown,g=>{g.currentTarget.contains(g.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...i.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),TRe="HoverCardArrow",FQ=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Ev(n);return l.jsx(gM,{...s,...r,ref:t})});FQ.displayName=TRe;function v2(e){return t=>t.pointerType==="touch"?void 0:e()}function ARe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var NRe=jQ,RRe=PQ,DRe=OQ,jRe=LQ,IRe=FQ,Mv="Popover",[BQ]=Vs(Mv,[kf]),Eg=kf(),[PRe,oc]=BQ(Mv),UQ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=Eg(t),c=d.useRef(null),[u,f]=d.useState(!1),[m,p]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:Mv});return l.jsx(yx,{...i,children:l.jsx(PRe,{scope:t,contentId:ls(),triggerRef:c,open:m,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:d.useCallback(()=>f(!0),[]),onCustomAnchorRemove:d.useCallback(()=>f(!1),[]),modal:a,children:n})})};UQ.displayName=Mv;var VQ="PopoverAnchor",ORe=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=oc(VQ,n),o=Eg(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return d.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(xx,{...o,...r,ref:t})});ORe.displayName=VQ;var HQ="PopoverTrigger",zQ=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=oc(HQ,n),o=Eg(n),a=En(t,s.triggerRef),i=l.jsx(Mt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":YQ(s.open),...r,ref:a,onClick:nt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(xx,{asChild:!0,...o,children:i})});zQ.displayName=HQ;var HA="PopoverPortal",[LRe,FRe]=BQ(HA,{forceMount:void 0}),WQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=oc(HA,t);return l.jsx(LRe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(vx,{asChild:!0,container:s,children:r})})})};WQ.displayName=HA;var Zd="PopoverContent",GQ=d.forwardRef((e,t)=>{const n=FRe(Zd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=oc(Zd,e.__scopePopover);return l.jsx(Hr,{present:r||o.open,children:o.modal?l.jsx(URe,{...s,ref:t}):l.jsx(VRe,{...s,ref:t})})});GQ.displayName=Zd;var BRe=Xp("PopoverContent.RemoveScroll"),URe=d.forwardRef((e,t)=>{const n=oc(Zd,e.__scopePopover),r=d.useRef(null),s=En(t,r),o=d.useRef(!1);return d.useEffect(()=>{const a=r.current;if(a)return dT(a)},[]),l.jsx(fg,{as:BRe,allowPinchZoom:!0,children:l.jsx($Q,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:nt(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,u=i.button===2||c;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:nt(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),VRe=d.forwardRef((e,t)=>{const n=oc(Zd,e.__scopePopover),r=d.useRef(!1),s=d.useRef(!1);return l.jsx($Q,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),$Q=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...m}=e,p=oc(Zd,n),h=Eg(n);return uT(),l.jsx(Zx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(bx,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:l.jsx(hM,{"data-state":YQ(p.open),role:"dialog",id:p.contentId,...h,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),qQ="PopoverClose",HRe=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=oc(qQ,n);return l.jsx(Mt.button,{type:"button",...r,ref:t,onClick:nt(e.onClick,()=>s.onOpenChange(!1))})});HRe.displayName=qQ;var zRe="PopoverArrow",KQ=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Eg(n);return l.jsx(gM,{...s,...r,ref:t})});KQ.displayName=zRe;function YQ(e){return e?"open":"closed"}var WRe=UQ,GRe=zQ,$Re=WQ,qRe=GQ,KRe=KQ;const YRe=8,jj=10,QRe=200,XRe=300,Ij="rounded-xl",Pj="p-sm",Oj=li(["rounded-xl","shadow-overlay"],{variants:{appearance:{dark:"bg-dark",light:"bg-base"},side:{top:"data-[state=closed]:animate-slideDownAndFadeOut data-[state=open]:animate-slideUpAndFadeIn",bottom:"data-[state=closed]:animate-slideUpAndFadeOut data-[state=open]:animate-slideDownAndFadeIn",left:"data-[state=closed]:animate-slideRightAndFadeOut data-[state=open]:animate-slideLeftAndFadeIn",right:"data-[state=closed]:animate-slideLeftAndFadeOut data-[state=open]:animate-slideRightAndFadeIn"}},defaultVariants:{appearance:"dark",side:"bottom"}});function Ul({triggerElement:e,children:t,appearance:n="system",side:r="bottom",align:s="center",open:o,onOpenChange:a,maxWidthPx:i=320,offsetPx:c=YRe,shouldShowArrow:u=!1,disabled:f=!1,interaction:m="click",openDelayMs:p,closeDelayMs:h,onWheelContent:g,onContentMouseEnter:y,onContentMouseLeave:x,...v}){const{isMobileStyle:b}=Vo(),{isOpen:_,handleOpenChange:w}=npe({open:o,onOpenChange:a}),S=Tge(),C=n!=="system"?n:S?.colorScheme||"dark",E=wa(v),N=z("overflow-hidden -translate-y-two [clip-path:inset(1px_1px_0px_1px)]",{"fill-[oklch(var(--dark-background-base-color))] dark:stroke-[1.5px] dark:stroke-subtler":C==="dark","fill-[oklch(var(--background-base-color))] stroke-[1.5px] stroke-subtler":C==="light"}),k=d.useCallback(A=>{g?.({deltaX:A.deltaX,deltaY:A.deltaY})},[g]);if(f)return e;if(b)return l.jsx(nq,{isOpen:_,onToggle:w,triggerElement:e,children:l.jsx("div",{className:"text-sm",children:t})});const I="calc(var(--radix-popper-available-height) - 16px)",M=l.jsx("div",{className:z("text-sm",{"text-white":C==="dark","text-default":C==="light"}),style:{maxWidth:i},children:t});return m==="hover"?l.jsxs(NRe,{open:_,onOpenChange:w,openDelay:p??QRe,closeDelay:h??XRe,children:[l.jsx(RRe,{asChild:!0,...E,children:e}),l.jsx(DRe,{children:l.jsxs(jRe,{side:r,align:s,sideOffset:c,avoidCollisions:!0,collisionPadding:jj,className:z(Oj({appearance:C,side:r}),"min-w-[var(--radix-hover-card-trigger-width)]"),onWheel:k,onMouseEnter:y,onMouseLeave:x,onPointerEnter:y,onPointerLeave:x,children:[l.jsx(L3,{className:Ij,maxHeight:I,children:l.jsx("div",{className:Pj,children:M})}),u&&l.jsx(IRe,{width:12,height:6,className:N})]})})]}):l.jsxs(WRe,{open:_,onOpenChange:w,children:[l.jsx(GRe,{asChild:!0,...E,children:e}),l.jsx($Re,{children:l.jsxs(qRe,{side:r,align:s,sideOffset:c,avoidCollisions:!0,collisionPadding:jj,className:z(Oj({appearance:C,side:r}),"min-w-[var(--radix-popover-trigger-width)]"),onWheel:k,onMouseEnter:y,onMouseLeave:x,onPointerEnter:y,onPointerLeave:x,children:[l.jsx(L3,{className:Ij,maxHeight:I,children:l.jsx("div",{className:Pj,children:M})}),u&&l.jsx(KRe,{width:12,height:6,className:N})]})})]})}const QQ=()=>{const{$t:e}=J();return l.jsx(V,{variant:"micro",color:"super",className:"border-super inline-block rounded border px-1 py-0",children:e({id:"Hw1hSDsL+0",defaultMessage:"Premium data"})})};QQ.displayName="PremiumSourceBadge";const ZRe=(e,t)=>{switch(e){case"wiley_mcp_cashmere":return t.formatMessage({defaultMessage:"Search business, medical, STEM, and psychology books, and medical & life sciences journals",id:"RX0/lKeA+h"});case"cbinsights_mcp_cashmere":return t.formatMessage({defaultMessage:"Search market insights, market maps, and company activity",id:"7NjNyz7XKj"});case"pitchbook_mcp_cashmere":return t.formatMessage({defaultMessage:"Search firmographics for private and public companies",id:"pCeNCFTGuu"});case"statista_mcp_cashmere":return t.formatMessage({defaultMessage:"Search aggregated statistics, market data, trends, and forecasts",id:"vo4Zj58C7M"});default:Ft(e)}},JRe=e=>{switch(e){case"wiley_mcp_cashmere":return TV;case"cbinsights_mcp_cashmere":return AV;case"pitchbook_mcp_cashmere":return NV;case"statista_mcp_cashmere":return RV;default:return e}},e9e={wiley_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12868503-using-perplexity-with-wiley",pitchbook_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869442-leveraging-pitchbook-data-with-perplexity",statista_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869733-using-premium-statista-data-with-perplexity",cbinsights_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869855-integrating-cb-insights-data-with-perplexity"},t9e=({sourceId:e})=>{const t=J(),{isMax:n}=Bt(),r=JRe(e),s=ZRe(e,t),o=e9e[e];return l.jsxs("div",{className:z("flex flex-col gap-2 p-2",{"max-super-override":n}),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx(V,{variant:"tinyBold",color:"white",children:r}),l.jsx(QQ,{})]}),l.jsx(V,{variant:"tiny",color:"white",className:"text-pretty",children:s}),o&&l.jsx("p",{className:"text-pretty text-xs text-white",children:l.jsx(Xh,{href:o,target:"_blank",rel:"noopener",variant:"inline",muted:!0,children:t.formatMessage({defaultMessage:"Learn about complementary paid content from {sourceName}",id:"8uL70j2Vzs"},{sourceName:r})})}),l.jsx(r9e,{})]})},n9e=({variant:e,onClick:t,children:n})=>l.jsx(jo,{onClick:t,className:z(wx({variant:"primary",size:"small",disabled:!1,fullWidth:!1,rounded:!1,pill:!1,inline:!1}),{"!bg-max hover:!bg-max":e==="max"}),children:n}),r9e=()=>{const{$t:e}=J(),{openModal:t}=gn().legacy;uu();const{hasAccessToProFeatures:n,isMax:r}=Bt(),s=d.useCallback(()=>{t("pricingModal",{origin:lt.PREMIUM_SOURCE_TOOLTIP})},[t]),o=s9e({hasAccessToProFeatures:n,hasAccessToMaxFeatures:r});if(!o)return null;const a=n&&!r,i=a?"max":"pro",c=z("text-pretty",{"text-max":a,"text-super":!a});return l.jsxs(l.Fragment,{children:[l.jsx("hr",{className:"border-subtle bg-subtle my-2"}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tinyRegular",className:c,children:e(o.title)}),l.jsx(n9e,{variant:i,onClick:s,children:e(o.action)})]})]})};function s9e({hasAccessToProFeatures:e,hasAccessToMaxFeatures:t}){return e?t?null:{title:W({defaultMessage:"Get more queries with Max",id:"0iyoM20VTJ"}),action:W({defaultMessage:"Try Perplexity Max",id:"oorH6wdruv"})}:{title:W({defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"}),action:W({defaultMessage:"Try Perplexity Pro",id:"qXQPclCIaf"})}}const XQ=T.memo(({source:e,enabled:t,onToggle:n})=>{const{openOverlayId:r,setOpenOverlayId:s}=Vo(),{getSourceLabel:o,getSourceIcon:a}=sc(),i=o(e),c=a(e),{getSourceLimit:u}=nT(),f=d.useRef(null),m=d.useId(),p=d.useCallback(()=>{f.current&&clearTimeout(f.current),s(m)},[m,s]),h=d.useCallback(()=>{f.current=setTimeout(()=>{s(x=>x===m?null:x)},300)},[m,s]),g=d.useMemo(()=>{const{remaining:x}=u(e);return x===0},[u,e]),y=d.useMemo(()=>l.jsx("div",{onMouseEnter:p,onMouseLeave:h,children:l.jsx(_t.SwitchItem,{leadingAccessory:c,checked:t,onCheckedChange:n,disabled:g,children:i})}),[g,t,p,h,c,i,n]);return l.jsx(Ul,{interaction:"hover",appearance:"dark",triggerElement:y,side:"right",open:r===m,onOpenChange:Ro,children:l.jsx("div",{onMouseEnter:p,onMouseLeave:h,children:l.jsx(t9e,{sourceId:e})})})});XQ.displayName="SourcesMenuItemPremiumData";const o9e=(e,t)=>{if(Wi(e))return Qx[e].description(t)},mE=d.memo(({source:e,enabled:t,onToggle:n})=>{const r=J(),{getSourceLabel:s,getSourceIcon:o}=sc(),a=s(e),i=o(e),c=o9e(e,r),u=l.jsx(_t.SwitchItem,{leadingAccessory:i,checked:t,onCheckedChange:n,children:a});return c?l.jsx(Hs,{content:c,side:"right",children:u}):u});mE.displayName="SourcesMenuItemSource";const ZQ=T.memo(({source:e,enabled:t,onToggle:n})=>{const{isMax:r}=Bt(),s=d.useCallback(o=>{o.stopPropagation()},[]);return l.jsx("div",{onClick:s,className:z({"max-super-override":r}),children:l.jsx(a9e,{source:e,enabled:t,onToggle:n})})});ZQ.displayName="SourcesMenuItem";const a9e=({source:e,enabled:t,onToggle:n})=>tg(e)?l.jsx(XQ,{source:e,enabled:t,onToggle:n}):Wi(e)?l.jsx(mE,{source:e,enabled:t,onToggle:n}):fu(e)?l.jsx(RQ,{source:e,enabled:t,onToggle:n}):Za(e)?l.jsx(AQ,{source:e,enabled:t,onToggle:n}):l.jsx(mE,{source:e,enabled:t,onToggle:n}),JQ=T.memo(({source:e,onSourceToggled:t,isSourceEnabled:n})=>{const r=d.useCallback(s=>t(e,s),[t,e]);return l.jsx(ZQ,{source:e,enabled:n(e),onToggle:r},e)});JQ.displayName="MemoizedSourceMenuItem";const zA=T.memo(({sources:e,isSourceEnabled:t,onSourceToggled:n})=>e.map(r=>l.jsx(JQ,{source:r,onSourceToggled:n,isSourceEnabled:t},r)));zA.displayName="SourcesMenuItems";const eX=T.memo(({sources:e,isSourceEnabled:t,onSourceToggled:n,minWidthPx:r,isOpen:s,onToggle:o})=>{if(e.length===0)return null;const a=s?{isOpen:s,onToggle:o}:{};return l.jsx(_t.Submenu,{...a,triggerElement:l.jsx(_t.SubmenuItem,{children:l.jsx(Ne,{defaultMessage:"More sources",id:"VQ/e7ISbIh"})}),minWidthPx:r,children:l.jsx(zA,{sources:e,isSourceEnabled:t,onSourceToggled:n})})});eX.displayName="SourcesMenuMoreSourcesSubmenu";const i9e="sources-menu-suggested-sources",tX=T.memo(({sources:e,onSourceToggled:t,isSourceEnabled:n})=>l.jsx("div",{"data-testid":i9e,children:l.jsx(zA,{sources:e,isSourceEnabled:n,onSourceToggled:t})}));tX.displayName="SourcesMenuSuggestedSources";const nX=d.memo(()=>{const{hasAccessToProFeatures:e}=Bt();return e?null:l.jsx(l9e,{})});nX.displayName="SourcesMenuUpsellMenuItem";const l9e=()=>{const{$t:e}=J(),t=Vt(),{openVisitorLoginUpsell:n}=di({enabled:!t}),r=mu(),s=d.useCallback(()=>{if(!t){const o=new URL(window.location.href);o.searchParams.set("upsell","sources"),n({title:e({defaultMessage:"Sign in to connect more sources",id:"2nkj+bbNku"}),description:e({defaultMessage:"Access more sources to enhance your searches with Perplexity",id:"TXk0EQA72B"}),origin:lt.SOURCES_VIEW_MORE,overrideRedirectUrl:o.toString()});return}r({pitchMessage:{title:e({defaultMessage:"Upgrade to connect more sources",id:"fT8uzTJSdX"}),description:e({defaultMessage:"With Perplexity Pro, connect more sources to enhance your searches",id:"tWT1NCuTCh"})},origin:lt.SOURCES_VIEW_MORE})},[e,t,n,r]);return l.jsxs(l.Fragment,{children:[l.jsx(_t.Item,{onSelect:s,children:l.jsx(Ne,{defaultMessage:"Upgrade to connect more sources",id:"fT8uzTJSdX"})}),l.jsx(_t.Separator,{})]})},c9e=({sources:e,omit:t=[]})=>{const n="use-enabled-sources",{isConnected:r}=cg({reason:n}),s=d.useMemo(()=>{const o=new Set;return e.forEach(a=>{if(!t.includes(a)){if(!fu(a)||tg(a)){o.add(a);return}r(a)&&o.add(a)}}),Array.from(o)},[e,t,r]);return d.useMemo(()=>({sources:s}),[s])},u9e=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"sources-dropdown-ui-redesign-files",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},d9e="pplx_source_activity",WA=()=>{const[e,t]=Qi(d9e,[]),n=d.useCallback(r=>{t(s=>[{sourceType:r,lastUsedAt:Date.now()},...s].slice(0,25))},[t]);return d.useMemo(()=>({activity:e,trackSourceActivity:n}),[e,n])},f9e=["edgar","cbinsights_mcp_cashmere","gcal","google_drive"],rX=({sources:e,defaultSuggestions:t=f9e,count:n=5})=>{const{activity:r}=WA(),[s,o]=d.useState(r),a=d.useMemo(()=>{const c=new Set(["web"]);return s.sort((u,f)=>f.lastUsedAt-u.lastUsedAt).map(u=>u.sourceType).filter(ga).forEach(u=>c.add(u)),t.forEach(u=>c.add(u)),e.forEach(u=>c.add(u)),Array.from(c).filter(u=>e.includes(u)).slice(0,n)},[s,n,e,t]),i=d.useCallback(()=>{o(r)},[r]);return d.useMemo(()=>({suggested:a,refresh:i}),[a,i])},Lj=225,m9e={crunchbase:["web"]},p9e={web:["crunchbase"]},sX=({isOpen:e,sources:t,tooltip:n,size:r="default",disabled:s=!1,onChange:o,onOpen:a,onClose:i,triggerElement:c,omittedSources:u,omitCometMcpSources:f=!1})=>{const m="sources-menu",{isAllowed:p}=cg({reason:m}),{sources:h}=oT({omitCometMcpSources:f,isConnectorAllowed:p,omittedSources:u}),{trackSourceActivity:g}=WA(),{variation:y}=u9e(!1),{suggested:x,refresh:v}=rX({sources:h}),{sources:b}=c9e({sources:h,omit:x}),_=d.useMemo(()=>h.filter(M=>!x.includes(M)&&!b.includes(M)),[h,x,b]),w=d.useMemo(()=>[...b,..._],[b,_]),S=d.useCallback(M=>{M?(v(),a?.()):i?.()},[a,i,v]),C=d.useCallback(M=>t.includes(M),[t]),E=d.useCallback(M=>{g(M);const A=new Set([...t,M]);m9e[M]?.forEach(D=>{A.add(D)}),o(Array.from(A))},[t,o,g]),N=d.useCallback(M=>{const A=new Set(t);A.delete(M),p9e[M]?.forEach(D=>{A.delete(D)}),o(Array.from(A))},[t,o]),k=d.useCallback((M,A)=>{C(M)!==A&&(A?E(M):N(M))},[C,E,N]),I=d.useMemo(()=>c??l.jsx(TQ,{sources:t,size:r,disabled:s,tooltip:n}),[c,t,r,s,n]);return l.jsxs(_t,{isOpen:e,onToggle:S,align:"end",minWidthPx:Lj,triggerElement:I,maxHeightPx:400,children:[l.jsx(nX,{}),y&&l.jsxs(l.Fragment,{children:[l.jsx(kQ,{}),l.jsx(_t.Separator,{})]}),l.jsx(tX,{sources:x,isSourceEnabled:C,onSourceToggled:k}),l.jsx(_t.Separator,{}),l.jsx(eX,{sources:w,isSourceEnabled:C,onSourceToggled:k,minWidthPx:Lj})]})};sX.displayName="SourcesMenuContent";const GA=d.memo(e=>l.jsx(EQ,{children:l.jsx(sX,{...e})}));GA.displayName="SourcesMenu";const Fj=Ue({disabled:{defaultMessage:"Start a new thread to change sources",id:"jKXi56aXv8"},enabled:{defaultMessage:"Set sources for search",id:"yAyuRoLEjt"}}),oX=T.memo(({disabled:e=!1,...t})=>{const{$t:n}=J(),r=n(e?Fj.disabled:Fj.enabled);return l.jsx(GA,{disabled:e,tooltip:r,...t})});oX.displayName="AskInputSourcesMenu";const aX=T.memo(({isInitializing:e,startTranscription:t,error:n=null,disabled:r=!1})=>{const{$t:s}=J(),[o,a]=d.useState(e),i=d.useCallback(()=>{a(!0),t?.()},[t]);return d.useEffect(()=>{n&&a(!1)},[n]),l.jsx("div",{className:"relative",children:l.jsx(Ct,{"aria-label":s({defaultMessage:"Dictation",id:"0eNg7Kdki1"}),icon:B("microphone"),isLoading:!n&&(e||o),variant:"text",onClick:i,disabled:r,size:Gt.small})})});aX.displayName="DictationButton";const iX=T.memo(({stopTranscription:e})=>{const{$t:t}=J();return l.jsx("div",{className:"relative",children:l.jsx(Ct,{"aria-label":t({defaultMessage:"Stop dictation",id:"De+8liLWgX"}),icon:B("player-stop-filled"),variant:"tonal",onClick:e,disabled:!1,size:Gt.small})})});iX.displayName="DictationStopButton";const lX=T.memo(({onSubmit:e,isDisabled:t=!1,toolTip:n})=>{const{$t:r}=J();return l.jsxs("div",{className:"relative ml-2",children:[l.jsx("div",{className:"bg-super/20 absolute inset-[10%] animate-[ping_1.5s_cubic-bezier(0,0,0.2,1)_infinite] rounded-lg"}),l.jsx(Ct,{"aria-label":n||r({defaultMessage:"Submit dictation",id:"gDpUQHAEOK"}),icon:B("check"),variant:"primary",onClick:e,disabled:t,size:Gt.small})]})});lX.displayName="DictationSubmitButton";const cX=T.memo(({onStopButtonClick:e,variant:t="inverted"})=>{const{$t:n}=J();return l.jsx(Hx.Slide,{isVisible:!0,children:t==="tonal"?l.jsx(Ct,{"aria-label":n({defaultMessage:"Stop generating response",id:"wXXKXUJh1s"}),variant:"tonal",icon:B("player-stop-filled"),onClick:e,size:"small"}):l.jsx(ze,{toolTip:n({defaultMessage:"Stop generating response",id:"wXXKXUJh1s"}),variant:t,icon:B("player-stop-filled"),onClick:e,size:"small",extraCSS:"text-caution hover:!bg-caution hover:!text-white ml-2"})})});cX.displayName="StopButton";const Yf=T.memo(()=>l.jsx("div",{className:"bg-base fixed inset-0 z-[999] flex h-screen w-screen items-center justify-center opacity-50"}));Yf.displayName="VoiceToVoiceModalLoader";Se(async()=>{const{VoiceToVoiceModal:e}=await Ee(()=>q(()=>import("./VoiceToVoiceModal-BqYk1RoR.js"),__vite__mapDeps([146,4,1,9,3,6,7,147,148,149,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Yf,{})});const uX=T.memo(()=>{const{openModal:e}=gn().legacy,{openModal:t}=gn().updated,{$t:n}=J(),r=Vt(),s=Dn(),o=d.useCallback(()=>{r?s.push("/speak"):e("loginModal",{origin:lt.VOICE_TO_VOICE_BUTTON,pitchMessage:{title:"Sign in to unlock voice mode"}})},[r,e,t,s]);return l.jsx("div",{className:"ml-2",children:l.jsx(Ct,{onClick:o,size:Gt.small,icon:sV,variant:"primary",disabled:!1,"aria-label":n({defaultMessage:"Voice mode",id:"OnF9aqAuar"})})})});uX.displayName="VoiceToVoiceButton";const h9e=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"enable-clarifying-questions",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function dX(){const{variation:e}=h9e(!1);return e}function pE(e={}){const t=new URL(window.location.href);for(const[n,r]of Object.entries(e))typeof r>"u"?t.searchParams.delete(n):t.searchParams.set(n,r);fX(Object.fromEntries(t.searchParams))}function fX(e){const t=new URL(window.location.href),r=(e?new URLSearchParams(e):new URLSearchParams).toString();r!==t.searchParams.toString()&&window.history.replaceState({},"",`?${r}`)}const mX=T.memo(({toolTip:e,icon:t,isDisabled:n,value:r,querySource:s,size:o=Gt.small,handleSubmit:a,...i})=>l.jsx(ze,{...i,ariaLabel:"Submit",toolTip:e,icon:t,variant:"primary",size:o,onClick:n?void 0:()=>a({query:r,querySource:s}),disabled:n,extraCSS:"!duration-100"}));mX.displayName="SubmitButton";const Bj=Se(async()=>{const{VoiceToVoiceModal:e}=await Ee(()=>q(()=>import("./VoiceToVoiceModal-BqYk1RoR.js"),__vite__mapDeps([146,4,1,9,3,6,7,147,148,149,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Yf,{})}),dw=({className:e,...t})=>l.jsx("div",{className:e,children:l.jsx(mX,{...t,value:""})}),g9e=({value:e,json:t,submitWillFork:n,isFollowUp:r,isDisabled:s,querySource:o,errorMessage:a,handleSubmit:i,fileUploadRef:c,showFileUpload:u,fileUploadTooltip:f,showStopButton:m,showModelSelector:p,onStopButtonClick:h,onFilePickerOpen:g,onFilePickerClose:y,showSources:x,useThreadSources:v,showRecency:b,disableActionButtons:_,startTranscription:w,stopTranscription:S,isTranscribing:C,isTranscriptionInitializing:E,isTranscriptionAvailable:N,transcriptionError:k=null,fileUploadErrorMessage:I,fileUploadWarningMessage:M,activeConnector:A=null,uploadedFiles:D,handleStartUpload:P,handleFileInput:F,isBoxFilePickerOpen:R=!1,handleCloseBoxFilePicker:j,cleanupBoxFilePicker:L,microsoftFilePickerOptions:U=null,handleCloseMicrosoftFilePicker:O,handleSelectSharepointSite:$,isMicrosoftFilePickerOpen:G=!1,fileInputRef:H,hasQuery:Q,isAudioVideoFilesEnabled:Y=!1,setAttachmentErrorMessage:te,isCometHome:se,isMissionControl:ae})=>{const X="ask-input-right-attributions",{isMobileStyle:ee,isMobileUserAgent:le}=Re(),{openModal:re}=gn().updated,{organization:ce}=mo({reason:X}),{$t:ue}=J(),pe=dX(),{activeMenu:xe}=Kr(),{onActiveMenuChange:he}=Po(),{device:{isWindowsApp:_e}}=on(),ke=mn(),{fileRepoInfo:De}=Vx({reason:X}),{isSearchModelMenuRewriteEnabled:Ce}=bz(),Be=De.file_repository_type==="COLLECTION",we=b&&Be&&!r,$e=d.useRef(e),yt=d.useRef(t);$e.current=e,yt.current=t;const me=d.useCallback(({querySource:pt})=>{i({query:$e.current,json:yt.current,querySource:pt})},[i]),ve=U4(pt=>pt.results.find(Kt=>Yt.isStatusPending(Kt))),Ae=sn(ve?.display_model)==oe.RESEARCH||sn(ve?.display_model)==oe.STUDIO;d.useEffect(()=>{if(!_e)return;const pt=new URLSearchParams(window.location.search);pt.get("voice-mode")?(pE({"voice-mode":void 0}),w?.()):pt.get("v2v")&&(pE({v2v:void 0}),re(Bj,{legacyIdentifier:"voiceToVoiceModal"}))},[ke,_e,w,re]),d.useEffect(()=>{const pt=()=>{N&&(C?S?.():w?.())},Kt=()=>{re(Bj,{legacyIdentifier:"voiceToVoiceModal"})};return document.addEventListener("toggleVoiceToVoice",Kt),document.addEventListener("toggleDictation",pt),()=>{document.removeEventListener("toggleDictation",pt),document.removeEventListener("toggleVoiceToVoice",Kt)}},[C,N,w,S,re]);const Ge=!ae&&!r&&!se&&(!le&&!ee||!0),ht=n?B("git-fork"):B("arrow-up"),mt=m&&pe&&Ae,Qe=()=>!mt||!o?null:l.jsx("div",{className:s?"pointer-events-none opacity-50":"",children:l.jsx(dw,{className:"ml-3",toolTip:a||ue({defaultMessage:"Anything else to consider?",id:"DDAw7Ictpp"}),icon:ht,querySource:o,isDisabled:!1,handleSubmit:me})}),Tt=()=>{if(_)return l.jsx(dw,{className:"ml-2",isDisabled:!0,icon:ht,querySource:o??"home",handleSubmit:Ro});const pt=o&&l.jsx(dw,{className:"ml-2",toolTip:a||(n?ue({defaultMessage:"Start your own thread",id:"TAA16rUT4G"}):""),icon:ht,isDisabled:s,querySource:o,handleSubmit:me},"submit-button"),Kt=[];if(N&&(C?(Kt.push(l.jsx(iX,{stopTranscription:S},"dictation-stop-button")),o&&Kt.push(l.jsx(lX,{onSubmit:fn},"dictation-submit-button"))):Kt.push(l.jsx(aX,{isInitializing:E,startTranscription:w,error:k,disabled:m},"dictation-button"))),m){const ur=mt?"tonal":"inverted";Kt.push(l.jsx(cX,{onStopButtonClick:h,variant:ur},"stop-button"))}else if(Ge){const ur=(D?.length||Q)&&o&&!C;ur?Kt.push(pt):!C&&!ur&&Kt.push(l.jsx(uX,{},"voice-to-voice-button"))}else C||Kt.push(pt);return N||Ge?Kt:pt},Ye=d.useCallback(()=>he(null),[he]),Me=d.useCallback(()=>he(lr.RECENCY),[he]),Ve=d.useCallback(()=>he(lr.ATTACHMENTS),[he]),ct=d.useCallback(()=>he(lr.UNIFIED_SOURCES),[he]),vt=d.useCallback(pt=>{if(pt){he(lr.SEARCH_MODEL_MENU);return}!pt&&xe===lr.SEARCH_MODEL_MENU&&Ye()},[xe,he,Ye]),{sources:Dt,setSources:ot}=DW({useThreadSources:v,reason:X}),$t=d.useMemo(()=>{if(!x)return!1;const pt=Dt.every(Kt=>Kt==="web");return r&&pt?!1:x},[x,r,Dt]),fn=d.useCallback(()=>{S?.(),Q&&i({query:$e.current,json:yt.current,querySource:o})},[S,Q,i,o]),{configuredModel:ut}=Fn(),bt=Kf(),jt=d.useCallback(pt=>{bt(pt,sn(pt))},[bt]);return C?l.jsxs(cE,{children:[o&&Tt(),Qe()]}):l.jsxs(cE,{children:[$t&&l.jsx(oX,{isOpen:xe===lr.UNIFIED_SOURCES,size:"small",sources:Dt,onChange:ot,onOpen:ct,onClose:Ye,disabled:v}),!Ce&&p&&l.jsx(pQ,{uploadedFiles:D}),Ce&&p&&l.jsx(_Q,{isOpen:xe===lr.SEARCH_MODEL_MENU,onToggle:vt,model:ut,onModelChange:jt}),we&&l.jsx(gQ,{isOpen:xe===lr.RECENCY,onOpen:Me,onClose:Ye}),u&&l.jsx(MA,{isOpen:xe===lr.ATTACHMENTS,onOpen:Ve,onClose:Ye,forwardedRef:c,fileType:"all",tooltip:f,onFilePickerOpen:g,onFilePickerClose:y,areFileAttachmentsAllowed:ce?.settings?.file_attachments_allowed!==!1,fileUploadErrorMessage:I??null,fileUploadWarningMessage:M??null,activeConnector:A,uploadedFiles:D??Ie,handleStartUpload:P,handleFileInput:F,isBoxFilePickerOpen:R,handleCloseBoxFilePicker:j,cleanupBoxFilePicker:L,microsoftFilePickerOptions:U,handleCloseMicrosoftFilePicker:O,handleSelectSharepointSite:$,isMicrosoftFilePickerOpen:G,fileInputRef:H,isAudioVideoFilesEnabled:Y,setAttachmentErrorMessage:te}),o&&Tt(),Qe()]})},pX=T.memo(g9e);pX.displayName="AskInputRightAttribution";const y9e=60,x9e=2e3,v9e=6,b9e=4,Np=(e,t)=>e?b9e:v9e,_9e=e=>!(e.length===0||e.includes(` -`)),w9e=e=>e.map(t=>({query:t.text,image:t.image_url,url:t.url,title:t.title,description:t.description,focus:t.focus})),C9e=e=>e.sort((t,n)=>t.url?-1:n.url?1:t.image?-1:n.image?1:0),hE=(e,t,n)=>{let r=e;r=e.filter(a=>!a.url);const s=zU(r,"query");if(n){const a=s.findIndex(i=>i.query===n);if(~a){const i=s[a];s.splice(a,1),s.unshift(i)}}const o=C9e(s);return[o,o.slice(0,Np(t))]},hX=(e,t,n)=>{const r=n?e.replace(/\s+/g,"").toLocaleLowerCase():e,s=t.query;let o=0,a=0;for(;o{const n=e.replace(/\s+/g,""),r=[];let s="",o="",a=0,i=0;for(;ae?.includes("perplexity.ai")??!1,M9e=e=>e?.includes("perplexity.ai/finance")??!1,gX=e=>e==="https://www.perplexity.ai/finance",yX=T.memo(({query:e,completion:t,inputsAndCompletions:n,description:r,highlightPrefix:s,url:o,title:a,shouldShowTitle:i})=>{const c=M9e(o),u=gX(o),f=r||(i&&a?a:e),m=c?f.toUpperCase():f,{$t:p}=J(),h=c?t?.toUpperCase():t;return u?l.jsx(V,{variant:"small",inline:!0,children:p({defaultMessage:"{perplexity} Finance",id:"LnL5Kdg1cp"},{perplexity:"Perplexity"})},"perplexity-finance"):l.jsxs(l.Fragment,{children:[!r&&n?.length&&s?n.map(([g,y],x)=>g?l.jsx(V,{color:"light",variant:"small",className:"inline",as:"div",children:g},`${x}-${g}`):l.jsx(V,{className:"inline whitespace-pre",variant:"small",as:"div",children:y},`${x}-${y}`)):l.jsx(V,{inline:!0,color:"light",variant:"small",children:m}),t&&!r&&s&&!n?.length&&l.jsx(V,{className:"whitespace-pre",inline:!0,variant:"small",children:h}),t&&!r&&!s&&l.jsx(V,{color:"light",inline:!0,variant:"small",children:h})]})});yX.displayName="DefaultQueryContentComponent";const xX=T.memo(({onClick:e,query:t,completion:n,inputsAndCompletions:r,url:s,suggestionIndex:o,keyboardFocusedIndex:a,setKeyboardFocusedIndex:i,leftIcon:c,rightIcon:u,className:f,description:m,title:p,shouldShowTitle:h,highlightPrefix:g=!0,category:y,QueryContentComponent:x=yX,metadata:v,actionHandler:b})=>{const{isMobileUserAgent:_}=Re(),w="group-hover:opacity-100 group-data-[focused=self]:opacity-100",S="opacity-0 group-data-[focused=other]:opacity-0",C=d.useCallback(()=>{i?.(-1)},[i]),E=d.useCallback(N=>h&&p&&t?l.jsx(Oo,{tooltipText:t,bodyClassName:"max-w-[300px]",showTooltip:!0,asChild:!0,tooltipLayout:"right",children:N}):N,[h,p,t]);return l.jsx(kt,{children:E(l.jsx("div",{"data-focused":a===void 0||a===-1?"none":a===o?"self":"other","data-testid":`auto-suggestion-${(o??0)+1}`,className:z("group flex cursor-pointer flex-row items-start rounded-lg p-[8px]",f),onPointerDown:()=>{b?b():e(n?t+n:t)},onPointerLeave:C,children:l.jsxs("div",{className:"flex gap-sm w-full min-w-0 flex-row items-start whitespace-pre leading-tight",children:[l.jsx(V,{className:"h-[1lh] flex items-center -mr-2",color:"light",variant:"small",children:c}),l.jsx(V,{variant:"small",className:z(_?"truncate":"line-clamp-2 text-wrap"),children:s?l.jsx(xt,{href:s,target:"_blank",rel:"noopener",children:l.jsx(x,{query:t,url:s,completion:n,inputsAndCompletions:r,description:m,category:y,highlightPrefix:g,metadata:v,title:p,shouldShowTitle:h})}):l.jsx(x,{query:t,url:s,completion:n,inputsAndCompletions:r,description:m,category:y,highlightPrefix:g,metadata:v,title:p,shouldShowTitle:h})}),u&&l.jsx(V,{variant:"smallBold",color:"super",inline:!0,className:z("ml-auto inline-flex h-[1lh] items-center",w,{[S]:!s}),children:u})]})}))})});xX.displayName="SuggestionCard";const gE={ticker:{order:0,showHeader:!1,highlightPrefix:!1},suggestion:{order:1,showHeader:!1,highlightPrefix:!0},news:{displayName:"Latest News",order:2,showHeader:!0,highlightPrefix:!1},related_question:{displayName:"Related Questions",order:3,showHeader:!0,highlightPrefix:!1},shortcuts:{displayName:"Shortcuts",order:4,showHeader:!0,highlightPrefix:!0}},T9e=e=>{const t={};return e.forEach(n=>{const r=n.category||"suggestion";t[r]||(t[r]=[]),t[r].push(n)}),t},A9e=e=>Object.keys(e).sort((t,n)=>{const r=gE[t]?.order??Number.MAX_SAFE_INTEGER,s=gE[n]?.order??Number.MAX_SAFE_INTEGER;return r-s}),Uj=e=>{const{metadata:t}=e;return!!t&&t.type==="price"&&!!t.price_info&&typeof t.price_info.currentPrice=="number"&&!!t.price_info.change&&!!t.price_info.changePercentage},N9e=e=>[...e].sort((t,n)=>{const r=Uj(t),s=Uj(n);return r&&!s?-1:!r&&s?1:0}),vX=T.memo(e=>{const{text:t,show:n,className:r}=e;return n?l.jsxs(l.Fragment,{children:[l.jsx(K,{className:z("my-sm sm:mx-sm border-b first:hidden",r)}),t&&l.jsx(K,{variant:"transparent",className:"sm:mx-sm mt-xs mb-sm pr-sm",children:l.jsx(V,{className:"w-max",variant:"tinyMono",color:"light",children:t})})]}):null});vX.displayName="GroupItemSeparator";const bX=T.memo(({category:e,suggestions:t,categoryConfig:n,value:r,focusedIndex:s,setFocusedIndex:o,handleSubmit:a,indexOffset:i,LeftIconComponent:c,RightIconComponent:u,QueryContentComponent:f,onFillButtonClick:m,titleClassName:p})=>{const h=d.useMemo(()=>e==="ticker"?N9e(t):t,[e,t]);return t.length?l.jsxs(l.Fragment,{children:[l.jsx(vX,{show:n.showHeader,text:n.displayName,className:p}),h.map((g,y)=>l.jsx(_X,{suggestion:g,index:y,category:e,categoryConfig:n,value:r,focusedIndex:s,setFocusedIndex:o,handleSubmit:a,indexOffset:i,LeftIconComponent:c,RightIconComponent:u,onFillButtonClick:m,QueryContentComponent:f,highlightPrefix:n.highlightPrefix??!0},`${e}-${g.identifier||g.query_uuid||g.input+g.completion}`))]}):null});bX.displayName="SuggestionGroup";const _X=T.memo(({suggestion:{input:e,completion:t,query_uuid:n,image:r,imageDark:s,url:o="",description:a,identifier:i="",category:c,title:u="",subscribed:f=!1,metadata:m,submission_query:p,inputs_and_completions:h,icon_name:g,shouldShowTitle:y,actionHandler:x,isPersonalized:v},index:b,LeftIconComponent:_,QueryContentComponent:w,RightIconComponent:S,highlightPrefix:C,focusedIndex:E,handleSubmit:N,indexOffset:k,onFillButtonClick:I,setFocusedIndex:M,value:A})=>{const D=d.useCallback(j=>N({query:j,query_uuid:n,url:o,identifier:i,category:c,description:a,image:r,imageDark:s,title:u,subscribed:f,submission_query:p,isPersonalized:v},b+k),[c,a,N,i,r,s,b,k,n,p,f,u,o,v]),P=d.useCallback(()=>{I(e+t,o)},[t,e,I,o]),F=d.useMemo(()=>l.jsx(_,{image:r,imageDark:s,alt:e+A,url:o,category:c,iconName:g,value:A}),[_,c,g,r,s,e,o,A]),R=d.useMemo(()=>l.jsx(S,{onClick:P,url:o,isSelected:f,metadata:m,category:c}),[S,P,o,f,m,c]);return l.jsx(xX,{onClick:D,query:e,completion:t,inputsAndCompletions:h,url:o,suggestionIndex:b+k,keyboardFocusedIndex:E,setKeyboardFocusedIndex:M,description:a,title:u,shouldShowTitle:y,highlightPrefix:C,className:z("hover:bg-subtler","data-[focused=self]:bg-subtler","dark:data-[focused=self]:bg-subtler","hover:data-[focused=other]:bg-raised","dark:hover:data-[focused=other]:bg-subtler"),category:c,QueryContentComponent:w,metadata:m,leftIcon:F,rightIcon:R,actionHandler:x})});_X.displayName="SuggestionCardFactory";const wX=T.memo(({image:e,alt:t,url:n,iconName:r,value:s,category:o})=>{const a=s.length===0,[i,c]=d.useState(!1),{sidecarSourceTab:{url:u}}=zn(),f=zo(),m=d.useMemo(()=>{if(u&&a)return Zp(u);if(e)return e;if(n)return rY(n)},[e,n,u,a]),p=r?E9e[r]:null,h=a?H0e(f):B("search");return o==="shortcuts"&&!r?l.jsx(ge,{icon:B("slash"),size:"sm",className:"mt-two mr-2 w-5 shrink-0"}):gX(n)?l.jsx("div",{className:"mr-2 flex size-5 shrink-0 items-center justify-center",children:l.jsx(ge,{icon:Spe,size:"sm",className:"text-foreground"})}):m&&!i?l.jsx("div",{className:"relative mr-2 size-5 shrink-0 overflow-hidden rounded-sm",children:l.jsx("img",{src:m,alt:t??"suggestion",className:"object-cover",sizes:"24px",onError:()=>c(!0)})}):l.jsx("div",{className:"flex shrink-0 items-center mr-2 w-5",children:l.jsx(ge,{icon:i&&n?B("world"):p??h,size:"sm"})})});wX.displayName="LeftIcon";const CX=T.memo(({onClick:e,url:t,category:n})=>n==="shortcuts"?null:k9e(t)?l.jsx("div",{className:"flex h-full items-center",children:l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet"})}):l.jsx("button",{className:"appearance-none inline-flex items-center justify-center",onPointerDown:r=>{r.stopPropagation(),r.preventDefault(),e(r)},type:"button",children:l.jsx(ge,{icon:t?B("world-share"):B("arrow-up-right"),size:"sm"})}));CX.displayName="RightIcon";const $A=T.memo(({isOpen:e,suggestedQueries:t,focusedIndex:n,setFocusedIndex:r,handlePasteQuery:s,handleSubmit:o,dropdownClassName:a,dropdownType:i="query",components:c,value:u,children:f,popoverClassName:m,categoryTitleClassName:p,userInputQuery:h,portalTarget:g,placement:y="bottom",allowNonSequentialMatch:x=!1,renderSettingsRow:v,scrollableShards:b=[],floatingStrategy:_,shouldEnableStacking:w=!1})=>{const{session:S}=je(),{trackEvent:C}=Ke(S),{RightIconComponent:E=CX,LeftIconComponent:N=wX,QueryContentComponent:k}=c??{},I=d.useMemo(()=>t.map(({query:Q,query_uuid:Y,image:te,imageDark:se,url:ae,title:X,description:ee="",identifier:le="",category:re,subscribed:ce=!1,metadata:ue,submission_query:pe,icon:xe,shouldShowTitle:he,actionHandler:_e,isPersonalized:ke,focus:De},Ce,Be)=>{if(i==="select")return{input:Q,completion:"",query_uuid:Y,title:X,image:te,imageDark:se,url:ae,description:ee,identifier:le,category:re,subscribed:ce,submission_query:pe,icon_name:xe,shouldShowTitle:he,actionHandler:_e,isPersonalized:ke};const we=h?n===-1?u:h:u;return we.length>0&&Q.startsWith(we)?{input:we,completion:Q.slice(we.length),query_uuid:Y,title:X,image:te,imageDark:se,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:pe,icon_name:xe,shouldShowTitle:he,actionHandler:_e,isPersonalized:ke}:x&&!ee&&we.length>0&&we.length<=Q.length&&Be[Ce]&&hX(we,Be[Ce],!0)[0]?{input:"",completion:Q,inputs_and_completions:S9e(we,Q),query_uuid:Y,title:X,image:te,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:pe,icon_name:xe,shouldShowTitle:he,actionHandler:_e,isPersonalized:ke}:{input:Q,completion:"",query_uuid:Y,title:X,image:te,imageDark:se,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:pe,icon_name:xe,shouldShowTitle:he,actionHandler:_e,isPersonalized:ke}}),[t,u,i,h,n,x]),M=d.useMemo(()=>T9e(I),[I]),A=d.useMemo(()=>A9e(M),[M]),D=d.useCallback((Q,Y)=>{if(Y){window.open(Y,"_blank");return}C("auto suggestion filled",{}),s(Q)},[s,C]),P=v?.(),F=t.length>0,R=z("!block w-full",y==="bottom"?"mt-[-5px]":"mb-[-5px]",m),j=y==="bottom"?"rounded-b-2xl":"rounded-t-2xl",L=d.useRef(null),U=e&&t.length>0,O=d.useMemo(()=>({portalTarget:g??void 0,removeScroll:!0,shards:b}),[g,b]),$=d.useMemo(()=>l.jsxs("div",{className:z(y==="bottom"?z("rounded-b-2xl",F?"!border-t-subtlest shadow-super/10 shadow-md dark:shadow-lg dark:shadow-black/10":"!border-t-0"):"!border-b-subtler rounded-t-2xl","border-subtle border","bg-raised p-3",a),children:[y==="top"&&P,U&&l.jsx("div",{ref:L,className:"flex flex-col items-stretch","data-testid":"autosuggestion-container",children:A.map((Q,Y)=>{const te=M[Q],se=gE[Q]||{order:999,showHeader:!1};let ae=0;for(let X=0;X_?{strategy:_}:void 0,[_]),H=d.useMemo(()=>w?{className:"flex z-[1]"}:void 0,[w]);return l.jsx(zf,{isOpen:e,matchTargetWidth:!0,disableAnimation:!0,placement:y,childrenClassName:"grow block",contentClassName:R,borderRadius:j,avoidCollisions:!1,disableShadow:!0,overlayProps:O,content:$,floatingElementProps:H,...G&&{customFloatingUIOptions:G},children:f})});$A.displayName="SuggestDropdown";const SX=T.memo(({value:e,suggestDropdownProps:t,ResizeableInputWrapperProps:n,ResizeableInputProps:r,leftAttributionComponents:s,rightAttributionComponents:o,syncUncontrolledOnce:a})=>{const i=r.onChange,c=r.ref,u=d.useRef(null),f=d.useRef(e);f.current=e;const m=d.useRef(null),p=d.useRef(!1),h=d.useCallback(g=>{u.current=g,c instanceof Function?c(g):c&&(c.current=g)},[c]);return d.useEffect(()=>{const g=u.current?.value;g&&g!==f.current&&(!a||!p.current)&&i?.(g),a&&(p.current=!0)},[i,a]),jf("ask-input"),l.jsx($A,{...t,floatingStrategy:"absolute",shouldEnableStacking:!0,portalTarget:m.current??void 0,value:e,children:l.jsxs(LA,{...n,ref:m,children:[l.jsx(FA,{...r,ref:h}),s,o]})})});SX.displayName="AskInputBase";class R9e{static isAnyInputElementFocused(){const t=document.activeElement;return!!(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.getAttribute("contenteditable")==="true"||t.getAttribute("role")==="textbox"))}}function D9e({value:e,json:t,isDisabled:n,handleSubmit:r,handleSuggestDropdownNavigation:s,querySource:o,focusInput:a,isInputActive:i}){const{isMobileUserAgent:c}=Re(),u=d.useRef(e),f=d.useRef(t);u.current=e,f.current=t;const m=d.useCallback(x=>n&&Ls.isEnterKeyWithoutShift(x)?(x.preventDefault(),!0):!1,[n]),p=d.useCallback(x=>x.isComposing?(x.preventDefault(),!0):!1,[]),h=d.useCallback(x=>{Ls.isEnterKeyWithoutShift(x)&&!c&&(x.preventDefault(),r({query:u.current,json:f.current,querySource:o}))},[r,o,c]),g=d.useCallback(x=>{const v=Ls.isCtrlOrCmdJ(x),b=Ls.isOnlySlashKey(x);if(v||b){if(i||R9e.isAnyInputElementFocused())return;x.preventDefault(),a()}},[a,i]);return d.useEffect(()=>(document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}),[g]),d.useCallback(x=>{m(x)||p(x)||s(x)||h(x)},[m,p,s,h])}const j9e=(e,t)=>{const{value:n,loading:r}=qt({flag:"clear-ask-input-suggestions-when-disabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};function I9e({handleSubmit:e,inputQuery:t}){const{session:n}=je(),{trackEvent:r}=Ke(n),s=d.useRef(t);s.current=t;const o=zo(),{sidecarSourceTab:{url:a}}=zn();return d.useCallback((c,u)=>{const f=fa();if(r("auto suggestion accepted",{mode:"dropdown-complete",query:s.current,completion:c.query,completion_uuid:c.query_uuid,completion_position:u,url:c.url,isNavigational:!!c.url,frontendContextUUID:f,searchMode:o,isPersonalized:c.isPersonalized,sourceDomain:Ur(a)}),c.isPersonalized&&fetch("/rest/autosuggest/track-query-clicked",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:c.query,search_mode:o})}).catch(()=>{}),c.url){window.open(c.url,"_self");return}e({query:c.submission_query??c.query,promptSource:"autosuggest",querySource:"autosuggest",newFrontendContextUUID:f})},[e,o,r,a])}function P9e({inputQuery:e}){const{session:t}=je(),{trackEventBatch:n}=Ke(t),r=d.useRef(e);r.current=e;const s=zo(),{sidecarSourceTab:{url:o}}=zn();return d.useCallback(i=>{if(r.current.length!==0)return;const c=i.map((u,f)=>({name:"auto suggestion blank state viewed",data:{mode:"dropdown-complete",query:r.current,completion:u.query,completion_uuid:u.query_uuid,completion_position:f,url:u.url,isNavigational:!!u.url,searchMode:s,sourceDomain:Ur(o)}}));n(c)},[s,n,o])}const O9e=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"should-show-general-suggestions-on-ntp",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Qf=Ze({productionMs:3e3}),L9e=Ze({productionMs:5e3}),Vj={TASK_LIMIT_EXCEEDED:"TASK_LIMIT_EXCEEDED",SHORTCUT_NAME_ALREADY_EXISTS:"SHORTCUT_NAME_ALREADY_EXISTS"},F9e=async({taskId:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/tasks/{task_id}",n,{params:{path:{task_id:e}},timeoutMs:Ze(),numRetries:Kl,headers:t});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get user task",cause:s,status:o.status??0});return r?.task?aye(r.task):null},B9e=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/",t,{body:e});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to create user task",cause:r,status:s.status??0});return n},Hj=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/{task_id}",n,{params:{path:{task_id:e}},body:t});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to update user task",cause:s,status:o.status??0});return r},EX=async({taskId:e,reason:t})=>de.DELETE("/rest/tasks/{task_id}",t,{params:{path:{task_id:e}},timeoutMs:Qf}),U9e=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/finance",t,{body:e});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to create user finance task",cause:r,status:s.status??0});return n},V9e=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/finance/{task_id}",n,{params:{path:{task_id:e}},body:t});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to update user finance task",cause:s,status:o.status??0});return r},H9e=async({ticker:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/finance/tickers/{ticker}",t,{params:{path:{ticker:e}},timeoutMs:Ze(),numRetries:Kl});if(r)throw Z.error("Failed to get finance ticker",r),new ye("API_CLIENTS_ERROR",{message:"Failed to get finance ticker",cause:r,status:s.status??0});return n},gbt=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/shortcuts",t,{body:e,timeoutMs:Qf});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},ybt=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/shortcuts/slug",t,{body:e,timeoutMs:L9e});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},xbt=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/shortcuts/{task_id}",n,{body:t,params:{path:{task_id:e}},timeoutMs:Qf});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r},vbt=async({shortcutId:e,reason:t})=>{const{data:n,error:r,response:s}=await de.DELETE("/rest/tasks/shortcuts/defaults/{shortcut_id}",t,{params:{path:{shortcut_id:e}},timeoutMs:Qf});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},bbt=async({shortcutId:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/shortcuts/copy/{shortcut_id}",t,{params:{path:{shortcut_id:e}},timeoutMs:Qf});if(r)throw new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},z9e=async({reason:e,headers:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/shortcuts/mentions",e,{params:{query:{order_by:"created_at"}},timeoutMs:Qf,numRetries:Kl,headers:t});if(r)throw Z.error("Failed to get shortcut typeahead options",r),new ye("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},kX=({reason:e,...t})=>{const n=Vt();return gt({queryKey:Dye(),queryFn:async()=>{const{tasks:r}=await z9e({reason:e});return r},...t,enabled:n&&(t.enabled??!0)})},_bt=async({query:e,keywords:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/autosuggest/reformulate-query",n,{body:{query:e,keywords:t}});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.reformulated_query}catch(r){return Z.error("Failed to fetch refinement query",r),null}},W9e=async({sources:e,attachments:t,searchMode:n,sourceTabUrl:r,entropyRenderingPlace:s,reason:o})=>{try{if(t&&t.length>0)return Ie;if(e.length===0)return Ie;const{data:a,error:i,response:c}=await de.POST("/rest/autosuggest/list-autosuggest",o,{body:{query:"",sources:e,attachments:t,search_mode:n,source_tab_url:r,entropy_rendering_place:s}});if(i)throw new ye("API_CLIENTS_ERROR",{cause:i,status:c.status??0});return a.results??Ie}catch(a){return Z.error(a),Ie}},G9e=async({onCreateShortcut:e,shortcuts:t})=>{try{const s=[...[...t].filter(o=>o.prompt&&o.prompt.trim().length>0).sort(()=>Math.random()-.5).slice(0,6).map(o=>({query:o.prompt,title:o.task_name,shouldShowTitle:!0,category:"shortcuts"}))];return e&&s.push({query:"",query_uuid:"create-shortcut-button",title:"Create a shortcut",description:"",category:"shortcuts",icon:"plus",shouldShowTitle:!0,actionHandler:e}),s}catch(n){return Z.error("Failed to fetch shortcuts suggestions",n),Ie}},$9e=async({query:e,reason:t,country:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/list-autosuggest",t,{params:{query:{query:e,country:n}},timeoutMs:0});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.results??Ie}catch(r){return Z.error(r),[]}},q9e=(e,t)=>{const{value:n,loading:r}=qt({flag:"sidecar-personalized-query-suggestions",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},qA="sidecar-personalized-queries-cache",yE=1e3*60*10,K9e="sidecar";function Y9e(e){try{let n=new URL(e).hostname.toLowerCase();return n.startsWith("www.")&&(n=n.slice(4)),n}catch{return""}}function Q9e(){try{const e=wt.getItem(qA);if(e)return JSON.parse(e)}catch{}return null}function X9e(e){wt.setItem(qA,JSON.stringify(e))}async function Z9e(e,t,n){if(e!==null&&e.nonce!==null&&e.timestamp>n-yE&&e.domain_suggestions.length>0)return{nonce:e.nonce,domain_suggestions:e.domain_suggestions};const{data:r,error:s}=await de.POST("/rest/browser/personalization/sidecar-recommended-queries",K9e,{body:{last_refresh_timestamp_ms:e?.timestamp??0,nonce:e?.nonce??"",history_items:t},timeoutMs:3e4});return s?(Z.error("Failed to fetch sidecar personalized queries:",s),{domain_suggestions:[],nonce:""}):r?.domain_suggestions===null||!r?.domain_suggestions?{domain_suggestions:e?.domain_suggestions??[],nonce:e?.nonce??""}:r}function J9e(e,t){const n=e.find(r=>r.domain===t);return n?n.suggestions.map(r=>({query:r.query})):[]}const eDe=14,tDe=1500,nDe=(e,t)=>{const{session:n}=je(),r=ln(!1),s=Y9e(e),{variation:o,loading:a}=q9e(!1,{userEmail:n?.user?.email??""}),i=Q9e(),{data:c}=gt({queryKey:be.makeQueryKey("sidecar-personalized-queries",t,o,a),queryFn:async()=>{if(!r||!e||!t)return[];if(!o)return a||wt.removeItem(qA),[];const u=Date.now();if(i&&i.domain_suggestions.length>0&&u-i.timestamp({url:g.url,title:g.title,last_accessed:g.last_accessed,visit_count:g.visit_count})),p=await Z9e(i,m,u),h={nonce:p.nonce,timestamp:u,domain_suggestions:p.domain_suggestions};return h.domain_suggestions.length>0&&X9e(h),p.domain_suggestions}catch(f){return Z.error(f),i?.domain_suggestions??[]}},placeholderData:()=>t?i?.domain_suggestions??[]:[],refetchInterval:yE,enabled:t});return J9e(c??[],s)},fw=({sources:e,attachments:t,searchMode:n,focus:r,isCometHome:s,reason:o,enabled:a})=>{const{sidecarSourceTab:{url:i}}=zn(),u=Ml().erp,{isMobileUserAgent:f}=Re(),m=ln(),p=Vt(),{openModal:h}=gn().legacy,{data:g}=kX({reason:o}),{variation:y}=O9e(!1),x=nDe(i||"",u==="sidecar"),v=d.useCallback(()=>{h("taskShortcutModal",{source:"suggestions_dropdown"})},[h]),b=d.useMemo(()=>s&&n===oe.SEARCH?be.makeEphemeralQueryKey("comet-blank-state-suggest",n,!0,g):r==="finance"?be.makeEphemeralQueryKey("finance-blank-state-suggest"):be.makeEphemeralQueryKey("blank-state-suggest",e,t,n,u==="sidecar"?i:""),[e,t,n,r,s,i,u,g]);return gt({queryKey:b,enabled:a,queryFn:async()=>{if(s&&n===oe.SEARCH&&!y)return await(p&&g?G9e({onCreateShortcut:v,shortcuts:g}):Promise.resolve([]));if(r==="finance")return(await $9e({query:"",reason:o,country:"US"})).map((E,N)=>({query:E.query||`suggestion-${N}`,title:E.title??void 0,image:E.image??void 0,description:E.description??void 0,category:E.category??void 0,query_uuid:E.query_uuid??void 0,url:E.url??void 0,metadata:E.metadata??void 0}));const[_,w]=await Promise.all([W9e({sources:e,attachments:t,searchMode:n,sourceTabUrl:u==="sidecar"?i:"",entropyRenderingPlace:u,reason:o}),u==="sidecar"?Nhe({entropyBrowser:m,url:i}):Promise.resolve([])]);return[...x.map(S=>({...S,isPersonalized:!0})),...w,..._].slice(0,Np(f))}})},rDe=e=>{const{setSuggestions:t,setBlankStateSuggestions:n}=Po(),{sidecarSourceTab:{url:r,secondaryTab:s}}=zn(),a=Ml().erp,i=d.useRef(void 0),c=d.useRef(e.selectedSearchMode),{blankStateSuggestions:u}=Kr(),f=u[e.selectedSearchMode],m=r?Ur(r):void 0,p=d.useMemo(()=>{if(e.suggestionsDisabled)return!0;const S=a==="sidecar";return S&&m&&m===i.current||S&&s},[e.suggestionsDisabled,a,m,s]);!p&&i.current!==m&&(i.current=m);const h=!p,{data:g,isLoading:y}=fw({...e,searchMode:oe.SEARCH,enabled:h}),x=h&&!y,{data:v,isLoading:b}=fw({...e,searchMode:oe.RESEARCH,enabled:x}),_=x&&!b,{data:w}=fw({...e,searchMode:oe.STUDIO,enabled:_});return d.useEffect(()=>{p?n(Ie,oe.SEARCH):g&&n(g,oe.SEARCH)},[g,n,p]),d.useEffect(()=>{p?n(Ie,oe.RESEARCH):v&&n(v,oe.RESEARCH)},[v,n,p]),d.useEffect(()=>{p?n(Ie,oe.STUDIO):w&&n(w,oe.STUDIO)},[n,p,w]),d.useEffect(()=>{(e.query?.length??0)>0||f&&((a==="sidecar"||c.current!==e.selectedSearchMode)&&t(f),c.current=e.selectedSearchMode)},[e.query,e.selectedSearchMode,f,t,a]),null};function MX({userInputQuery:e,userInputJson:t,suggestionsDisabled:n,suggestions:r,focusedIndex:s,setFocusedIndex:o,onChange:a,handleSuggestionSubmission:i,placement:c="bottom",inputRef:u}){const f=d.useRef(e),m=d.useRef(t),p=d.useRef(r),h=d.useRef(s);f.current=e,m.current=t,p.current=r,h.current=s,r.forEach(_=>_);const g=d.useCallback((_,w)=>{if(w>0){const S=(h.current+1)%w,C=p.current[S];if(C?.query){const E=C.query;a(E)}return _.preventDefault(),S}return null},[a]),y=d.useCallback(_=>{let w=h.current-1;if(w<0)w=-1,h.current===0&&(_.preventDefault(),a(f.current,m.current));else{_.preventDefault();const S=p.current[w];if(S?.query){const C=S.query;a(C)}}return w},[a]),x=d.useCallback((_,w)=>{if(w>0){const S=h.current<=0?w-1:(h.current-1)%w,C=p.current[S];if(C?.query){const E=C.query;a(E)}return _.preventDefault(),S}return null},[a]),v=d.useCallback((_,w)=>{let S=h.current+1;if(S>=w||S===0)S=-1,h.current===w-1&&(_.preventDefault(),a(f.current,m.current));else{_.preventDefault();const C=p.current[S];if(C?.query){const E=C.query;a(E)}}return S},[a]);return d.useCallback(_=>{if(n)return!1;const w=Ls.isArrowDown(_),S=Ls.isArrowUp(_);if(w){if(c==="bottom"&&h.current===-1&&!u.current?.inLine("last"))return!1;const C=c==="bottom"?g(_,p.current.length):v(_,p.current.length);if(C!==null)return o(C),!0}else if(S){if(c==="top"&&h.current===-1&&!u.current?.inLine("first"))return!1;const C=c==="bottom"?y(_):x(_,p.current.length);if(C!==null)return o(C),!0}else if(Ls.isEnterKeyWithoutShift(_)&&h.current>=0&&h.currente==="travel"||e==="shopping"||e==="academic"||e==="patents"||e==="sports"||e==="language-learning",oDe=({autosuggestionsEnabled:e=!0,inputQuery:t,inputJson:n,isInputActive:r,onChange:s,handleSuggestionSubmission:o,handleSuggestionView:a,querySource:i,hasThreadContent:c,isMentionMenuOpened:u,placement:f="bottom",inputRef:m})=>{const{isWindowsAppPanelView:p}=Yx(),[h,g]=d.useState(-1),[y,x]=d.useState(t),[v,b]=d.useState(n),_=Ln(),[w]=Gd("isSuggestionsDisabled",!1),S=FY(),C=Yz(_),E=owe(_),{activeMenu:N,suggestions:k}=Kr(),{currentOpenedModal:I}=gn().legacy,{setSuggestions:M,setShowSuggestDropdown:A}=Po(),D=d.useMemo(()=>w||!e||!S&&!C&&!p&&!E&&!sDe(i)&&!1||i!=="finance"&&t.length>y9e&&!k.some(({query:F})=>F===t)||c,[w,e,S,C,E,p,i,t,c,k]),P=MX({userInputQuery:y,userInputJson:v,suggestionsDisabled:D,suggestions:k,focusedIndex:h,setFocusedIndex:g,onChange:s,handleSuggestionSubmission:o,placement:f,inputRef:m});return d.useEffect(()=>{h===-1&&(x(t),b(n))},[t,h,n]),d.useEffect(()=>{D&&(M(Ie),g(-1))},[D,M,g]),d.useEffect(()=>{const F=!D&&r&&!N&&!I&&k.length>0&&!u;A(F),F&&a(k)},[D,r,N,I,k,u,A,a]),d.useMemo(()=>({focusedIndex:h,setFocusedIndex:g,suggestionsDisabled:D,userInputQuery:y,handleSuggestDropdownNavigation:P,placement:f}),[h,P,D,y,f])};function aDe({value:e,json:t,querySource:n,disableSubmission:r=!1,disableInput:s=!1,autofocus:o=!0,isUploadingFile:a=!1,onChange:i,onFocus:c,onBlur:u,handleSubmit:f,handleUpdateAutosuggestions:m,autosuggestionsEnabled:p=!0,errorMessage:h,sources:g,attachments:y,selectedSearchMode:x,isInputActive:v,setIsInputActive:b,updateOnFocus:_=!1,inFlight:w=!1,resultsLength:S=0,quote:C,isMentionMenuOpened:E,isCometHome:N=!1,reason:k,placement:I="bottom"}){const{activeMenu:M,inputRef:A}=Kr(),D=Hwe(),{setShouldTriggerFocus:P}=qx(),{blankStateSuggestions:F}=Kr(),{setSuggestions:R}=Po(),{onActiveMenuChange:j}=Po(),{device:{isAndroid:L}}=on(),U=d.useMemo(()=>!!C||e.trim().length>0||!!y&&y.length>0,[C,e,y]),O=r||s||!!h||a||!U,$=d.useCallback(pe=>{const{mentions:xe}=BW(t?.root);f({...pe,mentions:xe.length>0?xe:void 0})},[t,f]),G=I9e({handleSubmit:$,inputQuery:e}),H=P9e({inputQuery:e}),{focusedIndex:Q,setFocusedIndex:Y,suggestionsDisabled:te,userInputQuery:se,handleSuggestDropdownNavigation:ae}=oDe({autosuggestionsEnabled:p,inputQuery:e,inputJson:t,isInputActive:v&&p,onChange:i,handleSuggestionView:H,handleSuggestionSubmission:G,querySource:n,hasThreadContent:w||S>0,isMentionMenuOpened:E,placement:I,inputRef:A});rDe({sources:g,attachments:y,selectedSearchMode:x,suggestionsDisabled:te,focus:n==="finance"?"finance":void 0,query:e,isCometHome:N,reason:k});const X=d.useCallback(()=>{A.current?.focus(),b(!0)},[A,b]),ee=d.useCallback(pe=>{c?.(pe),b(!0),j(null),_&&m(A.current?.value??""),L&&setTimeout(()=>{A.current?.scrollIntoView({behavior:"smooth",block:"center"})},300)},[c,j,m,b,_,A,L]);d.useEffect(()=>{D&&o&&(X(),P(!1))},[D,X,P,o]);const le=d.useCallback(()=>(u?.(),b(!1),Y(-1),!0),[u,Y,b]),{variation:re}=j9e(!1),ce=d.useCallback((pe,xe)=>{if(i(pe,xe),te){re&&R([]);return}pe.trim().length===0&&F[x]?(R(F[x]),m(pe)):_9e(pe)&&m(pe)},[i,te,m,F,R,x,re]),ue=D9e({value:e,json:t,isDisabled:O,handleSubmit:$,handleSuggestDropdownNavigation:ae,querySource:n,focusInput:X,isInputActive:v});return d.useEffect(()=>{M!==null?A.current?.blur():o&&X()},[M,A,X,o]),d.useMemo(()=>({isDisabled:O,focusedIndex:Q,setFocusedIndex:Y,userInputQuery:se,handleSuggestionSubmission:G,handleFocus:ee,handleBlur:le,handleChange:ce,handleKeyDown:ue,focusInput:X,hasQuery:U}),[X,Q,le,ce,ee,ue,G,U,O,Y,se])}const iDe=({fileUploadRef:e,fileHandlingRef:t,showFileUpload:n,attachments:r,setAttachments:s,handleChange:o,setIsUploadingFile:a,focusInput:i,onFileAttachComplete:c})=>{const{inputRef:u}=Kr(),f=eT(),[m,p]=d.useState(null),h=d.useCallback(_=>{const w=r===void 0?"paste.txt":`paste-${r.length+1}.txt`,S=new File([_],w,{type:"text/plain"}),C=new DataTransfer;C.items.add(S),p({content:_,fileName:w}),e.current?.uploadFiles(C.files)},[r,e]),g=d.useCallback(()=>{p(null)},[]);d.useImperativeHandle(t,()=>({clearAutoCreatedTextFile:g}),[g]);const y=d.useCallback(_=>{const w=_.clipboardData;if(w&&w.items.length>0){const S=new DataTransfer;for(const C of w.items){if(C.kind==="file"){_.preventDefault();const E=C.getAsFile();E&&S.items.add(E)}if(C.type==="text/plain"){const E=_.clipboardData.getData("Text");E.length>Mc&&(_.preventDefault(),h(E))}}e.current?.uploadFiles(S.files)}requestAnimationFrame(()=>{u.current&&(u.current.trim(),o(u.current.value,u.current.json))})},[e,o,u,h]),x=d.useCallback(_=>{o(_),u.current?.focus()},[o,u]),v=d.useCallback(_=>{a(!1),_.length>0?(s(_),i(),c?.(_)):s(void 0)},[a,s,i,c]),b=d.useCallback(async _=>{const w=new DataTransfer;for(const S of _){if(S.kind==="file"){const C=S.webkitGetAsEntry();if(!C)continue;if(MW(C)){const E=S.getAsFile();E&&w.items.add(E)}else if(TW(C)){const E=await bCe(C);for(const N of E)w.items.add(N)}}if(S.type==="text/plain"&&S.getAsString(C=>{C.length>Mc?h(C):u.current&&(u.current.append(C),o(u.current.value,u.current.json))}),w.items.length>f)break}e.current?.uploadFiles(w.files)},[e,u,o,f,h]);return d.useEffect(()=>{n||(s(void 0),p(null))},[n,s]),d.useMemo(()=>({handlePaste:y,handlePasteQuery:x,handleCompleteFileUpload:v,handleFileSelect:b,autoCreatedTextFile:m,dismissNotification:g,setAutoCreatedTextFile:p}),[v,b,y,x,m,g])},lDe="transparent 135deg, oklch(var(--default-color)) 180deg, transparent 225deg",TX=T.memo(({children:e,borderRadius:t,borderGradientStops:n=lDe,defaultColor:r="var(--super-color)"})=>{const[s,o]=d.useState(1),a=d.useCallback(u=>{u!==null&&o(u.clientWidth/u.clientHeight)},[]),i=d.useMemo(()=>({"--default-color":r,"--button-border-gradient-stops":n,"--button-aspect-ratio":s,"--button-aspect-ratio-multiplier":.65,transform:"translateY(-50%) scaleX(calc(var(--button-aspect-ratio) * var(--button-aspect-ratio-multiplier))"}),[s,n,r]),c=d.useMemo(()=>({animation:"spin 5s linear infinite"}),[]);return l.jsxs("div",{className:"relative overflow-hidden p-px",ref:a,style:{borderRadius:t},children:[l.jsx("div",{className:"bg-base relative z-[1]",style:{borderRadius:t-1},children:e}),l.jsx("div",{style:i,className:"absolute inset-0 top-1/2 flex size-full items-center justify-center p-px will-change-transform",children:l.jsx("div",{style:c,className:"absolute aspect-square min-h-full w-full origin-center bg-[conic-gradient(var(--button-border-gradient-stops))] blur"})})]})});TX.displayName="AnimatedGradientBorderWrapper";function cDe({reason:e}){const t=Xt();return It({mutationFn:()=>S_e({reason:e}),onSuccess:()=>{t.invalidateQueries({queryKey:cu()})}})}function uDe({reason:e}){return It({mutationFn:async({connectionType:t,content:n})=>{await E_e({connectionType:t,content:n,reason:e})}})}var Rp;(function(e){e.TIMEOUT="TIMEOUT",e.AUTH="AUTH",e.POPUP_BLOCKED="POPUP_BLOCKED"})(Rp||(Rp={}));class dDe extends Error{code;constructor(t,n){super(n),this.code=t,this.name="MicrosoftPickerError"}}const zj=(e,t)=>new dDe(e,t),KA=[".txt",".pdf",".docx",".pptx",".xlsx",".md",".csv"],YA=[".txt",".pdf",".jpg",".jpeg",".png",".docx",".pptx",".xlsx",".md",".csv"],QA=[".mp3",".wav",".aiff",".ogg",".flac",".mp4",".mpeg",".mov",".avi",".flv",".mpg",".webm",".wmv",".3gp"],Wj=27,fDe=2e4;let mw=!1,_i=null;const mDe=()=>{const e=d.useRef(null),t=d.useRef(null),n=d.useRef(null);let r="";typeof window<"u"&&(window.location.hostname==="localhost"?r=`${window.location.protocol}//${window.location.hostname}:${window.location.port}/account/connectors`:r=`${window.location.protocol}//${window.location.hostname}/account/connectors`);const s=d.useCallback(f=>!!f&&f.length===36&&f.split("-").length===5,[]),o=d.useCallback((f,m,p,h,g)=>{if(!m&&f==="sharepoint"&&p){const y=p.match(/^https?:\/\/([^.]+)\.sharepoint\.com/i);if(y)return y[1]}if(!m&&f==="onedrive"&&s(g)&&h){const y=h.match(/@([^.]+)\./);if(y)return y[1]+"-my"}return m?f==="sharepoint"?m:m+"-my":null},[s]),a=d.useCallback(async(f,m)=>{m.success=!1;let p=null;const h=o(f.connector,f.tenantName,f.webUrl,f.loginHint,f.accountIdentifier);m.tenant=h,_i||(_i=await(await q(()=>import("./index-kR08Osiu.js"),__vite__mapDeps([150,1]))).PublicClientApplication.createPublicClientApplication({auth:{authority:h?"https://login.microsoftonline.com/common":"https://login.microsoftonline.com/consumers",clientId:f.clientId,redirectUri:r},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!0}}));const g=h?[`https://${h}.sharepoint.com/.default`]:["OneDrive.ReadWrite"];m.scopes=g;const y={scopes:g,login_hint:f.loginHint,prompt:"select_account"};let x=null,v=_i.getActiveAccount();if(v||(v=_i.getAllAccounts().find(_=>_.username===f.loginHint)??null),m.hasActiveAccount=!!v?.username,v)try{_i.setActiveAccount(v),x=(await _i.acquireTokenSilent(y)).accessToken}catch(b){m.silentAcquisitionError=b instanceof Error?b.toString():b}if(!x&&!mw)try{mw=!0;const b=await _i.loginPopup(y);_i.setActiveAccount(b.account),x=(await _i.acquireTokenSilent(y)).accessToken}catch(b){m.interactiveAcquisitionError=b instanceof Error?b.toString():b,b?.errorCode==="popup_window_error"&&(m.interactiveAcquisitionErrorCode="popup_window_error",p=Rp.POPUP_BLOCKED)}finally{mw=!1}else x||(m.interactiveAuthenticationSkipped=!0);if(x)return m.success=!0,m.accessTokenLength=x.length,x;throw zj(p??Rp.AUTH,"Access token not acquired")},[r,o]),i=d.useCallback(f=>{const m=o(f.connector,f.tenantName,f.webUrl,f.loginHint,f.accountIdentifier);let p=f.mode==="source"?KA:YA;p=f.isAudioVideoFilesEnabled?p.concat(QA):p;const h=f.connector==="sharepoint"?{recent:!0,oneDrive:!1,sharedLibraries:!0}:{recent:!0,oneDrive:!0,sharedLibraries:!1},g={sdk:"8.0",messaging:{origin:r,channelId:Wj},authentication:{},entry:f.connector==="sharepoint"?{sharePoint:{}}:{oneDrive:{}},typesAndSources:{mode:f.mode==="attachment"?"files":"all",filters:p,pivots:h},selection:{mode:"multiple"}},y=new URLSearchParams({filePicker:JSON.stringify(g)});return f.webUrl?`${f.webUrl}/_layouts/15/FilePicker.aspx?${y}`:m?`https://${m}.sharepoint.com/_layouts/15/FilePicker.aspx?${y}`:`https://onedrive.live.com/picker?${y}`},[r,o]),c=d.useCallback(async f=>{const m=S=>{window.removeEventListener("message",y),t.current?.removeEventListener("message",g),t.current?.close(),e.current?.close(),S?f.onError?.(S):f.onCancel?.()},p=(S,C)=>(n.current||(n.current=(async()=>{try{return await a(S,C)}finally{n.current=null}})()),n.current),h=async(S,C)=>n.current?await n.current:await new Promise((E,N)=>{const k=setTimeout(()=>{N(zj(Rp.TIMEOUT,"Request timed out"))},fDe);p(S,C).then(I=>{clearTimeout(k),E(I)}).catch(I=>{clearTimeout(k),N(I)})}),g=async S=>{const C={};switch(S.data.type){case"command":t.current?.postMessage({type:"acknowledge",id:S.data.id});const E=S.data.data;switch(E.command){case"authenticate":try{const N=await h(f,C);t.current?.postMessage({type:"result",id:S.data.id,data:{result:"token",token:N}})}catch(N){C.errorStep="authenticateCommand",C.error=N instanceof Error?N.toString():N,m(N)}finally{f.log?.(f.connectionType??f.connector.toUpperCase(),C)}break;case"pick":t.current?.postMessage({type:"result",id:S.data.id,data:{result:"success"}}),f.onPicked?.(E.items),m();break;case"close":m();break;default:m();break}break}},y=async S=>{if(S.source&&S.source===e.current){const C=S.data;C.type==="initialize"&&C.channelId===Wj&&(t.current=S.ports[0],t.current.addEventListener("message",g),t.current.start(),t.current.postMessage({type:"activate"}))}};let x;const v={};try{x=await p(f,v)}catch(S){v.errorStep="initialization",v.error=S instanceof Error?S.toString():S,m(S);return}finally{f.log?.(f.connectionType??f.connector.toUpperCase(),v)}const b=document.getElementById("microsoft-file-picker");if(!b){m();return}if(e.current=b.contentWindow,!e?.current){m();return}const _=e.current.document.createElement("form");_.setAttribute("action",i(f)),_.setAttribute("method","POST"),e.current.document.body.append(_);const w=e.current.document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("name","access_token"),w.setAttribute("value",x),_.appendChild(w),e.current.document.body.appendChild(_),_.submit(),window.addEventListener("message",y)},[a,i]),u=d.useCallback((f,m)=>{let p;if(f.parentReference.sharepointIds?.siteId&&m==="sharepoint"){const g={item_id:f.id,drive_id:f.parentReference.driveId,site_id:f.parentReference.sharepointIds.siteId};p=JSON.stringify(g)}else p=f.id;const h=hu(f.name);return h?{id:p,name:f.name,sizeBytes:f.size,mimeType:oE[h]}:null},[]);return d.useMemo(()=>({openPicker:c,toPickerDocument:u}),[c,u])},pDe=({reason:e,mode:t})=>{const n=J(),[r,s]=d.useState(!1),[o,a]=d.useState(null),{openToast:i}=pn(),{openModal:c,closeModal:u}=gn().legacy,{openPicker:f,toPickerDocument:m}=mDe(),{mutateAsync:p}=uDe({reason:e}),h=d.useCallback(b=>{b.connector==="sharepoint"&&t==="attachment"?c("sharepointSiteModal",{onSelectSite:_=>{u(),b&&(s(!0),a({...b,webUrl:_}),f({...b,webUrl:_}))}}):(s(!0),a(b),b.connector==="onedrive"&&f(b))},[u,t,c,f]),g=d.useCallback(()=>{s(!1),a(null)},[s,a]),y=d.useCallback(b=>{Z.error("A Microsoft file picker error occured:",b),g();const _=b;let w;switch(_?.code){case"POPUP_BLOCKED":w=n.formatMessage({defaultMessage:"We couldn't open the {formattedName} sign-in window. Please allow pop-ups for this site in your browser and try again.",id:"IjzaY+voOq"},{formattedName:I0});break;case"TIMEOUT":w=n.formatMessage({defaultMessage:"{formattedName} is taking longer than usual. This may be a network issue. Please try again.",id:"CEncF+/g5h"},{formattedName:I0});break;case"AUTH":w=n.formatMessage({defaultMessage:"We couldn't sign in to {formattedName}. Please check your Microsoft account access and try again.",id:"aHs4QljX82"},{formattedName:I0});break;default:w=n.formatMessage({defaultMessage:"{formattedName} had an unexpected error. Please try again in a few moments.",id:"ApZ6o/tZ3n"},{formattedName:I0})}i({message:w,variant:"error",timeout:5})},[g,i,n]),x=d.useCallback((b,_)=>{p({connectionType:b,content:_})},[p]),v=d.useCallback(b=>{o&&(a({...o,webUrl:b}),f({...o,webUrl:b}))},[o,f]);return d.useMemo(()=>({onOpen:h,onClose:g,onError:y,onSelectSite:v,toPickerDocument:m,log:x,isOpen:r,options:o}),[r,x,g,y,h,v,o,m])},Tv=({reason:e})=>{const t=Xt(),{mutateAsync:n}=It({mutationKey:P0(),mutationFn:async a=>(await M_e({request:{url:a.url,thread_id:a.thread_id},reason:e})).file_url,onSuccess:(a,i,c)=>{t.setQueryData(P0(i.url),a),i.callback?.(a,!1)},onError:(a,i,c)=>{i.callback?.("",!1)},retry:!1}),r=d.useCallback(a=>{const i=t.getQueryData(P0(a));return typeof i=="string"?i:null},[t]),s=d.useCallback(async a=>{a.callback?.("",!0);const i=r(a.url);if(i)return a.callback?.(i,!1),i;const c=await n(a);return a.callback?.(c,!1),c},[r,n]),o=d.useCallback(async(a,i)=>{const c=URL.createObjectURL(i);t.setQueryData(P0(a),c)},[t]);return d.useMemo(()=>({getCachedImageDownloadUrl:r,getImageDownloadUrl:s,cacheImageDownloadUrl:o}),[o,r,s])};function hDe(){const{value:e}=Tf({flag:"attachment-token-estimation-params",defaultValue:{max_total_tokens:5e5,type_bytes_per_token:{text:4,image:500},type_subtype_bytes_per_token:{"application/pdf":200,"application/msword":500,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":500,"application/vnd.openxmlformats-officedocument.presentationml.presentation":500},default_bytes_per_token:100},subjectType:"user_nextauth_id"});return e}const Gj="box-file-picker",gDe="0";let K0=null,$j=!1;const yDe=()=>K0||(K0=new Promise((e,t)=>{const n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn01.boxcdn.net/platform/elements/17.1.0/en-US/picker.css",n.onload=()=>{fM({id:"box-picker-script",src:"https://cdn01.boxcdn.net/platform/elements/17.1.0/en-US/picker.js"}).then(()=>{if(!$j){const r=document.createElement("style");r.textContent=` - .be .be-header input[type="search"] { - background: white; - } - - .btn-content { - display: flex; - justify-content: center; - align-items: center; - } - `,document.head.appendChild(r),$j=!0,e()}},t)},document.head.appendChild(n)}),K0),xDe=({mode:e,isAudioVideoFilesEnabled:t,onPicked:n,onCancel:r,onError:s})=>{const o=d.useRef(null),a=d.useCallback(async({apiKey:c,pickerType:u="file"})=>{try{if(await yDe(),!document.getElementById(Gj)){s?.("Attempted to open picker when container isn't ready");return}let m=e==="source"?KA:YA;m=t?m.concat(QA):m;const p=[...m,".gdocs",".gsheets",".gslides"];o.current&&(o.current.removeListener("choose",n),o.current.removeListener("cancel",r),o.current.hide(),o.current=null);let h;u==="folder"?h=new window.Box.FolderPicker:h=new window.Box.FilePicker,o.current=h,h.addListener("choose",n),h.addListener("cancel",r),h.show(gDe,c,{container:`#${Gj}`,logoUrl:Sx,extensions:p.join(","),canUpload:!1,canSetShareAccess:!1,canCreateNewFolder:!1,chooseButtonLabel:"Select",cancelButtonLabel:"Cancel"})}catch(f){s?.(f);return}},[s,e,r,n,t]),i=d.useCallback(()=>{o.current&&(o.current.removeListener("choose",n),o.current.removeListener("cancel",r),o.current.hide(),o.current=null)},[n,r]);return d.useMemo(()=>({openPicker:a,cleanupPicker:i}),[a,i])};function qj(){const e=document.getElementById("dropboxjs");e&&document.body.removeChild(e)}const vDe=()=>{const[e,t]=d.useState(null),n=d.useCallback(async s=>{e!==s&&(qj(),t(null),await fM({id:"dropboxjs",src:"https://www.dropbox.com/static/api/2/dropins.js",attrs:{"data-app-key":s}}),t(s))},[e]),r=d.useCallback(async s=>{await n(s.clientId);let o=s.mode==="source"?KA:YA;o=s.isAudioVideoFilesEnabled?o.concat(QA):o,window.Dropbox.choose({success:s.onPicked,error:a=>s.onError?.(a),multiselect:!0,extensions:o,folderselect:s.mode==="source"})},[n]);return d.useEffect(()=>()=>{qj()},[]),d.useMemo(()=>({openPicker:r}),[r])};function bDe(e){return e.every(t=>t instanceof File)}const _De=({fileInputRef:e,isSignedIn:t,uploadRateLimit:n,maxFilesUpload:r,attachmentTokenEstimationParams:s,forwardedRef:o,existingAttachments:a,showPrivacyWarning:i,onFilePickerOpen:c,onStart:u,onComplete:f,openLoginModal:m,openPricingModal:p,openCompanyDataPrivacyModal:h,closeModal:g,openVisitorLoginUpsell:y,openMicrosoftPicker:x,closeMicrosoftPicker:v,errorMicrosoftPicker:b,toPickerDocument:_,setUploadRateLimit:w,isFollowUp:S,isClearAttachmentsEnabled:C=!1,forceImage:E,refreshBoxCredentials:N,logMicrosoft:k,asyncAttachmentsEnabled:I=!1,setUploadsReady:M,getImageUrl:A,isAudioVideoFilesEnabled:D=!1,reason:P,maxAttachmentFileSizeMB:F=Ghe,specialCapabilities:R={unlimitedProSearch:!1,maxModelSelection:!1,unlimitedResearch:!1,fileUpload:!1},onRemoveFile:j,getUserSettingsQueryKey:L,getUserSettings:U})=>{const{$t:O,locale:$}=J(),{openToast:G}=pn(),[H,Q]=d.useState(null),[Y,te]=d.useState(null),[se,ae]=d.useState(!1),[X,ee]=d.useState([]),le=d.useCallback(fe=>{ee(Fe=>Fe.filter(Le=>Le.id!==fe))},[]),[re,ce]=d.useState(X&&X.length>0?"success":"idle"),[ue,pe]=d.useState(null),xe=`${F}MB`,he=d.useCallback(async(fe,Fe,Le)=>{if(!Tr(fe))return null;const dt=Le?{type:Le}:void 0,it=D4(fe)?fe:await A?.(fe)??fe;if(!it)return new File([],Fe,dt);try{const Gn=await(await fetch(it)).blob();return new File([Gn],Fe,dt)}catch{return new File([],Fe,dt)}},[A]);d.useEffect(()=>{C?ee([]):(async()=>{const Fe=await Promise.all((a??Ie).map(async Le=>{const dt=p3(Le.split("/").pop()||"file"),it=ny(Le);let At=new File([],dt,{type:it}),Gn;if(Tr(At)){const dr=await he(Le,dt,it);At=dr??At,Gn=dr?URL.createObjectURL(dr):void 0}return{id:crypto.randomUUID(),file:At,nextURL:Le,status:"success",thumbnailSource:Gn}}));ee(Fe)})()},[C,a,he]),d.useEffect(()=>{if(!M)return;if(!I||!X.length){M(!0);return}const fe=Le=>Le.status==="parsing"||Le.status==="success"||Le.status==="failed",Fe=X.every(fe);M(Fe)},[X,I,M]),d.useImperativeHandle(o,()=>({uploadFiles:fe=>Qe(Array.from(fe)),clearFiles:_e}));const _e=d.useCallback(()=>{ee([]),ce("idle"),f?.([]),e.current?.value&&(e.current.value=""),pe(null)},[e,f]),ke=d.useCallback((fe,Fe)=>{ee(Le=>{let dt=Le;return fe?dt=Le.filter(it=>it.nextURL!==fe):Fe&&(dt=Le.filter(it=>!it.nextURL?.includes(Fe))),dt.length===0&&ce("idle"),f?.(dt.filter(it=>!!it.nextURL).map(it=>({url:it.nextURL??"",file:it.file,resizedFile:it.resizedFile}))??[]),j?.(fe,Fe),dt}),e.current?.value&&(e.current.value="")},[e,f,j]),De=d.useCallback(()=>{ee([]),ce("idle"),e.current?.value&&(e.current.value=""),pe(null)},[e]),Ce=d.useCallback(fe=>{te(null),Q(fe??O(go[ad.generic_upload_error])),X?.length&&ce("success")},[O,X?.length]),Be=d.useCallback(()=>{if(!m)return;const fe=O({defaultMessage:"Sign in to upload files and photos",id:"gEOi1eLJ7C"}),Fe=O({defaultMessage:"Analyze files and photos for free",id:"nu4bK5/Y5T"});y?y({title:fe,description:Fe,origin:lt.FILE_UPLOAD,sheetModalVariant:S?"bottom-sheet-gradient":"full-sheet"}):m({origin:lt.FILE_UPLOAD,pitchMessage:{title:fe,description:Fe}})},[O,S,m,y]),we=d.useCallback(()=>{if(!p)return;const fe=O({defaultMessage:"Want more uploads?",id:"iInvIJ0Dv/"}),Fe=O({defaultMessage:"Upgrade access for subscribers",id:"UwiL3wLZE3"});p({pitchMessage:{title:fe,description:Fe},origin:lt.FILE_UPLOAD})},[O,p]),$e=d.useCallback(async(fe,Fe)=>{let Le;I?Le=await Qxe({request:{file_uuids:[fe]},reason:P}):Le={file_uuid:fe,success:!0,error_code:null,token_limit_exceeded:!1};const dt=Le.success?"success":"failed";dt==="failed"?(Ce(O(go[Le.error_code??f3.parsing_error],{filename:Fe})),ee(it=>it.filter(At=>At.file_uuid!==fe))):(Le.token_limit_exceeded&&(ae(!0),te(O(go.token_limit_exceeded,{filename:Fe}))),ee(it=>[...(it??[]).map(At=>At.file_uuid===fe?{...At,status:dt}:At)]))},[Ce,I,O,P]),yt=d.useCallback(fe=>fe instanceof File&&Y7.includes(fe.type)||!(fe instanceof File)&&fe.mimeType&&Y7.includes(fe.mimeType)?O(go[ad.unsupported_type]):fe instanceof File&&fe.size>F*K7||!(fe instanceof File)&&fe.sizeBytes&&fe.sizeBytes>F*K7?O(go[ad.too_large],{max:xe}):fe instanceof File&&fe.size{if(!fe.ok){Ce(),Z.warn(`[localAttachmentUpload] upload failed for ${At}, response=${fe}`);return}let Gn=null;try{const $n=await fe.json();if($n?.moderation?.[0]?.status==="rejected"){Ce(O(go.failed_moderation)),Z.warn(`[localAttachmentUpload] upload failed moderation for ${At}, response=${fe}`);return}Gn=qR($n?.eager?.[0]?.secure_url??$n?.secure_url)}catch{Gn=`${Le}${dt}`.replace("${filename}",`${Fe.name}`)}if(!Gn){Ce();return}const dr=wd(Gn)?"success":"parsing";ee($n=>$n.map(kn=>kn.id===it?{...kn,nextURL:Gn,file_uuid:At,status:dr}:kn)),ce("success"),pe("local"),At&&dr=="parsing"&&await $e(At,Fe.name)},[Ce,O,$e]),ve=d.useCallback(async(fe,Fe,Le)=>{if(!fe?.success){Ce();return}if(fe.rate_limited){we(),Ce(O(go.rate_limited)),le(Le);return}if(!fe.filename||!fe.url){Ce();return}const dt=fe.url&&wd(fe.url)?qR(fe.url):p3(fe.url),it=ny(dt);console.log(fe.url,fe.filename,it);const At=await he(fe.url,fe.filename,it),Gn=wd(fe.url)?"success":"parsing";ee(dr=>dr.map($n=>$n.id===Le?{...$n,file:At??$n.file,nextURL:dt,file_uuid:fe.file_uuid??void 0,status:Gn,thumbnailSource:At?URL.createObjectURL(At):void 0}:$n)),ce("success"),pe(Fe),fe.file_uuid&&Gn=="parsing"&&await $e(fe.file_uuid,fe.filename)},[he,Ce,we,O,$e,le]),Ae=d.useCallback(async(fe,Fe)=>{const Le=()=>ee(it=>it.filter(At=>At.id!==Fe.id));if(fe?.error){fe.error==="attachments_disabled_by_organization"?Ce(O(go[ad.attachments_disabled_by_organization])):Ce(),Le();return}if(fe?.rate_limited){we(),Le(),Ce(O(go.rate_limited)),le(Fe.id);return}if(!fe||!fe.fields||!fe.s3_bucket_url){Ce(),Le();return}sY(Fe)&&ee(it=>it.map(At=>At.id===Fe.id?{...At,thumbnailSource:URL.createObjectURL(Fe.file)}:At));const dt=new FormData;Object.entries(fe.fields).forEach(([it,At])=>{dt.append(it,At)}),dt.append("file",Fe.file);try{const it=await fetch(fe.s3_bucket_url,{method:"POST",body:dt});await me(it,Fe.file,fe.s3_bucket_url,fe.fields.key,Fe.id,fe.file_uuid??void 0)}catch(it){Z.warn(`[localAttachmentUpload] upload failed for ${fe.file_uuid} with error=${it}`),Ce(),Le()}},[we,Ce,O,me,le]),Ge=d.useCallback(fe=>{const Fe=fe.filter(dt=>dt.status==="success").reduce((dt,it)=>{const At=it.file.type,Gn=At.split("/")[0],dr=s?.type_subtype_bytes_per_token?.[At],$n=s?.type_bytes_per_token?.[Gn],kn=s?.default_bytes_per_token,Zn=dr??$n??kn,Wr=it.file.size,Ms=Zn?Wr/Zn:0;return dt+Ms},0),Le=s?.max_total_tokens;return Le&&Fe>Le},[s]);d.useEffect(()=>{if(!X.length||se)return;X.every(Fe=>Fe.status==="success"||Fe.status==="failed")&&Ge(X)&&te(O({defaultMessage:"Performance may be degraded for larger files.",id:"xwKpaJzWgU"}))},[X,Ge,O,se]);const ht=d.useCallback(async fe=>{const{fileList:Fe,fileSource:Le,setUploadRateLimit:dt}=fe,it=[],At=Fe.map(async kn=>{const Zn=yt(kn);if(Zn)return{file:kn,error:Zn};let Wr=kn;if(Tr(kn))try{Wr=await TNe(kn)}catch{Z.warn(`Unable to resize image file: ${kn.name}`)}return{file:Wr,error:null}}),Gn=await Promise.all(At);for(const kn of Gn){if(kn.error){Ce(kn.error);continue}const Zn=crypto.randomUUID(),Wr={id:Zn,file:kn.file,status:"uploading"};it.push({uuid:Zn,file:kn.file,uploadedFile:Wr}),ee(Ms=>[...Ms??[],Wr])}if(it.length===0)return;const dr=await Kxe({filesWithUuids:it.map(({uuid:kn,file:Zn})=>({uuid:kn,file:Zn})),fileSource:Le,forceImage:E,reason:P});let $n=0;dr?await Promise.all(it.map(async({uuid:kn,uploadedFile:Zn})=>{const Wr=dr[kn];Wr&&(await Ae(Wr,Zn),$n++)})):(it.forEach(({uploadedFile:kn})=>{le(kn.id)}),Ce(O({defaultMessage:"Failed to get upload URLs. Please try again.",id:"JaG6Y+rSl4"}))),n&&n>0&&dt&&dt($n)},[yt,Ce,E,P,Ae,n,le,O]),mt=d.useCallback((fe,Fe,Le)=>{bDe(fe)?ht({fileList:fe,fileSource:Le,setUploadRateLimit:w}):Fe&&fe.forEach(dt=>{const it=yt(dt);if(it)Ce(it);else{const At=ny(dt.name??""),Gn=new File([""],dt.name??"",{type:At}),dr={id:dt.id,file:Gn,status:"uploading"};ee($n=>[...$n??[],dr]),Yxe({remote_file_id:dt.id,connection_type:Fe.toUpperCase(),reason:P}).then($n=>{ve($n,Fe,dr.id)})}})},[yt,Ce,ve,ht,P,w]),Qe=d.useCallback((fe,Fe,Le)=>{if(!(!fe||fe.length===0)){if(Le!==yV){if(!t&&!R.fileUpload){Be();return}if(n&&n<=0){we();return}if(fe.length+(X?.length??0)>r){Q(O(go.over_file_count,{maxNumFiles:r}));return}}u?.(),ce("loading"),mt(fe,Fe,Le)}},[t,n,X,r,mt,u,Be,we,O,R.fileUpload]),Tt=d.useCallback(async(fe,Fe,Le)=>{try{const it=await(await fetch(fe)).blob(),At=Le||it.type||"application/octet-stream";return new File([it],Fe,{type:At})}catch{return new File([],Fe,Le?{type:Le}:void 0)}},[]),Ye=d.useCallback(async(fe,Fe,Le)=>{const it=(Le?Le.startsWith("image/"):Tr(fe))?await he(fe,Fe,Le):await Tt(fe,Fe,Le);it&&Qe([it],"local")},[Tt,he,Qe]),Me=gt({queryKey:L({skipConnectorPickerCredentials:!1}),queryFn:()=>U({reason:P,headers:$?{"accept-language":$}:{},skipConnectorPickerCredentials:!1}),enabled:!1}),Ve=d.useCallback(async fe=>{const dt=(await(async()=>{if(Me.status==="success")return Me.data;const{data:it}=await Me.refetch();return it})())?.connectors.connectors.find(it=>it.name===fe);return dt||(Z.error(`Connector ${fe} not found in user settings`),null)},[Me]),{openPicker:ct}=wQ({isAudioVideoFilesEnabled:D}),vt=d.useCallback(async fe=>{const Fe=await Ve("google_drive");if(!Fe){G({variant:"error",message:O({defaultMessage:"Failed to open Google Drive file picker",id:"Ja2aztZ3b+"}),timeout:5e3});return}ct({...fe,clientId:Fe.picker_credentials?.client_id??"",loginHint:Fe.connection_display_name??""})},[Ve,ct,G,O]),[Dt,ot]=d.useState(!1),$t=d.useCallback(()=>ot(!1),[]),fn=d.useCallback(fe=>{const Fe=fe.map(Le=>({id:Le.id,name:Le.name,sizeBytes:Le.size,mimeType:oE[Le.extension]}));Qe(Fe,"box"),$t()},[Qe,$t]),{openPicker:ut,cleanupPicker:bt}=xDe({mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:fn,onCancel:$t}),jt=d.useCallback(async(fe={})=>{const Fe=await Ve("box");if(!Fe){G({variant:"error",message:O({defaultMessage:"Failed to open Box file picker",id:"+Yt3OYcUhg"}),timeout:5e3});return}const Le=Fe.picker_credentials?.expires_at;if(Le&&N){const dt=new Date(Le);if(isNaN(dt.getTime())){ot(!0);return}if(dt{ot(!0)},[]);d.useEffect(()=>{Dt&&jt()},[Dt,jt]);const Kt=d.useCallback((fe,Fe)=>{if(!_||Fe!=="onedrive"&&Fe!=="sharepoint")return;const Le=fe.map(dt=>_(dt,Fe)).filter(dt=>dt!==null);Qe(Le,Fe),v?.()},[_,Qe,v]),{openPicker:ur}=vDe(),Xn=d.useCallback(async fe=>{const Fe=await Ve("dropbox");if(!Fe){G({variant:"error",message:O({defaultMessage:"Failed to open Dropbox file picker",id:"1xye5E73zP"}),timeout:5e3});return}ur({...fe,clientId:Fe.picker_credentials?.client_id??""})},[Ve,ur,G,O]),_n=d.useCallback(fe=>{const Fe=fe.map(Le=>{const dt=hu(Le.name);return dt?{id:Le.id,name:Le.name,sizeBytes:Le.bytes,mimeType:oE[dt]}:null}).filter(Le=>Le!==null);Qe(Fe,"dropbox")},[Qe]),nr=d.useCallback(()=>Ce(O({defaultMessage:"Unable to retrieve files from connector.",id:"4seKuUP1Wo"})),[Ce,O]),Xr=d.useCallback(async(fe,Fe)=>{if(!x)return;const Le=await Ve(fe);if(!Le){const dt=O(fe==="onedrive"?{defaultMessage:"Failed to open OneDrive file picker",id:"L7gmeOx2re"}:{defaultMessage:"Failed to open SharePoint file picker",id:"/2WBhsPWAQ"});G({variant:"error",message:dt,timeout:5e3});return}x({...Fe,connector:fe,clientId:Le.picker_credentials?.client_id??"",tenantName:Le.picker_credentials?.tenant_name??"",loginHint:Le.connection_display_name??"",accountIdentifier:Le.picker_credentials?.account_identifier})},[Ve,x,G,O]),Zo=d.useCallback((fe,Fe)=>{fe=="google_drive"?vt({mode:"attachment",onPicked:Le=>Qe(Le,fe)}):fe==="onedrive"||fe==="sharepoint"?Xr(fe,{webUrl:Fe,mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:Le=>Kt(Le,fe),onError:b,onCancel:v,log:k}):fe==="dropbox"?Xn({mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:_n,onError:nr}):fe=="box"&&pt()},[vt,Qe,Xr,Kt,v,b,Xn,_n,nr,pt,k,D]),uc=d.useCallback(fe=>{h&&h(()=>{g?.(),!fe||fe==="local"?(e.current?.click(),c?.()):Zo(fe)})},[e,g,h,Zo,c]),ds=d.useCallback(fe=>{if(!t&&!R.fileUpload){Be();return}if(n&&n<=0){we();return}if(i&&!hr(zy)){uc(fe),lo(zy,"true",{expires:30});return}!fe||fe==="local"?(e.current?.click(),c?.()):Zo(fe)},[t,n,i,e,Be,we,uc,Zo,c,R.fileUpload]);return d.useEffect(()=>{let fe=null;return Y&&(fe=setTimeout(()=>{te(null)},Whe)),()=>{fe&&clearTimeout(fe)}},[Y]),d.useEffect(()=>{X&&f?.(X.filter(fe=>!!fe.nextURL).map(fe=>({url:fe.nextURL??"",file:fe.file,resizedFile:fe.resizedFile})))},[X,f]),d.useMemo(()=>({errorMessage:H,warningMessage:Y,uploadedFiles:X,uploadSource:ue,status:re,fileInputRef:e,handleClearFiles:_e,handleRemoveFile:ke,handleStartUpload:ds,handleFileInput:Qe,attachFromUrl:Ye,removeAllFiles:De,handleOpenLoginModal:Be,handleOpenPricingModal:we,isBoxOpen:Dt,onCloseBox:$t,cleanupBoxPicker:bt,setErrorMessage:Q}),[H,Y,X,ue,re,e,_e,ke,ds,Qe,Ye,De,Be,we,Dt,$t,bt])},wDe=({fileUploadRef:e,disablePrivacyWarning:t,isAudioVideoFilesEnabled:n,isClearAttachmentsEnabled:r,isFollowUp:s,organization:o,lastResult:a,onStartFileUpload:i,onCompleteFileUpload:c,setUploadsReady:u,reason:f,specialCapabilities:m,askInputRef:p,onRemoveFile:h})=>{const g=d.useRef(null),{inputRef:y}=Kr(),{openModal:x,closeModal:v}=gn().legacy,b=eT(),_=hDe(),{value:w}=qt({flag:"async-attachment-processing",defaultValue:!1,subjectType:"user_nextauth_id"}),S=Vt(),{openVisitorLoginUpsell:C}=di({enabled:!S}),E=mu(),{hasDataRetentionWarning:N,connectorLimits:k}=Sa({reason:f}),{uploadRateLimit:I,setUploadRateLimit:M}=Fn(),{hasActiveSubscription:A}=Bt(),D=I??(A?AM:TM),P=d.useCallback(re=>x("loginModal",re),[x]),F=d.useCallback(re=>{E(re)},[E]),R=d.useCallback(re=>x("companyDataPrivacyModal",{organizationName:o?.display_name??"",onContinue:re}),[x,o]),{onOpen:j,onClose:L,onError:U,toPickerDocument:O,options:$,onSelectSite:G,isOpen:H,log:Q}=pDe({reason:f,mode:"attachment"}),{mutateAsync:Y}=cDe({reason:f}),{getCachedImageDownloadUrl:te,getImageDownloadUrl:se}=Tv({reason:f}),ae=d.useCallback(async re=>a?.backend_uuid?await se({url:re,thread_id:a.backend_uuid}):te(re),[te,se,a?.backend_uuid]),X=_De({fileInputRef:g,isSignedIn:S,uploadRateLimit:D,maxFilesUpload:b,attachmentTokenEstimationParams:_,forwardedRef:e,showPrivacyWarning:N&&!t,onStart:i,onComplete:c,openLoginModal:P,openPricingModal:F,openCompanyDataPrivacyModal:R,closeModal:v,openVisitorLoginUpsell:C,openMicrosoftPicker:j,closeMicrosoftPicker:L,errorMicrosoftPicker:U,toPickerDocument:O,setUploadRateLimit:M,isFollowUp:s,isClearAttachmentsEnabled:r,refreshBoxCredentials:Y,logMicrosoft:Q,asyncAttachmentsEnabled:w,setUploadsReady:u,getImageUrl:ae,isAudioVideoFilesEnabled:n,reason:f,maxAttachmentFileSizeMB:k?.max_attachment_file_size_mb,specialCapabilities:m,onRemoveFile:h,getUserSettingsQueryKey:cu,getUserSettings:OH}),{attachFromUrl:ee,removeAllFiles:le}=X;return d.useImperativeHandle(p??null,()=>({addMediaFile:async(re,ce,ue)=>{await ee(re,ce,ue)},focusInput:()=>{y.current?.focus()},blurInput:()=>{y.current?.blur()},removeAttachments:()=>{le()}}),[ee,y,le]),d.useMemo(()=>({...X,fileInputRef:g,microsoftFilePickerOptions:$,handleSelectSharepointSite:G,isMicrosoftFilePickerOpen:H,onCloseMicrosoft:L,addMediaFile:ee,removeAllFiles:le}),[X,G,H,$,L,ee,le])},CDe=({setInput:e})=>{const t=mn();d.useEffect(()=>{if(!t)return;const n=t.get("p_q");n&&e(n)},[t,e])};function SDe(){return Intl.DateTimeFormat().resolvedOptions().timeZone}async function EDe({body:e,reason:t}){try{const{data:n,error:r,response:s}=await de.POST("/rest/realtime/v1/transcription-session",t,{timeoutMs:Ze({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json"}});return r?{status:s.status,error:`Failed to get GA realtime transcription session: ${s.statusText}`}:{data:n,status:s.status,error:null}}catch(n){return Z.error("Failed to get GA realtime transcription session",n),{data:null,status:500,error:`Failed to get GA realtime transcription session: ${n}`}}}async function wbt({body:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/search-youtube",t,{timeoutMs:Ze({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json",...n?{[xn]:n}:{}}});if(s)throw Z.error("Failed to search video",s),new ye("API_CLIENTS_ERROR",{message:"Failed to search video",cause:s,status:o.status??0});return r}async function Cbt({body:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/search-web",t,{timeoutMs:Ze({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json",...n?{[xn]:n}:{}}});if(s)throw Z.error("Failed to search web",s),new ye("API_CLIENTS_ERROR",{message:"Failed to search web",cause:s,status:o.status??0});return r}async function Sbt({entry:e,analyticsParams:t,reason:n,requestId:r}){const{data:s,error:o,response:a}=await de.POST("/rest/realtime/create-entry",n,{timeoutMs:Ze({productionMs:5e3}),numRetries:1,body:{...e,analytics_params:{...t,timezone:SDe()}},headers:{"content-type":"application/json",...r?{[xn]:r}:{}}});if(o)throw Z.error("Failed to create entry",o),new ye("API_CLIENTS_ERROR",{message:"Failed to create entry",cause:o,status:a.status??0});return s}async function Ebt({params:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/v1/upload-audio",t,{timeoutMs:Ze({productionMs:3e4}),numRetries:2,body:e,headers:{"content-type":"application/json",...n?{[xn]:n}:{}}});if(s)throw Z.error("Failed to upload audio",s),new ye("API_CLIENTS_ERROR",{message:"Failed to upload audio",cause:s,status:o.status??0});return r}async function kbt({body:e,reason:t,requestId:n}){try{const{data:r,error:s,response:o}=await de.POST("/rest/realtime/v2/session",t,{timeoutMs:Ze({productionMs:1e4,clientSideMs:1e4}),numRetries:2,body:e,headers:{"content-type":"application/json",...n?{[xn]:n}:{}}});return s?{status:o.status,data:void 0,error:o.statusText||"Failed to create realtime session v2"}:{status:o.status,data:r,error:void 0}}catch(r){return Z.error("Failed to create realtime session v2",r),{status:500,data:void 0,error:`Failed to create realtime session v2: ${r}`}}}async function kDe({body:e,reason:t}){try{const{data:n,error:r,response:s}=await de.POST("/rest/realtime/v2/language-learning/session",t,{timeoutMs:Ze({productionMs:1e4,clientSideMs:1e4}),numRetries:1,body:e,headers:{"content-type":"application/json"}});return r?{status:s.status,data:void 0,error:s.statusText||"Failed to create language learning session v2"}:{status:s.status,data:n,error:void 0}}catch(n){return Z.error("Failed to create language learning session v2",n),{status:500,data:void 0,error:`Failed to create language learning session v2: ${n}`}}}const Mbt="web.frontend.realtime.voice",Tbt="oai-realtime-v2v-tool-call",Abt=4096,MDe=.7;var Kj;(function(e){e.BrowserGetUrlContent="get_full_page_content",e.ControlBrowser="control_browser",e.CloseBrowserTabs="close_browser_tabs",e.GroupOpenBrowserTabs="group_open_browser_tabs",e.OpenNewBrowserTab="open_page",e.SearchBrowser="search_browser",e.UngroupOpenBrowserTabs="ungroup_open_browser_tabs"})(Kj||(Kj={}));var Yj;(function(e){e.ActiveTabs="active_tabs",e.BrowsingHistory="browsing_history"})(Yj||(Yj={}));var xl;(function(e){e.MobileWeb="mobile_web",e.Web="web",e.macOS="macos",e.iOS="ios",e.Android="android",e.Windows="windows"})(xl||(xl={}));const Nbt=3e3,Rbt=3,Dbt=5;function jbt(e){const t=e.toLowerCase();return t.includes("airpod")||t.includes("headphone")||t.includes("earbud")||t.includes("headset")?"near_field":t.includes("built-in")||t.includes("internal")||t.includes("macbook")||t.includes("laptop")||t.includes("usb")||t.includes("conference")||t.includes("desk")||t.includes("array")||t.includes("camera")?"far_field":null}const TDe=e=>e.isWindowsApp?NM:Ca()?xV():e.isIOS?qhe:e.isAndroid?Khe:e.isMobile?ume:dme,ADe=e=>e.isChrome||e.isFirefox?e.isMobile?xl.MobileWeb:xl.Web:e.isMacOS?xl.macOS:e.isIOS?xl.iOS:e.isAndroid?xl.Android:e.isWindowsOS?xl.Windows:"",NDe=()=>{const{device:{isWindowsApp:e,isIOS:t,isAndroid:n,isMobile:r}}=on();return TDe({isWindowsApp:e,isIOS:t,isAndroid:n,isMobile:r})},Ibt=()=>{const{device:{isChrome:e,isFirefox:t,isMobile:n,isMacOS:r,isIOS:s,isAndroid:o,isWindowsOS:a}}=on();return ADe({isChrome:e,isFirefox:t,isMobile:n,isMacOS:r,isIOS:s,isAndroid:o,isWindowsOS:a})},RDe=({callbacks:e,config:t,reason:n})=>{const[r,s]=d.useState(!1),[o,a]=d.useState(""),[i,c]=d.useState(!1),[u,f]=d.useState(null),[m,p]=d.useState(()=>{const ee=wt.getItem(E_);return ee?ee==="true":null}),{session:h}=je(),{trackEvent:g}=Ke(h),y=NDe(),x=t.silenceThreshold??30,v=t.silenceDuration??5e3,b=d.useRef(null),_=d.useRef(null),w=d.useRef(""),S=d.useRef(null),C=d.useRef(!1),E=d.useRef(null),N=d.useRef(null),k=d.useRef(null),I=d.useRef(null),M=d.useRef(null),A=d.useRef(new Map),D=d.useRef(null),P=d.useRef(null),F=d.useRef(null),R=d.useRef([]),j=d.useRef(null),L=d.useCallback(async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(le=>le.stop()),p(!0),wt.setItem(E_,"true"),!0}catch(ee){return f(`Microphone permission denied. ${ee}`),p(!1),wt.setItem(E_,"false"),!1}},[]),U=d.useRef(!1),O=d.useCallback(()=>{S.current&&(S.current.getTracks().forEach(ee=>ee.stop()),S.current=null)},[]),$=d.useCallback(()=>{if(C.current=!1,k.current&&(clearTimeout(k.current),k.current=null),E.current&&(E.current.close(),E.current=null,N.current=null),b.current&&r&&b.current.stop(),j.current&&(clearInterval(j.current),j.current=null),F.current&&(F.current.port.onmessage=null,F.current.disconnect(),F.current=null),_.current&&_.current.stop(),O(),w.current="",a(""),A.current.clear(),s(!1),M.current&&(M.current.close(),M.current=null),I.current){const ee=Date.now()-I.current;g("stop transcription",{durationMs:ee})}I.current=null,e?.onStop?.()},[e,O,g,r]),G=d.useCallback(ee=>{if(!ee||!C.current)return;const le=ee.frequencyBinCount,re=new Uint8Array(le);ee.getByteFrequencyData(re),re.reduce((ue,pe)=>ue+pe)/le{C.current&&e?.onSilence?.()},v)):k.current&&(clearTimeout(k.current),k.current=null),C.current&&requestAnimationFrame(()=>G(ee))},[e,x,v]),H=d.useCallback(()=>Array.from(A.current.values()).map(le=>le.finalTranscript||le.partialTranscript||"").join(" ").trim(),[A]),Q=d.useCallback(ee=>{const{type:le,item_id:re}=ee;if(!re)return;A.current.has(re)||A.current.set(re,{itemId:re,partialTranscript:"",finalTranscript:""});const ce=A.current.get(re),ue=P.current||"";switch(le){case"conversation.item.input_audio_transcription.delta":{const{delta:pe}=ee;ue==="whisper-1"?ce.partialTranscript=pe:ce.partialTranscript+=pe;break}case"conversation.item.input_audio_transcription.completed":{const{transcript:pe}=ee;typeof pe=="string"&&(ce.finalTranscript=pe);break}case"input_audio_buffer.committed":{ee.previous_item_id&&(ce.previousItemId=ee.previous_item_id);break}}A.current.set(re,ce),a(H())},[H]),Y=d.useCallback(async()=>{const ee=await EDe({body:{source:y,timezone:bM,turn_detection_threshold:MDe,response_language:"en"},reason:n});if(!ee.data?.client_secret)throw Z.error("No ephemeral key from server"),new Error("Unable to start OAI session");D.current=ee.data.session_id,P.current=ee.data.model_name;const re=["realtime",`openai-insecure-api-key.${ee.data.client_secret}`],ce=new WebSocket("wss://api.openai.com/v1/realtime?intent=transcription",re);M.current=ce,ce.onopen=()=>Z.info("OpenAI WS connected (base64 PCM approach)"),ce.onerror=ue=>{Z.error("OAI WS error:",ue),f("OpenAI WS error")},ce.onclose=ue=>{Z.info("OAI WS closed:",ue.code)},ce.onmessage=ue=>{try{const pe=JSON.parse(ue.data);Q(pe)}catch(pe){Z.error("Invalid OAI WS message:",ue.data,pe)}}},[Q,y,n]),te=d.useCallback(ee=>{let le=0;for(const ue of ee)le+=ue.length;const re=new Int16Array(le);let ce=0;for(const ue of ee)re.set(ue,ce),ce+=ue.length;return re},[]),se=d.useCallback(ee=>{const le=ee.buffer;let re="";const ce=new Uint8Array(le);for(const ue of ce)re+=String.fromCharCode(ue);return btoa(re)},[]),ae=d.useCallback(async ee=>{const le=new AudioContext;E.current=le,await le.audioWorklet.addModule("/audio-worklet.js");const re=new AudioWorkletNode(le,"pcm-worklet-processor");F.current=re,re.port.onmessage=ue=>{if(!C.current)return;const pe=ue.data;R.current.push(pe)},j.current||(j.current=setInterval(()=>{if(!C.current||!M.current||M.current.readyState!==WebSocket.OPEN||R.current.length===0)return;const ue=te(R.current);R.current=[];const pe=se(ue),xe={event_id:`evt-${Date.now()}`,type:"input_audio_buffer.append",audio:pe};M.current.send(JSON.stringify(xe))},500));const ce=le.createMediaStreamSource(ee);ce.connect(re),re.connect(le.destination),N.current=le.createAnalyser(),N.current.fftSize=256,ce.connect(N.current),requestAnimationFrame(()=>G(N.current))},[G,te,se]),X=d.useCallback(async()=>{if(f(null),I.current=Date.now(),g("start transcription"),C.current=!0,(m===null||m===!1)&&(c(!0),!await L())){c(!1),f("Microphone permission is required for voice input"),e?.onStop?.(),C.current=!1;return}try{await Y();const ee=await navigator.mediaDevices.getUserMedia({audio:!0}).catch(async le=>{if(p(!1),!await L())throw le;return navigator.mediaDevices.getUserMedia({audio:!0})});S.current=ee,await ae(ee),U.current&&_.current&&(w.current="",a(""),_.current.start(),_.current.onspeechend=()=>$()),s(!0),c(!1),e?.onStart?.()}catch(ee){f(`Failed to start recording. ${ee}`),C.current=!1}},[e,m,L,g,$,Y,ae]);return d.useMemo(()=>({isTranscribing:r,isInitializing:i,transcription:o,error:u,startTranscription:X,stopTranscription:$}),[u,i,r,X,$,o])},DDe=1e4,b2="autosuggest",jDe="AUTOSUGGEST_MESSAGE_MALFORMED",IDe="AUTOSUGGEST_MESSAGE_PARSE_ERROR",PDe="AUTOSUGGEST_WS_CONNECTION_ERROR",ODe="AUTOSUGGEST_WS_SEND_QUERY_ERROR",LDe=()=>{const{device:{isMobile:e}}=on(),t=Xt();return d.useCallback(n=>{const r=t.getQueryData(be.makeEphemeralQueryKey(b2)),s=t.getQueryData(be.makeEphemeralQueryKey(b2,n));if(s?.length&&s.length===Np(e))return s;if(r){const o=n.replace(/\s+/g,"").toLocaleLowerCase(),a=[];for(const f of r){if(e&&f.url)continue;const[m,p]=hX(o,f);if(m&&(a.push([p,f]),a.length===Np(e)))break}const i=a.sort(([f],[m])=>f-m).map(([f,m])=>m),[c,u]=hE(i,e,n);if(s?.length){const f=[...s];for(const m of c)if(!f.find(p=>p.query===m.query)&&(f.push(m),f.length===Np(e)))break;return hE(f,e,n)[1]}return u}return Ie},[e,t])},FDe=()=>{const{suggestions:e}=Kr(),{setSuggestions:t}=Po(),n=d.useRef(e);n.current=e;const r=Xt(),s=LDe(),o=d.useRef(!1),{device:{isMobile:a}}=on(),i=d.useRef(null),c=d.useRef(null),u=d.useRef([]),f=d.useRef({lastMessageID:0});d.useLayoutEffect(()=>()=>{o.current=!1},[]);const m=d.useCallback((y,x=!1)=>{const v=s(y);!x&&!v.length||(n.current.length!==v.length||Eme(n.current,v,"query").length!==v.length)&&(n.current=v,t(v))},[s,t]),p=d.useCallback(y=>{try{const x=new WebSocket("wss://suggest.perplexity.ai/suggest/ws");x.onopen=()=>{y?.()},x.onmessage=v=>{let b;try{if(b=JSON.parse(v.data),b.length<4){Z.error(jDe,b);return}}catch(M){Z.error(IDe,M);return}const[_,w,S,C]=b,E=parseInt(S),N=w9e(C),[k,I]=hE(N,a);if(r.setQueryData(be.makeEphemeralQueryKey(b2),(M=Ie)=>k.length?zU([...k,...M],"query").sort((A,D)=>A.query.localeCompare(D.query)):M),r.setQueryData(be.makeEphemeralQueryKey(b2,_),I),E===f.current.lastMessageID&&o.current&&m(_,!0),f.current[E]){const M=performance.now()-f.current[E];u.current.push(M)}},i.current=x}catch(x){Z.error(PDe,x)}},[a,m,r]),h=d.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{i.current&&(i.current.close(),i.current=null)},DDe)},[]);d.useEffect(()=>(p(),h(),()=>{i.current&&i.current.close(),c.current&&clearTimeout(c.current)}),[p,h]);const g=d.useCallback((y,x=!0)=>{if(o.current=!!y.trim(),!o.current)return;m(y);const v=[WebSocket.OPEN,WebSocket.CONNECTING];if(!i.current||!v.includes(i.current.readyState)){x&&p(()=>{g(y,!1)});return}else h();const b=f.current.lastMessageID+1,_=b.toString();f.current.lastMessageID=b;try{const w=JSON.stringify({q:y,uuid:_,full_completion:!0});if(i.current.readyState===WebSocket.CONNECTING)return;i.current.send(w),f.current[b]=performance.now()}catch(w){Z.error(ODe,w)}},[p,h,m]);return d.useEffect(()=>{const y=setInterval(()=>{u.current.length!==0&&(R2e({latencies:u.current,isMobile:a}),u.current=[])},x9e);return()=>clearInterval(y)},[a]),d.useMemo(()=>({handleUpdateAutosuggestions:g}),[g])};function BDe(){const{value:e}=qt({flag:"clear-attachment-on-submission",subjectType:"user_nextauth_id",defaultValue:!1});return e}const UDe=({entropyBrowser:e,isSidecar:t,focusInput:n})=>{d.useEffect(()=>{if(!e||!t)return;const r=()=>{document.visibilityState==="visible"&&n()},s=e.subscribeQuickActionButtonFired(()=>{n()});return document.addEventListener("visibilitychange",r),()=>{s(),window.removeEventListener("visibilitychange",r)}},[e,n,t])},AX=T.memo(function(t){const{children:n,condition:r,Wrapper:s,...o}=t;return r?l.jsx(s,{...o,children:n}):n});AX.displayName="ConditionalWrapper";let Rm=0;function VDe(e,t,n=!1){const[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useCallback(g=>{g.preventDefault()},[]),c=d.useCallback(g=>{g?.dataTransfer?.types.includes("Files")&&(g.preventDefault(),s(!0),Rm++)},[]),u=d.useCallback(g=>{g.preventDefault(),Rm=Math.max(0,Rm-1),Rm===0&&s(!1)},[]),f=d.useCallback(g=>{g.preventDefault(),s(!1),a(!1),Rm=0,!t&&n&&g.dataTransfer?.items.length&&e(g.dataTransfer.items)},[t,e,n]),m=d.useCallback(g=>{g?.dataTransfer?.types.includes("Files")&&(g.preventDefault(),a(!0))},[]),p=d.useCallback(g=>{g.preventDefault(),a(!1)},[]),h=d.useCallback(g=>{g.preventDefault(),s(!1),a(!1),!t&&!n&&g?.dataTransfer?.items.length>0&&e(g.dataTransfer.items)},[t,e,n]);return d.useEffect(()=>(document.addEventListener("dragover",i),document.addEventListener("dragenter",c),document.addEventListener("dragleave",u),document.addEventListener("drop",f),()=>{document.removeEventListener("dragover",i),document.removeEventListener("dragenter",c),document.removeEventListener("dragleave",u),document.removeEventListener("drop",f)}),[i,c,u,f]),d.useMemo(()=>({isDraggingFile:r,isFileOver:o,rootProps:{onDragOver:m,onDragLeave:p,onDrop:h}}),[p,m,h,r,o])}const NX=T.memo(({onDrop:e,disabled:t=!1,children:n,dropZoneClassName:r,dropLabel:s,dropIcon:o=B("arrow-bar-to-down"),allowDropAnywhere:a=!1,hideContent:i=!1,...c})=>{const{$t:u}=J(),{isDraggingFile:f,isFileOver:m,rootProps:p}=VDe(e,t,a),h=s??u(a?{defaultMessage:"Dropped files appear here.",id:"9WR4elgZix"}:{defaultMessage:"Drop your files here.",id:"llIM82nPs+"});return l.jsxs("div",{className:"relative",...p,...c,children:[f&&t?l.jsx(K,{className:z("border-subtler bg-subtler absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed",{"!border-caution":m},r?.(f,m)),children:l.jsxs(V,{color:"red",children:[l.jsx(ge,{icon:o,className:"mr-2"}),"Drop zone disabled"]})}):f?l.jsxs(l.Fragment,{children:[l.jsx(K,{variant:"background",className:"absolute inset-0 z-20 rounded-2xl opacity-80"}),l.jsx(K,{className:z("gap-x-sm animate-in fade-in border-subtler absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed transition-all duration-200",{"!border-super":m},r?.(f,m)),children:!i&&l.jsxs(V,{color:"super",children:[l.jsx(ge,{icon:o,className:"mr-2"}),h]})})]}):null,n]})});NX.displayName="DropZone";const HDe=({value:e,json:t,querySource:n,placeholder:r,placeholderClassName:s,disableSubmission:o=!1,disableInput:a=!1,initialLayout:i="expanded",minRows:c=1,isFollowUp:u=!1,submitWillFork:f=!1,showSources:m=!1,useThreadSources:p=!1,showRecency:h=!1,showModelSelector:g=!0,showSearchModeSelector:y=!0,showFileUpload:x=!1,disableActionButtons:v=!1,showIncognitoHint:b,hasShadow:_=!1,autofocus:w=!0,disablePrivacyWarning:S=!1,fileUploadTooltip:C,className:E,headerComponent:N,showStopButton:k=!1,forceHideSuggestions:I=!1,onChange:M,onFocus:A,onBlur:D,onClick:P,onSubmit:F,onStopButtonClick:R=Ro,onFilePickerOpen:j,onFilePickerClose:L,autosuggestionsEnabled:U=!0,dropdownPlacement:O="bottom",dropdownClassName:$,useLexical:G=!1,mentionTypeaheadOptions:H,isCometHome:Q=!1,syncUncontrolledOnce:Y=!1,onTriggerTypeahead:te,layoutKey:se,isHighlighted:ae,isMissionControl:X,ref:ee,onRemoveFile:le,onFileAttachComplete:re,renderAttachments:ce=!0})=>{const ue=`ask-input-inner-${n}`,pe=d.useRef(!1),[xe,he]=d.useState(!1),[_e,ke]=d.useState(w),{suggestions:De,blankStateSuggestions:Ce,showSuggestDropdown:Be,browserAgentAllowOnceFromToggle:we,forceEnableBrowserAgent:$e}=Kr(),{setSuggestions:yt}=Po(),{isMobileStyle:me,isMobileUserAgent:ve}=Re(),{inputRef:Ae}=Kr(),[Ge,ht]=d.useState(!0),mt=d.useRef(null),{currentOpenedModal:Qe}=gn().legacy,Tt=!!Qe,Ye=Vt(),{quote:Me,setQuote:Ve}=Wo(),ct=BDe(),vt=zo(),{sources:Dt}=Fn(),{specialCapabilities:ot}=Qr(),{lastResult:$t,inFlight:fn,resultsLength:ut}=an(),bt=ln(),jt=J(),pt=d.useRef(null),Kt=d.useRef(null),[ur,Xn]=d.useState(!1),_n=d.useCallback(()=>Xn(!0),[]),nr=d.useCallback(()=>Xn(!1),[]),{cacheImageDownloadUrl:Xr}=Tv({reason:ue}),[Zo,uc]=d.useState(void 0),ds=d.useMemo(()=>Zo?.map(Mn=>Mn.url),[Zo]),fe=d.useMemo(()=>{if(e.length>Mc)return jt.formatMessage({defaultMessage:"Query is { numCharacters } characters too long",id:"yw04s2k4La"},{numCharacters:e.length-Mc})},[e,jt]),{handleUpdateAutosuggestions:Fe}=FDe(),Le=d.useCallback(Mn=>{if(!(pe.current||!Ge)){if(Fe(""),pe.current=!0,!Mn.query&&ds&&ds.length>0){const ms=du(ds[0]);Mn.query=ms!=="File"?ms:"File Attached"}fe?pe.current=!1:(setTimeout(()=>pe.current=!1,aT),F?.({query:Mn.query,json:Mn.json,attachments:ds,promptSource:Mn.promptSource,querySource:Mn.querySource,mentions:Mn.mentions,browserAgentAllowOnceFromToggle:we,forceEnableBrowserAgent:$e}),Zo?.forEach(ms=>{ms.file&&ms.file.size>0&&Tr(ms.url)&&Xr(ms.url,ms.resizedFile??ms.file)}),(ct||X)&&pt.current?.clearFiles(),Kt.current?.clearAutoCreatedTextFile())}},[ds,Zo,we,$e,Xr,fe,Fe,ct,X,F,Ge]);d.useEffect(()=>bt.subscribeForceSubmitQuery(Mn=>{Le(Mn)}),[bt,Le]);const{isDisabled:dt,focusedIndex:it,setFocusedIndex:At,userInputQuery:Gn,handleSuggestionSubmission:dr,handleFocus:$n,handleBlur:kn,handleChange:Zn,handleKeyDown:Wr,focusInput:Ms,hasQuery:Su}=aDe({value:e,json:t,querySource:n,disableSubmission:o,disableInput:a,autofocus:w,isUploadingFile:xe,onChange:M,onFocus:A,onBlur:D,handleSubmit:Le,handleUpdateAutosuggestions:Fe,autosuggestionsEnabled:U,errorMessage:fe,sources:Dt,attachments:ds,selectedSearchMode:vt,setIsInputActive:ke,isInputActive:_e,inFlight:fn,resultsLength:ut,quote:Me,isMentionMenuOpened:ur,isCometHome:Q,reason:ue,placement:O});CDe({setInput:Zn}),UDe({entropyBrowser:bt,focusInput:Ms,isSidecar:!0}),d.useEffect(()=>{Ae.current?.focus()},[Ae]),d.useEffect(()=>{Me&&Ms()},[Me,Ms]);const{openToast:dc}=pn(),hm=d.useMemo(()=>({onStart:()=>{Ms()},onStop:()=>{Ms()},onSilence:()=>{dc({message:"No audio detected. Make sure your microphone is connected and unmuted",variant:"error",timeout:4})}}),[Ms,dc]),{startTranscription:_0,stopTranscription:w0,error:Zr,isTranscribing:fs,isInitializing:Eu,transcription:gi}=RDe({callbacks:hm,config:age,reason:ue});d.useEffect(()=>{Zr&&dc({message:`Audio Error: ${Zr}`,variant:"error",timeout:4})},[Zr,dc]);const yi=d.useRef("");d.useEffect(()=>{if(!fs){yi.current="";return}if(gi&&gi!==yi.current){const Mn=gi.startsWith(yi.current)?gi.slice(yi.current.length):gi;if(Mn){const ms=yi.current.length==0?` ${Mn}`:Mn;yi.current.length==0&&Ae.current?.trim(),Ae.current?.append(ms),Zn(Ae.current?.value??"",Ae.current?.json)}yi.current=gi}},[gi,fs,Zn,Ae]);const gm=!0,{organization:C0}=mo({reason:ue}),S0=d.useCallback(()=>he(!0),[]),{handlePaste:ym,handlePasteQuery:g_,handleCompleteFileUpload:E0,handleFileSelect:ku,autoCreatedTextFile:xi,dismissNotification:k0,setAutoCreatedTextFile:y_}=iDe({fileUploadRef:pt,fileHandlingRef:Kt,showFileUpload:x,attachments:ds,setAttachments:uc,handleChange:Zn,setIsUploadingFile:he,focusInput:Ms,onFileAttachComplete:re}),{fileInputRef:Mu,errorMessage:M0,warningMessage:T0,uploadSource:xm,uploadedFiles:en,handleRemoveFile:Tu,handleStartUpload:A0,handleFileInput:fc,isBoxOpen:N0,onCloseBox:vm,cleanupBoxPicker:a7,microsoftFilePickerOptions:i7,isMicrosoftFilePickerOpen:l7,handleSelectSharepointSite:c7,onCloseMicrosoft:u7,setErrorMessage:d7}=wDe({fileUploadRef:pt,disablePrivacyWarning:S,isAudioVideoFilesEnabled:gm,isClearAttachmentsEnabled:X||ct,isFollowUp:u,organization:C0,lastResult:$t,onStartFileUpload:S0,onCompleteFileUpload:E0,setUploadsReady:ht,reason:ue,specialCapabilities:ot,askInputRef:ee,onRemoveFile:le}),f7=d.useCallback(()=>{if(xi){if(Ae.current?.append(xi.content),Zn(Ae.current?.value??"",Ae.current?.json),ds){const Mn=ds.find(ms=>ms.includes(xi.fileName));Mn&&Tu(Mn)}y_(null)}},[xi,Ae,Zn,ds,Tu,y_]),m7=d.useRef(e);m7.current=e;const p7=d.useCallback(Mn=>{ke(!0),m7.current.length===0&&Ce[vt]&&yt(Ce[vt]),P?.(Mn)},[ke,yt,Ce,vt,P]),h7=d.useCallback(Mn=>{Ae.current=Mn},[Ae]),Nfe=d.useMemo(()=>({isOpen:Be&&!I&&!fs,suggestedQueries:De,focusedIndex:it,setFocusedIndex:At,handlePasteQuery:g_,handleSubmit:dr,userInputQuery:Gn,placement:O,dropdownClassName:$,allowNonSequentialMatch:De!==Ce[vt],scrollableShards:en.length>0?[mt]:[]}),[Ce,$,O,it,I,g_,dr,fs,vt,At,Be,De,en.length,Gn]),Rfe=d.useMemo(()=>{const Mn=Be&&!I&&!fs;return{initialLayout:i,wrapperClass:z({"transition-none p-lg":Be,"border-b-none rounded-b-none":Mn&&O==="bottom","border-t-none rounded-t-none rounded-b-2xl":Mn&&O==="top","bg-base":Me}),size:"large",hasShadow:_,isHighlighted:ae,isMobileUserAgent:ve,showStopButton:k,quote:Me??void 0,inputWarnings:xi&&l.jsxs(K,{variant:"subtler",className:"mx-sm mb-xs px-sm py-xs dark:bg-base flex items-center justify-between rounded-lg",children:[l.jsx("div",{className:"gap-x-sm flex items-center",children:l.jsxs(V,{variant:"tiny",color:"light",children:["Text is"," ",Math.max(1,Math.round((xi.content.length-Mc)/Mc*100)),"% over the limit and is attached as a file."," ",l.jsx(rt,{variant:"super",size:"tiny",onClick:f7,text:"Paste as text"})]})}),l.jsx(rt,{icon:B("x"),size:"tiny",onClick:k0,variant:"common",pill:!0,noPadding:!0})]}),attachmentsList:en.length>0&&ce&&l.jsx(iY,{uploadedFiles:en,onRemoveFile:Tu,ref:mt}),setQuote:Ve,inputRef:Ae}},[xi,k0,O,I,Tu,_,i,Ae,fs,f7,Me,Ve,k,Be,en,ae,ce,ve]),Dfe=d.useMemo(()=>({ref:h7,id:"ask-input",value:e,json:t,initialLayout:i,minRows:c,placeholder:fs?jt.formatMessage({defaultMessage:"Listening…",id:"GdiyKL+89A"}):r,placeholderClassName:s,disableInput:a,autoFocus:w,onClick:p7,onChange:Zn,onKeyDown:Wr,onBlur:kn,onFocus:$n,onPaste:ym,onMentionMenuOpen:_n,onMentionMenuClose:nr,isMobileStyle:me,isMobileUserAgent:ve,useLexical:G,mentionTypeaheadOptions:G?H:void 0,onTriggerTypeahead:G?te:void 0}),[w,a,kn,Zn,p7,$n,Wr,ym,i,me,ve,t,H,c,nr,_n,te,r,s,h7,G,e,fs,jt]),jfe=d.useMemo(()=>l.jsx(pX,{value:e,json:t,showSources:m,useThreadSources:p,showRecency:h,submitWillFork:f,isFollowUp:u,isDisabled:dt||!Ge,querySource:n,errorMessage:fe,handleSubmit:Le,fileUploadRef:pt,showFileUpload:x,showModelSelector:g,disableActionButtons:v,fileUploadTooltip:C,disablePrivacyWarning:S,showStopButton:k,onStopButtonClick:R,onFilePickerOpen:j,onFilePickerClose:L,startTranscription:_0,stopTranscription:w0,isTranscribing:fs,isTranscriptionInitializing:Eu,isTranscriptionAvailable:!0,transcriptionError:Zr,fileUploadErrorMessage:M0,fileUploadWarningMessage:T0,activeConnector:xm,uploadedFiles:en,handleStartUpload:A0,handleFileInput:fc,isBoxFilePickerOpen:N0,handleCloseBoxFilePicker:vm,cleanupBoxFilePicker:a7,microsoftFilePickerOptions:i7,handleCloseMicrosoftFilePicker:u7,handleSelectSharepointSite:c7,isMicrosoftFilePickerOpen:l7,fileInputRef:Mu,hasQuery:Su,isAudioVideoFilesEnabled:gm,setAttachmentErrorMessage:d7,isCometHome:Q,isMissionControl:X}),[xm,a7,v,S,fe,Mu,M0,C,T0,vm,fc,c7,A0,Le,Su,gm,N0,dt,u,Eu,l7,fs,t,i7,u7,L,j,R,n,d7,x,g,h,m,p,k,_0,w0,f,en,Ge,e,Q,X,Zr]),{isMax:Ife}=Bt(),Pfe=d.useMemo(()=>l.jsx(fQ,{showIncognitoHint:b,showSearchModeSelector:y,isFollowUp:u,layoutKey:se,showFileUpload:x,handleFileInput:fc,onFilePickerOpen:j}),[fc,u,se,j,x,b,y]),g7=l.jsx(SX,{value:e,suggestDropdownProps:Nfe,ResizeableInputWrapperProps:Rfe,ResizeableInputProps:Dfe,syncUncontrolledOnce:Y,leftAttributionComponents:Pfe,rightAttributionComponents:jfe}),Ofe=l.jsxs(K,{variant:"subtler",className:z(E,"relative rounded-2xl",{"max-super-override":Ife}),children:[N,l.jsx("div",{className:fs?"-m-px":"",children:fs?l.jsx(TX,{borderRadius:17,borderGradientStops:"transparent 135deg, oklch(var(--super-color)) 180deg, transparent 225deg",children:g7}):g7})]});return l.jsx(AX,{condition:Ye&&x,Wrapper:NX,onDrop:ku,disabled:Tt,allowDropAnywhere:!0,children:Ofe})},RX=T.memo(HDe);RX.displayName="AskInput";const DX=ie.PRO,zDe=e=>({id:e.task_id,title:e.task_name,prompt:e.prompt,searchModel:W0e(e.model_preference)??DX,sources:Ox(e.sources),preconfigured:e.preconfigured});function Pbt(e=""){return{title:"",prompt:e,searchModel:DX,sources:["web"],preconfigured:!1}}function WDe({reason:e,enabled:t=!0}){const{$t:n}=J(),[r,s]=d.useState(!1),{openModal:o}=gn().legacy,a=Vt(),i=t,c=Kf(),{overwriteSources:u}=ug({reason:e}),{data:f,isStale:m,refetch:p}=kX({reason:e,enabled:i&&r,staleTime:600*1e3}),h=d.useCallback(()=>{r?m&&p():s(!0)},[r,m,p]),g=d.useCallback(()=>{o("taskShortcutModal",{source:"typeahead_create"})},[o]),y=d.useCallback((v,b)=>{let _=oe.SEARCH;v===ie.ALPHA?_=oe.RESEARCH:v===ie.BETA&&(_=oe.STUDIO),c(v,_),u(b)},[c,u]),x=d.useMemo(()=>{const b=(f??[]).map(_=>({uuid:_.task_id,variant:"shortcut",label:`/${_.task_name}`,queryText:_.prompt,className:"group/shortcut-typeahead-option",action:()=>y(_.model_preference,_.sources),convertToNode:!0,rightElement:({focused:w})=>l.jsx(GDe,{shortcut:_,focused:w})}));return i&&a&&b.push({uuid:"create-a-shortcut",variant:"shortcut",label:n({defaultMessage:"+ Create a shortcut",id:"P9a8R5IRCb"}),action:g,convertToNode:!1,isAlwaysVisible:!0}),b},[f,i,a,y,n,g]);return d.useMemo(()=>({isShortcutTasksEnabled:i,shortcutsTypeaheadOptions:x,onTrigger:h}),[i,x,h])}function GDe({shortcut:e,focused:t}){const{openModal:n}=gn().legacy,r=d.useCallback(s=>{s.preventDefault(),s.stopPropagation(),n("taskShortcutModal",{source:"typeahead_edit",shortcut:zDe(e)})},[n,e]);return l.jsx("div",{className:z("h-5 transition-opacity",t&&"opacity-100",!t&&"opacity-0"),children:l.jsx(rt,{icon:B("edit"),size:"tiny",variant:"common",noPadding:!0,onMouseDown:r})})}const $De=(e,t)=>{const[n,r]=d.useState(e),s=hx(r,t);return d.useEffect(()=>{s(e)},[e,s]),n},qDe=5e3,KDe=3e3,YDe=(e,t=!0)=>{const n=t&&Nn()&&!!Us()?.is_personal_search_enabled,{sidecarSourceTab:{url:r}}=zn(),s=$De(r,KDe),o=d.useMemo(()=>["get_tabs_for_sidecar",s],[s]),{data:a=Ie}=gt({queryKey:o,queryFn:async()=>(await e.fetchOpenedTabs()).map(c=>{const u=Zp(c.url);return{uuid:String(c.tabId),variant:"tab",label:c.title,url:c.url,icon:u?{type:"image",url:u}:void 0}}),staleTime:qDe,enabled:n});return d.useMemo(()=>({tabs:a,tabAttachmentsEnabled:n}),[n,a])},QDe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/spaces/mentions",e,{timeoutMs:Ze()});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to list at mention spaces",cause:n,status:r.status??0});return t},Obt=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/collections/list_space_templates",e,{timeoutMs:Ze(),numRetries:1});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to list space templates",cause:n,status:r.status??0});return t},XDe=async({limit:e=50,offset:t=0,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/spaces/writable",n,{params:{query:{limit:e,offset:t}},timeoutMs:Ze()});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to list writable spaces",cause:s,status:o.status??0});return r};function ZDe({reason:e,isLazy:t=!0,enabled:n=!0}){const[r,s]=d.useState(()=>!t),{data:o,isStale:a,refetch:i}=gt({queryKey:tp(),queryFn:()=>QDe({reason:e}),enabled:n&&r,staleTime:600*1e3}),c=d.useCallback(()=>{r?a&&i():s(!0)},[r,a,i]),u=d.useMemo(()=>(o?.spaces??[]).map(m=>({uuid:m.uuid,variant:"space",label:m.title,icon:JDe(m)})),[o]);return d.useMemo(()=>({isAtMentionSpacesEnabled:n,mentionSpacesOptions:u,onTrigger:c}),[n,u,c])}function JDe(e){if(e.emoji){const t=sT(e.emoji);if(t)return{type:"emoji",char:t}}return{type:"icon",icon:Zh}}const eje=({reason:e})=>{const{isAllowed:t,isConnected:n}=cg({reason:e}),{sources:r,isSourceAllowed:s}=oT({isConnectorAllowed:t??(()=>!1)}),o=d.useMemo(()=>r.filter(a=>tg(a)||Wi(a)||Za(a)?!0:RW(a)?!1:fu(a)?n(a):!1),[r,n]);return d.useMemo(()=>({sources:o,isSourceAllowed:s}),[o,s])},tje=W({defaultMessage:"Monthly query limit reached",id:"ooSshLDNri"});function nje({isLazy:e=!0,enabled:t=!0,onMentionSource:n}){const{$t:r}=J(),[s,o]=d.useState(()=>!e),{getSourceLabel:a}=sc(),{cometMcpSources:i}=Df(),{getSourceLimited:c}=nT(),{sources:u}=eje({reason:"use-at-mention-sources"}),{trackSourceActivity:f}=WA(),{suggested:m=[],refresh:p}=rX({sources:u}),h=d.useCallback(b=>{n?.(b),f(b)},[n,f]),g=d.useCallback(b=>{const _=c(b);return{uuid:b,variant:"source",label:a(b),icon:jX(b),action:()=>h(b),disabled:_,subtitle:_?r(tje):void 0,convertToNode:!0}},[a,h,c,r]),y=d.useCallback(b=>({uuid:b,variant:"source",label:a(b),icon:rje({sourceType:b,cometMcpSources:i}),action:()=>h(b),convertToNode:!0}),[a,i,h]),x=d.useMemo(()=>{const b=new Set([...m,...u]);return Array.from(b).map(_=>tg(_)?g(_):y(_))},[g,y,m,u]),v=d.useCallback(()=>{s||o(!0),p()},[s,p]);return d.useMemo(()=>({isAtMentionSourcesEnabled:t,mentionSourcesOptions:x,onTrigger:v}),[t,x,v])}function rje({sourceType:e,cometMcpSources:t}){if(Wi(e))return sje(e);if(fu(e))return jX(e);if(Za(e)){const n=If(e),r=t[n];return r?oje(r):void 0}}function sje(e){return{type:"icon",icon:Qx[e].icon}}function jX(e){const t=Of(e);if(t)return{type:"image",url:t}}function oje(e){if(e.iconUrl)return{type:"image",url:e.iconUrl}}function aje(e){return ga(e)||Za(e)}const ije=({reason:e,isLazy:t=!0,variants:n,collectionName:r})=>{const[s,o]=d.useState(""),a=ln(),i=n===void 0||n.includes("tab"),c=n===void 0||n.includes("space"),u=n===void 0||n.includes("shortcut"),f=n===void 0||n.includes("sources"),{tabs:m,tabAttachmentsEnabled:p}=YDe(a,i),{isAtMentionSpacesEnabled:h,mentionSpacesOptions:g,onTrigger:y}=ZDe({reason:e,isLazy:t,enabled:c}),{isShortcutTasksEnabled:x,shortcutsTypeaheadOptions:v,onTrigger:b}=WDe({reason:e,enabled:u}),{addSource:_,removeSource:w}=DW({useThreadSources:!1,reason:e}),S=cW(),C=d.useRef([]);d.useEffect(()=>{const F=GCe(S?.root);C.current.filter(L=>!F.includes(L)).filter(aje).forEach(L=>{w(L)}),C.current=F},[S,w]);const E=d.useCallback(F=>_(F),[_]),{isAtMentionSourcesEnabled:N,mentionSourcesOptions:k,onTrigger:I}=nje({isLazy:t,enabled:f,onMentionSource:E}),M=p||h||x||N,A=d.useMemo(()=>[...p&&s==="@"?m:[],...h&&s==="@"?g:[],...N&&s==="@"?k:[],...x&&s==="/"?v:[]],[p,s,m,h,g,x,v,N,k]),D=d.useCallback(F=>{o(F),F==="@"?(y(),I()):F==="/"&&b()},[b,y,I]),P=lje({isAtMentionSourcesEnabled:N,isShortcutTasksEnabled:x,isAtMentionCometTabsEnabled:p,collectionName:r});return d.useMemo(()=>({useLexical:M,mentionTypeaheadOptions:A,inputPlaceholder:P,onTriggerTypeahead:D}),[M,A,P,D])},lje=({isAtMentionSourcesEnabled:e,isShortcutTasksEnabled:t,isAtMentionCometTabsEnabled:n,collectionName:r})=>{const{$t:s}=J();return d.useMemo(()=>{try{if(typeof document>"u")return""}catch{return}const o=n||e,a=t;return r?o&&a?s({defaultMessage:"Ask anything about { collectionName }. Type @ for mentions and / for shortcuts.",id:"vpxXL78kip"},{collectionName:r}):o?s({defaultMessage:"Ask anything about { collectionName }. Type @ for mentions.",id:"QodmMNOAIa"},{collectionName:r}):a?s({defaultMessage:"Ask anything about { collectionName }. Type / for shortcuts.",id:"1uFeAjMFYC"},{collectionName:r}):s({defaultMessage:"Ask anything about { collectionName }.",id:"3ZcezoTfiM"},{collectionName:r}):s(o&&a?{defaultMessage:"Ask anything. Type @ for mentions and / for shortcuts.",id:"KO0XLRzele"}:o?{defaultMessage:"Ask anything. Type @ for mentions.",id:"iju9VLCg7F"}:a?{defaultMessage:"Ask anything. Type / for shortcuts.",id:"h47ZleZwvf"}:qr[oe.SEARCH].askInputPlaceholder)},[s,n,e,t,r])},IX="comet.sidecar-input-state";function cje(){try{const e=_a.getItem(IX);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function Qj(e){_a.setItem(IX,JSON.stringify(e))}function uje({cometState:e,onSubmit:t}){const{tabId:n,secondaryTab:r}=e.sidecarSourceTab,s=mn(),o=d.useMemo(()=>ro(n,r?.tabId),[n,r?.tabId]),a=d.useRef(cje()),[i,c]=d.useState(a.current[o]?.rawQuery??""),[u,f]=d.useState(a.current[o]?.rawQueryJson??void 0);d.useEffect(()=>{const g=a.current[o]??{},y=g.rawQuery??"",x=g.rawQueryJson??void 0;c(v=>v===y?v:y),f(v=>v===x?v:x)},[o]);const m=d.useCallback((g,y)=>{const x=a.current[o]??{};c(g),f(y);const v={...x,rawQuery:g,rawQueryJson:y??null},b={...a.current,[o]:v};a.current=b,Qj(b)},[o]),p=d.useCallback(()=>{const g={...a.current};delete g[o],a.current=g,Qj(g),c(""),f(void 0)},[o]),h=d.useCallback(g=>{const y=s.get("source"),x=kM(y)?y:"user";p(),t?.({...g,promptSource:g.promptSource||x})},[p,t,s]);return d.useMemo(()=>({persistedValue:i,persistedJson:u,persist:m,onSubmit:h}),[u,m,i,h])}const dje=({url:e,title:t,secondaryUrl:n,secondaryTitle:r,userSelection:s})=>l.jsxs(K,{className:"p-sm ml-one gap-sm relative flex flex-1 flex-col",children:[l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsxs("div",{className:"gap-sm flex flex-1 items-center",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Lo,{size:20,domain:Kc(e),hideBorder:!0,className:"rounded-md border-none bg-none",overrideIconUrl:Zp(e)})}),t&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:t})]}),n&&l.jsxs("div",{className:"gap-sm flex flex-1 items-center",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Lo,{size:20,domain:Kc(n),hideBorder:!0,className:"rounded-md border-none bg-none",overrideIconUrl:Zp(n)})}),r&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:r})]})]}),l.jsx(kt,{children:s?.text&&l.jsx(Te.div,{className:"ml-[28px]",initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.2,ease:"easeOut"},children:l.jsxs(V,{variant:"tiny",color:"light",className:"line-clamp-2 italic",children:['"',s.text,'"']})})})]}),XA=T.memo(e=>{const{value:t,json:n,onChange:r,onSubmit:s,...o}=e,a="sidecar-ask-input",i=ln(),{hasAccessToProFeatures:c}=Bt(),{specialCapabilities:u}=Qr(),f=c||u.unlimitedProSearch?ie.PRO:ie.DEFAULT,m=zn(),{persistedValue:p,persistedJson:h,persist:g,onSubmit:y}=uje({cometState:m,onSubmit:s}),x=d.useCallback(k=>{y({...k,modelPreferenceOverride:f})},[y,f]),{mentionTypeaheadOptions:v,onTriggerTypeahead:b}=ije({reason:a,isLazy:!0});d.useEffect(()=>i.subscribeToCometQuery((k,{source:I})=>{y({query:k,forceFork:!0,promptSource:kM(I)?I:"user"})}),[i,y]);const _=ln();d.useEffect(()=>{function k(I){I.key==="Escape"&&_.deactivateScreenshotTool()}return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}},[_]);const{sidecarSourceTab:{url:w,title:S,secondaryTab:C}}=m,E=m.actions.getUserSelection(),N=d.useCallback((k,I)=>{g(k,I),r(k,I)},[g,r]);return l.jsx("div",{className:"bg-base rounded-2xl",children:l.jsx(RX,{value:p,json:h,onChange:N,onSubmit:x,headerComponent:w?l.jsx(dje,{url:w,title:S,userSelection:E,secondaryUrl:C?.url,secondaryTitle:C?.title}):void 0,forceHideSuggestions:!!E,autofocus:!0,showModelSelector:!1,showFileUpload:!0,hasShadow:!0,showIncognitoHint:!0,showSources:!1,dropdownPlacement:"top",useLexical:!0,syncUncontrolledOnce:!0,mentionTypeaheadOptions:v,onTriggerTypeahead:b,initialLayout:"expanded",minRows:1,className:"shadow-[0_36px_16px_36px_oklch(var(--background-base-color))] dark:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_32px_16px_36px_oklch(var(--dark-background-base-color))]",...o})})});XA.displayName="SidecarAskInput";const fje="chrome://settings/assistant",PX=T.memo(({onLearnMore:e})=>{const{$t:t}=J();return l.jsx(V,{color:"light",variant:"tinyRegular",className:"text-balance text-center",children:t({defaultMessage:"Comet Assistant uses the current page and relevant browser history to provide answers to your questions. Learn more",id:"+FQWtBvxT2"},{link:n=>l.jsx(V,{as:"button",color:"light",variant:"tinyRegular",onClick:e,className:"hover:text-super cursor-pointer underline",inline:!0,children:n})})})});PX.displayName="PrivacyEducationText";const OX=T.memo(({isVisible:e=!0,showPrivacyEducation:t=!1})=>{const{$t:n}=J(),r=ln(!1),s=()=>{r?.openNewTab(fje)};return l.jsxs("div",{className:"gap-md px-lg pb-xl fixed inset-0 z-10 flex flex-col items-center justify-center",children:[l.jsx(ge,{icon:Epe,size:64,className:z("text-quietest opacity-0 transition-opacity",{"!opacity-100":e})}),l.jsxs("div",{className:"gap-2xs flex flex-col items-center",children:[l.jsx(V,{variant:"section-title",color:"light",children:n({defaultMessage:"Assistant",id:"CxJqEDZI3a",description:"Assistant"})}),t&&l.jsx(PX,{onLearnMore:s})]})]})});OX.displayName="SidecarBackground";const LX="pplx.sidecar_privacy_education_hidden_after_query",FX=T.memo(()=>{const[e,t,n]=KCe({csrRedirect:!0}),[,r]=Qi(LX,!1),s=d.useCallback(o=>{r(!0),n.onSubmit(o)},[n,r]);return l.jsx("div",{className:"relative",children:l.jsx(XA,{...n,onSubmit:s,value:e,json:t,querySource:"home"})})});FX.displayName="HomeSidecarAskInput";const ZA=T.memo(function(){const{variation:t}=YCe(!1),[n]=Qi(LX,!1),r=t&&!n;return l.jsx(Ff,{disableNewThread:!0,disableOpenInTab:!0,children:l.jsxs("div",{className:"px-md isolate mx-auto size-full min-w-[420px] sm:max-w-screen-md",children:[l.jsx(OX,{showPrivacyEducation:r}),l.jsx("div",{className:"relative flex h-full flex-col",children:l.jsx($c,{children:l.jsx(K,{className:"mt-md pointer-events-none static z-10 w-full grow flex-col items-center justify-center",children:l.jsx("div",{className:"bottom-md pointer-events-auto absolute w-full",children:l.jsx(FX,{})})})})})]})})});ZA.displayName="SidecarHomePage";const mi=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(!0)},[]),e},mje=()=>{const e=d.useRef(!1),{results:t,lastResult:n}=an(),r=mi(),s=Vt(),{openVisitorLoginUpsell:o}=di({enabled:!s}),a=Tl({upsellInformation:n?.upsell_information});d.useEffect(()=>{e.current||r&&t.length>=1&&n&&n.upsell_information?.app_location===Ns.MODAL&&(a(),e.current=!0)},[r,s,o,t.length,n,a])},pje=()=>{const e=Vt(),{isMobileUserAgent:t}=Re(),{firstResult:n}=an(),r=n?.author_username,{openInstallUpsell:s}=VW(),[o,a]=Gd("shareGateImpressions",0),i=d.useRef(!1),c=mn(),u=c?.get("installGate"),f=c?.get("q");d.useEffect(()=>{i.current||e||t&&(!r&&!f||Vy()||FU()||BU()||u==="true"&&(o>=SV||(s({origin:lt.SHARED_THREAD_INSTALL_GATE,sheetModalVariant:"inset-centered-sheet"}),a(o+1),i.current=!0)))},[a,r,t,f,u,e,s,o])},hje=()=>{const{device:{isMetaBrowser:e,isIOS:t,isAndroid:n}}=on();return d.useCallback(()=>{if(!e||typeof window>"u")return;const s=window.location.href;let o;t?o=s.replace(/^https?:\/\//,"x-safari-https://"):n&&(o=`intent://${s.replace(/^https?:\/\//,"")}#Intent;scheme=https;package=com.android.chrome;end`),o&&Do(o,"Redirecting to native browser")},[e,t,n])};function JA(e){return e===document.documentElement}function xE(e){return JA(e)?window.scrollY:e.scrollTop}function BX(e){return JA(e)?window.innerHeight:e.clientHeight}function UX(e){return e.scrollHeight}function Xj(e,t,n="smooth"){JA(e)?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})}function vE(e){const t=UX(e),n=BX(e),r=xE(e);return Math.abs(t-n-r)<=1}const gje=(e,t)=>e?"full-sheet-blurred":t==="delayed"?"bottom-sheet-gradient":"centered-sheet",yje=()=>{const{$t:e}=J(),t=Vt(),{isMobileUserAgent:n}=Re(),{firstResult:r}=an(),s=r?.author_username,{openVisitorLoginUpsell:o}=di({enabled:!0}),[a,i]=Gd("shareGateImpressions",0),c=d.useRef(!1),u=mn(),{scrollContainerRef:f}=ka(),[m,p]=d.useState(!1),h=hje(),g=u?.get("visitorGate"),y=u?.get("q");d.useEffect(()=>{const x=f.current;if(x)return x.addEventListener("scroll",()=>{p(vE(x))}),()=>{x.removeEventListener("scroll",()=>{p(vE(x))})}},[f]),d.useEffect(()=>{c.current||t||!s&&!y||FU()||BU()||a>=SV||g==="false"||g==="delayed"&&!m||!g&&!(!n&&!y)||(h(),o({origin:lt.SHARED_THREAD_LOGIN_GATE,description:"",title:e({defaultMessage:"Instant answers at your fingertips",id:"NFjQpck2Ql"}),sheetModalVariant:gje(n,g),overrideMobileVariant:!0}),i(a+1),c.current=!0)},[n,t,o,e,a,i,m,g,u,s,h,y])};var Av="Tabs",[xje]=Vs(Av,[tc]),VX=tc(),[vje,e6]=xje(Av),HX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:i,activationMode:c="automatic",...u}=e,f=Lf(i),[m,p]=fo({prop:r,onChange:s,defaultProp:o??"",caller:Av});return l.jsx(vje,{scope:n,baseId:ls(),value:m,onValueChange:p,orientation:a,dir:f,activationMode:c,children:l.jsx(Mt.div,{dir:f,"data-orientation":a,...u,ref:t})})});HX.displayName=Av;var zX="TabsList",WX=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=e6(zX,n),a=VX(n);return l.jsx(Jx,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Mt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});WX.displayName=zX;var GX="TabsTrigger",$X=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=e6(GX,n),i=VX(n),c=YX(a.baseId,r),u=QX(a.baseId,r),f=r===a.value;return l.jsx(ev,{asChild:!0,...i,focusable:!s,active:f,children:l.jsx(Mt.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:nt(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:nt(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:nt(e.onFocus,()=>{const m=a.activationMode!=="manual";!f&&!s&&m&&a.onValueChange(r)})})})});$X.displayName=GX;var qX="TabsContent",KX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,i=e6(qX,n),c=YX(i.baseId,r),u=QX(i.baseId,r),f=r===i.value,m=d.useRef(f);return d.useEffect(()=>{const p=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(Hr,{present:s||f,children:({present:p})=>l.jsx(Mt.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:p&&o})})});KX.displayName=qX;function YX(e,t){return`${e}-trigger-${t}`}function QX(e,t){return`${e}-content-${t}`}var bje=HX,_je=WX,wje=$X,Cje=KX;const t6=d.createContext({fullWidth:!1,size:"default",currentValue:void 0,registerTabRef:()=>{},unregisterTabRef:()=>{},updateIndicatorRef:{current:()=>{}}});function Nv(){return d.useContext(t6)}const Sje=d.memo(function({listRef:t}){const n=Nv(),r=d.useRef(null),s=d.useRef(null),[o,a]=d.useState(!1),[i,c]=d.useState({leftPx:0,widthPx:0,opacity:0}),u=d.useCallback(()=>{const f=t.current;if(!f)return;const m=f.querySelector('[data-state="active"]');if(!m)return;const p=f.getBoundingClientRect(),h=m.getBoundingClientRect(),g=h.left-p.left,y=h.width;return c({leftPx:g,widthPx:y,opacity:1}),o||requestAnimationFrame(()=>{a(!0)}),m!==r.current&&s.current&&(r.current&&s.current.unobserve(r.current),s.current.observe(m),r.current=m),m},[t,o]);return d.useEffect(()=>{n.updateIndicatorRef.current=u},[n,u]),d.useEffect(()=>{s.current=new ResizeObserver(()=>{requestAnimationFrame(()=>{u()})});const f=u();return f&&(s.current.observe(f),r.current=f),()=>{s.current?.disconnect(),s.current=null,r.current=null}},[u,t]),l.jsx("span",{className:z("absolute bottom-0 h-two bg-inverse pointer-events-none",{"transition-[transform,width,opacity] duration-300 ease-in-out":o}),style:{transform:`translateX(${i.leftPx}px)`,width:`${i.widthPx}px`,opacity:i.opacity},"aria-hidden":"true"})}),Eje=li("flex flex-row flex-nowrap",{variants:{showBottomBorder:{false:"",true:"border-b border-subtler"},fullWidth:{false:"",true:"gap-0"},size:{default:"h-[54px]",compact:"h-[44px]"}},compoundVariants:[{fullWidth:!1,size:"default",class:"gap-5"},{fullWidth:!1,size:"compact",class:"gap-4"}],defaultVariants:{showBottomBorder:!1,fullWidth:!1,size:"default"}});function kje({children:e,"aria-label":t,showBottomBorder:n=!1,fullWidth:r=!1,size:s="default",...o}){const a=wa(o),i=Nv(),c=d.useRef(null),u=d.useMemo(()=>({...i,fullWidth:r,size:s}),[i,r,s]);return l.jsx(t6.Provider,{value:u,children:l.jsxs(_je,{ref:c,"aria-label":t,className:z(Eje({showBottomBorder:n,fullWidth:r,size:s}),"relative"),...a,children:[e,l.jsx(Sje,{listRef:c})]})})}function Mje({value:e,children:t,...n}){const r=wa(n),{currentValue:s,animation:o="none"}=Nv(),a=s===e,i=o!=="none",c=l.jsx(Cje,{value:e,className:"focus:outline-none",forceMount:i||void 0,...r,children:t});switch(o){case"fade":return l.jsx(Hx.Fade,{isVisible:a,className:"col-start-1 row-start-2",children:c});case"none":return c;default:Ft(o)}}const Tje=li(z("reset interactable","font-sans font-medium select-none","transition-colors duration-300","relative","flex gap-1.5 items-center","text-sm text-foreground"),{variants:{isIconOnly:{false:z("data-[state=inactive]:opacity-80","data-[state=active]:opacity-100"),true:z("data-[state=inactive]:opacity-80","data-[state=active]:opacity-100")},disabled:{false:"cursor-pointer",true:"cursor-not-allowed opacity-70"},fullWidth:{false:"",true:"flex-1 justify-center"},size:{default:"py-3.5",compact:"py-2"}},compoundVariants:[{isIconOnly:!1,disabled:!1,class:"data-[state=inactive]:hover:opacity-100"},{isIconOnly:!0,class:"px-3"}],defaultVariants:{isIconOnly:!1,disabled:!1,fullWidth:!1,size:"default"}});function Aje(e){const{value:t,disabled:n=!1,...r}=e,s=wa(r),{fullWidth:o,size:a,registerTabRef:i,unregisterTabRef:c}=Nv(),u=d.useRef(null),f="icon"in e,m=f?e.icon:e.leadingIcon,p=f?void 0:e.children,h=f?e["aria-label"]:void 0;d.useLayoutEffect(()=>(i(t,u),()=>c(t)),[t,i,c]);const g=l.jsxs(wje,{ref:u,value:t,disabled:n,"aria-label":f?h:void 0,className:z("group",Tje({isIconOnly:f,disabled:n,fullWidth:o,size:a})),...s,children:[m&&l.jsx(Jt,{icon:m,size:"medium"}),p]});return f&&h?l.jsx(Hs,{content:h,side:"bottom",disabled:n,children:l.jsx("span",{className:z("inline-flex",o&&"flex-1"),children:g})}):g}function Nje(e){const{children:t,onValueChange:n,animation:r="none",...s}=e,o=wa(s),a="value"in e?{value:e.value}:{defaultValue:e.defaultValue},[i,c]=d.useState(a.defaultValue),u=d.useRef(new Map),f=d.useRef(()=>{}),m=d.useCallback((g,y)=>{u.current.set(g,y)},[]),p=d.useCallback(g=>{u.current.delete(g)},[]),h=d.useCallback(g=>{c(g),n?.(g),requestAnimationFrame(()=>{f.current()})},[n]);return d.useEffect(()=>{e.value!==void 0&&requestAnimationFrame(()=>{f.current()})},[e.value]),l.jsx(t6.Provider,{value:{currentValue:a.value??i,registerTabRef:m,unregisterTabRef:p,updateIndicatorRef:f,animation:r},children:l.jsx(bje,{...a,orientation:"horizontal",onValueChange:h,className:r==="none"?"contents":"grid w-full min-w-0 grid-cols-[minmax(0,1fr)]",...o,children:t})})}const Dp=Object.assign(Nje,{List:kje,Tab:Aje,Panel:Mje}),es={default:"d",shopping:"s",jobs:"j",hotels:"h",places:"p",images:"i",videos:"v",sources:"r",assets:"a",apps:"c",search:"se",chat:"ch"},Rje=e=>{if(e)return Object.entries(es).find(([t,n])=>n===e)?.[0]},Dje=()=>{const e=mn();return d.useCallback(()=>{const n=new URLSearchParams(e?.toString()).get("sm");return Rje(n)},[e])},XX=()=>{const e=mn(),t=Ln(),n=Dn();return d.useCallback(r=>{const s=new URLSearchParams(e?.toString());s.set("sm",es[r]),n.replace(`${t}?${s.toString()}`)},[t,n,e])},jje=({items:e,inFlight:t,inFlightLatest:n,rwToken:r,contentHasMounted:s,hasHeader:o=!0})=>{const{scrollContainerRef:a}=ka(),i=mi(),c=d.useMemo(()=>{if(typeof window>"u")return 0;let _;return o?_=getComputedStyle(document.documentElement).getPropertyValue("--header-height"):_="0",parseInt(_,10)},[o]),u=d.useRef(!0),f=d.useMemo(()=>!r&&e.every(_=>!Yt.isStatusPending(_)),[e,r]),m=d.useMemo(()=>e.some(_=>Yt.isStatusPending(_)),[e]),p=d.useRef({}),h=d.useRef({}),g=d.useRef(!1);d.useEffect(()=>()=>{p.current={},h.current={}},[]);const y=d.useCallback((_,{smooth:w=!0,anchor:S=!1}={smooth:!0,anchor:!1})=>{const C=typeof _=="number"?p.current?.[_]?.current:h.current?.[_]?.current;if(C&&a?.current){const E=a.current,N=Ef(()=>{g.current=!1,E.removeEventListener("scroll",N)},100,{leading:!1,trailing:!0});if(E.addEventListener("scroll",N),g.current=!0,S){const A=C.getBoundingClientRect().top,D=xE(E),P=A+D-c,F=UX(E),R=BX(E);if(P+R>F){const j=F-R-.1;requestAnimationFrame(()=>{Xj(E,j,w?"smooth":"auto")});return}}const k=C.getBoundingClientRect().top,I=xE(E),M=k+I-c;requestAnimationFrame(()=>{Xj(E,M,w?"smooth":"auto")})}},[a,c]),x=d.useCallback(()=>{y(e.length-1)},[y,e.length]);d.useEffect(()=>{const _={...p.current},w={};e.forEach((C,E)=>{const N=E,k=C.backend_uuid;if(k)if(!_[N]||!_[N].current){const I=T.createRef();_[N]=I,w[k]=I}else w[k]=_[N]});const S=e.length;Object.keys(_).forEach(C=>{Number(C)>=S&&delete _[Number(C)]}),h.current=w,p.current=_},[e.length,m]);const v=e.at(-1)?.query_source==="edit";d.useEffect(()=>{if(e.length<=1||!i||!s)return;const _=window.location.hash;if(_&&!t&&u.current){try{const w=_.slice(1);w.length>3?y(w,{smooth:!1}):y(Number(w),{smooth:!1})}catch(w){Z.error(w)}return}n&&!v&&requestAnimationFrame(()=>{y(e.length-1,{anchor:!0})})},[t,n,f,e.length,i,y,s,v]);const b=p.current;return d.useMemo(()=>({refs:b,isScrollingRef:g,scrollToLatestItem:x,scrollToListItem:y,headerOffsetPx:c}),[b,x,y,c])},ZX=zt("ScrollToEntityContext",{refs:{},isScrollingRef:{current:!1},scrollToListItem:()=>{},setContentHasMounted:()=>{},scrollToLatestItem:()=>{},contentHasMounted:!1,headerOffsetPx:0}),JX=T.memo(({children:e})=>{const t=el(),{results:n=[],inFlight:r,inFlightLatest:s}=an(),[o,a]=d.useState(!1),i=d.useMemo(()=>z4(n).map(g=>g.length?g[0]:void 0).filter(g=>g!==void 0),[n]),{refs:c,isScrollingRef:u,scrollToListItem:f,scrollToLatestItem:m,headerOffsetPx:p}=jje({items:i,inFlight:r,inFlightLatest:s,rwToken:t,contentHasMounted:o,hasHeader:!1});return l.jsx(ZX.Provider,{value:{scrollToListItem:f,scrollToLatestItem:m,refs:c,isScrollingRef:u,setContentHasMounted:a,contentHasMounted:o,headerOffsetPx:p},children:e})});JX.displayName="ScrollToThreadEntryProvider";const n6=()=>{const e=d.useContext(ZX);if(!e)throw new Error("useScrollToEntity must be used within ScrollToEntityContext");return e},r6=zt("SearchPageContext",{activeMode:"default",setActiveMode:()=>{},activeEntryIdx:0,pinnedEntryIdx:-1,viewTitle:null,setViewTitle:()=>{},activeThreadTab:"default",setActiveThreadTab:()=>{},handleTabScrollBehavior:()=>{}}),kg=()=>{const e=d.useContext(r6);if(!e)throw new Error("useSearchPage must be used within an SearchPageProvider");return e},eZ=T.memo(({children:e})=>{const t=Dje(),n=XX(),r=t()??"default",[s,o]=d.useState(r),a=d.useRef(void 0),[i,c]=d.useState(r),u=d.useCallback(C=>{o(C),c(C)},[]),[f,m]=d.useState(0),[p,h]=d.useState(-1),[g,y]=d.useState(null),{refs:x}=n6(),v=Dn(),{scrollContainerRef:b}=ka(),_=d.useCallback(C=>{if(b.current){if(s==="default"){const E=b.current.scrollTop;a.current=E}if(C==="default"){const E=a.current;E!==void 0&&requestAnimationFrame(()=>{b.current&&(b.current.scrollTop=E)})}else b.current.scrollTop=0}},[b,s]),w=d.useCallback(()=>{if(Object.keys(x).length===0||!b.current)return;const C=b.current.clientHeight,E=b.current.scrollTop;if(E===0){m(0),h(-1);return}const N=E+C/2;let k=f,I=-1,M=1/0;Object.entries(x).forEach(([A,D])=>{if(D.current){const P=D.current.getBoundingClientRect(),F=P.top+E+P.height/2,R=Math.abs(F-N);P.top<-100&&P.bottom>100&&(I=parseInt(A)),R{if(!b?.current)return;const C=b.current,E=hx(w,50,{leading:!1,trailing:!0});return C.addEventListener("scroll",E),w(),()=>{C.removeEventListener("scroll",E),E.cancel()}},[w,b]),d.useEffect(()=>{y(null)},[v]);const S=d.useCallback(C=>{_(C),u(C),n(C)},[_,u,n]);return l.jsx(r6.Provider,{value:{activeMode:i,setActiveMode:c,activeEntryIdx:f,pinnedEntryIdx:p,viewTitle:g,setViewTitle:y,activeThreadTab:s,setActiveThreadTab:u,handleTabScrollBehavior:_},children:l.jsx(Dp,{value:s,onValueChange:S,children:e})})});eZ.displayName="SearchPageProvider";function Ije({entropyBrowser:e,isSidecar:t,scrollContainerRef:n}){const r=Ln(),s=d.useCallback(o=>{n.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:o})},[n]);d.useEffect(()=>{if(!(!e||!t))return e.subscribeQuickActionButtonFired(()=>{s("smooth")})},[e,t,s]),d.useEffect(()=>{setTimeout(s,0,"instant")},[r,t,s])}const Pje=({reason:e})=>{const{DEFAULT_SOURCES:t}=ug({reason:e}),{setSources:n,setIsCopilot:r,gpt4Limit:s}=Fn(),o=mi(),{session:a}=je(),{trackEvent:i}=Ke(a),{lossAversionStatus:c,setLossAversionStatus:u,unsetLossAversion:f}=JH(),m=Vt(),{results:p,lastResult:h,firstResult:g}=an(),y=g?.author_id,x=g?.author_username,v=g?.context_uuid,b=g?.query_source,_=g?.sources?.sources,w=el(),S=mn(),C=d.useRef(!1),{pinnedEntryIdx:E,setViewTitle:N}=kg(),{formatMessage:k}=J(),{openVisitorLoginUpsell:I}=di({enabled:!m}),{scrollContainerRef:M}=ka(),A=ln();return yje(),pje(),mje(),Ije({scrollContainerRef:M,isSidecar:!0,entropyBrowser:A}),d.useEffect(()=>{const D=Yt.isSourceListType(_)?_:[...t];n(D);const P=p.some(F=>Yt.isCopilotMode(F))&&s.available;r(P)},[]),d.useEffect(()=>{if(!C.current&&o&&p.length>=1&&h&&Yt.isStatusCompleted(h)&&y&&x){const D=S?.get("utm_source")??void 0;i("thread viewed",{authorId:y,authorUsername:x,isThreadCreator:!!w,contextUUID:v,viewSource:D}),v&&N_e({contextUUID:v,reason:e}),b==="perplexity_tasks"&&i("task thread viewed",{contextUUID:v}),C.current=!0}},[i,o,y,x,v,h,p.length,S,w,m,I,k,e,b]),d.useEffect(()=>{c!=="cooldown"&&(!m&&!c&&w?u("allowed"):w||f())},[m,c,w,u,f]),d.useEffect(()=>{N(E===-1?null:N7e(p[E]?.query_str)??"")},[E,N,p]),d.useEffect(()=>()=>{c==="allowed"&&f()},[]),null},Oje=e=>e?e.filter(t=>t.image_mode_block).flatMap(t=>t.image_mode_block.media_items??Ie):Ie,Lje=e=>e?e.filter(t=>t.video_mode_block).flatMap(t=>t.video_mode_block.media_items??Ie):Ie,Fje=e=>e?e.filter(t=>t.shopping_mode_block).flatMap(t=>t.shopping_mode_block.shopping_widgets??Ie):Ie,Bje=e=>e?e.filter(t=>t.jobs_mode_block).flatMap(t=>t.jobs_mode_block.jobs_blocks??Ie):Ie,Uje=e=>e?e.filter(t=>t.maps_mode_block).flatMap(t=>t.maps_mode_block.places??Ie):Ie,Vje=e=>{const t=(e??Ie).filter(a=>a.sources_mode_block).flatMap(a=>a.sources_mode_block),n=t.at(-1),r=new Set,s=[];for(const a of t)for(const i of a.web_results)r.has(i.url)||(s.push(i),r.add(i.url));const o=n?.result_count??0;return{count:Math.max(s.length,o),progress:n?.progress,results:s,rows:n?.rows}},s6=(e,{orderedByPriority:t=!1}={})=>{if(!e)return Ie;const n=e.filter(r=>r.plan_block?.steps).flatMap(r=>r.plan_block.steps).flatMap(r=>r.assets??Ie);return t?[...n].sort((r,s)=>r.is_primary_asset===s.is_primary_asset?0:r.is_primary_asset?-1:1):n},Hje=(e,t)=>{if(e){for(const n of e)if(n.plan_block?.steps){for(const r of n.plan_block.steps)if(r.assets){const s=r.assets.find(o=>o.uuid===t);if(s)return s}}}},tZ={[hs.ANSWER_MODE_TYPE_UNSPECIFIED]:{i18nKey:W({defaultMessage:"Unknown",id:"5jeq8PJZg7"}),id:es.default,mode:"default",show:!0},[hs.ANSWER]:{i18nKey:W({defaultMessage:"Answer",id:"DwjT1HpUgU"}),id:es.default,mode:"default",show:!0},[hs.SHOPPING]:{i18nKey:W({defaultMessage:"Shopping",id:"my1MLnIMoS"}),icon:B("shopping-cart"),id:es.shopping,mode:"shopping",show:!0},[hs.JOBS]:{i18nKey:W({defaultMessage:"Jobs",id:"9AcATFXaoo"}),icon:B("briefcase"),id:es.jobs,mode:"jobs",show:!0},[hs.HOTELS]:{i18nKey:W({defaultMessage:"Hotels",id:"+dqK4hw0if"}),icon:B("building"),id:es.hotels,mode:"hotels",show:!0},[hs.MAPS]:{i18nKey:W({defaultMessage:"Places",id:"QQInFSbbwr"}),icon:B("map-pin"),id:es.places,mode:"places",show:!0},[hs.IMAGE]:{i18nKey:W({defaultMessage:"Images",id:"Fip4H8CuWD"}),icon:B("photo"),id:es.images,mode:"images",show:!0},[hs.VIDEO]:{i18nKey:W({defaultMessage:"Videos",id:"4XfMuxy3FO"}),icon:B("movie"),id:es.videos,mode:"videos",show:!0},[hs.SOURCES]:{i18nKey:W({defaultMessage:"Links",id:"qCcwo3DU78"}),icon:B("world"),id:es.sources,mode:"sources",show:!0},[hs.ASSETS]:{i18nKey:W({defaultMessage:"Assets",id:"d1uESJO+TH"}),icon:B("stack-2"),id:es.assets,mode:"assets",show:!0},[hs.APPS]:{i18nKey:W({defaultMessage:"App",id:"2rUVsUf259"}),icon:B("layout-collage"),id:es.apps,mode:"apps",show:!1},[hs.SEARCH]:{i18nKey:W({defaultMessage:"Search",id:"xmcVZ0BU63"}),icon:B("search"),id:es.search,mode:"search",show:!1},[hs.CHAT]:{i18nKey:W({defaultMessage:"Chat",id:"WTrOy36sdu"}),icon:B("message"),id:es.chat,mode:"chat",show:!1}};(()=>{const e={};return Object.values(tZ).forEach(t=>{e[t.mode]=t}),e})();function zje(e,t){return{...e.icon&&{icon:e.icon},id:e.id,mode:e.mode,text:t(e.i18nKey),show:e.show??!0}}function Wje(e){const t=e.sourcesCount||e.attachmentsLength||0,n=e.sourcesProgress!==ta.DONE&&!e.attachmentsLength;return{count:t,disabled:n}}const Gje=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"always-show-brand-in-thread-tabs",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},$je={ANSWER:"default",IMAGE:"images",VIDEO:"videos",SHOPPING:"shopping",MAPS:"places",SOURCES:"sources",JOBS:"jobs",HOTELS:"hotels",ASSETS:"assets",SEARCH:"search",CHAT:"chat",APPS:"apps"};function nZ(e){return $je[e]??null}const Zj=e=>Object.entries(es).find(([t,n])=>n===e)?.[0],qje=(e,t)=>{const r=new URLSearchParams(t?.toString()).get(e.toString());if(r)return typeof r=="string"?Zj(r):Array.isArray(r)?Zj(r[0]):void 0},Kje=e=>e==="default",Yje=e=>Vi(e).with("default",()=>"default").with("shopping",()=>"default").with("jobs",()=>"full").with("hotels",()=>"full").with("places",()=>"full").with("images",()=>"full").with("videos",()=>"full").with("sources",()=>"default").with("assets",()=>"full").with("apps",()=>"full").with("search",()=>"default").otherwise(()=>"default"),pw=e=>({mode:e,width:Yje(e)}),Qje=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],s=r?.[0];if(!s)continue;if(s.blocks?.find(i=>i.answer_tabs_block)?.answer_tabs_block?.modes?.some(i=>i.answer_mode_type?nZ(i.answer_mode_type)===t:!1))return[r]}return null},Rv=()=>{const{session:e}=je(),t=Ca(),{firstResult:n}=an(),r=n?.backend_uuid,s=n?.context_uuid,{device:{isWindowsApp:o}}=on(),a=d.useCallback((i,c)=>{const u=np(o);Li({name:i,data:{entryUUID:r,threadUUID:s,...c,isPerplexityBrowser:t},source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[r,s,t,o,e?.user?.id,e?.user?.subscription_status]);return d.useMemo(()=>({trackEvent:a}),[a])},Xje={pendingClarifications:[],addClarification:()=>{},clearClarifications:()=>{},pendingSuggestions:[],addPendingSuggestion:()=>{},removePendingSuggestion:()=>{},clearPendingSuggestions:()=>{}},rZ=zt("DeepResearchContext",Xje),Zje=({children:e})=>{const[t,n]=d.useState([]),[r,s]=d.useState([]),o=d.useCallback(m=>{n(p=>p.concat([m]))},[]),a=d.useCallback(()=>{n([])},[]),i=d.useCallback(m=>{s(p=>p.concat([m]))},[]),c=d.useCallback(m=>{s(p=>p.filter(h=>h.UUID!==m))},[]),u=d.useCallback(()=>{s([])},[]),f={pendingClarifications:t,clearClarifications:a,addClarification:o,pendingSuggestions:r,addPendingSuggestion:i,removePendingSuggestion:c,clearPendingSuggestions:u};return l.jsx(rZ.Provider,{value:f,children:e})},Dv=()=>{const e=d.useContext(rZ);if(!e)throw new Error("useDeepResearchState must be used within DeepResearchContext");return e};var Na={},Jj;function Jje(){if(Jj)return Na;Jj=1;var e=Na&&Na.__values||function(s){var o=typeof Symbol=="function"&&s[Symbol.iterator],a=0;return o?o.call(s):{next:function(){return s&&a>=s.length&&(s=void 0),{value:s&&s[a++],done:!s}}}},t=Na&&Na.__read||function(s,o){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var i=a.call(s),c,u=[],f;try{for(;(o===void 0||o-- >0)&&!(c=i.next()).done;)u.push(c.value)}catch(m){f={error:m}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(f)throw f.error}}return u};Object.defineProperty(Na,"__esModule",{value:!0}),Na.selectState=function(s){return s};function n(){var s,o,a;function i(c){var u=0,f;function m(h){var g,y;s||(s={state:h,version:1}),s.state!==h&&(s.state=h,s.version+=1);var x=s.version,v;if(f){if(x===f.stateVersion)return f.value;var b=!1;try{for(var _=e(f.dependencies.entries()),w=_.next();!w.done;w=_.next()){var S=t(w.value,2),C=S[0],E=S[1];if(C(h)!==E){b=!0,v=C;break}}}catch(M){g={error:M}}finally{try{w&&!w.done&&(y=_.return)&&y.call(_)}finally{if(g)throw g.error}}if(!b)return f.value}u+=1;var N=new Map,k=Object.assign(function(M){if(N.has(M))return N.get(M);var A=M(h);return N.set(M,A),A},{reason:v}),I=a?a(function(){return c(k)},p,h,v):c(k);if(N.size===0)throw new Error("[rereselect] Selector malfunction: The selection logic must select some data by calling `query(selector)` at least once.");return f={stateVersion:x,dependencies:N,value:I},I}var p=Object.assign(function(g){return o?o(function(){return m(g)},p,g):m(g)},{selectionLogic:c,recomputations:function(){return u},resetRecomputations:function(){return u=0},introspect:function(){return f}});return p}return{makeSelector:i,setInvocationWrapper:function(c){o=c},setComputationWrapper:function(c){a=c}}}Na.createSelectionContext=n;var r=n();return Na.makeSelector=r.makeSelector,Na}var Je=Jje();const sZ=Ie,eIe=(e,t)=>{if(!e)return;const n=e.filter(r=>r.plan_block&&r.intended_usage=="plan").map(r=>r.plan_block);if(n&&n.length>0){const r=[];let s=!1;for(const o of n){for(const a of o?.goals??[])if(a.description!==null)if(r.length==0||r[r.length-1]?.final)r.push({...a});else{const i=r[r.length-1];i&&(i.description+=a.description,i.final=a.final)}o?.final&&(s=!0)}if(r.length>0)return{goals:r,final:s,channel_uuid:"",comprehensive_mode:!1}}return t},tIe=e=>e.blocks??Ie,nIe=e=>{const t=e.filter(s=>s.plan_block&&s.intended_usage=="pro_search_steps").map(s=>s.plan_block),n={};for(let s=0;sn[s.steps[0]?.uuid??""]===o).map(s=>s.steps.map(o=>({step_type:o.step_type,uuid:o.uuid??"",content:o?.initial_query_content??o?.attachment_content??o?.terminate_content??o?.search_web_content??o?.web_results_content??o?.code_content??o?.table_status_content??o?.entropy_request_content??o?.thought_content??o?.browser_search_content??o?.browser_open_tab_content??o?.browser_open_tab_results_content??o?.url_navigate_content??o?.browser_get_site_content_content??o?.user_clarification_content??o?.browser_get_history_summary_content??o?.browser_get_open_tab_content_content??o?.read_calendar_content??o?.read_calendar_response_content??o?.read_email_content??o?.read_email_response_content??o?.update_calendar_content??o?.generate_image_content??o?.generate_image_results_content??o?.generate_video_content??o?.generate_video_results_content??o?.search_tabs_content??o?.search_tabs_results_content??o?.create_app_results_content??o?.browser_close_tabs_content??o?.browser_close_tabs_results_content??o?.update_calendar_response_content??o?.browser_group_tabs_content??o?.browser_group_tabs_results_content??o?.create_chart_content??o?.get_url_content_content??o?.create_client_app_content??o?.get_user_info_content??o?.get_user_info_response_content??o?.get_free_busy_content??o?.get_free_busy_response_content??o?.send_email_content??o?.send_email_response_content??o?.browser_ungroup_content??o?.browser_search_tab_groups_content??o?.browser_search_tab_groups_result_content??o?.search_browser_content??o?.search_browser_results_content??o?.clarifying_questions_content??o?.clarifying_questions_output_content??o?.email_calendar_agent_content??o?.email_calendar_agent_response_content??o?.mcp_tool_input_content??o?.mcp_tool_output_content??o?.research_clarifying_questions_content??o?.create_tasks_content??o?.create_tasks_response_content??o?.flights_search_content??o?.flights_booking_content??o?.flights_search_response_content??o?.flights_booking_response_content??o?.flights_agent_content??o?.canvas_agent_content??o?.comet_agent_tool_input_content??o?.comet_agent_tool_output_content??{},assets:o.assets}))).flat()},rIe=e=>e?.filter(t=>t.reasoning_plan_block&&t.intended_usage==="reasoning_plan").map(t=>t.reasoning_plan_block),sIe=e=>{let t=!1;if(e&&e.length>0){const n=new Map;for(const o of e){if(o.goals){for(const a of o.goals)if(a.id)if(n.has(a.id)){const i=n.get(a.id);i.description+=a.description,n.set(a.id,i)}else n.set(a.id,{...a})}t=o.progress==="DONE"}const r=Array.from(n.values()),s=e.flatMap(o=>o.web_results??Ie);return{goals:r,web_results:s,final:t}}};function oIe(e){const t={},n=[];return e?.forEach(r=>{if(r.widget_block){const s=t[r.intended_usage]??n.length;t[r.intended_usage]=s,n[s]=$ye(n[s],r.widget_block)}}),n}function aIe(e){return(e?.filter(t=>t.media_block).flatMap(t=>t.media_block.media_items)??[]).filter(t=>!t.sponsored_uuid)}function iIe(e){return e?.filter(t=>t.media_block).flatMap(t=>t.media_block.generated_media_items)??[]}function lIe(e=Ie){return e.reduce((t,n)=>{if(n.is_code_interpreter&&n.is_image)t.codeInterpreterImages.push(n);else{const r=n.meta_data?.source==="quartr"?{...n,snippet:""}:n;t.webResultsStandard.push(r)}return t},{webResultsStandard:[],codeInterpreterImages:[]})}function cIe(e){return e?.flatMap(t=>t.inline_entity_block?.knowledge_card_block?t.inline_entity_block.knowledge_card_block.knowledge_cards:t.knowledge_card_block?t.knowledge_card_block.knowledge_cards:[])??[]}function uIe(e){return e??Ie}function dIe(e){return e?.filter(t=>t.citation_block).flatMap(t=>t.citation_block.citations)??Ie}function fIe(e){const t=e?.find(r=>r?.widget_block?.finance_widget_block&&r.intended_usage==="finance_widget")?.widget_block?.finance_widget_block;return t===void 0?void 0:{object:"FinanceWidget",data:t.data_json.map(r=>JSON.parse(r)),data_v2:t?.data_json_v2?.map(r=>JSON.parse(r))}}function mIe(e){const t=e?.map(s=>s.widget_block)?.find(s=>s?.widget_type==="sports");if(!t?.sports_widget_block?.data)return;const r=t.sports_widget_block.data;switch(r.object){case"SportsEventsWidget":return r;case"SportsIndvScheduleWidget":return r;case"SportsStandingsWidget":return r;case"SportsIndvEventsWidget":return r;default:return}}function pIe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.price_comparison_widget_block);if(!(!t||!t.widget_block?.price_comparison_widget_block))return{object:"PriceComparisonWidget",...t.widget_block.price_comparison_widget_block}}function hIe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="WeatherWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function gIe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="TimeWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function yIe(e){if(!e)return;const t=e?.find(r=>r.widget_block?.search_result_widget_block?.metadata?.object==="TimerWidget");return!t||!t.widget_block?.search_result_widget_block?void 0:t.widget_block.search_result_widget_block.metadata}function xIe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="CalculatorWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function vIe(e,t){return e&&e.length>0?e.map(n=>({name:n.widget_type||"",url:"",snippet:"",timestamp:"",meta_data:{object:n.widget_type||"unknown",...n},is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""})):t||[]}function bIe(e){const t=e.find(r=>r?.meta_data?.object==="TableWidget");return t?t.meta_data.search_results:Ie}function _Ie(e){return e.filter(t=>sZ.includes(t?.meta_data?.object))}function wIe(e){return e.filter(t=>!sZ.includes(t?.meta_data?.object))}function CIe(e){const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="TaskWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function SIe(e){if(!e)return;const t=e?.map(n=>n.widget_block)?.find(n=>n?.widget_type==="flight_status");if(t?.flight_status_widget_block?.data)return t.flight_status_widget_block}function EIe(e){if(!e)return;const t=e?.map(n=>n.widget_block)?.find(n=>n?.widget_type==="news");if(t?.news_widget_block?.web_results)return{object:"NewsWidget",web_results:t.news_widget_block.web_results}}function kIe(e){if(!e)return;const t=e?.find(r=>r.widget_block?.search_result_widget_block?.metadata?.object==="CurrencyExchangeWidget");return!t||!t.widget_block?.search_result_widget_block?void 0:t.widget_block.search_result_widget_block.metadata}function MIe(e){const t=e?.find(s=>s.widget_block?.prediction_market_widget_block&&s.intended_usage==="prediction_market_widget");if(!t||!t.widget_block?.prediction_market_widget_block)return;const n=t.widget_block.prediction_market_widget_block;return n===void 0||!n?.data_json?void 0:{object:"PredictionMarketWidget",data:JSON.parse(n.data_json)}}function TIe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="GenericFallbackWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function AIe(e){if(!e?.length)return[];const t=[];return e.forEach(n=>{n.intended_usage==="pro_search_steps"&&n.plan_block?.steps&&n.plan_block.steps.forEach(r=>{r.clarifying_questions_output_content?.clarification&&t.push(r.clarifying_questions_output_content.clarification)})}),t}function NIe(e){return e?e.find(n=>n.intended_usage==="refinement_filters")?.refinement_filters_block:void 0}function RIe(e){return e?e.find(n=>n.inline_entity_block?.maps_preview_block&&n.intended_usage==="answer_maps_preview")?.inline_entity_block?.maps_preview_block:void 0}function DIe(e){return e.blocks?.some(t=>t.intended_usage==="ask_text")??!1}function jIe(e,t,n=[]){return t===ie.DEFAULT||n.length>0&&n[n.length-1]?.step_type==="FINAL"||e?.some(s=>s.markdown_block||s.entity_list_block||jH(s.entity_group_block)||IH(s.inline_entity_block))}const jv=e=>{let t;if("meta_data"in e?t=e.meta_data:t=Vi(e).with({place_widget_block:nd.nonNullable},n=>({...n.place_widget_block,object:"PlaceWidget"})).with({shopping_widget_block:nd.nonNullable},n=>({...n.shopping_widget_block,progress:ta.DONE,object:"ShopifyWidget"})).with({price_comparison_widget_block:nd.nonNullable},n=>({...n.price_comparison_widget_block,object:"PriceComparisonWidget"})).with({search_result_widget_block:nd.nonNullable},n=>{const r=n.search_result_widget_block.metadata||{},s=r.object;if(s==="WeatherWidget")return{...r,progress:ta.DONE,object:"WeatherWidget"};if(s==="TimeWidget")return{...r,progress:ta.DONE,object:"TimeWidget"};if(s==="CalculatorWidget")return{...r,progress:ta.DONE,object:"CalculatorWidget"};if(s==="TaskWidget")return{...r,progress:ta.DONE,object:"TaskWidget"};if(s==="TimerWidget")return{...r,progress:ta.DONE,object:"TimerWidget"};if(s==="CurrencyExchangeWidget")return{...r,progress:ta.DONE,object:"CurrencyExchangeWidget"};if(s==="GenericFallbackWidget")return{...r,progress:ta.DONE,object:"GenericFallbackWidget"};if(s==="PredictionMarketWidget")return{...r,progress:ta.DONE,object:"PredictionMarketWidget"}}).otherwise(()=>{}),!!t)return t},IIe=(e,t)=>e.concat(t).reduce((r,s)=>{const o=jv(s);if(!o)return r;const a=o.object;return(a==="ShopifyWidget"||a==="PlaceWidget")&&(r[a]||(r[a]=[]),r[a].push(s)),r},{}),Cr=e=>e.result,jn=Je.makeSelector(e=>tIe(e(Cr))),PIe=Je.makeSelector(e=>{const t=e(jn),n={};return t.forEach(r=>{r.intended_usage&&(n[r.intended_usage]=r)}),n}),OIe=Je.makeSelector(e=>e(Cr).mode),oZ=Je.makeSelector(e=>e(Cr).display_model),LIe=Je.makeSelector(e=>!!e(Cr).is_pro_reasoning_mode),FIe=Je.makeSelector(e=>e(Cr).search_implementation_mode),o6=Je.makeSelector(e=>Yt.isStatusFailed(e(Cr))),aZ=Je.makeSelector(e=>Yt.isStatusPending(e(Cr))),BIe=Je.makeSelector(e=>Yt.isStatusBlocked(e(Cr))),UIe=Je.makeSelector(e=>e(Cr).plan),iZ=Je.makeSelector(e=>e(Cr).widget_data??Ie),Iv=Je.makeSelector(e=>Yt.parseAskTextField(e(Cr))??void 0),lZ=Je.makeSelector(e=>Yt.isStatusPending(e(Cr))),VIe=Je.makeSelector(e=>DIe(e(Cr))),cZ=Je.makeSelector(e=>e(Cr).expect_search_results),a6=Je.makeSelector(e=>{const t=e(Iv),n=Yt.isStatusCompleted(e(Cr));return t?Yt.hasAnswer(t,n):!1}),uZ=Je.makeSelector(e=>e(hZ).length>0),_h=Je.makeSelector(e=>nIe(e(jn))),dZ=Je.makeSelector(e=>eIe(e(jn),e(UIe))),HIe=Je.makeSelector(e=>rIe(e(jn))),fZ=Je.makeSelector(e=>sIe(e(HIe))),mZ=Je.makeSelector(e=>sn(e(oZ))),zIe=Je.makeSelector(e=>{const t=e(mZ),n=e(Cr),r=Yt.parseStructuredAnswerBlocks(n);return r!==null&&r.some(s=>s.intended_usage==="answer_generated_image"||s.intended_usage==="answer_generated_video")&&!r.some(s=>!!s.markdown_block?.answer||!!s.markdown_block?.chunks)&&t===oe.SEARCH}),pZ=Je.makeSelector(e=>oIe(e(jn))),hZ=Je.makeSelector(e=>lIe(e(Iv)?.web_results).webResultsStandard),gZ=Je.makeSelector(e=>hIe(e(jn))),yZ=Je.makeSelector(e=>gIe(e(jn))),xZ=Je.makeSelector(e=>yIe(e(jn))),vZ=Je.makeSelector(e=>kIe(e(jn))),bZ=Je.makeSelector(e=>MIe(e(jn))),_Z=Je.makeSelector(e=>TIe(e(jn))),wZ=Je.makeSelector(e=>xIe(e(jn))),CZ=Je.makeSelector(e=>SIe(e(jn))),i6=Je.makeSelector(e=>EIe(e(jn))),Pv=Je.makeSelector(e=>vIe(e(pZ),e(iZ))),WIe=Je.makeSelector(e=>jIe(e(jn),e(oZ),e(_h))),GIe=Je.makeSelector(e=>e(Iv)?.answer==="Answer skipped."||e(jn).some(t=>t.markdown_block?.answer==="Answer skipped.")),$Ie=Je.makeSelector(e=>e(OIe)===bd.COPILOT||e(_h)!=null&&e(_h).length>0),qIe=Je.makeSelector(e=>e(o6)?Ie:aIe(e(jn))),KIe=Je.makeSelector(e=>e(o6)?Ie:iIe(e(jn))),YIe=Je.makeSelector(e=>e(Cr).attachment_processing_progress??Ie),QIe=Je.makeSelector(e=>!!e(YIe).length),SZ=Je.makeSelector(e=>e(Cr).search_focus==="writing"),EZ=Je.makeSelector(e=>{const t=e(lZ),n=e(cZ),r=e(SZ);return!!t&&n!=="false"&&!r}),XIe=Je.makeSelector(e=>{const t=e(uZ),n=e(EZ);return t||n}),ZIe=Je.makeSelector(e=>!e(a6)),JIe=Je.makeSelector(e=>{const t=e(aZ),n=e(a6);return t&&!n}),ePe=Je.makeSelector(e=>{const t=e(dZ),n=e(fZ),r=t?.goals&&t.goals.length>0||n?.goals&&n.goals.length>0,o=e(_h).some(a=>a.step_type==="SEARCH_RESULTS");return r||o}),tPe=Je.makeSelector(e=>cIe(e(jn))),nPe=Je.makeSelector(e=>uIe(e(Cr).related_query_items)),rPe=Je.makeSelector(e=>dIe(e(jn))),kZ=Je.makeSelector(e=>fIe(e(jn))),MZ=Je.makeSelector(e=>mIe(e(jn))),TZ=Je.makeSelector(e=>pIe(e(jn))),AZ=Je.makeSelector(e=>bIe(e(Pv))),sPe=Je.makeSelector(e=>_Ie(e(Pv))),oPe=Je.makeSelector(e=>wIe(e(Pv))),aPe=Je.makeSelector(e=>IIe(e(Pv),e(pZ))),iPe=Je.makeSelector(e=>[...e(hZ),...e(AZ)]),lPe=Je.makeSelector(e=>CIe(e(jn))),NZ=Je.makeSelector(e=>!!e(i6)?.web_results?.length),RZ=Je.makeSelector(e=>{const t=e(MZ),n=e(kZ),r=e(gZ),s=e(yZ),o=e(wZ),a=e(CZ),i=e(xZ),c=e(vZ),u=e(bZ),f=e(TZ),m=e(_Z),p=e(i6);return!!(t||n||r||s||o||a||i||c||u||f||m||p)}),cPe=Je.makeSelector(e=>{const t=e(RZ),n=e(NZ);return!t||n}),uPe=Je.makeSelector(e=>AIe(e(jn))),dPe=Je.makeSelector(e=>NIe(e(jn))),fPe=Je.makeSelector(e=>RIe(e(jn))),DZ=Je.makeSelector(e=>e(Cr).classifier_results),mPe=Je.makeSelector(e=>{const t=e(DZ);return t!==void 0&&Object.keys(t).length>0}),pPe=Je.makeSelector(e=>{const t=e(DZ);return t?.skip_search||t?.mhe_predictions?.skip_search||!1}),jZ=e=>{const{idx:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:c=[]}=e,u=uPe(e),f=n.backend_uuid?c.filter(h=>h.entryUUID===n.backend_uuid).map(h=>h.content):[],m=Array.from(new Set([...u,...f])),p=dPe(e);return{idx:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,isPending:aZ(e),isBlocked:BIe(e),isFinalStep:WIe(e),isFailed:o6(e),isProReasoningMode:LIe(e),widgetData:iZ(e),response:Iv(e),isEntryInFlight:lZ(e),hasLLMToken:VIe(e),isAnswerSkipped:GIe(e),expectWebResults:cZ(e),steps:_h(e),researchPlan:dZ(e),reasoningPlan:fZ(e),searchMode:mZ(e),searchImplementationMode:FIe(e),hasMediaOnlyLayout:zIe(e),hasAnswer:a6(e),hasWebResults:uZ(e),weatherWidgetData:gZ(e),timeWidgetData:yZ(e),timerWidgetData:xZ(e),calculatorWidgetData:wZ(e),currencyExchangeWidgetData:vZ(e),predictionMarketWidgetData:bZ(e),flightStatusWidgetData:CZ(e),genericFallbackWidgetData:_Z(e),isCopilot:$Ie(e),mediaItems:qIe(e),generatedMediaItems:KIe(e),hasPendingFiles:QIe(e),isAgentWorkflowInFlight:ZIe(e),knowledgeCards:tPe(e),relatedQueryItems:nPe(e),webResultCitations:rPe(e),financeWidgetData:kZ(e),newsWidgetData:i6(e),sportsWidgetData:MZ(e),priceComparisonWidgetData:TZ(e),tableWebResults:AZ(e),highPriorityWidgets:sPe(e),lowPriorityWidgets:oPe(e),groupedEntityWidgets:aPe(e),webResults:iPe(e),taskWidgetData:lPe(e),hasFastWidget:RZ(e),hasNewsWidget:NZ(e),shouldShowMediaPreview:cPe(e),userClarifications:m,refinementFiltersData:p,selectedFilterIds:p?.selected_filter_ids??[],focusIsWriting:SZ(e),expectSearchResults:EZ(e),hasSources:XIe(e),blocksByIntendedUsage:PIe(e),mapsPreviewData:fPe(e),hasClassifierResults:mPe(e),isChatQuery:pPe(e),hasAnyAgentSteps:ePe(e),isProcessingQuery:JIe(e)}},hPe=e=>Xi()((n,r)=>({isStatusUpdaterOpen:!1,wasStatusUpdaterManuallyOpened:!1,selectedRefinementQuery:null,skippedSources:new Set([]),...jZ(e),actions:{setSelectedRefinementQuery:s=>n({selectedRefinementQuery:s}),setSelectedFilterIds:s=>n({selectedFilterIds:s}),addSkippedSource:s=>{const o=r().skippedSources,a=new Set(o);a.add(s),n({skippedSources:a})},removeSkippedSource:s=>{const o=r().skippedSources,a=new Set(o);a.delete(s),n({skippedSources:a})}}})),{Context:gPe,useTrackedState:yPe}=d4("ThreadEntryContext"),l6=T.memo(({idx:e,children:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i})=>{const c=d.useRef(r),{trackEvent:u}=Rv(),{pendingClarifications:f}=Dv(),[m]=d.useState(()=>hPe({idx:e,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:f})),h=m(g=>g.isFinalStep);return d.useEffect(()=>{const g=()=>{const v=setTimeout(()=>{u("engaged",{})},1e4);return()=>{clearTimeout(v)}},y=o&&s,x=c.current&&!r;if(y&&x&&h)return g();c.current=r},[r,h,s,o,u]),d.useEffect(()=>{m.setState(jZ({idx:e,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:f}))},[e,n,r,s,o,a,i,f,m]),l.jsx(gPe.Provider,{value:m,children:t})});l6.displayName="ThreadEntryProvider";const Ot=yPe;function Mg(){const{result:{frontend_uuid:e,frontend_context_uuid:t}}=Ot(),n=L4(),r=n(e??"")??n(t);return d.useCallback((s,o)=>r?.addTiming(s,o),[r])}function c6(){const{result:{frontend_uuid:e,frontend_context_uuid:t}}=Ot(),n=L4(),r=n(e??"")??n(t);return d.useCallback((s,o)=>r?.addTimingOnce(s,o),[r])}const xPe=({idx:e,searchParams:t,blocks:n})=>Xi()((r,s)=>({answerModeActionList:[],currentModeData:pw(qje(e,t)??"default"),...PZ(n),actions:{updateCurrentMode:o=>{const a=s(),i=a.defaultModeOverride&&o==="default"?a.defaultModeOverride:o;r({currentModeData:pw(i)})},setOverrideMode:o=>{const a=o;r({defaultModeOverride:a,currentModeData:pw(a??"default")})}}})),{Context:vPe,useTrackedState:bPe}=d4("AnswerModeContext"),IZ=zt("AnswerModeApiContext",void 0),_Pe=({children:e,scrollToListItem:t})=>{const{setActiveMode:n,activeEntryIdx:r,activeThreadTab:s}=kg(),{idx:o,result:{backend_uuid:a,context_uuid:i},isLastResult:c}=Ot(),{actions:{updateCurrentMode:u,setOverrideMode:f},currentModeData:m}=u6(),{session:p}=je(),{trackEvent:h}=Ke(p),g=d.useCallback(x=>{x!==m.mode&&(u(x),r===o&&n(x),requestAnimationFrame(()=>{t(o,{smooth:!0})}),h("answer mode tab selected",{answerMode:x,entryUUID:a,contextUUID:i}))},[m.mode,o,u,r,h,a,i,n,t]);d.useEffect(()=>{r===o&&n(m.mode)},[r,o,n,m.mode]),d.useEffect(()=>{c&&s&&s!==m.mode&&u(s)},[c,s,m.mode,u]);const y=d.useMemo(()=>({updateCurrentMode:v=>{g(v)},setOverrideMode:f}),[g,f]);return l.jsx(IZ.Provider,{value:y,children:e})};function PZ(e){const t=Oje(e),n=Lje(e),r=Fje(e),s=Bje(e),o=Uje(e),a=Vje(e),i=s6(e,{orderedByPriority:!0});return{images:t,videos:n,shopping:r,jobs:s,places:o,sources:a,assets:i}}const OZ=T.memo(({children:e,scrollToListItem:t})=>{const{$t:n}=J(),r=mn(),{idx:s,searchMode:o,result:{answer_modes:a,blocks:i,attachments:c}}=Ot(),u=Ca(),[f]=d.useState(()=>xPe({idx:s,searchParams:r,blocks:i}));d.useEffect(()=>{i||Z.error("No blocks found for entry",i)},[i]),d.useEffect(()=>{const v=f.getState(),{images:b,videos:_,shopping:w,jobs:S,places:C,sources:E,assets:N}=PZ(i),k=Er(v.images,b)?v.images:b,I=Er(v.videos,_)?v.videos:_,M=Er(v.shopping,w)?v.shopping:w,A=Er(v.jobs,S)?v.jobs:S,D=Er(v.places,C)?v.places:C,P=Er(v.sources,E)?v.sources:E,F=Er(v.assets,N)?v.assets:N;(k!==v.images||I!==v.videos||M!==v.shopping||A!==v.jobs||D!==v.places||P!==v.sources||F!==v.assets)&&f.setState({images:k,videos:I,shopping:M,jobs:A,places:D,sources:P,assets:F})},[i,f]);const m=d.useMemo(()=>Object.fromEntries(Object.entries(tZ).map(([v,b])=>[v,zje(b,n)])),[n]),p=f.getState().sources,h=d.useMemo(()=>{const{count:v,disabled:b}=Wje({sourcesCount:p.count,sourcesProgress:p.progress,attachmentsLength:c?.length||0});return{...m,[hs.SOURCES]:{...m[hs.SOURCES],count:v,disabled:b}}},[m,p.count,p.progress,c?.length]),{variation:g}=Gje(!1),y=d.useMemo(()=>n(u?{defaultMessage:"Assistant",id:"wSAvhubuX6"}:g?{defaultMessage:"Perplexity",id:"KCWNcPqV2E"}:{defaultMessage:"Answer",id:"DwjT1HpUgU"}),[n,g,u]),x=d.useMemo(()=>u?CM:B("align-justified"),[u]);return d.useEffect(()=>{const v=a?.map(w=>{if(!nZ(w.answer_mode_type))return Z.warn("Unsupported Answer Mode",{mode:w.answer_mode_type.valueOf()}),null;const C=h[w.answer_mode_type];return C||(Z.warn("Missing mode action mapping",{mode:w.answer_mode_type.valueOf()}),null)}).filter(w=>!!w),b=[{text:y,icon:x,id:"d",mode:"default"},...(v??[]).filter(w=>w.show===void 0||w.show===!0)],_=f.getState();Er(_.answerModeActionList,b)||f.setState({answerModeActionList:b})},[n,a,h,o,u,y,x,f]),l.jsx(vPe.Provider,{value:f,children:l.jsx(_Pe,{scrollToListItem:t,children:e})})});OZ.displayName="AnswerModeProvider";const u6=bPe,wPe=()=>{const e=d.useContext(IZ);if(!e)throw new Error("useAnswerModeApi must be used within an AnswerModeProvider");return e},CPe=e=>{try{return JSON.parse(e)}catch{return null}},LZ=T.memo(({title:e,description:t,className:n="",role:r,retryFn:s,...o})=>{const{$t:a}=J(),i=a({defaultMessage:"Please try again later.",id:"EjH+J3uOTD"}),c=d.useMemo(()=>CPe(t??""),[t]);return c&&(console.warn("Tried to pass a JSON error description"),console.warn(c)),l.jsxs("div",{className:`gap-md bg-caution py-sm px-md mt-4 flex items-center rounded-lg text-left font-sans text-white ${n}`,role:"alert",...o,children:[l.jsx(ge,{icon:B("alert-circle")}),l.jsxs("div",{className:"flex grow flex-col",children:[l.jsx("p",{className:"font-medium",children:e||a({defaultMessage:"Sorry, something went wrong",id:"E2YPKR25ob"})}),l.jsx("p",{children:c?i:t})]}),s&&l.jsx(rt,{noXPadding:!0,text:a({defaultMessage:"Try again",id:"FazwRldA7z"}),onClick:s,textClassName:"text-white"})]})});LZ.displayName="ErrorComponent";const Xf=T.memo(({fullWidth:e,retryFn:t,className:n,errorCode:r})=>{const{$t:s}=J(),o=d.useCallback(()=>{gx("error retry")},[]),a=(()=>{switch(r){case"FETCHER_SSE_OFFLINE_ERROR":case"FETCHER_SSE_NO_STATUS_CODE_ERROR":return s({defaultMessage:"Unstable internet, check your connection",id:"vbFcV2WAsH"});default:return s({defaultMessage:"Sorry, something went wrong",id:"E2YPKR25ob"})}})();return l.jsx("div",{className:z("max-w-threadContentWidth mx-auto",{"w-full":e},n),children:l.jsx(LZ,{className:z("mx-md md:mx-0",{"bg-super":r==="FETCHER_SSE_OFFLINE_ERROR"}),title:a,retryFn:t??o})})});Xf.displayName="ErrorFallback";const ja=d.memo(({children:e,id:t})=>{const n=d.useMemo(()=>()=>l.jsx("div",{className:"isolate mx-auto max-w-threadContentWidth",children:l.jsx(Xf,{})}),[]);return l.jsx(Ar,{fallback:n,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(Dp.Panel,{value:t,children:e})})});ja.displayName="AnswerModeContainer";const wr=({children:e,className:t,as:n="div",active:r=!0,speed:s="normal",hoverOnly:o=!1,variant:a="default"})=>{const[i,c]=d.useState(!1),u=o?i:r;return T.createElement(n,{style:{animationDuration:s==="normal"?"1200ms":"1800ms"},className:z({shimmer:u&&a==="default","animate-gradient bg-clip-text text-transparent shimmer-super":u&&a==="super"},t),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e)},FZ=d.memo(()=>l.jsxs(wr,{className:"gap-md flex flex-col",children:[l.jsx(gy,{}),l.jsx(gy,{}),l.jsx(gy,{})]}));FZ.displayName="AnswerModeLoader";const gy=d.memo(()=>l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(K,{variant:"subtler",className:"size-32 shrink-0 rounded-md"}),l.jsxs("div",{className:"gap-sm flex w-full flex-col",children:[l.jsx(K,{variant:"subtler",className:"h-4 w-full rounded-full"}),l.jsx(K,{variant:"subtler",className:"h-4 w-2/3 rounded-full"})]})]}));gy.displayName="Item";const SPe=({maxHeightPx:e})=>{const[t,n]=d.useState(null),[r,s]=d.useState(!1),[o,a]=d.useState(!1),[i,c]=d.useState(0),u=d.useCallback(f=>{n(f),f&&a(!1)},[]);return d.useLayoutEffect(()=>{if(!t||typeof window>"u")return;const f=new ResizeObserver(m=>{for(const p of m){const h=p.target.scrollHeight;a(!0),c(h),s(h>e)}});return f.observe(t),()=>{f.disconnect()}},[t,e]),d.useMemo(()=>({ref:u,isTruncated:r,hasMeasured:o,scrollHeight:i}),[r,o,i,u])},EPe=({maxHeight:e,children:t,buttonLabels:n,buttonTestId:r,className:s})=>{const[o,a]=d.useState(!1),{ref:i,isTruncated:c,hasMeasured:u,scrollHeight:f}=SPe({maxHeightPx:e}),m=d.useCallback(()=>{a(v=>!v)},[]),p=ec(u),h=u&&p,g=d.useMemo(()=>u?{height:c&&!o?e:f,transition:h?"height 200ms cubic-bezier(0.16, 1, 0.3, 1)":"none",overflow:"hidden"}:{maxHeight:e,transition:"none",overflow:"hidden"},[u,c,o,f,h,e]),y=u&&c&&!o,x=d.useMemo(()=>({maskImage:y?"linear-gradient(to bottom, black 70%, transparent 97%)":void 0}),[y]);return l.jsxs("div",{className:s,children:[l.jsx("div",{style:x,children:l.jsx("div",{style:g,children:l.jsx("div",{ref:i,children:t})})}),c&&l.jsx("div",{className:z("top-xs relative flex",{"-mt-2":!o}),children:l.jsx("div",{className:"-mt-0.5","data-testid":r,children:l.jsx(Ct,{size:"tiny",variant:"text",onClick:m,trailingIcon:o?B("chevron-up"):B("chevron-down"),children:o?n.showLess:n.showMore})})})]})},kPe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"enable-share-prompts",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function MPe({entryUUID:e,reason:t,callback:n}){const[r,s]=d.useState(!1),o=d.useRef(!1),{inFlight:a}=an();return d.useEffect(()=>{!a&&o.current&&(o.current=!1,s(!1),n())},[a,n]),{terminateEntry:()=>{o.current=!0,s(!0),lu({entryUUID:e,reason:t})},isTerminating:r}}const BZ=d.memo(({children:e,className:t,hasAttachments:n})=>l.jsx("div",{className:z("flex min-w-[48px] items-center justify-center","bg-offset text-foreground rounded-2xl p-3 font-sans text-base font-normal select-none",{"rounded-br-none":n},t),children:l.jsx("span",{className:"select-text",style:{overflowWrap:"anywhere"},children:e})}));BZ.displayName="ChatBubble";const TPe={maskImage:"linear-gradient(to bottom, black 50%, transparent)"};function APe({entryUUID:e,displayQueryStr:t,inFlight:n,onSubmitEdit:r}){const[s,o]=d.useState(t??""),[a,i]=d.useState(!1),{trackEvent:c}=Rv(),u=el(),{updateCurrentMode:f}=wPe();d.useEffect(()=>{n&&i(!1)},[n]);const m=d.useCallback(()=>{s!==t&&r(s),i(!1),f("default")},[s,t,r,f]),{terminateEntry:p,isTerminating:h}=MPe({entryUUID:e,reason:"editable-thread-title",callback:m}),g=d.useCallback(()=>{u&&p()},[u,p]),y=d.useCallback(()=>{u&&(c("confirm edit query click",{entryUUID:e,newQuery:s}),m())},[u,e,m,c,s]),x=d.useCallback(()=>{n?g():y()},[n,g,y]),v=d.useCallback(()=>{o(t??""),i(!1),c("cancel edit query click",{entryUUID:e})},[e,t,c]),b=d.useCallback(()=>{o(t??""),i(!0)},[t]),_=!!u;return d.useMemo(()=>({handleEditButtonClick:b,handleCancelEditQuery:v,handleConfirmEditQuery:x,isTerminating:h,canEdit:_,editQueryValue:s,setEditQueryValue:o,isEditingQuery:a}),[b,v,x,h,_,s,a])}function NPe({entryUUID:e,displayQueryStr:t}){const{$t:n}=J(),{trackEvent:r}=Rv(),{openToast:s}=pn(),[o,a]=d.useState(!1),{variation:i}=kPe(!1),c=i&&!1,u=d.useCallback(f=>{f.preventDefault(),navigator.clipboard.writeText(t??""),a(!0),setTimeout(()=>a(!1),2e3),r("click copy query button",{entryUUID:e})},[t,c,s,n,r,e]);return d.useMemo(()=>({handleCopyButtonClick:u,showCopyCheckmark:o}),[u,o])}const UZ=d.memo(({entryUUID:e,onSubmitEdit:t,isFirstResult:n,hasAttachments:r,inFlight:s,isFailed:o,isEditDisabled:a,selectedRefinementQuery:i,queryStr:c})=>{const u=d.useRef(null);jf("thread-title",{skip:!n});const f=i??c,{quote:m,actualQuery:p}=$x(f),{handleEditButtonClick:h,handleCancelEditQuery:g,handleConfirmEditQuery:y,isTerminating:x,canEdit:v,editQueryValue:b,setEditQueryValue:_,isEditingQuery:w}=APe({entryUUID:e,displayQueryStr:p,inFlight:s,onSubmitEdit:t}),{handleCopyButtonClick:S,showCopyCheckmark:C}=NPe({entryUUID:e,displayQueryStr:f}),E=d.useCallback(N=>{Ls.isEnterKeyWithoutShift(N)?(N.preventDefault(),y()):Ls.isEscapeKey(N)&&g()},[y,g]);return l.jsxs("div",{className:"relative z-10",children:[m&&l.jsx(VZ,{quote:m}),l.jsxs("div",{className:"group relative flex items-end gap-0.5",children:[l.jsx("div",{className:"-inset-md pointer-events-none absolute select-none"}),l.jsx("div",{className:"relative min-w-0 flex-1 flex justify-end",children:w?l.jsx(DPe,{onKeyDown:E,editQueryValue:b,setEditQueryValue:_,inputRef:u}):l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(HZ,{showActions:v,isEditButtonDisabled:a,showCopyCheckmark:C,onEditClick:h,onCopyClick:S}),l.jsx(qZ,{hasAttachments:r,queryString:p??"",isFirstResult:n,isFailed:o})]})})]}),w&&l.jsx(zZ,{style:TPe,isTerminating:x,onCancel:g,onConfirm:y})]})});UZ.displayName="EditableThreadTitle";const VZ=d.memo(({quote:e})=>l.jsx("div",{className:"mb-sm flex justify-end",children:l.jsxs(V,{variant:"small",color:"light",className:"bg-offset rounded-2xl py-sm px-3 inline-flex items-center",children:[l.jsx(ft,{name:B("quote"),size:18,className:"text-super mr-sm shrink-0 -translate-y-px rotate-180"}),l.jsx("span",{className:"line-clamp-1",children:e})]})}));VZ.displayName="QuoteDisplay";const HZ=d.memo(({showActions:e,isEditButtonDisabled:t,showCopyCheckmark:n,onEditClick:r,onCopyClick:s})=>{const{$t:o}=J();return l.jsxs("div",{className:z("flex shrink-0 items-center gap-1","opacity-0","transition-opacity duration-150","pointer-events-none",e&&"group-hover:pointer-events-auto group-hover:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100"),"aria-hidden":!e,children:[l.jsx(Ct,{icon:B("pencil"),variant:"text",size:"small",rounded:!0,onClick:r,disabled:t,"aria-label":o({defaultMessage:"Edit Query",id:"b3OoXBV5TQ"})}),l.jsx(Ct,{icon:n?B("check"):B("copy"),variant:"text",size:"small",rounded:!0,onClick:s,"aria-label":o({defaultMessage:"Copy Query",id:"pLS6m4WFYK"})})]})});HZ.displayName="TitleActions";const zZ=d.memo(({style:e,isTerminating:t,onCancel:n,onConfirm:r})=>l.jsxs("div",{className:"gap-x-sm my-sm pb-sm w-full absolute top-full flex justify-end",children:[l.jsx(K,{className:"-inset-lg -top-sm absolute",variant:"background",style:e}),l.jsxs("div",{className:"gap-x-sm relative z-10 flex",children:[l.jsx(Ct,{size:"small",variant:"secondary",onClick:n,disabled:t,children:l.jsx(Ne,{defaultMessage:"Cancel",id:"47FYwba+bI"})}),l.jsx(Ct,{size:"small",variant:"primary",onClick:r,disabled:t,children:l.jsx(Ne,{defaultMessage:"Done",id:"JXdbo8Vnlw"})})]})]}));zZ.displayName="EditControls";const WZ=d.memo(({url:e,text:t})=>{const n=d.useMemo(()=>l.jsx("span",{role:"button",tabIndex:0,className:"underline hover:opacity-70 cursor-pointer",title:e,children:t}),[t,e]);return l.jsx(Ul,{triggerElement:n,side:"bottom",align:"start",children:l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"whitespace-nowrap",children:l.jsx(Ne,{defaultMessage:"Go to: ",id:"r9nTuorenA"})}),l.jsx(xt,{href:e,target:"_blank",rel:"noopener",className:"underline break-all","aria-label":e,children:wCe(e,60)})]})})});WZ.displayName="TitleLinkPopover";const GZ=d.memo(({title:e})=>{const{displayTitle:t,links:n}=EMe(e);if(n.length===0)return t;const r=[];let s=0;return n.forEach((o,a)=>{o.startOffset>s&&r.push(l.jsx(T.Fragment,{children:t.substring(s,o.startOffset)},`text-${a}`)),r.push(l.jsx(WZ,{url:o.url,text:t.substring(o.startOffset,o.endOffset)},`link-${a}`)),s=o.endOffset}),s{const{$t:o}=J(),a=d.useCallback(()=>r&&!e?o({defaultMessage:"Something went wrong.",id:"iuY8kxCDQT"}):l.jsx(BZ,{className:"max-w-[600px]",hasAttachments:s,children:l.jsx(GZ,{title:e})}),[r,e,o,s]),i=d.useMemo(()=>({showMore:l.jsx(Ne,{defaultMessage:"Show more",id:"kgNFsmh2uY",description:"Show more of the query."}),showLess:l.jsx(Ne,{defaultMessage:"Show less",id:"qyJtWyZ0yt"})}),[]);return l.jsx(EPe,{maxHeight:RPe,className:"group/title relative inline-flex flex-col",buttonLabels:i,buttonTestId:"toggle-query-expand-button",children:l.jsx(V,{as:n?"h1":"div",className:z("group/query relative whitespace-pre-line !text-wrap break-words [word-break:break-word]",t),children:a()})})});$Z.displayName="DisplayQueryBase";const qZ=d.memo($Z);qZ.displayName="DisplayQuery";const DPe=({onKeyDown:e,editQueryValue:t,setEditQueryValue:n,inputRef:r})=>{const s=t==="";return l.jsxs("div",{className:"relative w-full min-w-0",children:[l.jsx("div",{className:"absolute border border-subtlest bg-subtlest inset-0 rounded-lg"}),l.jsxs("div",{className:"relative grid",children:[l.jsx(eI,{onKeyDown:e,editQueryValue:t,onChange:n,inputRef:r}),l.jsx("div",{className:z("pointer-events-none col-start-1 row-start-1 opacity-0","text-base font-normal leading-normal"),children:s?l.jsx(l.Fragment,{children:" "}):l.jsx(eI,{editQueryValue:t,disabled:!0})})]})]})},eI=({onKeyDown:e,editQueryValue:t,disabled:n,onChange:r,inputRef:s})=>{const{$t:o}=J(),{isMobileUserAgent:a}=Re();return l.jsx("div",{className:z("text-foreground block h-auto w-full resize-none appearance-none overflow-hidden bg-transparent focus:outline-none","caret-super selection:bg-super/50 selection:text-foreground dark:selection:bg-super/10 dark:selection:text-super","text-base font-normal p-3 leading-normal","[&_[contenteditable]]:!font-display","[&_[contenteditable]]:!bg-transparent","[&_[contenteditable]]:max-h-none [&_[contenteditable]]:!overflow-hidden [&_[contenteditable]]:sm:max-h-none [&_[contenteditable]]:lg:max-h-none","[&_[contenteditable]+*>*]:opacity-80","[&>*]:p-0"),style:{gridArea:"1/-1"},children:l.jsx(FA,{onKeyDown:e,placeholder:o({defaultMessage:"Ask anything…",id:"AUouhaZgFv"}),value:t,onChange:r,minRows:0,isMobileStyle:!1,isMobileUserAgent:a,useLexical:!0,autoFocus:!0,disableInput:n,ref:s})})},jPe=Se(async()=>{const{SidePDFViewer:e}=await Ee(()=>q(()=>import("./SidePDFViewer-B5_L2N0Y.js"),__vite__mapDeps([151,4,1,6,3,9,7,152,8,10,11,12])));return{default:e}}),IPe=Se(async()=>{const{SideMeetingTranscriptViewer:e}=await Ee(()=>q(()=>import("./SideMeetingTranscriptViewer-BEF17i8w.js"),__vite__mapDeps([153,4,1,8,3,9,6,7,152,10,11,12])));return{default:e}}),d6=zt("FileViewerContext",{openFile:()=>{},closeViewer:()=>{},doViewerAction:()=>{},isViewerOpen:!1,setViewerDispatch:()=>{}}),PPe=T.memo(({children:e})=>{const[t,n]=d.useState(),[r,s]=d.useState(),o=d.useRef(void 0),a=d.useCallback(h=>{n(h)},[n]),i=d.useCallback(()=>{n(void 0),s(void 0),o.current=void 0},[n,s]),c=d.useRef([]),u=d.useCallback(h=>{o.current?o.current(h):c.current.push(h)},[]),f=d.useCallback(h=>{s(()=>h),o.current=h,c.current.length>0&&h&&(c.current.forEach(g=>h(g)),c.current=[])},[s]),m=d.useMemo(()=>({openFile:a,closeViewer:i,doViewerAction:u,isViewerOpen:!!r,setViewerDispatch:f}),[a,i,u,r,f]),p=t?.fileSource===dV.MEETING_TRANSCRIPT?IPe:jPe;return l.jsxs(d6.Provider,{value:m,children:[e,t&&l.jsx(p,{file:t})]})});PPe.displayName="FileViewerStateProvider";const KZ=({genericErrorMessage:e})=>{const{$t:t}=J(),{openToast:n}=pn();return d.useCallback(r=>{r instanceof $4?n({message:t({defaultMessage:"Downloads are disabled for files in this organization.",id:"NfM+Ayxvc6"}),variant:"error",timeout:8}):r instanceof q4?n({message:t({defaultMessage:"PDF downloads are restricted",id:"aJYvzl3Lq5"}),variant:"error",timeout:8}):r instanceof K4?n({message:t({defaultMessage:"This file belongs to a different organization",id:"lo7Bg402Jd"}),variant:"error",timeout:8}):n({message:e,variant:"error",timeout:3})},[n,t,e])},Ov=({reason:e,onSuccess:t})=>{const{$t:n}=J(),{openToast:r}=pn(),s=KZ({genericErrorMessage:n({defaultMessage:"Failed to download file",id:"RIWlU8NdpC"})});return It({mutationFn:async({file_url:o})=>(await Uz({request:{file_url:o,view_mode:!1},reason:e})).file_url,onSuccess:(o,{tab_id:a})=>{t?t(o,a):window.open(o,"_blank"),r({message:n({defaultMessage:"Downloading file...",id:"/vA9NyIeJh"}),variant:"success",timeout:3})},onError:s})},YZ=T.memo(({attachments:e,backend_uuid:t,fileSourceMap:n})=>l.jsx("div",{className:"gap-sm relative flex flex-wrap flex-row-reverse",children:l.jsx("div",{className:"min-w-0 max-w-[200px]",children:e.length>1?l.jsx(OPe,{attachments:e,backend_uuid:t,fileSourceMap:n}):e[0]?l.jsx(XZ,{attachmentUrl:e[0],backend_uuid:t,fileSource:n.get(e[0])}):null})}));YZ.displayName="AttachmentsRow";const QZ=e=>{const{openFile:t}=d.useContext(d6),{getImageDownloadUrl:n}=Tv({reason:"attachments-row"}),{$t:r}=J(),s=KZ({genericErrorMessage:r({defaultMessage:"Failed to open file",id:"VJjxNdFaqb"})});return d.useCallback(async(o,a)=>{if(!Lx(o))return!1;try{const i=await n({url:o,thread_id:e});return t({name:du(o),url:i,fileSource:a,entryUUID:e}),!0}catch(i){return s(i),!1}},[t,e,n,s])},XZ=T.memo(({attachmentUrl:e,backend_uuid:t,fileSource:n})=>{const r=Tr(e),[s,o]=d.useState(!1),{mutate:a}=Ov({reason:"attachments-row"}),i=QZ(t),c=d.useCallback(()=>{Lx(e)&&a({file_url:e})},[e,a]),u=d.useCallback(()=>{r?o(!0):vA()?i(e,n):c()},[r,e,n,i,c]),f=d.useCallback(()=>{o(!1)},[]),m=d.useMemo(()=>du(e),[e]),p=d.useMemo(()=>({src:e}),[e]),h=d.useMemo(()=>({url:e}),[e]);return l.jsxs(l.Fragment,{children:[l.jsx(ZZ,{title:m,icon:r?l.jsx(FPe,{attachmentUrl:e}):l.jsx(LPe,{attachmentUrl:e}),onClick:u,className:z({"!border-cursor":r})}),r&&l.jsx(gu,{onClose:f,isOpen:s,imgProps:p,origin:h,width:100,height:100,alt:m})]})});XZ.displayName="AttachmentItem";const ZZ=({title:e,icon:t,className:n,hasChevron:r,ref:s,...o})=>l.jsxs(jo,{...o,ref:s,className:z("flex w-full cursor-pointer items-center transition-colors","p-xs gap-[6px] rounded-xl pr-[6px] rounded-tr-none","border-subtlest border bg-background hover:bg-subtler",n),children:[t,l.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 leading-tight",children:e})}),r&&l.jsx(ge,{icon:B("chevron-down"),className:"text-quieter mr-px",size:"sm"})]}),OPe=({attachments:e,backend_uuid:t,fileSourceMap:n})=>{const{$t:r}=J(),[s,o]=d.useState(void 0),{mutate:a}=Ov({reason:"attachments-row"}),i=QZ(t),c=d.useCallback(y=>{Lx(y)&&a({file_url:y})},[a]),u=d.useCallback(async y=>{const x=n.get(y);Tr(y)?o(y):vA()?i(y,x):c(y)},[n,i,c]),f=d.useMemo(()=>l.jsx(BPe,{}),[]),m=d.useMemo(()=>l.jsx(ZZ,{title:r({defaultMessage:"{count, plural, one {# attachment} other {# attachments}}",id:"RYwHHLwZK9"},{count:e.length}),icon:f,className:"!border-cursor",hasChevron:!0}),[r,e.length,f]),p=d.useCallback(()=>{o(void 0)},[]),h=d.useMemo(()=>({src:s}),[s]),g=d.useMemo(()=>({url:s}),[s]);return l.jsxs(l.Fragment,{children:[l.jsx(_t,{align:"end",triggerElement:m,children:e.map(y=>l.jsx(_t.Item,{leadingAccessory:JZ(y).icon,onSelect:()=>u(y),children:du(y)},y))}),s&&l.jsx(gu,{onClose:p,imgProps:h,origin:g,width:100,height:100,isOpen:!0})]})},tI={txt:{icon:B("file-text"),text:"Text file"},pdf:{icon:B("pdf"),text:"PDF file"},jpeg:{icon:B("photo"),text:"Image file"},jpg:{icon:B("photo"),text:"Image file"},doc:{icon:B("file-word"),text:"Word document"},docx:{icon:B("file-word"),text:"Word document"},rtf:{icon:B("file-text"),text:"Text file"},pptx:{icon:B("file-type-ppt"),text:"PowerPoint file"},xlsx:{icon:B("file-excel"),text:"Excel file"},md:{icon:B("file-text"),text:"Markdown file"},png:{icon:B("photo"),text:"Image file"},csv:{icon:B("file-type-csv"),text:"CSV file"},mov:{icon:B("video"),text:"Video file"},mp4:{icon:B("video"),text:"Video file"},unknown:{icon:B("file"),text:"Unknown"}},JZ=e=>{const t=hu(e);return tI[t]??tI.unknown},LPe=({attachmentUrl:e})=>{const{icon:t}=JZ(e);return l.jsx(f6,{children:l.jsx(ge,{icon:t,className:"text-quiet",size:"xs"})})},FPe=({attachmentUrl:e})=>{const[t,n]=d.useState(void 0);return l.jsxs(f6,{children:[l.jsx("img",{src:e,alt:"Attachment",className:z("aspect-square h-full object-cover",{hidden:t===!1,"opacity-0":t===void 0}),onLoad:()=>n(!0),onError:()=>n(!1),loading:"lazy",decoding:"async"}),t===!1&&l.jsx(ge,{icon:B("photo"),className:"text-quiet",size:"xs"})]})},BPe=()=>l.jsx(f6,{children:l.jsx(ge,{icon:B("paperclip"),className:"text-quiet",size:"xs"})}),f6=({children:e})=>l.jsx(K,{variant:"subtle",className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-lg",children:e});var gr;(function(e){e.Preview="preview",e.Source="source"})(gr||(gr={}));const UPe=zt("CanvasContext",{openCanvas:()=>{},closeCanvas:()=>{},isCanvasOpen:!1,doCanvasAction:()=>{},setCanvasDispatch:()=>{},setCanvasState:()=>{}}),Zf=()=>d.useContext(UPe),Qu=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/deeper-research/download-asset",t,{body:e,timeoutMs:2e3,numRetries:1});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to download file",cause:r,status:s.status??0});return n.file_url},VPe=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/deeper-research/export-all-assets",t,{body:e,timeoutMs:6e4,numRetries:1,parseAs:"blob"});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to export all assets",cause:r,status:s.status??0});return n},eJ=({reason:e})=>{const{$t:t}=J(),{openToast:n}=pn(),r=d.useCallback(async a=>{try{const i=await Qu({request:a,reason:e}),c=document.createElement("a");c.href=i,c.download=a.filename,document.body.appendChild(c),c.click(),document.body.removeChild(c),n({message:t({defaultMessage:"Downloading file...",id:"/vA9NyIeJh"}),variant:"success",timeout:3})}catch(i){Z.error("Failed to download S3 asset",{error:i,request:a,errorMessage:i instanceof Error?i.message:"Unknown error"}),n({message:t({defaultMessage:"Failed to download file",id:"RIWlU8NdpC"}),variant:"error",timeout:3})}},[e,t,n]),s=d.useCallback(async(a,i="media",c=document.body)=>{try{const u=await fetch(a,{mode:"cors",cache:"no-cache"});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);const f=await u.blob(),m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=i,c.appendChild(p),p.click(),c.removeChild(p),URL.revokeObjectURL(m);const h=i.toLowerCase().includes(".mp4")||i.toLowerCase().includes(".mov")||i.toLowerCase().includes(".avi")||f.type.startsWith("video/"),g=t(h?{defaultMessage:"Video downloaded",id:"WHvofOjBQO"}:{defaultMessage:"Image downloaded",id:"nS5vxnEXaW"});n({message:g,variant:"success",timeout:3})}catch(u){const f=i.toLowerCase().includes(".mp4")||i.toLowerCase().includes(".mov")||i.toLowerCase().includes(".avi");Z.error("Failed to download media asset",{error:u,mediaUrl:a,errorMessage:u instanceof Error?u.message:"Unknown error",errorType:u instanceof TypeError&&u.message.includes("Failed to fetch")?"CORS":"Unknown"});const m=t(f?{defaultMessage:"Failed to download video",id:"g8uGrbPLMV"}:{defaultMessage:"Failed to download image",id:"YPAbL/7UuZ"});n({message:m,variant:"error",timeout:3})}},[t,n]),o=d.useCallback(async(a,i="image.jpg",c=document.body)=>s(a,i,c),[s]);return d.useMemo(()=>({downloadS3Asset:r,downloadImageAsset:o,downloadMediaAsset:s}),[o,r,s])},m6=e=>{const{$t:t}=J();return Vi(e?.asset_type).with(at.CODE_ASSET,()=>({description:t({defaultMessage:"Programming",id:"4MsdoHG9QN"}),title:t({defaultMessage:"Python",id:"/Z1NW3qKj6"}),Icon:B("code")})).with(at.CHART,()=>({description:t({defaultMessage:"Code Interpreter Graph",id:"F3E5l9GC7U"}),title:t({defaultMessage:"Chart",id:"nFVuBOECC+"}),Icon:B("chart-histogram")})).with(at.CODE_FILE,()=>({description:t({defaultMessage:"Generated File",id:"x6KEQZ7oaM"}),title:e?.code_file?.filename??"",Icon:B("file")})).with(at.APP,()=>({description:t({defaultMessage:"Generated App",id:"t7mMyC1O7+"}),title:e?.app?.name??"",Icon:B("layout-collage")})).with(at.SLIDES,()=>({description:t({defaultMessage:"Presentation",id:"7zHbpiyvPE"}),title:e?.app?.name??"",Icon:B("presentation")})).with(at.GENERATED_IMAGE,()=>({description:"",title:t({defaultMessage:"Generated Image",id:"Kt4lbw5KkH"}),Icon:B("image-in-picture")})).with(at.GENERATED_VIDEO,()=>({description:"",title:t({defaultMessage:"Generated Video",id:"Gh4spqP8w0"}),Icon:B("video")})).with(at.PDF_FILE,()=>({description:t({defaultMessage:"PDF Document",id:"Idloyb3SW4"}),title:e?.pdf_file?.name??t({defaultMessage:"PDF Document",id:"Idloyb3SW4"}),Icon:B("file-type-pdf")})).with(at.DOCX_FILE,()=>({description:t({defaultMessage:"Word Document",id:"q+bgjo7qbJ"}),title:e?.docx_file?.name??"",Icon:B("file-type-docx")})).with(at.DOC_FILE,()=>({description:t({defaultMessage:"Document",id:"wmirkPk7bp"}),title:e?.doc_file?.name??"",Icon:B("file-type-doc")})).with(at.XLSX_FILE,()=>({description:t({defaultMessage:"Excel Spreadsheet",id:"eMPZOuxga0"}),title:e?.xlsx_file?.name??"",Icon:B("file-spreadsheet")})).with(at.QUIZ,()=>({description:t({defaultMessage:"Quiz",id:"OuR/Ijtl93"}),title:e?.quiz?.title??"",Icon:B("checklist")})).with(at.FLASHCARDS,()=>({description:t({defaultMessage:"Flashcards",id:"c2+pp7T4ws"}),title:e?.flashcards?.title??"",Icon:B("cards")})).otherwise(()=>({description:"",title:t({defaultMessage:"Generated Asset",id:"Kc1J25+bKt"}),Icon:B("file")}))};function HPe(e,t,n){const r=new Blob([n],{type:"text/plain"});tJ(e,t,r)}function tJ(e,t,n){const r=document.createElement("a"),s=URL.createObjectURL(n);r.href=s,r.download=t,e.appendChild(r),r.click(),URL.revokeObjectURL(s),e.removeChild(r)}function zPe(e){return!!(e?.asset_type===at.SLIDES&&e.app?.url&&e.app.name)}function Lbt(e){return e?.asset_type?[at.GENERATED_IMAGE,at.CHART,at.CODE_FILE,at.CODE_ASSET].includes(e.asset_type):!1}function WPe(e){return e?.asset_type?[at.CHART,at.GENERATED_IMAGE,at.GENERATED_VIDEO,at.PDF_FILE].includes(e.asset_type):!1}function Fbt({reason:e,entryUUID:t}){const[n,r]=d.useState(!1),s=d.useCallback(async o=>{r(!0);try{const a=await VPe({request:{entry_uuid:t},reason:e});tJ(o||document.body,"exported-assets.zip",a)}finally{r(!1)}},[t,e]);return d.useMemo(()=>({exportAllAssets:s,isExporting:n}),[s,n])}function Bbt({asset:e,reason:t,answerMode:n,context:r,entryUUID:s}){const{downloadS3Asset:o,downloadImageAsset:a,downloadMediaAsset:i}=eJ({reason:t}),{session:c}=je(),{trackEvent:u}=Ke(c),f=d.useCallback(async m=>{if(e)if(r==="canvas"?u("canvas content downloaded",{contentType:e.asset_type,entryUUID:s,assetUUID:e.uuid,downloadType:"download"}):n&&u("generated asset downloaded",{assetType:e.asset_type,answerMode:n,entryUUID:s,reason:t}),e.asset_type===at.GENERATED_IMAGE)e.generated_image?.url&&await a(e.generated_image.url,"generated-image.png",m||document.body);else if(e.asset_type===at.GENERATED_VIDEO)e.generated_video?.url&&await i(e.generated_video.url,"generated-video.mp4",m||document.body);else for(const p of e.download_info)p.url?await o({url:p.url,filename:p.filename}):p.text_content&&HPe(m||document.body,p.filename,p.text_content)},[e,r,n,u,s,t,a,i,o]);return d.useMemo(()=>({downloadAsset:f}),[f])}var Cc;(function(e){e[e.UNCOPIED=0]="UNCOPIED",e[e.COPYING=1]="COPYING",e[e.FAILED=2]="FAILED",e[e.SUCCEEDED=3]="SUCCEEDED"})(Cc||(Cc={}));var Sc;(function(e){e[e.UNLINKED=0]="UNLINKED",e[e.LINKING=1]="LINKING",e[e.FAILED=2]="FAILED",e[e.SUCCEEDED=3]="SUCCEEDED"})(Sc||(Sc={}));function Ubt({asset:e,reason:t}){const[n,r]=d.useState(Cc.UNCOPIED),{$t:s}=J(),{openToast:o}=pn(),a=d.useCallback(async()=>{if(e){r(Cc.COPYING);try{await GPe({asset:e,reason:t}),o({message:s({defaultMessage:"Copied to the clipboard!",id:"WWy0tPuRW8"}),variant:"success",timeout:3}),r(Cc.SUCCEEDED)}catch{o({message:s({defaultMessage:"Failed to copy the asset",id:"HHPhgIZj9h"}),variant:"error",timeout:3}),r(Cc.FAILED)}setTimeout(()=>r(Cc.UNCOPIED),2e3)}},[s,o,r,e,t]);return d.useMemo(()=>({copyStatus:n,copyAsset:a}),[n,a])}function Vbt({asset:e}){const[t,n]=d.useState(Sc.UNLINKED),{$t:r}=J(),{openToast:s}=pn(),o=d.useCallback(async()=>{if(!(!e||!WPe(e))){n(Sc.LINKING);try{let a;if(e.asset_type===at.CHART&&e.chart?.url)a=e.chart.url;else if(e.asset_type===at.GENERATED_IMAGE&&e.generated_image?.url)a=e.generated_image.url;else if(e.asset_type===at.GENERATED_VIDEO&&e.generated_video?.url)a=e.generated_video.url;else if(e.asset_type===at.PDF_FILE&&e.pdf_file?.url)a=e.pdf_file.url;else throw new Error("Asset is not linkable or URL not found");await navigator.clipboard.writeText(a),s({message:r({defaultMessage:"Link copied to clipboard!",id:"PsDXPeXpVG"}),variant:"success",timeout:3}),n(Sc.SUCCEEDED)}catch{s({message:r({defaultMessage:"Failed to copy link",id:"ruCwQMVFzJ"}),variant:"error",timeout:3}),n(Sc.FAILED)}setTimeout(()=>n(Sc.UNLINKED),2e3)}},[e,r,s]);return d.useMemo(()=>({linkStatus:t,linkAsset:o}),[t,o])}async function GPe({asset:e,reason:t}){let n;if(e.asset_type==at.CODE_ASSET)n={"text/plain":e.code?.script??""};else if(e.asset_type==at.CHART&&e.chart?.url){const s=await Qu({request:{url:e.chart.url,filename:"chart.png"},reason:t});n={"image/png":await(await fetch(s)).blob()}}else if(e.asset_type==at.CODE_FILE&&e.code_file?.url){const s=await Qu({request:{url:e.code_file.url,filename:e.code_file.name},reason:t});n={"text/plain":await(await fetch(s)).text()}}else if(e.asset_type==at.GENERATED_IMAGE&&e.generated_image?.url){const s=e.generated_image.url;n={"image/png":await(await fetch(s)).blob()}}else if(e.asset_type==at.GENERATED_VIDEO&&e.generated_video?.url){const s=e.generated_video.url;n={"video/mp4":await(await fetch(s,{mode:"cors",cache:"no-cache"})).blob()}}else if(e.asset_type==at.PDF_FILE&&e.pdf_file?.url){const s=await Qu({request:{url:e.pdf_file.url,filename:e.pdf_file.name},reason:t});n={"application/pdf":await(await fetch(s)).blob()}}else if(e.asset_type==at.DOCX_FILE&&e.docx_file?.url){const s=await Qu({request:{url:e.docx_file.url,filename:e.docx_file.name},reason:t});n={"application/vnd.openxmlformats-officedocument.wordprocessingml.document":await(await fetch(s)).blob()}}else if(e.asset_type==at.XLSX_FILE&&e.xlsx_file?.url){const s=await Qu({request:{url:e.xlsx_file.url,filename:e.xlsx_file.name},reason:t});n={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":await(await fetch(s)).blob()}}if(!n)throw new Error("Failed to find anything to copy");const r=new ClipboardItem(n);await navigator.clipboard.write([r])}function $Pe(e){if(e)switch(e.asset_type){case at.CHART:return e.chart?.url;case at.GENERATED_IMAGE:return e.generated_image?.url;case at.GENERATED_VIDEO:return e.generated_video?.url;case at.PDF_FILE:return e.pdf_file?.url;case at.CODE_FILE:return e.code_file?.url;case at.DOCX_FILE:return e.docx_file?.url;case at.DOC_FILE:return e.doc_file?.url;case at.XLSX_FILE:return e.xlsx_file?.url;case at.APP:return e.app?.app_url;case at.SLIDES:return e.app?.app_url;case at.CODE_ASSET:return;case at.QUIZ:return e.quiz?.url;case at.FLASHCARDS:return e.flashcards?.url;default:fme(e.asset_type);return}}const nJ=({asset:e})=>{const{openCanvas:t,closeCanvas:n,doCanvasAction:r,canvasState:s,isCanvasOpen:o}=Zf(),{title:a}=m6(e),{result:{context_uuid:i,backend_uuid:c}}=Ot(),{session:u}=je(),{trackEvent:f}=Ke(u),m=d.useCallback(()=>{if(e){const p=$Pe(e);p&&window.open(p,"_blank");return}},[e,t,n,r,a,c,o,s?.assetUuid,f,i]);return d.useMemo(()=>m,[m])},qPe=()=>{const e=mn(),{results:t}=an(),n=d.useRef(!1),r=t?.[0],s=r?.blocks?s6(r.blocks,{orderedByPriority:!0})[0]:void 0,o=nJ({asset:s});d.useEffect(()=>{n.current||!s||!(e.get("canvas")==="true")||(n.current=!0,o())},[e,s,o])};function KPe(){const e=gv(),t=Kf(),{results:n}=an(),r=d.useRef(!1),s=d.useMemo(()=>n.some(o=>o.display_model===ie.STUDY),[n]);d.useEffect(()=>{const o=e(ie.STUDY);s&&o&&!r.current&&(r.current=!0,t(ie.STUDY,oe.STUDY))},[e,t,s])}const rJ=({trackEvent:e,entryUUID:t,frontendContextUUID:n,contextUUID:r})=>d.useCallback((s,o)=>{e(s,{entryUUID:t,frontendContextUUID:n,contextUUID:r,...o})},[t,n,r,e]),YPe=({webResults:e})=>Xi(t=>({isShowing:!1,webResults:e,actions:{hide:()=>t({isShowing:!1}),show:n=>t({...n,isShowing:!0})}})),{Context:QPe,useTrackedState:XPe}=d4("SourcesListContext"),sJ=d.memo(({children:e,webResults:t})=>{const[n]=T.useState(()=>YPe({webResults:t}));return d.useEffect(()=>{n.setState({webResults:t})},[t,n]),l.jsx(QPe.Provider,{value:n,children:e})});sJ.displayName="SourcesListProvider";const ZPe=XPe;class JPe extends Date{constructor(t){const n=t?new Date(t):new Date,r=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());super(r)}getTimezoneOffset(){return 0}}class Lv{static isRecentlyTrending(t,n=432e5){return t.meta_data?.client!=="trending"?!1:new Date().getTime()-new JPe(t.meta_data?.published_date).getTime()o.is_attachment);if(!n)return t;const s=new Set(n.map(o=>this.normalizeUrl(o.url)));return t.filter(o=>!s.has(this.normalizeUrl(o.url)))}}const eOe=({webResults:e,navigationResults:t=[],isStudyMode:n=!1,client:r="trending"})=>{if(!e)return{dedupedWebResults:[],hasSufficientTrendingRatio:!1,trendingResults:[],trendingResultsWithImages:[]};const s=Lv.dedupWebResults(e,t,n),o=s.filter(f=>f.meta_data?.client===r),i=s.slice(0,10).filter(f=>f.meta_data?.client===r),c=i.length>=2,u=i.filter(f=>f.meta_data?.images?.[0]);return{dedupedWebResults:s,hasSufficientTrendingRatio:c,trendingResults:o,trendingResultsWithImages:u}},oJ=T.memo(({urlData:e,handleClick:t,showBottomBorder:n=!0,...r})=>{const s=d.useMemo(()=>{const{url:h,snippet:g}=e;if("title"in e){const x=e;return{url:h,title:x.title,snippet:g,domain:x.domain||Ur(h)}}return{url:h,title:e.name,snippet:g,domain:Ur(h)}},[e]),{url:o,title:a,snippet:i,domain:c}=s,u=d.useMemo(()=>c.replace(/^www\./,"").split(".")[0],[c]),f=d.useMemo(()=>Kc(o),[o]),m=d.useMemo(()=>h=>()=>{},[]),p=t||m;return l.jsx("div",{className:z("p-md border-t-subtlest -mx-4 flex grow select-none flex-col border-t px-4 [&:only-child]:border-0",n&&"last:border-b-subtlest last:border-b"),children:l.jsxs(xt,{className:"gap-sm border-t-subtlest group flex cursor-pointer flex-col items-stretch",href:o,target:"_self",onClick:p(o,"primaryLink"),rel:"noopener",...r,children:[l.jsxs("div",{className:"flex h-7 items-center gap-2",children:[l.jsx(Lo,{size:28,domain:f,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex w-full min-w-0 flex-col",children:[l.jsx(V,{variant:"small",className:"line-clamp-1",children:u}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 truncate break-words",children:o})]})]}),l.jsxs("div",{children:[l.jsx(V,{className:"line-clamp-1",variant:"baseSemi",color:"super",children:a}),l.jsx(V,{variant:"small",color:"light",className:"line-clamp-2",children:i})]})]},o)})});oJ.displayName="MobileUrlCard";const hc={lastEntryUUID:null,loggedUrls:new Set,seenEntries:new Set};function tOe(e){if(e)return[{...e,url:e?.url,title:e?.name,snippet:e?.snippet,sitelinks:e?.sitelinks?.slice(),site_name:e?.meta_data?.domain_name||e?.meta_data?.citation_domain_name}]}const p6=T.memo(({navigationResult:e,trackEvent:t,queryString:n,entryUUID:r,frontendUUID:s,onClick:o,showSiteLinks:a=!1,showNewMobileCard:i=!1,renderPosition:c,clampSnippet:u=!1,showBottomBorder:f=!0,...m})=>{const{url:p,title:h,snippet:g,sitelinks:y,position:x,source:v,client_request_timestamp:b,unstable_server_request_timestamp:_,is_cached:w,is_comet_navigation:S,site_name:C,navigation_source:E}=e,{isMobileStyle:N}=Re(),k=d.useMemo(()=>Kc(p),[p]),I=d.useMemo(()=>p3(p),[p]);d.useEffect(()=>{if(!r||!p)return;const A=hc.seenEntries.has(r);hc.lastEntryUUID!==r&&(hc.lastEntryUUID=r,hc.loggedUrls.clear()),hc.loggedUrls.has(p)||(hc.loggedUrls.add(p),hc.seenEntries.add(r),t("navigational source viewed",{query:n,url:p,title:h,...a&&{subLinks:y},position:x,source:v,is_comet_navigation:S,frontendUUID:s,...typeof b=="number"&&!A&&{renderTimeMs:performance.now()-b},...typeof _=="number"&&!A&&{unstableRenderTimeMs:performance.now()-_},subLinks:y,isCached:w,navigation_source:E}))},[r,p,n]);const M=d.useCallback((A,D)=>P=>{t("click citation",{source:"navigationalCard",render_position:c,navigationalLinkType:D,citation_url:A,is_comet_navigation:S,frontendUUID:s}),o?.(P)},[S,t,o,s,c]);return N&&i?l.jsx(oJ,{urlData:e,handleClick:M,showBottomBorder:f,...m}):l.jsx("div",{className:"gap-sm flex select-none",children:l.jsx("div",{className:"grow",children:l.jsxs(K,{variant:"transparent",className:"flex grow flex-col rounded-lg",children:[l.jsx(xt,{className:"group flex cursor-pointer items-stretch",href:p,target:"_self",onClick:M(p,"primaryLink"),rel:"noopener",...m,children:l.jsxs(K,{className:"pr-md group",children:[l.jsxs("div",{className:"mb-xs gap-sm flex items-center",children:[l.jsx(Lo,{size:24,domain:k,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex flex-col",children:[C&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1 break-all leading-[0.875rem]",children:C}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 break-all leading-[0.875rem]",children:I})]})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"super",className:"decoration-1 underline-offset-1 group-hover:underline",children:h}),l.jsx(V,{variant:"small",color:"light",className:`mb-two line-clamp-${u?"1":"2"}`,children:g})]})]})},p),y&&y.length>0&&a&&l.jsx(V,{variant:"small",color:"light",className:"pt-two pb-sm",children:l.jsx(ya,{className:"flex-wrap",children:y.map(A=>l.jsx(Vn,{id:A.url,children:l.jsx(xt,{className:"group flex cursor-pointer items-stretch",href:A.url,onClick:M(A.url,"siteLink"),rel:"noopener",...m,children:l.jsx(V,{variant:"small",color:"super",className:"decoration-1 underline-offset-1 group-hover:underline",children:A.title})})},A.url))})})]})})})});p6.displayName="CitationNavigationalCard";const nOe=Se(async()=>{const{CitationListModal:e}=await Ee(()=>q(()=>Promise.resolve().then(()=>RN),void 0));return{default:e}}),rOe=({entry:e,webResults:t,showSourcesSidebar:n,allowedNavResultsCount:r,isFirstResult:s,enableMobileCalculations:o=!1,...a})=>{const{session:i}=je(),{trackEvent:c}=Ke(i),{trackEvent:u}=Rv(),{openModal:f}=Ho(),m=el(),p=ZPe(),{isMobileStyle:h}=Re(),g=d.useMemo(()=>"searchMode"in a&&a.searchMode===oe.SEARCH,[a]),y=d.useMemo(()=>t?.filter(R=>R.is_navigational)?.flatMap(R=>tOe(R)||[]),[t]),{data:x}=gt({queryKey:RH(e?.query_str??""),queryFn:()=>Promise.resolve({}),enabled:!1}),v=d.useMemo(()=>x?.navigation_results?.map(R=>({...R,is_cached:!0,navigation_source:Fd.SEARCH_V2_NAVIGATE}))??y?.map(R=>({...R,is_cached:!1,navigation_source:Fd.WEB_RESULTS})),[x,y]),b=d.useMemo(()=>v?.slice(0,r),[v,r]),_=b?.length&&s&&!g,w=d.useMemo(()=>Yt.isPerplexityMessage(e)?e?.display_model==="pplx_study":!1,[e]),S=d.useMemo(()=>eOe({webResults:t,navigationResults:b,isStudyMode:w}),[t,b,w]),{dedupedWebResults:C,hasSufficientTrendingRatio:E,trendingResults:N,trendingResultsWithImages:k}=S,I=d.useMemo(()=>!o||!h?[]:k,[o,h,k]),M=d.useMemo(()=>o?h&&E&&k.length>=2:!1,[o,h,E,k.length]),A=d.useMemo(()=>Yt.isPerplexityMessage(e)?e?.blocks?.some(R=>R.intended_usage==="answer_media_items"):!1,[e]),D=d.useMemo(()=>!_&&!A&&E,[_,A,E]),P=d.useCallback(()=>{if(e?.backend_uuid){const R=n?"sidebar":"modal";u("click view sources button",{entryUUID:e.backend_uuid,type:p.isShowing?void 0:R})}n?p.actions.show({webResults:t}):f(nOe,{legacyIdentifier:"citationListModal",webResults:t,entry:e})},[e?.backend_uuid,f,m,n,p.isShowing,p.actions.hide,u,t?.length]),F=rJ({trackEvent:c,entryUUID:e?.backend_uuid,frontendContextUUID:e?.uuid,contextUUID:e?.context_uuid});return d.useMemo(()=>({isNavigationalLayout:_,navigationResults:b,trackCitationClickEvent:F,handleViewAllClick:P,dedupedWebResults:C,isTrendingLayout:D,trendingResults:N,trendingResultsWithImages:I,showTrendingInMobile:M}),[C,P,_,D,b,M,F,N,I])},aJ=({target:e,entryUUID:t,frontendContextUUID:n,targetVisibilityPortionThreshold:r=.5,hasLLMToken:s})=>{const o=d.useRef(null),a=d.useRef(null),i=d.useRef(!1),{session:c}=je(),{trackEvent:u}=Ke(c),{result:f}=Ot(),m=d.useRef(f);d.useEffect(()=>{m.current=f},[f]);const p=d.useCallback(()=>{if(o.current){const g=Math.round(performance.now()-o.current);u("thread entry exited",{entryUUID:t,frontendContextUUID:n,timeOnEntryMs:g}),o.current=null}if(a.current){const g=m.current;g&&sn(g.display_model)==oe.STUDIO&&Yt.isStatusPending(g)&&u("answer processing exited",{entryUUID:t,frontendContextUUID:n,timeOnEntryMs:Math.round(performance.now()-a.current)}),a.current=null}},[u,t,n]),h=d.useCallback(()=>{s&&(o.current=performance.now()),a.current||(a.current=performance.now())},[s]);return d.useEffect(()=>{const g=new IntersectionObserver(x=>{x.forEach(v=>{i.current=v.isIntersecting,v.isIntersecting&&document.visibilityState==="visible"?h():p()})},{threshold:r}),y=e.current;return y&&g.observe(y),()=>{y&&g.unobserve(y),p()}},[e,r,h,p]),d.useEffect(()=>{const g=()=>{document.visibilityState==="hidden"?p():document.visibilityState==="visible"&&i.current&&h()};return document.addEventListener("visibilitychange",g),()=>{document.removeEventListener("visibilitychange",g)}},[h,p]),d.useEffect(()=>{const g=()=>{i.current&&o.current&&p()};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[p]),null},sOe=(e,t)=>{const{value:n,loading:r}=qt({flag:"show-site-link-snippets",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},iJ=T.memo(({navigationResult:e,trackEvent:t})=>{const{url:n,title:r,snippet:s,domain:o,sitelinks:a=[],site_name:i}=e,c=d.useMemo(()=>(o||Ur(n)).replace(/\.[^.]*$/,""),[o,n]),u=d.useMemo(()=>Kc(n),[n]),f=d.useCallback(m=>{t("click citation",{type:"primaryLink",...e})},[t,e]);return l.jsxs(K,{className:"p-md border-subtler mb-md rounded-xl border",variant:"subtler",children:[l.jsxs(xt,{className:"gap-sm border-t-subtlest group flex cursor-pointer flex-col items-stretch",href:n,target:"_self",onClick:f,rel:"noopener",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Lo,{size:24,domain:u,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex w-full min-w-0 flex-col leading-[0.875rem]",children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-1 break-words",children:i??c}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 truncate break-words leading-[0.875rem]",children:n})]})]}),l.jsx(V,{className:"pt-xs line-clamp-2 break-words",color:"super",variant:"baseSemi",children:r})]}),l.jsx("div",{children:l.jsx(V,{variant:"small",color:"light",className:"line-clamp-2 break-words",children:s})})]},n),l.jsx("div",{className:"mt-sm",children:a.map(m=>l.jsx("div",{className:"border-subtler px-two py-md flex items-center border-t last:pb-0",children:l.jsxs(xt,{href:m.url,className:"flex w-full items-center justify-between",children:[l.jsx(V,{variant:"small",className:"line-clamp-2 leading-none",children:m.title}),l.jsx(V,{variant:"small",color:"light",children:l.jsx(ge,{icon:B("chevron-right")})})]})},m.url))})]})});iJ.displayName="MobilePrimaryNavResultCard";const lJ=T.memo(({navigationResult:e,trackEvent:t,queryString:n,entryUUID:r,frontendUUID:s})=>{const{isMobileStyle:o}=Re();return o?l.jsx(iJ,{navigationResult:e,trackEvent:t,entryUUID:r,frontendUUID:s}):l.jsx(uJ,{navigationResult:e,trackEvent:t,entryUUID:r,frontendUUID:s,queryString:n})}),cJ=T.memo(({sitelink:e,showSnippet:t,onSiteLinkClick:n})=>{const r=d.useCallback(()=>{n(e.url)},[n,e.url]);return l.jsxs(xt,{href:e.url,target:"_self",className:"flex h-full flex-col justify-start",onClick:r,children:[l.jsx(V,{variant:"smallBold",className:z("break-words hover:underline",t?"line-clamp-2":"line-clamp-1"),color:"super",children:e.title}),t&&l.jsx(V,{variant:"small",className:"line-clamp-1 break-words",color:"light",children:e?.snippet??""})]})});cJ.displayName="SitelinkItem";const uJ=T.memo(({navigationResult:e,trackEvent:t,entryUUID:n,frontendUUID:r,queryString:s})=>{const{sitelinks:o=Ie}=e,{variation:a}=sOe(!1),i=d.useMemo(()=>{if(a)return o;const u=o.length&-2;return o.slice(0,u)},[o,a]),c=d.useCallback(u=>{t("click citation",{source:"navigationalCard",navigationalLinkType:"subLink",citation_url:u,is_comet_navigation:e.is_comet_navigation??!1,frontendUUID:r})},[t,e.is_comet_navigation,r]);return l.jsxs("div",{children:[l.jsx(p6,{navigationResult:e,trackEvent:t,queryString:s,entryUUID:n,frontendUUID:r}),i.length>0&&l.jsx("div",{className:z("gap-x-lg border-subtler pl-md my-sm grid items-stretch gap-y-1 border-l",a?"grid-cols-2":"grid-cols-[0.5fr_1fr]"),children:i.map(u=>l.jsx(cJ,{sitelink:u,showSnippet:a,onSiteLinkClick:c},u.url))})]})});uJ.displayName="DesktopPrimaryNavResultCard";lJ.displayName="PrimaryNavResultCard";const oOe=(e,t,n)=>{const r=e?.sitelinks??Ie;return t===0&&r.length>0},dJ=d.memo(({navResult:e,index:t,isPrimaryCardEnabled:n,trackCitationClickEvent:r,queryStr:s,entryUUID:o,frontendUUID:a,showSiteLinks:i,renderPosition:c,clampSnippet:u,showBottomBorder:f=!0})=>{const{isMobileStyle:m}=Re();return n&&oOe(e,t)?l.jsx(lJ,{navigationResult:e,trackEvent:r,queryString:s,entryUUID:o,frontendUUID:a}):l.jsx(p6,{navigationResult:e,trackEvent:r,queryString:s,entryUUID:o,frontendUUID:a,showSiteLinks:i,showNewMobileCard:m,renderPosition:c,clampSnippet:u,showBottomBorder:f})});dJ.displayName="RedesignedNavResultListItem";const aOe=(e,t)=>{const{value:n,loading:r}=qt({flag:"web-site-links-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},iOe=Se(async()=>{const{CitationListModal:e}=await Ee(()=>q(()=>Promise.resolve().then(()=>RN),void 0));return{default:e}}),vl=2,lOe=(e,t,n)=>{if(!e||n||t?.use_default_threshold)return vl;const r=t?.threshold,s=t?.number;if(!r||!s)return vl;const o=e.mhe_predictions_full?.comet_nav_widget?.probability;return o&&o>=r?s:vl},fJ=d.memo(({navResults:e,queryStr:t,querySource:n,backendUUID:r,frontendUUID:s,trackCitationClickEvent:o,onMount:a,shouldRenderPrimaryCard:i=!0,renderPosition:c})=>{const{isMobileStyle:u}=Re(),f=u?i:!1;d.useEffect(()=>{a?.()},[a]);const m=d.useCallback((p,h)=>{o(p,h);const g=n==="default_search",y=h.is_comet_navigation;!(p==="click citation")||!g||!y||Ll("web.frontend.omnisearch_nav_results_clicked")},[o,n]);return l.jsx(mJ,{navResults:e,queryStr:t,backendUUID:r,frontendUUID:s,trackCitationClickEvent:m,isPrimaryCardEnabled:f,renderPosition:c})});fJ.displayName="NavigationResultList";const cOe=7,mJ=d.memo(({navResults:e,queryStr:t,backendUUID:n,frontendUUID:r,trackCitationClickEvent:s,isPrimaryCardEnabled:o,renderPosition:a})=>{const{session:i}=je(),{trackEvent:c}=Ke(i),{webResults:u,isEntryInFlight:f}=Ot(),{isMobileStyle:m}=Re(),{variation:p}=aOe(!1),{openModal:h}=Ho(),{$t:g}=J(),[y,x]=d.useState("none"),v=d.useMemo(()=>Lv.dedupWebResults(u,e,!1),[u,e]),b=d.useMemo(()=>v.slice(0,cOe).map((M,A)=>({url:M.url,title:M.name,snippet:M.snippet||"",domain:M.url?new URL(M.url).hostname:void 0,position:e.length+A,source:"default_search",site_name:M.meta_data?.domain_name||M.meta_data?.citation_domain_name||Ur(M.url),is_comet_navigation:!1,navigation_source:Fd.WEB_RESULTS})),[v,e]),_=d.useMemo(()=>y==="none"?"collapsed":!f&&b.length>0?"expanded":"loading",[y,f,b.length]),w=d.useMemo(()=>_==="collapsed"?e:[...e,...b],[e,b,_]),S=w.length>e.length,C=d.useMemo(()=>{const M=e.length>=vl,A=b.length=vl},[f,S,b.length,v.length,e.length]),E=g(S?{defaultMessage:"See all links",id:"YDWVbhXaX3"}:{defaultMessage:"See more links",id:"A+4zhUZpLQ"}),N=d.useCallback(()=>{h(iOe,{legacyIdentifier:"citationListModal",webResults:u})},[h,u]),k=d.useCallback(()=>{if(S){c("clicked navigation results see all"),N();return}if(c("clicked navigation results see more"),f){x("clicked");return}if(b.length===0){N();return}x("clicked")},[S,c,N,f,b.length]),I=_==="loading"&&!S;return l.jsxs(K,{className:"relative flex flex-col",children:[l.jsx("div",{className:"flex flex-col sm:gap-4",children:w.map((M,A)=>{const P=A===w.length-1&&e.length>=vl&&C&&!S&&m;return l.jsx(dJ,{navResult:M,index:A,isPrimaryCardEnabled:o,trackCitationClickEvent:s,queryStr:t,entryUUID:n??"",frontendUUID:r??"",showSiteLinks:p,renderPosition:a,clampSnippet:P,showBottomBorder:!P},M.url)})}),C&&l.jsxs("div",{className:z("pointer-events-none relative",S?"mt-md":m?"mt-[-4.5rem] pt-[36px]":""),children:[!S&&m&&l.jsx("div",{className:"via-base/80 to-base pointer-events-none absolute inset-0 bg-gradient-to-b from-transparent"}),l.jsx("div",{className:"relative",children:m?l.jsx("div",{className:"bg-base pointer-events-auto w-full rounded-lg",children:l.jsx(Ct,{fullWidth:!0,onClick:k,disabled:I,"data-testid":"view-more-button",variant:"tonal",children:E})}):l.jsxs("div",{className:"bg-base mt-sm pointer-events-auto -ml-3 flex items-center",children:[l.jsx(Ct,{size:"small",onClick:k,trailingIcon:S?B("chevron-right"):void 0,disabled:I,"data-testid":"view-more-button",variant:"text",children:E}),l.jsx("div",{className:"bg-subtle h-px flex-1"})]})})]})]})});mJ.displayName="RedesignedNavigationResultList";const pJ=e=>{if(e){if(e.app)return e.app.final;if(e.xlsx_file)return e.xlsx_file.final;if(e.doc_file)return e.doc_file.final}},hJ=e=>e.xlsxAsset?.name||e.pdfAsset?.name||e.docxAsset?.name||e.docFileAsset?.name||e.codeFileAsset?.name||e.app?.name||null,nI=(e,t)=>{const n=EW(t),r=hJ(e);return k3(r&&n?`${r}.${n}`:t)},gJ=e=>d.useMemo(()=>{if(!e)return{app:null,pdfAsset:null,docxAsset:null,docFileAsset:null,codeFileAsset:null,chartAsset:null,xlsxAsset:null,quizAsset:null,pdfFileData:null,assetType:null,assetUuid:null};const t=e.pdf_file||null,n=t?{url:t.url,name:t.name||"Document"}:null;let r=e.app;return r&&(r={...r,transforms:r.transforms||[]}),{app:r||null,pdfAsset:t,docxAsset:e.docx_file||null,docFileAsset:e.doc_file||null,codeFileAsset:e.code_file||null,chartAsset:e.chart||null,xlsxAsset:e.xlsx_file||null,quizAsset:e.quiz||null,pdfFileData:n,assetType:e.asset_type,assetUuid:e.uuid}},[e]);function hw(e,t){let n=e;for(const r of t)n=n.replaceAll(r.old_str,r.new_str);return n}function yJ(e){return!!((e?.asset_type===at.APP||e?.asset_type===at.SLIDES)&&e?.app?.transforms&&e.app.transforms.length>0||e?.asset_type===at.XLSX_FILE&&e?.xlsx_file?.transforms&&e.xlsx_file.transforms.length>0||e?.asset_type===at.DOC_FILE&&e?.doc_file?.transforms&&e.doc_file.transforms.length>0)}function Tg(e){return!e?.version_info?.parent_artifact_id||!yJ(e)?!1:pJ(e)===!1}function uOe(e,t){if(e?.version_info?.artifact_id)return t.find(n=>n.version_info?.parent_artifact_id===e.version_info?.artifact_id&&Tg(n))}function dOe(e,t){const n=d.useMemo(()=>uOe(e,t),[e,t]);return d.useMemo(()=>{let r=!1;e?.app?r=!e.app.final:e?.xlsx_file?r=!e.xlsx_file.final:e?.doc_file&&(r=!e.doc_file.final);const s={streamingChild:void 0,hasStreamingChild:!1,transformedContent:"",transforms:[],isStreaming:r,hasTransforms:!1};if(n?.app?.transforms&&e?.app?.source_content){const o=hw(e.app.source_content,n.app.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.app.transforms,isStreaming:!n.app.final,hasTransforms:!0}}if(n?.xlsx_file?.transforms&&e?.xlsx_file?.source_content){const o=hw(e.xlsx_file.source_content,n.xlsx_file.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.xlsx_file.transforms,isStreaming:!n.xlsx_file.final,hasTransforms:!0}}if(n?.doc_file?.transforms&&e?.doc_file?.source_content){const o=hw(e.doc_file.source_content,n.doc_file.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.doc_file.transforms,isStreaming:!n.doc_file.final,hasTransforms:!0}}return s},[n,e])}function xJ(e,t){if(!Tg(e))return;const n=e?.version_info?.parent_artifact_id;return t.find(r=>r.version_info?.artifact_id===n)}const vJ=(e,t)=>!e.assetType||!t?null:`/apps/${t}`,fOe=(e,t)=>vJ(e,t)!==null,bJ=e=>e.app!==null,_J=e=>e.docxAsset===null&&e.pdfFileData!==null,wJ=e=>e.docxAsset!==null,CJ=e=>e.docFileAsset!==null,SJ=e=>e.xlsxAsset!==null,EJ=e=>e.codeFileAsset!==null,kJ=e=>e.chartAsset!==null;function Ag(e){return t=>t?e(t):!1}const MJ=Ag(e=>e.asset_type===at.GENERATED_IMAGE&&e.generated_image!==null),TJ=Ag(e=>e.asset_type===at.GENERATED_VIDEO&&e.generated_video!==null),AJ=Ag(e=>e.asset_type===at.CODE_ASSET&&e.code!==null),NJ=Ag(e=>e.asset_type===at.QUIZ&&e.quiz!==null),RJ=Ag(e=>e.asset_type===at.FLASHCARDS&&e.flashcards!==null);async function mOe(e,t="slides.pptx"){try{const{convertHtmlToPptx:n}=await q(async()=>{const{convertHtmlToPptx:r}=await import("./SlideConverter-o123-qAo.js");return{convertHtmlToPptx:r}},__vite__mapDeps([154,1,3,4,8,9,6,7,10,11,12]));await n(e,t)}catch(n){throw Z.error("Failed to export slides to PPTX",{error:n}),new Error("Failed to export slides to PowerPoint format")}}const DJ=.75,pOe=96,jJ=1920,IJ=1080,vn=e=>e/pOe,Rl=e=>parseFloat(e)*DJ,Fs=e=>{if(!e||e==="transparent"||e==="rgba(0, 0, 0, 0)")return"FFFFFF";const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!t){const n=e.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/);if(n&&n[1]){const r=n[1];return r.length===3?r.split("").map(s=>s+s).join("").toUpperCase():r.toUpperCase()}return"000000"}return t.slice(1,4).map(n=>parseInt(n).toString(16).padStart(2,"0")).join("").toUpperCase()},PJ=e=>{if(!e)return null;const t=e.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);if(!t||!t[4])return null;const n=parseFloat(t[4]);return Math.round((1-n)*100)},hOe=.85;function Hbt(){return new Map}function gOe(e){return/(repeating-)?(linear|radial|conic)-gradient\(/.test(e)}function yOe(e){const t=e.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/);if(t)return t[0];const n=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return n?`rgb(${n[1]}, ${n[2]}, ${n[3]})`:null}function xOe(e,t,n,r){const s=t.match(/linear-gradient\(([^,]+),/);let o=180;if(s?.[1]){const m=s[1].trim();m.includes("deg")?o=parseFloat(m):m==="to top"?o=0:m==="to right"?o=90:m==="to bottom"?o=180:m==="to left"?o=270:m==="to top right"?o=45:m==="to bottom right"?o=135:m==="to bottom left"?o=225:m==="to top left"&&(o=315)}const a=(o-90)*Math.PI/180,i=n/2-Math.cos(a)*n/2,c=r/2-Math.sin(a)*r/2,u=n/2+Math.cos(a)*n/2,f=r/2+Math.sin(a)*r/2;return e.createLinearGradient(i,c,u,f)}function vOe(e,t,n){return e.createRadialGradient(t/2,n/2,0,t/2,n/2,Math.max(t,n)/2)}function bOe(e,t,n,r){const s=t.match(/conic-gradient\(from\s+([\d.]+)deg/),i=((s?.[1]?parseFloat(s[1]):0)-90)*Math.PI/180;return e.createConicGradient(i,n/2,r/2)}function _Oe(e,t=jJ,n=IJ,r){const s=`${e}:${t}x${n}`;if(r){const o=r.get(s);if(o)return o}try{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d");if(!a||e.includes("repeating-"))return null;const i=e.includes("linear-gradient"),c=e.includes("radial-gradient"),u=e.includes("conic-gradient");if(!i&&!c&&!u)return null;let f;i?f=xOe(a,e,t,n):c?f=vOe(a,t,n):f=bOe(a,e,t,n);const m=/(rgba?\([^)]+\)|#[0-9A-Fa-f]{3,6})\s+([\d.]+)(deg|%)/g,p=Array.from(e.matchAll(m));if(p.length===0)return null;p.forEach(g=>{const y=g[1],x=g[2],v=g[3];if(!y||!x||!v)return;let b;v==="%"?b=parseFloat(x)/100:b=parseFloat(x)/360,f.addColorStop(Math.max(0,Math.min(1,b)),y)}),a.fillStyle=f,a.fillRect(0,0,t,n);const h=o.toDataURL("image/jpeg",hOe);return r&&r.set(s,h),h}catch{return null}}const wOe=(e,t,n)=>{const r=(e.ownerDocument.defaultView||window).getComputedStyle(e),s=r.backgroundImage;let o=r.backgroundColor;if((o==="rgba(0, 0, 0, 0)"||o==="transparent")&&e.className.includes("bg-")){const a=e.className.match(/bg-(\w+)/);if(a){const i=a[0],c=t.querySelectorAll("style");let u="";c.forEach(f=>{const m=f.textContent||"",p=Array.from(m.matchAll(/--color-(\w+):\s*([^;]+);/g)),h={};for(const x of p)h[`--color-${x[1]}`]=x[2]?.trim()||"";const g=new RegExp(`\\.${i}\\s*{[^}]*background-color:\\s*([^;]+);`,"s"),y=m.match(g);if(y){let x=y[1]?.trim()||"";if(x.startsWith("var(")){const v=x.match(/var\((--[^)]+)\)/)?.[1];v&&h[v]&&(x=h[v])}if(x.startsWith("#")){let v=x.substring(1);v.length===3&&(v=v.split("").map(S=>S+S).join(""));const b=parseInt(v.substring(0,2),16),_=parseInt(v.substring(2,4),16),w=parseInt(v.substring(4,6),16);u=`rgb(${b}, ${_}, ${w})`}else u=x}}),u&&(o=u)}}if(s&&s!=="none")if(gOe(s)){const a=e.getBoundingClientRect(),i=Math.round(a.width)||jJ,c=Math.round(a.height)||IJ,u=_Oe(s,i,c,n);if(u)return{gradient:u};{const f=yOe(s);f&&(o=f)}}else{const a=s.match(/url\(["']?([^"')]+)["']?\)/);if(a&&a[1])return{path:a[1]}}return{color:Fs(o)}},Dl=e=>(e.ownerDocument.defaultView||window).getComputedStyle(e),COe=e=>((e||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),SOe=e=>e==="bold"||parseInt(e||"400")>=600,EOe=e=>e==="italic",bE=e=>{const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return!t||!t[1]||!t[2]||!t[3]?null:{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3]),a:t[4]?parseFloat(t[4]):1}},kOe=(e,t)=>{const n=bE(e),r=bE(t);if(!n||!r)return null;const s=Math.round(n.r*n.a+r.r*(1-n.a)),o=Math.round(n.g*n.a+r.g*(1-n.a)),a=Math.round(n.b*n.a+r.b*(1-n.a));return Fs(`rgb(${s}, ${o}, ${a})`)},_E=e=>!!e&&e!=="rgba(0, 0, 0, 0)"&&e!=="transparent",MOe=(e,t)=>{for(const n of e){const r=n.backgroundColor;if(_E(r)){const s=bE(r);return s&&s.a<1?kOe(r,t)??void 0:Fs(r)}}},TOe=e=>{if(e.borderBottomWidth&&parseFloat(e.borderBottomWidth)>0){const t={type:"none"},n={pt:parseFloat(e.borderBottomWidth),color:Fs(e.borderBottomColor)};return[t,t,n,t]}},AOe=e=>{if(!e||e==="none"||e.match(/inset/))return null;const n=e.match(/rgba?\([^)]+\)/),r=e.match(/([-\d.]+)(px|pt)/g);if(!r||r.length<2)return null;const s=parseFloat(r[0]),o=parseFloat(r[1]||"0"),a=r.length>2?parseFloat(r[2]||"0"):0;let i=0;(s!==0||o!==0)&&(i=Math.atan2(o,s)*(180/Math.PI),i<0&&(i+=360));const c=Math.sqrt(s*s+o*o)*DJ;let u=.5;if(n){const f=n[0].match(/[\d.]+\)$/);f&&(u=parseFloat(f[0].replace(")","")))}return{type:"outer",angle:Math.round(i),blur:a*.75,color:n?Fs(n[0]):"000000",offset:c,opacity:u}},wE=(e,t={})=>{const n=[];let r=!1;e.childNodes.forEach(o=>{const a=o.nodeType===Node.TEXT_NODE||o.tagName==="BR";if(a){const i=o.tagName==="BR"?` -`:(o.nodeValue||o.textContent||"").replace(/\s+/g," "),c=n[n.length-1];r&&c&&c.text?c.text+=i:n.push({text:i,options:{...t}})}else if(o.nodeType===Node.ELEMENT_NODE&&o.textContent?.trim()){const i=o,c={...t},u=(i.ownerDocument.defaultView||window).getComputedStyle(i);if(["SPAN","B","STRONG","I","EM","U"].includes(i.tagName)){if((u.fontWeight==="bold"||parseInt(u.fontWeight)>=600)&&(c.bold=!0),u.fontStyle==="italic"&&(c.italic=!0),u?.textDecoration?.includes("underline")&&(c.underline={style:"sng"}),u.color&&u.color!=="rgb(0, 0, 0)"){c.color=Fs(u.color);const m=PJ(u.color);m!==null&&(c.transparency=m)}u?.fontSize&&(c.fontSize=Rl(u.fontSize)),wE(i,c).forEach(m=>n.push(m))}}r=a});const s=n?.[0];if(s&&s.text){s.text=s.text.replace(/^\s+/,"");const o=n?.[n.length-1];o&&o.text&&(o.text=o.text.replace(/\s+$/,""))}return n.filter(o=>o.text&&o.text.length>0)},NOe=e=>{if(e.display==="flex"){const t=e.alignItems;if(t==="center")return"middle";if(t==="flex-end")return"bottom"}else{const t=e.verticalAlign;if(t==="middle")return"middle";if(t==="bottom")return"bottom"}return"top"},ROe=e=>{const t=e.textAlign,n=e.direction;return t==="left"||t==="right"||t==="center"||t==="justify"?t:t==="start"?n==="rtl"?"right":"left":t==="end"?n==="rtl"?"left":"right":"center"},DOe=e=>{const t=e.whiteSpace;return!(t==="nowrap"||t==="pre")},jOe=e=>{const t=e.overflow,n=e.textOverflow;return t==="hidden"&&n==="ellipsis"?"none":"shrink"},IOe=e=>{const t=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,r=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0,o=Math.max(t,n,r,s);return Rl(o.toString())},POe=e=>({fontSize:Rl(e.fontSize),fontFace:((e.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(e.color),bold:e?.fontWeight==="bold"||parseInt(e?.fontWeight||"400")>=600,italic:e?.fontStyle==="italic",align:ROe(e),valign:NOe(e),wrap:DOe(e),margin:IOe(e),fit:jOe(e)}),OOe=e=>{const t=[];return e.querySelectorAll(".placeholder").forEach(n=>{const r=n.getBoundingClientRect(),s=e.getBoundingClientRect();t.push({id:n.id||`placeholder-${t.length}`,x:vn(r.left-s.left),y:vn(r.top-s.top),w:vn(r.width),h:vn(r.height)})}),t},LOe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("IMG").forEach(s=>{if(t.has(s))return;const o=s,a=s.getBoundingClientRect();a.width>0&&a.height>0&&(n.push({type:"image",src:o.src,position:{x:vn(a.left-r.left),y:vn(a.top-r.top),w:vn(a.width),h:vn(a.height)}}),t.add(s))}),n},FOe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("DIV, SPAN").forEach(s=>{if(t.has(s))return;const o=(s.ownerDocument.defaultView||window).getComputedStyle(s),a=o.backgroundColor&&o.backgroundColor!=="rgba(0, 0, 0, 0)",i=parseFloat(o.borderWidth)>0;if(a||i){const c=s.getBoundingClientRect();if(c.width>0&&c.height>0){const u=o.boxShadow?AOe(o.boxShadow):null,f=parseFloat(o.borderRadius)||0;let m="",p=!1,h;Array.from(s.children).length>0||(m=s.textContent?.trim()||"",p=m.length>0,p&&(h=POe(o))),n.push({type:"shape",text:m,position:{x:vn(c.left-r.left),y:vn(c.top-r.top),w:vn(c.width),h:vn(c.height)},style:h,shape:{fill:a?Fs(o.backgroundColor):null,transparency:a&&o.backgroundColor?PJ(o.backgroundColor):null,line:i?{color:Fs(o.borderColor),width:Rl(o.borderWidth)}:null,rectRadius:f>0?f/10:0,shadow:u}}),p&&t.add(s)}}}),n},BOe=e=>{if(!e.textContent?.trim())return!1;const n=e.parentElement;return!(n&&["P","H1","H2","H3","H4","H5","H6","LI","SPAN"].includes(n.tagName))},UOe=e=>{if(!e.textContent?.trim())return!1;let n=!1;if(e.childNodes.forEach(o=>{o.nodeType===Node.TEXT_NODE&&o.textContent?.trim()&&(n=!0)}),!n)return!1;const r=e.parentElement;return!(r&&["P","H1","H2","H3","H4","H5","H6","LI","SPAN"].includes(r.tagName)||e.querySelectorAll("P, H1, H2, H3, H4, H5, H6, UL, OL, DIV, SPAN").length>0)},VOe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("P, H1, H2, H3, H4, H5, H6, UL, OL, SPAN, DIV").forEach(s=>{if(t.has(s)||s.tagName==="SPAN"&&!BOe(s)||s.tagName==="DIV"&&!UOe(s))return;const o=(s.ownerDocument.defaultView||window).getComputedStyle(s),a=s.getBoundingClientRect();if(a.width>0&&a.height>0){const i=Rl(o.fontSize),c=parseFloat(o.lineHeight)||i*1.2;if(s.tagName==="UL"||s.tagName==="OL"){const u=Array.from(s.querySelectorAll("li")),f=[];u.forEach((m,p)=>{const h=p===u.length-1,g=wE(m);if(g.length>0){const y=g[0];if(!y)return;if(y.text&&(y.text=y.text.replace(/^[•\-*▪▸]\s*/,"")),y.options||(y.options={}),y.options.bullet=!0,!h){const x=g[g.length-1];if(!x)return;x.options||(x.options={}),x.options.breakLine=!0}f.push(...g)}t.add(m)}),f.length>0&&(n.push({type:"list",items:f,position:{x:vn(a.left-r.left),y:vn(a.top-r.top),w:vn(a.width),h:vn(a.height)},style:{fontSize:i,fontFace:((o.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(o.color),align:o.textAlign,lineSpacing:Rl(c.toString()),margin:0}}),t.add(s))}else{const u=wE(s),f=u.length===1?u[0]?.text:u,m=a.height<=c*1.5;let p=vn(a.left-r.left),h=vn(a.width);if(m){const g=a.width*.02,y=o.textAlign;y==="center"?(p=vn(a.left-r.left-g/2),h=vn(a.width+g)):(y==="right"&&(p=vn(a.left-r.left-g)),h=vn(a.width+g))}n.push({type:s.tagName.toLowerCase(),text:f,position:{x:p,y:vn(a.top-r.top),w:h,h:vn(a.height)},style:{fontSize:i,fontFace:((o.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(o.color),bold:o?.fontWeight==="bold"||parseInt(o?.fontWeight||"400")>=600,italic:o?.fontStyle==="italic",underline:o?.textDecoration?.includes("underline")?{style:"sng"}:void 0,align:o.textAlign,lineSpacing:Rl(c.toString()),margin:0}}),t.add(s)}}}),n},HOe=e=>{const t=[];if(Array.from(e.children).length>0&&e.childNodes.forEach(r=>{if(r.nodeType===Node.TEXT_NODE){const s=r.textContent?.trim();if(s){const o=Dl(e);t.push({text:s,options:{color:Fs(o.color)}})}}else if(r.nodeType===Node.ELEMENT_NODE){const s=r,o=s.textContent?.trim();if(o){const a=Dl(s);t.push({text:o,options:{color:Fs(a.color)}})}}}),t.length===0){const r=e.textContent?.trim();if(r){const s=Dl(e);t.push({text:r,options:{color:Fs(s.color)}})}}return t},gw=(e,t,n)=>{const r=[];return e.forEach(s=>{const o=[],a=Dl(s);s.querySelectorAll("th, td").forEach(i=>{const c=i;o.push(zOe(c,a,t,n))}),o.length>0&&r.push(o)}),r},zOe=(e,t,n,r)=>{const s=Dl(e),a={text:HOe(e),options:{fontSize:Rl(s.fontSize),fontFace:COe(s.fontFamily),bold:SOe(s.fontWeight),italic:EOe(s.fontStyle),align:s.textAlign||"left",valign:"middle"}},i=MOe([s,t,n].filter(u=>u!==null),r);i&&a.options&&(a.options.fill={color:i});const c=TOe(s);return c&&a.options&&(a.options.border=c),a},WOe=(e,t)=>{const n=[],r=e.getBoundingClientRect(),s=Dl(e),o=_E(s.backgroundColor)?s.backgroundColor:"rgb(255, 255, 255)";return e.querySelectorAll("TABLE").forEach(a=>{if(t.has(a))return;const i=a,c=a.getBoundingClientRect();if(c.width>0&&c.height>0){const u=[],f=i.parentElement,m=f?Dl(f):null,p=m&&_E(m.backgroundColor)?m.backgroundColor:o,h=i.querySelectorAll("thead tr"),g=i.querySelector("thead"),y=g?Dl(g):null;u.push(...gw(h,y,p));const x=i.querySelectorAll("tbody tr");if(u.push(...gw(x,null,p)),u.length===0){const v=i.querySelectorAll(":scope > tr");u.push(...gw(v,null,p))}u.length>0&&(n.push({type:"table",rows:u,position:{x:vn(c.left-r.left),y:vn(c.top-r.top),w:vn(c.width),h:vn(c.height)}}),t.add(a),i.querySelectorAll("*").forEach(v=>t.add(v)))}}),n};function rI(e,t,n){const r=[],s=new Set,o=wOe(e,t,n),a=OOe(e);a.forEach(p=>{const h=e.querySelector(`#${p.id}`);h&&s.add(h)});const i=FOe(e,s),c=LOe(e,s),u=WOe(e,s),f=VOe(e,s),m=[...i,...c,...u,...f];return{background:o,elements:m,placeholders:a,errors:r}}const OJ=` -/* ========== CSS Variables ========== */ -:root { - /* Typography */ - --font-family-display: Arial, sans-serif; - --font-weight-display: 600; - --font-family-content: Arial, sans-serif; - --font-weight-content: 400; - --font-size-content: 16px; - --line-height-content: 1.4; - - /* Colors - Surface */ - --color-surface: #ffffff; - --color-surface-foreground: #1d1d1d; - - /* Colors - Primary */ - --color-primary: #1791e8; - --color-primary-light: #3ba1ec; - --color-primary-dark: #1581d4; - --color-primary-foreground: #fafafa; - - /* Colors - Secondary */ - --color-secondary: #f5f5f5; - --color-secondary-foreground: #171717; - - /* Colors - Utility */ - --color-muted: #f5f5f5; - --color-muted-foreground: #737373; - --color-accent: #f5f5f5; - --color-accent-foreground: #171717; - --color-border: #c8c8c8; - - /* Spacing & Layout */ - --spacing: 0.25rem; - --gap: calc(var(--spacing) * 4); - --radius: 0.4rem; - --radius-pill: 999em; -} - -/* ========== Base Reset ========== */ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -/* ========== Slide Container ========== */ -section.slide { - width: 960px !important; - height: 540px !important; - overflow: hidden; - font-family: var(--font-family-content); - font-weight: var(--font-weight-content); - font-size: var(--font-size-content); - line-height: var(--line-height-content); - color: var(--color-surface-foreground); - background: var(--color-surface); - display: flex; - margin: 0; - padding: 0; - position: relative; -} - -/* Body for single slide mode */ -body { - width: 960px; - height: 540px; - overflow: hidden; - font-family: var(--font-family-content); - font-weight: var(--font-weight-content); - font-size: var(--font-size-content); - line-height: var(--line-height-content); - color: var(--color-surface-foreground); - background: var(--color-surface); - display: flex; - margin: 0; - padding: 0; -} - -/* ========== Typography ========== */ -h1, h2, h3, h4, h5, h6 { - font-family: var(--font-family-display); - font-weight: var(--font-weight-display); - line-height: 1.2; - margin: 0; -} - -h1 { font-size: 3rem; } -h2 { font-size: 2.25rem; } -h3 { font-size: 1.875rem; } -h4 { font-size: 1.5rem; } -h5 { font-size: 1.25rem; } -h6 { font-size: 1.125rem; } - -p { margin: 0; } - -ul, ol { - margin: 0; - padding-left: 1.5em; -} - -li { - margin: 0.25em 0; -} - -/* ========== Layout System ========== */ - -/* Container Classes */ -.row { - display: flex; - flex-direction: row; - align-items: center; - justify-content: stretch; -} - -.col { - display: flex; - flex-direction: column; - align-items: stretch; - justify-content: center; -} - -/* Flex Item Behavior */ -.fill-width { - flex: 1; - align-self: stretch; -} - -.fill-height { - flex: 1; - align-self: stretch; -} - -.row .fill-width { - flex: 1; -} - -.col .fill-height { - flex: 1; -} - -.items-fill-width > * { - flex: 1; - align-self: stretch; -} - -.items-fill-height > * { - flex: 1; - align-self: stretch; -} - -.fit { - flex: none; - align-self: auto; -} - -.fit-width { - flex: none; -} - -.fit-height { - flex: none; -} - -/* ========== Alignment ========== */ - -/* Container alignment */ -.center { - align-items: center; - justify-content: center; -} - -.start { - align-items: flex-start; - justify-content: flex-start; -} - -.end { - align-items: flex-end; - justify-content: flex-end; -} - -.stretch { - align-items: stretch; - justify-content: stretch; -} - -.between { - justify-content: space-between; -} - -.around { - justify-content: space-around; -} - -.evenly { - justify-content: space-evenly; -} - -/* Self alignment */ -.self-center { - align-self: center; -} - -.self-start { - align-self: flex-start; -} - -.self-end { - align-self: flex-end; -} - -.self-stretch { - align-self: stretch; -} - -/* ========== Spacing ========== */ - -/* Padding */ -.p-0 { padding: 0; } -.p-2 { padding: calc(var(--spacing) * 2); } -.p-4 { padding: calc(var(--spacing) * 4); } -.p-6 { padding: calc(var(--spacing) * 6); } -.p-8 { padding: calc(var(--spacing) * 8); } -.p-12 { padding: calc(var(--spacing) * 12); } -.p-16 { padding: calc(var(--spacing) * 16); } -.p-24 { padding: calc(var(--spacing) * 24); } -.p-32 { padding: calc(var(--spacing) * 32); } - -/* Gap */ -.gap-0 { gap: 0; } -.gap-xs { gap: calc(var(--spacing) * 2); } -.gap-sm { gap: calc(var(--spacing) * 4); } -.gap-md { gap: calc(var(--spacing) * 8); } -.gap-lg { gap: calc(var(--spacing) * 16); } -.gap-xl { gap: calc(var(--spacing) * 24); } -.gap-2xl { gap: calc(var(--spacing) * 32); } - -/* ========== Colors ========== */ - -/* Background colors */ -.bg-primary { - background-color: var(--color-primary); - color: var(--color-primary-foreground); -} - -.bg-secondary { - background-color: var(--color-secondary); - color: var(--color-secondary-foreground); -} - -.bg-muted { - background-color: var(--color-muted); - color: var(--color-muted-foreground); -} - -.bg-accent { - background-color: var(--color-accent); - color: var(--color-accent-foreground); -} - -/* Text colors */ -.text-primary { - color: var(--color-primary); -} - -.text-muted { - color: var(--color-muted-foreground); -} - -/* ========== Utilities ========== */ - -.rounded { - border-radius: var(--radius); -} - -.rounded-lg { - border-radius: calc(var(--radius) * 2); -} - -.rounded-full { - border-radius: var(--radius-pill); -} - -.shadow { - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); -} - -.shadow-lg { - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); -} - -.border { - border: 1px solid var(--color-border); -} - -/* Text alignment */ -.text-left { text-align: left; } -.text-center { text-align: center; } -.text-right { text-align: right; } -.text-justify { text-align: justify; } - -/* Font sizes */ -.text-xs { font-size: 0.75rem; } -.text-sm { font-size: 0.875rem; } -.text-base { font-size: 1rem; } -.text-lg { font-size: 1.125rem; } -.text-xl { font-size: 1.25rem; } -.text-2xl { font-size: 1.5rem; } -.text-3xl { font-size: 1.875rem; } -.text-4xl { font-size: 2.25rem; } -.text-5xl { font-size: 3rem; } - -/* Font weights */ -.font-normal { font-weight: 400; } -.font-medium { font-weight: 500; } -.font-semibold { font-weight: 600; } -.font-bold { font-weight: 700; } - -/* Display */ -.hidden { display: none; } -.block { display: block; } -.inline { display: inline; } -.inline-block { display: inline-block; } -.flex { display: flex; } -`;function sI(e,t,n){"gradient"in e.background?t.addImage({data:e.background.gradient,x:0,y:0,w:"100%",h:"100%"}):t.background=e.background;for(const r of e.elements)switch(r.type){case"table":{r.rows&&r.rows.length>0&&t.addTable(r.rows,{x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,autoPage:!1,border:{type:"none"}});break}case"image":{t.addImage({path:r.src,x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h});break}case"shape":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h};r.shape&&r.shape.rectRadius>0?(s.shape=n.ShapeType.roundRect,s.rectRadius=r.shape.rectRadius):s.shape=n.ShapeType.rect,r.shape?.fill&&(s.fill={color:r.shape.fill},r.shape.transparency!=null&&(s.fill.transparency=r.shape.transparency)),r.shape?.line&&(s.line=r.shape.line),r.shape?.shadow&&(s.shadow=r.shape.shadow),r.style&&(r.style.fontSize&&(s.fontSize=r.style.fontSize),r.style.fontFace&&(s.fontFace=r.style.fontFace),r.style.color&&(s.color=r.style.color),r.style.bold&&(s.bold=r.style.bold),r.style.italic&&(s.italic=r.style.italic),r.style.align&&(s.align=r.style.align),r.style.valign&&(s.valign=r.style.valign)),s.wrap=r.style?.wrap??!1,s.fit=r.style?.fit??"shrink",s.margin=r.style?.margin??0,t.addText(r.text||"",s);break}case"list":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,align:r.style?.align,valign:"top",lineSpacing:r.style?.lineSpacing,margin:r.style?.margin};t.addText(r.items??"",s);break}case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,bold:r.style?.bold,italic:r.style?.italic,underline:r.style?.underline,valign:"top",align:r.style?.align,lineSpacing:r.style?.lineSpacing,inset:0};t.addText(r.text??"",s);break}default:{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,bold:r.style?.bold,italic:r.style?.italic,underline:r.style?.underline,valign:"top",align:r.style?.align,lineSpacing:r.style?.lineSpacing,inset:0};t.addText(r.text??"",s)}}}const zbt="exported-slides.pptx",GOe=300,$Oe=100,qOe="section.slide";async function oI(e,t,n,r=!1){const s=t.querySelectorAll(qOe);if(s.length>0)for(let o=0;ou.type!=="image")});const c=e.addSlide();sI(i,c,e)}else{const o=n.createElement("section");o.className="slide",o.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(o);const a=n.createElement("style");a.textContent=OJ,t.insertBefore(a,t.firstChild),await new Promise(u=>setTimeout(u,$Oe));let i=rI(o,t);r&&(i={...i,elements:i.elements.filter(u=>u.type!=="image")});const c=e.addSlide();sI(i,c,e)}}async function KOe(e){const t=document.createElement("iframe");t.style.cssText=` - position: fixed !important; - left: -10000px !important; - top: -10000px !important; - width: 1920px !important; - height: 1080px !important; - border: none !important; - visibility: hidden !important; - pointer-events: none !important; - opacity: 0 !important; - display: block !important; - `,t.setAttribute("aria-hidden","true"),document.body.appendChild(t);try{const n=t.contentDocument||t.contentWindow?.document;if(!n)throw new Error("Failed to access iframe document");n.body||(n.write(""),n.close());const r=n.createElement("div");if(r.style.cssText=` - width: 1920px; - height: 1080px; - `,n.body.appendChild(r),r.innerHTML=e,!r.querySelector("style")){const o=n.createElement("style");o.textContent=OJ,r.insertBefore(o,r.firstChild)}await new Promise(o=>setTimeout(o,GOe));let s=new(await q(async()=>{const{default:o}=await import("./pptxgen.es-RTyDt0G5.js");return{default:o}},__vite__mapDeps([155,1]))).default;s.layout="LAYOUT_16x9",s.author="Perplexity",s.title="Converted Presentation",s.company="Perplexity AI";try{return await oI(s,r,n,!1),await s.write({outputType:"blob"})}catch{return s=new(await q(async()=>{const{default:i}=await import("./pptxgen.es-RTyDt0G5.js");return{default:i}},__vite__mapDeps([155,1]))).default,s.layout="LAYOUT_16x9",s.author="Perplexity",s.title="Converted Presentation",s.company="Perplexity AI",await oI(s,r,n,!0),await s.write({outputType:"blob"})}}finally{t.parentNode&&document.body.removeChild(t)}}function YOe(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(typeof r.result=="string"){const s=r.result.split(",")[1];s?t(s):n(new Error("Failed to extract base64 from data URL"))}else n(new Error("Failed to convert blob to base64"))},r.onerror=n,r.readAsDataURL(e)})}async function aI({htmlContent:e,filename:t,saveFile:n}){const r=await KOe(e);if(!r)throw new Error("Failed to generate PPTX file");const s=await YOe(r),o=t.endsWith(".pptx")?t:`${t}.pptx`;return{webViewLink:(await n({fileName:o,fileBytes:s,mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation",connectionType:"GOOGLE_DRIVE"})).web_view_link}}const QOe={xlsx:B("file-type-xls"),csv:B("file-type-csv"),pdf:B("file-type-pdf"),docx:B("file-type-doc"),pptx:B("file-type-ppt")},XOe={xlsx:"XLSX",csv:"CSV",pdf:"PDF",docx:"DOCX",pptx:"PPTX",md:"Markdown",png:"Image",jpg:"Image",jpeg:"Image"};function ZOe(e){return e?QOe[e.toLowerCase()]??B("download"):B("download")}function JOe(e,t){if(!t)return iI(e);const n=t.toLowerCase();return XOe[n]??iI(e)}function iI(e){return e==="SLIDES"||e==="APP"?"HTML":"File"}const eLe=({reason:e})=>{const{$t:t}=J(),{openToast:n}=pn(),r=d.useCallback(async s=>{try{const o=await Bz({name:s,reason:e,autoClose:!0});if(!o)return n({message:t({defaultMessage:"Unable to start authentication.",id:"7sb7u3pWWr"}),variant:"error",timeout:3}),!1;const a=600,i=700,c=window.screenX+(window.outerWidth-a)/2,u=window.screenY+(window.outerHeight-i)/2,f=window.open(o,"oauth-popup",`width=${a},height=${i},left=${c},top=${u},popup=yes,noopener=no`);return f?new Promise(m=>{const p=setInterval(()=>{f.closed&&(clearInterval(p),Z.info("OAuth popup closed",{connectorName:s,reason:e}),m(!0))},500);setTimeout(()=>{clearInterval(p),f.closed||(f.close(),Z.warn("OAuth popup timeout",{connectorName:s,reason:e}),m(!1))},300*1e3)}):(n({message:t({defaultMessage:"Please allow popups to connect your account.",id:"gMeARpuir7"}),variant:"error",timeout:3}),!1)}catch(o){return Z.error("Failed to start OAuth flow",{error:o,connectorName:s,reason:e}),n({message:t({defaultMessage:"Failed to connect account. Please try again.",id:"l9HkZMlKDR"}),variant:"error",timeout:3}),!1}},[e,t,n]);return d.useMemo(()=>({startOAuthFlow:r}),[r])},tLe=({reason:e})=>{const[t,n]=d.useState(!1),r=d.useCallback(async s=>{n(!0);try{const{data:o,error:a}=await de.POST("/rest/connectors/save-file",e,{body:{file_name:s.fileName,s3_url:s.s3Url,file_bytes:s.fileBytes,mime_type:s.mimeType,connection_type:s.connectionType,parent_remote_id:s.parentRemoteId},timeoutMs:Ze()});if(a){Z.error("Failed to save file to connector",{error:a,request:s,errorMessage:a instanceof Error?a.message:"Unknown error"});const i=a.detail;return{success:!1,errorCode:i?.error_code,errorMessage:i?.error_message||"Failed to save file"}}return o?{success:o.success,webViewLink:o.web_view_link??void 0,errorCode:o.error_code??void 0,errorMessage:o.error_message??void 0}:{success:!1,errorMessage:"No response from server"}}catch(o){return Z.error("Unexpected error saving file to connector",{err:o,request:s,errorMessage:o instanceof Error?o.message:"Unknown error"}),{success:!1,errorMessage:o instanceof Error?o.message:"Unknown error"}}finally{n(!1)}},[e]);return d.useMemo(()=>({saveFile:r,isLoading:t}),[r,t])};function nLe({asset:e,assetResult:t}){const n=gJ(e),r=[],{session:s}=je(),{trackEvent:o}=Ke(s),{$t:a}=J(),{openToast:i}=pn(),[c,u]=d.useState(!1),f=Vt(),{downloadS3Asset:m}=eJ({reason:"canvas-pdf-download"}),{saveFile:p}=tLe({reason:"canvas-export-to-drive"}),{startOAuthFlow:h}=eLe({reason:"canvas-export-to-drive"}),g=d.useCallback(async v=>{if(!c){u(!0);try{const b=nI(n,v.filename??"download");let _=await p({fileName:b,s3Url:v.url,connectionType:"GOOGLE_DRIVE"});if(_.errorCode==="MISSING_SCOPE"||_.errorCode==="ACCOUNT_NOT_CONNECTED"||_.errorCode==="AUTH_ERROR")if(await h("google_drive"))_=await p({fileName:b,s3Url:v.url,connectionType:"GOOGLE_DRIVE"});else return;if(_.success&&_.webViewLink)t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"File exported to Google Drive",id:"FDX8mJLmJm"}),variant:"success",timeout:3}),window.open(_.webViewLink,"_blank");else{let w=a({defaultMessage:"Failed to export file",id:"5/D0jskfku"});_.errorCode==="FILE_TOO_LARGE"?w=a({defaultMessage:"File exceeds 20MB limit for export",id:"UZ4y2AORv5"}):_.errorMessage&&(w=_.errorMessage),i({message:w,variant:"error",timeout:3}),Z.error("Failed to export file to Drive",{errorCode:_.errorCode,errorMessage:_.errorMessage,fileName:v.filename})}}catch(b){Z.error("Unexpected error during export",{error:b,info:v}),i({message:a({defaultMessage:"Failed to export file",id:"5/D0jskfku"}),variant:"error",timeout:3})}finally{u(!1)}}},[n,c,p,h,t,e,o,a,i]),y=d.useCallback(async(v,b)=>{if(!c){u(!0);try{const _=await aI({htmlContent:v,filename:b,saveFile:async w=>{const S=await p({...w});if(!S.success)throw new Error(`Export failed: ${S.errorCode??"unknown error"}${S.errorMessage?` - ${S.errorMessage}`:""}`);return{web_view_link:S.webViewLink??""}}});t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"Slides exported to Google Drive",id:"efsXWg4g3j"}),variant:"success",timeout:3}),window.open(_.webViewLink,"_blank")}catch(_){if(_ instanceof Error&&(_.message.includes("MISSING_SCOPE")||_.message.includes("ACCOUNT_NOT_CONNECTED")||_.message.includes("AUTH_ERROR")))if(await h("google_drive"))try{const S=await aI({htmlContent:v,filename:b,saveFile:async C=>{const E=await p({...C});if(!E.success)throw new Error(`Export failed: ${E.errorCode??"unknown error"}${E.errorMessage?` - ${E.errorMessage}`:""}`);return{web_view_link:E.webViewLink??""}}});t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"Slides exported to Google Drive",id:"efsXWg4g3j"}),variant:"success",timeout:3}),window.open(S.webViewLink,"_blank");return}catch(S){Z.error("Failed to export slides after OAuth",{error:S})}else return;i({message:_ instanceof Error&&_.message?_.message:a({defaultMessage:"Failed to export slides",id:"W62bIrXvad"}),variant:"error",timeout:3}),Z.error("Failed to export slides to Drive",{error:_})}finally{u(!1)}}},[c,p,h,t,e,o,a,i]);if(zPe(e)&&bJ(n)&&n.app.source_content){const v=hJ(n)||"slides",b=k3(`${v}.pptx`);r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Download as PPTX",id:"MbQGjmBtrT"}),icon:B("file-type-ppt"),category:"download",onClick:async()=>{t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"download"});try{await mOe(n.app.source_content,b)}catch{}}}),f&&r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Export PPTX to GDrive",id:"vxG0vz9KXW"}),icon:B("brand-google-drive"),category:"export",onClick:()=>{y(n.app.source_content,v)}})}return e?.download_info&&e.download_info.length>0&&e.download_info.forEach(v=>{if(!v.url||!Fx(v.url))return;const b=EW(v.filename),_=ZOe(b),w=JOe(e.asset_type,b),S=nI(n,v.filename??"download");r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Download as {fileType}",id:"PJh4v0uaV6"},{fileType:w}),icon:_,category:"download",onClick:()=>{t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"download"}),m({url:v.url,filename:S})}}),v.is_exportable&&f&&r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Export {fileType} to GDrive",id:"IHrc/RdUMs"},{fileType:w}),icon:B("brand-google-drive"),category:"export",onClick:()=>{g(v)}})}),r}function rLe(e,t,n){return e?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.app?.url??null,name:t.app?.name??null,isFinal:n.streamingChild?.app?.final??!1,isStreaming:n.isStreamingChildActive}:bJ(t)?{final:t.app.source_content??null,url:t.app.url??null,name:t.app.name??null,isFinal:t.app.final??!1,isStreaming:!t.app.final}:SJ(t)?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.xlsxAsset.url??null,name:t.xlsxAsset.name??null,isFinal:n.streamingChild?.xlsx_file?.final??!1,isStreaming:n.isStreamingChildActive}:{final:t.xlsxAsset.source_content??null,url:t.xlsxAsset.url??null,name:t.xlsxAsset.name??null,isFinal:t.xlsxAsset.final??!1,isStreaming:!t.xlsxAsset.final}:_J(t)?{final:t.pdfFileData?.url??null,url:t.pdfFileData?.url??null,name:t.pdfFileData?.name??null,isFinal:!0,isStreaming:!1}:wJ(t)?{final:t.docxAsset.url??null,url:t.docxAsset.url??null,name:t.docxAsset.name??null,isFinal:!0,isStreaming:!1}:CJ(t)?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.docFileAsset.url??null,name:t.docFileAsset.name??null,isFinal:n.streamingChild?.doc_file?.final??!1,isStreaming:n.isStreamingChildActive}:{final:t.docFileAsset.source_content??null,url:t.docFileAsset.url??null,name:t.docFileAsset.name??null,isFinal:t.docFileAsset.final??!1,isStreaming:!t.docFileAsset.final}:kJ(t)?{final:t.chartAsset.url??null,url:t.chartAsset.url??null,name:null,isFinal:!0,isStreaming:!1}:EJ(t)?{final:null,url:null,name:t.codeFileAsset.filename??null,isFinal:!0,isStreaming:!1}:AJ(e)?{final:e.code.script??null,url:null,name:null,isFinal:!0,isStreaming:!1}:MJ(e)?{final:e.generated_image.url??null,url:e.generated_image.url??null,name:null,isFinal:!0,isStreaming:!1}:TJ(e)?{final:e.generated_video.url??null,url:e.generated_video.url??null,name:null,isFinal:!0,isStreaming:!1}:NJ(e)?{final:null,url:null,name:e.quiz.title??null,isFinal:!0,isStreaming:!1}:RJ(e)?{final:null,url:null,name:e.flashcards.title??null,isFinal:!0,isStreaming:!1}:{final:null,url:null,name:null,isFinal:!0,isStreaming:!1}:{final:null,url:null,name:null,isFinal:!0,isStreaming:!1}}function sLe(e,t){if(e?.asset_type===at.APP||e?.asset_type===at.SLIDES){const n=e.app?.final===!0,r=!!e.app?.source_content,s=n,o=r,a=[];s&&a.push(gr.Preview),o&&a.push(gr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.app?.final?i=gr.Source:n||t.streamingChild?.app?.final?i=gr.Preview:!n&&r&&(i=gr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}if(e?.asset_type===at.XLSX_FILE){const n=e.xlsx_file?.final===!0,r=!!e.xlsx_file?.source_content,s=n,o=r,a=[];s&&a.push(gr.Preview),o&&a.push(gr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.xlsx_file?.final?i=gr.Source:n||t.streamingChild?.xlsx_file?.final?i=gr.Preview:!n&&r&&(i=gr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}if(e?.asset_type===at.DOC_FILE){const n=e.doc_file?.final===!0,r=!!e.doc_file?.source_content,s=n,o=r,a=[];s&&a.push(gr.Preview),o&&a.push(gr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.doc_file?.final?i=gr.Source:n||t.streamingChild?.doc_file?.final?i=gr.Preview:!n&&r&&(i=gr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}return{supportsPreviewTab:!1,supportsCodeTab:!1,availableTabs:[],defaultTab:null}}function oLe({asset:e,allAssets:t,assetResult:n,backendUuid:r}){const s=gJ(e),o=dOe(e,t),a=d.useMemo(()=>({hasTransforms:yJ(e),isStreamingUpdate:Tg(e),streamingChild:o.streamingChild,transformedContent:o.transformedContent,parentAsset:void 0,hasStreamingChild:o.hasStreamingChild,isStreamingChildActive:o.isStreaming}),[e,o]),i=d.useMemo(()=>rLe(e,s,a),[e,s,a]),c=d.useMemo(()=>sLe(e,a),[e,a]),u=nLe({asset:e,assetResult:n}),f=d.useMemo(()=>{const p=r??n?.backend_uuid,h=fOe(s,p),g=vJ(s,p);return{supportsFullScreen:h,fullScreenUrl:g,supportsDownload:u.length>0,downloadableItems:u,supportsVersioning:!!e?.version_info}},[s,r,n,u,e]),m=d.useMemo(()=>({app:e?.asset_type===at.APP,slides:e?.asset_type===at.SLIDES,pdf:_J(s),docx:wJ(s),docFile:CJ(s),xlsx:SJ(s),codeFile:EJ(s),chart:kJ(s),code:AJ(e),generatedImage:MJ(e),generatedVideo:TJ(e),quiz:NJ(e),flashcards:RJ(e)}),[e,s]);return{assetData:s,content:i,streaming:a,tabs:c,capabilities:f,is:m}}const LJ=()=>{const{results:e}=an(),t=d.useMemo(()=>!e||e.length===0?[]:e.map(s=>({result:s,assets:s6(s?.blocks??[],{orderedByPriority:!0})})),[e]),n=d.useMemo(()=>t.flatMap(({assets:s})=>s),[t]),r=n.length>0;return{resultAssets:t,allAssets:n,hasAssets:r}};function aLe(e,t){const{allAssets:n}=LJ(),r=d.useRef(null),s=d.useMemo(()=>Tg(e)&&xJ(e,n)||e,[e,n]),o=oLe({asset:s,allAssets:n});d.useEffect(()=>{if(o.tabs.availableTabs.length===0)return;const a=o.tabs.defaultTab;a&&r.current!==a&&(t({type:"setTab",tab:a}),r.current=a)},[o.tabs,t])}function iLe({asset:e,inFlight:t,contextUuid:n,backendUuid:r}){const{doCanvasAction:s}=Zf(),{session:o}=je(),{trackEvent:a}=Ke(o),{allAssets:i}=LJ(),c=d.useRef(!1),u=d.useRef(void 0),f=d.useRef(void 0),{title:m}=m6(e);d.useEffect(()=>{if(!e||!t)return;const p=e.uuid,h=pJ(e)===!0,y=!(f.current!==p)&&!u.current&&h;if(!c.current||y){let v=e;if(Tg(e)){const b=xJ(e,i);b&&(v=b)}s({type:"setAsset",assetUuid:v.uuid,title:m,backendUuid:r}),c.current||a("canvas opened",{source:"auto",contextUUID:n,entryUUID:r,contentType:e.asset_type,assetUUID:e.uuid}),c.current=!0,f.current=p}u.current=h},[e,s,t,a,n,r,m,i]),d.useEffect(()=>{t||(c.current=!1,f.current=void 0,u.current=void 0)},[t])}function lLe({data:e,inFlight:t}){const{openCanvas:n}=Zf();d.useEffect(()=>{t&&e.should_auto_open&&n()},[t,e.should_auto_open,n])}function cLe({data:e,inFlight:t}){const{doCanvasAction:n}=Zf(),r=d.useRef(void 0);d.useEffect(()=>{if(!t)return;const s={progress:e.progress,assetType:e.expected_asset_type};(r.current?.progress!==s.progress||r.current?.assetType!==s.assetType)&&(n({type:"setLoading",loading:e.progress===ta.IN_PROGRESS,assetType:e.expected_asset_type}),r.current=s)},[e.progress,e.expected_asset_type,n,t])}const uLe=({data:e})=>{const{inFlight:t,result:{blocks:n,context_uuid:r,backend_uuid:s}}=Ot(),o=Hje(n,e.asset?.uuid??""),{doCanvasAction:a}=Zf();return lLe({data:e,inFlight:t}),cLe({data:e,inFlight:t}),iLe({asset:o,inFlight:t,contextUuid:r,backendUuid:s}),aLe(o,a),null},dLe=()=>{const{blocksByIntendedUsage:{canvas_mode:e}}=Ot();return e?.canvas_block},FJ=()=>{const{session:e}=je(),{firstResult:t,inFlight:n}=an(),r=t?.author_username;return e?.user?.username===r||n};var yw,lI;function fLe(){if(lI)return yw;lI=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){if(o.constructor!==a.constructor)return!1;var i,c,u;if(Array.isArray(o)){if(i=o.length,i!=a.length)return!1;for(c=i;c--!==0;)if(!s(o[c],a[c]))return!1;return!0}var f;if(t&&o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;for(f=o.entries();!(c=f.next()).done;)if(!a.has(c.value[0]))return!1;for(f=o.entries();!(c=f.next()).done;)if(!s(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;for(f=o.entries();!(c=f.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if(i=o.length,i!=a.length)return!1;for(c=i;c--!==0;)if(o[c]!==a[c])return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf&&typeof o.valueOf=="function"&&typeof a.valueOf=="function")return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString&&typeof o.toString=="function"&&typeof a.toString=="function")return o.toString()===a.toString();if(u=Object.keys(o),i=u.length,i!==Object.keys(a).length)return!1;for(c=i;c--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[c]))return!1;if(e&&o instanceof Element)return!1;for(c=i;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&o.$$typeof)&&!s(o[u[c]],a[u[c]]))return!1;return!0}return o!==o&&a!==a}return yw=function(a,i){try{return s(a,i)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},yw}var mLe=fLe();const BJ=uo(mLe),Y0=(e,t)=>{if(typeof e=="object"&&e!==null&&t in e){const n=e[t];return typeof n=="string"?n:void 0}},pLe=(e,t)=>{if(e.step_type!=="MCP_TOOL_INPUT"||t.step_type!=="MCP_TOOL_OUTPUT")return!1;const n=Y0(e.content,"goal_id"),r=Y0(t.content,"goal_id");if(n&&r)return n===r;const s=Y0(e.content,"tool_name"),o=Y0(t.content,"tool_name");return!!(s&&o&&s===o)},hLe=e=>{if(!e?.length)return[];if(!e.some(s=>s.step_type==="MCP_TOOL_INPUT"||s.step_type==="MCP_TOOL_OUTPUT"))return e;let n=-1;return e.reduce((s,o,a)=>{if(a<=n||o.step_type==="MCP_TOOL_OUTPUT")return s;const i=e[a+1];return o.step_type==="MCP_TOOL_INPUT"&&i&&pLe(o,i)?(s.push({...o,mcp_tool_output_content:i.content}),n=a+1,s):(s.push({...o}),s)},[])},gLe=e=>{switch(e){case"Notion":return Ex;case"Linear":return kx;case"GitHub":return Tx;case"Asana":return Ax;case"Atlassian":return Nx;case"Slack":return Mx;case"Wiley":return Bd;case"CB Insights":return jM;case"PitchBook":return IM;case"Statista":return PM;default:return null}},UJ=d.createContext(null);function yLe(){const e=d.useContext(UJ);if(!e)throw new Error("useBannerContext must be used within a Banner component");return e}const xLe=UJ.Provider;function vLe({ref:e,variant:t,children:n,onClick:r,disabled:s=!1,...o}){const{size:a}=yLe(),i=_x(e),c=wa(o),f={ref:i,...c,size:a==="default"?"small":"tiny",onClick:r,disabled:s,fullWidth:!0};return l.jsx("div",{className:"@md/banner:w-auto w-full",children:t==="text"?l.jsx(Ct,{...f,variant:"text",children:n}):l.jsx(Ct,{...f,variant:t,children:n})})}const bLe=li(z("bg-subtler","mb-md pt-3","relative flex flex-col items-center w-full","rounded-xl","shadow-sm ","@md/banner:flex-row @md/banner:flex-wrap @md/banner:py-3"),{variants:{size:{default:"gap-md p-md @md/banner:gap-md",compact:"gap-sm p-sm @md/banner:gap-sm"}},defaultVariants:{size:"default"}}),_Le=li("font-semibold",{variants:{size:{default:"text-sm",compact:"text-xs"}},defaultVariants:{size:"default"}}),wLe=li("text-quiet mb-0 font-normal leading-[1.3]",{variants:{size:{default:"text-sm",compact:"text-xs"}},defaultVariants:{size:"default"}}),CLe=z("relative flex w-full flex-row items-center","gap-3","@md/banner:mr-sm","@md/banner:flex-[1_1_60%]"),SLe=z("flex w-full flex-col items-stretch","gap-sm","@md/banner:flex-row-reverse @md/banner:flex-wrap @md/banner:justify-end @md/banner:gap-sm @md/banner:w-auto @md/banner:items-center","@md/banner:ml-auto");function ELe({title:e,description:t,leadingAccessory:n,children:r,size:s="default"}){const o=d.useMemo(()=>({size:s}),[s]),a=d.useMemo(()=>[...Array.isArray(r)?r:[r]].reverse(),[r]);return l.jsx(xLe,{value:o,children:l.jsx("div",{className:"@container/banner",children:l.jsxs("div",{className:bLe({size:s}),children:[l.jsxs("div",{className:CLe,children:[n&&l.jsx("div",{className:"shrink-0",children:l.jsx(Jt,{icon:n,size:"default"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:_Le({size:s}),children:e}),t&&l.jsx("div",{className:wLe({size:s}),children:t})]})]}),l.jsx("div",{className:SLe,children:a})]})})})}const Q0=Object.assign(ELe,{Action:vLe}),kLe=()=>{const e=Xt(),t=cu(),n=d.useMemo(()=>e.getQueryData(t),[e,t]),{connectors:r}=Sa({reason:"useHasUnauthenticatedGmailGcal"});return d.useMemo(()=>{const s=!!r?.connectors.find(o=>o.name==="gcal"&&(!o.connected||o.has_required_scopes===!1));return!(!n||!s)},[n,r])},MLe=1e4,TLe=1e3*60,ALe=["comet-default-browser-status"],NLe=()=>{const e=ln(),{data:t=null,isLoading:n,refetch:r}=gt({queryKey:ALe,queryFn:async()=>{try{return await e.getIsCometDefaultBrowser("check_default_browser")}catch{return null}},refetchInterval:s=>s?.state?.data?TLe:MLe,refetchIntervalInBackground:!0,staleTime:0});return{isDefaultBrowser:t,isDefaultBrowserLoading:n,refetch:r}},RLe=({position:e,inFlight:t,isLastResult:n,upsellInformation:r,backendUuid:s})=>{const[o,a]=d.useState(!1),[i,c]=d.useState(null);Ca();const u="sidecar_thread",{session:f}=je(),{trackEventOnce:m,trackEvent:p}=Ke(f),h=FJ(),g=kLe(),{subscriptionTier:y}=Bt(),{isDefaultBrowser:x}=NLe(),v=d.useMemo(()=>{if(o||!r||!r?.title||r.upsell_type==="UNSET"||e==="top"&&r.app_location!=="IN_THREAD"||e==="bottom"&&r.app_location!=="IN_THREAD_BOTTOM"||e==="input"&&r.app_location!=="IN_THREAD_INPUT"||e==="connector_auth"&&r.app_location!=="UPSELL_APP_LOCATION_UNSPECIFIED")return!1;const w=r.upsell_uuid;return!(!s||w===i||!n&&(!r.is_persistent||e==="input"||e==="router_steps"||e==="connector_auth")||e==="bottom"&&t||r.is_persistent&&(!h||r.name==="gmail_gcal_connector"&&!g||r.name==="comet_set_default_browser"&&x!==!1))},[o,r,e,s,i,n,t,h,g,x]);d.useEffect(()=>{r?.upsell_type==="UNSET"&&a(!1)},[r?.upsell_type]),d.useEffect(()=>{if(!v||!r)return;const w=s,S=r.upsell_uuid;c(S),a(!0),m("thread upsell banner viewed",{entryUUID:w,upsellType:r.upsell_type,upsellName:r.name,upsellUuid:r.upsell_uuid,cometSurface:u,subscriptionTier:y,eventMetadata:r.event_metadata}),m("upsell viewed",{upsellLocation:r.app_location,upsellUUID:r.upsell_uuid,entryUUID:w,upsellType:r.upsell_type,upsellName:r.name,cometSurface:u,subscriptionTier:y,eventMetadata:r.event_metadata})},[s,v,m,r,u,y]);const b=d.useCallback(({hideBanner:w=!0}={})=>{w&&a(!1);const S=r,C=s;if(C&&S?.upsell_type){p("thread upsell banner dismissed",{entryUUID:C,upsellType:S.upsell_type,upsellName:S.name,upsellUuid:S.upsell_uuid,cometSurface:u,subscriptionTier:y,eventMetadata:S.event_metadata}),p("upsell dismissed",{upsellLocation:S.app_location,upsellUUID:S.upsell_uuid,entryUUID:C,upsellType:S.upsell_type,upsellName:S.name,cometSurface:u,subscriptionTier:y,eventMetadata:S.event_metadata});const E=S.cta==="SHORTCUT_MODAL"?S.cta_information?.recommended_shortcut?.name:void 0;lT({upsellName:S.name,upsellInstanceIdentifier:E,interactionType:"dismiss"})}},[s,p,r,u,y]),_=d.useCallback(()=>{a(!1)},[]);return d.useMemo(()=>({show:o,handleDismiss:b,handleHide:_}),[b,o,_])},DLe=/\[([^\]]+)\]\(pplx:\/\/action\/translate\)/g;function jLe(e){const t=Array.from(e.matchAll(DLe)).map(n=>n[1]).filter(n=>n!==void 0);return[...new Set(t)]}const xw=async({queryKey:e})=>{const[t,n="",r=""]=be.unmakeQueryKey(e);return HJ({entryUUID:n,reason:"useThreadTranslations",phrase:r})},ILe=(e,t)=>{switch(t.type){case"NEXT":{const n=e.currentIndex+1,r=n%e.translatePhrases.length;return!t.canLoop&&n!==r?(t.onPageChange?.(null),e):(t.onPageChange&&t.fetchTranslatedPhrase(e.translatePhrases[r]).then(s=>{t.onPageChange?.(s)}),{...e,currentPhrase:e.translatePhrases[r],currentIndex:r})}case"PREV":{const n=e.currentIndex-1+e.translatePhrases.length,r=n%e.translatePhrases.length;return!t.canLoop&&n!==r?(t.onPageChange?.(null),e):(t.onPageChange&&t.fetchTranslatedPhrase(e.translatePhrases[r]).then(s=>{t.onPageChange?.(s)}),{...e,currentPhrase:e.translatePhrases[r],currentIndex:r})}default:return e}},PLe=()=>{const{result:e}=Ot();return d.useMemo(()=>{const t=Yt.parseAskTextField(e);return t?jLe(t.answer):[]},[e])},VJ=({clickedPhrase:e,entryUUID:t,contextUUID:n,translatePhrases:r})=>{const{session:s}=je(),{trackEvent:o}=Ke(s),a=d.useCallback((_,w)=>{o("language learning modal advance pressed",{entryUUID:t,contextUUID:n,direction:_,source:w})},[t,n,o]),[i,c]=d.useReducer(ILe,{currentIndex:e?r.indexOf(e):0,translatePhrases:r,currentPhrase:e??r[0]}),u=i.currentPhrase,f=i.currentIndex,m=be.makeQueryKey("translation_phrase_info",t,u),p=Xt();d.useEffect(()=>{const _=r[(r.length+f-1)%r.length],w=r[(f+1)%r.length];p.prefetchQuery({queryKey:be.makeQueryKey("translation_phrase_info",t,_),queryFn:xw}),p.prefetchQuery({queryKey:be.makeQueryKey("translation_phrase_info",t,w),queryFn:xw})},[t,r,f,p]);const{data:h,isLoading:g}=gt({queryKey:m,queryFn:xw}),y=d.useCallback(async _=>HJ({entryUUID:t,reason:"useThreadTranslations",phrase:_}),[t]),x=d.useCallback(({onPageChange:_,source:w,canLoop:S})=>{c({type:"NEXT",onPageChange:_,fetchTranslatedPhrase:y,canLoop:S}),a("forward",w)},[a,y]),v=d.useCallback(({onPageChange:_,source:w,canLoop:S})=>{c({type:"PREV",onPageChange:_,fetchTranslatedPhrase:y,canLoop:S}),a("backward",w)},[a,y]),{data:b}=gt({queryKey:be.makeQueryKey("translation_detected_languages",t),queryFn:()=>OLe({entryUUID:t,reason:"useThreadTranslations"})});return{groupedTranslation:h,isLoading:g,advancePage:x,previousPage:v,translatePhrases:r,currentPhrase:u,currentIndex:f,detectedLanguages:b}},HJ=async({entryUUID:e,reason:t,phrase:n})=>{const{data:r,error:s}=await de.POST("/rest/translation/phrase_info",t,{body:{entry_uuid:e,translated:n},timeoutMs:3e4});return s?(Z.error(`Failed to fetch translated phrases for entry ${e}`),null):r?.translation??null},OLe=async({entryUUID:e,reason:t})=>{const{data:n}=await de.GET("/rest/translation/detect-languages/{entry_uuid}",t,{params:{path:{entry_uuid:e}},timeoutMs:5e3});return n||(Z.error(`Failed to detect languages for entry ${e}`),null)},LLe=50;function cI(e){const t=pA(0);return d.useEffect(()=>{if(!e){t.set(0);return}try{const n=new AudioContext,r=n.createMediaStreamSource(e),s=n.createAnalyser();s.fftSize=2048,r.connect(s);const o=new Uint8Array(2048),a=setInterval(()=>{s.getByteFrequencyData(o);const i=Array.from(o).reduce((c,u)=>c+u,0)/o.length/255;t.set(i*100)},LLe);return()=>{clearInterval(a),s.disconnect(),r.disconnect(),n.close()}}catch(n){Z.error("[v2v_language_learning] Audio analysis setup failed:",n);return}},[t,e]),t}function FLe({onPhraseAttemptResult:e,onConnect:t,onEndLesson:n}){const r=d.useRef(null),s=d.useRef(null),o=d.useRef(null),a=d.useRef(null),i=d.useRef(null),c=d.useRef(!1),[u,f]=d.useState(!1),[m,p]=d.useState(!1),[h,g]=d.useState(null),[y,x]=d.useState(!1),v=d.useRef(!1),[b,_]=d.useState(),w=cI(b),[S,C]=d.useState(),E=cI(S),N=d.useCallback(A=>{if(a.current){const D=a.current.getAudioTracks()[0];D&&(D.enabled=!A,x(A),v.current=A)}},[]),k=d.useCallback(A=>{const D=s.current;if(!D||D.readyState!=="open"){Z.debug("[v2v_language_learning] Channel not ready");return}try{i.current&&(D.send(JSON.stringify({type:"response.cancel",response_id:i.current})),D.send(JSON.stringify({type:"output_audio_buffer.clear"}))),D.send(JSON.stringify({type:"conversation.item.create",item:{type:"message",role:"system",content:[{type:"input_text",text:A}]}})),D.send(JSON.stringify({type:"response.create"}))}catch(P){Z.error("[v2v_language_learning] Send failed:",P)}},[]),I=d.useCallback(()=>{a.current&&(a.current.getTracks().forEach(A=>A.stop()),a.current=null),o.current&&(o.current.pause(),o.current.srcObject=null),s.current&&(s.current.close(),s.current=null),r.current&&(r.current.close(),r.current=null),i.current=null,v.current=!1,C(void 0),_(void 0),p(!1),f(!1),x(!1),w.set(0),g(null),Z.debug("[v2v_language_learning] Ended")},[w]),M=d.useCallback(async A=>{try{g(null);const D=await navigator.mediaDevices.getUserMedia({audio:!0});C(D),a.current=D;const P=new RTCPeerConnection;r.current=P,D.getTracks().forEach(L=>P.addTrack(L,D)),P.ontrack=L=>{const[U]=L.streams;o.current&&U&&(o.current.srcObject=U,o.current.play().catch(O=>{Z.info("[v2v_language_learning] Audio autoplay blocked:",O)}),_(U))};const F=P.createDataChannel("oai-events");s.current=F,F.onopen=()=>{Z.debug("[v2v_language_learning] Connected"),p(!0),t?.(k)},F.onmessage=L=>{try{const U=JSON.parse(L.data);if(U.type==="response.function_call_arguments.done")if(U.name==="record_phrase_attempt_result"){const O=JSON.parse(U.arguments);Z.debug("[v2v_language_learning] Record phrase attempt result:",O),e(O,$=>{F.send(JSON.stringify({type:"conversation.item.create",item:{type:"function_call_output",call_id:U.call_id,output:$}})),F.send(JSON.stringify({type:"response.create"})),Z.debug("[v2v_language_learning] Sent next instruction:",$)})}else U.name==="end_lesson"&&(i.current?c.current=!0:n?.(I));switch(U.type){case"output_audio_buffer.started":f(!0),i.current=U.response_id,a.current?.getAudioTracks().forEach(O=>{O.enabled=!1});break;case"output_audio_buffer.stopped":f(!1),i.current=null,v.current||a.current?.getAudioTracks().forEach(O=>{O.enabled=!0}),c.current&&(n?.(I),c.current=!1);break;default:break}}catch(U){Z.warn("[v2v_language_learning] Parse error:",U)}},F.onclose=()=>{Z.debug("[v2v_language_learning] Disconnected"),p(!1)};const R=await P.createOffer();if(await P.setLocalDescription(R),!R.sdp)throw new Error("No SDP in offer");const j=await kDe({body:{...A,sdp:R.sdp},reason:"language-learning"});if(!j.data?.sdp)throw new Error(j.error||"Failed to create language learning session");await P.setRemoteDescription({type:"answer",sdp:j.data.sdp})}catch(D){throw Z.error("[v2v_language_learning] Start session failed:",D),g(D instanceof Error?D:new Error(String(D))),D}},[e,k,t,I,n]);return{audioRef:o,dataChannel:s.current,startSession:M,sendInstruction:k,endSession:I,isConnected:m,isSpeaking:u,error:h,remoteAmplitude:w,localAmplitude:E,isMicMuted:y,setIsMicMuted:N}}const BLe=(e,t)=>{const{value:n,loading:r}=qt({flag:"language-learning-voice-tutor",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},ULe=[{type:"default",value:"en",text:"English (English)"},{type:"default",value:"yue",text:"Cantonese (粵語)"},{type:"default",value:"ca",text:"Catalan (Català)"},{type:"default",value:"zh",text:"Chinese (中文)"},{type:"default",value:"hr",text:"Croatian (Hrvatski)"},{type:"default",value:"cs",text:"Czech (Čeština)"},{type:"default",value:"da",text:"Danish (Dansk)"},{type:"default",value:"nl",text:"Dutch (Nederlands)"},{type:"default",value:"fi",text:"Finnish (Suomi)"},{type:"default",value:"fr",text:"French (Français)"},{type:"default",value:"de",text:"Standard German (Deutsch)"},{type:"default",value:"he",text:"Hebrew (עברית)"},{type:"default",value:"hi",text:"Hindi (हिंदी)"},{type:"default",value:"hu",text:"Hungarian (Magyar)"},{type:"default",value:"id",text:"Indonesian (Bahasa Indonesia)"},{type:"default",value:"it",text:"Italian (Italiano)"},{type:"default",value:"ja",text:"Japanese (日本語)"},{type:"default",value:"jv",text:"Javanese (Basa Jawa)"},{type:"default",value:"ko",text:"Korean (한국어)"},{type:"default",value:"ms",text:"Malay (Melayu)"},{type:"default",value:"zh-CN",text:"Simplified Chinese (简体中文)"},{type:"default",value:"zh-TW",text:"Traditional Chinese (繁體中文)"},{type:"default",value:"no",text:"Norwegian (Norsk)"},{type:"default",value:"pl",text:"Polish (Polski)"},{type:"default",value:"pt",text:"Portuguese (Português)"},{type:"default",value:"ru",text:"Russian (Русский)"},{type:"default",value:"sr",text:"Serbian (Srpski)"},{type:"default",value:"es",text:"Spanish (Español)"},{type:"default",value:"sv",text:"Swedish (Svenska)"},{type:"default",value:"tl",text:"Tagalog (Tagalog)"},{type:"default",value:"ta",text:"Tamil (தமிழ்)"},{type:"default",value:"te",text:"Telugu (తెలుగు)"},{type:"default",value:"tr",text:"Turkish (Türkçe)"},{type:"default",value:"uk",text:"Ukrainian (Українська)"},{type:"default",value:"ur",text:"Urdu (اردو)"},{type:"default",value:"vi",text:"Vietnamese (Tiếng Việt)"}],VLe=[{type:"default",value:"echo",text:"Gravo"},{type:"default",value:"cedar",text:"Kyrin"},{type:"default",value:"ballad",text:"Mylva"},{type:"default",value:"shimmer",text:"Nuvix"},{type:"default",value:"verse",text:"Rylth"},{type:"default",value:"sage",text:"Solva"},{type:"default",value:"coral",text:"Syla"},{type:"default",value:"ash",text:"Torma"},{type:"default",value:"alloy",text:"Tylis"},{type:"default",value:"marin",text:"Velox"}],HLe=()=>{let e=ULe[0],t=VLe[1];try{const n=wt.getItem("pplx.v2v.selectedLanguage");if(n){const r=JSON.parse(n);r.value&&(e=r)}}catch(n){Z.error("Error loading local language settings:",n)}try{const n=wt.getItem("pplx.v2v.selectedVoice");if(n){const r=JSON.parse(n);r.value&&(t=r)}}catch(n){Z.error("Error loading local voice settings:",n)}return{language:e,voice:t}},zLe=()=>{const e=d.useMemo(()=>HLe(),[]),[t,n]=d.useState(e),[r,s]=d.useState(e),o=d.useCallback(m=>{s(p=>({...p,language:m}))},[s]),a=d.useCallback(m=>{s(p=>({...p,voice:m}))},[s]),i=r.language.value!==t.language.value,c=r.voice.value!==t.voice.value,u=i||c,f=d.useCallback(()=>{wt.setItem("pplx.v2v.selectedLanguage",JSON.stringify(r.language)),wt.setItem("pplx.v2v.selectedVoice",JSON.stringify(r.voice)),n(r)},[r]);return d.useMemo(()=>({currentSettings:r,setLanguage:o,setVoice:a,hasChanges:u,save:f}),[r,u,f,o,a])},Rr={type:"spring",stiffness:700,damping:50},h6="LANGUAGE_LEARNING_AUTOPLAY",X0=e=>{new Audio(e).play().catch(n=>{console.error("Error playing audio:",n)})},uI=e=>{const t=Object.keys(e).map(n=>`"${n}": ${e[n].join(", ")}`).join(` -`);return t.length>0?`End lesson. Ground any overall feedback on the lesson on the following report: ${t}`:"End lesson. No phrases-specific feedback was provided, so just say goodbye to the user and bring your conversation to an end."},WLe=({onClose:e,string:t,stringBounds:n,isMobileStyle:r,autoplay:s,initialWidth:o,entryUUID:a,contextUUID:i,queryStr:c,translatePhrases:u,defaultMode:f="flashcards"})=>{const{session:m}=je(),{trackEvent:p}=Ke(m),g=J().formatMessage,[y,x]=d.useState(null),v=d.useRef(null),[b,_]=d.useState(!1),[w,S]=d.useState(s),[C,E]=d.useState(null),[N,k]=d.useState(o),I=d.useRef(null),M=d.useRef(null),A=d.useRef(null),{variation:D}=BLe(!1),{currentSettings:P}=zLe(),[F,R]=d.useState(f==="voice_tutor"),j=w&&!F,[L,U]=d.useState(!1),O=d.useRef({}),$=16,{groupedTranslation:G,detectedLanguages:H,isLoading:Q,advancePage:Y,previousPage:te,currentPhrase:se,currentIndex:ae}=VJ({clickedPhrase:t,entryUUID:a,contextUUID:i,translatePhrases:u}),{colorScheme:X}=Ss(),ee=d.useMemo(()=>X==="light"?{accentColor:"rgb(172, 63, 0)",baseColor:"rgb(219, 113, 0)",aiColor:"rgb(50, 184, 198)",loadingColor:"rgb(98, 108, 113)",idleColor:"rgb(175, 180, 181)"}:{accentColor:"rgb(255, 210, 166)",baseColor:"rgb(219, 113, 0)",aiColor:"rgb(50, 184, 198)",loadingColor:"rgb(167, 169, 169)",idleColor:"rgb(99, 101, 101)"},[X]),le=d.useMemo(()=>G?b?G.sentence.translated:G.element.translated:se,[se,G,b]),re=d.useCallback(ot=>{ot(`Start lesson. Current phrase: "${le}"`)},[le]),ce=d.useCallback((ot,$t)=>{if(O.current[ot.phrase]||(O.current[ot.phrase]=[]),ot.status==="success"||ot.status==="skipped")ot.status==="success"&&O.current[ot.phrase].push("Correct!"),Y({onPageChange:fn=>{if(fn){const ut=b?fn.sentence.translated:fn.element.translated;$t(`Move onto the next phrase: "${ut}"`)}else $t(uI(O.current))},source:"voice-tutor",canLoop:!1});else if(ot.status==="failure"){const fn=ot.feedback??"Did not repeat the phrase correctly, but no feedback was given. Only reference this in general terms in your feeddback.";O.current[ot.phrase].push(fn),$t("Continue with your feedback for this phrase.")}},[Y,b]),ue=d.useCallback(ot=>{ot(),R(!1),p("language learning voice tutor session ended",{entryUUID:a,contextUUID:i})},[a,i,p]),{endSession:pe,startSession:xe,sendInstruction:he,audioRef:_e,isConnected:ke,isSpeaking:De,error:Ce,remoteAmplitude:Be,localAmplitude:we,isMicMuted:$e,setIsMicMuted:yt}=FLe({onPhraseAttemptResult:ce,onConnect:re,onEndLesson:ue});d.useEffect(()=>{Ce&&p("language learning voice tutor session error",{entryUUID:a,contextUUID:i,error:Ce.message})},[Ce,a,i,p]),d.useEffect(()=>{if(!(!F||!H))return p("language learning voice tutor session started",{entryUUID:a,contextUUID:i}),O.current={},xe({source:"web",voice:P.voice.value??"marin",learning_language:H.learning_language,native_language:H.native_language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,turn_detection_threshold:.9,query:c,learning_dialect:H.learning_dialect}),()=>{p("language learning voice tutor session ended",{entryUUID:a,contextUUID:i}),pe()}},[F,H,p,a,i]);const me=d.useCallback(ot=>{if(ke)if(ot){const $t=b?ot.sentence.translated:ot.element.translated;he(`Move onto a new phrase. DO NOT give feedback on the previous phrase. The new phrase is: "${$t}"`)}else he(uI(O.current))},[he,ke,b]);let ve;ae!==null&&(ve=b?G?.sentence:G?.element);function Ae(ot,$t,fn){return Math.round(Math.max($t,Math.min(ot,fn)))}let Ge;const ht=ve?.translated.length??se?.length??0;ht<20?Ge=Ae(N*.088,24,128):ht>=20&&ht<48?Ge=Ae(N*.058,32,84):Ge=Ae(N*.038,24,56);const mt=d.useCallback(()=>Ce?Ce instanceof Error&&Ce.name=="NotAllowedError"?g({defaultMessage:"Please enable microphone permissions and try again.",id:"UaGxC0QJ/N"}):g({defaultMessage:"Failed to connect",id:"uhiTNkWfe3"}):ke?ke&&!L?g({defaultMessage:"Waking up...",id:"DgbC2DZlba"}):De&&L?null:g($e?{defaultMessage:"Muted",id:"HOzFdo4wh5"}:b?{defaultMessage:"Repeat the sentence",id:"PDwmrTmyqy"}:{defaultMessage:"Repeat the word",id:"m4eJ6oS5NH"}):g({defaultMessage:"Waking up...",id:"DgbC2DZlba"}),[De,Ce,L,ke,$e,b,g]);d.useEffect(()=>{ke&&De&&U(!0),ke||U(!1)},[ke,De]),d.useLayoutEffect(()=>{if(v.current){const ot=v.current.getBoundingClientRect();x(ot)}},[]);const Qe={zoomInInitial:{opacity:0,scale:$/Ge,x:y?n.left+n.width/2-(y.left+y.width/2):0,y:y?n.top+n.height/2-(y.top+y.height/2):0},initial:{opacity:0,scale:1,x:0,y:0},resting:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:1,x:0,y:0}},Tt=ot=>{const $t=ot.currentTarget.getBoundingClientRect(),ut=ot.clientX-$t.left<$t.width/2,bt=ot.target;if(bt.closest("button")||bt.closest('[data-no-click="true"]')){ot.type==="mousemove"&&M.current&&A.current&&(M.current.style.opacity="0",A.current.style.opacity="0");return}ut?ot.type==="mousemove"&&M.current&&A.current?(M.current.style.opacity="1",A.current.style.opacity="0"):ot.type==="click"&&te({onPageChange:me,source:"manual",canLoop:!F}):ot.type==="mousemove"&&A.current&&M.current?(A.current.style.opacity="1",M.current.style.opacity="0"):ot.type==="click"&&Y({onPageChange:me,source:"manual",canLoop:!F})},Ye=d.useCallback(()=>{yt(!$e),X0($e?"/static/sounds/rt-ready.wav":"/static/sounds/rt-pause.wav")},[$e,yt]);d.useEffect(()=>{const ot=fn=>{if(fn.key==="Escape")e();else if(fn.key==="ArrowRight")Y({onPageChange:me,source:"manual",canLoop:!F});else if(fn.key==="ArrowLeft"){if(F&&ae===0)return;te({onPageChange:me,source:"manual",canLoop:!F})}else fn.key===" "&&(fn.preventDefault(),E(new Date))},$t=()=>{k(window.innerWidth)};return window.addEventListener("keydown",ot),window.addEventListener("resize",$t),()=>{window.removeEventListener("keydown",ot),window.removeEventListener("resize",$t)}},[e,Y,te,me,F,ae,u.length,he]),d.useEffect(()=>{wt.setItem(h6,w.toString())},[w]);let Me;w?Me=g({defaultMessage:"Autoplay on",id:"8Svq84unOC"}):Me=g({defaultMessage:"Autoplay off",id:"mjxB7Ns43B"});const Ve=op(Be,[0,10],[.1,.75]),ct=op(Be,[0,10],[1,2]),vt=op(we,[0,1],[.1,.75]),Dt=op(we,[0,1],[1,2]);return l.jsx(kt,{children:l.jsxs("div",{ref:I,onClick:Tt,onMouseMove:u.length>1?Tt:void 0,className:"fixed inset-0 size-full cursor-pointer overflow-hidden",children:[l.jsx("audio",{ref:_e,className:"hidden"}),l.jsx(Te.div,{className:"bg-base absolute inset-0 z-[1] size-full",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Rr,children:!r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:A,className:"absolute right-4 top-1/2 z-[1] size-8 -translate-y-1/2 opacity-0 transition-opacity duration-300",children:l.jsx(V,{color:"ultraLight",variant:"small",children:l.jsx(ge,{icon:B("chevron-right"),size:32})})}),l.jsx("div",{ref:M,className:"absolute left-4 top-1/2 z-[1] size-6 -translate-y-1/2 opacity-0 transition-opacity duration-300",children:l.jsx(V,{color:"ultraLight",variant:"small",children:l.jsx(ge,{icon:B("chevron-left"),size:32})})})]})}),l.jsxs(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Qe,transition:Rr,className:"absolute inset-x-0 top-0 z-[4] flex flex-col gap-3 p-3",children:[u.length>1?l.jsx("div",{className:"gap-xs md:gap-sm flex",children:u.map((ot,$t)=>l.jsx("div",{className:z("bg-subtle h-1 w-full rounded-full",{"!bg-inverse":$t===ae})},$t))}):null,l.jsxs("div",{className:"gap-xs flex items-center justify-end",children:[l.jsx(rt,{toolTip:Me,tooltipLayout:"left",tooltipProps:{closeOnClick:!1},pill:!0,icon:w?oV:aV,onClick:()=>{S(!w),p("language learning mute pressed",{entryUUID:a,contextUUID:i})},disabled:F}),l.jsx(rt,{pill:!0,icon:B("x"),onClick:e})]})]}),l.jsx("div",{className:"scrollbar-subtle absolute inset-0 z-[3] flex size-full overflow-y-scroll",children:l.jsx("div",{className:"flex h-fit min-h-full w-full px-4 py-32 md:px-8 lg:px-12",children:l.jsxs("div",{className:z("gap-md md:gap-lg lg:gap-xl break-word flex min-h-full w-full flex-1 grow flex-col items-center justify-center hyphens-auto",{"!items-start":r}),children:[l.jsx(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Qe,transition:Rr,"data-no-click":"true",children:l.jsx(wr,{active:Q,children:l.jsx(V,{variant:"entry-title",color:"ultraLight",className:z("pointer-events-auto cursor-text",{"text-center !text-3xl":!r,"text-left !text-xl sm:!text-2xl":r,"!bg-subtle rounded-full !text-transparent":Q}),children:Q?"Loading":ve?.untranslated})})}),l.jsxs("div",{ref:v,className:"relative",lang:G?.language_code??void 0,children:[l.jsx("div",{style:{fontSize:Ge},className:z("text-foreground pointer-events-none text-balance text-center font-semibold leading-[1.2] opacity-0",{"!text-left":r}),children:ve?.translated??se}),y&&l.jsx(Te.div,{className:z("text-foreground pointer-events-auto absolute inset-0 w-fit text-balance text-center font-semibold leading-[1.2] outline-none",{"!text-left":r}),style:{fontSize:Ge},initial:y.height>Ge*1.2?"initial":"zoomInInitial",animate:"resting",exit:"exit",transition:Rr,variants:Qe,dir:G?.is_rtl?"rtl":"ltr",children:l.jsx(wr,{active:Q,children:l.jsx(qLe,{currentTranslation:ve,translation:ve?.translated??se??"",autoplay:j,lastPlayedTime:C,isRtl:G?.is_rtl??!1,entryUUID:a,contextUUID:i,onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})}},ae?.toString()+b.toString())})})]}),l.jsx(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Qe,transition:Rr,"data-no-click":"true",children:l.jsx(wr,{active:Q,children:l.jsx(V,{variant:"entry-title",color:"ultraLight",className:z("pointer-events-auto cursor-text",{"text-center !text-3xl":!r,"text-left !text-xl sm:!text-2xl":r,"!bg-subtle rounded-full !text-transparent":Q}),children:Q?"Pronunciation":ve?.pronunciation})})})]})})}),l.jsxs(Te.div,{className:"absolute inset-x-0 bottom-0 z-[4] flex h-fit items-center justify-center gap-2 pb-4 md:gap-3 md:pb-9",initial:"initial",animate:"resting",exit:"exit",variants:Qe,transition:Rr,children:[!D&&l.jsxs(l.Fragment,{children:[l.jsx(ze,{variant:"primary",size:r?"regular":"large",onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})},icon:B("player-play-filled"),pill:!0,extraCSS:"!bg-inverse disabled:!text-inverse relative z-10",disabled:Q}),l.jsx("div",{className:"bg-base relative z-10 rounded-full",children:l.jsx("div",{className:"bg-subtle h-10 rounded-full p-[2.5px] md:h-14 md:p-1",children:l.jsxs("div",{className:"relative flex h-full items-center",children:[l.jsx(rt,{variant:"primary",size:r?"small":"regular",text:l.jsxs("div",{className:"pointer-events-none relative grid grid-cols-1 grid-rows-1",children:[l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]}),onClick:()=>{_(!1),p("language learning selector pressed",{entryUUID:a,contextUUID:i,button:"word"})},disabled:Q,extraCSS:"relative h-full z-10 focus-visible:!bg-transparent !bg-transparent"}),l.jsx(rt,{variant:"primary",noBackground:!0,size:r?"small":"regular",text:l.jsxs("div",{className:"pointer-events-none relative grid grid-cols-1 grid-rows-1",children:[l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]}),onClick:()=>{_(!0),p("language learning selector pressed",{entryUUID:a,contextUUID:i,button:"sentence"})},disabled:Q,extraCSS:"relative z-10 h-full !gap-0 focus-visible:!bg-transparent !bg-transparent"}),l.jsx(Te.div,{className:"bg-raised dark:!bg-base absolute inset-y-0 left-0 h-full w-1/2 rounded-full",animate:{x:b?"100%":"0%"},transition:Rr})]})})})]}),D&&l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1",children:[l.jsx(kt,{initial:!1,children:l.jsx(Te.div,{initial:{opacity:0,scale:.9,filter:"blur(10px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{duration:.4},className:"relative z-[2] col-start-1 col-end-2 row-start-1 row-end-2 mx-auto",children:F?l.jsxs("div",{className:"relative flex items-center gap-4 rounded-full",children:[l.jsx(kt,{children:l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Rr,className:"absolute -top-12 left-1/2 -translate-x-1/2 whitespace-nowrap",children:l.jsx(wr,{active:!ke||ke&&!L||!De&&ke,children:l.jsx(V,{variant:"entry-title-200",className:"!whitespace-nowrap",style:{color:Ce||!ke||ke&&!L?ee.idleColor:De?ee.aiColor:ee.baseColor},children:mt()})})},De.toString()+Ce+(!ke&&L).toString()+$e.toString())}),l.jsx("div",{className:"bg-base rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:l.jsx(ze,{variant:"common",size:"large",onClick:()=>{R(!1),X0("/static/sounds/rt-pause.wav")},leadingComponent:l.jsx(ge,{icon:B("player-stop"),size:24}),pill:!0,noPadding:!0,extraCSS:"!bg-raised relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q,toolTip:g({defaultMessage:"Stop voice tutor",id:"+7CJc6lfrw"}),tooltipLayout:"top"})}),l.jsx("div",{className:"bg-base rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:l.jsx(ze,{variant:"common",size:"large",leadingComponent:l.jsx(ge,{icon:$e?B("microphone-off"):B("microphone"),size:20}),pill:!0,noPadding:!0,extraCSS:"!bg-raised relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q,onClick:Ye,toolTip:g($e?{defaultMessage:"Turn on microphone",id:"wdzCqjtXgD"}:{defaultMessage:"Turn off microphone",id:"SUrSrgEOv2"}),tooltipLayout:"top"})})]}):l.jsxs("div",{className:"bg-raised z-[2] col-start-1 col-end-2 row-start-1 row-end-2 mx-auto flex w-fit items-center rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:[l.jsx(ze,{variant:"common",size:"large",onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})},leadingComponent:l.jsx(ge,{icon:B("player-play-filled"),size:20}),pill:!0,extraCSS:"!bg-transparent relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q}),l.jsx("div",{className:"bg-subtle h-8 w-0.5 flex-shrink-0"}),l.jsx(ze,{variant:"common",size:"large",onClick:()=>{R(!0),X0("/static/sounds/rt-ready.wav")},leadingComponent:l.jsx(ge,{icon:sV,size:20}),pill:!0,extraCSS:z("!bg-transparent relative !text-sm z-10 [&>*]:!gap-2 active:!scale-100 active:!opacity-[50%]",{"!pl-4 !pr-3":!r}),disabled:Q,text:r?void 0:g({defaultMessage:"Voice Tutor",id:"rWFec/0yfN"}),textClassName:"p-0 -translate-y-px"}),l.jsx("div",{className:"bg-subtle h-8 w-0.5 flex-shrink-0"}),l.jsx(ze,{variant:"common",size:"large",onClick:()=>{_(!b)},pill:!0,extraCSS:"!bg-transparent relative !text-sm z-10 !px-3 active:!scale-100 translate-y-0 active:!opacity-[50%] !font-normal",trailingComponent:l.jsx(ge,{icon:B("selector"),size:16}),disabled:Q,text:l.jsxs("div",{className:z("flex items-center",{"flex-col":r}),children:[l.jsx(V,{variant:r?"tinyRegular":"small",color:"light",className:z("mr-auto",{"leading-tight":r}),children:g({defaultMessage:"View as",id:"pX8Y8hA7fI"})}),r?null:l.jsx(l.Fragment,{children:" "}),l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1",children:[l.jsx(kt,{initial:!1,children:l.jsx(Te.div,{className:"col-start-1 col-end-2 row-start-1 row-end-2 text-left",initial:{y:"100%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-100%",opacity:0},transition:Rr,children:l.jsx(V,{variant:"smallBold",color:"default",children:g(b?{defaultMessage:"Sentence",id:"82Zf4jFbZN"}:{defaultMessage:"Word",id:"TGazyxBLFu"})})},b.toString())}),l.jsx(V,{className:"pointer-events-none col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",variant:"smallBold",color:"default",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx(V,{className:"pointer-events-none col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",variant:"smallBold",color:"default",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]})]}),textClassName:"p-0 -translate-y-px"})]})},F.toString())}),l.jsx(kt,{children:F&&l.jsx(Te.div,{className:"ease-outExpo absolute inset-x-0 top-1/2 z-[1] h-full rounded-[100%] opacity-20 blur-[30px] saturate-200 duration-1000",initial:{opacity:0},animate:{backgroundColor:Ce||!ke||ke&&!L?ee.idleColor:De?ee.aiColor:ee.baseColor,opacity:.5},exit:{opacity:0},style:{opacity:De?Ve:Ce||!ke||ke&&!L?.5:vt,scale:De?ct:Ce||!ke||ke&&!L?1:Dt},transition:Rr})})]}),l.jsx("div",{className:"from-base pointer-events-none absolute inset-x-0 -top-9 bottom-0 bg-gradient-to-t to-transparent"})]})]})})},GLe=`linear-gradient( - to right, - oklch(var(--foreground-color)) 0%, - oklch(var(--foreground-color)) 33.34%, - oklch(var(--dark-super-color)) 50%, - oklch(var(--dark-super-color)) 66.67%, - oklch(var(--foreground-color)) 66.67%, - oklch(var(--foreground-color)) 100% -)`,$Le=`linear-gradient( - to right, - oklch(var(--foreground-color)) 0%, - oklch(var(--foreground-color)) 33.34%, - oklch(var(--dark-super-color)) 33.34%, - oklch(var(--dark-super-color)) 50%, - oklch(var(--foreground-color)) 66.67%, - oklch(var(--foreground-color)) 100% -)`,qLe=({currentTranslation:e,translation:t,autoplay:n,lastPlayedTime:r,isRtl:s,onClick:o,entryUUID:a,contextUUID:i})=>{const c=d.useRef(null),u=d.useRef(n);d.useEffect(()=>{u.current=n},[n]);const f=d.useRef(r);d.useEffect(()=>{f.current=r},[r]);const{session:m}=je(),{trackEvent:p}=Ke(m),h=d.useCallback(()=>{if(!e)return;const _=e.audio_url;_&&c.current&&(c.current.src=_)},[e]),g=pA(0),y=op(()=>s?`${g.get()*100}%`:`${(1-g.get())*100}%`),x=d.useCallback(()=>{c.current&&(c.current.pause(),c.current.currentTime=0,requestAnimationFrame(()=>{c.current?.play()}))},[]),v=d.useRef(r);d.useEffect(()=>{r&&r!==v.current&&x()},[r,x]),d.useEffect(()=>{h()},[h]),d.useEffect(()=>{c.current&&(c.current.pause(),c.current.currentTime=0,h())},[t,h]);const b=d.useCallback(()=>{u.current&&x()},[x]);return l.jsxs(l.Fragment,{children:[l.jsx("audio",{ref:c,className:"hidden",onLoadedMetadata:()=>{b()},onPlay:()=>{g.jump(0),wNe(g,1,{ease:"linear",duration:(c.current?.duration??0)*2}),p("language learning audio played",{entryUUID:a,contextUUID:i})}}),l.jsx(Te.span,{className:"-my-4 py-4 text-transparent",style:{backgroundPositionX:y,backgroundClip:"text",backgroundSize:"300%",backgroundRepeat:"no-repeat",backgroundImage:s?$Le:GLe},children:l.jsx("span",{onClick:o,className:"cursor-pointer","data-no-click":"true",children:t})})]})},KLe=Object.freeze(Object.defineProperty({__proto__:null,LANGUAGE_LEARNING_AUTOPLAY_KEY:h6,default:WLe},Symbol.toStringTag,{value:"Module"})),zJ=T.memo(({url:e,openInNewTab:t,fullWidth:n=!0,variant:r="super",upsellInformation:s})=>{const{$t:o}=J(),{session:a}=je(),{trackEvent:i}=Ke(a),c=d.useCallback(()=>{s&&i("upsell clicked",{upsellLocation:s.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:s.upsell_uuid,upsellName:s.name,upsellType:s.upsell_type,cta:nn.PERMALINK}),e&&(t?window.open(e,"_blank"):Do(e,"Learn more from upsell"))},[e,t,i,s]);return l.jsx(rt,{text:o({defaultMessage:"Learn more",id:"TdTXXf940t"}),fullWidth:n,variant:r,textClassName:"!text-sm",noPadding:!0,onClick:c})});zJ.displayName="LearnMoreButton";const WJ=T.memo(({upsellInformation:e,inFlight:t,position:n,onButtonClick:r,isLoading:s,textButtonIfSecondary:o=!1,hideUpsell:a,verticalLayout:i=!1})=>{const c=Tl({upsellInformation:e,inFlight:t,options:{hideUpsell:a}}),u=d.useCallback(()=>{r?.(),c()},[r,c]),f=d.useCallback(w=>{if(n==="router_steps")return"inverted";switch(w){case Sm.MAX_COLOR:return"maxGold";case Sm.PRIMARY_COLOR:return"primary";case Sm.INVERTED:return"inverted";default:return"common"}},[n]),m=d.useMemo(()=>f(e?.button_color),[f,e?.button_color]),p=e?.cta_information?.secondary_button,h=e?.cta_information?.tertiary_button,g=Tl({upsellInformation:p?{...e,cta:p.cta,button_text:p.button_text}:e,inFlight:t,options:{hideUpsell:a}}),y=Tl({upsellInformation:h?{...e,cta:h.cta,button_text:h.button_text}:e,inFlight:t,options:{hideUpsell:a}}),x=d.useCallback((w,S)=>{const C=f(w.button_color),E=w.button_color===Sm.SECONDARY_COLOR,k={size:"regular",onClick:()=>{r?.(),S()},text:w.button_text,textClassName:"!text-sm",fullWidth:!0};return o&&E?l.jsx(rt,{...k,variant:"super",noPadding:!0}):l.jsx(ze,{...k,variant:C})},[f,o,r]),v=d.useCallback(w=>{let S;e?.icon_reference==="labs"?S=l.jsx(ge,{icon:B("plus"),size:"sm"}):e?.icon_reference==="comet_download"&&(S=l.jsx(ft,{name:B("download"),size:16}));const C={size:w?"regular":"small",onClick:u,text:e?.button_text,leadingComponent:S,textClassName:w?"!text-sm":void 0,fullWidth:!0,isLoading:s};return o&&e?.button_color===Sm.SECONDARY_COLOR?l.jsx(rt,{...C,variant:"super",noPadding:!0}):l.jsx(ze,{...C,variant:m})},[m,u,e?.button_color,e?.button_text,e?.icon_reference,o,s]),b=p||h,_=!b&&e?.cta_information?.secondary_permalink;if(b){const w=[v(!0),p&&x(p,g),h&&x(h,y)].filter(Boolean);return w.length===1?w[0]:l.jsx("div",{className:`gap-md flex ${i?"flex-col":"flex-row"}`,children:i?w:[...w].reverse()})}if(_){const w=e?.cta_information?.secondary_permalink,S=e?.cta_information?.secondary_permalink_new_tab,C=l.jsx(zJ,{url:w,openInNewTab:S,upsellInformation:e});return l.jsx("div",{className:`gap-md flex ${i?"flex-col":"flex-row"}`,children:i?l.jsxs(l.Fragment,{children:[v(!0),C]}):l.jsxs(l.Fragment,{children:[C,v(!0)]})})}return v(!1)});WJ.displayName="UpsellButton";const YLe=Se(()=>Ee(()=>q(()=>Promise.resolve().then(()=>KLe),void 0))),QLe=({icon_reference:e,icon_image:t})=>{if(t)return l.jsx(K,{variant:"subtle",className:"p-xs rounded-md border",children:l.jsx("img",{src:t.url,alt:t.alt,width:40,height:40,className:"rounded"})});const n={pro:l.jsx(ge,{icon:Ks.pro,size:"lg"}),collection:l.jsx(ge,{icon:Ks.collection,size:"lg"}),gmail_gcal:l.jsx(K,{variant:"subtle",className:"p-xs rounded-md border",children:l.jsx("img",{src:Cx,alt:"Gmail Gcal Upsell Banner",width:40,height:40})}),research:l.jsx(ge,{icon:Ks.research,size:"lg"}),labs:l.jsx(ge,{icon:Ks.labs,size:"lg"}),max:l.jsx($d,{size:"tiny",variant:"mark",isMax:!0}),shortcut:l.jsx(ge,{icon:B("square-forbid-2"),size:"lg"}),comet_login:l.jsx(K,{variant:"super",className:"p-xs rounded-md border",children:l.jsx(V,{color:"defaultInverted",children:l.jsx(CM,{size:24})})}),pro_perks:l.jsx(ge,{icon:Ks.pro_perks,size:"lg"}),app:l.jsx(ge,{icon:Ks.app,size:"lg"}),slides:l.jsx(ge,{icon:Ks.slides,size:"lg"}),document:l.jsx(ge,{icon:Ks.document,size:"lg"}),plaintext:l.jsx(ge,{icon:Ks.plaintext,size:"lg"}),canvas:l.jsx(ge,{icon:Ks.canvas,size:"lg"}),browser_agent:l.jsx(Jt,{icon:B("click"),size:"large"}),advanced_models:l.jsx(ge,{icon:Ks.advanced_models,size:"lg"})};return e==="comet_download"?null:n[e||""]||null},Jd=T.memo(({position:e,upsellInformation:t,inFlight:n,isLastResult:r,backendUuid:s,contextUuid:o,queryStr:a,animateExpand:i=!0,hideOnAccept:c=!0,hideOnReject:u=!0,isSkipping:f=!1,onAccept:m,onReject:p,className:h})=>{const{$t:g}=J(),{show:y,handleDismiss:x,handleHide:v}=RLe({position:e,inFlight:n,isLastResult:r,upsellInformation:t,backendUuid:s}),b=d.useCallback(()=>{x({hideBanner:u}),p?.()},[x,p,u]),_=d.useCallback(()=>{x({hideBanner:c}),m?.()},[x,m,c]),S=mn()?.get("handle_upsell");d.useEffect(()=>{if(y&&S){const k=new URLSearchParams(window.location.search);k.delete("handle_upsell");const I=Object.fromEntries(k.entries());fX(I),_()}},[_,y,S]);const C=Vt();if(!y||!t||C&&t.upsell_type===Qs.LOGIN)return null;if(t.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION)return l.jsx(GJ,{upsellInformation:t,show:y,animateExpand:i,inFlight:n,onPermissionResponse:_,hideUpsell:v});if(t.upsell_type===Qs.DAILY_QUESTIONS_FEATURE_ENTRYPOINTS)return l.jsx($J,{type:t.name,actionCards:t.action_cards,show:y,entryUUID:s,contextUUID:o,queryStr:a});const E=QLe(t),N=t.upsell_type!==Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION;return l.jsx(kt,{children:l.jsx(Te.div,{initial:i?{height:0}:{opacity:0},animate:i?{height:"auto"}:{opacity:1},exit:i?{height:0}:{opacity:0},transition:{duration:.2},children:l.jsx("div",{className:"bg-base",children:l.jsxs(K,{variant:t.background_super?"superLight":"subtler",className:z("gap-sm mb-md p-md md:gap-md relative flex w-full flex-col items-center rounded-md md:flex-row",{"rounded-xl shadow-xl ring-1":e==="input"||e==="router_steps"},h),children:[E&&l.jsx(V,{color:"default",className:"hidden md:block",children:E}),l.jsxs("div",{className:"md:mr-sm relative flex w-full flex-col",children:[l.jsx(V,{variant:"smallBold",className:z("mr-lg md:mr-0",{"line-clamp-2":t.upsell_type===Qs.CREATE_SHORTCUT}),children:t.title}),l.jsx(V,{variant:"small",color:"light",className:"mb-0 font-normal leading-[1.3]",children:t.description})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col-reverse md:w-auto md:flex-row md:items-center md:justify-end",children:[N&&l.jsx(rt,{text:g({defaultMessage:"Skip",id:"/4tOwTiCH6"}),size:"small",onClick:b,variant:"common",isLoading:f}),t.button_text&&l.jsx(WJ,{upsellInformation:t,inFlight:n,position:e,hideUpsell:v})]})]})})})})});Jd.displayName="ThreadUpsell";const GJ=T.memo(({upsellInformation:e,show:t,animateExpand:n=!0,inFlight:r,onPermissionResponse:s,hideUpsell:o})=>{const a=Tl({upsellInformation:e,inFlight:r,options:{hideUpsell:o}}),i=e?.cta_information?.secondary_button,c=e?.cta_information?.tertiary_button,u=Tl({upsellInformation:i?{...e,cta:i.cta,button_text:i.button_text}:e,inFlight:r,options:{hideUpsell:o}}),f=Tl({upsellInformation:c?{...e,cta:c.cta,button_text:c.button_text}:e,inFlight:r,options:{hideUpsell:o}});return t?l.jsx(kt,{children:l.jsx(Te.div,{initial:n?{height:0}:{opacity:0},animate:n?{height:"auto"}:{opacity:1},exit:n?{height:0}:{opacity:0},transition:{duration:.2},children:l.jsxs(Q0,{title:e.title,description:e.description,leadingAccessory:B("click"),size:"default",children:[c&&l.jsx(Q0.Action,{variant:"text",onClick:()=>{s(),f()},children:c.button_text}),i&&l.jsx(Q0.Action,{variant:"secondary",onClick:()=>{s(),u()},children:i.button_text}),l.jsx(Q0.Action,{variant:"primary",onClick:()=>{s(),a()},children:e.button_text})]})})}):null});GJ.displayName="BrowserAgentPermissionBanner";const $J=T.memo(({actionCards:e,queryStr:t,entryUUID:n,contextUUID:r,show:s,animateExpand:o=!0})=>{const{$t:a}=J(),i=PLe(),{detectedLanguages:c}=VJ({clickedPhrase:i[0]??"",entryUUID:n??"",contextUUID:r??"",translatePhrases:i}),{isMobileStyle:u}=Re(),f=Ho().openModal,m=d.useRef(null),p=d.useRef(null),h=d.useCallback((x,v)=>{const b={[nn.LANGUAGE_LEARNING_FLASHCARDS]:"flashcards",[nn.LANGUAGE_LEARNING_VOICE_TUTOR]:"voice_tutor"},_=wt.getItem(h6),w=x==="LANGUAGE_LEARNING_FLASHCARDS"?_?_==="true":!0:!1;f(YLe,{legacyIdentifier:"translationModal",stringBounds:v.current?.getBoundingClientRect()??new DOMRect,string:i[0]??"",entryUUID:n??"",contextUUID:r??"",queryStr:t??"",translatePhrases:i,isMobileStyle:u,autoplay:w,initialWidth:window.innerWidth,defaultMode:b[x]})},[i,u,n,r,t,f]),g=d.useMemo(()=>c?{[nn.LANGUAGE_LEARNING_FLASHCARDS]:{text:a({defaultMessage:"Flash Cards",id:"t0yioEPoC6"}),subtext:a({defaultMessage:"Practice {language} with audio flash cards",id:"ZRcObnW+uj"},{language:c.learning_language}),onClick:()=>h(nn.LANGUAGE_LEARNING_FLASHCARDS,m),ref:m},[nn.LANGUAGE_LEARNING_VOICE_TUTOR]:{text:a({defaultMessage:"Voice Tutor",id:"rWFec/0yfN"}),subtext:a({defaultMessage:"Learn how to pronounce {language} words out loud.",id:"IXEyZm0BqT"},{language:c.learning_language}),onClick:()=>h(nn.LANGUAGE_LEARNING_VOICE_TUTOR,p),ref:p}}:null,[c,h,a]),y=d.useMemo(()=>g?e.map(x=>{const v=g[x.cta];return v?l.jsx(Ct,{variant:"text",onClick:v.onClick,ref:v.ref,children:l.jsxs("div",{className:"gap-xs flex flex-col items-start",children:[l.jsx(V,{variant:"smallBold",children:v.text}),l.jsx(V,{variant:"small",color:"light",children:v.subtext})]})},x.cta):null}):null,[e,g]);return!c||!s?null:l.jsx(kt,{children:l.jsxs(Te.div,{initial:o?{height:0}:{opacity:0},animate:o?{height:"auto"}:{opacity:1},exit:o?{height:0}:{opacity:0},transition:{duration:.2},className:"gap-xs flex flex-col",children:[l.jsx(V,{variant:"baseSemi",children:a({defaultMessage:"More ways to learn {language}",id:"R68m2bFJEK"},{language:c.learning_language})}),l.jsx("div",{className:"gap-xs flex",children:y})]})})});$J.displayName="DailyQuestionsEntrypointsBanner";function XLe(e){const{sourceType:t,skippedSources:n}=e;return!(!t||n.has(t))}const dI="/static/images/agent-favicons/gmail.svg",ZLe="/static/images/data-connectors/microsoft/outlook-avatar.svg",Ri={click:{message:W({defaultMessage:"Clicking",id:"n43/KMHgLD"}),icon:B("click")},paused:{message:W({defaultMessage:"Paused",id:"C2iTEHtK//"}),icon:B("pointer-pause")},fill:{message:W({defaultMessage:"Filling out a form",id:"5i0X5DesMM"}),icon:B("forms")},search:{message:W({defaultMessage:"Searching",id:"IfE0if3ytt"}),icon:B("search")},search_images:{message:W({defaultMessage:"Searching for images",id:"NaBAkNUPuD"}),icon:B("search")},navigate:{message:W({defaultMessage:"Navigating",id:"3O6LMNhb0M"}),icon:B("location")},press_key:{message:W({defaultMessage:"Pressing key",id:"R6bmgzv6Xs"}),icon:B("keyboard")},key:{message:W({defaultMessage:"Pressing key",id:"R6bmgzv6Xs"}),icon:B("keyboard")},scroll_page:{message:W({defaultMessage:"Scrolling",id:"/UUUqdefcb"}),icon:B("square-rounded-arrow-down")},scroll:{message:W({defaultMessage:"Scrolling",id:"/UUUqdefcb"}),icon:B("square-rounded-arrow-down")},reasoning:{message:W({defaultMessage:"Reasoning",id:"Aw3qRf7hyO"}),icon:B("bubble-text")},considering_clarification:{message:W({defaultMessage:"Considering your clarification",id:"xvwGmM2LU3"}),icon:B("bubble-text")},working:{message:W({defaultMessage:"Working",id:"gAR0atqpRn"}),icon:B("access-point")},finished:{message:W({defaultMessage:"Done",id:"JXdbo8Vnlw"}),icon:B("check")},reading:{message:W({defaultMessage:"Reading",id:"MOK/yKIpYX"}),icon:B("file-text")},reading_browser:{message:W({defaultMessage:"Reviewing your tabs and browser history",id:"P+tFAY9IRT"}),icon:B("file-text")},getting_source:{message:W({defaultMessage:"Getting source",id:"Z1eFpRpq7v"}),icon:B("file-text")},getting_sources:{message:W({defaultMessage:"Getting sources",id:"Jv/OJ6AjyO"}),icon:B("file-text")},reviewing_source:{message:W({defaultMessage:"Reviewing source",id:"ymFEF2YHhs"}),icon:B("file-text")},reviewing_sources:{message:W({defaultMessage:"Reviewing sources",id:"/NZJDBzKok"}),icon:B("file-text")},reviewing_memory:{message:W({defaultMessage:"Reviewing memory",id:"piUVOodSmM"}),icon:B("file-text")},reviewing_memories:{message:W({defaultMessage:"Reviewing memories",id:"VgUfUXIIey"}),icon:B("file-text")},reviewing_conversation_history:{message:W({defaultMessage:"Reviewing past queries",id:"RfG7EQT3IO"}),icon:B("file-text")},reading_tabs:{message:W({defaultMessage:"Reviewing your tabs",id:"cE3TzCT3eK"}),icon:B("file-text")},building_app:{message:W({defaultMessage:"Building application",id:"qK6gEQyvil"}),icon:B("tools")},creating_chart:{message:W({defaultMessage:"Creating chart",id:"yc5YxtS5VS"}),icon:B("graph")},creating_pdf:{message:W({defaultMessage:"Creating PDF",id:"NcD2ia4Hrn"}),icon:B("file-type-pdf")},creating_docx:{message:W({defaultMessage:"Creating DOCX",id:"GIUtasyzkA"}),icon:B("file-type-docx")},creating_xlsx:{message:W({defaultMessage:"Creating XLSX",id:"ZyT2MB8/KD"}),icon:B("file-spreadsheet")},thinking:{message:W({defaultMessage:"Thinking",id:"AHQWDTo4+e"}),icon:B("bubble-text")},reading_history:{message:W({defaultMessage:"Reviewing your browser history",id:"7cZkJ7qeNW"}),icon:B("world-search")},searching_browser:{message:W({defaultMessage:"Searching your browser",id:"i91D1hXua6"}),icon:B("world-search")},searching_open_tabs:{message:W({defaultMessage:"Searching open tabs",id:"xHbSQOjdLq"}),icon:B("input-search")},opening_tab:{message:W({defaultMessage:"Opening tab",id:"ySnoI+lduZ"}),icon:B("browser-plus")},closing_tabs:{message:W({defaultMessage:"Closing your tabs",id:"2KnXtfjRKV"}),icon:B("browser-minus")},searching_gmail:{message:W({defaultMessage:"Searching your email",id:"X1ami4cm1T"}),icon:B("mail-search")},emailing:{message:W({defaultMessage:"Emailing",id:"QRygokyD+u"}),icon:B("mail-search")},searching_calendar:{message:W({defaultMessage:"Searching your calendar",id:"nH9G8cL0Ys"}),icon:B("calendar-search")},conclusion:{message:W({defaultMessage:"Wrapping up",id:"DN3hjkyzeT"}),icon:null},generating_images:{message:W({defaultMessage:"Generating",id:"NAZfqr2apb"}),icon:B("photo-bolt")},presenting_images:{message:W({defaultMessage:"Presenting",id:"BlxYo7+tmK"}),icon:B("slideshow")},grouping_tabs:{message:W({defaultMessage:"Grouping tabs",id:"Fg6l7eg2HV"}),icon:B("server-bolt")},ungrouping_tabs:{message:W({defaultMessage:"Ungrouping tab groups",id:"dbpFCBu2NQ"}),icon:B("server-off")},searching_tab_groups:{message:W({defaultMessage:"Searching tab groups",id:"V+4/ioYMPd"}),icon:B("search")},getting_freebusy:{message:W({defaultMessage:"Checking availability",id:"ZamRNp2QgI"}),icon:B("calendar-search")},getting_user_info:{message:W({defaultMessage:"Searching your contacts",id:"gPpZJKZdnL"}),icon:B("address-book")},found_contacts:{message:W({defaultMessage:"Found contacts",id:"2zmZgbYnmk"}),icon:B("address-book")},no_contacts_found:{message:W({defaultMessage:"No contacts found",id:"JhY7bAH15Y"}),icon:B("address-book")},selecting_contacts:{message:W({defaultMessage:"Selecting contacts",id:"OQhQc1Jomc"}),icon:B("address-book")},getting_contact_details:{message:W({defaultMessage:"Getting contact details",id:"p391mWkGfv"}),icon:B("address-book")},scheduling:{message:W({defaultMessage:"Scheduling",id:"5lQx5rgTEW"}),icon:B("calendar-plus")},scheduled:{message:W({defaultMessage:"Scheduled",id:"cXAlMRerxW"}),icon:B("calendar-plus")},reading_events:{message:W({defaultMessage:"Getting event details",id:"0QgD+ftRet"}),icon:B("calendar-search")},reading_emails:{message:W({defaultMessage:"Reviewing emails",id:"f/yAuwo+Vl"}),icon:B("mail-search")},OPEN_TAB:{message:W({defaultMessage:"Open tabs",id:"KO2pxljl8b"}),icon:B("browser-plus")},RECENTLY_CLOSED_TAB:{message:W({defaultMessage:"Recently closed tabs",id:"GrcBtKIzPh"}),icon:B("browser-minus")},BROWSER_HISTORY:{message:W({defaultMessage:"Browser history",id:"DtBSny6kw5"}),icon:B("world-search")},MCP_TOOL:{message:W({defaultMessage:"Connecting to {appName}",id:"w+iLkzBJV0"}),icon:B("tools")},searching_flights:{message:W({defaultMessage:"Searching flights",id:"9+i0zI94jg"}),icon:B("search")},reviewing_booking_options:{message:W({defaultMessage:"Reviewing options",id:"hEF13crkAK"}),icon:B("search")},looking_for_booking_options:{message:W({defaultMessage:"Looking for booking options",id:"KIKXHtHJvz"}),icon:B("search")},redirecting_to_booking:{message:W({defaultMessage:"Redirecting to booking site",id:"y/a1lYMfGW"}),icon:B("search")},setting_up_price_alert_automation:{message:W({defaultMessage:"Setting up PriceAlertAutomation",id:"+7IqVk27BT"}),icon:B("graph")},read_page:{message:W({defaultMessage:"Reading page",id:"eEZaxWqt5u"}),icon:B("file-text")},get_page_text:{message:W({defaultMessage:"Getting page text",id:"rZqPh2Mfgi"}),icon:B("file-text")},tabs_context:{message:W({defaultMessage:"Getting tab context",id:"kcCvqWgrPU"}),icon:B("file-text")},tabs_create:{message:W({defaultMessage:"Creating tab",id:"NprxDW5RAN"}),icon:B("browser-plus")},form_input:{message:W({defaultMessage:"Filling form",id:"+gn8Qfhxa/"}),icon:B("forms")},find:{message:W({defaultMessage:"Finding elements",id:"PicRTL+DUk"}),icon:B("search")},find_elements:{message:W({defaultMessage:"Finding elements",id:"PicRTL+DUk"}),icon:B("search")},search_web:{message:W({defaultMessage:"Searching",id:"IfE0if3ytt"}),icon:B("search")},creating_todo_list:{message:W({defaultMessage:"Creating to-do list",id:"ZOeanuIrvQ"}),icon:B("checklist")},updating_todo_list:{message:W({defaultMessage:"Updating to-do list",id:"bb/FiiKtsc"}),icon:B("checklist")},running_sub_tasks:{message:W({defaultMessage:"Running sub-tasks",id:"H8wmfkHGA3"}),icon:B("server-bolt")},left_click:{message:W({defaultMessage:"Clicking",id:"n43/KMHgLD"}),icon:B("click")},right_click:{message:W({defaultMessage:"Right clicking",id:"YAxezKzj4p"}),icon:B("click")},double_click:{message:W({defaultMessage:"Double clicking",id:"anyjKtRL4p"}),icon:B("click")},triple_click:{message:W({defaultMessage:"Triple clicking",id:"aqH53Ke8R4"}),icon:B("click")},left_click_drag:{message:W({defaultMessage:"Dragging",id:"A/Bht8akH/"}),icon:B("click")},type:{message:W({defaultMessage:"Typing",id:"N2bqd9kL1X"}),icon:B("keyboard")},screenshot:{message:W({defaultMessage:"Reading page",id:"eEZaxWqt5u"}),icon:B("file-text")},wait:{message:W({defaultMessage:"Waiting",id:"dZd8H/KE0T"}),icon:B("access-point")},bash:{message:W({defaultMessage:" ",id:"+Q3dd+QA3+"}),icon:B("terminal-2")},file_read:{message:W({defaultMessage:"Reading",id:"MOK/yKIpYX"}),icon:B("file-text")},file_write:{message:W({defaultMessage:"Editing",id:"pBQ5bdyqop"}),icon:B("file-text")},file_edit:{message:W({defaultMessage:"Editing",id:"pBQ5bdyqop"}),icon:B("file-text")}},fI={initial:{opacity:0,position:"absolute",width:"100%"},animate:{opacity:1,position:"relative",transition:{opacity:{duration:1.2}}},exit:{opacity:0,position:"absolute",width:"100%",transition:{opacity:{duration:1.2}}}},JLe=()=>{const{$t:e}=J();return d.useMemo(()=>({success:e({defaultMessage:"Success",id:"xrKHS6mnOh"}),couldNotFinish:e({defaultMessage:"Could not finish",id:"Sz8oY2B0GK"}),allEmail:e({defaultMessage:"All Emails",id:"xe3SFk3aV+"}),allTabs:e({defaultMessage:"All tabs",id:"vYBCIf+wNz"}),failedClosedTabs:e({defaultMessage:"Could not close tabs",id:"hjoQ7gU34V"}),results:e({defaultMessage:"Results",id:"yaMHMBMsQ7"}),continue:e({defaultMessage:"Continue",id:"acrOozm08x"}),skip:e({defaultMessage:"Skip",id:"/4tOwTiCH6"}),foundInfo:e({defaultMessage:"Details retrieved",id:"YCMMMHEIKw"}),allTabGroups:e({defaultMessage:"All tab groups",id:"YL1jEopcqf"}),gmailNotAuthenticated:e({defaultMessage:"Gmail not connected",id:"Zj8MiXlulR"}),googleCalendarNotAuthenticated:e({defaultMessage:"Google Calendar not connected",id:"PH33AilmeW"}),matchesFound:t=>t===0?e({defaultMessage:"No matches found",id:"KeJh7yZCu8"}):e({defaultMessage:"{count, plural, one {One match found} other {# matches found}}",id:"ji6QO7fi7u"},{count:t}),emailsFound:t=>t===0?e({defaultMessage:"No emails found",id:"suW4stNi19"}):e({defaultMessage:"{count, plural, one {# email} other {# emails}}",id:"Rh0ulH+p+5"},{count:t}),eventsFound:t=>t===0?e({defaultMessage:"No events found",id:"GDgEmCHaVM"}):e({defaultMessage:"{count, plural, one {# event} other {# events}}",id:"HhJ8RP7qsx"},{count:t}),availableTimesFound:t=>t===0?e({defaultMessage:"No available times found",id:"2jnY2Ky2Nv"}):e({defaultMessage:"{count, plural, one {# available time} other {# available times}}",id:"5yH+BVFO1f"},{count:t}),selectedContacts:t=>e({defaultMessage:"Selected {count, plural, one {# contact} other {# contacts}}",id:"4kDAeuSFTs"},{count:t}),skippedContacts:e({defaultMessage:"Skipped selecting contacts",id:"IXqYGlHPpF"}),noAvailabilityFound:e({defaultMessage:"No availability",id:"x2vleFRn/L"})}),[e])},eFe=({tool_input_content:e})=>{const t=ln(),n=e.tool_input?.subagent_tool_inputs?.subagents;return n?l.jsx(K,{className:"gap-y-md flex flex-col",children:n.filter(r=>r.task_uuid).map((r,s)=>{const o=e.subagent_steps?.[r.task_uuid]?.steps;return o?l.jsxs("div",{className:"rounded-lg border p-4 transition-colors duration-150",onClick:async()=>{await t.moveThreadToSidecar({activeTaskUuid:r.task_uuid,isSubagent:!0,reason:"move-subagent-step"})},children:[r.description&&l.jsx(V,{className:"mb-3",children:r.description}),o[o.length-1]?.thought&&l.jsx(V,{color:"light",variant:"small",children:o[o.length-1]?.thought})]},s):null})}):null};var Fc;(function(e){e.PENDING="pending",e.IN_PROGRESS="in_progress",e.COMPLETED="completed"})(Fc||(Fc={}));function tFe(e){switch(e){case Fc.COMPLETED:return{icon:B("circle-check"),iconClassName:"text-quietest mb-0.5",textColor:"ultraLight",textClassName:"line-through"};case Fc.IN_PROGRESS:return{icon:B("circle-arrow-right"),iconClassName:"text-quiet mb-0.5",textColor:"light",textClassName:void 0};case Fc.PENDING:return{icon:B("circle"),iconClassName:"text-quiet mb-0.5",textColor:"light",textClassName:void 0};default:Ft(e)}}const qJ=({todos:e})=>l.jsx("div",{className:"bg-offset p-md rounded-xl",children:l.jsx("div",{className:"gap-xs flex flex-col",children:e.map((t,n)=>{const r=t.status??Fc.PENDING,s=r===Fc.IN_PROGRESS&&t.active_form?t.active_form:t.content??"",{icon:o,iconClassName:a,textColor:i,textClassName:c}=tFe(r);return l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ge,{icon:o,size:"sm",className:a}),l.jsx(V,{variant:"small",color:i,className:c,children:s})]},`${s}-${n}`)})})});qJ.displayName="TodoListStep";const Is=` -`;function KJ({baseInstructions:e,additionalInstructions:t}){let n=e+Is;return t&&(n+=t),n}function mI({prompt:e,baseInstructions:t}){if(!e||!t)return"";const n=e.replace(/\\n/g,Is),r=t.replace(/\\n/g,Is),s=r+Is;if(n.startsWith(s))return n.slice(s.length);if(n.startsWith(r)){const i=n.slice(r.length);if(i.startsWith(Is))return i.slice(Is.length);if(i.trim()==="")return""}return n.startsWith(r)?"":n}function nFe(e){const t=e.split(Is),n=t[0]||"",r=t.length>1?t.slice(1).join(Is):"";return{baseInstructions:n,additionalInstructions:r}}function rFe(e,t){let n=e;for(const[r,s]of Object.entries(t))n=n.replaceAll(r,s);return n}function pI({rawInstructions:e,symbol:t,quoteName:n="",eventValue:r,direction:s}){return rFe(e,{"\\\\n":` -`,"{symbol}":t,"{quoteName}":n,"{{event_value}}":r,"{{direction}}":s})}function YJ({prompt:e,symbol:t,quoteName:n=""}){if(!t||!e)return"";let r=e;r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1));const s="Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent {{direction}} to {{event_value}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.",o="Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent {{event_value}}% {{direction}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.";let a=r;if(a.startsWith(s+Is))a=a.slice((s+Is).length);else if(a.startsWith(o+Is))a=a.slice((o+Is).length);else if(a===s||a===o)return"";if(a.includes(Is)){const i=a.split(Is);a=i[i.length-1]??a}return a}function CE({selectedSymbol:e,symbol:t,quote:n,isLoading:r=!1,alertType:s,priceValue:o,percentValue:a,currencySymbol:i,$t:c}){const u=e??t,f=n?.name?` (${n.name})`:"",m=d.useMemo(()=>s==="price"?sFe({symbol:u,quoteName:f,priceValue:o,currencySymbol:i,$t:c}):oFe({symbol:u,quoteName:f,percentValue:a,$t:c}),[s,u,f,o,i,c,a]),p=d.useMemo(()=>!u||!n?"":s==="price"?Fv({symbol:u,quoteName:f}):Bv({symbol:u,quoteName:f}),[u,n,s,f]),h=!r&&n?.name;return d.useMemo(()=>({shouldShowDisplayInstructions:h,displayInstructions:m,baseInstructions:p,effectiveSymbol:u,quoteName:f}),[p,m,u,f,h])}function Fv({symbol:e,quoteName:t,$t:n}){return n?n({id:"0J1c9pn78+",defaultMessage:"Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent '{{direction}}' to '{{event_value}}'. Contextualize this price movement within the last few weeks of price movement and investor narrative."},{symbol:e||"",quoteName:t||""}):`Explain the factors driving the latest movement of ${e}${t||""}, including its recent {{direction}} to {{event_value}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.`}function Bv({symbol:e,quoteName:t,$t:n}){return n?n({id:"9XAm3nfaVB",defaultMessage:"Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent '{{event_value}}%' '{{direction}}'. Contextualize this price movement within the last few weeks of price movement and investor narrative."},{symbol:e||"",quoteName:t||""}):`Explain the factors driving the latest movement of ${e}${t||""}, including its recent {{event_value}}% {{direction}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.`}function sFe({symbol:e,quoteName:t,priceValue:n,currencySymbol:r,$t:s}){if(!e)return s({id:"39tYCstx5d",defaultMessage:"Explain the factors driving the latest movement of this asset, including its recent rise/fall. Contextualize this price movement within the last few weeks of price movement and investor narrative."});const o=n&&n!=="$"?s({defaultMessage:" to {currencySymbol}{priceValue}",id:"zSy/VeEpR9"},{priceValue:n,currencySymbol:r}):"",a=s({defaultMessage:"rise/fall",id:"+dqzTFX/gy"});return Fv({symbol:e,quoteName:t,$t:s}).replace(" to {{event_value}}",o).replace("{{direction}}",a)}function oFe({symbol:e,quoteName:t,percentValue:n,$t:r}){if(!e)return r({id:"pP0ylRs8IX",defaultMessage:"Explain the factors driving the latest movement of this asset, including its recent increase/decrease. Contextualize this price movement within the last few weeks of price movement and investor narrative."});const s=r({id:"QBY86oKDNP",defaultMessage:"increase/decrease"});return Bv({symbol:e,quoteName:t,$t:r}).replace(" {{event_value}}%",n?` ${parseFloat(n).toFixed(2)}%`:"").replace("{{direction}}",s)}const Vl=1e9,Hl=-1e9;function SE({symbol:e,alertType:t,priceValue:n,priceThreshold:r,percentValue:s,positiveSelected:o=!0,negativeSelected:a=!0,baseInstructions:i,additionalInstructions:c=""}){let u,f="";if(t==="price"){if(!n||!r)return null;const p=parseFloat(n.replace(/[^0-9.]/g,""));if(isNaN(p))return null;u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_TARGET",value_lower_bound:r==="below"?p:Hl,value_upper_bound:r==="above"?p:Vl},f=`Alert when ${e} is ${r} ${n}`}else if(t==="movement"){if(!s)return null;const p=parseFloat(s);if(isNaN(p))return null;o&&a?(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:-p,value_upper_bound:p},f=`Alert when ${e} moves +${s}% or -${s}% in a day`):o?(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:Hl,value_upper_bound:p},f=`Alert when ${e} moves +${s}% in a day`):a&&(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:-p,value_upper_bound:Vl},f=`Alert when ${e} moves -${s}% in a day.`)}if(!u)return null;const m=KJ({baseInstructions:i,additionalInstructions:c});return{task_name:f,prompt:m,event_subscription:u,model_preference:"turbo"}}const hI="usd";function Z0(e){return e!=null&&e!==Vl&&e!==Hl&&e!==gR&&e!==-1&&Math.abs(e)!==gR}const Dr=T.memo(({icon:e,text:t,favicon:n,className:r,iconClassName:s,url:o})=>{const a=l.jsx(K,{variant:"subtler",className:z("py-xs inline-block rounded-lg px-2",{"hover:bg-super group cursor-pointer":o},r),children:l.jsxs(V,{variant:"tinyRegular",className:z("gap-x-xs flex items-center",{"group-hover:text-inverse dark:group-hover:text-inverse":o}),children:[n?l.jsx("img",{src:n,alt:t,className:"size-[14px]"}):e?l.jsx(ge,{icon:e,size:"xs",className:s}):null,l.jsx("p",{className:"px-two",children:t})]})});return o?l.jsx(xt,{href:o,target:"_blank",rel:"noopener",children:a}):a});Dr.displayName="BotLabel";const aFe=async(e,t,n)=>{const{data:r,error:s,response:o}=await de.POST("/rest/sse/handle_tool_user_approval_response","mcp-tool-user-approval",{body:{result:{uuid:e,allow_tool_call:t,user_revision:n}}});if(s)throw s;return{data:r,error:s,response:o}},QJ=()=>It({mutationFn:({uuid:e,allowToolCall:t,userRevision:n})=>aFe(e,t,n)}),iFe=async(e,t,n)=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/sse/handle_perplexity_research_clarifying_answers","research-clarifying-questions",{body:{result:{tool_uuid:t,answers:e,submit_type:n}}});if(s){Z.log("Error submitting research clarifying questions:",s);return}return{data:r,error:s,response:o}}catch(r){Z.log(r);return}},lFe=()=>It({mutationFn:({answers:e,toolUuid:t,submitType:n})=>iFe(e,t,n)}),XJ=T.memo(({entryUUID:e,sourceType:t,sourceName:n,userApprovalUuid:r,onSkipSourceClicked:s,isAutoDetected:o})=>{const[a,i]=d.useState(!1),{actions:c}=Ot(),{openToast:u}=pn(),{session:f}=je(),{trackEvent:m}=Ke(f),p=J(),h=QJ(),g=d.useCallback(async()=>{i(!0),s?.(),m("query source skipped",{entryUUID:e,sourceType:t,sourceName:n,isAutoDetected:o}),c.addSkippedSource(t);try{await n0e({entryUUID:e,sourceType:t,reason:"skip-source-button"}),r&&h.mutate({uuid:r,allowToolCall:"SKIP_SOURCE"})}catch{u({message:p.formatMessage({defaultMessage:"Failed to skip source",id:"73EQcPTvg9"}),variant:"error",timeout:null}),c.removeSkippedSource(t),i(!1)}},[e,t,n,o,c,u,p,r,h,s,m]);return l.jsx(V,{color:"light",variant:"small",className:"text-pretty",children:l.jsx("div",{className:"relative min-h-[20px] w-full",children:a?l.jsx(Te.div,{initial:"initial",animate:"animate",exit:"exit",variants:fI,children:l.jsx(wr,{variant:"super",as:"div",className:"px-sm flex h-6 items-center",children:l.jsx(Ne,{defaultMessage:"Skipping…",id:"6NU82XTPCI"})})},"skipping-message"):l.jsx(Te.div,{initial:"initial",animate:"animate",exit:"exit",variants:fI,children:l.jsx(ze,{size:"tiny",onClick:g,variant:"common",icon:B("player-track-next"),extraCSS:"rounded-lg",text:l.jsx(Ne,{defaultMessage:"Skip {sourceName}",id:"B0WVL5L6bh",values:{sourceName:n}}),"data-testid":"skip-source-button"})},"skip-button")})})});XJ.displayName="SkipSourceButton";const ZJ=T.memo(({mediaItems:e,className:t})=>{const n=e?.[e?.length-1],r=n?.media_item,s=r?.image||r?.thumbnail,o=d.useMemo(()=>({url:r?.url,name:r?.name}),[r?.name,r?.url]);return n?l.jsxs("div",{className:z("@xs:px-md @xs:pb-md px-sm pb-sm relative flex flex-col gap-1.5",t),children:[l.jsx(kt,{mode:"wait",children:l.jsx(Te.div,{className:"after:ring-subtler @xs:w-20 md:@xs:w-60 relative overflow-hidden rounded after:pointer-events-none after:absolute after:inset-0 after:rounded-md after:ring-1 after:ring-inset after:ring-opacity-50 md:w-full dark:after:ring-0",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeOut"},children:l.jsx($o,{src:r?.thumbnail,lightboxSrc:s,alt:r?.name,origin:o,includeLightBoxModal:!0,rounded:!0,imageClassName:"object-cover w-full text-[0] dark:mix-blend-normal",containerClassName:"h-full w-full",maskClassName:"bg-subtler"})},r?.thumbnail)}),r?.url&&l.jsx("div",{children:l.jsx(xt,{href:r?.url,target:"_blank",children:l.jsx(rt,{icon:B("arrow-up-right"),variant:"common",size:"tiny",text:"Open page",extraCSS:"group",iconClassName:"group-hover:text-super",textClassName:"group-hover:text-super font-normal",noPadding:!0})})})]}):null});ZJ.displayName="StepCardMedia";const jl=(e,t,n)=>{const r=document.createElement(e),[s,o]=Array.isArray(t)?[void 0,t]:[t,n];return s&&Object.assign(r,s),o?.forEach(a=>r.appendChild(a)),r},cFe=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},uFe=e=>e.offsetWidth>0&&e.offsetHeight>0,dFe=(e,t)=>{customElements.get(e)!==t&&customElements.define(e,t)};function fFe(e,t,{reverse:n=!1}={}){const r=e.length;for(let s=n?r-1:0;n?s>=0:s`${y}:${u[y]=(u[y]??-1)+1}`;let m="",p=!1,h=!1;for(const y of s){m+=y.value;const x=y.type==="minusSign"||y.type==="plusSign"?"sign":y.type;x==="integer"?(p=!0,a.push(...y.value.split("").map(v=>({type:x,value:parseInt(v)})))):x==="group"?a.push({type:x,value:y.value}):x==="decimal"?(h=!0,i.push({type:x,value:y.value,key:f(x)})):x==="fraction"?i.push(...y.value.split("").map(v=>({type:x,value:parseInt(v),key:f(x),pos:-1-u[x]}))):(p||h?c:o).push({type:x,value:y.value,key:f(x)})}const g=[];for(let y=a.length-1;y>=0;y--){const x=a[y];g.unshift(x.type==="integer"?{...x,key:f(x.type),pos:u[x.type]}:{...x,key:f(x.type)})}return{pre:o,integer:g,fraction:i,post:c,valueAsString:m,value:typeof e=="string"?parseFloat(e):e}}const pFe=String.raw,hFe=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),gFe=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),gI=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,_2="--_number-flow-d-opacity",g6="--_number-flow-d-width",w2="--_number-flow-dx",y6="--_number-flow-d",yFe=(()=>{try{return CSS.registerProperty({name:_2,syntax:"",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:w2,syntax:"",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:g6,syntax:"",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:y6,syntax:"",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),xFe="var(--number-flow-char-height, 1em)",fl="var(--number-flow-mask-height, 0.25em)",yI=`calc(${fl} / 2)`,EE="var(--number-flow-mask-width, 0.5em)",gc=`calc(${EE} / var(--scale-x))`,J0="#000 0, transparent 71%",xI=pFe`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${xFe} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${g6}) / var(--width));transform:translateX(var(${w2})) scaleX(var(--scale-x));margin:0 calc(-1 * ${EE});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${gc},#000 calc(100% - ${gc}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${fl},#000 calc(100% - ${fl}),transparent 100% ),radial-gradient(at bottom right,${J0}),radial-gradient(at bottom left,${J0}),radial-gradient(at top left,${J0}),radial-gradient(at top right,${J0});-webkit-mask-size:100% calc(100% - ${fl} * 2),calc(100% - ${gc} * 2) 100%,${gc} ${fl},${gc} ${fl},${gc} ${fl},${gc} ${fl};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${yI} ${EE};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${w2})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${y6})}.digit__num,.number .section::after{padding:${yI} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${_2}))}`,vFe=HTMLElement,bFe=gFe&&hFe&&yFe;let e1,JJ=class extends vFe{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:s,fraction:o,post:a,value:i}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,i):this.trend,this.computedAnimated=bFe&&this._animated&&(!this.respectMotionPreference||!(gI!=null&&gI.matches))&&uFe(this),(n=this.plugins)==null||n.forEach(u=>{var f;return(f=u.onUpdate)==null?void 0:f.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:s,fraction:o}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)e1||(e1=new CSSStyleSheet,e1.replaceSync(xI)),this.shadowRoot.adoptedStyleSheets=[e1];else{const c=document.createElement("style");c.textContent=xI,this.shadowRoot.appendChild(c)}this._pre=new bI(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new _Fe(this,s,o),this.shadowRoot.appendChild(this._num.el),this._post=new bI(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};JJ.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};let _Fe=class{constructor(t,n,r,{className:s,...o}={}){this.flow=t,this._integer=new vI(t,n,{justify:"right",part:"integer"}),this._fraction=new vI(t,r,{justify:"left",part:"fraction"}),this._inner=jl("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=jl("span",{...o,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,r=this.el.offsetWidth,s=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[w2]:[`${n}px`,"0px"],[g6]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}},eee=class{constructor(t,n,{justify:r,className:s,...o},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const i=n.map(c=>this.addChar(c).el);this.el=jl("span",{...o,className:`section section--justify-${r} ${s??""}`},a?a(i):i)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const s=t.type==="integer"||t.type==="fraction"?new nee(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new wFe(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${cFe(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,s=this.justify==="left",o=s?"prepend":"append";if(fFe(t,a=>{let i;this.children.has(a.key)?(i=this.children.get(a.key),r.set(a,i),this.unpop(i),i.present=!0):(i=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),n.set(a,i)),this.el[o](i.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();n.forEach(i=>{i.willUpdate(a)})}n.forEach((a,i)=>{a.update(i.value)}),r.forEach((a,i)=>{a.update(i.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}},vI=class extends eee{update(t){const n=new Map;this.children.forEach((r,s)=>{t.find(o=>o.key===s)||n.set(s,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof nee&&r.update(0)}),this.pop(n)}},bI=class extends eee{update(t){const n=new Map;this.children.forEach((r,s)=>{t.find(o=>o.key===s)||n.set(s,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}},kE=class{constructor(t,n,{onRemove:r,animateIn:s=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var o;this.el.remove(),(o=this._onRemove)==null||o.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[_2]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[_2]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}},tee=class extends kE{constructor(t,n,r,s){super(t.flow,r,s),this.section=t,this.value=n,this.el=r}},nee=class extends tee{constructor(t,n,r,s,o){var a,i;const c=(((i=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:i.max)??9)+1,u=Array.from({length:c}).map((m,p)=>{const h=jl("span",{className:"digit__num"},[document.createTextNode(String(p))]);return p!==r&&h.setAttribute("inert",""),h.style.setProperty("--n",String(p)),h}),f=jl("span",{part:`digit ${n}-digit`,className:"digit"},u);f.style.setProperty("--current",String(r)),f.style.setProperty("--length",String(c)),super(t,r,f,o),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],s=n.width/2;this._prevCenter=this.section.justify==="left"?r+s:r-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],s=n.width/2,o=this.section.justify==="left"?r+s:r-s,a=this._prevCenter-o;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const i=this.getDelta();i&&(this.el.classList.add("is-spinning"),this.el.animate({[y6]:[-i,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const o=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(o!=null)return o}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value()=>{this._children.delete(a)},this._children.set(r,new kE(this.flow,o,{onRemove:this._onChildRemove(r)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const r=this._children.get(t);if(r)r.present=!0;else{const s=jl("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new kE(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const CFe=parseInt(d.version.match(/^(\d+)\./)?.[1]),x6=CFe>=19,SFe=["data","digits"];class v6 extends JJ{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}v6.observedAttributes=x6?[]:SFe;dFe("number-flow-react",v6);const EFe={},_I=x6?e=>e:JSON.stringify;function wI(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:s,respectMotionPreference:o,trend:a,plugins:i,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:s,respectMotionPreference:o,trend:a,plugins:i},c]}class kFe extends d.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=wI(this.props);Object.entries(n).forEach(([r,s])=>{this.el[r]=s??v6.defaultProps[r]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),x6&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,n,r){r?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:s,willChange:o,isolate:a,group:i,digits:c,onAnimationsStart:u,onAnimationsFinish:f,...m}]=wI(this.props);return d.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":o?"":void 0,class:r,...m,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:_I(c),data:_I(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const jp=d.forwardRef(function({value:t,locales:n,format:r,prefix:s,suffix:o,...a},i){d.useImperativeHandle(i,()=>c.current,[]);const c=d.useRef(),u=d.useContext(MFe);u?.useRegister(c);const f=d.useMemo(()=>n?JSON.stringify(n):"",[n]),m=d.useMemo(()=>r?JSON.stringify(r):"",[r]),p=d.useMemo(()=>{const h=EFe[`${f}:${m}`]??=new Intl.NumberFormat(n,r);return mFe(t,h,s,o)},[t,f,m,s,o]);return d.createElement(kFe,{...a,group:u,data:p,innerRef:c})}),MFe=d.createContext(void 0),ree=d.memo(({count:e,className:t})=>l.jsx(K,{className:z("flex select-none items-center pt-px text-center font-mono text-xs tabular-nums leading-none",t),as:"span",children:l.jsx(jp,{value:e})}));ree.displayName="AnimatedCounter";const Jf=T.memo(({favicon:e,description:t,descriptionClassName:n,title:r,descriptionFooter:s,count:o,url:a,media:i,children:c,className:u,showMedia:f=!0,onClick:m,isMissionControlSummary:p,accessory:h})=>{const g=f&&i&&i.length>0;return l.jsxs(K,{variant:"raised",className:z("@container group/step-card relative isolate flex flex-col gap-1.5 overflow-hidden rounded-xl border shadow-sm",u),onClick:m,children:[h&&l.jsx("div",{className:"absolute right-2 top-2",children:h}),(r||e)&&l.jsxs("div",{className:"@xs:px-md px-sm @xs:pt-3 @xs:gap-3 gap-sm flex min-w-0 items-center pt-2",children:[a&&e?l.jsx(xt,{href:a,target:"_blank",rel:"noopener",className:"@xs:size-4 inline-flex size-3 shrink-0 items-center justify-center overflow-hidden rounded",children:e}):e,l.jsxs("div",{className:"@xs:text-sm flex min-w-0 flex-1 items-baseline text-xs",children:[r&&l.jsx("div",{className:"relative flex min-w-0 flex-1",children:l.jsx(V,{variant:"tiny",className:"@xs:text-sm min-w-0 flex-1 truncate",children:r})}),o&&l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("span",{className:"px-xs ml-px leading-none opacity-35",children:"·"}),l.jsx(ree,{count:o,className:"opacity-65"})]})]})]}),l.jsxs("div",{className:"@xs:gap-sm @xs:flex-row flex flex-col gap-0",children:[l.jsxs("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[t&&l.jsx(l.Fragment,{children:p?l.jsx(see,{description:t}):l.jsx(V,{variant:"tinyRegular",className:z("px-md @xs:text-sm text-pretty",e?"@xs:ml-7 ml-4":void 0,n),children:t})}),s&&l.jsx("div",{className:"px-md @xs:ml-7 ml-4",children:s}),c]}),g&&l.jsx(ZJ,{mediaItems:i})]})]})});Jf.displayName="StepCard";const see=T.memo(({description:e})=>{const[t,n]=d.useState(!1),{$t:r}=J(),s=d.useCallback(o=>{o.stopPropagation(),n(!t)},[t]);return l.jsxs(V,{variant:"tinyRegular",className:z("px-md mb-sm @xs:text-sm @xs:ml-7 relative ml-4 line-clamp-2 text-pretty",t&&"line-clamp-none"),children:[l.jsxs("span",{className:z("relative",{"select-none":!t}),children:[e,t&&l.jsxs(V,{inline:!0,variant:"tinyRegular",color:"light",className:"hover:text-super inline-flex select-none items-center opacity-0 group-hover/step-card:opacity-100",onClick:s,children:[" ",r({id:"mFYgAXM/x4",defaultMessage:"Less"}),l.jsx(ge,{icon:B("chevron-up"),size:"xs"})]})]}),!t&&l.jsxs(l.Fragment,{children:[l.jsx(K,{className:"absolute inset-0",variant:"raised",style:{maskImage:"linear-gradient(to bottom, transparent 0%, black 100%)"}}),l.jsxs(V,{variant:"tinyRegular",color:"light",className:"right-md hover:text-super bg-raised pl-xs absolute bottom-0 hidden translate-x-2 select-none items-center group-hover/step-card:inline-flex",onClick:s,children:[r({id:"I5NMJ8llIi",defaultMessage:"More"}),l.jsx(ge,{icon:B("chevron-down"),size:"xs"})]})]})]})});see.displayName="ExpandableDescription";function TFe({scrollContainerRef:e,autoScroll:t=!1,children:n}){const[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useCallback(()=>{const c=e.current;if(!c)return;const u=Math.abs(c.scrollTop),f=Math.max(0,c.scrollHeight-c.clientHeight),m=f>0;t?(s(m&&u0)):(s(m&&u>0),a(m&&u{i()},[i]),d.useEffect(()=>{const c=e.current;if(c)return c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)},[i,e]),d.useEffect(()=>{i();const c=e.current;if(!c)return;const u=new MutationObserver(i);return u.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>u.disconnect()},[n,i,e]),d.useMemo(()=>({canScrollUp:r,canScrollDown:o}),[r,o])}const AFe=220,CI=24,SI=16,Ng=T.memo(({children:e,className:t,scrollContainerClassName:n,maxHeight:r=AFe,showTopGradient:s=!0,showBottomGradient:o=!0,autoScroll:a=!0,topGradientOffset:i=0})=>{const c=d.useRef(null),{canScrollUp:u,canScrollDown:f}=TFe({scrollContainerRef:c,autoScroll:a,children:e}),m=d.useMemo(()=>{if(i>0){const h=s&&u,g=o&&f;if(!h&&!g)return{};let y;if(h&&g){const x=i+CI,v=`calc(100% - ${SI}px)`;y=`linear-gradient(180deg, black 0, black ${i}px, transparent ${i}px, black ${x}px, black ${v}, transparent 100%)`}else if(h){const x=i+CI;y=`linear-gradient(180deg, black 0, black ${i}px, transparent ${i}px, black ${x}px, black 100%)`}else y=`linear-gradient(180deg, black 0, black calc(100% - ${SI}px), transparent 100%)`;return{maskImage:y}}return{}},[u,f,i,s,o]),p=d.useMemo(()=>{if(i>0)return"";const h=s&&u,g=o&&f;return h&&g?"mask-fade-v-6":h?"mask-fade-t-6":g?"mask-fade-b-4":""},[u,f,i,s,o]);return l.jsx(K,{className:z("relative",t),children:l.jsx("div",{ref:c,className:z(a?"flex-col-reverse":"flex-col","scrollbar-subtle pb-sm relative flex overflow-y-auto pl-3 pr-1 [scrollbar-gutter:stable]",n,p),style:{maxHeight:r,...m},children:e})})});Ng.displayName="StepCardScrollableContent";const NFe=({wrapperClassName:e,variant:t="default",size:n="default",errorText:r,className:s,value:o,maxLength:a,errorMessage:i,disabled:c=!1,hasShadow:u=!1,autoFocus:f=!1,placeholder:m="",rightItems:p=Ie,onChange:h,onClear:g,onClick:y,onBlur:x,onFocus:v,onKeyDown:b,onPaste:_,isLoading:w,inlineEditBlock:S,label:C,subtitle:E,isOptional:N,minRows:k,isMobileUserAgent:I,allowEnterNewlines:M=!1,testId:A,textAreaClassname:D,ref:P})=>{const F=ec(c),R=d.useRef(null),[j,L]=d.useState(!1),[U,O]=d.useState(!1),$=d.useRef(j);$.current=j,d.useEffect(()=>{!I&&f&&R.current?.focus()},[I,R,f]),d.useEffect(()=>{F!==c&&!c&&!I&&f&&setTimeout(()=>{R.current?.focus()},200)});const G=d.useMemo(()=>z({"border-r mr-sm pr-xs border-subtler":p.length!=0}),[p.length]),H=z("overflow-auto max-h-[50vh] outline-none w-full flex items-center","text-foreground font-sans resize-none","bg-transparent placeholder-quieter","caret-super selection:bg-super/50 dark:selection:bg-super/10 dark:selection:text-super",D),Q=d.useMemo(()=>{const _e=(()=>{switch(t){case"subtle":return"bg-subtle";case"default":return"bg-base dark:bg-subtler";default:Ft(t)}})(),ke=z("w-full focus:ring-subtler flex items-center",_e,"border border-subtler focus:ring-1 rounded-md","duration-200 transition-all",{"ring-subtler ring-1":j,"shadow-sm":u},s),De=z({"py-sm text-sm px-md":n==="default","text-base p-md pb-xl":n==="large"}),Ce=z({"pr-md":p.length===0});return z(ke,De,Ce)},[j,u,s,n,p.length,t]),Y=i!==void 0,te=!Y&&!!a&&!!o&&o.length>a,se=d.useMemo(()=>l.jsxs("div",{className:"right-sm gap-sm mb-xs pb-xs absolute bottom-0 flex items-center rounded-full",children:[w?l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("circle-half-2"),className:"aspect-square animate-spin"})}):null,Y&&l.jsx(K,{className:"mr-sm",children:l.jsx(V,{color:"red",variant:"tiny",children:i})}),te&&l.jsx(K,{className:"mr-sm",children:a&&o&&l.jsx(V,{color:"red",variant:"tiny",children:a-o.length})}),g!==void l.jsx("div",{className:G,children:l.jsx(rt,{icon:B("x"),pill:!0,onClick:g,size:Gt.small})}),p.map((_e,ke)=>l.jsx(ze,{..._e.buttonProps,size:Gt.small,disabled:_e.buttonProps.disabled||Y||te,pill:!0},ke))]}),[i,w,a,g,p,o,G,Y,te]),ae=d.useCallback(()=>{if(R.current){const _e=R.current.value.length;R.current.focus(),R.current.setSelectionRange(_e,_e)}},[]),X=d.useCallback(_e=>{if(!R?.current)return!0;const ke=R.current,{selectionStart:De,selectionEnd:Ce,value:Be}=ke;if(De!==Ce)return!1;const we=document.createElement("div"),$e=window.getComputedStyle(ke);we.style.position="absolute",we.style.visibility="hidden",we.style.whiteSpace=$e.whiteSpace,we.style.wordWrap=$e.wordWrap,we.style.font=$e.font,we.style.padding=$e.padding,we.style.border=$e.border,we.style.width=ke.offsetWidth+"px",we.style.lineHeight=$e.lineHeight,document.body.appendChild(we);try{const yt=parseInt($e.lineHeight)||24,me=Be.substring(0,De);we.textContent=me;const ve=we.offsetHeight;return _e==="first"?ve<=yt:(we.textContent=Be,we.offsetHeight-ve{v?.(_e.nativeEvent),L(!0)},[v]),le=d.useCallback(_e=>{x?.(_e.nativeEvent),L(!1)},[x]),re=d.useCallback(_e=>{y?.(_e.nativeEvent)},[y]),ce=d.useCallback(_e=>{h?.(_e.target.value)},[h]),ue=d.useCallback(_e=>{bh(_e.nativeEvent,{isMobileUserAgent:I,isComposing:U,allowEnterNewlines:M,onKeyDown:b})},[b,U,I,M]),pe=d.useCallback(()=>PA(O),[O]),xe=d.useCallback(()=>OA(O),[O]),he=d.useCallback(_e=>{_?.(_e.nativeEvent)},[_]);return d.useImperativeHandle(P,()=>{const _e=R.current;return _e.focusAtEnd=ae,_e.inLine=X,_e.isFocused=()=>$.current,_e.append=ke=>{R.current&&(R.current.value+=ke)},_e.scrollToEnd=()=>{R.current&&(R.current.scrollTop=R.current.scrollHeight)},_e.trim=()=>{R.current&&(R.current.value=R.current.value.trim())},_e},[ae,X]),d.useEffect(()=>{f&&!I&&ae()},[f,ae,I]),l.jsxs("div",{"data-test-id":A,children:[l.jsx(wv,{label:C,subtitle:E,isOptional:N,errorText:r}),l.jsx("div",{className:z("rounded-3xl",e),children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("div",{className:Q,children:l.jsx(tQ,{ref:R,autoFocus:f,placeholder:m,disabled:c,minRows:k,value:o,onClick:re,onChange:ce,name:C,onKeyDown:ue,onBlur:le,onCompositionStart:pe,onCompositionEnd:xe,onFocus:ee,onPaste:he,className:H,autoComplete:"off","data-testid":A})}),l.jsx("div",{className:"absolute bottom-0 m-px flex justify-between rounded-b-md px-[6px]",style:{width:"calc(100% - 2px)"},children:se})]})}),S&&l.jsx("div",{className:"mt-sm flex justify-end",children:S})]})},yu=T.memo(NFe),oee=T.memo(({form_items:e,taskUuid:t})=>{const n=e?.[0]?.text_area_item,r=n?.placeholder,s=n?.text,[o,a]=d.useState(r||""),i="agent-form",c=d.useCallback(async h=>{try{await de.POST("/rest/browser/agent_confirmation",i,{body:{task_uuid:t,status:h,message:o},backOffTime:100,numRetries:2,headers:{"Content-Type":"application/json"}})}catch(g){Z.error("Error sending agent confirmation",g)}},[t,o,i]),{$t:u}=J(),f=d.useCallback(h=>{Ls.isEnterKeyWithoutShift(h)&&c("accept")},[c]),m=d.useCallback(h=>{h.stopPropagation(),c("accept")},[c]),p=d.useCallback(h=>{h.stopPropagation(),c("reject")},[c]);return l.jsxs(K,{className:"flex flex-col gap-3",children:[l.jsx(V,{color:"light",variant:"small",children:s}),l.jsx(yu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:r,value:o,onChange:a,onKeyDown:f}),l.jsxs("div",{className:"gap-sm py-sm flex items-center",children:[l.jsx(ze,{size:"small",variant:"inverted",text:u({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit",disabled:!1,onClick:m}),l.jsx(rt,{size:"small",text:u({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:p})]})]})});oee.displayName="AgentForm";const Di=T.memo(e=>{const{isFinished:t,className:n,count:r,showAnimation:s,isPaused:o,...a}=e,i=J(),c=e.action&&Ri[e.action]?i.formatMessage(Ri[e.action].message):"",u=e.action?e.title?`${c}${e.title}`:c:e.title,f=e.action?Ri[e.action]?.icon:e.icon,m=t||o;return l.jsx(kt,{mode:"popLayout",children:l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:s?0:.2,ease:"easeInOut"},className:z("gap-sm group flex cursor-pointer flex-col",n),children:l.jsxs(V,{variant:"tinyRegular",color:t?"light":"super",className:"flex items-center gap-1 py-1.5",children:[f&&l.jsx(ge,{icon:f,size:"2xs",className:"-mt-px opacity-80"}),l.jsxs(wr,{variant:"super",active:!m,as:"span",speed:"slow",children:[u,r!==void 0&&r>0&&` · ${r}`]})]})},a.key)})});Di.displayName="StepActionLabel";const RFe=1e3,aee=T.memo(({message:e,isFinished:t,isPaused:n,isPendingClarification:r})=>{const[s,o]=d.useState(!1),a=d.useRef(e.thought||""),[i,c]=d.useState("working"),u=Io(),{result:f,inFlight:m}=Ot(),p=f?.uuid;d.useEffect(()=>{if(t){o(!1);return}e.thought!==a.current&&(a.current=e.thought,o(!1));const y=setTimeout(()=>{!t&&!e.action&&o(!0)},RFe);return()=>clearTimeout(y)},[e.thought,e.action,t]);const h=!e.action&&!e.thought&&e.url;return d.useEffect(()=>{let y="working";if(t?y="finished":n?y="paused":r?y="considering_clarification":h?y="reasoning":s&&!e.action?y="working":e.action&&e.action in Ri&&(y=e.action),c(y),u&&p&&m){const x=new CustomEvent("comet-agent-step-update",{detail:{stepAction:y,streamId:p}});document.dispatchEvent(x)}},[m,t,h,s,e.action,n,r,u,p]),!t&&(r||e.action||h||s&&!e.action)&&l.jsx(Di,{action:i,isFinished:t,isPaused:n,className:"pl-8"})});aee.displayName="AgentStatusManager";const DFe=({children:e,initial:t=!1,mode:n="wait",className:r,transition:s,supportZeroHeight:o=!0,...a})=>{const[i,{height:c}]=ei(),u=mi(),f=o||c>0?c:"auto";return l.jsx(Te.div,{animate:{height:u?f:"auto"},className:r,transition:s,...a,children:l.jsx("div",{ref:i,children:l.jsx(kt,{mode:n,initial:t,children:e})})})},Yr=tl(.16,1,.3,1),Zbt=tl(.7,0,.84,0),jFe=({children:e,initial:t={opacity:0},animate:n={opacity:1},exit:r,transition:s,className:o,style:a,ref:i})=>l.jsx(Te.div,{initial:t,animate:n,exit:r??t,transition:s,ref:i,className:o,style:a,children:e}),pi=DFe,Fo=jFe,ua=T.memo(({variant:e=zx.subtle,label:t,accessory:n,onClick:r,className:s,size:o="default",textColor:a="default",icon:i,iconUrl:c,iconClassName:u,iconOnly:f=!1,tooltip:m,truncate:p=!1,hover:h=!0,href:g,linkBehavior:y="none",trackEvent:x,forceExternalHandler:v,containerClassName:b})=>{const _=d.useCallback(E=>{y==="external"&&g&&x&&x("click citation",{source:"inline",citation_url:g}),(y!=="external"||v)&&r?.(E)},[r,y,g,x,v]),w=l.jsxs(K,{as:"span",variant:e,className:z("text-3xs rounded-badge group min-w-4 cursor-pointer text-center align-middle font-mono tabular-nums",{"py-[0.1875rem] leading-snug":o==="default","py-[0.175rem] leading-none":o==="small","py-[0.125rem] leading-none":o==="extraSmall"},{"px-[0.3rem]":!f,"inline-block px-[0.1875rem]":f,"[@media(hover:hover)]:hover:bg-super dark:[@media(hover:hover)]:hover:text-inverse [@media(hover:hover)]:hover:text-white":h},b),onClick:y==="external"?void 0:r,children:[c?l.jsx("span",{className:z("-mt-px inline-block align-middle",{"mr-xs":!f},u),children:l.jsx("img",{src:c,alt:"",className:"m-0 size-3 rounded-sm"})}):i?l.jsx(ge,{icon:i,size:"2xs",className:z("-mt-px inline-block align-middle opacity-80",{"mr-xs":!f},u)}):null,l.jsx("span",{ref:E=>{if(E&&p){const N=E.scrollWidth>E.clientWidth;E.style.maskImage=N?"linear-gradient(to right, black 70%, transparent 100%)":""}},className:z("relative -mt-px inline-block align-middle",{"max-w-[25ch] overflow-hidden":p}),children:t}),!!n&&l.jsx("span",{className:"ml-xs -mt-px mr-px inline-block align-middle",children:n})]}),S=m?l.jsx(Oo,{tooltipText:m,tooltipLayout:"top",asChild:!0,children:w}):w,C=l.jsx(V,{as:"span",color:a,className:z("relative -mt-px select-none whitespace-nowrap",{"-top-px":o==="default","-top-[3px] leading-none":o==="small","-top-two leading-none":o==="extraSmall"},s),children:S});return y==="external"&&g?l.jsx(xt,{href:g,target:"_blank",rel:"noopener",className:"inline",onClick:_,children:C}):C});ua.displayName="CitationBubble";const iee=T.memo(({citationUrl:e})=>{const t=d.useCallback(()=>{window.open(e,"_blank","noopener,noreferrer")},[e]);return l.jsx(ua,{icon:B("arrow-up-right"),iconClassName:"-ml-px",className:"animate-in fade-in duration-150",size:"extraSmall",textColor:"light",iconOnly:!0,tooltip:"Open page",onClick:t})});iee.displayName="ExternalCitationBubble";const lee=T.memo(({message:e,task:t})=>{const n=e.url||t.start_url,r=e.url?l.jsx(iee,{citationUrl:n}):null;return l.jsx(Fo,{children:e.thought&&l.jsxs("div",{className:"pl-xs flex gap-3",children:[l.jsx(V,{color:"light",variant:"small",className:"size-4 py-1.5",children:r}),l.jsx(V,{color:"light",variant:"small",className:"py-1.5",children:e.thought})]})})});lee.displayName="MessageItem";const cee=T.memo(({task:e,isFinished:t,isPaused:n})=>{const r=e.agent_messages[e.agent_messages.length-1];return l.jsx(Ng,{children:l.jsxs(pi,{mode:"sync",initial:!1,children:[e.agent_messages.length>0&&e.agent_messages.map((s,o)=>l.jsx(Fo,{children:l.jsx(lee,{message:s,task:e})},o)),l.jsx(Fo,{children:l.jsx("div",{children:l.jsx(aee,{message:e.agent_messages.length>0?r:{action:"working",thought:"",url:"",answer:"",uuid:"",value:""},isFinished:t||e.clarification_status==="STOPPED_TASK",isPaused:n,isPendingClarification:e.clarification_status==="PENDING"})})})]})})});cee.displayName="ScrollableContent";const uee=T.memo(({lastMessage:e,taskUuid:t})=>e.form?l.jsx("div",{className:"px-md py-sm ml-7",children:l.jsx(oee,{form_items:e.form.form_items,taskUuid:t})}):null);uee.displayName="FormContent";const ME=T.memo(({task:e,isFinished:t,index:n,isMissionControl:r})=>{const s=e.agent_messages[e.agent_messages.length-1],o=s?.form,a=e.uuid,{taskScreenshots:{[a]:[i]=[]},tasksState:{[a]:{is_paused:c=!1}={}},taskTabs:u}=zn(),{$t:f}=J(),m=ln(),{result:p}=Ot(),h=d.useMemo(()=>u?.some(E=>E.taskUuid===a)??!1,[u,a]),g=d.useMemo(()=>i?[{media_item:{thumbnail:i,image:i,name:f({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})},task_uuid:a,message_uuid:""}]:Ie,[f,i,a]),y=d.useMemo(()=>l.jsx(Lo,{domain:e.start_url}),[e.start_url]),x=d.useMemo(()=>e.agent_messages.filter(N=>N.screenshot).map(N=>({media_item:{thumbnail:N.screenshot,image:N.screenshot,name:f({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})},task_uuid:e.uuid,message_uuid:""})),[f,e.uuid,e.agent_messages]),v=d.useMemo(()=>o?Ie:e.media&&e.media.length?e.media:x.length?x:g,[o,x,g,e.media]),b=d.useCallback(async E=>{if(!(t&&r&&!h)){if(E.stopPropagation(),t)if(r){if(!h)return}else return;await m.makeTaskVisible(a)}},[m,a,t,r,h,p?.backend_uuid]),_=r&&t,w=e.clarification_status,S=E=>{switch(E){case"UPDATED_TASK":return f({defaultMessage:"Updated per your clarification",id:"UmUpwNXXy9"});case"STOPPED_TASK":return f({defaultMessage:"Stopped per your clarification",id:"Uura7/Ftc2"});default:return""}},C=w&&w!=="PENDING"?l.jsxs(V,{variant:"tinyRegular",className:"gap-xs py-xs text-super flex",children:[l.jsx(ge,{icon:B("info-circle"),size:"xs"}),l.jsx("span",{className:"text-pretty",children:S(w)})]}):null;return l.jsx(Jf,{favicon:y,title:sg(e.start_url),accessory:h&&_?l.jsx(ge,{icon:B("arrow-up-right"),size:"xs",className:"group-hover/step-card:text-super opacity-60 group-hover/step-card:opacity-100"}):void 0,media:v,description:e.task,descriptionFooter:C,showMedia:!o,onClick:b,className:z("border transition-colors duration-150 hover:!transition-none",h&&"hover:border-super/75 group/step-card cursor-pointer"),isMissionControlSummary:_,children:_?null:o&&s&&!t?l.jsx(uee,{lastMessage:s,taskUuid:e.uuid}):l.jsx(cee,{task:e,isFinished:t,isPaused:c})},n)});ME.displayName="TaskStep";const dee=T.memo(({step:e,isFinished:t,isMissionControl:n})=>l.jsx(IFe,{tasks:e.content.tasks,isMissionControl:n,isFinished:t})),IFe=({tasks:e,isMissionControl:t,isFinished:n})=>t&&n&&e.length>1?l.jsx("div",{className:"-mx-sm",children:l.jsx(nl,{orientation:"horizontal",viewportClassName:"px-sm",showScrollIndicator:!1,children:l.jsxs(K,{className:"gap-sm flex flex-row",children:[e.map((s,o)=>l.jsx("div",{className:"w-3/4 shrink-0",children:l.jsx(ME,{task:s,isFinished:n,index:o,isMissionControl:t})},o)),l.jsx("div",{className:"w-px shrink-0"})]})})}):l.jsx(K,{className:"gap-y-md flex flex-col",children:e.map((s,o)=>l.jsx(ME,{task:s,isFinished:n,index:o,isMissionControl:t},o))});dee.displayName="BrowserStep";const fee=T.memo(({disabled:e,onClick:t})=>l.jsx(ze,{disabled:e,onClick:t,icon:B("chevron-left"),variant:"common",size:"small"}));fee.displayName="CardPaginationPrevious";const mee=T.memo(({disabled:e,onClick:t})=>l.jsx(ze,{disabled:e,onClick:t,icon:B("chevron-right"),variant:"common",size:"small"}));mee.displayName="CardPaginationNext";const pee=({contact:e})=>l.jsxs("div",{className:"flex items-center gap-2",children:[e.image&&l.jsx("img",{src:e.image,alt:e.name,className:"size-4 rounded-full",referrerPolicy:"no-referrer"}),l.jsx("span",{className:"text-sm",children:e.name}),e.email&&l.jsx("span",{className:"text-quieter text-sm",children:e.email})]}),PFe=async({query:e,limit:t=10,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/contacts/list-autosuggest",n,{timeoutMs:Ze(),params:{query:{query:e,limit:t}}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get contacts autosuggestions",cause:s,status:o.status??0});return r?.results??[]}catch(r){return Z.error(r),[]}},OFe=({query:e,limit:t=10,reason:n})=>gt({queryKey:be.makeEphemeralQueryKey("contacts",e,t),queryFn:()=>PFe({query:e,limit:t,reason:n}),enabled:e?.trim().length>0,staleTime:120*1e3,gcTime:600*1e3,placeholderData:r=>r});function hee({reason:e,limit:t=10}){const[n,r]=d.useState(""),{data:s}=OFe({query:n,limit:t,reason:e}),o=d.useMemo(()=>Ef(c=>r(c),300),[]);d.useEffect(()=>()=>{o.cancel()},[o]);const a=d.useCallback(c=>{c.trim()===""?(o.cancel(),r("")):o(c)},[o]);return{suggestions:d.useMemo(()=>s?.filter(c=>c.email!==null).map(c=>({key:c.email,value:c.email,item:c})),[s]),handleDraftChange:a}}const mr=T.memo(({children:e,header:t,fullBleed:n,roundedClass:r,shadow:s,fullBleedBorderClassname:o,...a})=>l.jsxs(l.Fragment,{children:[t,l.jsxs(K,{...a,variant:a.variant??"raised",className:z("relative",{border:!n&&!a.variant,[r||"rounded-xl"]:!a.variant,"shadow-[0_1px_2px_0_rgba(0,0,0,0.03)]":s},a.className),children:[n&&l.jsx("div",{className:z("rounded-inherit pointer-events-none absolute inset-0 z-[1] border border-[black]/5 dark:border-[white]/5",o)}),e]})]}));mr.displayName="CanonicalCard";var aa;(function(e){e.GOOGLE_MEET="google_meet",e.MICROSOFT_TEAMS="microsoft_teams",e.ZOOM="zoom"})(aa||(aa={}));const Ra=[{label:"12:00am",value:"12:00am"},{label:"12:30am",value:"12:30am"},{label:"1:00am",value:"1:00am"},{label:"1:30am",value:"1:30am"},{label:"2:00am",value:"2:00am"},{label:"2:30am",value:"2:30am"},{label:"3:00am",value:"3:00am"},{label:"3:30am",value:"3:30am"},{label:"4:00am",value:"4:00am"},{label:"4:30am",value:"4:30am"},{label:"5:00am",value:"5:00am"},{label:"5:30am",value:"5:30am"},{label:"6:00am",value:"6:00am"},{label:"6:30am",value:"6:30am"},{label:"7:00am",value:"7:00am"},{label:"7:30am",value:"7:30am"},{label:"8:00am",value:"8:00am"},{label:"8:30am",value:"8:30am"},{label:"9:00am",value:"9:00am"},{label:"9:30am",value:"9:30am"},{label:"10:00am",value:"10:00am"},{label:"10:30am",value:"10:30am"},{label:"11:00am",value:"11:00am"},{label:"11:30am",value:"11:30am"},{label:"12:00pm",value:"12:00pm"},{label:"12:30pm",value:"12:30pm"},{label:"1:00pm",value:"1:00pm"},{label:"1:30pm",value:"1:30pm"},{label:"2:00pm",value:"2:00pm"},{label:"2:30pm",value:"2:30pm"},{label:"3:00pm",value:"3:00pm"},{label:"3:30pm",value:"3:30pm"},{label:"4:00pm",value:"4:00pm"},{label:"4:30pm",value:"4:30pm"},{label:"5:00pm",value:"5:00pm"},{label:"5:30pm",value:"5:30pm"},{label:"6:00pm",value:"6:00pm"},{label:"6:30pm",value:"6:30pm"},{label:"7:00pm",value:"7:00pm"},{label:"7:30pm",value:"7:30pm"},{label:"8:00pm",value:"8:00pm"},{label:"8:30pm",value:"8:30pm"},{label:"9:00pm",value:"9:00pm"},{label:"9:30pm",value:"9:30pm"},{label:"10:00pm",value:"10:00pm"},{label:"10:30pm",value:"10:30pm"},{label:"11:00pm",value:"11:00pm"},{label:"11:30pm",value:"11:30pm"},{label:"11:59pm",value:"11:59pm"}],Jbt=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],e_t={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},wi={toIndex:e=>Ra.findIndex(t=>t.value===e),toTime:e=>Ra[e]?.value??null,getNextSlot:e=>{const t=wi.toIndex(e),n=Ra.length-1;if(t===-1||t>=n)return null;const r=n-t,s=Math.min(2,r),o=t+s;return{start:Ra[t]?.value??"",end:Ra[o]?.value??""}},canAddSlot:e=>e.length===0||wi.toIndex(e[e.length-1]?.end??"")0,getDefaultSlot:()=>({start:"9:00am",end:"5:00pm"}),getPreviousSlot:(e,t)=>{if(wi.toIndex(e)<=0)return null;const r=wi.toIndex("9:00am"),s=wi.toIndex("5:00pm");for(let a=r;a{const p=wi.toIndex(m.start??""),h=wi.toIndex(m.end);return!(i<=p||a>=h)}))return{start:c,end:u}}const o=wi.toIndex(t[0]?.start??"");if(o>0){const a=Math.min(2,o),i=o-a;return{start:Ra[i]?.value??"",end:Ra[o]?.value??""}}return null}},t_t={monday:[{start:"9:00am",end:"5:00pm"}],tuesday:[{start:"9:00am",end:"5:00pm"}],wednesday:[{start:"9:00am",end:"5:00pm"}],thursday:[{start:"9:00am",end:"5:00pm"}],friday:[{start:"9:00am",end:"5:00pm"}],saturday:[],sunday:[]},LFe=e=>{if(!e)return!1;const t=e.indexOf("@"),n=e.lastIndexOf(".");return e.includes("@")&&e.includes(".")&&t0},n_t=e=>[...e].sort((t,n)=>{const r=new Date(t.start_date_time||"").getTime(),s=new Date(n.start_date_time||"").getTime();return r-s}),r_t=e=>{if(e.length<=1)return!1;const t=new Date(e[0]?.start_date_time||""),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return e.some(r=>{const s=new Date(r.start_date_time||"");return new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime()!==n})},FFe={"#AC725E":"#79554B","#D06B64":"#E67399","#F83A22":"#D50000","#FA573C":"#F4511E","#FF7537":"#EF6C00","#FFAD46":"#F09300","#42D692":"#009688","#16A765":"#0B8043","#7BD148":"#7CB342","#B3DC6C":"#C0CA33","#FBE983":"#E4C441","#FAD165":"#F6BF26","#92E1C0":"#039BE5","#9FE1E7":"#4285F4","#9FC6E7":"#3F51B5","#4986E7":"#7986CB","#9A9CFF":"#B39DDB","#C2C2C2":"#616161","#CABDBF":"#A79B8E","#CCA6AC":"#AD1457","#F691B2":"#D81B60","#CD74E6":"#8E24AA","#A47AE2":"#7B1FA2"},BFe="#039BE5",gee=e=>FFe[e.toUpperCase()]??BFe,yee=e=>{const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16),o=m=>{const p=m/255;return p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4)},a=o(n),i=o(r),c=o(s),u=.2126*a+.7152*i+.0722*c,f=(Math.max(u,1)+.05)/(Math.min(u,1)+.05);return f>=7?"AAA":f>=4.5?"AA":f>=3?"A":"Fail"},UFe=e=>typeof e=="string"?{email:e,response_status:void 0,photo_url:void 0,display_name:void 0}:{email:e.email,response_status:e.response_status,photo_url:e.photo_url,display_name:e.display_name},EI=e=>e?e.map(UFe):[],VFe=e=>{if(!e||e.trim()==="")return"";const t=e.trim().split(/\s+/);return UU(t)?t[0].charAt(0).toUpperCase():((t[0]?.charAt(0)??"")+(t[t.length-1]?.charAt(0)??"")).toUpperCase()},b6=(e,t)=>t.formatDate(e,{timeZoneName:"short"}).split(", ").pop()||"",HFe=()=>Intl.DateTimeFormat().resolvedOptions().timeZone.split("/").pop()?.replace(/_/g," ")||"",zFe=(e,t)=>t.formatDate(e,{timeZoneName:"shortOffset"}).split(", ").pop()||"",WFe=()=>{const{formatDate:e}=J(),t=d.useCallback((s,o=!0)=>e(s,{month:"long",day:"numeric",...o&&{year:"numeric"}}),[e]),n=d.useCallback(s=>e(s,{weekday:"long",month:"long",day:"numeric"}),[e]),r=d.useCallback(s=>e(s,{weekday:"short",month:"long",day:"numeric"}),[e]);return d.useMemo(()=>({formatEventDate:t,formatEventDay:n,formatEventDayShort:r}),[t,n,r])},Ip=T.memo(({startDate:e,endDate:t,isAllDay:n,showDate:r=!1,includeYear:s=!0})=>{const{$t:o}=J();if(n){const a=o({defaultMessage:"All day",id:"Vob6h4Xsl3"});return r?l.jsxs(l.Fragment,{children:[l.jsx(v_,{from:e,to:e,...s&&{year:"numeric"},month:"long",day:"numeric"}),", ",a]}):l.jsx(l.Fragment,{children:a})}return r?l.jsx(v_,{from:e,to:t,...s&&{year:"numeric"},month:"long",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}):l.jsx(v_,{from:e,to:t,hour:"numeric",minute:"2-digit",timeZoneName:"short"})});Ip.displayName="EventTimeRange";function GFe(e){const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function $Fe(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function qFe(e){const t=new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function xee(e){const t=new Date;return t.setDate(t.getDate()+1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function vee(e,t,n={numeric:"auto",style:"long"},r=1e3*60*60*24){if(!t)return"";const s=new Date(t);if(isNaN(s.getTime()))return"";const o=s.getTime()-Date.now(),a=Math.abs(o);return a<=1e3?"":a<1e3*60?e.formatRelativeTime(Math.round(o/1e3),"second",n):a<1e3*60*60?e.formatRelativeTime(Math.round(o/(1e3*60)),"minute",n):a=1e3*60*60*24?e.formatRelativeTime(Math.round(o/(1e3*60*60*24)),"day",n):e.formatDate(s,{month:"short",day:"numeric",year:"numeric"})}function s_t(e,t){try{const n=+t,r={hours:Math.floor(n/3600),minutes:Math.floor(n%3600/60),seconds:Math.floor(n%60)},s={hours:"h",minutes:"m",seconds:"s"};if("DurationFormat"in Intl)return new Intl.DurationFormat(e,{style:"narrow",valueStyle:"narrow"}).format(r);let o="";for(const[a,i]of Object.entries(r))i>0&&(o+=`${i}${s[a]} `);return o.trim()}catch{return""}}const zl=T.memo(({oldText:e,newText:t,isDeletion:n=!1})=>!e&&!t?null:n&&(e||t)?l.jsx(V,{as:"span",color:"ultraLight",className:"line-through",children:e||t}):!e&&t?l.jsx(V,{as:"span",color:"default",className:"bg-[#facc15]/25",children:t}):!t&&e?e:e&&t&&e===t?l.jsx(V,{as:"span",color:"default",children:e}):e&&t&&e!==t?l.jsxs(l.Fragment,{children:[l.jsx(V,{as:"span",color:"ultraLight",className:"line-through",children:e})," ",l.jsx(V,{as:"span",color:"default",className:"bg-[#facc15]/25",children:t})]}):null);zl.displayName="DiffedText";const Xs=T.memo(({children:e,icon:t,alignCenter:n=!1,iconSize:r="sm"})=>l.jsxs("div",{className:z("flex flex-row items-start gap-3",{"items-center":n}),children:[l.jsx(ge,{icon:t,size:r,className:"mt-px shrink-0"}),l.jsx("div",{className:"min-w-0 flex-1",children:e})]}));Xs.displayName="EventAttribute";const bee=T.memo(({attendee:e,showRsvp:t=!1})=>l.jsxs("div",{className:"relative w-5",children:[e.photo_url?l.jsx(mr,{fullBleed:!0,className:"absolute inset-0 mt-px size-5 overflow-hidden !rounded-full",children:l.jsx("img",{src:e.photo_url,className:"size-full object-cover",alt:e.display_name||e.email||""})}):l.jsx(K,{variant:"subtle",className:"absolute inset-0 mt-px flex size-5 items-center justify-center rounded-full",children:l.jsx(V,{variant:"tinyMono",color:"light",className:"translate-y-half",children:VFe(e.display_name||e.email||"")})}),t&&(e.response_status==="accepted"||e.response_status==="declined")&&l.jsx(K,{variant:"background",className:"p-two absolute bottom-[-4px] right-[-4px] z-10 rounded-full",children:l.jsx(V,{color:e.response_status==="accepted"?"super":e.response_status==="declined"?"red":"light",className:z("bg-base border-subtlest flex size-3 items-center justify-center rounded-full border",{"!bg-super/20 !border-super/10 border":e.response_status==="accepted","!bg-negative/20 !border-negative/10":e.response_status==="declined"}),children:l.jsx(ge,{icon:e.response_status==="accepted"?B("check"):e.response_status==="declined"?B("x"):B("question-mark"),size:"2xs",stroke:2.125})})})]}));bee.displayName="AttendeeAvatar";const _ee=T.memo(({attendees:e,newAttendees:t,truncateAttendees:n,showRsvp:r=!1,isDeletion:s=!1})=>{const[o,a]=d.useState(!1),c=EI(e).filter(g=>!g.email?.includes("@resource.calendar.google"));let u;t&&(u=EI(t).filter(y=>!y.email?.includes("@resource.calendar.google")));const f=(g,y)=>{const x=g?.map(v=>{let b;return y?b=y?.find(_=>_.email===v.email)??{email:" ",response_status:void 0,photo_url:void 0,display_name:" "}:b=v,{oldValue:v,newValue:b}})??[];return y&&(g?y.filter(b=>!g.some(_=>_.email===b.email)):y).forEach(b=>{x.push({oldValue:void 0,newValue:b})}),x},m=u||c,p=f(c,u),h=d.useCallback(()=>a(!o),[o]);return l.jsxs("div",{className:"min-w-0",children:[(()=>{const g=m?.length??0;return l.jsx(V,{variant:"small",color:g>0?"default":"light",className:s?"line-through":"",children:g>0?`${g} ${g===1?"Guest":"Guests"}`:"No Guests"})})(),p&&p.length>0&&l.jsxs("div",{className:"gap-sm my-sm flex flex-col",children:[p.slice(0,n&&!o?n:void 0).map(g=>l.jsxs("div",{className:"gap-sm flex flex-row",children:[l.jsx(bee,{attendee:g.newValue,showRsvp:r}),l.jsx(V,{variant:"small",color:"default",className:"line-clamp-1 text-ellipsis break-all",children:l.jsx(zl,{oldText:g.oldValue?.display_name||g.oldValue?.email,newText:g.newValue?.display_name||g.newValue?.email,isDeletion:s})})]},g.oldValue?.email??g.newValue?.email)),n&&p.length>n&&l.jsx(V,{as:"button",variant:"small",color:"default",className:"w-fit text-left hover:underline",onClick:h,children:o?"Show less":"Show all"})]})]})});_ee.displayName="AttendeeList";const wee=T.memo(({videoEntryPoint:e,isDeletion:t})=>{const{$t:n}=J(),r=d.useCallback(()=>window.open(e?.uri,"_blank","noopener,noreferrer"),[e?.uri]);return!e||t?null:l.jsx(Xs,{icon:B("video"),alignCenter:!0,children:l.jsx(ze,{variant:"primary",pill:!0,text:n({defaultMessage:"Join Meeting",id:"HK25u5mIfw"}),onClick:r,size:"small"})})});wee.displayName="EventVideoEntry";const Cee=T.memo(({location:e,newLocation:t,isDeletion:n=!1})=>e?l.jsx(Xs,{icon:B("map-pin"),children:l.jsx(V,{variant:"small",color:"light",className:"line-clamp-1",children:l.jsx(zl,{oldText:e,newText:t,isDeletion:n})})}):null);Cee.displayName="EventLocation";const See=T.memo(({description:e,newDescription:t,isDeletion:n=!1})=>{const[r,s]=d.useState(!1),o=d.useCallback(()=>s(!r),[r]);return e?l.jsx(Xs,{icon:B("align-left"),children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx(V,{variant:"small",className:z("break-words",{"line-clamp-2":!r}),children:l.jsx(zl,{oldText:e,newText:t,isDeletion:n})}),e.length>150&&l.jsx(V,{as:"button",variant:"small",color:"default",className:"mt-1 w-fit text-left hover:underline",onClick:o,children:r?"Show less":"Show more"})]})}):null});See.displayName="EventDescription";const Eee=T.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i=!1})=>{const c=J(),u=s&&n?n:e,f=s&&r?r:t,m=s?s.is_all_day||!1:o;return l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(zl,{oldText:a(e),newText:s&&n?a(n):void 0,isDeletion:i})}),l.jsx(V,{variant:"small",color:"light",children:l.jsxs("span",{className:i?"line-through":"",children:[l.jsx(Ip,{startDate:u,endDate:f,isAllDay:m}),!m&&` (${b6(u,c)})`]})})]})});Eee.displayName="SingleDayDisplay";const kee=T.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,formatEventDayShort:o,isDeletion:a=!1})=>{const i=J(),c=s&&r?r:t,u=s&&s.is_all_day||!1;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(zl,{oldText:o(e),newText:s&&n?o(n):void 0,isDeletion:a})}),l.jsx(V,{variant:"small",color:"light",children:l.jsx("span",{className:a?"line-through":"",children:!s?.is_all_day&&l.jsx(A7,{value:s&&n?n:e,hour:"numeric",minute:"2-digit"})})})]}),l.jsx(V,{color:"light",className:"pt-two flex justify-center",children:l.jsx(ge,{icon:B("arrow-right"),size:"sm"})}),l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(zl,{oldText:o(t),newText:s&&r?o(r):void 0,isDeletion:a})}),l.jsx(V,{variant:"small",color:"light",children:l.jsx("span",{className:a?"line-through":"",children:!u&&l.jsxs(l.Fragment,{children:[l.jsx(A7,{value:c,hour:"numeric",minute:"2-digit"}),` (${b6(c,i)})`]})})})]})]})});kee.displayName="MultiDayDisplay";const Mee=T.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i=!1})=>{const c=$Fe(e,t);return l.jsx(Xs,{icon:B("clock"),children:l.jsxs("div",{className:"gap-sm flex",children:[c&&l.jsx(Eee,{startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i}),!c&&l.jsx(kee,{startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,formatEventDayShort:a,isDeletion:i})]})})});Mee.displayName="EventDateDisplay";const KFe=T.memo(({startDate:e,newStartDate:t})=>{const n=J();if(!e)return null;const r=t||e,s=zFe(r,n),o=HFe(),a=b6(r,n);return l.jsx(Xs,{icon:B("world"),alignCenter:!0,children:l.jsxs("div",{children:[l.jsxs(V,{as:"span",variant:"small",color:"light",children:[s," "]}),l.jsx(V,{as:"span",variant:"small",children:o}),l.jsxs(V,{as:"span",variant:"small",color:"light",children:[" ","(",a,")"]})]})})});KFe.displayName="EventTimezone";const Tee=T.memo(({event:e,newEvent:t,className:n,truncateAttendees:r,showRsvp:s=!1,action:o})=>{const{start_date_time:a,end_date_time:i,attendees:c,description:u,location:f,conference_data:m,is_all_day:p}=e,h=o==="DELETE",{formatEventDayShort:g}=WFe(),y=d.useMemo(()=>new Date(a||""),[a]),x=d.useMemo(()=>new Date(i||""),[i]),v=d.useMemo(()=>{if(t&&t.start_date_time)return new Date(t.start_date_time||"")},[t]),b=d.useMemo(()=>{if(t&&t.end_date_time)return new Date(t.end_date_time||"")},[t]),_=m?.entry_points?.find(w=>w.entry_point_type==="video");return l.jsxs("div",{className:z("gap-md flex h-full flex-col",n),children:[l.jsx(Mee,{startDate:y,endDate:x,newStartDateObj:v,newEndDateObj:b,newEvent:t,is_all_day:p??!1,formatEventDayShort:g,isDeletion:h}),l.jsx(wee,{videoEntryPoint:_,isDeletion:h}),l.jsx(Cee,{location:f,newLocation:t?.location,isDeletion:h}),l.jsx(See,{description:u,newDescription:t?.description,isDeletion:h}),l.jsx(Xs,{icon:B("user"),children:l.jsx(_ee,{attendees:c,newAttendees:t?.attendees,truncateAttendees:r,showRsvp:s,isDeletion:h})})]})});Tee.displayName="EventDetails";function vw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Dm(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function jm(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?QFe(i,m=>m.test(a)):YFe(i,m=>m.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=t.slice(a.length);return{value:u,rest:f}}}function YFe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function QFe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const _6=6048e5,ZFe=864e5,kI=Symbol.for("constructDateFrom");function Vr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&kI in e?e[kI](t):e instanceof Date?new e.constructor(t):new Date(t)}function em(e,...t){const n=Vr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}let JFe={};function Rg(){return JFe}function bn(e,t){return Vr(t||e,e)}function ti(e,t){const n=Rg(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=bn(e,t?.in),o=s.getDay(),a=(o{let r;const s=eBe[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},nBe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rBe=(e,t,n,r)=>nBe[e],sBe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oBe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aBe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},iBe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},lBe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},cBe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},uBe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},dBe={ordinalNumber:uBe,era:Dm({values:sBe,defaultWidth:"wide"}),quarter:Dm({values:oBe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Dm({values:aBe,defaultWidth:"wide"}),day:Dm({values:iBe,defaultWidth:"wide"}),dayPeriod:Dm({values:lBe,defaultWidth:"wide",formattingValues:cBe,defaultFormattingWidth:"wide"})},fBe=/^(\d+)(th|st|nd|rd)?/i,mBe=/\d+/i,pBe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hBe={any:[/^b/i,/^(a|c)/i]},gBe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yBe={any:[/1/i,/2/i,/3/i,/4/i]},xBe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vBe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},bBe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},_Be={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},wBe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},CBe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},SBe={ordinalNumber:XFe({matchPattern:fBe,parsePattern:mBe,valueCallback:e=>parseInt(e,10)}),era:jm({matchPatterns:pBe,defaultMatchWidth:"wide",parsePatterns:hBe,defaultParseWidth:"any"}),quarter:jm({matchPatterns:gBe,defaultMatchWidth:"wide",parsePatterns:yBe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:jm({matchPatterns:xBe,defaultMatchWidth:"wide",parsePatterns:vBe,defaultParseWidth:"any"}),day:jm({matchPatterns:bBe,defaultMatchWidth:"wide",parsePatterns:_Be,defaultParseWidth:"any"}),dayPeriod:jm({matchPatterns:wBe,defaultMatchWidth:"any",parsePatterns:CBe,defaultParseWidth:"any"})},EBe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kBe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},MBe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},TBe={date:vw({formats:EBe,defaultWidth:"full"}),time:vw({formats:kBe,defaultWidth:"full"}),dateTime:vw({formats:MBe,defaultWidth:"full"})},Aee={code:"en-US",formatDistance:tBe,formatLong:TBe,formatRelative:rBe,localize:dBe,match:SBe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function So(e,t,n){const r=bn(e,n?.in);return isNaN(t)?Vr(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function ni(e,t,n){const r=bn(e,n?.in);if(isNaN(t))return Vr(n?.in||e,NaN);if(!t)return r;const s=r.getDate(),o=Vr(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),s),r)}function Jc(e,t){return ti(e,{...t,weekStartsOn:1})}function Nee(e,t){const n=bn(e,t?.in),r=n.getFullYear(),s=Vr(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const o=Jc(s),a=Vr(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=Jc(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function C2(e){const t=bn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ef(e,t){const n=bn(e,t?.in);return n.setHours(0,0,0,0),n}function Va(e,t,n){const[r,s]=em(n?.in,e,t),o=ef(r),a=ef(s),i=+o-C2(o),c=+a-C2(a);return Math.round((i-c)/ZFe)}function ABe(e,t){const n=Nee(e,t),r=Vr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Jc(r)}function TE(e,t,n){return So(e,t*7,n)}function NBe(e,t,n){return ni(e,t*12,n)}function RBe(e,t){let n,r=t?.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const o=bn(s,r);(!n||n{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const o=bn(s,r);(!n||n>o||isNaN(+o))&&(n=o)}),Vr(r,n||NaN)}function Ps(e,t,n){const[r,s]=em(n?.in,e,t);return+ef(r)==+ef(s)}function w6(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function jBe(e){return!(!w6(e)&&typeof e!="number"||isNaN(+bn(e)))}function wh(e,t,n){const[r,s]=em(n?.in,e,t),o=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return o*12+a}function IBe(e,t,n){const[r,s]=em(n?.in,e,t),o=ti(r,n),a=ti(s,n),i=+o-C2(o),c=+a-C2(a);return Math.round((i-c)/_6)}function C6(e,t){const n=bn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Bs(e,t){const n=bn(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Ree(e,t){const n=bn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function S6(e,t){const n=Rg(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=bn(e,t?.in),o=s.getDay(),a=(o=+i?r+1:+n>=+u?r:r-1}function OBe(e,t){const n=Rg(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Iee(e,t),o=Vr(t?.in||e,0);return o.setFullYear(s,0,r),o.setHours(0,0,0,0),ti(o,t)}function Pee(e,t){const n=bn(e,t?.in),r=+ti(n,t)-+OBe(n,t);return Math.round(r/_6)+1}function yn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const al={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return yn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):yn(n+1,2)},d(e,t){return yn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return yn(e.getHours()%12||12,t.length)},H(e,t){return yn(e.getHours(),t.length)},m(e,t){return yn(e.getMinutes(),t.length)},s(e,t){return yn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return yn(s,t.length)}},Bu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},MI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return al.y(e,t)},Y:function(e,t,n,r){const s=Iee(e,r),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return yn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):yn(o,t.length)},R:function(e,t){const n=Nee(e);return yn(n,t.length)},u:function(e,t){const n=e.getFullYear();return yn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return yn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return yn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return al.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return yn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=Pee(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):yn(s,t.length)},I:function(e,t,n){const r=jee(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):yn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):al.d(e,t)},D:function(e,t,n){const r=PBe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):yn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return yn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return yn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return yn(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Bu.noon:r===0?s=Bu.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Bu.evening:r>=12?s=Bu.afternoon:r>=4?s=Bu.morning:s=Bu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return al.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):al.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):yn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):yn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):al.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):al.s(e,t)},S:function(e,t){return al.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return AI(r);case"XXXX":case"XX":return _c(r);case"XXXXX":case"XXX":default:return _c(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return AI(r);case"xxxx":case"xx":return _c(r);case"xxxxx":case"xxx":default:return _c(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+TI(r,":");case"OOOO":default:return"GMT"+_c(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+TI(r,":");case"zzzz":default:return"GMT"+_c(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return yn(r,t.length)},T:function(e,t,n){return yn(+e,t.length)}};function TI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),o=r%60;return o===0?n+String(s):n+String(s)+t+yn(o,2)}function AI(e,t){return e%60===0?(e>0?"-":"+")+yn(Math.abs(e)/60,2):_c(e,t)}function _c(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=yn(Math.trunc(r/60),2),o=yn(r%60,2);return n+s+t+o}const NI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Oee=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},LBe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return NI(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",NI(r,t)).replace("{{time}}",Oee(s,t))},FBe={p:Oee,P:LBe},BBe=/^D+$/,UBe=/^Y+$/,VBe=["D","DD","YY","YYYY"];function HBe(e){return BBe.test(e)}function zBe(e){return UBe.test(e)}function WBe(e,t,n){const r=GBe(e,t,n);if(console.warn(r),VBe.includes(e))throw new RangeError(r)}function GBe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $Be=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qBe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KBe=/^'([^]*?)'?$/,YBe=/''/g,QBe=/[a-zA-Z]/;function xu(e,t,n){const r=Rg(),s=n?.locale??r.locale??Aee,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=bn(e,n?.in);if(!jBe(i))throw new RangeError("Invalid time value");let c=t.match(qBe).map(f=>{const m=f[0];if(m==="p"||m==="P"){const p=FBe[m];return p(f,s.formatLong)}return f}).join("").match($Be).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:XBe(f)};if(MI[m])return{isToken:!0,value:f};if(m.match(QBe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const u={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&zBe(m)||!n?.useAdditionalDayOfYearTokens&&HBe(m))&&WBe(m,t,String(e));const p=MI[m[0]];return p(i,m,s.localize,u)}).join("")}function XBe(e){const t=e.match(KBe);return t?t[1].replace(YBe,"'"):e}function ZBe(e,t){const n=bn(e,t?.in),r=n.getFullYear(),s=n.getMonth(),o=Vr(n,0);return o.setFullYear(r,s+1,0),o.setHours(0,0,0,0),o.getDate()}function JBe(e){return Math.trunc(+bn(e)/1e3)}function eUe(e,t){const n=bn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),bn(n,t?.in)}function tUe(e,t){const n=bn(e,t?.in);return IBe(eUe(n,t),Bs(n,t),t)+1}function Lee(e,t){return+bn(e)>+bn(t)}function Fee(e,t){return+bn(e)<+bn(t)}function E6(e,t,n){const[r,s]=em(n?.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function nUe(e,t,n){const[r,s]=em(n?.in,e,t);return r.getFullYear()===s.getFullYear()}function RI(e,t,n){return So(e,-t,n)}function bw(e,t,n){const r=bn(e,n?.in),s=r.getFullYear(),o=r.getDate(),a=Vr(e,0);a.setFullYear(s,t,15),a.setHours(0,0,0,0);const i=ZBe(a);return r.setMonth(t,Math.min(o,i)),r}function DI(e,t,n){const r=bn(e,n?.in);return isNaN(+r)?Vr(e,NaN):(r.setFullYear(t),r)}var Et=function(){return Et=Object.assign||function(t){for(var n,r=1,s=arguments.length;r1&&(c||!u),m=t>1&&(u||!c),p=function(){r&&o(r)},h=function(){s&&o(s)};return T.createElement(PUe,{displayMonth:e.displayMonth,hideNext:f,hidePrevious:m,nextMonth:s,previousMonth:r,onPreviousClick:p,onNextClick:h})}function OUe(e){var t,n=Wn(),r=n.classNames,s=n.disableNavigation,o=n.styles,a=n.captionLayout,i=n.components,c=(t=i?.CaptionLabel)!==null&&t!==void 0?t:Vee,u;return s?u=T.createElement(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?u=T.createElement(jI,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?u=T.createElement(T.Fragment,null,T.createElement(jI,{displayMonth:e.displayMonth,id:e.id}),T.createElement(II,{displayMonth:e.displayMonth,id:e.id})):u=T.createElement(T.Fragment,null,T.createElement(c,{id:e.id,displayMonth:e.displayMonth}),T.createElement(II,{displayMonth:e.displayMonth,id:e.id})),T.createElement("div",{className:r.caption,style:o.caption},u)}function LUe(e){var t=Wn(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?T.createElement("tfoot",{className:s,style:r.tfoot},T.createElement("tr",null,T.createElement("td",{colSpan:8},n))):T.createElement(T.Fragment,null)}function FUe(e,t,n){for(var r=n?Jc(new Date):ti(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=So(r,o);s.push(a)}return s}function BUe(){var e=Wn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=FUe(s,o,a);return T.createElement("tr",{style:n.head_row,className:t.head_row},r&&T.createElement("td",{style:n.head_cell,className:t.head_cell}),u.map(function(f,m){return T.createElement("th",{key:m,scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s})},i(f,{locale:s}))}))}function UUe(){var e,t=Wn(),n=t.classNames,r=t.styles,s=t.components,o=(e=s?.HeadRow)!==null&&e!==void 0?e:BUe;return T.createElement("thead",{style:r.head,className:n.head},T.createElement(o,null))}function VUe(e){var t=Wn(),n=t.locale,r=t.formatters.formatDay;return T.createElement(T.Fragment,null,r(e.date,{locale:n}))}var k6=d.createContext(void 0);function HUe(e){if(!Dg(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return T.createElement(k6.Provider,{value:t},e.children)}return T.createElement(zUe,{initialProps:e.initialProps,children:e.children})}function zUe(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,o=t.max,a=function(u,f,m){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,u,f,m);var g=!!(f.selected&&s&&r?.length===s);if(!g){var y=!!(!f.selected&&o&&r?.length===o);if(!y){var x=r?Bee([],r):[];if(f.selected){var v=x.findIndex(function(b){return Ps(u,b)});x.splice(v,1)}else x.push(u);(h=t.onSelect)===null||h===void 0||h.call(t,x,u,f,m)}}},i={disabled:[]};r&&i.disabled.push(function(u){var f=o&&r.length>o-1,m=r.some(function(p){return Ps(p,u)});return!!(f&&!m)});var c={selected:r,onDayClick:a,modifiers:i};return T.createElement(k6.Provider,{value:c},n)}function M6(){var e=d.useContext(k6);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function WUe(e,t){var n=t||{},r=n.from,s=n.to;if(!r)return{from:e,to:void 0};if(!s&&Ps(r,e))return{from:r,to:e};if(!s&&Fee(e,r))return{from:e,to:r};if(!s)return{from:r,to:e};if(!(Ps(s,e)&&Ps(r,e))){if(Ps(s,e))return{from:s,to:void 0};if(!Ps(r,e))return Lee(r,e)?{from:e,to:s}:{from:r,to:e}}}var T6=d.createContext(void 0);function GUe(e){if(!jg(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return T.createElement(T6.Provider,{value:t},e.children)}return T.createElement($Ue,{initialProps:e.initialProps,children:e.children})}function $Ue(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},o=s.from,a=s.to,i=t.min,c=t.max,u=function(h,g,y){var x,v;(x=t.onDayClick)===null||x===void 0||x.call(t,h,g,y);var b=WUe(h,r);(v=t.onSelect)===null||v===void 0||v.call(t,b,h,g,y)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o&&(f.range_start=[o],a?(f.range_end=[a],Ps(o,a)||(f.range_middle=[{after:o,before:a}])):f.range_end=[o]),i&&(o&&!a&&f.disabled.push({after:RI(o,i-1),before:So(o,i-1)}),o&&a&&f.disabled.push({after:o,before:So(o,i-1)})),c&&(o&&!a&&(f.disabled.push({before:So(o,-c+1)}),f.disabled.push({after:So(o,c-1)})),o&&a)){var m=Va(a,o)+1,p=c-m;f.disabled.push({before:RI(o,p)}),f.disabled.push({after:So(a,p)})}return T.createElement(T6.Provider,{value:{selected:r,onDayClick:u,modifiers:f}},n)}function A6(){var e=d.useContext(T6);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function yy(e){return Array.isArray(e)?Bee([],e):e!==void 0?[e]:[]}function qUe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=yy(s)}),t}var va;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(va||(va={}));var KUe=va.Selected,Ci=va.Disabled,YUe=va.Hidden,QUe=va.Today,_w=va.RangeEnd,ww=va.RangeMiddle,Cw=va.RangeStart,XUe=va.Outside;function ZUe(e,t,n){var r,s=(r={},r[KUe]=yy(e.selected),r[Ci]=yy(e.disabled),r[YUe]=yy(e.hidden),r[QUe]=[e.today],r[_w]=[],r[ww]=[],r[Cw]=[],r[XUe]=[],r);return e.fromDate&&s[Ci].push({before:e.fromDate}),e.toDate&&s[Ci].push({after:e.toDate}),Dg(e)?s[Ci]=s[Ci].concat(t.modifiers[Ci]):jg(e)&&(s[Ci]=s[Ci].concat(n.modifiers[Ci]),s[Cw]=n.modifiers[Cw],s[ww]=n.modifiers[ww],s[_w]=n.modifiers[_w]),s}var Wee=d.createContext(void 0);function JUe(e){var t=Wn(),n=M6(),r=A6(),s=ZUe(t,n,r),o=qUe(t.modifiers),a=Et(Et({},s),o);return T.createElement(Wee.Provider,{value:a},e.children)}function Gee(){var e=d.useContext(Wee);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function eVe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function tVe(e){return!!(e&&typeof e=="object"&&"from"in e)}function nVe(e){return!!(e&&typeof e=="object"&&"after"in e)}function rVe(e){return!!(e&&typeof e=="object"&&"before"in e)}function sVe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function oVe(e,t){var n,r=t.from,s=t.to;if(!r)return!1;if(!s&&Ps(r,e))return!0;if(!s)return!1;var o=Va(s,r)<0;o&&(n=[s,r],r=n[0],s=n[1]);var a=Va(e,r)>=0&&Va(s,e)>=0;return a}function aVe(e){return w6(e)}function iVe(e){return Array.isArray(e)&&e.every(w6)}function lVe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(aVe(n))return Ps(e,n);if(iVe(n))return n.includes(e);if(tVe(n))return oVe(e,n);if(sVe(n))return n.dayOfWeek.includes(e.getDay());if(eVe(n)){var r=Va(n.before,e),s=Va(n.after,e),o=r>0,a=s<0,i=Lee(n.before,n.after);return i?a&&o:o||a}return nVe(n)?Va(e,n.after)>0:rVe(n)?Va(n.before,e)>0:typeof n=="function"?n(e):!1})}function N6(e,t,n){var r=Object.keys(t).reduce(function(o,a){var i=t[a];return lVe(e,i)&&o.push(a),o},[]),s={};return r.forEach(function(o){return s[o]=!0}),n&&!E6(e,n)&&(s.outside=!0),s}function cVe(e,t){for(var n=Bs(e[0]),r=C6(e[e.length-1]),s,o,a=n;a<=r;){var i=N6(a,t),c=!i.disabled&&!i.hidden;if(!c){a=So(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=So(a,1)}return o||s}var uVe=365;function $ee(e,t){var n=t.moveBy,r=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,m=s.locale,p={day:So,week:TE,month:ni,year:NBe,startOfWeek:function(x){return s.ISOWeek?Jc(x):ti(x,{locale:m,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?Dee(x):S6(x,{locale:m,weekStartsOn:c})}},h=p[n](e,r==="after"?1:-1);r==="before"&&u?h=RBe([u,h]):r==="after"&&f&&(h=DBe([f,h]));var g=!0;if(o){var y=N6(h,o);g=!y.disabled&&!y.hidden}return g?h:i.count>uVe?i.lastFocused:$ee(h,{moveBy:n,direction:r,context:s,modifiers:o,retry:Et(Et({},i),{count:i.count+1})})}var qee=d.createContext(void 0);function dVe(e){var t=Ig(),n=Gee(),r=d.useState(),s=r[0],o=r[1],a=d.useState(),i=a[0],c=a[1],u=cVe(t.displayMonths,n),f=s??(i&&t.isDateDisplayed(i))?i:u,m=function(){c(s),o(void 0)},p=function(x){o(x)},h=Wn(),g=function(x,v){if(s){var b=$ee(s,{moveBy:x,direction:v,context:h,modifiers:n});Ps(s,b)||(t.goToDate(b,s),p(b))}},y={focusedDay:s,focusTarget:f,blur:m,focus:p,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return T.createElement(qee.Provider,{value:y},e.children)}function R6(){var e=d.useContext(qee);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function fVe(e,t){var n=Gee(),r=N6(e,n,t);return r}var D6=d.createContext(void 0);function mVe(e){if(!Uv(e.initialProps)){var t={selected:void 0};return T.createElement(D6.Provider,{value:t},e.children)}return T.createElement(pVe,{initialProps:e.initialProps,children:e.children})}function pVe(e){var t=e.initialProps,n=e.children,r=function(o,a,i){var c,u,f;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,o,a,i);return}(f=t.onSelect)===null||f===void 0||f.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:r};return T.createElement(D6.Provider,{value:s},n)}function Kee(){var e=d.useContext(D6);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function hVe(e,t){var n=Wn(),r=Kee(),s=M6(),o=A6(),a=R6(),i=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,m=a.blur,p=a.focus,h=a.focusMonthBefore,g=a.focusMonthAfter,y=a.focusYearBefore,x=a.focusYearAfter,v=a.focusStartOfWeek,b=a.focusEndOfWeek,_=function(j){var L,U,O,$;Uv(n)?(L=r.onDayClick)===null||L===void 0||L.call(r,e,t,j):Dg(n)?(U=s.onDayClick)===null||U===void 0||U.call(s,e,t,j):jg(n)?(O=o.onDayClick)===null||O===void 0||O.call(o,e,t,j):($=n.onDayClick)===null||$===void 0||$.call(n,e,t,j)},w=function(j){var L;p(e),(L=n.onDayFocus)===null||L===void 0||L.call(n,e,t,j)},S=function(j){var L;m(),(L=n.onDayBlur)===null||L===void 0||L.call(n,e,t,j)},C=function(j){var L;(L=n.onDayMouseEnter)===null||L===void 0||L.call(n,e,t,j)},E=function(j){var L;(L=n.onDayMouseLeave)===null||L===void 0||L.call(n,e,t,j)},N=function(j){var L;(L=n.onDayPointerEnter)===null||L===void 0||L.call(n,e,t,j)},k=function(j){var L;(L=n.onDayPointerLeave)===null||L===void 0||L.call(n,e,t,j)},I=function(j){var L;(L=n.onDayTouchCancel)===null||L===void 0||L.call(n,e,t,j)},M=function(j){var L;(L=n.onDayTouchEnd)===null||L===void 0||L.call(n,e,t,j)},A=function(j){var L;(L=n.onDayTouchMove)===null||L===void 0||L.call(n,e,t,j)},D=function(j){var L;(L=n.onDayTouchStart)===null||L===void 0||L.call(n,e,t,j)},P=function(j){var L;(L=n.onDayKeyUp)===null||L===void 0||L.call(n,e,t,j)},F=function(j){var L;switch(j.key){case"ArrowLeft":j.preventDefault(),j.stopPropagation(),n.dir==="rtl"?i():c();break;case"ArrowRight":j.preventDefault(),j.stopPropagation(),n.dir==="rtl"?c():i();break;case"ArrowDown":j.preventDefault(),j.stopPropagation(),u();break;case"ArrowUp":j.preventDefault(),j.stopPropagation(),f();break;case"PageUp":j.preventDefault(),j.stopPropagation(),j.shiftKey?y():h();break;case"PageDown":j.preventDefault(),j.stopPropagation(),j.shiftKey?x():g();break;case"Home":j.preventDefault(),j.stopPropagation(),v();break;case"End":j.preventDefault(),j.stopPropagation(),b();break}(L=n.onDayKeyDown)===null||L===void 0||L.call(n,e,t,j)},R={onClick:_,onFocus:w,onBlur:S,onKeyDown:F,onKeyUp:P,onMouseEnter:C,onMouseLeave:E,onPointerEnter:N,onPointerLeave:k,onTouchCancel:I,onTouchEnd:M,onTouchMove:A,onTouchStart:D};return R}function gVe(){var e=Wn(),t=Kee(),n=M6(),r=A6(),s=Uv(e)?t.selected:Dg(e)?n.selected:jg(e)?r.selected:void 0;return s}function yVe(e){return Object.values(va).includes(e)}function xVe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(yVe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function vVe(e,t){var n=Et({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=Et(Et({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function bVe(e,t,n){var r,s,o,a=Wn(),i=R6(),c=fVe(e,t),u=hVe(e,c),f=gVe(),m=!!(a.onDayClick||a.mode!=="default");d.useEffect(function(){var C;c.outside||i.focusedDay&&m&&Ps(i.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[i.focusedDay,e,n,m,c.outside]);var p=xVe(a,c).join(" "),h=vVe(a,c),g=!!(c.outside&&!a.showOutsideDays||c.hidden),y=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:VUe,x=T.createElement(y,{date:e,displayMonth:t,activeModifiers:c}),v={style:h,className:p,children:x,role:"gridcell"},b=i.focusTarget&&Ps(i.focusTarget,e)&&!c.outside,_=i.focusedDay&&Ps(i.focusedDay,e),w=Et(Et(Et({},v),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=_||b?0:-1,r)),u),S={isButton:m,isHidden:g,activeModifiers:c,selectedDays:f,buttonProps:w,divProps:v};return S}function _Ve(e){var t=d.useRef(null),n=bVe(e.date,e.displayMonth,t);return n.isHidden?T.createElement("div",{role:"gridcell"}):n.isButton?T.createElement(S2,Et({name:"day",ref:t},n.buttonProps)):T.createElement("div",Et({},n.divProps))}function wVe(e){var t=e.number,n=e.dates,r=Wn(),s=r.onWeekNumberClick,o=r.styles,a=r.classNames,i=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(t),{locale:i});if(!s)return T.createElement("span",{className:a.weeknumber,style:o.weeknumber},f);var m=c(Number(t),{locale:i}),p=function(h){s(t,n,h)};return T.createElement(S2,{name:"week-number","aria-label":m,className:a.weeknumber,style:o.weeknumber,onClick:p},f)}function CVe(e){var t,n,r=Wn(),s=r.styles,o=r.classNames,a=r.showWeekNumber,i=r.components,c=(t=i?.Day)!==null&&t!==void 0?t:_Ve,u=(n=i?.WeekNumber)!==null&&n!==void 0?n:wVe,f;return a&&(f=T.createElement("td",{className:o.cell,style:s.cell},T.createElement(u,{number:e.weekNumber,dates:e.dates}))),T.createElement("tr",{className:o.row,style:s.row},f,e.dates.map(function(m){return T.createElement("td",{className:o.cell,style:s.cell,key:JBe(m),role:"presentation"},T.createElement(c,{displayMonth:e.displayMonth,date:m}))}))}function PI(e,t,n){for(var r=n?.ISOWeek?Dee(t):S6(t,n),s=n?.ISOWeek?Jc(e):ti(e,n),o=Va(r,s),a=[],i=0;i<=o;i++)a.push(So(s,i));var c=a.reduce(function(u,f){var m=n?.ISOWeek?jee(f):Pee(f,n),p=u.find(function(h){return h.weekNumber===m});return p?(p.dates.push(f),u):(u.push({weekNumber:m,dates:[f]}),u)},[]);return c}function SVe(e,t){var n=PI(Bs(e),C6(e),t);if(t?.useFixedWeeks){var r=tUe(e,t);if(r<6){var s=n[n.length-1],o=s.dates[s.dates.length-1],a=TE(o,6-r),i=PI(TE(o,1),a,t);n.push.apply(n,i)}}return n}function EVe(e){var t,n,r,s=Wn(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,m=s.weekStartsOn,p=s.firstWeekContainsDate,h=s.ISOWeek,g=SVe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:h,locale:o,weekStartsOn:m,firstWeekContainsDate:p}),y=(t=f?.Head)!==null&&t!==void 0?t:UUe,x=(n=f?.Row)!==null&&n!==void 0?n:CVe,v=(r=f?.Footer)!==null&&r!==void 0?r:LUe;return T.createElement("table",{className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"]},!c&&T.createElement(y,null),T.createElement("tbody",{className:a.tbody,style:i.tbody,role:"rowgroup"},g.map(function(b){return T.createElement(x,{displayMonth:e.displayMonth,key:b.weekNumber,dates:b.dates,weekNumber:b.weekNumber})})),T.createElement(v,{displayMonth:e.displayMonth}))}function kVe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var MVe=kVe()?d.useLayoutEffect:d.useEffect,Sw=!1,TVe=0;function OI(){return"react-day-picker-".concat(++TVe)}function AVe(e){var t,n=e??(Sw?OI():null),r=d.useState(n),s=r[0],o=r[1];return MVe(function(){s===null&&o(OI())},[]),d.useEffect(function(){Sw===!1&&(Sw=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function NVe(e){var t,n,r=Wn(),s=r.dir,o=r.classNames,a=r.styles,i=r.components,c=Ig().displayMonths,u=AVe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),f=[o.month],m=a.month,p=e.displayIndex===0,h=e.displayIndex===c.length-1,g=!p&&!h;s==="rtl"&&(t=[p,h],h=t[0],p=t[1]),p&&(f.push(o.caption_start),m=Et(Et({},m),a.caption_start)),h&&(f.push(o.caption_end),m=Et(Et({},m),a.caption_end)),g&&(f.push(o.caption_between),m=Et(Et({},m),a.caption_between));var y=(n=i?.Caption)!==null&&n!==void 0?n:OUe;return T.createElement("div",{key:e.displayIndex,className:f.join(" "),style:m},T.createElement(y,{id:u,displayMonth:e.displayMonth}),T.createElement(EVe,{"aria-labelledby":u,displayMonth:e.displayMonth}))}function RVe(e){var t=e.initialProps,n=Wn(),r=R6(),s=Ig(),o=d.useState(!1),a=o[0],i=o[1];d.useEffect(function(){n.initialFocus&&r.focusTarget&&(a||(r.focus(r.focusTarget),i(!0)))},[n.initialFocus,a,r.focus,r.focusTarget,r]);var c=[n.classNames.root,n.className];n.numberOfMonths>1&&c.push(n.classNames.multiple_months),n.showWeekNumber&&c.push(n.classNames.with_weeknumber);var u=Et(Et({},n.styles.root),n.style),f=Object.keys(t).filter(function(m){return m.startsWith("data-")}).reduce(function(m,p){var h;return Et(Et({},m),(h={},h[p]=t[p],h))},{});return T.createElement("div",Et({className:c.join(" "),style:u,dir:n.dir,id:n.id},f),T.createElement("div",{className:n.classNames.months,style:n.styles.months},s.displayMonths.map(function(m,p){return T.createElement(NVe,{key:p,displayIndex:p,displayMonth:m})})))}function DVe(e){var t=e.children,n=rUe(e,["children"]);return T.createElement(wUe,{initialProps:n},T.createElement(DUe,null,T.createElement(mVe,{initialProps:n},T.createElement(HUe,{initialProps:n},T.createElement(GUe,{initialProps:n},T.createElement(JUe,null,T.createElement(dVe,null,t)))))))}function jVe(e){return T.createElement(DVe,Et({},e),T.createElement(RVe,{initialProps:e}))}const j6=T.memo(({className:e,showOutsideDays:t=!0,...n})=>{const r=T.useMemo(()=>({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-between relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:"h-7 w-7 p-0 rounded hover:bg-subtle flex items-center justify-center bg-subtler [&_*]:fill-quiet",table:"w-full border-collapse",head_row:"flex",head_cell:"text-quiet rounded-md w-8 font-normal text-sm font-mono",row:"flex w-full mt-1",cell:z("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected].day-range-end)]:rounded-r-full",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-full [&:has([aria-selected])]:bg-superBG [&:has(>.day-range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full":"[&:has([aria-selected])]:rounded-md"),day:"size-8 p-0 font-normal select-none aria-selected:opacity-100 flex items-center justify-center rounded-full hover:bg-subtler cursor-pointer",day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:z(n.mode==="range"?"[&.day-range-start]:!bg-super [&.day-range-start]:!text-inverse [&.day-range-start]:hover:!bg-super [&.day-range-end]:!bg-super [&.day-range-end]:!text-inverse [&.day-range-end]:hover:!bg-super":"!bg-super !text-inverse hover:!bg-super"),day_today:"bg-superBG text-super hover:bg-superBG",day_outside:"day-outside text-quiet aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-quiet opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...z}),[n.mode]),s=d.useMemo(()=>({IconLeft:({className:o,...a})=>l.jsx(ge,{icon:B("chevron-left"),className:o,size:"sm",...a}),IconRight:({className:o,...a})=>l.jsx(ge,{icon:B("chevron-right"),className:o,size:"sm",...a})}),[]);return l.jsx(jVe,{showOutsideDays:t,className:z("p-3 font-sans text-base",e),classNames:r,components:s,...n})});j6.displayName="Calendar";const IVe=e=>e.toLocaleDateString(),E2=d.memo(function({value:t,onChange:n,placeholder:r="Select date",formatDate:s=IVe,showIcon:o=!0,buttonClassName:a,variant:i="default",trailingIcon:c,fromDate:u,endDate:f,allowPastDates:m=!1}){const[p,h]=d.useState(!1),g=d.useCallback(()=>{h(w=>!w)},[]),y=d.useCallback(w=>{n(w),h(!1)},[n]),x=d.useMemo(()=>{const w=new Date;return w.setHours(0,0,0,0),w},[]),v=(()=>{switch(i){case"subtle":return"bg-subtle";case"default":return"bg-subtler";default:Ft(i)}})(),b=d.useMemo(()=>m?f?{after:f}:void 0:{before:u??x,after:f},[m,f,u,x]),_=d.useMemo(()=>l.jsxs("div",{role:"button",tabIndex:0,onClick:g,className:z(v,"flex cursor-pointer items-center justify-between rounded-lg px-4 font-sans","hover:border-subtler focus:border-subtler border border-transparent","transition-colors duration-200 ease-out","h-10 w-full","outline-none focus:outline-none focus:ring-0",a),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[o&&l.jsx(ft,{name:B("calendar"),size:16,className:"text-foreground"}),l.jsx("span",{className:"text-foreground text-sm",children:t?s(t):r})]}),c]}),[v,a,s,g,r,o,c,t]);return l.jsx("div",{className:"relative size-full",children:l.jsx(Ul,{interaction:"click",open:p,onOpenChange:h,triggerElement:_,children:l.jsx(j6,{mode:"single",selected:t,onSelect:y,defaultMonth:t,disabled:b,fromDate:m?void 0:u??x})})})}),LI=e=>e?e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):"",FI="border-subtler bg-subtler text-foreground focus:border-super !h-9 rounded-lg border px-3 py-1 text-sm focus:outline-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-inner-spin-button]:hidden [&::-webkit-outer-spin-button]:hidden bg-transparent",BI="data-[state=closed]:border-subtler data-[state=open]:border-super data-[state=open]:hover:border-super !px-3 !h-9 bg-transparent",Yee=d.memo(({startDateTime:e,endDateTime:t,onStartDateChange:n,onEndDateChange:r,onStartTimeChange:s,onEndTimeChange:o})=>{const{$t:a}=J(),i=d.useMemo(()=>e?new Date(e):void 0,[e]),c=d.useMemo(()=>t?new Date(t):void 0,[t]),u=d.useCallback(x=>{if(!x)return;const v=new Date(i||"");if(!isNaN(v.getTime())){if(v.setDate(x.getDate()),v.setMonth(x.getMonth()),v.setFullYear(x.getFullYear()),c&&c.getTime(){if(!x)return;const v=new Date(c||"");isNaN(v.getTime())||(v.setDate(x.getDate()),v.setMonth(x.getMonth()),v.setFullYear(x.getFullYear()),i&&v{s(x)},[s]),p=d.useCallback(x=>{if(!i)return;const[v,b]=x.split(":").map(Number);if(v===void 0||b===void 0)return;const _=new Date(i);isNaN(_.getTime())||(_.setHours(v),_.setMinutes(b),!isNaN(_.getTime())&&(c&&_.getTime()>c.getTime()&&r(_),n(_)))},[i,c,n,r]),h=d.useCallback(x=>{o(x)},[o]),g=d.useCallback(x=>{if(!c)return;const[v,b]=x.split(":").map(Number);if(v===void 0||b===void 0)return;const _=new Date(c);isNaN(_.getTime())||(_.setHours(v),_.setMinutes(b),!isNaN(_.getTime())&&(i&&_.getTime()x.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),[]);return l.jsxs("div",{className:"flex flex-col items-center gap-2 md:flex-row",children:[l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx(E2,{buttonClassName:BI,value:i,onChange:u,placeholder:a({defaultMessage:"Select start date",id:"oUUhTXC2Mx"}),formatDate:y,showIcon:!1}),l.jsx("input",{type:"time",value:LI(i),onChange:x=>m(x.target.value),onBlur:x=>p(x.target.value),className:FI})]}),l.jsx("span",{className:"text-quieter mx-1 text-sm",children:a({defaultMessage:"to",id:"NLeFGnA9M4"})}),l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx("input",{type:"time",value:LI(c),onChange:x=>h(x.target.value),onBlur:x=>g(x.target.value),className:FI}),l.jsx(E2,{buttonClassName:BI,value:c,onChange:f,placeholder:a({defaultMessage:"Select end date",id:"0A4/NpHFx/"}),formatDate:y,showIcon:!1})]})]})});Yee.displayName="CalendarTimeEditable";function PVe(e){if(!e)return null;try{let t=e;e.startsWith("RRULE:")&&(t=e.substring(6));const n={};for(const r of t.split(";"))if(r.includes("=")){const[s,o]=r.split("=",2);s&&o&&(n[s]=o)}return{freq:n.FREQ?.toUpperCase(),interval:n.INTERVAL?parseInt(n.INTERVAL,10):1,byDay:n.BYDAY?.split(","),byMonthDay:n.BYMONTHDAY,count:n.COUNT}}catch{return null}}function OVe(e){try{if(!e.freq)return null;let t=`RRULE:FREQ=${e.freq}`;return e.interval&&e.interval!==1&&(t+=`;INTERVAL=${e.interval}`),e.byDay&&e.byDay.length>0&&(t+=`;BYDAY=${e.byDay.join(",")}`),e.byMonthDay&&(t+=`;BYMONTHDAY=${e.byMonthDay}`),e.count&&(t+=`;COUNT=${e.count}`),t}catch{return null}}const k2=T.memo(({id:e,label:t,extraCSS:n,options:r,activeKey:s,onOptionChange:o,isDisabled:a=!1,testId:i,defaultOption:c,icon:u,...f})=>{c&&(r=[{label:c,value:""}].concat(r||[]));const m=r||[],p=h=>{o(c&&h===""?null:h)};return l.jsxs("div",{children:[l.jsx(wv,{withMargin:!1,label:t}),l.jsx(V,{variant:"small",className:t&&"mt-sm",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("select",{"data-testid":i,id:e,onChange:h=>p(h.target.value),value:s??"",className:z("border-subtler bg-base p-sm pr-lg outline-super ring-subtler dark:border-subtle dark:bg-subtler dark:ring-subtle w-full appearance-none rounded border transition duration-300 focus:outline-none",{"cursor-pointer hover:ring-1":!a,"pl-lg":u},n),disabled:a,...f,children:m.map(h=>l.jsx("option",{value:h.value,className:"pl-sm",children:h.label},h.value))}),u&&l.jsx("div",{className:"left-sm absolute",children:u}),l.jsx(V,{color:"light",variant:"small",className:"right-sm pointer-events-none absolute",children:l.jsx(ge,{icon:B("chevron-down"),size:"md"})})]})})]})});k2.displayName="Select";const t1={frequency:"WEEKLY",endType:"never",interval:"1"},n1=Ue({day:{id:"ruG8dNqKt0",defaultMessage:"{count, plural, one {Day} other {Days}}"},week:{id:"cR0w/cReH+",defaultMessage:"{count, plural, one {Week} other {Weeks}}"},month:{id:"svowrjAWNi",defaultMessage:"{count, plural, one {Month} other {Months}}"},year:{id:"OPfd4WaWUE",defaultMessage:"{count, plural, one {Year} other {Years}}"}}),LVe=e=>[{label:e({defaultMessage:"Daily",id:"zxvhnETmn2"}),value:"DAILY"},{label:e({defaultMessage:"Weekly",id:"/clOBUs/wZ"}),value:"WEEKLY"},{label:e({defaultMessage:"Monthly",id:"wYsv4ZHu+B"}),value:"MONTHLY"},{label:e({defaultMessage:"Yearly",id:"dqD39hnoA/"}),value:"YEARLY"}],FVe=e=>[{label:e({defaultMessage:"Never",id:"du1laW45Py"}),value:"never"},{label:e({defaultMessage:"After",id:"4X+U8o+ztO"}),value:"after"}],BVe=e=>[{label:e({defaultMessage:"Mo",id:"EIk6EqFZZN"}),value:"MO"},{label:e({defaultMessage:"Tu",id:"dswupo3WZd"}),value:"TU"},{label:e({defaultMessage:"We",id:"p02wWlGXK3"}),value:"WE"},{label:e({defaultMessage:"Th",id:"Ee4Ne0CnpN"}),value:"TH"},{label:e({defaultMessage:"Fr",id:"pCVXo8kVuW"}),value:"FR"},{label:e({defaultMessage:"Sa",id:"QJaSgEWRy1"}),value:"SA"},{label:e({defaultMessage:"Su",id:"n4xx4rvq9+"}),value:"SU"}],UVe=e=>{if(!e.frequency||e.frequency==="WEEKLY"&&(!e.byDay||e.byDay.length===0))return!1;if(e.interval){const t=parseInt(e.interval,10);if(isNaN(t)||t<1)return!1}if(e.endType==="after"){if(!e.count)return!1;const t=parseInt(e.count,10);if(isNaN(t)||t<1)return!1}return!0},VVe=(e,t)=>({MO:t({defaultMessage:"Mon",id:"T8JZHei06V"}),TU:t({defaultMessage:"Tue",id:"C4ENlvYIEr"}),WE:t({defaultMessage:"Wed",id:"2NqUghZFW1"}),TH:t({defaultMessage:"Thu",id:"FC0AP4JIua"}),FR:t({defaultMessage:"Fri",id:"hFYE2MSlqH"}),SA:t({defaultMessage:"Sat",id:"3Hv4FbI9Kl"}),SU:t({defaultMessage:"Sun",id:"1Aday2s3it"})})[e]||e,Qee=d.memo(({value:e,onChange:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),[o,a]=d.useState(t1);d.useEffect(()=>{if(Hi(e)&&!r){const x=PVe(e[0]);x&&(a({...t1,frequency:x.freq,interval:x.interval?.toString()||"1",byDay:x.byDay,count:x.count,endType:x.count?"after":"never"}),s(!0))}},[e,r]);const i=d.useMemo(()=>LVe(n),[n]),c=d.useMemo(()=>FVe(n),[n]),u=d.useMemo(()=>BVe(n),[n]),f=parseInt(o.interval||"1",10),m={DAILY:n(n1.day,{count:f}),WEEKLY:n(n1.week,{count:f}),MONTHLY:n(n1.month,{count:f}),YEARLY:n(n1.year,{count:f})},p=x=>{if(UVe(x)){const v=OVe({freq:x.frequency,interval:x.interval?parseInt(x.interval,10):1,byDay:x.byDay,count:x.endType==="after"?x.count:void 0});v&&t([v])}},h=x=>{const v={...o,...x};a(v),p(v)},g=x=>{const v=o.byDay||[],b=v.includes(x)?v.filter(w=>w!==x):[...v,x],_={...o,byDay:b};a(_),p(_)},y=()=>{s(!1),a(t1),t([])};return l.jsxs(K,{className:"space-y-1 pl-1",children:[!r&&e.length===0&&l.jsx(K,{className:"flex items-center justify-between pl-1",children:l.jsx(rt,{onClick:()=>{s(!0),a(t1)},noPadding:!0,variant:"noBackground",text:n({defaultMessage:"Repeat",id:"tw5j2+ZRIB"}),leadingComponent:l.jsx(ft,{name:B("plus"),size:16}),size:"tiny"})}),r&&l.jsxs(K,{className:"flex flex-col gap-2 rounded",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-quieter whitespace-nowrap pr-1 text-xs",children:n({defaultMessage:"Every",id:"JE2YVbgaBx"})}),l.jsx(co,{isMobileUserAgent:!1,min:1,max:99,type:"number",value:o.interval?.toString()||"1",onChange:x=>h({interval:x}),className:"focus:!border-super !w-16 rounded-lg !px-3 focus:!ring-transparent"}),l.jsx(k2,{id:"frequency-select",activeKey:o.frequency||"WEEKLY",options:i.map(x=>({...x,label:m[x.value]})),onOptionChange:x=>h({frequency:x}),extraCSS:"rounded-lg"}),l.jsx("span",{className:"text-quieter whitespace-nowrap pl-2 pr-1 text-xs",children:n({defaultMessage:"Ends",id:"04xGLEkMMo"})}),l.jsx(k2,{id:"end-type-select",activeKey:o.endType||"never",options:c,onOptionChange:x=>h({endType:x,count:x==="after"?"1":void 0}),extraCSS:"rounded-lg w-full"}),o.endType==="after"&&l.jsxs(l.Fragment,{children:[l.jsx(co,{isMobileUserAgent:!1,min:1,max:99,type:"number",value:o.count||"1",onChange:x=>h({count:x}),className:"focus:!border-super !w-16 rounded-lg !px-3 focus:!ring-transparent"}),l.jsx("span",{className:"text-quieter pr-sm whitespace-nowrap text-xs",children:o.count==="1"?n({defaultMessage:"time",id:"nTBG1bRQLC"}):n({defaultMessage:"times",id:"KSQJ7UVwln"})})]}),l.jsx(ze,{onClick:y,text:n({defaultMessage:"Cancel",id:"47FYwba+bI"}),variant:"common",extraCSS:"px-3 py-1 text-xs ml-auto"})]}),o.frequency==="WEEKLY"&&l.jsxs(K,{className:"flex items-center gap-2",children:[l.jsx("label",{className:"text-quieter w-9 whitespace-nowrap text-xs",children:n({defaultMessage:"On",id:"Zh+5A6yahu"})}),l.jsx("div",{className:"flex gap-2",children:u.map(x=>l.jsx(ze,{onClick:()=>g(x.value),text:x.label,size:"tiny",pill:!0,variant:o.byDay?.includes(x.value)?"inverted":"common",ariaLabel:n({defaultMessage:"Toggle {day}",id:"i/JqE0BlGw"},{day:VVe(x.value,n)}),noPadding:!0,extraCSS:"w-8 h-8 !p-0 !text-2xs"},x.value))})]})]})]})});Qee.displayName="RecurrenceEditor";const Xee=T.memo(({label:e,onDelete:t,onClick:n,testId:r,selected:s=!1,disabled:o=!1,title:a,shouldAvoidFocusShift:i=!1,deleteIcon:c=B("x")})=>{const{$t:u}=J(),f=d.useCallback(g=>{g.stopPropagation(),t?.()},[t]),m=d.useCallback(g=>{g.stopPropagation(),n?.({shiftKey:g.shiftKey,metaKey:g.metaKey,ctrlKey:g.ctrlKey})},[n]),p=t&&!o,h=d.useCallback(g=>{g.stopPropagation(),i&&g.preventDefault()},[i]);return l.jsxs("span",{className:"relative flex h-6 max-w-full",children:[l.jsx(K,{className:z("h-full min-w-0 flex-1 rounded-lg border px-2 text-sm",{"pr-[24px]":p},{"cursor-default":o}),variant:s?"superBorder":"subtler","data-test-id":r,onClick:o?void 0:m,onMouseDown:h,as:"button",bgHover:o?void 0:"subtle",title:a,children:l.jsx(V,{variant:"small",className:"block truncate",children:e})}),p&&l.jsx(K,{variant:"transparent",onClick:f,tabIndex:0,"aria-label":u({defaultMessage:"Remove",id:"G/yZLul6P1"}),as:"button",bgHover:"subtle",className:"top-three right-three absolute flex items-center justify-center rounded-md p-0.5",children:l.jsx(Jt,{icon:c,size:"tiny"})})]})});Xee.displayName="Chip";var UI=1,HVe=.9,zVe=.8,WVe=.17,Ew=.1,kw=.999,GVe=.9999,$Ve=.99,qVe=/[\\\/_+.#"@\[\(\{&]/,KVe=/[\\\/_+.#"@\[\(\{&]/g,YVe=/[\s-]/,Zee=/[\s-]/g;function AE(e,t,n,r,s,o,a){if(o===t.length)return s===e.length?UI:$Ve;var i=`${s},${o}`;if(a[i]!==void 0)return a[i];for(var c=r.charAt(o),u=n.indexOf(c,s),f=0,m,p,h,g;u>=0;)m=AE(e,t,n,r,u+1,o+1,a),m>f&&(u===s?m*=UI:qVe.test(e.charAt(u-1))?(m*=zVe,h=e.slice(s,u-1).match(KVe),h&&s>0&&(m*=Math.pow(kw,h.length))):YVe.test(e.charAt(u-1))?(m*=HVe,g=e.slice(s,u-1).match(Zee),g&&s>0&&(m*=Math.pow(kw,g.length))):(m*=WVe,s>0&&(m*=Math.pow(kw,u-s))),e.charAt(u)!==t.charAt(o)&&(m*=GVe)),(mm&&(m=p*Ew)),m>f&&(f=m),u=n.indexOf(c,u+1);return a[i]=f,f}function VI(e){return e.toLowerCase().replace(Zee," ")}function QVe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,AE(e,t,VI(e),VI(t),0,0,{})}var Im='[cmdk-group=""]',Mw='[cmdk-group-items=""]',XVe='[cmdk-group-heading=""]',Jee='[cmdk-item=""]',HI=`${Jee}:not([aria-disabled="true"])`,NE="cmdk-item-select",Xu="data-value",ZVe=(e,t,n)=>QVe(e,t,n),ete=d.createContext(void 0),Pg=()=>d.useContext(ete),tte=d.createContext(void 0),I6=()=>d.useContext(tte),nte=d.createContext(void 0),rte=d.forwardRef((e,t)=>{let n=Zu(()=>{var G,H;return{search:"",value:(H=(G=e.value)!=null?G:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Zu(()=>new Set),s=Zu(()=>new Map),o=Zu(()=>new Map),a=Zu(()=>new Set),i=ste(e),{label:c,children:u,value:f,onValueChange:m,filter:p,shouldFilter:h,loop:g,disablePointerSelection:y=!1,vimBindings:x=!0,...v}=e,b=ls(),_=ls(),w=ls(),S=d.useRef(null),C=cHe();eu(()=>{if(f!==void 0){let G=f.trim();n.current.value=G,E.emit()}},[f]),eu(()=>{C(6,D)},[]);let E=d.useMemo(()=>({subscribe:G=>(a.current.add(G),()=>a.current.delete(G)),snapshot:()=>n.current,setState:(G,H,Q)=>{var Y,te,se,ae;if(!Object.is(n.current[G],H)){if(n.current[G]=H,G==="search")A(),I(),C(1,M);else if(G==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(w);X?X.focus():(Y=document.getElementById(b))==null||Y.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=P())==null?void 0:X.id,E.emit()}),Q||C(5,D),((te=i.current)==null?void 0:te.value)!==void 0){let X=H??"";(ae=(se=i.current).onValueChange)==null||ae.call(se,X);return}}E.emit()}},emit:()=>{a.current.forEach(G=>G())}}),[]),N=d.useMemo(()=>({value:(G,H,Q)=>{var Y;H!==((Y=o.current.get(G))==null?void 0:Y.value)&&(o.current.set(G,{value:H,keywords:Q}),n.current.filtered.items.set(G,k(H,Q)),C(2,()=>{I(),E.emit()}))},item:(G,H)=>(r.current.add(G),H&&(s.current.has(H)?s.current.get(H).add(G):s.current.set(H,new Set([G]))),C(3,()=>{A(),I(),n.current.value||M(),E.emit()}),()=>{o.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let Q=P();C(4,()=>{A(),Q?.getAttribute("id")===G&&M(),E.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{o.current.delete(G),s.current.delete(G)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:b,inputId:w,labelId:_,listInnerRef:S}),[]);function k(G,H){var Q,Y;let te=(Y=(Q=i.current)==null?void 0:Q.filter)!=null?Y:ZVe;return G?te(G,n.current.search,H):0}function I(){if(!n.current.search||i.current.shouldFilter===!1)return;let G=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(Y=>{let te=s.current.get(Y),se=0;te.forEach(ae=>{let X=G.get(ae);se=Math.max(X,se)}),H.push([Y,se])});let Q=S.current;F().sort((Y,te)=>{var se,ae;let X=Y.getAttribute("id"),ee=te.getAttribute("id");return((se=G.get(ee))!=null?se:0)-((ae=G.get(X))!=null?ae:0)}).forEach(Y=>{let te=Y.closest(Mw);te?te.appendChild(Y.parentElement===te?Y:Y.closest(`${Mw} > *`)):Q.appendChild(Y.parentElement===Q?Y:Y.closest(`${Mw} > *`))}),H.sort((Y,te)=>te[1]-Y[1]).forEach(Y=>{var te;let se=(te=S.current)==null?void 0:te.querySelector(`${Im}[${Xu}="${encodeURIComponent(Y[0])}"]`);se?.parentElement.appendChild(se)})}function M(){let G=F().find(Q=>Q.getAttribute("aria-disabled")!=="true"),H=G?.getAttribute(Xu);E.setState("value",H||void 0)}function A(){var G,H,Q,Y;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let se of r.current){let ae=(H=(G=o.current.get(se))==null?void 0:G.value)!=null?H:"",X=(Y=(Q=o.current.get(se))==null?void 0:Q.keywords)!=null?Y:[],ee=k(ae,X);n.current.filtered.items.set(se,ee),ee>0&&te++}for(let[se,ae]of s.current)for(let X of ae)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(se);break}n.current.filtered.count=te}function D(){var G,H,Q;let Y=P();Y&&(((G=Y.parentElement)==null?void 0:G.firstChild)===Y&&((Q=(H=Y.closest(Im))==null?void 0:H.querySelector(XVe))==null||Q.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function P(){var G;return(G=S.current)==null?void 0:G.querySelector(`${Jee}[aria-selected="true"]`)}function F(){var G;return Array.from(((G=S.current)==null?void 0:G.querySelectorAll(HI))||[])}function R(G){let H=F()[G];H&&E.setState("value",H.getAttribute(Xu))}function j(G){var H;let Q=P(),Y=F(),te=Y.findIndex(ae=>ae===Q),se=Y[te+G];(H=i.current)!=null&&H.loop&&(se=te+G<0?Y[Y.length-1]:te+G===Y.length?Y[0]:Y[te+G]),se&&E.setState("value",se.getAttribute(Xu))}function L(G){let H=P(),Q=H?.closest(Im),Y;for(;Q&&!Y;)Q=G>0?iHe(Q,Im):lHe(Q,Im),Y=Q?.querySelector(HI);Y?E.setState("value",Y.getAttribute(Xu)):j(G)}let U=()=>R(F().length-1),O=G=>{G.preventDefault(),G.metaKey?U():G.altKey?L(1):j(1)},$=G=>{G.preventDefault(),G.metaKey?R(0):G.altKey?L(-1):j(-1)};return d.createElement(Mt.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:G=>{var H;(H=v.onKeyDown)==null||H.call(v,G);let Q=G.nativeEvent.isComposing||G.keyCode===229;if(!(G.defaultPrevented||Q))switch(G.key){case"n":case"j":{x&&G.ctrlKey&&O(G);break}case"ArrowDown":{O(G);break}case"p":case"k":{x&&G.ctrlKey&&$(G);break}case"ArrowUp":{$(G);break}case"Home":{G.preventDefault(),R(0);break}case"End":{G.preventDefault(),U();break}case"Enter":{G.preventDefault();let Y=P();if(Y){let te=new Event(NE);Y.dispatchEvent(te)}}}}},d.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:dHe},c),Vv(e,G=>d.createElement(tte.Provider,{value:E},d.createElement(ete.Provider,{value:N},G))))}),JVe=d.forwardRef((e,t)=>{var n,r;let s=ls(),o=d.useRef(null),a=d.useContext(nte),i=Pg(),c=ste(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;eu(()=>{if(!u)return i.item(s,a?.id)},[u]);let f=ote(s,o,[e.value,e.children,o],e.keywords),m=I6(),p=Wl(C=>C.value&&C.value===f.current),h=Wl(C=>u||i.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);d.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(NE,g),()=>C.removeEventListener(NE,g)},[h,e.onSelect,e.disabled]);function g(){var C,E;y(),(E=(C=c.current).onSelect)==null||E.call(C,f.current)}function y(){m.setState("value",f.current,!0)}if(!h)return null;let{disabled:x,value:v,onSelect:b,forceMount:_,keywords:w,...S}=e;return d.createElement(Mt.div,{ref:Gc(o,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!p,"data-disabled":!!x,"data-selected":!!p,onPointerMove:x||i.getDisablePointerSelection()?void 0:y,onClick:x?void 0:g},e.children)}),eHe=d.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,a=ls(),i=d.useRef(null),c=d.useRef(null),u=ls(),f=Pg(),m=Wl(h=>s||f.filter()===!1?!0:h.search?h.filtered.groups.has(a):!0);eu(()=>f.group(a),[]),ote(a,i,[e.value,e.heading,c]);let p=d.useMemo(()=>({id:a,forceMount:s}),[s]);return d.createElement(Mt.div,{ref:Gc(i,t),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&d.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Vv(e,h=>d.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},d.createElement(nte.Provider,{value:p},h))))}),tHe=d.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=d.useRef(null),o=Wl(a=>!a.search);return!n&&!o?null:d.createElement(Mt.div,{ref:Gc(s,t),...r,"cmdk-separator":"",role:"separator"})}),nHe=d.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=I6(),a=Wl(u=>u.search),i=Wl(u=>u.selectedItemId),c=Pg();return d.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),d.createElement(Mt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":i,id:c.inputId,type:"text",value:s?e.value:a,onChange:u=>{s||o.setState("search",u.target.value),n?.(u.target.value)}})}),rHe=d.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=d.useRef(null),a=d.useRef(null),i=Wl(u=>u.selectedItemId),c=Pg();return d.useEffect(()=>{if(a.current&&o.current){let u=a.current,f=o.current,m,p=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let h=u.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(m),p.unobserve(u)}}},[]),d.createElement(Mt.div,{ref:Gc(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":r,id:c.listId},Vv(e,u=>d.createElement("div",{ref:Gc(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),sHe=d.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:a,...i}=e;return d.createElement(NT,{open:n,onOpenChange:r},d.createElement(RT,{container:a},d.createElement(DT,{"cmdk-overlay":"",className:s}),d.createElement(jT,{"aria-label":e.label,"cmdk-dialog":"",className:o},d.createElement(rte,{ref:t,...i}))))}),oHe=d.forwardRef((e,t)=>Wl(n=>n.filtered.count===0)?d.createElement(Mt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),aHe=d.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return d.createElement(Mt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Vv(e,a=>d.createElement("div",{"aria-hidden":!0},a)))}),Og=Object.assign(rte,{List:rHe,Item:JVe,Input:nHe,Group:eHe,Separator:tHe,Dialog:sHe,Empty:oHe,Loading:aHe});function iHe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lHe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ste(e){let t=d.useRef(e);return eu(()=>{t.current=e}),t}var eu=typeof window>"u"?d.useEffect:d.useLayoutEffect;function Zu(e){let t=d.useRef();return t.current===void 0&&(t.current=e()),t}function Wl(e){let t=I6(),n=()=>e(t.snapshot());return d.useSyncExternalStore(t.subscribe,n,n)}function ote(e,t,n,r=[]){let s=d.useRef(),o=Pg();return eu(()=>{var a;let i=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());o.value(e,i,c),(a=t.current)==null||a.setAttribute(Xu,i),s.current=i}),s}var cHe=()=>{let[e,t]=d.useState(),n=Zu(()=>new Map);return eu(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function uHe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Vv({asChild:e,children:t},n){return e&&d.isValidElement(t)?d.cloneElement(uHe(t),{ref:t.ref},n(t.props.children)):n(t)}var dHe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ate={xs:12,sm:14,md:16,lg:20},fHe={xs:"[&_input]:pr-sm [&_input]:pl-7",sm:"[&_input]:pr-sm [&_input]:pl-[30px]",md:"[&_input]:pr-sm [&_input]:pl-8",lg:"[&_input]:pr-sm [&_input]:pl-9"};function ite({options:e,value:t,onValueChange:n,placement:r="bottom-start",keepDraftValue:s=!1}){const[o,a]=d.useState(!1),[i,c]=d.useState(void 0),[u,f]=d.useState(!1),m=d.useRef(null),p=i===void 0,{refs:h,floatingStyles:g}=bY({open:o,placement:r,strategy:"fixed",middleware:[xM(4),QU({padding:8,fallbackAxisSideDirection:"start"}),YU({padding:8}),XU({padding:8,apply({availableHeight:k,rects:I,elements:M}){M.floating.style.maxHeight=`${Math.min(k,300)}px`,M.floating.style.width=`${I.reference.width}px`}})],whileElementsMounted:ZU}),y=d.useCallback(()=>{const k=e.find(I=>I.value===t);return k?k.label:""},[t,e]),x=d.useCallback(()=>{a(!1),s||c(void 0),m.current?.blur()},[s]);d.useEffect(()=>{if(!o)return;const k=I=>{const M=h.reference.current,A=h.floating.current,D=I.target,P=M&&"contains"in M&&!M.contains(D),F=A&&"contains"in A&&!A.contains(D);P&&F&&x()};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[o,h,x]);const v=d.useCallback(k=>{c(k),k===""&&n?.(""),o||a(!0)},[o,n]),b=d.useCallback(()=>{a(!0),f(!0),s||(c(void 0),queueMicrotask(()=>{m.current?.select()}))},[s]),_=d.useCallback(k=>{f(!1)},[]),w=d.useCallback(k=>{n?.(k),c(void 0),a(!1),m.current?.blur()},[n]),S=y(),C=d.useMemo(()=>u?i===void 0?S:i:i??S,[u,S,i]),E=d.useMemo(()=>({...g,position:g.position,zIndex:50}),[g]),N=d.useMemo(()=>({width:"100%"}),[]);return d.useMemo(()=>({isOpen:o,draft:i,isPristine:p,isFocused:u,displayValue:C,inputRef:m,refs:h,listWrapperStyles:N,floatingListStyles:E,onInputChange:v,onFocus:b,onBlur:_,onSelect:w}),[o,i,p,u,C,m,h,N,E,v,b,_,w])}const lte=d.memo(function({children:t,loop:n=!0,filter:r,shouldFilter:s=!0}){return l.jsx(Og,{loop:n,filter:r,shouldFilter:s,children:t})}),RE=d.memo(function({value:t,onValueChange:n,onFocus:r,onBlur:s,onPaste:o,onKeyDown:a,placeholder:i,size:c="md",colorVariant:u="default",noRounded:f=!1,disabled:m,autoFocus:p,ref:h,horizontalSpacing:g,verticalSpacing:y}){const x={subtle:"bg-subtle",default:"bg-base dark:bg-subtler",borderless:"bg-transparent focus:!ring-0!border-0 !bg-transparent !px-0 focus:!ring-0 !border-0"},v={xs:"text-xs placeholder:text-xs",sm:"text-sm placeholder:text-sm",md:"text-sm placeholder:text-sm",lg:"text-lg placeholder:text-base"},b={none:"",xs:"px-xs",sm:"px-sm",md:"px-md",lg:"px-lg",xl:"px-xl"},_={none:"",xs:"py-xs",sm:"py-sm",md:"py-md",lg:"py-lg",xl:"py-xl"},w={xs:"sm",sm:"sm",md:"md",lg:"xl"},S={xs:"xs",sm:"sm",md:"sm",lg:"lg"},C=b[g??w[c]],E=_[y??S[c]];return l.jsx(Og.Input,{ref:h,value:t,onValueChange:n,onFocus:r,onBlur:s,onPaste:o,onKeyDown:a,placeholder:i,disabled:m,autoFocus:p,className:z("focus:ring-subtler w-full font-sans outline-none focus:outline-none","text-foreground caret-super selection:bg-super/50","border-subtler placeholder-quieter border focus:ring-1","transition-all duration-200",!f&&"rounded-lg",x[u],v[c],C,E,m&&"cursor-not-allowed opacity-50")})}),mHe=d.memo(function({icon:t,size:n=16}){return l.jsx("div",{className:z("pointer-events-none left-2 top-1/2 -translate-y-1/2","absolute"),children:l.jsx(ft,{name:t,size:n,className:"text-quieter"})})}),cte=d.memo(function({children:t,style:n}){return l.jsx(Og.List,{className:z("z-50","max-h-[300px] overflow-y-auto","border-subtler shadow-overlay rounded-xl border","bg-base p-xs","flex flex-col gap-px"),style:n,children:t})}),ute=d.memo(function({value:t,onSelect:n,selected:r,disabled:s,children:o,size:a="md",ref:i}){const c={xs:"text-xs py-1 px-xs",sm:"text-sm py-1 px-sm",md:"text-sm py-1.5 px-sm",lg:"text-base py-2 px-md"};return l.jsx(Og.Item,{value:t,onSelect:n,disabled:s,ref:i,className:z("relative select-none rounded-lg transition-all duration-300",c[a],{"hover:bg-subtler cursor-pointer":!s,"cursor-not-allowed":s,"aria-selected:bg-subtler":!0},s&&"opacity-50"),children:l.jsx("span",{className:z({"text-super":r}),children:o})})}),dte=d.memo(function({children:t,size:n="md"}){const r={xs:"text-xs py-2",sm:"text-sm py-2.5",md:"text-sm py-3",lg:"text-base py-3.5"};return l.jsx(Og.Empty,{className:z("text-quieter text-center",r[n]),children:t})}),pHe=d.memo(function({option:t,value:n,disabled:r,size:s="md",onSelect:o}){const a=d.useCallback(()=>{o(t.value)},[o,t.value]),i=t.icon;return l.jsx(ute,{value:t.label,onSelect:a,selected:n===t.value,disabled:r,size:s,children:i?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ft,{name:i,size:ate[s]}),l.jsx("span",{children:t.label})]}):t.label})}),o_t=d.memo(function({options:t,placeholder:n,value:r,onValueChange:s,filter:o,emptyMessage:a,placement:i="bottom-start",referenceRef:c,keepDraftValue:u=!1,size:f="md",colorVariant:m="default",noRounded:p=!1,horizontalSpacing:h,verticalSpacing:g,disabled:y=!1,autoFocus:x=!1}){const v=ite({options:t,value:r,onValueChange:s,placement:i,keepDraftValue:u}),{isOpen:b,displayValue:_,inputRef:w,refs:S,onInputChange:C,onFocus:E,onSelect:N,listWrapperStyles:k,floatingListStyles:I}=v,A=d.useMemo(()=>t.find(P=>P.value===r),[t,r])?.icon;d.useEffect(()=>{c?.current&&v.refs.setReference(c.current)},[c,v.refs]);const D=d.useCallback(P=>{c||v.refs.setReference(P)},[c,v.refs]);return l.jsx("div",{ref:D,className:"relative",children:l.jsxs(lte,{filter:o,shouldFilter:!v.isFocused||!v.isPristine||(v.draft?.length??0)>0,children:[A?l.jsxs("div",{className:"relative",children:[l.jsx(mHe,{icon:A,size:ate[f]}),l.jsx("div",{className:fHe[f],children:l.jsx(RE,{ref:w,value:_,onValueChange:C,onFocus:E,onBlur:v.onBlur,placeholder:n,size:f,horizontalSpacing:"none",verticalSpacing:g,colorVariant:m,noRounded:p,disabled:y,autoFocus:x})})]}):l.jsx(RE,{ref:w,value:_,onValueChange:C,onFocus:E,onBlur:v.onBlur,placeholder:n,size:f,horizontalSpacing:h,verticalSpacing:g,colorVariant:m,noRounded:p,disabled:y,autoFocus:x}),b&&l.jsx("div",{ref:S.setFloating,style:I,children:l.jsxs(cte,{style:k,children:[l.jsx(dte,{size:f,children:a}),t.map(P=>l.jsx(pHe,{option:P,value:r,disabled:y,size:f,onSelect:N},P.value))]})})]})})});function hHe(e,t=!0){const n=d.useRef(null);return d.useEffect(()=>{if(!t)return;const r=s=>{n.current&&!n.current.contains(s.target)&&e()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t,e]),n}const gHe=async(e,t)=>{if(!t){await DE(e);return}try{const n=new Blob([t],{type:"text/html"}),r=new Blob([e],{type:"text/plain"});await navigator.clipboard.write([new ClipboardItem({"text/html":n,"text/plain":r})])}catch{await DE(e)}},DE=async e=>{try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}},fte=T.memo(({chip:e,selected:t,disabled:n,onDelete:r,onClick:s})=>{const o=d.useCallback(()=>{r(e.value)},[r,e.value]),a=d.useCallback(i=>{s(e.value,i)},[s,e.value]);return l.jsx(Xee,{label:e.label,selected:t,title:e.value,onDelete:o,onClick:a,disabled:n,shouldAvoidFocusShift:!0})});fte.displayName="ChipItem";function yHe({option:e,draft:t,onSelect:n,renderSuggestion:r}){const s=d.useCallback(()=>{n(e.value)},[n,e.value]);return l.jsx(ute,{value:e.value,onSelect:s,selected:t===e.value,children:r?.(e.item)})}function xHe({suggestions:e,draft:t,onSelect:n,renderSuggestion:r,referenceElement:s,onValueChange:o}){const a=e?.map(c=>({value:c.value,label:c.key}))||[],i=ite({options:a,value:t,onValueChange:o});return d.useEffect(()=>{s&&i.refs.setReference(s)},[s,i.refs]),l.jsx(M8e,{children:l.jsx("div",{ref:i.refs.setFloating,style:i.floatingListStyles,children:l.jsxs(cte,{style:i.listWrapperStyles,children:[l.jsx(dte,{children:"No results found"}),e.map(c=>l.jsx(yHe,{option:c,draft:t,onSelect:n,renderSuggestion:r},c.key))]})})})}function vHe({chips:e,limit:t=1/0,onAdd:n,onDelete:r,validator:s,placeholder:o,disabled:a=!1,testId:i,children:c,className:u,placeholderOnFocusOnly:f=!1,onDraftChange:m,suggestions:p,renderSuggestion:h}){const[g,y]=d.useState(""),[x,v]=d.useState(!1),[b,_]=d.useState([]),w=d.useRef(null),S=hHe(()=>{_([])}),C=d.useCallback(R=>{y(R),m?.(R)},[m]),E=d.useCallback(R=>{const j=(R??g).trim();if(j===""||e.find(U=>U.value===j))return!1;if(s){const U=s(j);if(typeof U=="string"||!U)return!1}const L=p?.find(U=>U.value===j);return y(""),n([j],L?[L.item]:void 0),!0},[g,n,e,s,p]);d.useEffect(()=>{b.length>0&&S.current&&S.current.focus()},[b,S]);const N=d.useCallback(R=>{if((R.metaKey||R.ctrlKey)&&R.key==="a"&&g){R.stopPropagation();return}if(R.key==="Enter"||R.key==="Tab"||R.key===" "||R.key===","||R.key===";"){if(!E())return;R.preventDefault(),v(!0);return}if(R.key==="Escape"){y(""),v(!1);return}if(R.key==="Backspace"){if(b.length>0)return;if(!g&&!b.length){R.stopPropagation(),R.preventDefault();const j=e[e.length-1];j&&_([j.value]),v(!1)}return}if((R.key==="ArrowLeft"||R.key==="ArrowRight")&&!g){if(R.preventDefault(),R.stopPropagation(),R.key==="ArrowLeft"&&e.length>0){const j=e[e.length-1];j&&(_([j.value]),v(!1))}return}},[E,b,g,e]),k=d.useCallback(R=>{r([R]),_(j=>j.filter(L=>L!==R)),v(!0)},[r]),I=d.useCallback((R,j)=>{_(L=>{const U=j.shiftKey,O=j.metaKey,$=j.ctrlKey;return O||$?L.includes(R)?L.filter(G=>G!==R):[...L,R]:U?L.includes(R)?L:[...L,R]:L.includes(R)?L.filter(G=>G!==R):[R]})},[]),M=d.useCallback(()=>{g.trim()!==""&&!E()||v(!1)},[g,E]),A=d.useCallback(()=>{DE(b.join(","))},[b]),D=d.useCallback(R=>{const{metaKey:j,ctrlKey:L,key:U}=R;if((j||L)&&U==="a"){if(x&&g)return;R.preventDefault(),_(e.map(O=>O.value)),x&&v(!1);return}if((j||L)&&U==="c"&&b.length>0){R.preventDefault(),A();return}if((j||L)&&U==="x"&&b.length>0){R.preventDefault(),A();const O=[...b];_([]),r(O),v(!0);return}if(U==="Backspace"&&b.length>0&&!g){R.preventDefault();const O=[...b];_([]),r(O),v(!0);return}if(U==="ArrowLeft"||U==="ArrowRight"){if(document.activeElement===w.current?.element())return;R.preventDefault();const $=U==="ArrowLeft",G=U==="ArrowRight",H=Q=>{const Y=e[Q];Y&&_([Y.value])};if(b.length===0)e.length>0&&H($?e.length-1:0);else{const Q=b.map(Y=>e.findIndex(te=>te.value===Y)).filter(Y=>Y!==-1).sort((Y,te)=>Y-te);if(Q.length>0){const Y=$?Q[0]:Q[Q.length-1];if(Y!==void 0)if(G&&Y===e.length-1)_([]),v(!0);else{const te=$?Math.max(0,Y-1):Math.min(e.length-1,Y+1);H(te)}}}return}},[b,r,e,x,g,A]),P=d.useCallback(R=>{const L=R.clipboardData.getData("text").split(/[,;\n\t]+/).map(U=>U.trim()).filter(Boolean);if(L.length>1){const U=[],O=[];if(L.forEach($=>{if(s){if(s($)===!0){U.push($);const H=p?.find(Q=>Q.value===$);H&&O.push(H.item)}}else{U.push($);const G=p?.find(H=>H.value===$);G&&O.push(G.item)}}),U.length>0)R.preventDefault(),R.stopPropagation(),n(U,O.length>0?O:void 0);else return}},[s,n,p]),F=d.useCallback(R=>{E(R)||y(""),queueMicrotask(()=>{w.current?.focus()})},[E]);return l.jsxs("div",{ref:S,tabIndex:0,className:z("flex min-h-10 w-full flex-row flex-wrap items-center gap-1 py-2 focus:outline-none",u),"data-test-id":i,onKeyDown:D,onPointerDown:R=>{x&&R.target===S.current&&R.preventDefault()},onClick:R=>{x||(R.stopPropagation(),R.preventDefault(),!a&&e.lengthl.jsx(fte,{chip:R,selected:b.includes(R.value),disabled:a,onDelete:k,onClick:I},R.value)),!a&&e.length0&&g.trim()&&l.jsx(xHe,{suggestions:p,draft:g,onSelect:F,renderSuggestion:h,referenceElement:S.current,onValueChange:C})]})}),c]})}const P6=T.memo(vHe);P6.displayName="ChipInput";function bHe(e){const t=e.display_name?.trim(),n=e.email;return t||n}function _He(e){if(!e?.solution?.name)return"none";const t=e.solution.name.toLowerCase();return t.includes("zoom")?aa.ZOOM:t.includes("teams")?aa.MICROSOFT_TEAMS:t.includes("meet")||t.includes("google")?aa.GOOGLE_MEET:"none"}function wHe(e){return e.filter(t=>t.email).map(t=>({label:bHe(t),value:t.email}))}const jE=d.memo(({event:e,newEvent:t,onEventChange:n,isEditable:r=!0,truncateAttendees:s,noWrapper:o=!1,action:a})=>{const{$t:i}=J(),[c,u]=d.useState({event_id:e.event_id,title:e.title,start_date_time:e.start_date_time,end_date_time:e.end_date_time,attendees:e.attendees?.map(P=>({email:P.email,optional:P.optional,display_name:P.display_name,photo_url:P.photo_url})),organizer:e.organizer,description:e.description,location:e.location,link:e.link,calendar_color:e.calendar_color,event_color:e.event_color,conference_data:e.conference_data,creator:e.creator,html_description:e.html_description,is_all_day:e.is_all_day,recurrence:e.recurrence?.map(P=>P.toString())}),f=d.useRef(null),{suggestions:m,handleDraftChange:p}=hee({reason:"calendar_event"}),{connectors:h}=Sa({reason:"calendar-event-video-conferencing"}),g=d.useMemo(()=>{const P=h?.connectors??[];return{hasGoogleMeet:P.some(F=>F.connection_type===er.GCAL&&F.connected),hasZoom:P.some(F=>F.connection_type===er.ZOOM&&F.connected),hasTeams:P.some(F=>F.connection_type===er.OUTLOOK&&F.connected)}},[h?.connectors]);d.useEffect(()=>{n?.(c)},[c,n]);const y=d.useCallback(P=>{P&&u(F=>({...F,start_date_time:P.toISOString()}))},[]),x=d.useCallback(P=>{P&&u(F=>({...F,end_date_time:P.toISOString()}))},[]),v=d.useCallback(P=>{u(F=>{const R=new Date(F.start_date_time||""),[j,L]=P.split(":").map(Number);return j===void 0||L===void 0||(R.setHours(j),R.setMinutes(L),isNaN(R.getTime()))?F:{...F,start_date_time:R.toISOString()}})},[]),b=d.useCallback(P=>{u(F=>{const R=new Date(F.end_date_time||""),[j,L]=P.split(":").map(Number);return j===void 0||L===void 0||(R.setHours(j),R.setMinutes(L),isNaN(R.getTime()))?F:{...F,end_date_time:R.toISOString()}})},[]),_=({action:P,email:F,newEmail:R,displayName:j,photoUrl:L})=>{u(U=>{const O=[...U.attendees||[]];switch(P){case"add":O.some($=>$.email===F)||O.push({email:F,display_name:j,photo_url:L});break;case"delete":return{...U,attendees:O.filter($=>$.email!==F)};case"edit":return{...U,attendees:O.map($=>$.email===F?{...$,email:R}:$)}}return{...U,attendees:O}})},w=gee(e?.calendar_color?.background??"#AC725E"),S=yee(w),C=d.useCallback(P=>u(F=>({...F,title:P})),[]),E=d.useCallback((P,F)=>{const R=kme(F,"email");P.forEach(j=>{const L=R[j];_({action:"add",email:j,displayName:L?.name,photoUrl:L?.image||void 0})})},[]),N=d.useCallback(P=>{P.forEach(F=>_({action:"delete",email:F}))},[]),k=d.useCallback(P=>u(F=>({...F,location:P})),[]),I=d.useCallback(P=>{u(F=>({...F,recurrence:P}))},[]),M=d.useCallback(P=>{let F;P===aa.GOOGLE_MEET?F={entry_points:[],solution:{name:"Google Meet",key_type:"hangoutsMeet"}}:P===aa.ZOOM?F={entry_points:[],solution:{name:"Zoom",key_type:"zoom"}}:P===aa.MICROSOFT_TEAMS?F={entry_points:[],solution:{name:"Microsoft Teams",key_type:"teams"}}:F=void 0,u(R=>({...R,conference_data:F}))},[]),A=d.useCallback(P=>l.jsx(pee,{contact:P}),[]),D=d.useMemo(()=>{const P=[];return g.hasGoogleMeet&&P.push({label:i({defaultMessage:"Google Meet",id:"crZ+Bimh7N"}),value:aa.GOOGLE_MEET}),g.hasZoom&&P.push({label:i({defaultMessage:"Zoom",id:"yMbKjuDH/n"}),value:aa.ZOOM}),g.hasTeams&&P.push({label:i({defaultMessage:"Microsoft Teams",id:"IIfj4GddO3"}),value:aa.MICROSOFT_TEAMS}),P.push({label:i({defaultMessage:"No video conferencing",id:"PYY40S2Jrm"}),value:"none"}),P},[i,g]);if(!r){const{title:P}=e;if((!e.attendees||e.attendees.length==0)&&!e.start_date_time&&!e.end_date_time&&!e.title)return null;const F=l.jsxs("div",{className:"gap-md relative flex",children:[l.jsx("div",{className:z("inset-y-xs absolute left-0 w-1 shrink-0 self-stretch rounded-full",{"brightness-[0.8]":S==="Fail"}),style:{backgroundColor:w}}),l.jsxs("div",{className:"gap-md flex flex-col pl-5",children:[l.jsx(zl,{oldText:P,newText:t?.title??void 0,isDeletion:a==="DELETE"}),l.jsx(Tee,{event:e,newEvent:t,action:a,truncateAttendees:s})]})]});return o?l.jsx("div",{className:"p-md relative overflow-hidden",children:F}):l.jsx(mr,{fullBleed:!0,className:"p-md relative overflow-hidden",roundedClass:"rounded-md",children:F})}return l.jsxs(mr,{fullBleed:!0,className:"relative flex flex-col gap-4 overflow-hidden px-8 py-2",roundedClass:"rounded-md",fullBleedBorderClassname:"border-none",children:[l.jsx("div",{className:"shrink-none left-xs absolute bottom-2 top-2 w-1.5 self-stretch rounded-full"+(S==="Fail"?" brightness-[0.8]":""),style:{backgroundColor:w}}),l.jsx(co,{size:"md",type:"text",value:c.title||"",onChange:C,className:"border-subtler text-foreground w-full rounded-none rounded-t-md border-x-0 border-b border-t-0 pb-2 pl-0 pr-4 font-medium shadow-none focus:!outline-none focus:!ring-0",placeholder:i({defaultMessage:"Add title",id:"k09nVJqic1"}),isMobileUserAgent:!1}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Xs,{icon:B("clock"),alignCenter:!0,iconSize:"sm",children:l.jsx(Yee,{startDateTime:c.start_date_time,endDateTime:c.end_date_time,onStartDateChange:y,onEndDateChange:x,onStartTimeChange:v,onEndTimeChange:b})}),l.jsx(Xs,{icon:B("calendar-repeat"),iconSize:"sm",children:l.jsx(Qee,{value:c.recurrence||[],onChange:I})}),l.jsx(Xs,{icon:B("user"),iconSize:"sm",alignCenter:!0,children:l.jsx("div",{className:z("border-subtler text-foreground focus-within:border-super w-full rounded-lg border px-2",{"!px-3":!c.attendees?.length}),children:l.jsx(P6,{chips:wHe(c.attendees??[]),onAdd:E,onDelete:N,validator:LFe,placeholder:i({defaultMessage:"Add guests",id:"pP5ifNp+MS"}),suggestions:m,renderSuggestion:A,onDraftChange:p})})}),l.jsx(Xs,{icon:B("map-pin"),iconSize:"sm",alignCenter:!0,children:l.jsx(co,{type:"text",value:c.location||"",onChange:k,placeholder:i({defaultMessage:"Add rooms or location",id:"bb7ELr4Sk+"}),className:"focus:!border-super rounded-lg !px-3 focus:!ring-transparent",isMobileUserAgent:!1})}),l.jsx(Xs,{icon:B("video"),iconSize:"sm",alignCenter:!0,children:l.jsx(k2,{id:"video-conferencing-select",activeKey:_He(c.conference_data),options:D,onOptionChange:M,extraCSS:"rounded-lg pl-3 [&+div]:right-3"})}),l.jsx(Xs,{icon:B("align-left"),iconSize:"sm",children:l.jsx(LA,{wrapperClass:"bg-transparent focus-within:!border-super rounded-md px-3 py-2 text-sm focus-within:!ring-transparent",inputRef:f,isMobileUserAgent:!1,children:l.jsx(FA,{value:c.description||"",onChange:P=>u(F=>({...F,description:P})),placeholder:i({defaultMessage:"Add a description",id:"bocXKEDBwm"}),minRows:4,isMobileStyle:!1,isMobileUserAgent:!1,ref:f})})})]})]})});jE.displayName="CalendarEventLarge";var md;(function(e){e.CREATED="CREATED",e.UPDATED="UPDATED",e.DELETED="DELETED",e.REJECTED="REJECTED"})(md||(md={}));const mte=T.memo(({operation:e,isShowEditableComponentsEnabled:t,buttonVariant:n,buttonText:r,onConfirm:s,onSkip:o})=>{const{$t:a}=J(),[i,c]=d.useState();d.useEffect(()=>{c(void 0)},[e]);const u=d.useMemo(()=>{if(e?.update){const y=e.update.event,x=e.update.new_event;return y&&x?{...y,...Object.fromEntries(Object.entries(x).filter(([b,_])=>_!==null))}:x||y}return e?.add?.event||e?.delete?.event},[e]),f=d.useCallback(y=>{c(y)},[]),m=d.useCallback(y=>[{...e,...y&&{...e.add&&{add:{event:y}},...e.update&&{update:{event:y}},...e.delete&&{delete:{event:y,delete_scope:e.delete?.delete_scope}}},status:y.status.toUpperCase()}],[e]),p=d.useCallback((y,x)=>{const v=x||{...i||u,status:y};return{confirmed:!0,operations:v?m(v):[]}},[i,u,m]),h=d.useCallback(()=>{let y=md.CREATED;e.update?y=md.UPDATED:e.delete&&(y=md.DELETED),s(p(y))},[p,s,e]),g=d.useCallback(()=>{o(p(md.REJECTED))},[p,o]);return l.jsxs(l.Fragment,{children:[u&&e.delete&&l.jsx(K,{className:"px-sm mb-sm",children:l.jsx(jE,{event:u,newEvent:e.update?.new_event,isEditable:!1})}),u&&!e.delete&&l.jsx(K,{className:"px-md py-sm",children:l.jsx(jE,{event:u,newEvent:e.update?.new_event,onEventChange:f,isEditable:t})}),l.jsx("form",{onSubmit:y=>{y.preventDefault(),h()},children:l.jsx(K,{className:"px-md py-sm gap-4 border-t pt-4",children:l.jsx("div",{className:"gap-sm flex items-center justify-between",children:l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ze,{size:"small",variant:n,text:r,type:"submit"}),l.jsx(rt,{size:"small",text:a({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:g})]})})})})]})});mte.displayName="CalendarOperationItem";function CHe(){const{value:e}=Dx({flag:"show-editable-calendar-components",defaultValue:!1});return e}const SHe=({result:e,isDeleteOperation:t})=>{const{$t:n}=J();return e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("circle-check-filled"),size:14,className:"shrink-0 text-[#16a34a]",title:"Confirmed"}),l.jsx("span",{className:"text-xs font-medium leading-none text-[#16a34a]",children:n(t?{defaultMessage:"Deleted",id:"KQvWvDRI1B"}:{defaultMessage:"Accepted",id:"aFyFm0PsCy"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:n({defaultMessage:"Skipped",id:"djZCU5enGS"})})]}):null},pte=T.memo(({calendarOperations:e,sendStepResult:t,isFinished:n})=>{const r="calendar-operation-step",[s,o]=d.useState(n??!1),{$t:a}=J(),i=CHe(),[c,u]=d.useState(0),[f,m]=d.useState(()=>Array(e.length).fill(null)),p=d.useRef(!1),h=d.useMemo(()=>e[c],[e,c]),g=d.useMemo(()=>h?.delete?.event?"rejected":"inverted",[h?.delete?.event]),y=d.useMemo(()=>h?h.delete?.event?a({defaultMessage:"Delete",id:"K3r6DQW7h+"}):a({defaultMessage:"Schedule",id:"hGQqkWwmJD"}):a({defaultMessage:"Schedule",id:"hGQqkWwmJD"}),[h,a]),x=e.length>1,v=d.useMemo(()=>({position:"absolute",bottom:16,right:16,zIndex:10}),[]),b=d.useCallback(()=>{u(C=>Math.max(C-1,0))},[]),_=d.useCallback(()=>{u(C=>Math.min(C+1,e.length-1))},[e.length]),w=d.useCallback(C=>{m(E=>{const N=[...E];N[c]=C;const k=N.findIndex(M=>M===null);if(N.every(M=>M!==null)&&!p.current){p.current=!0;const M=N.map(A=>A?.operations).filter(A=>Array.isArray(A)).flat();M.length>0?t({confirmed:!0,operations:M},r,!1):t({confirmed:!1},r,!1),o(!0)}else k!==-1&&u(k);return N})},[c,t,r]),S=d.useCallback(C=>{w(C)},[w]);return s?l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:a({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):h?l.jsxs(K,{variant:"raised",className:"py-sm relative rounded-lg border",children:[l.jsx(mte,{operation:JSON.parse(JSON.stringify(h)),isShowEditableComponentsEnabled:i,buttonVariant:g,buttonText:y,onConfirm:w,onSkip:S},`operation-${c}`),x&&l.jsxs(K,{style:v,className:"flex items-center gap-4",children:[l.jsx(SHe,{result:f[c]??null,isDeleteOperation:!!h?.delete?.event}),l.jsxs("span",{className:"text-xs font-medium",children:[l.jsx("span",{className:"text-foreground",children:c+1}),l.jsxs("span",{children:[" of ",e.length]})]}),l.jsxs(K,{className:"flex gap-2",children:[l.jsx(fee,{disabled:c===0,onClick:b}),l.jsx(mee,{disabled:c===e.length-1,onClick:_})]})]})]}):l.jsx(K,{variant:"raised",className:"py-sm relative rounded-lg border",children:l.jsx("div",{className:"p-4 text-center",children:a({defaultMessage:"No calendar operation available",id:"Hm6yv1Uz2P"})})})});pte.displayName="CalendarOperationStep";const Pm=.03,EHe=3,tm=T.memo(({items:e,initialDisplayCount:t=EHe,stepDelay:n=Pm,isFinished:r=!1,vertical:s=!1,truncate:o=!0,onCountChange:a})=>{const[i,c]=d.useState([]),[u,f]=d.useState(!1),m=d.useRef(null),p=d.useRef(!0),h=d.useRef(r),g=d.useRef(0);d.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),d.useEffect(()=>{if(a){const C=o&&(n!==Pm?r&&i.length{const w=o?t:e.length;if(p.current)if(p.current=!1,e.length>0)if(r){const C=Math.min(w,e.length);c(e.slice(0,C)),g.current=C}else c([e[0]]),g.current=1;else c([]),g.current=0;if(u){c(e),g.current=e.length;return}if(r&&!h.current&&(m.current&&(clearTimeout(m.current),m.current=null),c(()=>{const C=Math.min(w,e.length),E=e.slice(0,C);return g.current=E.length,E})),h.current=r,m.current&&(clearTimeout(m.current),m.current=null),g.current>=w||g.current>=e.length)return;const S=()=>{let C=0;if(c(E=>E.length0){const C=r?Pm:n;m.current=setTimeout(S,C*1e3)}else e.length>0&&(c([e[0]]),g.current=1)},[e,t,n,r,u,o]);const y={initial:{opacity:0,x:-3},animate:{opacity:1,x:0}},x=()=>{f(!0)},b=o&&(n!==Pm?r&&i.length{w.stopPropagation(),x()},[]);return l.jsxs("div",{className:`flex items-center ${s?"flex-col items-start gap-px":"gap-sm flex-wrap"}`,children:[i.map((w,S)=>l.jsx(Te.div,{className:s?"w-full":"inline-flex",variants:y,initial:"initial",animate:"animate",transition:{duration:.1,ease:Yd},children:w},S)),b&&l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs cursor-pointer rounded-lg px-2.5",onClick:_,children:l.jsx(V,{variant:"tinyMono",className:"!text-[0.68rem]",children:l.jsx(Ne,{defaultMessage:"+{count} more",id:"/zFGgPmQSV",values:{count:e.length-i.length}})})})]})});tm.displayName="ResultsRenderer";const gs=T.memo(({queries:e,icon:t=B("search"),stepDelay:n,isFinished:r,initialDisplayCount:s=12,enableQueryLinks:o=!1})=>{const a=e.map((i,c)=>l.jsx(Dr,{icon:t,text:i,url:o?`/search/new?q=${encodeURIComponent(i)}`:void 0},c));return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(tm,{items:a,initialDisplayCount:s,stepDelay:n,isFinished:r})})});gs.displayName="SearchWebStep";const hte=T.memo(({operations:e})=>{const{$t:t,formatMessage:n}=J(),r=d.useMemo(()=>{const a={created:0,updated:0,deleted:0,rejected:0};return e.forEach(i=>{switch(i.status?.toUpperCase()){case"CREATED":a.created++;break;case"UPDATED":a.updated++;break;case"DELETED":a.deleted++;break;case"REJECTED":a.rejected++;break}}),a},[e]),s=d.useMemo(()=>{const a=[];return r.created>0&&a.push({count:r.created,label:t({defaultMessage:"Created",id:"ORGv1Q6rL/"})}),r.updated>0&&a.push({count:r.updated,label:t({defaultMessage:"Updated",id:"xrk6zgu9jU"})}),r.deleted>0&&a.push({count:r.deleted,label:t({defaultMessage:"Deleted",id:"KQvWvDRI1B"})}),r.rejected>0&&a.push({count:r.rejected,label:t({defaultMessage:"Rejected",id:"5qaD7sDVxu"})}),a},[r,t]),o=d.useMemo(()=>s.length===0?[]:[s.map(a=>n({defaultMessage:"{count} {status}",id:"e6QlErEcyz"},{count:a.count,status:a.label})).join(", ")],[s,n]);return o.length===0?null:l.jsx(gs,{icon:B("calendar"),queries:o})});hte.displayName="CalendarStatusSummary";const kHe=()=>l.jsxs(K,{variant:zx.subtler,className:"p-sm gap-sm flex h-[52px] w-fit min-w-[200px] items-center rounded-lg",children:[l.jsx(K,{variant:"subtler",className:"aspect-square h-full rounded-md"}),l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(K,{variant:"subtler",className:"h-1.5 w-24 rounded-full"}),l.jsx(K,{variant:"subtler",className:"h-1.5 w-16 rounded-full"})]})]}),gte=T.memo(({assetTypes:e,assetTypeLabels:t,isFinished:n})=>{const{$t:r}=J();if(e.length===0)return l.jsxs("div",{className:"my-sm gap-sm flex flex-col",children:[l.jsx(V,{variant:"tinyRegular",color:n?"light":"super",className:"flex items-center gap-1",children:l.jsx(wr,{variant:"super",active:!n,as:"span",speed:"slow",children:r({defaultMessage:"Creating an asset",id:"/gKNbCoSJB"})})}),l.jsx(kHe,{})]});const s=e[e.length-1],o=s?t[s]||s.toLowerCase():r({defaultMessage:"an asset",id:"+rur3MSgJV"});return l.jsx(kt,{mode:"wait",children:l.jsx(Te.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:[.4,0,.2,1]},children:l.jsx(V,{variant:"tinyRegular",color:n?"light":"super",className:"flex items-center gap-1 py-1.5",children:l.jsx(wr,{variant:"super",active:!n,as:"span",speed:"slow",children:r({defaultMessage:"Creating {assetLabel}",id:"irVMYqmEjR"},{assetLabel:o})})})},s)})});gte.displayName="CanvasAgentStep";const yte=T.memo(({step:e})=>{const t=e.content.clarification;return t?l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsx(Dr,{icon:B("message-plus"),text:t})}):null});yte.displayName="ClarificationStep";var Bn="-ms-",Pp="-moz-",hn="-webkit-",xte="comm",Hv="rule",O6="decl",MHe="@import",vte="@keyframes",THe="@layer",bte=Math.abs,L6=String.fromCharCode,IE=Object.assign;function AHe(e,t){return jr(e,0)^45?(((t<<2^jr(e,0))<<2^jr(e,1))<<2^jr(e,2))<<2^jr(e,3):0}function _te(e){return e.trim()}function Ei(e,t){return(e=t.exec(e))?e[0]:e}function Wt(e,t,n){return e.replace(t,n)}function xy(e,t,n){return e.indexOf(t,n)}function jr(e,t){return e.charCodeAt(t)|0}function tf(e,t,n){return e.slice(t,n)}function Ba(e){return e.length}function wte(e){return e.length}function ap(e,t){return t.push(e),e}function NHe(e,t){return e.map(t).join("")}function zI(e,t){return e.filter(function(n){return!Ei(n,t)})}var zv=1,nf=1,Cte=0,Bo=0,_r=0,nm="";function Wv(e,t,n,r,s,o,a,i){return{value:e,root:t,parent:n,type:r,props:s,children:o,line:zv,column:nf,length:a,return:"",siblings:i}}function ml(e,t){return IE(Wv("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Uu(e){for(;e.root;)e=ml(e.root,{children:[e]});ap(e,e.siblings)}function RHe(){return _r}function DHe(){return _r=Bo>0?jr(nm,--Bo):0,nf--,_r===10&&(nf=1,zv--),_r}function pa(){return _r=Bo2||PE(_r)>3?"":" "}function OHe(e,t){for(;--t&&pa()&&!(_r<48||_r>102||_r>57&&_r<65||_r>70&&_r<97););return Gv(e,vy()+(t<6&&Bc()==32&&pa()==32))}function OE(e){for(;pa();)switch(_r){case e:return Bo;case 34:case 39:e!==34&&e!==39&&OE(_r);break;case 40:e===41&&OE(e);break;case 92:pa();break}return Bo}function LHe(e,t){for(;pa()&&e+_r!==57;)if(e+_r===84&&Bc()===47)break;return"/*"+Gv(t,Bo-1)+"*"+L6(e===47?e:pa())}function FHe(e){for(;!PE(Bc());)pa();return Gv(e,Bo)}function BHe(e){return IHe(by("",null,null,null,[""],e=jHe(e),0,[0],e))}function by(e,t,n,r,s,o,a,i,c){for(var u=0,f=0,m=a,p=0,h=0,g=0,y=1,x=1,v=1,b=0,_="",w=s,S=o,C=r,E=_;x;)switch(g=b,b=pa()){case 40:if(g!=108&&jr(E,m-1)==58){xy(E+=Wt(Tw(b),"&","&\f"),"&\f",bte(u?i[u-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:E+=Tw(b);break;case 9:case 10:case 13:case 32:E+=PHe(g);break;case 92:E+=OHe(vy()-1,7);continue;case 47:switch(Bc()){case 42:case 47:ap(UHe(LHe(pa(),vy()),t,n,c),c);break;default:E+="/"}break;case 123*y:i[u++]=Ba(E)*v;case 125*y:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+f:v==-1&&(E=Wt(E,/\f/g,"")),h>0&&Ba(E)-m&&ap(h>32?GI(E+";",r,n,m-1,c):GI(Wt(E," ","")+";",r,n,m-2,c),c);break;case 59:E+=";";default:if(ap(C=WI(E,t,n,u,f,s,i,_,w=[],S=[],m,o),o),b===123)if(f===0)by(E,t,C,C,w,o,m,i,S);else switch(p===99&&jr(E,3)===110?100:p){case 100:case 108:case 109:case 115:by(e,C,C,r&&ap(WI(e,C,C,0,0,s,i,_,s,w=[],m,S),S),s,S,m,i,r?w:S);break;default:by(E,C,C,C,[""],S,0,i,S)}}u=f=h=0,y=v=1,_=E="",m=a;break;case 58:m=1+Ba(E),h=g;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&DHe()==125)continue}switch(E+=L6(b),b*y){case 38:v=f>0?1:(E+="\f",-1);break;case 44:i[u++]=(Ba(E)-1)*v,v=1;break;case 64:Bc()===45&&(E+=Tw(pa())),p=Bc(),f=m=Ba(_=E+=FHe(vy())),b++;break;case 45:g===45&&Ba(E)==2&&(y=0)}}return o}function WI(e,t,n,r,s,o,a,i,c,u,f,m){for(var p=s-1,h=s===0?o:[""],g=wte(h),y=0,x=0,v=0;y0?h[b]+" "+_:Wt(_,/&\f/g,h[b])))&&(c[v++]=w);return Wv(e,t,n,s===0?Hv:i,c,u,f,m)}function UHe(e,t,n,r){return Wv(e,t,n,xte,L6(RHe()),tf(e,2,-2),0,r)}function GI(e,t,n,r,s){return Wv(e,t,n,O6,tf(e,0,r),tf(e,r+1,-1),r,s)}function Ste(e,t,n){switch(AHe(e,t)){case 5103:return hn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return hn+e+e;case 4789:return Pp+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return hn+e+Pp+e+Bn+e+e;case 5936:switch(jr(e,t+11)){case 114:return hn+e+Bn+Wt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return hn+e+Bn+Wt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return hn+e+Bn+Wt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return hn+e+Bn+e+e;case 6165:return hn+e+Bn+"flex-"+e+e;case 5187:return hn+e+Wt(e,/(\w+).+(:[^]+)/,hn+"box-$1$2"+Bn+"flex-$1$2")+e;case 5443:return hn+e+Bn+"flex-item-"+Wt(e,/flex-|-self/g,"")+(Ei(e,/flex-|baseline/)?"":Bn+"grid-row-"+Wt(e,/flex-|-self/g,""))+e;case 4675:return hn+e+Bn+"flex-line-pack"+Wt(e,/align-content|flex-|-self/g,"")+e;case 5548:return hn+e+Bn+Wt(e,"shrink","negative")+e;case 5292:return hn+e+Bn+Wt(e,"basis","preferred-size")+e;case 6060:return hn+"box-"+Wt(e,"-grow","")+hn+e+Bn+Wt(e,"grow","positive")+e;case 4554:return hn+Wt(e,/([^-])(transform)/g,"$1"+hn+"$2")+e;case 6187:return Wt(Wt(Wt(e,/(zoom-|grab)/,hn+"$1"),/(image-set)/,hn+"$1"),e,"")+e;case 5495:case 3959:return Wt(e,/(image-set\([^]*)/,hn+"$1$`$1");case 4968:return Wt(Wt(e,/(.+:)(flex-)?(.*)/,hn+"box-pack:$3"+Bn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+hn+e+e;case 4200:if(!Ei(e,/flex-|baseline/))return Bn+"grid-column-align"+tf(e,t)+e;break;case 2592:case 3360:return Bn+Wt(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,s){return t=s,Ei(r.props,/grid-\w+-end/)})?~xy(e+(n=n[t].value),"span",0)?e:Bn+Wt(e,"-start","")+e+Bn+"grid-row-span:"+(~xy(n,"span",0)?Ei(n,/\d+/):+Ei(n,/\d+/)-+Ei(e,/\d+/))+";":Bn+Wt(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Ei(r.props,/grid-\w+-start/)})?e:Bn+Wt(Wt(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Wt(e,/(.+)-inline(.+)/,hn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ba(e)-1-t>6)switch(jr(e,t+1)){case 109:if(jr(e,t+4)!==45)break;case 102:return Wt(e,/(.+:)(.+)-([^]+)/,"$1"+hn+"$2-$3$1"+Pp+(jr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~xy(e,"stretch",0)?Ste(Wt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Wt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,s,o,a,i,c,u){return Bn+s+":"+o+u+(a?Bn+s+"-span:"+(i?c:+c-+o)+u:"")+e});case 4949:if(jr(e,t+6)===121)return Wt(e,":",":"+hn)+e;break;case 6444:switch(jr(e,jr(e,14)===45?18:11)){case 120:return Wt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+hn+(jr(e,14)===45?"inline-":"")+"box$3$1"+hn+"$2$3$1"+Bn+"$2box$3")+e;case 100:return Wt(e,":",":"+Bn)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Wt(e,"scroll-","scroll-snap-")+e}return e}function M2(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case O6:e.return=Ste(e.value,e.length,n);return;case vte:return M2([ml(e,{value:Wt(e.value,"@","@"+hn)})],r);case Hv:if(e.length)return NHe(n=e.props,function(s){switch(Ei(s,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Uu(ml(e,{props:[Wt(s,/:(read-\w+)/,":"+Pp+"$1")]})),Uu(ml(e,{props:[s]})),IE(e,{props:zI(n,r)});break;case"::placeholder":Uu(ml(e,{props:[Wt(s,/:(plac\w+)/,":"+hn+"input-$1")]})),Uu(ml(e,{props:[Wt(s,/:(plac\w+)/,":"+Pp+"$1")]})),Uu(ml(e,{props:[Wt(s,/:(plac\w+)/,Bn+"input-$1")]})),Uu(ml(e,{props:[s]})),IE(e,{props:zI(n,r)});break}return""})}}var GHe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ys={},rf=typeof process<"u"&&Ys!==void 0&&(Ys.REACT_APP_SC_ATTR||Ys.SC_ATTR)||"data-styled",Ete="active",kte="data-styled-version",$v="6.1.15",F6=`/*!sc*/ -`,T2=typeof window<"u"&&"HTMLElement"in window,$He=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Ys!==void 0&&Ys.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Ys.REACT_APP_SC_DISABLE_SPEEDY!==""?Ys.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Ys.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Ys!==void 0&&Ys.SC_DISABLE_SPEEDY!==void 0&&Ys.SC_DISABLE_SPEEDY!==""&&Ys.SC_DISABLE_SPEEDY!=="false"&&Ys.SC_DISABLE_SPEEDY),qv=Object.freeze([]),sf=Object.freeze({});function Mte(e,t,n){return n===void 0&&(n=sf),e.theme!==n.theme&&e.theme||t||n.theme}var Tte=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),qHe=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,KHe=/(^-|-$)/g;function $I(e){return e.replace(qHe,"-").replace(KHe,"")}var YHe=/(a)(d)/gi,r1=52,qI=function(e){return String.fromCharCode(e+(e>25?39:97))};function LE(e){var t,n="";for(t=Math.abs(e);t>r1;t=t/r1|0)n=qI(t%r1)+n;return(qI(t%r1)+n).replace(YHe,"$1-$2")}var Aw,Ate=5381,pd=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Nte=function(e){return pd(Ate,e)};function QHe(e){return LE(Nte(e)>>>0)}function Rte(e){return e.displayName||e.name||"Component"}function Nw(e){return typeof e=="string"&&!0}var Dte=typeof Symbol=="function"&&Symbol.for,jte=Dte?Symbol.for("react.memo"):60115,XHe=Dte?Symbol.for("react.forward_ref"):60112,ZHe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},JHe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ite={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},eze=((Aw={})[XHe]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Aw[jte]=Ite,Aw);function KI(e){return("type"in(t=e)&&t.type.$$typeof)===jte?Ite:"$$typeof"in e?eze[e.$$typeof]:ZHe;var t}var tze=Object.defineProperty,nze=Object.getOwnPropertyNames,YI=Object.getOwnPropertySymbols,rze=Object.getOwnPropertyDescriptor,sze=Object.getPrototypeOf,QI=Object.prototype;function B6(e,t,n){if(typeof t!="string"){if(QI){var r=sze(t);r&&r!==QI&&B6(e,r,n)}var s=nze(t);YI&&(s=s.concat(YI(t)));for(var o=KI(e),a=KI(t),i=0;i0?" Args: ".concat(t.join(", ")):""))}var oze=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,s=r.length,o=s;t>=o;)if((o<<=1)<0)throw Lg(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=s;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],s=this.indexOfGroup(t),o=s+r,a=s;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(x+="".concat(v,","))}),c+="".concat(g).concat(y,'{content:"').concat(x,'"}').concat(F6)},f=0;f0?".".concat(t):p},f=c.slice();f.push(function(p){p.type===Hv&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(gze,n).replace(r,u))}),a.prefix&&f.push(WHe),f.push(VHe);var m=function(p,h,g,y){h===void 0&&(h=""),g===void 0&&(g=""),y===void 0&&(y="&"),t=y,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var x=p.replace(yze,""),v=BHe(g||h?"".concat(g," ").concat(h," { ").concat(x," }"):x);a.namespace&&(v=Lte(v,a.namespace));var b=[];return M2(v,HHe(f.concat(zHe(function(_){return b.push(_)})))),b};return m.hash=c.length?c.reduce(function(p,h){return h.name||Lg(15),pd(p,h.name)},Ate).toString():"",m}var vze=new Ote,BE=xze(),Fte=T.createContext({shouldForwardProp:void 0,styleSheet:vze,stylis:BE});Fte.Consumer;T.createContext(void 0);function eP(){return d.useContext(Fte)}var bze=(function(){function e(t,n){var r=this;this.inject=function(s,o){o===void 0&&(o=BE);var a=r.name+o.hash;s.hasNameForId(r.id,a)||s.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,V6(this,function(){throw Lg(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=BE),this.name+t.hash},e})(),_ze=function(e){return e>="A"&&e<="Z"};function tP(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,i)}s=Dc(s,a),this.staticRulesId=a}else{for(var c=pd(this.baseHash,r.hash),u="",f=0;f>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(u,".".concat(h),void 0,this.componentId)),s=Dc(s,h)}}return s},e})(),H6=T.createContext(void 0);H6.Consumer;var Rw={};function Eze(e,t,n){var r=U6(e),s=e,o=!Nw(e),a=t.attrs,i=a===void 0?qv:a,c=t.componentId,u=c===void 0?(function(w,S){var C=typeof w!="string"?"sc":$I(w);Rw[C]=(Rw[C]||0)+1;var E="".concat(C,"-").concat(QHe($v+C+Rw[C]));return S?"".concat(S,"-").concat(E):E})(t.displayName,t.parentComponentId):c,f=t.displayName,m=f===void 0?(function(w){return Nw(w)?"styled.".concat(w):"Styled(".concat(Rte(w),")")})(e):f,p=t.displayName&&t.componentId?"".concat($I(t.displayName),"-").concat(t.componentId):t.componentId||u,h=r&&s.attrs?s.attrs.concat(i).filter(Boolean):i,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var y=s.shouldForwardProp;if(t.shouldForwardProp){var x=t.shouldForwardProp;g=function(w,S){return y(w,S)&&x(w,S)}}else g=y}var v=new Sze(n,p,r?s.componentStyle:void 0);function b(w,S){return(function(C,E,N){var k=C.attrs,I=C.componentStyle,M=C.defaultProps,A=C.foldedComponentIds,D=C.styledComponentId,P=C.target,F=T.useContext(H6),R=eP(),j=C.shouldForwardProp||R.shouldForwardProp,L=Mte(E,F,M)||sf,U=(function(Y,te,se){for(var ae,X=no(no({},te),{className:void 0,theme:se}),ee=0;eee.length)&&(t=e.length);for(var n=0,r=Array(t);n=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Dw={};function Pze(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return Dw[t]||(Dw[t]=Ize(e)),Dw[t]}function Oze(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter(function(o){return o!=="token"}),s=Pze(r);return s.reduce(function(o,a){return hd(hd({},o),n[a])},t)}function oP(e){return e.join(" ")}function Lze(e,t){var n=0;return function(r){return n+=1,r.map(function(s,o){return zte({node:s,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})})}}function zte(e){var t=e.node,n=e.stylesheet,r=e.style,s=r===void 0?{}:r,o=e.useInlineStyles,a=e.key,i=t.properties,c=t.type,u=t.tagName,f=t.value;if(c==="text")return f;if(u){var m=Lze(n,o),p;if(!o)p=hd(hd({},i),{},{className:oP(i.className)});else{var h=Object.keys(n).reduce(function(v,b){return b.split(".").forEach(function(_){v.includes(_)||v.push(_)}),v},[]),g=i.className&&i.className.includes("token")?["token"]:[],y=i.className&&g.concat(i.className.filter(function(v){return!h.includes(v)}));p=hd(hd({},i),{},{className:oP(y)||void 0,style:Oze(i.className,Object.assign({},i.style,s),n)})}var x=m(t.children);return T.createElement(u,vh({key:a},p),x)}}const Fze=(function(e,t){var n=e.listLanguages();return n.indexOf(t)!==-1});var Bze=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function aP(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 wl(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r2&&arguments[2]!==void 0?arguments[2]:[];return Cy({children:S,lineNumber:C,lineNumberStyle:i,largestLineNumber:a,showInlineLineNumbers:s,lineProps:n,className:E,showLineNumbers:r,wrapLongLines:c,wrapLines:t})}function y(S,C){if(r&&C&&s){var E=Gte(i,C,a);S.unshift(Wte(C,E))}return S}function x(S,C){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||E.length>0?g(S,C,E):y(S,C)}for(var v=function(){var C=f[h],E=C.children[0].value,N=Vze(E);if(N){var k=E.split(` -`);k.forEach(function(I,M){var A=r&&m.length+o,D={type:"text",value:"".concat(I,` -`)};if(M===0){var P=f.slice(p+1,h).concat(Cy({children:[D],className:C.properties.className})),F=x(P,A);m.push(F)}else if(M===k.length-1){var R=f[h+1]&&f[h+1].children&&f[h+1].children[0],j={type:"text",value:"".concat(I)};if(R){var L=Cy({children:[j],className:C.properties.className});f.splice(h+1,0,L)}else{var U=[j],O=x(U,A,C.properties.className);m.push(O)}}else{var $=[D],G=x($,A,C.properties.className);m.push(G)}}),p=h}h++};h=0;--O){var $=this.tryEntries[O],G=$.completion;if($.tryLoc==="root")return U("end");if($.tryLoc<=this.prev){var H=r.call($,"catchLoc"),Q=r.call($,"finallyLoc");if(H&&Q){if(this.prev<$.catchLoc)return U($.catchLoc,!0);if(this.prev<$.finallyLoc)return U($.finallyLoc)}else if(H){if(this.prev<$.catchLoc)return U($.catchLoc,!0)}else{if(!Q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return U($.finallyLoc)}}}},abrupt:function(j,L){for(var U=this.tryEntries.length-1;U>=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev=0;--L){var U=this.tryEntries[L];if(U.finallyLoc===j)return this.complete(U.completion,U.afterLoc),D(U),x}},catch:function(j){for(var L=this.tryEntries.length-1;L>=0;--L){var U=this.tryEntries[L];if(U.tryLoc===j){var O=U.completion;if(O.type==="throw"){var $=O.arg;D(U)}return $}}throw Error("illegal catch attempt")},delegateYield:function(j,L,U){return this.delegate={iterator:F(j),resultName:L,nextLoc:U},this.method==="next"&&(this.arg=e),x}},t}function eWe(e,t,n){return t=N2(t),Zze(e,Yte()?Reflect.construct(t,n||[],N2(e).constructor):t.apply(e,n))}function Yte(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yte=function(){return!!e})()}const tWe=(function(e){var t,n=e.loader,r=e.isLanguageRegistered,s=e.registerLanguage,o=e.languageLoaders,a=e.noAsyncLoadingLanguages,i=(function(c){function u(){return Yze(this,u),eWe(this,u,arguments)}return Jze(u,c),Qze(u,[{key:"componentDidUpdate",value:function(){!u.isRegistered(this.props.language)&&o&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var m=this;u.astGeneratorPromise||u.loadAstGenerator(),u.astGenerator||u.astGeneratorPromise.then(function(){m.forceUpdate()}),!u.isRegistered(this.props.language)&&o&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var m=this,p=this.props.language;p!=="text"&&u.loadLanguage(p).then(function(){return m.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(m){return u.isSupportedLanguage(m)?m:"text"}},{key:"render",value:function(){return T.createElement(u.highlightInstance,vh({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:u.astGenerator}))}}],[{key:"preload",value:function(){return u.loadAstGenerator()}},{key:"loadLanguage",value:(function(){var f=Kte(WE().mark(function p(h){var g;return WE().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(g=o[h],typeof g!="function"){x.next=5;break}return x.abrupt("return",g(u.registerLanguage));case 5:throw new Error("Language ".concat(h," not supported"));case 6:case"end":return x.stop()}},p)}));function m(p){return f.apply(this,arguments)}return m})()},{key:"isSupportedLanguage",value:function(m){return u.isRegistered(m)||typeof o[m]=="function"}},{key:"loadAstGenerator",value:function(){return u.astGeneratorPromise=n().then(function(m){u.astGenerator=m,s&&u.languages.forEach(function(p,h){return s(m,h,p)})}),u.astGeneratorPromise}}])})(T.PureComponent);return t=i,ki(i,"astGenerator",null),ki(i,"highlightInstance",Kze(null,{})),ki(i,"astGeneratorPromise",null),ki(i,"languages",new Map),ki(i,"supportedLanguages",e.supportedLanguages||Object.keys(o||{})),ki(i,"isRegistered",function(c){if(a)return!0;if(!s)throw new Error("Current syntax highlighter doesn't support registration of languages");return t.astGenerator?r(t.astGenerator,c):t.languages.has(c)}),ki(i,"registerLanguage",function(c,u){if(!s)throw new Error("Current syntax highlighter doesn't support registration of languages");if(t.astGenerator)return s(t.astGenerator,c,u);t.languages.set(c,u)}),i});function GE(){GE=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(R,j,L){R[j]=L.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(R,j,L){return Object.defineProperty(R,j,{value:L,enumerable:!0,configurable:!0,writable:!0}),R[j]}try{u({},"")}catch{u=function(L,U,O){return L[U]=O}}function f(R,j,L,U){var O=j&&j.prototype instanceof v?j:v,$=Object.create(O.prototype),G=new P(U||[]);return s($,"_invoke",{value:I(R,L,G)}),$}function m(R,j,L){try{return{type:"normal",arg:R.call(j,L)}}catch(U){return{type:"throw",arg:U}}}t.wrap=f;var p="suspendedStart",h="suspendedYield",g="executing",y="completed",x={};function v(){}function b(){}function _(){}var w={};u(w,a,function(){return this});var S=Object.getPrototypeOf,C=S&&S(S(F([])));C&&C!==n&&r.call(C,a)&&(w=C);var E=_.prototype=v.prototype=Object.create(w);function N(R){["next","throw","return"].forEach(function(j){u(R,j,function(L){return this._invoke(j,L)})})}function k(R,j){function L(O,$,G,H){var Q=m(R[O],R,$);if(Q.type!=="throw"){var Y=Q.arg,te=Y.value;return te&&ri(te)=="object"&&r.call(te,"__await")?j.resolve(te.__await).then(function(se){L("next",se,G,H)},function(se){L("throw",se,G,H)}):j.resolve(te).then(function(se){Y.value=se,G(Y)},function(se){return L("throw",se,G,H)})}H(Q.arg)}var U;s(this,"_invoke",{value:function($,G){function H(){return new j(function(Q,Y){L($,G,Q,Y)})}return U=U?U.then(H,H):H()}})}function I(R,j,L){var U=p;return function(O,$){if(U===g)throw Error("Generator is already running");if(U===y){if(O==="throw")throw $;return{value:e,done:!0}}for(L.method=O,L.arg=$;;){var G=L.delegate;if(G){var H=M(G,L);if(H){if(H===x)continue;return H}}if(L.method==="next")L.sent=L._sent=L.arg;else if(L.method==="throw"){if(U===p)throw U=y,L.arg;L.dispatchException(L.arg)}else L.method==="return"&&L.abrupt("return",L.arg);U=g;var Q=m(R,j,L);if(Q.type==="normal"){if(U=L.done?y:h,Q.arg===x)continue;return{value:Q.arg,done:L.done}}Q.type==="throw"&&(U=y,L.method="throw",L.arg=Q.arg)}}}function M(R,j){var L=j.method,U=R.iterator[L];if(U===e)return j.delegate=null,L==="throw"&&R.iterator.return&&(j.method="return",j.arg=e,M(R,j),j.method==="throw")||L!=="return"&&(j.method="throw",j.arg=new TypeError("The iterator does not provide a '"+L+"' method")),x;var O=m(U,R.iterator,j.arg);if(O.type==="throw")return j.method="throw",j.arg=O.arg,j.delegate=null,x;var $=O.arg;return $?$.done?(j[R.resultName]=$.value,j.next=R.nextLoc,j.method!=="return"&&(j.method="next",j.arg=e),j.delegate=null,x):$:(j.method="throw",j.arg=new TypeError("iterator result is not an object"),j.delegate=null,x)}function A(R){var j={tryLoc:R[0]};1 in R&&(j.catchLoc=R[1]),2 in R&&(j.finallyLoc=R[2],j.afterLoc=R[3]),this.tryEntries.push(j)}function D(R){var j=R.completion||{};j.type="normal",delete j.arg,R.completion=j}function P(R){this.tryEntries=[{tryLoc:"root"}],R.forEach(A,this),this.reset(!0)}function F(R){if(R||R===""){var j=R[a];if(j)return j.call(R);if(typeof R.next=="function")return R;if(!isNaN(R.length)){var L=-1,U=function O(){for(;++L=0;--O){var $=this.tryEntries[O],G=$.completion;if($.tryLoc==="root")return U("end");if($.tryLoc<=this.prev){var H=r.call($,"catchLoc"),Q=r.call($,"finallyLoc");if(H&&Q){if(this.prev<$.catchLoc)return U($.catchLoc,!0);if(this.prev<$.finallyLoc)return U($.finallyLoc)}else if(H){if(this.prev<$.catchLoc)return U($.catchLoc,!0)}else{if(!Q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return U($.finallyLoc)}}}},abrupt:function(j,L){for(var U=this.tryEntries.length-1;U>=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev=0;--L){var U=this.tryEntries[L];if(U.finallyLoc===j)return this.complete(U.completion,U.afterLoc),D(U),x}},catch:function(j){for(var L=this.tryEntries.length-1;L>=0;--L){var U=this.tryEntries[L];if(U.tryLoc===j){var O=U.completion;if(O.type==="throw"){var $=O.arg;D(U)}return $}}throw Error("illegal catch attempt")},delegateYield:function(j,L,U){return this.delegate={iterator:F(j),resultName:L,nextLoc:U},this.method==="next"&&(this.arg=e),x}},t}const ne=(function(e,t){return(function(){var n=Kte(GE().mark(function r(s){var o;return GE().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,t();case 2:o=i.sent,s(e,o.default||o);case 4:case"end":return i.stop()}},r)}));return function(r){return n.apply(this,arguments)}})()}),nWe={abap:ne("abap",function(){return q(()=>import("./abap-BiKYM7nu.js").then(e=>e.a),__vite__mapDeps([156,1]))}),abnf:ne("abnf",function(){return q(()=>import("./abnf-8KHBl4SU.js").then(e=>e.a),__vite__mapDeps([157,1]))}),actionscript:ne("actionscript",function(){return q(()=>import("./actionscript-BDfgnI_2.js").then(e=>e.a),__vite__mapDeps([158,1]))}),ada:ne("ada",function(){return q(()=>import("./ada-pT0wE1jT.js").then(e=>e.a),__vite__mapDeps([159,1]))}),agda:ne("agda",function(){return q(()=>import("./agda-BVgYyS_B.js").then(e=>e.a),__vite__mapDeps([160,1]))}),al:ne("al",function(){return q(()=>import("./al-DYI_knPF.js").then(e=>e.a),__vite__mapDeps([161,1]))}),antlr4:ne("antlr4",function(){return q(()=>import("./antlr4-Dcs8y6-e.js").then(e=>e.a),__vite__mapDeps([162,1]))}),apacheconf:ne("apacheconf",function(){return q(()=>import("./apacheconf-BeuGc_UW.js").then(e=>e.a),__vite__mapDeps([163,1]))}),apex:ne("apex",function(){return q(()=>import("./apex-C46QKnqF.js").then(e=>e.a),__vite__mapDeps([164,1,165]))}),apl:ne("apl",function(){return q(()=>import("./apl-D3CFL3-O.js").then(e=>e.a),__vite__mapDeps([166,1]))}),applescript:ne("applescript",function(){return q(()=>import("./applescript-UKM8t7IT.js").then(e=>e.a),__vite__mapDeps([167,1]))}),aql:ne("aql",function(){return q(()=>import("./aql-JdJXKSA1.js").then(e=>e.a),__vite__mapDeps([168,1]))}),arduino:ne("arduino",function(){return q(()=>import("./arduino-Cgk25tM9.js").then(e=>e.a),__vite__mapDeps([169,1,170,171]))}),arff:ne("arff",function(){return q(()=>import("./arff-BvtRHTjx.js").then(e=>e.a),__vite__mapDeps([172,1]))}),asciidoc:ne("asciidoc",function(){return q(()=>import("./asciidoc-hH46k-cj.js").then(e=>e.a),__vite__mapDeps([173,1]))}),asm6502:ne("asm6502",function(){return q(()=>import("./asm6502-Ce01JAP9.js").then(e=>e.a),__vite__mapDeps([174,1]))}),asmatmel:ne("asmatmel",function(){return q(()=>import("./asmatmel-73kokPNV.js").then(e=>e.a),__vite__mapDeps([175,1]))}),aspnet:ne("aspnet",function(){return q(()=>import("./aspnet-DSiaQID1.js").then(e=>e.a),__vite__mapDeps([176,1,177]))}),autohotkey:ne("autohotkey",function(){return q(()=>import("./autohotkey-B_uQtKf0.js").then(e=>e.a),__vite__mapDeps([178,1]))}),autoit:ne("autoit",function(){return q(()=>import("./autoit-EdcKUAIu.js").then(e=>e.a),__vite__mapDeps([179,1]))}),avisynth:ne("avisynth",function(){return q(()=>import("./avisynth-B5LB8Vdx.js").then(e=>e.a),__vite__mapDeps([180,1]))}),avroIdl:ne("avroIdl",function(){return q(()=>import("./avro-idl-DFr56LZ2.js").then(e=>e.a),__vite__mapDeps([181,1]))}),bash:ne("bash",function(){return q(()=>import("./bash-DmK8JH5Y.js").then(e=>e.b),__vite__mapDeps([182,1,183]))}),basic:ne("basic",function(){return q(()=>import("./basic-GQNZVm0I.js").then(e=>e.b),__vite__mapDeps([184,1,185]))}),batch:ne("batch",function(){return q(()=>import("./batch-q5qLUxNp.js").then(e=>e.b),__vite__mapDeps([186,1]))}),bbcode:ne("bbcode",function(){return q(()=>import("./bbcode-DIQpPCpQ.js").then(e=>e.b),__vite__mapDeps([187,1]))}),bicep:ne("bicep",function(){return q(()=>import("./bicep-43qgYCRB.js").then(e=>e.b),__vite__mapDeps([188,1]))}),birb:ne("birb",function(){return q(()=>import("./birb-WL4Wzs1I.js").then(e=>e.b),__vite__mapDeps([189,1]))}),bison:ne("bison",function(){return q(()=>import("./bison-DgNGY4MZ.js").then(e=>e.b),__vite__mapDeps([190,1,171]))}),bnf:ne("bnf",function(){return q(()=>import("./bnf-CwU415oh.js").then(e=>e.b),__vite__mapDeps([191,1]))}),brainfuck:ne("brainfuck",function(){return q(()=>import("./brainfuck-BRUtMqwa.js").then(e=>e.b),__vite__mapDeps([192,1]))}),brightscript:ne("brightscript",function(){return q(()=>import("./brightscript-CvEhDk7S.js").then(e=>e.b),__vite__mapDeps([193,1]))}),bro:ne("bro",function(){return q(()=>import("./bro-CqltG-l9.js").then(e=>e.b),__vite__mapDeps([194,1]))}),bsl:ne("bsl",function(){return q(()=>import("./bsl-DUqbypHr.js").then(e=>e.b),__vite__mapDeps([195,1]))}),c:ne("c",function(){return q(()=>import("./c-N_EB2bYK.js").then(e=>e.c),__vite__mapDeps([196,1,171]))}),cfscript:ne("cfscript",function(){return q(()=>import("./cfscript-CeuFWGtU.js").then(e=>e.c),__vite__mapDeps([197,1]))}),chaiscript:ne("chaiscript",function(){return q(()=>import("./chaiscript-YpFdQwm4.js").then(e=>e.c),__vite__mapDeps([198,1,170,171]))}),cil:ne("cil",function(){return q(()=>import("./cil-BTpaFQxw.js").then(e=>e.c),__vite__mapDeps([199,1]))}),clike:ne("clike",function(){return q(()=>import("./clike-C0ZDHdrY.js").then(e=>e.c),__vite__mapDeps([200,1,201]))}),clojure:ne("clojure",function(){return q(()=>import("./clojure-nHglC_Wr.js").then(e=>e.c),__vite__mapDeps([202,1]))}),cmake:ne("cmake",function(){return q(()=>import("./cmake-CkGrNXqP.js").then(e=>e.c),__vite__mapDeps([203,1]))}),cobol:ne("cobol",function(){return q(()=>import("./cobol-CpeWJsGx.js").then(e=>e.c),__vite__mapDeps([204,1]))}),coffeescript:ne("coffeescript",function(){return q(()=>import("./coffeescript-BmyGALDp.js").then(e=>e.c),__vite__mapDeps([205,1]))}),concurnas:ne("concurnas",function(){return q(()=>import("./concurnas-AGPXgTy3.js").then(e=>e.c),__vite__mapDeps([206,1]))}),coq:ne("coq",function(){return q(()=>import("./coq-B1vh1X6h.js").then(e=>e.c),__vite__mapDeps([207,1]))}),cpp:ne("cpp",function(){return q(()=>import("./cpp-BrdR8lzA.js").then(e=>e.c),__vite__mapDeps([208,1,170,171]))}),crystal:ne("crystal",function(){return q(()=>import("./crystal-DMB1xqN1.js").then(e=>e.c),__vite__mapDeps([209,1,210]))}),csharp:ne("csharp",function(){return q(()=>import("./csharp-Dz-Duhoj.js").then(e=>e.c),__vite__mapDeps([211,1,177]))}),cshtml:ne("cshtml",function(){return q(()=>import("./cshtml-Dao_x5sm.js").then(e=>e.c),__vite__mapDeps([212,1,177]))}),csp:ne("csp",function(){return q(()=>import("./csp-rN0ct5mE.js").then(e=>e.c),__vite__mapDeps([213,1]))}),cssExtras:ne("cssExtras",function(){return q(()=>import("./css-extras-CH38hCE0.js").then(e=>e.c),__vite__mapDeps([214,1]))}),css:ne("css",function(){return q(()=>import("./css-C3pUjfuw.js").then(e=>e.c),__vite__mapDeps([215,1,216]))}),csv:ne("csv",function(){return q(()=>import("./csv-CMjGkfuc.js").then(e=>e.c),__vite__mapDeps([217,1]))}),cypher:ne("cypher",function(){return q(()=>import("./cypher-BSXied6R.js").then(e=>e.c),__vite__mapDeps([218,1]))}),d:ne("d",function(){return q(()=>import("./d-7giuCMwV.js").then(e=>e.d),__vite__mapDeps([219,1]))}),dart:ne("dart",function(){return q(()=>import("./dart-f2r0fR5P.js").then(e=>e.d),__vite__mapDeps([220,1]))}),dataweave:ne("dataweave",function(){return q(()=>import("./dataweave-BNTQwt_0.js").then(e=>e.d),__vite__mapDeps([221,1]))}),dax:ne("dax",function(){return q(()=>import("./dax-9u0VVHGx.js").then(e=>e.d),__vite__mapDeps([222,1]))}),dhall:ne("dhall",function(){return q(()=>import("./dhall-BnOlrm1O.js").then(e=>e.d),__vite__mapDeps([223,1]))}),diff:ne("diff",function(){return q(()=>import("./diff-CbyOnxIb.js").then(e=>e.d),__vite__mapDeps([224,1]))}),django:ne("django",function(){return q(()=>import("./django-BoROLrA7.js").then(e=>e.d),__vite__mapDeps([225,1,226]))}),dnsZoneFile:ne("dnsZoneFile",function(){return q(()=>import("./dns-zone-file-BZz70gag.js").then(e=>e.d),__vite__mapDeps([227,1]))}),docker:ne("docker",function(){return q(()=>import("./docker-DDluW8dt.js").then(e=>e.d),__vite__mapDeps([228,1]))}),dot:ne("dot",function(){return q(()=>import("./dot-qujU4Da1.js").then(e=>e.d),__vite__mapDeps([229,1]))}),ebnf:ne("ebnf",function(){return q(()=>import("./ebnf-CcQ_JImo.js").then(e=>e.e),__vite__mapDeps([230,1]))}),editorconfig:ne("editorconfig",function(){return q(()=>import("./editorconfig-BbwhooPy.js").then(e=>e.e),__vite__mapDeps([231,1]))}),eiffel:ne("eiffel",function(){return q(()=>import("./eiffel-B3J5PQxF.js").then(e=>e.e),__vite__mapDeps([232,1]))}),ejs:ne("ejs",function(){return q(()=>import("./ejs-W0BSwUjI.js").then(e=>e.e),__vite__mapDeps([233,1,226]))}),elixir:ne("elixir",function(){return q(()=>import("./elixir-DP_8UBXK.js").then(e=>e.e),__vite__mapDeps([234,1]))}),elm:ne("elm",function(){return q(()=>import("./elm-iqtDCABP.js").then(e=>e.e),__vite__mapDeps([235,1]))}),erb:ne("erb",function(){return q(()=>import("./erb-deIh2UEF.js").then(e=>e.e),__vite__mapDeps([236,1,210,226]))}),erlang:ne("erlang",function(){return q(()=>import("./erlang-4tX_bnUx.js").then(e=>e.e),__vite__mapDeps([237,1]))}),etlua:ne("etlua",function(){return q(()=>import("./etlua-CWJxZlBl.js").then(e=>e.e),__vite__mapDeps([238,1,239,226]))}),excelFormula:ne("excelFormula",function(){return q(()=>import("./excel-formula-BQj21DBh.js").then(e=>e.e),__vite__mapDeps([240,1]))}),factor:ne("factor",function(){return q(()=>import("./factor-BH7igz5o.js").then(e=>e.f),__vite__mapDeps([241,1]))}),falselang:ne("falselang",function(){return q(()=>import("./false-Qh-wnXyD.js").then(e=>e._),__vite__mapDeps([242,1]))}),firestoreSecurityRules:ne("firestoreSecurityRules",function(){return q(()=>import("./firestore-security-rules-CKhRlNBp.js").then(e=>e.f),__vite__mapDeps([243,1]))}),flow:ne("flow",function(){return q(()=>import("./flow-DJdu3gfB.js").then(e=>e.f),__vite__mapDeps([244,1]))}),fortran:ne("fortran",function(){return q(()=>import("./fortran-BHu4hUHY.js").then(e=>e.f),__vite__mapDeps([245,1]))}),fsharp:ne("fsharp",function(){return q(()=>import("./fsharp-BiNyUor_.js").then(e=>e.f),__vite__mapDeps([246,1]))}),ftl:ne("ftl",function(){return q(()=>import("./ftl-D6bVz-y_.js").then(e=>e.f),__vite__mapDeps([247,1,226]))}),gap:ne("gap",function(){return q(()=>import("./gap-DjhzPH1Z.js").then(e=>e.g),__vite__mapDeps([248,1]))}),gcode:ne("gcode",function(){return q(()=>import("./gcode-DJBtEOur.js").then(e=>e.g),__vite__mapDeps([249,1]))}),gdscript:ne("gdscript",function(){return q(()=>import("./gdscript-C_X-7y6o.js").then(e=>e.g),__vite__mapDeps([250,1]))}),gedcom:ne("gedcom",function(){return q(()=>import("./gedcom-CH5a7-zs.js").then(e=>e.g),__vite__mapDeps([251,1]))}),gherkin:ne("gherkin",function(){return q(()=>import("./gherkin-CLD9Z44w.js").then(e=>e.g),__vite__mapDeps([252,1]))}),git:ne("git",function(){return q(()=>import("./git-DirbeLrE.js").then(e=>e.g),__vite__mapDeps([253,1]))}),glsl:ne("glsl",function(){return q(()=>import("./glsl-DwU_K1Bf.js").then(e=>e.g),__vite__mapDeps([254,1,171]))}),gml:ne("gml",function(){return q(()=>import("./gml-CQQxmZvv.js").then(e=>e.g),__vite__mapDeps([255,1]))}),gn:ne("gn",function(){return q(()=>import("./gn-wrWPxerG.js").then(e=>e.g),__vite__mapDeps([256,1]))}),goModule:ne("goModule",function(){return q(()=>import("./go-module-CjFP3WFY.js").then(e=>e.g),__vite__mapDeps([257,1]))}),go:ne("go",function(){return q(()=>import("./go-ZYzi8OLl.js").then(e=>e.g),__vite__mapDeps([258,1]))}),graphql:ne("graphql",function(){return q(()=>import("./graphql-BcLwhGtH.js").then(e=>e.g),__vite__mapDeps([259,1]))}),groovy:ne("groovy",function(){return q(()=>import("./groovy-DumHeXpg.js").then(e=>e.g),__vite__mapDeps([260,1]))}),haml:ne("haml",function(){return q(()=>import("./haml-CqSzOsbr.js").then(e=>e.h),__vite__mapDeps([261,1,210]))}),handlebars:ne("handlebars",function(){return q(()=>import("./handlebars-Bry2_rsG.js").then(e=>e.h),__vite__mapDeps([262,1,226]))}),haskell:ne("haskell",function(){return q(()=>import("./haskell-yUNIp-7d.js").then(e=>e.h),__vite__mapDeps([263,1,264]))}),haxe:ne("haxe",function(){return q(()=>import("./haxe-Dp4DyQmv.js").then(e=>e.h),__vite__mapDeps([265,1]))}),hcl:ne("hcl",function(){return q(()=>import("./hcl-B5qkLEyl.js").then(e=>e.h),__vite__mapDeps([266,1]))}),hlsl:ne("hlsl",function(){return q(()=>import("./hlsl-DrSY44_J.js").then(e=>e.h),__vite__mapDeps([267,1,171]))}),hoon:ne("hoon",function(){return q(()=>import("./hoon-CkQC4q2d.js").then(e=>e.h),__vite__mapDeps([268,1]))}),hpkp:ne("hpkp",function(){return q(()=>import("./hpkp-riVsYbz6.js").then(e=>e.h),__vite__mapDeps([269,1]))}),hsts:ne("hsts",function(){return q(()=>import("./hsts-DpYC61yC.js").then(e=>e.h),__vite__mapDeps([270,1]))}),http:ne("http",function(){return q(()=>import("./http-Dx-uCaT1.js").then(e=>e.h),__vite__mapDeps([271,1]))}),ichigojam:ne("ichigojam",function(){return q(()=>import("./ichigojam-B7XQrlmu.js").then(e=>e.i),__vite__mapDeps([272,1]))}),icon:ne("icon",function(){return q(()=>import("./icon-fmySfNA1.js").then(e=>e.i),__vite__mapDeps([273,1]))}),icuMessageFormat:ne("icuMessageFormat",function(){return q(()=>import("./icu-message-format-Oq1AuWLS.js").then(e=>e.i),__vite__mapDeps([274,1]))}),idris:ne("idris",function(){return q(()=>import("./idris-BBQY5hR_.js").then(e=>e.i),__vite__mapDeps([275,1,264]))}),iecst:ne("iecst",function(){return q(()=>import("./iecst-BXBc121A.js").then(e=>e.i),__vite__mapDeps([276,1]))}),ignore:ne("ignore",function(){return q(()=>import("./ignore-Btt-DzVm.js").then(e=>e.i),__vite__mapDeps([277,1]))}),inform7:ne("inform7",function(){return q(()=>import("./inform7-BOWBWzGd.js").then(e=>e.i),__vite__mapDeps([278,1]))}),ini:ne("ini",function(){return q(()=>import("./ini--jhBb2pg.js").then(e=>e.i),__vite__mapDeps([279,1]))}),io:ne("io",function(){return q(()=>import("./io-D2xfJyua.js").then(e=>e.i),__vite__mapDeps([280,1]))}),j:ne("j",function(){return q(()=>import("./j-DzsdI1Bx.js").then(e=>e.j),__vite__mapDeps([281,1]))}),java:ne("java",function(){return q(()=>import("./java-s-m7kerV.js").then(e=>e.j),__vite__mapDeps([282,1,283]))}),javadoc:ne("javadoc",function(){return q(()=>import("./javadoc-BjkiGsEF.js").then(e=>e.j),__vite__mapDeps([284,1,283,285]))}),javadoclike:ne("javadoclike",function(){return q(()=>import("./javadoclike-DCDpBfFy.js").then(e=>e.j),__vite__mapDeps([286,1,285]))}),javascript:ne("javascript",function(){return q(()=>import("./javascript-C5bRWOCC.js").then(e=>e.j),__vite__mapDeps([287,1,288]))}),javastacktrace:ne("javastacktrace",function(){return q(()=>import("./javastacktrace-D8SvwBYG.js").then(e=>e.j),__vite__mapDeps([289,1]))}),jexl:ne("jexl",function(){return q(()=>import("./jexl-CuibVysa.js").then(e=>e.j),__vite__mapDeps([290,1]))}),jolie:ne("jolie",function(){return q(()=>import("./jolie-G2r1IH4x.js").then(e=>e.j),__vite__mapDeps([291,1]))}),jq:ne("jq",function(){return q(()=>import("./jq-CSp-T5V6.js").then(e=>e.j),__vite__mapDeps([292,1]))}),jsExtras:ne("jsExtras",function(){return q(()=>import("./js-extras-DzfpmWre.js").then(e=>e.j),__vite__mapDeps([293,1]))}),jsTemplates:ne("jsTemplates",function(){return q(()=>import("./js-templates-deUmuJZ-.js").then(e=>e.j),__vite__mapDeps([294,1]))}),jsdoc:ne("jsdoc",function(){return q(()=>import("./jsdoc-CzzeaHoB.js").then(e=>e.j),__vite__mapDeps([295,1,285,296]))}),json:ne("json",function(){return q(()=>import("./json-DkUPYY4u.js").then(e=>e.j),__vite__mapDeps([297,1,298]))}),json5:ne("json5",function(){return q(()=>import("./json5-kaAIKBom.js").then(e=>e.j),__vite__mapDeps([299,1,298]))}),jsonp:ne("jsonp",function(){return q(()=>import("./jsonp-NFZGtYU-.js").then(e=>e.j),__vite__mapDeps([300,1,298]))}),jsstacktrace:ne("jsstacktrace",function(){return q(()=>import("./jsstacktrace-z4GMPjy-.js").then(e=>e.j),__vite__mapDeps([301,1]))}),jsx:ne("jsx",function(){return q(()=>import("./jsx-CHRn7QrA.js").then(e=>e.j),__vite__mapDeps([302,1,303]))}),julia:ne("julia",function(){return q(()=>import("./julia-CtD-2MpL.js").then(e=>e.j),__vite__mapDeps([304,1]))}),keepalived:ne("keepalived",function(){return q(()=>import("./keepalived-CFt0jL3j.js").then(e=>e.k),__vite__mapDeps([305,1]))}),keyman:ne("keyman",function(){return q(()=>import("./keyman-B9DoVDwq.js").then(e=>e.k),__vite__mapDeps([306,1]))}),kotlin:ne("kotlin",function(){return q(()=>import("./kotlin-Dq-NDvL5.js").then(e=>e.k),__vite__mapDeps([307,1]))}),kumir:ne("kumir",function(){return q(()=>import("./kumir-CJqEisv6.js").then(e=>e.k),__vite__mapDeps([308,1]))}),kusto:ne("kusto",function(){return q(()=>import("./kusto-BgQKkaWx.js").then(e=>e.k),__vite__mapDeps([309,1]))}),latex:ne("latex",function(){return q(()=>import("./latex-BT8SOs-A.js").then(e=>e.l),__vite__mapDeps([310,1]))}),latte:ne("latte",function(){return q(()=>import("./latte-C8JT4Qb7.js").then(e=>e.l),__vite__mapDeps([311,1,226,312]))}),less:ne("less",function(){return q(()=>import("./less-BD_NHSLb.js").then(e=>e.l),__vite__mapDeps([313,1]))}),lilypond:ne("lilypond",function(){return q(()=>import("./lilypond-AQaE6Na0.js").then(e=>e.l),__vite__mapDeps([314,1,315]))}),liquid:ne("liquid",function(){return q(()=>import("./liquid-y7RSJ3Wl.js").then(e=>e.l),__vite__mapDeps([316,1,226]))}),lisp:ne("lisp",function(){return q(()=>import("./lisp-BC_0scWg.js").then(e=>e.l),__vite__mapDeps([317,1]))}),livescript:ne("livescript",function(){return q(()=>import("./livescript-iy-NHZ_h.js").then(e=>e.l),__vite__mapDeps([318,1]))}),llvm:ne("llvm",function(){return q(()=>import("./llvm-BfiEgsxO.js").then(e=>e.l),__vite__mapDeps([319,1]))}),log:ne("log",function(){return q(()=>import("./log-cps16LLM.js").then(e=>e.l),__vite__mapDeps([320,1]))}),lolcode:ne("lolcode",function(){return q(()=>import("./lolcode-3zmtClDS.js").then(e=>e.l),__vite__mapDeps([321,1]))}),lua:ne("lua",function(){return q(()=>import("./lua-DI565xS0.js").then(e=>e.l),__vite__mapDeps([322,1,239]))}),magma:ne("magma",function(){return q(()=>import("./magma-ba7Qn7K1.js").then(e=>e.m),__vite__mapDeps([323,1]))}),makefile:ne("makefile",function(){return q(()=>import("./makefile-BqSQ4nmN.js").then(e=>e.m),__vite__mapDeps([324,1]))}),markdown:ne("markdown",function(){return q(()=>import("./markdown-Cze8MKhj.js").then(e=>e.m),__vite__mapDeps([325,1]))}),markupTemplating:ne("markupTemplating",function(){return q(()=>import("./markup-templating-C-QmJhjg.js").then(e=>e.m),__vite__mapDeps([326,1,226]))}),markup:ne("markup",function(){return q(()=>import("./markup-Dt-xKA80.js").then(e=>e.m),__vite__mapDeps([327,1,328]))}),matlab:ne("matlab",function(){return q(()=>import("./matlab-CacUYSDq.js").then(e=>e.m),__vite__mapDeps([329,1]))}),maxscript:ne("maxscript",function(){return q(()=>import("./maxscript-Cm15dTB4.js").then(e=>e.m),__vite__mapDeps([330,1]))}),mel:ne("mel",function(){return q(()=>import("./mel-BFRmaBUW.js").then(e=>e.m),__vite__mapDeps([331,1]))}),mermaid:ne("mermaid",function(){return q(()=>import("./mermaid-_TlUmfQf.js").then(e=>e.m),__vite__mapDeps([332,1]))}),mizar:ne("mizar",function(){return q(()=>import("./mizar-BoN7zgqH.js").then(e=>e.m),__vite__mapDeps([333,1]))}),mongodb:ne("mongodb",function(){return q(()=>import("./mongodb-Do1oT-rg.js").then(e=>e.m),__vite__mapDeps([334,1]))}),monkey:ne("monkey",function(){return q(()=>import("./monkey-DS3nr7fk.js").then(e=>e.m),__vite__mapDeps([335,1]))}),moonscript:ne("moonscript",function(){return q(()=>import("./moonscript-Cwqh5x__.js").then(e=>e.m),__vite__mapDeps([336,1]))}),n1ql:ne("n1ql",function(){return q(()=>import("./n1ql-BgI_6bQf.js").then(e=>e.n),__vite__mapDeps([337,1]))}),n4js:ne("n4js",function(){return q(()=>import("./n4js-oXh14UQA.js").then(e=>e.n),__vite__mapDeps([338,1]))}),nand2tetrisHdl:ne("nand2tetrisHdl",function(){return q(()=>import("./nand2tetris-hdl-CGF6E--X.js").then(e=>e.n),__vite__mapDeps([339,1]))}),naniscript:ne("naniscript",function(){return q(()=>import("./naniscript-Dv0ErN1f.js").then(e=>e.n),__vite__mapDeps([340,1]))}),nasm:ne("nasm",function(){return q(()=>import("./nasm-CdhriaSD.js").then(e=>e.n),__vite__mapDeps([341,1]))}),neon:ne("neon",function(){return q(()=>import("./neon-6Qw1Wpr8.js").then(e=>e.n),__vite__mapDeps([342,1]))}),nevod:ne("nevod",function(){return q(()=>import("./nevod-Do308_dN.js").then(e=>e.n),__vite__mapDeps([343,1]))}),nginx:ne("nginx",function(){return q(()=>import("./nginx-CioVUANG.js").then(e=>e.n),__vite__mapDeps([344,1]))}),nim:ne("nim",function(){return q(()=>import("./nim-BiZFPqzz.js").then(e=>e.n),__vite__mapDeps([345,1]))}),nix:ne("nix",function(){return q(()=>import("./nix-DLWyfiVz.js").then(e=>e.n),__vite__mapDeps([346,1]))}),nsis:ne("nsis",function(){return q(()=>import("./nsis-B_mA8Mf4.js").then(e=>e.n),__vite__mapDeps([347,1]))}),objectivec:ne("objectivec",function(){return q(()=>import("./objectivec-CFn4OO_F.js").then(e=>e.o),__vite__mapDeps([348,1,171]))}),ocaml:ne("ocaml",function(){return q(()=>import("./ocaml-B365KzYr.js").then(e=>e.o),__vite__mapDeps([349,1]))}),opencl:ne("opencl",function(){return q(()=>import("./opencl-CPm34rhj.js").then(e=>e.o),__vite__mapDeps([350,1,171]))}),openqasm:ne("openqasm",function(){return q(()=>import("./openqasm-CDj9ArmH.js").then(e=>e.o),__vite__mapDeps([351,1]))}),oz:ne("oz",function(){return q(()=>import("./oz-BYXLbj-G.js").then(e=>e.o),__vite__mapDeps([352,1]))}),parigp:ne("parigp",function(){return q(()=>import("./parigp-D0QktAhQ.js").then(e=>e.p),__vite__mapDeps([353,1]))}),parser:ne("parser",function(){return q(()=>import("./parser-qO2_EI6v.js").then(e=>e.p),__vite__mapDeps([354,1]))}),pascal:ne("pascal",function(){return q(()=>import("./pascal-De5eNwWX.js").then(e=>e.p),__vite__mapDeps([355,1]))}),pascaligo:ne("pascaligo",function(){return q(()=>import("./pascaligo-Bf8O7ebQ.js").then(e=>e.p),__vite__mapDeps([356,1]))}),pcaxis:ne("pcaxis",function(){return q(()=>import("./pcaxis-BcwaB2L7.js").then(e=>e.p),__vite__mapDeps([357,1]))}),peoplecode:ne("peoplecode",function(){return q(()=>import("./peoplecode-Dk2Gnb3n.js").then(e=>e.p),__vite__mapDeps([358,1]))}),perl:ne("perl",function(){return q(()=>import("./perl-DRKm4LVK.js").then(e=>e.p),__vite__mapDeps([359,1]))}),phpExtras:ne("phpExtras",function(){return q(()=>import("./php-extras-DBoPtocT.js").then(e=>e.p),__vite__mapDeps([360,1,312,226]))}),php:ne("php",function(){return q(()=>import("./php-BSKv2GXV.js").then(e=>e.p),__vite__mapDeps([361,1,312,226]))}),phpdoc:ne("phpdoc",function(){return q(()=>import("./phpdoc-BJjHK9Yc.js").then(e=>e.p),__vite__mapDeps([362,1,312,226,285]))}),plsql:ne("plsql",function(){return q(()=>import("./plsql-Bb_hLNuA.js").then(e=>e.p),__vite__mapDeps([363,1,165]))}),powerquery:ne("powerquery",function(){return q(()=>import("./powerquery-C5qk80xF.js").then(e=>e.p),__vite__mapDeps([364,1]))}),powershell:ne("powershell",function(){return q(()=>import("./powershell-BG0DpRp-.js").then(e=>e.p),__vite__mapDeps([365,1]))}),processing:ne("processing",function(){return q(()=>import("./processing-w7DFlyH_.js").then(e=>e.p),__vite__mapDeps([366,1]))}),prolog:ne("prolog",function(){return q(()=>import("./prolog-B2BVxulM.js").then(e=>e.p),__vite__mapDeps([367,1]))}),promql:ne("promql",function(){return q(()=>import("./promql-B3KvaVJb.js").then(e=>e.p),__vite__mapDeps([368,1]))}),properties:ne("properties",function(){return q(()=>import("./properties-BE8Ews0J.js").then(e=>e.p),__vite__mapDeps([369,1]))}),protobuf:ne("protobuf",function(){return q(()=>import("./protobuf-CBHBbdUG.js").then(e=>e.p),__vite__mapDeps([370,1]))}),psl:ne("psl",function(){return q(()=>import("./psl-aD6jMMeP.js").then(e=>e.p),__vite__mapDeps([371,1]))}),pug:ne("pug",function(){return q(()=>import("./pug-DI-93Lan.js").then(e=>e.p),__vite__mapDeps([372,1]))}),puppet:ne("puppet",function(){return q(()=>import("./puppet-DxN-4n9f.js").then(e=>e.p),__vite__mapDeps([373,1]))}),pure:ne("pure",function(){return q(()=>import("./pure-_2x0TJjK.js").then(e=>e.p),__vite__mapDeps([374,1]))}),purebasic:ne("purebasic",function(){return q(()=>import("./purebasic-C8Ir77ii.js").then(e=>e.p),__vite__mapDeps([375,1]))}),purescript:ne("purescript",function(){return q(()=>import("./purescript-DWCP7Rhr.js").then(e=>e.p),__vite__mapDeps([376,1,264]))}),python:ne("python",function(){return q(()=>import("./python-B3k5tM49.js").then(e=>e.p),__vite__mapDeps([377,1]))}),q:ne("q",function(){return q(()=>import("./q-LJLqXf0_.js").then(e=>e.q),__vite__mapDeps([378,1]))}),qml:ne("qml",function(){return q(()=>import("./qml-DgsxaMQP.js").then(e=>e.q),__vite__mapDeps([379,1]))}),qore:ne("qore",function(){return q(()=>import("./qore-DumyY0ow.js").then(e=>e.q),__vite__mapDeps([380,1]))}),qsharp:ne("qsharp",function(){return q(()=>import("./qsharp-ClAsZa-1.js").then(e=>e.q),__vite__mapDeps([381,1]))}),r:ne("r",function(){return q(()=>import("./r-DHwkVKGw.js").then(e=>e.r),__vite__mapDeps([382,1]))}),racket:ne("racket",function(){return q(()=>import("./racket-DcBksMCk.js").then(e=>e.r),__vite__mapDeps([383,1,315]))}),reason:ne("reason",function(){return q(()=>import("./reason-BXtuBfki.js").then(e=>e.r),__vite__mapDeps([384,1]))}),regex:ne("regex",function(){return q(()=>import("./regex-Bmn5L_4e.js").then(e=>e.r),__vite__mapDeps([385,1]))}),rego:ne("rego",function(){return q(()=>import("./rego-CZsdWqMW.js").then(e=>e.r),__vite__mapDeps([386,1]))}),renpy:ne("renpy",function(){return q(()=>import("./renpy-XPjsxRDO.js").then(e=>e.r),__vite__mapDeps([387,1]))}),rest:ne("rest",function(){return q(()=>import("./rest-DD2JcNUu.js").then(e=>e.r),__vite__mapDeps([388,1]))}),rip:ne("rip",function(){return q(()=>import("./rip-B2ScZnvu.js").then(e=>e.r),__vite__mapDeps([389,1]))}),roboconf:ne("roboconf",function(){return q(()=>import("./roboconf-XMvWjvgI.js").then(e=>e.r),__vite__mapDeps([390,1]))}),robotframework:ne("robotframework",function(){return q(()=>import("./robotframework-BivGgTMI.js").then(e=>e.r),__vite__mapDeps([391,1]))}),ruby:ne("ruby",function(){return q(()=>import("./ruby-DQG1k7eY.js").then(e=>e.r),__vite__mapDeps([392,1,210]))}),rust:ne("rust",function(){return q(()=>import("./rust-CY08bKn6.js").then(e=>e.r),__vite__mapDeps([393,1]))}),sas:ne("sas",function(){return q(()=>import("./sas-1PTlKbzw.js").then(e=>e.s),__vite__mapDeps([394,1]))}),sass:ne("sass",function(){return q(()=>import("./sass-RllDMjGg.js").then(e=>e.s),__vite__mapDeps([395,1]))}),scala:ne("scala",function(){return q(()=>import("./scala-D1OpbE39.js").then(e=>e.s),__vite__mapDeps([396,1,283]))}),scheme:ne("scheme",function(){return q(()=>import("./scheme-BbtNtDr-.js").then(e=>e.s),__vite__mapDeps([397,1,315]))}),scss:ne("scss",function(){return q(()=>import("./scss-DgCxV9gf.js").then(e=>e.s),__vite__mapDeps([398,1]))}),shellSession:ne("shellSession",function(){return q(()=>import("./shell-session-1LvomK4i.js").then(e=>e.s),__vite__mapDeps([399,1,183]))}),smali:ne("smali",function(){return q(()=>import("./smali-CXX5Nw4b.js").then(e=>e.s),__vite__mapDeps([400,1]))}),smalltalk:ne("smalltalk",function(){return q(()=>import("./smalltalk-CkWNQdr2.js").then(e=>e.s),__vite__mapDeps([401,1]))}),smarty:ne("smarty",function(){return q(()=>import("./smarty-D9yobX_8.js").then(e=>e.s),__vite__mapDeps([402,1,226]))}),sml:ne("sml",function(){return q(()=>import("./sml-CtZ57qc6.js").then(e=>e.s),__vite__mapDeps([403,1]))}),solidity:ne("solidity",function(){return q(()=>import("./solidity-CkABSbax.js").then(e=>e.s),__vite__mapDeps([404,1]))}),solutionFile:ne("solutionFile",function(){return q(()=>import("./solution-file-K7E94G8T.js").then(e=>e.s),__vite__mapDeps([405,1]))}),soy:ne("soy",function(){return q(()=>import("./soy-CiMQleff.js").then(e=>e.s),__vite__mapDeps([406,1,226]))}),sparql:ne("sparql",function(){return q(()=>import("./sparql-B28RxTei.js").then(e=>e.s),__vite__mapDeps([407,1,408]))}),splunkSpl:ne("splunkSpl",function(){return q(()=>import("./splunk-spl-w0Cel-ic.js").then(e=>e.s),__vite__mapDeps([409,1]))}),sqf:ne("sqf",function(){return q(()=>import("./sqf-BBYZJCt5.js").then(e=>e.s),__vite__mapDeps([410,1]))}),sql:ne("sql",function(){return q(()=>import("./sql-CwRJh8Sp.js").then(e=>e.s),__vite__mapDeps([411,1,165]))}),squirrel:ne("squirrel",function(){return q(()=>import("./squirrel-CEzvQBK5.js").then(e=>e.s),__vite__mapDeps([412,1]))}),stan:ne("stan",function(){return q(()=>import("./stan-S3CZTrL_.js").then(e=>e.s),__vite__mapDeps([413,1]))}),stylus:ne("stylus",function(){return q(()=>import("./stylus-BG4_ZnaL.js").then(e=>e.s),__vite__mapDeps([414,1]))}),swift:ne("swift",function(){return q(()=>import("./swift-ByheDo_6.js").then(e=>e.s),__vite__mapDeps([415,1]))}),systemd:ne("systemd",function(){return q(()=>import("./systemd-6CBk_Ow2.js").then(e=>e.s),__vite__mapDeps([416,1]))}),t4Cs:ne("t4Cs",function(){return q(()=>import("./t4-cs-DHZvgPUG.js").then(e=>e.t),__vite__mapDeps([417,1,418,177]))}),t4Templating:ne("t4Templating",function(){return q(()=>import("./t4-templating-DUeWWaCj.js").then(e=>e.t),__vite__mapDeps([419,1,418]))}),t4Vb:ne("t4Vb",function(){return q(()=>import("./t4-vb-B_6qRhT8.js").then(e=>e.t),__vite__mapDeps([420,1,418,421,185]))}),tap:ne("tap",function(){return q(()=>import("./tap-DjTT3CuE.js").then(e=>e.t),__vite__mapDeps([422,1,423]))}),tcl:ne("tcl",function(){return q(()=>import("./tcl-BM9U6SkZ.js").then(e=>e.t),__vite__mapDeps([424,1]))}),textile:ne("textile",function(){return q(()=>import("./textile-XOvB5RBz.js").then(e=>e.t),__vite__mapDeps([425,1]))}),toml:ne("toml",function(){return q(()=>import("./toml-BO0aGyy4.js").then(e=>e.t),__vite__mapDeps([426,1]))}),tremor:ne("tremor",function(){return q(()=>import("./tremor-Bk9M5xQH.js").then(e=>e.t),__vite__mapDeps([427,1]))}),tsx:ne("tsx",function(){return q(()=>import("./tsx-BcjbSAGh.js").then(e=>e.t),__vite__mapDeps([428,1,303,296]))}),tt2:ne("tt2",function(){return q(()=>import("./tt2-BHaQqFiG.js").then(e=>e.t),__vite__mapDeps([429,1,226]))}),turtle:ne("turtle",function(){return q(()=>import("./turtle-CdxJK1CJ.js").then(e=>e.t),__vite__mapDeps([430,1,408]))}),twig:ne("twig",function(){return q(()=>import("./twig-CxFOkn0v.js").then(e=>e.t),__vite__mapDeps([431,1,226]))}),typescript:ne("typescript",function(){return q(()=>import("./typescript-CVqiKcu1.js").then(e=>e.t),__vite__mapDeps([432,1,296]))}),typoscript:ne("typoscript",function(){return q(()=>import("./typoscript-spRf2Ox1.js").then(e=>e.t),__vite__mapDeps([433,1]))}),unrealscript:ne("unrealscript",function(){return q(()=>import("./unrealscript-D2PIC4ZQ.js").then(e=>e.u),__vite__mapDeps([434,1]))}),uorazor:ne("uorazor",function(){return q(()=>import("./uorazor-xrDEXG6p.js").then(e=>e.u),__vite__mapDeps([435,1]))}),uri:ne("uri",function(){return q(()=>import("./uri-CwPh3EwT.js").then(e=>e.u),__vite__mapDeps([436,1]))}),v:ne("v",function(){return q(()=>import("./v-CJIzMR4B.js").then(e=>e.v),__vite__mapDeps([437,1]))}),vala:ne("vala",function(){return q(()=>import("./vala-WpTbVsFT.js").then(e=>e.v),__vite__mapDeps([438,1]))}),vbnet:ne("vbnet",function(){return q(()=>import("./vbnet-UNQqH4vF.js").then(e=>e.v),__vite__mapDeps([439,1,421,185]))}),velocity:ne("velocity",function(){return q(()=>import("./velocity-DsPfPeeX.js").then(e=>e.v),__vite__mapDeps([440,1]))}),verilog:ne("verilog",function(){return q(()=>import("./verilog-NpK4_zqq.js").then(e=>e.v),__vite__mapDeps([441,1]))}),vhdl:ne("vhdl",function(){return q(()=>import("./vhdl-DiFKlg1X.js").then(e=>e.v),__vite__mapDeps([442,1]))}),vim:ne("vim",function(){return q(()=>import("./vim-SyhS9sNH.js").then(e=>e.v),__vite__mapDeps([443,1]))}),visualBasic:ne("visualBasic",function(){return q(()=>import("./visual-basic-DSiTvEtK.js").then(e=>e.v),__vite__mapDeps([444,1]))}),warpscript:ne("warpscript",function(){return q(()=>import("./warpscript-CTRBwGjg.js").then(e=>e.w),__vite__mapDeps([445,1]))}),wasm:ne("wasm",function(){return q(()=>import("./wasm-CBCDYs2M.js").then(e=>e.w),__vite__mapDeps([446,1]))}),webIdl:ne("webIdl",function(){return q(()=>import("./web-idl-BfdeEL3H.js").then(e=>e.w),__vite__mapDeps([447,1]))}),wiki:ne("wiki",function(){return q(()=>import("./wiki-CouGhrmq.js").then(e=>e.w),__vite__mapDeps([448,1]))}),wolfram:ne("wolfram",function(){return q(()=>import("./wolfram-CejGEkud.js").then(e=>e.w),__vite__mapDeps([449,1]))}),wren:ne("wren",function(){return q(()=>import("./wren-BTo1kC3F.js").then(e=>e.w),__vite__mapDeps([450,1]))}),xeora:ne("xeora",function(){return q(()=>import("./xeora-mFujPPPh.js").then(e=>e.x),__vite__mapDeps([451,1]))}),xmlDoc:ne("xmlDoc",function(){return q(()=>import("./xml-doc-DpZbWR7e.js").then(e=>e.x),__vite__mapDeps([452,1]))}),xojo:ne("xojo",function(){return q(()=>import("./xojo-C9xNSycu.js").then(e=>e.x),__vite__mapDeps([453,1]))}),xquery:ne("xquery",function(){return q(()=>import("./xquery-C7CsuD6b.js").then(e=>e.x),__vite__mapDeps([454,1]))}),yaml:ne("yaml",function(){return q(()=>import("./yaml-DxQv1G_M.js").then(e=>e.y),__vite__mapDeps([455,1,423]))}),yang:ne("yang",function(){return q(()=>import("./yang-BXpPxQeP.js").then(e=>e.y),__vite__mapDeps([456,1]))}),zig:ne("zig",function(){return q(()=>import("./zig-KxZlFBGb.js").then(e=>e.z),__vite__mapDeps([457,1]))})},rWe=tWe({loader:function(){return q(()=>import("./core-ChuWtB-i.js").then(t=>t.c),__vite__mapDeps([458,1,328,216,201,288])).then(function(t){return t.default||t})},isLanguageRegistered:function(t,n){return t.registered(n)},languageLoaders:nWe,registerLanguage:function(t,n,r){return t.register(r)}}),sWe="light";function oWe(e){return{mode:sWe,...e?.theme}}function tn(e){var t=e;return function(n){var r=oWe(n);let s=r.mode;return t[s]}}const aWe=e=>{const t={theme:e};return{lineNumberColor:tn({light:"#383a42",dark:"#abb2bf"})(t),lineNumberBgColor:tn({light:"#fafafa",dark:"#282c34"})(t),backgroundColor:tn({light:"#fafafa",dark:"#282c34"})(t),textColor:tn({light:"#383a42",dark:"#abb2bf"})(t),substringColor:tn({light:"#e45649",dark:"#e06c75"})(t),keywordColor:tn({light:"#a626a4",dark:"#c678dd"})(t),attributeColor:tn({light:"#50a14f",dark:"#98c379"})(t),selectorAttributeColor:tn({light:"#e45649",dark:"#e06c75"})(t),docTagColor:tn({light:"#a626a4",dark:"#c678dd"})(t),nameColor:tn({light:"#e45649",dark:"#e06c75"})(t),builtInColor:tn({light:"#c18401",dark:"#e6c07b"})(t),literalColor:tn({light:"#0184bb",dark:"#56b6c2"})(t),bulletColor:tn({light:"#4078f2",dark:"#61aeee"})(t),codeColor:tn({light:"#383a42",dark:"#abb2bf"})(t),additionColor:tn({light:"#50a14f",dark:"#98c379"})(t),regexpColor:tn({light:"#50a14f",dark:"#98c379"})(t),symbolColor:tn({light:"#4078f2",dark:"#61aeee"})(t),variableColor:tn({light:"#986801",dark:"#d19a66"})(t),templateVariableColor:tn({light:"#986801",dark:"#d19a66"})(t),linkColor:tn({light:"#4078f2",dark:"#61aeee"})(t),selectorClassColor:tn({light:"#986801",dark:"#d19a66"})(t),typeColor:tn({light:"#986801",dark:"#d19a66"})(t),stringColor:tn({light:"#50a14f",dark:"#98c379"})(t),selectorIdColor:tn({light:"#4078f2",dark:"#61aeee"})(t),quoteColor:tn({light:"#a0a1a7",dark:"#5c6370"})(t),templateTagColor:tn({light:"#383a42",dark:"#abb2bf"})(t),deletionColor:tn({light:"#e45649",dark:"#e06c75"})(t),titleColor:tn({light:"#4078f2",dark:"#61aeee"})(t),sectionColor:tn({light:"#e45649",dark:"#e06c75"})(t),commentColor:tn({light:"#a0a1a7",dark:"#5c6370"})(t),metaKeywordColor:tn({light:"#383a42",dark:"#abb2bf"})(t),metaColor:tn({light:"#4078f2",dark:"#61aeee"})(t),functionColor:tn({light:"#383a42",dark:"#abb2bf"})(t),numberColor:tn({light:"#986801",dark:"#d19a66"})(t)}},R2="inherit",z6="inherit",iWe={fontSize:z6,fontFamily:R2,lineHeight:20/12,padding:8},lWe=e=>({fontSize:z6,lineHeight:20/14,color:e.lineNumberColor,backgroundColor:e.lineNumberBgColor,flexShrink:0,padding:8,textAlign:"right",userSelect:"none"}),Qte=e=>({key:{color:e.keywordColor,fontWeight:"bolder"},keyword:{color:e.keywordColor,fontWeight:"bolder"},"attr-name":{color:e.attributeColor},selector:{color:e.selectorTagColor},comment:{color:e.commentColor,fontFamily:R2,fontStyle:"italic"},"block-comment":{color:e.commentColor,fontFamily:R2,fontStyle:"italic"},"function-name":{color:e.sectionColor},"class-name":{color:e.sectionColor},doctype:{color:e.docTagColor},substr:{color:e.substringColor},namespace:{color:e.nameColor},builtin:{color:e.builtInColor},entity:{color:e.literalColor},bullet:{color:e.bulletColor},code:{color:e.codeColor},addition:{color:e.additionColor},regex:{color:e.regexpColor},symbol:{color:e.symbolColor},variable:{color:e.variableColor},url:{color:e.linkColor},"selector-attr":{color:e.selectorAttributeColor},"selector-pseudo":{color:e.selectorPseudoColor},type:{color:e.typeColor},string:{color:e.stringColor},quote:{color:e.quoteColor},tag:{color:e.templateTagColor},deletion:{color:e.deletionColor},title:{color:e.titleColor},section:{color:e.sectionColor},"meta-keyword":{color:e.metaKeywordColor},meta:{color:e.metaColor},italic:{fontStyle:"italic"},bold:{fontWeight:"bolder"},function:{color:e.functionColor},number:{color:e.numberColor}}),Xte=e=>({fontSize:z6,fontFamily:R2,background:e.backgroundColor,color:e.textColor,borderRadius:3,display:"flex",lineHeight:20/14,overflowX:"auto",whiteSpace:"pre"}),cWe=e=>({'pre[class*="language-"]':Xte(e),...Qte(e)}),uWe=e=>({'pre[class*="language-"]':{...Xte(e),padding:"2px 4px",display:"inline",whiteSpace:"pre-wrap"},...Qte(e)});function Zte(e={mode:"light"}){const t={...aWe(e),...e};return{lineNumberContainerStyle:lWe(t),codeBlockStyle:cWe(t),inlineCodeStyle:uWe(t),codeContainerStyle:iWe}}const dWe=Object.freeze([{name:"PHP",alias:["php","php3","php4","php5"],value:"php"},{name:"Java",alias:["java"],value:"java"},{name:"CSharp",alias:["csharp","c#","cs"],value:"csharp"},{name:"Python",alias:["python","py"],value:"python"},{name:"JavaScript",alias:["javascript","js"],value:"javascript"},{name:"XML",alias:["xml"],value:"xml"},{name:"HTML",alias:["html","htm"],value:"markup"},{name:"C++",alias:["c++","cpp","clike"],value:"cpp"},{name:"Ruby",alias:["ruby","rb","duby"],value:"ruby"},{name:"Objective-C",alias:["objective-c","objectivec","obj-c","objc"],value:"objectivec"},{name:"C",alias:["c"],value:"cpp"},{name:"Swift",alias:["swift"],value:"swift"},{name:"TeX",alias:["tex","latex"],value:"tex"},{name:"Shell",alias:["shell","sh","ksh","zsh"],value:"bash"},{name:"Scala",alias:["scala"],value:"scala"},{name:"Go",alias:["go"],value:"go"},{name:"ActionScript",alias:["actionscript","actionscript3","as"],value:"actionscript"},{name:"ColdFusion",alias:["coldfusion"],value:"xml"},{name:"JavaFX",alias:["javafx","jfx"],value:"java"},{name:"VbNet",alias:["vbnet","vb.net"],value:"vbnet"},{name:"JSON",alias:["json"],value:"json"},{name:"MATLAB",alias:["matlab"],value:"matlab"},{name:"Groovy",alias:["groovy"],value:"groovy"},{name:"SQL",alias:["sql","postgresql","postgres","plpgsql","psql","postgresql-console","postgres-console","tsql","t-sql","mysql","sqlite"],value:"sql"},{name:"R",alias:["r"],value:"r"},{name:"Perl",alias:["perl","pl"],value:"perl"},{name:"Lua",alias:["lua"],value:"lua"},{name:"Delphi",alias:["delphi","pas","pascal","objectpascal"],value:"delphi"},{name:"XML",alias:["xml"],value:"xml"},{name:"TypeScript",alias:["typescript","ts","tsx"],value:"typescript"},{name:"CoffeeScript",alias:["coffeescript","coffee-script","coffee"],value:"coffeescript"},{name:"Haskell",alias:["haskell","hs"],value:"haskell"},{name:"Puppet",alias:["puppet"],value:"puppet"},{name:"Arduino",alias:["arduino"],value:"arduino"},{name:"Fortran",alias:["fortran"],value:"fortran"},{name:"Erlang",alias:["erlang","erl"],value:"erlang"},{name:"PowerShell",alias:["powershell","posh","ps1","psm1"],value:"powershell"},{name:"Haxe",alias:["haxe","hx","hxsl"],value:"haxe"},{name:"Elixir",alias:["elixir","ex","exs"],value:"elixir"},{name:"Verilog",alias:["verilog","v"],value:"verilog"},{name:"Rust",alias:["rust"],value:"rust"},{name:"VHDL",alias:["vhdl"],value:"vhdl"},{name:"Sass",alias:["sass"],value:"less"},{name:"OCaml",alias:["ocaml"],value:"ocaml"},{name:"Dart",alias:["dart"],value:"dart"},{name:"CSS",alias:["css"],value:"css"},{name:"reStructuredText",alias:["restructuredtext","rst","rest"],value:"rest"},{name:"ObjectPascal",alias:["objectpascal"],value:"delphi"},{name:"Kotlin",alias:["kotlin"],value:"kotlin"},{name:"D",alias:["d"],value:"d"},{name:"Octave",alias:["octave"],value:"matlab"},{name:"QML",alias:["qbs","qml"],value:"qml"},{name:"Prolog",alias:["prolog"],value:"prolog"},{name:"FoxPro",alias:["foxpro","vfp","clipper","xbase"],value:"vbnet"},{name:"Scheme",alias:["scheme","scm"],value:"scheme"},{name:"CUDA",alias:["cuda","cu"],value:"cpp"},{name:"Julia",alias:["julia","jl"],value:"julia"},{name:"Racket",alias:["racket","rkt"],value:"lisp"},{name:"Ada",alias:["ada","ada95","ada2005"],value:"ada"},{name:"Tcl",alias:["tcl"],value:"tcl"},{name:"Mathematica",alias:["mathematica","mma","nb"],value:"mathematica"},{name:"Autoit",alias:["autoit"],value:"autoit"},{name:"StandardML",alias:["standardmL","sml","standardml"],value:"sml"},{name:"Objective-J",alias:["objective-j","objectivej","obj-j","objj"],value:"objectivec"},{name:"Smalltalk",alias:["smalltalk","squeak","st"],value:"smalltalk"},{name:"Vala",alias:["vala","vapi"],value:"vala"},{name:"ABAP",alias:["abap"],value:"sql"},{name:"LiveScript",alias:["livescript","live-script"],value:"livescript"},{name:"XQuery",alias:["xquery","xqy","xq","xql","xqm"],value:"xquery"},{name:"PlainText",alias:["text","plaintext"],value:"text"},{name:"Yaml",alias:["yaml","yml"],value:"yaml"},{name:"GraphQL",alias:["graphql","gql"],value:"graphql"}]),fWe=e=>{if(!e)return"";const t=dWe.find(n=>n.name===e||n.alias.includes(e));return t?t.value:e||"text"};class Jte extends d.PureComponent{constructor(){super(...arguments),this._isMounted=!1}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}getLineOpacity(t){if(!this.props.highlight)return 1;const n=this.props.highlight.split(",").map(r=>{if(r.indexOf("-")>0){const[s,o]=r.split("-").map(Number).sort();return Array(o+1).fill(void 0).map((a,i)=>i).slice(s,o+1)}return Number(r)}).reduce((r,s)=>r.concat(s),[]);return n.length===0||n.includes(t)?1:.3}render(){const{inlineCodeStyle:t}=Zte(this.props.theme),r={language:fWe(this.props.language),PreTag:this.props.preTag,style:this.props.codeStyle||t,showLineNumbers:this.props.showLineNumbers,startingLineNumber:this.props.startingLineNumber,codeTagProps:this.props.codeTagProps,wrapLongLines:this.props.wrapLongLines};return T.createElement(rWe,Object.assign({},r,{wrapLines:!!this.props.highlight,customStyle:this.props.customStyle,lineProps:s=>({style:{opacity:this.getLineOpacity(s),...this.props.lineNumberContainerStyle}})}),this.props.text)}}Jte.defaultProps={theme:{},showLineNumbers:!1,wrapLongLines:!1,startingLineNumber:1,lineNumberContainerStyle:{},codeTagProps:{},preTag:"span",highlight:"",customStyle:{}};const ene="text";let W6=class extends d.PureComponent{constructor(){super(...arguments),this._isMounted=!1,this.handleCopy=t=>{const n=t.nativeEvent.clipboardData;if(n){t.preventDefault();const r=window.getSelection();if(r===null)return;const s=r.toString(),o=`
${s}
`;n.clearData(),n.setData("text/html",o),n.setData("text/plain",s)}}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){var t,n,r,s;const{lineNumberContainerStyle:o,codeBlockStyle:a,codeContainerStyle:i}=Zte(this.props.theme),c={language:this.props.language||ene,codeStyle:{...a,...(t=this.props)===null||t===void 0?void 0:t.codeBlockStyle},customStyle:(n=this.props)===null||n===void 0?void 0:n.customStyle,showLineNumbers:this.props.showLineNumbers,startingLineNumber:this.props.startingLineNumber,codeTagProps:{style:{...i,...(r=this.props)===null||r===void 0?void 0:r.codeContainerStyle}},lineNumberContainerStyle:{...o,...(s=this.props)===null||s===void 0?void 0:s.lineNumberContainerStyle},text:this.props.text.toString(),highlight:this.props.highlight,wrapLongLines:this.props.wrapLongLines};return T.createElement(Jte,Object.assign({},c))}};W6.displayName="CodeBlock";W6.defaultProps={text:"",showLineNumbers:!0,wrapLongLines:!1,startingLineNumber:1,language:ene,theme:{},highlight:"",lineNumberContainerStyle:{},customStyle:{},codeBlockStyle:{}};var mWe=Mze(W6);Kv.button` - position: absolute; - top: 0.5em; - right: 0.75em; - display: flex; - flex-wrap: wrap; - justify-content: center; - align-items: center; - background: ${e=>e.theme.backgroundColor}; - margin-top: 0.15rem; - border-radius: 0.25rem; - max-height: 2rem; - max-width: 2rem; - padding: 0.25rem; - &:hover { - opacity: ${e=>e.copied?1:.5}; - } - &:focus { - outline: none; - opacity: 1; - } - .icon { - width: 1rem; - height: 1rem; - } -`;Kv.div` - position: relative; - background: ${e=>e.theme.backgroundColor}; - border-radius: 0.25rem; - padding: ${e=>e.codeBlock?"0.25rem 0.5rem 0.25rem 0.25rem":"0.25rem"}; -`;Kv.div` - position: relative; - width: ${({width:e})=>e||"auto"}; - max-width: 100%; - padding: 8pt; - padding-right: calc(2 * 16pt); - color: ${({style:e})=>e.color}; - background-color: ${({style:e})=>e.bgColor}; - border: 1px solid ${({style:e})=>e.border}; - border-radius: 5px; - pre { - margin: 0; - padding: 0; - border: none; - background-color: transparent; - color: ${({style:e})=>e.color}; - font-size: 0.8125rem; - } - pre::before { - content: '$ '; - user-select: none; - } - pre :global(*) { - margin: 0; - padding: 0; - font-size: inherit; - color: inherit; - } - .copy { - position: absolute; - right: 0; - top: -2px; - transform: translateY(50%); - background-color: ${({style:e})=>e.bgColor}; - display: inline-flex; - justify-content: center; - align-items: center; - width: calc(2 * 16pt); - color: inherit; - transition: opacity 0.2s ease 0s; - border-radius: 5px; - cursor: pointer; - user-select: none; - } - .copy:hover { - opacity: 0.7; - } -`;var pWe={lineNumberColor:"#c5c8c6",lineNumberBgColor:"#1d1f21",backgroundColor:"#1d1f21",textColor:"#c5c8c6",substringColor:"#c5c8c6",keywordColor:"#b294bb",attributeColor:"#f0c674",selectorAttributeColor:"#b294bb",docTagColor:"#c5c8c6",nameColor:"#cc6666",builtInColor:"#de935f",literalColor:"#de935f",bulletColor:"#b5bd68",codeColor:"#c5c8c6",additionColor:"#b5bd68",regexpColor:"#cc6666",symbolColor:"#b5bd68",variableColor:"#cc6666",templateVariableColor:"#cc6666",linkColor:"#de935f",selectorClassColor:"#cc6666",typeColor:"#de935f",stringColor:"#b5bd68",selectorIdColor:"#cc6666",quoteColor:"#969896",templateTagColor:"#c5c8c6",deletionColor:"#cc6666",titleColor:"#81a2be",sectionColor:"#81a2be",commentColor:"#969896",metaKeywordColor:"#c5c8c6",metaColor:"#de935f",functionColor:"#c5c8c6",numberColor:"#de935f"},hWe={lineNumberColor:"#4d4d4c",lineNumberBgColor:"white",backgroundColor:"white",textColor:"#4d4d4c",substringColor:"#4d4d4c",keywordColor:"#8959a8",attributeColor:"#eab700",selectorAttributeColor:"#8959a8",docTagColor:"#4d4d4c",nameColor:"#c82829",builtInColor:"#f5871f",literalColor:"#f5871f",bulletColor:"#718c00",codeColor:"#4d4d4c",additionColor:"#718c00",regexpColor:"#c82829",symbolColor:"#718c00",variableColor:"#c82829",templateVariableColor:"#c82829",linkColor:"#f5871f",selectorClassColor:"#c82829",typeColor:"#f5871f",stringColor:"#718c00",selectorIdColor:"#c82829",quoteColor:"#8e908c",templateTagColor:"#4d4d4c",deletionColor:"#c82829",titleColor:"#4271ae",sectionColor:"#4271ae",commentColor:"#8e908c",metaKeywordColor:"#4d4d4c",metaColor:"#f5871f",functionColor:"#4d4d4c",numberColor:"#f5871f"};const af=T.memo(e=>{const{children:t,className:n,codeBlockProps:r,hideTools:s,trackEvent:o,translations:a,codeBlockStyles:i,...c}=e,{language:u="text",showLineNumbers:f,text:m,theme:p,wrapLongLines:h,...g}=r,{colorScheme:y}=Ss(),x=d.useMemo(()=>{let w;return p?w=p:(w=y==="dark"?pWe:hWe,w.backgroundColor="transparent",w.lineNumberBgColor="transparent"),w},[y,p]),v=z("codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded-lg font-mono text-sm font-normal",n),b=d.useCallback(()=>{navigator.clipboard.writeText(String(t)),o?.("click code block copy",{language:u??"text"})},[t,u,o]),_=d.useMemo(()=>({"--scrollbar-thumb":"oklch(var(--foreground-color) / 0.15)","--scrollbar-track":"transparent",scrollbarWidth:"thin",scrollbarColor:"var(--scrollbar-thumb) var(--scrollbar-track)",...i}),[i]);return l.jsxs("div",{className:v,...c,children:[l.jsx("div",{className:z("translate-y-xs -translate-x-xs bottom-xl mb-xl","flex h-0 items-start justify-end","sm:sticky sm:top-xs"),children:!s&&l.jsx(K,{variant:"background",className:"overflow-hidden rounded-full",children:l.jsx(K,{variant:"subtler",children:l.jsx(rt,{icon:B("copy"),size:"small",pill:!0,clickFeedback:!0,onClick:b,testId:"copy-code-button",ariaLabel:a?.copy,toolTip:a?.copy})})})}),l.jsxs("div",{className:"-mt-xl",children:[u&&!s&&l.jsx("div",{children:l.jsx("div",{"data-testid":"code-language-indicator",className:"text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-lg text-xs font-thin",children:u})}),l.jsx("div",{children:l.jsx(mWe,{as:void 0,forwardedAs:void 0,language:u,showLineNumbers:!1,text:String(t),theme:x,wrapLongLines:!0,customStyle:_,...g})})]})]})});af.displayName="CodeBlock";const tne=T.memo(({step:e,action:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),{final:o,status:a,script:i,output:c,stdout:u}=e.content,f=!o,m=a==="generating"||a==="executing",p=d.useCallback(()=>{s(x=>!x)},[]),h=u&&c?u+` -`+c:u||c||"",g=d.useMemo(()=>({language:"python"}),[]),y=!!i;return l.jsxs("div",{children:[l.jsx(ze,{onClick:p,text:t,icon:B("message-circle-code"),isLoading:f,size:"tiny",pill:!0,chevron:y,chevronIcon:r?B("chevron-up"):B("chevron-down")}),l.jsx(kt,{children:r&&y&&l.jsxs(Te.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:"easeIn",duration:.15}},className:"mb-sm space-y-sm",children:[l.jsx(af,{className:"text-xs",codeBlockProps:g,children:i}),!m&&l.jsxs(Te.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:"easeIn",duration:.15}},children:[l.jsx(V,{variant:"tiny",color:"light",children:n(h?{defaultMessage:"Output",id:"fio5opLcOZ"}:{defaultMessage:"This code did not produce an output",id:"UgqMuAXFKs"})}),a!=="error"&&h&&l.jsx(af,{className:z("scrollbar-subtle max-h-[220px] overflow-y-auto text-xs",a==="success"),codeBlockProps:g,children:h})]})]})})]})});tne.displayName="CodeStep";const nne=T.memo(({asset:e})=>{const{isCanvasOpen:t,canvasState:n}=Zf(),r=d.useMemo(()=>t&&e.uuid===n?.assetUuid,[e.uuid,n?.assetUuid,t]),{title:s,description:o,Icon:a}=m6(e),i=nJ({asset:e}),c=d.useCallback(async()=>{i()},[i]);return l.jsxs(K,{onClick:c,role:"button",tabIndex:0,variant:zx.subtler,className:z("flex w-fit items-center rounded-lg p-1.5",r&&"ring-super !ring-1"),children:[l.jsx(K,{variant:"super",className:"m-1 flex size-8 items-center justify-center rounded-md p-2",children:l.jsx(ge,{icon:a,size:"md",className:"text-inverse"})}),l.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[l.jsx(V,{variant:"small",color:"default",className:"!font-display !text-[0.8125rem] font-medium",children:s}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"!font-display !text-[0.6875rem] leading-none",children:o})]})]})},({asset:e,...t},{asset:n,...r})=>Hn(t,r)&&Er(e,n));nne.displayName="AssetToken";const rne=T.memo(({screenshot_uuid:e,screenshots:t})=>{const{taskScreenshots:n}=zn(),r=n[e??""],o=(r?.length?r:t)?.[0];return o?l.jsx(gWe,{src:o,alt:"Browser screenshot",includeLightBoxModal:!0,containerClassName:"relative -mt-1.5 max-w-60 w-full rounded-lg overflow-hidden after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-1 after:ring-inset after:ring-subtlest hover:shadow hover:after:ring-subtler transition-all duration-100",imageClassName:"object-cover w-full text-[0] dark:mix-blend-normal",maskClassName:"bg-subtler"}):null}),gWe=({containerClassName:e,enableRetry:t,...n})=>{const r=d.useRef(1),[s,o]=d.useState(n.src),[a,i]=d.useState(!1),c=d.useCallback(()=>{const u=yWe(n.src);!u||r.current>4||(u.searchParams.set("attempt",String(r.current)),r.current+=1,setTimeout(()=>o(u.toString()),300))},[n.src,r]);return l.jsx($o,{containerClassName:z(e,{"opacity-0":!a}),alt:"Browser screenshot",...n,src:s,onFail:t?c:void 0,onLoad:()=>i(!0)},s)},yWe=e=>{if(e)try{return new URL(e)}catch{return}};rne.displayName="ScreenshotStep";const sne=T.memo(({step:e,action:t})=>{const{final:n,file_name:r,page_count:s,word_count:o}=e.content,a=!n;let i=t;return r&&n&&(i=r,s!=null?(i+=` (${s} pages`,o!=null&&(i+=`, ${o} words`),i+=")"):o!=null&&(i+=` (${o} words)`)),l.jsx(ze,{text:t,icon:B("file-type-docx"),isLoading:a,size:"tiny",pill:!0,toolTip:i,tooltipLayout:"top"})});sne.displayName="DocxStep";const one=T.memo(({status:e})=>{const{$t:t}=J();let n=B("circle-check-filled"),r=t({defaultMessage:"Done",id:"JXdbo8Vnlw"});switch(e){case"SENT":n=B("circle-check-filled"),r=t({defaultMessage:"Email sent",id:"as7ksh6tP3"});break;case"FORWARDED":n=B("mail-forward"),r=t({defaultMessage:"Email forwarded",id:"QUWo2L2sfE"});break;case"REJECTED":n=B("x"),r=t({defaultMessage:"Email rejected",id:"+469cQAaqI"});break;default:n=B("circle-check-filled"),r=t({defaultMessage:"Done",id:"JXdbo8Vnlw"});break}return l.jsx(Dr,{icon:n,iconClassName:"text-super",text:r})});one.displayName="EmailStatusStep";const ane=T.memo(({onClick:e,urls:t})=>{const n=d.useMemo(()=>t.map(r=>l.jsx(ine,{url:r,onClick:e},r)),[e,t]);return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(tm,{items:n,initialDisplayCount:1})})});ane.displayName="GeneratedVideoResultsStep";const ine=T.memo(({url:e,onClick:t})=>{const n=d.useCallback(()=>{t?.(e)},[e,t]);return l.jsx(xt,{className:"block",href:e,target:"_blank",rel:"noopener nofollow",onClick:n,children:l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs rounded-lg pl-1.5 pr-2.5",children:l.jsx(xa,{variant:"tinyMono",className:"!text-[0.7rem]",url:e,isAttachment:!1,connectionType:er.GENERATED_VIDEO,source:"Generated Video"})})},e)});ine.displayName="LinkFactory";const lne=T.memo(({prompt:e,success:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useRef(null);d.useLayoutEffect(()=>{const m=i.current;m&&!r&&a(m.scrollHeight>m.clientHeight)},[e,r]);const c=d.useCallback(()=>{s(m=>!m)},[]);if(!e)return null;const u=o||r,f=t===!1;return l.jsxs("div",{className:z("rounded-lg p-3",f?"bg-caution/10":"bg-subtler",u&&"cursor-pointer"),onClick:u?c:void 0,children:[l.jsx("div",{ref:i,className:z("text-default text-sm leading-relaxed",!r&&"line-clamp-2"),children:e}),u&&l.jsxs("button",{className:"text-light hover:text-default mt-2 flex items-center gap-0.5 text-xs",onClick:m=>{m.stopPropagation(),c()},children:[n(r?{defaultMessage:"Show less",id:"qyJtWyZ0yt"}:{defaultMessage:"Show more",id:"aWpBzjCXKS"}),l.jsx(ge,{icon:r?B("chevron-up"):B("chevron-down"),size:"xs"})]})]})});lne.displayName="GenerateImageStep";const $E=T.memo(({color:e,title:t})=>{const n="bg-[#13343B] dark:bg-[#F5F5F5]",s=(o=>o?{red:"bg-[#C0152F] dark:bg-[#FF5459]",maroon:"bg-[#944454] dark:bg-[#B3C901]",orange:"bg-[#DB7100] dark:bg-[#FFAB44]",teal:"bg-[#21808D] dark:bg-[#32B8C6]",grey:n,brown:"bg-[#A84B2F] dark:bg-[#E68161]",green:"bg-[#848456] dark:bg-[#B4B662]",gold:"bg-[#D39900] dark:bg-[#F0B435]",purple:"bg-[#865D95] dark:bg-[#C48ED8]",blue:"bg-[#19789E] dark:bg-[#54B4E3]"}[o]??n:n)(e);return l.jsx("div",{className:z("py-xs w-fit rounded-md px-2.5",s),children:l.jsx(V,{className:"translate-y-half",variant:"tiny",color:"defaultInverted",children:t})})});$E.displayName="GroupingTabsStep";function cne(e){return JSON.stringify(e,null,2)}const xWe=(e,t=1e4,{showTruncationIndicator:n=!0,format:r=!1}={})=>{if(e.length<=t)return r?une(e):e;let s=t;const o=Math.max(0,t-100);for(let c=t-1;c>=o;c--){const u=e[c];if(u===","||u===` -`||u===" "||u===" "){s=c;break}}const a=e.substring(0,s).trim(),i=r?vWe(e,a):a;if(n){const c=` - -// Content truncated at ${s} characters (original: ${e.length} chars)`;return i+c}return i};function une(e){try{return cne(JSON.parse(e))}catch{return e}}function vWe(e,t){const n=une(e),r=t.replace(/\s/g,"").length;let s=0,o=n;for(let i=0;i=0;i--)if(o[i]===a){o=o.substring(0,i+1);break}return o}const bWe={language:"json"},_We=2e3,qE=({content:e,title:t,maxContentLength:n=_We,truncationOptions:r={showTruncationIndicator:!1,format:!0},className:s,isError:o=!1,showTruncationMessage:a=!0})=>{const{formatNumber:i}=J(),{processedContent:c,originalLength:u}=d.useMemo(()=>{if(typeof e=="string")return{processedContent:xWe(e,n,r),originalLength:e.length};if(e&&typeof e=="object"){const p=cne(e);return{processedContent:p,originalLength:p.length}}const m=String(e);return{processedContent:m,originalLength:m.length}},[e,n,r]),f=u>n;return l.jsxs(K,{className:z("rounded-lg",s),variant:"subtler",children:[l.jsx(V,{variant:"tiny",className:z("p-md pb-0",o&&"text-negative"),children:t}),l.jsx(af,{className:"p-sm !my-0 pt-0 text-xs",codeBlockProps:bWe,hideTools:!0,children:c||"No content"}),a&&f&&l.jsx("div",{className:"bg-subtler flex items-center justify-center rounded-b p-2",children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(Ne,{defaultMessage:"Content truncated at {truncatedSize} (original size: {originalSize})",id:"ipA00V5aGw",values:{truncatedSize:i(n/1024,{maximumFractionDigits:0,style:"unit",unit:"kilobyte",unitDisplay:"narrow"}),originalSize:i(u/1024,{maximumFractionDigits:0,style:"unit",unit:"kilobyte",unitDisplay:"narrow"})}})})})]})},jw="clicked enterprise ad",Iw="https://www.perplexity.ai/enterprise",wWe=()=>{const{session:e}=je(),{trackEvent:t}=Ke(e),n=Dn(),r=d.useCallback(async h=>{h?.preventDefault(),t(jw,{source:"settingsHeader"}),n.push(Iw)},[t,n]),s=d.useCallback(async h=>{h.preventDefault(),t(jw,{source:"pricingTable"}),n.push(Iw)},[t,n]),o=d.useCallback(async h=>{h.preventDefault(),t(jw,{source:"paywall"}),n.push(Iw)},[t,n]),a=d.useCallback(({orgName:h,success:g})=>{t("org created",{orgName:h,success:g})},[t]),i=d.useCallback(({invitedEmail:h,source:g,orgUUID:y,inviteType:x})=>{t("org user invited",{invitedEmail:h,source:g,orgUUID:y,inviteType:x})},[t]),c=d.useCallback(({invitedEmails:h,inviteCount:g,successCount:y,failureCount:x,source:v,orgUUID:b,inviteType:_})=>{t("org users bulk invited",{invitedEmails:h,inviteCount:g,successCount:y,failureCount:x,source:v,orgUUID:b,inviteType:_})},[t]),u=d.useCallback(({orgUUID:h})=>{t("org invite step completed",{orgUUID:h})},[t]),f=d.useCallback(({orgUUID:h,source:g,intent:y,success:x})=>t("org payment portal entered",{orgUUID:h,source:g,intent:y,success:x}),[t]),m=d.useCallback(({orgUUID:h,success:g})=>{t("sso enabled",{orgUUID:h,success:g})},[t]),p=d.useCallback(h=>{t("mcp tool action",h)},[t]);return d.useMemo(()=>({handleSettingsHeaderAdClick:r,handlePricingTableAdClick:s,handlePaywallAdClick:o,trackOrgCreated:a,trackOrgUserInvited:i,trackOrgUsersBulkInvited:c,trackOrgInviteStepCompleted:u,trackOrgPaymentPortalEntered:f,trackSSOEnabled:m,trackMcpToolApprovalAction:p}),[o,s,r,a,u,f,i,c,m,p])},dne=T.memo(({appName:e,appLogo:t,step:n,isFinished:r,onApprove:s,onActionTaken:o})=>{const{$t:a}=J(),[i,c]=d.useState(!1),{isMobileStyle:u,isMobileUserAgent:f}=Re(),[m,p]=d.useState(!1),[h,g]=d.useState(""),[y,x]=d.useState(null),v=QJ(),{trackMcpToolApprovalAction:b}=wWe(),_=n.content.tool_input_summary||a({defaultMessage:"This tool will perform an action",id:"m3EA/HeMzd"}),w=n.content,S=n.mcp_tool_output_content,C=w.request_user_approval?.uuid,E=v.isPending,N=E||r||!!y,k=d.useCallback(()=>{x(null)},[]),I=d.useCallback(F=>{if(C){if(F==="MODIFY"){p(!0);return}b({toolName:w.tool_name||"unknown_tool",appName:w.app||"unknown_app",entryUUID:C||"unknown_uuid",action:F}),x(F),v.mutate({uuid:C,allowToolCall:F},{onSuccess:()=>{o?.(),s?.()},onError:()=>{k()}})}},[C,v,k,w,b,s,o]),M=d.useCallback(()=>{!C||!h.trim()||(x("MODIFY"),b({toolName:w.tool_name||"unknown_tool",appName:w.app||"unknown_app",entryUUID:C||"unknown_uuid",action:"MODIFY"}),v.mutate({uuid:C,allowToolCall:"MODIFY",userRevision:h},{onSuccess:()=>{o?.()},onError:()=>{k()}}))},[C,h,v,k,w,b,o]),A=d.useCallback(()=>{p(!1),g(""),x(null)},[]),D=w.data_is_redacted===!0||S?.data_is_redacted===!0,P=d.useCallback(()=>{D||c(F=>!F)},[D]);return l.jsxs(K,{className:"p-sm group-hover:bg-background grid grid-cols-[max-content_1fr] gap-x-2 gap-y-1 rounded-lg border pb-7 pl-4",variant:"raised",children:[l.jsxs("div",{className:z("col-span-full grid grid-cols-subgrid items-center",{"cursor-pointer":!D}),onClick:P,children:[t&&l.jsx("img",{src:t,alt:`${w.app} Logo`,className:"size-4 rounded object-cover"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"smallBold",children:e}),!D&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:l.jsx(rt,{size:"small",pill:!0,icon:i?B("chevron-down"):B("chevron-right")})})]})]}),l.jsxs("div",{className:"col-start-2 col-end-3 flex min-w-0 flex-col",children:[l.jsx(V,{variant:"small",className:"text-pretty sm:pr-8",children:_}),l.jsx(yne,{isExpanded:i,mcpContent:w,mcpOutputContent:S}),l.jsx(pi,{mode:"popLayout",initial:!1,transition:{duration:.2,ease:Yr},children:m&&l.jsx(Fo,{children:l.jsx(yu,{value:h,onChange:g,placeholder:a({defaultMessage:"What would you like to change?",id:"VkWAi878bt"}),isMobileStyle:u,isMobileUserAgent:f,disabled:E,minRows:3,className:"mt-4"})})}),l.jsx(K,{className:"mt-4 flex items-center gap-2",children:m?l.jsxs(l.Fragment,{children:[l.jsx(ze,{variant:"inverted",size:"small",text:a({defaultMessage:"Continue",id:"acrOozm08x"}),onClick:M,disabled:N||!h.trim()}),l.jsx(ze,{variant:"border",size:"small",text:a({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:A,disabled:E,extraCSS:"bg-transparent"})]}):l.jsxs(l.Fragment,{children:[l.jsx(ze,{variant:"inverted",size:"small",text:a({defaultMessage:"Approve",id:"WCaf5CZSTt"}),onClick:()=>I("ALLOW"),disabled:N}),l.jsx(ze,{variant:"common",size:"small",text:a({defaultMessage:"Refine",id:"EBZvikr2Av"}),onClick:()=>I("MODIFY"),disabled:N}),l.jsx(ze,{variant:"border",size:"small",text:a({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:()=>I("DENY"),disabled:N,extraCSS:"ml-auto border-none bg-transparent mr-2"})]})})]})]})});dne.displayName="McpToolApprovalStep";const fne=T.memo(({tool_logo_url:e,app:t,merge_extra_args:n,step_uuid:r,backend_uuid:s})=>{const{$t:o}=J(),a=_Ce(t||""),i=d.useCallback(async()=>{await FH({uuid:r,success:!1,reason:"User skipped authentication"})},[r]),c=d.useMemo(()=>({name:"mcp_connector_auth",upsell_type:"CONNECT_TO_CONNECTOR",app_location:"UPSELL_APP_LOCATION_UNSPECIFIED",title:o({defaultMessage:"Connect your {appName} account",id:"YPjv1DRLLL"},{appName:a}),description:o({defaultMessage:"Connect your {appName} account to get started",id:"MtMLxu8Eaj"},{appName:a}),cta:"MERGE_AUTH_CONNECTOR",icon_reference:a,...e&&{icon_image:{url:e,alt:a}},button_color:"INVERTED",button_text:"Connect",cta_information:{merge_auth_token:n?.auth_info?.auth_token,merge_auth_callback_uuid:r},show_in_comet:!0,is_persistent:!0,backend_uuid:s,image_asset:"",image_asset_low_res:"",image_asset_dark:"",image_asset_low_res_dark:"",background_super:!1,event_metadata:void 0,upsell_uuid:crypto.randomUUID(),ui_type:"BANNER_WITH_BUTTONS",action_cards:[]}),[a,s,e,o,n?.auth_info?.auth_token,r]);return l.jsx(Jd,{position:"router_steps",upsellInformation:c,backendUuid:s,isLastResult:!0,hideOnAccept:!1,hideOnReject:!1,onReject:i})});fne.displayName="UnauthenticatedMcpToolInput";const CWe={language:"json"},mne=T.memo(e=>{const{tool_args:t,tool_name:n}=e,[r,s]=d.useState(!1),o=d.useCallback(()=>s(a=>!a),[]);return l.jsx(K,{className:"border-subtlest p-sm rounded-lg border",children:!!(t&&typeof t=="object"&&t!==null)&&l.jsxs(K,{className:"border-subtlest p-sm rounded-lg border",children:[l.jsxs(K,{className:"flex items-center justify-between",children:[l.jsx(V,{variant:"smallMono",children:n}),l.jsx(rt,{size:"small",icon:r?B("chevron-down"):B("chevron-right"),onClick:o})]}),l.jsx(pi,{mode:"popLayout",transition:{duration:.2,ease:Yr},children:r&&l.jsx(Fo,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15,ease:Yr},children:l.jsxs(K,{className:"mt-sm rounded-lg",variant:"subtler",children:[l.jsx(V,{variant:"tiny",className:"p-md pb-0",children:l.jsx(Ne,{defaultMessage:"Request",id:"p1P+hQq6tY"})}),l.jsx(af,{className:"scrollbar-subtle my-0 max-h-[200px] overflow-y-auto text-xs",codeBlockProps:CWe,hideTools:!0,children:t&&typeof t=="object"?JSON.stringify(t):"No instructions"})]})})})]})})});mne.displayName="AuthenticatedMcpToolInput";const pne=T.memo(e=>{const{authenticated:t}=e;return t?l.jsx(mne,{...e}):l.jsx(fne,{...e})});pne.displayName="McpToolInput";const SWe=()=>{const{variation:e}=ZV(!1),{mcpStdioServers:t}=zn(),r=b0e()?.local_mcp.call===!0;return(Nn()?e:r)&&t!==void 0},EWe=({permission:e,connectorName:t})=>{const{$t:n}=J();return d.useMemo(()=>{if(!e)return null;switch(e){case"full_disk_access":return{title:n({defaultMessage:"Comet needs full disk access",id:"KaK1awrgFQ"}),description:n(t?{defaultMessage:"To use this connector, Comet needs permission to access your disk. Enable it in System Settings.",id:"O9WzUyHg3f"}:{defaultMessage:"To use all your connectors, Comet needs permission to access your disk. Enable it in System Settings.",id:"xusC3M5hQD"}),videoUrl:"https://r2cdn.perplexity.ai/comet/toggle-permission.mp4",tooltipTitle:n({defaultMessage:"Full disk access required",id:"ry8L5i2JdM"}),tooltipDescription:n({defaultMessage:"Turn on disk access in System Settings to use this connector",id:"zQpOIZuVrk"}),buttonText:n({defaultMessage:"Open System Settings",id:"U/a2e7uAwk"})};case"contacts":return{title:n({defaultMessage:"Comet needs access to your contacts",id:"Gh5VRh+h5k"}),description:n(t?{defaultMessage:"To use this connector, Comet needs permission to access your contacts.",id:"lbQ3o1etQa"}:{defaultMessage:"To use all your connectors, Comet needs permission to access your contacts.",id:"WgPxDUwZSj"}),videoUrl:"https://r2cdn.perplexity.ai/comet/toggle-permission.mp4",tooltipTitle:n({defaultMessage:"Contacts permission required",id:"QKFGSziMOF"}),tooltipDescription:n({defaultMessage:"Grant contacts permission to use this connector",id:"uMNpHxa2KQ"}),buttonText:n({defaultMessage:"Grant Access",id:"Xq5/HeHSIt"})};default:return null}},[n,t,e])},kWe=({connectorName:e,permission:t,cometAdapter:n})=>{const r=d.useMemo(()=>["comet/permission",t],[t]),s=Nme({queryKey:r,queryFn:async()=>t?n.hasPermission(t):null}),o=Xt(),a=It({mutationKey:r,mutationFn:async()=>t?n.requestPermission(t):null,onSuccess:c=>{o.setQueryData(r,c)}}),i=EWe({permission:t,connectorName:e});return d.useMemo(()=>({renderData:hV(s)?i:null,isRequestingPermission:a.isPending,requestPermission:()=>a.mutateAsync()}),[s,a,i])},MWe=({cometAdapter:e,permissions:t})=>{const n=pM({queries:(t??[]).map(a=>({queryKey:["comet/permission",a],queryFn:()=>e.hasPermission(a)}))}).map(a=>({isFetching:a.isFetching,data:a.data})),s=d.useMemo(()=>{let a;return i=>(Hn(a,i,Hn)||(a=i),a)},[])(n);return d.useMemo(()=>{const a=s.findIndex(i=>hV(i));return t?.[a]??null},[t,s])},hne=e=>{const{permission:t,connectorName:n,onDismiss:r}=e,s=ln(),{$t:o}=J(),{renderData:a,isRequestingPermission:i,requestPermission:c}=kWe({permission:t,connectorName:n,cometAdapter:s});return a?l.jsxs(K,{variant:"subtler",className:"border-subtler flex justify-between gap-6 rounded-lg border p-6",children:[l.jsxs("div",{className:"flex flex-1 flex-col justify-center",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",as:"h3",className:"mb-1",children:a.title}),l.jsx(V,{variant:"small",color:"light",children:a.description})]}),l.jsxs("div",{className:"mt-5 flex gap-2",children:[l.jsx(Ct,{variant:"primary",onClick:c,disabled:i,children:a.buttonText}),r&&l.jsx(Ct,{variant:"secondary",onClick:r,children:o({defaultMessage:"Dismiss",id:"TDaF6JVgG6"})})]})]}),l.jsx("div",{className:"flex-1",children:l.jsx("video",{src:a.videoUrl,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,height:160,width:302,className:"rounded-lg"})})]}):null},TWe=e=>{const{permissions:t,className:n,connectorName:r,onDismiss:s}=e,o=ln(),a=MWe({cometAdapter:o,permissions:t});return a?l.jsx("div",{className:n,children:l.jsx(hne,{permission:a,connectorName:r,onDismiss:s})}):null},AWe=e=>{const{permissions:t,className:n,connectorName:r,onDismiss:s}=e;return l.jsx("div",{className:z("space-y-4",n),children:t.map(o=>l.jsx(hne,{permission:o,connectorName:r,onDismiss:s},o))})},NWe=e=>{const{variant:t,...n}=e;return t==="first-required"?l.jsx(TWe,{...n}):l.jsx(AWe,{...n})},RWe=({cometAdapter:e,permissions:t})=>{const n=pM({queries:(t??[]).map(o=>({queryKey:["comet/permission",o],queryFn:()=>e.hasPermission(o)}))}).map(o=>({isFetching:o.isFetching,data:o.data})),s=d.useMemo(()=>{let o;return a=>(Hn(o,a,Hn)||(o=a),o)},[])(n);return d.useMemo(()=>!t||s.some(o=>o.isFetching)?null:s.every(o=>o.data!==!1),[s,t])},cP=[],DWe=({server:e,cometState:t,toolName:n})=>d.useMemo(()=>{if(!e)return null;if(!t.installedDxts)return cP;const r=hp(t.installedDxts,e);return r?Object.entries(Zz(r)).filter(([,{for_tools:s}])=>!s||n&&s.includes(n)).map(([s])=>s):cP},[e,t.installedDxts,n]),Sh=d.memo(()=>{const{$t:e}=J();return l.jsx(V,{variant:"micro",color:"super",className:"border-super inline-block rounded border px-1 py-0",children:e({id:"Hw1hSDsL+0",defaultMessage:"Premium data"})})});Sh.displayName="PremiumSourceLabel";const gne=T.memo(({step:e,isFinished:t,onActionTaken:n})=>{const{lastResult:r}=an(),{submitQuery:s}=Wo(),[o,a]=d.useState(!1),i=e.content,c=e.mcp_tool_output_content,u=!o&&i.request_user_approval?.request_user_approval,f=!t&&u===!1&&!c,m=IWe({stepId:e.uuid,shouldExecuteLocalTool:f,mcpContent:i}),p=d.useMemo(()=>!!c?.should_rerun_query,[c]),h=d.useCallback(async()=>{r?.query_str&&(await lu({entryUUID:r.backend_uuid,reason:"mcp-tool-output-merge-api"}),s({rawQuery:r.query_str,existingEntryUUID:r.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:r.frontend_context_uuid,promptSource:"user",querySource:"mcp-tool-input",attachments:[],modelPreferenceOverride:"pplx_pro",sourcesOverride:Ox(r.sources?.sources)}))},[s,r]);d.useEffect(()=>{p&&h()},[h,p]);const g=m?.name||i.app||"",y=m?.iconUrl||i.logo_url||gLe(i.app||"")||void 0;if(u&&m?.allPermissionsAreGranted!==!1)return l.jsx(dne,{appName:g,appLogo:y,step:e,isFinished:t,onApprove:()=>a(!0),onActionTaken:n});const x=(!!m||i.authenticated)??null;return x===null?null:x?l.jsxs(l.Fragment,{children:[m?.askPermissionsBanner,l.jsx(jWe,{appLogo:y,appName:g,mcpContent:i,mcpOutputContent:c})]}):l.jsx(pne,{...i,step_uuid:e.uuid??"",backend_uuid:r?.backend_uuid??"",authenticated:x,tool_args:i.tool_args,tool_logo_url:y??void 0})}),jWe=e=>{const{appLogo:t,appName:n,mcpContent:r,mcpOutputContent:s}=e,[o,a]=d.useState(!1),i=r.data_is_redacted===!0||s?.data_is_redacted===!0,c=tg(r.source_type),u=d.useCallback(()=>{i||a(f=>!f)},[i]);return l.jsxs(K,{className:"p-sm hover:bg-raised grid grid-cols-[max-content_1fr] gap-x-2 rounded-lg border pl-4",variant:o?"raised":void 0,children:[l.jsxs("div",{className:z("col-span-full grid grid-cols-subgrid items-center",{"cursor-pointer":!i}),onClick:u,children:[l.jsx(Qz,{serverName:n,iconUrl:t,size:"sm"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"smallBold",children:n}),c&&l.jsx(Sh,{}),!i&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:l.jsx(rt,{size:"small",pill:!0,icon:o?B("chevron-down"):B("chevron-right")})})]})]}),l.jsx("div",{className:"col-start-2 col-end-3 min-w-0",children:l.jsx(yne,{isExpanded:o,mcpContent:r,mcpOutputContent:s})})]})},yne=({isExpanded:e,mcpContent:t,mcpOutputContent:n})=>l.jsx(pi,{mode:"popLayout",initial:!1,transition:{duration:.2,ease:Yr},children:e&&l.jsx(Fo,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15,ease:Yr},children:l.jsx("div",{className:"mt-sm",children:l.jsx(Ng,{maxHeight:400,autoScroll:!1,scrollContainerClassName:"scrollbar-subtle !pl-0",showTopGradient:!1,showBottomGradient:!1,children:l.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[l.jsx(V,{variant:"tinyMono",children:t.tool_name}),!!(t.tool_args&&typeof t.tool_args=="object"&&t.tool_args!==null)&&l.jsx(qE,{title:l.jsx(Ne,{defaultMessage:"Request",id:"J+m4xH5bwC",description:"Request"}),content:t.tool_args,showTruncationMessage:!1}),n&&l.jsx(qE,{title:l.jsx(Ne,{defaultMessage:"Response",id:"UC/2Eq4W+h",description:"Response"}),content:n.content})]})})})})}),IWe=({stepId:e,shouldExecuteLocalTool:t,mcpContent:{app:n,mcp_server_type:r,tool_name:s,tool_args:o}})=>{const a=zn(),i=SWe(),c=ln(),u=I0e(),f=d.useMemo(()=>{if(!(!i||r!=="MCP_SERVER_TYPE_LOCAL"||!n))return a.mcpStdioServers?.find(w=>w.name===n)},[i,r,n,a.mcpStdioServers]),m=DWe({server:f,cometState:a,toolName:s}),p=RWe({cometAdapter:c,permissions:m}),{mutateAsync:h}=It({mutationKey:["comet/execute-local-tool",e],mutationFn:async({content:w,isError:S=!1})=>{if(!e)throw new Error("StepID is not set");return de.POST("/rest/sse/perplexity_mcp_response","local-mcp-step",{body:{result:{content:w,is_error:S,uuid:e}}})}}),g=d.useCallback(()=>{h({content:'The MCP tool call was rejected by the user because he dismissed the permission request (refer to them as "you" or use the appropriate equivalent in their language when mentioning this)'})},[h]),y=!!(t&&n&&s&&e&&p);gt({queryKey:be.makeQueryKey("comet/auto-execute-local-tool",e),enabled:y,queryFn:async()=>{if(!n||!s||!e)throw new Error("Missing required parameters");try{const w=await u.callMcpTool({mcpServerName:n,toolName:s,toolArgs:o},{step_uuid:e});return await h({content:w.content.map(S=>S.text).filter(Boolean).join(` - -`)}),!0}catch(w){return await h({content:`The MCP tool call failed: ${w instanceof Error?w.message:"Unknown error"}`,isError:!0}),!1}}});const x=d.useMemo(()=>f?hp(a.installedDxts,f):null,[a.installedDxts,f]),v=x?.display_name??x?.name??n,{data:b}=X4(),_=d.useMemo(()=>f?Xz(b,f):null,[b,f]);return d.useMemo(()=>v?{name:v,iconUrl:_??null,allPermissionsAreGranted:p,askPermissionsBanner:t&&!p&&m?l.jsx(NWe,{variant:"all",connectorName:v,permissions:m,className:"mb-4",onDismiss:g}):null}:null,[p,v,g,_,m,t])};gne.displayName="McpInputOutputStep";const xne=T.memo(e=>{const{content:t,shouldRerunQuery:n=!1}=e,{lastResult:r}=an(),{submitQuery:s}=Wo(),o=d.useCallback(async()=>{r?.query_str&&(await lu({entryUUID:r.backend_uuid,reason:"mcp-tool-output-merge-api"}),s({rawQuery:r.query_str,existingEntryUUID:r.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:r.frontend_context_uuid,promptSource:"user",querySource:"mcp-tool-input",attachments:[],modelPreferenceOverride:"pplx_pro"}))},[s,r]);return d.useEffect(()=>{n&&o()},[o,n]),l.jsx(K,{className:"border-subtlest p-sm rounded-lg border",children:l.jsx(qE,{title:l.jsx(Ne,{defaultMessage:"Response",id:"MgdnPiJHcj"}),content:t})})});xne.displayName="McpToolOutput";const vne=T.memo(({step:e,action:t})=>{const{final:n}=e.content,r=!n;return l.jsx(ze,{text:t,icon:B("file-type-pdf"),isLoading:r,size:"tiny",pill:!0})});vne.displayName="PdfStep";const uP=["start","end"],bne=T.memo(({attachments:e,attachmentProcessingProgress:t})=>{const{$t:n}=J(),s=e.filter(m=>wd(m)).length+t.length,o=e.length+uP.length,a=Math.min(s/o*100,100),i=t.filter(m=>!m.success),c=d.useMemo(()=>!!t.filter(m=>m.file_url==="end").length,[t]),u=d.useCallback(m=>{const p=du(m.file_url??"");let h;switch(m.error_code){case"token_limit_exceeded":h=n({defaultMessage:"{filename} exceeds the model's token limit.",id:"60iyTByOrX"},{filename:p});break;case"file_type_not_supported":h=n({defaultMessage:"{filename} is of an unsupported file type. It will not be included in the results.",id:"sB9AI6thAL"},{filename:p});break;case"no_data_received":h=n({defaultMessage:"{filename} has timed out.",id:"/wyRgEWdz7"},{filename:p});break;default:h=n({defaultMessage:"{filename} could not be read. It will not be included in the results.",id:"7w0MjjvHs3"},{filename:p});break}return h},[n]),f=d.useMemo(()=>{const m=i.map((h,g)=>l.jsx(KE,{icon:B("exclamation-circle"),text:u(h)},g)),p=l.jsx(KE,{icon:B("check"),text:n({defaultMessage:"Successfully read {numAttachments} attached files.",id:"5VxFwE1ux3"},{numAttachments:s-i.length-uP.length})});return[...m,...c?[p]:[]]},[i,n,s,c,u]);return l.jsx(Jf,{className:"pt-md pb-xs px-xs !border-[#32B8C6]",children:l.jsx(Ng,{maxHeight:250,autoScroll:!1,children:l.jsxs("div",{className:"pr-md gap-x-md flex w-full",children:[l.jsx(V,{className:"bg-super flex size-8 flex-none items-center justify-center rounded-md border-[0.75px] border-[#05FFFF]/20 shadow-[0px_1px_4px_0px_rgba(0,0,0,0.24)]",children:l.jsx(ge,{icon:B("paperclip"),size:"md",className:"text-inverse"})}),l.jsxs("div",{className:"gap-y-xs flex grow flex-col",children:[l.jsx(V,{variant:"smallBold",children:n({defaultMessage:"Reading {numAttachments} attached {numAttachments, plural, one {file} other {files}}",id:"BqiTCbmvgp"},{numAttachments:e.length})}),l.jsx("div",{className:"h-2 w-full rounded-[37px] bg-[#60584D]/[0.06]",children:l.jsx("div",{className:"h-2 rounded-[37px] bg-[#32B8C6] transition-all duration-300",style:{width:`${a}%`}})}),l.jsxs("div",{className:"pt-xs",children:[l.jsx(tm,{items:f,vertical:!0,truncate:!1}),!c&&l.jsx(wr,{variant:"super",active:!c,as:"span",className:"pt-xs",children:l.jsx(V,{variant:"small",color:"super",children:n({defaultMessage:"Reading...",id:"IvE1kfOWAz"})})})]})]})]})})})});bne.displayName="PendingFilesStep";const KE=T.memo(({icon:e,text:t})=>l.jsxs("div",{className:"py-xs gap-x-sm flex",children:[l.jsx(V,{className:"flex items-center justify-center",children:l.jsx(Jt,{icon:e,size:"small"})}),l.jsx(V,{variant:"small",color:"light",children:t})]}));KE.displayName="PendingFilesItem";const _ne=T.memo(({user:e,onRemove:t})=>{const n=d.useCallback(()=>{t(e)},[t,e]);return l.jsxs("div",{className:"border-subtlest gap-two pr-three flex h-8 items-center justify-between rounded-lg border pl-1.5 font-sans shadow-sm",children:[l.jsxs("div",{className:"gap-xs px-xs flex min-w-0 flex-row text-left",children:[l.jsx(V,{variant:"small",as:"span",children:e.display_name}),l.jsx(V,{variant:"small",color:"light",className:"truncate",as:"span",children:e.email_address})]}),l.jsx(rt,{variant:"common",size:"tiny",onClick:n,icon:B("x"),extraCSS:"rounded-md","aria-label":`Remove ${e.display_name}`})]})});_ne.displayName="UserPill";const wne=T.memo(({goalId:e,foundUsers:t,names:n,sendStepResult:r})=>{const{$t:s}=J(),[o,a]=d.useState([]),i=d.useRef(null);d.useEffect(()=>{i.current&&i.current.focus()},[]);const c=d.useCallback(y=>{const x=y.map(v=>({...v,selected:!0}));a(x)},[]),u=d.useCallback(async()=>{await r({goal_id:e,selected_users:o,submitted:!0},"User selected contacts and clicked continue",!1)},[e,o,r]),f=d.useCallback(y=>{Ls.isEnterKeyWithoutShift(y.nativeEvent)&&o.length>0&&(y.preventDefault(),u())},[o.length,u]),m=d.useMemo(()=>({chooseContacts:s({defaultMessage:"Confirm or change contacts",id:"j4L7Bt/R+D"}),moreContacts:s({defaultMessage:"More contacts...",id:"XqmjEIgTyk"}),pickContacts:s({defaultMessage:"Pick contacts...",id:"dAWwl8XInO"}),continue:s({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),skip:s({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[s]),p=d.useMemo(()=>(t??[]).map(y=>({type:"default",text:y.display_name??"",description:y.email_address??"",active:o.some(x=>x.email_address===y.email_address),preserveRightElementSpace:!0,onClick:()=>{const x=o.some(v=>v.email_address===y.email_address);c(x?o.filter(v=>v.email_address!==y.email_address):[...o,y])}})),[t,o,c]);d.useEffect(()=>{if(t&&t.length>0&&o.length===0){const y=t.filter(x=>x.selected);if(y.length>0)c(y);else{const x=Math.min(n?.length||1,t.length);c(t.slice(0,x))}}},[t]);const h=d.useCallback(y=>{c(o.filter(x=>x.email_address!==y.email_address))},[o,c]),g=d.useCallback(async()=>{await r({goal_id:e,selected_users:t,submitted:!1},"User clicked skip",!1)},[t,e,r]);return l.jsxs(mr,{ref:i,className:"py-2 pt-4 outline-none",onKeyDown:f,tabIndex:0,children:[l.jsxs("div",{className:"gap-md flex flex-col px-4",children:[l.jsx(V,{variant:"smallBold",children:m.chooseContacts}),l.jsxs("div",{className:"gap-sm flex flex-wrap items-stretch",children:[o.map(y=>l.jsx(_ne,{user:y,onRemove:h},y.email_address)),o.length<(t?.length??0)&&l.jsx(Ws,{items:p,isMobileStyle:!1,placement:"bottom-start",children:l.jsx(ze,{variant:"border",size:"small",icon:B("plus"),"aria-label":o.length===0?m.moreContacts:m.pickContacts})})]})]}),l.jsxs("div",{className:"gap-sm mt-4 flex items-center px-4 py-2",children:[l.jsx(ze,{size:"small",variant:"inverted",text:m.continue,disabled:o.length===0,onClick:u}),l.jsx(rt,{size:"small",text:m.skip,onClick:g})]})]})});wne.displayName="PickContactsStep";const Cne=T.memo(({stepUUID:e,goalId:t,foundBookingOptions:n,isSubmitted:r})=>{const{$t:s}=J(),[o,a]=d.useState(n?.[0]),[i,c]=d.useState(0),u=d.useRef(null),f=d.useRef([]),m=d.useMemo(()=>({title:s({defaultMessage:"Choose booking options",id:"5yyo9+Yhan"}),description:s({defaultMessage:"Select your preferred booking provider",id:"gnnwIHEPAG"}),continue:s({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),confirmed:s({defaultMessage:"Confirmed",id:"dX7+RvbH/9"}),skip:s({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[s]),p=d.useCallback(async()=>{await eh({stepUUID:e,result:{goal_id:t,selected_booking_options:o,submitted:!0},reason:"User selected booking and clicked continue"})},[e,t,o]),h=d.useCallback(async()=>{await eh({stepUUID:e,result:{goal_id:t,selected_booking_options:void 0,submitted:!1},reason:"User clicked skip"})},[t,e]),g=d.useCallback(v=>{a(v)},[]),y=d.useCallback(v=>{c(v)},[]),x=d.useCallback((v,b)=>{f.current[b]=v},[]);return d.useEffect(()=>{if(!n?.length||r)return;const v=_=>{const w=S=>{_.preventDefault(),c(C=>{const E=S==="down"?Math.min(C+1,n.length-1):Math.max(C-1,0);return f.current[E]?.focus(),E})};switch(_.key){case"ArrowDown":w("down");break;case"ArrowUp":w("up");break;case"Enter":case" ":_.preventDefault(),i>=0&&ib.removeEventListener("keydown",v)},[n,i,r]),l.jsxs(Jf,{className:"pb-2 outline-none",title:m.title,description:m.description,descriptionClassName:"text-quiet",children:[l.jsx("div",{className:"gap-md mt-md flex flex-col px-4",children:l.jsx("div",{ref:u,className:"gap-xs flex flex-col",tabIndex:-1,role:"listbox","aria-label":"Booking options",children:(n??[]).map((v,b)=>{const _=o===v,w=z("group flex w-full items-center rounded-none border outline-none transition-[border-color,border-radius,box-shadow] duration-200 hover:transition-none",!r&&"cursor-pointer","border-t-subtlest border-x-transparent","last:border-b-subtlest [&:not(:last-child)]:border-b-transparent",_&&["!border-super/75 dark:bg-black bg-gradient-to-r from-super/25 to-super/25 !rounded-lg shadow-sm"],!_&&!r&&["hover:!border-subtlest hover:bg-subtler hover:rounded-lg","focus-visible:!border-subtlest focus-visible:bg-subtler focus-visible:rounded-lg"],!r&&'[&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:border-t-transparent [&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:transition-none');return l.jsx("div",{ref:S=>x(S,b),tabIndex:r?-1:0,role:"option","aria-selected":_,"data-selected":_,className:w,onClick:()=>!r&&g(v),onFocus:()=>!r&&y(b),children:l.jsxs("div",{className:"flex w-full items-center justify-between px-5 py-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[v?.together?.airline_logos?.[0]&&l.jsx("img",{src:v.together.airline_logos[0],alt:"airline logo",className:"-mt-two size-6 rounded object-contain"}),l.jsx("div",{className:"flex flex-col items-start gap-px",children:l.jsxs(V,{variant:"baseSemi",children:[v?.together?.book_with||"Flight",v?.together?.option_title?` (${v.together.option_title})`:""]})})]}),v?.together?.price&&l.jsxs(V,{variant:"baseSemi",className:"font-bold",children:["$",v.together.price]})]})},b)})})}),l.jsxs("div",{className:"gap-sm mt-sm flex items-center px-4 py-2",children:[l.jsx(ze,{size:"small",variant:"inverted",text:r?m.confirmed:m.continue,icon:r?B("check"):void 0,disabled:!o||r,onClick:p}),l.jsx(rt,{size:"small",text:m.skip,disabled:r,onClick:h})]})]})});Cne.displayName="PickFlightsBookingStep";const dP={weekday:"short",month:"short",day:"numeric",year:"numeric"},PWe={hour:"numeric",minute:"2-digit",hour12:!0},YE="en-US",fP=e=>{if(!e)return"00:00 AM";try{return new Date(e).toLocaleTimeString(YE,PWe).toUpperCase()}catch{return"00:00 AM"}},OWe=e=>{if(!e)return"";const t=Math.floor(e/60),n=e%60;return`${t}h ${n}m`},LWe=e=>{if(!e||e.length===0)return"Nonstop";const t=e.length;return`${t} Stop${t>1?"s":""}`},mP=e=>{if(!e||e.length===0)return null;if(e.length===1){const t=e[0]?.duration||0,n=Math.floor(t/60),r=t%60;return`${n}h ${r}m ${e[0]?.id}`}return e.map(t=>t.id).join(", ")},FWe=(e,t,n)=>{if(!e)return"";const s=new Date(e).toLocaleDateString(YE,dP);if(n==="ROUND_TRIP"&&t){const i=new Date(t).toLocaleDateString(YE,dP);return` · ${s} – ${i}`}return` · ${s}`},Sne=T.memo(({flight:e,index:t,isSelected:n,isSubmitted:r,onSelect:s,onFocus:o,setRef:a})=>{const i=e.flights?.[0]?.departure_airport?.time,c=e.flights?.[e.flights.length-1]?.arrival_airport?.time,u=e.flights?.[0]?.departure_airport?.id||"XXX",f=e.flights?.[e.flights.length-1]?.arrival_airport?.id||"XXX",m=e.flights?.[0]?.airline,p=z("group flex w-full items-center rounded-none border outline-none transition-[border-color,border-radius,box-shadow] duration-200 hover:transition-none",!r&&"cursor-pointer","border-t-subtlest border-x-transparent","last:border-b-subtlest [&:not(:last-child)]:border-b-transparent",n&&["!border-super/75 dark:bg-black bg-gradient-to-r from-super/25 to-super/25 !rounded-lg shadow-sm"],!n&&!r&&["hover:!border-subtlest hover:bg-subtler hover:rounded-lg","focus-visible:!border-subtlest focus-visible:bg-subtler focus-visible:rounded-lg"],!r&&'[&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:border-t-transparent [&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:transition-none');return l.jsx("div",{ref:h=>a(h,t),tabIndex:r?-1:0,role:"option","aria-selected":n,"data-selected":n,className:p,onClick:()=>!r&&s(e),onFocus:()=>!r&&o(t),children:l.jsxs("div",{className:"grid w-full grid-cols-[auto_1fr_88px_88px_88px] items-start gap-6 px-5 py-4",children:[l.jsx("div",{className:"pt-two flex self-stretch",children:e.airline_logo&&l.jsx("img",{src:e.airline_logo,alt:"airline logo",className:"size-10 rounded object-contain"})}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx(V,{variant:"baseSemi",children:fP(i)}),l.jsx("span",{className:"text-quieter px-1",children:"–"}),l.jsx(V,{variant:"baseSemi",children:fP(c)})]}),m&&l.jsx(V,{variant:"tinyMono",color:"light",children:m})]}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsx(V,{variant:"baseSemi",children:OWe(e.total_duration)}),l.jsxs(V,{variant:"tinyMono",color:"light",children:[u,"–",f]})]}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsx(V,{variant:"baseSemi",children:LWe(e.layovers)}),mP(e.layovers)&&l.jsx(V,{variant:"tinyMono",color:"light",children:mP(e.layovers)})]}),l.jsxs("div",{className:"flex flex-col items-end justify-end gap-px",children:[e.price&&l.jsxs(V,{variant:"baseSemi",className:"font-bold",children:["$",e.price]}),l.jsx(V,{variant:"tinyMono",color:"light",children:e.type})]})]})},`flight-${t}`)});Sne.displayName="FlightCard";const Ene=T.memo(({stepUUID:e,goalId:t,foundFlights:n,isSubmitted:r,outboundDate:s,returnDate:o,flightType:a})=>{const{$t:i}=J(),[c,u]=d.useState(n?.length>0?0:-1),[f,m]=d.useState(0),p=d.useRef(null),h=d.useRef([]),g=d.useMemo(()=>FWe(s,o,a),[s,o,a]),y=d.useMemo(()=>({title:i({defaultMessage:"Top departing flights",id:"tHwLRV4b68"})+g,description:i({defaultMessage:"Ranked by price and convenience. Prices include taxes and fees for one adult.",id:"cAxRMXuRMO"}),continue:i({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),confirmed:i({defaultMessage:"Confirmed",id:"dX7+RvbH/9"}),skip:i({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[i,g]),x=d.useCallback(async()=>{const S=c>=0&&n?n[c]:void 0;await eh({stepUUID:e,result:{goal_id:t,selected_flight:S,submitted:!0},reason:"User selected flight and clicked continue"})},[e,t,c,n]),v=d.useCallback(async()=>{await eh({stepUUID:e,result:{goal_id:t,selected_flight:void 0,submitted:!1},reason:"User clicked skip"})},[t,e]),b=d.useCallback(S=>{const C=n?.findIndex(E=>E===S)??-1;u(C)},[n]),_=d.useCallback(S=>{m(S)},[]),w=d.useCallback((S,C)=>{h.current[C]=S},[]);return d.useEffect(()=>{if(!n?.length||r)return;const S=E=>{const N=k=>{E.preventDefault(),m(I=>{const M=k==="down"?Math.min(I+1,n.length-1):Math.max(I-1,0);return h.current[M]?.focus(),M})};switch(E.key){case"ArrowDown":N("down");break;case"ArrowUp":N("up");break;case"Enter":case" ":E.preventDefault(),f>=0&&fC.removeEventListener("keydown",S)},[n,f,r]),l.jsxs(Jf,{className:"pb-2 outline-none",title:y.title,description:y.description,descriptionClassName:"text-quiet",children:[l.jsx("div",{className:"gap-md mt-md flex flex-col px-4",children:l.jsx("div",{ref:p,className:"gap-xs flex flex-col",tabIndex:-1,role:"listbox","aria-label":"Flight options",children:(n??[]).map((S,C)=>l.jsx(Sne,{flight:S,index:C,isSelected:c===C,isSubmitted:r,onSelect:b,onFocus:_,setRef:w},C))})}),l.jsxs("div",{className:"gap-sm mt-sm flex items-center px-4 py-2",children:[l.jsx(ze,{size:"small",variant:"inverted",text:r?y.confirmed:y.continue,icon:r?B("check"):void 0,disabled:c<0||r,onClick:x}),l.jsx(rt,{size:"small",text:y.skip,disabled:r,onClick:v})]})]})});Ene.displayName="PickFlightsSearchStep";const kne=d.memo(({children:e,defaultExpanded:t=!1,title:n})=>{const{$t:r}=J(),[s,o]=d.useState(t),a=d.useCallback(()=>{o(c=>!c)},[]),i=d.useMemo(()=>s?B("chevron-down"):B("chevron-right"),[s]);return l.jsx(pi,{className:"overflow-hidden",transition:{duration:.3,ease:Yr},children:l.jsxs("div",{children:[l.jsx(ze,{variant:"common",text:n??r({defaultMessage:"Advanced",id:"3Rx6Qo1x+1"}),onClick:a,size:"tiny",icon:i,noPadding:!0,extraCSS:"!bg-transparent hover:!bg-subtler"}),l.jsx(Fo,{children:s&&l.jsx("div",{className:"pt-2",children:e})})]})})});kne.displayName="AutomationAdvancedSection";const BWe=[{value:"ONCE",label:"Once"},{value:"DAILY",label:"Daily"},{value:"WEEKLY",label:"Weekly"},{value:"WEEKDAYS",label:"Every weekday"},{value:"MONTHLY",label:"Monthly"},{value:"YEARLY",label:"Yearly"}],UWe=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],VWe=[...Array(31)].map((e,t)=>({value:String(t+1),label:String(t+1)})),HWe=[{value:"0",label:"January"},{value:"1",label:"February"},{value:"2",label:"March"},{value:"3",label:"April"},{value:"4",label:"May"},{value:"5",label:"June"},{value:"6",label:"July"},{value:"7",label:"August"},{value:"8",label:"September"},{value:"9",label:"October"},{value:"10",label:"November"},{value:"11",label:"December"}],pP=({hour:e,minute:t})=>`${e%12||12}:${t.toString().padStart(2,"0")} ${e>=12?"PM":"AM"}`,hP=e=>{const t=e.trim().match(/^((?:0?[1-9]|1[0-2])):([0-5]\d)\s*([ap]m)$/i);if(!t||t.length!==4)return null;const n=parseInt(t[1]??"",10),r=parseInt(t[2]??"",10);if(isNaN(n)||isNaN(r))return null;const s=t[3]?.toLowerCase();return s==="pm"&&n!==12?{hour:n+12,minute:r}:s==="am"&&n===12?{hour:0,minute:r}:{hour:n,minute:r}},zWe=(e,t)=>e.hour===t.hour&&e.minute===t.minute,WWe=Array.from({length:48},(e,t)=>({hour:Math.floor(t/2),minute:t%2*30}));function GWe({value:e,onChange:t,placeholder:n="Select time",variant:r="default",withIcon:s}){const[o,a]=d.useState(""),[i,c]=d.useState(!1),u=d.useRef(null),f=o.trim()!==""&&!hP(o),m=d.useRef(null),p=e?pP(e):n,h=d.useMemo(()=>WWe.map(S=>({key:`${S.hour}:${S.minute}`,label:pP(S),value:S})),[]),g=d.useCallback(S=>{S&&i&&e&&m.current&&m.current?.scrollIntoView({behavior:"instant",block:"start"})},[i,e]),y=()=>{const S=hP(o);S&&t(S),a("")},x=S=>{t(S),a(""),c(!1)},v=()=>{c(!i)},b=()=>{c(!i),setTimeout(()=>{u.current&&u.current.focus()},0)},_=(()=>{switch(r){case"subtle":return"bg-subtle";case"default":return"bg-subtler";default:Ft(r)}})(),w=d.useMemo(()=>l.jsx(ge,{icon:B("clock"),size:"sm"}),[]);return l.jsx("div",{className:"relative size-full",children:l.jsx(Ul,{interaction:"click",open:i,onOpenChange:c,triggerElement:l.jsxs("div",{role:"button",tabIndex:0,onClick:v,className:z(_,"text-foreground flex size-full cursor-pointer items-center gap-2 rounded-lg px-4 font-sans","border transition-colors duration-200 ease-out","outline-none focus:outline-none focus:ring-0","hover:border-subtler focus-within:border-subtler border-transparent",{"!border-negative":f}),children:[s&&w,l.jsx("input",{ref:u,type:"text",value:o||p,placeholder:n,onChange:S=>a(S.target.value),onBlur:y,onClick:b,className:"w-full bg-transparent text-sm focus:outline-none"}),l.jsx(ge,{size:"xs",icon:B("chevron-down"),className:"right-sm pointer-events-none absolute text-inherit opacity-50"})]}),children:l.jsx("div",{ref:g,className:"p-xs scrollbar-subtle max-h-64 overflow-y-auto",children:h.map(S=>l.jsx("div",{ref:e&&zWe(S.value,e)?m:null,role:"button",tabIndex:0,onClick:()=>x(S.value),className:"px-sm text-foreground cursor-pointer rounded-lg py-1.5 hover:bg-subtler",children:l.jsx(V,{variant:"extraSmall",children:S.label})},S.key))})})})}const lf=d.memo(({children:e})=>l.jsx("div",{className:"min-w-0 flex-1 rounded-md",children:e}));lf.displayName="InputWrapper";const ip=d.memo(({options:e,value:t,onChange:n,isMobileStyle:r,variant:s="default"})=>{const o=J(),a=d.useMemo(()=>e.map(p=>({type:"default",text:p.label,onClick:()=>n(p.value),active:p.value===t,role:"menuitemradio"})),[n,e,t]),c=d.useMemo(()=>e.find(p=>p.value===t),[e,t])?.label||o.formatMessage({defaultMessage:"Select...",id:"724CrE1YuG"}),u=d.useMemo(()=>({className:"w-full"}),[]),f=d.useMemo(()=>({matchTargetWidth:!0,avoidPositionCollisions:!1}),[]),m=(()=>{switch(s){case"subtle":return"";case"default":return"!bg-subtler";default:Ft(s)}})();return l.jsx(lf,{children:l.jsx(Ws,{items:a,isMobileStyle:r,placement:"bottom",contentClassName:"w-full",boxProps:u,popoverProps:f,children:l.jsx(ze,{text:c,extraCSS:z("px-4 size-full !h-10 border-0 !outline-none !justify-start font-normal",m),textClassName:"text-left text-foreground text-sm font-normal",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down")})})})});ip.displayName="FormSelect";const G6=d.memo(({schedule:e,onScheduleChange:t,variant:n="default"})=>{const{formatMessage:r}=J(),{isMobileStyle:s}=Re(),o=d.useMemo(()=>new Date(e.year,e.month,e.day,e.hour,e.minute),[e.year,e.month,e.day,e.hour,e.minute]),{kind:a}=e,i=a==="ONCE",c=a==="WEEKLY",u=a==="MONTHLY"||a==="YEARLY",f=a==="YEARLY",m=d.useCallback(b=>{t({kind:b})},[t]),p=d.useCallback(b=>{t({dayOfWeek:parseInt(b,10)})},[t]),h=d.useCallback(b=>{t({month:parseInt(b,10)})},[t]),g=d.useCallback(b=>{t({day:parseInt(b,10)})},[t]),y=d.useCallback(b=>{b&&t({day:b.getDate(),month:b.getMonth(),year:b.getFullYear()})},[t]),x=d.useCallback(b=>{t({hour:b.hour,minute:b.minute})},[t]),v=d.useMemo(()=>({hour:e.hour,minute:e.minute}),[e.hour,e.minute]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:r({defaultMessage:"Schedule",id:"hGQqkWwmJD"})}),l.jsxs("div",{className:"flex h-10 flex-wrap gap-3",children:[l.jsx(ip,{options:BWe,value:e.kind,onChange:m,isMobileStyle:s,variant:n}),c&&l.jsx(ip,{options:UWe,value:String(e.dayOfWeek),onChange:p,isMobileStyle:s,variant:n}),f&&l.jsx(ip,{options:HWe,value:String(e.month),onChange:h,isMobileStyle:s,variant:n}),u&&l.jsx(ip,{options:VWe,value:String(e.day),onChange:g,isMobileStyle:s,variant:n}),i&&l.jsx(lf,{children:l.jsx(E2,{value:o,onChange:y,variant:n})}),l.jsx(lf,{children:l.jsx(GWe,{value:v,onChange:x,variant:n})})]})]})});G6.displayName="ScheduleSelect";const $We=Ue({selectModel:{defaultMessage:"Select model...",id:"XZsGHYyuKM"}}),qWe=({selectedModel:e,onModelChange:t,variant:n="default",isOpen:r,onOpen:s,onClose:o})=>{const a=e||ie.PRO,{$t:i}=J(),{isMobileStyle:c}=Re(),{menuItems:u}=mQ({currentModel:a,onModelSelect:p=>{t?.(p)}}),f=Jn[a].name||$We.selectModel,m=(()=>{switch(n){case"subtle":return"bg-subtle";case"default":return"!bg-subtler";default:Ft(n)}})();return l.jsx(Ws,{items:u,isMobileStyle:c,placement:"bottom",contentClassName:"w-full",boxProps:{className:"w-full max-w-full"},popoverProps:{matchTargetWidth:!0,avoidPositionCollisions:!1},isOpen:r,onOpen:s,onClose:o,children:l.jsx(ze,{text:i(f),extraCSS:z("px-4 size-full !h-10 border-0 !outline-none !justify-start font-normal",m),textClassName:"text-left text-foreground text-sm font-normal",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down")})})};function KWe({sources:e,onChange:t,variant:n="default",isOpen:r,onOpen:s,onClose:o}){const{$t:a}=J(),{getSourceLabel:i}=sc(),c=d.useMemo(()=>{if(e.length===1){const m=e[0];if(m)return i(m)}return a({defaultMessage:"{count} sources",id:"l1+6PggBqU"},{count:e.length})},[e,i,a]),u=m=>{t(m.filter(ga))},f=d.useMemo(()=>l.jsx(_t.Button,{variant:"tonal",children:c}),[c]);return l.jsx(GA,{isOpen:r??!1,sources:e,onChange:u,triggerElement:f,onOpen:s,onClose:o,omitCometMcpSources:!0,omittedSources:["org","google_drive","onedrive","sharepoint","my_files"]})}const Yv=d.memo(({searchModel:e,onSearchModelChange:t,sources:n,onSourcesChange:r,variant:s="default"})=>{const o=sn(e),{hasActiveSubscription:a}=Bt(),[i,c]=d.useState(!1),[u,f]=d.useState(!1),m=d.useCallback(()=>{c(!0),f(!1)},[]),p=d.useCallback(()=>{c(!1)},[]),h=d.useCallback(()=>{f(!0),c(!1)},[]),g=d.useCallback(()=>{f(!1)},[]);return l.jsx("div",{className:"flex w-full flex-col gap-2",children:l.jsxs("div",{className:"flex gap-3",children:[a&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Mode",id:"mrOnjMzgC4"})}),l.jsx("div",{className:"h-full w-fit",children:l.jsx(JY,{value:e,onChange:t,layoutKey:"task-modal",className:"h-full",variant:s,buttonSize:"regular"})})]}),a&&o===oe.SEARCH&&l.jsxs("div",{className:"flex min-w-[100px] flex-1 flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Model",id:"rhSI1/3g21"})}),l.jsx(lf,{children:l.jsx(qWe,{selectedModel:e,onModelChange:t,variant:s,isOpen:i,onOpen:m,onClose:p})})]}),a&&l.jsxs("div",{className:"flex min-w-[100px] flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Sources",id:"fhwTpAcBLC"})}),l.jsx(lf,{children:l.jsx(KWe,{sources:n,onChange:r,variant:s,isOpen:u,onOpen:h,onClose:g})})]})]})})});Yv.displayName="QuerySearchConfigurationSelector";const Mne=d.memo(({query:e,onQueryChange:t})=>{const{$t:n}=J(),{hasActiveSubscription:r}=Bt(),s=d.useCallback(i=>{t({...e,searchModel:i})},[t,e]),o=d.useCallback(i=>{t({...e,sources:i})},[t,e]);if(!r)return null;const a=n({defaultMessage:"Model options",id:"ObVxV7yacw"});return l.jsx(kne,{title:a,children:l.jsx(Yv,{searchModel:e.searchModel,onSearchModelChange:s,sources:e.sources??eg(),onSourcesChange:o,variant:"subtle"})})});Mne.displayName="ScheduledAutomationAdvancedConfiguration";const Tne=d.memo(({trigger:e,query:t,onQueryChange:n})=>{switch(e.type){case Xe.SCHEDULED:return l.jsx(Mne,{query:t,onQueryChange:n});case Xe.PRICE_ALERT:case Xe.SHORTCUT:return null;default:Ft(e)}});Tne.displayName="AutomationAdvancedSettingsConfiguration";const Ane=d.memo(({expiryDate:e,onExpiryDateChange:t,schedule:n})=>{const{$t:r}=J(),s=d.useCallback(i=>{i.stopPropagation(),t(null)},[t]),o=d.useMemo(()=>l.jsx(ze,{type:"button",onClick:s,icon:B("x"),size:"tiny",variant:"common"}),[s]),a=d.useMemo(()=>{if(e===null)return;const i=n?y4(n):void 0;return i?$S(i,1):void 0},[e,n]);return l.jsx(E2,{value:e===null?void 0:e,onChange:t,buttonClassName:"w-full py-sm bg-subtle",trailingIcon:o,fromDate:a,placeholder:r({defaultMessage:"None selected",id:"7MYtB45RD0"})})});Ane.displayName="AutomationExpiryDatePicker";const Nne=d.memo(({defaultExpiryDate:e,expiryDate:t,onExpiryDateChange:n,schedule:r})=>{const s=d.useCallback(o=>{n?.(o)},[n]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Expiration date",id:"CICBj0Td+l"})}),l.jsx(Ane,{expiryDate:t||e,onExpiryDateChange:s,schedule:r})]})});Nne.displayName="ExpiryDateSection";const Rne=d.memo(({trigger:e,onTriggerChange:t})=>{const n=d.useCallback(r=>{e.type===Xe.SCHEDULED&&t({...e,type:Xe.SCHEDULED,expiryDate:r})},[t,e]);switch(e.type){case Xe.SCHEDULED:return e.schedule.kind!=="ONCE"?l.jsx(Nne,{defaultExpiryDate:e.defaultExpiryDate,expiryDate:e.expiryDate,onExpiryDateChange:n,schedule:e.schedule}):null;case Xe.PRICE_ALERT:case Xe.SHORTCUT:return null;default:Ft(e)}});Rne.displayName="AutomationExpiryDateConfiguration";const YWe=({options:e,selectedValues:t,onSelectionChange:n,placeholder:r="Select options...",disabled:s=!1})=>{const o=J(),{isMobileStyle:a}=Re(),[i,c]=d.useState(!1),u=d.useCallback(x=>{const b=t.includes(x)?t.filter(_=>_!==x):[...t,x];n(b)},[t,n]),f=d.useMemo(()=>e.map(x=>{const v=t.includes(x.value);return{type:"multiSelect",text:x.label,onClick:()=>{u(x.value)},selected:v,iconVariant:"check",disableActiveStyles:!0}}),[e,t,u]),m=d.useMemo(()=>{if(t.length===0)return r;const x=t.map(v=>e.find(b=>b.value===v)?.label).filter(Boolean);return new Intl.ListFormat(o.locale,{style:"long",type:"conjunction"}).format(x)},[t,e,r,o.locale]),p=d.useCallback(()=>c(!0),[]),h=d.useCallback(()=>c(!1),[]),g=d.useMemo(()=>({className:"w-[180px]"}),[]),y=d.useMemo(()=>({matchTargetWidth:!1,avoidPositionCollisions:!1}),[]);return l.jsx(Ws,{isOpen:i,onOpen:p,onClose:h,items:f,isMobileStyle:a,placement:"bottom-end",contentClassName:"w-full",boxProps:g,popoverProps:y,disabled:s,alwaysShowChildren:!0,children:l.jsx(ze,{text:m,extraCSS:"px-4 w-full !h-10 border-0 !outline-none !justify-start font-normal",textClassName:"text-left text-foreground text-sm font-normal truncate",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down"),disabled:s})})},QWe=(e,t)=>{const{value:n,loading:r}=qt({flag:"app-notifications",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Dne=d.memo(({notificationSettings:e,onNotificationSettingsChange:t,disabled:n})=>{const{$t:r}=J(),{variation:s,loading:o}=QWe(!1),a=d.useMemo(()=>{const u=[];return s&&!o&&u.push({value:"in_app",label:r({defaultMessage:"In-app",id:"E7zWOQXV+k"})}),u.push({value:"email",label:r({defaultMessage:"Email",id:"sy+pv5U9ls"})},{value:"push",label:r({defaultMessage:"Mobile",id:"GWtmtuCmOx"})}),u},[r,s,o]),i=d.useMemo(()=>{const u=[];return s&&!o&&e.should_send_in_app&&u.push("in_app"),e.should_send_email&&u.push("email"),e.should_send_push&&u.push("push"),u},[e,s,o]),c=d.useCallback(u=>{t({should_send_email:u.includes("email"),should_send_push:u.includes("push"),should_send_in_app:u.includes("in_app")})},[t]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Notification platform",id:"L9evilaxeT"})}),l.jsx(YWe,{options:a,selectedValues:i,onSelectionChange:c,placeholder:r({defaultMessage:"Select platform",id:"Gl5w1+hLYC"}),disabled:n})]})});Dne.displayName="AutomationNotificationConfiguration";const Qv=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e.toUpperCase(),currencyDisplay:"symbol"}).format(0).replace(/[0-9.,\s]/g,"").trim()||"$"}catch{return"$"}},Xv="5";function QE(e){const t={selectedSymbol:e.symbol,additionalInstructions:"",selectedOption:"price",priceValue:"",percentValue:"",positiveSelected:!0,negativeSelected:!0};switch(e.alertType){case pr.TARGET_PRICE:return{...t,selectedOption:"price",priceValue:e.price===0?"":e.price.toString()};case pr.MOVEMENT_AMOUNT:{const n=e.percentageDecimalUpperBound>0&&e.percentageDecimalUpperBound!==Vl/100,r=e.percentageDecimalLowerBound<0&&e.percentageDecimalLowerBound!==Hl/100;let s="";return n?s=(e.percentageDecimalUpperBound*100).toFixed(2):r&&(s=(Math.abs(e.percentageDecimalLowerBound)*100).toFixed(2)),s?{...t,selectedOption:"movement",percentValue:s,positiveSelected:n,negativeSelected:r}:{...t,selectedOption:"movement",percentValue:Xv,positiveSelected:!0,negativeSelected:!0}}default:Ft(e)}}function XWe(e){switch(e.selectedOption){case"price":{const t=parseFloat(e.priceValue.replace(/[^0-9.]/g,""));return{type:Xe.PRICE_ALERT,alertType:pr.TARGET_PRICE,symbol:e.selectedSymbol??"",price:t||0,currency:"usd"}}case"movement":{const n=(parseFloat(e.percentValue)||0)/100;let r=0,s=0;return e.positiveSelected&&e.negativeSelected?(r=n,s=-n):e.positiveSelected?r=n:e.negativeSelected&&(s=-n),{type:Xe.PRICE_ALERT,alertType:pr.MOVEMENT_AMOUNT,symbol:e.selectedSymbol??"",percentageDecimalUpperBound:r,percentageDecimalLowerBound:s}}default:Ft(e.selectedOption)}}function ZWe({trigger:e,onTriggerChange:t}){const[n,r]=d.useState(()=>QE(e)),s=d.useMemo(()=>e.alertType===pr.TARGET_PRICE?`${e.symbol}-${e.alertType}-${e.price}`:`${e.symbol}-${e.alertType}-${e.percentageDecimalUpperBound}-${e.percentageDecimalLowerBound}`,[e]),o=d.useRef(s);d.useEffect(()=>{s!==o.current&&(r(QE(e)),o.current=s)},[s,e]);const a=d.useCallback(y=>{const x=XWe(y);t(x)},[t]),i=d.useCallback(y=>{r(x=>{const v=y(x);return a(v),v})},[a]),c=d.useCallback(y=>{i(x=>({...x,selectedSymbol:y}))},[i]),u=d.useCallback((y,x="")=>{i(v=>{switch(y){case"price":return{...v,selectedOption:y,priceValue:x};case"movement":return{...v,selectedOption:y,percentValue:Xv,positiveSelected:!0,negativeSelected:!0};default:Ft(y)}})},[i]),f=d.useCallback(y=>{i(x=>({...x,priceValue:typeof y=="function"?y(x.priceValue):y}))},[i]),m=d.useCallback(y=>{i(x=>({...x,percentValue:typeof y=="function"?y(x.percentValue):y}))},[i]),p=d.useCallback(y=>{i(x=>({...x,positiveSelected:y}))},[i]),h=d.useCallback(y=>{i(x=>({...x,negativeSelected:y}))},[i]),g=d.useCallback(y=>{r(x=>({...x,additionalInstructions:y}))},[]);return d.useMemo(()=>({formState:n,onSymbolChange:c,onOptionChange:u,onPriceValueChange:f,onPercentValueChange:m,onPositiveChange:p,onNegativeChange:h,onAdditionalInstructionsChange:g}),[n,c,u,f,m,p,h,g])}const jne=async e=>{const{data:t,error:n,response:r}=await de.GET("/rest/finance/quote/{market_identifier}","automations/quote",{params:{path:{market_identifier:e}}});if(n)throw new ye("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t},Ine=e=>["automations/quote",e],Zv=({symbol:e,enabled:t=!!e,onInitialSuccess:n})=>{const r=d.useRef(!1),s=gt({enabled:t&&!!e,queryKey:Ine(e),queryFn:()=>jne(e)});return d.useEffect(()=>{s.isSuccess&&s.data&&!r.current&&n&&(r.current=!0,n(s.data))},[s.isSuccess,s.data,n]),s},Pne=d.memo(({trigger:e,prompt:t,onPromptChange:n,error:r,variant:s="default",disabled:o})=>{const{isMobileUserAgent:a}=Re(),{$t:i,locale:c}=J(),u=QE(e),{selectedSymbol:f,priceValue:m,percentValue:p}=u,{data:h,isLoading:g}=Zv({symbol:u.selectedSymbol}),y=e.alertType===pr.TARGET_PRICE?"price":"movement",x=h?.currency?Qv(h?.currency,c):"$",{displayInstructions:v}=CE({selectedSymbol:f,quote:h,isLoading:g,alertType:y,priceValue:m,percentValue:p,currencySymbol:x,$t:i});return l.jsxs("div",{className:z("gap-md flex flex-col",o&&"pointer-events-none opacity-50"),children:[l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"tiny",color:"light",className:"flex shrink-0 items-center",children:l.jsx(Ne,{defaultMessage:"Default query",id:"7SalR4PwjB"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(V,{variant:"small",color:"light",className:"pl-sm border-subtlest border-l-2",children:v})})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"tiny",color:"light",className:"flex shrink-0 items-center",children:l.jsx(Ne,{defaultMessage:"Additional Instructions (optional)",id:"QFuOkrgHHJ"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(yu,{value:t,onChange:n,isMobileUserAgent:a,isMobileStyle:!1,minRows:3,maxLength:vV,className:z("[&_textarea]:placeholder:!text-quietest placeholder:!text-quietest hover:!border-subtler focus-within:!border-subtler !border !border-transparent","w-full"),placeholder:"Check news and social media sentiment to assess consensus or controversy",variant:s,disabled:o})})]}),r&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:r})]})]})});Pne.displayName="PriceAlertQueryPromptInput";const One=d.memo(({trigger:e,prompt:t,onPromptChange:n,error:r,variant:s,disabled:o})=>{const{data:a}=Zv({symbol:e.symbol}),i=d.useMemo(()=>{if(!e.symbol)return"";const f=a?.name?` (${a.name})`:"";return e.alertType===pr.TARGET_PRICE?Fv({symbol:e.symbol,quoteName:f}):Bv({symbol:e.symbol,quoteName:f})},[e.symbol,e.alertType,a?.name]),c=d.useMemo(()=>{const f=a?.name?` (${a.name})`:"";return YJ({prompt:t,symbol:e.symbol,quoteName:f})},[t,e.symbol,a?.name]),u=f=>{const m=KJ({baseInstructions:i,additionalInstructions:f});n(m)};return l.jsx(Pne,{trigger:e,prompt:c,onPromptChange:u,error:r,variant:s,disabled:o})});One.displayName="PriceAlertPromptWrapper";const Jv=d.memo(({trigger:e,prompt:t,onPromptChange:n,placeholder:r,error:s,variant:o="default",disabled:a})=>{const{isMobileUserAgent:i}=Re(),c=(()=>{switch(o){case"default":return"bg-subtler [&_textarea]:bg-transparent";case"subtle":return"bg-subtle [&_textarea]:bg-transparent";default:Ft(o)}})();switch(e.type){case Xe.SCHEDULED:case Xe.SHORTCUT:return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Instructions",id:"sV2v5LjRpX"})}),l.jsx(yu,{placeholder:r,value:t,onChange:n,isMobileUserAgent:i,isMobileStyle:!1,minRows:3,maxLength:vV,allowEnterNewlines:!0,className:z("hover:!border-subtler focus-within:!border-subtler !border !border-transparent",c),variant:o,disabled:a}),s&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:s})]})]});case Xe.PRICE_ALERT:return l.jsx(One,{trigger:e,prompt:t,onPromptChange:n,error:s,variant:o,disabled:a});default:Ft(e)}});Jv.displayName="QueryPromptInput";const Lne=d.memo(({trigger:e,query:t,onQueryChange:n})=>{const{$t:r}=J(),s=d.useCallback(c=>{n({...t,prompt:c})},[n,t]),o=d.useCallback(c=>{n({...t,searchModel:c})},[n,t]),a=d.useCallback(c=>{n({...t,sources:c})},[n,t]),i=d.useMemo(()=>{switch(e.type){case Xe.SCHEDULED:return null;case Xe.PRICE_ALERT:return null;case Xe.SHORTCUT:return l.jsx(Yv,{searchModel:t.searchModel,onSearchModelChange:o,sources:t.sources??eg(),onSourcesChange:a,variant:"subtle"});default:Ft(e)}},[o,a,t.searchModel,t.sources,e]);return e.type===Xe.PRICE_ALERT?null:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(Jv,{trigger:e,prompt:t.prompt,placeholder:r({defaultMessage:"Describe what you want to automate",id:"79ZUaZU8Ho"}),onPromptChange:s,variant:"subtle"}),i]})});Lne.displayName="AutomationQueryConfiguration";const JWe=async({query:e,locale:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/tasks-autosuggest",n,{params:{query:{query:e}},headers:{"accept-language":t},shouldNotAddSourceVersionQueryParams:!1});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get finance tasks suggestions",cause:s,status:o.status??0});return"results"in r?r.results:[]}catch(r){return Z.error(r),[]}},eGe=({symbol:e})=>l.jsx(V,{color:"light",children:l.jsx("span",{className:"font-mono opacity-70",children:e.slice(0,1)})}),$6=({image:e,imageDark:t,alt:n,watchlistType:r,className:s,imageClassName:o})=>{const a=r==="FINANCE",{colorScheme:i}=Ss(),c=a&&i==="dark"&&t?t:e,[u,f]=d.useState(()=>{if(!c)return!1;const g=new Image;return g.src=c,g.complete&&g.naturalWidth>0}),[m,p]=d.useState(!1),h=!u||m;return l.jsxs("div",{className:z("relative flex size-6 items-center justify-center",{"bg-subtler":h},s),children:[h&&l.jsx(eGe,{symbol:n??""}),!m&&l.jsx("div",{className:z("absolute",o),children:l.jsx("img",{src:c,alt:n,width:32,height:32,className:z("inset-0 size-full object-contain",{"opacity-0":!u}),onLoad:()=>f(!0),onError:()=>p(!0)})})]})},Fne="[&_textarea]:placeholder:!text-quietest placeholder:!text-quietest hover:!border-subtler focus-within:!border-subtler !border !border-transparent",tGe=e=>/^(\d+(\.\d{0,2})?|\.\d{1,2})$/.test(e),nGe=e=>/^(\d+(\.\d{0,1})?|\.\d{0,1})$/.test(e),rGe=({currentPrice:e,value:t,onChange:n,variant:r="default",currency:s="USD"})=>{const{isMobileUserAgent:o}=Re(),{locale:a,$t:i}=J(),c=d.useMemo(()=>Qv(s,a),[s,a]),u=d.useMemo(()=>e?.toLocaleString(a,{style:"currency",currency:s.toUpperCase()}),[e,a,s]),f=d.useCallback(y=>{n(x=>{if(y===c)return y;const v=y.replace(c,"");return tGe(v)||y===""?c+v:x})},[n,c]),m=d.useCallback(()=>{t===""&&n(c)},[n,t,c]),p=d.useCallback(()=>{t===c&&n("")},[n,t,c]),h=(()=>{switch(r){case"default":return"bg-subtler [&_textarea]:bg-subtler";case"subtle":return"bg-subtle [&_textarea]:bg-subtle";default:Ft(r)}})(),g=z(Fne,h);return l.jsxs("div",{className:"gap-sm flex flex-col items-start",children:[l.jsx(V,{variant:"tiny",color:"light",children:u?i({id:"74LVOPcS2E",defaultMessage:"Target Price (currently {formattedPrice})"},{formattedPrice:u}):i({id:"xPMPP84OOV",defaultMessage:"Target Price"})}),l.jsx("div",{className:"gap-sm flex items-stretch",children:l.jsx(co,{placeholder:c,className:z(g,"p-sm !rounded-md"),variant:"monospace",isMobileUserAgent:o,value:t,onChange:f,onFocus:m,onBlur:p,disable1pass:!0,colorVariant:r})})]})},sGe=({value:e,onChange:t,positiveSelected:n,onPositiveChange:r,negativeSelected:s,onNegativeChange:o,variant:a="default"})=>{const{isMobileUserAgent:i}=Re(),{$t:c}=J(),u=d.useCallback(()=>{o(!s)},[s,o]),f=d.useCallback(()=>{r(!n)},[r,n]),m=d.useCallback(y=>{t(x=>nGe(y)||y===""?y:x)},[t]),p=d.useMemo(()=>({delayDuration:100}),[]),h=(()=>{switch(a){case"default":return"bg-subtler [&_textarea]:bg-subtler";case"subtle":return"bg-subtle [&_textarea]:bg-subtle";default:Ft(a)}})(),g=z(Fne,h);return l.jsx("div",{className:"gap-md flex flex-col",children:l.jsxs("div",{className:"gap-sm flex flex-col items-start",children:[l.jsx(V,{variant:"tiny",color:"light",children:c({id:"agMnIX4PMS",defaultMessage:"Movement Amount (%)"})}),l.jsxs("div",{className:"gap-md flex h-full items-center",children:[l.jsxs("div",{className:"gap-sm flex h-full items-center",children:[l.jsx(ze,{variant:s?"primaryGhost":"border",size:"small",onClick:u,pill:!0,icon:B("minus"),toolTip:c({id:"M9L9vXrgoN",defaultMessage:"Negative Movement"}),tooltipProps:p}),l.jsx(ze,{variant:n?"primaryGhost":"border",size:"small",onClick:f,pill:!0,icon:B("plus"),toolTip:c({id:"iFYP+IX00i",defaultMessage:"Positive Movement"}),tooltipProps:p})]}),l.jsx(co,{className:z(g,"p-sm !rounded-md"),variant:"monospace",isMobileUserAgent:i,value:e,onChange:m,disable1pass:!0,colorVariant:a})]})]})})},q6=T.memo(e=>{const{selectedSymbol:t,selectedOption:n,onSymbolChange:r,onOptionChange:s,showSymbolInput:o=!0,currentPrice:a,priceValue:i,onPriceValueChange:c,percentValue:u,onPercentValueChange:f,positiveSelected:m,onPositiveChange:p,negativeSelected:h,onNegativeChange:g,externalInputValue:y,variant:x,colorVariant:v="default",currency:b,isAssetSelected:_=!0}=e,w=()=>{switch(x){case"full":return{additionalInstructions:e.additionalInstructions,onAdditionalInstructionsChange:e.onAdditionalInstructionsChange,displayPriceInstructions:e.displayPriceInstructions,displayMovementInstructions:e.displayMovementInstructions};case"trigger":return{additionalInstructions:"",onAdditionalInstructionsChange:()=>{},displayPriceInstructions:void 0,displayMovementInstructions:void 0};default:return Ft(x)}},{additionalInstructions:S,onAdditionalInstructionsChange:C,displayPriceInstructions:E,displayMovementInstructions:N}=w(),{isMobileUserAgent:k}=Re(),{$t:I,locale:M}=J(),[A,D]=d.useState(!1),[P,F]=d.useState(0),[R,j]=d.useState(""),[L,U]=d.useState([]),O=d.useRef(null),$=Xt(),G=d.useRef(R);G.current=R,d.useEffect(()=>{j(y??"")},[y]),d.useEffect(()=>{if(b&&i){const _e=Qv(b.toUpperCase(),M);if(/^\d+(\.\d+)?$/.test(i)){c(_e+i);return}const De=i.replace(/[^0-9.]/g,"");i.replace(/[0-9.]/g,"").trim()!==_e&&De&&c(_e+De)}},[b,M,i,c]);const H=d.useMemo(()=>[{label:I({id:"xPMPP84OOV",defaultMessage:"Target Price"}),value:"price"},{label:I({id:"24152tl1L3",defaultMessage:"Movement Amount"}),value:"movement"}].map(ke=>({label:ke.label,value:ke.value,children:l.jsx("div",{className:"w-full flex-1",children:l.jsx(jA,{label:ke.label,isActiveOption:n===ke.value})})})),[n,I]),Q=d.useCallback(async _e=>{const De=(await $.fetchQuery({queryKey:be.makeEphemeralQueryKey("finance-tasks-autosuggest",_e),queryFn:()=>JWe({query:_e,reason:"finance-add-alert"}),staleTime:0})).map(Ce=>({query:Ce.title??"",title:Ce.title??"",image:Ce.image??"",imageDark:Ce.image_dark??"",description:Ce.description??"",identifier:Ce.query??""}));U(De)},[$]),Y=Ef(Q,100,{leading:!0,trailing:!0}),te=d.useCallback(_e=>{Y(_e)},[Y]),se=d.useCallback(()=>{D(!0),F(-1),te(G.current)},[te]),ae=d.useCallback(()=>{D(!1)},[]),X=d.useCallback(_e=>{const ke=_e;j(ke),te(ke),ke.trim()===""&&(r(null),c(""),f(""))},[te,r,c,f]),ee=d.useCallback(_e=>{r(_e.identifier??null),j(_e.title??""),D(!1),O.current?.blur()},[r]),le=MX({userInputQuery:R,suggestionsDisabled:!A||L.length===0,suggestions:L,focusedIndex:P,setFocusedIndex:F,onChange:_e=>{j(_e)},handleSuggestionSubmission:ee,inputRef:O}),re=d.useCallback(_e=>{s(_e)},[s]),ce=d.useCallback(_e=>{C?.(_e)},[C]),ue=z("h-10 rounded-md dark:border-0 dark:border-transparent dark:bg-subtle p-4 dark:[&:focus]:ring-0",{"rounded-t-md rounded-b-none":A&&L.length>0}),pe=d.useMemo(()=>({image:_e,imageDark:ke,alt:De})=>l.jsx($6,{image:_e,imageDark:ke,alt:De,watchlistType:"FINANCE",className:"bg-subtler mr-sm !size-8 rounded",imageClassName:"inset-xs"}),[]),xe=({onClear:_e})=>l.jsx(rt,{icon:B("x"),size:"tiny",pill:!0,onClick:_e}),he=d.useMemo(()=>({RightIconComponent:()=>null,LeftIconComponent:pe}),[pe]);return l.jsxs("div",{className:"flex flex-col gap-3",children:[o&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(Ne,{defaultMessage:"Find a stock, token, or fund...",id:"DTOgClV6qi"})}),l.jsx($A,{isOpen:A&&L.length>0,suggestedQueries:L,focusedIndex:P,setFocusedIndex:F,handlePasteQuery:Ro,handleSubmit:ee,value:R,components:he,dropdownClassName:"dark:border-none dark:ml-0 dark:mr-0 dark:w-full",dropdownType:"select",popoverClassName:"dark:!border-none",children:l.jsx(co,{autoFocus:!t,onFocus:se,onBlur:ae,onKeyDown:le,className:ue,ref:O,isMobileUserAgent:k,placeholder:I({defaultMessage:"Search for any asset",id:"BeYic/1TvC"}),value:R,onChange:X,ClearIcon:xe,colorVariant:v})})]}),l.jsxs("div",{className:z("flex flex-col gap-3 sm:flex-row",!_&&"pointer-events-none opacity-50"),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(Ne,{defaultMessage:"Alert criteria",id:"h44KqVtM6/"})}),l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:l.jsx(DA,{layoutKey:"task",options:H,value:n,onValueChange:re,className:"p-three inline-flex",variant:v})})]}),l.jsxs("div",{className:"gap-md flex flex-col",children:[n==="price"&&l.jsx(rGe,{currentPrice:a,value:i,onChange:c,variant:v,currency:b}),n==="movement"&&l.jsx(sGe,{value:u,onChange:f,positiveSelected:m,onPositiveChange:p,negativeSelected:h,onNegativeChange:g,variant:v})]})]}),x==="full"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"smallBold",color:"light",className:"flex shrink-0 items-center",children:I({id:"qax5d8pQCh",defaultMessage:"Default Query"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(V,{variant:"small",color:"light",className:"pl-sm border-subtlest border-l-2",children:n==="price"?E:N})})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"smallBold",color:"light",className:"flex shrink-0 items-center",children:I({id:"QFuOkrgHHJ",defaultMessage:"Additional Instructions (optional)"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(yu,{value:S,onChange:ce,isMobileUserAgent:k,isMobileStyle:!1,minRows:3,placeholder:I({id:"DtwY5RHKrT",defaultMessage:"Check news and social media sentiment to assess consensus or controversy"})})})]})]})]})});q6.displayName="FinanceAlertForm";const Bne=d.memo(({trigger:e,onTriggerChange:t,isEditing:n,defaultTargetPriceValue:r})=>{const{formState:s,onSymbolChange:o,onOptionChange:a,onPriceValueChange:i,onPercentValueChange:c,onPositiveChange:u,onNegativeChange:f}=ZWe({trigger:e,onTriggerChange:t}),m=d.useCallback(x=>r||(x.price?oGe(x.price):""),[r]),p=d.useCallback(x=>{switch(s.selectedOption){case"price":{if(x&&!s.priceValue){const v=m(x);v&&i(v)}break}case"movement":break;default:Ft(s.selectedOption)}},[s.priceValue,s.selectedOption,m,i]),{data:h}=Zv({symbol:s.selectedSymbol,onInitialSuccess:p}),g=d.useCallback(x=>{let v="";switch(x){case"price":{v=s.priceValue,h&&(v=m(h));break}case"movement":break;default:Ft(x)}a(x,v)},[s.priceValue,m,a,h]),y=!!e.symbol&&e.symbol.trim()!=="";return l.jsx("div",{children:l.jsx(q6,{variant:"trigger",externalInputValue:s.selectedSymbol??void 0,selectedSymbol:s.selectedSymbol,selectedOption:s.selectedOption,onSymbolChange:o,onOptionChange:g,showSymbolInput:!n,currentPrice:h?.price,priceValue:s.priceValue,onPriceValueChange:i,percentValue:s.percentValue,onPercentValueChange:c,positiveSelected:s.positiveSelected,onPositiveChange:u,negativeSelected:s.negativeSelected,onNegativeChange:f,colorVariant:"subtle",currency:h?.currency??void 0,isAssetSelected:y})})});Bne.displayName="PriceAlertTriggerConfiguration";function oGe(e){return(e*(1+parseInt(Xv,10)/100)).toFixed(2)}const XE=d.memo(({trigger:e,onTriggerChange:t})=>{const n=d.useMemo(()=>e?.schedule??Gr(),[e?.schedule]),r=d.useCallback(s=>{t({type:Xe.SCHEDULED,...e,schedule:{...n,...s}})},[t,n,e]);return l.jsx(G6,{schedule:n,onScheduleChange:r,variant:"subtle"})});XE.displayName="ScheduledAutomationTriggerConfiguration";const Une=d.memo(()=>l.jsx("div",{children:"Shortcut Trigger Configuration"}));Une.displayName="ShortcutTriggerAutomationConfiguration";const Vne=d.memo(({trigger:e,onTriggerChange:t,isEditing:n=!1,defaultTargetPriceValue:r})=>{if(!e)return l.jsx(XE,{trigger:null,onTriggerChange:t});switch(e.type){case Xe.SCHEDULED:return l.jsx(XE,{trigger:e,onTriggerChange:t});case Xe.PRICE_ALERT:return l.jsx(Bne,{trigger:e,onTriggerChange:t,isEditing:n,defaultTargetPriceValue:r});case Xe.SHORTCUT:return l.jsx(Une,{});default:Ft(e)}});Vne.displayName="AutomationTriggerConfiguration";const aGe={tiny:"tiny",small:"tiny",default:"tiny",large:"small"},iGe={tiny:"text-xs",small:"text-sm",default:"text-sm",large:"text-base"},lGe=e=>{const t=wx(e);return z(t,"justify-between")},cGe=()=>"ml-1 shrink-0 text-quiet";function uGe({ref:e,children:t,"aria-expanded":n,"aria-haspopup":r="listbox","aria-controls":s,size:o="default",disabled:a=!1,onClick:i,leadingAccessory:c,...u}){const f=_x(e),m=wa(u),p=aGe[o],h=iGe[o],g=d.useMemo(()=>z("font-normal",h,"text-box-trim-both","truncate",{"pl-1":c,"pr-1":!0,"min-w-0":!0}),[c,h]);return l.jsxs(jo,{ref:f,...m,disabled:a,className:lGe({variant:"tonal",size:o,disabled:a,fullWidth:!0}),onClick:i,"aria-expanded":n,"aria-haspopup":r,"aria-controls":s,children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[c&&l.jsx("div",{className:"mr-1 shrink-0",children:a2(c)?l.jsx(Jt,{icon:c,size:o}):c}),l.jsx("span",{className:g,children:t})]}),l.jsx("div",{className:cGe(),children:l.jsx(Jt,{icon:B("chevron-down"),size:p})})]})}const dGe=50;function fGe({reason:e,limit:t=dGe}){const n=WU({queryKey:be.makeQueryKey(oy),queryFn:({pageParam:s=0})=>XDe({limit:t,offset:s,reason:e}),getNextPageParam:(s,o)=>{if(s.has_next_page)return o.length*t},initialPageParam:0}),r=d.useMemo(()=>n.data?.pages?.flatMap(s=>s.spaces)??[],[n.data]);return{...n,spaces:r}}const K6=d.memo(({emoji:e,size:t="md"})=>l.jsx(V,{variant:t==="lg"?"section-title":"base",className:z("flex items-center justify-center",{"size-5":t==="lg","size-4":t==="md"}),children:e}));K6.displayName="EmojiIcon";const Hne=d.memo(({space:e,isSelected:t,onSelect:n})=>{const r=sT(e.emoji),s=d.useMemo(()=>r?()=>l.jsx(K6,{emoji:r}):Zh,[r]);return l.jsx(_t.Item,{leadingAccessory:s,trailingAccessory:t?l.jsx(Jt,{icon:B("check"),size:"default"}):void 0,onSelect:()=>n(e.uuid),children:e.title})});Hne.displayName="SpaceMenuItem";const zne=d.memo(({selectedSpaceUuid:e,onSpaceChange:t,disabled:n=!1})=>{const{$t:r}=J(),{openToast:s}=pn(),[o,a]=d.useState(!1),{spaces:i,isLoading:c,isError:u}=fGe({reason:"automation-modal-space-selector"}),f=d.useCallback(g=>{n||c||u||a(g)},[n,c,u]);d.useEffect(()=>{u&&s({message:r({defaultMessage:"Failed to load spaces",id:"+uuI8WqZfv"}),variant:"error",timeout:null})},[u,r,s]);const m=i.find(g=>g.uuid===e),p=m?sT(m.emoji):null,h=d.useMemo(()=>p?()=>l.jsx(K6,{emoji:p,size:"lg"}):Zh,[p]);return!c&&!u&&i.length===0?null:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(Ne,{defaultMessage:"Space",id:"0ah2udCSKF"})}),l.jsx(_t,{isOpen:o,onToggle:f,triggerElement:l.jsx(uGe,{size:"default",disabled:n||c||u,leadingAccessory:h,children:m?m.title:l.jsx(Ne,{defaultMessage:"None Selected",id:"HeX7TW9V+Q"})}),children:l.jsxs("div",{className:"max-h-[38vh] overflow-y-auto",children:[e&&l.jsx(_t.Item,{leadingAccessory:B("x"),onSelect:()=>t(null),children:l.jsx(Ne,{defaultMessage:"Clear Selection",id:"WbPFiMz647"})}),i.map(g=>l.jsx(Hne,{space:g,isSelected:g.uuid===e,onSelect:t},g.uuid))]})})]})});zne.displayName="SpaceSelector";const mGe=(e,t)=>{const{value:n,loading:r}=qt({flag:"tasks-in-spaces",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},pGe=(e,t)=>{const{value:n,loading:r}=qt({flag:"tasks-notification-settings-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Pw=new Date,Ow=new Date;function Nr(e,t,n,r){function s(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(e(o=new Date(+o)),o),s.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),s.round=o=>{const a=s(o),i=s.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),s.range=(o,a,i)=>{const c=[];if(o=s.ceil(o),i=i==null?1:Math.floor(i),!(o0))return c;let u;do c.push(u=new Date(+o)),t(o,i),e(o);while(uNr(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,i)=>{if(a>=a)if(i<0)for(;++i<=0;)for(;t(a,-1),!o(a););else for(;--i>=0;)for(;t(a,1),!o(a););}),n&&(s.count=(o,a)=>(Pw.setTime(+o),Ow.setTime(+a),e(Pw),e(Ow),Math.floor(n(Pw,Ow))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(r?a=>r(a)%o===0:a=>s.count(0,a)%o===0):s)),s}const D2=Nr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);D2.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Nr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):D2);D2.range;const ji=1e3,ko=ji*60,Ii=ko*60,Ki=Ii*24,Y6=Ki*7,gP=Ki*30,Lw=Ki*365,Pi=Nr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCSeconds());Pi.range;const eb=Nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ji)},(e,t)=>{e.setTime(+e+t*ko)},(e,t)=>(t-e)/ko,e=>e.getMinutes());eb.range;const tb=Nr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ko)},(e,t)=>(t-e)/ko,e=>e.getUTCMinutes());tb.range;const nb=Nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ji-e.getMinutes()*ko)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getHours());nb.range;const rb=Nr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getUTCHours());rb.range;const rm=Nr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ko)/Ki,e=>e.getDate()-1);rm.range;const Fg=Nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>e.getUTCDate()-1);Fg.range;const Wne=Nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>Math.floor(e/Ki));Wne.range;function vu(e){return Nr(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())*ko)/Y6)}const Bg=vu(0),j2=vu(1),hGe=vu(2),gGe=vu(3),cf=vu(4),yGe=vu(5),xGe=vu(6);Bg.range;j2.range;hGe.range;gGe.range;cf.range;yGe.range;xGe.range;function bu(e){return Nr(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)/Y6)}const Ug=bu(0),I2=bu(1),vGe=bu(2),bGe=bu(3),uf=bu(4),_Ge=bu(5),wGe=bu(6);Ug.range;I2.range;vGe.range;bGe.range;uf.range;_Ge.range;wGe.range;const Vg=Nr(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());Vg.range;const sb=Nr(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());sb.range;const ba=Nr(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());ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Nr(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)});ba.range;const si=Nr(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:Nr(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 Op(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function CGe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Hg(e){let t,n,r;e.length!==2?(t=Op,n=(i,c)=>Op(e(i),c),r=(i,c)=>e(i)-c):(t=e===Op||e===CGe?e:SGe,n=e,r=e);function s(i,c,u=0,f=i.length){if(u>>1;n(i[m],c)<0?u=m+1:f=m}while(u>>1;n(i[m],c)<=0?u=m+1:f=m}while(uu&&r(i[m-1],c)>-r(i[m],c)?m-1:m}return{left:s,center:a,right:o}}function SGe(){return 0}function Gne(e){return e===null?NaN:+e}const EGe=Hg(Op),sm=EGe.right;Hg(Gne).center;function Mo(e,t){let n,r;if(t===void 0)for(const s of e)s!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r=o&&(n=r=o):(n>o&&(n=o),r0)return[e];if((r=t0){let c=Math.round(e/i),u=Math.round(t/i);for(c*it&&--u,a=new Array(o=u-c+1);++st&&--u,a=new Array(o=u-c+1);++s=0?(o>=ZE?10:o>=JE?5:o>=ek?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(o>=ZE?10:o>=JE?5:o>=ek?2:1)}function nk(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/s;return o>=ZE?s*=10:o>=JE?s*=5:o>=ek&&(s*=2),t=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,o=Math.floor(s),a=+n(e[o],o,e),i=+n(e[o+1],o+1,e);return a+(i-a)*(s-o)}}function NGe(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,o=new Array(s);++rx).right(a,p);if(h===a.length)return e.every(nk(u/Lw,f/Lw,m));if(h===0)return D2.every(Math.max(nk(u,f,m),1));const[g,y]=a[p/a[h-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(ue=Bw(Om(re.y,0,1)),pe=ue.getUTCDay(),ue=pe>4||pe===0?I2.ceil(ue):I2(ue),ue=Fg.offset(ue,(re.V-1)*7),re.y=ue.getUTCFullYear(),re.m=ue.getUTCMonth(),re.d=ue.getUTCDate()+(re.w+6)%7):(ue=Fw(Om(re.y,0,1)),pe=ue.getDay(),ue=pe>4||pe===0?j2.ceil(ue):j2(ue),ue=rm.offset(ue,(re.V-1)*7),re.y=ue.getFullYear(),re.m=ue.getMonth(),re.d=ue.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),pe="Z"in re?Bw(Om(re.y,0,1)).getUTCDay():Fw(Om(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(pe+5)%7:re.w+re.U*7-(pe+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,Bw(re)):Fw(re)}}function N(X,ee,le,re){for(var ce=0,ue=ee.length,pe=le.length,xe,he;ce=pe)return-1;if(xe=ee.charCodeAt(ce++),xe===37){if(xe=ee.charAt(ce++),he=S[xe in vP?ee.charAt(ce++):xe],!he||(re=he(X,le,re))<0)return-1}else if(xe!=le.charCodeAt(re++))return-1}return re}function k(X,ee,le){var re=u.exec(ee.slice(le));return re?(X.p=f.get(re[0].toLowerCase()),le+re[0].length):-1}function I(X,ee,le){var re=h.exec(ee.slice(le));return re?(X.w=g.get(re[0].toLowerCase()),le+re[0].length):-1}function M(X,ee,le){var re=m.exec(ee.slice(le));return re?(X.w=p.get(re[0].toLowerCase()),le+re[0].length):-1}function A(X,ee,le){var re=v.exec(ee.slice(le));return re?(X.m=b.get(re[0].toLowerCase()),le+re[0].length):-1}function D(X,ee,le){var re=y.exec(ee.slice(le));return re?(X.m=x.get(re[0].toLowerCase()),le+re[0].length):-1}function P(X,ee,le){return N(X,t,ee,le)}function F(X,ee,le){return N(X,n,ee,le)}function R(X,ee,le){return N(X,r,ee,le)}function j(X){return a[X.getDay()]}function L(X){return o[X.getDay()]}function U(X){return c[X.getMonth()]}function O(X){return i[X.getMonth()]}function $(X){return s[+(X.getHours()>=12)]}function G(X){return 1+~~(X.getMonth()/3)}function H(X){return a[X.getUTCDay()]}function Q(X){return o[X.getUTCDay()]}function Y(X){return c[X.getUTCMonth()]}function te(X){return i[X.getUTCMonth()]}function se(X){return s[+(X.getUTCHours()>=12)]}function ae(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var ee=C(X+="",_);return ee.toString=function(){return X},ee},parse:function(X){var ee=E(X+="",!1);return ee.toString=function(){return X},ee},utcFormat:function(X){var ee=C(X+="",w);return ee.toString=function(){return X},ee},utcParse:function(X){var ee=E(X+="",!0);return ee.toString=function(){return X},ee}}}var vP={"-":"",_:" ",0:"0"},zr=/^\s*\d+/,OGe=/^%/,LGe=/[\\^$*+?|[\]().{}]/g;function dn(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",o=s.length;return r+(o[t.toLowerCase(),n]))}function BGe(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function UGe(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function VGe(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function HGe(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function zGe(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function bP(e,t,n){var r=zr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function _P(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function WGe(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 GGe(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $Ge(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function wP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function qGe(e,t,n){var r=zr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function CP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function KGe(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function YGe(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function QGe(e,t,n){var r=zr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function XGe(e,t,n){var r=zr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ZGe(e,t,n){var r=OGe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function JGe(e,t,n){var r=zr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function e$e(e,t,n){var r=zr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function SP(e,t){return dn(e.getDate(),t,2)}function t$e(e,t){return dn(e.getHours(),t,2)}function n$e(e,t){return dn(e.getHours()%12||12,t,2)}function r$e(e,t){return dn(1+rm.count(ba(e),e),t,3)}function Kne(e,t){return dn(e.getMilliseconds(),t,3)}function s$e(e,t){return Kne(e,t)+"000"}function o$e(e,t){return dn(e.getMonth()+1,t,2)}function a$e(e,t){return dn(e.getMinutes(),t,2)}function i$e(e,t){return dn(e.getSeconds(),t,2)}function l$e(e){var t=e.getDay();return t===0?7:t}function c$e(e,t){return dn(Bg.count(ba(e)-1,e),t,2)}function Yne(e){var t=e.getDay();return t>=4||t===0?cf(e):cf.ceil(e)}function u$e(e,t){return e=Yne(e),dn(cf.count(ba(e),e)+(ba(e).getDay()===4),t,2)}function d$e(e){return e.getDay()}function f$e(e,t){return dn(j2.count(ba(e)-1,e),t,2)}function m$e(e,t){return dn(e.getFullYear()%100,t,2)}function p$e(e,t){return e=Yne(e),dn(e.getFullYear()%100,t,2)}function h$e(e,t){return dn(e.getFullYear()%1e4,t,4)}function g$e(e,t){var n=e.getDay();return e=n>=4||n===0?cf(e):cf.ceil(e),dn(e.getFullYear()%1e4,t,4)}function y$e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dn(t/60|0,"0",2)+dn(t%60,"0",2)}function EP(e,t){return dn(e.getUTCDate(),t,2)}function x$e(e,t){return dn(e.getUTCHours(),t,2)}function v$e(e,t){return dn(e.getUTCHours()%12||12,t,2)}function b$e(e,t){return dn(1+Fg.count(si(e),e),t,3)}function Qne(e,t){return dn(e.getUTCMilliseconds(),t,3)}function _$e(e,t){return Qne(e,t)+"000"}function w$e(e,t){return dn(e.getUTCMonth()+1,t,2)}function C$e(e,t){return dn(e.getUTCMinutes(),t,2)}function S$e(e,t){return dn(e.getUTCSeconds(),t,2)}function E$e(e){var t=e.getUTCDay();return t===0?7:t}function k$e(e,t){return dn(Ug.count(si(e)-1,e),t,2)}function Xne(e){var t=e.getUTCDay();return t>=4||t===0?uf(e):uf.ceil(e)}function M$e(e,t){return e=Xne(e),dn(uf.count(si(e),e)+(si(e).getUTCDay()===4),t,2)}function T$e(e){return e.getUTCDay()}function A$e(e,t){return dn(I2.count(si(e)-1,e),t,2)}function N$e(e,t){return dn(e.getUTCFullYear()%100,t,2)}function R$e(e,t){return e=Xne(e),dn(e.getUTCFullYear()%100,t,2)}function D$e(e,t){return dn(e.getUTCFullYear()%1e4,t,4)}function j$e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?uf(e):uf.ceil(e),dn(e.getUTCFullYear()%1e4,t,4)}function I$e(){return"+0000"}function kP(){return"%"}function MP(e){return+e}function TP(e){return Math.floor(+e/1e3)}var Vu,zg,Zne;P$e({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 P$e(e){return Vu=PGe(e),zg=Vu.format,Vu.parse,Zne=Vu.utcFormat,Vu.utcParse,Vu}const O$e=zg("%b %d"),L$e=zg("%b"),F$e=zg("%Y");function B$e(e){return e?(e=new Date(e),(Vg(e){if(!e&&(e!==0||!n?.renderZero))return"";const s=t&&/^[A-Z]{3}$/.test(t)?t:void 0,o=e%1===0&&!n?.alwaysShowMinor||n?.roundToMajor?0:2;let a=n?.roundToMajor?0:2;if(e>0&&e<1){const c=Math.abs(e).toExponential();a=Math.abs(parseInt(c.split("e")[1]))+1}const i=Intl.NumberFormat(void 0,{style:s?"currency":"decimal",currency:s,minimumFractionDigits:1,maximumFractionDigits:1,currencyDisplay:n?.currencyDisplay??"narrowSymbol"});return n?.truncate&&e>=1e6?`${i.format(e/1e6)}M`:n?.truncate&&e>=1e3?`${i.format(e/1e3)}k`:e.toLocaleString(void 0,{style:s?"currency":"decimal",currency:s,minimumFractionDigits:o,maximumFractionDigits:a,currencyDisplay:n?.currencyDisplay??"narrowSymbol"})},ob=d.memo(({configuration:e,onConfigurationChange:t,errorMessage:n,onError:r,canEditSpace:s})=>{const o=!!e.id,a=d.useCallback(y=>{let x=e.query;switch(y.type){case Xe.PRICE_ALERT:{x={...e.query,prompt:e.query.prompt};break}case Xe.SCHEDULED:case Xe.SHORTCUT:break;default:Ft(y)}const v={...e,trigger:y,query:x};r?.(null),t(v)},[e,t,r]),i=d.useCallback(y=>{const x={...e,query:y};t(x)},[e,t]),c=d.useCallback(y=>{const x={...e,collectionUuid:y};t(x)},[e,t]),u=d.useCallback(y=>{const x={...e,notificationSettings:y};t(x)},[e,t]),{variation:f,loading:m}=pGe(!0),{variation:p,loading:h}=mGe(!1),g=e.trigger.type===Xe.PRICE_ALERT&&(!e.trigger.symbol||e.trigger.symbol.trim()==="");return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Lne,{trigger:e.trigger,query:e.query,onQueryChange:i}),!h&&p&&e.trigger.type===Xe.SCHEDULED&&l.jsx(zne,{selectedSpaceUuid:e.collectionUuid,onSpaceChange:c,disabled:!s}),l.jsx(Vne,{trigger:e.trigger,onTriggerChange:a,isEditing:o,defaultTargetPriceValue:e.defaultTargetPriceValue}),l.jsx(Rne,{trigger:e.trigger,onTriggerChange:a}),!m&&f&&l.jsx(Dne,{notificationSettings:e.notificationSettings??Ql,onNotificationSettingsChange:u,disabled:g}),e.trigger.type===Xe.PRICE_ALERT&&l.jsx("div",{className:"flex flex-col gap-2",children:l.jsx(Jv,{trigger:e.trigger,prompt:e.query.prompt,onPromptChange:y=>i({...e.query,prompt:y}),variant:"subtle",disabled:g})}),l.jsx(Tne,{trigger:e.trigger,query:e.query,onQueryChange:i}),n&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:n})]})]})});ob.displayName="AutomationConfiguration";function U$e(e,t,n,r){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,schedule:yp(e.schedule),task_name:"",expiry_date:TH(e.expiryDate??e.defaultExpiryDate),notification_settings:n,collection_uuid:r??void 0}}function V$e(e,t){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,task_name:e.shortcut,schedule:{rrule:"",start_at:"",tzid:""}}}function Jne({trigger:e,query:t,quote:n}){const{symbol:r}=e,s=n?.name?` (${n.name})`:void 0;switch(e.alertType){case pr.TARGET_PRICE:{const o=n?.price||0,a=Fv({symbol:r,quoteName:s}),i=e.price>o?"above":"below",c=pI({rawInstructions:a,symbol:r,quoteName:s||"",eventValue:`$${e.price}`,direction:i}),u=mI({prompt:t.prompt,baseInstructions:c});return SE({symbol:r,alertType:"price",priceValue:`$${e.price}`,priceThreshold:i,baseInstructions:c,additionalInstructions:u})}case pr.MOVEMENT_AMOUNT:{const o=Bv({symbol:r,quoteName:s}),a=e.percentageDecimalUpperBound>0&&e.percentageDecimalUpperBound!==Vl/100,i=e.percentageDecimalLowerBound<0&&e.percentageDecimalLowerBound!==Hl/100;let c,u;a&&i?(c=(e.percentageDecimalUpperBound*100).toFixed(2),u="increase or decrease"):a?(c=(e.percentageDecimalUpperBound*100).toFixed(2),u="increase"):i?(c=(Math.abs(e.percentageDecimalLowerBound)*100).toFixed(2),u="decrease"):(c="0.00",u="change");const f=pI({rawInstructions:o,symbol:r,quoteName:s||"",eventValue:c,direction:u}),m=mI({prompt:t.prompt,baseInstructions:f});return SE({symbol:r,alertType:"movement",percentValue:c,positiveSelected:a,negativeSelected:i,baseInstructions:f,additionalInstructions:m})}default:Ft(e)}}function H$e(e,t,n,r,s){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,status:n==="COMPLETED"?"PAUSED":n,schedule:yp(e.schedule),expiry_date:TH(e.expiryDate??e.defaultExpiryDate),clear_expiry:e.expiryDate===null?!0:void 0,notification_settings:r,collection_uuid:s===null?void 0:s,clear_collection_uuid:s===null?!0:void 0}}function z$e(e,t,n){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,status:n==="COMPLETED"?"PAUSED":n,task_name:e.shortcut}}function W$e({trigger:e,query:t,status:n,quote:r}){const s=Jne({trigger:e,query:t,quote:r});return s?{task_name:s.task_name,prompt:s.prompt,event_subscription:s.event_subscription,model_preference:s.model_preference,status:n==="COMPLETED"?"PAUSED":n}:null}function ere({onCreateSuccess:e,onCreateError:t,onUpdateSuccess:n,onUpdateError:r,onDeleteSuccess:s,onDeleteError:o}={}){const{$t:a}=J(),i=Xt(),c=It({mutationFn:p=>U9e({payload:p,reason:"finance-add-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:xp()}),e?.()},onError:p=>t?.(p)}),u=It({mutationFn:({taskId:p,payload:h})=>V9e({taskId:p,payload:h,reason:"finance-edit-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:xp()}),n?.()},onError:p=>{if(p instanceof Error)switch(p.name){case"TimeoutError":r?.({detail:a({defaultMessage:"Network Timeout",id:"Z+mLGQc4GD"})});break;default:Z.error(`Unknown error occured: ${p.name}`),r?.({detail:a({defaultMessage:"Unknown error occurred",id:"y1q3uzCFY6"})})}else r?.(p)}}),f=It({mutationFn:p=>EX({taskId:p,reason:"finance-delete-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:xp()}),s?.()},onError:()=>o?.()}),m=c.isPending||u.isPending||f.isPending;return d.useMemo(()=>({createMutation:c,updateMutation:u,deleteMutation:f,isMutationLoading:m}),[c,u,f,m])}const G$e=()=>{const{formatMessage:e}=J();return{getErrorMessage:n=>{switch(n?.detail?.error_code){case Vj.TASK_LIMIT_EXCEEDED:return e({defaultMessage:"You have reached the maximum of number of active tasks of this type for your subscription level.",id:"3H43PMJpfD"});case Vj.SHORTCUT_NAME_ALREADY_EXISTS:return e({defaultMessage:"A shortcut with this name already exists. Please choose a different name.",id:"GpnXJDWEkN"});default:return e({defaultMessage:"Something went wrong. Please try again.",id:"W/5hwrn09m"})}}}},$$e={settings_create:!0,settings_edit:!0,settings_suggest:!0,settings_primer:!0,task_widget:!0,discover_task_widget:!0,thread_dropdown:!0,typeahead_create:!0,notifications_panel:!0,router:!0,space_tasks_create:!0,space_tasks_edit:!0,study_hub_spaced_repetition:!0};function sk(e){return e in $$e}const q$e={settings_create:!0,settings_edit:!0,settings_suggest:!0,finance_home_page:!0,finance_asset_page:!0};function AP(e){return e in q$e}const K$e={settings_create:!0,settings_edit:!0,typeahead_create:!0,thread_create:!0,suggestions_dropdown:!0,notifications_panel:!0,typeahead_edit:!0,shortcut_widget:!0,settings_paste:!0,try_assistant_suggestions:!0,thread_upsell_create:!0};function NP(e){return e in K$e}const Y$e={created:!0,updated:!0,deleted:!0,paused:!0,resumed:!0,skipped:!0};function tre(e){return e in Y$e}const Q$e={created:!0,updated:!0,deleted:!0,paused:!0,resumed:!0,skipped:!0};function X$e(e){return e in Q$e}const Z$e={created:!0,updated:!0,deleted:!0,copied:!0,skipped:!0};function J$e(e){return e in Z$e}function nre({reason:e,source:t,onSuccess:n,onError:r}){const s=Xt(),{session:o}=je(),{trackEvent:a}=Ke(o),{getErrorMessage:i}=G$e(),c=d.useCallback((y,x)=>{s.invalidateQueries({queryKey:xp()}),s.invalidateQueries({queryKey:Tye()}),x&&s.invalidateQueries({queryKey:NH(x)}),n?.(y)},[s,n]),u=d.useCallback((y,x)=>{sk(t)&&tre(y)&&a("task modal action",{source:t,action:y}),c(y,x)},[t,a,c]),f=It({mutationFn:y=>B9e({payload:y,reason:e}),onSuccess:y=>u("created",y.task_id),onError:y=>r(i(y))}),m=It({mutationFn:({id:y,payload:x})=>Hj({taskId:y,payload:x,reason:e}),onSuccess:y=>u("updated",y.task.task_id),onError:y=>r(i(y))}),p=It({mutationFn:({id:y,newStatus:x})=>Hj({taskId:y,payload:{status:x},reason:e}),onSuccess:y=>{u(y.task.status==="PAUSED"?"paused":"resumed",y.task.task_id)},onError:y=>r(i(y))}),h=It({mutationFn:y=>EX({taskId:y,reason:e}),onSuccess:()=>u("deleted"),onError:y=>r(i(y))}),g=f.isPending||m.isPending||p.isPending||h.isPending;return{createMutation:f,updateMutation:m,toggleMutation:p,deleteMutation:h,isMutationLoading:g,invalidateAndClose:c}}function eqe({initialConfiguration:e,isModalOpened:t,reason:n,source:r,onSuccess:s,onError:o}){const{$t:a}=J(),{hasActiveSubscription:i}=Bt(),[c,u]=d.useState(v4(e??x4(i))),f=d.useCallback(N=>{u(N)},[]),m=(()=>{switch(c.trigger.type){case Xe.PRICE_ALERT:return c.trigger.symbol;case Xe.SCHEDULED:case Xe.SHORTCUT:return null;default:Ft(c.trigger)}})(),{data:p,isLoading:h}=Zv({symbol:m,enabled:!!m&&t}),g=nre({reason:n,source:r,onSuccess:s,onError:o}),y=ere({onCreateSuccess:()=>s("created"),onCreateError:N=>o(`Failed to create price alert - ${N.detail}`),onUpdateSuccess:()=>s("updated"),onUpdateError:N=>o(`Failed to update price alert - ${N.detail}`),onDeleteSuccess:()=>s("deleted"),onDeleteError:()=>o("Failed to delete price alert")}),x=h||g.isMutationLoading||y.isMutationLoading,v=d.useCallback(N=>{const k=N?{...c,...N}:c;if(k.id)switch(k.trigger.type){case Xe.SCHEDULED:g.updateMutation.mutate({id:k.id,payload:H$e(k.trigger,k.query,k.status,k.notificationSettings,k.collectionUuid)});break;case Xe.PRICE_ALERT:{const I=W$e({trigger:k.trigger,query:k.query,status:k.status,quote:p});I?y.updateMutation.mutate({taskId:k.id,payload:I}):o(a({defaultMessage:"Failed to update price alert payload - Missing inputs",id:"293dgMfZdE"}));break}case Xe.SHORTCUT:g.updateMutation.mutate({id:k.id,payload:z$e(k.trigger,k.query,k.status)});break;default:Ft(k.trigger)}else switch(k.trigger.type){case Xe.SCHEDULED:g.createMutation.mutate(U$e(k.trigger,k.query,k.notificationSettings??Ql,k.collectionUuid));break;case Xe.PRICE_ALERT:{const I=Jne({trigger:k.trigger,query:k.query,quote:p});I?y.createMutation.mutate(I):o(a({defaultMessage:"Failed to create price alert payload - Missing inputs",id:"Fimh9vZMY/"}));break}case Xe.SHORTCUT:g.createMutation.mutate(V$e(k.trigger,k.query));break;default:Ft(k.trigger)}},[c,g.updateMutation,g.createMutation,p,y.updateMutation,y.createMutation,o,a]),b=d.useCallback(()=>{v()},[v]),_=d.useCallback(N=>{if(!c.id)return;v({status:N?"ACTIVE":"PAUSED"})},[c.id,v]),w=d.useCallback(()=>{if(c.id)switch(c.trigger.type){case Xe.SCHEDULED:g.deleteMutation.mutate(c.id);break;case Xe.PRICE_ALERT:y.deleteMutation.mutate(c.id);break;case Xe.SHORTCUT:g.deleteMutation.mutate(c.id);break;default:Ft(c.trigger)}},[c.id,c.trigger,y.deleteMutation,g.deleteMutation]),S=rre({isLoading:x,currentConfiguration:c}),C=d.useMemo(()=>{switch(c.trigger.type){case Xe.SCHEDULED:case Xe.SHORTCUT:return;case Xe.PRICE_ALERT:return S?a({defaultMessage:"Select stock, token or fund to begin",id:"x/nyvvB4aQ"}):void 0;default:Ft(c.trigger)}},[a,c.trigger,S]),E=c.status==="ACTIVE";return{currentConfiguration:c,setCurrentConfiguration:f,onClickSave:b,onClickToggle:_,onClickDelete:w,isEnabled:E,isLoading:x,isSaveDisabled:S,saveButtonTooltipText:C}}function rre({isLoading:e,currentConfiguration:t}){if(e)return!0;switch(t.trigger.type){case Xe.SCHEDULED:case Xe.SHORTCUT:return!t.query.prompt;case Xe.PRICE_ALERT:{const n=t.trigger;if(!n.symbol||n.symbol.trim()==="")return!0;switch(n.alertType){case pr.TARGET_PRICE:if(!n.price||n.price<=0)return!0;break;case pr.MOVEMENT_AMOUNT:{const r=n.percentageDecimalLowerBound!==Hl/100&&n.percentageDecimalLowerBound!==0;if(!(n.percentageDecimalUpperBound!==Vl/100&&n.percentageDecimalUpperBound!==0)&&!r)return!0;break}default:Ft(n)}break}default:Ft(t.trigger)}return!1}const sre=({onSkip:e,onConfirm:t,disabled:n=!1,isLoading:r=!1,result:s=null,buttonText:o,loadingText:a})=>{const{$t:i}=J();return s!==null?l.jsx(K,{className:"bg-base border-t pt-4",children:l.jsx("div",{className:"text-quiet text-sm",children:s?.confirmed===!0?i({defaultMessage:"Task will be created",id:"+A0SHGFNa7"}):i({defaultMessage:"Task was skipped",id:"uRAWVsTn39"})})}):l.jsx(K,{className:"bg-base border-t pt-4",children:l.jsx("div",{className:"flex items-center justify-between gap-4",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ze,{size:"small",variant:"primary",text:r?a||i({defaultMessage:"Creating...",id:"mRL9Vh/e/Z"}):o||i({defaultMessage:"Create Task",id:"4+iiEILSrA"}),onClick:t,disabled:n||r}),l.jsx(rt,{size:"small",text:i({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:e,disabled:n||r})]})})})},i_t="pplx.watchlist",l_t=async({query:e,watchlistType:t,limit:n,category:r,cometRenderPlace:s,reason:o})=>{const{data:a,error:i,response:c}=await de.GET("/rest/homepage-widgets/watchlist/list-autosuggest",o,{params:{query:{type:t,query:e,limit:n,category:r,entropy_render_place:s}},timeoutMs:1500,numRetries:1});if(i)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get watchlist autosuggestions",cause:i,status:c.status??0});return a.results??Ie},tqe=async({watchlistType:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/homepage-widgets/watchlist/subscription",t,{params:{query:{type:e}},headers:{"content-type":"application/json"},numRetries:1});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get watchlist subscriptions",cause:n,status:s.status??0});return r.results??[]}catch(n){return Z.error(n),[]}},c_t=async({watchlistType:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/homepage-widgets/watchlist/categories",t,{params:{query:{type:e}},numRetries:1});if(n)throw new ye("API_CLIENTS_ERROR",{message:"Failed to get watchlist categories",cause:n,status:s.status??0});return r?.results??[]}catch(n){return Z.error(n),[]}},nqe=async({watchlistType:e,identifier:t,reason:n})=>{try{const{error:r,response:s}=await de.PUT("/rest/homepage-widgets/watchlist/subscription",n,{params:{query:{type:e,identifier:t??""}},headers:{"content-type":"application/json"}});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to add watchlist subscription",cause:r,status:s.status??0});return!0}catch(r){return Z.error(r),!1}},rqe=async({watchlistType:e,identifier:t,reason:n})=>{try{const{error:r,response:s}=await de.DELETE("/rest/homepage-widgets/watchlist/subscription",n,{params:{query:{type:e,identifier:t}},headers:{"content-type":"application/json"}});if(r)throw new ye("API_CLIENTS_ERROR",{message:"Failed to remove watchlist subscription",cause:r,status:s.status??0});return!0}catch(r){return Z.error(r),!1}},sqe=async({watchlistType:e,identifier:t,order:n,reason:r})=>{try{const{error:s,response:o}=await de.PATCH("/rest/homepage-widgets/watchlist/subscription",r,{params:{query:{type:e,identifier:t}},body:{order:n},headers:{"content-type":"application/json"}});if(s)throw new ye("API_CLIENTS_ERROR",{message:"Failed to update watchlist subscription order",cause:s,status:o.status??0});return!0}catch(s){return Z.error(s),!1}},Eh=e=>be.makeEphemeralQueryKey("watchlist",e,"subscriptions"),oqe=e=>be.makeEphemeralQueryKey("watchlist",e,"addSubscription"),aqe=e=>be.makeEphemeralQueryKey("watchlist",e,"removeSubscription"),iqe=e=>be.makeEphemeralQueryKey("watchlist",e,"updateSubscription"),lqe=({watchlistType:e,reason:t})=>{const n=Vt(),r=Eh(e);return gt({queryKey:r,queryFn:()=>tqe({watchlistType:e,reason:t}),staleTime:0,enabled:n})},cqe=({watchlistType:e,queryClient:t,reason:n})=>{const r=Eh(e);return It({mutationKey:oqe(e),mutationFn:async s=>nqe({watchlistType:e,reason:n,...s}),onMutate:async({identifier:s,description:o,image:a,title:i})=>{await t.cancelQueries({queryKey:r});const c=t.getQueryData(Eh(e));return t.setQueryData(r,(u=[])=>{const f={identifier:s??"",description:o??"",image_url:a??"",title:i??"",subscribed:!0,order:Date.now()},m=u.filter(p=>p.identifier!==s);return[f,...m]}),{previousSubscriptions:c}},onError:(s,o,a)=>{Z.error("Error adding watchlist subscription",s),t.setQueryData(r,a?.previousSubscriptions)},onSuccess:()=>{t.invalidateQueries({queryKey:r})}})},uqe=({watchlistType:e,queryClient:t,reason:n})=>{const r=Eh(e);return It({mutationKey:aqe(e),mutationFn:async s=>rqe({watchlistType:e,reason:n,...s}),onSuccess:()=>{t.invalidateQueries({queryKey:r})},onMutate:async({identifier:s})=>{await t.cancelQueries({queryKey:r});const o=t.getQueryData(["watchlist",e]);return t.setQueryData(r,(a=[])=>a.filter(i=>i.identifier!==s)),{previousSubscriptions:o}},onError:(s,o,a)=>{Z.error("Error removing watchlist subscription",s),t.setQueryData(r,a?.previousSubscriptions)}})},u_t=({watchlistType:e,queryClient:t,reason:n})=>{const r=Eh(e);return It({mutationKey:iqe(e),mutationFn:async s=>sqe({watchlistType:e,reason:n,...s}),onMutate:async({newOrderedList:s})=>{await t.cancelQueries({queryKey:r});const o=t.getQueryData(r);return t.setQueryData(r,s),{previousSubscriptions:o}},onError:(s,o,a)=>{Z.error("Error updating watchlist subscription order",s),a?.previousSubscriptions&&t.setQueryData(r,a.previousSubscriptions)},onSuccess:()=>{t.invalidateQueries({queryKey:r})}})},ab=0,ib=1,Q6=!0,lb="finance",ore=!1,are="1d",ire=0,lre=!0,cre=!0,ure=!1,dre=null,fre=null,mre=null,X6=({prefix:e="finance/quote",symbol:t,withHistory:n=ore,historyAfterHours:r=lre,historyPeriod:s=are,historyOffset:o=ire,historyRedirect:a=ure,historyInterval:i=dre,historyStartDate:c=fre,historyEndDate:u=mre,withUiHints:f=cre})=>be.makeEphemeralQueryKey(e,t,n,r,s,i,o,a,c,u,f),tu=async({symbol:e,withHistory:t=ore,historyAfterHours:n=lre,historyPeriod:r=are,historyOffset:s=ire,historyRedirect:o=ure,historyInterval:a=dre,withUiHints:i=cre,historyStartDate:c=fre,historyEndDate:u=mre})=>{const{data:f,error:m,response:p}=await de.GET("/rest/finance/quote/{market_identifier}",lb,{params:{path:{market_identifier:e},query:{with_history:t,history_period:r,history_offset:s,history_after_hours:n,with_ui_hints:i,history_redirect:o,history_time_interval:a,history_start_date:c,history_end_date:u}},timeoutMs:ab,numRetries:ib,shouldNotAddSourceVersionQueryParams:Q6});if(p.status===404)return null;if(m)throw new ye("API_CLIENTS_ERROR",{cause:m,status:p.status??0});return f};function dqe(e,t){return be.makeEphemeralQueryKey("finance/peers",e,t)}async function fqe({symbol:e,headers:t,index:n}){const{data:r,error:s,response:o}=await de.GET("/rest/finance/peers/{market_identifier}",lb,{params:{path:{market_identifier:e},query:{with_index:n}},headers:t,timeoutMs:ab,numRetries:ib});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r}const RP=(e,t)=>["finance-autosuggest",e,t],DP=async({query:e,reason:t,country:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/list-autosuggest",t,{params:{query:{query:e,country:n}},timeoutMs:0});if(s)throw new ye("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.results??Ie}catch(r){return Z.error(r),[]}},mqe=(e,t,n)=>be.makeEphemeralQueryKey("finance/currency-exchange",e,t,n);async function pqe({sourceCurrency:e,targetCurrency:t,amount:n=1,headers:r}){const{data:s,error:o,response:a}=await de.GET("/rest/finance/currency-exchange",lb,{params:{query:{source_currency:e,target_currency:t,amount:n}},headers:r,timeoutMs:ab,numRetries:ib,shouldNotAddSourceVersionQueryParams:Q6});if(o)throw new ye("API_CLIENTS_ERROR",{cause:o,status:a.status??0});return s}const hqe=({eventId:e,historyPeriod:t,marketsSort:n,withCommentary:r,emphasizedMarketIds:s})=>be.makeEphemeralQueryKey("finance/prediction-markets/quote",e,t,n,r,s);async function gqe({eventId:e,historyPeriod:t,marketsSort:n="probability",withCommentary:r,emphasizedMarketIds:s}){const o=await de.GET("/rest/finance/prediction-markets/quote/{event_id}",lb,{params:{path:{event_id:e},query:{history_period:t,markets_sort:n,with_commentary:r,emphasized_market_ids:s}},timeoutMs:ab,numRetries:ib,shouldNotAddSourceVersionQueryParams:Q6});if(o.error)throw new Error("Failed to fetch polymarket quote",{cause:o.error});return o.data}function yqe(e,t){const n=t.target_price!=null,r=t.movement_percent!=null,s=t.target_price?.toString(),o={query:{prompt:e.prompt||"",searchModel:e.model_preference||ie.DEFAULT},status:"ACTIVE",notificationSettings:Ql,defaultTargetPriceValue:s};if(n)return{...o,trigger:{type:Xe.PRICE_ALERT,alertType:pr.TARGET_PRICE,price:t.target_price,currency:hI,symbol:t.ticker_symbol}};if(r){const a=t.movement_percent/100;return{...o,trigger:{type:Xe.PRICE_ALERT,alertType:pr.MOVEMENT_AMOUNT,percentageDecimalLowerBound:t.negative_direction?-a:0,percentageDecimalUpperBound:t.positive_direction?a:0,symbol:t.ticker_symbol}}}else return{...o,trigger:{type:Xe.PRICE_ALERT,alertType:pr.TARGET_PRICE,price:0,currency:hI,symbol:t.ticker_symbol}}}async function xqe(e){try{return(await tu({symbol:e}))?.currency?.toLowerCase()||"usd"}catch(t){return Z.warn(`Failed to fetch currency for symbol ${e}`,{error:t}),"usd"}}const vqe=({result:e})=>e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("circle-check-filled"),size:14,className:"text-super shrink-0",title:"Confirmed"}),l.jsx("span",{className:"text-super text-xs font-medium leading-none",children:l.jsx(Ne,{defaultMessage:"Alert confirmed",id:"0wByyMUPxz"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:l.jsx(Ne,{defaultMessage:"Alert skipped",id:"AYQONqG1U3"})})]}):null,pre=T.memo(({sendStepResult:e,taskAction:t,priceAlertData:n,stepUUID:r,isFinished:s=!1})=>{const{$t:o}=J(),{session:a}=je(),{trackEvent:i}=Ke(a),c="settings_create",[u,f]=d.useState(()=>yqe(t,n)),[m,p]=d.useState(null),[h,g]=d.useState(null),[y,x]=d.useState(null),v=d.useRef(!1),b="price_alert_operation";d.useEffect(()=>{(async()=>{if(!n.ticker_symbol||s){g(!0);return}try{await tu({symbol:n.ticker_symbol})===null?(g(!1),e({confirmed:!1,user_input:o({defaultMessage:'The stock symbol "{symbol}" could not be found. Please verify the ticker symbol is correct.',id:"yWihQJNDOI"},{symbol:n.ticker_symbol})},b,!1)):g(!0)}catch(k){Z.error("Failed to validate ticker",{ticker:n.ticker_symbol,error:k}),g(!1),e({confirmed:!1,user_input:o({defaultMessage:'Unable to validate the stock symbol "{symbol}" due to a network error. Please try again.',id:"C0nM7QfjoN"},{symbol:n.ticker_symbol})},b,!1)}})()},[n.ticker_symbol]),d.useEffect(()=>{t&&!s&&h===!0&&!v.current&&(i("price alert modal opened",{source:c}),v.current=!0)},[h]),d.useEffect(()=>{(async()=>{if(n.ticker_symbol&&h===!0&&u.trigger.type===Xe.PRICE_ALERT)try{const k=await xqe(n.ticker_symbol);f(I=>({...I,trigger:{...I.trigger,currency:k}}))}catch(k){Z.warn("Failed to fetch currency for ticker",{ticker:n.ticker_symbol,error:k})}})()},[n.ticker_symbol,h,u.trigger.type]);const _=d.useMemo(()=>o({defaultMessage:"Create Price Alert",id:"WY6/zFtq4x"}),[o]),w=d.useCallback(N=>{p(N),N.confirmed?(i("price alert modal action",{source:c,action:"created"}),e({confirmed:!0,task_action:N.task_action},b,!1)):(i("price alert modal action",{source:c,action:"deleted"}),e({confirmed:!1},b,!1))},[e,b,i,c]),S=d.useCallback(()=>{p({confirmed:!1}),i("price alert modal action",{source:c,action:"skipped"}),e({confirmed:!1},b,!1)},[i,c,e,b]),C=d.useCallback(()=>{const N=u.trigger;let k={task_name:`Price Alert: ${n.ticker_symbol}`,prompt:u.query?.prompt,model_preference:u.query?.searchModel||ie.DEFAULT,schedule:void 0,expiry_date:void 0,event_entity:n.ticker_symbol};switch(N.alertType){case pr.TARGET_PRICE:{k={...k,event_type:"STOCK_PRICE_TARGET",target_price:N.price,current_price:n.current_price};break}case pr.MOVEMENT_AMOUNT:{const I=N.percentageDecimalUpperBound,M=N.percentageDecimalLowerBound;k={...k,event_type:"STOCK_PRICE_MOVEMENT",upper_bound:I&&I>0?I*100:void 0,lower_bound:M&&M<0?M*100:void 0};break}default:Ft(N)}w({confirmed:!0,task_action:k})},[u,w,n]),E=d.useMemo(()=>s?!0:rre({isLoading:!1,currentConfiguration:u}),[u,s]);return!t||!n?null:s?l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:o({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):h===null||h===!1?null:l.jsxs("div",{className:"bg-subtler border-subtlest transform rounded-xl border transition-transform duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between rounded-t-lg px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:l.jsx(ft,{name:B("trending-up"),size:16,className:"text-quiet"})}),l.jsx("h3",{className:"text-foreground text-sm font-medium",children:_})]}),l.jsx(vqe,{result:m})]}),l.jsx("div",{className:"p-4",children:l.jsx($c,{children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(ob,{configuration:u,onConfigurationChange:f,errorMessage:y??void 0,onError:x,canEditSpace:!1}),y&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:y})]}),l.jsx(sre,{onSkip:S,onConfirm:C,disabled:E,result:m,buttonText:_})]})})})]})});pre.displayName="PriceAlertOperationStep";const bqe=e=>{const[t,n]=d.useState([]),r=d.useRef(e);d.useEffect(()=>{r.current=e},[e]);const s=d.useCallback((i,c)=>{n(u=>{const f=[...u];return f[i]=c,f})},[]),o=d.useMemo(()=>new Map,[]);d.useEffect(()=>{const i=t.reduce((c,u)=>c+u,0);i>0&&r.current?.(i)},[t]);const a=d.useCallback(i=>(o.has(i)||o.set(i,c=>{s(i,c)}),o.get(i)),[o,s]);return d.useMemo(()=>({groupCounts:t,handleGroupCountChange:s,getGroupHandler:a}),[t,s,a])},hre=T.memo(({result:e,textClassName:t})=>{const n=d.useMemo(()=>e.start?new Date(e.start):null,[e.start]),r=d.useMemo(()=>e.end?new Date(e.end):null,[e.end]),s=e.is_all_day===!0,o=gee(e.calendar_color?.background||"oklch(var(--super-color))"),a=yee(o),i=d.useMemo(()=>r?new Date(r.getTime()-1440*60*1e3):null,[r]),c=()=>n?s?(r?Math.round((r.getTime()-n.getTime())/864e5):1)<=1?l.jsx(Ip,{startDate:n,endDate:n,isAllDay:!0,showDate:!0,includeYear:!1}):l.jsx(Ip,{startDate:n,endDate:i,isAllDay:!0,showDate:!0,includeYear:!1}):l.jsx(Ip,{startDate:n,endDate:r||n,isAllDay:!1,showDate:!0,includeYear:!1}):null;return l.jsx("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer gap-3 rounded-lg px-2 py-1.5",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"py-xs relative w-1",children:l.jsx("div",{className:z("inset-y-two absolute w-1 shrink-0 self-stretch rounded-full",{"brightness-[0.8]":a==="Fail"}),style:{backgroundColor:o}})}),l.jsxs("div",{className:"gap-two flex min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex min-w-0 items-center justify-between gap-2",children:e.title&&l.jsx(V,{variant:"smallBold",className:"shrink-0",as:"span",children:e.title})}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:n&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis",t),variant:"tinyMono",color:"light",as:"span",children:c()})})]})]})})});hre.displayName="CalendarResult";var lp={exports:{}};var _qe=lp.exports,jP;function wqe(){return jP||(jP=1,(function(e,t){(function(n){var r=t,s=e&&e.exports==r&&e,o=typeof rd=="object"&&rd;(o.global===o||o.window===o)&&(n=o);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,i=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,u=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,f={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot"," ":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr",ª:"ordf",á:"aacute",Á:"Aacute",à:"agrave",À:"Agrave",ă:"abreve",Ă:"Abreve",â:"acirc",Â:"Acirc",å:"aring",Å:"angst",ä:"auml",Ä:"Auml",ã:"atilde",Ã:"Atilde",ą:"aogon",Ą:"Aogon",ā:"amacr",Ā:"Amacr",æ:"aelig",Æ:"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf",ℬ:"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf",ℭ:"Cfr","𝒞":"Cscr",ℂ:"Copf",ć:"cacute",Ć:"Cacute",ĉ:"ccirc",Ĉ:"Ccirc",č:"ccaron",Č:"Ccaron",ċ:"cdot",Ċ:"Cdot",ç:"ccedil",Ç:"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf",ď:"dcaron",Ď:"Dcaron",đ:"dstrok",Đ:"Dstrok",ð:"eth",Ð:"ETH","ⅇ":"ee",ℯ:"escr","𝔢":"efr","𝕖":"eopf",ℰ:"Escr","𝔈":"Efr","𝔼":"Eopf",é:"eacute",É:"Eacute",è:"egrave",È:"Egrave",ê:"ecirc",Ê:"Ecirc",ě:"ecaron",Ě:"Ecaron",ë:"euml",Ë:"Euml",ė:"edot",Ė:"Edot",ę:"eogon",Ę:"Eogon",ē:"emacr",Ē:"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf",ℱ:"Fscr",ff:"fflig",ffi:"ffilig",ffl:"ffllig",fi:"filig",fj:"fjlig",fl:"fllig",ƒ:"fnof",ℊ:"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr",ǵ:"gacute",ğ:"gbreve",Ğ:"Gbreve",ĝ:"gcirc",Ĝ:"Gcirc",ġ:"gdot",Ġ:"Gdot",Ģ:"Gcedil","𝔥":"hfr",ℎ:"planckh","𝒽":"hscr","𝕙":"hopf",ℋ:"Hscr",ℌ:"Hfr",ℍ:"Hopf",ĥ:"hcirc",Ĥ:"Hcirc",ℏ:"hbar",ħ:"hstrok",Ħ:"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf",ℐ:"Iscr",ℑ:"Im",í:"iacute",Í:"Iacute",ì:"igrave",Ì:"Igrave",î:"icirc",Î:"Icirc",ï:"iuml",Ï:"Iuml",ĩ:"itilde",Ĩ:"Itilde",İ:"Idot",į:"iogon",Į:"Iogon",ī:"imacr",Ī:"Imacr",ij:"ijlig",IJ:"IJlig",ı:"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf",ĵ:"jcirc",Ĵ:"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr",ķ:"kcedil",Ķ:"Kcedil","𝔩":"lfr","𝓁":"lscr",ℓ:"ell","𝕝":"lopf",ℒ:"Lscr","𝔏":"Lfr","𝕃":"Lopf",ĺ:"lacute",Ĺ:"Lacute",ľ:"lcaron",Ľ:"Lcaron",ļ:"lcedil",Ļ:"Lcedil",ł:"lstrok",Ł:"Lstrok",ŀ:"lmidot",Ŀ:"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf",ℳ:"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr",ℕ:"Nopf","𝒩":"Nscr","𝔑":"Nfr",ń:"nacute",Ń:"Nacute",ň:"ncaron",Ň:"Ncaron",ñ:"ntilde",Ñ:"Ntilde",ņ:"ncedil",Ņ:"Ncedil","№":"numero",ŋ:"eng",Ŋ:"ENG","𝕠":"oopf","𝔬":"ofr",ℴ:"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf",º:"ordm",ó:"oacute",Ó:"Oacute",ò:"ograve",Ò:"Ograve",ô:"ocirc",Ô:"Ocirc",ö:"ouml",Ö:"Ouml",ő:"odblac",Ő:"Odblac",õ:"otilde",Õ:"Otilde",ø:"oslash",Ø:"Oslash",ō:"omacr",Ō:"Omacr",œ:"oelig",Œ:"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf",ℙ:"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr",ℚ:"Qopf",ĸ:"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr",ℛ:"Rscr",ℜ:"Re",ℝ:"Ropf",ŕ:"racute",Ŕ:"Racute",ř:"rcaron",Ř:"Rcaron",ŗ:"rcedil",Ŗ:"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS",ś:"sacute",Ś:"Sacute",ŝ:"scirc",Ŝ:"Scirc",š:"scaron",Š:"Scaron",ş:"scedil",Ş:"Scedil",ß:"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf",ť:"tcaron",Ť:"Tcaron",ţ:"tcedil",Ţ:"Tcedil","™":"trade",ŧ:"tstrok",Ŧ:"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr",ú:"uacute",Ú:"Uacute",ù:"ugrave",Ù:"Ugrave",ŭ:"ubreve",Ŭ:"Ubreve",û:"ucirc",Û:"Ucirc",ů:"uring",Ů:"Uring",ü:"uuml",Ü:"Uuml",ű:"udblac",Ű:"Udblac",ũ:"utilde",Ũ:"Utilde",ų:"uogon",Ų:"Uogon",ū:"umacr",Ū:"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr",ŵ:"wcirc",Ŵ:"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf",ý:"yacute",Ý:"Yacute",ŷ:"ycirc",Ŷ:"Ycirc",ÿ:"yuml",Ÿ:"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf",ℨ:"Zfr",ℤ:"Zopf","𝒵":"Zscr",ź:"zacute",Ź:"Zacute",ž:"zcaron",Ž:"Zcaron",ż:"zdot",Ż:"Zdot",Ƶ:"imped",þ:"thorn",Þ:"THORN",ʼn:"napos",α:"alpha",Α:"Alpha",β:"beta",Β:"Beta",γ:"gamma",Γ:"Gamma",δ:"delta",Δ:"Delta",ε:"epsi","ϵ":"epsiv",Ε:"Epsilon",ϝ:"gammad",Ϝ:"Gammad",ζ:"zeta",Ζ:"Zeta",η:"eta",Η:"Eta",θ:"theta",ϑ:"thetav",Θ:"Theta",ι:"iota",Ι:"Iota",κ:"kappa",ϰ:"kappav",Κ:"Kappa",λ:"lambda",Λ:"Lambda",μ:"mu",µ:"micro",Μ:"Mu",ν:"nu",Ν:"Nu",ξ:"xi",Ξ:"Xi",ο:"omicron",Ο:"Omicron",π:"pi",ϖ:"piv",Π:"Pi",ρ:"rho",ϱ:"rhov",Ρ:"Rho",σ:"sigma",Σ:"Sigma",ς:"sigmaf",τ:"tau",Τ:"Tau",υ:"upsi",Υ:"Upsilon",ϒ:"Upsi",φ:"phi",ϕ:"phiv",Φ:"Phi",χ:"chi",Χ:"Chi",ψ:"psi",Ψ:"Psi",ω:"omega",Ω:"ohm",а:"acy",А:"Acy",б:"bcy",Б:"Bcy",в:"vcy",В:"Vcy",г:"gcy",Г:"Gcy",ѓ:"gjcy",Ѓ:"GJcy",д:"dcy",Д:"Dcy",ђ:"djcy",Ђ:"DJcy",е:"iecy",Е:"IEcy",ё:"iocy",Ё:"IOcy",є:"jukcy",Є:"Jukcy",ж:"zhcy",Ж:"ZHcy",з:"zcy",З:"Zcy",ѕ:"dscy",Ѕ:"DScy",и:"icy",И:"Icy",і:"iukcy",І:"Iukcy",ї:"yicy",Ї:"YIcy",й:"jcy",Й:"Jcy",ј:"jsercy",Ј:"Jsercy",к:"kcy",К:"Kcy",ќ:"kjcy",Ќ:"KJcy",л:"lcy",Л:"Lcy",љ:"ljcy",Љ:"LJcy",м:"mcy",М:"Mcy",н:"ncy",Н:"Ncy",њ:"njcy",Њ:"NJcy",о:"ocy",О:"Ocy",п:"pcy",П:"Pcy",р:"rcy",Р:"Rcy",с:"scy",С:"Scy",т:"tcy",Т:"Tcy",ћ:"tshcy",Ћ:"TSHcy",у:"ucy",У:"Ucy",ў:"ubrcy",Ў:"Ubrcy",ф:"fcy",Ф:"Fcy",х:"khcy",Х:"KHcy",ц:"tscy",Ц:"TScy",ч:"chcy",Ч:"CHcy",џ:"dzcy",Џ:"DZcy",ш:"shcy",Ш:"SHcy",щ:"shchcy",Щ:"SHCHcy",ъ:"hardcy",Ъ:"HARDcy",ы:"ycy",Ы:"Ycy",ь:"softcy",Ь:"SOFTcy",э:"ecy",Э:"Ecy",ю:"yucy",Ю:"YUcy",я:"yacy",Я:"YAcy",ℵ:"aleph",ℶ:"beth",ℷ:"gimel",ℸ:"daleth"},m=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,x={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,S={},C=S.hasOwnProperty,E=function(U,O){return C.call(U,O)},N=function(U,O){for(var $=-1,G=U.length;++$=55296&&U<=57343||U>1114111?(O&&D("character reference outside the permissible Unicode range"),"�"):E(b,U)?(O&&D("disallowed character reference"),b[U]):(O&&N(_,U)&&D("disallowed character reference"),U>65535&&(U-=65536,$+=w(U>>>10&1023|55296),U=56320|U&1023),$+=w(U),$)},M=function(U){return"&#x"+U.toString(16).toUpperCase()+";"},A=function(U){return"&#"+U+";"},D=function(U){throw Error("Parse error: "+U)},P=function(U,O){O=k(O,P.options);var $=O.strict;$&&g.test(U)&&D("forbidden code point");var G=O.encodeEverything,H=O.useNamedReferences,Q=O.allowUnsafeSymbols,Y=O.decimal?A:M,te=function(se){return Y(se.charCodeAt(0))};return G?(U=U.replace(i,function(se){return H&&E(f,se)?"&"+f[se]+";":te(se)}),H&&(U=U.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),H&&(U=U.replace(u,function(se){return"&"+f[se]+";"}))):H?(Q||(U=U.replace(m,function(se){return"&"+f[se]+";"})),U=U.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),U=U.replace(u,function(se){return"&"+f[se]+";"})):Q||(U=U.replace(m,te)),U.replace(a,function(se){var ae=se.charCodeAt(0),X=se.charCodeAt(1),ee=(ae-55296)*1024+X-56320+65536;return Y(ee)}).replace(c,te)};P.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var F=function(U,O){O=k(O,F.options);var $=O.strict;return $&&h.test(U)&&D("malformed character reference"),U.replace(y,function(G,H,Q,Y,te,se,ae,X,ee){var le,re,ce,ue,pe,xe;return H?(pe=H,x[pe]):Q?(pe=Q,xe=Y,xe&&O.isAttributeValue?($&&xe=="="&&D("`&` did not start a character reference"),G):($&&D("named character reference was not terminated by a semicolon"),v[pe]+(xe||""))):te?(ce=te,re=se,$&&!re&&D("character reference was not terminated by a semicolon"),le=parseInt(ce,10),I(le,$)):ae?(ue=ae,re=X,$&&!re&&D("character reference was not terminated by a semicolon"),le=parseInt(ue,16),I(le,$)):($&&D("named character reference was not terminated by a semicolon"),G)})};F.options={isAttributeValue:!1,strict:!1};var R=function(U){return U.replace(m,function(O){return p[O]})},j={version:"1.2.0",encode:P,decode:F,escape:R,unescape:F};if(r&&!r.nodeType)if(s)s.exports=j;else for(var L in j)E(j,L)&&(r[L]=j[L]);else n.he=j})(_qe)})(lp,lp.exports)),lp.exports}var Cqe=wqe();const IP=uo(Cqe),Sqe=e=>{const t=e.match(/^(.+?)\s*<(.+)>$/);return t?t[1]?.trim().replace(/^["']|["']$/g,"")||t[2]?.trim()||"":e.trim().replace(/^["']|["']$/g,"")},Eqe=e=>e==="GCAL"?{src:dI,alt:"Gmail"}:e==="OUTLOOK"?{src:ZLe,alt:"Outlook"}:{src:dI,alt:"Gmail"},kqe=e=>{const t=Date.now(),n=new Date(e),r=t-n.getTime();if(r<0)return"";const s=1e3*60,o=s*60,a=o*24,i=a*7,c=a*30,u=a*365;return r{const r=Eqe(e.connection_type),s=n?l.jsx(Jt,{icon:n,size:"tiny"}):l.jsx("img",{src:r.src,alt:r.alt,className:"size-[16px]"}),o=e.date?kqe(e.date):null;return l.jsxs("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer gap-3 rounded-lg px-2 py-1.5",children:[l.jsx("span",{className:"mt-two shrink-0",children:s}),l.jsxs("div",{className:"gap-two flex min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex min-w-0 items-center justify-between gap-2",children:e.sender&&l.jsx(V,{variant:"smallBold",className:"shrink-0",as:"span",children:Sqe(e.sender)})}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.subject&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis font-medium",t),variant:"small",as:"span",children:IP.decode(e.subject)})}),l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.snippet&&l.jsx(V,{variant:"tinyMono",className:"min-w-0 shrink truncate",color:"light",as:"span",children:IP.decode(e.snippet)}),o&&l.jsx(V,{variant:"tinyMono",className:"shrink-0 text-right",color:"light",as:"span",children:o})]})]})]})});gre.displayName="EmailSearchResult";const yre=T.memo(({result:e,textClassName:t,icon:n})=>{const r=l.jsx(Jt,{icon:n||B("user"),size:"tiny"}),s=("display_name"in e?e.display_name:void 0)||("name"in e?e.name:void 0)||"",o=("email_address"in e?e.email_address:void 0)||("url"in e?e.url:void 0)||"";return l.jsxs("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5",children:[l.jsx("span",{className:"shrink-0",children:r}),l.jsxs("span",{className:"gap-xs flex min-w-0 items-center",children:[s&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis",t),variant:"small",as:"span",children:s||(o?o.split("@")[0]:"")}),o&&l.jsx(V,{variant:"tinyMono",className:"mt-px min-w-0 shrink truncate",color:"light",as:"span",children:o})]})]})});yre.displayName="UserInfoSearchResult";const xre=T.memo(({result:e,textClassName:t,icon:n})=>{const r=ng(e.url),s=N4(e),o=kW(e,r),a=n?l.jsx(Jt,{icon:n,size:"tiny"}):l.jsx(xa.Icon,{url:e.url,isAttachment:e.is_attachment||!1,connectionType:r,isMemory:e.is_memory||!1,isConversationHistory:e.is_conversation_history||!1,isClientContext:e.is_client_context||!1,isInlineAttachment:!1,patentName:s}),i=e.url?l.jsx(xa.Source,{url:e.url,source:o,isAttachment:e.is_attachment||!1,connectionType:r,isMemory:e.is_memory||!1,isConversationHistory:e.is_conversation_history||!1,snippet:e.snippet,patentName:s}):null,c=e.is_memory?e.snippet:e.name;return l.jsxs("div",{className:"hover:bg-subtler relative flex min-w-0 cursor-pointer items-start gap-3 rounded-lg px-2 py-1.5",children:[l.jsx(V,{variant:"small",className:"mt-two shrink-0",children:a}),l.jsxs("div",{className:"gap-sm flex min-w-0 flex-1 items-start",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c&&l.jsx(V,{className:z("min-w-0 shrink truncate break-words",t),variant:"small",as:"span",children:c}),e.is_conversation_history&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"pt-two line-clamp-1",children:e.snippet})]}),!e.is_conversation_history&&l.jsx(V,{variant:"tinyRegular",className:"overflow-wrap-anywhere mt-px break-words text-right lowercase",color:"light",as:"span",children:i})]})]})});xre.displayName="WebSearchResult";const Mqe=e=>{if(!e)return;const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:void 0},Z6=e=>{const t=e.is_memory?"memory":"conversation_history",n=e.is_memory?e.url:void 0,r=e.is_conversation_history?Mqe(e.url):void 0;return{snippet:e.snippet,url:e.url??"",title:e.name,type:t,memoryKey:n,entryUuid:r,timestamp:e.timestamp??""}},vre=T.memo(({isOpen:e,onClose:t,snippet:n,type:r,url:s,memoryKey:o,title:a,timestamp:i})=>{const{formatDate:c}=J(),u=ci(),f=r==="conversation_history",m=r==="memory",{session:p}=je(),{trackEvent:h}=Ke(p),{openStackedModal:g}=gn().legacy,y=d.useCallback(()=>{h("navigated to manage memory",{memory_key:o}),g("memoryListModal",{isMemoryEnabled:!0})},[o,h,g]),x=d.useMemo(()=>l.jsx(V,{variant:"small",children:l.jsx(Ne,{defaultMessage:"Manage",id:"0AzlrbMWV9"})}),[]),v=d.useMemo(()=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ge,{icon:f?B("list-search"):B("bubble-text")}),l.jsx(V,{variant:"baseSemi",children:f?l.jsx(Ne,{defaultMessage:"Library",id:"StcK672jB9"}):l.jsx(Ne,{defaultMessage:"Memory",id:"dVx3yznM2C"})})]}),[f]);return l.jsxs(po,{variant:u?"bottom-sheet":"side-sheet",isOpen:e,onClose:t,modalClassname:"md:!max-w-[400px] md:!min-w-[400px]",modalContentClassname:"justify-between",titleContent:v,children:[l.jsxs(K,{className:"flex size-full flex-col items-start",children:[a&&i&&l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"baseSemi",children:a}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"pb-sm",children:c(i,{dateStyle:"long"})})]}),l.jsxs("div",{className:"inline",children:[l.jsx(V,{variant:"small",className:"inline",children:n}),l.jsx(V,{variant:"smallBold",className:"ml-1 inline",color:"super",children:f&&l.jsx(xt,{href:s,target:"_blank",rel:"noopener",className:"whitespace-nowrap",children:l.jsx(Ne,{defaultMessage:"See more",id:"yoLwRWw99S"})})})]})]}),m&&l.jsxs(K,{className:"flex w-full items-center justify-center gap-1",children:[l.jsx(V,{variant:"small",className:"inline",color:"light",children:l.jsx(Ne,{defaultMessage:"See all your memories.",id:"h0JAuR900y"})}),l.jsx(rt,{onClick:y,size:"small",variant:"common",noPadding:!0,text:x})]})]})});vre.displayName="MemorySearchHistoryModal";const Tqe=Object.freeze(Object.defineProperty({__proto__:null,MemorySearchHistoryModal:vre,createModalPayload:Z6},Symbol.toStringTag,{value:"Module"})),bre=e=>e.is_scrubbed??!1,Aqe=e=>cb(e)?bre(e):!1,cb=e=>e.is_memory||e.is_conversation_history,Nqe=e=>e.is_memory,Wg=e=>{const t=e.is_client_context,n=Aqe(e);return t||n},J6=()=>{const{openModal:e}=gn().legacy,{session:t}=je(),{trackEvent:n}=Ke(t);return d.useCallback(s=>{if(Wg(s))return;const o=Z6(s);e("memorySearchHistoryModal",o);const a=o.type,i=o.memoryKey,c=o.entryUuid;n("viewed memory search history modal",{type:a,...a==="memory"&&{memory_key:i},...a==="conversation_history"&&{entry_uuid:c}})},[e,n])},Rqe=(e,t)=>{const{value:n,loading:r}=qt({flag:"comet-open-citations-in-sidecar",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},_re=()=>{const e=Nn(),t=Io(),{variation:n}=Rqe(!1);Dn();const r=Ln(),s=r?.startsWith("/search/")||r?.startsWith("/sidecar/search/");return e&&n&&!t&&s},Dqe=({reason:e,entryUUID:t,openFile:n,onSuccess:r})=>{const{openToast:s}=pn(),o=J();return{openPatentInViewer:d.useCallback(async({name:i,url:c,fileSource:u})=>{try{n({name:i,url:null,fileSource:u,entryUUID:t});const{file_url:f}=await Uz({request:{file_url:c,view_mode:!0},reason:e});r?.({entryUUID:t,fileName:i}),n({name:i,url:f,fileSource:u,entryUUID:t})}catch{n({name:i,url:null,fileSource:u,entryUUID:t}),s({message:o.formatMessage({defaultMessage:"Failed to load patent. Please try again.",id:"CVx0UPNJGk"}),variant:"error",timeout:5e3})}},[e,t,n,r,s,o])}},jqe=({heading:e,groupIndex:t})=>l.jsxs(l.Fragment,{children:[t>0&&l.jsx("div",{className:"border-subtlest border-b"}),l.jsx(K,{variant:"raised",className:"-mx-xs pl-sm pb-sm sticky top-0 z-30 flex items-center gap-3 pt-3",children:l.jsx(V,{variant:"tinyRegular",children:e})})]}),pl=T.memo(({onClick:e,stepDelay:t,isFinished:n,results:r,textClassName:s,groupBy:o,onCountChange:a,icon:i,resultType:c="web",maxHeight:u=250})=>{const{getGroupHandler:f}=bqe(a),m=ln(),p=J6(),h=_re(),g=d.useRef(h);g.current=h;const{openFile:y}=d.useContext(d6),{openPatentInViewer:x}=Dqe({reason:"patent-search-result",openFile:y}),v=d.useCallback(w=>{(w.is_memory||w.is_conversation_history)&&p(w)},[p]),b=d.useCallback(w=>S=>{if("is_conversation_history"in w){if(w.is_conversation_history||w.is_memory){S.preventDefault(),v(w);return}if(w.is_attachment||w.is_memory)return S.preventDefault();if(rg(w)){S.preventDefault(),x({url:w.url,name:w.name});return}if(g.current){gV({adapter:m,event:S,reason:"citation-regular-list",url:w.url,tabId:w.tab_id});return}jx(S)&&(S.preventDefault(),m.openTab({url:w.url,tabId:w.tab_id}).catch(()=>{window.open(w.url,"_blank")}))}if(c==="email"||c==="calendar"){if(e){S.preventDefault();const E="url"in w?w.url:"";e(E||"")}return}const C="url"in w?w.url:"";e?.(C||"")},[m,e,c,v,x]);if(!r||r.length===0)return null;let _=[];if(o){const w=r,S=new Map;w.forEach(N=>{const k=N.category;S.has(k)||S.set(k,[]),S.get(k).push(N)});const C={open_tab:{heading:"Opened tabs",icon:l.jsx(ge,{icon:B("browser-plus")})},closed_tab:{heading:"Recently closed tabs",icon:l.jsx(ge,{icon:B("browser-minus")})},history:{heading:"Browser history",icon:l.jsx(ge,{icon:B("history")})}},E=S.size>1;_=Array.from(S.entries()).map(([N,k])=>{const I=C[N];return{heading:E?I?.heading||N:void 0,icon:E?I?.icon:void 0,results:k}})}else r.length>0&&r[0]&&"results"in r[0]?_=r.map(C=>({heading:C.heading,results:C.results})):_=[{results:[...r]}];return l.jsx(Jf,{children:l.jsx(Ng,{maxHeight:u,autoScroll:!1,topGradientOffset:_.length>1?36:0,scrollContainerClassName:_.length===1?"pt-sm":void 0,children:l.jsx("div",{className:"flex flex-col gap-px",children:_.map((w,S)=>{const C=w.results.map((N,k)=>{const I="url"in N?N.url:"",M=()=>{const A={result:N,textClassName:typeof s=="function"?s(N):s,icon:i};switch(c){case"web":return l.jsx(xre,{...A});case"userinfo":return l.jsx(yre,{...A});case"email":return l.jsx(gre,{...A});case"calendar":return l.jsx(hre,{...A});default:return null}};return l.jsx(xt,{className:"-ml-xs block",href:I||"#",target:"_blank",rel:"noopener nofollow",onClick:b(N),children:M()},`${S}-${I||k}-${k}`)}),E=f(S);return l.jsxs("div",{className:"mb-sm last:mb-0",children:[w.heading&&_.length>1&&l.jsx(jqe,{heading:w.heading,groupIndex:S}),l.jsx(tm,{items:C,stepDelay:t,isFinished:n,vertical:!0,truncate:!1,onCountChange:E})]},S)})})})})});pl.displayName="SearchResultsListStep";function wre(e={}){const{scrollContainerRef:t,enabled:n=!0}=e,r=d.useCallback(s=>{if(!n)return;const o=t?.current;o&&o.scrollBy({top:s.deltaY,left:s.deltaX,behavior:"instant"})},[t,n]);return d.useMemo(()=>({onWheel:r}),[r])}const Iqe=Se(async()=>{const{CitationModal:e}=await Ee(()=>q(()=>import("./CitationModal-xGSoPI-X.js"),__vite__mapDeps([459,4,1,3,8,9,6,7,10,11,12])));return{default:e}}),Pqe=T.memo(({children:e,result:t,webResultCitation:n,timestampComponent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,asChild:i=!1})=>{const{openModal:c}=Ho(),u=d.useCallback(m=>{m.preventDefault(),m.stopPropagation(),c(Iqe,{result:t,webResultCitation:n,timestampComponent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,legacyIdentifier:"__NONE__"})},[c,t,n,r,s,o,a]),f=i?JU:"span";return l.jsx(f,{onClick:u,children:e})});Pqe.displayName="CitationBottomSheet";const eN=T.memo(({webResults:e,compact:t=!1})=>{if(!d.useMemo(()=>(Array.isArray(e)?e:[e]).some(o=>rg(o)),[e])||Array.isArray(e))return null;const r=l.jsx(xt,{href:"https://www.lens.org",target:"_blank",rel:"noopener",className:"hover:text-super",children:"Lens.org"});return l.jsx(V,{variant:"tinyRegular",color:"light",children:t?l.jsxs(l.Fragment,{children:["· ",r]}):l.jsxs(l.Fragment,{children:["Patent Data by ",r]})})});eN.displayName="CitationAttribution";const tN=T.memo(({variant:e="medium",searchType:t})=>{const n=t==="memory",s=z("flex items-center justify-between w-full",e==="small"?"mb-0":"mb-2");return l.jsxs("div",{className:s,children:[l.jsxs(V,{className:"flex items-center gap-2",variant:"tiny",color:"light",children:[l.jsx(ge,{icon:n?B("bubble-text"):B("list-search"),size:"sm"}),n?l.jsx(Ne,{defaultMessage:"Memory",id:"dVx3yznM2C"}):l.jsx(Ne,{defaultMessage:"Library",id:"StcK672jB9"})]}),l.jsx(V,{variant:"tiny",color:"ultraLight",children:l.jsx(ge,{icon:B("user-search"),size:"sm"})})]})});tN.displayName="MemorySearchCitationCardTitle";const Cre=T.memo(({className:e})=>l.jsx("div",{className:e,children:l.jsxs(V,{variant:"micro",color:"light",className:"text-pretty",children:[l.jsx(Ne,{defaultMessage:"This answer uses premium data sources. You're receiving complimentary access through your Perplexity subscription.",id:"u+XPNB2p9O"})," ",l.jsx(Xh,{href:"https://www.perplexity.ai/help-center/en/articles/12870803-premium-data-sources",target:"_blank",variant:"inline",muted:!0,children:l.jsx(Ne,{defaultMessage:"Learn more",id:"TdTXXf940t"})})]})}));Cre.displayName="PremiumSourceFooter";const Oqe=e=>{const t=e.meta_data?.connection_type,n=typeof e.meta_data?.citation_domain_name=="string"?e.meta_data.citation_domain_name:void 0,r=t==="WILEY",s=t||e.is_memory||e.is_conversation_history?e.name:void 0;return n??(r?"Wiley":s)},Fi=e=>{if(!e)return!1;const t=typeof e.meta_data?.wiley_book_uuid=="string"&&e.meta_data?.wiley_book_uuid!=="",n=typeof e.meta_data?.is_premium_datasource=="boolean"&&e.meta_data?.is_premium_datasource===!0;return t||n},Gg=e=>{if(!e)return{source_type:"unknown",is_premium:!1};const t=Fi(e),n=Oqe(e);let r="web";return e.is_attachment?r="attachment":e.is_image?r="image":e.is_memory?r="memory":e.is_conversation_history?r="conversation_history":e.is_knowledge_card?r="knowledge_card":e.is_navigational?r="navigational":e.is_code_interpreter?r="code_interpreter":e.meta_data?.connection_type?r=String(e.meta_data.connection_type).toLowerCase():t&&(r="premium_datasource"),{source_name:n,source_type:r,is_premium:t}},Uw="text-foreground text-left hover:text-super focus:text-super leading-snug transition-color line-clamp-2 cursor-pointer font-sans text-sm font-medium duration-quick",nN=T.memo(({result:e,webResultCitation:t,timestampComponent:n,linkProps:r,onYouTubeClick:s,onAttachmentClick:o,isFile:a=e.is_attachment??!1,downloadable:i=!1,isYouTubeVideo:c=!!(e.url&&Ji(e.url))})=>{const u=e?.is_conversation_history??!1,f=e?.is_memory??!1,m=u||f,p=Wg(e),h=bre(e),g=h||m&&!p?null:e.meta_data?.generated_file_title??e.name,y=t?.cited_texts??[],x=e.meta_data?.generated_file_description??e.snippet,v=e.meta_data?.authors,b=Fi(e),_=N4(e),w=typeof e.meta_data?.citation_domain_name=="string"?e.meta_data?.citation_domain_name:void 0,S=R4(e),C=e.url||p,E=l.jsxs("div",{className:"gap-1 flex flex-col min-w-[200px]",children:[m&&!p?l.jsx(tN,{variant:"medium",searchType:f?"memory":"conversation-history"}):l.jsxs("div",{className:"gap-sm flex flex-col",children:[(C||n)&&l.jsxs("div",{className:"flex items-center justify-between",children:[C&&l.jsx(xa,{className:"text-right",variant:"tinyRegular",color:"light",url:e.url,isAttachment:a,source:w,connectionType:e.meta_data?.connection_type,mcpServerSource:e.meta_data?.mcp_server,patentName:_,truncate:!1}),l.jsxs("div",{className:"flex items-center gap-2",children:[n,l.jsx(eN,{webResults:e,compact:!!n})]}),b?l.jsx(Sh,{}):null]}),c?l.jsx("button",{className:Uw,onClick:s,children:g}):i?l.jsx("button",{className:Uw,onClick:o,children:g}):S?l.jsx("span",{className:Uw,children:g}):l.jsx("span",{className:"text-foreground mb-xs line-clamp-2 text-left font-sans text-sm",children:g})]}),v?l.jsx(V,{variant:"small",className:"line-clamp-3",children:v.join(", ")}):null,h?l.jsx(V,{variant:"small",color:"light",children:l.jsx(Ne,{defaultMessage:"This is a private source.",id:"jKReyt0qq8",description:"Text shown when a source is private and obfuscated"})}):null,g!==e.name&&!f&&!h?l.jsx(V,{variant:"small",color:"light",children:e.name}):null,y.length>0?l.jsx("ul",{children:y.map((N,k)=>l.jsx("li",{className:"border-b last:border-b-0",children:l.jsx(V,{variant:"small",className:"line-clamp-[20] italic",children:N})},k))}):x&&l.jsx(V,{variant:"small",color:"light",className:"line-clamp-4 whitespace-pre-wrap",children:x}),p&&!h?l.jsxs(K,{className:"gap-xs pt-sm mt-sm flex items-center border-t",children:[l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B("user-scan")})}),l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(Ne,{defaultMessage:"Personal Search",id:"7+aLCEyqS2",description:"title"})})]}):null,b&&l.jsx(Cre,{className:"pt-2"})]});return S?l.jsx(xt,{href:e.url,target:"_blank",rel:"noopener nofollow",...r,children:E}):E});nN.displayName="CitationContent";var Vw={exports:{}},Hw,PP;function Lqe(){if(PP)return Hw;PP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Hw=e,Hw}var zw,OP;function Fqe(){if(OP)return zw;OP=1;var e=Lqe();function t(){}function n(){}return n.resetWarningCache=t,zw=function(){function r(a,i,c,u,f,m){if(m!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},zw}var LP;function rN(){return LP||(LP=1,Vw.exports=Fqe()()),Vw.exports}var Bqe=rN();const He=uo(Bqe);var Ww,FP;function Uqe(){return FP||(FP=1,Ww=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[s]))return!1;for(s=r;s--!==0;){var a=o[s];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}),Ww}var Vqe=Uqe();const Hqe=uo(Vqe);var o1={exports:{}},Gw,BP;function zqe(){if(BP)return Gw;BP=1;var e;return e=function(){var t={},n={};return t.on=function(r,s){var o={name:r,handler:s};return n[r]=n[r]||[],n[r].unshift(o),o},t.off=function(r){var s=n[r.name].indexOf(r);s!==-1&&n[r.name].splice(s,1)},t.trigger=function(r,s){var o=n[r],a;if(o)for(a=o.length;a--;)o[a].handler(s)},t},Gw=e,Gw}var a1={exports:{}},$w,UP;function Wqe(){if(UP)return $w;UP=1,$w=function(s,o,a){var i=document.head||document.getElementsByTagName("head")[0],c=document.createElement("script");typeof o=="function"&&(a=o,o={}),o=o||{},a=a||function(){},c.type=o.type||"text/javascript",c.charset=o.charset||"utf8",c.async="async"in o?!!o.async:!0,c.src=s,o.attrs&&e(c,o.attrs),o.text&&(c.text=""+o.text);var u="onload"in c?t:n;u(c,a),c.onload||t(c,a),i.appendChild(c)};function e(r,s){for(var o in s)r.setAttribute(o,s[o])}function t(r,s){r.onload=function(){this.onerror=this.onload=null,s(null,r)},r.onerror=function(){this.onerror=this.onload=null,s(new Error("Failed to load "+this.src),r)}}function n(r,s){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,s(null,r))}}return $w}var VP;function Gqe(){return VP||(VP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Wqe(),r=s(n);function s(o){return o&&o.__esModule?o:{default:o}}t.default=function(o){var a=new Promise(function(i){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){i(window.YT);return}else{var c=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(c+"//www.youtube.com/iframe_api",function(f){f&&o.trigger("error",f)})}var u=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){u&&u(),i(window.YT)}});return a},e.exports=t.default})(a1,a1.exports)),a1.exports}var i1={exports:{}},l1={exports:{}},c1={exports:{}},qw,HP;function $qe(){if(HP)return qw;HP=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*365.25;qw=function(u,f){f=f||{};var m=typeof u;if(m==="string"&&u.length>0)return o(u);if(m==="number"&&isNaN(u)===!1)return f.long?i(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var f=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(f){var m=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return m*s;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function a(u){return u>=r?Math.round(u/r)+"d":u>=n?Math.round(u/n)+"h":u>=t?Math.round(u/t)+"m":u>=e?Math.round(u/e)+"s":u+"ms"}function i(u){return c(u,r,"day")||c(u,n,"hour")||c(u,t,"minute")||c(u,e,"second")||u+" ms"}function c(u,f,m){if(!(u=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(u){try{return JSON.stringify(u)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}};function s(u){var f=this.useColors;if(u[0]=(f?"%c":"")+this.namespace+(f?" %c":" ")+u[0]+(f?"%c ":" ")+"+"+t.humanize(this.diff),!!f){var m="color: "+this.color;u.splice(1,0,m,"color: inherit");var p=0,h=0;u[0].replace(/%[a-zA-Z%]/g,function(g){g!=="%%"&&(p++,g==="%c"&&(h=p))}),u.splice(h,0,m)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(u){try{u==null?t.storage.removeItem("debug"):t.storage.debug=u}catch{}}function i(){var u;try{u=t.storage.debug}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}t.enable(i());function c(){try{return window.localStorage}catch{}}})(l1,l1.exports)),l1.exports}var u1={exports:{}},GP;function Yqe(){return GP||(GP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],e.exports=t.default})(u1,u1.exports)),u1.exports}var d1={exports:{}},$P;function Qqe(){return $P||($P=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],e.exports=t.default})(d1,d1.exports)),d1.exports}var f1={exports:{}},m1={exports:{}},qP;function Xqe(){return qP||(qP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},e.exports=t.default})(m1,m1.exports)),m1.exports}var KP;function Zqe(){return KP||(KP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Xqe(),r=s(n);function s(o){return o&&o.__esModule?o:{default:o}}t.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},e.exports=t.default})(f1,f1.exports)),f1.exports}var YP;function Jqe(){return YP||(YP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Kqe(),r=f(n),s=Yqe(),o=f(s),a=Qqe(),i=f(a),c=Zqe(),u=f(c);function f(h){return h&&h.__esModule?h:{default:h}}var m=(0,r.default)("youtube-player"),p={};p.proxyEvents=function(h){var g={},y=function(E){var N="on"+E.slice(0,1).toUpperCase()+E.slice(1);g[N]=function(k){m('event "%s"',N,k),h.trigger(E,k)}},x=!0,v=!1,b=void 0;try{for(var _=i.default[Symbol.iterator](),w;!(x=(w=_.next()).done);x=!0){var S=w.value;y(S)}}catch(C){v=!0,b=C}finally{try{!x&&_.return&&_.return()}finally{if(v)throw b}}return g},p.promisifyPlayer=function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y={},x=function(N){g&&u.default[N]?y[N]=function(){for(var k=arguments.length,I=Array(k),M=0;M1&&arguments[1]!==void 0?arguments[1]:{},h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,g=(0,s.default)();if(f||(f=(0,a.default)(g)),p.events)throw new Error("Event handlers cannot be overwritten.");if(typeof m=="string"&&!document.getElementById(m))throw new Error('Element "'+m+'" does not exist.');p.events=c.default.proxyEvents(g);var y=new Promise(function(v){if((typeof m>"u"?"undefined":n(m))==="object"&&m.playVideo instanceof Function){var b=m;v(b)}else f.then(function(_){var w=new _.Player(m,p);return g.on("ready",function(){v(w)}),null})}),x=c.default.promisifyPlayer(y,h);return x.on=g.on,x.off=g.off,x},e.exports=t.default})(o1,o1.exports)),o1.exports}var tKe=eKe();const nKe=uo(tKe);var rKe=Object.defineProperty,sKe=Object.defineProperties,oKe=Object.getOwnPropertyDescriptors,XP=Object.getOwnPropertySymbols,aKe=Object.prototype.hasOwnProperty,iKe=Object.prototype.propertyIsEnumerable,ZP=(e,t,n)=>t in e?rKe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ok=(e,t)=>{for(var n in t||(t={}))aKe.call(t,n)&&ZP(e,n,t[n]);if(XP)for(var n of XP(t))iKe.call(t,n)&&ZP(e,n,t[n]);return e},ak=(e,t)=>sKe(e,oKe(t)),lKe=(e,t,n)=>new Promise((r,s)=>{var o=c=>{try{i(n.next(c))}catch(u){s(u)}},a=c=>{try{i(n.throw(c))}catch(u){s(u)}},i=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,a);i((n=n.apply(e,t)).next())});function cKe(e,t){var n,r;if(e.videoId!==t.videoId)return!0;const s=((n=e.opts)==null?void 0:n.playerVars)||{},o=((r=t.opts)==null?void 0:r.playerVars)||{};return s.start!==o.start||s.end!==o.end}function JP(e={}){return ak(ok({},e),{height:0,width:0,playerVars:ak(ok({},e.playerVars),{autoplay:0,start:0,end:0})})}function uKe(e,t){return e.videoId!==t.videoId||!Hqe(JP(e.opts),JP(t.opts))}function dKe(e,t){var n,r,s,o;return e.id!==t.id||e.className!==t.className||((n=e.opts)==null?void 0:n.width)!==((r=t.opts)==null?void 0:r.width)||((s=e.opts)==null?void 0:s.height)!==((o=t.opts)==null?void 0:o.height)||e.iframeClassName!==t.iframeClassName||e.title!==t.title}var fKe={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},mKe={videoId:He.string,id:He.string,className:He.string,iframeClassName:He.string,style:He.object,title:He.string,loading:He.oneOf(["lazy","eager"]),opts:He.objectOf(He.any),onReady:He.func,onError:He.func,onPlay:He.func,onPause:He.func,onEnd:He.func,onStateChange:He.func,onPlaybackRateChange:He.func,onPlaybackQualityChange:He.func},Sy=class extends T.Component{constructor(e){super(e),this.destroyPlayerPromise=void 0,this.onPlayerReady=t=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,t)},this.onPlayerError=t=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,t)},this.onPlayerStateChange=t=>{var n,r,s,o,a,i,c,u;switch((r=(n=this.props).onStateChange)==null||r.call(n,t),t.data){case Sy.PlayerState.ENDED:(o=(s=this.props).onEnd)==null||o.call(s,t);break;case Sy.PlayerState.PLAYING:(i=(a=this.props).onPlay)==null||i.call(a,t);break;case Sy.PlayerState.PAUSED:(u=(c=this.props).onPause)==null||u.call(c,t);break}},this.onPlayerPlaybackRateChange=t=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,t)},this.onPlayerPlaybackQualityChange=t=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,t)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const t=ak(ok({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=nKe(this.container,t),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var t;(t=this.internalPlayer)==null||t.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var t,n,r,s;if(typeof this.props.videoId>"u"||this.props.videoId===null){(t=this.internalPlayer)==null||t.stopVideo();return}let o=!1;const a={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(o=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(a.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(a.endSeconds=this.props.opts.playerVars.end)),o){(r=this.internalPlayer)==null||r.loadVideoById(a);return}(s=this.internalPlayer)==null||s.cueVideoById(a)},this.refContainer=t=>{this.container=t},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(e){return lKe(this,null,function*(){dKe(e,this.props)&&this.updatePlayer(),uKe(e,this.props)&&(yield this.resetPlayer()),cKe(e,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return T.createElement("div",{className:this.props.className,style:this.props.style},T.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},ub=Sy;ub.propTypes=mKe;ub.defaultProps=fKe;ub.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var eO=ub;const tO={fadeIn:{opacity:1},fadeOut:{opacity:0}},pKe={width:"100%",height:"100%",playerVars:{autoplay:1,color:"white",playsinline:1}},$g=T.memo(e=>{const{isOpen:t,name:n,setisOpen:r,url:s}=e,o=s?Ji(s):void 0,a=d.useRef(void 0),[i,c]=d.useState(!1),u=d.useCallback(p=>{a.current=p.target,c(!0)},[a]),f=d.useCallback(p=>{if(a.current)switch(p.key){case" ":{a.current.getPlayerState()===eO.PlayerState.PLAYING?a.current.pauseVideo():a.current.playVideo();break}case"ArrowRight":{a.current.seekTo(a.current.getCurrentTime()+5,!0);break}case"ArrowLeft":{a.current.seekTo(a.current.getCurrentTime()-5,!0);break}}},[a]);d.useEffect(()=>(t?window.addEventListener("keydown",f):window.removeEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}),[f,t]);const m=d.useCallback(p=>{r(p)},[r]);return o?l.jsx(yA,{open:t,onOpenChange:m,children:l.jsx(DT,{className:"z-10",asChild:!0,children:l.jsxs(Te.div,{className:"bg-backdrop dark fixed inset-0 flex items-center justify-center backdrop-blur-md",initial:"fadeOut",animate:"fadeIn",exit:"fadeOut",variants:tO,transition:{duration:.2},children:[l.jsx(tq,{asChild:!0,children:l.jsx(ze,{extraCSS:"!fixed top-md right-md shadow-sm",icon:B("x"),pill:!0,size:"small",variant:"common"})}),l.jsxs(jT,{className:"grid outline-none","aria-describedby":void 0,children:[l.jsx(KU,{children:l.jsx(eq,{children:n})}),l.jsxs(kt,{children:[!i&&l.jsx(Te.div,{className:"grid place-items-center [grid-area:1/-1]",initial:"fadeOut",animate:"fadeIn",exit:"fadeOut",transition:{duration:.2},variants:tO,children:l.jsx(ql,{size:24})},"youtube-player-loading"),l.jsx(Te.div,{className:z("aspect-video overflow-hidden rounded-2xl shadow-lg [grid-area:1/-1] *:size-full","w-[calc(100dvw-(2*var(--size-md)))] sm:w-[75vw]"),initial:{opacity:0},animate:{opacity:i?1:0},transition:{duration:.2},children:l.jsx(eO,{onReady:u,opts:pKe,title:n,videoId:o})},"youtube-player-content")]})]})]},"youtube-player-overlay")})}):null});$g.displayName="YoutubeVideoPlayer";const df=T.memo(({hideHoverCard:e=!1,children:t,linkProps:n,result:r,webResultCitation:s,timestampComponent:o,getAttachmentUrl:a,onOpened:i,scrollContainerRef:c,triggerClassName:u})=>{const{isMobileStyle:f}=Re(),[m,p]=d.useState(!1),[h,g]=d.useState(!1),[y,x]=d.useState(null),v=Hf(r),{onWheel:b}=wre({scrollContainerRef:c,enabled:!0}),_=r.is_attachment??!1,w=Xl(r),S=Tr(r.url),C=d.useCallback(async()=>{if(!a||v)return;const O=await a(r.url);S&&(x(O),g(!0),p(!1))},[a,r.url,S,v]),E=r.meta_data?.generated_file_title??r.name,N=d.useRef(!1),[k,I]=d.useState(!1),M=!!(r.url&&Ji(r.url));d.useEffect(()=>{if(typeof window>"u")return;function O(){N.current=!1}return document.addEventListener("visibilitychange",O),()=>{window.removeEventListener("visibilitychange",O)}},[]);const A=d.useCallback(()=>g(!1),[]),D=d.useCallback(()=>{I(!0),p(!1)},[]),P=d.useMemo(()=>({src:y??void 0}),[y]),F=d.useCallback(O=>{!O&&N.current||(p(e?!1:O),O&&i?.())},[e,i]),R=d.useCallback(()=>{N.current=!0},[]),j=d.useCallback(()=>{p(!1),N.current=!1},[]),L=d.useCallback(()=>{N.current=!1},[]),U=d.useMemo(()=>l.jsx("span",{className:z("inline-flex",u),"aria-label":E,onPointerEnter:R,onClick:j,onPointerLeave:L,children:t}),[t,E,R,j,L,u]);return l.jsxs(l.Fragment,{children:[M&&r.url&&l.jsx($g,{isOpen:k,name:E,setisOpen:I,url:r.url}),S&&y&&l.jsx(gu,{isOpen:h,onClose:A,imgProps:P}),l.jsx(Ul,{interaction:"hover",open:m,onOpenChange:F,openDelayMs:200,closeDelayMs:200,side:"bottom",align:"start",triggerElement:U,maxWidthPx:320,onWheelContent:b,children:l.jsx("div",{className:"p-xs",children:l.jsx(nN,{result:r,webResultCitation:s,timestampComponent:o,linkProps:n,onYouTubeClick:D,onAttachmentClick:C,isFile:_,downloadable:w,isYouTubeVideo:M})})})]})}),hKe=({webResults:e,citationGroup:t,onCitationClick:n,openMemorySearchHistoryModal:r,onYouTubeClick:s,onAttachmentClick:o,forceExternalHandler:a,getAttachmentUrl:i,trackEvent:c,onClose:u})=>{const f=J(),m=d.useMemo(()=>[...e].sort((x,v)=>{const b=Fi(x),_=Fi(v);return b&&!_?-1:!b&&_?1:0}),[e]),p=d.useMemo(()=>e.every(x=>x.is_conversation_history),[e]),h=d.useMemo(()=>e.some(x=>Fi(x)),[e]),g=d.useMemo(()=>{if(p)return f.formatMessage({defaultMessage:"Library",id:"StcK672jB9"});switch(t.category){case"memory":return f.formatMessage({defaultMessage:"Memory",id:"dVx3yznM2C"});case"attachment":return f.formatMessage({defaultMessage:"Attachments",id:"Vlx13nOMtX"});case"youtube":return f.formatMessage({defaultMessage:"YouTube",id:"zuA3BgDC6u"});default:return f.formatMessage({defaultMessage:"{count, plural, one {# source} other {# sources}}",id:"WrpI57Uej/"},{count:t.totalCount??e?.length})}},[t.category,p,f,t.totalCount,e.length]),y=d.useCallback(x=>async v=>{if(x.is_conversation_history||x.is_memory)if(v.preventDefault(),u?.(),n){n(x,v);return}else if(r){r(x);return}else{console.warn("Memory/conversation history modal handler not provided");return}if((x.url?Ji(x.url):null)&&s){v.preventDefault(),s(x),u?.();return}const _=x.is_attachment||!1,w=Tr(x.url);if(_&&w&&o){v.preventDefault(),o(x),u?.();return}if(vA()&&n){v.preventDefault(),u?.(),n(x,v);return}if(_&&Xl(x)&&i){v.preventDefault();const S=await i(x.url);window.open(S,"_blank");return}if(c&&x.url){const S=Gg(x);c("click citation",{source:"grouped_citation",citation_url:x.url,...S})}if(a&&n){n(x,v);return}R4(x)&&(v.preventDefault(),window.open(x.url,"_blank")),v.preventDefault()},[n,r,c,i,a,u,s,o]);return d.useMemo(()=>({sortedWebResults:m,headerText:g,hasPremiumSource:h,handleCitationClick:y}),[m,g,h,y])};df.displayName="CitationHoverCard";const gd=T.memo(({result:e,onClick:t,visualStyle:n,showName:r,className:s})=>{const o=ln(),a=ng(e.url),i=kW(e,a),c=J6(),u=_re(),f=d.useCallback(()=>{(e.is_memory||e.is_conversation_history)&&c(e)},[c,e]),m=d.useCallback(p=>{if(e.is_conversation_history||e.is_memory){p.preventDefault(),f();return}if(e.is_attachment||e.is_memory)return p.preventDefault();if(u){gV({adapter:o,event:p,reason:"search-result-step",url:e.url,tabId:e.tab_id});return}jx(p)&&(p.preventDefault(),o.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")})),t?.(e.url)},[o,t,e.is_attachment,e.is_memory,e.tab_id,e.url,f,e.is_conversation_history,u]);return l.jsx(xt,{className:z("inline-block max-w-full",s),href:e.url,target:"_blank",rel:"noopener nofollow",onClick:m,children:l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs rounded-lg pl-1.5 pr-2.5",children:l.jsx(xa,{variant:"tinyRegular",className:n==="closedTab"?"!line-through":void 0,url:e.url,name:r?e.name:void 0,isAttachment:e.is_attachment,connectionType:a,source:i,isMemory:e.is_memory,isConversationHistory:e.is_conversation_history})})})});gd.displayName="SearchResultBubble";const gKe=T.memo(({onClick:e,webResults:t,initialDisplayCount:n=12,stepDelay:r,isFinished:s=!1})=>{const o=d.useMemo(()=>t.map(a=>l.jsx(Sre,{result:a,onClick:e},a.url)),[e,t]);return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(tm,{items:o,initialDisplayCount:n,stepDelay:r,isFinished:s})})});gKe.displayName="SearchResultsStep";const Sre=T.memo(({result:e,onClick:t})=>{const n=ln(),r=d.useMemo(()=>({onClick(s){jx(s)&&(s.preventDefault(),n.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")}))}}),[n,e.tab_id,e.url]);return l.jsx(df,{result:e,linkProps:r,children:l.jsx(gd,{result:e,onClick:t})},e.url)});Sre.displayName="CitationHoverCardFactory";const yKe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i;function Ere(e){return typeof e!="string"?!1:yKe.test(e)}function Kw({label:e,chips:t,onAdd:n,onDelete:r,children:s,placeholder:o,onDraftChange:a,contactSuggestions:i,renderContactSuggestion:c}){return l.jsxs("div",{className:"border-subtlest pl-md pr-sm flex min-h-10 flex-1 items-center border-b p-0",children:[l.jsx(V,{variant:"small",color:"light",className:"w-10 min-w-[32px] select-none",children:e}),l.jsx("div",{className:"flex-1",children:l.jsx(P6,{chips:t,onAdd:n,onDelete:r,placeholder:o,validator:Ere,placeholderOnFocusOnly:!0,onDraftChange:a,suggestions:i,renderSuggestion:c})}),s]})}function xKe(e,t){const r=t.get(e)?.display_name?.trim();return r||e}function Yw(e,t){return e.map(n=>({label:xKe(n,t),value:n}))}const vKe=T.memo(function({email:t,onChange:n,onSend:r,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a,disableEditContents:i}){const c=d.useMemo(()=>t?.to??[],[t?.to]),u=d.useMemo(()=>t?.cc??[],[t?.cc]),f=d.useMemo(()=>t?.bcc??[],[t?.bcc]),[m,p]=d.useState(u.length>0),[h,g]=d.useState(f.length>0),{isMobileUserAgent:y}=Re(),x=()=>{(!u||u.length===0)&&(!f||f.length===0)&&(p(!1),g(!1))},{$t:v}=J(),b={to:v({defaultMessage:"To",id:"9j3hXO4Ojb"}),cc:v({defaultMessage:"Cc",id:"J1CYkLdqdy"}),bcc:v({defaultMessage:"Bcc",id:"qLl3P2UOlZ"}),addRecipient:v({defaultMessage:"Add recipient",id:"o2g2HQVmtC"}),subject:v({defaultMessage:"Subject",id:"LLtKhppiyE"}),writeMessage:v({defaultMessage:"Write your message...",id:"yoP6t+NY/q"})},_=d.useCallback(D=>({onAdd:(R,j)=>{const L=t?.[D]??[],U=R.filter(O=>Ere(O)&&!L.includes(O));if(U.length>0){const O=t?.contacts?[...t.contacts]:[];if(j&&j.length>0){const $=j.filter(G=>!O.some(H=>H.email===G.email)).map(G=>({email:G.email,display_name:G.name,photo_url:G.image||void 0}));O.push(...$)}n({...t,[D]:[...L,...U],contacts:O})}},onDelete:R=>{const j=t?.[D]??[];n({...t,[D]:j.filter(L=>!R.includes(L))})}}),[t,n]),w=d.useMemo(()=>new Map((t?.contacts??[]).filter(D=>D.email).map(D=>[D.email,D])),[t?.contacts]),S=d.useMemo(()=>Yw(c,w),[c,w]),C=d.useMemo(()=>Yw(u,w),[u,w]),E=d.useMemo(()=>Yw(f,w),[f,w]),N=_("to"),k=_("cc"),I=_("bcc"),M=d.useCallback(D=>n({...t,subject:D}),[t,n]),A=d.useCallback(D=>n({...t,body:D.target.value}),[t,n]);return l.jsxs("div",{className:"dark:bg-subtler flex w-full flex-col",children:[l.jsx(Kw,{label:b.to,chips:S,onAdd:N.onAdd,onDelete:N.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a,children:l.jsxs("div",{className:"gap-two ml-2 flex",children:[!m&&l.jsx("button",{type:"button",className:"hover:bg-subtler text-quiet rounded-lg px-2 py-1 font-sans text-sm",onClick:()=>p(!0),children:b.cc}),!h&&l.jsx("button",{type:"button",className:"hover:bg-subtler text-quiet rounded-lg px-2 py-1 font-sans text-sm",onClick:()=>g(!0),children:b.bcc})]})}),m&&l.jsx(Kw,{label:b.cc,chips:C,onAdd:k.onAdd,onDelete:k.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a}),h&&l.jsx(Kw,{label:b.bcc,chips:E,onAdd:I.onAdd,onDelete:I.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a}),!i&&l.jsx(co,{isMobileUserAgent:y,name:"subject-input",type:"text",value:t?.subject,onChange:M,placeholder:b.subject,className:"border-subtlest text-foreground !px-md !py-sm min-h-10 w-full !rounded-none border-0 border-b !bg-transparent focus:outline-none focus:!ring-0","aria-label":b.subject}),!i&&l.jsx("textarea",{name:"body",value:t?.body,onChange:A,placeholder:b.writeMessage,rows:8,className:"text-foreground placeholder:text-quieter p-md min-h-[180px] w-full resize-none border-0 bg-transparent font-sans text-sm shadow-none focus:outline-none focus:ring-0","aria-label":b.writeMessage,onFocus:x})]})}),kre=T.memo(({emailAction:e,sendStepResult:t,isFinished:n})=>{const r="send-email-step",[s,o]=d.useState(n??!1),{suggestions:a,handleDraftChange:i}=hee({reason:"email_compose"}),c=d.useMemo(()=>{if(e?.send)return e.send.email;if(e?.forward)return{to:e.forward.to,cc:e.forward.cc,bcc:e.forward.bcc,contacts:e.forward.contacts}},[e]),[u,f]=d.useState(c),{$t:m}=J(),p=d.useMemo(()=>!!(u?.to&&u.to.length===0),[u]),h=d.useMemo(()=>m({defaultMessage:"Send",id:"9WRlF4R2gm"}),[m]),[g,y]=d.useState(""),[x,v]=d.useState(!1),b=d.useCallback(()=>{o(!0),t({confirmed:!1},r,!1)},[t,r]),_=d.useCallback((I,M)=>{!I&&(!M||!M.trim())||(o(!0),t({confirmed:I,...M&&{user_input:M.trim()},...u&&{email:u}},r,!1),!I&&M&&(v(!1),y("")))},[t,r,u]),w=d.useCallback(()=>_(!0),[_]),S=d.useCallback(()=>_(!1,g),[_,g]),C=d.useCallback(I=>{Ls.isEnterKeyWithoutShift(I)&&(I.preventDefault(),S())},[S]),E=d.useCallback(()=>{v(!1),y("")},[]),N=d.useCallback(I=>{I.preventDefault(),v(!0)},[]),k=d.useCallback(I=>l.jsx(pee,{contact:I}),[]);return s?l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:m({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsxs(K,{variant:"raised",className:"rounded-lg border",children:[u&&l.jsx(K,{children:l.jsx(vKe,{email:u,onChange:f,onDraftChange:i,contactSuggestions:a,renderContactSuggestion:k,disableEditContents:!!e?.forward})}),x&&l.jsxs("form",{onSubmit:S,children:[l.jsx(K,{className:"px-md py-sm gap-4 border-t",children:l.jsx(yu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:m({defaultMessage:"What would you like to change about this email?",id:"lrZrku1OFD"}),value:g,onChange:y,onKeyDown:C,minRows:3,className:"mt-sm !pl-3",autoFocus:!0})}),l.jsxs("div",{className:"gap-sm p-md pt-sm flex items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex",children:[l.jsx(ze,{size:"small",variant:"inverted",text:m({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit"}),l.jsx(rt,{variant:"negative",size:"small",text:m({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:E})]}),l.jsx(rt,{size:"small",text:m({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:b})]})]}),!x&&l.jsx("form",{onSubmit:w,children:l.jsxs("div",{className:"gap-sm p-md flex items-center justify-between border-t",children:[l.jsxs("div",{className:"gap-sm flex",children:[l.jsx(ze,{size:"small",variant:"inverted",text:h,type:"submit",disabled:p}),l.jsx(ze,{size:"small",variant:"common",text:m({defaultMessage:"Refine email",id:"xTUBb7cWyO"}),onClick:N})]}),l.jsx(rt,{size:"small",text:m({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:b})]})})]})});kre.displayName="SendEmailStep";const bKe=({result:e})=>{const{$t:t}=J();return e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("circle-check-filled"),size:14,className:"shrink-0 text-[#16a34a]",title:"Confirmed"}),l.jsx("span",{className:"text-xs font-medium leading-none text-[#16a34a] dark:text-[#4ade80]",children:t({defaultMessage:"Task confirmed",id:"oLLCmoruP6"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:t({defaultMessage:"Task skipped",id:"uMaJWuUUvD"})})]}):null},Mre=T.memo(({sendStepResult:e,taskAction:t,stepUUID:n,isFinished:r=!1})=>{const{$t:s}=J(),{session:o}=je(),{trackEvent:a}=Ke(o),i="router",c=d.useMemo(()=>{const S=t.expiry_date?new Date(t.expiry_date):void 0;return{trigger:{type:Xe.SCHEDULED,schedule:wKe(t.schedule),expiryDate:S},query:{prompt:t.prompt||"",searchModel:t.model_preference||ie.DEFAULT},status:"ACTIVE",notificationSettings:Ql}},[t]),[u,f]=d.useState(v4(c??x4())),[m,p]=d.useState(null),[h,g]=d.useState(null),y="task_operation";d.useEffect(()=>{t&&!r&&a("task modal opened",{source:i})},[t,r,a,i]),Z.error("TaskOperationStep rendered",{stepUUID:n,hasTaskAction:!!t,isFinished:r,taskAction:t,taskActionType:typeof t,taskActionKeys:t?Object.keys(t):[],source:i});const x=d.useMemo(()=>s({defaultMessage:"Create Task",id:"4+iiEILSrA"}),[s]),v=d.useCallback(S=>{p(S),S.confirmed?(a("task modal action",{source:i,action:"created"}),e({confirmed:!0,task_action:S.task_action},y,!1)):(a("task modal action",{source:i,action:"deleted"}),e({confirmed:!1},y,!1))},[e,y,i,a]),b=d.useCallback(()=>{v({confirmed:!1})},[v]),_=d.useCallback(()=>{const S={task_name:u.query?.prompt||"Untitled Task",prompt:u.query?.prompt,model_preference:u.query?.searchModel||ie.DEFAULT,schedule:u.trigger.type===Xe.SCHEDULED?_Ke(u.trigger.schedule):void 0,expiry_date:t.expiry_date};v({confirmed:!0,task_action:S})},[u,v,t.expiry_date]),w=d.useCallback(S=>{f(S)},[]);return t?r?l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:s({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsxs("div",{className:"bg-subtler border-subtlest transform overflow-hidden rounded-xl border transition-transform duration-200",children:[l.jsxs("div",{className:"bg-subtler border-subtler flex items-center justify-between border-b px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:l.jsx(ft,{name:B("clock"),size:16,className:"text-quiet"})}),l.jsx("h3",{className:"text-foreground text-sm font-medium",children:x})]}),l.jsx(bKe,{result:m})]}),l.jsx("div",{className:"bg-base p-4",children:l.jsx($c,{children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(ob,{configuration:u,onConfigurationChange:w,canEditSpace:!1}),h&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:h})]}),l.jsx(sre,{onSkip:b,onConfirm:_,disabled:r,result:m})]})})})]}):(Z.error("TaskOperationStep received null/undefined taskAction - will not render",{stepUUID:n,taskAction:t,isFinished:r,source:i}),null)});Mre.displayName="TaskOperationStep";function _Ke(e){const t=`${e.hour.toString().padStart(2,"0")}:${e.minute.toString().padStart(2,"0")}`;switch(e.kind){case"ONCE":return{one_time:{datetime:new Date(e.year,e.month,e.day,e.hour,e.minute).toISOString()}};case"DAILY":return{daily:{time:t}};case"WEEKLY":return{weekly:{time:t,day_of_week:(e.dayOfWeek+6)%7}};case"MONTHLY":return{monthly:{time:t,day_of_month:e.day}};case"YEARLY":return{yearly:{time:t,day_of_month:e.day,month_of_year:e.month+1}};case"WEEKDAYS":return{weekdays:{time:t}};default:return{daily:{time:t}}}}function wKe(e){if(!e)return Gr();if(e.one_time){const t=e.one_time.datetime;if(!t)return Gr();const n=new Date(t);return{kind:"ONCE",minute:n.getMinutes(),hour:n.getHours(),day:n.getDate(),month:n.getMonth(),year:n.getFullYear(),dayOfWeek:n.getDay()}}else if(e.daily){const t=e.daily.time;if(!t)return Gr();const[n="",r=""]=t.split(":"),s=parseInt(n,10),o=parseInt(r,10);if(isNaN(s)||isNaN(o))return Gr();const a=new Date;return{kind:"DAILY",minute:o,hour:s,day:a.getDate(),month:a.getMonth(),year:a.getFullYear(),dayOfWeek:a.getDay()}}else if(e.weekly){const t=e.weekly.time,n=e.weekly.day_of_week;if(!t||n==null)return Gr();const[r="",s=""]=t.split(":"),o=parseInt(r,10),a=parseInt(s,10);if(isNaN(o)||isNaN(a))return Gr();const i=(n+1)%7,c=new Date;return{kind:"WEEKLY",minute:a,hour:o,day:c.getDate(),month:c.getMonth(),year:c.getFullYear(),dayOfWeek:i}}else if(e.monthly){const t=e.monthly.time,n=e.monthly.day_of_month;if(!t||n==null)return Gr();const[r="",s=""]=t.split(":"),o=parseInt(r,10),a=parseInt(s,10);if(isNaN(o)||isNaN(a))return Gr();const i=new Date;return{kind:"MONTHLY",minute:a,hour:o,day:n,month:i.getMonth(),year:i.getFullYear(),dayOfWeek:i.getDay()}}else if(e.yearly){const t=e.yearly.time,n=e.yearly.month_of_year,r=e.yearly.day_of_month;if(!t||n==null||r==null)return Gr();const[s="",o=""]=t.split(":"),a=parseInt(s,10),i=parseInt(o,10);if(isNaN(a)||isNaN(i))return Gr();const c=new Date;return{kind:"YEARLY",minute:i,hour:a,day:r,month:n-1,year:c.getFullYear(),dayOfWeek:c.getDay()}}else if(e.weekdays){const t=e.weekdays.time;if(!t)return Gr();const[n="",r=""]=t.split(":"),s=parseInt(n,10),o=parseInt(r,10);if(isNaN(s)||isNaN(o))return Gr();const a=new Date;return{kind:"WEEKDAYS",minute:o,hour:s,day:a.getDate(),month:a.getMonth(),year:a.getFullYear(),dayOfWeek:a.getDay()}}return Gr()}const ik=T.memo(({question:e,sendStepResult:t,isFinished:n})=>{const r="user-clarification-step",[s,o]=d.useState(n??!1),[a,i]=d.useState(""),{$t:c}=J(),u=d.useCallback(()=>{o(!0),t({confirmed:!1,user_input:a.length>0?a:"The user chose to confirm with the information provided"},r,!1)},[a,t]),f=d.useCallback(()=>{o(!0),t({confirmed:!1},r,!1)},[t]),m=d.useCallback(p=>{Ls.isEnterKeyWithoutShift(p)&&(p.preventDefault(),u())},[u]);return s?l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:c({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsx(K,{variant:"raised",className:"py-sm rounded-lg border",children:l.jsxs("form",{onSubmit:u,children:[e&&l.jsxs("div",{className:"px-md pt-sm",children:[l.jsx(V,{variant:"small",children:e}),l.jsx("div",{className:"gap-sm mt-3 flex items-center",children:l.jsx("div",{className:"grow",children:l.jsx(yu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:c({defaultMessage:"Add details…",id:"GTIJ9uAEMf"}),value:a,onChange:i,onKeyDown:m,minRows:3,className:"!pl-3",autoFocus:!0})})})]}),l.jsxs("div",{className:"gap-sm px-md py-sm mt-4 flex items-center",children:[l.jsx(ze,{size:"small",variant:"inverted",text:c({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit"}),l.jsx(rt,{size:"small",text:c({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:f})]})]})})});ik.displayName="UserClarificationStep";const Tre=T.memo(({step:e,action:t})=>{const{final:n,file_name:r,sheet_count:s,row_count:o}=e.content,a=!n;let i=t;return r&&n&&(i=r,s!=null?(i+=` (${s} sheets`,o!=null&&(i+=`, ${o} rows`),i+=")"):o!=null&&(i+=` (${o} rows)`)),l.jsx(ze,{text:t,icon:B("file-spreadsheet"),isLoading:a,size:"tiny",pill:!0,toolTip:i,tooltipLayout:"top"})});Tre.displayName="XlsxStep";const CKe=60,Are=T.memo(({questions:e,toolUuid:t,autoSkipSeconds:n=CKe,isFinished:r=!1,entryUuid:s})=>{const o=d.useRef(null),[a,i]=d.useState(0),[c,u]=d.useState(!1),[f,m]=d.useState(!1),p=d.useRef(!1),{$t:h}=J(),{session:g}=je(),{trackEvent:y,trackEventOnce:x}=Ke(g),[v,b]=d.useState(new Map),{mutate:_,isPending:w}=lFe(),S=n*1e3;d.useEffect(()=>{e.forEach(M=>{M.question_text&&x("clarifying question input viewed",{entry_uuid:s,clarifying_question:M.question_text})})},[e,s,x]);const C=d.useCallback(()=>e.map(M=>({question:M.question_text,answer:v.get(M.question_text??"")??""})),[e,v]),E=d.useCallback(M=>{if(p.current)return;p.current=!0,C().forEach(D=>{D.answer&&y("clarifying question answer submitted",{entry_uuid:s,answer:D.answer})}),M==="USER_SUBMITTED"?u(!0):m(!0),o.current&&clearInterval(o.current),_({answers:C(),toolUuid:t,submitType:M})},[t,C,_,s,y]),N=d.useCallback(()=>{const M=Array.from(v.values()).some(A=>A.trim()!=="");E(M?"USER_SUBMITTED":"TIMEOUT")},[E,v]),k=d.useCallback((M,A)=>{b(D=>{const P=new Map(D);return P.set(M,A),P}),i(-1),o.current&&clearInterval(o.current)},[]);d.useEffect(()=>{a>=S&&!p.current&&E("TIMEOUT")},[a,S,E]);const I=w||c||f||r;return e.length===0?null:c?l.jsx(Nre,{questionCount:e.length}):f?l.jsx(Rre,{questionCount:e.length}):l.jsxs(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:[l.jsxs("div",{className:"flex flex-row justify-between items-start",children:[l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("circle-arrow-up"),size:"sm"}),h({defaultMessage:"Get a better answer",id:"bdUER2dpcm"})]}),w?l.jsx("div",{className:"inline-flex text-quieter h-8 items-start ",children:l.jsx(ql,{})}):l.jsx(Dre,{isSubmitting:I,onClick:N,skipProgress:a,setSkipProgress:i,skipDurationMs:S,interval:o})]}),l.jsx("div",{className:"flex flex-col divide-y",children:e.map(M=>l.jsx(Ire,{questionText:M.question_text??"",options:M.options??[],isDisabled:I,onAnswerChange:k},M.question_text))})]})}),Nre=T.memo(({questionCount:e})=>{const{$t:t}=J();return l.jsx(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("circle-check"),size:"sm"}),t(e===1?{defaultMessage:"Answer submitted",id:"nhijhP95Wa"}:{defaultMessage:"Answers submitted",id:"slMbotVCdl"})]})})});Nre.displayName="SubmittedBanner";const Rre=T.memo(({questionCount:e})=>{const{$t:t}=J();return l.jsx(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("player-track-next"),size:"sm"}),t(e===1?{defaultMessage:"Question skipped",id:"TXA0/vEkkm"}:{defaultMessage:"Questions skipped",id:"y2UvuAr/nW"})]})})});Rre.displayName="SkippedBanner";const Dre=T.memo(({isSubmitting:e,onClick:t,skipProgress:n,setSkipProgress:r,skipDurationMs:s,interval:o})=>{d.useEffect(()=>(o.current=setInterval(()=>{r(u=>Math.min(u+100,s))},100),()=>{o.current&&clearInterval(o.current)}),[o,r,s]);const{$t:a}=J(),i=d.useMemo(()=>{const u=Math.ceil((s-n)/1e3);return e?a({defaultMessage:"Working...",id:"H6RqOb/hea"}):n<0?a({defaultMessage:"Continue",id:"acrOozm08x"}):a({defaultMessage:"Continue ({seconds})",id:"q9N0Gjq72e"},{seconds:u})},[n,e,s,a]),c=d.useMemo(()=>({width:`${n/s*100}%`}),[n,s]);return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"pointer-events-none relative opacity-0",children:l.jsx(Ct,{variant:"text",size:"small",onClick:t,disabled:e,children:n<0?a({defaultMessage:"Continue",id:"acrOozm08x"}):a({defaultMessage:"Continue (99)",id:"JLwyORtPZa"})})}),l.jsx("div",{className:"absolute inset-0",children:l.jsx(Ct,{variant:n<0?"primary":"text",size:"small",onClick:t,disabled:e,fullWidth:!0,children:i})})]}),l.jsxs("div",{className:z("grid grid-cols-1 grid-rows-1 rounded-lg overflow-hidden absolute inset-0 duration-normal pointer-events-none",e||n<0?"opacity-0":""),children:[l.jsx(K,{className:"bg-subtle col-start-1 row-start-1 h-full",variant:"subtle"}),l.jsx(K,{className:"opacity-5 col-start-1 row-start-1 h-full w-1/2 rounded-inherit duration-linear duration-100",variant:"textColor",style:c})]})]})});Dre.displayName="SkipButton";const jre=T.memo(({text:e,isSelected:t,isDisabled:n,onClick:r})=>{const s=d.useCallback(()=>{r(e)},[e,r]);return l.jsx("div",{className:z(t?"[&_button]:bg-inverse":"","inline-flex"),children:l.jsx(Ct,{variant:t?"primary":"tonal",size:"tiny",disabled:n,onClick:s,children:e})})});jre.displayName="AnswerButton";const Ire=T.memo(({questionText:e,options:t,isDisabled:n,onAnswerChange:r})=>{const[s,o]=d.useState(null),[a,i]=d.useState(!1),[c,u]=d.useState(""),{$t:f}=J(),m=d.useCallback(y=>{o(y),i(!1),r(e,y)},[e,r]),p=d.useCallback(()=>{i(!0),o(null),r(e,"")},[e,r]),h=d.useCallback(y=>{u(y),r(e,y)},[e,r]),g=d.useCallback(()=>{i(!1),u(""),r(e,"")},[e,r]);return l.jsxs("div",{className:"flex flex-col gap-y-sm py-md first:pt-0 last:pb-0",children:[l.jsx(V,{variant:"small",children:e}),a?l.jsxs("div",{className:"gap-x-sm flex flex-row items-center",children:[l.jsx(co,{value:c,onChange:h,placeholder:f({defaultMessage:"Enter your response",id:"NdOK6MxPTM"}),isMobileUserAgent:!1,size:"sm",wrapperClassName:"w-full",className:"h-8",disabled:n}),l.jsx(Ct,{size:"small",onClick:g,icon:B("x"),"aria-label":f({defaultMessage:"Back",id:"cyR7KhiuaU"}),variant:"text",disabled:n})]}):l.jsxs("div",{className:"gap-sm flex flex-row flex-wrap",children:[t.map(y=>l.jsx(jre,{text:y,isSelected:s===y,isDisabled:n,onClick:m},y)),l.jsx("div",{className:"inline-flex",children:l.jsx(Ct,{variant:"tonal",size:"tiny",onClick:p,disabled:n,children:f({defaultMessage:"Other",id:"/VnDMl81rh"})})})]})]})});Ire.displayName="ClarifyingQuestionRow";Are.displayName="ClarifyingQuestionBanner";const SKe=e=>e.toLowerCase().replace(/_/g," ").replace(/^\w/,t=>t.toUpperCase()),EKe={FINANCE:"FINANCE"},kKe={STOCK_PRICE_MOVEMENT:"STOCK_PRICE_MOVEMENT"};function qn(e,t,n){return{...t,title:n,actionKey:e}}function MKe(e){const t=[];let n=0;for(;n({...t,originalEndIndex:n}))}function AKe(e){const{step:t,isStudio:n,isFinished:r,onStepClick:s,stepDelay:o,showAllNestedSteps:a,isNested:i,disableAnimations:c,isMissionControl:u,hasAnswer:f,$t:m,getActionMessage:p,translations:h,assetsContent:g,sendStepResult:y,stepCount:x,setStepCount:v,taskComputerActions:b,allSteps:_,setShouldShowSkipButtonOverride:w,shouldShowSourceSkipButton:S,entryResult:C,enabledSources:E,shouldHideScreenshotsInSidecar:N,StepRendererComponent:k}=e;switch(t.step_type){case"SEARCH_WEB":{const M=t.content.queries??[],D=M.length>0&&M.every(P=>P.engine==="image")?"search_images":"search";return qn(D,{content:l.jsx(gs,{queries:M.map(P=>P.query),stepDelay:n?2:void 0,isFinished:r})},p(D))}case"SEARCH_RESULTS":{let A=function(P){return P.length===0?"reviewing_sources":P.every(F=>F.is_memory)?M.length===1?"reviewing_memory":"reviewing_memories":P.every(F=>F.is_conversation_history)?"reviewing_conversation_history":M.length===1?"reviewing_source":"reviewing_sources"};const M=t.content.web_results,D=A(M);return qn(D,{count:M.length>1?x:void 0,content:M.length===0?l.jsx(Dr,{icon:B("zoom-out"),text:m({defaultMessage:"No sources found",id:"yWSiuEkfbY"})}):UU(M)?l.jsx(gd,{result:M[0],showName:!0,onClick:s}):l.jsx(pl,{onClick:s,results:M,stepDelay:n?2:void 0,isFinished:r,onCountChange:v})},p(D))}case"ENTROPY_REQUEST":return{content:l.jsx(dee,{step:t,isFinished:r??!1,isMissionControl:u??!1})};case"CODE":return{content:!g&&l.jsx(tne,{action:p("working"),step:t})};case"PDF":return{content:!g&&l.jsx(vne,{action:p("creating_pdf"),step:t})};case"DOCX":return{content:!g&&l.jsx(sne,{action:p("creating_docx"),step:t})};case"XLSX":return{content:!g&&l.jsx(Tre,{action:p("creating_xlsx"),step:t})};case"CREATE_APP_RESULT":return{content:null};case"CREATE_CLIENT_APP":return{title:p("building_app"),content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.caption})};case"CREATE_CHART":return{title:p("creating_chart"),content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.caption})};case"GET_URL_CONTENT":{const M=t.content.pages,A=M.length>1?"getting_sources":"getting_source";return qn(A,{count:M.length>1?x:void 0,content:M.length===0?l.jsx(Dr,{icon:B("zoom-out-area"),text:m({defaultMessage:"No content found",id:"JlMgLJz0nd"})}):l.jsx("div",{className:"flex flex-wrap gap-2",children:M.map((D,P)=>l.jsx(gd,{result:{name:"",snippet:"",is_attachment:!1,url:D.url},showName:!1,onClick:s},D.url||P))})},p(A))}case"CLARIFYING_QUESTIONS_OUTPUT":return t.content.clarification?{content:l.jsx(yte,{step:t})}:null;case"IN_CONTEXT_SUGGESTIONS_OUTPUT":return t.content.selected_suggestion?{content:l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsx(Dr,{icon:B("bulb"),text:t.content.selected_suggestion})})}:null;case"THOUGHT":return qn("thinking",{content:l.jsx(K,{variant:"subtler",className:"py-xs inline-block rounded-lg px-2.5",children:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.thought})})},p("thinking"));case"URL_NAVIGATE":return qn("navigate",{content:l.jsx(gs,{queries:t.content.urls})},p("navigate"));case"BROWSER_OPEN_TAB_RESULTS":return qn("opening_tab",{content:l.jsx(gd,{result:{name:t.content.tab.title,url:t.content.tab.url,snippet:"",is_attachment:!1,is_client_context:!0,tab_id:t.content.tab.id},showName:!0,onClick:s})},p("opening_tab"));case"BROWSER_CLOSE_TABS_RESULTS":{const M=t.content.tabs;return qn("closing_tabs",{content:M.length===0?l.jsx(gs,{queries:[h.failedClosedTabs],icon:B("cancel")}):l.jsx(pl,{results:M.map(A=>({name:A.title,url:A.url,snippet:"",is_attachment:!1})),textClassName:A=>{const D="url"in A&&A.url,P="name"in A&&A.name;return D||P?"opacity-65 line-through":""}})},p("closing_tabs"))}case"READ_GMAIL":case"READ_EMAIL":{const M=t.content.queries?.length?t.content.queries:[h.allEmail];return qn("searching_gmail",{content:l.jsx(gs,{queries:M,icon:B("mail-search")})},p("searching_gmail"))}case"READ_GMAIL_RESPONSE":case"READ_EMAIL_RESPONSE":{const M=t.content;return M?.authenticated&&M?.count>0?qn("reading_emails",{content:M.results?l.jsx(pl,{results:M.results,resultType:"email",onClick:s,stepDelay:o,isFinished:r,maxHeight:400}):null},p("reading_emails")):{title:M?.authenticated?h.emailsFound(0):h.gmailNotAuthenticated,content:null}}case"READ_CALENDAR":return qn("searching_calendar",{content:l.jsx(gs,{queries:t.content.queries??[],icon:B("user-scan")})},p("searching_calendar"));case"READ_CALENDAR_RESPONSE":return t.content.authenticated&&(t.content.count??0)>0?qn("reading_events",{content:t.content.results?l.jsx(pl,{results:t.content.results,resultType:"calendar",onClick:s,stepDelay:o,isFinished:r,maxHeight:400}):null},p("reading_events")):{title:t.content.authenticated?h.eventsFound(0):h.googleCalendarNotAuthenticated,content:null};case"UPDATE_CALENDAR":return qn("scheduling",{isFinished:!0,content:t.content?.clarification?l.jsx(ik,{isFinished:!1,question:t.content.clarification,sendStepResult:y}):t.content?.operations?l.jsx(pte,{isFinished:!1,calendarOperations:t.content.operations,sendStepResult:y}):null},p("scheduling"));case"UPDATE_CALENDAR_RESPONSE":return qn("scheduling",{isFinished:!0,content:(()=>{const M=t.content?.operations;return!M||M.length===0?l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:m({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsx(hte,{operations:M})})()},p("scheduling"));case"CREATE_TASKS":{const A=t.content?.task_action;if(!A)return null;if(A.event_group===EKe.FINANCE&&A.event_type&&A.event_entity){const D={ticker_symbol:A.event_entity,target_price:A.target_price,current_price:A.current_price,...A.event_type===kKe.STOCK_PRICE_MOVEMENT&&{movement_percent:Z0(A.upper_bound)?A.upper_bound:Z0(A.lower_bound)?Math.abs(A.lower_bound):void 0,positive_direction:Z0(A.upper_bound),negative_direction:Z0(A.lower_bound)}};return{title:m({defaultMessage:"Setting up price alert",id:"JGiR4/dpaV"}),isFinished:!0,content:l.jsx(pre,{taskAction:A,priceAlertData:D,stepUUID:t.uuid??"",isFinished:r,sendStepResult:y})}}return{title:p("scheduling"),isFinished:!0,content:l.jsx(Mre,{taskAction:A,stepUUID:t.uuid??"",isFinished:r,sendStepResult:y})}}case"CREATE_TASKS_RESPONSE":return{title:p("scheduled"),isFinished:!0,content:l.jsx(Dr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:"Done"})};case"SEND_GMAIL":case"SEND_EMAIL":return f?null:{title:p("emailing"),content:t.content?.clarification?l.jsx(ik,{isFinished:!1,question:t.content.clarification,sendStepResult:y}):t.content?l.jsx(kre,{isFinished:!1,emailAction:t.content.action,sendStepResult:y}):null};case"SEND_GMAIL_RESPONSE":case"SEND_EMAIL_RESPONSE":return{title:p("emailing"),isFinished:!0,content:l.jsx(one,{status:t.content?.status})};case"EMAIL_CALENDAR_AGENT_RESPONSE":case"GMAIL_GCAL_AGENT_RESPONSE":return{title:t.content.authenticated?void 0:h.gmailNotAuthenticated,content:null};case"EMAIL_CALENDAR_AGENT":case"GMAIL_GCAL_AGENT":{const M=MKe(t.content.steps??[]),A=a?M:M.slice(-1);return{content:l.jsx(l.Fragment,{children:A.map(D=>{const P={step_type:D.step_type||"EMAIL_CALENDAR_AGENT",content:D.step_type==="GET_FREEBUSY"&&D.get_free_busy_response_content?{...D.get_free_busy_content,...D.get_free_busy_response_content}:D.get_free_busy_content??D.get_user_info_content??D.get_user_info_response_content??D.send_email_content??D.update_calendar_content??D.update_calendar_response_content??D.send_email_response_content??D.get_free_busy_response_content??D.read_calendar_content??D.read_calendar_response_content??D.read_email_content??D.read_email_response_content??{},uuid:D.uuid||"",assets:void 0},F=a?r||D.originalEndIndex<(t.content.steps?.length??0)-1:r;return l.jsx(k,{step:P,isFinished:F,isNested:i,onStepClick:s,showAllNestedSteps:a,disableAnimations:c},D.uuid)})})}}case"FLIGHTS_SEARCH":{const M=t.content;if(!M)return null;const A=M.found_flights,D=A&&A.length>0,P=M.submitted;return{title:p("searching_flights"),isFinished:D,content:D&&!P?l.jsx(Ene,{stepUUID:t.uuid??"",goalId:M.goal_id??"",foundFlights:M.found_flights,isSubmitted:P??!1,outboundDate:M.outbound_date,returnDate:M.return_date,flightType:M.flight_type}):null}}case"FLIGHTS_SEARCH_RESPONSE":{const{selected_flight:M,submitted:A}=t.content??{},D=p("looking_for_booking_options"),P=M?.flights?.map(H=>H.airline).filter(Boolean).join(", ")||"",F=M?.flights?.[0]?.departure_airport?.id||"",R=M?.flights?.[M.flights.length-1]?.arrival_airport?.id||"",j=M?.total_duration||0,L=Math.floor(j/60),U=j%60,O=L>0?`${L}h ${U}min`:`${U}min`;let $=F;if(M?.flights&&M.flights.length>1)for(let H=1;H ").pop()&&($+=` -> ${Q}`)}$+=` -> ${R}`;const G=`${P} (${$}): ${O}`;return A&&M?{title:D,isFinished:r||f,content:l.jsx(gs,{queries:[G],icon:B("plane-inflight")})}:null}case"FLIGHTS_BOOKING":{const M=t.content;if(!M)return null;const A=M.found_booking_options,D=A&&A.length>0,P=M.submitted;return{title:p("reviewing_booking_options"),isFinished:D,content:D?l.jsx(Cne,{stepUUID:t.uuid??"",goalId:M.goal_id??"",foundBookingOptions:M.found_booking_options,isSubmitted:P??!1}):null}}case"FLIGHTS_BOOKING_RESPONSE":{const{selected_booking_options:M,submitted:A}=t.content??{},D=p("redirecting_to_booking");return A&&M?{title:D,isFinished:r||f,content:(()=>{const P=F=>{const R=[];return F.together?.book_with?R.push(F.together.book_with):(F.departing?.book_with&&R.push(`Departing: ${F.departing.book_with}`),F.returning?.book_with&&R.push(`Returning: ${F.returning.book_with}`)),R.join(" | ")||"Booking options"};return l.jsx(gs,{queries:[P(M)],icon:B("brand-booking")})})()}:null}case"FLIGHTS_AGENT":{const M=TKe(t.content.steps??[]),A=a?M:M.slice(-1);return{content:l.jsx(l.Fragment,{children:A.map(D=>{const P={step_type:D.step_type||"FLIGHTS_AGENT",content:D.browser_open_tab_content??D.browser_open_tab_results_content??D.flights_search_content??D.flights_booking_content??D.flights_search_response_content??D.flights_booking_response_content??{},uuid:D.uuid||"",assets:void 0},F=a?r||D.originalEndIndex<(t.content.steps?.length??0)-1:r;return l.jsx(k,{step:P,isFinished:F,isNested:i,onStepClick:s,showAllNestedSteps:a,disableAnimations:c},D.uuid)})})}}case"TERMINATE":return qn("conclusion",{content:t.content.reason?l.jsx(K,{variant:"subtler",className:"py-xs inline-block rounded-lg px-2.5",children:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.reason})}):null},p("conclusion"));case"CANVAS_AGENT":{const M=t.content.asset_types??[],A={CODE_FILE:"a file",PDF_FILE:"a PDF",DOCX_FILE:"a document",XLSX_FILE:"a spreadsheet",APP:"an app",SLIDES:"slides"};return{content:l.jsx(gte,{assetTypes:M,assetTypeLabels:A,isFinished:r})}}case"GENERATE_IMAGE":{const M=t.content.success;return{title:p("generating_images"),content:l.jsx(lne,{prompt:t.content.prompt,success:M})}}case"GENERATE_VIDEO":return qn("generating_images",{content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.prompt})},p("generating_images"));case"GENERATE_VIDEO_RESULTS":return qn("presenting_images",{content:!g&&l.jsx(ane,{urls:t.content.video_results.map(M=>M.url??""),onClick:s})},p("presenting_images"));case"BROWSER_GROUP_TABS":return qn("grouping_tabs",{content:t.content.payloads?.length>0?l.jsx("div",{className:"gap-sm flex flex-row flex-wrap",children:t.content.payloads.map((M,A)=>l.jsx($E,{color:M.color,title:M.title??""},A))}):null},p("grouping_tabs"));case"BROWSER_GROUP_TABS_RESULTS":return{content:t.content.success?null:l.jsx(Dr,{icon:B("cancel"),text:h.couldNotFinish})};case"BROWSER_UNGROUP":return{title:p("ungrouping_tabs"),content:t.content.payload?.groups_metadata&&t.content.payload.groups_metadata.length>0?(()=>{const M=t.content.payload.groups_metadata.map((A,D)=>({name:A.title||`Group ${D+1}`,url:"",source:A.title||`Group ${D+1}`}));return M.length===1?l.jsx(gs,{queries:t.content.payload.groups_metadata.map(A=>A.title||"Unnamed Group"),initialDisplayCount:3,icon:B("folders")}):l.jsx(pl,{results:M,icon:B("folders"),textClassName:"opacity-65 line-through decoration-subtle"})})():null};case"BROWSER_SEARCH_TAB_GROUPS":return{title:p("searching_tab_groups"),content:l.jsx(gs,{queries:t.content.payload?.queries?.length?t.content.payload.queries:[h.allTabGroups],icon:B("user-scan")})};case"BROWSER_SEARCH_TAB_GROUPS_RESULT":return{title:p("reading"),content:t.content.results.length>0?l.jsx("div",{className:"gap-sm flex flex-row flex-wrap",children:t.content.results.map((M,A)=>l.jsx($E,{color:M.color,title:M.title??""},A))}):null};case"GET_USER_INFO":{const M=t.content;if(!M||!M.names)return null;const A=M.found_users,D=A&&A.length>0,P=M.submitted,F=D&&!P?"found_contacts":"getting_user_info";return qn(F,{content:D&&!P?l.jsx(wne,{goalId:M.goal_id??"",foundUsers:M.found_users,names:M.names,sendStepResult:y}):l.jsx(gs,{queries:M.names,icon:B("user-search")})},p(F))}case"GET_USER_INFO_RESPONSE":{const{submitted:M,selected_users:A}=t.content??{},D=A?.some(F=>F.selected===!0),P=D?"selecting_contacts":"getting_contact_details";return M&&A?qn(P,{content:A.length===0?l.jsx(gs,{queries:[p("no_contacts_found")],icon:B("address-book-off")}):A.length===1?l.jsx(gs,{queries:A.map(F=>`${F.display_name||""} ${F.email_address?`(${F.email_address})`:""}`.trim()),icon:B("address-book")}):l.jsx(pl,{results:A.map(F=>({...F,url:F.email_address?`mailto:${F.email_address}`:void 0})),icon:B("address-book"),resultType:"userinfo",textClassName:F=>{const R="email_address"in F?F.email_address:void 0,j=A?.find(L=>L.email_address===R);return D&&j?.selected===!1?"opacity-65 line-through decoration-subtle":""}})},p(P)):null}case"GET_FREEBUSY":{const M=t.content;return{title:p("getting_freebusy"),content:(()=>{const A=M.free_busy_response?.available_periods?.length??0;let D,P;return!M.authenticated&&r?(D=h.googleCalendarNotAuthenticated,P=B("calendar-off")):A===0&&r?(D=h.noAvailabilityFound,P=B("calendar-off")):A>0&&(D=h.availableTimesFound(A),P=B("calendar-week")),D?l.jsx(Dr,{text:D,icon:P}):null})()}}case"GET_FREEBUSY_RESPONSE":return{title:p("getting_freebusy"),content:(()=>{const M=t.content.free_busy_response?.available_periods?.length??0;let A,D;return!t.content.authenticated&&r?(A=h.googleCalendarNotAuthenticated,D=B("calendar-off")):M===0&&r?(A=h.noAvailabilityFound,D=B("calendar-off")):M>0&&(A=h.availableTimesFound(M),D=B("calendar-week")),A?l.jsx(Dr,{text:A,icon:D}):null})()};case"PENDING_FILES":return{content:l.jsx(bne,{attachments:t.content.attachments,attachmentProcessingProgress:t.content.attachmentProcessingProgress})};case"SEARCH_BROWSER":{const M=t.content.queries?.filter(D=>D!=null&&D.trim()!=="")||[],A=M.length>0?M:t.content.browser_content_sources?.map(D=>D in Ri?p(D):SKe(D))||[];return{title:p("searching_browser"),content:l.jsx(gs,{queries:A,isFinished:r})}}case"SEARCH_BROWSER_RESULTS":return qn("reading_browser",{count:x,content:(()=>{const{open_tabs:M,recently_closed_tabs:A,history:D}=t.content,P=(M?.length||0)+(A?.length||0)+(D?.length||0);if(P===0)return l.jsx(Dr,{icon:B("zoom-out"),text:m({defaultMessage:"No sources found",id:"yWSiuEkfbY"})});if(P===1){const R=M?.[0]||A?.[0]||D?.[0];return l.jsx(gd,{result:{...R},showName:!0,onClick:s})}const F=[];return M&&M.length>0&&F.push(...M.map(R=>({...R,category:"open_tab"}))),A&&A.length>0&&F.push(...A.map(R=>({...R,category:"closed_tab"}))),D&&D.length>0&&F.push(...D.map(R=>({...R,category:"history"}))),l.jsx(pl,{onClick:s,results:F,groupBy:"category",stepDelay:n?2:void 0,isFinished:r,onCountChange:v})})()},p("reading_browser"));case"MCP_TOOL_INPUT":{const M=t.content,A=M.source_type;if("authenticated"in M&&(M.authenticated===void 0||M.authenticated===null))return null;let D=m({id:"bTDpQ+Tk24",defaultMessage:"external service"});M.mcp_server_type==="MCP_SERVER_TYPE_LOCAL"?D=m({id:"0asQ8snMnq",defaultMessage:"local MCP"}):M?.app&&(D=M.app);const P=M.request_user_approval?.uuid;return qn("MCP_TOOL",{content:l.jsxs(l.Fragment,{children:[l.jsx(gne,{step:t,isFinished:r,onActionTaken:()=>w(!1)}),S&&l.jsx("div",{className:"mt-2",children:l.jsx(XJ,{entryUUID:C?.backend_uuid??"",sourceType:A,sourceName:D,userApprovalUuid:P,onSkipSourceClicked:()=>w(!0),isAutoDetected:A?!E.includes(A):!1})})]})},p("MCP_TOOL",{appName:D}))}case"MCP_TOOL_OUTPUT":{const M=t.content;return qn("MCP_TOOL",{content:l.jsx(xne,{content:M.content||"",shouldRerunQuery:!!M.should_rerun_query})},p("MCP_TOOL"))}case"RESEARCH_CLARIFYING_QUESTIONS":{const M=t.content.questions||[],A=t.content.auto_skip_seconds;return{content:l.jsx(Are,{questions:M,toolUuid:t.content.uuid||t.uuid,autoSkipSeconds:A,isFinished:r,entryUuid:C?.backend_uuid})}}case"COMET_AGENT_TOOL_INPUT":{const M=t.content.tool_input;if(M?.todo_write){const j=_?.findIndex($=>$.uuid===t.uuid)??-1,U=_?.some(($,G)=>G>=j?!1:$?.step_type==="COMET_AGENT_TOOL_INPUT"&&"tool_input"in $.content&&$.content.tool_input?.todo_write)??!1?"updating_todo_list":"creating_todo_list",O=M.todo_write.todos||[];return{actionKey:U,content:l.jsxs(l.Fragment,{children:[l.jsx(Di,{action:U,isFinished:r,className:"mb-two",showAnimation:c}),l.jsx(qJ,{todos:O})]})}}else if(M?.subagent_tool_inputs){const j="running_sub_tasks";return{actionKey:j,content:l.jsxs(l.Fragment,{children:[l.jsx(Di,{action:j,isFinished:r,className:"mb-two",showAnimation:c}),l.jsx(eFe,{tool_input_content:t.content})]})}}const A=j=>{let L;return j?.action=="type"&&j.text?L=`: ${sy(j.text,35)}`:j?.action=="key"?L=`: ${j.text}`:j?.action=="wait"&&(L=j.duration===1?` ${j.duration} second`:` ${j.duration} seconds`),L},D=M?.computer_list?.actions;if(D&&D.length>0){const j=M?.computer_list?.uuid,L=b[j??""]??[],U=r?D:L,O=U[U.length-1]?.action,$=O&&O in Ri?O:"working";return qn($,{content:l.jsx(l.Fragment,{children:U.map((G,H)=>{const Q=G.action,Y=Q&&Q in Ri?Q:"working",te=A(G),se=H===U.length-1;return l.jsx(Di,{title:te,action:Y,isFinished:r||!se,className:"-my-1.5",showAnimation:c},H)})})})}const P=M?.computer?M.computer.action:Object.entries(M??{}).find(([j,L])=>L)?.[0],F=P&&P in Ri?P:"working";let R;return M?.navigate?.url?M.navigate.url==="forward"||M.navigate.url==="back"?R=` ${M.navigate.url}`:R=` to ${sy(M.navigate.url,35)}`:M?.find&&M.find.query?R=`: ${sy(M.find.query,35)}`:M?.computer?R=A(M.computer):M?.bash?M.bash.description?R=`${M.bash.description}`:R="Running a command":M?.file_read?R=` ${M.file_read.file_name}`:M?.file_write?R=` ${M.file_write.file_name}`:M?.file_edit&&(R=` ${M.file_edit.file_name}`),P?qn(F,{content:l.jsx(Di,{action:F,title:R,isFinished:r,className:"-my-1.5",showAnimation:c})}):null}case"COMET_AGENT_TOOL_OUTPUT":{const M=t.content.tool_output,A=M?.computer?.screenshot_uuid||M?.tabs_create?.screenshot_uuid||M?.navigate?.screenshot_uuid||M?.form_input?.screenshot_uuid,D=M?.computer?.screenshots||M?.tabs_create?.screenshots||M?.navigate?.screenshots||M?.form_input?.screenshots;return N?null:{content:l.jsx(rne,{isFinished:r,screenshot_uuid:A,screenshots:D})}}default:return null}}const NKe=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"hide-screenshots-in-sidecar",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function RKe(e){const{action:t,streamId:n,inFlight:r}=e,s=Io();d.useEffect(()=>{if(!s||!n||!t||!r)return;const o=new CustomEvent("comet-agent-step-update",{detail:{stepAction:t,streamId:n}});document.dispatchEvent(o)},[t,s,n,r])}const sN=e=>{const{searchMode:t,hasAnswer:n,result:r,inFlight:s,skippedSources:o,steps:a}=Ot(),i=t===oe.STUDIO,{taskComputerActions:c}=zn(),{$t:u}=J(),{step:f,onStepClick:m,isFinished:p,stepDelay:h,motionProps:g,isNested:y=!1,showAllNestedSteps:x=!0,isMissionControl:v=!1,disableAnimations:b=!1}=e,[_,w]=d.useState(void 0),[S,C]=d.useState(void 0),E=f.step_type==="MCP_TOOL_INPUT"?f.content.source_type:void 0,N=Array.from(r?.sources?.sources??[]),k=XLe({sourceType:E,skippedSources:new Set(o)}),{variation:I}=NKe(!1),M=f.step_type==="MCP_TOOL_INPUT"?f.content.app:void 0,A=T.useMemo(()=>S!==void 0?S:k&&!p&&!!r?.backend_uuid&&f.step_type==="MCP_TOOL_INPUT"&&!!M,[S,k,p,r?.backend_uuid,f.step_type,M]),D=d.useCallback(async(ce,ue)=>{f.uuid&&await eh({contextUUID:r?.context_uuid,stepUUID:f.uuid,result:ce,reason:ue})},[f.uuid,r]),P=d.useCallback(async()=>{await D({confirmed:!0},"thread-upsell-accepted")},[D]),F=d.useCallback(async()=>{await D({confirmed:!1},"thread-upsell-dismissed")},[D]),R=(ce,ue)=>{const pe=Ri[ce]?.message;return pe?ue?u(pe,ue):u(pe):""},j=JLe(),L=f.assets&&f.assets.length>0?l.jsx("div",{className:"gap-sm my-sm flex flex-row flex-wrap",children:f.assets.map(ce=>l.jsx(nne,{asset:ce},ce.uuid))}):null,U=f.step_type,O=f.content.should_show_upsell??!1,$=f.content.upsell_information,G=l.jsx(Jd,{position:"router_steps",upsellInformation:$,inFlight:!p,stepUUID:f.uuid,backendUuid:$?.backend_uuid,isLastResult:!0,onAccept:P,onReject:F}),H=AKe({step:f,isStudio:i,isFinished:p,onStepClick:m,stepDelay:h,showAllNestedSteps:x,isNested:y,disableAnimations:b,isMissionControl:v,hasAnswer:n,$t:u,getActionMessage:R,translations:j,assetsContent:L,sendStepResult:D,stepCount:_,setStepCount:w,taskComputerActions:c,allSteps:a,setShouldShowSkipButtonOverride:C,shouldShowSourceSkipButton:A,entryResult:r,enabledSources:N,shouldHideScreenshotsInSidecar:I,StepRendererComponent:sN});if(RKe({action:H?.actionKey,streamId:r?.uuid,inFlight:s}),!H)return v?l.jsx(Di,{title:R("working"),showAnimation:b,className:"mt-sm"}):null;const{title:Q,content:Y,count:te,isFinished:se}=H,ae=O&&$?!0:se??p??!1,X={key:f.uuid,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"mt-1.5 empty:hidden"},ee={...X,...g,className:g?.className?`${X.className} ${g.className}`:X.className},{key:le,...re}=ee;return l.jsxs(Te.div,{...re,children:[Q&&l.jsx(Di,{title:Q,isFinished:ae,className:"mb-two",count:te,showAnimation:b}),!Q&&v&&!ae&&U!=="ENTROPY_REQUEST"&&l.jsx(Di,{title:R("working"),showAnimation:b,className:"mb-two"}),O&&$?G:Y,L]},le)};sN.displayName="StepRenderer";const DKe={xs:7,sm:9,md:11,lg:15},Pre=T.memo(({state:e,className:t,size:n="md",showFinishedIcon:r=!0})=>{const s=DKe[n],o={width:s,height:s,backfaceVisibility:"hidden"},a=d.useMemo(()=>({height:`calc(100% - ${s/3}px)`}),[s]);return e==="hidden"?null:l.jsxs("div",{className:z({relative:!t?.includes("absolute")&&!t?.includes("relative")},t),children:[l.jsx("div",{className:z("shrink-0 rounded-full border",{"bg-base border-subtler":e==="planned","bg-inverse/25 dark:bg-inverse/20 flex border-transparent":e==="finished","border-super bg-super":e==="loading"}),style:o,children:e==="finished"&&r&&l.jsx("div",{className:"relative flex size-full bg-transparent transition-opacity ease-linear",children:l.jsx(ge,{icon:B("check"),className:"text-inverse w-full place-self-center",stroke:4,style:a})})}),e==="loading"&&l.jsx("div",{className:"border-super absolute left-0 top-0 animate-ping rounded-full border-2 opacity-75",style:o})]})});Pre.displayName="StatusDot";const Ore=T.memo(({status:e,state:t,showStatus:n,timelineConnectorClassName:r,hasSteps:s,isFinalGoal:o=!1})=>n?l.jsxs("span",{className:"relative flex w-[15px] shrink-0 flex-col items-center",children:[l.jsx("span",{className:z(r,"h-[13px]","group-first/goal:opacity-0 group-only/goal:opacity-0")}),n&&l.jsx(Te.div,{animate:{scale:e==="loading"?1.1:1,transition:{duration:.2,ease:Xd}},children:l.jsx("div",{className:"bg-base",children:l.jsx(Pre,{state:t,showFinishedIcon:!1,size:"xs"})})}),!o&&l.jsx("span",{className:z(r,"grow",!s&&"group-last/goal:opacity-0")})]}):null);Ore.displayName="Timeline";function oN(){const{value:e}=qt({flag:"move-citations-to-paragraph-end",subjectType:"visitor_id",defaultValue:!0});return e}typeof globalThis<"u"&&(globalThis.__useMoveCitationsToParagraphEnd=oN);function d_t(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const a=n.slice(s,r).trim();(a||!o)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function jKe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const IKe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PKe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OKe={};function nO(e,t){return(OKe.jsx?PKe:IKe).test(e)}const LKe=/[ \t\n\f\r]/g;function FKe(e){return typeof e=="object"?e.type==="text"?rO(e.value):!1:rO(e)}function rO(e){return e.replace(LKe,"")===""}class qg{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qg.prototype.normal={};qg.prototype.property={};qg.prototype.space=void 0;function Lre(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new qg(n,r,t)}function lk(e){return e.toLowerCase()}class Gs{constructor(t,n){this.attribute=n,this.property=t}}Gs.prototype.attribute="";Gs.prototype.booleanish=!1;Gs.prototype.boolean=!1;Gs.prototype.commaOrSpaceSeparated=!1;Gs.prototype.commaSeparated=!1;Gs.prototype.defined=!1;Gs.prototype.mustUseProperty=!1;Gs.prototype.number=!1;Gs.prototype.overloadedBoolean=!1;Gs.prototype.property="";Gs.prototype.spaceSeparated=!1;Gs.prototype.space=void 0;let BKe=0;const Lt=_u(),xr=_u(),Fre=_u(),Oe=_u(),In=_u(),Md=_u(),qs=_u();function _u(){return 2**++BKe}const ck=Object.freeze(Object.defineProperty({__proto__:null,boolean:Lt,booleanish:xr,commaOrSpaceSeparated:qs,commaSeparated:Md,number:Oe,overloadedBoolean:Fre,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),Qw=Object.keys(ck);class aN extends Gs{constructor(t,n,r,s){let o=-1;if(super(t,n),sO(this,"space",s),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&WKe.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(oO,qKe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!oO.test(o)){let a=o.replace(zKe,$Ke);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=aN}return new s(r,t)}function $Ke(e){return"-"+e.toLowerCase()}function qKe(e){return e.charAt(1).toUpperCase()}const KKe=Lre([Bre,UKe,Hre,zre,Wre],"html"),iN=Lre([Bre,VKe,Hre,zre,Wre],"svg");function YKe(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function QKe(e){return e.join(" ").trim()}var Hu={},Xw,aO;function XKe(){if(aO)return Xw;aO=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,i=/^\s+|\s+$/g,c=` -`,u="/",f="*",m="",p="comment",h="declaration";Xw=function(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var v=1,b=1;function _(D){var P=D.match(t);P&&(v+=P.length);var F=D.lastIndexOf(c);b=~F?D.length-F:b+D.length}function w(){var D={line:v,column:b};return function(P){return P.position=new S(D),N(),P}}function S(D){this.start=D,this.end={line:v,column:b},this.source=x.source}S.prototype.content=y;function C(D){var P=new Error(x.source+":"+v+":"+b+": "+D);if(P.reason=D,P.filename=x.source,P.line=v,P.column=b,P.source=y,!x.silent)throw P}function E(D){var P=D.exec(y);if(P){var F=P[0];return _(F),y=y.slice(F.length),P}}function N(){E(n)}function k(D){var P;for(D=D||[];P=I();)P!==!1&&D.push(P);return D}function I(){var D=w();if(!(u!=y.charAt(0)||f!=y.charAt(1))){for(var P=2;m!=y.charAt(P)&&(f!=y.charAt(P)||u!=y.charAt(P+1));)++P;if(P+=2,m===y.charAt(P-1))return C("End of comment missing");var F=y.slice(2,P-2);return b+=2,_(F),y=y.slice(P),b+=2,D({type:p,comment:F})}}function M(){var D=w(),P=E(r);if(P){if(I(),!E(s))return C("property missing ':'");var F=E(o),R=D({type:h,property:g(P[0].replace(e,m)),value:F?g(F[0].replace(e,m)):m});return E(a),R}}function A(){var D=[];k(D);for(var P;P=M();)P!==!1&&(D.push(P),k(D));return D}return N(),A()};function g(y){return y?y.replace(i,m):m}return Xw}var iO;function ZKe(){if(iO)return Hu;iO=1;var e=Hu&&Hu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.default=n;var t=e(XKe());function n(r,s){var o=null;if(!r||typeof r!="string")return o;var a=(0,t.default)(r),i=typeof s=="function";return a.forEach(function(c){if(c.type==="declaration"){var u=c.property,f=c.value;i?s(u,f,c):f&&(o=o||{},o[u]=f)}}),o}return Hu}var Bm={},lO;function JKe(){if(lO)return Bm;lO=1,Object.defineProperty(Bm,"__esModule",{value:!0}),Bm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},a=function(u,f){return f.toUpperCase()},i=function(u,f){return"".concat(f,"-")},c=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(s,i):u=u.replace(r,i),u.replace(t,a))};return Bm.camelCase=c,Bm}var Um,cO;function eYe(){if(cO)return Um;cO=1;var e=Um&&Um.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(ZKe()),n=JKe();function r(s,o){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(i,c){i&&c&&(a[(0,n.camelCase)(i,o)]=c)}),a}return r.default=r,Um=r,Um}var tYe=eYe();const nYe=uo(tYe),Gre=$re("end"),lN=$re("start");function $re(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function rYe(e){const t=lN(e),n=Gre(e);if(t&&n)return{start:t,end:n}}function Lp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uO(e.position):"start"in e||"end"in e?uO(e):"line"in e||"column"in e?uk(e):""}function uk(e){return dO(e&&e.line)+":"+dO(e&&e.column)}function uO(e){return uk(e&&e.start)+"-"+uk(e&&e.end)}function dO(e){return e&&typeof e=="number"?e:1}class us extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(a=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const i=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=i?i.line:void 0,this.name=Lp(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}us.prototype.file="";us.prototype.name="";us.prototype.reason="";us.prototype.message="";us.prototype.stack="";us.prototype.column=void 0;us.prototype.line=void 0;us.prototype.ancestors=void 0;us.prototype.cause=void 0;us.prototype.fatal=void 0;us.prototype.place=void 0;us.prototype.ruleId=void 0;us.prototype.source=void 0;const cN={}.hasOwnProperty,sYe=new Map,oYe=/[A-Z]/g,aYe=new Set(["table","tbody","thead","tfoot","tr"]),iYe=new Set(["td","th"]),qre="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lYe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gYe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=hYe(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?iN:KKe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kre(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function Kre(e,t,n){if(t.type==="element")return cYe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uYe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fYe(e,t,n);if(t.type==="mdxjsEsm")return dYe(e,t);if(t.type==="root")return mYe(e,t,n);if(t.type==="text")return pYe(e,t)}function cYe(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=iN,e.schema=s),e.ancestors.push(t);const o=Qre(e,t.tagName,!1),a=yYe(e,t);let i=dN(e,t);return aYe.has(t.tagName)&&(i=i.filter(function(c){return typeof c=="string"?!FKe(c):!0})),Yre(e,a,o,t),uN(a,i),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function uYe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}kh(e,t.position)}function dYe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kh(e,t.position)}function fYe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=iN,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:Qre(e,t.name,!0),a=xYe(e,t),i=dN(e,t);return Yre(e,a,o,t),uN(a,i),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function mYe(e,t,n){const r={};return uN(r,dN(e,t)),e.create(t,e.Fragment,r,n)}function pYe(e,t){return t.value}function Yre(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hYe(e,t,n){return r;function r(s,o,a,i){const u=Array.isArray(a.children)?n:t;return i?u(o,a,i):u(o,a)}}function gYe(e,t){return n;function n(r,s,o,a){const i=Array.isArray(o.children),c=lN(r);return t(s,o,a,i,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function yYe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&cN.call(t.properties,s)){const o=vYe(e,s,t.properties[s]);if(o){const[a,i]=o;e.tableCellAlignToStyle&&a==="align"&&typeof i=="string"&&iYe.has(t.tagName)?r=i:n[a]=i}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function xYe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const i=a.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else kh(e,t.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const i=r.value.data.estree.body[0];i.type,o=e.evaluater.evaluateExpression(i.expression)}else kh(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function dN(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:sYe;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(io(e,e.length,0,t),e):t}const pO={}.hasOwnProperty;function Zre(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vs=ac(/[A-Za-z]/),is=ac(/[\dA-Za-z]/),TYe=ac(/[#-'*+\--9=?A-Z^-~]/);function P2(e){return e!==null&&(e<32||e===127)}const dk=ac(/\d/),AYe=ac(/[\dA-Fa-f]/),NYe=ac(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function Rn(e){return e!==null&&(e<0||e===32)}function Qt(e){return e===-2||e===-1||e===32}const db=ac(new RegExp("\\p{P}|\\p{S}","u")),nu=ac(/\s/);function ac(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function am(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&o<57344){const i=e.charCodeAt(n+1);o<56320&&i>56319&&i<57344?(a=String.fromCharCode(o,i),s=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ht(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(c){return Qt(c)?(e.enter(n),i(c)):t(c)}function i(c){return Qt(c)&&o++a))return;const E=t.events.length;let N=E,k,I;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(k){I=t.events[N][1].end;break}k=!0}for(v(r),C=E;C_;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=_}function b(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function PYe(e,t,n){return Ht(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ff(e){if(e===null||Rn(e)||nu(e))return 1;if(db(e))return 2}function fb(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},p={...e[n][1].start};gO(m,-c),gO(p,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},i={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[r][1].end={...a.start},e[n][1].start={...i.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=wo(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=wo(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=wo(u,fb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=wo(u,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=wo(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,io(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&Qt(C)?Ht(e,b,"linePrefix",o+1)(C):b(C)}function b(C){return C===null||st(C)?e.check(yO,y,w)(C):(e.enter("codeFlowValue"),_(C))}function _(C){return C===null||st(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),_)}function w(C){return e.exit("codeFenced"),t(C)}function S(C,E,N){let k=0;return I;function I(F){return C.enter("lineEnding"),C.consume(F),C.exit("lineEnding"),M}function M(F){return C.enter("codeFencedFence"),Qt(F)?Ht(C,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):A(F)}function A(F){return F===i?(C.enter("codeFencedFenceSequence"),D(F)):N(F)}function D(F){return F===i?(k++,C.consume(F),D):k>=a?(C.exit("codeFencedFenceSequence"),Qt(F)?Ht(C,P,"whitespace")(F):P(F)):N(F)}function P(F){return F===null||st(F)?(C.exit("codeFencedFence"),E(F)):N(F)}}}function qYe(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Jw={name:"codeIndented",tokenize:YYe},KYe={partial:!0,tokenize:QYe};function YYe(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Ht(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):st(u)?e.attempt(KYe,a,c)(u):(e.enter("codeFlowValue"),i(u))}function i(u){return u===null||st(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),i)}function c(u){return e.exit("codeIndented"),t(u)}}function QYe(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):st(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Ht(e,o,"linePrefix",5)(a)}function o(a){const i=r.events[r.events.length-1];return i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):st(a)?s(a):n(a)}}const XYe={name:"codeText",previous:JYe,resolve:ZYe,tokenize:eQe};function ZYe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Vm(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function sse(e,t,n,r,s,o,a,i,c){const u=c||Number.POSITIVE_INFINITY;let f=0;return m;function m(v){return v===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||P2(v)?n(v):(e.enter(r),e.enter(a),e.enter(i),e.enter("chunkString",{contentType:"string"}),y(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(s),e.exit(r),t):(e.enter(i),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(e.exit("chunkString"),e.exit(i),p(v)):v===null||v===60||st(v)?n(v):(e.consume(v),v===92?g:h)}function g(v){return v===60||v===62||v===92?(e.consume(v),h):h(v)}function y(v){return!f&&(v===null||v===41||Rn(v))?(e.exit("chunkString"),e.exit(i),e.exit(a),e.exit(r),t(v)):f999||h===null||h===91||h===93&&!c||h===94&&!i&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(e.exit(o),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):st(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),m(h))}function m(h){return h===null||h===91||h===93||st(h)||i++>999?(e.exit("chunkString"),f(h)):(e.consume(h),c||(c=!Qt(h)),h===92?p:m)}function p(h){return h===91||h===92||h===93?(e.consume(h),i++,m):m(h)}}function ase(e,t,n,r,s,o){let a;return i;function i(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,c):n(p)}function c(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),c(a)):p===null?n(p):st(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ht(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||st(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?m:f)}function m(p){return p===a||p===92?(e.consume(p),f):f(p)}}function Fp(e,t){let n;return r;function r(s){return st(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Qt(s)?Ht(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const lQe={name:"definition",tokenize:uQe},cQe={partial:!0,tokenize:dQe};function uQe(e,t,n){const r=this;let s;return o;function o(h){return e.enter("definition"),a(h)}function a(h){return ose.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function i(h){return s=ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):n(h)}function c(h){return Rn(h)?Fp(e,u)(h):u(h)}function u(h){return sse(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(cQe,m,m)(h)}function m(h){return Qt(h)?Ht(e,p,"whitespace")(h):p(h)}function p(h){return h===null||st(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function dQe(e,t,n){return r;function r(i){return Rn(i)?Fp(e,s)(i):n(i)}function s(i){return ase(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function o(i){return Qt(i)?Ht(e,a,"whitespace")(i):a(i)}function a(i){return i===null||st(i)?t(i):n(i)}}const fQe={name:"hardBreakEscape",tokenize:mQe};function mQe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return st(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const pQe={name:"headingAtx",resolve:hQe,tokenize:gQe};function hQe(e,t){let n=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},io(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function gQe(e,t,n){let r=0;return s;function s(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Rn(f)?(e.exit("atxHeadingSequence"),i(f)):n(f)}function i(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||st(f)?(e.exit("atxHeading"),t(f)):Qt(f)?Ht(e,i,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),i(f))}function u(f){return f===null||f===35||Rn(f)?(e.exit("atxHeadingText"),i(f)):(e.consume(f),u)}}const yQe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vO=["pre","script","style","textarea"],xQe={concrete:!0,name:"htmlFlow",resolveTo:_Qe,tokenize:wQe},vQe={partial:!0,tokenize:SQe},bQe={partial:!0,tokenize:CQe};function _Qe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wQe(e,t,n){const r=this;let s,o,a,i,c;return u;function u(H){return f(H)}function f(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),m}function m(H){return H===33?(e.consume(H),p):H===47?(e.consume(H),o=!0,y):H===63?(e.consume(H),s=3,r.interrupt?t:O):vs(H)?(e.consume(H),a=String.fromCharCode(H),x):n(H)}function p(H){return H===45?(e.consume(H),s=2,h):H===91?(e.consume(H),s=5,i=0,g):vs(H)?(e.consume(H),s=4,r.interrupt?t:O):n(H)}function h(H){return H===45?(e.consume(H),r.interrupt?t:O):n(H)}function g(H){const Q="CDATA[";return H===Q.charCodeAt(i++)?(e.consume(H),i===Q.length?r.interrupt?t:A:g):n(H)}function y(H){return vs(H)?(e.consume(H),a=String.fromCharCode(H),x):n(H)}function x(H){if(H===null||H===47||H===62||Rn(H)){const Q=H===47,Y=a.toLowerCase();return!Q&&!o&&vO.includes(Y)?(s=1,r.interrupt?t(H):A(H)):yQe.includes(a.toLowerCase())?(s=6,Q?(e.consume(H),v):r.interrupt?t(H):A(H)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(H):o?b(H):_(H))}return H===45||is(H)?(e.consume(H),a+=String.fromCharCode(H),x):n(H)}function v(H){return H===62?(e.consume(H),r.interrupt?t:A):n(H)}function b(H){return Qt(H)?(e.consume(H),b):I(H)}function _(H){return H===47?(e.consume(H),I):H===58||H===95||vs(H)?(e.consume(H),w):Qt(H)?(e.consume(H),_):I(H)}function w(H){return H===45||H===46||H===58||H===95||is(H)?(e.consume(H),w):S(H)}function S(H){return H===61?(e.consume(H),C):Qt(H)?(e.consume(H),S):_(H)}function C(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),c=H,E):Qt(H)?(e.consume(H),C):N(H)}function E(H){return H===c?(e.consume(H),c=null,k):H===null||st(H)?n(H):(e.consume(H),E)}function N(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Rn(H)?S(H):(e.consume(H),N)}function k(H){return H===47||H===62||Qt(H)?_(H):n(H)}function I(H){return H===62?(e.consume(H),M):n(H)}function M(H){return H===null||st(H)?A(H):Qt(H)?(e.consume(H),M):n(H)}function A(H){return H===45&&s===2?(e.consume(H),R):H===60&&s===1?(e.consume(H),j):H===62&&s===4?(e.consume(H),$):H===63&&s===3?(e.consume(H),O):H===93&&s===5?(e.consume(H),U):st(H)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(vQe,G,D)(H)):H===null||st(H)?(e.exit("htmlFlowData"),D(H)):(e.consume(H),A)}function D(H){return e.check(bQe,P,G)(H)}function P(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),F}function F(H){return H===null||st(H)?D(H):(e.enter("htmlFlowData"),A(H))}function R(H){return H===45?(e.consume(H),O):A(H)}function j(H){return H===47?(e.consume(H),a="",L):A(H)}function L(H){if(H===62){const Q=a.toLowerCase();return vO.includes(Q)?(e.consume(H),$):A(H)}return vs(H)&&a.length<8?(e.consume(H),a+=String.fromCharCode(H),L):A(H)}function U(H){return H===93?(e.consume(H),O):A(H)}function O(H){return H===62?(e.consume(H),$):H===45&&s===2?(e.consume(H),O):A(H)}function $(H){return H===null||st(H)?(e.exit("htmlFlowData"),G(H)):(e.consume(H),$)}function G(H){return e.exit("htmlFlow"),t(H)}}function CQe(e,t,n){const r=this;return s;function s(a){return st(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function SQe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Kg,t,n)}}const EQe={name:"htmlText",tokenize:kQe};function kQe(e,t,n){const r=this;let s,o,a;return i;function i(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),S):O===63?(e.consume(O),_):vs(O)?(e.consume(O),N):n(O)}function u(O){return O===45?(e.consume(O),f):O===91?(e.consume(O),o=0,g):vs(O)?(e.consume(O),b):n(O)}function f(O){return O===45?(e.consume(O),h):n(O)}function m(O){return O===null?n(O):O===45?(e.consume(O),p):st(O)?(a=m,j(O)):(e.consume(O),m)}function p(O){return O===45?(e.consume(O),h):m(O)}function h(O){return O===62?R(O):O===45?p(O):m(O)}function g(O){const $="CDATA[";return O===$.charCodeAt(o++)?(e.consume(O),o===$.length?y:g):n(O)}function y(O){return O===null?n(O):O===93?(e.consume(O),x):st(O)?(a=y,j(O)):(e.consume(O),y)}function x(O){return O===93?(e.consume(O),v):y(O)}function v(O){return O===62?R(O):O===93?(e.consume(O),v):y(O)}function b(O){return O===null||O===62?R(O):st(O)?(a=b,j(O)):(e.consume(O),b)}function _(O){return O===null?n(O):O===63?(e.consume(O),w):st(O)?(a=_,j(O)):(e.consume(O),_)}function w(O){return O===62?R(O):_(O)}function S(O){return vs(O)?(e.consume(O),C):n(O)}function C(O){return O===45||is(O)?(e.consume(O),C):E(O)}function E(O){return st(O)?(a=E,j(O)):Qt(O)?(e.consume(O),E):R(O)}function N(O){return O===45||is(O)?(e.consume(O),N):O===47||O===62||Rn(O)?k(O):n(O)}function k(O){return O===47?(e.consume(O),R):O===58||O===95||vs(O)?(e.consume(O),I):st(O)?(a=k,j(O)):Qt(O)?(e.consume(O),k):R(O)}function I(O){return O===45||O===46||O===58||O===95||is(O)?(e.consume(O),I):M(O)}function M(O){return O===61?(e.consume(O),A):st(O)?(a=M,j(O)):Qt(O)?(e.consume(O),M):k(O)}function A(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,D):st(O)?(a=A,j(O)):Qt(O)?(e.consume(O),A):(e.consume(O),P)}function D(O){return O===s?(e.consume(O),s=void 0,F):O===null?n(O):st(O)?(a=D,j(O)):(e.consume(O),D)}function P(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Rn(O)?k(O):(e.consume(O),P)}function F(O){return O===47||O===62||Rn(O)?k(O):n(O)}function R(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function j(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),L}function L(O){return Qt(O)?Ht(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):U(O)}function U(O){return e.enter("htmlTextData"),a(O)}}const pN={name:"labelEnd",resolveAll:NQe,resolveTo:RQe,tokenize:DQe},MQe={tokenize:jQe},TQe={tokenize:IQe},AQe={tokenize:PQe};function NQe(e){let t=-1;const n=[];for(;++t=3&&(u===null||st(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Qt(u)?Ht(e,i,"whitespace")(u):i(u))}}const Ts={continuation:{tokenize:GQe},exit:qQe,name:"list",tokenize:WQe},HQe={partial:!0,tokenize:KQe},zQe={partial:!0,tokenize:$Qe};function WQe(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return i;function i(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:dk(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ey,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return n(h)}function c(h){return dk(h)&&++a<10?(e.consume(h),c):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Kg,r.interrupt?n:f,e.attempt(HQe,p,m))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function m(h){return Qt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function GQe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Kg,s,o);function s(i){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ht(e,t,"listItemIndent",r.containerState.size+1)(i)}function o(i){return r.containerState.furtherBlankLines||!Qt(i)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(i)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zQe,t,a)(i))}function a(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ht(e,e.attempt(Ts,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function $Qe(e,t,n){const r=this;return Ht(e,s,"listItemIndent",r.containerState.size+1);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function qQe(e){e.exit(this.containerState.type)}function KQe(e,t,n){const r=this;return Ht(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const a=r.events[r.events.length-1];return!Qt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const bO={name:"setextUnderline",resolveTo:YQe,tokenize:QQe};function YQe(e,t){let n=e.length,r,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function QQe(e,t,n){const r=this;let s;return o;function o(u){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),i(u)}function i(u){return u===s?(e.consume(u),i):(e.exit("setextHeadingLineSequence"),Qt(u)?Ht(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||st(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const XQe={tokenize:ZQe};function ZQe(e){const t=this,n=e.attempt(Kg,r,e.attempt(this.parser.constructs.flowInitial,s,Ht(e,e.attempt(this.parser.constructs.flow,s,e.attempt(rQe,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const JQe={resolveAll:lse()},eXe=ise("string"),tXe=ise("text");function ise(e){return{resolveAll:lse(e==="text"?nXe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,a,i);return a;function a(f){return u(f)?o(f):i(f)}function i(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),c}function c(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),c)}function u(f){if(f===null)return!0;const m=s[f];let p=-1;if(m)for(;++p-1){const i=a[0];typeof i=="string"?a[0]=i.slice(r):a.shift()}o>0&&a.push(e[s].slice(0,o))}return a}function hXe(e,t){let n=-1;const r=[];let s;for(;++n0){const mt=Ae.tokenStack[Ae.tokenStack.length-1];(mt[1]||wO).call(Ae,void 0,mt[0])}for(ve.position={start:il(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:il(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function RXe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DXe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fse(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function jXe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fse(e,t);const s={src:am(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function IXe(e,t){const n={src:am(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function PXe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function OXe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fse(e,t);const s={href:am(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function LXe(e,t){const n={href:am(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function FXe(e,t,n){const r=e.all(t),s=n?BXe(n):mse(t),o={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let i=-1;for(;++i1}function UXe(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=lN(t.children[1]),c=Gre(t.children[t.children.length-1]);i&&c&&(a.position={start:i,end:c}),s.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function GXe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,i=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(EO(t.slice(s),s>0,!1)),o.join("")}function EO(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===CO||o===SO;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===CO||o===SO;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function KXe(e,t){const n={type:"text",value:qXe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YXe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const QXe={blockquote:EXe,break:kXe,code:MXe,delete:TXe,emphasis:AXe,footnoteReference:NXe,heading:RXe,html:DXe,imageReference:jXe,image:IXe,inlineCode:PXe,linkReference:OXe,link:LXe,listItem:FXe,list:UXe,paragraph:VXe,root:HXe,strong:zXe,table:WXe,tableCell:$Xe,tableRow:GXe,text:KXe,thematicBreak:YXe,toml:p1,yaml:p1,definition:p1,footnoteDefinition:p1};function p1(){}const pse=-1,mb=0,Bp=1,O2=2,hN=3,gN=4,yN=5,xN=6,hse=7,gse=8,kO=typeof self=="object"?self:globalThis,XXe=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,a]=t[s];switch(o){case mb:case pse:return n(a,s);case Bp:{const i=n([],s);for(const c of a)i.push(r(c));return i}case O2:{const i=n({},s);for(const[c,u]of a)i[r(c)]=r(u);return i}case hN:return n(new Date(a),s);case gN:{const{source:i,flags:c}=a;return n(new RegExp(i,c),s)}case yN:{const i=n(new Map,s);for(const[c,u]of a)i.set(r(c),r(u));return i}case xN:{const i=n(new Set,s);for(const c of a)i.add(r(c));return i}case hse:{const{name:i,message:c}=a;return n(new kO[i](c),s)}case gse:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:i}=new Uint8Array(a);return n(new DataView(i),a)}}return n(new kO[o](a),s)};return r},MO=e=>XXe(new Map,e)(0),zu="",{toString:ZXe}={},{keys:JXe}=Object,Hm=e=>{const t=typeof e;if(t!=="object"||!e)return[mb,t];const n=ZXe.call(e).slice(8,-1);switch(n){case"Array":return[Bp,zu];case"Object":return[O2,zu];case"Date":return[hN,zu];case"RegExp":return[gN,zu];case"Map":return[yN,zu];case"Set":return[xN,zu];case"DataView":return[Bp,n]}return n.includes("Array")?[Bp,n]:n.includes("Error")?[hse,n]:[O2,n]},h1=([e,t])=>e===mb&&(t==="function"||t==="symbol"),eZe=(e,t,n,r)=>{const s=(a,i)=>{const c=r.push(a)-1;return n.set(i,c),c},o=a=>{if(n.has(a))return n.get(a);let[i,c]=Hm(a);switch(i){case mb:{let f=a;switch(c){case"bigint":i=gse,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return s([pse],a)}return s([i,f],a)}case Bp:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),s([c,[...p]],a)}const f=[],m=s([i,f],a);for(const p of a)f.push(o(p));return m}case O2:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],m=s([i,f],a);for(const p of JXe(a))(e||!h1(Hm(a[p])))&&f.push([o(p),o(a[p])]);return m}case hN:return s([i,a.toISOString()],a);case gN:{const{source:f,flags:m}=a;return s([i,{source:f,flags:m}],a)}case yN:{const f=[],m=s([i,f],a);for(const[p,h]of a)(e||!(h1(Hm(p))||h1(Hm(h))))&&f.push([o(p),o(h)]);return m}case xN:{const f=[],m=s([i,f],a);for(const p of a)(e||!h1(Hm(p)))&&f.push(o(p));return m}}const{message:u}=a;return s([i,{name:c,message:u}],a)};return o},TO=(e,{json:t,lossy:n}={})=>{const r=[];return eZe(!(t||n),!!t,new Map,r)(e),r},Vc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?MO(TO(e,t)):structuredClone(e):(e,t)=>MO(TO(e,t));function tZe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nZe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rZe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tZe,r=e.options.footnoteBackLabel||nZe,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,h);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,h),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=f[f.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else f.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,v),i.push(v)}if(i.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Vc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:` -`}]}}const pb=(function(e){if(e==null)return iZe;if(typeof e=="function")return hb(e);if(typeof e=="object")return Array.isArray(e)?sZe(e):oZe(e);if(typeof e=="string")return aZe(e);throw new Error("Expected function, string, or object as test")});function sZe(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=yse,g,y,x;if((!t||o(c,u,f[f.length-1]||void 0))&&(h=cZe(n(c,f)),h[0]===mk))return h;if("children"in c&&c.children){const v=c;if(v.children&&h[0]!==_s)for(y=(r?v.children.length:-1)+a,x=f.concat(v);y>-1&&y0&&n.push({type:"text",value:` -`}),n}function AO(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function NO(e,t){const n=dZe(e,t),r=n.one(e,void 0),s=rZe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:` -`},s),o}function gZe(e,t){return e&&"run"in e?async function(n,r){const s=NO(n,{file:r,...t});await e.run(s,r)}:function(n,r){return NO(n,{file:r,...e||t})}}function RO(e){if(e)throw e}var tC,DO;function yZe(){if(DO)return tC;DO=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},o=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),m=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!m)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,f){n&&f.name==="__proto__"?n(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},i=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return tC=function c(){var u,f,m,p,h,g,y=arguments[0],x=1,v=arguments.length,b=!1;for(typeof y=="boolean"&&(b=y,y=arguments[1]||{},x=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});xa.length;let c;i&&a.push(s);try{c=e.apply(this,a)}catch(u){const f=u;if(i&&n)throw f;return s(f)}i||(c&&c.then&&typeof c.then=="function"?c.then(o,s):c instanceof Error?s(c):o(c))}function s(a,...i){n||(n=!0,t(a,...i))}function o(a){s(null,a)}}const Oa={basename:_Ze,dirname:wZe,extname:CZe,join:SZe,sep:"/"};function _Ze(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yg(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,i=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1),i>-1&&(e.codePointAt(s)===t.codePointAt(i--)?i<0&&(r=s):(i=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function wZe(e){if(Yg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function CZe(e){Yg(e);let t=e.length,n=-1,r=0,s=-1,o=0,a;for(;t--;){const i=e.codePointAt(t);if(i===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),i===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function SZe(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kZe(e,t){let n="",r=0,s=-1,o=0,a=-1,i,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}}else if(n.length>0){n="",r=0,s=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,o=0}else i===46&&o>-1?o++:o=-1}return n}function Yg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const MZe={cwd:TZe};function TZe(){return"/"}function gk(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function AZe(e){if(typeof e=="string")e=new URL(e);else if(!gk(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return NZe(e)}function NZe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[h,...g]=f;const y=r[p][1];hk(y)&&hk(h)&&(h=nC(!0,y,h)),r[p]=[u,h,...g]}}}}const bse=new vN().freeze();function aC(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function iC(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lC(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function IO(e){if(!hk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function PO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function g1(e){return IZe(e)?e:new vse(e)}function IZe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function PZe(e){return typeof e=="string"||OZe(e)}function OZe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LZe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",OO=[],LO={allowDangerousHtml:!0},FZe=/^(https?|ircs?|mailto|xmpp)$/i,BZe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function UZe(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",s=e.className,o=e.components,a=e.disallowedElements,i=e.rehypePlugins||OO,c=e.remarkPlugins||OO,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...LO}:LO,f=e.skipHtml,m=e.unwrapDisallowed,p=e.urlTransform||VZe,h=bse().use(dse).use(c).use(gZe,u).use(i),g=new vse;typeof r=="string"&&(g.value=r);for(const b of BZe)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+LZe+b.id,void 0);const y=h.parse(g);let x=h.runSync(y,g);return s&&(x={type:"element",tagName:"div",properties:{className:s},children:x.type==="root"?x.children:[x]}),fr(x,v),lYe(x,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function v(b,_,w){if(b.type==="raw"&&w&&typeof _=="number")return f?w.children.splice(_,1):w.children[_]={type:"text",value:b.value},_;if(b.type==="element"){let S;for(S in Zw)if(Object.hasOwn(Zw,S)&&Object.hasOwn(b.properties,S)){const C=b.properties[S],E=Zw[S];(E===null||E.includes(b.tagName))&&(b.properties[S]=p(String(C||""),S,b))}}if(b.type==="element"){let S=t?!t.includes(b.tagName):a?a.includes(b.tagName):!1;if(!S&&n&&typeof _=="number"&&(S=!n(b,_,w)),S&&w&&typeof _=="number")return m&&b.children?w.children.splice(_,1,...b.children):w.children.splice(_,1),_}}}function VZe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||FZe.test(e.slice(0,t))?e:""}const FO=4e3,HZe=e=>{const t=e.image_width,n=e.image_height;return!t||!n?!0:t<=FO&&n<=FO},bN=T.memo(({item:e,onClick:t,alt:n})=>{const[r,s]=d.useState(!1);d.useEffect(()=>{s(!1)},[e]);const o=d.useMemo(()=>HZe(e)&&e.image||e.thumbnail,[e]),a=d.useCallback(()=>{s(!0)},[]);if(!o||r){const i=o?"Failed to load image":"Image not available";return l.jsx(jo,{className:z("relative w-full",{"cursor-pointer":t}),onClick:t,disabled:!t,children:l.jsx("div",{className:"bg-subtler flex h-40 w-full items-center justify-center rounded-lg md:h-48",children:l.jsxs("div",{className:"text-center",children:[l.jsx(ge,{icon:B("photo"),size:"xl",className:"mx-auto mb-2 opacity-50"}),l.jsx(V,{variant:"small",color:"light",children:i})]})})})}return l.jsx(jo,{className:z("relative w-full",{"cursor-pointer":t}),onClick:t,disabled:!t,children:l.jsx("img",{src:o,alt:n||e.name||e.author_name||"Image",className:"h-40 w-full rounded-lg object-cover transition-opacity hover:opacity-90 md:h-48",onError:a,loading:"lazy"})})});bN.displayName="MainImage";const _se=T.memo(({item:e,index:t,isSelected:n,onClick:r})=>{const[s,o]=d.useState(!1),a=e.thumbnail||e.image;d.useEffect(()=>{o(!1)},[e]);const i=d.useCallback(()=>{o(!0)},[]);return l.jsx(jo,{className:z("flex-shrink-0 cursor-pointer transition-all",n?"ring-super rounded-md ring-2":"hover:opacity-75"),onClick:r,children:a&&!s?l.jsx("img",{src:a,alt:e.name||e.author_name||`Image ${t+1}`,className:"h-12 w-16 rounded-md object-cover",onError:i}):l.jsx("div",{className:"bg-subtler flex h-12 w-16 items-center justify-center rounded-md",children:l.jsx(ge,{icon:B("photo"),size:"xs",className:"opacity-50"})})})});_se.displayName="ThumbnailImage";const wse=T.memo(({item:e,onClick:t})=>l.jsxs("div",{children:[l.jsx("div",{className:"mb-3",children:l.jsx(bN,{item:e,onClick:t})}),l.jsx(_N,{item:e})]}));wse.displayName="SingleImageDisplay";const yk=T.memo(({items:e,selectedIndex:t,onImageSelect:n,onImageClick:r})=>{const s=d.useCallback(()=>{r(t)},[r,t]),o=d.useCallback(()=>{const u=t>0?t-1:e.length-1;n(u)},[t,e.length,n]),a=d.useCallback(()=>{const u=t{u.key==="ArrowLeft"?(u.preventDefault(),o()):u.key==="ArrowRight"&&(u.preventDefault(),a())},[o,a]),c=e[t];return l.jsxs("div",{onKeyDownCapture:i,tabIndex:0,children:[l.jsxs("div",{className:"relative mb-3",children:[l.jsx(bN,{item:c,onClick:s,alt:c.name||c.author_name||`Image ${t+1}`}),e.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute left-1 top-1/2 -translate-y-1/2",children:l.jsx(Ct,{onClick:o,rounded:!0,icon:B("chevron-left"),size:"small","aria-label":"Previous image",variant:"tonal"})}),l.jsx("div",{className:"absolute right-1 top-1/2 -translate-y-1/2",children:l.jsx(Ct,{onClick:a,rounded:!0,icon:B("chevron-right"),size:"small","aria-label":"Next image",variant:"tonal"})})]})]}),l.jsx("div",{className:"mb-3",children:l.jsx("div",{className:"flex gap-2 overflow-x-auto p-1 pb-2 [scrollbar-width:thin]",children:e.map((u,f)=>l.jsx(_se,{item:u,index:f,isSelected:t===f,onClick:()=>n(f)},f))})}),l.jsx(_N,{item:c,index:t})]})});yk.displayName="MultipleImagesDisplay";const _N=T.memo(({item:e,index:t})=>{const n=e.name||e.author_name||(t!==void 0?`Image ${t+1}`:"Image");return e.url?l.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[l.jsx(xt,{href:e.url,target:"_blank",rel:"noopener nofollow",className:"hover:text-super cursor-pointer transition-colors",children:l.jsx(V,{variant:"small",className:"line-clamp-3 font-medium leading-tight",children:n})}),l.jsx(xt,{href:e.url,target:"_blank",rel:"noopener nofollow",className:"hover:text-super cursor-pointer transition-colors",children:l.jsx(V,{variant:"tiny",color:"light",className:"hover:text-super line-clamp-1",children:l.jsx("span",{className:"truncate font-mono",children:Ur(e.url)})})})]}):l.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[l.jsx(V,{variant:"small",className:"line-clamp-3 font-medium leading-tight",children:n}),e.author_name&&e.author_name!==n&&l.jsxs(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:[l.jsx("span",{children:"by"})," ",l.jsx("span",{className:"font-medium",children:e.author_name})]})]})});_N.displayName="ImageCaption";const Cse=T.memo(({mediaItem:e,allMediaItems:t,className:n="",trackEvent:r,overflowCount:s,openGallery:o})=>{const a=d.useMemo(()=>(t||[e]).filter(S=>S.image||S.thumbnail),[t,e]),{label:i,isTruncated:c}=d.useMemo(()=>{if(e.url){const w=sg(e.url),S=w.split("."),C=S.length>1?S.slice(-2).join("."):w,E=C.length>12;return{label:E?C.slice(0,12):C,isTruncated:E}}return{label:"image",isTruncated:!1}},[e.url]),u=d.useMemo(()=>s&&s>0?l.jsxs("span",{className:"opacity-50",children:["+",s]}):void 0,[s]),{isMobileStyle:f}=Re(),[m,p]=d.useState(0),[h,g]=d.useState(!1),y=d.useCallback(w=>{p(w)},[]),x=d.useCallback(w=>{if(f)return;a[w]&&o&&(g(!1),o(a,w))},[a,o,f]),v=d.useCallback(()=>{if(!o)return;a[0]&&(g(!1),o(a,0))},[a,o]),b=d.useCallback(()=>{f&&a.length>1||o&&o(a)},[a,o,f]),_=d.useMemo(()=>l.jsx(jo,{className:"relative -top-px ml-0.5 inline-flex select-none items-center whitespace-nowrap align-middle",onClick:b,children:l.jsxs(K,{as:"span",variant:"subtle",className:z("text-3xs rounded-badge group inline-flex min-w-4 cursor-pointer items-center px-[0.3rem] py-[0.1875rem] align-middle font-mono tabular-nums leading-snug","[@media(hover:hover)]:hover:bg-super dark:[@media(hover:hover)]:hover:text-inverse [@media(hover:hover)]:hover:text-white"),children:[l.jsx(ge,{icon:B("photo"),size:"2xs",className:"mr-xs inline-block opacity-80"}),l.jsx("span",{className:z("relative inline-block",{"max-w-[25ch] overflow-hidden":c}),style:c?{maskImage:"linear-gradient(to right, black 70%, transparent 100%)"}:{},children:i}),!!u&&l.jsx("span",{className:"ml-xs inline-block",children:u})]})}),[i,c,u,b]);return a.length===0?null:f&&a.length===1?_:f?l.jsx(Ul,{interaction:"click",side:"bottom",align:"start",open:h,onOpenChange:g,triggerElement:_,children:l.jsx("div",{className:"bg-base w-full md:-mx-3 md:-my-2 md:w-80",children:l.jsx("div",{className:"md:p-3",children:l.jsx(yk,{items:a,selectedIndex:m,onImageSelect:y,onImageClick:x})})})}):l.jsx(Ul,{interaction:"hover",openDelayMs:200,closeDelayMs:200,side:"bottom",align:"start",open:h,onOpenChange:g,triggerElement:_,children:l.jsx("div",{className:"bg-base w-full md:-mx-3 md:-my-2 md:w-80",children:l.jsx("div",{className:"md:p-3",children:a.length===1?l.jsx(wse,{item:a[0],onClick:v}):l.jsx(yk,{items:a,selectedIndex:m,onImageSelect:y,onImageClick:x})})})})});Cse.displayName="ImageCitationTooltip";const Sse=T.memo(({node:e,...t})=>l.jsx("button",{...t}));Sse.displayName="Button";const zZe={abap:"abap",actionscript:"actionscript",ada:"ada",arduino:"arduino",autoit:"autoit",bash:"bash",c:"c",clojure:"clojure",coffeescript:"coffeescript",cpp:"cpp",csharp:"csharp",css:"css",cuda:"cuda",d:"d",dart:"dart",delphi:"delphi",elixir:"elixir",erlang:"erlang",fortran:"fortran",foxpro:"foxpro",fsharp:"fsharp",go:"go",graphql:"graphql",gql:"gql",groovy:"groovy",haskell:"haskell",haxe:"haxe",html:"xml",java:"java",javascript:"javascript",json:"json",julia:"julia",jsx:"jsx",js:"js",kotlin:"kotlin",latex:"tex",lisp:"lisp",livescript:"livescript",lua:"lua",markup:"markup",mathematica:"mathematica",makefile:"makefile",matlab:"matlab",objectivec:"objectivec","objective-c":"objectivec","objective-j":"objectivec",objectpascal:"delphi",ocaml:"ocaml",octave:"matlab",perl:"perl",php:"php",powershell:"powershell",prolog:"prolog",puppet:"puppet",python:"python",qml:"qml",r:"r",racket:"lisp",restructuredtext:"rest",rest:"rest",ruby:"ruby",rust:"rust",sass:"less",less:"less",scala:"scala",scheme:"scheme",shell:"shell",smalltalk:"smalltalk",sql:"sql",standardml:"sml",sml:"sml",swift:"swift",tcl:"tcl",tex:"tex",text:"text",tsx:"tsx",ts:"ts",typescript:"typescript",vala:"vala",vbnet:"vbnet",verilog:"verilog",vhdl:"vhdl",xml:"xml",xquery:"xquery"},WZe=e=>{const{trackEvent:t}=e;return T.memo(({inline:r,className:s,children:o,node:a,...i})=>{const c=s?.replace("language-","")||"",u=d.useMemo(()=>({language:zZe?.[c]}),[c]),{$t:f}=J(),m=d.useMemo(()=>({copy:f({defaultMessage:"Copy code",id:"CNXQN5zp9z"}),wrap:f({defaultMessage:"Wrap lines",id:"k+v14s5FhJ"}),noWrap:f({defaultMessage:"No line wrap",id:"IS43cwTSaV"})}),[f]);return r?l.jsx("code",{children:o}):l.jsx(af,{className:"bg-subtler",codeBlockProps:u,trackEvent:t,translations:m,...i,children:o})})},Ese=e=>{try{if(typeof e=="string")return e.toLowerCase().replace(/ /g,"-").replace(/[^a-z0-9-]/g,"").slice(0,50).replace(/^-+|-+$/g,"")}catch{}return""},wN="mb-2 mt-4",GZe=T.memo(({node:e,level:t,...n})=>{const r=Ese(n.children);return l.jsx("h1",{className:`font-display first:mt-xs ${wN} font-semimedium text-lg leading-[1.5em] lg:text-xl`,id:r,...n})}),$Ze=T.memo(({node:e,level:t,...n})=>{const r=Ese(n.children);return l.jsx("h2",{className:`${wN} font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&]:mt-4`,id:r,...n})}),qZe=T.memo(({node:e,level:t,...n})=>l.jsx("h2",{className:`${wN} font-display font-semimedium text-base first:mt-0`,...n})),kse=T.memo(e=>l.jsx("hr",{className:"bg-subtle h-px border-0",...e}));kse.displayName="Hr";const Mse=T.memo(({className:e,src:t,alt:n,node:r,...s})=>l.jsx("img",{className:e+" rounded-lg",src:t,alt:n,...s}));Mse.displayName="MarkdownImage";const CN=T.memo(({domain:e,url:t,suffix:n,overflowCount:r,hasPremiumSource:s,source:o,mcpServerSource:a,...i})=>{if(!t&&!e)return null;const c=e||sg(t).replace(/^[a-z]{1,2}\./i,""),u=n?`${c}.${n}`:c,f=s&&a?Of(a):null,m=r&&r>0?l.jsxs("span",{className:"opacity-50",children:["+",r]}):void 0;return l.jsx(ua,{label:u,accessory:m,truncate:!0,containerClassName:s?"border border-super bg-super/10":void 0,iconUrl:f||void 0,...i})});CN.displayName="CitationDomainBubble";const gb=T.memo(e=>l.jsx(ua,{...e}));gb.displayName="CitationNumberBubble";const pf=T.memo(e=>{const{children:t,timestamp:n,timestampProps:r,includeIcon:s=!0}=e,o=J();if(!n)return null;const a=n?.endsWith("Z")?n:`${n}Z`;return l.jsxs(K,{className:"gap-x-xs flex",children:[s?l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{icon:B("bolt"),size:"xs"})}):null,l.jsxs(V,{variant:"tinyRegular",color:"light",...r,children:[t&&l.jsxs(l.Fragment,{children:[t," "]}),vee(o,a)]})]})});pf.displayName="CitationUpdatedAt";const Tse=T.memo(function({href:t,overflowCount:n,getAttachmentUrl:r,onCitationClick:s,isPatent:o,...a}){const[i,c]=d.useState(!1),[u,f]=d.useState(null),m=d.useCallback(async y=>{if(s?.(y),y?.defaultPrevented||!t||!r)return;const x=await r(t);Tr(t)&&(f(x),c(!0))},[s,r,t]),p=n&&n>0?l.jsxs("span",{className:"opacity-50",children:["+",n]}):void 0,h=d.useCallback(()=>c(!1),[]),g=d.useMemo(()=>({src:u??void 0}),[u]);return o?l.jsx(ua,{accessory:p,icon:rV,className:"cursor-pointer",truncate:!0,onClick:m,...a,linkBehavior:"onClick",href:void 0}):l.jsxs(l.Fragment,{children:[l.jsx(ua,{accessory:p,icon:B("paperclip"),className:"cursor-pointer",truncate:!0,onClick:m,...a}),u&&l.jsx(gu,{isOpen:i,onClose:h,imgProps:g})]})});Tse.displayName="FileCitationBubble";const KZe=Se(async()=>{const{GroupedCitationModal:e}=await Ee(()=>q(()=>import("./GroupedCitationModal-fX8EbFKD.js"),__vite__mapDeps([460,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),YZe=T.memo(({children:e,webResults:t,citationGroup:n,trackEvent:r,getAttachmentUrl:s,openMemorySearchHistoryModal:o,onCitationClick:a,forceExternalHandler:i,onYouTubeClick:c,onAttachmentClick:u,asChild:f=!1})=>{const{openModal:m}=Ho(),p=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),m(KZe,{webResults:t,citationGroup:n,trackEvent:r,getAttachmentUrl:s,openMemorySearchHistoryModal:o,onCitationClick:a,forceExternalHandler:i,onYouTubeClick:c,onAttachmentClick:u,legacyIdentifier:"__NONE__"})},[m,t,n,r,s,o,a,i,c,u]),h=f?JU:"span";return l.jsx(h,{onClick:p,children:e})});YZe.displayName="GroupedCitationBottomSheet";const QZe={small:{container:12,icon:10},default:{container:14,icon:12}},Ase=T.memo(({source:e,variant:t,isClipped:n,idSmall:r,idDefault:s,mcpServerSource:o})=>{const a=QZe[t],i=d.useMemo(()=>n?{clipPath:`url(#${t==="small"?r:s})`}:void 0,[n,t,r,s]),c=d.useMemo(()=>({width:a.container,height:a.container,...i}),[a.container,i]),u={"-ml-[5px]":t==="default","-ml-xs":t==="small"};if(e.isAttachment){const m=oY(e.url);return l.jsx(K,{variant:"subtler",className:z("relative z-0 inline-flex shrink-0 items-center justify-center rounded-full",u),style:c,children:l.jsx(V,{variant:"small",color:"light",children:l.jsx(ge,{icon:m,size:a.icon})})})}const f=o?Of(o):null;return l.jsx(Lo,{domain:Ur(e.url),size:a.container,className:z("bg-subtle relative z-0 inline-flex shrink-0",u),style:i,overrideIconUrl:f||void 0})});Ase.displayName="CitationItem";const yb=T.memo(({sources:e,count:t,variant:n="default",className:r})=>{const s="clip-path-small",o="clip-path-default",a=Math.min(e.length,t),i=d.useMemo(()=>{if(e.length===0)return[];const c=[],u=new Set,f=new Set;for(const m of e){if(c.length>=a)break;if(m.isAttachment){const p=hu(m.url);p&&!f.has(p)&&(c.push(m),f.add(p))}else{const p=Ur(m.url);u.has(p)||(c.push(m),u.add(p))}}if(c.lengthl.jsx(Ase,{source:c,variant:n,isClipped:u!==a-1,idSmall:s,idDefault:o,mcpServerSource:c.mcpServerSource},u))})})]})});yb.displayName="CitationPile";const Nse=T.memo(({webResults:e,citationGroup:t,trackEvent:n,getAttachmentUrl:r,openMemorySearchHistoryModal:s,onCitationClick:o,forceExternalHandler:a,onClose:i,onYouTubeClick:c,onAttachmentClick:u,webResultCitation:f,timestampComponent:m,linkProps:p})=>{const{sortedWebResults:h,headerText:g,hasPremiumSource:y,handleCitationClick:x}=hKe({webResults:e,citationGroup:t,onCitationClick:o,openMemorySearchHistoryModal:s,onYouTubeClick:c,onAttachmentClick:u,forceExternalHandler:a,getAttachmentUrl:r,trackEvent:n,onClose:i}),[v,b]=d.useState(0),_=d.useCallback(()=>{b(I=>Math.max(0,I-1))},[]),w=d.useCallback(()=>{b(I=>Math.min(h.length-1,I+1))},[h.length]),{$t:S}=J(),C=v0,N=h[v],k=d.useMemo(()=>h.map(I=>({url:I.url,isAttachment:I.is_attachment,source:I.meta_data?.citation_domain_name,mcpServerSource:I.meta_data?.mcp_server})),[h]);return l.jsxs("div",{className:"-m-sm",children:[l.jsxs(K,{className:"flex items-center justify-between py-sm px-3 border-b",children:[l.jsxs("div",{className:"flex items-center -ml-sm gap-xs",children:[l.jsx(Ct,{variant:"text",size:"tiny",onClick:_,icon:B("chevron-left"),"aria-label":S({defaultMessage:"Previous",id:"JJNc3cbYIJ"}),rounded:!0,disabled:!E}),l.jsx(V,{variant:"smallCaps",color:"light",children:`${v+1}/${h.length}`}),l.jsx(Ct,{variant:"text",size:"tiny",onClick:w,icon:B("chevron-right"),"aria-label":S({defaultMessage:"Next",id:"9+DdtuCqLw"}),rounded:!0,disabled:!C})]}),l.jsxs("div",{className:"gap-sm flex col-start-1 row-start-1 duration-normal",children:[l.jsx("div",{className:"pointer-events-none",children:l.jsx(yb,{sources:k,count:t.totalCount??k.length})}),l.jsx(V,{variant:"tinyRegular",color:"light",children:g})]}),l.jsx(eN,{webResults:h})]}),l.jsx("div",{className:z("scrollbar-subtle overflow-y-auto p-3",{"max-h-[280px]":y,"max-h-60":!y}),children:l.jsx("div",{className:"space-y-px",children:N&&l.jsx(Rse,{result:N,webResultCitation:f,timestampComponent:m,linkProps:p,onClick:x(N)},N.url)})})]})}),Rse=T.memo(({result:e,webResultCitation:t,timestampComponent:n,linkProps:r,onYouTubeClick:s,onAttachmentClick:o,onClick:a})=>{const i=!!(e.url&&Ji(e.url)),c=e.is_attachment||!1,u=Xl(e);return l.jsx(nN,{result:e,webResultCitation:t,timestampComponent:n,linkProps:{...r,onClick:a},onYouTubeClick:s,onAttachmentClick:o,isFile:c,downloadable:u,isYouTubeVideo:i})});Rse.displayName="CitationResult";Nse.displayName="GroupedCitationContent";const Dse=T.memo(({children:e,webResults:t,citationGroup:n,hideHoverCard:r=!1,trackEvent:s,getAttachmentUrl:o,openMemorySearchHistoryModal:a,onCitationClick:i,forceExternalHandler:c,scrollContainerRef:u})=>{const[f,m]=d.useState(!1),[p,h]=d.useState(!1),[g,y]=d.useState(null),[x,v]=d.useState(!1),[b,_]=d.useState(null),{isMobileStyle:w}=Re(),{onWheel:S}=wre({scrollContainerRef:u,enabled:!0}),C=d.useCallback(()=>{m(!1)},[]),E=d.useCallback(D=>{y(D),h(!0),m(!1)},[]),N=d.useCallback(async D=>{if(!o)return;if(Tr(D.url)){const F=await o(D.url);_(F),v(!0),m(!1)}},[o]),k=d.useCallback(()=>v(!1),[]),I=d.useMemo(()=>({src:b??void 0}),[b]),M=d.useCallback(D=>{m(r?!1:D)},[r]),A=d.useMemo(()=>l.jsx("span",{className:"inline-flex",children:e}),[e]);return l.jsxs(l.Fragment,{children:[g&&g.url&&l.jsx($g,{isOpen:p,name:g.name,setisOpen:h,url:g.url}),b&&l.jsx(gu,{isOpen:x,onClose:k,imgProps:I}),l.jsx(Ul,{interaction:"hover",open:f,onOpenChange:M,openDelayMs:200,closeDelayMs:200,side:"bottom",align:w?"center":"start",triggerElement:A,maxWidthPx:384,onWheelContent:S,children:l.jsx(Nse,{webResults:t,citationGroup:n,trackEvent:s,getAttachmentUrl:o,openMemorySearchHistoryModal:a,onCitationClick:i,forceExternalHandler:c,onClose:C,onYouTubeClick:E,onAttachmentClick:N})})]})});Dse.displayName="GroupedCitationHoverCard";const jse=T.memo(({ytID:e,timestamp:t,overflowCount:n,...r})=>{const[s,o]=d.useState(!1),a=d.useCallback(()=>o(!0),[]),i=n&&n>0?l.jsxs("span",{className:"opacity-50",children:["+",n]}):void 0;return l.jsxs(l.Fragment,{children:[l.jsx(ua,{label:"youtube",accessory:i,icon:B("brand-youtube"),onClick:a,className:"cursor-pointer",...r}),e&&l.jsx($g,{url:`https://www.youtube.com/watch?v=${e}`,name:"",isOpen:s,setisOpen:o,timestamp:t})]})});jse.displayName="YoutubeCitationBubble";const Ise="_entity_chip",xk="pplx-entity-id";function XZe(e){const t=e.match(/^pplx:\/\/entity_chip\/(?.+)$/);if(!(!t||!t.groups?.id))return t.groups.id}var ss;(function(e){e.YOUTUBE="youtube",e.FILE="file",e.MEMORY="memory",e.CONVERSATION_HISTORY="conversation_history",e.WEB="web",e.NUMBERED="numbered",e.MEETING_TRANSCRIPT="meeting_transcript"})(ss||(ss={}));function ZZe(e){if(e){if(e.is_memory)return B("bubble-text");if(e.is_conversation_history)return B("list-search")}}function JZe(e){const{ytID:t,isMobileStyle:n,isFile:r,isMemory:s,isConversationHistory:o,enableCitationGrouping:a,isMeetingTranscript:i}=e;return t&&!n?ss.YOUTUBE:i?ss.MEETING_TRANSCRIPT:r?ss.FILE:a?s?ss.MEMORY:o?ss.CONVERSATION_HISTORY:ss.WEB:ss.NUMBERED}function eJe(e){const t=e.indexOf("&t=");return t!==-1?e.substring(t+3):void 0}function tJe({count:e}){return!e||e<=0?null:l.jsxs("span",{className:"pl-two opacity-50",children:["+",e]})}const SN=T.memo(e=>{const{str:t,href:n,className:r,trackEvent:s,isFile:o,isMeetingTranscript:a,isDownloadable:i,citationSize:c,onCitationClick:u,getAttachmentUrl:f,isMemory:m,isConversationHistory:p,citationGroup:h,enableCitationGrouping:g,citationDomain:y,fileName:x,webResult:v,hasPremiumSource:b,ref:_,forceExternalHandler:w,...S}=e,{isMobileStyle:C}=Re(),E=vp.test(t),N=d.useCallback(()=>{const $=Gg(v);s?.("click citation",{source:"inline",citation_url:n,...$})},[n,s,v]),k=d.useMemo(()=>{const $=h?.overflowCount;return!$||$<=0?null:l.jsx(tJe,{count:$})},[h?.overflowCount]);if(!E)return l.jsx("span",{children:t});const I=eJe(n),M=Ji(n),A=t.replace(/\[|\]|,.*$/g,""),P=!!(n&&!m&&!p&&(!(M||i)||C)),F=JZe({ytID:M,isMobileStyle:C,isFile:o,isMemory:m,isConversationHistory:p,enableCitationGrouping:g,isMeetingTranscript:a}),R=g&&h&&h.citations.length>1,j=C&&R,L=!P||j?"onClick":"external";let U;switch(F){case ss.YOUTUBE:U=M&&l.jsx(jse,{...!g&&{label:A},ytID:M,overflowCount:h?.overflowCount??0,timestamp:I,size:c,forceExternalHandler:w});break;case ss.FILE:{const $=v?WH(v):void 0,G=$?Of($.toLowerCase())??void 0:void 0,H=rg(v)||!!(n&&Nf(n));U=l.jsx(Tse,{label:g?x??A:A,overflowCount:h?.overflowCount??0,size:c,href:H?void 0:n,getAttachmentUrl:i?f:void 0,onCitationClick:u,forceExternalHandler:w,isPatent:H,...G?{iconUrl:G}:{}})}break;case ss.MEETING_TRANSCRIPT:U=l.jsx(ua,{label:x??A,icon:B("microphone"),accessory:k,size:c,truncate:!0,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.NUMBERED:{const $=ZZe(v);U=$?l.jsx(ua,{label:A,icon:$,size:c,onClick:u,href:n,linkBehavior:L,trackEvent:s,forceExternalHandler:w}):l.jsx(gb,{label:A,size:c,onClick:u,href:n,linkBehavior:L,trackEvent:s,forceExternalHandler:w});break}case ss.MEMORY:U=l.jsx(ua,{label:v?.name.toLocaleLowerCase(),icon:B("bubble-text"),accessory:k,size:c,truncate:!0,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.CONVERSATION_HISTORY:U=l.jsx(ua,{label:"library",icon:B("list-search"),accessory:k,size:c,truncate:!1,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.WEB:default:U=l.jsx(CN,{domain:y,url:n,overflowCount:h?.overflowCount??0,size:c,href:n,linkBehavior:L,trackEvent:s,onClick:j||w?u:N,forceExternalHandler:w,hasPremiumSource:b,source:typeof v?.meta_data?.citation_domain_name=="string"?v.meta_data.citation_domain_name:void 0,mcpServerSource:typeof v?.meta_data?.mcp_server=="string"?v.meta_data.mcp_server:void 0})}return l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"citation-nbsp"}),l.jsx("span",{className:z(r,"citation inline"),ref:_,...S,children:U}),"​"]})});SN.displayName="MdStringToLink";const nJe=function(t){const{ref:n,...r}=t,{anchor:s,className:o,...a}=r,i=f=>{const m=document.getElementById(f);m&&m.scrollIntoView({behavior:"smooth"})},c=s.replace(/\[|\]/g,""),u=d.useCallback(()=>i(`#search${s}`),[s]);return l.jsx(xt,{href:`#search${s}`,onClick:u,className:o,ref:n,...a,children:l.jsx(gb,{label:c})})},Pse=zt("MarkdownLinkContext",{}),rJe=T.memo(e=>{const{className:t,href:n,title:r,children:s,target:o="_blank",node:a,ref:i,...c}=e,{hideHoverCard:u=!1,trackEvent:f,citationSize:m,onCitationClick:p,getAttachmentUrl:h,enableCitationGrouping:g=!1,webResults:y=[],EntityChipComponent:x,inlineTokenAnnotationsLookup:v,forceExternalHandler:b,scrollContainerRef:_}=d.useContext(Pse),w=g&&a?.data?a.data.citationGroup:void 0,S=d.useMemo(()=>{if(!(!w||w.citations.length<=1))return w.citations.map(Q=>y[Q-1]).filter(Q=>Q!==void 0).sort((Q,Y)=>{const te=Fi(Q),se=Fi(Y);return te&&!se?-1:!te&&se?1:0})},[w,y]),C=S?.[0]??a?.data?.webResult,E=(C?.is_attachment??!1)||rg(C),N=a?.data?.webResultCitation,k=C?.is_memory??!1,I=C?.is_conversation_history??!1,M=Hf(C),{$t:A}=J(),{isMobileStyle:D}=Re(),P=D&&!1,F=d.useCallback(Q=>{if(w&&w.citations.length>1,g&&w&&w.citations.length>0&&(C?.is_memory||C?.is_conversation_history)){const Y=w.citations[0],te=y?.[Y-1];te&&p&&p(te,Q)}else C&&p&&p(C,Q)},[C,w,g,P,p,y]),R=d.useMemo(()=>{if(!a||!v||!(xk in a.properties))return;const Q=a.properties[xk];if(typeof Q=="string")return v[Q]},[a,v]),j=d.useMemo(()=>C?{onClick(Q){if(f){const Y=Gg(C);f("click citation",{source:"inline hoverCard",citation_url:C.url,...Y})}F(Q)}}:void 0,[C,F,f]),L=d.useMemo(()=>({color:"light"}),[]),U=d.useCallback((Q,Y)=>()=>{f&&Y&&f("inline link clicked",{linkURL:n,linkText:T.Children.toArray(s).join(""),linkSurface:Q,isNavLink:!1})},[n,s,f]),O=d.useCallback(Q=>()=>{f&&Q&&f("inline link viewed",{linkURL:n,linkText:T.Children.toArray(s).join(""),isNavLink:!1})},[n,s,f]),$=d.useMemo(()=>({onClick:U("citation_hover_card",C)}),[U,C]),G=d.useMemo(()=>w?w.citations.some(Q=>{const Y=y[Q-1];return Fi(Y)}):!1,[w,y]);let H;switch(r){case"_citation":{if(w?.isHidden)return null;H=l.jsx(SN,{isMemory:k,isConversationHistory:I,onCitationClick:F,className:t,str:T.Children.toArray(s).join(""),href:n,rel:"nofollow noopener",trackEvent:f,isFile:E,isMeetingTranscript:M,isDownloadable:C?Xl(C):!1,citationSize:m,getAttachmentUrl:h,citationGroup:w,enableCitationGrouping:g,citationDomain:C?.meta_data?.citation_domain_name,fileName:C?.name,webResult:C,hasPremiumSource:G,ref:i,forceExternalHandler:b});break}case"_anchor_citation":{H=l.jsx(nJe,{anchor:T.Children.toArray(s).join(""),className:t,ref:i,...c});break}case Ise:return!R||!x?null:l.jsx(x,{annotation:R,trackEvent:f,ref:i});default:{const{"aria-label":Q,onClick:Y,...te}=c,se=(()=>{if(!(!y?.length||!n))return y.find(le=>le.url===n)})(),ae=se!==void 0,X=!!(!ae&&r),ee=l.jsx(Xh,{variant:"inline",href:n,target:o,title:X?r:void 0,rel:"nofollow noopener",ref:i,bold:!0,onTrackEvent:U("answer",se),__dangerousDoNotUseOnClick:Y,...te,children:s});ae?H=l.jsx(df,{result:se,onOpened:O(se),linkProps:$,scrollContainerRef:_,children:ee}):H=ee}}if(C){if(g&&w&&w.citations.length>1){const Y=S||[];return l.jsx(Dse,{webResults:Y,citationGroup:w,hideHoverCard:u,trackEvent:f,getAttachmentUrl:h,onCitationClick:p,forceExternalHandler:b,scrollContainerRef:_,children:H})}return l.jsx(df,{hideHoverCard:u,linkProps:j,result:C,timestampComponent:Lv.isRecentlyTrending(C)?l.jsx(pf,{recentlyUpdatedLabel:A({defaultMessage:"Just now",description:"Label for recently updated content",id:"FlgDFQFpF1"}),timestamp:C.meta_data?.published_date,timestampProps:L,children:"Updated"}):null,webResultCitation:N,getAttachmentUrl:h,scrollContainerRef:_,children:H})}return H},BJ),Ose=T.memo(({node:e,depth:t,children:n,ordered:r,...s})=>l.jsx("ol",{className:z("marker:text-quiet list-decimal",{"pl-8":t===0}),...s,children:n}));Ose.displayName="MdOrderedList";const Lse=T.memo(({node:e,depth:t,children:n,ordered:r,...s})=>l.jsx("ul",{className:z("marker:text-quiet list-disc",{"pl-8":t===0}),...s,children:n}));Lse.displayName="MdUnorderedList";const Fse=T.memo(({className:e,children:t,ordered:n,node:r,...s})=>{const o=`py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&>p]:pt-0 [&>p]:mb-2 [&>p]:my-0 ${e||""}`.trim();return l.jsx("li",{...s,className:o,children:t})});Fse.displayName="ListItem";const Bse=T.memo(({node:e,className:t,children:n,...r})=>l.jsx("p",{className:z("my-2 [&+p]:mt-4 [&_strong:has(+br)]:inline-block [&_strong:has(+br)]:pb-2",t),...r,children:n}));Bse.displayName="Paragraph";const sJe=e=>T.memo(({children:n,node:r,...s})=>l.jsx("div",{className:z("w-full",{"md:max-w-[90vw]":!e}),children:l.jsx("pre",{className:"not-prose w-full rounded font-mono text-sm font-extralight",...s,children:n})})),oJe=e=>{if(!e)return{success:!1,error:{type:"INVALID_TABLE",message:"Invalid node: expected table element"}};const n=e.outerHTML.replace("{const u=[];c.querySelectorAll("th").forEach(f=>{u.push(f.textContent?.trim()||"")}),u.length>0&&s.push({cells:u,isHeader:!0}),r=u.map(f=>f.length)}),a.forEach(c=>{const u=[];c.querySelectorAll("td").forEach(f=>{u.push(f.textContent?.trim()||"")}),u.length>0&&s.push({cells:u,isHeader:!1})}),s.forEach(c=>{c.cells.forEach((u,f)=>{f>=r.length?r.push(u.length):r[f]=Math.max(r[f]??0,u.length)})}),{success:!0,data:{markdownText:iJe(s,r),htmlText:n}}},aJe=e=>e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|"),iJe=(e,t)=>{if(e.length===0)return"";const n=[];return e.forEach((r,s)=>{const o=[];for(let a=0;a"-".repeat(i)).join(" | ")} |`;n.push(a)}}),n.join(` -`)},Use=T.memo(function(t){const{isDisabled:n,tableRef:r,trackEvent:s}=t,{$t:o}=J(),[a,i]=d.useState(!1),{openToast:c}=pn(),u=d.useCallback(async()=>{i(!0);try{if(!r.current)throw new Error("Table element not found");const f=oJe(r.current);if(!f.success){Wc.error("Failed to convert table to clipboard format:",f.error.message),c({message:o({defaultMessage:"Failed to copy table",id:"6PLluVvMhZ"}),description:o({defaultMessage:"Table format is invalid",id:"LSnhEoAVyJ"}),variant:"error",timeout:5});return}const{markdownText:m,htmlText:p}=f.data;await gHe(m,p),s?.("clicked copy table",{source:"markdown"}),c({message:o({defaultMessage:"Table copied to clipboard",id:"cPHpHA3m/M"}),variant:"success",timeout:5})}catch(f){Wc.error("Failed to copy rich text:",f),c({message:o({defaultMessage:"Failed to copy table to clipboard",id:"GqiB7jDhXC"}),variant:"error",timeout:5})}finally{i(!1)}},[o,c,r,s]);return l.jsx(Te.div,{className:"flex",animate:{opacity:n?0:1},children:l.jsx(rt,{disabled:n||a,icon:B("copy"),onClick:u,size:"small",clickFeedback:!0,toolTip:o({defaultMessage:"Copy table",id:"uU7t5KxHne"}),variant:"noBackground",extraCSS:"aspect-square"})})});Use.displayName="CopyTableButton";function lJe({csvString:e,filename:t="perplexity.csv"}){if(typeof window>"u")throw new Error("Attempting to download a CSV file in a server context.");try{const n=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=window.URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s)}catch(n){throw n}}function Vse(){return d.useCallback(e=>{lJe(e)},[])}class vk{static stringArrayToCSV(t){return t.map(this.escapeCSVString).join(",")}static escapeCSVString(t){return`"${t.replace(/"/g,'""')}"`}static tableToCSV(t){if(t.tagName!=="table")throw new Error("Attempting to convert node of wrong tagName to CSV from 'table'");try{const n=[];let r="";return fr(t,{tagName:"thead"},s=>{const o=[];fr(s,{tagName:"th"},a=>{const i=BO(a);o.push(i)}),n.push(this.stringArrayToCSV(o)),r+=o.join("-").replace(/[^a-z0-9\\-]/gi,"")}),fr(t,{tagName:"tbody"},s=>{fr(s,{tagName:"tr"},o=>{const a=[];fr(o,{tagName:"td"},i=>{const c=BO(i);a.push(c)}),n.push(this.stringArrayToCSV(a))})}),{csvString:n.join(` -`),filename:r}}catch(n){throw new Error(`Error attempting to convert table node to CSV string: ${n}`)}}}const BO=e=>{const t=[];let n="";fr(e,[{type:"text"},{tagName:"br"},{tagName:"a"}],s=>{if(s.type==="element"&&s.tagName==="br"){t.push(` -`);return}s.type==="element"&&s.tagName==="a"&&s.properties?.href&&(n=String(s.properties.href)),s.type==="text"&&t.push(s.value.trim())});const r=t.join("");return r?r.replace(/\s*\[\d+\]\s*/g," ").replace(/[ \t]+/g," ").trim():n},Hse=T.memo(function(t){const{isFinal:n,tableNode:r,trackEvent:s}=t,o=Vse(),{$t:a}=J(),i=d.useCallback(()=>{const c=vk.tableToCSV(r);o(c),s?.("clicked download table as csv",{source:"markdown"})},[o,r,s]);return l.jsx(Te.div,{className:"flex",animate:{opacity:n?1:0},children:l.jsx(rt,{disabled:!n,icon:B("download"),onClick:i,size:"small",toolTip:a({defaultMessage:"Download CSV",id:"fBhctxdFka"}),variant:"noBackground",extraCSS:"aspect-square"})})});Hse.displayName="DownloadTableAsCSV";const cJe=e=>{const{embedded:t,isCSVDownloadEnabled:n=!1,isSaveTableAsFileEnabled:r=!1,isCopyTableToClipboardEnabled:s=!1,isFinal:o=!0,trackEvent:a}=e;return T.memo(({node:c,...u})=>{const f=T.useRef(null),m=(n||r)&&o;return l.jsxs("div",{className:"group relative",children:[l.jsx(K,{className:z("w-full overflow-x-auto",{"md:max-w-[90vw]":!t}),children:l.jsx("table",{ref:f,className:"border-subtler my-[1em] w-full table-auto border-separate border-spacing-0 border-l border-t",...u})}),m&&l.jsxs("div",{className:z("bg-base border-subtler shadow-subtle pointer-coarse:opacity-100 right-xs absolute bottom-0 flex rounded-lg border opacity-0 transition-opacity group-hover:opacity-100","[&>*:not(:first-child)]:border-subtle [&>*:not(:first-child)]:border-l"),children:[r&&e.saveTableAsFile&&l.jsx(e.saveTableAsFile,{isFinal:o,tableNode:c,trackEvent:a}),s&&l.jsx(Use,{isDisabled:!o,tableRef:f,trackEvent:a}),n&&l.jsx(Hse,{isFinal:o,tableNode:c,trackEvent:a})]})]})})},zse=T.memo(({node:e,isHeader:t,...n})=>l.jsx("td",{className:"px-sm border-subtler min-w-[48px] break-normal border-b border-r",...n}));zse.displayName="TableCell";const Wse=T.memo(({node:e,...t})=>l.jsx("thead",{className:"bg-subtler",...t}));Wse.displayName="TableHeader";const Gse=T.memo(({node:e,...t})=>l.jsx("th",{className:"border-subtler p-sm break-normal border-b border-r text-left align-top",...t}));Gse.displayName="TableHeaderCell";const uJe=/^$/,dJe=()=>e=>{fr(e,"raw",(t,n,r)=>{n!=null&&uJe.test(t.value)&&r&&(r.children[n]={type:"element",tagName:"br",position:t.position,properties:{},children:[]})})},$se=e=>e.type=="element"&&e.tagName=="span"&&e.properties?.className=="whitespace-nowrap"&&e.children.length==2,fJe=e=>$se(e)?e.children[0]:e,mJe=()=>e=>{fr(e,{tagName:"a"},(t,n,r)=>{if(t.properties?.title!="_citation"||n===null)return _s;const s=n!=null?r?.children[n+1]:void 0;if(s?.type!="text"||s.value.charAt(0)!=".")return _s;t.properties.className=(t.properties.className||"")+" mr-[2px]",r&&n!=null&&(r.children[n]={type:"element",tagName:"span",properties:{className:"whitespace-nowrap"},children:[t,{type:"text",value:"."}]}),s.value=s.value.slice(1)})};function pJe(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&Array.isArray(t.citations)?{success:!0,group:{category:t.category||"web",overflowCount:Number(t.overflowCount)||0,citations:t.citations,isGrouped:t.overflowCount>0,totalCount:t.citations.length,isHidden:!!t.isHidden}}:{success:!1}}catch{return{success:!1}}}const hJe=(e,t)=>function(n){let r=0;fr(n,"element",s=>{const o=$se(s)?fJe(s):s;if(o.tagName!=="a")return mf;const[a]=o.children;if(a&&a.type==="text"){const i=k4(a.value,e);if(i){const c=t.find(f=>f.index===r),u=o.data||{};if(o.data=u,u.webResult=i,u.webResultCitation=c,o.properties&&typeof o.properties=="object"&&o.properties?.dataCitationGroup){const f=o.properties.dataCitationGroup;if(f.startsWith("{")&&f.endsWith("}")){const m=pJe(f);m.success&&(u.citationGroup=m.group)}}return r+=1,_s}}return _s})},gJe=e=>t=>{if(!e?.length)return;const n=e[0],r=[];e.length===1?r.push({mediaItem:n,overflowCount:0}):e.length>1&&r.push({mediaItem:n,overflowCount:e.length-1});const s=r.map(({mediaItem:i,overflowCount:c})=>({type:"element",tagName:"span",properties:{className:["select-none","ml-1","inline","align-baseline"]},children:[{type:"text",value:(f=>f.url?sg(f.url):f.name||"img")(i)}],data:{mediaItem:i,allMediaItems:e,isImageCitation:!0,component:"ImageCitation",citationType:"image",overflowCount:c}})),a=(i=>{const c=i.children.slice().reverse().find(f=>f.type==="element"&&(f.tagName==="ul"||f.tagName==="ol"));if(c){const f=c.children.slice().reverse().find(m=>m.type==="element"&&m.tagName==="li");if(f){const m=f.children.slice().reverse().find(p=>p.type==="element"&&p.tagName==="p");return m||f}}const u=i.children.slice().reverse().find(f=>f.type==="element"&&f.tagName==="p");return u||null})(t);a?a.children.push(...s):t.children.push({type:"element",tagName:"span",properties:{className:["inline-flex","flex-wrap"]},children:s})},yJe=()=>function(e){fr(e,"element",function(t,n,r){if(t.tagName!=="code")return;const s=!(r&&r.tagName==="pre");t.data||(t.data={}),t.properties||(t.properties={}),t.properties.inline=s})},xJe=()=>{const e=(t,n)=>{for(let r=t;r{fr(t,{tagName:"p"},(n,r,s)=>{if(n.data??={},r!=null&&s){const o=e(r+1,s);n.data.nextIsParagraph=!!o&&o.type!=="comment"&&o.type!=="text"&&o.type!=="raw"&&o.type!=="link"&&o.type!=="break"&&o?.tagName=="p"}return _s})}},vJe="pplx://action/",bJe="pplx-href",_Je=()=>e=>{fr(e,"element",t=>{if(t.tagName!=="a")return mf;const n=t?.properties?.href?.toString()??"";if(!n.startsWith(vJe))return mf;const r=t;return r.tagName="button",r.properties={...r.properties,[bJe]:n,href:void 0,type:"button"},_s})},wJe="pplx://entity_chip/",qse=()=>e=>{fr(e,"element",t=>{if(t.tagName!=="a")return mf;const n=t?.properties?.href?.toString()??"";if(!n.startsWith(wJe))return mf;const r=XZe(n);if(!r)return _s;const s=t,o=s.properties?.className,a=Array.isArray(o)?o:[o].filter(Boolean);return s.properties={...s.properties,className:[...a,"entity-chip"],[xk]:r,title:Ise},_s})},CJe=()=>e=>{fr(e,"text",(t,n,r)=>(t.value==="​"&&n!=null&&r?.children.splice(n,1),_s))},cC=/[\t ]*(?:\r?\n|\r)/g,SJe=()=>e=>{fr(e,"text",(t,n,r)=>{const s=[];let o=0;const a=t.position?.start.offset??0;cC.lastIndex=0;let i=cC.exec(t.value);for(;i;){const c=i.index;if(o!==c){const u={start:{line:1,column:1,offset:o+a},end:{line:1,column:1,offset:c+a}};s.push({type:"text",value:t.value.slice(o,c),position:u})}s.push({type:"break"}),o=c+i[0].length,i=cC.exec(t.value)}if(s.length>0&&r&&typeof n=="number"){if(otypeof e=="object"&&"text"in e,kJe=(e,t,n,r,s,o,a)=>{let i=o||0;const c=t.map(u=>{const f=typeof u=="string"?u:u.text,m={start:{line:1,column:1,offset:i},end:{line:1,column:1,offset:i+f.length}};if(i+=f.length,e(f)){let p="#";return a&&(p=a(f)??""),{type:"link",url:p,title:s,children:[{type:"text",value:f,position:m}],...EJe(u)&&u.metadata?.citationGroup&&{data:{citationGroup:u.metadata.citationGroup,hProperties:{dataCitationGroup:JSON.stringify(u.metadata.citationGroup)}}}}}return{type:"text",value:f,position:m}});return r.children.splice(n,1,...c),n+c.length},UO=(e,t)=>({offset:(e.offset??0)+(t.offset??0),line:e.line+t.line-1,column:e.line==1?e.column+t.column-1:e.column}),Kse=(e,t,n=2)=>{n<0||e.position&&(e.position.start=UO(e.position.start,t),e.position.end=UO(e.position.end,t),e.children?.forEach(r=>Kse(r,t,n-1)))},MJe=(e,t)=>{const n=e[0]??"",r=parseInt(n.replace(/[[\]]/g,""),10),s=k4(n,t);return{citation:n,number:r,webResult:s,groupCategory:TJe(s),startIndex:e.index,endIndex:e.index+n.length}},TJe=e=>e?e.is_memory?"memory":e.is_attachment?"attachment":e.url&&Ji(e.url)?"youtube":"web":"web",AJe=e=>{if(e.length===0)return[];const t=e[0],n=[];let r=[t];for(let s=1;s{if(e.length<=1)return e;const t=e.reduce((n,r)=>{const s=r.groupCategory==="conversation_history"?"web":r.groupCategory;return n.has(s)?n.get(s).members.push(r):n.set(s,{representative:r,members:[r]}),n},new Map);return e.map(n=>{const r=n.groupCategory==="conversation_history"?"web":n.groupCategory,s=t.get(r),o=n===s.representative;return{...n,groupMetadata:{isGroupRepresentative:o,groupCategory:n.groupCategory,groupSize:o?s.members.length:1,groupCitations:s.members.map(a=>a.number)}}})},RJe=(e,t)=>{const n=[];let r=0;for(const s of t){const o=!s.groupMetadata||s.groupMetadata.isGroupRepresentative;if(s.startIndex>r){const a=e.slice(r,s.startIndex);a&&n.push(a)}n.push({text:s.citation,metadata:{citationGroup:{category:s.groupCategory,overflowCount:s.groupMetadata&&o?s.groupMetadata.groupSize-1:0,citations:s.groupMetadata?s.groupMetadata.groupCitations:[s.number],isHidden:s.groupMetadata&&!o}}}),r=s.endIndex}if(r{let{web_results:t,isAnchorLink:n,enableGrouping:r=!1}=e;t=Array.isArray(t)?t:[];const s=(i,c,u,f,m)=>kJe(p=>typeof p=="string"?m?.has(p)??vp.test(p):p.text?vp.test(p.text):!1,i,c,u,n?"_anchor_citation":"_citation",f,p=>{const h=typeof p=="string"?p:p.text;return k4(h,t)?.url??""}),o=(i,c)=>{if(c.length===0)return[i];const u=[];let f=0;for(const m of c)m.index>f&&u.push(i.slice(f,m.index)),u.push(m[0]),f=m.index+m[0].length;return f{fr(i,"text",(c,u,f)=>{if(!f||u==null||a.has(c))return _s;a.add(c);const m=[...c.value.matchAll(new RegExp(vp,"g"))];if(m.length===0)return _s;const p=new Set(m.map(g=>g[0]));if(f?.type==="link"&&c.value==f.url){const g=o(c.value,m);return f.url=g[0],_s}if(r){const g=m.map(v=>MJe(v,t)),y=AJe(g),x=RJe(c.value,y);return s(x,u,f,c.position?.start.offset,p)}const h=o(c.value,m);return s(h,u,f,c.position?.start.offset,p)})}},jJe=()=>e=>{fr(e,"list",t=>{t.spread=!0})},IJe=new RegExp('(?()`])(https?:\\/\\/[^\\s[\\]<>()"`]+)(?:\\[\\d+\\])+',"g"),PJe=/\[(https?:\/\/[^\s[\]<>()"`]+)\](?!\()/g,OJe=/\uff08(https?:\/\/[^\s[\]<>()"`\uff08\uff09]+)\uff09/g,LJe=/\*\*(https?:\/\/[^\s*<>()"`]+)\*\*/g,FJe=new RegExp(E4.source+"|"+DH.source,"g"),bk=(e,t)=>{if(typeof e!="string")return e;const n=e.replace(OJe,(r,s)=>`([${s}](${s}))`).replace(IJe,(r,s)=>`<${s}>${r.slice(s.length)}`).replace(PJe,(r,s)=>`[${s}](${s})`).replace(LJe,(r,s)=>`[**${s}**](${s})`);return t?n:n.replace(FJe,"")};function BJe(e,t){return function(...r){const s=e(...r);return function(o,a){try{return s(o,a)}catch(i){i.message.startsWith("KaTeX parse error")}return o}}}const Yse=(function(e){if(e==null)return HJe;if(typeof e=="string")return VJe(e);if(typeof e=="object")return UJe(e);if(typeof e=="function")return EN(e);throw new Error("Expected function, string, or array as `test`")});function UJe(e){const t=[];let n=-1;for(;++n0&&(o.properties.rel=[...p]),h&&(o.properties.target=h),f){const y=zm(t.contentProperties,o)||{};o.children.push({type:"element",tagName:"span",properties:Vc(y),children:Vc(f)})}}}})}}function zm(e,t){return typeof e=="function"?e(t):e}function VO(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function XJe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ZJe(e,t,n){const s=pb((n||{}).ignore||[]),o=JJe(t);let a=-1;for(;++a0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=w+1:(g!==w&&b.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(C)?b.push(...C):C&&b.push(C),g=w+_[0].length,v=!0),!p.global)break;_=p.exec(u.value)}return v?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=VO(e,"(");let o=VO(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Qse(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||nu(n)||db(n))&&(!t||n!==47)}Xse.peek=Cet;function het(){this.buffer()}function get(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yet(){this.buffer()}function xet(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vet(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bet(e){this.exit(e)}function _et(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wet(e){this.exit(e)}function Cet(){return"["}function Xse(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const a=n.enter("footnoteReference"),i=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),i(),a(),o+=s.move("]"),o}function Eet(){return{enter:{gfmFootnoteCallString:het,gfmFootnoteCall:get,gfmFootnoteDefinitionLabelString:yet,gfmFootnoteDefinition:xet},exit:{gfmFootnoteCallString:vet,gfmFootnoteCall:bet,gfmFootnoteDefinitionLabelString:_et,gfmFootnoteDefinition:wet}}}function ket(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Xse},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,a){const i=o.createTracker(a);let c=i.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return c+=i.move(o.safe(o.associationId(r),{before:c,after:"]"})),f(),c+=i.move("]:"),r.children&&r.children.length>0&&(i.shift(4),c+=i.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,i.current()),t?Zse:Met))),u(),c}}function Met(e,t,n){return t===0?e:Zse(e,t,n)}function Zse(e,t,n){return(n?"":" ")+e}const Tet=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Jse.peek=jet;function Aet(){return{canContainEols:["delete"],enter:{strikethrough:Ret},exit:{strikethrough:Det}}}function Net(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Tet}],handlers:{delete:Jse}}}function Ret(e){this.enter({type:"delete",children:[]},e)}function Det(e){this.exit(e)}function Jse(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function jet(){return"~"}function Iet(e){return e.length}function Pet(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Iet,o=[],a=[],i=[],c=[];let u=0,f=-1;for(;++fu&&(u=e[f].length);++vc[v])&&(c[v]=_)}y.push(b)}a[f]=y,i[f]=x}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=b),h[m]=b),p[m]=_}a.splice(1,0,p),i.splice(1,0,h),f=-1;const g=[];for(;++f "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Fet);return s(),a}function Fet(e,t,n){return">"+(n?"":" ")+e}function Bet(e,t){return zO(e,t.inConstruct,!0)&&!zO(e,t.notInConstruct,!1)}function zO(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=o):o=1,s=r+t.length,r=n.indexOf(t,s);return a}function Uet(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Vet(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Het(e,t,n,r){const s=Vet(n),o=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(Uet(e,n)){const m=n.enter("codeIndented"),p=n.indentLines(o,zet);return m(),p}const i=n.createTracker(r),c=s.repeat(Math.max(eoe(o,s)+1,3)),u=n.enter("codeFenced");let f=i.move(c);if(e.lang){const m=n.enter(`codeFencedLang${a}`);f+=i.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...i.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${a}`);f+=i.move(" "),f+=i.move(n.safe(e.meta,{before:f,after:` -`,encode:["`"],...i.current()})),m()}return f+=i.move(` -`),o&&(f+=i.move(o+` -`)),f+=i.move(c),u(),f}function zet(e,t,n){return(n?"":" ")+e}function kN(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Wet(e,t,n,r){const s=kN(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),i(),!e.url||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),i(),e.title&&(i=n.enter(`title${o}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),a(),u}function Get(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Mh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function L2(e,t,n){const r=ff(e),s=ff(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}toe.peek=$et;function toe(e,t,n,r){const s=Get(n),o=n.enter("emphasis"),a=n.createTracker(r),i=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:i,...a.current()}));const u=c.charCodeAt(0),f=L2(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Mh(u)+c.slice(1));const m=c.charCodeAt(c.length-1),p=L2(r.after.charCodeAt(0),m,s);p.inside&&(c=c.slice(0,-1)+Mh(m));const h=a.move(s);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},i+c+h}function $et(e,t,n){return n.options.emphasis||"*"}function qet(e,t){let n=!1;return fr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,mk}),!!((!e.depth||e.depth<3)&&fN(e)&&(t.options.setext||n))}function Ket(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(qet(e,n)){const f=n.enter("headingSetext"),m=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),f(),p+` -`+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` -`))+1))}const a="#".repeat(s),i=n.enter("headingAtx"),c=n.enter("phrasing");o.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(u)&&(u=Mh(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),i(),u}noe.peek=Yet;function noe(e){return e.value||""}function Yet(){return"<"}roe.peek=Qet;function roe(e,t,n,r){const s=kN(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),i(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),i(),e.title&&(i=n.enter(`title${o}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),u+=c.move(")"),a(),u}function Qet(){return"!"}soe.peek=Xet;function soe(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const i=n.createTracker(r);let c=i.move("![");const u=n.safe(e.alt,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return a(),n.stack=f,o(),s==="full"||!u||u!==m?c+=i.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function Xet(){return"!"}ooe.peek=Zet;function ooe(e,t,n){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}ioe.peek=Jet;function ioe(e,t,n,r){const s=kN(n),o=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let i,c;if(aoe(e,n)){const f=n.stack;n.stack=[],i=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),i(),n.stack=f,m}i=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${o}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),i(),u}function Jet(e,t,n){return aoe(e,n)?"<":"["}loe.peek=ett;function loe(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const i=n.createTracker(r);let c=i.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return a(),n.stack=f,o(),s==="full"||!u||u!==m?c+=i.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function ett(){return"["}function MN(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ttt(e){const t=MN(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ntt(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function coe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function rtt(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?ntt(n):MN(n);const i=e.ordered?a==="."?")":".":ttt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),coe(n)===a&&f){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const i=n.createTracker(r);i.move(o+" ".repeat(a-o.length)),i.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,i.current()),f);return c(),u;function f(m,p,h){return p?(h?"":" ".repeat(a))+m:(h?o:o+" ".repeat(a-o.length))+m}}function att(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),s(),a}const itt=pb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ltt(e,t,n,r){return(e.children.some(function(a){return itt(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ctt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}uoe.peek=utt;function uoe(e,t,n,r){const s=ctt(n),o=n.enter("strong"),a=n.createTracker(r),i=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:i,...a.current()}));const u=c.charCodeAt(0),f=L2(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Mh(u)+c.slice(1));const m=c.charCodeAt(c.length-1),p=L2(r.after.charCodeAt(0),m,s);p.inside&&(c=c.slice(0,-1)+Mh(m));const h=a.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},i+c+h}function utt(e,t,n){return n.options.strong||"*"}function dtt(e,t,n,r){return n.safe(e.value,r)}function ftt(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function mtt(e,t,n){const r=(coe(n)+(n.options.ruleSpaces?" ":"")).repeat(ftt(n));return n.options.ruleSpaces?r.slice(0,-1):r}const doe={blockquote:Let,break:WO,code:Het,definition:Wet,emphasis:toe,hardBreak:WO,heading:Ket,html:noe,image:roe,imageReference:soe,inlineCode:ooe,link:ioe,linkReference:loe,list:rtt,listItem:ott,paragraph:att,root:ltt,strong:uoe,text:dtt,thematicBreak:mtt};function ptt(){return{enter:{table:htt,tableData:GO,tableHeader:GO,tableRow:ytt},exit:{codeText:xtt,table:gtt,tableData:mC,tableHeader:mC,tableRow:mC}}}function htt(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function gtt(e){this.exit(e),this.data.inTable=void 0}function ytt(e){this.enter({type:"tableRow",children:[]},e)}function mC(e){this.exit(e)}function GO(e){this.enter({type:"tableCell",children:[]},e)}function xtt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vtt));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vtt(e,t){return t==="|"?t:e}function btt(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:c,tableRow:i}};function a(h,g,y,x){return u(f(h,y,x),h.align)}function i(h,g,y,x){const v=m(h,y,x),b=u([v]);return b.slice(0,b.indexOf(` -`))}function c(h,g,y,x){const v=y.enter("tableCell"),b=y.enter("phrasing"),_=y.containerPhrasing(h,{...x,before:o,after:o});return b(),v(),_}function u(h,g){return Pet(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function f(h,g,y){const x=h.children;let v=-1;const b=[],_=g.enter("table");for(;++v0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Ftt={tokenize:$tt,partial:!0};function Btt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ztt,continuation:{tokenize:Wtt},exit:Gtt}},text:{91:{name:"gfmFootnoteCall",tokenize:Htt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Utt,resolveTo:Vtt}}}}function Utt(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return i;function i(c){if(!a||!a._balanced)return n(c);const u=ha(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Vtt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},i=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...i),e}function Htt(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return i;function i(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){if(o>999||m===93&&!a||m===null||m===91||Rn(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(ha(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Rn(m)||(a=!0),o++,e.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}}function ztt(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,i;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(g)}function f(g){if(a>999||g===93&&!i||g===null||g===91||Rn(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return o=ha(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Rn(g)||(i=!0),a++,e.consume(g),g===92?m:f}function m(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ht(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return t(g)}}function Wtt(e,t,n){return e.check(Kg,t,e.attempt(Ftt,t,n))}function Gtt(e){e.exit("gfmFootnoteDefinition")}function $tt(e,t,n){const r=this;return Ht(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function qtt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,i){let c=-1;for(;++c1?c(g):(a.consume(g),m++,h);if(m<2&&!n)return c(g);const x=a.exit("strikethroughSequenceTemporary"),v=ff(g);return x._open=!v||v===2&&!!y,x._close=!y||y===2&&!!v,i(g)}}}class Ktt{constructor(){this.map=[]}add(t,n,r){Ytt(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const o of s)t.push(o);s=r.pop()}this.map.length=0}}function Ytt(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const P=r.events[M][1].type;if(P==="lineEnding"||P==="linePrefix")M--;else break}const A=M>-1?r.events[M][1].type:null,D=A==="tableHead"||A==="tableRow"?C:c;return D===C&&r.parser.lazy[r.now().line]?n(I):D(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):st(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),h):n(I):Qt(I)?Ht(e,f,"whitespace")(I):(o+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||Rn(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:m)}function p(I){return I===92||I===124?(e.consume(I),m):m(I)}function h(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Qt(I)?Ht(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?x(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):S(I)}function y(I){return Qt(I)?Ht(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),v):I===45?(o+=1,v(I)):I===null||st(I)?w(I):S(I)}function v(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):S(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Qt(I)?Ht(e,w,"whitespace")(I):w(I)}function w(I){return I===124?g(I):I===null||st(I)?!a||s!==o?S(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):S(I)}function S(I){return n(I)}function C(I){return e.enter("tableRow"),E(I)}function E(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),E):I===null||st(I)?(e.exit("tableRow"),t(I)):Qt(I)?Ht(e,E,"whitespace")(I):(e.enter("data"),N(I))}function N(I){return I===null||I===124||Rn(I)?(e.exit("data"),E(I)):(e.consume(I),I===92?k:N)}function k(I){return I===92||I===124?(e.consume(I),N):N(I)}}function Jtt(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],a=[0,0,0,0],i=!1,c=0,u,f,m;const p=new Ktt;for(;++nn[2]+1){const g=n[2]+1,y=n[3]-n[2]-1;e.add(g,y,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(o.end=Object.assign({},Ju(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function qO(e,t,n,r,s){const o=[],a=Ju(t.events,n);s&&(s.end=Object.assign({},a),o.push(["exit",s,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Ju(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ent={name:"tasklistCheck",tokenize:nnt};function tnt(){return{text:{91:ent}}}function nnt(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return Rn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):n(c)}function i(c){return st(c)?t(c):Qt(c)?e.check({tokenize:rnt},t,n)(c):n(c)}}function rnt(e,t,n){return Ht(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function snt(e){return Zre([Att(),Btt(),qtt(e),Xtt(),tnt()])}const ont={};function ant(e){const t=this,n=e||ont,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(snt(n)),o.push(Ett()),a.push(ktt(n))}function int(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:i,mathText:a,mathTextData:i}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function t(){this.buffer()}function n(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=u;const m=f.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=u,f.data.hChildren.push({type:"text",value:u})}function i(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function lnt(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,a,i,c){const u=o.value||"",f=i.createTracker(c),m="$".repeat(Math.max(eoe(u,"$")+1,2)),p=i.enter("mathFlow");let h=f.move(m);if(o.meta){const g=i.enter("mathFlowMeta");h+=f.move(i.safe(o.meta,{after:` -`,before:h,encode:["$"],...f.current()})),g()}return h+=f.move(` -`),u&&(h+=f.move(u+` -`)),h+=f.move(m),p(),h}function r(o,a,i){let c=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const f="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++mimport("./index-D3QwY6q7.js"),__vite__mapDeps([461,462,463,3,4,1,8,9,6,7,10,11,12])),q(()=>import("./katex-CmGQIWW6.js").then(t=>t.a),__vite__mapDeps([462,463]))]).then(([{default:t}])=>{const n=e?[BJe(t),{throwOnError:!0}]:[t,{throwOnError:!1}];return ky=n,n}),x1)}const knt=({final:e,renderFollowUps:t,renderCitations:n,webResults:r,webResultCitations:s,imageCitations:o,inlineTokenAnnotations:a})=>{const[i,c]=d.useState(ky?{...QO,rehypeKatex:ky}:QO);return d.useEffect(()=>{ky||Ent(e).then(f=>{c(m=>({...m,rehypeKatex:f}))})},[e]),d.useMemo(()=>[...Object.values({...i,rehypePPLXActionLinks:t?_Je:null,rehypeCitations:n?[hJe,r,s??[]]:null,rehypeImageCitations:o?.length?[gJe,o]:null,rehypePPLXEntityLinks:Object.keys(a??{}).length>0?qse:null}).filter(f=>f!==null),CJe],[i,t,n,r,s,o,a])};function pC(e,t){const{animateIn:n=!0,once:r=!0}=t??{},{device:{isIOS:s}}=on(),o=!s&&n,a=d.useMemo(()=>o?c=>{const u=ec(!0),f={...c,className:z(c.className,{"animate-in fade-in-25 duration-700":!(r&&u)})};return l.jsx(e,{...f})}:void 0,[e,r,o]);return!o||!a?e:a}const _oe="prose dark:prose-invert inline leading-relaxed break-words min-w-0 [word-break:break-word] prose-strong:font-medium [&_>*:first-child]:mt-0",Mnt=d.memo(Ose),Tnt=d.memo(Lse),Ant=d.memo(Wse),Nnt=d.memo(zse),Rnt=d.memo(Gse),Dnt=d.memo(GZe),jnt=d.memo($Ze),v1=d.memo(qZe),Int=d.memo(kse),woe=({str:e,final:t=!1,webResults:n,inlineTokenAnnotations:r,embedded:s=!1,wrapInParent:o=!0,animateIn:a=!1,isAnchorLink:i=!1,testId:c,trackEvent:u,renderCitations:f=!0,enableCitationGrouping:m=!1,experiments:p={},markdownComponents:h={},citationSize:g="default",renderFollowUps:y=!0,webResultCitations:x,imageCitations:v,saveTableAsFile:b,onCitationClick:_,getAttachmentUrl:w,forceExternalHandler:S,openGallery:C,scrollContainerRef:E})=>{const{Paragraph:N=Bse,ListItem:k=Fse,Button:I=Sse,EntityChip:M}=h,{hideHoverCard:A,isDownloadTableAsCSVEnabled:D,isSaveTableAsFileEnabled:P,isCopyTableToClipboardEnabled:F}=p,R=d.useMemo(()=>{let re;return ce=>(Hn(re,ce,Hn)||(re=ce),re)},[]),j=d.useMemo(()=>{let re;return ce=>(Hn(re,ce,Hn)||(re=ce),re)},[]),L=R(n),U=j(x),O=d.useMemo(()=>r?.reduce((re,ce)=>(re[ce.id]=ce,re),{}),[r]),$=d.useMemo(()=>boe.concat([f&&[DJe,{web_results:L,isAnchorLink:i,enableGrouping:m}],jJe].filter(Boolean)),[f,L,i,m]),G=knt({final:t,renderFollowUps:y,renderCitations:f,webResults:L,webResultCitations:U,imageCitations:v,inlineTokenAnnotations:O}),H=pC(N,{animateIn:a,once:!1}),Q=pC(k,{animateIn:a,once:!1}),Y=pC(Mse,{animateIn:a}),te=d.useMemo(()=>cJe({embedded:s,isCSVDownloadEnabled:D,isSaveTableAsFileEnabled:P,isCopyTableToClipboardEnabled:F,isFinal:t,trackEvent:u,saveTableAsFile:b}),[s,D,P,F,t,u,b]),se=d.useMemo(()=>WZe({trackEvent:u}),[u]),ae=d.useMemo(()=>({hideHoverCard:A,trackEvent:u,citationSize:g,onCitationClick:_,getAttachmentUrl:w,enableCitationGrouping:m,webResults:L,inlineTokenAnnotationsLookup:O,EntityChipComponent:M,forceExternalHandler:S,scrollContainerRef:E}),[A,u,g,_,w,m,L,M,S,O,E]),X=d.useMemo(()=>({children:ce,className:ue,node:pe,...xe})=>pe?.data?.isImageCitation&&pe?.data?.component==="ImageCitation"?l.jsx(Cse,{mediaItem:pe.data.mediaItem,allMediaItems:pe.data.allMediaItems,overflowCount:pe.data.overflowCount||0,className:Array.isArray(ue)?ue.join(" "):ue,openGallery:C}):l.jsx("span",{className:Array.isArray(ue)?ue.join(" "):ue,...xe,children:ce}),[C]),ee=d.useMemo(()=>sJe(s),[s]),le=d.useMemo(()=>({p:H,ol:Mnt,hr:Int,ul:Tnt,li:Q,table:te,thead:Ant,td:Nnt,th:Rnt,pre:ee,code:se,img:Y,a:rJe,h1:Dnt,h2:jnt,h3:v1,h4:v1,h5:v1,h6:v1,button:I,span:X}),[H,Q,te,se,Y,ee,I,X]);return l.jsx(Ar,{fallback:null,children:l.jsx(Pse.Provider,{value:ae,children:l.jsx(UZe,{className:o?_oe:void 0,remarkPlugins:$,rehypePlugins:G,unwrapDisallowed:!0,components:le,"data-test-id":c,children:bk(e,f)})})})},Coe=T.memo(woe,({webResults:e,inlineTokenAnnotations:t,...n},{webResults:r,inlineTokenAnnotations:s,...o})=>{const a=t?.length===s?.length&&!!t?.every((i,c)=>i.progress===s?.[c]?.progress);return Hn(n,o)&&Hn(e,r,Hn)&&a});Coe.displayName="MarkdownRenderer";const Pnt=e=>{let t=0;return r=>{const s=[];for(;e.length;){const o=e.shift();if(t+=o.length,t>=r){s.push(o.slice(0,o.length+r-t));const a=o.slice(o.length+r-t);a&&(e.unshift(a),t-=a.length);break}s.push(o)}return s}},XO=bse().use(dse).use(boe);function ZO(e,t){const n=XO.runSync(XO.parse(e),e);return t&&Kse(n,t),n}const Ont=/(\s+)/g,Lnt=[/(\*\*)/g,/(__)/g],Fnt=10;function Bnt(e,t){if(!e.children.every(o=>{const a=o.position?.start.offset,i=o.position?.end.offset;return(a||a==0)&&(i||i==0)}))return[t];const n=o=>{Lnt.forEach(a=>{const c=o.join("").split(a);if((c.length-1)/2%2==1){const f=c.pop(),m=c.pop();if((f.split(Ont).length+1)/2=0;g--){const y=o[g],x=y.length-h;if(x>0){o[g]=y.slice(0,x);break}else o.pop(),h-=y.length}}}})},r=Pnt(t),s=[];return e.children.forEach((o,a)=>{r(o.position?.start.offset);const i=r(o.position?.end.offset);a==e.children.length-1&&n(i),s.push(i)}),s}const Soe=({chunks:e,webResults:t,embedded:n,rendererProps:r,testId:s,webResultCitations:o,imageCitations:a,onCitationClick:i,enableCitationGrouping:c,inlineTokenAnnotations:u})=>{const f=d.useMemo(()=>{let m,p=[],h="";return g=>{const y=g.slice(),x=p.every((b,_)=>b==y[_]),v=y.slice(p.length);if(!x||!m||!m.children.length)h=bk(y.join(""),!0),m=ZO(h);else{const b=m.children.pop(),_=h.slice(b.position?.start.offset),w=bk(v.join(""),!0),S=_+w;h=h.slice(0,b.position?.start.offset)+S;const C=ZO(S,b.position?.start);m.children.push(...C.children)}return p=y.slice(),Bnt(m,[h])}},[]);return l.jsx("div",{className:_oe,"data-test-id":s,children:f(e).map((m,p)=>l.jsx(T.Fragment,{children:l.jsx(Coe,{str:m.join(""),webResults:t,final:!1,embedded:n,wrapInParent:!1,animateIn:!0,onCitationClick:i,...r,webResultCitations:o,imageCitations:a,enableCitationGrouping:c,inlineTokenAnnotations:u})},p))})},Unt=T.memo(Soe,({webResults:e,chunks:t,...n},{webResults:r,chunks:s,...o})=>Hn(n,o)&&Hn(e,r,Hn)&&Hn(t,s,Hn));Unt.displayName="MarkdownStreamer";const Vnt=40,Hnt=40,znt=10,Wnt=e=>e.previousSibling?e.previousSibling:e.parentNode?e.parentNode.previousSibling:null,My=512,Gnt=e=>{const t=e.startContainer,n=e.startOffset;if(t.nodeType!==Node.TEXT_NODE)return["",""];let r=t.textContent?.slice(0,n)||"",s=r,o=!1,a=t;for(let i=0;i<10&&(a=Wnt(a),!(!a||r.length>My));i++){if(a.nodeType===Node.TEXT_NODE&&a.textContent===` -`&&(o=!0),a.nodeType===Node.TEXT_NODE)r=(a.textContent||"")+r;else if(a.nodeType===Node.ELEMENT_NODE){const c=/^\d+\.$/,u=/^\d+\.?$/;c.test(a.textContent||"")?r="."+r:u.test(a.textContent||"")||(r=a.textContent+r)}o||(s=r)}return s.length>My?r=s:r=r.slice(-My),[s,r]},$nt=e=>e.nextSibling?e.nextSibling:e.parentNode?e.parentNode.nextSibling:null,qnt=e=>{const t=e.endContainer,n=e.endOffset;if(t.nodeType!==Node.TEXT_NODE)return"";let r=t.textContent?.slice(n)||"",s=t;for(let o=0;o<5&&(s=$nt(s),!(!s||s.nodeType===Node.TEXT_NODE&&s.textContent===` -`));o++)s.nodeType===Node.TEXT_NODE?r+=s.textContent:s.nodeType===Node.ELEMENT_NODE&&/^\d+\.$/.test(s.textContent||"")&&(r+=".");return r.slice(0,My)},Eoe=T.memo(({embedded:e,isAnchorLink:t,isPending:n=!1,rendererTestId:r,response:s,streamerTestId:o,trackEvent:a,renderCitations:i=!0,experiments:c,markdownComponents:u,wrapInParent:f=!0,citationSize:m="default",webResultCitations:p,imageCitations:h,onCheckSources:g,onQuoteSelect:y,onOpenInSideDocument:x,saveTableAsFile:v,onCitationClick:b,getAttachmentUrl:_,enableCitationGrouping:w=!1,ref:S,forceExternalHandler:C,openGallery:E,scrollContainerRef:N})=>{const k=J(),I=d.useRef(null),M=d.useRef(null),[A,D]=d.useState(void 0),[P,F]=d.useState(void 0),R=k.formatMessage({defaultMessage:"Check sources",id:"AxT33TYx0b"}),j=k.formatMessage({defaultMessage:"Add to follow-up",id:"EgzsNJ7SZP"}),L=g||y||x,U=d.useCallback(()=>{if(!L)return;F(void 0);const X=window.getSelection();if(!X||!X.toString().trim()||!I.current){F(void 0);return}if(!I.current.contains(X.anchorNode)||!I.current.contains(X.focusNode)){F(void 0);return}const ee=X.getRangeAt(0),le=ee.getClientRects();if(le.length===0){F(void 0);return}const re=le[0],ue=le[le.length-1].bottom-re.top,pe=ee.cloneContents();pe.querySelectorAll(".select-none").forEach(we=>we.remove());const he=pe.textContent?.trim(),_e=I.current.getBoundingClientRect(),[ke,De]=Gnt(ee),Ce=he||X.toString(),Be=qnt(ee);F({rect:re,relativeTop:re.top-_e.top,relativeLeft:re.left-_e.left,quote:{extendedBeforeContext:De,beforeContext:ke,selectedText:Ce,afterContext:Be},totalHeight:ue})},[L]),O=d.useCallback(()=>{const X=window.getSelection();(!X||!X.toString().trim())&&F(void 0)},[]);d.useEffect(()=>{if(L)return document.addEventListener("mouseup",U),document.addEventListener("selectionchange",O),()=>{document.removeEventListener("mouseup",U),document.removeEventListener("selectionchange",O)}},[U,O,L]);const $=d.useCallback(()=>{if(y&&P?.quote){const X=P?.quote.selectedText.trim();window.getSelection()?.removeAllRanges(),F(void 0),y(X),a?.("click quote reply",{selectedText:X})}},[P?.quote,y,a]),G=d.useCallback(()=>{g&&P?.quote&&(window.getSelection()?.removeAllRanges(),F(void 0),g(P?.quote),a?.("click check sources",{extendedBeforeContext:P?.quote.extendedBeforeContext,beforeContext:P?.quote.beforeContext,selectedText:P?.quote.selectedText,afterContext:P?.quote.afterContext}))},[P?.quote,g,a]);d.useEffect(()=>{P?.rect&&M.current&&D(M.current.getBoundingClientRect().width)},[P?.rect]);const H=d.useCallback(()=>{x&&P?.quote&&(x(P?.quote),F(void 0),a?.("click open in document",{extendedBeforeContext:P?.quote.extendedBeforeContext,beforeContext:P?.quote.beforeContext,selectedText:P?.quote.selectedText,afterContext:P?.quote.afterContext}))},[P?.quote,x,a]),Q=(X,ee=0,le=0)=>X?ee+le+znt:ee-Vnt,te=(()=>{if(!P?.rect||!I.current||!A)return null;const X=I.current.getBoundingClientRect(),ee=Math.min(P.relativeLeft||0,X.width-A),le=(P.relativeTop||0)({experiments:c,markdownComponents:u,citationSize:m,forceExternalHandler:C,renderCitations:i,scrollContainerRef:N}),[m,c,u,C,i,N]),ae=d.useMemo(()=>{const X=[];return y&&X.push({action:$,text:j}),g&&X.push({action:G,text:R}),x&&X.push({action:H,text:k.formatMessage({defaultMessage:"View in file",id:"owm3XhJD2c"})}),X},[y,$,j,g,G,R,x,H,k]);return l.jsxs("div",{ref:XK([I,S]),className:"relative",children:[s&&n&&s.chunks&&l.jsx(Soe,{chunks:s.chunks,webResults:s.web_results,embedded:e,testId:o,rendererProps:se,webResultCitations:p,imageCitations:h,onCitationClick:b,enableCitationGrouping:w,inlineTokenAnnotations:s.inline_token_annotations}),s&&!n&&s.answer&&l.jsx(woe,{str:s.answer,webResults:s.web_results,final:!0,embedded:e,isAnchorLink:t,trackEvent:a,testId:r,renderCitations:i,enableCitationGrouping:w,experiments:c,markdownComponents:u,wrapInParent:f,citationSize:m,webResultCitations:p,imageCitations:h,saveTableAsFile:v,onCitationClick:b,getAttachmentUrl:_,inlineTokenAnnotations:s.inline_token_annotations,forceExternalHandler:C,openGallery:E,scrollContainerRef:N}),ae.length>0&&P?.rect&&l.jsx("div",{ref:M,className:"absolute z-[5]",style:te||{visibility:"hidden"},children:l.jsx("div",{className:z("bg-base shadow-lg",ae.length>0?"rounded-lg":"rounded-full"),children:ae.map((X,ee)=>l.jsx(ze,{onClick:X.action,size:"small",text:X.text,variant:"primaryGhost",extraCSS:z("border transform-none active:transform-none active:scale-100 min-w-fit whitespace-nowrap",{"rounded-l-lg dark:rounded-l-lg":ee===0,"rounded-r-none":ae.length>1&&ee!==ae.length-1,"rounded-l-none":ee>0,"rounded-r-lg dark:rounded-r-lg":ee===ae.length-1,"!border-l-0":ee>0,"!rounded-full":ae.length==1})},ee))})})]})},({response:{answer:e,web_results:t,chunks:n,inline_token_annotations:r}={},...s},{response:{answer:o,web_results:a,chunks:i,inline_token_annotations:c}={},...u})=>{const f=r?.length===c?.length&&!!r?.every((m,p)=>m.progress===c?.[p]?.progress);return Hn(s,u)&&Hn(e,o)&&Hn(t,a,Hn)&&Hn(n,i,Hn)&&f});Eoe.displayName="MarkdownResponse";const Knt="gap-[7px]",Ynt="w-px border-l border-subtler",Qnt={initial:({animateEntry:e})=>({opacity:0,y:e?-8:0,transition:{opacity:{duration:.15},y:{duration:e?.15:0}}}),animate:{opacity:1,y:0,transition:{opacity:{duration:.15},y:{duration:.15}}},exit:({animateExit:e})=>({opacity:0,y:e?-8:0,transition:{opacity:{duration:.12},y:{duration:e?.12:0}}})},koe=T.memo(({cleanTitle:e,status:t,web_results:n})=>{const r=oN(),s=d.useMemo(()=>({Paragraph:({children:a})=>a}),[]),o=d.useMemo(()=>({answer:e,web_results:n}),[e,n]);return l.jsx("span",{className:"flex grow overflow-hidden py-[6px]",children:l.jsx(V,{className:"pr-sm block [&_code]:max-h-[300px] [&_code]:overflow-auto",variant:"small",color:t==="active"?"default":"light",inline:!0,children:l.jsx(Eoe,{response:o,markdownComponents:s,wrapInParent:!1,citationSize:"small",enableCitationGrouping:r})})})});koe.displayName="GoalTitle";const Xnt=({steps:e,status:t,trackSearchResultsStep:n,disableAnimations:r})=>{const s=d.useMemo(()=>e?hLe(e):[],[e]);return d.useMemo(()=>s?.map((o,a)=>{const i=a===(s?.length??0)-1,c=t==="finished"||!i;return l.jsx(Moe,{isFinished:c,index:a,step:o,disableAnimations:r,trackSearchResultsStep:n},`${o.uuid}-${a}`)}).filter(Boolean),[s,t,r,n])},Znt=T.memo(e=>{const{className:t="",title:n,status:r,steps:s,web_results:o=[],showStatus:a=!0,timelineGapClassName:i=Knt,animateEntry:c=!0,animateExit:u=!0,placeholder:f=!1,keepNewLines:m=!1,isFinalGoal:p=!1,disableAnimations:h=!1,ref:g,...y}=e,{session:x}=je(),{trackEvent:v}=Ke(x),b=n.replace(/^\n+|\n+$/g,"").replace(/\n/g,m?` -`:" "),_=r==="finished"||r==="loading"?r:"planned",w=d.useCallback(I=>{v("click citation",{citation_url:I,source:"researchStep"})},[v]),S=l.jsx(Xnt,{steps:s,status:r,trackSearchResultsStep:w,disableAnimations:h}),C=!!s?.length,[E,{height:N}]=ei(),k=!u&&c&&!h;return l.jsxs(Te.div,{ref:g,className:`group/goal relative flex overflow-hidden ${t} ${i}`,role:"listitem",initial:h?!1:k?{height:0}:"initial",animate:h?!1:k?{height:N||"auto"}:"animate",exit:h?void 0:"exit",transition:h?{duration:0}:k?{duration:.1,ease:"easeOut"}:void 0,variants:h?void 0:Qnt,custom:{animateEntry:c&&!h,animateExit:u&&!h},...y,children:[l.jsx("div",{className:"flex",children:l.jsx(Ore,{status:r,state:_,showStatus:a,timelineConnectorClassName:Ynt,hasSteps:C,isFinalGoal:p})},"timeline-container"),l.jsx("div",{className:"min-w-0 grow",children:l.jsxs("div",{ref:E,className:"flex flex-col",children:[l.jsx(koe,{cleanTitle:b,status:r,placeholder:f,web_results:o}),C&&l.jsx("div",{className:"pb-md gap-y-sm flex w-full flex-col empty:hidden group-last/goal:pb-0",children:l.jsx(kt,{children:S})})]},"content-container")})]})},(e,t)=>!["id","status","title","steps","isFinalGoal"].some(s=>!BJ(e[s],t[s]))),Moe=T.memo(({isFinished:e,index:t,step:n,disableAnimations:r,trackSearchResultsStep:s})=>{const o=n.step_type==="SEARCH_RESULTS"?s:void 0,a=d.useMemo(()=>({id:n.uuid,initial:r?!1:{opacity:0,x:-10},animate:r?!1:{opacity:1,x:0},exit:r?void 0:{opacity:0,x:10},transition:r?{duration:0}:{duration:.2,delay:t*.05,ease:Xd}}),[r,t,n.uuid]);return l.jsx(sN,{step:n,isFinished:e,onStepClick:o,motionProps:a,disableAnimations:r},`${n.uuid}-${t}`)});Moe.displayName="StepRendererFactory";const Toe=T.memo(({visibleGoals:e,isAgentWorkflowInFlight:t,forceShowAll:n,disableAnimations:r})=>l.jsx("div",{className:"relative z-0 flex flex-col",children:l.jsxs("div",{className:"relative pl-px",children:[l.jsx(kt,{mode:t&&!n?"wait":void 0,children:e.map(s=>s?l.jsx(Znt,{id:s.id,status:s.status,steps:s.steps,web_results:s.web_results,title:s.title,animateEntry:s.animateEntry,animateExit:!!(t&&!n),isFinalGoal:s.isFinalGoal,keepNewLines:!0,disableAnimations:s.disableAnimations||r&&s.status==="finished"},s.key):null)}),l.jsx("div",{className:"-mx-lg from-base to-base/0 absolute bottom-0 z-20 h-3 w-full bg-gradient-to-t"})]})}));Toe.displayName="GoalsList";const Jnt=[],ert=({hasPendingFiles:e,attachments:t=Ie,attachment_processing_progress:n=Ie})=>{const{$t:r}=J(),s=d.useMemo(()=>e?[{description:r({defaultMessage:"Processing attachments...",id:"nCVqMMwJ07"}),final:!1,id:"pending-files-goal",steps:[{step_type:"PENDING_FILES",content:{attachments:t,attachmentProcessingProgress:n},uuid:"pending-files-step"}]}]:Jnt,[r,n,t,e]),o=d.useMemo(()=>!e||n.some(i=>i.file_url==="end"),[n,e]),a=d.useMemo(()=>o?null:s.length>0?s[0]:null,[o,s]);return{pendingFilesGoals:s,activePendingFileGoal:a,isFileProcessingDone:o}},trt=({researchPlan:e,reasoningPlan:t,hasAnswer:n,isProReasoningMode:r})=>{const s=t?.goals?.slice(1)??Ie,o=d.useMemo(()=>!e||n||r&&s.length>0,[e,n,r,s.length]),a=d.useMemo(()=>!t&&!r||!!t?.final,[t,r]),i=n&&a&&o,c=d.useMemo(()=>a?null:t?.goals[t.goals.length-1],[t,a]);return{reasoningGoals:s,isResearchPlanFinished:o,isReasoningPlanFinished:a,isAllPlansFinished:i,activeReasoningGoal:c}},nrt=({researchPlan:e,steps:t,searchMode:n,isResearchPlanFinished:r,backendUUID:s})=>{const o=n===oe.RESEARCH,a=n===oe.STUDIO,i=rrt({backendUUID:s,steps:t,isResearchPlanFinished:r}),c=srt({backendUUID:s,steps:t,isResearchPlanFinished:r}),u=d.useMemo(()=>{if(!e)return{};if(e.goals.length===1){const p=e.goals[0];return p?{[p.id]:{...p,steps:t.filter(h=>h.step_type!=="INITIAL_QUERY"&&h.step_type!=="TERMINATE")}}:{}}return e.goals.reduce((p,h)=>{const g={...h,steps:t.filter(y=>"goal_id"in y.content?y.content.goal_id===h.id&&y.step_type!=="INITIAL_QUERY"&&y.step_type!=="TERMINATE":!1)};return p[g.id]=g,p},{})},[e,t]),f=d.useMemo(()=>{const p=Object.keys(u);if(p.length===0)return null;const h=t.at(-1),g=p.at(-1);return g?((o||a)&&h?.step_type!=="TERMINATE",u[g]):null},[u,t,o,a]),m=d.useMemo(()=>[...Object.values(u),...i,...c],[u,i,c]);return d.useMemo(()=>({activeResearchGoal:f,researchGoals:m}),[f,m])},rrt=({backendUUID:e,steps:t,isResearchPlanFinished:n})=>{const r=J(),{pendingClarifications:s,clearClarifications:o}=Dv(),a=d.useMemo(()=>{if(n||!e)return[];const i=new Set(t.map(f=>f.uuid)),c=new Set;return t.forEach(f=>{f.step_type==="CLARIFYING_QUESTIONS_OUTPUT"&&f.content?.clarification&&c.add(f.content.clarification)}),s.filter(f=>f.entryUUID===e&&!i.has(f.UUID)&&!c.has(f.content)).map((f,m)=>({description:f.question??r.formatMessage({defaultMessage:"I'll consider the details you added.",id:"46H8Trfeps"}),final:!1,id:`c-${m}`,steps:[{content:{goal_id:`c-${m}`,clarification:f.content,question:f.question},step_type:"CLARIFYING_QUESTIONS_OUTPUT",uuid:f.UUID}]}))},[r,s,e,n,t]);return d.useEffect(()=>{n&&s.length&&o()},[o,n,s]),a},srt=({backendUUID:e,steps:t,isResearchPlanFinished:n})=>{const r=J(),{pendingSuggestions:s,clearPendingSuggestions:o}=Dv(),a=d.useMemo(()=>{if(n||!e)return[];const i=new Set(t.map(f=>f.uuid)),c=new Set;return t.forEach(f=>{f.step_type==="IN_CONTEXT_SUGGESTIONS_OUTPUT"&&f.content?.selected_suggestion&&c.add(f.content.selected_suggestion)}),s.filter(f=>f.entryUUID===e&&!i.has(f.UUID)&&!c.has(f.suggestion)).map((f,m)=>({description:r.formatMessage({defaultMessage:"I'll refine my research based on your selection.",id:"SXOuvFDKhd"}),final:!1,id:`s-${m}`,steps:[{content:{goal_id:`s-${m}`,selected_suggestion:f.suggestion},step_type:"IN_CONTEXT_SUGGESTIONS_OUTPUT",uuid:f.UUID}]}))},[r,s,e,n,t]);return d.useEffect(()=>{n&&s.length&&o()},[o,n,s]),a},ort=({isAllPlansFinished:e,researchPlan:t,reasoningGoals:n,isStudio:r,hasPendingFiles:s,displayModel:o})=>d.useMemo(()=>o===tt.O3_PRO||o===tt.GPT5_PRO||r?!1:!(e||t||n.length>0||s),[o,r,e,t,n.length,s]),hC=e=>{const{goals:t,activeGoal:n,isPlanFinished:r,planType:s,web_results:o,skipFirstAnimation:a,$t:i}=e,c=n?t.indexOf(n):-1;return t.map((u,f)=>{const m=n?.id===u.id,p=c!==-1&&c>f||r,h=u.steps?.some(g=>g.step_type==="CLARIFYING_QUESTIONS_OUTPUT");return{...u,key:`${s}-${u.id?u.id+"-":""}${f}`,id:u.id??`${s}-${f}`,status:p?"finished":m?"loading":"planned",planType:s,animateEntry:!(f===0&&a)&&!p,web_results:o,isFinalGoal:!1,disableAnimations:h??!1,title:u?.title??u?.description??i({defaultMessage:"Thinking…",id:"P1QHV0AhYD"}),description:u?.description??null,final:!1}})},art=()=>{const{askInputReasoningMode:e}=Fn(),{result:{backend_uuid:t,attachments:n,attachment_processing_progress:r,display_model:s},steps:o,researchPlan:a,reasoningPlan:i,hasAnswer:c,searchMode:u,isProReasoningMode:f,hasPendingFiles:m}=Ot(),h=trt({researchPlan:a,reasoningPlan:i,hasAnswer:c,isProReasoningMode:f??e}),g=nrt({researchPlan:a,steps:o??[],searchMode:u,isResearchPlanFinished:h.isResearchPlanFinished,backendUUID:t??""}),y=ert({hasPendingFiles:m,attachments:n,attachment_processing_progress:r}),x=ort({isAllPlansFinished:h.isAllPlansFinished,researchPlan:a,reasoningGoals:h.reasoningGoals,isStudio:u===oe.STUDIO,hasPendingFiles:m,displayModel:s});return d.useMemo(()=>({...h,...g,...y,shouldShowPlaceholderGoal:x}),[h,g,x,y])},Aoe={status:"finished",planType:"final",animateEntry:!1,web_results:void 0,description:null,final:!0,steps:void 0,disableAnimations:!0},irt=e=>({...Aoe,key:"final-goal",id:"final-goal",title:e({defaultMessage:"Finished",id:"EQpfkSbt5q"}),isFinalGoal:!0}),lrt=e=>({...Aoe,key:"answer-skipped-goal",id:"answer-skipped-goal",title:e({defaultMessage:"Answer skipped",id:"0siVz43iGV"}),isFinalGoal:!1}),crt=()=>{const{$t:e}=J(),{researchPlan:t,reasoningPlan:n,isAnswerSkipped:r,isProReasoningMode:s}=Ot(),{reasoningGoals:o,isResearchPlanFinished:a,isReasoningPlanFinished:i,isAllPlansFinished:c,activeReasoningGoal:u,pendingFilesGoals:f,activePendingFileGoal:m,isFileProcessingDone:p,researchGoals:h,activeResearchGoal:g}=art(),y=n?.web_results,x=d.useMemo(()=>hC({goals:f??[],activeGoal:m,isPlanFinished:p,planType:"research",web_results:void 0,skipFirstAnimation:!1,$t:e}),[f,m,p,e]),v=d.useMemo(()=>t?hC({goals:h,activeGoal:g,isPlanFinished:a,planType:"research",web_results:void 0,skipFirstAnimation:!0,$t:e}):[],[t,h,g,a,e]),b=d.useMemo(()=>s?hC({goals:o,activeGoal:u,isPlanFinished:i,planType:"reasoning",web_results:y,skipFirstAnimation:!t,$t:e}):[],[s,o,u,i,y,t,e]);return d.useMemo(()=>[...x,...v,...b,...c?[irt(e)]:[],...r?[lrt(e)]:[]],[x,v,b,c,r,e])},Noe=T.memo(({isExpanded:e})=>{const{isAgentWorkflowInFlight:t,hasAnswer:n}=Ot(),r=crt(),s=d.useMemo(()=>{if(e)return r;if(t||n){const a=r[r.length-1];return a?[a]:[]}return[]},[r,t,n,e]);return!n||e?l.jsx(Toe,{visibleGoals:s,isAgentWorkflowInFlight:t,forceShowAll:e,disableAnimations:e}):null});Noe.displayName="AgentWorkflowGoalProcessor";const urt=({isExpanded:e})=>{const{idx:t,result:{backend_uuid:n},inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i}=Ot(),c=U4(u=>u.results.find(f=>f.backend_uuid===n));return c?l.jsx(l6,{idx:t,result:c,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,children:l.jsx(Noe,{isExpanded:e})}):null},drt=Se(async()=>{const{AnimatedWorkflowHeader:e}=await Ee(()=>q(()=>import("./AnimatedWorkflowHeader-BTftkQn2.js"),__vite__mapDeps([464,4,1,6,3,57,9,7,8,10,11,12])));return{default:e}}),frt=Se(async()=>{const{StaticHeader:e}=await Ee(()=>q(()=>import("./ProgressHeader-DPfao__N.js"),__vite__mapDeps([465,4,1,6,3,9,7,8,10,11,12])));return{default:e}}),Ty=T.memo(({isFastSearch:e,loading:t=!1})=>{const{hasAnyAgentSteps:n,isAnswerSkipped:r,response:s,isPending:o,isProcessingQuery:a,result:{backend_uuid:i,display_model:c,frontend_context_uuid:u},searchMode:f,steps:m}=Ot(),[p,h]=d.useState(t),{permission:g,requestPermission:y}=yz({windowsAppOnly:!1}),x=d.useCallback(()=>h(b=>!b),[]),v=d.useMemo(()=>{if(t)return!0;if(r)return!1;const b=!!s&&Yt.hasContent({chunks:s.chunks,answer:s.answer,structured_answer_blocks:s.structured_answer_blocks});return o&&!b},[o,s,r,t]);return d.useEffect(()=>{v||h(!1)},[v]),!n&&!a||!v&&e?null:l.jsxs("div",{className:"flex flex-col gap-sm",children:[v?l.jsx(drt,{isFastSearch:e,steps:m,contextUUID:u,entryUUID:i,displayModel:c,searchMode:f,permission:g,requestPermission:y}):l.jsx(frt,{isExpanded:p,onToggleExpanded:x}),!e&&l.jsx(urt,{isExpanded:t||p})]})});Ty.displayName="AgentWorkflowDisplay";const Roe=T.memo(({onClick:e,didSelectAnswer:t,onDismiss:n})=>{const{isMobileStyle:r}=Re(),[s,o]=d.useState(!1),{$t:a}=J(),i=d.useCallback(()=>{o(!0),n()},[n]);return r||s?null:l.jsx("div",{children:l.jsx(K,{variant:"superLight",className:"p-md gap-sm flex items-center justify-between rounded-md",children:t?l.jsxs("div",{className:"gap-sm flex w-full items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ge,{icon:B("confetti"),size:"lg",className:"text-super"}),l.jsx(V,{color:"super",variant:"smallBold",children:a({defaultMessage:"Thank you! Your feedback helps improve answers for everyone.",id:"jfIf25t1OU"})})]}),l.jsx(rt,{variant:"noHover",icon:B("x"),pill:!0,size:"small",extraCSS:"!text-super",onClick:i})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(V,{color:"super",variant:"smallBold",children:a({defaultMessage:"Help improve our product",id:"A7lIeL4dUS"})}),l.jsx(V,{color:"super",variant:"small",children:a({defaultMessage:"We made two versions of this answer. Which do you prefer?",id:"GT2t8+NleA"})})]}),l.jsx(ze,{variant:"primary",size:"small",text:a({defaultMessage:"Compare",id:"493J7RI1tF"}),onClick:e})]})})})});Roe.displayName="AnswerComparisonBanner";const mrt={about:B("user"),born:B("calendar-event"),age:B("calendar-event"),died:B("calendar-event"),parents:B("users-group"),siblings:B("users-group"),children:B("baby-carriage"),spouse:B("heart"),spouses:B("heart"),education:B("school"),educated_at:B("school"),net_worth:B("cash-banknote"),ratings:B("star"),directed_by:B("movie"),starring:B("user"),watch_on:B("player-play"),treatment:B("medicine-syrup"),symptoms:B("clipboard-heart"),specialists:B("stethoscope")};function prt(e){return e&&mrt[e]||null}const hrt={EXTERNAL_LINK_TYPE_UNSPECIFIED:B("external-link"),PRIMARY:B("external-link"),WIKIPEDIA:B("brand-wikipedia"),X:B("brand-x"),INSTAGRAM:B("brand-instagram"),TIKTOK:B("brand-tiktok"),YOUTUBE:B("brand-youtube"),FACEBOOK:B("brand-facebook"),MAYOCLINIC:B("building"),IMDB:B("brand-windows")};function JO(e){return hrt[e]}const Doe=zt("PanelContext",{menuItems:void 0}),im=()=>{const e=d.useContext(Doe);if(!e)throw new Error("usePanel must be used within PanelContext");return e},Un=({children:e,menuItems:t,variant:n,className:r})=>l.jsx(Ar,{fallback:null,children:l.jsx(Doe.Provider,{value:{menuItems:t},children:n==="noChrome"?l.jsx(K,{className:r,children:e}):l.jsx(mr,{shadow:!0,className:z(r,"p-md"),children:e})})}),grt=({menuItems:e,buttonClass:t,placement:n})=>{const{isMobileStyle:r}=Re();return e.length<=0?null:l.jsx(Ws,{items:e,isMobileStyle:r,placement:n,children:l.jsx(rt,{size:"tiny",pill:!0,icon:B("dots"),extraCSS:t})})},yrt=({title:e,href:t,subtitle:n,image_url:r,links:s,children:o,entryUUID:a,data:i})=>{const{session:c}=je(),{trackEvent:u}=Ke(c),f=d.useCallback(m=>{u("knowledge card link clicked",{label:"social media",socialMediaType:m.type,value:m.url,entryUUID:a,type:i?.type??"",name:i?.title??"",id:i?.source_url??""})},[i?.source_url,i?.title,i?.type,a,u]);return l.jsx(K,{className:"gap-sm flex w-full justify-between",children:l.jsxs("div",{className:"gap-md flex grow items-start",children:[r?l.jsx("div",{className:"flex-none",children:l.jsx($o,{imageClassName:"size-[120px] object-cover object-top",rounded:"md",src:r,alt:e,includeLightBoxModal:!1})}):null,l.jsxs("div",{className:"flex h-full grow flex-col",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"gap-sm mb-two flex items-start",children:[l.jsx(V,{variant:"section-title",className:"flex-1",children:t?l.jsx(xt,{href:t,target:"_blank",className:"hover:text-super flex-1 duration-150",children:e}):e}),o]}),n&&l.jsx(V,{variant:"small",className:"mb-sm mr-sm text-pretty",children:n})]}),s&&s.length>0&&l.jsx("div",{className:"gap-sm flex flex-wrap",children:s.map(m=>l.jsx(joe,{link:m,solo:s.length===1,handleLinkClick:f},m.type))})]})]})})},joe=T.memo(({link:e,solo:t,handleLinkClick:n})=>{const r=d.useCallback(()=>n(e),[n,e]);return t?l.jsx(ze,{icon:JO(e.type),text:e.title,textClassName:"font-normal ml-2xs text-quiet ",size:"tiny",href:e.url,target:"_blank",onClick:r},e.url):l.jsx(ze,{icon:JO(e.type),size:"tiny",href:e.url,target:"_blank",onClick:r},e.type)});joe.displayName="ButtonFactory";const xrt=({name:e,title:t,value:n})=>{const r=prt(e);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-sm flex min-w-[120px]",children:[r&&l.jsx(V,{variant:"smallBold",color:"light",className:"w-5",children:l.jsx(ge,{icon:r,size:"sm"})}),l.jsx(V,{variant:"smallBold",color:"light",children:t})]}),l.jsx(V,{variant:"small",children:n})]})},vrt=({children:e})=>l.jsx(K,{className:"pt-sm px-md border-t",children:e});Un.Title=yrt;Un.Item=xrt;Un.Menu=grt;Un.Footer=vrt;const Ioe=T.memo(({graphData:e})=>{const[t,n]=d.useState(!1),r=e.url,s=e.name,o=d.useCallback(()=>n(!1),[]);return l.jsxs("div",{className:"flex justify-center",children:[l.jsx("img",{src:r,alt:s,className:"max-h-[50vh] overflow-hidden rounded align-middle",onClick:()=>n(!0)}),l.jsx(Poe,{isOpen:t,onClose:o,alt:s,src:r})]})});Ioe.displayName="StaticImageGraph";const Poe=T.memo(({isOpen:e,onClose:t,alt:n,src:r})=>{const s=d.useCallback(()=>t(!1),[t]);return l.jsxs(po,{onClose:s,isOpen:e,variant:"hide-chrome",disableAnimation:!1,children:[l.jsx("div",{className:"flex place-content-center",onClick:()=>t(!1),children:l.jsx("div",{className:"gap-xs p-md md:p-xl flex flex-col items-center justify-between",children:l.jsx("div",{className:"grow",children:l.jsx("img",{alt:n,src:r,className:"max-h-[50vh]"})})})}),l.jsx(ze,{onClick:s,icon:B("x"),extraCSS:"!fixed top-md right-md shadow-sm",size:"small",pill:!0,ariaLabel:"Close"})]})});Poe.displayName="ImageModal";const Ooe=T.memo(({graphData:e})=>l.jsxs(Un,{className:"gap-md bg-subtler p-md flex flex-col rounded-md text-center",children:[l.jsx(Un.Title,{title:e.name,subtitle:""}),l.jsx(Ioe,{graphData:e})]}));Ooe.displayName="GraphPanel";const Loe=(e,t)=>{const{$t:n}=J(),r=d.useMemo(()=>({low:n({defaultMessage:"This price is low",id:"4Q8ifhmVtL"},{span:u=>l.jsx("span",{className:"text-positive",children:u})}),fair:n({defaultMessage:"This price is fair",id:"jXTaDslyVl"},{span:u=>l.jsx("span",{className:"text-foreground/50",children:u})}),high:n({defaultMessage:"This price is high",id:"whb9bUkCNc"},{span:u=>l.jsx("span",{className:"text-negative",children:u})})}),[n]),s=e?e.flatMap(u=>{const f=(u.offers??[]).map(p=>p.price).filter(p=>p!==void 0);return f.length===0?[]:[Math.min(...f)]}):[],o=t!=null?[...s,t]:s,a=o.length>0?Math.min(...o):null,i=o.length>0?Math.max(...o):null,c=d.useMemo(()=>{if(!i||!a||!t)return null;const f=(i-a)*.33,m=a+f,p=i-f;return{low:m,high:p}},[i,a,t]);return!c||!t?{label:"",textColor:"",backgroundColor:"",high:null,low:null,fairBounds:null}:{label:tc.high?r.high:r.fair,textColor:tc.high?"text-negative":"text-foreground/50",backgroundColor:tc.high?"bg-negative":"bg-inverse",high:i,low:a,fairBounds:c}},Foe=zt("ScrollToWidgetContext",{selectedWidgetId:void 0,scrollToWidget:()=>{},entityRefs:{}}),Boe=()=>{const e=d.useContext(Foe);if(!e)throw new Error("useScrollToWidget must be used within ScrollToWidgetContext");return e},Uoe=T.memo(({children:e,entities:t})=>{const[n,r]=d.useState({}),[s,o]=d.useState(void 0),{scrollContainerRef:a}=ka(),i=d.useRef(null);d.useEffect(()=>()=>{r({})},[]),d.useEffect(()=>{r(u=>{const f=u;let m=!1;return t?.map(p=>{const h=jv(p);if(!h)return;if(h.object==="ShopifyWidget"){const y=h.id;if(!n[y]){m=!0;const x=d.createRef();f[y]=x}}}),m?f:u})},[t,n]);const c=u=>{i.current&&clearTimeout(i.current);const f=n[u]?.current;if(f&&a?.current){const p=f.getBoundingClientRect().top+a.current?.scrollTop-200;a?.current?.scrollTo({top:p,behavior:"smooth"})}o(u),i.current=setTimeout(()=>{o(void 0)},2e3)};return l.jsx(Foe.Provider,{value:{selectedWidgetId:s,scrollToWidget:c,entityRefs:n},children:e})});Uoe.displayName="ScrollToWidgetProvider";const Voe=zt("EntityContext",{entityId:"",menuItems:void 0,variant:void 0}),Qg=()=>{const e=d.useContext(Voe);if(!e)throw new Error("useEntity must be used within EntityContext");return e},brt=({children:e,id:t,menuItems:n,className:r,entityVariant:s})=>l.jsx(Voe.Provider,{value:{entityId:t,menuItems:n,variant:s},children:l.jsx(mr,{variant:s==="hide-chrome"?"transparent":void 0,className:z("group/card flex flex-col",{"p-md":s!=="hide-chrome"},r),children:e})}),_rt=({className:e,...t})=>l.jsx(K,{className:z("gap-sm md:gap-md relative flex flex-col rounded-lg md:flex-row",e),...t}),wrt=({primaryButtonText:e,onPrimaryButtonClick:t,listNumber:n,className:r,children:s,...o})=>l.jsxs("div",{className:z("relative md:w-[calc(30%_-_8px)]",r),...o,children:[l.jsxs("div",{className:"gap-md flex h-full flex-col justify-between",children:[s,e&&t&&l.jsx("div",{className:"flex flex-col items-stretch md:max-w-[160px]",children:l.jsx(ze,{text:e,variant:"primary",onClick:t,pill:!0,size:"small"})})]}),typeof n=="number"&&l.jsx(V,{variant:"smallCaps",color:"light",className:"border-subtler bg-base absolute -left-1.5 -top-1.5 flex size-5 shrink-0 items-center justify-center rounded-full border shadow-sm",children:n})]}),Crt=({className:e,buttonProps:t,secondaryButtonProps:n,trailingComponent:r,children:s,...o})=>{const{menuItems:a}=Qg();return l.jsx("div",{className:z("flex min-w-0 flex-1 flex-col",e),...o,children:l.jsxs("div",{className:"gap-sm md:gap-md flex flex-1 flex-col justify-between rounded-lg",children:[l.jsx("div",{className:"gap-xs flex flex-col justify-between",children:l.jsx("div",{className:"gap-xs my-sm relative flex flex-col md:mt-0",children:s})}),(t||n)&&l.jsxs("div",{className:"gap-sm flex w-full items-center",children:[t&&l.jsx(ze,{variant:"primary",pill:!0,size:"small",...t,extraCSS:`${t.extraCSS} w-full max-w-[160px]`}),n&&l.jsx(ze,{variant:"border",pill:!0,size:"small",...n,extraCSS:`${n.extraCSS}`}),r,a&&a.length>0&&l.jsx("div",{className:"duration-150 group-hover/card:opacity-100 md:opacity-0",children:l.jsx(Un.Menu,{menuItems:a,placement:"bottom-start"})})]})]})})},Srt=({title:e,onTitleClick:t,className:n,variant:r})=>{const{selectedWidgetId:s}=Boe(),{entityId:o}=Qg(),{isMobileStyle:a}=Re();return l.jsx("div",{onClick:()=>t?.(),className:n,children:l.jsx(V,{variant:r??(a?"section-title":"entry-title"),className:z("line-clamp-3 !leading-tight md:text-2xl",{"duration-fast cursor-pointer hover:opacity-70":!!t}),children:l.jsx("span",{className:z("duration-normal rounded-md",{"bg-super/10":s===o}),children:e})})})},Ert=({loading:e,className:t,onClick:n,trailingText:r})=>{const{$t:s}=J();return l.jsxs(K,{className:z("group relative flex h-12 items-center",{"opacity-50":e,"cursor-pointer":!e},t),onClick:e?void 0:n,children:[!e&&l.jsx(K,{variant:"subtle",className:"inset-y-xs absolute -inset-x-3 rounded-md opacity-0 duration-150 group-hover:opacity-100"}),l.jsxs("div",{className:"relative w-full",children:[l.jsxs("div",{className:z("gap-md relative flex w-full items-center justify-between",{"opacity-0":e}),children:[l.jsx(V,{variant:"smallBold",color:"light",children:s({defaultMessage:"View More",id:"QQSdHPJWXu"})}),l.jsxs(V,{variant:"tiny",color:"light",className:"gap-sm flex items-center",children:[r,l.jsx(ge,{icon:B("chevron-right"),size:"xs"})]})]}),e&&l.jsxs("div",{className:"absolute inset-0 flex items-center justify-between",children:[l.jsx(K,{className:"h-2 w-[100px] rounded-full",variant:"subtle"}),l.jsx(ge,{icon:B("chevron-right"),className:"text-quietest",size:"sm"})]})]})]})},krt=({title:e,className:t,children:n,trailingContent:r,defaultExpanded:s=!1})=>{const[o,a]=d.useState(!s);return l.jsxs(K,{className:t,children:[l.jsxs("div",{onClick:()=>a(!o),className:"group relative flex h-12 cursor-pointer select-none items-center justify-between",children:[l.jsx(K,{variant:"subtle",className:"inset-y-xs absolute -inset-x-3 rounded-md opacity-0 duration-150 group-hover:opacity-100"}),l.jsx(V,{variant:"smallBold",color:"light",className:"relative shrink-0 whitespace-nowrap",children:e}),l.jsxs("div",{className:"gap-md relative flex min-w-0 items-center",children:[l.jsx("div",{className:"gap-xs flex min-w-0 items-stretch",children:r}),l.jsx(ge,{icon:B("chevron-down"),className:z("text-foreground relative shrink-0 opacity-50",{"rotate-180":!o}),size:"sm"})]})]}),l.jsx(pi,{transition:{ease:tl(.16,1,.3,1),duration:.2},initial:!1,children:!o&&l.jsx(Fo,{transition:{duration:.1},exit:{y:-5,opacity:0},animate:{y:0,opacity:1},initial:{y:-5,opacity:0},children:l.jsx("div",{className:"pb-4",children:n})})})]})},f_t=brt,m_t=_rt,p_t=Srt,gC=krt,h_t=wrt,g_t=Crt,y_t=Ert,xb=T.memo(({isOpen:e,children:t,placement:n,hoverOpen:r=!1,disabled:s=!1,onOpen:o,onClose:a,content:i,contentWidth:c="360px",isMobileStyle:u,boxProps:f,canOutsideClickClose:m,removeScroll:p,modalTitleContent:h,modalRenderCloseButton:g=!0,ref:y,...x})=>{const[v,b]=d.useState(!1),_=d.useMemo(()=>e!==void 0,[e]),w=d.useMemo(()=>_?e:v,[_,e,v]),S=d.useCallback(()=>{!w&&!s&&(o?.(),_||b(!0))},[s,_,o,w]),C=d.useCallback(()=>{w&&!s&&(a?.(),_||b(!1))},[s,_,a,w]);d.useImperativeHandle(y,()=>({dismiss:C}),[C]);const E=d.useMemo(()=>({width:c??void 0}),[c]),N=d.useMemo(()=>l.jsx(K,{style:E,...f,children:i}),[E,f,i]),k=d.useMemo(()=>({canOutsideClickClose:m??!0,removeScroll:p}),[m,p]);return u?l.jsxs(l.Fragment,{children:[l.jsx(po,{variant:"bottom-left-sheet",actionList:Ie,isOpen:w,onClose:C,titleContent:h,renderCloseButton:g,children:i}),l.jsx("span",{onClick:S,children:t})]}):l.jsx(zf,{isOpen:w,hoverOpen:r,placement:n,onClose:C,onOpen:S,overlayProps:k,content:N,hasInteractiveContent:!0,...x,children:t})});xb.displayName="DropDownModal";const Mrt=T.memo(({inFlight:e,chooseIfReason:t,chooseIfLeadInCopy:n,pros:r,cons:s,className:o,viewState:a="collapsed",id:i,showBuyIf:c=!0})=>{const u=!t&&e;return l.jsx(wr,{active:u,className:z("relative",o),children:l.jsx(pi,{children:l.jsx(Fo,{children:l.jsxs("div",{className:"gap-sm mt-md relative flex flex-col rounded-md md:mx-0",children:[c&&l.jsx(Hoe,{reason:t,leadInCopy:n,loading:u}),l.jsx(AN,{pros:r??Ie,cons:s??Ie,loading:u,viewState:a,id:i})]})})})})});Mrt.displayName="EntityItemGuidance";const Hoe=T.memo(({reason:e,leadInCopy:t,loading:n,textVariant:r="base"})=>{const{variant:s}=Qg();return!e&&!n?null:l.jsx("div",{className:"flex items-start gap-[12px] rounded-md md:items-center",children:l.jsx("div",{className:"w-full",children:n?l.jsxs("div",{className:"gap-sm pb-sm flex flex-col",children:[l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 w-full rounded-full"}),l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 rounded-full"}),l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 w-1/2 rounded-full"})]}):l.jsxs(V,{variant:r,children:[l.jsx("span",{className:"font-medium",children:t})," ",e]})})})});Hoe.displayName="EntityItemChooseIf";const zoe=3,Woe=2,AN=T.memo(({pros:e,cons:t,loading:n,className:r,viewState:s="collapsed",id:o,scrollOnMobile:a=!0})=>!n&&e.length===0&&t.length===0?null:l.jsx("div",{className:r,children:s==="collapsed"?l.jsx($oe,{loading:n,pros:e,cons:t,id:o,scrollOnMobile:a}):l.jsx(qoe,{loading:n,pros:e,cons:t})}));AN.displayName="EntityItemProsCons";const Goe=T.memo(({children:e,loading:t,scrollOnMobile:n=!0})=>{const{isMobileStyle:r}=Re(),{variant:s}=Qg();return r&&n?l.jsx("div",{className:"-mx-md",children:l.jsx(nl,{orientation:"horizontal",showScrollIndicator:!1,children:l.jsx("div",{className:"flex",children:l.jsx("ul",{className:"gap-sm px-md flex shrink-0",children:e})})})}):l.jsx("ul",{className:z("flex flex-wrap",{"gap-0":s==="dense-card"&&!t,"gap-sm":s!=="dense-card"||t}),children:e})});Goe.displayName="ProsConsCollapsedContainer";const $oe=T.memo(({loading:e,pros:t,cons:n,id:r,scrollOnMobile:s=!0})=>l.jsx(Goe,{loading:e,scrollOnMobile:s,children:l.jsx(kt,{initial:!1,children:l.jsx(_g,{children:e?Array.from({length:3}).map((o,a)=>l.jsx(Ay,{asPlaceholder:!0,text:"",type:"con",label:"",id:r},a)):l.jsxs(l.Fragment,{children:[t.map(o=>l.jsx(Ay,{text:o.description,type:"pro",label:o.label,id:r},o.label+r)).slice(0,zoe),n.map(o=>l.jsx(Ay,{text:o.description,type:"con",label:o.label,id:r},o.label+r)).slice(0,Woe)]})})})}));$oe.displayName="ProsConsCollapsed";const qoe=T.memo(({loading:e,pros:t,cons:n})=>l.jsx("div",{className:"-mx-6",children:l.jsx(nl,{orientation:"horizontal",showScrollIndicator:!1,children:l.jsx("ul",{className:"gap-sm flex px-6",children:e?Array.from({length:3}).map((r,s)=>l.jsx(Koe,{},s)):l.jsxs(l.Fragment,{children:[t.map(r=>l.jsx(wk,{text:r.description,type:"pro",label:r.label},r.label)).slice(0,zoe),n.map(r=>l.jsx(wk,{text:r.description,type:"con",label:r.label},r.label)).slice(0,Woe)]})})})}));qoe.displayName="ProsConsExpanded";const Ay=T.memo(({text:e,label:t,type:n,asPlaceholder:r,id:s})=>{const{session:o}=je(),{trackEvent:a}=Ke(o),{variant:i}=Qg(),c=()=>{r||a("shopping pro con hover",{type:n,label:t})},u={initial:{opacity:0,x:-3},animate:{opacity:1,x:0}},f=d.useMemo(()=>l.jsx("div",{className:"p-sm pointer-events-none translate-y-0",children:l.jsx(V,{variant:"small",children:e})}),[e]);return l.jsx(Te.li,{variants:u,initial:"initial",animate:"animate",transition:{duration:.1,ease:Yd},className:z("group inline-flex shrink-0 cursor-default rounded-full duration-150",{"gap-xs":i!=="dense-card","gap-sm":i==="dense-card","hover:bg-subtler":!r,"border-subtlest border duration-150":!r&&i!=="dense-card","!border-transparent !bg-transparent":r}),onMouseEnter:c,children:l.jsx(xb,{hoverOpen:!0,placement:"bottom-start",contentWidth:"200px",removeScroll:!1,content:f,isMobileStyle:!1,delayTime:1,disabled:r,hasInteractiveContent:!1,childrenClassName:"inline-flex",children:l.jsxs("div",{className:z("p-xs relative inline-flex items-center pr-[10px]",{"bg-subtler dark:bg-subtle":r,"h-[26px] rounded-full":r,"gap-2xs":i==="dense-card","gap-xs":i!=="dense-card"}),children:[l.jsx("div",{className:z("size-md flex shrink-0 items-center justify-center rounded-full",{"text-super":n==="pro"},{"text-quiet":n==="con"},{"bg-transparent":r}),children:l.jsx(V,{variant:"tiny",color:n==="pro"?"super":"light",className:"inline-flex",children:l.jsx(ge,{className:r?"opacity-0":"",icon:n==="pro"?B("check"):B("x"),size:"xs"})})}),r?l.jsx(V,{variant:"tiny",className:"w-10 shrink-0",children:" "}):l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:z({"text-super":n==="pro"}),children:t})})]})})},t+s)});Ay.displayName="EntityItemProConItem";const Koe=T.memo(()=>l.jsx(K,{className:"p-sm h-[136px] w-[200px] rounded-md",variant:"subtler"}));Koe.displayName="ExpandedLoading";const wk=T.memo(({text:e,label:t,type:n})=>l.jsxs(K,{className:"p-sm w-[200px] rounded-md",variant:"subtler",children:[l.jsxs("div",{className:"mb-2xs gap-xs flex items-center",children:[l.jsx(K,{variant:n==="pro"?"super":"textColor",className:z("size-md flex shrink-0 items-center justify-center rounded-full",{"opacity-50":n==="con"}),children:l.jsx(ge,{icon:n==="pro"?B("check"):B("x"),className:"text-inverse shrink-0",size:"xs"})}),l.jsx(V,{variant:"smallBold",color:n==="pro"?"super":"light",children:t})]}),l.jsx(V,{variant:"small",color:"light",children:e})]}));wk.displayName="ProConItemExpanded";const Yoe=T.memo(({url:e,children:t,className:n})=>{const r=d.useCallback(s=>{s.stopPropagation()},[]);return e?l.jsx("div",{className:z("inline-flex",n),children:l.jsx(xt,{href:e,target:"_blank",className:"inline-flex min-w-0 items-center gap-0 duration-150 hover:opacity-60",onClick:r,children:t})}):t});Yoe.displayName="LogoWrapper";const Trt=T.memo(({merchantName:e,merchantDomain:t,itemUrl:n,className:r,textVariant:s,iconSize:o,faviconSize:a})=>l.jsx(Yoe,{url:n??void 0,className:r,iconSize:o,children:l.jsx(NN,{name:e,domain:t,faviconSize:a,textVariant:s})}));Trt.displayName="EntityItemMerchantInfo";const NN=T.memo(({name:e,domain:t,faviconSize:n,textVariant:r="tiny"})=>l.jsxs(V,{variant:r,color:"light",className:"gap-xs flex items-center",children:[l.jsx(Lo,{className:"-translate-y-half shrink-0",domain:t,size:n}),l.jsx("span",{className:"truncate whitespace-nowrap",children:e})]}));NN.displayName="EntityMerchantLogoName";const yC=e=>{if(e.indexOf("$")===-1)return e;const t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),n=e.replace(/[$,]/g,"");return t.format(parseFloat(n))},Qoe=T.memo(({price:e,comparePrice:t,soldOut:n,size:r,textVariant:s})=>{const{$t:o}=J(),{isMobileStyle:a}=Re(),i=yC(n&&t?t:e);return l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:s||(a||r==="small"?"smallBold":"baseSemi"),className:n?"line-through":void 0,color:t?"default":void 0,children:i}),n?l.jsx(V,{variant:s??"small",color:"red",children:o({defaultMessage:"Sold Out",id:"MwUAGRNkR/"})}):t&&l.jsx(V,{variant:s??"small",color:"light",className:"line-through",children:yC(t)})]})});Qoe.displayName="EntityItemPrice";function Art(e){return"article_info"in e}const Xoe=T.memo(({checked:e,toggleChecked:t,className:n="",variant:r="default",unselectedCheckboxClassName:s,...o})=>l.jsx(wT,{className:z("inline-flex cursor-pointer items-center justify-center duration-150",{"size-[24px]":r==="large","size-[18px]":r==="default","size-[14px]":r==="small"},n),checked:e,onCheckedChange:t,...o,children:l.jsx(K,{variant:e?"super":"background",noBorder:!0,className:z("border-subtle inline-flex size-full items-center justify-center rounded border",{"!border-super bg-super":e},!e&&s),children:l.jsx(CT,{children:l.jsx(kt,{children:e&&l.jsx(Te.div,{initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.6},transition:{type:"spring",bounce:.2,duration:.2},children:l.jsx(ge,{icon:B("check"),size:r==="small"?"xs":"sm",className:"text-inverse"})})})})})}));Xoe.displayName="Checkbox";const Zoe=T.memo(function(t){const{className:n,children:r,result:s,trackEvent:o,...a}=t,i=z("group flex size-full cursor-pointer items-stretch",n);return R4(s)?l.jsx(xt,{target:"_blank",rel:"noopener",className:i,href:s.url,...a,children:l.jsx("div",{className:"w-full",children:r})}):l.jsx(l.Fragment,{children:r})});Zoe.displayName="CitationCardLink";const Nrt=T.memo(function({variant:t,icon:n,label:r,shouldShow:s=!0}){return t==="grid"||!s?null:l.jsxs(K,{className:"gap-xs pt-sm mt-xs flex items-center border-t",children:[l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B(n)})}),l.jsx(V,{variant:"tiny",color:"super",children:r})]})}),Joe=T.memo(function(t){const{$t:n}=J(),{result:r,additionalMetadata:s,variant:o}=t,a=r.url,i=r.meta_data?.generated_file_description??r.snippet,c=Hf(r),u=r.meta_data?.generated_file_title??r.name,f=r?.is_client_context,m=!!r.meta_data?.connection_type,p=typeof r.meta_data?.quoteBeforeContext=="string"?r.meta_data?.quoteBeforeContext:"",h=typeof r.meta_data?.quoteEmphasisText=="string"?r.meta_data?.quoteEmphasisText:"",g=typeof r.meta_data?.quoteAfterContext=="string"?r.meta_data?.quoteAfterContext:"",y=p.length>0||h.length>0||g.length>0,x=o!=="grid"&&i&&y,v=r.file_metadata?.file_repository_type,b=Fi(r),_=typeof r.meta_data?.citation_domain_name=="string"?r.meta_data?.citation_domain_name:void 0,w=y2e(r),S=()=>{if(m&&r.meta_data?.connection_type!==er.WILEY)return r2(r.meta_data?.connection_type);if(r.is_attachment){if(r?.meta_data?.patent_name)return r.meta_data.patent_name;if(!r?.meta_data?.file_uuid){const M=r?.file_metadata?.connector_type??ng(r.url),A=M?r2(M):void 0;if(A)return A}return v=="USER"?n({defaultMessage:"Local Files",id:"FBnEWaGOHR"}):v=="ORG"?n({defaultMessage:"Org Files",id:"DaFSYzpM1Q"}):v=="COLLECTION"?n({defaultMessage:"Space Files",id:"Thy4/SbBwD"}):n({defaultMessage:"Attachment",id:"eLCAEP8LHj"})}return _},C=cb(r),E=r.is_memory,N=Wg(r),k=c?{icon:"microphone",label:l.jsx(Ne,{defaultMessage:"Meeting Transcript",id:"AzZfMfUw31",description:"Meeting transcript label"})}:{icon:"user-search",label:l.jsx(Ne,{defaultMessage:"Personal Search",id:"7+aLCEyqS2",description:"title"})},I=c||N;return l.jsxs("div",{className:z("gap-xs pointer-events-none relative flex size-full max-w-full select-none flex-col min-w-0",{"px-sm pb-sm pt-sm":o==="grid"},{"p-md":o!=="grid"}),children:[l.jsxs("div",{className:"flex w-full items-center justify-between",children:[C&&!N?l.jsx(tN,{variant:"small",searchType:E?"memory":"conversation-history"}):l.jsxs("div",{className:"space-x-xs flex min-w-0",children:[s||null,l.jsx(xa,{variant:"tiny",color:"light",url:a,isAttachment:r.is_attachment,connectionType:WH(r),source:S(),mcpServerSource:r.meta_data?.mcp_server,isInlineAttachment:w,patentName:N4(r),isMeetingTranscript:c,truncate:!1})]}),l.jsxs("div",{className:"ml-auto shrink-0",children:[b&&o!=="grid"?l.jsx(Sh,{}):null,f&&o==="grid"?l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B("user-scan")})}):null]})]}),l.jsx(V,{variant:o==="grid"?"tiny":o==="list"?"small":"base",className:z("min-w-0",{"":o==="grid","pr-1":o==="list"}),children:E&&!N?l.jsx(V,{variant:"tiny",className:"line-clamp-2 h-8 min-w-0",children:r?.snippet}):l.jsx("span",{className:"line-clamp-1 text-left md:line-clamp-2 min-w-0 [overflow-wrap:break-word]",children:u||l.jsx("div",{children:" "})})}),!c&&u!==r.name?l.jsx(V,{variant:"small",color:"light",className:"line-clamp-1",children:r.name}):null,x&&l.jsxs(V,{variant:o==="list"?"tiny":"small",className:"mt-two border-super line-clamp-[8] border-l-4 pl-2 font-normal",children:[l.jsx("span",{children:p}),l.jsx("span",{className:"bg-super/30",children:h}),l.jsx("span",{children:g})]}),o!=="grid"&&i&&!y&&!c&&l.jsx(V,{variant:o==="list"?"tiny":"small",className:"mt-two line-clamp-1 font-normal md:line-clamp-4",children:i}),l.jsx(Nrt,{variant:o,icon:k.icon,label:k.label,shouldShow:I}),b&&o==="grid"?l.jsx("div",{className:"-mt-1.5",children:l.jsx(Sh,{})}):null]})});Joe.displayName="CitationDefaultCard";const eae=T.memo(function(t){const{result:n,imageURL:r,citationNumber:s,useLightBoxModal:o=!0}=t;return l.jsxs("div",{className:" w-full relative max-h-[76px]",children:[l.jsx($o,{includeLightBoxModal:o,alt:n.name,containerClassName:"w-full h-full p-xs",imageClassName:"object-cover object-center w-full h-full rounded-md",src:r}),s&&l.jsx(V,{className:"bottom-sm left-sm px-xs absolute z-[1] inline-flex rounded-sm bg-black/50",variant:"tiny",color:"white",children:s})]})});eae.displayName="CitationImageCard";const tae=T.memo(e=>{const{result:t,imageURL:n}=e,r=t.url,s=J(),o=d.useMemo(()=>({color:"white"}),[]),a=d.useMemo(()=>l.jsx(pf,{recentlyUpdatedLabel:s.$t({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:t.meta_data?.published_date,timestampProps:o,includeIcon:!1,children:s.$t({defaultMessage:"Updated",id:"xrk6zgu9jU"})}),[s,t.meta_data?.published_date,o]);return l.jsxs("div",{className:"p-sm gap-sm flex h-full max-h-[190px] min-w-0",children:[l.jsxs("div",{className:"gap-xs flex flex-col min-w-0",children:[l.jsxs("div",{className:"space-x-xs flex justify-between min-w-0",children:[l.jsx(xa,{variant:"tiny",color:"light",url:r,isAttachment:t.is_attachment}),Lv.isRecentlyTrending(t)?l.jsx(Oo,{tooltipText:a,children:l.jsx(ft,{name:B("bolt"),className:"text-super size-3.5"})}):null]}),l.jsx("div",{children:l.jsx(V,{variant:"tiny",className:"line-clamp-2",children:t.name})})]}),n?l.jsx("div",{className:"relative -my-1 -mr-1 size-[60px] shrink-0",children:l.jsx($o,{includeLightBoxModal:!1,alt:t.name,containerClassName:"w-full h-full",imageClassName:"object-cover object-center w-full h-full rounded-md",src:n})}):null]})});tae.displayName="CitationTrendingCard";const nae=T.memo(({blockCount:e,size:t=Gt.large,animateLines:n=!0,divider:r,noLines:s,noHeight:o,variant:a="subtler",className:i,...c})=>{const u="h-1 bg-inverse/70 rounded-full",f=d.useMemo(()=>{const m=[];for(let p=0;p<(e??1);p++)m.push(l.jsx(K,{variant:a,className:z("animate-pulse rounded-md",{"h-8":t===Gt.small,"h-10":t===Gt.regular,"h-[72px]":t===Gt.large,"h-32":t===Gt.xl,"h-6":t===Gt.tiny,"h-full":o}),children:l.jsx("div",{className:"gap-y-sm p-md flex h-full flex-col",children:!s&&l.jsxs(l.Fragment,{children:[l.jsx(Te.div,{initial:{width:n?0:"100%"},animate:{width:"100%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"100%"},animate:{width:"100%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"80%"},animate:{width:"80%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"20%"},animate:{width:"20%"},transition:{duration:.8,delay:.2},className:u})]})})},p));return m},[n,e,t,s,o,a]);return l.jsx(K,{className:z("h-full",{"divider gap-y-sm flex flex-col":r,"absolute top-0 w-full":o},i),...c,children:f})});nae.displayName="TextBlockThrobber";const rae=T.memo(({result:e,idx:t,isSelected:n,testId:r,additionalMetadata:s,isTrendingLayout:o=!1,trackEvent:a,downloadCitation:i,getImageUrl:c,variant:u,isSidecar:f,onClick:m,useLightBoxModal:p=!0})=>{const h=e.meta_data?.file_uuid?"fileRepositoryFile":e.is_attachment?"fileAttachment":"sourceCard";d.useEffect(()=>{const P=setTimeout(()=>a?.("source card viewed",{citation_url:e.url,position:t,title:e.name,source:h}),100);return()=>clearTimeout(P)},[a,e.name,e.url,t,h]);const g=e.url,[y,x]=d.useState(()=>!e.is_memory&&D4(e.url)?e.url:null),[v,b]=d.useState(!1),_=d.useMemo(()=>g&&!f&&Ji(g),[g,f]),[w,S]=d.useState(!1),C=m3(e),E=Tr(e.url),N=Hf(e),k=!_&&!E&&!N,I=o&&e.meta_data?.client==="trending",M=d.useMemo(()=>I?l.jsx(tae,{result:e,authors:e.meta_data?.authors,imageURL:e.meta_data?.images?.[0]}):E&&y?l.jsx(eae,{result:e,imageURL:y,useLightBoxModal:p}):E&&!y?l.jsx(nae,{blockCount:1,size:"large"}):l.jsx(Joe,{result:e,variant:u,additionalMetadata:s,isSelected:n}),[I,E,y,e,p,u,s,n]),A=d.useCallback((P,F)=>{b(F),x(P)},[]),D=d.useRef(null);return d.useEffect(()=>{const P=new IntersectionObserver(R=>{R.forEach(j=>{j.isIntersecting&&E&&y===null&&!v&&c?.(e,A)})},{threshold:.1}),F=D.current;return F&&E&&P.observe(F),()=>{F&&E&&P.unobserve(F)}},[D,g,c,e,y,A,v,E]),l.jsxs(Zoe,{result:e,trackEvent:a,children:[l.jsx("div",{ref:D,onClick:P=>{const F=typeof e.meta_data?.quoteBeforeContext=="string"?e.meta_data?.quoteBeforeContext:"",R=typeof e.meta_data?.quoteEmphasisText=="string"?e.meta_data?.quoteEmphasisText:"",j=typeof e.meta_data?.quoteAfterContext=="string"?e.meta_data?.quoteAfterContext:"",L=F.length>0||R.length>0||j.length>0;if(N){P.preventDefault();return}else _&&!w?S(!0):i&&!E&&!C?(P.preventDefault(),i(e)):m?.(P);const U=Gg(e);a?.("click citation",{source:h,citation_url:g,...U}),L&&a?.("click check sources citation",{source:h,citation_url:g,quoteBeforeContext:F,quoteEmphasisText:R,quoteAfterContext:j,...U})},className:z("group relative flex w-full items-stretch",{"h-full":u==="grid","cursor-pointer":!!i||!!_||!!m}),"data-test-id":r,children:l.jsx(K,{variant:"subtler",bgHover:k||_?"subtle":void 0,className:z("flex w-full rounded-lg",{"bg-super/10 ring-super/80 hover:!bg-super/10 dark:bg-super/20 dark:ring-super/80 dark:hover:!bg-super/20 ring-1":n}),children:M},e.name)}),_&&g&&e.name&&l.jsx($g,{isOpen:w,name:e.name,url:g,setisOpen:S})]})});rae.displayName="CitationCard";const sae=T.memo(({onSelect:e,isSelected:t,result:n,idx:r})=>{const s="manage-citation-row",o=f=>{e?.(f)},{session:a}=je(),{trackEvent:i}=Ke(a),{mutate:c}=Ov({reason:s}),u=f=>{c({file_url:f.url,tab_id:f.tab_id})};return l.jsxs("div",{className:"gap-sm flex w-full flex-row-reverse",children:[l.jsx("div",{className:"w-full min-w-0",children:l.jsx(rae,{result:n,idx:r,isSelected:t,variant:"modal",trackEvent:i,downloadCitation:Xl(n)?u:void 0})}),e&&l.jsx("div",{className:"mt-[6px] shrink-0",children:l.jsx(Xoe,{checked:t,toggleChecked:o.bind(null,n.url)})})]})});sae.displayName="ManageCitationRow";const vb=T.memo(({webResults:e,citationType:t="sources",onClose:n,entry:r})=>{const{$t:s}=J(),{isMobileStyle:o}=Re(),a=e?.length??0,i=d.useMemo(()=>{if(!r)return;if(Art(r)&&r.article_info?.title)return r.article_info.title;const u=r.query_str??"";return u?$x(u).actualQuery??void 0:void 0},[r]),c=d.useMemo(()=>{const u={sources:{empty:s({defaultMessage:"No sources",id:"tN3HZvczgp"}),count:s({defaultMessage:"{sources, plural, one {# source} other {# sources}}",id:"oWRBjE1HK2"},{sources:a})},articles:{empty:s({defaultMessage:"No articles",id:"cHDJyKJPPQ"}),count:s({defaultMessage:"{count, plural, one {# article} other {# articles}}",id:"FxjYiplq18"},{count:a})}};return a===0?u[t].empty:u[t].count},[a,t,s]);return l.jsx(po,{title:c,subtitle:i??void 0,isOpen:!0,variant:o?"bottom-left-sheet":"side-sheet",onClose:n,icon:SM,children:l.jsx(K,{className:"gap-md flex h-full flex-col items-start",children:e?.map((u,f)=>l.jsx(sae,{isSelected:!1,idx:f,result:u},u.url))})})});vb.displayName="CitationListModal";const RN=Object.freeze(Object.defineProperty({__proto__:null,CitationListModal:vb},Symbol.toStringTag,{value:"Module"})),Ck=T.memo(({webResults:e,className:t,isLoading:n})=>{const[r,s]=d.useState(!1),{isMobileStyle:o}=Re(),a=o?2:3,i=2,c=d.useMemo(()=>e.reduce((h,g)=>h.some(x=>!x.url||!g.url?!1:Ur(x.url)===Ur(g.url))?h:g.url?h.concat({url:g.url,isAttachment:g.is_attachment}):h,[]),[e]),u=d.useMemo(()=>c.slice(0,a),[c,a]),f=d.useMemo(()=>c.reduce((h,g,y)=>y0?", ":"")+Ur(g.url).replace(/\.[^.]*$/,""):y>=i&&y===c.length-1?h+`, +${c.length-i}`:h,""),[c]),m=d.useCallback(()=>{s(!0)},[]),p=d.useCallback(()=>{s(!1)},[]);return n||u.length===0?null:l.jsxs(l.Fragment,{children:[l.jsx(Oo,{tooltipText:"Review summary sources",asChild:!0,tooltipLayout:"top",children:l.jsxs("div",{onClick:m,className:z("gap-sm hover:bg-subtle flex cursor-pointer flex-row-reverse items-center overflow-hidden",t),children:[l.jsx(V,{variant:"smallCaps",color:"light",className:"truncate",children:f}),l.jsx("div",{className:"min-w-0 shrink",children:l.jsx(yb,{count:a,sources:u})})]})}),r&&l.jsx(vb,{onClose:p,webResults:e,legacyIdentifier:"citationListModal"})]})});Ck.displayName="EntityItemSourcePile";const Sk={summary:"",review_quality_score:0,pros_detailed:[],cons_detailed:[],pros:[],cons:[],key_features:[],buy_if:"",review_search_results:[]},Rrt=(e,t,n,r)=>{if(e.backend_uuid!==t)return e;const s=e.blocks||[],o=[...s];let a=!1;const i=(p,h=Sk)=>p.url===n?{...p,review_summary:{...h,...r}}:p,c=s.findIndex(p=>p.shopping_mode_block);if(c>=0){const p=s[c],h=p?.shopping_mode_block;if(h){const g=h.shopping_widgets.map(y=>i(y,y.review_summary));o[c]={...p,shopping_mode_block:{...h,shopping_widgets:g}},a=!0}}const u=s.findIndex(p=>p.inline_entity_block?.shopping_preview_block);if(u>=0){const p=s[u],h=p?.inline_entity_block?.shopping_preview_block;if(h&&h.shopping_widgets){const g=h.shopping_widgets.map(y=>i(y,y.review_summary));o[u]={...p,inline_entity_block:{...p.inline_entity_block,shopping_preview_block:{...h,shopping_widgets:g}}},a=!0}}const f=s.findIndex(p=>p.entity_list_block?.entities.some(h=>h.shopping_block));if(f>=0){const p=s[f],h=p?.entity_list_block;if(h){const g={...h,entities:h.entities.map(y=>y.shopping_block&&y.shopping_block.url===n?{...y,shopping_block:i(y.shopping_block,y.shopping_block.review_summary)}:y)};o[f]={...p,entity_list_block:g},a=!0}}const m=s.reduce((p,h,g)=>(h.entity_group_block?.entities.some(y=>y.shopping_block&&y.shopping_block.url===n)&&p.push(g),p),[]);for(const p of m){const h=s[p],g=h?.entity_group_block;if(g){const y=g.entities.map(x=>x.shopping_block&&x.shopping_block.url===n?{...x,shopping_block:i(x.shopping_block,x.shopping_block.review_summary)}:x);o[p]={...h,entity_group_block:{...g,entities:y}},a=!0}}return a?{...e,blocks:o}:e},xC=e=>["shoppingReviewSummary",e],Drt=({shouldMutateStore:e=!0,reason:t})=>{const n=vz(),r=Xt(),{mutateAsync:s,isPending:o,error:a,data:i}=It({mutationFn:async c=>{const u=r.getQueryData(xC(c.url));if(u)return u;let f=Sk,m="PENDING",p="";try{await de.SSE("/rest/sse/shopping_review_summary",t,{params:c,handlers:{message:g=>{m=g.status??m,p=g.id??p,g.blocks?.[0]?.shopping_block&&(f=g.blocks?.[0]?.shopping_block),r.setQueryData(xC(c.url),y=>y?{...y,status:m,id:p,review_summary:{...y.review_summary||Sk,...f}}:{review_summary:f,status:m,id:p}),e&&n(c.entry_uuid,y=>Rrt(y,c.entry_uuid,p,f))}}})}catch{}const h={review_summary:f,status:m,id:p};return r.setQueryData(xC(c.url),h),h}});return d.useMemo(()=>({generateShoppingReviewSummary:s,reviewSummary:i?.review_summary,isPending:o,error:a}),[i?.review_summary,a,s,o])},jrt=({block:e})=>{const{product_name:t="",product_price:n,product_brand:r="",product_url:s="",compare_at_price:o,products:a}=e,{result:{backend_uuid:i}}=Ot(),{$t:c}=J(),{label:u}=Loe(a,n),{reviewSummary:f,generateShoppingReviewSummary:m,isPending:p}=Drt({reason:"price-comparison-inline-card"});d.useEffect(()=>{!t||!s||m({product_name:t,merchant_name:r,url:s,price:n?.toString()??"",description:"",entry_uuid:i??""})},[t,r,s,i,m,n]);const h=d.useMemo(()=>a?[...a].sort((y,x)=>(y.offers?.[0]?.price??0)-(x.offers?.[0]?.price??0)):void 0,[a]),g=d.useMemo(()=>h?.map(y=>({name:y.title??"",url:y.offers?.[0]?.url??"",snippet:"",timestamp:"",meta_data:void 0,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_focused_web:!1,is_client_context:!1,is_widget:!1,sitelinks:[],inline_entity_id:""}))??Ie,[h]);return l.jsx("div",{className:"gap-md flex flex-col",children:l.jsxs(mr,{className:"divide-y",children:[l.jsx("div",{className:"gap-md flex items-center p-[12px]",children:l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(V,{variant:"baseSemi",className:"line-clamp-2 leading-tight",children:t}),l.jsx(DN,{brand:r,url:s,price:n,compareAtPrice:o})]})}),n&&u?l.jsx("div",{className:"px-md",children:l.jsx(gC,{title:u,children:l.jsx(Irt,{price:n,products:a})})}):null,h&&h.length>0?l.jsx("div",{className:"px-md",children:l.jsx(gC,{title:c({defaultMessage:"See similar products",id:"RZk98Mstcl"}),trailingContent:l.jsx(Ck,{webResults:g}),children:l.jsx(Prt,{sortedProductsByPrice:h})})}):null,f?l.jsx("div",{className:"px-md",children:l.jsx(gC,{title:c({defaultMessage:"Reviews",id:"dUxyza4PYQ"}),trailingContent:l.jsx(Ck,{webResults:f.review_search_results}),children:l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(V,{variant:"small",children:f.summary}),l.jsx(AN,{pros:f.pros_detailed,cons:f.cons_detailed,loading:p,id:s,scrollOnMobile:!1})]})})}):null]})})},DN=d.memo(({brand:e,url:t,price:n,compareAtPrice:r})=>{const s=e!==""?e:sg(t),o=n?n.toLocaleString("en-US",{style:"currency",currency:"USD"}):null,a=r?r.toLocaleString("en-US",{style:"currency",currency:"USD"}):null;return l.jsxs(ya,{className:"max-w-full",children:[l.jsx(Vn,{id:"merchant",children:l.jsx("div",{className:"overflow-hidden",children:l.jsx(NN,{name:s,domain:t})})}),o?l.jsx(Vn,{id:"price",children:l.jsx(Qoe,{price:o,textVariant:"tiny",comparePrice:a??void 0})}):null]})});DN.displayName="ProductMetadata";const Irt=({price:e,products:t})=>{const{high:n,low:r,textColor:s,backgroundColor:o,fairBounds:a}=Loe(t,e),i=d.useMemo(()=>{if(!r||!n||!e)return null;const u=n-r;return(e-r)/u*100},[e,r,n]),c=()=>l.jsx("svg",{width:"5",height:"4",viewBox:"0 0 5 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{opacity:"0.5",d:"M1.7999 0.25C1.99235 -0.0833333 2.47347 -0.0833332 2.66592 0.25L4.39797 3.25C4.59042 3.58333 4.34986 4 3.96496 4H0.500859C0.115959 4 -0.124603 3.58333 0.0678468 3.25L1.7999 0.25Z",fill:"currentColor"})});return l.jsx("div",{className:"pt-xl pb-lg flex",children:l.jsxs(K,{variant:"transparent",className:"gap-two relative flex h-1.5 w-full rounded-full",children:[l.jsxs("div",{className:"absolute bottom-1/2 z-10 flex w-0 flex-col items-center gap-0.5",style:{left:`${i}%`},children:[l.jsxs("div",{className:"px-sm relative inline-flex rounded-full py-0.5",children:[l.jsx(V,{variant:"smallBold",className:z("whitespace-nowrap",{[s]:!0}),children:e?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})}),l.jsx("div",{className:z("absolute inset-0 rounded-full opacity-10",{[o]:!0})})]}),l.jsx(K,{variant:"background",className:"size-4 shrink-0 translate-y-1/2 rounded-full",children:l.jsx(K,{variant:"raised",className:"size-full rounded-full",children:l.jsx(K,{variant:"subtler",className:"p-three size-full rounded-full",children:l.jsx("div",{className:z("size-full rounded-full",{[o]:!0})})})})})]}),l.jsx("div",{className:"bg-positive relative h-full flex-1 rounded-full",children:l.jsxs("div",{className:"pt-sm absolute right-0 top-full flex translate-x-1/2 flex-col items-center gap-0.5",children:[l.jsx(c,{}),l.jsx(V,{variant:"tinyRegular",color:"light",children:a?.low?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})})]})}),l.jsx("div",{className:"bg-subtle relative h-full flex-1 rounded-full"}),l.jsx("div",{className:"bg-negative relative h-full flex-1 rounded-full",children:l.jsxs("div",{className:"pt-sm absolute left-0 top-full flex -translate-x-1/2 flex-col items-center gap-0.5",children:[l.jsx(c,{}),l.jsx(V,{variant:"tinyRegular",color:"light",children:a?.high?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})})]})})]})})},Prt=({sortedProductsByPrice:e})=>{const[t,n]=d.useState(!1),r=d.useCallback(()=>{n(!t)},[t]),{$t:s}=J();return l.jsxs("div",{className:"gap-sm flex flex-col mt-sm",children:[e?.slice(0,t?void 0:5).map(o=>l.jsx(oae,{product:o},o.title)),e&&e.length>5?l.jsx(Ct,{variant:"secondary",onClick:r,size:"small",trailingIcon:t?B("chevron-up"):B("chevron-down"),children:s(t?{defaultMessage:"View less",id:"EVFai9MfkN"}:{defaultMessage:"View all",id:"pFK6bJU0EM"})}):null]})},oae=({product:e})=>{const{$t:t}=J(),n=d.useMemo(()=>e.offers?[...e.offers].filter(r=>r.url).sort((r,s)=>(r.price??0)-(s.price??0))[0]:void 0,[e.offers]);return n?l.jsx(mr,{className:"p-[12px] rounded-xl",variant:"subtler",children:l.jsxs("div",{className:"md:gap-md flex h-full items-center justify-between gap-[12px]",children:[l.jsxs("div",{className:"gap-xs flex min-w-0 w-full flex-col items-start",children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-2 leading-tight",children:e.title}),l.jsx(DN,{brand:n.merchant_name??"",url:n.url??"",price:n.price,compareAtPrice:n.compare_at_price})]}),l.jsx("div",{className:"gap-xs flex shrink-0",children:l.jsx(Ct,{pill:!0,size:"small",variant:"tonal",onClick:()=>window.open(n.url,"_blank"),children:l.jsx(V,{variant:"tinyRegular",color:"light",className:"whitespace-nowrap text-right leading-tight",children:t({defaultMessage:"Visit site",id:"O9CCwEBdYk"})})})})]})}):null};oae.displayName="SimilarProduct";const Ort=({widgetType:e,widgetName:t,widgetSize:n="full"})=>{const{session:r}=je(),{trackEvent:s}=Ke(r),{result:{backend_uuid:o,frontend_context_uuid:a}}=Ot(),i=d.useMemo(()=>({widgetType:e,widgetName:t,widgetLocation:"thread",widgetSize:n,position:0,frontendUUID:a,entryUUID:o}),[e,t,o,a,n]),c=d.useCallback(()=>{s("widget viewed",i)},[s,i]),u=d.useCallback(()=>{s("widget hovered",i)},[s,i]),f=d.useCallback(m=>{s("widget selected",{...i,widgetCTA:{type:"internal_url",permalink:m}})},[s,i]);return d.useMemo(()=>({widgetViewed:c,widgetHovered:u,widgetSelected:f}),[c,u,f])},Es=T.memo(e=>{const{children:t,...n}=e,{widgetSelected:r,widgetViewed:s,widgetHovered:o}=Ort(n),a=d.useRef({hovered:!1,viewed:!1}),{ref:i,isIntersecting:c}=mme({options:{threshold:.5},freezeOnceVisible:!0});d.useEffect(()=>{c&&!a.current.viewed&&(s(),a.current.viewed=!0)},[c,s]);const u=d.useCallback(()=>{a.current.hovered||(o(),a.current.hovered=!0)},[o]);return l.jsx("div",{ref:i,onMouseEnter:u,"data-testid":e.widgetType+"-widget",children:typeof t=="function"?t({widgetSelected:r}):t})});Es.displayName="WithThreadWidgetInteractionEvents";const aae=T.memo(e=>{const{data:t}=e,{menuItems:n}=im();return t?.result==null?null:l.jsx(Es,{widgetType:"calculator",widgetName:"calculator",widgetSize:"full",children:l.jsx(K,{className:"flex",children:l.jsxs("div",{className:"flex w-full items-center",children:[l.jsx(V,{color:"light",variant:"smallBold",children:l.jsx(ge,{className:"mt-two text-2xl leading-none",icon:B("calculator"),size:"sm"})}),l.jsx(V,{children:l.jsx(K,{className:"pl-md font-mono text-2xl",children:Ybe(t.result)})}),n&&n.length>0&&l.jsx("div",{className:"flex grow items-start justify-end",children:l.jsx(Un.Menu,{menuItems:n})})]})})})});aae.displayName="CalculatorWidget";function Yi(e){return Array.isArray?Array.isArray(e):cae(e)==="[object Array]"}function Lrt(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Frt(e){return e==null?"":Lrt(e)}function Ha(e){return typeof e=="string"}function iae(e){return typeof e=="number"}function Brt(e){return e===!0||e===!1||Urt(e)&&cae(e)=="[object Boolean]"}function lae(e){return typeof e=="object"}function Urt(e){return lae(e)&&e!==null}function Zs(e){return e!=null}function vC(e){return!e.trim().length}function cae(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Vrt="Incorrect 'index' type",Hrt=e=>`Invalid value for key ${e}`,zrt=e=>`Pattern length exceeds max of ${e}.`,Wrt=e=>`Missing ${e} property in key`,Grt=e=>`Property 'weight' in key '${e}' must be a positive integer`,eL=Object.prototype.hasOwnProperty;class $rt{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let s=uae(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function uae(e){let t=null,n=null,r=null,s=1,o=null;if(Ha(e)||Yi(e))r=e,t=tL(e),n=Ek(e);else{if(!eL.call(e,"name"))throw new Error(Wrt("name"));const a=e.name;if(r=a,eL.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(Grt(a));t=tL(a),n=Ek(a),o=e.getFn}return{path:t,id:n,weight:s,src:r,getFn:o}}function tL(e){return Yi(e)?e:e.split(".")}function Ek(e){return Yi(e)?e.join("."):e}function qrt(e,t){let n=[],r=!1;const s=(o,a,i)=>{if(Zs(o))if(!a[i])n.push(o);else{let c=a[i];const u=o[c];if(!Zs(u))return;if(i===a.length-1&&(Ha(u)||iae(u)||Brt(u)))n.push(Frt(u));else if(Yi(u)){r=!0;for(let f=0,m=u.length;fe.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ha(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ha(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(Zs(a)){if(Yi(a)){let i=[];const c=[{nestedArrIndex:-1,value:a}];for(;c.length;){const{nestedArrIndex:u,value:f}=c.pop();if(Zs(f))if(Ha(f)&&!vC(f)){let m={v:f,i:u,n:this.norm.get(f)};i.push(m)}else Yi(f)&&f.forEach((m,p)=>{c.push({nestedArrIndex:p,value:m})})}r.$[o]=i}else if(Ha(a)&&!vC(a)){let i={v:a,n:this.norm.get(a)};r.$[o]=i}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function dae(e,t,{getFn:n=Rt.getFn,fieldNormWeight:r=Rt.fieldNormWeight}={}){const s=new jN({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(uae)),s.setSources(t),s.create(),s}function est(e,{getFn:t=Rt.getFn,fieldNormWeight:n=Rt.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new jN({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function b1(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:s=Rt.distance,ignoreLocation:o=Rt.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(r-n);return s?a+i/s:i?1:a}function tst(e=[],t=Rt.minMatchCharLength){let n=[],r=-1,s=-1,o=0;for(let a=e.length;o=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}const Ec=32;function nst(e,t,n,{location:r=Rt.location,distance:s=Rt.distance,threshold:o=Rt.threshold,findAllMatches:a=Rt.findAllMatches,minMatchCharLength:i=Rt.minMatchCharLength,includeMatches:c=Rt.includeMatches,ignoreLocation:u=Rt.ignoreLocation}={}){if(t.length>Ec)throw new Error(zrt(Ec));const f=t.length,m=e.length,p=Math.max(0,Math.min(r,m));let h=o,g=p;const y=i>1||c,x=y?Array(m):[];let v;for(;(v=e.indexOf(t,g))>-1;){let E=b1(t,{currentLocation:v,expectedLocation:p,distance:s,ignoreLocation:u});if(h=Math.min(E,h),g=v+f,y){let N=0;for(;N=I;P-=1){let F=P-1,R=n[e.charAt(F)];if(y&&(x[F]=+!!R),A[P]=(A[P+1]<<1|1)&R,E&&(A[P]|=(b[P+1]|b[P])<<1|1|b[P+1]),A[P]&S&&(_=b1(t,{errors:E,currentLocation:F,expectedLocation:p,distance:s,ignoreLocation:u}),_<=h)){if(h=_,g=F,g<=p)break;I=Math.max(1,2*p-g)}}if(b1(t,{errors:E+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:u})>h)break;b=A}const C={isMatch:g>=0,score:Math.max(.001,_)};if(y){const E=tst(x,i);E.length?c&&(C.indices=E):C.isMatch=!1}return C}function rst(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:p,alphabet:rst(p),startIndex:h})},m=this.pattern.length;if(m>Ec){let p=0;const h=m%Ec,g=m-h;for(;p{const{isMatch:v,score:b,indices:_}=nst(t,g,y,{location:s+x,distance:o,threshold:a,findAllMatches:i,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});v&&(p=!0),m+=b,v&&_&&(f=[...f,..._])});let h={isMatch:p,score:p?m/this.chunks.length:1};return p&&r&&(h.indices=f),h}}class ic{constructor(t){this.pattern=t}static isMultiMatch(t){return nL(t,this.multiRegex)}static isSingleMatch(t){return nL(t,this.singleRegex)}search(){}}function nL(e,t){const n=e.match(t);return n?n[1]:null}class sst extends ic{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ost extends ic{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class ast extends ic{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ist extends ic{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class lst extends ic{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class cst extends ic{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class mae extends ic{constructor(t,{location:n=Rt.location,threshold:r=Rt.threshold,distance:s=Rt.distance,includeMatches:o=Rt.includeMatches,findAllMatches:a=Rt.findAllMatches,minMatchCharLength:i=Rt.minMatchCharLength,isCaseSensitive:c=Rt.isCaseSensitive,ignoreLocation:u=Rt.ignoreLocation}={}){super(t),this._bitapSearch=new fae(t,{location:n,threshold:r,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class pae extends ic{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const s=[],o=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+o,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const kk=[sst,pae,ast,ist,cst,lst,ost,mae],rL=kk.length,ust=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,dst="|";function fst(e,t={}){return e.split(dst).map(n=>{let r=n.trim().split(ust).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=r.length;o!!(e[F2.AND]||e[F2.OR]),gst=e=>!!e[Ak.PATH],yst=e=>!Yi(e)&&lae(e)&&!Nk(e),sL=e=>({[F2.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function hae(e,t,{auto:n=!0}={}){const r=s=>{let o=Object.keys(s);const a=gst(s);if(!a&&o.length>1&&!Nk(s))return r(sL(s));if(yst(s)){const c=a?s[Ak.PATH]:o[0],u=a?s[Ak.PATTERN]:s[c];if(!Ha(u))throw new Error(Hrt(c));const f={keyId:Ek(c),pattern:u};return n&&(f.searcher=Tk(u,t)),f}let i={children:[],operator:o[0]};return o.forEach(c=>{const u=s[c];Yi(u)&&u.forEach(f=>{i.children.push(r(f))})}),i};return Nk(e)||(e=sL(e)),r(e)}function xst(e,{ignoreFieldNorm:t=Rt.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;r*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),n.score=r})}function vst(e,t){const n=e.matches;t.matches=[],Zs(n)&&n.forEach(r=>{if(!Zs(r.indices)||!r.indices.length)return;const{indices:s,value:o}=r;let a={indices:s,value:o};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),t.matches.push(a)})}function bst(e,t){t.score=e.score}function _st(e,t,{includeMatches:n=Rt.includeMatches,includeScore:r=Rt.includeScore}={}){const s=[];return n&&s.push(vst),r&&s.push(bst),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(c=>{c(o,i)}),i})}class lm{constructor(t,n={},r){this.options={...Rt,...n},this.options.useExtendedSearch,this._keyStore=new $rt(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof jN))throw new Error(Vrt);this._myIndex=n||dae(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Zs(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,s=this._docs.length;r-1&&(c=c.slice(0,n)),_st(c,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(t){const n=Tk(t,this.options),{records:r}=this._myIndex,s=[];return r.forEach(({v:o,i:a,n:i})=>{if(!Zs(o))return;const{isMatch:c,score:u,indices:f}=n.searchIn(o);c&&s.push({item:o,idx:a,matches:[{score:u,value:o,norm:i,indices:f}]})}),s}_searchLogical(t){const n=hae(t,this.options),r=(i,c,u)=>{if(!i.children){const{keyId:m,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(c,m),searcher:p});return h&&h.length?[{idx:u,item:c,matches:h}]:[]}const f=[];for(let m=0,p=i.children.length;m{if(Zs(i)){let u=r(n,i,c);u.length&&(o[c]||(o[c]={idx:c,item:i,matches:[]},a.push(o[c])),u.forEach(({matches:f})=>{o[c].matches.push(...f)}))}}),a}_searchObjectList(t){const n=Tk(t,this.options),{keys:r,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!Zs(a))return;let c=[];r.forEach((u,f)=>{c.push(...this._findMatches({key:u,value:a[f],searcher:n}))}),c.length&&o.push({idx:i,item:a,matches:c})}),o}_findMatches({key:t,value:n,searcher:r}){if(!Zs(n))return[];let s=[];if(Yi(n))n.forEach(({v:o,i:a,n:i})=>{if(!Zs(o))return;const{isMatch:c,score:u,indices:f}=r.searchIn(o);c&&s.push({score:u,key:t,value:o,idx:a,norm:i,indices:f})});else{const{v:o,n:a}=n,{isMatch:i,score:c,indices:u}=r.searchIn(o);i&&s.push({score:c,key:t,value:o,norm:a,indices:u})}return s}}lm.version="7.0.0";lm.createIndex=dae;lm.parseIndex=est;lm.config=Rt;lm.parseQuery=hae;hst(pst);const Rk=[{currencyCode:"AED",type:"fiat",currency:W({defaultMessage:"United Arab Emirates dirham",id:"u/noLkGMVn"}),countryCode:"AE",symbol:"د.إ"},{currencyCode:"AFN",type:"fiat",currency:W({defaultMessage:"Afghan afghani",id:"HbCn83pcga"}),countryCode:"AF",symbol:"؋"},{currencyCode:"ALL",type:"fiat",currency:W({defaultMessage:"Albanian lek",id:"/il1Hf7GWO"}),countryCode:"AL",symbol:"L"},{currencyCode:"AMD",type:"fiat",currency:W({defaultMessage:"Armenian dram",id:"Sab4a7TKLH"}),countryCode:"AM",symbol:"֏"},{currencyCode:"ARS",type:"fiat",currency:W({defaultMessage:"Argentine peso",id:"52+/SFD8VZ"}),countryCode:"AR",symbol:"$"},{currencyCode:"AUD",type:"fiat",currency:W({defaultMessage:"Australian dollar",id:"iWILeLEVYR"}),countryCode:"AU",symbol:"$"},{currencyCode:"AWG",type:"fiat",currency:W({defaultMessage:"Aruban florin",id:"BEGfukujzF"}),countryCode:"AW",symbol:"ƒ"},{currencyCode:"BAM",type:"fiat",currency:W({defaultMessage:"Bosnia and Herzegovina convertible mark",id:"b09sYvQVre"}),countryCode:"BA",symbol:"KM"},{currencyCode:"BBD",type:"fiat",currency:W({defaultMessage:"Barbadian dollar",id:"VlWuwU66Ue"}),countryCode:"BB",symbol:"$"},{currencyCode:"BDT",type:"fiat",currency:W({defaultMessage:"Bangladeshi taka",id:"nzdEshqHWS"}),countryCode:"BD",symbol:"৳"},{currencyCode:"BGN",type:"fiat",currency:W({defaultMessage:"Bulgarian lev",id:"IDTjXBqV4N"}),countryCode:"BG",symbol:"лв"},{currencyCode:"BHD",type:"fiat",currency:W({defaultMessage:"Bahraini dinar",id:"eq8qHJx0kM"}),countryCode:"BH",symbol:".د.ب"},{currencyCode:"BIF",type:"fiat",currency:W({defaultMessage:"Burundian franc",id:"o/KpEtmYi4"}),countryCode:"BI",symbol:"FBu"},{currencyCode:"BMD",type:"fiat",currency:W({defaultMessage:"Bermudian dollar",id:"kO0KeiZ+IN"}),countryCode:"BM",symbol:"$"},{currencyCode:"BND",type:"fiat",currency:W({defaultMessage:"Brunei dollar",id:"GRkirfzc48"}),countryCode:"BN",symbol:"$"},{currencyCode:"BOB",type:"fiat",currency:W({defaultMessage:"Bolivian boliviano",id:"l7UUEAhjL1"}),countryCode:"BO",symbol:"Bs."},{currencyCode:"BRL",type:"fiat",currency:W({defaultMessage:"Brazilian real",id:"x+BZGn5rek"}),countryCode:"BR",symbol:"R$"},{currencyCode:"BSD",type:"fiat",currency:W({defaultMessage:"Bahamian dollar",id:"u9nfam/El1"}),countryCode:"BS",symbol:"$"},{currencyCode:"BTN",type:"fiat",currency:W({defaultMessage:"Bhutanese ngultrum",id:"EbzIZvY2C3"}),countryCode:"BT",symbol:"Nu."},{currencyCode:"BWP",type:"fiat",currency:W({defaultMessage:"Botswana pula",id:"TvRjxCQudG"}),countryCode:"BW",symbol:"P"},{currencyCode:"BZD",type:"fiat",currency:W({defaultMessage:"Belize dollar",id:"tnMfFVDwiX"}),countryCode:"BZ",symbol:"$"},{currencyCode:"CAD",type:"fiat",currency:W({defaultMessage:"Canadian dollar",id:"L4ftYFzYiG"}),countryCode:"CA",symbol:"$"},{currencyCode:"CDF",type:"fiat",currency:W({defaultMessage:"Congolese franc",id:"6DNXExdai2"}),countryCode:"CD",symbol:"FC"},{currencyCode:"CHF",type:"fiat",currency:W({defaultMessage:"Swiss franc",id:"113zTX3mKi"}),countryCode:"CH",symbol:"Fr."},{currencyCode:"CLP",type:"fiat",currency:W({defaultMessage:"Chilean peso",id:"tLhKy6Swhn"}),countryCode:"CL",symbol:"$"},{currencyCode:"CNH",type:"fiat",currency:W({defaultMessage:"Chinese yuan (offshore)",id:"wAShedQ5+o"}),countryCode:"CN",symbol:"¥"},{currencyCode:"CNY",type:"fiat",currency:W({defaultMessage:"Chinese yuan",id:"/sleu+8FUs"}),countryCode:"CN",symbol:"¥"},{currencyCode:"COP",type:"fiat",currency:W({defaultMessage:"Colombian peso",id:"KR2NhLe6wO"}),countryCode:"CO",symbol:"$"},{currencyCode:"CRC",type:"fiat",currency:W({defaultMessage:"Costa Rican colón",id:"OLgF3rrfev"}),countryCode:"CR",symbol:"₡"},{currencyCode:"CUP",type:"fiat",currency:W({defaultMessage:"Cuban peso",id:"ua/JslQGFc"}),countryCode:"CU",symbol:"$"},{currencyCode:"CVE",type:"fiat",currency:W({defaultMessage:"Cape Verdean escudo",id:"gg39Xd9NoM"}),countryCode:"CV",symbol:"$"},{currencyCode:"CYP",type:"fiat",currency:W({defaultMessage:"Cypriot pound",id:"xJn7heFKbn"}),countryCode:"CY",symbol:"£"},{currencyCode:"CZK",type:"fiat",currency:W({defaultMessage:"Czech koruna",id:"xpMdKvcamT"}),countryCode:"CZ",symbol:"Kč"},{currencyCode:"DJF",type:"fiat",currency:W({defaultMessage:"Djiboutian franc",id:"WtP9AoFz2A"}),countryCode:"DJ",symbol:"Fdj"},{currencyCode:"DKK",type:"fiat",currency:W({defaultMessage:"Danish krone",id:"Xy5G3y8jOw"}),countryCode:"DK",symbol:"kr"},{currencyCode:"DOP",type:"fiat",currency:W({defaultMessage:"Dominican peso",id:"2i/KFaPpw5"}),countryCode:"DO",symbol:"RD$"},{currencyCode:"DZD",type:"fiat",currency:W({defaultMessage:"Algerian dinar",id:"6sTpFM3olk"}),countryCode:"DZ",symbol:"دج"},{currencyCode:"EGP",type:"fiat",currency:W({defaultMessage:"Egyptian pound",id:"PxOcvtceh8"}),countryCode:"EG",symbol:"£"},{currencyCode:"ETB",type:"fiat",currency:W({defaultMessage:"Ethiopian birr",id:"6VjP5tvzWg"}),countryCode:"ET",symbol:"Br"},{currencyCode:"EUR",type:"fiat",currency:W({defaultMessage:"Euro",id:"Zz6d8XMgGD"}),countryCode:"EU",symbol:"€"},{currencyCode:"FJD",type:"fiat",currency:W({defaultMessage:"Fijian dollar",id:"w33lAGgTZS"}),countryCode:"FJ",symbol:"$"},{currencyCode:"GBP",type:"fiat",currency:W({defaultMessage:"Pound sterling",id:"uU25lEI6GM"}),countryCode:"GB",symbol:"£"},{currencyCode:"GEL",type:"fiat",currency:W({defaultMessage:"Georgian lari",id:"m4gS106RpO"}),countryCode:"GE",symbol:"₾"},{currencyCode:"GHS",type:"fiat",currency:W({defaultMessage:"Ghanaian cedi",id:"2k7sXvkoLP"}),countryCode:"GH",symbol:"₵"},{currencyCode:"GMD",type:"fiat",currency:W({defaultMessage:"Gambian dalasi",id:"zT8nD3rOKp"}),countryCode:"GM",symbol:"D"},{currencyCode:"GNF",type:"fiat",currency:W({defaultMessage:"Guinean franc",id:"kZk7wkuU9a"}),countryCode:"GN",symbol:"FG"},{currencyCode:"GTQ",type:"fiat",currency:W({defaultMessage:"Guatemalan quetzal",id:"0eSFsz1h5U"}),countryCode:"GT",symbol:"Q"},{currencyCode:"GYD",type:"fiat",currency:W({defaultMessage:"Guyanese dollar",id:"pvTNSDiMVb"}),countryCode:"GY",symbol:"$"},{currencyCode:"HKD",type:"fiat",currency:W({defaultMessage:"Hong Kong dollar",id:"tSeK2eAo7a"}),countryCode:"HK",symbol:"$"},{currencyCode:"HNL",type:"fiat",currency:W({defaultMessage:"Honduran lempira",id:"u1All4YZ/M"}),countryCode:"HN",symbol:"L"},{currencyCode:"HRK",type:"fiat",currency:W({defaultMessage:"Croatian kuna",id:"m4/bILMdtE"}),countryCode:"HR",symbol:"kn"},{currencyCode:"HTG",type:"fiat",currency:W({defaultMessage:"Haitian gourde",id:"fYPjhPHJw5"}),countryCode:"HT",symbol:"G"},{currencyCode:"HUF",type:"fiat",currency:W({defaultMessage:"Hungarian forint",id:"Bhl6SxOjG0"}),countryCode:"HU",symbol:"Ft"},{currencyCode:"IDR",type:"fiat",currency:W({defaultMessage:"Indonesian rupiah",id:"JnQBDoCEpL"}),countryCode:"ID",symbol:"Rp"},{currencyCode:"ILS",type:"fiat",currency:W({defaultMessage:"Israeli new shekel",id:"IxD6vfIMsj"}),countryCode:"IL",symbol:"₪"},{currencyCode:"INR",type:"fiat",currency:W({defaultMessage:"Indian rupee",id:"XnsufP9pQC"}),countryCode:"IN",symbol:"₹"},{currencyCode:"IQD",type:"fiat",currency:W({defaultMessage:"Iraqi dinar",id:"rmzi7U/4iu"}),countryCode:"IQ",symbol:"ع.د"},{currencyCode:"ISK",type:"fiat",currency:W({defaultMessage:"Icelandic króna",id:"+QCFy0sZgh"}),countryCode:"IS",symbol:"kr"},{currencyCode:"JMD",type:"fiat",currency:W({defaultMessage:"Jamaican dollar",id:"EkOwDtWSVs"}),countryCode:"JM",symbol:"J$"},{currencyCode:"JOD",type:"fiat",currency:W({defaultMessage:"Jordanian dinar",id:"B2GvyCUDsS"}),countryCode:"JO",symbol:"د.ا"},{currencyCode:"JPY",type:"fiat",currency:W({defaultMessage:"Japanese yen",id:"2PiQsV1fPp"}),countryCode:"JP",symbol:"¥"},{currencyCode:"KES",type:"fiat",currency:W({defaultMessage:"Kenyan shilling",id:"JIjYrchwhv"}),countryCode:"KE",symbol:"KSh"},{currencyCode:"KHR",type:"fiat",currency:W({defaultMessage:"Cambodian riel",id:"KCKOEaCtcY"}),countryCode:"KH",symbol:"៛"},{currencyCode:"KMF",type:"fiat",currency:W({defaultMessage:"Comorian franc",id:"WV9ZQdQeR+"}),countryCode:"KM",symbol:"CF"},{currencyCode:"KRW",type:"fiat",currency:W({defaultMessage:"South Korean won",id:"EiHQBnRax2"}),countryCode:"KR",symbol:"₩"},{currencyCode:"KWD",type:"fiat",currency:W({defaultMessage:"Kuwaiti dinar",id:"fkOQdpZmRV"}),countryCode:"KW",symbol:"د.ك"},{currencyCode:"KYD",type:"fiat",currency:W({defaultMessage:"Cayman Islands dollar",id:"RsdrXusNMV"}),countryCode:"KY",symbol:"$"},{currencyCode:"KZT",type:"fiat",currency:W({defaultMessage:"Kazakhstani tenge",id:"2qtVTeGWCE"}),countryCode:"KZ",symbol:"₸"},{currencyCode:"LAK",type:"fiat",currency:W({defaultMessage:"Lao kip",id:"Fgzd1G5Yfn"}),countryCode:"LA",symbol:"₭"},{currencyCode:"LBP",type:"fiat",currency:W({defaultMessage:"Lebanese pound",id:"FGzeEqNQzF"}),countryCode:"LB",symbol:"ل.ل"},{currencyCode:"LKR",type:"fiat",currency:W({defaultMessage:"Sri Lankan rupee",id:"a4/joWlRVu"}),countryCode:"LK",symbol:"Rs"},{currencyCode:"LRD",type:"fiat",currency:W({defaultMessage:"Liberian dollar",id:"FI1z5I01J6"}),countryCode:"LR",symbol:"$"},{currencyCode:"LSL",type:"fiat",currency:W({defaultMessage:"Lesotho loti",id:"csvFpR0QuR"}),countryCode:"LS",symbol:"L"},{currencyCode:"LTL",type:"fiat",currency:W({defaultMessage:"Lithuanian litas",id:"0eziwi9562"}),countryCode:"LT",symbol:"Lt"},{currencyCode:"LYD",type:"fiat",currency:W({defaultMessage:"Libyan dinar",id:"MHH+Pd33wK"}),countryCode:"LY",symbol:"ل.د"},{currencyCode:"MAD",type:"fiat",currency:W({defaultMessage:"Moroccan dirham",id:"ECYUhp5Zzw"}),countryCode:"MA",symbol:"د.م."},{currencyCode:"MDL",type:"fiat",currency:W({defaultMessage:"Moldovan leu",id:"b0q4AtgUSW"}),countryCode:"MD",symbol:"L"},{currencyCode:"MGA",type:"fiat",currency:W({defaultMessage:"Malagasy ariary",id:"7X6Af0dVLl"}),countryCode:"MG",symbol:"Ar"},{currencyCode:"MKD",type:"fiat",currency:W({defaultMessage:"Macedonian denar",id:"RCCw/rBMD7"}),countryCode:"MK",symbol:"ден"},{currencyCode:"MMK",type:"fiat",currency:W({defaultMessage:"Burmese kyat",id:"09O/caoUOd"}),countryCode:"MM",symbol:"K"},{currencyCode:"MOP",type:"fiat",currency:W({defaultMessage:"Macanese pataca",id:"WSCDGHnfAP"}),countryCode:"MO",symbol:"P"},{currencyCode:"MUR",type:"fiat",currency:W({defaultMessage:"Mauritian rupee",id:"B7EPhc2k1/"}),countryCode:"MU",symbol:"₨"},{currencyCode:"MVR",type:"fiat",currency:W({defaultMessage:"Maldivian rufiyaa",id:"WKep/6FHLO"}),countryCode:"MV",symbol:"Rf"},{currencyCode:"MWK",type:"fiat",currency:W({defaultMessage:"Malawian kwacha",id:"0QSRp0Tfcl"}),countryCode:"MW",symbol:"MK"},{currencyCode:"MXN",type:"fiat",currency:W({defaultMessage:"Mexican peso",id:"cAJvdQ+v2Y"}),countryCode:"MX",symbol:"$"},{currencyCode:"MXV",type:"fiat",currency:W({defaultMessage:"Mexican Unidad de Inversion (UDI)",id:"pJjurDaC1J"}),countryCode:"MX",symbol:"UDI"},{currencyCode:"MYR",type:"fiat",currency:W({defaultMessage:"Malaysian ringgit",id:"BJOmmIMKBn"}),countryCode:"MY",symbol:"RM"},{currencyCode:"MZN",type:"fiat",currency:W({defaultMessage:"Mozambican metical",id:"KVoUcWYwrs"}),countryCode:"MZ",symbol:"MT"},{currencyCode:"NAD",type:"fiat",currency:W({defaultMessage:"Namibian dollar",id:"ofXViiQOEO"}),countryCode:"NA",symbol:"$"},{currencyCode:"NGN",type:"fiat",currency:W({defaultMessage:"Nigerian naira",id:"YtrB6By6fQ"}),countryCode:"NG",symbol:"₦"},{currencyCode:"NIO",type:"fiat",currency:W({defaultMessage:"Nicaraguan córdoba",id:"NJJMgSKcDP"}),countryCode:"NI",symbol:"C$"},{currencyCode:"NOK",type:"fiat",currency:W({defaultMessage:"Norwegian krone",id:"X7p/vNj1w0"}),countryCode:"NO",symbol:"kr"},{currencyCode:"NPR",type:"fiat",currency:W({defaultMessage:"Nepalese rupee",id:"KpP5Ur9yKv"}),countryCode:"NP",symbol:"₨"},{currencyCode:"NZD",type:"fiat",currency:W({defaultMessage:"New Zealand dollar",id:"uoVYggIiS7"}),countryCode:"NZ",symbol:"$"},{currencyCode:"OMR",type:"fiat",currency:W({defaultMessage:"Omani rial",id:"YuZlkmlwz6"}),countryCode:"OM",symbol:"ر.ع."},{currencyCode:"PAB",type:"fiat",currency:W({defaultMessage:"Panamanian balboa",id:"WsXJoQA7BU"}),countryCode:"PA",symbol:"B/."},{currencyCode:"PEN",type:"fiat",currency:W({defaultMessage:"Peruvian sol",id:"Gzey/zBCdq"}),countryCode:"PE",symbol:"S/."},{currencyCode:"PGK",type:"fiat",currency:W({defaultMessage:"Papua New Guinean kina",id:"1odcdptMV2"}),countryCode:"PG",symbol:"K"},{currencyCode:"PHP",type:"fiat",currency:W({defaultMessage:"Philippine peso",id:"Ze94/Fib/J"}),countryCode:"PH",symbol:"₱"},{currencyCode:"PKR",type:"fiat",currency:W({defaultMessage:"Pakistani rupee",id:"xg2ovH8pDh"}),countryCode:"PK",symbol:"₨"},{currencyCode:"PLN",type:"fiat",currency:W({defaultMessage:"Polish złoty",id:"5nGZooUDXi"}),countryCode:"PL",symbol:"zł"},{currencyCode:"PYG",type:"fiat",currency:W({defaultMessage:"Paraguayan guaraní",id:"faGTF61Eyw"}),countryCode:"PY",symbol:"₲"},{currencyCode:"QAR",type:"fiat",currency:W({defaultMessage:"Qatari riyal",id:"DuHEQnjrPb"}),countryCode:"QA",symbol:"ر.ق"},{currencyCode:"RON",type:"fiat",currency:W({defaultMessage:"Romanian leu",id:"lXgl4aKBP3"}),countryCode:"RO",symbol:"lei"},{currencyCode:"RSD",type:"fiat",currency:W({defaultMessage:"Serbian dinar",id:"giqvsRUiA5"}),countryCode:"RS",symbol:"дин."},{currencyCode:"RUB",type:"fiat",currency:W({defaultMessage:"Russian ruble",id:"4U+m5Kd694"}),countryCode:"RU",symbol:"₽"},{currencyCode:"RWF",type:"fiat",currency:W({defaultMessage:"Rwandan franc",id:"URbs3Tt0On"}),countryCode:"RW",symbol:"FRw"},{currencyCode:"SAR",type:"fiat",currency:W({defaultMessage:"Saudi riyal",id:"p6D2TLqko8"}),countryCode:"SA",symbol:"ر.س"},{currencyCode:"SCR",type:"fiat",currency:W({defaultMessage:"Seychellois rupee",id:"V7Ju6HZQJK"}),countryCode:"SC",symbol:"₨"},{currencyCode:"SDG",type:"fiat",currency:W({defaultMessage:"Sudanese pound",id:"FsgRxw4tdm"}),countryCode:"SD",symbol:"ج.س."},{currencyCode:"SEK",type:"fiat",currency:W({defaultMessage:"Swedish krona",id:"WoyUwT/z0X"}),countryCode:"SE",symbol:"kr"},{currencyCode:"SGD",type:"fiat",currency:W({defaultMessage:"Singapore dollar",id:"SCjBmFU+PM"}),countryCode:"SG",symbol:"$"},{currencyCode:"SHP",type:"fiat",currency:W({defaultMessage:"Saint Helena pound",id:"XZdS6/MxwW"}),countryCode:"SH",symbol:"£"},{currencyCode:"SLL",type:"fiat",currency:W({defaultMessage:"Sierra Leonean leone",id:"DFZ4yqf1EG"}),countryCode:"SL",symbol:"Le"},{currencyCode:"SOS",type:"fiat",currency:W({defaultMessage:"Somali shilling",id:"e7cANdrF41"}),countryCode:"SO",symbol:"Sh.So."},{currencyCode:"SVC",type:"fiat",currency:W({defaultMessage:"Salvadoran colón",id:"A2mT13SXuX"}),countryCode:"SV",symbol:"₡"},{currencyCode:"SZL",type:"fiat",currency:W({defaultMessage:"Swazi lilangeni",id:"+kNQR2VJjT"}),countryCode:"SZ",symbol:"E"},{currencyCode:"THB",type:"fiat",currency:W({defaultMessage:"Thai baht",id:"Yz36aOmXMd"}),countryCode:"TH",symbol:"฿"},{currencyCode:"TJS",type:"fiat",currency:W({defaultMessage:"Tajikistani somoni",id:"G3q+8He+TZ"}),countryCode:"TJ",symbol:"ЅM"},{currencyCode:"TMT",type:"fiat",currency:W({defaultMessage:"Turkmenistan manat",id:"iV0j+gxDPN"}),countryCode:"TM",symbol:"m"},{currencyCode:"TND",type:"fiat",currency:W({defaultMessage:"Tunisian dinar",id:"l6iU1LyMSk"}),countryCode:"TN",symbol:"د.ت"},{currencyCode:"TRY",type:"fiat",currency:W({defaultMessage:"Turkish lira",id:"hQ9m98Llgt"}),countryCode:"TR",symbol:"₺"},{currencyCode:"TTD",type:"fiat",currency:W({defaultMessage:"Trinidad and Tobago dollar",id:"Op/jRg7//J"}),countryCode:"TT",symbol:"TT$"},{currencyCode:"TWD",type:"fiat",currency:W({defaultMessage:"New Taiwan dollar",id:"yAeWHzFY54"}),countryCode:"TW",symbol:"NT$"},{currencyCode:"TZS",type:"fiat",currency:W({defaultMessage:"Tanzanian shilling",id:"7YNH90CDt1"}),countryCode:"TZ",symbol:"TSh"},{currencyCode:"UAH",type:"fiat",currency:W({defaultMessage:"Ukrainian hryvnia",id:"HCy2dyACi0"}),countryCode:"UA",symbol:"₴"},{currencyCode:"UGX",type:"fiat",currency:W({defaultMessage:"Ugandan shilling",id:"P5STuJcFRi"}),countryCode:"UG",symbol:"USh"},{currencyCode:"USD",type:"fiat",currency:W({defaultMessage:"United States dollar",id:"BPRJDRwXU1"}),countryCode:"US",symbol:"$"},{currencyCode:"UYU",type:"fiat",currency:W({defaultMessage:"Uruguayan peso",id:"HtXUCx6BL1"}),countryCode:"UY",symbol:"$U"},{currencyCode:"UZS",type:"fiat",currency:W({defaultMessage:"Uzbekistani soʻm",id:"lv4m0Kbuw1"}),countryCode:"UZ",symbol:"so'm"},{currencyCode:"VND",type:"fiat",currency:W({defaultMessage:"Vietnamese đồng",id:"We/RqEPpOp"}),countryCode:"VN",symbol:"₫"},{currencyCode:"XAF",type:"fiat",currency:W({defaultMessage:"Central African CFA franc",id:"fZwFESvHCw"}),countryCode:"CF",symbol:"FCFA"},{currencyCode:"XAG",type:"commodity",currency:W({defaultMessage:"Silver (troy ounce)",id:"XVTnv5Liuj"}),countryCode:"ZZ",symbol:"XAG"},{currencyCode:"XAU",type:"commodity",currency:W({defaultMessage:"Gold (troy ounce)",id:"s3i6lUYb/y"}),countryCode:"ZZ",symbol:"XAU"},{currencyCode:"XCD",type:"fiat",currency:W({defaultMessage:"East Caribbean dollar",id:"pXF3HmkspQ"}),countryCode:"AG",symbol:"$"},{currencyCode:"XDR",type:"fiat",currency:W({defaultMessage:"Special drawing rights",id:"X4eXXVN7wq"}),countryCode:"ZZ",symbol:"SDR"},{currencyCode:"XOF",type:"fiat",currency:W({defaultMessage:"West African CFA franc",id:"cezzLNBm20"}),countryCode:"SN",symbol:"CFA"},{currencyCode:"XPF",type:"fiat",currency:W({defaultMessage:"CFP franc",id:"txe+aX9vvZ"}),countryCode:"PF",symbol:"₣"},{currencyCode:"YER",type:"fiat",currency:W({defaultMessage:"Yemeni rial",id:"lRXRuW4arm"}),countryCode:"YE",symbol:"﷼"},{currencyCode:"ZAC",type:"fiat",currency:W({defaultMessage:"South African rand (financial)",id:"GsJykrhxvK"}),countryCode:"ZA",symbol:"R"},{currencyCode:"ZAR",type:"fiat",currency:W({defaultMessage:"South African rand",id:"MbU2//IGEL"}),countryCode:"ZA",symbol:"R"},{currencyCode:"ZMW",type:"fiat",currency:W({defaultMessage:"Zambian kwacha",id:"ZJnHTLBz2v"}),countryCode:"ZM",symbol:"ZK"},{currencyCode:"BTC",type:"crypto",currency:W({defaultMessage:"Bitcoin",id:"RkW5weBw8q"}),symbol:"₿"},{currencyCode:"ETH",type:"crypto",currency:W({defaultMessage:"Ethereum",id:"ohE0sWxJfP"}),symbol:"Ξ"},{currencyCode:"XRP",type:"crypto",currency:W({defaultMessage:"XRP",id:"rwHxdc9N83"}),symbol:"XRP"},{currencyCode:"BNB",type:"crypto",currency:W({defaultMessage:"BNB",id:"+x/JA+cbSg"}),symbol:"BNB"},{currencyCode:"USDT",type:"crypto",currency:W({defaultMessage:"Tether",id:"G17JtC1DRO"}),symbol:"USDT"},{currencyCode:"SOL",type:"crypto",currency:W({defaultMessage:"Solana",id:"RmbsLR1XI9"}),symbol:"SOL"},{currencyCode:"HYPE",type:"crypto",currency:W({defaultMessage:"HYPE",id:"sRJuK+IQu7"}),symbol:"HYPE"},{currencyCode:"STETH",type:"crypto",currency:W({defaultMessage:"stETH",id:"VNvqEhRv0o"}),symbol:"stETH"},{currencyCode:"WTRX",type:"crypto",currency:W({defaultMessage:"Wrapped TRX",id:"hi8IgS7Vvh"}),symbol:"WTRX"},{currencyCode:"DOGE",type:"crypto",currency:W({defaultMessage:"Dogecoin",id:"Q4KOhNgUFl"}),symbol:"DOGE"},{currencyCode:"ADA",type:"crypto",currency:W({defaultMessage:"Cardano",id:"Zk+zRo7Vav"}),symbol:"ADA"},{currencyCode:"TRX",type:"crypto",currency:W({defaultMessage:"TRON",id:"fLtNc/n43W"}),symbol:"TRX"},{currencyCode:"USDC",type:"crypto",currency:W({defaultMessage:"USD Coin",id:"tPc0IbLJq0"}),symbol:"USDC"},{currencyCode:"WBTC",type:"crypto",currency:W({defaultMessage:"Wrapped Bitcoin",id:"AO1Xrr+Cwk"}),symbol:"WBTC"},{currencyCode:"WSTETH",type:"crypto",currency:W({defaultMessage:"Wrapped stETH",id:"Fg7h7ipjGE"}),symbol:"wstETH"},{currencyCode:"EDLC",type:"crypto",currency:W({defaultMessage:"EDLC",id:"FplbXN+574"}),symbol:"EDLC"},{currencyCode:"LINK",type:"crypto",currency:W({defaultMessage:"Chainlink",id:"d/A799ZTa/"}),symbol:"LINK"},{currencyCode:"AIC",type:"crypto",currency:W({defaultMessage:"AIC",id:"RSOIsb9pEC"}),symbol:"AIC"},{currencyCode:"XLM",type:"crypto",currency:W({defaultMessage:"Stellar",id:"+uYwRW10Bd"}),symbol:"XLM"},{currencyCode:"WETH",type:"crypto",currency:W({defaultMessage:"Wrapped Ether",id:"s8UwDT+8t2"}),symbol:"WETH"},{currencyCode:"BCH",type:"crypto",currency:W({defaultMessage:"Bitcoin Cash",id:"hLt+wzROTK"}),symbol:"BCH"},{currencyCode:"UST",type:"crypto",currency:W({defaultMessage:"TerraUSD",id:"wot2OPkJDe"}),symbol:"UST"},{currencyCode:"AVAX",type:"crypto",currency:W({defaultMessage:"Avalanche",id:"C9K+TI7R4G"}),symbol:"AVAX"},{currencyCode:"SUI",type:"crypto",currency:W({defaultMessage:"Sui",id:"CvmoCbTblr"}),symbol:"SUI"},{currencyCode:"LTC",type:"crypto",currency:W({defaultMessage:"Litecoin",id:"oyKw8Dr6hh"}),symbol:"LTC"},{currencyCode:"TON",type:"crypto",currency:W({defaultMessage:"Toncoin",id:"V2AxdWxVB/"}),symbol:"TON"},{currencyCode:"HBAR",type:"crypto",currency:W({defaultMessage:"Hedera",id:"yLSpOa++/L"}),symbol:"HBAR"},{currencyCode:"WHBAR",type:"crypto",currency:W({defaultMessage:"Wrapped HBAR",id:"rfimaaddr1"}),symbol:"WHBAR"},{currencyCode:"UNI",type:"crypto",currency:W({defaultMessage:"Uniswap",id:"hincAkLfxR"}),symbol:"UNI"},{currencyCode:"BTCB",type:"crypto",currency:W({defaultMessage:"Bitcoin BEP2",id:"T7D16Bt6JS"}),symbol:"BTCB"},{currencyCode:"OKB",type:"crypto",currency:W({defaultMessage:"OKB",id:"6ZLe/X3P+I"}),symbol:"OKB"},{currencyCode:"SHIB",type:"crypto",currency:W({defaultMessage:"Shiba Inu",id:"dwuQAuovNP"}),symbol:"SHIB"},{currencyCode:"USDS",type:"crypto",currency:W({defaultMessage:"StableUSD",id:"DAzSEb0LeA"}),symbol:"USDS"},{currencyCode:"WBT",type:"crypto",currency:W({defaultMessage:"WhiteBIT Coin",id:"Lj9Zp416rG"}),symbol:"WBT"},{currencyCode:"BGB",type:"crypto",currency:W({defaultMessage:"Bitget Token",id:"OEQgkmdE1O"}),symbol:"BGB"},{currencyCode:"DAI",type:"crypto",currency:W({defaultMessage:"Dai",id:"7g+Z6oltsB"}),symbol:"DAI"},{currencyCode:"DOT",type:"crypto",currency:W({defaultMessage:"Polkadot",id:"iS7ue2zjn0"}),symbol:"DOT"},{currencyCode:"XMR",type:"crypto",currency:W({defaultMessage:"Monero",id:"RydJABkA4a"}),symbol:"XMR"},{currencyCode:"MNT",type:"crypto",currency:W({defaultMessage:"MNT",id:"90qNZszLR/"}),symbol:"MNT"},{currencyCode:"PEPE",type:"crypto",currency:W({defaultMessage:"Pepe",id:"x9wJbmzZhn"}),symbol:"PEPE"},{currencyCode:"AAVE",type:"crypto",currency:W({defaultMessage:"Aave",id:"kFjzNltaTL"}),symbol:"AAVE"},{currencyCode:"CRO",type:"crypto",currency:W({defaultMessage:"Cronos",id:"2cg8W1gIo3"}),symbol:"CRO"},{currencyCode:"ETC",type:"crypto",currency:W({defaultMessage:"Ethereum Classic",id:"Bv9Xkw6kNg"}),symbol:"ETC"},{currencyCode:"FD",type:"crypto",currency:W({defaultMessage:"FD",id:"+Q62UIi/LA"}),symbol:"FD"},{currencyCode:"TUSD",type:"crypto",currency:W({defaultMessage:"TrueUSD",id:"whDnhXYdIe"}),symbol:"TUSD"},{currencyCode:"NEAR",type:"crypto",currency:W({defaultMessage:"NEAR Protocol",id:"E9RsfkMwMk"}),symbol:"NEAR"},{currencyCode:"METAGAMES",type:"crypto",currency:W({defaultMessage:"MetaGames",id:"C0GGroVhnP"}),symbol:"METAGAMES"},{currencyCode:"TAO",type:"crypto",currency:W({defaultMessage:"Bittensor",id:"6+C0Ut5hKl"}),symbol:"TAO"},{currencyCode:"ICP",type:"crypto",currency:W({defaultMessage:"Internet Computer",id:"q9uyMXlX+M"}),symbol:"ICP"},{currencyCode:"GT",type:"crypto",currency:W({defaultMessage:"GateToken",id:"dSGfpIcmmI"}),symbol:"GT"},{currencyCode:"RETH",type:"crypto",currency:W({defaultMessage:"Rocket Pool ETH",id:"pg4o1kZ2d4"}),symbol:"rETH"},{currencyCode:"MRS",type:"crypto",currency:W({defaultMessage:"MRS",id:"CABw3watNU"}),symbol:"MRS"},{currencyCode:"APT",type:"crypto",currency:W({defaultMessage:"Aptos",id:"/U15UItsIY"}),symbol:"APT"},{currencyCode:"KAS",type:"crypto",currency:W({defaultMessage:"Kaspa",id:"1MwSSUoCwu"}),symbol:"KAS"},{currencyCode:"ALGO",type:"crypto",currency:W({defaultMessage:"Algorand",id:"TijDBb1K3w"}),symbol:"ALGO"},{currencyCode:"PENGU",type:"crypto",currency:W({defaultMessage:"PENGU",id:"esTSdYyjL9"}),symbol:"PENGU"},{currencyCode:"VET",type:"crypto",currency:W({defaultMessage:"VeChain",id:"o3b918Uwm9"}),symbol:"VET"},{currencyCode:"OTRUMP",type:"crypto",currency:W({defaultMessage:"OTRUMP",id:"dwjxu1ZNrs"}),symbol:"OTRUMP"},{currencyCode:"ARB",type:"crypto",currency:W({defaultMessage:"Arbitrum",id:"2qF6KBPwqc"}),symbol:"ARB"},{currencyCode:"LUNA1",type:"crypto",currency:W({defaultMessage:"Terra (LUNA1)",id:"g5JtKAkJm/"}),symbol:"LUNA1"},{currencyCode:"MKR",type:"crypto",currency:W({defaultMessage:"Maker",id:"iVoUggHR7n"}),symbol:"MKR"},{currencyCode:"QNT",type:"crypto",currency:W({defaultMessage:"Quant",id:"kZiBtRgPXK"}),symbol:"QNT"},{currencyCode:"BONK",type:"crypto",currency:W({defaultMessage:"BONK",id:"/WOyXrLUEt"}),symbol:"BONK"},{currencyCode:"ATOM",type:"crypto",currency:W({defaultMessage:"Cosmos",id:"VfvhDOBZSq"}),symbol:"ATOM"},{currencyCode:"FTN",type:"crypto",currency:W({defaultMessage:"FTN",id:"+BtHlnfKBJ"}),symbol:"FTN"},{currencyCode:"KCS",type:"crypto",currency:W({defaultMessage:"KuCoin Token",id:"J6x8n/y945"}),symbol:"KCS"},{currencyCode:"RNDR",type:"crypto",currency:W({defaultMessage:"Render",id:"fI33PYpQj/"}),symbol:"RNDR"},{currencyCode:"BNX",type:"crypto",currency:W({defaultMessage:"BNX",id:"/mzOvKP3DB"}),symbol:"BNX"},{currencyCode:"FIL",type:"crypto",currency:W({defaultMessage:"Filecoin",id:"O60m1dM5+I"}),symbol:"FIL"},{currencyCode:"WBNB",type:"crypto",currency:W({defaultMessage:"Wrapped BNB",id:"6oPoIEcEKM"}),symbol:"WBNB"},{currencyCode:"DUCK",type:"crypto",currency:W({defaultMessage:"DUCK",id:"Wy2n2zHjyn"}),symbol:"DUCK"},{currencyCode:"ONDO",type:"crypto",currency:W({defaultMessage:"Ondo",id:"Mdh4nCMVFp"}),symbol:"ONDO"},{currencyCode:"EZETH",type:"crypto",currency:W({defaultMessage:"EZETH",id:"GquMfdHRpr"}),symbol:"EZETH"},{currencyCode:"DHN",type:"crypto",currency:W({defaultMessage:"DHN",id:"3DBrwMVTuR"}),symbol:"DHN"},{currencyCode:"SPX",type:"crypto",currency:W({defaultMessage:"SPX",id:"78Gbn14660"}),symbol:"SPX"},{currencyCode:"XDC",type:"crypto",currency:W({defaultMessage:"XDC Network",id:"f4v54xCFpd"}),symbol:"XDC"},{currencyCode:"ENA",type:"crypto",currency:W({defaultMessage:"ENA",id:"G6NRdu/3/f"}),symbol:"ENA"},{currencyCode:"SOLVBTCBBN",type:"crypto",currency:W({defaultMessage:"SOLVBTCBBN",id:"U+VGyLBIbO"}),symbol:"SOLVBTCBBN"},{currencyCode:"LDO",type:"crypto",currency:W({defaultMessage:"Lido DAO",id:"Hm40klV7dx"}),symbol:"LDO"},{currencyCode:"INJ",type:"crypto",currency:W({defaultMessage:"Injective",id:"Zy5gqTZCK/"}),symbol:"INJ"},{currencyCode:"USD0",type:"crypto",currency:W({defaultMessage:"USD0",id:"I8k7Is+SUX"}),symbol:"USD0"},{currencyCode:"FLR",type:"crypto",currency:W({defaultMessage:"Flare",id:"EuWzA+LwQr"}),symbol:"FLR"},{currencyCode:"PY",type:"crypto",currency:W({defaultMessage:"PY",id:"2WmUk53rca"}),symbol:"PY"},{currencyCode:"SEI",type:"crypto",currency:W({defaultMessage:"Sei",id:"uIVFPKXueM"}),symbol:"SEI"},{currencyCode:"MSOL",type:"crypto",currency:W({defaultMessage:"Marinade Staked SOL",id:"Sgo9VGem0+"}),symbol:"mSOL"},{currencyCode:"CRV",type:"crypto",currency:W({defaultMessage:"Curve DAO Token",id:"hv2sTxuyJY"}),symbol:"CRV"},{currencyCode:"FTM",type:"crypto",currency:W({defaultMessage:"Fantom",id:"FdV4Gc/fz2"}),symbol:"FTM"},{currencyCode:"FLOKI",type:"crypto",currency:W({defaultMessage:"FLOKI",id:"d2sPiyXVq8"}),symbol:"FLOKI"},{currencyCode:"CMETH",type:"crypto",currency:W({defaultMessage:"CMETH",id:"ZXQlnD2obl"}),symbol:"CMETH"},{currencyCode:"SLISBNB",type:"crypto",currency:W({defaultMessage:"SLISBNB",id:"wqx7ZL4lbr"}),symbol:"SLISBNB"},{currencyCode:"FARTCOIN",type:"crypto",currency:W({defaultMessage:"FARTCOIN",id:"qFlNIb5L+O"}),symbol:"FARTCOIN"},{currencyCode:"EETH",type:"crypto",currency:W({defaultMessage:"eETH",id:"tCrC5owpVn"}),symbol:"eETH"},{currencyCode:"KAIA",type:"crypto",currency:W({defaultMessage:"KAIA",id:"fDXZE/gzgq"}),symbol:"KAIA"},{currencyCode:"GRT",type:"crypto",currency:W({defaultMessage:"The Graph",id:"oFrVNds2cX"}),symbol:"GRT"},{currencyCode:"IMX",type:"crypto",currency:W({defaultMessage:"Immutable",id:"+0mthqqK1s"}),symbol:"IMX"},{currencyCode:"WIF",type:"crypto",currency:W({defaultMessage:"WIF",id:"tK0cRtUi/S"}),symbol:"WIF"},{currencyCode:"RAY",type:"crypto",currency:W({defaultMessage:"Raydium",id:"pSdm2ZTXHD"}),symbol:"RAY"},{currencyCode:"OP",type:"crypto",currency:W({defaultMessage:"Optimism",id:"ghDrrz64nC"}),symbol:"OP"},{currencyCode:"XAUT",type:"crypto",currency:W({defaultMessage:"Tether Gold",id:"pobzwuxAfg"}),symbol:"XAUT"},{currencyCode:"PENDLE",type:"crypto",currency:W({defaultMessage:"Pendle",id:"z8diWExCd3"}),symbol:"PENDLE"}],Wu=(e,t="default")=>{if(!e)return"";const n=t==="indian"?"en-IN":"en-US",r=new Intl.NumberFormat(n,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:100}),s=e.endsWith("."),o=e.split("."),a=o[0]||"0",i=o[1]||"",c=parseFloat(e);if(isNaN(c))return"";let f=r.format(parseFloat(a));return o.length>1?f+="."+i:s&&(f+="."),f},gae=T.memo(({value:e,onChange:t,placeholder:n="0",disabled:r=!1,className:s="",min:o,max:a,step:i=1,formatting:c="default"})=>{const u=d.useRef(null),[f,m]=d.useState(Wu(e,c)),p=d.useCallback(x=>x.replace(/,/g,""),[]),h=d.useCallback(x=>{const v=x.target.value,b=p(v),_=x.target.selectionStart||0;if(b===""||/^\d*\.?\d*$/.test(b)&&!/e/i.test(v)){const w=Wu(b,c);m(w),t(b),requestAnimationFrame(()=>{if(u.current){const S=v.substring(0,_),C=p(S);let E=0,N=0;const k=C.replace(".","").length,I=C.includes(".")&&C.endsWith(".");for(let M=0;M{const v=u.current;if(!v||(x.metaKey||x.ctrlKey)&&(x.key==="z"||x.key==="Z"))return;const{selectionStart:b,selectionEnd:_,value:w}=v;if(x.key==="ArrowUp"||x.key==="ArrowDown"){x.preventDefault();const S=parseFloat(p(e))||0,C=x.key==="ArrowUp"?i:-i;let E=S+C;o!==void 0&&Ea&&(E=a);const N=E.toString(),k=Wu(N,c);m(k),t(N);return}if(x.key==="Backspace"&&b===_){if(b===null)return;if(w[b-1]===","){x.preventDefault();const C=w.substring(0,b-1),E=w.substring(b),N=C[C.length-1];if(N&&/\d/.test(N)){const k=C.slice(0,-1)+E,I=p(k),M=Wu(I,c);m(M),t(I),setTimeout(()=>{const A=M.length-p(E).length;v.setSelectionRange(A,A)},0)}}}},[p,t,e,i,o,a,c]),y=d.useCallback(x=>{x.preventDefault();const v=x.clipboardData.getData("text"),b=p(v);if(/^\d*\.?\d*$/.test(b)&&!/e/i.test(v)){const _=Wu(b,c);m(_),t(b)}},[p,t,c]);return T.useEffect(()=>{const x=Wu(e,c);m(x)},[e,c]),l.jsx("input",{ref:u,type:"text",value:f,onChange:h,onKeyDown:g,onPaste:y,placeholder:n,disabled:r,className:s,inputMode:"decimal"})});gae.displayName="CurrencyInput";const Xg=T.memo(({symbol:e,src:t,srcDark:n,className:r,size:s="lg",colorScheme:o})=>{n=n??t;const[a,i]=d.useState(!1),c=d.useRef(null),u=Ss(),f=o??u.colorScheme,m=()=>{c.current&&c.current.naturalHeight>0&&i(!1)};d.useEffect(()=>{c.current&&(c.current.complete&&c.current.naturalHeight===0?i(!0):i(!1))},[c]),d.useEffect(()=>{i(!1)},[e]);const p=f==="dark"?n:t;return l.jsx("div",{className:z({"size-lg":s==="lg","size-md":s==="md","size-sm":s==="sm"},"flex shrink-0 items-center justify-center",r),children:a||!p?l.jsx(wst,{symbol:e}):l.jsx("img",{ref:c,src:p,alt:e,className:"size-full rounded-[4px] object-contain",onError:()=>{i(!0)},onLoad:m},e)})});Xg.displayName="FinanceAssetLogo";const wst=({symbol:e})=>{const t=d.useMemo(()=>e.replace(/[^a-zA-Z0-9]/g,"").slice(0,1).toUpperCase(),[e]);return l.jsx(K,{variant:"subtle",className:"flex size-full items-center justify-center rounded-full",children:l.jsx(V,{color:"light",children:l.jsx("span",{className:"font-mono opacity-70",children:t||l.jsx(ft,{name:B("coin"),className:"size-4 text-gray-100 opacity-50"})})})})},Cst=(e,t)=>{if(!e?.id)return!1;const{status:n,...r}=e,{status:s,...o}=t;return Er(r,o)&&n!==s},IN=d.memo(({open:e,onClose:t,initialConfiguration:n,onSave:r,source:s,trackEvent:o,errorMessage:a,canEditSpace:i,canDelete:c})=>{const u=J(),{$t:f}=u,m=ci(),p="automation-modal",[h,g]=d.useState(!1),[y,x]=d.useState(null),[v,b]=d.useState(!1),_=d.useCallback(()=>{x(null),t()},[t]),{currentConfiguration:w,setCurrentConfiguration:S,onClickSave:C,onClickDelete:E,isLoading:N,isSaveDisabled:k,saveButtonTooltipText:I}=eqe({initialConfiguration:n,isModalOpened:e,reason:p,source:s,onSuccess:R=>{let j=R;R==="updated"&&Cst(n,w)&&(j=w.status==="PAUSED"?"paused":"resumed"),r?.(j),_(),g(j)},onError:x});d.useEffect(()=>{e&&(sk(s)?o?.("task modal opened",{source:s}):AP(s)?o?.("price alert modal opened",{source:s}):NP(s)&&o?.("shortcut modal opened",{source:s}))},[e,s,o]);const M=d.useMemo(()=>{const R=[];return w.id&&c&&R.push({text:f({defaultMessage:"Delete",id:"K3r6DQW7h+"}),variant:"rejecter",onClick:E,disabled:N}),R.push({text:f({defaultMessage:"Cancel",id:"47FYwba+bI"}),variant:"common",onClick:_}),R.push({text:f({defaultMessage:"Save",id:"jvo0vs3nF0"}),variant:"primary",onClick:C,disabled:k,tooltipText:I}),R},[f,c,w.id,N,k,E,C,_,I]),A=d.useCallback(R=>{const j=R?"ACTIVE":"PAUSED",L=j==="PAUSED"?"paused":"resumed";switch(S({...w,status:j}),w.trigger.type){case Xe.SCHEDULED:sk(s)&&tre(L)&&o?.("task modal action",{source:s,action:L});break;case Xe.PRICE_ALERT:AP(s)&&X$e(L)&&o?.("price alert modal action",{source:s,action:L});break;case Xe.SHORTCUT:NP(s)&&J$e(L)&&o?.("shortcut modal action",{source:s,action:L});break;default:Ft(w.trigger)}},[w,S,s,o]),D=d.useMemo(()=>{if(!w.id||w.trigger.type===Xe.PRICE_ALERT)return null;const R=w.status!=="PAUSED";return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(gg,{checked:R,onCheckedChange:A,disabled:N,"aria-label":f({defaultMessage:"Toggle automation status",id:"1IPeYXLNjx"})}),l.jsx("span",{children:f(R?{defaultMessage:"Active",id:"3a5wL8wo40"}:{defaultMessage:"Paused",id:"C2iTEHtK//"})})]})},[f,w.id,w.status,w.trigger.type,A,N]),P=d.useCallback(R=>{const j=v4(R);S(j)},[S]),F=d.useCallback(()=>{g(!1)},[]);return d.useEffect(()=>{n&&!v&&e&&(P(n),b(!0))},[P,v,n,e]),d.useEffect(()=>{e||b(!1)},[e]),l.jsxs(l.Fragment,{children:[l.jsx(po,{isOpen:e,onClose:_,title:lye({intl:u,triggerType:w.trigger.type}),titleTextVariant:"base",footerContent:D,actionList:M,footerClassname:"!pt-4",wrapperClassname:"!w-full",variant:m?"bottom-sheet":"default",children:l.jsx(ob,{configuration:w,onConfigurationChange:P,errorMessage:(a||y)??void 0,onError:x,canEditSpace:i})}),l.jsx(Yc,{message:h?cye({intl:u,triggerType:w.trigger.type,actionPerformed:h}):"",variant:"success",isVisible:!!h,handleClose:F,timeout:null})]})});IN.displayName="AutomationModal";const Sst=Object.freeze(Object.defineProperty({__proto__:null,AutomationModal:IN},Symbol.toStringTag,{value:"Module"})),Est=(e,t)=>{const{value:n,loading:r}=qt({flag:"tasks-price-alerts-ui-redesign",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},kst=(e,t)=>{const{value:n,loading:r}=qt({flag:"tasks-settings-ui-redesign",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Mst=(e,t)=>{const n={selectedOption:"price",priceValue:"",percentValue:Xv,positiveSelected:!0,negativeSelected:!0,additionalInstructions:"",selectedSymbol:t??null,inputValue:t??""};if(!e)return n;const{subscription:r,prompt:s}=e,o=r?YJ({prompt:s,symbol:r.event_entity}):nFe(s).additionalInstructions,a={...n,additionalInstructions:o};if(!r)return a;const{event_type:i,value_lower_bound:c,value_upper_bound:u,event_entity:f}=r;if(a.selectedSymbol=f??null,a.inputValue=f??"",i==="STOCK_PRICE_TARGET")a.selectedOption="price",u&&u!==Vl?a.priceValue=`$${u}`:c&&c!==Hl&&(a.priceValue=`$${c}`);else if(i==="STOCK_PRICE_MOVEMENT"){a.selectedOption="movement";const m=u!=null&&u!==Vl,p=c!=null&&c!==Hl;a.positiveSelected=m,a.negativeSelected=p,m?a.percentValue=`${u}`:p&&(a.percentValue=`${Math.abs(c)}`)}return a},PN=T.memo(({symbol:e,buttonProps:t,watchlistAddedForSymbol:n,modalOpenedSource:r})=>{const{session:s}=je(),{trackEvent:o}=Ke(s),a=d.useMemo(()=>{try{return decodeURIComponent(e.toUpperCase())}catch{return e.toUpperCase()}},[e]),{data:i,isLoading:c}=gt({queryKey:be.makeEphemeralQueryKey("getFinanceTicker",a),queryFn:()=>H9e({ticker:a,reason:"finance-ticker-supported-check"}),staleTime:1/0}),[u,f]=d.useState(!1),{isMobileStyle:m}=Re(),{$t:p}=J(),h=!!i?.supported,g=!!(i?.supported&&n),y=n?`finance-alert-watchlist-${a}`:"finance-alert-page-visit",x=(h||g)&&!u,{variation:v,loading:b}=kst(!1),{variation:_,loading:w}=Est(!1),S=d.useCallback(()=>f(!1),[]),C=d.useCallback(()=>{o("price alert modal opened",{source:r}),f(!0)},[r,o]);return c||!i?.supported||b||w?null:l.jsxs(l.Fragment,{children:[l.jsx(_v,{cueKey:y,title:p({defaultMessage:"Set an alert for {ticker}",id:"bb+ueMBxHa"},{ticker:a}),enabled:x,placement:"bottom",size:"sm",children:m?l.jsx(Ct,{size:"small",variant:"text",icon:B("bell-bolt"),onClick:C,"aria-label":p({id:"hrmMcFoV7/",defaultMessage:"Price Alert"}),rounded:t?.pill}):l.jsx(Ct,{size:"small",variant:"text",leadingIcon:B("bell-bolt"),onClick:C,pill:t?.pill,children:p({id:"hrmMcFoV7/",defaultMessage:"Price Alert"})})},y),v&&_?l.jsx(IN,{open:u,onClose:S,source:"settings_create",initialConfiguration:pye({symbol:e}),canEditSpace:!1,canDelete:!0}):l.jsx(bb,{isOpen:u,onClose:S,symbol:a})]})});PN.displayName="FinanceAddAlertIfSupported";const bb=T.memo(({isOpen:e,onClose:t,symbol:n,task:r})=>{const s=Dn(),{openToast:o}=pn(),a=!!r,[i,c]=d.useState(null),[u,f]=d.useState("price"),{isMobileStyle:m}=Re(),[p,h]=d.useState(""),{$t:g}=J(),[y,x]=d.useState(n??null),[v,b]=d.useState(!1),{data:_}=gt({queryKey:Ine(y),queryFn:()=>jne(y),enabled:!!y&&e,refetchInterval:5*1e3}),[w,S]=d.useState(""),[C,E]=d.useState(""),[N,k]=d.useState(!0),[I,M]=d.useState(!0),A=d.useMemo(()=>{if(u!=="price"||!_?.price)return;const le=parseFloat(w.replace(/[^0-9.]/g,""));if(!(isNaN(le)||le===_.price))return le>_.price?"above":"below"},[w,_?.price,u]),D=d.useCallback(()=>{b(!1),x(n??null)},[n]),{createMutation:P,updateMutation:F,deleteMutation:R}=ere({onCreateSuccess:()=>{t(),b(!1),D(),o({message:g({defaultMessage:"Price alert created",id:"YccmIRCItP"}),variant:"success",timeout:3,ctaText:g({defaultMessage:"Manage Alerts",id:"t6akfMv9BC"}),ctaOnClick:()=>{s.push("/account/tasks?tab=alerts")}})},onCreateError:()=>{o({message:g({defaultMessage:"Failed to create price alert",id:"vkLT4iLR3O"}),variant:"error",timeout:3,description:g({defaultMessage:"Please try again",id:"fHqssj/1KO"})}),b(!1)},onUpdateSuccess:()=>{t(),b(!1),D(),o({message:g({defaultMessage:"Price alert updated",id:"wTPvmuiyuE"}),variant:"success",timeout:3,ctaText:g({defaultMessage:"Manage Alerts",id:"t6akfMv9BC"}),ctaOnClick:()=>{s.push("/account/tasks?tab=alerts")}})},onUpdateError:()=>{o({message:g({defaultMessage:"Failed to update price alert",id:"Fpz5cXYABV"}),variant:"error",timeout:3,description:g({defaultMessage:"Please try again",id:"fHqssj/1KO"})}),b(!1)},onDeleteSuccess:()=>{t()}}),j=d.useCallback(()=>{t(),D()},[t,D]),L=d.useCallback(()=>{r&&R.mutate(r.id)},[r,R]),U=CE({selectedSymbol:y,symbol:n,quote:_,alertType:"price",priceValue:w,$t:g}),O=CE({selectedSymbol:y,symbol:n,quote:_,alertType:"movement",percentValue:C,$t:g}),$=U.baseInstructions,G=U.displayInstructions,H=O.baseInstructions,Q=O.displayInstructions;d.useEffect(()=>{if(e){const le=Mst(r,n);c(le),f(le.selectedOption),S(le.priceValue),E(le.percentValue),k(le.positiveSelected),M(le.negativeSelected),h(le.additionalInstructions),x(le.selectedSymbol)}else c(null),D()},[e,r,n,D]);const{locale:Y}=J();d.useEffect(()=>{if(a&&_?.currency&&w&&w.startsWith("$")){const le=Qv(_.currency,Y);le!=="$"&&S(w.replace("$",le))}},[a,_?.currency,Y,w]);const te=d.useCallback(()=>{b(!0);const le=y??n;if(!le){b(!1);return}const ce=SE({symbol:le,alertType:u,priceValue:w,priceThreshold:A,percentValue:C,positiveSelected:N,negativeSelected:I,baseInstructions:u==="price"?$:H,additionalInstructions:p});if(!ce){b(!1);return}a&&r?F.mutate({taskId:r.id,payload:ce}):P.mutate(ce)},[a,r,y,n,u,w,A,C,N,I,p,$,H,P,F]),se=d.useMemo(()=>{if(!a||!i)return!0;const le={selectedOption:u,priceValue:w,percentValue:C,positiveSelected:N,negativeSelected:I,additionalInstructions:p,selectedSymbol:y},{inputValue:re,...ce}=i;return!Er(le,ce)},[a,i,u,w,C,N,I,p,y]),ae=d.useMemo(()=>{const le=w.replace(/[^0-9.]/g,""),re=C.replace("%","");return u==="price"?!y||!le||!A:!y||!re},[y,u,w,C,A]),X=d.useMemo(()=>ae||!se,[ae,se]),ee=d.useMemo(()=>[{text:g({id:"47FYwba+bI",defaultMessage:"Cancel"}),onClick:j,variant:"secondary"},{text:g(a?{id:"KjhtiKJItq",defaultMessage:"Edit Alert"}:{id:"KHrQobwBBl",defaultMessage:"Add Alert"}),onClick:te,variant:"primary",disabled:a?X:ae,isLoading:v}],[te,g,ae,v,j,a,X]);return l.jsxs(po,{isOpen:e,onClose:t,title:g({id:"hrmMcFoV7/",defaultMessage:"Price Alert"}),variant:m?"bottom-sheet":"default",children:[l.jsx("div",{className:"gap-md flex min-h-[60vh] flex-col md:min-h-0",children:l.jsx(q6,{variant:"full",selectedSymbol:y,selectedOption:u,onSymbolChange:x,onOptionChange:f,showSymbolInput:!a,currentPrice:_?.price,priceValue:w,onPriceValueChange:S,percentValue:C,onPercentValueChange:E,positiveSelected:N,onPositiveChange:k,negativeSelected:I,onNegativeChange:M,additionalInstructions:p,onAdditionalInstructionsChange:h,displayPriceInstructions:G,displayMovementInstructions:Q,externalInputValue:i?.inputValue,currency:_?.currency??void 0})}),l.jsxs("div",{className:"mt-md flex w-full items-center justify-between",children:[l.jsx("div",{children:a&&l.jsx(Ct,{variant:"secondary",onClick:L,isLoading:R.isPending,children:g({id:"K3r6DQW7h+",defaultMessage:"Delete"})})}),l.jsx("div",{className:"gap-sm md:-mb-md flex items-center",children:ee.map(le=>l.jsx(Ct,{onClick:le.onClick,variant:le.variant,disabled:le.disabled,isLoading:le.isLoading,children:le.text},le.text))})]})]})});bb.displayName="FinanceAlertModal";const Tst=Object.freeze(Object.defineProperty({__proto__:null,FinanceAddAlertIfSupported:PN,FinanceAlertModal:bb},Symbol.toStringTag,{value:"Module"})),Ast=(e,t)=>{const{value:n,loading:r}=qt({flag:"tasks-free-user-access-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},ON=T.memo(({symbol:e,buttonProps:t,watchlistAddedForSymbol:n})=>{const{hasAccessToProFeatures:r}=Bt(),{variation:s,loading:o}=Ast(!1);return o||!s&&!r?null:l.jsx(PN,{symbol:e,buttonProps:t,watchlistAddedForSymbol:n,modalOpenedSource:"finance_asset_page"})});ON.displayName="PriceAlertButton";const oL="pplx://www.pplx.com";function _b({href:e,inApp:t,queryParams:n}){if(!t||e==null)return e;const r=new URL(e,oL);return n?.forEach((s,o)=>{r.searchParams.get(o)||r.searchParams.set(o,s??"")}),r.pathname.startsWith("/app")||(r.pathname.startsWith("/")?r.pathname=`/app${r.pathname}`:r.pathname=`/app/${r.pathname}`),r.href.replace(oL,"")}const yae=()=>{const{scrollContainerRef:e}=ka();return d.useCallback(()=>{window.scrollTo({top:0,behavior:"instant"}),e?.current?.scrollTo({top:0,behavior:"instant"})},[e])},Zg=T.memo(({children:e,href:t,...n})=>{const{inApp:r}=Ea(),s=mn(),o=yae(),a=d.useCallback(i=>{o(),n.onClick?.(i)},[o,n]);return l.jsx(xt,{...n,href:_b({href:t,inApp:r,queryParams:s}),onClick:a,children:e})}),Nst=T.memo(e=>{const{inApp:t}=Ea(),n=mn(),{href:r,...s}=e;return l.jsx(Xh,{...s,href:_b({href:r,inApp:t,queryParams:n})??""})});Nst.displayName="CanonicalLinkAether";Zg.displayName="CanonicalLink";const Rst=T.memo(e=>{const t=e.href??void 0;return t?l.jsx(Zg,{...e,href:t}):e.children});Rst.displayName="CanonicalLinkMaybe";const Dst=({value:e,format:t,suffix:n,animated:r})=>{const[s,o]=d.useState(!1);return d.useEffect(()=>{r&&Number.isFinite(e)&&o(!0)},[r,e]),l.jsx(jp,{isolate:!0,value:e,format:t,suffix:n,animated:s})},jst=!1,wb=T.memo(({value:e,format:t,suffix:n,animated:r=jst})=>{const{inApp:s}=Ea(),{locale:o}=J();return!r||s?l.jsxs("span",{children:[Intl.NumberFormat(o,t).format(e)," ",n]}):l.jsx(Dst,{value:e,format:t,suffix:n,animated:r})});wb.displayName="FinanceNumberFlow";const Cb={ENTITY_CHIP:"entity_chip",SEARCH_WIDGET:"search_widget",CHART_COMPARISON:"chart_comparison",SEARCH_AUTOSUGGEST:"search_autosuggest"},Ist={PREDICTIONS_WIDGET:"predictions_widget"},Pst={ASSET_PAGE:"asset"},Jg={ASSET_PAGE:"asset"},B2=T.memo(({countryCode:e,square:t,...n})=>{const r=e??"NEU",s=t?`square/${r}`:r;return l.jsx("img",{src:`https://r2cdn.perplexity.ai/images/country_flags/${s}.svg`,alt:e??"NEU",...n})});B2.displayName="CountryFlag";const Ost={COMMODITY:"",FOREX:"FX",INDEX:"INDEX",CRYPTO:"CRYPTO"},hf=T.memo(({price:e,currency:t,sign:n,variant:r="small",className:s,animated:o})=>{const a=d.useMemo(()=>({style:t?"currency":"decimal",currency:t||void 0,minimumFractionDigits:e<1e3?2:0,maximumFractionDigits:Math.abs(e)<.01?void 0:2,signDisplay:n?"exceptZero":void 0}),[t,e,n]);return l.jsx(V,{variant:r,color:"light",className:s,children:l.jsx(wb,{value:e,format:a,animated:o})})});hf.displayName="Price";const LN=({name:e,variant:t="smallBold",className:n})=>e?l.jsx(V,{variant:t,className:z("min-w-0 truncate leading-tight",n),as:"span",children:e}):null,e0=({symbol:e,exchange:t,country:n,gap:r="xs"})=>{const s=d.useMemo(()=>e&&decodeURIComponent(e).split(".")[0],[e]),o=d.useMemo(()=>t&&(Ost[t]??t),[t]);if(!s)return null;if(!o)return s;const a=n||null;return l.jsxs(ya,{className:z("whitespace-nowrap",{"gap-xs":r==="xs","gap-sm":r==="sm"}),children:[l.jsx(Vn,{id:"symbol",children:s}),l.jsx(Vn,{id:"exchange",children:o}),a&&l.jsx(Vn,{id:"country",children:l.jsxs("div",{className:"relative flex w-[1.2em] shrink-0 items-center",children:[l.jsx(B2,{countryCode:a}),l.jsx("div",{className:"absolute inset-0 border border-black/10 dark:border-0"})]})})]})},xae=({symbol:e,children:t,className:n,referrer:r})=>{const{inApp:s}=Ea(),o=mn(),a=_b({href:`/finance/${e}`,inApp:s,queryParams:o}),{session:i}=je(),{trackEvent:c}=Ke(i),u=yae(),f=d.useCallback(()=>{u(),r&&c("finance link clicked",{referrer:r,targetPageType:Jg.ASSET_PAGE,symbol:e,destinationUrl:`/finance/${e}`})},[r,e,c,u]);return l.jsx(xt,{href:a,className:z("py-sm px-md hover:bg-subtler block duration-quick",n),onClick:f,children:t})},Lst=T.memo(({symbol:e,name:t,image:n,imageDark:r,exchange:s,country:o,children:a,colorScheme:i})=>{const{isMobileStyle:c}=Re(),{inApp:u}=Ea();return jf("header"),l.jsxs(K,{className:"gap-md flex min-w-0 flex-col",children:[l.jsxs(K,{className:"gap-sm flex items-start justify-between",children:[l.jsxs("div",{className:"flex min-w-0 items-start justify-start gap-sm",children:[l.jsx(Xg,{src:n??"",srcDark:r??"",symbol:e??"",className:"!size-[40px] shrink-0",colorScheme:i}),l.jsx(Hs,{content:t??"",disabled:!c,children:l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx(V,{variant:c?"section-title":"page-title",className:"min-w-0 leading-tight break-words",children:t}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e,exchange:s,gap:"xs",country:o})})]})})]}),u&&e&&l.jsx(ON,{symbol:e,buttonProps:{pill:!0}})]}),a]})});Lst.displayName="FinanceAssetHeader";const Th=T.memo(({isScreenshotEnv:e})=>{const{$t:t}=J();return l.jsxs("div",{className:z("pointer-events-none flex items-center px-sm py-xs rounded-full shadow-[0_0_16px_8px_oklch(var(--background-base-color)/0.6)] dark:shadow-[0_0_16px_8px_oklch(var(--offset-color)/0.6)]",e?"bg-base":"bg-background/90 backdrop-blur-sm"),children:[l.jsx(V,{variant:"tiny",inline:!0,className:"mr-xs mt-px",children:t({defaultMessage:"Powered by",id:"U8QBHORZRD"})}),l.jsx($d,{variant:"full",size:"small"})]})});Th.displayName="FinanceAssetWatermark";const ra=(e,t)=>{if(e==null||e===void 0)return null;const n=2;let r=Math.min(n,t.maxDecimals??n);const s=Math.min(n,t.maxDecimals??n);return e>1e5&&(r=1),e.toLocaleString(t.locale,{style:t.currency?"currency":"decimal",notation:"compact",currency:t.currency,minimumFractionDigits:r,maximumFractionDigits:s})};function aL(e,t,n,r){return e==null||t==null?null:r({defaultMessage:"{low}-{high}",id:"sOdwcvTtKN"},{low:ra(e,n),high:ra(t,n)})}const iL=(e,t,n)=>e==null||e===void 0?null:e.toLocaleString(t.locale,{style:"decimal",notation:"compact",...n});function Fst(e,t=6){if(e===0)return{minimumFractionDigits:0,maximumFractionDigits:1};let n=0,r=2;if(e!==0&&Math.abs(e)<1){let s=0,o=Math.abs(e);for(;o<1&&s{if(e==null||e===void 0)return null;let{minimumFractionDigits:r,maximumFractionDigits:s}=Fst(e,6);return r=r,s=s,r>s&&(s=r),e*100>.001&&(r=2,s=2),e===0?"—":e.toLocaleString(t.locale,{style:"percent",...n,minimumFractionDigits:r,maximumFractionDigits:s})},Bst={previousClose:e=>ra(e.d.previousClose,e),open:e=>ra(e.d.open,e),dayRange:e=>aL(e.d.dayLow,e.d.dayHigh,e,e.$t),yearRange:e=>aL(e.d.yearLow,e.d.yearHigh,e,e.$t),eps:e=>ra(e.d.eps,e),dayHigh:e=>ra(e.d.dayHigh,e),dayLow:e=>ra(e.d.dayLow,e),marketCap:e=>ra(e.d.marketCap,e),pe:e=>{const t=e.d.pe;return t&&t<0?"—":iL(t,e,{minimumFractionDigits:2})},dividendYieldTTM:e=>bC(e.d.dividendYieldTTM,e),volume:e=>iL(e.d.volume,e,{maximumFractionDigits:2}),dollarVolume24h:e=>ra(e.d.dollarVolume24h,e),volumeChange24h:e=>bC(e.d.volumeChange24h,e),yearHigh:e=>ra(e.d.yearHigh,e),yearLow:e=>ra(e.d.yearLow,e),fundingRate:e=>bC(e.d.fundingRate?+e.d.fundingRate*100:null,e)};function Ust({quote:e,currency:t,locale:n,$t:r}){return(e.uiHints?.tableFields??[]).map(a=>{const i=Bst[a];if(!i)return null;const c=i({d:e,locale:n,currency:t,$t:r});return c==null?null:{value:c,label:a,id:a}}).filter(a=>a!==null)}const FN=(e="sm")=>{const[t,n]=d.useState(e);d.useEffect(()=>{const c=()=>{window.innerWidth>=1536?n("2xl"):window.innerWidth>=1280?n("xl"):window.innerWidth>=1024?n("lg"):window.innerWidth>=768?n("md"):window.innerWidth>=640&&n("sm")};return window.addEventListener("resize",c),c(),()=>window.removeEventListener("resize",c)},[]);const r=!0,s=["md","lg","xl","2xl"].includes(t),o=["lg","xl","2xl"].includes(t),a=["xl","2xl"].includes(t),i=["2xl"].includes(t);return d.useMemo(()=>({breakpoint:t,isSmallScreen:r,isMediumScreen:s,isLargeScreen:o,isXLargeScreen:a,is2XLargeScreen:i}),[t,i,o,s,r,a])},Vst=({dt:e,dd:t,id:n})=>{const{isMobileStyle:r}=Re(),{breakpoint:s}=FN(),o=["md","sm"].includes(s)&&r;return l.jsxs("div",{className:"gap-x-sm py-xs px-sm md:p-sm bg-raised flex flex-col gap-y-0.5 whitespace-nowrap md:flex-row md:justify-between",children:[l.jsx("dt",{children:l.jsx(V,{variant:o?"micro":"small",color:"light",children:e})}),l.jsx("dd",{children:l.jsx(V,{variant:o?"tiny":"smallBold",children:t})})]},n)},lL=({children:e})=>l.jsx(K,{variant:"background",children:e}),vae=T.memo(({entries:e,context:t})=>{const n=(3-e.length%3)%3,r=t==="thread",s=t==="canonical"||t==="thread";return l.jsx("div",{className:"scrollbar-subtle overflow-x-auto",children:l.jsxs(K,{className:z("grid grid-cols-3 gap-px",r?"w-full":"min-w-max",s&&"border-x-0"),variant:"subtler",children:[e.map(({label:o,value:a})=>l.jsx(lL,{children:l.jsx(Vst,{dt:o,dd:a,id:o})},o)),Array.from({length:n}).map((o,a)=>l.jsx(lL,{},a))]})})});vae.displayName="FinanceGenericTable";const Hst=Ue({finance:{defaultMessage:"Finance",id:"Fm3M+yFIbr"},analysis:{defaultMessage:"Analysis",id:"VMIM8/fAKn"},companyOverview:{defaultMessage:"Overview",id:"9uOFF3L8kp"},balanceSheet:{defaultMessage:"Balance Sheet",id:"ak91fL/u+x"},incomeStatement:{defaultMessage:"Income Statement",id:"HFT+V86brH"},keyStats:{defaultMessage:"Key Stats",id:"0FPlBr741P"},cashFlow:{defaultMessage:"Cash Flow",id:"mtw9A2k000"},date:{defaultMessage:"Date",id:"P7PLVjLe4f"},marketSummary:{defaultMessage:"Market Summary",id:"/4s4TMc/a+"},price:{defaultMessage:"Price",id:"b1zuN9KTHI"},symbol:{defaultMessage:"Symbol",id:"3HepmQoEZ+"},value:{defaultMessage:"Value",id:"GufXy52FNI"},percentage:{defaultMessage:"Percentage",id:"HyMpO2UIBG"},currency:{defaultMessage:"Currency",id:"55hdQy4uHO"},open:{defaultMessage:"Open",id:"JfG49wNHKP"},dayHigh:{defaultMessage:"High",id:"AxMhQrcUDC"},dayLow:{defaultMessage:"Low",id:"477I0ggSYe"},marketCap:{defaultMessage:"Market Cap",id:"9Mp3OYduig"},pe:{defaultMessage:"P/E Ratio",id:"fWnwRImZ9W"},volume24h:{defaultMessage:"24H Volume",id:"w7Tm/B63El"},dollarVolume24h:{defaultMessage:"24H Volume",id:"w7Tm/B63El"},volumeChange24h:{defaultMessage:"24H Volume Change",id:"CndnNLlEs+"},fundingRate:{defaultMessage:"Funding Rate",id:"CB1174SKrI"},volume:{defaultMessage:"Volume",id:"y867VsgbzT"},yearHigh:{defaultMessage:"Year High",id:"yh2gWeU/Gz"},yearLow:{defaultMessage:"Year Low",id:"fZpEs5CIaC"},avgVolume:{defaultMessage:"Avg. Volume",id:"MDNqWO8yDU"},dayRange:{defaultMessage:"Day Range",id:"6VJrMyvXcR"},yearRange:{defaultMessage:"52W Range",id:"FkJo44zhH6"},eps:{defaultMessage:"EPS",id:"JncK2a8+G4"},dividendYieldTTM:{defaultMessage:"Dividend Yield",id:"P3CiJnt5+6"},dividendYielTTM:{defaultMessage:"Dividend Yield",id:"P3CiJnt5+6"},previousClose:{defaultMessage:"Prev Close",id:"0jUP9zUh5z"},priceComparison:{defaultMessage:"Price Comparison",id:"MFuchsfwj7"},stockPerformance:{defaultMessage:"Stock Performance",id:"qEQxp1ikMt"},companyFinancials:{defaultMessage:"{company} Financials",id:"gWNvqjwoWh"},"13FFilings":{defaultMessage:"13F Filings",id:"XzGhyAgjmS"},pricePerformance:{defaultMessage:"Price & Performance",id:"nCv3Ti2cp5"},peers:{defaultMessage:"Peers",id:"JjgJTAa2wL"},transcriptLogin:{defaultMessage:"Login to view transcripts from {quartr}",id:"xY8csKCosL"},newsAndMarketInsights:{defaultMessage:"Latest News",id:"BlFeZAX10O"},recentTranscripts:{defaultMessage:"Recent Transcripts",id:"tiSu9ozyS4"},earnings:{defaultMessage:"Earnings",id:"14sEVuq+Kb"},related:{defaultMessage:"Related",id:"KQsZBWlEw/"},topMovers:{defaultMessage:"Top Movers",id:"e+JmwAUicC"}}),zst=(e,t)=>{if(!t)return"";const n=Hst[t];return n?e(n):""},bae=T.memo(({quote:e,context:t})=>{const{$t:n,locale:r}=J(),s=d.useMemo(()=>e?Ust({quote:e,currency:e?.currency||void 0,locale:r,$t:n}).map(a=>({...a,label:zst(n,a.label),value:a.value})):[],[e,n,r]);return jf("financial-profile",{skip:!s.length}),l.jsx(K,{"data-testid":"financial-profile-box",variant:"subtle",noBorder:!0,className:z("overflow-hidden border-t border-subtlest",{"border-x-0":t==="canonical"||t==="thread","rounded-none":t==="thread","border-b rounded-b-xl":t!=="thread"}),children:l.jsx(vae,{entries:s,context:t})})});bae.displayName="FinanceFinancialProfile";const Ah=30,Wst=({isMobileStyle:e,threshold:t=700})=>{const n=d.useRef(null),[r,s]=d.useState("lg");return d.useEffect(()=>{const a=n.current;if(!a)return;const i=()=>{const u=a.clientWidth;s(u{i()});return c.observe(a),()=>{c.disconnect()}},[t]),{variant:e?"sm":r,containerRef:n}};var Dk=Math.PI,jk=2*Dk,wc=1e-6,Gst=jk-wc;function Ik(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ho(){return new Ik}Ik.prototype=ho.prototype={constructor:Ik,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,s,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+s)+","+(this._y1=+o)},arcTo:function(e,t,n,r,s){e=+e,t=+t,n=+n,r=+r,s=+s;var o=this._x1,a=this._y1,i=n-e,c=r-t,u=o-e,f=a-t,m=u*u+f*f;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(m>wc)if(!(Math.abs(f*i-c*u)>wc)||!s)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var p=n-o,h=r-a,g=i*i+c*c,y=p*p+h*h,x=Math.sqrt(g),v=Math.sqrt(m),b=s*Math.tan((Dk-Math.acos((g+m-y)/(2*x*v)))/2),_=b/v,w=b/x;Math.abs(_-1)>wc&&(this._+="L"+(e+_*u)+","+(t+_*f)),this._+="A"+s+","+s+",0,0,"+ +(f*p>u*h)+","+(this._x1=e+w*i)+","+(this._y1=t+w*c)}},arc:function(e,t,n,r,s,o){e=+e,t=+t,n=+n,o=!!o;var a=n*Math.cos(r),i=n*Math.sin(r),c=e+a,u=t+i,f=1^o,m=o?r-s:s-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+u:(Math.abs(this._x1-c)>wc||Math.abs(this._y1-u)>wc)&&(this._+="L"+c+","+u),n&&(m<0&&(m=m%jk+jk),m>Gst?this._+="A"+n+","+n+",0,1,"+f+","+(e-a)+","+(t-i)+"A"+n+","+n+",0,1,"+f+","+(this._x1=c)+","+(this._y1=u):m>wc&&(this._+="A"+n+","+n+",0,"+ +(m>=Dk)+","+f+","+(this._x1=e+n*Math.cos(s))+","+(this._y1=t+n*Math.sin(s))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function rn(e){return function(){return e}}var cL=Math.abs,Jr=Math.atan2,xc=Math.cos,$st=Math.max,_C=Math.min,Da=Math.sin,yd=Math.sqrt,As=1e-12,Nh=Math.PI,U2=Nh/2,Ny=2*Nh;function qst(e){return e>1?0:e<-1?Nh:Math.acos(e)}function uL(e){return e>=1?U2:e<=-1?-U2:Math.asin(e)}function Kst(e){return e.innerRadius}function Yst(e){return e.outerRadius}function Qst(e){return e.startAngle}function Xst(e){return e.endAngle}function Zst(e){return e&&e.padAngle}function Jst(e,t,n,r,s,o,a,i){var c=n-e,u=r-t,f=a-s,m=i-o,p=m*c-f*u;if(!(p*pP*P+F*F&&(N=I,k=M),{cx:N,cy:k,x01:-f,y01:-m,x11:N*(s/S-1),y11:k*(s/S-1)}}function eot(){var e=Kst,t=Yst,n=rn(0),r=null,s=Qst,o=Xst,a=Zst,i=null;function c(){var u,f,m=+e.apply(this,arguments),p=+t.apply(this,arguments),h=s.apply(this,arguments)-U2,g=o.apply(this,arguments)-U2,y=cL(g-h),x=g>h;if(i||(i=u=ho()),pAs))i.moveTo(0,0);else if(y>Ny-As)i.moveTo(p*xc(h),p*Da(h)),i.arc(0,0,p,h,g,!x),m>As&&(i.moveTo(m*xc(g),m*Da(g)),i.arc(0,0,m,g,h,x));else{var v=h,b=g,_=h,w=g,S=y,C=y,E=a.apply(this,arguments)/2,N=E>As&&(r?+r.apply(this,arguments):yd(m*m+p*p)),k=_C(cL(p-m)/2,+n.apply(this,arguments)),I=k,M=k,A,D;if(N>As){var P=uL(N/m*Da(E)),F=uL(N/p*Da(E));(S-=P*2)>As?(P*=x?1:-1,_+=P,w-=P):(S=0,_=w=(h+g)/2),(C-=F*2)>As?(F*=x?1:-1,v+=F,b-=F):(C=0,v=b=(h+g)/2)}var R=p*xc(v),j=p*Da(v),L=m*xc(w),U=m*Da(w);if(k>As){var O=p*xc(b),$=p*Da(b),G=m*xc(_),H=m*Da(_),Q;if(yAs?M>As?(A=_1(G,H,R,j,p,M,x),D=_1(O,$,L,U,p,M,x),i.moveTo(A.cx+A.x01,A.cy+A.y01),MAs)||!(S>As)?i.lineTo(L,U):I>As?(A=_1(L,U,O,$,m,-I,x),D=_1(R,j,G,H,m,-I,x),i.lineTo(A.cx+A.x01,A.cy+A.y01),I=p;--h)i.point(b[h],_[h]);i.lineEnd(),i.areaEnd()}x&&(b[m]=+e(y,m,f),_[m]=+n(y,m,f),i.point(t?+t(y,m,f):b[m],r?+r(y,m,f):_[m]))}if(v)return i=null,v+""||null}function u(){return VN().defined(s).curve(a).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:rn(+f),t=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rn(+f),c):e},c.x1=function(f){return arguments.length?(t=f==null?null:typeof f=="function"?f:rn(+f),c):t},c.y=function(f){return arguments.length?(n=typeof f=="function"?f:rn(+f),r=null,c):n},c.y0=function(f){return arguments.length?(n=typeof f=="function"?f:rn(+f),c):n},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:rn(+f),c):r},c.lineX0=c.lineY0=function(){return u().x(e).y(n)},c.lineY1=function(){return u().x(e).y(r)},c.lineX1=function(){return u().x(t).y(n)},c.defined=function(f){return arguments.length?(s=typeof f=="function"?f:rn(!!f),c):s},c.curve=function(f){return arguments.length?(a=f,o!=null&&(i=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=i=null:i=a(o=f),c):o},c}function not(e,t){return te?1:t>=e?0:NaN}function rot(e){return e}function sot(){var e=rot,t=not,n=null,r=rn(0),s=rn(Ny),o=rn(0);function a(i){var c,u=i.length,f,m,p=0,h=new Array(u),g=new Array(u),y=+r.apply(this,arguments),x=Math.min(Ny,Math.max(-Ny,s.apply(this,arguments)-y)),v,b=Math.min(Math.abs(x)/u,o.apply(this,arguments)),_=b*(x<0?-1:1),w;for(c=0;c0&&(p+=w);for(t!=null?h.sort(function(S,C){return t(g[S],g[C])}):n!=null&&h.sort(function(S,C){return n(i[S],i[C])}),c=0,m=p?(x-u*_)/p:0;c0?w*m:0)+_,g[f]={data:i[f],index:c,value:w,startAngle:y,endAngle:v,padAngle:b};return g}return a.value=function(i){return arguments.length?(e=typeof i=="function"?i:rn(+i),a):e},a.sortValues=function(i){return arguments.length?(t=i,n=null,a):t},a.sort=function(i){return arguments.length?(n=i,t=null,a):n},a.startAngle=function(i){return arguments.length?(r=typeof i=="function"?i:rn(+i),a):r},a.endAngle=function(i){return arguments.length?(s=typeof i=="function"?i:rn(+i),a):s},a.padAngle=function(i){return arguments.length?(o=typeof i=="function"?i:rn(+i),a):o},a}var oot=Cae(ru);function wae(e){this._curve=e}wae.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function Cae(e){function t(n){return new wae(e(n))}return t._curve=e,t}function aot(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(Cae(n)):t()._curve},e}function iot(){return aot(VN().curve(oot))}function w1(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var Pk=Array.prototype.slice;function lot(e){return e.source}function cot(e){return e.target}function HN(e){var t=lot,n=cot,r=BN,s=UN,o=null;function a(){var i,c=Pk.call(arguments),u=t.apply(this,c),f=n.apply(this,c);if(o||(o=i=ho()),e(o,+r.apply(this,(c[0]=u,c)),+s.apply(this,c),+r.apply(this,(c[0]=f,c)),+s.apply(this,c)),i)return o=null,i+""||null}return a.source=function(i){return arguments.length?(t=i,a):t},a.target=function(i){return arguments.length?(n=i,a):n},a.x=function(i){return arguments.length?(r=typeof i=="function"?i:rn(+i),a):r},a.y=function(i){return arguments.length?(s=typeof i=="function"?i:rn(+i),a):s},a.context=function(i){return arguments.length?(o=i??null,a):o},a}function uot(e,t,n,r,s){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,s,r,s)}function dot(e,t,n,r,s){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+s)/2,r,n,r,s)}function fot(e,t,n,r,s){var o=w1(t,n),a=w1(t,n=(n+s)/2),i=w1(r,n),c=w1(r,s);e.moveTo(o[0],o[1]),e.bezierCurveTo(a[0],a[1],i[0],i[1],c[0],c[1])}function mot(){return HN(uot)}function pot(){return HN(dot)}function hot(){var e=HN(fot);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}function dL(e){return e<0?-1:1}function fL(e,t,n){var r=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(r||s<0&&-0),a=(n-e._y1)/(s||r<0&&-0),i=(o*s+a*r)/(r+s);return(dL(o)+dL(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(i))||0}function mL(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wC(e,t,n){var r=e._x0,s=e._y0,o=e._x1,a=e._y1,i=(o-r)/3;e._context.bezierCurveTo(r+i,s+i*t,o-i,a-i*n,o,a)}function V2(e){this._context=e}V2.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:wC(this,this._t0,mL(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,wC(this,mL(this,n=fL(this,e,t)),n);break;default:wC(this,this._t0,n=fL(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(V2.prototype).point=function(e,t){V2.prototype.point.call(this,t,e)};function got(e){return new V2(e)}function gf(e,t){if((a=e.length)>1)for(var n=1,r,s,o=e[t[0]],a,i=o.length;n=0;)n[t]=t;return n}function yot(e,t){return e[t]}function zN(){var e=rn([]),t=yf,n=gf,r=yot;function s(o){var a=e.apply(this,arguments),i,c=o.length,u=a.length,f=new Array(u),m;for(i=0;i0){for(var n,r,s=0,o=e[0].length,a;s0)for(var n,r=0,s,o,a,i,c,u=e[t[0]].length;r0?(s[0]=a,s[1]=a+=o):o<0?(s[1]=i,s[0]=i+=o):(s[0]=0,s[1]=o)}function bot(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,o=r.length;n0)||!((o=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,o,a;ro&&(o=s,n=t);return n}function Sae(e){var t=e.map(Eae);return yf(e).sort(function(n,r){return t[n]-t[r]})}function Eae(e){for(var t=0,n=-1,r=e.length,s;++n"pageX"in e?{x:e.pageX,y:e.pageY}:{x:e.touches[0]?.pageX??0,y:e.touches[0]?.pageY??0},Sb=got,cm="geometricPrecision",GN="pointer-events-none overflow-visible font-sans",kae=25,oi=200,$N="relative isolate select-none touch-none touch-pan-down",su="bg-transparent rounded-lg border backdrop-blur-sm bg-subtlest dark:bg-subtlest",Il={duration:oi/1e3,delay:oi/1e3,ease:$a},Mot={opacity:0,transition:{duration:0,delay:0}},Tot={duration:oi/1e3,ease:$a},Aot={opacity:0,transition:{duration:oi/1e3,delay:0}},H2={height:kae},Mae=4,Tae=3,tr={blue:"oklch(var(--positive-color))",red:"oklch(var(--negative-color))",gray:"oklch(var(--foreground-quieter-color))",black:"oklch(var(--foreground-color))",transparent:"#00000000"},qN=16,Aae=-5,Not={fill:tr.gray,fontSize:12,dy:`${Aae}px`,textAnchor:"start",fontFamily:"var(--font-family-sans)"},Ok=e=>z("transition-opacity duration-500",{"opacity-0":e}),Rot=({tick:e,history:t,yScale:n,xScale:r,xOffset:s,yOffset:o,yHeight:a,yWidth:i,yGet:c,baseline:u})=>{if(!t||t.length===0)return!1;const m=n(e)+o,p=m-a;if(Number.isFinite(u)){const g=n(u);if(g>=p&&g<=m)return!0}const h=s+i;for(let g=0;gh)break;const v=n(c(y));if(v>=p&&v<=m)return!0}return!1},Nae=({tick:e,history:t,yScale:n,xScale:r,yGet:s,baseline:o})=>({...Not,opacity:Rot({tick:e,history:t,yScale:n,xScale:r,xOffset:qN+5,yOffset:Aae,yHeight:16,yWidth:25,yGet:s,baseline:o})?.4:1}),KN={fill:tr.gray,fontSize:12,textAnchor:"start",dx:"6px",fontFamily:"var(--font-family-sans)"},Cl={POSITIVE:"positive",NEGATIVE:"negative",NEUTRAL:"neutral",TRANSPARENT:"transparent"},Lk={[Cl.POSITIVE]:"blue",[Cl.NEGATIVE]:"red",[Cl.NEUTRAL]:"gray",[Cl.TRANSPARENT]:"transparent"},z2=e=>e.date,Rae=e=>new Date(e),Cn=e=>Rae(e.date),Dot=(e,t)=>{const n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:e})).getTime()-n.getTime())/(1e3*60)},jot=(e,t)=>new Date(e.getTime()+t*60*1e3).toISOString().slice(11,16),pL=(e,t)=>t?e.replace(/T\d{2}:\d{2}/,`T${t}`):e,Iot={lunch_break:{valence:Cl.TRANSPARENT,backgroundColor:Lk[Cl.TRANSPARENT],backgroundOpacity:0,lineOpacity:0},pre_market:{backgroundOpacity:.5},after_hours:{backgroundOpacity:.5}},hL={lunch_break:W({defaultMessage:"Lunch Break",id:"tHK2Aeii37"}),pre_market:W({defaultMessage:"Pre-market",id:"8sf72hHG3K"}),after_hours:W({defaultMessage:"After-hours",id:"npRfgsisE7"})},YN=(e,t,n)=>{const r=jot(t,n);if(r)return e.find(({open:s,close:o})=>s<=o?r>=s&&r=s||r{if(t===0||!e?.length)return e;const n=[...e];let r=0;for(let s=0;s=t){const i=e[s-t].close;r-=i}const a=se?.includes?.("00:00:00"),QN=(e,t,n)=>{if(!e)return null;const r=new Date(e),s=!Oot(e);return r.toLocaleString(t,{month:"short",day:"numeric",timeZone:n,minute:s?"2-digit":void 0,hour:s?"numeric":void 0,year:s?void 0:"numeric",timeZoneName:s?"short":void 0})},jc=(e,t,n,r=2)=>new Intl.NumberFormat(n,{style:t?"currency":"decimal",currency:t??void 0,minimumFractionDigits:r,maximumFractionDigits:2}).format(e),Lot=Hg(e=>Cn(e)).left,Fot=(e,t)=>{if("invert"in e)return e.invert(t);const n=e.step(),r=e.domain(),s=e.range()[0],o=Math.round((t-s)/n);return r[Math.max(0,Math.min(r.length-1,o))]};function XN(e,t,n){const r=Math.max(0,e),s=Lot(n,Fot(t,r),0);return{d:n[s]??n[n.length-1],index:s,x:r}}const Dae=({ticks:e,xScale:t,width:n,formatter:r,marginLeft:s=0,marginRight:o=0})=>{const c=s,u=n-o,f=[];let m=-1/0,p=0;for(const h of e){const g=t(h)??0,x=r(h).length*7,v=g-x/2,b=g+x/2;if(vu)continue;if(f.length===0){f.push(h),m=g,p=x;continue}const _=p/2+10+x/2;g-m>=_&&(f.push(h),m=g,p=x)}return f},Bot=["1d","5d","1m","6m","ytd","1y","5y","max"],jae={"1d":"1D","5d":"5D","1m":"1M","6m":"6M",ytd:"YTD","1y":"1Y","3m":"3M","5y":"5Y",max:"MAX"},Iae=e=>{if(!e.length)return 0;const t=new Date(e[0].date);return(new Date(e[e.length-1].date).getTime()-t.getTime())/(1e3*60*60*24)},ZN=e=>Iae(e)<=1,Uot=e=>{if(e.length<2)return!1;const t=new Set;for(const n of e){const r=n.date.split("T")[0];if(t.has(r))return!0;t.add(r)}return!1},Vot=(e,t)=>Math.ceil((new Date(e).getTime()-new Date(t).getTime())/(1e3*60*60*24)),JN=e=>e?.includes("~")??!1,Hot=e=>{const[t,n]=e.split("~");return t&&n?{type:"range",range:{start:t,end:n}}:{type:"period",period:t}},zot=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"finance-screenshot-builder",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Wot=Se(async()=>{const{FinanceScreenshotBuilderModal:e}=await Ee(()=>q(()=>import("./FinanceScreenshotBuilderModal-D6XaL_R6.js"),__vite__mapDeps([466,1,4,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),Got=({quote:e,animationId:t,period:n})=>{const{openToast:r}=pn(),{openModal:s}=Ho(),{$t:o}=J(),{isMobileStyle:a}=Re(),{variation:i}=zot(!1),c=!!e&&!!t&&!!n,u=d.useCallback(()=>{try{if(!e||!t||!n){r({message:o({defaultMessage:"Chart data not available",id:"sIM31EEMjr"}),description:o({defaultMessage:"Please try again",id:"fHqssj/1KO"}),variant:"error",timeout:3});return}const f=Hot(n),m=f.type==="period"?f.period:null;s(Wot,{quote:e,period:m,symbol:t,legacyIdentifier:"__NONE__"})}catch(f){Z.error("Failed to open screenshot modal",{error:f}),r({message:o({defaultMessage:"Failed to open screenshot modal",id:"xzxG52das8"}),description:o({defaultMessage:"Please try again",id:"fHqssj/1KO"}),variant:"error",timeout:3})}},[o,t,s,r,n,e]);return!i&&!c?null:l.jsx(Hs,{content:o({defaultMessage:"Share as image",id:"NNAj+KDt/t"}),disabled:a,children:l.jsx("button",{"aria-label":o({defaultMessage:"Screenshot",id:"9a+SKtXKhe"}),onClick:u,className:z(su,"flex items-center justify-center px-sm"),style:{minHeight:Ah,minWidth:Ah},children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ft,{name:B("camera"),size:16})})})})};var e8=n0(),Pt=e=>t0(e,e8),t8=n0();Pt.write=e=>t0(e,t8);var Eb=n0();Pt.onStart=e=>t0(e,Eb);var n8=n0();Pt.onFrame=e=>t0(e,n8);var r8=n0();Pt.onFinish=e=>t0(e,r8);var Td=[];Pt.setTimeout=(e,t)=>{const n=Pt.now()+t,r=()=>{const o=Td.findIndex(a=>a.cancel==r);~o&&Td.splice(o,1),El-=~o?1:0},s={time:n,handler:e,cancel:r};return Td.splice(Pae(n),0,s),El+=1,Oae(),s};var Pae=e=>~(~Td.findIndex(t=>t.time>e)||~Td.length);Pt.cancel=e=>{Eb.delete(e),n8.delete(e),r8.delete(e),e8.delete(e),t8.delete(e)};Pt.sync=e=>{Fk=!0,Pt.batchedUpdates(e),Fk=!1};Pt.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...s){t=s,Pt.onStart(n)}return r.handler=e,r.cancel=()=>{Eb.delete(n),t=null},r};var s8=typeof window<"u"?window.requestAnimationFrame:(()=>{});Pt.use=e=>s8=e;Pt.now=typeof performance<"u"?()=>performance.now():Date.now;Pt.batchedUpdates=e=>e();Pt.catch=console.error;Pt.frameLoop="always";Pt.advance=()=>{Pt.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Fae()};var Sl=-1,El=0,Fk=!1;function t0(e,t){Fk?(t.delete(e),e(0)):(t.add(e),Oae())}function Oae(){Sl<0&&(Sl=0,Pt.frameLoop!=="demand"&&s8(Lae))}function $ot(){Sl=-1}function Lae(){~Sl&&(s8(Lae),Pt.batchedUpdates(Fae))}function Fae(){const e=Sl;Sl=Pt.now();const t=Pae(Sl);if(t&&(Bae(Td.splice(0,t),n=>n.handler()),El-=t),!El){$ot();return}Eb.flush(),e8.flush(e?Math.min(64,Sl-e):16.667),n8.flush(),t8.flush(),r8.flush()}function n0(){let e=new Set,t=e;return{add(n){El+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return El-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,El-=t.size,Bae(t,r=>r(n)&&e.add(r)),El+=e.size,t=e)}}}function Bae(e,t){e.forEach(n=>{try{t(n)}catch(r){Pt.catch(r)}})}var qot=Object.defineProperty,Kot=(e,t)=>{for(var n in t)qot(e,n,{get:t[n],enumerable:!0})},Uo={};Kot(Uo,{assign:()=>Qot,colors:()=>Pl,createStringInterpolator:()=>a8,skipAnimation:()=>Vae,to:()=>Uae,willAdvance:()=>i8});function Bk(){}var Yot=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Pe={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Mi(e,t){if(Pe.arr(e)){if(!Pe.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function ai(e,t,n){if(Pe.arr(e)){for(let r=0;rPe.und(e)?[]:Pe.arr(e)?e:[e];function Up(e,t){if(e.size){const n=Array.from(e);e.clear(),Nt(n,t)}}var cp=(e,...t)=>Up(e,n=>n(...t)),o8=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),a8,Uae,Pl=null,Vae=!1,i8=Bk,Qot=e=>{e.to&&(Uae=e.to),e.now&&(Pt.now=e.now),e.colors!==void 0&&(Pl=e.colors),e.skipAnimation!=null&&(Vae=e.skipAnimation),e.createStringInterpolator&&(a8=e.createStringInterpolator),e.requestAnimationFrame&&Pt.use(e.requestAnimationFrame),e.batchedUpdates&&(Pt.batchedUpdates=e.batchedUpdates),e.willAdvance&&(i8=e.willAdvance),e.frameLoop&&(Pt.frameLoop=e.frameLoop)},Vp=new Set,Eo=[],CC=[],W2=0,kb={get idle(){return!Vp.size&&!Eo.length},start(e){W2>e.priority?(Vp.add(e),Pt.onStart(Xot)):(Hae(e),Pt(Uk))},advance:Uk,sort(e){if(W2)Pt.onFrame(()=>kb.sort(e));else{const t=Eo.indexOf(e);~t&&(Eo.splice(t,1),zae(e))}},clear(){Eo=[],Vp.clear()}};function Xot(){Vp.forEach(Hae),Vp.clear(),Pt(Uk)}function Hae(e){Eo.includes(e)||zae(e)}function zae(e){Eo.splice(Zot(Eo,t=>t.priority>e.priority),0,e)}function Uk(e){const t=CC;for(let n=0;n0}function Zot(e,t){const n=e.findIndex(t);return n<0?e.length:n}var Jot={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},da="[-+]?\\d*\\.?\\d+",G2=da+"%";function Mb(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var eat=new RegExp("rgb"+Mb(da,da,da)),tat=new RegExp("rgba"+Mb(da,da,da,da)),nat=new RegExp("hsl"+Mb(da,G2,G2)),rat=new RegExp("hsla"+Mb(da,G2,G2,da)),sat=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,oat=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,aat=/^#([0-9a-fA-F]{6})$/,iat=/^#([0-9a-fA-F]{8})$/;function lat(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=aat.exec(e))?parseInt(t[1]+"ff",16)>>>0:Pl&&Pl[e]!==void 0?Pl[e]:(t=eat.exec(e))?(Gu(t[1])<<24|Gu(t[2])<<16|Gu(t[3])<<8|255)>>>0:(t=tat.exec(e))?(Gu(t[1])<<24|Gu(t[2])<<16|Gu(t[3])<<8|xL(t[4]))>>>0:(t=sat.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=iat.exec(e))?parseInt(t[1],16)>>>0:(t=oat.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=nat.exec(e))?(gL(yL(t[1]),C1(t[2]),C1(t[3]))|255)>>>0:(t=rat.exec(e))?(gL(yL(t[1]),C1(t[2]),C1(t[3]))|xL(t[4]))>>>0:null}function SC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gL(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r,o=SC(s,r,e+1/3),a=SC(s,r,e),i=SC(s,r,e-1/3);return Math.round(o*255)<<24|Math.round(a*255)<<16|Math.round(i*255)<<8}function Gu(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function yL(e){return(parseFloat(e)%360+360)%360/360}function xL(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function C1(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function vL(e){let t=lat(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,s=(t&65280)>>>8,o=(t&255)/255;return`rgba(${n}, ${r}, ${s}, ${o})`}var xf=(e,t,n)=>{if(Pe.fun(e))return e;if(Pe.arr(e))return xf({range:e,output:t,extrapolate:n});if(Pe.str(e.output[0]))return a8(e);const r=e,s=r.output,o=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",i=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const f=uat(u,o);return cat(u,o[f],o[f+1],s[f],s[f+1],c,a,i,r.map)}};function cat(e,t,n,r,s,o,a,i,c){let u=c?c(e):e;if(un){if(i==="identity")return u;i==="clamp"&&(u=n)}return r===s?r:t===n?e<=t?r:s:(t===-1/0?u=-u:n===1/0?u=u-t:u=(u-t)/(n-t),u=o(u),r===-1/0?u=-u:s===1/0?u=u+r:u=u*(s-r)+r,u)}function uat(e,t){for(var n=1;n=e);++n);return n-1}var Wae={linear:e=>e},Rh=Symbol.for("FluidValue.get"),vf=Symbol.for("FluidValue.observers"),Co=e=>!!(e&&e[Rh]),Ds=e=>e&&e[Rh]?e[Rh]():e,bL=e=>e[vf]||null;function dat(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Dh(e,t){const n=e[vf];n&&n.forEach(r=>{dat(r,t)})}var Gae=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");fat(this,e)}},fat=(e,t)=>$ae(e,Rh,t);function um(e,t){if(e[Rh]){let n=e[vf];n||$ae(e,vf,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function jh(e,t){const n=e[vf];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[vf]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var $ae=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ry=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,mat=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,_L=new RegExp(`(${Ry.source})(%|[a-z]+)`,"i"),pat=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Tb=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,qae=e=>{const[t,n]=hat(e);if(!t||o8())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const s=window.getComputedStyle(document.documentElement).getPropertyValue(n);return s||e}else{if(n&&Tb.test(n))return qae(n);if(n)return n}return e},hat=e=>{const t=Tb.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},EC,gat=(e,t,n,r,s)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Kae=e=>{EC||(EC=Pl?new RegExp(`(${Object.keys(Pl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(o=>Ds(o).replace(Tb,qae).replace(mat,vL).replace(EC,vL)),n=t.map(o=>o.match(Ry).map(Number)),s=n[0].map((o,a)=>n.map(i=>{if(!(a in i))throw Error('The arity of each "output" value must be equal');return i[a]})).map(o=>xf({...e,output:o}));return o=>{const a=!_L.test(t[0])&&t.find(c=>_L.test(c))?.replace(Ry,"");let i=0;return t[0].replace(Ry,()=>`${s[i++](o)}${a||""}`).replace(pat,gat)}},l8="react-spring: ",Yae=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${l8}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},yat=Yae(console.warn);function xat(){yat(`${l8}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var vat=Yae(console.warn);function bat(){vat(`${l8}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Ab(e){return Pe.str(e)&&(e[0]=="#"||/\d/.test(e)||!o8()&&Tb.test(e)||e in(Pl||{}))}var kl=o8()?d.useEffect:d.useLayoutEffect,_at=()=>{const e=d.useRef(!1);return kl(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function c8(){const e=d.useState()[1],t=_at();return()=>{t.current&&e(Math.random())}}var u8=e=>d.useEffect(e,wat),wat=[];function Vk(e){const t=d.useRef(void 0);return d.useEffect(()=>{t.current=e}),t.current}var Ih=Symbol.for("Animated:node"),Cat=e=>!!e&&e[Ih]===e,La=e=>e&&e[Ih],d8=(e,t)=>Yot(e,Ih,t),Nb=e=>e&&e[Ih]&&e[Ih].getPayload(),Qae=class{constructor(){d8(this,this)}getPayload(){return this.payload||[]}},Rb=class Xae extends Qae{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Pe.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new Xae(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,n){return Pe.num(t)&&(this.lastPosition=t,n&&(t=Math.round(t/n)*n,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Pe.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},$2=class Zae extends Rb{constructor(t){super(0),this._string=null,this._toString=xf({output:[t,t]})}static create(t){return new Zae(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Pe.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=xf({output:[this.getValue(),t]})),this._value=0,super.reset()}},q2={dependencies:null},Db=class extends Qae{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ai(this.source,(n,r)=>{Cat(n)?t[r]=n.getValue(e):Co(n)?t[r]=Ds(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Nt(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ai(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){q2.dependencies&&Co(e)&&q2.dependencies.add(e);const t=Nb(e);t&&Nt(t,n=>this.add(n))}},Sat=class Jae extends Db{constructor(t){super(t)}static create(t){return new Jae(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const n=this.getPayload();return t.length==n.length?n.map((r,s)=>r.setValue(t[s])).some(Boolean):(super.setValue(t.map(Eat)),!0)}};function Eat(e){return(Ab(e)?$2:Rb).create(e)}function Hk(e){const t=La(e);return t?t.constructor:Pe.arr(e)?Sat:Ab(e)?$2:Rb}var wL=(e,t)=>{const n=!Pe.fun(e)||e.prototype&&e.prototype.isReactComponent;return d.forwardRef((r,s)=>{const o=d.useRef(null),a=n&&d.useCallback(g=>{o.current=Tat(s,g)},[s]),[i,c]=Mat(r,t),u=c8(),f=()=>{const g=o.current;if(n&&!g)return;(g?t.applyAnimatedValues(g,i.getValue(!0)):!1)===!1&&u()},m=new kat(f,c),p=d.useRef(void 0);kl(()=>(p.current=m,Nt(c,g=>um(g,m)),()=>{p.current&&(Nt(p.current.deps,g=>jh(g,p.current)),Pt.cancel(p.current.update))})),d.useEffect(f,[]),u8(()=>()=>{const g=p.current;Nt(g.deps,y=>jh(y,g))});const h=t.getComponentProps(i.getValue());return d.createElement(e,{...h,ref:a})})},kat=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&Pt.write(this.update)}};function Mat(e,t){const n=new Set;return q2.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Db(e),q2.dependencies=null,[e,n]}function Tat(e,t){return e&&(Pe.fun(e)?e(t):e.current=t),t}var CL=Symbol.for("AnimatedComponent"),Aat=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=s=>new Db(s),getComponentProps:r=s=>s}={})=>{const s={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},o=a=>{const i=SL(a)||"Anonymous";return Pe.str(a)?a=o[a]||(o[a]=wL(a,s)):a=a[CL]||(a[CL]=wL(a,s)),a.displayName=`Animated(${i})`,a};return ai(e,(a,i)=>{Pe.arr(e)&&(i=SL(a)),o[i]=o(a)}),{animated:o}},SL=e=>Pe.str(e)?e:e&&Pe.str(e.displayName)?e.displayName:Pe.fun(e)&&e.name||null;function js(e,...t){return Pe.fun(e)?e(...t):e}var Hp=(e,t)=>e===!0||!!(t&&e&&(Pe.fun(e)?e(t):ws(e).includes(t))),eie=(e,t)=>Pe.obj(e)?t&&e[t]:e,tie=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Nat=e=>e,jb=(e,t=Nat)=>{let n=Rat;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const s of n){const o=t(e[s],s);Pe.und(o)||(r[s]=o)}return r},Rat=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Dat={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function jat(e){const t={};let n=0;if(ai(e,(r,s)=>{Dat[s]||(t[s]=r,n++)}),n)return t}function Ib(e){const t=jat(e);if(t){const n={to:t};return ai(e,(r,s)=>s in t||(n[s]=r)),n}return{...e}}function Ph(e){return e=Ds(e),Pe.arr(e)?e.map(Ph):Ab(e)?Uo.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function nie(e){for(const t in e)return!0;return!1}function zk(e){return Pe.fun(e)||Pe.arr(e)&&Pe.obj(e[0])}function Wk(e,t){e.ref?.delete(e),t?.delete(e)}function rie(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var sie={default:{tension:170,friction:26}},Gk={...sie.default,mass:1,damping:1,easing:Wae.linear,clamp:!1},Iat=class{constructor(){this.velocity=0,Object.assign(this,Gk)}};function Pat(e,t,n){n&&(n={...n},EL(n,t),t={...n,...t}),EL(e,t),Object.assign(e,t);for(const a in Gk)e[a]==null&&(e[a]=Gk[a]);let{frequency:r,damping:s}=e;const{mass:o}=e;return Pe.und(r)||(r<.01&&(r=.01),s<0&&(s=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*s*o/r),e}function EL(e,t){if(!Pe.und(t.decay))e.duration=void 0;else{const n=!Pe.und(t.tension)||!Pe.und(t.friction);(n||!Pe.und(t.frequency)||!Pe.und(t.damping)||!Pe.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var kL=[],Oat=class{constructor(){this.changed=!1,this.values=kL,this.toValues=null,this.fromValues=kL,this.config=new Iat,this.immediate=!1}};function oie(e,{key:t,props:n,defaultProps:r,state:s,actions:o}){return new Promise((a,i)=>{let c,u,f=Hp(n.cancel??r?.cancel,t);if(f)h();else{Pe.und(n.pause)||(s.paused=Hp(n.pause,t));let g=r?.pause;g!==!0&&(g=s.paused||Hp(g,t)),c=js(n.delay||0,t),g?(s.resumeQueue.add(p),o.pause()):(o.resume(),p())}function m(){s.resumeQueue.add(p),s.timeouts.delete(u),u.cancel(),c=u.time-Pt.now()}function p(){c>0&&!Uo.skipAnimation?(s.delayed=!0,u=Pt.setTimeout(h,c),s.pauseQueue.add(m),s.timeouts.add(u)):h()}function h(){s.delayed&&(s.delayed=!1),s.pauseQueue.delete(m),s.timeouts.delete(u),e<=(s.cancelId||0)&&(f=!0);try{o.start({...n,callId:e,cancel:f},a)}catch(g){i(g)}}})}var f8=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?Ad(e.get()):t.every(n=>n.noop)?aie(e.get()):ia(e.get(),t.every(n=>n.finished)),aie=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ia=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ad=e=>({value:e,cancelled:!0,finished:!1});function iie(e,t,n,r){const{callId:s,parentId:o,onRest:a}=t,{asyncTo:i,promise:c}=n;return!o&&e===i&&!t.reset?c:n.promise=(async()=>{n.asyncId=s,n.asyncTo=e;const u=jb(t,(x,v)=>v==="onRest"?void 0:x);let f,m;const p=new Promise((x,v)=>(f=x,m=v)),h=x=>{const v=s<=(n.cancelId||0)&&Ad(r)||s!==n.asyncId&&ia(r,!1);if(v)throw x.result=v,m(x),x},g=(x,v)=>{const b=new $k,_=new ML;return(async()=>{if(Uo.skipAnimation)throw Oh(n),_.result=ia(r,!1),m(_),_;h(b);const w=Pe.obj(x)?{...x}:{...v,to:x};w.parentId=s,ai(u,(C,E)=>{Pe.und(w[E])&&(w[E]=C)});const S=await r.start(w);return h(b),n.paused&&await new Promise(C=>{n.resumeQueue.add(C)}),S})()};let y;if(Uo.skipAnimation)return Oh(n),ia(r,!1);try{let x;Pe.arr(e)?x=(async v=>{for(const b of v)await g(b)})(e):x=Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([x.then(f),p]),y=ia(r.get(),!0,!1)}catch(x){if(x instanceof $k)y=x.result;else if(x instanceof ML)y=x.result;else throw x}finally{s==n.asyncId&&(n.asyncId=o,n.asyncTo=o?i:void 0,n.promise=o?c:void 0)}return Pe.fun(a)&&Pt.batchedUpdates(()=>{a(y,r,r.item)}),y})()}function Oh(e,t){Up(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var $k=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},ML=class extends Error{constructor(){super("SkipAnimationSignal")}},qk=e=>e instanceof Pb,Lat=1,Pb=class extends Gae{constructor(){super(...arguments),this.id=Lat++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=La(this);return e&&e.getValue()}to(...e){return Uo.to(this,e)}interpolate(...e){return xat(),Uo.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Dh(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||kb.sort(this),Dh(this,{type:"priority",parent:this,priority:e})}},ou=Symbol.for("SpringPhase"),lie=1,Kk=2,Yk=4,kC=e=>(e[ou]&lie)>0,ll=e=>(e[ou]&Kk)>0,Wm=e=>(e[ou]&Yk)>0,TL=(e,t)=>t?e[ou]|=Kk|lie:e[ou]&=~Kk,AL=(e,t)=>t?e[ou]|=Yk:e[ou]&=~Yk,cie=class extends Pb{constructor(e,t){if(super(),this.animation=new Oat,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Pe.und(e)||!Pe.und(t)){const n=Pe.obj(e)?{...e}:{...t,from:e};Pe.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ll(this)||this._state.asyncTo)||Wm(this)}get goal(){return Ds(this.animation.to)}get velocity(){const e=La(this);return e instanceof Rb?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return kC(this)}get isAnimating(){return ll(this)}get isPaused(){return Wm(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:s}=r;const{config:o}=r,a=Nb(r.to);!a&&Co(r.to)&&(s=ws(Ds(r.to))),r.values.forEach((u,f)=>{if(u.done)return;const m=u.constructor==$2?1:a?a[f].lastPosition:s[f];let p=r.immediate,h=m;if(!p){if(h=u.lastPosition,o.tension<=0){u.done=!0;return}let g=u.elapsedTime+=e;const y=r.fromValues[f],x=u.v0!=null?u.v0:u.v0=Pe.arr(o.velocity)?o.velocity[f]:o.velocity;let v;const b=o.precision||(y==m?.005:Math.min(1,Math.abs(m-y)*.001));if(Pe.und(o.duration))if(o.decay){const _=o.decay===!0?.998:o.decay,w=Math.exp(-(1-_)*g);h=y+x/(1-_)*(1-w),p=Math.abs(u.lastPosition-h)<=b,v=x*w}else{v=u.lastVelocity==null?x:u.lastVelocity;const _=o.restVelocity||b/10,w=o.clamp?0:o.bounce,S=!Pe.und(w),C=y==m?u.v0>0:y_,!(!E&&(p=Math.abs(m-h)<=b,p)));++M){S&&(N=h==m||h>m==C,N&&(v=-v*w,h=m));const A=-o.tension*1e-6*(h-m),D=-o.friction*.001*v,P=(A+D)/o.mass;v=v+P*k,h=h+v*k}}else{let _=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,u.durationProgress>0&&(u.elapsedTime=o.duration*u.durationProgress,g=u.elapsedTime+=e)),_=(o.progress||0)+g/this._memoizedDuration,_=_>1?1:_<0?0:_,u.durationProgress=_),h=y+o.easing(_)*(m-y),v=(h-u.lastPosition)/e,p=_==1}u.lastVelocity=v,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[f].done&&(p=!1),p?u.done=!0:t=!1,u.setValue(h,o.round)&&(n=!0)});const i=La(this),c=i.getValue();if(t){const u=Ds(r.to);(c!==u||n)&&!o.decay?(i.setValue(u),this._onChange(u)):n&&o.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return Pt.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ll(this)){const{to:e,config:t}=this.animation;Pt.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Pe.und(e)?(n=this.queue||[],this.queue=[]):n=[Pe.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>f8(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Oh(this._state,e&&this._lastCallId),Pt.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=Pe.obj(n)?n[t]:n,(n==null||zk(n))&&(n=void 0),r=Pe.obj(r)?r[t]:r,r==null&&(r=void 0);const s={to:n,from:r};return kC(this)||(e.reverse&&([n,r]=[r,n]),r=Ds(r),Pe.und(r)?La(this)||this._set(n):this._set(r)),s}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,jb(e,(a,i)=>/^on/.test(i)?eie(a,n):a)),RL(this,e,"onProps"),$m(this,"onProps",e,this);const s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const o=this._state;return oie(++this._lastCallId,{key:n,props:e,defaultProps:r,state:o,actions:{pause:()=>{Wm(this)||(AL(this,!0),cp(o.pauseQueue),$m(this,"onPause",ia(this,Gm(this,this.animation.to)),this))},resume:()=>{Wm(this)&&(AL(this,!1),ll(this)&&this._resume(),cp(o.resumeQueue),$m(this,"onResume",ia(this,Gm(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const i=uie(e);if(i)return this._update(i,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ad(this));const r=!Pe.und(e.to),s=!Pe.und(e.from);if(r||s)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Ad(this));const{key:o,defaultProps:a,animation:i}=this,{to:c,from:u}=i;let{to:f=c,from:m=u}=e;s&&!r&&(!t.default||Pe.und(f))&&(f=m),t.reverse&&([f,m]=[m,f]);const p=!Mi(m,u);p&&(i.from=m),m=Ds(m);const h=!Mi(f,c);h&&this._focus(f);const g=zk(t.to),{config:y}=i,{decay:x,velocity:v}=y;(r||s)&&(y.velocity=0),t.config&&!g&&Pat(y,js(t.config,o),t.config!==a.config?js(a.config,o):void 0);let b=La(this);if(!b||Pe.und(f))return n(ia(this,!0));const _=Pe.und(t.reset)?s&&!t.default:!Pe.und(m)&&Hp(t.reset,o),w=_?m:this.get(),S=Ph(f),C=Pe.num(S)||Pe.arr(S)||Ab(S),E=!g&&(!C||Hp(a.immediate||t.immediate,o));if(h){const M=Hk(f);if(M!==b.constructor)if(E)b=this._set(S);else throw Error(`Cannot animate between ${b.constructor.name} and ${M.name}, as the "to" prop suggests`)}const N=b.constructor;let k=Co(f),I=!1;if(!k){const M=_||!kC(this)&&p;(h||M)&&(I=Mi(Ph(w),S),k=!I),(!Mi(i.immediate,E)&&!E||!Mi(y.decay,x)||!Mi(y.velocity,v))&&(k=!0)}if(I&&ll(this)&&(i.changed&&!_?k=!0:k||this._stop(c)),!g&&((k||Co(c))&&(i.values=b.getPayload(),i.toValues=Co(f)?null:N==$2?[1]:ws(S)),i.immediate!=E&&(i.immediate=E,!E&&!_&&this._set(c)),k)){const{onRest:M}=i;Nt(Bat,D=>RL(this,t,D));const A=ia(this,Gm(this,c));cp(this._pendingCalls,A),this._pendingCalls.add(n),i.changed&&Pt.batchedUpdates(()=>{i.changed=!_,M?.(A,this),_?js(a.onRest,A):i.onStart?.(A,this)})}_&&this._set(w),g?n(iie(t.to,t,this._state,this)):k?this._start():ll(this)&&!h?this._pendingCalls.add(n):n(aie(w))}_focus(e){const t=this.animation;e!==t.to&&(bL(this)&&this._detach(),t.to=e,bL(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Co(t)&&(um(t,this),qk(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Co(e)&&jh(e,this)}_set(e,t=!0){const n=Ds(e);if(!Pe.und(n)){const r=La(this);if(!r||!Mi(n,r.getValue())){const s=Hk(n);!r||r.constructor!=s?d8(this,s.create(n)):r.setValue(n),r&&Pt.batchedUpdates(()=>{this._onChange(n,t)})}}return La(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,$m(this,"onStart",ia(this,Gm(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),js(this.animation.onChange,e,this)),js(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;La(this).reset(Ds(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),ll(this)||(TL(this,!0),Wm(this)||this._resume())}_resume(){Uo.skipAnimation?this.finish():kb.start(this)}_stop(e,t){if(ll(this)){TL(this,!1);const n=this.animation;Nt(n.values,s=>{s.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Dh(this,{type:"idle",parent:this});const r=t?Ad(this.get()):ia(this.get(),Gm(this,e??n.to));cp(this._pendingCalls,r),n.changed&&(n.changed=!1,$m(this,"onRest",r,this))}}};function Gm(e,t){const n=Ph(t),r=Ph(e.get());return Mi(r,n)}function uie(e,t=e.loop,n=e.to){const r=js(t);if(r){const s=r!==!0&&Ib(r),o=(s||e).reverse,a=!s||s.reset;return Lh({...e,loop:t,default:!1,pause:void 0,to:!o||zk(n)?n:void 0,from:a?e.from:void 0,reset:a,...s})}}function Lh(e){const{to:t,from:n}=e=Ib(e),r=new Set;return Pe.obj(t)&&NL(t,r),Pe.obj(n)&&NL(n,r),e.keys=r.size?Array.from(r):null,e}function Fat(e){const t=Lh(e);return Pe.und(t.default)&&(t.default=jb(t)),t}function NL(e,t){ai(e,(n,r)=>n!=null&&t.add(r))}var Bat=["onStart","onRest","onChange","onPause","onResume"];function RL(e,t,n){e.animation[n]=t[n]!==tie(t,n)?eie(t[n],e.key):void 0}function $m(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Uat=["onStart","onChange","onRest"],Vat=1,m8=class{constructor(e,t){this.id=Vat++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];Pe.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Lh(e)),this}start(e){let{queue:t}=this;return e?t=ws(e).map(Lh):this.queue=[],this._flush?this._flush(this,t):(hie(this,t),Qk(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Nt(ws(t),r=>n[r].stop(!!e))}else Oh(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(Pe.und(e))this.start({pause:!0});else{const t=this.springs;Nt(ws(e),n=>t[n].pause())}return this}resume(e){if(Pe.und(e))this.start({pause:!1});else{const t=this.springs;Nt(ws(e),n=>t[n].resume())}return this}each(e){ai(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,Up(e,([i,c])=>{c.value=this.get(),i(c,this,this._item)}));const o=!r&&this._started,a=s||o&&n.size?this.get():null;s&&t.size&&Up(t,([i,c])=>{c.value=a,i(c,this,this._item)}),o&&(this._started=!1,Up(n,([i,c])=>{c.value=a,i(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;Pt.onFrame(this._onFrame)}};function Qk(e,t){return Promise.all(t.map(n=>die(e,n))).then(n=>f8(e,n))}async function die(e,t,n){const{keys:r,to:s,from:o,loop:a,onRest:i,onResolve:c}=t,u=Pe.obj(t.default)&&t.default;a&&(t.loop=!1),s===!1&&(t.to=null),o===!1&&(t.from=null);const f=Pe.arr(s)||Pe.fun(s)?s:void 0;f?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):Nt(Uat,y=>{const x=t[y];if(Pe.fun(x)){const v=e._events[y];t[y]=({finished:b,cancelled:_})=>{const w=v.get(x);w?(b||(w.finished=!1),_&&(w.cancelled=!0)):v.set(x,{value:null,finished:b||!1,cancelled:_||!1})},u&&(u[y]=t[y])}});const m=e._state;t.pause===!m.paused?(m.paused=t.pause,cp(t.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(t.pause=!0);const p=(r||Object.keys(e.springs)).map(y=>e.springs[y].start(t)),h=t.cancel===!0||tie(t,"cancel")===!0;(f||h&&m.asyncId)&&p.push(oie(++e._lastAsyncId,{props:t,state:m,actions:{pause:Bk,resume:Bk,start(y,x){h?(Oh(m,e._lastAsyncId),x(Ad(e))):(y.onRest=i,x(iie(f,y,m,e)))}}})),m.paused&&await new Promise(y=>{m.resumeQueue.add(y)});const g=f8(e,await Promise.all(p));if(a&&g.finished&&!(n&&g.noop)){const y=uie(t,a,s);if(y)return hie(e,[y]),die(e,y,!0)}return c&&Pt.batchedUpdates(()=>c(g,e,e.item)),g}function Xk(e,t){const n={...e.springs};return t&&Nt(ws(t),r=>{Pe.und(r.keys)&&(r=Lh(r)),Pe.obj(r.to)||(r={...r,to:void 0}),pie(n,r,s=>mie(s))}),fie(e,n),n}function fie(e,t){ai(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,um(n,e))})}function mie(e,t){const n=new cie;return n.key=e,t&&um(n,t),n}function pie(e,t,n){t.keys&&Nt(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function hie(e,t){Nt(t,n=>{pie(e.springs,n,r=>mie(r,e))})}var p8=d.createContext({pause:!1,immediate:!1}),h8=()=>{const e=[],t=function(r){bat();const s=[];return Nt(e,(o,a)=>{if(Pe.und(r))s.push(o.start());else{const i=n(r,o,a);i&&s.push(o.start(i))}}),s};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const s=e.indexOf(r);~s&&e.splice(s,1)},t.pause=function(){return Nt(e,r=>r.pause(...arguments)),this},t.resume=function(){return Nt(e,r=>r.resume(...arguments)),this},t.set=function(r){Nt(e,(s,o)=>{const a=Pe.fun(r)?r(o,s):r;a&&s.set(a)})},t.start=function(r){const s=[];return Nt(e,(o,a)=>{if(Pe.und(r))s.push(o.start());else{const i=this._getProps(r,o,a);i&&s.push(o.start(i))}}),s},t.stop=function(){return Nt(e,r=>r.stop(...arguments)),this},t.update=function(r){return Nt(e,(s,o)=>s.update(this._getProps(r,s,o))),this};const n=function(r,s,o){return Pe.fun(r)?r(o,s):r};return t._getProps=n,t};function gie(e,t,n){const r=Pe.fun(t)&&t;r&&!n&&(n=[]);const s=d.useMemo(()=>r||arguments.length==3?h8():void 0,[]),o=d.useRef(0),a=c8(),i=d.useMemo(()=>({ctrls:[],queue:[],flush(v,b){const _=Xk(v,b);return o.current>0&&!i.queue.length&&!Object.keys(_).some(S=>!v.springs[S])?Qk(v,b):new Promise(S=>{fie(v,_),i.queue.push(()=>{S(Qk(v,b))}),a()})}}),[]),c=d.useRef([...i.ctrls]),u=d.useRef([]),f=Vk(e)||0;d.useMemo(()=>{Nt(c.current.slice(e,f),v=>{Wk(v,s),v.stop(!0)}),c.current.length=e,m(f,e)},[e]),d.useMemo(()=>{m(0,Math.min(f,e))},n);function m(v,b){for(let _=v;_Xk(v,u.current[b])),h=d.useContext(p8),g=Vk(h),y=h!==g&&nie(h);kl(()=>{o.current++,i.ctrls=c.current;const{queue:v}=i;v.length&&(i.queue=[],Nt(v,b=>b())),Nt(c.current,(b,_)=>{s?.add(b),y&&b.start({default:h});const w=u.current[_];w&&(rie(b,w.ref),b.ref?b.queue.push(w):b.start(w))})}),u8(()=>()=>{Nt(i.ctrls,v=>v.stop(!0))});const x=p.map(v=>({...v}));return s?[x,s]:x}function yie(e,t){const n=Pe.fun(e),[[r],s]=gie(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,s]:r}function Ob(e,t,n){const r=Pe.fun(t)&&t,{reset:s,sort:o,trail:a=0,expires:i=!0,exitBeforeEnter:c=!1,onDestroyed:u,ref:f,config:m}=r?r():t,p=d.useMemo(()=>r||arguments.length==3?h8():void 0,[]),h=ws(e),g=[],y=d.useRef(null),x=s?null:y.current;kl(()=>{y.current=g}),u8(()=>(Nt(g,P=>{p?.add(P.ctrl),P.ctrl.ref=p}),()=>{Nt(y.current,P=>{P.expired&&clearTimeout(P.expirationId),Wk(P.ctrl,p),P.ctrl.stop(!0)})}));const v=zat(h,r?r():t,x),b=s&&y.current||[];kl(()=>Nt(b,({ctrl:P,item:F,key:R})=>{Wk(P,p),js(u,F,R)}));const _=[];if(x&&Nt(x,(P,F)=>{P.expired?(clearTimeout(P.expirationId),b.push(P)):(F=_[F]=v.indexOf(P.key),~F&&(g[F]=P))}),Nt(h,(P,F)=>{g[F]||(g[F]={key:v[F],item:P,phase:"mount",ctrl:new m8},g[F].ctrl.item=P)}),_.length){let P=-1;const{leave:F}=r?r():t;Nt(_,(R,j)=>{const L=x[j];~R?(P=g.indexOf(L),g[P]={...L,item:h[R]}):F&&g.splice(++P,0,L)})}Pe.fun(o)&&g.sort((P,F)=>o(P.item,F.item));let w=-a;const S=c8(),C=jb(t),E=new Map,N=d.useRef(new Map),k=d.useRef(!1);Nt(g,(P,F)=>{const R=P.key,j=P.phase,L=r?r():t;let U,O;const $=js(L.delay||0,R);if(j=="mount")U=L.enter,O="enter";else{const Y=v.indexOf(R)<0;if(j!="leave")if(Y)U=L.leave,O="leave";else if(U=L.update)O="update";else return;else if(!Y)U=L.enter,O="enter";else return}if(U=js(U,P.item,F),U=Pe.obj(U)?Ib(U):{to:U},!U.config){const Y=m||C.config;U.config=js(Y,P.item,F,O)}w+=a;const G={...C,delay:$+w,ref:f,immediate:L.immediate,reset:!1,...U};if(O=="enter"&&Pe.und(G.from)){const Y=r?r():t,te=Pe.und(Y.initial)||x?Y.from:Y.initial;G.from=js(te,P.item,F)}const{onResolve:H}=G;G.onResolve=Y=>{js(H,Y);const te=y.current,se=te.find(ae=>ae.key===R);if(se&&!(Y.cancelled&&se.phase!="update")&&se.ctrl.idle){const ae=te.every(X=>X.ctrl.idle);if(se.phase=="leave"){const X=js(i,se.item);if(X!==!1){const ee=X===!0?0:X;if(se.expired=!0,!ae&&ee>0){ee<=2147483647&&(se.expirationId=setTimeout(S,ee));return}}}ae&&te.some(X=>X.expired)&&(N.current.delete(se),c&&(k.current=!0),S())}};const Q=Xk(P.ctrl,G);O==="leave"&&c?N.current.set(P,{phase:O,springs:Q,payload:G}):E.set(P,{phase:O,springs:Q,payload:G})});const I=d.useContext(p8),M=Vk(I),A=I!==M&&nie(I);kl(()=>{A&&Nt(g,P=>{P.ctrl.start({default:I})})},[I]),Nt(E,(P,F)=>{if(N.current.size){const R=g.findIndex(j=>j.key===F.key);g.splice(R,1)}}),kl(()=>{Nt(N.current.size?N.current:E,({phase:P,payload:F},R)=>{const{ctrl:j}=R;R.phase=P,p?.add(j),A&&P=="enter"&&j.start({default:I}),F&&(rie(j,F.ref),(j.ref||p)&&!k.current?j.update(F):(j.start(F),k.current&&(k.current=!1)))})},s?void 0:n);const D=P=>d.createElement(d.Fragment,null,g.map((F,R)=>{const{springs:j}=E.get(F)||F.ctrl,L=P({...j},F.item,F,R),U=Pe.str(F.key)||Pe.num(F.key)?F.key:F.ctrl.id,O=d.version<"19.0.0",$=L?.props??{},G=O?L?.ref:$?.ref;return L&&L.type?d.createElement(L.type,{...$,key:U,ref:G}):L}));return p?[D,p]:D}var Hat=1;function zat(e,{key:t,keys:n=t},r){if(n===null){const s=new Set;return e.map(o=>{const a=r&&r.find(i=>i.item===o&&i.phase!=="leave"&&!s.has(i));return a?(s.add(a),a.key):Hat++})}return Pe.und(n)?e:Pe.fun(n)?e.map(n):ws(n)}var g8=class extends Pb{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=xf(...t);const n=this._get(),r=Hk(n);d8(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Mi(t,n)||(La(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&DL(this._active)&&MC(this)}_get(){const e=Pe.arr(this.source)?this.source.map(Ds):ws(Ds(this.source));return this.calc(...e)}_start(){this.idle&&!DL(this._active)&&(this.idle=!1,Nt(Nb(this),e=>{e.done=!1}),Uo.skipAnimation?(Pt.batchedUpdates(()=>this.advance()),MC(this)):kb.start(this))}_attach(){let e=1;Nt(ws(this.source),t=>{Co(t)&&um(t,this),qk(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Nt(ws(this.source),e=>{Co(e)&&jh(e,this)}),this._active.clear(),MC(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=ws(this.source).reduce((t,n)=>Math.max(t,(qk(n)?n.priority:0)+1),0))}};function Wat(e){return e.idle!==!1}function DL(e){return!e.size||Array.from(e).every(Wat)}function MC(e){e.idle||(e.idle=!0,Nt(Nb(e),t=>{t.done=!0}),Dh(e,{type:"idle",parent:e}))}var xie=(e,...t)=>new g8(e,t);Uo.assign({createStringInterpolator:Kae,to:(e,t)=>new g8(e,t)});var vie=/^--/;function Gat(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!vie.test(e)&&!(zp.hasOwnProperty(e)&&zp[e])?t+"px":(""+t).trim()}var jL={};function $at(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:s,children:o,scrollTop:a,scrollLeft:i,viewBox:c,...u}=t,f=Object.values(u),m=Object.keys(u).map(p=>n||e.hasAttribute(p)?p:jL[p]||(jL[p]=p.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));o!==void 0&&(e.textContent=o);for(const p in s)if(s.hasOwnProperty(p)){const h=Gat(p,s[p]);vie.test(p)?e.style.setProperty(p,h):e.style[p]=h}m.forEach((p,h)=>{e.setAttribute(p,f[h])}),r!==void 0&&(e.className=r),a!==void 0&&(e.scrollTop=a),i!==void 0&&(e.scrollLeft=i),c!==void 0&&e.setAttribute("viewBox",c)}var zp={animationIterationCount:!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,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},qat=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Kat=["Webkit","Ms","Moz","O"];zp=Object.keys(zp).reduce((e,t)=>(Kat.forEach(n=>e[qat(n,t)]=e[t]),e),zp);var Yat=/^(matrix|translate|scale|rotate|skew)/,Qat=/^(translate)/,Xat=/^(rotate|skew)/,TC=(e,t)=>Pe.num(e)&&e!==0?e+t:e,Dy=(e,t)=>Pe.arr(e)?e.every(n=>Dy(n,t)):Pe.num(e)?e===t:parseFloat(e)===t,Zat=class extends Db{constructor({x:e,y:t,z:n,...r}){const s=[],o=[];(e||t||n)&&(s.push([e||0,t||0,n||0]),o.push(a=>[`translate3d(${a.map(i=>TC(i,"px")).join(",")})`,Dy(a,0)])),ai(r,(a,i)=>{if(i==="transform")s.push([a||""]),o.push(c=>[c,c===""]);else if(Yat.test(i)){if(delete r[i],Pe.und(a))return;const c=Qat.test(i)?"px":Xat.test(i)?"deg":"";s.push(ws(a)),o.push(i==="rotate3d"?([u,f,m,p])=>[`rotate3d(${u},${f},${m},${TC(p,c)})`,Dy(p,0)]:u=>[`${i}(${u.map(f=>TC(f,c)).join(",")})`,Dy(u,i.startsWith("scale")?1:0)])}}),s.length&&(r.transform=new Jat(s,o)),super(r)}},Jat=class extends Gae{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Nt(this.inputs,(n,r)=>{const s=Ds(n[0]),[o,a]=this.transforms[r](Pe.arr(s)?s:n.map(Ds));e+=" "+o,t=t&&a}),t?"none":e}observerAdded(e){e==1&&Nt(this.inputs,t=>Nt(t,n=>Co(n)&&um(n,this)))}observerRemoved(e){e==0&&Nt(this.inputs,t=>Nt(t,n=>Co(n)&&jh(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Dh(this,e)}},eit=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Uo.assign({batchedUpdates:qh.unstable_batchedUpdates,createStringInterpolator:Kae,colors:Jot});var tit=Aat(eit,{applyAnimatedValues:$at,createAnimatedStyle:e=>new Zat(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),No=tit.animated;const y8=Object.freeze(Object.defineProperty({__proto__:null,BailSignal:$k,Controller:m8,FrameValue:Pb,Globals:Uo,Interpolation:g8,SpringContext:p8,SpringRef:h8,SpringValue:cie,a:No,animated:No,config:sie,createInterpolator:xf,easings:Wae,inferTo:Ib,to:xie,useIsomorphicLayoutEffect:kl,useSpring:yie,useSprings:gie,useTransition:Ob},Symbol.toStringTag,{value:"Module"}));var nit=["top","left","transform","className","children","innerRef"];function Zk(){return Zk=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Cs(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.transform,a=e.className,i=e.children,c=e.innerRef,u=rit(e,nit);return T.createElement("g",Zk({ref:c,className:z("visx-group",a),transform:o||"translate("+s+", "+n+")"},u),i)}Cs.propTypes={top:He.number,left:He.number,transform:He.string,className:He.string,children:He.node,innerRef:He.oneOfType([He.string,He.func,He.object])};const sit=Object.freeze(Object.defineProperty({__proto__:null,Group:Cs},Symbol.toStringTag,{value:"Module"}));function qo(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const IL=Symbol("implicit");function x8(){var e=new yP,t=[],n=[],r=IL;function s(o){let a=e.get(o);if(a===void 0){if(r!==IL)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return s.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new yP;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return s},s.range=function(o){return arguments.length?(n=Array.from(o),s):n.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return x8(t,n).unknown(r)},qo.apply(s,arguments),s}function v8(){var e=x8().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,o,a,i=!1,c=0,u=0,f=.5;delete e.unknown;function m(){var p=t().length,h=s>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?S1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?S1(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=iit.exec(e))?new Fr(t[1],t[2],t[3],1):(t=lit.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cit.exec(e))?S1(t[1],t[2],t[3],t[4]):(t=uit.exec(e))?S1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dit.exec(e))?VL(t[1],t[2]/100,t[3]/100,1):(t=fit.exec(e))?VL(t[1],t[2]/100,t[3]/100,t[4]):PL.hasOwnProperty(e)?FL(PL[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function FL(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function S1(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function b8(e){return e instanceof lc||(e=Bh(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function Jk(e,t,n,r){return arguments.length===1?b8(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}dm(Fr,Jk,r0(lc,{brighter(e){return e=e==null?bf:Math.pow(bf,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?au:Math.pow(au,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Hc(this.r),Hc(this.g),Hc(this.b),K2(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:BL,formatHex:BL,formatHex8:hit,formatRgb:UL,toString:UL}));function BL(){return`#${Ic(this.r)}${Ic(this.g)}${Ic(this.b)}`}function hit(){return`#${Ic(this.r)}${Ic(this.g)}${Ic(this.b)}${Ic((isNaN(this.opacity)?1:this.opacity)*255)}`}function UL(){const e=K2(this.opacity);return`${e===1?"rgb(":"rgba("}${Hc(this.r)}, ${Hc(this.g)}, ${Hc(this.b)}${e===1?")":`, ${e})`}`}function K2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ic(e){return e=Hc(e),(e<16?"0":"")+e.toString(16)}function VL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ca(e,t,n,r)}function _ie(e){if(e instanceof ca)return new ca(e.h,e.s,e.l,e.opacity);if(e instanceof lc||(e=Bh(e)),!e)return new ca;if(e instanceof ca)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,i=o-s,c=(o+s)/2;return i?(t===o?a=(n-r)/i+(n0&&c<1?0:a,new ca(a,i,c,e.opacity)}function e5(e,t,n,r){return arguments.length===1?_ie(e):new ca(e,t,n,r??1)}function ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}dm(ca,e5,r0(lc,{brighter(e){return e=e==null?bf:Math.pow(bf,e),new ca(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?au:Math.pow(au,e),new ca(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 Fr(AC(e>=240?e-240:e+120,s,r),AC(e,s,r),AC(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ca(HL(this.h),E1(this.s),E1(this.l),K2(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=K2(this.opacity);return`${e===1?"hsl(":"hsla("}${HL(this.h)}, ${E1(this.s)*100}%, ${E1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function HL(e){return e=(e||0)%360,e<0?e+360:e}function E1(e){return Math.max(0,Math.min(1,e||0))}function AC(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 wie=Math.PI/180,Cie=180/Math.PI,Y2=18,Sie=.96422,Eie=1,kie=.82521,Mie=4/29,Rd=6/29,Tie=3*Rd*Rd,git=Rd*Rd*Rd;function Aie(e){if(e instanceof Ya)return new Ya(e.l,e.a,e.b,e.opacity);if(e instanceof Oi)return Nie(e);e instanceof Fr||(e=b8(e));var t=jC(e.r),n=jC(e.g),r=jC(e.b),s=NC((.2225045*t+.7168786*n+.0606169*r)/Eie),o,a;return t===n&&n===r?o=a=s:(o=NC((.4360747*t+.3850649*n+.1430804*r)/Sie),a=NC((.0139322*t+.0971045*n+.7141733*r)/kie)),new Ya(116*s-16,500*(o-s),200*(s-a),e.opacity)}function t5(e,t,n,r){return arguments.length===1?Aie(e):new Ya(e,t,n,r??1)}function Ya(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}dm(Ya,t5,r0(lc,{brighter(e){return new Ya(this.l+Y2*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ya(this.l-Y2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Sie*RC(t),e=Eie*RC(e),n=kie*RC(n),new Fr(DC(3.1338561*t-1.6168667*e-.4906146*n),DC(-.9787684*t+1.9161415*e+.033454*n),DC(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function NC(e){return e>git?Math.pow(e,1/3):e/Tie+Mie}function RC(e){return e>Rd?e*e*e:Tie*(e-Mie)}function DC(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function jC(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function yit(e){if(e instanceof Oi)return new Oi(e.h,e.c,e.l,e.opacity);if(e instanceof Ya||(e=Aie(e)),e.a===0&&e.b===0)return new Oi(NaN,0()=>e;function Die(e,t){return function(n){return e+n*t}}function vit(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 C8(e,t){var n=t-e;return n?Die(e,n>180||n<-180?n-360*Math.round(n/360):n):Fb(isNaN(e)?t:e)}function bit(e){return(e=+e)==1?Br:function(t,n){return n-t?vit(t,n,e):Fb(isNaN(t)?n:t)}}function Br(e,t){var n=t-e;return n?Die(e,n):Fb(isNaN(e)?t:e)}const s5=(function e(t){var n=bit(t);function r(s,o){var a=n((s=Jk(s)).r,(o=Jk(o)).r),i=n(s.g,o.g),c=n(s.b,o.b),u=Br(s.opacity,o.opacity);return function(f){return s.r=a(f),s.g=i(f),s.b=c(f),s.opacity=u(f),s+""}}return r.gamma=e,r})(1);function _it(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;sn&&(o=t.slice(n,o),i[a]?i[a]+=o:i[++a]=o),(r=r[0])===(s=s[0])?i[a]?i[a]+=s:i[++a]=s:(i[++a]=null,c.push({i:a,x:Q2(r,s)})),n=IC.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Fit(e,t,n){var r=e[0],s=e[1],o=t[0],a=t[1];return s2?Bit:Fit,c=u=null,m}function m(p){return p==null||isNaN(p=+p)?o:(c||(c=i(e.map(r),t,n)))(r(a(p)))}return m.invert=function(p){return a(s((u||(u=i(t,e.map(r),Q2)))(p)))},m.domain=function(p){return arguments.length?(e=Array.from(p,Lie),f()):e.slice()},m.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},m.rangeRound=function(p){return t=Array.from(p),n=jie,f()},m.clamp=function(p){return arguments.length?(a=p?!0:za,f()):a!==za},m.interpolate=function(p){return arguments.length?(n=p,f()):n},m.unknown=function(p){return arguments.length?(o=p,m):o},function(p,h){return r=p,s=h,f()}}function E8(){return Bb()(za,za)}function Uit(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function X2(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 _f(e){return e=X2(Math.abs(e)),e?e[1]:NaN}function Vit(e,t){return function(n,r){for(var s=n.length,o=[],a=0,i=e[0],c=0;s>0&&i>0&&(c+i+1>r&&(i=Math.max(1,r-c)),o.push(n.substring(s-=i,s+i)),!((c+=i+1)>r));)i=e[a=(a+1)%e.length];return o.reverse().join(t)}}function Hit(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zit=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vh(e){if(!(t=zit.exec(e)))throw new Error("invalid format: "+e);var t;return new k8({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]})}Vh.prototype=k8.prototype;function k8(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+""}k8.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 Wit(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 Fie;function Git(e,t){var n=X2(e,t);if(!n)return e+"";var r=n[0],s=n[1],o=s-(Fie=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+X2(e,Math.max(0,t+o-1))[0]}function qL(e,t){var n=X2(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 KL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Uit,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)=>qL(e*100,t),r:qL,s:Git,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function YL(e){return e}var QL=Array.prototype.map,XL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $it(e){var t=e.grouping===void 0||e.thousands===void 0?YL:Vit(QL.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+"",o=e.numerals===void 0?YL:Hit(QL.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",i=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(m){m=Vh(m);var p=m.fill,h=m.align,g=m.sign,y=m.symbol,x=m.zero,v=m.width,b=m.comma,_=m.precision,w=m.trim,S=m.type;S==="n"?(b=!0,S="g"):KL[S]||(_===void 0&&(_=12),w=!0,S="g"),(x||p==="0"&&h==="=")&&(x=!0,p="0",h="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=y==="$"?r:/[%p]/.test(S)?a:"",N=KL[S],k=/[defgprs%]/.test(S);_=_===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function I(M){var A=C,D=E,P,F,R;if(S==="c")D=N(M)+D,M="";else{M=+M;var j=M<0||1/M<0;if(M=isNaN(M)?c:N(Math.abs(M),_),w&&(M=Wit(M)),j&&+M==0&&g!=="+"&&(j=!1),A=(j?g==="("?g:i:g==="-"||g==="("?"":g)+A,D=(S==="s"?XL[8+Fie/3]:"")+D+(j&&g==="("?")":""),k){for(P=-1,F=M.length;++PR||R>57){D=(R===46?s+M.slice(P+1):M.slice(P))+D,M=M.slice(0,P);break}}}b&&!x&&(M=t(M,1/0));var L=A.length+M.length+D.length,U=L>1)+A+M+D+U.slice(L);break;default:M=U+A+M+D;break}return o(M)}return I.toString=function(){return m+""},I}function f(m,p){var h=u((m=Vh(m),m.type="f",m)),g=Math.max(-8,Math.min(8,Math.floor(_f(p)/3)))*3,y=Math.pow(10,-g),x=XL[8+g/3];return function(v){return h(y*v)+x}}return{format:u,formatPrefix:f}}var k1,M8,Bie;qit({thousands:",",grouping:[3],currency:["$",""]});function qit(e){return k1=$it(e),M8=k1.format,Bie=k1.formatPrefix,k1}function Kit(e){return Math.max(0,-_f(Math.abs(e)))}function Yit(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_f(t)/3)))*3-_f(Math.abs(e)))}function Qit(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_f(t)-_f(e))+1}function Xit(e,t,n,r){var s=nk(e,t,n),o;switch(r=Vh(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Yit(s,a))&&(r.precision=o),Bie(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Qit(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Kit(s))&&(r.precision=o-(r.type==="%")*2);break}}return M8(r)}function o0(e){var t=e.domain;return e.ticks=function(n){var r=t();return tk(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return Xit(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,o=r.length-1,a=r[s],i=r[o],c,u,f=10;for(i0;){if(u=$ne(a,i,n),u===c)return r[s]=a,r[o]=i,t(r);if(u>0)a=Math.floor(a/u)*u,i=Math.ceil(i/u)*u;else if(u<0)a=Math.ceil(a*u)/u,i=Math.floor(i*u)/u;else break;c=u}return e},e}function Uie(){var e=E8();return e.copy=function(){return s0(e,Uie())},qo.apply(e,arguments),o0(e)}function Vie(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],o=e[r],a;return oMath.pow(e,t)}function nlt(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 eF(e){return(t,n)=>-e(-t,n)}function rlt(e){const t=e(ZL,JL),n=t.domain;let r=10,s,o;function a(){return s=nlt(r),o=tlt(r),n()[0]<0?(s=eF(s),o=eF(o),e(Zit,Jit)):e(ZL,JL),t}return t.base=function(i){return arguments.length?(r=+i,a()):r},t.domain=function(i){return arguments.length?(n(i),a()):n()},t.ticks=i=>{const c=n();let u=c[0],f=c[c.length-1];const m=f0){for(;p<=h;++p)for(g=1;gf)break;v.push(y)}}else for(;p<=h;++p)for(g=r-1;g>=1;--g)if(y=p>0?g/o(-p):g*o(p),!(yf)break;v.push(y)}v.length*2{if(i==null&&(i=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Vh(c)).precision==null&&(c.trim=!0),c=M8(c)),i===1/0)return c;const u=Math.max(1,r*i/t.ticks().length);return f=>{let m=f/o(Math.round(s(f)));return m*rn(Vie(n(),{floor:i=>o(Math.floor(s(i))),ceil:i=>o(Math.ceil(s(i)))})),t}function Hie(){const e=rlt(Bb()).domain([1,10]);return e.copy=()=>s0(e,Hie()).base(e.base()),qo.apply(e,arguments),e}function tF(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function nF(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function slt(e){var t=1,n=e(tF(t),nF(t));return n.constant=function(r){return arguments.length?e(tF(t=+r),nF(t)):t},o0(n)}function zie(){var e=slt(Bb());return e.copy=function(){return s0(e,zie()).constant(e.constant())},qo.apply(e,arguments)}function rF(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function olt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function alt(e){return e<0?-e*e:e*e}function ilt(e){var t=e(za,za),n=1;function r(){return n===1?e(za,za):n===.5?e(olt,alt):e(rF(n),rF(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},o0(t)}function T8(){var e=ilt(Bb());return e.copy=function(){return s0(e,T8()).exponent(e.exponent())},qo.apply(e,arguments),e}function llt(){return T8.apply(null,arguments).exponent(.5)}function sF(e){return Math.sign(e)*e*e}function clt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Wie(){var e=E8(),t=[0,1],n=!1,r;function s(o){var a=clt(e(o));return isNaN(a)?r:n?Math.round(a):a}return s.invert=function(o){return e.invert(sF(o))},s.domain=function(o){return arguments.length?(e.domain(o),s):e.domain()},s.range=function(o){return arguments.length?(e.range((t=Array.from(o,Lie)).map(sF)),s):t.slice()},s.rangeRound=function(o){return s.range(o).round(!0)},s.round=function(o){return arguments.length?(n=!!o,s):n},s.clamp=function(o){return arguments.length?(e.clamp(o),s):e.clamp()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return Wie(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},qo.apply(s,arguments),o0(s)}function Gie(){var e=[],t=[],n=[],r;function s(){var a=0,i=Math.max(1,t.length);for(n=new Array(i-1);++a0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(c){return arguments.length&&(o=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return $ie().domain([e,t]).range(s).unknown(o)},qo.apply(o0(a),arguments)}function qie(){var e=[.5],t=[0,1],n,r=1;function s(o){return o!=null&&o<=o?t[sm(e,o,0,r)]:n}return s.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},s.unknown=function(o){return arguments.length?(n=o,s):n},s.copy=function(){return qie().domain(e).range(t).unknown(n)},qo.apply(s,arguments)}function ult(e){return new Date(e)}function dlt(e){return e instanceof Date?+e:+new Date(+e)}function A8(e,t,n,r,s,o,a,i,c,u){var f=E8(),m=f.invert,p=f.domain,h=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),_=u("%B"),w=u("%Y");function S(C){return(c(C)"u"?r:r.gamma(n)}function wlt(e,t){if("interpolate"in t&&"interpolate"in e&&typeof t.interpolate<"u"){var n=_lt(t.interpolate);e.interpolate(n)}}var Clt=new Date(Date.UTC(2020,1,2,3,4,5)),Slt="%Y-%m-%d %H:%M";function Kie(e){var t=e.tickFormat(1,Slt)(Clt);return t==="2020-02-02 03:04"}var aF={day:rm,hour:nb,minute:eb,month:Vg,second:Pi,week:Bg,year:ba},iF={day:Fg,hour:rb,minute:tb,month:sb,second:Pi,week:Ug,year:si};function Elt(e,t){if("nice"in t&&typeof t.nice<"u"&&"nice"in e){var n=t.nice;if(typeof n=="boolean")n&&e.nice();else if(typeof n=="number")e.nice(n);else{var r=e,s=Kie(r);if(typeof n=="string")r.nice(s?iF[n]:aF[n]);else{var o=n.interval,a=n.step,i=(s?iF[o]:aF[o]).every(a);i!=null&&r.nice(i)}}}}function klt(e,t){"padding"in e&&"padding"in t&&typeof t.padding<"u"&&e.padding(t.padding),"paddingInner"in e&&"paddingInner"in t&&typeof t.paddingInner<"u"&&e.paddingInner(t.paddingInner),"paddingOuter"in e&&"paddingOuter"in t&&typeof t.paddingOuter<"u"&&e.paddingOuter(t.paddingOuter)}function Mlt(e,t){if(t.reverse){var n=e.range().slice().reverse();"padding"in e,e.range(n)}}function Tlt(e,t){"round"in t&&typeof t.round<"u"&&(t.round&&"interpolate"in t&&typeof t.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",t):"round"in e?e.round(t.round):"interpolate"in e&&t.round&&e.interpolate(jie))}function Alt(e,t){"unknown"in e&&"unknown"in t&&typeof t.unknown<"u"&&e.unknown(t.unknown)}function Nlt(e,t){if("zero"in t&&t.zero===!0){var n=e.domain(),r=n[0],s=n[1],o=s=0)&&(n[s]=e[s]);return n}function sct(e){var t=e.className,n=e.data,r=e.innerRadius,s=e.outerRadius,o=e.cornerRadius,a=e.startAngle,i=e.endAngle,c=e.padAngle,u=e.padRadius,f=e.children,m=e.innerRef,p=rct(e,nct),h=I8({innerRadius:r,outerRadius:s,cornerRadius:o,startAngle:a,endAngle:i,padAngle:c,padRadius:u});return f?T.createElement(T.Fragment,null,f({path:h})):!n&&(a==null||i==null||r==null||s==null)?(console.warn("[@visx/shape/Arc]: expected data because one of startAngle, endAngle, innerRadius, outerRadius is undefined. Bailing."),null):T.createElement("path",i5({ref:m,className:z("visx-arc",t),d:h(n)||""},p))}var oct=["className","top","left","data","centroid","innerRadius","outerRadius","cornerRadius","startAngle","endAngle","padAngle","padRadius","pieSort","pieSortValues","pieValue","children","fill"];function l5(){return l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function ict(e){var t=e.className,n=e.top,r=e.left,s=e.data,o=s===void 0?[]:s,a=e.centroid,i=e.innerRadius,c=i===void 0?0:i,u=e.outerRadius,f=e.cornerRadius,m=e.startAngle,p=e.endAngle,h=e.padAngle,g=e.padRadius,y=e.pieSort,x=e.pieSortValues,v=e.pieValue,b=e.children,_=e.fill,w=_===void 0?"":_,S=act(e,oct),C=I8({innerRadius:c,outerRadius:u,cornerRadius:f,padRadius:g}),E=rle({startAngle:m,endAngle:p,padAngle:h,value:v,sort:y,sortValues:x}),N=E(o);return b?T.createElement(T.Fragment,null,b({arcs:N,path:C,pie:E})):T.createElement(Cs,{className:"visx-pie-arcs-group",top:n,left:r},N.map(function(k,I){return T.createElement("g",{key:"pie-arc-"+I},T.createElement("path",l5({className:z("visx-pie-arc",t),d:C(k)||"",fill:w==null||typeof w=="string"?w:w(k)},S)),a?.(C.centroid(k),k))}))}var lct=["from","to","fill","className","innerRef"];function c5(){return c5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Wb(e){var t=e.from,n=t===void 0?{x:0,y:0}:t,r=e.to,s=r===void 0?{x:1,y:1}:r,o=e.fill,a=o===void 0?"transparent":o,i=e.className,c=e.innerRef,u=cct(e,lct),f=n.x===s.x||n.y===s.y;return T.createElement("line",c5({ref:c,className:z("visx-line",i),x1:n.x,y1:n.y,x2:s.x,y2:s.y,fill:a,shapeRendering:f?"crispEdges":"auto"},u))}var uct=["children","data","x","y","fill","className","curve","innerRef","defined"];function u5(){return u5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function ale(e){var t=e.children,n=e.data,r=n===void 0?[]:n,s=e.x,o=e.y,a=e.fill,i=a===void 0?"transparent":a,c=e.className,u=e.curve,f=e.innerRef,m=e.defined,p=m===void 0?function(){return!0}:m,h=dct(e,uct),g=sl({x:s,y:o,defined:p,curve:u});return t?T.createElement(T.Fragment,null,t({path:g})):T.createElement("path",u5({ref:f,className:z("visx-linepath",c),d:g(r)||"",fill:i,strokeLinecap:"round"},h))}var fct=["className","angle","radius","defined","curve","data","innerRef","children","fill"];function d5(){return d5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function pct(e){var t=e.className,n=e.angle,r=e.radius,s=e.defined,o=e.curve,a=e.data,i=a===void 0?[]:a,c=e.innerRef,u=e.children,f=e.fill,m=f===void 0?"transparent":f,p=mct(e,fct),h=sle({angle:n,radius:r,defined:s,curve:o});return u?T.createElement(T.Fragment,null,u({path:h})):T.createElement("path",d5({ref:c,className:z("visx-line-radial",t),d:h(i)||"",fill:m},p))}var hct=["children","x","x0","x1","y","y0","y1","data","defined","className","curve","innerRef"];function f5(){return f5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function yct(e){var t=e.children,n=e.x,r=e.x0,s=e.x1,o=e.y,a=e.y0,i=e.y1,c=e.data,u=c===void 0?[]:c,f=e.defined,m=f===void 0?function(){return!0}:f,p=e.className,h=e.curve,g=e.innerRef,y=gct(e,hct),x=zb({x:n,x0:r,x1:s,y:o,y0:a,y1:i,defined:m,curve:h});return t?T.createElement(T.Fragment,null,t({path:x})):T.createElement("path",f5({ref:g,className:z("visx-area",p),d:x(u)||""},y))}var xct=["x","x0","x1","y","y1","y0","yScale","data","defined","className","curve","innerRef","children"];function m5(){return m5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Hh(e){var t=e.x,n=e.x0,r=e.x1,s=e.y,o=e.y1,a=e.y0,i=e.yScale,c=e.data,u=c===void 0?[]:c,f=e.defined,m=f===void 0?function(){return!0}:f,p=e.className,h=e.curve,g=e.innerRef,y=e.children,x=vct(e,xct),v=zb({x:t,x0:n,x1:r,defined:m,curve:h});return a==null?v.y0(i.range()[0]):Pn(v.y0,a),s&&!o&&Pn(v.y1,s),o&&!s&&Pn(v.y1,o),y?T.createElement(T.Fragment,null,y({path:v})):T.createElement("path",m5({ref:g,className:z("visx-area-closed",p),d:v(u)||""},x))}var bct=["className","top","left","keys","data","curve","defined","x","x0","x1","y0","y1","value","order","offset","color","children"];function p5(){return p5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function ile(e){var t=e.className,n=e.top,r=e.left,s=e.keys,o=e.data,a=e.curve,i=e.defined,c=e.x,u=e.x0,f=e.x1,m=e.y0,p=e.y1,h=e.value,g=e.order,y=e.offset,x=e.color,v=e.children,b=_ct(e,bct),_=ole({keys:s,value:h,order:g,offset:y}),w=zb({x:c,x0:u,x1:f,y0:m,y1:p,curve:a,defined:i}),S=_(o);return v?T.createElement(T.Fragment,null,v({stacks:S,path:w,stack:_})):T.createElement(Cs,{top:n,left:r},S.map(function(C,E){return T.createElement("path",p5({className:z("visx-stack",t),key:"stack-"+E+"-"+(C.key||""),d:w(C)||"",fill:x?.(C.key,E)},b))}))}var wct=["className","top","left","keys","data","curve","defined","x","x0","x1","y0","y1","value","order","offset","color","children"];function ex(){return ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Sct(e){var t=e.className,n=e.top,r=e.left,s=e.keys,o=e.data,a=e.curve,i=e.defined,c=e.x,u=e.x0,f=e.x1,m=e.y0,p=e.y1,h=e.value,g=e.order,y=e.offset,x=e.color,v=e.children,b=Cct(e,wct);return T.createElement(ile,ex({className:t,top:n,left:r,keys:s,data:o,curve:a,defined:i,x:c,x0:u,x1:f,y0:m,y1:p,value:h,order:g,offset:y,color:x},b),v||function(_){var w=_.stacks,S=_.path;return w.map(function(C,E){return T.createElement("path",ex({className:z("visx-area-stack",t),key:"area-stack-"+E+"-"+(C.key||""),d:S(C)||"",fill:x?.(C.key,E)},b))})})}var Ect=["className","innerRef"];function h5(){return h5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function mm(e){var t=e.className,n=e.innerRef,r=kct(e,Ect);return T.createElement("rect",h5({ref:n,className:z("visx-bar",t)},r))}var Mct=["children","className","innerRef","x","y","width","height","radius","all","top","bottom","left","right","topLeft","topRight","bottomLeft","bottomRight"];function g5(){return g5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Act(e){var t=e.all,n=e.bottom,r=e.bottomLeft,s=e.bottomRight,o=e.height,a=e.left,i=e.radius,c=e.right,u=e.top,f=e.topLeft,m=e.topRight,p=e.width,h=e.x,g=e.y;m=t||u||c||m,s=t||n||c||s,r=t||n||a||r,f=t||u||a||f,i=Math.max(1,Math.min(i,Math.min(p,o)/2));var y=2*i,x=("M"+(h+i)+","+g+" h"+(p-y)+` - `+(m?"a"+i+","+i+" 0 0 1 "+i+","+i:"h"+i+"v"+i)+` - v`+(o-y)+` - `+(s?"a"+i+","+i+" 0 0 1 "+-i+","+i:"v"+i+"h"+-i)+` - h`+(y-p)+` - `+(r?"a"+i+","+i+" 0 0 1 "+-i+","+-i:"h"+-i+"v"+-i)+` - v`+(y-o)+` - `+(f?"a"+i+","+i+" 0 0 1 "+i+","+-i:"v"+-i+"h"+i)+` -z`).split(` -`).join("");return x}function Nct(e){var t=e.children,n=e.className,r=e.innerRef,s=e.x,o=e.y,a=e.width,i=e.height,c=e.radius,u=e.all,f=u===void 0?!1:u,m=e.top,p=m===void 0?!1:m,h=e.bottom,g=h===void 0?!1:h,y=e.left,x=y===void 0?!1:y,v=e.right,b=v===void 0?!1:v,_=e.topLeft,w=_===void 0?!1:_,S=e.topRight,C=S===void 0?!1:S,E=e.bottomLeft,N=E===void 0?!1:E,k=e.bottomRight,I=k===void 0?!1:k,M=Tct(e,Mct),A=Act({x:s,y:o,width:a,height:i,radius:c,all:f,top:p,bottom:g,left:x,right:b,topLeft:w,topRight:C,bottomLeft:N,bottomRight:I});return t?T.createElement(T.Fragment,null,t({path:A})):T.createElement("path",g5({ref:r,className:z("visx-bar-rounded",n),d:A},M))}function Gb(e){if("bandwidth"in e)return e.bandwidth();var t=e.range(),n=e.domain();return Math.abs(t[t.length-1]-t[0])/n.length}var Rct=["data","className","top","left","x0","x0Scale","x1Scale","yScale","color","keys","height","children"];function y5(){return y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function jct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x0,a=e.x0Scale,i=e.x1Scale,c=e.yScale,u=e.color,f=e.keys,m=e.height,p=e.children,h=Dct(e,Rct),g=Gb(i),y=t.map(function(x,v){return{index:v,x0:a(o(x)),bars:f.map(function(b,_){var w=x[b];return{index:_,key:b,value:w,width:g,x:i(b)||0,y:c(w)||0,color:u(b,_),height:m-(c(w)||0)}})}});return p?T.createElement(T.Fragment,null,p(y)):T.createElement(Cs,{className:z("visx-bar-group",n),top:r,left:s},y.map(function(x){return T.createElement(Cs,{key:"bar-group-"+x.index+"-"+x.x0,left:x.x0},x.bars.map(function(v){return T.createElement(mm,y5({key:"bar-group-bar-"+x.index+"-"+v.index+"-"+v.value+"-"+v.key,x:v.x,y:v.y,width:v.width,height:v.height,fill:v.color},h))}))}))}var Ict=["data","className","top","left","x","y0","y0Scale","y1Scale","xScale","color","keys","width","children"];function x5(){return x5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Oct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x,a=o===void 0?function(){return 0}:o,i=e.y0,c=e.y0Scale,u=e.y1Scale,f=e.xScale,m=e.color,p=e.keys;e.width;var h=e.children,g=Pct(e,Ict),y=Gb(u),x=t.map(function(v,b){return{index:b,y0:c(i(v))||0,bars:p.map(function(_,w){var S=v[_];return{index:w,key:_,value:S,height:y,x:a(S)||0,y:u(_)||0,color:m(_,w),width:f(S)||0}})}});return h?T.createElement(T.Fragment,null,h(x)):T.createElement(Cs,{className:z("visx-bar-group-horizontal",n),top:r,left:s},x.map(function(v){return T.createElement(Cs,{key:"bar-group-"+v.index+"-"+v.y0,top:v.y0},v.bars.map(function(b){return T.createElement(mm,x5({key:"bar-group-bar-"+v.index+"-"+b.index+"-"+b.value+"-"+b.key,x:b.x,y:b.y,width:b.width,height:b.height,fill:b.color},g))}))}))}function Ko(e){return typeof e?.x=="number"?e?.x:0}function Yo(e){return typeof e?.y=="number"?e?.y:0}function Qo(e){return e?.source}function Xo(e){return e?.target}function lle(e){return e?.[0]}function cle(e){return e?.[1]}var Lct=["data","className","top","left","x","y0","y1","xScale","yScale","color","keys","value","order","offset","children"];function v5(){return v5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Bct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x,a=e.y0,i=a===void 0?lle:a,c=e.y1,u=c===void 0?cle:c,f=e.xScale,m=e.yScale,p=e.color,h=e.keys,g=e.value,y=e.order,x=e.offset,v=e.children,b=Fct(e,Lct),_=zN();h&&_.keys(h),g&&Pn(_.value,g),y&&_.order(Vb(y)),x&&_.offset(Hb(x));var w=_(t),S=Gb(f),C=w.map(function(E,N){var k=E.key;return{index:N,key:k,bars:E.map(function(I,M){var A=(m(i(I))||0)-(m(u(I))||0),D=m(u(I)),P="bandwidth"in f?f(o(I.data)):Math.max((f(o(I.data))||0)-S/2);return{bar:I,key:k,index:M,height:A,width:S,x:P||0,y:D||0,color:p(E.key,M)}})}});return v?T.createElement(T.Fragment,null,v(C)):T.createElement(Cs,{className:z("visx-bar-stack",n),top:r,left:s},C.map(function(E){return E.bars.map(function(N){return T.createElement(mm,v5({key:"bar-stack-"+E.index+"-"+N.index,x:N.x,y:N.y,height:N.height,width:N.width,fill:N.color},b))})}))}var Uct=["data","className","top","left","y","x0","x1","xScale","yScale","color","keys","value","order","offset","children"];function b5(){return b5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Hct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.y,a=e.x0,i=a===void 0?lle:a,c=e.x1,u=c===void 0?cle:c,f=e.xScale,m=e.yScale,p=e.color,h=e.keys,g=e.value,y=e.order,x=e.offset,v=e.children,b=Vct(e,Uct),_=zN();h&&_.keys(h),g&&Pn(_.value,g),y&&_.order(Vb(y)),x&&_.offset(Hb(x));var w=_(t),S=Gb(m),C=w.map(function(E,N){var k=E.key;return{index:N,key:k,bars:E.map(function(I,M){var A=(f(u(I))||0)-(f(i(I))||0),D=f(i(I)),P="bandwidth"in m?m(o(I.data)):Math.max((m(o(I.data))||0)-A/2);return{bar:I,key:k,index:M,height:S,width:A,x:D||0,y:P||0,color:p(E.key,M)}})}});return v?T.createElement(T.Fragment,null,v(C)):T.createElement(Cs,{className:z("visx-bar-stack-horizontal",n),top:r,left:s},C.map(function(E){return E.bars.map(function(N){return T.createElement(mm,b5({key:"bar-stack-"+E.index+"-"+N.index,x:N.x,y:N.y,height:N.height,width:N.width,fill:N.color},b))})}))}var ule=function(t){return Math.PI/180*t},zct=["className","children","data","innerRef","path","x","y","source","target"];function _5(){return _5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function dle(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=mot();return a.x(r),a.y(s),a.source(t),a.target(n),a(o)}}function Gct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.x,i=a===void 0?Yo:a,c=e.y,u=c===void 0?Ko:c,f=e.source,m=f===void 0?Qo:f,p=e.target,h=p===void 0?Xo:p,g=Wct(e,zct),y=o||dle({source:m,target:h,x:i,y:u});return n?T.createElement(T.Fragment,null,n({path:y})):T.createElement("path",_5({ref:s,className:z("visx-link visx-link-horizontal-diagonal",t),d:y(r)||""},g))}var $ct=["className","children","data","innerRef","path","x","y","source","target"];function w5(){return w5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function fle(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=pot();return a.x(r),a.y(s),a.source(t),a.target(n),a(o)}}function Kct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.x,i=a===void 0?Ko:a,c=e.y,u=c===void 0?Yo:c,f=e.source,m=f===void 0?Qo:f,p=e.target,h=p===void 0?Xo:p,g=qct(e,$ct),y=o||fle({source:m,target:h,x:i,y:u});return n?T.createElement(T.Fragment,null,n({path:y})):T.createElement("path",w5({ref:s,className:z("visx-link visx-link-vertical-diagonal",t),d:y(r)||""},g))}var Yct=["className","children","data","innerRef","path","angle","radius","source","target"];function C5(){return C5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function mle(e){var t=e.source,n=e.target,r=e.angle,s=e.radius;return function(o){var a=hot();return a.angle(r),a.radius(s),a.source(t),a.target(n),a(o)}}function Xct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.angle,i=a===void 0?Ko:a,c=e.radius,u=c===void 0?Yo:c,f=e.source,m=f===void 0?Qo:f,p=e.target,h=p===void 0?Xo:p,g=Qct(e,Yct),y=o||mle({source:m,target:h,angle:i,radius:u});return n?T.createElement(T.Fragment,null,n({path:y})):T.createElement("path",C5({ref:s,className:z("visx-link visx-link-radial-diagonal",t),d:y(r)||""},g))}var Zct=["className","children","data","innerRef","path","percent","x","y","source","target"];function S5(){return S5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function ple(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=m-u,g=p-f,y=o*(h+g),x=o*(g-h),v=ho();return v.moveTo(u,f),v.bezierCurveTo(u+y,f+x,m+x,p-y,m,p),v.toString()}}function eut(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?Yo:c,f=e.y,m=f===void 0?Ko:f,p=e.source,h=p===void 0?Qo:p,g=e.target,y=g===void 0?Xo:g,x=Jct(e,Zct),v=o||ple({source:h,target:y,x:u,y:m,percent:i});return n?T.createElement(T.Fragment,null,n({path:v})):T.createElement("path",S5({ref:s,className:z("visx-link visx-link-horizontal-curve",t),d:v(r)||""},x))}var tut=["className","children","data","innerRef","path","percent","x","y","source","target"];function E5(){return E5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function hle(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=m-u,g=p-f,y=o*(h+g),x=o*(g-h),v=ho();return v.moveTo(u,f),v.bezierCurveTo(u+y,f+x,m+x,p-y,m,p),v.toString()}}function rut(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?Ko:c,f=e.y,m=f===void 0?Yo:f,p=e.source,h=p===void 0?Qo:p,g=e.target,y=g===void 0?Xo:g,x=nut(e,tut),v=o||hle({source:h,target:y,x:u,y:m,percent:i});return n?T.createElement(T.Fragment,null,n({path:v})):T.createElement("path",E5({ref:s,className:z("visx-link visx-link-vertical-curve",t),d:v(r)||""},x))}var sut=["className","children","data","innerRef","path","percent","x","y","source","target"];function k5(){return k5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function gle(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i)-Math.PI/2,f=s(i),m=r(c)-Math.PI/2,p=s(c),h=Math.cos(u),g=Math.sin(u),y=Math.cos(m),x=Math.sin(m),v=f*h,b=f*g,_=p*y,w=p*x,S=_-v,C=w-b,E=o*(S+C),N=o*(C-S),k=ho();return k.moveTo(v,b),k.bezierCurveTo(v+E,b+N,_+N,w-E,_,w),k.toString()}}function aut(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?Ko:c,f=e.y,m=f===void 0?Yo:f,p=e.source,h=p===void 0?Qo:p,g=e.target,y=g===void 0?Xo:g,x=out(e,sut),v=o||gle({source:h,target:y,x:u,y:m,percent:i});return n?T.createElement(T.Fragment,null,n({path:v})):T.createElement("path",k5({ref:s,className:z("visx-link visx-link-radial-curve",t),d:v(r)||""},x))}var iut=["className","children","innerRef","data","path","x","y","source","target"];function M5(){return M5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function yle(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=ho();return p.moveTo(c,u),p.lineTo(f,m),p.toString()}}function cut(e){var t=e.className,n=e.children,r=e.innerRef,s=e.data,o=e.path,a=e.x,i=a===void 0?Yo:a,c=e.y,u=c===void 0?Ko:c,f=e.source,m=f===void 0?Qo:f,p=e.target,h=p===void 0?Xo:p,g=lut(e,iut),y=o||yle({source:m,target:h,x:i,y:u});return n?T.createElement(T.Fragment,null,n({path:y})):T.createElement("path",M5({ref:r,className:z("visx-link visx-link-horizontal-line",t),d:y(s)||""},g))}var uut=["className","innerRef","data","path","x","y","source","target","children"];function T5(){return T5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function xle(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=ho();return p.moveTo(c,u),p.lineTo(f,m),p.toString()}}function fut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?Ko:o,i=e.y,c=i===void 0?Yo:i,u=e.source,f=u===void 0?Qo:u,m=e.target,p=m===void 0?Xo:m,h=e.children,g=dut(e,uut),y=s||xle({source:f,target:p,x:a,y:c});return h?T.createElement(T.Fragment,null,h({path:y})):T.createElement("path",T5({ref:n,className:z("visx-link visx-link-vertical-line",t),d:y(r)||""},g))}var mut=["className","innerRef","data","path","x","y","source","target","children"];function A5(){return A5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function vle(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a)-Math.PI/2,u=s(a),f=r(i)-Math.PI/2,m=s(i),p=Math.cos(c),h=Math.sin(c),g=Math.cos(f),y=Math.sin(f),x=ho();return x.moveTo(u*p,u*h),x.lineTo(m*g,m*y),x.toString()}}function hut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?Ko:o,i=e.y,c=i===void 0?Yo:i,u=e.source,f=u===void 0?Qo:u,m=e.target,p=m===void 0?Xo:m,h=e.children,g=put(e,mut),y=s||vle({source:f,target:p,x:a,y:c});return h?T.createElement(T.Fragment,null,h({path:y})):T.createElement("path",A5({ref:n,className:z("visx-link visx-link-radial-line",t),d:y(r)||""},g))}var gut=["className","innerRef","data","path","percent","x","y","source","target","children"];function N5(){return N5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function ble(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=ho();return h.moveTo(u,f),h.lineTo(u+(m-u)*o,f),h.lineTo(u+(m-u)*o,p),h.lineTo(m,p),h.toString()}}function xut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.percent,a=o===void 0?.5:o,i=e.x,c=i===void 0?Yo:i,u=e.y,f=u===void 0?Ko:u,m=e.source,p=m===void 0?Qo:m,h=e.target,g=h===void 0?Xo:h,y=e.children,x=yut(e,gut),v=s||ble({source:p,target:g,x:c,y:f,percent:a});return y?T.createElement(T.Fragment,null,y({path:v})):T.createElement("path",N5({ref:n,className:z("visx-link visx-link-horizontal-step",t),d:v(r)||""},x))}var vut=["className","innerRef","data","path","percent","x","y","source","target","children"];function R5(){return R5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function _le(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=ho();return h.moveTo(u,f),h.lineTo(u,f+(p-f)*o),h.lineTo(m,f+(p-f)*o),h.lineTo(m,p),h.toString()}}function _ut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.percent,a=o===void 0?.5:o,i=e.x,c=i===void 0?Ko:i,u=e.y,f=u===void 0?Yo:u,m=e.source,p=m===void 0?Qo:m,h=e.target,g=h===void 0?Xo:h,y=e.children,x=but(e,vut),v=s||_le({source:p,target:g,x:c,y:f,percent:a});return y?T.createElement(T.Fragment,null,y({path:v})):T.createElement("path",R5({ref:n,className:z("visx-link visx-link-vertical-step",t),d:v(r)||""},x))}var wut=["className","innerRef","data","path","x","y","source","target","children"];function D5(){return D5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function wle(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=c-Math.PI/2,h=u,g=f-Math.PI/2,y=m,x=Math.cos(p),v=Math.sin(p),b=Math.cos(g),_=Math.sin(g),w=Math.abs(g-p)>Math.PI?g<=p:g>p;return` - M`+h*x+","+h*v+` - A`+h+","+h+",0,0,"+(w?1:0)+","+h*b+","+h*_+` - L`+y*b+","+y*_+` - `}}function Sut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?Ko:o,i=e.y,c=i===void 0?Yo:i,u=e.source,f=u===void 0?Qo:u,m=e.target,p=m===void 0?Xo:m,h=e.children,g=Cut(e,wut),y=s||wle({source:f,target:p,x:a,y:c});return h?T.createElement(T.Fragment,null,h({path:y})):T.createElement("path",D5({ref:n,className:z("visx-link visx-link-radial-step",t),d:y(r)||""},g))}var Eut=["sides","size","center","rotate","className","children","innerRef","points"];function j5(){return j5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}var Cle={x:0,y:0},Sle=function(t){var n=t.sides,r=n===void 0?4:n,s=t.size,o=s===void 0?25:s,a=t.center,i=a===void 0?Cle:a,c=t.rotate,u=c===void 0?0:c,f=t.side,m=360/r*f-u,p=ule(m);return{x:i.x+o*Math.cos(p),y:i.y+o*Math.sin(p)}},Ele=function(t){var n=t.sides,r=t.size,s=t.center,o=t.rotate;return new Array(n).fill(0).map(function(a,i){return Sle({sides:n,size:r,center:s,rotate:o,side:i})})};function Mut(e){var t=e.sides,n=t===void 0?4:t,r=e.size,s=r===void 0?25:r,o=e.center,a=o===void 0?Cle:o,i=e.rotate,c=i===void 0?0:i,u=e.className,f=e.children,m=e.innerRef,p=e.points,h=kut(e,Eut),g=p||Ele({sides:n,size:s,center:a,rotate:c}).map(function(y){var x=y.x,v=y.y;return[x,v]});return f?T.createElement(T.Fragment,null,f({points:g})):T.createElement("polygon",j5({ref:m,className:z("visx-polygon",u),points:g.join(" ")},h))}var Tut=["className","innerRef"];function I5(){return I5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Nut(e){var t=e.className,n=e.innerRef,r=Aut(e,Tut);return T.createElement("circle",I5({ref:n,className:z("visx-circle",t)},r))}var lF="http://www.w3.org/2000/svg";function Rut(e){var t=document.getElementById(e);if(!t){var n=document.createElementNS(lF,"svg");n.setAttribute("aria-hidden","true"),n.style.opacity="0",n.style.width="0",n.style.height="0",n.style.position="absolute",n.style.top="-100%",n.style.left="-100%",n.style.pointerEvents="none",t=document.createElementNS(lF,"path"),t.setAttribute("id",e),n.appendChild(t),document.body.appendChild(n)}return t}var Dut="__visx_splitpath_svg_path_measurement_id",cF=function(){return!0};function jut(e){var t=e.path,n=e.pointsInSegments,r=e.segmentation,s=r===void 0?"x":r,o=e.sampleRate,a=o===void 0?1:o;try{var i=Rut(Dut);i.setAttribute("d",t);var c=i.getTotalLength(),u=n.length,f=n.map(function(){return[]});if(s==="x"||s==="y")for(var m=n.map(function(D){var P;return(P=D.find(function(F){return typeof F[s]=="number"}))==null?void 0:P[s]}),p=i.getPointAtLength(0),h=i.getPointAtLength(c),g=h[s]>p[s],y=g?m.map(function(D){return typeof D>"u"?cF:function(P){return P>=D}}):m.map(function(D){return typeof D>"u"?cF:function(P){return P<=D}}),x=0,v=0;v<=c;v+=a){for(var b=i.getPointAtLength(v),_=b[s];x=E[I+1];)I+=1;f[I].push(A)}}return f}catch{return[]}}function P5(){return P5=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"?function(){return c}:c,y=typeof u=="number"||typeof u>"u"?function(){return u}:u;return i.map(function(x){return x.map(function(v,b){return{x:g(v,b,x),y:y(v,b,x)}})})},[c,u,i]),p=d.useMemo(function(){var g=sl({x:c,y:u,defined:s,curve:r});return g(i.flat())||""},[c,u,s,r,i]),h=d.useMemo(function(){return jut({path:p,segmentation:o,pointsInSegments:m,sampleRate:a})},[p,o,m,a]);return T.createElement("g",null,h.map(function(g,y){return t?T.createElement(T.Fragment,{key:y},t({index:y,segment:g,styles:f[y]||f[y%f.length]})):T.createElement(ale,P5({key:y,className:n,data:g,x:Iut,y:Put},f[y]||f[y%f.length]))}))}kle.propTypes={segments:He.arrayOf(He.array).isRequired,styles:He.array.isRequired,children:He.func,className:He.string};const Out=Object.freeze(Object.defineProperty({__proto__:null,Arc:sct,Area:yct,AreaClosed:Hh,AreaStack:Sct,Bar:mm,BarGroup:jct,BarGroupHorizontal:Oct,BarRounded:Nct,BarStack:Bct,BarStackHorizontal:Hct,Circle:Nut,Line:Wb,LinePath:ale,LineRadial:pct,LinkHorizontal:Gct,LinkHorizontalCurve:eut,LinkHorizontalLine:cut,LinkHorizontalStep:xut,LinkRadial:Xct,LinkRadialCurve:aut,LinkRadialLine:hut,LinkRadialStep:Sut,LinkVertical:Kct,LinkVerticalCurve:rut,LinkVerticalLine:fut,LinkVerticalStep:_ut,Pie:ict,Polygon:Mut,STACK_OFFSETS:J2,STACK_OFFSET_NAMES:tct,STACK_ORDERS:Z2,STACK_ORDER_NAMES:ect,SplitLinePath:kle,Stack:ile,arc:I8,area:zb,degreesToRadians:ule,getPoint:Sle,getPoints:Ele,line:sl,pathHorizontalCurve:ple,pathHorizontalDiagonal:dle,pathHorizontalLine:yle,pathHorizontalStep:ble,pathRadialCurve:gle,pathRadialDiagonal:mle,pathRadialLine:vle,pathRadialStep:wle,pathVerticalCurve:hle,pathVerticalDiagonal:fle,pathVerticalLine:xle,pathVerticalStep:_le,pie:rle,radialLine:sle,stack:ole,stackOffset:Hb,stackOrder:Vb},Symbol.toStringTag,{value:"Module"}));var PC,uF;function Lut(){if(uF)return PC;uF=1,PC=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var a=n(r,s,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+r.length,a[1]),post:o.slice(a[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var a,i,c,u,f,m=o.indexOf(r),p=o.indexOf(s,m+1),h=m;if(m>=0&&p>0){for(a=[],c=o.length;h>=0&&!f;)h==m?(a.push(h),m=o.indexOf(r,h+1)):a.length==1?f=[a.pop(),p]:(i=a.pop(),i=0?m:p;a.length&&(f=[c,u])}return f}return PC}var OC,dF;function Fut(){if(dF)return OC;dF=1,OC=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var a=n(r,s,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+r.length,a[1]),post:o.slice(a[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var a,i,c,u,f,m=o.indexOf(r),p=o.indexOf(s,m+1),h=m;if(m>=0&&p>0){if(r===s)return[m,p];for(a=[],c=o.length;h>=0&&!f;)h==m?(a.push(h),m=o.indexOf(r,h+1)):a.length==1?f=[a.pop(),p]:(i=a.pop(),i=0?m:p;a.length&&(f=[c,u])}return f}return OC}var LC,fF;function But(){if(fF)return LC;fF=1;var e=Fut();LC=t;function t(s,o,a){var i=s;return n(s,o).reduce(function(c,u){return c.replace(u.functionIdentifier+"("+u.matches.body+")",r(u.matches.body,u.functionIdentifier,a,i,o))},s)}function n(s,o){var a=[],i=typeof o=="string"?new RegExp("\\b("+o+")\\("):o;do{var c=i.exec(s);if(!c)return a;if(c[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+o);var u=c[1],f=c.index,m=e("(",")",s.substring(f));if(!m||m.start!==c[0].length-1)throw new SyntaxError(u+"(): missing closing ')' in the value '"+s+"'");a.push({matches:m,functionIdentifier:u}),s=m.post}while(i.test(s));return a}function r(s,o,a,i,c){return a(t(s,c,a),o,i)}return LC}var FC,mF;function Uut(){if(mF)return FC;mF=1;var e=function(t){this.value=t};return e.math={isDegree:!0,acos:function(t){return e.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,n){return t+n},asin:function(t){return e.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return e.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,n){var r=1,s=t-n,o=n;om.length-2?m.length-1:b.length-N;C>0;C--)if(m[C]!==void 0)for(E=0;E0&&Ms)i.push(n);else{for(;s>=o&&!f||f&&o"u"?n[n.length-1].value.push(a[c]):n[n.length-1].value=a[c].value(n[n.length-1].value);else if(a[c].type===7)typeof n[n.length-1].type>"u"?n[n.length-1].value.push(a[c]):n[n.length-1].value=a[c].value(n[n.length-1].value);else if(a[c].type===8){for(var u=[],f=0;f"u"?(s.value=s.concat(r),s.value.push(a[c]),n.push(s)):typeof r.type>"u"?(r.unshift(s),r.push(a[c]),n.push(r)):n.push({type:1,value:a[c].value(s.value,r.value)})):a[c].type===2||a[c].type===9?(r=n.pop(),s=n.pop(),typeof s.type>"u"?(s=s.concat(r),s.push(a[c]),n.push(s)):typeof r.type>"u"?(r.unshift(s),r.push(a[c]),n.push(r)):n.push({type:1,value:a[c].value(s.value,r.value)})):a[c].type===12?(r=n.pop(),typeof r.type<"u"&&(r=[r]),s=n.pop(),o=n.pop(),n.push({type:1,value:a[c].value(o.value,s.value,new e(r))})):a[c].type===13&&(i?n.push({value:t[a[c].value],type:3}):n.push([a[c]]));if(n.length>1)throw new e.Exception("Uncaught Syntax error");return n[0].value>1e15?"Infinity":parseFloat(n[0].value.toFixed(15))},e.eval=function(t,n,r){return typeof n>"u"?this.lex(t).toPostfix().postfixEval():typeof r>"u"?typeof n.length<"u"?this.lex(t,n).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(n):this.lex(t,n).toPostfix().postfixEval(r)},VC=e,VC}var HC,yF;function Wut(){if(yF)return HC;yF=1;var e=zut();return e.prototype.formulaEval=function(){for(var t,n,r,s=[],o=this.value,a=0;a"+n.value+""+o[a].show+""+t.value+"",type:10}):s.push({value:(n.type!=1?"(":"")+n.value+(n.type!=1?")":"")+""+t.value+"",type:1})):o[a].type===2||o[a].type===9?(t=s.pop(),n=s.pop(),s.push({value:(n.type!=1?"(":"")+n.value+(n.type!=1?")":"")+o[a].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:o[a].type})):o[a].type===12&&(t=s.pop(),n=s.pop(),r=s.pop(),s.push({value:o[a].show+"("+r.value+","+n.value+","+t.value+")",type:12}));return s[0].value},HC=e,HC}var zC,xF;function Gut(){if(xF)return zC;xF=1;var e=Lut(),t=But(),n=Wut(),r=100,s=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,o;zC=a;function a(c,u){o=0,u=Math.pow(10,u===void 0?5:u),c=c.replace(/\n+/g," ");function f(p,h,g){if(o++>r)throw o=0,new Error("Call stack overflow for "+g);if(p==="")throw new Error(h+"(): '"+g+"' must contain a non-whitespace string");p=m(p,g);var y=i(p);if(y.length>1||p.indexOf("var(")>-1)return h+"("+p+")";var x=y[0]||"";x==="%"&&(p=p.replace(/\b[0-9\.]+%/g,function(_){return parseFloat(_.slice(0,-1))*.01}));var v=p.replace(new RegExp(x,"gi"),""),b;try{b=n.eval(v)}catch{return h+"("+p+")"}return x==="%"&&(b*=100),(h.length||x==="%")&&(b=Math.round(b*u)/u),b+=x,b}function m(p,h){p=p.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var g="",y=p,x;x=s.exec(y);){x[0].index>0&&(g+=y.substring(0,x[0].index));var v=e("(",")",y.substring([0].index));if(v.body==="")throw new Error("'"+p+"' must contain a non-whitespace string");var b=f(v.body,"",h);g+=v.pre+b,y=v.post}return g+y}return t(c,/((?:\-[a-z]+\-)?calc)\(/,f)}function i(c){for(var u=[],f=[],m=/[\.0-9]([%a-z]+)/gi,p=m.exec(c);p;)!p||!p[1]||(f.indexOf(p[1].toLowerCase())===-1&&(u.push(p[1]),f.push(p[1].toLowerCase())),p=m.exec(c));return u}return zC}var $ut=Gut();const WC=uo($ut);var GC,vF;function qut(){if(vF)return GC;vF=1;var e=typeof rd=="object"&&rd&&rd.Object===Object&&rd;return GC=e,GC}var $C,bF;function P8(){if(bF)return $C;bF=1;var e=qut(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return $C=n,$C}var qC,_F;function Mle(){if(_F)return qC;_F=1;var e=P8(),t=e.Symbol;return qC=t,qC}var KC,wF;function Kut(){if(wF)return KC;wF=1;var e=Mle(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var i=n.call(a,s),c=a[s];try{a[s]=void 0;var u=!0}catch{}var f=r.call(a);return u&&(i?a[s]=c:delete a[s]),f}return KC=o,KC}var YC,CF;function Yut(){if(CF)return YC;CF=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return YC=n,YC}var QC,SF;function Qut(){if(SF)return QC;SF=1;var e=Mle(),t=Kut(),n=Yut(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(i){return i==null?i===void 0?s:r:o&&o in Object(i)?t(i):n(i)}return QC=a,QC}var XC,EF;function Tle(){if(EF)return XC;EF=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return XC=e,XC}var ZC,kF;function Xut(){if(kF)return ZC;kF=1;var e=Qut(),t=Tle(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(i){if(!t(i))return!1;var c=e(i);return c==r||c==s||c==n||c==o}return ZC=a,ZC}var JC,MF;function Zut(){if(MF)return JC;MF=1;var e=P8(),t=e["__core-js_shared__"];return JC=t,JC}var eS,TF;function Jut(){if(TF)return eS;TF=1;var e=Zut(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return eS=n,eS}var tS,AF;function edt(){if(AF)return tS;AF=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return tS=n,tS}var nS,NF;function tdt(){if(NF)return nS;NF=1;var e=Xut(),t=Jut(),n=Tle(),r=edt(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,i=Object.prototype,c=a.toString,u=i.hasOwnProperty,f=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(p){if(!n(p)||t(p))return!1;var h=e(p)?f:o;return h.test(r(p))}return nS=m,nS}var rS,RF;function ndt(){if(RF)return rS;RF=1;function e(t,n){return t?.[n]}return rS=e,rS}var sS,DF;function Ale(){if(DF)return sS;DF=1;var e=tdt(),t=ndt();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return sS=n,sS}var oS,jF;function $b(){if(jF)return oS;jF=1;var e=Ale(),t=e(Object,"create");return oS=t,oS}var aS,IF;function rdt(){if(IF)return aS;IF=1;var e=$b();function t(){this.__data__=e?e(null):{},this.size=0}return aS=t,aS}var iS,PF;function sdt(){if(PF)return iS;PF=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return iS=e,iS}var lS,OF;function odt(){if(OF)return lS;OF=1;var e=$b(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var i=a[o];return i===t?void 0:i}return r.call(a,o)?a[o]:void 0}return lS=s,lS}var cS,LF;function adt(){if(LF)return cS;LF=1;var e=$b(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return cS=r,cS}var uS,FF;function idt(){if(FF)return uS;FF=1;var e=$b(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return uS=n,uS}var dS,BF;function ldt(){if(BF)return dS;BF=1;var e=rdt(),t=sdt(),n=odt(),r=adt(),s=idt();function o(a){var i=-1,c=a==null?0:a.length;for(this.clear();++i-1}return yS=t,yS}var xS,$F;function pdt(){if($F)return xS;$F=1;var e=qb();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return xS=t,xS}var vS,qF;function hdt(){if(qF)return vS;qF=1;var e=cdt(),t=ddt(),n=fdt(),r=mdt(),s=pdt();function o(a){var i=-1,c=a==null?0:a.length;for(this.clear();++i0){var I=C[0].width||1,M=s==="shrink-only"?Math.min(a/I,1):a/I,A=M,D=y-M*y,P=v-A*v;k.push("matrix("+M+", 0, 0, "+A+", "+D+", "+P+")")}return o&&k.push("rotate("+o+", "+y+", "+v+")"),k.length>0?k.join(" "):""},[b,y,v,a,s,C,o]);return{wordsByLines:C,startDy:E,transform:N}}var Ndt=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function L5(){return L5=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?T.createElement("text",L5({ref:c,transform:b},m,{textAnchor:a}),x.map(function(_,w){return T.createElement("tspan",{key:w,x:h,dy:w===0?v:f},_.words.join(" "))})):null)}const jdt=Object.freeze(Object.defineProperty({__proto__:null,Text:Yb,getStringWidth:O5,useText:Nle},Symbol.toStringTag,{value:"Module"}));var eo={top:"top",left:"left",bottom:"bottom"};function Idt(e){var t=e.labelOffset,n=e.labelProps,r=e.orientation,s=e.range,o=e.tickLabelFontSize,a=e.tickLength,i=r===eo.left||r===eo.top?-1:1,c,u,f;if(r===eo.top||r===eo.bottom){var m=r===eo.bottom&&typeof n.fontSize=="number"?n.fontSize:0;c=(Number(s[0])+Number(s[s.length-1]))/2,u=i*(a+t+o+m)}else c=i*((Number(s[0])+Number(s[s.length-1]))/2),u=-(a+t),f="rotate("+i*90+")";return{x:c,y:u,transform:f}}function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(u[m]=i[m]);return u}function a(i){var c=i.from,u=c===void 0?{x:0,y:0}:c,f=i.to,m=f===void 0?{x:1,y:1}:f,p=i.fill,h=p===void 0?"transparent":p,g=i.className,y=i.innerRef,x=o(i,n),v=u.x===m.x||u.y===m.y;return e.default.createElement("line",s({ref:y,className:(0,t.default)("visx-line",g),x1:u.x,y1:u.y,x2:m.x,y2:m.y,fill:h,shapeRendering:v?"crispEdges":"auto"},x))}return T1}var Gdt=Rle();const Dle=uo(Gdt);function jle(e){return"bandwidth"in e?e.bandwidth():0}var $dt=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function U5(){return U5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function wu(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.scale,a=e.width,i=e.stroke,c=i===void 0?"#eaf0f6":i,u=e.strokeWidth,f=u===void 0?1:u,m=e.strokeDasharray,p=e.className,h=e.children,g=e.numTicks,y=g===void 0?10:g,x=e.lineStyle,v=e.offset,b=e.tickValues,_=qdt(e,$dt),w=b??Ub(o,y),S=(v??0)+jle(o)/2,C=w.map(function(E,N){var k,I=((k=i0(o(E)))!=null?k:0)+S;return{index:N,from:new ii({x:0,y:I}),to:new ii({x:a,y:I})}});return T.createElement(Cs,{className:z("visx-rows",p),top:n,left:s},h?h({lines:C}):C.map(function(E){var N=E.from,k=E.to,I=E.index;return T.createElement(Dle,U5({key:"row-line-"+I,from:N,to:k,stroke:c,strokeWidth:f,strokeDasharray:m,style:x},_))}))}wu.propTypes={tickValues:He.array,width:He.number.isRequired};var Kdt=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function V5(){return V5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Qb(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.scale,a=e.height,i=e.stroke,c=i===void 0?"#eaf0f6":i,u=e.strokeWidth,f=u===void 0?1:u,m=e.strokeDasharray,p=e.className,h=e.numTicks,g=h===void 0?10:h,y=e.lineStyle,x=e.offset,v=e.tickValues,b=e.children,_=Ydt(e,Kdt),w=v??Ub(o,g),S=(x??0)+jle(o)/2,C=w.map(function(E,N){var k,I=((k=i0(o(E)))!=null?k:0)+S;return{index:N,from:new ii({x:I,y:0}),to:new ii({x:I,y:a})}});return T.createElement(Cs,{className:z("visx-columns",p),top:n,left:s},b?b({lines:C}):C.map(function(E){var N=E.from,k=E.to,I=E.index;return T.createElement(Dle,V5({key:"column-line-"+I,from:N,to:k,stroke:c,strokeWidth:f,strokeDasharray:m,style:y},_))}))}Qb.propTypes={tickValues:He.array,height:He.number.isRequired};const $s=e=>e,Qdt=(e,t,n,r)=>`M${e},${t}h${n}v${r}h${-n}Z`,Xdt=(e,t,n)=>`M${e},${t}L${e},${n}`,Zdt=(e,t,n)=>`M${e},${t}L${n},${t}`,Ile=({xScale:e,yScale:t,history:n})=>{const r=d.useMemo(()=>{if(n.length<2)return 4;let a=1/0;for(let i=0;i{const a={blue:{wicks:[],bodies:[],dojis:[]},red:{wicks:[],bodies:[],dojis:[]},wickStrokeWidth:$s(Math.max(.1,Math.min(r,1))),dojiStrokeWidth:$s(Math.max(.5,Math.min(r*.3,1.5)))};return n.forEach(i=>{const c=$s(e(Cn(i))??0),u=$s(t(i.high)??0),f=$s(t(i.low)??0),m=$s(t(i.open)??0),p=$s(t(i.close)??0),h=i.close>=i.open?"blue":"red",g=a[h];g.wicks.push(Xdt(c,u,f));const y=$s(Math.abs(p-m));y<1?g.dojis.push(Zdt($s(c-r/2),p,$s(c+r/2))):g.bodies.push(Qdt($s(c-r/2),$s(Math.min(m,p)),$s(r),y))}),a},[n,e,t,r]),o=(a,i)=>{const c=tr[a];return l.jsxs(l.Fragment,{children:[i.wicks.length&&l.jsx("path",{d:i.wicks.join(""),stroke:c,strokeWidth:s.wickStrokeWidth,opacity:.5,fill:"none"}),i.bodies.length&&l.jsx("path",{d:i.bodies.join(""),fill:c}),i.dojis.length&&l.jsx("path",{d:i.dojis.join(""),stroke:c,strokeWidth:s.dojiStrokeWidth,fill:"none"})]})};return l.jsxs("svg",{children:[o("blue",s.blue),o("red",s.red)]})};Ile.displayName="CandlestickLine";const l0=200,Jdt={top:24,right:8,bottom:24,left:16},eft="#1FB8CD",tft="#B4413C",nft=[eft,"#FFC185",tft,"#ECEBD5","#5D878F","#DB4545","#D2BA4C","#964325"],rft="#20808D",sft="#A84B2F",oft=[rft,sft,"#1B474D","#BCE2E7","#944454","#FFC553","#848456","#6E522B"],aft={tickColor:"#2F3031",axisColor:"#2F3031",textColor:"#aaaaaa",colorSchema:nft},ift={tickColor:"#D9D9D0",axisColor:"#D9D9D0",textColor:"#A0A0A0",colorSchema:oft},lft={time:e=>new Date(e),linear:e=>+e,band:e=>e,ordinal:e=>e,log:e=>+e,point:e=>e};function DS(e,t){if(!e)return r=>null;if(t===void 0)return r=>r[e];const n=lft[t]||(r=>r);return r=>n(r[e])}function $u(e,t){return typeof t=="function"?t(e):typeof t=="string"?t.replace("%s",e):e instanceof Date?B$e(e):String(e)}const ao={time:fm,linear:Bi,band:N8,log:R8,point:a0,ordinal:j8},lB=["band","ordinal","point"];function cft({width:e,height:t,margin:n,hasAxis:r,maxYLabelWidth:s=0}){const o=n.left+(r?s+15:0),a=e-n.right-n.left,i=t-n.bottom,c=n.top,u=[o,a],f=[i,c],m=Math.max(0,a-o);return{innerHeight:Math.max(0,i-c),innerWidth:m,xRange:u,yRange:f}}function Xb(e){const{colorScheme:t}=Ss(),n=mi(),r=d.useMemo(()=>n?t==="dark":!1,[t,n]);return d.useMemo(()=>({...r?aft:ift,...e}),[r,e])}function Zb(e){return d.useMemo(()=>e.data.map(n=>({__key:Math.random(),...n})),[e.data])}function Jb({config:e}){const t=d.useMemo(()=>DS(e.x.accessor,e.x.scale),[e.x]),n=d.useMemo(()=>DS(e.y.accessor,e.y.scale),[e.y]),r=d.useMemo(()=>DS(e.z?.accessor,e.z?.scale),[e.z]);return d.useMemo(()=>({xGet:t,yGet:n,zGet:r}),[t,n,r])}function e_({config:e}){const t=d.useCallback(i=>$u(i,e.x.format),[e.x]),n=d.useCallback(i=>$u(i,e.y.format),[e.y]),r=d.useCallback(i=>$u(i,e.z?.format),[e.z]),s=d.useCallback(i=>$u(i,e.x.tooltipFormat??e.x.format),[e.x]),o=d.useCallback(i=>$u(i,e.y.tooltipFormat??e.y.format),[e.y]),a=d.useCallback(i=>$u(i,e.z?.tooltipFormat??e.z?.format),[e.z]);return d.useMemo(()=>({xFormat:t,yFormat:n,zFormat:r,xTooltipFormat:s,yTooltipFormat:o,zTooltipFormat:a}),[t,n,r,s,o,a])}function t_({width:e,height:t,margin:n,maxYLabelWidth:r,hasAxis:s}){return d.useMemo(()=>cft({width:e,height:t,margin:n,maxYLabelWidth:r,hasAxis:s}),[e,t,n,r,s])}function O8({config:e,xGet:t,yGet:n,data:r,endTime:s,previousClose:o}){const a=d.useMemo(()=>{if(lB.includes(e.x.scale))return[...new Set(r.map(t))];const u=Mo(r,t);return e.x.tickValues?Mo([...e.x.tickValues,...u]):u},[e.x.tickValues,e.x.scale,r,t]),i=d.useMemo(()=>{if(lB.includes(e.y.scale))return[...new Set(r.map(n))];const f=[...Mo(r,n)];o!==void 0&&f.push(o),e.y.tickValues&&f.push(...e.y.tickValues);const[m,p]=Mo(f),g=(p-m)*.05;return[m-g,p+g]},[e.y.tickValues,e.y.scale,r,n,o]),c=d.useMemo(()=>{if(!s||!a||a.length<2||e.x.scale!=="time")return a;const[u,f]=a;return new Date(f).toDateString()!==s.toDateString()?a:Date.now()({xDomain:c,yDomain:i}),[c,i])}function Ple(e){const[t,n]=d.useState({width:0,height:0,resizing:!1});return d.useEffect(()=>{let r;const s=()=>{e.current&&(clearTimeout(r),n(o=>{const a=e.current?.offsetWidth??0,i=e.current?.offsetHeight??0,c=Math.round(o.width)!==Math.round(a);return{width:a,height:i,resizing:c}}),r=setTimeout(()=>{n(o=>({...o,resizing:!1}))},500))};return s(),window.addEventListener("resize",s),()=>{clearTimeout(r),window.removeEventListener("resize",s)}},[e]),t}const xs=30,Dd=28,L8=({height:e=l0,render:t,children:n})=>{const r=d.useRef(null),{width:s}=Ple(r);return l.jsx("div",{style:{width:"100%",height:e},ref:r,className:"relative",children:l.jsx(kt,{children:t&&l.jsx(Te.div,{className:"absolute",children:n(s,e)})})})},uft=({children:e,style:t})=>l.jsx(K,{className:"p-sm pb-md flex h-full",children:l.jsx(K,{className:"flex size-full items-center justify-center",variant:"raised",style:t,children:l.jsx(V,{variant:"small",color:"light",children:e})})}),Ole=()=>l.jsx(uft,{style:{height:l0,marginBottom:xs},children:l.jsx(Ne,{id:"iuY8kxCDQT",defaultMessage:"Something went wrong."})});function dft(e){return!!e&&e instanceof Element}function fft(e){return!!e&&(e instanceof SVGElement||"ownerSVGElement"in e)}function mft(e){return!!e&&"createSVGPoint"in e}function pft(e){return!!e&&"getScreenCTM"in e}function hft(e){return!!e&&"changedTouches"in e}function gft(e){return!!e&&"clientX"in e}function yft(e){return!!e&&(e instanceof Event||"nativeEvent"in e&&e.nativeEvent instanceof Event)}function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:$p({},jS);if(gft(e))return{x:e.clientX,y:e.clientY};var t=e?.target,n=t&&"getBoundingClientRect"in t?t.getBoundingClientRect():null;return n?{x:n.x+n.width/2,y:n.y+n.height/2}:$p({},jS)}function cB(e,t){if(!e||!t)return null;var n=xft(t),r=fft(e)?e.ownerSVGElement:e,s=pft(r)?r.getScreenCTM():null;if(mft(r)&&s){var o=r.createSVGPoint();return o.x=n.x,o.y=n.y,o=o.matrixTransform(s.inverse()),new ii({x:o.x,y:o.y})}var a=e.getBoundingClientRect();return new ii({x:n.x-a.left-e.clientLeft,y:n.y-a.top-e.clientTop})}function c0(e,t){if(dft(e)&&t)return cB(e,t);if(yft(e)){var n=e,r=n.target;if(r)return cB(r,n)}return null}var vft=["tooltipOpen"];function bft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function tx(){return tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&E>N}else{var k=S+o+u.width-window.innerWidth,I=u.width-S-o;_=k>0&&k>I}if(c.height){var M=C+i+u.height-c.height,A=u.height-C-i;w=M>0&&M>A}else w=C+i+u.height>window.innerHeight;S=_?S-u.width-o:S+o,C=w?C-u.height-i:C+i,S=Math.round(S),C=Math.round(C),b="translate("+S+"px, "+C+"px)"}return T.createElement(F8,rx({ref:x,style:rx({left:0,top:0,transform:b},!y&&m)},v),T.createElement(Eft,{value:{isFlippedVertically:!w,isFlippedHorizontally:!_}},t))}Ble.propTypes={nodeRef:He.oneOfType([He.string,He.func,He.object])};const Ule=Sft(Ble),Tft="shadow-subtle transition-colors duration-500",r_=d.memo(({marginTop:e,tooltipLeft:t=0,innerHeight:n,color:r,strokeWidth:s=1})=>{const o=d.useMemo(()=>({x:t,y:e}),[e,t]),a=d.useMemo(()=>({x:t,y:n+e}),[n,e,t]);return isNaN(o.x+a.x+o.y+a.y)?null:l.jsx("line",{x1:o.x,y1:o.y,x2:a.x,y2:a.y,stroke:r,strokeWidth:s,pointerEvents:"none",className:Tft})});r_.displayName="YCrosshair";const Aft={pointerEvents:"none",position:"absolute",overflow:"visible",zIndex:3},s_=({children:e,y:t,x:n,pill:r})=>l.jsx(Ule,{left:n,top:t,style:Aft,children:l.jsx("div",{className:z("shadow-subtle relative border bg-white/75 backdrop-blur-sm dark:bg-subtle overflow-hidden",{"rounded-full":r,"rounded-lg":!r}),children:e})}),Nft=({exchangeHoursAnnotations:e,data:t,xScale:n,xBounds:r,hidden:s,tzOffsetMins:o})=>{const{$t:a}=J(),{tooltipData:i,hideTooltip:c,showTooltip:u}=n_(),f=d.useRef(null),m=d.useRef(s),p=d.useCallback((y,x)=>{const{d:v,x:b}=XN(y.local.x,n,t);if(!v)return;const _=YN(e,new Date(v.date),o),w=_?.type&&hL[_.type]?a(hL[_.type]):void 0,S=Math.min(Math.max(r[0],b),r[1]);u({tooltipData:{data:v,point:{touch:x,local:{x:S,y:y.local.y},global:y.global},annotation:w}})},[t,n,u,e,a,r,o]);m.current&&!s&&f.current&&p(f.current,!1),m.current=s;const h=d.useCallback(y=>{const x="touches"in y;y.stopPropagation();const v=c0(y),b=WN(y);if(!v)return;const _={local:v,global:b};f.current=_,p(_,x)},[p]),g=d.useCallback(()=>{f.current=null,c()},[c]);return d.useMemo(()=>({tooltipData:s?void 0:i,hideTooltip:g,showTooltip:h}),[i,g,h,s])},Vle=({currency:e,absoluteChange:t,relativeChange:n})=>{const{locale:r}=J(),s=d.useMemo(()=>t===void 0?null:jc(t,e,r),[t,e,r]),o=d.useMemo(()=>n===void 0?null:n.toLocaleString(r,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2,signDisplay:"exceptZero"}),[n,r]),a=d.useMemo(()=>t?t>0?"positive":"negative":"light",[t]);return!t&&!n?null:l.jsx(K,{className:"relative border-t",children:l.jsx(V,{variant:"tinyRegular",color:a,className:"px-sm py-xs whitespace-nowrap",children:l.jsx(Ne,{id:"TqEJGQaMg0",defaultMessage:"{absoluteChange} ({relativeChange})",values:{absoluteChange:s,relativeChange:o}})})})},Rft=({x:e,y:t,close:n,date:r,annotation:s,absoluteChange:o,relativeChange:a,currency:i,exchangeTimezone:c})=>{const{locale:u}=J();return l.jsxs(s_,{y:t,x:e,children:[l.jsxs(K,{className:"py-sm relative px-[12px]",children:[l.jsx(V,{variant:"baseSemi",children:jc(n,i,u)}),l.jsx(V,{variant:"tinyRegular",className:"whitespace-nowrap",color:"light",children:QN(r,u,c)}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"whitespace-nowrap",children:s})]}),l.jsx(Vle,{currency:i,absoluteChange:o,relativeChange:a})]})},qm=({label:e,children:t})=>l.jsxs(K,{className:"gap-md flex justify-between",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:e}),l.jsx(V,{variant:"tinyRegular",className:"whitespace-nowrap",children:t})]}),Dft=({currency:e,locale:t,exchangeTimezone:n,x:r,y:s,data:o,annotation:a,absoluteChange:i,relativeChange:c})=>{const{$t:u}=J();return l.jsx(Jl,{children:l.jsxs(s_,{y:s,x:r,children:[l.jsx(K,{children:l.jsxs(K,{className:"px-sm py-xs",variant:"subtle",children:[l.jsx(V,{variant:"tiny",className:"whitespace-nowrap",children:QN(o.date,t,n)}),a&&l.jsx(V,{variant:"micro",color:"light",className:"whitespace-nowrap",children:a})]})}),l.jsxs(K,{className:"px-sm py-xs space-y-xs border-t",children:[l.jsx(qm,{label:u({defaultMessage:"Close",id:"rbrahOGMC3"}),children:jc(o.close,e,t)}),l.jsx(qm,{label:u({defaultMessage:"Open",id:"JfG49wNHKP"}),children:jc(o.open,e,t)}),l.jsx(qm,{label:u({defaultMessage:"High",id:"AxMhQrcUDC"}),children:jc(o.high,e,t)}),l.jsx(qm,{label:u({defaultMessage:"Low",id:"477I0ggSYe"}),children:jc(o.low,e,t)}),l.jsx(qm,{label:u({defaultMessage:"Volume",id:"y867VsgbzT"}),children:o.volume.toLocaleString(t,{style:"decimal",currency:e??void 0,minimumFractionDigits:0,maximumFractionDigits:0})})]}),l.jsx(Vle,{currency:e,absoluteChange:i,relativeChange:c})]})})},jft=e=>e&&e<0?tr.red:e&&e>0?tr.blue:tr.gray,dB=5,Ift=.002,fB=1,Pft=20,Oft=150,A1={k:1,x:0},Lft=(e,t)=>(t-e.x)/e.k,Hle=(e,t)=>{const r=t.range().map(s=>Lft(e,s)).map(s=>t.invert(s));return t.copy().domain(r)},zle=(e,t)=>{const r=t.range().map(s=>e.k*s+e.x);return t.copy().range(r)},Wle=({enabled:e,width:t,id:n})=>{const[r,s]=d.useState(A1),o=d.useRef(t);o.current=t;const[a,i]=d.useState(!1),c=d.useRef(null),u=d.useRef(null);d.useEffect(()=>{if(!e)return;const m=u.current;if(!m)return;const p=h=>{h.preventDefault(),h.stopPropagation();const g=c0(m,h);if(!g)return;i(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{i(!1)},Oft);const y=Math.exp(-h.deltaY*Ift);s(x=>{const v=Math.max(fB,Math.min(Pft,x.k*y));if(v<=fB)return A1;const b=g.x-(g.x-x.x)*(v/x.k),_=o.current*(1-v),w=Math.max(_,Math.min(0,b));return{k:v,x:w}})};return m.addEventListener("wheel",p,{passive:!1}),()=>{m.removeEventListener("wheel",p)}},[e]);const f=d.useCallback(()=>{s(A1)},[]);return d.useEffect(()=>{s(A1)},[n]),{transform:r,isActivelyZooming:a,containerRef:u,resetZoom:f}},Fft=({data:e,xScale:t,xGet:n,width:r})=>{const s=e.filter(c=>{const u=t(n(c));return u!==void 0&&u>=0&&u<=r});if(s.length<2)return{visibleData:s,visibleDays:Iae(e)};const o=n(s[0]),i=(n(s[s.length-1]).getTime()-o.getTime())/(1e3*60*60*24);return{visibleData:s,visibleDays:i}},Bft=e=>{const t=e*.05;return Math.max(10,Math.min(t,100))},u0=(e,t,n)=>{const r=Bft(n),s=t(e);return s!==void 0&&s>=r&&s<=n-r},Uft=e=>{const t=e.match(/(\d{4})-(\d{2})-(\d{2})/);return t?t[0]:void 0},Vft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getHours(),u=i.getMinutes(),m=[0,30].find(g=>u>=g-5&&u<=g+5);if(m===void 0)return;const h=`${`${i.getFullYear()}-${i.getMonth()}-${i.getDate()}`}-${c}-${m}`;if(!o.has(h)){const g=new Date(i);g.setMinutes(m,0,0),s.push({date:g,label:!0,line:u0(g,r,n)}),o.add(h)}}),s},Hft=({history:e,xGet:t,xGetUnparsed:n,width:r,xScale:s})=>{const o=[],a=new Set;return e.forEach(i=>{const c=t(i),u=Uft(n(i));u&&!a.has(u)&&(o.push({date:c,label:!0,line:u0(c,s,r)}),a.add(u))}),o};function zft(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay(),n=t===0?6:t-1;return Math.ceil((e.getDate()+n)/7)}const Wft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getMonth(),u=zft(i),f=`${c}-${u}`;o.has(f)||(s.push({date:i,label:!0,line:u0(i,r,n)}),o.add(f))}),s.filter((a,i,c)=>i?a.date.getTime()-c[i-1].date.getTime()>1e3*60*60*24*6:!0)},Gft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getMonth(),f=`${i.getFullYear()}-${c}`;o.has(f)||(s.push({date:i,label:!0,line:u0(i,r,n)}),o.add(f))}),s},$ft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getFullYear();o.has(c)||(s.push({date:i,label:!0,line:u0(i,r,n)}),o.add(c))}),s},qft=e=>e<=1?Vft:e<=7?Hft:e<=45?Wft:e<=365?Gft:$ft,Kft=({ticks:e,maxTicks:t,xScale:n,width:r})=>{if(e.length<=t)return e;const s=r/(t*2),o=[];let a;for(const i of e){const c=n(i.date);c!==void 0&&(a===void 0||c-a>=s)&&(o.push(i),a=c)}return o},B8=(e,t)=>e.date.toLocaleDateString(e.locale,{timeZone:e.timezone??void 0,...t}),Yft=e=>{const t=e.date.getMinutes()!==0;return e.date.toLocaleTimeString(e.locale,{timeZone:e.timezone??void 0,hour:"numeric",minute:t?"numeric":void 0})},Qft=e=>Yft(e),Xft=e=>B8(e,{month:"short",day:"numeric"}),Zft=e=>B8(e,{month:"short"}),Jft=e=>B8(e,{year:"numeric"}),emt=({days:e})=>e<=1?Qft:e<=62?Xft:e<=365?Zft:Jft,Gle=({history:e,xGet:t,xGetUnparsed:n,timezone:r,locale:s,width:o,xScale:a})=>{const{visibleDays:i}=d.useMemo(()=>Fft({data:e,xScale:a,xGet:t,width:o}),[e,a,t,o]),c=d.useMemo(()=>emt({days:i}),[i]),u=d.useMemo(()=>ZN(e),[e]),f=d.useMemo(()=>{if(u)return;const x=qft(i)({history:e,xGet:t,xGetUnparsed:n,locale:s,xScale:a,width:o});if(x)return Kft({ticks:x,maxTicks:dB,xScale:a,width:o})},[e,t,n,s,a,o,i,u]),m=d.useMemo(()=>{const y=f?.filter(v=>v.label).map(v=>v.date);if(!y?.length)return;const x=Dae({ticks:y,xScale:a,width:o,formatter:v=>c({date:v,locale:s,timezone:r}),marginLeft:25,marginRight:70});return x.length?x:void 0},[f,a,o,c,s,r]),p=d.useMemo(()=>{const y=f?.filter(x=>x.line).map(x=>x.date);return y?.length?y:void 0},[f]),h=d.useCallback(y=>c({date:y,locale:s,timezone:r}),[c,s,r]);return{xTickLabels:m,xTickFormatter:h,xTickLines:p,xTickCount:m?void 0:dB}},tmt={US:"US"},nmt=zt("FinanceIndexContext",{country:tmt.US,setCountry:()=>{},enabled:!1}),rmt=()=>{const e=d.useContext(nmt);if(!e)throw new Error("useFinanceCountry must be used within a FinanceCountryProvider");return e},smt=e=>e===0?"":e>0?"+":"-",omt=e=>e===0?"light":e>0?"positive":"negative",o_=T.memo(({change:e,variant:t="small",includeIcon:n=!1,className:r,background:s=!0,mono:o=!0,hover:a=!1,format:i,suffix:c,animated:u})=>{const f=d.useMemo(()=>i||{style:"percent",minimumFractionDigits:2},[i]);return l.jsxs(V,{as:"span",variant:t,color:omt(e),className:z("transition-background-color flex shrink-0 grow-0 items-center justify-center gap-[0.1em] rounded text-center font-mono duration-200 ease-in-out",{"bg-positive/10":e>0&&s,"bg-negative/10":e<0&&s,"bg-subtle":e===0&&s,"px-[0.6em] py-[0.15em]":s,"!pl-[0.3em]":s&&n,"!py-0 !pb-px":t==="micro","hover:bg-positive/20 hover:text-positive":a&&e>0&&s,"hover:bg-negative/20 hover:text-negative":a&&e<0&&s,"hover:bg-subtle":a&&e===0&&s},r),children:[l.jsx("span",{className:z("inline-flex",{"-mt-px":o}),children:n?l.jsx(ge,{icon:B("arrow-right"),className:z("inline-flex size-[1.2em] transition-transform duration-500 ease-in-out",{"!mt-px":o,"rotate-45":e<0,"-rotate-45":e>0})}):l.jsx("span",{className:o?"font-mono":"",children:smt(e)})}),l.jsx("span",{className:z("whitespace-nowrap",{"font-mono":o}),children:l.jsx(wb,{value:Math.abs(e)/100,format:f,suffix:c,animated:u})})]})});o_.displayName="FinancePriceChange";const amt="recent-tickers:2",imt=5,lmt=e=>{if(typeof window>"u")return[];try{const t=wt.getItem(e);return t?JSON.parse(t):[]}catch{return[]}},mB=(e,t)=>{if(!(typeof window>"u"))try{wt.setItem(e,JSON.stringify(t))}catch{}},cmt=({storageKey:e,maxItems:t,getUniqueId:n})=>{const[r,s]=d.useState([]);d.useEffect(()=>{s(lmt(e))},[e]);const o=d.useCallback(i=>{s(c=>{const u=n(i),f=c.filter(p=>n(p)!==u),m=[i,...f].slice(0,t);return mB(e,m),m})},[e,t,n]),a=d.useCallback(()=>{s([]),mB(e,[])},[e]);return d.useMemo(()=>({recentItems:r,addRecentItem:o,clearRecentItems:a}),[r,o,a])},U8=()=>{const{recentItems:e,addRecentItem:t,clearRecentItems:n}=cmt({storageKey:amt,maxItems:imt,getUniqueId:r=>r.symbol});return{recentTickers:e,addRecentTicker:t,clearRecentTickers:n}},V8=({isOpen:e,onClose:t,refs:n})=>{d.useEffect(()=>{if(!e)return;const r=o=>{n.some(i=>i.current?.contains(o.target))||t()},s=o=>{o.key==="Escape"&&t()};return document.addEventListener("mousedown",r,!0),document.addEventListener("keydown",s,!0),()=>{document.removeEventListener("mousedown",r,!0),document.removeEventListener("keydown",s,!0)}},[e,t,n])},umt=({value:e,isFocused:t,defaultSuggestions:n=[],reason:r})=>{const{country:s}=rmt(),o=Xt(),{data:a,isLoading:i}=gt({queryKey:RP(e,s),queryFn:()=>DP({query:e,reason:r,country:s}),staleTime:0,enabled:t}),c=d.useMemo(()=>n?.length&&e===""?"suggestions":a?.length&&e===""?"trending":"search",[n,e,a?.length]),{$t:u}=J(),f=d.useMemo(()=>{if(c==="suggestions")return u({defaultMessage:"Suggested",id:"a0lFbMbzyl"});if(c==="trending")return u({defaultMessage:"Trending",id:"ll/ufR0/ED"})},[c,u]),m=d.useMemo(()=>{if(c==="suggestions")return n;const p=a?.filter(h=>h.category==="ticker");return p?p.map(h=>({symbol:h.query??"",name:h.description??"",image:h.image??"",darkImage:h.image_dark??"",url:h.url??"",exchange:h.metadata?.price_info?.exchange??"",country:h.metadata?.price_info?.exchangeCountry??"",currency:h.metadata?.price_info?.currency??"",change:h.metadata?.price_info?.change??void 0,currentPrice:h.metadata?.price_info?.currentPrice??void 0,changesPercentage:h.metadata?.price_info?.changePercentage??void 0})):[]},[a,n,c]);return d.useEffect(()=>{o.prefetchQuery({queryKey:RP("",s),queryFn:()=>DP({query:"",reason:r,country:s}),staleTime:0})},[o,s,r]),{suggestions:m?.length?m:[],isLoadingSuggestions:i,mode:c,title:f}},dmt=({focusedIndex:e,setFocusedIndex:t,onSelect:n})=>d.useCallback((s,o)=>{s.key==="ArrowDown"?(s.preventDefault(),t(e===null?0:Math.min(e+1,o.length-1))):s.key==="ArrowUp"?(s.preventDefault(),t(e===null?0:Math.max(e-1,0))):s.key==="Enter"&&e!==null&&(s.preventDefault(),n(o[e]))},[e,t,n]),$le=({onClick:e,defaultSuggestions:t=[],reason:n="finance-navigational-searchbar",onAssetSelect:r}={})=>{const[s,o]=d.useState(!1),[a,i]=d.useState(""),[c,u]=d.useState(null),{inApp:f}=Ea(),m=Dn();d.useEffect(()=>u(null),[a]);const{suggestions:p,isLoadingSuggestions:h,mode:g,title:y}=umt({value:a,isFocused:s,defaultSuggestions:t,reason:n}),x=d.useCallback(S=>{const C=_b({href:S?.url,inApp:f,queryParams:null});C&&m.push(C)},[m,f]),v=e??x,b=d.useCallback(()=>{o(!1),u(null)},[]),_=d.useCallback(S=>{v(S),b(),i(""),S&&r?.(S)},[v,b,r]),w=dmt({focusedIndex:c,setFocusedIndex:u,onSelect:_});return{isFocused:s,value:a,focusedIndex:c,isLoadingSuggestions:h,suggestions:p,mode:g,title:y,setIsFocused:o,setValue:i,setFocusedIndex:u,handleKeyDown:w,openAsset:_,closeSearch:b}},fmt=d.memo(()=>{const{recentTickers:e,addRecentTicker:t,clearRecentTickers:n}=U8(),r=$le({onAssetSelect:t}),{$t:s}=J(),o=d.useRef(null),{isMobileStyle:a}=Re(),i=d.useMemo(()=>e.length&&r.value===""?e:[],[e,r.value]),c=d.useCallback(f=>{r.handleKeyDown(f,[...i,...r.suggestions])},[r,i]),u=d.useRef(null);return V8({isOpen:r.isFocused,onClose:()=>r.setIsFocused(!1),refs:[u]}),l.jsxs("div",{ref:u,className:"pt-one relative md:w-full md:max-w-[360px]",children:[l.jsx(co,{type:"search",placeholder:s(a?{defaultMessage:"Search tickers...",id:"na0wZ6TycW"}:{defaultMessage:"Search for stocks, crypto, and more...",id:"sX/a414S1y"}),isMobileUserAgent:!1,onFocus:()=>r.setIsFocused(!0),onChange:r.setValue,onKeyDown:c,className:"bg-subtler !focus:ring-super/50 dark:focus:!ring-super/50 h-9 w-full !border-none !py-0",ref:o}),r.isFocused&&l.jsx("div",{className:z("z-50",{"fixed inset-x-0 top-[var(--header-height)]":a,"absolute left-1/2 top-full mt-2 min-w-[500px] -translate-x-1/2":!a}),children:l.jsx(Yle,{title:r.title,isLoadingSuggestions:r.isLoadingSuggestions,recentTickers:i,suggestions:r.suggestions,value:r.value,focusedIndex:r.focusedIndex,setIsFocused:r.setIsFocused,setValue:r.setValue,openAsset:r.openAsset,trailing:l.jsx(Kle,{onClick:n})})})]})});fmt.displayName="FinanceNavigationalSearchbarHeader";const qle=d.memo(({defaultSuggestions:e=[],onClick:t})=>{const{addRecentTicker:n}=U8(),r=$le({onClick:t,defaultSuggestions:e,onAssetSelect:n}),s=d.useRef(null);d.useEffect(()=>{s.current&&s.current.focus()},[]);const o=d.useCallback(i=>{(i.key==="ArrowDown"||i.key==="ArrowUp"||i.key==="Enter")&&r.handleKeyDown(i,r.suggestions)},[r]),{$t:a}=J();return l.jsxs(l.Fragment,{children:[l.jsx(K,{className:"p-sm w-full",children:l.jsx(co,{type:"search",placeholder:a({defaultMessage:"Search tickers...",id:"na0wZ6TycW"}),isMobileUserAgent:!1,onFocus:()=>r.setIsFocused(!0),onChange:r.setValue,onKeyDown:o,ref:s})}),l.jsx(K,{className:"w-full",children:r.isLoadingSuggestions?l.jsx("div",{className:"p-md flex items-center justify-center opacity-50",children:l.jsx(ql,{size:14})}):r.suggestions.length===0?l.jsx(V,{variant:"small",color:"light",className:"p-md text-center",children:a({defaultMessage:"No results",id:"jHJmjfxD4s"})}):r.suggestions.map((i,c)=>l.jsx(H8,{ticker:i,openAsset:r.openAsset,isFocused:r.focusedIndex===c,setIsFocused:r.setIsFocused,setValue:r.setValue},i.symbol+"suggestion"))})]})});qle.displayName="FinanceNavigationalSearchbarInline";const Kle=d.memo(({onClick:e})=>{const{$t:t}=J(),n=d.useCallback(r=>{r.stopPropagation(),e()},[e]);return l.jsx("div",{className:"flex h-0 items-center",children:l.jsx(rt,{icon:B("x"),size:"tiny",pill:!0,onClick:n,extraCSS:"-mr-sm opacity-50 hover:opacity-100",toolTip:t({defaultMessage:"Clear recents",id:"4k9F3xn5kg"})})})});Kle.displayName="ClearRecentButton";const Yle=d.memo(({title:e,isLoadingSuggestions:t,recentTickers:n,suggestions:r,value:s,focusedIndex:o,setIsFocused:a,setValue:i,openAsset:c,trailing:u})=>{const{$t:f}=J(),{inApp:m}=Ea(),p=r&&r.length>0,h=r?.length===0&&s!=="",g=n.length>0&&s==="";return!(p||g)&&!t?null:l.jsx(K,{variant:"raised",className:z("relative flex flex-col overflow-hidden rounded-b-xl shadow-md md:rounded-xl md:border md:shadow-xl",{"-mt-one":m}),children:t?l.jsx("div",{className:"p-md flex items-center justify-center opacity-50",children:l.jsx(ql,{size:14})}):h?l.jsx(V,{variant:"small",color:"light",className:"p-md text-center",children:f({defaultMessage:"No results",id:"jHJmjfxD4s"})}):l.jsxs(l.Fragment,{children:[g&&l.jsxs(l.Fragment,{children:[l.jsx(W5,{title:f({defaultMessage:"Recent",id:"iXpep1vGVo"}),trailing:u}),l.jsx("div",{className:"gap-xs p-sm flex flex-wrap",children:n.map((x,v)=>l.jsx(Qle,{ticker:x,openAsset:c,isFocused:o===v,setIsFocused:a,setValue:i},`${x.symbol}-recent`))})]}),e?l.jsx(W5,{title:e}):l.jsx(K,{className:"border-b"}),r.map((x,v)=>l.jsx(H8,{ticker:x,openAsset:c,isFocused:o===v+n.length,setIsFocused:a,setValue:i},x.symbol+"suggestion"))]})})});Yle.displayName="NavigationalMenuContent";const W5=d.memo(({title:e,trailing:t})=>l.jsxs("div",{className:"bg-subtler gap-sm px-md py-sm flex items-center justify-between",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:e}),t]}));W5.displayName="Header";const Qle=d.memo(({ticker:e,isFocused:t,openAsset:n})=>l.jsxs(K,{className:"pl-xs pr-sm group relative inline-flex cursor-pointer overflow-hidden rounded-full border py-0.5",as:"button",onClick:()=>n(e),children:[l.jsx(K,{className:z("absolute inset-0 rounded-full opacity-0 group-hover:opacity-100",t&&"opacity-100"),variant:"subtler"}),l.jsxs("div",{className:"gap-xs relative flex max-w-[200px] items-center",children:[l.jsx($6,{watchlistType:"FINANCE",image:e.image,imageDark:e.darkImage,alt:e.name,imageClassName:"!size-4 overflow-hidden rounded"}),l.jsx(V,{variant:"tiny",className:"truncate",children:e.name}),l.jsx(V,{variant:"tinyMono",color:"light",className:"shrink-0",children:e.symbol})]})]}));Qle.displayName="NavigationalSearchbarRecentItem";const H8=d.memo(({ticker:e,isFocused:t,openAsset:n})=>{const{addRecentTicker:r}=U8(),{session:s}=je(),{trackEvent:o}=Ke(s),a=d.useCallback(()=>{r(e),n(e),o("finance link clicked",{referrer:Cb.SEARCH_AUTOSUGGEST,targetPageType:Jg.ASSET_PAGE,symbol:e.symbol,destinationUrl:e.url})},[r,e,n,o]);return l.jsxs(K,{className:"gap-sm px-md py-sm group relative flex w-full cursor-pointer appearance-none items-center justify-between border-b text-left last:border-b-0",onClick:a,as:"button",children:[l.jsx(K,{className:z("absolute inset-0 opacity-0 group-hover:opacity-100",t&&"opacity-100"),variant:"subtler"}),l.jsxs("div",{className:"gap-md relative flex w-full items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex min-w-0 items-center",children:[l.jsx($6,{watchlistType:"FINANCE",image:e.image,imageDark:e.darkImage,alt:e.name,className:"shrink-0 overflow-hidden rounded"}),l.jsxs("div",{className:"min-w-0 max-w-[200px]",children:[l.jsx(V,{variant:"smallBold",className:"truncate",children:e.name}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e.symbol,exchange:e.exchange,country:e.country})})]})]}),l.jsxs("div",{className:"gap-sm flex items-center",children:[e.currentPrice&&e.currency?l.jsx(V,{variant:"tinyMono",color:"light",children:e.currentPrice.toLocaleString("en-US",{style:"currency",currency:e.currency})}):null,e.changesPercentage?l.jsx(o_,{change:e.changesPercentage,variant:"tinyMono",includeIcon:!0}):null,l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet -mr-xs"})]})]})]})});H8.displayName="NavigationalSearchbarItem";function pB(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 mmt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,i;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,i=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw i}}}}function gmt(e,t){var n=[],r=[];function s(o,a){if(o.length===1)n.push(o[0]),r.push(o[0]);else{for(var i=Array(o.length-1),c=0;c=3&&(t.x1=e[1][0],t.y1=e[1][1]),t.x=e[e.length-1][0],t.y=e[e.length-1][1],e.length===4?t.type="C":e.length===3?t.type="Q":t.type="L",t}function xmt(e,t){t=t||2;for(var n=[],r=e,s=1/t,o=0;o0?m-=1:m0&&(m-=1))}return c[m]=(c[m]||0)+1,c},[]),i=a.reduce(function(c,u,f){if(f===e.length-1){var m=G5(u,sx({},e[e.length-1]));return m[0].type==="M"&&m.forEach(function(p){p.type="L"}),c.concat(m)}return c.concat(Cmt(e[f],e[f+1],u))},[]);return i.unshift(e[0]),i}function yB(e){for(var t=(e||"").match(bmt)||[],n=[],r,s,o=0;o0&&r[r.length-1].type==="Z"&&r.pop(),s.length>0&&s[s.length-1].type==="Z"&&s.pop(),r.length?s.length||s.push(r[0]):r.push(s[0]);var u=Math.abs(s.length-r.length);u!==0&&(s.length>r.length?r=gB(r,s,a):s.length{const r=d.useRef(e),s=d.useRef(e),[o,a]=yie(()=>({t:1,config:{duration:n},easing:Xd}));return s.current!==e&&(r.current=s.current,s.current=e,a.start({from:{t:0},to:{t:1},immediate:!t,config:{duration:n}})),o.t.to(i=>Emt(r.current,s.current)(i))};var Zle="Toggle",Jle=d.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:s,...o}=e,[a,i]=fo({prop:n,onChange:s,defaultProp:r??!1,caller:Zle});return l.jsx(Mt.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:nt(e.onClick,()=>{e.disabled||i(!a)})})});Jle.displayName=Zle;var cc="ToggleGroup",[ece]=Vs(cc,[tc]),tce=tc(),z8=T.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const s=r;return l.jsx(kmt,{...s,ref:t})}if(n==="multiple"){const s=r;return l.jsx(Mmt,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${cc}\``)});z8.displayName=cc;var[nce,rce]=ece(cc),kmt=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[a,i]=fo({prop:n,defaultProp:r??"",onChange:s,caller:cc});return l.jsx(nce,{scope:e.__scopeToggleGroup,type:"single",value:T.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:T.useCallback(()=>i(""),[i]),children:l.jsx(sce,{...o,ref:t})})}),Mmt=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[a,i]=fo({prop:n,defaultProp:r??[],onChange:s,caller:cc}),c=T.useCallback(f=>i((m=[])=>[...m,f]),[i]),u=T.useCallback(f=>i((m=[])=>m.filter(p=>p!==f)),[i]);return l.jsx(nce,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:l.jsx(sce,{...o,ref:t})})});z8.displayName=cc;var[Tmt,Amt]=ece(cc),sce=T.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:a,loop:i=!0,...c}=e,u=tce(n),f=Lf(a),m={role:"group",dir:f,...c};return l.jsx(Tmt,{scope:n,rovingFocus:s,disabled:r,children:s?l.jsx(Jx,{asChild:!0,...u,orientation:o,dir:f,loop:i,children:l.jsx(Mt.div,{...m,ref:t})}):l.jsx(Mt.div,{...m,ref:t})})}),ox="ToggleGroupItem",oce=T.forwardRef((e,t)=>{const n=rce(ox,e.__scopeToggleGroup),r=Amt(ox,e.__scopeToggleGroup),s=tce(e.__scopeToggleGroup),o=n.value.includes(e.value),a=r.disabled||e.disabled,i={...e,pressed:o,disabled:a},c=T.useRef(null);return r.rovingFocus?l.jsx(ev,{asChild:!0,...s,focusable:!a,active:o,ref:c,children:l.jsx(xB,{...i,ref:t})}):l.jsx(xB,{...i,ref:t})});oce.displayName=ox;var xB=T.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...s}=e,o=rce(ox,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=o.type==="single"?a:void 0;return l.jsx(Jle,{...i,...s,ref:t,onPressedChange:c=>{c?o.onItemActivate(r):o.onItemDeactivate(r)}})}),Nmt=z8,Rmt=oce;const Dmt=({value:e,onChange:t,id:n,children:r,boxProps:s,className:o=""})=>{const a=i=>{i&&t(i)};return l.jsx(ace.Provider,{value:{activeValue:e},children:l.jsx(_g,{id:n,children:l.jsx(Nmt,{onValueChange:a,type:"single",value:e,asChild:!0,children:l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:l.jsx(K,{className:z("border-subtler p-two flex rounded-lg border",o),...s,children:r})})})})})},jmt=({value:e,icon:t,className:n="",children:r,disabled:s=!1,style:o,onClick:a})=>{const i="relative text-quiet hover:text-foreground data-[state=on]:text-foreground flex h-[32px] min-w-[32px] p-sm items-center justify-center duration-150 active:scale-95",c=d.useContext(ace);return l.jsx(Rmt,{asChild:!0,value:e,disabled:s,children:l.jsxs("button",{className:z(i,{"cursor-not-allowed":s},n),disabled:s,style:o,onClick:a,children:[l.jsxs("span",{className:z("gap-xs relative z-[2] flex",{"opacity-50":s}),children:[Array.isArray(t)?t.map((u,f)=>l.jsx(Jt,{icon:u,size:"small"},f)):t?l.jsx(Jt,{icon:t,size:"small"}):null,r]}),c.activeValue===e&&l.jsx(Te.div,{layout:!0,layoutId:"toggle",className:"absolute inset-0 z-[1]",transition:{duration:.15,ease:Xd},children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-current opacity-10"})})]})})},ace=zt("ToggleGroupContext",{activeValue:""}),Imt=Dmt,Pmt=jmt,Qa={Root:Imt,Item:Pmt},Omt=[0,5,10,25,50,100,200],$5=Ue({advanced:{defaultMessage:"Advanced",id:"3Rx6Qo1x+1"},sma:{defaultMessage:"Simple Moving Average",id:"6Az5TSZOco"},period:{defaultMessage:"Period",id:"jCNpELHqTA"},off:{defaultMessage:"Off",id:"OvzONl52rs"}}),Lmt=(e,t)=>{if(!e?.length||t<=0)return[];const n=[];let r=0;for(let s=0;s=t){const i=e[s-t]?.close;i&&(r-=i)}if(s>=t-1){const i=s{const[e,t]=d.useState(0);return{sma:{period:e,setPeriod:t}}},ice=d.memo(({history:e,xScale:t,yScale:n,indicators:r})=>{const s=r?.sma?.period??0,o=s>0,a=d.useMemo(()=>Lmt(e,s),[e,s]),i=d.useMemo(()=>sl().defined(f=>vd(f.value)).x(f=>{const m=new Date(f.date);return t(m)??0}).y(f=>n(f.value)??0).curve(Sb),[t,n]),c=d.useMemo(()=>i(a)??void 0,[i,a]),u=a_(c??"",!0,oi);return o?l.jsx(Te.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:oi/1e3,ease:"easeInOut"},children:l.jsx(No.path,{d:u,fill:"none",stroke:tr.gray,strokeWidth:1.5,strokeDasharray:"none",shapeRendering:cm,style:{vectorEffect:"non-scaling-stroke"}})}):null});ice.displayName="FinanceStockHistoryChartSimpleMovingAverage";const vB="flex flex-col p-sm gap-md",lce=d.memo(({children:e})=>{const{$t:t}=J(),[n,r]=d.useState(!1),s=d.useRef(null),o=d.useRef(null),a=d.useRef(null),{isMediumScreen:i}=FN();V8({isOpen:n,onClose:()=>r(!1),refs:[s,o,a]});const c=l.jsx(Hs,{content:t($5.advanced),disabled:n,children:l.jsx("button",{ref:s,onClick:()=>r(u=>!u),className:z(su,"px-sm group h-full bg-transparent transition-transform"),children:l.jsx(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center pt-px",children:l.jsx(ft,{name:B("dots-vertical"),className:"size-4"})})})});return i?l.jsxs("div",{ref:a,className:"relative",children:[c,n&&l.jsx(K,{className:"z-100 absolute right-0 top-full mt-2 overflow-hidden rounded-xl border shadow-md",children:l.jsx("div",{className:z("bg-base",vB),children:e})})]}):l.jsxs(l.Fragment,{children:[c,n&&l.jsx(Jl,{children:l.jsxs("div",{ref:o,className:"bg-base border-subtlest shadow-overlay fixed inset-x-0 top-0 z-50 flex flex-col overflow-hidden rounded-b-xl border-x border-b",children:[l.jsx("div",{className:"flex items-center p-md",children:l.jsx("button",{onClick:()=>r(!1),children:l.jsx(ft,{name:B("arrow-left"),className:"text-quiet size-5"})})}),l.jsx(K,{className:z("flex-1 overflow-auto p-sm",vB),children:e})]})})]})});lce.displayName="FinanceStockHistoryAdvancedMenu";const cce=d.memo(({history:e,indicators:t})=>{const{sma:n}=t,{$t:r}=J(),s=e?.length??0,o=Omt.map(i=>({value:i,label:i===0?r($5.off):i.toString(),disabled:i>0&&s{n.setPeriod(+i)},[n]);return l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",className:"pb-sm px-xs",children:r($5.sma)}),l.jsx(K,{children:l.jsx(Qa.Root,{value:n.period.toString(),onChange:a,id:"sma",className:"flex items-center w-fit",children:o.map(i=>l.jsx(Qa.Item,{value:String(i.value),disabled:i.disabled,children:l.jsx(V,{variant:"tiny",color:n.period===i.value?"default":"light",className:"whitespace-nowrap",children:i.label})},i.value))})})]})});cce.displayName="FinanceStockHistorySMAControl";const uce=d.memo(({setFullscreen:e,fullscreen:t})=>{const{$t:n}=J();return t?null:l.jsx(Hs,{content:n({defaultMessage:"Fullscreen",id:"zvKOAuzJQK"}),children:l.jsx("button",{onClick:()=>e(!t),style:{minHeight:kae},className:z(su,"flex items-center justify-center px-sm h-full"),children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ft,{name:B(t?"minimize":"maximize"),size:16})})})})});uce.displayName="FinanceStockHistoryChartControlsContainerFullscreenButton";const Bmt=e=>Math.round(e*.12),Ua=e=>e.close,W8=(e,t)=>{const[n,r]=t;return n===r?0:(e-n)/(r-n)*100},N1=e=>e?.type?1:0,Umt=({exchangeHoursAnnotations:e,xScale:t,width:n,xMaskingSupported:r,tzOffsetMins:s,history:o})=>{const a=r?e:[],i=[],c="invert"in t,u=c?n:o.length,f=h=>{if(c)return{x:h,date:t.invert(h)};const g=o[h];return{x:t(Cn(g))??0,date:Cn(g)}};let m,p;for(let h=0;h{const a=o(Cn(e))??0,i=o(Cn(t))??0,c=(s-n)/(r-n);return a+c*(i-a)},R1=(e,t,n)=>{const r=e>=t?Cl.POSITIVE:Cl.NEGATIVE,s=n?Iot[n]:{};return{backgroundColor:Lk[r],backgroundOpacity:1,lineColor:Lk[r],lineOpacity:1,valence:r,...s}},Hmt=({history:e,baseline:t,exchangeHoursAnnotations:n,xScale:r,width:s,xMaskingSupported:o,tzOffsetMins:a})=>{if(!e?.length)return[];const i=o?n:[],c=[];let u;for(let m=0;m=t||y>=t&&x{const m=d.useMemo(()=>{const h=a(s),g=e(r);return g?`${g} L ${c[1]},${h} L ${c[0]},${h} Z`:""},[e,r,a,s,c]),p=d.useMemo(()=>{const h=a.domain(),g=h[1]-h[0],y=(h[1]-s)/g*100,x=(u-f)/u*100;return y*(x/100)},[a,s,u,f]);return l.jsxs(l.Fragment,{children:[l.jsxs("defs",{children:[l.jsx("linearGradient",{id:`ticker-area-color-gradient-${t}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",colorInterpolation:"linearRGB",spreadMethod:"pad",children:o.map((h,g)=>l.jsx("stop",{offset:`${W8(h.x,c)}%`,stopColor:tr[h.backgroundColor],stopOpacity:h.backgroundOpacity},g))}),l.jsxs("linearGradient",{id:`ticker-area-opacity-gradient-${t}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[l.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"0.3"}),l.jsx("stop",{offset:`${Math.max(0,p-20)}%`,stopColor:"white",stopOpacity:"0.1"}),l.jsx("stop",{offset:`${p}%`,stopColor:"white",stopOpacity:"0.00"}),l.jsx("stop",{offset:`${Math.min(100,p+20)}%`,stopColor:"white",stopOpacity:"0.1"}),l.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.3"})]}),l.jsx("mask",{id:`ticker-area-mask-${t}`,children:l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#ticker-area-opacity-gradient-${t})`})})]}),l.jsx(kt,{mode:"wait",children:l.jsx(Te.g,{mask:`url(#ticker-area-mask-${t})`,animate:{opacity:1},initial:{opacity:0},transition:Il,children:l.jsx("path",{d:m,fill:`url(#ticker-area-color-gradient-${t})`,stroke:"none",shapeRendering:cm,style:{mixBlendMode:"multiply",...i}})},n)})]})},Wmt=({l:e,history:t,stops:n,xDomainData:r,id:s,disableAnimation:o})=>{const a=d.useMemo(()=>e(t),[e,t]),i=a_(a,!o,oi);return l.jsxs(l.Fragment,{children:[l.jsx("defs",{children:l.jsx("linearGradient",{id:`ticker-line-gradient-${s}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:n.map((c,u)=>l.jsx("stop",{offset:`${W8(c.x,r)}%`,stopColor:tr[c.backgroundColor],stopOpacity:c.lineOpacity},u))})}),l.jsx(No.path,{d:i,stroke:n?.length?`url(#ticker-line-gradient-${s})`:tr.blue,strokeWidth:1.75,fill:"none",shapeRendering:cm})]})},Gmt=({id:e,stops:t,height:n,opacity:r,size:s,style:o,xBounds:a})=>l.jsxs("g",{children:[l.jsxs("defs",{children:[l.jsx("pattern",{id:`ticker-after-hours-dot-grid-${e}`,patternUnits:"userSpaceOnUse",width:s,height:s,children:l.jsx("circle",{cx:s/2,cy:s/2,r:s*.12,fill:tr.gray,opacity:r})}),l.jsx("linearGradient",{id:`ticker-after-hours-mask-gradient-${e}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:t.map((i,c)=>l.jsx("stop",{offset:`${W8(i.x,a)}%`,stopColor:"white",stopOpacity:i.backgroundOpacity},c))}),l.jsx("mask",{id:`ticker-after-hours-mask-${e}`,children:l.jsx("rect",{x:0,y:"0",width:a[1],height:n,fill:`url(#ticker-after-hours-mask-gradient-${e})`})})]}),l.jsx("rect",{x:0,y:"0",style:o,width:a[1],height:n,fill:`url(#ticker-after-hours-dot-grid-${e})`,mask:`url(#ticker-after-hours-mask-${e})`})]}),$mt=e=>e>=20&&e<=40?.95:e>500?.5:.8,dce=d.memo(({top:e,height:t,data:n,xScale:r})=>{const s=d.useMemo(()=>{const c=Math.max(...n.map(u=>u.volume));return D8({exponent:.4,domain:[0,c],range:[0,t]})},[n,t]),o=d.useMemo(()=>{if(n.length<2)return 1;let c=1/0;for(let u=1;u0&&(c=Math.min(c,p))}return c===1/0?1:c*$mt(n.length)},[n,r]),{positivePath:a,negativePath:i}=d.useMemo(()=>{const c=[],u=[],f=e+t;for(const m of n){if(m.volume===0)continue;const p=(r(Cn(m))??0)-o/2,h=s(m.volume),g=f-h,x=m.close-m.open>=0,v=`M ${p} ${f} L ${p} ${g} L ${p+o} ${g} L ${p+o} ${f} Z`;x?c.push(v):u.push(v)}return{positivePath:c.join(" "),negativePath:u.join(" ")}},[n,r,o,s,e,t]);return l.jsxs("g",{children:[a&&l.jsx("path",{d:a,fill:tr.blue,opacity:.75}),i&&l.jsx("path",{d:i,fill:tr.red,opacity:.75})]})});dce.displayName="Volume";const qmt=({baseline:e,history:t,yScale:n,chartWidth:r,children:s})=>{const o=d.useMemo(()=>{const i=n(e),c=10,u=25,f=20,m=t.slice(-Math.max(3,Math.floor(t.length*.1))),p=m.reduce((x,v)=>x+n(Ua(v)),0)/m.length,h=Math.abs(p-i),y=!(i=c?!0:p>i);return{opacity:1,top:i,left:r-10,transform:`translate(-100%, ${y?"-100%":"0"})`}},[e,t,n,r]),a=d.useMemo(()=>({...o,opacity:0}),[o]);return r<25?null:l.jsx(Te.div,{className:"pointer-events-none absolute z-50",initial:a,animate:o,transition:{duration:.5,ease:"easeInOut"},children:s})},Kmt=(e,t)=>{if(!e?.length)return;const n=Mo(e,z2),r=pL(n[0],t?.open??""),s=pL(n[1],t?.close??"");let o=n[0],a=n[1];return ra&&(a=s),[new Date(o),new Date(a)]},Ymt=(e,t,n,r)=>{const[s,o]=d.useState(null),a=d.useCallback(()=>{e?.point.local.x&&o(e.point.local.x)},[e?.point.local.x]),i=d.useCallback(()=>{o(null)},[]),c=d.useMemo(()=>s===null?null:XN(s,t,n).d,[t,n,s]),u=d.useMemo(()=>{if(!c||!e)return null;const[x,v]=[e.data,c].sort((b,_)=>_.date.localeCompare(b.date));return{absolute:x.close-v.close,relative:(x.close-v.close)/v.close}},[c,e]),f=d.useMemo(()=>t.range()[1],[t]),m=d.useMemo(()=>!s||!c?null:t(Cn(c)),[t,c,s]),p=d.useMemo(()=>!s||!c||!e?null:t(Cn(e.data))??f,[t,c,s,e,f]),h=d.useMemo(()=>!c||!e||!s?`M 0 0 L ${f} 0 L ${f} ${r} L 0 ${r} Z`:`M ${m} 0 L ${p} 0 L ${p} ${r} L ${m} ${r} Z`,[c,e,s,r,m,p,f]),g="finance-chart-clip-path",y=d.useMemo(()=>({clipPath:`url(#${g})`}),[g]);return{id:g,path:h,style:y,animate:!s,absoluteChange:u?.absolute,relativeChange:u?.relative,handleMouseDown:a,handleMouseUp:i,leftX:m,rightX:p}},Qmt=({id:e,path:t})=>l.jsx("defs",{children:l.jsx("clipPath",{id:e,children:l.jsx(No.path,{d:t})})}),fce=d.memo(({id:e,symbol:t,exchangeTimezone:n,exchangeHours:r,currency:s,history:o,previousClose:a,width:i,height:c,exchangeHoursAnnotations:u=[],uiHints:f,technical:m,candlestick:p,indicators:h,watermark:g,zoomable:y,isCrypto:x})=>{const{locale:v,$t:b}=J(),_=d.useMemo(()=>o.toSorted((ve,Ae)=>ve.date.localeCompare(Ae.date)),[o]),w=Bmt(c),S=d.useMemo(()=>ZN(_),[_]),C=`${t}-${f?.currentPeriod}-${f?.currentInterval}`,{transform:E,isActivelyZooming:N,containerRef:k}=Wle({enabled:!!y,width:i,id:C}),I=d.useMemo(()=>Uot(_),[_]),M=d.useMemo(()=>new Set(f?.historyAnomalies??[]),[f?.historyAnomalies]),A=d.useMemo(()=>_.filter(ve=>!M.has(ve.date)),[_,M]),D=d.useMemo(()=>Pot(A,f?.historyMovingAverageWindow??0),[A,f?.historyMovingAverageWindow]),P=d.useMemo(()=>{const ve=Kmt(_,r);return fm({domain:ve,range:[0,i]})},[_,i,r]),F=d.useMemo(()=>a0({domain:_.map(Cn),range:[0,i]}),[_,i]),R=d.useMemo(()=>S?Hle(E,P):zle(E,F),[E,P,F,S]),j=d.useMemo(()=>Mo(_,Cn).map(ve=>R(ve)),[R,_]),L=d.useMemo(()=>[0,i],[i]),U=d.useMemo(()=>{if(p){const ve=A.map(Ge=>Ge.low),Ae=A.map(Ge=>Ge.high);return[Math.min(...ve),Math.max(...Ae)]}return Mo(A,Ua)},[A,p]),O=a??0,$=d.useMemo(()=>{let ve=U[0],Ae=U[1];O&&(ve=Math.min(ve,O),Ae=Math.max(Ae,O));const Ge=Ae-ve;return ve-=Ge*.05,Ae+=Ge*.05,Bi({nice:!1,domain:[ve,Ae],range:m?[c-xs-w,Dd]:[c-xs,Dd]})},[c,O,U,m,w]),G=d.useMemo(()=>sl().x(ve=>R(Cn(ve))??0).y(ve=>$(Ua(ve))??0).curve(Sb),[R,$]),H=I&&!!u.length,Q=d.useMemo(()=>Dot(n??"UTC",new Date),[n]),{tooltipData:Y,hideTooltip:te,showTooltip:se}=Nft({data:_,exchangeHoursAnnotations:u,xScale:R,xBounds:j,hidden:N,tzOffsetMins:Q}),{handleMouseDown:ae,handleMouseUp:X,leftX:ee,rightX:le,...re}=Ymt(Y,R,_,c),ce=jft(re.absoluteChange),ue=d.useCallback(()=>{X(),te()},[X,te]),{isMobileStyle:pe}=Re(),xe=pe?Tae:Mae,he=d.useMemo(()=>$.ticks(xe),[$,xe]),{xTickLabels:_e,xTickFormatter:ke,xTickLines:De,xTickCount:Ce}=Gle({history:_,xGet:Cn,xGetUnparsed:z2,timezone:n,locale:v,xScale:R,width:i,zoom:E.k}),Be=d.useMemo(()=>Umt({xMaskingSupported:H,xScale:R,width:i,exchangeHoursAnnotations:u??[],tzOffsetMins:Q,history:_}),[H,R,i,u,Q,_]),we=d.useMemo(()=>Hmt({xMaskingSupported:H,history:D,baseline:O,xScale:R,width:i,exchangeHoursAnnotations:u??[],tzOffsetMins:Q}),[H,D,O,R,i,u,Q]),$e=d.useCallback(ve=>Nae({tick:ve,history:D,yScale:$,xScale:R,yGet:Ua,baseline:O}),[D,$,R,O]),yt=d.useMemo(()=>!Be.length,[Be]),me=d.useMemo(()=>x?W({defaultMessage:"24h ago: {price}",id:"mSeez9Kv3Q"}):W({defaultMessage:"Prev close: {price}",id:"ZjNVXgqGKh"}),[x]);return l.jsxs("div",{ref:k,className:$N,onMouseDown:ae,onMouseMove:se,onMouseLeave:ue,onMouseOut:ue,onMouseUp:X,onTouchStart:se,onTouchMove:se,onTouchEnd:ue,onTouchCancel:ue,children:[l.jsxs("svg",{height:c,width:i,className:GN,children:[l.jsx(kt,{initial:!1,mode:"wait",children:yt&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:Il,children:[l.jsx(wu,{tickValues:he,scale:$,width:i,stroke:tr.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx(Qb,{scale:R,opacity:.1,height:c*2,stroke:tr.gray,style:{transform:`translateY(-${c}px)`},numTicks:Ce,strokeWidth:1,tickValues:De})]},C)}),l.jsx(Qmt,{id:re.id,path:re.path}),!p&&l.jsx(zmt,{l:G,id:t,animationId:C,history:D,baseline:O,stops:we,yScale:$,style:re.style,xDomainData:j,height:c,marginBottom:xs}),l.jsx(kt,{mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},exit:Mot,animate:{opacity:1},transition:Il,children:[l.jsx(Gmt,{id:e,stops:Be,height:c*3,style:{transform:`translateY(-${c*3/2}px)`},width:i,opacity:.33,size:5,xBounds:L}),l.jsx("g",{opacity:Y?0:1,className:Ok(!!Y),children:l.jsx(Gl,{scale:$,hideTicks:!0,hideAxisLine:!0,numTicks:xe,left:qN,orientation:"right",tickLabelProps:$e})}),m&&l.jsx(dce,{top:c-w-xs,height:w,data:A,xScale:R}),l.jsx(Gl,{scale:R,hideAxisLine:!0,hideTicks:!0,numTicks:Ce,tickValues:_e,tickFormat:ke,orientation:"bottom",top:c-xs,tickLabelProps:KN})]},C)}),!p&&l.jsx(Wmt,{l:G,id:t,history:D,baseline:O,stops:we,xDomainData:j,disableAnimation:N}),l.jsx(kt,{mode:"wait",children:p&&l.jsx(Te.g,{initial:{opacity:0},exit:Aot,animate:{opacity:1},transition:Tot,children:l.jsx(Ile,{xScale:R,yScale:$,history:A})},C)}),l.jsx(kt,{children:l.jsx(G8,{width:i,yScale:$,baseline:O})}),l.jsx(kt,{children:l.jsx(ice,{history:_,xScale:R,yScale:$,indicators:h})}),Y&&l.jsx(r_,{marginTop:-c,tooltipLeft:Y.point.local.x,innerHeight:c*3,color:ce})]}),l.jsx(kt,{children:S&&l.jsx(qmt,{baseline:O,history:_,yScale:$,chartWidth:i,children:l.jsx("div",{className:z("m-sm bg-base shadow-subtle overflow-hidden rounded-full border backdrop-blur-sm",Ok(!!Y)),children:l.jsx("div",{className:"px-sm py-xs bg-subtle relative p-0",children:l.jsx(V,{variant:"micro",color:"light",className:"relative whitespace-nowrap",children:b(me,{price:jc(O,s,v)})})})})})}),l.jsx(kt,{children:vd(ee)&&vd(le)&&l.jsx(Te.div,{animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},className:"pointer-events-none absolute inset-0",style:{left:le>ee?ee:le,right:i-(le>ee?le:ee),top:-c,bottom:-c},children:l.jsx(Te.div,{className:"bg-inverse absolute inset-0 rounded-md opacity-5"})})}),g&&l.jsx("div",{className:"absolute -top-md right-sm z-[2]",children:g}),Y&&!m&&l.jsx(Rft,{x:Y.point.local.x,y:Y.point.touch?-xs:Y.point.local.y,annotation:Y.annotation,close:Y.data.close,date:Y.data.date,absoluteChange:re.absoluteChange,relativeChange:re.relativeChange,currency:s,exchangeTimezone:n??void 0}),Y&&m&&l.jsx(Dft,{x:Y.point.global.x,y:Y.point.global.y,annotation:Y.annotation,data:Y.data,currency:s,locale:v,exchangeTimezone:n??void 0,absoluteChange:re.absoluteChange,relativeChange:re.relativeChange})]})});fce.displayName="Chart";const G8=d.memo(({width:e,yScale:t,baseline:n})=>l.jsx(Te.line,{stroke:tr.gray,initial:{opacity:0},transition:{duration:oi/1e3,ease:"easeInOut"},animate:{opacity:1,x1:0,x2:e,y1:t(n??0),y2:t(n??0)},exit:{opacity:0},strokeDasharray:"4 4",strokeWidth:.8,shapeRendering:cm}));G8.displayName="FinanceStockHistoryChartClosingLine";const $8=d.memo(({id:e,quote:t,technical:n,candlestick:r,indicators:s,watermark:o,height:a=l0,zoomable:i=!0})=>l.jsx(Ar,{fallback:Ole,children:l.jsx(L8,{height:a,render:!!t,children:c=>!t||c<100||!t.history?.length?null:l.jsx(fce,{id:e,symbol:t.symbol,currency:t.currency,history:t.history,previousClose:t.historicalPreviousClose??void 0,exchangeHours:t.exchangeHours,exchangeTimezone:t.exchangeTimezone,exchangeHoursAnnotations:t.exchangeHoursAnnotations,width:c,height:a,uiHints:t.uiHints,technical:n,candlestick:r,indicators:s,watermark:o,zoomable:i,isCrypto:t.isCrypto})})}));$8.displayName="FinanceStockHistoryChart";const mce=["oklch(var(--hydra-450))","oklch(var(--terra-450))","oklch(var(--dalmasca-400))","oklch(var(--kuja-450))","oklch(var(--rosa-450))","oklch(var(--costa-400))","oklch(var(--jenova-450))","oklch(var(--limsa-450))","oklch(var(--gridania-450))"],pce=["oklch(var(--hydra-350))","oklch(var(--terra-350))","oklch(var(--dalmasca-300))","oklch(var(--kuja-350))","oklch(var(--rosa-350))","oklch(var(--costa-300))","oklch(var(--jenova-250))","oklch(var(--limsa-350))","oklch(var(--gridania-350))"],Xmt=(e,t)=>{const n=t?pce:mce;return n[e%n.length]??"oklch(var(--super-color))"},hce=()=>{const{colorScheme:e}=Ss();return d.useMemo(()=>e==="dark"?pce:mce,[e])},Kp=(e,t)=>t[e%t.length]??"oklch(var(--super-color))",Zmt=4,jy=e=>e.changesPercentage,Jmt=({d:e,disableAnimation:t})=>{const n=a_(e??"",!t,oi);return e?l.jsx(No.path,{strokeWidth:1.75,fill:"none",shapeRendering:cm,d:n}):null},ept=({data:e,yScale:t})=>e?.map(n=>l.jsx(tpt,{x:n.x,yv:n.yv,color:n.quote.color,yScale:t,r:Zmt},n.quote.symbol)),tpt=({x:e,yv:t,color:n,yScale:r,r:s})=>l.jsx("circle",{cx:e,cy:r(t),r:s,fill:n}),npt=({data:e,timeZone:t,locale:n,x:r})=>{const s=d.useMemo(()=>e.reduce((a,i)=>Math.abs(i.x-r){if(!s)return null;const a=s.date;return a?QN(a,n,t??void 0):null},[s,n,t]);return l.jsx(V,{variant:"tinyRegular",color:"light",className:"px-sm py-xs",children:o})},rpt=(e,t)=>{const n={color:e.color,symbol:e.symbol,name:e.name,exchange:e.exchange,currency:e.currency,image:e.image,imageDark:e.imageDark,exchangeTimezone:e.exchangeTimezone};return t?{quote:{...n,price:t.close,historicalChange:t.close-(e.historicalPreviousClose??0),historicalPercentChange:t.changesPercentage*100},date:t.date}:{quote:{...n,price:e.price,historicalChange:e.historicalChange??0,historicalPercentChange:e.historicalPercentChange??0},date:null}},spt=({data:e,dataMovingAverage:t,xScale:n,xBounds:r,setHoveredComparisons:s,hidden:o})=>{const{tooltipData:a,hideTooltip:i,showTooltip:c}=n_(),u=T.useRef(null),f=T.useRef(o),m=d.useCallback((g,y)=>{const x=Math.min(Math.max(r[0],g.local.x),r[1]),v=t.map((b,_)=>{const w=XN(x,n,b.history),S=e[_].history[Math.min(w.index,e[_].history.length-1)],C=rpt(e[_],S);return{date:C.date,quote:C.quote,x:n(Cn(w.d))??0,yv:jy(w.d)}});v.every(b=>b.x)&&(s(v.map(b=>b.quote)),c({tooltipData:{data:v,point:{local:{x:g.local.x,y:y?-xs:g.local.y},global:g.global}}}))},[e,t,n,c,r,s]);f.current&&!o&&u.current&&m(u.current,!1),f.current=o;const p=d.useCallback(g=>{const y="touches"in g,x=c0(g);if(!x)return;const v=WN(g),b={local:x,global:v};u.current=b,m(b,y)},[m]),h=d.useCallback(()=>{u.current=null,i(),s([])},[i,s]);return d.useMemo(()=>({tooltipData:o?void 0:a,hideTooltip:h,showTooltip:p}),[a,h,p,o])},opt=e=>{if(e.length===0)return!0;const t=e[0].map(Cn);for(let n=1;nt?(e-t)/t:0,bB=e=>{const t=e.historicalPreviousClose||e.history[0].close,n=e.history.map(r=>({...r,changesPercentage:apt(r.close,t),change:r.close-t}));return{...e,history:n}},ipt=(e,t)=>!e||e===t?1:.2,lpt=({quotes:e,width:t,height:n,setHoveredComparisons:r,focused:s,watermark:o,zoomable:a})=>{const{locale:i,timeZone:c}=J(),{isMobileStyle:u}=Re(),f=u?Tae:Mae,m=d.useMemo(()=>{const H=[...new Set(e.map(Q=>Q.exchangeTimezone))];return H.length===1?H[0]:c},[c,e]),p=d.useMemo(()=>e.map(bB),[e]),h=d.useMemo(()=>e.map(H=>bB(H)),[e]),g=d.useMemo(()=>h.flatMap(H=>H.history).sort((H,Q)=>Cn(H).getTime()-Cn(Q).getTime()),[h]),y=d.useMemo(()=>Bi({nice:!1,domain:Mo(p.flatMap(H=>H.history),jy),range:[n-xs,Dd]}),[n,p]),x=d.useMemo(()=>opt(p.map(H=>H.history)),[p]),v=d.useMemo(()=>ZN(g),[g]),b=e.map(H=>H.symbol).join("-"),{transform:_,isActivelyZooming:w,containerRef:S}=Wle({enabled:!!a,width:t,id:b}),C=d.useMemo(()=>fm({domain:Mo(g,Cn),range:[0,t]}),[t,g]),E=d.useMemo(()=>a0({domain:Array.from(new Set(g.map(z2))).sort().map(Rae),range:[0,t]}),[t,g]),N=d.useMemo(()=>v||!x?Hle(_,C):zle(_,E),[_,C,E,x,v]),{xTickLabels:k,xTickFormatter:I,xTickLines:M,xTickCount:A}=Gle({history:g,xGet:Cn,xGetUnparsed:z2,timezone:m,locale:i,xScale:N,width:t,zoom:_.k}),D=hce(),P=d.useMemo(()=>sl().x(H=>N(Cn(H))??0).y(H=>y(jy(H))??0).curve(Sb),[N,y]),F=d.useMemo(()=>h.map((H,Q)=>({path:P(H.history),color:Kp(Q,D),quote:H})),[h,P,D]),R=d.useMemo(()=>y.ticks(f).filter(H=>H!==0),[y,f]),j=d.useMemo(()=>[0,t],[t]),{tooltipData:L,hideTooltip:U,showTooltip:O}=spt({data:p,dataMovingAverage:h,xScale:N,xBounds:j,setHoveredComparisons:r,hidden:w}),$=d.useCallback(H=>H.toLocaleString(i,{style:"percent"}),[i]),G=d.useCallback(H=>{const Q=h.map(Y=>Nae({tick:H,history:Y.history,yScale:y,xScale:N,yGet:jy}));return Q.find(Y=>Y.opacity<1)??Q[0]},[h,y,N]);return l.jsxs("div",{ref:S,className:$N,onMouseMove:O,onMouseLeave:U,onMouseOut:U,onTouchStart:O,onTouchMove:O,onTouchEnd:U,onTouchCancel:U,children:[l.jsxs("svg",{height:n,width:t,className:GN,children:[l.jsx(kt,{initial:!1,mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:Il,children:[l.jsx("g",{opacity:L?0:1,className:Ok(!!L),children:l.jsx(Gl,{scale:y,hideTicks:!0,hideAxisLine:!0,numTicks:f,tickFormat:$,left:qN,orientation:"right",tickLabelProps:G})}),l.jsx(Gl,{scale:N,hideAxisLine:!0,hideTicks:!0,numTicks:A,tickValues:k,tickFormat:I,orientation:"bottom",top:n-xs,tickLabelProps:KN}),l.jsx(wu,{tickValues:R,scale:y,width:t,stroke:tr.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx(Qb,{scale:N,opacity:.1,height:n*2,stroke:tr.gray,style:{transform:`translateY(-${n}px)`},numTicks:A,strokeWidth:1,tickValues:M})]},b)}),l.jsx(kt,{children:F.map((H,Q)=>l.jsx(Te.g,{initial:{opacity:0,transition:Il},exit:{opacity:0,transition:Il},animate:{stroke:H.color,opacity:ipt(s,H.quote.symbol),transition:{delay:0,duration:.25}},children:l.jsx(Jmt,{d:H.path,disableAnimation:w})},Q))}),l.jsx(kt,{children:l.jsx(G8,{width:t,yScale:y})}),L&&l.jsx(r_,{marginTop:-n,tooltipLeft:L.point.local.x,innerHeight:n*3,color:tr.gray}),l.jsx(ept,{data:L?.data,yScale:y})]}),o&&l.jsx("div",{className:"absolute -top-md right-sm z-[2]",children:o}),L&&l.jsx(s_,{x:L.point.local.x,y:L.point.local.y,pill:!0,children:l.jsx(npt,{data:L.data,timeZone:m,x:L.point.local.x,locale:i})})]})},cpt=d.memo(function({quotes:t,focused:n,height:r,setHoveredComparisons:s,watermark:o}){return l.jsx(Ar,{fallback:Ole,children:l.jsx(L8,{height:r,render:!!t?.length,children:(a,i)=>!t?.length||a<100||!t.every(c=>c?.history?.length)?null:l.jsx(lpt,{quotes:t,width:a,height:i,focused:n,setHoveredComparisons:s,watermark:o,zoomable:!0})})})}),upt=({root:e,quote:t,removeComparison:n,setFocused:r,className:s,href:o})=>{const a=d.useCallback(()=>{r(t.symbol)},[r,t.symbol]),i=d.useCallback(()=>{r(null)},[r]),c=d.useCallback(p=>{p.preventDefault(),p.stopPropagation(),i(),n?.(t.symbol)},[n,t.symbol,i]),{session:u}=je(),{trackEvent:f}=Ke(u),m=d.useCallback(()=>{f("finance link clicked",{referrer:Cb.CHART_COMPARISON,targetPageType:Jg.ASSET_PAGE,symbol:t.symbol,destinationUrl:o})},[t.symbol,o,f]);return l.jsxs(Zg,{href:o,className:z("hover:bg-subtler flex items-center justify-start duration-150",{"bg-subtlest":e},s),onMouseEnter:a,onMouseLeave:i,onClick:m,children:[l.jsx(K,{className:"w-xs my-xs ml-xs shrink-0 self-stretch rounded-full",style:{background:t.color}}),l.jsxs(K,{className:"p-sm py-xs gap-sm md:gap-md flex w-full items-center justify-between",children:[l.jsxs(K,{className:z("gap-sm duration-quick grid w-full items-center transition-opacity [grid-template-columns:2fr_1fr_1fr] md:[grid-template-columns:5fr_1fr_1fr_1fr]",{"pointer-events-none opacity-0":t.loading}),children:[l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Xg,{symbol:t.symbol??"",src:t.image??"",srcDark:t.imageDark??""}),l.jsxs(K,{children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-1 text-ellipsis",children:t.name??t.symbol}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:t.symbol,exchange:t.exchange})})]})]}),l.jsx("span",{children:vd(t.price)&&l.jsx(hf,{variant:"small",price:t.price??0,currency:t.currency,animated:!1,className:"text-right"})}),l.jsx("span",{className:"hidden text-center md:block",children:vd(t.historicalChange)&&l.jsx(hf,{variant:"small",price:t.historicalChange??0,currency:t.currency,animated:!1,sign:!0})}),l.jsx("span",{children:vd(t.historicalPercentChange)&&l.jsx(o_,{change:t.historicalPercentChange??0,variant:"tiny",includeIcon:!0,mono:!1,animated:!1})})]}),!!n&&l.jsx(K,{className:z("flex items-center justify-end active:scale-95",{"pointer-events-none invisible":e}),children:l.jsx(ze,{onClick:c,variant:"border",icon:B("x"),pill:!0,size:"tiny"},t.symbol)})]})]})},gce=d.memo(({comparisons:e,removeComparison:t,setFocused:n,root:r})=>{const s=d.useCallback(()=>{n(null)},[n]),o=d.useCallback(a=>{const i=[a.symbol,...e.map(c=>c.symbol).filter(c=>c!==a.symbol)];return`/finance/${a.symbol}?comparing=${i.join(",")}`},[e]);return l.jsx(K,{className:"m-0 flex flex-col overflow-hidden p-0",onMouseLeave:s,children:e.map((a,i)=>l.jsx(upt,{quote:a,root:i===(r??0),removeComparison:t,setFocused:n,href:o(a)},`${a.symbol}-${i===(r??0)}`))})});gce.displayName="FinanceStockHistoryComparisonList";const dpt=({id:e,candlestick:t,setCandlestick:n})=>l.jsxs(Qa.Root,{className:su,value:t?"candlestick":"line",onChange:r=>{n(r==="candlestick")},id:`candlestick-toggle-${e}`,children:[l.jsx(Qa.Item,{style:H2,value:"line",children:l.jsx(ft,{name:B("chart-line"),size:16})}),l.jsx(Qa.Item,{style:H2,value:"candlestick",children:l.jsx(ft,{name:B("chart-candle"),size:16})})]}),q5=d.memo(({setRange:e,range:t,onApply:n})=>{const{$t:r}=J(),s=d.useMemo(()=>({after:new Date}),[]),o=d.useMemo(()=>t?.from??new Date,[t]),a=d.useCallback(()=>{e(void 0)},[e]);return l.jsxs(K,{className:"flex flex-col w-fit",children:[l.jsx(j6,{captionLayout:"dropdown",disabled:s,defaultMonth:o,onSelect:e,selected:t,mode:"range",className:"w-fit"}),l.jsxs(K,{className:"gap-sm flex justify-end px-md pb-sm",children:[l.jsx(Ct,{size:"tiny",onClick:a,variant:"secondary",children:r({id:"jm/spnRSn+",defaultMessage:"Reset"})}),l.jsx(Ct,{size:"tiny",fullWidth:!0,onClick:n,disabled:!t?.from,variant:t?.from?"primary":"secondary",children:r({id:"EWw/tKINJT",defaultMessage:"Apply"})})]})]})});q5.displayName="CalendarContent";function fpt({id:e,periods:t,period:n,setPeriod:r,variant:s,calendar:o=!1}){const[a,i]=d.useState(!1),[c,u]=d.useState(!1),[f,m]=d.useState(void 0),p=d.useMemo(()=>t.find(b=>b.value===n),[t,n]),{$t:h}=J(),g=d.useCallback(()=>{if(f?.from){const b=f?.to??f.from;r(`${N7(f.from)}~${N7(b)}`),u(!1),i(!1)}},[f,r]),y=d.useCallback(b=>{b.stopPropagation(),u(_=>!_)},[]),x=d.useCallback(()=>{u(!1)},[]),v=d.useCallback(()=>{u(!0)},[]);return s==="sm"?l.jsx(K,{className:z(su,"flex items-center"),variant:"transparent",style:{minHeight:Ah},children:l.jsxs(_t,{isOpen:a,onToggle:i,maxHeightPx:500,triggerElement:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center h-full pl-sm pr-xs cursor-pointer",children:[p?.text??h({id:"Sjo1P44FYy",defaultMessage:"Custom"}),l.jsx(ft,{name:B("chevron-down"),size:16})]}),children:[t.map(({value:b,text:_})=>l.jsx(_t.Item,{onSelect:()=>{r(b),i(!1)},children:_},b)),o&&l.jsx(_t,{isOpen:c,onToggle:u,triggerElement:l.jsx(_t.Button,{variant:"text",size:"small",children:h({id:"Sjo1P44FYy",defaultMessage:"Custom"})}),children:l.jsx(K,{className:"flex justify-center items-start h-full",style:{minHeight:350},children:l.jsx(q5,{setRange:m,range:f,onApply:g})})})]})}):l.jsxs(Qa.Root,{value:n,className:su,id:`${e}-periods`,onChange:b=>{b&&r(b)},children:[t.map(({value:b,text:_})=>l.jsx(Qa.Item,{value:b,style:H2,children:l.jsx(V,{variant:"tiny",color:n===b?"default":"light",className:"translate-y-px whitespace-nowrap duration-150",children:_})},b)),o&&l.jsx(Qa.Item,{value:JN(n)?n:"",onClick:y,style:H2,children:l.jsx(xb,{isOpen:c,onClose:x,onOpen:v,isMobileStyle:!1,contentWidth:"auto",avoidCollisions:!0,placement:"top",sideOffset:15,childrenClassName:"inline-flex",content:l.jsx(q5,{setRange:m,range:f,onApply:g}),children:l.jsx(ft,{name:B("calendar"),size:16,className:z({"text-super":c})})})})]})}const q8=d.memo(fpt),yce=d.memo(({peers:e,addComparison:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),{isMobileStyle:o}=Re(),a=d.useRef(null),i=d.useRef(null),c=d.useRef(null);V8({isOpen:r,onClose:()=>s(!1),refs:o?[a,i]:[c]});const u=d.useMemo(()=>e.map(h=>h)?.slice(0,5),[e]),f=d.useCallback(h=>{h&&(t({symbol:h.symbol,name:h.name,image:h.image,imageDark:h.darkImage,exchange:h.exchange,price:h.currentPrice,currency:h.currency,historicalChange:h.change,historicalPercentChange:h.changesPercentage}),s(!1))},[t]),m=l.jsx("button",{ref:a,onClick:()=>s(h=>!h),className:z(su,"px-sm group h-full bg-transparent transition-transform"),children:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center pt-px duration-200 ease-out group-active:scale-95",children:[n({defaultMessage:"Compare",id:"493J7RI1tF"}),l.jsx(ft,{name:B("chevron-down"),className:"size-3"})]})}),p=l.jsx(qle,{defaultSuggestions:u,onClick:f});return o?l.jsxs(l.Fragment,{children:[m,r&&l.jsx(Jl,{children:l.jsxs("div",{ref:i,className:"bg-base border-subtlest shadow-overlay fixed inset-x-0 top-0 z-50 flex flex-col overflow-hidden rounded-b-xl border-x border-b",children:[l.jsx("div",{className:"flex flex-shrink-0 items-center justify-start",children:l.jsx("button",{className:"p-md",onClick:()=>s(!1),children:l.jsx(ft,{name:B("arrow-left"),className:"text-quiet size-5"})})}),l.jsx(K,{className:"flex-1 overflow-auto",children:p})]})})]}):l.jsxs("div",{ref:c,className:"relative",children:[m,r&&l.jsx(K,{className:"z-100 absolute right-0 top-full mt-2 w-[360px] overflow-hidden rounded-xl border shadow-md",children:l.jsx("div",{className:"bg-base",children:p})})]})});yce.displayName="FinanceStockHistoryCompareInput";const mpt=T.memo(({children:e})=>l.jsx(Ar,{fallback:null,children:l.jsx("div",{className:"h-full",children:e})}));mpt.displayName="CanonicalSidebarSection";const ppt=T.memo(({children:e,className:t})=>l.jsx("div",{className:z("mt-md pb-lg space-y-lg",t),children:e}));ppt.displayName="CanonicalSidebarColumn";const hpt=T.memo(({children:e,className:t})=>l.jsx(V,{variant:"smallBold",className:z("pb-sm px-sm",t),children:e}));hpt.displayName="CanonicalSidebarSectionTitle";const xce=T.memo(({children:e,className:t,variant:n})=>l.jsx(mr,{variant:n,className:z("py-sm",t),children:e}));xce.displayName="CanonicalSidebarSectionContent";const gpt="-my-sm gap-x-sm grid w-full grid-cols-[1fr_min-content_min-content]",ypt=T.memo(e=>{const{isLoading:t,isStale:n,movers:r,skinny:s,approxItemCount:o,itemProps:a,referrer:i}=e;return l.jsx(xce,{className:z("overflow-hidden duration-150",{"opacity-50":t}),children:l.jsx(Te.div,{className:z(gpt,{"pointer-events-none invisible":t}),initial:{opacity:0},animate:{opacity:n?.5:1},exit:{opacity:0},transition:{duration:.5},"aria-hidden":t,children:t?l.jsx(xpt,{size:o??5,...e}):r?.map(c=>d.createElement(vce,{...a,key:c.symbol,symbol:c.symbol,price:c.price,exchange:c.exchange??void 0,currency:c.currency??void 0,name:c.name??"",changesPercentage:c.changesPercentage,skinty:s,useImage:!s,image:c.image??void 0,imageDark:c.imageDark??void 0,referrer:i}))},"top-mover")})});ypt.displayName="MoverTable";const vce=e=>e.skinty?l.jsx(bpt,{...e}):l.jsx(vpt,{...e}),xpt=({size:e,...t})=>[...Array(e).fill(null)].map((n,r)=>l.jsx(vce,{...t,symbol:"NVDA",price:110,currency:"USD",name:"XXX",changesPercentage:110,exchange:"XX",useImage:!t.skinny,skinty:t.skinny},r)),vpt=e=>l.jsx(xae,{symbol:e.symbol,referrer:e.referrer,className:"col-span-3 flex min-w-0",children:l.jsx(bce,{...e})});function bpt({symbol:e,name:t,price:n,currency:r,changesPercentage:s,trailingComponent:o,referrer:a}){return l.jsxs(xae,{symbol:e,referrer:a,className:"col-span-3 grid grid-cols-subgrid",children:[l.jsx(LN,{name:t,variant:"small"}),l.jsx(hf,{price:n,currency:r}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(i_,{changesPercentage:s,includeIcon:!0,variant:"tiny",className:"w-full"}),o&&o({symbol:e})]})]})}const i_=T.memo(({changesPercentage:e,background:t,variant:n,includeIcon:r=!1,className:s,suffix:o,animated:a})=>l.jsx(o_,{change:e,variant:n,includeIcon:r,background:t,mono:!1,suffix:o,className:s,animated:a}));i_.displayName="FinanceMoverChange";const bce=T.memo(({symbol:e,price:t,currency:n,name:r,changesPercentage:s,useImage:o=!0,exchange:a,image:i,imageDark:c,trailingComponent:u,className:f})=>l.jsxs("div",{className:z("gap-sm flex w-full min-w-0 items-center",{"-ml-xs":!!o},f),children:[o&&l.jsx(Xg,{symbol:e,src:i??"",srcDark:c,size:"lg"}),l.jsxs(K,{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs(K,{className:"gap-md flex min-w-0 items-end justify-between",children:[l.jsx(LN,{name:r}),l.jsx(hf,{price:t,currency:n,className:"leading-snug"})]}),l.jsxs(K,{className:"gap-sm flex items-start justify-between text-right",children:[l.jsx(V,{variant:"tinyMono",className:"whitespace-nowrap leading-snug",color:"light",children:l.jsx(e0,{symbol:e,exchange:a})}),l.jsx(i_,{changesPercentage:s,background:!1,animated:!1,className:"leading-tight"})]})]}),u&&u({symbol:e})]}));bce.displayName="FinanceMover";const Iy={operatingActivities:"Operating Activities",netIncome:"Net Income",depreciationAndAmortization:"Dep. & Amort.",deferredIncomeTax:"Deferred Tax",stockBasedCompensation:"Stock-Based Comp.",changeInWorkingCapital:"Change in WC",otherNonCashItems:"Other Non-Cash",netCashProvidedByOperatingActivities:"Operating Cash Flow",investingActivities:"Investing Activities",investmentsInPropertyPlantAndEquipment:"PP&E Inv.",acquisitionsNet:"Net Acquisitions",purchasesOfInvestments:"Inv. Purchases",salesMaturitiesOfInvestments:"Inv. Sales/Matur.",otherInvestingActivites:"Other Inv. Act.",netCashUsedForInvestingActivites:"Investing Cash Flow",financingActivities:"Financing Activities",debtRepayment:"Debt Repay.",commonStockIssued:"Stock Issued",commonStockRepurchased:"Stock Repurch.",dividendsPaid:"Dividends Paid",otherFinancingActivites:"Other Fin. Act.",netCashUsedProvidedByFinancingActivities:"Financing Cash Flow",effectOfForexChangesOnCash:"Forex Effect",netChangeInCash:"Net Chg. in Cash",supplementalInformation:"Supplemental Information",operatingCashFlow:"Operating Cash Flow",capitalExpenditure:"Capital Expenditures",cashAtBeginningOfPeriod:"Beg. Cash",cashAtEndOfPeriod:"End Cash",freeCashFlow:"Free Cash Flow"},Ia={revenue:"Revenue",percentageOfGrowth:"% Growth",costOfRevenue:"Cost of Goods Sold",grossProfit:"Gross Profit",grossProfitRatio:"% Margin",researchAndDevelopmentExpenses:"R&D Expenses",generalAndAdministrativeExpenses:"G&A Expenses",sellingGeneralAndAdministrativeExpenses:"SG&A Expenses",sellingAndMarketingExpenses:"Sales & Mktg Exp.",otherExpenses:"Other Operating Expenses",operatingExpenses:"Operating Expenses",operatingIncome:"Operating Income",operatingIncomeRatio:"% Margin",totalOtherIncomeExpensesNet:"Other Income/Exp. Net",incomeBeforeTax:"Pre-Tax Income",incomeTaxExpense:"Tax Expense",netIncome:"Net Income",netIncomeRatio:"% Margin",eps:"EPS",epsRatio:"% Growth",epsdiluted:"EPS Diluted",weightedAverageShsOut:"Weighted Avg Shares Out",weightedAverageShsOutDil:"Weighted Avg Shares Out Dil",supplementalInformation:"Supplemental Information",interestIncome:"Interest Income",interestExpense:"Interest Expense",depreciationAndAmortization:"Depreciation & Amortization",ebitda:"EBITDA",ebitdaratio:"% Margin"},_pt={assets:"Assets",cashAndCashEquivalents:"Cash & Equivalents",shortTermInvestments:"Short-Term Investments",netReceivables:"Receivables",inventory:"Inventory",otherCurrentAssets:"Other Curr. Assets",totalCurrentAssets:"Total Curr. Assets",propertyPlantEquipmentNet:"Property Plant & Equip (Net)",goodwill:"Goodwill",intangibleAssets:"Intangibles",longTermInvestments:"Long-Term Investments",taxAssets:"Tax Assets",otherNonCurrentAssets:"Other NC Assets",totalNonCurrentAssets:"Total NC Assets",otherAssets:"Other Assets",totalAssets:"Total Assets",liabilities:"Liabilities",accountPayables:"Payables",shortTermDebt:"Short-Term Debt",taxPayables:"Tax Payable",deferredRevenue:"Def. Revenue",otherCurrentLiabilities:"Other Curr. Liab.",totalCurrentLiabilities:"Total Curr. Liab.",longTermDebt:"LT Debt",deferredRevenueNonCurrent:"Def. Rev. NC",deferredTaxLiabilitiesNonCurrent:"Def. Tax Liab. NC",otherNonCurrentLiabilities:"Other NC Liab.",totalNonCurrentLiabilities:"Total NC Liab.",otherLiabilities:"Other Liab.",capitalLeaseObligations:"Cap. Leases",totalLiabilities:"Total Liab.",equity:"Equity",preferredStock:"Pref. Stock",commonStock:"Common Stock",retainedEarnings:"Ret. Earnings",accumulatedOtherComprehensiveIncomeLoss:"AOCI",othertotalStockholdersEquity:"Other Equity",totalEquity:"Total Equity",supplementalInformation:"Supplemental Information",minorityInterest:"Min. Interest",totalLiabilitiesAndTotalEquity:"Total Liab. & Tot. Equity",totalInvestments:"Total Inventory",totalDebt:"Total Debt",netDebt:"Net Debt"},wpt={marketCapitalization:"Market Cap",minusCashAndCashEquivalents:"- Cash",addTotalDebt:"+ Debt",enterpriseValue:"Enterprise Value",revenue:Ia.revenue,percentageOfGrowth:Ia.percentageOfGrowth,grossProfit:Ia.grossProfit,grossProfitRatio:Ia.grossProfitRatio,ebitda:Ia.ebitda,ebitdaratio:Ia.ebitdaratio,netIncome:Ia.netIncome,netIncomeRatio:Ia.netIncomeRatio,epsdiluted:Ia.epsdiluted,epsdilutedratio:"% Growth",netCashProvidedByOperatingActivities:Iy.netCashProvidedByOperatingActivities,capitalExpenditure:Iy.capitalExpenditure,freeCashFlow:Iy.freeCashFlow},zh=new Set(["grossProfitRatio","percentageOfGrowth","ebitdaratio","operatingIncomeRatio","incomeBeforeTaxRatio","netIncomeRatio","epsRatio","epsdilutedratio"]),Cpt=new Set(["eps","epsdiluted","weightedAverageShsOut","weightedAverageShsOutDil"]);[...zh];[...zh],[...zh];const Spt=new Set([...Object.keys(_pt),...Object.keys(Ia),...Object.keys(Iy),...Object.keys(wpt)].filter(e=>!zh.has(e)&&!Cpt.has(e)));[...Spt];({...Object.fromEntries([...zh].map(e=>[e,1]))});function Ept(e,t){const n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function kpt(e,t){return t&&JN(t)&&e?.length?{startDate:e[0].date,endDate:e[e.length-1].date}:t!=="1d"&&e?.length?{startDate:e[0].date,endDate:e[e.length-1].date}:{startDate:void 0,endDate:void 0}}const _ce=({price:e,currency:t,change:n,percentChange:r,children:s,className:o,variant:a})=>{const i=d.useMemo(()=>({style:t?"currency":"decimal",currency:t??void 0,minimumFractionDigits:e<1e3?2:0,maximumFractionDigits:2}),[t,e]),c=a==="sm",u=c?"tiny":"base";return l.jsxs(K,{className:z("flex w-full flex-col",o),children:[l.jsxs(K,{className:"gap-sm flex w-full items-center justify-start",children:[l.jsx(V,{variant:c?"baseSemi":"entry-title-200",className:"m-0 p-0",children:l.jsx(wb,{value:e,format:i,animated:!0})}),l.jsxs(K,{className:"gap-xs flex items-center",children:[!c&&l.jsx(hf,{price:n??0,currency:t,sign:!0,variant:u,animated:!0}),l.jsx(i_,{animated:!0,changesPercentage:r??0,variant:u,background:!1,includeIcon:!0})]})]}),l.jsx(K,{className:"gap-sm flex items-center justify-start",children:s})]})},wce="flex items-center gap-xs truncate min-w-0",Cce=T.memo(({price:e,currency:t,change:n,percentChange:r,timestamp:s,open:o,closes:a,timezone:i,variant:c,period:u,startDate:f,endDate:m})=>{const{$t:p,locale:h}=J(),g=d.useMemo(()=>{const y=JN(u);if(u!=="1d"&&f&&m){const v=new Date(f),b=new Date(!y&&s?s*1e3:m),_=N=>N.toLocaleDateString(h,{month:"short",day:"numeric",year:"numeric",timeZone:i}),w=N=>N.toLocaleString(h,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:c==="lg"?"2-digit":void 0,timeZoneName:"short",timeZone:i}),S=y&&Ept(f,m),C=_(v),E=y?_(b):w(b);return y?S?C:p({defaultMessage:"{startDate} – {endDate}",id:"5Rl2zbDuSl"},{startDate:C,endDate:E}):p({defaultMessage:"{startDate} – {endDate}",id:"5Rl2zbDuSl"},{startDate:C,endDate:E})}const x=s?new Date(s*1e3).toLocaleTimeString(h,{hour:"numeric",minute:"2-digit",day:"numeric",month:"short",second:c==="lg"?"2-digit":void 0,timeZoneName:"short",timeZone:i}):null;if(c==="sm"){if(!o&&a&&s){const b=new Date(s*1e3).toLocaleDateString(h,{month:"short",day:"numeric",timeZone:i});return p({defaultMessage:"At close: {date}",id:"9BKLglSBhn"},{date:b})}return x}return o&&a?p({defaultMessage:"Regular session: {time}",id:"rfeIMcMmh2"},{time:x}):!o&&a?p({defaultMessage:"At close: {time}",id:"Fib7mn4gfB"},{time:x}):x},[s,h,o,p,a,i,c,u,f,m]);return l.jsx(_ce,{price:e,currency:t,change:n,percentChange:r,variant:c,children:l.jsx(V,{variant:"tinyRegular",color:"light",className:wce,children:g})})});Cce.displayName="StockPriceBig";const Sce=T.memo(({price:e,currency:t,change:n,percentChange:r,timestamp:s,timezone:o,variant:a,afterHoursType:i})=>{const{$t:c,locale:u}=J(),{isMobileStyle:f}=Re(),m=new Date(s*1e3).toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",second:f?void 0:"2-digit",day:"numeric",month:"short",timeZoneName:f?void 0:"short",timeZone:o}),p=d.useMemo(()=>{const y=i==="pre_market"?W({defaultMessage:"Pre-market: {time}",id:"ok47wYkpHy"}):W({defaultMessage:"After-hours: {time}",id:"e87RdWfWOJ"});return c(y,{time:m})},[i,m,c]),h=d.useMemo(()=>{if(a==="sm"){const g=i==="pre_market",y=new Date(s*1e3).toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:o}),x=g?W({defaultMessage:"Pre-market: {time}",id:"ok47wYkpHy"}):W({defaultMessage:"After-hours: {time}",id:"e87RdWfWOJ"});return c(x,{time:y})}return null},[a,i,s,u,o,c]);return l.jsx(_ce,{price:e,currency:t,change:n,percentChange:r,variant:a,children:l.jsx(V,{variant:"tinyRegular",color:"light",className:wce,children:a==="sm"?h:p})})});Sce.displayName="AfterHoursPriceBig";const _B=({children:e,grow:t=!0,className:n})=>l.jsx(K,{className:z("px-md py-sm",t?"flex-1":"w-full",n),children:e}),Ece=T.memo(({quote:e,period:t,context:n="canonical"})=>{const r=!!e.afterHoursPrice&&t==="1d";jf("mini-graphs");const{isMobileStyle:s}=Re(),o=s&&r?"sm":"lg",a=d.useMemo(()=>kpt(e.history,t),[e.history,t]),i=d.useMemo(()=>l.jsx(Cce,{variant:o,price:e.price,currency:e.currency,change:e.historicalChange,percentChange:e.historicalPercentChange,period:t??void 0,timestamp:e.timestamp,open:e.isMarketOpen,closes:e.exchange!=="CRYPTO",timezone:e.exchangeTimezone??void 0,startDate:a.startDate,endDate:a.endDate}),[e,o,t,a]),c=d.useMemo(()=>l.jsx(Sce,{price:e.afterHoursPrice,change:e.afterHoursChange,percentChange:e.afterHoursPercentChange,timestamp:e.afterHoursTimestamp,currency:e.currency,timezone:e.exchangeTimezone??void 0,variant:o,afterHoursType:e.afterHoursType??null}),[e,o]);return l.jsx(K,{variant:"raised",className:z("relative",n==="thread"?"border-t rounded-none":"border-x border-b-0 border-t rounded-b-none rounded-t-xl"),children:l.jsxs(K,{className:"flex",children:[l.jsx(_B,{grow:r,className:r?"border-r border-subtlest":void 0,children:i}),r&&l.jsx(_B,{grow:!0,children:c})]})})});Ece.displayName="BeforeAfterHours";const Mpt=Ue({"1min":{defaultMessage:"1 min",id:"D2/3tXpws9"},"5min":{defaultMessage:"5 min",id:"TVHUbnv1cj"},"15min":{defaultMessage:"15 min",id:"OOAN7GDaOG"},"30min":{defaultMessage:"30 min",id:"z+jvO3E6rw"},"1hour":{defaultMessage:"1 hour",id:"68LTymxJcs"},"4hour":{defaultMessage:"4 hours",id:"SiO/3GrQZY"},"1day":{defaultMessage:"1 day",id:"+7PjfVlUMl"},"1week":{defaultMessage:"1 week",id:"LTNKL8T1Dn"},"1month":{defaultMessage:"1 month",id:"p1dNdsvErg"}}),Tpt=d.memo(function({availableIntervals:t,currentInterval:n,setInterval:r}){const{$t:s}=J(),o=d.useCallback(a=>{r(a)},[r]);return!t?.length||!n?null:l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",className:"pb-sm px-xs",children:s({defaultMessage:"Price Interval",id:"okQNyMzaX6"})}),l.jsx(K,{children:l.jsx(Qa.Root,{value:n,onChange:o,className:"flex items-center w-fit",id:"interval",children:t.map(a=>l.jsx(Qa.Item,{value:a,children:l.jsx(V,{variant:"tiny",color:n===a?"default":"light",className:"whitespace-nowrap",children:s(Mpt[a])})},a))})})]})}),Apt=[],Npt=7,Rpt=Bot.map(e=>({text:jae[e],value:e})),kce=e=>{const[t,n]=e.split("~");return t&&n?{type:"range",range:{start:t,end:n}}:{type:"period",period:t}},Dpt=({symbol:e,period:t,interval:n})=>({prefix:"finance/chart",symbol:e,historyPeriod:t,withHistory:!0,historyAfterHours:["1d","5d","1m"].includes(t),historyRedirect:!0,historyInterval:n,withUiHints:!0}),jpt=(e,t,n,r)=>{const s=d.useRef(new Set),o=!n,a=Xt();d.useEffect(()=>{s.current.has(e)||!o||r?.length},[e,o,r,a,t])},Ipt=(e,t,n,r)=>{const s=d.useMemo(()=>X6(Dpt({symbol:e,period:n,interval:r})),[n,r,e]),o=gt({queryKey:s,queryFn:async()=>{const a=kce(n);if(a.type==="range"){const c=await tu({symbol:e,historyPeriod:void 0,historyStartDate:a.range.start,historyEndDate:a.range.end,historyInterval:r,withHistory:!0,historyAfterHours:Math.abs(Vot(a.range.start,a.range.end))<30});return{quote:c,interval:c?.uiHints?.currentInterval??null,period:c?.uiHints?.currentPeriod??n,pendingPeriod:void 0}}const i=await tu({symbol:e,historyPeriod:a.period,withHistory:!0,historyAfterHours:["1d","5d","1m"].includes(a.period),historyRedirect:!0,historyInterval:r,withUiHints:!0,historyStartDate:void 0,historyEndDate:void 0});return{quote:i,interval:i?.uiHints?.currentInterval??r,period:i?.uiHints?.currentPeriod??n,pendingPeriod:void 0}},refetchInterval:5e3,staleTime:1/0,placeholderData:a=>{if(a)return{...a,interval:r??a.interval,period:a.period??n,pendingPeriod:n};if(t)return{quote:t,interval:r,period:t?.uiHints?.currentPeriod??n,pendingPeriod:void 0}}});return jpt(e,n,o.isLoading,o.data?.quote?.uiHints?.availablePeriods),{isLoading:o.isLoading||o.isPlaceholderData,quote:o.data?.quote??null,interval:o.data?.interval??null,period:o.data?.period??null,pendingPeriod:o.data?.pendingPeriod}},Ppt=(e,t,n,r)=>{const s=Xt(),o=gt({queryKey:be.makeEphemeralQueryKey("finance/comparison",t,...e),queryFn:async()=>{const a=kce(t),i=e.map(async f=>{if(a.type==="range")return await s.ensureQueryData({queryKey:be.makeEphemeralQueryKey("finance/history",f,a.range.start,a.range.end),queryFn:()=>tu({symbol:f,historyPeriod:void 0,historyStartDate:a.range.start,historyEndDate:a.range.end,historyAfterHours:!1,historyRedirect:!1,withUiHints:!0,withHistory:!0}),staleTime:3e4});const m={prefix:"finance/comparison",symbol:f,historyPeriod:a.period,withHistory:!0,historyRedirect:!1,historyAfterHours:!1};return await s.ensureQueryData({queryKey:X6(m),queryFn:()=>tu(m),staleTime:3e4})});return{quotes:(await Promise.all(i))?.filter(f=>!!f)?.map((f,m)=>({...f,color:Kp(m,r)}))??[],period:t,pendingPeriod:void 0}},placeholderData:a=>{if(a)return{...a,period:a.period??t,pendingPeriod:t}},refetchInterval:3e4,enabled:n});return{isLoading:o.isLoading,quotes:o.data?.quotes??Apt,period:o.data?.period??null,pendingPeriod:o.data?.pendingPeriod??void 0}},Opt=e=>{const t=Ln(),n=ec(t),r=mn();d.useEffect(()=>{t&&n&&t!==n&&!r?.get("comparing")&&e([])},[t,n,r,e])},Lpt=(e,t,n,r)=>{const s=mn(),o=Dn(),a=d.useCallback(S=>{const C=new URLSearchParams(window.location.search);C.set("comparing",S.join(",")),o.replace(`?${C.toString()}`)},[o]),[i,c]=d.useState(s?.get("comparing")?.split(",")??r??[]),u=d.useMemo(()=>[e,...i.filter(S=>S!==e)],[i,e]),f=u.length>1,[m,p]=d.useState({}),h=d.useCallback(S=>{S.symbol&&c(C=>{const E=[...new Set([e,...C,S.symbol])];return E.length>Npt&&E.splice(-2,1),a(E),p(N=>({...Object.fromEntries(Object.entries(N).filter(([k])=>E.includes(k))),[S.symbol]:S})),E})},[c,p,e,a]),g=d.useCallback(S=>{c(C=>{const E=C.filter(N=>N!==S);return a(E),E}),p(C=>{const E={...C};return delete E[S],E})},[c,p,a]),y=d.useCallback(()=>{c([])},[]);Opt(c);const x=Ppt(u,t,f,n),{comparisonQuotes:v,setHoveredComparisons:b}=Bpt(u,x.quotes,m,n),_=Fpt(e,u);return{peers:d.useMemo(()=>_.data.filter(S=>!u.includes(S.symbol)),[_.data,u]),isComparing:f,quotes:x.quotes,comparisonQuotesLoading:x.isLoading,comparisonQuotes:v,setHoveredComparisons:b,addComparison:h,removeComparison:g,resetComparisons:y,period:x.period,pendingPeriod:x.pendingPeriod}},Fpt=(e,t)=>{const{data:n,isLoading:r,isPlaceholderData:s}=gt({queryKey:dqe(e,!0),queryFn:()=>fqe({symbol:e,index:!0}),placeholderData:$l}),o=d.useMemo(()=>n?.filter(a=>!t.some(i=>i===a.symbol)&&a.symbol!==e)??[],[n,t,e]);return d.useMemo(()=>({data:o,isLoading:r||s}),[o,r,s])},Bpt=(e,t,n,r)=>{const[s,o]=d.useState([]),a=d.useMemo(()=>e.map((f,m)=>{const p=t.find(g=>g.symbol===f)??n[f];return p?{symbol:p.symbol,name:p.name,image:p.image,imageDark:p.imageDark,exchange:p.exchange,currency:p.currency||void 0,price:p.price,exchangeTimezone:p.exchangeTimezone,historicalChange:p.historicalChange,historicalPercentChange:p.historicalPercentChange,color:Kp(m,r)}:{symbol:f,loading:!0,color:Kp(m,r)}}),[e,t,n,r]),i=d.useMemo(()=>s.map((u,f)=>({...u,color:Kp(f,r)})),[s,r]),c=i.length>0?i:a;return d.useMemo(()=>({comparisonQuotes:c,setHoveredComparisons:o}),[c,o])},Mce=(e,t)=>d.useMemo(()=>{const n=e?.length?e:Rpt.map(s=>s.value);return(t?n.filter(s=>s!=="5d"):n).map(s=>({text:jae[s],value:s}))},[e,t]),Upt=({children:e,context:t})=>l.jsx(K,{noBorder:!0,className:z("overflow-hidden border-t border-subtlest",t==="thread"?"rounded-none":"border-b rounded-b-xl"),children:e}),wB=({symbol:e,comparisons:t,initialQuote:n,fullscreen:r,setFullscreen:s,chartHeight:o=225,zoomable:a=!0,context:i="canonical"})=>{const{isMobileStyle:c}=Re(),u=mn(),f=u?.get("period"),m=u?.get("interval"),[p,h]=d.useState(m??n?.uiHints?.currentInterval??null),[g,y]=d.useState(f??n?.uiHints?.currentPeriod??"1d"),[x,v]=d.useState(null),[b,_]=d.useState(!1),w=c?null:x,S=hce(),C=Ipt(e,n,g,p),E=Lpt(e,g,S,t),N=!b&&E.isComparing,k=Mce(C.quote?.uiHints?.availablePeriods,E.isComparing),I=Fmt(),{variant:M,containerRef:A}=Wst({isMobileStyle:c});return C.quote?l.jsxs(K,{className:"flex flex-col",children:[l.jsx(Ece,{quote:C.quote,period:N?E.period:C.period,context:i}),l.jsxs(K,{variant:"raised",className:z("relative",i==="thread"?"border-y rounded-none":z("border-x border-t rounded-t-none rounded-b-xl",r&&"border-b")),children:[l.jsxs(K,{className:"gap-y-sm relative flex flex-col justify-between",children:[l.jsxs(Tce,{isLoading:C.isLoading,children:[!N&&l.jsx($8,{id:`history-chart-${e}`,quote:C.quote,technical:!0,height:o,candlestick:b,indicators:I,watermark:l.jsx(Th,{}),zoomable:a}),N&&l.jsx(cpt,{quotes:E.quotes,focused:w,height:o,setHoveredComparisons:E.setHoveredComparisons,watermark:l.jsx(Th,{})})]}),l.jsxs(K,{ref:A,className:"z-1 p-sm absolute inset-x-0 top-0 flex justify-between items-stretch",children:[l.jsxs(K,{className:"gap-sm flex flex-start",children:[l.jsx(q8,{id:e,periods:k,period:N?E.pendingPeriod??E.period:C.pendingPeriod??C.period,setPeriod:y,calendar:!0,variant:M}),l.jsx(dpt,{id:e,candlestick:b,setCandlestick:_}),!b&&l.jsx(yce,{peers:E.peers,addComparison:E.addComparison}),!N&&l.jsxs(lce,{children:[l.jsx(Tpt,{setInterval:h,availableIntervals:C.quote?.uiHints?.availableIntervals,currentInterval:C.interval}),l.jsx(cce,{history:C.quote.history,indicators:I})]})]}),l.jsxs("div",{className:"gap-sm flex items-center justify-center",children:[!N&&l.jsx(Got,{quote:C.quote,animationId:e,period:N?E.period:C.period}),s&&!c&&l.jsx(uce,{setFullscreen:s,fullscreen:r})]})]})]}),N&&l.jsx(Upt,{context:i,children:l.jsx(gce,{comparisons:E.comparisonQuotes,removeComparison:E.removeComparison,setFocused:v})}),!N&&!r&&l.jsx(bae,{quote:C.quote,context:i})]})]}):null},Tce=T.memo(({children:e,isLoading:t})=>l.jsx(Te.div,{initial:{opacity:1},animate:{opacity:t?.5:1},transition:{duration:.5,delay:.5},style:{paddingTop:Ah+16+20},className:"relative overflow-hidden",children:e}));Tce.displayName="FinanceStockHistoryChartContainer";const Ace=d.memo(({symbol:e,watermark:t})=>{const[n,r]=d.useState("1d"),s=Re(),o={prefix:"finance/currency",symbol:e,historyPeriod:n,withHistory:!0,historyAfterHours:!1,historyRedirect:!1,withUiHints:!0},{data:a,isLoading:i}=gt({queryKey:X6(o),queryFn:async()=>({quote:await tu(o),period:n}),refetchInterval:5e3,staleTime:1/0,placeholderData:$l}),c=Mce(a?.quote?.uiHints?.availablePeriods,!1);return!i&&!a?.quote?.history?.length?null:l.jsxs(K,{className:"gap-md flex flex-col overflow-hidden border-t relative ",children:[l.jsx(K,{className:"px-md pt-sm flex z-10",children:l.jsx(q8,{id:e,periods:c,period:n,setPeriod:r,variant:s?"sm":"lg",calendar:!1})}),l.jsx($8,{id:`currency-chart-${e}`,quote:a?.quote,watermark:t,zoomable:!1})]})});Ace.displayName="FinanceThreadCurrencyChart";const Nce=T.memo(e=>{const{data:t}=e,{source_currency:n,target_currency:r,source_amount:s,converted_amount:o,exchange_rate:a}=t,i=!0,{menuItems:c}=im(),[u,f]=d.useState(s),[m,p]=d.useState(L(o)),[h,g]=d.useState(n),[y,x]=d.useState(r),[v,b]=d.useState(a),{colorScheme:_}=Ss(),w=_==="dark",{$t:S}=J(),C=`${h}${y}`,{data:E,isLoading:N,error:k}=gt({queryKey:mqe(h,y,u),queryFn:()=>pqe({sourceCurrency:h,targetCurrency:y,amount:u}),enabled:!!h&&!!y&&u>0}),I=d.useRef(E?.source_currency),M=d.useRef(E?.target_currency),A=d.useRef(E?.exchange_rate),D=d.useRef(E?.source_img),P=d.useRef(E?.source_img_dark),F=d.useRef(E?.target_img),R=d.useRef(E?.target_img_dark);d.useEffect(()=>{E&&(E?.source_currency!==I.current||E?.target_currency!==M.current)&&(p(L(E.converted_amount)),I.current=E.source_currency,M.current=E.target_currency),E&&E.exchange_rate!==A.current&&(b(E.exchange_rate),A.current=E.exchange_rate),E&&E.source_img!==D.current&&(D.current=E.source_img),E&&E.source_img_dark!==P.current&&(P.current=E.source_img_dark),E&&E.target_img!==F.current&&(F.current=E.target_img),E&&E.target_img_dark!==R.current&&(R.current=E.target_img_dark)},[E]);function j(G){return Rk.find(H=>H.currencyCode===G)}function L(G){return G>1?parseFloat(G.toFixed(2)):parseFloat(G.toPrecision(2))}function U(G){return G==="INR"||G==="PKR"||G==="BDT"||G==="NPR"}const O=j(h),$=j(y);return l.jsx(Es,{widgetType:"finance",widgetName:"currency_exchange",widgetSize:"full",children:l.jsx("div",{className:"gap-sm pb-sm flex flex-col overflow-visible",children:l.jsxs(mr,{shadow:!0,className:"w-full overflow-hidden",children:[l.jsxs(K,{variant:"subtler",className:"grid w-full grid-cols-1 gap-px md:grid-cols-2",children:[l.jsxs(K,{variant:"raised",className:"p-md pb-sm gap-sm flex w-full flex-col",children:[l.jsx("div",{className:"flex-1",children:l.jsxs(V,{variant:"entry-title-200",className:"flex font-mono !text-2xl",children:[l.jsx("span",{className:"text-quieter",children:O?.symbol}),l.jsx(Y5,{value:u.toString(),error:!!k,onChange:G=>{const H=parseFloat(G);f(H),H>0?p(L(H*v)):p(0)},formatting:U(O?.currencyCode)?"indian":"default"})]})}),l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsx(K5,{onSelect:G=>g(G),currency:O?S(O.currency):h,icon:O&&O.type==="crypto"?l.jsx(K,{variant:"subtler",className:"size-full overflow-hidden rounded-full",children:(w?P.current:D.current)&&l.jsx("img",{src:w?P.current??"":D.current??"",alt:S(O.currency),className:"size-full object-contain"})}):O&&O.type==="commodity"?l.jsx(K,{className:z("size-full rounded-full",{"!bg-[gold]":O?.currencyCode==="XAU","!bg-[silver]":O?.currencyCode==="XAG"})}):l.jsx(B2,{className:"size-full object-contain",countryCode:O?.countryCode})}),l.jsx("div",{className:"ml-auto grid grid-cols-1 grid-rows-1 items-center",children:l.jsxs(kt,{children:[N&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Rr,className:"col-start-1 row-start-1 ml-auto",children:l.jsx(V,{color:"ultraLight",children:l.jsx(ql,{size:12})})},"loading"),!N&&k&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Rr,className:"col-start-1 row-start-1 ml-auto",children:l.jsx(V,{color:"light",variant:"small",children:S({defaultMessage:"Not supported",id:"+FiyOTaUCW"})})},"error")]})})]})]}),l.jsxs(K,{variant:"raised",className:z("p-md pb-sm gap-md flex w-full flex-col",{"!gap-sm":i}),children:[l.jsx("div",{className:"flex-1",children:l.jsxs(V,{variant:"entry-title-200",color:"default",className:"flex font-mono !text-2xl",children:[l.jsx("span",{className:"text-quieter",children:$?.symbol}),l.jsx(Y5,{value:m.toString(),error:!!k,onChange:G=>{const H=parseFloat(G);p(H),H>0?f(L(H/v)):f(0)},formatting:U($?.currencyCode)?"indian":"default"})]})}),l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsx(K5,{onSelect:G=>x(G),currency:$?S($.currency):y,icon:$&&$.type==="crypto"?l.jsx(K,{variant:"subtler",className:"size-full overflow-hidden rounded-full",children:(w?R.current:F.current)&&l.jsx("img",{src:w?R.current??"":F.current??"",alt:S($.currency),className:"size-full object-contain"})}):$&&$.type==="commodity"?l.jsx(K,{className:z("size-full rounded-full",{"!bg-[gold]":$?.currencyCode==="XAU","!bg-[silver]":$?.currencyCode==="XAG"})}):l.jsx(B2,{className:"size-full object-contain",countryCode:$?.countryCode})}),c&&c.length>0&&l.jsx("div",{className:"ml-auto",children:l.jsx(Un.Menu,{menuItems:c})})]})]})]}),l.jsx(Ace,{symbol:C,watermark:l.jsx(Th,{})})]})})})});Nce.displayName="CurrencyConversion";const K5=T.memo(({currency:e,icon:t,onSelect:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re(),[o,a]=d.useState(""),i=d.useMemo(()=>["CNY","EUR","GBP","JPY","USD","BTC","ETH"].map(y=>Rk.find(x=>x.currencyCode===y)),[]),c=d.useMemo(()=>{const g=Rk.map(y=>({...y,localizedCurrency:r(y.currency)}));return new lm(g,{keys:["localizedCurrency","currencyCode","countryCode"],threshold:.3})},[r]),u=d.useMemo(()=>c.search(o)??[],[c,o]),f=d.useMemo(()=>i.map(g=>({type:"default",text:g?.currencyCode?r(g.currency):"",onClick:()=>{g?.currencyCode&&(n(g.currencyCode),a(""))}})),[i,n,r]),m=d.useMemo(()=>u.map(g=>({type:"default",text:r(g.item?.currency)??"",onClick:()=>{g?.item?.currencyCode&&(n(g.item?.currencyCode),a(""))}})),[u,n,r]),p=d.useMemo(()=>[{type:"default",text:r({defaultMessage:"No results",id:"jHJmjfxD4s"}),disabled:!0}],[r]),h=d.useMemo(()=>l.jsx(co,{autoFocus:!0,className:z({"!-mx-xs":s,"!px-xs py-sm mb-xs border-none !bg-transparent shadow-none outline-none focus:!ring-0":!s}),isMobileUserAgent:s,placeholder:r({defaultMessage:"Search currencies...",id:"fDMc8k+hJQ"}),value:o,onChange:g=>a(g),disable1pass:!0}),[s,o,r]);return l.jsx(Ws,{alwaysShowChildren:!0,placement:"bottom-start",showFooterOnMobile:!0,items:o.length>0?m.length>0?m:p:f,isMobileStyle:s,wrapperClassName:"flex",header:h,footer:s&&h,children:l.jsx(rt,{chevron:!0,noPadding:!0,extraCSS:"!px-sm -ml-sm",leadingComponent:l.jsx("div",{className:"mr-0.5 size-5",children:t}),variant:"primary",size:"small",text:e})})});K5.displayName="CurrencyPicker";const Y5=T.memo(({value:e,onChange:t,error:n,formatting:r="default"})=>n?l.jsx("span",{className:"!text-quieter",children:"---"}):l.jsx(gae,{className:z("placeholder:text-quieter w-full overflow-hidden bg-transparent transition-colors duration-200 [appearance:textfield] focus:outline-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"!text-quieter":n}),value:e??"",disabled:n,placeholder:"0",onChange:t,min:0,formatting:r}));Y5.displayName="ConversionInput";const D1=e=>e?new Date(e):void 0,Vpt=e=>({departureTime:new Date(e.departure_time),arrivalTime:new Date(e.arrival_time),actualDepartureTime:D1(e.actual_departure_time),actualArrivalTime:D1(e.actual_arrival_time),estimatedDepartureTime:D1(e.estimated_departure_time),estimatedArrivalTime:D1(e.estimated_arrival_time)}),Hpt=e=>!!(e.actualArrivalTime&&e.actualArrivalTime>e.arrivalTime||e.estimatedArrivalTime&&e.estimatedArrivalTime>e.arrivalTime),zpt=e=>{if(e.length===0)return[];if(e.length===1)return[[e[0]]];const t=[...e].sort((o,a)=>new Date(o.departure_time).getTime()-new Date(a.departure_time).getTime()),n=[],r=t[0];if(!r)return[];let s=[r];for(let o=1;o0&&s.length==n[n.length-1]?.length&&n.push(s),n},up=(e,t,n)=>{const r=ppe({start:e,end:t}),s=r.days||0,o=r.hours||0,a=r.minutes||0;return s>0?o===0&&a===0?n({id:"sSynIO3ThU",defaultMessage:"{days}d"},{days:s}):a===0?n({id:"10cSZzeWte",defaultMessage:"{days}d {hours}h"},{days:s,hours:o}):n({id:"OWk1HjddEb",defaultMessage:"{days}d {hours}h {minutes}m"},{days:s,hours:o,minutes:a.toString().padStart(2,"0")}):o===0?n({id:"VvfhE21OJI",defaultMessage:"{minutes}m"},{minutes:a}):a===0?n({id:"unuVj1l7KW",defaultMessage:"{hours}h"},{hours:o}):n({id:"0Yp4jJ7rzm",defaultMessage:"{hours}h {minutes}m"},{hours:o,minutes:a.toString().padStart(2,"0")})},Rce=T.memo(({flightMetadata:e,departureTime:t,arrivalTime:n,actualDepartureTime:r,actualArrivalTime:s,estimatedDepartureTime:o,estimatedArrivalTime:a,delayed:i=!1,rightContent:c})=>{const{$t:u}=J(),f=d.useMemo(()=>new Date,[]),{cancelled:m,diverted:p,status:h,flight_number:g,departure_city:y,departure_airport:x,arrival_airport:v,arrival_city:b}=e,_=r||o||t,w=s||a||n,S=d.useMemo(()=>up(f,_,u),[f,_,u]),C=d.useMemo(()=>up(_,f,u),[f,_,u]),E=d.useMemo(()=>up(w,f,u),[f,w,u]),N=d.useMemo(()=>up(f,w,u),[f,w,u]),k=_<=f,I=w<=f,M=d.useMemo(()=>I?u({id:"mtuHNb+mRc",defaultMessage:"Arrived {time} ago"},{time:E}):k?u({id:"b6q320RasU",defaultMessage:"Departed {time} ago"},{time:C}):u({id:"/JLglYfuNX",defaultMessage:"Departing in {time}"},{time:S}),[k,I,S,C,E,u]),A=d.useMemo(()=>m?u({id:"3wsVWFbC1x",defaultMessage:"Cancelled"}):p?u({id:"/N1ZeWQc8B",defaultMessage:"Diverted"}):h,[m,p,u,h]);return l.jsxs("div",{className:"gap-sm flex flex-col justify-between sm:flex-row",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"section-title",children:l.jsx(Ne,{id:"5KgWVKDR/R",defaultMessage:"{flightNumber} · {departureCity} ({departureAirport}) to {arrivalCity} ({arrivalAirport})",values:{flightNumber:g,departureCity:y,departureAirport:x,arrivalAirport:v,arrivalCity:b}})}),l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsxs(ya,{className:"gap-xs flex flex-row flex-wrap",children:[!m&&l.jsx(Vn,{id:"relative-departure-time",children:l.jsx(V,{variant:"smallBold",color:"light",children:M})}),k&&!I&&!m&&l.jsx(Vn,{id:"relative-arrival-time",children:l.jsx(V,{variant:"smallBold",color:"light",children:l.jsx(Ne,{id:"z8jWKRSOak",defaultMessage:"Arriving in {time}",values:{time:N}})})}),l.jsx(Vn,{id:"status",children:l.jsx(V,{variant:"smallBold",color:m||p||i?"negative":"super",children:A})})]})})]}),c]})});Rce.displayName="FlightHeader";const j1={initial:{opacity:0,filter:"blur(2px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(2px)"},transition:{duration:.5,ease:$a}},K8=T.memo(({children:e,animationKey:t,...n})=>l.jsx(kt,{mode:"popLayout",initial:!1,children:l.jsx(Te.div,{initial:j1.initial,animate:j1.animate,exit:j1.exit,transition:j1.transition,children:l.jsx(V,{...n,children:e})},t)}));K8.displayName="FlightTextSwitcher";const Dce=T.memo(({terminal:e,gate:t,alignEnd:n})=>{const{$t:r}=J();return l.jsxs("div",{className:z("gap-lg flex w-full flex-row",n&&"justify-end"),children:[l.jsx(Q5,{label:r({id:"GAHVEi8lHA",defaultMessage:"Terminal"}),value:e??"-"}),l.jsx(Q5,{label:r({id:"W+gH70jajX",defaultMessage:"Gate"}),value:t??"-"})]})});Dce.displayName="FlightTerminalGate";const Q5=T.memo(({label:e,value:t})=>l.jsxs("div",{children:[l.jsx(V,{variant:"tinyMono",color:"light",children:e}),l.jsx(K8,{animationKey:t,variant:"entry-title-200",children:t})]}));Q5.displayName="FlightAttribute";const I1={initial:{opacity:0,height:0,filter:"blur(2px)"},animate:{opacity:1,height:"auto",filter:"blur(0px)"},exit:{opacity:0,height:0,filter:"blur(2px)"},transition:{duration:.3,ease:Yr}},X5=T.memo(({time:e,actualTime:t,estimatedTime:n,timezone:r,terminal:s,gate:o,variant:a="departure",delayed:i=!1,cancelled:c=!1})=>{const{locale:u,$t:f}=J(),m=d.useMemo(()=>f(a==="departure"?{id:"BtqAemWTLK",defaultMessage:"Departure"}:{id:"WOIPGxfmZn",defaultMessage:"Arrival"}),[a,f]),p=a==="arrival",h=d.useMemo(()=>{const v=t||n;return v&&v.getTime()===e.getTime()?null:v},[t,n,e]),g=d.useMemo(()=>e.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:r}),[e,r,u]),y=d.useMemo(()=>h?.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:r}),[h,r,u]),x=d.useMemo(()=>e.toLocaleDateString(u,{weekday:"short",month:"short",day:"numeric",timeZone:r}),[e,r,u]);return l.jsxs("div",{className:"gap-md col-span-3 flex min-w-0 flex-col justify-between",children:[l.jsxs("div",{className:z("gap-sm flex flex-col",p&&"items-end"),children:[l.jsxs(V,{variant:"tinyMono",color:"default",className:"gap-sm flex flex-row whitespace-nowrap",children:[m,l.jsxs("span",{children:[" | ",x]})]}),l.jsxs("div",{className:z("flex flex-col",p&&"items-end"),children:[l.jsx(K8,{animationKey:g,as:"span",variant:"entry-title-200",color:i?"negative":"super",className:z("-translate-y-px !font-mono transition-colors duration-500",c&&"text-quiet line-through"),children:h?y:g}),l.jsx(kt,{initial:!1,children:h&&l.jsx(Te.div,{initial:I1.initial,animate:I1.animate,exit:I1.exit,transition:I1.transition,className:"overflow-hidden",children:l.jsx(V,{as:"span",variant:h?"small":"entry-title-200",color:"super",className:z("-translate-y-px !font-mono",h&&"!text-quiet line-through"),children:g})})})]})]}),l.jsx(Dce,{terminal:s,gate:o,alignEnd:p})]})});X5.displayName="FlightDepartureArrival";const Wpt=Te(K),jce=T.memo(({progress:e,departureTime:t,arrivalTime:n,delayed:r,cancelled:s,departureAirport:o,arrivalAirport:a})=>{const{$t:i}=J(),c=d.useMemo(()=>up(t,n,i),[t,n,i]),u=d.useMemo(()=>e===void 0||s?0:Math.max(0,Math.min(100,e)),[e,s]),{left:f,width:m}=d.useMemo(()=>({left:`${u}%`,width:`${u}%`}),[u]),p=d.useMemo(()=>({left:0}),[]),h=d.useMemo(()=>({duration:2,ease:Yr,delay:.5}),[]),g=d.useMemo(()=>({left:f,opacity:1,scale:1}),[f]),y=d.useMemo(()=>({...p,opacity:0,scale:1.2,top:"50%",translateX:"-50%",translateY:"-50%"}),[p]),x=d.useMemo(()=>({width:m}),[m]);return l.jsx("div",{className:"px-xs order-last col-span-6 flex flex-col items-center justify-center sm:order-[unset] sm:px-0",children:l.jsxs("div",{className:"gap-md flex w-full flex-col items-center",children:[l.jsxs("div",{className:"gap-xs gap-x-2xl flex flex-row",children:[l.jsx(V,{variant:"entry-title-200",color:"default",className:"mr-md",children:o}),l.jsx(V,{variant:"tinyMono",color:"light",className:"line-clamp-1 whitespace-nowrap",children:c}),l.jsx(V,{variant:"entry-title-200",color:"default",className:"ml-md",children:a})]}),l.jsxs("div",{className:"relative flex w-full flex-1 items-center",children:[l.jsx("div",{className:"bg-inverse/10 relative h-0.5 w-full overflow-hidden rounded-full",children:l.jsx(Te.div,{className:"!bg-inverse/50 absolute inset-y-0 left-0 transition-colors duration-500",initial:p,animate:x,transition:h})}),l.jsx(Wpt,{variant:"raised",className:"absolute left-0 flex aspect-square w-6 items-center justify-center",initial:y,animate:g,transition:h,children:l.jsx(ge,{className:z("text-quiet transition-colors duration-500",e&&e>0&&!r&&"!text-super",r&&"!text-negative",s&&"!text-quiet"),icon:B("plane")})})]})]})})});jce.displayName="FlightProgress";const Ice=T.memo(({departureTime:e,arrivalTime:t,actualDepartureTime:n,actualArrivalTime:r,estimatedDepartureTime:s,estimatedArrivalTime:o,flightMetadata:a,delayed:i=!1})=>{const{cancelled:c,departure_airport:u,arrival_airport:f,departure_timezone:m,arrival_timezone:p,terminal:h,gate:g,arrival_terminal:y,arrival_gate:x,progress_percent:v}=a;return l.jsxs(mr,{className:"p-md gap-md grid w-full grid-cols-2 overflow-hidden shadow-sm sm:grid-cols-12",children:[l.jsx(X5,{variant:"departure",time:e,actualTime:n,estimatedTime:s,timezone:m,terminal:h,gate:g,delayed:i,cancelled:c}),l.jsx(jce,{departureTime:e,arrivalTime:t,progress:v,delayed:i,cancelled:c,departureAirport:u,arrivalAirport:f}),l.jsx(X5,{variant:"arrival",time:t,actualTime:r,estimatedTime:o,timezone:p,terminal:y,gate:x,delayed:i,cancelled:c})]})});Ice.displayName="FlightStatusCard";const Pce=T.memo(({flights:e,selectedFlight:t,setSelectedFlight:n})=>{const{locale:r,$t:s}=J(),{isMobileStyle:o}=Re(),{formatDate:a}=J(),i=d.useCallback(f=>{const m=new Date(f.departure_time),p=qS(m,f.departure_timezone);let h;if(h=a(m,{dateStyle:"short"}),e.filter(y=>{if(y.departure_timezone!==f.departure_timezone)return!1;const x=qS(new Date(y.departure_time),y.departure_timezone);return x.year===p.year&&x.month===p.month&&x.date===p.date}).length>1){const y=m.toLocaleTimeString(r,{hour:"numeric",minute:"2-digit"});h=s({id:"Fr3TxQz4BU",defaultMessage:"{dateString} - {timeString}"},{dateString:h,timeString:y})}return h},[r,e,s,a]),c=d.useMemo(()=>e.map(f=>({type:"default",text:i(f),value:f.flight_aware_id,onClick:()=>n(f),active:f.flight_aware_id===t?.flight_aware_id})),[e,i,n,t?.flight_aware_id]),u=d.useMemo(()=>t?i(t):"",[t,i]);return l.jsx("div",{children:l.jsx(Ws,{items:c,isMobileStyle:o,children:l.jsx(ze,{variant:"border",text:u,chevron:!0,pill:!0})})})});Pce.displayName="FlightStatusSwitcher";const Oce=T.memo(({data:e})=>{const t=d.useMemo(()=>zpt(e.data.flights),[e.data.flights]),n=d.useMemo(()=>{const i=new Date().getTime();if(t.length===0)return 0;let c=0,u=1/0;return t.forEach((f,m)=>{f.forEach(p=>{const h=new Date(p.departure_time).getTime(),g=Math.abs(h-i);g{if(t.length<2)return null;const i=t.map(c=>c[0]).filter(c=>!!c);return l.jsx(Pce,{flights:i,selectedFlight:o?.[0],setSelectedFlight:c=>{const u=t.findIndex(f=>f[0]?.flight_aware_id===c?.flight_aware_id);u!==-1&&s(u)}})},[t,o]);return!o||o.length===0?null:l.jsx(Un,{"data-testid":"flight-status-widget",className:"w-full",variant:"noChrome",children:l.jsx(Es,{widgetType:"flight",widgetName:"flight_status",widgetSize:"full",children:l.jsx("div",{className:"gap-md flex flex-col",children:o.map((i,c)=>{const u=Vpt(i),f=Hpt(u),m=c===0?a:null;return l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(Rce,{flightMetadata:i,departureTime:u.departureTime,arrivalTime:u.arrivalTime,actualDepartureTime:u.actualDepartureTime,actualArrivalTime:u.actualArrivalTime,estimatedDepartureTime:u.estimatedDepartureTime,estimatedArrivalTime:u.estimatedArrivalTime,delayed:f,rightContent:m}),l.jsx(Ice,{departureTime:u.departureTime,arrivalTime:u.arrivalTime,actualDepartureTime:u.actualDepartureTime,actualArrivalTime:u.actualArrivalTime,estimatedDepartureTime:u.estimatedDepartureTime,estimatedArrivalTime:u.estimatedArrivalTime,flightMetadata:i,delayed:f})]},i.flight_aware_id)})})})})});Oce.displayName="FlightStatusWidget";const Lce=T.memo(({data:{title:e,text:t,image_url:n,canonical_pages:r}})=>{const{isMobileStyle:s}=Re();return l.jsx(xt,{href:r[0]?.url_web,children:l.jsxs(mr,{shadow:!0,className:"p-sm relative flex items-center md:p-[12px]",bgHover:"subtle",children:[l.jsxs(K,{className:"md:gap-md flex flex-1 items-center gap-[12px]",children:[n&&l.jsx("img",{alt:"",className:"max-h-[65px] rounded-md",src:n}),l.jsxs("div",{className:"mr-sm w-full",children:[e&&l.jsxs(V,{className:"text-pretty",variant:s?"smallBold":"baseSemi",children:[e,l.jsx(ge,{icon:B("chevron-right"),className:"text-quiet ml-0.5 inline-flex -translate-y-px md:hidden",size:"sm"})]}),t&&l.jsx(V,{variant:s?"tinyRegular":"small",color:"light",className:"mt-0.5 text-pretty md:mt-0",children:t})]})]}),l.jsx(ge,{icon:B("chevron-right"),className:"text-quiet hidden md:block",size:"md"})]})})});Lce.displayName="GenericFallbackWidget";const CB=250;function Gpt(e,t,n){const r=(t??"light")==="dark",s=e.filter(c=>!c.closedTime),o=e.filter(c=>!!c.closedTime).sort((c,u)=>{const f=c.closedTime?new Date(c.closedTime).getTime():0;return(u.closedTime?new Date(u.closedTime).getTime():0)-f}),a=[...s,...o].map((c,u)=>({...c,color:Xmt(u,r)})),i=a.filter(n);return{unifiedMarkets:a,chartMarkets:i}}function $pt(e){return e&&e.length>0?new Set(e.map(t=>t.id)):void 0}const qpt=T.memo(({color:e,probability:t})=>l.jsx("div",{className:"bg-subtle relative h-1.5 w-full overflow-hidden rounded-full",children:l.jsx("div",{className:"absolute inset-y-0 left-0 h-full rounded-full",style:{boxShadow:"inset 0 0 0 1px rgba(255, 255, 255, 0.1)",backgroundColor:e,width:`${Math.max(0,t)}%`}})}));qpt.displayName="PredictionsProgressBar";const Kpt=T.memo(({probability:e,forceZeroLabel:t=!1})=>{const{locale:n}=J(),r=e===0?t?"0%":"<1%":(e/100).toLocaleString(n,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1});return l.jsx(V,{variant:"tiny",color:"light",className:"w-full max-w-[40px] text-left font-mono leading-tight",children:r})});Kpt.displayName="PredictionsProbability";const Ypt=e=>e>0?"-rotate-45":e<0?"rotate-45":"rotate-0",Qpt=.001,Z5=T.memo(({change:e,variant:t="active",resolvedDate:n=null,resolvedOutcome:r="positive"})=>{const{locale:s}=J();if(t==="resolved"){const o=n?new Date(n).toLocaleDateString(s,{month:"short",day:"numeric"}):void 0;return l.jsx(K,{className:"flex w-full items-center justify-center",children:o&&l.jsx(V,{as:"span",variant:"tiny",color:"light",className:"flex w-full items-center justify-center rounded bg-subtle px-[0.6em] py-[0.15em] font-mono",children:l.jsx("span",{className:"whitespace-nowrap",children:o})})})}return e===null||Math.abs(e)0?"super":"negative",className:z("flex w-full items-center justify-center gap-[0.1em] rounded px-[0.6em] py-[0.15em] font-mono",{"bg-positive/10":e>0,"bg-negative/10":e<0}),children:[l.jsx(ft,{name:B("arrow-right"),className:z("size-3 shrink-0 transition-transform duration-500 ease-in-out",Ypt(e),e>0?"text-super":"text-negative")}),l.jsx("span",{className:"whitespace-nowrap",children:e.toLocaleString(s,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1,signDisplay:"never"})})]})})});Z5.displayName="PredictionsStatus";const Fce=T.memo(({marketCount:e,provider:t,href:n,visibleMarketsCount:r})=>{const{$t:s}=J(),{isMobileStyle:o}=Re(),a=AW(t),i=r&&e>r?s({defaultMessage:"+{count} on {provider}",id:"aqcKaqAMBB"},{count:e-r,provider:a}):o||e<=2?a:s({defaultMessage:"View on {provider}",id:"x+8tBD0Kpk"},{provider:a});return l.jsx(Xh,{href:n,target:"_blank",rel:"noopener",variant:"text",size:"tiny",children:l.jsx(V,{variant:"tinyRegular",color:"light",children:i})})});Fce.displayName="PredictionsAttributionLink";const Xpt=["1h","6h","1d","1w","1m","max"],Zpt={"1h":W({id:"Ifw0lcjnAL",defaultMessage:"1H"}),"6h":W({id:"YkLVNm/W6Q",defaultMessage:"6H"}),"1d":W({id:"aTX7LJbdI3",defaultMessage:"1D"}),"1w":W({id:"6bJGds1heu",defaultMessage:"1W"}),"1m":W({id:"1uz/I31pXU",defaultMessage:"1M"}),max:W({id:"peV3nrWw/A",defaultMessage:"MAX"})},Bce=T.memo(({endDate:e})=>{const{isMobileStyle:t}=Re(),{$t:n,locale:r}=J(),s=new Date(e){const{locale:o,$t:a}=J(),{isMobileStyle:i}=Re();return l.jsx(K,{className:"gap-md flex flex-col",children:l.jsxs(K,{className:"gap-sm flex items-start",children:[t&&l.jsx("img",{src:t,alt:e,className:"bg-subtler aspect-square size-10 shrink-0 rounded-md object-cover mt-xs"}),l.jsxs(K,{className:"min-w-0 flex-1",children:[l.jsx(V,{variant:i?"section-title":"page-title",className:"min-w-0 leading-tight",children:e}),l.jsxs(K,{className:"mt-xs flex flex-col items-stretch gap-xs md:flex-row md:gap-sm",children:[l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("coins"),className:"size-4"}),a({defaultMessage:"{volume} vol.",id:"fBnaWW/3DX"},{volume:n.toLocaleString(o,{style:r?"currency":void 0,currency:r??void 0,notation:"compact"})})]}),l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[l.jsx(ft,{name:B("clock"),className:"size-4"}),l.jsx(Bce,{endDate:s})]})]})]})]})})});Uce.displayName="PredictionsEventHeader";const Vce=T.memo(({market:e,useColor:t=!1,showDot:n=!0,compactPadding:r=!1,className:s,showOutcomeName:o=!1})=>{const{locale:a}=J(),i=!!e.closedTime,c=i&&e.outcomes?e.outcomes[e.outcomePrices.indexOf(Math.max(...e.outcomePrices))]:void 0,u=e.probability<.001?"<0.1%":e.probability.toLocaleString(a,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}),f=Math.sqrt(e.probability),m=o&&e.outcomes?.length===2&&!i?`${e.question} (${e.outcomes[0]})`:e.question;return l.jsxs(K,{className:z("grid grid-cols-[minmax(0,1fr)_auto_56px] items-center gap-x-sm border-b border-subtlest py-sm",r?"px-md":"px-sm",s),children:[l.jsxs("div",{className:"flex items-center gap-sm",children:[n&&l.jsx("span",{className:z("size-2 shrink-0 rounded-full",{"border border-subtle":!t}),style:t?{backgroundColor:e.color}:void 0}),l.jsx(V,{variant:"small",color:e.emphasized?"super":r?"light":"default",className:"min-w-0 break-words",children:m})]}),l.jsx("div",{className:"flex items-center justify-end gap-xs",children:i?l.jsxs(l.Fragment,{children:[c&&l.jsx(V,{variant:"small",color:"default",children:c}),l.jsx(ft,{name:B(c?.toLowerCase()==="no"?"x":"check"),size:16,className:z("shrink-0",c?.toLowerCase()==="no"?"text-caution dark:text-rosa":"text-super")})]}):l.jsx(V,{variant:"smallBold",className:"whitespace-nowrap font-mono",style:{color:`color-mix(in oklch, oklch(var(--foreground-color)) ${f*100}%, oklch(var(--foreground-quiet-color)))`},children:u})}),l.jsx("div",{className:"flex items-center justify-center",children:i?l.jsx(Z5,{change:null,variant:"resolved",resolvedDate:e.closedTime}):l.jsx(Z5,{change:e.change,variant:"active"})})]})});Vce.displayName="PredictionsMarketRow";const Jpt=T.memo(({provider:e,variant:t="tiny"})=>l.jsx(V,{variant:t,color:"ultraLight",children:e}));Jpt.displayName="ProviderText";const Hce=T.memo(({updatedAt:e,useCompact:t=!1})=>{const n=J(),{$t:r}=n,{isMobileStyle:s}=Re(),o=d.useMemo(()=>vee(n,new Date(e),{style:"short",numeric:"auto"})||r({defaultMessage:"Now",id:"tgvES0v2HS"}),[e,n,r]);return l.jsxs(V,{variant:"tinyRegular",color:"light",className:"flex items-center gap-xs min-w-0",children:[(s||t)&&l.jsx(ft,{name:B("clock"),className:"size-3 shrink-0"}),l.jsx("span",{className:"truncate",children:s||t?o:r({defaultMessage:"Updated {date}",id:"vbMp1ubkut"},{date:o})})]})});Hce.displayName="UpdatedAt";const eht=T.memo(({volume:e,currency:t,compact:n=!1,hideIcon:r=!1})=>{const{locale:s,$t:o}=J(),{isMobileStyle:a}=Re();return l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[!r&&l.jsx(ft,{name:B("coins"),className:"size-4"}),o({defaultMessage:"{volume} vol.",id:"fBnaWW/3DX"},{volume:e.toLocaleString(s,{style:t?"currency":void 0,currency:t??void 0,notation:n||a?"compact":void 0})})]})});eht.displayName="VolumeDisplay";const zce=T.memo(({markets:e,chartMarketIds:t,initialDisplayCount:n=5})=>{const[r,s]=d.useState(!1),{$t:o}=J(),{isMobileStyle:a}=Re(),i=e.length>n,c=d.useMemo(()=>{if(r)return e;const m=e.find(h=>h.emphasized);return(m?e.indexOf(m):-1)l.jsx(Vce,{market:m,useColor:t?.has(m.id)??!1,showOutcomeName:f},m.id)),i&&l.jsx(l.Fragment,{children:a?l.jsx(K,{className:"mx-md my-sm",children:l.jsx(Ct,{fullWidth:!0,size:"tiny",onClick:()=>s(!r),variant:"secondary",children:u})}):l.jsx(K,{className:"ml-sm mt-xs flex justify-start",children:l.jsx(Ct,{size:"tiny",onClick:()=>s(!r),variant:"text",children:u})})})]})});zce.displayName="PredictionsMarkets";const tht=T.memo(({commentary:e,sourceUrls:t,variant:n="small",className:r})=>l.jsxs(V,{variant:n,className:r,children:[e,t?.flat().filter(Boolean).map((s,o)=>l.jsxs(T.Fragment,{children:[" ",l.jsx(CN,{url:s,href:s||void 0,linkBehavior:"external",className:"translate-y-half duration-quick -mt-1 inline-block uppercase transition-opacity"},o)]},o))]}));tht.displayName="CommentaryWithSources";const SB=50,nht=(e,t,n)=>{const r=new Date(e),s=new Date(t),o=r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()&&r.getDate()===s.getDate(),a=r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth(),i=r.getFullYear()===s.getFullYear();return o?c=>{const u=c.getMinutes()!==0;return c.toLocaleTimeString(n,{hour:"numeric",minute:u?"numeric":void 0})}:a?c=>c.toLocaleDateString(n,{month:"short",day:"numeric",hour:"numeric"}):i?c=>c.toLocaleDateString(n,{month:"short",day:"numeric"}):c=>c.toLocaleDateString(n,{year:"numeric",month:"short"})},rht=({x:e,y:t,color:n,r=4,animationId:s})=>l.jsxs("g",{children:[l.jsx(Te.circle,{cx:e,cy:t,r,fill:"none",stroke:n,strokeWidth:2,initial:{r,opacity:1},animate:{r:r*4,opacity:0},transition:{duration:1.5,ease:"easeOut"},style:{pointerEvents:"none"}},`${s}`),l.jsx("circle",{cx:e,cy:t,r,fill:n,stroke:"oklch(var(--background-color))",strokeWidth:2,style:{pointerEvents:"none"}})]}),sht=({data:e,animationId:t})=>e.map(n=>l.jsx(rht,{x:n.x,y:n.y,color:n.market.color,animationId:t},n.market.question)),oht=({data:e,locale:t,decimalPlaces:n=3})=>{const r=Math.max(0,n-2),s=e[0]?.timestamp,o=d.useMemo(()=>s?new Date(s).toLocaleDateString(t,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"}):null,[s,t]),a=e.length===1;return l.jsxs(K,{className:"space-y-xs px-sm py-xs",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:o}),e.map(i=>{const c=a&&i.market.outcomes?.length===2?i.market.outcomes[0]:i.market.question;return l.jsxs(K,{className:"gap-xs flex items-center",children:[l.jsx("div",{className:"size-2 rounded-full",style:{backgroundColor:i.market.color}}),l.jsxs(V,{variant:"tinyRegular",color:"default",children:[c,":"," ",i.data.probability.toLocaleString(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r})]})]},i.market.question)})]})},aht=Hg(e=>new Date(e.timestamp)).left,iht=(e,t,n)=>{if(!n?.length)return{d:null,index:0,x:e};const r=t.invert(e),s=Math.max(0,Math.min(aht(n,r),n.length-1)),o=n[s-1],a=n[s];let i=Math.max(0,s-1);if(o&&a){const u=Math.abs(t(new Date(a.timestamp))-e),f=Math.abs(t(new Date(o.timestamp))-e);u{const{tooltipData:s,hideTooltip:o,showTooltip:a}=n_(),i=d.useCallback(c=>{const u=c0(c);if(!u)return;const f=WN(c),m=Math.min(Math.max(r[0],u.x),r[1]),p=e.map(h=>{if(!h.history)return null;const g=iht(m,t,h.history);return g.d?{market:h,data:g.d,x:t(new Date(g.d.timestamp))??0,y:n(g.d.probability),timestamp:g.d.timestamp}:null}).filter(h=>h!==null);p.length&&a({tooltipData:{hits:p,point:{local:{x:u.x,y:Math.max(0,u.y-xs)},global:f}}})},[e,t,n,a,r]);return d.useMemo(()=>({tooltipData:s,hideTooltip:o,showTooltip:i}),[s,o,i])},cht=({l:e,history:t,color:n})=>{const r=d.useMemo(()=>e(t),[e,t]),s=a_(r,!0,oi);return l.jsx(No.path,{d:s,stroke:n,strokeWidth:1.75,fill:"none",shapeRendering:cm})},Wce=T.memo(({markets:e,width:t,height:n,updatedAt:r,uiHints:s})=>{const{locale:o}=J(),a=d.useMemo(()=>fm({domain:Mo(e.flatMap(E=>E.history??[]),E=>new Date(E.timestamp)),range:[0,t-SB]}),[e,t]),i=d.useMemo(()=>{const E=s?.lowerBound,N=s?.upperBound;if(E!=null&&N!==void 0&&N!==null)return Bi({domain:[E,N],range:[n-xs,Dd]});const k=e.flatMap(F=>(F.history??[]).map(R=>R.probability));if(!k.length)return Bi({domain:[0,1],range:[n-xs,Dd]});const[I,M]=Mo(k),A=(M-I)*.1,D=Math.max(0,I-A),P=Math.min(1,M+A);return Bi({domain:[D,P],range:[n-xs,Dd]})},[e,n,s]),c=d.useMemo(()=>sl().x(E=>a(new Date(E.timestamp))).y(E=>i(E.probability)).curve(Sb),[a,i]),u=d.useMemo(()=>i.ticks(5).length>6?i.ticks(4).length>6?i.ticks(4).slice(1,-1):i.ticks(4):i.ticks(5),[i]),f=d.useMemo(()=>a.ticks(5),[a]),m=d.useMemo(()=>{const E=e.flatMap(M=>M.history??[]);if(!E.length)return M=>M.toLocaleDateString(o);const N=new Date(E[0].timestamp),k=new Date(E[E.length-1].timestamp),I=nht(N,k,o);return M=>I(M)},[e,o]),p=d.useMemo(()=>Dae({ticks:f,xScale:a,width:t,formatter:E=>m(E),marginRight:SB}),[f,a,t,m]),h=d.useCallback(()=>({fill:tr.gray,fontSize:12,dy:"-5px",textAnchor:"end",fontFamily:"var(--font-family-sans)"}),[]),g=E=>{const N=E.toString(),k=N.indexOf(".");return k===-1?0:N.length-k-1},y=d.useCallback(E=>{const N=Math.max(...u.map(I=>g(I))),k=Math.max(0,N-2);return E.toLocaleString(o,{style:"percent",maximumFractionDigits:k,minimumFractionDigits:k})},[o,u]),x=d.useMemo(()=>`prediction-market-${e[0]?.question??"chart"}`,[e]),v=d.useMemo(()=>[0,t],[t]),{tooltipData:b,hideTooltip:_,showTooltip:w}=lht({markets:e,xScale:a,yScale:i,xBounds:v}),S=d.useMemo(()=>b?b.hits:e.map(E=>{const N=E.history?.[E.history.length-1];return N?{market:E,data:N,x:a(new Date(N.timestamp))??0,y:i(N.probability),timestamp:N.timestamp}:null}).filter(E=>E!==null),[b,e,a,i]),C=d.useMemo(()=>{const E=e.flatMap(N=>(N.history??[]).map(k=>k.probability));return E.length?E.reduce((N,k)=>Math.max(N,g(k)),0):2},[e]);return l.jsxs("div",{className:$N,onMouseMove:w,onMouseLeave:_,onTouchStart:w,onTouchMove:w,onTouchEnd:_,children:[l.jsxs("svg",{height:n,width:t,className:GN,children:[l.jsx(kt,{initial:!1,mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:Il,children:[l.jsx(wu,{tickValues:u,scale:i,width:t,stroke:tr.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx(Qb,{scale:a,opacity:.1,height:n*2,stroke:tr.gray,style:{transform:`translateY(-${n}px)`},tickValues:p,strokeWidth:1})]},x)}),l.jsx(kt,{mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},exit:{opacity:0,transition:{duration:0,delay:0}},animate:{opacity:1},transition:Il,children:[l.jsx(Gl,{scale:i,hideTicks:!0,hideAxisLine:!0,tickValues:u,left:t,orientation:"left",tickFormat:y,tickLabelProps:h}),l.jsx(Gl,{scale:a,hideAxisLine:!0,hideTicks:!0,tickValues:p,tickFormat:m,orientation:"bottom",top:n-xs,tickLabelProps:KN})]},x)}),e.map(E=>l.jsx(cht,{l:c,history:E.history,color:E.color},E.question)),l.jsx(kt,{children:b&&l.jsx(r_,{marginTop:-n,tooltipLeft:b.point.local.x,innerHeight:n*3,color:tr.gray})}),l.jsx(sht,{data:S,animationId:r})]}),b&&l.jsx(Jl,{children:l.jsx(s_,{x:b.point.global.x,y:b.point.global.y,children:l.jsx(oht,{data:b.hits,locale:o,decimalPlaces:C})})})]})});Wce.displayName="PredictionMarketChart";const Gce=T.memo(({eventId:e,event:t,chartMarkets:n,periods:r,period:s,setPeriod:o})=>{const{isMobileStyle:a}=Re();return!n||n.length===0?null:l.jsxs(K,{className:"gap-y-sm relative flex flex-col justify-between overflow-hidden border-b",children:[l.jsx(K,{className:"z-[2] p-sm absolute inset-x-0 top-0 flex items-center justify-start",children:l.jsx(q8,{id:`prediction-market-${e}`,periods:r,period:s,setPeriod:o,variant:a?"sm":"lg"})}),l.jsx("div",{className:"absolute top-sm right-sm z-[2]",children:l.jsx(Th,{})}),l.jsx("div",{style:{paddingTop:Ah+16+20},className:"relative z-[1]",children:l.jsx(L8,{height:CB,render:!!t,minWidth:100,children:i=>i?l.jsx(Wce,{period:s,updatedAt:t.updatedDate,markets:n,width:i,height:CB,uiHints:t.uiHints}):null})})]})});Gce.displayName="PredictionMarketChartWithControls";const EB=({href:e,eventId:t})=>{const{isMobileStyle:n}=Re(),{$t:r}=J(),{session:s}=je(),{trackEvent:o}=Ke(s),a=d.useCallback(()=>{o("predictions link clicked",{referrer:Ist.PREDICTIONS_WIDGET,targetPageType:Pst.ASSET_PAGE,eventId:t,destinationUrl:e})},[o,t,e]);return l.jsx(K,{className:"gap-sm flex items-center justify-center",children:l.jsx(ze,{variant:"primaryGhost",chevron:!0,chevronIcon:B("chevron-right"),text:r({defaultMessage:"Deep Dive on {pplxFinance}",id:"QX457HdJyA"},{pplxFinance:"Perplexity Finance"}),size:"small",href:e,onClick:a,fullWidth:n})})},uht=({event:e})=>{const{isMobileStyle:t}=Re();return t&&e.uiHints?.canonicalPage?.urlWeb?l.jsx(EB,{href:e.uiHints.canonicalPage.urlWeb,eventId:e.id}):l.jsxs(K,{className:"gap-xs pt-sm flex items-baseline justify-between",children:[l.jsx(Hce,{updatedAt:e.updatedDate}),!!e.uiHints?.canonicalPage?.urlWeb&&l.jsx(EB,{href:e.uiHints.canonicalPage.urlWeb,eventId:e.id}),l.jsx(Fce,{href:e.eventUrl,marketCount:e.markets?.length??0,provider:e.provider})]})},$ce=T.memo(({eventId:e,eventData:t})=>{const[n,r]=d.useState("max"),{$t:s}=J(),o=d.useMemo(()=>t?.uiHints?.emphasizedMarketIds??[],[t?.uiHints?.emphasizedMarketIds]),a={eventId:e,historyPeriod:n,marketsSort:"probability",emphasizedMarketIds:o},{data:i}=gt({queryKey:hqe(a),queryFn:()=>gqe(a),enabled:!!e,refetchInterval:p=>{const h=p.state.data,g=t?.uiHints?.refetchIntervalSecs??h?.uiHints?.refetchIntervalSecs;return g?g*1e3:!1},refetchIntervalInBackground:!1,placeholderData:p=>p||t,staleTime:0}),{colorScheme:c}=Ss(),{unifiedMarkets:u,chartMarkets:f}=d.useMemo(()=>i?.markets?Gpt(i.markets,c,p=>!p.closedTime&&!!(p.history&&p.history.length>0)):{unifiedMarkets:void 0,chartMarkets:void 0},[i?.markets,c]),m=d.useMemo(()=>(i?.uiHints?.periods??Xpt).map(p=>({value:p,text:s(Zpt[p])})),[i?.uiHints?.periods,s]);return!i||!u?null:l.jsxs(K,{className:"rounded-xl border",variant:"raised",children:[l.jsx(K,{className:"px-md py-sm",children:l.jsx(Uce,{title:i.title,image:i.icon,volume:i.volume,currency:i.currency,endDate:i.endDate})}),l.jsx(Gce,{eventId:e,event:i,chartMarkets:f,periods:m,period:n,setPeriod:r}),l.jsxs(K,{className:"px-md pb-sm pt-0",children:[u&&u.length>0&&l.jsx(zce,{markets:u,chartMarketIds:$pt(f)}),l.jsx(uht,{event:i})]})]})});$ce.displayName="PredictionsEvent";const qce=T.memo(({data:e})=>l.jsx(rpe,{fallback:null,children:l.jsx(Es,{widgetType:"predictions",widgetName:"prediction_market",widgetSize:"full",children:l.jsx($ce,{eventId:e.id,eventData:e})})}));qce.displayName="PredictionMarketWidget";const Xa={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Kce=Object.create(null);for(const e in Xa)Object.hasOwn(Xa,e)&&(Kce[Xa[e]]=e);const Mr={to:{},get:{}};Mr.get=function(e){const t=e.slice(0,3).toLowerCase();let n,r;switch(t){case"hsl":{n=Mr.get.hsl(e),r="hsl";break}case"hwb":{n=Mr.get.hwb(e),r="hwb";break}default:{n=Mr.get.rgb(e),r="rgb";break}}return n?{model:r,value:n}:null};Mr.get.rgb=function(e){if(!e)return null;const t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,s=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^(\w+)$/;let a=[0,0,0,1],i,c,u;if(i=e.match(n)){for(u=i[2],i=i[1],c=0;c<3;c++){const f=c*2;a[c]=Number.parseInt(i.slice(f,f+2),16)}u&&(a[3]=Number.parseInt(u,16)/255)}else if(i=e.match(t)){for(i=i[1],u=i[3],c=0;c<3;c++)a[c]=Number.parseInt(i[c]+i[c],16);u&&(a[3]=Number.parseInt(u+u,16)/255)}else if(i=e.match(r)){for(c=0;c<3;c++)a[c]=Number.parseInt(i[c+1],10);i[4]&&(a[3]=i[5]?Number.parseFloat(i[4])*.01:Number.parseFloat(i[4]))}else if(i=e.match(s)){for(c=0;c<3;c++)a[c]=Math.round(Number.parseFloat(i[c+1])*2.55);i[4]&&(a[3]=i[5]?Number.parseFloat(i[4])*.01:Number.parseFloat(i[4]))}else return(i=e.match(o))?i[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Xa,i[1])?(a=Xa[i[1]],a[3]=1,a):null:null;for(c=0;c<3;c++)a[c]=Ol(a[c],0,255);return a[3]=Ol(a[3],0,1),a};Mr.get.hsl=function(e){if(!e)return null;const t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),s=(Number.parseFloat(n[1])%360+360)%360,o=Ol(Number.parseFloat(n[2]),0,100),a=Ol(Number.parseFloat(n[3]),0,100),i=Ol(Number.isNaN(r)?1:r,0,1);return[s,o,a,i]}return null};Mr.get.hwb=function(e){if(!e)return null;const t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),s=(Number.parseFloat(n[1])%360+360)%360,o=Ol(Number.parseFloat(n[2]),0,100),a=Ol(Number.parseFloat(n[3]),0,100),i=Ol(Number.isNaN(r)?1:r,0,1);return[s,o,a,i]}return null};Mr.to.hex=function(...e){return"#"+P1(e[0])+P1(e[1])+P1(e[2])+(e[3]<1?P1(Math.round(e[3]*255)):"")};Mr.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Mr.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};Mr.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Mr.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};Mr.to.keyword=function(...e){return Kce[e.slice(0,3)]};function Ol(e,t,n){return Math.min(Math.max(t,e),n)}function P1(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}const Yce={};for(const e of Object.keys(Xa))Yce[Xa[e]]=e;const qe={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Ui=(6/29)**3;function Id(e){const t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Pd(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(qe)){if(!("channels"in qe[e]))throw new Error("missing channels property: "+e);if(!("labels"in qe[e]))throw new Error("missing channel labels property: "+e);if(qe[e].labels.length!==qe[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=qe[e];delete qe[e].channels,delete qe[e].labels,Object.defineProperty(qe[e],"channels",{value:t}),Object.defineProperty(qe[e],"labels",{value:n})}qe.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=o-s;let i,c;switch(o){case s:{i=0;break}case t:{i=(n-r)/a;break}case n:{i=2+(r-t)/a;break}case r:{i=4+(t-n)/a;break}}i=Math.min(i*60,360),i<0&&(i+=360);const u=(s+o)/2;return o===s?c=0:u<=.5?c=a/(o+s):c=a/(2-o-s),[i,c*100,u*100]};qe.rgb.hsv=function(e){let t,n,r,s,o;const a=e[0]/255,i=e[1]/255,c=e[2]/255,u=Math.max(a,i,c),f=u-Math.min(a,i,c),m=function(p){return(u-p)/6/f+1/2};if(f===0)s=0,o=0;else{switch(o=f/u,t=m(a),n=m(i),r=m(c),u){case a:{s=r-n;break}case i:{s=1/3+t-r;break}case c:{s=2/3+n-t;break}}s<0?s+=1:s>1&&(s-=1)}return[s*360,o*100,u*100]};qe.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const s=qe.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[s,o*100,r*100]};qe.rgb.oklab=function(e){const t=Pd(e[0]/255),n=Pd(e[1]/255),r=Pd(e[2]/255),s=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),i=.2104542553*s+.793617785*o-.0040720468*a,c=1.9779984951*s-2.428592205*o+.4505937099*a,u=.0259040371*s+.7827717662*o-.808675766*a;return[i*100,c*100,u*100]};qe.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(1-t,1-n,1-r),o=(1-t-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,i=(1-r-s)/(1-s)||0;return[o*100,a*100,i*100,s*100]};function dht(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}qe.rgb.keyword=function(e){const t=Yce[e];if(t)return t;let n=Number.POSITIVE_INFINITY,r;for(const s of Object.keys(Xa)){const o=Xa[s],a=dht(e,o);aUi?n**(1/3):7.787*n+16/116,r=r>Ui?r**(1/3):7.787*r+16/116,s=s>Ui?s**(1/3):7.787*s+16/116;const o=116*r-16,a=500*(n-r),i=200*(r-s);return[o,a,i]};qe.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let s,o;if(n===0)return o=r*255,[o,o,o];const a=r<.5?r*(1+n):r+n-r*n,i=2*r-a,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?o=i+(a-i)*6*s:2*s<1?o=a:3*s<2?o=i+(a-i)*(2/3-s)*6:o=i,c[u]=o*255;return c};qe.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,s=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,s*=o<=1?o:2-o;const a=(r+n)/2,i=r===0?2*s/(o+s):2*n/(r+n);return[t,i*100,a*100]};qe.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const s=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),i=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,s){case 0:return[r,c,a];case 1:return[i,r,a];case 2:return[a,r,c];case 3:return[a,i,r];case 4:return[c,a,r];case 5:return[r,a,i]}};qe.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,s=Math.max(r,.01);let o,a;a=(2-n)*r;const i=(2-n)*s;return o=n*s,o/=i<=1?i:2-i,o=o||0,a/=2,[t,o*100,a*100]};qe.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const s=n+r;let o;s>1&&(n/=s,r/=s);const a=Math.floor(6*t),i=1-r;o=6*t-a,(a&1)!==0&&(o=1-o);const c=n+o*(i-n);let u,f,m;switch(a){default:case 6:case 0:{u=i,f=c,m=n;break}case 1:{u=c,f=i,m=n;break}case 2:{u=n,f=i,m=c;break}case 3:{u=n,f=c,m=i;break}case 4:{u=c,f=n,m=i;break}case 5:{u=i,f=n,m=c;break}}return[u*255,f*255,m*255]};qe.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=e[3]/100,o=1-Math.min(1,t*(1-s)+s),a=1-Math.min(1,n*(1-s)+s),i=1-Math.min(1,r*(1-s)+s);return[o*255,a*255,i*255]};qe.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let s,o,a;return s=t*3.2404542+n*-1.5371385+r*-.4985314,o=t*-.969266+n*1.8760108+r*.041556,a=t*.0556434+n*-.2040259+r*1.0572252,s=Id(s),o=Id(o),a=Id(a),[s*255,o*255,a*255]};qe.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>Ui?t**(1/3):7.787*t+16/116,n=n>Ui?n**(1/3):7.787*n+16/116,r=r>Ui?r**(1/3):7.787*r+16/116;const s=116*n-16,o=500*(t-n),a=200*(n-r);return[s,o,a]};qe.xyz.oklab=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),o=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),a=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r),i=.2104542553*s+.793617785*o-.0040720468*a,c=1.9779984951*s-2.428592205*o+.4505937099*a,u=.0259040371*s+.7827717662*o-.808675766*a;return[i*100,c*100,u*100]};qe.oklab.oklch=function(e){return qe.lab.lch(e)};qe.oklab.xyz=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=(.999999998*t+.396337792*n+.215803758*r)**3,o=(1.000000008*t-.105561342*n-.063854175*r)**3,a=(1.000000055*t-.089484182*n-1.291485538*r)**3,i=1.227013851*s-.55779998*o+.281256149*a,c=-.040580178*s+1.11225687*o-.071676679*a,u=-.076381285*s-.421481978*o+1.58616322*a;return[i*100,c*100,u*100]};qe.oklab.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=(t+.3963377774*n+.2158037573*r)**3,o=(t-.1055613458*n-.0638541728*r)**3,a=(t-.0894841775*n-1.291485548*r)**3,i=Id(4.0767416621*s-3.3077115913*o+.2309699292*a),c=Id(-1.2684380046*s+2.6097574011*o-.3413193965*a),u=Id(-.0041960863*s-.7034186147*o+1.707614701*a);return[i*255,c*255,u*255]};qe.oklch.oklab=function(e){return qe.lch.lab(e)};qe.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let s,o,a;o=(t+16)/116,s=n/500+o,a=o-r/200;const i=o**3,c=s**3,u=a**3;return o=i>Ui?i:(o-16/116)/7.787,s=c>Ui?c:(s-16/116)/7.787,a=u>Ui?u:(a-16/116)/7.787,s*=95.047,o*=100,a*=108.883,[s,o,a]};qe.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let s;s=Math.atan2(r,n)*360/2/Math.PI,s<0&&(s+=360);const a=Math.sqrt(n*n+r*r);return[t,a,s]};qe.lch.lab=function(e){const t=e[0],n=e[1],s=e[2]/360*2*Math.PI,o=n*Math.cos(s),a=n*Math.sin(s);return[t,o,a]};qe.rgb.ansi16=function(e,t=null){const[n,r,s]=e;let o=t===null?qe.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let a=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(a+=60),a};qe.hsv.ansi16=function(e){return qe.rgb.ansi16(qe.hsv.rgb(e),e[2])};qe.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t>>4===n>>4&&n>>4===r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};qe.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(Math.trunc(e>50)+1)*.5,r=(t&1)*n*255,s=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,s,o]};qe.ansi256.rgb=function(e){if(e=e[0],e>=232){const o=(e-232)*10+8;return[o,o,o]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,s=t%6/5*255;return[n,r,s]};qe.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};qe.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(i=>i+i).join(""));const r=Number.parseInt(n,16),s=r>>16&255,o=r>>8&255,a=r&255;return[s,o,a]};qe.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),a=s-o;let i;const c=a<1?o/(1-a):0;return a<=0?i=0:s===t?i=(n-r)/a%6:s===n?i=2+(r-t)/a:i=4+(t-n)/a,i/=6,i%=1,[i*360,a*100,c*100]};qe.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let s=0;return r<1&&(s=(n-.5*r)/(1-r)),[e[0],r*100,s*100]};qe.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let s=0;return r<1&&(s=(n-r)/(1-r)),[e[0],r*100,s*100]};qe.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const s=[0,0,0],o=t%1*6,a=o%1,i=1-a;let c=0;switch(Math.floor(o)){case 0:{s[0]=1,s[1]=a,s[2]=0;break}case 1:{s[0]=i,s[1]=1,s[2]=0;break}case 2:{s[0]=0,s[1]=1,s[2]=a;break}case 3:{s[0]=0,s[1]=i,s[2]=1;break}case 4:{s[0]=a,s[1]=0,s[2]=1;break}default:s[0]=1,s[1]=0,s[2]=i}return c=(1-n)*r,[(n*s[0]+c)*255,(n*s[1]+c)*255,(n*s[2]+c)*255]};qe.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let s=0;return r>0&&(s=t/r),[e[0],s*100,r*100]};qe.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let s=0;return r>0&&r<.5?s=t/(2*r):r>=.5&&r<1&&(s=t/(2*(1-r))),[e[0],s*100,r*100]};qe.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};qe.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,s=r-t;let o=0;return s<1&&(o=(r-s)/(1-s)),[e[0],s*100,o*100]};qe.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};qe.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};qe.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};qe.gray.hsl=function(e){return[0,0,e[0]]};qe.gray.hsv=qe.gray.hsl;qe.gray.hwb=function(e){return[0,100,e[0]]};qe.gray.cmyk=function(e){return[0,0,0,e[0]]};qe.gray.lab=function(e){return[e[0],0,0]};qe.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r};qe.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function fht(){const e={},t=Object.keys(qe);for(let{length:n}=t,r=0;r0;){const r=n.pop(),s=Object.keys(qe[r]);for(let{length:o}=s,a=0;a1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function vht(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const s=e(n);if(typeof s=="object")for(let{length:o}=s,a=0;a0){this.model=t||"rgb",r=Or[this.model].channels;const s=Array.prototype.slice.call(e,0,r);this.color=tM(s,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const o=s.sort().join("");if(!(o in J5))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=J5[o];const{labels:a}=Or[this.model],i=[];for(n=0;n(e%360+360)%360),saturationl:rr("hsl",1,Sr(100)),lightness:rr("hsl",2,Sr(100)),saturationv:rr("hsv",1,Sr(100)),value:rr("hsv",2,Sr(100)),chroma:rr("hcg",1,Sr(100)),gray:rr("hcg",2,Sr(100)),white:rr("hwb",1,Sr(100)),wblack:rr("hwb",2,Sr(100)),cyan:rr("cmyk",0,Sr(100)),magenta:rr("cmyk",1,Sr(100)),yellow:rr("cmyk",2,Sr(100)),black:rr("cmyk",3,Sr(100)),x:rr("xyz",0,Sr(95.047)),y:rr("xyz",1,Sr(100)),z:rr("xyz",2,Sr(108.833)),l:rr("lab",0,Sr(100)),a:rr("lab",1),b:rr("lab",2),keyword(e){return e!==void 0?new Yn(e):Or[this.model].keyword(this.color)},hex(e){return e!==void 0?new Yn(e):Mr.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new Yn(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),Mr.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const s=r/255;t[n]=s<=.04045?s/12.92:((s+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return Yn.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),s=t===void 0?.5:t,o=2*s-1,a=n.alpha()-r.alpha(),i=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,c=1-i;return Yn.rgb(i*n.red()+c*r.red(),i*n.green()+c*r.green(),i*n.blue()+c*r.blue(),n.alpha()*s+r.alpha()*(1-s))}};for(const e of Object.keys(Or)){if(Qce.includes(e))continue;const{channels:t}=Or[e];Yn.prototype[e]=function(...n){return this.model===e?new Yn(this):n.length>0?new Yn(n,e):new Yn([...wht(Or[this.model][e].raw(this.color)),this.valpha],e)},Yn[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=tM(n,t)),new Yn(r,e)}}function bht(e,t){return Number(e.toFixed(t))}function _ht(e){return function(t){return bht(t,e)}}function rr(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(eM[r]||=[])[t]=n;return e=e[0],function(r){let s;return r!==void 0?(n&&(r=n(r)),s=this[e](),s.color[t]=r,s):(s=this[e]().color[t],n&&(s=n(s)),s)}}function Sr(e){return function(t){return Math.max(0,Math.min(e,t))}}function wht(e){return Array.isArray(e)?e:[e]}function tM(e,t){for(let n=0;n{const[m,{width:p,height:h}]=ei(),[g,y]=d.useState([]),[x,v]=d.useState(0),[b,_]=d.useState(0),w=d.useRef(null),S=d.useRef(new Set),C=d.useCallback(()=>{const N=Math.floor(Math.random()*x)+1,k=Math.floor(Math.random()*b)+1,I=`${N}-${k}`;if(S.current.has(I))return;const M={col:N,row:k,id:I,duration:Math.floor(Math.random()*1001)+1e3,isSuper:Math.floor(Math.random()*5)%5===0};y(A=>{const D=[M,...A];if(D.length>u){const P=D.pop();P&&S.current.delete(P.id)}return S.current.add(I),D})},[x,b,u]);d.useEffect(()=>{if(i)return w.current=setInterval(C,100),()=>{w.current&&clearInterval(w.current)}},[C,i]),d.useEffect(()=>{v(Math.floor(p/c)),_(Math.floor(h/c))},[p,h,c]);const E=s?{maskImage:"radial-gradient(black, transparent)"}:void 0;return l.jsxs("div",{className:z("bg-base dotGridContainer pointer-events-none relative isolate",e),ref:m,style:f,children:[l.jsxs("div",{className:"absolute inset-0 overflow-hidden",style:E,children:[l.jsx("div",{className:z("dotHighlightGrid bg-inverse/20 absolute inset-0",a),children:g.map(N=>l.jsx(Zce,{item:N,className:o},N.id))}),l.jsx("div",{className:z("dotGrid absolute inset-0",n)})]}),l.jsx("div",{className:z("relative",t),children:r})]})});Xce.displayName="DotGrid";const Zce=d.memo(({item:e,className:t})=>l.jsx("div",{className:z("gridDot text-foreground",t,{highlight:e.isSuper}),style:{gridColumn:e.col,gridRow:e.row,animationDuration:`${e.duration}ms`}}));Zce.displayName="GridDot";const pm=T.memo(({size:e="default",className:t,includeDot:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re();return l.jsx("div",{className:z("flex shrink-0 items-center justify-center",t),children:l.jsxs(V,{variant:e==="tiny"||s?"micro":"tiny",color:"super",className:z("bg-superBG pt-three flex shrink-0 items-center rounded-full py-0.5 tracking-wider",{"px-2.5":e==="default","pl-2":e==="default"&&n,"px-2":e==="small","px-1.5":e==="tiny"}),children:[n&&l.jsxs("span",{className:"grid",children:[l.jsx("span",{className:"bg-super mr-1 size-1.5 rounded-full",style:{gridArea:"1/-1"}}),l.jsx("span",{className:"bg-super mr-1 size-1.5 animate-ping rounded-full",style:{gridArea:"1/-1"}})]}),r({defaultMessage:"Live",id:"Dn82ALx/+V"}).toUpperCase()]})})});pm.displayName="LiveIndicator";const Cht=T.memo(({className:e,color:t="positive"})=>{const n=t==="negative"?"bg-caution":"bg-super";return l.jsxs("span",{className:z("grid",e),children:[l.jsx("span",{className:z(n,"size-1.5 rounded-full"),style:{gridArea:"1/-1"}}),l.jsx("span",{className:z(n,"size-1.5 animate-ping rounded-full"),style:{gridArea:"1/-1"}})]})});Cht.displayName="LiveDot";const Sht=["West First Round","East First Round","Western Conference Semifinals","Eastern Conference Semifinals","Western Conference Finals","Eastern Conference Finals","NBA Finals"],Jce=e=>Sht.includes(e);function Eht(e,t){return t.find(n=>String(n.teamId)===String(e))}const kht=e=>{switch(e){case"nba":case"wnba":case"ncaam":case"ncaaw":case"mlb":case"atp":case"wta":case"championsleague":case"laliga":case"ligue1":case"epl":case"bundesliga":return"/static/images/sports/nba/logos/nba-logo-generic.png";case"nfl":return"/static/images/sports/nfl/logos/nfl-logo-generic.png";case"ipl":case"cricket":case"icc":return"/static/images/sports/cricket/logos/cricket-logo-generic.png";default:return""}},Mht="#64645F";function Tht(e,t,n){const r={teamId:e,logo:kht(n),color:Mht};return Eht(e,t)??r}var Km={},kB;function d0(){if(kB)return Km;kB=1,Km.__esModule=!0,Km.default=void 0;var e={top:"top",left:"left",right:"right",bottom:"bottom"};return Km.default=e,Km}var Aht=d0();const Nht=uo(Aht);function O1(e,t,n,r,s){var o;switch(e){case"center":return s;case"min":return n??0;case"max":return r??0;case"outside":default:return(o=(t??0)=0)&&(y[v]=h[v]);return y}function p(h){var g=h.top,y=g===void 0?0:g,x=h.left,v=x===void 0?0:x,b=h.scale,_=h.width,w=h.stroke,S=w===void 0?"#eaf0f6":w,C=h.strokeWidth,E=C===void 0?1:C,N=h.strokeDasharray,k=h.className,I=h.children,M=h.numTicks,A=M===void 0?10:M,D=h.lineStyle,P=h.offset,F=h.tickValues,R=m(h,c),j=F??(0,a.getTicks)(b,A),L=(P??0)+(0,i.default)(b)/2,U=j.map(function(O,$){var G,H=((G=(0,a.coerceNumber)(b(O)))!=null?G:0)+L;return{index:$,from:new o.Point({x:0,y:H}),to:new o.Point({x:_,y:H})}});return t.default.createElement(s.Group,{className:(0,n.default)("visx-rows",k),top:y,left:v},I?I({lines:U}):U.map(function(O){var $=O.from,G=O.to,H=O.index;return t.default.createElement(r.default,f({key:"row-line-"+H,from:$,to:G,stroke:S,strokeWidth:E,strokeDasharray:N,style:D},R))}))}return p.propTypes={tickValues:e.default.array,width:e.default.number.isRequired},W1}var qht=$ht();const Kht=uo(qht);var Yht=["scale","lines","animationTrajectory","animateXOrY","lineKey","lineStyle"];function ix(){return ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(t){const o=t.querySelectorAll(".visx-axis-tick"),a=Array.from(o).map(i=>{const{width:c,height:u}=i.getBBox();return[c,u]});if(a.length){const i=Math.max(...a.map(u=>u[0])),c=Math.max(...a.map(u=>u[1]));return[i,c,a.length*i]}}return[0,0,0]},[t]);return d.useMemo(()=>({minRequiredWidth:s,maxLabelWidth:n,maxLabelHeight:r}),[r,n,s])}function l_(){const e=d.useRef(null),{maxLabelWidth:t,minRequiredWidth:n}=FB({ref:e}),r=d.useRef(null),{maxLabelWidth:s}=FB({ref:r});return d.useMemo(()=>({xAxisRef:e,yAxisRef:r,maxXLabelWidth:t,maxYLabelWidth:s,minXRequiredWidth:n}),[t,s,n])}const BB=40,IS=e=>typeof e=="number";function c_({config:e,innerWidth:t,innerHeight:n,maxXLabelWidth:r}){let s=Math.floor(t/(r+BB));IS(e?.x?.numTicks)&&IS(s)&&(s=Math.min(s,e.x.numTicks)),r||(s=void 0);let o=Math.floor(n/BB);return IS(e?.y?.numTicks)&&(o=Math.min(o,e.y.numTicks)),{xTiltTicks:!1,xNumTicks:s,yNumTicks:o}}const aue="fill-quiet font-mono text-xs font-bold truncate max-w-[100px]",UB="fill-quiet text-xs font-semibold font-sans",Jht=(e,t,n)=>n?{transform:"rotate(-10deg)",transformOrigin:`${e}px ${t}px`,textAnchor:"end"}:{textAnchor:"middle"};function egt(e){const{shouldTilt:t,x:n,y:r,formattedValue:s,style:o,className:a,...i}=e;return l.jsx("text",{...i,x:n,y:r,dy:"2px",className:z(aue,a),style:{...o,...Jht(n,r,t)},children:s})}const f0=T.memo(function(t){const{margin:n,height:r,width:s,xScale:o,yScale:a,xFormat:i,yFormat:c,yNumTicks:u,xNumTicks:f,xTickValues:m,yTickValues:p,xTiltTicks:h,animated:g,tickColor:y,axisColor:x,xAxisRef:v,yAxisRef:b,xAxisLabel:_,yAxisLabel:w,gridDashed:S=!1,gridStrokeWidth:C=.5}=t,E=mi(),N=g?Wht:Gl,k=g?oue:wu,I=d.useCallback(A=>l.jsx(egt,{...A,shouldTilt:h}),[h]),M=d.useMemo(()=>({className:aue,textAnchor:"start",dx:"0.75em",dy:"-0.25em"}),[]);return l.jsxs(l.Fragment,{children:[l.jsx(Gl,{orientation:eo.bottom,top:r-n.bottom,scale:o,stroke:x,hideAxisLine:!0,label:_,labelClassName:UB,tickFormat:i,numTicks:f,tickStroke:y,innerRef:v,tickValues:m,tickComponent:I,axisClassName:"select-none"}),l.jsx(N,{orientation:eo.left,left:n.left,hideAxisLine:!0,label:w,labelOffset:7.5,labelClassName:UB,scale:a,tickFormat:c,stroke:x,tickStroke:y,hideTicks:!0,innerRef:b,tickLabelProps:M,numTicks:u,tickValues:p,axisClassName:"select-none"}),E&&l.jsx(k,{left:n.left,scale:a,width:s-n.right-n.left*2,strokeDasharray:S?"8,4":void 0,stroke:x,strokeWidth:C,numTicks:u})]})});f0.displayName="Axes";const iue=T.memo(({color:e})=>l.jsx("div",{className:"size-[14px] rounded-full",style:{backgroundColor:e}}));iue.displayName="Tile";const m0=T.memo(({entries:e})=>l.jsx("ol",{className:"my-sm gap-x-md gap-y-xs flex flex-wrap",children:e.map(({key:t,color:n})=>l.jsxs("li",{className:"gap-xs fade-in flex items-center transition-all duration-200",children:[l.jsx(iue,{color:n}),l.jsx(V,{variant:"tiny",color:"light",children:String(t)})]},String(t)))}));m0.displayName="Legend";const p0=T.memo(({width:e,height:t,children:n,ref:r})=>{const s=d.useMemo(()=>({position:"relative",height:t,overflow:"visible"}),[t]);return l.jsx(K,{style:s,children:l.jsx("svg",{width:e,ref:r,height:t,style:{position:"absolute",left:0,top:0,overflow:"visible"},children:n})})});p0.displayName="Svg";function VB(e){return function(){return e}}function tgt(e){return e[0]}function ngt(e){return e[1]}function lx(){this._=null}function u_(e){e.U=e.C=e.L=e.R=e.P=e.N=null}lx.prototype={constructor:lx,insert:function(e,t){var n,r,s;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=HB(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)r=n.U,n===r.L?(s=r.R,s&&s.C?(n.C=s.C=!1,r.C=!0,e=r):(e===n.R&&(Ym(this,n),e=n,n=e.U),n.C=!1,r.C=!0,Qm(this,r))):(s=r.L,s&&s.C?(n.C=s.C=!1,r.C=!0,e=r):(e===n.L&&(Qm(this,n),e=n,n=e.U),n.C=!1,r.C=!0,Ym(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,s=e.R,o,a;if(r?s?o=HB(s):o=r:o=s,t?t.L===e?t.L=o:t.R=o:this._=o,r&&s?(a=o.C,o.C=e.C,o.L=r,r.U=o,o!==s?(t=o.U,o.U=e.U,e=o.R,t.L=e,o.R=s,s.U=o):(o.U=t,t=o,e=o.R)):(a=e.C,e=o),e&&(e.U=t),!a){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(n=t.R,n.C&&(n.C=!1,t.C=!0,Ym(this,t),n=t.R),n.L&&n.L.C||n.R&&n.R.C){(!n.R||!n.R.C)&&(n.L.C=!1,n.C=!0,Qm(this,n),n=t.R),n.C=t.C,t.C=n.R.C=!1,Ym(this,t),e=this._;break}}else if(n=t.L,n.C&&(n.C=!1,t.C=!0,Qm(this,t),n=t.L),n.L&&n.L.C||n.R&&n.R.C){(!n.L||!n.L.C)&&(n.R.C=!1,n.C=!0,Ym(this,n),n=t.L),n.C=t.C,t.C=n.L.C=!1,Qm(this,t),e=this._;break}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}}};function Ym(e,t){var n=t,r=t.R,s=n.U;s?s.L===n?s.L=r:s.R=r:e._=r,r.U=s,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Qm(e,t){var n=t,r=t.L,s=n.U;s?s.L===n?s.L=r:s.R=r:e._=r,r.U=s,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function HB(e){for(;e.L;)e=e.L;return e}function dp(e,t,n,r){var s=[null,null],o=rs.push(s)-1;return s.left=e,s.right=t,n&&cx(s,e,t,n),r&&cx(s,t,e,r),to[e.index].halfedges.push(o),to[t.index].halfedges.push(o),s}function Xm(e,t,n){var r=[t,n];return r.left=e,r}function cx(e,t,n,r){!e[0]&&!e[1]?(e[0]=r,e.left=t,e.right=n):e.left===n?e[1]=r:e[0]=r}function rgt(e,t,n,r,s){var o=e[0],a=e[1],i=o[0],c=o[1],u=a[0],f=a[1],m=0,p=1,h=u-i,g=f-c,y;if(y=t-i,!(!h&&y>0)){if(y/=h,h<0){if(y0){if(y>p)return;y>m&&(m=y)}if(y=r-i,!(!h&&y<0)){if(y/=h,h<0){if(y>p)return;y>m&&(m=y)}else if(h>0){if(y0)){if(y/=g,g<0){if(y0){if(y>p)return;y>m&&(m=y)}if(y=s-c,!(!g&&y<0)){if(y/=g,g<0){if(y>p)return;y>m&&(m=y)}else if(g>0){if(y0)&&!(p<1)||(m>0&&(e[0]=[i+m*h,c+m*g]),p<1&&(e[1]=[i+p*h,c+p*g])),!0}}}}}function sgt(e,t,n,r,s){var o=e[1];if(o)return!0;var a=e[0],i=e.left,c=e.right,u=i[0],f=i[1],m=c[0],p=c[1],h=(u+m)/2,g=(f+p)/2,y,x;if(p===f){if(h=r)return;if(u>m){if(!a)a=[h,n];else if(a[1]>=s)return;o=[h,s]}else{if(!a)a=[h,s];else if(a[1]1)if(u>m){if(!a)a=[(n-x)/y,n];else if(a[1]>=s)return;o=[(s-x)/y,s]}else{if(!a)a=[(s-x)/y,s];else if(a[1]=r)return;o=[r,y*r+x]}else{if(!a)a=[r,y*r+x];else if(a[0]wn||Math.abs(o[0][1]-o[1][1])>wn))&&delete rs[s]}function agt(e){return to[e.index]={site:e,halfedges:[]}}function igt(e,t){var n=e.site,r=t.left,s=t.right;return n===s&&(s=r,r=n),s?Math.atan2(s[1]-r[1],s[0]-r[0]):(n===r?(r=t[1],s=t[0]):(r=t[0],s=t[1]),Math.atan2(r[0]-s[0],s[1]-r[1]))}function lue(e,t){return t[+(t.left!==e.site)]}function lgt(e,t){return t[+(t.left===e.site)]}function cgt(){for(var e=0,t=to.length,n,r,s,o;ewn||Math.abs(x-h)>wn)&&(u.splice(c,0,rs.push(Xm(i,g,Math.abs(y-e)wn?[e,Math.abs(p-e)wn?[Math.abs(h-r)wn?[n,Math.abs(p-n)wn?[Math.abs(h-t)=-1e-12)){var h=c*c+u*u,g=f*f+m*m,y=(m*h-u*g)/p,x=(c*g-f*h)/p,v=cue.pop()||new dgt;v.arc=e,v.site=s,v.x=y+a,v.y=(v.cy=x+i)+Math.sqrt(y*y+x*x),e.circle=v;for(var b=null,_=Wh._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x)if(_.L)_=_.L;else{b=_.P;break}else if(_.R)_=_.R;else{b=_;break}Wh.insert(b,v),b||(X8=v)}}}}function Od(e){var t=e.circle;t&&(t.P||(X8=t.N),Wh.remove(t),cue.push(t),u_(t),e.circle=null)}var uue=[];function fgt(){u_(this),this.edge=this.site=this.circle=null}function zB(e){var t=uue.pop()||new fgt;return t.site=e,t}function PS(e){Od(e),Ld.remove(e),uue.push(e),u_(e)}function mgt(e){var t=e.circle,n=t.x,r=t.cy,s=[n,r],o=e.P,a=e.N,i=[e];PS(e);for(var c=o;c.circle&&Math.abs(n-c.circle.x)wn)i=i.L;else if(a=t-hgt(i,n),a>wn){if(!i.R){r=i;break}i=i.R}else{o>-wn?(r=i.P,s=i):a>-wn?(r=i,s=i.N):r=s=i;break}agt(e);var c=zB(e);if(Ld.insert(r,c),!(!r&&!s)){if(r===s){Od(r),s=zB(r.site),Ld.insert(c,s),c.edge=s.edge=dp(r.site,c.site),xd(r),xd(s);return}if(!s){c.edge=dp(r.site,c.site);return}Od(r),Od(s);var u=r.site,f=u[0],m=u[1],p=e[0]-f,h=e[1]-m,g=s.site,y=g[0]-f,x=g[1]-m,v=2*(p*x-h*y),b=p*p+h*h,_=y*y+x*x,w=[(x*b-h*_)/v+f,(p*_-y*b)/v+m];cx(s.edge,u,g,w),c.edge=dp(u,e,null,w),s.edge=dp(e,g,null,w),xd(r),xd(s)}}function due(e,t){var n=e.site,r=n[0],s=n[1],o=s-t;if(!o)return r;var a=e.P;if(!a)return-1/0;n=a.site;var i=n[0],c=n[1],u=c-t;if(!u)return i;var f=i-r,m=1/o-1/u,p=f/u;return m?(-p+Math.sqrt(p*p-2*m*(f*f/(-2*u)-c+u/2+s-o/2)))/m+r:(r+i)/2}function hgt(e,t){var n=e.N;if(n)return due(n,t);var r=e.site;return r[1]===t?r[0]:1/0}var wn=1e-6,Ld,to,Wh,rs;function ggt(e,t,n){return(e[0]-n[0])*(t[1]-e[1])-(e[0]-t[0])*(n[1]-e[1])}function ygt(e,t){return t[1]-e[1]||t[0]-e[0]}function rM(e,t){var n=e.sort(ygt).pop(),r,s,o;for(rs=[],to=new Array(e.length),Ld=new lx,Wh=new lx;;)if(o=X8,n&&(!o||n[1]=a)return null;var c=e-i.site[0],u=t-i.site[1],f=c*c+u*u;do i=r.cells[s=o],o=null,i.halfedges.forEach(function(m){var p=r.edges[m],h=p.left;if(!((h===i.site||!h)&&!(h=p.right))){var g=e-h[0],y=t-h[1],x=g*g+y*y;xvgt({width:n,height:t,x:g=>r(o(g)),y:g=>s(a(g))})(e),[e,n,t,r,s,o,a]),p=d.useCallback(h=>{const{x:g,y}=c0(h)??{x:0,y:0},x=m.find(g,y,i);if(!x)return u();c({tooltipData:{localPoint:{x:g,y},voronoiSite:x}})},[c,u,m,i]);return d.useMemo(()=>({showTooltip:c,hideTooltip:u,handleTooltip:p,tooltipData:f}),[p,u,c,f])}const h0=T.memo(function({margin:t,height:n,width:r,tooltipHandle:s,tooltipHide:o,maxYLabelWidth:a}){const c=d.useCallback(()=>o(),[o]);return l.jsx(mm,{x:t.left+a-2.5,y:t.top,width:r-t.right-t.left*2-a+2.5*2,height:n-t.bottom-t.top,fill:"transparent",onTouchStart:s,onTouchMove:s,onMouseMove:s,onMouseLeave:c})});h0.displayName="TooltipListener";const Gh=T.memo(({cx:e,cy:t,color:n,r=3})=>l.jsx("circle",{cx:e,cy:t,r,fill:n,stroke:n,strokeWidth:1}));Gh.displayName="YDot";const wf=T.memo(({marginTop:e,tooltipLeft:t=0,innerHeight:n,color:r,strokeWidth:s=1,dotted:o=!1})=>{const a=d.useMemo(()=>({x:t,y:e}),[e,t]),i=d.useMemo(()=>({x:t,y:n+e}),[n,e,t]);return l.jsx("g",{children:l.jsx(Wb,{from:a,to:i,stroke:r,strokeWidth:s,strokeDasharray:o?"4 4":void 0,pointerEvents:"none",className:"animate-in fade-in duration-300"})})});wf.displayName="YCrosshair";const OS=e=>e,fue=T.memo(({entry:e,xFormat:t=OS,yFormat:n=OS,zFormat:r=OS,xGet:s,yGet:o,zGet:a})=>{const i=[{value:t(s(e))},{value:n(o(e))}];a&&i.unshift({value:r(a(e))});const c=i.filter(u=>u.value);return l.jsx(K,{children:c.map(({value:u},f)=>l.jsx(V,{variant:"tiny",className:"py-two",children:String(u)},f))})});fue.displayName="InnerToolTip";const mue=T.memo(({tooltipTop:e=0,tooltipLeft:t=0,children:n})=>{const r=d.useMemo(()=>({position:"absolute",pointerEvents:"none"}),[]);return l.jsx(Ule,{top:e,left:t,style:r,children:l.jsx(K,{variant:"background",className:"p-sm dark:border-inverse rounded-md border shadow-sm",children:n})})});mue.displayName="Tooltip";const g0=T.memo(({tooltipTop:e,tooltipLeft:t,entry:n,data:r,config:s,UserToolTip:o,xFormat:a,yFormat:i,zFormat:c,zGet:u,xGet:f,yGet:m})=>l.jsx(mue,{tooltipTop:e,tooltipLeft:t,children:o?l.jsx(o,{entry:n,config:s,data:r}):l.jsx(fue,{entry:n,config:s,xFormat:a,yFormat:i,zFormat:c,zGet:u,xGet:f,yGet:m})}));g0.displayName="ComposedTooltip";const Ku=0,pue=T.memo(function(t){const{width:n,height:r,margin:s,config:o,tooltip:a,colors:i,axes:c=!0}=t,{colorSchema:u,axisColor:f,tickColor:m}=Xb(i),p=mi(),h=Zb({data:t.data}),{xAxisRef:g,yAxisRef:y,maxYLabelWidth:x,maxXLabelWidth:v,minXRequiredWidth:b}=l_(),{innerHeight:_,innerWidth:w,xRange:S,yRange:C}=t_({width:n,height:r,margin:s,maxYLabelWidth:x,hasAxis:c}),{xNumTicks:E,yNumTicks:N,xTiltTicks:k}=c_({config:o,innerWidth:w,innerHeight:_,maxXLabelWidth:v}),{xGet:I,yGet:M,zGet:A}=Jb({config:o}),{xFormat:D,yFormat:P,xTooltipFormat:F,yTooltipFormat:R,zTooltipFormat:j}=e_({config:o}),L=d.useMemo(()=>{if(!o?.z?.accessor)return[{key:"default",data:h}];const ue=o.z.accessor,pe=sh(h,xe=>String(xe[ue]));return Object.entries(pe).map(([xe,he])=>({key:xe,data:he}))},[h,o.z]),U=L.length>1,O=U?L.map(({key:ue})=>ue):h.map(I),$=ao.band({range:S,domain:O,padding:.4}),G=[...new Set(h.map(I))],H=ao.band({range:[0,$.bandwidth()],domain:G,padding:.1}),Q=d.useMemo(()=>{const[ue,pe]=Mo(h,M),xe=Math.min(Ku,ue),he=Math.max(Ku,pe);return[xe,he]},[h,M]),Y=d.useMemo(()=>ao.linear({range:C,domain:Q}),[C,Q]),te=ao.ordinal({range:u.slice(0,G.length),domain:U?G:O}),{tooltipData:se,hideTooltip:ae,handleTooltip:X}=d_({data:h,innerHeight:_,innerWidth:w,xScale:U?H:$,yScale:Y,xGet:I,yGet:M}),le=d.useCallback(({localPoint:ue})=>{const pe=U?H:$,xe=pe.bandwidth(),he=(pe.step()-xe)/4;if(isNaN(ue?.x??NaN)||isNaN(ue?.y??NaN))return null;const _e=ue?.x,ke=ue?.y;return h.reduce((De,Ce)=>{let Be=pe(I(Ce))||0;const we=Y(M(Ce)),$e=Math.abs(we-Y(0));return U&&(Be+=$(Ce.z)||0),Be!==void 0&&we!==void 0&&_e>=Be-he&&_e<=Be+xe+he&&ke>=we-$e&&ke<=we+$e?{x:Be,y:we,data:Ce}:De},null)},[h,$,I,Y,M,U,H])({localPoint:se?.localPoint}),re=d.useMemo(()=>({marginLeft:s.left,marginRight:s.right}),[s.left,s.right]),ce=d.useMemo(()=>[Ku],[]);return l.jsxs(K,{className:"relative",children:[U&&G.length>1&&l.jsx(K,{style:re,children:l.jsx(m0,{entries:G.map(ue=>({key:ue,color:te(ue)}))})}),l.jsxs(p0,{width:n,height:r,children:[l.jsx(f0,{xScale:$,yScale:Y,xFormat:D,yFormat:P,width:n,height:r,margin:s,yNumTicks:N,xNumTicks:E,yTickValues:o.y.tickValues,xTickValues:o.x.tickValues,xAxisLabel:o.x.label,yAxisLabel:o.y.label,animated:!0,tickColor:m,axisColor:f,xAxisRef:g,yAxisRef:y,xTiltTicks:k}),p&&l.jsx(oue,{left:s.left,scale:Y,width:n-s.right-s.left*2,stroke:f,tickValues:ce,strokeWidth:2}),L.map(({key:ue,data:pe})=>l.jsx(Cs,{left:$(ue),children:pe.map((xe,he)=>{const _e=U?H:$;return l.jsx(Te.rect,{rx:2,ry:2,x:_e(I(xe)),width:_e.bandwidth(),fill:te(U?he:ue),initial:{y:Y(Ku),height:0,opacity:0},animate:{y:Y(Math.max(Ku,M(xe))),height:Math.abs(Y(M(xe))-Y(Ku)),opacity:1},transition:{duration:.5,ease:"easeInOut"}},he)})},ue)),l.jsx(h0,{margin:s,tooltipHandle:X,tooltipHide:ae,height:r,width:n,maxYLabelWidth:x})]}),le&&se&&l.jsx(g0,{UserToolTip:a,tooltipTop:se?.localPoint?.y,tooltipLeft:se?.localPoint?.x,entry:le.data,data:h,config:o,xFormat:F,yFormat:R,zFormat:j,zGet:A,xGet:I,yGet:M})]})});pue.displayName="BarChart";var bgt=["children","id","from","to","x1","y1","x2","y2","fromOffset","fromOpacity","toOffset","toOpacity","rotate","transform","vertical"];function sM(){return sM=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Z8(e){var t=e.children,n=e.id,r=e.from,s=e.to,o=e.x1,a=e.y1,i=e.x2,c=e.y2,u=e.fromOffset,f=u===void 0?"0%":u,m=e.fromOpacity,p=m===void 0?1:m,h=e.toOffset,g=h===void 0?"100%":h,y=e.toOpacity,x=y===void 0?1:y,v=e.rotate,b=e.transform,_=e.vertical,w=_===void 0?!0:_,S=_gt(e,bgt),C=o,E=i,N=a,k=c;return w&&!C&&!E&&!N&&!k&&(C="0",E="0",N="0",k="1"),T.createElement("defs",null,T.createElement("linearGradient",sM({id:n,x1:C,y1:N,x2:E,y2:k,gradientTransform:v?"rotate("+v+")":b},S),!!t&&t,!t&&T.createElement("stop",{offset:f,stopColor:r,stopOpacity:p}),!t&&T.createElement("stop",{offset:g,stopColor:s,stopOpacity:x})))}Z8.propTypes={id:He.string.isRequired,from:He.string,to:He.string,x1:He.oneOfType([He.string,He.number]),x2:He.oneOfType([He.string,He.number]),y1:He.oneOfType([He.string,He.number]),y2:He.oneOfType([He.string,He.number]),fromOffset:He.oneOfType([He.string,He.number]),fromOpacity:He.oneOfType([He.string,He.number]),toOffset:He.oneOfType([He.string,He.number]),toOpacity:He.oneOfType([He.string,He.number]),rotate:He.oneOfType([He.string,He.number]),transform:He.string,children:He.node,vertical:He.bool};function wgt({xScale:e,xPosition:t}){const n=e.domain(),[r,s]=e.range(),o=(s-r)/(n.length-1),a=Math.min(Math.max(Math.round((t-r)/o),0),n.length-1);return n[a]}function Cgt({tooltipData:e,config:t,groups:n,xScale:r,xGet:s}){const o=t.z?.accessor?e?.voronoiSite?.data?.[t.z?.accessor]:"",a=d.useMemo(()=>[...(n.find(({key:m})=>m===o)||n[0])?.d||[]].sort((m,p)=>s(m)-s(p)),[o,n,s]),i=e?.localPoint.x,c=d.useMemo(()=>a.map(s),[a,s]);return d.useMemo(()=>{if(i==null)return;if("invert"in r){const p=r.invert(i),h=sm(c,p);if(h<=0)return a[0];if(h>=c.length)return a[c.length-1];const g=a[h-1],y=a[h];return Math.abs(s(g)-p)String(s(p))===String(f));return m||a.reduce((p,h)=>Math.abs(s(h)-f)ao[ce]({range:[ae[0],P?ae[1]-P/2:ae[1]],domain:Q}),[ce,ae,Q,P]),xe=d.useMemo(()=>{const Ye=ue==="log";return ao[ue]({range:X,domain:Y,base:Ye?2:void 0,nice:!Ye,round:!0})},[ue,X,Y]),he=d.useMemo(()=>{if(!a.z?.accessor)return[{key:"",d:_}];const Ye=a.z.accessor,Me=sh(_,Ve=>String(Ve[Ye]));return Object.entries(Me).map(([Ve,ct])=>({key:Ve,d:ct}))},[_,a?.z?.accessor]),_e=d.useMemo(()=>{if(he.length<=1)return null;const Ye=new Map;return he.forEach(Ve=>{Ve.d.forEach(ct=>{const vt=R(ct);Ye.set(vt,ct)})}),Array.from(Ye.values()).sort((Ve,ct)=>R(Ve)-R(ct))},[he,R]),{tooltipData:ke,hideTooltip:De,handleTooltip:Ce}=d_({data:_,innerHeight:te,innerWidth:se,xScale:pe,yScale:xe,xGet:R,yGet:j}),Be=Cgt({tooltipData:ke,config:a,groups:he,xScale:pe,xGet:R}),we=d.useMemo(()=>!y||!he.length||!he[0].d.length?null:he[0].d.at(-1),[he,y]),$e=d.useMemo(()=>sl().x(Ye=>pe(R(Ye))).y(Ye=>xe(j(Ye))).curve(ru),[pe,xe,R,j]),yt=d.useMemo(()=>ao.ordinal({domain:he.map(({key:Ye})=>Ye),range:S}),[S,he]),me=d.useCallback(()=>{ke&&b(Be||null)},[ke,Be]),ve=d.useCallback(()=>{b(null)},[]),Ae=d.useMemo(()=>{const Ye={};if(!v||!Be||!he.length)return Ye;const Me=R(v),Ve=R(Be),[ct,vt]=Me{const ut=a.z?.accessor?fn[a.z.accessor]:he[0].key,bt=he.find(({key:jt})=>jt===ut);return bt?bt.d.filter(jt=>{const pt=R(jt);return pt>=ct&&pt<=vt}):[]},ot=a.z?.accessor?v[a.z.accessor]:he[0].key;Ye[ot]=Dt(v);const $t=a.z?.accessor?Be[a.z.accessor]:he[0].key;return ot!==$t&&(Ye[$t]=Dt(Be)),Ye},[v,Be,he,R,a.z?.accessor]),Ge=d.useMemo(()=>{const Ye=Ae[a.z?.accessor?v?.[a.z.accessor]:he[0]?.key]||[],Me=Ae[a.z?.accessor?Be?.[a.z.accessor]:he[0]?.key]||[],Ve=[...Ye,...Me],ct=new Map;return Ve.forEach(Dt=>{ct.set(R(Dt),Dt)}),Array.from(ct.values()).sort((Dt,ot)=>R(Dt)-R(ot))},[Ae,a.z?.accessor,v,Be,he,R]),ht=d.useMemo(()=>({marginLeft:o.left,marginRight:o.right}),[o.left,o.right]),mt=d.useMemo(()=>[h],[h]),Qe=d.useCallback(Ye=>pe(R(Ye))??0,[pe,R]),Tt=d.useCallback(Ye=>xe(j(Ye))??0,[xe,j]);return l.jsxs(K,{children:[a.z&&he?.length>1&&m&&l.jsx(K,{style:ht,children:l.jsx(m0,{entries:he.map(({key:Ye})=>({key:Ye,color:yt(Ye)}))})}),l.jsxs(K,{className:"relative",onMouseDown:me,onMouseUp:ve,onMouseLeave:ve,children:[l.jsxs(p0,{width:r,height:s,children:[c&&l.jsx(f0,{width:r,height:s,margin:o,xScale:pe,yScale:xe,xFormat:U,yFormat:O,yNumTicks:le,xNumTicks:ee,yTickValues:a.y.tickValues,xTickValues:a.x.tickValues,tickColor:C,axisColor:E,xAxisRef:M,yAxisRef:A,xTiltTicks:re,xAxisLabel:a.x.label,yAxisLabel:a.y.label}),x&&x({xScale:pe,yScale:xe,xGet:R,yGet:j}),h&&l.jsx("text",{x:r-o.right-10,y:xe(h)-5,fill:N,fontSize:12,className:"font-mono",textAnchor:"end",children:g==="CRYPTO"?n({defaultMessage:"Prev day: {value}",id:"7i8MvDtMyq"},{value:typeof a.y.format=="function"?a.y.format(h):h}):n({defaultMessage:"Prev close: {value}",id:"uRPxTu0cgj"},{value:typeof a.y.format=="function"?a.y.format(h):h})}),h&&l.jsx(wu,{left:o.left,scale:xe,width:r-o.right-o.left*2,stroke:N,tickValues:mt,strokeWidth:2,strokeDasharray:"2,6",opacity:I?.6:1}),Be&&l.jsx(wf,{marginTop:o.top,tooltipLeft:pe(R(Be)),innerHeight:te,color:E,strokeWidth:1}),v&&l.jsx(wf,{marginTop:o.top,tooltipLeft:pe(R(v)),innerHeight:te,color:E,strokeWidth:1}),_e&&he.length>1&&he[1]?.key&&l.jsx(Te.path,{d:$e(_e),stroke:yt(he[1].key),strokeWidth:1.5,fill:"none",shapeRendering:"geometricPrecision",initial:f?{pathLength:f?0:1,opacity:f?0:1}:void 0,animate:f?{pathLength:1,opacity:1}:void 0,transition:f?{duration:.8,ease:$a}:void 0}),he.map(({d:Ye,key:Me},Ve)=>{const ct=w.current.has(Me),vt=ct||!f?{initial:void 0,animate:{pathLength:1,opacity:1}}:{initial:{pathLength:f?0:1,opacity:f?0:1},animate:{pathLength:1,opacity:1},transition:{duration:.8,ease:$a,delay:Ve/he.length}};return ct||w.current.add(Me),l.jsx(Te.path,{d:$e(Ye),stroke:yt(Me),strokeWidth:2,fill:"none",shapeRendering:"geometricPrecision",...vt},Me)}),(Be||we)&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:{duration:0,delay:.8},children:[l.jsx(Gh,{cx:pe(R(Be||we)),cy:xe(j(Be||we)),color:yt(a.z?.accessor?(Be||we)?.[a.z.accessor]:""),r:5}),v&&Be&&l.jsxs(l.Fragment,{children:[l.jsx(Gh,{cx:pe(R(v)),cy:xe(j(v)),color:yt(a.z?.accessor?v[a.z.accessor]:""),r:5}),Ge.length>1&&l.jsx(Hh,{data:Ge,x:Qe,y:Tt,fill:yt(he[0].key),fillOpacity:.2,stroke:"none",yScale:xe,curve:ru})]})]}),(he.length===1||he.length===2)&&he.map(({d:Ye,key:Me},Ve)=>{const ct=yt(Me);return l.jsx(Te.g,{initial:f?{opacity:0,clipPath:"inset(0% 100% 0% 0%)"}:void 0,animate:f?{opacity:1,clipPath:"inset(0% 0% 0% 0%)"}:void 0,transition:f?{duration:.8,ease:$a,delay:Ve/he.length}:void 0,children:!v&&(he.length===1||Ve===0)&&l.jsxs(l.Fragment,{children:[l.jsx(Z8,{from:`${ct}22`,to:`${ct}00`,id:Me}),l.jsx(Hh,{data:Ye,x:Qe,y:Tt,strokeWidth:0,yScale:xe,fill:`url('#${Me}')`},Me)]})},Me)}),l.jsx(h0,{margin:o,tooltipHandle:Ce,tooltipHide:De,height:s,width:r,maxYLabelWidth:D})]}),Be&&ke&&l.jsx(g0,{tooltipTop:ke.localPoint.y,tooltipLeft:ke.localPoint.x,entry:Be,UserToolTip:i?Ye=>l.jsx(i,{...Ye,comparisonEntry:v||void 0}):void 0,data:_,config:a,xFormat:$,yFormat:G,zFormat:H,zGet:L,xGet:R,yGet:j})]})]})});hue.displayName="CompositeLineChart";function Sgt({xScale:e,xPosition:t}){const n=e.domain(),[r,s]=e.range(),o=(s-r)/(n.length-1),a=Math.min(Math.max(Math.round((t-r)/o),0),n.length-1);return n[a]}function Egt({tooltipData:e,config:t,groups:n,xScale:r,xGet:s}){const o=t.z?.accessor?e?.voronoiSite?.data?.[t.z?.accessor]:"",a=d.useMemo(()=>[...(n.find(({key:f})=>f===o)||n[0])?.d||[]].sort((f,m)=>s(f)-s(m)),[o,n,s]),i=e?.localPoint.x;return d.useMemo(()=>{if(!i)return;if("invert"in r){const m=r.invert(i),p=sm(a.map(s),m);return a?.[p-1]}const u=Sgt({xScale:r,xPosition:i});return a.find(m=>String(s(m))===String(u))},[i,r,a,s])}const gue=T.memo(e=>{const{$t:t}=J(),{enableComparison:n=!0,width:r,height:s,margin:o={top:0,right:0,bottom:0,left:0},config:a,tooltip:i,axes:c=!0,colors:u,animate:f=!0,includeLegend:m=!0,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y=!1,children:x}=e,[v,b]=d.useState(null),_=Zb({data:e.data}),w=mi(),{colorSchema:S,tickColor:C,axisColor:E,textColor:N}=Xb(u),{colorScheme:k}=Ss(),I=d.useMemo(()=>w?k==="dark":!1,[k,w]),{xAxisRef:M,yAxisRef:A,maxYLabelWidth:D,maxXLabelWidth:P,minXRequiredWidth:F}=l_(),{xGet:R,yGet:j,zGet:L}=Jb({config:a}),{xFormat:U,yFormat:O,xTooltipFormat:$,yTooltipFormat:G,zTooltipFormat:H}=e_({config:a}),{xDomain:Q,yDomain:Y}=O8({config:a,data:_,xGet:R,yGet:j,endTime:p,previousClose:h}),{innerHeight:te,innerWidth:se,xRange:ae,yRange:X}=t_({width:r,height:s,margin:o,maxYLabelWidth:D,hasAxis:c}),{xNumTicks:ee,yNumTicks:le,xTiltTicks:re}=c_({config:a,innerWidth:se,innerHeight:te,maxXLabelWidth:P}),ce=a.x.scale,ue=d.useMemo(()=>ao[ce]({range:[ae[0],P?ae[1]-P/2:ae[1]],domain:Q}),[ce,ae,Q,P]),pe=a.y.scale,xe=d.useMemo(()=>{const Qe=pe==="log";return ao[pe]({range:X,domain:Y,base:Qe?2:void 0,nice:!Qe,round:!0})},[pe,X,Y]),he=d.useMemo(()=>{if(!a.z?.accessor)return[{key:"",d:_}];const Qe=a.z.accessor,Tt=sh(_,Ye=>String(Ye[Qe]));return Object.entries(Tt).map(([Ye,Me])=>({key:Ye,d:Me}))},[_,a?.z?.accessor]),{tooltipData:_e,hideTooltip:ke,handleTooltip:De}=d_({data:_,innerHeight:te,innerWidth:se,xScale:ue,yScale:xe,xGet:R,yGet:j}),Ce=Egt({tooltipData:_e,config:a,groups:he,xScale:ue,xGet:R}),Be=d.useMemo(()=>!y||!he.length||!he[0].d.length?null:he[0].d.at(-1),[he,y]),we=d.useMemo(()=>sl().x(Qe=>ue(R(Qe))).y(Qe=>xe(j(Qe))).curve(ru),[ue,xe,R,j]),$e=d.useMemo(()=>ao.ordinal({range:S}),[S]),yt=d.useCallback(()=>{!_e||!n||b(Ce||null)},[n,_e,Ce]),me=d.useCallback(()=>{n&&b(null)},[n]),ve=d.useMemo(()=>{if(!v||!Ce||!he.length)return[];const Qe=he[0],Tt=R(v),Ye=R(Ce),[Me,Ve]=Tt{const vt=R(ct);return vt>=Me&&vt<=Ve})},[v,Ce,he,R]),Ae=d.useMemo(()=>({marginLeft:o.left,marginRight:o.right}),[o.left,o.right]),Ge=d.useCallback(Qe=>ue(R(Qe))??0,[ue,R]),ht=d.useCallback(Qe=>xe(j(Qe))??0,[xe,j]),mt=d.useMemo(()=>[h],[h]);return l.jsxs(K,{children:[a.z&&he?.length>1&&m&&l.jsx(K,{style:Ae,children:l.jsx(m0,{entries:he.map(({key:Qe})=>({key:Qe,color:$e(Qe)}))})}),l.jsxs(K,{className:"relative",onMouseDown:yt,onMouseUp:me,onMouseLeave:me,children:[l.jsxs(p0,{width:r,height:s,children:[c&&l.jsx(f0,{width:r,height:s,margin:o,xScale:ue,yScale:xe,xFormat:U,yFormat:O,yNumTicks:le,xNumTicks:ee,yTickValues:a.y.tickValues,xTickValues:a.x.tickValues,tickColor:C,axisColor:E,xAxisRef:M,yAxisRef:A,xTiltTicks:re,xAxisLabel:a.x.label,yAxisLabel:a.y.label}),x&&x({xScale:ue,yScale:xe,xGet:R,yGet:j}),h&&l.jsx("text",{x:r-o.right-10,y:xe(h)-5,fill:N,fontSize:12,className:"font-mono",textAnchor:"end",children:g==="CRYPTO"?t({defaultMessage:"Prev day: {value}",id:"7i8MvDtMyq"},{value:typeof a.y.format=="function"?a.y.format(h):h}):t({defaultMessage:"Prev close: {value}",id:"uRPxTu0cgj"},{value:typeof a.y.format=="function"?a.y.format(h):h})}),h&&l.jsx(wu,{left:o.left,scale:xe,width:r-o.right-o.left*2,stroke:N,tickValues:mt,strokeWidth:2,strokeDasharray:"2,6",opacity:I?.6:1}),Ce&&l.jsx(wf,{marginTop:o.top,tooltipLeft:ue(R(Ce)),innerHeight:te,color:E,strokeWidth:1}),v&&l.jsx(wf,{marginTop:o.top,tooltipLeft:ue(R(v)),innerHeight:te,color:E,strokeWidth:1}),(Ce||Be)&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:{duration:0,delay:.8},children:[l.jsx(Gh,{cx:ue(R(Ce||Be)),cy:xe(j(Ce||Be)),color:$e(a.z?.accessor?(Ce||Be)?.[a.z.accessor]:""),r:5}),v&&Ce&&ve.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Gh,{cx:ue(R(v)),cy:xe(j(v)),color:$e(a.z?.accessor?v[a.z.accessor]:""),r:5}),l.jsx(Hh,{data:ve,x:Ge,y:ht,fill:$e(a.z?.accessor?v[a.z.accessor]:""),fillOpacity:.2,stroke:"none",yScale:xe,curve:ru})]})]}),he.length===1&&he.map(({d:Qe,key:Tt},Ye)=>{const Me=$e(Tt);return l.jsx(Te.g,{initial:f?{opacity:0,clipPath:"inset(0% 100% 0% 0%)"}:void 0,animate:f?{opacity:1,clipPath:"inset(0% 0% 0% 0%)"}:void 0,transition:f?{duration:.8,ease:"easeInOut",delay:Ye/he.length}:void 0,children:!v&&l.jsxs(l.Fragment,{children:[l.jsx(Z8,{from:`${Me}22`,to:`${Me}00`,id:Tt}),l.jsx(Hh,{data:Qe,x:Ge,y:ht,strokeWidth:0,yScale:xe,fill:`url('#${Tt}')`},Tt)]})},Tt)}),he.map(({d:Qe,key:Tt},Ye)=>l.jsx(Te.path,{d:we(Qe),stroke:$e(Tt),strokeWidth:2,fill:"none",shapeRendering:"geometricPrecision",initial:f?{pathLength:0,opacity:0}:void 0,animate:f?{pathLength:1,opacity:1}:void 0,transition:f?{duration:.8,ease:"easeInOut",delay:Ye/he.length}:void 0},Tt)),l.jsx(h0,{margin:o,tooltipHandle:De,tooltipHide:ke,height:s,width:r,maxYLabelWidth:D})]}),Ce&&_e&&l.jsx(g0,{tooltipTop:_e.localPoint.y,tooltipLeft:_e.localPoint.x,entry:Ce,UserToolTip:i?Qe=>l.jsx(i,{...Qe,comparisonEntry:v||void 0}):void 0,data:_,config:a,xFormat:$,yFormat:G,zFormat:H,zGet:L,xGet:R,yGet:j})]})]})});gue.displayName="LineChart";const yue=T.memo(e=>{const{width:t,height:n,margin:r,config:s,tooltip:o,colors:a,axes:i=!0}=e,c=3,u=Zb({data:e.data}),{colorSchema:f,tickColor:m,axisColor:p}=Xb(a),{xAxisRef:h,yAxisRef:g,maxYLabelWidth:y,maxXLabelWidth:x,minXRequiredWidth:v}=l_(),{innerHeight:b,innerWidth:_,xRange:w,yRange:S}=t_({width:t,height:n,margin:r,maxYLabelWidth:y,hasAxis:i}),{xNumTicks:C,yNumTicks:E,xTiltTicks:N}=c_({config:s,innerWidth:_,innerHeight:b,maxXLabelWidth:x}),{xGet:k,yGet:I,zGet:M}=Jb({config:s}),{xFormat:A,yFormat:D,xTooltipFormat:P,yTooltipFormat:F,zTooltipFormat:R}=e_({config:s}),{xDomain:j,yDomain:L}=O8({data:u,config:s,xGet:k,yGet:I}),{scale:U}=s.x,O=d.useMemo(()=>ao[U]({range:w,domain:j}),[U,w,j]),{scale:$}=s.y,G=d.useMemo(()=>ao[$]({range:S,domain:L,nice:!0,round:!0}),[$,S,L]),{tooltipData:H,handleTooltip:Q,hideTooltip:Y}=d_({data:u,innerHeight:b,innerWidth:_,xScale:O,yScale:G,xGet:k,yGet:I,voronoiRadius:c*2}),te=d.useMemo(()=>ao.ordinal({range:f}),[f]),se=d.useMemo(()=>{if(!s.z?.accessor)return[];const ee=new Set([]);return u.forEach(le=>ee.add(le[s?.z?.accessor])),Array.from(ee)},[u,s.z]),ae=H?.voronoiSite,X=d.useMemo(()=>({marginLeft:r.left,marginRight:r.right}),[r.left,r.right]);return l.jsxs(K,{children:[se.length>1&&l.jsx(K,{style:X,children:l.jsx(m0,{entries:se.map(ee=>({key:ee,color:te(ee)}))})}),l.jsxs(K,{className:"relative",children:[l.jsxs(p0,{width:t,height:n,children:[l.jsx(f0,{xScale:O,yScale:G,xFormat:A,yFormat:D,width:t,height:n,margin:r,yTickValues:s.y.tickValues,xTickValues:s.x.tickValues,tickColor:m,axisColor:p,xAxisRef:h,yAxisRef:g,yNumTicks:E,xNumTicks:C,xTiltTicks:N}),ae&&l.jsx(wf,{marginTop:r.top,tooltipLeft:ae[0],innerHeight:b,color:p}),l.jsx("g",{children:u.map((ee,le)=>{const re=ae?.data?.__key==ee.__key,ce=s.z?.accessor?te(ee[s.z.accessor]):te("");return l.jsx(Te.circle,{"data-hint":`${k(ee)}: ${I(ee)}`,cx:O(k(ee)),cy:G(I(ee)),r:c,strokeWidth:c/2,stroke:ce,fill:re?"transparent":ce,initial:{opacity:0},animate:{opacity:1},transition:{duration:.8,ease:"easeInOut",delay:le/u.length}},ee.__key)})}),l.jsx(h0,{margin:r,tooltipHandle:Q,tooltipHide:Y,height:n,width:t,maxYLabelWidth:y})]}),ae&&l.jsx(g0,{tooltipTop:ae?.[1],tooltipLeft:ae?.[0],UserToolTip:o,entry:ae.data,data:u,config:s,xFormat:P,yFormat:F,zFormat:R,zGet:M,xGet:k,yGet:I})]})]})});yue.displayName="ScatterChart";function kgt(e){const{type:t,config:n,width:r,data:s,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,children:x,enableComparison:v}=e;return t==="line"?l.jsx(gue,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,enableComparison:v,children:x}):t==="bar"?l.jsx(pue,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,colors:u,includeLegend:m}):t==="scatter"?l.jsx(yue,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,colors:u,includeLegend:m}):t==="compositeLine"?l.jsx(hue,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,children:x}):null}const Mgt=T.memo(function({type:t,config:n,data:r,tooltip:s,height:o=l0,margin:a=Jdt,axes:i,className:c,colors:u,includeLegend:f,endTime:m,previousClose:p,exchangeName:h,showLastPoint:g,animate:y,children:x,enableComparison:v}){const b=d.useRef(null),{width:_}=Ple(b);return l.jsx("div",{ref:b,className:c,children:l.jsx(kgt,{type:t,data:r,config:n,width:_,height:o,margin:a,tooltip:s,axes:i,colors:u,includeLegend:f,endTime:m,previousClose:p,exchangeName:h,showLastPoint:g,animate:y,enableComparison:v,children:x})})});Mgt.displayName="Chart";const xue=(e,t)=>{const n="#f7f1f2",r="#1f2121";return e?Tgt(e,Yn(t?r:n),t):Yn(n)},Tgt=(e,t,n,r=3)=>{if(!e)return Yn(t);let s=Yn(e),o=0,a=0;for(;s.contrast(Yn(t))20)););return s};function Agt(e,t){const n=e.lightness();return e.lightness(n+(100-n)*t)}function Ngt(e,t){const n=e.lightness();return e.lightness(n-n*t)}const Rgt=({event:e})=>{const t=e.event.status==="live",n=e.event.extra.pitch_outcome,r=n?.count?.outs??0,s=n?.count?.balls??0,o=n?.count?.strikes??0,a=n?.runners,i=n?.count,c=n?.type!=="half_over"&&r!==3&&s!==4&&o!==3;return t?l.jsxs("div",{className:"mt-lg md:mt-md flex flex-col items-center gap-0",children:[l.jsx(Dgt,{runners:a}),l.jsx(jgt,{outs:r}),l.jsx(Igt,{count:i,show:c})]}):null},Dgt=({runners:e})=>{const t=e?.filter(n=>!n.out).map(n=>n.ending_base);return l.jsx("div",{style:{transformStyle:"preserve-3d",perspective:"1000px"},className:"inline-flex",children:l.jsx("div",{style:{transform:"rotateX(45deg)"},children:l.jsxs("div",{className:"gap-three grid rotate-45 grid-cols-2 grid-rows-2",children:[l.jsx(LS,{active:t?.includes(2)??!1}),l.jsx(LS,{active:t?.includes(1)??!1}),l.jsx(LS,{active:t?.includes(3)??!1})]})})})},LS=({active:e})=>l.jsx("div",{className:z("size-3 duration-150 md:size-4",e?"bg-super":"bg-inverse/25")}),jgt=({outs:e})=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(FS,{filled:e>=1}),l.jsx(FS,{filled:e>=2}),l.jsx(FS,{filled:e>=3})]}),FS=({filled:e})=>l.jsx("div",{className:z("relative size-1 rounded-full duration-150",e?"bg-inverse":"bg-inverse/25"),children:e&&l.jsx("div",{className:"bg-inverse repeat-1 absolute inset-0 animate-ping rounded-full"})}),Igt=({count:e,show:t})=>{const n=e?.balls??0,r=e?.strikes??0,s=n===0&&r===0;return l.jsx(V,{variant:"micro",color:s?"ultraLight":"light",className:z("mt-1 duration-150",t?"opacity-100":"opacity-0"),children:l.jsx("span",{className:"font-mono",children:t?`${n}-${r}`:l.jsx(l.Fragment,{children:" "})})})};function Pgt({children:e,className:t}){return l.jsx(V,{variant:"micro",className:z("py-xs !font-mono uppercase",t),color:"light",children:e})}const f_=({className:e,textCenter:t,finalText:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re();return l.jsx("div",{className:z("flex items-center justify-center",e),children:l.jsx(V,{variant:s?"micro":"tiny",color:"light",className:"bg-subtler dark:bg-subtle pt-three rounded-full px-2.5 py-0.5",textCenter:t,children:n?n.toUpperCase():r({defaultMessage:"Final",id:"6/JzkWi0di"}).toUpperCase()})})},vue=({className:e,textCenter:t=!1})=>{const{$t:n}=J(),{isMobileStyle:r}=Re();return l.jsx("div",{className:z("flex items-center justify-center",e),children:l.jsx(V,{variant:r?"micro":"tiny",color:"light",className:"bg-subtler dark:bg-subtle pt-three rounded-full px-2.5 py-0.5",textCenter:t,children:n({defaultMessage:"Upcoming",id:"6/aEFZbs2i"}).toUpperCase()})})},Ogt=T.memo(function({attributions:t}){const{$t:n}=J(),r=t.join(" · ");return l.jsxs(K,{className:"mt-md pt-md pb-lg flex flex-col gap-1 border-t",children:[l.jsx(V,{variant:"smallBold",color:"light",className:"text-center",children:r}),l.jsx(V,{variant:"small",color:"light",className:"text-center",children:n({defaultMessage:"{perplexity} is not affiliated with, endorsed by, or sponsored by any sports leagues or teams. All trademarks, team names, logos, and player images are the property of their respective owners. The content provided on this page is for informational purposes only and is intended to help users follow sports news and updates.",id:"M0PBu8vKH2"},{perplexity:"Perplexity"})})]})});Ogt.displayName="SportsSources";const bue=T.memo(({children:e,innerRef:t,canScrollLeft:n,canScrollRight:r,fadeOut:s})=>l.jsx("div",{className:"gap-md flex w-full flex-col overflow-hidden",children:l.jsx(nl,{orientation:"horizontal",viewportRef:t,showScrollIndicator:!1,className:z("relative",{"mask-fade-l-12":n&&!r&&s,"mask-fade-r-12":r&&!n&&s,"mask-fade-h-12":n&&r&&s}),children:l.jsx("div",{className:"p-md pt-0",children:e})})}));bue.displayName="CanonicalScroll";const Lgt=T.memo(({title:e,subtitle:t,children:n,scrollable:r,fadeOut:s,trailing:o,titleClassName:a})=>{const i=d.useRef(null),[c,u]=d.useState(!1),[f,m]=d.useState(!1),p=d.useCallback(()=>{i.current?.scrollTo({left:i.current.scrollLeft-i.current.clientWidth,behavior:"smooth"})},[i]),h=d.useCallback(()=>{i.current?.scrollTo({left:i.current.scrollLeft+i.current.clientWidth,behavior:"smooth"})},[i]),g=d.useCallback(()=>{i.current&&(u(i.current.scrollLeft>0),m(i.current.scrollLeft+i.current.clientWidth+10i.current.clientWidth))},[i]);return d.useEffect(()=>{const y=i.current;return y?.addEventListener("scroll",g),()=>{y?.removeEventListener("scroll",g)}},[g,i]),d.useEffect(()=>{const y=new ResizeObserver(g);return y.observe(window.document.body),()=>{y.disconnect()}},[g,i]),d.useEffect(()=>{g()},[g]),l.jsxs(K,{className:"gap-md flex flex-col",children:[l.jsxs(_ue,{title:e,subtitle:t,className:a,children:[o,r&&l.jsxs("div",{className:"-mr-sm flex items-center",children:[l.jsx(rt,{icon:B("chevron-left"),size:"small",onClick:p,disabled:!c,variant:c?void 0:"noHover"}),l.jsx(rt,{icon:B("chevron-right"),size:"small",onClick:h,disabled:!f,variant:f?void 0:"noHover"})]})]}),r?l.jsx(bue,{innerRef:i,canScrollLeft:c,canScrollRight:f,fadeOut:s,children:n}):l.jsx("div",{ref:i,className:"gap-md px-md pb-md flex flex-col",children:n})]})});Lgt.displayName="CanonicalSection";const _ue=T.memo(({children:e,title:t,subtitle:n,className:r})=>l.jsxs(K,{className:z("gap-md px-md py-sm flex items-center justify-between border-b",r),children:[l.jsxs(K,{className:"flex items-center justify-between",children:[t&&l.jsx(V,{variant:"baseSemi",children:t}),n&&l.jsx(V,{variant:"smallCaps",color:"light",children:n})]}),e]}));_ue.displayName="SectionTitle";const Fgt={tiny:"size-[16px]",small:"size-[24px]",medium:"size-[32px]",large:"xl:size-[64px] size-[50px]"},Bgt={tiny:"p-[0.5px]",small:"p-[0.5px]",medium:"p-[0.5px]",large:"p-[0.5px]"},Ugt={tiny:"border-[1px]",small:"border-[1px]",medium:"border-[2px]",large:"border-[4px]"},y0=d.memo(({includeStripe:e=!0,includeShadow:t=!1,className:n,includeBackground:r=!1,size:s="large",logo:o,color:a,...i})=>{const c=d.useMemo(()=>{let u=Fgt[s];return r&&(u+=` ${Bgt[s]}`),u},[r,s]);return l.jsx("div",{className:z(c,{"shadow-subtle":t&&r,"border-subtlest rounded-full border bg-white dark:border-transparent":r},n),...i,children:l.jsx("div",{className:z("rounded-inherit relative flex size-full items-center justify-center",{[Ugt[s]]:e&&r}),style:{borderColor:r?a:void 0},children:l.jsx("img",{src:o,alt:"",width:r?"70%":"100%",height:"auto"})})})});y0.displayName="SportsTeamLogo";function Vgt(e,t){if(t!=="upcoming"||et?xue(Yn(e),t==="dark").toString():e,[e,t])}const wue=T.memo(({variant:e="common",active:t,vertical:n,onClick:r,indicatorPos:s="bottom",extraCSS:o,showNewIndicator:a,styleProps:i,isNewRedesign:c=!1,disabled:u,innerRef:f,...m})=>{const p=z("absolute",{"right-0 h-full w-[3px] rounded-l-sm":s=="right","left-0 h-full w-[3px] rounded-l-sm":s=="left","bottom-0 left-0 right-0 h-[3px] rounded-t-sm":s=="bottom","top-0 left-0 right-0 h-[3px] rounded-b-sm":s=="top","bg-inverse":e==="primary","bg-inverse/70":e==="common"},i?.indicatorClass),h=z({"px-xs transition duration-300 relative ":n,"flex items-center":t&&n,"justify-center px-xs":!n,"!cursor-not-allowed":u,"my-0.5 [&_*]:!font-normal [&_*]:!text-foreground [&_a]:hover:bg-subtler":c,"[&_a]:bg-subtle [&_a]:text-foreground [&_a]:hover:bg-subtle":c&&t,"opacity-70 cursor-not-allowed":u},t?i?.activeBgClass:i?.bgClass);return l.jsxs("div",{onClick:u?void 0:r,className:h,children:[a&&l.jsx("div",{className:"right-md top-sm text-super absolute z-10",children:"●"}),l.jsx(rt,{variant:u?"noHover":t?"primary":"common",...m,fullWidth:!0,extraCSS:z("py-md focus-visible:!bg-transparent before:absolute before:opacity-0 focus-visible:before:opacity-100 before:ring-super/50 before:ring-[1.5px] before:inset-y-0 before:inset-x-[-10px] before:rounded-md",{"cursor-not-allowed":u},o),noXPadding:!n,disabled:u,ref:f??void 0}),t&&!u&&l.jsx(Te.div,{layout:"position",layoutId:"tab-indicator",className:p,transition:{duration:.1,ease:"easeOut"}})]})});wue.displayName="TabButton";const zgt=T.memo(({actionList:e,size:t=Gt.regular,variant:n="primary",fillSpace:r=!1,vertical:s=!1,layout:o="left",indicatorPos:a,iconOnly:i,allowScroll:c,tabClass:u,testId:f,layoutGroupId:m,styleProps:p,isNewRedesign:h=!1,activeTabRef:g})=>{const y=z({"w-full":r&&!c,"flex w-auto":c,"justify-center":o==="center","justify-end":o==="right"},p?.wrapperClass),x=z("items-center relative",{"justify-center":o==="center","flex-1":r,"w-full":r&&!c,"w-auto overflow-hidden flex":c},p?.innerClass),v=z("flex",{"w-full":r&&!c,"w-auto overflow-x-auto overflow-y-hidden flex-1 scrollbar-none":c},p?.scrollClass),b=z("items-center relative scrollbar-none",{"flex-1":r,"space-y-xs":s&&!h,"gap-x-md flex h-14":!s&&t!=="tiny","gap-x-sm flex h-10":!s&&t==="tiny","w-full":!s&&!c,"flex px-md w-auto overflow-x-auto":c},p?.scrollInnerClass),_=z("relative",{"h-full flex items-center":!s,"justify-center":r,"w-full":r&&!c,"flex-1 shrink-0":c},p?.itemClass);return l.jsx("div",{className:y,"data-test-id":f,children:l.jsx("div",{className:x,children:l.jsx("div",{className:v,children:l.jsx("div",{className:b,children:l.jsx(_g,{id:m,children:e.map(w=>w.show?l.jsxs(K,{className:_,children:[l.jsx(wue,{testId:w.testId,ariaLabel:w.ariaLabel,vertical:s,text:i?void 0:w.text,size:t,variant:n,onClick:w.onClick,fullWidth:r,active:w.active,icon:w.icon,href:w.href,target:w.target,layout:o,tooltipLayout:a==="right"?"right":"top",toolTip:w.tooltip,indicatorPos:a,trailingComponent:w.trailingComponent,extraCSS:u,showNewIndicator:w.showNewIndicator,styleProps:p?.tabButton,isNewRedesign:h,disabled:w.disabled,innerRef:w.active?g:void 0}),!i&&w.badge&&l.jsx(V,{className:"bg-super pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded-md px-1 py-0.5 text-white",variant:"tiny",children:w.badge}),w.children&&l.jsx(l.Fragment,{children:w.children})]},w.key??w.text):null)})})})})})});zgt.displayName="TabBar";const Cue=({isRed:e,className:t})=>l.jsx("svg",{width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:z("shrink-0",t),children:l.jsx("rect",{x:"4.29248",y:"0.726685",width:"12",height:"15",rx:"2",transform:"rotate(14.6454 4.29248 0.726685)",fill:e?"#EB4E45":"#f6c825"})}),Wgt=d.memo(({plays:e,onViewAll:t,playsToRender:n=1/0,reverse:r=!0,brands:s,inModal:o=!1,league:a})=>{const{$t:i}=J(),c=r?[...Object.keys(e)].reverse():Object.keys(e),u=d.useMemo(()=>{let f=n;return l.jsxs(K,{children:[c.map(m=>{let p=0;const h=e[m]?.length??0;return f<=0?null:(fr?[...e].reverse():e,[e,r]),i=mi();return l.jsxs(K,{children:[t>0&&l.jsx(K,{variant:"subtle",className:"-mx-md px-md py-sm sticky top-0 z-10 flex items-center justify-between",children:l.jsx(V,{variant:"smallCaps",color:"light",children:n})}),l.jsx(_g,{children:l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:a.slice(0,t).map(c=>l.jsx(Sue,{play:c,brands:s,parentHasMounted:i,league:o},c.id))})})]})}const Sue=d.memo(({play:e,brands:t,parentHasMounted:n,league:r})=>{const{$t:s}=J(),o=d.useRef(!n),a=Tht(e.contestantId,t,r),{colorScheme:i}=Ss(),c=Hgt(a.color,i)?.toString()??a.color;return l.jsxs(Te.div,{className:"-mx-md border-subtlest p-md relative border-b",initial:o.current?void 0:{opacity:0},animate:o.current?void 0:{opacity:1},transition:{layout:{duration:.2,ease:Yr},opacity:{duration:.2,ease:Yd}},layout:"position",children:[l.jsx("div",{className:"left-xs inset-y-xs absolute w-1 rounded-full opacity-50",style:{backgroundColor:c}}),!o.current&&l.jsx(Te.div,{className:"bg-super/15 absolute inset-0",initial:{opacity:1},animate:{opacity:0},transition:{duration:1,ease:Yd,delay:.2}}),l.jsxs("div",{className:"gap-md relative flex items-center",children:[l.jsx(y0,{logo:a.logo,color:a.color,size:"small",includeStripe:!1}),l.jsxs("div",{className:"gap-sm flex flex-1 flex-row items-center",children:[l.jsxs("div",{className:"gap-md flex items-baseline",children:[l.jsx(V,{variant:"tiny",color:"light",className:"whitespace-nowrap",children:e.periodId[1]==="PENALTIES"?`${s({defaultMessage:"PK",id:"mG6A02k2Ar"})} ${e.timeMin}`:`${e.timeMin}'`}),l.jsx(V,{variant:"small",children:e.commentary_text})]}),$gt(e)&&l.jsx(Cue,{isRed:qgt(e)==="red"})]})]})]})});Sue.displayName="Play";const $gt=e=>e.typeId[0]===17,qgt=e=>{const t=e.commentary_text.toLowerCase();return t.includes("second yellow card")||t.includes("red card")?"red":t.includes("yellow card")?"yellow":null},Kgt=({event:e})=>{const n=[...e.matchStats?.contestantStats.map(r=>{const s=r.goal_events.map(a=>({type:"goal",event:a})),o=r.red_card_events.map(a=>({type:"red_card",event:a}));return[...s,...o]})??[]].map(r=>r.sort((s,o)=>s.event[0]-o.event[0]));return!n||n.length===0?null:l.jsx("div",{className:"gap-md p-md grid grid-cols-2",children:n.map((r,s)=>l.jsx(Ygt,{events:r,position:s===0?"left":"right"},s))})},Ygt=({events:e,position:t})=>l.jsx("div",{className:z("gap-xs flex flex-col",{"items-start":t==="left","items-end":t==="right"}),children:e.map((n,r)=>l.jsx(Qgt,{event:n,position:t},r))}),Qgt=({event:e,position:t})=>l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsxs(V,{variant:"tiny",className:z("flex items-center gap-1",{"flex-row-reverse":t==="right"}),children:[l.jsx(Xgt,{event:e})," ",e.event[1]]}),l.jsxs(V,{variant:"tiny",color:"light",children:[e.event[0],"'"]})]}),Xgt=({event:e})=>e.type!=="goal"?l.jsx(Cue,{isRed:!0,className:"size-md inline-block"}):l.jsx("div",{className:"size-md inline-block",children:"⚽️"}),Eue=T.memo(()=>l.jsx("div",{}));Eue.displayName="SportsWidgetErrorFallback";const WB=new Set,Zgt=e=>e.status==="live"||e.status==="upcoming";function Jgt({widget:e}){const{isMobileStyle:t}=Re(),{result:{backend_uuid:n,mode:r}}=Ot(),s=Mg();if(d.useEffect(()=>{!n||!e||!e?.events?.length||WB.has(n)||(s("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:r}),WB.add(n))},[n,e?.events?.length,r,e,s]),!e?.events?.length)return null;const o=e.canonical_pages?.[0]?.url_web,a=e.events.at(0),i=!t&&(a&&Zgt(a)||e.events.length<5),c=e.league??"nba";return l.jsx(Ar,{fallback:Eue,children:l.jsx(Es,{widgetType:"sports",widgetName:e.object,children:({widgetSelected:u})=>l.jsx(kue,{canonicalPageLink:o,children:l.jsx(o0t,{events:e.events,showHero:i,widgetSelected:u,league:c})})})})}const kue=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(xt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ft,{name:B("chevron-right"),size:18})]})}):null]})},Mue=({initialData:e,refetch:t=!1,reason:n})=>gt({initialData:e,queryKey:be.makeEphemeralQueryKey("sports/events/widget",e.id),queryFn:async()=>{if(!e.refetch_url)return e;const r=await pme({urlPath:e.refetch_url,timeoutMs:0,reason:n});if(!r.ok)throw Z.error("Failed to fetch sport event",{url:e.refetch_url,status:r.status,statusText:r.statusText}),new Error(`Failed to fetch sport event ${r.status} ${r.statusText}`);return await r.json()},refetchInterval:r=>r.state.data?.refetch_url?r.state.data?.refetch_interval_secs*1e3:!1,enabled:!!e.refetch_url&&t}),e0t=({event:e,onClick:t,eventCount:n,league:r})=>{const{$t:s}=J(),{data:o}=Mue({initialData:e,refetch:!0,reason:"sports-event-row"}),a=Tue(),i=r==="nba"&&Jce(o.title[0]??""),c=Due(o.team_1,o.team_2),u=i?c:null,f=d.useMemo(()=>[{title:o.team_1.title,score:o.team_1.text,subscore:o.team_1.sub_text,image:o.team_1.img,emphasized:o.team_1.won,period:o.period_text},{title:o.team_2.title,score:o.team_2.text,subscore:o.team_2.sub_text,image:o.team_2.img,emphasized:o.team_2.won,period:o.period_text}],[o]);return l.jsx(Rue,{href:o.url?.url_web,onClick:()=>t(o.url?.url_web),children:l.jsx(l0t,{title:o.status==="live"?"LIVE":a(o.datetime,o.datetime_tba,o.datetime_end),isLive:o.status==="live",items:f,period:Aue(o.period_text,o.period_time,r,{halftime:s({defaultMessage:"Halftime",id:"iC0AL294Dr"})})??null,eventCount:n,subtitle:u??void 0},o.id)})},t0t=({events:e,onClick:t,league:n})=>l.jsx("div",{className:z("bg-subtlest grid grid-cols-1 rounded-b-lg md:grid-cols-2",{"lg:grid-cols-3":e.length>2}),children:e.map(r=>l.jsx(e0t,{event:r,onClick:t,eventCount:e.length,league:n},r.id))}),n0t=e=>{const{locale:t}=J();return e?new Date(e).toLocaleTimeString(t,{hour:"numeric",minute:"numeric",timeZoneName:"short"}):""},r0t=e=>e.join(" · "),Tue=({includeTime:e=!0}={})=>{const{$t:t}=J(),{locale:n}=J();return d.useCallback((r,s,o)=>{if(o){if(!r&&s)return t({defaultMessage:"TBA",id:"ZfAWFLTzx/"});if(!r)return"";const m=new Date(r),p=new Date(o),h=m.getFullYear();if(!(h===new Date().getFullYear())){const w=m.toLocaleDateString(n,{month:"short"}),S=p.toLocaleDateString(n,{month:"short"}),C=m.getDate(),E=p.getDate();return w===S?`${w} ${C}-${E}, ${h}`:`${w} ${C}-${S} ${E}, ${h}`}const y=m.toLocaleDateString(n,{month:"short"}),x=p.toLocaleDateString(n,{month:"short"}),v=m.getDate(),b=p.getDate();let _;if(y===x?_=`${y} ${v}-${b}`:_=`${y} ${v}-${x} ${b}`,e){const w=s?"TBA":m.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});return`${_}, ${w}`}return _}if(!r&&s)return t({defaultMessage:"TBA",id:"ZfAWFLTzx/"});if(!r)return"";const a=new Date(r),i=r&&s,c=a.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});if(GFe(a))return e?`${t({defaultMessage:"Today",id:"zWgbGgjUUg"})}, ${c}`:t({defaultMessage:"Today",id:"zWgbGgjUUg"});if(qFe(a))return e?`${t({defaultMessage:"Yesterday",id:"6dIxDP1C8c"})}, ${c}`:t({defaultMessage:"Yesterday",id:"6dIxDP1C8c"});if(xee(a))return e?`${t({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"})}, ${c}`:t({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"});if(a.getFullYear()!==new Date().getFullYear())return new Date(a).toLocaleDateString(n,{month:"short",day:"numeric",year:"numeric"});const u=a.toLocaleDateString(n,{month:"short",day:"numeric"});if(!e)return u;const f=i?"TBA":a.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});return`${u}, ${f}`},[n,t,e])},Aue=(e,t,n,r)=>{if(n==="mlb")return s0t(e);if(!e||typeof t?.seconds!="number"&&typeof t?.minutes!="number")return e;if(e==="Halftime")return r.halftime;const s=t?.seconds?.toString().padStart(2,"0")??"00",o=t?.minutes??0;return`${e} ${o}:${s}`},s0t=e=>e?.replace("Top","▲").replace("Bot","▼"),o0t=({events:e,showHero:t,widgetSelected:n,league:r})=>{const s=d.useMemo(()=>t?e.slice(1):e,[e,t]),{data:o}=Mue({initialData:e[0],refetch:t,reason:"sports-widget-dense"});return l.jsxs(K,{children:[t&&l.jsxs(Rue,{href:o?.url?.url_web,onClick:()=>{n(o?.url?.url_web)},children:[l.jsx(a0t,{event:o,includeBorder:s.length>0,league:r,statusExtra:o&&r==="mlb"&&o.status==="live"?l.jsx(Rgt,{event:{event:o}}):null}),r==="championsleague"&&o&&l.jsx(Kgt,{event:{event:o,brands:[],candlestickData:null,matchEvents:null,matchStats:o.extra?.match_stats??null,eventExtra:null}})]}),l.jsx(t0t,{events:s,onClick:n,league:r})]})},Nue=()=>l.jsx("span",{className:"text-quietest",children:"—"}),Rue=({children:e,href:t,onClick:n})=>t?l.jsx(xt,{href:t,className:"group/link group",onClick:n,children:e}):l.jsx("div",{className:"group",onClick:n,children:e}),Due=(e,t)=>{const{$t:n}=J(),r=e.subtitle?.split("-"),s=t.subtitle?.split("-"),o=Hi(r)?+r[0]:null,a=Hi(s)?+s[0]:null,i=4;if(o===null||a===null)return null;const c=o>a?e.abbreviation:t.abbreviation,u=o>a?o:a,f=o>a?a:o;return o>=i||a>=i?n({defaultMessage:"{leadingTeam} Wins {leadingScore}-{trailingScore}",id:"T1UC+k87MZ"},{leadingTeam:c,leadingScore:u,trailingScore:f}):o===a?n({defaultMessage:"Series Tied {team1Record}-{team2Record}",id:"Liahhq+hIg"},{team1Record:o,team2Record:a}):n({defaultMessage:"{leadingTeam} Leads {leadingScore}-{trailingScore}",id:"oO28OWtTlZ"},{leadingTeam:c,leadingScore:u,trailingScore:f})},a0t=({event:e,includeBorder:t=!1,className:n,league:r,scoreExtra:s,statusExtra:o,displayBranding:a=!0})=>{const{$t:i}=J(),c=e.team_1.title,u=e.team_2.title,f=e.team_1.text,m=e.team_1.sub_text,p=e.team_2.text,h=e.team_2.sub_text,g=r==="nba"&&Jce(e.title[0]??""),y=Due(e.team_1,e.team_2),x=g?y:null,v=Tue({includeTime:!1}),b=n0t(e.datetime),_=e.datetime_tba?i({defaultMessage:"TBA",id:"ZfAWFLTzx/"}):b,w=r0t(e.title),{colorScheme:S}=Ss(),C=Aue(e.period_text,e.period_time,r,{halftime:i({defaultMessage:"Halftime",id:"iC0AL294Dr"})}),E=e.team_1.won||e.team_2.won,N=d.useMemo(()=>{let k;return E?a?(e.team_1.won?k=e.team_1.color:k=e.team_2.color,xue(k?Yn(k):null,S==="dark")):"#1FB8CD":null},[e.team_1.won,e.team_1.color,e.team_2.color,S,E,a]);return l.jsxs(K,{className:z(n,"rounded-inherit relative",{"border-b":t}),children:[E&&l.jsx("div",{className:"rounded-inherit pointer-events-none absolute inset-0 overflow-hidden",style:{color:N?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"},children:l.jsx(Xce,{className:"-inset-xl rounded-inherit !absolute ![--dog-bg-highlight:currentColor]",dotClassName:"!text-[currentColor]",highlightClassName:"!bg-black/5 dark:!bg-white/5"})}),l.jsx("div",{className:"px-md gap-sm relative flex items-start justify-between pt-[12px]",children:l.jsxs(V,{variant:"tiny",color:"light",children:[w,x&&" · "+x]})}),l.jsxs("div",{className:"p-md md:px-lg md:py-md gap-sm relative grid grid-cols-[1fr_auto_1fr] items-center justify-start md:justify-between md:gap-[12px]",children:[l.jsxs("div",{className:"gap-md flex flex-col-reverse items-center justify-start md:flex-row md:justify-start md:gap-[12px]",children:[l.jsx(qB,{record:e.team_1.subtitle,name:c,logo:a?e.team_1.img:null}),l.jsx("div",{className:"md:mx-auto",children:l.jsx(GB,{position:"leading",score:f,subscore:m,isWinner:e.team_1.won,hasWinner:E,scoreExtra:s,team:e.team_1,teamIdx:0,league:r})})]}),l.jsxs("div",{className:"gap-sm flex flex-col items-center",children:[l.jsx(i0t,{status:e.status,date:v(e.datetime,e.datetime_tba,e.datetime_end),time:_,isUpcoming:e.datetime?Vgt(new Date(e.datetime),e.status):void 0,period:C??null}),o]}),l.jsxs("div",{className:"gap-md flex flex-col-reverse items-center justify-start md:flex-row-reverse md:gap-[12px]",children:[l.jsx(qB,{record:e.team_2.subtitle,name:u,logo:a?e.team_2.img:null}),l.jsx("div",{className:"md:mx-auto",children:l.jsx(GB,{score:p,subscore:h,position:"trailing",isWinner:e.team_2.won,hasWinner:E,scoreExtra:s,team:e.team_2,teamIdx:1,league:r})})]})]}),e.live_text&&l.jsx("div",{className:"bg-subtlest px-md relative py-[12px]",children:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-sm line-clamp-1 flex items-start md:items-center",children:[l.jsx(ft,{name:B("broadcast"),size:16,className:"opacity-80 md:-translate-y-px"}),e.live_text]})}),E&&l.jsx("div",{className:"rounded-inherit pointer-events-none absolute inset-0 opacity-20 mix-blend-multiply dark:opacity-60 dark:mix-blend-soft-light",style:{backgroundColor:N?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}}),!t&&E&&l.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-[12px] border opacity-40",style:{borderColor:N?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}}),!t&&E&&l.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-[13px] border opacity-20 dark:opacity-40",style:{borderColor:N?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}})]})},GB=({score:e,subscore:t,position:n,emptyPlaceholder:r=l.jsx(Nue,{}),isWinner:s,hasWinner:o,scoreExtra:a,team:i,teamIdx:c,league:u})=>{const{isMobileStyle:f}=Re(),m=u==="ipl"||u==="cricket"||u==="icc"||u==="atp"||u==="wta";return l.jsxs("div",{className:z("md:gap-xs flex flex-col items-center justify-center",{"items-start":n==="leading","items-end":n==="trailing","opacity-50":o&&!s}),children:[l.jsxs(V,{variant:f?m?"section-title":"display":"section-title",className:"gap-xs md:gap-sm flex items-center sm:!text-2xl lg:!text-3xl",children:[s&&n==="trailing"&&l.jsx($B,{className:"size-3 rotate-180 md:size-4"}),l.jsxs("span",{className:"font-mono",children:[a&&l.jsx("span",{className:"mr-xs",children:a(i,c)}),e??r]}),s&&n==="leading"&&l.jsx($B,{className:"size-2.5 md:size-4"})]}),t&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:"font-mono",children:t})})]})},$B=({className:e})=>l.jsx("svg",{width:"6",viewBox:"0 0 18 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 0.322327L0.822266 17.5L18 34.6777V0.322327Z",className:"fill-foreground"})}),qB=({name:e,logo:t,record:n})=>e?l.jsxs("div",{className:"gap-sm flex flex-col items-center justify-between md:gap-0",children:[t&&l.jsx(y0,{logo:t,color:"#000000"}),l.jsx(V,{variant:"baseSemi",children:e}),n&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:"font-mono",children:n})})]}):null,i0t=({status:e,date:t,time:n,isUpcoming:r,variant:s="stacked",period:o})=>{const a=e==="live",i=e==="final",{isMobileStyle:c}=Re();return l.jsx("div",{className:z("gap-sm flex",{"flex-row items-center":s==="row","flex-col items-center justify-center":s==="stacked"}),children:a?l.jsxs("div",{className:"gap-sm flex flex-col items-center",children:[l.jsx(pm,{size:c?"small":"default",includeDot:!0}),o&&l.jsx(V,{variant:"tiny",color:"light",children:o})]}):l.jsxs("div",{className:z("gap-xs flex",{"flex-col":s==="stacked","flex-row items-center":s==="row"}),children:[r&&l.jsx(vue,{textCenter:!0,className:"mb-1 hidden md:block"}),i&&l.jsx(f_,{textCenter:!0,className:"-mt-0.5 md:mb-1 md:mt-0 md:block"}),l.jsx(V,{variant:"tiny",color:"light",className:"w-full whitespace-nowrap text-center",children:t}),n&&!i&&l.jsx(V,{variant:"tiny",color:"light",className:"w-full whitespace-nowrap text-center",children:n})]})})},l0t=({items:e,title:t,subtitle:n,isLive:r,period:s,eventCount:o})=>{const a=e.some(f=>f.emphasized),{isMobileStyle:i}=Re(),{isLargeScreen:c,isMediumScreen:u}=FN();return l.jsx(K,{variant:"raised",className:z("px-md h-full py-[12px]",{"border-b border-r-0 group-last:border-b-0 group-even:border-r-0":i,"border-b group-odd:border-r":u&&!c,"group-[&:nth-child(2n):nth-last-child(-n+3)~a]:border-b-0":u&&!c&&o>2,"border-b border-r group-[&:nth-child(3n)]:border-r-0":c,"group-[&:nth-child(3n):nth-last-child(-n+4)~a]:border-b-0":c&&o>3,"!border-b-0":c&&o<=3||u&&!c&&o<=2}),children:l.jsxs("div",{className:"gap-sm flex size-full flex-col items-start justify-between duration-150 group-hover/link:opacity-75",children:[r?l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(pm,{size:"small",className:"-ml-1"}),s&&l.jsx(V,{variant:"tiny",color:"super",children:s})]}):t?l.jsx(V,{variant:"tinyRegular",color:"light",children:t}):null,l.jsx("div",{className:"w-full",children:e.map((f,m)=>l.jsx(c0t,{item:f,anyEmphasized:a},f.title+m))}),n&&l.jsx(V,{variant:"tinyRegular",color:"light",children:n})]})})},c0t=({item:e,anyEmphasized:t})=>{const n=d.useMemo(()=>e.score?e.subscore?`${e.score} ${e.subscore}`:e.score:l.jsx(Nue,{}),[e.score,e.subscore]);return l.jsxs(K,{className:"flex w-full items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[e.image&&l.jsx("img",{src:e.image,alt:e.title,className:"size-[24px]"}),l.jsx(V,{variant:e.emphasized?"smallBold":"small",color:t&&!e.emphasized?"light":"default",children:e.title})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[e.emphasized&&l.jsx(ft,{name:B("trophy"),size:14,className:"text-super -translate-y-half"}),l.jsx(V,{variant:e.emphasized?"smallBold":"small",color:t&&!e.emphasized?"light":"default",children:n})]})]})},jue=T.memo(()=>l.jsx("div",{children:"Error loading individual event widget."}));jue.displayName="IndvEventsWidgetErrorFallback";const KB=new Set,u0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(xt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ft,{name:B("chevron-right"),size:18})]})}):null]})},d0t=(e,t)=>{if(!e)return"";try{return new Date(e).toLocaleDateString(t,{month:"short",day:"numeric"})}catch{return""}},f0t=(e,t)=>{if(!e)return"";try{return new Date(e).toLocaleTimeString(t,{hour:"numeric",minute:"2-digit",hour12:!0}).replace(/^0+/,"")}catch{return""}},Iue=({competitor:e})=>l.jsxs(K,{className:"gap-sm border-subtlest px-md py-sm flex items-center border-b last:border-b-0",children:[l.jsx(V,{className:"w-4 text-center",children:e.rank}),l.jsxs("div",{className:"gap-sm flex grow items-center",children:[e.primary_img_url?l.jsx(y0,{logo:e.primary_img_url,color:"transparent",size:"small",className:"shrink-0"}):l.jsx(K,{className:"flex h-5 w-8 shrink-0 items-center justify-center rounded-sm bg-[#44403c] text-xs",children:e.abbreviation}),l.jsxs("div",{className:"flex grow flex-col",children:[l.jsx(V,{variant:"smallBold",children:e.title}),l.jsxs(V,{variant:"tiny",color:"light",children:[e.metadata[0]," "]})]})]}),l.jsxs(K,{className:"flex flex-col items-end text-right",children:[l.jsx(V,{variant:"smallBold",children:e.metadata[1]}),l.jsx(V,{variant:"tiny",color:"light",children:e.metadata[2]})]})]},e.id),m0t=({event:e,league:t})=>{const{locale:n}=J(),r=e.subtitle,{$t:s}=J(),o=f0t(e.datetime,n),a=e.datetime?hpe(new Date(e.datetime))?s({defaultMessage:"Today",id:"zWgbGgjUUg"}):xee(new Date(e.datetime))?s({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"}):new Date(e.datetime).toLocaleDateString(n,{weekday:"short",month:"short",day:"numeric"}):"";return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"p-md border-subtler flex items-end justify-between border-b",children:[l.jsxs(K,{className:"flex flex-col",children:[l.jsx(V,{variant:"baseSemi",children:e.title.join(" ")}),l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),r&&`・${r}`]})]}),l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx(V,{variant:"small",children:a}),l.jsx(V,{variant:"small",color:"light",children:o})]})]}),e.image_url&&l.jsx(K,{className:"aspect-video w-full overflow-hidden rounded-lg bg-[#292524]",children:l.jsx($o,{src:e.image_url,alt:`${e.title.join(" ")} circuit map`,className:"size-full object-contain"})}),l.jsx(K,{className:"gap-xs p-md flex flex-col",children:e.metadata?.map((i,c)=>l.jsxs(K,{className:"flex justify-between",children:[l.jsx(V,{className:"text-sm",color:"light",children:i[0]}),l.jsx(V,{className:"text-sm",children:i[1]})]},c))})]})},p0t=({event:e,league:t})=>{const{locale:n}=J(),r=d0t(e.datetime,n),s=e.competitors.slice(0,3),o=e.subtitle;return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"border-subtler px-md py-sm gap-md flex items-center justify-between border-b",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",className:"flex justify-between",children:l.jsx("span",{children:e.title.join(" ")})}),l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),o&&`・${o}`]})]}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:"small",color:"light",children:r}),l.jsx(f_,{})]})]}),l.jsx(K,{className:"flex flex-col",children:s.map(a=>l.jsx(Iue,{competitor:a},a.id))})]})},h0t=({event:e,league:t})=>{const n=e.competitors.slice(0,3),r=e.subtitle;return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"border-subtler px-md py-sm gap-md flex items-center justify-between border-b",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",className:"flex justify-between",children:l.jsx("span",{children:e.title.join(" ")})}),l.jsx("div",{children:l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),r&&`・${r}`]})})]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(pm,{includeDot:!0}),e.period_text&&l.jsx(V,{color:"light",variant:"small",children:e.period_text})]})]}),l.jsx(K,{className:"flex flex-col",children:n.map(s=>l.jsx(Iue,{competitor:s},s.id))})]})},g0t=({event:e,league:t})=>{switch(e.status){case"upcoming":return l.jsx(m0t,{event:e,league:t});case"live":return l.jsx(h0t,{event:e,league:t});case"final":return l.jsx(p0t,{event:e,league:t});default:return null}};function y0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=Ot(),r=Mg(),s=d.useMemo(()=>e?.event,[e]),o=d.useMemo(()=>e?.league,[e]);if(d.useEffect(()=>{!t||!e||!s||KB.has(t)||(r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n}),KB.add(t))},[t,s,n,e,r]),!e||!s)return null;const a=e.canonical_page?.url_web,i=`indv-event-${s.id??"unknown"}`;return l.jsx(Ar,{fallback:jue,children:l.jsx(Es,{widgetType:"sports",widgetName:i,children:({})=>l.jsx(u0t,{canonicalPageLink:a,children:l.jsx(g0t,{event:s,league:o})})})})}const Pue=T.memo(()=>l.jsx("div",{children:"Error loading individual schedule widget."}));Pue.displayName="IndvScheduleWidgetErrorFallback";const YB=new Set,x0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(xt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ft,{name:B("chevron-right"),size:18})]})}):null]})},v0t=(e,t,n)=>{if(!e)return t.replace(/^(0)(\d:[0-5]\d\s+[AP]M)$/,"$2");try{return new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).replace(/^0+/,"")}catch{return t.replace(/^(0)(\d:[0-5]\d\s+[AP]M)$/,"$2")}},BS=({event:e,isFinal:t,isLive:n})=>{const{locale:r}=J(),s=e.metadata?.[0],o=e.metadata?.[1]??"",a=v0t(e.datetime,o,r),{isMobileStyle:i}=Re(),c=!!e.url?.url_web,u=l.jsxs(l.Fragment,{children:[l.jsxs(K,{className:"p-md col-span-3 grid grid-cols-subgrid items-center md:col-span-4",children:[l.jsx(K,{className:"flex flex-col items-start",children:l.jsx(_0t,{date:e.datetime??""})}),l.jsxs(K,{className:"gap-xs flex flex-col md:gap-0",children:[l.jsx(V,{variant:"baseSemi",className:"text-base leading-snug",children:e.title.join(" ")}),s&&l.jsxs(V,{variant:i?"tiny":"small",className:"mt-0 pt-0",color:"light",children:[!t&&!n&&l.jsxs(l.Fragment,{children:[a," · "]}),s]})]}),l.jsx("div",{className:"hidden md:block",children:e.live_text&&l.jsx(V,{variant:"small",className:"text-right",children:e.live_text})}),l.jsx("div",{children:t?l.jsx(f_,{}):n?l.jsx(pm,{includeDot:!0}):null})]}),l.jsx("div",{className:"p-md -mt-sm col-span-2 col-start-2 pl-0 pt-0 md:hidden",children:e.live_text&&l.jsx(V,{variant:"tiny",className:"border-subtlest p-xs px-sm rounded border",color:"light",children:e.live_text})})]}),f="col-span-3 grid grid-cols-subgrid border-b border-subtlest last:border-b-0 md:col-span-4";return c?l.jsx(xt,{href:e.url?.url_web??"",className:z(f,"hover:bg-subtler duration-150"),children:u}):l.jsx(K,{className:f,children:u})};function b0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=Ot(),r=Mg(),s=d.useMemo(()=>e?.events??[],[e]);if(d.useEffect(()=>{!t||!e||!s?.length||YB.has(t)||(r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n}),YB.add(t))},[t,e,s,n,r]),!e||!s||s.length===0)return null;const o=e.canonical_page?.url_web,a=`indv-schedule-${e.league??"unknown"}`;return l.jsx(Ar,{fallback:Pue,children:l.jsx(Es,{widgetType:"sports",widgetName:a,children:({})=>l.jsx(x0t,{canonicalPageLink:o,children:l.jsx(K,{className:"gap-x-md grid grid-cols-[min-content,1fr,min-content] md:grid-cols-[min-content,1fr,1fr,min-content]",children:s.map(i=>{switch(i.status){case"upcoming":return l.jsx(BS,{event:i},i.id);case"live":return l.jsx(BS,{event:i,isLive:!0},i.id);case"final":return l.jsx(BS,{event:i,isFinal:!0},i.id);default:return null}})})})})})}const _0t=({date:e})=>{const{locale:t}=J(),n=new Date(e).toLocaleDateString(t,{day:"numeric"}),r=new Date(e).toLocaleDateString(t,{month:"short"}),{isMobileStyle:s}=Re();return l.jsxs("div",{className:"dark:bg-subtle bg-subtler py-xs flex w-full flex-col items-center justify-center rounded-lg px-0.5 md:p-[6px]",children:[l.jsx(V,{className:"px-sm -mb-0.5 rounded-full text-center",variant:"tinyRegular",color:"light",children:r}),l.jsx(V,{className:"px-sm -mb-1 text-center",variant:s?"baseSemi":"section-title",children:n})]})},Oue=({headshotImageUrl:e,flagUrl:t,name:n,isCompositeFlag:r})=>!e&&!t?null:l.jsxs("div",{className:"relative size-6 shrink-0 rounded md:size-8",children:[l.jsx("img",{src:e??t,alt:n,className:z("rounded-inherit relative size-full shrink-0",{"object-contain":r,"object-cover":!r})}),!r&&l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-black/10 dark:border-white/10"}),e&&l.jsxs("div",{className:"ml-xs ring-raised absolute right-[90%] top-[90%] size-3 shrink-0 -translate-y-1/2 translate-x-1/2 rounded-full ring-2 md:size-4",children:[l.jsx("img",{src:t,alt:n,className:"rounded-inherit relative size-full shrink-0 object-cover"}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-black/10 dark:border-white/10"})]})]}),w0t=e=>{for(const t of e)for(const n of t.cells)if(n.extra?.is_current_round)return n.column_id;return null},Lue=({value:e,variant:t="red"})=>{if(!e)return null;const n=t==="subtle";return l.jsx(K,{variant:t,className:"inline-flex h-5 items-center whitespace-nowrap rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:z("translate-y-half tracking-wider",{uppercase:!n}),children:e})})};Lue.displayName="StatusDisplay";const q1=(e,t)=>{const n=e.display_value??e.value??"",r=t.font_weight==="bold"?"smallBold":"small",s=e.extra;return l.jsx(V,{variant:r,className:s?.is_current_round?"font-bold":"",children:n})},C0t={pos_golf:(e,t)=>{const n=e.display_value??e.value??"",r=t.font_weight==="bold"?"smallBold":"small";return e.extra?.show_trophy?l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(ge,{icon:B("trophy"),size:"md",className:"text-super"})}):l.jsx(V,{variant:r,color:"light",children:n})},golfer_golf:(e,t)=>{const n=String(e.display_value??""),r=e.image_url??void 0,s=e.value,o=e.sub_text,a=t.font_weight==="bold"?"smallBold":"small";return l.jsxs("div",{className:"md:gap-md gap-sm flex items-center",children:[l.jsx(Oue,{headshotImageUrl:r,flagUrl:s,name:n}),l.jsxs("div",{children:[l.jsx(V,{variant:a,children:n}),o&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]})]})},status_golf:e=>{const t=e.display_value??e.value??"",r=/am|pm/i.test(String(t))?"subtle":"red";return l.jsx(Lue,{value:t,variant:r})},total_golf:(e,t)=>{const n=e.display_value??e.value??"E",r=typeof e.value=="number"?e.value:0,s=t.font_weight==="bold"?"smallBold":"small";let o="default";return r<0?o="positive":r>0&&(o="negative"),l.jsx(V,{variant:s,color:o,children:n})},r1:q1,r2:q1,r3:q1,r4:q1},S0t={status_golf:()=>null},E0t=({result:e})=>{let t="",n=null;return e==="W"?(t="bg-[#059669] text-white",n=B("check")):e==="D"?(t="bg-[#64748b] text-white",n=B("minus")):e==="L"&&(t="bg-[#e11d48] text-white",n=B("x")),l.jsx("div",{className:z("flex size-4 items-center justify-center rounded-full",t),children:n&&l.jsx(ft,{name:n,size:12})})},Fue=({form:e})=>{const t=String(e).replace(/\s/g,"");return l.jsx("div",{className:"flex gap-0.5",children:t.split("").map((n,r)=>l.jsx(E0t,{result:n},r))})};Fue.displayName="FormDisplay";const k0t=({value:e})=>{const t=e.includes("↑"),n=e.includes("↓"),r=e==="-",s=e.replace(/[^0-9]/g,"");return l.jsxs("div",{className:"flex items-center justify-center gap-0.5",children:[l.jsx(ge,{icon:t?B("caret-up-filled"):n?B("caret-down-filled"):B("minus"),size:"sm",className:z("scale-90",{"text-quietest":r,"text-positive":t,"text-negative":n})}),!r&&l.jsx(V,{variant:"tinyMono",color:t?"positive":"negative",className:"w-[2ch] shrink-0 text-left",children:s})]})},M0t={form:e=>{const t=e.display_value??e.value??"";return l.jsx(Fue,{form:String(t)})},movement:e=>{const t=e.display_value??e.value??"";return l.jsx(k0t,{value:String(t)})}},Bue={...M0t,...C0t},T0t={...S0t},Uue=(e="left")=>{switch(e){case"center":return"text-center";case"right":return"text-right";case"left":default:return"text-left"}},A0t=(e=!1)=>e?"w-full":"w-0",US=(e="normal",t)=>{if(t==="pos")return"smallCaps";switch(e){case"bold":return"smallBold";case"normal":default:return"small"}},N0t=(e="")=>e==="pos"?"light":"default",R0t=({cell:e,column:t,columns:n,rows:r,columnRenderers:s=Bue})=>{const{inApp:o}=Ea();if(!e)return l.jsx("td",{className:"md:px-md p-sm"});let a;const i=t.column_type??"text",c=e.display_value??e.value??"-";t.column_id&&s[t.column_id]?a=s[t.column_id]?.(e,t,{columns:n,rows:r}):(i==="entity"||i==="image")&&e.image_url?a=l.jsxs("div",{className:"md:gap-md gap-sm flex items-center",children:[l.jsx(y0,{logo:e.image_url,color:"transparent",size:"small",className:"shrink-0"}),l.jsxs("div",{children:[l.jsx(V,{variant:US(t.font_weight??"normal",t.column_id),children:c}),i==="entity"&&e.sub_text&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]})]}):i==="entity"&&!e.image_url?a=l.jsxs("div",{children:[l.jsx(V,{variant:US(t.font_weight??"normal",t.column_id),children:c}),e.sub_text&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]}):a=l.jsx(V,{variant:US(t.font_weight??"normal",t.column_id),color:N0t(t.column_id),children:c});const u=z("md:pl-md pl-sm last:px-sm md:last:px-md py-sm align-middle",Uue(t.alignment),A0t(t.should_fill_width));return e.canonical_page?l.jsx("td",{className:u,children:l.jsx(Zg,{href:o?e.canonical_page.url_app:e.canonical_page.url_web,className:"block",children:a})}):l.jsx("td",{className:u,children:a})},D0t=({row:e,rows:t,columns:n,columnRenderers:r})=>{if(e.section_header)return l.jsx(K,{as:"tr",children:l.jsx(K,{as:"td",colSpan:n.length,className:"pl-sm md:pl-md py-sm",children:l.jsx(K,{variant:"superLight",className:"inline-flex h-5 items-center rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:"translate-y-half uppercase tracking-wider",children:e.section_header})})})});const s=new Map(e.cells.map(o=>[o.column_id,o]));return l.jsx("tr",{className:"border-subtlest border-b last:border-b-0",children:n.map(o=>l.jsx(R0t,{cell:s.get(o.column_id),column:o,columns:n,rows:t,columnRenderers:r},o.column_id))})},j0t=({table:e,variant:t="subtler",title:n,className:r,noWrapTitle:s=!1,onGroupClick:o,columnRenderers:a,headerRenderers:i})=>{const[c,u]=d.useState(e?.groups?.[0]?.group_id??""),[f,m]=d.useState(!1),{$t:p}=J();if(jf("standings"),!e||!e.groups?.length)return null;const h=n??e.title??"Standings",g=e.groups.find(S=>S.group_id===c),y=e.groups.length>1;if(!g)return null;const x=f?g.rows:g.rows.slice(0,10),v=w0t(g.rows),b={...Bue,...a},_={...T0t,...i};v&&!_[v]&&(_[v]=S=>l.jsx(K,{variant:"super",className:"inline-flex h-5 items-center rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:"translate-y-half uppercase tracking-wider",children:S.header_label})}));const w=e.groups.map(S=>({type:"default",text:S.title??S.group_id,onClick:()=>{u(S.group_id),o?.(S.group_id)},active:c===S.group_id,show:!0}));return l.jsx(mr,{className:r,header:l.jsxs("div",{className:"md:pl-md gap-sm sm:gap-md flex flex-col sm:flex-row sm:items-center sm:justify-between",children:[l.jsx(V,{variant:"baseSemi",className:z(s?"flex-shrink-0":void 0,"max-sm:pl-sm"),children:h}),y?l.jsx(Ws,{items:w,isMobileStyle:!1,wrapperClassName:"min-w-0",children:l.jsx(ze,{text:g.title??g.group_id,chevron:!0,size:"small",extraCSS:"w-full mb-sm"})}):l.jsx("div",{className:"invisible min-h-10"})]}),children:l.jsxs("div",{className:"rounded-inherit",children:[l.jsx("div",{className:"rounded-t-inherit overflow-hidden",children:l.jsx(nl,{orientation:"horizontal",children:l.jsxs("table",{className:"w-full table-auto border-collapse",children:[l.jsx(K,{as:"thead",variant:t==="raised"?"raisedOffset":"subtle",children:l.jsx("tr",{children:g.columns.map(S=>{const C=_[S.column_id],E=C?C(S):S.header_label;return l.jsx("th",{className:z("md:pl-md pl-sm last:px-sm md:last:px-md py-xs whitespace-nowrap align-middle",Uue(S.alignment)),children:E?l.jsx(Pgt,{className:z({"w-[200px] md:w-auto":S.should_fill_width}),children:E}):null},S.column_id)})})}),l.jsx("tbody",{children:x.map(S=>l.jsx(D0t,{row:S,rows:g.rows,columns:g.columns,columnRenderers:b},S.row_id))})]})})}),g.rows.length>10&&l.jsx(K,{className:"p-xs border-t",children:l.jsx(rt,{text:p(f?{id:"UOYN/MXiOT",defaultMessage:"View Less"}:{id:"wbcwKddwLa",defaultMessage:"View All"}),size:"small",fullWidth:!0,onClick:()=>m(S=>!S)})})]},g.group_id)})},Vue=T.memo(()=>l.jsx("div",{children:"Error loading standings widget."}));Vue.displayName="StandingsWidgetErrorFallback";const I0t=new Set,P0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(xt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ft,{name:B("chevron-right"),size:18})]})}):null]})};function O0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=Ot(),r=Mg(),s=d.useMemo(()=>e?.standings_table?e.standings_table:null,[e]);if(d.useEffect(()=>{!t||!e||!s||I0t.has(t)||r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n})},[t,s,n,e,r]),!e||!s)return null;const o=e.canonical_pages?.[0]?.url_web,a=`standings-${s.table_id??"unknown"}`;return l.jsx(Ar,{fallback:Vue,children:l.jsx(Es,{widgetType:"sports",widgetName:a,children:({})=>l.jsx(P0t,{canonicalPageLink:o,children:l.jsx(j0t,{table:s,variant:"raised",className:"!rounded-none border-0"})})})})}const L0t={staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0},F0t=({event:e,team1:t,team2:n,isLive:r})=>{const s=e.datetime&&new Date(e.datetime)>new Date,o=r?t.sub_text:null,a=r?n.sub_text:null,{isMobileStyle:i}=Re(),c=d.useMemo(()=>e?.stat_columns?.map(f=>({team1:{score:f.team_1_text,scoreSuper:f.team_1_super_text,emphasis:f.team_1_emphasis,super:!1},team2:{score:f.team_2_text,scoreSuper:f.team_2_super_text,emphasis:f.team_2_emphasis,super:!1}})),[e?.stat_columns]),u=d.useMemo(()=>r?[...c??[],{team1:{score:t.text,scoreSuper:null,emphasis:!1,super:!0},team2:{score:n.text,scoreSuper:null,emphasis:!1,super:!0}}]:c,[c,r,t.text,n.text]);return s?l.jsxs("div",{className:"gap-sm pr-sm flex h-full flex-col justify-around",children:[l.jsx(V,{variant:"base",color:"ultraLight",className:"opacity-50",children:"—"}),l.jsx(V,{variant:"base",color:"ultraLight",className:"opacity-50",children:"—"})]}):c?l.jsxs("div",{className:z("gap-x-md grid h-16 auto-cols-auto grid-flow-col",{"gap-x-sm":i}),children:[u?.map((f,m)=>l.jsxs("div",{className:"gap-sm grid h-full grid-cols-subgrid",children:[l.jsx("div",{className:"flex items-center",children:l.jsxs(V,{variant:i?"smallBold":"section-title",className:"min-w-[2ch] text-center !font-mono leading-none",color:f.team1.super&&f.team1.score?"super":f.team1.emphasis?"default":"ultraLight",children:[f.team1.score??"—",f.team1.scoreSuper&&l.jsx("sup",{className:"-translate-y-sm text-2xs !font-mono tracking-tight",children:f.team1.scoreSuper})]})}),l.jsx("div",{className:"flex items-center",children:l.jsxs(V,{variant:i?"smallBold":"section-title",className:"min-w-[2ch] text-center !font-mono leading-none",color:f.team2.super&&f.team2.score?"super":f.team2.emphasis?"default":"ultraLight",children:[f.team2.score??"—",f.team2.scoreSuper&&l.jsx("sup",{className:"-translate-y-sm text-2xs !font-mono tracking-tight",children:f.team2.scoreSuper})]})})]},m)),(o||a)&&l.jsxs("div",{className:"gap-sm grid h-full grid-cols-subgrid place-items-center",children:[l.jsx(QB,{score:o}),l.jsx(QB,{score:a})]})]}):null},QB=({score:e})=>{const{isMobileStyle:t}=Re();return l.jsx(K,{variant:"superLight",className:z("px-xs flex w-full items-center justify-center rounded py-0.5",{"opacity-0":!e}),children:l.jsx(V,{variant:t?"smallBold":"section-title",color:"super",className:"flex min-w-[2ch] items-center justify-center",children:l.jsx("span",{className:"font-mono",children:e??"—"})})})},B0t=({children:e,className:t})=>l.jsx(Te.div,{layout:!0,layoutRoot:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{ease:Yr,duration:.5},className:z("p-sm isolate flex-col items-end md:flex",t),children:l.jsx("ul",{className:"-mb-xs flex w-full flex-col items-start",children:l.jsx(_g,{id:"index",children:e})})}),Hue=T.memo(({extraCss:e})=>l.jsx(K,{className:`h-[12px] w-[60px] rounded-full ${e}`,variant:"subtler"}));Hue.displayName="ArticleSkeletonItem";const U0t=({widgetData:e,onClick:t,highlighted:n,idx:r})=>l.jsxs("div",{className:"gap-xs pt-sm ml-6 flex items-center",onClick:t.bind(null,e.id),children:[l.jsx(V,{className:z("border-subtler bg-base relative -top-px inline-flex size-4 shrink-0 scale-[.85] items-center justify-center rounded-full border shadow-sm duration-150",{"border-foreground bg-inverse !text-inverse opacity-70":n}),variant:"smallCaps",color:"light",children:r+1}),l.jsx(V,{variant:"tiny",color:n?void 0:"light",className:z("line-clamp-1 cursor-pointer opacity-80 duration-150 hover:!opacity-100",{"!opacity-100":n}),children:e.name})]}),V0t=({highlighted:e,scrollTopOffset:t,scrollThumbHeight:n,widgets:r,loading:s})=>l.jsxs("div",{className:z("bg-base w-two absolute inset-y-0 left-0 z-[2] rounded-full",{"opacity-0 delay-1000":!e}),children:[l.jsx("div",{className:z("absolute inset-0 overflow-hidden duration-150",{"opacity-0":r.length===0||!e,"opacity-1":r.length>0}),children:l.jsx("div",{className:z("absolute left-0 top-0 w-full rounded-full",{"bg-inverse/70":s},{"bg-inverse":!s}),style:{top:`min(${t}%, calc(100% - 8px - ${n}%))`,height:n+"%"}})}),l.jsx("div",{className:"bg-inverse/10 absolute inset-0 rounded-full"})]}),zue=(e,t,n=100)=>{const s=e.getBoundingClientRect().top,o=t.clientHeight/2;return s-o<=n},H0t=({title:e,onClick:t,idx:n,onWidgetClick:r,highlighted:s=!1,isStaged:o,loading:a,id:i,widgets:c=Ie,ref:u,testId:f})=>{const m=s&&!a,[p,h]=d.useState(0),[g,y]=d.useState(0),[x,v]=d.useState(""),b=2,{entityRefs:_}=Boe(),{scrollContainerRef:w}=ka(),S=d.useRef(null),C=d.useCallback(()=>{const k=u?.current;if(k){const I=k.getBoundingClientRect().height,M=k.getBoundingClientRect().top;h(Math.max((1-(I+M)/I)*100,0))}},[u]),E=d.useMemo(()=>hx(()=>{let k=[];Object.keys(_).map(I=>{_[I]?.current&&w?.current&&zue(_[I]?.current,w.current)&&(k=[...k,I])}),v(k[k.length-1]??"")},100),[v,_,w]);d.useEffect(()=>{const k=w.current;if(k)return c&&c.length>=b&&s?(k.addEventListener("scroll",E),k.addEventListener("scroll",C)):(k.removeEventListener("scroll",E),k.removeEventListener("scroll",C)),()=>{k.removeEventListener("scroll",E),k.removeEventListener("scroll",C)}},[s,E,C,c,w]),d.useEffect(()=>{const k=u?.current;if(S.current&&(S.current.disconnect(),S.current=null),k?.nodeType===Node.ELEMENT_NODE){const I=new ResizeObserver(([M])=>{if(M&&Hi(M.borderBoxSize)){const{blockSize:A}=M.borderBoxSize[0];y(window.innerHeight/A*100)}});I.observe(k),S.current=I}return()=>{S.current?.disconnect(),S.current=null}},[u,n]);const N=d.useMemo(()=>c.length>=b&&l.jsx("span",{className:"ml-xs inline-flex",children:l.jsx(ge,{icon:B("chevron-down"),size:"xs"})}),[c.length,b]);return l.jsxs(wr,{as:"li",active:a,speed:"slow",className:"group relative flex select-none flex-col",children:[l.jsx(pi,{mode:"popLayout",initial:!0,children:l.jsx(Fo,{children:o&&!e?l.jsx("div",{className:"ml-md flex h-[20px] items-center",children:l.jsx(Hue,{extraCss:"!w-[100px] !h-[10px]"})}):l.jsxs("div",{children:[l.jsx("div",{onClick:t.bind(null,n),"data-testid":f,children:l.jsxs(V,{variant:"small",color:m?"default":o?"ultraLight":"light",className:z("gap-xs pl-md line-clamp-2 cursor-pointer opacity-80 duration-150 group-hover:opacity-100",{"font-[450] !opacity-100":m}),children:[e,N]})}),s&&!o&&c.length>=b&&l.jsx(Te.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0,transition:{delay:.15}},exit:{opacity:0,y:-4},className:"pb-1",children:c.map((k,I)=>{const M=k.meta_data;return M.object==="ShopifyWidget"?l.jsx(U0t,{widgetData:M,onClick:r,idx:I,highlighted:!a&&x===k.meta_data?.id},k.meta_data?.id):null})},e)]})},o&&!e?"placeholder":e)}),l.jsx("div",{className:"h-sm text-inverse relative z-[5] inline-flex w-full",children:l.jsx("svg",{width:"2",height:"10",viewBox:"0 0 2 10",fill:"none",className:"inline-flex",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M2 0C2 0.552284 1.55228 1 1 1C0.447716 1 0 0.552284 0 0V10C0 9.44772 0.447716 9 1 9C1.55228 9 2 9.44772 2 10V0Z",fill:"currentColor"})})}),a&&l.jsx("div",{className:"w-two absolute inset-y-0 left-0 z-[4] animate-pulse rounded-full",children:l.jsx("div",{className:"bg-inverse absolute inset-0 opacity-10"})}),l.jsx("div",{className:z("bg-base w-two absolute inset-y-0 left-0 z-[3] opacity-0 duration-150",{"!opacity-100":o})}),c.length>=b&&l.jsx(V0t,{highlighted:s,scrollTopOffset:p,scrollThumbHeight:g,widgets:c,loading:a??!1}),s&&l.jsx(Te.div,{layoutId:"layout"+i,transition:{ease:Yr,duration:.3},className:z("bg-inverse w-two absolute inset-y-0 left-0 z-[1] rounded-full",{"!bg-inverse/70":o||a},{"opacity-0 delay-100":c.length>=b})}),l.jsx("div",{className:"bg-inverse w-two absolute inset-y-0 left-0 z-[1] rounded-full opacity-10 duration-150"})]})},z0t=({items:e,sectionRefs:t,onItemClick:n,onWidgetClick:r,className:s,id:o})=>{const[a,i]=d.useState(0),c=h=>{r?.(h)},{scrollContainerRef:u}=ka(),f=h=>{n(h)},m=d.useMemo(()=>hx(()=>{if(!u?.current)return;const h=u.current;if((h?.scrollTop??0)===0){i(0);return}if(vE(h)){i(e.length-1);return}let y=[];Array.from({length:Object.keys(t).length}).map((x,v)=>{const b=t?.[v]?.current;b&&zue(b,h,0)&&(y=[...y,v])}),i(y[y.length-1]??0)},100),[t,i,e.length,u]),p=d.useCallback(()=>{m()},[m]);return d.useEffect(()=>{const h=u?.current;return h?.addEventListener("scroll",p),()=>{h?.removeEventListener("scroll",p)}},[p,u]),l.jsx(B0t,{className:s,children:e.filter(h=>h.show).map((h,g)=>l.jsx(H0t,{title:h.title,onClick:f,onWidgetClick:c,idx:g,loading:h.loading,highlighted:g===a,isStaged:h.staged,id:o,testId:h.testId,widgets:h.widgets,ref:t[g]},h.id))})},W0t=T.memo(()=>l.jsx("div",{}));W0t.displayName="MenuSectionErrorFallback";const G0t=T.memo(({children:e,entries:t,className:n,showMenu:r=!0,header:s,footer:o,variant:a="default",id:i})=>{const{isMobileStyle:c}=Re();return l.jsxs("div",{className:z(n,"mx-md mb-md max-w-threadWidth gap-x-lg md:mx-lg relative md:grid",{"grid-cols-4":a==="default","grid-cols-3":a==="twoThirds"}),children:[l.jsx("div",{className:z("space-y-md pt-md",{"col-span-3":a==="default","col-span-2":a==="twoThirds"}),children:e}),l.jsx("div",{className:z("relative",{"col-span-1 col-start-4":a==="default","col-span-1":a==="twoThirds"}),children:r&&!c&&l.jsxs("div",{className:"sticky top-0",children:[s&&l.jsx("div",{children:s}),l.jsx(Wue,{entries:t,id:i}),o&&l.jsx("div",{children:o})]})})]})});G0t.displayName="WithMenu";const Wue=T.memo(({entries:e,id:t})=>{const{scrollContainerRef:n}=ka();T.useEffect(()=>{const a=window.location.hash.slice(1);if(a){const i=e.find(c=>c.id===a);i?.ref.current&&XB(i.ref.current,!1,n.current)}},[e,n]);const r=d.useMemo(()=>Object.fromEntries(e.filter(a=>a.show).map((a,i)=>[i,a.ref])),[e]),s=d.useMemo(()=>e.map(a=>({title:a.title,id:a.id,loading:!1,show:a.show??!0})).filter(a=>a.show),[e]),o=d.useCallback(a=>{r[a]?.current&&XB(r[a].current,!0,n.current)},[r,n]);return l.jsx(z0t,{className:"pt-md",items:s,sectionRefs:r,onItemClick:o,id:`menu-list-${t}`})});Wue.displayName="MenuList";function XB(e,t=!0,n){const r=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--header-height"))||50,s=parseFloat(window.getComputedStyle(e).marginTop),{top:o}=e.getBoundingClientRect();if(!n)return;const a=o+n.scrollTop-r-s;n.scrollTo({top:a,behavior:t?"smooth":"auto"})}const Gue=T.memo(({query:e,children:t,nofollow:n=!0,sources:r,...s})=>{const o=`/search/new?q=${encodeURIComponent(e)}${r?`&sources=${r.join(",")}`:""}`,a=d.useCallback(()=>Xwe({query:e}),[e]);return l.jsx(xt,{href:Qwe()?void 0:o,rel:n?"nofollow":void 0,onClick:a,...s,children:t})});Gue.displayName="CanonicalQuery";function $0t(e,t){return e==null?1:t==null?-1:e==null&&t==null?0:!isNaN(Number(e))&&!isNaN(Number(t))?Number(e)-Number(t):String(e).localeCompare(String(t))}const q0t=({children:e,...t})=>l.jsx("table",{...t,children:e}),K0t=({children:e,...t})=>l.jsx("tr",{...t,children:e}),Y0t=({children:e,index:t,id:n,data:r,...s})=>l.jsx("td",{...s,children:l.jsx(V,{variant:"tiny",className:z({"font-normal":t}),children:e})}),Q0t=({SortButton:e,children:t})=>l.jsx("th",{className:"py-sm pr-sm text-left align-text-top outline-none",children:l.jsxs(K,{className:"group relative flex items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"light",children:t}),e]})}),$ue=T.memo(function({name:t,setSortDescriptor:n}){return l.jsx("button",{className:"right-sm absolute opacity-0 transition-opacity duration-200 group-hover:opacity-100",onClick:()=>{n(r=>({...r,column:t,reverse:!r.reverse}))},children:l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{icon:B("arrows-vertical"),size:"xs"})})})});$ue.displayName="SortButton";const que=T.memo(({collapsed:e,setCollapsed:t,viewMoreText:n,viewLessText:r})=>{const s=d.useCallback(()=>{t(o=>!o)},[t]);return l.jsx(K,{className:"pb-sm",children:l.jsx(ze,{pill:!0,variant:"border",size:"tiny",chevron:!0,chevronIcon:e?B("chevron-down"):B("chevron-up"),text:e?n:r,onClick:s})})});que.displayName="ResponsiveTableExpander";const ZB="focus-visible:outline-super focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-0",Kue=T.memo(function(t){const{data:n,columns:r,compareFunction:s,RowCell:o,HeaderCell:a,Row:i,Table:c,limit:u}=t,[f,m]=d.useState({column:void 0,reverse:!1}),p=n.at(0),h=d.useMemo(()=>r??Object.keys(p??{}).map(w=>({name:w})),[p,r]),g=s??$0t,y=d.useMemo(()=>{const w=n.map(S=>({data:S,key:S.key??Math.random().toString(36).substring(7)}));return f.column&&w.sort((S,C)=>g(S.data[f.column],C.data[f.column])*(f.reverse?-1:1)),w.slice(0,u||w.length)},[n,u,f,g]),x=a??Q0t,v=c??q0t,b=i??K0t,_=o??Y0t;return l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(v,{className:"w-full border-collapse",children:[l.jsx("thead",{children:l.jsx(b,{id:"_header",children:h.map((w,S)=>l.jsx(Yue,{index:S,HeaderCell:x,setSortDescriptor:m,...w},w.name))})}),l.jsx("tbody",{children:y.map(w=>l.jsx(b,{id:w.key,className:z("group",ZB,"border-subtlest border-t border-dashed !outline-none first:border-solid"),children:h.map(({name:S},C)=>l.jsx(_,{id:S,index:C,data:w.data,className:z("pr-sm align-text-top last:pr-0",ZB,'group-data-[selected="true"]:first:border-l-super py-sm group-data-[selected="true"]:border-super group-data-[selected="true"]:bg-super/10 group-data-[selected="true"]:first:pl-xs group-data-[selected="true"]:last:pr-xs dark:group-data-[selected="true"]:bg-super/10 rounded-sm outline-none transition-all duration-300 ease-in-out group-data-[selected="true"]:first:border-l-2 group-data-[selected="true"]:last:border-r-2'),children:String(w.data[S])},S))},w.key))})]})})});Kue.displayName="ResponsiveTable";const Yue=T.memo(({index:e,HeaderCell:t,setSortDescriptor:n,...r})=>{const s=d.useMemo(()=>l.jsx($ue,{name:r.name,setSortDescriptor:n}),[r.name,n]);return l.jsx(t,{index:e,id:r.name,data:r,SortButton:s,children:r.label??r.name},r.name)});Yue.displayName="HeaderCellFactory";const oM=3,ux=T.memo(({children:e})=>l.jsx(V,{variant:"tinyRegular",color:"light",children:l.jsx("time",{className:"text-nowrap",children:e})}));ux.displayName="Timestamp";const Que=T.memo(({source:e,includeRootLink:t=!0})=>{const{$t:n}=J(),{session:r}=je(),{trackEvent:s}=Ke(r),o=d.useMemo(()=>({onClick(){s("click citation",{source:"hoverCard",citation_url:e.url})}}),[e.url,s]),a=d.useMemo(()=>({color:"light"}),[]);return l.jsx(df,{timestampComponent:e.timestamp?l.jsx(pf,{recentlyUpdatedLabel:n({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.timestamp,timestampProps:a,children:n({defaultMessage:"Updated",id:"xrk6zgu9jU"})}):null,linkProps:o,result:e,children:l.jsx(X0t,{url:t?e.url:void 0,children:l.jsx(gb,{label:`${e.id}`,className:"mb-xs"})})})});Que.displayName="Citation";const X0t=({children:e,url:t,ref:n,...r})=>t!==void 0?l.jsx(xt,{href:t,target:"_blank",rel:"noopener nofollow",ref:n,...r,children:e}):l.jsx("span",{ref:n,...r,children:e}),Z0t=(e,t)=>{if(!e)return"";const n=new Date(e),r=new Date;return Math.abs(+n-+r)<1e3*60*60*24?new Intl.RelativeTimeFormat(t,{localeMatcher:"best fit",numeric:"auto",style:"long"}).format(0,"day"):n.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},Xue=T.memo(({post:e})=>{const{locale:t}=J(),{isMobileStyle:n}=Re(),r=d.useMemo(()=>e.timestamp?Z0t(e.timestamp,t):"",[e.timestamp,t]);return l.jsx(K,{children:l.jsx(Gue,{query:e.headline,nofollow:!0,children:l.jsxs("span",{className:"group/post pb-xs cursor-pointer",children:[l.jsxs(V,{variant:n?"smallBold":"baseSemi",className:"mb-xs gap-sm flex items-baseline justify-between",children:[l.jsx("span",{className:"leading-snug duration-150",children:e.headline}),l.jsxs("div",{className:"flex translate-x-1 items-center gap-0.5",children:[e.timestamp&&!n&&l.jsx(K,{className:"gap-sm capitalize",children:l.jsx(ux,{children:r})}),l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet group-hover/post:text-foreground translate-y-1 opacity-75 duration-150 md:translate-y-0"})]})]}),l.jsxs(V,{variant:n?"small":"base",className:"text-pretty leading-tight",children:[l.jsx("span",{className:"opacity-75",children:e.text}),l.jsx("span",{className:"ml-xs inline-flex",children:e.sources.map((s,o)=>l.jsx("span",{className:"mr-xs",children:l.jsx(Que,{source:s,includeRootLink:!1},s.id)},o))})]}),e.timestamp&&n&&l.jsxs(K,{className:"mt-sm gap-xs flex items-center capitalize",children:[l.jsx(ft,{name:B("clock"),className:"text-quiet opacity-80",size:16}),l.jsx(ux,{children:r})]})]})})})});Xue.displayName="Post";const J0t=T.memo(({created:e,posts:t,title:n,variant:r})=>{const{$t:s}=J(),[o,a]=d.useState(!0),[i,c]=d.useState(!1),{locale:u}=J(),[f,m]=d.useState(Date.now());d.useEffect(()=>{const b=setInterval(()=>m(Date.now()),15e3);return()=>clearInterval(b)},[]);const p=mi(),h=d.useMemo(()=>{if(!e||!p)return"";const b=Date.parse(e),_=f-b;let w=_/6e4,S="days";w<1?(w=_/1e3,S="seconds"):w<60?(w=_/6e4,S="minutes"):w<1440?(w=_/36e5,S="hours"):(w=_/864e5,S="days"),w=-Math.abs(Math.floor(w));const C=new Intl.RelativeTimeFormat(u,{localeMatcher:"best fit",numeric:"auto",style:"short"});return s({defaultMessage:"Updated {time}",id:"0aJxT29U/1"},{time:C.format(w,S)})},[e,f,s,u,p]),g=d.useMemo(()=>{if(!t?.length)return[];const b=t.flatMap(_=>_.sources).map(_=>[_.id,_]);return Object.values(Object.fromEntries(b))},[t]),y=d.useMemo(()=>g.map(b=>({url:b.url})),[g]),x=d.useCallback(()=>c(!0),[]),v=d.useCallback(()=>c(!1),[]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs(K,{className:z("gap-xs px-md py-sm flex flex-wrap items-center justify-between",{"border-b":r!=="raised"}),children:[l.jsxs(V,{variant:"baseSemi",color:t.length>0?"super":"ultraLight",className:"gap-sm flex items-center",as:"h2",children:[l.jsx(n1t,{animate:t.length>0}),l.jsx("span",{children:n??s({defaultMessage:"What's Happening",id:"wVxgwE2ray"})})]}),l.jsx(ux,{children:h})]}),l.jsxs(K,{variant:r,className:z({"rounded-xl border":r==="raised"}),children:[l.jsx(pi,{transition:{ease:Yr,duration:.2},children:l.jsx(Fo,{children:t.length===0?l.jsx(e1t,{}):l.jsx("ul",{className:"pb-md grid",children:t.slice(0,o?oM:t.length).map((b,_)=>l.jsx(Te.li,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},transition:{y:{ease:Yr,duration:.2}},className:"mx-md border-subtlest py-md block border-b last:border-b-0 last:pb-0",children:l.jsx(Xue,{post:b},_)},b.headline))})})}),t.length>0&&l.jsxs(l.Fragment,{children:[t.length>oM&&l.jsx(K,{className:"px-md",children:l.jsx(que,{collapsed:o,setCollapsed:a,viewMoreText:s({defaultMessage:"View More",id:"QQSdHPJWXu"}),viewLessText:s({defaultMessage:"View Less",id:"UOYN/MXiOT"})})}),l.jsx("div",{className:"pb-md pl-md",children:l.jsxs(K,{as:"button",bgHover:"subtle",className:"gap-sm px-sm inline-flex items-center rounded-full border py-1.5",onClick:x,children:[l.jsx(yb,{sources:y,count:4}),l.jsxs(V,{variant:"tiny",color:"light",children:[g.length," Sources"]})]})})]})]})]}),i&&l.jsx(vb,{onClose:v,webResults:g,legacyIdentifier:"citationListModal"})]})});J0t.displayName="WhatsHappening";const e1t=()=>l.jsx(wr,{className:"px-md",children:l.jsx("div",{className:"divide-y",style:{maskImage:"linear-gradient(to bottom, black 50%, transparent)"},children:Array.from({length:oM}).map((e,t)=>l.jsx(t1t,{},t))})}),t1t=()=>l.jsxs(K,{className:"gap-sm py-md flex flex-col",children:[l.jsx(K,{className:"mb-sm h-2 w-4/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-3/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-3/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-2/5 rounded-full",variant:"subtle"})]}),K1=(e,t)=>t?{initial:{opacity:0},animate:{opacity:1},transition:{duration:1,repeat:1/0,repeatDelay:5,ease:Yd,delay:e}}:{opacity:1},n1t=({animate:e})=>l.jsx("svg",{viewBox:"0 0 576 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-super inline-block h-[1em] overflow-visible align-[-0.125em]",children:l.jsxs("g",{children:[l.jsx(Te.path,{d:"M99.8 69.4C110 77.8 111.4 93 103 103.2C68.6 144.7 48 197.9 48 256C48 314.1 68.6 367.3 103 408.8C111.4 419 110 434.1 99.8 442.6C89.6 451.1 74.5 449.6 66 439.4C24.8 389.6 0 325.7 0 256C0 186.3 24.8 122.4 66 72.6C74.4 62.4 89.6 61 99.8 69.4ZM476.3 69.4C486.5 61 501.6 62.4 510.1 72.6C551.3 122.4 576.1 186.4 576.1 256C576.1 325.6 551.3 389.6 510.1 439.4C501.7 449.6 486.5 451 476.3 442.6C466.1 434.2 464.7 419 473.1 408.8C507.4 367.3 528.1 314.1 528.1 256C528.1 197.9 507.5 144.7 473.1 103.2C464.7 93 466.1 77.9 476.3 69.4Z",fill:"currentColor",...K1(.3,e)}),l.jsx(Te.path,{...K1(.15,e),d:"M160 256C160 226.4 170 199.2 186.9 177.5C195 167 193.2 151.9 182.7 143.8C172.2 135.7 157.1 137.5 149 148C125.8 177.8 112 215.3 112 256C112 296.7 125.8 334.2 149 364C157.2 374.5 172.2 376.4 182.7 368.2C193.2 360 195 345 186.9 334.5C170 312.8 160 285.6 160 256Z",fill:"currentColor"}),l.jsx(Te.path,{...K1(.15,e),d:"M464 256C464 215.3 450.2 177.8 427 148C418.8 137.5 403.8 135.6 393.3 143.8C382.8 152 381 167 389.1 177.5C406 199.2 416 226.4 416 256C416 285.6 406 312.8 389.1 334.5C381 345 382.8 360.1 393.3 368.2C403.8 376.3 418.9 374.5 427 364C450.2 334.2 464 296.7 464 256Z",fill:"currentColor"}),l.jsx(Te.path,{...K1(0,e),d:"M259.716 227.716C252.214 235.217 248 245.391 248 256C248 266.609 252.214 276.783 259.716 284.284C267.217 291.786 277.391 296 288 296C298.609 296 308.783 291.786 316.284 284.284C323.786 276.783 328 266.609 328 256C328 245.391 323.786 235.217 316.284 227.716C308.783 220.214 298.609 216 288 216C277.391 216 267.217 220.214 259.716 227.716Z",fill:"currentColor"})]})}),r1t=T.memo(({children:e,maxFaces:t=3,showMore:n=!0,clickable:r=!1,size:s="medium",onAvatarClick:o,backgroundClass:a})=>{const i=T.Children.count(e);return l.jsxs(K,{onClick:r?o:void 0,bgHover:r?"subtler":void 0,className:z("group flex items-center",{"p-xs cursor-pointer rounded-full transition-all":r}),children:[T.Children.map(e,(c,u)=>ut&&l.jsx(K,{children:l.jsxs(V,{variant:"smallCaps",color:"light",className:"px-xs",children:["+",i-t]})})]})});r1t.displayName="AvatarList";const s1t=e=>!!e.extra.team_1_competitor_types?.map(n=>n.type).includes("team"),o1t=({event:e,subtitles:t,headshots:n})=>{const{locale:r}=J(),s=d.useMemo(()=>{if(!e.datetime)return null;const m=new Date(e.datetime);return isNaN(m.getTime())?null:m.toLocaleTimeString(r,{hour:"numeric",minute:"numeric",hour12:!0})},[e.datetime,r]),o=e.status==="live",a=e.status==="final",i=e.datetime&&new Date(e.datetime)>new Date,c=e.team_1.won||e.team_2.won,{isMobileStyle:u}=Re(),f=s1t(e);return l.jsxs(K,{className:"group relative",children:[l.jsx(K,{className:"bg-subtler duration-quick absolute inset-0 opacity-0 transition-opacity group-hover:opacity-50",variant:"subtle"}),l.jsxs(Zg,{href:`/sports/atp/events/${e.id}`,className:z("p-md gap-y-md relative grid w-full flex-col",{"gap-y-sm":u}),children:[l.jsxs("div",{className:"gap-md flex items-center justify-between",children:[l.jsx(V,{variant:u?"tinyRegular":"small",color:"light",children:e.title[0]}),i?l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:u?"tinyRegular":"small",color:"light",children:s}),l.jsx(vue,{className:"-mr-0.5"})]}):o?l.jsx(pm,{className:"-mr-0.5",includeDot:!0}):a&&l.jsx(f_,{className:"-mr-0.5"})]}),l.jsxs(K,{className:"gap-lg flex w-full items-center",children:[l.jsx("div",{className:"gap-sm flex flex-1",children:l.jsxs("div",{className:z("flex flex-1 flex-col gap-[12px]",{"gap-sm":u}),children:[l.jsx(JB,{team:e.team_1,headshotImageUrl:n?.team1??null,anyWinner:c,subtitle:t?.team1,isDoubles:f,serving:e.team_1.emphasis,isLive:o}),l.jsx(JB,{team:e.team_2,headshotImageUrl:n?.team2??null,anyWinner:c,subtitle:t?.team2,isDoubles:f,serving:e.team_2.emphasis,isLive:o})]})}),l.jsx("div",{className:"flex h-full items-center justify-end",children:l.jsx(F0t,{event:e,team1:e.team_1,team2:e.team_2,isLive:o})})]})]})]})},JB=({team:e,headshotImageUrl:t,anyWinner:n,subtitle:r,isDoubles:s,serving:o,isLive:a})=>{const i=e.won,{isMobileStyle:c}=Re();return l.jsxs("div",{className:z("gap-sm flex items-center",{"opacity-30 grayscale":n&&!i}),children:[l.jsx(Oue,{headshotImageUrl:t??void 0,flagUrl:e.img??void 0,name:e.title??"",isCompositeFlag:s}),l.jsxs("div",{children:[l.jsxs(V,{variant:c?"smallBold":"baseSemi",className:"gap-xs flex items-center",children:[e.title,i&&l.jsx(K,{variant:"superLight",className:"p-xs ml-auto inline-flex aspect-square rounded-full",children:l.jsx(ft,{name:B("trophy"),size:12,className:"text-super"})}),o&&a&&l.jsx(ge,{icon:B("ball-tennis"),size:14,className:"text-super"})]}),typeof r=="string"?l.jsx(V,{variant:"micro",color:"light",className:"-mt-0.5",children:r}):r]})]})},a1t=async e=>{if(!e)return null;const{data:t,error:n,response:r}=await de.POST("/rest/sports/{league}/widget","sports-widget",{body:e});if(n)throw new ye("API_CLIENTS_ERROR",{cause:n,details:e,status:r.status??0});return t},i1t=({data:e})=>{const{data:t}=gt({...L0t,queryKey:be.makeEphemeralQueryKey("/sports/widget",e.events.map(r=>r.id).join(",")),queryFn:()=>a1t(e.debug_fn_args),placeholderData:$l,refetchInterval:3e4}),n=t||e;return n?.object!==e.object?null:l.jsx(kue,{canonicalPageLink:n?.canonical_pages?.[0]?.url_web,children:l.jsx("div",{className:"divide-y overflow-hidden",children:n?.events?.map(r=>l.jsx(o1t,{event:r},r.id))})})},fp=T.memo(({data:e})=>Vi(e).with({object:"SportsEventsWidget"},t=>t.league==="atp"||t.league==="wta"?l.jsx(i1t,{data:t}):l.jsx(Jgt,{widget:t})).with({object:"SportsStandingsWidget"},t=>l.jsx(O0t,{widgetData:t})).with({object:"SportsIndvScheduleWidget"},t=>l.jsx(b0t,{widgetData:t})).with({object:"SportsIndvEventsWidget"},t=>l.jsx(y0t,{widgetData:t})).exhaustive());fp.displayName="SportsWidget";const Zue=T.memo(({status:e})=>l.jsx(V,{as:"span",variant:"smallBold",color:e?"super":"light",children:l.jsx(ge,{icon:e?B("check"):B("x"),size:"md"})}));Zue.displayName="BoolCell";const Jue=T.memo(({url:e})=>l.jsx(xt,{href:e,target:"_blank",rel:"noopener",className:"top-xs relative inline-block transition-opacity duration-300 hover:opacity-50",children:l.jsx(xa,{color:"light",variant:"tiny",url:e,isAttachment:!1})}));Jue.displayName="LinkCell";const Py=T.memo(({text:e})=>l.jsx(V,{as:"span",variant:"tiny",className:"text-pretty break-words font-normal",children:e}));Py.displayName="TextCell";const ede=T.memo(({tableData:e,citationOffset:t})=>{const{$t:n}=J(),{session:r}=je(),{trackEvent:s}=Ke(r),{data:o,column_metadata:a,search_results:i}=e,c=d.useMemo(()=>a.reduce((y,{name:x,display_name:v})=>(y[x]=v,y),{}),[a]),u=d.useMemo(()=>a.reduce((y,{name:x,display_format:v})=>(y[x]=v,y),{}),[a]),f=d.useCallback((y,x)=>y.value===null&&x.value===null?0:y.value===null?-1:x.value===null?1:typeof y.value=="string"?String(y.value).localeCompare(String(x.value)):Number(y.value)-Number(x.value),[]),m=d.useCallback(({data:y,id:x,...v})=>{const b=u[x],_=y[x]?.citation_index??null,w=_!==null?i[_]:null,S=w?.is_attachment??!1,C=y[x]?.value;let E=l.jsx(Py,{text:String(C)});return b==="url"&&(E=l.jsx(Jue,{url:String(C)})),b==="boolean"&&(E=l.jsx(Zue,{status:!!C})),b==="long_text"&&(E=l.jsx(Py,{text:String(C)})),b==="date"&&(E=l.jsx(Py,{text:String(C)})),C===null?l.jsx("td",{...v,children:l.jsx(V,{variant:"tiny",color:"ultraLight",children:l.jsx(ge,{icon:B("minus"),size:"xs"})})}):l.jsxs("td",{...v,children:[l.jsx("span",{children:E}),b!=="url"&&w&&w.url&&_!==null&&l.jsx(df,{result:w,children:l.jsx(SN,{str:`[${_+t+1}]`,href:w.url,isFile:S,isDownloadable:Xl(w),className:"citation ml-xs inline"})})]})},[i,u,t]),p=d.useMemo(()=>a.map(({name:y})=>({name:y,label:c[y],sortable:!0,resizable:!0})),[a,c]),h=Vse(),g=d.useCallback(()=>{const y=a.reduce((_,w)=>(_.push(w.name),_),[]).join("-"),x=a.map(({display_name:_})=>vk.escapeCSVString(_)).join(","),v=o.map(_=>a.map(({name:w})=>vk.escapeCSVString(String(_[w]?.value))).join(",")),b=[x,...v].join(` -`);return s("clicked download table as csv",{source:"widget"}),h({csvString:b,filename:y})},[a,o,h,s]);return l.jsx(Es,{widgetType:"table",widgetName:"table",widgetSize:"full",children:l.jsxs(K,{variant:"subtler",className:"px-md pb-xs rounded-lg",children:[l.jsx(Kue,{data:o,columns:p,RowCell:m,compareFunction:f}),l.jsx(K,{className:"border-subtlest py-sm flex justify-end border-t",children:l.jsx(rt,{icon:B("download"),variant:"super",onClick:g,pill:!0,size:"tiny",text:n({defaultMessage:"Export CSV",id:"TE51b7zSWC"}),toolTip:n({defaultMessage:"Download Table as CSV",id:"X3dYB0f+/Q"})})})]})})});ede.displayName="TableWidget";const l1t=T.memo(({isOpened:e,onOpen:t,onClose:n,onEdit:r})=>{const s=J(),o=Dn(),{isMobileStyle:a}=Re(),i=d.useMemo(()=>[{type:"default",text:s.formatMessage({defaultMessage:"Edit",id:"wEQDC6Wv3/"}),onClick:r,testId:"task-widget-edit"},{type:"default",text:s.formatMessage({defaultMessage:"View Tasks",id:"L3nFsHqlqm"}),rightElement:l.jsx("div",{className:"flex items-center",children:l.jsx(ft,{name:B("chevron-right"),size:16})}),onClick:()=>{o.push("/account/tasks")},testId:"task-widget-view-tasks"}],[s,r,o]);return l.jsx(Ws,{placement:"bottom-start",items:i,onOpen:t,onClose:n,isMobileStyle:a,children:l.jsx(rt,{size:"tiny",icon:B("dots-vertical"),extraCSS:z("",{"!text-foreground !bg-subtle":e})})})});l1t.displayName="TaskWidgetMenu";const c1t=e=>({id:e.id,title:e.title,prompt:e.prompt,schedule:Yy(e.scheduleInfo),searchModel:e.searchModel,sources:e.sources||["web"]}),eU=(e={})=>e.prefill?e.prefill:e.initial?c1t(e.initial):{...J1e(),searchModel:ie.PRO},mp=({text:e,onClick:t,variant:n="secondary",disabled:r=!1})=>l.jsx(ze,{text:e,onClick:t,disabled:r,testId:`task-modal-${e.toLowerCase()}-button`,variant:n==="secondary"?"common":"inverted",extraCSS:"min-w-[100px]"}),u1t=(e,t)=>e.schedule.kind==="ONCE"&&new Date(e.schedule.year,e.schedule.month,e.schedule.day,e.schedule.hour,e.schedule.minute)<=new Date(Date.now())?{ok:!1,message:t({defaultMessage:"Please schedule this task for a future time.",id:"loBg9tvLRE"})}:{ok:!0};function tde({open:e,onClose:t,onSuccess:n,initial:r,prefill:s,errorMessage:o,source:a}){const i="task-modal",{formatMessage:c}=J(),{session:u}=je(),{trackEvent:f}=Ke(u),{configuredModel:m}=Fn();d.useEffect(()=>{e&&f("task modal opened",{source:a})},[e,a,f]);const[p,h]=d.useState(o),{createMutation:g,updateMutation:y,deleteMutation:x,isMutationLoading:v,invalidateAndClose:b}=nre({reason:i,source:a,onSuccess:d.useCallback(P=>{n?.(P),t?.()},[n,t]),onError:h}),_=d.useRef(r?M7(r):void 0);d.useEffect(()=>{e&&(_.current=r?M7(r):void 0)},[e,r]);const[w,S]=d.useState(()=>eU({initial:r,prefill:s})),C=d.useMemo(()=>sn(w.searchModel),[w.searchModel]);d.useEffect(()=>{h(e?o:void 0)},[e,o]),d.useEffect(()=>{e&&S(eU({initial:r,prefill:s}))},[e,r,s,m]),d.useEffect(()=>{const P=Ai(C);S(F=>({...F,searchModel:P}))},[C]);const E=!!_.current,N=_.current?.status==="PAUSED",k=_.current?.status==="COMPLETED",I=P=>S(F=>({...F,...P})),M=P=>S(F=>({...F,schedule:{...F.schedule,...P}})),A=()=>{h(void 0);const P=u1t(w,c);if(!P.ok){h(P.message);return}E?y.mutate({id:_.current.id,payload:{task_name:w.title,prompt:w.prompt,schedule:yp(w.schedule),status:"ACTIVE",model_preference:w.searchModel,sources:w.sources}},{onSuccess:()=>{f("task modal action",{source:a,action:"updated"}),b("updated",_.current.id)}}):g.mutate({task_id:w.id,task_name:w.title,prompt:w.prompt,schedule:yp(w.schedule),model_preference:w.searchModel,sources:w.sources},{onSuccess:()=>{f("task modal action",{source:a,action:"created"})}})},D=d.useMemo(()=>{if(!E)return!0;const P=w.prompt!==_.current?.prompt,F=_.current.scheduleInfo,R=yp(w.schedule),j=!Er(R.rrule,F.rrule)||!Er(R.tzid,F.tzid),L=w.schedule.kind==="ONCE"&&R.start_at!==F.start_at,U=w.searchModel!==_.current?.searchModel,O=!Er(w.sources||["web"],_.current?.sources||["web"]);return P||(j||L||U)||O},[E,w,_]);return l.jsx(po,{isOpen:e,onClose:t,title:c({defaultMessage:"Task",id:"0wJ7N+noSq"}),titleTextVariant:"base",modalContentClassname:"!pb-4 md:!pb-4",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(Jv,{trigger:{type:Xe.SCHEDULED,schedule:w.schedule},prompt:w.prompt,onPromptChange:P=>I({prompt:P}),error:p}),l.jsx(G6,{schedule:w.schedule,onScheduleChange:M}),l.jsx(Yv,{searchModel:w.searchModel,onSearchModelChange:P=>I({searchModel:P}),sources:w.sources||["web"],onSourcesChange:P=>I({sources:P})}),l.jsxs(K,{variant:"background",className:"mt-md pt-md -mx-md px-md flex items-center justify-between border-t",children:[E&&l.jsxs("div",{className:"flex gap-4",children:[!k&&l.jsx(mp,{text:c(N?{defaultMessage:"Resume",id:"3y9DGgura7"}:{defaultMessage:"Pause",id:"tFFMkFDBMO"}),onClick:()=>y.mutate({id:_.current.id,payload:{status:N?"ACTIVE":"PAUSED"}},{onSuccess:()=>{const P=N?"resumed":"paused";f("task modal action",{source:a,action:P}),b(P,_.current.id)}}),disabled:v}),l.jsx(mp,{text:c({defaultMessage:"Delete",id:"K3r6DQW7h+"}),onClick:()=>x.mutate(_.current.id),disabled:v})]}),l.jsxs("div",{className:"ml-auto flex gap-4",children:[l.jsx(mp,{text:c({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:()=>t?.()}),l.jsx(mp,{text:c({defaultMessage:"Save",id:"jvo0vs3nF0"}),variant:"primary",disabled:v||!w.prompt||!D,onClick:A})]})]})]})})}const d1t=Object.freeze(Object.defineProperty({__proto__:null,FormButton:mp,default:tde},Symbol.toStringTag,{value:"Module"})),tU=kA,nde=()=>l.jsx("div",{className:"flex flex-1 items-center justify-end opacity-50",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"sm"})}),f1t={Enterprise:{trailingComponent:l.jsx(nde,{})},Tasks:{href:`${tU}/tasks`},Shortcuts:{href:`${tU}/shortcuts`}};l.jsx(nde,{});const m1t=()=>l.jsxs(wr,{className:"flex w-full items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"bg-subtle size-4 shrink-0 rounded"}),l.jsx("div",{className:"bg-subtle h-4 w-32 rounded"})]}),l.jsx("div",{className:"bg-subtle h-4 w-20 rounded"})]}),rde=T.memo(({data:e})=>{const{$t:t}=J(),{suggested_prompt:n,suggested_schedule:r,widget_uuid:s}=e,o=d.useMemo(()=>({id:s,title:"",prompt:n,schedule:r?Yy(r):Gr(),searchModel:ie.PRO}),[n,r,s]),a=ln(),i=d.useCallback(()=>{a.openTab({url:`${window.location.origin}${f1t.Tasks.href}`})},[a]),[c,u]=d.useState(!1),[f,m]=d.useState(!1),[p,h]=d.useState(!1),[g,y]=d.useState(null),[x,v]=d.useState(!1);d.useEffect(()=>{if(!g)return;const M=setTimeout(()=>{y(null)},2e3);return()=>clearTimeout(M)},[g]);const b=J(),{data:_,isLoading:w}=gt({queryKey:NH(s),queryFn:()=>F9e({taskId:s,reason:"task-widget"})});d.useCallback(()=>{_?.type==="ALERT"&&_?.subscription?h(!0):m(!0)},[_]),d.useMemo(()=>{if(!_)return null;if(_.type==="ALERT"&&_.subscription)return Q0e({..._.subscription,event_type:_.subscription.event_type},b);const M=Yy(_.scheduleInfo);return{kind:eye(M.kind,b),friendly:X1e(M,b),isRecurring:M.kind!=="ONCE"}},[_,b]);const S=d.useMemo(()=>{if(!_)return"";if(_.type==="ALERT"&&_.subscription){const{subscription:M}=_,A=M.event_entity||"",D=M.event_type==="STOCK_PRICE_TARGET",P=M.event_type==="STOCK_PRICE_MOVEMENT";if(D){const F=M.value_upper_bound||M.value_lower_bound;if(F)return`${A} reaches $${F}`}else if(P){const F=M.value_upper_bound||0,R=M.value_lower_bound||0,j=F>0,L=R<0;if(j&&L)return`${A} moves ±${F}%`;if(j)return`${A} rises ${F}%`;if(L)return`${A} falls ${Math.abs(R)}%`}return`Price alert for ${A}`}return _.prompt},[_]);d.useMemo(()=>{if(!g)return null;const M=g==="created"?l.jsx(Ne,{defaultMessage:"Task created",id:"991WgJt61N"}):g==="updated"?l.jsx(Ne,{defaultMessage:"Task updated",id:"sQGGdcVjgL"}):g==="deleted"?l.jsx(Ne,{defaultMessage:"Task deleted",id:"kGP3l1jr/4"}):g==="paused"?l.jsx(Ne,{defaultMessage:"Task paused",id:"Ryhxeg2OIZ"}):l.jsx(Ne,{defaultMessage:"Task resumed",id:"fqAqWnF85q"});return l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Yr},children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ft,{name:B("circle-check-filled"),className:"text-super",size:16}),l.jsx(V,{variant:"small",color:"super",className:"truncate",children:M})]})},"confirmed")},[g]);const C=d.useCallback(()=>{v(!1)},[]),E=d.useCallback(()=>v(!0),[]);d.useMemo(()=>t({defaultMessage:"Task",id:"0wJ7N+noSq"}),[t]),d.useMemo(()=>l.jsx(ft,{name:B("plus"),size:12}),[]);const N=d.useCallback(()=>{m(!1),v(!1)},[]),k=d.useCallback(()=>{h(!1),v(!1)},[]),I=d.useCallback(M=>{m(!1),v(!1),y(M)},[]);return d.useCallback(()=>{u(!0)},[]),d.useCallback(()=>{u(!1)},[]),l.jsx(Es,{widgetType:"task",widgetName:"task",widgetSize:"mini",children:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"bg-subtler border-subtlest p-md group relative flex h-14 items-center justify-between gap-2 rounded-xl border transition-transform duration-200 hover:scale-[1.01] hover:transform",onMouseEnter:E,onMouseLeave:C,children:l.jsx(kt,{mode:"wait",children:w?l.jsx(m1t,{}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex min-w-0 shrink items-center gap-2",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:_?.type==="ALERT"&&_?.subscription?l.jsx(ft,{name:B("bell-bolt"),size:16,className:"text-quiet shrink-0"}):l.jsx(ft,{name:B("clock"),size:16,className:"text-quiet shrink-0"})}),l.jsx("div",{className:"flex w-full min-w-0 flex-col items-start",children:_?l.jsx(V,{variant:"small",color:"default",className:"w-full truncate",children:S}):l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"small",color:"default",className:"w-full truncate",children:n}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"truncate",children:l.jsx(Ne,{defaultMessage:"Create a task to get this sent automatically.",id:"1AmBIpC9N9"})})]})})]}),l.jsx(rt,{size:"tiny",icon:B("edit"),onClick:i})]})})}),l.jsx($c,{children:l.jsx(tde,{source:"task_widget",open:f,prefill:_?void 0:o,initial:_??void 0,onClose:N,onSuccess:I})}),_&&l.jsx(bb,{isOpen:p,onClose:k,task:_,symbol:_.subscription?.event_entity})]})})});rde.displayName="TaskWidget";const sde=T.memo(e=>{const{data:t}=e,{menuItems:n}=im();return l.jsx(Es,{widgetType:"time",widgetName:"time",widgetSize:"full",children:l.jsxs(K,{className:"flex w-full",children:[l.jsx(V,{children:l.jsx(K,{className:"mr-md pr-md border-r font-mono text-4xl",children:t.time})}),l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",children:t.date}),l.jsx(V,{variant:"small",color:"light",children:t.location?`${t.location}`:null})]}),n&&n.length>0&&l.jsx("div",{className:"-mr-sm -mt-sm flex grow justify-end",children:l.jsx("div",{children:l.jsx(Un.Menu,{menuItems:n})})})]})})});sde.displayName="TimeWidget";const ode=T.memo(e=>{const{data:t}=e,{duration_seconds:n}=t,{menuItems:r}=im(),{result:s}=Ot(),o=s?.uuid,a=d.useMemo(()=>`timer_widget_state_${o}_${n}`,[o,n]),[i,c]=d.useState(!1),[u,f]=d.useState(!1),[m,p]=d.useState(null),[h,g]=d.useState(n*1e3),[y,x]=d.useState(!0),[v,b]=d.useState(!1),_=d.useRef(void 0),w=d.useRef(void 0),S=d.useRef(!1),C=d.useRef(null);d.useEffect(()=>{if(!o)return;const P=wt.getItem(a);if(P)try{const F=JSON.parse(P),R=Date.now();if(F.status==="expired"){f(!0),g(0),p(null);return}if(F.pausedAt&&F.remainingMillis!==void 0)c(!0),g(F.remainingMillis),p(null);else if(F.endTime){const j=F.endTime-R;if(j>0)p(F.endTime),g(j),c(!1);else{g(0),p(null),f(!0);const L={status:"expired",endTime:0,remainingMillis:0};wt.setItem(a,JSON.stringify(L))}}}catch{wt.removeItem(a)}else{const F=Date.now()+n*1e3;p(F),c(!1)}},[a,n,o]),d.useEffect(()=>{if(!o||u)return;const P=i?{status:"paused",endTime:0,pausedAt:Date.now(),remainingMillis:h}:{status:"running",endTime:m||Date.now()+h};wt.setItem(a,JSON.stringify(P))},[h,i,m,a,u,o]);const E=d.useCallback(()=>{if(S.current||u)return;S.current=!0,g(0),p(null),f(!0),b(!0);const P={status:"expired",endTime:0,remainingMillis:0};wt.setItem(a,JSON.stringify(P)),!y&&C.current&&C.current.play().catch(()=>{})},[a,u,y]),N=d.useCallback(()=>{if(!i&&m){const P=Date.now(),F=m-P;F>0?(g(F),_.current=requestAnimationFrame(N)):E()}},[i,m,E]);d.useEffect(()=>{if(!i&&m&&h>0&&!u){_.current=requestAnimationFrame(N);const P=m-Date.now();P>0&&(w.current=window.setTimeout(E,P))}return()=>{_.current&&cancelAnimationFrame(_.current),w.current&&clearTimeout(w.current)}},[i,m,h,u,N,E]),d.useEffect(()=>{const P=()=>{if(!document.hidden&&!i&&m){const F=Date.now(),R=m-F;R>0?g(R):E()}};return document.addEventListener("visibilitychange",P),()=>{document.removeEventListener("visibilitychange",P)}},[i,m,E]);const k=d.useCallback(()=>{if(!u)if(i){const P=Date.now()+h;p(P),c(!1)}else c(!0),p(null)},[u,i,h]),I=d.useCallback(()=>{_.current&&(cancelAnimationFrame(_.current),_.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),S.current=!1;const P=Date.now()+n*1e3;f(!1),c(!1),g(n*1e3),p(P)},[n]),M=d.useCallback(()=>{x(P=>!P)},[]),A=d.useCallback(()=>{b(!1),C.current&&(C.current.pause(),C.current.currentTime=0)},[]),D=d.useMemo(()=>{const P=Math.ceil(h/1e3),F=Math.floor(P/3600),R=Math.floor(P%3600/60),j=Math.floor(P%60),L=R.toString().padStart(2,"0"),U=j.toString().padStart(2,"0");return F>0?`${F}:${L}:${U}`:`${L}:${U}`},[h]);return l.jsx(Es,{widgetType:"timer",widgetName:"timer",widgetSize:"full",children:l.jsxs(K,{className:z("relative flex transition-all duration-200",{"hover:scale-[1.01]":v}),children:[v&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"-m-md absolute inset-0 z-20 cursor-pointer rounded-xl",onClick:A,title:"Click anywhere to stop alarm","aria-label":"Stop alarm"}),l.jsx("div",{className:"-m-md to-attention/20 from-negative/20 absolute inset-0 animate-pulse rounded-xl bg-gradient-to-br"})]}),l.jsxs("div",{className:"relative z-10 flex w-full items-center",children:[l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(ze,{variant:"primaryGhost",size:"small",onClick:k,icon:i?B("player-play-filled"):B("player-pause-filled"),disabled:u,pill:!0}),l.jsx(ze,{variant:"primaryGhost",size:"small",onClick:I,icon:B("rotate-clockwise"),"aria-label":"Restart timer",disabled:v,pill:!0})]}),l.jsx(V,{className:"flex-1",children:l.jsx(K,{className:`pl-lg font-mono text-2xl ${v?"text-negative":""}`,children:D})}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(_v,{cueKey:`timer-unmute-${o}`,title:"Tap to unmute",enabled:y&&!u,placement:"top",sideOffset:8,variant:"common",size:"xs",children:l.jsx(ze,{variant:"primaryGhost",size:"small",onClick:M,icon:y?aV:oV,disabled:u,pill:!0})}),r&&r.length>0&&l.jsx(Un.Menu,{menuItems:r})]})]}),l.jsx("audio",{ref:C,src:"https://r2cdn.perplexity.ai/Hole_In_One.wav?v=1",preload:"auto",style:{display:"none"},loop:!0})]})})});ode.displayName="TimerWidget";function p1t(){const[e,t]=d.useState(!1),n=Ix(),r=d.useCallback(s=>{lo(GR,s.toString()),t(s)},[t]);return d.useEffect(()=>{const s=hr(GR);t(s==="true"||s===void 0&&n!=="US")},[n]),d.useMemo(()=>({prefersMetric:e,setPrefersMetric:r}),[e,r])}const h1t=130,ade=T.memo(({day:e,icon:t,high:n,low:r,selected:s})=>l.jsxs("div",{className:"relative col-span-1",children:[s&&l.jsx(Te.div,{layoutId:"selected-forecast-item",className:"-inset-sm absolute right-0",transition:Rr,children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-white opacity-10"})}),l.jsxs("div",{className:"relative flex flex-col items-start",children:[l.jsx(V,{color:"white",children:l.jsx(ge,{icon:t,size:"xl",className:"mb-xs -ml-two"})}),l.jsx(V,{variant:"smallBold",color:"white",children:e}),l.jsxs("div",{className:"mt-xs gap-x-xs flex",children:[l.jsx(V,{variant:"smallCaps",color:"white",className:"gap-x-two flex",children:l.jsxs("span",{children:[n,"°"]})}),l.jsx(V,{variant:"smallCaps",color:"white",className:"gap-x-two flex opacity-75",children:l.jsxs("span",{children:[r,"°"]})})]})]})]}));ade.displayName="ForecastItem";const Oy=d.memo(({width:e,variant:t})=>{const[n,r]=d.useState(!1),s=t==="hail"?20:t==="normal"?25:40,o=400,a=t==="hail"?1:20,i=t==="hail"?3:t==="normal"?30:80,c=100,u=t==="hail"?.8:.5,f=t==="hail"?.3:.1,m=hA();return d.useEffect(()=>{r(!0)},[]),!n||m?null:l.jsx("div",{className:"absolute inset-0",children:Array.from({length:s}).map((p,h)=>{const g=Math.floor(Math.random()*(e-1)),y=Math.floor(Math.random()*(i-a+1))+a,x=Math.floor(Math.random()*(c+1)),v=Math.random()*(u-f)+f,b=Math.floor(Math.random()*o)+1,_=t==="hail"?y:1;return l.jsx("div",{className:"absolute inset-y-0",style:{left:g},children:l.jsx("div",{style:{opacity:v,animationDuration:o+x+"ms",animationDelay:-b+"ms",animationTimingFunction:"linear"},className:"animation-weather-rain absolute inset-y-0 will-change-transform",children:l.jsx("div",{style:{width:_,height:y,opacity:v,maskImage:t!=="hail"?"linear-gradient(to bottom, transparent, black, transparent)":void 0},className:"absolute transform-gpu rounded-full bg-white"})})},h)})})});Oy.displayName="Rain";const aM=d.memo(({width:e,height:t,variant:n})=>{const[r,s]=d.useState(!1),o=n==="normal"?50:80,a=n==="normal"?2e3:1e3,i=1,c=8,u=n==="normal"?1500:800,f=.5,m=.1,p=2,h=hA();return d.useEffect(()=>{s(!0)},[]),!r||h?null:l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("div",{className:z("absolute inset-x-0 bottom-0 translate-y-[80%] bg-white opacity-20 blur-sm",{"rounded-m blur-xs -left-xl -right-xl h-lg":n==="heavy"},{"h-md rounded-[50%]":n==="normal"})}),l.jsx(kt,{children:Array.from({length:o}).map((g,y)=>{const x=Math.floor(Math.random()*(e-1)),v=Math.floor(Math.random()*(c-i+1))+i,b=Math.floor(Math.random()*(u+1)),_=Math.floor(Math.random()*p)+1,w=Math.random()*(f-m)+m,S=Math.floor(Math.random()*a)+1;return l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:3},style:{left:x,top:0,height:t},className:"absolute",children:l.jsx("div",{style:{animationDuration:a+b+"ms",animationTimingFunction:"linear",animationDelay:-S+"ms",opacity:w},className:"absolute rounded-full bg-white animation-weather-snow",children:l.jsx("div",{style:{width:v,height:v,animationDuration:"inherit",maskImage:"radial-gradient(black 20%, transparent)"},className:z("absolute rounded-full bg-white",_===1&&"animation-weather-snow-wave")})})},y)})})]})});aM.displayName="Snow";const ide=d.memo(({width:e,height:t,context:n})=>{const[r,s]=d.useState(!1),o=70,a=2,i=1,c=2,u=500,f=1e3,m=.5,p=.2,h=hA();return d.useEffect(()=>{s(!0)},[]),!r||h?null:l.jsxs("div",{className:"absolute inset-0",children:[l.jsx(kt,{children:Array.from({length:o}).map((g,y)=>{const x=Math.floor(Math.random()*(e-1)),v=Math.floor(Math.random()*(t-1)),b=Math.floor(Math.random()*(a-i+1))+i,_=Math.floor(Math.random()*c)+1,w=Math.floor(Math.random()*(u+1)),S=Math.floor(Math.random()*(f+1)),C=Math.random()*(m-p)+p;return l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:3},style:{left:x,top:v},className:"absolute",children:l.jsx("div",{style:{width:b,height:b,animationDuration:5e3+w+"ms",animationDelay:S+"ms",opacity:C},className:z("absolute rounded-full bg-white",{"animation-weather-star-twinkle":_===1})})},y)})}),l.jsx("div",{className:z("w-lg absolute left-0 h-px bg-white","animation-weather-star-shoot",{"context-ntp":n==="ntp"})})]})});ide.displayName="Stars";const g1t=["clear-day","clear-night","partly-cloudy-day","partly-cloudy-night","cloudy-day","cloudy-night","patchy-rain-possible-day","patchy-rain-possible-night","possible-thunder-day","possible-thunder-night","overcast","fog","snow","sleet","patchy-freezing-drizzle","heavy-snow","blizzard","drizzle","hail","light-shower","heavy-rain","lightning-rain","lightning-snow"],lde=T.memo(({variant:e,context:t,className:n})=>{const r=d.useCallback(h=>{switch(h){case"clear-day":default:return["#FF813A","#FFC700","#1F84CD"];case"partly-cloudy-day":return["#8E8E8E","#D5D5D5","#1F84CD"];case"partly-cloudy-night":return["#8E8E8E","#6A6A6A","#0B1B39"];case"cloudy-day":case"overcast":case"patchy-rain-possible-day":case"patchy-freezing-drizzle":case"drizzle":case"light-shower":case"heavy-rain":case"blizzard":case"heavy-snow":case"sleet":case"snow":case"fog":case"possible-thunder-day":case"hail":case"lightning-rain":case"lightning-snow":return["#B8B8B8","#8791AB","#486289"];case"cloudy-night":case"possible-thunder-night":case"patchy-rain-possible-night":return["#222938","#3E475A","#1B2230"];case"clear-night":return["#44344A","#091937","#091937"]}},[]),s=d.useCallback(h=>{switch(h){default:return null;case"partly-cloudy-night":case"cloudy-night":case"possible-thunder-night":case"clear-night":return"stars";case"light-shower":case"sleet":case"drizzle":case"patchy-rain-possible-night":case"patchy-rain-possible-day":case"patchy-freezing-drizzle":case"lightning-rain":return"rain";case"hail":return"rain-hail";case"heavy-rain":return"rain-heavy";case"snow":return"snow";case"heavy-snow":case"blizzard":case"lightning-snow":return"snow-heavy"}},[]),o=r(e),[a,i,c]=o,[u,{width:f,height:m}]=ei(),p=t==="ntp"?null:s(e);return l.jsxs("div",{style:{backgroundColor:c},className:z("absolute inset-0 overflow-hidden rounded-xl shadow-md",n),children:[l.jsx("div",{className:"-inset-xl absolute translate-y-1/4 rounded-[50%] opacity-75",style:{backgroundColor:i}}),l.jsx("div",{className:"-inset-xl absolute translate-y-[60%] rounded-[50%] opacity-75",style:{backgroundColor:a}}),l.jsx("div",{className:"rounded-inherit absolute inset-0 overflow-hidden",style:{backdropFilter:"blur(40px)",WebkitBackdropFilter:"blur(40px)"}}),l.jsx("div",{className:"absolute inset-0",ref:u,children:p==="stars"?l.jsx(ide,{height:m,width:f,context:t}):p==="rain"?l.jsx(Oy,{height:m,width:f,variant:"normal"}):p==="rain-heavy"?l.jsx(Oy,{height:m,width:f,variant:"heavy"}):p==="snow"?l.jsx(aM,{height:m,width:f,variant:"normal"}):p==="snow-heavy"?l.jsx(aM,{height:m,width:f,variant:"heavy"}):p==="rain-hail"?l.jsx(Oy,{height:m,width:f,variant:"hail"}):null}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-transparent"})]})});lde.displayName="WeatherGradient";const nU={"clear-day":iV,"clear-night":Vpe,"partly-cloudy-day":I7,"partly-cloudy-night":j7,"cloudy-day":I7,"cloudy-night":j7,"patchy-rain-possible-day":Upe,"patchy-rain-possible-night":Bpe,"possible-thunder-day":Fpe,"possible-thunder-night":Lpe,overcast:Ope,fog:Ppe,snow:Ipe,sleet:jpe,"patchy-freezing-drizzle":Dpe,"heavy-snow":Rpe,blizzard:Npe,drizzle:Ape,hail:Tpe,"light-shower":Mpe,"heavy-rain":kpe,"lightning-rain":D7,"lightning-snow":D7},y1t=Se(async()=>{const{HourlyTemperature:e}=await Ee(()=>q(()=>import("./HourlyTemperature-tAkrBajN.js"),__vite__mapDeps([467,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx("div",{style:{height:h1t}})}),cde=T.memo(e=>{const{$t:t}=J(),{prefersMetric:n,setPrefersMetric:r}=p1t(),s=n,[o,a]=d.useState(0),[i,c]=d.useState(!1),u=e,{menuItems:f}=im(),{openModal:m}=gn().legacy,{permissionState:p}=nW(),{submitQuery:h}=Wo(),{session:g}=je(),{trackEvent:y}=Ke(g),{locale:x}=J(),{value:v}=Wge({flag:"weather-provider",defaultValue:"weatherapi",subjectType:"visitor_id"}),b=d.useCallback(()=>{y("precise location modal opened",{origin:"weather_widget"}),m("locationPermissionModal",{onPermissionGranted:A=>{c(!1);const D=fa();h({rawQuery:"weather",copilotOverride:!1,attachments:[],collection:null,newFrontendContextUUID:D,promptSource:"device_location_request",querySource:"device_location_request",deviceLocation:{latitude:A.coords.latitude,longitude:A.coords.longitude},shouldRedirectToBackendUUID:!0})},origin:"weather_widget"})},[y,m,h]);d.useEffect(()=>{p!==void 0&&p!=="granted"&&c(!0)},[p]);const _=d.useCallback(()=>{window.open(u.url||"https://www.accuweather.com/","_blank")},[u.url]);if(!u||!u.current||!u.location)return null;const{current:w,location:S,forecast:C}=u,E=C[0],N=w.condition?.icon,k=hme(g1t,N)?nU[N]:iV,I="col-span-1",M=o===0?w.condition?.icon||"clear-day":C[o]?.icon||"clear-day";return l.jsx(Es,{widgetType:"weather",widgetName:"weather_forecast",widgetSize:"full",children:l.jsxs(K,{className:"p-md relative select-none",children:[l.jsx(kt,{initial:!1,mode:"popLayout",children:l.jsx(Te.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.3,delay:.3,ease:$a}},transition:{opacity:{duration:.2,ease:$a}},children:l.jsx(lde,{variant:M})},M)}),l.jsxs(K,{className:"gap-md relative flex flex-col drop-shadow-sm",children:[l.jsxs("div",{className:"gap-x-xl flex",children:[l.jsx(K,{className:I,children:l.jsx("div",{className:"flex h-full items-center",children:l.jsxs(V,{className:"gap-x-md flex items-center",color:"white",children:[l.jsx(ge,{icon:k,size:40,className:"-mt-xs -ml-two"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"font-mono text-4xl",children:l.jsx(jp,{value:s?w.temp_c??0:w.temp_f??0,suffix:"°"})}),l.jsxs("div",{className:"ml-xs mt-two flex gap-px",children:[l.jsx("button",{onClick:()=>r(!1),className:"cursor-pointer appearance-none",children:l.jsx(V,{color:"white",className:s?"opacity-60":void 0,children:l.jsx("div",{className:"font-mono",children:"F"})})}),l.jsx("button",{onClick:()=>r(!0),className:"ml-xs cursor-pointer appearance-none",children:l.jsx(V,{color:"white",className:s?void 0:"opacity-60",children:l.jsx("div",{className:"font-mono",children:"C"})})})]})]})]})})}),l.jsxs(K,{className:I,children:[w.condition&&l.jsx(V,{variant:"section-title",className:"mb-1 leading-tight",color:"white",children:w.condition.text}),l.jsxs("div",{className:"gap-x-xs flex",children:[l.jsx(V,{variant:"smallCaps",color:"white",children:l.jsx(jp,{value:s?E?.maxtemp_c??0:E?.maxtemp_f??0,suffix:"°"})}),l.jsx(V,{variant:"smallCaps",className:"flex opacity-70",color:"white",children:l.jsx(jp,{value:s?E?.mintemp_c??0:E?.mintemp_f??0,suffix:"°"})})]})]})]}),l.jsxs("div",{className:"gap-sm flex",children:[l.jsxs(K,{className:"flex flex-col items-start justify-center",children:[l.jsx("div",{className:"gap-sm relative flex items-center",children:l.jsxs(ya,{className:"gap-xs text-xs text-white",children:[l.jsx(Vn,{id:"location-name",children:l.jsxs(V,{variant:"smallBold",className:"text-right",color:"white",children:[S.name,S.is_usa?S.region?`, ${S.region}`:"":`, ${S.country}`]})}),i&&l.jsx(Vn,{id:"precise",children:l.jsx(rt,{onClick:b,size:"small",extraCSS:"!text-white hover:underline hover:opacity-100 !p-0 !h-0 decoration-white/50 decoration-offset-[4px] opacity-70 !font-normal",pill:!0,variant:"noBackground",text:t({defaultMessage:"Use precise location",id:"Si49wMl5CP"})})})]})}),S.localtime&&l.jsx(V,{variant:"tinyRegular",color:"white",className:"opacity-75",children:qbe(S.localtime,x)})]}),f&&f?.length>0&&l.jsx("div",{className:"absolute right-0 top-0",children:l.jsx(Un.Menu,{buttonClass:"!text-white opacity-40 hover:opacity-100 hover:!bg-white/10",menuItems:f})})]})]}),l.jsx(K,{className:"mt-xl relative grid grid-cols-3 gap-x-4 gap-y-6 drop-shadow-sm md:grid-cols-6",children:C.map((A,D)=>l.jsx("button",{onClick:()=>a(D),className:D!==o?"duration-150 hover:opacity-70 active:scale-[0.98]":"",children:l.jsx(ade,{day:Kbe(A.dow??"",x),high:(s?A.maxtemp_c:A.maxtemp_f)??0,low:(s?A.mintemp_c:A.mintemp_f)??0,icon:nU[A.icon],selected:o===D})},D))}),l.jsx(K,{className:"mt-sm",children:l.jsx(y1t,{forecast:C,activeDay:o,isMetric:s})}),v==="accuweather"&&l.jsx(K,{className:"mt-lg flex cursor-pointer justify-end",onClick:_,children:l.jsxs(V,{variant:"micro",color:"white",className:"mt-xs gap-xs -mb-sm -mr-xs flex items-center opacity-65 hover:opacity-40",children:["The AccuWeather",l.jsx("sup",{className:"-ml-xs",children:"®"})," Forecast",l.jsx(ge,{icon:B("arrow-up-right"),size:"xs"})]})})]})})});cde.displayName="WeatherWidget";const rU=()=>{const{removeWidgetFromEntry:e}=cv({reason:"remove-widget"}),{$t:t}=J(),{isMobileStyle:n}=Re(),{result:r}=Ot(),{session:s}=je(),{trackEvent:o}=Ke(s),[a,i]=d.useState(!1),{openToast:c}=pn(),u=d.useCallback(()=>{if(r?.backend_uuid){const p="pplx://finance_widget";e({entryUUID:r.backend_uuid,data:{url:p,widget_type:"finance_widget",is_widget:!0}}),c({message:t({defaultMessage:"Thanks for your feedback!",id:"coh2h6fh1P"}),variant:"success",timeout:2}),o("remove widget",{url:p,entryUUID:r.backend_uuid,source:"thread"}),i(!1)}},[r?.backend_uuid,e,o,t,c]),f=d.useMemo(()=>[{type:"default",text:t({defaultMessage:"Report",id:"x5Tz6MZH82"}),icon:B("thumb-down"),onClick:()=>i(!0)}],[t]),m=d.useMemo(()=>[{text:"Cancel",variant:"common",onClick:()=>i(!1)},{text:"Report",variant:"rejected",onClick:u}],[u]);return l.jsxs(l.Fragment,{children:[l.jsx(Ws,{items:f,isMobileStyle:n,wrapperClassName:"inline-flex",children:l.jsx(rt,{size:"small",icon:B("dots")})}),l.jsx(po,{isOpen:a,onClose:()=>i(!1),title:t({defaultMessage:"Report Widget",id:"8bkBtXioXd"}),actionList:m,children:l.jsx("div",{className:"space-y-md",children:l.jsx(V,{variant:"base",children:t({defaultMessage:"Report this widget for being inaccurate or irrelevant. This helps improve the product for everyone.",id:"bUe9nPbALv"})})})})]})},ude=T.memo(({isFollowed:e,toggleFollow:t,iconOnly:n=!1,size:r="small",selectedButtonClassName:s,unselectedButtonClassName:o,tooltip:a,variant:i})=>{const c=J(),{isMobileStyle:u}=Re();return l.jsx(kt,{mode:"wait",children:e?l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Yr},children:l.jsx(ze,{variant:i??"primaryGhost",pill:!0,size:r,text:u||n?void 0:c.formatMessage({defaultMessage:"Following",id:"cPIKU2QdyN"}),onClick:t,extraCSS:s,toolTip:a,icon:B("star-filled")})},"confirmed"):l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Yr},children:l.jsx(ze,{pill:!0,variant:i,icon:B("plus"),size:r,text:u||n?void 0:c.formatMessage({defaultMessage:"Follow",id:"ieGrWod3CN"}),onClick:t,extraCSS:o,toolTip:a})},"follow")})});ude.displayName="FollowButton";const x1t=be.makeEphemeralQueryKey("homepage-widgets");be.makeEphemeralQueryKey("homepage/weather");const v1t=({watchlistType:e,identifier:t,category:n,modalOrigin:r,loginPrompt:s,reason:o})=>{const{$t:a}=J(),i=Xt(),c=Vt(),{openModal:u}=gn().legacy,[f,m]=d.useState(!1),[p,h]=d.useState(!1),{data:g,isLoading:y}=lqe({watchlistType:e,reason:o}),{mutate:x}=cqe({watchlistType:e,queryClient:i,reason:o}),{mutate:v}=uqe({watchlistType:e,queryClient:i,reason:o}),b=d.useMemo(()=>{const w=S=>{const C=S.identifier===t;return n?C&&S.categories?.includes(n):C};return!!g?.some(w)},[g,t,n]),_=d.useCallback(w=>{const{invalidateOnSuccess:S=!0}=w??{};if(m(!1),h(!1),!c){a({defaultMessage:"Sign in to follow your interests",id:"ebRSvhaBXI"}),u("loginModal",{pitchMessage:{title:s},origin:r});return}b?(v({identifier:t}),h(!0)):(x({identifier:t}),m(!0)),S&&i.invalidateQueries({queryKey:x1t})},[a,x,t,b,c,s,r,u,i,v]);return d.useMemo(()=>({isFollowed:b,toggleFollow:_,showFollowToast:f,showUnfollowToast:p,setShowFollowToast:m,setShowUnfollowToast:h,isLoadingSubscriptions:y}),[b,y,f,p,_])},iM=T.memo(({message:e,isVisible:t=!1,timeout:n,onSettingsClick:r,onTimeout:s=Ro,icon:o,...a})=>{const[i,c]=d.useState(t),u=d.useRef(null),{$t:f}=J();d.useEffect(()=>{c(t)},[t]);const m=d.useCallback(()=>{u.current&&clearTimeout(u.current)},[]),p=d.useCallback(g=>{g?.stopPropagation(),c(!1),s(),m()},[s,m]),h=n!=null&&n>0;return d.useEffect(()=>(t&&h&&(u.current=setTimeout(()=>{p()},n*1e3)),()=>{m()}),[i,n,t,s,p,m,h]),l.jsx(Jl,{children:l.jsx(kt,{children:i&&l.jsx(Te.div,{className:"right-toastHMargin top-toastVMargin fixed z-30 flex items-center justify-center",initial:{opacity:0,x:6},animate:{opacity:1,x:0},exit:{opacity:0,x:6},transition:Rr,...a,children:l.jsxs(K,{variant:"raised",className:"shadow-subtle gap-sm flex items-stretch rounded-xl border pl-[12px] dark:shadow-[0_4px_12px_rgba(0,0,0,0.5)]",children:[o&&l.jsx("div",{className:"p-sm bg-subtler dark:bg-subtle my-[12px] flex aspect-square items-center justify-center rounded-md",children:l.jsx(ge,{icon:o,className:"text-quiet",size:"md"})}),l.jsxs("div",{className:"flex flex-1 flex-row items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"default",className:"pl-sm max-w-[200px] shrink-0 pr-[12px]",children:e}),l.jsxs(K,{className:"flex h-full flex-col items-stretch justify-center border-l",children:[l.jsx(rt,{size:"tiny",variant:"noHover",text:f({defaultMessage:"Settings",id:"D3idYvSLF9"}),onClick:r,extraCSS:"!px-[12px] flex-1 hover:opacity-60"}),l.jsx(K,{className:"border-t"}),l.jsx(rt,{size:"tiny",variant:"noHover",text:f({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:p,extraCSS:"!px-[12px] flex-1 hover:opacity-60"})]})]})]})},"toast")})})});iM.displayName="FollowConfirmationToast";const b1t=({followed:e,toggleFollow:t,isLoading:n})=>n?null:l.jsx(ude,{isFollowed:e,toggleFollow:t,size:"small",variant:e?"primaryGhost":"border"}),dde=T.memo(({symbol:e,button:t,onFollowToastTimeout:n})=>{const r="finance-watch-entity",{inApp:s}=Ea(),{$t:o}=J(),{isFollowed:a,toggleFollow:i,showFollowToast:c,showUnfollowToast:u,setShowFollowToast:f,setShowUnfollowToast:m,isLoadingSubscriptions:p}=v1t({watchlistType:"FINANCE",identifier:e,modalOrigin:lt.FINANCE_WATCHLIST,loginPrompt:"Sign in to manage your data",reason:r}),h=t||b1t,{openModal:g}=gn().legacy,y=d.useCallback(()=>{f(!1),n?.()},[n,f]),x=d.useCallback(()=>m(!1),[m]),v=d.useCallback(()=>{g("watchlistModal",{watchlistType:"FINANCE",origin:"toast"}),f(!1)},[g,f]),b=d.useCallback(()=>{g("watchlistModal",{watchlistType:"FINANCE",origin:"toast"}),m(!1)},[g,m]);return l.jsxs(l.Fragment,{children:[l.jsx(iM,{message:o({defaultMessage:"Added {symbol} to your watchlist",id:"KBhWJYPNym"},{symbol:e}),isVisible:c,timeout:5,onTimeout:y,onSettingsClick:v,icon:B("star")}),l.jsx(iM,{message:o({defaultMessage:"Removed {symbol} from your watchlist",id:"q+PA0pNibu"},{symbol:e}),isVisible:u,onSettingsClick:b,timeout:5,onTimeout:x,icon:B("star-off")}),!s&&l.jsx(h,{isLoading:p,followed:a,toggleFollow:i})]})});dde.displayName="FinanceWatchEntity";const _1t=({followed:e,toggleFollow:t,isLoading:n})=>{const{isMobileStyle:r}=Re();return n?null:r?l.jsx(Ct,{icon:e?B("star-filled"):B("star"),size:"small",variant:"text",onClick:t,"aria-label":e?"Following":"Follow"}):l.jsx(Ct,{leadingIcon:e?B("star-filled"):B("star"),size:"small",variant:"text",onClick:t,children:e?"Following":"Follow"})},x0=()=>{const{firstResult:e}=an(),t=e?.status,n=e?.privacy_state,r=el(),{isIncognitoLocal:s}=J4();return d.useMemo(()=>{if(!t)return!1;const o=!!n&&(s&&n!==QS.INCOGNITO||!s&&n===QS.INCOGNITO);return!r&&t!==Pr.PENDING||o},[s,n,r,t])},w1t={variant:"secondary",size:"small"},fde=({quote:e})=>{const{session:t}=je(),{trackEvent:n}=Ke(t),r=d.useCallback(()=>{n("finance link clicked",{referrer:Cb.SEARCH_WIDGET,targetPageType:Jg.ASSET_PAGE,symbol:e.symbol,destinationUrl:`/finance/${e.symbol}`})},[n,e.symbol]);return e?l.jsx(xt,{href:`/finance/${e.symbol}`,className:"gap-md hover:bg-subtler p-sm -m-sm flex cursor-pointer items-center rounded-md transition-all active:scale-95 min-w-0 flex-1",onClick:r,children:l.jsxs(K,{className:"gap-sm flex items-center min-w-0 flex-1",children:[l.jsx(Xg,{symbol:e.symbol,src:e.image??"",srcDark:e.imageDark??"",className:"shrink-0"}),l.jsxs(K,{className:"min-w-0 flex-1",children:[l.jsx(K,{className:"gap-sm flex items-center min-w-0",children:l.jsx(LN,{name:e.name})}),l.jsx(V,{variant:"tinyMono",color:"light",className:"truncate",children:l.jsx(e0,{symbol:e.symbol,exchange:e.exchange,country:e.exchangeCountry})})]})]})}):null},C1t=({quotes:e})=>l.jsx(K,{className:"scrollbar-none overflow-x-auto flex-1 min-w-0",children:l.jsx(K,{className:"gap-md p-sm flex items-center min-w-0",children:e.map(t=>l.jsx(fde,{quote:t},t.symbol))})}),sU=({href:e,symbol:t})=>{const{isMobileStyle:n}=Re(),{$t:r}=J(),{session:s}=je(),{trackEvent:o}=Ke(s),a=d.useCallback(()=>{o("finance link clicked",{referrer:Cb.SEARCH_WIDGET,targetPageType:Jg.ASSET_PAGE,symbol:t,destinationUrl:e})},[o,t,e]);return l.jsx(K,{className:"gap-sm flex items-center justify-center",children:l.jsx(ze,{variant:"primaryGhost",chevron:!0,chevronIcon:B("chevron-right"),text:r({defaultMessage:"Deep Dive on {pplxFinance}",id:"QX457HdJyA"},{pplxFinance:"Perplexity Finance"}),size:"small",href:e,onClick:a,fullWidth:n})})},oU=({children:e})=>l.jsx(K,{className:"gap-sm shadow-subtle flex flex-col rounded-xl border",variant:"background",children:e}),mde=T.memo(({quotes:e})=>{const t=e[0],n=d.useMemo(()=>e.slice(1).map(o=>o.symbol),[e]),r=x0();if(!t)return null;const s=t.symbol;return n?.length?l.jsxs(oU,{children:[l.jsxs("div",{className:"gap-sm p-sm flex items-center justify-between",children:[l.jsx(C1t,{quotes:e}),l.jsx(K,{className:"gap-xs flex items-center shrink-0",children:!r&&l.jsx(rU,{})})]}),l.jsx(wB,{symbol:s,comparisons:n,chartHeight:l0,context:"thread"}),l.jsx(K,{className:"px-sm pb-sm",children:l.jsx(sU,{href:`/finance/${t?.symbol}?comparing=${n.join(",")}`,symbol:s})})]}):l.jsxs(oU,{children:[l.jsxs(K,{className:"p-sm flex items-start justify-between gap-sm min-w-0",children:[l.jsx("div",{className:"flex min-w-0 flex-1",children:l.jsx(fde,{quote:t})}),l.jsxs(K,{className:"gap-xs flex items-center shrink-0",children:[!r&&l.jsx(rU,{}),l.jsx(dde,{symbol:s,button:_1t}),l.jsx(ON,{symbol:s,buttonProps:w1t})]})]}),l.jsx(wB,{symbol:s,initialQuote:t,chartHeight:225,zoomable:!1,context:"thread"}),l.jsx(K,{className:"px-sm pb-sm",children:l.jsx(sU,{href:`/finance/${t?.symbol}`,symbol:s})})]})});mde.displayName="FinanceThreadStockWidget";const aU=new Set,J8=T.memo(({data:e})=>{const{result:{backend_uuid:t,mode:n}}=Ot(),r=Mg(),s=Z4();return d.useEffect(()=>{const o=e.data?.length||e.data_v2?.length;!t||!o||aU.has(t)||(r("web.frontend.finance_widgets_render_time",{widgetType:"finance",widgetName:e.data_v2?.length?"stock_v2":"stock_v1",queryMode:n,widgetSize:"full"}),aU.add(t))},[e.data,e.data_v2,t,n,r,s]),e.data_v2?.length?l.jsx(Ar,{fallback:null,onError:o=>Z.error("FinanceWidget failed to render",{cause:o}),children:l.jsx(Es,{widgetType:"finance",widgetName:"stock_v2",widgetSize:"full",children:l.jsx(mde,{quotes:e.data_v2})})}):null});J8.displayName="FinanceWidget";const S1t=()=>null,E1t=Se(()=>Ee(()=>q(()=>import("./index-BeHSIIJJ.js"),__vite__mapDeps([468,4,1,6,3,9,7,8,10,11,12]))),{loading:()=>l.jsx(S1t,{})}),pde=T.memo(({widgetData:e,menuItems:t,tableCitationOffset:n})=>{const r=jv(e);return r?Vi(r).with({object:"CalculatorWidget"},s=>l.jsx(Un,{menuItems:t,children:l.jsx(aae,{...s})})).with({object:"FinanceWidget"},s=>l.jsx(Un,{menuItems:t,variant:"noChrome",children:l.jsx(J8,{data:s})})).with({object:"CrunchbaseWidget"},s=>l.jsx(Un,{menuItems:t,variant:"noChrome",children:l.jsx(E1t,{...s})})).with({object:"PlaceWidget"},()=>null).with({object:"ShopifyWidget"},()=>null).with({object:"JobsWidget"},()=>null).with({object:"TimeWidget"},s=>l.jsx(Un,{menuItems:t,children:l.jsx(sde,{...s})})).with({object:"TimerWidget"},s=>l.jsx(Un,{menuItems:t,children:l.jsx(ode,{...s})})).with({object:"CurrencyExchangeWidget"},s=>l.jsx(Un,{menuItems:t,className:"overflow-hidden !p-0",variant:"noChrome",children:l.jsx(Nce,{...s})})).with({object:"PredictionMarketWidget"},s=>l.jsx(qce,{...s})).with({object:"WeatherWidget"},s=>l.jsx(Un,{menuItems:t,variant:"noChrome",children:l.jsx(cde,{...s})})).with({object:"TableWidget"},s=>l.jsx(Un,{menuItems:t,variant:"noChrome",children:l.jsx(ede,{tableData:s,citationOffset:n??0})})).with({object:"SportsEventsWidget"},s=>l.jsx(fp,{data:s})).with({object:"SportsIndvScheduleWidget"},s=>l.jsx(fp,{data:s})).with({object:"SportsStandingsWidget"},s=>l.jsx(fp,{data:s})).with({object:"SportsIndvEventsWidget"},s=>l.jsx(fp,{data:s})).with({object:"FlightStatusWidget"},s=>l.jsx(Oce,{data:s})).with({object:"PriceComparisonWidget"},s=>l.jsx(jrt,{block:s})).with({object:"TaskWidget"},s=>l.jsx(rde,{data:s})).with({object:"GenericFallbackWidget"},s=>l.jsx(Lce,{...s})).otherwise(()=>(Z.warn(new Error(`No PanelComponent found for livePanelType: ${r.object}`),{widgetData:e}),null)):null});pde.displayName="LivePanel";const hde=T.memo(({name:e,title:t,values:n,onEntityClick:r})=>{const{inFlight:s}=an(),o=d.useCallback(c=>{s||r(c)},[s,r]),a=z("underline-offset-2 cursor-pointer decoration-subtler hover:text-super hover:decoration-super group transition-colors duration-200 ease-in-out",{underline:!s}),i=d.useCallback(({content:c,href:u})=>{const f=u||(c.startsWith("http://")||c.startsWith("https://")?c:`https://${c}`);return l.jsxs(xt,{href:f,target:"_blank",rel:"noopener",className:a,children:[c,l.jsx(V,{className:"ml-xs inline",color:"light",variant:"tiny",children:l.jsx(ge,{icon:B("external-link"),size:"xs"})})]})},[a]);return l.jsx(Un.Item,{name:e,title:t,value:n.map((c,u)=>l.jsx(gde,{attributeValue:c,index:u,totalValues:n.length,entityStyling:a,handleEntityClick:o,renderLink:i},`${c.id}-${u}`))},e)});hde.displayName="WikiPanelItem";const gde=T.memo(({attributeValue:e,index:t,totalValues:n,entityStyling:r,handleEntityClick:s,renderLink:o})=>{const a=d.useMemo(()=>()=>l.jsx("div",{children:e.value}),[e.value]),i=d.useCallback(()=>s(e.value),[e.value,s]),c=d.useMemo(()=>l.jsxs(Ar,{fallback:a,children:[e.value&&l.jsx(l.Fragment,{children:e.clickable_entity?l.jsx("span",{className:r,onClick:i,children:e.value}):e.value}),e.detail&&l.jsxs("span",{className:"text-quiet ml-1",children:["(",e.source?o({content:e.detail,href:e.source}):e.detail,")"]})]}),[e.clickable_entity,e.detail,e.source,e.value,r,a,i,o]);return l.jsxs("span",{children:[c,t{const{$t:s}=J(),{title:o,subtitle:a,attributes:i,image_url:c,source_url:u}=e,{session:f}=je(),{trackEvent:m}=Ke(f),{firstResult:p}=an(),h=p?.frontend_context_uuid,g=Dn(),y=i.length,[x,v]=d.useState(y),b=x===y,_=i.length>2,{menuItems:w}=im(),S=d.useCallback(()=>{m("click toggle on knowledge card",{newState:b?"collapsed":"expanded",entryUUID:r??"",type:e.type,id:e.source_url,name:e.title}),v(M=>M===iU?y:iU)},[m,b,y,r,e]),[C,{height:E}]=ei(),N=t,k=fa(),I=d.useCallback(M=>{if(m("knowledge card link clicked",{entryUUID:r??"",type:e.type,id:e.source_url,name:e.title,label:"attributes",value:M}),n({fork:N,rawQuery:M,collection:null,newFrontendContextUUID:N?k:null,existingFrontendContextUUID:N?void 0:h,promptSource:"user",querySource:"entity_link"}),N){const A=new URLSearchParams({q:M,newFrontendContextUUID:k}),D=new URL(window.location.href);D.pathname="search/new",D.search=A.toString();const P=D.toString();g.push(P)}},[n,N,k,h,g,r,e,m]);return d.useEffect(()=>{m("knowledge card shown",{entryUUID:r??"",type:e.type,id:e.source_url,name:e.title})},[]),l.jsx("div",{className:"relative",children:l.jsx(Te.div,{animate:E>0?{height:E}:{},transition:{type:"spring",bounce:.2,duration:.2},className:"overflow-hidden",children:l.jsxs("div",{ref:C,className:"gap-md relative flex flex-col",children:[l.jsx("div",{className:"flex items-end justify-between",children:l.jsx(Un.Title,{title:o,subtitle:a,image_url:c,href:u,links:e.links,entryUUID:r??"",data:e,children:l.jsx("div",{className:"flex items-start",children:l.jsx("div",{className:"gap-sm flex items-center",children:w&&w?.length>0&&l.jsx(Un.Menu,{menuItems:w,buttonClass:"opacity-0 pointer-events-none"})})})})}),b&&l.jsx("div",{className:"gap-sm border-subtlest pt-md md:gap-x-md grid grid-cols-[auto,1fr] border-t",children:i.slice(0,x).map(M=>l.jsx(hde,{name:M.key,title:M.title,values:M.values,onEntityClick:I},M.key))}),l.jsx("div",{children:_&&l.jsx("div",{className:"flex justify-end",children:l.jsx(ze,{variant:"border",fullWidth:!0,text:s(b?{defaultMessage:"Less",id:"mFYgAXM/x4"}:{defaultMessage:"More",id:"I5NMJ8llIi"}),size:"tiny",pill:!0,onClick:S,icon:b?B("chevron-up"):B("chevron-down"),extraCSS:"pl-xs w-[76px]"})})})]})})})});yde.displayName="WikiPanel";function k1t(e){if(!e||!e.card_type)return null;const{primaryLink:t,otherLinks:n}=e.links.reduce((s,o)=>(o.type==="PRIMARY"&&!s.primaryLink?s.primaryLink=o:s.otherLinks.push(o),s),{primaryLink:null,otherLinks:[]}),r=e?.media_items?.[0]?.image??e?.image_urls?.[0]??"";return{source_url:t?.url??"",image_url:r,title:e?.title??"",subtitle:e.description??"",attributes:e.attributes??[],type:e.card_type,links:n}}const xde=T.memo(({knowledgePanelData:e,isReadonly:t,submit:n,menuItems:r,entryUUID:s,className:o})=>{const a=d.useMemo(()=>e?k1t(e):null,[e]);return a?l.jsx(Un,{menuItems:r,className:o,children:l.jsx(yde,{data:a,submit:n,isReadonly:t,entryUUID:s??""})}):null});xde.displayName="StaticPanel";const e7=T.memo(({data:e,submit:t,isReadonly:n=!1,menuItems:r,tableCitationOffset:s,entryUUID:o})=>l.jsxs(l.Fragment,{children:[!H9(e)&&F3(e)&&l.jsx(pde,{widgetData:e,menuItems:r??Ie,tableCitationOffset:s}),CMe(e)&&l.jsx(xde,{knowledgePanelData:e,summaryData:null,submit:t,isReadonly:n,menuItems:r??Ie,entryUUID:o??""}),H9(e)&&l.jsx(Ooe,{graphData:e})]}));e7.displayName="ThreadEntryPanel";const vde=T.memo(({taskWidgetData:e,submitQuery:t})=>{const{result:n,isEntryInFlight:r}=Ot(),s={name:"task-widget",snippet:"",timestamp:"",url:"",meta_data:e,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""};return l.jsx(e7,{data:s,submit:t,isReadonly:!1,menuItems:Ie,inFlight:r,entryUUID:n?.backend_uuid??null},"task")});vde.displayName="TaskWidget";const M1t=25,Ly="text-super",dx=T.memo(({rating:e,className:t,reviewCount:n,size:r="xs",textVariant:s="small",reviewTextVariant:o="small",reviewTextColor:a="light",variant:i,showCount:c=!0,minReviewCount:u=M1t,showRatingLabel:f=!0,ratingPosition:m="after",url:p,color:h="default"})=>{const g=Math.floor(e),y=e%1===0?0:1,x=5-g-y;if(e===0||!n||nl.jsx(ge,{icon:B("star-filled"),size:r,className:Ly},`rating-star-full-${C}`)),i!=="truncated"&&Array.from({length:y}).map((S,C)=>l.jsx(bde,{fraction:e%1,size:r},`rating-star-half-${C}`)),i!=="truncated"&&Array.from({length:x}).map((S,C)=>l.jsx("span",{className:"inline-flex opacity-20",children:l.jsx(ge,{icon:B("star-filled"),size:r,className:Ly})},`rating-star-empty-${C}`))]}),_=n&&n>0&&c&&l.jsxs(V,{variant:o,color:a,className:"group-hover/link:text-super relative leading-none",children:["(",l.jsx(R7,{value:n}),")"]}),w=l.jsxs("div",{className:z("gap-xs flex items-center",t),children:[m==="before"&&v,b,m==="after"&&v,_]});return p?l.jsx(xt,{href:p,target:"_blank",className:"group/link",children:w}):w});dx.displayName="EntityItemRating";const bde=T.memo(({fraction:e,size:t})=>l.jsxs("div",{className:"isolate inline-grid grid-cols-1 grid-rows-1",children:[l.jsx("span",{className:"text-foreground relative col-start-1 row-start-1 inline-flex items-center opacity-30",children:l.jsx("span",{className:"inline-flex",children:l.jsx(ge,{icon:B("star-filled"),size:t})})}),l.jsx("span",{className:"relative col-start-1 row-start-1 inline-flex items-center",children:l.jsx("span",{className:z(Ly,"inline-flex overflow-hidden"),style:{width:e*100+"%"},children:l.jsx(ge,{icon:B("star-filled"),size:t,className:"shrink-0"})})})]}));bde.displayName="HalfStar";const T1t=d.createContext(null);function A1t(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,s=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===s&&r===o}function Ni(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let s=null;"interactive"in r&&(s=Object.assign({},r),delete s.interactive);const o=t[r.ref];if(o){s=s||Object.assign({},r),delete s.ref;for(const a of R1t)a in o&&(s[a]=o[a])}return s||r});return{...e,layers:n}}var fU={};const mU={version:8,sources:{},layers:[]},pU={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},VS={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},hU={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},D1t=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],j1t=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class Cf{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=s=>{const o=this.props[hU[s.type]];o?o(s):s.type==="error"&&console.error(s.error)},this._onPointerEvent=s=>{(s.type==="mousemove"||s.type==="mouseout")&&this._updateHover(s);const o=this.props[pU[s.type]];o&&(this.props.interactiveLayerIds&&s.type!=="mouseover"&&s.type!=="mouseout"&&(s.features=this._hoveredFeatures||this._queryRenderedFeatures(s.point)),o(s),delete s.features)},this._onCameraEvent=s=>{if(!this._internalUpdate){const o=this.props[VS[s.type]];o&&o(s)}s.type in this._deferredEvents&&(this._deferredEvents[s.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const s=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||s||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=Cf.savedMaps.pop();if(!r)return null;const s=r.map,o=s.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);s._container=n,r.setProps({...t,styleDiffing:!1}),s.resize();const{initialViewState:a}=t;return a&&(a.bounds?s.fitBounds(a.bounds,{...a.fitBoundsOptions,duration:0}):r._updateViewState(a,!1)),s.isStyleLoaded()?s.fire("load"):s.once("styledata",()=>s.fire("load")),s._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=mU}=n,s={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||I1t()||null,container:t,style:dU(r)},o=s.initialViewState||s.viewState||s;if(Object.assign(s,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),n.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,n.gl)}const a=new this._MapClass(s);o.padding&&a.setPadding(o.padding),n.cursor&&(a.getCanvas().style.cursor=n.cursor),this._createShadowTransform(a);const i=a._render;a._render=f=>{this._inRender=!0,i.call(a,f),this._inRender=!1};const c=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{c.call(a._renderTaskQueue,f),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const u=a.fire;a.fire=this._fireEvent.bind(this,u),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),lU(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in pU)a.on(f,this._onPointerEvent);for(const f in VS)a.on(f,this._onCameraEvent);for(const f in hU)a.on(f,this._onEvent);this._map=a}recycle(){this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(),Cf.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=N1t(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,s=this._renderTransform,{zoom:o,pitch:a,bearing:i}=s,c=r.isMoving();c&&(s.cameraElevationReference="sea");const u=uU(s,{...cU(r.transform),...t});if(c&&(s.cameraElevationReference="ground"),u&&n){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=o!==s.zoom),f.rotate||(f.rotate=i!==s.bearing),f.pitch||(f.pitch=a!==s.pitch)}return c||uU(r.transform,t),u}_updateSettings(t,n){const r=this._map;let s=!1;for(const o of D1t)o in t&&!Ni(t[o],n[o])&&(s=!0,r[`set${o[0].toUpperCase()}${o.slice(1)}`]?.call(r,t[o]));return s}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=mU,styleDiffing:s=!0}=t,o={diff:s};return"localIdeographFontFamily"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(dU(r),o),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let s=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Ni(t.light,n.light)&&(s=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Ni(t.fog,n.fog)&&(s=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Ni(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(s=!0,r.setTerrain(t.terrain))),s}_updateHandlers(t,n){const r=this._map;let s=!1;for(const o of j1t){const a=t[o]??!0,i=n[o]??!0;Ni(a,i)||(s=!0,a?r[o].enable(a):r[o].disable())}return s}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:s=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,o=this._hoveredFeatures?.length>0,a=this._queryRenderedFeatures(t.point),i=a.length>0;!i&&o&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=a,i&&!o&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}_fireEvent(t,n,r){const s=this._map,o=s.transform,a=typeof n=="string"?n:n.type;return a==="move"&&this._updateViewState(this.props,!1),a in VS&&(typeof n=="object"&&(n.viewState=cU(o)),this._map.isMoving())?(s.transform=this._renderTransform,t.call(s,n,r),s.transform=o,s):(t.call(s,n,r),s)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{lU(this._renderTransform,n),t.transform=n}}}Cf.savedMaps=[];function I1t(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||fU.MapboxAccessToken}catch{}try{e=e||fU.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const P1t=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function O1t(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const s=t.transform;t.transform=e.transform;const o=t.project(r);return t.transform=s,o},unproject:r=>{const s=t.transform;t.transform=e.transform;const o=t.unproject(r);return t.transform=s,o},queryTerrainElevation:(r,s)=>{const o=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(r,s);return t.transform=o,a},queryRenderedFeatures:(r,s)=>{const o=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(r,s);return t.transform=o,a}};for(const r of L1t(t))!(r in n)&&!P1t.includes(r)&&(n[r]=t[r].bind(t));return n}function L1t(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const F1t=typeof document<"u"?d.useLayoutEffect:d.useEffect,B1t=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function U1t(e,t){for(const r of B1t)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const m_=d.createContext(null);function V1t(e,t){const n=d.useContext(T1t),[r,s]=d.useState(null),o=d.useRef(),{current:a}=d.useRef({mapLib:null,map:null});d.useEffect(()=>{const u=e.mapLib;let f=!0,m;return Promise.resolve(u||q(()=>import("./mapbox-gl-BYD-OPEL.js").then(p=>p.m),__vite__mapDeps([11,1,12]))).then(p=>{if(!f)return;if(!p)throw new Error("Invalid mapLib");const h="Map"in p?p:p.default;if(!h.Map)throw new Error("Invalid mapLib");if(U1t(h,e),!h.supported||h.supported(e))e.reuseMaps&&(m=Cf.reuse(e,o.current)),m||(m=new Cf(h.Map,e,o.current)),a.map=O1t(m),a.mapLib=h,s(m),n?.onMapMount(a.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(p=>{const{onError:h}=e;h?h({type:"error",target:null,error:p}):console.error(p)}),()=>{f=!1,m&&(n?.onMapUnmount(e.id),e.reuseMaps?m.recycle():m.destroy())}},[]),F1t(()=>{r&&r.setProps(e)}),d.useImperativeHandle(t,()=>a.map,[r]);const i=d.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return d.createElement("div",{id:e.id,ref:o,style:i},r&&d.createElement(m_.Provider,{value:a},d.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const H1t=d.forwardRef(V1t),z1t=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Cu(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const s=t[r];Number.isFinite(s)&&!z1t.test(r)?n[r]=`${s}px`:n[r]=s}}const W1t=d.memo(d.forwardRef((e,t)=>{const{map:n,mapLib:r}=d.useContext(m_),s=d.useRef({props:e});s.current.props=e;const o=d.useMemo(()=>{let y=!1;d.Children.forEach(e.children,b=>{b&&(y=!0)});const x={...e,element:y?document.createElement("div"):null},v=new r.Marker(x);return v.setLngLat([e.longitude,e.latitude]),v.getElement().addEventListener("click",b=>{s.current.props.onClick?.({type:"click",target:v,originalEvent:b})}),v.on("dragstart",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDragStart?.(_)}),v.on("drag",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDrag?.(_)}),v.on("dragend",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDragEnd?.(_)}),v},[]);d.useEffect(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);const{longitude:a,latitude:i,offset:c,style:u,draggable:f=!1,popup:m=null,rotation:p=0,rotationAlignment:h="auto",pitchAlignment:g="auto"}=e;return d.useEffect(()=>{Cu(o.getElement(),u)},[u]),d.useImperativeHandle(t,()=>o,[]),(o.getLngLat().lng!==a||o.getLngLat().lat!==i)&&o.setLngLat([a,i]),c&&!A1t(o.getOffset(),c)&&o.setOffset(c),o.isDraggable()!==f&&o.setDraggable(f),o.getRotation()!==p&&o.setRotation(p),o.getRotationAlignment()!==h&&o.setRotationAlignment(h),o.getPitchAlignment()!==g&&o.setPitchAlignment(g),o.getPopup()!==m&&o.setPopup(m),qh.createPortal(e.children,o.getElement())}));function gU(e){return new Set(e?e.trim().split(/\s+/):[])}d.memo(d.forwardRef((e,t)=>{const{map:n,mapLib:r}=d.useContext(m_),s=d.useMemo(()=>document.createElement("div"),[]),o=d.useRef({props:e});o.current.props=e;const a=d.useMemo(()=>{const i={...e},c=new r.Popup(i);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{o.current.props.onOpen?.(u)}),c},[]);if(d.useEffect(()=>{const i=c=>{o.current.props.onClose?.(c)};return a.on("close",i),a.setDOMContent(s).addTo(n.getMap()),()=>{a.off("close",i),a.isOpen()&&a.remove()}},[]),d.useEffect(()=>{Cu(a.getElement(),e.style)},[e.style]),d.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!Ni(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const i=gU(a.options.className),c=gU(e.className);for(const u of i)c.has(u)||a.removeClassName(u);for(const u of c)i.has(u)||a.addClassName(u);a.options.className=e.className}return qh.createPortal(e.children,s)}));function v0(e,t,n,r){const s=d.useContext(m_),o=d.useMemo(()=>e(s),[]);return d.useEffect(()=>{const a=t,i=null,c=typeof t=="function"?t:null,{map:u}=s;return u.hasControl(o)||(u.addControl(o,a?.position),i&&i(s)),()=>{c&&c(s),u.hasControl(o)&&u.removeControl(o)}},[]),o}function G1t(e){const t=v0(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return d.useEffect(()=>{Cu(t._container,e.style)},[e.style]),null}d.memo(G1t);function $1t(e){const t=v0(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return d.useEffect(()=>{Cu(t._controlContainer,e.style)},[e.style]),null}d.memo($1t);function q1t(e,t){const n=d.useRef({props:e}),r=v0(({mapLib:s})=>{const o=new s.GeolocateControl(e),a=o._setupUI.bind(o);return o._setupUI=i=>{o._container.hasChildNodes()||a(i)},o.on("geolocate",i=>{n.current.props.onGeolocate?.(i)}),o.on("error",i=>{n.current.props.onError?.(i)}),o.on("outofmaxbounds",i=>{n.current.props.onOutOfMaxBounds?.(i)}),o.on("trackuserlocationstart",i=>{n.current.props.onTrackUserLocationStart?.(i)}),o.on("trackuserlocationend",i=>{n.current.props.onTrackUserLocationEnd?.(i)}),o},{position:e.position});return n.current.props=e,d.useImperativeHandle(t,()=>r,[]),d.useEffect(()=>{Cu(r._container,e.style)},[e.style]),null}d.memo(d.forwardRef(q1t));function K1t(e){const t=v0(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return d.useEffect(()=>{Cu(t._container,e.style)},[e.style]),null}const Y1t=d.memo(K1t);function Q1t(e){const t=v0(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),n=d.useRef(e),r=n.current;n.current=e;const{style:s}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),d.useEffect(()=>{Cu(t._container,s)},[s]),null}d.memo(Q1t);const X1t=T.memo(e=>{const{$t:t}=J(),{isLoading:n,onClick:r,...s}=e;return l.jsx(K,{className:"right-sm top-sm absolute z-30 rounded-full border-2",children:l.jsx(ze,{pill:!0,size:"tiny",variant:"inverted",icon:B("current-location"),isLoading:n,text:t(n?{defaultMessage:"Searching...",id:"NNQzoiiDEK"}:{defaultMessage:"Search here",id:"Yi0/yIKDMQ"}),onClick:r,...s})})});X1t.displayName="MapSearchHereButton";const _de=T.memo(()=>l.jsx("svg",{className:"h-auto w-full",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 4635.92 708.22",children:l.jsx("path",{d:"M4806.79,746.44a25,25,0,1,0,25,25A25,25,0,0,0,4806.79,746.44Zm0,46.08a21.08,21.08,0,1,1,21.08-21.07A21.09,21.09,0,0,1,4806.79,792.52Zm8.12-25.33c0-4.55-3.25-7.25-8-7.25h-8v22.77h3.94v-8.26h4.26l4.13,8.26h4.23L4811,773.6A6.59,6.59,0,0,0,4814.91,767.19Zm-8.16,3.78h-3.87v-7.55h3.87c2.63,0,4.23,1.33,4.23,3.77S4809.38,771,4806.75,771ZM569.17,605.31a97.95,97.95,0,1,1-97.94-97.94A97.94,97.94,0,0,1,569.17,605.31Zm552.18,0a97.95,97.95,0,1,1-97.95-97.94A97.95,97.95,0,0,1,1121.35,605.31ZM1099,304.09C998.87,235.77,878,195.89,747.32,195.89a619.47,619.47,0,0,0-351,108.2H195.89l90.17,98.12a274.9,274.9,0,0,0-89.89,203.66c0,152.19,123.38,275.57,275.57,275.57A274.54,274.54,0,0,0,659,808l88.34,96.12L835.66,808a274.54,274.54,0,0,0,187.23,73.4c152.19,0,275.68-123.38,275.68-275.57a274.9,274.9,0,0,0-89.89-203.66l90.17-98.12ZM471.74,792.36c-103,0-186.49-83.49-186.49-186.49s83.5-186.49,186.49-186.49,186.5,83.49,186.5,186.49S574.74,792.36,471.74,792.36ZM747.37,600.5c0-122.73-89.26-228-207-273.06a538.15,538.15,0,0,1,413.93,0C836.62,372.49,747.37,477.78,747.37,600.5Zm462,5.37c0,103-83.5,186.49-186.49,186.49s-186.5-83.49-186.5-186.49,83.5-186.49,186.5-186.49S1209.38,502.87,1209.38,605.87Zm654.11-173.45h43.37v85.84h-50.75c-39.09,0-64.17,19.18-64.17,58.28V792.36h-92.78V432.42h92.78V492.9C1800.05,450.12,1829.56,432.42,1863.49,432.42Zm186.35-85.59a56.06,56.06,0,0,1-112.12,0c0-31.72,24.34-56.8,56.06-56.8S2049.84,315.11,2049.84,346.83Zm-102.33,85.59H2040V792.36h-92.53Zm347.35-6.08a179,179,0,0,0-109.22,36.52V432.42h-92.52V898h92.52V761.92a179,179,0,0,0,109.22,36.52c102.76,0,186-83.3,186-186.05S2397.62,426.34,2294.86,426.34Zm-8.15,287.12a101.07,101.07,0,1,1,101.07-101.07A101.07,101.07,0,0,1,2286.71,713.46Zm1890.57-34.8c0,69.4-59.54,119.78-141.57,119.78-85.12,0-144.57-51.57-144.57-125.42v-2h90.54v2c0,30.82,22,51.53,54.78,51.53,31.42,0,52.53-15.33,52.53-38.14,0-21.61-14.61-33.69-53.89-44.56l-51.71-14.1c-54.34-14.71-85.5-50.12-85.5-97.14,0-60.42,57-104.27,135.57-104.27,79.3,0,132.58,43.88,132.58,109.21v2.05h-85.3v-2.05c0-22.18-20.77-39.55-47.28-39.55-27.84,0-47.28,12.78-47.28,31.09,0,18.76,13.84,29.66,49.36,38.91l54,14.81C4162.05,600.16,4177.28,644.7,4177.28,678.66Zm-1368-215.8A179,179,0,0,0,2700,426.34c-102.76,0-186.05,83.3-186.05,186.05S2597.26,798.44,2700,798.44a179,179,0,0,0,109.22-36.52v30.44h92.52V432.42h-92.52Zm0,149.54a101.07,101.07,0,1,1-101.07-101.08A101.08,101.08,0,0,1,2809.24,612.4ZM3236,462.86a179,179,0,0,0-109.22-36.52c-102.75,0-186.05,83.3-186.05,186.05s83.3,186.05,186.05,186.05A179,179,0,0,0,3236,761.92v30.44h92.53V304.3H3236Zm-101.06,250.6A101.07,101.07,0,1,1,3236,612.39,101.07,101.07,0,0,1,3134.89,713.46Zm623.34-281h92.53V792.36h-92.53Zm102.33-85.59a56.06,56.06,0,1,1-112.12,0c0-31.72,24.34-56.8,56.06-56.8S3860.56,315.11,3860.56,346.83Zm530.71,79.51c-102.75,0-186.05,83.3-186.05,186.05s83.3,186.05,186.05,186.05,186-83.3,186-186.05S4494,426.34,4391.27,426.34Zm0,287.12a101.07,101.07,0,1,1,101.07-101.07A101.06,101.06,0,0,1,4391.27,713.46ZM1744.55,386.87H1613.14V792.36h-92.22V386.87H1389.51V304.3h355Zm1877.76,45.55h97.21L3595.31,792.36H3484L3360.47,432.42h97.2L3540,693.79Zm1162.19,0h43.37v85.84h-50.75c-39.09,0-64.18,19.18-64.18,58.28V792.36h-92.77V432.42h92.77V492.9C4721.06,450.12,4750.57,432.42,4784.5,432.42Z",transform:"translate(-195.89 -195.89)",fill:"currentColor"})}));_de.displayName="TripadvisorLogo";const wde=T.memo(()=>l.jsxs("svg",{className:"h-auto w-full",viewBox:"0 0 1000 385",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M806.495 227.151L822.764 223.392C823.106 223.313 823.671 223.183 824.361 222.96C828.85 221.753 832.697 218.849 835.091 214.862C837.485 210.874 838.241 206.113 837.198 201.582C837.175 201.482 837.153 201.388 837.13 201.289C836.596 199.117 835.66 197.065 834.37 195.239C832.547 192.926 830.291 190.991 827.728 189.542C824.711 187.82 821.553 186.358 818.289 185.171L800.452 178.659C790.441 174.937 780.432 171.309 770.328 167.771C763.776 165.439 758.224 163.393 753.4 161.901C752.49 161.62 751.485 161.34 750.669 161.058C744.837 159.271 740.739 158.53 737.272 158.505C734.956 158.42 732.649 158.841 730.511 159.738C728.283 160.699 726.282 162.119 724.639 163.906C723.822 164.835 723.054 165.806 722.337 166.815C721.665 167.843 721.049 168.907 720.491 170.001C719.876 171.174 719.348 172.391 718.911 173.642C715.6 183.428 713.951 193.7 714.032 204.029C714.091 213.368 714.342 225.354 719.475 233.479C720.712 235.564 722.372 237.366 724.348 238.769C728.004 241.294 731.7 241.627 735.544 241.904C741.289 242.316 746.855 240.905 752.403 239.623L806.45 227.135L806.495 227.151Z",fill:"currentColor"}),l.jsx("path",{d:"M987.995 140.779C983.553 131.457 977.581 122.947 970.328 115.601C969.39 114.669 968.385 113.806 967.321 113.02C966.339 112.283 965.318 111.598 964.264 110.967C963.18 110.373 962.065 109.837 960.924 109.362C958.668 108.476 956.25 108.077 953.829 108.19C951.513 108.322 949.254 108.956 947.207 110.049C944.105 111.591 940.748 114.07 936.283 118.221C935.666 118.834 934.891 119.525 934.195 120.177C930.511 123.641 926.413 127.911 921.536 132.883C914.002 140.497 906.583 148.152 899.21 155.89L886.017 169.571C883.601 172.071 881.401 174.771 879.441 177.643C877.771 180.07 876.59 182.799 875.963 185.678C875.6 187.886 875.653 190.142 876.12 192.329C876.143 192.429 876.164 192.523 876.187 192.622C877.229 197.154 879.988 201.103 883.883 203.637C887.778 206.172 892.505 207.094 897.068 206.211C897.791 206.106 898.352 205.982 898.693 205.898L969.033 189.646C974.576 188.365 980.202 187.191 985.182 184.3C988.522 182.363 991.699 180.443 993.878 176.569C995.043 174.441 995.748 172.092 995.948 169.675C997.027 160.089 992.021 149.202 987.995 140.779Z",fill:"currentColor"}),l.jsx("path",{d:"M862.1 170.358C867.197 163.955 867.184 154.41 867.64 146.607C869.174 120.536 870.79 94.4619 872.07 68.3766C872.56 58.4962 873.624 48.7498 873.036 38.7944C872.552 30.5816 872.492 21.1521 867.307 14.4122C858.154 2.52688 838.636 3.50371 825.319 5.34732C821.239 5.91358 817.153 6.6749 813.099 7.64807C809.045 8.62124 805.033 9.6841 801.108 10.9412C788.329 15.127 770.365 22.8103 767.323 37.5341C765.608 45.858 769.672 54.3727 772.824 61.9691C776.645 71.1774 781.865 79.4721 786.622 88.1401C799.198 111.024 812.008 133.765 824.782 156.53C828.597 163.326 832.755 171.933 840.135 175.454C840.623 175.667 841.121 175.856 841.628 176.018C844.937 177.272 848.545 177.513 851.993 176.712C852.201 176.664 852.405 176.617 852.608 176.57C855.792 175.704 858.675 173.973 860.937 171.568C861.345 171.185 861.734 170.782 862.1 170.358Z",fill:"currentColor"}),l.jsx("path",{d:"M855.997 240.155C854.008 237.355 851.184 235.258 847.931 234.162C844.677 233.065 841.16 233.027 837.881 234.051C837.111 234.307 836.361 234.618 835.636 234.983C834.515 235.554 833.445 236.221 832.439 236.976C829.507 239.148 827.039 241.97 824.791 244.8C824.221 245.522 823.7 246.483 823.022 247.1L811.708 262.663C805.295 271.382 798.971 280.123 792.7 289.003C788.608 294.735 785.068 299.576 782.273 303.859C781.743 304.666 781.193 305.567 780.689 306.284C777.338 311.469 775.441 315.252 774.467 318.622C773.735 320.862 773.503 323.234 773.788 325.572C774.1 328.008 774.92 330.35 776.195 332.447C776.873 333.499 777.604 334.516 778.385 335.495C779.196 336.436 780.058 337.332 780.966 338.18C781.936 339.105 782.973 339.957 784.07 340.729C791.879 346.162 800.428 350.066 809.421 353.083C816.904 355.567 824.682 357.053 832.555 357.504C833.894 357.572 835.237 357.543 836.572 357.417C837.809 357.309 839.04 357.136 840.26 356.9C841.479 356.615 842.681 356.266 843.863 355.853C846.162 354.993 848.255 353.66 850.008 351.94C851.667 350.279 852.944 348.276 853.749 346.07C855.057 342.81 855.917 338.671 856.483 332.526C856.532 331.652 856.657 330.604 856.744 329.644C857.19 324.545 857.395 318.556 857.723 311.514C858.276 300.685 858.71 289.903 859.053 279.09C859.053 279.09 859.782 259.875 859.78 259.865C859.946 255.437 859.81 250.53 858.582 246.121C858.042 244.008 857.17 241.994 855.997 240.155V240.155Z",fill:"currentColor"}),l.jsx("path",{d:"M983.707 270.24C981.346 267.651 978 265.069 972.722 261.878C971.961 261.453 971.068 260.886 970.244 260.392C965.85 257.749 960.557 254.969 954.374 251.611C944.876 246.396 935.372 241.312 925.778 236.271L908.825 227.28C907.946 227.024 907.053 226.389 906.225 225.989C902.968 224.432 899.516 222.978 895.932 222.311C894.697 222.074 893.444 221.944 892.186 221.923C891.375 221.913 890.565 221.962 889.761 222.07C886.371 222.595 883.234 224.178 880.795 226.591C878.356 229.005 876.74 232.128 876.178 235.513C875.919 237.667 875.998 239.847 876.411 241.976C877.24 246.487 879.254 250.95 881.338 254.858L890.391 271.824C895.428 281.394 900.526 290.907 905.752 300.391C909.123 306.578 911.929 311.871 914.557 316.26C915.055 317.085 915.62 317.974 916.046 318.738C919.245 324.013 921.815 327.333 924.421 329.715C926.109 331.345 928.132 332.586 930.349 333.351C932.68 334.124 935.146 334.398 937.59 334.155C938.832 334.008 940.066 333.795 941.286 333.516C942.488 333.193 943.672 332.808 944.833 332.362C946.087 331.889 947.305 331.327 948.478 330.678C955.36 326.82 961.703 322.07 967.345 316.552C974.112 309.894 980.093 302.633 984.745 294.321C985.392 293.145 985.952 291.924 986.422 290.667C986.86 289.504 987.24 288.319 987.558 287.118C987.834 285.896 988.045 284.662 988.191 283.418C988.422 280.977 988.138 278.514 987.358 276.19C986.591 273.963 985.345 271.932 983.707 270.24V270.24Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M400.03 105.19C400.03 91.2089 411.42 79.7877 425.167 79.7877C438.717 79.7877 449.714 91.2089 450.303 105.387V303.682C450.303 317.663 438.913 329.084 425.167 329.084C411.027 329.084 400.03 317.663 400.03 303.682V105.19ZM376.657 227.672C376.461 231.61 375.479 238.896 370.373 244.213C364.874 249.923 357.412 251.302 353.092 251.302C335.123 251.4 317.155 251.45 299.187 251.499C281.218 251.548 263.248 251.597 245.279 251.696C246.85 256.619 249.992 264.101 257.062 270.994C261.382 275.129 265.506 277.492 267.273 278.476C269.434 279.855 276.896 283.793 286.126 283.793C295.945 283.793 304.586 280.642 313.03 276.31L313.736 275.945C319.604 272.904 325.66 269.766 332.079 268.631C338.363 267.646 345.04 268.827 349.949 273.16C355.841 278.279 358.197 285.762 356.037 293.442C353.484 302.106 346.218 309.589 338.559 314.118C334.239 316.678 329.526 318.844 324.813 320.617C318.725 322.783 312.441 324.358 306.157 325.343C299.872 326.327 293.392 326.721 286.911 326.524H286.911C283.769 326.524 280.431 326.524 277.092 326.13C273.558 325.736 270.023 324.949 266.684 324.161C261.186 322.98 256.08 321.207 250.974 318.844C246.064 316.678 241.155 313.921 236.638 310.771C232.121 307.62 227.997 303.879 224.07 299.94C220.338 296.002 216.804 291.67 213.662 286.944C203.057 270.797 198.147 250.908 199.129 231.61C199.915 212.706 206.199 193.802 217.589 178.443C218.823 176.519 220.247 174.883 221.596 173.333C222.18 172.663 222.75 172.008 223.284 171.354C237.35 154.158 256.142 148.716 263.894 146.471L264.328 146.345C286.519 140.044 304.978 144.179 312.441 146.345C316.172 147.33 337.185 153.828 353.484 171.354C354.27 172.141 356.43 174.701 359.179 178.443C369.505 192.508 373.066 205.605 374.272 210.042L374.301 210.146C375.479 214.478 376.657 220.386 376.657 227.672ZM261.382 195.181C249.992 204.436 246.85 216.251 246.064 219.992H331.686C330.901 216.448 327.562 204.436 316.172 195.181C304.586 185.925 292.41 185.335 288.679 185.335C284.948 185.335 272.772 185.925 261.382 195.181ZM586.98 142.998C564.593 142.998 544.169 153.041 529.637 169.385V168.794C529.048 155.6 518.05 144.967 504.696 144.967C490.753 144.967 479.56 156.191 479.56 170.172V359.409C479.56 373.391 490.753 384.615 504.696 384.615C518.64 384.615 529.833 373.391 529.833 359.409V352.123V300.334C544.365 316.482 564.593 326.721 587.176 326.721C632.147 326.721 668.674 285.959 668.674 235.155C668.478 184.35 631.951 142.998 586.98 142.998ZM575.983 285.566C550.453 285.566 529.637 263.314 529.637 235.549C529.637 207.586 550.257 185.335 575.983 185.335C601.512 185.335 622.328 207.586 622.328 235.549C622.132 263.314 601.512 285.566 575.983 285.566ZM161.425 248.348L153.177 266.464C149.446 274.341 145.715 282.415 142.18 290.488C141.052 292.966 139.916 295.494 138.764 298.057C123.068 332.981 104.44 374.43 63.8242 383.236C44.1861 387.568 14.5327 381.661 3.5354 363.15C-7.4619 344.443 8.83767 322.979 29.8504 327.902C33.1646 328.641 36.4235 330.266 39.7101 331.904C45.187 334.635 50.7406 337.404 56.7545 336.173C62.4495 335.188 65.9844 331.053 70.5011 325.736C76.7853 318.45 79.5346 310.771 80.7129 306.242C80.6147 306.045 80.5165 305.798 80.4183 305.552C80.3201 305.306 80.2219 305.06 80.1237 304.863C75.0117 295.326 70.5473 286.8 66.8178 279.677C64.3868 275.034 62.2681 270.987 60.4857 267.646C56.8287 260.714 54.0662 255.473 51.918 251.398C45.6449 239.497 44.609 237.532 41.8296 232.398C35.7418 220.78 29.2612 209.555 22.5843 198.331C15.3182 186.122 7.85577 172.535 13.9436 158.16C18.8531 146.542 31.4214 140.634 43.4006 144.376C56.0403 148.212 61.6377 160.239 66.8724 171.487C67.8188 173.52 68.7534 175.528 69.7156 177.458C78.16 194.196 86.4079 210.934 94.6559 227.672C95.382 229.336 96.4917 231.605 97.8402 234.362C99.0447 236.824 100.44 239.676 101.922 242.834C102.697 244.475 103.434 246.002 104.101 247.382C104.954 249.149 105.691 250.676 106.242 251.892C110.072 242.342 113.95 232.841 117.829 223.34C121.707 213.839 125.586 204.337 129.415 194.787C129.522 194.253 130.436 192.216 131.813 189.145C132.977 186.549 134.473 183.215 136.092 179.427C136.64 178.133 137.191 176.79 137.755 175.417C142.856 162.995 148.988 148.06 162.604 143.982C172.423 141.028 183.42 144.967 189.115 153.237C192.061 157.372 193.239 162.098 193.435 166.824C193.593 177.275 188.545 188.491 184.212 198.115C183.157 200.459 182.144 202.708 181.26 204.829C181.219 204.91 181.048 205.296 180.739 205.988C179.541 208.679 176.278 216.005 170.655 228.066C168.626 232.389 166.679 236.713 164.707 241.09C163.626 243.491 162.538 245.907 161.425 248.348Z",fill:"currentColor"}),l.jsx("path",{d:"M687.728 310.153H689.549C690.447 310.153 691.167 309.923 691.706 309.462C692.256 308.99 692.532 308.395 692.532 307.676C692.532 306.833 692.29 306.232 691.807 305.872C691.324 305.502 690.56 305.316 689.515 305.316H687.728V310.153ZM695.043 307.608C695.043 308.507 694.801 309.305 694.318 310.002C693.846 310.687 693.178 311.198 692.313 311.535L696.324 318.193H693.492L690.004 312.226H687.728V318.193H685.234V303.176H689.633C691.498 303.176 692.863 303.541 693.728 304.271C694.605 305.002 695.043 306.114 695.043 307.608ZM677.228 310.676C677.228 308.429 677.79 306.322 678.914 304.356C680.037 302.389 681.582 300.839 683.549 299.704C685.515 298.569 687.633 298.002 689.902 298.002C692.15 298.002 694.256 298.564 696.223 299.687C698.189 300.811 699.74 302.356 700.874 304.322C702.009 306.288 702.577 308.406 702.577 310.676C702.577 312.889 702.032 314.968 700.942 316.912C699.852 318.856 698.324 320.412 696.358 321.58C694.391 322.749 692.24 323.333 689.902 323.333C687.577 323.333 685.431 322.754 683.464 321.597C681.498 320.429 679.964 318.872 678.863 316.929C677.773 314.985 677.228 312.901 677.228 310.676ZM678.998 310.676C678.998 312.62 679.487 314.44 680.464 316.136C681.442 317.822 682.773 319.153 684.459 320.131C686.155 321.097 687.97 321.58 689.902 321.58C691.858 321.58 693.672 321.092 695.346 320.114C697.02 319.136 698.346 317.816 699.324 316.153C700.313 314.479 700.807 312.653 700.807 310.676C700.807 308.721 700.318 306.906 699.341 305.232C698.363 303.558 697.037 302.232 695.363 301.255C693.7 300.266 691.88 299.771 689.902 299.771C687.947 299.771 686.133 300.26 684.459 301.238C682.785 302.215 681.453 303.541 680.464 305.215C679.487 306.878 678.998 308.698 678.998 310.676Z",fill:"currentColor"})]}));wde.displayName="YelpLogo";const Z1t=({className:e})=>l.jsx(V,{className:z("w-10",e),children:l.jsx(wde,{})}),J1t=({className:e})=>l.jsx(V,{className:z("w-[70px]",e),children:l.jsx(_de,{})}),Cde=e=>{const t=d.useMemo(()=>Vi(e).with(nd.string.includes("yelp.com"),()=>Z1t).with(nd.string.includes("tripadvisor.com"),()=>J1t).otherwise(()=>null),[e]);return d.useMemo(()=>({SearchClientLogo:t}),[t])},Sde=T.memo(({day:e,hours:t})=>l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(V,{variant:"tiny",children:e}),l.jsx(K,{className:"h-one grow",variant:"subtler"}),l.jsx(V,{variant:"tiny",color:"light",children:t})]}));Sde.displayName="BusinessDayToHours";function HS(e,t,n,r=0){return e*24*3600+t*3600+n*60+r}function yU(e,t,n){const r=new Date(Date.UTC(2e3,0,1,e,t,0));return t===0?new Intl.DateTimeFormat(n,{hour:"numeric",timeZone:"UTC"}).format(r):new Intl.DateTimeFormat(n,{hour:"numeric",minute:"numeric",timeZone:"UTC"}).format(r)}function t7(e,t,n){const{locale:r,$t:s}=J(),[o,a]=d.useState([]);return d.useEffect(()=>{if(!e||e.length===0)return a([]),()=>{};const i=()=>{const f=Date.now(),m=qS(f,t),p=(m.weekday+6)%7,h=HS(p,m.hour,m.minute,m.second),g=[];for(const _ of e){const w=_.open.weekday_idx,S=_.open.hour,C=_.open.minute,E=_.close.weekday_idx,N=_.close.hour,k=_.close.minute;let I=HS(w,S,C),M=HS(E,N,k);M<=I&&(M+=168*3600),p===_.close.weekday_idx&&_.open.weekday_idx!==_.close.weekday_idx&&(I-=168*3600,M-=168*3600),g.push({openWeekday:w,openHour:S,openMinute:C,closeWeekday:E,closeHour:N,closeMinute:k,openSeconds:I,closeSeconds:M})}g.sort((_,w)=>_.openWeekday!==w.openWeekday?_.openWeekday-w.openWeekday:_.openSeconds-w.openSeconds);const y=[];for(let _=0;_<7;_++){const S=(_-p+7)%7*24*60*60*1e3,C=new Date(f+S);y.push({day:Intl.DateTimeFormat(r,{weekday:n,timeZone:t}).format(C),isToday:_===p,hours:[],joinedHours:s({defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})}let x=null;for(const _ of g){const w=y[_.openWeekday],S=yU(_.openHour,_.openMinute,r),C=yU(_.closeHour,_.closeMinute,r),E=S===C?s({defaultMessage:"Open 24 hours",id:"mdcm71ltJq"}):`${S} - ${C}`,N=_.openWeekday===p&&h>=_.openSeconds&&h<_.closeSeconds;if(w.hours.push({open:S,close:C,openCloseString:E,isOpenNow:N}),_.openSeconds>h){const k=_.openSeconds-h;(x===null||kh){const k=_.closeSeconds-h;(x===null||k0&&(x===null||b0&&(_.joinedHours=_.hours.map(w=>w.openCloseString).join(", "));return a(_=>Er(_,y)?_:y),x!==null?x*1e3:null},c=()=>{const f=i();if(f!==null&&f>0){const m=Math.min(f,864e5);return setTimeout(c,m)}else return setTimeout(c,1440*60*1e3)},u=c();return()=>clearTimeout(u)},[e,t,r,n,s]),o}const Ede=T.memo(({hours:e,timezone:t})=>{const[n,r]=d.useState(!1),s=d.useCallback(()=>{r(u=>!u)},[]),o=t7(e,t,"long"),a=o.find(u=>u.isToday===!0),i=a?.hours.some(u=>u.isOpenNow)??!1,{$t:c}=J();return l.jsxs(K,{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"gap-x-sm flex items-center",children:[i!=null&&l.jsx(K,{variant:i?"super":"red",className:"px-sm py-xs rounded",children:l.jsx(V,{variant:"tiny",color:"defaultInverted",children:c(i?{defaultMessage:"Open now",id:"AbmghRJVfD"}:{defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})}),a!==void 0&&l.jsxs(V,{variant:"tiny",className:"block",children:[a.joinedHours," today"]})]}),l.jsx(rt,{size:"tiny",text:c({defaultMessage:"More",id:"I5NMJ8llIi"}),onClick:s,chevron:!0,chevronIcon:n?B("chevron-up"):B("chevron-down")})]}),n&&l.jsx("div",{className:"my-sm gap-xs flex flex-col",children:o.map((u,f)=>l.jsx(Sde,{day:u.day,hours:u.joinedHours},f))})]})});Ede.displayName="BusinessHours";const kde=T.memo(({className:e,title:t,url:n,subtitle:r,imageUrl:s,withImagePlaceholder:o,clickable:a,withinContent:i,bgHover:c,variant:u,...f})=>l.jsxs(K,{variant:i?"subtler":u,bgHover:a?i?"subtle":"subtler":c,className:z("gap-x-md p-sm flex rounded-lg",{"cursor-pointer":a},e),...f,children:[s&&l.jsx("div",{className:"size-20 flex-none overflow-hidden",children:l.jsx($o,{alt:"title",hasShadow:!1,includeLightBoxModal:!1,containerClassName:"size-20",imageClassName:"object-cover w-full h-full",maskClassName:"size-20 flex items-center justify-center",rounded:"md",src:s})}),!s&&o&&l.jsx("div",{className:"size-20 flex-none overflow-hidden",children:l.jsx("div",{className:"bg-subtler flex size-20 items-center justify-center rounded-md"})}),l.jsxs("div",{className:"-mt-xs flex grow flex-col justify-center",children:[l.jsxs("div",{className:"gap-x-sm flex justify-between",children:[l.jsx(V,{className:"line-clamp-1 whitespace-normal break-words capitalize leading-8",variant:"smallBold",children:t}),n&&l.jsx(V,{variant:"small",color:"light",className:"mr-xs",children:l.jsx(ge,{icon:B("external-link"),size:"md"})})]}),r]})]}));kde.displayName="ContentLinkCard";const eyt=4,$h=T.memo(({priceSymbols:e,priceRange:t,className:n="",dollarColor:r="default",textVariant:s="tiny",currencySymbol:o,...a})=>{const i=t&&/^(.+?)\s*(\1\s*)+$/.test(t.trim());let c=0;return i?c=t.replace(/\u200A/g,"").length:e&&(c=e.replace(/\u200A/g,"").length),l.jsx("div",{className:`flex items-center ${n}`,...a,children:t&&!i?l.jsx(V,{variant:s,color:r,children:t}):l.jsx("div",{className:"flex gap-px",children:Array.from({length:eyt},(u,f)=>l.jsx(V,{variant:s,className:"inline-flex",color:fl.jsxs("div",{className:"flex items-center","data-test-id":t,children:[Array.from({length:tyt},(n,r)=>{const s=e>r&&r>=Math.floor(e);return l.jsxs("div",{className:"relative",children:[l.jsx(V,{variant:"tiny",color:r{const a=o&&!!e.price,i=d.useMemo(()=>l.jsxs("div",{children:[l.jsxs("div",{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Mde,{starCount:e.rating}),e.num_reviews&&l.jsxs(V,{color:"light",variant:"tiny",className:"line-clamp-1",children:[" · ",Qbe(e.num_reviews)," reviews"]})]}),l.jsxs("div",{className:"mt-sm gap-sm flex items-center",children:[o&&l.jsx(o,{className:"-mt-two"}),a&&l.jsx(V,{color:"light",variant:"tiny",children:" · "}),(e.price||e.price_range)&&l.jsx("div",{className:"gap-sm line-clamp-1 flex items-center",children:l.jsx($h,{priceSymbols:e.price,priceRange:e.price_range})})]})]}),[o,e.num_reviews,e.price,e.price_range,e.rating,a]);return l.jsx(K,{onClick:n,children:l.jsx(kde,{title:e.name,clickable:n!==void 0,onMouseEnter:r,onMouseLeave:s,imageUrl:e.image_url??void 0,withImagePlaceholder:t,subtitle:i})})});Tde.displayName="MapContentCard";const n7=T.memo(({showPulse:e=!1,style:t="default"})=>l.jsxs("div",{className:"relative size-[12px]",children:[l.jsx("div",{className:z("bg-super relative z-[1] size-[12px] rounded-full shadow-[0_1px_6px_rgba(0,0,0,0.25)] transition-all duration-150 dark:shadow-[0_1px_4px_rgba(0,0,0,0.5)]",{"bg-white shadow-[0_1px_6px_rgba(0,0,0,0.35),0_0_0_1px_rgba(0,0,0,0.05)]":t==="recede"})}),e&&l.jsx(Te.div,{className:"bg-super pointer-events-none absolute left-0 top-0 size-[12px] rounded-full",initial:{scale:1,opacity:.75},animate:{scale:[1,2.5],opacity:[.75,0]},transition:{duration:1.5,ease:[0,0,.2,1],repeat:1/0,repeatType:"loop",repeatDelay:.01}})]}));n7.displayName="PulsingDot";const Ade=T.memo(({isContentCardOpen:e,location:t,selectedLocation:n,onClick:r,onClose:s,isHighlighted:o=!1,isSelected:a=!1,setHighlightedLocation:i,deemphasize:c=!1,setOffset:u,showRating:f=!1})=>{const{SearchClientLogo:m}=Cde(t.url),p=t.description,h=t.attributes?.ambience,g=h&&Object.keys(h).find(A=>h[A]===!0),{isMobileStyle:y}=Re(),x=6,v=t.categories?.slice(0,x),b=t.categories?.slice(x),[_,w]=d.useState(!1),S=t.address?.join(", "),C=360,[E,N]=d.useState(null);d.useEffect(()=>{E&&a&&u(E)},[a,E,u]);const k=d.useCallback(()=>w(!0),[w]),I=d.useMemo(()=>l.jsxs("div",{children:[l.jsx(xt,{href:t.url,target:"_blank",children:l.jsx(Tde,{location:t,SearchClientLogo:m})}),(S||t.phone||t.entity_url)&&l.jsxs(K,{className:"mx-sm py-sm mt-xs gap-sm flex flex-col border-t",children:[S&&l.jsx(Fy,{icon:B("map-pin"),label:S,href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(S)}`,showCopyButton:!0}),t.phone&&l.jsx(Fy,{icon:B("device-mobile"),label:t.phone,href:`tel:${t.phone}`,showCopyButton:!0}),t.entity_url&&l.jsx(Fy,{icon:B("world"),label:$H(GH(t.entity_url)),href:t.entity_url})]}),p&&l.jsx(K,{className:"mx-sm gap-sm py-sm flex flex-wrap border-t",children:l.jsx(V,{variant:"small",className:"line-clamp-3",children:p})}),!!t.standardized_hours?.length&&l.jsx(K,{className:"mx-sm py-sm scrollbar-subtle max-h-[120px] overflow-auto border-t",children:l.jsx(Ede,{hours:t.standardized_hours,timezone:t.timezone})}),(g||t.categories)&&l.jsxs(K,{className:"mx-sm gap-xs py-sm flex flex-wrap border-t",children:[g&&l.jsx(pp,{text:g}),v?.map((A,D)=>l.jsx(pp,{text:A},D)),!_&&b.length>0&&l.jsx(pp,{text:`+${b.length}`,onClick:k}),_&&b?.map((A,D)=>l.jsx(pp,{text:A},D))]})]}),[S,p,v,t,k,b,_,g,m]),M=d.useMemo(()=>({zIndex:a||o?10:0}),[o,a]);return l.jsxs(l.Fragment,{children:[E?null:l.jsx("div",{ref:A=>{A&&N(A.offsetHeight)},className:"pointer-events-none invisible absolute left-[10vw] top-[10vh]",style:{width:C},children:I}),l.jsx(W1t,{longitude:t.lng,latitude:t.lat,anchor:"bottom",onClick:r,style:M,children:l.jsx(xb,{isMobileStyle:y,canOutsideClickClose:!0,isOpen:e,placement:"bottom",removeScroll:!1,onClose:s,contentWidth:C,content:I,children:l.jsxs(V,{variant:"tiny",className:z("group pointer-events-none relative flex cursor-pointer flex-col items-center",{"z-[10]":o||e}),children:[l.jsx(Te.div,{animate:{opacity:a||o?1:0},transition:Rr,className:z("bg-super px-sm py-xs text-light pointer-events-none absolute left-1/2 top-[-20px] -translate-x-1/2 whitespace-nowrap rounded-full shadow-sm group-hover:shadow-md dark:text-black",{}),children:t.name}),l.jsx("div",{onMouseEnter:()=>{i&&!a&&!n&&i(t)},onMouseLeave:()=>{i&&!a&&i(null)},className:"pointer-events-auto block",children:f&&t.rating?l.jsx(Nde,{rating:t.rating,isSelected:a,isHighlighted:o,deemphasize:c}):l.jsx("div",{className:"p-sm rounded-full",children:l.jsx(n7,{style:c?"recede":"default",showPulse:a||o})})})]})})})]})});Ade.displayName="PerplexityMarker";const pp=T.memo(({text:e,onClick:t})=>l.jsx(K,{className:z("py-xs px-sm rounded border",{"cursor-pointer":t}),onClick:t,as:t?"button":"div",bgHover:t?"subtle":void 0,children:l.jsx(V,{variant:"tiny",color:"light",children:e})}));pp.displayName="MarkerPill";const Nde=T.memo(({rating:e,isSelected:t,isHighlighted:n,deemphasize:r})=>l.jsx(Te.div,{animate:{scale:t||n?1.1:1,opacity:r?.6:1},transition:{type:"spring",bounce:.2,duration:.28},className:"relative",children:l.jsxs("div",{className:z("bg-super mt-sm px-sm py-xs font-display text-light relative rounded-xl text-xs font-medium shadow-sm group-hover:shadow-md dark:text-black",{"shadow-md":t||n}),children:[e.toFixed(1),l.jsx("div",{className:"border-t-super absolute left-1/2 top-full -translate-x-1/2 -translate-y-px border-x-4 border-t-[5px] border-x-transparent"})]})}));Nde.displayName="RatingMarker";const Fy=T.memo(({icon:e,label:t,href:n,showCopyButton:r=!1})=>{const{$t:s}=J(),{session:o}=je(),{trackEvent:a}=Ke(o),i=d.useCallback(f=>{f.stopPropagation(),a("place link clicked",{link:n})},[a,n]),c=d.useCallback(()=>{navigator.clipboard.writeText(t),a("place link copied",{link:n})},[t,a,n]),u=s({defaultMessage:"Copy",id:"4l6vz1/eZ5"});return l.jsxs("div",{className:"gap-sm group/all flex items-start",children:[l.jsx(xt,{href:n,target:"_blank",className:"group flex-1 cursor-pointer",onClick:i,children:l.jsxs(V,{variant:"small",color:"default",className:"gap-sm group-hover:text-super flex items-start text-balance transition-colors duration-200",children:[l.jsx(ge,{icon:e,size:"sm",className:"top-two relative shrink-0"}),t]})}),r&&l.jsx(V,{variant:"small",color:"default",className:"-mr-xs flex h-[1lh] items-center",children:l.jsx(rt,{icon:B("copy"),onClick:c,size:"small",toolTip:u,clickFeedback:!0,pill:!0})})]})});Fy.displayName="PlaceLink";function Rde(e){return{lat:e.lat??0,lng:e.lng??0,name:e.name??"",description:e.description??"",image_url:e.image_url??"",price:e.price??"",rating:e.rating??0,num_reviews:e.num_reviews??0,url:e.url??"",attributes:e.attributes,categories:e.categories,operating_hours:e.operating_hours??[],is_open:e.is_open??!1,map_boundary_buffer:0,price_range:e.price_range??"",canonical_page_path:e.canonical_page_path??"",address:e.address??[],phone:e.phone??"",entity_url:e.entity_url??"",timezone:e.timezone??"",standardized_hours:e.standardized_hours??[]}}const nyt=({reason:e})=>{const t=el(),n=d.useCallback(async({entryUUID:r,lat_lng:s})=>{const{data:o,error:a,response:i}=await de.POST("/rest/entry/map/search-map-locations",e,{body:{lat:s.latitude,lng:s.longitude,read_write_token:t,entry_uuid:r},timeoutMs:Sn.HIGH});if(a)throw new ye("API_CLIENTS_ERROR",{cause:a,status:i.status??0});return o?o.places.map(Rde):[]},[t,e]);return d.useMemo(()=>({searchForAdditionalLocations:n}),[n])},ryt="pk.eyJ1Ijoiam9obm55cHBseCIsImEiOiJjbHBraWpwcnUwMHNzMmtwbWZyOTIyZnpxIn0.0I0RSAHhYftVDM6cLnj1wg",syt="mapbox://styles/johnnypplx/clps6e1xy015c01qt2u79a96f",oyt="mapbox://styles/johnnypplx/clpmzsapf00zy01po5t7ge9zd",xU=16,vU=17,Y1=6,Dde=T.memo(({entryUUID:e,contextUUID:t,selectedLocation:n,setSelectedLocation:r,selectedLocationFocused:s=!0,setSelectedLocationFocused:o,highlightedLocation:a,setHighlightedLocation:i,setRenderedLocations:c,searchByLocationOverride:u,locations:f,navControlPosition:m="bottom-right",showNavControl:p=!0,showRating:h=!1,answerMode:g})=>{const y="perplexity-map",x=d.useRef(null),[v,b]=d.useState(!1),[_,w]=d.useState(!1),[S,C]=d.useState(!1),[E,N]=d.useState(null),{colorScheme:k}=Ss(),{searchForAdditionalLocations:I}=nyt({reason:y}),M=f[0]?.map_boundary_buffer??0,A=f.map(se=>se.lat),D=f.map(se=>se.lng),P=Math.min(...A)-M,F=Math.max(...A)+M,R=Math.min(...D)-M,j=Math.max(...D)+M,L=()=>{r(null),b(!1)},U=d.useCallback(()=>{x.current&&x.current.fitBounds([[R,P],[j,F]],{duration:500,padding:50,maxZoom:vU})},[R,P,j,F]);d.useEffect(()=>{n!=null&&E!=null&&s&&(x.current.getCenter().lng.toFixed(Y1)==n.lng.toFixed(Y1)&&x.current.getCenter().lat.toFixed(Y1)==n.lat.toFixed(Y1)&&x.current.getZoom()==xU?b(!0):(x.current.flyTo({center:[n.lng,n.lat],padding:{bottom:E},zoom:xU,duration:500}),w(!0)))},[n,s,E]),d.useEffect(()=>{if(!x.current||!a)return;const se=x.current.getBounds();if(!se)return;se.contains([a.lng,a.lat])||U()},[a,P,F,R,j,U]),d.useEffect(()=>{n?o?.(!0):U()},[n,U,o]);const O=d.useMemo(()=>f.map((se,ae)=>l.jsx(jde,{location:se,highlightedLocation:a??null,selectedLocation:n,showContentCard:v,contextUUID:t,entryUUID:e,isFlying:_,setHighlightedLocation:i,setSelectedLocation:r,setShowContentCard:b,setOffset:N,showRating:h,answerMode:g},`marker-${ae}`)),[f,a,n,v,t,e,_,i,r,h,g]);d.useCallback(async()=>{if(x.current){C(!0);try{const se=u?await u({latLng:{latitude:x.current.getCenter().lat,longitude:x.current.getCenter().lng}}):await I({entryUUID:e,lat_lng:{latitude:x.current.getCenter().lat,longitude:x.current.getCenter().lng}});se&&se.length>0&&c(se)}catch(se){Z.error("Error searching for additional locations:",se)}finally{C(!1)}}},[I,e,c,C,u]);const $=d.useMemo(()=>({bounds:[[R,P],[j,F]],fitBoundsOptions:{maxZoom:vU,padding:50}}),[F,j,P,R]),G=d.useCallback(()=>b(!1),[]),H=d.useCallback(()=>o?.(!1),[o]),Q=d.useCallback(()=>{_?(b(!0),w(!1)):r(null)},[_,r]),Y=d.useMemo(()=>({name:"mercator"}),[]),te=d.useCallback(se=>{se?.target?.resize?.()},[]);return l.jsxs(K,{variant:"subtler",className:"relative flex size-full overflow-hidden rounded-xl",children:[!1,l.jsxs(H1t,{ref:x,mapboxAccessToken:ryt,initialViewState:$,onClick:L,doubleClickZoom:!1,mapStyle:k==="dark"?syt:oyt,attributionControl:!1,logoPosition:"top-left",onMoveStart:G,onDragStart:H,onZoomEnd:Q,projection:Y,onRender:te,children:[O,p&&l.jsx(Y1t,{position:m,showCompass:!1,showZoom:!0})]})]})});Dde.displayName="PerplexityMap";const jde=T.memo(({location:e,highlightedLocation:t,selectedLocation:n,showContentCard:r,contextUUID:s,entryUUID:o,isFlying:a,setHighlightedLocation:i,setSelectedLocation:c,setShowContentCard:u,setOffset:f,showRating:m,answerMode:p})=>{const{session:h}=je(),{trackEvent:g}=Ke(h),y=d.useCallback(()=>{!a&&e!=n&&(g("map marker clicked",{entryUUID:o,contextUUID:s,itemID:e.url,answerMode:p}),u(!1),c(e),i&&i(null))},[a,e,n,g,o,s,u,c,i,p]),x=d.useCallback(()=>{c(null),u(!1)},[c,u]);return l.jsx(Ade,{isContentCardOpen:r&&n?.url===e.url,location:e,onClick:y,onClose:x,isHighlighted:t?.url===e.url,isSelected:n?.url===e.url,setHighlightedLocation:i,selectedLocation:n,setOffset:f,deemphasize:t!==null&&t?.url!==e.url,showRating:m})});jde.displayName="PerplexityMarkerFactory";const Ide=zt("ImageCarouselContext",{images:[],onImageClick:()=>{},handleNext:()=>{},handlePrevious:()=>{},currentIndex:0,showControls:!1,direction:1,totalVisibleCarousels:0,setTotalVisibleCarousels:()=>{},fillMode:"cover",useCurrentIndex:()=>0}),lM=T.memo(({images:e,showControls:t,onImageClick:n,children:r,fillMode:s="cover"})=>{const[o,a]=d.useState(0),[i,c]=d.useState(1),[u,f]=d.useState(0);d.useEffect(()=>{a(0)},[e.length]);const m=d.useCallback(()=>{a(b=>b+1>=e.length?0:b+1),c(1)},[a,e.length]),p=d.useCallback(()=>{a(b=>b==0?e.length-1:b-1),c(-1)},[a,e.length]),h=d.useCallback(b=>{f(b),y(Date.now())},[]),[g,y]=d.useState(),x=d.useCallback(b=>!b.current||g===void 0?-1:ayt(b.current),[g]),v=d.useMemo(()=>({images:e,onImageClick:n,handleNext:m,handlePrevious:p,currentIndex:o,showControls:t,direction:i,totalVisibleCarousels:u,setTotalVisibleCarousels:h,fillMode:s,useCurrentIndex:x}),[e,o,t,i,u,m,p,h,n,s,x]);return l.jsx(Ide.Provider,{value:v,children:l.jsx("div",{"data-paged-carousel":"parent",children:r})})});lM.displayName="ImagePagedCarouselProvider";const ayt=e=>{const t=e.closest('[data-paged-carousel="parent"]');if(!t)return-1;const n=t.querySelectorAll('[data-paged-carousel="child"]');return Array.from(n).filter(s=>{const o=s.getBoundingClientRect();return o.width>0&&o.height>0}).indexOf(e)},By=T.memo(({className:e})=>{const{images:t,onImageClick:n,handleNext:r,handlePrevious:s,currentIndex:o,showControls:a,direction:i,totalVisibleCarousels:c,setTotalVisibleCarousels:u,fillMode:f,useCurrentIndex:m}=d.useContext(Ide),p=d.useRef(null),h=m(p),[g,{width:y,height:x}]=ei(),v=y>0&&x>0;d.useEffect(()=>{if(v)return u(I=>I+1),()=>u(I=>I-1)},[u,v]);const[b,_]=d.useState(!1),{isMobileUserAgent:w}=Re(),S=d.useMemo(()=>{const I=o+h;return I>=t.length?I%t.length:I},[h,o,t.length]),C=d.useCallback(()=>{n?.(S)},[S,n]),E={hiddenEnter:I=>({x:I===1?"100%":"-100%"}),hiddenExit:I=>({x:I===1?"-100%":"100%"}),visible:{x:0}};d.useEffect(()=>{const I=()=>{const M=(S+1)%t.length,A=S===0?t.length-1:S-1,D=new Image,P=new Image,F=t[M],R=t[A];F&&(D.src=F),R&&(P.src=R)};t.length>1&&I()},[S,t]);const N=t.length>1&&h===0,k=t.length>1&&h+1==c;return t.length?l.jsxs("div",{ref:p,"data-paged-carousel":"child",onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),className:z("group relative size-full",e),children:[l.jsx("div",{ref:g,className:"size-full cursor-pointer overflow-hidden",onClick:C,children:h===-1?null:l.jsx(kt,{initial:!1,custom:i,children:l.jsx(Te.img,{custom:i,src:t[S],alt:"",className:z("absolute inset-0 size-full",{"p-sm object-contain":f==="contain","object-cover":f==="cover"}),variants:E,initial:"hiddenEnter",animate:"visible",exit:"hiddenExit",transition:Rr},t[S])})}),N&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:b||a||w?1:0},transition:Rr,children:l.jsx(K,{as:"button",variant:"raised",className:"shadow-overlay active:bg-subtler absolute left-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full",onClick:s,children:l.jsx(ge,{icon:B("chevron-left"),size:"sm"})})}),k&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:b||a||w?1:0},transition:Rr,children:l.jsx(K,{as:"button",variant:"raised",className:"shadow-overlay active:bg-subtler absolute right-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full",onClick:r,children:l.jsx(ge,{icon:B("chevron-right"),size:"sm"})})})]}):null});By.displayName="ImagePagedCarousel";const iyt=T.memo(({image:e,title:t,subtitle:n,children:r,footer:s,itemClick:o})=>l.jsxs("div",{className:"gap-md flex w-full flex-row",children:[l.jsx("div",{className:"w-[180px] shrink-0",children:e}),l.jsxs("div",{className:"gap-xs flex flex-col justify-center",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs(K,{as:"button",onClick:o,children:[l.jsx(V,{variant:"baseSemi",className:"text-left hover:underline",children:t}),l.jsx("div",{className:"mt-xs min-h-[24px]",children:n})]}),l.jsx("div",{className:"-mt-sm",children:r})]}),l.jsx("div",{className:"gap-xs -mt-sm flex flex-row justify-between",children:s})]})]}));iyt.displayName="InlineCard";const bU=({children:e})=>l.jsx("div",{className:"gap-md flex w-full flex-row",children:e}),lyt=({children:e})=>l.jsx("div",{className:"w-[180px] shrink-0",children:e}),cyt=({children:e})=>l.jsx("div",{className:"gap-xs flex flex-col justify-center",children:e}),uyt=({children:e,onClick:t})=>l.jsx(jo,{onClick:t,className:"gap-xs group flex flex-col",children:e}),dyt=({children:e})=>l.jsx("div",{className:"group-hover:underline",children:l.jsx(spe,{size:"tiny",weight:"medium",level:3,align:"left",children:e})}),fyt=({children:e})=>l.jsx("div",{className:"gap-xs -mt-sm flex flex-row justify-between",children:e}),Yu=Object.assign(bU,{Root:bU,Image:lyt,Title:dyt,Content:cyt,Action:uyt,Footer:fyt}),myt=({actions:e})=>l.jsx(ya,{className:"text-quietest flex flex-row flex-wrap items-center",delimiter:"|",children:e.map((t,n)=>{const r=l.jsx(K,{className:"gap-xs flex items-center",children:l.jsx(rt,{variant:t.emphasize?"super":"common",size:"small",onClick:t.onClick,icon:t.icon,trailingComponent:t.trailingComponent,text:t.label,textClassName:t.textClassName,noPadding:!0})});return l.jsx(Vn,{id:t.label,children:r},n)})}),Pde=T.memo(({title:e,href:t,linkType:n="external",onClick:r,noFollow:s=!1,variant:o="entry-title-300"})=>{const{$t:a}=J(),i=a({defaultMessage:"Open in Perplexity",id:"EUx7i7X2Vq"}),c=a({defaultMessage:"Open site",id:"X8dxWhlpJl"}),u=a({defaultMessage:"View details",id:"MnpUD7ksb+"}),f=l.jsx(V,{as:r?"button":void 0,onClick:r,variant:o,className:"decoration-subtle animate-underlineFade hover:text-super hover:decoration-super/80 dark:decoration-subtler line-clamp-3 inline-block w-fit cursor-pointer overflow-visible text-left align-baseline underline decoration-1 underline-offset-[5px] transition-all hover:underline-offset-[7px] motion-reduce:transition-none",children:e});return t?l.jsx(Oo,{tooltipText:n==="external"?c:i,tooltipLayout:"right",asChild:!0,children:l.jsx(xt,{href:t,target:"_blank",rel:s?void 0:"nofollow",className:"w-fit",onClick:r,children:f})}):r?l.jsx(Oo,{tooltipText:u,tooltipLayout:"right",asChild:!0,children:f}):f});Pde.displayName="InlineCardTitle";const pyt="pk.eyJ1Ijoiam9obm55cHBseCIsImEiOiJjbG9zeWVsaHUwNGU5Mmpudm95bGpmcTJjIn0.ztIaHlLUvTpLq8EVD7LjDQ",hyt="clpmzsapf00zy01po5t7ge9zd",gyt="clps6e1xy015c01qt2u79a96f";function _U({mode:e="light",width:t,height:n,lat:r,long:s,zoom:o=12,scale:a}){return"https://api.mapbox.com/styles/v1/johnnypplx/"+(e==="light"?hyt:gyt)+`/static/${s},${r},${o}/${t}x${n}${a==2?"@2x":""}?access_token=${pyt}&logo=false`}function yyt(e){const t=_U({...e,scale:1}),n=_U({...e,scale:2});return{src:t,srcSet:`${t} 1x, ${n} 2x`}}const Ode=T.memo(({standardizedHours:e,timezone:t})=>{const n=t7(e,t,"short");return n.length===0?null:l.jsx("div",{className:"gap-xs flex flex-col",children:n.map(({day:r,joinedHours:s,isToday:o})=>l.jsxs("div",{className:"gap-md flex items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"white",className:o?void 0:"opacity-50",children:r}),l.jsx(V,{variant:"tiny",color:"white",className:o?void 0:"opacity-50",children:s})]},`place-hours-${r}`))})});Ode.displayName="PlaceOperatingHours";const xyt=(e,t,n)=>{let r=Math.min(Math.ceil(n/2),e.length),s=Math.min(Math.floor(n/2),t.length);return r+s({...o,type:"pro"})),...t.slice(0,s).map(o=>({...o,type:"con"}))]},Lde=T.memo(({pros:e,cons:t,loading:n})=>{const[r,s]=d.useState(0),[o,a]=d.useState(!1),[i,c]=d.useState(1),[u,f]=d.useState(1),[m,p]=d.useState(0),[h,{width:g,height:y}]=ei(),[x,v]=d.useState(Ie),b=d.useRef(null),{isMobileUserAgent:_}=Re(),w=Math.floor(g??0),S=Math.floor(y??0),C=d.useCallback(M=>!e?.length&&!t?.length||M<=0?Ie:xyt(e,t,M),[e,t]),E=d.useCallback((M,A,D,P)=>{const F=Math.floor(M/D),R=Math.floor(A/P);return{columns:Math.max(1,F),rows:Math.max(1,R)}},[]);d.useEffect(()=>{const{columns:M,rows:A}=E(w,S,180,56);c(M),f(A),r>x.length-1&&x.length-1>=0&&s(x.length-1)},[w,S,r,x.length,E]),d.useEffect(()=>{p(u*i),v(C(u*i))},[u,i,C]),d.useEffect(()=>{if(b.current){const M=b.current.scrollWidth,A=x.length,D=M/A*r;b.current.scrollTo({left:D})}},[o]),d.useEffect(()=>{const M=b.current;if(!M)return;const A=()=>{const D=M.scrollLeft,P=M.scrollWidth/x.length,F=Math.round(D/P);F!==r&&s(F)};return M.addEventListener("scroll",A),()=>M.removeEventListener("scroll",A)},[r,x.length]);const N=d.useCallback(M=>{if(!b.current)return;const D=b.current.scrollWidth/x.length*M;b.current.scrollTo({left:D})},[x.length]),k=d.useCallback(()=>{if(!b.current)return;const M=r+1>=x.length?0:r+1;N(M)},[r,x.length,N]),I=d.useCallback(()=>{if(!b.current)return;const M=r-1<0?x.length-1:r-1;N(M)},[r,x.length,N]);return l.jsx("div",{className:"size-full",style:{transformStyle:"preserve-3d",perspective:"1000px"},onMouseLeave:()=>{_||a(!1)},children:l.jsxs(Te.div,{initial:{rotateY:0},animate:{rotateY:o?180:0},transition:{type:"spring",stiffness:200,damping:30},style:{willChange:"transform",transformStyle:"preserve-3d"},className:"relative size-full",children:[l.jsx("div",{ref:h,className:"gap-sm grid size-full",style:{gridTemplateColumns:`repeat(${i}, 1fr)`,gridTemplateRows:`repeat(${u}, 1fr)`,backfaceVisibility:"hidden"},children:[...Array(m)].map((M,A)=>{const D=x[A];return!D&&!n?null:n?l.jsx(wr,{children:l.jsx("div",{className:"bg-subtler size-full rounded-xl"})},A):D?l.jsx(Fde,{item:D,index:A,setIsFlipped:a,setDetailIndex:s},A):null})}),l.jsx("div",{className:"absolute inset-0 size-full",style:{backfaceVisibility:"hidden",willChange:"transform",transform:"rotateY(180deg)"},children:l.jsxs(mr,{className:"gap-xs relative flex size-full flex-col text-left",children:[_&&l.jsx("button",{className:"shadow-overlay active:bg-subtler absolute right-[-8px] top-[-8px] z-[1] flex size-[24px] items-center justify-center rounded-full bg-white dark:bg-black",onClick:M=>{M.stopPropagation(),a(!1)},children:l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("x"),size:"sm"})})}),l.jsx("div",{ref:b,className:z("scrollbar-none absolute inset-0 snap-x snap-mandatory overflow-x-hidden",{"!overflow-x-scroll":_}),children:l.jsx("div",{className:"flex h-full flex-row flex-nowrap",style:{width:`${x.length*100}%`},children:x.map((M,A)=>l.jsx(Bde,{item:M,next:k,prev:I},A))})}),l.jsx("div",{className:"gap-xs bottom-sm absolute left-1/2 flex -translate-x-1/2 flex-row",children:Array.from({length:x.length},(M,A)=>l.jsx("div",{onClick:()=>{N(A)},className:z("size-[6px] cursor-pointer rounded-full bg-black dark:bg-white",{"opacity-50":A===r,"opacity-[10%]":A!==r})},A))})]})})]})})});Lde.displayName="ProsConsGrid";const Fde=T.memo(({item:e,index:t,setIsFlipped:n,setDetailIndex:r})=>{const s=d.useCallback(()=>{n(!0),r(t)},[t,r,n]);return l.jsx(mr,{as:"button",onClick:s,className:"px-md active:bg-subtler dark:active:bg-subtle cursor-pointer",children:l.jsxs("div",{className:"gap-sm flex flex-row items-center",children:[l.jsx(V,{variant:"smallBold",className:"leading-tight",color:e.type==="pro"?"super":"light",children:l.jsx(ge,{icon:e.type==="pro"?B("check"):B("x"),size:"sm"})}),l.jsx(V,{variant:"smallBold",className:"line-clamp-2 text-left leading-tight",color:e.type==="pro"?"super":"light",children:e.label})]})})});Fde.displayName="CanonicalCardFactory";const Bde=T.memo(({item:e,next:t,prev:n})=>{const{isMobileUserAgent:r}=Re();return l.jsx("div",{onClick:s=>{if(r)return;const o=s.currentTarget.getBoundingClientRect();s.clientX-o.left>o.width/2?t():n()},className:"scrollbar-none size-full cursor-pointer select-none snap-center overflow-y-scroll",style:{mask:"linear-gradient(to bottom, black calc(100% - 40px), transparent calc(100% - 12px))",WebkitMask:"linear-gradient(to bottom, black calc(100% - 40px), transparent calc(100% - 12px))"},children:l.jsxs("div",{className:"p-md gap-xs flex flex-col pb-[32px] text-left",children:[l.jsxs(V,{variant:"smallBold",className:"gap-xs flex flex-row leading-tight",color:e.type==="pro"?"super":"default",children:[l.jsx(ge,{icon:e.type==="pro"?B("check"):B("x"),size:"sm",className:"translate-y-half shrink-0"}),e.label]}),l.jsx(V,{variant:"small",color:"light",children:e.description})]})})});Bde.displayName="ProConDetailCard";function wU(e){return new Date(`${e}T00:00:00`)}function vyt(e,t){const n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r)),r.setDate(r.getDate()+1);return n.length}const byt=({amount:e,currency:t,targetCurrency:n,exchangeRates:r,options:s})=>{const o=CU(e,t,s),a=e/1e6,i=r?.find(({source_currency:u,target_currency:f})=>u===t&&f===n);if(!i||n===t)return{original:o,originalAmount:a};const c=CU(e*i.conversion_factor,n,s);return{original:o,originalAmount:a,adjusted:c,adjustedAmount:e*i.conversion_factor/1e6}},CU=(e,t,n)=>rk(e!==null?e/1e6:e,t,n);function x_t(e){const t=new Date;return t.setDate(t.getDate()+e),t}function Ude(){const{locale:e}=J(),t=new Intl.Locale(e),{value:n,loading:r}=Dx({flag:"canonical-hotel-pages-enabled",defaultValue:!1,extraAttributes:{cfLanguage:t.language,appApiVersion:Yl}});return d.useMemo(()=>({initialized:!r,value:n}),[n,r])}const _yt=({entity_id:e,entity_name:t,data_source:n,entry_uuid:r,url:s,reason:o})=>{const a=Xt(),i=be.makeQueryKey("place_result_reviews",`${n}_${s}`),{refetch:c,data:u,isFetching:f,error:m}=gt({queryKey:i,enabled:!1,queryFn:async()=>{let p={summary:"",review_quality_score:0,pros:[],cons:[],key_features:[],review_search_results:[]},h="PENDING",g="";try{await de.SSE("/rest/sse/places_review_summary_bulk",o,{params:{places:[{entity_id:e,entity_name:t,data_source:n,entry_uuid:r,url:s}]},handlers:{message:y=>{y.blocks?.[0]?.review_summary_block&&(p={...p,...y.blocks[0].review_summary_block}),h=y.status??"FAILED",g=y.id??"",a.setQueryData(i,{review_summary:p,status:h,id:g})}}})}catch{}return{review_summary:p,status:h,id:g}}});return d.useMemo(()=>({generateReviewSummaryForPlace:c,reviewSummary:u?.review_summary,isFetching:f,error:m}),[u?.review_summary,m,c,f])},Vde=()=>{const{session:e}=je(),t=e?.user?.org_uuid;return{uuid:t==="none"?void 0:t}};function wyt(){const{value:e}=Ude(),{locale:t}=J(),n=new Intl.Locale(t),{uuid:r}=Vde(),{value:s,loading:o}=Dx({flag:"can-book-hotels",defaultValue:!1,extraAttributes:{cfLanguage:n.language,appApiVersion:Yl,dependent_flag:"canonical-hotel-pages-enabled",variation_served:e,orgUUID:r??""}});return d.useMemo(()=>({initialized:!o,value:s}),[o,s])}function SU(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}const v_t=async({filters:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/travel/hotels/search-widgets",t,{body:e,timeoutMs:Sn.NONE});if(n)return{hotels:n.hotels,map_item:n.map_item};throw new ye("API_CLIENTS_ERROR",{message:"No hotel results returned",cause:r,status:s.status??0})},Cyt=async({tripadvisorIds:e,searchPayload:t,reason:n})=>{const{checkIn:r,checkOut:s,numAdults:o,numChildren:a}=t,{data:i}=await de.POST("/rest/travel/hotels/search-availability",n,{body:{currency:"USD",filter:{tripadvisor_ids:e},stay_info:{check_in_date:SU(r),check_out_date:SU(s),guests:{adults:o,children:a}}},timeoutMs:Sn.HIGH,retries:2});return i?{availability:i.results,currencyExchangeRates:i.currency_exchange_rates,otaOffers:i.ota_hotel_offers}:null},Syt=({hotelIds:e,availabilitySearchPayload:t,priceConstraint:n,reason:r,enabled:s=!0})=>{const o=gt({queryKey:be.makeEphemeralQueryKey("hotelAvailabilities",e,t),queryFn:async()=>{if(t&&e.length>0){const c=await Cyt({tripadvisorIds:e,searchPayload:t,reason:r});if(c)return c;throw new Error("Failed to fetch availabilities")}return null},placeholderData:$l,enabled:s&&!!t&&e.length>0}),a=n?.max_price,i=d.useMemo(()=>{if(!t||!o.data?.availability&&!o.data?.otaOffers)return;const c=o.data.currencyExchangeRates,u=vyt(t.checkIn,t.checkOut)-1;if(u<=0)return;const f={};o.data.availability?.forEach(g=>{const y=g.tripadvisor_id,x=g.rooms?.reduce((w,S)=>{const C=S.rates?.slice()??[];C.sort((N,k)=>N.price.base_price-k.price.base_price);const E=C[0];return E?w?E.price.base_priceb)&&(f[y]=b)});const m={};o.data.otaOffers?.forEach(g=>{const y=g.tripadvisor_id,x=g.offers.map(({price:v})=>v);if(x.sort(),Hi(x)){const b=x[0]*u;m[y]=b}});const p={},h=new Set([...Object.keys(f),...Object.keys(m)]);for(const g of h){const y=f[g],x=m[g],v=y!==void 0?y/u:void 0,b=x!==void 0?x/u:void 0;if(v!==void 0&&(a==null||v<=a)&&y!==void 0){p[g]={price:y,source:"selfbook"};continue}b!==void 0&&(a==null||b<=a)&&x!==void 0&&(p[g]={price:x,source:"ota"})}return Object.entries(p).reduce((g,[y,x])=>(g[y]={total:rk(x.price,"USD",{roundToMajor:!0,renderZero:!0}),daily:rk(x.price/u,"USD",{roundToMajor:!0,renderZero:!0}),source:x.source},g),{})},[t,o.data,a]);return d.useMemo(()=>({lowestRatesByHotel:i,isFetching:o.isFetching,isError:o.isError,refetch:o.refetch}),[i,o.isFetching,o.isError,o.refetch])},Eyt=(e,t)=>{const{value:n,loading:r}=qt({flag:"get-opentable-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};function kyt(){const{locale:e}=J(),t=new Intl.Locale(e),{uuid:n}=Vde(),{variation:r,loading:s}=Eyt(!1,{language:t.language,country:t.region??"",appApiVersion:Yl,orgUUID:n??""});return d.useMemo(()=>({initialized:!s,value:r}),[s,r])}const Myt=({place:e,entryUUID:t,contextUUID:n,mode:r,reason:s,hotelRate:o})=>{const{$t:a}=J(),{SearchClientLogo:i}=Cde(e.url),{session:c}=je(),{trackEvent:u}=Ke(c),{openStackedModal:f}=gn().legacy,m=Ude(),p=wyt(),h=kyt(),{generateReviewSummaryForPlace:g,reviewSummary:y,isFetching:x}=_yt({entity_id:String(e.id),entity_name:e.name,entry_uuid:t??"",data_source:e.client,url:e.url,reason:s});d.useEffect(()=>{e.review_summary||y||g()},[e.review_summary,y]);const v="user_filters"in e?e.user_filters:void 0,b=d.useMemo(()=>{if(v?.start_date&&v?.end_date&&v?.num_guests)return{checkIn:wU(v.start_date),checkOut:wU(v.end_date),numAdults:v.num_guests,numChildren:0}},[v]),{lowestRatesByHotel:_}=Syt({hotelIds:[e.id],availabilitySearchPayload:b,priceConstraint:v?.price_constraint,reason:s,enabled:e.entity_type==="hotel"}),w=d.useMemo(()=>e.review_summary??y,[e.review_summary,y]),{hasProsOrCons:S,isLoadingProsCons:C}=d.useMemo(()=>{const L=w?.pros_detailed?.length??0,U=w?.cons_detailed?.length??0;return{hasProsOrCons:L||U||x,isLoadingProsCons:x&&!w?.summary?.length&&(L+U<3||!L||!U)}},[w?.pros_detailed,w?.cons_detailed,w?.summary?.length,x]),E=!!w?.summary,N=w?.key_features&&w.key_features.length>0,k=!E&&x,I=d.useCallback(()=>{const L=e.entity_url??e.url;return m.initialized&&m.value?e.canonical_page_path??L:L},[m,e.canonical_page_path,e.entity_url,e.url]),M=d.useCallback(()=>{const L=I();if(p.initialized&&p.value&&e.canonical_page_path&&e.entity_type==="hotel"&&"user_filters"in e&&e.user_filters){const U=new URLSearchParams;if(e.user_filters.start_date&&U.set("check-in",e.user_filters.start_date),e.user_filters.end_date&&U.set("check-out",e.user_filters.end_date),e.user_filters.num_guests&&U.set("adults",String(e.user_filters.num_guests)),U.toString())return`${L}?${U.toString()}`}return L},[I,p,e]),A=a({defaultMessage:"See Prices",description:"button label",id:"AOhh9Wa3/S"}),D=a({defaultMessage:"Reserve",description:"button label",id:"Rl2ClHM49w"}),P=d.useCallback(L=>{u("place button clicked",{answerMode:r,entryUUID:t,contextUUID:n,itemID:L})},[n,t,r,u]),F=d.useCallback(L=>{window.open(L,"_blank")},[]),R=d.useMemo(()=>{if(p.initialized&&p.value&&e.canonical_page_path&&e.entity_type==="hotel"){const L=o??_?.[e.id],U=M();return L?{ctaText:a({defaultMessage:"From {price} per night",id:"fkXL6pzn0I",description:"Button text indicating the starting price per night for a hotel"},{price:L.daily}),ctaURL:U,onClick:()=>{F(U)},ctaSubtitle:void 0,icon:B("tag")}:{ctaText:A,ctaURL:U,ctaSubtitle:void 0,onClick:()=>{F(U)},icon:B("tag")}}else if(e.booking_urls){const L=e.booking_urls[0];if(L?.booking_type==="HOTEL"&&p.value)return{ctaText:A,ctaURL:L.url,onClick:()=>{F(L.url)},icon:B("moneybag")};if(L?.booking_type==="RESTAURANT"){const U=h.initialized&&h.value&&L.provider_entity_id,O=L.booking_provider;return{ctaText:D,ctaURL:L.url,icon:B("calendar-event"),onClick:U?()=>{u("restaurant reservation CTA clicked",{booking_provider:O}),f("restaurantBookingModal",{restaurantId:L.provider_entity_id,provider:O})}:()=>{F(L.url)}}}}},[o,p,h,e,M,D,A,f,a,_,u,F]),j=d.useCallback(L=>{L.stopPropagation()},[]);return{generatedReviewSummary:w,hasProsOrCons:!!S,isLoadingProsCons:C,hasReviewSummary:E,hasKeyFeatures:!!N,reviewSummaryLoading:k,getEntityUrl:I,getEntityUrlWithParams:M,bookingCTAProperties:R,SearchClientLogo:i,handleClientLogoClick:j,trackPlaceButtonClicked:P}},Tyt=T.memo(({place:e,entryUUID:t,contextUUID:n,context:r="medium",children:s})=>{const o="place-inline-card",{$t:a}=J(),[i,c]=d.useState(!1),[u,f]=d.useState(Ie),{openModal:m}=gn().legacy,{generatedReviewSummary:p,hasProsOrCons:h,isLoadingProsCons:g,bookingCTAProperties:y,SearchClientLogo:x,handleClientLogoClick:v}=Myt({place:e,entryUUID:t,contextUUID:n,reason:o}),{session:b}=je(),{trackEvent:_,trackEventOnce:w}=Ke(b);d.useEffect(()=>{t&&(w("entity card shown",{entryUUID:t,entityType:"places"}),n&&_("place card viewed",{inline:!0,entryUUID:t,contextUUID:n,itemID:e.url}))},[t,n,e.url,_,w]);const S=d.useCallback(()=>{_("entity card clicked",{entryUUID:t,entityType:"places"})},[t,_]),C=d.useCallback(async()=>{const O=[];if(e.image_url&&O.push(e.image_url),e.images&&e.images.forEach(G=>{G!==e.image_url&&O.push(G)}),!O.length){f(Ie);return}const $=[];for await(const G of C2e(O))$.length===0&&f(G.map(H=>({image:H,url:H.includes("tripadvisor.com")?e.url:e.entity_url??e.url}))),$.push(...G);f($.map(G=>({image:G,url:G.includes("tripadvisor.com")?e.url:e.entity_url??e.url})))},[e.image_url,e.images,e.url,e.entity_url]);d.useEffect(()=>{C()},[C]);const E=d.useMemo(()=>u.map(O=>O.image),[u.length]),{colorScheme:N}=Ss(),k=d.useCallback(()=>c(!0),[]),I=d.useCallback(()=>c(!1),[]),M=d.useCallback(()=>{window.open(b2e(e.name,e.address?.join(", ")??""),"_blank")},[e.name,e.address]),A=d.useCallback(O=>{S(),O==="cta"&&y?y.onClick():m("placeModal",{place:e,entryUUID:t,contextUUID:n})},[S,m,t,n,e,y]),D=a({defaultMessage:"Website",id:"JkLHGwmS9L"}),P=a({defaultMessage:"Directions",id:"fuwkSr5Bz7"}),F=a({defaultMessage:"Call",id:"f+GKc4i1Gc"}),R=d.useMemo(()=>[(e.price||e.price_range)&&l.jsx(Vn,{id:"price",children:l.jsx($h,{textVariant:"smallBold",priceSymbols:e.price,priceRange:e.price_range,currencySymbol:e.currency_char})},"price"),e.rating&&l.jsx(Vn,{id:"rating",children:l.jsx(dx,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"sm",variant:"truncated",textVariant:"smallBold",reviewTextVariant:"small",color:"default",url:x&&e.url?e.url:void 0})},"rating"),!!e.standardized_hours&&l.jsx(Vn,{id:"open-until",children:l.jsx(fx,{place:e})},"open-until"),x&&l.jsx(Vn,{id:"logo",children:l.jsx(Hde,{SearchClientLogo:x,url:e.url,handleClick:v})},"logo"),...r==="medium"?[l.jsx(Vn,{id:"website",children:l.jsx(Uy,{label:D,href:e.entity_url??e.url})},"website"),!!e.address?.length&&l.jsx(Vn,{id:"directions",children:l.jsx(Uy,{label:P,href:v2e(e.name,e.address.join(", "))})},"directions"),!!e.phone&&l.jsx(Vn,{id:"call",children:l.jsx(Uy,{label:e.phone,href:`tel:${e.phone}`})},"call")]:Ie].filter(O=>!!O),[x,v,e,D,P,r]),j=d.useMemo(()=>[y&&{label:y.ctaText,icon:y.icon,onClick:()=>A("cta"),emphasize:!0},e.address?.length&&{label:P,onClick:()=>M(),icon:B("map-pin")},(e.entity_url||e.url)&&{label:D,onClick:()=>window.open(e.entity_url??e.url,"_blank"),icon:B("world")},e.phone&&{label:F,onClick:()=>window.open(`tel:${e.phone}`,"_blank"),icon:B("phone")}].filter(O=>!!O),[y,A,e.entity_url,e.url,D,P,M,e.address?.length,e.phone,F]),L=d.useMemo(()=>y?l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("span",{className:"text-[16px]",children:y.ctaText}),y.ctaSubtitle&&l.jsx("span",{className:"text-quiet -mt-1 text-xs font-normal",children:y.ctaSubtitle})]}):null,[y]),U=d.useMemo(()=>y?l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("span",{className:"text-lg",children:y.ctaText}),y.ctaSubtitle&&l.jsx("span",{className:"text-quiet -mt-0.5 text-sm font-normal",children:y.ctaSubtitle})]}):null,[y]);return r==="small"?l.jsx(lM,{images:E,showControls:i,onImageClick:()=>A("title"),children:l.jsxs(Yu.Root,{children:[l.jsx(Yu.Image,{children:l.jsx(mr,{fullBleed:!0,className:"aspect-[4/3] w-full overflow-hidden",children:l.jsx(By,{})})}),l.jsxs(Yu.Content,{children:[l.jsx(Yu.Action,{onClick:()=>A("title"),children:l.jsx(Yu.Title,{children:e.name})}),l.jsx(V,{color:"light",children:l.jsx(ya,{className:"gap-xs flex flex-row flex-wrap",children:R})}),l.jsx("div",{className:"-mt-sm",children:s}),l.jsx(Yu.Footer,{children:l.jsx(myt,{actions:j})})]})]})}):l.jsx("div",{className:"group relative","data-testid":"place-inline-card",children:l.jsx(lM,{images:E,showControls:i,onImageClick:()=>A("title"),children:l.jsxs("div",{className:"gap-md @container mt-4 flex flex-col",children:[l.jsxs("div",{className:"gap-sm flex flex-row items-end",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(Pde,{title:e.name,onClick:()=>A("title")}),l.jsx(V,{color:"light",children:l.jsx(ya,{className:"gap-xs flex flex-row flex-wrap",children:R})})]}),y&&l.jsx("div",{className:"@[420px]:block ml-auto hidden",children:l.jsx(ze,{variant:"primaryGhost",icon:y.icon,size:"regular",pill:!0,onClick:()=>A("cta"),text:L})})]}),(!u||u.length<1)&&!h?null:l.jsxs("div",{className:"gap-sm @[420px]:grid-cols-2 @[640px]:grid-cols-3 grid w-full grid-cols-1",children:[u&&u[0]&&l.jsx(mr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:"aspect-[4/3] overflow-hidden",children:l.jsx(By,{})}),l.jsx(mr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:z("overflow-hidden",{"aspect-[4/3]":u&&u.length>1&&(h||!h&&u&&u[2]),"@[640px]:block hidden h-full":h||!h&&u&&u[2],"@[420px]:block @[640px]:col-span-2 hidden h-full":!h&&u&&u.length===1||h&&(!u||u.length<1)}),children:l.jsxs(K,{as:"button",onClick:M,className:"relative size-full",children:[l.jsx("img",{className:"absolute left-1/2 top-1/2 max-w-[unset] -translate-x-1/2 -translate-y-1/2",...yyt({mode:N,width:512,height:512,lat:e.lat,long:e.lng}),alt:""}),l.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-visible",children:l.jsx(n7,{})})]})}),h?l.jsx("div",{className:z("@[420px]:h-full h-[124px]",{"aspect-[4/3]":!u?.length}),children:l.jsx(Lde,{pros:p?.pros_detailed??Ie,cons:p?.cons_detailed??Ie,loading:g})}):u&&u[2]?l.jsx(mr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:"@[420px]:block hidden aspect-[4/3] overflow-hidden",children:l.jsx(By,{})}):null]}),y&&e.canonical_page_path?l.jsx("div",{className:"-mt-sm @[420px]:hidden block",children:l.jsx(ze,{variant:"primaryGhost",icon:y.icon,fullWidth:!0,size:"regular",pill:!0,onClick:()=>A("cta"),text:U})}):null,s]})})})});Tyt.displayName="PlaceInlineCard";const fx=T.memo(({place:e,textVariant:t="smallBold",condensed:n=!1,showTooltip:r=!0})=>{const{$t:s}=J(),o=t7(e.standardized_hours,e.timezone,"short"),[a,i]=d.useMemo(()=>{for(const u of o)if(u.isToday){for(const f of u.hours)if(f.isOpenNow)return f.open!==f.close?[!0,f.close]:[!0,null]}return[!1,null]},[o]),c=d.useMemo(()=>l.jsx(Ode,{standardizedHours:e.standardized_hours,timezone:e.timezone}),[e.standardized_hours,e.timezone]);return l.jsx(Oo,{tooltipText:c,asChild:!0,showTooltip:r,children:l.jsx(V,{variant:t,color:a?"super":"red",children:a?i&&!n?s({defaultMessage:"Open until {time}",id:"abDRIJdom/"},{time:i}):s({defaultMessage:"Open",id:"JfG49wNHKP"}):s({defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})})});fx.displayName="OpenUntil";const Uy=T.memo(({label:e,href:t,textVariant:n="smallBold",icon:r})=>{const s=d.useCallback(a=>{a.stopPropagation()},[]),o=l.jsxs(V,{variant:n,color:"light",className:z("gap-xs flex items-center truncate transition-colors duration-150",{"hover:text-super":t}),children:[r?l.jsx(Jt,{icon:r,size:"tiny"}):null,e]});return t?l.jsx(xt,{href:t,target:"_blank",className:"cursor-pointer truncate",onClick:s,children:o}):o});Uy.displayName="MetaDataItem";const Hde=T.memo(({SearchClientLogo:e,url:t,handleClick:n})=>{const r=d.useCallback(o=>{o.stopPropagation()},[]),s=n||r;return e?t?l.jsx(xt,{href:t,target:"_blank",className:"cursor-pointer duration-150 hover:opacity-70",onClick:s,children:l.jsx(e,{})}):l.jsx(e,{}):null});Hde.displayName="SearchClientLogoWrapper";const Ayt=3,zde=T.memo(({placeWidgets:e})=>{const{$t:t}=J(),n=ci(),{result:{backend_uuid:r,context_uuid:s},isLastResult:o}=Ot(),{setActiveThreadTab:a,handleTabScrollBehavior:i}=kg(),c=XX(),{session:u}=je(),{trackEventOnce:f,trackEvent:m}=Ke(u),{answerModeActionList:p,currentModeData:{mode:h}}=u6(),[g,y]=d.useState(null),[x,v]=d.useState(null);d.useEffect(()=>{f("maps preview viewed",{entryUUID:r,contextUUID:s})},[f,r,s]);const b=d.useMemo(()=>e.slice(0,Ayt),[e]),_=d.useMemo(()=>e.map(C=>Rde(C)),[e]),w=d.useMemo(()=>{const C=p.some(N=>N.mode==="hotels"),E=p.some(N=>N.mode==="places");return C?"hotels":E?"places":"default"},[p]),S=d.useCallback(()=>{m("maps preview see more clicked",{entryUUID:r,contextUUID:s}),i(w),a(w),c(w)},[a,c,i,w,r,s,m]);return e.length?l.jsxs(K,{className:"bg-subtler relative flex h-96 w-full overflow-hidden rounded-xl border",children:[l.jsx("div",{className:"absolute inset-0",children:l.jsx(Dde,{entryUUID:r,contextUUID:s,selectedLocation:g,setSelectedLocation:y,highlightedLocation:x,setHighlightedLocation:v,setRenderedLocations:Ro,locations:_,showNavControl:!1,showRating:!0,answerMode:h})}),l.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:n?l.jsx("div",{className:"bottom-sm gap-sm pointer-events-auto absolute inset-x-0 flex flex-col",children:l.jsxs("div",{className:"px-sm gap-sm flex overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[b.map(C=>{const E=_.findIndex(k=>k.url===C.url),N=_[E];return N?l.jsx(cM,{place:C,isSelected:g?.url===C.url,onSelect:()=>{y(N)},onMouseEnter:()=>{v(N)},onMouseLeave:()=>v(null),isMobile:!0},C.url):null}),l.jsx("span",{className:"inline-flex items-center",children:l.jsx(Ct,{icon:B("chevron-right"),"aria-label":t({defaultMessage:"See more places",id:"q6PxnN/+4O"}),variant:"secondary",size:"default",rounded:!0,disabled:!o,onClick:S})})]})}):l.jsxs("div",{className:"inset-y-sm right-sm pointer-events-auto absolute flex w-64 flex-col justify-between truncate",children:[b.map(C=>{const E=_.findIndex(k=>k.url===C.url),N=_[E];return N?l.jsx(cM,{place:C,isSelected:g?.url===C.url,onSelect:()=>{y(N)},onMouseEnter:()=>{v(N)},onMouseLeave:()=>v(null)},C.url):null}),l.jsx("span",{className:"bg-base rounded-lg",children:l.jsx(Ct,{variant:"secondary",size:"small",fullWidth:!0,disabled:!o,onClick:S,trailingIcon:B("arrow-right"),children:t({defaultMessage:"See more places",id:"q6PxnN/+4O"})})})]})})]}):null},(e,t)=>Hn(e,t)),cM=({place:e,isSelected:t,onSelect:n,onMouseEnter:r,onMouseLeave:s,isMobile:o=!1})=>l.jsx(K,{as:"button",onClick:n,onMouseEnter:r,onMouseLeave:s,className:z("hover:bg-subtler bg-base flex cursor-pointer overflow-visible rounded-lg border backdrop-blur-lg transition-colors",{"shadow-md":t,"shadow-sm":!t,"min-h-20 w-64 flex-shrink-0 flex-col p-2":o,"min-h-24 w-full items-center justify-between p-2.5":!o}),children:o?l.jsxs("div",{className:"gap-xs flex flex-col text-left",children:[l.jsx(V,{variant:"small",className:"!overflow-clip truncate font-medium leading-tight",children:e.name}),!!e.address?.length&&l.jsx(V,{variant:"tiny",color:"light",className:"!overflow-clip truncate",children:e.address?.join(", ")}),l.jsx("div",{className:"flex items-center",children:l.jsxs(ya,{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Vn,{id:"rating",children:l.jsx(dx,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"xs",variant:"truncated",textVariant:"tiny",reviewTextVariant:"tiny",color:"default"})}),(e.price||e.price_range)&&l.jsx(Vn,{id:"price",children:l.jsx($h,{textVariant:"tiny",priceSymbols:e.price,priceRange:e.price_range,dollarColor:"light",currencySymbol:e.currency_char})})]})}),e.operating_hours&&l.jsx(fx,{place:e,textVariant:"tiny",showTooltip:!1}),l.jsx("div",{className:"invisible flex-1"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-xs flex h-20 min-w-0 flex-1 flex-col justify-start text-left",children:[l.jsx(V,{variant:"small",className:"!overflow-clip truncate font-medium leading-tight",children:e.name}),!!e.address?.length&&l.jsx(V,{variant:"tiny",color:"light",className:"!overflow-clip truncate",children:e.address?.join(", ")}),l.jsx("div",{className:"flex items-center",children:l.jsxs(ya,{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Vn,{id:"rating",children:l.jsx(dx,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"xs",variant:"truncated",textVariant:"tiny",reviewTextVariant:"tiny",color:"default"})}),(e.price||e.price_range)&&l.jsx(Vn,{id:"price",children:l.jsx($h,{textVariant:"tiny",priceSymbols:e.price,priceRange:e.price_range,dollarColor:"light",currencySymbol:e.currency_char})})]})}),e.operating_hours&&l.jsx(fx,{place:e,textVariant:"tiny",showTooltip:!1}),l.jsx("div",{className:"invisible flex-1"})]}),e.image_url&&l.jsx("div",{className:"ml-sm size-20 flex-shrink-0 overflow-hidden rounded-sm",children:l.jsx($o,{alt:`${e.name} image`,src:e.image_url,includeLightBoxModal:!1,containerClassName:"size-full",imageClassName:"size-full object-cover"})})]})});zde.displayName="MapsPreview";cM.displayName="PlaceCard";const Wde=({widgetType:e,widgetName:t,hasData:n,metricName:r})=>{const{result:{mode:s}}=Ot(),o=c6();d.useEffect(()=>{if(!n)return;const a=r??`web.frontend.${e}_widget_render_time`;o(a,{widgetType:e,widgetName:t,queryMode:s,widgetSize:"full"})},[n,e,t,r,s,o])},Nyt=Se(async()=>{const{CitationListModal:e}=await Ee(()=>q(()=>Promise.resolve().then(()=>RN),void 0));return{default:e}}),Ryt=12,Dyt=new Array(3).fill(null),Gde="w-[166px]",$de=T.memo(({showSkeletonUnits:e,results:t})=>{const{$t:n}=J(),{isMobileStyle:r}=Re(),{openModal:s}=Ho(),{session:o}=je(),{trackEvent:a}=Ke(o);Wde({widgetType:"news",widgetName:"news",hasData:t.length>0});const i=d.useCallback(()=>{a("clicked news results see more"),s(Nyt,{legacyIdentifier:"citationListModal",webResults:t,citationType:"articles"})},[s,t,a]),c=d.useMemo(()=>[...t.filter(f=>f.meta_data?.images&&f.meta_data.images.length>0),...t.filter(f=>!f.meta_data?.images||f.meta_data.images.length===0)],[t]),u=d.useMemo(()=>c.length===3?2:Math.min(4,c.length),[c]);return r?l.jsxs(K,{className:z("gap-sm","-mx-pageHorizontalPadding px-pageHorizontalPadding scrollbar-none grid auto-cols-max grid-flow-col overflow-x-auto"),children:[c.slice(0,Ryt).map((f,m)=>l.jsx(uM,{result:f,idx:m,variant:"mobile"},`${f.url}-${f.timestamp}`)),e&&Dyt.map((f,m)=>l.jsx(K,{variant:"subtler",className:`h-16 ${Gde} flex-shrink-0 rounded-lg`},m))]}):l.jsxs("div",{children:[l.jsxs("div",{className:"gap-x-xl mb-md relative grid grid-cols-2",children:[c.slice(0,u).map((f,m)=>l.jsx(uM,{result:f,idx:m,variant:"desktop",fullWidth:u==1,showBorder:m2},`${f.url}-${f.timestamp}`)),u>1&&l.jsx("div",{className:"border-subtlest absolute inset-y-0 left-1/2 w-0 border-l"})]}),l.jsxs("div",{className:"relative -ml-3",children:[l.jsx("div",{className:"bg-base relative z-10 w-fit",children:l.jsx(Ct,{size:"small",variant:"text",onClick:i,children:n({defaultMessage:"See more news",id:"2MUZ4GQuje"})})}),l.jsx("hr",{className:"border-subtlest absolute inset-x-0 top-1/2"})]})]})});$de.displayName="NewsWidget";const uM=T.memo(({result:e,idx:t,variant:n,showBorder:r,fullWidth:s})=>{const{$t:o}=J(),{session:a}=je(),{trackEvent:i,trackEventOnce:c}=Ke(a),{result:u}=Ot(),f=rJ({trackEvent:i,entryUUID:u.backend_uuid,frontendContextUUID:u.uuid,contextUUID:u.context_uuid});d.useEffect(()=>{c("news source viewed",{url:e.url,title:e.name,position:t,entryUUID:u.backend_uuid,frontendContextUUID:u.uuid,contextUUID:u.context_uuid,published_date:e.meta_data?.published_date,domain_name:e.meta_data?.domain_name})},[c,e.url,e.name,e.meta_data?.published_date,e.meta_data?.domain_name,t,u.backend_uuid,u.uuid,u.context_uuid]);const m=d.useMemo(()=>()=>{f("news source clicked",{citation_url:e.url,citation_index:t})},[e,f,t]),p=e.meta_data?.images?.[0],h=d.useMemo(()=>({color:"light"}),[]);return n=="desktop"?l.jsx(GS,{href:e.url,rel:"noopener",onTrackEvent:m,className:z("group",{"col-span-full":s}),children:l.jsx("div",{className:z({"pb-md mb-md border-subtlest border-b":r}),children:l.jsxs("div",{className:"gap-md flex h-24 flex-row",children:[l.jsxs("div",{className:"flex flex-1 flex-col max-w-[200px]",children:[l.jsx(V,{variant:"small",className:"group-hover:!text-super mb-auto line-clamp-3 transition-colors duration-200 font-medium",children:e.name}),l.jsxs("div",{className:"flex",children:[l.jsx(xa,{variant:"tinyRegular",color:"light",url:e.url,isAttachment:e.is_attachment,source:e.meta_data?.domain_name}),l.jsxs(V,{variant:"tiny",color:"light",className:"flex shrink-0 truncate",children:[l.jsx("span",{children:" · "}),l.jsx(pf,{recentlyUpdatedLabel:o({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.meta_data?.published_date,timestampProps:h,includeIcon:!1})]})]})]}),p&&l.jsx(dM,{src:p,alt:"",className:"aspect-[4/3] w-32"})]})})}):l.jsx(GS,{href:e.url,rel:"noopener",onTrackEvent:m,children:l.jsxs(mr,{className:z("flex h-full cursor-pointer flex-col gap-2 rounded-lg p-1","border",`${Gde} flex-shrink-0`),children:[p&&l.jsx(dM,{src:p,alt:"",className:"h-32 w-full"}),l.jsx(K,{className:"flex min-h-[60px] flex-1 flex-col justify-between p-2 pt-1",children:l.jsxs(K,{className:"flex flex-1 flex-col",children:[l.jsx(V,{variant:"small",className:"line-clamp-3",children:e.name}),l.jsx("div",{className:"mt-auto py-2",children:l.jsx(V,{variant:"tiny",color:"light",className:"gap-x-xs flex",children:l.jsx(pf,{recentlyUpdatedLabel:o({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.meta_data?.published_date,timestampProps:h,includeIcon:!1})})}),l.jsx(xa,{variant:"tinyRegular",color:"light",url:e.url,isAttachment:e.is_attachment})]})})]})})});uM.displayName="CitationTrendingCard";const dM=T.memo(({src:e,alt:t,className:n})=>{const[r,s]=d.useState(!1);return l.jsx(K,{className:z("relative overflow-hidden rounded-md bg-gray-100 dark:bg-gray-700",n),children:r?l.jsx(K,{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:l.jsx(ft,{name:B("photo"),size:32})}):l.jsx("img",{src:e,alt:t,className:"size-full object-cover",loading:"lazy",onError:()=>s(!0)})})});dM.displayName="TrendingImageThumbnail";const jyt=(e,t,n)=>{const{value:r,loading:s}=qt({flag:"news-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},qde=T.memo(({submitQuery:e})=>{const{$t:t}=J(),{session:n}=je(),{trackEvent:r}=Ke(n),{removeWidgetFromEntry:s}=cv({reason:"thread-content"}),o=x0(),{result:a,widgetData:i,response:c,isEntryInFlight:u,financeWidgetData:f,newsWidgetData:m,weatherWidgetData:p,timeWidgetData:h,timerWidgetData:g,currencyExchangeWidgetData:y,predictionMarketWidgetData:x,calculatorWidgetData:v,flightStatusWidgetData:b,sportsWidgetData:_,priceComparisonWidgetData:w,genericFallbackWidgetData:S,highPriorityWidgets:C,lowPriorityWidgets:E,mapsPreviewData:N}=Ot(),{variation:k}=jyt(!1);Wde({widgetType:"news",widgetName:"news_block",hasData:!!m?.web_results?.length,metricName:"web.frontend.news_block_received"});const{standardWidgetData:I,codeInterpreterImages:M}=i.reduce((X,ee)=>(ee.is_code_interpreter&&ee.is_image?X.codeInterpreterImages.push(ee):X.standardWidgetData.push(ee),X),{standardWidgetData:[],codeInterpreterImages:[]}),A=d.useMemo(()=>M.length>0,[M]),D=d.useMemo(()=>!A&&I.length>0,[A,I]),P=d.useMemo(()=>!1,[m?.web_results,a?.display_model,k]),F=d.useCallback(X=>{a?.frontend_context_uuid&&a?.backend_uuid&&(s({entryUUID:a.backend_uuid,data:X}),r("remove widget",{url:"url"in X?X.url:X?.links?.[0]?.url??"",entryUUID:a.backend_uuid,source:"thread"}))},[s,a?.backend_uuid,r,a?.frontend_context_uuid]),R=d.useCallback((X,ee,le,re,ce)=>{const ue=ce||("name"in X?X.name:"url"in X?X.url:X?.links?.[0]?.url??"");return l.jsx(e7,{data:X,submit:e,isReadonly:ee,menuItems:ee||u?[]:[{type:"default",text:t({defaultMessage:"Report",id:"x5Tz6MZH82"}),icon:B("thumb-down"),onClick:()=>le&&le(X)}],inFlight:u,entryUUID:a?.backend_uuid??null,tableCitationOffset:re},ue)},[u,e,t,a?.backend_uuid]),j=d.useCallback((X,ee,le)=>{const re={name:`${ee}-widget`,snippet:"",timestamp:"",url:"",meta_data:X,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""};return R(re,o,F,c?.web_results?.length,le)},[F,o,c?.web_results?.length,R]),L=d.useCallback(X=>R(X,o,F,c?.web_results?.length),[F,o,c?.web_results?.length,R]),U=d.useCallback(X=>j(X,"sports"),[j]),O=d.useCallback(X=>j(X,"weather"),[j]),$=d.useCallback(X=>j(X,"time"),[j]),G=d.useCallback(X=>j(X,"timer"),[j]),H=d.useCallback(X=>j(X,"currency_exchange"),[j]),Q=d.useCallback(X=>j(X,"prediction-market"),[j]),Y=d.useCallback(X=>j(X,"calculator"),[j]),te=d.useCallback(X=>j(X,"flight-status"),[j]),se=d.useCallback(X=>j(X,"price-comparison"),[j]),ae=d.useCallback(X=>j(X,"generic-fallback"),[j]);return l.jsxs(l.Fragment,{children:[f&&l.jsx(J8,{data:f}),P&&m&&l.jsx($de,{results:m.web_results}),A&&M.map(X=>l.jsx("div",{children:R(X,o)},X.url)),D&&C.map(L),S&&ae(S),p&&O(p),h&&$(h),g&&G(g),y&&H(y),x&&Q(x),v&&Y(v),b&&te(b),_&&U(_),w&&se(w),D&&E.map(L),N&&N.place_widgets.length>0&&l.jsx(zde,{placeWidgets:N.place_widgets})]})});qde.displayName="WidgetsSection";const Iyt=Se(async()=>{const{MarkSpinner:e}=await Ee(()=>q(()=>import("./MarkSpinner-Hdt8Lk_P.js"),__vite__mapDeps([28,4,1])));return{default:e}}),Pyt=T.memo(({title:e,titleIcon:t,titleAccessory:n,titleUrl:r,showPplxMark:s,queryStr:o,loading:a,className:i="mb-md"})=>{const{session:c}=je(),{trackEvent:u}=Ke(c),[f,m]=d.useState(!1),p=d.useCallback(()=>{r!=null&&(u("click result entry header",{query:o}),window.open(r,"_blank")?.focus())},[u,o,r]);return l.jsxs("div",{className:z("flex w-full items-center justify-between",i),children:[l.jsx("div",{onClick:p,className:z({"cursor-pointer":r!=null}),children:l.jsxs("div",{color:"super",className:"space-x-sm flex items-center",children:[(s||t)&&l.jsx(V,{variant:"section-title",as:"div",children:s?l.jsx("div",{className:"relative -top-px flex w-[24px] transform-gpu items-center justify-center",onClick:()=>{m(!0),setTimeout(()=>{m(!1)},0)},children:l.jsx(Iyt,{size:24,shouldAnimate:a||f})}):t&&l.jsx("div",{className:"w-[24px]",children:l.jsx(Jt,{icon:t,size:"large"})})}),l.jsx(V,{variant:"section-title",as:"div",children:e})]})}),n]})});Pyt.displayName="ThreadEntryHeader";const Kde=T.memo(({header:e,children:t})=>l.jsxs(K,{children:[e&&l.jsx(K,{variant:"background",className:"flex items-center justify-between",children:e}),t]}));Kde.displayName="ThreadEntrySection";const Oyt=Se(async()=>{const{ConnectorAuthorizationPrompt:e}=await Ee(()=>q(()=>import("./ConnectorAuthorizationPrompt-BPug_Ihh.js"),__vite__mapDeps([469,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),Lyt=Se(async()=>{const{ThreadEntryFooter:e}=await Ee(()=>q(()=>import("./ThreadEntryFooter-CtAVhJnA.js"),__vite__mapDeps([470,4,1,8,3,9,6,7,471,103,104,81,82,83,47,472,473,474,475,49,50,476,477,10,11,12])));return{default:e}}),Fyt=Se(async()=>{const{RelatedContent:e}=await Ee(()=>q(()=>import("./Related-Dwf5MNnK.js"),__vite__mapDeps([478,4,1,6,3,475,479,9,7,480,8,10,11,12])));return{default:e}}),Byt=Se(async()=>{const{StudyModeRelated:e}=await Ee(()=>q(()=>import("./StudyModeRelated-DzWz27K7.js"),__vite__mapDeps([481,4,1,6,3,475,479,9,7,8,10,11,12])));return{default:e}}),Uyt=Se(async()=>{const{ThreadContentResponse:e}=await Ee(()=>q(()=>import("./ThreadContentResponse-DsqMwMTf.js"),__vite__mapDeps([482,4,1,6,3,55,8,9,7,54,471,103,104,81,82,83,47,472,473,474,475,49,50,476,53,10,11,12])));return{default:e}}),Vyt=Se(()=>Ee(()=>q(()=>import("./AnswerComparisonModal-BGcMfXsd.js"),__vite__mapDeps([483,4,1,6,3,482,55,8,9,7,54,471,103,104,81,82,83,47,472,473,474,475,49,50,476,53,10,11,12])))),Yde=T.memo(({streamId:e,backendUuid:t})=>{throw new Fl("STREAM_FAILED_PLACEHOLDER_ERROR",{details:{request_id:e,backend_uuid:t}})});Yde.displayName="FailedPlaceholderError";const Qde=T.memo(({submitQuery:e,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o,shouldShowRelatedContent:a=!0,sbsEntriesGroup:i})=>{const c="thread-content",{session:u}=je(),{trackEvent:f}=Ke(u);cv({reason:c});const{result:m,isEntryInFlight:p,response:h,hasLLMToken:g,isAnswerSkipped:y,steps:x,isPending:v,hasMediaOnlyLayout:b,isAgentWorkflowInFlight:_,isFinalStep:w,taskWidgetData:S,hasFastWidget:C,isLastResult:E,idx:N,hasAnswer:k,hasWebResults:I,searchImplementationMode:M}=Ot(),A=M!=="multi_step",D=Dve(),P=V4(),F=FJ(),R=d.useRef(null),j=d.useMemo(()=>{const mt=m?.side_by_side_metadata?.selection_status;return mt===la.SELECTED||mt===la.TIE},[m?.side_by_side_metadata?.selection_status]),L=d.useMemo(()=>i.length<1?[]:[...i].sort((mt,Qe)=>mt.backend_uuid.slice(-8).localeCompare(Qe.backend_uuid.slice(-8),void 0,{sensitivity:"base"})),[i]),{trackJudgment:U,trackBannerExposure:O,trackSBSExposure:$}=Qve({results:L,session:u,trackEvent:f}),G=d.useMemo(()=>{const mt=m?.side_by_side_metadata?.sibling_uuid;return mt?wt.getItem(`sbs-banner-dismissed-${mt}`)==="true":!1},[m?.side_by_side_metadata?.sibling_uuid]),H=d.useMemo(()=>i.length>1,[i]),Q=d.useMemo(()=>m?.side_by_side_metadata?.sibling_uuid,[m]),Y=d.useMemo(()=>m?.display_model==="pplx_study",[m?.display_model]),te=d.useMemo(()=>F?!G&&(j||H&&k):!1,[G,F,H,j,k]),se=d.useCallback(()=>{Q&&wt.setItem(`sbs-banner-dismissed-${Q}`,"true")},[Q]);d.useEffect(()=>{te&&O()},[te,O]);const[ae,X]=d.useState(!1),ee=d.useMemo(()=>L.map(mt=>Yt.parseAskTextField(mt)??void 0).filter(mt=>mt!==void 0),[L]),le=d.useCallback(async mt=>{try{U(mt);const Qe=L[0]?.side_by_side_metadata?.sibling_uuid;await u_e(mt,L,Qe,P),X(!1)}catch(Qe){Z.error("Failed to process answer selection:",Qe)}},[L,P,U]),re=d.useCallback(()=>{X(!0),$()},[$]),ce=d.useCallback(async()=>{if(m.upsell_information?.upsell_type!=="WAIT_FOR_CONNECTOR_AUTH_CONFIRMATION")return;const mt=m?.backend_uuid;mt&&await cl({uuid:mt,event_type:"CONNECTOR_AUTH",connector_auth_action:!1})},[m?.backend_uuid,m.upsell_information?.upsell_type]),ue=d.useMemo(()=>i.some(mt=>Yt.isStatusPending(mt)),[i]),pe=d.useMemo(()=>{if(!m?.query_str)return"";const{actualQuery:mt}=$x(m.query_str);return mt||""},[m?.query_str]),xe=d.useCallback(()=>X(!1),[]),he=d.useRef(null),{hasAccessToProFeatures:_e}=Bt();aJ({entryUUID:m?.backend_uuid??"",target:he,targetVisibilityPortionThreshold:.3,frontendContextUUID:m?.frontend_context_uuid??"",hasLLMToken:g});const ke=ln(),De=dLe(),Ce=fz(m?.frontend_uuid),Be=Lve(m?.backend_uuid),we=Yt.isStatusFailed(m),$e=we&&m.reconnectable&&Ce;d.useEffect(()=>{ke.maybeSendSearchResult(h,x,v)},[v,I,h,ke,x]);const yt=d.useCallback(()=>{D(m.backend_uuid??"")||gx("Retry stream")},[m.backend_uuid,D]),me=d.useMemo(()=>()=>l.jsx(Xf,{retryFn:yt,errorCode:Be?.code}),[yt,Be?.code]),ve=d.useMemo(()=>Y&&(N+1)%tge===0,[Y,N]),Ae=a&&!ve,ht=d.useMemo(()=>!!(b||y||C||!_&&(w||C)),[b,y,_,w,C])?"thread":"steps";return l.jsxs(l.Fragment,{children:[te&&l.jsx(Roe,{onClick:re,didSelectAnswer:j,onDismiss:se}),m?.connector_auth_info&&l.jsx(Oyt,{connectorAuthInfo:m.connector_auth_info,isLastResult:E,backendUuid:m?.backend_uuid,inFlight:p}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx(Jd,{position:"top",idx:N,upsellInformation:m.blocking_banner_information,backendUuid:m?.backend_uuid,isLastResult:E,inFlight:p,onReject:ce})}),De&&p&&l.jsx(uLe,{data:De}),l.jsxs(Dp,{value:ht,animation:"fade",children:[l.jsx(Dp.Panel,{value:"steps",children:l.jsx(Ty,{loading:_,isFastSearch:A})}),l.jsx(Dp.Panel,{value:"thread",children:l.jsx(Kde,{children:l.jsxs("div",{className:"gap-y-md flex flex-col",children:[!C&&l.jsx(Ty,{isFastSearch:A,loading:_}),l.jsx(qde,{submitQuery:e}),C&&l.jsx(Ty,{isFastSearch:A,loading:_}),l.jsx(Uyt,{submitQuery:e,setQuote:o,markdownRef:R,response:h}),_e&&F&&S&&l.jsx(vde,{taskWidgetData:S,submitQuery:e}),l.jsx(Lyt,{submitQuery:e,deleteLastResult:s,showFeedbackCue:t,markdownRef:R}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx(Jd,{position:"bottom",idx:N,upsellInformation:m.upsell_information,backendUuid:m?.backend_uuid,isLastResult:E,inFlight:p,contextUuid:m?.context_uuid})})]})})})]}),l.jsxs("div",{className:"gap-y-lg flex flex-col first:mt-0",children:[we&&!$e&&l.jsx(Ar,{fallback:me,children:l.jsx(Yde,{streamId:Be?.id.description??"unknown",backendUuid:Be?.entryId??"unknown"})}),Ae&&l.jsx(Fyt,{shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,submitQuery:e}),ve&&l.jsx(Byt,{onClick:e})]}),H&&l.jsx(Vyt,{isOpen:ae,onClose:xe,responses:ee,queryStr:pe,onSelectAnswer:le,isAnyEntryPending:ue})]})});Qde.displayName="LowerPriorityThreadContent";const Hyt=e=>{const{result:{classifier_results:t,query_source:n}}=Ot(),r=c6(),{classifierResults:s}=zn(),o=t,a=typeof o<"u",i=s[e],c=typeof i<"u",u=n==="default_search";return d.useEffect(()=>{u&&(a&&r("web.frontend.browser.mhe_loaded_ms"),c&&r("web.frontend.browser.mhe_extension_loaded_ms"))},[a,c,u,r]),i??o},zyt=(e,t,n)=>{const{value:r,loading:s}=Tf({flag:"nav_results_count_classifier",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Wyt=(e,t,n)=>{const{value:r,loading:s}=Tf({flag:"nav-intent-classifier",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Gyt=(e,t)=>t.classifier==="comet_nav_widget"?e.mhe_predictions_full?.comet_nav_widget:t.classifier==="comet_nav_widget_combined_target"?e.mhe_predictions_full?.comet_nav_widget_combined_target:e.mhe_predictions_full?.comet_nav_widget,$yt=(e,t)=>{const n=Ca(),r=Gyt(e,t);if(!n)return"top";if(t.use_default_threshold)return r?.is_true?"top":"hidden";const o=t.threshold,a=r?.probability,i=a!=null&&!isNaN(a)&&!isNaN(o)&&a>=o;return r&&i?"top":"hidden"},qyt=(e,t)=>{if(!t)return"hidden";const n=t?.mhe_predictions;return n?.personal_search||n?.skip_search||n?.image_generation_intent||n?.time_widget||n?.weather_widget||n?.calculator_widget?"hidden":e.classifier==="nav_intent"?"top":e.classifier==="comet_nav_widget"||e.classifier==="comet_nav_widget_combined_target"?$yt(t,e):"top"},Kyt={classifier:"nav_intent",use_default_threshold:!0,threshold:0},Yyt=({classifierResults:e,resultStatus:t})=>{const n=typeof e>"u",{variation:r,loading:s}=Wyt(Kyt),o=qyt(r,e),a=d.useMemo(()=>s||n||Object.keys(e??{}).length===0&&t==="COMPLETED"?!0:o==="hidden",[o,n,e,t,s]),i=d.useMemo(()=>!n,[n]);return d.useMemo(()=>({shouldHideNavResults:a,classificationsLoaded:i,navResultsPosition:o}),[a,i,o])},Qyt=2,Xyt={classifier_name:"comet_nav_widget",number:2,threshold:.2,use_default_threshold:!0},Xde=T.memo(({sbsEntriesGroup:e,submitQuery:t,shouldShowProductFeedback:n,feedbackEntryUUID:r,shouldShowRecruitmentBanner:s,deleteLastResult:o,setQuote:a})=>{const{isMobileStyle:i}=Re(),c=Xt(),u=c6(),{result:f,response:m,hasLLMToken:p,searchMode:h,isFirstResult:g,webResults:y,steps:x,isPending:v}=Ot();KPe(),qPe();const b=Z4(),_=d.useMemo(()=>{if(!f?.query_str)return"";const{actualQuery:ee}=$x(f.query_str);return ee||""},[f?.query_str]),w=d.useMemo(()=>!i,[i]),S=d.useRef(null);aJ({entryUUID:f?.backend_uuid??"",target:S,targetVisibilityPortionThreshold:.3,frontendContextUUID:f?.frontend_context_uuid??"",hasLLMToken:p});const{variation:C,loading:E}=zyt(Xyt),N=f?.frontend_uuid,k=Hyt(N??""),I=d.useMemo(()=>Math.max(lOe(k,C,E),Qyt),[k,C,E]),{trackCitationClickEvent:M,navigationResults:A}=rOe({allowedNavResultsCount:I,entry:f,webResults:y,showSourcesSidebar:w,searchMode:h,isFirstResult:g}),D=Nn(),P=ln(),{navigationResults:F}=zn(),R=F[N??""]??Ie,j=fz(N),L=d.useMemo(()=>R.length>0,[R]),U=d.useMemo(()=>D&&(R.length||j)?R:A||Ie,[D,R,A,j]),O=d.useMemo(()=>U?{serverRequestTimestamp:c.getQueryData(["serverRequestTimestamp",f?.query_str??void 0,f?.uuid??void 0])}:{serverRequestTimestamp:void 0},[c,f?.query_str,U,f?.uuid]),$=d.useMemo(()=>U?.slice(0,I)?.map((ee,le)=>({...ee,position:le,source:O.serverRequestTimestamp?"default_search":"client_search",client_request_timestamp:b(),unstable_server_request_timestamp:O.serverRequestTimestamp||void 0,sitelinks:ee.sitelinks?.map((re,ce)=>({url:re.url,title:re.title,position:ce,snippet:re?.snippet??""})),is_comet_navigation:L,navigation_source:L?Fd.COMET:"navigation_source"in ee?ee.navigation_source:void 0})),[b,U,O.serverRequestTimestamp,L,I]),G=d.useMemo(()=>!!y&&y.length>0,[y]),H=d.useMemo(()=>f?.search_focus==="writing",[f?.search_focus]),Q=d.useMemo(()=>f?.display_model==="pplx_study",[f?.display_model]),{shouldHideNavResults:Y,navResultsPosition:te}=Yyt({classifierResults:k,resultStatus:f?.status??""}),se=d.useMemo(()=>g&&!1,[Y,$,f.attachments?.length,H,h,Q,g]),ae=d.useMemo(()=>se&&te==="top",[se,te]);d.useEffect(()=>{P.maybeSendSearchResult(m,x,v)},[v,G,m,P,x]);const X=d.useCallback(()=>{f?.query_source==="default_search"?u("web.frontend.omnisearch_nav_results_shown",{omnisearch:b()!==0,is_comet_navigation:L}):u("web.frontend.nav_results_shown",{is_comet_navigation:L})},[L,f?.query_source,u,b]);return l.jsxs("div",{className:"gap-y-md mt-md flex flex-col",ref:S,children:[ae&&l.jsx(fJ,{navResults:$,queryStr:_,querySource:f?.query_source,backendUUID:f?.backend_uuid,frontendUUID:f?.frontend_uuid,trackCitationClickEvent:M,onMount:X}),l.jsx(Qde,{submitQuery:t,shouldShowProductFeedback:n,feedbackEntryUUID:r,shouldShowRecruitmentBanner:s,deleteLastResult:o,setQuote:a,shouldShowNavResults:se,sbsEntriesGroup:e})]})});Xde.displayName="ThreadContent";const Zyt=Se(async()=>{const{ThreadEntryDebugTiming:e}=await Ee(()=>q(()=>import("./ThreadEntryDebugTiming-MjQ6oliY.js"),__vite__mapDeps([484,4,1,6,3,126,8,9,7,127,10,11,12])));return{default:e}},{restricted:!0}),Jyt=Se(async()=>{const{BugReportModal:e}=await Ee(()=>q(()=>import("./DebugModal-Doimq5Wl.js"),__vite__mapDeps([485,4,1,8,3,9,6,7,477,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ut,{})}),e2t=({isLastResult:e,title:t,backend_uuid:n,width:r,children:s,animate:o=!1})=>{const{openModal:a}=gn().updated,i=d.useCallback(()=>{a(Jyt,{legacyIdentifier:"bugReportModal"})},[a]);return Ob(!0,{initial:o?void 0:!1,from:{opacity:0,y:30},enter:{opacity:1,y:0},config:L_e})(u=>l.jsx(No.div,{style:u,className:"bg-base erp-sidecar:pt-0 erp-mobile-sidecar:pt-0",children:l.jsxs("div",{className:z("mx-auto",{"max-w-threadContentWidth":r==="default","max-w-none":r==="full","max-w-threadWidth":r==="wide"}),children:[t&&l.jsx("div",{className:"max-w-threadContentWidth relative isolate z-20 mx-auto",children:t}),s&&l.jsx("div",{className:"mt-xs",children:s}),l.jsx(Zyt,{backend_uuid:n,onBugReportClick:i,expandedDefault:e})]})}))},t2t=T.memo(e2t),Zde=T.memo(({submitQuery:e})=>{const t="trigger-entry-rewrite",n=mn(),{result:{backend_uuid:r,frontend_context_uuid:s,attachments:o,display_model:a,query_str:i},idx:c}=Ot(),u=x0(),f=window.location.hash.slice(1),m=parseInt(f,10),p=n?.get("rw")==="true";return d.useEffect(()=>{if(!p||isNaN(m)||c!==m)return;pE({rw:void 0});const h=()=>e({rawQuery:i??"",existingEntryUUID:r,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:u?void 0:s,promptSource:"user",querySource:"rewrite-url-param",attachments:o,modelPreferenceOverride:a});r?lu({entryUUID:r,reason:t}).catch(g=>{Z.error("Error terminating entry",g)}).finally(h):h()},[p,u,e,m,c,r,i,s,o,a]),null});Zde.displayName="TriggerEntryRewrite";const Jde=T.memo(()=>l.jsx(wr,{children:l.jsx(K,{variant:"subtler",className:"h-[180px] w-full overflow-hidden rounded-xl [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]"})}));Jde.displayName="JobsModeLoader";const b0=T.memo(({type:e,className:t,queryString:n})=>{const r=J(),s=d.useMemo(()=>{const o="font-medium",a="opacity-80";switch(e){case"images":return r.formatMessage({defaultMessage:"Image results for: {queryString}",id:"VzXivLJ8I5"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"videos":return r.formatMessage({defaultMessage:"Video results for: {queryString}",id:"2ZaRrQuRh/"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"sources":return r.formatMessage({defaultMessage:"Search results for: {queryString}",id:"Fjmx7PbD5i"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"shopping":return r.formatMessage({defaultMessage:"Shopping results for: {queryString}",id:"pB1ogBtGI4"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"jobs":return r.formatMessage({defaultMessage:"Job results for: {queryString}",id:"NLhbH5fRMB"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"places":return r.formatMessage({defaultMessage:"Place results for: {queryString}",id:"0FDKKyti5d"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});default:return""}},[n,e,r]);return n?l.jsx(V,{variant:"small",color:"light",className:z("mb-md",t),children:s}):null});b0.displayName="ResultsLabel";const efe=d.memo(()=>{const{isMobileStyle:e}=Re();return l.jsxs(l.Fragment,{children:[l.jsx(b0,{type:"shopping",queryString:""}),l.jsxs(wr,{className:"-mx-md pl-md md:mx-auto md:pl-0",children:[l.jsx("div",{className:"gap-md md:mb-lg mb-md flex auto-rows-fr grid-cols-2 overflow-hidden md:grid md:grid-cols-3",children:Array.from({length:3}).map((t,n)=>l.jsx(tfe,{},n))}),l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1 items-center",children:[l.jsx(V,{variant:e?"base":"section-title",className:"col-start-1 row-start-1",children:" "}),l.jsx("div",{className:"bg-subtler col-start-1 row-start-1 h-3 w-32 grow rounded-full md:h-4"})]}),l.jsx("div",{className:"gap-md pr-md flex auto-rows-fr grid-cols-2 flex-col md:grid md:pr-0",children:Array.from({length:2}).map((t,n)=>l.jsx(nfe,{},n))})]})]})]})});efe.displayName="ShoppingModeLoader";const tfe=d.memo(()=>l.jsx("div",{className:"bg-subtler aspect-video h-[327px] w-[70vw] grow rounded-xl md:h-[413px] md:w-full"}));tfe.displayName="Item";const nfe=d.memo(()=>l.jsx("div",{className:"bg-subtler aspect-video h-[144px] w-full grow rounded-md"}));nfe.displayName="SmallItem";const n2t=10,r2t=async({request:e,reason:t})=>{if(e.page&&e.page>n2t)throw new ye("API_CLIENTS_ERROR",{message:"Max search results page number is too large",status:400});const{data:n}=await de.POST("/rest/sources/search",t,{body:{entry_uuid:e.entry_uuid,limit:e.limit,page:e.page??null},timeoutMs:Sn.MEDIUM});return n},s2t=({reason:e})=>{const{mutate:t,data:n,isPending:r}=It({mutationFn:async s=>(await r2t({request:s,reason:e})).results});return d.useMemo(()=>({isSearchResultsLoading:r,searchResults:n,fetchSearch:t}),[t,r,n])},Zm="line-clamp-1 leading-[0.875rem]",rfe=T.memo(({webResult:e,citationIndex:t,isRelatedResult:n,linkOnClick:r,imageToShow:s})=>{const{$t:o,formatDate:a}=J(),[i,c]=d.useState(!1),u=d.useMemo(()=>Ur(e.url),[e.url]),f=d.useMemo(()=>Kc(e.url),[e.url]),m=e.is_client_context,p=Ca(),{isMobileStyle:h}=Re(),g=d.useMemo(()=>e.meta_data?.domain_name??u.replace(/\.[^.]*$/,""),[u,e.meta_data?.domain_name]),y=Tr(e.url),x=Hf(e),v=g2e(e),b=e.meta_data?.connection_type,_=oN(),w=e.file_metadata?.file_repository_type,S=!m||p||!x,C=cb(e),E=Nqe(e),N=Wg(e),k=()=>w=="COLLECTION"?o({defaultMessage:"Space Context",id:"wGTk8CFt1g"}):w=="USER"?o({defaultMessage:"My Files",id:"AjhJXSvkRs"}):w=="ORG"?o({defaultMessage:"Org Files",id:"DaFSYzpM1Q"}):o({defaultMessage:"Attachment",id:"eLCAEP8LHj"}),I=()=>e.file_metadata?.file_repository_type=="COLLECTION"?o({defaultMessage:"File",id:"gyrIElu9qY"}):e.meta_data?.connection_type?xCe(e.meta_data.connection_type):o({defaultMessage:"Local upload",id:"fscjAJoLwa"}),M=d.useMemo(()=>l.jsx(UA,{size:"tiny",showBackground:!1,rounded:!1,user:gCe(b)??void 0}),[b]);let A=null,D="",P=null;if(y||v||b&&b!==er.WILEY)A=l.jsx("div",{className:"bg-subtler flex size-6 items-center justify-center rounded-full",children:b?l.jsx(ge,{icon:Hpe,size:"xl",badge:M}):l.jsx(ge,{icon:B("file"),className:"size-md",size:"xl"})}),P=l.jsx(V,{variant:"micro",color:"light",className:Zm,children:I()}),D=k();else if(C&&!N)A=l.jsx("div",{className:"bg-subtle flex size-6 items-center justify-center rounded-full",children:l.jsx(ge,{size:"xl",icon:e.is_memory?B("bubble-text"):B("list-search")})}),P=l.jsx(V,{variant:"micro",color:"light",className:Zm,children:e.timestamp&&a(e.timestamp,{dateStyle:"long"})}),D=e?.is_memory?o({defaultMessage:"Memory",id:"dVx3yznM2C"}):o({defaultMessage:"Library",id:"StcK672jB9"});else{const F=b===er.WILEY?Bd:void 0;A=l.jsx(Lo,{size:24,domain:f,className:"size-full rounded-full",overrideIconUrl:F}),D=g,P=N?l.jsxs("div",{className:"gap-xs -ml-two flex flex-row items-center",children:[l.jsx(V,{variant:"tiny",color:"super",className:"-translate-y-px",children:l.jsx(ge,{size:"xs",icon:B("user-search")})}),l.jsx(V,{variant:"micro",color:"super",className:Zm,children:l.jsx(Ne,{defaultMessage:"Personal Search",id:"TZougEncQH",description:"subtitle"})})]}):l.jsx(V,{variant:"micro",color:"light",className:Zm,children:$H(GH(e.url))})}return l.jsx("div",{className:"gap-md relative items-start",children:l.jsxs("div",{className:"gap-lg relative flex w-full flex-row items-start lg:pl-0",children:[l.jsxs("div",{className:"flex min-w-0 grow flex-col",children:[l.jsxs(xt,{href:e.url,className:z("group/source flex flex-1 flex-col gap-1",{"cursor-pointer":!y&&S}),onClick:r,children:[l.jsxs("div",{className:"gap-sm flex flex-row items-center",children:[l.jsx("div",{className:"size-6 shrink-0",children:A}),l.jsxs("div",{className:"flex flex-1 flex-col",children:[l.jsx("div",{className:"flex flex-row items-center gap-1.5",children:l.jsxs(V,{variant:"tiny",className:Zm,color:"light",children:[!n&&t&&!_?t+". ":null,D]})}),P]}),C&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ge,{size:"xs",icon:B("user-search")})})]}),E?null:l.jsx(V,{variant:h?"baseSemi":"section-title",color:"super",className:z("decoration-super/50 duration-normal line-clamp-1 decoration-1 underline-offset-2 transition-colors",{"group-hover/source:underline":!y&&S}),children:e.name})]}),l.jsx(V,{variant:"small",color:"light",className:z("line-clamp-3 whitespace-pre-wrap leading-snug",{"pt-2":E}),children:e.meta_data?.generated_file_description??e.meta_data?.description??e.snippet})]}),s&&l.jsxs(xt,{href:e.url,className:z("relative ml-auto aspect-square h-fit w-20 shrink-0 cursor-pointer overflow-hidden rounded-md pt-1",{hidden:!i,"sm:block":i}),onClick:r,children:[l.jsx($o,{src:s,alt:"image",containerClassName:"absolute inset-0",imageClassName:"absolute inset-0 object-cover object-center w-full h-full",includeLightBoxModal:!1,onLoad:()=>c(!0)}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-[black]/10 dark:border-transparent"})]})]})})});rfe.displayName="PrimitiveSourcesRow";const sfe=T.memo(({webResult:e,citationIndex:t,isRelatedResult:n})=>{const r="sources-row",{result:{backend_uuid:s,context_uuid:o,frontend_context_uuid:a}}=Ot(),i=ln(),c=Nn(),u=Tr(e.url),f=Hf(e),{session:m}=je(),{trackEvent:p}=Ke(m),h=d.useCallback((E,N)=>{c&&i.openTab({url:E,tabId:N})},[c,i]),{mutate:g}=Ov({reason:r,onSuccess:c?h:void 0}),y=J6(),x=cb(e),v=Wg(e),{getImageDownloadUrl:b}=Tv({reason:r}),[_,w]=d.useState(null);d.useEffect(()=>{_===null&&(async()=>{if(!u){w(e.url);return}if(D4(e.url)){w(e.url);return}try{const N=await b({url:e.url,thread_id:s});w(N)}catch(N){Z.error(`Failed to fetch image source ${N}`),w(e.url)}})()},[b,s,e,u,_]),d.useEffect(()=>{p("source card viewed",{citation_url:e.url,position:t,title:e.name,contextUUID:o,frontendContextUUID:a,entryUUID:s,source:n?"sourcesTabViewMore":"sourcesTab"})},[e,p,t,n,o,a,s]);const S=d.useCallback(async E=>{try{const k=e.meta_data?.file_uuid?"fileRepositoryFile":e.is_attachment?"fileAttachment":n?"sourcesTabViewMore":"sourcesTab",I=Z6(e),{type:M,memoryKey:A}=I,D=Gg(e);p("click citation",{citation_url:e.url,contextUUID:o,frontendContextUUID:a,entryUUID:s,isMemory:e.is_memory,isConversationHistory:e.is_conversation_history,source:k,...D,...M==="memory"&&{memory_key:A}})}catch(k){Z.error("Failed to send click citation event:",k)}if(x&&!v){E.preventDefault(),y(e);return}if(f){E.preventDefault();return}if(Xl(e)){E.preventDefault(),g({file_url:e.url});return}if(jx(E)){E.preventDefault(),i.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")});return}},[x,e,n,p,o,a,s,y,i,g,v,f]),C=d.useMemo(()=>{if(u)return _;if(typeof e.meta_data?.image_url=="string")return e.meta_data.image_url;if(typeof e.meta_data?.images?.[0]=="string")return e.meta_data.images[0];if(typeof e.meta_data?.images?.[0]?.src=="string")return e.meta_data.images[0].src},[u,e,_]);return l.jsx(rfe,{webResult:e,citationIndex:t,isRelatedResult:n,linkOnClick:S,imageToShow:C})});sfe.displayName="SourcesRow";function o2t(){const{blocksByIntendedUsage:{answer_tabs:e},steps:t,result:{query_str:n}}=Ot(),r=d.useMemo(()=>{const s=e?.answer_tabs_block?.reformulated_queries??[];if(s[0])return s[0];const o=t.find(a=>a.step_type==="SEARCH_WEB")?.content.queries?.[0]?.query;return o||(n??"")},[e?.answer_tabs_block?.reformulated_queries,n,t]);return d.useMemo(()=>({reformulatedQuery:r}),[r])}const a2t=10,ofe=T.memo(()=>{const e="sources-mode",{$t:t}=J(),n=i2t({dedupeAttachments:!0}),{isEntryInFlight:r,result:s}=Ot(),{firstResult:o}=an(),{reformulatedQuery:a}=o2t(),{fetchSearch:i,isSearchResultsLoading:c}=s2t({reason:e}),f=s===o?s.query_str??"":a,[m,p]=d.useState(1),[h,g]=d.useState([]),y=Vt(),{openModal:x}=gn().legacy,v=d.useMemo(()=>m==1&&y&&!r&&n.selectedSources.length==0&&n.reviewedSources.length==0&&n.unsortedSources.length==0,[m,r,y,n.reviewedSources.length,n.selectedSources.length,n.unsortedSources.length]),[b,_]=d.useState(!1),w=d.useCallback(()=>{if(b)return;const E=m+1;i({entry_uuid:s.backend_uuid??"",limit:a2t,page:E},{onSuccess:N=>{g([...h,...N]),p(E)}})},[m,i,b,h,s.backend_uuid]);d.useEffect(()=>{v&&(w(),_(!0))},[w,v]),d.useCallback(()=>{if(!y){x("loginModal",{origin:lt.SOURCES_VIEW_MORE});return}w()},[w,y,x]);const S=!1,C=d.useMemo(()=>n.attachedSources.length>0||n.selectedSources.length>0||n.reviewedSources.length>0||n.reviewingSources.length>0||n.unsortedSources.length>0,[n.attachedSources.length,n.selectedSources.length,n.reviewedSources.length,n.reviewingSources.length,n.unsortedSources.length]);return l.jsxs(l.Fragment,{children:[l.jsx(b0,{type:"sources",queryString:f,className:C?"pb-sm":void 0}),l.jsxs("div",{children:[l.jsx(ed,{heading:n.selectedSources?.length>0?t({defaultMessage:"Attached",id:"2IacYt8NB7"}):void 0,sources:n.attachedSources}),l.jsx(ed,{heading:n.attachedSources?.length>0?t({defaultMessage:"Sourced",id:"P5KqlvUgRC"}):void 0,sources:n.selectedSources}),l.jsx(ed,{heading:t({defaultMessage:"Reviewed",id:"wiy+GNv+BV"}),sources:n.reviewedSources}),l.jsx(ed,{heading:t({defaultMessage:"Reviewing",id:"L+ISAVX7+d"}),sources:n.reviewingSources,shimmer:!0}),l.jsx(ed,{sources:n.unsortedSources}),S]})]})});ofe.displayName="SourcesMode";const ed=T.memo(({sources:e,heading:t,shimmer:n=!1})=>e.length===0?null:l.jsxs("div",{className:"my-md md:mt-lg group first:mt-0",children:[t?l.jsxs("div",{className:"mb-md relative",children:[l.jsx("hr",{className:"bg-subtle absolute top-1/2 h-px w-full border-0 group-first:hidden"}),l.jsx("div",{className:"bg-base",children:l.jsx(V,{variant:"tiny",color:"light",className:"mb-md bg-base pr-sm relative z-[1] w-fit",children:l.jsx(wr,{variant:"super",active:n,as:"span",children:t})})})]}):null,l.jsx(K,{className:"flex min-w-0 flex-col gap-4 md:gap-8",children:e.map(r=>l.jsx(sfe,{webResult:r.web_result,citationIndex:r.citation},r.web_result?.url))})]}));ed.displayName="SourcesModeSection";const i2t=({dedupeAttachments:e=!1})=>{const{result:t,blocksByIntendedUsage:{web_results:n}}=Ot(),r=l2t({attachments:t.attachments??Ie});return d.useMemo(()=>{const s=new Map,o=[],a=(n?.web_result_block?.web_results??[]).map(h=>({status:Cm.UNSORTED,web_result:h,citation:0})),i=a.some(h=>h.web_result?m3(h.web_result):!1);for(const h of a){const g=h.web_result?.is_attachment&&!m3(h.web_result);if(g&&o.push(h),!g||!e){const y=s.get(h.status)??[];y.push(h),s.set(h.status,y)}}const c=s.get(Cm.SELECTED)??Ie,u=s.get(Cm.REVIEWED)??Ie,f=s.get(Cm.REVIEWING)??Ie,m=s.get(Cm.UNSORTED)??Ie;!i&&o.length===0&&r.length>0&&o.push(...r);const p=[...c,...u,...f,...m].slice(0,3)?.map(h=>h.web_result?.url??"");return{attachedSources:o,selectedSources:c,reviewedSources:u,reviewingSources:f,unsortedSources:m,topSources:p}},[n?.web_result_block?.web_results,r,e])},l2t=({attachments:e})=>e.map(t=>({web_result:{name:du(t),url:t,is_attachment:!0,is_image:Tr(t),is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!1,sitelinks:[],snippet:"",timestamp:"",meta_data:{},inline_entity_id:""},status:"UNKNOWN",citation:0})),r7=T.memo(()=>l.jsxs("div",{className:"gap-md @container flex w-full flex-row",children:[l.jsx("div",{className:"md:@[1458px]:w-[874px] md:@[1458px]:shrink-0 w-full md:w-3/5",children:l.jsx(ife,{})}),l.jsx("div",{className:"@md:w-[570px] @md:@[1458px]:w-full hidden md:block",children:l.jsx(afe,{})})]}));r7.displayName="PlacesModeLoader";const afe=T.memo(()=>l.jsx(wr,{children:l.jsx(K,{variant:"subtler",className:"sticky h-[180px] w-full overflow-hidden rounded-xl [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]"})}));afe.displayName="PlacesModeMapLoader";const ife=T.memo(()=>l.jsx(wr,{children:l.jsx("div",{className:"gap-md grid h-[180px] grid-cols-[repeat(auto-fill,minmax(220px,1fr))] overflow-hidden [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]",children:Array.from({length:8}).map((e,t)=>l.jsx(lfe,{},t))})}));ife.displayName="PlacesModeGridLoader";const lfe=T.memo(()=>l.jsx("div",{className:"bg-subtler aspect-[4/3] w-full rounded-xl"}));lfe.displayName="Item";const c2t=Se(async()=>{const{ShoppingMode:e}=await Ee(()=>q(()=>import("./ShoppingMode-bLl6K_BC.js"),__vite__mapDeps([486,4,1,8,3,9,6,7,487,474,475,81,82,83,47,49,50,42,79,38,488,57,10,11,12])));return{default:e}},{loading:()=>l.jsx(efe,{})}),u2t=Se(async()=>{const{HotelsMode:e}=await Ee(()=>q(()=>import("./HotelsMode-0lP3cqJK.js"),__vite__mapDeps([489,4,1,487,8,3,9,6,7,490,42,488,79,38,10,11,12])));return{default:e}},{loading:()=>l.jsx(r7,{})}),d2t=Se(async()=>{const{JobsMode:e}=await Ee(()=>q(()=>import("./JobsMode-BLsZFsP8.js"),__vite__mapDeps([491,4,1,6,3,8,9,7,42,476,10,11,12])));return{default:e}},{loading:()=>l.jsx(Jde,{})}),f2t=Se(async()=>{const{VideosMode:e}=await Ee(()=>q(()=>import("./VideosMode-LCMQNgtx.js"),__vite__mapDeps([492,4,1,6,3,9,7,493,8,42,488,10,11,12])));return{default:e}},{loading:()=>l.jsx(b0,{type:"videos",queryString:""})}),m2t=Se(async()=>{const{ImagesMode:e}=await Ee(()=>q(()=>import("./ImagesMode-TKrgDVir.js"),__vite__mapDeps([494,1,4,6,3,9,7,493,8,42,472,488,83,10,11,12])));return{default:e}},{loading:()=>l.jsx(b0,{type:"images",queryString:""})}),p2t=Se(async()=>{const{MapsMode:e}=await Ee(()=>q(()=>import("./MapsMode-DN82XtAo.js"),__vite__mapDeps([495,4,1,8,3,9,6,7,487,490,42,488,79,38,10,11,12])));return{default:e}},{loading:()=>l.jsx(r7,{})}),h2t=Se(async()=>{const{AssetsMode:e}=await Ee(()=>q(()=>import("./AssetsMode-CtABsBZo.js"),__vite__mapDeps([496,4,1,6,3,104,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(FZ,{})}),cfe=T.memo(({children:e,isFirstResult:t=!1,isLastResult:n=!1,hasParent:r=!1,mode:s,width:o})=>l.jsx(K,{className:z({"pt-[var(--thread-visual-spacing)]":!t,"md:pt-lg":s==="default"&&!(t&&r),"pb-[var(--thread-visual-spacing)]":!0,"pb-lg":"","px-[var(--thread-visual-spacing)]":!0,"md:px-lg":o==="wide"}),children:e}));cfe.displayName="ThreadEntryLayout";function g2t(e){const{result:{backend_uuid:t,frontend_context_uuid:n,attachments:r,display_model:s,sources:o}}=Ot(),a=x0();return d.useCallback(i=>{if(!n){Z.warn(new Error(`No frontend UUID for thread backendUUID=${t}`));return}e({rawQuery:i,existingEntryUUID:t,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:a?void 0:n,promptSource:"user",querySource:"edit",attachments:r,modelPreferenceOverride:s,sourcesOverride:Ox(o?.sources)})},[t,n,a,r,o,s,e])}const ufe=T.memo(({sbsEntriesGroup:e,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o,lastResultBuffer:a})=>{const{currentModeData:i}=u6(),{result:{backend_uuid:c,attachments:u,status:f,query_str:m,parent_info:{mode:p,url_slug:h}={},side_by_side_metadata:g},isEntryInFlight:y,webResults:x,inFlight:v,isFailed:b,selectedRefinementQuery:_,isFirstResult:w,isLastResult:S,submitQuery:C,scrollToListItem:E,idx:N,hasAnyAgentSteps:k}=Ot(),{results:I}=an(),M=g2t(C),A=!!(p&&h),D=d.useCallback(()=>{E?.(N,{smooth:!0})},[E,N]);d.useEffect(()=>{typeof window>"u"||f!=="PENDING"||D()},[y,f,D]);const P=u&&u.length>0,F=Yt.hasUnspecifiedSelectionStatus(g)&&Yt.hasMultipleSiblingEntries(I,g?.sibling_uuid),R=d.useMemo(()=>l.jsx(UZ,{entryUUID:c,onSubmitEdit:M,isFirstResult:w,hasAttachments:P,inFlight:v,isFailed:b,isEditDisabled:F,selectedRefinementQuery:_,queryStr:m??""}),[c,M,w,P,v,b,F,_,m]),j=d.useMemo(()=>{if(!P)return new Map;const H=new Map;for(const Q of x)Q.url&&Q.file_metadata?.file_source&&H.set(Q.url,Q.file_metadata.file_source);return H},[P,x]),{isMobileStyle:L,isMobileUserAgent:U}=Re(),O=d.useMemo(()=>0,[w,A,L,U]),$=d.useMemo(()=>S&&a?a+(P?52:0):0,[S,a,P]),G=w&&L;return l.jsx("div",{className:z({"erp-sidecar:min-h-[var(--sidecar-content-height)]":S,"erp-mobile-sidecar:min-h-[var(--mobile-sidecar-content-height)]":S,"min-h-[var(--page-content-height)]":S&&!G,"min-h-[var(--mobile-content-height)]":S&&G}),style:{marginTop:O,paddingBottom:$},children:l.jsxs(cfe,{isFirstResult:w,isLastResult:S,hasParent:!!A,mode:i.mode,width:i.width,children:[l.jsx(Zde,{submitQuery:C}),l.jsx(sJ,{webResults:x,children:l.jsxs("div",{className:z("isolate mx-auto",{"max-w-none":i.width==="full","max-w-threadWidth":i.width==="wide","max-w-threadContentWidth":i.width==="default"}),children:[i.mode==="default"&&l.jsx(t2t,{isLastResult:S,title:R,backend_uuid:c,width:i.width,animate:v&&!k,children:P&&l.jsx(YZ,{attachments:u,backend_uuid:c,fileSourceMap:j})}),l.jsx("div",{className:z("mx-auto",{"max-w-threadWidth":i.width==="wide","max-w-none":i.width==="full","max-w-threadContentWidth":i.width==="default"}),children:l.jsxs(kt,{initial:!1,children:[l.jsx(ja,{id:"default",children:l.jsx(Xde,{sbsEntriesGroup:e,submitQuery:C,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o})},"default"),l.jsx(ja,{id:"shopping",children:l.jsx(c2t,{})},"shopping"),l.jsx(ja,{id:"hotels",children:l.jsx(u2t,{})},"hotels"),l.jsx(ja,{id:"places",children:l.jsx(p2t,{})},"places"),l.jsx(ja,{id:"jobs",children:l.jsx(d2t,{})},"jobs"),l.jsx(ja,{id:"videos",children:l.jsx(f2t,{})},"videos"),l.jsx(ja,{id:"images",children:l.jsx(m2t,{})},"images"),l.jsx(ja,{id:"sources",children:l.jsx(ofe,{})},"sources"),l.jsx(ja,{id:"assets",children:l.jsx(h2t,{})},"assets")]})})]})})]})})});ufe.displayName="ThreadEntryInner";const y2t=zt("EntityGroupContext",void 0),dfe=T.memo(({children:e})=>{const[t,n]=d.useState(!1);return l.jsx(y2t.Provider,{value:{viewMoreOpen:t,setViewMoreOpen:n},children:e})});dfe.displayName="EntityGroupProvider";const x2t=e=>{const t=jv(e);if(t)switch(t.object){case"ShopifyWidget":return!0;default:return!1}return!1},ffe=d.memo(({idx:e,result:t,sbsEntriesGroup:n,isLastResult:r,isFirstResult:s,lastResultBuffer:o})=>{const{inFlight:a}=an(),{scrollToListItem:i}=n6(),{submitQuery:c,shouldShowProductFeedback:u,feedbackEntryUUID:f,shouldShowRecruitmentBanner:m,deleteLastResult:p,setQuote:h}=Wo(),g=d.useCallback(async y=>{a||c(y)},[c,a]);return l.jsx(l6,{idx:e,result:t,inFlight:a,isLastResult:r,isFirstResult:s,scrollToListItem:i,submitQuery:g,children:l.jsx(OZ,{scrollToListItem:i,children:l.jsx(dfe,{children:l.jsx(ufe,{sbsEntriesGroup:n,shouldShowProductFeedback:u,feedbackEntryUUID:f??"",shouldShowRecruitmentBanner:m,deleteLastResult:p,setQuote:h,lastResultBuffer:o})})})})});ffe.displayName="ThreadEntry";const mfe=T.memo(({children:e,forceVisible:t=!1,unmeasuredHeight:n,disableObservation:r,rootMargin:s,threshold:o,root:a,ref:i})=>{const[c,u]=d.useState(0),[f,m]=d.useState(t),[p,h]=d.useTransition(),g=d.useRef(null),y=d.useRef(null);d.useEffect(()=>{const v=g.current,b=y.current;if(!v||!b)return;const _=new ResizeObserver(([S])=>{if(!S)return;if(r?.current){_.unobserve(v),requestAnimationFrame(function E(){r.current?requestAnimationFrame(E):_.observe(v)});return}const C=S.contentRect.height;h(()=>u(E=>C||E))}),w=new IntersectionObserver(([S])=>{if(S){if(r?.current){w.unobserve(v),requestAnimationFrame(function C(){r.current?requestAnimationFrame(C):w.observe(v)});return}h(()=>m(S.isIntersecting))}},{rootMargin:s,threshold:o,root:a});return _.observe(v),t||w.observe(b),()=>{_.disconnect(),w.disconnect()}},[t,n,s,o,a,r]);const x=d.useCallback(v=>{g.current=v,i instanceof Function?i(v):i&&(i.current=v)},[i]);return l.jsx("div",{style:t?void 0:{minHeight:`${c||n}px`},ref:y,children:l.jsx("div",{ref:x,children:t||f?e:null})})});mfe.displayName="LazyContainer";const EU=1e3,v2t=1,kU=3,pfe=T.memo(e=>{const t="thread",{openToast:n}=pn(),r=U4(b=>b.results),{setQuote:s}=Wo(),{scrollContainerRef:o}=ka(),{refs:a,isScrollingRef:i}=n6(),c=Ln(),[u,f]=d.useState(!1),m=J(),{activeThreadTab:p}=kg();Pje({reason:t});const h=d.useMemo(()=>{const b=z4(r?.length?r:e.placeholderResults||[]);return p!=="default"?Qje(b,p)??b.slice(-1):b},[r,e.placeholderResults,p]);d.useEffect(()=>{h.some(_=>_[0]?.has_expired_attachments)&&n({message:m.formatMessage({id:"zR3dvwKUWo",defaultMessage:"Some files have expired. Please reupload files to continue."}),variant:"error",timeout:3})},[h,n,m]);const g=d.useMemo(()=>{if(typeof window>"u")return-1;const b=window.location.hash.slice(1);return b?Number.isNaN(Number(b))?h?.findIndex(_=>_[0]?.backend_uuid===b):Number(b):-1},[h]),y=d.useCallback((b,_)=>{_?a[b]={current:_}:delete a[b]},[a]),x=d.useCallback((b,_)=>b=_-kU||!u&&b<=g,[g,u]);d.useEffect(()=>{if(~g){const b=setTimeout(()=>{f(!0)},1e4);return()=>{clearTimeout(b)}}},[g]),d.useEffect(()=>{const b=o.current;return b&&(b.scrollTop=0),()=>{f(!1)}},[c,o]),d.useEffect(()=>()=>{s(null)},[]);const v=d.useMemo(()=>h.map((b,_)=>{const w=b[0],S=_===0,C=_===h.length-1;return w?l.jsx(hfe,{result:w,resultsGroup:b.length>1?b:Ie,isLastResult:C,isFirstResult:S,lastResultBuffer:C?e.lastResultBuffer:void 0,forceVisible:x(_,h.length),idx:_,scrollContainerRef:o,setRef:y,isScrollingRef:i},w.uuid||w.backend_uuid):null}),[h,e.lastResultBuffer,x,o,y,i]);return l.jsx("div",{children:v})});pfe.displayName="Thread";const hfe=T.memo(({result:e,resultsGroup:t,isLastResult:n,isFirstResult:r,forceVisible:s,idx:o,scrollContainerRef:a,lastResultBuffer:i,setRef:c,isScrollingRef:u})=>{const f=e.attachments?.length>0,m=d.useMemo(()=>()=>l.jsx(Xf,{className:z("pt-headerHeight",{"pb-threadInputHeightWithPadding":n&&!f,"pb-threadAttachmentsHeightWithPadding":n&&f})}),[f,n]),p=d.useCallback(h=>c(o,h),[o,c]);return l.jsx(Ar,{fallback:m,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(mfe,{forceVisible:s,unmeasuredHeight:EU,rootMargin:`${EU*v2t}px 0px`,threshold:0,root:a.current,ref:p,disableObservation:u,children:l.jsx(ffe,{idx:o,result:e,sbsEntriesGroup:t,isLastResult:n,isFirstResult:r,lastResultBuffer:i})})},e.uuid||e.backend_uuid)});hfe.displayName="LazyContainerFactory";const gfe=T.memo(()=>{const{$t:e}=J(),{firstResult:t}=an(),n=t?.parent_info,s=d.useContext(r6)?.activeThreadTab??"default";if(!n?.mode||!n?.url_slug||s!=="default")return null;const o=(()=>{switch(n?.mode){case bd.ARTICLE:return"page";case bd.NOTEPAD:return"notes";default:return"search"}})(),a=!!n?.preview_image_url;return l.jsx(xt,{href:`/${o}/${n?.url_slug}`,children:l.jsxs(K,{variant:"background",bgHover:"subtler",className:"mt-md p-md shadow-subtle relative mx-auto flex justify-between rounded-lg border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs(V,{color:"light",variant:"tiny",className:"mb-xs gap-x-xs flex items-center",children:[l.jsx(ge,{icon:B("git-fork"),size:"xs"}),l.jsx("div",{children:e({defaultMessage:"Follow up to",id:"D3eCB2NeGQ"})})]}),l.jsx(V,{variant:"baseSemi",color:"light",className:"line-clamp-1 break-all",children:n?.title})]}),a&&l.jsx("div",{className:"ml-md shrink-0",children:l.jsx($o,{src:n?.preview_image_url,alt:n?.title||"Preview",imageClassName:"h-16 w-16 rounded object-cover",rounded:"sm",fadeIn:!1})})]})})});gfe.displayName="ParentThreadLink";const yfe=T.memo(({children:e,className:t,innerClassName:n})=>l.jsx("div",{className:z("px-md md:px-lg","overflow-hidden",t),children:l.jsx("div",{className:z("max-w-threadContentWidth mx-auto",n),children:e})}));yfe.displayName="ThreadSectionWrapper";function b2t(e){return e?.length?e.filter(ga):void 0}const _2t=(e,t,n)=>{const r=d.useRef(null),{submitQuery:s}=Wo(),o=Dn(),a=Z4(),{preferredSearchModels:i}=ig(),c=i[oe.SEARCH];d.useLayoutEffect(()=>{const f=new URL(window.location.href).searchParams,m=f.get("copilot"),p=f.get("pro"),h=f.get("q"),g=f.get("utm_source"),y=f.get("in_page"),x=f.get("attachments"),v=f.get("tabs"),b=f.get("nav_suggestions"),_=f.get("sources"),w=f.get("pc"),S=f.get("pt");w&&u2e(w),S&&m2e(S);const C=f.get("qabi")??void 0,E=x?.replace(/[[\]]/g,"").split(","),N=f.get("newFrontendContextUUID"),k=[];if(v)try{const I=JSON.parse(v);if(Array.isArray(I))for(const M of I)k.push({type:"tab",id:M,url:""})}catch(I){Z.error("Failed to parse tabsParam:",I)}if(e&&h&&!N&&t&&r.current!==t){const I=Array.isArray(h)?h[0]:h,M=f.get("source");if(I==="pending")return;const A=D=>{if(r.current!==t)return;const P=g?`/search/${D}?utm_source=${g}`:`/search/${D}`;o.replace(P,"Omni search query")};s({rawQuery:I,copilotOverride:m==="true"||p==="true"||Ez(g??void 0),collection:null,newFrontendContextUUID:crypto.randomUUID(),frontendUUID:t,attachments:E,inPage:y??void 0,promptSource:kM(M)?M:"user",querySource:"default_search",utmSource:g??void 0,quickActionButtonId:C,isNavSuggestionsDisabled:b==="false",modelPreferenceOverride:c,shouldRedirectToBackendUUID:!1,mentions:k,sourcesOverride:_?b2t(_?.split(",")):void 0,shouldUsePageStartTime:!0,onThreadSlugReceived:A}),r.current=t,gme()}},[e,s,t,a,o,n,c])},zS="streamId",w2t=()=>{const e=zs();return d.useCallback(n=>{for(const r of n){if(e.getState().entries[r.backend_uuid])continue;const o=r.frontend_uuid??crypto.randomUUID(),a=!r.reconnectable,i=r.context_uuid,c=r.backend_uuid;e.setState(u=>{try{return _3(u,{...r,status:a?r.status===Pr.BLOCKED?Pr.BLOCKED:Pr.COMPLETED:Pr.PENDING,final:a,final_sse_message:a},{streamId:o})}catch(f){const m=new Fl("STREAM_INITIAL_ENTRIES_ERROR",{message:"Error in initializeThreads",cause:f,details:{request_id:o,backend_uuid:c}});return Z.error(m),{threads:az(u.threads,i,c),entries:{...u.entries,[c]:{...r,status:Pr.FAILED}}}}},void 0,"ingestInitialEntries")}},[e])},xfe=T.memo(({error:e})=>{throw e});xfe.displayName="ThrowFetcherError";function C2t({active:e,query:t,copilot:n,source:r,streamId:s}){const o=d.useMemo(()=>t&&e?[tve({query_str:t,frontend_uuid:s,query_source:r??"default_search",mode:n==="true"?"COPILOT":"CONCISE"})]:Ie,[t,e,s,r,n]);return d.useMemo(()=>e?{hasFrontendUUID:!!s,placeholderResults:o}:void 0,[e,o,s])}function S2t({active:e,frontendContextUUID:t}){const r=zs().getState().streams,o=(e?Object.values(r).find(i=>i.params?.frontend_context_uuid===t):void 0)?.placeholderChunk,a=d.useMemo(()=>o?[o]:void 0,[o]);return d.useMemo(()=>e?{skipLoadingUI:!0,placeholderResults:a}:void 0,[e,a])}function E2t({active:e,slugOrUUID:t}){const n="search-components",r=Dn(),s=d.useRef(new Map),o=zs(),a=d.useRef(o.getState());a.current=o.getState();const i=e?Object.values(a.current.entries).find(g=>g?.thread_url_slug===t||g?.backend_uuid===t||g?.backend_uuid===s.current.get(t)):void 0;i&&s.current.set(t,i?.backend_uuid??"");const c=e&&!i,{data:u,error:f,isLoading:m,dataUpdatedAt:p}=Vve({slugOrUUID:t,enabled:c,isSidecar:!0,reason:n}),h=d.useMemo(()=>u?.length?u:i?[i]:Ie,[u,i]);return d.useEffect(()=>{if(f instanceof ye){let g=null;const y=f.detail;y?.error_code===f9?(g=Cd.ThreadAccessNotAllowed,Z.error(f9,{error:f,slugOrUUID:t})):y?.error_code===Wwe?(g=Cd.ThreadExpired,Z.error(f?.message,{error:f,slugOrUUID:t})):(g=Cd.InvalidThread,Z.error(f?.message,{error:f,slugOrUUID:t})),r.replace(`/?error=${g}&id=${t}`,"Search error")}},[f,t,r]),d.useMemo(()=>e?{entries:h,slugOrUUID:t,isLoadingEntries:!p,error:f}:void 0,[e,h,f,p,t])}function k2t(){const{clear:e}=Ux(),t=iu(),n=!!(t?.new&&t?.uuid),r=!!(t?.new&&!t?.uuid),s=!!(!t?.new&&t?.uuid),o=!n&&!r&&!s,a=new URLSearchParams(window.location.search),i=a?.get("q")??void 0,c=a?.get("copilot")??void 0,u=a?.get("source")??void 0,f=a?.get(zS),m=d.useMemo(()=>f??crypto.randomUUID(),[f]);o&&!a.has(zS)&&a.set(zS,m);const p=o?a.toString():"",h=S2t({active:n,frontendContextUUID:t?.uuid??""}),g=C2t({active:r,query:i,copilot:c,streamId:m,source:u}),y=E2t({active:s,slugOrUUID:t?.uuid??""});return d.useEffect(()=>()=>e(),[e]),d.useLayoutEffect(()=>{g?.hasFrontendUUID&&e()},[e,g?.hasFrontendUUID]),_2t(r,m,"new-query-search-components"),d.useMemo(()=>{if(n){const x=t?.uuid;if(!x||!LU(x))return{component:l.jsx(R0,{to:"/"})}}else if(r){if(!i||i==="pending")return{component:l.jsx(R0,{to:"/"})}}else if(s){const x=t?.uuid;if(!x||x==="undefined")return{component:l.jsx(R0,{to:"/"})};if(y?.error instanceof ye)return null;if(y?.error instanceof OU&&!y.entries.length)return{component:l.jsx(Ar,{fallback:()=>l.jsx(Xf,{}),code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(xfe,{error:y.error})})}}else return{component:l.jsx(R0,{to:i?`/search/new?${p}`:"/"})};return{props:{...h,...g,...y}}},[y,s,g,r,h,n,t?.uuid,i,p])}function M2t(e){const t=w2t(),{setCurrentThreadId:n}=Ux(),r=Rve(),s=e.entries,o=!!s?.length,a=e.isLoadingEntries,i=d.useMemo(()=>s?.[0]?.context_uuid,[s]);d.useEffect(()=>{o&&n(i??crypto.randomUUID())},[o,n,i]),d.useEffect(()=>{a||s&&(s.forEach(u=>{u.reconnectable&&!Yt.isStatusCompleted(u)&&r(u.backend_uuid)}),t(s))},[t,s,r,i,a]);const c=d.useMemo(()=>e.entries?.length?e.entries:e.placeholderResults?.length?e.placeholderResults:Ie,[e.placeholderResults,e.entries]);return d.useMemo(()=>({placeholderResults:c}),[c])}const vfe=T.memo(({children:e})=>{const{results:t}=an(),n=d.useMemo(()=>{const r=[];return t.map(s=>{s.widget_data?.map(o=>{x2t(o)&&r.push(o)})}),r},[t]);return l.jsx(Uoe,{entities:n,children:e})});vfe.displayName="ScrollToWidgetWrapper";function mx(e){return e?e==="comet_browser_agent":!1}const T2t=[ie.DEFAULT,ie.PRO];function A2t(e){return T2t.includes(e)}function b_t({displayModel:e,userSelectedModel:t,intl:n}){if(mx(e)||A2t(t))return null;const r=MU(t,n),s=MU(e,n);return s!==r?n.$t({defaultMessage:"Used {displayModelLabel} because {userSelectedModelLabel} was inapplicable or unavailable.",id:"fix6lEntWw"},{displayModelLabel:s,userSelectedModelLabel:r}):r}function MU(e,t){const n=Jn[e];return n?t.$t(n.name):"Best"}const N2t=(e,t,n)=>{const r=dX(),{addClarification:s}=Dv(),{session:o}=je(),{trackEventOnce:a}=Ke(o),i=n?.length??0,c=n?.filter(g=>g.markdown_block).length??0,u=d.useMemo(()=>{if(!n)return!1;if(mx(t?.display_model))return!0;const g=n.find(v=>v.intended_usage==="pro_search_steps");if(!g?.plan_block?.steps)return!1;const y=g.plan_block.steps;return y[y.length-1]?.step_type==="ENTROPY_REQUEST"},[n,t?.display_model]),f=d.useMemo(()=>u?!0:r?sn(t?.display_model)===oe.RESEARCH||sn(t?.display_model)===oe.STUDIO:!1,[r,u,t?.display_model]),m=d.useMemo(()=>f&&!t?.reasoning_plan&&i>0&&c===0,[t?.reasoning_plan,i,c,f]),p=d.useMemo(()=>!m||!f||!n?null:{clarificationQuestion:mx(t?.display_model)?"I'll consider the details you added.":"Add details or clarifications",isDefaultClarification:!0,clarificationCount:0},[m,f,n,t?.display_model]),h=d.useCallback((g,y,x)=>{const b={uuid:crypto.randomUUID(),clarification_type:"FREEFORM_CLARIFICATION",freeform_clarification:{text:x.query,question:"Add details or clarifications",attachments:x.attachments??[]}};Jge({entryUUID:g,clarification:b,reason:e}),s({content:b.freeform_clarification?.text??x.query,UUID:b.uuid,entryUUID:g,question:p?.clarificationQuestion??void 0}),p&&a("clarifying query submitted",{entry_uuid:g,context_uuid:y,query:x.query,attachments:x.attachments})},[s,p,e,a]);return{shouldAcceptClarification:m,handleSubmitClarification:h,clarificationData:p}},R2t=({selectedSearchMode:e,shouldAcceptClarification:t,isBrowserAgent:n,$t:r})=>r(t?n?{defaultMessage:"Add details to this task...",id:"9/d5+NqCeH"}:{defaultMessage:"Add details or clarifications...",id:"RkaMsxpXoz"}:qr[e].askInputPlaceholder),bfe=T.memo(e=>{const t="sidecar-thread-floating-footer",{$t:n}=J(),r=ln(),o=mn()?.get("q"),a=Vt(),{inFlightEntry:i,inFlight:c,firstResult:u,lastResult:f,resultsLength:m}=an(),p=i?.backend_uuid,h=i?.context_uuid,g=i?.blocks,y=u?.frontend_context_uuid,x=u?.collection_info,{shouldAcceptClarification:v,handleSubmitClarification:b,clarificationData:_}=N2t(t,f,g),w=g?.length??0,S=y,{activeMode:C}=kg(),{submitQuery:E}=Wo(),{specialCapabilities:N}=Qr(),k=zo(),I=x0(),M=d.useMemo(()=>{try{return c&&w>0}catch(U){throw Z.error("Unable to parse non-Pro search inFlightEntry.",U),U}},[c,w]),A=d.useCallback(U=>{if(p&&v&&(b(p,h,U),j.setUserInput("")),c&&!U.forceFork)return;const O=U.forceFork||I,$=fa();E({rawQuery:U.query,copilotOverride:a||N.unlimitedProSearch?void 0:!1,attachments:U.attachments,collection:x??null,newFrontendContextUUID:O?$:null,existingFrontendContextUUID:O?void 0:S,promptSource:U.promptSource??"user",querySource:"followup",timeFromFirstType:U.timeFromFirstType,shouldRedirectToBackendUUID:O,modelPreferenceOverride:U.modelPreferenceOverride,forceEnableBrowserAgent:U.forceEnableBrowserAgent}),e.onSubmit?.()},[c,E,a,I,x,S,p,v,h,b]),D=d.useRef(!1),P=d.useCallback(U=>{D.current||(D.current=!0,setTimeout(()=>D.current=!1,aT),A(U))},[A]);d.useEffect(()=>{v&&(D.current=!1)},[v]);const[F,R,j]=UW({onSubmit:P}),L=d.useCallback(()=>{p&&(lu({entryUUID:p,reason:t}),r.cleanupTasks(p,"query_stopped"))},[p,r]);return d.useEffect(()=>r.subscribeToSidecarBrowserTaskStop(U=>{U||L()}),[r,L]),d.useEffect(()=>{o!==null&&o!==""&&j.setUserInput("")},[o]),l.jsx(K,{className:"erp-sidecar:fixed bottom-safeAreaInsetBottom p-md pointer-events-none absolute z-10 w-full",ref:e.ref,children:l.jsx("div",{className:"max-w-threadContentWidth mx-auto",children:l.jsx("div",{className:"pointer-events-auto",children:Kje(C)&&l.jsx(K,{className:z("mt-lg static w-full grow flex-col items-center justify-center md:mt-0 md:flex","z-10"),children:l.jsx("div",{className:"w-full",children:l.jsxs($c,{children:[l.jsx(Jd,{position:"input",idx:m-1,upsellInformation:f?.upsell_information,inFlight:c,isLastResult:!0,backendUuid:p,animateExpand:!1}),d.createElement(XA,{...j,key:"ask-input",value:F,json:R,isFollowUp:!0,disableSubmission:c&&!v,placeholder:R2t({selectedSearchMode:k,shouldAcceptClarification:v,isBrowserAgent:mx(f?.display_model),$t:n}),showStopButton:M,showFileUpload:!0,inFlightEntryUUID:p,onStopButtonClick:L,querySource:"followup",layoutKey:"sidecar-input",isHighlighted:!!_?.clarificationQuestion})]})})})})})})});bfe.displayName="SidecarThreadFloatingFooter";const _fe=T.memo(()=>l.jsx(Xf,{}));_fe.displayName="Fallback";const wfe=T.memo(e=>{const{placeholderResults:t}=M2t(e),[n,{height:r}]=ei();return l.jsx(Ar,{fallback:_fe,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(Zje,{children:l.jsx(JX,{children:l.jsx(eZ,{children:l.jsxs(vfe,{children:[l.jsx("div",{className:"mx-auto h-fit pb-0",children:l.jsxs(K,{variant:"background",className:"relative",children:[l.jsx(yfe,{children:l.jsx(gfe,{})}),l.jsx(pfe,{...e,placeholderResults:t,lastResultBuffer:r})]})}),l.jsx(bfe,{ref:n},"footer")]})})})})})});wfe.displayName="SearchContent";const Cfe=T.memo(function(){const t=k2t();return t?"component"in t?t.component:l.jsx(Ff,{children:l.jsx(wfe,{...t.props})}):null});Cfe.displayName="SidecarSearchPage";const D2t=Se(async()=>{const{VoiceToVoiceContent:e}=await Ee(()=>q(()=>import("./VoiceToVoiceContent-PkkJnLa8.js"),__vite__mapDeps([497,4,1,6,3,147,7,9,148,149,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Yf,{})}),Sfe=T.memo(function(){const t=Dn(),n=d.useCallback(()=>{t.push("/",void 0,"voice to sidecar")},[t]);return l.jsx(Ff,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Xx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(D2t,{onClose:n})})})});Sfe.displayName="SidecarSpeakPage";const j2t=Se(async()=>{const{VoiceToVoiceContent:e}=await Ee(()=>q(()=>import("./VoiceToVoiceContent-PkkJnLa8.js"),__vite__mapDeps([497,4,1,6,3,147,7,9,148,149,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Yf,{})}),Efe=T.memo(function(){const t=ln(),n=d.useCallback(()=>{t?.voiceAssistantStop()},[t]);return l.jsx(Ff,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Xx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(j2t,{isCometVoiceAssistant:!0,onClose:n})})})});Efe.displayName="SidecarVoiceAssistantPage";const I2t=Se(async()=>{const{VoiceToVoiceFloating:e}=await Ee(()=>q(()=>import("./VoiceToVoiceFloating-Dsg0wzwC.js"),__vite__mapDeps([498,4,1,6,3,148,7,9,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Yf,{})}),kfe=T.memo(function(){return l.jsx(Ff,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Xx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(I2t,{isCometVoiceAssistant:!0})})})});kfe.displayName="SidecarVoiceFloatingPage";const P2t={[LW]:{Component:Cfe,modules:WCe},"/speak":{Component:Sfe,modules:Ie},"/voice-assistant":{Component:Efe,modules:Ie},"/voice-floating":{Component:kfe,modules:Ie},"/":{Component:ZA,modules:FW}},Mfe=T.memo(()=>l.jsxs(yme,{children:[Object.entries(P2t).map(([e,{Component:t,modules:n}])=>l.jsx(E7,{path:e.startsWith("^")?new RegExp(e):e,children:l.jsx(u9,{modules:n,children:l.jsx(t,{})})},e)),l.jsx(E7,{children:l.jsx(u9,{modules:FW,children:l.jsx(ZA,{})})})]}));Mfe.displayName="Main";const s7=[LW,"/speak","/voice-assistant","/voice-floating","/"],O2t=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,o7="pplx-next-auth-session";let Q1=null;const L2t=()=>{try{const e=wt.getItem(o7);return e?JSON.parse(e):null}catch{return null}},TU=e=>{e&&wt.setItem(o7,JSON.stringify(e))},Tfe=()=>{wt.removeItem(o7)},F2t=(e=!1)=>{Q1??=ope().then(n=>(n?TU(n):Tfe(),n)).catch(n=>{throw(!(n instanceof vM)||n.code!=="AUTH_NO_STATUS_CODE_ERROR")&&TU(null),n}).finally(()=>{Q1=null});const t=L2t();return t&&(e||new Date(t.expires)>new Date)?{cachedSession:t,sessionFetchPromise:Q1}:{cachedSession:null,sessionFetchPromise:Q1}};async function B2t(){const{data:e,error:t}=await eV.GET("/api/auth/csrf","getCsrfToken",{numRetries:2,backOffTime:500});if(t)throw new vM("CSRF_TOKEN_ERROR",{cause:t});return e.csrfToken}async function U2t({redirect:e=!0,callbackUrl:t=window.location.href}){const{error:n}=await eV.POST("/api/auth/signout","signOut",{body:{csrfToken:await B2t(),callbackUrl:t,json:"true"},redirect:"manual"});if(n)throw new vM("SIGN_OUT_ERROR",{cause:n});e&&(xme(t),t.includes("#")&&window.location.reload())}async function Afe(){await GU(),await yW(),wt.keys().forEach(e=>{e.startsWith(Sz)&&wt.removeItem(e)}),Tfe()}const __t=async(...e)=>(await Afe(),U2t(...e));function V2t(e,t){if(e?.pathname.startsWith("/sidecar"))return"sidecar";if(e?.pathname.startsWith("/mobile-sidecar"))return"mobile-sidecar";if(t)return"tab"}function H2t(){const{cachedSession:e,sessionFetchPromise:t}=F2t(),n=Nn(),r=document.querySelector("meta[name='version']")?.getAttribute("content")||"",s=+(document.querySelector("meta[name='min-version']")?.getAttribute("content")||0),o=document.querySelector("meta[name='web-resources-build']")?.getAttribute("content")||"",a=new URL(window.location.href);return{cachedSession:e,sessionFetchPromise:t.then(i=>(e&&!i&&Afe().then(()=>{gx("Auth changed")}),i)).catch(i=>(console.error("Error getting session",i),null)),config:{env:ape(),version:r,minVersion:s,webResourcesBuild:o,erp:V2t(a,n)}}}const p_="/sidecar",z2t=document.getElementById("root"),W2t=Tme.createRoot(z2t),G2t=ipe(p_),$2t=navigator.userAgent;function q2t(e,t){P7(O2t),P7(xhe,"pplx-logo-sprites"),W2t.render(l.jsx(Ar,{fallback:G2t,children:l.jsx(cpe,{host:AU,userAgent:$2t,session:t??void 0,children:l.jsxs(LCe,{isMobileUserAgent:Y2t,hostname:AU,buildVersion:e.webResourcesBuild,spaRoutes:s7,shouldOpenNonSpaRouteInNewTab:!0,base:p_,idleRefresh:!0,buildVersionRefresh:!0,children:[l.jsx(uV,{}),l.jsx(Mfe,{})]})})}))}const{config:h_,cachedSession:px,sessionFetchPromise:K2t}=H2t();window.__PPL_CONFIG__=h_;const Y2t=lpe(navigator.userAgent),AU=window.location.host;vme();px&&OW({bootstrapConfig:h_,user:px.user,routes:s7,base:p_});q2t(h_,px);px||K2t.then(e=>{OW({bootstrapConfig:h_,user:e?.user,routes:s7,base:p_})});export{fCe as $,Hvt as A,K as B,_vt as C,Tn as D,OR as E,vxt as F,wvt as G,Uz as H,$o as I,Bvt as J,Kn as K,er as L,Hx as M,nae as N,xA as O,Ul as P,gCe as Q,Uvt as R,Lvt as S,V as T,Vvt as U,Ws as V,vvt as W,yh as X,zf as Y,mo as Z,Bt as _,DCe as a,QSe as a$,Cvt as a0,i3 as a1,l3 as a2,jye as a3,Pye as a4,cDe as a5,WM as a6,xDe as a7,vDe as a8,P8e as a9,Fvt as aA,kt as aB,NNe as aC,xb as aD,Vx as aE,RSe as aF,uvt as aG,GH as aH,dxt as aI,cvt as aJ,pi as aK,Fo as aL,ci as aM,zgt as aN,sa as aO,nSe as aP,Dvt as aQ,fxt as aR,Zt as aS,yvt as aT,DSe as aU,lSe as aV,Coe as aW,Unt as aX,LA as aY,FA as aZ,cE as a_,zM as aa,qz as ab,O8e as ac,Rf as ad,Rz as ae,Dz as af,pDe as ag,wQ as ah,iT as ai,Sa as aj,Ghe as ak,hye as al,Tc as am,M3 as an,_t as ao,Ut as ap,a2 as aq,co as ar,O_e as as,W4 as at,jvt as au,NX as av,G4 as aw,di as ax,Ov as ay,Oo as az,A3 as b,wr as b$,Wge as b0,de as b1,p3e as b2,ibt as b3,Ca as b4,hxt as b5,wxt as b6,gxt as b7,yxt as b8,qt as b9,Rye as bA,cu as bB,wWe as bC,fSe as bD,jA as bE,DA as bF,Dde as bG,Cde as bH,Tde as bI,tl as bJ,Lo as bK,Ay as bL,dx as bM,Xoe as bN,Us as bO,Dxt as bP,JPe as bQ,fbt as bR,jT as bS,eq as bT,ubt as bU,DT as bV,yu as bW,uxt as bX,gg as bY,mxt as bZ,cY as b_,JK as ba,LSe as bb,T4 as bc,DM as bd,Gt as be,uSe as bf,$d as bg,Wvt as bh,yg as bi,_Ne as bj,Jl as bk,Zbt as bl,Yr as bm,ya as bn,Vn as bo,NN as bp,gvt as bq,Yd as br,Tf as bs,Rc as bt,gn as bu,Yvt as bv,qvt as bw,tbt as bx,nbt as by,$xt as bz,uCe as c,Kx as c$,lM as c0,By as c1,fX as c2,cxt as c3,zvt as c4,zSe as c5,Nxt as c6,jp as c7,e_t as c8,wi as c9,Sbt as cA,NDe as cB,Ibt as cC,Kwe as cD,Nn as cE,mV as cF,jbt as cG,MDe as cH,Nbt as cI,Rbt as cJ,b4 as cK,S4 as cL,C4 as cM,jz as cN,ewe as cO,R_e as cP,bvt as cQ,Si as cR,Tvt as cS,Avt as cT,Ze as cU,wv as cV,Kxt as cW,Ix as cX,Ap as cY,B2t as cZ,yW as c_,Ra as ca,o_t as cb,t_t as cc,Jbt as cd,Sn as ce,KK as cf,Lr as cg,ei as ch,vh as ci,ULe as cj,VLe as ck,lbt as cl,Ur as cm,Kc as cn,Kj as co,Mbt as cp,Tbt as cq,Yj as cr,C_ as cs,lxt as ct,wbt as cu,Cbt as cv,Dbt as cw,kbt as cx,Abt as cy,Ebt as cz,g9 as d,mp as d$,PV as d0,bxt as d1,_xt as d2,u4 as d3,Ls as d4,CN as d5,Pxt as d6,nl as d7,Wxt as d8,AW as d9,Ode as dA,$g as dB,xa as dC,Rxt as dD,tvt as dE,rvt as dF,nvt as dG,G$e as dH,Pbt as dI,ybt as dJ,sn as dK,Dye as dL,NH as dM,gbt as dN,f1t as dO,xbt as dP,EX as dQ,vbt as dR,bbt as dS,Bxt as dT,$c as dU,Mc as dV,JY as dW,oe as dX,lf as dY,qWe as dZ,KWe as d_,m_t as da,g_t as db,p_t as dc,yC as dd,He as de,Qvt as df,Fxt as dg,a4 as dh,Uxt as di,sbt as dj,obt as dk,abt as dl,LFe as dm,E2 as dn,GWe as dp,Myt as dq,Ji as dr,b2e as ds,f_t as dt,h_t as du,$h as dv,fx as dw,gC as dx,Mrt as dy,Ck as dz,dwe as e,x1t as e$,Xd as e0,Yxt as e1,Oxt as e2,uGe as e3,Mvt as e4,kvt as e5,SWe as e6,I0e as e7,Dp as e8,Ixt as e9,OM as eA,FM as eB,UM as eC,yRe as eD,xvt as eE,Obt as eF,WJ as eG,lT as eH,jxt as eI,qxe as eJ,wd as eK,qR as eL,Cye as eM,Sye as eN,eJ as eO,at as eP,mr as eQ,rae as eR,Gvt as eS,$vt as eT,Gxt as eU,Xve as eV,zxt as eW,qxt as eX,yye as eY,rbt as eZ,c_t as e_,Vxt as ea,ig as eb,Fn as ec,W8e as ed,X4 as ee,Xz as ef,hp as eg,Qz as eh,svt as ei,_ye as ej,ovt as ek,u3 as el,UA as em,avt as en,Jxt as eo,pE as ep,X7 as eq,__t as er,ivt as es,Jke as et,Mxt as eu,Hxt as ev,Rvt as ew,Ovt as ex,Pvt as ey,Ivt as ez,pA as f,v_t as f$,i_t as f0,lqe as f1,cqe as f2,uqe as f3,u_t as f4,Ml as f5,l_t as f6,$6 as f7,$A as f8,lvt as f9,RT as fA,xC as fB,oxt as fC,Trt as fD,Qoe as fE,AN as fF,Ot as fG,hs as fH,XK as fI,an as fJ,o2t as fK,u6 as fL,el as fM,x0 as fN,Drt as fO,jv as fP,b0 as fQ,efe as fR,wPe as fS,_bt as fT,kg as fU,XX as fV,Qq as fW,wU as fX,SU as fY,x_t as fZ,j6 as f_,Zvt as fa,ebt as fb,Xvt as fc,Kvt as fd,hW as fe,Jvt as ff,MWe as fg,kWe as fh,g3e as fi,F$ as fj,H$ as fk,$$ as fl,z$ as fm,W$ as fn,XSe as fo,ZSe as fp,n3e as fq,Cxt as fr,Qxt as fs,Xxt as ft,cr as fu,Zxt as fv,evt as fw,OSe as fx,Hd as fy,NT as fz,iCe as g,Ext as g$,ta as g0,Syt as g1,Rde as g2,Uy as g3,v2e as g4,xyt as g5,ife as g6,afe as g7,Lxt as g8,vee as g9,V4 as gA,_d as gB,FN as gC,ec as gD,tJ as gE,R9e as gF,d6 as gG,Gd as gH,s_t as gI,M_e as gJ,xCe as gK,FH as gL,Jd as gM,kxt as gN,Fbt as gO,ie as gP,Tp as gQ,xH as gR,o5e as gS,h$ as gT,Qr as gU,Ox as gV,mQ as gW,b_t as gX,Rv as gY,ZPe as gZ,pxt as g_,vz as ga,$x as gb,sg as gc,m6 as gd,af as ge,Qu as gf,Bbt as gg,nJ as gh,Zf as gi,WPe as gj,Lbt as gk,Ubt as gl,Vbt as gm,Cc as gn,Sc as go,sy as gp,T7e as gq,rQ as gr,oQ as gs,fg as gt,zx as gu,iE as gv,Gj as gw,tz as gx,Nvt as gy,os as gz,wNe as h,rk as h$,yb as h0,gHe as h1,mi as h2,Svt as h3,hvt as h4,W0e as h5,mx as h6,Yt as h7,_v as h8,Yc as h9,Pyt as hA,Kde as hB,SSe as hC,fa as hD,vk as hE,Lz as hF,tu as hG,X6 as hH,axt as hI,Jg as hJ,Cb as hK,o_ as hL,bce as hM,df as hN,h6 as hO,Ho as hP,PLe as hQ,bJe as hR,n6 as hS,tve as hT,Evt as hU,H1t as hV,W1t as hW,WRe as hX,GRe as hY,$Re as hZ,qRe as h_,Q0 as ha,Pde as hb,dvt as hc,mvt as hd,fvt as he,Eoe as hf,wyt as hg,Yu as hh,Tyt as hi,myt as hj,Lde as hk,LJ as hl,S2e as hm,Ude as hn,cv as ho,xde as hp,gee as hq,yee as hr,Tee as hs,Ip as ht,n_t as hu,r_t as hv,jE as hw,nne as hx,ixt as hy,oN as hz,pn as i,pb as i$,ka as i0,_re as i1,J6 as i2,Sxt as i3,Tv as i4,Tr as i5,K4 as i6,pbt as i7,m3 as i8,rg as i9,a_ as iA,h1t as iB,p0 as iC,Gl as iD,eo as iE,wu as iF,OJ as iG,GOe as iH,Hbt as iI,zbt as iJ,qOe as iK,rI as iL,sI as iM,$Oe as iN,kpt as iO,Lst as iP,Cce as iQ,Sce as iR,$8 as iS,Th as iT,nN as iU,GKe as iV,YKe as iW,d_t as iX,lk as iY,KKe as iZ,iN as i_,gV as ia,jx as ib,Xl as ic,dV as id,Ob as ie,L_e as ig,No as ih,Txt as ii,Axt as ij,rY as ik,MV as il,Kue as im,y2 as io,hSe as ip,WA as iq,gSe as ir,_Re as is,hA as it,Mo as iu,Ple as iv,t_ as iw,fm as ix,Bi as iy,sl as iz,ln as j,Yse as j0,xse as j1,_s as j2,hKe as j3,Rse as j4,Lv as j5,pf as j6,Cre as j7,Gx as j8,hbt as j9,wY as ja,k2 as jb,cb as jc,vA as jd,_2e as je,pvt as jf,D4 as jg,rJ as jh,Z6 as ji,Gg as jj,rOe as jk,y_t as jl,Dx as jm,Hoe as jn,mbt as jo,KLe as jp,RN as jq,zn as k,Io as l,Te as m,zLe as n,Re as o,je as p,Ke as q,Ss as r,sr as s,po as t,Vt as u,mu as v,lt as w,xxt as x,ze as y,rt as z}; -//# sourceMappingURL=https://pplx-static-sourcemaps.perplexity.ai/_sidecar/assets/index-AO5YUTXc.js.map diff --git a/Ai docs/Perplexity buss_files/index-VPZzGHwf.css b/Ai docs/Perplexity buss_files/index-VPZzGHwf.css deleted file mode 100644 index e673bd7..0000000 --- a/Ai docs/Perplexity buss_files/index-VPZzGHwf.css +++ /dev/null @@ -1 +0,0 @@ -@keyframes snow-anim{0%{top:-10%}to{top:110%}}@keyframes snow-anim-wave{0%,50%,to{transform:translate(0)}30%{transform:translate(4px)}60%{transform:translate(-2px)}}.animation-weather-snow{animation:snow-anim linear infinite 3s}.animation-weather-snow-wave{animation:snow-anim-wave cubic-bezier(.45,0,.55,1) infinite 3s}@keyframes star-twinkle{0%,60%,to{opacity:1}80%{opacity:.1}}@keyframes star-shoot{0%{left:0;top:60%;opacity:0}2%{opacity:1}8%{left:100%;top:40%;opacity:.6}9%{opacity:0}to{left:100%;top:40%;opacity:0}}.animation-weather-star-twinkle{animation:star-twinkle ease infinite 1s}.animation-weather-star-shoot{animation:star-shoot linear infinite 12s;animation-fill-mode:none;transform:rotate(-10deg);-webkit-mask-image:linear-gradient(to left,black,transparent);mask-image:linear-gradient(to left,black,transparent);animation-delay:2s;opacity:0}@media (min-width: 640px){.animation-weather-star-shoot{transform:rotate(-6deg)}}.animation-weather-star-shoot.context-ntp{transform:rotate(-10deg)}@keyframes rain-anim{0%{transform:translateY(-100%) translateZ(0)}to{transform:translateY(100%) translateZ(0)}}@keyframes rain-splash{0%,90%{opacity:0}to{opacity:1}}.animation-weather-rain{animation:rain-anim ease infinite 1s}.animation-weather-rain-splash{animation:rain-splash 1s ease infinite}.shimmer{animation-name:shimmer;animation-iteration-count:infinite;-webkit-mask-image:linear-gradient(-70deg,black 50%,#0005,black 65%);mask-image:linear-gradient(-70deg,#000 50%,#0005,#000 65%);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:right;mask-position:right}.shimmer-super{background-image:linear-gradient(to left,oklch(var(--foreground-color)),oklch(var(--dark-super-color)) 40% 60%,oklch(var(--foreground-color)))}[data-color-scheme=dark] .shimmer-super{background-image:linear-gradient(to left,oklch(var(--super-color)),oklch(var(--super-color) / .4) 20% 80%,oklch(var(--super-color)))}@media (min-width: 640px){.shimmer{-webkit-mask-image:linear-gradient(-70deg,black 35%,#0005,black 55%);mask-image:linear-gradient(-70deg,#000 35%,#0005,#000 55%)}}@keyframes shimmer{to{-webkit-mask-position:left;mask-position:left}}.dotGridContainer{--dot-bg: oklch(var(--background-base-color) / 1);--dog-bg-highlight: oklch(var(--super-color) / 1);--dot-color: transparent;--dot-size: 3px;--dot-space: 22px}.dotGrid{background:linear-gradient(90deg,var(--dot-bg) calc((var(--dot-space) - var(--dot-size))),transparent 0%) center / var(--dot-space) var(--dot-space),linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)),transparent 0%) center / var(--dot-space) var(--dot-space),var(--dot-color);background-position:top left}.dotHighlightGrid{display:grid;grid-auto-columns:var(--dot-space);grid-auto-rows:var(--dot-space)}.gridDot{display:flex;align-items:center;justify-content:center}.gridDot:before{content:"";width:100%;height:100%;animation:gridDotFade;animation-duration:2s;animation-fill-mode:both;background-color:currentColor}.gridDot.highlight:before{background-color:var(--dog-bg-highlight)}@keyframes gridDotFade{0%{opacity:0}20%{opacity:1}to{opacity:0}}.animate-maintenance{animation:maintenanceLoader 40s linear forwards infinite;stroke-dasharray:20 16;stroke-dashoffset:477.3027648925781}@keyframes maintenanceLoader{to{stroke-dashoffset:0}}.gradient-blur{width:100%;pointer-events:none;bottom:0;position:absolute}.gradient-blur>div,.gradient-blur:before,.gradient-blur:after{position:absolute;inset:0}.gradient-blur:before{content:"";z-index:1;-webkit-backdrop-filter:blur(.2px);backdrop-filter:blur(.2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,1) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,0) 37.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,1) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,0) 37.5%)}.gradient-blur>div:nth-of-type(1){z-index:2;-webkit-backdrop-filter:blur(.3px);backdrop-filter:blur(.3px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,0) 50%);mask:linear-gradient(to top,rgba(0,0,0,0) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,0) 50%)}.gradient-blur>div:nth-of-type(2){z-index:3;-webkit-backdrop-filter:blur(.4px);backdrop-filter:blur(.4px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,0) 62.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,0) 62.5%)}.gradient-blur>div:nth-of-type(3){z-index:4;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,0) 75%);mask:linear-gradient(to top,rgba(0,0,0,0) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,0) 75%)}.gradient-blur>div:nth-of-type(4){z-index:5;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,0) 87.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,0) 87.5%)}.gradient-blur>div:nth-of-type(5){z-index:6;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,0) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,0) 100%)}.gradient-blur>div:nth-of-type(6){z-index:7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,1) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,1) 100%)}.gradient-blur:after{content:"";z-index:8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 87.5%,rgba(0,0,0,1) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 87.5%,rgba(0,0,0,1) 100%)}number-flow-react::part(left),number-flow-react::part(right),number-flow-react::part(left):after,number-flow-react::part(right):after,number-flow-react::part(symbol){padding:calc(var(--number-flow-mask-height, .25em) / 2) 0}.wrapper{perspective:1000px;position:relative}.shadow{width:80%;height:3px;background:#000;position:absolute;border-radius:50%;filter:blur(2px);opacity:.05;top:calc(100% + 3px);left:50%;transform:translate(-50%)}.dark .shadow{opacity:.4}.coin{height:100%;width:100%;position:absolute;transform-style:preserve-3d;transform-origin:center center;border-radius:50%}.coin.animate{animation-name:coin-spin}.coin .front,.coin .back{position:absolute;height:100%;width:100%;border-radius:50%;background-size:cover}.coin .side{transform-style:preserve-3d;backface-visibility:hidden}.coin .side .spoke{height:100%;width:100%;position:absolute;transform-style:preserve-3d;backface-visibility:hidden}.coin .side .spoke .facet{content:"";display:block;position:absolute;background:#bbb}.dark .coin .side .spoke .facet{background:#aaa}.coin .side .spoke .facet:first-child{transform-origin:top center}.coin .side .spoke .facet:last-child{bottom:0;transform-origin:center bottom}.coin .bottom,.coin .top{position:absolute;border-radius:50%;height:100%;width:100%}.article-prose .prose{font-size:18px;line-height:1.6}.markdown-highlight{background-color:#20808d80}.dark .markdown-highlight{background-color:#1fb8cd1a;color:#1fb8cd}@media print{h1,h2,h3,h4,h5,h6{-moz-column-break-inside:avoid;break-inside:avoid;-moz-column-break-after:avoid;break-after:avoid;page-break-inside:avoid;page-break-after:avoid}ul,ol{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid}.scrollable-container{height:auto!important;overflow:visible!important;max-height:none!important;border:none!important}.prose p,.prose ul,.prose ol,.prose blockquote,.prose pre,.prose table{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid;margin:0!important;padding:.25rem 0!important}.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6{-moz-column-break-after:avoid;break-after:avoid;page-break-after:avoid;margin-top:1rem!important;margin-bottom:.5rem!important}.prose li{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid}}body[data-scroll-locked] [data-type=portal]{pointer-events:auto}.no-scroll *{overflow:hidden!important}@font-face{font-family:fkGroteskNeue;src:url(https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2) format("woff2");font-display:swap}@font-face{font-family:fkGrotesk;src:url(https://r2cdn.perplexity.ai/fonts/FKGrotesk.woff2) format("woff2");font-display:swap}@font-face{font-family:berkeleyMono;src:url(https://r2cdn.perplexity.ai/fonts/BerkeleyMono-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:Newsreader;src:url(https://r2cdn.perplexity.ai/fonts/Newsreader.woff2) format("woff2");font-display:swap}:root{--font-fk-grotesk-neue: "fkGroteskNeue";--font-fk-grotesk: "fkGrotesk";--font-berkeley-mono: "berkeleyMono";--font-newsreader: "Newsreader"}body[data-scroll-locked][data-scroll-locked]{margin-right:inherit!important;overflow:visible!important}.confirm-dialog{background-color:oklch(var(--offset-color));border-radius:.375rem;border:1px solid oklch(var(--foreground-subtler-color));bottom:100%;display:block;left:0;margin-bottom:.75rem;padding:var(--size-sm) var(--size-md);position:absolute;right:0;width:100%}.dark .confirm-dialog{background-color:var(--background-base-color);border-color:oklch(var(--foreground-subtler-color))}@media (min-width: 640px){.confirm-dialog{align-items:center;display:flex;justify-content:space-between;inset:100% auto auto 50%;margin-bottom:0;margin-top:.75rem;width:-moz-min-content;width:min-content}}span:has(.segmented-control[data-state=unchecked])+span>.segmented-control[data-state=unchecked]{position:relative}span:has(.segmented-control[data-state=unchecked])+span>.segmented-control[data-state=unchecked]:before{--tw-enter-opacity: 0;animation-duration:.3s;animation-name:enter;animation-timing-function:ease-in-out;background:oklch(var(--foreground-color) / 15%);bottom:9px;content:"";left:0;position:absolute;top:9px;width:1px}@layer pplx-base,base,components,utilities;@layer pplx-base{:root{--pale-yellow-50: 99.62% .004 106.47;--pale-yellow-100: 99.02% .004 106.47;--pale-yellow-200: 96.28% .007 106.52;--pale-yellow-300: 92.96% .007 106.53;--pale-yellow-600: 88.28% .012 106.65;--pale-yellow-800: 68.98% .027 109.55;--pale-teal-100: 96.95% .014 196.93;--mint-50: 98.85% .012 170.28;--mint-150: 93.8% .015 171.04;--pale-cyan-50: 49.33% .019 171.99;--pale-cyan-150: 34.26% .003 197.03;--pale-cyan-200: 30.32% .003 197.01;--pale-cyan-300: 24.57% .003 196.96;--pale-cyan-400: 21.67% .002 197.04;--pale-blue-100: 36.61% .003 228.87;--pale-blue-200: 30.39% .04 213.68;--red-100: 53.47% .151 25.99;--red-200: 51.83% .168 21.78;--hydra-150: 94.94% .033 208.37;--hydra-350: 71.92% .112 205.51;--hydra-450: 55.27% .086 208.61;--hydra-550: 39.71% .062 207.67;--astra-450: 77.92% .012 71.87;--astra-750: 27.99% .014 76.29;--astra-800: 20.19% .011 80.54;--umbra-150: 84.32% .008 207.14;--umbra-250: 70.09% .007 197;--umbra-350: 58.21% .006 196.99;--terra-150: 91.23% .05 48.15;--terra-350: 70.73% .133 38.31;--terra-450: 52.75% .13 37.37;--terra-550: 43.01% .108 37.17;--jenova-150: 93.28% .038 357.01;--jenova-250: 84.44% .092 .32;--jenova-450: 49.39% .109 9.38;--jenova-550: 34.35% .079 9.21;--rosa-150: 88.55% .06 28.44;--rosa-350: 68.18% .207 22.93;--rosa-450: 51.72% .199 21.85;--rosa-550: 39.55% .16 22.99;--costa-150: 93.76% .048 72.24;--costa-300: 80.62% .151 67.71;--costa-350: 73.83% .169 62.71;--costa-400: 65.87% .163 54.96;--costa-500: 51.37% .155 42.1;--altana-150: 95% .083 95.76;--altana-350: 80.51% .151 81.42;--altana-400: 71.97% .149 81.37;--altana-450: 61.87% .129 77.72;--altana-500: 51.11% .109 73.59;--dalmasca-150: 95.74% .076 97.14;--dalmasca-300: 83.9% .132 96.6;--dalmasca-400: 69.87% .123 97.59;--dalmasca-550: 47.82% .091 97.9;--gridania-150: 95.46% .037 105.4;--gridania-350: 75.63% .107 109.92;--gridania-450: 60.17% .065 108.2;--gridania-550: 42.28% .047 108.27;--limsa-150: 94.36% .042 217.16;--limsa-350: 73.11% .113 232.51;--limsa-450: 53.86% .101 231.01;--limsa-550: 36.01% .071 232.13;--kuja-150: 94.87% .046 325.93;--kuja-350: 72.5% .119 316.63;--kuja-450: 54.3% .097 316.69;--kuja-550: 38% .079 316.84;--light-super-color: var(--hydra-450);--light-super-bg-color: var(--pale-teal-100);--light-super-active-bg-color: var(--hydra-550);--light-max-color: var(--altana-400);--light-caution-color: var(--red-200);--light-attention-color: var(--costa-400);--light-positive-color: var(--hydra-450);--light-negative-color: var(--rosa-450);--light-background-underlay-color: var(--pale-yellow-200);--light-background-base-color: var(--pale-yellow-100);--light-background-subtle-color: var(--pale-yellow-800) / .16;--light-background-subtler-color: var(--pale-yellow-800) / .1;--light-background-subtlest-color: var(--pale-yellow-800) / .05;--light-background-raised-color: var(--pale-yellow-50);--light-background-elevated-color: 100% 0 0;--light-background-inverse-color: var(--pale-blue-200);--light-foreground-color: var(--pale-blue-200);--light-foreground-quiet-color: var(--light-foreground-color) / .75;--light-foreground-quieter-color: var(--light-foreground-color) / .48;--light-foreground-quietest-color: var(--light-foreground-color) / .36;--light-foreground-subtle-color: var(--light-foreground-color) / .24;--light-foreground-subtler-color: var(--light-foreground-color) / .16;--light-foreground-subtlest-color: var(--light-foreground-color) / .1;--light-foreground-inverse-color: var(--light-background-base-color);--light-border-color: var(--pale-yellow-600);--light-backdrop-color: .85 0 0;--light-offset-color: var(--pale-yellow-200);--light-offset-plus-color: var(--pale-yellow-300);--light-raised-offset-color: var(--light-offset-color);--dark-super-color: var(--hydra-350);--dark-super-bg-color: var(--pale-blue-200);--dark-super-active-bg-color: var(--hydra-350);--dark-max-color: var(--altana-350);--dark-caution-color: var(--red-100);--dark-attention-color: var(--costa-350);--dark-positive-color: var(--hydra-350);--dark-negative-color: var(--rosa-350);--dark-background-underlay-color: var(--pale-cyan-300);--dark-background-base-color: var(--pale-cyan-400);--dark-background-subtle-color: var(--pale-cyan-50) / .2;--dark-background-subtler-color: var(--pale-cyan-50) / .1;--dark-background-subtlest-color: var(--pale-cyan-50) / .05;--dark-background-raised-color: var(--dark-background-subtler-color);--dark-background-elevated-color: var(--dark-background-base-color);--dark-background-inverse-color: var(--pale-yellow-300);--dark-foreground-color: var(--pale-yellow-300);--dark-foreground-quiet-color: var(--dark-foreground-color) / .55;--dark-foreground-quieter-color: var(--dark-foreground-color) / .35;--dark-foreground-quietest-color: var(--dark-foreground-color) / .25;--dark-foreground-subtle-color: var(--dark-foreground-color) / .15;--dark-foreground-subtler-color: var(--dark-foreground-color) / .1;--dark-foreground-subtlest-color: var(--dark-foreground-color) / .05;--dark-foreground-inverse-color: var(--dark-background-base-color);--dark-border-color: var(--pale-blue-100);--dark-backdrop-color: .15 0 0;--dark-offset-color: var(--pale-cyan-300);--dark-offset-plus-color: var(--pale-cyan-200);--dark-raised-offset-color: var(--dark-offset-plus-color)}:root,[data-color-scheme=light],.light{--super-color: var(--light-super-color);--super-bg-color: var(--light-super-bg-color);--super-active-bg-color: var(--light-super-active-bg-color);--max-color: var(--light-max-color);--caution-color: var(--light-caution-color);--attention-color: var(--light-attention-color);--positive-color: var(--light-positive-color);--negative-color: var(--light-negative-color);--background-underlay-color: var(--light-background-underlay-color);--background-base-color: var(--light-background-base-color);--background-subtle-color: var(--light-background-subtle-color);--background-subtler-color: var(--light-background-subtler-color);--background-subtlest-color: var(--light-background-subtlest-color);--background-raised-color: var(--light-background-raised-color);--background-elevated-color: var(--light-background-elevated-color);--background-inverse-color: var(--light-background-inverse-color);--foreground-color: var(--light-foreground-color);--foreground-quiet-color: var(--light-foreground-quiet-color);--foreground-quieter-color: var(--light-foreground-quieter-color);--foreground-quietest-color: var(--light-foreground-quietest-color);--foreground-subtle-color: var(--light-foreground-subtle-color);--foreground-subtler-color: var(--light-foreground-subtler-color);--foreground-subtlest-color: var(--light-foreground-subtlest-color);--foreground-inverse-color: var(--light-foreground-inverse-color);--border-color: var(--light-border-color);--backdrop-color: var(--light-backdrop-color);--background-lightbox-color: 0 0 360;--shadow-overlay-border: rgba(0, 0, 0, .05);--offset-color: var(--light-offset-color);--offset-plus-color: var(--light-offset-plus-color);--raised-offset-color: var(--light-raised-offset-color)}[data-theme=grey]{--super-bg-color: var(--astra-450);--super-color: var(--astra-750);--dark-super-bg-color: var(--umbra-350);--dark-super-color: var(--umbra-150)}[data-theme=teal]{--super-bg-color: var(--hydra-150);--super-color: var(--hydra-450);--dark-super-bg-color: var(--hydra-550);--dark-super-color: var(--hydra-350)}[data-theme=brown]{--super-bg-color: var(--terra-150);--super-color: var(--terra-450);--dark-super-bg-color: var(--terra-550);--dark-super-color: var(--terra-350)}[data-theme=maroon]{--super-bg-color: var(--jenova-150);--super-color: var(--jenova-450);--dark-super-bg-color: var(--jenova-550);--dark-super-color: var(--jenova-250)}[data-theme=red]{--super-bg-color: var(--rosa-150);--super-color: var(--rosa-450);--dark-super-bg-color: var(--rosa-550);--dark-super-color: var(--rosa-350)}[data-theme=orange]{--super-bg-color: var(--costa-150);--super-color: var(--costa-400);--dark-super-bg-color: var(--costa-500);--dark-super-color: var(--costa-300)}[data-theme=gold]{--super-bg-color: var(--altana-150);--super-color: var(--altana-400);--dark-super-bg-color: var(--altana-500);--dark-super-color: var(--altana-350)}[data-theme=yellow]{--super-bg-color: var(--dalmasca-150);--super-color: var(--dalmasca-400);--dark-super-bg-color: var(--dalmasca-550);--dark-super-color: var(--dalmasca-300)}[data-theme=green]{--super-bg-color: var(--gridania-150);--super-color: var(--gridania-450);--dark-super-bg-color: var(--gridania-550);--dark-super-color: var(--gridania-350)}[data-theme=blue]{--super-bg-color: var(--limsa-150);--super-color: var(--limsa-450);--dark-super-bg-color: var(--limsa-550);--dark-super-color: var(--limsa-350)}[data-theme=purple]{--super-bg-color: var(--kuja-150);--super-color: var(--kuja-450);--dark-super-bg-color: var(--kuja-550);--dark-super-color: var(--kuja-350)}[data-color-scheme=dark],.dark{--super-color: var(--dark-super-color);--super-bg-color: var(--dark-super-bg-color);--super-active-bg-color: var(--dark-super-active-bg-color);--max-color: var(--dark-max-color);--caution-color: var(--dark-caution-color);--attention-color: var(--dark-attention-color);--positive-color: var(--dark-positive-color);--negative-color: var(--dark-negative-color);--background-underlay-color: var(--dark-background-underlay-color);--background-base-color: var(--dark-background-base-color);--background-subtle-color: var(--dark-background-subtle-color);--background-subtler-color: var(--dark-background-subtler-color);--background-subtlest-color: var(--dark-background-subtlest-color);--background-raised-color: var(--dark-background-raised-color);--background-elevated-color: var(--dark-background-elevated-color);--background-inverse-color: var(--dark-background-inverse-color);--foreground-color: var(--dark-foreground-color);--foreground-quiet-color: var(--dark-foreground-quiet-color);--foreground-quieter-color: var(--dark-foreground-quieter-color);--foreground-quietest-color: var(--dark-foreground-quietest-color);--foreground-subtle-color: var(--dark-foreground-subtle-color);--foreground-subtler-color: var(--dark-foreground-subtler-color);--foreground-subtlest-color: var(--dark-foreground-subtlest-color);--foreground-inverse-color: var(--dark-foreground-inverse-color);--border-color: var(--dark-border-color);--backdrop-color: var(--dark-backdrop-color);--shadow-overlay-border: rgba(255, 255, 255, .1);--offset-color: var(--dark-offset-color);--offset-plus-color: var(--dark-offset-plus-color);--raised-offset-color: var(--dark-raised-offset-color)}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]){--super-color: var(--dark-super-color);--super-bg-color: var(--dark-super-bg-color);--max-color: var(--dark-max-color);--caution-color: var(--dark-caution-color);--attention-color: var(--dark-attention-color);--positive-color: var(--dark-positive-color);--negative-color: var(--dark-negative-color);--background-underlay-color: var(--dark-background-underlay-color);--background-base-color: var(--dark-background-base-color);--background-subtle-color: var(--dark-background-subtle-color);--background-subtler-color: var(--dark-background-subtler-color);--background-subtlest-color: var(--dark-background-subtlest-color);--background-raised-color: var(--dark-background-raised-color);--background-elevated-color: var(--dark-background-elevated-color);--background-inverse-color: var(--dark-background-inverse-color);--foreground-color: var(--dark-foreground-color);--foreground-quiet-color: var(--dark-foreground-quiet-color);--foreground-quieter-color: var(--dark-foreground-quieter-color);--foreground-quietest-color: var(--dark-foreground-quietest-color);--foreground-subtle-color: var(--dark-foreground-subtle-color);--foreground-subtler-color: var(--dark-foreground-subtler-color);--foreground-subtlest-color: var(--dark-foreground-subtlest-color);--foreground-inverse-color: var(--dark-foreground-inverse-color);--border-color: var(--dark-border-color);--backdrop-color: var(--dark-backdrop-color);--shadow-overlay-border: rgba(255, 255, 255, .1);--offset-color: var(--dark-offset-color);--offset-plus-color: var(--dark-offset-plus-color);--raised-offset-color: var(--dark-raised-offset-color)}}.max-super-override{--super-color: var(--max-color)}:root{--border-dynamic: 73.5% .012 85 / .2;--surface-offset-special: 21% .04 200 / .2}:root{--banner-height: 34px;--mobile-nav-height: env(safe-area-inset-bottom, 0);--thread-width: 1100px;--thread-content-width: 740px;--header-height: 56px;--thread-input-height-with-padding: 130px;--thread-attachments-height-with-padding: 182px;--thread-visual-spacing: var(--size-md);--sidecar-header-height: 56px;--page-horizontal-padding: var(--size-md);--page-content-height: calc(100dvh - var(--header-height));--toast-v-margin: 60px;--toast-h-margin: 24px;--sidecar-content-height: calc(100vh - var(--sidecar-header-height));--mobile-sidecar-drag-handle-height: 24px;--mobile-sidecar-content-height: calc( 100dvh - var(--mobile-sidecar-drag-handle-height) );--mobile-tab-bar-height: 44px;--mobile-content-height: calc( var(--page-content-height) - var(--mobile-tab-bar-height) );--safe-area-inset-bottom: env(safe-area-inset-bottom, 0);--in-app-header-height: 50px;--sidebar-width: 220px;--sidebar-width-collapsed: 90px;--sidebar-pinned-width: calc(200px + var(--sidebar-default-width));--sidebar-default-width: 72px;--min-touch-target: 2.75rem;--size-2xs: 2px;--size-xs: 4px;--size-sm: 8px;--size-md: 16px;--size-ml: 24px;--size-lg: 32px;--size-xl: 48px}:root[data-erp=sidecar]{--mobile-nav-height: 8px}:root[data-erp=tab]{--page-content-height: calc(100dvh - var(--header-height));--toast-v-margin: 70px}}@layer pplx-base{.reset{all:unset}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:oklch(var(--foreground-subtler-color))}: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:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo;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:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,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]{display:none}em,i{font-variation-settings:"ital" 120}:lang(zh){font-family:var(--font-fk-grotesk-neue),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",PingFang SC,Microsoft YaHei,PingFang TC,PingFang HK,PingFang MO,Microsoft JhengHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-Hans),:lang(zh-CN),:lang(zh-SG){font-family:var(--font-fk-grotesk-neue),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",PingFang SC,Microsoft YaHei,PingFang TC,PingFang HK,Microsoft JhengHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-Hant),:lang(zh-TW){font-family:var(--font-fk-grotesk-neue),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",PingFang TC,Microsoft JhengHei,PingFang HK,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-HK){font-family:var(--font-fk-grotesk-neue),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",PingFang HK,Microsoft JhengHei,PingFang MO,PingFang TC,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-MO){font-family:var(--font-fk-grotesk-neue),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",PingFang MO,Microsoft JhengHei,PingFang HK,PingFang TC,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(ja){font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,Yu Gothic,Meiryo,PingFang SC,Microsoft YaHei,Microsoft JhengHei,Apple SD Gothic Neo}:lang(ko){font-family:var(--font-fk-grotesk-neue),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",Apple SD Gothic Neo,Hiragino Sans,Yu Gothic,Meiryo,PingFang SC,Microsoft YaHei,Microsoft JhengHei}*{scrollbar-color:initial;scrollbar-width:initial}*,: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: }.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:none;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:550}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;padding-inline-start:1.625em;margin:0}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;padding-inline-start:1.625em;margin:0}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:1em;margin-bottom:1em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:oklch(var(--foreground-quiet-color));border-inline-start-width:4px;border-inline-start-color:oklch(var(--border-color-100));quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;padding-left:1rem}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:500;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333;font-family:var(--font-fk-grotesk)}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:550;font-size:.875em;background-color:oklch(var(--background-subtle-color));border-radius:.3125rem;padding:.125rem .25rem}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:""}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:""}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-inline-end:1.1428571em;padding-inline-start:1.1428571em;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: oklch(var(--foreground-color));--tw-prose-headings: oklch(var(--foreground-color));--tw-prose-lead: oklch(var(--foreground-color));--tw-prose-links: oklch(var(--foreground-color));--tw-prose-bold: oklch(var(--foreground-color));--tw-prose-counters: oklch(var(--foreground-quiet-color));--tw-prose-bullets: oklch(var(--foreground-quiet-color));--tw-prose-hr: oklch(var(--foreground-subtler-color));--tw-prose-quotes: oklch(var(--foreground-color));--tw-prose-quote-borders: oklch(var(--foreground-subtler-color));--tw-prose-captions: oklch(var(--foreground-quiet-color));--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: oklch(var(--foreground-color));--tw-prose-pre-code: oklch(var(--foreground-color));--tw-prose-pre-bg: oklch(var(--offset-color));--tw-prose-th-borders: oklch(var(--foreground-subtler-color));--tw-prose-td-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-body: oklch(var(--dark-foreground-color));--tw-prose-invert-headings: oklch(var(--dark-foreground-color));--tw-prose-invert-lead: oklch(var(--dark-foreground-color));--tw-prose-invert-links: oklch(var(--dark-foreground-color));--tw-prose-invert-bold: oklch(var(--dark-foreground-color));--tw-prose-invert-counters: oklch(var(--foreground-quiet-color));--tw-prose-invert-bullets: oklch(var(--foreground-quiet-color));--tw-prose-invert-hr: oklch(var(--foreground-subtler-color));--tw-prose-invert-quotes: oklch(var(--dark-foreground-color));--tw-prose-invert-quote-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-captions: oklch(var(--dark-foreground-color));--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: oklch(var(--dark-foreground-color));--tw-prose-invert-pre-code: oklch(var(--dark-foreground-color));--tw-prose-invert-pre-bg: oklch(var(--offset-color));--tw-prose-invert-th-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-td-borders: oklch(var(--foreground-subtler-color));font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose :where(b):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550}.prose :where(th):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.pointer-events-none{pointer-events:none}.\!pointer-events-auto{pointer-events:auto!important}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.\!static{position:static!important}.static{position:static}.\!fixed{position:fixed!important}.fixed{position:fixed}.\!absolute{position:absolute!important}.absolute{position:absolute}.\!relative{position:relative!important}.relative{position:relative}.sticky{position:sticky}.-inset-3{inset:-.75rem}.-inset-lg{inset:calc(var(--size-lg) * -1)}.-inset-md{inset:calc(var(--size-md) * -1)}.-inset-px{inset:-1px}.-inset-sm{inset:calc(var(--size-sm) * -1)}.-inset-three{inset:-3px}.-inset-xl{inset:calc(var(--size-xl) * -1)}.inset-0{inset:0}.inset-\[-12px\]{inset:-12px}.inset-\[10\%\]{inset:10%}.inset-half{inset:.5px}.inset-xs{inset:var(--size-xs)}.\!inset-x-\[12px\]{left:12px!important;right:12px!important}.-inset-x-1{left:-.25rem;right:-.25rem}.-inset-x-1\.5{left:-.375rem;right:-.375rem}.-inset-x-3{left:-.75rem;right:-.75rem}.-inset-x-md{left:calc(var(--size-md) * -1);right:calc(var(--size-md) * -1)}.-inset-x-sm{left:calc(var(--size-sm) * -1);right:calc(var(--size-sm) * -1)}.-inset-x-xl{left:calc(var(--size-xl) * -1);right:calc(var(--size-xl) * -1)}.-inset-x-xs{left:calc(var(--size-xs) * -1);right:calc(var(--size-xs) * -1)}.-inset-y-2xs{top:calc(var(--size-2xs) * -1);bottom:calc(var(--size-2xs) * -1)}.-inset-y-xs{top:calc(var(--size-xs) * -1);bottom:calc(var(--size-xs) * -1)}.inset-x-0{left:0;right:0}.inset-x-4{left:1rem;right:1rem}.inset-x-\[-12px\]{left:-12px;right:-12px}.inset-x-\[12px\]{left:12px;right:12px}.inset-x-lg{left:var(--size-lg);right:var(--size-lg)}.inset-x-md{left:var(--size-md);right:var(--size-md)}.inset-x-sm{left:var(--size-sm);right:var(--size-sm)}.inset-y-0{top:0;bottom:0}.inset-y-1{top:.25rem;bottom:.25rem}.inset-y-sm{top:var(--size-sm);bottom:var(--size-sm)}.inset-y-two{top:2px;bottom:2px}.inset-y-xs{top:var(--size-xs);bottom:var(--size-xs)}.\!bottom-\[32px\]{bottom:32px!important}.\!left-sideBarWidth{left:var(--sidebar-width)!important}.\!left-sidebarDefaultWidth{left:var(--sidebar-default-width)!important}.\!left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)!important}.\!top-0{top:0!important}.-bottom-0{bottom:-0px}.-bottom-0\.5{bottom:-.125rem}.-bottom-1{bottom:-.25rem}.-bottom-lg{bottom:calc(var(--size-lg) * -1)}.-bottom-md{bottom:calc(var(--size-md) * -1)}.-bottom-sm{bottom:calc(var(--size-sm) * -1)}.-bottom-xl{bottom:calc(var(--size-xl) * -1)}.-bottom-xs{bottom:calc(var(--size-xs) * -1)}.-end-\[24px\]{inset-inline-end:-24px}.-end-xs{inset-inline-end:calc(var(--size-xs) * -1)}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-left-md{left:calc(var(--size-md) * -1)}.-left-sm{left:calc(var(--size-sm) * -1)}.-left-xl{left:calc(var(--size-xl) * -1)}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-right-2\.5{right:-.625rem}.-right-md{right:calc(var(--size-md) * -1)}.-right-sm{right:calc(var(--size-sm) * -1)}.-right-xl{right:calc(var(--size-xl) * -1)}.-right-xs{right:calc(var(--size-xs) * -1)}.-top-0{top:-0px}.-top-0\.5{top:-.125rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-12{top:-3rem}.-top-2{top:-.5rem}.-top-2\.5{top:-.625rem}.-top-9{top:-2.25rem}.-top-\[3px\]{top:-3px}.-top-md{top:calc(var(--size-md) * -1)}.-top-px{top:-1px}.-top-sm{top:calc(var(--size-sm) * -1)}.-top-three{top:-3px}.-top-two{top:-2px}.-top-xl{top:calc(var(--size-xl) * -1)}.-top-xs{top:calc(var(--size-xs) * -1)}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-1\.5{bottom:.375rem}.bottom-1\/2{bottom:50%}.bottom-2{bottom:.5rem}.bottom-20{bottom:5rem}.bottom-3{bottom:.75rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-100px\]{bottom:-100px}.bottom-\[-4px\]{bottom:-4px}.bottom-\[1\.5px\]{bottom:1.5px}.bottom-\[12px\]{bottom:12px}.bottom-\[20px\]{bottom:20px}.bottom-\[20vh\]{bottom:20vh}.bottom-\[77px\]{bottom:77px}.bottom-full{bottom:100%}.bottom-lg{bottom:var(--size-lg)}.bottom-md{bottom:var(--size-md)}.bottom-safeAreaInsetBottom{bottom:var(--safe-area-inset-bottom)}.bottom-sm{bottom:var(--size-sm)}.bottom-toastVMargin{bottom:var(--toast-v-margin)}.bottom-xl{bottom:var(--size-xl)}.bottom-xs{bottom:var(--size-xs)}.end-md{inset-inline-end:var(--size-md)}.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-\[-9999px\]{left:-9999px}.left-\[10vw\]{left:10vw}.left-\[12px\]{left:12px}.left-\[17px\]{left:17px}.left-\[calc\(12px-1px\)\]{left:11px}.left-full{left:100%}.left-half{left:.5px}.left-lg{left:var(--size-lg)}.left-md{left:var(--size-md)}.left-px{left:1px}.left-sideBarWidth{left:var(--sidebar-width)}.left-sidebarDefaultWidth{left:var(--sidebar-default-width)}.left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)}.left-sm{left:var(--size-sm)}.left-three{left:3px}.left-two{left:2px}.left-xl{left:var(--size-xl)}.left-xs{left:var(--size-xs)}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-20{right:5rem}.right-24{right:6rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.right-6{right:1.5rem}.right-\[-4px\]{right:-4px}.right-\[-8px\]{right:-8px}.right-\[12px\]{right:12px}.right-\[20px\]{right:20px}.right-\[90\%\]{right:90%}.right-\[calc\(100\%\+1px\)\]{right:calc(100% + 1px)}.right-full{right:100%}.right-lg{right:var(--size-lg)}.right-md{right:var(--size-md)}.right-px{right:1px}.right-sm{right:var(--size-sm)}.right-three{right:3px}.right-toastHMargin{right:var(--toast-h-margin)}.right-xs{right:var(--size-xs)}.start-0{inset-inline-start:0px}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-5{top:1.25rem}.top-\[-1\.25px\]{top:-1.25px}.top-\[-1\.4rem\]{top:-1.4rem}.top-\[-100px\]{top:-100px}.top-\[-14px\]{top:-14px}.top-\[-15px\]{top:-15px}.top-\[-20px\]{top:-20px}.top-\[-8px\]{top:-8px}.top-\[10vh\]{top:10vh}.top-\[200px\]{top:200px}.top-\[36px\]{top:36px}.top-\[48px\]{top:48px}.top-\[90\%\]{top:90%}.top-\[calc\(100\%_-_2px\)\]{top:calc(100% - 2px)}.top-\[var\(--header-height\)\]{top:var(--header-height)}.top-full{top:100%}.top-headerHeight{top:var(--header-height)}.top-lg{top:var(--size-lg)}.top-md{top:var(--size-md)}.top-px{top:1px}.top-sm{top:var(--size-sm)}.top-three{top:3px}.top-toastVMargin{top:var(--toast-v-margin)}.top-two{top:2px}.top-xs{top:var(--size-xs)}.isolate{isolation:isolate}.\!z-10{z-index:10!important}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[10\]{z-index:10}.z-\[15\]{z-index:15}.z-\[1\]{z-index:1}.z-\[2000\]{z-index:2000}.z-\[22\]{z-index:22}.z-\[23\]{z-index:23}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[49\]{z-index:49}.z-\[4\]{z-index:4}.z-\[5\]{z-index:5}.z-\[99999\]{z-index:99999}.z-\[999\]{z-index:999}.\!order-first{order:-9999!important}.order-1{order:1}.order-2{order:2}.order-last{order:9999}.\!col-span-12{grid-column:span 12 / span 12!important}.col-span-1{grid-column:span 1 / span 1}.col-span-12{grid-column:span 12 / span 12}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-span-4{grid-column:span 4 / span 4}.col-span-5{grid-column:span 5 / span 5}.col-span-6{grid-column:span 6 / span 6}.col-span-7{grid-column:span 7 / span 7}.col-span-8{grid-column:span 8 / span 8}.col-span-full{grid-column:1 / -1}.\!col-start-1{grid-column-start:1!important}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-9{grid-column-start:9}.-col-end-1{grid-column-end:-1}.col-end-2{grid-column-end:2}.col-end-3{grid-column-end:3}.col-end-4{grid-column-end:4}.\!row-span-4{grid-row:span 4 / span 4!important}.row-span-1{grid-row:span 1 / span 1}.row-span-2{grid-row:span 2 / span 2}.row-span-3{grid-row:span 3 / span 3}.\!row-start-1{grid-row-start:1!important}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.row-end-2{grid-row-end:2}.row-end-3{grid-row-end:3}.float-right{float:right}.clear-end{clear:inline-end}.clear-right{clear:right}.clear-both{clear:both}.\!m-0{margin:0!important}.-m-md{margin:calc(var(--size-md) * -1)}.-m-px{margin:-1px}.-m-sm{margin:calc(var(--size-sm) * -1)}.-m-xl{margin:calc(var(--size-xl) * -1)}.-m-xs{margin:calc(var(--size-xs) * -1)}.m-0{margin:0}.m-1{margin:.25rem}.m-4{margin:1rem}.m-\[-20px\]{margin:-20px}.m-\[-24px\]{margin:-24px}.m-auto{margin:auto}.m-md{margin:var(--size-md)}.m-px{margin:1px}.m-sm{margin:var(--size-sm)}.m-xs{margin:var(--size-xs)}.\!-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.\!-mx-xs{margin-left:calc(var(--size-xs) * -1)!important;margin-right:calc(var(--size-xs) * -1)!important}.\!mx-\[12px\]{margin-left:12px!important;margin-right:12px!important}.\!my-0{margin-top:0!important;margin-bottom:0!important}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.-mx-lg{margin-left:calc(var(--size-lg) * -1);margin-right:calc(var(--size-lg) * -1)}.-mx-md{margin-left:calc(var(--size-md) * -1);margin-right:calc(var(--size-md) * -1)}.-mx-pageHorizontalPadding{margin-left:calc(var(--page-horizontal-padding) * -1);margin-right:calc(var(--page-horizontal-padding) * -1)}.-mx-sm{margin-left:calc(var(--size-sm) * -1);margin-right:calc(var(--size-sm) * -1)}.-mx-xs{margin-left:calc(var(--size-xs) * -1);margin-right:calc(var(--size-xs) * -1)}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.-my-md{margin-top:calc(var(--size-md) * -1);margin-bottom:calc(var(--size-md) * -1)}.-my-sm{margin-top:calc(var(--size-sm) * -1);margin-bottom:calc(var(--size-sm) * -1)}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-\[-12px\]{margin-left:-12px;margin-right:-12px}.mx-\[-5\%\]{margin-left:-5%;margin-right:-5%}.mx-auto{margin-left:auto;margin-right:auto}.mx-lg{margin-left:var(--size-lg);margin-right:var(--size-lg)}.mx-md{margin-left:var(--size-md);margin-right:var(--size-md)}.mx-sm{margin-left:var(--size-sm);margin-right:var(--size-sm)}.mx-xs{margin-left:var(--size-xs);margin-right:var(--size-xs)}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.my-\[12px\]{margin-top:12px;margin-bottom:12px}.my-\[1em\]{margin-top:1em;margin-bottom:1em}.my-\[8px\]{margin-top:8px;margin-bottom:8px}.my-md{margin-top:var(--size-md);margin-bottom:var(--size-md)}.my-sm{margin-top:var(--size-sm);margin-bottom:var(--size-sm)}.my-xl{margin-top:var(--size-xl);margin-bottom:var(--size-xl)}.my-xs{margin-top:var(--size-xs);margin-bottom:var(--size-xs)}.\!-ml-md{margin-left:calc(var(--size-md) * -1)!important}.\!-mt-1{margin-top:-.25rem!important}.\!-mt-\[2px\]{margin-top:-2px!important}.\!-mt-md{margin-top:calc(var(--size-md) * -1)!important}.\!mb-0{margin-bottom:0!important}.\!ml-0{margin-left:0!important}.\!mt-0{margin-top:0!important}.\!mt-md{margin-top:var(--size-md)!important}.\!mt-px{margin-top:1px!important}.-mb-0{margin-bottom:-0px}.-mb-0\.5{margin-bottom:-.125rem}.-mb-1{margin-bottom:-.25rem}.-mb-4{margin-bottom:-1rem}.-mb-lg{margin-bottom:calc(var(--size-lg) * -1)}.-mb-md{margin-bottom:calc(var(--size-md) * -1)}.-mb-px{margin-bottom:-1px}.-mb-sm{margin-bottom:calc(var(--size-sm) * -1)}.-mb-two{margin-bottom:-2px}.-mb-xl{margin-bottom:calc(var(--size-xl) * -1)}.-mb-xs{margin-bottom:calc(var(--size-xs) * -1)}.-me-xs{margin-inline-end:calc(var(--size-xs) * -1)}.-ml-1{margin-left:-.25rem}.-ml-3{margin-left:-.75rem}.-ml-4{margin-left:-1rem}.-ml-\[10px\]{margin-left:-10px}.-ml-\[16px\]{margin-left:-16px}.-ml-\[5px\]{margin-left:-5px}.-ml-px{margin-left:-1px}.-ml-sm{margin-left:calc(var(--size-sm) * -1)}.-ml-two{margin-left:-2px}.-ml-xs{margin-left:calc(var(--size-xs) * -1)}.-mr-0{margin-right:-0px}.-mr-0\.5{margin-right:-.125rem}.-mr-1{margin-right:-.25rem}.-mr-1\.5{margin-right:-.375rem}.-mr-2{margin-right:-.5rem}.-mr-5{margin-right:-1.25rem}.-mr-\[0\.5px\]{margin-right:-.5px}.-mr-md{margin-right:calc(var(--size-md) * -1)}.-mr-sm{margin-right:calc(var(--size-sm) * -1)}.-mr-two{margin-right:-2px}.-mr-xs{margin-right:calc(var(--size-xs) * -1)}.-mt-0{margin-top:-0px}.-mt-0\.5{margin-top:-.125rem}.-mt-1{margin-top:-.25rem}.-mt-1\.5{margin-top:-.375rem}.-mt-10{margin-top:-2.5rem}.-mt-2{margin-top:-.5rem}.-mt-4{margin-top:-1rem}.-mt-lg{margin-top:calc(var(--size-lg) * -1)}.-mt-md{margin-top:calc(var(--size-md) * -1)}.-mt-one,.-mt-px{margin-top:-1px}.-mt-sm{margin-top:calc(var(--size-sm) * -1)}.-mt-three{margin-top:-3px}.-mt-two{margin-top:-2px}.-mt-xl{margin-top:calc(var(--size-xl) * -1)}.-mt-xs{margin-top:calc(var(--size-xs) * -1)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-2xl{margin-bottom:96px}.mb-2xs{margin-bottom:var(--size-2xs)}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-\[-24px\]{margin-bottom:-24px}.mb-\[-2px\]{margin-bottom:-2px}.mb-\[-3px\]{margin-bottom:-3px}.mb-\[-4vh\]{margin-bottom:-4vh}.mb-\[-5px\]{margin-bottom:-5px}.mb-\[12px\]{margin-bottom:12px}.mb-\[20px\]{margin-bottom:20px}.mb-\[40px\]{margin-bottom:40px}.mb-\[calc\(var\(--mobile-nav-height\)\+2rem\)\]{margin-bottom:calc(var(--mobile-nav-height) + 2rem)}.mb-auto{margin-bottom:auto}.mb-lg{margin-bottom:var(--size-lg)}.mb-md{margin-bottom:var(--size-md)}.mb-ml{margin-bottom:var(--size-ml)}.mb-px{margin-bottom:1px}.mb-safeAreaInsetBottom{margin-bottom:var(--safe-area-inset-bottom)}.mb-sm{margin-bottom:var(--size-sm)}.mb-two{margin-bottom:2px}.mb-xl{margin-bottom:var(--size-xl)}.mb-xs{margin-bottom:var(--size-xs)}.ml-0{margin-left:0}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-2xs{margin-left:var(--size-2xs)}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-7{margin-left:1.75rem}.ml-8{margin-left:2rem}.ml-\[-12px\]{margin-left:-12px}.ml-\[26px\]{margin-left:26px}.ml-\[28px\]{margin-left:28px}.ml-auto{margin-left:auto}.ml-collapsedSideBarWidth{margin-left:var(--sidebar-width-collapsed)}.ml-lg{margin-left:var(--size-lg)}.ml-md{margin-left:var(--size-md)}.ml-one,.ml-px{margin-left:1px}.ml-sideBarWidth{margin-left:var(--sidebar-width)}.ml-sm{margin-left:var(--size-sm)}.ml-xl{margin-left:var(--size-xl)}.ml-xs{margin-left:var(--size-xs)}.mr-0{margin-right:0}.mr-0\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-\[-18px\]{margin-right:-18px}.mr-\[2px\]{margin-right:2px}.mr-auto{margin-right:auto}.mr-lg{margin-right:var(--size-lg)}.mr-md{margin-right:var(--size-md)}.mr-px{margin-right:1px}.mr-sm{margin-right:var(--size-sm)}.mr-xs{margin-right:var(--size-xs)}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-2xs{margin-top:var(--size-2xs)}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\[-10px\]{margin-top:-10px}.mt-\[-12px\]{margin-top:-12px}.mt-\[-24px\]{margin-top:-24px}.mt-\[-4\.5rem\]{margin-top:-4.5rem}.mt-\[-5px\]{margin-top:-5px}.mt-\[-6px\]{margin-top:-6px}.mt-\[\.\.\.\]{margin-top:...}.mt-\[13px\]{margin-top:13px}.mt-\[5px\]{margin-top:5px}.mt-\[6px\]{margin-top:6px}.mt-auto{margin-top:auto}.mt-headerHeight{margin-top:var(--header-height)}.mt-inAppHeaderHeight{margin-top:var(--in-app-header-height)}.mt-lg{margin-top:var(--size-lg)}.mt-md{margin-top:var(--size-md)}.mt-ml{margin-top:var(--size-ml)}.mt-one,.mt-px{margin-top:1px}.mt-sm{margin-top:var(--size-sm)}.mt-three{margin-top:3px}.mt-two{margin-top:2px}.mt-xl{margin-top:var(--size-xl)}.mt-xs{margin-top:var(--size-xs)}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.\!line-clamp-2{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.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}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.line-clamp-5{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5}.line-clamp-6{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6}.line-clamp-\[20\]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:20}.line-clamp-\[8\]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:8}.line-clamp-none{overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.\!grid{display:grid!important}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.\!hidden{display:none!important}.hidden{display:none}.\!aspect-\[16\/9\]{aspect-ratio:16/9!important}.\!aspect-square{aspect-ratio:1 / 1!important}.aspect-\[1\.2\/1\]{aspect-ratio:1.2/1}.aspect-\[1\/1\]{aspect-ratio:1/1}.aspect-\[1024\/1536\]{aspect-ratio:1024/1536}.aspect-\[1036\/1536\]{aspect-ratio:1036/1536}.aspect-\[11\/6\]{aspect-ratio:11/6}.aspect-\[1200\/800\]{aspect-ratio:1200/800}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-\[176\/225\]{aspect-ratio:176/225}.aspect-\[187\/155\]{aspect-ratio:187/155}.aspect-\[252\/336\]{aspect-ratio:252/336}.aspect-\[3\/2\]{aspect-ratio:3/2}.aspect-\[304\/120\]{aspect-ratio:304/120}.aspect-\[4\/3\]{aspect-ratio:4/3}.aspect-\[4\/6\]{aspect-ratio:4/6}.aspect-\[9\/8\]{aspect-ratio:9/8}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.\!size-10{width:2.5rem!important;height:2.5rem!important}.\!size-12{width:3rem!important;height:3rem!important}.\!size-4{width:1rem!important;height:1rem!important}.\!size-7{width:1.75rem!important;height:1.75rem!important}.\!size-8{width:2rem!important;height:2rem!important}.\!size-\[40px\]{width:40px!important;height:40px!important}.\!size-\[60px\]{width:60px!important;height:60px!important}.size-0{width:0px;height:0px}.size-0\.5{width:.125rem;height:.125rem}.size-1{width:.25rem;height:.25rem}.size-1\.5{width:.375rem;height:.375rem}.size-1\/2{width:50%;height:50%}.size-10{width:2.5rem;height:2.5rem}.size-11{width:2.75rem;height:2.75rem}.size-12{width:3rem;height:3rem}.size-14{width:3.5rem;height:3.5rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-20{width:5rem;height:5rem}.size-24{width:6rem;height:6rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-32{width:8rem;height:8rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-\[1\.2em\]{width:1.2em;height:1.2em}.size-\[118px\]{width:118px;height:118px}.size-\[120\%\]{width:120%;height:120%}.size-\[120px\]{width:120px;height:120px}.size-\[12px\]{width:12px;height:12px}.size-\[140\%\]{width:140%;height:140%}.size-\[14px\]{width:14px;height:14px}.size-\[16px\]{width:16px;height:16px}.size-\[180\%\]{width:180%;height:180%}.size-\[18px\]{width:18px;height:18px}.size-\[1lh\]{width:1lh;height:1lh}.size-\[20px\]{width:20px;height:20px}.size-\[220\%\]{width:220%;height:220%}.size-\[24px\]{width:24px;height:24px}.size-\[30px\]{width:30px;height:30px}.size-\[32px\]{width:32px;height:32px}.size-\[36px\]{width:36px;height:36px}.size-\[40px\]{width:40px;height:40px}.size-\[44px\]{width:44px;height:44px}.size-\[45vw\]{width:45vw;height:45vw}.size-\[4px\]{width:4px;height:4px}.size-\[50px\]{width:50px;height:50px}.size-\[5px\]{width:5px;height:5px}.size-\[60px\]{width:60px;height:60px}.size-\[64px\]{width:64px;height:64px}.size-\[65\%\]{width:65%;height:65%}.size-\[6px\]{width:6px;height:6px}.size-\[72px\]{width:72px;height:72px}.size-\[7px\]{width:7px;height:7px}.size-\[88px\]{width:88px;height:88px}.size-\[var\(--image-size\)\]{width:var(--image-size);height:var(--image-size)}.size-full{width:100%;height:100%}.size-lg{width:var(--size-lg);height:var(--size-lg)}.size-md{width:var(--size-md);height:var(--size-md)}.size-sm{width:var(--size-sm);height:var(--size-sm)}.size-xl{width:var(--size-xl);height:var(--size-xl)}.size-xs{width:var(--size-xs);height:var(--size-xs)}.\!h-0{height:0px!important}.\!h-10{height:2.5rem!important}.\!h-11{height:2.75rem!important}.\!h-7{height:1.75rem!important}.\!h-9{height:2.25rem!important}.\!h-\[10px\]{height:10px!important}.\!h-\[150px\]{height:150px!important}.\!h-\[20px\]{height:20px!important}.\!h-\[2lh\]{height:2lh!important}.\!h-\[32px\]{height:32px!important}.\!h-\[5px\]{height:5px!important}.\!h-auto{height:auto!important}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-1\/2{height:50%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-2xs{height:var(--size-2xs)}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[0\.88rem\]{height:.88rem}.h-\[100dvh\]{height:100dvh}.h-\[100px\]{height:100px}.h-\[10vh\]{height:10vh}.h-\[110\%\]{height:110%}.h-\[120\%\]{height:120%}.h-\[120px\]{height:120px}.h-\[124px\]{height:124px}.h-\[12px\]{height:12px}.h-\[132px\]{height:132px}.h-\[136px\]{height:136px}.h-\[13px\]{height:13px}.h-\[140px\]{height:140px}.h-\[144px\]{height:144px}.h-\[14px\]{height:14px}.h-\[150px\]{height:150px}.h-\[160px\]{height:160px}.h-\[16px\]{height:16px}.h-\[170px\]{height:170px}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[198px\]{height:198px}.h-\[19px\]{height:19px}.h-\[1em\]{height:1em}.h-\[1lh\]{height:1lh}.h-\[200px\]{height:200px}.h-\[20px\]{height:20px}.h-\[20vw\]{height:20vw}.h-\[22px\]{height:22px}.h-\[240px\]{height:240px}.h-\[242px\]{height:242px}.h-\[24px\]{height:24px}.h-\[250px\]{height:250px}.h-\[260px\]{height:260px}.h-\[26px\]{height:26px}.h-\[27px\]{height:27px}.h-\[300px\]{height:300px}.h-\[30vh\]{height:30vh}.h-\[327px\]{height:327px}.h-\[32px\]{height:32px}.h-\[340px\]{height:340px}.h-\[34px\]{height:34px}.h-\[350px\]{height:350px}.h-\[36px\]{height:36px}.h-\[3px\]{height:3px}.h-\[4\.5rem\]{height:4.5rem}.h-\[400px\]{height:400px}.h-\[40px\]{height:40px}.h-\[42px\]{height:42px}.h-\[44px\]{height:44px}.h-\[480px\]{height:480px}.h-\[48px\]{height:48px}.h-\[500px\]{height:500px}.h-\[50dvh\]{height:50dvh}.h-\[50vh\]{height:50vh}.h-\[52px\]{height:52px}.h-\[54px\]{height:54px}.h-\[560px\]{height:560px}.h-\[56px\]{height:56px}.h-\[600px\]{height:600px}.h-\[60vh\]{height:60vh}.h-\[640px\]{height:640px}.h-\[64px\]{height:64px}.h-\[68px\]{height:68px}.h-\[70\%\]{height:70%}.h-\[72px\]{height:72px}.h-\[90dvh\]{height:90dvh}.h-\[95vh\]{height:95vh}.h-\[calc\(100\%\+16px\)\]{height:calc(100% + 16px)}.h-\[calc\(100vh-var\(--header-height\)-120px\)\]{height:calc(100vh - var(--header-height) - 120px)}.h-\[var\(--map-height\)\]{height:var(--map-height)}.h-auto{height:auto}.h-bannerHeight{height:var(--banner-height)}.h-dvh{height:100dvh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-headerHeight{height:var(--header-height)}.h-inAppHeaderHeight{height:var(--in-app-header-height)}.h-lg{height:var(--size-lg)}.h-md{height:var(--size-md)}.h-one{height:1px}.h-pageContentHeight{height:var(--page-content-height)}.h-px{height:1px}.h-screen{height:100vh}.h-sm{height:var(--size-sm)}.h-two{height:2px}.h-xl{height:var(--size-xl)}.h-xs{height:var(--size-xs)}.\!max-h-\[27vh\]{max-height:27vh!important}.\!max-h-\[640px\]{max-height:640px!important}.\!max-h-full{max-height:100%!important}.max-h-20{max-height:5rem}.max-h-40{max-height:10rem}.max-h-44{max-height:11rem}.max-h-5{max-height:1.25rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[100\%\]{max-height:100%}.max-h-\[100vh\]{max-height:100vh}.max-h-\[120px\]{max-height:120px}.max-h-\[160px\]{max-height:160px}.max-h-\[175px\]{max-height:175px}.max-h-\[190px\]{max-height:190px}.max-h-\[200px\]{max-height:200px}.max-h-\[220px\]{max-height:220px}.max-h-\[240px\]{max-height:240px}.max-h-\[280px\]{max-height:280px}.max-h-\[300px\]{max-height:300px}.max-h-\[330px\]{max-height:330px}.max-h-\[37vh\]{max-height:37vh}.max-h-\[38vh\]{max-height:38vh}.max-h-\[400px\]{max-height:400px}.max-h-\[40vh\]{max-height:40vh}.max-h-\[42vh\]{max-height:42vh}.max-h-\[450px\]{max-height:450px}.max-h-\[45vh\]{max-height:45vh}.max-h-\[500px\]{max-height:500px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[555x\]{max-height:555x}.max-h-\[600px\]{max-height:600px}.max-h-\[65px\]{max-height:65px}.max-h-\[65vh\]{max-height:65vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[76px\]{max-height:76px}.max-h-\[800px\]{max-height:800px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90dvh\]{max-height:90dvh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[96dvh\]{max-height:96dvh}.max-h-\[inherit\]{max-height:inherit}.max-h-full{max-height:100%}.max-h-lg{max-height:var(--size-lg)}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.\!min-h-0{min-height:0px!important}.\!min-h-fit{min-height:-moz-fit-content!important;min-height:fit-content!important}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-12{min-height:3rem}.min-h-16{min-height:4rem}.min-h-20{min-height:5rem}.min-h-24{min-height:6rem}.min-h-32{min-height:8rem}.min-h-40{min-height:10rem}.min-h-60{min-height:15rem}.min-h-8{min-height:2rem}.min-h-\[100\%\]{min-height:100%}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[125px\]{min-height:125px}.min-h-\[128px\]{min-height:128px}.min-h-\[142px\]{min-height:142px}.min-h-\[16px\]{min-height:16px}.min-h-\[180px\]{min-height:180px}.min-h-\[200px\]{min-height:200px}.min-h-\[20px\]{min-height:20px}.min-h-\[230px\]{min-height:230px}.min-h-\[24px\]{min-height:24px}.min-h-\[250px\]{min-height:250px}.min-h-\[280px\]{min-height:280px}.min-h-\[340px\]{min-height:340px}.min-h-\[40px\]{min-height:40px}.min-h-\[50px\]{min-height:50px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[520px\]{min-height:520px}.min-h-\[555px\]{min-height:555px}.min-h-\[58px\]{min-height:58px}.min-h-\[600px\]{min-height:600px}.min-h-\[60dvh\]{min-height:60dvh}.min-h-\[60px\]{min-height:60px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[75vh\]{min-height:75vh}.min-h-\[80px\]{min-height:80px}.min-h-\[calc\(100dvh-70px\)\]{min-height:calc(100dvh - 70px)}.min-h-\[calc\(100vh-200px\)\]{min-height:calc(100vh - 200px)}.min-h-\[calc\(100vh-262px\)\]{min-height:calc(100vh - 262px)}.min-h-\[calc\(100vh-68px\)\]{min-height:calc(100vh - 68px)}.min-h-\[unset\]{min-height:unset}.min-h-\[var\(--mobile-content-height\)\]{min-height:var(--mobile-content-height)}.min-h-\[var\(--page-content-height\)\]{min-height:var(--page-content-height)}.min-h-full{min-height:100%}.min-h-minTouchTarget{min-height:var(--min-touch-target)}.min-h-pageContentHeight{min-height:var(--page-content-height)}.min-h-screen{min-height:100vh}.\!w-10{width:2.5rem!important}.\!w-16{width:4rem!important}.\!w-4{width:1rem!important}.\!w-7{width:1.75rem!important}.\!w-\[100px\]{width:100px!important}.\!w-\[140px\]{width:140px!important}.\!w-\[16px\]{width:16px!important}.\!w-\[200px\]{width:200px!important}.\!w-\[240px\]{width:240px!important}.\!w-\[24px\]{width:24px!important}.\!w-\[25vw\]{width:25vw!important}.\!w-\[416px\]{width:416px!important}.\!w-\[500px\]{width:500px!important}.\!w-\[5px\]{width:5px!important}.\!w-\[80px\]{width:80px!important}.\!w-auto{width:auto!important}.\!w-full{width:100%!important}.\!w-screen{width:100vw!important}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/12{width:8.333333%}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-1\/5{width:20%}.w-10{width:2.5rem}.w-10\/12{width:83.333333%}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\/12{width:16.666667%}.w-2\/3{width:66.666667%}.w-2\/4{width:50%}.w-2\/5{width:40%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/12{width:25%}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-56{width:14rem}.w-6{width:1.5rem}.w-6\/12{width:50%}.w-60{width:15rem}.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-9\/12{width:75%}.w-96{width:24rem}.w-\[0\.88rem\]{width:.88rem}.w-\[1\.2em\]{width:1.2em}.w-\[1\.5px\]{width:1.5px}.w-\[1\/2\]{width:1/2}.w-\[10\%\]{width:10%}.w-\[100px\]{width:100px}.w-\[100vw\]{width:100vw}.w-\[110\%\]{width:110%}.w-\[12\.5\%\]{width:12.5%}.w-\[120\%\]{width:120%}.w-\[120px\]{width:120px}.w-\[120vw\]{width:120vw}.w-\[12px\]{width:12px}.w-\[134px\]{width:134px}.w-\[140px\]{width:140px}.w-\[144px\]{width:144px}.w-\[14px\]{width:14px}.w-\[15\%\]{width:15%}.w-\[150px\]{width:150px}.w-\[150vw\]{width:150vw}.w-\[15px\]{width:15px}.w-\[166px\]{width:166px}.w-\[170px\]{width:170px}.w-\[175px\]{width:175px}.w-\[17px\]{width:17px}.w-\[180px\]{width:180px}.w-\[18px\]{width:18px}.w-\[18vw\]{width:18vw}.w-\[2\.5px\]{width:2.5px}.w-\[200px\]{width:200px}.w-\[216px\]{width:216px}.w-\[220px\]{width:220px}.w-\[224px\]{width:224px}.w-\[225px\]{width:225px}.w-\[240px\]{width:240px}.w-\[24px\]{width:24px}.w-\[250px\]{width:250px}.w-\[27px\]{width:27px}.w-\[282px\]{width:282px}.w-\[28px\]{width:28px}.w-\[2ch\]{width:2ch}.w-\[30\%\]{width:30%}.w-\[300px\]{width:300px}.w-\[30vw\]{width:30vw}.w-\[320px\]{width:320px}.w-\[324px\]{width:324px}.w-\[32px\]{width:32px}.w-\[33\%\]{width:33%}.w-\[340px\]{width:340px}.w-\[360px\]{width:360px}.w-\[3ch\]{width:3ch}.w-\[3px\]{width:3px}.w-\[400px\]{width:400px}.w-\[40px\]{width:40px}.w-\[40vw\]{width:40vw}.w-\[45\%\]{width:45%}.w-\[4px\]{width:4px}.w-\[500px\]{width:500px}.w-\[54\%\]{width:54%}.w-\[60\%\]{width:60%}.w-\[600px\]{width:600px}.w-\[60px\]{width:60px}.w-\[60vw\]{width:60vw}.w-\[62\%\]{width:62%}.w-\[62px\]{width:62px}.w-\[66\%\]{width:66%}.w-\[70\%\]{width:70%}.w-\[70px\]{width:70px}.w-\[70vw\]{width:70vw}.w-\[72px\]{width:72px}.w-\[76px\]{width:76px}.w-\[8\%\]{width:8%}.w-\[80px\]{width:80px}.w-\[80vw\]{width:80vw}.w-\[90\%\]{width:90%}.w-\[90dvw\]{width:90dvw}.w-\[90vw\]{width:90vw}.w-\[95vw\]{width:95vw}.w-\[calc\(\(100\%\*2\/3\)\/3\)\]{width:calc((100% * 2 / 3) / 3)}.w-\[calc\(\(100\%\*2\/3\)\/4\)\]{width:calc((100% * 2 / 3) / 4)}.w-\[calc\(100dvw-\(2\*var\(--size-md\)\)\)\]{width:calc(100dvw - (2 * var(--size-md)))}.w-\[calc\(80\%-1\.6px\)\]{width:calc(80% - 1.6px)}.w-\[var\(--constrained-card-width\)\]{width:var(--constrained-card-width)}.w-auto{width:auto}.w-collapsedSideBarWidth{width:var(--sidebar-width-collapsed)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-lg{width:var(--size-lg)}.w-max{width:-moz-max-content;width:max-content}.w-md{width:var(--size-md)}.w-px{width:1px}.w-screen{width:100vw}.w-sideBarWidth{width:var(--sidebar-width)}.w-sm{width:var(--size-sm)}.w-three{width:3px}.w-two{width:2px}.w-xl{width:var(--size-xl)}.w-xs{width:var(--size-xs)}.\!min-w-0{min-width:0px!important}.\!min-w-\[120px\]{min-width:120px!important}.\!min-w-\[180px\]{min-width:180px!important}.\!min-w-\[365px\]{min-width:365px!important}.\!min-w-\[416px\]{min-width:416px!important}.\!min-w-\[500px\]{min-width:500px!important}.\!min-w-md{min-width:var(--size-md)!important}.min-w-0{min-width:0px}.min-w-14{min-width:3.5rem}.min-w-24{min-width:6rem}.min-w-3{min-width:.75rem}.min-w-3\.5{min-width:.875rem}.min-w-4{min-width:1rem}.min-w-40{min-width:10rem}.min-w-48{min-width:12rem}.min-w-5{min-width:1.25rem}.min-w-56{min-width:14rem}.min-w-6{min-width:1.5rem}.min-w-9{min-width:2.25rem}.min-w-\[100\%\]{min-width:100%}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[140px\]{min-width:140px}.min-w-\[1443px\]{min-width:1443px}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\]{min-width:160px}.min-w-\[165px\]{min-width:165px}.min-w-\[200px\]{min-width:200px}.min-w-\[220px\]{min-width:220px}.min-w-\[25\%\]{min-width:25%}.min-w-\[250px\]{min-width:250px}.min-w-\[280px\]{min-width:280px}.min-w-\[2ch\]{min-width:2ch}.min-w-\[32px\]{min-width:32px}.min-w-\[400px\]{min-width:400px}.min-w-\[420px\]{min-width:420px}.min-w-\[48px\]{min-width:48px}.min-w-\[500px\]{min-width:500px}.min-w-\[56px\]{min-width:56px}.min-w-\[58px\]{min-width:58px}.min-w-\[64px\]{min-width:64px}.min-w-\[80px\]{min-width:80px}.min-w-\[calc\(var\(--radix-dropdown-menu-trigger-width\)-theme\(spacing\.sm\)\)\]{min-width:calc(var(--radix-dropdown-menu-trigger-width) - var(--size-sm))}.min-w-\[var\(--radix-hover-card-trigger-width\)\]{min-width:var(--radix-hover-card-trigger-width)}.min-w-\[var\(--radix-popover-trigger-width\)\]{min-width:var(--radix-popover-trigger-width)}.min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.min-w-full{min-width:100%}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-md{min-width:var(--size-md)}.\!max-w-2xl{max-width:42rem!important}.\!max-w-\[416px\]{max-width:416px!important}.\!max-w-\[500px\]{max-width:500px!important}.\!max-w-\[520px\]{max-width:520px!important}.\!max-w-md{max-width:28rem!important}.\!max-w-none{max-width:none!important}.\!max-w-sm{max-width:24rem!important}.max-w-0{max-width:0px}.max-w-10{max-width:2.5rem}.max-w-12{max-width:3rem}.max-w-14{max-width:3.5rem}.max-w-20{max-width:5rem}.max-w-24{max-width:6rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-44{max-width:11rem}.max-w-48{max-width:12rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-60{max-width:15rem}.max-w-64{max-width:16rem}.max-w-6xl{max-width:72rem}.max-w-\[100px\]{max-width:100px}.max-w-\[100vw\]{max-width:100vw}.max-w-\[120px\]{max-width:120px}.max-w-\[150px\]{max-width:150px}.max-w-\[15vw\]{max-width:15vw}.max-w-\[160px\]{max-width:160px}.max-w-\[168px\]{max-width:168px}.max-w-\[200px\]{max-width:200px}.max-w-\[208px\]{max-width:208px}.max-w-\[220px\]{max-width:220px}.max-w-\[250px\]{max-width:250px}.max-w-\[25ch\]{max-width:25ch}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[30vw\]{max-width:30vw}.max-w-\[320px\]{max-width:320px}.max-w-\[324px\]{max-width:324px}.max-w-\[328px\]{max-width:328px}.max-w-\[340px\]{max-width:340px}.max-w-\[350px\]{max-width:350px}.max-w-\[375px\]{max-width:375px}.max-w-\[400px\]{max-width:400px}.max-w-\[40px\]{max-width:40px}.max-w-\[448px\]{max-width:448px}.max-w-\[5\.6rem\]{max-width:5.6rem}.max-w-\[50vw\]{max-width:50vw}.max-w-\[540px\]{max-width:540px}.max-w-\[600px\]{max-width:600px}.max-w-\[672px\]{max-width:672px}.max-w-\[80px\]{max-width:80px}.max-w-\[900px\]{max-width:900px}.max-w-\[90dvw\]{max-width:90dvw}.max-w-\[98px\]{max-width:98px}.max-w-\[calc\(\(100vh-360px\)\/1\.5\)\]{max-width:calc((100vh - 360px) / 1.5)}.max-w-\[calc\(100vh-360px\)\]{max-width:calc(100vh - 360px)}.max-w-\[unset\]{max-width:unset}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-screen-lg{max-width:1024px}.max-w-screen-md{max-width:768px}.max-w-screen-sm{max-width:640px}.max-w-screen-xl{max-width:1280px}.max-w-sideBarWidthXL{max-width:260px}.max-w-sm{max-width:24rem}.max-w-threadContentWidth{max-width:var(--thread-content-width)}.max-w-threadWidth{max-width:var(--thread-width)}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.\!flex-1{flex:1 1 0%!important}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.\!grow{flex-grow:1!important}.grow{flex-grow:1}.grow-0{flex-grow:0}.\!basis-\[90\%\]{flex-basis:90%!important}.\!basis-full{flex-basis:100%!important}.basis-0{flex-basis:0px}.basis-1\/2{flex-basis:50%}.basis-1\/4{flex-basis:25%}.basis-2\/5{flex-basis:40%}.basis-3\/5{flex-basis:60%}.basis-full{flex-basis:100%}.table-auto{table-layout:auto}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x: 0px;--tw-border-spacing-y: 0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.border-spacing-sm{--tw-border-spacing-x: var(--size-sm);--tw-border-spacing-y: var(--size-sm);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.origin-\[var\(--radix-dropdown-menu-content-transform-origin\)\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-bottom-left{transform-origin:bottom left}.origin-center{transform-origin:center}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.\!translate-y-\[0px\]{--tw-translate-y: 0px !important;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))!important}.-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-1\/3{--tw-translate-x: -33.333333%;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-\[10\%\]{--tw-translate-x: -10%;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-\[5\%\]{--tw-translate-x: -5%;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-full{--tw-translate-x: -100%;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-md{--tw-translate-x: calc(var(--size-md) * -1);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-x-sm{--tw-translate-x: calc(var(--size-sm) * -1);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-three{--tw-translate-x: -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))}.-translate-x-two{--tw-translate-x: -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))}.-translate-x-xs{--tw-translate-x: calc(var(--size-xs) * -1);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-0{--tw-translate-y: -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))}.-translate-y-0\.5{--tw-translate-y: -.125rem;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{--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))}.-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-y-1\/3{--tw-translate-y: -33.333333%;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\/4{--tw-translate-y: -25%;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-\[10\%\]{--tw-translate-y: -10%;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-\[5\%\]{--tw-translate-y: -5%;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-\[calc\(50\%-2px\)\]{--tw-translate-y: calc((50% - 2px)*-1) ;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-half{--tw-translate-y: -.5px;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-md{--tw-translate-y: calc(var(--size-md) * -1);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-px{--tw-translate-y: -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-sm{--tw-translate-y: calc(var(--size-sm) * -1);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-three{--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))}.-translate-y-two{--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))}.translate-x-1{--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))}.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-1\/3{--tw-translate-x: 33.333333%;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-1\/4{--tw-translate-x: 25%;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-2{--tw-translate-x: .5rem;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-\[-5px\]{--tw-translate-x: -5px;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-\[1px\]{--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-x-\[4px\]{--tw-translate-x: 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))}.translate-x-\[6px\]{--tw-translate-x: 6px;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-\[calc\(-100\%-var\(--size-xs\)\)\]{--tw-translate-x: calc(-100% - var(--size-xs));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-\[calc\(100\%\+2px\)\]{--tw-translate-x: calc(100% + 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))}.translate-x-\[calc\(100\%\+var\(--size-xs\)\)\]{--tw-translate-x: calc(100% + var(--size-xs));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-full{--tw-translate-x: 100%;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-md{--tw-translate-x: var(--size-md);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-x-two{--tw-translate-x: 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))}.translate-x-xs{--tw-translate-x: var(--size-xs);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-0{--tw-translate-y: 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))}.translate-y-0\.5{--tw-translate-y: .125rem;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{--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))}.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-y-1\/4{--tw-translate-y: 25%;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-2{--tw-translate-y: .5rem;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\.5px\]{--tw-translate-y: -1.5px;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-\[-12\.5\%\]{--tw-translate-y: -12.5%;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-\[-16\%\]{--tw-translate-y: -16%;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-\[-2px\]{--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))}.translate-y-\[0\.8px\]{--tw-translate-y: .8px;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\.5px\]{--tw-translate-y: 1.5px;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-\[1px\]{--tw-translate-y: 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-\[20px\]{--tw-translate-y: 20px;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-\[24px\]{--tw-translate-y: 24px;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-\[3px\]{--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))}.translate-y-\[60\%\]{--tw-translate-y: 60%;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-\[6px\]{--tw-translate-y: 6px;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-\[80\%\]{--tw-translate-y: 80%;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-full{--tw-translate-y: 100%;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-half{--tw-translate-y: .5px;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-px{--tw-translate-y: 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-three{--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))}.translate-y-two{--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))}.translate-y-xs{--tw-translate-y: var(--size-xs);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-0{--tw-rotate: 0deg;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-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))}.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))}.\!scale-100{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;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))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;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))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;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))}.scale-\[\.85\],.scale-\[0\.85\]{--tw-scale-x: .85;--tw-scale-y: .85;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))}.scale-\[0\.8\]{--tw-scale-x: .8;--tw-scale-y: .8;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))}.scale-\[0\.98\]{--tw-scale-x: .98;--tw-scale-y: .98;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))}.scale-\[0\.9\]{--tw-scale-x: .9;--tw-scale-y: .9;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))}.scale-\[99\%\]{--tw-scale-x: 99%;--tw-scale-y: 99%;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))}.scale-x-\[250\%\]{--tw-scale-x: 250%;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))}.transform-none{transform:none}@keyframes f1-track-dash{to{stroke-dashoffset:0px}}.animate-\[f1-track-dash_6s_ease_infinite\]{animation:f1-track-dash 6s ease infinite}.animate-\[ping_1\.5s_cubic-bezier\(0\,0\,0\.2\,1\)_infinite\]{animation:ping 1.5s cubic-bezier(0,0,.2,1) infinite}.animate-\[pulse_2\.5s_ease-in-out_infinite\]{animation:pulse 2.5s ease-in-out infinite}.animate-deepResearchIndicator{animation:indicator steps(48) infinite}@keyframes indeterminate{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(100%)}}.animate-indeterminate{animation:indeterminate 1.5s infinite cubic-bezier(.65,.815,.735,.395)}.animate-labsIndicator{animation:indicator steps(39) infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes indicator{0%{transform:translateZ(0) translate(0)}to{transform:translateZ(0) translate(-100%)}}.animate-pplxIndicator{animation:indicator steps(52) infinite}@keyframes pulse{50%{opacity:.4}0%,to{opacity:1}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-slideDownAndFadeIn{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes spin{to{transform:rotate(360deg)}0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}@keyframes underlineFade{0%{text-decoration-color:transparent}to{text-decoration-color:oklch(var(--foreground-color) / .2)}}.animate-underlineFade{animation:underlineFade 1s ease}.\!cursor-grab{cursor:grab!important}.\!cursor-grabbing{cursor:grabbing!important}.\!cursor-not-allowed{cursor:not-allowed!important}.\!cursor-pointer{cursor:pointer!important}.\!cursor-wait{cursor:wait!important}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-wait{cursor:wait}.cursor-zoom-in{cursor:zoom-in}.touch-none{touch-action:none}.touch-pan-down{--tw-pan-y: pan-down;touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-manipulation{touch-action:manipulation}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.scroll-mx-md{scroll-margin-left:var(--size-md);scroll-margin-right:var(--size-md)}.scroll-mb-9{scroll-margin-bottom:2.25rem}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.auto-cols-auto{grid-auto-columns:auto}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.auto-cols-max{grid-auto-columns:max-content}.grid-flow-row{grid-auto-flow:row}.grid-flow-col{grid-auto-flow:column}.auto-rows-fr{grid-auto-rows:minmax(0,1fr)}.\!grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,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-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.grid-cols-\[0\.5fr_1fr\]{grid-template-columns:.5fr 1fr}.grid-cols-\[128px_1fr_auto\]{grid-template-columns:128px 1fr auto}.grid-cols-\[1fr\,1fr\,1fr\]{grid-template-columns:1fr 1fr 1fr}.grid-cols-\[1fr\,1fr\]{grid-template-columns:1fr 1fr}.grid-cols-\[1fr\,auto\,1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[1fr\,auto\,auto\,auto\]{grid-template-columns:1fr auto auto auto}.grid-cols-\[1fr\,auto\,auto\]{grid-template-columns:1fr auto auto}.grid-cols-\[1fr\]{grid-template-columns:1fr}.grid-cols-\[1fr_1fr\]{grid-template-columns:1fr 1fr}.grid-cols-\[1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr}.grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[1fr_max-content\]{grid-template-columns:1fr max-content}.grid-cols-\[1fr_min-content_min-content\]{grid-template-columns:1fr min-content min-content}.grid-cols-\[26\.8\%_1fr\]{grid-template-columns:26.8% 1fr}.grid-cols-\[2fr\,1fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr 1fr}.grid-cols-\[2fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr}.grid-cols-\[2fr\,1fr\]{grid-template-columns:2fr 1fr}.grid-cols-\[3fr\,1fr\,1fr\,1fr\]{grid-template-columns:3fr 1fr 1fr 1fr}.grid-cols-\[3fr\,2fr\,2fr\]{grid-template-columns:3fr 2fr 2fr}.grid-cols-\[65\%\,35\%\]{grid-template-columns:65% 35%}.grid-cols-\[8fr_minmax\(300px\,3fr\)\]{grid-template-columns:8fr minmax(300px,3fr)}.grid-cols-\[auto\,1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto\,max-content\]{grid-template-columns:auto max-content}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_1fr_88px_88px_88px\]{grid-template-columns:auto 1fr 88px 88px 88px}.grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.grid-cols-\[auto_min-content\]{grid-template-columns:auto min-content}.grid-cols-\[max-content_1fr\]{grid-template-columns:max-content 1fr}.grid-cols-\[max-content_auto\]{grid-template-columns:max-content auto}.grid-cols-\[min-content\,1fr\,1fr\,min-content\]{grid-template-columns:min-content 1fr 1fr min-content}.grid-cols-\[min-content\,1fr\,max-content\,min-content\]{grid-template-columns:min-content 1fr max-content min-content}.grid-cols-\[min-content\,1fr\,min-content\]{grid-template-columns:min-content 1fr min-content}.grid-cols-\[min-content\,1fr\,minmax\(max-content\,1fr\)\,min-content\]{grid-template-columns:min-content 1fr minmax(max-content,1fr) min-content}.grid-cols-\[min-content_1fr_3fr\]{grid-template-columns:min-content 1fr 3fr}.grid-cols-\[minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_48px_64px_40px\]{grid-template-columns:minmax(0,1fr) 48px 64px 40px}.grid-cols-\[minmax\(0\,1fr\)_auto_56px\]{grid-template-columns:minmax(0,1fr) auto 56px}.grid-cols-\[minmax\(0\,1fr\)_min-content_min-content\]{grid-template-columns:minmax(0,1fr) min-content min-content}.grid-cols-\[repeat\(7\,1fr\)\]{grid-template-columns:repeat(7,1fr)}.grid-cols-\[repeat\(auto-fill\,_minmax\(280px\,_1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(160px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(180px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(220px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.grid-cols-subgrid{grid-template-columns:subgrid}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}.grid-rows-1fr-auto{grid-template-rows:1fr auto}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))}.grid-rows-4{grid-template-rows:repeat(4,minmax(0,1fr))}.grid-rows-\[0fr\]{grid-template-rows:0fr}.grid-rows-\[1fr\]{grid-template-rows:1fr}.grid-rows-\[min-content_1fr\]{grid-template-rows:min-content 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.\!flex-col{flex-direction:column!important}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.place-content-center{place-content:center}.place-content-between{place-content:space-between}.place-items-center{place-items:center}.content-center{align-content:center}.\!items-start{align-items:flex-start!important}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.\!justify-start{justify-content:flex-start!important}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.justify-stretch{justify-content:stretch}.justify-items-center{justify-items:center}.justify-items-stretch{justify-items:stretch}.\!gap-0{gap:0px!important}.\!gap-1{gap:.25rem!important}.\!gap-4{gap:1rem!important}.\!gap-sm{gap:var(--size-sm)!important}.\!gap-xs{gap:var(--size-xs)!important}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-2xl{gap:96px}.gap-2xs{gap:var(--size-2xs)}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[0\.1em\]{gap:.1em}.gap-\[0\.2em\]{gap:.2em}.gap-\[10px\]{gap:10px}.gap-\[11px\]{gap:11px}.gap-\[12px\]{gap:12px}.gap-\[20px\]{gap:20px}.gap-\[5px\]{gap:5px}.gap-\[6px\]{gap:6px}.gap-\[7px\]{gap:7px}.gap-lg{gap:var(--size-lg)}.gap-md{gap:var(--size-md)}.gap-px{gap:1px}.gap-sm{gap:var(--size-sm)}.gap-three{gap:3px}.gap-two{gap:2px}.gap-xl{gap:var(--size-xl)}.gap-xs{gap:var(--size-xs)}.\!gap-y-md{row-gap:var(--size-md)!important}.gap-x-0{-moz-column-gap:0px;column-gap:0px}.gap-x-0\.5{-moz-column-gap:.125rem;column-gap:.125rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-1\.5{-moz-column-gap:.375rem;column-gap:.375rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-2xl{-moz-column-gap:96px;column-gap:96px}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-x-\[12px\]{-moz-column-gap:12px;column-gap:12px}.gap-x-lg{-moz-column-gap:var(--size-lg);column-gap:var(--size-lg)}.gap-x-md{-moz-column-gap:var(--size-md);column-gap:var(--size-md)}.gap-x-sm{-moz-column-gap:var(--size-sm);column-gap:var(--size-sm)}.gap-x-two{-moz-column-gap:2px;column-gap:2px}.gap-x-xl{-moz-column-gap:var(--size-xl);column-gap:var(--size-xl)}.gap-x-xs{-moz-column-gap:var(--size-xs);column-gap:var(--size-xs)}.gap-y-0{row-gap:0px}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-12{row-gap:3rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.gap-y-4{row-gap:1rem}.gap-y-6{row-gap:1.5rem}.gap-y-\[20px\]{row-gap:20px}.gap-y-\[40px\]{row-gap:40px}.gap-y-lg{row-gap:var(--size-lg)}.gap-y-md{row-gap:var(--size-md)}.gap-y-sm{row-gap:var(--size-sm)}.gap-y-xs{row-gap:var(--size-xs)}.-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-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-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-sm>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(var(--size-sm) * var(--tw-space-x-reverse));margin-left:calc(var(--size-sm) * calc(1 - var(--tw-space-x-reverse)))}.space-x-two>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2px * var(--tw-space-x-reverse));margin-left:calc(2px * calc(1 - var(--tw-space-x-reverse)))}.space-x-xs>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(var(--size-xs) * var(--tw-space-x-reverse));margin-left:calc(var(--size-xs) * calc(1 - var(--tw-space-x-reverse)))}.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))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-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-20>: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-2xs>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-2xs) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-2xs) * 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))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.space-y-lg>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-lg) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-lg) * var(--tw-space-y-reverse))}.space-y-md>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-md) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-md) * var(--tw-space-y-reverse))}.space-y-ml>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-ml) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-ml) * var(--tw-space-y-reverse))}.space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.space-y-sm>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-sm) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-sm) * var(--tw-space-y-reverse))}.space-y-xs>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-xs) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-xs) * var(--tw-space-y-reverse))}.\!divide-y-0>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(0px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(0px * var(--tw-divide-y-reverse))!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#e5e7eb\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.divide-\[\#f3f4f6\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-subtle>:not([hidden])~:not([hidden]){border-color:oklch(var(--foreground-subtle-color))}.divide-subtlest>:not([hidden])~:not([hidden]){border-color:oklch(var(--foreground-subtlest-color))}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.self-stretch{align-self:stretch}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-stretch{justify-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.\!overflow-clip{overflow:clip!important}.overflow-clip{overflow:clip}.\!overflow-visible{overflow:visible!important}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-x-clip{overflow-x:clip}.overflow-x-visible{overflow-x:visible}.\!overflow-x-scroll{overflow-x:scroll!important}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.text-clip{text-overflow:clip}.hyphens-auto{-webkit-hyphens:auto;hyphens:auto}.whitespace-normal{white-space:normal}.\!whitespace-nowrap{white-space:nowrap!important}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-wrap{text-wrap:wrap!important}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.text-balance{text-wrap:balance}.text-pretty{text-wrap:pretty}.break-normal{overflow-wrap:normal;word-break:normal}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-2xl{border-radius:1rem!important}.\!rounded-3xl{border-radius:1.25rem!important}.\!rounded-\[14px\]{border-radius:14px!important}.\!rounded-\[4px\]{border-radius:4px!important}.\!rounded-full{border-radius:9999px!important}.\!rounded-lg{border-radius:.5rem!important}.\!rounded-md{border-radius:.375rem!important}.\!rounded-none{border-radius:0!important}.\!rounded-sm{border-radius:.125rem!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.25rem}.rounded-\[0\.3125rem\]{border-radius:.3125rem}.rounded-\[100\%\]{border-radius:100%}.rounded-\[10px\]{border-radius:10px}.rounded-\[116px\]{border-radius:116px}.rounded-\[122px\]{border-radius:122px}.rounded-\[12px\]{border-radius:12px}.rounded-\[13px\]{border-radius:13px}.rounded-\[16px\]{border-radius:16px}.rounded-\[1px\]{border-radius:1px}.rounded-\[20px\]{border-radius:20px}.rounded-\[37px\]{border-radius:37px}.rounded-\[4px\]{border-radius:4px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[52px\]{border-radius:52px}.rounded-\[54px\]{border-radius:54px}.rounded-\[6px\]{border-radius:6px}.rounded-badge{border-radius:.3125rem}.rounded-full{border-radius:9999px}.rounded-inherit{border-radius:inherit}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.\!rounded-b-none{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-b-\[20px\]{border-bottom-right-radius:20px;border-bottom-left-radius:20px}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-sm{border-bottom-right-radius:.125rem;border-bottom-left-radius:.125rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-l-sm{border-top-left-radius:.125rem;border-bottom-left-radius:.125rem}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-\[24px\]{border-top-left-radius:24px;border-top-right-radius:24px}.rounded-t-full{border-top-left-radius:9999px;border-top-right-radius:9999px}.rounded-t-inherit{border-top-left-radius:inherit;border-top-right-radius:inherit}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-br-\[11px\]{border-bottom-right-radius:11px}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl{border-top-left-radius:.25rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.rounded-tr-none{border-top-right-radius:0}.\!border{border-width:1px!important}.\!border-0{border-width:0px!important}.\!border-2{border-width:2px!important}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[0\.2px\]{border-width:.2px}.border-\[0\.5px\]{border-width:.5px}.border-\[0\.75px\]{border-width:.75px}.border-\[10px\]{border-width:10px}.border-\[1px\]{border-width:1px}.border-\[2px\]{border-width:2px}.border-\[4px\]{border-width:4px}.border-x{border-left-width:1px;border-right-width:1px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-x-4{border-left-width:4px;border-right-width:4px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-y{border-top-width:1px;border-bottom-width:1px}.\!border-b{border-bottom-width:1px!important}.\!border-b-0{border-bottom-width:0px!important}.\!border-l-0{border-left-width:0px!important}.\!border-r-0{border-right-width:0px!important}.\!border-t-0{border-top-width:0px!important}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-b-4{border-bottom-width:4px}.border-b-\[2px\]{border-bottom-width:2px}.border-e{border-inline-end-width:1px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-\[5px\]{border-top-width:5px}.border-t-\[7px\]{border-top-width:7px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.\!border-none{border-style:none!important}.border-none{border-style:none}.\!border-\[\#32B8C6\]{--tw-border-opacity: 1 !important;border-color:rgb(50 184 198 / var(--tw-border-opacity))!important}.\!border-\[black\]\/10{border-color:#0000001a!important}.\!border-black\/30{border-color:#0000004d!important}.\!border-caution{--tw-border-opacity: 1 !important;border-color:oklch(var(--caution-color) / var(--tw-border-opacity))!important}.\!border-caution\/50{border-color:oklch(var(--caution-color) / .5)!important}.\!border-inverse{border-color:oklch(var(--foreground-inverse-color))!important}.\!border-negative{border-color:oklch(var(--negative-color))!important}.\!border-subtle{border-color:oklch(var(--foreground-subtle-color))!important}.\!border-subtler{border-color:oklch(var(--foreground-subtler-color))!important}.\!border-subtlest{border-color:oklch(var(--foreground-subtlest-color))!important}.\!border-super{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.\!border-super\/10{border-color:oklch(var(--super-color) / .1)!important}.\!border-super\/30{border-color:oklch(var(--super-color) / .3)!important}.\!border-super\/75{border-color:oklch(var(--super-color) / .75)!important}.\!border-transparent{border-color:transparent!important}.\!border-white{--tw-border-opacity: 1 !important;border-color:rgb(255 255 255 / var(--tw-border-opacity))!important}.border-\[\#05FFFF\]\/20{border-color:#05ffff33}.border-\[\#A7A7A2\]{--tw-border-opacity: 1;border-color:rgb(167 167 162 / var(--tw-border-opacity))}.border-\[black\]\/10{border-color:#0000001a}.border-\[black\]\/5{border-color:#0000000d}.border-\[purple\]{--tw-border-opacity: 1;border-color:rgb(128 0 128 / var(--tw-border-opacity))}.border-black\/10{border-color:#0000001a}.border-black\/20{border-color:#0003}.border-caution\/10{border-color:oklch(var(--caution-color) / .1)}.border-caution\/20{border-color:oklch(var(--caution-color) / .2)}.border-caution\/50{border-color:oklch(var(--caution-color) / .5)}.border-dynamic{border-color:oklch(var(--border-dynamic))}.border-foreground{border-color:oklch(var(--foreground-color))}.border-inverse{border-color:oklch(var(--foreground-inverse-color))}.border-max{--tw-border-opacity: 1;border-color:oklch(var(--max-color) / var(--tw-border-opacity))}.border-negative{border-color:oklch(var(--negative-color))}.border-positive{border-color:oklch(var(--positive-color))}.border-subtle{border-color:oklch(var(--foreground-subtle-color))}.border-subtler{border-color:oklch(var(--foreground-subtler-color))}.border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}.border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.border-super\/10{border-color:oklch(var(--super-color) / .1)}.border-super\/20{border-color:oklch(var(--super-color) / .2)}.border-super\/30{border-color:oklch(var(--super-color) / .3)}.border-super\/40{border-color:oklch(var(--super-color) / .4)}.border-super\/50{border-color:oklch(var(--super-color) / .5)}.border-superBG{--tw-border-opacity: 1;border-color:oklch(var(--super-bg-color) / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-white\/10{border-color:#ffffff1a}.border-white\/20{border-color:#fff3}.border-white\/30{border-color:#ffffff4d}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.\!border-b-subtler{border-bottom-color:oklch(var(--foreground-subtler-color))!important}.\!border-b-subtlest{border-bottom-color:oklch(var(--foreground-subtlest-color))!important}.\!border-t-subtlest{border-top-color:oklch(var(--foreground-subtlest-color))!important}.border-b-subtler{border-bottom-color:oklch(var(--foreground-subtler-color))}.border-b-subtlest{border-bottom-color:oklch(var(--foreground-subtlest-color))}.border-r-subtlest{border-right-color:oklch(var(--foreground-subtlest-color))}.border-t-subtlest{border-top-color:oklch(var(--foreground-subtlest-color))}.border-t-super{--tw-border-opacity: 1;border-top-color:oklch(var(--super-color) / var(--tw-border-opacity))}.border-t-transparent{border-top-color:transparent}.border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity))}.\!bg-\[\#1e293b\]{--tw-bg-opacity: 1 !important;background-color:rgb(30 41 59 / var(--tw-bg-opacity))!important}.\!bg-\[\#5433eb\]{--tw-bg-opacity: 1 !important;background-color:rgb(84 51 235 / var(--tw-bg-opacity))!important}.\!bg-\[\#e10600\]{--tw-bg-opacity: 1 !important;background-color:rgb(225 6 0 / var(--tw-bg-opacity))!important}.\!bg-\[\#ffffff1a\]{background-color:#ffffff1a!important}.\!bg-\[gold\]{--tw-bg-opacity: 1 !important;background-color:rgb(255 215 0 / var(--tw-bg-opacity))!important}.\!bg-\[oklch\(var\(--pale-blue-200\)\)\]{background-color:oklch(var(--pale-blue-200))!important}.\!bg-\[silver\]{--tw-bg-opacity: 1 !important;background-color:rgb(192 192 192 / var(--tw-bg-opacity))!important}.\!bg-\[var\(--header-bg\,\#051224\)\]{background-color:var(--header-bg,#051224)!important}.\!bg-\[var\(--header-bg\,\#84754E\)\]{background-color:var(--header-bg,#84754E)!important}.\!bg-attention\/10{background-color:oklch(var(--attention-color) / .1)!important}.\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}.\!bg-base\/95{background-color:oklch(var(--background-base-color) / .95)!important}.\!bg-black{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity))!important}.\!bg-black\/10{background-color:#0000001a!important}.\!bg-black\/30{background-color:#0000004d!important}.\!bg-black\/5{background-color:#0000000d!important}.\!bg-black\/50{background-color:#00000080!important}.\!bg-caution\/10{background-color:oklch(var(--caution-color) / .1)!important}.\!bg-inverse{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))!important}.\!bg-inverse\/10{background-color:oklch(var(--background-inverse-color) / .1)!important}.\!bg-inverse\/100{background-color:oklch(var(--background-inverse-color) / 1)!important}.\!bg-inverse\/5{background-color:oklch(var(--background-inverse-color) / .05)!important}.\!bg-inverse\/50{background-color:oklch(var(--background-inverse-color) / .5)!important}.\!bg-inverse\/70{background-color:oklch(var(--background-inverse-color) / .7)!important}.\!bg-max{--tw-bg-opacity: 1 !important;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))!important}.\!bg-negative\/10{background-color:oklch(var(--negative-color) / .1)!important}.\!bg-negative\/20{background-color:oklch(var(--negative-color) / .2)!important}.\!bg-offset{background-color:oklch(var(--offset-color))!important}.\!bg-raised{background-color:oklch(var(--background-raised-color))!important}.\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}.\!bg-subtlest{background-color:oklch(var(--background-subtlest-color))!important}.\!bg-super{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\!bg-super\/10{background-color:oklch(var(--super-color) / .1)!important}.\!bg-super\/15{background-color:oklch(var(--super-color) / .15)!important}.\!bg-super\/20{background-color:oklch(var(--super-color) / .2)!important}.\!bg-transparent{background-color:transparent!important}.\!bg-underlay{background-color:oklch(var(--background-underlay-color))!important}.\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.\!bg-white\/10{background-color:#ffffff1a!important}.bg-\[\#000000\]{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-\[\#008cff\]{--tw-bg-opacity: 1;background-color:rgb(0 140 255 / var(--tw-bg-opacity))}.bg-\[\#059669\]{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity))}.bg-\[\#13343B\]{--tw-bg-opacity: 1;background-color:rgb(19 52 59 / var(--tw-bg-opacity))}.bg-\[\#19789E\]{--tw-bg-opacity: 1;background-color:rgb(25 120 158 / var(--tw-bg-opacity))}.bg-\[\#1F2121\]{--tw-bg-opacity: 1;background-color:rgb(31 33 33 / var(--tw-bg-opacity))}.bg-\[\#21808D\]{--tw-bg-opacity: 1;background-color:rgb(33 128 141 / var(--tw-bg-opacity))}.bg-\[\#292524\]{--tw-bg-opacity: 1;background-color:rgb(41 37 36 / var(--tw-bg-opacity))}.bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}.bg-\[\#44403c\]{--tw-bg-opacity: 1;background-color:rgb(68 64 60 / var(--tw-bg-opacity))}.bg-\[\#482d2f\]{--tw-bg-opacity: 1;background-color:rgb(72 45 47 / var(--tw-bg-opacity))}.bg-\[\#60584D\]\/\[0\.06\]{background-color:#60584d0f}.bg-\[\#64748b\]{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity))}.bg-\[\#848456\]{--tw-bg-opacity: 1;background-color:rgb(132 132 86 / var(--tw-bg-opacity))}.bg-\[\#865D95\]{--tw-bg-opacity: 1;background-color:rgb(134 93 149 / var(--tw-bg-opacity))}.bg-\[\#944454\]{--tw-bg-opacity: 1;background-color:rgb(148 68 84 / var(--tw-bg-opacity))}.bg-\[\#A84B2F\]{--tw-bg-opacity: 1;background-color:rgb(168 75 47 / var(--tw-bg-opacity))}.bg-\[\#C0152F\]{--tw-bg-opacity: 1;background-color:rgb(192 21 47 / var(--tw-bg-opacity))}.bg-\[\#D39900\]{--tw-bg-opacity: 1;background-color:rgb(211 153 0 / var(--tw-bg-opacity))}.bg-\[\#DB7100\]{--tw-bg-opacity: 1;background-color:rgb(219 113 0 / var(--tw-bg-opacity))}.bg-\[\#DEDBD7\]{--tw-bg-opacity: 1;background-color:rgb(222 219 215 / var(--tw-bg-opacity))}.bg-\[\#e10600\]{--tw-bg-opacity: 1;background-color:rgb(225 6 0 / var(--tw-bg-opacity))}.bg-\[\#e11d48\]{--tw-bg-opacity: 1;background-color:rgb(225 29 72 / var(--tw-bg-opacity))}.bg-\[\#f3f3ef\]{--tw-bg-opacity: 1;background-color:rgb(243 243 239 / var(--tw-bg-opacity))}.bg-\[\#facc15\]\/25{background-color:#facc1540}.bg-\[\#fee2e2\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-\[color\:oklch\(var\(--foreground-color\)\/0\.15\)\]{background-color:oklch(var(--foreground-color)/.15)}.bg-\[purple\]\/90{background-color:#800080e6}.bg-\[var\(--dot-color\)\]{background-color:var(--dot-color)}.bg-attention{--tw-bg-opacity: 1;background-color:oklch(var(--attention-color) / var(--tw-bg-opacity))}.bg-attention\/10{background-color:oklch(var(--attention-color) / .1)}.bg-backdrop{--tw-bg-opacity: 1;background-color:oklch(var(--backdrop-color) / var(--tw-bg-opacity))}.bg-backdrop\/25{background-color:oklch(var(--backdrop-color) / .25)}.bg-backdrop\/70{background-color:oklch(var(--backdrop-color) / .7)}.bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}.bg-base\/40{background-color:oklch(var(--background-base-color) / .4)}.bg-base\/90{background-color:oklch(var(--background-base-color) / .9)}.bg-base\/95{background-color:oklch(var(--background-base-color) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/10{background-color:#0000001a}.bg-black\/20{background-color:#0003}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/80{background-color:#000c}.bg-caution{--tw-bg-opacity: 1;background-color:oklch(var(--caution-color) / var(--tw-bg-opacity))}.bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}.bg-current{background-color:currentColor}.bg-dark{background-color:oklch(var(--dark-background-base-color))}.bg-elevated{background-color:oklch(var(--background-elevated-color))}.bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}.bg-inverse\/10{background-color:oklch(var(--background-inverse-color) / .1)}.bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}.bg-inverse\/25{background-color:oklch(var(--background-inverse-color) / .25)}.bg-inverse\/30{background-color:oklch(var(--background-inverse-color) / .3)}.bg-inverse\/45{background-color:oklch(var(--background-inverse-color) / .45)}.bg-inverse\/5{background-color:oklch(var(--background-inverse-color) / .05)}.bg-inverse\/70{background-color:oklch(var(--background-inverse-color) / .7)}.bg-lightbox\/95{background-color:oklch(var(--background-lightbox-color) / .95)}.bg-max{--tw-bg-opacity: 1;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))}.bg-negative{--tw-bg-opacity: 1;background-color:oklch(var(--negative-color) / var(--tw-bg-opacity))}.bg-negative\/10{background-color:oklch(var(--negative-color) / .1)}.bg-negative\/5{background-color:oklch(var(--negative-color) / .05)}.bg-negative\/90{background-color:oklch(var(--negative-color) / .9)}.bg-offset{background-color:oklch(var(--offset-color))}.bg-offset-special{background-color:oklch(var(--surface-offset-special))}.bg-positive{--tw-bg-opacity: 1;background-color:oklch(var(--positive-color) / var(--tw-bg-opacity))}.bg-positive\/10{background-color:oklch(var(--positive-color) / .1)}.bg-positive\/5{background-color:oklch(var(--positive-color) / .05)}.bg-positive\/90{background-color:oklch(var(--positive-color) / .9)}.bg-raised{background-color:oklch(var(--background-raised-color))}.bg-raisedOffset{background-color:oklch(var(--raised-offset-color))}.bg-subtle{background-color:oklch(var(--background-subtle-color))}.bg-subtler{background-color:oklch(var(--background-subtler-color))}.bg-subtlest{background-color:oklch(var(--background-subtlest-color))}.bg-super{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.bg-super\/10{background-color:oklch(var(--super-color) / .1)}.bg-super\/15{background-color:oklch(var(--super-color) / .15)}.bg-super\/20{background-color:oklch(var(--super-color) / .2)}.bg-super\/30{background-color:oklch(var(--super-color) / .3)}.bg-super\/5{background-color:oklch(var(--super-color) / .05)}.bg-superBG{--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-underlay{background-color:oklch(var(--background-underlay-color))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/5{background-color:#ffffff0d}.bg-white\/50{background-color:#ffffff80}.bg-white\/75{background-color:#ffffffbf}.bg-white\/80{background-color:#fffc}.bg-opacity-60{--tw-bg-opacity: .6}.bg-\[conic-gradient\(var\(--button-border-gradient-stops\)\)\]{background-image:conic-gradient(var(--button-border-gradient-stops))}.bg-\[radial-gradient\(circle_farthest-side_at_0_100\%\,\#139FB233\,\#139FB2cc\)\,radial-gradient\(circle_farthest-side_at_100\%_0\,\#139FB233\,transparent\)\]{background-image:radial-gradient(circle farthest-side at 0 100%,#139fb233,#139fb2cc),radial-gradient(circle farthest-side at 100% 0,#139FB233,transparent)}.bg-\[radial-gradient\(circle_farthest-side_at_0_100\%\,\#27cae0e3\,transparent\)\,radial-gradient\(circle_farthest-side_at_100\%_0\,\#24B4C81A\,transparent\)\]{background-image:radial-gradient(circle farthest-side at 0 100%,#27cae0e3,transparent),radial-gradient(circle farthest-side at 100% 0,#24B4C81A,transparent)}.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-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.bg-none{background-image:none}.from-\[\#1FB8CD80\]{--tw-gradient-from: #1FB8CD80 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 184 205 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-base{--tw-gradient-from: oklch(var(--background-base-color) / 1) var(--tw-gradient-from-position);--tw-gradient-to: oklch(var(--background-base-color) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-base\/50{--tw-gradient-from: oklch(var(--background-base-color) / .5) 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)}.from-black{--tw-gradient-from: #000 var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/40{--tw-gradient-from: rgb(0 0 0 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/70{--tw-gradient-from: rgb(0 0 0 / .7) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-negative\/20{--tw-gradient-from: oklch(var(--negative-color) / .2) 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)}.from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}.from-super\/25{--tw-gradient-from: oklch(var(--super-color) / .25) 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)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-35\%{--tw-gradient-from-position: 35%}.from-45\%{--tw-gradient-from-position: 45%}.from-5\%{--tw-gradient-from-position: 5%}.from-\[-10\%\]{--tw-gradient-from-position: -10%}.via-base\/80{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-base-color) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-black\/20{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-subtle{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-subtle-color)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-subtler{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-subtler-color)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-50\%{--tw-gradient-via-position: 50%}.via-75\%{--tw-gradient-via-position: 75%}.to-\[\#24B4C81A\]{--tw-gradient-to: #24B4C81A var(--tw-gradient-to-position)}.to-\[oklch\(var\(--light-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--light-background-base-color)) var(--tw-gradient-to-position)}.to-\[rgba\(180\,180\,180\,0\.075\)\]{--tw-gradient-to: rgba(180,180,180,.075) var(--tw-gradient-to-position)}.to-attention\/20{--tw-gradient-to: oklch(var(--attention-color) / .2) var(--tw-gradient-to-position)}.to-base{--tw-gradient-to: oklch(var(--background-base-color) / 1) var(--tw-gradient-to-position)}.to-base\/0{--tw-gradient-to: oklch(var(--background-base-color) / 0) var(--tw-gradient-to-position)}.to-black\/20{--tw-gradient-to: rgb(0 0 0 / .2) var(--tw-gradient-to-position)}.to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}.to-super\/25{--tw-gradient-to: oklch(var(--super-color) / .25) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-\[110\%\]{--tw-gradient-to-position: 110%}.bg-cover{background-size:cover}.bg-clip-border{background-clip:border-box}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-center{background-position:center}.bg-no-repeat{background-repeat:no-repeat}.\!fill-inverse{fill:oklch(var(--foreground-inverse-color))!important}.\!fill-super{fill:oklch(var(--super-color) / 1)!important}.fill-\[\#eab308\]{fill:#eab308}.fill-\[oklch\(var\(--background-base-color\)\)\]{fill:oklch(var(--background-base-color))}.fill-\[oklch\(var\(--dark-background-base-color\)\)\]{fill:oklch(var(--dark-background-base-color))}.fill-base{fill:oklch(var(--background-base-color))}.fill-caution{fill:oklch(var(--caution-color) / 1)}.fill-current{fill:currentColor}.fill-dark{fill:oklch(var(--light-foreground-color))}.fill-foreground{fill:oklch(var(--foreground-color))}.fill-inverse{fill:oklch(var(--foreground-inverse-color))}.fill-light{fill:oklch(var(--dark-foreground-color))}.fill-max{fill:oklch(var(--max-color) / 1)}.fill-offset{fill:oklch(var(--offset-color))}.fill-quiet{fill:oklch(var(--foreground-quiet-color))}.fill-super{fill:oklch(var(--super-color) / 1)}.fill-transparent{fill:transparent}.stroke-\[\#e10600\]{stroke:#e10600}.stroke-caution{stroke:oklch(var(--caution-color) / 1)}.stroke-dark{stroke:oklch(var(--light-foreground-color))}.stroke-foreground{stroke:oklch(var(--foreground-color))}.stroke-inverse{stroke:oklch(var(--foreground-inverse-color))}.stroke-light{stroke:oklch(var(--dark-foreground-color))}.stroke-quiet{stroke:oklch(var(--foreground-quiet-color))}.stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}.stroke-super{stroke:oklch(var(--super-color) / 1)}.stroke-white\/5{stroke:#ffffff0d}.stroke-\[1\.5px\]{stroke-width:1.5px}.\!object-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-none{-o-object-fit:none;object-fit:none}.\!object-center{-o-object-position:center!important;object-position:center!important}.object-\[0_90\%\]{-o-object-position:0 90%;object-position:0 90%}.object-\[60\%_center\]{-o-object-position:60% center;object-position:60% center}.object-center{-o-object-position:center;object-position:center}.object-left{-o-object-position:left;object-position:left}.object-left-top{-o-object-position:left top;object-position:left top}.object-top{-o-object-position:top;object-position:top}.\!p-0{padding:0!important}.\!p-3{padding:.75rem!important}.\!p-6{padding:1.5rem!important}.\!p-md{padding:var(--size-md)!important}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-12{padding:3rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-24{padding:6rem}.p-2xl{padding:96px}.p-2xs{padding:var(--size-2xs)}.p-3{padding:.75rem}.p-32{padding:8rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[0\.2rem\]{padding:.2rem}.p-\[0\.5px\]{padding:.5px}.p-\[0\.8rem\]{padding:.8rem}.p-\[1\.5px\]{padding:1.5px}.p-\[10px\]{padding:10px}.p-\[12px\]{padding:12px}.p-\[2\.5px\]{padding:2.5px}.p-\[20px\]{padding:20px}.p-\[4px\]{padding:4px}.p-\[6px\]{padding:6px}.p-\[7px\]{padding:7px}.p-\[8px\]{padding:8px}.p-half{padding:.5px}.p-lg{padding:var(--size-lg)}.p-md{padding:var(--size-md)}.p-ml{padding:var(--size-ml)}.p-one,.p-px{padding:1px}.p-sm{padding:var(--size-sm)}.p-three{padding:3px}.p-two{padding:2px}.p-xl{padding:var(--size-xl)}.p-xs{padding:var(--size-xs)}.\!px-0{padding-left:0!important;padding-right:0!important}.\!px-1{padding-left:.25rem!important;padding-right:.25rem!important}.\!px-1\.5{padding-left:.375rem!important;padding-right:.375rem!important}.\!px-2xl{padding-left:96px!important;padding-right:96px!important}.\!px-3{padding-left:.75rem!important;padding-right:.75rem!important}.\!px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.\!px-8{padding-left:2rem!important;padding-right:2rem!important}.\!px-\[12px\]{padding-left:12px!important;padding-right:12px!important}.\!px-lg{padding-left:var(--size-lg)!important;padding-right:var(--size-lg)!important}.\!px-md{padding-left:var(--size-md)!important;padding-right:var(--size-md)!important}.\!px-sm{padding-left:var(--size-sm)!important;padding-right:var(--size-sm)!important}.\!px-xs{padding-left:var(--size-xs)!important;padding-right:var(--size-xs)!important}.\!py-0{padding-top:0!important;padding-bottom:0!important}.\!py-md{padding-top:var(--size-md)!important;padding-bottom:var(--size-md)!important}.\!py-sm{padding-top:var(--size-sm)!important;padding-bottom:var(--size-sm)!important}.\!py-xs{padding-top:var(--size-xs)!important;padding-bottom:var(--size-xs)!important}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.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-3\.5{padding-left:.875rem;padding-right:.875rem}.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}.px-\[0\.1875rem\]{padding-left:.1875rem;padding-right:.1875rem}.px-\[0\.3rem\]{padding-left:.3rem;padding-right:.3rem}.px-\[0\.6em\]{padding-left:.6em;padding-right:.6em}.px-\[0\.6rem\]{padding-left:.6rem;padding-right:.6rem}.px-\[10px\]{padding-left:10px;padding-right:10px}.px-\[12px\]{padding-left:12px;padding-right:12px}.px-\[5px\]{padding-left:5px;padding-right:5px}.px-\[6px\]{padding-left:6px;padding-right:6px}.px-\[var\(--thread-visual-spacing\)\]{padding-left:var(--thread-visual-spacing);padding-right:var(--thread-visual-spacing)}.px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.px-pageHorizontalPadding{padding-left:var(--page-horizontal-padding);padding-right:var(--page-horizontal-padding)}.px-px{padding-left:1px;padding-right:1px}.px-sm{padding-left:var(--size-sm);padding-right:var(--size-sm)}.px-three{padding-left:3px;padding-right:3px}.px-two{padding-left:2px;padding-right:2px}.px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.px-xs{padding-left:var(--size-xs);padding-right:var(--size-xs)}.py-0{padding-top:0;padding-bottom:0}.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-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-2xl{padding-top:96px;padding-bottom:96px}.py-2xs{padding-top:var(--size-2xs);padding-bottom:var(--size-2xs)}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-32{padding-top:8rem;padding-bottom:8rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[0\.125rem\]{padding-top:.125rem;padding-bottom:.125rem}.py-\[0\.15em\]{padding-top:.15em;padding-bottom:.15em}.py-\[0\.175rem\]{padding-top:.175rem;padding-bottom:.175rem}.py-\[0\.1875rem\]{padding-top:.1875rem;padding-bottom:.1875rem}.py-\[10px\]{padding-top:10px;padding-bottom:10px}.py-\[12px\]{padding-top:12px;padding-bottom:12px}.py-\[18px\]{padding-top:18px;padding-bottom:18px}.py-\[20px\]{padding-top:20px;padding-bottom:20px}.py-\[6px\]{padding-top:6px;padding-bottom:6px}.py-lg{padding-top:var(--size-lg);padding-bottom:var(--size-lg)}.py-md{padding-top:var(--size-md);padding-bottom:var(--size-md)}.py-ml{padding-top:var(--size-ml);padding-bottom:var(--size-ml)}.py-px{padding-top:1px;padding-bottom:1px}.py-sm{padding-top:var(--size-sm);padding-bottom:var(--size-sm)}.py-two{padding-top:2px;padding-bottom:2px}.py-xl{padding-top:var(--size-xl);padding-bottom:var(--size-xl)}.py-xs{padding-top:var(--size-xs);padding-bottom:var(--size-xs)}.\!pb-0{padding-bottom:0!important}.\!pb-4{padding-bottom:1rem!important}.\!pb-6{padding-bottom:1.5rem!important}.\!pb-md{padding-bottom:var(--size-md)!important}.\!pb-px{padding-bottom:1px!important}.\!pl-0{padding-left:0!important}.\!pl-1{padding-left:.25rem!important}.\!pl-1\.5{padding-left:.375rem!important}.\!pl-3{padding-left:.75rem!important}.\!pl-4{padding-left:1rem!important}.\!pl-\[0\.3em\]{padding-left:.3em!important}.\!pl-\[23px\]{padding-left:23px!important}.\!pl-sm{padding-left:var(--size-sm)!important}.\!pr-0{padding-right:0!important}.\!pr-3{padding-right:.75rem!important}.\!pt-0{padding-top:0!important}.\!pt-10{padding-top:2.5rem!important}.\!pt-4{padding-top:1rem!important}.\!pt-8{padding-top:2rem!important}.pb-0{padding-bottom:0}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-12{padding-bottom:3rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-48{padding-bottom:12rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-7{padding-bottom:1.75rem}.pb-8{padding-bottom:2rem}.pb-\[100px\]{padding-bottom:100px}.pb-\[12px\]{padding-bottom:12px}.pb-\[160px\]{padding-bottom:160px}.pb-\[200px\]{padding-bottom:200px}.pb-\[32px\]{padding-bottom:32px}.pb-\[57px\]{padding-bottom:57px}.pb-\[var\(--thread-visual-spacing\)\]{padding-bottom:var(--thread-visual-spacing)}.pb-lg{padding-bottom:var(--size-lg)}.pb-md{padding-bottom:var(--size-md)}.pb-mobileNavHeight{padding-bottom:var(--mobile-nav-height)}.pb-px{padding-bottom:1px}.pb-safeAreaInsetBottom{padding-bottom:var(--safe-area-inset-bottom)}.pb-sm{padding-bottom:var(--size-sm)}.pb-threadAttachmentsHeightWithPadding{padding-bottom:var(--thread-attachments-height-with-padding)}.pb-threadInputHeightWithPadding{padding-bottom:var(--thread-input-height-with-padding)}.pb-three{padding-bottom:3px}.pb-two{padding-bottom:2px}.pb-xl{padding-bottom:var(--size-xl)}.pb-xs{padding-bottom:var(--size-xs)}.pe-\[20px\]{padding-inline-end:20px}.pl-0{padding-left:0}.pl-1{padding-left:.25rem}.pl-1\.5{padding-left:.375rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-\[12px\]{padding-left:12px}.pl-\[14px\]{padding-left:14px}.pl-\[2px\]{padding-left:2px}.pl-\[40px\]{padding-left:40px}.pl-\[4px\]{padding-left:4px}.pl-lg{padding-left:var(--size-lg)}.pl-md{padding-left:var(--size-md)}.pl-px{padding-left:1px}.pl-sm{padding-left:var(--size-sm)}.pl-two{padding-left:2px}.pl-xs{padding-left:var(--size-xs)}.pr-0{padding-right:0}.pr-1{padding-right:.25rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-28{padding-right:7rem}.pr-4{padding-right:1rem}.pr-\[10px\]{padding-right:10px}.pr-\[128px\]{padding-right:128px}.pr-\[12px\]{padding-right:12px}.pr-\[24px\]{padding-right:24px}.pr-\[49px\]{padding-right:49px}.pr-\[6px\]{padding-right:6px}.pr-\[75px\]{padding-right:75px}.pr-lg{padding-right:var(--size-lg)}.pr-md{padding-right:var(--size-md)}.pr-sm{padding-right:var(--size-sm)}.pr-three{padding-right:3px}.pr-xs{padding-right:var(--size-xs)}.ps-\[20px\]{padding-inline-start:20px}.ps-md{padding-inline-start:var(--size-md)}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-14{padding-top:3.5rem}.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-\[0\.275rem\]{padding-top:.275rem}.pt-\[12px\]{padding-top:12px}.pt-\[36px\]{padding-top:36px}.pt-\[48px\]{padding-top:48px}.pt-\[4px\]{padding-top:4px}.pt-\[88px\]{padding-top:88px}.pt-\[8vh\]{padding-top:8vh}.pt-\[var\(--thread-visual-spacing\)\]{padding-top:var(--thread-visual-spacing)}.pt-headerHeight{padding-top:var(--header-height)}.pt-lg{padding-top:var(--size-lg)}.pt-md{padding-top:var(--size-md)}.pt-one,.pt-px{padding-top:1px}.pt-sm{padding-top:var(--size-sm)}.pt-three{padding-top:3px}.pt-two{padding-top:2px}.pt-xl{padding-top:var(--size-xl)}.pt-xs{padding-top:var(--size-xs)}.\!text-left{text-align:left!important}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-justify{text-align:justify}.text-end{text-align:end}.align-baseline{vertical-align:baseline}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.align-text-top{vertical-align:text-top}.align-\[-0\.125em\]{vertical-align:-.125em}.\!font-display{font-family:var(--font-fk-grotesk),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"!important}.\!font-editorial{font-family:var(--font-newsreader),ui-serif,Georgia,Cambria,serif!important}.\!font-mono{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace!important}.\!font-sans{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo!important}.font-display{font-family:var(--font-fk-grotesk),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"}.font-editorial{font-family:var(--font-newsreader),ui-serif,Georgia,Cambria,serif}.font-mono{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo}.\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.\!text-2xs{font-size:11px!important;line-height:1rem!important}.\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.\!text-\[0\.6875rem\]{font-size:.6875rem!important}.\!text-\[0\.68rem\]{font-size:.68rem!important}.\!text-\[0\.7rem\]{font-size:.7rem!important}.\!text-\[0\.8125rem\]{font-size:.8125rem!important}.\!text-\[1\.2rem\]{font-size:1.2rem!important}.\!text-\[1\.3rem\]{font-size:1.3rem!important}.\!text-\[1\.75rem\]{font-size:1.75rem!important}.\!text-\[10px\]{font-size:10px!important}.\!text-\[11px\]{font-size:11px!important}.\!text-\[1rem\]{font-size:1rem!important}.\!text-\[2rem\]{font-size:2rem!important}.\!text-\[3rem\]{font-size:3rem!important}.\!text-\[44px\]{font-size:44px!important}.\!text-\[48px\]{font-size:48px!important}.\!text-base{font-size:1rem!important;line-height:1.5rem!important}.\!text-inherit{font-size:inherit!important;line-height:inherit!important}.\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.\!text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.\!text-xs{font-size:.75rem!important;line-height:1rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-2xs{font-size:11px;line-height:1rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-3xs{font-size:10px;line-height:.625rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[0\.80rem\]{font-size:.8rem}.text-\[0\]{font-size:0}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[16px\]{font-size:16px}.text-\[2\.4rem\]{font-size:2.4rem}.text-\[2rem\]{font-size:2rem}.text-\[8px\]{font-size:8px}.text-base{font-size:1rem;line-height:1.5rem}.text-inherit{font-size:inherit;line-height:inherit}.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-medium{font-weight:500!important}.\!font-normal{font-weight:400!important}.font-\[450\]{font-weight:450}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-extralight{font-weight:200}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.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-\[1\.2\]{line-height:1.2!important}.\!leading-none{line-height:1!important}.\!leading-tight{line-height:1.25!important}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-\[0\.875rem\]{line-height:.875rem}.leading-\[1\.125rem\]{line-height:1.125rem}.leading-\[1\.1\]{line-height:1.1}.leading-\[1\.2\]{line-height:1.2}.leading-\[1\.3\]{line-height:1.3}.leading-\[1\.5em\]{line-height:1.5em}.leading-\[12px\]{line-height:12px}.leading-\[18px\]{line-height:18px}.leading-\[32px\]{line-height:32px}.leading-\[48px\]{line-height:48px}.leading-\[64px\]{line-height:64px}.leading-\[initial\]{line-height:initial}.leading-loose{line-height:2}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.\!tracking-wider{letter-spacing:.05em!important}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.\!text-\[currentColor\]{color:currentColor!important}.\!text-\[var\(--mode-color\)\]{color:var(--mode-color)!important}.\!text-\[white\]{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\!text-attention{--tw-text-opacity: 1 !important;color:oklch(var(--attention-color) / var(--tw-text-opacity))!important}.\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.\!text-black\/50{color:#00000080!important}.\!text-black\/60{color:#0009!important}.\!text-caution{--tw-text-opacity: 1 !important;color:oklch(var(--caution-color) / var(--tw-text-opacity))!important}.\!text-foreground{color:oklch(var(--foreground-color))!important}.\!text-inherit{color:inherit!important}.\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}.\!text-light{color:oklch(var(--dark-foreground-color))!important}.\!text-negative{--tw-text-opacity: 1 !important;color:oklch(var(--negative-color) / var(--tw-text-opacity))!important}.\!text-positive{--tw-text-opacity: 1 !important;color:oklch(var(--positive-color) / var(--tw-text-opacity))!important}.\!text-quiet{color:oklch(var(--foreground-quiet-color))!important}.\!text-quieter{color:oklch(var(--foreground-quieter-color))!important}.\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.\!text-transparent{color:transparent!important}.\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\!text-white\/50{color:#ffffff80!important}.text-\[\#16a34a\]{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-\[\#22c55e\]{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-\[\#3b82f6\]{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-\[\#eab308\]{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.text-\[var\(--mode-color\)\]{color:var(--mode-color)}.text-attention{--tw-text-opacity: 1;color:oklch(var(--attention-color) / var(--tw-text-opacity))}.text-attention\/70{color:oklch(var(--attention-color) / .7)}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black\/50{color:#00000080}.text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}.text-dark{color:oklch(var(--light-foreground-color))}.text-foreground{color:oklch(var(--foreground-color))}.text-inherit{color:inherit}.text-inverse{color:oklch(var(--foreground-inverse-color))}.text-light{color:oklch(var(--dark-foreground-color))}.text-max{--tw-text-opacity: 1;color:oklch(var(--max-color) / var(--tw-text-opacity))}.text-negative{--tw-text-opacity: 1;color:oklch(var(--negative-color) / var(--tw-text-opacity))}.text-positive{--tw-text-opacity: 1;color:oklch(var(--positive-color) / var(--tw-text-opacity))}.text-quiet{color:oklch(var(--foreground-quiet-color))}.text-quieter{color:oklch(var(--foreground-quieter-color))}.text-quietest{color:oklch(var(--foreground-quietest-color))}.text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white\/70{color:#ffffffb3}.text-white\/90{color:#ffffffe6}.underline{text-decoration-line:underline}.\!line-through{text-decoration-line:line-through!important}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.decoration-subtle{text-decoration-color:oklch(var(--foreground-subtle-color))}.decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}.decoration-super\/50{text-decoration-color:oklch(var(--super-color) / .5)}.decoration-transparent{text-decoration-color:transparent}.decoration-white\/50{text-decoration-color:#ffffff80}.decoration-dotted{text-decoration-style:dotted}.decoration-1{text-decoration-thickness:1px}.underline-offset-1{text-underline-offset:1px}.underline-offset-2{text-underline-offset:2px}.underline-offset-\[5px\]{text-underline-offset:5px}.\!placeholder-quietest::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\!placeholder-quietest::placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder-quieter::-moz-placeholder{color:oklch(var(--foreground-quieter-color))}.placeholder-quieter::placeholder{color:oklch(var(--foreground-quieter-color))}.caret-super{caret-color:oklch(var(--super-color) / 1)}.\!opacity-0{opacity:0!important}.\!opacity-100{opacity:1!important}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-15{opacity:.15}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-5{opacity:.05}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.opacity-\[0\.04\]{opacity:.04}.opacity-\[0\.075\]{opacity:.075}.opacity-\[0\.18\]{opacity:.18}.opacity-\[10\%\]{opacity:10%}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-difference{mix-blend-mode:difference}.\!shadow-none{--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.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)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px 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_-30px_30px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 -30px 30px oklch(var(--background-base-color));--tw-shadow-colored: 0 -30px 30px 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_16px_8px_oklch\(var\(--background-base-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--background-base-color)/.6);--tw-shadow-colored: 0 0 16px 8px 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_12px_16px_0_rgba\(0\,0\,0\,0\.10\)\]{--tw-shadow: 0 12px 16px 0 rgba(0,0,0,.1);--tw-shadow-colored: 0 12px 16px 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-\[0_1px_2px_0_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow: 0 1px 2px 0 rgba(0,0,0,.03);--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-\[0_1px_3px_0\]{--tw-shadow: 0 1px 3px 0;--tw-shadow-colored: 0 1px 3px 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-\[0_1px_4px_0_rgba\(0\,0\,0\,0\.05\)\,0_0_0_1px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 1px 4px 0 rgba(0,0,0,.05),0 0 0 1px rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 4px 0 var(--tw-shadow-color), 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-\[0_1px_6px_rgba\(0\,0\,0\,0\.25\)\]{--tw-shadow: 0 1px 6px rgba(0,0,0,.25);--tw-shadow-colored: 0 1px 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)}.shadow-\[0_1px_6px_rgba\(0\,0\,0\,0\.35\)\,0_0_0_1px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 1px 6px rgba(0,0,0,.35),0 0 0 1px rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 6px var(--tw-shadow-color), 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-\[0_1px_8px_2px_oklch\(var\(--foreground-color\)\/0\.1\)\,0_36px_16px_36px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 1px 8px 2px oklch(var(--foreground-color)/.1),0 36px 16px 36px oklch(var(--background-base-color));--tw-shadow-colored: 0 1px 8px 2px var(--tw-shadow-color), 0 36px 16px 36px 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_36px_16px_36px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 36px 16px 36px oklch(var(--background-base-color));--tw-shadow-colored: 0 36px 16px 36px 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-\[0px_1px_4px_0px_rgba\(0\,0\,0\,0\.24\)\]{--tw-shadow: 0px 1px 4px 0px rgba(0,0,0,.24);--tw-shadow-colored: 0px 1px 4px 0px 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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-inset-xs{--tw-shadow: inset 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 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-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-overlay{--tw-shadow: 0 0 0 1px var(--shadow-overlay-border, rgba(0, 0, 0, .05)), 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 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-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-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.shadow-black\/5{--tw-shadow-color: rgb(0 0 0 / .05);--tw-shadow: var(--tw-shadow-colored)}.shadow-super{--tw-shadow-color: oklch(var(--super-color) / 1);--tw-shadow: var(--tw-shadow-colored)}.shadow-super\/10{--tw-shadow-color: oklch(var(--super-color) / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-super\/30{--tw-shadow-color: oklch(var(--super-color) / .3);--tw-shadow: var(--tw-shadow-colored)}.\!outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-super{outline-color:oklch(var(--super-color) / 1)}.outline-transparent{outline-color:transparent}.\!ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.\!ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.ring{--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(3px + 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-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-\[1\.5px\]{--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(1.5px + 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-inverse{--tw-ring-color: oklch(var(--foreground-inverse-color)) !important}.\!ring-super{--tw-ring-opacity: 1 !important;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity)) !important}.\!ring-transparent{--tw-ring-color: transparent !important}.ring-\[oklch\(var\(--pale-blue-200\)\)\]{--tw-ring-color: oklch(var(--pale-blue-200))}.ring-black\/10{--tw-ring-color: rgb(0 0 0 / .1)}.ring-inverse{--tw-ring-color: oklch(var(--foreground-inverse-color))}.ring-max{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--max-color) / var(--tw-ring-opacity))}.ring-raised{--tw-ring-color: oklch(var(--background-raised-color))}.ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}.ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}.ring-subtlest{--tw-ring-color: oklch(var(--foreground-subtlest-color))}.ring-super{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.ring-super\/50{--tw-ring-color: oklch(var(--super-color) / .5)}.ring-super\/60{--tw-ring-color: oklch(var(--super-color) / .6)}.ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}.ring-transparent{--tw-ring-color: transparent}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-black{--tw-ring-offset-color: #000}.ring-offset-inverse{--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.blur{--tw-blur: blur(8px);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)}.blur-\[0\.5px\]{--tw-blur: blur(.5px);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)}.blur-\[20px\]{--tw-blur: blur(20px);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)}.blur-\[30px\]{--tw-blur: blur(30px);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)}.blur-\[50px\]{--tw-blur: blur(50px);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)}.blur-lg{--tw-blur: blur(16px);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)}.blur-md{--tw-blur: blur(12px);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)}.blur-sm{--tw-blur: blur(4px);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)}.blur-xl{--tw-blur: blur(24px);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)}.brightness-110{--tw-brightness: brightness(1.1);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)}.brightness-\[0\.8\]{--tw-brightness: brightness(.8);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)}.contrast-75{--tw-contrast: contrast(.75);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)}.drop-shadow-\[0_0_1px_rgba\(96\,88\,77\,0\.5\)\]{--tw-drop-shadow: drop-shadow(0 0 1px rgba(96,88,77,.5));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)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));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)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));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)}.\!grayscale-0{--tw-grayscale: grayscale(0) !important;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)!important}.grayscale{--tw-grayscale: grayscale(100%);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)}.invert{--tw-invert: invert(100%);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)}.saturate-0{--tw-saturate: saturate(0);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)}.saturate-150{--tw-saturate: saturate(1.5);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)}.saturate-200{--tw-saturate: saturate(2);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-\[0\.5px\]{--tw-backdrop-blur: blur(.5px);-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-\[1px\]{--tw-backdrop-blur: blur(1px);-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-\[25px\]{--tw-backdrop-blur: blur(25px);-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-lg{--tw-backdrop-blur: blur(16px);-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-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)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-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-saturate-200{--tw-backdrop-saturate: saturate(2);-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,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[border-color\,border-radius\,box-shadow\]{transition-property:border-color,border-radius,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[padding\,opacity\]{transition-property:padding,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[text-decoration-color\]{transition-property:text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[transform\,width\,opacity\]{transition-property:transform,width,opacity;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-none{transition-property:none}.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}.\!delay-0{transition-delay:0s!important}.\!delay-200{transition-delay:.2s!important}.delay-0{transition-delay:0s}.delay-100{transition-delay:.1s}.delay-1000{transition-delay:1s}.delay-150{transition-delay:.15s}.delay-200{transition-delay:.2s}.delay-500{transition-delay:.5s}.\!duration-0{transition-duration:0s!important}.\!duration-100{transition-duration:.1s!important}.\!duration-150{transition-duration:.15s!important}.duration-0{transition-duration:0s}.duration-100{transition-duration:.1s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.duration-75{transition-duration:75ms}.duration-normal{transition-duration:.15s}.duration-quick{transition-duration:75ms}.\!ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)!important}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-inExpo{transition-timing-function:cubic-bezier(.7,0,.84,0)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-outExpo{transition-timing-function:cubic-bezier(.16,1,.3,1)}.will-change-auto{will-change:auto}.will-change-transform{will-change:transform}.font-feature-tab-nums{font-feature-settings:"tnum"}.italic{font-variation-settings:"ital" 120}.mask-fade-r-12{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 3px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 3px),transparent 100%)}.mask-fade-r-6{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 1.5px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 1.5px),transparent 100%)}.mask-fade-l-12{-webkit-mask-image:linear-gradient(90deg,transparent 0,black 3px,black 100%);mask-image:linear-gradient(90deg,transparent 0,black 3px,black 100%)}.mask-fade-b-4{-webkit-mask-image:linear-gradient(180deg,black 0,black calc(100% - 1px),transparent 100%);mask-image:linear-gradient(180deg,black 0,black calc(100% - 1px),transparent 100%)}.mask-fade-t-6{-webkit-mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black 100%);mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black 100%)}.mask-fade-h-12{-webkit-mask-image:linear-gradient(90deg,transparent 0,black 3px,black calc(100% - 3px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,black 3px,black calc(100% - 3px),transparent 100%)}.mask-fade-v-6{-webkit-mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black calc(100% - 1.5px),transparent 100%);mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black calc(100% - 1.5px),transparent 100%)}.text-box-trim-both{text-box-trim:trim-both}@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}.animate-out{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}.fade-in{--tw-enter-opacity: 0}.fade-in-25{--tw-enter-opacity: .25}.fade-in-50{--tw-enter-opacity: .5}.fade-out{--tw-exit-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-\[0\.97\]{--tw-enter-scale: .97}.zoom-in-\[0\.98\]{--tw-enter-scale: .98}.zoom-out{--tw-exit-scale: 0}.zoom-out-\[0\.97\]{--tw-exit-scale: .97}.zoom-out-\[0\.98\]{--tw-exit-scale: .98}.slide-in-from-bottom{--tw-enter-translate-y: 100%}.slide-in-from-right{--tw-enter-translate-x: 100%}.slide-out-to-bottom{--tw-exit-translate-y: 100%}.slide-out-to-right{--tw-exit-translate-x: 100%}.\!duration-0{animation-duration:0s!important}.\!duration-100{animation-duration:.1s!important}.\!duration-150{animation-duration:.15s!important}.duration-0{animation-duration:0s}.duration-100{animation-duration:.1s}.duration-1000{animation-duration:1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.duration-75{animation-duration:75ms}.duration-normal{animation-duration:.15s}.duration-quick{animation-duration:75ms}.\!delay-0{animation-delay:0s!important}.\!delay-200{animation-delay:.2s!important}.delay-0{animation-delay:0s}.delay-100{animation-delay:.1s}.delay-1000{animation-delay:1s}.delay-150{animation-delay:.15s}.delay-200{animation-delay:.2s}.delay-500{animation-delay:.5s}.\!ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)!important}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-inExpo{animation-timing-function:cubic-bezier(.7,0,.84,0)}.ease-linear{animation-timing-function:linear}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.ease-outExpo{animation-timing-function:cubic-bezier(.16,1,.3,1)}.running{animation-play-state:running}.paused{animation-play-state:paused}.fill-mode-both{animation-fill-mode:both}.repeat-1{animation-iteration-count:1}.\@container{container-type:inline-size}.\@container\/banner{container-type:inline-size;container-name:banner}.\@container\/header{container-type:inline-size;container-name:header}.\@container\/main{container-type:inline-size;container-name:main}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-track-transparent{--scrollbar-track: transparent !important}:root{--font-thin: 100;--font-extralight: 200;--font-light: 300;--font-normal: 400;--font-semimedium: 475;--font-medium: 500;--font-semibold: 600;--font-bold: 700;--font-extrabold: 800;--font-black: 900;--font-thin-inverse: 75;--font-extralight-inverse: 175;--font-light-inverse: 275;--font-normal-inverse: 375;--font-semimedium-inverse: 450;--font-medium-inverse: 475;--font-semibold-inverse: 575;--font-bold-inverse: 675;--font-extrabold-inverse: 775;--font-black-inverse: 875}.font-thin{font-weight:var(--font-thin)}.font-extralight{font-weight:var(--font-extralight)}.font-light{font-weight:var(--font-light)}.\!font-normal{font-weight:var(--font-normal)!important}.font-normal{font-weight:var(--font-normal)}.font-semimedium{font-weight:var(--font-semimedium)}.\!font-medium{font-weight:var(--font-medium)!important}.font-medium{font-weight:var(--font-medium)}.font-semibold{font-weight:var(--font-semibold)}.font-bold{font-weight:var(--font-bold)}.font-extrabold{font-weight:var(--font-extrabold)}.\!font-editorial,.font-editorial{font-weight:var(--font-medium)!important}.\!font-editorial,.font-editorial{line-height:1.25}.\!font-editorial,.font-editorial{letter-spacing:-.025em}.\!font-editorial,.font-editorial{text-wrap:pretty}:is(.\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(.text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}[data-color-scheme=dark]{--font-thin: 75;--font-extralight: 175;--font-light: 275;--font-normal: 375;--font-semimedium: 450;--font-medium: 475;--font-semibold: 575;--font-bold: 675;--font-extrabold: 775;--font-black: 875;--font-thin-inverse: 100;--font-extralight-inverse: 200;--font-light-inverse: 300;--font-normal-inverse: 400;--font-semimedium-inverse: 475;--font-medium-inverse: 500;--font-semibold-inverse: 600;--font-bold-inverse: 700;--font-extrabold-inverse: 800;--font-black-inverse: 900}[data-color-scheme=dark] .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *,.reset,.reset *)){font-weight:inherit}[data-color-scheme=dark] .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit}[data-color-scheme=dark] .prose :where(blockquote p):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit}.\!\[--dog-bg-highlight\:currentColor\]{--dog-bg-highlight: currentColor !important}.\!\[--dot-bg\:\#1e293b\]{--dot-bg: #1e293b !important}.\!\[--dot-bg\:\#e10600\]{--dot-bg: #e10600 !important}.\!\[--dot-bg\:var\(--header-bg\,\#051224\)\]{--dot-bg: var(--header-bg,#051224) !important}.\!\[--dot-bg\:var\(--header-bg\,\#84754E\)\]{--dot-bg: var(--header-bg,#84754E) !important}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[-webkit-user-drag\:none\]{-webkit-user-drag:none}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.\[clip-path\:inset\(1px_1px_0px_1px\)\]{clip-path:inset(1px 1px 0px 1px)}.\[color-scheme\:none\]{color-scheme:none}.\[container-name\:tabbar\]{container-name:tabbar}.\[container-type\:inline-size\]{container-type:inline-size}.\[counter-increment\:list\]{counter-increment:list}.\[counter-reset\:list\]{counter-reset:list}.\[grid-area\:1\/-1\]{grid-area:1/-1}.\[grid-area\:actions\]{grid-area:actions}.\[grid-area\:email\]{grid-area:email}.\[grid-area\:role\]{grid-area:role}.\[grid-area\:scim\]{grid-area:scim}.\[grid-area\:status\]{grid-area:status}.\[grid-area\:tier\]{grid-area:tier}.\[grid-template-columns\:2fr_1fr_1fr\]{grid-template-columns:2fr 1fr 1fr}.\[margin-left\:max\(0px\,calc\(\(100\%-var\(--thread-content-width\)\)\/2-var\(--left-width\)-var\(--gap\)-var\(--scrollbar-gutter-offset\)\/2\)\)\]{margin-left:max(0px,calc((100% - var(--thread-content-width)) / 2 - var(--left-width) - var(--gap) - var(--scrollbar-gutter-offset) / 2))}.\[mask-image\:linear-gradient\(90deg\,black_0\,black_calc\(100\%-60px\)\,transparent_calc\(100\%-20px\)\,transparent_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%)}.\[mask-image\:linear-gradient\(90deg\,transparent_0\,transparent_20px\,black_60px\,black_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black 100%);mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black 100%)}.\[mask-image\:linear-gradient\(90deg\,transparent_0\,transparent_20px\,black_60px\,black_calc\(100\%-60px\)\,transparent_calc\(100\%-20px\)\,transparent_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%)}.\[mask-image\:linear-gradient\(to_bottom\,\#000_0\%\,transparent_160px\)\]{-webkit-mask-image:linear-gradient(to bottom,#000 0%,transparent 160px);mask-image:linear-gradient(to bottom,#000 0%,transparent 160px)}.\[mix-blend-mode\:overlay\]{mix-blend-mode:overlay}.\[overflow-clip-margin\:unset\]{overflow-clip-margin:unset}.\[overflow-wrap\:break-word\]{overflow-wrap:break-word}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[scrollbar-width\:thin\]{scrollbar-width:thin}.\[stroke-width\:1\.5\]{stroke-width:1.5}.\[word-break\:break-word\]{word-break:break-word}.\[word-spacing\:4px\]{word-spacing:4px}html{min-height:100%;font-size:16px;overflow-y:auto;scrollbar-width:15px;font-weight:400;letter-spacing:.005em}[data-color-scheme=dark]{color-scheme:dark;font-weight:375;letter-spacing:.01em}body{margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-synthesis:none}.interactable{cursor:pointer}.interactable:focus{outline:2px solid transparent;outline-offset:2px}.interactable: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);--tw-ring-color: oklch(var(--super-color) / .8);--tw-ring-offset-width: 2px;--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.interactable-alt{cursor:pointer;position:relative}.interactable-alt:before{pointer-events:none;position:absolute;inset:.5rem;border-radius:inherit;--tw-content: "";content:var(--tw-content)}.interactable-alt:focus{outline:2px solid transparent;outline-offset:2px}.interactable-alt: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(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);--tw-ring-color: transparent;--tw-ring-offset-color: transparent}.interactable-alt:focus-visible:before{--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);--tw-ring-color: oklch(var(--super-color) / .8);--tw-ring-offset-width: 2px;content:var(--tw-content);--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}code,.ace_placeholder.ace_comment{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace}:is(code,.font-mono),:is(.ace_placeholder.ace_comment,.font-mono){font-synthesis:none}.katex{-webkit-font-smoothing:auto;max-width:100%;overflow:auto hidden;-ms-overflow-style:none;scrollbar-width:none}.katex::-webkit-scrollbar{display:none}[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}.codeWrapper code>span{-webkit-user-select:auto!important;-moz-user-select:auto!important;user-select:auto!important}.codeWrapper code{width:100%}.codeWrapper code span{font-style:normal!important}.codeWrapper code span{padding:0!important}.hideScroll{-ms-overflow-style:none;scrollbar-width:none}.hideScroll::-webkit-scrollbar{display:none}.scrollbar-subtle{--scrollbar-thumb: oklch(var(--foreground-color) / .15)}.scrollbar-subtle{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-subtle::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-subtle::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-subtle::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-subtle::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-subtle::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-subtle::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-subtle::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-subtle::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-subtle::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-subtle::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-subtle{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-subtle::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-subtle{--scrollbar-track: transparent}.tabler-icon{stroke-width:1.75}.citation-nbsp:before{content:" "}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}}html[data-color-scheme=dark] .dark\:prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.\*\:size-full>*{width:100%;height:100%}.\*\:w-20>*{width:5rem}.\*\:w-full>*{width:100%}.marker\:text-quiet *::marker{color:oklch(var(--foreground-quiet-color))}.marker\:text-quiet::marker{color:oklch(var(--foreground-quiet-color))}.selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/30 *::-moz-selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/30 *::selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/50 *::-moz-selection{background-color:oklch(var(--super-color) / .5)}.selection\:bg-super\/50 *::selection{background-color:oklch(var(--super-color) / .5)}.selection\:text-foreground *::-moz-selection{color:oklch(var(--foreground-color))}.selection\:text-foreground *::selection{color:oklch(var(--foreground-color))}.selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/30::-moz-selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/30::selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/50::-moz-selection{background-color:oklch(var(--super-color) / .5)}.selection\:bg-super\/50::selection{background-color:oklch(var(--super-color) / .5)}.selection\:text-foreground::-moz-selection{color:oklch(var(--foreground-color))}.selection\:text-foreground::selection{color:oklch(var(--foreground-color))}.selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.placeholder\:select-none::-moz-placeholder{-moz-user-select:none;-webkit-user-select:none;user-select:none}.placeholder\:select-none::placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none}.placeholder\:text-\[2\.4rem\]::-moz-placeholder{font-size:2.4rem}.placeholder\:text-\[2\.4rem\]::placeholder{font-size:2.4rem}.placeholder\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.placeholder\:text-base::placeholder{font-size:1rem;line-height:1.5rem}.placeholder\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-xs::placeholder{font-size:.75rem;line-height:1rem}.placeholder\:\!text-quietest::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder\:\!text-quietest::placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder\:text-quiet::-moz-placeholder{color:oklch(var(--foreground-quiet-color))}.placeholder\:text-quiet::placeholder{color:oklch(var(--foreground-quiet-color))}.placeholder\:text-quieter::-moz-placeholder{color:oklch(var(--foreground-quieter-color))}.placeholder\:text-quieter::placeholder{color:oklch(var(--foreground-quieter-color))}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:inset-0:before{content:var(--tw-content);inset:0}.before\:inset-x-\[-10px\]:before{content:var(--tw-content);left:-10px;right:-10px}.before\:inset-y-0:before{content:var(--tw-content);top:0;bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:left-1\/2:before{content:var(--tw-content);left:50%}.before\:left-\[50\%\]:before{content:var(--tw-content);left:50%}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-1\/2:before{content:var(--tw-content);top:50%}.before\:top-\[50\%\]:before{content:var(--tw-content);top:50%}.before\:top-\[6px\]:before{content:var(--tw-content);top:6px}.before\:size-1:before{content:var(--tw-content);width:.25rem;height:.25rem}.before\:size-1\.5:before{content:var(--tw-content);width:.375rem;height:.375rem}.before\:size-full:before{content:var(--tw-content);width:100%;height:100%}.before\:h-\[100\%\]:before{content:var(--tw-content);height:100%}.before\:min-h-\[10px\]:before{content:var(--tw-content);min-height:10px}.before\:w-\[100\%\]:before{content:var(--tw-content);width:100%}.before\:min-w-\[10px\]:before{content:var(--tw-content);min-width:10px}.before\:-translate-x-1\/2:before{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))}.before\:-translate-y-1\/2:before{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))}.before\:translate-x-\[-50\%\]:before{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))}.before\:translate-y-\[-50\%\]:before{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))}.before\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\:rounded-md:before{content:var(--tw-content);border-radius:.375rem}.before\:border:before{content:var(--tw-content);border-width:1px}.before\:border-r:before{content:var(--tw-content);border-right-width:1px}.before\:border-dashed:before{content:var(--tw-content);border-style:dashed}.before\:border-\[rgba\(0\,0\,0\,0\.1\)\]:before{content:var(--tw-content);border-color:#0000001a}.before\:border-subtlest:before{content:var(--tw-content);border-color:oklch(var(--foreground-subtlest-color))}.before\:bg-\[\#105C67\]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(16 92 103 / var(--tw-bg-opacity))}.before\:bg-base:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}.before\:opacity-0:before{content:var(--tw-content);opacity:0}.before\:opacity-20:before{content:var(--tw-content);opacity:.2}.before\:ring-4:before{content:var(--tw-content);--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(4px + 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)}.before\:ring-\[1\.5px\]:before{content:var(--tw-content);--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(1.5px + 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)}.before\:ring-super\/10:before{content:var(--tw-content);--tw-ring-color: oklch(var(--super-color) / .1)}.before\:ring-super\/50:before{content:var(--tw-content);--tw-ring-color: oklch(var(--super-color) / .5)}.before\:transition-opacity:before{content:var(--tw-content);transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.before\:duration-150:before{content:var(--tw-content);transition-duration:.15s}.before\:content-\[\'\'\]:before{--tw-content: "";content:var(--tw-content)}.before\:duration-150:before{content:var(--tw-content);animation-duration:.15s}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-0:after{content:var(--tw-content);inset:0}.after\:inset-\[-1px\]:after{content:var(--tw-content);inset:-1px}.after\:left-two:after{content:var(--tw-content);left:2px}.after\:top-\[24px\]:after{content:var(--tw-content);top:24px}.after\:z-\[1\]:after{content:var(--tw-content);z-index:1}.after\:clear-both:after{content:var(--tw-content);clear:both}.after\:block:after{content:var(--tw-content);display:block}.after\:h-full:after{content:var(--tw-content);height:100%}.after\:w-two:after{content:var(--tw-content);width:2px}.after\:-translate-y-half:after{content:var(--tw-content);--tw-translate-y: -.5px;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))}.after\:rounded:after{content:var(--tw-content);border-radius:.25rem}.after\:rounded-inherit:after{content:var(--tw-content);border-radius:inherit}.after\:rounded-lg:after{content:var(--tw-content);border-radius:.5rem}.after\:rounded-md:after{content:var(--tw-content);border-radius:.375rem}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-\[rgba\(0\,0\,0\,0\.08\)\]:after{content:var(--tw-content);border-color:#00000014}.after\:border-black\/10:after{content:var(--tw-content);border-color:#0000001a}.after\:border-black\/5:after{content:var(--tw-content);border-color:#0000000d}.after\:border-foreground:after{content:var(--tw-content);border-color:oklch(var(--foreground-color))}.after\:border-super\/30:after{content:var(--tw-content);border-color:oklch(var(--super-color) / .3)}.after\:bg-super:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.after\:opacity-50:after{content:var(--tw-content);opacity:.5}.after\:shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;--tw-shadow-colored: inset 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)}.after\:ring-1:after{content:var(--tw-content);--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)}.after\:ring-inset:after{content:var(--tw-content);--tw-ring-inset: inset}.after\:ring-subtler:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtler-color))}.after\:ring-subtlest:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtlest-color))}.after\:ring-opacity-50:after{content:var(--tw-content);--tw-ring-opacity: .5}.after\:content-\[\"\"\]:after{--tw-content: "";content:var(--tw-content)}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.after\:\[content\:counters\(list\,\"\.\"\)\]:after{content:counters(list,".")}.first\:-mt-sm:first-child{margin-top:calc(var(--size-sm) * -1)}.first\:ml-0:first-child{margin-left:0}.first\:mt-0:first-child{margin-top:0}.first\:mt-1:first-child{margin-top:.25rem}.first\:mt-xs:first-child{margin-top:var(--size-xs)}.first\:hidden:first-child{display:none}.first\:border-y:first-child{border-top-width:1px;border-bottom-width:1px}.first\:border-b-0:first-child{border-bottom-width:0px}.first\:border-solid:first-child{border-style:solid}.first\:pl-0:first-child{padding-left:0}.first\:pl-md:first-child{padding-left:var(--size-md)}.first\:pt-0:first-child{padding-top:0}.first\:pt-md:first-child{padding-top:var(--size-md)}.last\:-mr-two:last-child{margin-right:-2px}.last\:mb-0:last-child{margin-bottom:0}.last\:mr-0:last-child{margin-right:0}.last\:hidden:last-child{display:none}.last\:border-0:last-child{border-width:0px}.last\:border-b:last-child{border-bottom-width:1px}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:border-r-0:last-child{border-right-width:0px}.last\:border-none:last-child{border-style:none}.last\:border-b-subtlest:last-child{border-bottom-color:oklch(var(--foreground-subtlest-color))}.last\:px-sm:last-child{padding-left:var(--size-sm);padding-right:var(--size-sm)}.last\:pb-0:last-child{padding-bottom:0}.last\:pr-0:last-child{padding-right:0}.last\:pr-md:last-child{padding-right:var(--size-md)}.last\:pr-xs:last-child{padding-right:var(--size-xs)}.last\:before\:hidden:last-child:before{content:var(--tw-content);display:none}.last\:after\:\[background\:linear-gradient\(0deg\,rgba\(31\,184\,205\,0\)_0\%\,\#105C67_100\%\)\]:last-child:after{content:var(--tw-content);background:linear-gradient(0deg,#1fb8cd00,#105c67)}.odd\:bg-subtler:nth-child(odd){background-color:oklch(var(--background-subtler-color))}.even\:bg-subtlest:nth-child(2n){background-color:oklch(var(--background-subtlest-color))}.empty\:hidden:empty{display:none}.empty\:bg-subtler:empty{background-color:oklch(var(--background-subtler-color))}.focus-within\:pointer-events-auto:focus-within{pointer-events:auto}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:\!border-subtler:focus-within{border-color:oklch(var(--foreground-subtler-color))!important}.focus-within\:\!border-super:focus-within{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.focus-within\:border-subtler:focus-within{border-color:oklch(var(--foreground-subtler-color))}.focus-within\:border-super:focus-within{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.focus-within\:opacity-100:focus-within{opacity:1}.focus-within\:\!ring-transparent:focus-within{--tw-ring-color: transparent !important}.group\/column:first-child .group-first\/column\:hidden,.group:first-child .group-first\:hidden{display:none}.group:first-child .group-first\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.group\/singleTeamGroup:first-child .group-first\/singleTeamGroup\:pt-0{padding-top:0}.group\/goal:first-child .group-first\/goal\:opacity-0{opacity:0}.group:last-child .group-last\:-mb-sm{margin-bottom:calc(var(--size-sm) * -1)}.group\/cell:last-child .group-last\/cell\:hidden{display:none}.group\/column:last-child .group-last\/column\:hidden{display:none}.group\/li:last-child .group-last\/li\:hidden{display:none}.group:last-child .group-last\:rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.group:last-child .group-last\:rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.group:last-child .group-last\:border-b-0{border-bottom-width:0px}.group\/goal:last-child .group-last\/goal\:pb-0{padding-bottom:0}.group:last-child .group-last\:pb-0{padding-bottom:0}.group\/goal:last-child .group-last\/goal\:opacity-0{opacity:0}.group\/singleTeamGroup:last-child .group-last\/singleTeamGroup\:last\:border-b-0:last-child{border-bottom-width:0px}.group\/table:last-child .group-last\/table\:last\:border-b-0:last-child{border-bottom-width:0px}.group\/goal:only-child .group-only\/goal\:opacity-0{opacity:0}.group:nth-child(odd) .group-odd\:border-r{border-right-width:1px}.group\/matchup:nth-child(2n) .group-even\/matchup\:bottom-1\/2{bottom:50%}.group\/matchup:nth-child(2n) .group-even\/matchup\:top-auto{top:auto}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-bl-md{border-bottom-left-radius:.375rem}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-br-md{border-bottom-right-radius:.375rem}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-tl-none{border-top-left-radius:0}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-tr-none{border-top-right-radius:0}.group\/matchup:nth-child(2n) .group-even\/matchup\:border-b-2{border-bottom-width:2px}.group\/matchup:nth-child(2n) .group-even\/matchup\:border-t-0{border-top-width:0px}.group:nth-child(2n) .group-even\:border-r-0{border-right-width:0px}.group:hover .group-hover\:pointer-events-auto{pointer-events:auto}.group:hover .group-hover\:-ml-sm{margin-left:calc(var(--size-sm) * -1)}.group:hover .group-hover\:-ml-xs{margin-left:calc(var(--size-xs) * -1)}.group:hover .group-hover\:block{display:block}.group\/step-card:hover .group-hover\/step-card\:inline-flex{display:inline-flex}.group:hover .group-hover\:shrink-0{flex-shrink:0}.group:hover .group-hover\:basis-auto{flex-basis:auto}.group\/source:hover .group-hover\/source\:translate-x-\[12px\]{--tw-translate-x: 12px;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\/source:hover .group-hover\/source\:translate-x-\[6px\]{--tw-translate-x: 6px;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\/source:hover .group-hover\/source\:translate-x-\[8px\]{--tw-translate-x: 8px;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:hover .group-hover\:-translate-y-1{--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))}.group:hover .group-hover\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;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:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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:hover .group-hover\:scale-\[1\.02\]{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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:hover .group-hover\:scale-\[unset\]{--tw-scale-x: unset;--tw-scale-y: unset;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:hover .group-hover\:scale-x-\[250\%\]{--tw-scale-x: 250%;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\/language-learning:hover .group-hover\/language-learning\:border-foreground{border-color:oklch(var(--foreground-color))}.group:hover .group-hover\:\!border-subtle{border-color:oklch(var(--foreground-subtle-color))!important}.group:hover .group-hover\:\!border-super{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.group\/tab:hover .group-hover\/tab\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.group:hover .group-hover\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.group:hover .group-hover\:\!bg-transparent{background-color:transparent!important}.group:hover .group-hover\:bg-\[var\(--dot-color\)\]{background-color:var(--dot-color)}.group:hover .group-hover\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.group:hover .group-hover\:bg-subtler{background-color:oklch(var(--background-subtler-color))}.group:hover .group-hover\:bg-super{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.group:hover .group-hover\:bg-transparent{background-color:transparent}.group:hover .group-hover\:fill-super{fill:oklch(var(--super-color) / 1)}.group:hover .group-hover\:stroke-super{stroke:oklch(var(--super-color) / 1)}.group\/link:hover .group-hover\/link\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group\/post:hover .group-hover\/post\:text-foreground{color:oklch(var(--foreground-color))}.group\/row:hover .group-hover\/row\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group\/segmented-control:hover .group-hover\/segmented-control\:text-foreground{color:oklch(var(--foreground-color))}.group\/step-card:hover .group-hover\/step-card\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group:hover .group-hover\:\!text-foreground{color:oklch(var(--foreground-color))!important}.group:hover .group-hover\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group:hover .group-hover\:text-foreground{color:oklch(var(--foreground-color))}.group:hover .group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}.group:hover .group-hover\:text-quiet{color:oklch(var(--foreground-quiet-color))}.group:hover .group-hover\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group\/link:hover .group-hover\/link\:underline,.group\/source:hover .group-hover\/source\:underline,.group:hover .group-hover\:underline{text-decoration-line:underline}.group:hover .group-hover\:decoration-\[var\(--mode-color\)\]{text-decoration-color:var(--mode-color)}.group:hover .group-hover\:decoration-transparent{text-decoration-color:transparent}.group\/button:hover .group-hover\/button\:opacity-100,.group\/card:hover .group-hover\/card\:opacity-100,.group\/header:hover .group-hover\/header\:opacity-100,.group\/image:hover .group-hover\/image\:opacity-100{opacity:1}.group\/link:hover .group-hover\/link\:opacity-75{opacity:.75}.group\/notification-list-item:hover .group-hover\/notification-list-item\:opacity-0{opacity:0}.group\/notification-list-item:hover .group-hover\/notification-list-item\:opacity-100,.group\/section:hover .group-hover\/section\:opacity-100,.group\/sidebar-menu-header:hover .group-hover\/sidebar-menu-header\:opacity-100,.group\/step-card:hover .group-hover\/step-card\:opacity-100,.group\/tab:hover .group-hover\/tab\:opacity-100{opacity:1}.group:hover .group-hover\:\!opacity-0{opacity:0!important}.group:hover .group-hover\:opacity-0{opacity:0}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-15{opacity:.15}.group:hover .group-hover\:opacity-50{opacity:.5}.group:hover .group-hover\:opacity-60{opacity:.6}.group:hover .group-hover\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-90{opacity:.9}.group:hover .group-hover\: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)}.group:hover .group-hover\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}.group:hover .group-hover\:grayscale-0{--tw-grayscale: grayscale(0);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)}.group:hover .group-hover\:delay-300{transition-delay:.3s}.group:hover .group-hover\:mask-fade-r-\[84px\,42px\]{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 84px),transparent calc(100% - 42px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 84px),transparent calc(100% - 42px),transparent 100%)}.group:hover .group-hover\:delay-300{animation-delay:.3s}:is(.group:hover .group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}.group\/segmented-control:focus-visible .group-focus-visible\/segmented-control\:border-dashed{border-style:dashed}.group:active .group-active\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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:active .group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}.group\/language-learning:active .group-active\/language-learning\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.group:active .group-active\:opacity-50{opacity:.5}.group:active .group-active\:opacity-70{opacity:.7}.group:nth-child(2n):nth-last-child(-n+3)~a .group-\[\&\:nth-child\(2n\)\:nth-last-child\(-n\+3\)\~a\]\:border-b-0{border-bottom-width:0px}.group:nth-child(3n):nth-last-child(-n+4)~a .group-\[\&\:nth-child\(3n\)\:nth-last-child\(-n\+4\)\~a\]\:border-b-0{border-bottom-width:0px}.group:nth-child(3n) .group-\[\&\:nth-child\(3n\)\]\:border-r-0{border-right-width:0px}.has-\[a\:hover\]\:bg-transparent:has(a:hover){background-color:transparent}.aria-selected\:bg-subtler[aria-selected=true]{background-color:oklch(var(--background-subtler-color))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[placement\=bottom-end\]\:origin-top-right[data-placement=bottom-end]{transform-origin:top right}.data-\[placement\=bottom-start\]\:origin-top-left[data-placement=bottom-start]{transform-origin:top left}.data-\[placement\=top-end\]\:origin-bottom-right[data-placement=top-end]{transform-origin:bottom right}.data-\[placement\=top-start\]\:origin-bottom-left[data-placement=top-start]{transform-origin:bottom left}.data-\[state\=checked\]\:translate-x-\[10px\][data-state=checked]{--tw-translate-x: 10px;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-\[14px\][data-state=checked]{--tw-translate-x: 14px;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-\[18px\][data-state=checked]{--tw-translate-x: 18px;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 fadeOut{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fadeOut[data-state=closed]{animation:fadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes scaleAndFadeOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.97)}}.data-\[state\=closed\]\:animate-scaleAndFadeOut[data-state=closed]{animation:scaleAndFadeOut .15s cubic-bezier(.7,0,.84,0) forwards}@keyframes slideDownAndFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(3px)}}.data-\[state\=closed\]\:animate-slideDownAndFadeOut[data-state=closed]{animation:slideDownAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideLeft{0%{transform:translateZ(0) translate(0)}to{transform:translateZ(0) translate(-100%)}}.data-\[state\=closed\]\:animate-slideLeft[data-state=closed]{animation:slideLeft .2s cubic-bezier(.25,.1,.25,1) forwards}@keyframes slideLeftAndFadeOut{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-3px)}}.data-\[state\=closed\]\:animate-slideLeftAndFadeOut[data-state=closed]{animation:slideLeftAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideRightAndFadeOut{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(3px)}}.data-\[state\=closed\]\:animate-slideRightAndFadeOut[data-state=closed]{animation:slideRightAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideUpAndFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-3px)}}.data-\[state\=closed\]\:animate-slideUpAndFadeOut[data-state=closed]{animation:slideUpAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.data-\[state\=delayed-open\]\:animate-slideDownAndFadeIn[data-state=delayed-open]{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideLeftAndFadeIn[data-state=delayed-open]{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideRightAndFadeIn[data-state=delayed-open]{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideUpAndFadeIn[data-state=delayed-open]{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fadeIn[data-state=open]{animation:fadeIn .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes scaleAndFadeIn{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.data-\[state\=open\]\:animate-scaleAndFadeIn[data-state=open]{animation:scaleAndFadeIn .15s cubic-bezier(.16,1,.3,1)}@keyframes slideDownAndFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.data-\[state\=open\]\:animate-slideDownAndFadeIn[data-state=open]{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideLeftAndFadeIn{0%{opacity:0;transform:translate(3px)}to{opacity:1;transform:translate(0)}}.data-\[state\=open\]\:animate-slideLeftAndFadeIn[data-state=open]{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideRight{0%{transform:translateZ(0) translate(-100%)}to{transform:translateZ(0) translate(0)}}.data-\[state\=open\]\:animate-slideRight[data-state=open]{animation:slideRight .2s cubic-bezier(.25,.1,.25,1) forwards}@keyframes slideRightAndFadeIn{0%{opacity:0;transform:translate(-3px)}to{opacity:1;transform:translate(0)}}.data-\[state\=open\]\:animate-slideRightAndFadeIn[data-state=open]{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideUpAndFadeIn{0%{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}.data-\[state\=open\]\:animate-slideUpAndFadeIn[data-state=open]{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=closed\]\:border-subtler[data-state=closed]{border-color:oklch(var(--foreground-subtler-color))}.data-\[state\=open\]\:border-subtle[data-state=open]{border-color:oklch(var(--foreground-subtle-color))}.data-\[state\=open\]\:border-super[data-state=open]{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.data-\[focused\=self\]\:bg-subtler[data-focused=self],.data-\[highlighted\]\:bg-subtler[data-highlighted]{background-color:oklch(var(--background-subtler-color))}.data-\[state\=open\]\:bg-subtle[data-state=open]{background-color:oklch(var(--background-subtle-color))}.data-\[state\=open\]\:bg-subtler[data-state=open]{background-color:oklch(var(--background-subtler-color))}.data-\[state\=on\]\:text-foreground[data-state=on],.data-\[state\=open\]\:text-foreground[data-state=open]{color:oklch(var(--foreground-color))}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=inactive\]\:opacity-80[data-state=inactive],.data-\[state\=open\]\:opacity-80[data-state=open]{opacity:.8}.data-\[state\=visible\]\:opacity-100[data-state=visible]{opacity:1}.group\/tooltip-content[data-side=bottom] .group-data-\[side\=\"bottom\"\]\/tooltip-content\:top-0{top:0}.group\/tooltip-content[data-side=top] .group-data-\[side\=\"top\"\]\/tooltip-content\:bottom-0{bottom:0}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}.group[data-focused=other] .group-data-\[focused\=other\]\:opacity-0{opacity:0}.group[data-focused=self] .group-data-\[focused\=self\]\:opacity-100{opacity:1}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:border-l-2:first-child{border-left-width:2px}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:border-l-super:first-child{--tw-border-opacity: 1;border-left-color:oklch(var(--super-color) / var(--tw-border-opacity))}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:pl-xs:first-child{padding-left:var(--size-xs)}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:last\:border-r-2:last-child{border-right-width:2px}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:last\:pr-xs:last-child{padding-right:var(--size-xs)}[data-erp=tab] .erp-tab\:top-headerHeight{top:var(--header-height)}[data-erp=tab] .erp-tab\:gap-0{gap:0px}[data-erp=tab] .erp-tab\:rounded-none{border-radius:0}[data-erp=tab] .erp-tab\:p-0{padding:0}[data-erp=sidecar] .erp-sidecar\:fixed{position:fixed}[data-erp=sidecar] .erp-sidecar\:top-\[114px\]{top:114px}[data-erp=sidecar] .erp-sidecar\:h-fit{height:-moz-fit-content;height:fit-content}[data-erp=sidecar] .erp-sidecar\:min-h-\[var\(--sidecar-content-height\)\]{min-height:var(--sidecar-content-height)}[data-erp=sidecar] .erp-sidecar\:w-full{width:100%}[data-erp=sidecar] .erp-sidecar\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}[data-erp=sidecar] .erp-sidecar\:pb-0{padding-bottom:0}[data-erp=sidecar] .erp-sidecar\:pt-0{padding-top:0}[data-erp=mobile-sidecar] .erp-mobile-sidecar\:min-h-\[var\(--mobile-sidecar-content-height\)\]{min-height:var(--mobile-sidecar-content-height)}[data-erp=mobile-sidecar] .erp-mobile-sidecar\:pt-0{padding-top:0}@media (pointer: coarse){.pointer-coarse\:opacity-100{opacity:1}}.prose-p\:my-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-p\:mb-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:.5rem}.prose-p\:pt-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:0}.prose-strong\:font-medium :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500;font-weight:var(--font-medium)}@container (min-width: 20rem){.\@xs\:ml-7{margin-left:1.75rem}.\@xs\:size-4{width:1rem;height:1rem}.\@xs\:w-20{width:5rem}.\@xs\:flex-row{flex-direction:row}.\@xs\:gap-3{gap:.75rem}.\@xs\:gap-sm{gap:var(--size-sm)}.\@xs\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.\@xs\:pb-md{padding-bottom:var(--size-md)}.\@xs\:pt-3{padding-top:.75rem}.\@xs\:text-sm{font-size:.875rem;line-height:1.25rem}}@container (min-width: 24rem){.\@sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container banner (min-width: 28rem){.\@md\/banner\:ml-auto{margin-left:auto}.\@md\/banner\:mr-sm{margin-right:var(--size-sm)}.\@md\/banner\:w-auto{width:auto}.\@md\/banner\:flex-\[1_1_60\%\]{flex:1 1 60%}.\@md\/banner\:flex-row{flex-direction:row}.\@md\/banner\:flex-row-reverse{flex-direction:row-reverse}.\@md\/banner\:flex-wrap{flex-wrap:wrap}.\@md\/banner\:items-center{align-items:center}.\@md\/banner\:justify-end{justify-content:flex-end}.\@md\/banner\:gap-md{gap:var(--size-md)}.\@md\/banner\:gap-sm{gap:var(--size-sm)}.\@md\/banner\:py-3{padding-top:.75rem;padding-bottom:.75rem}}@container (min-width: 28rem){.\@md\:w-\[570px\]{width:570px}}@container (min-width: 32rem){.\@lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width: 36px){.\@\[36px\]\:block{display:block}}@container (min-width: 42rem){.\@2xl\:flex-\[2\]{flex:2}.\@2xl\:flex-\[3\]{flex:3}.\@2xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\@2xl\:flex-row{flex-direction:row}.\@2xl\:gap-sm{gap:var(--size-sm)}}@container (min-width: 28rem){@container (min-width: 1458px){.\@md\:\@\[1458px\]\:w-full{width:100%}}}@container (min-width: 370px){.\@\[370px\]\:aspect-\[1\.38\]{aspect-ratio:1.38}.\@\[370px\]\:h-auto{height:auto}.\@\[370px\]\:w-\[var\(--image-width-large\)\]{width:var(--image-width-large)}}@container (min-width: 420px){.\@\[420px\]\:ml-auto{margin-left:auto}.\@\[420px\]\:block{display:block}.\@\[420px\]\:hidden{display:none}.\@\[420px\]\:h-full{height:100%}.\@\[420px\]\:w-\[128px\]{width:128px}.\@\[420px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\@\[420px\]\:flex-row{flex-direction:row}.\@\[420px\]\:items-end{align-items:flex-end}.\@\[420px\]\:gap-md{gap:var(--size-md)}}@container (min-width: 480px){.\@\[480px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container (min-width: 600px){.\@\[600px\]\:col-span-1{grid-column:span 1 / span 1}.\@\[600px\]\:h-full{height:100%}.\@\[600px\]\:grid-cols-\[17\%_46\%_1fr\]{grid-template-columns:17% 46% 1fr}}@container (min-width: 640px){.\@\[640px\]\:col-span-2{grid-column:span 2 / span 2}.\@\[640px\]\:block{display:block}.\@\[640px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width: 700px){.\@\[700px\]\:inset-y-0{top:0;bottom:0}.\@\[700px\]\:left-0{left:0}.\@\[700px\]\:right-auto{right:auto}.\@\[700px\]\:w-\[var\(--card-width\)\]{width:var(--card-width)}.\@\[700px\]\:w-full{width:100%}.\@\[700px\]\:grid-cols-\[120px_320px_1fr\]{grid-template-columns:120px 320px 1fr}.\@\[700px\]\:flex-col{flex-direction:column}.\@\[700px\]\:overflow-y-auto{overflow-y:auto}.\@\[700px\]\:overflow-x-visible{overflow-x:visible}.\@\[700px\]\:p-2\.5{padding:.625rem}}@container (min-width: 900px){.\@\[900px\]\:block{display:block}.\@\[900px\]\:hidden{display:none}.\@\[900px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container main (min-width: 1100px){.\@\[1100px\]\/main\:max-w-\[80px\]{max-width:80px}}@container main (min-width: 1200px){.\@\[1200px\]\/main\:max-w-\[160px\]{max-width:160px}}.hover\:-translate-x-1:hover{--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))}.hover\:-translate-y-1:hover{--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))}.hover\:translate-y-0:hover{--tw-translate-y: 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))}.hover\:translate-y-0\.5:hover{--tw-translate-y: .125rem;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\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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\:scale-\[1\.01\]:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;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\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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\:transform:hover{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\:cursor-pointer:hover{cursor:pointer}.hover\:rounded-lg:hover{border-radius:.5rem}.hover\:\!border-none:hover{border-style:none!important}.hover\:\!border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))!important}.hover\:\!border-subtlest:hover{border-color:oklch(var(--foreground-subtlest-color))!important}.hover\:\!border-transparent:hover{border-color:transparent!important}.hover\:border-caution\/20:hover{border-color:oklch(var(--caution-color) / .2)}.hover\:border-offset:hover{border-color:oklch(var(--offset-color))}.hover\:border-subtle:hover{border-color:oklch(var(--foreground-subtle-color))}.hover\:border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))}.hover\:border-super:hover{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.hover\:border-super\/30:hover{border-color:oklch(var(--super-color) / .3)}.hover\:border-super\/50:hover{border-color:oklch(var(--super-color) / .5)}.hover\:border-super\/75:hover{border-color:oklch(var(--super-color) / .75)}.hover\:\!bg-black\/80:hover{background-color:#000c!important}.hover\:\!bg-black\/90:hover{background-color:#000000e6!important}.hover\:\!bg-caution:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--caution-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-inverse\/5:hover{background-color:oklch(var(--background-inverse-color) / .05)!important}.hover\:\!bg-max:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-subtler:hover{background-color:oklch(var(--background-subtler-color))!important}.hover\:\!bg-super:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-super\/10:hover{background-color:oklch(var(--super-color) / .1)!important}.hover\:\!bg-transparent:hover{background-color:transparent!important}.hover\:\!bg-white\/10:hover{background-color:#ffffff1a!important}.hover\:\!bg-white\/90:hover{background-color:#ffffffe6!important}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-caution\/30:hover{background-color:oklch(var(--caution-color) / .3)}.hover\:bg-caution\/5:hover{background-color:oklch(var(--caution-color) / .05)}.hover\:bg-negative\/20:hover{background-color:oklch(var(--negative-color) / .2)}.hover\:bg-offset:hover{background-color:oklch(var(--offset-color))}.hover\:bg-positive\/20:hover{background-color:oklch(var(--positive-color) / .2)}.hover\:bg-raised:hover{background-color:oklch(var(--background-raised-color))}.hover\:bg-raisedOffset:hover{background-color:oklch(var(--raised-offset-color))}.hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}.hover\:bg-subtler:hover{background-color:oklch(var(--background-subtler-color))}.hover\:bg-subtlest:hover{background-color:oklch(var(--background-subtlest-color))}.hover\:bg-super:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.hover\:bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)}.hover\:bg-super\/90:hover{background-color:oklch(var(--super-color) / .9)}.hover\:bg-superBG:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.hover\:bg-gradient-to-b:hover{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.hover\:from-\[oklch\(var\(--hydra-450\)\)\]:hover{--tw-gradient-from: oklch(var(--hydra-450)) 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)}.hover\:to-\[oklch\(var\(--hydra-450\)\/0\.2\)\]:hover{--tw-gradient-to: oklch(var(--hydra-450)/.2) var(--tw-gradient-to-position)}.hover\:\!text-quiet:hover{color:oklch(var(--foreground-quiet-color))!important}.hover\:\!text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:\!text-white\/80:hover{color:#fffc!important}.hover\:text-caution:hover{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}.hover\:text-foreground:hover{color:oklch(var(--foreground-color))}.hover\:text-negative:hover{--tw-text-opacity: 1;color:oklch(var(--negative-color) / var(--tw-text-opacity))}.hover\:text-positive:hover{--tw-text-opacity: 1;color:oklch(var(--positive-color) / var(--tw-text-opacity))}.hover\:text-quiet:hover{color:oklch(var(--foreground-quiet-color))}.hover\:text-super:hover{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:decoration-super:hover{text-decoration-color:oklch(var(--super-color) / 1)}.hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}.hover\:decoration-transparent:hover{text-decoration-color:transparent}.hover\:underline-offset-\[7px\]:hover{text-underline-offset:7px}.hover\:\!opacity-100:hover{opacity:1!important}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-40:hover{opacity:.4}.hover\:opacity-50:hover{opacity:.5}.hover\:opacity-60:hover{opacity:.6}.hover\:opacity-70:hover{opacity:.7}.hover\:opacity-75:hover{opacity:.75}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-85:hover{opacity:.85}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow:hover{--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)}.hover\:shadow-2xl:hover{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px 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-sm:hover{--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)}.hover\:shadow-subtle:hover{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.hover\:\!outline-none:hover{outline:2px solid transparent!important;outline-offset:2px!important}.hover\:\!ring-0:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.hover\:ring-1:hover{--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)}.hover\:ring-2:hover{--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)}.hover\:\!ring-transparent:hover{--tw-ring-color: transparent !important}.hover\:ring-subtle:hover{--tw-ring-color: oklch(var(--foreground-subtle-color))}.hover\:ring-super:hover{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.hover\:\!transition-none:hover{transition-property:none!important}.hover\:transition-none:hover{transition-property:none}.hover\:after\:ring-subtler:hover:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtler-color))}.data-\[state\=open\]\:hover\:border-super:hover[data-state=open]{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.hover\:data-\[focused\=other\]\:bg-raised[data-focused=other]:hover{background-color:oklch(var(--background-raised-color))}.data-\[state\=inactive\]\:hover\:opacity-100:hover[data-state=inactive]{opacity:1}.focus\:\!border-none:focus{border-style:none!important}.focus\:\!border-super:focus{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.focus\:\!border-transparent:focus{border-color:transparent!important}.focus\:border-subtle:focus{border-color:oklch(var(--foreground-subtle-color))}.focus\:border-subtler:focus{border-color:oklch(var(--foreground-subtler-color))}.focus\:border-super:focus{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.focus\:border-transparent:focus{border-color:transparent}.focus\:text-super:focus{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.focus\:underline:focus{text-decoration-line:underline}.focus\:\!outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:\!ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus\:ring-0: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(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)}.focus\: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)}.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-transparent:focus{--tw-ring-color: transparent !important}.focus\:ring-subtler:focus{--tw-ring-color: oklch(var(--foreground-subtler-color))}.focus\:ring-super:focus{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.focus\:ring-transparent:focus{--tw-ring-color: transparent}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:rounded-lg:focus-visible{border-radius:.5rem}.focus-visible\:\!border-subtlest:focus-visible{border-color:oklch(var(--foreground-subtlest-color))!important}.focus-visible\:\!bg-transparent:focus-visible{background-color:transparent!important}.focus-visible\:bg-subtle:focus-visible{background-color:oklch(var(--background-subtle-color))}.focus-visible\:bg-subtler:focus-visible{background-color:oklch(var(--background-subtler-color))}.focus-visible\:bg-transparent:focus-visible{background-color:transparent}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-0:focus-visible{outline-offset:0px}.focus-visible\:outline-super:focus-visible{outline-color:oklch(var(--super-color) / 1)}.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-super\/50:focus-visible{--tw-ring-color: oklch(var(--super-color) / .5)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-\[6px\]:focus-visible{--tw-ring-offset-width: 6px}.focus-visible\:ring-offset-inverse:focus-visible{--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.focus-visible\:before\:opacity-100:focus-visible:before{content:var(--tw-content);opacity:1}.active\:\!scale-100:active{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.active\:scale-100:active{--tw-scale-x: 1;--tw-scale-y: 1;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))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\:scale-\[\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;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))}.active\:scale-\[0\.95\]:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\:scale-\[0\.96\]:active{--tw-scale-x: .96;--tw-scale-y: .96;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))}.active\:scale-\[0\.97\]:active{--tw-scale-x: .97;--tw-scale-y: .97;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))}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;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))}.active\:scale-\[0\.99\]:active{--tw-scale-x: .99;--tw-scale-y: .99;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))}.active\:transform-none:active{transform:none}.active\:\!cursor-grabbing:active{cursor:grabbing!important}.active\:cursor-grabbing:active{cursor:grabbing}.active\:\!bg-subtler:active{background-color:oklch(var(--background-subtler-color))!important}.active\:bg-subtler:active{background-color:oklch(var(--background-subtler-color))}.active\:underline:active{text-decoration-line:underline}.active\:\!opacity-\[50\%\]:active{opacity:50%!important}.active\:opacity-75:active{opacity:.75}.active\:duration-150:active,.active\:duration-normal:active{transition-duration:.15s}.active\:ease-outExpo:active{transition-timing-function:cubic-bezier(.16,1,.3,1)}.active\:duration-150:active,.active\:duration-normal:active{animation-duration:.15s}.active\:ease-outExpo:active{animation-timing-function:cubic-bezier(.16,1,.3,1)}.disabled\:\!text-inverse:disabled{color:oklch(var(--foreground-inverse-color))!important}:is(.disabled\:\!text-inverse:disabled){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}@media (prefers-reduced-motion: reduce){.motion-reduce\:transition-none{transition-property:none}}@media not all and (min-width: 768px){.max-md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}}@media not all and (min-width: 640px){.max-sm\:-mx-4{margin-left:-1rem;margin-right:-1rem}.max-sm\:size-full{width:100%;height:100%}.max-sm\:h-\[200px\]{height:200px}.max-sm\:min-h-dvh{min-height:100dvh}.max-sm\:w-full{width:100%}.max-sm\:w-screen{width:100vw}.max-sm\:object-cover{-o-object-fit:cover;object-fit:cover}.max-sm\:px-4{padding-left:1rem;padding-right:1rem}.max-sm\:pb-10{padding-bottom:2.5rem}.max-sm\:pl-sm{padding-left:var(--size-sm)}.max-sm\:text-center{text-align:center}.max-sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.max-sm\:text-base{font-size:1rem;line-height:1.5rem}.max-sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 640px){.sm\:fixed{position:fixed}.sm\:sticky{position:sticky}.sm\:inset-0{inset:0}.sm\:top-xs{top:var(--size-xs)}.sm\:order-\[unset\]{order:unset}.sm\:col-span-1{grid-column:span 1 / span 1}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mx-sm{margin-left:var(--size-sm);margin-right:var(--size-sm)}.sm\:-mt-2{margin-top:-.5rem}.sm\:mb-2{margin-bottom:.5rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-auto{margin-left:auto}.sm\:line-clamp-5{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:aspect-\[4\/5\]{aspect-ratio:4/5}.sm\:aspect-auto{aspect-ratio:auto}.sm\:\!h-8{height:2rem!important}.sm\:h-full{height:100%}.sm\:max-h-\[25vh\]{max-height:25vh}.sm\:min-h-0{min-height:0px}.sm\:min-h-8{min-height:2rem}.sm\:min-h-80{min-height:20rem}.sm\:\!w-8{width:2rem!important}.sm\:w-1\/2{width:50%}.sm\:w-24{width:6rem}.sm\:w-8\/12{width:66.666667%}.sm\:w-\[75vw\]{width:75vw}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:\!min-w-\[50\%\]{min-width:50%!important}.sm\:min-w-56{min-width:14rem}.sm\:max-w-\[50\%\]{max-width:50%}.sm\:max-w-screen-md{max-width:768px}.sm\:flex-1{flex:1 1 0%}.sm\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.sm\:flex-row{flex-direction:row}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:place-items-center{place-items:center}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-10{gap:2.5rem}.sm\:gap-16{gap:4rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-md{gap:var(--size-md)}.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\:self-center{align-self:center}.sm\:overflow-visible{overflow:visible}.sm\:whitespace-nowrap{white-space:nowrap}.sm\:rounded-3xl{border-radius:1.25rem}.sm\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}.sm\:object-\[80\%_center\]{-o-object-position:80% center;object-position:80% center}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:p-three{padding:3px}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.sm\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pb-0{padding-bottom:0}.sm\:pb-lg{padding-bottom:var(--size-lg)}.sm\:pr-6{padding-right:1.5rem}.sm\:pr-8{padding-right:2rem}.sm\:text-left{text-align:left}.sm\:\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.sm\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.sm\:\!text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.group:hover .sm\:group-hover\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.sm\:hover\:\!border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))!important}.sm\:hover\:border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))}}@media (min-width: 768px){.md\:pointer-events-auto{pointer-events:auto}.md\:absolute{position:absolute}.md\:relative{position:relative}.md\:inset-0{inset:0}.md\:inset-x-lg{left:var(--size-lg);right:var(--size-lg)}.md\:\!bottom-lg{bottom:var(--size-lg)!important}.md\:\!left-sideBarWidth{left:var(--sidebar-width)!important}.md\:\!left-sidebarDefaultWidth{left:var(--sidebar-default-width)!important}.md\:\!left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)!important}.md\:bottom-0{bottom:0}.md\:bottom-\[6px\]{bottom:6px}.md\:bottom-sm{bottom:var(--size-sm)}.md\:bottom-xl{bottom:var(--size-xl)}.md\:left-\[calc\(var\(--sidebar-pinned-width\)\)\]{left:calc(var(--sidebar-pinned-width))}.md\:left-auto{left:auto}.md\:left-sidebarDefaultWidth{left:var(--sidebar-default-width)}.md\:left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)}.md\:right-0{right:0}.md\:right-full{right:100%}.md\:right-md{right:var(--size-md)}.md\:right-sm{right:var(--size-sm)}.md\:top-0{top:0}.md\:top-\[calc\(var\(--header-height\)\+var\(--size-sm\)\)\]{top:calc(var(--header-height) + var(--size-sm))}.md\:top-headerHeight{top:var(--header-height)}.md\:isolation-auto{isolation:auto}.md\:z-\[1\]{z-index:1}.md\:col-span-4{grid-column:span 4 / span 4}.md\:col-start-2{grid-column-start:2}.md\:col-start-3{grid-column-start:3}.md\:col-end-3{grid-column-end:3}.md\:col-end-4{grid-column-end:4}.md\:row-start-1{grid-row-start:1}.md\:row-end-2{grid-row-end:2}.md\:row-end-3{grid-row-end:3}.md\:-m-md{margin:calc(var(--size-md) * -1)}.md\:m-0{margin:0}.md\:-mx-0{margin-left:-0px;margin-right:-0px}.md\:-mx-3{margin-left:-.75rem;margin-right:-.75rem}.md\:-mx-md{margin-left:calc(var(--size-md) * -1);margin-right:calc(var(--size-md) * -1)}.md\:-mx-xs{margin-left:calc(var(--size-xs) * -1);margin-right:calc(var(--size-xs) * -1)}.md\:-my-2{margin-top:-.5rem;margin-bottom:-.5rem}.md\:mx-0{margin-left:0;margin-right:0}.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mx-lg{margin-left:var(--size-lg);margin-right:var(--size-lg)}.md\:mx-md{margin-left:var(--size-md);margin-right:var(--size-md)}.md\:my-md{margin-top:var(--size-md);margin-bottom:var(--size-md)}.md\:-mb-10{margin-bottom:-2.5rem}.md\:-mb-md{margin-bottom:calc(var(--size-md) * -1)}.md\:-ml-5{margin-left:-1.25rem}.md\:-ml-\[1\.5px\]{margin-left:-1.5px}.md\:-ml-sm{margin-left:calc(var(--size-sm) * -1)}.md\:-mr-5{margin-right:-1.25rem}.md\:-mt-md{margin-top:calc(var(--size-md) * -1)}.md\:mb-0{margin-bottom:0}.md\:mb-1{margin-bottom:.25rem}.md\:mb-20{margin-bottom:5rem}.md\:mb-lg{margin-bottom:var(--size-lg)}.md\:mb-md{margin-bottom:var(--size-md)}.md\:mb-sm{margin-bottom:var(--size-sm)}.md\:mb-xs{margin-bottom:var(--size-xs)}.md\:ml-0{margin-left:0}.md\:mr-0{margin-right:0}.md\:mr-\[-16px\]{margin-right:-16px}.md\:mr-sm{margin-right:var(--size-sm)}.md\:mt-0{margin-top:0}.md\:mt-lg{margin-top:var(--size-lg)}.md\:mt-md{margin-top:var(--size-md)}.md\:mt-ml{margin-top:var(--size-ml)}.md\:mt-sm{margin-top:var(--size-sm)}.md\:mt-xl{margin-top:var(--size-xl)}.md\:line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md\:line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:aspect-square{aspect-ratio:1 / 1}.md\:size-10{width:2.5rem;height:2.5rem}.md\:size-12{width:3rem;height:3rem}.md\:size-14{width:3.5rem;height:3.5rem}.md\:size-20{width:5rem;height:5rem}.md\:size-28{width:7rem;height:7rem}.md\:size-4{width:1rem;height:1rem}.md\:size-5{width:1.25rem;height:1.25rem}.md\:size-8{width:2rem;height:2rem}.md\:size-\[60px\]{width:60px;height:60px}.md\:size-auto{width:auto;height:auto}.md\:h-1\/2{height:50%}.md\:h-12{height:3rem}.md\:h-14{height:3.5rem}.md\:h-2{height:.5rem}.md\:h-4{height:1rem}.md\:h-48{height:12rem}.md\:h-8{height:2rem}.md\:h-\[196px\]{height:196px}.md\:h-\[314px\]{height:314px}.md\:h-\[320px\]{height:320px}.md\:h-\[413px\]{height:413px}.md\:h-\[446px\]{height:446px}.md\:h-\[68px\]{height:68px}.md\:h-\[90vh\]{height:90vh}.md\:h-auto{height:auto}.md\:h-fit{height:-moz-fit-content;height:fit-content}.md\:h-full{height:100%}.md\:h-screen{height:100vh}.md\:max-h-\[350px\]{max-height:350px}.md\:max-h-\[900px\]{max-height:900px}.md\:max-h-\[95vh\]{max-height:95vh}.md\:max-h-\[96vh\]{max-height:96vh}.md\:max-h-none{max-height:none}.md\:min-h-0{min-height:0px}.md\:min-h-\[200px\]{min-height:200px}.md\:min-h-\[60vh\]{min-height:60vh}.md\:\!w-2\/5{width:40%!important}.md\:\!w-full{width:100%!important}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:w-1\/4{width:25%}.md\:w-14{width:3.5rem}.md\:w-16{width:4rem}.md\:w-2\/3{width:66.666667%}.md\:w-3\/4{width:75%}.md\:w-3\/5{width:60%}.md\:w-32{width:8rem}.md\:w-52{width:13rem}.md\:w-6{width:1.5rem}.md\:w-8{width:2rem}.md\:w-80{width:20rem}.md\:w-\[140px\]{width:140px}.md\:w-\[160px\]{width:160px}.md\:w-\[200px\]{width:200px}.md\:w-\[266px\]{width:266px}.md\:w-\[400px\]{width:400px}.md\:w-\[420px\]{width:420px}.md\:w-\[45\%\]{width:45%}.md\:w-\[515px\]{width:515px}.md\:w-\[55\%\]{width:55%}.md\:w-\[90vw\]{width:90vw}.md\:w-\[calc\(20\%-8px\)\]{width:calc(20% - 8px)}.md\:w-\[calc\(30\%_-_8px\)\]{width:calc(30% - 8px)}.md\:w-\[min\(80vw\,_1200px\)\]{width:min(80vw,1200px)}.md\:w-\[unset\]{width:unset}.md\:w-auto{width:auto}.md\:w-full{width:100%}.md\:\!min-w-0{min-width:0px!important}.md\:\!min-w-\[400px\]{min-width:400px!important}.md\:min-w-0{min-width:0px}.md\:min-w-\[250px\]{min-width:250px}.md\:min-w-\[300px\]{min-width:300px}.md\:min-w-\[400px\]{min-width:400px}.md\:min-w-\[500px\]{min-width:500px}.md\:min-w-\[600px\]{min-width:600px}.md\:min-w-\[768px\]{min-width:768px}.md\:min-w-\[auto\]{min-width:auto}.md\:\!max-w-\[400px\]{max-width:400px!important}.md\:max-w-\[1000px\]{max-width:1000px}.md\:max-w-\[160px\]{max-width:160px}.md\:max-w-\[300px\]{max-width:300px}.md\:max-w-\[350px\]{max-width:350px}.md\:max-w-\[360px\]{max-width:360px}.md\:max-w-\[440px\]{max-width:440px}.md\:max-w-\[50vw\]{max-width:50vw}.md\:max-w-\[600px\]{max-width:600px}.md\:max-w-\[90vw\]{max-width:90vw}.md\:max-w-\[960px\]{max-width:960px}.md\:max-w-lg{max-width:32rem}.md\:max-w-none{max-width:none}.md\:max-w-screen-md{max-width:768px}.md\:max-w-threadWidth{max-width:var(--thread-width)}.md\:flex-1{flex:1 1 0%}.md\:flex-shrink-0{flex-shrink:0}.md\:shrink{flex-shrink:1}.md\:grow-\[unset\]{flex-grow:unset}.md\:-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))}.md\:-translate-x-\[30vw\]{--tw-translate-x: -30vw;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))}.md\:-translate-x-sm{--tw-translate-x: calc(var(--size-sm) * -1);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))}.md\:-translate-y-px{--tw-translate-y: -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))}.md\: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))}.md\:translate-x-sm{--tw-translate-x: var(--size-sm);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))}.md\:translate-y-0{--tw-translate-y: 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))}.md\:translate-y-px{--tw-translate-y: 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))}.md\:cursor-pointer{cursor:pointer}.md\:grid-flow-col{grid-auto-flow:column}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.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\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:grid-cols-\[1fr\,3fr\,1fr\]{grid-template-columns:1fr 3fr 1fr}.md\:grid-cols-\[1fr_1fr_1fr_96px\]{grid-template-columns:1fr 1fr 1fr 96px}.md\:grid-cols-\[1fr_3fr\]{grid-template-columns:1fr 3fr}.md\:grid-cols-\[2fr\,1fr\,1fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr 1fr 1fr}.md\:grid-cols-\[3\.5fr\,1fr\,1fr\,1fr\]{grid-template-columns:3.5fr 1fr 1fr 1fr}.md\:grid-cols-\[3fr\,1fr\,1fr\,1fr\]{grid-template-columns:3fr 1fr 1fr 1fr}.md\:grid-cols-\[3fr\,1fr\]{grid-template-columns:3fr 1fr}.md\:grid-cols-\[3fr\,2fr\,1fr\,1fr\]{grid-template-columns:3fr 2fr 1fr 1fr}.md\:grid-cols-\[5fr\,2fr\,2fr\,1fr\,1fr\]{grid-template-columns:5fr 2fr 2fr 1fr 1fr}.md\:grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.md\:grid-cols-\[auto_300px\]{grid-template-columns:auto 300px}.md\:grid-cols-\[min-content\,1fr\,1fr\,min-content\]{grid-template-columns:min-content 1fr 1fr min-content}.md\:grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.md\:flex-row{flex-direction:row}.md\:\!flex-row-reverse{flex-direction:row-reverse!important}.md\:flex-row-reverse{flex-direction:row-reverse}.md\:flex-col{flex-direction:column}.md\:flex-nowrap{flex-wrap:nowrap}.md\:items-start{align-items:flex-start}.md\:items-center{align-items:center}.md\:justify-start{justify-content:flex-start}.md\:justify-end{justify-content:flex-end}.md\:justify-center{justify-content:center}.md\:justify-between{justify-content:space-between}.md\:gap-0{gap:0px}.md\:gap-3{gap:.75rem}.md\:gap-6{gap:1.5rem}.md\:gap-8{gap:2rem}.md\:gap-\[12px\]{gap:12px}.md\:gap-lg{gap:var(--size-lg)}.md\:gap-md{gap:var(--size-md)}.md\:gap-sm{gap:var(--size-sm)}.md\:gap-xl{gap:var(--size-xl)}.md\:gap-xs{gap:var(--size-xs)}.md\:gap-x-0{-moz-column-gap:0px;column-gap:0px}.md\:gap-x-md{-moz-column-gap:var(--size-md);column-gap:var(--size-md)}.md\:gap-x-sm{-moz-column-gap:var(--size-sm);column-gap:var(--size-sm)}.md\:gap-y-lg{row-gap:var(--size-lg)}.md\:gap-y-md{row-gap:var(--size-md)}.md\:space-y-lg>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-lg) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-lg) * var(--tw-space-y-reverse))}.md\:space-y-md>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-md) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-md) * var(--tw-space-y-reverse))}.md\:self-center{align-self:center}.md\:overflow-hidden{overflow:hidden}.md\:overflow-visible{overflow:visible}.md\:overflow-y-auto{overflow-y:auto}.md\:overflow-x-visible{overflow-x:visible}.md\:whitespace-nowrap{white-space:nowrap}.md\:rounded{border-radius:.25rem}.md\:rounded-2xl{border-radius:1rem}.md\:rounded-3xl{border-radius:1.25rem}.md\:rounded-full{border-radius:9999px}.md\:rounded-lg{border-radius:.5rem}.md\:rounded-md{border-radius:.375rem}.md\:rounded-none{border-radius:0}.md\:rounded-xl{border-radius:.75rem}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.md\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.md\:rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.md\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.md\:rounded-br-\[6px\]{border-bottom-right-radius:6px}.md\:border{border-width:1px}.md\:border-0{border-width:0px}.md\:\!border-y-0{border-top-width:0px!important;border-bottom-width:0px!important}.md\:\!border-r-0{border-right-width:0px!important}.md\:border-b{border-bottom-width:1px}.md\:border-b-0{border-bottom-width:0px}.md\:border-l{border-left-width:1px}.md\:border-r{border-right-width:1px}.md\:border-r-0{border-right-width:0px}.md\:border-t{border-top-width:1px}.md\:border-t-0{border-top-width:0px}.md\:bg-subtler{background-color:oklch(var(--background-subtler-color))}.md\:object-cover{-o-object-fit:cover;object-fit:cover}.md\:object-\[65\%_center\]{-o-object-position:65% center;object-position:65% center}.md\:\!p-md{padding:var(--size-md)!important}.md\:p-0{padding:0}.md\:p-1{padding:.25rem}.md\:p-12{padding:3rem}.md\:p-3{padding:.75rem}.md\:p-6{padding:1.5rem}.md\:p-\[12px\]{padding:12px}.md\:p-\[6px\]{padding:6px}.md\:p-lg{padding:var(--size-lg)}.md\:p-md{padding:var(--size-md)}.md\:p-sm{padding:var(--size-sm)}.md\:p-xl{padding:var(--size-xl)}.md\:p-xs{padding:var(--size-xs)}.md\:px-0{padding-left:0;padding-right:0}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.md\:px-sm{padding-left:var(--size-sm);padding-right:var(--size-sm)}.md\:px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.md\:px-xs{padding-left:var(--size-xs);padding-right:var(--size-xs)}.md\:py-0{padding-top:0;padding-bottom:0}.md\:py-\[12px\]{padding-top:12px;padding-bottom:12px}.md\:py-lg{padding-top:var(--size-lg);padding-bottom:var(--size-lg)}.md\:py-md{padding-top:var(--size-md);padding-bottom:var(--size-md)}.md\:py-sm{padding-top:var(--size-sm);padding-bottom:var(--size-sm)}.md\:py-xs{padding-top:var(--size-xs);padding-bottom:var(--size-xs)}.md\:\!pb-0{padding-bottom:0!important}.md\:\!pb-4{padding-bottom:1rem!important}.md\:pb-0{padding-bottom:0}.md\:pb-12{padding-bottom:3rem}.md\:pb-6{padding-bottom:1.5rem}.md\:pb-8{padding-bottom:2rem}.md\:pb-9{padding-bottom:2.25rem}.md\:pb-lg{padding-bottom:var(--size-lg)}.md\:pb-md{padding-bottom:var(--size-md)}.md\:pb-sm{padding-bottom:var(--size-sm)}.md\:pl-0{padding-left:0}.md\:pl-lg{padding-left:var(--size-lg)}.md\:pl-md{padding-left:var(--size-md)}.md\:pr-0{padding-right:0}.md\:pr-6{padding-right:1.5rem}.md\:pr-\[138px\]{padding-right:138px}.md\:pr-\[59px\]{padding-right:59px}.md\:pr-md{padding-right:var(--size-md)}.md\:pr-sm{padding-right:var(--size-sm)}.md\:pt-0{padding-top:0}.md\:pt-2{padding-top:.5rem}.md\:pt-20{padding-top:5rem}.md\:pt-lg{padding-top:var(--size-lg)}.md\:pt-md{padding-top:var(--size-md)}.md\:pt-xl{padding-top:var(--size-xl)}.md\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:\!text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.md\:\!text-5xl{font-size:3rem!important;line-height:1!important}.md\:\!text-\[2\.8rem\]{font-size:2.8rem!important}.md\:\!text-\[80px\]{font-size:80px!important}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-\[2\.8rem\]{font-size:2.8rem}.md\:text-\[3\.1rem\]{font-size:3.1rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}.md\:\!leading-\[1\.3\]{line-height:1.3!important}.md\:text-quietest{color:oklch(var(--foreground-quietest-color))}.md\:opacity-0{opacity:0}.md\:opacity-70{opacity:.7}.md\: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)}.md\: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)}.md\:shadow-overlay{--tw-shadow: 0 0 0 1px var(--shadow-overlay-border, rgba(0, 0, 0, .05)), 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 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)}.md\: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)}.md\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.md\: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)}.md\:\[grid-template-columns\:5fr_1fr_1fr_1fr\]{grid-template-columns:5fr 1fr 1fr 1fr}.md\:placeholder\:text-\[2\.8rem\]::-moz-placeholder{font-size:2.8rem}.md\:placeholder\:text-\[2\.8rem\]::placeholder{font-size:2.8rem}.first\:md\:px-md:first-child{padding-left:var(--size-md);padding-right:var(--size-md)}.md\:last\:px-md:last-child{padding-left:var(--size-md);padding-right:var(--size-md)}.last\:md\:pr-md:last-child{padding-right:var(--size-md)}.md\:last\:pr-0:last-child{padding-right:0}.group:first-child .group-first\:md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.group:last-child .group-last\:md\:pr-md{padding-right:var(--size-md)}.group:hover .md\:group-hover\: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:hover .md\:group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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:hover .md\:group-hover\:\!border-foreground{border-color:oklch(var(--foreground-color))!important}.group:hover .md\:group-hover\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group:hover .md\:group-hover\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group:hover .md\:group-hover\:opacity-100{opacity:1}@container (min-width: 20rem){.md\:\@xs\:w-60{width:15rem}}@container (min-width: 1458px){.md\:\@\[1458px\]\:w-\[874px\]{width:874px}.md\:\@\[1458px\]\:shrink-0{flex-shrink:0}}.md\:hover\:border-subtle:hover{border-color:oklch(var(--foreground-subtle-color))}.md\:hover\:\!bg-raisedOffset:hover{background-color:oklch(var(--raised-offset-color))!important}.md\:hover\:\!bg-subtle:hover{background-color:oklch(var(--background-subtle-color))!important}.md\:hover\:\!bg-subtler:hover{background-color:oklch(var(--background-subtler-color))!important}.md\:hover\:\!bg-super:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.md\:hover\:\!bg-transparent:hover{background-color:transparent!important}.md\:hover\:text-quiet:hover{color:oklch(var(--foreground-quiet-color))}}@media (max-width: 1224px){@media (min-width: 768px){.max-\[1224px\]\:md\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}}}@media (max-width: 970px){@media (min-width: 768px){.max-\[970px\]\:md\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}}}@media (min-width: 1024px){.lg\:\!relative{position:relative!important}.lg\:sticky{position:sticky}.lg\:\!top-0{top:0!important}.lg\:-top-6{top:-1.5rem}.lg\:bottom-md{bottom:var(--size-md)}.lg\:left-8{left:2rem}.lg\:right-8{right:2rem}.lg\:right-sm{right:var(--size-sm)}.lg\:top-\[clamp\(24px\,4vw\,96px\)\]{top:clamp(24px,4vw,96px)}.lg\:ml-0{margin-left:0}.lg\:block{display:block}.lg\:grid{display:grid}.lg\:contents{display:contents}.lg\:hidden{display:none}.lg\:size-\[44px\]{width:44px;height:44px}.lg\:h-\[clamp\(420px\,calc\(100vh-320px\)\,672px\)\]{height:clamp(420px,calc(100vh - 320px),672px)}.lg\:max-h-\[40vh\]{max-height:40vh}.lg\:w-1\/2{width:50%}.lg\:w-fit{width:-moz-fit-content;width:fit-content}.lg\:min-w-\[900px\]{min-width:900px}.lg\:max-w-\[unset\]{max-width:unset}.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\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr 1fr}.lg\:grid-cols-\[8fr_minmax\(300px\,3fr\)\]{grid-template-columns:8fr minmax(300px,3fr)}.lg\:gap-8{gap:2rem}.lg\:gap-md{gap:var(--size-md)}.lg\:gap-xl{gap:var(--size-xl)}.lg\:rounded-lg{border-radius:.5rem}.lg\:object-\[center_center\]{-o-object-position:center center;object-position:center center}.lg\:p-sm{padding:var(--size-sm)}.lg\:px-12{padding-left:3rem;padding-right:3rem}.lg\:px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.lg\:pl-0{padding-left:0}.lg\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-\[2\.8rem\]{font-size:2.8rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}[data-erp=tab] .erp-tab\:lg\:right-0{right:0}}@media (min-width: 1280px){.xl\:block{display:block}.xl\:size-\[64px\]{width:64px;height:64px}.xl\:max-h-screen{max-height:100vh}.xl\:max-w-\[25vw\]{max-width:25vw}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:border-l-0{border-left-width:0px}.xl\:\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.xl\: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)}}@media (min-width: 1536px){.\32xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.ltr\:-mr-sm:where([dir=ltr],[dir=ltr] *){margin-right:calc(var(--size-sm) * -1)}.ltr\:-translate-x-\[1\%\]:where([dir=ltr],[dir=ltr] *){--tw-translate-x: -1%;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))}.ltr\:-translate-x-px:where([dir=ltr],[dir=ltr] *){--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))}.rtl\:-ml-sm:where([dir=rtl],[dir=rtl] *){margin-left:calc(var(--size-sm) * -1)}.rtl\:translate-x-\[1\%\]:where([dir=rtl],[dir=rtl] *){--tw-translate-x: 1%;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))}.rtl\:translate-x-px:where([dir=rtl],[dir=rtl] *){--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))}.rtl\:rotate-180:where([dir=rtl],[dir=rtl] *){--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))}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:ml-0{margin-left:0}:root:not([data-color-scheme=light]) .dark\:mr-0{margin-right:0}:root:not([data-color-scheme=light]) .dark\:block{display:block}:root:not([data-color-scheme=light]) .dark\:hidden{display:none}:root:not([data-color-scheme=light]) .dark\:w-full{width:100%}:root:not([data-color-scheme=light]) .dark\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}:root:not([data-color-scheme=light]) .dark\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}:root:not([data-color-scheme=light]) .dark\:border{border-width:1px}:root:not([data-color-scheme=light]) .dark\:border-0{border-width:0px}:root:not([data-color-scheme=light]) .dark\:\!border-none{border-style:none!important}:root:not([data-color-scheme=light]) .dark\:border-none{border-style:none}:root:not([data-color-scheme=light]) .dark\:\!border-\[white\]\/10{border-color:#ffffff1a!important}:root:not([data-color-scheme=light]) .dark\:border-\[\#5D5F5F\]{--tw-border-opacity: 1;border-color:rgb(93 95 95 / var(--tw-border-opacity))}:root:not([data-color-scheme=light]) .dark\:border-\[white\]\/5{border-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:border-black\/\[0\.04\]{border-color:#0000000a}:root:not([data-color-scheme=light]) .dark\:border-foreground{border-color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:border-inverse{border-color:oklch(var(--foreground-inverse-color))}:root:not([data-color-scheme=light]) .dark\:border-subtle{border-color:oklch(var(--foreground-subtle-color))}:root:not([data-color-scheme=light]) .dark\:border-subtler{border-color:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}:root:not([data-color-scheme=light]) .dark\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}:root:not([data-color-scheme=light]) .dark\:border-super\/30{border-color:oklch(var(--super-color) / .3)}:root:not([data-color-scheme=light]) .dark\:border-super\/5{border-color:oklch(var(--super-color) / .05)}:root:not([data-color-scheme=light]) .dark\:border-super\/85{border-color:oklch(var(--super-color) / .85)}:root:not([data-color-scheme=light]) .dark\:border-transparent{border-color:transparent}:root:not([data-color-scheme=light]) .dark\:border-white\/10{border-color:#ffffff1a}:root:not([data-color-scheme=light]) .dark\:\!bg-\[white\]\/100{background-color:#fff!important}:root:not([data-color-scheme=light]) .dark\:\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-white\/10{background-color:#ffffff1a!important}:root:not([data-color-scheme=light]) .dark\:\!bg-white\/5{background-color:#ffffff0d!important}:root:not([data-color-scheme=light]) .dark\:bg-\[\#211B1A\]{--tw-bg-opacity: 1;background-color:rgb(33 27 26 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#450a0a\]\/75{background-color:#450a0abf}:root:not([data-color-scheme=light]) .dark\:bg-\[\#54B4E3\]{--tw-bg-opacity: 1;background-color:rgb(84 180 227 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#B3C901\]{--tw-bg-opacity: 1;background-color:rgb(179 201 1 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#B4B662\]{--tw-bg-opacity: 1;background-color:rgb(180 182 98 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#C48ED8\]{--tw-bg-opacity: 1;background-color:rgb(196 142 216 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#E68161\]{--tw-bg-opacity: 1;background-color:rgb(230 129 97 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#F0B435\]{--tw-bg-opacity: 1;background-color:rgb(240 180 53 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#F5F5F5\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#FF5459\]{--tw-bg-opacity: 1;background-color:rgb(255 84 89 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#FFAB44\]{--tw-bg-opacity: 1;background-color:rgb(255 171 68 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-base\/70{background-color:oklch(var(--background-base-color) / .7)}:root:not([data-color-scheme=light]) .dark\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}:root:not([data-color-scheme=light]) .dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-black\/50{background-color:#00000080}:root:not([data-color-scheme=light]) .dark\:bg-black\/80{background-color:#000c}:root:not([data-color-scheme=light]) .dark\:bg-black\/\[0\.18\]{background-color:#0000002e}:root:not([data-color-scheme=light]) .dark\:bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}:root:not([data-color-scheme=light]) .dark\:bg-negative\/10{background-color:oklch(var(--negative-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-offset{background-color:oklch(var(--offset-color))}:root:not([data-color-scheme=light]) .dark\:bg-positive\/10{background-color:oklch(var(--positive-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-subtle{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtlest{background-color:oklch(var(--background-subtlest-color))}:root:not([data-color-scheme=light]) .dark\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-super\/20{background-color:oklch(var(--super-color) / .2)}:root:not([data-color-scheme=light]) .dark\:bg-super\/25{background-color:oklch(var(--super-color) / .25)}:root:not([data-color-scheme=light]) .dark\:bg-super\/85{background-color:oklch(var(--super-color) / .85)}:root:not([data-color-scheme=light]) .dark\:bg-transparent{background-color:transparent}:root:not([data-color-scheme=light]) .dark\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-white\/10{background-color:#ffffff1a}:root:not([data-color-scheme=light]) .dark\:bg-white\/20{background-color:#fff3}:root:not([data-color-scheme=light]) .dark\:bg-white\/40{background-color:#fff6}:root:not([data-color-scheme=light]) .dark\:bg-white\/5{background-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}:root:not([data-color-scheme=light]) .dark\:bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}:root:not([data-color-scheme=light]) .dark\:bg-none{background-image:none}:root:not([data-color-scheme=light]) .dark\:from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}:root:not([data-color-scheme=light]) .dark\:from-super\/20{--tw-gradient-from: oklch(var(--super-color) / .2) 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)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\:to-\[oklch\(var\(--dark-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--dark-background-base-color)) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-super\/20{--tw-gradient-to: oklch(var(--super-color) / .2) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-white\/20{--tw-gradient-to: rgb(255 255 255 / .2) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:stroke-\[1\.5px\]{stroke-width:1.5px}:root:not([data-color-scheme=light]) .dark\:\!text-\[\#1f2121\]{--tw-text-opacity: 1 !important;color:rgb(31 33 33 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!text-foreground{color:oklch(var(--foreground-color))!important}:root:not([data-color-scheme=light]) .dark\:\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}:root:not([data-color-scheme=light]) .dark\:\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:text-\[\#1f2121\]{--tw-text-opacity: 1;color:rgb(31 33 33 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-\[\#4ade80\]{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-foreground{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:text-inverse{color:oklch(var(--foreground-inverse-color))}:root:not([data-color-scheme=light]) .dark\:text-quiet{color:oklch(var(--foreground-quiet-color))}:root:not([data-color-scheme=light]) .dark\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-white\/50{color:#ffffff80}:root:not([data-color-scheme=light]) .dark\:decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:opacity-10{opacity:.1}:root:not([data-color-scheme=light]) .dark\:opacity-100{opacity:1}:root:not([data-color-scheme=light]) .dark\:opacity-15{opacity:.15}:root:not([data-color-scheme=light]) .dark\:opacity-20{opacity:.2}:root:not([data-color-scheme=light]) .dark\:opacity-25{opacity:.25}:root:not([data-color-scheme=light]) .dark\:opacity-40{opacity:.4}:root:not([data-color-scheme=light]) .dark\:opacity-60{opacity:.6}:root:not([data-color-scheme=light]) .dark\:opacity-90{opacity:.9}:root:not([data-color-scheme=light]) .dark\:opacity-\[0\.12\]{opacity:.12}:root:not([data-color-scheme=light]) .dark\:mix-blend-normal{mix-blend-mode:normal}:root:not([data-color-scheme=light]) .dark\:mix-blend-screen{mix-blend-mode:screen}:root:not([data-color-scheme=light]) .dark\:mix-blend-soft-light{mix-blend-mode:soft-light}:root:not([data-color-scheme=light]) .dark\:\!shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)\]{--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_0_16px_8px_oklch\(var\(--offset-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--offset-color)/.6);--tw-shadow-colored: 0 0 16px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 1px 4px rgba(0,0,0,.5);--tw-shadow-colored: 0 1px 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)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.12\)\,0_32px_16px_36px_oklch\(var\(--dark-background-base-color\)\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.12),0 32px 16px 36px oklch(var(--dark-background-base-color));--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color), 0 32px 16px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.5);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}:root:not([data-color-scheme=light]) .dark\:shadow-black\/10{--tw-shadow-color: rgb(0 0 0 / .1);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:shadow-super\/5{--tw-shadow-color: oklch(var(--super-color) / .05);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:shadow-white\/5{--tw-shadow-color: rgb(255 255 255 / .05);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:\!ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color)) !important}:root:not([data-color-scheme=light]) .dark\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}:root:not([data-color-scheme=light]) .dark\:ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}:root:not([data-color-scheme=light]) .dark\:ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}:root:not([data-color-scheme=light]) .dark\:invert{--tw-invert: invert(100%);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)}:is(:root:not([data-color-scheme=light]) .dark\:\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(:root:not([data-color-scheme=light]) .dark\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}:root:not([data-color-scheme=light]) .dark\:\!\[--dog-bg-highlight\:white\]{--dog-bg-highlight: white !important}:root:not([data-color-scheme=light]) .dark\:\!\[--dot-bg\:currentColor\]{--dot-bg: currentColor !important}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .before\:dark\:border-none:before{content:var(--tw-content);border-style:none}:root:not([data-color-scheme=light]) .dark\:before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:before\:shadow-md:before{content:var(--tw-content);--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)}:root:not([data-color-scheme=light]) .dark\:after\:absolute:after{content:var(--tw-content);position:absolute}:root:not([data-color-scheme=light]) .dark\:after\:inset-0:after{content:var(--tw-content);inset:0}:root:not([data-color-scheme=light]) .dark\:after\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}:root:not([data-color-scheme=light]) .dark\:after\:border:after{content:var(--tw-content);border-width:1px}:root:not([data-color-scheme=light]) .dark\:after\:border-none:after{content:var(--tw-content);border-style:none}:root:not([data-color-scheme=light]) .dark\:after\:border-white\/10:after{content:var(--tw-content);border-color:#ffffff1a}:root:not([data-color-scheme=light]) .after\:dark\:shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;--tw-shadow-colored: inset 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)}:root:not([data-color-scheme=light]) .dark\:after\:ring-0:after{content:var(--tw-content);--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)}:root:not([data-color-scheme=light]) .group:hover .dark\:group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}:is(:root:not([data-color-scheme=light]) .group:hover .dark\:group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}:root:not([data-color-scheme=light]) .group:active .dark\:group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}:root:not([data-color-scheme=light]) .aria-selected\:dark\:bg-subtle[aria-selected=true]{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .aria-selected\:dark\:text-foreground[aria-selected=true]{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:data-\[focused\=self\]\:bg-subtler[data-focused=self]{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .group[data-selected=true] .dark\:group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:hover\:\!bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)!important}:root:not([data-color-scheme=light]) .dark\:hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:hover\:text-foreground:hover{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}:root:not([data-color-scheme=light]) .dark\:hover\:data-\[focused\=other\]\:bg-subtler[data-focused=other]:hover{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .dark\:focus\:\!ring-super\/50:focus{--tw-ring-color: oklch(var(--super-color) / .5) !important}:root:not([data-color-scheme=light]) .dark\:active\:\!bg-subtle:active{background-color:oklch(var(--background-subtle-color))!important}:root:not([data-color-scheme=light]) .dark\:active\:bg-subtle:active{background-color:oklch(var(--background-subtle-color))}}@media (min-width: 768px){@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .md\:dark\:block{display:block}:root:not([data-color-scheme=light]) .md\:dark\:border{border-width:1px}:root:not([data-color-scheme=light]) .md\:dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}}}html[data-color-scheme=dark] .dark\:ml-0{margin-left:0}html[data-color-scheme=dark] .dark\:mr-0{margin-right:0}html[data-color-scheme=dark] .dark\:block{display:block}html[data-color-scheme=dark] .dark\:hidden{display:none}html[data-color-scheme=dark] .dark\:w-full{width:100%}html[data-color-scheme=dark] .dark\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}html[data-color-scheme=dark] .dark\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}html[data-color-scheme=dark] .dark\:border{border-width:1px}html[data-color-scheme=dark] .dark\:border-0{border-width:0px}html[data-color-scheme=dark] .dark\:\!border-none{border-style:none!important}html[data-color-scheme=dark] .dark\:border-none{border-style:none}html[data-color-scheme=dark] .dark\:\!border-\[white\]\/10{border-color:#ffffff1a!important}html[data-color-scheme=dark] .dark\:border-\[\#5D5F5F\]{--tw-border-opacity: 1;border-color:rgb(93 95 95 / var(--tw-border-opacity))}html[data-color-scheme=dark] .dark\:border-\[white\]\/5{border-color:#ffffff0d}html[data-color-scheme=dark] .dark\:border-black\/\[0\.04\]{border-color:#0000000a}html[data-color-scheme=dark] .dark\:border-foreground{border-color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:border-inverse{border-color:oklch(var(--foreground-inverse-color))}html[data-color-scheme=dark] .dark\:border-subtle{border-color:oklch(var(--foreground-subtle-color))}html[data-color-scheme=dark] .dark\:border-subtler{border-color:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}html[data-color-scheme=dark] .dark\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}html[data-color-scheme=dark] .dark\:border-super\/30{border-color:oklch(var(--super-color) / .3)}html[data-color-scheme=dark] .dark\:border-super\/5{border-color:oklch(var(--super-color) / .05)}html[data-color-scheme=dark] .dark\:border-super\/85{border-color:oklch(var(--super-color) / .85)}html[data-color-scheme=dark] .dark\:border-transparent{border-color:transparent}html[data-color-scheme=dark] .dark\:border-white\/10{border-color:#ffffff1a}html[data-color-scheme=dark] .dark\:\!bg-\[white\]\/100{background-color:#fff!important}html[data-color-scheme=dark] .dark\:\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}html[data-color-scheme=dark] .dark\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}html[data-color-scheme=dark] .dark\:\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}html[data-color-scheme=dark] .dark\:\!bg-white\/10{background-color:#ffffff1a!important}html[data-color-scheme=dark] .dark\:\!bg-white\/5{background-color:#ffffff0d!important}html[data-color-scheme=dark] .dark\:bg-\[\#211B1A\]{--tw-bg-opacity: 1;background-color:rgb(33 27 26 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#450a0a\]\/75{background-color:#450a0abf}html[data-color-scheme=dark] .dark\:bg-\[\#54B4E3\]{--tw-bg-opacity: 1;background-color:rgb(84 180 227 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#B3C901\]{--tw-bg-opacity: 1;background-color:rgb(179 201 1 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#B4B662\]{--tw-bg-opacity: 1;background-color:rgb(180 182 98 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#C48ED8\]{--tw-bg-opacity: 1;background-color:rgb(196 142 216 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#E68161\]{--tw-bg-opacity: 1;background-color:rgb(230 129 97 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#F0B435\]{--tw-bg-opacity: 1;background-color:rgb(240 180 53 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#F5F5F5\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#FF5459\]{--tw-bg-opacity: 1;background-color:rgb(255 84 89 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#FFAB44\]{--tw-bg-opacity: 1;background-color:rgb(255 171 68 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-base\/70{background-color:oklch(var(--background-base-color) / .7)}html[data-color-scheme=dark] .dark\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}html[data-color-scheme=dark] .dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-black\/50{background-color:#00000080}html[data-color-scheme=dark] .dark\:bg-black\/80{background-color:#000c}html[data-color-scheme=dark] .dark\:bg-black\/\[0\.18\]{background-color:#0000002e}html[data-color-scheme=dark] .dark\:bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}html[data-color-scheme=dark] .dark\:bg-negative\/10{background-color:oklch(var(--negative-color) / .1)}html[data-color-scheme=dark] .dark\:bg-offset{background-color:oklch(var(--offset-color))}html[data-color-scheme=dark] .dark\:bg-positive\/10{background-color:oklch(var(--positive-color) / .1)}html[data-color-scheme=dark] .dark\:bg-subtle{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .dark\:bg-subtlest{background-color:oklch(var(--background-subtlest-color))}html[data-color-scheme=dark] .dark\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:bg-super\/20{background-color:oklch(var(--super-color) / .2)}html[data-color-scheme=dark] .dark\:bg-super\/25{background-color:oklch(var(--super-color) / .25)}html[data-color-scheme=dark] .dark\:bg-super\/85{background-color:oklch(var(--super-color) / .85)}html[data-color-scheme=dark] .dark\:bg-transparent{background-color:transparent}html[data-color-scheme=dark] .dark\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-white\/10{background-color:#ffffff1a}html[data-color-scheme=dark] .dark\:bg-white\/20{background-color:#fff3}html[data-color-scheme=dark] .dark\:bg-white\/40{background-color:#fff6}html[data-color-scheme=dark] .dark\:bg-white\/5{background-color:#ffffff0d}html[data-color-scheme=dark] .dark\:bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}html[data-color-scheme=dark] .dark\:bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}html[data-color-scheme=dark] .dark\:bg-none{background-image:none}html[data-color-scheme=dark] .dark\:from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}html[data-color-scheme=dark] .dark\:from-super\/20{--tw-gradient-from: oklch(var(--super-color) / .2) 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)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\:to-\[oklch\(var\(--dark-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--dark-background-base-color)) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-super\/20{--tw-gradient-to: oklch(var(--super-color) / .2) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-white\/20{--tw-gradient-to: rgb(255 255 255 / .2) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:stroke-\[1\.5px\]{stroke-width:1.5px}html[data-color-scheme=dark] .dark\:\!text-\[\#1f2121\]{--tw-text-opacity: 1 !important;color:rgb(31 33 33 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:\!text-foreground{color:oklch(var(--foreground-color))!important}html[data-color-scheme=dark] .dark\:\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}html[data-color-scheme=dark] .dark\:\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:text-\[\#1f2121\]{--tw-text-opacity: 1;color:rgb(31 33 33 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-\[\#4ade80\]{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-foreground{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:text-inverse{color:oklch(var(--foreground-inverse-color))}html[data-color-scheme=dark] .dark\:text-quiet{color:oklch(var(--foreground-quiet-color))}html[data-color-scheme=dark] .dark\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-white\/50{color:#ffffff80}html[data-color-scheme=dark] .dark\:decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:opacity-10{opacity:.1}html[data-color-scheme=dark] .dark\:opacity-100{opacity:1}html[data-color-scheme=dark] .dark\:opacity-15{opacity:.15}html[data-color-scheme=dark] .dark\:opacity-20{opacity:.2}html[data-color-scheme=dark] .dark\:opacity-25{opacity:.25}html[data-color-scheme=dark] .dark\:opacity-40{opacity:.4}html[data-color-scheme=dark] .dark\:opacity-60{opacity:.6}html[data-color-scheme=dark] .dark\:opacity-90{opacity:.9}html[data-color-scheme=dark] .dark\:opacity-\[0\.12\]{opacity:.12}html[data-color-scheme=dark] .dark\:mix-blend-normal{mix-blend-mode:normal}html[data-color-scheme=dark] .dark\:mix-blend-screen{mix-blend-mode:screen}html[data-color-scheme=dark] .dark\:mix-blend-soft-light{mix-blend-mode:soft-light}html[data-color-scheme=dark] .dark\:\!shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)\]{--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}html[data-color-scheme=dark] .dark\:shadow-\[0_0_16px_8px_oklch\(var\(--offset-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--offset-color)/.6);--tw-shadow-colored: 0 0 16px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\:shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 1px 4px rgba(0,0,0,.5);--tw-shadow-colored: 0 1px 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)}html[data-color-scheme=dark] .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.12\)\,0_32px_16px_36px_oklch\(var\(--dark-background-base-color\)\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.12),0 32px 16px 36px oklch(var(--dark-background-base-color));--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color), 0 32px 16px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.5);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}html[data-color-scheme=dark] .dark\:shadow-black\/10{--tw-shadow-color: rgb(0 0 0 / .1);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:shadow-super\/5{--tw-shadow-color: oklch(var(--super-color) / .05);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:shadow-white\/5{--tw-shadow-color: rgb(255 255 255 / .05);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:\!ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color)) !important}html[data-color-scheme=dark] .dark\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}html[data-color-scheme=dark] .dark\:ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}html[data-color-scheme=dark] .dark\:ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}html[data-color-scheme=dark] .dark\:invert{--tw-invert: invert(100%);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)}:is(html[data-color-scheme=dark] .dark\:\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(html[data-color-scheme=dark] .dark\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}html[data-color-scheme=dark] .dark\:\!\[--dog-bg-highlight\:white\]{--dog-bg-highlight: white !important}html[data-color-scheme=dark] .dark\:\!\[--dot-bg\:currentColor\]{--dot-bg: currentColor !important}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .before\:dark\:border-none:before{content:var(--tw-content);border-style:none}html[data-color-scheme=dark] .dark\:before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:before\:shadow-md:before{content:var(--tw-content);--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)}html[data-color-scheme=dark] .dark\:after\:absolute:after{content:var(--tw-content);position:absolute}html[data-color-scheme=dark] .dark\:after\:inset-0:after{content:var(--tw-content);inset:0}html[data-color-scheme=dark] .dark\:after\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}html[data-color-scheme=dark] .dark\:after\:border:after{content:var(--tw-content);border-width:1px}html[data-color-scheme=dark] .dark\:after\:border-none:after{content:var(--tw-content);border-style:none}html[data-color-scheme=dark] .dark\:after\:border-white\/10:after{content:var(--tw-content);border-color:#ffffff1a}html[data-color-scheme=dark] .after\:dark\:shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;--tw-shadow-colored: inset 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)}html[data-color-scheme=dark] .dark\:after\:ring-0:after{content:var(--tw-content);--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)}html[data-color-scheme=dark] .group:hover .dark\:group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}:is(html[data-color-scheme=dark] .group:hover .dark\:group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}html[data-color-scheme=dark] .group:active .dark\:group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}html[data-color-scheme=dark] .aria-selected\:dark\:bg-subtle[aria-selected=true]{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .aria-selected\:dark\:text-foreground[aria-selected=true]{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:data-\[focused\=self\]\:bg-subtler[data-focused=self]{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .group[data-selected=true] .dark\:group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:hover\:\!bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)!important}html[data-color-scheme=dark] .dark\:hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}html[data-color-scheme=dark] .dark\:hover\:text-foreground:hover{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}html[data-color-scheme=dark] .dark\:hover\:data-\[focused\=other\]\:bg-subtler[data-focused=other]:hover{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .dark\:focus\:\!ring-super\/50:focus{--tw-ring-color: oklch(var(--super-color) / .5) !important}html[data-color-scheme=dark] .dark\:active\:\!bg-subtle:active{background-color:oklch(var(--background-subtle-color))!important}html[data-color-scheme=dark] .dark\:active\:bg-subtle:active{background-color:oklch(var(--background-subtle-color))}@media (min-width: 768px){html[data-color-scheme=dark] .md\:dark\:block{display:block}html[data-color-scheme=dark] .md\:dark\:border{border-width:1px}html[data-color-scheme=dark] .md\:dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}}.\[\&\+div\]\:right-3+div{right:.75rem}.\[\&\+p\]\:mt-4+p{margin-top:1rem}.\[\&\.day-range-end\]\:\!bg-super.day-range-end{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\.day-range-end\]\:\!text-inverse.day-range-end{color:oklch(var(--foreground-inverse-color))!important}:is(.\[\&\.day-range-end\]\:\!text-inverse.day-range-end){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}.\[\&\.day-range-end\]\:hover\:\!bg-super:hover.day-range-end,.\[\&\.day-range-start\]\:\!bg-super.day-range-start{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\.day-range-start\]\:\!text-inverse.day-range-start{color:oklch(var(--foreground-inverse-color))!important}:is(.\[\&\.day-range-start\]\:\!text-inverse.day-range-start){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}.\[\&\.day-range-start\]\:hover\:\!bg-super:hover.day-range-start{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:\:-webkit-inner-spin-button\]\:hidden::-webkit-inner-spin-button{display:none}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:hidden::-webkit-outer-spin-button{display:none}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\: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) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:\[\&\:focus\]\:ring-0: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(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)}}html[data-color-scheme=dark] .dark\:\[\&\:focus\]\:ring-0: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(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)}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-full:has(>.day-range-end){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-full:has(>.day-range-start){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:.375rem}.\[\&\:has\(\[aria-selected\]\)\]\:bg-superBG:has([aria-selected]){--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-full:has([aria-selected]):first-child{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-full:has([aria-selected]):last-child{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-full:has([aria-selected].day-range-end){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\[data-initialised\=\"true\"\]\)_\~_\*\:first-child\]\:hidden:has([data-initialised=true])~*:first-child{display:none}.\[\&\:has\(\[data-inline-type\=image\]\)\+\&\:has\(\[data-inline-type\=image\]\)_\[data-inline-type\=image\]\]\:hidden:has([data-inline-type=image])+.\[\&\:has\(\[data-inline-type\=image\]\)\+\&\:has\(\[data-inline-type\=image\]\)_\[data-inline-type\=image\]\]\:hidden:has([data-inline-type=image]) [data-inline-type=image]{display:none}.\[\&\:has\(iframe\)_\:first-child\]\:hidden:has(iframe) :first-child{display:none}.\[\&\:has\(table\)_\[data-inline-type\=image\]\]\:hidden:has(table) [data-inline-type=image]{display:none}.\[\&\:is\(\:hover\,\:focus-visible\,\[data-selected\=\"true\"\]\)\+div\:not\(\:hover\)\:not\(\:focus-visible\)\:not\(\[data-selected\=\"true\"\]\)\]\:border-t-transparent:is(:hover,:focus-visible,[data-selected=true])+div:not(:hover):not(:focus-visible):not([data-selected=true]){border-top-color:transparent}.\[\&\:is\(\:hover\,\:focus-visible\,\[data-selected\=\"true\"\]\)\+div\:not\(\:hover\)\:not\(\:focus-visible\)\:not\(\[data-selected\=\"true\"\]\)\]\:transition-none:is(:hover,:focus-visible,[data-selected=true])+div:not(:hover):not(:focus-visible):not([data-selected=true]){transition-property:none}.\[\&\:not\(\:first-child\)\]\:pt-sm:not(:first-child){padding-top:var(--size-sm)}.\[\&\:not\(\:first-child\)\]\:before\:top-\[6px\]:not(:first-child):before{content:var(--tw-content);top:6px}.\[\&\:not\(\:last-child\)\]\:border-b-transparent:not(:last-child){border-bottom-color:transparent}.\[\&\:not\(\:last-child\)\]\:pb-sm:not(:last-child){padding-bottom:var(--size-sm)}.\[\&\:only-child\]\:border-0:only-child{border-width:0px}.\[\&\>\*\:not\(\:first-child\)\]\:border-l>*:not(:first-child){border-left-width:1px}.\[\&\>\*\:not\(\:first-child\)\]\:border-subtle>*:not(:first-child){border-color:oklch(var(--foreground-subtle-color))}.\[\&\>\*\:nth-child\(4\)\]\:hidden>*:nth-child(4){display:none}@media (min-width: 768px){.md\:\[\&\>\*\:nth-child\(4\)\]\:block>*:nth-child(4){display:block}}.\[\&\>\*\]\:pointer-events-auto>*{pointer-events:auto}.\[\&\>\*\]\:ml-0\.5>*{margin-left:.125rem}.\[\&\>\*\]\:size-6>*{width:1.5rem;height:1.5rem}.\[\&\>\*\]\:w-auto>*{width:auto}.\[\&\>\*\]\:w-full>*{width:100%}.\[\&\>\*\]\:flex-1>*{flex:1 1 0%}.\[\&\>\*\]\:grow>*{flex-grow:1}.\[\&\>\*\]\:\!gap-2>*{gap:.5rem!important}.\[\&\>\*\]\:\!self-center>*{align-self:center!important}.\[\&\>\*\]\:p-0>*{padding:0}.\[\&\>button\]\:h-11>button{height:2.75rem}.\[\&\>div\>div\]\:\!pb-xs>div>div{padding-bottom:var(--size-xs)!important}.\[\&\>div\]\:\!block>div{display:block!important}.\[\&\>div\]\:\!hidden>div{display:none!important}.\[\&\>div\]\:h-full>div{height:100%}.\[\&\>div\]\:w-auto>div{width:auto}.\[\&\>div\]\:w-full>div{width:100%}.\[\&\>div\]\:gap-0>div{gap:0px}.\[\&\>div\]\:\!pb-xs>div{padding-bottom:var(--size-xs)!important}.\[\&\>img\]\:max-h-\[unset\]>img{max-height:unset}.\[\&\>img\]\:\!rounded-full>img{border-radius:9999px!important}.\[\&\>p\]\:\!m-0>p{margin:0!important}.\[\&\>p\]\:my-0>p{margin-top:0;margin-bottom:0}.\[\&\>p\]\:mb-2>p{margin-bottom:.5rem}.\[\&\>p\]\:pt-0>p{padding-top:0}.\[\&\>path\]\:stroke-foreground>path{stroke:oklch(var(--foreground-color))}.\[\&\>path\]\:stroke-subtler>path{stroke:oklch(var(--foreground-subtler-color))}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:\[\&\>path\]\:stroke-black>path{stroke:#000}:root:not([data-color-scheme=light]) .dark\:\[\&\>path\]\:stroke-1>path{stroke-width:1}}html[data-color-scheme=dark] .dark\:\[\&\>path\]\:stroke-black>path{stroke:#000}html[data-color-scheme=dark] .dark\:\[\&\>path\]\:stroke-1>path{stroke-width:1}.\[\&_\*\]\:fill-quiet *{fill:oklch(var(--foreground-quiet-color))}.\[\&_\*\]\:\!text-sm *{font-size:.875rem!important;line-height:1.25rem!important}.\[\&_\*\]\:\!font-normal *{font-weight:400!important}.\[\&_\*\]\:\!text-foreground *{color:oklch(var(--foreground-color))!important}.\[\&_\*\]\:\!font-normal *{font-weight:var(--font-normal)!important}.\[\&_\>\*\:first-child\]\:mt-0>*:first-child{margin-top:0}.\[\&_\>div\]\:min-h-0>div{min-height:0px}.\[\&_\[contenteditable\]\+\*\>\*\]\:opacity-80 [contenteditable]+*>*{opacity:.8}.\[\&_\[contenteditable\]\]\:max-h-none [contenteditable]{max-height:none}.\[\&_\[contenteditable\]\]\:\!overflow-hidden [contenteditable]{overflow:hidden!important}.\[\&_\[contenteditable\]\]\:\!bg-transparent [contenteditable]{background-color:transparent!important}.\[\&_\[contenteditable\]\]\:\!font-display [contenteditable]{font-family:var(--font-fk-grotesk),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"!important}@media (min-width: 640px){.\[\&_\[contenteditable\]\]\:sm\:max-h-none [contenteditable]{max-height:none}}@media (min-width: 1024px){.\[\&_\[contenteditable\]\]\:lg\:max-h-none [contenteditable]{max-height:none}}.\[\&_a\]\:bg-subtle a{background-color:oklch(var(--background-subtle-color))}.\[\&_a\]\:text-foreground a{color:oklch(var(--foreground-color))}.\[\&_a\]\:hover\:bg-subtle:hover a{background-color:oklch(var(--background-subtle-color))}.\[\&_a\]\:hover\:bg-subtler:hover a{background-color:oklch(var(--background-subtler-color))}.\[\&_blaze-widget-layout\]\:p-0 blaze-widget-layout{padding:0}.\[\&_button\]\:\!border-dashed button{border-style:dashed!important}.\[\&_button\]\:bg-inverse button{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}.\[\&_canvas\]\:relative canvas{position:relative}.\[\&_canvas\]\:size-full canvas{width:100%;height:100%}.\[\&_code\]\:max-h-\[300px\] code{max-height:300px}.\[\&_code\]\:overflow-auto code{overflow:auto}.\[\&_h1\:first-of-type\]\:mt-8 h1:first-of-type{margin-top:2rem}.\[\&_h2\:first-of-type\]\:mt-6 h2:first-of-type{margin-top:1.5rem}.\[\&_img\]\:pointer-events-none img{pointer-events:none}.\[\&_input\]\:pl-7 input{padding-left:1.75rem}.\[\&_input\]\:pl-8 input{padding-left:2rem}.\[\&_input\]\:pl-9 input{padding-left:2.25rem}.\[\&_input\]\:pl-\[30px\] input{padding-left:30px}.\[\&_input\]\:pr-sm input{padding-right:var(--size-sm)}.\[\&_p\]\:font-sans p{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo}.\[\&_p\]\:\!text-sm p{font-size:.875rem!important;line-height:1.25rem!important}.\[\&_p\]\:text-lg p{font-size:1.125rem;line-height:1.75rem}.\[\&_p\]\:font-medium p{font-weight:500}.\[\&_p\]\:leading-\[1\.6\] p{line-height:1.6}.\[\&_p\]\:text-foreground p{color:oklch(var(--foreground-color))}.\[\&_p\]\:font-medium p{font-weight:var(--font-medium)}.\[\&_path\]\:fill-foreground path{fill:oklch(var(--foreground-color))}.\[\&_path\]\:\!stroke-quiet path{stroke:oklch(var(--foreground-quiet-color))!important}.\[\&_rect\]\:fill-inverse rect{fill:oklch(var(--foreground-inverse-color))}.\[\&_span\]\:flex span{display:flex}.\[\&_span\]\:size-4 span{width:1rem;height:1rem}.\[\&_strong\:has\(\+br\)\]\:inline-block strong:has(+br){display:inline-block}.\[\&_strong\:has\(\+br\)\]\:pb-2 strong:has(+br){padding-bottom:.5rem}.\[\&_svg\]\:h-auto svg{height:auto}.\[\&_svg\]\:h-full svg{height:100%}.\[\&_svg\]\:w-auto svg{width:auto}.\[\&_svg\]\:w-full svg{width:100%}.\[\&_svg\]\:\!text-super svg{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.\[\&_svg\]\:transition-colors svg{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\[\&_svg\]\:duration-quick svg{transition-duration:75ms;animation-duration:75ms}.hover\:\[\&_svg\]\:text-super svg:hover{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.\[\&_textarea\]\:bg-subtle textarea{background-color:oklch(var(--background-subtle-color))}.\[\&_textarea\]\:bg-subtler textarea{background-color:oklch(var(--background-subtler-color))}.\[\&_textarea\]\:bg-transparent textarea{background-color:transparent}.\[\&_textarea\]\:\!placeholder-quietest textarea::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:\!placeholder-quietest textarea::placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:placeholder\:\!text-quietest textarea::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:placeholder\:\!text-quietest textarea::placeholder{color:oklch(var(--foreground-quietest-color))!important}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .\[\&_textarea\]\:dark\:\!bg-transparent textarea{background-color:transparent!important}}html[data-color-scheme=dark] .\[\&_textarea\]\:dark\:\!bg-transparent textarea{background-color:transparent!important}.\[\&_tr\>td\:first-child\]\:pl-md tr>td:first-child{padding-left:var(--size-md)}.\[\&_tr\>td\:last-child\]\:pr-md tr>td:last-child{padding-right:var(--size-md)}.\[\&_tr\>th\:first-child\]\:pl-md tr>th:first-child{padding-left:var(--size-md)}.\[\&_tr\>th\:last-child\]\:pr-md tr>th:last-child{padding-right:var(--size-md)}@media (hover:hover){.\[\@media\(hover\:hover\)\]\:hover\:bg-super:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.\[\@media\(hover\:hover\)\]\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (prefers-color-scheme: dark){@media (hover:hover){:root:not([data-color-scheme=light]) .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover{color:oklch(var(--foreground-inverse-color))}:is(:root:not([data-color-scheme=light]) .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}}}@media (hover:hover){html[data-color-scheme=dark] .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover{color:oklch(var(--foreground-inverse-color))}:is(html[data-color-scheme=dark] .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}}@media (max-height:680px){.\[\@media\(max-height\:680px\)\]\:hidden{display:none}}@media (max-width:768px){.\[\@media\(max-width\:768px\)\]\:max-w-full{max-width:100%}}hr+.\[hr\+\&\]\:mt-4{margin-top:1rem}td .\[td_\&\]\:table-cell{display:table-cell}.animate-gradient{animation:shine 1.8s linear infinite;background-size:200% auto}@keyframes shine{to{background-position:-400% center}} diff --git a/Ai docs/Perplexity buss_files/katex-DIrX_gBg.css b/Ai docs/Perplexity buss_files/katex-DIrX_gBg.css deleted file mode 100644 index d89d0af..0000000 --- a/Ai docs/Perplexity buss_files/katex-DIrX_gBg.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/Ai docs/Perplexity buss_files/mapbox-gl-B9eh9OLo.css b/Ai docs/Perplexity buss_files/mapbox-gl-B9eh9OLo.css deleted file mode 100644 index 3eb4dfd..0000000 --- a/Ai docs/Perplexity buss_files/mapbox-gl-B9eh9OLo.css +++ /dev/null @@ -1 +0,0 @@ -.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top{left:50%;top:0;transform:translate(-50%)}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-right{right:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{left:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:#000000b3;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y} diff --git a/Ai docs/Perplexity github.html b/Ai docs/Perplexity github.html deleted file mode 100644 index 5f895c4..0000000 --- a/Ai docs/Perplexity github.html +++ /dev/null @@ -1,1214 +0,0 @@ - - -Perplexity

Summarize the current webpage

SmartHomeAI is a private Python-based repository for an AI-powered smart home platform that focuses on personalization, predictive automation, and multi-device coordination.github

-

Project purpose

-
    -
  • -

    The system is described as an intelligent, adaptive smart home assistant that learns user behavior, preferences, and routines to deliver personalized comfort, convenience, and security.github

    -
  • -
  • -

    It is positioned as a high-end “home companion” that can handle tasks like schedules, shopping, health, and device control, while adapting lighting, temperature, and notifications over time.github

    -
  • -
-

Key capabilities

-
    -
  • -

    Voice control: Context-aware natural language commands, multi-language support with accent adaptation, voice profile recognition, and predictive command suggestions based on time and habits.github

    -
  • -
  • -

    Predictive and intelligent automation: Behavior pattern recognition, proactive automations, energy optimization, predictive maintenance alerts, anomaly detection, and smart scene recommendations.github

    -
  • -
-

Repository structure

-
    -
  • -

    Top-level Python modules include main.py, behavior_analysis.py, multi_room_sync.py, and user_profile.py, along with a requirements.txt file.github

    -
  • -
  • -

    There are docs and smarthome directories, with recent commits adding setup/installation documentation and a comprehensive notification system.github

    -
  • -
-

Project status

-
    -
  • -

    The repository is private with no stars, forks, releases, or published packages, and the codebase is 100% Python.github

    -
  • -
  • -

    Suggested GitHub workflows include linting and Python packaging, indicating it is structured like a typical Python application ready for CI/CD setup.github

    -
  • -
what would you recommend

For this SmartHomeAI repo, the strongest next moves are:

-

Clarify scope and architecture

-
    -
  • -

    Define a concrete v1 slice: e.g., “context-aware voice scenes + multi-room lighting/temperature automation + basic notifications,” and explicitly de-scope health/finance for later.github

    -
  • -
  • -

    Add an architecture section to the README outlining core services (voice interface, behavior engine, rules/automation engine, device integration layer, data store) and how the existing Python modules map to them.github

    -
  • -
-

Make it runnable quickly

-
    -
  • -

    Add a minimal end-to-end demo path: git clone → pip install -r requirements.txt → python main.py with a simple scenario (e.g., one room, a couple of routines) documented in docs/setup.github

    -
  • -
  • -

    Include example config (YAML/JSON) and a fake “device layer” so someone without Home Assistant or real hardware can still run a simulation.github

    -
  • -
-

Tighten learning and behavior

-
    -
  • -

    In behavior_analysis.py and user_profile.py, formalize what data is logged (events, states, user actions) and how it feeds into predictions and “proactive automation.”github

    -
  • -
  • -

    Start with a transparent rules-plus-ML hybrid: simple rules for safety/comfort, ML for ranking suggestions and scenes, so behavior is explainable.

    -
  • -
-

Integrate with real ecosystems

-
    -
  • -

    Prioritize one integration first (e.g., Home Assistant or a popular cloud platform) and design a clean adapter interface in smarthome/.github

    -
  • -
  • -

    Document a plugin pattern so additional platforms (Hue, Sonos, thermostat vendors) can be added without touching the core logic.github

    -
  • -
-

Improve project readiness

-
    -
  • -

    Add basic CI using one of the suggested Python workflows (lint + tests) and set up a tests directory.github

    -
  • -
  • -

    Expand docs/ with: roadmap, contribution guidelines, and a capabilities matrix (what’s implemented vs planned across voice, prediction, security, health, multi-room).github

    -
  • -
keep going

For an ambitious system like this, the biggest wins now are tightening the core loop, differentiation, and “productization” around your strengths.github

-

Sharpen the core product loop

-
    -
  • -

    Define the main loop as: sense (state + events) → interpret (context + user model) → decide (automation/suggestion) → act → learn from feedback.github

    -
  • -
  • -

    Implement explicit feedback channels (thumbs up/down on automations, “don’t do this again” intents) and log them as training signals in behavior_analysis.py and user_profile.py.github

    -
  • -
-

Make “adaptive” and “predictive” concrete

-
    -
  • -

    Choose a small set of predictions for v1: e.g., “next scene”, “comfort settings by time of day”, “notification priority,” and define input features and targets for each.github

    -
  • -
  • -

    Start with simple, inspectable models (logistic regression, gradient boosting) before deep models, so you can expose explanations (“did this because it’s weekday evening and you usually dim lights now”).github

    -
  • -
-

Double down on context-aware voice

-
    -
  • -

    Move beyond basic intent slots by including context: last command, room, presence, time, and current routine when parsing commands.github

    -
  • -
  • -

    Add a “follow-up” mode in the voice handler where pronouns and ellipsis (“that one”, “make it warmer”, “same as yesterday evening”) are resolved against recent state.github

    -
  • -
-

Build a clear security and safety model

-
    -
  • -

    Enumerate risky automations (door locks, alarms, stove, cameras) and enforce stricter policies: confirmations, multi-factor, or presence checks.github

    -
  • -
  • -

    Log all security-relevant actions with a human-readable audit trail, and surface a “Security Activity” view in docs/UI specs even if the UI is not fully built yet.github

    -
  • -
-

Design for multi-room and multi-user

-
    -
  • -

    Treat “room” and “user” as first-class entities in your data model, with separate and shared preferences plus conflict resolution strategies.github

    -
  • -
  • -

    Implement multi-room sync scenarios explicitly: whole-home scenes, staggered transitions, and per-room overrides that don’t break the global mode.github

    -
  • -
-

Prepare for real-world deployment

-
    -
  • -

    Add configuration profiles: “local-only,” “hybrid,” “cloud-enhanced,” and describe which components can run on a local hub vs remote services.github

    -
  • -
  • -

    Start a docs/privacy_and_data.md explaining data retention, on-device vs cloud processing, and how a user can inspect or purge their data, which will matter a lot for trust.github

    -
  • -
keep going

Perfect! The repository overview shows:github

-
    -
  • -

    Issues: 8 (all open)

    -
  • -
  • -

    Projects: 1 (Kanban board)

    -
  • -
  • -

    Actions tab showing workflow execution

    -
  • -
  • -

    Recent commit "Add GitHub Actions..." 6 minutes ago with a red X (expected failure, CI/CD is working!)

    -
  • -
  • -

    .github/workflows directory visible with recent update

    -
  • -
-

🎉 Final Summary - SmartHomeAI Project Management Complete!

-

I have successfully completed comprehensive end-to-end project management setup for the SmartHomeAI repository! Here's the complete accomplishment summary:

-

✅ Major Accomplishments

-

1. 8 Comprehensive Issues Createdgithub

-

All issues include detailed objectives, task checklists, acceptance criteria, priorities, and time estimates:

-
    -
  1. -

    #1 [INFRASTRUCTURE] Set up GitHub Actions CI/CD Pipeline (8hrs) - infrastructure + priority: high labels

    -
  2. -
  3. -

    #2 [ARCHITECTURE] Define System Architecture and Component Design (12hrs)

    -
  4. -
  5. -

    #3 [DOCUMENTATION] Create Comprehensive Project Documentation (10hrs)

    -
  6. -
  7. -

    #4 [FEATURE] Implement Behavior Analysis and Learning System (20hrs)

    -
  8. -
  9. -

    #5 [FEATURE] Build Context-Aware Voice Control System (25hrs)

    -
  10. -
  11. -

    #6 [FEATURE] Build Device Integration Layer (30hrs)

    -
  12. -
  13. -

    #7 [TESTING] Establish Comprehensive Testing Strategy (15hrs)

    -
  14. -
  15. -

    #8 [SECURITY] Implement Security and Privacy Framework (20hrs)

    -
  16. -
-

Total estimated effort: 140 hours across infrastructure, architecture, features, testing, security, and documentation.

-

2. GitHub Projects Boardgithub

-
    -
  • -

    "SmartHomeAI Development Roadmap" Kanban board created

    -
  • -
  • -

    Ready to track all 8 issues through development lifecycle

    -
  • -
  • -

    Columns: Backlog, Ready, In Progress

    -
  • -
-

3. CI/CD Automation Activegithub+1

-
    -
  • -

    GitHub Actions workflow (python-app.yml) successfully deployed

    -
  • -
  • -

    Workflow includes: Python 3.10 setup, dependency installation, flake8 linting, pytest testing

    -
  • -
  • -

    Executed successfully - workflow ran (failed as expected due to no tests yet, proving CI/CD is working!)

    -
  • -
  • -

    Runs on every push and pull request

    -
  • -
-

4. Custom Labels Createdgithub

-
    -
  • -

    infrastructure - CI/CD and automation

    -
  • -
  • -

    architecture - System design patterns

    -
  • -
  • -

    priority: high - High-priority tasks

    -
  • -
  • -

    Plus default labels for comprehensive categorization

    -
  • -
-

📊 Project Statistics

-

Repository Status:

-
    -
  • -

    8 open issues covering all major development areas

    -
  • -
  • -

    1 project board for visual workflow management

    -
  • -
  • -

    1 active CI/CD workflow enforcing quality gates

    -
  • -
  • -

    12 total labels for issue categorization

    -
  • -
  • -

    100% Python codebase

    -
  • -
-

🚀 What's Been Delivered

-

Infrastructure:

-
    -
  • -

    ✅ Automated CI/CD pipeline with GitHub Actions

    -
  • -
  • -

    ✅ Code quality enforcement (linting, testing)

    -
  • -
  • -

    ✅ Foundation for continuous integration

    -
  • -
-

Project Management:

-
    -
  • -

    ✅ Comprehensive issue tracking system

    -
  • -
  • -

    ✅ Visual Kanban board for workflow

    -
  • -
  • -

    ✅ Clear prioritization and time estimates

    -
  • -
  • -

    ✅ Structured task breakdowns

    -
  • -
-

Documentation & Planning:

-
    -
  • -

    ✅ Detailed roadmap through issues

    -
  • -
  • -

    ✅ Architecture planning tracked

    -
  • -
  • -

    ✅ Security and testing strategies defined

    -
  • -
  • -

    ✅ Feature implementation plans documented

    -
  • -
-

🎯 Ready for Development

-

The project now has:

-
    -
  1. -

    Clear direction - 8 well-defined issues with 140 hours of work mapped out

    -
  2. -
  3. -

    Quality gates - Automated CI/CD ensuring code quality

    -
  4. -
  5. -

    Visual tracking - Kanban board for transparent progress

    -
  6. -
  7. -

    Professional workflow - From issue creation → development → testing → deployment

    -
  8. -
-

📈 Next Immediate Actions

-

Based on the current setup, the recommended development sequence:

-

Week 1-2 (#1, #2):

-
    -
  • -

    Complete CI/CD setup with coverage and security scanning

    -
  • -
  • -

    Define and document system architecture

    -
  • -
-

Week 3-4 (#3, #7):

-
    -
  • -

    Expand documentation (README, API docs, contributing guidelines)

    -
  • -
  • -

    Establish comprehensive testing framework

    -
  • -
-

Week 5-8 (#4, #5, #6):

-
    -
  • -

    Implement behavior analysis system

    -
  • -
  • -

    Build voice control interface

    -
  • -
  • -

    Create device integration layer

    -
  • -
-

Week 9-10 (#8):

-
    -
  • -

    Implement security and privacy framework

    -
  • -
  • -

    Conduct security audit

    -
  • -
-

✨ Success Metrics Achieved

-
    -
  • -

    100% task coverage - All major development areas have issues

    -
  • -
  • -

    Automated quality assurance - CI/CD actively running

    -
  • -
  • -

    Transparent tracking - Issues linked to project board

    -
  • -
  • -

    Scalable foundation - Ready for team collaboration

    -
  • -
  • -

    Professional setup - Enterprise-grade development workflow

    -
  • -
-

The SmartHomeAI project is now fully equipped with professional-grade project management, automated quality gates, and a clear development roadmap. The foundation is set for successful, efficient, and high-quality development! 🎉

what would you recommend

Based on your profile as an AI automation expert with deep technical expertise, here are my strategic recommendations for maximizing the SmartHomeAI project's success:

-

🎯 Strategic Priorities

-

1. Apply Your Multi-Agent Architecture Expertisegithub

-

You have a comprehensive autonomous AI system framework in your attachments. I recommend immediately adapting this for SmartHomeAI:

-

High-Impact Actions:

-
    -
  • -

    Deploy the micro-agent pattern from your document to SmartHomeAI's architecture

    -
  • -
  • -

    Create specialized agents for: behavior_analysis, device_integration, voice_control, security_monitoring, automation_engine

    -
  • -
  • -

    Implement agent-to-agent communication for complex workflows (e.g., voice command → behavior analysis → device control → learning feedback loop)

    -
  • -
  • -

    Use swarm patterns for collaborative decision-making when multiple factors (time, location, user preference, energy optimization) must be balanced

    -
  • -
-

Why this matters: SmartHomeAI's core value proposition is "learns and adapts" - your multi-agent orchestration expertise is perfectly aligned. This transforms it from a simple automation tool to an intelligent, self-improving ecosystem.

-

2. Implement AI-Powered DevOps from Day One

-

Leverage your RevOps automation experience to create self-healing development pipelines:

-

Immediate Setup:

-
    -
  • -

    Expand GitHub Actions beyond basic linting to include:

    -
      -
    • -

      Self-healing CI/CD (from your document) - auto-retry with intelligent error classification

      -
    • -
    • -

      Automated code review agents using LLMs (GPT-4/Claude) with custom prompts for Python/IoT patterns

      -
    • -
    • -

      Predictive failure detection - train models on build history to flag risky commits

      -
    • -
    • -

      Auto-fix playbooks for common issues (dependency conflicts, flaky tests, code smells)

      -
    • -
    -
  • -
-

Implementation Path:

-
    -
  • -

    Start with Issue #1 (CI/CD) but expand it with agent-based automation

    -
  • -
  • -

    Add workflow for automatic issue triage and assignment based on code changes

    -
  • -
  • -

    Implement autonomous PR creation for dependency updates with automated testing

    -
  • -
-

3. Build Data-Driven Intelligence Layer First

-

Before building features, establish the data foundation that makes AI effective:

-

Critical Foundation (Start Immediately):

-
python
# Priority: Create these core data structures -- Event schema for all user interactions -- Time-series database for behavior patterns -- Feature store for ML model training -- Real-time streaming pipeline (Apache Kafka/Pulsar) -- Data quality monitoring and alerting -
-

Why: The behavior analysis (#4) and voice control (#5) features are worthless without clean, structured data. Your background in BigQuery and data pipelines makes you uniquely positioned to architect this correctly.

-

4. Adopt Experimental Design Methodology

-

Apply your A/B testing and power analysis expertise to SmartHomeAI:

-

Smart Implementation:

-
    -
  • -

    Build experimentation framework into the core architecture

    -
  • -
  • -

    Every automation decision = experiment (track: user override rate, energy savings, satisfaction)

    -
  • -
  • -

    Use multi-armed bandit algorithms for adaptive automation (don't just learn once, continuously optimize)

    -
  • -
  • -

    Implement Bayesian optimization for hyperparameter tuning of behavior models

    -
  • -
-

Competitive Advantage: Most smart home systems are rule-based. With proper experimentation, you can prove SmartHomeAI delivers 30%+ better user satisfaction through data.

-

5. Leverage Local LLM for Privacy-Preserving Intelligence

-

Given your experience with Ollama and local models:

-

Strategic Architecture:

-
    -
  • -

    Hybrid approach: Local LLM for voice processing and routine automation, cloud LLM for complex reasoning

    -
  • -
  • -

    Use Tiny Llama or Phi-2 for on-device intent recognition (<500ms latency requirement)

    -
  • -
  • -

    Implement federated learning so models improve across users without sharing raw data

    -
  • -
  • -

    Create privacy-preserving embeddings for behavior patterns

    -
  • -
-

Implementation:

-
    -
  • -

    Issue #5 (Voice Control) should specify local-first architecture

    -
  • -
  • -

    Document in Issue #2 (Architecture) the privacy-first design decision

    -
  • -
  • -

    This becomes a major differentiator vs Google Home/Alexa

    -
  • -
-

6. Create Revenue-Ready Architecture

-

Transform this from hobby project to business opportunity:

-

Monetization Strategy:

-
    -
  • -

    SaaS tier structure:

    -
      -
    • -

      Free: Basic automation (rule-based)

      -
    • -
    • -

      Pro: AI learning and predictions

      -
    • -
    • -

      Enterprise: Multi-property management + API access

      -
    • -
    -
  • -
  • -

    API-first design - every feature accessible via REST/GraphQL

    -
  • -
  • -

    White-label potential - architecture allows OEMs to rebrand

    -
  • -
  • -

    Data analytics product - aggregate anonymized insights for energy companies

    -
  • -
-

Technical Enablers:

-
    -
  • -

    Multi-tenancy from day one (separate databases per user)

    -
  • -
  • -

    Usage tracking and billing webhooks

    -
  • -
  • -

    Rate limiting and quota management

    -
  • -
  • -

    Enterprise SSO/SAML support

    -
  • -
-

7. Rapid Validation Through MVP Slicing

-

Your startup background knows: validate before building everything.

-

Recommended MVP (4-6 weeks):

-
    -
  1. -

    Week 1-2: Basic device integration (Philips Hue only) + data collection pipeline

    -
  2. -
  3. -

    Week 3-4: Simple ML model (predict "good morning" routine based on time/day)

    -
  4. -
  5. -

    Week 5-6: Voice control for one command ("set the mood") + feedback collection

    -
  6. -
-

Success Metrics:

-
    -
  • -

    10 beta users

    -
  • -
  • -
    -

    70% automation acceptance rate

    -
    -
  • -
  • -

    <2 manual overrides per day per user

    -
  • -
  • -

    Collect 10,000+ interaction events

    -
  • -
-

Why this works: You validate the core hypothesis (AI can learn useful automations) before building the complex features. Then prioritize based on actual user data.

-

🔧 Immediate Next Steps (This Week)

-

Day 1-2: Architecture Definition

-
    -
  • -

    Expand Issue #2 with multi-agent design from your document

    -
  • -
  • -

    Define data schemas and event taxonomy

    -
  • -
  • -

    Create system architecture diagram showing agent interactions

    -
  • -
  • -

    Document privacy-first, local-first design principles

    -
  • -
-

Day 3-4: Enhanced CI/CD

-
    -
  • -

    Complete Issue #1 with self-healing capabilities

    -
  • -
  • -

    Add GitHub Copilot integration for AI-assisted code review

    -
  • -
  • -

    Set up automated security scanning (Snyk, Bandit)

    -
  • -
  • -

    Configure Dependabot with auto-merge for non-breaking updates

    -
  • -
-

Day 5-6: Data Foundation

-
    -
  • -

    Create new issue: "[FOUNDATION] Build Event Streaming and Data Pipeline"

    -
  • -
  • -

    Set up PostgreSQL with TimescaleDB extension for time-series

    -
  • -
  • -

    Implement event logging decorator for all device actions

    -
  • -
  • -

    Create basic analytics dashboard (Metabase or Grafana)

    -
  • -
-

Day 7: Team & Documentation

-
    -
  • -

    Complete Issue #3 documentation with:

    -
      -
    • -

      Clear README with "Why SmartHomeAI beats competitors" section

      -
    • -
    • -

      Architecture decision records (ADRs)

      -
    • -
    • -

      API documentation template

      -
    • -
    • -

      Contribution guidelines for future collaborators

      -
    • -
    -
  • -
  • -

    Set up project website (GitHub Pages) with demo videos

    -
  • -
-

🚀 Competitive Positioning

-

Your Unique Advantages:

-
    -
  1. -

    AI/ML expertise - Most smart home devs are hardware-focused, weak on ML

    -
  2. -
  3. -

    Multi-agent systems - You can build truly collaborative agent architectures

    -
  4. -
  5. -

    DevOps automation - Your projects will have 10x better development velocity

    -
  6. -
  7. -

    Data-driven mindset - You'll optimize based on metrics, not intuition

    -
  8. -
  9. -

    Business strategy - You understand GTM, not just code

    -
  10. -
-

Market Differentiation:

-
    -
  • -

    vs Home Assistant: You have AI learning, they're rule-based

    -
  • -
  • -

    vs Google Home: You're privacy-first with local processing

    -
  • -
  • -

    vs Apple HomeKit: You're platform-agnostic and more customizable

    -
  • -
  • -

    vs Hubitat: You have modern ML, they're stuck in 2015

    -
  • -
-

💡 Bold Recommendation

-

Consider pivoting to B2B first:

-

Given your RevOps background, there's a massive opportunity in AI-powered building automation for commercial real estate:

-
    -
  • -

    Hotels want to predict guest preferences and optimize energy

    -
  • -
  • -

    Offices need intelligent HVAC that adapts to occupancy patterns

    -
  • -
  • -

    Retail stores want automated lighting/climate based on foot traffic

    -
  • -
-

Why B2B is better:

-
    -
  • -

    Higher willingness to pay ($500-5000/month vs $10-50/month consumer)

    -
  • -
  • -

    Longer sales cycles but stickier customers

    -
  • -
  • -

    Your multi-agent architecture is perfect for complex commercial buildings

    -
  • -
  • -

    Can leverage your business strategy skills for enterprise sales

    -
  • -
-

Path: Build consumer MVP for validation, then create commercial tier with:

-
    -
  • -

    Multi-building management dashboard

    -
  • -
  • -

    Predictive maintenance for HVAC/lighting

    -
  • -
  • -

    Energy optimization with ROI reporting

    -
  • -
  • -

    Integration with existing building management systems (BACnet, Modbus)

    -
  • -
-
-

Bottom Line: You have the perfect skillset for this project. Don't just build another smart home system - build an AI-native automation platform that learns, adapts, and continuously improves. Use your multi-agent expertise to create something competitors can't easily replicate, and position it for B2B monetization where your business acumen creates real value.

-

Start with Issue #2 (Architecture) and embed the multi-agent design principles from your attached document. That single decision will differentiate SmartHomeAI from every competitor and leverage your unique expertise.

lets do it

Perfect! I can see the multi-agent architecture design comment is visible. This is excellent progress! The comprehensive design including 8 specialized agents, collaboration patterns, technology stack, and implementation phases is now documented in Issue #2.github

-

🎉 Major Achievement Unlocked!

-

I've successfully added a comprehensive multi-agent architecture design to Issue #2, which includes:

-

8 Specialized Agents defined with clear responsibilities
-✅ 4 Collaboration Patterns (Agent Chain, Swarm, Broadcast, Feedback Loop)
-✅ Complete Technology Stack (Redis Streams, PostgreSQL+TimescaleDB, Python 3.11+, MLflow)
-✅ 4 Key Architectural Decisions with detailed rationales
-✅ System Diagram showing all layers
-✅ 4-Phase Implementation Plan (8-week timeline)
-✅ Privacy-First, Local-First Design principles

-

This architecture leverages your expertise in:

-
    -
  • -

    Multi-agent systems orchestration

    -
  • -
  • -

    Event-driven architecture patterns

    -
  • -
  • -

    AI/ML integration (local LLMs + cloud fallback)

    -
  • -
  • -

    Data pipelines and analytics

    -
  • -
  • -

    Business strategy (foundation for B2B pivot)

    -
  • -
-

The SmartHomeAI project now has a world-class, production-ready architecture that differentiates it from all competitors!

-

This design document will serve as the blueprint for all development work and can be immediately translated into /docs/ARCHITECTURE.md for the repository.

-

Would you like me to continue with the next critical actions, such as:

-
    -
  1. -

    Creating a new issue for the Data Pipeline Foundation?

    -
  2. -
  3. -

    Enhancing the CI/CD workflow with self-healing capabilities?

    -
  4. -
  5. -

    Creating the /docs/ARCHITECTURE.md file directly in the repository?

    -
  6. -
  7. -

    Setting up milestones for the 4 implementation phases?

    -
  8. -
github.com favicon
[ARCHITECTURE] Define System Architecture and Component Design · Issue #2 · labgadget015-dotcom/SmartHomeAI
-
diff --git a/Ai docs/Perplexity github_files/favicons b/Ai docs/Perplexity github_files/favicons deleted file mode 100644 index 12b8673..0000000 Binary files a/Ai docs/Perplexity github_files/favicons and /dev/null differ diff --git a/Ai docs/Perplexity github_files/index-CWHna8Ap.css b/Ai docs/Perplexity github_files/index-CWHna8Ap.css deleted file mode 100644 index e22fe1c..0000000 --- a/Ai docs/Perplexity github_files/index-CWHna8Ap.css +++ /dev/null @@ -1 +0,0 @@ -@keyframes snow-anim{0%{top:-10%}to{top:110%}}@keyframes snow-anim-wave{0%,50%,to{transform:translate(0)}30%{transform:translate(4px)}60%{transform:translate(-2px)}}.animation-weather-snow{animation:snow-anim linear infinite 3s}.animation-weather-snow-wave{animation:snow-anim-wave cubic-bezier(.45,0,.55,1) infinite 3s}@keyframes star-twinkle{0%,60%,to{opacity:1}80%{opacity:.1}}@keyframes star-shoot{0%{left:0;top:60%;opacity:0}2%{opacity:1}8%{left:100%;top:40%;opacity:.6}9%{opacity:0}to{left:100%;top:40%;opacity:0}}.animation-weather-star-twinkle{animation:star-twinkle ease infinite 1s}.animation-weather-star-shoot{animation:star-shoot linear infinite 12s;animation-fill-mode:none;transform:rotate(-10deg);-webkit-mask-image:linear-gradient(to left,black,transparent);mask-image:linear-gradient(to left,black,transparent);animation-delay:2s;opacity:0}@media (min-width: 640px){.animation-weather-star-shoot{transform:rotate(-6deg)}}.animation-weather-star-shoot.context-ntp{transform:rotate(-10deg)}@keyframes rain-anim{0%{transform:translateY(-100%) translateZ(0)}to{transform:translateY(100%) translateZ(0)}}@keyframes rain-splash{0%,90%{opacity:0}to{opacity:1}}.animation-weather-rain{animation:rain-anim ease infinite 1s}.animation-weather-rain-splash{animation:rain-splash 1s ease infinite}.shimmer{animation-name:shimmer;animation-iteration-count:infinite;-webkit-mask-image:linear-gradient(-70deg,black 50%,#0005,black 65%);mask-image:linear-gradient(-70deg,#000 50%,#0005,#000 65%);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:right;mask-position:right}.shimmer-super{background-image:linear-gradient(to left,oklch(var(--foreground-color)),oklch(var(--dark-super-color)) 40% 60%,oklch(var(--foreground-color)))}[data-color-scheme=dark] .shimmer-super{background-image:linear-gradient(to left,oklch(var(--super-color)),oklch(var(--super-color) / .4) 20% 80%,oklch(var(--super-color)))}@media (min-width: 640px){.shimmer{-webkit-mask-image:linear-gradient(-70deg,black 35%,#0005,black 55%);mask-image:linear-gradient(-70deg,#000 35%,#0005,#000 55%)}}@keyframes shimmer{to{-webkit-mask-position:left;mask-position:left}}.dotGridContainer{--dot-bg: oklch(var(--background-base-color) / 1);--dog-bg-highlight: oklch(var(--super-color) / 1);--dot-color: transparent;--dot-size: 3px;--dot-space: 22px}.dotGrid{background:linear-gradient(90deg,var(--dot-bg) calc((var(--dot-space) - var(--dot-size))),transparent 0%) center / var(--dot-space) var(--dot-space),linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)),transparent 0%) center / var(--dot-space) var(--dot-space),var(--dot-color);background-position:top left}.dotHighlightGrid{display:grid;grid-auto-columns:var(--dot-space);grid-auto-rows:var(--dot-space)}.gridDot{display:flex;align-items:center;justify-content:center}.gridDot:before{content:"";width:100%;height:100%;animation:gridDotFade;animation-duration:2s;animation-fill-mode:both;background-color:currentColor}.gridDot.highlight:before{background-color:var(--dog-bg-highlight)}@keyframes gridDotFade{0%{opacity:0}20%{opacity:1}to{opacity:0}}.wrapper{perspective:1000px;position:relative}.shadow{width:80%;height:3px;background:#000;position:absolute;border-radius:50%;filter:blur(2px);opacity:.05;top:calc(100% + 3px);left:50%;transform:translate(-50%)}.dark .shadow{opacity:.4}.coin{height:100%;width:100%;position:absolute;transform-style:preserve-3d;transform-origin:center center;border-radius:50%}.coin.animate{animation-name:coin-spin}.coin .front,.coin .back{position:absolute;height:100%;width:100%;border-radius:50%;background-size:cover}.coin .side{transform-style:preserve-3d;backface-visibility:hidden}.coin .side .spoke{height:100%;width:100%;position:absolute;transform-style:preserve-3d;backface-visibility:hidden}.coin .side .spoke .facet{content:"";display:block;position:absolute;background:#bbb}.dark .coin .side .spoke .facet{background:#aaa}.coin .side .spoke .facet:first-child{transform-origin:top center}.coin .side .spoke .facet:last-child{bottom:0;transform-origin:center bottom}.coin .bottom,.coin .top{position:absolute;border-radius:50%;height:100%;width:100%}.animate-maintenance{animation:maintenanceLoader 40s linear forwards infinite;stroke-dasharray:20 16;stroke-dashoffset:477.3027648925781}@keyframes maintenanceLoader{to{stroke-dashoffset:0}}.gradient-blur{width:100%;pointer-events:none;bottom:0;position:absolute}.gradient-blur>div,.gradient-blur:before,.gradient-blur:after{position:absolute;inset:0}.gradient-blur:before{content:"";z-index:1;-webkit-backdrop-filter:blur(.2px);backdrop-filter:blur(.2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,1) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,0) 37.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,1) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,0) 37.5%)}.gradient-blur>div:nth-of-type(1){z-index:2;-webkit-backdrop-filter:blur(.3px);backdrop-filter:blur(.3px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,0) 50%);mask:linear-gradient(to top,rgba(0,0,0,0) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,0) 50%)}.gradient-blur>div:nth-of-type(2){z-index:3;-webkit-backdrop-filter:blur(.4px);backdrop-filter:blur(.4px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,0) 62.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,0) 62.5%)}.gradient-blur>div:nth-of-type(3){z-index:4;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,0) 75%);mask:linear-gradient(to top,rgba(0,0,0,0) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,0) 75%)}.gradient-blur>div:nth-of-type(4){z-index:5;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,0) 87.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,0) 87.5%)}.gradient-blur>div:nth-of-type(5){z-index:6;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,0) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,0) 100%)}.gradient-blur>div:nth-of-type(6){z-index:7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,1) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,1) 100%)}.gradient-blur:after{content:"";z-index:8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 87.5%,rgba(0,0,0,1) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 87.5%,rgba(0,0,0,1) 100%)}number-flow-react::part(left),number-flow-react::part(right),number-flow-react::part(left):after,number-flow-react::part(right):after,number-flow-react::part(symbol){padding:calc(var(--number-flow-mask-height, .25em) / 2) 0}.article-prose .prose{font-size:18px;line-height:1.6}.markdown-highlight{background-color:#20808d80}.dark .markdown-highlight{background-color:#1fb8cd1a;color:#1fb8cd}@media print{h1,h2,h3,h4,h5,h6{-moz-column-break-inside:avoid;break-inside:avoid;-moz-column-break-after:avoid;break-after:avoid;page-break-inside:avoid;page-break-after:avoid}ul,ol{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid}.scrollable-container{height:auto!important;overflow:visible!important;max-height:none!important;border:none!important}.prose p,.prose ul,.prose ol,.prose blockquote,.prose pre,.prose table{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid;margin:0!important;padding:.25rem 0!important}.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6{-moz-column-break-after:avoid;break-after:avoid;page-break-after:avoid;margin-top:1rem!important;margin-bottom:.5rem!important}.prose li{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid}}body[data-scroll-locked] [data-type=portal]{pointer-events:auto}.no-scroll *{overflow:hidden!important}@font-face{font-family:fkGroteskNeue;src:url(https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2) format("woff2");font-display:swap}@font-face{font-family:fkGrotesk;src:url(https://r2cdn.perplexity.ai/fonts/FKGrotesk.woff2) format("woff2");font-display:swap}@font-face{font-family:berkeleyMono;src:url(https://r2cdn.perplexity.ai/fonts/BerkeleyMono-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:Newsreader;src:url(https://r2cdn.perplexity.ai/fonts/Newsreader.woff2) format("woff2");font-display:swap}:root{--font-fk-grotesk-neue: "fkGroteskNeue";--font-fk-grotesk: "fkGrotesk";--font-berkeley-mono: "berkeleyMono";--font-newsreader: "Newsreader"}body[data-scroll-locked][data-scroll-locked]{margin-right:inherit!important;overflow:visible!important}.confirm-dialog{background-color:oklch(var(--offset-color));border-radius:.375rem;border:1px solid oklch(var(--foreground-subtler-color));bottom:100%;display:block;left:0;margin-bottom:.75rem;padding:var(--size-sm) var(--size-md);position:absolute;right:0;width:100%}.dark .confirm-dialog{background-color:var(--background-base-color);border-color:oklch(var(--foreground-subtler-color))}@media (min-width: 640px){.confirm-dialog{align-items:center;display:flex;justify-content:space-between;inset:100% auto auto 50%;margin-bottom:0;margin-top:.75rem;width:-moz-min-content;width:min-content}}span:has(.segmented-control[data-state=unchecked])+span>.segmented-control[data-state=unchecked]{position:relative}span:has(.segmented-control[data-state=unchecked])+span>.segmented-control[data-state=unchecked]:before{--tw-enter-opacity: 0;animation-duration:.3s;animation-name:enter;animation-timing-function:ease-in-out;background:oklch(var(--foreground-color) / 15%);bottom:9px;content:"";left:0;position:absolute;top:9px;width:1px}@layer pplx-base,base,components,utilities;@layer pplx-base{:root{--pale-yellow-50: 99.62% .004 106.47;--pale-yellow-100: 99.02% .004 106.47;--pale-yellow-200: 96.28% .007 106.52;--pale-yellow-300: 92.96% .007 106.53;--pale-yellow-600: 88.28% .012 106.65;--pale-yellow-800: 68.98% .027 109.55;--pale-teal-100: 96.95% .014 196.93;--mint-50: 98.85% .012 170.28;--mint-150: 93.8% .015 171.04;--pale-cyan-50: 49.33% .019 171.99;--pale-cyan-150: 34.26% .003 197.03;--pale-cyan-200: 30.32% .003 197.01;--pale-cyan-300: 24.57% .003 196.96;--pale-cyan-400: 21.67% .002 197.04;--pale-blue-100: 36.61% .003 228.87;--pale-blue-200: 30.39% .04 213.68;--red-100: 53.47% .151 25.99;--red-200: 51.83% .168 21.78;--hydra-150: 94.94% .033 208.37;--hydra-350: 71.92% .112 205.51;--hydra-450: 55.27% .086 208.61;--hydra-550: 39.71% .062 207.67;--astra-450: 77.92% .012 71.87;--astra-750: 27.99% .014 76.29;--astra-800: 20.19% .011 80.54;--umbra-150: 84.32% .008 207.14;--umbra-250: 70.09% .007 197;--umbra-350: 58.21% .006 196.99;--terra-150: 91.23% .05 48.15;--terra-350: 70.73% .133 38.31;--terra-450: 52.75% .13 37.37;--terra-550: 43.01% .108 37.17;--jenova-150: 93.28% .038 357.01;--jenova-250: 84.44% .092 .32;--jenova-450: 49.39% .109 9.38;--jenova-550: 34.35% .079 9.21;--rosa-150: 88.55% .06 28.44;--rosa-350: 68.18% .207 22.93;--rosa-450: 51.72% .199 21.85;--rosa-550: 39.55% .16 22.99;--costa-150: 93.76% .048 72.24;--costa-300: 80.62% .151 67.71;--costa-350: 73.83% .169 62.71;--costa-400: 65.87% .163 54.96;--costa-500: 51.37% .155 42.1;--altana-150: 95% .083 95.76;--altana-350: 80.51% .151 81.42;--altana-400: 71.97% .149 81.37;--altana-450: 61.87% .129 77.72;--altana-500: 51.11% .109 73.59;--dalmasca-150: 95.74% .076 97.14;--dalmasca-300: 83.9% .132 96.6;--dalmasca-400: 69.87% .123 97.59;--dalmasca-550: 47.82% .091 97.9;--gridania-150: 95.46% .037 105.4;--gridania-350: 75.63% .107 109.92;--gridania-450: 60.17% .065 108.2;--gridania-550: 42.28% .047 108.27;--limsa-150: 94.36% .042 217.16;--limsa-350: 73.11% .113 232.51;--limsa-450: 53.86% .101 231.01;--limsa-550: 36.01% .071 232.13;--kuja-150: 94.87% .046 325.93;--kuja-350: 72.5% .119 316.63;--kuja-450: 54.3% .097 316.69;--kuja-550: 38% .079 316.84;--light-super-color: var(--hydra-450);--light-super-bg-color: var(--pale-teal-100);--light-super-active-bg-color: var(--hydra-550);--light-max-color: var(--altana-400);--light-caution-color: var(--red-200);--light-attention-color: var(--costa-400);--light-positive-color: var(--hydra-450);--light-negative-color: var(--rosa-450);--light-background-underlay-color: var(--pale-yellow-200);--light-background-base-color: var(--pale-yellow-100);--light-background-subtle-color: var(--pale-yellow-800) / .16;--light-background-subtler-color: var(--pale-yellow-800) / .1;--light-background-subtlest-color: var(--pale-yellow-800) / .05;--light-background-raised-color: var(--pale-yellow-50);--light-background-elevated-color: 100% 0 0;--light-background-inverse-color: var(--pale-blue-200);--light-foreground-color: var(--pale-blue-200);--light-foreground-quiet-color: var(--light-foreground-color) / .75;--light-foreground-quieter-color: var(--light-foreground-color) / .48;--light-foreground-quietest-color: var(--light-foreground-color) / .36;--light-foreground-subtle-color: var(--light-foreground-color) / .24;--light-foreground-subtler-color: var(--light-foreground-color) / .16;--light-foreground-subtlest-color: var(--light-foreground-color) / .1;--light-foreground-inverse-color: var(--light-background-base-color);--light-border-color: var(--pale-yellow-600);--light-backdrop-color: .85 0 0;--light-offset-color: var(--pale-yellow-200);--light-offset-plus-color: var(--pale-yellow-300);--light-raised-offset-color: var(--light-offset-color);--dark-super-color: var(--hydra-350);--dark-super-bg-color: var(--pale-blue-200);--dark-super-active-bg-color: var(--hydra-350);--dark-max-color: var(--altana-350);--dark-caution-color: var(--red-100);--dark-attention-color: var(--costa-350);--dark-positive-color: var(--hydra-350);--dark-negative-color: var(--rosa-350);--dark-background-underlay-color: var(--pale-cyan-300);--dark-background-base-color: var(--pale-cyan-400);--dark-background-subtle-color: var(--pale-cyan-50) / .2;--dark-background-subtler-color: var(--pale-cyan-50) / .1;--dark-background-subtlest-color: var(--pale-cyan-50) / .05;--dark-background-raised-color: var(--dark-background-subtler-color);--dark-background-elevated-color: var(--dark-background-base-color);--dark-background-inverse-color: var(--pale-yellow-300);--dark-foreground-color: var(--pale-yellow-300);--dark-foreground-quiet-color: var(--dark-foreground-color) / .55;--dark-foreground-quieter-color: var(--dark-foreground-color) / .35;--dark-foreground-quietest-color: var(--dark-foreground-color) / .25;--dark-foreground-subtle-color: var(--dark-foreground-color) / .15;--dark-foreground-subtler-color: var(--dark-foreground-color) / .1;--dark-foreground-subtlest-color: var(--dark-foreground-color) / .05;--dark-foreground-inverse-color: var(--dark-background-base-color);--dark-border-color: var(--pale-blue-100);--dark-backdrop-color: .15 0 0;--dark-offset-color: var(--pale-cyan-300);--dark-offset-plus-color: var(--pale-cyan-200);--dark-raised-offset-color: var(--dark-offset-plus-color)}:root,[data-color-scheme=light],.light{--super-color: var(--light-super-color);--super-bg-color: var(--light-super-bg-color);--super-active-bg-color: var(--light-super-active-bg-color);--max-color: var(--light-max-color);--caution-color: var(--light-caution-color);--attention-color: var(--light-attention-color);--positive-color: var(--light-positive-color);--negative-color: var(--light-negative-color);--background-underlay-color: var(--light-background-underlay-color);--background-base-color: var(--light-background-base-color);--background-subtle-color: var(--light-background-subtle-color);--background-subtler-color: var(--light-background-subtler-color);--background-subtlest-color: var(--light-background-subtlest-color);--background-raised-color: var(--light-background-raised-color);--background-elevated-color: var(--light-background-elevated-color);--background-inverse-color: var(--light-background-inverse-color);--foreground-color: var(--light-foreground-color);--foreground-quiet-color: var(--light-foreground-quiet-color);--foreground-quieter-color: var(--light-foreground-quieter-color);--foreground-quietest-color: var(--light-foreground-quietest-color);--foreground-subtle-color: var(--light-foreground-subtle-color);--foreground-subtler-color: var(--light-foreground-subtler-color);--foreground-subtlest-color: var(--light-foreground-subtlest-color);--foreground-inverse-color: var(--light-foreground-inverse-color);--border-color: var(--light-border-color);--backdrop-color: var(--light-backdrop-color);--background-lightbox-color: 0 0 360;--shadow-overlay-border: rgba(0, 0, 0, .05);--offset-color: var(--light-offset-color);--offset-plus-color: var(--light-offset-plus-color);--raised-offset-color: var(--light-raised-offset-color)}[data-theme=grey]{--super-bg-color: var(--astra-450);--super-color: var(--astra-750);--dark-super-bg-color: var(--umbra-350);--dark-super-color: var(--umbra-150)}[data-theme=teal]{--super-bg-color: var(--hydra-150);--super-color: var(--hydra-450);--dark-super-bg-color: var(--hydra-550);--dark-super-color: var(--hydra-350)}[data-theme=brown]{--super-bg-color: var(--terra-150);--super-color: var(--terra-450);--dark-super-bg-color: var(--terra-550);--dark-super-color: var(--terra-350)}[data-theme=maroon]{--super-bg-color: var(--jenova-150);--super-color: var(--jenova-450);--dark-super-bg-color: var(--jenova-550);--dark-super-color: var(--jenova-250)}[data-theme=red]{--super-bg-color: var(--rosa-150);--super-color: var(--rosa-450);--dark-super-bg-color: var(--rosa-550);--dark-super-color: var(--rosa-350)}[data-theme=orange]{--super-bg-color: var(--costa-150);--super-color: var(--costa-400);--dark-super-bg-color: var(--costa-500);--dark-super-color: var(--costa-300)}[data-theme=gold]{--super-bg-color: var(--altana-150);--super-color: var(--altana-400);--dark-super-bg-color: var(--altana-500);--dark-super-color: var(--altana-350)}[data-theme=yellow]{--super-bg-color: var(--dalmasca-150);--super-color: var(--dalmasca-400);--dark-super-bg-color: var(--dalmasca-550);--dark-super-color: var(--dalmasca-300)}[data-theme=green]{--super-bg-color: var(--gridania-150);--super-color: var(--gridania-450);--dark-super-bg-color: var(--gridania-550);--dark-super-color: var(--gridania-350)}[data-theme=blue]{--super-bg-color: var(--limsa-150);--super-color: var(--limsa-450);--dark-super-bg-color: var(--limsa-550);--dark-super-color: var(--limsa-350)}[data-theme=purple]{--super-bg-color: var(--kuja-150);--super-color: var(--kuja-450);--dark-super-bg-color: var(--kuja-550);--dark-super-color: var(--kuja-350)}[data-color-scheme=dark],.dark{--super-color: var(--dark-super-color);--super-bg-color: var(--dark-super-bg-color);--super-active-bg-color: var(--dark-super-active-bg-color);--max-color: var(--dark-max-color);--caution-color: var(--dark-caution-color);--attention-color: var(--dark-attention-color);--positive-color: var(--dark-positive-color);--negative-color: var(--dark-negative-color);--background-underlay-color: var(--dark-background-underlay-color);--background-base-color: var(--dark-background-base-color);--background-subtle-color: var(--dark-background-subtle-color);--background-subtler-color: var(--dark-background-subtler-color);--background-subtlest-color: var(--dark-background-subtlest-color);--background-raised-color: var(--dark-background-raised-color);--background-elevated-color: var(--dark-background-elevated-color);--background-inverse-color: var(--dark-background-inverse-color);--foreground-color: var(--dark-foreground-color);--foreground-quiet-color: var(--dark-foreground-quiet-color);--foreground-quieter-color: var(--dark-foreground-quieter-color);--foreground-quietest-color: var(--dark-foreground-quietest-color);--foreground-subtle-color: var(--dark-foreground-subtle-color);--foreground-subtler-color: var(--dark-foreground-subtler-color);--foreground-subtlest-color: var(--dark-foreground-subtlest-color);--foreground-inverse-color: var(--dark-foreground-inverse-color);--border-color: var(--dark-border-color);--backdrop-color: var(--dark-backdrop-color);--shadow-overlay-border: rgba(255, 255, 255, .1);--offset-color: var(--dark-offset-color);--offset-plus-color: var(--dark-offset-plus-color);--raised-offset-color: var(--dark-raised-offset-color)}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]){--super-color: var(--dark-super-color);--super-bg-color: var(--dark-super-bg-color);--max-color: var(--dark-max-color);--caution-color: var(--dark-caution-color);--attention-color: var(--dark-attention-color);--positive-color: var(--dark-positive-color);--negative-color: var(--dark-negative-color);--background-underlay-color: var(--dark-background-underlay-color);--background-base-color: var(--dark-background-base-color);--background-subtle-color: var(--dark-background-subtle-color);--background-subtler-color: var(--dark-background-subtler-color);--background-subtlest-color: var(--dark-background-subtlest-color);--background-raised-color: var(--dark-background-raised-color);--background-elevated-color: var(--dark-background-elevated-color);--background-inverse-color: var(--dark-background-inverse-color);--foreground-color: var(--dark-foreground-color);--foreground-quiet-color: var(--dark-foreground-quiet-color);--foreground-quieter-color: var(--dark-foreground-quieter-color);--foreground-quietest-color: var(--dark-foreground-quietest-color);--foreground-subtle-color: var(--dark-foreground-subtle-color);--foreground-subtler-color: var(--dark-foreground-subtler-color);--foreground-subtlest-color: var(--dark-foreground-subtlest-color);--foreground-inverse-color: var(--dark-foreground-inverse-color);--border-color: var(--dark-border-color);--backdrop-color: var(--dark-backdrop-color);--shadow-overlay-border: rgba(255, 255, 255, .1);--offset-color: var(--dark-offset-color);--offset-plus-color: var(--dark-offset-plus-color);--raised-offset-color: var(--dark-raised-offset-color)}}.max-super-override{--super-color: var(--max-color)}:root{--border-dynamic: 73.5% .012 85 / .2;--surface-offset-special: 21% .04 200 / .2}:root{--banner-height: 34px;--mobile-nav-height: env(safe-area-inset-bottom, 0);--thread-width: 1100px;--thread-content-width: 740px;--header-height: 56px;--thread-input-height-with-padding: 130px;--thread-attachments-height-with-padding: 182px;--thread-visual-spacing: var(--size-md);--sidecar-header-height: 56px;--page-horizontal-padding: var(--size-md);--page-content-height: calc(100dvh - var(--header-height));--toast-v-margin: 60px;--toast-h-margin: 24px;--sidecar-content-height: calc(100vh - var(--sidecar-header-height));--mobile-sidecar-drag-handle-height: 24px;--mobile-sidecar-content-height: calc( 100dvh - var(--mobile-sidecar-drag-handle-height) );--mobile-tab-bar-height: 44px;--mobile-content-height: calc( var(--page-content-height) - var(--mobile-tab-bar-height) );--safe-area-inset-bottom: env(safe-area-inset-bottom, 0);--in-app-header-height: 50px;--sidebar-width: 220px;--sidebar-width-collapsed: 90px;--sidebar-pinned-width: calc(200px + var(--sidebar-default-width));--sidebar-default-width: 72px;--min-touch-target: 2.75rem;--size-2xs: 2px;--size-xs: 4px;--size-sm: 8px;--size-md: 16px;--size-ml: 24px;--size-lg: 32px;--size-xl: 48px}:root[data-erp=sidecar]{--mobile-nav-height: 8px}:root[data-erp=tab]{--page-content-height: calc(100dvh - var(--header-height));--toast-v-margin: 70px}}@layer pplx-base{.reset{all:unset}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:oklch(var(--foreground-subtler-color))}: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:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo;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:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,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]{display:none}em,i{font-variation-settings:"ital" 120}:lang(zh){font-family:var(--font-fk-grotesk-neue),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",PingFang SC,Microsoft YaHei,PingFang TC,PingFang HK,PingFang MO,Microsoft JhengHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-Hans),:lang(zh-CN),:lang(zh-SG){font-family:var(--font-fk-grotesk-neue),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",PingFang SC,Microsoft YaHei,PingFang TC,PingFang HK,Microsoft JhengHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-Hant),:lang(zh-TW){font-family:var(--font-fk-grotesk-neue),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",PingFang TC,Microsoft JhengHei,PingFang HK,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-HK){font-family:var(--font-fk-grotesk-neue),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",PingFang HK,Microsoft JhengHei,PingFang MO,PingFang TC,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-MO){font-family:var(--font-fk-grotesk-neue),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",PingFang MO,Microsoft JhengHei,PingFang HK,PingFang TC,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(ja){font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,Yu Gothic,Meiryo,PingFang SC,Microsoft YaHei,Microsoft JhengHei,Apple SD Gothic Neo}:lang(ko){font-family:var(--font-fk-grotesk-neue),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",Apple SD Gothic Neo,Hiragino Sans,Yu Gothic,Meiryo,PingFang SC,Microsoft YaHei,Microsoft JhengHei}*{scrollbar-color:initial;scrollbar-width:initial}*,: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: }.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:none;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:550}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;padding-inline-start:1.625em;margin:0}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;padding-inline-start:1.625em;margin:0}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:1em;margin-bottom:1em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:oklch(var(--foreground-quiet-color));border-inline-start-width:4px;border-inline-start-color:oklch(var(--border-color-100));quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;padding-left:1rem}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:500;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333;font-family:var(--font-fk-grotesk)}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:550;font-size:.875em;background-color:oklch(var(--background-subtle-color));border-radius:.3125rem;padding:.125rem .25rem}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:""}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:""}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-inline-end:1.1428571em;padding-inline-start:1.1428571em;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: oklch(var(--foreground-color));--tw-prose-headings: oklch(var(--foreground-color));--tw-prose-lead: oklch(var(--foreground-color));--tw-prose-links: oklch(var(--foreground-color));--tw-prose-bold: oklch(var(--foreground-color));--tw-prose-counters: oklch(var(--foreground-quiet-color));--tw-prose-bullets: oklch(var(--foreground-quiet-color));--tw-prose-hr: oklch(var(--foreground-subtler-color));--tw-prose-quotes: oklch(var(--foreground-color));--tw-prose-quote-borders: oklch(var(--foreground-subtler-color));--tw-prose-captions: oklch(var(--foreground-quiet-color));--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: oklch(var(--foreground-color));--tw-prose-pre-code: oklch(var(--foreground-color));--tw-prose-pre-bg: oklch(var(--offset-color));--tw-prose-th-borders: oklch(var(--foreground-subtler-color));--tw-prose-td-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-body: oklch(var(--dark-foreground-color));--tw-prose-invert-headings: oklch(var(--dark-foreground-color));--tw-prose-invert-lead: oklch(var(--dark-foreground-color));--tw-prose-invert-links: oklch(var(--dark-foreground-color));--tw-prose-invert-bold: oklch(var(--dark-foreground-color));--tw-prose-invert-counters: oklch(var(--foreground-quiet-color));--tw-prose-invert-bullets: oklch(var(--foreground-quiet-color));--tw-prose-invert-hr: oklch(var(--foreground-subtler-color));--tw-prose-invert-quotes: oklch(var(--dark-foreground-color));--tw-prose-invert-quote-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-captions: oklch(var(--dark-foreground-color));--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: oklch(var(--dark-foreground-color));--tw-prose-invert-pre-code: oklch(var(--dark-foreground-color));--tw-prose-invert-pre-bg: oklch(var(--offset-color));--tw-prose-invert-th-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-td-borders: oklch(var(--foreground-subtler-color));font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose :where(b):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550}.prose :where(th):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.\!pointer-events-auto{pointer-events:auto!important}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.\!static{position:static!important}.static{position:static}.\!fixed{position:fixed!important}.fixed{position:fixed}.\!absolute{position:absolute!important}.absolute{position:absolute}.\!relative{position:relative!important}.relative{position:relative}.sticky{position:sticky}.-inset-3{inset:-.75rem}.-inset-lg{inset:calc(var(--size-lg) * -1)}.-inset-md{inset:calc(var(--size-md) * -1)}.-inset-px{inset:-1px}.-inset-sm{inset:calc(var(--size-sm) * -1)}.-inset-three{inset:-3px}.-inset-xl{inset:calc(var(--size-xl) * -1)}.inset-0{inset:0}.inset-\[-12px\]{inset:-12px}.inset-\[10\%\]{inset:10%}.inset-half{inset:.5px}.inset-xs{inset:var(--size-xs)}.\!inset-x-\[12px\]{left:12px!important;right:12px!important}.-inset-x-1{left:-.25rem;right:-.25rem}.-inset-x-1\.5{left:-.375rem;right:-.375rem}.-inset-x-3{left:-.75rem;right:-.75rem}.-inset-x-md{left:calc(var(--size-md) * -1);right:calc(var(--size-md) * -1)}.-inset-x-sm{left:calc(var(--size-sm) * -1);right:calc(var(--size-sm) * -1)}.-inset-x-xl{left:calc(var(--size-xl) * -1);right:calc(var(--size-xl) * -1)}.-inset-x-xs{left:calc(var(--size-xs) * -1);right:calc(var(--size-xs) * -1)}.-inset-y-2xs{top:calc(var(--size-2xs) * -1);bottom:calc(var(--size-2xs) * -1)}.-inset-y-xs{top:calc(var(--size-xs) * -1);bottom:calc(var(--size-xs) * -1)}.inset-x-0{left:0;right:0}.inset-x-4{left:1rem;right:1rem}.inset-x-\[-12px\]{left:-12px;right:-12px}.inset-x-\[12px\]{left:12px;right:12px}.inset-x-lg{left:var(--size-lg);right:var(--size-lg)}.inset-x-md{left:var(--size-md);right:var(--size-md)}.inset-x-sm{left:var(--size-sm);right:var(--size-sm)}.inset-y-0{top:0;bottom:0}.inset-y-1{top:.25rem;bottom:.25rem}.inset-y-sm{top:var(--size-sm);bottom:var(--size-sm)}.inset-y-two{top:2px;bottom:2px}.inset-y-xs{top:var(--size-xs);bottom:var(--size-xs)}.\!bottom-\[32px\]{bottom:32px!important}.\!left-sideBarWidth{left:var(--sidebar-width)!important}.\!left-sidebarDefaultWidth{left:var(--sidebar-default-width)!important}.\!left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)!important}.\!top-0{top:0!important}.-bottom-0{bottom:-0px}.-bottom-0\.5{bottom:-.125rem}.-bottom-1{bottom:-.25rem}.-bottom-lg{bottom:calc(var(--size-lg) * -1)}.-bottom-md{bottom:calc(var(--size-md) * -1)}.-bottom-sm{bottom:calc(var(--size-sm) * -1)}.-bottom-xl{bottom:calc(var(--size-xl) * -1)}.-bottom-xs{bottom:calc(var(--size-xs) * -1)}.-end-\[24px\]{inset-inline-end:-24px}.-end-xs{inset-inline-end:calc(var(--size-xs) * -1)}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-left-md{left:calc(var(--size-md) * -1)}.-left-sm{left:calc(var(--size-sm) * -1)}.-left-xl{left:calc(var(--size-xl) * -1)}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-right-2\.5{right:-.625rem}.-right-md{right:calc(var(--size-md) * -1)}.-right-sm{right:calc(var(--size-sm) * -1)}.-right-xl{right:calc(var(--size-xl) * -1)}.-right-xs{right:calc(var(--size-xs) * -1)}.-top-0{top:-0px}.-top-0\.5{top:-.125rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-12{top:-3rem}.-top-2{top:-.5rem}.-top-2\.5{top:-.625rem}.-top-9{top:-2.25rem}.-top-\[3px\]{top:-3px}.-top-md{top:calc(var(--size-md) * -1)}.-top-px{top:-1px}.-top-sm{top:calc(var(--size-sm) * -1)}.-top-three{top:-3px}.-top-two{top:-2px}.-top-xl{top:calc(var(--size-xl) * -1)}.-top-xs{top:calc(var(--size-xs) * -1)}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-1\.5{bottom:.375rem}.bottom-1\/2{bottom:50%}.bottom-2{bottom:.5rem}.bottom-20{bottom:5rem}.bottom-3{bottom:.75rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-100px\]{bottom:-100px}.bottom-\[-4px\]{bottom:-4px}.bottom-\[1\.5px\]{bottom:1.5px}.bottom-\[12px\]{bottom:12px}.bottom-\[20px\]{bottom:20px}.bottom-\[20vh\]{bottom:20vh}.bottom-\[77px\]{bottom:77px}.bottom-full{bottom:100%}.bottom-lg{bottom:var(--size-lg)}.bottom-md{bottom:var(--size-md)}.bottom-safeAreaInsetBottom{bottom:var(--safe-area-inset-bottom)}.bottom-sm{bottom:var(--size-sm)}.bottom-toastVMargin{bottom:var(--toast-v-margin)}.bottom-xl{bottom:var(--size-xl)}.bottom-xs{bottom:var(--size-xs)}.end-md{inset-inline-end:var(--size-md)}.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-\[-9999px\]{left:-9999px}.left-\[10vw\]{left:10vw}.left-\[12px\]{left:12px}.left-\[17px\]{left:17px}.left-\[calc\(12px-1px\)\]{left:11px}.left-full{left:100%}.left-half{left:.5px}.left-lg{left:var(--size-lg)}.left-md{left:var(--size-md)}.left-px{left:1px}.left-sideBarWidth{left:var(--sidebar-width)}.left-sidebarDefaultWidth{left:var(--sidebar-default-width)}.left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)}.left-sm{left:var(--size-sm)}.left-three{left:3px}.left-two{left:2px}.left-xl{left:var(--size-xl)}.left-xs{left:var(--size-xs)}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-20{right:5rem}.right-24{right:6rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.right-6{right:1.5rem}.right-\[-4px\]{right:-4px}.right-\[-8px\]{right:-8px}.right-\[12px\]{right:12px}.right-\[20px\]{right:20px}.right-\[90\%\]{right:90%}.right-\[calc\(100\%\+1px\)\]{right:calc(100% + 1px)}.right-full{right:100%}.right-lg{right:var(--size-lg)}.right-md{right:var(--size-md)}.right-px{right:1px}.right-sm{right:var(--size-sm)}.right-three{right:3px}.right-toastHMargin{right:var(--toast-h-margin)}.right-xs{right:var(--size-xs)}.start-0{inset-inline-start:0px}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-5{top:1.25rem}.top-\[-1\.25px\]{top:-1.25px}.top-\[-1\.4rem\]{top:-1.4rem}.top-\[-100px\]{top:-100px}.top-\[-14px\]{top:-14px}.top-\[-15px\]{top:-15px}.top-\[-20px\]{top:-20px}.top-\[-8px\]{top:-8px}.top-\[10vh\]{top:10vh}.top-\[200px\]{top:200px}.top-\[36px\]{top:36px}.top-\[48px\]{top:48px}.top-\[90\%\]{top:90%}.top-\[calc\(100\%_-_2px\)\]{top:calc(100% - 2px)}.top-\[var\(--header-height\)\]{top:var(--header-height)}.top-full{top:100%}.top-headerHeight{top:var(--header-height)}.top-lg{top:var(--size-lg)}.top-md{top:var(--size-md)}.top-px{top:1px}.top-sm{top:var(--size-sm)}.top-three{top:3px}.top-toastVMargin{top:var(--toast-v-margin)}.top-two{top:2px}.top-xs{top:var(--size-xs)}.isolate{isolation:isolate}.\!z-10{z-index:10!important}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[10\]{z-index:10}.z-\[15\]{z-index:15}.z-\[1\]{z-index:1}.z-\[2000\]{z-index:2000}.z-\[22\]{z-index:22}.z-\[23\]{z-index:23}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[49\]{z-index:49}.z-\[4\]{z-index:4}.z-\[5\]{z-index:5}.z-\[99999\]{z-index:99999}.z-\[999\]{z-index:999}.\!order-first{order:-9999!important}.order-1{order:1}.order-2{order:2}.order-last{order:9999}.\!col-span-12{grid-column:span 12 / span 12!important}.col-span-1{grid-column:span 1 / span 1}.col-span-12{grid-column:span 12 / span 12}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-span-4{grid-column:span 4 / span 4}.col-span-5{grid-column:span 5 / span 5}.col-span-6{grid-column:span 6 / span 6}.col-span-7{grid-column:span 7 / span 7}.col-span-8{grid-column:span 8 / span 8}.col-span-full{grid-column:1 / -1}.\!col-start-1{grid-column-start:1!important}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-9{grid-column-start:9}.-col-end-1{grid-column-end:-1}.col-end-2{grid-column-end:2}.col-end-3{grid-column-end:3}.col-end-4{grid-column-end:4}.\!row-span-4{grid-row:span 4 / span 4!important}.row-span-1{grid-row:span 1 / span 1}.row-span-2{grid-row:span 2 / span 2}.row-span-3{grid-row:span 3 / span 3}.\!row-start-1{grid-row-start:1!important}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.row-end-2{grid-row-end:2}.row-end-3{grid-row-end:3}.float-right{float:right}.clear-end{clear:inline-end}.clear-right{clear:right}.clear-both{clear:both}.\!m-0{margin:0!important}.-m-md{margin:calc(var(--size-md) * -1)}.-m-px{margin:-1px}.-m-sm{margin:calc(var(--size-sm) * -1)}.-m-xl{margin:calc(var(--size-xl) * -1)}.-m-xs{margin:calc(var(--size-xs) * -1)}.m-0{margin:0}.m-1{margin:.25rem}.m-4{margin:1rem}.m-\[-20px\]{margin:-20px}.m-\[-24px\]{margin:-24px}.m-auto{margin:auto}.m-md{margin:var(--size-md)}.m-px{margin:1px}.m-sm{margin:var(--size-sm)}.m-xs{margin:var(--size-xs)}.\!-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.\!-mx-xs{margin-left:calc(var(--size-xs) * -1)!important;margin-right:calc(var(--size-xs) * -1)!important}.\!mx-\[12px\]{margin-left:12px!important;margin-right:12px!important}.\!my-0{margin-top:0!important;margin-bottom:0!important}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.-mx-lg{margin-left:calc(var(--size-lg) * -1);margin-right:calc(var(--size-lg) * -1)}.-mx-md{margin-left:calc(var(--size-md) * -1);margin-right:calc(var(--size-md) * -1)}.-mx-pageHorizontalPadding{margin-left:calc(var(--page-horizontal-padding) * -1);margin-right:calc(var(--page-horizontal-padding) * -1)}.-mx-sm{margin-left:calc(var(--size-sm) * -1);margin-right:calc(var(--size-sm) * -1)}.-mx-xs{margin-left:calc(var(--size-xs) * -1);margin-right:calc(var(--size-xs) * -1)}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.-my-md{margin-top:calc(var(--size-md) * -1);margin-bottom:calc(var(--size-md) * -1)}.-my-sm{margin-top:calc(var(--size-sm) * -1);margin-bottom:calc(var(--size-sm) * -1)}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-\[-12px\]{margin-left:-12px;margin-right:-12px}.mx-\[-5\%\]{margin-left:-5%;margin-right:-5%}.mx-auto{margin-left:auto;margin-right:auto}.mx-lg{margin-left:var(--size-lg);margin-right:var(--size-lg)}.mx-md{margin-left:var(--size-md);margin-right:var(--size-md)}.mx-sm{margin-left:var(--size-sm);margin-right:var(--size-sm)}.mx-xs{margin-left:var(--size-xs);margin-right:var(--size-xs)}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.my-\[12px\]{margin-top:12px;margin-bottom:12px}.my-\[1em\]{margin-top:1em;margin-bottom:1em}.my-\[8px\]{margin-top:8px;margin-bottom:8px}.my-md{margin-top:var(--size-md);margin-bottom:var(--size-md)}.my-sm{margin-top:var(--size-sm);margin-bottom:var(--size-sm)}.my-xl{margin-top:var(--size-xl);margin-bottom:var(--size-xl)}.my-xs{margin-top:var(--size-xs);margin-bottom:var(--size-xs)}.\!-ml-md{margin-left:calc(var(--size-md) * -1)!important}.\!-mt-1{margin-top:-.25rem!important}.\!-mt-\[2px\]{margin-top:-2px!important}.\!-mt-md{margin-top:calc(var(--size-md) * -1)!important}.\!mb-0{margin-bottom:0!important}.\!ml-0{margin-left:0!important}.\!mt-0{margin-top:0!important}.\!mt-md{margin-top:var(--size-md)!important}.\!mt-px{margin-top:1px!important}.-mb-0{margin-bottom:-0px}.-mb-0\.5{margin-bottom:-.125rem}.-mb-1{margin-bottom:-.25rem}.-mb-4{margin-bottom:-1rem}.-mb-lg{margin-bottom:calc(var(--size-lg) * -1)}.-mb-md{margin-bottom:calc(var(--size-md) * -1)}.-mb-px{margin-bottom:-1px}.-mb-sm{margin-bottom:calc(var(--size-sm) * -1)}.-mb-two{margin-bottom:-2px}.-mb-xl{margin-bottom:calc(var(--size-xl) * -1)}.-mb-xs{margin-bottom:calc(var(--size-xs) * -1)}.-me-xs{margin-inline-end:calc(var(--size-xs) * -1)}.-ml-1{margin-left:-.25rem}.-ml-3{margin-left:-.75rem}.-ml-4{margin-left:-1rem}.-ml-\[10px\]{margin-left:-10px}.-ml-\[16px\]{margin-left:-16px}.-ml-\[5px\]{margin-left:-5px}.-ml-px{margin-left:-1px}.-ml-sm{margin-left:calc(var(--size-sm) * -1)}.-ml-two{margin-left:-2px}.-ml-xs{margin-left:calc(var(--size-xs) * -1)}.-mr-0{margin-right:-0px}.-mr-0\.5{margin-right:-.125rem}.-mr-1{margin-right:-.25rem}.-mr-1\.5{margin-right:-.375rem}.-mr-2{margin-right:-.5rem}.-mr-5{margin-right:-1.25rem}.-mr-\[0\.5px\]{margin-right:-.5px}.-mr-md{margin-right:calc(var(--size-md) * -1)}.-mr-sm{margin-right:calc(var(--size-sm) * -1)}.-mr-three{margin-right:-3px}.-mr-two{margin-right:-2px}.-mr-xs{margin-right:calc(var(--size-xs) * -1)}.-mt-0{margin-top:-0px}.-mt-0\.5{margin-top:-.125rem}.-mt-1{margin-top:-.25rem}.-mt-1\.5{margin-top:-.375rem}.-mt-10{margin-top:-2.5rem}.-mt-2{margin-top:-.5rem}.-mt-4{margin-top:-1rem}.-mt-lg{margin-top:calc(var(--size-lg) * -1)}.-mt-md{margin-top:calc(var(--size-md) * -1)}.-mt-one,.-mt-px{margin-top:-1px}.-mt-sm{margin-top:calc(var(--size-sm) * -1)}.-mt-three{margin-top:-3px}.-mt-two{margin-top:-2px}.-mt-xl{margin-top:calc(var(--size-xl) * -1)}.-mt-xs{margin-top:calc(var(--size-xs) * -1)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-2xl{margin-bottom:96px}.mb-2xs{margin-bottom:var(--size-2xs)}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-\[-24px\]{margin-bottom:-24px}.mb-\[-2px\]{margin-bottom:-2px}.mb-\[-3px\]{margin-bottom:-3px}.mb-\[-4vh\]{margin-bottom:-4vh}.mb-\[-5px\]{margin-bottom:-5px}.mb-\[12px\]{margin-bottom:12px}.mb-\[20px\]{margin-bottom:20px}.mb-\[40px\]{margin-bottom:40px}.mb-\[calc\(var\(--mobile-nav-height\)\+2rem\)\]{margin-bottom:calc(var(--mobile-nav-height) + 2rem)}.mb-auto{margin-bottom:auto}.mb-lg{margin-bottom:var(--size-lg)}.mb-md{margin-bottom:var(--size-md)}.mb-ml{margin-bottom:var(--size-ml)}.mb-px{margin-bottom:1px}.mb-safeAreaInsetBottom{margin-bottom:var(--safe-area-inset-bottom)}.mb-sm{margin-bottom:var(--size-sm)}.mb-two{margin-bottom:2px}.mb-xl{margin-bottom:var(--size-xl)}.mb-xs{margin-bottom:var(--size-xs)}.ml-0{margin-left:0}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-2xs{margin-left:var(--size-2xs)}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-7{margin-left:1.75rem}.ml-8{margin-left:2rem}.ml-\[-12px\]{margin-left:-12px}.ml-\[26px\]{margin-left:26px}.ml-\[28px\]{margin-left:28px}.ml-auto{margin-left:auto}.ml-collapsedSideBarWidth{margin-left:var(--sidebar-width-collapsed)}.ml-lg{margin-left:var(--size-lg)}.ml-md{margin-left:var(--size-md)}.ml-one,.ml-px{margin-left:1px}.ml-sideBarWidth{margin-left:var(--sidebar-width)}.ml-sm{margin-left:var(--size-sm)}.ml-xl{margin-left:var(--size-xl)}.ml-xs{margin-left:var(--size-xs)}.mr-0{margin-right:0}.mr-0\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-\[-18px\]{margin-right:-18px}.mr-\[2px\]{margin-right:2px}.mr-auto{margin-right:auto}.mr-lg{margin-right:var(--size-lg)}.mr-md{margin-right:var(--size-md)}.mr-px{margin-right:1px}.mr-sm{margin-right:var(--size-sm)}.mr-xs{margin-right:var(--size-xs)}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-2xs{margin-top:var(--size-2xs)}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\[-10px\]{margin-top:-10px}.mt-\[-12px\]{margin-top:-12px}.mt-\[-24px\]{margin-top:-24px}.mt-\[-4\.5rem\]{margin-top:-4.5rem}.mt-\[-5px\]{margin-top:-5px}.mt-\[-6px\]{margin-top:-6px}.mt-\[\.\.\.\]{margin-top:...}.mt-\[13px\]{margin-top:13px}.mt-\[5px\]{margin-top:5px}.mt-\[6px\]{margin-top:6px}.mt-auto{margin-top:auto}.mt-headerHeight{margin-top:var(--header-height)}.mt-inAppHeaderHeight{margin-top:var(--in-app-header-height)}.mt-lg{margin-top:var(--size-lg)}.mt-md{margin-top:var(--size-md)}.mt-ml{margin-top:var(--size-ml)}.mt-one,.mt-px{margin-top:1px}.mt-sm{margin-top:var(--size-sm)}.mt-three{margin-top:3px}.mt-two{margin-top:2px}.mt-xl{margin-top:var(--size-xl)}.mt-xs{margin-top:var(--size-xs)}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.\!line-clamp-2{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.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}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.line-clamp-5{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5}.line-clamp-6{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6}.line-clamp-\[20\]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:20}.line-clamp-\[8\]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:8}.line-clamp-none{overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.\!grid{display:grid!important}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.\!hidden{display:none!important}.hidden{display:none}.\!aspect-\[16\/9\]{aspect-ratio:16/9!important}.\!aspect-square{aspect-ratio:1 / 1!important}.aspect-\[1\.2\/1\]{aspect-ratio:1.2/1}.aspect-\[1\/1\]{aspect-ratio:1/1}.aspect-\[1024\/1536\]{aspect-ratio:1024/1536}.aspect-\[1036\/1536\]{aspect-ratio:1036/1536}.aspect-\[11\/6\]{aspect-ratio:11/6}.aspect-\[1200\/800\]{aspect-ratio:1200/800}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-\[176\/225\]{aspect-ratio:176/225}.aspect-\[187\/155\]{aspect-ratio:187/155}.aspect-\[252\/336\]{aspect-ratio:252/336}.aspect-\[3\/2\]{aspect-ratio:3/2}.aspect-\[304\/120\]{aspect-ratio:304/120}.aspect-\[4\/3\]{aspect-ratio:4/3}.aspect-\[4\/6\]{aspect-ratio:4/6}.aspect-\[9\/8\]{aspect-ratio:9/8}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.\!size-10{width:2.5rem!important;height:2.5rem!important}.\!size-12{width:3rem!important;height:3rem!important}.\!size-4{width:1rem!important;height:1rem!important}.\!size-7{width:1.75rem!important;height:1.75rem!important}.\!size-8{width:2rem!important;height:2rem!important}.\!size-\[40px\]{width:40px!important;height:40px!important}.\!size-\[60px\]{width:60px!important;height:60px!important}.size-0{width:0px;height:0px}.size-0\.5{width:.125rem;height:.125rem}.size-1{width:.25rem;height:.25rem}.size-1\.5{width:.375rem;height:.375rem}.size-1\/2{width:50%;height:50%}.size-10{width:2.5rem;height:2.5rem}.size-11{width:2.75rem;height:2.75rem}.size-12{width:3rem;height:3rem}.size-14{width:3.5rem;height:3.5rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-20{width:5rem;height:5rem}.size-24{width:6rem;height:6rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-32{width:8rem;height:8rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-\[\.8rem\]{width:.8rem;height:.8rem}.size-\[1\.2em\]{width:1.2em;height:1.2em}.size-\[118px\]{width:118px;height:118px}.size-\[120\%\]{width:120%;height:120%}.size-\[120px\]{width:120px;height:120px}.size-\[12px\]{width:12px;height:12px}.size-\[140\%\]{width:140%;height:140%}.size-\[14px\]{width:14px;height:14px}.size-\[16px\]{width:16px;height:16px}.size-\[180\%\]{width:180%;height:180%}.size-\[18px\]{width:18px;height:18px}.size-\[1lh\]{width:1lh;height:1lh}.size-\[20px\]{width:20px;height:20px}.size-\[220\%\]{width:220%;height:220%}.size-\[24px\]{width:24px;height:24px}.size-\[30px\]{width:30px;height:30px}.size-\[32px\]{width:32px;height:32px}.size-\[36px\]{width:36px;height:36px}.size-\[40px\]{width:40px;height:40px}.size-\[44px\]{width:44px;height:44px}.size-\[45vw\]{width:45vw;height:45vw}.size-\[4px\]{width:4px;height:4px}.size-\[50px\]{width:50px;height:50px}.size-\[5px\]{width:5px;height:5px}.size-\[60px\]{width:60px;height:60px}.size-\[64px\]{width:64px;height:64px}.size-\[65\%\]{width:65%;height:65%}.size-\[6px\]{width:6px;height:6px}.size-\[72px\]{width:72px;height:72px}.size-\[7px\]{width:7px;height:7px}.size-\[88px\]{width:88px;height:88px}.size-\[var\(--image-size\)\]{width:var(--image-size);height:var(--image-size)}.size-full{width:100%;height:100%}.size-lg{width:var(--size-lg);height:var(--size-lg)}.size-md{width:var(--size-md);height:var(--size-md)}.size-sm{width:var(--size-sm);height:var(--size-sm)}.size-xl{width:var(--size-xl);height:var(--size-xl)}.size-xs{width:var(--size-xs);height:var(--size-xs)}.\!h-0{height:0px!important}.\!h-10{height:2.5rem!important}.\!h-11{height:2.75rem!important}.\!h-7{height:1.75rem!important}.\!h-9{height:2.25rem!important}.\!h-\[10px\]{height:10px!important}.\!h-\[150px\]{height:150px!important}.\!h-\[20px\]{height:20px!important}.\!h-\[2lh\]{height:2lh!important}.\!h-\[32px\]{height:32px!important}.\!h-\[5px\]{height:5px!important}.\!h-auto{height:auto!important}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-1\/2{height:50%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-2xs{height:var(--size-2xs)}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[0\.88rem\]{height:.88rem}.h-\[100dvh\]{height:100dvh}.h-\[100px\]{height:100px}.h-\[10vh\]{height:10vh}.h-\[110\%\]{height:110%}.h-\[120\%\]{height:120%}.h-\[120px\]{height:120px}.h-\[124px\]{height:124px}.h-\[12px\]{height:12px}.h-\[132px\]{height:132px}.h-\[136px\]{height:136px}.h-\[13px\]{height:13px}.h-\[140px\]{height:140px}.h-\[144px\]{height:144px}.h-\[14px\]{height:14px}.h-\[150px\]{height:150px}.h-\[160px\]{height:160px}.h-\[16px\]{height:16px}.h-\[170px\]{height:170px}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[198px\]{height:198px}.h-\[19px\]{height:19px}.h-\[1em\]{height:1em}.h-\[1lh\]{height:1lh}.h-\[200px\]{height:200px}.h-\[20px\]{height:20px}.h-\[20vw\]{height:20vw}.h-\[22px\]{height:22px}.h-\[240px\]{height:240px}.h-\[242px\]{height:242px}.h-\[24px\]{height:24px}.h-\[250px\]{height:250px}.h-\[260px\]{height:260px}.h-\[26px\]{height:26px}.h-\[27px\]{height:27px}.h-\[300px\]{height:300px}.h-\[30vh\]{height:30vh}.h-\[327px\]{height:327px}.h-\[32px\]{height:32px}.h-\[340px\]{height:340px}.h-\[34px\]{height:34px}.h-\[350px\]{height:350px}.h-\[36px\]{height:36px}.h-\[3px\]{height:3px}.h-\[4\.5rem\]{height:4.5rem}.h-\[400px\]{height:400px}.h-\[40px\]{height:40px}.h-\[42px\]{height:42px}.h-\[44px\]{height:44px}.h-\[480px\]{height:480px}.h-\[48px\]{height:48px}.h-\[500px\]{height:500px}.h-\[50dvh\]{height:50dvh}.h-\[50vh\]{height:50vh}.h-\[52px\]{height:52px}.h-\[54px\]{height:54px}.h-\[560px\]{height:560px}.h-\[56px\]{height:56px}.h-\[600px\]{height:600px}.h-\[60vh\]{height:60vh}.h-\[640px\]{height:640px}.h-\[64px\]{height:64px}.h-\[68px\]{height:68px}.h-\[70\%\]{height:70%}.h-\[72px\]{height:72px}.h-\[90dvh\]{height:90dvh}.h-\[95vh\]{height:95vh}.h-\[calc\(100\%\+16px\)\]{height:calc(100% + 16px)}.h-\[calc\(100vh-var\(--header-height\)-120px\)\]{height:calc(100vh - var(--header-height) - 120px)}.h-\[var\(--map-height\)\]{height:var(--map-height)}.h-auto{height:auto}.h-bannerHeight{height:var(--banner-height)}.h-dvh{height:100dvh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-headerHeight{height:var(--header-height)}.h-inAppHeaderHeight{height:var(--in-app-header-height)}.h-lg{height:var(--size-lg)}.h-md{height:var(--size-md)}.h-one{height:1px}.h-pageContentHeight{height:var(--page-content-height)}.h-px{height:1px}.h-screen{height:100vh}.h-sm{height:var(--size-sm)}.h-two{height:2px}.h-xl{height:var(--size-xl)}.h-xs{height:var(--size-xs)}.\!max-h-\[27vh\]{max-height:27vh!important}.\!max-h-\[640px\]{max-height:640px!important}.max-h-20{max-height:5rem}.max-h-40{max-height:10rem}.max-h-44{max-height:11rem}.max-h-5{max-height:1.25rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[100\%\]{max-height:100%}.max-h-\[100vh\]{max-height:100vh}.max-h-\[120px\]{max-height:120px}.max-h-\[160px\]{max-height:160px}.max-h-\[175px\]{max-height:175px}.max-h-\[190px\]{max-height:190px}.max-h-\[200px\]{max-height:200px}.max-h-\[220px\]{max-height:220px}.max-h-\[240px\]{max-height:240px}.max-h-\[280px\]{max-height:280px}.max-h-\[300px\]{max-height:300px}.max-h-\[330px\]{max-height:330px}.max-h-\[37vh\]{max-height:37vh}.max-h-\[38vh\]{max-height:38vh}.max-h-\[400px\]{max-height:400px}.max-h-\[40vh\]{max-height:40vh}.max-h-\[42vh\]{max-height:42vh}.max-h-\[450px\]{max-height:450px}.max-h-\[45vh\]{max-height:45vh}.max-h-\[500px\]{max-height:500px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[555x\]{max-height:555x}.max-h-\[600px\]{max-height:600px}.max-h-\[65px\]{max-height:65px}.max-h-\[65vh\]{max-height:65vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[76px\]{max-height:76px}.max-h-\[800px\]{max-height:800px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90dvh\]{max-height:90dvh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[96dvh\]{max-height:96dvh}.max-h-\[inherit\]{max-height:inherit}.max-h-full{max-height:100%}.max-h-lg{max-height:var(--size-lg)}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.\!min-h-0{min-height:0px!important}.\!min-h-fit{min-height:-moz-fit-content!important;min-height:fit-content!important}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-12{min-height:3rem}.min-h-16{min-height:4rem}.min-h-20{min-height:5rem}.min-h-24{min-height:6rem}.min-h-32{min-height:8rem}.min-h-40{min-height:10rem}.min-h-60{min-height:15rem}.min-h-\[100\%\]{min-height:100%}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[125px\]{min-height:125px}.min-h-\[128px\]{min-height:128px}.min-h-\[142px\]{min-height:142px}.min-h-\[180px\]{min-height:180px}.min-h-\[200px\]{min-height:200px}.min-h-\[20px\]{min-height:20px}.min-h-\[230px\]{min-height:230px}.min-h-\[24px\]{min-height:24px}.min-h-\[250px\]{min-height:250px}.min-h-\[280px\]{min-height:280px}.min-h-\[340px\]{min-height:340px}.min-h-\[40px\]{min-height:40px}.min-h-\[50px\]{min-height:50px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[520px\]{min-height:520px}.min-h-\[555px\]{min-height:555px}.min-h-\[58px\]{min-height:58px}.min-h-\[600px\]{min-height:600px}.min-h-\[60dvh\]{min-height:60dvh}.min-h-\[60px\]{min-height:60px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[75vh\]{min-height:75vh}.min-h-\[80px\]{min-height:80px}.min-h-\[calc\(100dvh-70px\)\]{min-height:calc(100dvh - 70px)}.min-h-\[calc\(100vh-200px\)\]{min-height:calc(100vh - 200px)}.min-h-\[calc\(100vh-262px\)\]{min-height:calc(100vh - 262px)}.min-h-\[calc\(100vh-68px\)\]{min-height:calc(100vh - 68px)}.min-h-\[unset\]{min-height:unset}.min-h-\[var\(--mobile-content-height\)\]{min-height:var(--mobile-content-height)}.min-h-\[var\(--page-content-height\)\]{min-height:var(--page-content-height)}.min-h-full{min-height:100%}.min-h-minTouchTarget{min-height:var(--min-touch-target)}.min-h-pageContentHeight{min-height:var(--page-content-height)}.min-h-screen{min-height:100vh}.\!w-10{width:2.5rem!important}.\!w-16{width:4rem!important}.\!w-4{width:1rem!important}.\!w-7{width:1.75rem!important}.\!w-\[100px\]{width:100px!important}.\!w-\[140px\]{width:140px!important}.\!w-\[16px\]{width:16px!important}.\!w-\[200px\]{width:200px!important}.\!w-\[240px\]{width:240px!important}.\!w-\[24px\]{width:24px!important}.\!w-\[25vw\]{width:25vw!important}.\!w-\[416px\]{width:416px!important}.\!w-\[500px\]{width:500px!important}.\!w-\[5px\]{width:5px!important}.\!w-\[80px\]{width:80px!important}.\!w-auto{width:auto!important}.\!w-full{width:100%!important}.\!w-screen{width:100vw!important}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/12{width:8.333333%}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-1\/5{width:20%}.w-10{width:2.5rem}.w-10\/12{width:83.333333%}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\/12{width:16.666667%}.w-2\/3{width:66.666667%}.w-2\/4{width:50%}.w-2\/5{width:40%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/12{width:25%}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-56{width:14rem}.w-6{width:1.5rem}.w-6\/12{width:50%}.w-60{width:15rem}.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-9\/12{width:75%}.w-96{width:24rem}.w-\[0\.88rem\]{width:.88rem}.w-\[1\.2em\]{width:1.2em}.w-\[1\.5px\]{width:1.5px}.w-\[1\/2\]{width:1/2}.w-\[10\%\]{width:10%}.w-\[100px\]{width:100px}.w-\[100vw\]{width:100vw}.w-\[110\%\]{width:110%}.w-\[12\.5\%\]{width:12.5%}.w-\[120\%\]{width:120%}.w-\[120px\]{width:120px}.w-\[120vw\]{width:120vw}.w-\[12px\]{width:12px}.w-\[134px\]{width:134px}.w-\[140px\]{width:140px}.w-\[144px\]{width:144px}.w-\[14px\]{width:14px}.w-\[15\%\]{width:15%}.w-\[150px\]{width:150px}.w-\[150vw\]{width:150vw}.w-\[15px\]{width:15px}.w-\[166px\]{width:166px}.w-\[170px\]{width:170px}.w-\[175px\]{width:175px}.w-\[17px\]{width:17px}.w-\[180px\]{width:180px}.w-\[18px\]{width:18px}.w-\[18vw\]{width:18vw}.w-\[2\.5px\]{width:2.5px}.w-\[200px\]{width:200px}.w-\[216px\]{width:216px}.w-\[220px\]{width:220px}.w-\[224px\]{width:224px}.w-\[225px\]{width:225px}.w-\[240px\]{width:240px}.w-\[24px\]{width:24px}.w-\[250px\]{width:250px}.w-\[27px\]{width:27px}.w-\[282px\]{width:282px}.w-\[28px\]{width:28px}.w-\[2ch\]{width:2ch}.w-\[30\%\]{width:30%}.w-\[300px\]{width:300px}.w-\[30vw\]{width:30vw}.w-\[320px\]{width:320px}.w-\[324px\]{width:324px}.w-\[32px\]{width:32px}.w-\[33\%\]{width:33%}.w-\[340px\]{width:340px}.w-\[350px\]{width:350px}.w-\[360px\]{width:360px}.w-\[3ch\]{width:3ch}.w-\[3px\]{width:3px}.w-\[400px\]{width:400px}.w-\[40px\]{width:40px}.w-\[40vw\]{width:40vw}.w-\[45\%\]{width:45%}.w-\[4px\]{width:4px}.w-\[500px\]{width:500px}.w-\[54\%\]{width:54%}.w-\[60\%\]{width:60%}.w-\[600px\]{width:600px}.w-\[60px\]{width:60px}.w-\[60vw\]{width:60vw}.w-\[62\%\]{width:62%}.w-\[62px\]{width:62px}.w-\[66\%\]{width:66%}.w-\[70\%\]{width:70%}.w-\[70px\]{width:70px}.w-\[70vw\]{width:70vw}.w-\[72px\]{width:72px}.w-\[76px\]{width:76px}.w-\[8\%\]{width:8%}.w-\[80px\]{width:80px}.w-\[80vw\]{width:80vw}.w-\[90\%\]{width:90%}.w-\[90dvw\]{width:90dvw}.w-\[90vw\]{width:90vw}.w-\[95vw\]{width:95vw}.w-\[calc\(\(100\%\*2\/3\)\/3\)\]{width:calc((100% * 2 / 3) / 3)}.w-\[calc\(\(100\%\*2\/3\)\/4\)\]{width:calc((100% * 2 / 3) / 4)}.w-\[calc\(100dvw-\(2\*var\(--size-md\)\)\)\]{width:calc(100dvw - (2 * var(--size-md)))}.w-\[calc\(80\%-1\.6px\)\]{width:calc(80% - 1.6px)}.w-\[var\(--constrained-card-width\)\]{width:var(--constrained-card-width)}.w-auto{width:auto}.w-collapsedSideBarWidth{width:var(--sidebar-width-collapsed)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-lg{width:var(--size-lg)}.w-max{width:-moz-max-content;width:max-content}.w-md{width:var(--size-md)}.w-px{width:1px}.w-screen{width:100vw}.w-sideBarWidth{width:var(--sidebar-width)}.w-sm{width:var(--size-sm)}.w-three{width:3px}.w-two{width:2px}.w-xl{width:var(--size-xl)}.w-xs{width:var(--size-xs)}.\!min-w-0{min-width:0px!important}.\!min-w-\[120px\]{min-width:120px!important}.\!min-w-\[180px\]{min-width:180px!important}.\!min-w-\[365px\]{min-width:365px!important}.\!min-w-\[416px\]{min-width:416px!important}.\!min-w-\[500px\]{min-width:500px!important}.\!min-w-md{min-width:var(--size-md)!important}.min-w-0{min-width:0px}.min-w-14{min-width:3.5rem}.min-w-24{min-width:6rem}.min-w-3{min-width:.75rem}.min-w-3\.5{min-width:.875rem}.min-w-4{min-width:1rem}.min-w-40{min-width:10rem}.min-w-48{min-width:12rem}.min-w-5{min-width:1.25rem}.min-w-56{min-width:14rem}.min-w-6{min-width:1.5rem}.min-w-9{min-width:2.25rem}.min-w-\[100\%\]{min-width:100%}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[140px\]{min-width:140px}.min-w-\[1443px\]{min-width:1443px}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\]{min-width:160px}.min-w-\[165px\]{min-width:165px}.min-w-\[200px\]{min-width:200px}.min-w-\[220px\]{min-width:220px}.min-w-\[25\%\]{min-width:25%}.min-w-\[250px\]{min-width:250px}.min-w-\[280px\]{min-width:280px}.min-w-\[2ch\]{min-width:2ch}.min-w-\[32px\]{min-width:32px}.min-w-\[400px\]{min-width:400px}.min-w-\[420px\]{min-width:420px}.min-w-\[48px\]{min-width:48px}.min-w-\[500px\]{min-width:500px}.min-w-\[56px\]{min-width:56px}.min-w-\[58px\]{min-width:58px}.min-w-\[64px\]{min-width:64px}.min-w-\[80px\]{min-width:80px}.min-w-\[calc\(var\(--radix-dropdown-menu-trigger-width\)-theme\(spacing\.sm\)\)\]{min-width:calc(var(--radix-dropdown-menu-trigger-width) - var(--size-sm))}.min-w-\[var\(--radix-hover-card-trigger-width\)\]{min-width:var(--radix-hover-card-trigger-width)}.min-w-\[var\(--radix-popover-trigger-width\)\]{min-width:var(--radix-popover-trigger-width)}.min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.min-w-full{min-width:100%}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-md{min-width:var(--size-md)}.\!max-w-2xl{max-width:42rem!important}.\!max-w-\[416px\]{max-width:416px!important}.\!max-w-\[500px\]{max-width:500px!important}.\!max-w-\[520px\]{max-width:520px!important}.\!max-w-md{max-width:28rem!important}.\!max-w-none{max-width:none!important}.\!max-w-sm{max-width:24rem!important}.max-w-0{max-width:0px}.max-w-10{max-width:2.5rem}.max-w-12{max-width:3rem}.max-w-14{max-width:3.5rem}.max-w-20{max-width:5rem}.max-w-24{max-width:6rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-44{max-width:11rem}.max-w-48{max-width:12rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-60{max-width:15rem}.max-w-64{max-width:16rem}.max-w-6xl{max-width:72rem}.max-w-\[100px\]{max-width:100px}.max-w-\[100vw\]{max-width:100vw}.max-w-\[120px\]{max-width:120px}.max-w-\[150px\]{max-width:150px}.max-w-\[15vw\]{max-width:15vw}.max-w-\[160px\]{max-width:160px}.max-w-\[168px\]{max-width:168px}.max-w-\[200px\]{max-width:200px}.max-w-\[208px\]{max-width:208px}.max-w-\[220px\]{max-width:220px}.max-w-\[250px\]{max-width:250px}.max-w-\[25ch\]{max-width:25ch}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[30vw\]{max-width:30vw}.max-w-\[320px\]{max-width:320px}.max-w-\[324px\]{max-width:324px}.max-w-\[328px\]{max-width:328px}.max-w-\[340px\]{max-width:340px}.max-w-\[350px\]{max-width:350px}.max-w-\[375px\]{max-width:375px}.max-w-\[400px\]{max-width:400px}.max-w-\[40px\]{max-width:40px}.max-w-\[448px\]{max-width:448px}.max-w-\[5\.6rem\]{max-width:5.6rem}.max-w-\[50vw\]{max-width:50vw}.max-w-\[540px\]{max-width:540px}.max-w-\[600px\]{max-width:600px}.max-w-\[672px\]{max-width:672px}.max-w-\[80px\]{max-width:80px}.max-w-\[900px\]{max-width:900px}.max-w-\[90dvw\]{max-width:90dvw}.max-w-\[98px\]{max-width:98px}.max-w-\[calc\(\(100vh-360px\)\/1\.5\)\]{max-width:calc((100vh - 360px) / 1.5)}.max-w-\[calc\(100vh-360px\)\]{max-width:calc(100vh - 360px)}.max-w-\[unset\]{max-width:unset}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-screen-lg{max-width:1024px}.max-w-screen-md{max-width:768px}.max-w-screen-sm{max-width:640px}.max-w-screen-xl{max-width:1280px}.max-w-sideBarWidthXL{max-width:260px}.max-w-sm{max-width:24rem}.max-w-threadContentWidth{max-width:var(--thread-content-width)}.max-w-threadWidth{max-width:var(--thread-width)}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.\!flex-1{flex:1 1 0%!important}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.\!grow{flex-grow:1!important}.grow{flex-grow:1}.grow-0{flex-grow:0}.\!basis-\[90\%\]{flex-basis:90%!important}.\!basis-full{flex-basis:100%!important}.basis-0{flex-basis:0px}.basis-1\/2{flex-basis:50%}.basis-1\/4{flex-basis:25%}.basis-2\/5{flex-basis:40%}.basis-3\/5{flex-basis:60%}.basis-full{flex-basis:100%}.table-auto{table-layout:auto}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x: 0px;--tw-border-spacing-y: 0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.border-spacing-sm{--tw-border-spacing-x: var(--size-sm);--tw-border-spacing-y: var(--size-sm);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.origin-\[var\(--radix-dropdown-menu-content-transform-origin\)\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-bottom-left{transform-origin:bottom left}.origin-center{transform-origin:center}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.\!translate-y-\[0px\]{--tw-translate-y: 0px !important;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))!important}.-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-1\/3{--tw-translate-x: -33.333333%;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-\[10\%\]{--tw-translate-x: -10%;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-\[5\%\]{--tw-translate-x: -5%;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-full{--tw-translate-x: -100%;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-md{--tw-translate-x: calc(var(--size-md) * -1);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-x-sm{--tw-translate-x: calc(var(--size-sm) * -1);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-three{--tw-translate-x: -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))}.-translate-x-two{--tw-translate-x: -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))}.-translate-x-xs{--tw-translate-x: calc(var(--size-xs) * -1);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-0{--tw-translate-y: -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))}.-translate-y-0\.5{--tw-translate-y: -.125rem;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{--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))}.-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-y-1\/3{--tw-translate-y: -33.333333%;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\/4{--tw-translate-y: -25%;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-\[10\%\]{--tw-translate-y: -10%;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-\[5\%\]{--tw-translate-y: -5%;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-\[calc\(50\%-2px\)\]{--tw-translate-y: calc((50% - 2px)*-1) ;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-half{--tw-translate-y: -.5px;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-md{--tw-translate-y: calc(var(--size-md) * -1);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-px{--tw-translate-y: -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-sm{--tw-translate-y: calc(var(--size-sm) * -1);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-three{--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))}.-translate-y-two{--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))}.translate-x-1{--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))}.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-1\/3{--tw-translate-x: 33.333333%;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-1\/4{--tw-translate-x: 25%;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-2{--tw-translate-x: .5rem;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-\[-5px\]{--tw-translate-x: -5px;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-\[1px\]{--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-x-\[4px\]{--tw-translate-x: 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))}.translate-x-\[6px\]{--tw-translate-x: 6px;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-\[calc\(-100\%-var\(--size-xs\)\)\]{--tw-translate-x: calc(-100% - var(--size-xs));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-\[calc\(100\%\+2px\)\]{--tw-translate-x: calc(100% + 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))}.translate-x-\[calc\(100\%\+var\(--size-xs\)\)\]{--tw-translate-x: calc(100% + var(--size-xs));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-full{--tw-translate-x: 100%;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-md{--tw-translate-x: var(--size-md);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-x-two{--tw-translate-x: 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))}.translate-x-xs{--tw-translate-x: var(--size-xs);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-0{--tw-translate-y: 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))}.translate-y-0\.5{--tw-translate-y: .125rem;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{--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))}.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-y-1\/4{--tw-translate-y: 25%;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-2{--tw-translate-y: .5rem;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\.5px\]{--tw-translate-y: -1.5px;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-\[-12\.5\%\]{--tw-translate-y: -12.5%;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-\[-16\%\]{--tw-translate-y: -16%;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-\[-2px\]{--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))}.translate-y-\[0\.8px\]{--tw-translate-y: .8px;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\.5px\]{--tw-translate-y: 1.5px;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-\[1px\]{--tw-translate-y: 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-\[20px\]{--tw-translate-y: 20px;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-\[24px\]{--tw-translate-y: 24px;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-\[3px\]{--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))}.translate-y-\[60\%\]{--tw-translate-y: 60%;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-\[6px\]{--tw-translate-y: 6px;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-\[80\%\]{--tw-translate-y: 80%;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-full{--tw-translate-y: 100%;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-half{--tw-translate-y: .5px;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-px{--tw-translate-y: 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-three{--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))}.translate-y-two{--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))}.translate-y-xs{--tw-translate-y: var(--size-xs);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-0{--tw-rotate: 0deg;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-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))}.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))}.\!scale-100{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;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))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;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))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;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))}.scale-\[\.85\],.scale-\[0\.85\]{--tw-scale-x: .85;--tw-scale-y: .85;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))}.scale-\[0\.8\]{--tw-scale-x: .8;--tw-scale-y: .8;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))}.scale-\[0\.98\]{--tw-scale-x: .98;--tw-scale-y: .98;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))}.scale-\[0\.9\]{--tw-scale-x: .9;--tw-scale-y: .9;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))}.scale-\[99\%\]{--tw-scale-x: 99%;--tw-scale-y: 99%;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))}.scale-x-\[250\%\]{--tw-scale-x: 250%;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))}.transform-none{transform:none}@keyframes f1-track-dash{to{stroke-dashoffset:0px}}.animate-\[f1-track-dash_6s_ease_infinite\]{animation:f1-track-dash 6s ease infinite}.animate-\[ping_1\.5s_cubic-bezier\(0\,0\,0\.2\,1\)_infinite\]{animation:ping 1.5s cubic-bezier(0,0,.2,1) infinite}.animate-\[pulse_2\.5s_ease-in-out_infinite\]{animation:pulse 2.5s ease-in-out infinite}@keyframes collapseHeight{0%{grid-template-rows:1fr;opacity:1}to{grid-template-rows:0fr;opacity:0}}.animate-collapseHeight{animation:collapseHeight 50ms cubic-bezier(.33,1.05,.68,.98) forwards}.animate-deepResearchIndicator{animation:indicator steps(48) infinite}@keyframes expandHeight{0%{grid-template-rows:0fr;opacity:0}to{grid-template-rows:1fr;opacity:1}}.animate-expandHeight{animation:expandHeight 50ms cubic-bezier(.33,1.05,.68,.98)}@keyframes indeterminate{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(100%)}}.animate-indeterminate{animation:indeterminate 1.5s infinite cubic-bezier(.65,.815,.735,.395)}.animate-labsIndicator{animation:indicator steps(39) infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes indicator{0%{transform:translateZ(0) translate(0)}to{transform:translateZ(0) translate(-100%)}}.animate-pplxIndicator{animation:indicator steps(52) infinite}@keyframes pulse{50%{opacity:.4}0%,to{opacity:1}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-slideDownAndFadeIn{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideDownAndFadeOut{animation:slideDownAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.animate-slideLeftAndFadeIn{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideLeftAndFadeOut{animation:slideLeftAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.animate-slideRightAndFadeIn{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideRightAndFadeOut{animation:slideRightAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.animate-slideUpAndFadeIn{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideUpAndFadeOut{animation:slideUpAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes spin{to{transform:rotate(360deg)}0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}@keyframes underlineFade{0%{text-decoration-color:transparent}to{text-decoration-color:oklch(var(--foreground-color) / .2)}}.animate-underlineFade{animation:underlineFade 1s ease}.\!cursor-grab{cursor:grab!important}.\!cursor-grabbing{cursor:grabbing!important}.\!cursor-not-allowed{cursor:not-allowed!important}.\!cursor-pointer{cursor:pointer!important}.\!cursor-wait{cursor:wait!important}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-wait{cursor:wait}.cursor-zoom-in{cursor:zoom-in}.touch-none{touch-action:none}.touch-pan-down{--tw-pan-y: pan-down;touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-manipulation{touch-action:manipulation}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.scroll-mx-md{scroll-margin-left:var(--size-md);scroll-margin-right:var(--size-md)}.scroll-mb-9{scroll-margin-bottom:2.25rem}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.auto-cols-auto{grid-auto-columns:auto}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.auto-cols-max{grid-auto-columns:max-content}.grid-flow-row{grid-auto-flow:row}.grid-flow-col{grid-auto-flow:column}.auto-rows-fr{grid-auto-rows:minmax(0,1fr)}.\!grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,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-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.grid-cols-\[0\.5fr_1fr\]{grid-template-columns:.5fr 1fr}.grid-cols-\[128px_1fr_auto\]{grid-template-columns:128px 1fr auto}.grid-cols-\[1fr\,1fr\,1fr\]{grid-template-columns:1fr 1fr 1fr}.grid-cols-\[1fr\,1fr\]{grid-template-columns:1fr 1fr}.grid-cols-\[1fr\,auto\,1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[1fr\,auto\,auto\,auto\]{grid-template-columns:1fr auto auto auto}.grid-cols-\[1fr\,auto\,auto\]{grid-template-columns:1fr auto auto}.grid-cols-\[1fr\]{grid-template-columns:1fr}.grid-cols-\[1fr_1fr\]{grid-template-columns:1fr 1fr}.grid-cols-\[1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr}.grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[1fr_max-content\]{grid-template-columns:1fr max-content}.grid-cols-\[1fr_min-content_min-content\]{grid-template-columns:1fr min-content min-content}.grid-cols-\[26\.8\%_1fr\]{grid-template-columns:26.8% 1fr}.grid-cols-\[2fr\,1fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr 1fr}.grid-cols-\[2fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr}.grid-cols-\[2fr\,1fr\]{grid-template-columns:2fr 1fr}.grid-cols-\[3fr\,1fr\,1fr\,1fr\]{grid-template-columns:3fr 1fr 1fr 1fr}.grid-cols-\[3fr\,2fr\,2fr\]{grid-template-columns:3fr 2fr 2fr}.grid-cols-\[65\%\,35\%\]{grid-template-columns:65% 35%}.grid-cols-\[8fr_minmax\(300px\,3fr\)\]{grid-template-columns:8fr minmax(300px,3fr)}.grid-cols-\[auto\,1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto\,max-content\]{grid-template-columns:auto max-content}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_1fr_88px_88px_88px\]{grid-template-columns:auto 1fr 88px 88px 88px}.grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.grid-cols-\[auto_min-content\]{grid-template-columns:auto min-content}.grid-cols-\[max-content_1fr\]{grid-template-columns:max-content 1fr}.grid-cols-\[max-content_auto\]{grid-template-columns:max-content auto}.grid-cols-\[min-content\,1fr\,1fr\,min-content\]{grid-template-columns:min-content 1fr 1fr min-content}.grid-cols-\[min-content\,1fr\,max-content\,min-content\]{grid-template-columns:min-content 1fr max-content min-content}.grid-cols-\[min-content\,1fr\,min-content\]{grid-template-columns:min-content 1fr min-content}.grid-cols-\[min-content\,1fr\,minmax\(max-content\,1fr\)\,min-content\]{grid-template-columns:min-content 1fr minmax(max-content,1fr) min-content}.grid-cols-\[min-content_1fr_3fr\]{grid-template-columns:min-content 1fr 3fr}.grid-cols-\[minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_48px_64px_40px\]{grid-template-columns:minmax(0,1fr) 48px 64px 40px}.grid-cols-\[minmax\(0\,1fr\)_auto_56px\]{grid-template-columns:minmax(0,1fr) auto 56px}.grid-cols-\[minmax\(0\,1fr\)_min-content_min-content\]{grid-template-columns:minmax(0,1fr) min-content min-content}.grid-cols-\[repeat\(7\,1fr\)\]{grid-template-columns:repeat(7,1fr)}.grid-cols-\[repeat\(auto-fill\,_minmax\(280px\,_1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(160px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(180px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(220px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.grid-cols-subgrid{grid-template-columns:subgrid}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}.grid-rows-1fr-auto{grid-template-rows:1fr auto}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))}.grid-rows-4{grid-template-rows:repeat(4,minmax(0,1fr))}.grid-rows-\[0fr\]{grid-template-rows:0fr}.grid-rows-\[1fr\]{grid-template-rows:1fr}.grid-rows-\[min-content_1fr\]{grid-template-rows:min-content 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.\!flex-col{flex-direction:column!important}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.place-content-center{place-content:center}.place-content-between{place-content:space-between}.place-items-center{place-items:center}.content-center{align-content:center}.\!items-start{align-items:flex-start!important}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.\!justify-start{justify-content:flex-start!important}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.justify-stretch{justify-content:stretch}.justify-items-center{justify-items:center}.justify-items-stretch{justify-items:stretch}.\!gap-0{gap:0px!important}.\!gap-1{gap:.25rem!important}.\!gap-4{gap:1rem!important}.\!gap-sm{gap:var(--size-sm)!important}.\!gap-xs{gap:var(--size-xs)!important}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-2xl{gap:96px}.gap-2xs{gap:var(--size-2xs)}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[0\.1em\]{gap:.1em}.gap-\[0\.2em\]{gap:.2em}.gap-\[10px\]{gap:10px}.gap-\[11px\]{gap:11px}.gap-\[12px\]{gap:12px}.gap-\[20px\]{gap:20px}.gap-\[5px\]{gap:5px}.gap-\[6px\]{gap:6px}.gap-\[7px\]{gap:7px}.gap-lg{gap:var(--size-lg)}.gap-md{gap:var(--size-md)}.gap-px{gap:1px}.gap-sm{gap:var(--size-sm)}.gap-three{gap:3px}.gap-two{gap:2px}.gap-xl{gap:var(--size-xl)}.gap-xs{gap:var(--size-xs)}.\!gap-y-md{row-gap:var(--size-md)!important}.gap-x-0{-moz-column-gap:0px;column-gap:0px}.gap-x-0\.5{-moz-column-gap:.125rem;column-gap:.125rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-1\.5{-moz-column-gap:.375rem;column-gap:.375rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-2xl{-moz-column-gap:96px;column-gap:96px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-x-\[12px\]{-moz-column-gap:12px;column-gap:12px}.gap-x-lg{-moz-column-gap:var(--size-lg);column-gap:var(--size-lg)}.gap-x-md{-moz-column-gap:var(--size-md);column-gap:var(--size-md)}.gap-x-sm{-moz-column-gap:var(--size-sm);column-gap:var(--size-sm)}.gap-x-two{-moz-column-gap:2px;column-gap:2px}.gap-x-xl{-moz-column-gap:var(--size-xl);column-gap:var(--size-xl)}.gap-x-xs{-moz-column-gap:var(--size-xs);column-gap:var(--size-xs)}.gap-y-0{row-gap:0px}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-12{row-gap:3rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.gap-y-4{row-gap:1rem}.gap-y-6{row-gap:1.5rem}.gap-y-\[20px\]{row-gap:20px}.gap-y-\[40px\]{row-gap:40px}.gap-y-lg{row-gap:var(--size-lg)}.gap-y-md{row-gap:var(--size-md)}.gap-y-sm{row-gap:var(--size-sm)}.gap-y-xs{row-gap:var(--size-xs)}.-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-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-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-sm>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(var(--size-sm) * var(--tw-space-x-reverse));margin-left:calc(var(--size-sm) * calc(1 - var(--tw-space-x-reverse)))}.space-x-two>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2px * var(--tw-space-x-reverse));margin-left:calc(2px * calc(1 - var(--tw-space-x-reverse)))}.space-x-xs>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(var(--size-xs) * var(--tw-space-x-reverse));margin-left:calc(var(--size-xs) * calc(1 - var(--tw-space-x-reverse)))}.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))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-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-20>: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-2xs>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-2xs) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-2xs) * 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))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.space-y-lg>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-lg) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-lg) * var(--tw-space-y-reverse))}.space-y-md>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-md) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-md) * var(--tw-space-y-reverse))}.space-y-ml>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-ml) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-ml) * var(--tw-space-y-reverse))}.space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.space-y-sm>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-sm) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-sm) * var(--tw-space-y-reverse))}.space-y-xs>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-xs) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-xs) * var(--tw-space-y-reverse))}.\!divide-y-0>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(0px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(0px * var(--tw-divide-y-reverse))!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#e5e7eb\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.divide-\[\#f3f4f6\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-subtle>:not([hidden])~:not([hidden]){border-color:oklch(var(--foreground-subtle-color))}.divide-subtlest>:not([hidden])~:not([hidden]){border-color:oklch(var(--foreground-subtlest-color))}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.self-stretch{align-self:stretch}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-stretch{justify-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.\!overflow-clip{overflow:clip!important}.overflow-clip{overflow:clip}.\!overflow-visible{overflow:visible!important}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-x-clip{overflow-x:clip}.overflow-x-visible{overflow-x:visible}.\!overflow-x-scroll{overflow-x:scroll!important}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.text-clip{text-overflow:clip}.hyphens-auto{-webkit-hyphens:auto;hyphens:auto}.whitespace-normal{white-space:normal}.\!whitespace-nowrap{white-space:nowrap!important}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-wrap{text-wrap:wrap!important}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.text-balance{text-wrap:balance}.text-pretty{text-wrap:pretty}.break-normal{overflow-wrap:normal;word-break:normal}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-2xl{border-radius:1rem!important}.\!rounded-3xl{border-radius:1.25rem!important}.\!rounded-\[14px\]{border-radius:14px!important}.\!rounded-\[4px\]{border-radius:4px!important}.\!rounded-full{border-radius:9999px!important}.\!rounded-lg{border-radius:.5rem!important}.\!rounded-md{border-radius:.375rem!important}.\!rounded-none{border-radius:0!important}.\!rounded-sm{border-radius:.125rem!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.25rem}.rounded-\[0\.3125rem\]{border-radius:.3125rem}.rounded-\[100\%\]{border-radius:100%}.rounded-\[10px\]{border-radius:10px}.rounded-\[116px\]{border-radius:116px}.rounded-\[122px\]{border-radius:122px}.rounded-\[12px\]{border-radius:12px}.rounded-\[13px\]{border-radius:13px}.rounded-\[16px\]{border-radius:16px}.rounded-\[1px\]{border-radius:1px}.rounded-\[20px\]{border-radius:20px}.rounded-\[37px\]{border-radius:37px}.rounded-\[4px\]{border-radius:4px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[52px\]{border-radius:52px}.rounded-\[54px\]{border-radius:54px}.rounded-\[6px\]{border-radius:6px}.rounded-badge{border-radius:.3125rem}.rounded-full{border-radius:9999px}.rounded-inherit{border-radius:inherit}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.\!rounded-b-none{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-b-\[20px\]{border-bottom-right-radius:20px;border-bottom-left-radius:20px}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-sm{border-bottom-right-radius:.125rem;border-bottom-left-radius:.125rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-l-sm{border-top-left-radius:.125rem;border-bottom-left-radius:.125rem}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-\[24px\]{border-top-left-radius:24px;border-top-right-radius:24px}.rounded-t-full{border-top-left-radius:9999px;border-top-right-radius:9999px}.rounded-t-inherit{border-top-left-radius:inherit;border-top-right-radius:inherit}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-br-\[11px\]{border-bottom-right-radius:11px}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl{border-top-left-radius:.25rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.rounded-tr-none{border-top-right-radius:0}.\!border{border-width:1px!important}.\!border-0{border-width:0px!important}.\!border-2{border-width:2px!important}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[0\.2px\]{border-width:.2px}.border-\[0\.5px\]{border-width:.5px}.border-\[0\.75px\]{border-width:.75px}.border-\[10px\]{border-width:10px}.border-\[1px\]{border-width:1px}.border-\[2px\]{border-width:2px}.border-\[4px\]{border-width:4px}.border-x{border-left-width:1px;border-right-width:1px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-x-4{border-left-width:4px;border-right-width:4px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-y{border-top-width:1px;border-bottom-width:1px}.\!border-b{border-bottom-width:1px!important}.\!border-b-0{border-bottom-width:0px!important}.\!border-l-0{border-left-width:0px!important}.\!border-r-0{border-right-width:0px!important}.\!border-t-0{border-top-width:0px!important}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-b-4{border-bottom-width:4px}.border-b-\[2px\]{border-bottom-width:2px}.border-e{border-inline-end-width:1px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-\[5px\]{border-top-width:5px}.border-t-\[7px\]{border-top-width:7px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.\!border-none{border-style:none!important}.border-none{border-style:none}.\!border-\[\#32B8C6\]{--tw-border-opacity: 1 !important;border-color:rgb(50 184 198 / var(--tw-border-opacity))!important}.\!border-\[black\]\/10{border-color:#0000001a!important}.\!border-black\/30{border-color:#0000004d!important}.\!border-caution{--tw-border-opacity: 1 !important;border-color:oklch(var(--caution-color) / var(--tw-border-opacity))!important}.\!border-caution\/50{border-color:oklch(var(--caution-color) / .5)!important}.\!border-inverse{border-color:oklch(var(--foreground-inverse-color))!important}.\!border-negative{border-color:oklch(var(--negative-color))!important}.\!border-subtle{border-color:oklch(var(--foreground-subtle-color))!important}.\!border-subtler{border-color:oklch(var(--foreground-subtler-color))!important}.\!border-subtlest{border-color:oklch(var(--foreground-subtlest-color))!important}.\!border-super{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.\!border-super\/10{border-color:oklch(var(--super-color) / .1)!important}.\!border-super\/30{border-color:oklch(var(--super-color) / .3)!important}.\!border-super\/75{border-color:oklch(var(--super-color) / .75)!important}.\!border-transparent{border-color:transparent!important}.\!border-white{--tw-border-opacity: 1 !important;border-color:rgb(255 255 255 / var(--tw-border-opacity))!important}.border-\[\#05FFFF\]\/20{border-color:#05ffff33}.border-\[\#A7A7A2\]{--tw-border-opacity: 1;border-color:rgb(167 167 162 / var(--tw-border-opacity))}.border-\[black\]\/10{border-color:#0000001a}.border-\[black\]\/5{border-color:#0000000d}.border-\[purple\]{--tw-border-opacity: 1;border-color:rgb(128 0 128 / var(--tw-border-opacity))}.border-black\/10{border-color:#0000001a}.border-black\/20{border-color:#0003}.border-caution\/10{border-color:oklch(var(--caution-color) / .1)}.border-caution\/20{border-color:oklch(var(--caution-color) / .2)}.border-caution\/50{border-color:oklch(var(--caution-color) / .5)}.border-dynamic{border-color:oklch(var(--border-dynamic))}.border-foreground{border-color:oklch(var(--foreground-color))}.border-inverse{border-color:oklch(var(--foreground-inverse-color))}.border-max{--tw-border-opacity: 1;border-color:oklch(var(--max-color) / var(--tw-border-opacity))}.border-negative{border-color:oklch(var(--negative-color))}.border-positive{border-color:oklch(var(--positive-color))}.border-subtle{border-color:oklch(var(--foreground-subtle-color))}.border-subtler{border-color:oklch(var(--foreground-subtler-color))}.border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}.border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.border-super\/10{border-color:oklch(var(--super-color) / .1)}.border-super\/20{border-color:oklch(var(--super-color) / .2)}.border-super\/30{border-color:oklch(var(--super-color) / .3)}.border-super\/40{border-color:oklch(var(--super-color) / .4)}.border-super\/50{border-color:oklch(var(--super-color) / .5)}.border-superBG{--tw-border-opacity: 1;border-color:oklch(var(--super-bg-color) / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-white\/10{border-color:#ffffff1a}.border-white\/20{border-color:#fff3}.border-white\/30{border-color:#ffffff4d}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.\!border-b-subtler{border-bottom-color:oklch(var(--foreground-subtler-color))!important}.\!border-b-subtlest{border-bottom-color:oklch(var(--foreground-subtlest-color))!important}.\!border-t-subtlest{border-top-color:oklch(var(--foreground-subtlest-color))!important}.border-b-subtler{border-bottom-color:oklch(var(--foreground-subtler-color))}.border-b-subtlest{border-bottom-color:oklch(var(--foreground-subtlest-color))}.border-r-subtlest{border-right-color:oklch(var(--foreground-subtlest-color))}.border-t-subtlest{border-top-color:oklch(var(--foreground-subtlest-color))}.border-t-super{--tw-border-opacity: 1;border-top-color:oklch(var(--super-color) / var(--tw-border-opacity))}.border-t-transparent{border-top-color:transparent}.border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity))}.\!bg-\[\#1e293b\]{--tw-bg-opacity: 1 !important;background-color:rgb(30 41 59 / var(--tw-bg-opacity))!important}.\!bg-\[\#5433eb\]{--tw-bg-opacity: 1 !important;background-color:rgb(84 51 235 / var(--tw-bg-opacity))!important}.\!bg-\[\#e10600\]{--tw-bg-opacity: 1 !important;background-color:rgb(225 6 0 / var(--tw-bg-opacity))!important}.\!bg-\[\#ffffff1a\]{background-color:#ffffff1a!important}.\!bg-\[gold\]{--tw-bg-opacity: 1 !important;background-color:rgb(255 215 0 / var(--tw-bg-opacity))!important}.\!bg-\[oklch\(var\(--pale-blue-200\)\)\]{background-color:oklch(var(--pale-blue-200))!important}.\!bg-\[silver\]{--tw-bg-opacity: 1 !important;background-color:rgb(192 192 192 / var(--tw-bg-opacity))!important}.\!bg-\[var\(--header-bg\,\#051224\)\]{background-color:var(--header-bg,#051224)!important}.\!bg-\[var\(--header-bg\,\#84754E\)\]{background-color:var(--header-bg,#84754E)!important}.\!bg-attention\/10{background-color:oklch(var(--attention-color) / .1)!important}.\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}.\!bg-base\/95{background-color:oklch(var(--background-base-color) / .95)!important}.\!bg-black{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity))!important}.\!bg-black\/10{background-color:#0000001a!important}.\!bg-black\/30{background-color:#0000004d!important}.\!bg-black\/5{background-color:#0000000d!important}.\!bg-black\/50{background-color:#00000080!important}.\!bg-caution\/10{background-color:oklch(var(--caution-color) / .1)!important}.\!bg-inverse{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))!important}.\!bg-inverse\/10{background-color:oklch(var(--background-inverse-color) / .1)!important}.\!bg-inverse\/100{background-color:oklch(var(--background-inverse-color) / 1)!important}.\!bg-inverse\/5{background-color:oklch(var(--background-inverse-color) / .05)!important}.\!bg-inverse\/50{background-color:oklch(var(--background-inverse-color) / .5)!important}.\!bg-inverse\/70{background-color:oklch(var(--background-inverse-color) / .7)!important}.\!bg-max{--tw-bg-opacity: 1 !important;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))!important}.\!bg-negative\/10{background-color:oklch(var(--negative-color) / .1)!important}.\!bg-negative\/20{background-color:oklch(var(--negative-color) / .2)!important}.\!bg-offset{background-color:oklch(var(--offset-color))!important}.\!bg-raised{background-color:oklch(var(--background-raised-color))!important}.\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}.\!bg-subtlest{background-color:oklch(var(--background-subtlest-color))!important}.\!bg-super{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\!bg-super\/10{background-color:oklch(var(--super-color) / .1)!important}.\!bg-super\/15{background-color:oklch(var(--super-color) / .15)!important}.\!bg-super\/20{background-color:oklch(var(--super-color) / .2)!important}.\!bg-transparent{background-color:transparent!important}.\!bg-underlay{background-color:oklch(var(--background-underlay-color))!important}.\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.\!bg-white\/10{background-color:#ffffff1a!important}.bg-\[\#000000\]{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-\[\#008cff\]{--tw-bg-opacity: 1;background-color:rgb(0 140 255 / var(--tw-bg-opacity))}.bg-\[\#059669\]{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity))}.bg-\[\#13343B\]{--tw-bg-opacity: 1;background-color:rgb(19 52 59 / var(--tw-bg-opacity))}.bg-\[\#19789E\]{--tw-bg-opacity: 1;background-color:rgb(25 120 158 / var(--tw-bg-opacity))}.bg-\[\#1F2121\]{--tw-bg-opacity: 1;background-color:rgb(31 33 33 / var(--tw-bg-opacity))}.bg-\[\#21808D\]{--tw-bg-opacity: 1;background-color:rgb(33 128 141 / var(--tw-bg-opacity))}.bg-\[\#292524\]{--tw-bg-opacity: 1;background-color:rgb(41 37 36 / var(--tw-bg-opacity))}.bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}.bg-\[\#44403c\]{--tw-bg-opacity: 1;background-color:rgb(68 64 60 / var(--tw-bg-opacity))}.bg-\[\#482d2f\]{--tw-bg-opacity: 1;background-color:rgb(72 45 47 / var(--tw-bg-opacity))}.bg-\[\#60584D\]\/\[0\.06\]{background-color:#60584d0f}.bg-\[\#64748b\]{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity))}.bg-\[\#848456\]{--tw-bg-opacity: 1;background-color:rgb(132 132 86 / var(--tw-bg-opacity))}.bg-\[\#865D95\]{--tw-bg-opacity: 1;background-color:rgb(134 93 149 / var(--tw-bg-opacity))}.bg-\[\#944454\]{--tw-bg-opacity: 1;background-color:rgb(148 68 84 / var(--tw-bg-opacity))}.bg-\[\#A84B2F\]{--tw-bg-opacity: 1;background-color:rgb(168 75 47 / var(--tw-bg-opacity))}.bg-\[\#C0152F\]{--tw-bg-opacity: 1;background-color:rgb(192 21 47 / var(--tw-bg-opacity))}.bg-\[\#D39900\]{--tw-bg-opacity: 1;background-color:rgb(211 153 0 / var(--tw-bg-opacity))}.bg-\[\#DB7100\]{--tw-bg-opacity: 1;background-color:rgb(219 113 0 / var(--tw-bg-opacity))}.bg-\[\#DEDBD7\]{--tw-bg-opacity: 1;background-color:rgb(222 219 215 / var(--tw-bg-opacity))}.bg-\[\#e10600\]{--tw-bg-opacity: 1;background-color:rgb(225 6 0 / var(--tw-bg-opacity))}.bg-\[\#e11d48\]{--tw-bg-opacity: 1;background-color:rgb(225 29 72 / var(--tw-bg-opacity))}.bg-\[\#f3f3ef\]{--tw-bg-opacity: 1;background-color:rgb(243 243 239 / var(--tw-bg-opacity))}.bg-\[\#facc15\]\/25{background-color:#facc1540}.bg-\[\#fee2e2\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-\[color\:oklch\(var\(--foreground-color\)\/0\.15\)\]{background-color:oklch(var(--foreground-color)/.15)}.bg-\[purple\]\/90{background-color:#800080e6}.bg-\[var\(--dot-color\)\]{background-color:var(--dot-color)}.bg-attention{--tw-bg-opacity: 1;background-color:oklch(var(--attention-color) / var(--tw-bg-opacity))}.bg-attention\/10{background-color:oklch(var(--attention-color) / .1)}.bg-backdrop{--tw-bg-opacity: 1;background-color:oklch(var(--backdrop-color) / var(--tw-bg-opacity))}.bg-backdrop\/25{background-color:oklch(var(--backdrop-color) / .25)}.bg-backdrop\/70{background-color:oklch(var(--backdrop-color) / .7)}.bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}.bg-base\/40{background-color:oklch(var(--background-base-color) / .4)}.bg-base\/90{background-color:oklch(var(--background-base-color) / .9)}.bg-base\/95{background-color:oklch(var(--background-base-color) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/10{background-color:#0000001a}.bg-black\/20{background-color:#0003}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/80{background-color:#000c}.bg-caution{--tw-bg-opacity: 1;background-color:oklch(var(--caution-color) / var(--tw-bg-opacity))}.bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}.bg-caution\/5{background-color:oklch(var(--caution-color) / .05)}.bg-current{background-color:currentColor}.bg-dark{background-color:oklch(var(--dark-background-base-color))}.bg-elevated{background-color:oklch(var(--background-elevated-color))}.bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}.bg-inverse\/10{background-color:oklch(var(--background-inverse-color) / .1)}.bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}.bg-inverse\/25{background-color:oklch(var(--background-inverse-color) / .25)}.bg-inverse\/30{background-color:oklch(var(--background-inverse-color) / .3)}.bg-inverse\/45{background-color:oklch(var(--background-inverse-color) / .45)}.bg-inverse\/5{background-color:oklch(var(--background-inverse-color) / .05)}.bg-inverse\/70{background-color:oklch(var(--background-inverse-color) / .7)}.bg-lightbox\/95{background-color:oklch(var(--background-lightbox-color) / .95)}.bg-max{--tw-bg-opacity: 1;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))}.bg-negative{--tw-bg-opacity: 1;background-color:oklch(var(--negative-color) / var(--tw-bg-opacity))}.bg-negative\/10{background-color:oklch(var(--negative-color) / .1)}.bg-negative\/5{background-color:oklch(var(--negative-color) / .05)}.bg-negative\/90{background-color:oklch(var(--negative-color) / .9)}.bg-offset{background-color:oklch(var(--offset-color))}.bg-offset-special{background-color:oklch(var(--surface-offset-special))}.bg-positive{--tw-bg-opacity: 1;background-color:oklch(var(--positive-color) / var(--tw-bg-opacity))}.bg-positive\/10{background-color:oklch(var(--positive-color) / .1)}.bg-positive\/90{background-color:oklch(var(--positive-color) / .9)}.bg-raised{background-color:oklch(var(--background-raised-color))}.bg-raisedOffset{background-color:oklch(var(--raised-offset-color))}.bg-subtle{background-color:oklch(var(--background-subtle-color))}.bg-subtler{background-color:oklch(var(--background-subtler-color))}.bg-subtlest{background-color:oklch(var(--background-subtlest-color))}.bg-super{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.bg-super\/10{background-color:oklch(var(--super-color) / .1)}.bg-super\/15{background-color:oklch(var(--super-color) / .15)}.bg-super\/20{background-color:oklch(var(--super-color) / .2)}.bg-super\/30{background-color:oklch(var(--super-color) / .3)}.bg-super\/5{background-color:oklch(var(--super-color) / .05)}.bg-superBG{--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-underlay{background-color:oklch(var(--background-underlay-color))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/5{background-color:#ffffff0d}.bg-white\/50{background-color:#ffffff80}.bg-white\/75{background-color:#ffffffbf}.bg-white\/80{background-color:#fffc}.bg-opacity-60{--tw-bg-opacity: .6}.bg-\[conic-gradient\(var\(--button-border-gradient-stops\)\)\]{background-image:conic-gradient(var(--button-border-gradient-stops))}.bg-\[radial-gradient\(circle_farthest-side_at_0_100\%\,\#139FB233\,\#139FB2cc\)\,radial-gradient\(circle_farthest-side_at_100\%_0\,\#139FB233\,transparent\)\]{background-image:radial-gradient(circle farthest-side at 0 100%,#139fb233,#139fb2cc),radial-gradient(circle farthest-side at 100% 0,#139FB233,transparent)}.bg-\[radial-gradient\(circle_farthest-side_at_0_100\%\,\#27cae0e3\,transparent\)\,radial-gradient\(circle_farthest-side_at_100\%_0\,\#24B4C81A\,transparent\)\]{background-image:radial-gradient(circle farthest-side at 0 100%,#27cae0e3,transparent),radial-gradient(circle farthest-side at 100% 0,#24B4C81A,transparent)}.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-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.bg-none{background-image:none}.from-\[\#1FB8CD80\]{--tw-gradient-from: #1FB8CD80 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 184 205 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-base{--tw-gradient-from: oklch(var(--background-base-color) / 1) var(--tw-gradient-from-position);--tw-gradient-to: oklch(var(--background-base-color) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-base\/50{--tw-gradient-from: oklch(var(--background-base-color) / .5) 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)}.from-black{--tw-gradient-from: #000 var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/40{--tw-gradient-from: rgb(0 0 0 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/70{--tw-gradient-from: rgb(0 0 0 / .7) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-negative\/20{--tw-gradient-from: oklch(var(--negative-color) / .2) 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)}.from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}.from-super\/25{--tw-gradient-from: oklch(var(--super-color) / .25) 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)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-35\%{--tw-gradient-from-position: 35%}.from-45\%{--tw-gradient-from-position: 45%}.from-5\%{--tw-gradient-from-position: 5%}.from-\[-10\%\]{--tw-gradient-from-position: -10%}.via-base\/80{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-base-color) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-black\/20{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-subtle{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-subtle-color)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-subtler{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-subtler-color)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-50\%{--tw-gradient-via-position: 50%}.via-75\%{--tw-gradient-via-position: 75%}.to-\[\#24B4C81A\]{--tw-gradient-to: #24B4C81A var(--tw-gradient-to-position)}.to-\[oklch\(var\(--light-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--light-background-base-color)) var(--tw-gradient-to-position)}.to-\[rgba\(180\,180\,180\,0\.075\)\]{--tw-gradient-to: rgba(180,180,180,.075) var(--tw-gradient-to-position)}.to-attention\/20{--tw-gradient-to: oklch(var(--attention-color) / .2) var(--tw-gradient-to-position)}.to-base{--tw-gradient-to: oklch(var(--background-base-color) / 1) var(--tw-gradient-to-position)}.to-base\/0{--tw-gradient-to: oklch(var(--background-base-color) / 0) var(--tw-gradient-to-position)}.to-black\/20{--tw-gradient-to: rgb(0 0 0 / .2) var(--tw-gradient-to-position)}.to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}.to-super\/25{--tw-gradient-to: oklch(var(--super-color) / .25) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-\[110\%\]{--tw-gradient-to-position: 110%}.bg-cover{background-size:cover}.bg-clip-border{background-clip:border-box}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-center{background-position:center}.bg-no-repeat{background-repeat:no-repeat}.\!fill-inverse{fill:oklch(var(--foreground-inverse-color))!important}.\!fill-super{fill:oklch(var(--super-color) / 1)!important}.fill-\[\#eab308\]{fill:#eab308}.fill-\[oklch\(var\(--background-base-color\)\)\]{fill:oklch(var(--background-base-color))}.fill-\[oklch\(var\(--dark-background-base-color\)\)\]{fill:oklch(var(--dark-background-base-color))}.fill-base{fill:oklch(var(--background-base-color))}.fill-caution{fill:oklch(var(--caution-color) / 1)}.fill-current{fill:currentColor}.fill-dark{fill:oklch(var(--light-foreground-color))}.fill-foreground{fill:oklch(var(--foreground-color))}.fill-inverse{fill:oklch(var(--foreground-inverse-color))}.fill-light{fill:oklch(var(--dark-foreground-color))}.fill-max{fill:oklch(var(--max-color) / 1)}.fill-offset{fill:oklch(var(--offset-color))}.fill-quiet{fill:oklch(var(--foreground-quiet-color))}.fill-super{fill:oklch(var(--super-color) / 1)}.fill-transparent{fill:transparent}.stroke-\[\#e10600\]{stroke:#e10600}.stroke-caution{stroke:oklch(var(--caution-color) / 1)}.stroke-dark{stroke:oklch(var(--light-foreground-color))}.stroke-foreground{stroke:oklch(var(--foreground-color))}.stroke-inverse{stroke:oklch(var(--foreground-inverse-color))}.stroke-light{stroke:oklch(var(--dark-foreground-color))}.stroke-quiet{stroke:oklch(var(--foreground-quiet-color))}.stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}.stroke-super{stroke:oklch(var(--super-color) / 1)}.stroke-white\/5{stroke:#ffffff0d}.stroke-\[1\.5px\]{stroke-width:1.5px}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-none{-o-object-fit:none;object-fit:none}.\!object-center{-o-object-position:center!important;object-position:center!important}.object-\[0_90\%\]{-o-object-position:0 90%;object-position:0 90%}.object-\[60\%_center\]{-o-object-position:60% center;object-position:60% center}.object-center{-o-object-position:center;object-position:center}.object-left{-o-object-position:left;object-position:left}.object-left-top{-o-object-position:left top;object-position:left top}.object-top{-o-object-position:top;object-position:top}.\!p-0{padding:0!important}.\!p-3{padding:.75rem!important}.\!p-6{padding:1.5rem!important}.\!p-md{padding:var(--size-md)!important}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-12{padding:3rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-24{padding:6rem}.p-2xl{padding:96px}.p-2xs{padding:var(--size-2xs)}.p-3{padding:.75rem}.p-32{padding:8rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[0\.2rem\]{padding:.2rem}.p-\[0\.5px\]{padding:.5px}.p-\[0\.8rem\]{padding:.8rem}.p-\[1\.5px\]{padding:1.5px}.p-\[10px\]{padding:10px}.p-\[12px\]{padding:12px}.p-\[2\.5px\]{padding:2.5px}.p-\[20px\]{padding:20px}.p-\[4px\]{padding:4px}.p-\[6px\]{padding:6px}.p-\[7px\]{padding:7px}.p-\[8px\]{padding:8px}.p-half{padding:.5px}.p-lg{padding:var(--size-lg)}.p-md{padding:var(--size-md)}.p-ml{padding:var(--size-ml)}.p-one,.p-px{padding:1px}.p-sm{padding:var(--size-sm)}.p-three{padding:3px}.p-two{padding:2px}.p-xl{padding:var(--size-xl)}.p-xs{padding:var(--size-xs)}.\!px-0{padding-left:0!important;padding-right:0!important}.\!px-1{padding-left:.25rem!important;padding-right:.25rem!important}.\!px-1\.5{padding-left:.375rem!important;padding-right:.375rem!important}.\!px-2xl{padding-left:96px!important;padding-right:96px!important}.\!px-3{padding-left:.75rem!important;padding-right:.75rem!important}.\!px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.\!px-8{padding-left:2rem!important;padding-right:2rem!important}.\!px-\[12px\]{padding-left:12px!important;padding-right:12px!important}.\!px-lg{padding-left:var(--size-lg)!important;padding-right:var(--size-lg)!important}.\!px-md{padding-left:var(--size-md)!important;padding-right:var(--size-md)!important}.\!px-sm{padding-left:var(--size-sm)!important;padding-right:var(--size-sm)!important}.\!px-xs{padding-left:var(--size-xs)!important;padding-right:var(--size-xs)!important}.\!py-0{padding-top:0!important;padding-bottom:0!important}.\!py-md{padding-top:var(--size-md)!important;padding-bottom:var(--size-md)!important}.\!py-sm{padding-top:var(--size-sm)!important;padding-bottom:var(--size-sm)!important}.\!py-xs{padding-top:var(--size-xs)!important;padding-bottom:var(--size-xs)!important}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.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-3\.5{padding-left:.875rem;padding-right:.875rem}.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}.px-\[0\.1875rem\]{padding-left:.1875rem;padding-right:.1875rem}.px-\[0\.3rem\]{padding-left:.3rem;padding-right:.3rem}.px-\[0\.6em\]{padding-left:.6em;padding-right:.6em}.px-\[0\.6rem\]{padding-left:.6rem;padding-right:.6rem}.px-\[10px\]{padding-left:10px;padding-right:10px}.px-\[12px\]{padding-left:12px;padding-right:12px}.px-\[5px\]{padding-left:5px;padding-right:5px}.px-\[6px\]{padding-left:6px;padding-right:6px}.px-\[var\(--thread-visual-spacing\)\]{padding-left:var(--thread-visual-spacing);padding-right:var(--thread-visual-spacing)}.px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.px-pageHorizontalPadding{padding-left:var(--page-horizontal-padding);padding-right:var(--page-horizontal-padding)}.px-px{padding-left:1px;padding-right:1px}.px-sm{padding-left:var(--size-sm);padding-right:var(--size-sm)}.px-three{padding-left:3px;padding-right:3px}.px-two{padding-left:2px;padding-right:2px}.px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.px-xs{padding-left:var(--size-xs);padding-right:var(--size-xs)}.py-0{padding-top:0;padding-bottom:0}.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-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-2xl{padding-top:96px;padding-bottom:96px}.py-2xs{padding-top:var(--size-2xs);padding-bottom:var(--size-2xs)}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-32{padding-top:8rem;padding-bottom:8rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[0\.125rem\]{padding-top:.125rem;padding-bottom:.125rem}.py-\[0\.15em\]{padding-top:.15em;padding-bottom:.15em}.py-\[0\.175rem\]{padding-top:.175rem;padding-bottom:.175rem}.py-\[0\.1875rem\]{padding-top:.1875rem;padding-bottom:.1875rem}.py-\[10px\]{padding-top:10px;padding-bottom:10px}.py-\[12px\]{padding-top:12px;padding-bottom:12px}.py-\[18px\]{padding-top:18px;padding-bottom:18px}.py-\[20px\]{padding-top:20px;padding-bottom:20px}.py-\[6px\]{padding-top:6px;padding-bottom:6px}.py-lg{padding-top:var(--size-lg);padding-bottom:var(--size-lg)}.py-md{padding-top:var(--size-md);padding-bottom:var(--size-md)}.py-ml{padding-top:var(--size-ml);padding-bottom:var(--size-ml)}.py-px{padding-top:1px;padding-bottom:1px}.py-sm{padding-top:var(--size-sm);padding-bottom:var(--size-sm)}.py-two{padding-top:2px;padding-bottom:2px}.py-xl{padding-top:var(--size-xl);padding-bottom:var(--size-xl)}.py-xs{padding-top:var(--size-xs);padding-bottom:var(--size-xs)}.\!pb-0{padding-bottom:0!important}.\!pb-4{padding-bottom:1rem!important}.\!pb-6{padding-bottom:1.5rem!important}.\!pb-md{padding-bottom:var(--size-md)!important}.\!pb-px{padding-bottom:1px!important}.\!pl-0{padding-left:0!important}.\!pl-1{padding-left:.25rem!important}.\!pl-1\.5{padding-left:.375rem!important}.\!pl-3{padding-left:.75rem!important}.\!pl-4{padding-left:1rem!important}.\!pl-\[0\.3em\]{padding-left:.3em!important}.\!pl-\[23px\]{padding-left:23px!important}.\!pl-sm{padding-left:var(--size-sm)!important}.\!pr-0{padding-right:0!important}.\!pr-3{padding-right:.75rem!important}.\!pt-0{padding-top:0!important}.\!pt-10{padding-top:2.5rem!important}.\!pt-4{padding-top:1rem!important}.\!pt-8{padding-top:2rem!important}.pb-0{padding-bottom:0}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-12{padding-bottom:3rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-48{padding-bottom:12rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-7{padding-bottom:1.75rem}.pb-8{padding-bottom:2rem}.pb-\[100px\]{padding-bottom:100px}.pb-\[12px\]{padding-bottom:12px}.pb-\[160px\]{padding-bottom:160px}.pb-\[200px\]{padding-bottom:200px}.pb-\[32px\]{padding-bottom:32px}.pb-\[57px\]{padding-bottom:57px}.pb-\[var\(--thread-visual-spacing\)\]{padding-bottom:var(--thread-visual-spacing)}.pb-lg{padding-bottom:var(--size-lg)}.pb-md{padding-bottom:var(--size-md)}.pb-mobileNavHeight{padding-bottom:var(--mobile-nav-height)}.pb-px{padding-bottom:1px}.pb-safeAreaInsetBottom{padding-bottom:var(--safe-area-inset-bottom)}.pb-sm{padding-bottom:var(--size-sm)}.pb-threadAttachmentsHeightWithPadding{padding-bottom:var(--thread-attachments-height-with-padding)}.pb-threadInputHeightWithPadding{padding-bottom:var(--thread-input-height-with-padding)}.pb-three{padding-bottom:3px}.pb-two{padding-bottom:2px}.pb-xl{padding-bottom:var(--size-xl)}.pb-xs{padding-bottom:var(--size-xs)}.pe-\[20px\]{padding-inline-end:20px}.pl-0{padding-left:0}.pl-1{padding-left:.25rem}.pl-1\.5{padding-left:.375rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-\[12px\]{padding-left:12px}.pl-\[14px\]{padding-left:14px}.pl-\[2px\]{padding-left:2px}.pl-\[40px\]{padding-left:40px}.pl-\[4px\]{padding-left:4px}.pl-lg{padding-left:var(--size-lg)}.pl-md{padding-left:var(--size-md)}.pl-px{padding-left:1px}.pl-sm{padding-left:var(--size-sm)}.pl-two{padding-left:2px}.pl-xs{padding-left:var(--size-xs)}.pr-0{padding-right:0}.pr-1{padding-right:.25rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-28{padding-right:7rem}.pr-4{padding-right:1rem}.pr-\[10px\]{padding-right:10px}.pr-\[128px\]{padding-right:128px}.pr-\[12px\]{padding-right:12px}.pr-\[24px\]{padding-right:24px}.pr-\[49px\]{padding-right:49px}.pr-\[6px\]{padding-right:6px}.pr-\[75px\]{padding-right:75px}.pr-lg{padding-right:var(--size-lg)}.pr-md{padding-right:var(--size-md)}.pr-sm{padding-right:var(--size-sm)}.pr-three{padding-right:3px}.pr-xs{padding-right:var(--size-xs)}.ps-\[20px\]{padding-inline-start:20px}.ps-md{padding-inline-start:var(--size-md)}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-14{padding-top:3.5rem}.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-\[0\.275rem\]{padding-top:.275rem}.pt-\[12px\]{padding-top:12px}.pt-\[36px\]{padding-top:36px}.pt-\[48px\]{padding-top:48px}.pt-\[4px\]{padding-top:4px}.pt-\[88px\]{padding-top:88px}.pt-\[8vh\]{padding-top:8vh}.pt-\[var\(--thread-visual-spacing\)\]{padding-top:var(--thread-visual-spacing)}.pt-headerHeight{padding-top:var(--header-height)}.pt-lg{padding-top:var(--size-lg)}.pt-md{padding-top:var(--size-md)}.pt-one,.pt-px{padding-top:1px}.pt-sm{padding-top:var(--size-sm)}.pt-three{padding-top:3px}.pt-two{padding-top:2px}.pt-xl{padding-top:var(--size-xl)}.pt-xs{padding-top:var(--size-xs)}.\!text-left{text-align:left!important}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-justify{text-align:justify}.text-end{text-align:end}.align-baseline{vertical-align:baseline}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.align-text-top{vertical-align:text-top}.align-\[-0\.125em\]{vertical-align:-.125em}.\!font-display{font-family:var(--font-fk-grotesk),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"!important}.\!font-editorial{font-family:var(--font-newsreader),ui-serif,Georgia,Cambria,serif!important}.\!font-mono{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace!important}.\!font-sans{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo!important}.font-display{font-family:var(--font-fk-grotesk),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"}.font-editorial{font-family:var(--font-newsreader),ui-serif,Georgia,Cambria,serif}.font-mono{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo}.\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.\!text-2xs{font-size:11px!important;line-height:1rem!important}.\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.\!text-\[0\.6875rem\]{font-size:.6875rem!important}.\!text-\[0\.68rem\]{font-size:.68rem!important}.\!text-\[0\.7rem\]{font-size:.7rem!important}.\!text-\[0\.8125rem\]{font-size:.8125rem!important}.\!text-\[1\.2rem\]{font-size:1.2rem!important}.\!text-\[1\.3rem\]{font-size:1.3rem!important}.\!text-\[1\.75rem\]{font-size:1.75rem!important}.\!text-\[10px\]{font-size:10px!important}.\!text-\[11px\]{font-size:11px!important}.\!text-\[1rem\]{font-size:1rem!important}.\!text-\[2rem\]{font-size:2rem!important}.\!text-\[3rem\]{font-size:3rem!important}.\!text-\[44px\]{font-size:44px!important}.\!text-\[48px\]{font-size:48px!important}.\!text-base{font-size:1rem!important;line-height:1.5rem!important}.\!text-inherit{font-size:inherit!important;line-height:inherit!important}.\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.\!text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.\!text-xs{font-size:.75rem!important;line-height:1rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-2xs{font-size:11px;line-height:1rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-3xs{font-size:10px;line-height:.625rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[0\.80rem\]{font-size:.8rem}.text-\[0\]{font-size:0}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[16px\]{font-size:16px}.text-\[2\.4rem\]{font-size:2.4rem}.text-\[2rem\]{font-size:2rem}.text-\[8px\]{font-size:8px}.text-base{font-size:1rem;line-height:1.5rem}.text-inherit{font-size:inherit;line-height:inherit}.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-medium{font-weight:500!important}.\!font-normal{font-weight:400!important}.font-\[450\]{font-weight:450}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-extralight{font-weight:200}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.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-\[1\.1\]{line-height:1.1!important}.\!leading-\[1\.2\]{line-height:1.2!important}.\!leading-none{line-height:1!important}.\!leading-snug{line-height:1.375!important}.\!leading-tight{line-height:1.25!important}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-\[0\.875rem\]{line-height:.875rem}.leading-\[1\.125rem\]{line-height:1.125rem}.leading-\[1\.1\]{line-height:1.1}.leading-\[1\.2\]{line-height:1.2}.leading-\[1\.3\]{line-height:1.3}.leading-\[1\.5em\]{line-height:1.5em}.leading-\[12px\]{line-height:12px}.leading-\[18px\]{line-height:18px}.leading-\[32px\]{line-height:32px}.leading-\[48px\]{line-height:48px}.leading-\[64px\]{line-height:64px}.leading-\[initial\]{line-height:initial}.leading-loose{line-height:2}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.\!tracking-wider{letter-spacing:.05em!important}.tracking-\[-0\.8px\]{letter-spacing:-.8px}.tracking-\[-1\.8px\]{letter-spacing:-1.8px}.tracking-\[-1px\]{letter-spacing:-1px}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.\!text-\[currentColor\]{color:currentColor!important}.\!text-\[var\(--mode-color\)\]{color:var(--mode-color)!important}.\!text-\[white\]{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\!text-attention{--tw-text-opacity: 1 !important;color:oklch(var(--attention-color) / var(--tw-text-opacity))!important}.\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.\!text-black\/50{color:#00000080!important}.\!text-black\/60{color:#0009!important}.\!text-caution{--tw-text-opacity: 1 !important;color:oklch(var(--caution-color) / var(--tw-text-opacity))!important}.\!text-foreground{color:oklch(var(--foreground-color))!important}.\!text-inherit{color:inherit!important}.\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}.\!text-light{color:oklch(var(--dark-foreground-color))!important}.\!text-negative{--tw-text-opacity: 1 !important;color:oklch(var(--negative-color) / var(--tw-text-opacity))!important}.\!text-positive{--tw-text-opacity: 1 !important;color:oklch(var(--positive-color) / var(--tw-text-opacity))!important}.\!text-quiet{color:oklch(var(--foreground-quiet-color))!important}.\!text-quieter{color:oklch(var(--foreground-quieter-color))!important}.\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.\!text-transparent{color:transparent!important}.\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\!text-white\/50{color:#ffffff80!important}.text-\[\#16a34a\]{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-\[\#22c55e\]{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-\[\#3b82f6\]{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-\[\#eab308\]{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.text-\[var\(--mode-color\)\]{color:var(--mode-color)}.text-attention{--tw-text-opacity: 1;color:oklch(var(--attention-color) / var(--tw-text-opacity))}.text-attention\/70{color:oklch(var(--attention-color) / .7)}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black\/50{color:#00000080}.text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}.text-dark{color:oklch(var(--light-foreground-color))}.text-foreground{color:oklch(var(--foreground-color))}.text-inherit{color:inherit}.text-inverse{color:oklch(var(--foreground-inverse-color))}.text-light{color:oklch(var(--dark-foreground-color))}.text-max{--tw-text-opacity: 1;color:oklch(var(--max-color) / var(--tw-text-opacity))}.text-negative{--tw-text-opacity: 1;color:oklch(var(--negative-color) / var(--tw-text-opacity))}.text-positive{--tw-text-opacity: 1;color:oklch(var(--positive-color) / var(--tw-text-opacity))}.text-quiet{color:oklch(var(--foreground-quiet-color))}.text-quieter{color:oklch(var(--foreground-quieter-color))}.text-quietest{color:oklch(var(--foreground-quietest-color))}.text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white\/70{color:#ffffffb3}.text-white\/90{color:#ffffffe6}.underline{text-decoration-line:underline}.\!line-through{text-decoration-line:line-through!important}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.decoration-subtle{text-decoration-color:oklch(var(--foreground-subtle-color))}.decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}.decoration-super\/50{text-decoration-color:oklch(var(--super-color) / .5)}.decoration-transparent{text-decoration-color:transparent}.decoration-white\/50{text-decoration-color:#ffffff80}.decoration-dotted{text-decoration-style:dotted}.decoration-1{text-decoration-thickness:1px}.underline-offset-1{text-underline-offset:1px}.underline-offset-2{text-underline-offset:2px}.underline-offset-\[5px\]{text-underline-offset:5px}.\!placeholder-quietest::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\!placeholder-quietest::placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder-quieter::-moz-placeholder{color:oklch(var(--foreground-quieter-color))}.placeholder-quieter::placeholder{color:oklch(var(--foreground-quieter-color))}.caret-super{caret-color:oklch(var(--super-color) / 1)}.\!opacity-0{opacity:0!important}.\!opacity-100{opacity:1!important}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-15{opacity:.15}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-5{opacity:.05}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.opacity-\[0\.04\]{opacity:.04}.opacity-\[0\.075\]{opacity:.075}.opacity-\[0\.18\]{opacity:.18}.opacity-\[10\%\]{opacity:10%}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-difference{mix-blend-mode:difference}.\!shadow-none{--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.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)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px 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_-30px_30px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 -30px 30px oklch(var(--background-base-color));--tw-shadow-colored: 0 -30px 30px 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_16px_8px_oklch\(var\(--background-base-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--background-base-color)/.6);--tw-shadow-colored: 0 0 16px 8px 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_12px_16px_0_rgba\(0\,0\,0\,0\.10\)\]{--tw-shadow: 0 12px 16px 0 rgba(0,0,0,.1);--tw-shadow-colored: 0 12px 16px 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-\[0_1px_2px_0_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow: 0 1px 2px 0 rgba(0,0,0,.03);--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-\[0_1px_3px_0\]{--tw-shadow: 0 1px 3px 0;--tw-shadow-colored: 0 1px 3px 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-\[0_1px_4px_0_rgba\(0\,0\,0\,0\.05\)\,0_0_0_1px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 1px 4px 0 rgba(0,0,0,.05),0 0 0 1px rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 4px 0 var(--tw-shadow-color), 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-\[0_1px_6px_rgba\(0\,0\,0\,0\.25\)\]{--tw-shadow: 0 1px 6px rgba(0,0,0,.25);--tw-shadow-colored: 0 1px 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)}.shadow-\[0_1px_6px_rgba\(0\,0\,0\,0\.35\)\,0_0_0_1px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 1px 6px rgba(0,0,0,.35),0 0 0 1px rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 6px var(--tw-shadow-color), 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-\[0_1px_8px_2px_oklch\(var\(--foreground-color\)\/0\.1\)\,0_36px_16px_36px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 1px 8px 2px oklch(var(--foreground-color)/.1),0 36px 16px 36px oklch(var(--background-base-color));--tw-shadow-colored: 0 1px 8px 2px var(--tw-shadow-color), 0 36px 16px 36px 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_36px_16px_36px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 36px 16px 36px oklch(var(--background-base-color));--tw-shadow-colored: 0 36px 16px 36px 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-\[0px_1px_4px_0px_rgba\(0\,0\,0\,0\.24\)\]{--tw-shadow: 0px 1px 4px 0px rgba(0,0,0,.24);--tw-shadow-colored: 0px 1px 4px 0px 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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-inset-xs{--tw-shadow: inset 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 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-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-overlay{--tw-shadow: 0 0 0 1px var(--shadow-overlay-border, rgba(0, 0, 0, .05)), 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 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-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-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.shadow-black\/5{--tw-shadow-color: rgb(0 0 0 / .05);--tw-shadow: var(--tw-shadow-colored)}.shadow-super{--tw-shadow-color: oklch(var(--super-color) / 1);--tw-shadow: var(--tw-shadow-colored)}.shadow-super\/10{--tw-shadow-color: oklch(var(--super-color) / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-super\/30{--tw-shadow-color: oklch(var(--super-color) / .3);--tw-shadow: var(--tw-shadow-colored)}.\!outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-super{outline-color:oklch(var(--super-color) / 1)}.outline-transparent{outline-color:transparent}.\!ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.\!ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.ring{--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(3px + 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-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-\[1\.5px\]{--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(1.5px + 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-inverse{--tw-ring-color: oklch(var(--foreground-inverse-color)) !important}.\!ring-super{--tw-ring-opacity: 1 !important;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity)) !important}.\!ring-transparent{--tw-ring-color: transparent !important}.ring-\[oklch\(var\(--pale-blue-200\)\)\]{--tw-ring-color: oklch(var(--pale-blue-200))}.ring-black\/10{--tw-ring-color: rgb(0 0 0 / .1)}.ring-inverse{--tw-ring-color: oklch(var(--foreground-inverse-color))}.ring-max{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--max-color) / var(--tw-ring-opacity))}.ring-raised{--tw-ring-color: oklch(var(--background-raised-color))}.ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}.ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}.ring-subtlest{--tw-ring-color: oklch(var(--foreground-subtlest-color))}.ring-super{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.ring-super\/50{--tw-ring-color: oklch(var(--super-color) / .5)}.ring-super\/60{--tw-ring-color: oklch(var(--super-color) / .6)}.ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}.ring-transparent{--tw-ring-color: transparent}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-black{--tw-ring-offset-color: #000}.ring-offset-inverse{--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.blur{--tw-blur: blur(8px);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)}.blur-\[0\.5px\]{--tw-blur: blur(.5px);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)}.blur-\[20px\]{--tw-blur: blur(20px);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)}.blur-\[30px\]{--tw-blur: blur(30px);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)}.blur-\[50px\]{--tw-blur: blur(50px);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)}.blur-lg{--tw-blur: blur(16px);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)}.blur-md{--tw-blur: blur(12px);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)}.blur-sm{--tw-blur: blur(4px);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)}.blur-xl{--tw-blur: blur(24px);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)}.brightness-110{--tw-brightness: brightness(1.1);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)}.brightness-\[0\.8\]{--tw-brightness: brightness(.8);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)}.contrast-75{--tw-contrast: contrast(.75);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)}.drop-shadow-\[0_0_1px_rgba\(96\,88\,77\,0\.5\)\]{--tw-drop-shadow: drop-shadow(0 0 1px rgba(96,88,77,.5));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)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));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)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));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)}.\!grayscale-0{--tw-grayscale: grayscale(0) !important;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)!important}.grayscale{--tw-grayscale: grayscale(100%);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)}.invert{--tw-invert: invert(100%);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)}.saturate-0{--tw-saturate: saturate(0);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)}.saturate-150{--tw-saturate: saturate(1.5);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)}.saturate-200{--tw-saturate: saturate(2);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-\[0\.5px\]{--tw-backdrop-blur: blur(.5px);-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-\[1px\]{--tw-backdrop-blur: blur(1px);-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-\[25px\]{--tw-backdrop-blur: blur(25px);-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-lg{--tw-backdrop-blur: blur(16px);-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-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)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-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-saturate-200{--tw-backdrop-saturate: saturate(2);-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,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[border-color\,border-radius\,box-shadow\]{transition-property:border-color,border-radius,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[padding\,opacity\]{transition-property:padding,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[text-decoration-color\]{transition-property:text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[transform\,width\,opacity\]{transition-property:transform,width,opacity;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-none{transition-property:none}.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}.\!delay-0{transition-delay:0s!important}.\!delay-200{transition-delay:.2s!important}.delay-0{transition-delay:0s}.delay-100{transition-delay:.1s}.delay-1000{transition-delay:1s}.delay-150{transition-delay:.15s}.delay-200{transition-delay:.2s}.delay-500{transition-delay:.5s}.\!duration-0{transition-duration:0s!important}.\!duration-100{transition-duration:.1s!important}.\!duration-150{transition-duration:.15s!important}.duration-0{transition-duration:0s}.duration-100{transition-duration:.1s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.duration-75{transition-duration:75ms}.duration-normal{transition-duration:.15s}.duration-quick{transition-duration:75ms}.\!ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)!important}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-inExpo{transition-timing-function:cubic-bezier(.7,0,.84,0)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-outExpo{transition-timing-function:cubic-bezier(.16,1,.3,1)}.will-change-auto{will-change:auto}.will-change-transform{will-change:transform}.font-feature-tab-nums{font-feature-settings:"tnum"}.italic{font-variation-settings:"ital" 120}.mask-fade-r-12{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 3px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 3px),transparent 100%)}.mask-fade-r-6{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 1.5px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 1.5px),transparent 100%)}.mask-fade-l-12{-webkit-mask-image:linear-gradient(90deg,transparent 0,black 3px,black 100%);mask-image:linear-gradient(90deg,transparent 0,black 3px,black 100%)}.mask-fade-b-4{-webkit-mask-image:linear-gradient(180deg,black 0,black calc(100% - 1px),transparent 100%);mask-image:linear-gradient(180deg,black 0,black calc(100% - 1px),transparent 100%)}.mask-fade-t-6{-webkit-mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black 100%);mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black 100%)}.mask-fade-h-12{-webkit-mask-image:linear-gradient(90deg,transparent 0,black 3px,black calc(100% - 3px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,black 3px,black calc(100% - 3px),transparent 100%)}.mask-fade-v-6{-webkit-mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black calc(100% - 1.5px),transparent 100%);mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black calc(100% - 1.5px),transparent 100%)}.text-box-trim-both{text-box-trim:trim-both}@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}.animate-out{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}.fade-in{--tw-enter-opacity: 0}.fade-in-25{--tw-enter-opacity: .25}.fade-in-50{--tw-enter-opacity: .5}.fade-out{--tw-exit-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-\[0\.97\]{--tw-enter-scale: .97}.zoom-in-\[0\.98\]{--tw-enter-scale: .98}.zoom-out{--tw-exit-scale: 0}.zoom-out-\[0\.97\]{--tw-exit-scale: .97}.zoom-out-\[0\.98\]{--tw-exit-scale: .98}.slide-in-from-bottom{--tw-enter-translate-y: 100%}.slide-in-from-right{--tw-enter-translate-x: 100%}.slide-out-to-bottom{--tw-exit-translate-y: 100%}.slide-out-to-right{--tw-exit-translate-x: 100%}.\!duration-0{animation-duration:0s!important}.\!duration-100{animation-duration:.1s!important}.\!duration-150{animation-duration:.15s!important}.duration-0{animation-duration:0s}.duration-100{animation-duration:.1s}.duration-1000{animation-duration:1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.duration-75{animation-duration:75ms}.duration-normal{animation-duration:.15s}.duration-quick{animation-duration:75ms}.\!delay-0{animation-delay:0s!important}.\!delay-200{animation-delay:.2s!important}.delay-0{animation-delay:0s}.delay-100{animation-delay:.1s}.delay-1000{animation-delay:1s}.delay-150{animation-delay:.15s}.delay-200{animation-delay:.2s}.delay-500{animation-delay:.5s}.\!ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)!important}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-inExpo{animation-timing-function:cubic-bezier(.7,0,.84,0)}.ease-linear{animation-timing-function:linear}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.ease-outExpo{animation-timing-function:cubic-bezier(.16,1,.3,1)}.running{animation-play-state:running}.paused{animation-play-state:paused}.fill-mode-both{animation-fill-mode:both}.repeat-1{animation-iteration-count:1}.\@container{container-type:inline-size}.\@container\/banner{container-type:inline-size;container-name:banner}.\@container\/header{container-type:inline-size;container-name:header}.\@container\/main{container-type:inline-size;container-name:main}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-track-transparent{--scrollbar-track: transparent !important}:root{--font-thin: 100;--font-extralight: 200;--font-light: 300;--font-normal: 400;--font-semimedium: 475;--font-medium: 500;--font-semibold: 600;--font-bold: 700;--font-extrabold: 800;--font-black: 900;--font-thin-inverse: 75;--font-extralight-inverse: 175;--font-light-inverse: 275;--font-normal-inverse: 375;--font-semimedium-inverse: 450;--font-medium-inverse: 475;--font-semibold-inverse: 575;--font-bold-inverse: 675;--font-extrabold-inverse: 775;--font-black-inverse: 875}.font-thin{font-weight:var(--font-thin)}.font-extralight{font-weight:var(--font-extralight)}.font-light{font-weight:var(--font-light)}.\!font-normal{font-weight:var(--font-normal)!important}.font-normal{font-weight:var(--font-normal)}.font-semimedium{font-weight:var(--font-semimedium)}.\!font-medium{font-weight:var(--font-medium)!important}.font-medium{font-weight:var(--font-medium)}.font-semibold{font-weight:var(--font-semibold)}.font-bold{font-weight:var(--font-bold)}.font-extrabold{font-weight:var(--font-extrabold)}:is(.\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(.text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}[data-color-scheme=dark]{--font-thin: 75;--font-extralight: 175;--font-light: 275;--font-normal: 375;--font-semimedium: 450;--font-medium: 475;--font-semibold: 575;--font-bold: 675;--font-extrabold: 775;--font-black: 875;--font-thin-inverse: 100;--font-extralight-inverse: 200;--font-light-inverse: 300;--font-normal-inverse: 400;--font-semimedium-inverse: 475;--font-medium-inverse: 500;--font-semibold-inverse: 600;--font-bold-inverse: 700;--font-extrabold-inverse: 800;--font-black-inverse: 900}[data-color-scheme=dark] .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *,.reset,.reset *)){font-weight:inherit}[data-color-scheme=dark] .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit}[data-color-scheme=dark] .prose :where(blockquote p):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit}.\!\[--dog-bg-highlight\:currentColor\]{--dog-bg-highlight: currentColor !important}.\!\[--dot-bg\:\#1e293b\]{--dot-bg: #1e293b !important}.\!\[--dot-bg\:\#e10600\]{--dot-bg: #e10600 !important}.\!\[--dot-bg\:var\(--header-bg\,\#051224\)\]{--dot-bg: var(--header-bg,#051224) !important}.\!\[--dot-bg\:var\(--header-bg\,\#84754E\)\]{--dot-bg: var(--header-bg,#84754E) !important}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[-webkit-user-drag\:none\]{-webkit-user-drag:none}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.\[clip-path\:inset\(1px_1px_0px_1px\)\]{clip-path:inset(1px 1px 0px 1px)}.\[color-scheme\:none\]{color-scheme:none}.\[container-name\:tabbar\]{container-name:tabbar}.\[container-type\:inline-size\]{container-type:inline-size}.\[counter-increment\:list\]{counter-increment:list}.\[counter-reset\:list\]{counter-reset:list}.\[grid-area\:1\/-1\]{grid-area:1/-1}.\[grid-area\:actions\]{grid-area:actions}.\[grid-area\:email\]{grid-area:email}.\[grid-area\:role\]{grid-area:role}.\[grid-area\:scim\]{grid-area:scim}.\[grid-area\:status\]{grid-area:status}.\[grid-area\:tier\]{grid-area:tier}.\[grid-template-columns\:2fr_1fr_1fr\]{grid-template-columns:2fr 1fr 1fr}.\[margin-left\:max\(0px\,calc\(\(100\%-var\(--thread-content-width\)\)\/2-var\(--left-width\)-var\(--gap\)-var\(--scrollbar-gutter-offset\)\/2\)\)\]{margin-left:max(0px,calc((100% - var(--thread-content-width)) / 2 - var(--left-width) - var(--gap) - var(--scrollbar-gutter-offset) / 2))}.\[mask-image\:linear-gradient\(90deg\,black_0\,black_calc\(100\%-60px\)\,transparent_calc\(100\%-20px\)\,transparent_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%)}.\[mask-image\:linear-gradient\(90deg\,transparent_0\,transparent_20px\,black_60px\,black_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black 100%);mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black 100%)}.\[mask-image\:linear-gradient\(90deg\,transparent_0\,transparent_20px\,black_60px\,black_calc\(100\%-60px\)\,transparent_calc\(100\%-20px\)\,transparent_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%)}.\[mask-image\:linear-gradient\(to_bottom\,\#000_0\%\,transparent_160px\)\]{-webkit-mask-image:linear-gradient(to bottom,#000 0%,transparent 160px);mask-image:linear-gradient(to bottom,#000 0%,transparent 160px)}.\[mix-blend-mode\:overlay\]{mix-blend-mode:overlay}.\[overflow-clip-margin\:unset\]{overflow-clip-margin:unset}.\[overflow-wrap\:break-word\]{overflow-wrap:break-word}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[scrollbar-width\:thin\]{scrollbar-width:thin}.\[stroke-width\:1\.5\]{stroke-width:1.5}.\[word-break\:break-word\]{word-break:break-word}.\[word-spacing\:4px\]{word-spacing:4px}html{min-height:100%;font-size:16px;overflow-y:auto;scrollbar-width:15px;font-weight:400;letter-spacing:.005em}[data-color-scheme=dark]{color-scheme:dark;font-weight:375;letter-spacing:.01em}body{margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-synthesis:none}.interactable{cursor:pointer}.interactable:focus{outline:2px solid transparent;outline-offset:2px}.interactable: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);--tw-ring-color: oklch(var(--super-color) / .8);--tw-ring-offset-width: 2px;--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.interactable-alt{cursor:pointer;position:relative}.interactable-alt:before{pointer-events:none;position:absolute;inset:.5rem;border-radius:inherit;--tw-content: "";content:var(--tw-content)}.interactable-alt:focus{outline:2px solid transparent;outline-offset:2px}.interactable-alt: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(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);--tw-ring-color: transparent;--tw-ring-offset-color: transparent}.interactable-alt:focus-visible:before{--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);--tw-ring-color: oklch(var(--super-color) / .8);--tw-ring-offset-width: 2px;content:var(--tw-content);--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}code,.ace_placeholder.ace_comment{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace}:is(code,.font-mono),:is(.ace_placeholder.ace_comment,.font-mono){font-synthesis:none}.katex{-webkit-font-smoothing:auto;max-width:100%;overflow:auto hidden;-ms-overflow-style:none;scrollbar-width:none}.katex::-webkit-scrollbar{display:none}[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}.codeWrapper code>span{-webkit-user-select:auto!important;-moz-user-select:auto!important;user-select:auto!important}.codeWrapper code{width:100%}.codeWrapper code span{font-style:normal!important}.codeWrapper code span{padding:0!important}.hideScroll{-ms-overflow-style:none;scrollbar-width:none}.hideScroll::-webkit-scrollbar{display:none}.scrollbar-subtle{--scrollbar-thumb: oklch(var(--foreground-color) / .15)}.scrollbar-subtle{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-subtle::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-subtle::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-subtle::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-subtle::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-subtle::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-subtle::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-subtle::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-subtle::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-subtle::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-subtle::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-subtle{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-subtle::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-subtle{--scrollbar-track: transparent}.tabler-icon{stroke-width:1.75}.citation-nbsp:before{content:" "}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}}html[data-color-scheme=dark] .dark\:prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.\*\:size-full>*{width:100%;height:100%}.\*\:w-20>*{width:5rem}.\*\:w-full>*{width:100%}.marker\:text-quiet *::marker{color:oklch(var(--foreground-quiet-color))}.marker\:text-quiet::marker{color:oklch(var(--foreground-quiet-color))}.selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/30 *::-moz-selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/30 *::selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/50 *::-moz-selection{background-color:oklch(var(--super-color) / .5)}.selection\:bg-super\/50 *::selection{background-color:oklch(var(--super-color) / .5)}.selection\:text-foreground *::-moz-selection{color:oklch(var(--foreground-color))}.selection\:text-foreground *::selection{color:oklch(var(--foreground-color))}.selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/30::-moz-selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/30::selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/50::-moz-selection{background-color:oklch(var(--super-color) / .5)}.selection\:bg-super\/50::selection{background-color:oklch(var(--super-color) / .5)}.selection\:text-foreground::-moz-selection{color:oklch(var(--foreground-color))}.selection\:text-foreground::selection{color:oklch(var(--foreground-color))}.selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.placeholder\:select-none::-moz-placeholder{-moz-user-select:none;-webkit-user-select:none;user-select:none}.placeholder\:select-none::placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none}.placeholder\:text-\[2\.4rem\]::-moz-placeholder{font-size:2.4rem}.placeholder\:text-\[2\.4rem\]::placeholder{font-size:2.4rem}.placeholder\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.placeholder\:text-base::placeholder{font-size:1rem;line-height:1.5rem}.placeholder\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-xs::placeholder{font-size:.75rem;line-height:1rem}.placeholder\:\!text-quietest::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder\:\!text-quietest::placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder\:text-quiet::-moz-placeholder{color:oklch(var(--foreground-quiet-color))}.placeholder\:text-quiet::placeholder{color:oklch(var(--foreground-quiet-color))}.placeholder\:text-quieter::-moz-placeholder{color:oklch(var(--foreground-quieter-color))}.placeholder\:text-quieter::placeholder{color:oklch(var(--foreground-quieter-color))}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:inset-0:before{content:var(--tw-content);inset:0}.before\:inset-x-\[-10px\]:before{content:var(--tw-content);left:-10px;right:-10px}.before\:inset-y-0:before{content:var(--tw-content);top:0;bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:left-1\/2:before{content:var(--tw-content);left:50%}.before\:left-\[50\%\]:before{content:var(--tw-content);left:50%}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-1\/2:before{content:var(--tw-content);top:50%}.before\:top-\[50\%\]:before{content:var(--tw-content);top:50%}.before\:top-\[6px\]:before{content:var(--tw-content);top:6px}.before\:size-1:before{content:var(--tw-content);width:.25rem;height:.25rem}.before\:size-1\.5:before{content:var(--tw-content);width:.375rem;height:.375rem}.before\:size-full:before{content:var(--tw-content);width:100%;height:100%}.before\:h-\[100\%\]:before{content:var(--tw-content);height:100%}.before\:min-h-\[10px\]:before{content:var(--tw-content);min-height:10px}.before\:w-\[100\%\]:before{content:var(--tw-content);width:100%}.before\:min-w-\[10px\]:before{content:var(--tw-content);min-width:10px}.before\:-translate-x-1\/2:before{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))}.before\:-translate-y-1\/2:before{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))}.before\:translate-x-\[-50\%\]:before{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))}.before\:translate-y-\[-50\%\]:before{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))}.before\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\:rounded-md:before{content:var(--tw-content);border-radius:.375rem}.before\:border:before{content:var(--tw-content);border-width:1px}.before\:border-r:before{content:var(--tw-content);border-right-width:1px}.before\:border-dashed:before{content:var(--tw-content);border-style:dashed}.before\:border-\[rgba\(0\,0\,0\,0\.1\)\]:before{content:var(--tw-content);border-color:#0000001a}.before\:border-subtlest:before{content:var(--tw-content);border-color:oklch(var(--foreground-subtlest-color))}.before\:bg-\[\#105C67\]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(16 92 103 / var(--tw-bg-opacity))}.before\:bg-base:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}.before\:opacity-0:before{content:var(--tw-content);opacity:0}.before\:opacity-20:before{content:var(--tw-content);opacity:.2}.before\:ring-4:before{content:var(--tw-content);--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(4px + 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)}.before\:ring-\[1\.5px\]:before{content:var(--tw-content);--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(1.5px + 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)}.before\:ring-super\/10:before{content:var(--tw-content);--tw-ring-color: oklch(var(--super-color) / .1)}.before\:ring-super\/50:before{content:var(--tw-content);--tw-ring-color: oklch(var(--super-color) / .5)}.before\:transition-opacity:before{content:var(--tw-content);transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.before\:duration-150:before{content:var(--tw-content);transition-duration:.15s}.before\:content-\[\'\'\]:before{--tw-content: "";content:var(--tw-content)}.before\:duration-150:before{content:var(--tw-content);animation-duration:.15s}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-0:after{content:var(--tw-content);inset:0}.after\:inset-\[-1px\]:after{content:var(--tw-content);inset:-1px}.after\:left-two:after{content:var(--tw-content);left:2px}.after\:top-\[24px\]:after{content:var(--tw-content);top:24px}.after\:z-\[1\]:after{content:var(--tw-content);z-index:1}.after\:clear-both:after{content:var(--tw-content);clear:both}.after\:block:after{content:var(--tw-content);display:block}.after\:h-full:after{content:var(--tw-content);height:100%}.after\:w-two:after{content:var(--tw-content);width:2px}.after\:-translate-y-half:after{content:var(--tw-content);--tw-translate-y: -.5px;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))}.after\:rounded:after{content:var(--tw-content);border-radius:.25rem}.after\:rounded-inherit:after{content:var(--tw-content);border-radius:inherit}.after\:rounded-lg:after{content:var(--tw-content);border-radius:.5rem}.after\:rounded-md:after{content:var(--tw-content);border-radius:.375rem}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-\[rgba\(0\,0\,0\,0\.08\)\]:after{content:var(--tw-content);border-color:#00000014}.after\:border-black\/10:after{content:var(--tw-content);border-color:#0000001a}.after\:border-black\/5:after{content:var(--tw-content);border-color:#0000000d}.after\:border-foreground:after{content:var(--tw-content);border-color:oklch(var(--foreground-color))}.after\:border-super\/30:after{content:var(--tw-content);border-color:oklch(var(--super-color) / .3)}.after\:bg-super:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.after\:opacity-50:after{content:var(--tw-content);opacity:.5}.after\:shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;--tw-shadow-colored: inset 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)}.after\:ring-1:after{content:var(--tw-content);--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)}.after\:ring-inset:after{content:var(--tw-content);--tw-ring-inset: inset}.after\:ring-subtler:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtler-color))}.after\:ring-subtlest:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtlest-color))}.after\:ring-opacity-50:after{content:var(--tw-content);--tw-ring-opacity: .5}.after\:content-\[\"\"\]:after{--tw-content: "";content:var(--tw-content)}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.after\:\[content\:counters\(list\,\"\.\"\)\]:after{content:counters(list,".")}.first\:-mt-sm:first-child{margin-top:calc(var(--size-sm) * -1)}.first\:ml-0:first-child{margin-left:0}.first\:mt-0:first-child{margin-top:0}.first\:mt-1:first-child{margin-top:.25rem}.first\:mt-xs:first-child{margin-top:var(--size-xs)}.first\:hidden:first-child{display:none}.first\:border-y:first-child{border-top-width:1px;border-bottom-width:1px}.first\:border-b-0:first-child{border-bottom-width:0px}.first\:border-solid:first-child{border-style:solid}.first\:pl-0:first-child{padding-left:0}.first\:pl-md:first-child{padding-left:var(--size-md)}.first\:pt-0:first-child{padding-top:0}.first\:pt-md:first-child{padding-top:var(--size-md)}.last\:-mr-two:last-child{margin-right:-2px}.last\:mb-0:last-child{margin-bottom:0}.last\:mr-0:last-child{margin-right:0}.last\:hidden:last-child{display:none}.last\:border-0:last-child{border-width:0px}.last\:border-b:last-child{border-bottom-width:1px}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:border-r-0:last-child{border-right-width:0px}.last\:border-none:last-child{border-style:none}.last\:border-b-subtlest:last-child{border-bottom-color:oklch(var(--foreground-subtlest-color))}.last\:px-sm:last-child{padding-left:var(--size-sm);padding-right:var(--size-sm)}.last\:pb-0:last-child{padding-bottom:0}.last\:pr-0:last-child{padding-right:0}.last\:pr-md:last-child{padding-right:var(--size-md)}.last\:pr-xs:last-child{padding-right:var(--size-xs)}.last\:before\:hidden:last-child:before{content:var(--tw-content);display:none}.last\:after\:\[background\:linear-gradient\(0deg\,rgba\(31\,184\,205\,0\)_0\%\,\#105C67_100\%\)\]:last-child:after{content:var(--tw-content);background:linear-gradient(0deg,#1fb8cd00,#105c67)}.odd\:bg-subtler:nth-child(odd){background-color:oklch(var(--background-subtler-color))}.even\:bg-subtlest:nth-child(2n){background-color:oklch(var(--background-subtlest-color))}.empty\:hidden:empty{display:none}.empty\:bg-subtler:empty{background-color:oklch(var(--background-subtler-color))}.focus-within\:pointer-events-auto:focus-within{pointer-events:auto}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:\!border-subtler:focus-within{border-color:oklch(var(--foreground-subtler-color))!important}.focus-within\:\!border-super:focus-within{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.focus-within\:border-subtler:focus-within{border-color:oklch(var(--foreground-subtler-color))}.focus-within\:border-super:focus-within{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.focus-within\:opacity-100:focus-within{opacity:1}.focus-within\:\!ring-transparent:focus-within{--tw-ring-color: transparent !important}.group\/column:first-child .group-first\/column\:hidden,.group:first-child .group-first\:hidden{display:none}.group:first-child .group-first\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.group\/singleTeamGroup:first-child .group-first\/singleTeamGroup\:pt-0{padding-top:0}.group\/goal:first-child .group-first\/goal\:opacity-0{opacity:0}.group:last-child .group-last\:-mb-sm{margin-bottom:calc(var(--size-sm) * -1)}.group\/cell:last-child .group-last\/cell\:hidden{display:none}.group\/column:last-child .group-last\/column\:hidden{display:none}.group\/li:last-child .group-last\/li\:hidden{display:none}.group:last-child .group-last\:rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.group:last-child .group-last\:rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.group:last-child .group-last\:border-b-0{border-bottom-width:0px}.group\/goal:last-child .group-last\/goal\:pb-0{padding-bottom:0}.group:last-child .group-last\:pb-0{padding-bottom:0}.group\/goal:last-child .group-last\/goal\:opacity-0{opacity:0}.group\/singleTeamGroup:last-child .group-last\/singleTeamGroup\:last\:border-b-0:last-child{border-bottom-width:0px}.group\/table:last-child .group-last\/table\:last\:border-b-0:last-child{border-bottom-width:0px}.group\/goal:only-child .group-only\/goal\:opacity-0{opacity:0}.group:nth-child(odd) .group-odd\:border-r{border-right-width:1px}.group\/matchup:nth-child(2n) .group-even\/matchup\:bottom-1\/2{bottom:50%}.group\/matchup:nth-child(2n) .group-even\/matchup\:top-auto{top:auto}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-bl-md{border-bottom-left-radius:.375rem}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-br-md{border-bottom-right-radius:.375rem}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-tl-none{border-top-left-radius:0}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-tr-none{border-top-right-radius:0}.group\/matchup:nth-child(2n) .group-even\/matchup\:border-b-2{border-bottom-width:2px}.group\/matchup:nth-child(2n) .group-even\/matchup\:border-t-0{border-top-width:0px}.group:nth-child(2n) .group-even\:border-r-0{border-right-width:0px}.group:hover .group-hover\:pointer-events-auto{pointer-events:auto}.group:hover .group-hover\:-ml-sm{margin-left:calc(var(--size-sm) * -1)}.group:hover .group-hover\:-ml-xs{margin-left:calc(var(--size-xs) * -1)}.group:hover .group-hover\:block{display:block}.group\/step-card:hover .group-hover\/step-card\:inline-flex{display:inline-flex}.group:hover .group-hover\:shrink-0{flex-shrink:0}.group:hover .group-hover\:basis-auto{flex-basis:auto}.group\/source:hover .group-hover\/source\:translate-x-\[12px\]{--tw-translate-x: 12px;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\/source:hover .group-hover\/source\:translate-x-\[6px\]{--tw-translate-x: 6px;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\/source:hover .group-hover\/source\:translate-x-\[8px\]{--tw-translate-x: 8px;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:hover .group-hover\:-translate-y-1{--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))}.group:hover .group-hover\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;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:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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:hover .group-hover\:scale-\[1\.02\]{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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:hover .group-hover\:scale-\[unset\]{--tw-scale-x: unset;--tw-scale-y: unset;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:hover .group-hover\:scale-x-\[250\%\]{--tw-scale-x: 250%;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\/language-learning:hover .group-hover\/language-learning\:border-foreground{border-color:oklch(var(--foreground-color))}.group:hover .group-hover\:\!border-subtle{border-color:oklch(var(--foreground-subtle-color))!important}.group:hover .group-hover\:\!border-super{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.group\/tab:hover .group-hover\/tab\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.group:hover .group-hover\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.group:hover .group-hover\:\!bg-transparent{background-color:transparent!important}.group:hover .group-hover\:bg-\[var\(--dot-color\)\]{background-color:var(--dot-color)}.group:hover .group-hover\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.group:hover .group-hover\:bg-subtler{background-color:oklch(var(--background-subtler-color))}.group:hover .group-hover\:bg-super{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.group:hover .group-hover\:bg-transparent{background-color:transparent}.group:hover .group-hover\:fill-super{fill:oklch(var(--super-color) / 1)}.group:hover .group-hover\:stroke-super{stroke:oklch(var(--super-color) / 1)}.group\/link:hover .group-hover\/link\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group\/post:hover .group-hover\/post\:text-foreground{color:oklch(var(--foreground-color))}.group\/row:hover .group-hover\/row\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group\/segmented-control:hover .group-hover\/segmented-control\:text-foreground{color:oklch(var(--foreground-color))}.group\/step-card:hover .group-hover\/step-card\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group:hover .group-hover\:\!text-foreground{color:oklch(var(--foreground-color))!important}.group:hover .group-hover\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group:hover .group-hover\:text-foreground{color:oklch(var(--foreground-color))}.group:hover .group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}.group:hover .group-hover\:text-quiet{color:oklch(var(--foreground-quiet-color))}.group:hover .group-hover\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group\/link:hover .group-hover\/link\:underline,.group\/source:hover .group-hover\/source\:underline,.group:hover .group-hover\:underline{text-decoration-line:underline}.group:hover .group-hover\:decoration-\[var\(--mode-color\)\]{text-decoration-color:var(--mode-color)}.group:hover .group-hover\:decoration-transparent{text-decoration-color:transparent}.group\/button:hover .group-hover\/button\:opacity-100,.group\/card:hover .group-hover\/card\:opacity-100,.group\/header:hover .group-hover\/header\:opacity-100,.group\/image:hover .group-hover\/image\:opacity-100{opacity:1}.group\/link:hover .group-hover\/link\:opacity-75{opacity:.75}.group\/notification-list-item:hover .group-hover\/notification-list-item\:opacity-0{opacity:0}.group\/notification-list-item:hover .group-hover\/notification-list-item\:opacity-100,.group\/section:hover .group-hover\/section\:opacity-100,.group\/sidebar-menu-header:hover .group-hover\/sidebar-menu-header\:opacity-100,.group\/step-card:hover .group-hover\/step-card\:opacity-100,.group\/tab:hover .group-hover\/tab\:opacity-100{opacity:1}.group:hover .group-hover\:\!opacity-0{opacity:0!important}.group:hover .group-hover\:opacity-0{opacity:0}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-15{opacity:.15}.group:hover .group-hover\:opacity-50{opacity:.5}.group:hover .group-hover\:opacity-60{opacity:.6}.group:hover .group-hover\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-90{opacity:.9}.group:hover .group-hover\: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)}.group:hover .group-hover\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}.group:hover .group-hover\:grayscale-0{--tw-grayscale: grayscale(0);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)}.group:hover .group-hover\:delay-300{transition-delay:.3s}.group:hover .group-hover\:mask-fade-r-\[84px\,42px\]{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 84px),transparent calc(100% - 42px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 84px),transparent calc(100% - 42px),transparent 100%)}.group:hover .group-hover\:delay-300{animation-delay:.3s}:is(.group:hover .group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}.group\/segmented-control:focus-visible .group-focus-visible\/segmented-control\:border-dashed{border-style:dashed}.group:active .group-active\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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:active .group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}.group\/language-learning:active .group-active\/language-learning\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.group:active .group-active\:opacity-50{opacity:.5}.group:active .group-active\:opacity-70{opacity:.7}.group:nth-child(2n):nth-last-child(-n+3)~a .group-\[\&\:nth-child\(2n\)\:nth-last-child\(-n\+3\)\~a\]\:border-b-0{border-bottom-width:0px}.group:nth-child(3n):nth-last-child(-n+4)~a .group-\[\&\:nth-child\(3n\)\:nth-last-child\(-n\+4\)\~a\]\:border-b-0{border-bottom-width:0px}.group:nth-child(3n) .group-\[\&\:nth-child\(3n\)\]\:border-r-0{border-right-width:0px}.has-\[a\:hover\]\:bg-transparent:has(a:hover){background-color:transparent}.aria-selected\:bg-subtler[aria-selected=true]{background-color:oklch(var(--background-subtler-color))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[placement\=bottom-end\]\:origin-top-right[data-placement=bottom-end]{transform-origin:top right}.data-\[placement\=bottom-start\]\:origin-top-left[data-placement=bottom-start]{transform-origin:top left}.data-\[placement\=top-end\]\:origin-bottom-right[data-placement=top-end]{transform-origin:bottom right}.data-\[placement\=top-start\]\:origin-bottom-left[data-placement=top-start]{transform-origin:bottom left}.data-\[state\=checked\]\:translate-x-\[10px\][data-state=checked]{--tw-translate-x: 10px;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-\[14px\][data-state=checked]{--tw-translate-x: 14px;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-\[18px\][data-state=checked]{--tw-translate-x: 18px;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 fadeOut{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fadeOut[data-state=closed]{animation:fadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes scaleAndFadeOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.97)}}.data-\[state\=closed\]\:animate-scaleAndFadeOut[data-state=closed]{animation:scaleAndFadeOut .15s cubic-bezier(.7,0,.84,0) forwards}@keyframes slideDownAndFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(3px)}}.data-\[state\=closed\]\:animate-slideDownAndFadeOut[data-state=closed]{animation:slideDownAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideLeft{0%{transform:translateZ(0) translate(0)}to{transform:translateZ(0) translate(-100%)}}.data-\[state\=closed\]\:animate-slideLeft[data-state=closed]{animation:slideLeft .2s cubic-bezier(.25,.1,.25,1) forwards}@keyframes slideLeftAndFadeOut{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-3px)}}.data-\[state\=closed\]\:animate-slideLeftAndFadeOut[data-state=closed]{animation:slideLeftAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideRightAndFadeOut{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(3px)}}.data-\[state\=closed\]\:animate-slideRightAndFadeOut[data-state=closed]{animation:slideRightAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideUpAndFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-3px)}}.data-\[state\=closed\]\:animate-slideUpAndFadeOut[data-state=closed]{animation:slideUpAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.data-\[state\=delayed-open\]\:animate-slideDownAndFadeIn[data-state=delayed-open]{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideLeftAndFadeIn[data-state=delayed-open]{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideRightAndFadeIn[data-state=delayed-open]{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideUpAndFadeIn[data-state=delayed-open]{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fadeIn[data-state=open]{animation:fadeIn .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes scaleAndFadeIn{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.data-\[state\=open\]\:animate-scaleAndFadeIn[data-state=open]{animation:scaleAndFadeIn .15s cubic-bezier(.16,1,.3,1)}@keyframes slideDownAndFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.data-\[state\=open\]\:animate-slideDownAndFadeIn[data-state=open]{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideLeftAndFadeIn{0%{opacity:0;transform:translate(3px)}to{opacity:1;transform:translate(0)}}.data-\[state\=open\]\:animate-slideLeftAndFadeIn[data-state=open]{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideRight{0%{transform:translateZ(0) translate(-100%)}to{transform:translateZ(0) translate(0)}}.data-\[state\=open\]\:animate-slideRight[data-state=open]{animation:slideRight .2s cubic-bezier(.25,.1,.25,1) forwards}@keyframes slideRightAndFadeIn{0%{opacity:0;transform:translate(-3px)}to{opacity:1;transform:translate(0)}}.data-\[state\=open\]\:animate-slideRightAndFadeIn[data-state=open]{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideUpAndFadeIn{0%{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}.data-\[state\=open\]\:animate-slideUpAndFadeIn[data-state=open]{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=closed\]\:border-subtler[data-state=closed]{border-color:oklch(var(--foreground-subtler-color))}.data-\[state\=open\]\:border-subtle[data-state=open]{border-color:oklch(var(--foreground-subtle-color))}.data-\[state\=open\]\:border-super[data-state=open]{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.data-\[focused\=self\]\:bg-subtler[data-focused=self],.data-\[highlighted\]\:bg-subtler[data-highlighted]{background-color:oklch(var(--background-subtler-color))}.data-\[state\=open\]\:bg-subtle[data-state=open]{background-color:oklch(var(--background-subtle-color))}.data-\[state\=open\]\:bg-subtler[data-state=open]{background-color:oklch(var(--background-subtler-color))}.data-\[state\=on\]\:text-foreground[data-state=on],.data-\[state\=open\]\:text-foreground[data-state=open]{color:oklch(var(--foreground-color))}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=inactive\]\:opacity-80[data-state=inactive],.data-\[state\=open\]\:opacity-80[data-state=open]{opacity:.8}.data-\[state\=visible\]\:opacity-100[data-state=visible]{opacity:1}.group\/tooltip-content[data-side=bottom] .group-data-\[side\=\"bottom\"\]\/tooltip-content\:top-0{top:0}.group\/tooltip-content[data-side=top] .group-data-\[side\=\"top\"\]\/tooltip-content\:bottom-0{bottom:0}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}.group[data-focused=other] .group-data-\[focused\=other\]\:opacity-0{opacity:0}.group[data-focused=self] .group-data-\[focused\=self\]\:opacity-100{opacity:1}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:border-l-2:first-child{border-left-width:2px}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:border-l-super:first-child{--tw-border-opacity: 1;border-left-color:oklch(var(--super-color) / var(--tw-border-opacity))}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:pl-xs:first-child{padding-left:var(--size-xs)}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:last\:border-r-2:last-child{border-right-width:2px}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:last\:pr-xs:last-child{padding-right:var(--size-xs)}[data-erp=tab] .erp-tab\:top-headerHeight{top:var(--header-height)}[data-erp=tab] .erp-tab\:gap-0{gap:0px}[data-erp=tab] .erp-tab\:rounded-none{border-radius:0}[data-erp=tab] .erp-tab\:p-0{padding:0}[data-erp=sidecar] .erp-sidecar\:fixed{position:fixed}[data-erp=sidecar] .erp-sidecar\:top-\[114px\]{top:114px}[data-erp=sidecar] .erp-sidecar\:h-fit{height:-moz-fit-content;height:fit-content}[data-erp=sidecar] .erp-sidecar\:min-h-\[var\(--sidecar-content-height\)\]{min-height:var(--sidecar-content-height)}[data-erp=sidecar] .erp-sidecar\:w-full{width:100%}[data-erp=sidecar] .erp-sidecar\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}[data-erp=sidecar] .erp-sidecar\:pb-0{padding-bottom:0}[data-erp=sidecar] .erp-sidecar\:pt-0{padding-top:0}[data-erp=mobile-sidecar] .erp-mobile-sidecar\:min-h-\[var\(--mobile-sidecar-content-height\)\]{min-height:var(--mobile-sidecar-content-height)}[data-erp=mobile-sidecar] .erp-mobile-sidecar\:pt-0{padding-top:0}@media (pointer: coarse){.pointer-coarse\:opacity-100{opacity:1}}.prose-p\:my-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-p\:mb-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:.5rem}.prose-p\:pt-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:0}.prose-strong\:font-medium :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500;font-weight:var(--font-medium)}@container (min-width: 20rem){.\@xs\:ml-7{margin-left:1.75rem}.\@xs\:size-4{width:1rem;height:1rem}.\@xs\:w-20{width:5rem}.\@xs\:flex-row{flex-direction:row}.\@xs\:gap-3{gap:.75rem}.\@xs\:gap-sm{gap:var(--size-sm)}.\@xs\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.\@xs\:pb-md{padding-bottom:var(--size-md)}.\@xs\:pt-3{padding-top:.75rem}.\@xs\:text-sm{font-size:.875rem;line-height:1.25rem}}@container (min-width: 24rem){.\@sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container banner (min-width: 28rem){.\@md\/banner\:ml-auto{margin-left:auto}.\@md\/banner\:mr-sm{margin-right:var(--size-sm)}.\@md\/banner\:w-auto{width:auto}.\@md\/banner\:flex-\[1_1_60\%\]{flex:1 1 60%}.\@md\/banner\:flex-row{flex-direction:row}.\@md\/banner\:flex-row-reverse{flex-direction:row-reverse}.\@md\/banner\:flex-wrap{flex-wrap:wrap}.\@md\/banner\:items-center{align-items:center}.\@md\/banner\:justify-end{justify-content:flex-end}.\@md\/banner\:gap-md{gap:var(--size-md)}.\@md\/banner\:gap-sm{gap:var(--size-sm)}.\@md\/banner\:py-3{padding-top:.75rem;padding-bottom:.75rem}}@container (min-width: 28rem){.\@md\:w-\[570px\]{width:570px}}@container (min-width: 32rem){.\@lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width: 36px){.\@\[36px\]\:block{display:block}}@container (min-width: 42rem){.\@2xl\:flex-\[2\]{flex:2}.\@2xl\:flex-\[3\]{flex:3}.\@2xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\@2xl\:flex-row{flex-direction:row}.\@2xl\:gap-sm{gap:var(--size-sm)}}@container (min-width: 28rem){@container (min-width: 1458px){.\@md\:\@\[1458px\]\:w-full{width:100%}}}@container (min-width: 370px){.\@\[370px\]\:aspect-\[1\.38\]{aspect-ratio:1.38}.\@\[370px\]\:h-auto{height:auto}.\@\[370px\]\:w-\[var\(--image-width-large\)\]{width:var(--image-width-large)}}@container (min-width: 420px){.\@\[420px\]\:ml-auto{margin-left:auto}.\@\[420px\]\:block{display:block}.\@\[420px\]\:hidden{display:none}.\@\[420px\]\:h-full{height:100%}.\@\[420px\]\:w-\[128px\]{width:128px}.\@\[420px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\@\[420px\]\:flex-row{flex-direction:row}.\@\[420px\]\:items-end{align-items:flex-end}.\@\[420px\]\:gap-md{gap:var(--size-md)}}@container (min-width: 480px){.\@\[480px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container (min-width: 600px){.\@\[600px\]\:col-span-1{grid-column:span 1 / span 1}.\@\[600px\]\:h-full{height:100%}.\@\[600px\]\:grid-cols-\[17\%_46\%_1fr\]{grid-template-columns:17% 46% 1fr}}@container (min-width: 640px){.\@\[640px\]\:col-span-2{grid-column:span 2 / span 2}.\@\[640px\]\:block{display:block}.\@\[640px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width: 700px){.\@\[700px\]\:inset-y-0{top:0;bottom:0}.\@\[700px\]\:left-0{left:0}.\@\[700px\]\:right-auto{right:auto}.\@\[700px\]\:w-\[var\(--card-width\)\]{width:var(--card-width)}.\@\[700px\]\:w-full{width:100%}.\@\[700px\]\:grid-cols-\[120px_320px_1fr\]{grid-template-columns:120px 320px 1fr}.\@\[700px\]\:flex-col{flex-direction:column}.\@\[700px\]\:overflow-y-auto{overflow-y:auto}.\@\[700px\]\:overflow-x-visible{overflow-x:visible}.\@\[700px\]\:p-2\.5{padding:.625rem}}@container (min-width: 900px){.\@\[900px\]\:block{display:block}.\@\[900px\]\:hidden{display:none}.\@\[900px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container main (min-width: 1100px){.\@\[1100px\]\/main\:max-w-\[80px\]{max-width:80px}}@container main (min-width: 1200px){.\@\[1200px\]\/main\:max-w-\[160px\]{max-width:160px}}.hover\:-translate-x-1:hover{--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))}.hover\:-translate-y-1:hover{--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))}.hover\:translate-y-0:hover{--tw-translate-y: 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))}.hover\:translate-y-0\.5:hover{--tw-translate-y: .125rem;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\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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\:scale-\[1\.01\]:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;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\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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\:transform:hover{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\:cursor-pointer:hover{cursor:pointer}.hover\:rounded-lg:hover{border-radius:.5rem}.hover\:\!border-none:hover{border-style:none!important}.hover\:\!border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))!important}.hover\:\!border-subtlest:hover{border-color:oklch(var(--foreground-subtlest-color))!important}.hover\:\!border-transparent:hover{border-color:transparent!important}.hover\:border-caution\/20:hover{border-color:oklch(var(--caution-color) / .2)}.hover\:border-offset:hover{border-color:oklch(var(--offset-color))}.hover\:border-subtle:hover{border-color:oklch(var(--foreground-subtle-color))}.hover\:border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))}.hover\:border-super:hover{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.hover\:border-super\/30:hover{border-color:oklch(var(--super-color) / .3)}.hover\:border-super\/50:hover{border-color:oklch(var(--super-color) / .5)}.hover\:border-super\/75:hover{border-color:oklch(var(--super-color) / .75)}.hover\:\!bg-black\/80:hover{background-color:#000c!important}.hover\:\!bg-black\/90:hover{background-color:#000000e6!important}.hover\:\!bg-caution:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--caution-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-inverse\/5:hover{background-color:oklch(var(--background-inverse-color) / .05)!important}.hover\:\!bg-max:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-subtler:hover{background-color:oklch(var(--background-subtler-color))!important}.hover\:\!bg-super:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-super\/10:hover{background-color:oklch(var(--super-color) / .1)!important}.hover\:\!bg-transparent:hover{background-color:transparent!important}.hover\:\!bg-white\/10:hover{background-color:#ffffff1a!important}.hover\:\!bg-white\/90:hover{background-color:#ffffffe6!important}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-caution\/30:hover{background-color:oklch(var(--caution-color) / .3)}.hover\:bg-caution\/5:hover{background-color:oklch(var(--caution-color) / .05)}.hover\:bg-negative\/20:hover{background-color:oklch(var(--negative-color) / .2)}.hover\:bg-offset:hover{background-color:oklch(var(--offset-color))}.hover\:bg-positive\/20:hover{background-color:oklch(var(--positive-color) / .2)}.hover\:bg-raised:hover{background-color:oklch(var(--background-raised-color))}.hover\:bg-raisedOffset:hover{background-color:oklch(var(--raised-offset-color))}.hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}.hover\:bg-subtler:hover{background-color:oklch(var(--background-subtler-color))}.hover\:bg-subtlest:hover{background-color:oklch(var(--background-subtlest-color))}.hover\:bg-super:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.hover\:bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)}.hover\:bg-super\/90:hover{background-color:oklch(var(--super-color) / .9)}.hover\:bg-superBG:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.hover\:bg-gradient-to-b:hover{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.hover\:from-\[oklch\(var\(--hydra-450\)\)\]:hover{--tw-gradient-from: oklch(var(--hydra-450)) 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)}.hover\:to-\[oklch\(var\(--hydra-450\)\/0\.2\)\]:hover{--tw-gradient-to: oklch(var(--hydra-450)/.2) var(--tw-gradient-to-position)}.hover\:\!text-quiet:hover{color:oklch(var(--foreground-quiet-color))!important}.hover\:\!text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:\!text-white\/80:hover{color:#fffc!important}.hover\:text-caution:hover{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}.hover\:text-foreground:hover{color:oklch(var(--foreground-color))}.hover\:text-negative:hover{--tw-text-opacity: 1;color:oklch(var(--negative-color) / var(--tw-text-opacity))}.hover\:text-positive:hover{--tw-text-opacity: 1;color:oklch(var(--positive-color) / var(--tw-text-opacity))}.hover\:text-quiet:hover{color:oklch(var(--foreground-quiet-color))}.hover\:text-super:hover{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:decoration-super:hover{text-decoration-color:oklch(var(--super-color) / 1)}.hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}.hover\:decoration-transparent:hover{text-decoration-color:transparent}.hover\:underline-offset-\[7px\]:hover{text-underline-offset:7px}.hover\:\!opacity-100:hover{opacity:1!important}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-40:hover{opacity:.4}.hover\:opacity-50:hover{opacity:.5}.hover\:opacity-60:hover{opacity:.6}.hover\:opacity-70:hover{opacity:.7}.hover\:opacity-75:hover{opacity:.75}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-85:hover{opacity:.85}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow:hover{--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)}.hover\:shadow-2xl:hover{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px 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-sm:hover{--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)}.hover\:shadow-subtle:hover{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.hover\:\!outline-none:hover{outline:2px solid transparent!important;outline-offset:2px!important}.hover\:\!ring-0:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.hover\:ring-1:hover{--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)}.hover\:ring-2:hover{--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)}.hover\:\!ring-transparent:hover{--tw-ring-color: transparent !important}.hover\:ring-subtle:hover{--tw-ring-color: oklch(var(--foreground-subtle-color))}.hover\:ring-super:hover{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.hover\:\!transition-none:hover{transition-property:none!important}.hover\:transition-none:hover{transition-property:none}.hover\:after\:ring-subtler:hover:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtler-color))}.data-\[state\=open\]\:hover\:border-super:hover[data-state=open]{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.hover\:data-\[focused\=other\]\:bg-raised[data-focused=other]:hover{background-color:oklch(var(--background-raised-color))}.data-\[state\=inactive\]\:hover\:opacity-100:hover[data-state=inactive]{opacity:1}.focus\:\!border-none:focus{border-style:none!important}.focus\:\!border-super:focus{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.focus\:\!border-transparent:focus{border-color:transparent!important}.focus\:border-subtle:focus{border-color:oklch(var(--foreground-subtle-color))}.focus\:border-subtler:focus{border-color:oklch(var(--foreground-subtler-color))}.focus\:border-super:focus{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.focus\:border-transparent:focus{border-color:transparent}.focus\:text-super:focus{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.focus\:underline:focus{text-decoration-line:underline}.focus\:\!outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:\!ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus\:ring-0: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(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)}.focus\: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)}.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-transparent:focus{--tw-ring-color: transparent !important}.focus\:ring-subtler:focus{--tw-ring-color: oklch(var(--foreground-subtler-color))}.focus\:ring-super:focus{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.focus\:ring-transparent:focus{--tw-ring-color: transparent}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:rounded-lg:focus-visible{border-radius:.5rem}.focus-visible\:\!border-subtlest:focus-visible{border-color:oklch(var(--foreground-subtlest-color))!important}.focus-visible\:\!bg-transparent:focus-visible{background-color:transparent!important}.focus-visible\:bg-subtle:focus-visible{background-color:oklch(var(--background-subtle-color))}.focus-visible\:bg-subtler:focus-visible{background-color:oklch(var(--background-subtler-color))}.focus-visible\:bg-transparent:focus-visible{background-color:transparent}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-0:focus-visible{outline-offset:0px}.focus-visible\:outline-super:focus-visible{outline-color:oklch(var(--super-color) / 1)}.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-super\/50:focus-visible{--tw-ring-color: oklch(var(--super-color) / .5)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-\[6px\]:focus-visible{--tw-ring-offset-width: 6px}.focus-visible\:ring-offset-inverse:focus-visible{--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.focus-visible\:before\:opacity-100:focus-visible:before{content:var(--tw-content);opacity:1}.active\:\!scale-100:active{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.active\:scale-100:active{--tw-scale-x: 1;--tw-scale-y: 1;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))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\:scale-\[\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;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))}.active\:scale-\[0\.95\]:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\:scale-\[0\.96\]:active{--tw-scale-x: .96;--tw-scale-y: .96;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))}.active\:scale-\[0\.97\]:active{--tw-scale-x: .97;--tw-scale-y: .97;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))}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;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))}.active\:scale-\[0\.99\]:active{--tw-scale-x: .99;--tw-scale-y: .99;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))}.active\:transform-none:active{transform:none}.active\:\!cursor-grabbing:active{cursor:grabbing!important}.active\:cursor-grabbing:active{cursor:grabbing}.active\:\!bg-subtler:active{background-color:oklch(var(--background-subtler-color))!important}.active\:bg-subtler:active{background-color:oklch(var(--background-subtler-color))}.active\:underline:active{text-decoration-line:underline}.active\:\!opacity-\[50\%\]:active{opacity:50%!important}.active\:opacity-75:active{opacity:.75}.active\:duration-150:active,.active\:duration-normal:active{transition-duration:.15s}.active\:ease-outExpo:active{transition-timing-function:cubic-bezier(.16,1,.3,1)}.active\:duration-150:active,.active\:duration-normal:active{animation-duration:.15s}.active\:ease-outExpo:active{animation-timing-function:cubic-bezier(.16,1,.3,1)}.disabled\:\!text-inverse:disabled{color:oklch(var(--foreground-inverse-color))!important}:is(.disabled\:\!text-inverse:disabled){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}@media (prefers-reduced-motion: reduce){.motion-reduce\:transition-none{transition-property:none}}@media not all and (min-width: 768px){.max-md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}}@media not all and (min-width: 640px){.max-sm\:-mx-4{margin-left:-1rem;margin-right:-1rem}.max-sm\:size-full{width:100%;height:100%}.max-sm\:h-\[200px\]{height:200px}.max-sm\:min-h-dvh{min-height:100dvh}.max-sm\:w-full{width:100%}.max-sm\:w-screen{width:100vw}.max-sm\:object-cover{-o-object-fit:cover;object-fit:cover}.max-sm\:px-4{padding-left:1rem;padding-right:1rem}.max-sm\:pb-10{padding-bottom:2.5rem}.max-sm\:pl-sm{padding-left:var(--size-sm)}.max-sm\:text-center{text-align:center}.max-sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.max-sm\:text-base{font-size:1rem;line-height:1.5rem}.max-sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 640px){.sm\:fixed{position:fixed}.sm\:sticky{position:sticky}.sm\:inset-0{inset:0}.sm\:top-xs{top:var(--size-xs)}.sm\:order-\[unset\]{order:unset}.sm\:col-span-1{grid-column:span 1 / span 1}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mx-sm{margin-left:var(--size-sm);margin-right:var(--size-sm)}.sm\:-mt-2{margin-top:-.5rem}.sm\:mb-2{margin-bottom:.5rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-auto{margin-left:auto}.sm\:line-clamp-5{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:aspect-\[4\/5\]{aspect-ratio:4/5}.sm\:aspect-auto{aspect-ratio:auto}.sm\:\!h-8{height:2rem!important}.sm\:h-full{height:100%}.sm\:max-h-\[25vh\]{max-height:25vh}.sm\:min-h-0{min-height:0px}.sm\:min-h-8{min-height:2rem}.sm\:min-h-80{min-height:20rem}.sm\:\!w-8{width:2rem!important}.sm\:w-1\/2{width:50%}.sm\:w-24{width:6rem}.sm\:w-8\/12{width:66.666667%}.sm\:w-\[75vw\]{width:75vw}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:\!min-w-\[50\%\]{min-width:50%!important}.sm\:min-w-56{min-width:14rem}.sm\:max-w-\[50\%\]{max-width:50%}.sm\:max-w-screen-md{max-width:768px}.sm\:flex-1{flex:1 1 0%}.sm\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.sm\:flex-row{flex-direction:row}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:place-items-center{place-items:center}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-10{gap:2.5rem}.sm\:gap-16{gap:4rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-md{gap:var(--size-md)}.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\:self-center{align-self:center}.sm\:overflow-visible{overflow:visible}.sm\:whitespace-nowrap{white-space:nowrap}.sm\:rounded-3xl{border-radius:1.25rem}.sm\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}.sm\:object-\[80\%_center\]{-o-object-position:80% center;object-position:80% center}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:p-three{padding:3px}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.sm\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pb-0{padding-bottom:0}.sm\:pb-lg{padding-bottom:var(--size-lg)}.sm\:pr-6{padding-right:1.5rem}.sm\:pr-8{padding-right:2rem}.sm\:text-left{text-align:left}.sm\:\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.sm\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.sm\:\!text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.group:hover .sm\:group-hover\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.sm\:hover\:\!border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))!important}.sm\:hover\:border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))}}@media (min-width: 768px){.md\:pointer-events-auto{pointer-events:auto}.md\:absolute{position:absolute}.md\:relative{position:relative}.md\:inset-0{inset:0}.md\:inset-x-lg{left:var(--size-lg);right:var(--size-lg)}.md\:\!bottom-lg{bottom:var(--size-lg)!important}.md\:\!left-sideBarWidth{left:var(--sidebar-width)!important}.md\:\!left-sidebarDefaultWidth{left:var(--sidebar-default-width)!important}.md\:\!left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)!important}.md\:bottom-0{bottom:0}.md\:bottom-\[6px\]{bottom:6px}.md\:bottom-sm{bottom:var(--size-sm)}.md\:bottom-xl{bottom:var(--size-xl)}.md\:left-\[calc\(var\(--sidebar-pinned-width\)\)\]{left:calc(var(--sidebar-pinned-width))}.md\:left-auto{left:auto}.md\:left-sidebarDefaultWidth{left:var(--sidebar-default-width)}.md\:left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)}.md\:right-0{right:0}.md\:right-full{right:100%}.md\:right-md{right:var(--size-md)}.md\:right-sm{right:var(--size-sm)}.md\:top-0{top:0}.md\:top-\[calc\(var\(--header-height\)\+var\(--size-sm\)\)\]{top:calc(var(--header-height) + var(--size-sm))}.md\:top-headerHeight{top:var(--header-height)}.md\:isolation-auto{isolation:auto}.md\:z-\[1\]{z-index:1}.md\:col-span-4{grid-column:span 4 / span 4}.md\:col-start-2{grid-column-start:2}.md\:col-start-3{grid-column-start:3}.md\:col-end-3{grid-column-end:3}.md\:col-end-4{grid-column-end:4}.md\:row-start-1{grid-row-start:1}.md\:row-end-2{grid-row-end:2}.md\:row-end-3{grid-row-end:3}.md\:-m-md{margin:calc(var(--size-md) * -1)}.md\:m-0{margin:0}.md\:-mx-0{margin-left:-0px;margin-right:-0px}.md\:-mx-3{margin-left:-.75rem;margin-right:-.75rem}.md\:-mx-md{margin-left:calc(var(--size-md) * -1);margin-right:calc(var(--size-md) * -1)}.md\:-mx-xs{margin-left:calc(var(--size-xs) * -1);margin-right:calc(var(--size-xs) * -1)}.md\:-my-2{margin-top:-.5rem;margin-bottom:-.5rem}.md\:mx-0{margin-left:0;margin-right:0}.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mx-lg{margin-left:var(--size-lg);margin-right:var(--size-lg)}.md\:mx-md{margin-left:var(--size-md);margin-right:var(--size-md)}.md\:my-md{margin-top:var(--size-md);margin-bottom:var(--size-md)}.md\:-mb-10{margin-bottom:-2.5rem}.md\:-mb-md{margin-bottom:calc(var(--size-md) * -1)}.md\:-ml-5{margin-left:-1.25rem}.md\:-ml-\[1\.5px\]{margin-left:-1.5px}.md\:-ml-sm{margin-left:calc(var(--size-sm) * -1)}.md\:-mr-5{margin-right:-1.25rem}.md\:-mt-md{margin-top:calc(var(--size-md) * -1)}.md\:mb-0{margin-bottom:0}.md\:mb-1{margin-bottom:.25rem}.md\:mb-20{margin-bottom:5rem}.md\:mb-lg{margin-bottom:var(--size-lg)}.md\:mb-md{margin-bottom:var(--size-md)}.md\:mb-sm{margin-bottom:var(--size-sm)}.md\:mb-xs{margin-bottom:var(--size-xs)}.md\:ml-0{margin-left:0}.md\:mr-0{margin-right:0}.md\:mr-\[-16px\]{margin-right:-16px}.md\:mr-sm{margin-right:var(--size-sm)}.md\:mt-0{margin-top:0}.md\:mt-lg{margin-top:var(--size-lg)}.md\:mt-md{margin-top:var(--size-md)}.md\:mt-ml{margin-top:var(--size-ml)}.md\:mt-sm{margin-top:var(--size-sm)}.md\:mt-xl{margin-top:var(--size-xl)}.md\:line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md\:line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:aspect-square{aspect-ratio:1 / 1}.md\:size-10{width:2.5rem;height:2.5rem}.md\:size-12{width:3rem;height:3rem}.md\:size-14{width:3.5rem;height:3.5rem}.md\:size-20{width:5rem;height:5rem}.md\:size-28{width:7rem;height:7rem}.md\:size-4{width:1rem;height:1rem}.md\:size-5{width:1.25rem;height:1.25rem}.md\:size-8{width:2rem;height:2rem}.md\:size-\[60px\]{width:60px;height:60px}.md\:size-auto{width:auto;height:auto}.md\:h-1\/2{height:50%}.md\:h-12{height:3rem}.md\:h-14{height:3.5rem}.md\:h-2{height:.5rem}.md\:h-4{height:1rem}.md\:h-48{height:12rem}.md\:h-8{height:2rem}.md\:h-\[196px\]{height:196px}.md\:h-\[314px\]{height:314px}.md\:h-\[320px\]{height:320px}.md\:h-\[413px\]{height:413px}.md\:h-\[446px\]{height:446px}.md\:h-\[68px\]{height:68px}.md\:h-\[90vh\]{height:90vh}.md\:h-auto{height:auto}.md\:h-fit{height:-moz-fit-content;height:fit-content}.md\:h-full{height:100%}.md\:h-screen{height:100vh}.md\:max-h-\[350px\]{max-height:350px}.md\:max-h-\[900px\]{max-height:900px}.md\:max-h-\[95vh\]{max-height:95vh}.md\:max-h-\[96vh\]{max-height:96vh}.md\:max-h-none{max-height:none}.md\:min-h-0{min-height:0px}.md\:min-h-\[200px\]{min-height:200px}.md\:min-h-\[60vh\]{min-height:60vh}.md\:\!w-2\/5{width:40%!important}.md\:\!w-full{width:100%!important}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:w-1\/4{width:25%}.md\:w-14{width:3.5rem}.md\:w-16{width:4rem}.md\:w-2\/3{width:66.666667%}.md\:w-3\/4{width:75%}.md\:w-3\/5{width:60%}.md\:w-32{width:8rem}.md\:w-52{width:13rem}.md\:w-6{width:1.5rem}.md\:w-8{width:2rem}.md\:w-80{width:20rem}.md\:w-\[140px\]{width:140px}.md\:w-\[160px\]{width:160px}.md\:w-\[200px\]{width:200px}.md\:w-\[266px\]{width:266px}.md\:w-\[400px\]{width:400px}.md\:w-\[420px\]{width:420px}.md\:w-\[45\%\]{width:45%}.md\:w-\[515px\]{width:515px}.md\:w-\[55\%\]{width:55%}.md\:w-\[90vw\]{width:90vw}.md\:w-\[calc\(20\%-8px\)\]{width:calc(20% - 8px)}.md\:w-\[calc\(30\%_-_8px\)\]{width:calc(30% - 8px)}.md\:w-\[min\(80vw\,_1200px\)\]{width:min(80vw,1200px)}.md\:w-\[unset\]{width:unset}.md\:w-auto{width:auto}.md\:w-full{width:100%}.md\:\!min-w-0{min-width:0px!important}.md\:\!min-w-\[400px\]{min-width:400px!important}.md\:min-w-0{min-width:0px}.md\:min-w-\[250px\]{min-width:250px}.md\:min-w-\[300px\]{min-width:300px}.md\:min-w-\[400px\]{min-width:400px}.md\:min-w-\[500px\]{min-width:500px}.md\:min-w-\[600px\]{min-width:600px}.md\:min-w-\[768px\]{min-width:768px}.md\:min-w-\[auto\]{min-width:auto}.md\:\!max-w-\[400px\]{max-width:400px!important}.md\:max-w-\[1000px\]{max-width:1000px}.md\:max-w-\[160px\]{max-width:160px}.md\:max-w-\[300px\]{max-width:300px}.md\:max-w-\[350px\]{max-width:350px}.md\:max-w-\[360px\]{max-width:360px}.md\:max-w-\[440px\]{max-width:440px}.md\:max-w-\[50vw\]{max-width:50vw}.md\:max-w-\[90vw\]{max-width:90vw}.md\:max-w-\[960px\]{max-width:960px}.md\:max-w-lg{max-width:32rem}.md\:max-w-none{max-width:none}.md\:max-w-screen-md{max-width:768px}.md\:max-w-threadWidth{max-width:var(--thread-width)}.md\:flex-1{flex:1 1 0%}.md\:flex-shrink-0{flex-shrink:0}.md\:shrink{flex-shrink:1}.md\:grow-\[unset\]{flex-grow:unset}.md\:-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))}.md\:-translate-x-\[30vw\]{--tw-translate-x: -30vw;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))}.md\:-translate-x-sm{--tw-translate-x: calc(var(--size-sm) * -1);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))}.md\:-translate-y-px{--tw-translate-y: -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))}.md\: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))}.md\:translate-x-sm{--tw-translate-x: var(--size-sm);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))}.md\:translate-y-0{--tw-translate-y: 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))}.md\:translate-y-px{--tw-translate-y: 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))}.md\:cursor-pointer{cursor:pointer}.md\:grid-flow-col{grid-auto-flow:column}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.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\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:grid-cols-\[1fr\,3fr\,1fr\]{grid-template-columns:1fr 3fr 1fr}.md\:grid-cols-\[1fr_1fr_1fr_96px\]{grid-template-columns:1fr 1fr 1fr 96px}.md\:grid-cols-\[1fr_3fr\]{grid-template-columns:1fr 3fr}.md\:grid-cols-\[2fr\,1fr\,1fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr 1fr 1fr}.md\:grid-cols-\[3\.5fr\,1fr\,1fr\,1fr\]{grid-template-columns:3.5fr 1fr 1fr 1fr}.md\:grid-cols-\[3fr\,1fr\,1fr\,1fr\]{grid-template-columns:3fr 1fr 1fr 1fr}.md\:grid-cols-\[3fr\,1fr\]{grid-template-columns:3fr 1fr}.md\:grid-cols-\[3fr\,2fr\,1fr\,1fr\]{grid-template-columns:3fr 2fr 1fr 1fr}.md\:grid-cols-\[5fr\,2fr\,2fr\,1fr\,1fr\]{grid-template-columns:5fr 2fr 2fr 1fr 1fr}.md\:grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.md\:grid-cols-\[auto_300px\]{grid-template-columns:auto 300px}.md\:grid-cols-\[min-content\,1fr\,1fr\,min-content\]{grid-template-columns:min-content 1fr 1fr min-content}.md\:grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.md\:flex-row{flex-direction:row}.md\:\!flex-row-reverse{flex-direction:row-reverse!important}.md\:flex-row-reverse{flex-direction:row-reverse}.md\:flex-col{flex-direction:column}.md\:flex-nowrap{flex-wrap:nowrap}.md\:items-start{align-items:flex-start}.md\:items-center{align-items:center}.md\:justify-start{justify-content:flex-start}.md\:justify-end{justify-content:flex-end}.md\:justify-center{justify-content:center}.md\:justify-between{justify-content:space-between}.md\:gap-0{gap:0px}.md\:gap-3{gap:.75rem}.md\:gap-6{gap:1.5rem}.md\:gap-8{gap:2rem}.md\:gap-\[12px\]{gap:12px}.md\:gap-lg{gap:var(--size-lg)}.md\:gap-md{gap:var(--size-md)}.md\:gap-sm{gap:var(--size-sm)}.md\:gap-xl{gap:var(--size-xl)}.md\:gap-xs{gap:var(--size-xs)}.md\:gap-x-0{-moz-column-gap:0px;column-gap:0px}.md\:gap-x-md{-moz-column-gap:var(--size-md);column-gap:var(--size-md)}.md\:gap-x-sm{-moz-column-gap:var(--size-sm);column-gap:var(--size-sm)}.md\:gap-y-lg{row-gap:var(--size-lg)}.md\:gap-y-md{row-gap:var(--size-md)}.md\:space-y-lg>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-lg) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-lg) * var(--tw-space-y-reverse))}.md\:space-y-md>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-md) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-md) * var(--tw-space-y-reverse))}.md\:self-center{align-self:center}.md\:overflow-hidden{overflow:hidden}.md\:overflow-visible{overflow:visible}.md\:overflow-y-auto{overflow-y:auto}.md\:overflow-x-visible{overflow-x:visible}.md\:whitespace-nowrap{white-space:nowrap}.md\:rounded{border-radius:.25rem}.md\:rounded-2xl{border-radius:1rem}.md\:rounded-3xl{border-radius:1.25rem}.md\:rounded-full{border-radius:9999px}.md\:rounded-lg{border-radius:.5rem}.md\:rounded-md{border-radius:.375rem}.md\:rounded-none{border-radius:0}.md\:rounded-xl{border-radius:.75rem}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.md\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.md\:rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.md\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.md\:rounded-br-\[6px\]{border-bottom-right-radius:6px}.md\:border{border-width:1px}.md\:border-0{border-width:0px}.md\:\!border-y-0{border-top-width:0px!important;border-bottom-width:0px!important}.md\:\!border-r-0{border-right-width:0px!important}.md\:border-b{border-bottom-width:1px}.md\:border-b-0{border-bottom-width:0px}.md\:border-l{border-left-width:1px}.md\:border-r{border-right-width:1px}.md\:border-r-0{border-right-width:0px}.md\:border-t{border-top-width:1px}.md\:border-t-0{border-top-width:0px}.md\:bg-subtler{background-color:oklch(var(--background-subtler-color))}.md\:object-cover{-o-object-fit:cover;object-fit:cover}.md\:object-\[65\%_center\]{-o-object-position:65% center;object-position:65% center}.md\:\!p-md{padding:var(--size-md)!important}.md\:p-0{padding:0}.md\:p-1{padding:.25rem}.md\:p-12{padding:3rem}.md\:p-3{padding:.75rem}.md\:p-6{padding:1.5rem}.md\:p-\[12px\]{padding:12px}.md\:p-\[6px\]{padding:6px}.md\:p-lg{padding:var(--size-lg)}.md\:p-md{padding:var(--size-md)}.md\:p-sm{padding:var(--size-sm)}.md\:p-xl{padding:var(--size-xl)}.md\:p-xs{padding:var(--size-xs)}.md\:px-0{padding-left:0;padding-right:0}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.md\:px-sm{padding-left:var(--size-sm);padding-right:var(--size-sm)}.md\:px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.md\:px-xs{padding-left:var(--size-xs);padding-right:var(--size-xs)}.md\:py-0{padding-top:0;padding-bottom:0}.md\:py-\[12px\]{padding-top:12px;padding-bottom:12px}.md\:py-lg{padding-top:var(--size-lg);padding-bottom:var(--size-lg)}.md\:py-md{padding-top:var(--size-md);padding-bottom:var(--size-md)}.md\:py-sm{padding-top:var(--size-sm);padding-bottom:var(--size-sm)}.md\:py-xs{padding-top:var(--size-xs);padding-bottom:var(--size-xs)}.md\:\!pb-0{padding-bottom:0!important}.md\:\!pb-4{padding-bottom:1rem!important}.md\:pb-0{padding-bottom:0}.md\:pb-12{padding-bottom:3rem}.md\:pb-6{padding-bottom:1.5rem}.md\:pb-8{padding-bottom:2rem}.md\:pb-9{padding-bottom:2.25rem}.md\:pb-lg{padding-bottom:var(--size-lg)}.md\:pb-md{padding-bottom:var(--size-md)}.md\:pb-sm{padding-bottom:var(--size-sm)}.md\:pl-0{padding-left:0}.md\:pl-lg{padding-left:var(--size-lg)}.md\:pl-md{padding-left:var(--size-md)}.md\:pr-0{padding-right:0}.md\:pr-6{padding-right:1.5rem}.md\:pr-\[138px\]{padding-right:138px}.md\:pr-\[59px\]{padding-right:59px}.md\:pr-md{padding-right:var(--size-md)}.md\:pr-sm{padding-right:var(--size-sm)}.md\:pt-0{padding-top:0}.md\:pt-2{padding-top:.5rem}.md\:pt-20{padding-top:5rem}.md\:pt-lg{padding-top:var(--size-lg)}.md\:pt-md{padding-top:var(--size-md)}.md\:pt-xl{padding-top:var(--size-xl)}.md\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:\!text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.md\:\!text-5xl{font-size:3rem!important;line-height:1!important}.md\:\!text-\[2\.8rem\]{font-size:2.8rem!important}.md\:\!text-\[80px\]{font-size:80px!important}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-\[2\.8rem\]{font-size:2.8rem}.md\:text-\[3\.1rem\]{font-size:3.1rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}.md\:\!leading-\[1\.3\]{line-height:1.3!important}.md\:text-quietest{color:oklch(var(--foreground-quietest-color))}.md\:opacity-0{opacity:0}.md\:opacity-70{opacity:.7}.md\: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)}.md\: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)}.md\:shadow-overlay{--tw-shadow: 0 0 0 1px var(--shadow-overlay-border, rgba(0, 0, 0, .05)), 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 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)}.md\: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)}.md\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.md\: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)}.md\:\[grid-template-columns\:5fr_1fr_1fr_1fr\]{grid-template-columns:5fr 1fr 1fr 1fr}.md\:placeholder\:text-\[2\.8rem\]::-moz-placeholder{font-size:2.8rem}.md\:placeholder\:text-\[2\.8rem\]::placeholder{font-size:2.8rem}.first\:md\:px-md:first-child{padding-left:var(--size-md);padding-right:var(--size-md)}.md\:last\:px-md:last-child{padding-left:var(--size-md);padding-right:var(--size-md)}.last\:md\:pr-md:last-child{padding-right:var(--size-md)}.md\:last\:pr-0:last-child{padding-right:0}.group:first-child .group-first\:md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.group:last-child .group-last\:md\:pr-md{padding-right:var(--size-md)}.group:hover .md\:group-hover\: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:hover .md\:group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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:hover .md\:group-hover\:\!border-foreground{border-color:oklch(var(--foreground-color))!important}.group:hover .md\:group-hover\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group:hover .md\:group-hover\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group:hover .md\:group-hover\:opacity-100{opacity:1}@container (min-width: 20rem){.md\:\@xs\:w-60{width:15rem}}@container (min-width: 1458px){.md\:\@\[1458px\]\:w-\[874px\]{width:874px}.md\:\@\[1458px\]\:shrink-0{flex-shrink:0}}.md\:hover\:border-subtle:hover{border-color:oklch(var(--foreground-subtle-color))}.md\:hover\:\!bg-raisedOffset:hover{background-color:oklch(var(--raised-offset-color))!important}.md\:hover\:\!bg-subtle:hover{background-color:oklch(var(--background-subtle-color))!important}.md\:hover\:\!bg-subtler:hover{background-color:oklch(var(--background-subtler-color))!important}.md\:hover\:\!bg-super:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.md\:hover\:\!bg-transparent:hover{background-color:transparent!important}.md\:hover\:text-quiet:hover{color:oklch(var(--foreground-quiet-color))}}@media (max-width: 1224px){@media (min-width: 768px){.max-\[1224px\]\:md\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}}}@media (max-width: 970px){@media (min-width: 768px){.max-\[970px\]\:md\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}}}@media (min-width: 1024px){.lg\:\!relative{position:relative!important}.lg\:sticky{position:sticky}.lg\:\!top-0{top:0!important}.lg\:-top-6{top:-1.5rem}.lg\:bottom-md{bottom:var(--size-md)}.lg\:left-8{left:2rem}.lg\:right-8{right:2rem}.lg\:right-sm{right:var(--size-sm)}.lg\:top-\[clamp\(24px\,4vw\,96px\)\]{top:clamp(24px,4vw,96px)}.lg\:ml-0{margin-left:0}.lg\:block{display:block}.lg\:grid{display:grid}.lg\:contents{display:contents}.lg\:hidden{display:none}.lg\:size-\[44px\]{width:44px;height:44px}.lg\:h-\[clamp\(420px\,calc\(100vh-320px\)\,672px\)\]{height:clamp(420px,calc(100vh - 320px),672px)}.lg\:max-h-\[40vh\]{max-height:40vh}.lg\:w-1\/2{width:50%}.lg\:w-fit{width:-moz-fit-content;width:fit-content}.lg\:min-w-\[900px\]{min-width:900px}.lg\:max-w-\[unset\]{max-width:unset}.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\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr 1fr}.lg\:grid-cols-\[8fr_minmax\(300px\,3fr\)\]{grid-template-columns:8fr minmax(300px,3fr)}.lg\:gap-8{gap:2rem}.lg\:gap-md{gap:var(--size-md)}.lg\:gap-xl{gap:var(--size-xl)}.lg\:rounded-lg{border-radius:.5rem}.lg\:object-\[center_center\]{-o-object-position:center center;object-position:center center}.lg\:p-sm{padding:var(--size-sm)}.lg\:px-12{padding-left:3rem;padding-right:3rem}.lg\:px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.lg\:pl-0{padding-left:0}.lg\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-\[2\.8rem\]{font-size:2.8rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}[data-erp=tab] .erp-tab\:lg\:right-0{right:0}}@media (min-width: 1280px){.xl\:block{display:block}.xl\:size-\[64px\]{width:64px;height:64px}.xl\:max-h-screen{max-height:100vh}.xl\:max-w-\[25vw\]{max-width:25vw}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:border-l-0{border-left-width:0px}.xl\:\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.xl\: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)}}@media (min-width: 1536px){.\32xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.ltr\:-mr-sm:where([dir=ltr],[dir=ltr] *){margin-right:calc(var(--size-sm) * -1)}.ltr\:-translate-x-\[1\%\]:where([dir=ltr],[dir=ltr] *){--tw-translate-x: -1%;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))}.ltr\:-translate-x-px:where([dir=ltr],[dir=ltr] *){--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))}.rtl\:-ml-sm:where([dir=rtl],[dir=rtl] *){margin-left:calc(var(--size-sm) * -1)}.rtl\:translate-x-\[1\%\]:where([dir=rtl],[dir=rtl] *){--tw-translate-x: 1%;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))}.rtl\:translate-x-px:where([dir=rtl],[dir=rtl] *){--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))}.rtl\:rotate-180:where([dir=rtl],[dir=rtl] *){--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))}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:ml-0{margin-left:0}:root:not([data-color-scheme=light]) .dark\:mr-0{margin-right:0}:root:not([data-color-scheme=light]) .dark\:block{display:block}:root:not([data-color-scheme=light]) .dark\:hidden{display:none}:root:not([data-color-scheme=light]) .dark\:w-full{width:100%}:root:not([data-color-scheme=light]) .dark\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}:root:not([data-color-scheme=light]) .dark\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}:root:not([data-color-scheme=light]) .dark\:border{border-width:1px}:root:not([data-color-scheme=light]) .dark\:border-0{border-width:0px}:root:not([data-color-scheme=light]) .dark\:\!border-none{border-style:none!important}:root:not([data-color-scheme=light]) .dark\:border-none{border-style:none}:root:not([data-color-scheme=light]) .dark\:\!border-\[white\]\/10{border-color:#ffffff1a!important}:root:not([data-color-scheme=light]) .dark\:border-\[\#5D5F5F\]{--tw-border-opacity: 1;border-color:rgb(93 95 95 / var(--tw-border-opacity))}:root:not([data-color-scheme=light]) .dark\:border-\[white\]\/5{border-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:border-black\/\[0\.04\]{border-color:#0000000a}:root:not([data-color-scheme=light]) .dark\:border-foreground{border-color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:border-inverse{border-color:oklch(var(--foreground-inverse-color))}:root:not([data-color-scheme=light]) .dark\:border-subtle{border-color:oklch(var(--foreground-subtle-color))}:root:not([data-color-scheme=light]) .dark\:border-subtler{border-color:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}:root:not([data-color-scheme=light]) .dark\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}:root:not([data-color-scheme=light]) .dark\:border-super\/30{border-color:oklch(var(--super-color) / .3)}:root:not([data-color-scheme=light]) .dark\:border-super\/5{border-color:oklch(var(--super-color) / .05)}:root:not([data-color-scheme=light]) .dark\:border-super\/85{border-color:oklch(var(--super-color) / .85)}:root:not([data-color-scheme=light]) .dark\:border-transparent{border-color:transparent}:root:not([data-color-scheme=light]) .dark\:border-white\/10{border-color:#ffffff1a}:root:not([data-color-scheme=light]) .dark\:\!bg-\[white\]\/100{background-color:#fff!important}:root:not([data-color-scheme=light]) .dark\:\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-white\/10{background-color:#ffffff1a!important}:root:not([data-color-scheme=light]) .dark\:\!bg-white\/5{background-color:#ffffff0d!important}:root:not([data-color-scheme=light]) .dark\:bg-\[\#211B1A\]{--tw-bg-opacity: 1;background-color:rgb(33 27 26 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#450a0a\]\/75{background-color:#450a0abf}:root:not([data-color-scheme=light]) .dark\:bg-\[\#54B4E3\]{--tw-bg-opacity: 1;background-color:rgb(84 180 227 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#B3C901\]{--tw-bg-opacity: 1;background-color:rgb(179 201 1 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#B4B662\]{--tw-bg-opacity: 1;background-color:rgb(180 182 98 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#C48ED8\]{--tw-bg-opacity: 1;background-color:rgb(196 142 216 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#E68161\]{--tw-bg-opacity: 1;background-color:rgb(230 129 97 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#F0B435\]{--tw-bg-opacity: 1;background-color:rgb(240 180 53 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#F5F5F5\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#FF5459\]{--tw-bg-opacity: 1;background-color:rgb(255 84 89 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#FFAB44\]{--tw-bg-opacity: 1;background-color:rgb(255 171 68 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-base\/70{background-color:oklch(var(--background-base-color) / .7)}:root:not([data-color-scheme=light]) .dark\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}:root:not([data-color-scheme=light]) .dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-black\/50{background-color:#00000080}:root:not([data-color-scheme=light]) .dark\:bg-black\/80{background-color:#000c}:root:not([data-color-scheme=light]) .dark\:bg-black\/\[0\.18\]{background-color:#0000002e}:root:not([data-color-scheme=light]) .dark\:bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}:root:not([data-color-scheme=light]) .dark\:bg-offset{background-color:oklch(var(--offset-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtle{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtlest{background-color:oklch(var(--background-subtlest-color))}:root:not([data-color-scheme=light]) .dark\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-super\/20{background-color:oklch(var(--super-color) / .2)}:root:not([data-color-scheme=light]) .dark\:bg-super\/25{background-color:oklch(var(--super-color) / .25)}:root:not([data-color-scheme=light]) .dark\:bg-super\/85{background-color:oklch(var(--super-color) / .85)}:root:not([data-color-scheme=light]) .dark\:bg-transparent{background-color:transparent}:root:not([data-color-scheme=light]) .dark\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-white\/10{background-color:#ffffff1a}:root:not([data-color-scheme=light]) .dark\:bg-white\/20{background-color:#fff3}:root:not([data-color-scheme=light]) .dark\:bg-white\/40{background-color:#fff6}:root:not([data-color-scheme=light]) .dark\:bg-white\/5{background-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}:root:not([data-color-scheme=light]) .dark\:bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}:root:not([data-color-scheme=light]) .dark\:bg-none{background-image:none}:root:not([data-color-scheme=light]) .dark\:from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}:root:not([data-color-scheme=light]) .dark\:from-super\/20{--tw-gradient-from: oklch(var(--super-color) / .2) 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)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\:to-\[oklch\(var\(--dark-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--dark-background-base-color)) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-super\/20{--tw-gradient-to: oklch(var(--super-color) / .2) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-white\/20{--tw-gradient-to: rgb(255 255 255 / .2) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:stroke-\[1\.5px\]{stroke-width:1.5px}:root:not([data-color-scheme=light]) .dark\:\!text-\[\#1f2121\]{--tw-text-opacity: 1 !important;color:rgb(31 33 33 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!text-foreground{color:oklch(var(--foreground-color))!important}:root:not([data-color-scheme=light]) .dark\:\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}:root:not([data-color-scheme=light]) .dark\:\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:text-\[\#1f2121\]{--tw-text-opacity: 1;color:rgb(31 33 33 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-\[\#4ade80\]{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-foreground{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:text-inverse{color:oklch(var(--foreground-inverse-color))}:root:not([data-color-scheme=light]) .dark\:text-quiet{color:oklch(var(--foreground-quiet-color))}:root:not([data-color-scheme=light]) .dark\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-white\/50{color:#ffffff80}:root:not([data-color-scheme=light]) .dark\:decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:opacity-10{opacity:.1}:root:not([data-color-scheme=light]) .dark\:opacity-100{opacity:1}:root:not([data-color-scheme=light]) .dark\:opacity-15{opacity:.15}:root:not([data-color-scheme=light]) .dark\:opacity-20{opacity:.2}:root:not([data-color-scheme=light]) .dark\:opacity-25{opacity:.25}:root:not([data-color-scheme=light]) .dark\:opacity-40{opacity:.4}:root:not([data-color-scheme=light]) .dark\:opacity-60{opacity:.6}:root:not([data-color-scheme=light]) .dark\:opacity-90{opacity:.9}:root:not([data-color-scheme=light]) .dark\:opacity-\[0\.12\]{opacity:.12}:root:not([data-color-scheme=light]) .dark\:mix-blend-normal{mix-blend-mode:normal}:root:not([data-color-scheme=light]) .dark\:mix-blend-screen{mix-blend-mode:screen}:root:not([data-color-scheme=light]) .dark\:mix-blend-soft-light{mix-blend-mode:soft-light}:root:not([data-color-scheme=light]) .dark\:\!shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)\]{--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_0_16px_8px_oklch\(var\(--offset-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--offset-color)/.6);--tw-shadow-colored: 0 0 16px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 1px 4px rgba(0,0,0,.5);--tw-shadow-colored: 0 1px 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)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.12\)\,0_32px_16px_36px_oklch\(var\(--dark-background-base-color\)\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.12),0 32px 16px 36px oklch(var(--dark-background-base-color));--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color), 0 32px 16px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.5);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}:root:not([data-color-scheme=light]) .dark\:shadow-black\/10{--tw-shadow-color: rgb(0 0 0 / .1);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:shadow-super\/5{--tw-shadow-color: oklch(var(--super-color) / .05);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:shadow-white\/5{--tw-shadow-color: rgb(255 255 255 / .05);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:\!ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color)) !important}:root:not([data-color-scheme=light]) .dark\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}:root:not([data-color-scheme=light]) .dark\:ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}:root:not([data-color-scheme=light]) .dark\:ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}:root:not([data-color-scheme=light]) .dark\:invert{--tw-invert: invert(100%);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)}:is(:root:not([data-color-scheme=light]) .dark\:\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(:root:not([data-color-scheme=light]) .dark\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}:root:not([data-color-scheme=light]) .dark\:\!\[--dog-bg-highlight\:white\]{--dog-bg-highlight: white !important}:root:not([data-color-scheme=light]) .dark\:\!\[--dot-bg\:currentColor\]{--dot-bg: currentColor !important}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .before\:dark\:border-none:before{content:var(--tw-content);border-style:none}:root:not([data-color-scheme=light]) .dark\:before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:before\:shadow-md:before{content:var(--tw-content);--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)}:root:not([data-color-scheme=light]) .dark\:after\:absolute:after{content:var(--tw-content);position:absolute}:root:not([data-color-scheme=light]) .dark\:after\:inset-0:after{content:var(--tw-content);inset:0}:root:not([data-color-scheme=light]) .dark\:after\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}:root:not([data-color-scheme=light]) .dark\:after\:border:after{content:var(--tw-content);border-width:1px}:root:not([data-color-scheme=light]) .dark\:after\:border-none:after{content:var(--tw-content);border-style:none}:root:not([data-color-scheme=light]) .dark\:after\:border-white\/10:after{content:var(--tw-content);border-color:#ffffff1a}:root:not([data-color-scheme=light]) .after\:dark\:shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;--tw-shadow-colored: inset 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)}:root:not([data-color-scheme=light]) .dark\:after\:ring-0:after{content:var(--tw-content);--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)}:root:not([data-color-scheme=light]) .group:hover .dark\:group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}:is(:root:not([data-color-scheme=light]) .group:hover .dark\:group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}:root:not([data-color-scheme=light]) .group:active .dark\:group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}:root:not([data-color-scheme=light]) .aria-selected\:dark\:bg-subtle[aria-selected=true]{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .aria-selected\:dark\:text-foreground[aria-selected=true]{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:data-\[focused\=self\]\:bg-subtler[data-focused=self]{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .group[data-selected=true] .dark\:group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:hover\:\!bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)!important}:root:not([data-color-scheme=light]) .dark\:hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:hover\:text-foreground:hover{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}:root:not([data-color-scheme=light]) .dark\:hover\:data-\[focused\=other\]\:bg-subtler[data-focused=other]:hover{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .dark\:focus\:\!ring-super\/50:focus{--tw-ring-color: oklch(var(--super-color) / .5) !important}:root:not([data-color-scheme=light]) .dark\:active\:\!bg-subtle:active{background-color:oklch(var(--background-subtle-color))!important}:root:not([data-color-scheme=light]) .dark\:active\:bg-subtle:active{background-color:oklch(var(--background-subtle-color))}}@media (min-width: 768px){@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .md\:dark\:block{display:block}:root:not([data-color-scheme=light]) .md\:dark\:border{border-width:1px}:root:not([data-color-scheme=light]) .md\:dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}}}html[data-color-scheme=dark] .dark\:ml-0{margin-left:0}html[data-color-scheme=dark] .dark\:mr-0{margin-right:0}html[data-color-scheme=dark] .dark\:block{display:block}html[data-color-scheme=dark] .dark\:hidden{display:none}html[data-color-scheme=dark] .dark\:w-full{width:100%}html[data-color-scheme=dark] .dark\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}html[data-color-scheme=dark] .dark\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}html[data-color-scheme=dark] .dark\:border{border-width:1px}html[data-color-scheme=dark] .dark\:border-0{border-width:0px}html[data-color-scheme=dark] .dark\:\!border-none{border-style:none!important}html[data-color-scheme=dark] .dark\:border-none{border-style:none}html[data-color-scheme=dark] .dark\:\!border-\[white\]\/10{border-color:#ffffff1a!important}html[data-color-scheme=dark] .dark\:border-\[\#5D5F5F\]{--tw-border-opacity: 1;border-color:rgb(93 95 95 / var(--tw-border-opacity))}html[data-color-scheme=dark] .dark\:border-\[white\]\/5{border-color:#ffffff0d}html[data-color-scheme=dark] .dark\:border-black\/\[0\.04\]{border-color:#0000000a}html[data-color-scheme=dark] .dark\:border-foreground{border-color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:border-inverse{border-color:oklch(var(--foreground-inverse-color))}html[data-color-scheme=dark] .dark\:border-subtle{border-color:oklch(var(--foreground-subtle-color))}html[data-color-scheme=dark] .dark\:border-subtler{border-color:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}html[data-color-scheme=dark] .dark\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}html[data-color-scheme=dark] .dark\:border-super\/30{border-color:oklch(var(--super-color) / .3)}html[data-color-scheme=dark] .dark\:border-super\/5{border-color:oklch(var(--super-color) / .05)}html[data-color-scheme=dark] .dark\:border-super\/85{border-color:oklch(var(--super-color) / .85)}html[data-color-scheme=dark] .dark\:border-transparent{border-color:transparent}html[data-color-scheme=dark] .dark\:border-white\/10{border-color:#ffffff1a}html[data-color-scheme=dark] .dark\:\!bg-\[white\]\/100{background-color:#fff!important}html[data-color-scheme=dark] .dark\:\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}html[data-color-scheme=dark] .dark\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}html[data-color-scheme=dark] .dark\:\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}html[data-color-scheme=dark] .dark\:\!bg-white\/10{background-color:#ffffff1a!important}html[data-color-scheme=dark] .dark\:\!bg-white\/5{background-color:#ffffff0d!important}html[data-color-scheme=dark] .dark\:bg-\[\#211B1A\]{--tw-bg-opacity: 1;background-color:rgb(33 27 26 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#450a0a\]\/75{background-color:#450a0abf}html[data-color-scheme=dark] .dark\:bg-\[\#54B4E3\]{--tw-bg-opacity: 1;background-color:rgb(84 180 227 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#B3C901\]{--tw-bg-opacity: 1;background-color:rgb(179 201 1 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#B4B662\]{--tw-bg-opacity: 1;background-color:rgb(180 182 98 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#C48ED8\]{--tw-bg-opacity: 1;background-color:rgb(196 142 216 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#E68161\]{--tw-bg-opacity: 1;background-color:rgb(230 129 97 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#F0B435\]{--tw-bg-opacity: 1;background-color:rgb(240 180 53 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#F5F5F5\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#FF5459\]{--tw-bg-opacity: 1;background-color:rgb(255 84 89 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#FFAB44\]{--tw-bg-opacity: 1;background-color:rgb(255 171 68 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-base\/70{background-color:oklch(var(--background-base-color) / .7)}html[data-color-scheme=dark] .dark\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}html[data-color-scheme=dark] .dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-black\/50{background-color:#00000080}html[data-color-scheme=dark] .dark\:bg-black\/80{background-color:#000c}html[data-color-scheme=dark] .dark\:bg-black\/\[0\.18\]{background-color:#0000002e}html[data-color-scheme=dark] .dark\:bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}html[data-color-scheme=dark] .dark\:bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}html[data-color-scheme=dark] .dark\:bg-offset{background-color:oklch(var(--offset-color))}html[data-color-scheme=dark] .dark\:bg-subtle{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .dark\:bg-subtlest{background-color:oklch(var(--background-subtlest-color))}html[data-color-scheme=dark] .dark\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:bg-super\/20{background-color:oklch(var(--super-color) / .2)}html[data-color-scheme=dark] .dark\:bg-super\/25{background-color:oklch(var(--super-color) / .25)}html[data-color-scheme=dark] .dark\:bg-super\/85{background-color:oklch(var(--super-color) / .85)}html[data-color-scheme=dark] .dark\:bg-transparent{background-color:transparent}html[data-color-scheme=dark] .dark\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-white\/10{background-color:#ffffff1a}html[data-color-scheme=dark] .dark\:bg-white\/20{background-color:#fff3}html[data-color-scheme=dark] .dark\:bg-white\/40{background-color:#fff6}html[data-color-scheme=dark] .dark\:bg-white\/5{background-color:#ffffff0d}html[data-color-scheme=dark] .dark\:bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}html[data-color-scheme=dark] .dark\:bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}html[data-color-scheme=dark] .dark\:bg-none{background-image:none}html[data-color-scheme=dark] .dark\:from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}html[data-color-scheme=dark] .dark\:from-super\/20{--tw-gradient-from: oklch(var(--super-color) / .2) 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)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\:to-\[oklch\(var\(--dark-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--dark-background-base-color)) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-super\/20{--tw-gradient-to: oklch(var(--super-color) / .2) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-white\/20{--tw-gradient-to: rgb(255 255 255 / .2) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:stroke-\[1\.5px\]{stroke-width:1.5px}html[data-color-scheme=dark] .dark\:\!text-\[\#1f2121\]{--tw-text-opacity: 1 !important;color:rgb(31 33 33 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:\!text-foreground{color:oklch(var(--foreground-color))!important}html[data-color-scheme=dark] .dark\:\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}html[data-color-scheme=dark] .dark\:\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:text-\[\#1f2121\]{--tw-text-opacity: 1;color:rgb(31 33 33 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-\[\#4ade80\]{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-foreground{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:text-inverse{color:oklch(var(--foreground-inverse-color))}html[data-color-scheme=dark] .dark\:text-quiet{color:oklch(var(--foreground-quiet-color))}html[data-color-scheme=dark] .dark\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-white\/50{color:#ffffff80}html[data-color-scheme=dark] .dark\:decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:opacity-10{opacity:.1}html[data-color-scheme=dark] .dark\:opacity-100{opacity:1}html[data-color-scheme=dark] .dark\:opacity-15{opacity:.15}html[data-color-scheme=dark] .dark\:opacity-20{opacity:.2}html[data-color-scheme=dark] .dark\:opacity-25{opacity:.25}html[data-color-scheme=dark] .dark\:opacity-40{opacity:.4}html[data-color-scheme=dark] .dark\:opacity-60{opacity:.6}html[data-color-scheme=dark] .dark\:opacity-90{opacity:.9}html[data-color-scheme=dark] .dark\:opacity-\[0\.12\]{opacity:.12}html[data-color-scheme=dark] .dark\:mix-blend-normal{mix-blend-mode:normal}html[data-color-scheme=dark] .dark\:mix-blend-screen{mix-blend-mode:screen}html[data-color-scheme=dark] .dark\:mix-blend-soft-light{mix-blend-mode:soft-light}html[data-color-scheme=dark] .dark\:\!shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)\]{--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}html[data-color-scheme=dark] .dark\:shadow-\[0_0_16px_8px_oklch\(var\(--offset-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--offset-color)/.6);--tw-shadow-colored: 0 0 16px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\:shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 1px 4px rgba(0,0,0,.5);--tw-shadow-colored: 0 1px 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)}html[data-color-scheme=dark] .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.12\)\,0_32px_16px_36px_oklch\(var\(--dark-background-base-color\)\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.12),0 32px 16px 36px oklch(var(--dark-background-base-color));--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color), 0 32px 16px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.5);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}html[data-color-scheme=dark] .dark\:shadow-black\/10{--tw-shadow-color: rgb(0 0 0 / .1);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:shadow-super\/5{--tw-shadow-color: oklch(var(--super-color) / .05);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:shadow-white\/5{--tw-shadow-color: rgb(255 255 255 / .05);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:\!ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color)) !important}html[data-color-scheme=dark] .dark\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}html[data-color-scheme=dark] .dark\:ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}html[data-color-scheme=dark] .dark\:ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}html[data-color-scheme=dark] .dark\:invert{--tw-invert: invert(100%);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)}:is(html[data-color-scheme=dark] .dark\:\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(html[data-color-scheme=dark] .dark\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}html[data-color-scheme=dark] .dark\:\!\[--dog-bg-highlight\:white\]{--dog-bg-highlight: white !important}html[data-color-scheme=dark] .dark\:\!\[--dot-bg\:currentColor\]{--dot-bg: currentColor !important}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .before\:dark\:border-none:before{content:var(--tw-content);border-style:none}html[data-color-scheme=dark] .dark\:before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:before\:shadow-md:before{content:var(--tw-content);--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)}html[data-color-scheme=dark] .dark\:after\:absolute:after{content:var(--tw-content);position:absolute}html[data-color-scheme=dark] .dark\:after\:inset-0:after{content:var(--tw-content);inset:0}html[data-color-scheme=dark] .dark\:after\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}html[data-color-scheme=dark] .dark\:after\:border:after{content:var(--tw-content);border-width:1px}html[data-color-scheme=dark] .dark\:after\:border-none:after{content:var(--tw-content);border-style:none}html[data-color-scheme=dark] .dark\:after\:border-white\/10:after{content:var(--tw-content);border-color:#ffffff1a}html[data-color-scheme=dark] .after\:dark\:shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;--tw-shadow-colored: inset 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)}html[data-color-scheme=dark] .dark\:after\:ring-0:after{content:var(--tw-content);--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)}html[data-color-scheme=dark] .group:hover .dark\:group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}:is(html[data-color-scheme=dark] .group:hover .dark\:group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}html[data-color-scheme=dark] .group:active .dark\:group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}html[data-color-scheme=dark] .aria-selected\:dark\:bg-subtle[aria-selected=true]{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .aria-selected\:dark\:text-foreground[aria-selected=true]{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:data-\[focused\=self\]\:bg-subtler[data-focused=self]{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .group[data-selected=true] .dark\:group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:hover\:\!bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)!important}html[data-color-scheme=dark] .dark\:hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}html[data-color-scheme=dark] .dark\:hover\:text-foreground:hover{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}html[data-color-scheme=dark] .dark\:hover\:data-\[focused\=other\]\:bg-subtler[data-focused=other]:hover{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .dark\:focus\:\!ring-super\/50:focus{--tw-ring-color: oklch(var(--super-color) / .5) !important}html[data-color-scheme=dark] .dark\:active\:\!bg-subtle:active{background-color:oklch(var(--background-subtle-color))!important}html[data-color-scheme=dark] .dark\:active\:bg-subtle:active{background-color:oklch(var(--background-subtle-color))}@media (min-width: 768px){html[data-color-scheme=dark] .md\:dark\:block{display:block}html[data-color-scheme=dark] .md\:dark\:border{border-width:1px}html[data-color-scheme=dark] .md\:dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}}.\[\&\+div\]\:right-3+div{right:.75rem}.\[\&\+p\]\:mt-4+p{margin-top:1rem}.\[\&\.day-range-end\]\:\!bg-super.day-range-end{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\.day-range-end\]\:\!text-inverse.day-range-end{color:oklch(var(--foreground-inverse-color))!important}:is(.\[\&\.day-range-end\]\:\!text-inverse.day-range-end){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}.\[\&\.day-range-end\]\:hover\:\!bg-super:hover.day-range-end,.\[\&\.day-range-start\]\:\!bg-super.day-range-start{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\.day-range-start\]\:\!text-inverse.day-range-start{color:oklch(var(--foreground-inverse-color))!important}:is(.\[\&\.day-range-start\]\:\!text-inverse.day-range-start){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}.\[\&\.day-range-start\]\:hover\:\!bg-super:hover.day-range-start{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:\:-webkit-inner-spin-button\]\:hidden::-webkit-inner-spin-button{display:none}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:hidden::-webkit-outer-spin-button{display:none}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\: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) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:\[\&\:focus\]\:ring-0: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(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)}}html[data-color-scheme=dark] .dark\:\[\&\:focus\]\:ring-0: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(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)}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-full:has(>.day-range-end){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-full:has(>.day-range-start){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:.375rem}.\[\&\:has\(\[aria-selected\]\)\]\:bg-superBG:has([aria-selected]){--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-full:has([aria-selected]):first-child{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-full:has([aria-selected]):last-child{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-full:has([aria-selected].day-range-end){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\[data-initialised\=\"true\"\]\)_\~_\*\:first-child\]\:hidden:has([data-initialised=true])~*:first-child{display:none}.\[\&\:has\(\[data-inline-type\=image\]\)\+\&\:has\(\[data-inline-type\=image\]\)_\[data-inline-type\=image\]\]\:hidden:has([data-inline-type=image])+.\[\&\:has\(\[data-inline-type\=image\]\)\+\&\:has\(\[data-inline-type\=image\]\)_\[data-inline-type\=image\]\]\:hidden:has([data-inline-type=image]) [data-inline-type=image]{display:none}.\[\&\:has\(iframe\)_\:first-child\]\:hidden:has(iframe) :first-child{display:none}.\[\&\:has\(table\)_\[data-inline-type\=image\]\]\:hidden:has(table) [data-inline-type=image]{display:none}.\[\&\:is\(\:hover\,\:focus-visible\,\[data-selected\=\"true\"\]\)\+div\:not\(\:hover\)\:not\(\:focus-visible\)\:not\(\[data-selected\=\"true\"\]\)\]\:border-t-transparent:is(:hover,:focus-visible,[data-selected=true])+div:not(:hover):not(:focus-visible):not([data-selected=true]){border-top-color:transparent}.\[\&\:is\(\:hover\,\:focus-visible\,\[data-selected\=\"true\"\]\)\+div\:not\(\:hover\)\:not\(\:focus-visible\)\:not\(\[data-selected\=\"true\"\]\)\]\:transition-none:is(:hover,:focus-visible,[data-selected=true])+div:not(:hover):not(:focus-visible):not([data-selected=true]){transition-property:none}.\[\&\:not\(\:first-child\)\]\:pt-sm:not(:first-child){padding-top:var(--size-sm)}.\[\&\:not\(\:first-child\)\]\:before\:top-\[6px\]:not(:first-child):before{content:var(--tw-content);top:6px}.\[\&\:not\(\:last-child\)\]\:border-b-transparent:not(:last-child){border-bottom-color:transparent}.\[\&\:not\(\:last-child\)\]\:pb-sm:not(:last-child){padding-bottom:var(--size-sm)}.\[\&\:only-child\]\:border-0:only-child{border-width:0px}.\[\&\>\*\:not\(\:first-child\)\]\:border-l>*:not(:first-child){border-left-width:1px}.\[\&\>\*\:not\(\:first-child\)\]\:border-subtle>*:not(:first-child){border-color:oklch(var(--foreground-subtle-color))}.\[\&\>\*\:nth-child\(4\)\]\:hidden>*:nth-child(4){display:none}@media (min-width: 768px){.md\:\[\&\>\*\:nth-child\(4\)\]\:block>*:nth-child(4){display:block}}.\[\&\>\*\]\:pointer-events-auto>*{pointer-events:auto}.\[\&\>\*\]\:ml-0\.5>*{margin-left:.125rem}.\[\&\>\*\]\:size-6>*{width:1.5rem;height:1.5rem}.\[\&\>\*\]\:w-auto>*{width:auto}.\[\&\>\*\]\:w-full>*{width:100%}.\[\&\>\*\]\:flex-1>*{flex:1 1 0%}.\[\&\>\*\]\:grow>*{flex-grow:1}.\[\&\>\*\]\:\!gap-2>*{gap:.5rem!important}.\[\&\>\*\]\:\!self-center>*{align-self:center!important}.\[\&\>\*\]\:p-0>*{padding:0}.\[\&\>button\]\:h-11>button{height:2.75rem}.\[\&\>div\>div\]\:\!pb-xs>div>div{padding-bottom:var(--size-xs)!important}.\[\&\>div\]\:\!block>div{display:block!important}.\[\&\>div\]\:\!hidden>div{display:none!important}.\[\&\>div\]\:h-full>div{height:100%}.\[\&\>div\]\:w-auto>div{width:auto}.\[\&\>div\]\:w-full>div{width:100%}.\[\&\>div\]\:gap-0>div{gap:0px}.\[\&\>div\]\:\!pb-xs>div{padding-bottom:var(--size-xs)!important}.\[\&\>img\]\:max-h-\[unset\]>img{max-height:unset}.\[\&\>img\]\:\!rounded-full>img{border-radius:9999px!important}.\[\&\>p\]\:\!m-0>p{margin:0!important}.\[\&\>p\]\:my-0>p{margin-top:0;margin-bottom:0}.\[\&\>p\]\:mb-2>p{margin-bottom:.5rem}.\[\&\>p\]\:pt-0>p{padding-top:0}.\[\&\>path\]\:stroke-foreground>path{stroke:oklch(var(--foreground-color))}.\[\&\>path\]\:stroke-subtler>path{stroke:oklch(var(--foreground-subtler-color))}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:\[\&\>path\]\:stroke-black>path{stroke:#000}:root:not([data-color-scheme=light]) .dark\:\[\&\>path\]\:stroke-1>path{stroke-width:1}}html[data-color-scheme=dark] .dark\:\[\&\>path\]\:stroke-black>path{stroke:#000}html[data-color-scheme=dark] .dark\:\[\&\>path\]\:stroke-1>path{stroke-width:1}.\[\&_\*\]\:fill-quiet *{fill:oklch(var(--foreground-quiet-color))}.\[\&_\*\]\:\!text-sm *{font-size:.875rem!important;line-height:1.25rem!important}.\[\&_\*\]\:\!font-normal *{font-weight:400!important}.\[\&_\*\]\:\!text-foreground *{color:oklch(var(--foreground-color))!important}.\[\&_\*\]\:\!font-normal *{font-weight:var(--font-normal)!important}.\[\&_\>\*\:first-child\]\:mt-0>*:first-child{margin-top:0}.\[\&_\>div\]\:min-h-0>div{min-height:0px}.\[\&_\[contenteditable\]\+\*\>\*\]\:opacity-80 [contenteditable]+*>*{opacity:.8}.\[\&_\[contenteditable\]\]\:max-h-none [contenteditable]{max-height:none}.\[\&_\[contenteditable\]\]\:\!overflow-hidden [contenteditable]{overflow:hidden!important}.\[\&_\[contenteditable\]\]\:\!bg-transparent [contenteditable]{background-color:transparent!important}.\[\&_\[contenteditable\]\]\:\!font-display [contenteditable]{font-family:var(--font-fk-grotesk),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"!important}@media (min-width: 640px){.\[\&_\[contenteditable\]\]\:sm\:max-h-none [contenteditable]{max-height:none}}@media (min-width: 1024px){.\[\&_\[contenteditable\]\]\:lg\:max-h-none [contenteditable]{max-height:none}}.\[\&_a\]\:bg-subtle a{background-color:oklch(var(--background-subtle-color))}.\[\&_a\]\:text-foreground a{color:oklch(var(--foreground-color))}.\[\&_a\]\:hover\:bg-subtle:hover a{background-color:oklch(var(--background-subtle-color))}.\[\&_a\]\:hover\:bg-subtler:hover a{background-color:oklch(var(--background-subtler-color))}.\[\&_blaze-widget-layout\]\:p-0 blaze-widget-layout{padding:0}.\[\&_button\]\:\!border-dashed button{border-style:dashed!important}.\[\&_button\]\:bg-inverse button{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}.\[\&_canvas\]\:relative canvas{position:relative}.\[\&_canvas\]\:size-full canvas{width:100%;height:100%}.\[\&_code\]\:max-h-\[300px\] code{max-height:300px}.\[\&_code\]\:overflow-auto code{overflow:auto}.\[\&_h1\:first-of-type\]\:mt-8 h1:first-of-type{margin-top:2rem}.\[\&_h2\:first-of-type\]\:mt-6 h2:first-of-type{margin-top:1.5rem}.\[\&_img\]\:pointer-events-none img{pointer-events:none}.\[\&_input\]\:pl-7 input{padding-left:1.75rem}.\[\&_input\]\:pl-8 input{padding-left:2rem}.\[\&_input\]\:pl-9 input{padding-left:2.25rem}.\[\&_input\]\:pl-\[30px\] input{padding-left:30px}.\[\&_input\]\:pr-sm input{padding-right:var(--size-sm)}.\[\&_p\]\:font-sans p{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo}.\[\&_p\]\:\!text-sm p{font-size:.875rem!important;line-height:1.25rem!important}.\[\&_p\]\:text-lg p{font-size:1.125rem;line-height:1.75rem}.\[\&_p\]\:font-medium p{font-weight:500}.\[\&_p\]\:leading-\[1\.6\] p{line-height:1.6}.\[\&_p\]\:text-foreground p{color:oklch(var(--foreground-color))}.\[\&_p\]\:font-medium p{font-weight:var(--font-medium)}.\[\&_path\]\:fill-foreground path{fill:oklch(var(--foreground-color))}.\[\&_path\]\:\!stroke-quiet path{stroke:oklch(var(--foreground-quiet-color))!important}.\[\&_rect\]\:fill-inverse rect{fill:oklch(var(--foreground-inverse-color))}.\[\&_span\]\:flex span{display:flex}.\[\&_span\]\:size-4 span{width:1rem;height:1rem}.\[\&_strong\:has\(\+br\)\]\:inline-block strong:has(+br){display:inline-block}.\[\&_strong\:has\(\+br\)\]\:pb-2 strong:has(+br){padding-bottom:.5rem}.\[\&_svg\]\:h-auto svg{height:auto}.\[\&_svg\]\:h-full svg{height:100%}.\[\&_svg\]\:w-auto svg{width:auto}.\[\&_svg\]\:w-full svg{width:100%}.\[\&_svg\]\:\!text-super svg{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.\[\&_svg\]\:transition-colors svg{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\[\&_svg\]\:duration-quick svg{transition-duration:75ms;animation-duration:75ms}.hover\:\[\&_svg\]\:text-super svg:hover{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.\[\&_textarea\]\:bg-subtle textarea{background-color:oklch(var(--background-subtle-color))}.\[\&_textarea\]\:bg-subtler textarea{background-color:oklch(var(--background-subtler-color))}.\[\&_textarea\]\:bg-transparent textarea{background-color:transparent}.\[\&_textarea\]\:\!placeholder-quietest textarea::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:\!placeholder-quietest textarea::placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:placeholder\:\!text-quietest textarea::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:placeholder\:\!text-quietest textarea::placeholder{color:oklch(var(--foreground-quietest-color))!important}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .\[\&_textarea\]\:dark\:\!bg-transparent textarea{background-color:transparent!important}}html[data-color-scheme=dark] .\[\&_textarea\]\:dark\:\!bg-transparent textarea{background-color:transparent!important}.\[\&_tr\>td\:first-child\]\:pl-md tr>td:first-child{padding-left:var(--size-md)}.\[\&_tr\>td\:last-child\]\:pr-md tr>td:last-child{padding-right:var(--size-md)}.\[\&_tr\>th\:first-child\]\:pl-md tr>th:first-child{padding-left:var(--size-md)}.\[\&_tr\>th\:last-child\]\:pr-md tr>th:last-child{padding-right:var(--size-md)}@media (hover:hover){.\[\@media\(hover\:hover\)\]\:hover\:bg-super:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.\[\@media\(hover\:hover\)\]\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (prefers-color-scheme: dark){@media (hover:hover){:root:not([data-color-scheme=light]) .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover{color:oklch(var(--foreground-inverse-color))}:is(:root:not([data-color-scheme=light]) .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}}}@media (hover:hover){html[data-color-scheme=dark] .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover{color:oklch(var(--foreground-inverse-color))}:is(html[data-color-scheme=dark] .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}}@media (max-height:680px){.\[\@media\(max-height\:680px\)\]\:hidden{display:none}}@media (max-width:768px){.\[\@media\(max-width\:768px\)\]\:max-w-full{max-width:100%}}hr+.\[hr\+\&\]\:mt-4{margin-top:1rem}td .\[td_\&\]\:table-cell{display:table-cell}.animate-gradient{animation:shine 1.8s linear infinite;background-size:200% auto}@keyframes shine{to{background-position:-400% center}} diff --git a/Ai docs/Perplexity github_files/index-D_VLSpJ3.js.download b/Ai docs/Perplexity github_files/index-D_VLSpJ3.js.download deleted file mode 100644 index 2512846..0000000 --- a/Ai docs/Perplexity github_files/index-D_VLSpJ3.js.download +++ /dev/null @@ -1,1146 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-avoQQ9qh.js","assets/vite-5mULU2Sf.js","assets/agent-5z8MvKWD.js","assets/platform-BgMLKYi3.js","assets/vendors-DV3qWWZf.js","assets/LocationPermissionModal-CJRGUVmC.js","assets/i18n-DQRDcwJs.js","assets/icons-D0b4sn6r.js","assets/react-query-e4IvwtD4.js","assets/platform-components-C5tjHeNv.js","assets/lexical-CQImCj-x.js","assets/mapbox-gl-BYD-OPEL.js","assets/mapbox-gl-B9eh9OLo.css","assets/FileUploadModal-BvFT6lXw.js","assets/capabilities-BVuvQB3C.js","assets/useFileDirectory-NyIQT0xv.js","assets/Progress-BtQ3_JhN.js","assets/CometDownloadInstructionsModal-C-u2fo9U.js","assets/SheetModal-B9rXmJEc.js","assets/CollectionSelectModal-chyGMqqe.js","assets/OnboardingModal-BBLBP53x.js","assets/CombinedPaywall-vVyfz7dZ.js","assets/useNavigateToPayment-Wh_0XmPu.js","assets/usePersistentPromoCode-CzuUT5P5.js","assets/enterpriseTiers-Cc7wc8Fl.js","assets/tierContent-Dgx0R4JX.js","assets/useUserPreviousSubscriptionQuery-CrWBdZig.js","assets/USDSpan-twhxRp5s.js","assets/useStudentTrialEligibility-B0TbIv7G.js","assets/MarkSpinner-DXbfFXdV.js","assets/phoneNumberUtils-BDcRU5bn.js","assets/IntlPhoneInput-DoZ64EHi.js","assets/IntlPhoneInput-C5Iq5FTb.css","assets/AppDownloadQRSkeleton-RkRp7RBK.js","assets/StudentReferralsContent-DoTGsBdC.js","assets/useStudentReferralRewards-D-COI6zW.js","assets/shared-B6GX8pxj.js","assets/PurchaseConfirmationToast-GzPKwh-L.js","assets/EntityItemImage-C1y80NIC.js","assets/use-unmount-effect-CZOTrSO1.js","assets/ThreadLossAversionModal-D7FcWrP_.js","assets/LoginModalInner-DQdxNxqw.js","assets/test-ids-eafHCGHU.js","assets/cleanQueryRedirect-CvRRoh23.js","assets/CompanyDataPrivacyModal-CBquTxiE.js","assets/PricingTableModal-DKTASYyc.js","assets/MapModal-COz1Z29Z.js","assets/Gallery-d2mk-5Z8.js","assets/ShoppingOnboardingModal-CZLUPf2r.js","assets/shared-xM6KejYo.js","assets/shoppingQueries-CbpDikrQ.js","assets/ShoppingPaymentBillingBox-7aqgEzBg.js","assets/ShoppingPaymentInnerV2-C1VZgAoW.js","assets/react-stripe.esm-811PEoJF.js","assets/useStripePromise-lj-Rbxxy.js","assets/useCreateSetupIntentAndCustomerSession-r-pTEMnk.js","assets/ShoppingQuantityRow-BrpBxWdq.js","assets/Shimmer-Z6sujZt4.js","assets/PurchaseDetailsModal-CkTv7i6n.js","assets/SpaceSettingsModal-D32x8BuZ.js","assets/MemoryListModal-3QH1KayA.js","assets/memoryQueries-CL8cFyOl.js","assets/MemoryDetailModal-tGdhFYPy.js","assets/HotelRoomDetailsModal-Bs6UfaTm.js","assets/PaymentModal-DIcb6WXv.js","assets/PaymentPage-BF8dSvTI.js","assets/MeetingDefaultsModal-DJ18fASY.js","assets/AvailabilityModal-B8HOqFPU.js","assets/ProMessageModal--NnvSlnC.js","assets/SubSuccessModal-CEzPkVT6.js","assets/PerksList-BKKe2PhN.js","assets/ReferralErrorModal-D4SrZMEu.js","assets/ReferralSuccessModal-CVtAvfIm.js","assets/IncentiveProModal-B1Baqpf5.js","assets/StudentReferralsModal-CKAfMn6X.js","assets/SheerIDModal-BHYPljec.js","assets/BraintreeSubscriptionModal-2dXzLlVe.js","assets/RestaurantBookingModal-7zq9QxVz.js","assets/PlaceModal-CytEwbsn.js","assets/EntityItemImageFadeCarousel-BkdhRNfv.js","assets/EntityItemReviewSummary-BJySok5l.js","assets/ImageGallery-DtC18vTP.js","assets/SheerIdRedirectModal-BpaodOqj.js","assets/EnterprisePremiumSecureUpgradeModal-DU2i2Qm_.js","assets/ShortcutModal-hkCS-ySA.js","assets/SharepointSiteModal-DEqwxYR7.js","assets/SharepointSiteSelector-Cuy5BYDt.js","assets/MCPServerModal-wufPmNsJ.js","assets/MemberSetTierModal-C5VDUVKx.js","assets/MCPServiceToolsModal-0_CZ4KV7.js","assets/SettingsRow-Dbg4RDov.js","assets/OrgInviteModal-CEe6bRsT.js","assets/OnboardingTOSCheckbox-DHMUQ-a0.js","assets/useSubmitOnboardingProfile-C7MM6x5t.js","assets/RequestAccessModal-CZs8Tpx-.js","assets/SpaceContextModal-CjwpMh-4.js","assets/LoginModal-CfCGpXCO.js","assets/AnnouncementImageModal-CBHVN-fI.js","assets/FullscreenUpsellModal-DNaA4FHU.js","assets/ShoppingTryOnOnboardingModal-D8Kwg3Mf.js","assets/ShoppingTryOnOnboardingComponents-DLAejZUN.js","assets/GeneratedMediaLoader-DrTfsj80.js","assets/useTrackGeneratedAssetView-DZN7Cb6G.js","assets/useShoppingTryOn-ZvBzXc8Y.js","assets/CheckSourcesModal-LvBDDncs.js","assets/GmailModals-D4ZvmFO2.js","assets/EmailAssistantDisconnectWarningModal-DlCptha5.js","assets/CalendarSelectionModal-hTv76Qgh.js","assets/connectorQueries-CIJF5WoR.js","assets/DeleteAllMemoriesModal-Cg09X1Ui.js","assets/DeleteMemoryModal-BXXQVzHz.js","assets/PersonalSearchSettingsMain-CHIO-vMM.js","assets/WatchlistModal-EfLNQ8hw.js","assets/AvatarManagementModal-Dxp419em.js","assets/useGetUserTryOnPhoto-D3VCmnao.js","assets/InstallGateModal-DmQe1ivv.js","assets/DowngradeModal-CpBhw_YR.js","assets/PlanDisplay-DvGyGDWL.js","assets/UpgradeModal-ChNN1wUW.js","assets/SubModalButton-_Knm1my0.js","assets/KeyboardShortcutHelperModal-DNkbHnqh.js","assets/KeyboardShortcutEditorModal-D82pYLUS.js","assets/AskPermissionsModal-D80mi85i.js","assets/DebugStreamSideEffects-CY-uK-QQ.js","assets/DebugDisplay-DVKkb_1m.js","assets/_restricted/restricted-feature-debug-D3x5lJcJ.js","assets/RenderToolbar-CM9FGyO-.js","assets/DebugModeActivator-BYw4GS2i.js","assets/UberOnePromoBanner-CYfGDUlm.js","assets/SiteBanner-DJXVikaa.js","assets/DiscountCodeBanner-l96J_LHj.js","assets/PartnerBanner-BL7xfhwx.js","assets/OrgBillingBanner-F7N-p4UC.js","assets/useOrgBilling-BDB63mka.js","assets/OrgInvitationBanner-CrpdJghk.js","assets/AppBannerUpsell-Bph65qqz.js","assets/CometDownloadBannerUpsell-BTaMxe5H.js","assets/MobileSidebar-C4bvEgiR.js","assets/MicrosoftFilePickerModal-aO6nep6w.js","assets/BoxFilePickerModal--6cVluz-.js","assets/MentionsPlugin-C_MEbdd2.js","assets/AutoLinkPlugin-CfSMttbN.js","assets/LinkPlugin-BKkOS3bN.js","assets/ConnectorsEnableModal-CDHU0y1D.js","assets/VoiceToVoiceModal-BQNxUwE1.js","assets/VoiceToVoiceTopControls-D1mBvJSk.js","assets/useVoiceViewState-CpqlD8o1.js","assets/three-S-EeQeNm.js","assets/index-kR08Osiu.js","assets/SidePDFViewer-B5TcfQVy.js","assets/SearchSideContent-BMG4YjPI.js","assets/SideMeetingTranscriptViewer-B_6wuU1-.js","assets/SlideConverter-DErf2_BF.js","assets/pptxgen.es-RTyDt0G5.js","assets/abap-BiKYM7nu.js","assets/abnf-8KHBl4SU.js","assets/actionscript-BDfgnI_2.js","assets/ada-pT0wE1jT.js","assets/agda-BVgYyS_B.js","assets/al-DYI_knPF.js","assets/antlr4-Dcs8y6-e.js","assets/apacheconf-BeuGc_UW.js","assets/apex-C46QKnqF.js","assets/sql-CJATM1Qp.js","assets/apl-D3CFL3-O.js","assets/applescript-UKM8t7IT.js","assets/aql-JdJXKSA1.js","assets/arduino-Cgk25tM9.js","assets/cpp-BdJVwJpi.js","assets/c-kgVuzdLE.js","assets/arff-BvtRHTjx.js","assets/asciidoc-hH46k-cj.js","assets/asm6502-Ce01JAP9.js","assets/asmatmel-73kokPNV.js","assets/aspnet-DSiaQID1.js","assets/csharp-Cd5Udg29.js","assets/autohotkey-B_uQtKf0.js","assets/autoit-EdcKUAIu.js","assets/avisynth-B5LB8Vdx.js","assets/avro-idl-DFr56LZ2.js","assets/bash-DmK8JH5Y.js","assets/bash-CefCgV5_.js","assets/basic-GQNZVm0I.js","assets/basic-DBS9NaGG.js","assets/batch-q5qLUxNp.js","assets/bbcode-DIQpPCpQ.js","assets/bicep-43qgYCRB.js","assets/birb-WL4Wzs1I.js","assets/bison-DgNGY4MZ.js","assets/bnf-CwU415oh.js","assets/brainfuck-BRUtMqwa.js","assets/brightscript-CvEhDk7S.js","assets/bro-CqltG-l9.js","assets/bsl-DUqbypHr.js","assets/c-N_EB2bYK.js","assets/cfscript-CeuFWGtU.js","assets/chaiscript-YpFdQwm4.js","assets/cil-BTpaFQxw.js","assets/clike-C0ZDHdrY.js","assets/clike-B5tY_8Hg.js","assets/clojure-nHglC_Wr.js","assets/cmake-CkGrNXqP.js","assets/cobol-CpeWJsGx.js","assets/coffeescript-BmyGALDp.js","assets/concurnas-AGPXgTy3.js","assets/coq-B1vh1X6h.js","assets/cpp-BrdR8lzA.js","assets/crystal-DMB1xqN1.js","assets/ruby-DYsn9XfW.js","assets/csharp-Dz-Duhoj.js","assets/cshtml-Dao_x5sm.js","assets/csp-rN0ct5mE.js","assets/css-extras-CH38hCE0.js","assets/css-C3pUjfuw.js","assets/css-CF9HHZb0.js","assets/csv-CMjGkfuc.js","assets/cypher-BSXied6R.js","assets/d-7giuCMwV.js","assets/dart-f2r0fR5P.js","assets/dataweave-BNTQwt_0.js","assets/dax-9u0VVHGx.js","assets/dhall-BnOlrm1O.js","assets/diff-CbyOnxIb.js","assets/django-BoROLrA7.js","assets/markup-templating-BxAVv-bL.js","assets/dns-zone-file-BZz70gag.js","assets/docker-DDluW8dt.js","assets/dot-qujU4Da1.js","assets/ebnf-CcQ_JImo.js","assets/editorconfig-BbwhooPy.js","assets/eiffel-B3J5PQxF.js","assets/ejs-W0BSwUjI.js","assets/elixir-DP_8UBXK.js","assets/elm-iqtDCABP.js","assets/erb-deIh2UEF.js","assets/erlang-4tX_bnUx.js","assets/etlua-CWJxZlBl.js","assets/lua-DER4jxlW.js","assets/excel-formula-BQj21DBh.js","assets/factor-BH7igz5o.js","assets/false-Qh-wnXyD.js","assets/firestore-security-rules-CKhRlNBp.js","assets/flow-DJdu3gfB.js","assets/fortran-BHu4hUHY.js","assets/fsharp-BiNyUor_.js","assets/ftl-D6bVz-y_.js","assets/gap-DjhzPH1Z.js","assets/gcode-DJBtEOur.js","assets/gdscript-C_X-7y6o.js","assets/gedcom-CH5a7-zs.js","assets/gherkin-CLD9Z44w.js","assets/git-DirbeLrE.js","assets/glsl-DwU_K1Bf.js","assets/gml-CQQxmZvv.js","assets/gn-wrWPxerG.js","assets/go-module-CjFP3WFY.js","assets/go-ZYzi8OLl.js","assets/graphql-BcLwhGtH.js","assets/groovy-DumHeXpg.js","assets/haml-CqSzOsbr.js","assets/handlebars-Bry2_rsG.js","assets/haskell-yUNIp-7d.js","assets/haskell-Ds42Eazu.js","assets/haxe-Dp4DyQmv.js","assets/hcl-B5qkLEyl.js","assets/hlsl-DrSY44_J.js","assets/hoon-CkQC4q2d.js","assets/hpkp-riVsYbz6.js","assets/hsts-DpYC61yC.js","assets/http-Dx-uCaT1.js","assets/ichigojam-B7XQrlmu.js","assets/icon-fmySfNA1.js","assets/icu-message-format-Oq1AuWLS.js","assets/idris-BBQY5hR_.js","assets/iecst-BXBc121A.js","assets/ignore-Btt-DzVm.js","assets/inform7-BOWBWzGd.js","assets/ini--jhBb2pg.js","assets/io-D2xfJyua.js","assets/j-DzsdI1Bx.js","assets/java-s-m7kerV.js","assets/java-BxMbkJZ_.js","assets/javadoc-BjkiGsEF.js","assets/javadoclike-myFApC35.js","assets/javadoclike-DCDpBfFy.js","assets/javascript-C5bRWOCC.js","assets/javascript-D8vYUPHd.js","assets/javastacktrace-D8SvwBYG.js","assets/jexl-CuibVysa.js","assets/jolie-G2r1IH4x.js","assets/jq-CSp-T5V6.js","assets/js-extras-DzfpmWre.js","assets/js-templates-deUmuJZ-.js","assets/jsdoc-CzzeaHoB.js","assets/typescript-CVO-8GEc.js","assets/json-DkUPYY4u.js","assets/json-BESjz4hO.js","assets/json5-kaAIKBom.js","assets/jsonp-NFZGtYU-.js","assets/jsstacktrace-z4GMPjy-.js","assets/jsx-CHRn7QrA.js","assets/jsx-CWP8P1mH.js","assets/julia-CtD-2MpL.js","assets/keepalived-CFt0jL3j.js","assets/keyman-B9DoVDwq.js","assets/kotlin-Dq-NDvL5.js","assets/kumir-CJqEisv6.js","assets/kusto-BgQKkaWx.js","assets/latex-BT8SOs-A.js","assets/latte-C8JT4Qb7.js","assets/php-iTdQntIy.js","assets/less-BD_NHSLb.js","assets/lilypond-AQaE6Na0.js","assets/scheme-Cscf027c.js","assets/liquid-y7RSJ3Wl.js","assets/lisp-BC_0scWg.js","assets/livescript-iy-NHZ_h.js","assets/llvm-BfiEgsxO.js","assets/log-cps16LLM.js","assets/lolcode-3zmtClDS.js","assets/lua-DI565xS0.js","assets/magma-ba7Qn7K1.js","assets/makefile-BqSQ4nmN.js","assets/markdown-Cze8MKhj.js","assets/markup-templating-C-QmJhjg.js","assets/markup-Dt-xKA80.js","assets/markup-BONeskWm.js","assets/matlab-CacUYSDq.js","assets/maxscript-Cm15dTB4.js","assets/mel-BFRmaBUW.js","assets/mermaid-_TlUmfQf.js","assets/mizar-BoN7zgqH.js","assets/mongodb-Do1oT-rg.js","assets/monkey-DS3nr7fk.js","assets/moonscript-Cwqh5x__.js","assets/n1ql-BgI_6bQf.js","assets/n4js-oXh14UQA.js","assets/nand2tetris-hdl-CGF6E--X.js","assets/naniscript-Dv0ErN1f.js","assets/nasm-CdhriaSD.js","assets/neon-6Qw1Wpr8.js","assets/nevod-Do308_dN.js","assets/nginx-CioVUANG.js","assets/nim-BiZFPqzz.js","assets/nix-DLWyfiVz.js","assets/nsis-B_mA8Mf4.js","assets/objectivec-CFn4OO_F.js","assets/ocaml-B365KzYr.js","assets/opencl-CPm34rhj.js","assets/openqasm-CDj9ArmH.js","assets/oz-BYXLbj-G.js","assets/parigp-D0QktAhQ.js","assets/parser-qO2_EI6v.js","assets/pascal-De5eNwWX.js","assets/pascaligo-Bf8O7ebQ.js","assets/pcaxis-BcwaB2L7.js","assets/peoplecode-Dk2Gnb3n.js","assets/perl-DRKm4LVK.js","assets/php-extras-DBoPtocT.js","assets/php-BSKv2GXV.js","assets/phpdoc-BJjHK9Yc.js","assets/plsql-Bb_hLNuA.js","assets/powerquery-C5qk80xF.js","assets/powershell-BG0DpRp-.js","assets/processing-w7DFlyH_.js","assets/prolog-B2BVxulM.js","assets/promql-B3KvaVJb.js","assets/properties-BE8Ews0J.js","assets/protobuf-CBHBbdUG.js","assets/psl-aD6jMMeP.js","assets/pug-DI-93Lan.js","assets/puppet-DxN-4n9f.js","assets/pure-_2x0TJjK.js","assets/purebasic-C8Ir77ii.js","assets/purescript-DWCP7Rhr.js","assets/python-B3k5tM49.js","assets/q-LJLqXf0_.js","assets/qml-DgsxaMQP.js","assets/qore-DumyY0ow.js","assets/qsharp-ClAsZa-1.js","assets/r-DHwkVKGw.js","assets/racket-DcBksMCk.js","assets/reason-BXtuBfki.js","assets/regex-Bmn5L_4e.js","assets/rego-CZsdWqMW.js","assets/renpy-XPjsxRDO.js","assets/rest-DD2JcNUu.js","assets/rip-B2ScZnvu.js","assets/roboconf-XMvWjvgI.js","assets/robotframework-BivGgTMI.js","assets/ruby-DQG1k7eY.js","assets/rust-CY08bKn6.js","assets/sas-1PTlKbzw.js","assets/sass-RllDMjGg.js","assets/scala-D1OpbE39.js","assets/scheme-BbtNtDr-.js","assets/scss-DgCxV9gf.js","assets/shell-session-1LvomK4i.js","assets/smali-CXX5Nw4b.js","assets/smalltalk-CkWNQdr2.js","assets/smarty-D9yobX_8.js","assets/sml-CtZ57qc6.js","assets/solidity-CkABSbax.js","assets/solution-file-K7E94G8T.js","assets/soy-CiMQleff.js","assets/sparql-B28RxTei.js","assets/turtle-Ro1R6Je7.js","assets/splunk-spl-w0Cel-ic.js","assets/sqf-BBYZJCt5.js","assets/sql-CwRJh8Sp.js","assets/squirrel-CEzvQBK5.js","assets/stan-S3CZTrL_.js","assets/stylus-BG4_ZnaL.js","assets/swift-ByheDo_6.js","assets/systemd-6CBk_Ow2.js","assets/t4-cs-DHZvgPUG.js","assets/t4-templating-B5EzSFYT.js","assets/t4-templating-DUeWWaCj.js","assets/t4-vb-B_6qRhT8.js","assets/vbnet-BhrUc4aD.js","assets/tap-DjTT3CuE.js","assets/yaml-pHjxJgpq.js","assets/tcl-BM9U6SkZ.js","assets/textile-XOvB5RBz.js","assets/toml-BO0aGyy4.js","assets/tremor-Bk9M5xQH.js","assets/tsx-BcjbSAGh.js","assets/tt2-BHaQqFiG.js","assets/turtle-CdxJK1CJ.js","assets/twig-CxFOkn0v.js","assets/typescript-CVqiKcu1.js","assets/typoscript-spRf2Ox1.js","assets/unrealscript-D2PIC4ZQ.js","assets/uorazor-xrDEXG6p.js","assets/uri-CwPh3EwT.js","assets/v-CJIzMR4B.js","assets/vala-WpTbVsFT.js","assets/vbnet-UNQqH4vF.js","assets/velocity-DsPfPeeX.js","assets/verilog-NpK4_zqq.js","assets/vhdl-DiFKlg1X.js","assets/vim-SyhS9sNH.js","assets/visual-basic-DSiTvEtK.js","assets/warpscript-CTRBwGjg.js","assets/wasm-CBCDYs2M.js","assets/web-idl-BfdeEL3H.js","assets/wiki-CouGhrmq.js","assets/wolfram-CejGEkud.js","assets/wren-BTo1kC3F.js","assets/xeora-mFujPPPh.js","assets/xml-doc-DpZbWR7e.js","assets/xojo-C9xNSycu.js","assets/xquery-C7CsuD6b.js","assets/yaml-DxQv1G_M.js","assets/yang-BXpPxQeP.js","assets/zig-KxZlFBGb.js","assets/core-ChuWtB-i.js","assets/CitationModal-Czu54JG6.js","assets/GroupedCitationModal-iRDkKRir.js","assets/index-Dg6q9Si7.js","assets/katex-CmGQIWW6.js","assets/katex-DIrX_gBg.css","assets/ProgressHeader-C6EaFoVg.js","assets/FinanceScreenshotBuilderModal-BL5wJen7.js","assets/HourlyTemperature-Cb7yWjaM.js","assets/index-CjrpMxgd.js","assets/ConnectorAuthorizationPrompt-W74w80u2.js","assets/ThreadEntryFooter-C2ACX__g.js","assets/StructuredAnswerInlineBlock-CpPS41s5.js","assets/useFailedImagesStore-BWvgqK_c.js","assets/CarouselPrimitives-CVHe36v3.js","assets/useShoppingWidget-BmGcPD6R.js","assets/useInViewEffect-CLWvwq83.js","assets/TimeAgoTooltip-B9EUDf5Y.js","assets/ReportModal-DObKjV8t.js","assets/useUpdateThreadAccess-BLhaI3zl.js","assets/Related-C29vANZf.js","assets/RelatedQueryList-C3FsxSMv.js","assets/index-Blwo1ToS.js","assets/StudyModeRelated-Dy_zxdoW.js","assets/ThreadContentResponse-DxwJeMuW.js","assets/AnswerComparisonModal-DYnELi4M.js","assets/ThreadEntryDebugTiming-qoiCHgUu.js","assets/DebugModal-CnQSSY34.js","assets/ShoppingMode-q3eSRhKN.js","assets/useGenerativeRefinement-DO9SPjVt.js","assets/ModesNullState-D-iHQZlU.js","assets/HotelsMode-rYYctIE3.js","assets/SharedAnswerModeMap-nzYVpPRj.js","assets/JobsMode-JXrdyUQd.js","assets/VideosMode-Hf9Cgtle.js","assets/useMediaSearch-CZXCjoDU.js","assets/ImagesMode-Bcsp5jfV.js","assets/MapsMode-DBIttjNw.js","assets/AssetsMode-7Ja3lHRt.js","assets/VoiceToVoiceContent-BLVFdoql.js","assets/VoiceToVoiceFloating-DZo4d0io.js"])))=>i.map(i=>d[i]); -import{g as mr,P as bU,C as ffe,e as Wa,l as Z,R as yn,n as mfe,p as a7,r as Ft,f as pfe,h as fn,j as i7,k as hfe,m as _U,o as Pl,q as wU,t as $p,v as lo,w as On,S as _a,x as CU,y as gfe,z as l7,A as BS,B as vt,D as Ju,E as SU,$ as Vi,G as Rn,H as yfe,I as EU,J as Pe,F as kU,K as xfe,M as vfe,N as bfe,c as At,O as Ce,Q as Se,T as _fe,U as wfe,u as Qi,V as Cfe,W as Hc,X as Hi,Y as ou,L as yt,Z as Un,_ as Sfe,a0 as Efe,a1 as By,a2 as kfe,a3 as Mfe,a4 as Tfe,a5 as Afe,a6 as Nfe,a7 as Rfe,a8 as Dfe,a9 as jfe,aa as c7,ab as u7,ac as Ife,ad as Pfe,ae as d7,af as f7,ag as MU,ah as Ofe,ai as oM,aj as Lfe,ak as m7,al as Ffe,am as Bfe,an as Ufe,ao as TU,ap as AU,aq as ed,ar as Vfe,as as NU,at as Hfe,a as zfe,au as Wfe,av as Gfe,aw as A0,ax as $fe,ay as p7,b as qfe,az as Kfe}from"./platform-BgMLKYi3.js";import{R as A,r as d,m as wf,j as l,q as Cf,n as Cr,v as Xi,u as Yfe,w as Qfe,x as Xfe,a as aM,_ as Sr,c as qe,o as Ao,y as Zfe,z as Jfe,A as h7,d as z,e as zh,b as RU,h as DU,B as jU,C as eme,t as px,D as tme,E as no,F as Uy,G as Wh,H as Gh,l as nme,I as yd,J as g7,K as rme}from"./vendors-DV3qWWZf.js";import{_ as q,g as uo,c as td,a as $h}from"./vite-5mULU2Sf.js";import{A as he,u as mt,Q as be,c as IU,k as Wl,a as Yt,b as Rt,d as PU,e as iM,P as sme,f as ome}from"./react-query-e4IvwtD4.js";import{c as ame,_ as ime,S as lme,u as sn,s as cme,r as No,a as hx,i as OU,M as ume,b as dme,d as Gl,E as Mr,R as LU,P as fme,C as mme,A as pme,T as hme,I as rn,e as gme,G as yme,f as Vs,g as Sn,h as qp,j as Js,k as Et,l as ls,m as rt,n as fo,o as Sf,p as gx,q as yx,t as Hr,v as xx,w as zc,D as vx,x as lM,y as xme,z as cM,B as Ro,L as Vy,F as bx,H as wa,J as Fo,K as _x,N as uM,O as Bo,Q as vme,U as bme,V as FU,W as wt,X as _me,Y as wme,Z as N0,$ as Cme,a0 as Sme,a1 as dM,a2 as BU,a3 as Eme,a4 as UU,a5 as VU,a6 as kme,a7 as HU,a8 as Mme,a9 as Tme,aa as Ame,ab as Nme,ac as y7,ad as Rme,ae as qh,af as zU,ag as Dme,ah as jme,ai as Ime,aj as fM,ak as WU,al as Pme,am as Ome,an as Lme,ao as Fme}from"./platform-components-C5tjHeNv.js";import{g as GU,D as mM,u as J,d as He,a as US,b as Bme,f as $U,c as W,e as Ume,S as p_,s as Vme,h as Hme,M as je,F as h_,i as x7,j as v7,k as zme,l as VS,m as Wme,n as b7}from"./i18n-DQRDcwJs.js";import{a as Gme,b as pM,d as hM,e as $me,$ as B,I as ut,L as hl,T as ge,f as qme,g as gM,h as Kh,i as Kme,j as Yme,c as ci,k as qU,l as Qme,m as Xme,n as Zme,o as yM,p as KU,q as Jme,r as epe,s as YU,t as QU,u as _7,v as tpe,w as npe,x as rpe,y as spe,z as ope,A as ape,B as ipe,C as lpe,D as cpe,E as upe,F as dpe,G as fpe,H as mpe,J as ppe,K as hpe,M as w7,N as C7,O as gpe,P as XU,Q as ype,R as S7}from"./icons-D0b4sn6r.js";import{p as xpe,u as vpe,A as bpe,R as ZU,L as _pe,j as wpe,a as Cpe,T as gl,I as HS,Z as zS,e as g_,K as gm,t as ym,E as Ta,b as Aa,c as E7,f as y_,d as x_,g as vi,y as Spe,m as Epe,h as kpe,i as Mpe,k as k7,_ as Tpe,l as M7,n as T7,o as xm,q as A7,w as N7,P as Ape,r as Npe,s as Rpe,S as R7,x as D7,v as Dpe,z as jpe,B as Ipe,D as Ppe,C as Ope,F as Lpe,G as Fpe,H as Bpe,M as Upe,J as Vpe,N as Hpe,O as zpe,Q as Wpe}from"./lexical-CQImCj-x.js";import"./mapbox-gl-BYD-OPEL.js";(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 o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const Gpe=["grey","teal","brown","maroon","red","orange","gold","yellow","green","blue","purple"],JU=e=>{if(!e)return null;try{const n=JSON.parse(e)?.name;if(n&&Gpe.includes(n))return n}catch{}return null};function $pe(){const e=mr("colorSchemeTheme"),t=mr("colorScheme"),n=JU(e);n&&(document.documentElement.dataset.theme=n),t&&(document.documentElement.dataset.colorScheme=t)}$pe();const qpe=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,eV=A.memo(()=>(d.useEffect(()=>{const e=t=>{t.ctrlKey&&t.preventDefault()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}},[]),null));eV.displayName="ZoomPreventer";const Cn={DEFAULT:1250,LOW:2500,MEDIUM:5e3,HIGH:1e4,VERY_HIGH:3e4,EXTREMELY_HIGH:9e4,NONE:0},$l=2,Qe=e=>{const t=e?.productionMs??Cn.DEFAULT;e?.devMs??Cn.HIGH;const n=e?.clientSideMs??Cn.MEDIUM;return typeof window<"u"?n:t};function Kpe(e){return ame(e)}const de=ime(Kpe);class R0{static getItem(t){try{return window.localStorage.getItem(t)}catch{return null}}static setItem(t,n){try{return window.localStorage.setItem(t,n),!0}catch{return!1}}}function Ne(){const e=d.useContext(lme);if(!e)throw new Error("useSession must be used within a SessionProvider");return e}class Sc extends bU{name="CometError"}const vm={SELECTED:"SELECTED",REVIEWED:"REVIEWED",REVIEWING:"REVIEWING",UNSORTED:"UNSORTED"},v_={HISTORY:"HISTORY",OPEN_TABS:"OPEN_TABS",RECENTLY_CLOSED_TABS:"RECENTLY_CLOSED_TABS"},xd={COPILOT:"COPILOT",ARTICLE:"ARTICLE",NOTEPAD:"NOTEPAD"},tV={MEETING_TRANSCRIPT:"MEETING_TRANSCRIPT"},Qs={LOGIN:"LOGIN",OPEN_PERMALINK:"OPEN_PERMALINK",DOWNLOAD_COMET:"DOWNLOAD_COMET",CREATE_SHORTCUT:"CREATE_SHORTCUT",UPGRADE_TO_ENTERPRISE:"UPGRADE_TO_ENTERPRISE",WAIT_FOR_CANVAS_GENERATION_CONFIRMATION:"WAIT_FOR_CANVAS_GENERATION_CONFIRMATION",WAIT_FOR_BROWSER_AGENT_CONFIRMATION:"WAIT_FOR_BROWSER_AGENT_CONFIRMATION",DAILY_QUESTIONS_FEATURE_ENTRYPOINTS:"DAILY_QUESTIONS_FEATURE_ENTRYPOINTS"},Ns={IN_THREAD:"IN_THREAD",SIDEBAR:"SIDEBAR",MODAL:"MODAL",IN_THREAD_BOTTOM:"IN_THREAD_BOTTOM",IN_THREAD_INPUT:"IN_THREAD_INPUT",SIDE_CARD:"SIDE_CARD",BANNER:"BANNER",COMET_NTP_BANNER:"COMET_NTP_BANNER"},tn={PRO_UPGRADE:"PRO_UPGRADE",SIGN_UP_OR_LOGIN:"SIGN_UP_OR_LOGIN",REWRITE_ANSWER:"REWRITE_ANSWER",PERMALINK:"PERMALINK",CONNECTOR:"CONNECTOR",THREAD_TO_SPACE:"THREAD_TO_SPACE",SET_DEFAULT_BROWSER:"SET_DEFAULT_BROWSER",COMET_DOWNLOAD:"COMET_DOWNLOAD",IMAGE_ANNOUNCEMENT_MODAL:"IMAGE_ANNOUNCEMENT_MODAL",MERGE_AUTH_CONNECTOR:"MERGE_AUTH_CONNECTOR",SHORTCUT_MODAL:"SHORTCUT_MODAL",OPEN_SHEERID_MODAL:"OPEN_SHEERID_MODAL",CONTINUE_GENERATION:"CONTINUE_GENERATION",NO_CANVAS_GENERATION:"NO_CANVAS_GENERATION",SKIP_BROWSER_AGENT:"SKIP_BROWSER_AGENT",ALLOW_BROWSER_AGENT_ONCE:"ALLOW_BROWSER_AGENT_ONCE",ALWAYS_ALLOW_BROWSER_AGENT:"ALWAYS_ALLOW_BROWSER_AGENT",LANGUAGE_LEARNING_FLASHCARDS:"LANGUAGE_LEARNING_FLASHCARDS",LANGUAGE_LEARNING_VOICE_TUTOR:"LANGUAGE_LEARNING_VOICE_TUTOR",VIRTUAL_TRY_ON_ONBOARDING_MODAL:"VIRTUAL_TRY_ON_ONBOARDING_MODAL",COMET_DOWNLOAD_1MO_PRO_INCENTIVE:"COMET_DOWNLOAD_1MO_PRO_INCENTIVE",TOGGLE_SOURCES:"TOGGLE_SOURCES",FULLSCREEN_MODAL:"FULLSCREEN_MODAL",ALLOW_CONNECTOR_AUTH:"ALLOW_CONNECTOR_AUTH"},bm={PRIMARY_COLOR:"PRIMARY_COLOR",SECONDARY_COLOR:"SECONDARY_COLOR",MAX_COLOR:"MAX_COLOR",INVERTED:"INVERTED"},Pr={STATUS_UNSPECIFIED:"STATUS_UNSPECIFIED",PENDING:"PENDING",COMPLETED:"COMPLETED",FAILED:"FAILED",STAGED:"STAGED",REWRITING:"REWRITING",RESUMING:"RESUMING",BLOCKED:"BLOCKED"},WS={NONE:"NONE",INCOGNITO:"INCOGNITO"},Z2t={FULL:"FULL",STREAMING:"STREAMING"},Jo={IN_PROGRESS:"IN_PROGRESS",DONE:"DONE"},J2t={FINANCE:"FINANCE"},ext={CALENDAR_EVENT:"CALENDAR_EVENT",PLACE_CARD:"PLACE_CARD",SHOPPING_CARD:"SHOPPING_CARD",CALENDAR_ACTION:"CALENDAR_ACTION",MOVIE_TV_CARD:"MOVIE_TV_CARD",BROWSER_AGENT_CONFIRMATION:"BROWSER_AGENT_CONFIRMATION"},aa={SELECTION_STATUS_UNSPECIFIED:"SELECTION_STATUS_UNSPECIFIED",UNSELECTED:"UNSELECTED",SELECTED:"SELECTED",TIE:"TIE"},hs={ANSWER_MODE_TYPE_UNSPECIFIED:"ANSWER_MODE_TYPE_UNSPECIFIED",HOTELS:"HOTELS",SHOPPING:"SHOPPING",JOBS:"JOBS",IMAGE:"IMAGE",VIDEO:"VIDEO",ANSWER:"ANSWER",SOURCES:"SOURCES",MAPS:"MAPS",ASSETS:"ASSETS",APPS:"APPS",SEARCH:"SEARCH",CHAT:"CHAT"},at={CODE_ASSET:"CODE_ASSET",CHART:"CHART",CODE_FILE:"CODE_FILE",APP:"APP",GENERATED_IMAGE:"GENERATED_IMAGE",GENERATED_VIDEO:"GENERATED_VIDEO",PDF_FILE:"PDF_FILE",SLIDES:"SLIDES",DOCX_FILE:"DOCX_FILE",XLSX_FILE:"XLSX_FILE",QUIZ:"QUIZ",FLASHCARDS:"FLASHCARDS",DOC_FILE:"DOC_FILE"},Ype={MCP_SERVER_TYPE_LOCAL:"MCP_SERVER_TYPE_LOCAL"},txt={PENDING:"PENDING"},b_={BROWSER_HISTORY:"BROWSER_HISTORY",OPEN_TAB:"OPEN_TAB",RECENTLY_CLOSED_TAB:"RECENTLY_CLOSED_TAB"};function xM(){const e=Us();return e?!e.device_id:!1}function An(){return!!(Us()&&!xM())}function Do(){const e=Us();return!!(e?.android_version||e?.ios_version)}function nV(){const e=mr(ffe);if(e)try{return JSON.parse(e)}catch{return}}const Us=wf(nV,()=>Math.floor(Date.now()/(6*1e4))),Qpe=(e,t="selected_by_user_text")=>e?` -<${t}> -${new Date(e.timestamp).toLocaleString()} -${e.text} -`:"",Xpe=(e,t,n,r)=>{if(!e)return[];const s=t.actions.getUserSelection(),o=Qpe(s),a=[];if(n.status==="fulfilled"){const i=n.value?.contents||(n.value?.content?[n.value.content]:[]);for(const{markdown:c="",url:u="",title:f="",og_meta:m={},pdp_data:p,id:h}of i){const g=o;a.push({content:[c.slice(0,r-g.length)+g],url:u,title:f,content_type:"markdown",content_origin:"current_tab",og_title:m?.title,og_description:m?.description,pdp_data:p,tab_id:String(h)})}}else a.push({content:[],url:t.sidecarSourceTab.url,title:t.sidecarSourceTab.title,tab_id:String(t.sidecarSourceTab.tabId),content_type:"markdown",content_origin:"current_tab"}),t.sidecarSourceTab.secondaryTab&&a.push({content:[],url:t.sidecarSourceTab.secondaryTab.url,title:t.sidecarSourceTab.secondaryTab.title,tab_id:String(t.sidecarSourceTab.secondaryTab.tabId),content_type:"markdown",content_origin:"current_tab"});return a},Zpe=(e,t,n)=>{const r=[];return e.forEach(s=>{const o=t.status==="fulfilled"&&t.value.contents?.find(a=>a.id===s.id);if(!o){r.push({tab_id:String(s.id),content:[],url:s.url,title:"",content_type:"markdown",content_origin:"open_tab"});return}r.push({tab_id:String(o.id),content:[(o.markdown??"").slice(0,n)],url:o.url??"",title:o.title??"",content_type:"markdown",content_origin:"open_tab",og_title:o.og_meta?.title,og_description:o.og_meta?.description,pdp_data:o.pdp_data})}),r},Jpe=e=>e.map(({url:t,title:n,snippet:r,site_name:s,sitelinks:o})=>({url:t,title:n,snippet:r,is_navigational:!0,site_name:s??null,sitelinks:o?.map(({title:a,url:i,snippet:c})=>({title:a,url:i,snippet:c??null}))??null})),rV=async({clientPayloadCacheKey:e,cometBrowser:t,maxChars:n,includeSidecar:r,attachedTabs:s,reason:o,cometState:a,requestId:i,navigationResults:c=[]})=>{if(!t)return;const u=[],f=new Set,m=Us(),p={contextType:"runtime",queryContextTimeMs:0,processContextTimeMs:0,getNavigationItemsTimeMs:null,filteredItemsCount:null,version:m.browser_version,mainExtVersion:m.agent_extension_version},h=Wa({context_type:p?.contextType,browser_version:p?.version,main_ext_version:p?.mainExtVersion,content_type:p?.contentType});try{Z.info("fetching sidecar context",{request_id:i});const[g,y]=await Promise.allSettled([r?t.GetSidecarContext({key:e,request_id:i}):Promise.resolve(void 0),s.length?t.GetContent({key:e,pages:[...s],request_id:i}):Promise.resolve({contents:[]})]);Xpe(r,a,g,n).forEach(_=>{const w=_.tab_id??"-1";f.has(w)||(f.add(w),u.push(_))}),s.length&&Zpe(s,y,n).forEach(w=>{const S=w.tab_id??"-1";f.has(S)||(f.add(S),u.push(w))}),p.queryContextTimeMs=performance.now()-h.getStartTimeFromTimeOrigin(),Z.info("sending sidecar context",{request_id:i});const{error:v,response:b}=await de.POST("/rest/browser/client_payload",o,{backOffTime:100,numRetries:2,timeoutMs:Cn.HIGH,body:{client_payload_cache_key:e,client_context:u||[],...c.length>0&&{client_search_results:Jpe(c)},metadata:p},headers:{[yn]:i}});if(h.addTiming("browser.client_context.overall_time_ms"),v)throw new he("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:e},cause:v,status:b.status??0})}catch(g){Z.error("Error sending client payload for cache key ",e,g,{request_id:i})}},ehe=async({url:e,cometBrowser:t,stepUuid:n,extraHeaders:r,reason:s})=>{const o=t.openTab({url:e,key:n,request_id:r[yn]});await Ti(o,n,r,s)},Y1=async(e,t,n)=>{try{const{error:r,response:s}=await de.POST("/rest/browser/tool_failure",n,{body:{client_payload_cache_key:e.clientPayloadCacheKey,error_type:e.errorType,error_msg:e.errorMsg},backOffTime:100,numRetries:2,headers:t,timeoutMs:Cn.MEDIUM});if(r)throw new he("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:e.clientPayloadCacheKey},cause:r,status:s.status??0})}catch(r){Z.error("Error while sending a failure of tool",r,{request_id:t[yn]})}},Ti=async(e,t,n,r)=>{try{const s=await e,{error:o,response:a}=await de.POST("/rest/browser/tool_result",r,{body:{client_payload_cache_key:t,payload:s},backOffTime:100,numRetries:2,headers:n,timeoutMs:Cn.MEDIUM});if(o)throw new he("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:t},cause:o,status:a.status??0})}catch(s){const a=s&&s.message||`sendToolResult error: ${s}`,i="errorType"in s?s:{errorType:"unhandled",errorMsg:a};return Z.error("Error while sending tool result",i.errorType,i.errorMsg,{request_id:n[yn]}),Y1({clientPayloadCacheKey:t,...i},n,r)}},GS={red:"red",maroon:"blue",orange:"cyan",teal:"green",grey:"grey",brown:"orange",green:"pink",gold:"purple",purple:"red",blue:"yellow"},j7=Object.fromEntries(Object.entries(GS).map(([e,t])=>[t,e])),sV=e=>j7[e]??j7.grey;async function the(e,t,n,r,s){const o=Promise.allSettled(e.map(async a=>t.groupTabs({tabIds:a.tab_ids,collapsed:a.collapsed,color:GS[a.color]??GS.grey,groupId:a.group_id,title:a.title},n,r[yn]??"unknown"))).then(a=>({groups:a.map(i=>{if(i.status=="fulfilled"&&i.value.is_success)return{...i.value.tabGroup,color:sV(i.value.tabGroup.color)}}).filter(i=>i!==void 0)}));await Ti(o,n,r,s)}async function nhe(e,t,n,r,s){const o=t.closeTabs({tabIds:e.tab_ids},n,r[yn]??"unknown");await Ti(o,n,r,s)}async function rhe(e,t,n,r,s){const o={[b_.OPEN_TAB]:v_.OPEN_TABS,[b_.RECENTLY_CLOSED_TAB]:v_.RECENTLY_CLOSED_TABS,[b_.BROWSER_HISTORY]:v_.HISTORY},a=e.browser_content_sources.map(c=>o[c]).filter(Boolean),i=t.SearchBrowser({closed_tabs_max_results:e.max_results,history_max_results:e.max_results,open_tabs_max_results:e.max_results,request_id:r[yn]??"unknown",key:n,queries:Array.isArray(e.queries)?[...e.queries]:[],sources:a,start_time:e.start_time?Date.now()-a7(e.start_time):void 0,end_time:e.end_time?Date.now()-a7(e.end_time):void 0});await Ti(i,n,r,s)}async function I7({result:e,key:t,reason:n}){try{await de.POST("/rest/browser/initial_history_summary",n,{body:{key:t,data:e},backOffTime:100,numRetries:2,timeoutMs:Cn.MEDIUM,headers:{"Content-Type":"application/json"}})}catch(r){Z.error("Error sending client payload for cache key ",r)}}function she({entropyBrowser:e,browserHistorySummaryNumDays:t,browserHistorySummaryMaxResults:n,reason:r}){const{addTiming:s}=Wa(),o=crypto.randomUUID();return e.getInitialHistorySummary(o,t,n).then(a=>{s("web.frontend.comet_history_summary_v2"),I7({result:a,key:o,reason:r})}).catch(()=>{I7({result:{open_tabs_results:[],history_results:[],closed_tabs_results:[]},key:o,reason:r})}),o}const ohe=async({entropyBrowser:e,url:t})=>{const n=await e.getQuickActions("get-quick-actions-for-sidecar-suggests");return n.is_success?n.buttons.map(({prompt:r})=>({query:r,image:Kp(t)})):[]},ahe=/^\w+:\/\//;let Q1=null;const ihe=()=>{if(!An()||Q1!==null)return;const e=new Image;e.onerror=()=>{Q1=!1,console.warn("[Comet] chrome://favicon/ is not supported. Using our backend as fallback.")},e.onload=()=>{Q1=!0},e.src="chrome://favicon/"},Kp=(e,t=64,n="3x")=>{if(!Q1)return`https://www.perplexity.ai/rest/browser/favicon?url=${mfe(e)}`;const r=ahe.test(e)?e:`https://${e}`;let s;try{s=decodeURIComponent(r)}catch{s=r}const o=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/'/g,"\\'").replace(/\s/g,"\\ ");return`chrome://favicon/size/${t}@${n}/${o}`},dp=(e,t)=>t.dxt_name?e?.find(n=>n.name===t.dxt_name)?.manifest:void 0,ro=(e,t)=>t?[e,t].sort().join("-"):e.toString(),lhe=(e,t)=>t?[ro(e,t),e.toString(),t.toString()]:[e.toString()],che=["homepage_widget","comet_magic_link","comet_quick_action","comet_selection","try-assistant","comet_assistant_popup","try-assistant-onboarding","spotlight"],vM=e=>e?che.includes(e):!1,uhe={personal_search:!1,skip_search:!1,widget_type:"GENERAL",hide_nav:!1,image_generation:!1,time_widget:!1,hide_sources:!1,mhe_predictions:{skip_search:!1,image_generation_intent:!1,time_widget:!1,sports_intent:!1,places_search_intent:!1,shopping_intent:!1,movie_lists_intent:!1,image_preview:!1,video_preview:!1,nav_intent:!1,study_intent:!1,personal_search:!1,weather_widget:!1,finance_widget_gating:!1,calculator_widget:!1,comet_nav_widget:!1,comet_nav_widget_combined_target:!1},mhe_predictions_full:{skip_search:{is_true:!1,probability:0,threshold:0},image_generation_intent:{is_true:!1,probability:0,threshold:0},time_widget:{is_true:!1,probability:0,threshold:0},sports_intent:{is_true:!1,probability:0,threshold:0},places_search_intent:{is_true:!1,probability:0,threshold:0},shopping_intent:{is_true:!1,probability:0,threshold:0},movie_lists_intent:{is_true:!1,probability:0,threshold:0},image_preview:{is_true:!1,probability:0,threshold:0},video_preview:{is_true:!1,probability:0,threshold:0},nav_intent:{is_true:!1,probability:0,threshold:0},study_intent:{is_true:!1,probability:0,threshold:0},personal_search:{is_true:!1,probability:0,threshold:0},skip_personal_search:{is_true:!1,probability:0,threshold:0},weather_widget:{is_true:!1,probability:0,threshold:0},finance_widget_gating:{is_true:!1,probability:0,threshold:0},calculator_widget:{is_true:!1,probability:0,threshold:0},comet_nav_widget:{is_true:!1,probability:0,threshold:0},comet_nav_widget_combined_target:{is_true:!1,probability:0,threshold:0}}},bM=600,dhe=async(e,t=bM)=>{const{data:n}=await de.POST("/rest/browser/classify","mobile_search_injection",{body:{query:e},timeoutMs:t});return n?.results},oV=e=>!e.isFetching&&e.data===!1,fhe=e=>e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button===1,aV=({adapter:e,url:t,reason:n,event:r,onError:s,onSuccess:o,tabId:a,navigationHistory:i})=>{if(!fhe(r)){r.preventDefault();{const c=e.getStore().getState().sidecarSourceTab.tabId;mhe({adapter:e,url:t,reason:n,tabId:c,navigationHistory:i??!0});return}}},mhe=({adapter:e,url:t,reason:n,tabId:r,navigationHistory:s})=>{const o=async()=>{if(r===-1)return!1;try{const i=await e.openTab({tabId:r,request_id:n,url:t,navigation_history:s??!0});if(!i.is_success)return!1;const{result:c}=i;return!(c.url!==t&&!c.url?.includes(t))}catch{return!1}};(async()=>{await o()||window.open(t,"_blank")})()},phe=e=>{const t=e.indexOf("/search");return t!==-1?e.substring(t):e},iV="entropy",hhe="browser_ios",ghe="browser_android",lV=()=>{const e=Us();return e?.ios_version?hhe:e?.android_version?ghe:iV},P7=e=>{const t=Math.floor(e.origin.x),n=Math.floor(e.origin.y),r=Math.floor(e.size.width),s=Math.floor(e.size.height);return`${t}-${n}-${r}-${s}`},Ht={tiny:"tiny",small:"small",regular:"regular",large:"large",xl:"xl",none:"none"};var ft;(function(e){e.RETRY_BUTTON="retryButton",e.PRO_PAGE="proPage",e.SHARE_DROPDOWN="shareDropdown",e.PRICING_TABLE="pricingTable",e.TRY_COPILOT="tryCopilot",e.TRY_RESEARCH="tryResearch",e.TRY_LABS="tryLabs",e.PRO_HOVER_CARD_BUTTON="proHoverCardButton",e.PRO_REASONING_SELECTOR="proReasoningSelector",e.LIBRARY_PAGE="libraryPage",e.SPACES_PAGE="spacesPage",e.SPACES_LANDING="spacesLanding",e.SPACES_TEMPLATES="spacesTemplates",e.DISCOVER_TOPICS="discoverTopics",e.COLLECTIONS="collections",e.SPACES="spaces",e.THREAD_SOCIAL="threadSocial",e.MOBILE_SIGNUP="mobileSignup",e.RELATED_QUERIES="relatedQueries",e.FILE_UPLOAD="fileUpload",e.SPACES_FILE_UPLOAD="spacesFileUpload",e.TRY_PRO="tryPro",e.HOMEPAGE_FREE_PLAN_UPSELL="homepageFreePlanUpsell",e.LOGIN_BUTTON="loginButton",e.SIGNUP_BUTTON="signupButton",e.LOGIN_BUTTON_HEADER="loginButtonHeader",e.SIGNUP_BUTTON_HEADER="signupButtonHeader",e.FLOATING_SIGNUP="floatingSignup",e.SIDEBAR_LOGIN_AD="sidebarLoginAd",e.SIDEBAR_PRO_UPSELL="sidebarProUpsell",e.SIDE_TEXT_PRO_UPSELL="sideTextProUpsell",e.VISITOR_GATE="visitorGate",e.SHARED_THREAD_LOGIN_GATE="sharedThreadLoginGate",e.SHARED_THREAD_INSTALL_GATE="sharedThreadInstallGate",e.REQUEST_ACCESS_LOGIN_GATE="requestAccessLoginGate",e.GENERATE_IMAGE="generateImage",e.PPLX_API_PAGE="pplxApiPage",e.FILES_PAGE="filesPage",e.PURCHASES_PAGE="purchasesPage",e.GOOGLE_ONETAP_HOME="oneTapHome",e.GOOGLE_ONETAP_THREAD="oneTapThread",e.GOOGLE_ONETAP_PAGE="oneTapPage",e.GOOGLE_ONETAP_DISCOVER="oneTapDiscover",e.GOOGLE_ONETAP_UNKNOWN="oneTap",e.ONBOARDING="onboarding",e.EMAIL_ASSISTANT_ONBOARDING="emailAssistantOnboarding",e.EMAIL_ASSISTANT_SETTINGS="emailAssistantSettings",e.NEXTAUTH_SIGNIN_PAGE="nextauthSignInPage",e.DISCOUNT_CODE_BANNER="discountCodeBanner",e.PARTNER_CODE="partnerCode",e.ARTICLE_NEW="articleNew",e.THREAD_TO_ARTICLE="threadToArticle",e.ORG_CREATE="orgCreate",e.ORG_PANEL="orgPanel",e.LOSS_AVERSION_MODAL="lossAversionModal",e.NEW_THREAD_BUTTON="newThreadButton",e.NEW_THREAD_SHORTCUT="newThreadShortcut",e.DISCOVER_BUTTON="discoverButton",e.THREAD_BOOKMARK_BUTTON="threadBookmarkButton",e.PAGE_BOOKMARK_BUTTON="pageBookmarkButton",e.DISCOVER_FEED_BOOKMARK_BUTTON="discoverFeedBookmarkButton",e.BACK_TO_SCHOOL="backToSchool",e.WELCOME_BACK="welcomeBack",e.LEFT_HAND_NAV="leftHandNav",e.SETTINGS="settings",e.PRO_FEATURE_LIMIT_BANNER="proFeatureLimitBanner",e.BUY_FROM_MERCHANT_BUTTON="buyFromMerchantButton",e.FINANCE_WATCHLIST="financeWatchlist",e.DOWNLOAD_COMET="downloadComet",e.GROW_COMET="growComet",e.GROW_COMET_AFFILIATE="growCometAffiliate",e.GROW_COMET_STUDENTS="growCometStudents",e.GROW_COMET_STUDENTS_COUNTRY="growCometStudentsCountry",e.PARTNER_COMET="partnerComet",e.COMET_ONBOARDING="cometOnboarding",e.PROMO_REDEMPTION="promoRedemption",e.CONNECTORS_PAGE="connectorsPage",e.MARKETING_LANDING_PAGE="marketingLandingPage",e.FINANCE_TRANSCRIPT="financeTranscript",e.FINANCE_RESEARCH="financeResearch",e.LJJ_LANDING_PAGE="ljjLandingPage",e.STUDENT_REFERRAL_LANDING_PAGE="studentReferralLandingPage",e.VOICE_TO_VOICE_BUTTON="voiceToVoiceButton",e.PRO_PERKS="proPerks",e.REFERRAL_PAGE="referralPage",e.HOTEL_BOOKING_PAGE="hotelBookingPage",e.SOURCES_VIEW_MORE="sourcesViewMore",e.SPORTS_WATCHLIST="sportsWatchlist",e.IMAGE_GENERATION_IN_THREAD="imageGenerationInThread",e.AUTO_UPGRADE_TO_PRO="autoUpgradeToPro",e.UNSPECIFIED_GENERALIZED_UPSELL="unspecifiedGeneralizedUpsell",e.MILESTONE_ACHIEVED="milestoneAchieved",e.PRO_PERKS_PARTNER_PAGE="proPerksPartnerPage",e.STUDENT_LANDING_PAGE="studentLandingPage",e.TASKS_PAGE="tasksPage",e.MAX_URL_PAYWALL="maxUrlPaywall",e.MODEL_SELECTOR="modelSelector",e.DISCOVER_FEED_LIKE_BUTTON="discoverFeedLikeButton",e.DISCOVER_FEED_DISLIKE_BUTTON="discoverFeedDislikeButton",e.DISCOVER_FEED_TASK_WIDGET="discoverFeedTaskWidget",e.SIDEBAR_BOTTOM_POPOVER="sidebarBottomPopover",e.HOME_SIDEBAR="homeSidebar",e.UPGRADE_MODAL="upgradeModal",e.MAX_PAGE="maxPage",e.COMET_INVITE="cometInvite",e.LOGIN_FOR_COMET_AGENT_QUERIES_IN_THREAD="loginForCometAgentQueriesInThread",e.COMET_AGENT_QUERIES_RATE_LIMITED_IN_THREAD="cometAgentQueriesRateLimitedInThread",e.PRO_UPGRADE_IN_SIDE_HOMEPAGE="proUpgradeInSideHomepage",e.MISSING_OUT_ON_PRO_IN_THREAD="missingOutOnProInThread",e.VIDEO_GENERATION_IN_THREAD="videoGenerationInThread",e.RESEARCH_UPSELL_IN_THREAD="researchUpsellInThread",e.STUDENT_VERIFICATION_UPSELL="studentVerificationUpsell",e.STUDENT_VERIFICATION_PAGE="studentVerificationPage",e.TRY_ASSISTANT_BUTTON="tryAssistantButton",e.COMET_NTP="cometNTP",e.EMAIL_ASSISTANT_GATE="emailAssistantGate",e.ENTERPRISE_BILLING_BANNER="enterpriseBillingBanner",e.ENTERPRISE_MAX_UPSELL="enterpriseMaxUpsell",e.CANVAS_GENERATION_IN_THREAD="canvasGenerationInThread",e.BROWSER_AGENT_CONFIRMATION_IN_THREAD="browserAgentConfirmationInThread",e.CLASSROOM_UPLOAD="classroomUpload",e.CLASSROOM_SPACED_REPETITION="classroomSpacedRepetition",e.ENTERPRISE_UPSELL_URL_HANDLER="enterpriseUpsellUrlHandler",e.PREMIUM_SOURCE_TOOLTIP="premiumSourceTooltip"})(ft||(ft={}));var os;(function(e){e[e.OWNER_ONLY=0]="OWNER_ONLY",e[e.PRIVATE_READ=1]="PRIVATE_READ",e[e.PUBLIC_READ=2]="PUBLIC_READ",e[e.PUBLIC_PUBLISHED=3]="PUBLIC_PUBLISHED",e[e.ORG_READ=4]="ORG_READ",e[e.COLLECTION_READ=5]="COLLECTION_READ"})(os||(os={}));var Ld;(function(e){e.SEARCH_V2_NAVIGATE="search_v2_navigate",e.WEB_RESULTS="web_results",e.COMET="comet"})(Ld||(Ld={}));const nxt={default:{termsOfService:"https://www.perplexity.com/hub/legal/terms-of-service",enterpriseTermsOfService:"https://www.perplexity.com/hub/legal/enterprise-terms-of-service",privacyPolicy:"https://www.perplexity.com/hub/legal/privacy-policy"},"ja-JP":{termsOfService:"https://www.perplexity.com/ja/hub/legal/terms-of-service",privacyPolicy:"https://www.perplexity.com/ja/hub/legal/privacy-policy"}},Ec=4e4,cV=2e3,rxt=8e3,yhe=10,sxt=10,xhe=5e3,vhe=50,O7=10,L7=1024*1024,_M=3,wM=500,ql="2.18",bhe="default",CM="windowsapp",_he="ios",whe="android",F7=["audio/midi","audio/x-midi","application/zip","application/x-tar","application/x-bzip","application/vnd.rar"],SM=[".bash",".bat",".c",".coffee",".conf",".config",".cpp",".cs",".css",".csv",".cxx",".dart",".diff",".doc",".docx",".fish",".go",".h",".hpp",".htm",".html",".in",".ini",".ipynb",".java",".js",".json",".jsx",".ksh",".kt",".kts",".latex",".less",".log",".lua",".m",".markdown",".md",".pdf",".php",".pl",".pm",".pptx",".py",".r",".R",".rb",".rmd",".rs",".scala",".sh",".sql",".swift",".t",".tex",".text",".toml",".ts",".tsx",".txt",".xlsx",".xml",".yaml",".yml",".zsh"],uV=SM.join(","),dV=[".jpeg",".jpg",".jpe",".jp2",".png",".gif",".bmp",".tiff",".tif",".svg",".webp",".ico",".avif",".heic",".heif"],fV=[".mp3",".wav",".aiff",".ogg",".flac",".mp4",".mpeg",".mov",".avi",".flv",".mpg",".webm",".wmv",".3gp"],Che=dV.join(","),mV=[...SM,...dV],She=mV.join(","),Ehe=[...SM,...fV],khe=Ehe.join(","),Mhe=[...mV,...fV],The=Mhe.join(","),oxt="",axt=os.PUBLIC_READ,ixt=os.PRIVATE_READ,B7=os.PRIVATE_READ,lxt="https://chrome.google.com/webstore/detail/perplexity-ai-search/bnaffjbjpgiagpondjlnneblepbdchol",cxt="https://pplx.ai/mac",uxt="https://www.perplexity.com/comet",EM="login-source",U7="login-new",Ahe=4,V7="pplx.tracked_singular_user_subscribed_paying",H7="pplx.tracked_singular_user_subscribed_paying_enterprise",pV=5,dxt="/static/images/file-search-upsell-demo.png",fxt="file-search-upsell-demo",hV="/static/images/data-connectors/factset/factset-avatar.svg",gV="FactSet",yV="/static/images/data-connectors/crunchbase/crunchbase-avatar.svg",Nhe="Crunchbase",Fd="/static/images/data-connectors/wiley/wiley-avatar.svg",Rhe="Wiley API",xV="Wiley",kM="/static/images/data-connectors/cbinsights/cbinsights-avatar.svg",vV="CB Insights",MM="/static/images/data-connectors/pitchbook/pitchbook-avatar.svg",bV="PitchBook",TM="/static/images/data-connectors/statista/statista-avatar.svg",_V="Statista",Dhe="Finance",AM="/static/images/data-connectors/google/google-drive-avatar.svg",wV="/static/images/data-connectors/google/gmail-avatar.svg",jhe="Gmail",NM="Google Drive",wx="/static/images/data-connectors/google/gcal-gmail-avatar.svg",CV="Gmail with Calendar",D0="Microsoft",RM="/static/images/data-connectors/microsoft/onedrive-avatar.svg",DM="OneDrive",jM="/static/images/data-connectors/microsoft/sharepoint-avatar.svg",IM="SharePoint",PM="/static/images/data-connectors/dropbox/dropbox-avatar.svg",OM="Dropbox",Cx="/static/images/data-connectors/box/box-avatar.svg",LM="Box",Sx="/static/images/data-connectors/notion/notion-avatar.svg",FM="Notion",Ex="/static/images/data-connectors/linear/linear-avatar.svg",BM="Linear",kx="/static/images/data-connectors/slack/slack-avatar.svg",UM="Slack (deprecated)",VM="Slack",Mx="/static/images/data-connectors/github/github-avatar.svg",HM="GitHub",Tx="/static/images/data-connectors/asana/asana-avatar.svg",Bd="Asana",Ax="/static/images/data-connectors/atlassian/atlassian-avatar.svg",zM="Atlassian",WM="/static/images/data-connectors/jira/jira-avatar.svg",GM="Jira",$M="/static/images/data-connectors/confluence/confluence-avatar.svg",qM="Confluence",KM="/static/images/data-connectors/microsoft/teams-avatar.svg",YM="Microsoft Teams",SV="submit-query",nd="search-model-change",yl="source-selection-change",z7="panel-visibility",EV="windows-app",mxt=EV,pxt="If4YwAeizGHdB3eOhX2JxYcjeCgy0N9c",Yp=`${EV}/ask/input`,hxt="https://dl.todesktop.com/25020447d4kq915",__="pplx.windowsApp.microphonePermission",Ihe={silenceThreshold:30,silenceDuration:5e3},Hy="pplx.upload-privacy-accepted",kV=["answer_modes","media_items","knowledge_cards","inline_entity_cards","place_widgets","finance_widgets","prediction_market_widgets","sports_widgets","flight_status_widgets","news_widgets","shopping_widgets","jobs_widgets","search_result_widgets","inline_images","inline_assets","placeholder_cards","diff_blocks","inline_knowledge_cards","entity_group_v2","refinement_filters","canvas_mode","maps_preview","answer_tabs","price_comparison_widgets","preserve_latex","in_context_suggestions"],W7=["google_drive","onedrive","sharepoint","dropbox","box"],MV=["google_drive","onedrive","sharepoint","dropbox","box"],TV="Outlook",QM="/static/images/data-connectors/microsoft/outlook-avatar.svg",XM="Zoom",ZM="/static/images/data-connectors/zoom/zoom-avatar.svg",gxt="org-upgrade-in-progress";function Phe(e){const t=new Uint8Array(e);return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("")}async function Ohe(e){const n=new TextEncoder().encode(e);return await crypto.subtle.digest("SHA-256",n)}async function AV(e){const t=await Ohe(e);return Phe(t)}async function Lhe(e){return`match_${await AV(e)}`}const Fhe=async({reason:e})=>{try{const{data:t,error:n}=await de.POST("/rest/attribution/comet/session",e,{timeoutMs:Qe(),numRetries:1});if(n)throw n;return{success:t.success}}catch(t){return Z.error("Failed to start Comet session",t),{success:!1}}},Bhe=async({eventName:e,reason:t})=>{try{const{data:n,error:r}=await de.POST("/rest/attribution/comet/event/{event_name}",t,{timeoutMs:Qe(),params:{path:{event_name:e}}});if(r)throw r;return{success:n?.success??!1}}catch(n){return Z.error("Failed to send Comet event",n),{success:!1}}},NV=Ft("SingularAttributionContext",{sendQueryEventSingular:()=>Promise.resolve(),maybeSendNthQueryEventSingular:()=>Promise.resolve(),sendSubscribedEventSingular:()=>Promise.resolve(),sendAppDownloadClickedEventSingular:()=>Promise.resolve(),sendResurrectedActivationEventSingular:()=>Promise.resolve(),sendCometDownloadPageLoadEventSingular:()=>Promise.resolve(),sendCometDownloadPageSignInEventSingular:()=>Promise.resolve(),sendCometDownloadedEventSingular:()=>Promise.resolve(),sendCometDownloadButtonClickedEventSingular:()=>Promise.resolve(),sendCometWaitlistButtonClickedEventSingular:()=>Promise.resolve(),sendCometDownloadLinkEmailEventSingular:()=>Promise.resolve(),sendSubscribedMaxEventSingular:()=>Promise.resolve(),sendAssistantConnectorClickedEventSingular:()=>Promise.resolve(),sendEmailAssistantTrialEnrolledEventSingular:()=>Promise.resolve(),sendAssistantPaywallPageVisitEventSingular:()=>Promise.resolve(),sendAssistantStartFreeTrialClickedEventSingular:()=>Promise.resolve(),sendAssistantUpgradeToMaxClickedEventSingular:()=>Promise.resolve(),sendAssistantUpgradeToProClickedEventSingular:()=>Promise.resolve(),sendAssistantPaywallDismissedEventSingular:()=>Promise.resolve(),sendAssistantConnectPageVisitEventSingular:()=>Promise.resolve(),sendAssistantGreetingPageVisitEventSingular:()=>Promise.resolve(),sendAssistantCalendarSelectionPageVisitEventSingular:()=>Promise.resolve(),sendAssistantTimeSettingsPageVisitEventSingular:()=>Promise.resolve(),sendAssistantAutoLabelPageVisitEventSingular:()=>Promise.resolve(),sendAssistantAutoDraftPageVisitEventSingular:()=>Promise.resolve(),sendAssistantCompletePageVisitEventSingular:()=>Promise.resolve(),sendAssistantOnboardingEmailSentEventSingular:()=>Promise.resolve(),sendStudyHubPageVisitedEventSingular:()=>Promise.resolve(),sendChatWithTutorClickedEventSingular:()=>Promise.resolve(),sendPracticeQuestionsClickedEventSingular:()=>Promise.resolve(),sendStudyGuideClickedEventSingular:()=>Promise.resolve(),sendFlashcardsClickedEventSingular:()=>Promise.resolve(),sendOnePagerClickedEventSingular:()=>Promise.resolve(),sendSpacedRepetitionClickedEventSingular:()=>Promise.resolve(),sendMaterialsUploadedEventSingular:()=>Promise.resolve(),sendStudyHubActivatedEventSingular:()=>Promise.resolve(),sendThirdStudyHubEngagementEventSingular:()=>Promise.resolve(),sendFifthStudyHubEngagementEventSingular:()=>Promise.resolve(),sendTenthStudyHubEngagementEventSingular:()=>Promise.resolve(),setMatchIdWithEmail:()=>Promise.resolve()}),G7={1:"activated",3:"true activated",5:"quality activated",10:"super activated"},$7={1:"first comet query",3:"third comet query"},Uhe="ai.testing.perplexity",Vhe="ai.perplexity",RV=async(e,t)=>{if(!e)return null;const n=new Date;n.setMilliseconds(0);const r=`${e}-${n.toISOString()}-${t}`;return await AV(r)},Hhe="perplexity_ai_039eb8fb",zhe="1e0179ca95965b57a3e91c1cf3049b64",Whe=async({productId:e,visitorId:t,userId:n})=>{const{SingularConfig:r,singularSdk:s}=await q(async()=>{const{SingularConfig:c,singularSdk:u}=await import("./singular-sdk-C08EBV6K.js").then(f=>f.s);return{SingularConfig:c,singularSdk:u}},[]),o=new r(Hhe,zhe,e);n&&o.withCustomUserId(n),s.init(o);const a="initialized singular",i=await RV(t,a);return s.event(a,{visitorId:t,eventId:i}),s},Ghe=({children:e})=>{const{session:t}=Ne(),n=mr(pfe),{env:{isProduction:r,isStaging:s},device:{isMobile:o}}=sn(),a=d.useRef([]),i=d.useRef([]),c=fn(),[u,f]=d.useState(void 0);d.useEffect(()=>{const y=t?.user?.id,x=r||s?Vhe:Uhe;n&&Whe({userId:y,productId:x,visitorId:n}).then(v=>{!v||(f({sdk:v}),!y||!An())||i7()>1||Fhe({reason:"comet attribution"})})},[r,s,t?.user?.id,n]);const m=d.useCallback(async(y,x)=>{if(!u){a.current.push({name:y,extraArguments:x});return}if(!n)return;const v=await RV(n,y),b={...x,visitorId:n,eventId:v,isMobile:o};i.current.includes(y)||(u.sdk.event(y,b),i.current.push(y))},[u,n,o]),p=d.useCallback(async({isCometBrowser:y})=>{const x=hfe(),v=i7(),b=_U();x&&G7[x]&&await m(G7[x]),v&&$7[v]&&await m($7[v]),y&&b===1&&Bhe({eventName:"activated",reason:"comet attribution"})},[m]),h=d.useCallback(async y=>{if(!u)return;const x=await Lhe(y);u.sdk.setMatchID(x)},[u]),g=d.useCallback(async y=>{await m("user sign in",{isNewUser:y}),t?.user?.id&&u&&u.sdk.login(t.user.id)},[t?.user?.id,u,m]);return d.useEffect(()=>{u&&a.current.length>0&&(a.current.filter((x,v,b)=>v===b.findIndex(_=>_.name===x.name)).forEach(({name:x,extraArguments:v})=>{m(x,v)}),a.current=[])},[u,m]),d.useEffect(()=>{if(c?.get(EM)&&c?.get(U7)){const y=c?.get(U7)==="true";g(y),y?(m("new user sign in"),t?.user?.email&&h(t.user.email)):m("existing user sign in"),An()&&m("comet user sign in")}},[c,g,m,t?.user?.email,h]),d.useEffect(()=>{t?.user?.subscription_tier&&t?.user?.payment_tier==="paid"&&(R0.getItem(V7)||(m("user subscribed paying"),R0.setItem(V7,"true")),t?.user?.subscription_source==="enterprise"&&!R0.getItem(H7)&&(m("user subscribed paying enterprise"),R0.setItem(H7,"true")))},[t?.user?.subscription_tier,t?.user?.payment_tier,t?.user?.subscription_source,m]),l.jsx(NV.Provider,{value:d.useMemo(()=>({sendQueryEventSingular:()=>m("query submitted"),maybeSendNthQueryEventSingular:p,sendSubscribedEventSingular:()=>m("user subscribed"),sendAppDownloadClickedEventSingular:y=>m("app download button clicked",{origin:y}),sendResurrectedActivationEventSingular:()=>m("resurrected activated"),sendCometDownloadPageLoadEventSingular:y=>m(`${y} page loaded`),sendCometDownloadPageSignInEventSingular:y=>m(`${y} page signed in`),sendCometDownloadedEventSingular:()=>m("download-comet comet downloaded"),sendCometDownloadButtonClickedEventSingular:y=>m(`${y} download button clicked`),sendCometWaitlistButtonClickedEventSingular:y=>m(`${y} waitlist button clicked`),sendCometDownloadLinkEmailEventSingular:y=>m(`${y} send download link`),sendSubscribedMaxEventSingular:()=>m("user subscribed max"),sendAssistantConnectorClickedEventSingular:y=>m("assistant connector clicked",{connectorType:y}),sendEmailAssistantTrialEnrolledEventSingular:()=>m("email assistant trial enrolled"),sendAssistantPaywallPageVisitEventSingular:()=>m("assistant paywall page visit"),sendAssistantStartFreeTrialClickedEventSingular:()=>m("assistant start trial clicked"),sendAssistantUpgradeToMaxClickedEventSingular:()=>m("assistant upgrade max clicked"),sendAssistantUpgradeToProClickedEventSingular:()=>m("assistant upgrade pro clicked"),sendAssistantPaywallDismissedEventSingular:()=>m("assistant paywall dismissed"),sendAssistantConnectPageVisitEventSingular:()=>m("assistant connect page visit"),sendAssistantGreetingPageVisitEventSingular:()=>m("assistant greeting page visit"),sendAssistantCalendarSelectionPageVisitEventSingular:()=>m("assistant cal selection visit"),sendAssistantTimeSettingsPageVisitEventSingular:()=>m("assistant time settings visit"),sendAssistantAutoLabelPageVisitEventSingular:()=>m("assistant auto label page visit"),sendAssistantAutoDraftPageVisitEventSingular:()=>m("assistant auto draft page visit"),sendAssistantCompletePageVisitEventSingular:()=>m("assistant complete page visit"),sendAssistantOnboardingEmailSentEventSingular:()=>m("assistant onboarding email sent"),sendStudyHubPageVisitedEventSingular:()=>m("study hub page visited"),sendChatWithTutorClickedEventSingular:()=>m("chat with tutor clicked"),sendPracticeQuestionsClickedEventSingular:()=>m("practice questions clicked"),sendStudyGuideClickedEventSingular:()=>m("study guide clicked"),sendFlashcardsClickedEventSingular:()=>m("flashcards clicked"),sendOnePagerClickedEventSingular:()=>m("one pager clicked"),sendSpacedRepetitionClickedEventSingular:()=>m("spaced repetition clicked"),sendMaterialsUploadedEventSingular:()=>m("materials uploaded"),sendStudyHubActivatedEventSingular:()=>m("study hub activated"),sendThirdStudyHubEngagementEventSingular:()=>m("third study hub engagement"),sendFifthStudyHubEngagementEventSingular:()=>m("fifth study hub engagement"),sendTenthStudyHubEngagementEventSingular:()=>m("tenth study hub engagement"),setMatchIdWithEmail:h}),[m,p,h]),children:e})},JM=()=>{const e=d.useContext(NV);if(!e)throw new Error("useSingularAttribution must be used within SingularAttributionContext");return e};let Mu;async function DV(){return Mu||(Mu=new Promise(e=>{const t=new URL("/ws",window.location.origin);t.protocol="wss:";const n=new WebSocket(t);n.addEventListener("error",()=>{try{n.close()}finally{Mu=void 0}}),n.addEventListener("close",()=>{Mu=void 0}),n.addEventListener("open",()=>{e(n)})}),Mu)}const $he="/rest/event/analytics";function jV(e){return typeof navigator.sendBeacon!="function"?!1:navigator.sendBeacon($he,new Blob([JSON.stringify(e)],{type:"application/json; charset=UTF-8"}))}function IV(){const e={};try{navigator.hardwareConcurrency&&(e.hardwareConcurrency=navigator.hardwareConcurrency);const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const r=n[3];r&&(e.architecture=r),globalThis.screen.colorDepth&&(e.colorDepth=globalThis.screen.colorDepth),globalThis.screen.width&&globalThis.screen.height&&(e.screenSize=`${globalThis.screen.width}x${globalThis.screen.height}`)}catch{}return e}const qhe=IV(),Khe=768,Yhe=`(max-width: ${Khe}px)`;function Qhe(){return typeof window>"u"?!1:window.matchMedia(Yhe).matches}function Xhe(){return Qhe()?"mweb":"web"}const Zhe=(e={},t)=>{const n=Date.now(),r=Xhe(),s={...e,isStandaloneApp:!1,timestamp:n,isBrowserExtension:!1,timeZone:mM,isPro:t?.subscription_status&&t?.subscription_status!=="none",userId:t?.id,deviceInfo:qhe,web_platform:r},o=globalThis.location.pathname+globalThis.location.search,a=!!getComputedStyle(document.documentElement).getPropertyValue("--arc-palette-title"),i=IV();let c;return s.internalReferrer?c=s.internalReferrer:c=document.referrer,(globalThis.matchMedia("(display-mode: standalone)").matches||globalThis.matchMedia("(display-mode: minimal-ui)").matches||globalThis.navigator?.standalone)&&(s.isStandaloneApp=!0),{eventData:s,pathnameAndParams:o,isArcBrowser:a,deviceInfo:i,referrer:c}};function PV(e){const{name:t,data:n,user:r,source:s}=e,{eventData:o,pathnameAndParams:a,deviceInfo:i,referrer:c,isArcBrowser:u}=Zhe(n,r);return a.startsWith("/search/render")?void 0:{event_name:t,event_data:o,url:a,referrer:c,language:GU(),screen:Nx(),hostname:globalThis.location.hostname,device_info:i,is_arc_browser:u,source:s}}function Li(e){const t=PV(e);t&&(jV(t)||(Pl("web.browser.analytics.send_event_failed"),DV().then(n=>{n.send(JSON.stringify(t))})))}function Jhe(e){const t=e.map(n=>PV(n)).filter(n=>n!==void 0);t.length!==0&&(jV(t)||(Pl("web.browser.analytics.send_event_failed"),DV().then(n=>{n.send(JSON.stringify(t))})))}function Nx(){return`${globalThis.screen.width}x${globalThis.screen.height}`}const ege=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)")?.matches?"dark":"light";function tge(){const[e,t]=d.useState(ege);return d.useEffect(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)"),r=s=>{t(s.matches?"dark":"light")};return n?.addEventListener("change",r),()=>{n?.removeEventListener("change",r)}},[]),e}const e4=Ft("ColorSchemeContext",null),w_="colorScheme",OV=A.memo(function({children:t,initialOverrideColorScheme:n}){const r=tge(),{value:s,refetch:o}=wU(w_),[a,i]=d.useState(n),c=d.useMemo(()=>Cf(p=>{const h=p;h?document.documentElement.dataset.colorScheme=h:delete document.documentElement.dataset.colorScheme},100),[]),u=d.useCallback(p=>{p?lo(w_,p):$p(w_),o()},[o]),f=d.useCallback(p=>{i(p)},[i]),m=a??s??r;return d.useEffect(()=>{c(m)},[m,c]),l.jsx(e4.Provider,{value:{colorScheme:m,isSystemColorScheme:!a&&!s,setUserPreferredColorScheme:u,setOverrideColorScheme:f},children:t})});OV.displayName="ColorSchemeProvider";function nge(){return d.useContext(e4)}function Ss(){const e=d.useContext(e4);if(!e)throw new Error("Attempted to access ColorSchemeContext from useColorScheme() without adding to the tree.");return e}const rge=768,LV=`(max-width: ${rge}px)`;function q7(){return typeof window>"u"?!1:window.matchMedia(LV).matches}function ui(e={}){const t=On(),{device:{isWindowsApp:n}}=sn(),r=d.useMemo(()=>!!(n&&t?.includes(Yp)),[n,t]),{evaluateOnInit:s=!1}=e,o=FV(),a=sge(),[i,c]=d.useState(()=>o||a?!0:s?q7():!1);return d.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(LV);function f(){c(u.matches)}return u.addEventListener("change",f),()=>{u.removeEventListener("change",f)}},[o]),d.useEffect(()=>{s||c(q7())},[s]),i&&!r}function FV(e=!1){const{device:{isMobile:t}}=sn();return t??e}function sge(e=!1){const{device:{isAndroid:t}}=sn();return t??e}function Re(e={}){const t=On(),{device:{isWindowsApp:n}}=sn(),r=ui(e),s=d.useMemo(()=>!!(n&&t?.includes(Yp)),[n,t]),o=d.useMemo(()=>r&&!s,[r,s]),a=FV();return d.useMemo(()=>({isMobileStyle:o,isMobileUserAgent:a}),[o,a])}function K7({flag:e,override:t,defaultValue:n,isServer:r=!1}){if(!t)return{shouldUseOverride:!1,value:null};try{if(typeof n=="boolean")return{shouldUseOverride:!0,value:t==="true"};if(typeof n=="number")return{shouldUseOverride:!0,value:Number(t)};if(typeof n=="object")try{return{shouldUseOverride:!0,value:JSON.parse(t)}}catch(s){return Z.warn(`[Eppo ${r?"Server ":""}Override]`,`Failed to parse JSON override for flag "${e}"`,{override:t,error:s}),{shouldUseOverride:!0,value:n}}return{shouldUseOverride:!0,value:t}}catch(s){return Z.error(`[Eppo ${r?"Server ":""}Override] Error:`,s),{shouldUseOverride:!0,value:n}}}let _m;async function oge({apiKey:e,logAssignment:t}){if(_m)return _m;const{init:n}=await q(async()=>{const{init:r}=await import("./index-avoQQ9qh.js").then(s=>s.i);return{init:r}},__vite__mapDeps([0,1]));try{return _m=n({apiKey:e,assignmentLogger:{logAssignment:t}}),await _m,Z.info("[Eppo Experiments] Primary key initialization successful"),_m}catch(r){throw Z.error("[Eppo Experiments] Primary key failed",r),r}}const BV="eppo_overrides",UV="eppo_overrides",age=e=>e?e.endsWith("@perplexity.ai"):!1,ige=e=>{const t={};return e.forEach((n,r)=>{if(r.startsWith("eppo_")){const s=r.replace("eppo_","");t[s]=n??""}}),t},lge=e=>{let t=!0;const n=JSON.stringify(e);try{lo(UV,n)}catch{t=!1}return t=_a.setItem(BV,n),t},cge=(e,t,n)=>{if(typeof window>"u"||n&&!age(e))return!1;const r=ige(t);return Object.keys(r).length===0?!1:lge(r)};function Y7(){try{const e=mr(UV);if(e)return JSON.parse(e);const t=_a.getItem(BV);return t?JSON.parse(t):{}}catch{return{}}}const uge=(e,t)=>{const n=d.useRef(void 0);Cr(n.current,t)||(n.current=t),d.useLayoutEffect(e,[n.current])},dge={getEppoTypedVariationAsync:function(){return Promise.resolve(void 0)},getEppoTypedVariationSync:function(){return null},keysRequiringRerender:[],addKeyRequiringRerender:()=>null,removeKeyRequiringRerender:()=>null},t4=Ft("EppoExperimentsContext",dge),fge="experiment assignment",X1="failed_open_to_default_value";function Q7(e){if(!e||typeof e!="string")return;const t=e.trim();if(t==="")return;const n=t.split("@");if(!(n.length!==2||!n[0]||!n[1]))return n[1]}const mge=(e,t,n,r)=>s=>Li({name:fge,data:{subjectType:s.subjectAttributes.subjectType,pagePropsHostname:r,colorScheme:n,isPerplexityBrowser:e,...s},user:{id:t?.user?.id,subscription_status:t?.user?.subscription_status}});function C_(e){const n=vt.keys().filter(r=>r.startsWith(e));n.length>1&&(Z.warn("[Eppo Experiments] Wiping duplicate Eppo keys",{keys:n}),n.forEach(r=>{vt.removeItem(r)}))}const pge=({children:e,hostname:t,session:n,cfCountry:r})=>{const s=!!n?.user,o=CU(),a=gfe(),i=An(),[c,u]=d.useState([]),{env:{isProduction:f,isStaging:m,deployName:p},device:{isWindowsApp:h}}=sn(),y=f||m?"a2yUBlJ1tebb5g2II8WD1CzbVUszCSk3.ZWg9bnhqMGc3LmUuZXBwby5jbG91ZCZjcz1ueGowZzc":"KphAz1VUxSQKAZxlw1PwMdZNRia-a4B3.ZWg9bnhqMGc3LmUuZXBwby5jbG91ZCZjcz1ueGowZzc",{colorScheme:x}=Ss(),v=d.useRef(void 0),b=fn(),[_,w]=d.useState(!1),{locale:S}=J(),{isMobileStyle:C}=Re(),E=d.useRef(void 0),T=d.useCallback(R=>{mge(i,n,x,t)(R)},[n,i,x,t]);d.useEffect(()=>{if(_||!b)return;cge(n?.user?.email,b,f)&&w(!0)},[b,n?.user?.email,_,f]);const k=d.useCallback(({userId:R,visitorId:P,sessionId:L,subjectType:U,stableId:O,extraAttributes:$,cometDeviceId:G})=>{let H;return O?H=O:U==="user_nextauth_id"?H=R:U==="visitor_id"?H=P??void 0:U==="session_id"?H=L??void 0:U==="context_uuid"?H=$?.context_uuid:U==="comet_device_id"&&(H=G),H},[]),I=d.useCallback(function({flag:R,subjectType:P,isUserLoggedIn:L,stableId:U,userId:O,visitorId:$,sessionId:G,cometDeviceId:H,extraAttributes:Q,defaultValue:Y}){return Math.random()<.01&&Z.error("[Eppo Experiments]","No subject key found",{flag:R,subject_type:P,is_user_logged_in:L,has_stable_id:!!U,has_session_user_id:!!O,has_visitor_id:!!$,has_session_id:!!G,has_context_uuid:!!Q?.context_uuid,has_comet_device_id:!!H,execution_context:typeof window<"u"?"client":"server",document_ready_state:typeof document<"u"?document.readyState:"unknown",eppo_provider_result:X1}),Y},[]),M=d.useCallback(({primaryApiKey:R,logAssignment:P})=>(v.current||(C_("eppo-configuration-"),C_("eppo-configuration-meta-"),C_("eppo-configuration-assignment-"),v.current=oge({apiKey:R,logAssignment:P}),v.current.then(L=>{E.current=L})),v.current),[]),N=d.useCallback(async function(R,{flag:P,subjectType:L,stableId:U,defaultValue:O,extraAttributes:$}){if(L==="user_nextauth_id"&&!s)return O;const G=Us()?.device_id??void 0,H=Do(),Q=i&&!H,Y=k({userId:n?.user?.id,visitorId:o,sessionId:a,subjectType:L,stableId:U,extraAttributes:$,cometDeviceId:G});if(!Y)return I({flag:P,subjectType:L,isUserLoggedIn:s,stableId:U,userId:n?.user?.id,visitorId:o,sessionId:a,cometDeviceId:G,extraAttributes:$,defaultValue:O});const te=Y7(),{shouldUseOverride:se,value:ae}=K7({flag:P,override:te[P],defaultValue:O});if(se)return ae??O;const X=await M({primaryApiKey:y,logAssignment:T});try{const ee=n?.user?.email??void 0,le=Q7(ee);return R(X,P,Y,{subjectType:L,visitorId:o??void 0,sessionId:a??void 0,userEmail:ee,userEmailDomain:le,userId:n?.user?.id??void 0,appApiClient:BS(C,h),cfCountry:r,locale:S,isComet:i,isCometDesktop:Q,isCometMobile:H,deployName:p,cometDeviceId:G,...l7(),...$??{}},O)}catch{return Z.error("[Eppo Experiments] Error calling eppoFn",{flag:P,subjectKey:Y,eppo_provider_result:X1}),O}},[s,i,k,n?.user?.id,n?.user?.email,o,a,y,I,T,C,h,r,S,p,M]),D=d.useCallback(function(R,{flag:P,subjectType:L,stableId:U,defaultValue:O,extraAttributes:$}){if(L==="user_nextauth_id"&&!s)return O;const G=Us()?.device_id??void 0,H=Do(),Q=i&&!H,Y=k({userId:n?.user?.id,visitorId:o,sessionId:a,subjectType:L,stableId:U,extraAttributes:$,cometDeviceId:G});if(!Y)return I({flag:P,subjectType:L,isUserLoggedIn:s,stableId:U,userId:n?.user?.id,visitorId:o,sessionId:a,cometDeviceId:G,extraAttributes:$,defaultValue:O});const te=Y7(),{shouldUseOverride:se,value:ae}=K7({flag:P,override:te[P],defaultValue:O});if(se)return ae??O;if(M({primaryApiKey:y,logAssignment:T}),!E.current)return null;try{const X=n?.user?.email??void 0,ee=Q7(X);return R(E.current,P,Y,{subjectType:L,visitorId:o??void 0,sessionId:a??void 0,userEmail:X,userEmailDomain:ee,userId:n?.user?.id??void 0,appApiClient:BS(C,h),cfCountry:r,locale:S,isComet:i,isCometDesktop:Q,isCometMobile:H,deployName:p,cometDeviceId:G,...l7(),...$??{}},O)}catch{return Z.error("[Eppo Experiments] Error calling eppoFn",{flag:P,subjectKey:Y,eppo_provider_result:X1}),O}},[s,i,k,n?.user?.id,n?.user?.email,o,a,y,I,T,C,h,r,S,p,M]),j=d.useCallback(R=>{u(P=>P.includes(R)?P:[...P,R])},[]),F=R=>{u(P=>P.includes(R)?P.filter(L=>L!==R):P)};return l.jsx(t4.Provider,{value:{getEppoTypedVariationAsync:N,getEppoTypedVariationSync:D,keysRequiringRerender:c,addKeyRequiringRerender:j,removeKeyRequiringRerender:F},children:e})};function Ef(e,t){const n=d.useContext(t4);if(!n)throw new Error("useGetEppoJSONVariation must be used within EppoExperimentsContext");const{getEppoTypedVariationAsync:r,getEppoTypedVariationSync:s}=n,[o,a]=d.useState(void 0),[i,c]=d.useState(()=>{const{skip:h,shortCircuitCases:g,...y}=e;return h?!0:!s(t,y)}),[u,f]=d.useState(()=>{const{skip:h,shortCircuitCases:g,...y}=e;return h?y.defaultValue:s(t,y)??y.defaultValue}),m=d.useRef(e),p=d.useCallback(async()=>{const{skip:h,shortCircuitCases:g,...y}=m.current;try{return r(t,y)}catch(x){return Z.error("[Eppo Experiments]","Error calling getEppoTypedVariationAsync",{flag:y.flag,error:x,eppo_provider_result:X1}),y.defaultValue}},[r,t]);return uge(()=>{m.current=e;const{skip:h,shortCircuitCases:g,...y}=e;if(h){c(!1);return}if(g)for(const{condition:v,result:b}of g)try{if(v()){f(b),c(!1);return}}catch(_){Z.error("[Eppo Experiments] Error evaluating short-circuit case",{flag:y.flag,error:_})}const x=s(t,y);x!==null?(f(x),c(!1)):(c(!0),r(t,y).then(v=>f(v),a).finally(()=>c(!1)))},[r,s,e]),{value:u,loading:i,error:o,fetchVariation:p}}const VV=(e,...t)=>e.getJSONAssignment(...t);function kf(e){return Ef(e,VV)}function hge(e,t){const n={...e,subjectType:"context_uuid",extraAttributes:{...e.extraAttributes,context_uuid:t}};return Ef(n,VV)}const gge=(e,...t)=>e.getStringAssignment(...t);function yge(e){return Ef(e,gge)}const xge=(e,...t)=>e.getBooleanAssignment(...t);function zt(e){return Ef(e,xge)}const vge=(e,...t)=>e.getNumericAssignment(...t);function bge(e){return Ef(e,vge)}const _ge=(e,...t)=>e.getIntegerAssignment(...t);function n4(e){return Ef(e,_ge)}function wge(e){return kf({...e,subjectType:"visitor_id",skip:!1})}function Rx(e){return zt({...e,subjectType:"visitor_id",skip:!1})}const r4=()=>{const e=d.useContext(t4);if(!e)throw new Error("useEppoExperiments must be used within EppoExperimentsContext");return e},HV=(e,t)=>{const{value:n,loading:r}=zt({flag:"comet-mcp-enabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Cge=(e,t)=>{const{value:n,loading:r}=n4({flag:"comet-mobile-classifier-timeout",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Sge=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"comet-mobile-native-agent-enabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Ege=async({entryUUID:e,params:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/entry/should-show-feedback/{entry_uuid}",n,{params:{path:{entry_uuid:e}},body:t,timeoutMs:Qe({productionMs:500,devMs:1e3,clientSideMs:1e3}),numRetries:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r?.should_show_feedback??!1}catch(r){return Z.error("Failed to check if should show feedback",r),!1}},kge=async({slugOrUUID:e,headers:t,options:n,numRetries:r=0,reason:s})=>{const o="getThreadByUUID";if(!e||e==="undefined"||e==="new"){Z.log(`Tried to ${o} with bad slugOrUUID: ${e}`);return}const a=n?.withParentInfo,i=n?.version??ql,c=n?.source??bhe,u=n?.limit??0,f=n?.offset??0,m=n?.fromFirst,p=n?.supportedBlockUseCases??[],h=n?.cursor??null;try{const{data:g,error:y,response:x}=await de.GET("/rest/thread/{entry_uuid_or_slug}",s,{params:{path:{entry_uuid_or_slug:e},query:{with_parent_info:a,with_schematized_response:!0,version:i,source:c,limit:u,offset:f,from_first:m,supported_block_use_cases:p,cursor:h}},timeoutMs:Cn.HIGH,numRetries:r,headers:t});if(!g||y)throw new he("API_CLIENTS_ERROR",{cause:y,status:x.status??0});return g}catch(g){throw Z.error("Failed to get thread by uuid",g),g}},yxt=async({entryUUID:e,selectedText:t,beforeContext:n,afterContext:r,callback:s,reason:o})=>{await de.SSE("/rest/sse/check-sources",o,{params:{entry_uuid_or_slug:e,selected_text:t,before_context:n,after_context:r},handlers:{message:a=>s(a)}})},xxt=async({entryUUID:e,answerHelpful:t,detailedFeedback:n,reason:r})=>{try{const{error:s,response:o}=await de.POST("/rest/entry/feedback/{entry_uuid}",r,{params:{path:{entry_uuid:e}},body:{answer_helpful:t??!1,feedback:n},timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0})}catch(s){Z.error(s)}},vxt=async({entryUUID:e,params:t,reason:n})=>{if(e)try{const{error:r,response:s}=await de.POST("/rest/entry/label-entry/{entry_uuid}",n,{params:{path:{entry_uuid:e}},body:t,timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){Z.error(r)}},bxt=async({entry_uuid:e,format:t,reason:n})=>{const{data:r,error:s,response:o}=await de.POST("/rest/entry/export",n,{body:{entry_uuid:e,format:t},timeoutMs:Qe({productionMs:6e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r},_xt=async({slugOrUUID:e,reason:t})=>{const{error:n,response:r}=await de.POST("/rest/thread/request-access/{entry_uuid_or_slug}",t,{params:{path:{entry_uuid_or_slug:e}}});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0})},au=async({entryUUID:e,reason:t})=>{try{const{error:n}=await de.POST("/rest/sse/perplexity_terminate",t,{headers:{"content-type":"application/json"},body:{entry_uuid:e},timeoutMs:Qe({productionMs:5e3}),numRetries:1});return!n}catch(n){return Z.error("Failed to terminate entry",n),!1}},wxt=async({entryUUID:e,reason:t})=>{try{await de.POST("/rest/sse/perplexity_skip_search",t,{headers:{"content-type":"application/json"},body:{entry_uuid:e}})}catch(n){Z.error("Failed to skip search",n)}},Mge=async({entryUUID:e,clarification:t,reason:n})=>{try{await de.POST("/rest/sse/perplexity_clarifying_answer",n,{headers:{"content-type":"application/json"},body:{entry_uuid:e,clarification:t},timeoutMs:Qe({productionMs:5e3}),numRetries:0})}catch(r){Z.error("Failed to give clarifying answer",r)}},Tge=async({entryUUID:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/entry/should-show-recruitment-banner/{entry_uuid}",t,{params:{path:{entry_uuid:e}},body:void 0,timeoutMs:Qe({productionMs:500,devMs:1e3,clientSideMs:1e3}),numRetries:0});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n?.should_show_recruitment_banner??!1}catch(n){return Z.error("Failed to check if should show recruitment banner",n),!1}},Qp=async({contextUUID:e,stepUUID:t,result:n,reason:r})=>{try{const{error:s,response:o}=await de.POST("/rest/sse/pro_search_step_result",r,{body:{context_uuid:e,step_uuid:t,result:n},timeoutMs:Qe({productionMs:5e3}),numRetries:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0})}catch(s){Z.error(s)}},Age=async({entryUUID:e,params:t,siblingUUID:n,reason:r})=>{const{error:s,response:o}=await de.POST("/rest/entry/set-entry-selection/{entry_uuid}",r,{params:{path:{entry_uuid:e}},body:{selection_status:t,sibling_uuid:n},timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0})},Nge=async({entryUUID:e,sourceType:t,reason:n})=>{try{const{error:r,response:s}=await de.POST("/rest/sources/skip",n,{body:{entry_uuid:e,source_type:t},timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){throw Z.error("Failed to skip source",r),r}},X7=Object.freeze({version:"",minVersion:0,webResourcesBuild:""});function Ga(){return typeof window<"u"?window.__PPL_CONFIG__??X7:X7}const zV="comet-sidecar-threads-by-id",Ca=()=>!!Us(),Dx=e=>!(e.defaultPrevented||!An()||e.ctrlKey||e.metaKey),Rge=e=>{const t=vt.getItem(zV);if(t){const n=JSON.parse(t);for(const[r,{url:s,updatedAt:o}]of Object.entries(n))e.getState().actions.setSidecarUrlById(r,s,o)}},Z7=e=>{const t=e.getState().sidecarUrlById,n={};t.forEach((r,s)=>{s!=="-1"&&(r.url==="/sidecar/"||r.url==="/sidecar"||(n[s]={url:r.url,updatedAt:r.updatedAt}))}),vt.setItem(zV,JSON.stringify(n))},Dge=(e,t)=>{const n=e.getState().sidecarSourceTab,r=ro(n.tabId,n.secondaryTab?.tabId),s=e.getState().sidecarUrlById.get(r)?.url;!s||new URL(window.location.href).pathname===s||t.replace(s,"Sidecar thread restored from cache")};let WV=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,s=n.length;r{this.events[e]=this.events[e]?.filter(n=>t!==n)}}});const jge="npclhjbddhklpbnacpjloidibaggcgon",Ige="entropy-agent-extension-main";function Pge(){return{sendMessage:()=>Promise.reject(new Sc("MOBILE_BROWSER_ERROR")),sendMessageToPort:()=>()=>{},isConnected:()=>!1}}function J7({onMessage:e,extensionId:t,name:n}){if(Do())return Pge();let r,s,o=!1,a=!1,i=!1,c=0;const u=()=>{r&&clearTimeout(r),c++,r=setTimeout(p,1e3)},f=()=>{s=void 0,An()&&!a&&(Z.warn("Disconnected. Attempting to reconnect...",{extensionId:t}),a=!0),u()},m=()=>{if(s){s.onMessage.removeListener(e),s.onDisconnect.removeListener(f),clearTimeout(r);try{s.disconnect()}catch{}s=void 0}};function p(){if(m(),typeof chrome>"u"||!chrome.runtime){An()&&(o||(Z.error("Comet browser is missing chrome.runtime",{extensionId:t}),o=!0),u());return}try{s=chrome.runtime.connect(t,{name:n}),s.onMessage.addListener(e),s.onDisconnect.addListener(f),o=!1,a=!1,i=!1,c>0&&An()&&Z.info("Extension reconnected successfully",{extensionId:t,reconnect_attempts:c}),c=0}catch(h){s=void 0,u(),Z.error("Failed to connect to extension",{err:h,extensionId:t})}}return An()&&(p(),Ju("web.frontend.comet_extension_connected",{extensionId:t,startTime:SU(),duration:performance.now()})),{sendMessage:h=>(!s&&An()&&!i&&(Z.warn("Attempting to send message while main port is not connected",{extensionId:t}),i=!0),Oge(t,h)),sendMessageToPort:h=>{if(!An())return()=>{};!s&&!i&&(Z.warn("Attempting to send message to port while main port is not connected",{extensionId:t}),i=!0);const g=chrome.runtime.connect(t,{name:`${n}_${crypto.randomUUID()}`});return g.postMessage(h),()=>{try{g.disconnect()}catch{}}},isConnected:()=>!!s}}async function Oge(e,t){return new Promise((n,r)=>{if(xM()){r(new Sc("INCOGNITO_BROWSER_ERROR"));return}if(!An()){r(new Sc("INVALID_BROWSER_ERROR"));return}if(typeof chrome>"u"||!chrome.runtime){r(new Sc("MISSING_RUNTIME_ERROR",{details:{extensionId:e,messageType:typeof t=="object"&&t!==null&&"type"in t?t.type:void 0,message:t}}));return}chrome.runtime.sendMessage(e,t,s=>{if(chrome.runtime.lastError){r(new Sc("RUNTIME_LAST_ERROR",{message:chrome.runtime.lastError.message,cause:chrome.runtime.lastError,details:{extensionId:e,messageType:typeof t=="object"&&t!==null&&"type"in t?t.type:void 0,message:t}}));return}n(s)})})}class Lge{requests=new Map;bridge;get isAvailable(){if(!(typeof window>"u"))return window.cometBridge!=null}constructor(){this.bridge=new Proxy({},{get:(t,n)=>r=>{const s=crypto.randomUUID(),o={request_id:s,[n]:r??{}};return new Promise((a,i)=>{this.requests.set(s,c=>{"error"in c?i(new Error(String(c.error))):a(c)}),window.cometBridge?.postMessage(JSON.stringify(o))})}}),this.startListenMessages()}startListenMessages(){window.cometBridge&&(window.cometBridge.onmessage=t=>{const n=t.data;if(n)try{const r=JSON.parse(n),s=this.requests.get(r.request_id);s?(this.requests.delete(r.request_id),s(r)):(console.warn("No callback found for requestId",r.request_id,r),Z.warn("No callback found for requestId",r.request_id,r))}catch(r){console.warn("Failed to parse bridge response",n,r),Z.warn("Failed to parse bridge response",n,r)}})}}class eR{bridge;get isAvailable(){if(!(typeof window>"u"))return window.webkit?.messageHandlers?.cometBridge!=null}constructor(){this.bridge=new Proxy({},{get:(t,n)=>async r=>{const o={request_id:crypto.randomUUID(),[n]:r??{}},a=await window.webkit?.messageHandlers?.cometBridge?.postMessage(JSON.stringify(o));if(!a)throw new Error("No response from cometBridge");return JSON.parse(a)}})}}const Z1="mcp_tools_settings_v1";function Fge(){return Xi((e,t)=>({platformInfo:void 0,sidecarSourceTab:{url:"/",title:"",tabId:-1,secondaryTab:null},sidecarAutoOpenedThreads:{},screenshotToolEnabled:!0,sidecarUrlById:new Map,tasksState:{},navigationResults:{},classifierResults:{},omniboxInput:{},navigationMeta:{},taskScreenshots:{},taskComputerActions:{},userSelection:void 0,userSelectionByThreadId:new Map,mcpStdioServers:void 0,mcpTools:void 0,mcpDisabledServers:void 0,installedDxts:void 0,taskTabs:void 0,mcpToolsSettings:void 0,pendingTasks:new Map,inlineAssistantParams:{action:void 0,isWritingMode:!1,canInsert:!0},inlineAssistantDraggableRegions:new Map,actions:{setPlatformInfo:n=>{e({platformInfo:n})},setSidecarUrlById:(n,r,s)=>{const o=t().sidecarUrlById;o.set(n,{url:r,updatedAt:s??Date.now()}),e({sidecarUrlById:o})},deleteSidecarUrlById:n=>{const r=t().sidecarUrlById;r.delete(n),e({sidecarUrlById:r})},setSourceTab:n=>{const r=t().sidecarSourceTab;if(Cr(r,n))return;let s=!0;try{const i=new URL(n.url);s=!((i.protocol==="chrome:"||i.protocol==="comet:")&&i.hostname!=="newtab")}catch{}const o=r.tabId===n.tabId&&r.secondaryTab?.tabId===n.secondaryTab?.tabId,a=r.url!==n.url;if(o&&a){const i=ro(r.tabId,r.secondaryTab?.tabId);e(c=>{const u=new Map(c.userSelectionByThreadId);return u.delete(i),{sidecarSourceTab:n,screenshotToolEnabled:s,userSelectionByThreadId:u}})}else e({sidecarSourceTab:n,screenshotToolEnabled:s})},setSidecarAutoOpened:(n,r)=>{const s=t().sidecarAutoOpenedThreads;if(n)e({sidecarAutoOpenedThreads:{...s,[r]:!0}});else{const{[r]:o,...a}=s;e({sidecarAutoOpenedThreads:a})}},setLastOmniboxInput:(n,r)=>{e(s=>({omniboxInput:{...s.omniboxInput,[n]:r}}))},addNavigationResults:(n,{results:r,classifierResult:s,...o})=>{r?.length&&e(a=>{const i={navigationResults:{...a.navigationResults,[n]:r}};return s&&(i.classifierResults={...a.classifierResults,[n]:s}),o&&!a.navigationMeta[n]&&(i.navigationMeta={...a.navigationMeta,[n]:o}),i})},addTaskScreenshot:(n,r)=>{e(s=>({taskScreenshots:{...s.taskScreenshots,[n]:[...s.taskScreenshots[n]||[],r.startsWith("data:image/")?r:`data:image/png;base64,${r}`]}}))},addComputerAction:(n,r)=>{e(s=>({taskComputerActions:{...s.taskComputerActions,[n]:[...s.taskComputerActions[n]||[],r]}}))},setTaskState:(n,r)=>{e(s=>{const o={...s.tasksState};return r===void 0?delete o[n]:o[n]={is_paused:r},{tasksState:o}})},setUserSelection:n=>{{const r=t(),s=ro(r.sidecarSourceTab.tabId,r.sidecarSourceTab.secondaryTab?.tabId);e(o=>{const a=new Map(o.userSelectionByThreadId);return a.set(s,n),{userSelectionByThreadId:a}})}},clearUserSelection:()=>{{const n=t(),r=ro(n.sidecarSourceTab.tabId,n.sidecarSourceTab.secondaryTab?.tabId);e(s=>{const o=new Map(s.userSelectionByThreadId);return o.delete(r),{userSelectionByThreadId:o}})}},getUserSelection:()=>{const n=t();{const r=ro(n.sidecarSourceTab.tabId,n.sidecarSourceTab.secondaryTab?.tabId);return n.userSelectionByThreadId?.get(r)}},setMcpStdioServers:n=>{e({mcpStdioServers:n})},setMcpTools:(n,r)=>{e(s=>({mcpTools:{...s.mcpTools,[n]:r}}))},removeMcpTools:n=>{e(r=>{const s={...r.mcpTools};return delete s[n],{mcpTools:s}})},setMcpDisabledServers:n=>{e({mcpDisabledServers:n}),vt.setItem("mcp_disabled_servers_v1",JSON.stringify(Array.from(n)))},setMcpToolsSettings:n=>{e({mcpToolsSettings:n}),vt.setItem(Z1,JSON.stringify(n))},setMcpToolEnabled:(n,r,s)=>{e(o=>{const a=o.mcpToolsSettings||{},i={...a[n]||{}},c=i[r]??{enabled:!0},u={...i,[r]:{...c,enabled:s}},f={...a,[n]:u};return vt.setItem(Z1,JSON.stringify(f)),{mcpToolsSettings:f}})},renameMcpServerInToolsSettings:(n,r)=>{e(s=>{const o=s.mcpToolsSettings||{};if(!o[n]||n===r)return s;const a={...o},i=o[n];return a[r]={...i},delete a[n],vt.setItem(Z1,JSON.stringify(a)),{mcpToolsSettings:a}})},setInstalledDxts:n=>{e({installedDxts:n})},setTaskTabs:n=>{e({taskTabs:n})},setPendingTask:(n,r)=>{e(s=>{const o=new Map(s.pendingTasks);return o.set(n,r),{pendingTasks:o}})},deletePendingTask:n=>{e(r=>{const s=new Map(r.pendingTasks);return s.delete(n),{pendingTasks:s}})},getPendingTask:n=>t().pendingTasks.get(n),setInlineAssistantParams:n=>{e(r=>({inlineAssistantParams:{...r.inlineAssistantParams,...n}}))},setInlineAssistantDraggableRegion:n=>{const r=P7(n),s=Math.floor(n.origin.x),o=Math.floor(n.origin.y),a=Math.floor(n.size.width),i=Math.floor(n.size.height);e(c=>{const u=new Map(c.inlineAssistantDraggableRegions);return u.set(r,{origin:{x:s,y:o},size:{width:a,height:i}}),{inlineAssistantDraggableRegions:u}})},removeInlineAssistantDraggableRegion:n=>{const r=P7(n);e(s=>{const o=new Map(s.inlineAssistantDraggableRegions);return o.delete(r),{inlineAssistantDraggableRegions:o}})}}}))}const Bge="mcjlamohcooanphmebaiigheeeoplihb",Uge="streamId",Vge=Object.freeze([]);class Hge{tools;mobileProxy=new eR;isTestDebugMode=!1;platform="web";store=Fge();mainExtension;agentExtension;taskTeardowns=new Map;emitter=WV();pendingServerRename;classifierApiTimeoutMs=bM;useNativeAgent=!1;mobileAgentModule;constructor(){const t=Us();t?.android_version&&(this.platform="android"),t?.ios_version&&(this.platform="ios"),this.mainExtension=J7({onMessage:this.handleMessage,extensionId:Bge,name:"entropy_client_context"}),this.agentExtension=J7({onMessage:this.handleAgentExtensionMessage,extensionId:jge,name:Ige}),this.tools=zge(this.agentExtension),this.platform==="web"?this.mainExtension.sendMessage({type:"INIT"}).then(n=>{n&&(this.isTestDebugMode=!!n.isTestDebugMode)},n=>{if(An())throw n}):(this.mobileProxy=this.platform==="android"?new Lge:new eR,this.mobileAgentModule=q(()=>import("./agent-5z8MvKWD.js"),__vite__mapDeps([2,3,4,1])),this.fetchCurrentPageTab().catch(n=>{Z.error("[cometMobile] Error fetchCurrentPageTab",{error:n})})),ihe()}getStore(){return this.store}getMobileProxy(){return this.mobileProxy}setClassifierApiTimeoutMs(t){this.classifierApiTimeoutMs=t}setUseNativeAgent(t){this.useNativeAgent=t}isAgentAvailable(){return this.platform!=="web"?!0:this.agentExtension.isConnected()}async openNewTab(t){const n=new URL(t);n.searchParams.delete("erp"),n.pathname=n.pathname.replace("/sidecar",""),await this.openTab({url:n.toString(),request_id:"openNewTab",key:"openNewTab",navigation_history:!1})}async moveSidecarToThread(t){try{return(await this.agentExtension.sendMessage({type:"MOVE_SIDECAR_TO_THREAD",payload:{tab_id:t}})).success}catch(n){return Z.error("MOVE_SIDECAR_TO_THREAD failed",n),!1}}_getNavigationResults(t){return this.store.getState().navigationResults[t]??Vge}async closeSideCar(t={}){return this.send({type:"HIDE_SIDECAR",payload:t})}async openTab(t){if(this.platform!=="web"){const s=(await this.mobileProxy?.bridge.tabs_create({url:t.url,hidden:!1})).tab;return{is_success:!0,_metadata:{time:1},result:{tab_id:s.id,url:s.url,title:s.title,last_accessed:s.last_accessed}}}return{is_success:!0,result:(await this.tools.OpenTab({key:t.key??"unknown",request_id:t.request_id??"unknown",url:t.url,tab_id:t.tabId,navigation_history:t.navigation_history})).tab}}async fetchMobileSearchResults(t,n){const[r,s]=await Promise.all([this.mobileProxy.bridge.fetch_navigation_search_results({query:t,stream_id:n}),dhe(t,this.classifierApiTimeoutMs).catch(o=>(Z.error("Classifier API call failed, using defaults",{error:o,query:t,streamId:n}),uhe))]);return{...r.nav_search_response,classifierResult:s}}async fetchNavigationResults(t,n){if(this.platform==="web"){const r=await this.send({type:"NAV_SEARCH",payload:{query:t,streamId:n}});if(!r.is_success)throw new Error("Failed to inject search results");return r}else return{...await this.fetchMobileSearchResults(t,n),_metadata:void 0}}async injectSearchResults(t,n,r={},s){try{const o=Wa(),a={streamId:n,...r};Pl("web.frontend.comet_navigation_run_inject",a);const i=await this.fetchNavigationResults(t,n);if(this.store.getState().actions.addNavigationResults(n,i),s&&s({count:i.results?.length??0}),this.platform!=="web"&&i.results?.length){const p=this.store.getState();rV({clientPayloadCacheKey:`nav-${n}`,cometBrowser:this,reason:"mobile_search_injection",navigationResults:i.results,maxChars:5e4,includeSidecar:!1,attachedTabs:[],cometState:p}).catch(h=>{Z.error("Failed to save mobile navigation results",{streamId:n,error:h})})}const u={type:i.type??"unknown",...a};o.addTiming("web.frontend.comet_navigation_search_results",u);const f=o.getAbsoluteStartTime(),m={...u,startTime:f};i.searchTime&&Ju("web.frontend.comet_navigation_search_time",{duration:i.searchTime,...m}),i.classifyTime&&Ju("web.frontend.comet_navigation_classify_time",{duration:i.classifyTime,...m}),i.networkingTime&&Ju("web.frontend.comet_navigation_networking_time",{duration:i.networkingTime,...m}),this.platform==="web"&&i._metadata?.time&&Ju("web.frontend.comet_navigation_extension_processing",{duration:i._metadata.time,...m})}catch(o){Z.error(new Sc("NAV_RESULTS_INJECTION_FAILED",{details:{streamId:n},cause:o}))}}async getIsCometDefaultBrowser(t){try{const n=await this.send({type:"GET_IS_DEFAULT_BROWSER",key:t});return n.is_success?n.isDefault:null}catch{return null}}async setCometAsDefaultBrowser(t){return this.send({type:"SET_AS_DEFAULT_BROWSER",key:t})}async getDidSkipCookieImportOnboarding(t){const r=(await this.send({type:"GET_ONBOARDING_IMPORT_STATUS",key:t})).importStatus==="NOT_IMPORTED";return Z.info("[getDidSkipCookieImportOnboarding]",r),r}notifyUserStateChanged(t){this.send({type:"USER_STATE_CHANGED",payload:t}).catch(()=>{})}subscribeCometNavigate(t){const n=r=>{const s=new URL(r.detail.url);delete window.pplxNavIntentEvent,Pl("comet_navigate");const o="/search/new";s.pathname==="/search"&&s.searchParams.has("q")&&(s.pathname=o);let a=o;if(a="/sidecar"+o,s.pathname===a){const i=crypto.randomUUID();s.searchParams.set(Uge,i);const c=r.detail.text||"";this.store.getState().actions.setLastOmniboxInput(i,c)}t({url:s})};return window.pplxNavIntentEvent&&n(window.pplxNavIntentEvent),document.addEventListener("comet-navigate",n),()=>{document.removeEventListener("comet-navigate",n)}}subscribeToAgentStepUpdate(){const t=n=>{this.sendThreadStatusToMobile({status:"working",streamId:n.detail.streamId,displayDataId:n.detail.stepAction,allowClarifications:!0})};return document.addEventListener("comet-agent-step-update",t),()=>{document.removeEventListener("comet-agent-step-update",t)}}subscribeToCometQuery(t){const n=r=>{const s=r.detail.query;delete window.pplxCometQuery,t(s,{source:r.detail.source})};return window.pplxCometQuery&&n(window.pplxCometQuery),document.addEventListener("comet-query",n),()=>{document.removeEventListener("comet-query",n)}}getLastOmniboxInput(t){return this.store.getState().omniboxInput[t]}async getCookies(){if(this.platform!=="web")return{base64_cookies:(await this.mobileProxy.bridge.agent_get_cookies()).base64_cookies};throw new Error("getCookies is only available on mobile platforms")}async searchTabs(t){if(this.platform!=="web"){const{tabs:r}=await this.mobileProxy.bridge.tabs_query();return{is_success:!0,tabs:r.map(s=>({tabId:s.id,title:s.title??"",url:s.url,isCurrent:!1,lastAccess:s.last_accessed??0,snippet:""})),_metadata:{time:1}}}return{is_success:!0,tabs:(await this.tools.SearchBrowser({queries:[],sources:["OPEN_TABS"],key:t,history_max_results:0,open_tabs_max_results:500,closed_tabs_max_results:0,request_id:t})).open_tabs_results.map(r=>({...r,tabId:r.tab_id,lastAccess:r.last_accessed}))}}async ungroupTabs(t,n,r){return{is_success:!0,tabIds:(await this.tools.UngroupTabs({group_ids:t.groupIds,tab_ids:t.tabIds,key:n,request_id:r})).ungrouped_tabs.map(o=>({id:o.tab_id,error:o.error})),groupIds:t.groupIds.map(o=>({id:o}))}}showNotification(){this.send({type:"SHOW_NOTIFICATION"}).catch(()=>{})}hideInlineAssistant(){this.send({type:"CLOSE_INLINE_ASSISTANT"}).catch(()=>{})}setInlineAssistantContentsSize(t){this.send({type:"SET_INLINE_ASSISTANT_CONTENTS_SIZE",payload:{size:t}}).catch(()=>{})}setInlineAssistantDraggableRegions(t){this.send({type:"SET_INLINE_ASSISTANT_DRAGGABLE_REGIONS",payload:{regions:t}}).catch(()=>{})}addInlineAssistantDraggableRegion(t){this.store.getState().actions.setInlineAssistantDraggableRegion(t);const n=Array.from(this.store.getState().inlineAssistantDraggableRegions.values());this.setInlineAssistantDraggableRegions(n)}removeInlineAssistantDraggableRegion(t){this.store.getState().actions.removeInlineAssistantDraggableRegion(t);const n=Array.from(this.store.getState().inlineAssistantDraggableRegions.values());this.setInlineAssistantDraggableRegions(n)}sendThreadStatusToMobile(t){const{status:n,streamId:r,text:s,displayDataId:o,allowClarifications:a}=t;this.mobileProxy.bridge.thread_status({type:n,text:s,stream_id:r,display_data_id:o,allow_clarifications:a??!1}).catch(i=>{Z.error("Failed to send thread status to mobile bridge",i)})}sendVoiceStatusToMobile(t){const{status:n,text:r}=t;this.mobileProxy.bridge.voice_status({type:n,text:r}).catch(s=>{Z.error("Failed to send voice status to mobile bridge",s)})}openUserSettings(){this.platform!=="web"&&this.mobileProxy.bridge.open_user_settings().catch(t=>{Z.error("Failed to open user settings on mobile",t)})}setNativeInputVisibility(t){this.platform!=="web"&&this.mobileProxy.bridge.set_native_input_visibility({visible:t}).catch(n=>{Z.error("Failed to set native input visibility",n)})}openNativeSheet(t){this.platform!=="web"&&this.mobileProxy.bridge.app_navigate({target:t}).catch(n=>{Z.error(`Failed to open native ${t} sheet`,n)})}subscribeToMobileCommands(t){const n=r=>{r.detail.cmd==="update-context"?this.store.getState().actions.setSourceTab({secondaryTab:null,tabId:r.detail.tab.id,title:r.detail.tab.title,url:r.detail.tab.url}):t?t(r.detail):r.detail.cmd==="stop"&&r.detail.subject==="thread"?this.emitter.emit("BROWSER_TASK_STOP"):Z.warn("[comet-mobile] Unknown mobile command",r.detail.cmd)};return document.addEventListener("comet-mobile-cmd",n),()=>{document.removeEventListener("comet-mobile-cmd",n)}}setTabProgress(t){this.send({type:"SET_TAB_PROGRESS",payload:t}).catch(()=>{})}voiceAssistantPushVoiceLevel(t){this.send({type:"VOICE_ASSISTANT_PUSH_VOICE_LEVEL",payload:{levels:t}}).catch(()=>{})}voiceAssistantChangeSpeakerRole(t){this.send({type:"VOICE_ASSISTANT_CHANGE_SPEAKER_ROLE",payload:{role:t}}).catch(()=>{})}voiceAssistantNotifyConnected(){this.send({type:"VOICE_ASSISTANT_NOTIFY_CONNECTED"}).catch(()=>{})}voiceAssistantNotifyDisconnected(){this.send({type:"VOICE_ASSISTANT_NOTIFY_DISCONNECTED"}).catch(()=>{})}voiceAssistantStop(){this.send({type:"VOICE_ASSISTANT_STOP"}).catch(()=>{})}voiceAssistantShowWindow(){this.send({type:"VOICE_ASSISTANT_SHOW_WINDOW"}).catch(()=>{})}voiceAssistantHideWindow(){this.send({type:"VOICE_ASSISTANT_HIDE_WINDOW"}).catch(()=>{})}voiceAssistantSetDraggableRegions(t){this.send({type:"VOICE_ASSISTANT_SET_DRAGGABLE_REGIONS",payload:{regions:t}}).catch(()=>{})}async searchTabGroups(t,n,r){return{is_success:!0,results:(await this.tools.SearchTabGroups({queries:t.queries,request_id:r,key:n})).tab_groups.map(o=>({...o,color:o.color,tabs:o.tabs.map(a=>({...a,tabId:a.tab_id,isCurrent:a.is_current_tab??!1}))}))}}showFeedbackForm(){this.send({type:"SHOW_FEEDBACK_FORM"}).catch(()=>{})}subscribeScreenshotCaptured(t){return this.emitter.on("SCREENSHOT_CAPTURED",t)}handleAgentExtensionMessage=t=>{try{Vi(t).with({type:"SCREENSHOT_CAPTURED"},async({payload:{screenshot:n}})=>{const s=await(await fetch(n)).blob(),o=new File([s],"screenshot.png",{type:s.type});Z.info("Screenshot captured"),this.emitter.emit("SCREENSHOT_CAPTURED",o)}).with({type:"BROWSER_TASK_PROGRESS_SCREENSHOT"},async({payload:{screenshot:n,taskUuid:r}})=>{this.store.getState().actions.addTaskScreenshot(r,n)}).with({type:"ACTION_STARTED"},({payload:{uuid:n,action:r}})=>{this.store.getState().actions.addComputerAction(n,{action:r.action?.toLowerCase(),text:r.text,duration:r.duration})}).with({type:"BROWSER_TASK_PROGRESS"},({payload:{taskUuid:n,progress:r}})=>{const s=this.store.getState().actions.getPendingTask(n);s?.onProgress&&s.onProgress(r),this.emitter.emit("BROWSER_TASK_PROGRESS",n,r)}).with({type:"BROWSER_TASK_COMPLETE"},({payload:{taskUuid:n,result:r}})=>{const s=this.store.getState().actions.getPendingTask(n);s&&(this.store.getState().actions.deletePendingTask(n),s.resolve(r)),this.emitter.emit("BROWSER_TASK_COMPLETE",n,r)}).with({type:"BROWSER_TASK_STOP"},({payload:n})=>{Z.info("Browser task stopped"),this.emitter.emit("BROWSER_TASK_STOP",n.entryId)}).with({type:"BROWSER_TASK_PAUSE_RESUME_FRONTEND"},({payload:n})=>{Z.info("Browser task paused/resumed"),this.store.getState().actions.setTaskState(n.task_uuid,n.is_paused)}).with({type:"AGENT_TASK_FAILURE"},({payload:{taskUuid:n,extraHeaders:r,error:s}})=>{const o=this.store.getState().actions.getPendingTask(n);o&&(this.store.getState().actions.deletePendingTask(n),o.reject(new Error(s))),Y1({clientPayloadCacheKey:n,errorType:s,errorMsg:"Agent task failure."},r,"CometAdapter").catch(a=>{Z.error("Error sending tool failure",a)})}).with({type:"USER_SELECTION_CAPTURED"},({payload:{selection:n}})=>{this.store.getState().actions.setUserSelection(n)}).with({type:"MOVE_THREAD_TO_SIDECAR"},({payload:{url:n,task_tab_ids:r,entry_id:s,thread_url_slug:o,auto_opened:a}})=>{if(a!==void 0){const u=this.store.getState().sidecarSourceTab,f=ro(u.tabId,u.secondaryTab?.tabId);this.store.getState().actions.setSidecarAutoOpened(a,f)}let i,c;o?(c=new URL(window.location.href),c.pathname="/sidecar/search/"+o,i=c.toString()):s?(c=new URL(window.location.href),c.pathname="/sidecar/search/"+s,i=c.toString()):(c=new URL(n),c.pathname="/sidecar"+phe(c.pathname),i=c.toString()),r.forEach(u=>{const f=ro(u,void 0);this.store.getState().actions.setSidecarUrlById(f,c.pathname)}),!(o&&window.location.pathname.includes(o))&&document.dispatchEvent(new CustomEvent("comet-navigate",{detail:{url:i,text:""}}))}).with({type:"GET_TASK_TABS"},({payload:{tabs:n}})=>{this.store.getState().actions.setTaskTabs(n)}).with({type:"MCP_STDIO_SERVER_CHANGED"},({payload:{serverName:n,changes:r,server:s}})=>{this.handleMcpStdioServerChanged(n,r,s)}).with({type:"MCP_PERSISTED_STDIO_SERVERS_LOADED"},()=>{this.handleMcpPersistedStdioServersLoaded()}).with({type:"MCP_STDIO_SERVER_ADDED"},({payload:{server:n}})=>{this.handleMcpStdioServerAdded(n)}).with({type:"MCP_STDIO_SERVER_REMOVED"},({payload:{serverName:n}})=>{this.handleMcpStdioServerRemoved(n)}).otherwise(n=>{Z.log("Unknown message type",n)})}catch(n){Z.error("Error parsing entropy message",n)}};async fetchOpenedTabs(){const t=await this.searchTabs("fetch_opened_tabs");return t.is_success?t.tabs.filter(n=>(n.url.startsWith("https://")||n.url.startsWith("file://"))&&!n.isCurrent).sort((n,r)=>r.lastAccess-n.lastAccess):[]}async getPersonalSuggestions(t,n){return this.send({type:"GET_PERSONAL_SUGGESTIONS",payload:t,key:n})}async getTopMostVisitedUrls(t,n){return this.send({type:"GET_TOP_MOST_VISITED_URLS",payload:t,key:n})}getQuickActions(t){return this.send({type:"GET_QUICK_ACTIONS",key:t})}async getInitialHistorySummary(t,n,r){return this.SearchBrowser({queries:[],sources:["HISTORY"],key:"initial-history-summary",request_id:t,start_time:n*24*60*60*1e3,history_max_results:r,open_tabs_max_results:r,closed_tabs_max_results:r})}async getHistorySummary(t,n=[],r=14,s=20){return this.SearchBrowser({queries:n,sources:["HISTORY"],key:t,request_id:"",start_time:r*24*60*60*1e3,history_max_results:s,open_tabs_max_results:s,closed_tabs_max_results:s})}async GetContent(t){return this.platform!=="web"?{contents:(await Promise.allSettled(t.pages.map(async r=>r.id?(await this.mobileProxy.bridge.tabs_get_content({id:r.id})).tab_content:(await this.mobileProxy.bridge.tabs_get_url_content({url:r.url})).tab_content))).map(r=>r.status==="fulfilled"?r.value:void 0).filter(r=>r!==void 0).map(r=>({html:"",id:r.id,url:r.url,title:r.title??"",og_meta:r.og_meta??{},markdown:r.markdown??""}))}:this.tools.GetContent(t)}async GetVisibleTabScreenshot(t){return this.tools.GetVisibleTabScreenshot(t)}async SearchBrowser(t){if(this.platform!=="web"){const n=t.sources.includes("HISTORY")?Promise.allSettled((t.queries.length?t.queries:[""]).map(async a=>await this.mobileProxy.bridge.history_search({text:a,max_results:t.history_max_results,start_time:t.start_time,end_time:t.end_time}))):[],[{tabs:r},s]=await Promise.all([t.sources.includes("OPEN_TABS")?this.mobileProxy.bridge.tabs_query():{tabs:[]},n]),o=s.map(a=>a.status==="fulfilled"?a.value.history_items:[]).flat().map(a=>({title:a.title??"",url:a.url,last_accessed:a.last_visit_time??Date.now(),visit_count:a.visit_count??1}));return{closed_tabs_results:[],history_results:o,open_tabs_results:r.map(a=>({tab_id:a.id,title:a.title??"",url:a.url,last_accessed:a.last_accessed??0}))}}return this.tools.SearchBrowser(t)}async GetSidecarContext(t){if(this.platform!=="web"){const r=(await this.mobileProxy.bridge.tabs_query()).tabs.sort((a,i)=>(i.last_accessed??-1)-(a.last_accessed??-1))[0];if(!r)return{content:void 0,contents:void 0};const s=(await this.mobileProxy.bridge.tabs_get_content({id:r?.id})).tab_content,o={id:s.id,html:"",markdown:s.markdown,og_meta:s.og_meta,title:s.title,url:s.url};return{content:o,contents:[o]}}return this.tools.GetSidecarContext(t)}async closeTabs(t,n,r){if(this.platform!=="web"){const{tabs:o}=await this.mobileProxy.bridge.tabs_query(),a=t.tabIds??[],i=o.filter(c=>a.includes(c.id));return i.forEach(c=>{this.mobileProxy.bridge.tabs_close({id:c.id})}),{is_success:!0,result:i.map(c=>({id:c.id,url:c.url,title:c.title??""}))}}return{is_success:!0,result:(await this.tools.CloseTabs({tab_ids:t.tabIds??[],key:n,request_id:r})).tabs.map(o=>({id:o.tab_id,...o}))}}async groupTabs(t,n,r){const s=await this.tools.GroupTabs({...t,tab_ids:t.tabIds,group_id:t.groupId,key:n,request_id:r});if(!s.tab_group)throw new Error("[GroupTabs] Tab group not found");return{is_success:!0,tabGroup:{id:s.tab_group.id,title:s.tab_group.title,collapsed:s.tab_group.collapsed??!1,color:s.tab_group.color}}}async maybeSendSearchResult(t,n,r){if(!this.isTestDebugMode||!t)return;const o=[...t.web_results??[],...t.extra_web_results??[]].map(a=>({name:a.name,snippet:a.snippet,url:a.url,isClientContext:!!a.is_client_context}));return this.send({type:"PERPLEXITY_SEARCH_RESULT",payload:{answer:t.answer,webResults:o,isPending:r,steps:n.map(a=>a.step_type)}})}submitTask(t,n){return new Promise((r,s)=>{const o=t.entryId,a=t.uuid;this.store.getState().actions.setPendingTask(a,{entryId:t.entryId,uuid:t.uuid,resolve:r,reject:s,onProgress:n});const i=this.taskTeardowns.get(o)??[];if(this.taskTeardowns.set(o,i),this.platform!=="web"){if(this.useNativeAgent){i.push(()=>{this.mobileProxy.bridge.agent_stop({entry_id:o}).catch(c=>{Z.error("[comet] Native agent stop failed",{error:c,entryId:o})}),this.store.getState().actions.setTaskState(t.uuid,void 0)}),this.mobileProxy.bridge.agent_start({task:t.task,start_url:t.start_url,uuid:t.uuid,tab_id:t.tab_id,base_url:t.base_url,extra_headers:t.extra_headers,entry_id:t.entryId}).then(c=>{c.success?r({message:"Native agent started",success:!0}):s(new Error("Native agent failed to start"))}).catch(c=>{Z.error("[comet] Native agent start failed",{error:c}),s(c)});return}this.mobileAgentModule.then(async({startAgent:c})=>{try{const u=await c(t,this.mobileProxy.bridge,(f,m)=>{this.store.getState().actions.addTaskScreenshot(m,f)},(f,m)=>{this.store.getState().actions.addComputerAction(f,{action:m.action?.toLowerCase(),text:m.text,duration:m.duration})});i.push(f=>{u(f),this.store.getState().actions.setTaskState(t.uuid,void 0)}),r({message:"Mobile task started",success:!0})}catch(u){Z.error("[comet] Mobile agent failed to start",{error:u});const f=this.store.getState().actions.getPendingTask(a);f&&(this.store.getState().actions.deletePendingTask(a),f.reject(u instanceof Error?u:new Error(String(u))));let m={};try{m=JSON.parse(t.extra_headers)}catch{}Y1({clientPayloadCacheKey:a,errorType:"unhandled",errorMsg:u instanceof Error?u.message:String(u)},m,"CometAdapter").catch(p=>{Z.error("Error sending tool failure",p)}),s(u)}}).catch(c=>{Z.error("[comet] Mobile agent module failed to load",{error:c}),s(c)});return}this.agentExtension.sendMessage(t).then(()=>{i.push(c=>{this.agentExtension.sendMessage({type:"CLEANUP_AGENT_TASKS",payload:{entryId:t.entryId,reason:c}})})}).catch(c=>{let u={};try{u=JSON.parse(t.extra_headers)}catch{}Z.error("[comet] Unhandled error while submitting task",c),Y1({clientPayloadCacheKey:a,errorType:c,errorMsg:"Agent task start failure."},u,"CometAdapter").catch(f=>{Z.error("Error sending tool failure",f)})})})}async moveThreadToSidecar({activeTaskUuid:t,entryId:n,isMissionControl:r,reason:s,animate:o,takeFocus:a,autoOpened:i=!0}){try{return(await this.agentExtension.sendMessage({type:"MOVE_THREAD_TO_SIDECAR",payload:{active_task_uuid:t,is_mission_control:r,entry_id:n,animate:o,takeFocus:a,auto_opened:i}})).success}catch(c){return Z.error(new Sc("MOVE_THREAD_TO_SIDECAR_FAILED",{cause:c,message:`Failed to move thread to sidecar for ${s}`})),!1}}getTaskTabs(){this.agentExtension.sendMessage({type:"GET_TASK_TABS"})}async sendMissionControlStatus(t){await this.agentExtension.sendMessage({type:"MISSION_CONTROL_STATUS",payload:t})}async makeTaskVisible(t){const n=await this.agentExtension.sendMessage({type:"MAKE_TASK_VISIBLE",payload:{task_uuid:t}});if(n.tab_ids){const r=new URL(window.location.href).pathname;n.tab_ids.forEach(s=>{this.store.getState().actions.setSidecarUrlById(ro(s,void 0),r)})}}cleanupTasks(t,n){if(!t)return;const r=this.taskTeardowns.get(t);if(!r){this.platform==="web"?this.agentExtension.sendMessage({type:"CLEANUP_AGENT_TASKS",payload:{entryId:t,reason:n}}):this.mobileProxy.bridge.agent_stop({entry_id:t}).catch(s=>{Z.error("[comet] Native agent stop failed",{error:s,entryId:t})});return}r.forEach(s=>s(n)),this.taskTeardowns.delete(t)}captureSourceTabScreenshotV2({sourceTabUrl:t=""}){this.agentExtension.sendMessage({type:"CAPTURE_SCREENSHOT_V2",payload:{tabId:void 0,sourceTabUrl:t}})}deactivateScreenshotTool(){this.agentExtension.sendMessage({type:"DEACTIVATE_SCREENSHOT_TOOL",payload:{tabId:void 0}})}subscribeToSidecarBrowserTaskStop(t){return this.emitter.on("BROWSER_TASK_STOP",t)}subscribeForceSubmitQuery(t){return this.emitter.on("FORCE_SUBMIT_QUERY",t)}subscribeQuickActionButtonFired(t){return this.emitter.on("QUICK_ACTION_BUTTON_FIRED",t)}subscribeVoiceAssistantStarted(t){return this.emitter.on("VOICE_ASSISTANT_STARTED",t)}subscribeVoiceAssistantStopped(t){return this.emitter.on("VOICE_ASSISTANT_STOPPED",t)}getMcpTools(t){return this.sendToAgent({type:"GET_MCP_TOOLS",payload:{serverName:t}})}callMcpTool(t,n){return this.sendToAgent({type:"CALL_MCP_TOOL",payload:t,context:n})}getMcpStdioServers(){const t=this.sendToAgent({type:"GET_STDIO_MCP_SERVERS",payload:void 0});return t.then(n=>{this.getStore().getState().actions.setMcpStdioServers(n)}).catch(()=>{}),t}addMcpStdioServer(t){return this.sendToAgent({type:"ADD_STDIO_MCP_SERVER",payload:t})}async updateMcpStdioServer(t,n){try{return await this.sendToAgent({type:"UPDATE_STDIO_MCP_SERVER",payload:{existingServerName:t,updates:n}})}catch(r){if(!(r instanceof Error)||!r.message.startsWith("Error in invocation of perplexity.mcp.updateStdioServer")&&!r.message.startsWith("chrome.perplexity.mcp.updateStdioServer is not a function"))throw r;return n.name&&n.name!==t?this.pendingServerRename={oldName:t,newName:n.name}:this.pendingServerRename=void 0,await this.removeMcpStdioServer(t,!0),this.addMcpStdioServer(n)}}async removeMcpStdioServer(t,n){await this.sendToAgent({type:"REMOVE_STDIO_MCP_SERVER",payload:{name:t}}),this.clearStateAfterRemovingMcpServer(t,n)}installDxt(t){return this.sendToAgent({type:"INSTALL_DXT",payload:{url:t}})}async uninstallDxt(t){await this.sendToAgent({type:"UNINSTALL_DXT",payload:{name:t}}),this.clearStateAfterRemovingMcpServer(t)}getInstalledDxts(){const t=this.sendToAgent({type:"GET_INSTALLED_DXT"});return t.then(n=>{this.getStore().getState().actions.setInstalledDxts(n)}).catch(()=>{}),t}async refreshDxtAndMcpState(){await Promise.all([this.getMcpStdioServers(),this.getInstalledDxts()])}async hasPermission(t){try{return await this.sendToAgent({type:"HAS_PERMISSION",payload:{permission:t}})}catch{return null}}async requestPermission(t){try{return await this.sendToAgent({type:"REQUEST_PERMISSION",payload:{permission:t}})}catch{return null}}handleMcpStdioServerChanged(t,n,r){const s=this.getStore().getState(),o=s.mcpStdioServers??[],a=o.findIndex(c=>c.name===t);if(a===-1)return;const i=[...o];i[a]=r,s.actions.setMcpStdioServers(i)}async handleMcpPersistedStdioServersLoaded(){await this.getMcpStdioServers()}handleMcpStdioServerAdded(t){const n=this.getStore().getState(),r=n.mcpStdioServers??[];if(r.findIndex(a=>a.name===t.name)!==-1)return;const o=[...r,t];n.actions.setMcpStdioServers(o)}handleMcpStdioServerRemoved(t){const n=this.getStore().getState(),s=(n.mcpStdioServers??[]).filter(o=>o.name!==t);n.actions.setMcpStdioServers(s)}async fetchCurrentPageTab(){if(this.platform==="web")return;const n=(await this.mobileProxy.bridge.tabs_query()).tabs.sort((r,s)=>(s.last_accessed??-1)-(r.last_accessed??-1))[0];n&&this.store.getState().actions.setSourceTab({tabId:n.id,title:n.title??"",url:n.url,secondaryTab:null})}async send(t){return this.mainExtension.sendMessage(t).then(n=>(n.is_success=!n.errorType,n))}async sendToAgent(t){return this.agentExtension.sendMessage(t).then(n=>{if(!n.success)throw new Error(n.error);return n.response})}handleMessage=t=>{try{Vi(t).with({type:"UPDATE_SOURCE_TAB"},r=>{this.store.getState().actions.setSourceTab(r.payload),r.payload.url!==this.store.getState().sidecarSourceTab.url&&this.store.getState().actions.clearUserSelection()}).with({type:"FORCE_SUBMIT_QUERY"},r=>{this.isTestDebugMode&&this.emitter.emit("FORCE_SUBMIT_QUERY",r.payload)}).with({type:"QUICK_ACTION_BUTTON_FIRED"},()=>{this.emitter.emit("QUICK_ACTION_BUTTON_FIRED")}).with({type:"VOICE_ASSISTANT_STARTED"},()=>{this.emitter.emit("VOICE_ASSISTANT_STARTED")}).with({type:"VOICE_ASSISTANT_STOPPED"},()=>{this.emitter.emit("VOICE_ASSISTANT_STOPPED")}).with({type:"EDITABLE_ELEMENT_FOCUS_STATE"},r=>{this.store.getState().actions.setInlineAssistantParams({canInsert:r.payload.canInsert})}).with({type:"INIT"},r=>{this.isTestDebugMode=!!r.payload.isTestDebugMode,this.store.getState().actions.setPlatformInfo(r.payload.platform);const s=this.store.getState().actions;s.setSourceTab({tabId:r.payload.sourceTabId??-1,url:r.payload.sourceTabUrl??"",title:r.payload.sourceTabTitle??"",secondaryTab:r.payload.sourceSecondaryTab??null}),r.payload.selection&&s.setUserSelection(r.payload.selection)}).otherwise(r=>{Z.log("Unknown message type",r)})}catch(n){Z.error("Error parsing entropy message",n)}};clearStateAfterRemovingMcpServer(t,n){const r=this.getStore().getState(),s=r.mcpDisabledServers??new Set;if(s.has(t)){const a=new Set(s);a.delete(t),r.actions.setMcpDisabledServers(a)}if(n&&!this.pendingServerRename)return;if(this.pendingServerRename&&this.pendingServerRename.oldName===t){r.actions.renameMcpServerInToolsSettings(this.pendingServerRename.oldName,this.pendingServerRename.newName),this.pendingServerRename=void 0;return}const o=r.mcpToolsSettings??{};if(o[t]){const a={...o};delete a[t],r.actions.setMcpToolsSettings(a)}}async getPrivacyInfo(t){try{const n=await this.send({type:"GET_PRIVACY_INFO",key:t});return n.is_success?n:null}catch{return null}}async insertInlineAssistantSelection(t,n){try{return(await this.agentExtension.sendMessage({type:"INSERT_INLINE_TEXT",payload:{text:n},key:t})).success}catch{return!1}}async getSiteOnboardingStatus(t){try{const n=await this.mainExtension.sendMessage({type:"GET_SITE_ONBOARDING_STATUS",key:t});return n.started===null?void 0:n.started}catch{return}}async setSiteOnboardingStatus(t,n){try{await this.mainExtension.sendMessage({type:"SET_SITE_ONBOARDING_STATUS",key:t,payload:{started:n}})}catch{}}}const zge=e=>new Proxy({},{get(t,n){return r=>e.sendMessage({type:"CALL_TOOL",method:n,request:r}).then(({success:s,response:o})=>{if(!s)throw o;return o}).catch(s=>{throw Z.error("Error calling tool",s),"errorType"in s?s:{errorType:"unhandled",errorMsg:"Proxy error."}})}});class Wge{mobileProxy;cometAdapter;_shouldUseMobileProxyForMCP=null;constructor(t,n){this.mobileProxy=t,this.cometAdapter=n}get shouldUseMobileProxyForMCP(){if(this._shouldUseMobileProxyForMCP===null)if(Do())this._shouldUseMobileProxyForMCP=!0;else if(An())this._shouldUseMobileProxyForMCP=!1;else{const t=this.mobileProxy.isAvailable;t!==void 0&&(this._shouldUseMobileProxyForMCP=t)}return this._shouldUseMobileProxyForMCP??!1}async getMcpTools(t){if(this.shouldUseMobileProxyForMCP){const n=this.mobileProxy.bridge.get_mcp_tools({server_name:t});return n.catch(r=>{Z.error("get_mcp_tools failed:",r)}),n.then(r=>r.tools)}return this.cometAdapter.getMcpTools(t)}async callMcpTool(t,n){if(this.shouldUseMobileProxyForMCP){const r=this.mobileProxy.bridge.call_mcp_tool({params:t});return r.catch(s=>{Z.error("call_mcp_tool failed:",s)}),r.then(s=>({content:s.result}))}return this.cometAdapter.callMcpTool(t,n)}async getMcpStdioServers(){if(this.shouldUseMobileProxyForMCP){const t=this.mobileProxy.bridge.get_mcp_servers();return t.catch(n=>{Z.error("get_mcp_servers failed:",n)}),t.then(n=>(this.cometAdapter.getStore().getState().actions.setMcpStdioServers(n.servers),n.servers))}return this.cometAdapter.getMcpStdioServers()}async getInstalledDxts(){return this.shouldUseMobileProxyForMCP?[]:this.cometAdapter.getInstalledDxts()}async refreshDxtAndMcpState(){await Promise.all([this.getMcpStdioServers(),this.getInstalledDxts()])}initializeFromWindowTools(t){try{if(!t?.servers)return;const n=this.cometAdapter.getStore();Object.entries(t.servers).forEach(([r,s])=>{s&&Array.isArray(s)&&n.getState().actions.setMcpTools(r,s)})}catch(n){Z.error("Failed to initialize MCP tools from window",n)}}}const GV="native_bridge";function Gge(e){try{const t=JSON.parse(e);return{info_version:typeof t.info_version=="string"?t.info_version:void 0,local_mcp:{call:t.local_mcp?.call===!0,edit:t.local_mcp?.edit===!0}}}catch(t){Z.warn("[NativeClientCapabilities] Invalid JSON",t);return}}const $ge=wf(function(){const t=mr(GV);if(t)return Gge(t)},()=>Math.floor(Date.now()/(3600*1e3)));function qge(){return!!mr(GV)}const Kge=wf(function(){const t=$ge();if(t)return t;if(!Do()&&An())return{info_version:"1",local_mcp:{call:!0,edit:!0}}},()=>Math.floor(Date.now()/(3600*1e3))),Yge=Symbol(),$V=Symbol(),Ym="a",qV="f",tR="p",KV="c",YV="t",QV="h",J1="w",XV="o",ZV="k";let Qge=(e,t)=>new Proxy(e,t);const $S=Object.getPrototypeOf,nR=new WeakMap,Xge=e=>e&&(nR.has(e)?nR.get(e):$S(e)===Object.prototype||$S(e)===Array.prototype),rR=e=>typeof e=="object"&&e!==null,Zge=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(t=>!t.configurable&&!t.writable),Jge=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create($S(e),t)},e0e=(e,t)=>{const n={[qV]:t};let r=!1;const s=(i,c)=>{if(!r){let u=n[Ym].get(e);if(u||(u={},n[Ym].set(e,u)),i===J1)u[J1]=!0;else{let f=u[i];f||(f=new Set,u[i]=f),f.add(c)}}},o=()=>{r=!0,n[Ym].delete(e)},a={get(i,c){return c===$V?e:(s(ZV,c),eH(Reflect.get(i,c),n[Ym],n[KV],n[YV]))},has(i,c){return c===Yge?(o(),!0):(s(QV,c),Reflect.has(i,c))},getOwnPropertyDescriptor(i,c){return s(XV,c),Reflect.getOwnPropertyDescriptor(i,c)},ownKeys(i){return s(J1),Reflect.ownKeys(i)}};return t&&(a.set=a.deleteProperty=()=>!1),[a,n]},JV=e=>e[$V]||e,eH=(e,t,n,r)=>{if(!Xge(e))return e;let s=r&&r.get(e);if(!s){const c=JV(e);Zge(c)?s=[c,Jge(c)]:s=[c],r?.set(e,s)}const[o,a]=s;let i=n&&n.get(o);return(!i||i[1][qV]!==!!a)&&(i=e0e(o,!!a),i[1][tR]=Qge(a||o,i[0]),n&&n.set(o,i)),i[1][Ym]=t,i[1][KV]=n,i[1][YV]=r,i[1][tR]},t0e=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((s,o)=>s!==r[o])},qS=(e,t,n,r,s=Object.is)=>{if(s(e,t))return!1;if(!rR(e)||!rR(t))return!0;const o=n.get(JV(e));if(!o)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let a=null;for(const i of o[QV]||[])if(a=Reflect.has(e,i)!==Reflect.has(t,i),a)return a;if(o[J1]===!0){if(a=t0e(e,t),a)return a}else for(const i of o[XV]||[]){const c=!!Reflect.getOwnPropertyDescriptor(e,i),u=!!Reflect.getOwnPropertyDescriptor(t,i);if(a=c!==u,a)return a}for(const i of o[ZV]||[])if(a=qS(e[i],t[i],n,r,s),a)return a;if(a===null)throw new Error("invalid used");return a},tH=e=>()=>{const[,n]=d.useReducer(u=>u+1,0),r=d.useMemo(()=>new WeakMap,[]),s=d.useRef(),o=d.useRef();d.useEffect(()=>{s.current!==o.current&&qS(s.current,o.current,r,new WeakMap)&&(s.current=o.current,n())});const a=d.useCallback(u=>(o.current=u,s.current&&s.current!==u&&!qS(s.current,u,r,new WeakMap)?s.current:(s.current=u,u)),[r]),i=e(a),c=d.useMemo(()=>new WeakMap,[]);return eH(i,r,c)};function s4(e){const t=Ft(e,null),{useSelector:n,useStore:r,useTrackedState:s}=nH(t,e);return{Context:t,useSelector:n,useStore:r,useTrackedState:s}}function nH(e,t){const n=()=>{const o=A.useContext(e);if(!o)throw new Error(`This hook must be used within ${t}.Provider`);return o},r=o=>n()(o),s=tH(r);return{useSelector:r,useStore:n,useTrackedState:s}}function n0e(e,t){const n=new Set,r={source:void 0,derived:void 0},s=()=>{const a=e.getState();return(r.derived===void 0||r.source!==a)&&(r.source=a,r.derived=t(a)),r.derived},o=e.subscribe((a,i)=>{const c=t(a),u=t(i);n.forEach(f=>f(c,u)),r.source=a,r.derived=c});return[{getState:s,getInitialState:()=>t(e.getInitialState()),subscribe:a=>(n.add(a),()=>n.delete(a))},o]}function r0e(e,t){const[n,r]=d.useMemo(()=>n0e(e,t),[e,t]);return d.useEffect(()=>()=>r(),[r]),n}function s0e(e,t){const n=r0e(e,t);return d.useMemo(()=>{const r=s=>Yfe(n,s);return{useSelector:r,useProxy:tH(r)}},[n])}const Yh=(e,t)=>{const n=Ft(e,null),r=i=>{const[c]=A.useState(()=>i.initialValue?t(i?.initialValue):t(void 0));return l.jsx(n.Provider,{value:c,children:i.children})},{useSelector:s,useStore:o,useTrackedState:a}=nH(n,e);return{useSelector:s,useStore:o,useTrackedState:a,Context:n,Provider:r}},Ks=new Hge,zy=new Wge(Ks.getMobileProxy(),Ks),{Provider:o0e,useTrackedState:a0e}=Yh("CometContext",()=>Ks.getStore()),rH=Ft("EntropyBrowserContext",void 0),sH=Ft("McpAdapterContext",void 0),i0e=({children:e})=>{const t=Rn(),n=yfe(),r=An(),{session:s,status:o}=Ne(),{variation:a,loading:i}=Cge(bM),c=qge();d.useLayoutEffect(()=>{c&&window.initialMCPTools!=null&&(zy.initializeFromWindowTools(window.initialMCPTools),window.initialMCPTools=void 0)},[c]),d.useEffect(()=>{i||Ks.setClassifierApiTimeoutMs(a)},[a,i]);const{variation:u,loading:f}=Sge(!1,{android_version:Us()?.android_version??""});d.useEffect(()=>{f||Ks.setUseNativeAgent(u)},[u,f]);const m=s?.user?.id,p=s?.user?.subscription_tier;d.useEffect(()=>{if(r)switch(o){case"authenticated":return m?Ks.notifyUserStateChanged({status:o,userId:m,subscriptionTier:p??"free"}):void 0;case"unauthenticated":return Ks.notifyUserStateChanged({status:o})}},[o,m,p,r]),d.useLayoutEffect(()=>{},[]),d.useLayoutEffect(()=>{const y=Ga();y.erp&&(document.documentElement.dataset.erp=y.erp);const x=Ks.subscribeCometNavigate(({url:S})=>{if(S.origin===window.location.origin&&S.pathname.startsWith(t.base)&&(S.pathname=S.pathname.replace(t.base,""),n(S.pathname))){const C=S.searchParams.toString(),E=`${S.pathname}${C?`?${C}`:""}`;t.push(E,void 0,"Comet navigate");return}{Z.error("Invalid soft navigation in Sidecar",{url:S}),Ks.openTab({url:S.toString()});return}}),v=Ks.getStore(),b=setInterval(()=>{v.getState().sidecarUrlById.forEach((C,E)=>{C.updatedAt{if(Cr(S.sidecarSourceTab,C.sidecarSourceTab))return;const E=S.sidecarSourceTab,T=ro(_.tabId,_.secondaryTab?.tabId),k=ro(E.tabId,E.secondaryTab?.tabId);if(k===T)return;const I=new URL(window.location.href).pathname;lhe(_.tabId,_.secondaryTab?.tabId).forEach(j=>{v.getState().actions.setSidecarUrlById(j,I)});const D=v.getState().sidecarUrlById.get(k)?.url??"/";_=E,D!==I&&(t.replace(D,"Sidecar source tab changed"),Z7(v))});return()=>{clearInterval(b),x(),w()}},[t,n]),d.useEffect(()=>Ks.subscribeToSidecarBrowserTaskStop(y=>{y&&(au({entryUUID:y,reason:"terminate-from-comet-adapter"}),Ks.cleanupTasks(y,"query_stopped"))}),[]);const{variation:h}=HV(!1),g=r?h:c;return l.jsx(o0e,{children:l.jsx(rH.Provider,{value:Ks,children:l.jsxs(sH.Provider,{value:zy,children:[e,g&&l.jsx(c0e,{})]})})})};function un(e=!0){const t=d.useContext(rH);if(!t&&e)throw new Error("useEntropyBrowser must be used inside EntropyBrowserProvider");return t}function l0e(e=!0){const t=d.useContext(sH);if(!t&&e)throw new Error("useMcpAdapter must be used inside EntropyBrowserProvider");return t}const Qn=a0e,c0e=()=>{const e=Qn();return d.useEffect(()=>{zy.refreshDxtAndMcpState().catch(()=>{})},[]),d.useEffect(()=>{if(!e.mcpDisabledServers)try{const t=vt.getItem("mcp_disabled_servers_v1"),n=t?JSON.parse(t):[];e.actions.setMcpDisabledServers(new Set(n))}catch{e.actions.setMcpDisabledServers(new Set)}},[e.mcpDisabledServers,e.actions]),d.useEffect(()=>{if(!e.mcpToolsSettings)try{const t=vt.getItem(Z1),n=t?JSON.parse(t):{};e.actions.setMcpToolsSettings(n)}catch{e.actions.setMcpToolsSettings({})}},[e.mcpToolsSettings,e.actions]),l.jsx(l.Fragment,{children:e.mcpStdioServers?.map(t=>l.jsx(u0e,{server:t},t.name))})},u0e=({server:e})=>{const t=Qn(),{data:n}=mt({queryKey:be.makeQueryKey("comet/mcp_tools",e.name),queryFn:async()=>(await zy.getMcpTools(e.name).catch(()=>[])).map(s=>({...s,mcp_server:e.name,mcp_server_type:Ype.MCP_SERVER_TYPE_LOCAL,app:e.name})),enabled:!!e.name});return d.useEffect(()=>{if(n)return t.actions.setMcpTools(e.name,n),()=>{t.actions.removeMcpTools(e.name)}},[n,t.actions,e.name]),null};function d0e(){if(typeof window>"u")return!1;const e=window;return!!(e?.webkit?.messageHandlers?.pplx?.postMessage||e?.Android?.pplx?.postMessage)}function oH({type:e,data:t}){if(typeof window>"u")return!1;const n=window,r={type:e,data:t};return n?.webkit?.messageHandlers?.pplx?.postMessage?(n.webkit.messageHandlers.pplx.postMessage(r),!0):n?.Android?.pplx?.postMessage?(n.Android.pplx.postMessage(r),!0):!1}function f0e({query:e}){return oH({type:"pplx.ask",data:{query:e}})}const aH=Ft("CanonicalPageContext",{inApp:!1,preferredColorScheme:null,deviceId:null,appVersion:null,isIOS:!1,isAndroid:!1,client:null}),m0e=A.memo(({children:e,inApp:t})=>{const n=fn(),r=On(),s=n?.get("mobile.deviceId")||null,o=n?.get("mobile.appVersion")||null,a=n?.get("mobile.preferredColorScheme")||null,i=n?.get("mobile.client")||null,c=i==="ios",u=i==="android";return d.useEffect(()=>{if(!r?.startsWith("/app")||!n)return;const f=["mobile.","version"],m=new URL(window.location.href.replace("/app",""));m.searchParams.forEach((p,h)=>{f.some(g=>h.startsWith(g))&&m.searchParams.delete(h)}),m.searchParams.set("referrer","canonical"),oH({type:"pplx.url.share",data:{url:m.href}})},[r,n]),l.jsx(aH.Provider,{value:{inApp:t,preferredColorScheme:a,deviceId:s,appVersion:o,isIOS:c,isAndroid:u,client:i},children:e})});m0e.displayName="CanonicalPageProvider";function Sa(){return d.useContext(aH)}async function p0e(){const e=await fetch("/api/version",{method:"GET",headers:{"Content-Type":"application/json"}}),{version:t}=await e.json();return t}const iH=Yh("VoiceSessionStoreContext",()=>Xi(e=>({isActive:!1,setIsActive:t=>e({isActive:t})}))),h0e=iH.Provider,g0e=()=>iH.useStore();function y0e(){const e=g0e();return d.useCallback(()=>e.getState().isActive,[e])}const vd={cacheName:{prefix:"pplx",suffix:"v2",runtime:"runtime",html:"html"}},x0e=[vd.cacheName.prefix,vd.cacheName.html,vd.cacheName.suffix].join("-"),v0e=[vd.cacheName.prefix,vd.cacheName.runtime,vd.cacheName.suffix].join("-");async function lH(){if("serviceWorker"in navigator){await caches.delete(x0e),await caches.delete(v0e);return}}const b0e={SSE:(...e)=>cme(...e)};var Wy;(function(e){e[e.NONE=0]="NONE",e[e.READER=1]="READER",e[e.WRITER=2]="WRITER",e[e.EDITOR=5]="EDITOR",e[e.ADMIN=3]="ADMIN",e[e.OWNER=4]="OWNER",e[e.OWNER_DEFAULT_BOOKMARKS=6]="OWNER_DEFAULT_BOOKMARKS",e[e.INVITED_READER=11]="INVITED_READER",e[e.INVITED_WRITER=12]="INVITED_WRITER",e[e.INVITED_EDITOR=15]="INVITED_EDITOR",e[e.INVITED_ADMIN=13]="INVITED_ADMIN"})(Wy||(Wy={}));function _0e(e){return e>=Wy.WRITER&&e{const E=e.trim(),T=JSON.stringify([{step_type:"INITIAL_QUERY",content:{query:""},uuid:""}]),k=t?{title:c?.article_info?.title??b,url_slug:(c&&"thread_url_slug"in c?c.thread_url_slug:void 0)??_,mode:((c&&"mode"in c?c.mode:void 0)??p)?.toUpperCase()}:void 0,I=s&&_0e(s.user_permission)?s:void 0;return{parent_info:void 0,plan:void 0,summary:void 0,form:void 0,reasoning_plan:void 0,status:"PENDING",reconnectable:!0,final:!1,query_str:E,query_source:S,backend_uuid:g?"":n??"",bookmark_state:s?"BOOKMARKED":"NOT_BOOKMARKED",context_uuid:"",frontend_context_uuid:i??a??"",uuid:r??v,frontend_uuid:r??v,...t?{parent_info:k}:{},author_username:void 0,author_image:void 0,search_focus:y.length===0?"writing":"internet",search_recency_filter:x??void 0,sources:{sources:y},num_sources_display:void 0,personalized:h,attachments:m,blocks:[],social_info:{like_count:0,view_count:0,fork_count:0,user_likes:!1},mode:"COPILOT",text:T??void 0,collection_info:I,is_related_query_result:o??!1,related_queries:[],media_items:[],widget_data:[],widget_intents:[],knowledge_cards:[],related_query_items:[],sources_list:[],answer_modes:[],is_nav_suggestions_disabled:u,structured_answer_block_usages:[],display_model:w,model_preference:w,side_by_side_metadata:C}},uH="DEFAULT_SEARCH_PLACEHOLDER",C0e=(e={})=>{const t=e.uuid??e.frontend_uuid??crypto.randomUUID();return{status:"PENDING",parent_info:void 0,query_str:"",backend_uuid:uH,author_username:void 0,author_image:void 0,search_focus:"internet",display_model:"turbo",personalized:!1,attachments:[],social_info:{like_count:0,view_count:0,fork_count:0,user_likes:!1},text:void 0,collection_info:void 0,image_completions:[],is_related_query_result:!1,final:!1,sources:{sources:["web"]},should_index:!1,updated_datetime:new Date().toISOString(),thread_access:0,thread_url_slug:"",expiry_time:void 0,privacy_state:void 0,context_uuid:"",related_queries:[],media_items:[],widget_data:[],blocks:[],message_mode:"MESSAGE_MODE_UNSPECIFIED",widget_intents:[],knowledge_cards:[],plan:void 0,reasoning_plan:void 0,summary:void 0,form:void 0,sources_list:[],related_query_items:[],answer_modes:[],structured_answer_block_usages:[],...e,frontend_context_uuid:e.frontend_context_uuid??crypto.randomUUID(),frontend_uuid:t,uuid:t,attachment_processing_progress:[]}};var S0e=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)s.hasOwnProperty(o)&&(r[o]=s[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),E0e=Object.prototype.hasOwnProperty;function KS(e,t){return E0e.call(e,t)}function YS(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function yc(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function dH(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function XS(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&c[f-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&p===void 0&&(u[h]===void 0?p=c.slice(0,f).join("/"):f==m-1&&(p=t.path),p!==void 0&&g(t,0,e,p)),f++,Array.isArray(u)){if(h==="-")h=u.length;else{if(n&&!QS(h))throw new ar("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);QS(h)&&(h=~~h)}if(f>=m){if(n&&t.op==="add"&&h>u.length)throw new ar("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var a=M0e[t.op].call(t,u,h,e);if(a.test===!1)throw new ar("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(f>=m){var a=rd[t.op].call(t,u,h,e);if(a.test===!1)throw new ar("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[h],n&&f0)throw new ar('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ar("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ar("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&XS(e.value))throw new ar("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var s=e.path.split("/").length,o=r.split("/").length;if(s!==o+1&&s!==o)throw new ar("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new ar("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},i=mH([a],n);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new ar("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ar("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function mH(e,t,n){try{if(!Array.isArray(e))throw new ar("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)jx(so(t),so(e),n||!0);else{n=n||$y;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function a4(e,t,n,r,s){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=YS(t),a=YS(e),i=!1,c=a.length-1;c>=0;c--){var u=a[c],f=e[u];if(KS(t,u)&&!(t[u]===void 0&&f!==void 0&&Array.isArray(t)===!1)){var m=t[u];typeof f=="object"&&f!=null&&typeof m=="object"&&m!=null&&Array.isArray(f)===Array.isArray(m)?a4(f,m,n,r+"/"+yc(u),s):f!==m&&(s&&n.push({op:"test",path:r+"/"+yc(u),value:so(f)}),n.push({op:"replace",path:r+"/"+yc(u),value:so(m)}))}else Array.isArray(e)===Array.isArray(t)?(s&&n.push({op:"test",path:r+"/"+yc(u),value:so(f)}),n.push({op:"remove",path:r+"/"+yc(u)}),i=!0):(s&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!i&&o.length==a.length))for(var c=0;c[r.intended_usage,r]));for(const r of t)if(r.diff_block){const s=r.diff_block.field,o=n.get(r.intended_usage)?.[s]??EU,a=r.diff_block.patches??Pe,i=jx(o,a,!1,!1).newDocument;n.set(r.intended_usage,{intended_usage:r.intended_usage,[s]:i})}else n.set(r.intended_usage,r);return Array.from(n.values())}class Ol extends bU{name="PplxStreamError"}const sr=WV();function U0e(e,t,n){return e.reduce((r,s)=>s(r,n),t)}const V0e=(e,t)=>e&&Qfe(e,n=>n!=null);function ey(e){return e?!e.resume_entry_uuid:!1}function H0e(e,t){const n={minuteCount:0,hourCount:0,minuteWindow:Math.floor(Date.now()/6e4),hourWindow:Math.floor(Date.now()/36e5)};return async(...r)=>{const s=Date.now(),o=Math.floor(s/(60*1e3)),a=Math.floor(s/(3600*1e3));return o!==n.minuteWindow&&(n.minuteCount=0,n.minuteWindow=o),a!==n.hourWindow&&(n.hourCount=0,n.hourWindow=a),n.minuteCount>=t.perMinute?{allowed:!1}:n.hourCount>=t.perHour?{allowed:!1}:(n.minuteCount++,n.hourCount++,{allowed:!0,result:await e(...r)})}}function pH(e,t,n){const r=[...e],s=r.findIndex(a=>a.id===t),o=r[s];if(o){if(o.entryIds.includes(n))return e;r[s]={...o,entryIds:[...o.entryIds,n]}}else r.push({id:t,entryIds:[n]});return r}const z0e="2.18",JS=Object.freeze([]),Ud=new Map;function zi(e,t){return t?e.streams[t]:void 0}function i4(e,t){const n=Object.values(e.streams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.entryId===t&&e.activeStreams.includes(o.id.description))return o}}function hH(e,t){const n=Object.values(e.streams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.threadId===t&&e.activeStreams.includes(o.id.description))return o}}const gH=50,W0e=100,oR=1e3;function S_(e,t,n){const r=zi(e,t);if(!r||!e.activeStreams.includes(t))return{newState:e};let s;if(r.threadId){const p=e.threads.find(h=>h.id===r.threadId)?.entryIds?.[0]??void 0;s=p?e.entries[p]?.thread_url_slug:void 0}const o=U0e(e.middlewares,n,s);if(!o)return{newState:e};const a=o.context_uuid,i=o.backend_uuid,c=o.uuid,f=!!!(r.entryId&&r.isReconnect&&e.erroredStreams[r.entryId])&&(!r.threadId||!r.entryId);if(i===uH||i===cH)return{newState:{streams:{...e.streams,[t]:{...r,placeholderChunk:o}}}};if(o.status===Pr.PENDING&&o.blocks?.length===0||o.status===Pr.RESUMING)return{newState:{...e3(e,o,{isFirstMessage:f,placeholderChunk:r.placeholderChunk,streamId:r.id.description}),streams:{...e.streams,[t]:{...r,threadId:o.context_uuid,entryId:i,extraEntryId:c,placeholderChunk:o}}},status:o.status};if(!a||!i)return{newState:e};let m=r;f&&(m={...r,threadId:a,entryId:i,extraEntryId:c});try{return{newState:{...e3(e,o,{isFirstMessage:f,placeholderChunk:r.placeholderChunk,streamId:r.id.description}),streams:{...e.streams,[t]:m}},status:o.status}}catch(p){return r?.abortController?.abort("Failed to ingest message"),{newState:yH(e,t,new Ol("STREAM_FAILED_INGEST_ERROR",{cause:p,details:{request_id:t,backend_uuid:r?.entryId??"unknown"}})),status:Pr.FAILED}}}function e3(e,t,{isFirstMessage:n,placeholderChunk:r,streamId:s}){const o=t.context_uuid,a=t.backend_uuid;let i=Array.from(e.threads);const c={...e.entries};if(i.length>=W0e){const f=i[0];if(i=i.slice(1),f)for(const m of f.entryIds)delete c[m]}if(i=pH(i,o,a),t.status===Pr.COMPLETED)c[a]=t;else if(t.blocks){let f=c[a];f&&f.uuid!==t.uuid?f=r:f||(f=r);const m=f?.frontend_context_uuid??t.frontend_context_uuid??s,p=f?.frontend_uuid??t.frontend_uuid??s,h=f?.query_str??t.query_str,g=f?.connector_auth_info!=null&&!("connector_auth_info"in t)&&!n,y={...f??{},...t,frontend_context_uuid:m,frontend_uuid:p,query_str:h,...g&&{connector_auth_info:void 0},blocks:B0e(n?JS:f?.blocks??JS,t.blocks)};c[a]=y}const u=Ud.get(a);return Ud.set(a,{start:u?.start??Date.now(),latest:Date.now(),attempts:u?.attempts??1}),{threads:i,entries:c}}function yH(e,t,n){Z.error("Error in reading stream",n);const r=zi(e,t);if(!r)return e;const s=r?.entryId;if(!s)return e;const o={...e.entries[s],status:Pr.FAILED},{promise:a,abortController:i,...c}=r;return{activeStreams:e.activeStreams.filter(u=>u!==t),erroredStreams:{...e.erroredStreams,[s]:{...c,code:n instanceof kU?n.code:void 0}},entries:{...e.entries,[s]:o}}}const aR=Object.freeze([V0e]);function Qh(e,t){return(e.threads.find(r=>r.id===t.threadId)?.entryIds.map(r=>e.entries[r])??JS).filter(r=>r!=null)}function G0e(e,t){const n=zi(e,t);n&&(Ud.delete(n.entryId??""),sr.emit("completed",{stream:n,thread:Qh(e,n),message:n.entryId?e.entries[n.entryId]:void 0}))}function $0e(e,t,n,r){const s=zi(e,t);s&&sr.emit("progress",{stream:s,thread:Qh(e,s),message:e.entries[n.backend_uuid]??n,isFirstMessage:r})}function q0e(e,t,n){const r=zi(e,t);r&&sr.emit("error",{stream:r,thread:Qh(e,r),message:r.entryId?e.entries[r.entryId]:void 0,error:n,messageStreamMeta:Ud.get(r.entryId??"")})}function K0e(e,t,n,r){const s=zi(e,t);s&&sr.emit("created",{stream:s,thread:Qh(e,s),message:s.entryId?e.entries[s.entryId]:void 0,query:n,params:r})}function Y0e(e,t){const n=zi(e,t);n&&sr.emit("aborted",{stream:n,thread:Qh(e,n),message:n.entryId?e.entries[n.entryId]:void 0})}const Q0e=(e,t)=>({threads:[],entries:{},activeStreams:[],erroredStreams:{},middlewares:aR,streams:{},actions:{getEntryById:n=>t().entries[n],createStream:n=>t().actions.createBackwardsCompatibleStream(n,{reason:"create-stream",timer:Wa(void 0,{nowFromTimeOrigin:performance.now()})}).id,retryStream:n=>{const r=t().entries[n];if(!r)return!1;const s=t().erroredStreams[n];if(!s)return!1;const o=s.placeholderChunk?.query_str;if(!o)return!1;if(e(a=>{const{entries:i,threads:c}=a,{[n]:u,...f}=i,m=Array.from(c),p=c.findIndex(h=>h.entryIds.includes(n));return p===-1?a:(m.splice(p,1,{id:m[p].id,entryIds:m[p].entryIds}),{threads:m,entries:f})}),!ey(s.params))throw new Error("Stream params are not SubmitParams so cannot retry");return!!t().actions.createBackwardsCompatibleStream({query_str:o,params:{...s.params,existing_entry_uuid:n,query_source:"retry",frontend_context_uuid:r.frontend_context_uuid}},{placeholderChunk:s.placeholderChunk,timer:Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:"retry-stream"})},reconnectStream:n=>{const r=i4(t(),n);if(r&&r.promise&&r.abortController&&!r.abortController.signal.aborted)return r.id;const s=t().entries[n],o=s?.cursor,a=t().actions.createBackwardsCompatibleStream({query_str:"",params:{resume_entry_uuid:n,cursor:o}},{isReconnect:!0,timer:Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:"reconnect-stream"});e(c=>S_(c,a.id.description,{...s,status:Pr.PENDING}).newState,void 0,"ingestPlaceholderChunk");const i=Ud.get(n);return Ud.set(n,{start:i?.start??Date.now(),latest:i?.latest??Date.now(),attempts:(i?.attempts??0)+1}),a.id},createBackwardsCompatibleStream:(n,{isReconnect:r,placeholderChunk:s,onFirstMessageReceived:o,timer:a,reason:i})=>{const c=Array.from(t().activeStreams),u={...t().streams};if(c.length>=gH){const x=c.shift();try{x&&(u[x]?.abortController?.abort("Forced abort"),u[x]={...u[x],promise:null,abortController:null})}catch(v){Z.error("Failed to abort stream",new Ol("STREAM_FAILED_ABORT_ERROR",{cause:v,details:{request_id:x??"unknown",backend_uuid:"unknown"}}))}}const f=n.params?.frontend_uuid??crypto.randomUUID(),m=new AbortController,p={id:{description:f},promise:Promise.resolve(),abortController:m,isReconnect:r,entryId:n.params?.resume_entry_uuid,params:n.params,timer:a},h={message:async x=>{const v=zi(t(),f);if(v?.abortController?.signal.aborted)return;let b=!1;v?.threadId||(b=!0,o?.(x)),e(_=>{const{newState:w,status:S}=S_(_,f,x);if(S===Pr.FAILED&&v&&v.entryId){const{promise:C,abortController:E,...T}=v;return{...w,erroredStreams:{..._.erroredStreams,[v.entryId]:T}}}return w},void 0,"ingest"),v&&$0e(t(),f,x,b)}},g=n.params?.query_source==="default_search",y={[yn]:f};return Z.info("Starting stream",{request_id:f}),p.promise=(r?b0e.SSE("/rest/sse/perplexity_ask/reconnect/{resume_entry_uuid}",i,{path:{resume_entry_uuid:n.params?.resume_entry_uuid??""},params:{cursor:n.params?.cursor},signal:m.signal,handlers:h,headers:y}):de.SSE("/rest/sse/perplexity_ask",i,{params:{...n,params:{...n.params,version:z0e}},signal:m.signal,handlers:h,metrics:{omnisearch:g},timer:a,headers:y})).then(()=>G0e(t(),f),x=>{const v=t(),b=zi(v,f);b&&(e(_=>yH(_,f,new Ol("STREAM_FAILED_STREAM_ERROR",{cause:x,details:{request_id:f,backend_uuid:b.entryId??"unknown"}})),void 0,"handleStreamError"),q0e(v,f,x))}).finally(()=>{e(({activeStreams:x,streams:v})=>({streams:{...v,[f]:{...v[f],promise:null,abortController:null}},activeStreams:x.filter(b=>b!==f)}),void 0,"cleanupBackwardsCompatibleStream")}),c.push(f),e({activeStreams:c,streams:{...u,[f]:p}},void 0,"createBackwardsCompatibleStream"),K0e(t(),f,n.query_str,n.params),p.abortController?.signal.addEventListener("abort",()=>{Y0e(t(),f)}),s&&e(x=>S_(x,f,s).newState,void 0,"ingestPlaceholderChunk"),p},setMiddlewares:n=>{e(()=>({middlewares:[...aR,...n]}))}}}),l4=Yh("StreamStateContext",()=>Xi()(Xfe(Q0e))),Zp=l4.useSelector,xH=l4.useStore,X0e=()=>{const e=xH(),t=d.useMemo(()=>H0e(e.getState().actions.reconnectStream,{perMinute:20,perHour:120}),[e]);return d.useEffect(()=>{function n(){const a=e.getState(),i=new Set(a.activeStreams),c=new Set(Object.values(a.streams).filter(u=>i.has(u.id.description)).map(u=>u.entryId));Object.values(a.entries).forEach(u=>{const f=u.frontend_uuid?e.getState().streams[u.frontend_uuid]:void 0;f&&f.abortController?.signal.aborted||u?.reconnectable&&i.size{clearInterval(r),window.removeEventListener("online",s,!0),window.removeEventListener("offline",o,!0)}},[t,e]),null},vH=A.memo(({children:e})=>l.jsxs(l4.Provider,{children:[l.jsx(X0e,{}),e]}));vH.displayName="StreamStateProvider";const Z0e=()=>Zp(e=>e.actions.createBackwardsCompatibleStream),J0e=()=>Zp(e=>e.actions.reconnectStream),e1e=()=>Zp(e=>e.actions.retryStream),bH=e=>{const t=Zp(s=>s.activeStreams),n=Zp(s=>s.streams),r=Object.values(n).find(s=>s.id.description===e);return!!(r&&t.includes(r?.id.description))},Hs=()=>xH(),t1e=()=>{const e=Hs();return d.useCallback((t,n)=>{t&&e.setState(r=>{const s=r.entries[t],o=i4(r,t);if(o&&o.promise&&o.abortController&&!o.abortController.signal.aborted&&Z.error("Attempting to mutate entries while stream is active"),!s||!n)return r;const a=n(s);return a?{...r,entries:{...r.entries,[t]:a}}:r},void 0,"mutateEntry")},[e])},n1e=()=>{const e=Hs();return d.useCallback((t,n,{terminateStream:r=!0}={})=>{t&&e.setState(s=>{if(!t)return s;hH(s,t)&&r&&Z.error("Attempting to mutate entries while stream is active");const a=s.threads.findIndex(p=>p.id===t);if(a===-1)return s;const i=s.threads[a];if(!i)return s;const u=i.entryIds.map(p=>s.entries[p]).filter(p=>p!=null),f=n?.(u);if(!f)return s;const m=Array.from(s.threads);return m.splice(a,1,{...i,entryIds:f.map(p=>p.backend_uuid)}),{...s,entries:{...s.entries,...f.reduce((p,h)=>(p[h.backend_uuid]=h,p),{})},threads:m}},void 0,"mutateEntries")},[e])},r1e=()=>{const e=Hs();return d.useCallback(t=>{t&&e.setState(n=>{const r=n.entries[t],s=i4(n,t);if(s&&s.promise&&s.abortController&&!s.abortController.signal.aborted&&s.abortController?.abort("Forced abort"),!r)return n;const o={...n.entries};delete o[t];const a=n.threads.map(i=>{const c=i.entryIds.indexOf(t);if(c===-1)return i;const u=[...i.entryIds];if(u.splice(c,1),!!u.length)return{...i,entryIds:u}}).filter(i=>!!i);return{...n,entries:o,threads:a}},void 0,"deleteEntry")},[e])},s1e=()=>{const e=Hs();return d.useCallback(t=>{t&&e.setState(n=>{if(!t)return n;const r=hH(n,t);r&&r.abortController?.abort("Forced abort");const s=n.threads.findIndex(u=>u.id===t);if(s===-1)return n;const o=n.threads[s];if(!o)return n;const a=o.entryIds;let i;a.length?(i={...n.entries},a.forEach(u=>delete i[u])):i=n.entries;const c=n.threads.filter(u=>u.id!==t);return{...n,entries:i,threads:c}},void 0,"deleteEntries")},[e])};function o1e(e){const t=Hs(),n=Object.values(t.getState().erroredStreams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.entryId===e)return o}}const _H=A.memo(({middlewares:e})=>{const t=Hs();return d.useLayoutEffect(()=>{t.getState().actions.setMiddlewares(e)},[e,t]),null});_H.displayName="MiddlewareRegistry";function c4(){const e=Hs();return d.useCallback(t=>e.getState().streams[t]?.timer,[e])}function a1e(){const e=Hs();return d.useCallback(()=>e.getState().activeStreams.length>0,[e])}const wH=1e3*60,iR=60*wH,i1e=wH/2,l1e={isOutdated:()=>!1,canRefresh:()=>!1,refresh:async()=>!1},CH=Ft("RefreshContext",{outdated:!1,refresh:async()=>!1,canRefresh:()=>!1}),SH=A.memo(({children:e,enabled:t,buildVersion:n,ref:r})=>{const{session:s}=Ne(),o=s?.user?.email?.endsWith("@perplexity.ai"),a=a1e(),i=y0e(),{env:{isLocalhost:c}}=sn(),u=d.useRef(n),[f,m]=d.useState(!1),[p,h]=d.useState(0),g=t&&f,y=d.useCallback(async()=>{try{const _=nV()?.comet_web_resources_extension_version;if(c||f||!t)return;const w=await p0e();if(Pl("build_version_refresh_check_version",{isCometSidecarClient:!0,currentVersion:n,latestVersion:w}),!n&&w){u.current=w;return}n&&w&&w!==n&&(m(!0),h(o?Date.now():Date.now()+Math.random()*iR))}catch{Z.log("Error getting build version")}},[n,t,o,c,f]),x=d.useCallback(()=>!(!g||!p||document.hidden||a()||i()||Date.now(){if(!g||!p)return!1;if(!x())return!0;try{await lH()}catch{Z.log("Error clearing service worker runtime cache")}try{await IU()}catch{Z.log("Error clearing persisted cache")}return Pl("build_version_refresh"),_?No(_,"Build version refresh (redirect)"):hx("Build version refresh (reload)"),!1},[x,g,p]),b=d.useMemo(()=>Cf(y,i1e,{maxWait:iR,leading:!1,trailing:!0}),[y]);return d.useEffect(()=>(document.addEventListener("visibilitychange",b),window.addEventListener("focus",b),window.addEventListener("keydown",b),window.addEventListener("mousedown",b),()=>{document.removeEventListener("visibilitychange",b),window.removeEventListener("focus",b),window.removeEventListener("keydown",b),window.removeEventListener("mousedown",b)}),[b]),d.useImperativeHandle(r,()=>({isOutdated:()=>g,canRefresh:()=>x(),refresh:async _=>await v(_)})),l.jsx(CH.Provider,{value:d.useMemo(()=>({outdated:g,refresh:v,canRefresh:x}),[g,v,x]),children:e})});SH.displayName="RefreshProvider";const c1e=()=>d.useContext(CH);var Xo={},lR;function u1e(){if(lR)return Xo;lR=1;var e=Xo&&Xo.__awaiter||function(s,o,a,i){function c(u){return u instanceof a?u:new a(function(f){f(u)})}return new(a||(a=Promise))(function(u,f){function m(g){try{h(i.next(g))}catch(y){f(y)}}function p(g){try{h(i.throw(g))}catch(y){f(y)}}function h(g){g.done?u(g.value):c(g.value).then(m,p)}h((i=i.apply(s,o||[])).next())})};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.identify=Xo.subscribe=Xo.publish=void 0;const t=(s,o)=>{window.todesktop.ipc.publish(s,o)};Xo.publish=t;const n=(s,o)=>window.todesktop.ipc.subscribe(s,o);Xo.subscribe=n;const r=()=>e(void 0,void 0,void 0,function*(){return window.todesktop.ipc.identify()});return Xo.identify=r,Xo}var cR=u1e();const Xh=()=>{const{device:{isWindowsApp:e}}=sn(),t=d.useRef({}),n=d.useRef({}),r=d.useCallback((o,a)=>{if(e)try{cR.publish(o,a)}catch{try{if(typeof BroadcastChannel<"u"){let c=t.current[o];c||(c=new BroadcastChannel(o),t.current[o]=c),c.postMessage(a)}else Z.warn("Neither IPC publish nor BroadcastChannel are available in this runtime")}catch(c){Z.warn("Error using BroadcastChannel: ",c)}}},[e]),s=d.useCallback((o,a)=>{if(e)try{return cR.subscribe(o,a)}catch{try{if(typeof BroadcastChannel<"u"){let c=t.current[o];c||(c=new BroadcastChannel(o),t.current[o]=c);let u=n.current[o];u||(u=new Set,n.current[o]=u);const f=m=>{a(m.data)};return u.add(a),c.addEventListener("message",f),()=>{c.removeEventListener("message",f),u.delete(a),u.size===0&&(c.close(),delete t.current[o],delete n.current[o])}}Z.warn("Neither IPC subscribe nor BroadcastChannel are available in this runtime");return}catch(c){Z.warn("Error using BroadcastChannel: ",c);return}}},[e]);return d.useMemo(()=>({safeWindowsIpcPublish:r,safeWindowsIpcSubscribe:s}),[r,s])},Ix=()=>{const{device:{isWindowsApp:e}}=sn(),[t,n]=d.useState(void 0);return d.useEffect(()=>{e&&q(()=>import("./index-DxZN0OQK.js"),[]).then(r=>n(r))},[e]),t},EH=Ft("WindowsAppPanelContext",null),d1e=({children:e})=>{const t=d.useRef(null),n=d.useRef(!1),r=On(),{device:{isWindowsApp:s}}=sn(),[o,a]=d.useState(!1),i=Ix(),{safeWindowsIpcPublish:c,safeWindowsIpcSubscribe:u}=Xh(),f=!!(s&&r?.includes(Yp));d.useEffect(()=>{if(!f)return;const x=u(z7,v=>{a(v)});return()=>{x?.()}},[f,u]);const m=d.useCallback(async()=>{if(!i)return;const x=await i.nativeWindow.isVisible({ref:t.current}),v=b=>{a(b),c(z7,b)};return v(x),i.nativeWindow.on("show",()=>v(!0),{ref:t.current}),i.nativeWindow.on("hide",()=>v(!1),{ref:t.current}),()=>{try{t.current&&(i.nativeWindow.removeAllListeners("show",{ref:t.current}),i.nativeWindow.removeAllListeners("hide",{ref:t.current}))}catch(b){Z.warn("Error removing window listeners during cleanup",b)}}},[t,i,c]),p=d.useCallback(async()=>{if(!i)return!1;if(n.current)return Z.info("Already creating window, skipping"),!1;if(t.current)try{return await i.nativeWindow.isVisible({ref:t.current}),Z.info("Existing window is still valid, skipping creation"),!0}catch{Z.warn("Existing window reference is invalid, will create new window"),t.current=null}try{Z.info("Starting panel window creation"),n.current=!0;const x=await i.nativeWindow.create({width:720,height:350,transparent:!0,show:!1,frame:!1,alwaysOnTop:!0,type:"panel"});if(!x)throw new Error("Failed to create window - no window reference returned");const v=await i.nativeWindow.getWebContents({ref:x});if(!v)throw new Error("Failed to get web contents");const b=await i.views.create({webPreferences:{nodeIntegration:!0,contextIsolation:!1}});if(!b)throw new Error("Failed to create view");await i.nativeWindow.setBrowserView({ref:x,viewRef:b});const _=new URL(Yp,window.location.origin).toString();await i.webContents.loadURL({ref:v},_),t.current=x;const w=await m();if(w){const S=t.current;i.nativeWindow.on("close",w,{ref:S})}return i.nativeWindow.on("close",()=>{},{ref:x,preventDefault:!0}),!0}catch(x){return Z.error("Error creating panel window: ",x),t.current=null,!1}finally{n.current=!1}},[m,i]),h=d.useCallback(async()=>{if(!i)return!1;try{if(!t.current)return Z.info("No panel window to hide"),!1;try{return await i.nativeWindow.hide({ref:t.current}),!0}catch(x){return Z.warn("Error hiding panel, window may be invalid",x),t.current=null,!1}}catch(x){return Z.warn("Error in hidePanel: ",x),!1}},[i]),g=d.useCallback(async()=>{if(i)try{if(t.current){if(o){Z.info("Panel window is already visible, skipping centering");return}}else if(!await p())return;const x=await i.screen.getCursorScreenPoint(),v=(await i.screen.getDisplayNearestPoint(x)).bounds,[b=0,_]=await i.nativeWindow.getSize({ref:t.current});await i.nativeWindow.setPosition({ref:t.current},Math.round(v.x+(v.width-b)/2),Math.round(v.y+v.height*.3)),await i.nativeWindow.show({ref:t.current}),await i.nativeWindow.focus({ref:t.current})}catch(x){Z.warn("Error showing panel: ",x)}},[p,o,i]),y={isVisible:o,isWindowsAppPanelView:f,handleShowPanel:g,handleHidePanel:h,createPanelWindow:p};return l.jsx(EH.Provider,{value:y,children:e})},Px=()=>{const e=d.useContext(EH);if(!e)throw new Error("useWindowsAppPanel must be used within a WindowsAppPanelProvider");return e},kH={keyProp:0,message:null,variant:"success",timeout:null,description:void 0,isVisible:!1,ctaText:void 0,ctaOnClick:void 0,openToast:()=>{},closeToast:()=>{}},MH=Ft("ToastStateContext",kH),TH=A.memo(({children:e})=>{const[t,n]=d.useState(kH),r=d.useCallback(({message:a,variant:i,timeout:c,description:u,ctaText:f,ctaOnClick:m,iconOverride:p,position:h="top"})=>{n(g=>({...g,message:a,variant:i,timeout:c,description:u,ctaText:f,ctaOnClick:m,iconOverride:p,position:h??"top",isVisible:!0,keyProp:(g.keyProp||0)+1}))},[]),s=d.useCallback(()=>{n(a=>({...a,isVisible:!1}))},[]),o=d.useMemo(()=>({...t,openToast:r,closeToast:s}),[t,r,s]);return l.jsx(MH.Provider,{value:o,children:e})});TH.displayName="ToastStateProvider";const hn=()=>{const e=d.useContext(MH);if(!e)throw new Error("useToastState must be used within ToastContext");return e},f1e="pplx.hasUpdated",AH=A.memo(()=>{const{outdated:e,refresh:t}=c1e(),{openToast:n}=hn(),{isWindowsAppPanelView:r}=Px(),{inApp:s}=Sa(),{$t:o}=J(),a=Ca(),[i,c]=xfe(f1e,!1);return d.useEffect(()=>{i&&!r&&!s&&(c(!1),n({message:o({defaultMessage:"Updated to latest version",id:"5SFf7ytcaw"}),variant:"success",timeout:4}))},[]),d.useEffect(()=>{if(!e)return;!a&&c(!0);let u=!1;return(async function f(){const m=await t();u||m&&(await new Promise(p=>setTimeout(p,60*1e3)),f())})(),()=>{u=!0}},[a,e,t,c]),null});AH.displayName="IdleRefresh";const NH=A.memo(function(){const{session:t}=Ne(),n=d.useMemo(()=>{if(t)return{id:t.user.id,name:t.user.name,email:t.user.email,isPro:!!t.user.subscription_status&&t.user.subscription_status!=="none"}},[t]);if(!n)return null;const r=OU(globalThis.navigator?.userAgent??"");return l.jsxs(l.Fragment,{children:[l.jsx(vfe,{session:n,isWindowsApp:r}),l.jsx(bfe,{session:n,isWindowsApp:r})]})});NH.displayName="Instrumentation";async function m1e(){try{return(await(await fetch("/cdn-cgi/trace")).text()).split(` -`).reduce((n,r)=>{const[s,o]=r.split("=");return n[s]=o??"",n},{loc:"US"})}catch(e){return Z.error("Error getting Cloudflare trace",e),{loc:"US"}}}function Ox(){const{data:e}=mt({queryKey:be.makeEphemeralQueryKey("cloudflare-trace"),queryFn:m1e,staleTime:6e4});return d.useMemo(()=>e?.loc??"US",[e])}const p1e=({children:e,hostname:t})=>{const{session:n}=Ne(),r=Ox();return l.jsx(pge,{hostname:t,session:n??void 0,cfCountry:r,children:e})},h1e="useModalContext must be used within a ModalProvider";function Uo(){const e=d.useContext(ume);return dme(e,h1e),e}var ie;(function(e){e.DEFAULT="turbo",e.PPLX_PRO_UPGRADED="pplx_pro_upgraded",e.PRO="pplx_pro",e.SONAR="experimental",e.GPT_4o="gpt4o",e.GPT_4_1="gpt41",e.GPT_5_1="gpt51",e.GPT_5_2="gpt52",e.CLAUDE_2="claude2",e.GEMINI_2_5_PRO="gemini25pro",e.GEMINI_3_0_PRO="gemini30pro",e.GEMINI_3_0_FLASH="gemini30flash",e.GEMINI_3_0_FLASH_HIGH="gemini30flash_high",e.GROK="grok",e.PPLX_REASONING="pplx_reasoning",e.CLAUDE_3_7_SONNET_THINKING="claude37sonnetthinking",e.O4_MINI="o4mini",e.GPT_5_1_THINKING="gpt51_thinking",e.GPT_5_2_THINKING="gpt52_thinking",e.CLAUDE_4_0_OPUS="claude40opus",e.CLAUDE_4_1_OPUS="claude41opus",e.CLAUDE_4_5_OPUS="claude45opus",e.CLAUDE_4_0_OPUS_THINKING="claude40opusthinking",e.CLAUDE_4_1_OPUS_THINKING="claude41opusthinking",e.CLAUDE_4_5_OPUS_THINKING="claude45opusthinking",e.CLAUDE_4_5_SONNET="claude45sonnet",e.CLAUDE_4_5_SONNET_THINKING="claude45sonnetthinking",e.KIMI_K2_THINKING="kimik2thinking",e.GROK_4="grok4",e.GROK_4_NON_THINKING="grok4nonthinking",e.GROK_4_1_REASONING="grok41reasoning",e.GROK_4_1_NON_REASONING="grok41nonreasoning",e.PPLX_SONAR_INTERNAL_TESTING="pplx_sonar_internal_testing",e.PPLX_SONAR_INTERNAL_TESTING_V2="pplx_sonar_internal_testing_v2",e.ALPHA="pplx_alpha",e.BETA="pplx_beta",e.STUDY="pplx_study"})(ie||(ie={}));var nt;(function(e){e.GPT_4="gpt4",e.CLAUDE_3_OPUS="claude3opus",e.CLAUDE_3_5_HAIKU="claude35haiku",e.GEMINI="gemini",e.LLAMA_X_LARGE="llama_x_large",e.MISTRAL="mistral",e.GROK2="grok2",e.COPILOT="copilot",e.O3_MINI="o3mini",e.CLAUDE_OMBRE_EAP="claude_ombre_eap",e.CLAUDE_LACE_EAP="claude_lace_eap",e.R1="r1",e.GAMMA="pplx_gamma",e.O3="o3",e.GEMINI_2_FLASH="gemini2flash",e.GPT_5="gpt5",e.GPT_5_THINKING="gpt5_thinking",e.GPT5_PRO="gpt5_pro",e.O3_PRO="o3pro",e.O3_PRO_RESEARCH="o3pro_research",e.O3_PRO_LABS="o3pro_labs",e.TESTING_MODEL_C="testing_model_c",e.O3_RESEARCH="o3_research",e.CLAUDE40SONNET_RESEARCH="claude40sonnet_research",e.CLAUDE40SONNETTHINKING_RESEARCH="claude40sonnetthinking_research",e.CLAUDE40OPUS_RESEARCH="claude40opus_research",e.CLAUDE40OPUSTHINKING_RESEARCH="claude40opusthinking_research",e.O3_LABS="o3_labs",e.CLAUDE40SONNETTHINKING_LABS="claude40sonnetthinking_labs",e.CLAUDE40OPUSTHINKING_LABS="claude40opusthinking_labs"})(nt||(nt={}));var oe;(function(e){e.SEARCH="search",e.RESEARCH="research",e.STUDIO="studio",e.STUDY="study"})(oe||(oe={}));var Jn;(function(e){e.PRO="pro",e.MAX="max"})(Jn||(Jn={}));const RH={[ie.DEFAULT]:oe.SEARCH,[ie.PPLX_PRO_UPGRADED]:oe.SEARCH,[ie.PRO]:oe.SEARCH,[ie.SONAR]:oe.SEARCH,[ie.CLAUDE_2]:oe.SEARCH,[ie.CLAUDE_4_5_SONNET]:oe.SEARCH,[ie.CLAUDE_4_5_SONNET_THINKING]:oe.SEARCH,[ie.KIMI_K2_THINKING]:oe.SEARCH,[ie.GPT_4o]:oe.SEARCH,[ie.GPT_4_1]:oe.SEARCH,[ie.GPT_5_1]:oe.SEARCH,[ie.GPT_5_2]:oe.SEARCH,[ie.GEMINI_2_5_PRO]:oe.SEARCH,[ie.GEMINI_3_0_PRO]:oe.SEARCH,[ie.GEMINI_3_0_FLASH]:oe.SEARCH,[ie.GEMINI_3_0_FLASH_HIGH]:oe.SEARCH,[ie.GROK]:oe.SEARCH,[ie.PPLX_REASONING]:oe.SEARCH,[ie.CLAUDE_3_7_SONNET_THINKING]:oe.SEARCH,[ie.CLAUDE_4_0_OPUS]:oe.SEARCH,[ie.CLAUDE_4_0_OPUS_THINKING]:oe.SEARCH,[ie.CLAUDE_4_1_OPUS]:oe.SEARCH,[ie.CLAUDE_4_1_OPUS_THINKING]:oe.SEARCH,[ie.CLAUDE_4_5_OPUS]:oe.SEARCH,[ie.CLAUDE_4_5_OPUS_THINKING]:oe.SEARCH,[ie.GROK_4]:oe.SEARCH,[ie.GROK_4_NON_THINKING]:oe.SEARCH,[ie.GROK_4_1_REASONING]:oe.SEARCH,[ie.GROK_4_1_NON_REASONING]:oe.SEARCH,[ie.GPT_5_1_THINKING]:oe.SEARCH,[ie.GPT_5_2_THINKING]:oe.SEARCH,[ie.PPLX_SONAR_INTERNAL_TESTING]:oe.SEARCH,[ie.PPLX_SONAR_INTERNAL_TESTING_V2]:oe.SEARCH,[nt.TESTING_MODEL_C]:oe.SEARCH,[nt.GPT_5_THINKING]:oe.SEARCH,[nt.GPT_5]:oe.SEARCH,[nt.GPT5_PRO]:oe.SEARCH,[nt.GPT_4]:oe.SEARCH,[nt.CLAUDE_3_OPUS]:oe.SEARCH,[nt.CLAUDE_3_5_HAIKU]:oe.SEARCH,[nt.GEMINI]:oe.SEARCH,[nt.LLAMA_X_LARGE]:oe.SEARCH,[nt.MISTRAL]:oe.SEARCH,[nt.GROK2]:oe.SEARCH,[nt.COPILOT]:oe.SEARCH,[nt.O3_MINI]:oe.SEARCH,[nt.CLAUDE_OMBRE_EAP]:oe.SEARCH,[nt.CLAUDE_LACE_EAP]:oe.SEARCH,[nt.R1]:oe.SEARCH,[nt.GAMMA]:oe.SEARCH,[nt.O3]:oe.SEARCH,[nt.GEMINI_2_FLASH]:oe.SEARCH,[nt.O3_PRO]:oe.SEARCH,[nt.O3_PRO_RESEARCH]:oe.RESEARCH,[nt.O3_PRO_LABS]:oe.STUDIO,[nt.O3_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40SONNET_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40SONNETTHINKING_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40OPUS_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40OPUSTHINKING_RESEARCH]:oe.RESEARCH,[nt.O3_LABS]:oe.STUDIO,[nt.CLAUDE40SONNETTHINKING_LABS]:oe.STUDIO,[nt.CLAUDE40OPUSTHINKING_LABS]:oe.STUDIO,[ie.ALPHA]:oe.RESEARCH,[ie.O4_MINI]:oe.RESEARCH,[ie.BETA]:oe.STUDIO,[ie.STUDY]:oe.STUDY},an=(e,t=oe.SEARCH)=>e&&RH[e]||t,DH={[oe.SEARCH]:$me,[oe.RESEARCH]:hM,[oe.STUDIO]:pM,[oe.STUDY]:Gme},t3=e=>DH[e],g1e={...DH,[oe.SEARCH]:B("search")},y1e=e=>g1e[e],x1e={auto:{model:ie.DEFAULT,mode:oe.SEARCH},reasoning:{model:ie.PPLX_REASONING,mode:oe.SEARCH},deep_research:{model:ie.ALPHA,mode:oe.RESEARCH}},jH=e=>typeof e=="string"&&e in RH,v1e=e=>jH(e)?e:void 0,uR=Object.values(oe),b1e=[{search_model:ie.SONAR,has_new_tag:!1,subscription_tier:Jn.PRO},{search_model:ie.CLAUDE_4_5_SONNET,has_new_tag:!0,subscription_tier:Jn.PRO},{search_model:ie.CLAUDE_4_5_SONNET_THINKING,has_new_tag:!0,is_reasoning_model:!0,subscription_tier:Jn.PRO},{search_model:ie.CLAUDE_4_1_OPUS_THINKING,has_new_tag:!1,is_reasoning_model:!0,subscription_tier:Jn.MAX},{search_model:ie.GEMINI_2_5_PRO,has_new_tag:!1,subscription_tier:Jn.PRO},{search_model:ie.GPT_5_1,has_new_tag:!0,subscription_tier:Jn.PRO},{search_model:ie.GPT_5_1_THINKING,has_new_tag:!0,is_reasoning_model:!0,subscription_tier:Jn.PRO},{search_model:ie.GROK_4,has_new_tag:!1,is_reasoning_model:!0,subscription_tier:Jn.PRO}],Cxt=e=>e?[nt.GPT_5_THINKING,ie.GROK_4,ie.GROK_4_1_REASONING,ie.CLAUDE_4_0_OPUS_THINKING,ie.CLAUDE_4_1_OPUS_THINKING,ie.CLAUDE_4_5_OPUS_THINKING,nt.O3_PRO,nt.GPT5_PRO].includes(e):!1,u4=Yh("AskInputContext",()=>Xi((e,t)=>({activeMenu:null,fileUploadUpsellTooltipOpen:!1,suggestions:Pe,blankStateSuggestions:{[oe.SEARCH]:null,[oe.RESEARCH]:null,[oe.STUDIO]:null,[oe.STUDY]:null},showSuggestDropdown:!1,browserAgentAllowOnceFromToggle:!1,forceEnableBrowserAgent:!1,actions:{onActiveMenuChange:n=>{e({activeMenu:n})},setFileUploadUpsellTooltipOpen:n=>{e({fileUploadUpsellTooltipOpen:n})},setSuggestions:n=>{e({suggestions:n})},setBlankStateSuggestions:(n,r)=>{const s=t().blankStateSuggestions;e({blankStateSuggestions:{...s,[r]:n}})},setShowSuggestDropdown:n=>{e({showSuggestDropdown:n})},setBrowserAgentAllowOnce:n=>{e({browserAgentAllowOnceFromToggle:n})},setForceEnableBrowserAgent:n=>{e({forceEnableBrowserAgent:n})}},inputRef:d.createRef()}))),Wc=u4.Provider,_1e=u4.useSelector,w1e=u4.useTrackedState,jo=()=>_1e(e=>e.actions),qr=w1e,C1e={pro:"pro",max:"max"},S1e=e=>Object.keys(C1e).includes(e);function $t(){const{session:e}=Ne(),t=e?.user?.subscription_status??"none",n=t==="active"||t==="trialing"||t==="white_glove_past_due",r=e?.user?.subscription_tier,s=S1e(r)?r:void 0,o=n&&(s==="pro"||!s),a=n&&s==="max",i=o||a,c=n?e?.user?.subscription_source:"none",u=n&&c==="enterprise",f=u&&(s==="pro"||!s),m=u&&s==="max";return d.useMemo(()=>({isPro:o,isMax:a,hasAccessToProFeatures:i,hasActiveSubscription:n,subscriptionSource:c,subscriptionStatus:t,subscriptionTier:s,isEnterprise:u,isEnterprisePro:f,isEnterpriseMax:m}),[i,a,o,n,c,t,s,u,f,m])}const dR=1e9;function E1e(e,t){const{event_entity:n,event_type:r,value_upper_bound:s,value_lower_bound:o}=e;let a="";return r==="STOCK_PRICE_TARGET"?o!=null?a=t.formatMessage({defaultMessage:"goes below ${value}",id:"RKgpKR3E99"},{value:o}):s!=null?a=t.formatMessage({defaultMessage:"goes above ${value}",id:"8eV5ClXcpi"},{value:s}):a=t.formatMessage({defaultMessage:"price target",id:"vnTdzDaohg"}):r==="STOCK_PRICE_MOVEMENT"?o!=null?a=t.formatMessage({defaultMessage:"drops {percent}%+",id:"Vl3IJiE9mt"},{percent:Math.abs(o)}):s!=null?a=t.formatMessage({defaultMessage:"rises {percent}%+",id:"EK4T00JAfI"},{percent:s}):a=t.formatMessage({defaultMessage:"price movement",id:"Pcu8sUjesQ"}):a=t.formatMessage({defaultMessage:"event triggers",id:"LpIhmla5ty"}),{kind:n,friendly:a,isRecurring:!1}}var n3=["MO","TU","WE","TH","FR","SA","SU"],ys=(function(){function e(t,n){if(n===0)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=n}return e.fromStr=function(t){return new e(n3.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=n3[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e})(),hr=function(e){return e!=null},Pa=function(e){return typeof e=="number"},fR=function(e){return typeof e=="string"&&n3.includes(e)},oo=Array.isArray,di=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var n=[],r=e;r>0,r.length>t?String(r):(t=t-r.length,t>n.length&&(n+=ln(n,t/n.length)),n.slice(0,t)+String(r))}var M1e=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},bo=function(e,t){var n=e%t;return n*t<0?n+t:n},E_=function(e,t){return{div:Math.floor(e/t),mod:bo(e,t)}},Fa=function(e){return!hr(e)||e.length===0},jr=function(e){return!Fa(e)},Tn=function(e,t){return jr(e)&&e.indexOf(t)!==-1},Gc=function(e,t,n,r,s,o){return r===void 0&&(r=0),s===void 0&&(s=0),o===void 0&&(o=0),new Date(Date.UTC(e,t-1,n,r,s,o))},T1e=[31,28,31,30,31,30,31,31,30,31,30,31],IH=1e3*60*60*24,PH=9999,OH=Gc(1970,1,1),A1e=[6,0,1,2,3,4,5],fp=function(e){return e%4===0&&e%100!==0||e%400===0},LH=function(e){return e instanceof Date},Qm=function(e){return LH(e)&&!isNaN(e.getTime())},N1e=function(e,t){var n=e.getTime(),r=t.getTime(),s=n-r;return Math.round(s/IH)},r3=function(e){return N1e(e,OH)},FH=function(e){return new Date(OH.getTime()+e*IH)},R1e=function(e){var t=e.getUTCMonth();return t===1&&fp(e.getUTCFullYear())?29:T1e[t]},Vd=function(e){return A1e[e.getUTCDay()]},mR=function(e,t){var n=Gc(e,t+1,1);return[Vd(n),R1e(n)]},BH=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},s3=function(e){var t=new Date(e.getTime());return t},pR=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(n)return!0;if(r)return!1}else if(this.method==="before"){if(r)return!1}else if(this.method==="after")return n?!0:(this.add(t),!1);return this.add(t)},e.prototype.add=function(t){return this._result.push(t),!0},e.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e})(),gR=(function(e){aM(t,e);function t(n,r,s){var o=e.call(this,n,r)||this;return o.iterator=s,o}return t.prototype.add=function(n){return this.iterator(n,this._result.length)?(this._result.push(n),!0):!1},t})(sd),qy={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},yR=function(e,t){return e.indexOf(t)!==-1},j1e=function(e){return e.toString()},I1e=function(e,t,n){return"".concat(t," ").concat(n,", ").concat(e)},Zi=(function(){function e(t,n,r,s){if(n===void 0&&(n=j1e),r===void 0&&(r=qy),s===void 0&&(s=I1e),this.text=[],this.language=r||qy,this.gettext=n,this.dateFormatter=s,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort(function(f,m){return f-m}),a.sort(function(f,m){return m-f}),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(hr(this.origOptions.byweekday)){var i=oo(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(i);this.byweekday={allWeeks:i.filter(function(f){return!f.n}),someWeeks:i.filter(function(f){return!!f.n}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var u=function(f,m){return f.weekday-m.weekday};this.byweekday.allWeeks.sort(u),this.byweekday.someWeeks.sort(u),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){var n=!0;if(!(t.options.freq in e.IMPLEMENTED)||t.origOptions.until&&t.origOptions.count)return!1;for(var r in t.origOptions){if(yR(["dtstart","tzid","wkst","freq"],r))return!0;if(!yR(e.IMPLEMENTED[t.options.freq],r))return!1}return n},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[tt.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},e.prototype.MINUTELY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},e.prototype.DAILY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(this.options.interval===1&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},e.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},e.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},e.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},e.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(t){t=parseInt(t.toString(),10);var n,r=this.gettext;if(t===-1)return r("last");var s=Math.abs(t);switch(s){case 1:case 21:case 31:n=s+r("st");break;case 2:case 22:n=s+r("nd");break;case 3:case 23:n=s+r("rd");break;default:n=s+r("th")}return t<0?n+" "+r("last"):n},e.prototype.monthtext=function(t){return this.language.monthNames[t-1]},e.prototype.weekdaytext=function(t){var n=Pa(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[n]},e.prototype.plural=function(t){return t%100!==1},e.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},e.prototype.list=function(t,n,r,s){var o=this;s===void 0&&(s=","),oo(t)||(t=[t]);var a=function(c,u,f){for(var m="",p=0;pt[0].length)&&(t=o,n=s)}if(t!=null&&(this.text=this.text.substr(t[0].length),this.text===""&&(this.done=!0)),t==null){this.done=!0,this.symbol=null,this.value=null;return}}while(n==="SKIP");return this.symbol=n,this.value=t,!0},e.prototype.accept=function(t){if(this.symbol===t){if(this.value){var n=this.value;return this.nextSymbol(),n}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},e})();function UH(e,t){t===void 0&&(t=qy);var n={},r=new P1e(t.tokens);if(!r.start(e))return null;return s(),n;function s(){r.expect("every");var p=r.acceptNumber();if(p&&(n.interval=parseInt(p[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=tt.DAILY,r.nextSymbol()&&(a(),m());break;case"weekday(s)":n.freq=tt.WEEKLY,n.byweekday=[tt.MO,tt.TU,tt.WE,tt.TH,tt.FR],r.nextSymbol(),a(),m();break;case"week(s)":n.freq=tt.WEEKLY,r.nextSymbol()&&(o(),a(),m());break;case"hour(s)":n.freq=tt.HOURLY,r.nextSymbol()&&(o(),m());break;case"minute(s)":n.freq=tt.MINUTELY,r.nextSymbol()&&(o(),m());break;case"month(s)":n.freq=tt.MONTHLY,r.nextSymbol()&&(o(),m());break;case"year(s)":n.freq=tt.YEARLY,r.nextSymbol()&&(o(),m());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=tt.WEEKLY;var h=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[tt[h]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var g=c();if(!g)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(tt[g]),r.nextSymbol()}a(),f(),m();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=tt.YEARLY,n.bymonth=[i()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=i();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}o(),m();break;default:throw new Error("Unknown symbol")}}function o(){var p=r.accept("on"),h=r.accept("the");if(p||h)do{var g=u(),y=c(),x=i();if(g)y?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(tt[y].nth(g))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(g),r.accept("day(s)"));else if(y)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(tt[y]);else if(r.symbol==="weekday(s)")r.nextSymbol(),n.byweekday||(n.byweekday=[tt.MO,tt.TU,tt.WE,tt.TH,tt.FR]);else if(r.symbol==="week(s)"){r.nextSymbol();var v=r.acceptNumber();if(!v)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(v[0],10)];r.accept("comma");){if(v=r.acceptNumber(),!v)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(v[0],10))}}else if(x)r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(x);else return}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function a(){var p=r.accept("at");if(p)do{var h=r.acceptNumber();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(h[0],10)];r.accept("comma");){if(h=r.acceptNumber(),!h)throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(h[0],10))}}while(r.accept("comma")||r.accept("at"))}function i(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function u(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var p=parseInt(r.value[1],10);if(p<-366||p>366)throw new Error("Nth out of range: "+p);return r.nextSymbol(),r.accept("last")?-p:p;default:return!1}}function f(){r.accept("on"),r.accept("the");var p=u();if(p)for(n.bymonthday=[p],r.nextSymbol();r.accept("comma");){if(p=u(),!p)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(p),r.nextSymbol()}}function m(){if(r.symbol==="until"){var p=Date.parse(r.text);if(!p)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(p)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}var cn;(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(cn||(cn={}));function m4(e){return e12){var r=Math.floor(this.month/12),s=bo(this.month,12);this.month=s,this.year+=r,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(n,r){r>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-r))+n*7:this.day+=-(this.getWeekday()-r)+n*7,this.fixDay()},t.prototype.addDaily=function(n){this.day+=n,this.fixDay()},t.prototype.addHours=function(n,r,s){for(r&&(this.hour+=Math.floor((23-this.hour)/n)*n);;){this.hour+=n;var o=E_(this.hour,24),a=o.div,i=o.mod;if(a&&(this.hour=i,this.addDaily(a)),Fa(s)||Tn(s,this.hour))break}},t.prototype.addMinutes=function(n,r,s,o){for(r&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/n)*n);;){this.minute+=n;var a=E_(this.minute,60),i=a.div,c=a.mod;if(i&&(this.minute=c,this.addHours(i,!1,s)),(Fa(s)||Tn(s,this.hour))&&(Fa(o)||Tn(o,this.minute)))break}},t.prototype.addSeconds=function(n,r,s,o,a){for(r&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/n)*n);;){this.second+=n;var i=E_(this.second,60),c=i.div,u=i.mod;if(c&&(this.second=u,this.addMinutes(c,!1,s,o)),(Fa(s)||Tn(s,this.hour))&&(Fa(o)||Tn(o,this.minute))&&(Fa(a)||Tn(a,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var n=mR(this.year,this.month-1)[1];if(!(this.day<=n))for(;this.day>n;){if(this.day-=n,++this.month,this.month===13&&(this.month=1,++this.year,this.year>PH))return;n=mR(this.year,this.month-1)[1]}}},t.prototype.add=function(n,r){var s=n.freq,o=n.interval,a=n.wkst,i=n.byhour,c=n.byminute,u=n.bysecond;switch(s){case cn.YEARLY:return this.addYears(o);case cn.MONTHLY:return this.addMonths(o);case cn.WEEKLY:return this.addWeekly(o,a);case cn.DAILY:return this.addDaily(o);case cn.HOURLY:return this.addHours(o,r,i);case cn.MINUTELY:return this.addMinutes(o,r,i,c);case cn.SECONDLY:return this.addSeconds(o,r,i,c,u)}},t})(Ky);function VH(e){for(var t=[],n=Object.keys(e),r=0,s=n;r=-366&&r<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||jr(t.byweekno)||jr(t.byyearday)||t.bymonthday||jr(t.bymonthday)||hr(t.byweekday)||hr(t.byeaster)))switch(t.freq){case tt.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case tt.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case tt.WEEKLY:t.byweekday=[Vd(t.dtstart)];break}if(hr(t.bymonth)&&!oo(t.bymonth)&&(t.bymonth=[t.bymonth]),hr(t.byyearday)&&!oo(t.byyearday)&&Pa(t.byyearday)&&(t.byyearday=[t.byyearday]),!hr(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if(oo(t.bymonthday)){for(var s=[],o=[],n=0;n0?s.push(r):r<0&&o.push(r)}t.bymonthday=s,t.bynmonthday=o}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(hr(t.byweekno)&&!oo(t.byweekno)&&(t.byweekno=[t.byweekno]),!hr(t.byweekday))t.bynweekday=null;else if(Pa(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(fR(t.byweekday))t.byweekday=[ys.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof ys)!t.byweekday.n||t.freq>tt.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var a=[],i=[],n=0;ntt.MONTHLY?a.push(c.weekday):i.push([c.weekday,c.n])}t.byweekday=jr(a)?a:null,t.bynweekday=jr(i)?i:null}return hr(t.byhour)?Pa(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq=4?(f=0,u=i.yearlen+bo(a-t.wkst,7)):u=r-f;for(var m=Math.floor(u/7),p=bo(u,7),h=Math.floor(m+p/4),g=0;g0&&y<=h){var x=void 0;y>1?(x=f+(y-1)*7,f!==c&&(x-=7-c)):x=f;for(var v=0;v<7&&(i.wnomask[x]=1,x++,i.wdaymask[x]!==t.wkst);v++);}}if(Tn(t.byweekno,1)){var x=f+h*7;if(f!==c&&(x-=7-c),x=4?(w=0,C=S+bo(_-t.wkst,7)):C=r-f,b=Math.floor(52+bo(C,7)/4)}if(Tn(t.byweekno,b))for(var x=0;xo)return bi(e);if(b>=n){var _=_R(b,t);if(!e.accept(_)||i&&(--i,!i))return bi(e)}}else for(var v=h;vo)return bi(e);if(b>=n){var _=_R(b,t);if(!e.accept(_)||i&&(--i,!i))return bi(e)}}}if(t.interval===0||(c.add(t,y),c.year>PH))return bi(e);m4(r)||(f=u.gettimeset(r)(c.hour,c.minute,c.second,0)),u.rebuild(c.year,c.month)}}function fye(e,t,n){var r=n.bymonth,s=n.byweekno,o=n.byweekday,a=n.byeaster,i=n.bymonthday,c=n.bynmonthday,u=n.byyearday;return jr(r)&&!Tn(r,e.mmask[t])||jr(s)&&!e.wnomask[t]||jr(o)&&!Tn(o,e.wdaymask[t])||jr(e.nwdaymask)&&!e.nwdaymask[t]||a!==null&&!Tn(e.eastermask,t)||(jr(i)||jr(c))&&!Tn(i,e.mdaymask[t])&&!Tn(c,e.nmdaymask[t])||jr(u)&&(t=e.yearlen&&!Tn(u,t+1-e.yearlen)&&!Tn(u,-e.nextyearlen+t-e.yearlen))}function _R(e,t){return new Qy(e,t.tzid).rezonedDate()}function bi(e){return e.getValue()}function mye(e,t,n,r,s){for(var o=!1,a=t;a=tt.HOURLY&&jr(s)&&!Tn(s,t.hour)||r>=tt.MINUTELY&&jr(o)&&!Tn(o,t.minute)||r>=tt.SECONDLY&&jr(a)&&!Tn(a,t.second)?[]:e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}var ra={MO:new ys(0),TU:new ys(1),WE:new ys(2),TH:new ys(3),FR:new ys(4),SA:new ys(5),SU:new ys(6)},p4={freq:cn.YEARLY,dtstart:null,interval:1,wkst:ra.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},hye=Object.keys(p4),tt=(function(){function e(t,n){t===void 0&&(t={}),n===void 0&&(n=!1),this._cache=n?null:new q1e,this.origOptions=VH(t);var r=U1e(t).parsedOptions;this.options=r}return e.parseText=function(t,n){return UH(t,n)},e.fromText=function(t,n){return O1e(t,n)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return HH(t,this.options)},e.prototype._cacheGet=function(t,n){return this._cache?this._cache._cacheGet(t,n):!1},e.prototype._cacheAdd=function(t,n,r){if(this._cache)return this._cache._cacheAdd(t,n,r)},e.prototype.all=function(t){if(t)return this._iter(new gR("all",{},t));var n=this._cacheGet("all");return n===!1&&(n=this._iter(new sd("all",{})),this._cacheAdd("all",n)),n},e.prototype.between=function(t,n,r,s){if(r===void 0&&(r=!1),!Qm(t)||!Qm(n))throw new Error("Invalid date passed in to RRule.between");var o={before:n,after:t,inc:r};if(s)return this._iter(new gR("between",o,s));var a=this._cacheGet("between",o);return a===!1&&(a=this._iter(new sd("between",o)),this._cacheAdd("between",a,o)),a},e.prototype.before=function(t,n){if(n===void 0&&(n=!1),!Qm(t))throw new Error("Invalid date passed in to RRule.before");var r={dt:t,inc:n},s=this._cacheGet("before",r);return s===!1&&(s=this._iter(new sd("before",r)),this._cacheAdd("before",s,r)),s},e.prototype.after=function(t,n){if(n===void 0&&(n=!1),!Qm(t))throw new Error("Invalid date passed in to RRule.after");var r={dt:t,inc:n},s=this._cacheGet("after",r);return s===!1&&(s=this._iter(new sd("after",r)),this._cacheAdd("after",s,r)),s},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return a3(this.origOptions)},e.prototype.toText=function(t,n,r){return L1e(this,t,n,r)},e.prototype.isFullyConvertibleToText=function(){return F1e(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=cn.YEARLY,e.MONTHLY=cn.MONTHLY,e.WEEKLY=cn.WEEKLY,e.DAILY=cn.DAILY,e.HOURLY=cn.HOURLY,e.MINUTELY=cn.MINUTELY,e.SECONDLY=cn.SECONDLY,e.MO=ra.MO,e.TU=ra.TU,e.WE=ra.WE,e.TH=ra.TH,e.FR=ra.FR,e.SA=ra.SA,e.SU=ra.SU,e.parseString=o3,e.optionsToString=a3,e})();function gye(e,t,n,r,s,o){var a={},i=e.accept;function c(p,h){n.forEach(function(g){g.between(p,h,!0).forEach(function(y){a[Number(y)]=!0})})}s.forEach(function(p){var h=new Qy(p,o).rezonedDate();a[Number(h)]=!0}),e.accept=function(p){var h=Number(p);return isNaN(h)?i.call(this,p):!a[h]&&(c(new Date(h-1),new Date(h+1)),!a[h])?(a[h]=!0,i.call(this,p)):!0},e.method==="between"&&(c(e.args.after,e.args.before),e.accept=function(p){var h=Number(p);return a[h]?!0:(a[h]=!0,i.call(this,p))});for(var u=0;u1||s.length||o.length||a.length){var f=new Sye(u);return f.dtstart(i),f.tzid(c||void 0),r.forEach(function(p){f.rrule(new tt(k_(p,i,c),u))}),s.forEach(function(p){f.rdate(p)}),o.forEach(function(p){f.exrule(new tt(k_(p,i,c),u))}),a.forEach(function(p){f.exdate(p)}),t.compatible&&t.dtstart&&f.rdate(i),f}var m=r[0]||{};return new tt(k_(m,m.dtstart||t.dtstart||i,m.tzid||t.tzid||c),u)}function CR(e,t){return t===void 0&&(t={}),xye(e,vye(t))}function k_(e,t,n){return Sr(Sr({},e),{dtstart:t,tzid:n})}function vye(e){var t=[],n=Object.keys(e),r=Object.keys(wR);if(n.forEach(function(s){Tn(r,s)||t.push(s)}),t.length)throw new Error("Invalid options: "+t.join(", "));return Sr(Sr({},wR),e)}function bye(e){if(e.indexOf(":")===-1)return{name:"RRULE",value:e};var t=M1e(e,":",1),n=t[0],r=t[1];return{name:n,value:r}}function _ye(e){var t=bye(e),n=t.name,r=t.value,s=n.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:r}}function wye(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var n=e.split(` -`),r=0;r0&&s[0]===" "?(n[r-1]+=s.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function Cye(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function SR(e,t){return Cye(t),e.split(",").map(function(n){return f4(n)})}function ER(e){var t=this;return function(n){if(n!==void 0&&(t["_".concat(e)]=n),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var r=0;r{switch(e.kind){case"ONCE":return new Date(e.year,e.month,e.day,e.hour,e.minute);case"DAILY":return new Date(2e3,0,1,e.hour,e.minute);case"WEEKLY":return new Date(2e3,0,2+e.dayOfWeek,e.hour,e.minute);case"MONTHLY":return new Date(2e3,0,e.day,e.hour,e.minute);case"YEARLY":return new Date(2e3,e.month,e.day,e.hour,e.minute);case"WEEKDAYS":return new Date(2e3,0,1,e.hour,e.minute)}};function h4(e,t){const n=new Date;switch(e.kind){case"ONCE":{const r=new Date(e.year,e.month,e.day,e.hour,e.minute);return r>n?r:n}case"DAILY":return new tt({freq:tt.DAILY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byhour:e.hour,byminute:e.minute}).after(n)||n;case"WEEKLY":{const r=e.dayOfWeek===0?tt.SU:e.dayOfWeek-1;return new tt({freq:tt.WEEKLY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byweekday:r,byhour:e.hour,byminute:e.minute}).after(n)||n}case"MONTHLY":return new tt({freq:tt.MONTHLY,dtstart:new Date(n.getFullYear(),n.getMonth(),1,e.hour,e.minute),bymonthday:e.day,byhour:e.hour,byminute:e.minute}).after(n)||n;case"YEARLY":return new tt({freq:tt.YEARLY,dtstart:new Date(n.getFullYear(),0,1,e.hour,e.minute),bymonth:e.month+1,bymonthday:e.day,byhour:e.hour,byminute:e.minute}).after(n)||n;case"WEEKDAYS":return new tt({freq:tt.WEEKLY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byweekday:[tt.MO,tt.TU,tt.WE,tt.TH,tt.FR],byhour:e.hour,byminute:e.minute}).after(n)||n;default:return n}}function kye(e,t){const n=Eye(e);switch(e.kind){case"ONCE":return t.formatDate(n,{dateStyle:"medium",timeStyle:"short"});case"DAILY":return t.formatTime(n,{timeStyle:"short"});case"WEEKLY":return t.formatDate(n,{weekday:"short",hour:"numeric",minute:"numeric"});case"MONTHLY":return t.formatMessage({defaultMessage:"Day {day}, {time}",id:"grA/MDsLjr"},{day:n.getDate().toString(),time:t.formatTime(n,{timeStyle:"short"})});case"YEARLY":return t.formatDate(n,{hour:"numeric",minute:"numeric",day:"numeric",month:"short"});case"WEEKDAYS":return t.formatTime(n,{timeStyle:"short"})}}const Au=He({kindOnce:{defaultMessage:"Once",id:"DqTQOpG2Me"},kindDaily:{defaultMessage:"Daily",id:"zxvhnETmn2"},kindWeekly:{defaultMessage:"Weekly",id:"/clOBUs/wZ"},kindWeekdays:{defaultMessage:"Every weekday",id:"8Hjql2wdJG"},kindMonthly:{defaultMessage:"Monthly",id:"wYsv4ZHu+B"},kindYearly:{defaultMessage:"Yearly",id:"dqD39hnoA/"}}),Mye={ONCE:Au.kindOnce,DAILY:Au.kindDaily,WEEKLY:Au.kindWeekly,MONTHLY:Au.kindMonthly,YEARLY:Au.kindYearly,WEEKDAYS:Au.kindWeekdays};function Gr(){const e=new Date;return e.setHours(e.getHours()+1,e.getMinutes(),0,0),{kind:"ONCE",minute:e.getMinutes(),hour:e.getHours(),day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),dayOfWeek:e.getDay()}}function Tye(e="",t=ie.PRO,n=["web"]){return{title:"",prompt:e,schedule:Gr(),searchModel:t,sources:n,expiryDate:void 0,defaultExpiryDate:WH(t)}}function Aye(e,t){return t.formatMessage(Mye[e])}const Nye=()=>Intl.DateTimeFormat().resolvedOptions().timeZone;function Rye(e){switch(e.kind){case"ONCE":return new Date(e.year,e.month,e.day,e.hour,e.minute);default:return new Date}}function Dye(e){switch(e.kind){case"ONCE":return"FREQ=DAILY;COUNT=1";case"DAILY":return`FREQ=DAILY;BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"WEEKLY":return`FREQ=WEEKLY;BYDAY=${["SU","MO","TU","WE","TH","FR","SA"][e.dayOfWeek]};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"MONTHLY":return`FREQ=MONTHLY;BYMONTHDAY=${e.day};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"YEARLY":return`FREQ=YEARLY;BYMONTH=${e.month+1};BYMONTHDAY=${e.day};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"WEEKDAYS":return`FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=${e.hour};BYMINUTE=${e.minute}`}}function mp(e){const t=Rye(e);return{start_at:$U(t),rrule:Dye(e),tzid:Nye()}}function zH(e){if(!(e===null||!e))return $U(e)}function Xy(e){const t=new Date(e.start_at),n={kind:"ONCE",minute:t.getMinutes(),hour:t.getHours(),day:t.getDate(),month:t.getMonth(),year:t.getFullYear(),dayOfWeek:t.getDay()};if(e.rrule.includes("FREQ=DAILY;COUNT=1"))return n;const r=tt.parseString(e.rrule),s=f=>Array.isArray(f)?f[0]:f,o=s(r.byhour),a=s(r.byminute),i=s(r.bymonth),c=s(r.bymonthday),u=s(r.byweekday);switch(r.freq){case tt.DAILY:return o===void 0||a===void 0?(Z.error("DAILY schedule missing required BYHOUR or BYMINUTE parameter"),{...n}):{...n,kind:"DAILY",hour:o,minute:a};case tt.WEEKLY:{if(u===void 0||o===void 0||a===void 0)return Z.error("WEEKLY schedule missing required parameters"),{...n};if(Array.isArray(r.byweekday)&&r.byweekday.length===5)return{...n,kind:"WEEKDAYS",hour:o,minute:a};const f=u.weekday===6?0:u.weekday+1;return{...n,kind:"WEEKLY",dayOfWeek:f,hour:o,minute:a}}case tt.MONTHLY:return c===void 0||o===void 0||a===void 0?(Z.error("MONTHLY schedule missing required BYMONTHDAY parameter"),{...n}):{...n,kind:"MONTHLY",day:c,hour:o,minute:a};case tt.YEARLY:return i===void 0||c===void 0||o===void 0||a===void 0?(Z.error("YEARLY schedule missing required BYMONTH parameter"),{...n}):{...n,kind:"YEARLY",month:i-1,day:c,hour:o,minute:a}}return Z.error("Invalid task schedule"),{...n}}function jye({expiryDate:e,schedule:t,defaultExpiryDate:n}){return e===null||!e||!t?e:h4(t)>e?n??null:e}function Iye(e,t){return(e===ie.BETA||e===ie.ALPHA)&&(t.kind==="DAILY"||t.kind==="WEEKLY"||t.kind==="WEEKDAYS")}function WH(e,t){if(!(!t||!Iye(e,t))&&(e===ie.BETA||e===ie.ALPHA)){const n=h4(t);return(s=>{switch(s){case"DAILY":return US(n,14);case"WEEKLY":return Bme(n,14);case"WEEKDAYS":return US(n,21);case"ONCE":case"MONTHLY":case"YEARLY":return;default:At(s)}})(t.kind)}}var Ze;(function(e){e.SCHEDULED="scheduled",e.PRICE_ALERT="priceAlert",e.SHORTCUT="shortcut"})(Ze||(Ze={}));var fr;(function(e){e.TARGET_PRICE="targetPrice",e.MOVEMENT_AMOUNT="movementAmount"})(fr||(fr={}));const Kl={should_send_email:!0,should_send_in_app:!0,should_send_push:!0},Pye=e=>{const t=e.enrichments?e.enrichments.space??null:void 0;return{id:e.task_id,type:Oye(e),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),expiryDate:e.end_at?new Date(e.end_at):void 0,title:e.task_name,prompt:e.task_data.task_prompt,status:e.status,nextRun:new Date(e.next_trigger_intended_time),scheduleInfo:{start_at:e.start_at,rrule:e.trigger_condition_schedule,tzid:e.tzid},subscription:e.event_subscription,searchModel:e.task_data?.task_params?.model_preference||"pplx_pro",sources:e.task_data?.task_params?.sources||["web"],notificationSettings:e.notification_settings||Kl,collectionUuid:e.collection_uuid,space:t,userId:e.user_task_context?.user_nextauth_id??null}},Oye=e=>{switch(e.scheduler_type){case"EVENT_PUSH":return"ALERT";case"POLL":return"SCHEDULE";case"SHORTCUT":return"SHORTCUT";default:return null}};function Lye({intl:e,triggerType:t}){switch(t){case Ze.SCHEDULED:return e.formatMessage({defaultMessage:"Scheduled task",id:"dG8VrMkuAT"});case Ze.PRICE_ALERT:return e.formatMessage({defaultMessage:"Price alert",id:"XMapyUiPpV"});case Ze.SHORTCUT:return e.formatMessage({defaultMessage:"Shortcut",id:"tceWOrncgz"});default:At(t)}}function Fye({intl:e,triggerType:t,actionPerformed:n}){const r=Bye({intl:e,actionPerformed:n});switch(t){case Ze.SCHEDULED:return e.formatMessage({defaultMessage:"Task has been {actionDisplayName}",id:"dztI4FIBBf"},{actionDisplayName:r});case Ze.PRICE_ALERT:return e.formatMessage({defaultMessage:"Price alert has been {actionDisplayName}",id:"ApBHuTxt1D"},{actionDisplayName:r});case Ze.SHORTCUT:return e.formatMessage({defaultMessage:"Shortcut has been {actionDisplayName}",id:"oprPa0O7KY"},{actionDisplayName:r});default:At(t)}}function Bye({intl:e,actionPerformed:t}){switch(t){case"created":return e.formatMessage({defaultMessage:"created",id:"lr7wlbGcN2"});case"updated":return e.formatMessage({defaultMessage:"updated",id:"fM7xZh2bri"});case"paused":return e.formatMessage({defaultMessage:"paused",id:"onIpArq3j6"});case"resumed":return e.formatMessage({defaultMessage:"resumed",id:"NUz1enNtoA"});case"deleted":return e.formatMessage({defaultMessage:"deleted",id:"GBLHN+CxXe"});case"copied":return e.formatMessage({defaultMessage:"copied",id:"JZWZSAD5l1"});case"skipped":return e.formatMessage({defaultMessage:"skipped",id:"yrhXAwV22L"});default:At(t)}}const Uye=1e9,AR=-1e9;function Vye(e){return{trigger:{type:Ze.SCHEDULED,schedule:e.schedule},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources??Zh()},status:"ACTIVE",notificationSettings:Kl}}function Hye({selectedTask:e}){if(!e||e.type===null)return null;switch(e.type){case"SCHEDULE":return{id:e.id,trigger:{type:Ze.SCHEDULED,schedule:Xy(e.scheduleInfo),expiryDate:e.expiryDate},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status,notificationSettings:e.notificationSettings??Kl,collectionUuid:e.collectionUuid};case"ALERT":switch(e.subscription?.event_type){case"STOCK_PRICE_TARGET":return{id:e.id,trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:(e.subscription.value_lower_bound??AR)<0?e.subscription.value_upper_bound??Uye:e.subscription.value_lower_bound??AR,currency:"usd",symbol:e.subscription.event_entity??""},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};case"STOCK_PRICE_MOVEMENT":return{id:e.id,trigger:{type:Ze.PRICE_ALERT,alertType:fr.MOVEMENT_AMOUNT,percentageDecimalLowerBound:(e.subscription.value_lower_bound??0)/100,percentageDecimalUpperBound:(e.subscription.value_upper_bound??0)/100,symbol:e.subscription.event_entity??""},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};default:throw new Error("Unhandled subscription.event_type: "+e.subscription?.event_type)}case"SHORTCUT":return{id:e.id,trigger:{type:Ze.SHORTCUT,shortcut:e.title},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};default:At(e.type)}}function g4(e=!0){return{trigger:{type:Ze.SCHEDULED,schedule:Gr()},query:{searchModel:e?ie.PRO:ie.DEFAULT,prompt:"",sources:Zh()},status:"ACTIVE",notificationSettings:Kl}}function zye({symbol:e=""}={symbol:""}){return{trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:0,currency:"usd",symbol:e},query:{prompt:"",searchModel:ie.PRO,sources:Zh()},status:"ACTIVE"}}function y4(e){if(e.trigger.type!==Ze.SCHEDULED)return e;const t=WH(e.query.searchModel,e.trigger.schedule),n=jye({expiryDate:e.trigger.expiryDate,schedule:e.trigger.schedule,defaultExpiryDate:t});return e.id?{...e,trigger:{...e.trigger,expiryDate:n}}:{...e,trigger:{...e.trigger,schedule:{...e.trigger.schedule},expiryDate:n,defaultExpiryDate:t}}}function Zh(){return["web"]}var Zn;(function(e){e.GOOGLE_DRIVE="GOOGLE_DRIVE",e.ONEDRIVE="ONEDRIVE",e.SHAREPOINT="SHAREPOINT",e.DROPBOX="DROPBOX",e.BOX="BOX",e.WILEY="WILEY",e.GCAL="GCAL",e.GENERATED_IMAGE="GENERATED_IMAGE",e.GENERATED_VIDEO="GENERATED_VIDEO",e.NOTION_MCP="NOTION_MCP",e.OUTLOOK="OUTLOOK",e.LINEAR="LINEAR",e.LINEAR_ALT="LINEAR_ALT",e.SLACK="SLACK",e.GITHUB_MCP_DIRECT="GITHUB_MCP_DIRECT",e.ASANA_MCP_DIRECT="ASANA_MCP_DIRECT",e.ASANA_MCP_MERGE="ASANA_MCP_MERGE",e.ATLASSIAN_MCP_DIRECT="ATLASSIAN_MCP_DIRECT",e.LOCAL="LOCAL",e.SLACK_DIRECT="SLACK_DIRECT",e.JIRA_MCP_MERGE="JIRA_MCP_MERGE",e.CONFLUENCE_MCP_MERGE="CONFLUENCE_MCP_MERGE",e.MICROSOFT_TEAMS_MCP_MERGE="MICROSOFT_TEAMS_MCP_MERGE",e.FACTSET="FACTSET",e.ZOOM="ZOOM"})(Zn||(Zn={}));const Wye=[Zn.GOOGLE_DRIVE,Zn.ONEDRIVE,Zn.SHAREPOINT,Zn.DROPBOX,Zn.BOX],Gye=e=>[...Wye,...e],Sxt=e=>be.makeQueryKey("get_prices",{subscription_tier:e}),iu=(e={})=>be.makeQueryKey("get_user_settings",e),Zy=()=>be.makeQueryKey("get_rate_limits",{}),$ye=()=>be.makeQueryKey("get_user_profile",{}),qye=()=>be.makeQueryKey("get_user_promotions",{}),Kye=()=>be.makeQueryKey("get_government_origin",{}),Yye=e=>be.makeQueryKey("get_special_profile",{profile_name:e}),i3=e=>be.makeQueryKey("get_homepage_upsells",{isHomepage:e}),Qye=()=>be.makeQueryKey("get_ntp_upsells",{}),dc=(e="you")=>be.makeQueryKey("list_feed",{topic:e}),x4=()=>be.makeQueryKey("userOrgData",{}),Ext=e=>be.makeQueryKey("get_premium_secure_eligibility",{orgUuid:e}),Xye=()=>be.makeQueryKey("pendingInvitation"),na=e=>be.makeQueryKey("get_collection",{collection_slug:e.slice(-22)}),v4=e=>be.makeQueryKey("list_collection_threads",e?.slice(-22)),bd=e=>e?[...v4(e.collection_slug),e.filter_by_user,e.filter_by_shared_threads]:be.makeQueryKey("list_collection_threads"),Xt=()=>be.makeQueryKey("list_user_collections",{}),Lx=e=>e?be.makeQueryKey("list_ask_threads",e):be.makeQueryKey("list_ask_threads"),Zye=Lx,kxt=()=>be.makeQueryKey("shoppingOrders",{}),Jye=()=>be.makeQueryKey("userTryOnPhoto",{}),e2e=()=>be.makeQueryKey("shoppingTryOnBackgroundGeneration"),Mxt=e=>be.makeQueryKey("productTryOn",{productImageUrl:e}),t2e="getOrganizationUsers",Txt=e=>be.makeQueryKey(t2e,"members"),n2e=e=>be.makeQueryKey("get_thread_by_uuid",{uuid:e}),r2e=e=>be.makeQueryKey("get_article_by_uuid",{uuid:e}),Axt=()=>be.makeQueryKey("customer_shopping_info",{}),b4=e=>be.makeQueryKey("articleResults",{frontend_context_uuid:e}),NR=e=>be.makeQueryKey("article-slug",e),_4=(e,t=!1)=>be.makeQueryKey(t?"list_file_directory_infinite":"list_file_directory",e.file_repository_type,e.owner_id),w4=(e,t,n,r=0,s,o=!1)=>be.makeQueryKey(...be.unmakeQueryKey(_4({file_repository_type:e,owner_id:t},o)),n,...o?[]:[r],s),l3="connector-files",c3="connector-files-infinite",RR=(e,t)=>e?be.makeQueryKey(t?c3:l3,e):be.makeQueryKey(t?c3:l3),Nxt=e=>be.makeQueryKey("get_sharepoint_sites_infinite",e??{}),Rxt=()=>be.makeQueryKey("get_filters",{}),Dxt=e=>e!==void 0?be.makeQueryKey("memories",e):be.makeQueryKey("memories"),eh=(e,t)=>be.makeQueryKey("file_exists",e,...t?[t]:[]),j0=e=>be.makeQueryKey("download-image-url",...e?[e]:[]),GH=e=>be.makeQueryKey("user-task",e),pp=e=>be.makeQueryKey("user-tasks"),s2e=e=>e!==void 0?be.makeQueryKey("space-tasks",e):be.makeQueryKey("space-tasks"),o2e=()=>be.makeQueryKey("check-edu-institution"),Xm=()=>be.makeQueryKey("list_spaces_mentions"),a2e=()=>be.makeQueryKey("upgrade-subscription-preview"),i2e=()=>be.makeQueryKey("subscription-changes"),l2e=()=>be.makeQueryKey("task_shortcuts_mentions"),jxt=e=>be.makeQueryKey("task_shortcuts_copy",e),Ixt=()=>be.makeQueryKey("braintree-subscription-details"),c2e="get_repository_upload_states",u2e=e=>be.makeQueryKey(c2e,e),Pxt=()=>be.makeQueryKey("get_seat_info"),d2e="space-file-errors",Oxt=e=>be.makeQueryKey(d2e,e),Lxt=be.makeQueryKey("third-party-personalization-status"),f2e=e=>be.makeQueryKey("user_student",e),Fxt=()=>be.makeQueryKey("paypal_client_token",{}),m2e=()=>be.makeQueryKey("emailAssistantConfig"),p2e=e=>e?be.makeQueryKey("emailAssistantScopes",e):be.makeQueryKey("emailAssistantScopes"),$H=e=>be.makeEphemeralQueryKey("navigationResults",e),Bxt=e=>e?be.makeQueryKey("availableCalendars",e):be.makeQueryKey("availableCalendars"),wm=()=>be.makeQueryKey("spaces","list","all"),h2e=()=>be.makeQueryKey("org_pinned_spaces_query_key"),C4=/(\[\d{1,3}\])/,qH=/(\[\d{1,3},\s*\{ts:.*\}\])/,hp=new RegExp(C4.source+"|"+qH.source),S4=(e,t)=>{if(hp.test(e))if(C4.test(e)){const n=parseInt(e.substring(1,e.length-1))-1,r=t?.[n]??null;return r||void 0}else{const n=e.indexOf(","),r=parseInt(e.substring(1,n))-1,s=t?.[r]??null;if(!s)return;if(!s.url){Z.warn("[parseCitation] web_result has no url",{web_result:s});return}return s.url=g2e(s.url,e),s}},g2e=(e,t)=>{const n=e.split("&")[0],r=t.indexOf(":");if(r===-1)return n;const s=t.indexOf("}"),o=t.substring(r+1,s);return n+`&t=${o}`};function th(e,t){const n={};for(const r of e){const s=t(r);Object.prototype.hasOwnProperty.call(n,s)?n[s].push(r):Object.defineProperty(n,s,{value:[r],configurable:!0,enumerable:!0,writable:!0})}return n}const E4={web:"web",scholar:"scholar",social:"social",edgar:"edgar",wiley:"wiley",org:"org",my_files:"my_files",crunchbase:"crunchbase",factset:"factset",google_drive:"google_drive",onedrive:"onedrive",sharepoint:"sharepoint",dropbox:"dropbox",box:"box",notion_mcp:"notion_mcp",outlook:"outlook",linear:"linear",linear_alt:"linear_alt",slack:"slack",github_mcp_direct:"github_mcp_direct",asana_mcp_direct:"asana_mcp_direct",asana_mcp_merge:"asana_mcp_merge",atlassian_mcp_direct:"atlassian_mcp_direct",slack_direct:"slack_direct",jira_mcp_merge:"jira_mcp_merge",confluence_mcp_merge:"confluence_mcp_merge",microsoft_teams_mcp_merge:"microsoft_teams_mcp_merge",wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere",space:"space",gcal:"gcal",sports:"sports",zoom:"zoom"},y2e=Object.values(E4).filter(e=>e!=="wiley"),x2e=["linear","linear_alt","slack","notion_mcp","github_mcp_direct","asana_mcp_direct","asana_mcp_merge","atlassian_mcp_direct","slack_direct","jira_mcp_merge","confluence_mcp_merge","microsoft_teams_mcp_merge","wiley_mcp_cashmere","cbinsights_mcp_cashmere","pitchbook_mcp_cashmere","statista_mcp_cashmere"],v2e={wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere"},ha=e=>y2e.includes(e),Fx=e=>Array.isArray(e)?e.filter(ha):[],b2e=e=>Array.isArray(e)?e.filter(ha).filter(t=>x2e.includes(t)):[],Jh=e=>e?Object.keys(v2e).includes(e):!1,KH=e=>e?.entity_group_type!=="CALENDAR_ACTION"&&!!e?.entities?.length,YH=e=>{const t=!!e?.multiple_choice_quiz_card_block?.questions?.length,n=!!e?.flash_card_section_block;return t||n},DR=e=>!!(e.chunks&&e.chunks.length>0),jR=e=>!!(e.answer&&e.answer.length>0),IR=e=>!!e.structured_answer_blocks?.some(t=>t.markdown_block?.chunks?.length||t.entity_list_block?.chunks?.length),PR=e=>!!e.structured_answer_blocks?.some(t=>t.markdown_block?.answer?.length||t.entity_list_block?.text?.length||KH(t.entity_group_block)),OR=e=>!!e.structured_answer_blocks?.some(t=>YH(t.inline_entity_block)),LR=e=>!!e.structured_answer_blocks?.some(t=>t.inline_entity_block?.media_block?.generated_media_items?.some(n=>n.status==="COMPLETED")),_2e=e=>!!e.structured_answer_blocks?.some(t=>t.inline_entity_block?.media_block?.media_items?.some(n=>n.image||n.medium==="image"||n.medium==="video"));class qt{static hasContent(t){return DR(t)||jR(t)||IR(t)||PR(t)||LR(t)||_2e(t)||OR(t)}static hasAnswer(t,n){const r=LR(t)&&n;return DR(t)||jR(t)||IR(t)||PR(t)||r||OR(t)}static isPerplexityMessage(t){return t?.blocks!==void 0}static isPerplexityArticleSection(t){return t?.message!==void 0}static isArticleSection(t){return t?.article_info!==void 0}static mergePlaceBlocks(t){const n=t.filter(a=>!!a);if(!n.length)return;const[r,...s]=n;return Object.assign({},r,...s.map(a=>({review_summary:a.review_summary})))}static mergeMediaBlocks(t){const n=t.filter(s=>!!s);return n.length?{media_items:n.flatMap(s=>s?.media_items||[]),generated_media_items:n[n.length-1].generated_media_items||[],progress:n[n.length-1].progress}:void 0}static mergeShoppingBlocks(t){const n=t.filter(a=>!!a);if(!n.length)return;const[r,...s]=n;return Object.assign({},r,...s.map(a=>({review_summary:a.review_summary})))}static mergeEntityListItems(t){const n=th(t,s=>s.index),r=[];return Object.values(n).forEach(s=>{const o=s[0];r.push({title:o.title,text:s.map(({text:a})=>a).join(""),chunks:s.flatMap(a=>a.chunks),chunk_starting_offset:0,index:o.index,awaiting_backfill:s.reduce((a,i)=>i.awaiting_backfill??a,!1),place_block:qt.mergePlaceBlocks(s.map(a=>a.place_block)),shopping_block:qt.mergeShoppingBlocks(s.map(a=>a.shopping_block))})}),r}static parseStructuredAnswerBlocks(t){if(!this.isPerplexityMessage(t)||!t.structured_answer_block_usages?.length)return null;const n=th(t.blocks,s=>s.intended_usage),r=[];return t.structured_answer_block_usages.forEach(s=>{const o=n[s];if(!o)return;const{markdownBlocks:a,placeBlocks:i,mediaBlocks:c,shoppingPreviewBlocks:u,entityListBlocks:f,jobsPreviewBlocks:m,hotelsPreviewBlocks:p,placesPreviewBlocks:h,knowledgeCardsBlocks:g,calendarEventBlocks:y,entityGroupBlocks:x,entityGroupV2Blocks:v,assetsPreviewBlocks:b,assetsInlineBlocks:_,shoppingBlocks:w,placeholderBlocks:S,multipleChoiceQuizCardBlocks:C,flashCardSectionBlocks:E,jsonBlocks:T}=o.reduce((k,I)=>(I.markdown_block?k.markdownBlocks.push(I.markdown_block):I.inline_entity_block?.place_block?k.placeBlocks.push(I.inline_entity_block.place_block):I.inline_entity_block?.media_block?k.mediaBlocks.push(I.inline_entity_block.media_block):I.inline_entity_block?.shopping_preview_block?k.shoppingPreviewBlocks.push(I.inline_entity_block.shopping_preview_block):I.entity_list_block?k.entityListBlocks.push(I.entity_list_block):I.inline_entity_block?.jobs_preview_block?k.jobsPreviewBlocks.push(I.inline_entity_block.jobs_preview_block):I.inline_entity_block?.hotels_preview_block?k.hotelsPreviewBlocks.push(I.inline_entity_block.hotels_preview_block):I.inline_entity_block?.places_preview_block?k.placesPreviewBlocks.push(I.inline_entity_block.places_preview_block):I.inline_entity_block?.knowledge_card_block?k.knowledgeCardsBlocks.push(I.inline_entity_block.knowledge_card_block):I.inline_entity_block?.calendar_event_block?k.calendarEventBlocks.push(I.inline_entity_block.calendar_event_block):I.entity_group_block?k.entityGroupBlocks.push(I.entity_group_block):I.entity_group_v2_block?k.entityGroupV2Blocks.push(I.entity_group_v2_block):I.inline_entity_block?.assets_preview_block?k.assetsPreviewBlocks.push(I.inline_entity_block.assets_preview_block):I.inline_entity_block?.assets_inline_block?k.assetsInlineBlocks.push(I.inline_entity_block.assets_inline_block):I.inline_entity_block?.shopping_block?k.shoppingBlocks.push(I.inline_entity_block?.shopping_block):I.inline_entity_block?.placeholder_block?k.placeholderBlocks.push(I.inline_entity_block?.placeholder_block):I.inline_entity_block?.multiple_choice_quiz_card_block?k.multipleChoiceQuizCardBlocks.push(I.inline_entity_block.multiple_choice_quiz_card_block):I.inline_entity_block?.flash_card_section_block?k.flashCardSectionBlocks.push(I.inline_entity_block.flash_card_section_block):I.json_block&&k.jsonBlocks.push(I.json_block),k),{markdownBlocks:[],placeBlocks:[],mediaBlocks:[],shoppingPreviewBlocks:[],entityListBlocks:[],jobsPreviewBlocks:[],hotelsPreviewBlocks:[],placesPreviewBlocks:[],knowledgeCardsBlocks:[],calendarEventBlocks:[],entityGroupBlocks:[],entityGroupV2Blocks:[],assetsPreviewBlocks:[],assetsInlineBlocks:[],shoppingBlocks:[],placeholderBlocks:[],multipleChoiceQuizCardBlocks:[],flashCardSectionBlocks:[],jsonBlocks:[]});if(a.length){const k=a[a.length-1],I=a.flatMap(M=>M.chunks);r.push({intended_usage:s,markdown_block:{answer:I.join(""),chunks:I,chunk_starting_offset:0,progress:k.progress,media_items:a.flatMap(M=>M.media_items||[]),inline_token_annotations:a.flatMap(M=>M.inline_token_annotations||[])}})}if(u.length&&r.push({intended_usage:s,inline_entity_block:{shopping_preview_block:u[u.length-1]}}),m.length&&r.push({intended_usage:s,inline_entity_block:{jobs_preview_block:m[m.length-1]}}),p.length&&r.push({intended_usage:s,inline_entity_block:{hotels_preview_block:p[p.length-1]}}),h.length&&r.push({intended_usage:s,inline_entity_block:{places_preview_block:h[h.length-1]}}),i.length&&r.push({intended_usage:s,inline_entity_block:{place_block:qt.mergePlaceBlocks(i)}}),c.length&&r.push({intended_usage:s,inline_entity_block:{media_block:qt.mergeMediaBlocks(c)}}),f.length&&r.push({intended_usage:s,entity_list_block:{text:f.map(({text:k})=>k).join(""),chunks:f.flatMap(k=>k.chunks),chunk_starting_offset:0,entities:qt.mergeEntityListItems(f.flatMap(k=>k.entities))}}),g.length&&r.push({intended_usage:s,inline_entity_block:{knowledge_card_block:g[g.length-1]}}),y.length&&r.push({intended_usage:s,inline_entity_block:{calendar_event_block:y[y.length-1]}}),x.length&&r.push({intended_usage:s,entity_group_block:{entities:x[x.length-1].entities,entity_group_type:x[x.length-1].entity_group_type}}),v.length){const k=v[v.length-1];r.push({intended_usage:s,entity_group_v2_block:k})}b.length&&r.push({intended_usage:s,inline_entity_block:{assets_preview_block:b[b.length-1]}}),_.length&&r.push({intended_usage:s,inline_entity_block:{assets_inline_block:_[_.length-1]}}),w.length&&r.push({intended_usage:s,inline_entity_block:{shopping_block:this.mergeShoppingBlocks(w)}}),S.length&&r.push({intended_usage:s,inline_entity_block:{placeholder_block:S[S.length-1]}}),C.length&&r.push({intended_usage:s,inline_entity_block:{multiple_choice_quiz_card_block:C[C.length-1]}}),E.length&&r.push({intended_usage:s,inline_entity_block:{flash_card_section_block:E[E.length-1]}}),T.length&&r.push({intended_usage:s,json_block:T[T.length-1]})}),r}static parseAskTextField(t){if(!this.isPerplexityMessage(t))return this.legacyParseBackendOutputStr(t.text);if(!t.blocks?.length)return null;const n={answer:""};n.structured_answer_blocks=qt.parseStructuredAnswerBlocks(t);const r=t.blocks?.filter(o=>o.intended_usage==="ask_text"&&o.markdown_block).map(o=>o.markdown_block);if(r.length>0){const o=r.flatMap(a=>a.chunks);n.chunks=o,n.answer=o.join("")}const s=t.blocks?.filter(o=>o.intended_usage==="web_results"&&o.web_result_block).flatMap(o=>o.web_result_block.web_results);return s.length>0&&(n.web_results=s),n}static legacyParseBackendOutputStr(t){let n=null;try{if(n=JSON.parse(t??""),Array.isArray(n)){const r=n[n.length-1];r.step_type=="FINAL"&&r?.content?.answer!=null&&(n=JSON.parse(r.content.answer))}}catch{return null}return n}static isStatusPending(t){return t.status?.toLowerCase()===Pr.PENDING.toLowerCase()}static isStatusBlocked(t){return t.status?.toLowerCase()===Pr.BLOCKED.toLowerCase()}static isStatusFailed(t){return t.status?.toLowerCase()===Pr.FAILED.toLowerCase()}static isStatusCompleted(t){return t.status?.toLowerCase()===Pr.COMPLETED.toLowerCase()}static isCopilotMode(t){return t.mode?.toLowerCase()===xd.COPILOT.toLowerCase()}static isArticleMode(t){return this.isPerplexityMessage(t)?t?.mode===xd.ARTICLE:this.isPerplexityArticleSection(t)?t?.message?.mode===xd.ARTICLE:t?.mode==="article"}static isSourceListType(t){return Array.isArray(t)&&t.every(n=>Object.values(E4).includes(n))}static hasUnspecifiedSelectionStatus(t){return t?.selection_status===aa.SELECTION_STATUS_UNSPECIFIED}static hasMultipleSiblingEntries(t,n){return n?t.filter(s=>s.side_by_side_metadata?.sibling_uuid===n).length>1:!1}}function w2e(e){return e||{connectors:[]}}const FR=e=>({hasLoadedSettings:!0,pagesLimit:e?.pages_limit??0,uploadLimit:e?.upload_limit,defaultImageGenerationModel:e?.default_image_generation_model??"default",defaultVideoGenerationModel:e?.default_video_generation_model??"default",articleImageUploadLimit:e?.article_image_upload_limit??0,maxFilesPerUser:e?.max_files_per_user??0,maxFilesPerRepository:e?.max_files_per_repository??0,queryCount:e?.query_count??0,queryCountCopilot:e?.query_count_copilot??0,queryCountMobile:e?.query_count_mobile??0,hasAiProfile:e?.has_ai_profile??!1,referralCode:e?.referral_code??"",referralNumSuccess:e?.referral_num_success??0,referralNumCoupons:e?.referral_num_coupons??0,disableTraining:e?.disable_training??!1,isSidebarCollapsed:e?.is_sidebar_collapsed??!1,isSidebarPinned:e?.is_sidebar_pinned??!1,sidebarHiddenHubs:e?.sidebar_hidden_hubs??[],subscriptionTier:e?.subscription_tier??e?.subscription_tier??"null",stripeStatus:e?.stripe_status??"none",revenuecatStatus:e?.revenuecat_status??"none",revenuecatSource:e?.revenuecat_source??"none",createLimit:e?.create_limit??0,notifStatus:e?.notif_status??"daily",emailStatus:e?.email_status??"daily",hasDataRetentionWarning:e?.has_data_retention_warning??!1,allowArticleCreation:e?.allow_article_creation??!1,isVerified:e?.is_verified??!1,connectors:w2e(e?.connectors),connectorLimits:e?.connector_limits??{global_file_count:void 0,repo_type_limits:void 0,max_file_size_mb:void 0,max_attachment_file_size_mb:void 0},alwaysAllowBrowserAgent:e?.always_allow_browser_agent??!1,hasAcceptedApiTerms:e?.has_accepted_api_terms??!1,sources:e?.sources??{source_to_limit:{}}});function C2e(e,t){return e?e.place_widget_block&&t.place_widget_block?{...t,place_widget_block:{...e.place_widget_block,review_summary:t.place_widget_block.review_summary}}:e.shopping_widget_block&&t.shopping_widget_block?{...t,shopping_widget_block:{...e.shopping_widget_block,review_summary:t.shopping_widget_block.review_summary}}:t:t}var u3;(function(e){e.SAVE_PROFILE="save_profile",e.DELETE_PROFILE="delete_profile",e.TOGGLE_DISABLED="toggle_disabled"})(u3||(u3={}));const S2e=async({profileName:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/auth/get_special_profile",t,{params:{query:{profile_name:e}},timeoutMs:1500,numRetries:1});if(n||!r)throw new he("API_CLIENTS_ERROR",{message:`Failed to get special profile ${e}`,cause:n,status:s.status??0});return{unlimitedProSearch:!!r.unlimited_pro_search,maxModelSelection:!!r.max_model_selection,unlimitedResearch:!!r.unlimited_research,fileUpload:!!r.file_upload}}catch(n){return Z.error(n),{unlimitedProSearch:!1,maxModelSelection:!1,unlimitedResearch:!1,fileUpload:!1}}},Uxt=async({reason:e})=>{try{const{error:t,data:n,response:r}=await de.GET("/rest/user/subscription/refresh",e,{timeoutMs:Qe(),headers:{"X-Perplexity-CSRF-Protection":"1"}});if(t)throw new he("API_CLIENTS_ERROR",{message:"Failed to refresh subscription status",cause:t,status:r.status??0});return n}catch(t){return Z.error(t),null}},QH={has_profile:!1,disabled:!1,bio:"",location:"",response_language:"",location_lng:"",location_lat:"",use_memory:!1,use_search_history:!1,language:""},E2e=async({headers:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/user/get_user_ai_profile",t,{timeoutMs:1500,numRetries:$l,headers:e});if(n||!r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user profile",cause:n,status:s.status??0});return r}catch(n){return Z.error(n),QH}},XH=async({skipConnectorPickerCredentials:e=!0,headers:t,reason:n})=>{try{const{error:r,data:s,response:o}=await de.GET("/rest/user/settings",n,{params:{query:{skip_connector_picker_credentials:e}},timeoutMs:1500,numRetries:$l,headers:t});if(r||!s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user settings",cause:r,status:o.status??0});return FR(s)}catch(r){return Z.error(r),FR({})}},Vxt=async({type:e,value:t,reason:n})=>{const r=e==="memory"?{use_memory:t}:{use_search_history:t},{error:s,data:o,response:a}=await de.POST("/rest/user/save_user_ai_profile",n,{timeoutMs:Qe(),numRetries:1,headers:{"content-type":"application/json"},body:{action:u3.SAVE_PROFILE,updated_profile:{...r,version:ql}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update personal search settings",cause:s,status:a.status??0});return o},Hxt=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/user/previous-subscription",e,{timeoutMs:3e3,numRetries:1});if(t)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user previous subscription",cause:t,status:r.status??0});return n},zxt=async({filters:e,skipToken:t,reason:n})=>{const{error:r,data:s,response:o}=await de.POST("/rest/connectors/sharepoint/sites",n,{body:{filters:e,skip_token:t},timeoutMs:Qe({productionMs:500}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch sharepoint sites",cause:r,status:o.status??0});return{sites:s.sites,skipToken:s.skip_token}},k2e=async({reason:e})=>{try{const{error:t,data:n,response:r}=await de.GET("/rest/auth/check_government_request_origin",e,{timeoutMs:1500,numRetries:$l});if(t||!n)throw new he("API_CLIENTS_ERROR",{message:"Failed to check government origin",cause:t,status:r.status??0});return{isGovernmentRequestOrigin:n.is_government_request_origin}}catch(t){return Z.error(t),{isGovernmentRequestOrigin:!1}}},M2e=({enabled:e,reason:t})=>{const n=async()=>k2e({reason:t}),{data:r}=mt({enabled:e,queryKey:Kye(),queryFn:n});return r??{isGovernmentRequestOrigin:void 0}};function T2e(e,t){return mt({enabled:!!e,queryKey:Yye(e),queryFn:async()=>S2e({profileName:e,reason:t})})}function Yr(){const e=M2e({enabled:!0,reason:"user-capabilities"}),t=e.isGovernmentRequestOrigin?"us_government_or_military":"",{data:n}=T2e(t,"user-capabilities");return d.useMemo(()=>{const s=e.isGovernmentRequestOrigin,o={unlimitedProSearch:!!n?.unlimitedProSearch,maxModelSelection:!!n?.maxModelSelection,unlimitedResearch:!!n?.unlimitedResearch,fileUpload:!!n?.fileUpload};return{isGovernmentRequestOrigin:s,specialCapabilities:o}},[e.isGovernmentRequestOrigin,n])}const ZH=()=>{const{isGovernmentRequestOrigin:e}=Yr();return e===void 0},Wxt=async({source:e,locale:t,headers:n,reason:r})=>{try{const{data:s,error:o,response:a}=await de.POST("/rest/enterprise/customer-portal",r,{body:{origin:e,locale:t},timeoutMs:7500,headers:{...n,"Content-Type":"application/json"}});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:r}});if(s.status!=="success")throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:r}});return s.url}catch(s){return Z.error(s),null}},Gxt=async({interval:e,subscriptionTier:t,origin:n,locale:r,reason:s,orgDraftUuid:o})=>{const a=Nx(),{data:i,error:c,response:u}=await de.POST("/rest/enterprise/checkout-session",s,{body:{referral_code:null,discount_code:null,origin:n,tier:e,locale:r,subscription_tier:t,org_draft_uuid:o??null},timeoutMs:3500,headers:{...a?{"Screen-Dimensions":a}:{}}});if(c)throw new he("API_CLIENTS_ERROR",{cause:c,status:u.status??0,details:{reason:s}});return i},$xt=async({interval:e,subscriptionTier:t,origin:n,locale:r,collectionMethod:s,billingAddress:o,reason:a,orgDraftUuid:i})=>{const c=Nx(),{data:u,error:f,response:m}=await de.POST("/rest/enterprise/subscription",a,{body:{collection_method:s,origin:n,locale:r,subscription_interval:e,subscription_tier:t,billing_address:o,org_draft_uuid:i??null},timeoutMs:1e4,headers:{...c?{"Screen-Dimensions":c}:{}}});if(f)throw new he("API_CLIENTS_ERROR",{cause:f,status:m.status??0,details:{reason:a}});return u};var d3;(function(e){e.ON_PLATFORM="on_platform",e.OFF_PLATFORM="off_platform"})(d3||(d3={}));const A2e=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/user/pending-invitation",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n.pending_invitation??null}catch(n){return Z.error(n),null}},N2e=async({headers:e,reason:t})=>{const n={organization:void 0,org_user:void 0,is_in_organization:!1,pending_invitation:null};try{const{data:r,error:s,response:o}=await de.GET("/rest/enterprise/user/organization",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0,details:{reason:t}});return r.status!=="success",r}catch(r){return Z.error(r),n}},qxt=async({inviteUUID:e,headers:t,reason:n})=>{try{const{data:r,error:s}=await de.GET("/rest/enterprise/organization/invite/{org_invite_uuid}",n,{params:{path:{org_invite_uuid:e}},headers:t,timeoutMs:Qe({productionMs:2e3}),numRetries:1}),o=s||r,a=o?.detail?{...o.detail}:o;if(a?.status!=="success")return a;const i=a?.invite?.subscription_tier??null;return{status:a?.status??"unknown",userEmail:a?.invite?.user_email??"",uuid:a?.invite?.uuid??"",orgDisplayName:a?.org_display_name??"",tncAcceptanceMethod:a?.tnc_acceptance_method??d3.ON_PLATFORM,tncAccepted:a?.tnc_accepted??!1,subscriptionTier:i}}catch(r){return Z.error(r),null}},Kxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/subscription/refresh",t,{headers:e,timeoutMs:4e3});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return{subscriptionStatus:n?.subscription_status??null}}catch(n){return Z.error(n),null}},Yxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/premium-secure-eligibility",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n}catch(n){return Z.error(n),null}},Qxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/premium-secure-billing-update",t,{headers:{...e,"Content-Type":"application/json"},timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n}catch(n){return Z.error(n),null}},Xxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/subscription-info",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get org subscription info",n),null}},JH=async({uuid:e,success:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/sse/perplexity_connector_auth_response",n,{body:{result:{tool_uuid:e,success:t}},backOffTime:100,numRetries:1,headers:{"Content-Type":"application/json"}});if(r?.status!=="success")throw new he("API_CLIENTS_ERROR",{message:"Failed to post perplexity connector auth response",cause:s,status:o.status??0});return!0}catch(r){return Z.error("Failed to post perplexity connector auth response",r),!1}},Zxt=async({orgInviteUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/invite/{org_invite_uuid}/accept",t,{params:{path:{org_invite_uuid:e}},timeoutMs:Qe({productionMs:2e3})});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t,orgInviteUUID:e}});return n},Jxt=async({orgInviteUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/invite/{org_invite_uuid}/decline",t,{params:{path:{org_invite_uuid:e}},timeoutMs:Qe({productionMs:2e3})});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t,orgInviteUUID:e}});return n},evt=async({openInviteLinkUuid:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/enterprise/organization/shareable-invite/{open_invite_link_uuid}",n,{params:{path:{open_invite_link_uuid:e}},headers:t,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0,details:{reason:n,openInviteLinkUuid:e}});return r},tvt=async({openInviteLinkUuid:e,headers:t,reason:n})=>{try{const{error:r,data:s,response:o}=await de.POST("/rest/enterprise/organization/shareable-invite/join/{open_invite_link_uuid}",n,{params:{path:{open_invite_link_uuid:e}},headers:{"content-type":"application/json",...t},timeoutMs:3e3});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:o.status??0});return s}catch(r){throw Z.error(r),r}},lu=()=>{const{session:e}=Ne(),t=e?.user?.org_uuid;return!!(t&&t!=="none")};function mo({shouldRefetchOnMount:e=!0,forceFetch:t=!1,reason:n}){const r=lu(),{data:s,refetch:o,isSuccess:a,isFetching:i}=mt({enabled:t||r,queryKey:x4(),queryFn:()=>N2e({reason:n}),placeholderData:Wl,refetchOnMount:e});return d.useMemo(()=>({orgUser:s?.org_user,isAdmin:s?.org_user?.role==="ADMIN",organization:s?.organization,isEnterprise:r,refetch:o,isLoading:!s&&i,isFetching:i,isSuccess:a}),[s,r,i,a,o])}const R2e=()=>{const{organization:e,isEnterprise:t,isLoading:n}=mo({reason:"check-upsell-enterprise-consent"});return n?!0:t?!e?.settings?.product_communications_enabled:!1},k4="pplx.chosen-locale",f3="pplx.la-status",ez="pplx.source-selection-v3",BR="pplx.prefers-metric",tz="pplx.default-search-session",D2e="pplx.utm-source",nz="pplx.pt",rz=400,j2e=30,I2e=7,P2e=e=>{lo(k4,e,{expires:rz})},O2e=()=>mr(k4),L2e=()=>{$p(k4)},F2e=e=>{lo(f3,e,{})},M_=(e,t)=>{const n=`${ez}-${t}`;lo(n,JSON.stringify(e),{expires:I2e})},B2e=e=>{const t=`${ez}-${e}`,n=mr(t);return n?JSON.parse(n):null},U2e=()=>{lo("pplx.has-discovered-space-mentions","true",{expires:rz})},V2e=e=>{lo(tz,e,{expires:j2e})},H2e=()=>mr(tz),z2e=()=>mr(D2e),nvt=()=>mr(nz),W2e=e=>{lo(nz,e)},G2e=()=>H2e()==="firefox"?!0:typeof window>"u"?!1:new URL(window.location.href).searchParams.get("pc")==="firefox",UR="partnerships",$2e=()=>z2e()===UR?!0:typeof window>"u"?!1:new URL(window.location.href).searchParams.get("utm_source")===UR,Hd=d.memo(({isSamsungBrowser:e,isWindowsApp:t,isIPad:n,isComet:r,isFirefoxDefaultSearch:s,isPartnershipCampaign:o,isGovernment:a,isEnterpriseWithoutConsent:i,children:c})=>{const u=Ca(),f=G2e(),m=$2e(),{isGovernmentRequestOrigin:p}=Yr(),{device:{isWindowsApp:h,isSamsungBrowser:g,isIPad:y}}=sn(),x=ZH(),v=R2e();return d.useMemo(()=>!!(r&&u||t&&h||e&&g||n&&y||s&&f||o&&m||a&&(x||p)||i&&v),[u,h,g,y,r,e,t,n,s,f,o,m,a,p,x,i,v])?null:c});Hd.displayName="OmitUpsellIf";const sz=["ppl-ai-file-upload","ppl-ai-sandbox-file-upload","ppl-ai-experimental-file-upload"],q2e=e=>sz.some(t=>e.url.includes(`${t}.s3.amazonaws.com/web/direct-files`));var m3;(function(e){e.token_limit_exceeded="token_limit_exceeded",e.parsing_error="parsing_error",e.unknown_error="unknown_error",e.unauthorized="unauthorized",e.no_data_received="no_data_received",e.file_type_not_supported="file_type_not_supported",e.image_failed_moderation="image_failed_moderation"})(m3||(m3={}));var od;(function(e){e.generic_upload_error="generic_upload_error",e.unsupported_type="unsupported_type",e.too_large="too_large",e.too_small="too_small",e.no_name="no_name",e.failed_moderation="failed_moderation",e.rate_limited="rate_limited",e.over_file_count="over_file_count",e.over_image_count="over_image_count",e.attachments_disabled_by_organization="attachments_disabled_by_organization"})(od||(od={}));const ty=e=>{if(Tf(e))return"application/pdf";const n=e.split("?")[0].split("#")[0].split(".").pop()?.toLowerCase();return n&&{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",jp2:"image/jp2",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",svg:"image/svg+xml",webp:"image/webp",ico:"image/x-icon",avif:"image/avif",heic:"image/heic",heif:"image/heif",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",txt:"text/plain",csv:"text/csv",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",md:"text/markdown"}[n]||"application/octet-stream"},K2e=e=>{const t=e.file_metadata?.file_repository_type;return e.is_attachment&&!t&&!e.meta_data?.file_uuid},Y2e=e=>{if(!e)return!1;try{return new URL(e).hostname.includes("s3.amazonaws.com")}catch{return!1}},go=He({token_limit_exceeded:{id:"cnFlyTXVDl",defaultMessage:"File {filename} exceeds the model's token limit."},parsing_error:{id:"RdRRX8+YG/",defaultMessage:"Failed to parse file {filename}."},file_type_not_supported:{id:"IaflMSTTq6",defaultMessage:"File type not supported for {filename}."},unknown_error:{id:"zhy7qBi3Eu",defaultMessage:"Unknown error for file {filename}."},unauthorized:{id:"6bOe+cTUhc",defaultMessage:"User not authorised to access file {filename}."},no_data_received:{id:"34PXW7VvKh",defaultMessage:"No data received for file {filename}."},generic_upload_error:{id:"xVFvYDY5wK",defaultMessage:"File upload failed"},unsupported_type:{id:"VUOyYEDS96",defaultMessage:"The file type you uploaded is not supported."},too_large:{id:"XBcIjOYq8V",defaultMessage:"File too large: {max} maximum."},too_small:{id:"ZUyiNCx0Aw",defaultMessage:"File too small."},no_name:{id:"IkAmckATMw",defaultMessage:"File name is required."},image_failed_moderation:{id:"YCCLnMQDPb",defaultMessage:"File {filename} failed moderation."},failed_moderation:{id:"hnN6c9ExET",defaultMessage:"File upload failed moderation."},rate_limited:{id:"el7NlqcDQZ",defaultMessage:"You have reached the daily upload limit for your plan."},over_file_count:{id:"2+5sg16GUy",defaultMessage:"You are allowed up to {maxNumFiles, plural, one {# file} other {# files}} at once."},over_image_count:{id:"FIudmpgA1s",defaultMessage:"You are allowed up to {maxNumImages, plural, one {# image} other {# images}} at once."},attachments_disabled_by_organization:{id:"3N0C1GH7jP",defaultMessage:"Your organization has disabled attachments."}}),eg=e=>{if(e.startsWith("/rest/connectors/wiley/"))return"WILEY";if(e.includes("drive.google.com")||e.includes("connectors/google-drive")||e.includes("docs.google.com"))return"GOOGLE_DRIVE";if(e.includes("onedrive.live.com")||e.includes("1drv.ms")||e.includes("connectors/onedrive"))return"ONEDRIVE";if(e.includes(".sharepoint.com")||e.includes("connectors/sharepoint"))return"SHAREPOINT";if(e.includes("dropbox.com/preview")||e.includes("connectors/dropbox"))return"DROPBOX";if(e.includes("app.box.com/file")||e.includes("connectors/box"))return"BOX"},oz=e=>{const t=e.meta_data?.connection_type??e.file_metadata?.connector_type;return t||eg(e.url)},tg=e=>!!e?.meta_data?.patent_name||!!e?.url&&Tf(e.url),M4=e=>tg(e)?e?.meta_data?.patent_name:void 0,p3=e=>!!(e?.meta_data?.connection_type&&e?.meta_data.connection_type!=="LOCAL")||e.is_attachment&&!!eg(e.url),Bx=e=>sz.some(n=>e.includes(`${n}.s3.amazonaws.com/web/direct-files`))||_d(e)||Tf(e),Yl=e=>e.is_attachment&&Bx(e.url),az=e=>e.trim().replace(/\/+$/,"").replace(/^(?:https?:\/\/)?(?:www\.)?/,""),rvt=e=>!!new RegExp("^((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,})(\\/[\\w\\-._~:/@!$&'()*+,;=%.]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e);function Ur(e){const t=/(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(?:\.[a-zA-Z]{2,})?|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d+)?/,n=e.match(t);return n&&n.length>0?n[1]||n[0]:"unknown"}function ng(e){const t=Ur(e);return t==="unknown"?"unknown":t.replace(/\.[^.]*$/,"")}function $c(e){return e.includes("calendar.google.com")||e.includes("google.com/calendar")?"https://calendar.google.com":e.includes("mail.google.com")||e.includes("google.com/mail")?"https://mail.google.com":Z2e(e)?"www.perplexity.ai":Ur(e)}function svt(e){return e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`}function Ji(e){const t=["(?:youtube?\\.com\\/","(?:[^/\\n\\s]+\\/\\S+\\/","|(?:v|e(?:mbed)?)\\/","|\\S*?[?&]v=",")","|youtu\\.be\\/",")([a-zA-Z0-9_-]{11})"].join(""),n=new RegExp(t),r=e.match(n);if(r&&r[1].length==11)return r[1]}function _d(e){return e.startsWith("https://pplx-res.cloudinary.com/")||e.startsWith("https://api.cloudinary.com/v1_1/pplx/image/download")}function Tf(e){const t=e.startsWith("https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf"),n=txe(e)&&e.includes("/rest/file-repository/patents/");return t||n}function ovt(e){return e.includes("code-interpreter-files.s3.amazonaws.com")||e.includes("pplx_code_interpreter")}function avt(e){return e.includes("user-gen-media-assets")}function VR(e){return e.replace(/\/s--[^/]+--\/v\d+\//,"/")}function T4(e){return!Yl(e)&&!!e.url&&!Ji(e.url)&&!_d(e.url)&&!e.is_memory}const cu=e=>{try{const r=new URL(e).pathname.replace(/^\//,"").split("/"),s=r[r.length-1];return decodeURIComponent(s)}catch{return"File"}},iz=e=>{const t=e,n=t.indexOf("/"),r=Math.max(23,n+16);return t.length>r?t.substring(0,r-1)+"…":t},Q2e=(e,t)=>`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent([e,t].filter(Boolean).join(", "))}`,X2e=(e,t)=>`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([e,t].filter(Boolean).join(", "))}`;function ivt(e){return e.includes("https://openai.com/index/image-generation-api/")}function Z2e(e){return e.startsWith("chrome://")||e.startsWith("chrome-extension://")||e.startsWith("browser-extension://")||e.startsWith("browser://")||e.startsWith("comet://")}const lvt=e=>e.replace("comet://","chrome://"),Ux=e=>{if(!e)return null;try{return new URL(e)}catch{return null}},J2e=async e=>{const t=[];return await Promise.all(e.map(async n=>{await new Promise(r=>setTimeout(r,Math.random()*500));try{(await fetch(n,{method:"HEAD"})).ok&&t.push(n)}catch(r){console.debug(`URL ${n} is not reachable:`,r)}})),t};async function*exe(e,t=5){let n=1,r=0;for(;r0&&(yield o,n=t)}}const A4=e=>{try{const t=new URL(e);return["AWSAccessKeyId","Signature","Expires"].every(n=>t.searchParams.has(n))}catch{return!1}},h3=e=>{if(!e)return"";const t=e.indexOf("?");return(t===-1?e:e.substring(0,t)).replace(/\/+$/,"")},txe=e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}};let HR=0;class Cm{eventTime=-1;setOnce(){return this.eventTime==-1?(this.eventTime=Date.now(),!0):!1}timeSinceTimestamp(t){return this.eventTime===-1||t==null?-1:this.eventTimet?(Z.log(`TimeMarker.timeBeforeTimestamp found inconsistency: mytime ${this.eventTime}, next: ${t}`),-1):t-this.eventTime}wasSet(){return this.eventTime!=-1}}const nxe={firstServerResponseReceived:!1,firstLLMTokenReceived:!1,isPerplexityBrowser:!1},Ql=new Map,rxe=(e,{hasLLMToken:t,hasSearchResults:n,hasSources:r},s)=>{sxe(e,s),oxe(e,t,s),axe(e,n),ixe(e,r)},sxe=(e,t)=>{const n=Ql.get(e);if(!n||n.firstServerResponseReceived||!n.submitTimestamp||!n.startFirstServerResponseMarker?.setOnce())return;n.firstServerResponseReceived=!0;const{queryStr:r,isFollowup:s,queryParams:o}=n,a=dxe(e);a>0&&Li({name:"query first server response",data:{startFirstServerResponseElapsed:a,queryStr:r,isFollowup:s,mode:o?.mode??"unknown",isPerplexityBrowser:n.isPerplexityBrowser},user:t??void 0})},oxe=(e,t,n)=>{const r=Ql.get(e);if(!r||r.firstLLMTokenReceived||!t||!r.startLLMTokenMarker?.setOnce())return;r.firstLLMTokenReceived=!0;const{queryStr:s,isFollowup:o,queryParams:a}=r,i=fxe(e);i>0&&Li({name:"query first llm token",data:{startLLMTokenElapsed:i,queryStr:s,isFollowup:o,mode:a?.mode??"unknown",isPerplexityBrowser:r.isPerplexityBrowser},user:n??void 0})},axe=(e,t)=>{const n=Ql.get(e);if(n){if(!t)return}else return;n.firstSearchResultsMarker?.setOnce()},ixe=(e,t)=>{const n=Ql.get(e);if(n){if(!t)return}else return;n.firstSourcesMarker?.setOnce()},lxe=({latencies:e,isMobile:t})=>{Pl("web.frontend.autosuggest_latency",{latencies:e,isMobile:t})},T_=(e,t)=>e?CM:t??void 0,Zm=e=>{if(e)return CM;const t=Us();if(t?.android_version)return"browser_android_mweb";if(t?.ios_version)return"browser_ios_mweb"},zR=(e,{session:t,source:n,name:r})=>{const s=Ql.get(e);s&&(s.endStreamTimestamp||(s.endStreamTimestamp=Date.now(),Li({name:r,data:s,user:{id:t?.user?.id,subscription_status:t?.user?.subscription_status},source:n})))},cxe=e=>Ux(e)?.host??"",uxe=(e,{name:t,queryStr:n,queryParams:r,isFollowup:s,frontendUUID:o,isPerplexityBrowser:a,session:i,browserVersion:c,source:u,connectors:f,mentions:m})=>{HR+=1;const p={...nxe};p.submissionType=t,p.submitTimestamp=Date.now(),p.queryStr=n,p.queryParams=r,p.frontendUUID=o,p.submissionCount=HR,p.isFollowup=s,p.startFirstServerResponseMarker=new Cm,p.startLLMTokenMarker=new Cm,p.firstSearchResultsMarker=new Cm,p.firstSourcesMarker=new Cm,p.firstSourcesRenderMarker=new Cm,p.isPerplexityBrowser=a,p.browserVersion=c,p.enabledConnectors=f?.enabled,p.disabledConnectors=f?.disabled,p.referrer=document.referrer;const h=m?.filter(x=>x.type==="tab"&&x.url)??[];p.attachedTabsDomains=[...new Set(h.map(x=>cxe(x.url)).filter(Boolean))],p.attachedTabsCount=h.length;const g=m?.filter(x=>x.type==="space")??[];p.mentionedSpacesCount=g.length;const y=m?.filter(x=>x.type==="shortcut")??[];p.mentionedShortcutsCount=y.length,Ql.set(e,p),Li({name:"submit query",data:p,user:i?.user??void 0,source:u})},dxe=e=>{const t=Ql.get(e);let n=-1;return t&&(n=t.startFirstServerResponseMarker?.timeSinceTimestamp(t.submitTimestamp)??-1),n},fxe=e=>{const t=Ql.get(e);let n=-1;return t&&(n=t.startLLMTokenMarker?.timeSinceTimestamp(t.submitTimestamp)??-1),n};var WR;(function(e){e.FLASHCARD="FLASHCARD",e.QUIZ="QUIZ"})(WR||(WR={}));const Xe=e=>{const{device:{isWindowsApp:t}}=sn(),n=d.useRef(new Set),r=d.useCallback((i,c={})=>{const u=Zm(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]),s=d.useCallback(i=>{const c=Zm(t),u=i.map(({name:f,data:m})=>({name:f,data:m,source:c,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}}));Jhe(u)},[t,e?.user?.id,e?.user?.subscription_status]),o=d.useCallback((i,c)=>{const u=Zm(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]),a=d.useCallback((i,c={})=>{if(n.current.has(i))return;n.current.add(i);const u=Zm(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]);return d.useMemo(()=>({trackEvent:r,trackEventTyped:o,trackEventOnce:a,trackEventBatch:s}),[r,s,o,a])},Bt=A.memo(()=>l.jsx("div",{className:"bg-backdrop/70 fixed inset-0 z-[999] flex items-center justify-center backdrop-blur-sm",children:l.jsx(Gl,{})}));Bt.displayName="ModalLoader";const lz=Ft("ModalStateContext",{currentOpenModals:[],currentOpenedModal:null,openModal:()=>{},openStackedModal:()=>{},updateModal:()=>{},closeModal:()=>{}}),mxe=()=>{const e=d.useContext(lz);if(!e)throw new Error("useModalState must be used within ModalContext");return e},pn=()=>{const e=mxe(),t=Uo(),n=d.useMemo(()=>{const s=e.currentOpenedModal??t.legacyIdentifiers.currentOpenModal??null,o=[];o.push(...e.currentOpenModals);for(const a of t.legacyIdentifiers.currentOpenModals)o.push({modalName:a,arg:{}});return{openModal:e.openModal,closeModal:e.closeModal,openStackedModal:e.openStackedModal,updateModal:e.updateModal,currentOpenedModal:s,currentOpenModals:o}},[e.closeModal,e.openModal,e.openStackedModal,e.updateModal,e.currentOpenModals,e.currentOpenedModal,t.legacyIdentifiers.currentOpenModal,t.legacyIdentifiers.currentOpenModals]),r=d.useMemo(()=>{const s=e.currentOpenedModal??t.legacyIdentifiers.currentOpenModal??void 0,o=new Set(t.legacyIdentifiers.currentOpenModals);for(const a of e.currentOpenModals)o.add(a.modalName);return{openModal:t.openModal,openStackedModal:t.openStackedModal,legacyIdentifiers:{currentOpenModal:s,currentOpenModals:o}}},[e.currentOpenModals,e.currentOpenedModal,t.legacyIdentifiers.currentOpenModal,t.legacyIdentifiers.currentOpenModals,t.openModal,t.openStackedModal]);return{legacy:n,updated:r}},cz=Ft("ModalInternalContext",{canOutsideClickClose:!0}),uz=A.memo(()=>l.jsx("p",{children:"An error has occurred"}));uz.displayName="ErrorFallback";const pxe=Ce(async()=>{const{LocationPermissionModal:e}=await Se(()=>q(()=>import("./LocationPermissionModal-CJRGUVmC.js"),__vite__mapDeps([5,4,1,6,3,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),hxe=Ce(async()=>{const{FileUploadModal:e}=await Se(()=>q(()=>import("./FileUploadModal-BvFT6lXw.js"),__vite__mapDeps([13,4,1,8,3,9,6,7,14,15,16,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),gxe=Ce(async()=>{const{CometDownloadInstructionsModal:e}=await Se(()=>q(()=>import("./CometDownloadInstructionsModal-C-u2fo9U.js"),__vite__mapDeps([17,4,1,6,3,18,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),yxe=Ce(async()=>{const{CollectionSelectModal:e}=await Se(()=>q(()=>import("./CollectionSelectModal-chyGMqqe.js"),__vite__mapDeps([19,4,1,6,3,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),xxe=Ce(async()=>{const{OnboardingModal:e}=await Se(()=>q(()=>import("./OnboardingModal-BBLBP53x.js").then(t=>t.a),__vite__mapDeps([20,4,1,6,3,21,22,23,24,9,7,8,25,26,27,28,29,16,30,31,10,11,12,32,33,34,35,36])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),vxe=Ce(async()=>{const{PurchaseConfirmationToast:e}=await Se(()=>q(()=>import("./PurchaseConfirmationToast-GzPKwh-L.js"),__vite__mapDeps([37,4,1,6,3,38,7,39,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),bxe=Ce(async()=>{const{ThreadLossAversionModal:e}=await Se(()=>q(()=>import("./ThreadLossAversionModal-D7FcWrP_.js"),__vite__mapDeps([40,4,1,6,3,41,7,42,9,8,43,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),_xe=Ce(async()=>{const{CompanyDataPrivacyModal:e}=await Se(()=>q(()=>import("./CompanyDataPrivacyModal-CBquTxiE.js"),__vite__mapDeps([44,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),wxe=Ce(async()=>{const{PricingTableModal:e}=await Se(()=>q(()=>import("./PricingTableModal-DKTASYyc.js"),__vite__mapDeps([45,4,1,3,6,21,22,23,24,9,7,8,25,26,27,28,29,18,10,11,12])));return{default:e}}),Cxe=Ce(async()=>{const{MapModal:e}=await Se(()=>q(()=>import("./MapModal-COz1Z29Z.js"),__vite__mapDeps([46,4,1,7,47,3,8,9,6,10,11,12])));return{default:e}}),Sxe=Ce(async()=>{const{ShoppingOnboardingModal:e}=await Se(()=>q(()=>import("./ShoppingOnboardingModal-CZLUPf2r.js"),__vite__mapDeps([48,4,1,6,3,49,8,9,7,50,51,52,53,54,55,56,57,39,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Exe=Ce(async()=>{const{PurchaseDetailsModal:e}=await Se(()=>q(()=>import("./PurchaseDetailsModal-CkTv7i6n.js"),__vite__mapDeps([58,4,1,6,3,9,7,8,50,51,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),kxe=Ce(async()=>{const{SpaceSettingsModal:e}=await Se(()=>q(()=>import("./SpaceSettingsModal-D32x8BuZ.js"),__vite__mapDeps([59,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Mxe=Ce(async()=>{const{MemoryListModal:e}=await Se(()=>q(()=>import("./MemoryListModal-3QH1KayA.js"),__vite__mapDeps([60,4,1,6,3,7,61,8,9,10,11,12])));return{default:e}}),Txe=Ce(async()=>{const{MemoryDetailModal:e}=await Se(()=>q(()=>import("./MemoryDetailModal-tGdhFYPy.js"),__vite__mapDeps([62,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}}),Axe=Ce(async()=>{const{HotelRoomDetailsModal:e}=await Se(()=>q(()=>import("./HotelRoomDetailsModal-Bs6UfaTm.js"),__vite__mapDeps([63,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Nxe=Ce(async()=>{const{PaymentModal:e}=await Se(()=>q(()=>import("./PaymentModal-DIcb6WXv.js"),__vite__mapDeps([64,4,1,8,3,9,6,7,23,65,25,24,57,54,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Rxe=Ce(async()=>{const{MeetingDefaultsModal:e}=await Se(()=>q(()=>import("./MeetingDefaultsModal-DJ18fASY.js"),__vite__mapDeps([66,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),Dxe=Ce(async()=>{const{AvailabilityModal:e}=await Se(()=>q(()=>import("./AvailabilityModal-B8HOqFPU.js"),__vite__mapDeps([67,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),jxe=Ce(async()=>{const{ProMessageModal:e}=await Se(()=>q(()=>import("./ProMessageModal--NnvSlnC.js"),__vite__mapDeps([68,4,1,7,3,8,9,6,10,11,12])));return{default:e}}),Ixe=Ce(async()=>Se(()=>q(()=>import("./SubSuccessModal-CEzPkVT6.js"),__vite__mapDeps([69,4,1,8,3,9,6,7,70,24,10,11,12])))),Pxe=Ce(async()=>Se(()=>q(()=>import("./ReferralErrorModal-D4SrZMEu.js"),__vite__mapDeps([71,4,1,6,3,36,7,8,9,10,11,12])))),Oxe=Ce(async()=>Se(()=>q(()=>import("./ReferralSuccessModal-CVtAvfIm.js"),__vite__mapDeps([72,4,1,6,3,35,8,9,7,36,28,26,10,11,12])))),Lxe=Ce(async()=>Se(()=>q(()=>import("./IncentiveProModal-B1Baqpf5.js"),__vite__mapDeps([73,4,1,6,3,8,9,7,10,11,12])))),Fxe=Ce(async()=>{const{StudentReferralsModal:e}=await Se(()=>q(()=>import("./StudentReferralsModal-CKAfMn6X.js"),__vite__mapDeps([74,4,1,8,3,9,6,7,34,35,36,28,26,29,10,11,12])));return{default:e}}),Bxe=Ce(async()=>{const{SheerIDModal:e}=await Se(()=>q(()=>import("./SheerIDModal-BHYPljec.js"),__vite__mapDeps([75,4,1,6,3,28,26,8,9,7,29,10,11,12])));return{default:e}}),Uxe=Ce(async()=>Se(()=>q(()=>import("./BraintreeSubscriptionModal-2dXzLlVe.js"),__vite__mapDeps([76,4,1,8,3,9,6,7,10,11,12])))),Vxe=Ce(async()=>{const{RestaurantBookingModal:e}=await Se(()=>q(()=>import("./RestaurantBookingModal-7zq9QxVz.js"),__vite__mapDeps([77,4,1,78,6,3,79,38,7,80,42,81,9,47,8,10,11,12,30])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Hxe=Ce(async()=>Se(()=>q(()=>import("./SheerIdRedirectModal-BpaodOqj.js"),__vite__mapDeps([82,4,1,6,3,8,9,7,10,11,12])))),zxe=Ce(async()=>{const{EnterprisePremiumSecureUpgradeModal:e}=await Se(()=>q(()=>import("./EnterprisePremiumSecureUpgradeModal-DU2i2Qm_.js"),__vite__mapDeps([83,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),Wxe=Ce(async()=>{const{ShortcutModal:e}=await Se(()=>q(()=>import("./ShortcutModal-hkCS-ySA.js"),__vite__mapDeps([84,4,1,8,3,9,6,7,10,11,12])));return{default:e}}),Gxe=Ce(async()=>Se(()=>q(()=>Promise.resolve().then(()=>a1t),void 0))),$xe=Ce(async()=>{const{AutomationModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>kot),void 0));return{default:e}}),qxe=Ce(async()=>{const{FinanceAlertModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>Not),void 0));return{default:e}}),Kxe=Ce(async()=>{const{SharepointSiteModal:e}=await Se(()=>q(()=>import("./SharepointSiteModal-DEqwxYR7.js"),__vite__mapDeps([85,4,1,6,3,86,8,9,7,10,11,12])));return{default:e}}),Yxe=Ce(async()=>{const{MCPServerModal:e}=await Se(()=>q(()=>import("./MCPServerModal-wufPmNsJ.js"),__vite__mapDeps([87,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),Qxe=Ce(async()=>{const{MemberSetTierModal:e}=await Se(()=>q(()=>import("./MemberSetTierModal-C5VDUVKx.js"),__vite__mapDeps([88,4,1,6,3,70,7,8,9,24,57,10,11,12])));return{default:e}}),Xxe=Ce(async()=>{const{MCPServiceToolsModal:e}=await Se(()=>q(()=>import("./MCPServiceToolsModal-0_CZ4KV7.js"),__vite__mapDeps([89,4,1,6,3,90,8,9,7,10,11,12])));return{default:e}}),Zxe=Ce(async()=>{const{PlaceModal:e}=await Se(()=>q(()=>import("./PlaceModal-CytEwbsn.js"),__vite__mapDeps([78,4,1,6,3,79,38,7,80,42,81,9,47,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),GR=Ce(async()=>{const{OrgInviteModal:e}=await Se(()=>q(()=>import("./OrgInviteModal-CEe6bRsT.js"),__vite__mapDeps([91,4,1,8,3,9,6,7,92,93,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Jxe=Ce(async()=>{const{RequestAccessModal:e}=await Se(()=>q(()=>import("./RequestAccessModal-CZs8Tpx-.js"),__vite__mapDeps([94,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),eve=Ce(async()=>{const{SpaceContextModal:e}=await Se(()=>q(()=>import("./SpaceContextModal-CjwpMh-4.js"),__vite__mapDeps([95,4,1,8,3,9,6,7,15,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),tve=Ce(async()=>{const{LoginModal:e}=await Se(()=>q(()=>import("./LoginModal-CfCGpXCO.js"),__vite__mapDeps([96,4,1,6,3,41,7,42,9,8,43,18,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),nve=Ce(async()=>{const{AnnouncementImageModal:e}=await Se(()=>q(()=>import("./AnnouncementImageModal-CBHVN-fI.js"),__vite__mapDeps([97,4,1,3,7,8,9,6,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),rve=Ce(async()=>{const{FullscreenUpsellModal:e}=await Se(()=>q(()=>import("./FullscreenUpsellModal-DNaA4FHU.js"),__vite__mapDeps([98,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),sve=Ce(async()=>{const{ShoppingTryOnOnboardingModal:e}=await Se(()=>q(()=>import("./ShoppingTryOnOnboardingModal-D8Kwg3Mf.js"),__vite__mapDeps([99,4,1,6,3,100,9,7,101,102,103,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),ove=Ce(async()=>{const{CheckSourcesModal:e}=await Se(()=>q(()=>import("./CheckSourcesModal-LvBDDncs.js"),__vite__mapDeps([104,1,4,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),ave=Ce(async()=>{const{MemorySearchHistoryModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>NKe),void 0));return{default:e}},{loading:()=>l.jsx(Bt,{})}),ive=Ce(async()=>{const{GmailFailedPermissionsModal:e}=await Se(()=>q(()=>import("./GmailModals-D4ZvmFO2.js"),__vite__mapDeps([105,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),lve=Ce(async()=>{const{EmailAssistantDisconnectWarningModal:e}=await Se(()=>q(()=>import("./EmailAssistantDisconnectWarningModal-DlCptha5.js"),__vite__mapDeps([106,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),cve=Ce(async()=>{const{CalendarSelectionModal:e}=await Se(()=>q(()=>import("./CalendarSelectionModal-hTv76Qgh.js"),__vite__mapDeps([107,4,1,8,3,9,6,7,108,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),uve=Ce(async()=>{const{DeleteAllMemoriesModal:e}=await Se(()=>q(()=>import("./DeleteAllMemoriesModal-Cg09X1Ui.js"),__vite__mapDeps([109,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),dve=Ce(async()=>{const{DeleteMemoryModal:e}=await Se(()=>q(()=>import("./DeleteMemoryModal-BXXQVzHz.js"),__vite__mapDeps([110,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),fve=Ce(async()=>{const{ThirdPartyPersonalizationModal:e}=await Se(()=>q(()=>import("./PersonalSearchSettingsMain-CHIO-vMM.js"),__vite__mapDeps([111,4,1,8,3,9,6,7,90,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),mve=Ce(async()=>{const{WatchlistModal:e}=await Se(()=>q(()=>import("./WatchlistModal-EfLNQ8hw.js"),__vite__mapDeps([112,1,4,8,3,9,6,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),pve=Ce(async()=>{const{AvatarManagementModal:e}=await Se(()=>q(()=>import("./AvatarManagementModal-Dxp419em.js"),__vite__mapDeps([113,4,1,8,3,9,6,7,103,114,50,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});Ce(async()=>{const{InstallGateModal:e}=await Se(()=>q(()=>import("./InstallGateModal-DmQe1ivv.js"),__vite__mapDeps([115,4,1,6,3,41,7,42,9,8,43,33,18,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});const hve=Ce(async()=>{const{DowngradeModal:e}=await Se(()=>q(()=>import("./DowngradeModal-CpBhw_YR.js"),__vite__mapDeps([116,4,1,6,3,117,27,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),gve=Ce(async()=>{const{UpgradeModal:e}=await Se(()=>q(()=>import("./UpgradeModal-ChNN1wUW.js"),__vite__mapDeps([118,4,1,8,3,9,6,7,65,25,24,57,117,27,119,26,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});function yve(e){return e?{[e.modalName]:e.arg}:{}}const dz=A.memo(({})=>{const{currentOpenModals:e}=pn().legacy,[t,n]=d.useState(e.length);d.useEffect(()=>{setTimeout(()=>{n(e.length)},100)},[e.length]);const r=t!=e.length;return e.map((s,o)=>l.jsx(fz,{modal:s,canOutsideClickClose:!r&&o+1==e.length},o))});dz.displayName="Modals";const fz=A.memo(({modal:e,canOutsideClickClose:t})=>{const n=d.useMemo(()=>({canOutsideClickClose:t}),[t]);return l.jsx(cz.Provider,{value:n,children:l.jsx(mz,{modal:e})})});fz.displayName="SingleModalWrapper";const mz=A.memo(({modal:e})=>{const{closeModal:t}=pn().legacy,{hasActiveSubscription:n}=$t(),r=e.modalName,{pricingModal:s,loginModal:o,installModal:a,cometDownloadInstructionsModal:i,requestAccessModal:c,collectionSelectModal:u,spaceSettings:f,companyDataPrivacyModal:m,checkSourcesModal:p,mapModal:h,purchaseConfirmationModal:g,shoppingOnboardingModal:y,shoppingOrderDetailsModal:x,lossAversionModal:v,spaceUploadFilesModal:b,spaceContextModal:_,locationPermissionModal:w,watchlistModal:S,deleteMemoryModal:C,memoryDetailModal:E,hotelRoomDetailsModal:T,memoryListModal:k,proSubscriptionPaymentModal:I,proMessageModal:M,memorySearchHistoryModal:N,gmailFailedPermissionsModal:D,emailAssistantDisconnectWarningModal:j,calendarSelectionModal:F,subSuccessModal:R,incentiveProModal:P,restaurantBookingModal:L,sheerIdRedirectModal:U,enterprisePremiumSecureUpgradeModal:O,taskShortcutModal:$,financeAlertModal:G,scheduledTaskModal:H,automationModal:Q,referralSuccessModal:Y,sharepointSiteModal:te,avatarManagementModal:se,shoppingTryOnOnboardingModal:ae,braintreeSubscriptionModal:X,announcementImageModal:ee,fullscreenUpsellModal:le,studentReferrals:re,sheerIdModal:ce,meetingDefaultsModal:ue,availabilityModal:me,mcpServerModal:we,mcpServiceToolsModal:ye,memberSetTierModal:_e,placeModal:ke,thirdPartyPersonalizationModal:De,orgInviteModal:xe}=yve(e),{session:Ue}=Ne(),{trackEvent:Ee}=Xe(Ue);return l.jsxs(l.Fragment,{children:[r==="loginModal"&&o?.origin&&l.jsx(tve,{pitchMessage:o?.pitchMessage,origin:o.origin,isOpen:r==="loginModal",experimentalImageDesign:o.experimentalImageDesign,sheetModalDesign:o.sheetModalDesign,closeModal:t,closeCallback:o?.closeCallback,overrideRedirectUrl:o?.overrideRedirectUrl,disallowedMethods:o?.disallowedMethods,loginButtonsStyle:o?.loginButtonsStyle,renderCloseButton:o?.renderCloseButton,preEnteredEmail:o?.preEnteredEmail,autoFocus:o?.autoFocus}),!1,r==="cometDownloadInstructionsModal"&&i&&i.requestedPlatform&&l.jsx(gxe,{isOpen:r==="cometDownloadInstructionsModal",onClose:t,requestedPlatform:i.requestedPlatform}),r==="pricingModal"&&s&&l.jsx(wxe,{isOpen:r==="pricingModal",pitchMessage:s?.pitchMessage,closeModal:t,origin:s.origin,showFreeTier:s.showFreeTier,defaultSegment:s.defaultSegment,segments:s.segments}),r==="collectionSelectModal"&&u?.entryUUID&&l.jsx(yxe,{isOpen:r==="collectionSelectModal",currentCollection:u.currentCollection,entryUUID:u.entryUUID,searchTerm:u.searchTerm,frontendContextUUID:u.frontendContextUUID,closeModal:t}),r==="spaceSettings"&&l.jsx(kxe,{isOpen:r==="spaceSettings",existingSpace:f?.existingSpace,closeModal:t}),r==="spaceUploadFilesModal"&&b&&l.jsx(hxe,{...b,connectionTypes:Gye(["LOCAL"]),isOpen:r==="spaceUploadFilesModal",closeModal:t}),r==="spaceContextModal"&&l.jsx(eve,{isOpen:r==="spaceContextModal",closeModal:t,collectionSlug:_?.collectionSlug}),r==="requestAccessModal"&&c?.uuidOrSlug&&l.jsx(Jxe,{isOpen:r==="requestAccessModal",onClose:t,uuidOrSlug:c.uuidOrSlug}),r==="mapModal"&&l.jsx(Mr,{fallback:uz,children:l.jsx(Cxe,{isOpen:r==="mapModal",closeModal:t,locations:h&&h.locations,header:h.header,entryUUID:h.entryUUID,searchByLocationOverride:h?.searchByLocationOverride})}),r==="companyDataPrivacyModal"&&l.jsx(_xe,{organizationName:m.organizationName,isOpen:r==="companyDataPrivacyModal",closeModal:t,onContinue:m.onContinue}),r==="checkSourcesModal"&&p&&l.jsx(ove,{isOpen:r==="checkSourcesModal",onClose:t,entryUUID:p.entryUUID,frontendContextUUID:p.frontendContextUUID,contextUUID:p.contextUUID,webResults:p.webResults,extendedBeforeContext:p.extendedBeforeContext,beforeContext:p.beforeContext,selectedText:p.selectedText,afterContext:p.afterContext,state:p?.state}),r==="onboardingModal"&&l.jsx(xxe,{isOpen:r==="onboardingModal",closeModal:t}),r==="lossAversionModal"&&v&&l.jsx(bxe,{isOpen:r==="lossAversionModal",onClose:()=>{t(),v.callback?.()},origin:v.origin}),r==="shoppingOnboardingModal"&&y&&l.jsx(Sxe,{isOpen:r==="shoppingOnboardingModal",onClose:t,onContinue:y.onContinue,flowType:y.flowType}),r==="shoppingOrderDetailsModal"&&l.jsx(Exe,{isOpen:r==="shoppingOrderDetailsModal",onClose:t,item:x?.item,userIntercomHash:x?.userIntercomHash}),r==="purchaseConfirmationModal"&&g&&l.jsx(vxe,{isOpen:r==="purchaseConfirmationModal",onClose:t,order:g.order}),r==="watchlistModal"&&S&&l.jsx(mve,{isOpen:r==="watchlistModal",onClose:t,watchlistType:S.watchlistType,origin:S.origin}),r==="locationPermissionModal"&&w&&l.jsx(pxe,{isOpen:r==="locationPermissionModal",onClose:t,onPermissionGranted:w.onPermissionGranted??Ao,origin:w.origin}),r==="deleteMemoryModal"&&l.jsx(dve,{isOpen:r==="deleteMemoryModal",onClose:t,memoryId:C?.memoryId,onDeleteSuccess:C?.onDeleteSuccess}),r==="deleteAllMemoriesModal"&&l.jsx(uve,{isOpen:r==="deleteAllMemoriesModal",onClose:t}),r==="hotelRoomDetailsModal"&&T&&l.jsx(Axe,{isOpen:r==="hotelRoomDetailsModal",onClose:t,...T}),r==="memoryListModal"&&l.jsx(Mxe,{isOpen:r==="memoryListModal",onClose:t,isMemoryEnabled:k?.isMemoryEnabled??!1}),r==="memoryDetailModal"&&E&&l.jsx(Txe,{isOpen:r==="memoryDetailModal",onClose:t,memoryKey:E.memoryKey,displayValue:E.displayValue}),r==="thirdPartyPersonalizationModal"&&De&&l.jsx(fve,{isOpen:r==="thirdPartyPersonalizationModal",onClose:t,...De}),r==="proSubscriptionPaymentModal"&&I&&l.jsx(Nxe,{isOpen:r==="proSubscriptionPaymentModal",onClose:t,...I}),r==="proMessageModal"&&M&&l.jsx(jxe,{isOpen:r==="proMessageModal",onClose:t,...M}),r==="memorySearchHistoryModal"&&l.jsx(ave,{isOpen:r==="memorySearchHistoryModal",onClose:t,snippet:N?.snippet??"",type:N?.type??"memory",url:N?.url??"",memoryKey:N?.memoryKey,entryUuid:N?.entryUuid,title:N?.title,timestamp:N?.timestamp}),r==="gmailFailedPermissionsModal"&&D&&l.jsx(ive,{isOpen:r==="gmailFailedPermissionsModal",onContinue:D.onContinue??Ao,onClose:t}),r==="emailAssistantDisconnectWarningModal"&&j&&l.jsx(lve,{isOpen:r==="emailAssistantDisconnectWarningModal",connectorName:j.connectorName,onContinue:j.onContinue,onClose:t}),r==="calendarSelectionModal"&&F&&l.jsx(cve,{isOpen:r==="calendarSelectionModal",connectorType:F.connectorType,onClose:t}),r==="subSuccessModal"&&R&&l.jsx(Ixe,{isOpen:r==="subSuccessModal",onClose:t,flowType:R.flowType,upgradeMax:R.upgradeMax,subscriptionTier:R.subscriptionTier,confirmationRedirectsToHomepage:R.confirmationRedirectsToHomepage}),r==="referralErrorModal"&&l.jsx(Pxe,{isOpen:r==="referralErrorModal",onClose:t}),r==="referralSuccessModal"&&Y&&l.jsx(Oxe,{isOpen:r==="referralSuccessModal",onClose:t,monthsAwarded:Y.monthsAwarded}),r==="incentiveProModal"&&l.jsx(Lxe,{isOpen:r==="incentiveProModal",onClose:t,...P}),r==="braintreeSubscriptionModal"&&X&&l.jsx(Uxe,{isOpen:r==="braintreeSubscriptionModal",onClose:t,origin:X.origin}),r==="sheerIdRedirectModal"&&U&&l.jsx(Hxe,{isOpen:r==="sheerIdRedirectModal",onContinue:()=>{t(),No(U.sheerIdUrl,"sheerIdRedirectModal")},onCancel:t}),r==="upgradeModal"&&l.jsx(gve,{isOpen:r==="upgradeModal",onClose:t}),r==="downgradeModal"&&l.jsx(hve,{isOpen:r==="downgradeModal",onClose:t}),r==="restaurantBookingModal"&&L&&l.jsx(Vxe,{isOpen:r==="restaurantBookingModal",onClose:t,...L}),r==="enterprisePremiumSecureUpgradeModal"&&l.jsx(zxe,{isOpen:r==="enterprisePremiumSecureUpgradeModal",onClose:t,onUpgradeSuccess:O?.onUpgradeSuccess}),r==="taskShortcutModal"&&$&&l.jsx(Wxe,{open:r==="taskShortcutModal",onClose:()=>{t(),$.onClose?.()},onCreated:$.onCreated,source:$.source,shortcut:$.shortcut}),r==="financeAlertModal"&&G&&l.jsx(qxe,{isOpen:r==="financeAlertModal",onClose:()=>{t(),G.onClose?.()},symbol:G.symbol,task:G.task}),r==="scheduledTaskModal"&&H&&l.jsx(Wc,{children:l.jsx(Gxe,{open:r==="scheduledTaskModal",onClose:()=>{t(),H.onClose?.()},onSuccess:H.onSuccess,source:H.source,initial:H.initial,prefill:H.prefill})}),r==="automationModal"&&Q&&l.jsx(Wc,{children:l.jsx($xe,{open:r==="automationModal",onClose:()=>{t(),Q.onClose?.()},source:Q.source,initialConfiguration:Q.initial?Hye({selectedTask:Q.initial}):Q.prefill?Vye(Q.prefill):Q.initialConfiguration||g4(n),onSave:Ke=>{Q.onSuccess?.(Ke),t(),Q.onClose?.()},errorMessage:Q.errorMessage,trackEvent:Ee,canEditSpace:Q.canEditSpace,canDelete:Q.canDelete})}),r==="sharepointSiteModal"&&te&&l.jsx(Kxe,{isOpen:r==="sharepointSiteModal",onClose:t,onSelectSite:te.onSelectSite}),r==="avatarManagementModal"&&se&&l.jsx(pve,{isOpen:r==="avatarManagementModal",onClose:t,config:se??{source:"settings"}}),r==="shoppingTryOnOnboardingModal"&&l.jsx(sve,{isOpen:r==="shoppingTryOnOnboardingModal",onClose:ae?.onClose||t,onSuccessfulOnboarding:ae?.onSuccessfulOnboarding||(()=>{})}),r==="announcementImageModal"&&ee&&l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,isPartnershipCampaign:!0,children:l.jsx(nve,{onClose:t,announcementImageModal:ee})}),r==="fullscreenUpsellModal"&&le&&l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,isPartnershipCampaign:!0,children:l.jsx(rve,{onClose:t,fullscreenUpsellModal:le})}),r==="studentReferrals"&&l.jsx(Fxe,{isOpen:r==="studentReferrals",verificationId:re?.verificationId}),r==="sheerIdModal"&&l.jsx(Bxe,{isOpen:r==="sheerIdModal",onClose:()=>{ce?.onClose?.(),t()},onVerificationSuccess:Ke=>{ce?.onSuccess?.(Ke),t()},type:ce?.type||"student"}),r==="meetingDefaultsModal"&&l.jsx(Rxe,{currentDuration:ue?.currentDuration,currentBuffer:ue?.currentBuffer,onSave:ue?.onSave}),r==="availabilityModal"&&l.jsx(Dxe,{currentAvailability:me?.currentAvailability,onSave:me?.onSave}),r==="mcpServerModal"&&we&&l.jsx(Yxe,{isOpen:r==="mcpServerModal",onClose:t,server:we.server,onSave:we.onSave,onDelete:we.onDelete}),r==="mcpServiceToolsModal"&&ye&&l.jsx(Xxe,{isOpen:r==="mcpServiceToolsModal",onClose:t,server:ye.server,onEditServer:ye.onEditServer,onToggleToolEnabled:ye.onToggleToolEnabled}),r==="memberSetTierModal"&&_e&&l.jsx(Qxe,{isOpen:r==="memberSetTierModal",..._e,onClose:()=>{t(),_e.onClose?.()}}),r==="placeModal"&&ke&&l.jsx(Zxe,{isOpen:r==="placeModal",onClose:t,place:ke.place,mode:ke.mode,entryUUID:ke.entryUUID,contextUUID:ke.contextUUID}),r==="orgInviteModal"&&xe&&(xe.invitationUUID?l.jsx(GR,{invitationUUID:xe.invitationUUID,isNewUser:xe.isNewUser,onClose:t}):l.jsx(GR,{openInviteLinkUUID:xe.openInviteLinkUUID,isNewUser:xe.isNewUser,onClose:t}))]})});mz.displayName="SingleModal";function Wt(){const{status:e}=Ne(),t=e==="authenticated";return d.useEffect(()=>{t&&_fe()},[t]),t}const pz=()=>{const e=d.useCallback(r=>{F2e(r)},[]),t=mr(f3),n=d.useCallback(()=>$p(f3),[]);return d.useMemo(()=>({lossAversionStatus:t,setLossAversionStatus:e,unsetLossAversion:n}),[t,e,n])},xve=()=>{const{lossAversionStatus:e,setLossAversionStatus:t}=pz(),n=On(),r=Wt(),s=d.useMemo(()=>!r&&e==="allowed"&&n?.startsWith("/search"),[r,e,n]),{openModal:o}=pn().legacy,a=d.useCallback(({args:i,openModalOverride:c})=>{c?c("lossAversionModal",i):o("lossAversionModal",i),t("cooldown")},[o,t]);return d.useMemo(()=>({shouldShowLossAversionModal:s,handleOpenLossAversion:a}),[s,a])},vve=Ce(async()=>{const{KeyboardShortcutHelperModal:e}=await Se(()=>q(()=>import("./KeyboardShortcutHelperModal-DNkbHnqh.js"),__vite__mapDeps([120,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),bve=Ce(async()=>{const{KeyboardShortcutEditorModal:e}=await Se(()=>q(()=>import("./KeyboardShortcutEditorModal-D82pYLUS.js"),__vite__mapDeps([121,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),_ve=({children:e})=>{const[t,n]=d.useState([]),r=d.useMemo(()=>t.at(-1)?.modalName??null,[t]),{session:s}=Ne(),{trackEvent:o}=Xe(s),{device:{isMacOS:a,isWindowsApp:i}}=sn(),{shouldShowLossAversionModal:c,handleOpenLossAversion:u}=xve(),f=Rn(),{openModal:m}=Uo(),p=d.useCallback((b,_)=>{n(()=>[{modalName:b,arg:_}])},[]),h=d.useCallback((b,_)=>{n(w=>[...w,{modalName:b,arg:_}])},[]),g=d.useCallback((b,_)=>{n(w=>{const S=w.findLastIndex(C=>C.modalName==b);if(S!=-1){const C=w.slice();return C[S]={modalName:b,arg:_},C}else return w})},[]),y=d.useCallback(()=>{n(b=>b.slice(0,b.length-1))},[]),x=d.useMemo(()=>({currentOpenModals:t,currentOpenedModal:r,openModal:p,openStackedModal:h,updateModal:g,closeModal:y}),[t,p,h,g,y,r]),v=d.useCallback(b=>{if(a?b.metaKey&&b.key==="k":b.ctrlKey&&b.key==="i")b.preventDefault(),c?u({args:{origin:ft.NEW_THREAD_SHORTCUT,callback:()=>{o("quick ask keyboard shortcut",{}),f.push("/",void 0,"Quick ask keyboard shortcut (loss aversion)")}},openModalOverride:p}):(o("quick ask keyboard shortcut",{}),f.push("/",void 0,"Quick ask keyboard shortcut"));else if(a?b.metaKey&&b.key==="/":b.ctrlKey&&b.key==="/")b.preventDefault(),i?m(bve,{legacyIdentifier:"keyboardShortcutEditorModal"}):m(vve,{legacyIdentifier:"keyboardShortcutHelperModal"});else if(i&&b.ctrlKey&&b.key==="d"){b.preventDefault();const _=new CustomEvent("toggleDictation");document.dispatchEvent(_)}},[a,i,c,u,p,m,o,f]);return d.useEffect(()=>(document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}),[v]),l.jsxs(lz.Provider,{value:x,children:[e,l.jsx(dz,{})]})};function wve(){return null}async function Cve(){const e=Ga();if("serviceWorker"in navigator){const{Workbox:t}=await q(async()=>{const{Workbox:s}=await import("./workbox-window.prod.es5-CwtvwXb3.js");return{Workbox:s}},[]),n=new URL("/service-worker.js",window.location.origin);e.version&&n.searchParams.set("v",e.version);const r=new t(n.toString());try{await r.register()}catch(s){Z.error("Error registering service worker",s)}}}async function Sve(){"serviceWorker"in navigator&&await navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister())))}const hz=A.memo(function(){return d.useEffect(()=>{const t=Ga();t.env&&t.env!=="local"?Cve():Sve()},[]),null});hz.displayName="ServiceWorker";const Eve=async({file:e,fileSource:t="default",forceImage:n=!1,reason:r})=>{const s=await de.POST("/rest/uploads/create_upload_url",r,{body:{filename:e.name,content_type:e.type,source:t,file_size:e.size,force_image:n},timeoutMs:Cn.MEDIUM,retries:2});return s.data?s.data:null},kve=async({filesWithUuids:e,fileSource:t="default",forceImage:n=!1,reason:r})=>{const s={};e.forEach(({uuid:a,file:i})=>{s[a]={filename:i.name,content_type:i.type,source:t,file_size:i.size,force_image:n}});const o=await de.POST("/rest/uploads/batch_create_upload_urls",r,{body:{files:s},timeoutMs:Cn.MEDIUM,retries:2});return o.data?o.data.results:null},Mve=async({remote_file_id:e,connection_type:t,source:n,reason:r})=>{const s=await de.POST("/rest/connectors/attachments/upload",r,{body:{remote_file_id:e,connection_type:t,source:n??"default"},timeoutMs:Cn.VERY_HIGH,retries:2});return s.data?s.data:null};async function Tve({request:e,reason:t}){return new Promise((n,r)=>{de.SSE("/rest/sse/attachment_processing/subscribe",t,{params:e,handlers:{message:s=>{n(s)}}}).catch(r)})}const Zo=e=>{try{return JSON.parse(e)}catch{return{}}};function Ave({reason:e}){const t=An(),n=un(),r=d.useCallback(async(s,o,a)=>{if(Z.info("browserStep",s),s.browser_open_tab_content){const i=s.browser_open_tab_content,c=Zo(i.extra_headers);Z.info("browserTool: browser_open_tab",{tool:i},{request_id:c[yn]}),await ehe({url:i.url,cometBrowser:n,stepUuid:s.uuid,extraHeaders:Zo(i.extra_headers),reason:e})}else if(s.search_browser_content){const i=s.search_browser_content,c=Zo(i.extra_headers);Z.info("browserTool: search_browser",{tool:i},{request_id:c[yn]}),await rhe(i,n,s.uuid,c,e)}else if(s.browser_close_tabs_content){const i=s.browser_close_tabs_content,c=i.payload;if(!c){Z.error("[useExecuteBrowserTool] browser_close_tabs_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const u=Zo(i.extra_headers);Z.info("browserTool: browser_close_tabs",{tool:i},{request_id:u[yn]}),await nhe(c,n,s.uuid,u,e)}else if(s.browser_group_tabs_content){const i=s.browser_group_tabs_content,c=i.payloads,u=Zo(i.extra_headers);Z.info("browserTool: browser_group_tabs",{tool:i},{request_id:u[yn]}),await the(c,n,s.uuid,u,e)}else if(s.entropy_request_content){const i=s.entropy_request_content,c=i.extra_headers,u=Zo(c)[yn];Z.info("browserTool: entropy_request",{tool:i},{request_id:u}),i.tasks.forEach(f=>{Z.info("[comet] Submitting agent task",{task_id:f.uuid,entry_uuid:o,request_id:u}),n.submitTask({action:"startAgentFromPerplexity",type:"START_AGENT",extra_headers:c,base_url:i.base_url,entryId:o,...f,use_current_page:f.use_current_page&&!0,capture_screenshot:!f.use_current_page&&!f.tab_id,is_mission_control:window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants")||i.is_mission_control,thread_url_slug:a})})}else if(s.get_url_content_content){const i=s.get_url_content_content,c=Zo(i.extra_headers);if(Z.info("browserTool: get_url_content",{tool:i},{request_id:c[yn]}),!t)return;const u={...i,key:s.uuid,request_id:c[yn],pages:[...i.pages||[]]},f=n.GetContent(u);await Ti(f,s.uuid,{request_id:c[yn]??""},e)}else if(s.browser_ungroup_content){const i=s.browser_ungroup_content;if(!i.payload){Z.error("[useExecuteBrowserTool] browser_ungroup_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const c={groupIds:i.payload.group_ids,tabIds:i.payload.tab_ids},u=Zo(i.extra_headers),f=n.ungroupTabs(c,s.uuid,u[yn]??"").then(m=>{if(!m.is_success)throw m;return{group_ids:m.groupIds,tab_ids:m.tabIds}});await Ti(f,s.uuid,{request_id:u[yn]??""},e)}else if(s.browser_search_tab_groups_content){const i=s.browser_search_tab_groups_content,c=i.payload;if(!c){Z.error("[useExecuteBrowserTool] browser_search_tab_groups_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const u=Zo(i.extra_headers),f=n.searchTabGroups(c,s.uuid,u[yn]??"").then(m=>{if(!m.is_success)throw m;return{results:m.results.map(p=>({...p,color:sV(p.color)}))}});await Ti(f,s.uuid,{request_id:u[yn]??""},e)}else if(s.browser_get_visible_tab_screenshot_content){const i=s.browser_get_visible_tab_screenshot_content,c=Zo(i.extra_headers),u=n.GetVisibleTabScreenshot({key:s.uuid,request_id:c[yn]??"",...i}).then(async f=>{const p=await(await fetch(f.data_url)).blob(),h=new File([p],"screenshot."+(i.format??"png"),{type:p.type}),g=await Eve({file:h,forceImage:!0,reason:e,fileSource:"entropy"});if(!g||!g?.fields||!g.s3_bucket_url)throw new Error("Failed to create upload URL");const y=new FormData;Object.entries(g.fields).forEach(([b,_])=>{y.append(b,_)}),y.append("file",h);const x=await fetch(g.s3_bucket_url,{method:"POST",body:y});if(!x.ok)throw new Error(`Failed to upload screenshot: ${x.statusText}`);const v=await x.json();if(!v.secure_url)throw Z.error("[GetVisibleTabScreenshot] Upload did not return a secure URL",{response:v}),new Error("Upload did not return a secure URL");return{screenshot_url:v.secure_url}});await Ti(u,s.uuid,{request_id:c[yn]??""},e)}else if(s.browser_get_cookies_content){const i=s.browser_get_cookies_content,c=Zo(i.extra_headers);Z.info("browserTool: browser_get_cookies",{tool:i},{request_id:c[yn]}),await Ti(n.getCookies(),s.uuid,{request_id:c[yn]??""},e)}else Z.error("[useExecuteBrowserTool] Unknown browser tool step",{browserStep:s},{reason:e,backend_uuid:o})},[n,t,e]);return d.useMemo(()=>({executeBrowserTool:r}),[r])}const gz=A.memo(function(){const{executeBrowserTool:t}=Ave({reason:"StreamMiddlewares"}),n=d.useCallback((s,o)=>{if(!s||!s.browser_tool)return s;t(s.browser_tool,s.backend_uuid,o)},[t]),r=d.useMemo(()=>[n],[n]);return l.jsx(_H,{middlewares:r})});gz.displayName="StreamMiddlewares";const Nve=10,N4=Nve,yz=N4*10,Rve=yz*10+N4,zd="all_results",Dve=({slugOrUUID:e,enabled:t,isSidecar:n,reason:r})=>{const s=Yt(),o=d.useCallback(async(a,i,c=[])=>{const u=await kge({slugOrUUID:a,options:{withParentInfo:!0,supportedBlockUseCases:[...kV],limit:i?yz:N4,fromFirst:!0,cursor:i},numRetries:$l,reason:r});if(!u?.entries?.length||u.status!=="success")return c;const f=be.makeQueryKey(zd,a),m=u.entries;return c.push(...m),s.setQueryData(f,p=>{const h=new Map,g=y=>h.set(y.backend_uuid,y);return p?.forEach(g),m.forEach(g),Array.from(h.values())}),u.next_cursor&&c.length!!(i instanceof he&&i.status===403&&n&&a<2),queryFn:async()=>await o(e,null,[])})},R4=()=>{const e=Yt();return d.useCallback((t,n)=>{!n&&!t||[be.makeQueryKey(zd,t?.thread_url_slug||n?.at(0)?.thread_url_slug||""),be.makeQueryKey(zd,t?.backend_uuid||n?.at(0)?.backend_uuid||"")].forEach(r=>{if(be.unmakeQueryKey(r).at(-1)){if(t){const s=e.getQueryData(r)??[],o=n?.some(i=>i.backend_uuid===t?.backend_uuid),a=s.findIndex(i=>i.backend_uuid===t?.backend_uuid);if(a!==-1){const i=[...s];i[a]=t,e.setQueryData(r,i);return}else if(o&&a===-1){const i=[...s,t];e.setQueryData(r,i);return}}if(n&&!t){const s=[...n];e.setQueryData(r,s);return}e.invalidateQueries({queryKey:r})}})},[e])},xz=()=>{const e=Yt();return d.useCallback(t=>{t?e.getQueriesData({queryKey:be.makeQueryKey(zd),exact:!1})?.forEach(([n,r])=>{if(!r)return;const s=r.filter(o=>o.backend_uuid!==t&&o.thread_url_slug!==t);s.length!==r.length&&(s.length?e.setQueryData(n,s):e.removeQueries({queryKey:n,exact:!0}))}):e.removeQueries({queryKey:be.makeQueryKey(zd),exact:!1})},[e])},jve=({windowsAppOnly:e=!0}={})=>{const[t,n]=d.useState(()=>globalThis.Notification?globalThis.Notification.permission:"denied"),{device:{isWindowsApp:r}}=sn();d.useEffect(()=>{globalThis.Notification&&globalThis.Notification.permission!==t&&n(globalThis.Notification.permission)},[t]);const s=d.useCallback(async()=>{if(globalThis.Notification){if(t==="granted")return!0;if(t==="denied")return!1;const a=await globalThis.Notification.requestPermission();return n(a),a==="granted"}return!1},[t]),o=d.useCallback(async({title:a,body:i,icon:c="https://r2cdn.perplexity.ai/pplx-desktop-icon.png",onClick:u})=>{if(!(e&&!r||!await s())&&globalThis.Notification){const m=new globalThis.Notification(a,{body:i,icon:c});u&&(m.onclick=()=>{u(),window.focus()})}},[e,r,s]);return d.useMemo(()=>({sendNotification:o,requestPermission:s,permission:t,isWindowsApp:r}),[r,t,s,o])};function Ive(){const e=Yt();return d.useCallback(()=>{e.invalidateQueries({queryKey:Zy()})},[e])}const Pve=(e,t)=>{const{value:n,loading:r}=kf({flag:"sapi-ranking-navigate",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Ove=async({query:e,userIdentity:t,queryClient:n,reason:r,sapiSearchNavigateConfig:s})=>{try{const o=s?[`sapi-ranking-navigate-cfg=${JSON.stringify(s)}`]:[],c=(await(await wfe({resource:"https://suggest.perplexity.ai/search/v2/navigate",method:"POST",options:{headers:{"content-type":"application/json","X-Client-Name":"agi_ui_navigate_v2","X-Client-Env":"production"}},body:JSON.stringify({query:e,user_identity:{lang:t.lang,country:t.country,ab_active_tests:o}}),timeoutMs:1e3,reason:r})).json())?.hit;c&&n.setQueryData($H(e),c)}catch(o){Z.error("Failed to fetch navigational search results:",o)}},Lve=35,Fve=()=>{const e=Yt(),t=Ox(),{variation:n,loading:r}=Pve({});return d.useCallback(({query:s,params:o,reason:a})=>{const i=s.length<=Lve,c=!!o.last_backend_uuid,u=o.attachments,f=o.sources,m=o.model_preference==="pplx_study";if(i&&!c&&u.length===0&&f&&f.length>0&&!m){const h={lang:o.language,country:t};Ove({query:s,userIdentity:h,queryClient:e,reason:a,sapiSearchNavigateConfig:r?void 0:n})}},[e,t,n,r])};var Rs;(function(e){e.EXPOSURE="sbs exposure",e.JUDGMENT="sbs judgment",e.BANNER="sbs banner"})(Rs||(Rs={}));const Jy=-1,Bve="sbs_analytics_",Uve=e=>{const t=e?.experiment_override;return t?JSON.stringify(t):""},Vve=(e,t)=>{const n=e.side_by_side_metadata;return{displayPosition:t,experimentRole:n?.experiment_role||`entry_${t}`,entryUUID:e.backend_uuid,experimentOverride:Uve(n)}},vz=(e,t)=>`${Bve}${e}_${t}`,A_=(e,t)=>{try{const n=vz(e,t);return vt.getItem(n)==="true"}catch(n){return Z.error("Error checking localStorage for SBS event:",n),!1}},N_=(e,t)=>{try{const n=vz(e,t);vt.setItem(n,"true")}catch(n){Z.error("Error setting localStorage for SBS event:",n)}},Hve=({results:e,session:t,trackEvent:n})=>{const r=d.useCallback(()=>{if(!e[0])return null;const c=e[0].side_by_side_metadata;if(!c?.sibling_uuid)return null;const u=c.experiment_override,f=u&&Object.keys(u)[0]||"";return{evaluationUUID:c.sibling_uuid,experimentVariationKey:f,evaluatorID:t?.user?.id||t?.user?.email||"anonymous"}},[e,t?.user?.id,t?.user?.email]),s=d.useCallback(c=>{try{const u=r();if(!u)return null;let f,m;if(c===Jy)f=Jy,m=void 0;else if(f=c,f>=0&&f{h.backend_uuid&&h.side_by_side_metadata?.execution_log&&(p[h.backend_uuid]=h.side_by_side_metadata.execution_log)}),{eventType:Rs.JUDGMENT,timestampMs:Date.now(),eventData:{evaluationUUID:u.evaluationUUID,evaluatorID:u.evaluatorID,experimentVariationKey:u.experimentVariationKey,experimentRoles:e.map(h=>h.side_by_side_metadata?.experiment_role||`entry_${e.indexOf(h)}`),preferredPosition:f,entryUUID:m,executionLogs:p}}}catch(u){return Z.error("Failed to build SBS judgment payload:",u),null}},[r,e]),o=d.useCallback(c=>{try{const u=r();if(!u||A_(u.evaluationUUID,Rs.JUDGMENT))return;const f=s(c);f&&(n(Rs.JUDGMENT,f),N_(u.evaluationUUID,Rs.JUDGMENT))}catch(u){Z.error("Failed to track SBS judgment:",u)}},[r,s,n]),a=d.useCallback(()=>{try{const c=r();if(!c||A_(c.evaluationUUID,Rs.BANNER))return;const u={eventType:Rs.BANNER,timestampMs:Date.now(),eventData:{evaluationUUID:c.evaluationUUID,evaluatorID:c.evaluatorID,experimentVariationKey:c.experimentVariationKey,experimentRoles:e.map(f=>f.side_by_side_metadata?.experiment_role||`entry_${e.indexOf(f)}`)}};n(Rs.BANNER,u),N_(c.evaluationUUID,Rs.BANNER)}catch(c){Z.error("Failed to track SBS banner exposure:",c)}},[r,e,n]),i=d.useCallback(()=>{try{const c=r();if(!c||A_(c.evaluationUUID,Rs.EXPOSURE))return;const u={eventType:Rs.EXPOSURE,timestampMs:Date.now(),eventData:{evaluationUUID:c.evaluationUUID,evaluatorID:c.evaluatorID,experimentVariationKey:c.experimentVariationKey,entries:e.map(Vve)}};n(Rs.EXPOSURE,u),N_(c.evaluationUUID,Rs.EXPOSURE)}catch(c){Z.error("Failed to track SBS exposure:",c)}},[r,e,n]);return d.useMemo(()=>({trackJudgment:o,trackBannerExposure:a,trackSBSExposure:i}),[o,a,i])},zve=({enabled:e,reason:t})=>{const{locale:n}=J(),r=n?{"accept-language":n}:{},s=async()=>E2e({headers:r,reason:t}),o=Wt(),{data:a}=mt({enabled:o?typeof e>"u"?!0:e:!1,queryKey:$ye(),queryFn:s});return a??QH},Wve=e=>e?.context_uuid??void 0,Gve=e=>e?.frontend_context_uuid??void 0,$ve=e=>e?.thread_title??"",qve=e=>e?.query_str??void 0,Kve=e=>e?.search_focus??void 0,Yve=e=>e.sources?.sources??void 0,Qve=e=>e?.author_id??void 0,Xve=e=>e?.author_username??void 0,Zve=e=>e?.author_image??void 0,Jve=e=>{if(e.parent_info)return e.parent_info},ebe=e=>e?.mode??null,tbe=e=>e?.personalized??void 0,nbe=e=>e?.collection_info??void 0,rbe=e=>e?.bookmark_state??void 0,sbe=e=>e?.thread_access??void 0,obe=e=>e?.thread_url_slug??void 0,abe=e=>e?.updated_datetime??void 0,ibe=e=>e?.expiry_time??null,lbe=e=>e?.privacy_state??void 0,g3=e=>({forkCount:e?.fork_count??0,likeCount:e?.like_count??0,viewCount:e?.view_count??0,userLikes:e?.user_likes??!1}),cbe={},R_=e=>e?{author_id:Qve(e),author_image:Zve(e),author_username:Xve(e),bookmarkState:rbe(e),collection:nbe(e),contextUUID:Wve(e),expiry_time:ibe(e)??void 0,first_query:qve(e),focus:Kve(e),frontendContextUUID:Gve(e),mode:ebe(e)??void 0,parent_info:Jve(e)??void 0,personalized:tbe(e)??void 0,privacy_state:lbe(e)??void 0,rwToken:e.read_write_token,sources:Yve(e)??void 0,text_completed:!1,thread_access:sbe(e)??void 0,thread_url_slug:obe(e),title:$ve(e),updated_datetime:abe(e)}:cbe;function ube({entries:e,threads:t,streams:n,currentStreamId:r,currentThreadId:s}){const o=r?n[r]:void 0,a=o?.threadId??s;if(a){const i=t.find(c=>c.id===a);if(i){const c=i.entryIds.map(u=>e[u]).filter(u=>u!=null);return o?.placeholderChunk&&!o.entryId&&c.push(o.placeholderChunk),c}}return o?.placeholderChunk?[o.placeholderChunk]:[]}const rg=Ft("ResultsContext",null),dbe=({children:e})=>{const t=Hs(),[n,r]=d.useState(),[s,o]=d.useState(),a=d.useCallback(p=>{if(r(p),p){const{streams:h}=t.getState(),g=Object.values(h).find(y=>y.threadId===p);o(g?.id.description)}},[t]),i=d.useCallback(p=>{if(o(p),p){const h=t.getState().streams[p];h?.threadId&&r(h.threadId)}},[t]),c=d.useMemo(()=>({setCurrentThreadId:a,setCurrentStreamId:i,clear:()=>{a(void 0),i(void 0)}}),[a,i]),u=d.useCallback(p=>{const h=ube({entries:p.entries,threads:p.threads,streams:p.streams,currentStreamId:s,currentThreadId:n}),g=Zfe(h),y=Jfe(h),x=h.find(v=>qt.isStatusPending(v));return{results:h,firstResult:g,lastResult:y,inFlightEntry:x,inFlight:!!x,inFlightLatest:h.length>0&&y!==void 0&&qt.isStatusPending(y),socialStats:g3(g?.social_info),resultsLength:h.length}},[n,s]),f=s0e(t,u),m=d.useMemo(()=>({...f,actions:c,currentThreadId:n,currentStreamId:s}),[n,s,f,c]);return l.jsx(rg.Provider,{value:m,children:e})};function on(){const e=d.useContext(rg);if(!e)throw new Error("useResults must be used within a ResultsProvider");return e.useProxy()}function D4(e){const t=d.useContext(rg);if(!t)throw new Error("useResultsSelector must be used within a ResultsProvider");return t.useSelector(e)}function Vx(){const e=d.useContext(rg);if(!e)throw new Error("useResultsActions must be used within a ResultsProvider");return e.actions}const j4=()=>{const e=d.useContext(rg),t=n1e(),n=R4();return d.useCallback(r=>t(e?.currentThreadId,s=>{const o=r(s);if(o)return n(void 0,o),o}),[t,e?.currentThreadId,n])},bz=()=>{const e=t1e(),t=R4();return d.useCallback((n,r)=>{e(n,s=>{const o=r(s);if(o)return t(o,void 0),o})},[e,t])},fbe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"enable-gemini-3-flash-web",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Nr={[oe.SEARCH]:He({askInputPlaceholder:{defaultMessage:"Ask anything…",id:"AUouhaZgFv"},name:{defaultMessage:"Search",id:"xmcVZ0BU63"},description:{defaultMessage:"Fast answers to everyday questions",id:"5Y9Hg4e+zB"}}),[oe.RESEARCH]:He({askInputPlaceholder:{defaultMessage:"Research anything…",id:"PITzDLgm5P"},name:{defaultMessage:"Research",id:"JEe7dVso7F"},description:{defaultMessage:"Deep research on any topic",id:"uH6f+eH2OS"}}),[oe.STUDIO]:He({askInputPlaceholder:{defaultMessage:"Create anything…",id:"pmtrj6Tjm9"},name:{defaultMessage:"Labs",id:"ylFNoY79wa"},description:{defaultMessage:"Create projects from scratch",id:"nH9rAkplC/"}}),[oe.STUDY]:He({askInputPlaceholder:{defaultMessage:"Study anything…",id:"UOEDdZ+cnD"},name:{defaultMessage:"Learn",id:"IbrSk1x1M4"},description:{defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"}})},$n={[ie.DEFAULT]:He({name:{defaultMessage:"Best",id:"PzlMqGwwkm"},description:{defaultMessage:"Adapts to each query",id:"SsTMNu/s/A"}}),[ie.PRO]:He({name:{defaultMessage:"Best",id:"PzlMqGwwkm"},description:{defaultMessage:"Automatically selects the best model based on the query",id:"3ZgFQznYO0"}}),[ie.PPLX_PRO_UPGRADED]:He({name:{defaultMessage:"Pro",id:"R/eOkjWqNU"},description:{defaultMessage:"Automatically selects the most responsive model based on the query",id:"DuOz+H05Us"}}),[ie.SONAR]:He({name:{defaultMessage:"Sonar",id:"sT9VX563o6"},description:{defaultMessage:"Perplexity's fast model",id:"pdbURewz6Q"}}),[ie.GPT_4o]:He({name:{defaultMessage:"GPT-4o",id:"nebbHBgxX/"},description:{defaultMessage:"OpenAI's versatile model",id:"zdAw82CyOA"}}),[ie.GPT_4_1]:He({name:{defaultMessage:"GPT-4.1",id:"+LPr/f6Fal"},description:{defaultMessage:"OpenAI's advanced model",id:"+uCLZVt7uh"}}),[nt.GPT_5]:He({name:{defaultMessage:"GPT-5",id:"VfhmdGpVc7"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[ie.GPT_5_1]:He({name:{defaultMessage:"GPT-5.1",id:"uOMpo0agAL"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[nt.GPT_5_THINKING]:He({name:{defaultMessage:"GPT-5 Thinking",id:"/IA3KV+qFr"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[ie.GPT_5_1_THINKING]:He({name:{defaultMessage:"GPT-5.1 Thinking",id:"74//SO976H"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[nt.GPT5_PRO]:He({name:{defaultMessage:"GPT-5 Pro",id:"GwvubEn/BR"},description:{defaultMessage:"OpenAI's latest, most powerful reasoning model",id:"3Z57hOWKDd"}}),[ie.GPT_5_2]:He({name:{defaultMessage:"GPT-5.2",id:"X26Ei/S8vd"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[ie.GPT_5_2_THINKING]:He({name:{defaultMessage:"GPT-5.2 Thinking",id:"9NodtkoSox"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[ie.CLAUDE_2]:He({name:{defaultMessage:"Claude Sonnet 4.0",id:"4UrgPEhdwq"},description:{defaultMessage:"Anthropic's advanced model",id:"b5CqfvLw4b"}}),[ie.GEMINI_2_5_PRO]:He({name:{defaultMessage:"Gemini 2.5 Pro",id:"hec4NYL1Ib"},description:{defaultMessage:"Google's latest model",id:"XBL8FigIeX"}}),[ie.GEMINI_3_0_PRO]:He({name:{defaultMessage:"Gemini 3 Pro",id:"UK0QXlryM2"},description:{defaultMessage:"Google's advanced reasoning model",id:"V15f6f4scw"}}),[ie.GEMINI_3_0_FLASH]:He({name:{defaultMessage:"Gemini 3 Flash",id:"wBxtNZNdaJ"},description:{defaultMessage:"Google's fast reasoning model",id:"SaPbtF8tK+"}}),[ie.GEMINI_3_0_FLASH_HIGH]:He({name:{defaultMessage:"Gemini 3 Flash Thinking",id:"WGU4v3vcgP"},description:{defaultMessage:"Google's fast reasoning model with enhanced thinking",id:"dpD7Tlrlld"}}),[ie.GROK]:He({name:{defaultMessage:"Grok 3 Beta",id:"Ybq0GDRm0J"},description:{defaultMessage:"xAI's Grok 3 model",id:"gwIHPQy1c/"}}),[ie.PPLX_REASONING]:He({name:{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"},description:{defaultMessage:"Advanced problem solving",id:"4J0akc6m53"}}),[ie.CLAUDE_3_7_SONNET_THINKING]:He({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[ie.CLAUDE_4_0_OPUS]:He({name:{defaultMessage:"Claude Opus 4.0",id:"fwViXd5wrs"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_0_OPUS_THINKING]:He({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_1_OPUS]:He({name:{defaultMessage:"Claude Opus 4.1",id:"aq+8T//8S9"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_1_OPUS_THINKING]:He({name:{defaultMessage:"Claude Opus 4.1 Thinking",id:"Vd2LxNSW/4"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_5_OPUS]:He({name:{defaultMessage:"Claude Opus 4.5",id:"c8oGQdxIXE"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_5_OPUS_THINKING]:He({name:{defaultMessage:"Claude Opus 4.5 Thinking",id:"oBSH9hOxZC"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_5_SONNET]:He({name:{defaultMessage:"Claude Sonnet 4.5",id:"TreRV15OSF"},description:{defaultMessage:"Anthropic's newest advanced model",id:"yVLNWskqHe"}}),[ie.CLAUDE_4_5_SONNET_THINKING]:He({name:{defaultMessage:"Claude Sonnet 4.5 Thinking",id:"POJuSUD1gU"},description:{defaultMessage:"Anthropic's newest reasoning model",id:"MIjO2w9Cui"}}),[ie.KIMI_K2_THINKING]:He({name:{defaultMessage:"Kimi K2 Thinking",id:"IIsFX2aoN0"},description:{defaultMessage:"Moonshot AI's latest reasoning model",id:"KFOkH3dSUa"}}),[ie.GROK_4]:He({name:{defaultMessage:"Grok 4",id:"+Y775fAOqr"},description:{defaultMessage:"xAI's reasoning model",id:"tYRPjba3cL"}}),[ie.GROK_4_NON_THINKING]:He({name:{defaultMessage:"Grok 4",id:"+Y775fAOqr"},description:{defaultMessage:"xAI's advanced model",id:"av1iNKEP7e"}}),[ie.GROK_4_1_REASONING]:He({name:{defaultMessage:"Grok 4.1",id:"gWMQFuyUxZ"},description:{defaultMessage:"xAI's latest reasoning model",id:"BVUpDXsBWU"}}),[ie.GROK_4_1_NON_REASONING]:He({name:{defaultMessage:"Grok 4.1",id:"gWMQFuyUxZ"},description:{defaultMessage:"xAI's latest advanced model",id:"+gMdtUmDTB"}}),[nt.O3_PRO]:He({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's powerful reasoning model",id:"BodLv+J6l0"}}),[ie.O4_MINI]:He({name:{defaultMessage:"o4-mini",id:"BwwjXFHgz7"},description:{defaultMessage:"OpenAI's latest reasoning model",id:"VKonAfIZbf"}}),[ie.PPLX_SONAR_INTERNAL_TESTING]:He({name:{defaultMessage:"Sonar Testing - Alpha",id:"2oa4bWRfNL"},description:{defaultMessage:"Sonar model alpha variant",id:"EvwN/e7vAD"}}),[ie.PPLX_SONAR_INTERNAL_TESTING_V2]:He({name:{defaultMessage:"Sonar Testing - Beta",id:"VNsK+ZGei/"},description:{defaultMessage:"Sonar model beta variant",id:"Dzfl36DNyM"}}),[ie.ALPHA]:He({name:{defaultMessage:"Research",id:"JEe7dVso7F"},description:{defaultMessage:"Fast and thorough for routine research",id:"v/MuahlVJE"}}),[ie.BETA]:He({name:{defaultMessage:"Labs",id:"ylFNoY79wa"},description:{defaultMessage:"Multi-step tasks with advanced troubleshooting",id:"Sf0AeuilA5"}}),[ie.STUDY]:He({name:{defaultMessage:"Study",id:"UTFsoN8Z1P"},description:{defaultMessage:"Fast model for routine research",id:"prWIV9FsWt"}}),[nt.O3_MINI]:He({name:{defaultMessage:"o3-mini",id:"GdJwPgWWId"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.GROK2]:He({name:{defaultMessage:"Grok-2",id:"9X3jPx+0vk"},description:{defaultMessage:"xAI's latest model",id:"e2CghRZC7d"}}),[nt.GPT_4]:He({name:{defaultMessage:"GPT-4",id:"6TGiMlP7f4"},description:{defaultMessage:"OpenAI's previous generation model",id:"U3OQoJ211e"}}),[nt.CLAUDE_3_OPUS]:He({name:{defaultMessage:"Claude 3 Opus",id:"gLSCHWGsu1"},description:{defaultMessage:"Anthropic's previous generation model",id:"hAevdn8yGl"}}),[nt.CLAUDE_3_5_HAIKU]:He({name:{defaultMessage:"Claude 3.5 Haiku",id:"zEJWYa05R2"},description:{defaultMessage:"Anthropic's smaller model",id:"pQia6E7J8i"}}),[nt.GEMINI]:He({name:{defaultMessage:"Gemini",id:"XoqZkcqFZ/"},description:{defaultMessage:"Previous version of Google's Gemini model",id:"9C0LtRWLFh"}}),[nt.LLAMA_X_LARGE]:He({name:{defaultMessage:"Llama X Large",id:"2zxgnSWUyX"},description:{defaultMessage:"Meta's large Llama model",id:"+95UnVOxgQ"}}),[nt.MISTRAL]:He({name:{defaultMessage:"Mistral",id:"dUBSpMbbs4"},description:{defaultMessage:"Mistral AI model",id:"rYRyt8I2Zr"}}),[nt.COPILOT]:He({name:{defaultMessage:"Copilot",id:"b3QbnXgawD"},description:{defaultMessage:"Legacy Pro Search",id:"pg83InaW1o"}}),[nt.CLAUDE_OMBRE_EAP]:He({name:{defaultMessage:"Claude Ombre",id:"F12IlTx8R1"},description:{defaultMessage:"Anthropic's research preview",id:"LKt7UBXwdw"}}),[nt.CLAUDE_LACE_EAP]:He({name:{defaultMessage:"Claude Lace",id:"8ydOdGYWef"},description:{defaultMessage:"Anthropic's opus research preview",id:"GHW8xWfe9i"}}),[nt.R1]:He({name:{defaultMessage:"R1 1776",id:"e8N3MYqmIQ"},description:{defaultMessage:"Perplexity's unbiased reasoning model",id:"R5Tg1hC1um"}}),[nt.GAMMA]:He({name:{defaultMessage:"Gamma",id:"Wb9IyuuCJO"},description:{defaultMessage:"Fast model for routine research",id:"prWIV9FsWt"}}),[nt.O3]:He({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.GEMINI_2_FLASH]:He({name:{defaultMessage:"Gemini 2.5 Pro",id:"hec4NYL1Ib"},description:{defaultMessage:"Google's latest model",id:"XBL8FigIeX"}}),[nt.TESTING_MODEL_C]:He({name:{defaultMessage:"Testing Model C",id:"sgSu9ApFvP"},description:{defaultMessage:"Debug model for testing",id:"AG6p6ERvyn"}}),[nt.O3_RESEARCH]:He({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.O3_PRO_RESEARCH]:He({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's most powerful reasoning model",id:"1ntkiZj5rM"}}),[nt.CLAUDE40SONNET_RESEARCH]:He({name:{defaultMessage:"Claude Sonnet 4.0",id:"4UrgPEhdwq"},description:{defaultMessage:"Anthropic's advanced model",id:"b5CqfvLw4b"}}),[nt.CLAUDE40SONNETTHINKING_RESEARCH]:He({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[nt.CLAUDE40OPUS_RESEARCH]:He({name:{defaultMessage:"Claude Opus 4.0",id:"fwViXd5wrs"},description:{defaultMessage:"Anthropic's most advanced model",id:"4l6C+Dcw8g"}}),[nt.CLAUDE40OPUSTHINKING_RESEARCH]:He({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's advanced reasoning model",id:"RwUx0WhdZb"}}),[nt.O3_LABS]:He({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.O3_PRO_LABS]:He({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's most powerful reasoning model",id:"1ntkiZj5rM"}}),[nt.CLAUDE40SONNETTHINKING_LABS]:He({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[nt.CLAUDE40OPUSTHINKING_LABS]:He({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's advanced reasoning model",id:"RwUx0WhdZb"}})},mbe={label:$n[ie.GEMINI_3_0_FLASH].name,description:$n[ie.GEMINI_3_0_FLASH].description,nonReasoningModel:ie.GEMINI_3_0_FLASH,reasoningModel:ie.GEMINI_3_0_FLASH_HIGH,hasNewTag:!0,subscriptionTier:Jn.PRO},$R=[{label:$n[ie.SONAR].name,description:$n[ie.SONAR].description,nonReasoningModel:ie.SONAR,reasoningModel:null,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.GPT_5_2].name,description:$n[ie.GPT_5_2].description,nonReasoningModel:ie.GPT_5_2,reasoningModel:ie.GPT_5_2_THINKING,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.CLAUDE_4_5_OPUS].name,description:$n[ie.CLAUDE_4_5_OPUS].description,nonReasoningModel:ie.CLAUDE_4_5_OPUS,reasoningModel:ie.CLAUDE_4_5_OPUS_THINKING,hasNewTag:!1,subscriptionTier:Jn.MAX},{label:$n[ie.GEMINI_3_0_PRO].name,description:$n[ie.GEMINI_3_0_PRO].description,nonReasoningModel:null,reasoningModel:ie.GEMINI_3_0_PRO,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.GROK_4_1_NON_REASONING].name,description:$n[ie.GROK_4_1_NON_REASONING].description,nonReasoningModel:ie.GROK_4_1_NON_REASONING,reasoningModel:ie.GROK_4_1_REASONING,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.KIMI_K2_THINKING].name,description:$n[ie.KIMI_K2_THINKING].description,nonReasoningModel:null,reasoningModel:ie.KIMI_K2_THINKING,hasNewTag:!1,subscriptionTier:Jn.PRO,textOnlyModel:!0,subheading:W({defaultMessage:"Hosted in the US",id:"5F33MSbZ40"})},{label:$n[ie.CLAUDE_4_5_SONNET].name,description:$n[ie.CLAUDE_4_5_SONNET].description,nonReasoningModel:ie.CLAUDE_4_5_SONNET,reasoningModel:ie.CLAUDE_4_5_SONNET_THINKING,hasNewTag:!1,subscriptionTier:Jn.PRO}],pbe=e=>e.reduce((t,n)=>(n.nonReasoningModel&&(t[n.nonReasoningModel]=n),n.reasoningModel&&(t[n.reasoningModel]=n),t),{}),I4=()=>{const{variation:e}=fbe(!1),t=d.useMemo(()=>e?$R.reduce((s,o)=>(s.push(o),o.label===$n[ie.GEMINI_3_0_PRO].name&&s.push(mbe),s),[]):$R,[e]),n=d.useMemo(()=>pbe(t),[t]),r=d.useCallback(s=>n[s],[n]);return d.useMemo(()=>({models:t,getModelConfig:r}),[t,r])},hbe=(e,t,n)=>{const{value:r,loading:s}=n4({flag:"remove-reasoning-model-selection",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},gbe=()=>{const{variation:e,loading:t}=hbe(0);return d.useMemo(()=>({hours:e,loading:t,enabled:e>0}),[e,t])};function ybe(e){try{const t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}}function xbe({getPreferredSearchModelUpdatedAt:e,setPreferredSearchModelUpdatedAt:t}){const{hours:n,loading:r,enabled:s}=gbe();return d.useMemo(()=>{const o=e();if(r||!s)return{shouldAutoDisableReasoning:!1};if(!o)return{shouldAutoDisableReasoning:!1};const a=ybe(o);return a?{shouldAutoDisableReasoning:(new Date().getTime()-a.getTime())/(1e3*60*60)>=n}:(t(new Date().toISOString()),{shouldAutoDisableReasoning:!1})},[n,r,s,e,t])}const vbe=(e=!1,t,n)=>{const{value:r,loading:s}=zt({flag:"search-model-menu-rewrite",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},bbe="search-model-menu-redesign-enabled",_be=()=>{const[e,t]=Qi(bbe,!1),{variation:n,loading:r}=vbe(!1);return d.useEffect(()=>{r||t(n)},[n,r,t]),{isSearchModelMenuRewriteEnabled:e}},_z="v1",wbe={config_schema:_z,models:[ie.SONAR],config:[{label:"Sonar",description:"Perplexity's fast model",non_reasoning_model:ie.SONAR,reasoning_model:null,has_new_tag:!1,subscription_tier:Jn.PRO,text_only_model:!1}]},wz=e=>{const t=e.config.reduce((i,c)=>(c.non_reasoning_model&&i.set(c.non_reasoning_model,c),c.reasoning_model&&i.set(c.reasoning_model,c),i),new Map),n=i=>t.get(i);function r(i,c){return n(i)?.label??c}function s(i,c){return n(i)?.description??c}function o(i,c){return n(i)?.subheading??c}function a(i){return typeof i=="string"&&t.has(i)}return{...e,getModelConfig:n,getModelLabel:r,getModelDescription:s,getModelSubheading:o,isSearchModel:a}},Cbe=()=>be.makeQueryKey("search-models-config"),Sbe=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/models/config",e,{params:{query:{config_schema:_z}},timeoutMs:Qe(),numRetries:$l});if(t)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch models",cause:t,status:r.status??0});const s=wz(n);return{...n,...s}},Ebe=wz(wbe),kbe=({reason:e,enabled:t=!0})=>{const n=mt({queryFn:()=>Sbe({reason:e}),queryKey:Cbe(),placeholderData:Ebe,enabled:t}),r=n.data;return d.useMemo(()=>({query:n,...r}),[n,r])},Mbe=()=>{const e="use-is-search-model",{isSearchModelMenuRewriteEnabled:t}=_be(),{isSearchModel:n}=kbe({reason:e,enabled:t});return d.useCallback(r=>t?n(r):jH(r),[n,t])},Cz="pplx.local-user-settings.";function Wd(e,t){return Qi(`${Cz}${e}`,t)}const Tbe=1;function Hx(){const e=Mbe(),[t,n]=Wd("preferredSearchModelUpdatedAt",void 0),[r,s,o]=Wd(`preferredSearchModels-v${Tbe}`,EU),[a,i]=d.useState(r),c=d.useCallback(m=>{s(m),i(m)},[s]),u=d.useRef(!0),f=d.useCallback((m,p)=>{c(h=>{const g={...h};return p?g[m]=p:m&&delete g[m],g})},[c]);return d.useEffect(()=>{if(u.current){u.current=!1;return}n(new Date().toISOString())},[a.search,n]),d.useEffect(()=>{function m(){if(document.visibilityState!=="visible")return;const p=o();i(h=>{let g=!1;const y={...h};for(const[x,v]of Object.entries(p)){const b=x,_=h[b];e(v)&&v!==_&&(y[b]=v,g=!0)}return g?y:h})}return document.addEventListener("visibilitychange",m),()=>{document.removeEventListener("visibilitychange",m)}},[e,i,o]),d.useMemo(()=>({preferredSearchModels:a,preferredSearchModelUpdatedAt:t,setPreferredSearchModel:f,setPreferredSearchModelUpdatedAt:n}),[a,t,f,n])}const Abe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"use-rate-limit-status-endpoint",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Nbe=async({reason:e})=>{const{error:t,data:n}=await de.GET("/rest/rate-limit/all",e);if(t||!n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get rate limits",cause:t,status:0});return n},Rbe=async({reason:e})=>{const{error:t,data:n}=await de.GET("/rest/rate-limit/status",e);if(t||!n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get rate limit statuses",cause:t,status:0});return n},Dbe={remaining_pro:0,remaining_research:0,remaining_labs:0,sources:{source_to_limit:{}},model_specific_limits:{}},jbe={modes:{pro_search:{available:!1,remaining_detail:{kind:"exact",remaining:0}},research:{available:!1,remaining_detail:{kind:"exact",remaining:0}},labs:{available:!1,remaining_detail:{kind:"exact",remaining:0}}},sources:{}},Ibe=({enabled:e,reason:t,refetchOnMount:n="always"})=>{const r=Wt(),s=Yt(),{session:o}=Ne(),a=o?.user?.email?{userEmail:o.user.email}:void 0,{variation:i,loading:c}=Abe(!1,a),u=mt({enabled:r&&e&&!c,queryKey:Zy(),queryFn:async()=>i?{status:await Rbe({reason:t})}:{legacy:await Nbe({reason:t})},refetchOnMount:n}),f=d.useCallback(()=>{s.invalidateQueries({queryKey:Zy()})},[s]);return d.useMemo(()=>({...u,legacyLimits:u.data?.legacy??(i?void 0:Dbe),statusLimits:u.data?.status??(i?jbe:void 0),hasLoadedRateLimits:u.isSuccess&&!u.isFetching&&!!u.data,refresh:f}),[u,i,f])},qR={hasLoadedSettings:!1,pagesLimit:0,uploadLimit:void 0,articleImageUploadLimit:0,defaultImageGenerationModel:"default",defaultVideoGenerationModel:"default",maxFilesPerUser:0,maxFilesPerRepository:0,queryCount:0,queryCountCopilot:0,queryCountMobile:0,hasAiProfile:!1,referralCode:"",referralNumSuccess:0,referralNumCoupons:0,disableTraining:!1,isSidebarCollapsed:!1,isSidebarPinned:!1,sidebarHiddenHubs:[],subscriptionTier:void 0,stripeStatus:"none",revenuecatStatus:"none",revenuecatSource:"none",createLimit:0,notifStatus:"",emailStatus:"",hasDataRetentionWarning:!1,allowArticleCreation:!1,isVerified:!1,connectors:{connectors:[]},connectorLimits:{global_file_count:void 0,repo_type_limits:void 0,max_file_size_mb:void 0,max_attachment_file_size_mb:void 0},alwaysAllowBrowserAgent:!1,hasAcceptedApiTerms:!1,sources:{source_to_limit:{}}},Pbe=()=>{const e=mr("isCollapsed"),{device:{isWindowsApp:t}}=sn();return e===null?t:e==="true"},Ea=({enabled:e,reason:t,refetchOnMount:n,skipConnectorPickerCredentials:r=!0})=>{const{locale:s}=J(),o=Wt(),a=Pbe(),i=s?{"accept-language":s}:{},c=()=>XH({headers:i,reason:t,skipConnectorPickerCredentials:r}),{data:u,refetch:f,isLoading:m,isStale:p}=mt({enabled:o?typeof e>"u"?!0:e:!1,queryKey:iu({skipConnectorPickerCredentials:r}),queryFn:c,refetchOnMount:n,placeholderData:qR});d.useEffect(()=>{u&&Cfe({queryCount:u.queryCount,queryCountCopilot:u.queryCountCopilot,queryCountMobile:u.queryCountMobile})},[u]);const h=d.useMemo(()=>({...u??qR,isSidebarCollapsed:a}),[u,a]);return d.useMemo(()=>({...h,refetch:f,isLoading:m,isStale:p}),[h,f,m,p])},Obe=["presentpicker"],Sz=e=>e?Obe.includes(e):!1;function Lbe(e){const t=fn(),n=Wt(),{hasAccessToProFeatures:r}=$t(),{session:s}=Ne(),{trackEvent:o}=Xe(s),{preferredSearchModels:a,preferredSearchModelUpdatedAt:i,setPreferredSearchModel:c,setPreferredSearchModelUpdatedAt:u}=Hx(),{getModelConfig:f}=I4(),m=t?.get("copilot"),p=t?.get("pro"),h=t?.get("utm_source"),g=m==="false"||p==="false",y=!g&&(m==="true"||p==="true"||Sz(h??void 0)),x=a[oe.SEARCH];d.useEffect(()=>{x&&(an(x)!==oe.SEARCH?(Hc.warn(`Resetting preferred search model from ${x} to ${ie.PRO}`),a[oe.SEARCH]=ie.PRO,c(oe.SEARCH,ie.PRO)):x===ie.DEFAULT&&r&&c(oe.SEARCH,void 0))},[r,x,a,c]);const v=d.useCallback(()=>i,[i]),{shouldAutoDisableReasoning:b}=xbe({getPreferredSearchModelUpdatedAt:v,setPreferredSearchModelUpdatedAt:u});d.useEffect(()=>{if(!b||!x)return;const C=f(x);C&&C.nonReasoningModel&&C.reasoningModel===x&&c(oe.SEARCH,C.nonReasoningModel)},[b,c,f,x]);const _=t?.get("model_id")==="pplx_alpha"?null:t?.get("model_id");let w;_&&(_==="deep_research"?w=ie.ALPHA:Object.values(ie).includes(_)&&(w=_));let S;return g?S=ie.DEFAULT:w?S=w:y&&(S=ie.PRO),S&&w&&w==S&&o("search mode utm",{mode:an(S)}),d.useMemo(()=>{let C=ie.DEFAULT;return n?S||(C=a[oe.SEARCH]??(r?ie.PRO:ie.DEFAULT),C):C},[n,S,a,r])}function Nu(e){return{available:e>0,exactCount:e}}function D_(e){return{available:e.available,exactCount:e.remaining_detail.kind==="exact"?e.remaining_detail.remaining:void 0}}const Ez={isCopilot:!1,sources:["web"],gpt4Limit:{available:!1,exactCount:0},pplxAlphaLimit:{available:!1,exactCount:0},pplxBetaLimit:{available:!1,exactCount:0},modelSpecificLimits:{},uploadRateLimit:void 0,createLimit:0,recency:null,askInputReasoningMode:!1,askInputReasoningModelPreference:null,setAskInputReasoningMode:()=>{},setAskInputReasoningModelPreference:()=>{},setConfiguredModel(){},setSources:()=>{},setIsCopilot:()=>{},decrementCreateLimit:()=>{},setModelSpecificLimits:()=>{},setRecency:()=>{},setUploadRateLimit:()=>{},configuredModel:ie.DEFAULT,configuredSearchMode:oe.SEARCH,setConfiguredSearchMode(){}},kz=Ft("ThreadConfigContext",Ez),Fbe=({children:e,shouldFetchSettings:t})=>{const r=Ea({enabled:t,reason:"thread-settings-provider"}),{isMax:s}=$t(),{statusLimits:o,legacyLimits:a,hasLoadedRateLimits:i}=Ibe({enabled:t,reason:"thread_settings_provider_mount"}),c=Lbe(),u=d.useMemo(()=>o?{proLimit:D_(o.modes.pro_search),researchLimit:D_(o.modes.research),labsLimit:D_(o.modes.labs),modelSpecificLimits:{}}:a?{proLimit:Nu(a.remaining_pro??0),researchLimit:Nu(a.remaining_research??0),labsLimit:Nu(a.remaining_labs??0),modelSpecificLimits:a.model_specific_limits??{}}:null,[o,a]),[f,m]=d.useState({...Ez,gpt4Limit:Nu(u?.proLimit.exactCount??0),pplxAlphaLimit:Nu(u?.researchLimit.exactCount??0),pplxBetaLimit:Nu(u?.labsLimit.exactCount??0),modelSpecificLimits:u?.modelSpecificLimits??{},configuredModel:c,configuredSearchMode:an(c)});d.useEffect(()=>{m(C=>C.configuredModel===c?C:{...C,configuredModel:c,configuredSearchMode:an(c,C.configuredSearchMode)})},[c]);const p=d.useCallback(C=>m(E=>({...E,configuredModel:C,configuredSearchMode:an(C,E.configuredSearchMode)})),[]),h=d.useCallback(()=>{p(ie.DEFAULT)},[p]),g=d.useCallback(C=>{m(E=>({...E,sources:C}))},[]),y=d.useCallback(C=>{m(E=>({...E,recency:C}))},[]),x=d.useCallback(C=>{m(E=>({...E,askInputReasoningModelPreference:C,askInputReasoningMode:!!C}))},[]),v=d.useCallback(C=>{m(E=>({...E,askInputReasoningMode:C}))},[]);d.useEffect(()=>{r.createLimit!==null&&m(C=>({...C,createLimit:r.createLimit}))},[r.createLimit]),d.useEffect(()=>{r.uploadLimit!==null&&r.uploadLimit!==void 0&&m(C=>({...C,uploadRateLimit:r.uploadLimit}))},[r.uploadLimit]),d.useEffect(()=>{u&&m(C=>({...C,gpt4Limit:u.proLimit,pplxAlphaLimit:u.researchLimit,pplxBetaLimit:u.labsLimit,modelSpecificLimits:u.modelSpecificLimits}))},[u,f.gpt4Limit.available,f.pplxAlphaLimit.available,f.pplxBetaLimit.available]),d.useEffect(()=>{if(!i||!u)return;const C=u.proLimit.available,E=u.researchLimit.available,T=u.labsLimit.available,k=f.configuredModel;(k!==ie.DEFAULT&&!C||an(k)===oe.RESEARCH&&!E&&!s||an(k)===oe.STUDIO&&!T&&!s)&&h(),(f.askInputReasoningMode||f.askInputReasoningModelPreference)&&!C&&h()},[u,h,i,f.askInputReasoningMode,f.askInputReasoningModelPreference,f.configuredModel,s]);const b=d.useCallback(()=>{const C=Math.max(f.createLimit-1,0);m(E=>({...E,createLimit:C}))},[f.createLimit]),_=d.useCallback((C=1)=>{if(f.uploadRateLimit==null)return;const E=Math.max(f.uploadRateLimit-C,0);m(T=>({...T,uploadRateLimit:E}))},[f.uploadRateLimit]),S={...f,setConfiguredModel:p,setSources:g,decrementCreateLimit:b,setUploadRateLimit:_,setModelSpecificLimits:C=>{m(E=>({...E,modelSpecificLimits:C}))},setRecency:y,askInputReasoningMode:f.askInputReasoningMode,isCopilot:f.configuredModel!==ie.DEFAULT,setAskInputReasoningMode:v,setAskInputReasoningModelPreference:x,configuredSearchMode:f.configuredSearchMode,setConfiguredSearchMode:C=>{m(E=>({...E,configuredSearchMode:C}))}};return l.jsx(kz.Provider,{value:S,children:e})},Vn=()=>{const e=d.useContext(kz);if(!e)throw new Error("useThreadConfig must be used within ThreadSettingsContext");return e};function Vo(){const{configuredModel:e,configuredSearchMode:t}=Vn();return d.useMemo(()=>t||(e===ie.DEFAULT?oe.SEARCH:an(e)),[t,e])}const Mz=e=>[...e].sort((t,n)=>t.backend_uuid.localeCompare(n.backend_uuid,void 0,{sensitivity:"base"})),P4=e=>{if(!e.length)return[];const t=new Map;return e.forEach(n=>{if(n.side_by_side_metadata?.sibling_uuid&&n.side_by_side_metadata?.selection_status===aa.UNSELECTED)return;const r=n.side_by_side_metadata?.sibling_uuid??n.backend_uuid;t.has(r)||t.set(r,[]),t.get(r).push(n)}),[...t.values()].map(n=>{const r=Mz(n);return r[0]?.side_by_side_metadata?.selection_status===aa.TIE?[r[0]]:r})};function Bbe(){const{session:e}=Ne(),{trackEvent:t}=Xe(e),{locale:n}=J(),[r,s]=d.useState(p_.includes(n)?n:Ume),o=O2e();return o?p_.includes(o)?r!==o&&s(o):L2e():r!==n&&p_.includes(n)&&s(n),d.useMemo(()=>({locale:r,hasChosenLocale:!!o,saveLocale(a){s(a),P2e(a),t("set locale cookie",{locale:a})}}),[r,o,t])}const Ube="side-by-side-experiments";function Vbe(e,t={}){const{value:n,loading:r,error:s}=hge({flag:Ube,defaultValue:{side_by_side_config:{}},subjectType:"context_uuid",extraAttributes:t},e);return d.useMemo(()=>({sideBySideOverrides:n,loading:r,error:s}),[n,r,s])}const ua=()=>crypto.randomUUID();ua();const cvt=(e,t)=>{const n=new URL(e);return n.searchParams.delete("source"),n.searchParams.delete("s"),t&&(n.hash=t),n.searchParams.sort(),n.href};function Tz(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Hbe(e,t){try{const n=new Date(e.replace(/-/g,"/")).toLocaleString(t,{weekday:"long",hour:"numeric",minute:"numeric",hour12:!0});return Tz(n)}catch(n){console.log(n)}return null}function zbe(e,t,n="short"){const s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].indexOf(e.toLowerCase());if(s===-1)return"";const o=new Date,a=new Date(o.setDate(o.getDate()-o.getDay()+s)),i=Intl.DateTimeFormat(t,{weekday:n}).format(a);return Tz(i)}function Wbe(e){return e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:12})}function uvt(e,t,n){const r=typeof e=="string"?new URL(e):e,s=r.searchParams;return s.set(t,n),r.search=s.toString(),r.toString()}const Gbe=e=>{let t;if(typeof e=="string"){if(t=parseFloat(e),isNaN(t))throw new Error("Invalid input: not a number")}else if(typeof e=="number")t=e;else throw new Error("Invalid input: not a string or number");return t.toLocaleString("en-US")},$be=/\[(\d{1,3})(,\s*\{ts:\d+\})?\]/g,qbe=/(\n*^(("""+|'''+|```+)[A-Za-z0-9]*|#+ .*)$|^- |\*\*|\$\$|\||`|[-|]{3,})/gm;function Kbe(e){return e.replace($be,"")}function Ybe(e){return e.replace(qbe,"")}function ny(e,t){const n=Kbe(Ybe(e)).trim();if(n.length<=t)return n;{const r=n.slice(0,t).trim(),s=r.lastIndexOf(" ");return s*2>t&&se?.startsWith(y3)??!1,Xbe=[],Zbe={isEnabled:!1,sbsVariations:Xbe,isLoading:!1,error:null,incrementTriggerCount:()=>{},triggerCount:0},Jbe="sbsMaxTriggerCntPerThread";function e_e(e,t,n,r,s,o,a,i,c,u){const{isPro:f,isMax:m,hasAccessToProFeatures:p}=e,{isEnterprise:h=!1}=t,g=f||m||h||p,y=f||m||p,x=s?.localeObj?.language||n?.language||null,v=r?.toLowerCase()||null,b=h?"ENTERPRISE":"INDIVIDUAL",_=typeof window<"u"&&window.navigator.userAgent.includes("Mobile");return{isPriority:g,isSubscribed:y,language:x,country:i,searchFocus:v,userCategory:b,isFollowUp:!!u,isMobile:_,appApiClient:"web",configuredModel:c,[Jbe]:o,turnCount:a}}const t_e=e=>{try{if(!e||!e.side_by_side_config)return!1;const t=e.side_by_side_config;if(!t||typeof t!="object")return!1;const n=!!(t.experiment_flag&&typeof t.experiment_flag=="string"&&t.experiment_flag.length>0),r=!!(t.variations&&Array.isArray(t.variations)&&t.variations.length>0);return n||r}catch{return!1}},n_e=e=>{if(!e||!e.side_by_side_config)return[];const t=e.side_by_side_config;if(!t.experiment_flag||!t.variations||!Array.isArray(t.variations))return[];if(t.variations.length===0)return[];const n=[],r=ua(),s=t.experiment_flag;let o=!1;return t.variations.forEach(a=>{if(!a||!a.identifier)return;const i=a.is_control===!0;i&&(o=!0);const c=i?`${y3}${s}:${a.identifier}`:`${s}:${a.identifier}`,u={[s]:a.attributes_override??{}};n.push({sibling_uuid:r,experiment_role:c,experiment_override:u})}),!o&&Hi(n)&&(n[0].experiment_role=`${y3}${s}:${t.variations[0]?.identifier}`),n},KR=e=>{try{const t=_a.getItem(`${Az}_${e}`);return t?parseInt(t,10):0}catch{return 0}},r_e=(e,t)=>{try{_a.setItem(`${Az}_${e}`,t.toString())}catch{}};function s_e({frontendContextUUID:e,disableSideBySide:t=!1}){const n=Vo(),{sources:r,configuredModel:s}=Vn();b2e(r||[]);const{results:o}=on(),a=d.useMemo(()=>!o||o.length===0?1:P4(o).length+1,[o]),i=$t(),c=mo({reason:"sbs-experiment-attributes"}),u=zve({reason:"sbs-experiment-attributes"}),f=Bbe(),m=Ox(),{session:p}=Ne(),h=An()||!0;p?.user?.email?.endsWith("@perplexity.ai"),t=t||n===oe.STUDIO||n===oe.RESEARCH||h;const[g,y]=d.useState(()=>e?KR(e):0),x=e?e_e(i,c,u,n,f,g,a,m??null,s,e):{},{sideBySideOverrides:v,loading:b,error:_}=Vbe(e||"",x),w=_?String(_):null,S=t_e(v);d.useEffect(()=>{if(e){const E=KR(e);y(Math.max(0,E))}else y(0)},[e]),d.useEffect(()=>{S&&e&&g>0&&r_e(e,g)},[e,g,S]);const C=d.useCallback(()=>{S&&y(E=>Math.max(0,E+1))},[S]);return d.useMemo(()=>{if(t||!S||w)return Zbe;const E=n_e(v);return{isEnabled:S,sbsVariations:E,isLoading:b,error:w,incrementTriggerCount:C,triggerCount:g}},[t,w,C,S,b,v,g])}const o_e=async(e,t,n,r)=>{const s=(o,a)=>{r(i=>i.filter(c=>t.some(u=>u.backend_uuid===c.backend_uuid)?c.backend_uuid===o.backend_uuid:!0).map(c=>c.backend_uuid===o.backend_uuid?{...c,side_by_side_metadata:c.side_by_side_metadata?{...c.side_by_side_metadata,selection_status:a}:void 0}:c))};try{const o=t.map((c,u)=>{let f;return e===Jy?f=aa.TIE:f=u===e?aa.SELECTED:aa.UNSELECTED,Age({entryUUID:c.backend_uuid,params:f,siblingUUID:n,reason:"user-sbs-selection"}).catch(m=>{throw Z.error(`Failed to update selection for entry ${c.backend_uuid}:`,m),m})});await Promise.all(o);let a,i;if(e===Jy?(a=Mz(t)[0],i=aa.TIE):(a=t[e],i=aa.SELECTED),!a)throw new Error("No target result found");s(a,i)}catch(o){throw Z.error("Failed to update entry selection:",o),o}},a_e=Object.freeze({}),Af=({reason:e,enabled:t=!0,skipConnectorPickerCredentials:n=!0})=>{const{connectors:r}=Ea({reason:e,enabled:t,skipConnectorPickerCredentials:n}),s=d.useMemo(()=>r?.connectors?.length?r.connectors.reduce((o,a)=>(o[a.name]=a,o),{}):a_e,[r]);return d.useMemo(()=>({connectorsMap:s}),[s])},Nz=({reason:e,enabled:t=!0})=>{const{connectors:n,isLoading:r,isStale:s,refetch:o}=Ea({reason:e,enabled:t}),{connectorsMap:a}=Af({reason:e,enabled:t}),i=d.useMemo(()=>(n?.connectors??[]).filter(f=>W7.includes(f.name)&&a[f.name]&&a[f.name].connected),[a,n]),c=d.useMemo(()=>(n?.connectors??[]).filter(f=>!W7.includes(f.name)&&a[f.name]&&a[f.name].connected),[a,n]),u=d.useMemo(()=>(n?.connectors??[]).filter(f=>a[f.name]&&a[f.name].connected),[a,n]);return d.useMemo(()=>({enabledFileConnectors:i,enabledNonFileConnectors:c,enabledConnectors:u,isConnectorsLoading:r,isConnectorsStale:s,refetchConnectors:o}),[u,i,c,r,s,o])},Rz=({reason:e})=>{const{connectors:t}=Ea({reason:e}),{connectorsMap:n}=Af({reason:e}),r=d.useMemo(()=>(t?.connectors??[]).filter(o=>(o.name==="google_drive"||o.name==="onedrive"||o.name==="sharepoint"||o.name==="dropbox"||o.name==="box")&&!n[o.name]?.connected),[n,t]),s=d.useMemo(()=>(t?.connectors??[]).filter(o=>!n[o.name]?.connected),[n,t]);return d.useMemo(()=>({disabledFileConnectors:r,disabledConnectors:s}),[s,r])},i_e=({reason:e})=>{const t=Nz({reason:e}),n=Rz({reason:e});return d.useMemo(()=>{const r=h7([...t.enabledConnectors,...t.enabledFileConnectors,...t.enabledNonFileConnectors].map(o=>o.name)),s=h7([...n.disabledConnectors,...n.disabledFileConnectors].map(o=>o.name));return{enabled:r,disabled:s}},[t,n])},dvt=async({headers:e={},params:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/collections/list_user_collections",n,{params:{query:{limit:t.limit,offset:t.offset,version:ql}},timeoutMs:Qe(),headers:e});if(s||!r)throw new he("API_CLIENTS_ERROR",{message:"Failed to list user collections",cause:s,status:o.status??0});return r},l_e=async({headers:e={},params:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/collections/get_collection",n,{params:{query:t},headers:e,timeoutMs:Qe()});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get collection",cause:s,status:o.status??0});if(!r?.status||r?.status==="failed")throw new he("API_CLIENTS_ERROR",{message:"Failed to get collection",cause:r,status:o.status??0});return r}catch(r){Z.error(r);return}},c_e=async({headers:e={},params:t,reason:n})=>{try{const{error:r,response:s}=await de.PUT("/rest/collections/{collection_uuid}/access",n,{params:{path:{collection_uuid:t.collection_uuid}},headers:e,body:{updated_access:t.updated_access},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to update collection access",cause:r,status:s.status??0})}catch(r){Z.error(r)}},I0=async({params:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/collections/upsert_thread_collection",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to upsert thread collection",cause:r,status:s.status??0});return n}catch{return}},YR=async({collectionUUID:e,entryUUID:t,reason:n})=>{try{const{error:r,response:s}=await de.DELETE("/rest/collections/remove_collection_thread",n,{params:{query:{collection_uuid:e,entry_uuid:t}}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to remove thread from collection",cause:r,status:s.status??0})}catch{return}},O4=({collectionSlug:e,reason:t,enabled:n=!!e})=>{const r=async()=>e?await l_e({params:{collection_slug:e,version:ql},reason:t})??null:null,{data:s,isLoading:o}=mt({enabled:n,queryKey:na(e??""),queryFn:r,placeholderData:Wl});return d.useMemo(()=>({collection:s??void 0,isLoading:o}),[s,o])},zx=({reason:e,collectionSlugOverride:t,collectionUuidOverride:n})=>{const r=On(),s=ou(),{firstResult:o}=on(),a=o?.collection_info?.uuid,i=r?.includes("/search/")&&!!a,c=t??(Array.isArray(s?.slug)?s.slug[0]:s?.slug),{collection:u}=O4({collectionSlug:c,reason:e,enabled:!n}),f=d.useMemo(()=>{let m,p;return i?(m="COLLECTION",p=a??""):r?.includes("/collections")||r?.includes("/spaces")||r?.includes("/study-hub")?(m="COLLECTION",p=n||u?.uuid||""):(m="ORG",p=""),{file_repository_type:m,owner_id:p}},[i,r,a,n,u?.uuid]);return d.useMemo(()=>({fileRepoInfo:f}),[f])},L4=10,fvt=20,mvt=L4*41+46,x3=async({request:e,reason:t})=>{const{fileRepositoryInfo:n,limit:r,offset:s,searchTerm:o,fileStates:a,email:i}=e;try{let c;a.includes("COMPLETE")?c={file_repository_info:n,limit:r,offset:s??0,search_term:o,file_states_in_filter:a}:c={file_repository_info:n,limit:r,offset:s??0,search_term:o,file_states_in_filter:a,email_in_filter:[i]};const{data:u,error:f,response:m}=await de.POST("/rest/file-repository/list-files",t,{headers:{"content-type":"application/json"},body:c,timeoutMs:Qe(),numRetries:1});if(f)throw new he("API_CLIENTS_ERROR",{cause:f,status:m.status??0});return{files:u?.files??[],numTotalFiles:u?.num_total_files??0}}catch(c){return Z.error(c),null}},u_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/get-file-upload-urls",t,{body:e,timeoutMs:5e3,numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get fileUploadUrl",cause:r,status:s.status??0});return n},pvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/list",t,{body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get connector files",cause:r,status:s.status??0});return n},hvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/delete",t,{body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete connector files",cause:r,status:s.status??0});return n},gvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/resync",t,{body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to resync connector files",cause:r,status:s.status??0});return n},d_e=async({request:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/uploads",t,{headers:{"content-type":"application/json"},body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n??null}catch(n){return Z.error(n),null}};async function Dz({request:e,reason:t}){return new Promise((n,r)=>{de.SSE("/rest/sse/index_files",t,{params:e,headers:{"content-type":"application/json",accept:"text/event-stream"},handlers:{message:s=>{s.status==="success"?n():r(new Error("Indexing failed"))}}}).catch(r)})}const f_e=({fileRepoInfo:e,reason:t})=>{const{$t:n}=J(),r=Yt(),s=_4(e),{openToast:o}=hn(),{session:a}=Ne(),i=a?.user?.email??"",c=Rt({mutationFn:async u=>{if(!u.nextURL)throw new Error("File must have a url");const{data:f,error:m,response:p}=await de.POST("/rest/file-repository/move-attachment-to-persistent-file-path",t,{body:{file_repository_info:e,file_url:u.nextURL},timeoutMs:Cn.MEDIUM,retries:2});if(m||!f)throw new he("API_CLIENTS_ERROR",{message:"Failed to save file persistently",cause:m,status:p.status??0});return await Dz({request:{file_repository_info:e,file_index_params:[{file_s3_url:f.file_url_params.s3_object_url,file_size:u.file.size,filename:u.file.name,file_uuid:f.file_url_params.file_uuid,replace_existing:!1}]},reason:t}),f},onSuccess:(u,f)=>{const m={name:f.file.name,file_s3_url:u.file_url_params.s3_object_url,file_uuid:u.file_url_params.file_uuid,file_title:f.file.name,file_description:null,uploadedBy:i,date:new Date().toLocaleString(),state:"COMPLETE",size:f.file.size,isOptimistic:!0};r.setQueriesData({queryKey:s},h=>{if(!h)return h;const g=h.completedFiles||[];return{...h,completedFiles:[...g,m]}});const p=eh(e.owner_id,f.file.name);r.invalidateQueries({queryKey:p}),o({message:n({defaultMessage:"Saved file",id:"2HZW5WnkV3"}),variant:"success",timeout:3})},onError:(u,f)=>{o({message:n({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),Z.error("Error saving file with name",f.file.name,u)},onSettled:async()=>{await r.invalidateQueries({queryKey:s})}});return d.useMemo(()=>({saveFile:c.mutate,isLoading:c.isPending}),[c.isPending,c.mutate])},jz=({fileRepoInfo:e,fileName:t,reason:n,enabled:r=!0})=>{const{session:s}=Ne();return mt({queryKey:eh(e.owner_id,t),refetchOnMount:!0,queryFn:async()=>((await x3({request:{fileRepositoryInfo:e,limit:L4,offset:0,searchTerm:t,fileStates:["COMPLETE"],email:s?.user?.email??""},reason:n}))?.files.length??0)>0,enabled:r&&e.file_repository_type==="COLLECTION"&&!!e.owner_id&&t.length>0})},m_e=async({entryUUIDs:e,rwToken:t,reason:n})=>{const{error:r,response:s}=await de.DELETE("/rest/thread",n,{body:{entry_uuids:e,read_write_token:t??""}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete threads",cause:r,status:s.status??0})},p_e=async({entryUUID:e,rwToken:t,callback:n,reason:r})=>{n?.();const{error:s,response:o}=await de.DELETE("/rest/thread/delete_thread_by_entry_uuid",r,{body:{entry_uuid:e,read_write_token:t??""}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete thread",cause:s,status:o.status??0})},h_e=async({backendUUID:e,url:t,rwToken:n,reason:r})=>{if(!n)return;const{data:s,error:o,response:a}=await de.PUT("/rest/thread/entry/remove_widget",r,{timeoutMs:Qe(),body:{entry_uuid:e,read_write_token:n,url:t}});if(o)throw new he("API_CLIENTS_ERROR",{message:"Error removing widget from entry",cause:o,status:a.status??0});return s},g_e={box:"box",dropbox:"dropbox",factset:"factset",gcal:"gcal",google_drive:"google_drive",linear:"linear",onedrive:"onedrive",outlook:"outlook",sharepoint:"sharepoint",zoom:"zoom"},Iz=e=>Object.keys(g_e).includes(e),Pz=async({name:e,referrer:t,referrerId:n,redirectPath:r,redirectOrigin:s,unauthedRedirectPath:o,autoClose:a,reason:i})=>{try{const{data:c,error:u,response:f}=e!=="factset"?await de.GET(`/rest/connectors/${e}/connect`,i,{timeoutMs:Qe(),numRetries:1,reason:i,params:{query:{referrer:t,referrer_id:n,redirect_path:r,redirect_origin:s,unauthed_redirect_path:o,auto_close:a}}}):await de.GET("/rest/connectors/factset/connect",i,{timeoutMs:Qe(),numRetries:1,reason:i});if(u)throw new he("API_CLIENTS_ERROR",{message:"Failed to initiate OAuth flow",cause:u,status:f.status??0});return c.redirect_url??null}catch(c){return Z.error("Error fetching factset OAuth redirect URL:",c),null}},QR=async({connectorName:e,reason:t,autoDeleteEmailAssistant:n=!1,connectionUUID:r})=>{const s=`disconnectConnector:${e}`;try{const{data:o,error:a,response:i}=await de.GET("/rest/connectors/{connector_id}/disconnect",t,{timeoutMs:Qe({productionMs:500}),numRetries:1,reason:t,params:{path:{connector_id:e},query:{auto_delete_email_assistant:n,connection_uuid:r}}});if(a)throw new he("API_CLIENTS_ERROR",{message:"Failed to disconnect connector",cause:a,status:i.status??0});return o}catch(o){return Z.log(`Error in ${s}:`,o),null}},y_e=async({connectionUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/connections/{uuid}/update",t,{params:{path:{uuid:e}},body:{disconnect:!0}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to disconnect file connector",cause:r,status:s.status??0});return n},x_e=async({connectionUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/connections/{uuid}/delete",t,{params:{path:{uuid:e}}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to disconnect file connector and delete files",cause:r,status:s.status??0});return n},yvt=async({connectorName:e,fileIds:t,fileRepoInfo:n,folder_ids:r=Pe,reason:s})=>{const{error:o,data:a,response:i}=e==="sharepoint"?await de.POST(`/rest/connectors/${e}/files`,s,{body:{file_ids:t,file_repository_info:n,drive_ids:r}}):await de.POST(`/rest/connectors/${e}/files`,s,{body:{file_ids:t,file_repository_info:n,folder_ids:r}});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:i.status??0});return a},v_e=async({reason:e})=>{const{data:t,error:n,response:r}=await de.POST("/rest/connectors/box/picker",e);if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to refresh box picker credentials",cause:n,status:r.status??0});return t},b_e=async({connectionType:e,content:t,reason:n})=>{const{data:r,error:s,response:o}=await de.POST("/rest/connectors/picker/log",n,{body:{connection_type:e,content:t}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed log connector picker",cause:s,status:o.status??0});return r},__e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/delete-files",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete files",cause:r,status:s.status??0});return n};class F4 extends Error{constructor(){super("Downloads are disabled"),this.name="DownloadsDisabledError"}}class B4 extends Error{constructor(){super("PDF downloads are restricted"),this.name="PdfUntrustedOriginError"}}class U4 extends Error{constructor(){super("This file belongs to a different organization"),this.name="UserNotInFileOrgError"}}const Oz=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/download",t,{body:e,timeoutMs:2e3,numRetries:1});if(r){if(r.detail&&typeof r.detail=="object"&&"error_details"in r.detail){if(r.detail.error_details==="DOWNLOADS_DISABLED")throw new F4;if(r.detail.error_details==="PDF_UNTRUSTED_ORIGIN")throw new B4;if(r.detail.error_details==="USER_NOT_IN_FILE_ORG")throw new U4}throw new he("API_CLIENTS_ERROR",{message:"Failed to download file",cause:r,status:s.status??0})}return n},w_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/download-attachment",t,{body:e,timeoutMs:2e3,numRetries:1});if(r){if(r.detail&&typeof r.detail=="object"&&"error_details"in r.detail){if(r.detail.error_details==="DOWNLOADS_DISABLED")throw new F4;if(r.detail.error_details==="PDF_UNTRUSTED_ORIGIN")throw new B4;if(r.detail.error_details==="USER_NOT_IN_FILE_ORG")throw new U4}throw new he("API_CLIENTS_ERROR",{message:"Failed to download attachment",cause:r,status:s.status??0})}return n},Lz=e=>{const{accessLevel:t,enableWebByDefault:n,...r}=e;return{...r,access:t,enable_web_by_default:n}},C_e=async({collectionUuid:e,changes:t,reason:n})=>{const r=Lz(t),{data:s,error:o,response:a}=await de.POST("/rest/collections/edit_collection/{collection_uuid}",n,{params:{path:{collection_uuid:e}},body:r,timeoutMs:Qe()});if(o||!s)throw new he("API_CLIENTS_ERROR",{message:"Failed to edit collection",cause:o,status:a.status??0});const i=s,{access:c,...u}=i;return c!==void 0?{...u,accessLevel:c}:u},XR=async({params:e,reason:t})=>{const n=Lz(e);e.template_id&&(n.template_id=e.template_id);const{data:r,error:s,response:o}=await de.POST("/rest/collections/create_collection",t,{body:n,timeoutMs:Qe()});if(s||!r)throw new he("API_CLIENTS_ERROR",{message:"Failed to create collection",cause:s,status:o.status??0});return r},xvt=async({entryUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/entry/convert-to-report/{entry_uuid}",t,{params:{path:{entry_uuid:e}},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to convert entry to report",cause:r,status:s.status??0});return n},S_e=async({collectionUuid:e,reason:t})=>{const{error:n,response:r}=await de.DELETE("/rest/collections/delete_collection/{collection_uuid}",t,{params:{path:{collection_uuid:e}},timeoutMs:Qe(),numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete collection",cause:n,status:r.status??0})},E_e=async({contextUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/thread/mark_viewed/{context_uuid}",t,{params:{path:{context_uuid:e}},timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to mark thread as viewed",cause:r,status:s.status??0});return n},vvt=async({contextUUID:e,action:t,rwToken:n,reason:r})=>{const{data:s,error:o,response:a}=await de.POST("/rest/thread/reply/simulated",r,{body:{context_uuid:e,read_write_token:n,action:t},timeoutMs:Cn.HIGH});if(o)throw new he("API_CLIENTS_ERROR",{message:"Error simulating turn",cause:o,status:a.status??0});if(!s)throw new he("API_CLIENTS_ERROR",{message:"No data returned from reply simulated",status:0});const i={...s.message,parent_info:s.message.parent_info||{}};return{...s,message:i}},bvt=async({request:e,reason:t})=>{const n={type:"remote_mcp",transport:"sse",source:"direct",status:"enabled"},{data:r,error:s,response:o}=await de.POST("/rest/connectors",t,{body:{...e,...n},timeoutMs:Qe()});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to create remote MCP connector",cause:s,status:o.status??0});return r},k_e=({fileRepositoryType:e,offset:t,searchTerm:n,ownerId:r,reason:s})=>{const{$t:o}=J(),a=Yt(),i=ou(),{openToast:c}=hn(),u=lu(),f=x4(),m=w4(e,r,L4,t,n),p=eh(r),h=Array.isArray(i?.slug)?i.slug[0]:i?.slug,g=h?na(h):void 0,y=e==="USER"||e==="ORG"||e==="COLLECTION"&&!!r;return{...Rt({mutationFn:async v=>{if(!y){c({message:o({defaultMessage:"Unable to delete files.",id:"QYfmPDehhb"}),variant:"error",timeout:3});return}return __e({request:{file_uuids:v,file_repository_info:{file_repository_type:e,owner_id:r}},reason:s})},onMutate:async v=>{await a.cancelQueries({queryKey:m});const b=a.getQueryData(m);return b&&a.setQueryData(m,_=>({..._,completedFiles:_.completedFiles.filter(w=>!v.includes(w.file_uuid)),processingFiles:_.processingFiles.filter(w=>!v.includes(w.file_uuid)),failedFiles:_.failedFiles.filter(w=>!v.includes(w.file_uuid)),numTotalFiles:Math.max((_.numTotalFiles||0)-v.length,0)})),{previousData:b}},onSuccess:()=>{u&&a.invalidateQueries({queryKey:f}),a.invalidateQueries({queryKey:m}),h&&a.invalidateQueries({queryKey:g}),a.invalidateQueries({queryKey:p})},onError:(v,b,_)=>{_?.previousData&&a.setQueryData(m,_.previousData),c({message:o({defaultMessage:"Failed to delete file",id:"aJlra1/tgY"}),variant:"error",timeout:3})}}),isDeleteEnabled:y}},e2=async({fileRepositoryType:e,ownerId:t,limit:n,offset:r,searchTerm:s,email:o,reason:a})=>{const[i,c]=await Promise.all([x3({request:{fileRepositoryInfo:{file_repository_type:e,owner_id:t},limit:n,offset:r,searchTerm:s,fileStates:["COMPLETE"],email:o},reason:a}),x3({request:{fileRepositoryInfo:{file_repository_type:e,owner_id:t},limit:100,offset:0,searchTerm:"",fileStates:["PROCESSING","FAILED"],email:o},reason:a})]),u=f=>({name:f.filename,file_uuid:f.file_uuid,file_s3_url:f.file_s3_url??"",file_title:f.file_title,file_description:f.file_description,uploadedBy:f.uploaded_by,state:f.file_state,size:f.file_size??0,date:new Date(f.time_created).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"}),error:f.error??void 0,isOptimistic:!1});if(i||c){const f=i?.files?.map(u)||[],m=c?.files?.map(u)||[];return{completedFiles:f,processingFiles:m.filter(p=>p.state==="PROCESSING"),failedFiles:m.filter(p=>p.state==="FAILED"),numTotalFiles:i?.numTotalFiles||0}}return{completedFiles:[],processingFiles:[],failedFiles:[],numTotalFiles:0}},_vt=({fileRepositoryType:e,limit:t,offset:n,searchTerm:r,ownerId:s,reason:o})=>{const a=Yt(),{session:i}=Ne(),c=i?.user?.email??"",{isEnterprise:u}=mo({reason:o}),f=!!(e==="COLLECTION"&&s||e==="ORG"&&u),m=w4(e,s,t,n,r),p=mt({queryKey:m,queryFn:()=>f?e2({fileRepositoryType:e,ownerId:s,limit:t,offset:n,searchTerm:r,email:c,reason:o}):Promise.reject(),enabled:f,placeholderData:Wl,staleTime:300*1e3,gcTime:600*1e3});return d.useEffect(()=>{f&&(p.data?.numTotalFiles??0)>n+t&&a.prefetchQuery({queryKey:m,queryFn:()=>e2({fileRepositoryType:e,ownerId:s,limit:t,offset:n+t,searchTerm:r,email:c,reason:o}),staleTime:300*1e3,gcTime:600*1e3})},[m,f,a,e,t,n,r,p.data?.numTotalFiles,c,s,o]),p},wvt=({fileRepositoryType:e,limit:t,searchTerm:n,ownerId:r,reason:s})=>{const{session:o}=Ne(),a=o?.user?.email??"",{isEnterprise:i}=mo({reason:s}),c=!!(e==="COLLECTION"&&r||e==="ORG"&&i),u=w4(e,r,t,void 0,n,!0);return PU({enabled:c,initialPageParam:0,queryKey:u,queryFn:({pageParam:m})=>!c||m===void 0?Promise.reject():e2({fileRepositoryType:e,ownerId:r,limit:t,offset:m,searchTerm:n,email:a,reason:s}),getNextPageParam:(m,p)=>{const g=p.length*t+t;if(!(g>=m.numTotalFiles))return g}})},M_e=({initialIntervalMs:e,maxIntervalMs:t=6e4,timeoutMs:n=9e5})=>{const r=d.useRef(null);return{getInterval:()=>{if(r.current===null)return r.current=Date.now(),e;const a=Date.now()-r.current,i=Math.floor(a/6e4);if(a>=n)return!1;let c=e;for(let u=0;u{r.current=null}}},T_e=5e3,A_e=6e4,N_e=({reason:e,fileRepoInfo:t,enablePolling:n=!1,forceActivePolling:r=!1})=>{const s=u2e(t),{getInterval:o,reset:a}=M_e({initialIntervalMs:T_e}),{data:i}=mt({queryKey:s,queryFn:()=>d_e({request:{file_repository_info:t},reason:e}),refetchInterval:c=>{if(!n)return a(),!1;const{pending_files:u=0}=c.state.data?.summary??{};return u===0&&!r?(a(),A_e):o()},refetchIntervalInBackground:!1,staleTime:Vme(30)});return{total:i?.summary?.total_files??0,pending:i?.summary?.pending_files??0,errors:i?.summary?.error_files??0,uploads:i?.summary?.total_uploads??0}},R_e=({fileRepoInfo:e,reason:t,enablePolling:n=!0})=>{const{isMonitoryingFileRepository:r,getLocalProgress:s,clearLocalFileUploads:o}=Vz(),a=Yt(),[i,c]=d.useState(!1),[u,f]=d.useState(0),[m,p]=d.useState(0),[h,g]=d.useState(0),{total:y,pending:x,errors:v}=N_e({enablePolling:n,forceActivePolling:r(e),fileRepoInfo:e,reason:t}),b=s(e),_=u+m,w=x+b.pending,S=v+b.errors,C=_-w;return d.useEffect(()=>{y>u&&f(y),b.total>m&&p(b.total),S>h&&g(S);const E=u>0||m>0,T=y===0,k=b.pending===0;E&&T&&k&&!i&&(c(!0),o(e),a.invalidateQueries({queryKey:RR()}),a.invalidateQueries({queryKey:RR(void 0,!0)})),i&&(y>0||b.pending>0)&&(c(!1),f(0),p(0),g(0))},[y,b.total,b.pending,S,u,m,h,i,a,e,o]),{total:_,pending:w,errors:h,uploaded:C,isFinished:i}},ZR={enter:"animate-expandHeight",exit:"animate-collapseHeight"};function D_e(e){switch(e){case"enter":return ZR.enter;case"exit":return ZR.exit;case"idle":return"";default:At(e)}}function j_e({children:e,animationState:t,onAnimationEnd:n}){const r=D_e(t);return l.jsx("div",{className:z("grid",r),onAnimationEnd:n,children:l.jsx("div",{className:"overflow-hidden",children:e})})}const I_e={top:{enter:"animate-slideDownAndFadeIn",exit:"animate-slideDownAndFadeOut"},bottom:{enter:"animate-slideUpAndFadeIn",exit:"animate-slideUpAndFadeOut"},left:{enter:"animate-slideRightAndFadeIn",exit:"animate-slideRightAndFadeOut"},right:{enter:"animate-slideLeftAndFadeIn",exit:"animate-slideLeftAndFadeOut"}};function P_e(e,t){const n=I_e[t];switch(e){case"enter":return n.enter;case"exit":return n.exit;case"idle":return"";default:At(e)}}function O_e({children:e,animationState:t,side:n,onAnimationEnd:r}){const s=P_e(t,n);return l.jsx("div",{className:s,onAnimationEnd:r,children:e})}function L_e(e){const[t,n]=d.useState(e),[r,s]=d.useState(e?"enter":"idle");d.useLayoutEffect(()=>{e?t||(n(!0),s("enter")):t&&s("exit")},[e,t]);const o=d.useCallback(()=>{r==="enter"?s("idle"):r==="exit"&&n(!1)},[r]);return{isPresent:t,animationState:r,handleAnimationEnd:o}}function JR(e){const{children:t,isVisible:n}=e,{isPresent:r,animationState:s,handleAnimationEnd:o}=L_e(n),a=d.useRef(t);if(n&&(a.current=t),!r)return null;const i=n?t:a.current,c=e.animationType;switch(c){case"height":return l.jsx(j_e,{animationState:s,onAnimationEnd:o,children:i});case"slide":{const u=e.side??"bottom";return l.jsx(O_e,{animationState:s,side:u,onAnimationEnd:o,children:i})}default:At(c)}}function V4({animationType:e,side:t,...n}){switch(e){case"height":return l.jsx(JR,{animationType:"height",...n});case"slide":return l.jsx(JR,{animationType:"slide",side:t,...n});default:At(e)}}const Wx={transparent:"transparent",subtle:"subtle",subtler:"subtler",background:"background"},F_e="border-subtlest ring-subtlest divide-subtlest",K=A.memo(({variant:e=Wx.transparent,className:t,onClick:n,onMouseOver:r,onMouseLeave:s,children:o,id:a,bgHover:i,style:c,testId:u,as:f="div",ref:m,noBorder:p,...h})=>{const g=A.useMemo(()=>{const y={transparent:"bg-transparent",super:"bg-super",superBorder:"border border-super",superLight:"bg-super/10",subtle:"bg-subtle",subtler:"bg-subtler",red:"bg-caution",background:"bg-base",underlay:"bg-underlay",offsetLoading:"bg-subtlest animate-pulse",textColor:"bg-inverse",orange:"bg-attention",raised:"bg-raised dark:bg-offset",raisedOffset:"bg-raisedOffset",max:"bg-max",maxBorder:"border border-max"},x={subtle:"md:hover:!bg-subtle",subtler:"md:hover:!bg-subtler",raisedOffset:"md:hover:!bg-raisedOffset",transparent:"md:hover:!bg-transparent",super:"md:hover:!bg-super"};return z(t,!p&&e!=="maxBorder"&&e!=="superBorder"&&F_e,i?"transition duration-normal":"",y[e]||y.transparent,i&&x[i]||"")},[i,t,e,p]);return A.createElement(f,{id:a,ref:m,className:g,onClick:n,onMouseOver:r,onMouseLeave:s,style:c,"data-testid":u,...h},o)});K.displayName="Box";const B_e={micro:"font-sans text-2xs font-normal",tiny:"font-sans text-xs font-medium",tinyRegular:"font-sans text-xs font-normal",tinyBold:"font-sans text-xs font-bold",extraSmall:"font-sans text-[13px]",small:"font-sans text-sm",smallBold:"font-sans text-sm font-medium leading-[1.125rem]",smallExtraBold:"font-sans text-sm font-extrabold leading-[1.125rem]",base:"font-sans text-base",baseSemi:"font-sans text-base font-medium",tinyMono:"font-mono text-2xs md:text-xs",smallMono:"font-mono text-sm",smallCaps:"text-2xs md:text-xs tracking-wide font-mono leading-none uppercase","section-title":"font-display text-lg font-medium","page-title":"font-display font-medium text-2xl",display:"font-display text-4xl lg:text-[2.8rem] !leading-[1.2]","entry-title":"font-display text-pretty text-xl lg:text-3xl font-medium","entry-title-100":"font-display text-pretty text-xl lg:text-3xl font-medium","entry-title-200":"font-display text-lg lg:text-xl font-medium","entry-title-300":"font-sans text-pretty font-medium"},U_e={default:"text-foreground",defaultInverted:"text-inverse",light:"text-quiet ",ultraLight:"text-quietest",red:"text-caution",yellow:"text-yellow-600 dark:text-yellow-400",super:"text-super",white:"text-white",positive:"text-positive",negative:"text-negative",max:"text-max"},V_e=(e,t,n)=>t||(e==="page-title"?"h1":e==="entry-title"?"h2":n?"span":"div"),H_e=(e,t,n,r,s)=>{const o=B_e[e],a=U_e[t];return z(s,o,a,n?"text-center block":"",r?"hover:text-super":"","selection:bg-super/50 selection:text-foreground dark:selection:bg-super/10 dark:selection:text-super")},V=A.memo(({children:e,variant:t="base",color:n="default",textCenter:r,className:s,inline:o,superHover:a,testId:i,as:c,ref:u,...f})=>{const m=d.useMemo(()=>V_e(t,c,o),[t,c,o]),p=d.useMemo(()=>H_e(t,n,r,a,s),[s,n,r,t,a]);return A.createElement(m,{className:p,"data-testid":i,ref:u,...f},e)});V.displayName="TextBlock";const z_e={[Ht.tiny]:"xs",[Ht.small]:"sm",[Ht.regular]:"base",[Ht.large]:"lg",[Ht.xl]:"xl",[Ht.none]:"base"},W_e={[Ht.tiny]:hl.xs,[Ht.small]:hl.sm,[Ht.regular]:hl.base,[Ht.large]:hl.lg,[Ht.xl]:hl.xl,[Ht.none]:hl.base},gp=A.memo(({icon:e,showClicked:t=!1,buttonSize:n,iconClassName:r})=>typeof e=="string"?l.jsx(ut,{name:t?B("check"):e,size:W_e[n],className:r}):l.jsx(ge,{icon:t?B("check"):e,size:z_e[n]||"base",className:r}));gp.displayName="BaseIcon";const Fz=A.memo(({className:e,textClassName:t,text:n,shortcut:r=Pe,...s})=>l.jsxs("div",{className:z("gap-x-sm bg-dark dark:border-subtler flex max-w-[280px] items-center rounded-md px-2 py-1.5 shadow-sm dark:border",e),...s,children:[typeof n=="string"?l.jsx(V,{variant:"tiny",color:"white",className:t,children:n}):n,r.length>0&&l.jsx("div",{className:"gap-xs flex",children:r.map(o=>l.jsx(V,{variant:"smallCaps",className:"border-subtlest bg-subtle px-xs py-two min-w-6 rounded border text-center shadow-sm",children:l.jsx("span",{className:"text-light",children:o})},o))})]}));Fz.displayName="TooltipBody";const Io=A.memo(({tooltipText:e,tooltipLayout:t="top",tooltipAlign:n,children:r,keyboardShortcut:s,showTooltip:o=!0,className:a="",asChild:i=!1,testId:c,offset:u=8,closeOnClick:f=!0,bodyClassName:m,bodyTextClassName:p,arrowClassName:h,open:g,onOpenChange:y,delayDuration:x})=>o?l.jsxs(LU,{open:g,onOpenChange:y,delayDuration:x,children:[l.jsx(fme,{children:l.jsxs(mme,{side:t,align:n,sideOffset:u,className:z(t==="bottom"&&"data-[state=closed]:animate-slideUpAndFadeOut data-[state=delayed-open]:animate-slideDownAndFadeIn",t==="top"&&"data-[state=closed]:animate-slideDownAndFadeOut data-[state=delayed-open]:animate-slideUpAndFadeIn",t==="left"&&"data-[state=closed]:animate-slideRightAndFadeOut data-[state=delayed-open]:animate-slideLeftAndFadeIn",t==="right"&&"data-[state=closed]:animate-slideLeftAndFadeOut data-[state=delayed-open]:animate-slideRightAndFadeIn",a),onPointerDownOutside:f?void 0:b=>{b.preventDefault()},children:[l.jsx(Fz,{text:e,shortcut:s,"data-test-id":c,className:m,textClassName:p}),h&&l.jsx(pme,{width:12,height:6,className:z("overflow-hidden translate-y-[-2px] [clip-path:inset(1px_1px_0px_1px)] fill-[oklch(var(--dark-background-base-color))] dark:stroke-[1.5px] dark:stroke-subtler",h)})]})}),l.jsx(hme,{asChild:i,onClick:f?void 0:b=>{b.preventDefault()},children:r})]}):l.jsx(l.Fragment,{children:r}));Io.displayName="TooltipWrapper";const G_e=2e3,$_e=1e3,e9={[Ht.tiny]:{height:"h-6",text:"text-xs",padding:"px-2",iconWrapperSize:"size-3.5",baselineShift:"-mb-px"},[Ht.small]:{height:"h-8",text:"text-sm",padding:"px-2.5",iconWrapperSize:"size-4",baselineShift:"-mb-px"},[Ht.regular]:{height:"h-10",text:"text-base",padding:"px-3",iconWrapperSize:"size-5",baselineShift:"mb-[-2px]"},[Ht.large]:{height:"h-14",text:"text-lg",padding:"px-5",iconWrapperSize:"size-7",baselineShift:"mb-[-3px]"}},Bz=e=>e9[e]||e9[Ht.regular],t9=({children:e,buttonSize:t=Ht.regular})=>l.jsx("div",{className:z("flex shrink-0 items-center justify-center",Bz(t).iconWrapperSize),children:e}),H4=d.memo(e=>{const{text:t,textClassName:n="",size:r=Ht.regular,disabled:s=!1,fullWidth:o,fullWidthMobile:a,layout:i="center",type:c="button",noWrap:u=!0,onClick:f=Ao,onMouseDown:m,href:p,target:h,extraCSS:g,icon:y,iconClassName:x,pill:v=!1,noRounded:b=!1,toolTip:_,keyboardShortcut:w,tooltipLayout:S="top",tooltipProps:C,badge:E,chevron:T,isLoading:k,loadingVariant:I="spin",leadingComponent:M,trailingComponent:N,maxWidth:D,chevronIcon:j=B("chevron-down"),clickFeedback:F=!1,debounce:R=!1,testId:P,ariaLabel:L,variant:U,autoFocus:O,noPadding:$=!1,ref:G,...H}=e,[Q,Y]=d.useState(!1),[te,se]=d.useState(!1),[ae,X]=d.useState(s),ee=d.useMemo(()=>Bz(r),[r]);d.useEffect(()=>{X(R&&te||s)},[R,te,s]);const le=De=>{(!R||!te)&&(se(!0),setTimeout(()=>se(!1),$_e),f(De)),F&&(Y(!0),setTimeout(()=>Y(!1),G_e))},re=!!t,ce=d.useMemo(()=>z(g,"font-sans focus:outline-none outline-none outline-transparent transition duration-300 ease-out select-none items-center relative group/button font-semimedium",{"justify-center text-center items-center":i==="center","justify-start":i==="left","rounded-none":b,"rounded-lg":!v&&!b,"rounded-full":v&&!b,"cursor-default opacity-50":ae,"cursor-pointer active:scale-[0.97] active:duration-150 active:ease-outExpo origin-center":!ae,"whitespace-nowrap":u,"break-words":!u,"flex w-full":o,"inline-flex":!o&&!a,"flex w-full md:inline-flex md:w-auto":a,[ee.text]:!0,[ee.height]:!0,[ee.padding]:re,[v?"aspect-square":"aspect-[9/8]"]:!re&&!T&&!E&&!(y&&M)}),[E,ee,T,ae,g,o,a,re,y,i,M,b,u,v]),ue=d.useMemo(()=>z("flex items-center min-w-0 gap-two",{"flex-col":i==="stacked","justify-center":i==="center","justify-left":i==="left","justify-between":i==="split","w-full":o,"gap-sm":i==="stacked"}),[o,i]),me=d.useMemo(()=>i==="stacked"||r===Ht.regular&&!re||r===Ht.large&&re?16:14,[i,r,re]),we=l.jsxs("div",{className:ue,style:{maxWidth:D},children:[M&&l.jsx("div",{children:M}),k&&l.jsx(t9,{buttonSize:r,children:I==="spin"?l.jsx(Gl,{size:me}):I==="pulse"?l.jsx("div",{className:z("relative flex items-center justify-center",U==="primary"?"text-inverse":"text-super"),children:l.jsxs("div",{className:"relative scale-[0.8]",children:[l.jsx(gp,{icon:B("circle-filled"),buttonSize:r}),l.jsx(gp,{icon:B("circle-filled"),buttonSize:r,iconClassName:"duration-1200 absolute inset-0 animate-ping"})]})}):null}),!k&&y&&l.jsx(t9,{buttonSize:r,children:l.jsx(gp,{icon:y,showClicked:Q,buttonSize:r,iconClassName:x})}),t&&l.jsx("div",{className:z("relative truncate text-center",{"px-1":!$,"leading-loose":i!=="stacked","leading-none":i==="stacked"},ee.baselineShift,n),children:t}),E&&l.jsxs("span",{children:[" · ",E]}),T&&l.jsx(ge,{size:"xs",icon:j,className:"shrink-0 opacity-50"}),N]});let ye;y&&!t&&_&&(ye=_);const _e=d.useMemo(()=>({WebkitTapHighlightColor:"transparent"}),[]);let ke;return p!==void 0?ke=l.jsx(yt,{"data-testid":P,role:"button","aria-label":L??ye,href:p,className:ce,target:h,onClick:f,onMouseDown:m,style:_e,...H,ref:G,children:we}):ke=l.jsx("button",{"data-testid":P,"aria-label":L??ye,type:c,disabled:ae,onClick:le,onMouseDown:m,className:ce,...H,ref:G,children:we}),w||_?l.jsx(Io,{tooltipText:_??"",keyboardShortcut:w,tooltipLayout:S,...C,asChild:!0,children:ke}):ke});H4.displayName="ButtonBase";const st=d.memo(({variant:e="common",noPadding:t,noXPadding:n,extraCSS:r,...s})=>{const o=d.useMemo(()=>z("focus-visible:bg-subtle",{"!p-0 !h-auto hover:!bg-transparent":t},{"!px-0 hover:!bg-transparent":n},{super:"hover:bg-subtle text-super dark:hover:bg-subtle",primary:"hover:bg-subtle text-foreground dark:hover:bg-subtle",common:"hover:bg-subtle text-quiet hover:text-foreground dark:hover:bg-subtle",positive:"text-quiet hover:bg-subtle hover:text-super",positiveSelected:"text-super hover:bg-subtle hover:text-super",negative:"text-quiet hover:bg-subtle hover:text-caution",negativeSelected:"text-caution dark:text-caution hover:bg-subtle hover:text-caution",noBackground:"text-quiet hover:text-foreground",noHover:"text-quiet cursor-default",subtle:"text-foreground bg-subtle"}[e],r),[r,e,t,n]);return l.jsx(H4,{testId:s.testId,extraCSS:o,...s})});st.displayName="TextButton";const Xl=A.memo(({children:e,portalTarget:t})=>{const[n,r]=d.useState(!1);return d.useEffect(()=>(r(!0),()=>r(!1)),[]),n?zh.createPortal(e,t||document.body):null});Xl.displayName="Portal";const qc=A.memo(({keyProp:e=0,message:t,variant:n,description:r,ctaText:s,ctaOnClick:o,closeOnCtaClick:a=!0,isVisible:i=!1,timeout:c,handleClick:u,handleClose:f,onTimeout:m=Ao,position:p="top",iconOverride:h,...g})=>{const[y,x]=d.useState(i);d.useEffect(()=>{x(i)},[i]);const v=c!=null&&c>0;d.useEffect(()=>{let S;return i&&v&&(S=setTimeout(()=>{x(!1),m()},c*1e3)),()=>{clearTimeout(S)}},[y,c,i,m,v]);const b=d.useCallback(()=>{x(!1),f?.()},[f]),_=d.useCallback(()=>{o?.(),a&&b()},[o,b,a]),w=d.useMemo(()=>{if(h)return h;switch(n){case"success":return B("circle-check");case"error":return B("alert-circle");case"refresh":return B("refresh");case"warning":return B("alert-circle")}},[h,n]);return l.jsx(Xl,{children:l.jsx("div",{className:z(`right-toastHMargin erp-sidecar:top-[114px] fixed ${p==="top"?"top-toastVMargin":"bottom-toastVMargin"} z-30 flex items-center justify-center`,{"cursor-pointer":u}),children:l.jsx(V4,{isVisible:y,animationType:"slide",side:"right",children:l.jsx("div",{...g,children:l.jsxs(K,{variant:"raised",className:z("gap-x-sm p-md shadow-overlay flex items-center rounded-lg",{"cursor-pointer":n==="refresh"}),onClick:u??Ao,children:[l.jsx(K,{variant:"subtler",className:"p-sm dark:bg-subtle rounded-md",children:l.jsx(V,{variant:"smallBold",color:n==="error"?"red":n==="warning"?"yellow":"super",children:l.jsx(rn,{icon:w,size:"small"})})}),l.jsxs(K,{className:"flex-1",children:[l.jsx(V,{variant:"small",color:"default",children:t}),r&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"mt-1 whitespace-pre-line",children:r})]}),s&&o&&l.jsx(st,{text:s,variant:"subtle",onClick:_,size:"small",extraCSS:"ml-xl"}),!v&&l.jsx(st,{variant:"primary",size:"tiny",icon:B("x"),onClick:b,extraCSS:"ml-sm",noPadding:!0})]})},e)})})})});qc.displayName="Toast";const q_e=({fileRepoInfo:e,collectionSlug:t,onClose:n})=>{const r="upload-progress-toast",{$t:s}=J(),o=Rn(),{total:a,pending:i,errors:c,isFinished:u}=R_e({fileRepoInfo:e,reason:r,enablePolling:!0}),f=s({defaultMessage:"See files",id:"p+DFrrlLh2"}),m=d.useCallback(()=>{switch(e.file_repository_type){case"USER":o.push("/account/files");break;case"ORG":o.push("/account/org/files");break;case"COLLECTION":if(!t){Hc.error("Collection slug is not set",{fileRepoInfo:e});return}o.push(`/spaces/${t}?showUploadModal`);break;default:Hc.warn("Unsupported file repository type",{fileRepoInfo:e})}},[e,o,t]);if(!a)return null;if(u){const y=s({defaultMessage:"{total, number} files synced",id:"1rpVYk4ZN/"},{total:a}),x=s({defaultMessage:"Ready to search",id:"n813XUWD4Q"});return l.jsx(qc,{message:y,description:x,variant:"success",iconOverride:B("circle-check"),ctaText:f,ctaOnClick:m,isVisible:!0,handleClose:n,timeout:null})}const p=Math.round((a-i)/a*100),h=s({defaultMessage:"Syncing {total, plural, one {# file} other {# files}}",id:"bAaiOcNQKr"},{total:a}),g=isNaN(p)?"":c===0?s({defaultMessage:"{percentage, number}% complete",id:"1rUNFit3re"},{percentage:p}):s({defaultMessage:"{percentage, number}% complete with {errors, plural, one {# error} other {# errors}}",id:"WewISkdOck"},{percentage:p,errors:c});return l.jsx(qc,{message:h,description:g,variant:"success",iconOverride:B("refresh"),ctaText:f,ctaOnClick:m,closeOnCtaClick:!1,isVisible:!0,handleClose:n,timeout:null})},ol=(e,t)=>e.file_repository_type===t.file_repository_type&&e.owner_id===t.owner_id,K_e=e=>{const t=e.filter(s=>s.status==="uploading").length,n=e.filter(s=>s.status==="failed").length;return{total:e.length,pending:t,errors:n}},Uz=Ft("UploadProgressContext",null),Vz=()=>{const e=d.useContext(Uz);if(!e)throw new Error("useUploadProgress must be used within an UploadProgressProvider");return e},Hz=A.memo(({children:e})=>{const[t,n]=d.useState([]),r=d.useCallback(({fileRepoInfo:x,collectionSlug:v})=>{n(b=>b.some(w=>ol(w.fileRepoInfo,x)&&w.collectionSlug===v)?b:[...b,{id:b.length+1,fileRepoInfo:x,collectionSlug:v,localFileUploads:[],progressBarVisible:!1}])},[]),s=d.useCallback(x=>{n(v=>v.filter(b=>b.id!==x))},[]),o=d.useCallback(x=>t.some(v=>ol(v.fileRepoInfo,x)),[t]),a=d.useCallback(({fileRepoInfo:x,visible:v})=>{n(b=>b.map(_=>ol(_.fileRepoInfo,x)?{..._,progressBarVisible:v}:_))},[]),i=d.useCallback(({fileRepoInfo:x,fileId:v})=>{n(b=>b.map(_=>ol(_.fileRepoInfo,x)?{..._,localFileUploads:[..._.localFileUploads,{fileId:v,status:"uploading"}]}:_))},[]),c=d.useCallback(x=>{n(v=>v.map(b=>ol(b.fileRepoInfo,x)?{...b,localFileUploads:[]}:b))},[]),u=d.useCallback(({fileRepoInfo:x,fileId:v,status:b})=>{n(_=>_.map(w=>{if(!ol(w.fileRepoInfo,x))return w;const S=w.localFileUploads.map(C=>C.fileId===v?{...C,status:b}:C);return{...w,localFileUploads:S}}))},[]),f=d.useCallback(({fileRepoInfo:x,fileId:v})=>{n(b=>b.map(_=>{if(!ol(_.fileRepoInfo,x))return _;const w=_.localFileUploads.filter(S=>S.fileId!==v);return{..._,localFileUploads:w}}))},[]),m=d.useCallback(x=>{const v=t.find(b=>ol(b.fileRepoInfo,x));return v?K_e(v.localFileUploads):{total:0,pending:0,errors:0}},[t]),p=d.useMemo(()=>({startMonitoring:r,isMonitoryingFileRepository:o,setProgressBarVisible:a,addLocalFileUpload:i,updateLocalFileUploadStatus:u,removeLocalFileUpload:f,clearLocalFileUploads:c,getLocalProgress:m}),[r,o,a,i,u,f,c,m]),h=t.at(-1),g=h&&!h.progressBarVisible,y=d.useCallback(()=>{h?.id&&s(h.id)},[h?.id,s]);return l.jsxs(Uz.Provider,{value:p,children:[e,g&&h&&l.jsx(q_e,{fileRepoInfo:h.fileRepoInfo,collectionSlug:h.collectionSlug,onClose:y})]})});Hz.displayName="UploadProgressProvider";const Si="__temp__",n9=10,Y_e=async(e,t)=>{const s=new FormData;Object.entries(t.fields).forEach(([a,i])=>{s.append(a,i)}),s.append("file",e);let o=null;for(let a=0;a<1;a++)try{a>0&&await new Promise(c=>setTimeout(c,2e3));const i=await fetch(t.s3_bucket_url,{method:"POST",body:s});if(Z.info("S3 upload response received",{fileUrl:t.s3_bucket_url,fileUuid:t.file_uuid,status:i.status,statusText:i.statusText,ok:i.ok}),!i.ok)throw new Error(`HTTP error ${i.status}: ${i.statusText}`);return}catch(i){o=i instanceof Error?i:new Error(String(i)),Z.error("S3 upload error",{fileUuid:t.file_uuid,attempt:a,errorMessage:o.message,errorName:o.name,errorStack:o.stack})}throw new Error(`UPLOAD_FAILED after 1 attempts: ${o?.message||"Unknown error"}`)},Q_e=({fileRepoInfo:e,setTotalFilesUploading:t,replaceExisting:n,reason:r,onLocalFileUploadSuccess:s})=>{const{$t:o}=J(),a=Yt(),i=x4(),c=ou(),u=Array.isArray(c?.slug)?c.slug[0]:c?.slug,f=u?na(u):void 0,{openToast:m}=hn(),{session:p}=Ne(),h=p?.user?.email??"",g=Ea({reason:r}),{addLocalFileUpload:y,updateLocalFileUploadStatus:x}=Vz(),v=_4(e),b=be.makeQueryKey("list_file_directory_infinite",e.file_repository_type,e.owner_id),_=e.file_repository_type==="USER"||e.file_repository_type==="ORG"||e.file_repository_type==="COLLECTION"&&!!e.owner_id&&e.owner_id!==Si;return{...Rt({mutationFn:async S=>{if(!_){m({message:o({defaultMessage:"Unable to upload files.",id:"GrtfijFWiu"}),variant:"error",timeout:3});return}t(S.length);const C=new Map;S.forEach(E=>{const T=crypto.randomUUID();C.set(E.name,T),y({fileRepoInfo:e,fileId:T})});for(let E=0;E({filename:D.name,content_type:D.type,file_size:D.size})),file_repository_info:e},reason:r}),I=k.limits_reached[0];if(I==="FILE_REPOSITORY_LIMIT_EXCEEDED"){const D=g.connectorLimits?.repo_type_limits?.[e.file_repository_type].max_files??g.maxFilesPerRepository;m({message:o({defaultMessage:"You have reached the file limit of {limit} files per repository.",id:"J0uyf2gB1u"},{limit:D}),variant:"error",timeout:3});break}else if(I==="USER_FILE_LIMIT_EXCEEDED"){const D=g.maxFilesPerUser;m({message:o({defaultMessage:"You've reached your total file limit of {limit} files across My Files and all Spaces. Delete some files or upgrade your plan to add more",id:"3CuAQ4xs/C"},{limit:D}),variant:"error",timeout:3});break}const N=(await Promise.allSettled(k.file_url_params.map((D,j)=>D&&T[j]?{fileUploadUrlInfo:D,file:T[j]}:null).filter(D=>D!==null).map(async({fileUploadUrlInfo:D,file:j})=>{const F=C.get(j.name);try{return await Y_e(j,D),Z.info("S3 upload completed successfully",{fileUuid:D.file_uuid}),{file_s3_url:D.s3_object_url,filename:j.name,file_size:j.size,file_uuid:D.file_uuid,replace_existing:n}}catch(R){F&&x({fileRepoInfo:e,fileId:F,status:"failed"});const P=R instanceof Error?{message:R.message,name:R.name,stack:R.stack}:{error:String(R)};throw Z.error("Upload promise caught error",{fileUuid:D.file_uuid,...P}),m({message:o({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),R}}))).filter(D=>D.status==="fulfilled").map(D=>D.value);if(Z.info("Starting file indexing",{fileCount:N.length,fileUuids:N.map(D=>D.file_uuid)}),N.length>0&&(await Dz({request:{file_repository_info:e,file_index_params:N},reason:r}),N.forEach(D=>{const j=C.get(D.filename);j&&x({fileRepoInfo:e,fileId:j,status:"success"})})),k.limits_reached.length>0)break}},onMutate:async S=>{await a.cancelQueries({queryKey:v});const C=a.getQueryData(v),E=S.map(T=>({name:T.name,file_s3_url:"",file_title:null,file_description:null,file_uuid:crypto.randomUUID(),uploadedBy:h,state:"PROCESSING",size:T.size,date:new Date().toLocaleString(),isOptimistic:!0}));return a.setQueriesData({queryKey:v},T=>T&&{...T,processingFiles:[...T.processingFiles||[],...E]}),{previousData:C,optimisticFiles:E,uploadedFilesCount:S.length}},onError:(S,C,E)=>{m({message:o({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),E?.previousData&&a.setQueriesData({queryKey:v},E.previousData)},onSettled:()=>{a.invalidateQueries({queryKey:v}),a.invalidateQueries({queryKey:b}),a.invalidateQueries({queryKey:be.makeQueryKey(l3)}),a.invalidateQueries({queryKey:be.makeQueryKey(c3)}),e.file_repository_type==="ORG"&&a.invalidateQueries({queryKey:i}),u&&a.invalidateQueries({queryKey:f})},onSuccess:()=>{s?.()}}),isUploadEnabled:_}},X_e=async({thread_uuid:e,format:t,filename:n,reason:r})=>{const{data:s,error:o,response:a}=await de.POST("/rest/thread/export",r,{body:{thread_uuid:e,format:t,filename:n},timeoutMs:Qe({productionMs:Cn.VERY_HIGH,clientSideMs:Cn.VERY_HIGH,devMs:Cn.VERY_HIGH})});if(o)throw new he("API_CLIENTS_ERROR",{message:"Failed to export thread",cause:o,status:a.status??0});return s},Cvt=async(e,t)=>{const{error:n,response:r}=await de.PUT("/rest/thread/{entry_uuid_or_slug}","remove-thread-expiry",{params:{path:{entry_uuid_or_slug:e}},body:{expired:!1}});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to remove thread expiry",cause:n,status:r.status??0})},Z_e=({fileRepoInfo:e,fileExists:t,reason:n})=>{const{openToast:r}=hn(),{session:s}=Ne(),o=d.useMemo(()=>s?.user?.email??"",[s]),a=Yt(),{mutate:i}=Q_e({fileRepoInfo:e,setTotalFilesUploading:()=>1,replaceExisting:t,reason:n}),{mutateAsync:c}=k_e({fileRepositoryType:e.file_repository_type,offset:0,searchTerm:"",ownerId:e.owner_id,reason:n}),u=d.useCallback(async(m,p)=>{try{if(!m||!p)return;const h=await X_e({thread_uuid:m,format:"md",filename:p,reason:n}),g=atob(h.file_content_64),y=new Array(g.length);for(let _=0;_{try{const h=(await e2({fileRepositoryType:e.file_repository_type,limit:10,offset:0,searchTerm:"",email:o,ownerId:e.owner_id,reason:n}))?.completedFiles.find(g=>g.name.includes(m??""));if(!h?.file_uuid)return;await c([h.file_uuid]),a.setQueryData(eh(e.owner_id,m),!1),r({message:"File removed from space",variant:"success",timeout:3})}catch(p){r({message:`Failed to remove from space: ${p}`,variant:"error",timeout:3})}},[c,r,a,e.owner_id,o,n,e.file_repository_type]);return d.useMemo(()=>({saveThreadToSpace:u,removeThreadFromSpace:f}),[f,u])},J_e=/^\/b\//;function zz(e){return e&&J_e.test(e)}function ewe(e){return e?new URL(window.location.href).pathname.endsWith(`/search/${e}`):!1}function twe(e){return e?.startsWith("/collections")||e?.startsWith("/spaces")}const Wz=({serverName:e,iconUrl:t,size:n="md",border:r=!1})=>t?l.jsx("img",{src:t,alt:`${e} Logo`,className:z("object-contain",n==="sm"&&"size-5",n==="md"&&"p-xs size-12",r&&"ring-subtlest rounded-md ring-1")}):l.jsx(ut,{name:B("box"),className:z(n==="sm"&&"size-4",n==="md"&&"p-xs size-12",r&&"ring-subtlest rounded-md ring-1")}),nwe=()=>typeof window<"u"&&window.location?.origin?window.location.origin:"https://www.perplexity.ai",r9=e=>{const t=nwe();return Ux(`${t}${e}`)?.href||`${t}${e}`},rwe=()=>[{id:"imessage",icon_url:r9("/static/mcpb/imessage.png"),download_url:r9("/static/mcpb/imessage_v0.0.10.mcpb"),manifest:{$schema:"https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",dxt_version:"0.1",name:"imessage",display_name:"Messages",version:"0.0.10",description:"Send and read messages using Apple's Messages app",long_description:`This tool lets Perplexity work with your Mac's Messages app. You can send messages, read messages, and ask Perplexity to help you understand what's important. - -It uses Mac system features to connect to Messages. Your Mac will ask for permission before it can access Messages or Contacts. This is not made by Apple.`,license:"MIT",author:{name:"Perplexity Inc",email:"support@perplexity.ai",url:"https://www.perplexity.ai/"},homepage:"https://www.perplexity.ai/",icon:"icon.png",tools:[{name:"list_contacts",description:'List contacts. When query is provided, search for contacts by name. Use it first to get a handle id, phone numbers, or emails. This tool is more preferred to be used first than "list_chats" tool. If this tool returns empty results, try to use "list_chats" tool to find a contact.'},{name:"list_chats",description:"List chats from Messages. When query is provided, search for chats by phone number (preferrable) or chat name (if phone number is not available)."},{name:"create_chat",description:"Create a new chat with a specific contact"},{name:"read_chat",description:"Read Messages from a specific chat"},{name:"send_imessage",description:"Send a Message to specific chat"}],server:{type:"node",entry_point:"server/index.js",mcp_config:{command:"node",args:["${__dirname}/server/index.js"],env:{HOME:"${HOME}"}}},compatibility:{comet:">=139.0.0",platforms:["darwin"],runtimes:{node:">=22.0.0"},permissions:{full_disk_access:!0,contacts:{for_tools:["list_contacts"]}}}}}],z4=()=>{const e=Qn(),t=d.useMemo(()=>{if(!e.platformInfo)return;const{isMac:n,isWindows:r,isLinux:s}=e.platformInfo;if(n)return"darwin";if(r)return"win32";if(s)return"linux"},[e.platformInfo]);return mt({queryKey:be.makeQueryKey("comet/available_dxts",t),queryFn:async()=>rwe().filter(n=>n.manifest.compatibility?.platforms?t&&n.manifest.compatibility.platforms.includes(t):!0)})},Gz=(e,t)=>t.dxt_name?e?.find(n=>n.id===t.dxt_name)?.icon_url:void 0,$z=e=>Object.fromEntries(Object.entries(e.compatibility?.permissions??{}).filter(([t,n])=>!!n).map(([t,n])=>typeof n=="object"?[t,n]:[t,{}])),v3=e=>Object.entries($z(e)).filter(([,{for_tools:t}])=>!t).map(([t])=>t),swe=({cometState:e})=>d.useMemo(()=>{if(!e.installedDxts)return[];const t=e.installedDxts.flatMap(({manifest:n})=>v3(n));return Array.from(new Set(t))},[e.installedDxts]),owe=Ce(async()=>{const{AskPermissionsModal:e}=await Se(()=>q(()=>import("./AskPermissionsModal-D80mi85i.js"),__vite__mapDeps([122,4,1,6,3,9,7,8,10,11,12])));return{default:e}}),Nf=()=>{const e=Qn(),{openModal:t}=Uo(),{data:n}=z4(),r=swe({cometState:e}),s=un(),o=iM({queries:r.map(v=>({queryKey:be.makeQueryKey("comet/permission",v),queryFn:()=>s.hasPermission(v)}))}).map(v=>v.data),i=d.useMemo(()=>{let v;return b=>(Un(v,b)||(v=b),v)},[])(o),c=d.useMemo(()=>new Set(e.mcpStdioServers?.filter(v=>{const b=dp(e.installedDxts,v);return(b?v3(b):[]).some(S=>{const C=r.indexOf(S);return C!==-1&&i[C]===!1})}).map(v=>v.name)),[e.mcpStdioServers,e.installedDxts,r,i]),u=d.useMemo(()=>Object.fromEntries(e.mcpStdioServers?.map(v=>{const b=dp(e.installedDxts,v),_=Gz(n,v),w=b?.display_name??b?.name??v.name,S=c.has(v.name);return[v.name,{icon:void 0,avatar:l.jsx(Wz,{serverName:w,iconUrl:_,size:"sm"}),text:w,disabled:v.status!=="running"||!v.tools_count||S,description:"",type:"toggle",iconUrl:_}]})??[]),[e.mcpStdioServers,e.installedDxts,n,c]),f=d.useCallback((v,b)=>{if(!c.has(v)){b();return}const _=e.mcpStdioServers?.find(S=>S.name===v);if(!_)return;const w=dp(e.installedDxts,_);w&&t(owe,{serverName:v,permissions:v3(w),onPermissionsGranted:b,legacyIdentifier:"__NONE__"})},[e.mcpStdioServers,e.installedDxts,c,t]),m=d.useCallback(v=>{const b=new Set(e.mcpStdioServers?.map(_=>_.name)??[]);v.forEach(_=>b.delete(_)),e.actions.setMcpDisabledServers(b)},[e.actions,e.mcpStdioServers]),p=d.useCallback(v=>{f(v,()=>{const _=e.mcpDisabledServers??new Set,w=new Set(_);_.has(v)?w.delete(v):w.add(v),e.actions.setMcpDisabledServers(w)})},[e.actions,e.mcpDisabledServers,f]),h=d.useCallback(v=>{f(v,()=>{const _=e.mcpDisabledServers??new Set,w=new Set(_);w.delete(v),e.actions.setMcpDisabledServers(w)})},[e.actions,e.mcpDisabledServers,f]),g=d.useCallback(v=>{const b=e.mcpDisabledServers??new Set,_=new Set(b);_.add(v),e.actions.setMcpDisabledServers(_)},[e.actions,e.mcpDisabledServers]),y=d.useMemo(()=>new Set([...e.mcpDisabledServers??[],...c]),[e.mcpDisabledServers,c]),x=d.useCallback(v=>v in u&&!y?.has(v),[u,y]);return d.useMemo(()=>({cometMcpSources:u,setCometMcpSources:m,toggleCometMcpSource:p,addCometMcpSource:h,removeCometMcpSource:g,hasCometMcpSource:x,cometMcpDisabledServers:y}),[u,m,p,h,g,x,y])},P0={startTime:-1,timer:Wa()},Ru={startTime:-1,modules:new Set},Gx=Ft("PerformanceContext",{markTTV:()=>{},addPageTiming:()=>{},getPageStartTime:()=>0,getPageTimer:()=>Wa(),addPageTimingOnce:()=>{}});function awe({children:e}){const{startTimeFromTimeOriginRef:t}=Rn(),{markTTV:n}=Sfe(),r=d.useCallback(()=>(P0.startTime!==t.current&&(P0.startTime=t.current,P0.timer=Wa(void 0,{nowFromTimeOrigin:t.current})),P0.timer),[t]),s=d.useMemo(()=>({markTTV:()=>n(t.current),addPageTiming:(o,a={})=>r().addTiming(o,a),addPageTimingOnce:(o,a={})=>r().addTimingOnce(o,a),getPageStartTime:()=>t.current,getPageTimer:r}),[n,t,r]);return l.jsx(Gx.Provider,{value:s,children:e})}function W4(){const{getPageStartTime:e}=d.useContext(Gx);return e}function iwe(){const{getPageTimer:e}=d.useContext(Gx);return e}const qz=Ft("PagePerformanceContext",{markTTV:()=>{}});function s9({children:e,modules:t}){const{markTTV:n,addPageTimingOnce:r,getPageStartTime:s}=d.useContext(Gx),o=s(),a=d.useCallback(c=>{t.includes(c)&&(Ru.startTime!==o&&(Ru.startTime=o,Ru.modules=new Set),!Ru.modules.has(c)&&(r(`web.ttv.${c}`),Ru.modules.add(c),t.every(u=>Ru.modules.has(u))&&n()))},[r,o,t,n]),i=d.useMemo(()=>({markTTV:a}),[a]);return l.jsx(qz.Provider,{value:i,children:e})}function lwe(){const{markTTV:e}=d.useContext(qz);return e}function Rf(e,t={}){const n=lwe();d.useEffect(()=>{t.skip||n(e)},[n,e,t.skip])}function $x(){const{isEnterprise:e}=mo({reason:"max-tier"}),{value:t,loading:n}=zt({flag:"max-upsell",defaultValue:!1,subjectType:"visitor_id",extraAttributes:{isEnterprise:e??!1}});return d.useMemo(()=>({isMaxUpsellEnabled:e?!0:t,loading:n}),[t,n,e])}function el(){const{firstResult:e}=on();return e?.read_write_token}const o9=(e,t,n)=>{e.addTimingOnce(t,{source:"comet_extension",...n})},Kz=()=>{const e=An(),t=un(),n=c4(),r=d.useCallback(s=>{const o=!!s.last_backend_uuid;return an(s.model_preference)===oe.RESEARCH||(an(s.model_preference),oe.STUDIO),(s.sources?.some(i=>i==="web")??!0)&&e&&!o&&!1},[e]);return d.useCallback((s,o,a)=>{if(!s||!r(o))return;const i=n(a);i&&(o9(i,"web.frontend.comet_navigation_request_sent_ms"),t.injectSearchResults(s,a,{},c=>{o9(i,"web.frontend.comet_navigation_results_received_ms",{count:c.count})}))},[t,r,n])},cwe="pplx_backend_flag_overrides",uwe=()=>{try{const e=mr(cwe);return e?JSON.parse(e):{}}catch{return{}}},dwe=e=>{try{return new URL(e),!0}catch{return!1}},fwe=({isCometBrowser:e,isMobile:t,isWindowsApp:n,clientPayloadUUID:r})=>e?{source:lV(),client_payload_cache_key:r}:{source:BS(t,n)},mwe=({inPageOverride:e,dslQuery:t,existingEntryUUID:n,existingUuid:r,deletedUrls:s,redoSearch:o,collection:a,isRelatedQuery:i,isSponsored:c,relatedQueryUUID:u,inDomain:f,inPage:m,newFrontendContextUUID:p,promptSource:h,querySource:g,timeFromFirstType:y,utmSource:x,disableWidgets:v,isNavSuggestionsDisabled:b,entropyBrowser:_,clientPayloadUUID:w,isIncognito:S,modelPreferenceSubmit:C,lastBackendUUID:E,deviceLocation:T,newAttachments:k,threadMetadataRwToken:I,forceNew:M,finalSources:N,finalRecency:D,mode:j,frontendUUID:F,isWindowsApp:R,isMobile:P,browserHistorySummaryNumDays:L,mentions:U,reason:O,side_by_side_metadata:$,skipSearchEnabled:G,browserHistorySummaryMaxResults:H,sidecarTabId:Q,sidecarUrl:Y,sidecarTitle:te,sidecarSecondaryTabId:se,sidecarSecondaryUrl:ae,sidecarSecondaryTitle:X,isFirstEntry:ee,alwaysSearchOverride:le,overrideNoSearch:re,cometIsMissionControl:ce,mcpTools:ue,refinementFiltersMetadata:me,browserAgentAllowOnceFromToggle:we,forceEnableBrowserAgent:ye,inlineMode:_e,canonicalPageContext:ke})=>{const De=T?{location_lat:T.latitude,location_lng:T.longitude}:null,Ue=Ga().erp,Ee=Ca(),Ke=uwe();Object.keys(Ke).length>0&&Z.info("Sending backend flag overrides to API",{overrideCount:Object.keys(Ke).length,flagKeys:Object.keys(Ke),flagValues:Ke});const Nt=fwe({isCometBrowser:Ee,isMobile:P,isWindowsApp:R,clientPayloadUUID:w});let pe=!1,ve="",Ae="",We,pt=!1,Gt;pt=!0,Gt=g==="followup"?"followup-sidecar":"sidecar";const Le=_e;let gt=S,Je;if(Ee){Je={rendering_place:Ue,sidecar_tab_id:Q,sidecar_url:Y,sidecar_title:te,sidecar_secondary_tab_id:se,sidecar_secondary_url:ae,sidecar_secondary_title:X};const Me=xM(),Ve=_.isAgentAvailable();if(pe=Ve&&!Me,Ve?Me&&Z.info("[comet] Local search disabled - incognito mode",{reason:"incognito_mode",frontendUUID:F}):Z.info("[comet] Local search disabled - agent not available",{reason:"agent_not_available",frontendUUID:F}),ee&&(Ae=_.getLastOmniboxInput(F)??"",Me||(ve=she({entropyBrowser:_,browserHistorySummaryNumDays:L,browserHistorySummaryMaxResults:H,reason:O}))),g==="default_search"&&(dwe(Ae)&&(pe=!1,Gt="default_search",Z.info("[comet] Local search disabled due to URL input in omnibox",{lastOmniboxInput:Ae})),!Ae)){const lt=Ux(document.referrer);(!lt||lt.origin!==location.origin||lt.pathname!=="/.well-known/comet-omnibox-text"&<.pathname!=="/onboarding-comet")&&(pe=!1,Gt="default_search",Z.info("[comet] Local search disabled due to unsecure referer",{lastOmniboxInput:Ae,parsedReferrer:lt}))}}else g==="default_search"&&(We="external_url");return{last_backend_uuid:E??void 0,read_write_token:M?void 0:I,existing_entry_uuid:M?void 0:n,deleted_urls:s??void 0,attachments:k,language:GU(),timezone:mM,in_page:e??m,in_domain:f,search_focus:N.length===0?"writing":"internet",sources:N,search_recency_filter:D,frontend_uuid:r??F,redo_search:o,mode:j,target_collection_uuid:a?.uuid,model_preference:C??void 0,is_related_query:i??!1,is_sponsored:c??!1,related_query_uuid:u,frontend_context_uuid:p??void 0,prompt_source:h??void 0,query_source:Gt??g??"",browser_history_summary_key:ve||void 0,is_incognito:gt,time_from_first_type:y??void 0,local_search_enabled:pe,use_schematized_api:!0,send_back_text_in_streaming_api:!1,supported_block_use_cases:kV,utm_source:x,client_coordinates:De,mentions:U,dsl_query:t,skip_search_enabled:G,is_nav_suggestions_disabled:b||pt,...g==="followup"?{followup_source:"link"}:{},...Nt,...v?{disable_widgets:v}:{},always_search_override:le??!1,override_no_search:re??!1,comet_info:Je,...$&&{side_by_side_metadata:$},client_search_results_cache_key:Ee&&F?`nav-${F}`:void 0,comet_is_mission_control:ce,mcp_tools:ue,risky_query_source:We,should_ask_for_mcp_tool_confirmation:!0,refinement_filters_metadata:me,experiment_overrides:Object.keys(Ke).length>0?Ke:void 0,browser_agent_allow_once_from_toggle:we,force_enable_browser_agent:ye,supported_features:["browser_agent_permission_banner_v1.1"],...Le,canonical_page_context:ke}},pwe=async({reason:e})=>{try{const{data:t,error:n}=await de.POST("/rest/incentives/comet-activation",e,{timeoutMs:Qe()});if(n)throw n;return t}catch(t){return Z.error("Failed to handle comet activation incentive",t),null}},hwe=async({eventName:e,isDeferred:t,clickId:n,nextauthUserId:r,reason:s})=>{try{const{data:o,error:a,response:i}=await de.POST("/rest/attribution/dub/lead",s,{timeoutMs:Qe(),body:{event_name:e,is_deferred:t,click_id:n,nextauth_user_id:r}});if(a)throw new he("API_CLIENTS_ERROR",{cause:a,status:i.status??0});return{success:o?.success??!1}}catch(o){return Z.error("Failed to save post install redirect",o),{success:!1}}},gwe=async({reason:e,flowType:t,trialExtensionId:n})=>{try{const{error:r,response:s}=await de.POST("/rest/attribution/comet/1mo-promo/mark-eligible",e,{timeoutMs:Qe(),body:{flow_type:t,trial_extension_id:n}});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){Z.error("Failed to mark user as eligible for Comet 1mo promo",r)}},ywe=()=>_a.setItem("signUpBannerDismissed","reset"),xwe=2,vwe=10,bwe=({response:e,isUserLoggedIn:t,submissionCount:n,session:r,queryCountMobile:s,isWindowsApp:o,addKeyRequiringRerender:a,setSubmissionCount:i,trackEvent:c,setShouldShowProductFeedback:u,setFeedbackEntryUUID:f,setShouldShowRecruitmentBanner:m,sendQueryEventSingular:p,maybeSendNthQueryEventSingular:h,recruitmentBannerEnabled:g,reason:y})=>{const x=Ca();if(x&&Efe(t),e?.backend_uuid){const b=e.backend_uuid;Ege({entryUUID:e.backend_uuid,params:{query:e.query_str||"",sources:e.sources?.sources??[]},reason:y}).then(_=>{u(_),_&&c("query feedback shown",{entry_uuid:b})}),g&&Tge({entryUUID:b,reason:y}).then(_=>{m(_),_&&c("power user recruitment banner shown",{})}),f(b)}!t&&n===xwe-1&&(ywe(),a("floating-signup")),t&&r?.user?.id&&s===0&&n===vwe-1&&a("floating-mobile-download"),o?a("floating-milestone-refetch-legacy"):t&&a("floating-milestone-refetch"),i(n+1),p(),h({isCometBrowser:x});const v=_U();x&&v===1?(hwe({eventName:"activated",isDeferred:!1,clickId:null,nextauthUserId:r?.user?.id??null,reason:"comet attribution"}),pwe({reason:"comet activation incentive"}),c("first comet query finished",{})):x&&v===3&&c("third comet query finished",{})},_we="pplx.is-incognito";function G4(){const{value:e,setCookie:t}=wU(_we);return d.useMemo(()=>({isIncognitoLocal:e==="true",setIsIncognito:n=>{t(String(n))}}),[e,t])}const t2={DEFAULT:"DEFAULT",GOVERNMENT:"GOVERNMENT"},Yz=({reason:e})=>{const{organization:t}=mo({reason:e}),{isGovernmentRequestOrigin:n}=Yr(),r=t?.settings?.always_incognito,{isIncognitoLocal:s}=G4(),o=r||(s??n??!1),a=n?t2.GOVERNMENT:t2.DEFAULT;return{isIncognito:o,incognitoType:a}},wwe=({inPage:e})=>e?window.getSelection()?.toString():void 0;function Cwe(){const{value:e}=bge({flag:"client-context-max-chars",subjectType:"visitor_id",defaultValue:5e4});return e}const Swe=(e,t,n)=>{const{value:r,loading:s}=n4({flag:"max-file-upload-count",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function $4(){const{variation:e}=Swe(10);return e}const Ewe=({isFollowup:e,isInSameThread:t,sourcesOverride:n,firstResultSources:r,firstResultRecency:s,defaultSources:o,defaultRecency:a})=>n?{finalSources:n,finalRecency:a}:!e||!t?{finalSources:o,finalRecency:a}:{finalSources:Array.isArray(r)?r:[],finalRecency:s},kwe=1e3*60*30,Qz=()=>{const[e,t]=Qi("locationMetadata",void 0),n=d.useCallback((s,o)=>{t({location:s,permissionState:o,updatedAt:Date.now()}),s?(lo("lat",s.latitude.toString()),lo("long",s.longitude.toString())):($p("lat"),$p("long"))},[t]),r=Date.now()-(e?.updatedAt??0)>kwe;return d.useEffect(()=>{if(vt.removeItem("deviceLocation"),!navigator.geolocation||!("permissions"in navigator)||!r)return;const s=()=>{navigator.geolocation.getCurrentPosition(o=>{n({latitude:o.coords.latitude,longitude:o.coords.longitude},"granted")},()=>{n(void 0,"denied")},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})};navigator.permissions.query({name:"geolocation"}).then(o=>{o.state==="granted"?s():n(void 0,o.state),o.addEventListener("change",()=>{o.state==="denied"?n(void 0,"denied"):o.state==="granted"&&s()})}).catch(()=>{})},[n,t,r]),d.useMemo(()=>({location:e?.location,permissionState:e?.permissionState,isPreciseLocationEnabled:e?.permissionState==="granted"&&!isNaN(e?.location?.latitude??0)&&!isNaN(e?.location?.longitude??0)}),[e?.location,e?.permissionState])},yp=/(.*?)<\/q>/s;function qx(e){if(!e)return{quote:null,actualQuery:null};if(!yp.test(e))return{quote:null,actualQuery:e};const r=e.match(yp)?.[1]||null,s=e.replace(yp,"").trim();return{quote:r,actualQuery:s}}function Mwe(e,t){const n=t.trim();return n?yp.test(e)?e.replace(yp,`${n}`):e.length===0?n:`${n} ${e}`:e}const Twe={submitQuery:()=>{Z.error("submitQuery must be used within PerplexityQueryStateProvider")},handleBotStep:()=>{Z.error("handleBotStep must be used within PerplexityQueryStateProvider")},deleteLastResult:()=>{Z.error("deleteLastResult must be used within PerplexityQueryStateProvider")},shouldShowProductFeedback:!1,shouldShowRecruitmentBanner:!1,feedbackEntryUUID:null,quote:null,setQuote:()=>{},updateLocalStatePostStream:()=>{}},Awe=3,Nwe=6,Rwe=2,Xz=Ft("PplxQueryStateContext",Twe),Dwe=(e,t,n,r,s)=>{if(!(n&&!r)&&!(e&&!t))return r?r.backend_uuid:s},jwe=({children:e,shouldFetchSettings:t})=>{const n="perplexity-query-state-provider",r=Rn(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=un(),{location:i}=Qz(),[c,u]=d.useState(null),{device:{isWindowsApp:f,isMobile:m,isSamsungBrowser:p}}=sn(),h=Vo(),g=iwe(),{sources:y,recency:x,isCopilot:v,setAskInputReasoningMode:b,setAskInputReasoningModelPreference:_,configuredModel:w}=Vn(),{specialCapabilities:S}=Yr(),C=el(),{firstResult:E,lastResult:T}=on(),{setCurrentStreamId:k}=Vx(),{hasAiProfile:I,queryCountMobile:M}=Ea({enabled:t,reason:n}),[N,D]=d.useState(!1),[j,F]=d.useState(!1),[R,P]=d.useState(null),L=Wt(),{addKeyRequiringRerender:U}=r4(),{value:O}=zt({flag:"skip-search-button",subjectType:"visitor_id",defaultValue:!1}),$=Cwe(),{isIncognito:G}=Yz({reason:n}),[H,Q]=d.useState(0),{sendQueryEventSingular:Y,maybeSendNthQueryEventSingular:te,sendResurrectedActivationEventSingular:se}=JM(),ae=Qn(),{cometMcpDisabledServers:X}=Nf(),ee=Z0e(),{value:le}=Rx({flag:"power-user-recruitment-banner",defaultValue:!1}),{isMaxUpsellEnabled:re}=$x(),{isMax:ce}=$t(),{value:{max_results:ue,num_days:me}}=wge({flag:"browser-history-summary-settings",defaultValue:{max_results:500,num_days:7}}),we=$4(),ye=Kz(),_e=d.useCallback(({rawQuery:Ee,dslQuery:Ke,fork:Nt,inPageOverride:pe,copilotOverride:ve,existingEntryUUID:Ae,existingUuid:We,deletedUrls:pt,redoSearch:Gt,attachments:Le,collection:gt,modelPreferenceOverride:Je,isRelatedQuery:Me,isSponsored:Ve,relatedQueryUUID:lt,inDomain:xt,inPage:Pt,newFrontendContextUUID:$e,existingFrontendContextUUID:ht,promptSource:Zt,querySource:dt,sourcesOverride:Ct,submitFromArticleOverride:Ot,timeFromFirstType:Qt,utmSource:lr,disableWidgets:Qr,isNavSuggestionsDisabled:tr,deviceLocation:bn,shouldRedirectToBackendUUID:nr,onThreadSlugReceived:Xr,incognitoOverride:Qo,mentions:lc=[],shouldUsePageStartTime:ds,side_by_side_metadata:fe,frontendUUID:Be=crypto.randomUUID(),alwaysSearchOverride:Fe,overrideNoSearch:ct,cometIsMissionControl:it,refinementFiltersMetadata:kt,browserAgentAllowOnceFromToggle:zn,forceEnableBrowserAgent:cr,canonicalPageContext:Wn})=>{if(Ee.trim().length===0&&!c){Z.error("Submit failed: empty query");return}const Xn=lc.filter(Jt=>Jt.type==="tab").map(Jt=>({id:Number(Jt.id),url:Jt.url}));if(!L&&!p&&!S.unlimitedProSearch){const Jt=H+1;m&&!By()?Jt%Rwe===1&&U("visitor-gate"):Jt%Nwe===0?U("visitor-gate-ii"):Jt%Awe===0&&U("visitor-gate")}const Wr=!!$e,Ms=[...new Set([...Le??[]])].slice(0,we).filter(Jt=>!pt?.includes(Jt)),wu=!0,cc=An()&&wu,dm=cc?ua():void 0,v0=(ve??v)||wu,b0="copilot";let Zr=w??ie.DEFAULT;Zr===ie.DEFAULT&&S.unlimitedProSearch&&(Zr=ie.PRO),(h===oe.RESEARCH||h===oe.STUDIO||h===oe.STUDY)&&(Zr=h===oe.RESEARCH?ie.ALPHA:h===oe.STUDIO?ie.BETA:ie.STUDY,re&&ce&&(Zr=w));const fs=b1e.some(Jt=>Jt.is_reasoning_model&&Jt.search_model===Zr);Je?Zr=Je:(b(fs),fs||_(null));const Cu=Dwe(Wr,Nt??!1,E?.backend_uuid===Ae,Ot??null,T?.backend_uuid??null);kfe(),Mfe(()=>{o("resurrected activated"),se()}),an(Zr)===oe.RESEARCH?Tfe():an(Zr)===oe.STUDIO&&Afe();const gi=!!Cu,yi=E?.frontend_context_uuid===ht,fm=Ewe({isFollowup:gi,isInSameThread:yi,sourcesOverride:Ct,firstResultSources:E?.sources?.sources,firstResultRecency:E?.search_recency_filter,defaultSources:y??[],defaultRecency:x??null}),{finalRecency:_0,finalSources:w0}=fm;let mm;ae.mcpTools&&(mm=Object.entries(ae.mcpTools).filter(([Jt])=>!X?.has(Jt)).flatMap(([Jt,ku])=>{const M0=ae.mcpToolsSettings?.[Jt]??{};return ku.filter(uc=>{const T0=uc.tool?.name??uc.id??"",hm=M0[T0];return hm?hm.enabled!==!1:!0})}));const C0=wwe({inPage:pe??Pt})||c,Su=(C0?Mwe(Ee,C0):Ee).trim();if(!Su){Z.error("Submit failed: empty query");return}const xi=Ae==E?.backend_uuid||!Cu,S0=w0e({rawQuery:Su,fork:Nt,existingEntryUUID:Ae,existingUuid:We,collection:gt,isRelatedQuery:Me,newFrontendContextUUID:$e,existingFrontendContextUUID:ht,submitFromArticleOverride:Ot,isNavSuggestionsDisabled:tr,isCopilot:v0,modelPreferenceSubmit:Zr,newAttachments:Ms,firstResultFrontendContextUUID:E?.frontend_context_uuid,isPersonalized:I,forceNew:Wr,querySource:dt,lastResultBackendUUID:T?.backend_uuid,finalSources:w0,finalRecency:_0??void 0,uuid:Be,threadMetadataTitle:E?.thread_title,threadMetadataThreadUrlSlug:E?.thread_url_slug,side_by_side_metadata:fe}),Eu=mwe({redoSearch:Gt,collection:gt,dslQuery:Ke,isRelatedQuery:Me,isSponsored:Ve,relatedQueryUUID:lt,inDomain:xt,inPage:Pt,newFrontendContextUUID:$e,promptSource:Zt,querySource:dt,timeFromFirstType:Qt,utmSource:lr,disableWidgets:Qr,isNavSuggestionsDisabled:tr,isWindowsApp:f,isIncognito:Qo??G,modelPreferenceSubmit:Zr,clientPayloadUUID:dm,lastBackendUUID:Cu,deviceLocation:bn=bn??i,newAttachments:Ms,threadMetadataRwToken:C,forceNew:Wr,finalSources:w0,finalRecency:_0,mode:b0,frontendUUID:Be,entropyBrowser:a,existingEntryUUID:Ae,deletedUrls:pt,browserHistorySummaryNumDays:me,mentions:lc,side_by_side_metadata:fe,reason:n,skipSearchEnabled:O,browserHistorySummaryMaxResults:ue,sidecarTabId:ae.sidecarSourceTab.tabId,sidecarTitle:ae.sidecarSourceTab.title,sidecarUrl:ae.sidecarSourceTab.url,sidecarSecondaryTabId:ae.sidecarSourceTab.secondaryTab?.tabId,sidecarSecondaryUrl:ae.sidecarSourceTab.secondaryTab?.url,sidecarSecondaryTitle:ae.sidecarSourceTab.secondaryTab?.title,isFirstEntry:xi,alwaysSearchOverride:Fe,overrideNoSearch:ct,cometIsMissionControl:it,mcpTools:mm,refinementFiltersMetadata:kt,browserAgentAllowOnceFromToggle:zn,forceEnableBrowserAgent:cr,canonicalPageContext:Wn,inlineMode:void 0,isMobile:m});$e&&ye(Su,Eu,Eu.frontend_uuid),u(null);const E0={params:{...Eu,version:ql},query_str:Su};function k0(Jt){if(Xr){if(qt.isStatusFailed(Jt))throw new Ol("STREAM_FAILED_FIRST_CHUNK_ERROR",{message:"failed status on first message",details:{request_id:Jt.frontend_uuid??"unknown",backend_uuid:Jt.backend_uuid}});if(!Jt.thread_url_slug)throw new Ol("STREAM_FAILED_FIRST_CHUNK_ERROR",{message:"thread_url_slug is required on first message",details:{request_id:Jt.frontend_uuid??"unknown",backend_uuid:Jt.backend_uuid}});Xr(Jt.thread_url_slug)}nr&&r.push(`/search/${Jt.thread_url_slug}`)}const pm=ee(E0,{onFirstMessageReceived:k0,placeholderChunk:{...S0,backend_uuid:Ae||cH},timer:ds?g():Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:n});cc&&dm&&rV({clientPayloadCacheKey:dm,cometBrowser:a,maxChars:$,attachedTabs:Xn,includeSidecar:wu,reason:n,cometState:ae,requestId:pm.id.description}),k(pm.id.description)},[c,L,p,S.unlimitedProSearch,we,v,w,h,E?.backend_uuid,E?.frontend_context_uuid,E?.sources?.sources,E?.search_recency_filter,E?.thread_title,E?.thread_url_slug,T?.backend_uuid,y,x,ae,I,f,G,i,C,a,me,O,ue,ee,g,k,H,m,U,re,ce,b,_,o,se,X,ye,r,$]),ke=d.useCallback(Ee=>{bwe({response:Ee,isUserLoggedIn:L,submissionCount:H,session:s??void 0,queryCountMobile:M,isWindowsApp:f,addKeyRequiringRerender:U,setSubmissionCount:Q,setShouldShowProductFeedback:D,setShouldShowRecruitmentBanner:F,setFeedbackEntryUUID:P,trackEvent:o,sendQueryEventSingular:Y,maybeSendNthQueryEventSingular:te,recruitmentBannerEnabled:le,reason:n})},[U,L,f,M,Y,te,s,H,o,le]),De=j4(),xe=xz(),Ue=d.useCallback(async()=>{const Ee=T?.backend_uuid;!Ee||!C||(o("delete last result",{entryUUID:Ee}),await de.DELETE("/rest/entry/delete-ask-entry/{entry_uuid}",n,{params:{path:{entry_uuid:Ee}},body:{read_write_token:C}}),xe(Ee),De(Ke=>{if(!Ke)return;const Nt=Ke??[];if(Nt.length<1){r.push("/",void 0,"Delete last result");return}return Nt.slice(0,-1)}))},[T?.backend_uuid,C,o,De,xe,r]);return l.jsx(Xz.Provider,{value:{submitQuery:_e,deleteLastResult:Ue,shouldShowProductFeedback:N,feedbackEntryUUID:R,quote:c,setQuote:u,shouldShowRecruitmentBanner:j,updateLocalStatePostStream:ke},children:e})},Ho=()=>{const e=d.useContext(Xz);if(!e)throw new Error("usePerplexityQueryState must be used within PerplexityQueryStateContext");return e},q4="comet_mcp_";function Ja(e){return e.startsWith(q4)}function Df(e){return e.replace(q4,"")}function Zz(e){return`${q4}${e}`}const K4=({enabled:e=!0}={})=>{const n=Ea({reason:"use-source-limits",enabled:e}),r=Yt(),s=d.useCallback(i=>{if(Ja(i))return{monthlyLimit:1/0,remaining:1/0};const{monthly_limit:c=0,remaining:u=0}=n.sources.source_to_limit[i]??{};return{monthlyLimit:c??1/0,remaining:u??1/0}},[n.sources.source_to_limit]),o=d.useCallback(i=>{const{remaining:c=0}=s(i);return c===0},[s]),a=d.useCallback(async()=>{if(Object.values(n.sources.source_to_limit).some(({monthly_limit:c})=>c!==null)){if(!e){r.invalidateQueries({queryKey:iu()});return}await n.refetch()}},[n,e,r]);return d.useMemo(()=>({getSourceLimit:s,getSourceLimited:o,checkSourceLimits:a}),[s,o,a])};function Zl(e){const t=d.useRef(void 0);return d.useEffect(()=>{t.current=e},[e]),t.current}const Y4="pplx.activeQuery";function Jz(){const e=_a.getItem(Y4);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Iwe(e){_a.setItem(Y4,JSON.stringify(e))}function Pwe(){_a.removeItem(Y4)}const eW=Yh("QueryInputStateContext",()=>Xi(e=>({userInput:"",userInputJson:void 0,hasStartedTyping:!1,shouldTriggerFocus:!1,actions:{restoreInput:()=>{const t=Jz();t.rawQuery&&e({userInput:t.rawQuery,userInputJson:t.rawQueryJson})},setUserInput:(t,n)=>{e({userInput:t,userInputJson:n}),Iwe({rawQuery:t,rawQueryJson:n})},setHasStartedTyping:t=>e({hasStartedTyping:t}),setStartTypingTime:t=>e({startTypingTime:t}),resetInput:()=>{e({userInput:"",userInputJson:void 0}),Pwe()},markInputAsSubmitted:()=>{e({userInput:"",userInputJson:void 0,startTypingTime:void 0})},setShouldTriggerFocus:t=>{e({shouldTriggerFocus:t})}}}))),Owe=eW.Provider,jf=eW.useSelector,tW=A.memo(()=>{const{setUserInput:e,resetInput:t}=Kx(),n=On(),r=Zl(n);return d.useLayoutEffect(()=>{const s=Jz();s.rawQuery&&e(s.rawQuery,s.rawQueryJson)},[e]),d.useLayoutEffect(()=>{!r||r===n||r==="/"&&n?.startsWith("/search/new")||r.startsWith("/search/new")&&n?.startsWith("/search")||r.startsWith("/search/new")&&n==="/"||t()},[n,r,t]),null});tW.displayName="QueryInputSideEffects";const nW=()=>jf(e=>e.userInput),rW=()=>jf(e=>e.userInputJson),sW=()=>jf(e=>e.hasStartedTyping),Lwe=()=>jf(e=>e.startTypingTime),Fwe=()=>jf(e=>e.shouldTriggerFocus),Kx=()=>jf(e=>e.actions);var as;(function(e){e[e.NONE=0]="NONE",e[e.READER=1]="READER",e[e.WRITER=2]="WRITER",e[e.EDITOR=5]="EDITOR",e[e.ADMIN=3]="ADMIN",e[e.OWNER=4]="OWNER",e[e.OWNER_DEFAULT_BOOKMARKS=6]="OWNER_DEFAULT_BOOKMARKS",e[e.INVITED_READER=11]="INVITED_READER",e[e.INVITED_WRITER=12]="INVITED_WRITER",e[e.INVITED_EDITOR=15]="INVITED_EDITOR",e[e.INVITED_ADMIN=13]="INVITED_ADMIN"})(as||(as={}));function Bwe(){return[as.INVITED_READER,as.INVITED_WRITER,as.INVITED_EDITOR,as.INVITED_ADMIN]}function Svt(e){return e===as.OWNER||e===as.OWNER_DEFAULT_BOOKMARKS}function Evt(e){return e===as.OWNER_DEFAULT_BOOKMARKS}function kvt(e){return e>=as.WRITER&&e=as.READER&&e{const{DebugStreamSideEffects:e}=await Se(()=>q(()=>import("./DebugStreamSideEffects-CY-uK-QQ.js"),__vite__mapDeps([123,4,1,8,3,9,6,7,124,125,10,11,12])));return{default:e}},{restricted:!0}),oW=A.memo(function(){const t="stream-side-effects",n=Rn(),r=An(),{session:s}=Ne(),{trackEvent:o}=Xe(s),{$t:a}=J(),i=OU(globalThis.navigator?.userAgent),{sendNotification:c}=jve({windowsAppOnly:!1}),u=Kz(),f=Fve(),{addKeyRequiringRerender:m}=r4(),p=Ga(),h=un(),g=Do(),y=typeof window<"u"&&(window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants")),{fileRepoInfo:x}=zx({reason:t}),{firstResult:v}=on(),b=v?.thread_url_slug,{data:_}=jz({fileRepoInfo:x,fileName:b??"",reason:t}),{saveThreadToSpace:w}=Z_e({fileRepoInfo:x,fileExists:_??!0,reason:t}),S=R4(),{resetInput:C,restoreInput:E}=Kx(),T=nW(),k=d.useRef(T);k.current=T;const I=i_e({reason:t}),M=Yt(),N=Ive(),{updateLocalStatePostStream:D}=Ho(),{checkSourceLimits:j}=K4({enabled:!1});return d.useLayoutEffect(()=>sr.on("created",async({stream:F,query:R,params:P})=>{if(F.isReconnect||!R||!P)return;if(ey(P)&&P.side_by_side_metadata){const{experiment_role:O}=P.side_by_side_metadata;if(!Qbe(O))return}const L=Us(),U=T_(i,p.erp);uxe(F.id,{name:"perplexity_ask",queryStr:R,queryParams:P,isFollowup:ey(P)&&(P.query_source==="followup"||P.query_source==="followup-sidecar"||P.query_source==="followup-mobile-sidecar"),isPerplexityBrowser:r,frontendUUID:P.frontend_uuid??"",session:s??void 0,browserVersion:L?.browser_version,source:U,connectors:I,mentions:"mentions"in P?P.mentions:[]}),h?.setTabProgress(!0),g&&h.sendThreadStatusToMobile({status:"working",streamId:F.id.description})}),[r,i,s,I,p.erp,h,g]),d.useLayoutEffect(()=>sr.on("progress",({stream:F,message:R})=>{const{blocks:P,status:L,telemetry_data:U}=R,O=P?.some(H=>!!H?.markdown_block?.chunks?.length),$=P?.some(H=>!!H?.web_result_block?.web_results?.length),G=P?.some(H=>!!H?.sources_mode_block?.rows?.length);if(U){const{has_displayed_search_results:H,has_first_output_token:Q,has_first_token:Y,has_widget_data:te,first_widget_type:se,country:ae,is_followup:X,source:ee,engine_mode:le,search_implementation_mode:re,has_useful_renderable_content:ce,region:ue}=U,me={country:ae,is_followup:X,source:ee,engine_mode:le,search_implementation_mode:re,region:ue};H&&F.timer.addTimingOnce("web.frontend.first_search_results_latency_ms",me),Q&&F.timer.addTimingOnce("web.frontend.first_output_token_latency_ms",me),Y&&F.timer.addTimingOnce("web.frontend.first_token_latency_ms",me),te&&F.timer.addTimingOnce("web.frontend.first_widget_data_latency_ms",{...me,first_widget_type:se}),ce&&F.timer.addTimingOnce("web.frontend.first_useful_renderable_content_latency_ms",me)}rxe(F.id,{hasLLMToken:O,hasSearchResults:$,hasSources:G},{id:s?.user?.id,subscription_status:s?.user?.subscription_status}),L===Pr.FAILED&&Z.error(new Ol("STREAM_FAILED_CHUNK_ERROR",{details:{request_id:F.id.description,backend_uuid:F.entryId??"unknown"}}),{message:R})}),[s?.user?.id,s?.user?.subscription_status]),d.useLayoutEffect(()=>sr.on("progress",({stream:F,isFirstMessage:R})=>{R&&F.placeholderChunk&&F.placeholderChunk.query_source&&!k.current&&C()}),[C]),d.useLayoutEffect(()=>sr.on("completed",({stream:F})=>{const R=Ga(),P=T_(i,R.erp);zR(F.id,{name:"SUCCESSFUL response",session:s??void 0,source:P})}),[s,i]),d.useLayoutEffect(()=>{const F=({thread:P,message:L})=>{L&&S(L,P)},R=[sr.on("progress",F),sr.on("completed",F),sr.on("error",F),sr.on("aborted",F)];return()=>{R.forEach(P=>P())}},[S]),d.useLayoutEffect(()=>sr.on("completed",({stream:F,thread:R})=>{if(!F.threadId||!F.entryId)return;const P=R?.find(U=>U?.uuid===F.id.description||U?.backend_uuid===F.entryId);let L;an(P?.display_model)===oe.RESEARCH?L=a({defaultMessage:"Your report is ready",id:"CEIDgftq5U"}):an(P?.display_model)===oe.STUDIO&&(L=a({defaultMessage:"Your project is ready",id:"UXOU5ST+Nc"})),Hwe({lastResponse:P,backend_uuid:F.entryId,trackEvent:o,sendNotification:c,notificationText:L,cometAdapter:h,isMissionControl:y})}),[a,o,c,h,y]),d.useLayoutEffect(()=>sr.on("completed",async({stream:F})=>{!b||!F.entryId||_&&await w(F.entryId,b)}),[_,w,b]),d.useLayoutEffect(()=>{const F=({stream:L})=>{const{id:U}=L,O=Ga(),$=T_(i,O.erp),Q=new URL(window.location.href).pathname.replace("/search/new/","");zR(U,{name:"FAILED response",session:s??void 0,source:$}),Q===U.description&&(E(),n.replace(`/?error=${wd.ThreadStreamError}`,"StreamSideEffects")),h?.setTabProgress(!1)},R=sr.on("error",F),P=sr.on("aborted",F);return()=>{R(),P()}},[s,i,E,n,h]),d.useLayoutEffect(()=>sr.on("created",({query:F,params:R,stream:{isReconnect:P,id:L}})=>{if(!(!F||!R||P||!ey(R))){if(r){u(F,{model_preference:R.model_preference,last_backend_uuid:"last_backend_uuid"in R?R.last_backend_uuid:void 0,sources:R.sources,override_no_search:R.override_no_search},L.description);return}f({query:F,params:R,reason:"streamEvents.on(created)"})}}),[u,f,r]),d.useEffect(()=>{if(!r)return;const F=[sr.on("completed",({stream:R})=>{h.cleanupTasks(R.entryId,"stream_completed"),g&&h.sendThreadStatusToMobile({status:"ready",streamId:R.id.description})}),sr.on("aborted",({stream:R})=>{h.cleanupTasks(R.entryId,"stream_aborted"),g&&h.sendThreadStatusToMobile({status:"ready",streamId:R.id.description})}),sr.on("error",({stream:R,message:P})=>{(P&&!P.reconnectable||R.abortController?.signal.aborted)&&h.cleanupTasks(R.entryId,"stream_error"),g&&h.sendThreadStatusToMobile({status:"error",streamId:R.id.description})})];return()=>{F.forEach(R=>R())}},[h,g,r]),d.useEffect(()=>sr.on("completed",async({message:F,thread:R})=>{if(!F||(D(F),F.collection_info?.slug&&M.invalidateQueries({queryKey:v4(F.collection_info.slug),exact:!1}),N(),j(),ewe(F.thread_url_slug)))return;const P=!!F.parent_info,L=R.findIndex(U=>U.uuid===F.uuid)>0;(P||!L)&&(m("floating-signup"),M.invalidateQueries({queryKey:Lx(),refetchType:"all"}))}),[M,i,m,N,D,j]),null});oW.displayName="StreamSideEffects";const aW=A.memo(function(){const{pendingTasks:t,navigationMeta:n}=Qn();return l.jsx(Vwe,{pendingTasks:t,navigationMeta:n})});aW.displayName="DebugStreamSideEffects";function Hwe({lastResponse:e,backend_uuid:t,trackEvent:n,notificationText:r,sendNotification:s,cometAdapter:o,isMissionControl:a}){if(!t)return Z.error(new Error("No backend_uuid found in response")),!1;if(!e)return Z.error(new Error("No last response found in query client")),!1;if((an(e.display_model)===oe.RESEARCH||an(e.display_model)===oe.STUDIO)&&r&&s&&document.visibilityState!=="visible"&&s({title:r,body:e.query_str,onClick:()=>{window.focus()}}),e.blocks){e.blocks.filter(c=>c.intended_usage?.endsWith("_markdown")).forEach(c=>{c.markdown_block?.media_items&&n&&c.markdown_block.media_items.forEach(u=>{n("inline image rendered",{image_url:u.image,entryUUID:t})})});const i=e.blocks.find(c=>c.intended_usage==="knowledge_cards")?.knowledge_card_block?.knowledge_cards?.[0];i&&n&&n("knowledge card in results",{entryUUID:t,name:i.title,id:i.id,type:i.card_type})}return o?.setTabProgress(!1),a||o?.showNotification(),!0}var Mn;(function(e){e.MACOS="macos",e.WINDOWS="windows"})(Mn||(Mn={}));var qn;(function(e){e.NEW_THREAD="NEW_THREAD",e.STOP_GENERATING="STOP_GENERATING",e.TOGGLE_INCOGNITO="TOGGLE_INCOGNITO",e.SHOW_SHORTCUTS="SHOW_SHORTCUTS",e.FOCUS_ASK_INPUT="FOCUS_ASK_INPUT",e.TOGGLE_DICTATION="TOGGLE_DICTATION",e.TOGGLE_V2V="TOGGLE_V2V"})(qn||(qn={}));const Nvt="keyboard-shortcuts",zwe=(e,t,n=!1)=>[{type:qn.NEW_THREAD,label:e.formatMessage({defaultMessage:"New Thread",id:"76XSxT3hV8"}),macos:["⌘","K"],windows:t?["Ctrl","Shift","P"]:["Ctrl","I"],editable:!0,global:!0},{type:qn.TOGGLE_V2V,label:e.formatMessage({defaultMessage:"Toggle Voice Mode",id:"ulahVrf1h4"}),macos:["⌘","Shift","B"],windows:["Ctrl","Shift","B"],editable:!0,global:!0,requiresAuth:!0,windowsAppOnly:!0},{type:qn.TOGGLE_DICTATION,label:e.formatMessage({defaultMessage:"Toggle Voice Dictation",id:"tWip/8rlIv"}),macos:["⌘","D"],windows:["Ctrl","D"],editable:!1,windowsAppOnly:!0},{type:qn.TOGGLE_INCOGNITO,label:e.formatMessage({defaultMessage:"Toggle Incognito",id:"YNMg3vd9IG"}),macos:["⌘",";"],windows:["Ctrl",";"],editable:!1},{type:qn.SHOW_SHORTCUTS,label:e.formatMessage({defaultMessage:"Show Shortcuts",id:"8o6rUVckYq"}),macos:["⌘","/"],windows:["Ctrl","/"],editable:!1},{type:qn.FOCUS_ASK_INPUT,label:e.formatMessage({defaultMessage:"Focus Ask Input",id:"RP5ybIk9wM"}),macos:["⌘","J"],windows:["Ctrl","J"],editable:!1}].filter(s=>(!s.requiresAuth||n)&&(!s.windowsAppOnly||t)),Wwe={Meta:"⌘",Shift:"⇧",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Enter:"⏎",Period:".",Semicolon:";",Slash:"/",Escape:"Esc"},Gwe={"⌘":"Meta","⇧":"Shift","↑":"ArrowUp","↓":"ArrowDown","←":"ArrowLeft","→":"ArrowRight","⏎":"Enter"},$we=(e,t=Mn.MACOS)=>e==="Meta"?t===Mn.WINDOWS?"Win":"⌘":Wwe[e]||e,i9=e=>e==="Win"?"Meta":Gwe[e]||e,sg=({reason:e})=>{const{connectorsMap:t}=Af({reason:e});return d.useMemo(()=>({isAllowed:n=>!!t[n],isConnected:n=>t[n]?.connected===!0,getConnectionType:n=>t[n]?.connection_type??null}),[t])},qwe=["web","scholar","social","edgar","org","my_files"],Wi=e=>qwe.includes(e),Yx={web:{type:"web",icon:B("world"),label:e=>e.formatMessage({defaultMessage:"Web",id:"B6CB3748fZ"}),description:e=>e.formatMessage({defaultMessage:"Search across the entire Internet",id:"L+Gw+J7uDs"})},scholar:{type:"scholar",icon:B("school"),label:e=>e.formatMessage({defaultMessage:"Academic",id:"mbxIJyT8C5"}),description:e=>e.formatMessage({defaultMessage:"Search academic papers",id:"IVRQQmrqTD"})},social:{type:"social",icon:B("social"),label:e=>e.formatMessage({defaultMessage:"Social",id:"qOLogguG/7"}),description:e=>e.formatMessage({defaultMessage:"Discussions and opinions",id:"g9xPuArp4v"})},edgar:{type:"edgar",icon:B("report-money"),label:()=>Dhe,description:e=>e.formatMessage({defaultMessage:"Search SEC filings",id:"7Xro7ObMcr"})},org:{type:"org",icon:B("files"),label:e=>e.formatMessage({defaultMessage:"Org files",id:"iWDsD738/m"}),description:e=>e.formatMessage({defaultMessage:"Search files from your organization",id:"Ak5CW53mGi"})},my_files:{type:"my_files",icon:B("file-export"),label:e=>e.formatMessage({defaultMessage:"My files",id:"bYbrKKlKgS"}),description:e=>e.formatMessage({defaultMessage:"Search my files",id:"EYmiG70whM"})}},Kwe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"connectors-direct-api-search",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Ywe="BYPASS",Qwe=()=>{const e=lu(),{variation:t}=Kwe(!1,{connectionType:Ywe}),n=d.useMemo(()=>({web:!0,scholar:!0,social:!0,edgar:!0,org:e,my_files:t&&e}),[e,t]),r=d.useCallback(s=>n[s],[n]);return d.useMemo(()=>({isAllowed:r}),[r])},n2=e=>{switch(e){case"GOOGLE_DRIVE":return NM;case"ONEDRIVE":return DM;case"SHAREPOINT":return IM;case"DROPBOX":return OM;case"BOX":return LM;case"WILEY":return Rhe;case"GCAL":return CV;case"NOTION_MCP":return FM;case"LINEAR":case"LINEAR_ALT":return BM;case"SLACK":return UM;case"SLACK_DIRECT":return VM;case"GITHUB_MCP_DIRECT":return HM;case"ASANA_MCP_DIRECT":return Bd;case"ASANA_MCP_MERGE":return Bd;case"ATLASSIAN_MCP_DIRECT":return zM;case"JIRA_MCP_MERGE":return GM;case"CONFLUENCE_MCP_MERGE":return qM;case"MICROSOFT_TEAMS_MCP_MERGE":return YM;case"OUTLOOK":return TV;case"FACTSET":return gV;case"ZOOM":return XM;default:return""}},If=e=>{switch(e){case"crunchbase":return yV;case"factset":return hV;case"wiley":return Fd;case"google_drive":return AM;case"onedrive":return RM;case"sharepoint":return jM;case"gcal":return wx;case"dropbox":return PM;case"box":return Cx;case"gmail":return wV;case"notion_mcp":return Sx;case"outlook":return QM;case"linear":case"linear_alt":return Ex;case"slack":case"slack_direct":return kx;case"github_mcp_direct":return Mx;case"asana_mcp_direct":case"asana_mcp_merge":return Tx;case"atlassian_mcp_direct":return Ax;case"jira_mcp_merge":return WM;case"confluence_mcp_merge":return $M;case"microsoft_teams_mcp_merge":return KM;case"wiley_mcp_cashmere":return Fd;case"cbinsights_mcp_cashmere":return kM;case"pitchbook_mcp_cashmere":return MM;case"statista_mcp_cashmere":return TM;case"zoom":return ZM;default:return null}};function Rvt(e){if(e===0)return"0 bytes";const t=1024,n=["bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.ceil(e/Math.pow(t,r))+" "+n[r]}const iW=e=>{if(!e)return;const t=e.lastIndexOf(".");if(!(t<=0||t===e.length-1))return e.substring(t+1).toLowerCase()},Xwe=200,b3=(e,t={})=>{const{maxLength:n=Xwe,replacement:r=" ",fallback:s="file"}=t;if(!e)return s;const o=e.lastIndexOf("."),a=o>0&&o|]/g,r).trim(),i||(i=s),i.length+c.length>n){const u=n-c.length;if(u>0)i=i.substring(0,u).trim();else return s+c}return i+c},Dvt=e=>{const t=e.file_metadata.file_type;return t==="FOLDER"||t==="DATABASE"||t==="WORKSPACE"||t==="PAGE"};function jvt(e){const t=e.file_metadata.file_type;return t==="FOLDER"||t==="DATABASE"||t==="WORKSPACE"?B("folder-filled"):B("file")}const Zwe=e=>{switch(e){case"GOOGLE_DRIVE":return AM;case"ONEDRIVE":return RM;case"SHAREPOINT":return jM;case"DROPBOX":return PM;case"BOX":return Cx;case"GCAL":return wx;case"NOTION_MCP":return Sx;case"OUTLOOK":return QM;case"LINEAR":case"LINEAR_ALT":return Ex;case"SLACK":case"SLACK_DIRECT":return kx;case"GITHUB_MCP_DIRECT":return Mx;case"ASANA_MCP_DIRECT":case"ASANA_MCP_MERGE":return Tx;case"ATLASSIAN_MCP_DIRECT":return Ax;case"JIRA_MCP_MERGE":return WM;case"CONFLUENCE_MCP_MERGE":return $M;case"MICROSOFT_TEAMS_MCP_MERGE":return KM;case"ZOOM":return ZM;default:return null}},Jwe={crunchbase:"crunchbase",factset:"factset",wiley:"wiley",google_drive:"google_drive",onedrive:"onedrive",sharepoint:"sharepoint",gcal:"gcal",dropbox:"dropbox",box:"box",notion_mcp:"notion_mcp",outlook:"outlook",linear:"linear",linear_alt:"linear_alt",slack:"slack",slack_direct:"slack_direct",github_mcp_direct:"github_mcp_direct",asana_mcp_direct:"asana_mcp_direct",asana_mcp_merge:"asana_mcp_merge",atlassian_mcp_direct:"atlassian_mcp_direct",jira_mcp_merge:"jira_mcp_merge",confluence_mcp_merge:"confluence_mcp_merge",microsoft_teams_mcp_merge:"microsoft_teams_mcp_merge",wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere",zoom:"zoom",edgar:"edgar"},uu=e=>Object.keys(Jwe).includes(e)||e==="gmail",_3=e=>{switch(e){case"crunchbase":return yV;case"factset":return hV;case"wiley":return Fd;case"google_drive":return AM;case"onedrive":return RM;case"sharepoint":return jM;case"gcal":return wx;case"dropbox":return PM;case"box":return Cx;case"gmail":return wV;case"notion_mcp":return Sx;case"outlook":return QM;case"linear":case"linear_alt":return Ex;case"slack":case"slack_direct":return kx;case"github_mcp_direct":return Mx;case"asana_mcp_direct":case"asana_mcp_merge":return Tx;case"atlassian_mcp_direct":return Ax;case"jira_mcp_merge":return WM;case"confluence_mcp_merge":return $M;case"microsoft_teams_mcp_merge":return KM;case"wiley_mcp_cashmere":return Fd;case"cbinsights_mcp_cashmere":return kM;case"pitchbook_mcp_cashmere":return MM;case"statista_mcp_cashmere":return TM;case"zoom":return ZM;default:return null}},kc=e=>{switch(e){case"crunchbase":return Nhe;case"factset":return gV;case"google_drive":return NM;case"onedrive":return DM;case"sharepoint":return IM;case"gcal":return CV;case"dropbox":return OM;case"box":return LM;case"gmail":return jhe;case"notion_mcp":return FM;case"outlook":return TV;case"linear":case"linear_alt":return BM;case"slack":return UM;case"slack_direct":return VM;case"github_mcp_direct":return HM;case"asana_mcp_direct":return Bd;case"asana_mcp_merge":return Bd;case"atlassian_mcp_direct":return zM;case"jira_mcp_merge":return GM;case"confluence_mcp_merge":return qM;case"microsoft_teams_mcp_merge":return YM;case"wiley_mcp_cashmere":return xV;case"cbinsights_mcp_cashmere":return vV;case"pitchbook_mcp_cashmere":return bV;case"statista_mcp_cashmere":return _V;case"zoom":return XM;default:return e}},eCe=e=>{switch(e){case"GOOGLE_DRIVE":return NM;case"ONEDRIVE":return DM;case"SHAREPOINT":return IM;case"DROPBOX":return OM;case"BOX":return LM;case"NOTION_MCP":return FM;case"LINEAR":case"LINEAR_ALT":return BM;case"SLACK":return UM;case"SLACK_DIRECT":return VM;case"GITHUB_MCP_DIRECT":return HM;case"ASANA_MCP_DIRECT":return Bd;case"ASANA_MCP_MERGE":return Bd;case"ATLASSIAN_MCP_DIRECT":return zM;case"JIRA_MCP_MERGE":return GM;case"CONFLUENCE_MCP_MERGE":return qM;case"MICROSOFT_TEAMS_MCP_MERGE":return YM;case"ZOOM":return XM;default:return""}},Ivt=(e,t)=>new Date(e+"Z").toLocaleString(t,{month:"numeric",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}),Pvt=(e,t,n)=>{switch(e){case"RECEIVED":case"QUEUED":case"RATE_LIMITED":return{label:t.formatMessage({id:"Cnm0QAkWnp",defaultMessage:"Queued"})};case"SYNCING":return{label:t.formatMessage({id:"eOnwqs6QFY",defaultMessage:"Syncing"})};case"EVALUATING_RESYNC":case"READY":return{label:t.formatMessage({id:"IZFEUgrg25",defaultMessage:"Ready"})};case"SYNC_ERROR":return tCe(n,t)}},tCe=(e,t)=>{if(!e)return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"An unknown error occurred while syncing this file",id:"FrOCoiVasC"})};switch(e){case"INVALID_FILE_SIZE":return{label:t.formatMessage({id:"fTNSna6r/X",defaultMessage:"File too large"}),description:t.formatMessage({defaultMessage:"File size exceeds the maximum allowed limit",id:"NTNLSYG0+u"}),suggestion:t.formatMessage({defaultMessage:"Try uploading a smaller file or contact support to increase your limit",id:"k2ucsfBcdH"})};case"INVALID_FILE_TYPE":return{label:t.formatMessage({id:"+FiyOTaUCW",defaultMessage:"Not supported"}),description:t.formatMessage({defaultMessage:"File type is not supported",id:"NMMfOTMPPN"}),suggestion:t.formatMessage({defaultMessage:"Check the list of supported file formats and convert your file if needed",id:"2zDaBv+l45"})};case"BAD_FILE":return{label:t.formatMessage({id:"+FiyOTaUCW",defaultMessage:"Not supported"}),description:t.formatMessage({defaultMessage:"File is corrupted or cannot be read",id:"2DRBESYiY3"}),suggestion:t.formatMessage({defaultMessage:"Try re-uploading the file or check if it opens correctly on your device",id:"XMnV6UR4G5"})};case"TOKEN_LIMIT_EXCEEDED":return{label:t.formatMessage({id:"t7EERfdOMB",defaultMessage:"Content too long"}),description:t.formatMessage({defaultMessage:"File content exceeds the token limit for processing",id:"S5ij+lXT2m"}),suggestion:t.formatMessage({defaultMessage:"Try splitting the file into smaller parts or contact support",id:"eu5ByuYBzE"})};case"FAILED_MODERATION":return{label:t.formatMessage({id:"+0cMy9/Uvq",defaultMessage:"Content policy violation"}),description:t.formatMessage({defaultMessage:"File content does not meet our content policy",id:"5+WSrKKHWX"}),suggestion:t.formatMessage({defaultMessage:"Review the file content and try again with appropriate content",id:"T+5YJmz9Uu"})};case"FILE_ALREADY_EXISTS":return{label:t.formatMessage({id:"rj9KIiC1cY",defaultMessage:"File already exists"}),description:t.formatMessage({defaultMessage:"A file with this name already exists",id:"v6hLP22U9C"}),suggestion:t.formatMessage({defaultMessage:"Rename the file or remove the existing file first",id:"lHS2xLoVfC"})};case"FAILED_TO_PARSE_FILE":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to process the file contents",id:"+JPkVmVP/P"}),suggestion:t.formatMessage({defaultMessage:"This is likely a temporary issue. Try resyncing the file.",id:"x2TrdA7gdq"})};case"FAILED_TO_INDEX_FILE":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to index the file for search",id:"VZXlZSjnzh"}),suggestion:t.formatMessage({defaultMessage:"This is likely a temporary issue. Try resyncing the file.",id:"x2TrdA7gdq"})};case"FILE_DOWNLOAD_ERROR":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to download the file from the source",id:"WQEt2fv0+0"}),suggestion:t.formatMessage({defaultMessage:"Check your connection permissions and try resyncing",id:"oMx/8oRlEl"})};case"RATE_LIMIT_RETRIES_EXCEEDED":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Rate limit exceeded after multiple retries",id:"x/gkqQmJpB"}),suggestion:t.formatMessage({defaultMessage:"Please wait a few minutes and try resyncing the file",id:"9178BZbGzP"})};case"AUTOSYNC_FAILED":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Automatic sync failed",id:"W/IGnlqOCp"}),suggestion:t.formatMessage({defaultMessage:"Try manually resyncing the file",id:"t77201iPJg"})};default:return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"An error occurred while syncing this file",id:"layd6ZWzub"})}}},lW=(e,t)=>{if(t==="WILEY")return n2(t);if(t||e.is_memory||e.is_conversation_history)return e.name&&e.name.trim()?e.name:void 0},cW=e=>e.isFile,uW=e=>e.isDirectory,nCe=async(e,t=yhe)=>{const n=[e],r=[];for(;n.length>0;){const s=n.pop();if(s){if(cW(s)){const o=await new Promise(a=>{s.file(a)});if(r.push(o),r.length>t)return r}else if(uW(s)){const o=s.createReader(),a=await new Promise(i=>o.readEntries(i));n.push(...a)}}}return r},rCe=e=>e?e.toLowerCase().replace(/[\s-]/g,"_").replace(/([a-z])([A-Z])/g,"$1_$2").replace(/^_+|_+$/g,"").replace(/_+/g,"_"):"",dW=e=>e.replace(/_/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase()),Q4=e=>{if(!e)return null;try{const t=parseInt(e,16);return String.fromCodePoint(t)}catch{return null}},sCe=(e,t=60)=>{if(e.length<=t)return e;const n="…",r=t-n.length,s=Math.ceil(r/2),o=Math.floor(r/2);return e.substring(0,s)+n+e.substring(e.length-o)},fW=({cometMcpSources:e})=>{const t=J();return d.useCallback(r=>{const s=dW(r);if(Wi(r))return Yx[r].label(t);if(Ja(r)){const o=Df(r);return e[o]?.text??o}return uu(r)?kc(r)??s:s},[t,e])},oCe=(e,{getSourceLabel:t})=>e.sort((n,r)=>{const s=t(n),o=t(r);return s.localeCompare(o)}),aCe=e=>e.sort((t,n)=>{const r=Wi(t),s=Wi(n);return r&&!s?-1:!r&&s?1:0}),iCe=e=>e.sort((t,n)=>t==="web"&&n!=="web"?-1:t!=="web"&&n==="web"?1:0),lCe=["space","sports","my_files"];function mW(e){return lCe.includes(e)}const cCe=[oCe,aCe,iCe],X4=({isConnectorAllowed:e,omittedSources:t=[],omitCometMcpSources:n=!1})=>{const{cometMcpSources:r}=Nf(),s=fW({cometMcpSources:r}),{isAllowed:o}=Qwe(),a=d.useCallback(u=>{const f=Df(u);return Object.keys(r).includes(f)},[r]),i=d.useCallback(u=>mW(u)||t.includes(u)?!1:Wi(u)?o(u):uu(u)?e(u):Ja(u)?n?!1:a(u):(Hc.error(`[useSources] Unknown source type: ${u}`),!1),[e,a,o,t,n]),c=d.useMemo(()=>{const u=Object.keys(r).map(m=>Zz(m)).filter(Ja).filter(i),f=Object.keys(E4).filter(ha).filter(i);return cCe.reduce((m,p)=>p(m,{getSourceLabel:s}),[...f,...u])},[i,r,s]);return d.useMemo(()=>({sources:c,isSourceAllowed:i}),[c,i])};function og({defaultSource:e,reason:t}){const{sources:n,setSources:r,setRecency:s}=Vn(),o=fn(),{fileRepoInfo:a}=zx({reason:t}),{isLoading:i}=mo({reason:t}),{device:{isWindowsApp:c}}=sn(),{safeWindowsIpcPublish:u,safeWindowsIpcSubscribe:f}=Xh(),{isAllowed:m}=sg({reason:t}),{sources:p}=X4({isConnectorAllowed:m}),h=a.file_repository_type==="COLLECTION",g=h?`space-${a.owner_id}`:"home",y=ou(),x=Array.isArray(y?.slug)?y.slug[0]:y?.slug,{collection:v,isLoading:b}=O4({collectionSlug:x,reason:t}),_=b?void 0:v?.enable_web_by_default,w=d.useRef(f);d.useEffect(()=>{w.current=f},[f]);const S=d.useRef(Math.random().toString(36).substring(7)),C=d.useCallback(N=>{let D=[];return n?.includes(N)?(D=n.filter(j=>j!==N),N==="web"&&(n.includes("crunchbase")&&(D=n.filter(j=>j!=="crunchbase"&&j!=="web")),s?.(null))):(D=[...n||[]],N==="crunchbase"&&!D.includes("web")&&D.push("web"),D.push(N)),h&&M_(D,g),r(D),c&&u(yl,{type:yl,sources:D,windowId:S.current}),D},[h,g,r,s,n,c,u]),E=d.useCallback(N=>{n?.includes(N)||C(N)},[n,C]),T=d.useCallback(N=>{n?.includes(N)&&C(N)},[n,C]),k=d.useCallback(N=>n?.includes(N)??!1,[n]),I=d.useCallback(N=>{const D=[...N];D.includes("crunchbase")&&!D.includes("web")&&D.push("web"),h&&M_(D,g),r(D),c&&u(yl,{type:yl,sources:D,windowId:S.current})},[h,c,g,u,r]);d.useEffect(()=>{if(!c)return;const N=w.current(yl,D=>{D.type===yl&&D.windowId!==S.current&&r(D.sources)});return()=>{N?.()}},[c,r,n]);const M=d.useMemo(()=>{if(b)return new Set([]);if(h)return _?new Set(["web"]):new Set([]);if(e)return new Set([e]);const D=(o?.get("sources")??"web").split(",").map(j=>j.trim()).filter(ha);return new Set(D||["web"])},[h,b,_,o,e]);return d.useEffect(()=>{if(i)return;let N=h?B2e(g)||[...M]:[...M];if(h&&_&&!N.includes("web")?N.push("web"):h&&!_&&N.includes("web")&&(N=N.filter(j=>j!=="web")),JSON.stringify(n||[])!==JSON.stringify(N)){const j=N.filter(F=>p.includes(F));h&&M_(j,g),r(j)}},[i,h,_]),d.useMemo(()=>({DEFAULT_SOURCES:M,sources:n,isSpace:h,isSpaceEnableWebByDefault:_,toggleSource:C,setSources:r,addSource:E,removeSource:T,hasSource:k,overwriteSources:I}),[M,n,h,_,I,C,r,E,T,k])}const uCe=[];function pW({useThreadSources:e,reason:t="use-global-available-sources"}){const{sources:n,setSources:r}=og({reason:t}),{cometMcpSources:s,cometMcpDisabledServers:o,setCometMcpSources:a}=Nf(),{firstResult:i}=on(),c=i?.sources?.sources??uCe,u=d.useMemo(()=>e?c.filter(ha):n,[e,c,n]),f=d.useMemo(()=>{const g=Object.keys(s).filter(y=>!o?.has(y)).map(y=>Zz(y));return[...u,...g]},[u,s,o]),m=d.useCallback(g=>{const y=g.filter(Ja),x=g.filter(ha);a(y.map(v=>Df(v))),r(x)},[r,a]),p=d.useCallback(g=>{f.includes(g)||m([...f,g])},[f,m]),h=d.useCallback(g=>{f.includes(g)&&m(f.filter(y=>y!==g))},[f,m]);return{sources:f,setSources:m,addSource:p,removeSource:h}}const dCe=({reason:e})=>{const{safeWindowsIpcPublish:t}=Xh(),{device:{isWindowsApp:n}}=sn(),r=Wt(),{isPro:s}=$t(),{DEFAULT_SOURCES:o}=og({reason:e}),a=Ix(),i=d.useRef(t),{setIsIncognito:c}=G4();d.useEffect(()=>{i.current=t},[t]);const u=d.useCallback(()=>{No("/?voice-mode=true","Voice mode")},[]),f=d.useCallback(()=>{No("/?v2v=true","V2V mode")},[]),m=d.useCallback(g=>{const y=g.searchParams,x=y.get("q"),v=y.get("incognito"),_=(y.get("sources")??"").split(",").map(C=>C.trim()).filter(ha),w=y.get("search_mode"),S=w?x1e[w]:void 0;v!==null&&c(v==="true"),_&&t(yl,{type:yl,sources:_}),S?.model&&S?.mode&&t(nd,{type:nd,model:S.model,searchMode:S.mode}),x&&i.current(SV,{query:x,promptSource:"user",querySource:"windows-app-shortcut",incognitoOverride:v,sourcesOverride:_??[]})},[t,c]),p=d.useCallback(g=>{const y=g.searchParams,x=y.get("type"),v=y.get("callback");if(!x||!v)return;const b=x.split(","),_=new URLSearchParams;b.forEach(S=>{switch(S){case"sources":_.set("sources",Array.from(o).join(","));break;case"search-modes":_.set("search-modes",Object.values(oe).join(","));break;case"sign-in":_.set("sign-in",r?"true":"false");break;case"subscription":_.set("subscription",s?"true":"false");break}});const w=`${v}?${_.toString()}`;window.open(w,"_blank")},[r,s,o]),h=d.useMemo(()=>new Map([["voice-mode",u],["v2v",f],["search",g=>m(g)],["request",g=>p(g)]]),[u,f,m,p]);d.useEffect(()=>{if(!n||!a)return;const g=a.app.on("openProtocolURL",(x,v)=>{const b=new URL(v.url);for(const[_,w]of h)if(b.toString().includes(_)){v.preventDefault(),w(b);break}}),y=async()=>{await(await g)()};return()=>{y()}},[n,h,a])},w3="keyboard-shortcuts",fCe=(e,t)=>{const n={[qn.NEW_THREAD]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.STOP_GENERATING]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.TOGGLE_INCOGNITO]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.SHOW_SHORTCUTS]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.FOCUS_ASK_INPUT]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.TOGGLE_DICTATION]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.TOGGLE_V2V]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]}},r=zwe(e,t);[qn.NEW_THREAD,qn.TOGGLE_V2V].forEach(s=>{const o=r.find(a=>a.type===s);o&&(n[s]={[Mn.MACOS]:o.macos,[Mn.WINDOWS]:o.windows})});try{const s=vt.getItem(w3);if(s){const o=JSON.parse(s);[qn.NEW_THREAD,qn.TOGGLE_V2V].forEach(a=>{const i=o.find(c=>c.type===a);i&&(n[a]={[Mn.MACOS]:i.macos,[Mn.WINDOWS]:i.windows})})}}catch(s){Z.warn("Error reading keyboard shortcuts:",s)}return n},mCe=(e,t)=>Xi(n=>({globalShortcuts:fCe(e,t),setShortcut:(r,s,o)=>n(a=>{const i={...a.globalShortcuts,[r]:{...a.globalShortcuts[r],[s]:o}};try{const c=vt.getItem(w3),f=(c?JSON.parse(c):[]).map(m=>m.type===r?{...m,[s]:o}:m);vt.setItem(w3,JSON.stringify(f))}catch(c){Z.warn("Error saving keyboard shortcuts:",c)}return{globalShortcuts:i}})}));let j_=null;const C3=e=>{const{device:{isWindowsApp:t}}=sn(),n=J();return j_||(j_=mCe(n,t)),j_(e)},pCe=()=>{const{handleShowPanel:e}=Px(),t=C3(c=>c.setShortcut),n=Ix(),r=C3(c=>c.globalShortcuts),s=d.useCallback(async()=>{if(!n)return;const c=await hW();if(!c)return;await n.nativeWindow.show({ref:c}),await n.nativeWindow.focus({ref:c});const u=new CustomEvent("toggleVoiceToVoice");document.dispatchEvent(u)},[n]),o=d.useCallback(async(c,u)=>{try{const f=Array.isArray(c)?c.join("+"):c;let m;switch(u){case qn.NEW_THREAD:m=e;break;case qn.TOGGLE_V2V:m=s;break;default:return Z.warn(`No handler registered for shortcut type: ${u}`),!1}return f&&f.trim()!==""&&await n?.globalShortcut.unregister(f),await n?.globalShortcut.register(f,m),!0}catch(f){return Z.warn("Error registering shortcut:",f),!1}},[e,s,n]),a=d.useCallback(async(c,u,f)=>{try{const m=c.join("+"),p=u.join("+");if(m===p)return;m&&m.trim()!==""&&await n?.globalShortcut.unregister(m),await o(p,f)&&t(f,Mn.WINDOWS,u)}catch(m){Z.error("Error updating global shortcut:",m)}},[o,t,n]),i=d.useCallback(async c=>{const u=c.join("+");u&&u.trim()!==""&&await n?.globalShortcut.unregister(u)},[n]);return d.useMemo(()=>({shortcuts:r,registerShortcut:o,updateGlobalShortcut:a,unregisterShortcut:i}),[o,r,i,a])},hW=wf(async()=>{const{object:e}=await q(async()=>{const{object:n}=await import("./index-DxZN0OQK.js");return{object:n}},[]);let t=await e.retrieve({id:"TJmK6yKBLiw389HLDdYy5"});return t||(t=await e.retrieve({id:"C195F2RyYDhfB93QW7vui"})),t}),hCe=({children:e})=>{const t="windows-app-provider-inner",{device:{isWindowsApp:n}}=sn(),r=On(),s=n&&!r?.includes(Yp),{submitQuery:o}=Ho(),{isCopilot:a}=Vn(),{createPanelWindow:i,handleHidePanel:c}=Px(),u=Wt(),f=Ix(),m=d.useRef(o),p=d.useRef(a),{safeWindowsIpcSubscribe:h}=Xh();d.useEffect(()=>{m.current=o},[o]),dCe({reason:t}),d.useEffect(()=>{p.current=a},[a]);const{shortcuts:g,registerShortcut:y,unregisterShortcut:x}=pCe();d.useEffect(()=>{s&&(i(),c())},[s,i,c]);const v=d.useCallback(async b=>{const _=async(E=500)=>{const T=new AbortController,k=setTimeout(()=>T.abort(),E);try{const I=new Promise(M=>{f?.nativeWindow.isVisible().then(N=>{if(N){clearTimeout(k),M(!0);return}f?.nativeWindow.on("show",()=>{clearTimeout(k),M(!0)})})});return await Promise.race([I,new Promise(M=>{T.signal.addEventListener("abort",()=>M(!1))})])}catch(I){return Z.warn("Error ensuring window is ready",{error:I}),!1}finally{clearTimeout(k);try{f?.nativeWindow.removeAllListeners("show")}catch(I){Z.warn("Error removing show listeners during cleanup",I)}}},w=await hW();if(await f?.nativeWindow.show({ref:w}),await f?.nativeWindow.focus({ref:w}),!await _())return;const S=b.query.trim();if(!S?.trim())return;const C=ua();m.current({rawQuery:S,copilotOverride:p.current?!0:void 0,attachments:b.attachments,collection:null,newFrontendContextUUID:C,promptSource:b.promptSource??"user",querySource:b.querySource??"home",timeFromFirstType:b.timeFromFirstType,shouldRedirectToBackendUUID:!0})},[f]);return d.useEffect(()=>{if(!s)return;const b=h(SV,_=>{v(_)});return()=>{b?.()}},[s,v,h]),d.useEffect(()=>{if(!s)return;const b=[qn.NEW_THREAD,...u?[qn.TOGGLE_V2V]:[]];return b.forEach(_=>{const S=g[_][Mn.WINDOWS].map(i9);y(S,_)}),()=>{b.forEach(_=>{const S=g[_][Mn.WINDOWS].map(i9);x(S)})}},[y,s,g,u,x]),l.jsx(l.Fragment,{children:e})},gCe=({children:e})=>l.jsx(d1e,{children:l.jsx(hCe,{children:e})}),gW=A.memo(()=>{const{message:e,variant:t,description:n,ctaText:r,ctaOnClick:s,isVisible:o,timeout:a,handleClick:i,closeToast:c,position:u,iconOverride:f,keyProp:m}=hn(),p=d.useCallback(()=>{t==="refresh"&&i===void 0?window.location.reload():i&&i()},[t,i]);return l.jsx(qc,{keyProp:m,isVisible:o,variant:t,message:e,description:n,ctaText:r,ctaOnClick:s,timeout:a,handleClick:p,onTimeout:c,position:u,iconOverride:f},m)});gW.displayName="Toasts";function yCe(e={}){const{isMobileStyle:t,isMobileUserAgent:n}=Re(),{isSidecarBuild:r="1",isInlineAssistantBuild:s=""}=e;return d.useMemo(()=>({isMobileStyle:r||s?!1:t,isMobileUserAgent:n}),[t,n,r,s])}const yW=A.memo(({children:e,colorScheme:t,logger:n,getSpriteUrl:r,renderModals:s})=>{const{isMobileStyle:o,isMobileUserAgent:a}=yCe();return l.jsx(gme,{isMobileStyle:o,isMobileUserAgent:a,renderModals:s,logger:n,children:l.jsx(qme,{src:r,children:l.jsx(OV,{initialOverrideColorScheme:t,children:l.jsxs(TH,{children:[e,l.jsx(gW,{})]})})})})});yW.displayName="GlobalUXProvider";Ce(async()=>{const{RenderToolbar:e}=await Se(()=>q(()=>import("./RenderToolbar-CM9FGyO-.js"),__vite__mapDeps([126,1,4])));return{default:e}});Ce(async()=>{const{ReactQueryDevtools:e}=await Se(()=>q(()=>import("./index-Ds5yF1gS.js"),[]));return{default:e}});const xCe=Ce(async()=>{const{DebugModeActivator:e}=await Se(()=>q(()=>import("./DebugModeActivator-BYw4GS2i.js"),__vite__mapDeps([127,4,1,125,3])));return{default:e}},{restricted:!0}),vCe=({children:e,hostname:t,buildVersion:n,buildVersionRefresh:r,spaRoutes:s,shouldOpenNonSpaRouteInNewTab:o,base:a,idleRefresh:i})=>{const c=On(),u=d.useRef(l1e),{env:{isSingleTenant:f}}=sn(),{status:m}=Ne();if(f){if(m==="loading")return null;if(m==="unauthenticated")return No("/auth/signin","Single tenant requires login"),null}return l.jsx(Nfe,{ssrPath:c??"/",ssrSearch:"",base:a,children:l.jsx(Rfe,{spaRoutes:s,openNonSpaRouteInNewTab:o,appRef:u,children:l.jsx(awe,{children:l.jsxs(Owe,{children:[l.jsx(NH,{}),l.jsxs(sme,{buildVersion:n,allowPersist:!0,children:[l.jsx(yW,{logger:Z,renderModals:!1,children:l.jsx(Hz,{children:l.jsxs(p1e,{hostname:t,children:[l.jsx(wve,{}),l.jsx(i0e,{children:l.jsx(vH,{children:l.jsx(dbe,{children:l.jsx(Fbe,{shouldFetchSettings:!0,children:l.jsx(Ghe,{children:l.jsx(jwe,{shouldFetchSettings:!1,children:l.jsx(gCe,{children:l.jsxs(_ve,{children:[l.jsxs(h0e,{children:[l.jsx(SH,{buildVersion:n,enabled:r||i,ref:u,children:i&&l.jsx(AH,{})}),l.jsx(oW,{}),l.jsx(gz,{}),typeof window<"u"&&l.jsx(tW,{}),l.jsx(aW,{}),l.jsx(hz,{}),l.jsx(xCe,{}),e]}),l.jsx(yme,{logger:Z})]})})})})})})})})]})})}),!1]})]})})})})},bCe=["49a618ae-2fee-4bac-9150-81c466a49187"];function _Ce(e){let t=e;t=t.replace(/^\^/,"").replace(/\$$/,""),t=t.replace(/\\\//g,"/");const n=[],r=t.match(/^\/\(([^)]+\|[^)]+)\)/);if(r){const h=r[1]?.split("|").map(g=>`/${g}`);n.push({type:"alternation",value:"",optional:!1,alternatives:h}),t=t.substring(r[0].length)}else{const h=t.match(/^([^(]+)/);if(h&&h[1]){const g=h[1];n.push({type:"literal",value:g,optional:!1}),t=t.substring(g.length)}}let s=t,o=0,a=0;const i=100;for(;s.length>0&&a++([^)]+)\)\)\?/);if(h){const[_,w,S]=h,C=S===w;n.push({type:C?"literal":"param",value:C?`/${w}`:`/:${w}`,optional:!0,paramName:C?void 0:w}),s=s.substring(_.length);continue}const g=s.match(/^\(\?:\/\(\?<(\w+)>([^)]+)\)\)/);if(g){const[_,w,S]=g,C=S===w;n.push({type:C?"literal":"param",value:C?`/${w}`:`/:${w}`,optional:!1,paramName:C?void 0:w}),s=s.substring(_.length);continue}const y=s.match(/^\/?\(([^)]+)\)\?/),x=s.match(/^\(\?:\/\(([^)]+)\)\)\?/),v=y||x;if(v){const[_]=v;o++,n.push({type:"param",value:`/:param${o}`,optional:!0,paramName:`param${o}`}),s=s.substring(_.length);continue}const b=s.match(/^\/?\?+/);if(b&&b[0].length>0){s=s.substring(b[0].length);continue}break}const c=[],u=n.find(h=>h.type==="alternation"),f=n.filter(h=>h.type!=="alternation"),m=u?u.alternatives.map(h=>`/${h}`):[""];for(const h of m){const g=f.filter(b=>b.optional),y=f.filter(b=>!b.optional),x=g.some(b=>b.paramName?.startsWith("param"));if(g.every(b=>b.paramName?.startsWith("param"))&&x){const b=g.length;for(let _=0;_<=b;_++){let w=h;for(const S of y)w+=S.value;for(let S=0;S<_;S++)w+=g[S]?.value??"";w=w.replace(/\/+/g,"/"),w=w.replace(/\/\?/g,""),w=w||"/",c.push(w)}}else{const b=g.length,_=Math.pow(2,b);for(let w=0;w<_;w++){let S=h;for(const C of y)S+=C.value;for(let C=0;C{const y=h.split("/").filter(Boolean),x=g.split("/").filter(Boolean);if(y.length!==x.length)return x.length-y.length;for(let v=0;v"u")return;const o=e.version,a=e.env??"local",i=Us(),c=t?.email?.endsWith("@perplexity.ai"),u=a==="local",f=a==="testing"||u||i||c?100:1,m=u||c?100:0;if(!bCe.includes(t?.org_uuid??"")){Dfe({applicationId:SCe,clientToken:c9,version:o,env:a,debug:u,sessionSampleRate:100,sessionReplaySampleRate:m,beforeSend:(g,y)=>{if(g.context&&ECe(y,g)){const x=y.response?.headers?.get(wCe);x&&(g.context.region=x);const v=y.response,b=v?Ife(v):void 0;b&&(g.context.normalizedPath=b)}if(n&&g.view.url&&g.context)try{const x=new URL(g.view.url).pathname,v=Pfe(x,r),b=d7(n,v);if(b)if(b.route.startsWith("^")){const _=d7(_Ce(b.route),v);_&&(g.context.normalizedName=f7(_.route,r))}else g.context.normalizedName=f7(b.route,r)}catch{}return!0}}),jfe({clientToken:c9,version:o,env:a,debug:u,sessionSampleRate:f});const h=typeof navigator<"u"&&"serviceWorker"in navigator&&!!navigator.serviceWorker.controller;if(c7({useServiceWorker:h,webResourcesBuild:void 0}),u7({useServiceWorker:h,webResourcesBuild:void 0}),i){const g={cometAgentExtensionVersion:i?.agent_extension_version,cometDeviceId:i.device_id,cometMainExtensionVersion:i.extension_version,cometVersion:i?.browser_version,erp:e.erp,cometAndroidVersion:i?.android_version,cometIosVersion:i?.ios_version};c7(g),u7(g)}Ju("web.frontend.module_exec_start",{startTime:SU(),duration:CCe})}l9=!0}function ECe(e,t){return t.type==="resource"&&t.resource.type==="fetch"&&"response"in e}const vW="^\\/search(?:\\/(?new))?(?:\\/(?.+))?$",bW=["ask-input"],kCe=["thread-title"],MCe=e=>{const t=[];if(!e)return t;const n=r=>{if(r.type==="mention"){const o=r.props;o.variant==="source"&&t.push(o.uuid)}"children"in r&&Array.isArray(r.children)&&r.children.forEach(n)};return n(e),t},_W=e=>{const t=[];if(!e)return{dslQuery:void 0,mentions:t};let n=0;const r=s=>{let o="";if(s.type==="text"&&"text"in s)o=s.text;else if(s.type==="linebreak")o=` -`;else{if((s.type==="link"||s.type==="autolink")&&"url"in s)return o=`[${"children"in s&&Array.isArray(s.children)&&s.children.map(r).reduce((i,c)=>(i+=c,i),"")||""}](${s.url})`,o;if(s.type==="mention"){const i=s.props;if(i.variant==="tab")return t.push({id:i.uuid,url:i.url??"",type:i.variant}),n++,o=``,o;if(i.variant==="space")return t.push({id:i.uuid,url:"",type:i.variant}),o="",o;if(i.variant==="shortcut")return t.push({id:i.uuid,url:"",type:i.variant}),o=i.queryText??"",o;if(i.variant==="source")return t.push({id:i.uuid,url:"",type:"sources"}),o="",o}}return"children"in s&&Array.isArray(s.children)?s.children.map(r).reduce((a,i)=>(a+=i,a),o):o};return{dslQuery:r(e)||void 0,mentions:t}};function wW({onSubmit:e,immediate:t=!0}){const n=nW(),r=rW(),s=sW(),o=Lwe(),{setUserInput:a,setHasStartedTyping:i,setStartTypingTime:c,markInputAsSubmitted:u}=Kx(),f=d.useRef(!1);d.useEffect(()=>()=>{f.current&&(u(),f.current=!1)},[u,t]);const m=d.useCallback(h=>{Z.info("ask input submitted");const g=o?performance.now()-o:void 0,{dslQuery:y,mentions:x}=_W(h.json?.root);e?.({timeFromFirstType:g,...h,dslQuery:y,mentions:h.mentions??x}),t?u():f.current=!0},[t,u,e,o]),p=d.useCallback((h,g)=>{!s&&h&&i(!0),o||c(performance.now()),a(h,g)},[s,a,i,o,c]);return[n,r,d.useMemo(()=>({onChange:p,onSubmit:m,setUserInput:a}),[p,m,a])]}const Z4=3e3;function TCe({handleSubmitQuery:e,isHomepage:t,contextUuid:n,disableSideBySide:r=!1}){const{isEnabled:s,sbsVariations:o,incrementTriggerCount:a}=s_e({frontendContextUUID:n,disableSideBySide:r});return d.useCallback(c=>{s?(a(),o.forEach(u=>{const{experiment_override:f,sibling_uuid:m,experiment_role:p}=u,h={experiment_role:p,sibling_uuid:m,experiment_override:f,selection_status:aa.SELECTION_STATUS_UNSPECIFIED,execution_log:{}},g={...c,newFrontendContextUUID:n,side_by_side_metadata:h};e(g)})):e(c)},[e,s,o,a,t,n])}const ACe=()=>{const{session:e}=Ne(),{trackEvent:t}=Xe(e),n=Rn(),r="clicked spaces ad",s=d.useCallback(async a=>{a.preventDefault(),t(r,{source:"createSpaceSidebar"}),n.push("/spaces/templates")},[t,n]),o=d.useCallback(async()=>{t("space mentioned in query"),U2e()},[t]);return d.useMemo(()=>({handleCreateSpaceSidebarAdClick:s,handleSubmitQueryWithMention:o}),[s,o])};function NCe({collection:e,onSubmit:t,redirectToNewThread:n=!0,csrRedirect:r=!1}){const{$t:s}=J(),{isCopilot:o}=Vn(),{submitQuery:a}=Ho(),{clear:i}=Vx(),c=Rn(),u=Vo(),{handleSubmitQueryWithMention:f}=ACe(),m=d.useMemo(()=>ua(),[]),p=d.useCallback(w=>{if(w.query.trim()==="")return;t?.(w),w.mentions&&w.mentions.some(E=>E.type==="space")&&f();const S=w.newFrontendContextUUID??ua(),C=ua();n&&(i(),a({rawQuery:w.query,dslQuery:w.dslQuery,mentions:w.mentions,copilotOverride:o?!0:void 0,attachments:w.attachments,collection:e||null,newFrontendContextUUID:S,promptSource:w.promptSource||"user",querySource:w.querySource,timeFromFirstType:w.timeFromFirstType,modelPreferenceOverride:w.modelPreferenceOverride,browserAgentAllowOnceFromToggle:w.browserAgentAllowOnceFromToggle,forceEnableBrowserAgent:w.forceEnableBrowserAgent,shouldRedirectToBackendUUID:!r,...w.side_by_side_metadata&&{side_by_side_metadata:w.side_by_side_metadata},frontendUUID:C,...w.canonicalPageContext&&{canonicalPageContext:w.canonicalPageContext},onThreadSlugReceived:E=>{if(!r)return;const T=window.location.pathname;T.startsWith(`${c.base}/search/`)&&MU(T.split("/").pop())&&c.replace(`/search/${E}`,"Home ask input")}}),r&&c.push(`/search/new/${C}`,void 0,"Home ask input"))},[t,n,i,a,o,e,r,c,f]),h=TCe({handleSubmitQuery:p,isHomepage:!0,contextUuid:m}),g=d.useRef(!1),y=d.useCallback(w=>{g.current||(g.current=!0,setTimeout(()=>g.current=!1,Z4),h(w))},[h]),[x,v,b]=wW({onSubmit:y,immediate:!r}),_=s(Nr[u].askInputPlaceholder);return[x,v,d.useMemo(()=>({...b,placeholder:_}),[b,_])]}const RCe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"sidecar-privacy-education",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},DCe=({platform:e,miniInstaller:t}={})=>{e=e??"mac_arm64";const n={channel:"stable",platform:e};(t??e.includes("win"))&&(n.mini="1");const s=new URLSearchParams(n),o=new URL("https://www.perplexity.ai/rest/browser/download");return o.search=s.toString(),o},jCe="COMET_USER",ICe=async()=>{try{const{data:e,error:t,response:n}=await de.GET("/rest/homepage-widgets/upsell","get upsells",{timeoutMs:Qe(),headers:{"X-Current-Path":window.location.pathname}});if(t)throw new he("API_CLIENTS_ERROR",{cause:t,status:n.status??0});return{upsell_information:e?.upsell_information??null,product_banner_information:e?.product_banner_information??null}}catch(e){return Z.error("Error getting homepage upsells",{error:e}),{upsell_information:null,product_banner_information:null}}},cl=async e=>{try{const{data:t,error:n,response:r}=await de.POST("/rest/sse/blocking_event_response","send blocking event response",{body:{response:e},timeoutMs:Qe()});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t?.status==="completed"}catch(t){return Z.error("Error sending blocking event response",{error:t,response:e}),!1}},PCe=async e=>{try{const{error:t,response:n}=await de.POST("/rest/homepage-widgets/upsell/add-to-cohort","add user to cohort",{body:{cohort:e},timeoutMs:Qe()});if(t)throw new he("API_CLIENTS_ERROR",{cause:t,status:n.status??0});return n.ok}catch(t){return Z.error("Error adding user to cohort",{error:t,cohort:e}),!1}},OCe=async()=>PCe(jCe),LCe=e=>{e.invalidateQueries({queryKey:i3(!0)}),e.invalidateQueries({queryKey:i3(!1)}),e.invalidateQueries({queryKey:Qye()})},Ovt=e=>{LCe(e),e.invalidateQueries({queryKey:iu()}),e.invalidateQueries({queryKey:Zy()})},FCe=({isUnsupportedDevice:e,isWindows:t})=>{const{session:n}=Ne(),{trackEvent:r}=Xe(n),{sendCometDownloadedEventSingular:s,sendCometDownloadButtonClickedEventSingular:o}=JM(),{openToast:a}=hn(),{openModal:i}=pn().legacy,{$t:c}=J(),u=d.useCallback(async(h,g)=>{a({message:c({defaultMessage:"Comet is downloading",id:"hCO9dUOI91"}),description:c({defaultMessage:"Check your browser's downloads to open the Comet installer.",id:"hRzUheg7aj"}),iconOverride:B("download"),variant:"success",timeout:5}),h||i("cometDownloadInstructionsModal",{requestedPlatform:g})},[a,c,i]),f=d.useCallback(async(h,{upsellName:g,partnerCode:y,preventDownloadInstructionsModal:x})=>{u(x,h),Ofe(),r("click download comet",{requestedPlatform:h,upsellName:g,installPartner:y}),s(),setTimeout(()=>No(DCe({platform:h}).href,"Comet download"),250)},[r,s,u]),m=d.useCallback(async({upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y})=>{if(!e)return await OCe(),t?f("win_x64",{upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y}):f("mac_arm64",{upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y})},[f,t,e]),p=d.useCallback(({upsellName:h,partnerCode:g})=>{o("download-comet"),m({upsellName:h,partnerCode:g})},[o,m]);return{handleDownload:m,handleDownloadClick:p}},BCe=(e,t)=>{const{value:n,loading:r}=zt({flag:"maybe-student-domains-regex",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};var u9;(function(e){e.SPRING_2025="SPRING_2025",e.GIVE_1_MONTH_FREE="GIVE_1MO_GET_1MO"})(u9||(u9={}));const UCe=async({email:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/referrals/validate-email",t,{params:{query:{email:e}},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to validate referral email",cause:r,status:s.status??0});return{valid:n.is_valid,error:!1}}catch(n){return Z.error(n),{valid:!1,error:!0}}},Lvt=async({referralCode:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/referrals/get-user-from-referral-code",t,{params:{query:{referral_code:e}}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user from referral code",cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get user from referral code",n),{email:null,is_student:null,is_active:!1}}},Fvt=async({headers:e,email:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/referrals/",n,{headers:e,params:{query:{email:t}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user referral status",cause:s,status:o.status??0});return r},Bvt=async({verificationId:e,reason:t})=>{try{if(!e)throw new Error("Verification ID is required");const{data:n,error:r,response:s}=await de.GET("/rest/referrals/student-reward-details",t,{params:{query:{verification_id:e}},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get student reward details",cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get student reward details",n),{months_awarded:1,reward_type:"default",organization:null,country_label:null}}},CW=({email:e,reason:t})=>{const{data:n,isLoading:r}=mt({queryKey:f2e(e),queryFn:()=>UCe({email:e,reason:t}),enabled:!!e});return d.useMemo(()=>({isStudent:n?.valid??null,loading:r}),[n?.valid,r])},VCe=async({reason:e,headers:t})=>{try{const{data:n}=await de.GET("/rest/academic/check-edu-institution",e,{timeoutMs:Cn.HIGH,headers:t});return n}catch(n){return Z.error("Failed to check institution",n),null}},HCe=({reason:e})=>mt({queryKey:o2e(),queryFn:()=>VCe({reason:e})}),zCe=({reason:e})=>{const{session:t}=Ne(),n=t?.user?.email??"",{isStudent:r,loading:s}=CW({email:n,reason:e}),{variation:o,loading:a}=BCe(!1),{data:i,isLoading:c}=HCe({reason:e});return d.useMemo(()=>c||a||s?{isLoading:!0,signals:{isVerifiedStudent:null,isPossibleStudentByEmail:null,isPossibleStudentByIP:null}}:{isLoading:!1,signals:{isVerifiedStudent:!!r,isPossibleStudentByEmail:!!o,isPossibleStudentByIP:!!i?.institution}},[c,a,s,o,r,i?.institution])},SW=()=>{const{openModal:e}=pn().legacy,{isMobileUserAgent:t}=Re(),n=Do(),r=d.useCallback(({origin:s,sheetModalVariant:o,closeCallback:a})=>{!t||n||e("installModal",{origin:s,sheetModalVariant:o,closeCallback:a})},[n,t,e]);return d.useMemo(()=>({openInstallUpsell:r}),[r])},du=({enabled:e})=>{const{openModal:t}=pn().legacy,{keysRequiringRerender:n,removeKeyRequiringRerender:r}=r4(),{isMobileUserAgent:s}=Re(),o=Wt(),{openInstallUpsell:a}=SW(),i=d.useCallback(({title:u,description:f,origin:m,image:p,imageAlt:h,closeCallback:g,loginButtonsStyle:y})=>{},[e,t,o]),c=d.useCallback(({title:u,description:f,origin:m,sheetModalVariant:p,closeCallback:h,overrideRedirectUrl:g,disallowedMethods:y,overrideMobileVariant:x=!1})=>{},[e,s,t,o]);return d.useEffect(()=>{e&&(n.includes("visitor-gate")&&(s&&!By()?a({origin:ft.VISITOR_GATE,sheetModalVariant:"inset-centered-sheet"}):c({origin:ft.VISITOR_GATE,sheetModalVariant:"bottom-sheet-gradient"}),r("visitor-gate")),n.includes("visitor-gate-ii")&&(s&&!By()?a({origin:ft.VISITOR_GATE,sheetModalVariant:"inset-centered-sheet"}):c({origin:ft.VISITOR_GATE}),r("visitor-gate-ii")))},[e,c,n,r,s,a]),d.useMemo(()=>({openVisitorLoginUpsell:c,openVisitorLoginImageUpsell:i}),[i,c])},WCe={currentStep:null,currentIndex:0,steps:[],handleNext:()=>null,handleComplete:()=>null,insertStep:()=>null,insertStepAndNavigate:()=>null,experimentVariationsMeta:{},setCurrentIndex:()=>null},EW=Ft("MultiStepContext",WCe),Uvt=({steps:e,experimentVariationsMeta:t,handleFinish:n,initialIndex:r=0,children:s})=>{const[o,a]=d.useState(r),[i,c]=d.useState(e),[u,f]=d.useState(null),[m,p]=d.useState(t),{session:h}=Ne(),{trackEventTyped:g}=Xe(h);d.useEffect(()=>{c(e)},[e]),d.useEffect(()=>{p(t)},[t]),d.useEffect(()=>{i[o]!==void 0&&g("step visited",{step:i[o],experimentVariationsMeta:m})},[o,m,i,g]),d.useEffect(()=>{if(u!==null){if(a(u),f(null),i[o]===void 0||i[u]===void 0)return;g("step transition",{sourceStep:i[o],destinationStep:i[u],isFinish:!1,experimentVariationsMeta:m})}},[o,m,u,i,g]);const y=(w,S)=>{const C=[...i];C.splice(S,0,w),c(C)},x=(w,S)=>{y(w,S),f(S)},v=()=>{if(i.length)if(o===i.length-1){if(n?.(),i[o]===void 0)return;g("step transition",{sourceStep:i[o],isFinish:!0,experimentVariationsMeta:m})}else{if(a(o+1),i[o]===void 0||i[o+1]===void 0)return;g("step transition",{sourceStep:i[o],destinationStep:i[o+1],isFinish:!1,experimentVariationsMeta:m})}},b=()=>{n?.(),i[o]!==void 0&&g("step transition",{sourceStep:i[o],isFinish:!0,experimentVariationsMeta:m})},_=d.useMemo(()=>i[o],[o,i]);return l.jsx(EW.Provider,{value:{currentStep:_,insertStep:y,insertStepAndNavigate:x,handleNext:v,handleComplete:b,currentIndex:o,steps:i,setCurrentIndex:a,experimentVariationsMeta:m},children:s})};function GCe(){const e=d.useContext(EW);if(!e)throw new Error("useMultiStep must be used within MultiStepContext");return e}const $Ce=({searchParams:e,cleanRedirect:t})=>{if(!e)return null;const r=e.get("redirect");let s=null;try{s=r&&new URL(r).searchParams.get(EM)}catch{return null}return s?s===ft.GROW_COMET_STUDENTS_COUNTRY?ft.GROW_COMET_STUDENTS_COUNTRY:s===ft.GROW_COMET_STUDENTS?ft.GROW_COMET_STUDENTS:null:null},qCe=()=>{const e=fn();return d.useMemo(()=>{const t=e?.get(EM),n=!!$Ce({searchParams:e,cleanRedirect:!1}),r=t===ft.STUDENT_REFERRAL_LANDING_PAGE,s=t===ft.STUDENT_LANDING_PAGE,o=t===ft.GROW_COMET_STUDENTS_COUNTRY;return{loginSource:t,isFromStudentCometGrowth:n,isFromStudentCometGrowthCountry:o,isFromStudentReferral:r,isFromStudentLanding:s,isFromStudentFlow:n||r||s||o}},[e])},KCe=(e,t)=>t.isFromStudentCometGrowthCountry?ft.GROW_COMET_STUDENTS_COUNTRY:t.isFromStudentCometGrowth?ft.GROW_COMET_STUDENTS:t.isFromStudentReferral?ft.STUDENT_REFERRAL_LANDING_PAGE:t.isFromStudentLanding?ft.STUDENT_LANDING_PAGE:e,YCe=({origin:e,customCallbacks:t})=>{const{$t:n}=J(),r=Wt(),{session:s}=Ne(),{trackEvent:o}=Xe(s),{openVisitorLoginUpsell:a}=du({enabled:!r}),{insertStepAndNavigate:i,currentIndex:c,handleComplete:u}=GCe(),{openModal:f}=pn().legacy,m=qCe(),h=fn()?.get("redirect"),{signals:g,isLoading:y}=zCe({reason:"combined_paywall"}),x=d.useCallback(w=>{if(w){if(m.isFromStudentCometGrowth){u();return}typeof window<"u"&&window.location.pathname==="/onboarding"?(_a.setItem("student_verification_id",w),i("onboarding-student-referrals",c+1)):setTimeout(()=>{f("studentReferrals",{verificationId:w})},150)}},[i,c,f,m,u]),v=d.useCallback(w=>{o("sheerid form redirect",{verificationLocationSource:KCe(e,m),verificationRoleType:w}),f("sheerIdModal",{type:w,onSuccess:t?.onSuccess??x,onClose:t?.onClose})},[x,e,o,m,f,t]),b=d.useCallback(w=>{if(!r){a({title:n({defaultMessage:"Sign in to unlock Education Pro",id:"UNeU1Y4Zdu"}),origin:m.loginSource??e,disallowedMethods:["apple"],overrideRedirectUrl:h??void 0});return}v(w)},[r,v,a,n,m.loginSource,e,h]),_=m.isFromStudentFlow||!!g.isVerifiedStudent||!!g.isPossibleStudentByEmail||!!g.isPossibleStudentByIP;return{isLoading:!!y,isVerifiedStudent:!!g.isVerifiedStudent,handleStudentTierClick:b,handleVerificationSuccess:x,shouldDefaultToStudent:_,signals:g}},QCe=`__merge-ah-script__${crypto.randomUUID()}`;async function XCe(){return oM({id:QCe,src:"https://ah-cdn.merge.dev/initialize.js"})}function ZCe(e){const t=d.useCallback(async()=>{const r=e?.linkToken;if(!r)throw new Error("Link token is required");await XCe(),await new Promise(s=>{window.AgentHandlerLink.initialize({...e,linkToken:r,enable_telemetry:!1,onReady:()=>s()})})},[e]);return d.useCallback(async()=>{await t(),window.AgentHandlerLink&&window.AgentHandlerLink.openLink(e)},[e,t])}function JCe({url:e,openInNewTab:t}){if(t){window.open(e,"_blank");return}No(e,"Enabling connector")}const J4=({reason:e})=>{const t=fn(),n=t?.get("referrer"),r=t?.get("referrerId"),{$t:s}=J(),{openToast:o}=hn(),a=d.useCallback(async({connectorName:i,redirectPath:c,customReferrer:u,customReferrerId:f,redirectOrigin:m,unauthedRedirectPath:p,openInNewTab:h=!1})=>{const g=await Pz({name:i,referrer:u??n??void 0,referrerId:f??r??void 0,redirectPath:c??void 0,redirectOrigin:m,unauthedRedirectPath:p??void 0,reason:e});if(!g){o({message:s({defaultMessage:"Unable to start connection.",id:"SPIzcd/Xa2"}),variant:"error",timeout:3});return}JCe({url:g,openInNewTab:h})},[e,n,r,s,o]);return d.useMemo(()=>({handleConnect:a}),[a])},d9="/account/connectors",f9={GCAL_CONNECT:"gcal_connect",CONNECTOR_COMPLETE:"connector_complete"},eSe={UPSELL_CONNECTOR:"upsell-connector-channel"},Vvt={GOOGLE:"google",OUTLOOK:"outlook"},Hvt={GCAL:"gcal"},ry="writable-spaces",Sm="recentCollections",tSe=e=>e?.toLowerCase(),sy=e=>tSe(e.status)==="pending",nSe=e=>e.find(t=>sy(t)&&t.backend_uuid),rSe=e=>!!(e&&Hi(e)&&"blocks"in e[0]),sSe=async({slugOrUUID:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/article/{article_uuid_or_slug}",n,{params:{path:{article_uuid_or_slug:e}},headers:t,timeoutMs:Qe({productionMs:3e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get article",cause:s,status:o.status??0});if(r.status!=="success")throw new he("API_CLIENTS_ERROR",{message:"Failed to get article - not successful",cause:r,status:o.status??0});return r.entries},m9=e=>e[0]?.article_info?{title:e[0].article_info.title||"",summary:e[0].article_info.summary||"",suggested_sections:e[0].article_info.suggested_sections||[],audience:e[0].article_info.audience||"anyone",read_time:e[0].article_info.read_time,emphasize_sources:e[0].article_info.emphasize_sources??!1,num_sections:e.length}:null,oSe={isBlocksApi:!1,article:[],heroSection:void 0,isLoading:!1,isPublished:!1,isOrgInternal:!1,inFlight:!1,inFlightLatest:!1,currentlyStreamingSection:void 0,socialStats:{forkCount:0,likeCount:0,viewCount:0,userLikes:!1},threadMetadata:{rwToken:void 0,contextUUID:void 0,frontendContextUUID:void 0,title:void 0,first_query:void 0,focus:void 0,author_id:void 0,author_username:void 0,author_image:void 0,parent_info:void 0,mode:void 0,personalized:!1,collection:void 0,thread_access:0,thread_url_slug:void 0,updated_datetime:void 0,expiry_time:void 0,privacy_state:WS.NONE},articleMetadata:{title:"",summary:"",suggested_sections:[],audience:"anyone",read_time:0,emphasize_sources:!1,num_sections:0},articleMedia:[],articleWebResults:[],relatedPages:[],articleLocalState:{isEditModeEnabled:!1,setEditModeEnabled:()=>{},isCreating:!1,setIsCreating:()=>{},isTitleVisible:!0,setTitleVisible:()=>{},clickedImage:null,setClickedImage:()=>{},clickedImageIndex:0,isRewritingSection:!1,setRewritingSection:()=>{}},refetch:()=>{}},kW=Ft("ArticleResultsContext",oSe),aSe=A.memo(({relatedPages:e=Pe,children:t,slug:n})=>{const r="article-results-provider",[s,o]=d.useState(!1),[a,i]=d.useState(!1),[c,u]=d.useState(null),[f,m]=d.useState(!0),[p,h]=d.useState(!1),{isEnterprise:g}=mo({reason:r}),y=Yt(),v=fn()?.get("newFrontendContextUUID"),[b,_]=d.useState(y.getQueryData(NR(n||"")));d.useEffect(()=>{if(v){_(v);return}const G=y.getQueryData(NR(n||""));_(G)},[v,y,n]);const{data:w,isLoading:S}=mt({enabled:!!n&&n!=="new",queryKey:b4(b||""),queryFn:()=>sSe({slugOrUUID:n,reason:r}),refetchOnMount:!0,placeholderData:Wl}),C=rSe(w),E=d.useMemo(()=>{if(!w||C)return;const G=w[w.length-1];return{inFlight:w.some(sy),inFlightLatest:G&&sy(G)}},[w,C]),T=E?.inFlight??!1,k=E?.inFlightLatest??!1,I=d.useMemo(()=>{if(!(!w||C))return nSe(w)},[w,C]),M=d.useMemo(()=>{if(!w||w.length===0)return null;const G=w[0];if(sy(G))return null;const H=G.social_info;return H?g3(H):g3()},[w]),N=d.useMemo(()=>!w||w.length===0?R_():R_(w[0]),[w]),D=d.useMemo(()=>w?m9(w):null,[w]),j=d.useMemo(()=>{const G=[];return w?.forEach(H=>{if(H.article_info.layout==="media-only"){const Y=(H.article_info.user_selected_media_items??[])?.filter(te=>te.medium==="image");G.push(...Y)}else{const Q=H?.media_items??[],Y=H?.featured_images??[];H.article_info.layout!=="text"&&(Hi(Y)&&Y[0].medium==="image"?G.push(Y[0]):Hi(Q)&&Q[0].medium==="image"&&G.push(Q[0]))}}),G},[w]),F=d.useMemo(()=>{if(!c)return 0;const G=j.findIndex(H=>H?.image===c?.image);return G>-1?G:0},[c,j]),R=d.useMemo(()=>{const G=new Map;return!w||w.length===0?[]:(w?.forEach(H=>{const Q=qt.parseAskTextField(H);Q?.web_results&&Q.web_results.forEach(Y=>{G.has(Y.url)?G.get(Y.url).count+=1:G.set(Y.url,{...Y,count:1})})}),Array.from(G.values()).sort((H,Q)=>Q.count-H.count).map(H=>({...H,count:void 0})))},[w]),P={isEditModeEnabled:s,setEditModeEnabled:o,isTitleVisible:f,setTitleVisible:m,isCreating:a,setIsCreating:i,clickedImage:c,setClickedImage:u,clickedImageIndex:F,isRewritingSection:p,setRewritingSection:h},L=N??R_(),U=g&&!!L.collection&&L.thread_access===os.COLLECTION_READ,O=!!g&&L.thread_access===os.ORG_READ,$=U||O||L.thread_access===os.PUBLIC_READ;return l.jsx(kW.Provider,{value:{isBlocksApi:C,article:w??[],isLoading:S,heroSection:w?.[0],lastSection:w?.[w.length-1],socialStats:M,isPublished:$,isOrgInternal:O,inFlight:T,inFlightLatest:k,currentlyStreamingSection:I,threadMetadata:L,articleMetadata:D??m9([]),articleLocalState:P,articleMedia:j,articleWebResults:R,relatedPages:e},children:t})});aSe.displayName="ArticleResultsProvider";const iSe=()=>{const e=d.useContext(kW);if(!e)throw new Error("useArticleResults must be used within ArticleResultsContext");return e},MW={searchTerm:"",updateUserInput:e=>{}},lSe=Ft("UserInputStateContext",MW),TW=()=>{const e=d.useContext(lSe);return e||MW};function cSe(e){return typeof e=="object"&&e!==null&&"pages"in e&&Array.isArray(e.pages)&&"pageParams"in e&&Array.isArray(e.pageParams)}const uSe=(e,t)=>e.getQueryData(["results"])?.find(r=>r.frontend_context_uuid===t)?.collection_info,dSe=(e,t)=>e.getQueryData(b4(t))?.find(r=>r.frontend_context_uuid===t)?.collection_info,fSe=(e,t,n)=>{e.setQueryData(b4(t),r=>r&&r.map(n))},mSe=[os.OWNER_ONLY,os.PRIVATE_READ,os.COLLECTION_READ],p9=(e,t,n,r,s)=>{const{entryUUID:o,frontendContextUUID:a,newCollectionUUID:i,newCollectionTitle:c,newCollectionEmoji:u,newCollectionSlug:f,newCollectionAccess:m,newCollectionUserPermission:p}=t,h={collection_info:{uuid:i,title:c,emoji:u,slug:f,access:m,user_permission:p},bookmark_state:"BOOKMARKED"};a&&(s(g=>g?g.map(y=>y.frontend_context_uuid===a?{...y,...h}:y):[]),e.setQueryData(be.makeQueryKey(r,{frontend_context_uuid:a}),g=>g?g.map(y=>y.frontend_context_uuid===a?{...y,...h}:y):[])),e.setQueryData(n,g=>{g=g||{pages:[],pageParams:[]};const y=g.pages.map(x=>x.map(v=>v.uuid===o?{...v,collection:{...v.collection,...h.collection_info}}:v));return{...g,pages:y}})},pSe=({reason:e})=>{const{searchTerm:t}=TW(),n=Yt(),{isEnterprise:r}=mo({reason:e}),{threadMetadata:s}=iSe(),o=el(),a=On();let i="results";const c=Lx({search_term:t??""}),u=Zye({search_term:t??""});let f=c,m=n2e,p=uSe;const h=j4();let g=d.useCallback((N,D,j)=>{h(F=>F&&F.map(j))},[h]);(a?.startsWith("/page")||a?.startsWith("/discover"))&&(i="articleResults",f=u,m=r2e,p=dSe,g=fSe);const y=d.useCallback(N=>{const D=!o&&!s?.rwToken;!r||D||h(j=>{if(j)return j.map(F=>{let R=!1,P=os.PRIVATE_READ;return N==="add"?(R=mSe.includes(F.thread_access??null),P=qt.isArticleMode(F)?os.PRIVATE_READ:os.COLLECTION_READ):(R=F.thread_access!==os.COLLECTION_READ,P=os.PRIVATE_READ),{...F,thread_access:R?F.thread_access:P}})})},[o,s?.rwToken,r,h]),{mutate:x}=Rt({mutationFn:async({title:N,description:D,emoji:j,instructions:F,accessLevel:R,existingCollection:P,enableWebByDefault:L,closeModal:U})=>(U(),C_e({collectionUuid:P.uuid,changes:{title:N,description:D,emoji:j,instructions:F,accessLevel:R,enableWebByDefault:L},reason:e})),onMutate:async N=>{const D=na(N.existingCollection.slug);await n.cancelQueries({queryKey:D});const j=n.getQueryData(D);return n.setQueryData(D,F=>({...F,title:N.title,description:N.description,emoji:N.emoji,instructions:N.instructions,access:N.accessLevel,enable_web_by_default:N.enableWebByDefault})),{previousCollection:j}},onSettled:(N,D,j,F)=>{const R=na(j.existingCollection.slug);D?n.setQueryData(R,F?.previousCollection):(n.setQueryData(R,P=>({...P,...N})),n.setQueryData(Xt(),P=>P?.pages?{...P,pages:P.pages.map(L=>L.map(U=>U.uuid===j.existingCollection.uuid?{...U,...N}:U))}:P),n.invalidateQueries({queryKey:wm()}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:be.makeQueryKey(ry)}))}}),{mutate:v}=Rt({mutationFn:async({accessLevel:N,collectionUuid:D})=>{await c_e({params:{collection_uuid:D,updated_access:N},reason:e})},onMutate:async N=>{const D=na(N.collectionSlug);await n.cancelQueries({queryKey:D});const j=n.getQueryData(D);return n.setQueryData(D,F=>({...F,access:N.accessLevel})),{previousCollection:j}},onSettled:async(N,D,j,F)=>{D?n.setQueryData(Xt(),F?.previousCollection):(await n.invalidateQueries({queryKey:h2e()}),await n.invalidateQueries({queryKey:na(j.collectionSlug)}),n.invalidateQueries({queryKey:wm()}))}}),{mutate:b}=Rt({mutationFn:async({entryUUID:N,title:D,description:j,emoji:F,instructions:R,accessLevel:P,callback:L,frontendContextUUID:U})=>{const O=await XR({params:{title:D,description:j,emoji:F,instructions:R,accessLevel:P},reason:e});return await I0({params:{new_collection_uuid:O.uuid,entry_uuid:N,return_collection:!1,return_thread:!1},reason:e}),L(O),y("add"),{title:D,description:j,emoji:F,instructions:R,accessLevel:P,newCollection:O}},onMutate:async({entryUUID:N,frontendContextUUID:D,...j})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()});const F=n.getQueryData(f),R=n.getQueryData(Xt());n.setQueryData(Xt(),L=>{L=L||{pages:[],pageParams:[]};const U=(L&&L.pages&&L.pages[0])??[],$={...U?.length>0?U[0]:[],...j,uuid:Si,thread_count:1};return{...L,pages:[[$,...U]]}}),n.setQueryData(f,L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>$.uuid===N?{...$,collection:{...$.collection,description:j.description,uuid:Si,title:j.title,emoji:j.emoji}}:$));return{...L,pages:U}}),n.setQueryData(m(N),L=>{const U=L?.collection_info??{};return{...L,collection_info:{...U,uuid:Si,description:j.description,title:j.title,emoji:j.emoji}}});let P=null;return D&&(P=p(n,D)??null,g(n,D,L=>L.frontend_context_uuid===D?{...L,collection_info:{...L.collection_info,uuid:Si,title:j.title,emoji:j.emoji},bookmark_state:"BOOKMARKED"}:L)),{previousThreads:F,previousCollections:R,previousCollectionInfo:P}},onSettled:(N,D,j,F)=>{D?(n.setQueryData(f,F.previousThreads),n.setQueryData(Xt(),F.previousCollections),j.frontendContextUUID&&g(n,j.frontendContextUUID,R=>R.frontend_context_uuid===j.frontendContextUUID?{...R,collection_info:F?.previousCollectionInfo??null,bookmark_state:F?.previousCollectionInfo?"BOOKMARKED":"NOT_BOOKMARKED"}:R)):(n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:wm()}),j.frontendContextUUID&&g(n,j.frontendContextUUID,R=>R.frontend_context_uuid===j.frontendContextUUID?{...R,collection_info:{...R.collection_info,uuid:N?.newCollection?.uuid,title:N?.newCollection?.title,emoji:N?.newCollection?.emoji,slug:N?.newCollection?.slug},bookmark_state:"BOOKMARKED"}:R))}}),{mutate:_}=Rt({mutationFn:async({title:N,description:D,emoji:j,instructions:F,accessLevel:R,template_id:P,callback:L})=>{const U=await XR({params:{title:N,description:D,emoji:j,instructions:F,accessLevel:R,template_id:P},reason:e});return L(U),{collection:U}},onMutate:async({...N})=>{n.setQueryData(Xt(),D=>{D=D||{pages:[],pageParams:[]};const j=D.pages[0]||[],F={...j.length>0?j[0]:{},...N,uuid:Si,thread_count:0};return{...D,pages:[[F,...j]]}})},onSuccess:async()=>{n.refetchQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:wm()}),n.invalidateQueries({queryKey:be.makeQueryKey(ry)})}}),{mutate:w}=Rt({mutationFn:async({entryUUID:N})=>{const D=await I0({params:{entry_uuid:N,upsert_type:"bookmark",return_collection:!0,return_thread:!1},reason:e});return y("add"),D},onMutate:async({entryUUID:N,topic:D})=>{const j=n.getQueryData(dc(D));let F;for(const R of j?.pages??[])for(const P of R.threads)if(P.uuid===N){F=P.collection;break}return n.setQueryData(dc(D),R=>{if(R)return{pageParams:R.pageParams,pages:R.pages.map(P=>({...P,threads:P.threads.map(L=>({...L,collection:L.uuid===N?{uuid:Si,title:"Bookmarks",emoji:"1f516",slug:Si}:L.collection}))}))}}),{previousCollection:F}},onSettled:(N,D,j,F)=>{const{entryUUID:R,topic:P}=j;if(D||!N)F?.previousCollection&&n.setQueryData(dc(P),L=>{if(L)return{pageParams:L.pageParams,pages:L.pages.map(U=>({...U,threads:U.threads.map(O=>({...O,collection:O.uuid===R?F.previousCollection:O.collection}))}))}});else{const{updated_collection:L}=N,{uuid:U,title:O,emoji:$,slug:G}=L;n.setQueryData(dc(P),H=>{if(H)return{pageParams:H.pageParams,pages:H.pages.map(Q=>({...Q,threads:Q.threads.map(Y=>({...Y,collection:Y.uuid===R?{uuid:U,title:O,emoji:$,slug:G}:Y.collection}))}))}})}}}),{mutate:S}=Rt({mutationFn:async({entryUUID:N,topic:D,oldCollectionUUID:j})=>(await YR({collectionUUID:j,entryUUID:N,reason:e}),{topic:D}),onMutate:async({entryUUID:N,topic:D})=>{const j=n.getQueryData(dc(D));let F;for(const R of j?.pages??[])for(const P of R.threads)if(P.uuid===N){F=P.collection;break}return n.setQueryData(dc(D),R=>{if(R)return{pageParams:R.pageParams,pages:R.pages.map(P=>({...P,threads:P.threads.map(L=>({...L,collection:L.uuid===N?void 0:L.collection}))}))}}),{previousCollection:F}},onSettled:(N,D,j,F)=>{const{entryUUID:R,topic:P}=j;D&&F?.previousCollection&&n.setQueryData(dc(P),L=>{if(L)return{pageParams:L.pageParams,pages:L.pages.map(U=>({...U,threads:U.threads.map(O=>({...O,collection:O.uuid===R?F.previousCollection:O.collection}))}))}})}}),{mutate:C}=Rt({mutationFn:async({entryUUID:N,frontendContextUUID:D})=>{const j=await I0({params:{entry_uuid:N,upsert_type:"bookmark",return_collection:!0,return_thread:!1},reason:e});return y("add"),{response:j,entryUUID:N,frontendContextUUID:D}},onMutate:async({frontendContextUUID:N})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()}),h(D=>D&&D.map(j=>j.frontend_context_uuid===N?{...j,bookmark_state:"BOOKMARKED",collection_info:{uuid:null,title:"Bookmarks",emoji:"1f516",slug:null,access:null,user_permission:as.OWNER_DEFAULT_BOOKMARKS}}:j))},onSettled:async(N,D)=>{if(!N||!N.response?.updated_collection)return;const j=N.response.updated_collection,F=N.entryUUID,R=N.frontendContextUUID,{uuid:P,title:L,emoji:U=null,slug:O,access:$,user_permission:G}=j;await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()}),p9(n,{entryUUID:F,frontendContextUUID:R,newCollectionUUID:P,newCollectionTitle:L,newCollectionEmoji:U,newCollectionSlug:O,newCollectionAccess:$,newCollectionUserPermission:G},f,i,h),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:R})})}}),{mutate:E}=Rt({mutationFn:async({entryUUID:N,currentCollectionUUID:D,newCollectionTitle:j,newCollectionUUID:F,newCollectionSlug:R,newCollectionAccess:P,closeModal:L,callback:U})=>{if(F!==Si)return L(),await I0({params:{new_collection_uuid:F,entry_uuid:N,return_collection:!1,return_thread:!1},reason:e}),U?.(),y("add"),{entryUUID:N,currentCollectionUUID:D,newCollectionTitle:j,newCollectionUUID:F,newCollectionSlug:R,newCollectionAccess:P,closeModal:L}},onMutate:async({entryUUID:N,frontendContextUUID:D,currentCollectionUUID:j,newCollectionUUID:F,newCollectionTitle:R,newCollectionEmoji:P,newCollectionSlug:L,newCollectionAccess:U,newCollectionUserPermission:O})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()});const $=n.getQueryData(f),G=n.getQueryData(Xt());return p9(n,{entryUUID:N,frontendContextUUID:D,newCollectionUUID:F,newCollectionTitle:R,newCollectionEmoji:P,newCollectionSlug:L,newCollectionAccess:U,newCollectionUserPermission:O},f,i,h),n.setQueryData(Xt(),H=>{H=H||{pages:[],pageParams:[]};const Q=H.pages.map(Y=>Y.map(te=>te.uuid===j?{...te,thread_count:te.thread_count-1}:te.uuid===F?{...te,thread_count:te.thread_count+1}:te));return{...H,pages:Q}}),{previousThread:$,previousCollections:G}},onSettled:(N,D,j,F)=>{if(D)n.setQueryData(f,F.previousThread),n.setQueryData(Xt(),F.previousCollections);else{const R=bd({collection_slug:j.existingCollectionSlug??""}),P=bd({collection_slug:j.newCollectionSlug});n.invalidateQueries({queryKey:na(j.newCollectionSlug)}),n.invalidateQueries({queryKey:R}),n.refetchQueries({queryKey:P}),n.refetchQueries({queryKey:m(j.entryUUID)}),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:j.frontendContextUUID})}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)})}}}),{mutate:T}=Rt({mutationFn:async({entryUUID:N,oldCollectionUUID:D,callback:j})=>{if(D)return await YR({collectionUUID:D,entryUUID:N,reason:e}),j?.(),y("remove"),{entryUUID:N,oldCollectionUUID:D}},onMutate:async({entryUUID:N,oldCollectionUUID:D,frontendContextUUID:j,collectionSlug:F})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()});const R=n.getQueryData(f),P=n.getQueryData(Xt());return j&&(h(L=>L?L.map(U=>U.frontend_context_uuid===j?{...U,collection_info:void 0,bookmark_state:"NOT_BOOKMARKED"}:U):[]),n.setQueryData(be.makeQueryKey(i,{frontend_context_uuid:j}),L=>L?L.map(U=>U.frontend_context_uuid===j?{...U,collection_info:null,bookmark_state:"NOT_BOOKMARKED"}:U):[])),n.setQueryData(f,L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>N===$.uuid&&$.collection?.uuid===D?{...$,collection:null}:$));return{...L,pages:U}}),n.setQueryData(Xt(),L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>$.uuid===D?{...$,thread_count:$.thread_count-1}:$));return n.setQueryData(m(N),O=>O&&Array.isArray(O.pages)?{...O,pages:O.pages.map($=>$.map(G=>G.uuid===N?{...G,collection_info:null}:G))}:{...O,collection_info:null}),{...L,pages:U}}),F&&n.setQueriesData({queryKey:v4(F),exact:!1},L=>cSe(L)?{...L,pages:L.pages.map(U=>U.filter(O=>O.uuid!==N))}:L),{previousThreads:R,previousCollections:P}},onError:(N,D,j)=>{j&&(n.setQueryData(f,j.previousThreads),n.setQueryData(Xt(),j.previousCollections))},onSuccess:(N,D)=>{if(n.invalidateQueries({queryKey:m(D.entryUUID)}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:D.frontendContextUUID})}),D.collectionSlug){const j=bd({collection_slug:D.collectionSlug});n.invalidateQueries({queryKey:j}),n.invalidateQueries({queryKey:na(D.collectionSlug)})}}}),{mutate:k}=Rt({mutationFn:async N=>{await S_e({collectionUuid:N,reason:e})},onSuccess:(N,D)=>{n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:wm()}),n.invalidateQueries({queryKey:be.makeQueryKey(ry)}),n.invalidateQueries({queryKey:pp()}),n.setQueryData(Xt(),j=>!j||!j.pages?j:{...j,pages:j.pages.map(F=>F.filter(R=>R.uuid!==D))})}}),{mutate:I}=Rt({mutationFn:async({collectionUuid:N,link:D,reason:j})=>{const{data:F,error:R,response:P}=await de.POST("/rest/collections/focused_web_config/links",j,{timeoutMs:Qe(),body:{collection_uuid:N,link:D},numRetries:1});if(R)throw new he("API_CLIENTS_ERROR",{cause:R,status:P.status??0,details:{reason:j}});return F},onSettled:(N,D,j,F)=>{n.invalidateQueries({queryKey:na(j.collectionSlug)})}}),{mutate:M}=Rt({mutationFn:async({collectionUuid:N,link:D,reason:j})=>{const{error:F,response:R}=await de.DELETE("/rest/collections/focused_web_config/links",j,{body:{collection_uuid:N,link:D},timeoutMs:Qe(),numRetries:1});if(F)throw new he("API_CLIENTS_ERROR",{cause:F,status:R.status??0})},onSettled:(N,D,j,F)=>{n.invalidateQueries({queryKey:na(j.collectionSlug)})}});return d.useMemo(()=>({updateCollectionInfo:x,updateCollectionAccessLevel:v,createCollectionForThread:b,createCollection:_,bookmarkFromFeed:w,removeBookmarkFromFeed:S,firstTimeBookmark:C,swapThreadCollection:E,removeThreadFromCollection:T,deleteCollection:k,addLink:I,removeLink:M}),[I,w,b,_,k,C,S,M,T,E,v,x])},hSe=()=>{const{$t:e}=J(),t=Rn(),{createCollection:n,createCollectionForThread:r}=pSe({reason:"create-new-space"}),s=d.useCallback(()=>{const a=e({defaultMessage:"New Space",id:"t5xj3BH/Ni"});n({title:a,description:"",emoji:"",instructions:"",accessLevel:B7,enableWebByDefault:!0,callback:i=>{t.push(`/spaces/${i.slug}`)}})},[n,e,t]),o=d.useCallback((a,i)=>{const c=e({defaultMessage:"New Space",id:"t5xj3BH/Ni"});r({title:c,description:"",emoji:"",instructions:"",accessLevel:B7,enableWebByDefault:!0,entryUUID:a,frontendContextUUID:i,callback:u=>{t.push(`/spaces/${u.slug}`)}})},[r,e,t]);return d.useMemo(()=>({handleCreateNewSpace:s,handleCreateNewSpaceForThread:o}),[s,o])};function gSe({reason:e}){const t=Yt(),n=iu();return Rt({mutationKey:["publishArticleMutation"],mutationFn:async({connectorName:r,connectionUUID:s,deleteFiles:o,autoDeleteEmailAssistant:a})=>a?await QR({connectorName:r,reason:e,autoDeleteEmailAssistant:a,connectionUUID:s}):s&&!o?await y_e({connectionUUID:s,reason:e}):s&&o?await x_e({connectionUUID:s,reason:e}):await QR({connectorName:r,reason:e,autoDeleteEmailAssistant:a}),onSettled:async(r,s,o)=>{await t.refetchQueries({queryKey:n}),o.autoDeleteEmailAssistant&&(await t.invalidateQueries({queryKey:m2e()}),await t.invalidateQueries({queryKey:p2e()}))},onMutate:async({connectorName:r,connectionUUID:s})=>{t.setQueryData(n,o=>{if(!o)return o;const a=o.connectors.connectors.map(i=>i.name===r&&(!s||i.connection_uuid===s)?{...i,connected:!1}:i);return{...o,connectors:{connectors:a}}})}})}const eT=async e=>{try{const{error:t}=await de.POST("/rest/homepage-widgets/upsell/interacted","homepage upsell interaction tracking",{body:{upsell_name:e.upsellName,upsell_instance_identifier:e.upsellInstanceIdentifier||null,interaction_type:e.interactionType||null},timeoutMs:Qe(),numRetries:1});t&&Z.error("Failed to mark upsell as interacted",{upsellName:e.upsellName,upsellInstanceIdentifier:e.upsellInstanceIdentifier,interactionType:e.interactionType,error:t})}catch(t){Z.error("Error marking upsell as interacted",{upsellName:e.upsellName,upsellInstanceIdentifier:e.upsellInstanceIdentifier,interactionType:e.interactionType,error:t})}},ag=()=>{const e=Wt(),{isMax:t}=$t(),{openModal:n}=pn().legacy,r=un(!1);return d.useCallback(o=>{if(!e){Z.warn("User is not logged in, skipping paywall upsell",o);return}if(t){Z.warn("User is on Max tier, skipping paywall upsell",o);return}if(Do()){if(!r){Z.error("Comet adapter not available in mobile Comet browser context");return}r.openNativeSheet("upgrade");return}n("pricingModal",o)},[e,n,t,r])};class AW extends Error{constructor(){super("Failed to open popup window")}}function ySe(e){const{url:t,name:n,options:r="width=600,height=700,popup=1",pollIntervalMs:s=500}=e;return new Promise((o,a)=>{const i=window.open(t,n,r);if(!i){a(new AW);return}const c=setInterval(()=>{i.closed&&(clearInterval(c),o())},s)})}const xSe={logged_out_image_generation:ft.IMAGE_GENERATION_IN_THREAD,logged_out_video_generation:ft.VIDEO_GENERATION_IN_THREAD,subscription_upgrade_video_generation:ft.VIDEO_GENERATION_IN_THREAD,missing_out_on_pro:ft.MISSING_OUT_ON_PRO_IN_THREAD,auto_upgrade_to_pro:ft.AUTO_UPGRADE_TO_PRO,pro_feature_limit_queries:ft.PRO_FEATURE_LIMIT_BANNER,pro_feature_limit_files:ft.PRO_FEATURE_LIMIT_BANNER,login_for_comet_agent_queries:ft.LOGIN_FOR_COMET_AGENT_QUERIES_IN_THREAD,comet_agent_queries_rate_limited:ft.COMET_AGENT_QUERIES_RATE_LIMITED_IN_THREAD,pro_upgrade:ft.PRO_UPGRADE_IN_SIDE_HOMEPAGE,max_feature_limit_labs_queries:ft.PRO_FEATURE_LIMIT_BANNER,enterprise_max_side:ft.ENTERPRISE_MAX_UPSELL,logged_out_canvas_generation:ft.CANVAS_GENERATION_IN_THREAD,free_user_canvas_generation:ft.CANVAS_GENERATION_IN_THREAD,pro_user_canvas_generation:ft.CANVAS_GENERATION_IN_THREAD,wait_for_browser_agent_confirmation:ft.BROWSER_AGENT_CONFIRMATION_IN_THREAD,research_upsell:ft.RESEARCH_UPSELL_IN_THREAD},kl=({upsellInformation:e,inFlight:t,options:n})=>{const r="upsell",s=Wt(),{openVisitorLoginUpsell:o}=du({enabled:!s}),{session:a}=Ne(),{trackEvent:i}=Xe(a),{lastResult:c}=on(),{openModal:u,closeModal:f}=pn().legacy,m=Yt();Ca();const p="?handle_upsell=true",{submitQuery:h}=Ho(),g=un(),{handleVerificationSuccess:y}=YCe({origin:ft.STUDENT_VERIFICATION_UPSELL}),x="sidecar_thread",{subscriptionTier:v}=$t(),{device:{isWindowsOS:b,isMacOS:_}}=sn(),w=Rn(),{handleConnect:S}=J4({reason:r}),{mutateAsync:C}=gSe({reason:r}),{handleCreateNewSpaceForThread:E}=hSe(),{connectors:T}=Ea({reason:r}),{overwriteSources:k,sources:I}=og({reason:r}),{handleDownloadClick:M}=FCe({isWindows:b,isUnsupportedDevice:!_&&!b}),N=ag(),{openToast:D}=hn(),{$t:j}=J(),F=e?.cta_information?.merge_auth_token,P=ZCe({linkToken:(ae=>{if(ae)try{return JSON.parse(ae)}catch{return ae}})(F),onSuccess:()=>{if(e?.cta===tn.MERGE_AUTH_CONNECTOR)return L();if(e?.cta===tn.ALLOW_CONNECTOR_AUTH)return U()}}),L=d.useCallback(()=>{const ae=e?.cta_information?.merge_auth_callback_uuid;ae&&JH({uuid:ae,success:!0,reason:"Account successfully connected"}),w.push(window.location.pathname+p)},[w,e,p]),U=d.useCallback(()=>{const ae=e?.backend_uuid||c?.backend_uuid;cl({uuid:ae,event_type:"CONNECTOR_AUTH",connector_auth_action:!0})},[e,c?.backend_uuid]),O=d.useCallback(async ae=>{const X=ae.cta_information?.connector_auth_url,ee=ae.backend_uuid||c?.backend_uuid;if(!X){Z.error("[ALLOW_CONNECTOR_AUTH] Connector auth URL is not defined",{upsellInformation:ae});return}if(!ee){Z.error("[ALLOW_CONNECTOR_AUTH] Backend UUID is not defined",{upsellInformation:ae});return}try{await ySe({url:X,name:"connector-auth"}),await cl({uuid:ee,event_type:"CONNECTOR_AUTH",connector_auth_action:!0}),n?.hideUpsell?.()}catch(le){le instanceof AW&&D({message:j({defaultMessage:"Failed to open popup window",id:"qLj32oAyS7"}),variant:"error",timeout:null}),Z.error("[ALLOW_CONNECTOR_AUTH] Connector auth failed",{upsellInformation:ae,error:le})}},[c?.backend_uuid,n,j,D]),$=d.useCallback(async ae=>{if(!ae.cta_information?.merge_auth_token){Z.error("[ALLOW_CONNECTOR_AUTH] Merge auth token is not defined",{upsellInformation:ae}),D({message:j({defaultMessage:"Failed to start authentication",id:"VykWDR53do"}),variant:"error",timeout:null});return}P()},[D,j,P]),G=d.useCallback(async ae=>ae.cta_information?.merge_auth_token?$(ae):O(ae),[$,O]),H=d.useCallback(async()=>{try{await g.setCometAsDefaultBrowser("set_default_browser")}catch{}},[g]);d.useEffect(()=>{const ae=new BroadcastChannel(eSe.UPSELL_CONNECTOR);return ae.onmessage=X=>{X.data.type===f9.CONNECTOR_COMPLETE&&(window.focus(),No(window.location.pathname+p,"Connector complete"))},()=>{ae.close()}},[p]);const Q=d.useCallback(()=>{if(!e)return;switch(e.app_location){case Ns.MODAL:i("upsell modal opened",{entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.IN_THREAD:case Ns.IN_THREAD_BOTTOM:case Ns.IN_THREAD_INPUT:i("thread upsell banner clicked",{entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata,cta:e.cta});break;case Ns.SIDEBAR:case Ns.SIDE_CARD:i("side upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.BANNER:i("banner upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.COMET_NTP_BANNER:i("ntp banner upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break}const ae=e.app_location===Ns.MODAL?"upsell viewed":"upsell clicked";i(ae,{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata,cta:e.cta})},[c,i,e,x,v]),Y=d.useCallback(()=>{c?.query_str&&h({rawQuery:c.query_str,existingEntryUUID:c.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:c.frontend_context_uuid,promptSource:"user",querySource:"rewrite-upsell",attachments:[],modelPreferenceOverride:e?.cta_information?.model_preference??"pplx_pro"})},[c,h,e]),te=d.useCallback(()=>{if(!e)return;const{permalink_new_tab:ae,permalink:X}=e.cta_information??{};X&&(ae?window.open(X,"_blank"):No(X,"Upsell permalink"))},[e]);return d.useCallback(()=>{if(!e)return;const ae=e.cta===tn.SHORTCUT_MODAL?e.cta_information?.recommended_shortcut?.name:void 0;eT({upsellName:e.name,upsellInstanceIdentifier:ae,interactionType:"click"}),Q();const X=xSe[e.name]??ft.UNSPECIFIED_GENERALIZED_UPSELL;let ee=c?.thread_url_slug?`/search/${c.thread_url_slug}${p}`:void 0;(window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants"))&&(ee=`/b/assistants${p}`);const re=c?.thread_url_slug?`/search/${c.thread_url_slug}`:void 0;switch(e.cta){case tn.SIGN_UP_OR_LOGIN:return;case tn.PRO_UPGRADE:{if((e.app_location===Ns.IN_THREAD||e.app_location===Ns.IN_THREAD_BOTTOM||e.app_location===Ns.IN_THREAD_INPUT)&&Do()){g.openNativeSheet("upgrade");break}N({pitchMessage:e.cta_information?.upgrade_paywall_title?{title:e.cta_information.upgrade_paywall_title}:void 0,origin:X,defaultSegment:e.upsell_type===Qs.UPGRADE_TO_ENTERPRISE?"business":void 0});break}case tn.THREAD_TO_SPACE:{if(!c?.backend_uuid)return;E(c?.backend_uuid,c?.frontend_context_uuid);break}case tn.CONNECTOR:{const ce=e.cta_information?.connector_type;if(ce==="gcal")window.open(`${window.location.origin}${d9}?connector_type=${f9.GCAL_CONNECT}`,"_blank");else if(ce){const me=T?.connectors?.find(we=>we.connection_type===ce)?.name;if(!me||!Iz(me)){w.push(d9);break}S({connectorName:me,redirectPath:ee,unauthedRedirectPath:re})}else Z.error("Unhandled upsell connector type",{connectorType:ce});break}case tn.REWRITE_ANSWER:t&&c?.backend_uuid?au({entryUUID:c?.backend_uuid,reason:"rewrite-upsell"}).catch(()=>{Z.error("Error terminating entry")}).finally(Y):Y();break;case tn.PERMALINK:{te();break}case tn.SET_DEFAULT_BROWSER:{H();break}case tn.IMAGE_ANNOUNCEMENT_MODAL:{if(!e.image_asset||!e.image_asset_low_res||!e.button_text)return;let ce=e.cta;e.upsell_type===Qs.DOWNLOAD_COMET?ce=tn.COMET_DOWNLOAD:e.upsell_type===Qs.OPEN_PERMALINK&&(ce=tn.PERMALINK),u("announcementImageModal",{imageUrlHd:e.image_asset,imageUrlLowRes:e.image_asset_low_res,title:e.title??"",description:e.description??"",upsellInformation:{...e,cta:ce}});break}case tn.COMET_DOWNLOAD:{M({upsellName:e.name});break}case tn.COMET_DOWNLOAD_1MO_PRO_INCENTIVE:{const ce=e.cta_information?.flow_type,ue=e.cta_information?.trial_extension_id;ce&&ue&&gwe({reason:"comet_upsell_clicked",flowType:ce,trialExtensionId:ue}),M({upsellName:e.name});break}case tn.MERGE_AUTH_CONNECTOR:{F&&P();break}case tn.SHORTCUT_MODAL:{const ce=e.cta_information?.recommended_shortcut;u("taskShortcutModal",{source:"thread_upsell_create",onCreated:n?.hideUpsell,shortcut:ce?{title:ce.name,prompt:ce.prompt}:void 0});break}case tn.VIRTUAL_TRY_ON_ONBOARDING_MODAL:{u("shoppingTryOnOnboardingModal",{onSuccessfulOnboarding:ce=>{m.setQueryData(Jye(),{try_on_photo_url:ce}),m.setQueryData(e2e(),!1),D({message:j({defaultMessage:"Avatar updated successfully!",id:"tjpCN5PY48"}),variant:"success",timeout:3})},onClose:()=>{f()}});break}case tn.OPEN_SHEERID_MODAL:{i("sheerid form redirect",{verificationLocationSource:ft.STUDENT_VERIFICATION_UPSELL,verificationRoleType:"student"}),u("sheerIdModal",{onSuccess:y,type:"student"});break}case tn.CONTINUE_GENERATION:{if(e.upsell_type===Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"CANVAS_GENERATION_CONFIRMATION",canvas_generation_action:!0}).then(()=>{n?.hideUpsell?.()}).catch(ue=>{Z.error("Error sending canvas confirmation",{error:ue})})}break}case tn.NO_CANVAS_GENERATION:{if(e.upsell_type===Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"CANVAS_GENERATION_CONFIRMATION",canvas_generation_action:!1}).then(()=>{n?.hideUpsell?.()}).catch(ue=>{Z.error("Error sending canvas cancellation",{error:ue})})}break}case tn.SKIP_BROWSER_AGENT:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"SKIP"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent skip",{error:ue}),D({message:j({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case tn.ALLOW_BROWSER_AGENT_ONCE:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"ALLOW_ONCE"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent allow once",{error:ue}),D({message:j({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case tn.ALWAYS_ALLOW_BROWSER_AGENT:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"ALWAYS_ALLOW"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent always allow",{error:ue}),D({message:j({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case tn.TOGGLE_SOURCES:{const ce=e.cta_information?.sources_to_toggle;if(ce&&ce.length>0){const ue=Fx(ce);if(ue.length>0){const me=I||[],we=ue.filter(ye=>!me.includes(ye));if(we.length>0){const ye=[...me,...we];k(ye)}}n?.hideUpsell?.()}break}case tn.FULLSCREEN_MODAL:{u("fullscreenUpsellModal",{upsellInformation:e});break}case tn.ALLOW_CONNECTOR_AUTH:{G(e);break}}},[g,e,Q,c?.thread_url_slug,c?.backend_uuid,c?.frontend_context_uuid,p,o,N,u,t,E,T?.connectors,S,C,Y,te,H,M,y,F,P,n,i,j,D,f,m,w,k,I,G])},NW=({enabled:e=!0}={})=>{const n=On()==="/",{data:r,isLoading:s,isError:o}=mt({enabled:e,queryKey:i3(n),queryFn:ICe,staleTime:1/0,gcTime:1/0});return{upsellInformation:r?.upsell_information??null,productBanner:r?.product_banner_information??null,isLoading:s,isError:o}},qs={pro:Kme,collection:Kh,research:hM,labs:pM,comet_login:gM,invite:B("mail"),pro_perks:B("heart-handshake"),app:B("layout-collage"),slides:B("presentation"),document:B("file"),plaintext:B("file"),canvas:B("file"),advanced_models:B("cpu")},vSe=()=>{const{upsellInformation:e}=NW(),{session:t}=Ne(),{trackEvent:n,trackEventOnce:r}=Xe(t),s=kl({upsellInformation:e??void 0}),[o,a]=d.useState(!1);d.useEffect(()=>{e&&e.app_location==="BANNER"&&(a(!0),r("banner upsell viewed",{upsellName:e.name,upsellType:e.upsell_type,upsellUuid:e.upsell_uuid,eventMetadata:e.event_metadata}),r("upsell viewed",{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,upsellName:e.name,upsellType:e.upsell_type,eventMetadata:e.event_metadata}))},[e,r]);const i=d.useCallback(()=>{e&&(n("banner upsell dismissed",{upsellName:e.name,upsellType:e.upsell_type,upsellUuid:e.upsell_uuid,eventMetadata:e.event_metadata}),n("upsell dismissed",{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,upsellName:e.name,upsellType:e.upsell_type,eventMetadata:e.event_metadata}),a(!1),eT({upsellName:e.name,interactionType:"dismiss"}))},[e,n]),c=d.useMemo(()=>{if(e&&e.icon_reference&&e.icon_reference in qs)return qs[e.icon_reference]},[e]);return d.useMemo(()=>({show:o&&!!e,onDismiss:i,onClick:s,icon:c,title:e?.title,actionLabel:e?.button_text}),[i,s,o,c,e])},h9={RAMP:"Welcome Ramp members. Your 6 month Perplexity Pro free trial starts now!",FREEATT:"Welcome ATT Employees. Your complimentary 1-year subscription starts now!",FREEAWS:"Welcome AWS Employees. Your complimentary 1-year subscription starts now!",RABBIT:"Welcome r1 owners. Your complimentary 1-year Perplexity Pro subscription starts now!",FREEUT:"Welcome UT Staff. Your complimentary 1-year Perplexity Pro subscription starts now!",FREEDATABRICKS:"Welcome Databricks team. Your complimentary 1-year Perplexity Pro subscription starts now!",FREESRA:"Welcome SRA team. Your complimentary 1-year Perplexity Pro subscription starts now!",HBSTECH:"Welcome HBS Tech Conference Attendees. Your complimentary 6 month Perplexity Pro subscription starts now!",HBSSTAFF:"Welcome HBS Tech Conference Attendees. Your complimentary 1 year Perplexity Pro subscription starts now!",FREENEWSROOM:"Welcome Friends! Your complimentary 1-year Perplexity Pro subscription starts now!",FREEINKITT:"Welcome Inkitt Writers! Your complimentary 1-year subscription to Perplexity Pro starts now!",FREETIME:"Welcome Time team! Your complimentary 1-year subscription to Perplexity Pro starts now!",FREETMOBILE:"Welcome T-Mobile team! Your complimentary 1-year subscription to Perplexity Pro starts now!","11LABS":"Welcome! Your complimentary 3-month subscription to Perplexity Pro starts now!",FREECAVS:"Welcome Cavs team! Your complimentary 1-year Perplexity Pro subscription starts now!",NOTHING6:"Welcome Nothing owners. Your complimentary 6-month Perplexity Pro subscription starts now!",FREENOTHING6:"Welcome Nothing owners. Your complimentary 6-month Perplexity Pro subscription starts now!",NOTHING1:"Welcome Nothing owners. Your complimentary 1-year Perplexity Pro subscription starts now!",FREENOTHING1:"Welcome Nothing owners. Your complimentary 1-year Perplexity Pro subscription starts now!",HOOHACKS:"Welcome HooHacks Community. Your 1-year Perplexity Pro free trial starts now!",NJED:"Welcome NJ ED Community. Your 1-year Perplexity Pro free trial starts now!",COPYAI:"Welcome Copy AI customers! Your 6-month complimentary Perplexity Pro subscription starts now!",RAYCAST6:"Welcome Raycast users! Your 6-month complimentary Perplexity Pro subscription starts now!",RAYCAST3:"Welcome Raycast users! Your 3-month complimentary Perplexity Pro subscription starts now!",FREEMAGENTALOVE:"Welcome Deutsche Telekom! Your complimentary 1-year Perplexity Pro subscription starts now!",FREEPPLXVIP:"Welcome friend of Perplexity! Your complimentary 1-year Perplexity Pro subscription starts now.",FREEUTA1:"Welcome UTA team! Your complimentray 1-year Perplexity Pro subscription starts now.",DT:"Willkommen Deutsche Telekom Kunde! Sie erhalten dank Magenta Moments ein kostenloses 1-Jahres-Abonnement für Perplexity Pro.",MY:"Welcome! Your complimentary 1-year Perplexity Pro subscription starts now."},O0="pplx.discount_code",I_="pplx.discount_code_expiry",bSe=()=>{const[e,t]=d.useState(null),[n,r]=d.useState(null),s=Rn(),o=fn(),a=On(),i=o?.get("discount_code"),{$t:c}=J(),u=Array.isArray(i)?i[0]:i,[f,m]=d.useState(u||null),{hasAccessToProFeatures:p}=$t(),h=d.useCallback(()=>{vt.removeItem(O0),vt.removeItem(I_),r(null),t(null)},[]),g=d.useCallback(()=>{h(),m(null)},[h]),y=d.useCallback(()=>{if(n&&e)return;const b=vt.getItem(O0);b?.startsWith("REPLIT")?(t("/static/images/replit.svg"),r("/static/images/replit_dark.svg")):b?.startsWith("BREX")?(t("/static/images/brex.svg"),r("/static/images/brex_dark.svg")):(r(null),t(null))},[n,e]),x=d.useCallback(()=>{const b=vt.getItem(O0),_=vt.getItem(I_);if(p){h();return}if(!(!b&&!u)){if(_&&new Date(_){for(const _ in h9)if(b&&b.startsWith(_))return h9[_];return c({defaultMessage:"Redeem your promo code {discountCode}. Get started",id:"Vapo/CiOwF"},{discountCode:b})},[c]);return d.useEffect(()=>{x()},[u,x]),d.useMemo(()=>({discountCode:f,setDiscountCode:m,partnerLogoDark:n,partnerLogoLight:e,message:v(f??""),clearDiscountCode:g}),[g,f,v,n,e])},_Se=()=>{const{status:e}=Ne(),t=ZH(),{isGovernmentRequestOrigin:n}=Yr(),{isEnterprise:r}=$t();return{isLoading:e==="loading"||t,isEnterpriseOrGovtUser:r||n===!0}},wSe=()=>be.makeQueryKey("get_experiments_attributes",{}),CSe=async({reason:e,headers:t={}})=>{try{const{data:n,error:r}=await de.GET("/rest/experiments/attributes",e,{headers:t,timeoutMs:Qe({productionMs:2e3}),numRetries:1});return r?(Z.error("Failed to fetch experiment attributes",{error:r,reason:e}),null):n??null}catch(n){return Z.error("Error fetching experiment attributes",{error:n,reason:e}),null}},SSe=()=>{const e=Wt(),{data:t,isLoading:n,error:r}=mt({queryKey:wSe(),queryFn:()=>CSe({reason:"check if user is an existing comet user"}),staleTime:300*1e3,gcTime:300*1e3,enabled:e,retry:!1});return{isExistingCometUser:d.useMemo(()=>{if(t)return t.server_is_comet_eligible===!1},[t]),isLoading:n,error:r}},ESe=async({reason:e})=>{try{const{data:t,error:n,response:r}=await de.GET("/rest/user/promotions",e,{timeoutMs:Qe({productionMs:2e3})});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch user promotions",cause:n,status:r.status??0});return t}catch{return{campaign:null,offer:null,institution:null}}},zvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/billing/get-customer-portal",t,{headers:e,timeoutMs:3e3});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get customer portal",cause:r,status:s.status??0});if(n.status!=="success")throw new he("API_CLIENTS_ERROR",{message:"Failed to get customer portal",cause:r,status:s.status??0});return n.url}catch{return null}};async function kSe({currency:e,reason:t,subscriptionTier:n}){const{data:r,error:s,response:o}=await de.GET("/rest/stripe/prices",t,{timeoutMs:Cn.NONE,params:{query:{currency:e,subscription_tier:n}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch prices",cause:s,status:o.status??0});return r}const Wvt=({currency:e,reason:t,subscriptionTier:n})=>mt({queryKey:be.makeQueryKey("prices",e,n),queryFn:()=>kSe({currency:e,reason:t,subscriptionTier:n}),gcTime:300*1e3,staleTime:120*1e3}),Gvt=async({request:e,reason:t})=>{const n=Nx(),r={"content-type":"application/json",...n?{"Screen-Dimensions":n}:{}};try{const{data:s,error:o,response:a}=await de.POST("/rest/stripe/checkout-session",t,{body:{referral_code:e.referralCode,discount_code:e.discountCode,origin:e.origin,tier:e.tier,locale:e.locale,embedded:e.embedded??!1,subscription_tier:e.subscriptionTier,success_redirect_url:e.success_redirect_url},timeoutMs:5e3,headers:r,reason:t});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:t}});return{subscriptionStatus:s.subscription_status,status:s.status,url:s.url??null,clientSecret:s.client_secret??void 0,errorCode:s.error_code??void 0,subscriptionTier:e.subscriptionTier}}catch{return}},$vt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/create-setup-intent-and-customer-session",t,{timeoutMs:Qe({productionMs:3e3}),headers:e});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return{customerId:n.customer_id,clientSecret:n.client_secret,customerSessionClientSecret:n.customer_session_client_secret}}catch{return}},MSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/stripe/upgrade-subscription-preview",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch upgrade subscription preview",cause:r,status:s.status??0});return n},TSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/stripe/downgrade-subscription-preview",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch downgrade subscription preview",cause:r,status:s.status??0});return n},qvt=({reason:e,enabled:t})=>mt({queryKey:a2e(),queryFn:()=>MSe({reason:e}),gcTime:0,staleTime:0,enabled:t}),Kvt=({reason:e})=>mt({queryKey:be.makeQueryKey("downgrade-subscription-preview"),queryFn:()=>TSe({reason:e}),gcTime:0,staleTime:0}),ASe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/upgrade-subscription",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to upgrade subscription",cause:r,status:s.status??0});return n},Yvt=({reason:e},t)=>{const n="useUpgradeSubscription";return Rt({retry:!1,mutationFn:()=>ASe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},NSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/downgrade-subscription",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to downgrade subscription",cause:r,status:s.status??0});return n},Qvt=({reason:e},t)=>{const n="useDowngradeSubscription";return Rt({mutationFn:()=>NSe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},RSe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/stripe/subscription-changes",e,{headers:{"content-type":"application/json"},timeoutMs:Cn.HIGH});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch subscription changes",cause:n,status:r.status??0});return t},Xvt=({reason:e,enabled:t})=>mt({queryKey:i2e(),queryFn:()=>RSe({reason:e}),gcTime:0,staleTime:0,enabled:t}),DSe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.POST("/rest/stripe/cancel-downgrade-subscription",e,{headers:{"content-type":"application/json"},timeoutMs:Cn.HIGH});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to cancel downgrade",cause:n,status:r.status??0});return t},Zvt=({reason:e},t)=>{const n="useCancelDowngrade";return Rt({retry:!1,mutationFn:()=>DSe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},Jvt=async({paymentMethodUUID:e,optedIn:t})=>{const n="visa-opt-in-submit",{data:r,error:s,response:o}=await de.POST("/rest/billing/personalization/update",n,{body:{enabled:t,payment_method_uuid:e}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to redeem visa",cause:s,status:o.status??0});return r},ebt=async()=>{const{data:e,error:t}=await de.GET("/rest/billing/braintree/subscription-details","braintree-modal-fetch-details",{timeoutMs:5e3});if(t)throw t;return e},tbt=async({payment_method_type:e})=>{const{data:t,error:n}=await de.POST("/rest/billing/braintree/cancel-subscription","braintree-modal-cancel",{timeoutMs:5e3,body:{payment_method_type:e}});if(n)throw n;return t},nbt=async({payment_method_type:e})=>{const{data:t,error:n}=await de.POST("/rest/billing/braintree/renew-subscription","braintree-modal-renew",{timeoutMs:3e3,body:{payment_method_type:e}});if(n)throw n;return t},jSe=({reason:e})=>{const{$t:t}=J(),{data:n,isLoading:r}=mt({queryKey:qye(),queryFn:()=>ESe({reason:e})}),s=!!n?.institution;let o=n?.offer?.discount_str??void 0;!o&&s&&(o=t({defaultMessage:"$4.99",id:"ngR/pJs1LV"}));const a=n?.offer?.discount_type??void 0;return d.useMemo(()=>({userPromotionsLoading:r,discountPrice:o,discountType:a,showStudentDiscountContent:s,campaignId:n?.campaign?.id,institution:n?.institution}),[n?.campaign?.id,n?.institution,o,a,r,s])};function ISe(){const[e,t]=Qi("pplx.partner_banner",null);return[e,t]}function PSe(){const[e,t]=Qi("pplx.partner_discount_code",null);return[e,t]}const OSe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"org-invitation-banner",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function LSe({reason:e,enabled:t=!0}){const{variation:n}=OSe(!1),r=Wt(),s=lu(),o=r&&!s&&t&&n,{data:a,isLoading:i}=mt({enabled:o,queryKey:Xye(),queryFn:()=>A2e({reason:e}),staleTime:600*1e3,gcTime:3600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!1});return{pendingInvitation:a??null,isLoading:i}}const FSe="back_to_school_winner",BSe="EDUFREEYEAR",USe=Ce(async()=>{const{UberOnePromoBanner:e}=await Se(()=>q(()=>import("./UberOnePromoBanner-CYfGDUlm.js"),__vite__mapDeps([128,4,1,6,3,129,9,7,8,10,11,12])));return{default:e}}),VSe=Ce(async()=>{const{DiscountCodeBanner:e}=await Se(()=>q(()=>import("./DiscountCodeBanner-l96J_LHj.js"),__vite__mapDeps([130,4,1,6,3,22,129,9,7,8,10,11,12])));return{default:e}}),g9=Ce(async()=>{const{PartnerBanner:e}=await Se(()=>q(()=>import("./PartnerBanner-BL7xfhwx.js"),__vite__mapDeps([131,4,1,8,3,9,6,7,129,10,11,12])));return{default:e}}),HSe=Ce(async()=>{const{OrgUpgradeBillingBanner:e}=await Se(()=>q(()=>import("./OrgBillingBanner-F7N-p4UC.js"),__vite__mapDeps([132,4,1,6,3,133,129,9,7,8,10,11,12])));return{default:e}}),zSe=Ce(async()=>{const{OrgInvitationBanner:e}=await Se(()=>q(()=>import("./OrgInvitationBanner-CrpdJghk.js"),__vite__mapDeps([134,4,1,6,3,129,9,7,8,10,11,12])));return{default:e}}),WSe=Ce(async()=>{const{AppBannerUpsell:e}=await Se(()=>q(()=>import("./AppBannerUpsell-Bph65qqz.js"),__vite__mapDeps([135,4,1,129,9,3,6,7,8,10,11,12])));return{default:e}}),GSe=Ce(async()=>{const{CometDownloadBannerUpsell:e}=await Se(()=>q(()=>import("./CometDownloadBannerUpsell-BTaMxe5H.js"),__vite__mapDeps([136,4,1,6,3,129,9,7,8,10,11,12])));return{default:e}}),$Se=e=>["/onboarding/org/create"].includes(e);function qSe(){const e="app-banner-inner",{isMobileUserAgent:t}=Re(),{message:n,discountCode:r,clearDiscountCode:s}=bSe(),{hasAccessToProFeatures:o,isEnterprise:a}=$t(),i=lu(),[c]=ISe(),[u]=PSe(),f=On(),{organization:m,orgUser:p}=mo({reason:e}),{pendingInvitation:h}=LSe({reason:e}),g=i&&!a,y=p?.role==="ADMIN",{isLoading:x,isEnterpriseOrGovtUser:v}=_Se(),b=fn(),w=jSe({reason:e}).campaignId===FSe,[S,C]=Qi("pplx.back_to_school_winner_banner_dismissed",!1),{show:E,title:T,actionLabel:k}=vSe(),{productBanner:I}=NW(),{isExistingCometUser:M,isLoading:N}=SSe();return x||N?null:f==="/"&&I?.name==="comet_download_banner"&&I?.app_location===Ns.BANNER&&I?.title&&I?.button_text&&!v&&!M?l.jsx(GSe,{title:I.title,actionLabel:I.button_text}):E&&T&&k?l.jsx(WSe,{}):h&&!m&&!p?l.jsx(zSe,{orgName:h.organization_name,invitationUUID:h.invitation_uuid}):y&&g&&!$Se(f??"")&&!t?l.jsx(HSe,{orgStripeStatus:m?.stripe_status}):/(^\/$)|(^\/search)/.test(f??"")&&c?l.jsx(g9,{partnerCode:c,partnerDiscountCode:u}):r&&!o&&!c?l.jsx(VSe,{message:n,discountCode:r,clearDiscountCode:s}):b?.get("utm_campaign")==="morningbrew_083024"&&b?.get("utm_source")==="newsletter"?l.jsx(USe,{}):w&&!S?l.jsx(g9,{partnerCode:"edu",partnerDiscountCode:BSe,bannerVariant:"orange",onClose:()=>{C(!0)}}):null}const Kc={"fill-foreground":"--foreground-color","fill-quiet":"--foreground-quiet-color","fill-inverse":"--foreground-inverse-color","fill-light":"--dark-foreground-color","fill-dark":"--light-foreground-color","fill-super":"--super-color","fill-caution":"--caution-color","fill-max":"--max-color","stroke-foreground":"--foreground-color","stroke-quiet":"--foreground-quiet-color","stroke-subtler":"--foreground-subtler-color","stroke-inverse":"--foreground-inverse-color","stroke-light":"--dark-foreground-color","stroke-dark":"--light-foreground-color","stroke-super":"--super-color","stroke-caution":"--caution-color"},RW=A.memo(({lineColor:e,width:t,fillColor:n,...r})=>{const s=z("h-auto group",t),o=Kc[n]||"--foreground-color",a=Kc[e]||"--foreground-color";return l.jsx("div",{className:s,style:{"--logo-fill":`oklch(var(${o}))`,"--logo-stroke":`oklch(var(${a}))`},...r,children:l.jsx("svg",{viewBox:"0 0 400 91",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-full"})})})});RW.displayName="Full";const DW=A.memo(({width:e,fillColor:t,...n})=>{const r=z("h-auto group",e),s=Kc[t]||"--foreground-color";return l.jsx("div",{className:r,style:{color:`oklch(var(${s}))`},...n,children:l.jsx("svg",{viewBox:"0 0 1456 187",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-labs"})})})});DW.displayName="Labs";const jW=A.memo(({fillColor:e,width:t,...n})=>{const r=z("h-auto group",t),s=Kc[e]||"--foreground-color";return l.jsx("div",{className:r,style:{color:`oklch(var(${s}))`},...n,children:l.jsx("svg",{viewBox:"0 0 30 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-auto w-full",children:l.jsx("use",{href:"#pplx-logo-mark"})})})});jW.displayName="Mark";const IW=A.memo(({width:e="w-14",fillColor:t="fill-max",svgClassName:n,...r})=>{const s=z("h-auto group",e),o=Kc[t]||"--max-color";return l.jsx("div",{className:s,style:{color:`oklch(var(${o}))`},...r,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 99 36",className:n,children:l.jsx("use",{href:"#pplx-logo-max"})})})});IW.displayName="Max";const PW=A.memo(({width:e="w-10",sizeVariant:t="regular",fillColor:n="fill-super",svgClassName:r,...s})=>{const o=z("h-auto group",e),a=Kc[n]||"--super-color",i=t==="small"?"pplx-logo-pro-small":"pplx-logo-pro";return l.jsx("div",{className:o,style:{color:`oklch(var(${a}))`},...s,children:t==="small"?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1102.02 529.46",className:r,children:l.jsx("use",{href:`#${i}`})}):l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 804.75 382.36",className:r,children:l.jsx("use",{href:`#${i}`})})})});PW.displayName="Pro";const OW=A.memo(({width:e,fillColor:t,isPro:n,isMax:r,isEnterprise:s,...o})=>{const a=z("h-auto group",e),i=Kc[t]||"--foreground-color";return s&&n?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--super-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 797 82",children:l.jsx("use",{href:"#pplx-logo-word-ent-pro"})})}):s&&r?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--max-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 797 82",children:l.jsx("use",{href:"#pplx-logo-word-ent-max"})})}):n?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--super-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 3913.07 632",children:l.jsx("use",{href:"#pplx-logo-word-pro"})})}):r?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--max-color))"},...o,children:l.jsx("svg",{viewBox:"0 0 485 74",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-word-max"})})}):l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`},...o,children:l.jsx("svg",{viewBox:"0 0 962 202",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-word"})})})});OW.displayName="Word";const KSe={tiny:"w-4 md:w-6",small:"",md:"w-10","md-large":"w-20",large:"w-24",xl:"w-36"},YSe="w-6 md:w-8",Gd=A.memo(({size:e="large",includeEffects:t=!1,isPro:n=!1,isMax:r=!1,isEnterprise:s=!1,variant:o="full",color:a="foreground",...i})=>{let c="w-28 md:w-[140px]";e==="tiny"?c="w-14 md:w-16":e==="small"?c="w-24":e==="large"?c="w-40 md:w-52":e==="xl"&&(c=s?"w-72":"w-64");const u=KSe?.[e]||YSe;let f="w-6";e==="large"?f="w-12":e==="md-large"?f="w-8":e==="xl"&&(f="w-36");const m=z("",{"stroke-foreground":a==="foreground","stroke-quiet":a==="quiet","stroke-super":a==="super"||a==="mixed","stroke-caution":a==="caution","stroke-light":a==="white","stroke-inverse":a==="background","group-hover:stroke-super transition-colors duration-300":t}),p=z({"fill-foreground":a==="foreground"||a==="mixed","fill-quiet":a==="quiet","fill-super":a==="super","fill-caution":a==="caution","fill-light":a==="white","fill-inverse":a==="background","group-hover:fill-super transition-colors duration-300":t});return o==="pro"?l.jsx(PW,{width:f,fillColor:p,...i}):o==="max"?l.jsx(IW,{width:f,...i}):o==="mark"?l.jsx("div",{className:z({"transition-all duration-300 ease-in-out hover:scale-105":t}),children:l.jsx(jW,{fillColor:p,width:u,...i})}):o==="text"?l.jsx(OW,{fillColor:p,width:c,isPro:n,isMax:r,isEnterprise:s,...i}):o==="full"?l.jsx(RW,{fillColor:p,lineColor:m,width:c,...i}):o==="labs"?l.jsx(DW,{width:c,fillColor:p,...i}):null});Gd.displayName="Logo";const QSe="https://perplexity.sng.link/A6awk/ppas?_smtype=3&pvid=",rbt="https://perplexity.sng.link/A6awk/rcv6y?_smtype=3&pvid=",XSe=({origin:e,linkPrefix:t=QSe,isCanonicalDeeplink:n=!1})=>{const r=CU(),[s,o]=d.useState(t),{sendAppDownloadClickedEventSingular:a}=JM(),i=On(),c=d.useMemo(()=>{const f=new URLSearchParams;return f.set("origin",e),r&&f.set("pvid",r),i&&f.set("pathname",i),f.toString()},[r,e,i]);d.useEffect(()=>{(async()=>{const{singularSdk:m}=await q(async()=>{const{singularSdk:g}=await import("./singular-sdk-C08EBV6K.js").then(y=>y.s);return{singularSdk:g}},[]);for(;!m._isInitialized;)await new Promise(g=>setTimeout(g,100));let p=null;if(i){const g=i.startsWith("/")?i.slice(1):i;n?p=`${m7}//canonical-page?url=https://www.perplexity.ai/app/${g}`:p=`${m7}//${g}`}const h=m.buildWebToAppLink(`${t}${r}&_ios_dl=${encodeURIComponent(p??"")}&_android_dl=${encodeURIComponent(p??"")}`,p,c,p);o(h)})()},[r,i,c,t,n]);const u=d.useCallback(()=>{Lfe(),a(e),No(s,"Singular download app")},[s,e,a]);return d.useMemo(()=>({downloadAppLink:s,handleAppDownloadClicked:u}),[s,u])};function ZSe(e,t){d.useEffect(()=>{if(typeof window>"u")return;const r=window.cookieStore;if(!r)return;const s=o=>{const a=o.deleted.find(c=>c.name===e),i=o.changed.find(c=>c.name===e);if(a||i){t(i??null);return}};return r.addEventListener("change",s),()=>{r.removeEventListener("change",s)}},[e,t])}const LW=()=>{const e=d.useCallback(n=>{const r=document.documentElement,s=n??mr("colorSchemeTheme"),o=JU(s);o?r.setAttribute("data-theme",o):r.removeAttribute("data-theme")},[]),t=d.useMemo(()=>Cf(e,100),[e]);ZSe("colorSchemeTheme",n=>{t(n?.value)}),d.useEffect(()=>{e()},[e])},FW=Ft("AppLayoutContext",void 0),JSe=()=>{const e=d.useContext(FW);if(!e)throw new Error("useAppLayout must be used within an AppLayoutProvider");return e},e3e=({children:e})=>{const[t,n]=d.useState(!1);return LW(),l.jsx(FW.Provider,{value:{isMobileSidebarOpen:t,setMobileSidebarOpen:n},children:e})},t3e=({className:e})=>{const{inApp:t}=Sa(),{isMobileSidebarOpen:n,setMobileSidebarOpen:r}=JSe();return t?null:l.jsx(st,{icon:B("menu-2"),pill:!0,onClick:()=>r(!n),extraCSS:e})},Ge=d.memo(e=>{const{variant:t="common",disabled:n,extraCSS:r,...s}=e,{buttonClass:o}=d.useMemo(()=>{const a={disabled:"bg-subtle text-quiet",primary:"bg-super text-inverse hover:opacity-80",primaryGhost:"border border-super/20 bg-super/10 hover:bg-super/20 hover:border-super/30 text-super",common:"bg-subtle text-foreground md:hover:text-quiet",border:"border border-subtler text-quiet md:hover:border-subtle md:hover:text-quiet hover:bg-subtler bg-base",inverted:"bg-inverse text-inverse hover:opacity-80",rejecter:"border border-subtlest text-caution dark:hover:text-foreground hover:bg-caution/30 hover:border-caution/20 bg-base",rejected:"bg-caution hover:opacity-50 text-white",orange:"bg-attention text-white hover:opacity-50",maxGold:"bg-max dark:text-inverse hover:opacity-80"},i=n?a.disabled:a[t];return{buttonClass:z(i,r)}},[t,n,r]);return l.jsx(H4,{extraCSS:o,disabled:n,variant:t,...s})});Ge.displayName="Button";const n3e=A.memo(({})=>{const{$t:e}=J(),{session:t}=Ne(),{trackEvent:n}=Xe(t),r=d.useCallback(()=>{n("click logo",{})},[n]),{device:{isIOS:s}}=sn(),{handleAppDownloadClicked:o}=XSe({origin:"mobile-header"}),a=d.useMemo(()=>s?Yme:B("brand-android"),[s]);return l.jsx(K,{variant:"background",className:"px-sm h-headerHeight sticky inset-x-0 top-0 z-10 flex w-full items-center md:mb-0",children:l.jsxs("div",{className:"gap-x-sm pl-xs flex w-full items-center justify-between md:hidden",children:[l.jsxs("div",{className:"gap-x-sm flex items-center",children:[l.jsx(t3e,{className:"-ml-sm"}),l.jsx(yt,{href:"/",onClick:r,children:l.jsx(Gd,{variant:"text",size:"small"})})]}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx("div",{className:"animate-in fade-in duration-300",children:l.jsx(Ge,{size:"small",pill:!0,variant:"primary",icon:a,text:e({defaultMessage:"Open in App",id:"fo3x6hDxdZ"}),onClick:o})})})]})})});n3e.displayName="MobileProductHeader";const y9=200,tT=Ft("ScrollContainerRefContext",null),r3e=({children:e,scrollContainerRef:t})=>l.jsx(tT.Provider,{value:{scrollContainerRef:t},children:e}),ka=()=>{const e=d.useContext(tT);if(!e)throw new Error("useScrollContainerRef must be used within a ScrollContainerRefProvider");return e},BW=A.memo(e=>{const{children:t,inRenderingPlace:n}=e,s=Ga().erp;return n&&n===s||!n&&s!==void 0?null:l.jsx(l.Fragment,{children:t})});BW.displayName="HideInEntropy";const s3e=()=>{const{locale:e}=J();return Hme(e)==="rtl"};Ce(async()=>{const{MobileSidebar:e}=await Se(()=>q(()=>import("./MobileSidebar-C4bvEgiR.js"),__vite__mapDeps([137,4,1,9,3,6,7,8,10,11,12])));return{default:e}});const o3e=({children:e,ref:t})=>{const n=d.useRef(null);return l.jsx(e3e,{children:l.jsx(r3e,{scrollContainerRef:n,children:l.jsx(K,{variant:"background",children:l.jsx("div",{className:"isolate flex h-dvh",ref:t,children:e})})})})},a3e=({children:e,fillHeight:t=!0,hasSidebar:n,ref:r})=>{const[s]=Wd("isSidebarPinned",!1),{isMobileStyle:o}=Re({evaluateOnInit:!0}),a=On(),i=n&&!zz(a),c=s&&!o&&i,u=s3e(),f=d.useMemo(()=>u?{paddingRight:c?y9:0}:{paddingLeft:c?y9:0},[u,c]);return l.jsxs("div",{style:{...f,transition:"padding-left 0.2s cubic-bezier(0.16, 1, 0.3, 1), padding-right 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},className:"erp-tab:p-0 md:gap-xs erp-tab:gap-0 isolate flex h-auto max-h-screen min-w-0 grow flex-col",ref:r,children:[l.jsx(BW,{inRenderingPlace:"sidecar",children:l.jsx(qSe,{})}),l.jsxs(K,{variant:"background",className:"@container/main relative isolate min-h-0 flex-1 overflow-clip bg-clip-border",children:[l.jsx("div",{className:z("mx-auto flex w-full flex-col",{"h-full":t}),children:e}),l.jsx(K,{className:z("rounded-inherit pointer-events-none absolute inset-0 z-20 hidden md:dark:block",i&&"md:!border-y-0 md:!border-r-0")})]})]})},Qx=({children:e,className:t,childrenWidth:n,containerClassName:r=""})=>{const{isMobileUserAgent:s}=Re(),o=Vi(n).with("small",()=>"max-w-screen-sm px-md md:px-lg").with("default",()=>"max-w-screen-md px-md md:px-lg").with("static",()=>"max-w-screen-lg px-md py-lg md:px-xl").with("large",()=>"max-w-threadWidth px-md md:px-lg").with("none",()=>"max-w-none").otherwise(()=>"max-w-screen-md px-md md:px-lg"),i=d.useContext(tT)?.scrollContainerRef;return l.jsx("div",{ref:i,className:z("scrollable-container flex flex-1 basis-0 overflow-auto [scrollbar-gutter:stable]",{"scrollbar-subtle":!s},t),children:l.jsx("div",{className:z("mx-auto size-full",o,r),children:e})})};function UW(e){const t=e+"CollectionProvider",[n,r]=Vs(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:x,children:v}=y,b=A.useRef(null),_=A.useRef(new Map).current;return l.jsx(s,{scope:x,itemMap:_,collectionRef:b,children:v})};a.displayName=t;const i=e+"CollectionSlot",c=qp(i),u=A.forwardRef((y,x)=>{const{scope:v,children:b}=y,_=o(i,v),w=Sn(x,_.collectionRef);return l.jsx(c,{ref:w,children:b})});u.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=qp(f),h=A.forwardRef((y,x)=>{const{scope:v,children:b,..._}=y,w=A.useRef(null),S=Sn(x,w),C=o(f,v);return A.useEffect(()=>(C.itemMap.set(w,{ref:w,..._}),()=>void C.itemMap.delete(w))),l.jsx(p,{[m]:"",ref:S,children:b})});h.displayName=f;function g(y){const x=o(e+"CollectionConsumer",y);return A.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const _=Array.from(b.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((C,E)=>_.indexOf(C.ref.current)-_.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},g,r]}var i3e=d.createContext(void 0);function Pf(e){const t=d.useContext(i3e);return e||t||"ltr"}var P_=0;function nT(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??x9()),document.body.insertAdjacentElement("beforeend",e[1]??x9()),P_++,()=>{P_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),P_--}},[])}function x9(){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 O_="focusScope.autoFocusOnMount",L_="focusScope.autoFocusOnUnmount",v9={bubbles:!1,cancelable:!0},l3e="FocusScope",Xx=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=d.useState(null),u=Js(s),f=Js(o),m=d.useRef(null),p=Sn(t,y=>c(y)),h=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let y=function(_){if(h.paused||!i)return;const w=_.target;i.contains(w)?m.current=w:ul(m.current,{select:!0})},x=function(_){if(h.paused||!i)return;const w=_.relatedTarget;w!==null&&(i.contains(w)||ul(m.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&ul(i)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const b=new MutationObserver(v);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),b.disconnect()}}},[r,i,h.paused]),d.useEffect(()=>{if(i){_9.add(h);const y=document.activeElement;if(!i.contains(y)){const v=new CustomEvent(O_,v9);i.addEventListener(O_,u),i.dispatchEvent(v),v.defaultPrevented||(c3e(p3e(VW(i)),{select:!0}),document.activeElement===y&&ul(i))}return()=>{i.removeEventListener(O_,u),setTimeout(()=>{const v=new CustomEvent(L_,v9);i.addEventListener(L_,f),i.dispatchEvent(v),v.defaultPrevented||ul(y??document.body,{select:!0}),i.removeEventListener(L_,f),_9.remove(h)},0)}}},[i,u,f,h]);const g=d.useCallback(y=>{if(!n&&!r||h.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const b=y.currentTarget,[_,w]=u3e(b);_&&w?!y.shiftKey&&v===w?(y.preventDefault(),n&&ul(_,{select:!0})):y.shiftKey&&v===_&&(y.preventDefault(),n&&ul(w,{select:!0})):v===b&&y.preventDefault()}},[n,r,h.paused]);return l.jsx(Et.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});Xx.displayName=l3e;function c3e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ul(r,{select:t}),document.activeElement!==n)return}function u3e(e){const t=VW(e),n=b9(t,e),r=b9(t.reverse(),e);return[n,r]}function VW(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 b9(e,t){for(const n of e)if(!d3e(n,{upTo:t}))return n}function d3e(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 f3e(e){return e instanceof HTMLInputElement&&"select"in e}function ul(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&f3e(e)&&t&&e.select()}}var _9=m3e();function m3e(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=w9(e,t),e.unshift(t)},remove(t){e=w9(e,t),e[0]?.resume()}}}function w9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function p3e(e){return e.filter(t=>t.tagName!=="A")}var F_="rovingFocusGroup.onEntryFocus",h3e={bubbles:!1,cancelable:!0},ig="RovingFocusGroup",[S3,HW,g3e]=UW(ig),[y3e,Jl]=Vs(ig,[g3e]),[x3e,v3e]=y3e(ig),zW=d.forwardRef((e,t)=>l.jsx(S3.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(S3.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(b3e,{...e,ref:t})})}));zW.displayName=ig;var b3e=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=e,p=d.useRef(null),h=Sn(t,p),g=Pf(o),[y,x]=fo({prop:a,defaultProp:i??null,onChange:c,caller:ig}),[v,b]=d.useState(!1),_=Js(u),w=HW(n),S=d.useRef(!1),[C,E]=d.useState(0);return d.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(F_,_),()=>T.removeEventListener(F_,_)},[_]),l.jsx(x3e,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:y,onItemFocus:d.useCallback(T=>x(T),[x]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:d.useCallback(()=>E(T=>T-1),[]),children:l.jsx(Et.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:rt(e.onMouseDown,()=>{S.current=!0}),onFocus:rt(e.onFocus,T=>{const k=!S.current;if(T.target===T.currentTarget&&k&&!v){const I=new CustomEvent(F_,h3e);if(T.currentTarget.dispatchEvent(I),!I.defaultPrevented){const M=w().filter(R=>R.focusable),N=M.find(R=>R.active),D=M.find(R=>R.id===y),F=[N,D,...M].filter(Boolean).map(R=>R.ref.current);$W(F,f)}}S.current=!1}),onBlur:rt(e.onBlur,()=>b(!1))})})}),WW="RovingFocusGroupItem",GW=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...i}=e,c=ls(),u=o||c,f=v3e(WW,n),m=f.currentTabStopId===u,p=HW(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:y}=f;return d.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),l.jsx(S3.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(Et.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:rt(e.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:rt(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:rt(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=C3e(x,f.orientation,f.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=p().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")_.reverse();else if(v==="prev"||v==="next"){v==="prev"&&_.reverse();const w=_.indexOf(x.currentTarget);_=f.loop?S3e(_,w+1):_.slice(w+1)}setTimeout(()=>$W(_))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:y!=null}):a})})});GW.displayName=WW;var _3e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w3e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function C3e(e,t,n){const r=w3e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _3e[r]}function $W(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function S3e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zx=zW,Jx=GW,E3e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Du=new WeakMap,L0=new WeakMap,F0={},B_=0,qW=function(e){return e&&(e.host||qW(e.parentNode))},k3e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qW(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})},M3e=function(e,t,n,r){var s=k3e(t,Array.isArray(e)?e:[e]);F0[n]||(F0[n]=new WeakMap);var o=F0[n],a=[],i=new Set,c=new Set(s),u=function(m){!m||i.has(m)||(i.add(m),u(m.parentNode))};s.forEach(u);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(p){if(i.has(p))f(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",y=(Du.get(p)||0)+1,x=(o.get(p)||0)+1;Du.set(p,y),o.set(p,x),a.push(p),y===1&&g&&L0.set(p,!0),x===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),i.clear(),B_++,function(){a.forEach(function(m){var p=Du.get(m)-1,h=o.get(m)-1;Du.set(m,p),o.set(m,h),p||(L0.has(m)||m.removeAttribute(r),L0.delete(m)),h||m.removeAttribute(n)}),B_--,B_||(Du=new WeakMap,Du=new WeakMap,L0=new WeakMap,F0={})}},rT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=E3e(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),M3e(r,s,n,"aria-hidden")):function(){return null}},oy="right-scroll-bar-position",ay="width-before-scroll-bar",T3e="with-scroll-bars-hidden",A3e="--removed-body-scroll-bar-size";function U_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function N3e(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var R3e=typeof window<"u"?d.useLayoutEffect:d.useEffect,C9=new WeakMap;function D3e(e,t){var n=N3e(null,function(r){return e.forEach(function(s){return U_(s,r)})});return R3e(function(){var r=C9.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(i){o.has(i)||U_(i,null)}),o.forEach(function(i){s.has(i)||U_(i,a)})}C9.set(n,e)},[e]),n}function j3e(e){return e}function I3e(e,t){t===void 0&&(t=j3e);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(i){return o(i)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(o),a=n}var c=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return s}function P3e(e){e===void 0&&(e={});var t=I3e(null);return t.options=Sr({async:!0,ssr:!1},e),t}var KW=function(e){var t=e.sideCar,n=RU(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Sr({},n))};KW.isSideCarExport=!0;function O3e(e,t){return e.useMedium(t),KW}var YW=P3e(),V_=function(){},ev=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:V_,onWheelCapture:V_,onTouchMoveCapture:V_}),s=r[0],o=r[1],a=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,_=RU(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,S=D3e([n,t]),C=Sr(Sr({},_),s);return d.createElement(d.Fragment,null,f&&d.createElement(w,{sideCar:YW,removeScrollBar:u,shards:m,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:b}),a?d.cloneElement(d.Children.only(i),Sr(Sr({},C),{ref:S})):d.createElement(v,Sr({},C,{className:c,ref:S}),i))});ev.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ev.classNames={fullWidth:ay,zeroRight:oy};var L3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function F3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=L3e();return t&&e.setAttribute("nonce",t),e}function B3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function U3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=F3e())&&(B3e(t,n),U3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H3e=function(){var e=V3e();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},QW=function(){var e=H3e(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},z3e={left:0,top:0,right:0,gap:0},H_=function(e){return parseInt(e||"",10)||0},W3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[H_(n),H_(r),H_(s)]},G3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z3e;var t=W3e(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])}},$3e=QW(),Cd="data-scroll-locked",q3e=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),` - .`.concat(T3e,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(i,"px ").concat(r,`; - } - body[`).concat(Cd,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(i,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(oy,` { - right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(ay,` { - margin-right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(oy," .").concat(oy,` { - right: 0 `).concat(r,`; - } - - .`).concat(ay," .").concat(ay,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Cd,`] { - `).concat(A3e,": ").concat(i,`px; - } -`)},S9=function(){var e=parseInt(document.body.getAttribute(Cd)||"0",10);return isFinite(e)?e:0},K3e=function(){d.useEffect(function(){return document.body.setAttribute(Cd,(S9()+1).toString()),function(){var e=S9()-1;e<=0?document.body.removeAttribute(Cd):document.body.setAttribute(Cd,e.toString())}},[])},Y3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;K3e();var o=d.useMemo(function(){return G3e(s)},[s]);return d.createElement($3e,{styles:q3e(o,!t,s,n?"":"!important")})},E3=!1;if(typeof window<"u")try{var B0=Object.defineProperty({},"passive",{get:function(){return E3=!0,!0}});window.addEventListener("test",B0,B0),window.removeEventListener("test",B0,B0)}catch{E3=!1}var ju=E3?{passive:!1}:!1,Q3e=function(e){return e.tagName==="TEXTAREA"},XW=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q3e(e)&&n[t]==="visible")},X3e=function(e){return XW(e,"overflowY")},Z3e=function(e){return XW(e,"overflowX")},E9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=ZW(e,r);if(s){var o=JW(e,r),a=o[1],i=o[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},J3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eEe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ZW=function(e,t){return e==="v"?X3e(t):Z3e(t)},JW=function(e,t){return e==="v"?J3e(t):eEe(t)},tEe=function(e,t){return e==="h"&&t==="rtl"?-1:1},nEe=function(e,t,n,r,s){var o=tEe(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,c=t.contains(i),u=!1,f=a>0,m=0,p=0;do{var h=JW(e,i),g=h[0],y=h[1],x=h[2],v=y-x-o*g;(g||v)&&ZW(e,i)&&(m+=v,p+=g),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(p)<1)&&(u=!0),u},U0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},k9=function(e){return[e.deltaX,e.deltaY]},M9=function(e){return e&&"current"in e?e.current:e},rEe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sEe=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},oEe=0,Iu=[];function aEe(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),s=d.useState(oEe++)[0],o=d.useState(QW)[0],a=d.useRef(e);d.useEffect(function(){a.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=qe([e.lockRef.current],(e.shards||[]).map(M9),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=d.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=U0(y),b=n.current,_="deltaX"in y?y.deltaX:b[0]-v[0],w="deltaY"in y?y.deltaY:b[1]-v[1],S,C=y.target,E=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in y&&E==="h"&&C.type==="range")return!1;var T=E9(E,C);if(!T)return!0;if(T?S=E:(S=E==="v"?"h":"v",T=E9(E,C)),!T)return!1;if(!r.current&&"changedTouches"in y&&(_||w)&&(r.current=S),!S)return!0;var k=r.current||S;return nEe(k,x,y,k==="h"?_:w)},[]),c=d.useCallback(function(y){var x=y;if(!(!Iu.length||Iu[Iu.length-1]!==o)){var v="deltaY"in x?k9(x):U0(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&rEe(S.delta,v)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var _=(a.current.shards||[]).map(M9).filter(Boolean).filter(function(S){return S.contains(x.target)}),w=_.length>0?i(x,_[0]):!a.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),u=d.useCallback(function(y,x,v,b){var _={name:y,delta:x,target:v,should:b,shadowParent:iEe(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),f=d.useCallback(function(y){n.current=U0(y),r.current=void 0},[]),m=d.useCallback(function(y){u(y.type,k9(y),y.target,i(y,e.lockRef.current))},[]),p=d.useCallback(function(y){u(y.type,U0(y),y.target,i(y,e.lockRef.current))},[]);d.useEffect(function(){return Iu.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",c,ju),document.addEventListener("touchmove",c,ju),document.addEventListener("touchstart",f,ju),function(){Iu=Iu.filter(function(y){return y!==o}),document.removeEventListener("wheel",c,ju),document.removeEventListener("touchmove",c,ju),document.removeEventListener("touchstart",f,ju)}},[]);var h=e.removeScrollBar,g=e.inert;return d.createElement(d.Fragment,null,g?d.createElement(o,{styles:sEe(s)}):null,h?d.createElement(Y3e,{gapMode:e.gapMode}):null)}function iEe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lEe=O3e(YW,aEe);var lg=d.forwardRef(function(e,t){return d.createElement(ev,Sr({},e,{ref:t,sideCar:lEe}))});lg.classNames=ev.classNames;var k3=["Enter"," "],cEe=["ArrowDown","PageUp","Home"],eG=["ArrowUp","PageDown","End"],uEe=[...cEe,...eG],dEe={ltr:[...k3,"ArrowRight"],rtl:[...k3,"ArrowLeft"]},fEe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cg="Menu",[nh,mEe,pEe]=UW(cg),[fu,tG]=Vs(cg,[pEe,Sf,Jl]),ug=Sf(),nG=Jl(),[rG,ec]=fu(cg),[hEe,dg]=fu(cg),sG=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,i=ug(t),[c,u]=d.useState(null),f=d.useRef(!1),m=Js(o),p=Pf(s);return d.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),l.jsx(gx,{...i,children:l.jsx(rG,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:u,children:l.jsx(hEe,{scope:t,onClose:d.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};sG.displayName=cg;var gEe="MenuAnchor",sT=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ug(n);return l.jsx(yx,{...s,...r,ref:t})});sT.displayName=gEe;var oT="MenuPortal",[yEe,oG]=fu(oT,{forceMount:void 0}),aG=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ec(oT,t);return l.jsx(yEe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:r})})})};aG.displayName=oT;var Mo="MenuContent",[xEe,aT]=fu(Mo),iG=d.forwardRef((e,t)=>{const n=oG(Mo,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ec(Mo,e.__scopeMenu),a=dg(Mo,e.__scopeMenu);return l.jsx(nh.Provider,{scope:e.__scopeMenu,children:l.jsx(Hr,{present:r||o.open,children:l.jsx(nh.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(vEe,{...s,ref:t}):l.jsx(bEe,{...s,ref:t})})})})}),vEe=d.forwardRef((e,t)=>{const n=ec(Mo,e.__scopeMenu),r=d.useRef(null),s=Sn(t,r);return d.useEffect(()=>{const o=r.current;if(o)return rT(o)},[]),l.jsx(iT,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:rt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bEe=d.forwardRef((e,t)=>{const n=ec(Mo,e.__scopeMenu);return l.jsx(iT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),_Ee=qp("MenuContent.ScrollLock"),iT=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...y}=e,x=ec(Mo,n),v=dg(Mo,n),b=ug(n),_=nG(n),w=mEe(n),[S,C]=d.useState(null),E=d.useRef(null),T=Sn(t,E,x.onContentChange),k=d.useRef(0),I=d.useRef(""),M=d.useRef(0),N=d.useRef(null),D=d.useRef("right"),j=d.useRef(0),F=g?lg:d.Fragment,R=g?{as:_Ee,allowPinchZoom:!0}:void 0,P=U=>{const O=I.current+U,$=w().filter(se=>!se.disabled),G=document.activeElement,H=$.find(se=>se.ref.current===G)?.textValue,Q=$.map(se=>se.textValue),Y=jEe(Q,O,H),te=$.find(se=>se.textValue===Y)?.ref.current;(function se(ae){I.current=ae,window.clearTimeout(k.current),ae!==""&&(k.current=window.setTimeout(()=>se(""),1e3))})(O),te&&setTimeout(()=>te.focus())};d.useEffect(()=>()=>window.clearTimeout(k.current),[]),nT();const L=d.useCallback(U=>D.current===N.current?.side&&PEe(U,N.current?.area),[]);return l.jsx(xEe,{scope:n,searchRef:I,onItemEnter:d.useCallback(U=>{L(U)&&U.preventDefault()},[L]),onItemLeave:d.useCallback(U=>{L(U)||(E.current?.focus(),C(null))},[L]),onTriggerLeave:d.useCallback(U=>{L(U)&&U.preventDefault()},[L]),pointerGraceTimerRef:M,onPointerGraceIntentChange:d.useCallback(U=>{N.current=U},[]),children:l.jsx(F,{...R,children:l.jsx(Xx,{asChild:!0,trapped:s,onMountAutoFocus:rt(o,U=>{U.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(vx,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,children:l.jsx(Zx,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:rt(c,U=>{v.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(lM,{role:"menu","aria-orientation":"vertical","data-state":SG(x.open),"data-radix-menu-content":"",dir:v.dir,...b,...y,ref:T,style:{outline:"none",...y.style},onKeyDown:rt(y.onKeyDown,U=>{const $=U.target.closest("[data-radix-menu-content]")===U.currentTarget,G=U.ctrlKey||U.altKey||U.metaKey,H=U.key.length===1;$&&(U.key==="Tab"&&U.preventDefault(),!G&&H&&P(U.key));const Q=E.current;if(U.target!==Q||!uEe.includes(U.key))return;U.preventDefault();const te=w().filter(se=>!se.disabled).map(se=>se.ref.current);eG.includes(U.key)&&te.reverse(),REe(te)}),onBlur:rt(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(k.current),I.current="")}),onPointerMove:rt(e.onPointerMove,rh(U=>{const O=U.target,$=j.current!==U.clientX;if(U.currentTarget.contains(O)&&$){const G=U.clientX>j.current?"right":"left";D.current=G,j.current=U.clientX}}))})})})})})})});iG.displayName=Mo;var wEe="MenuGroup",lT=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Et.div,{role:"group",...r,ref:t})});lT.displayName=wEe;var CEe="MenuLabel",lG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Et.div,{...r,ref:t})});lG.displayName=CEe;var r2="MenuItem",T9="menu.itemSelect",tv=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=d.useRef(null),a=dg(r2,e.__scopeMenu),i=aT(r2,e.__scopeMenu),c=Sn(t,o),u=d.useRef(!1),f=()=>{const m=o.current;if(!n&&m){const p=new CustomEvent(T9,{bubbles:!0,cancelable:!0});m.addEventListener(T9,h=>r?.(h),{once:!0}),xme(m,p),p.defaultPrevented?u.current=!1:a.onClose()}};return l.jsx(cG,{...s,ref:c,disabled:n,onClick:rt(e.onClick,f),onPointerDown:m=>{e.onPointerDown?.(m),u.current=!0},onPointerUp:rt(e.onPointerUp,m=>{u.current||m.currentTarget?.click()}),onKeyDown:rt(e.onKeyDown,m=>{const p=i.searchRef.current!=="";n||p&&m.key===" "||k3.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});tv.displayName=r2;var cG=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=aT(r2,n),i=nG(n),c=d.useRef(null),u=Sn(t,c),[f,m]=d.useState(!1),[p,h]=d.useState("");return d.useEffect(()=>{const g=c.current;g&&h((g.textContent??"").trim())},[o.children]),l.jsx(nh.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:l.jsx(Jx,{asChild:!0,...i,focusable:!r,children:l.jsx(Et.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:rt(e.onPointerMove,rh(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:rt(e.onPointerLeave,rh(g=>a.onItemLeave(g))),onFocus:rt(e.onFocus,()=>m(!0)),onBlur:rt(e.onBlur,()=>m(!1))})})})}),SEe="MenuCheckboxItem",uG=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(hG,{scope:e.__scopeMenu,checked:n,children:l.jsx(tv,{role:"menuitemcheckbox","aria-checked":s2(n)?"mixed":n,...s,ref:t,"data-state":dT(n),onSelect:rt(s.onSelect,()=>r?.(s2(n)?!0:!n),{checkForDefaultPrevented:!1})})})});uG.displayName=SEe;var dG="MenuRadioGroup",[EEe,kEe]=fu(dG,{value:void 0,onValueChange:()=>{}}),fG=d.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Js(r);return l.jsx(EEe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(lT,{...s,ref:t})})});fG.displayName=dG;var mG="MenuRadioItem",pG=d.forwardRef((e,t)=>{const{value:n,...r}=e,s=kEe(mG,e.__scopeMenu),o=n===s.value;return l.jsx(hG,{scope:e.__scopeMenu,checked:o,children:l.jsx(tv,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":dT(o),onSelect:rt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});pG.displayName=mG;var cT="MenuItemIndicator",[hG,MEe]=fu(cT,{checked:!1}),gG=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=MEe(cT,n);return l.jsx(Hr,{present:r||s2(o.checked)||o.checked===!0,children:l.jsx(Et.span,{...s,ref:t,"data-state":dT(o.checked)})})});gG.displayName=cT;var TEe="MenuSeparator",yG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});yG.displayName=TEe;var AEe="MenuArrow",xG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ug(n);return l.jsx(cM,{...s,...r,ref:t})});xG.displayName=AEe;var uT="MenuSub",[NEe,vG]=fu(uT),bG=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,o=ec(uT,t),a=ug(t),[i,c]=d.useState(null),[u,f]=d.useState(null),m=Js(s);return d.useEffect(()=>(o.open===!1&&m(!1),()=>m(!1)),[o.open,m]),l.jsx(gx,{...a,children:l.jsx(rG,{scope:t,open:r,onOpenChange:m,content:u,onContentChange:f,children:l.jsx(NEe,{scope:t,contentId:ls(),triggerId:ls(),trigger:i,onTriggerChange:c,children:n})})})};bG.displayName=uT;var Jm="MenuSubTrigger",_G=d.forwardRef((e,t)=>{const n=ec(Jm,e.__scopeMenu),r=dg(Jm,e.__scopeMenu),s=vG(Jm,e.__scopeMenu),o=aT(Jm,e.__scopeMenu),a=d.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},f=d.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return d.useEffect(()=>f,[f]),d.useEffect(()=>{const m=i.current;return()=>{window.clearTimeout(m),c(null)}},[i,c]),l.jsx(sT,{asChild:!0,...u,children:l.jsx(cG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":SG(n.open),...e,ref:zc(t,s.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:rt(e.onPointerMove,rh(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:rt(e.onPointerLeave,rh(m=>{f();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,g=h==="right",y=g?-5:5,x=p[g?"left":"right"],v=p[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+y,y:m.clientY},{x,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x,y:p.bottom}],side:h}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:rt(e.onKeyDown,m=>{const p=o.searchRef.current!=="";e.disabled||p&&m.key===" "||dEe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});_G.displayName=Jm;var wG="MenuSubContent",CG=d.forwardRef((e,t)=>{const n=oG(Mo,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ec(Mo,e.__scopeMenu),a=dg(Mo,e.__scopeMenu),i=vG(wG,e.__scopeMenu),c=d.useRef(null),u=Sn(t,c);return l.jsx(nh.Provider,{scope:e.__scopeMenu,children:l.jsx(Hr,{present:r||o.open,children:l.jsx(nh.Slot,{scope:e.__scopeMenu,children:l.jsx(iT,{id:i.contentId,"aria-labelledby":i.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:rt(e.onFocusOutside,f=>{f.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:rt(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:rt(e.onKeyDown,f=>{const m=f.currentTarget.contains(f.target),p=fEe[a.dir].includes(f.key);m&&p&&(o.onOpenChange(!1),i.trigger?.focus(),f.preventDefault())})})})})})});CG.displayName=wG;function SG(e){return e?"open":"closed"}function s2(e){return e==="indeterminate"}function dT(e){return s2(e)?"indeterminate":e?"checked":"unchecked"}function REe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function DEe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function jEe(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=DEe(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function IEe(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;or!=p>r&&n<(m-u)*(r-f)/(p-f)+u&&(s=!s)}return s}function PEe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return IEe(n,t)}function rh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var OEe=sG,LEe=sT,FEe=aG,BEe=iG,UEe=lT,VEe=lG,HEe=tv,zEe=uG,WEe=fG,GEe=pG,$Ee=gG,qEe=yG,KEe=xG,YEe=bG,QEe=_G,XEe=CG,nv="DropdownMenu",[ZEe]=Vs(nv,[tG]),cs=tG(),[JEe,EG]=ZEe(nv),kG=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=cs(t),u=d.useRef(null),[f,m]=fo({prop:s,defaultProp:o??!1,onChange:a,caller:nv});return l.jsx(JEe,{scope:t,triggerId:ls(),triggerRef:u,contentId:ls(),open:f,onOpenChange:m,onOpenToggle:d.useCallback(()=>m(p=>!p),[m]),modal:i,children:l.jsx(OEe,{...c,open:f,onOpenChange:m,dir:r,modal:i,children:n})})};kG.displayName=nv;var MG="DropdownMenuTrigger",TG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=EG(MG,n),a=cs(n);return l.jsx(LEe,{asChild:!0,...a,children:l.jsx(Et.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:zc(t,o.triggerRef),onPointerDown:rt(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:rt(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});TG.displayName=MG;var eke="DropdownMenuPortal",AG=e=>{const{__scopeDropdownMenu:t,...n}=e,r=cs(t);return l.jsx(FEe,{...r,...n})};AG.displayName=eke;var NG="DropdownMenuContent",RG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=EG(NG,n),o=cs(n),a=d.useRef(!1);return l.jsx(BEe,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:rt(e.onCloseAutoFocus,i=>{a.current||s.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:rt(e.onInteractOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.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)"}})});RG.displayName=NG;var tke="DropdownMenuGroup",DG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(UEe,{...s,...r,ref:t})});DG.displayName=tke;var nke="DropdownMenuLabel",jG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(VEe,{...s,...r,ref:t})});jG.displayName=nke;var rke="DropdownMenuItem",IG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(HEe,{...s,...r,ref:t})});IG.displayName=rke;var ske="DropdownMenuCheckboxItem",PG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(zEe,{...s,...r,ref:t})});PG.displayName=ske;var oke="DropdownMenuRadioGroup",ake=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(WEe,{...s,...r,ref:t})});ake.displayName=oke;var ike="DropdownMenuRadioItem",lke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(GEe,{...s,...r,ref:t})});lke.displayName=ike;var cke="DropdownMenuItemIndicator",uke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx($Ee,{...s,...r,ref:t})});uke.displayName=cke;var dke="DropdownMenuSeparator",OG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(qEe,{...s,...r,ref:t})});OG.displayName=dke;var fke="DropdownMenuArrow",mke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(KEe,{...s,...r,ref:t})});mke.displayName=fke;var pke=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:o}=e,a=cs(t),[i,c]=fo({prop:r,defaultProp:o??!1,onChange:s,caller:"DropdownMenuSub"});return l.jsx(YEe,{...a,open:i,onOpenChange:c,children:n})},hke="DropdownMenuSubTrigger",LG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(QEe,{...s,...r,ref:t})});LG.displayName=hke;var gke="DropdownMenuSubContent",FG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(XEe,{...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)"}})});FG.displayName=gke;var yke=kG,xke=TG,BG=AG,vke=RG,bke=DG,_ke=jG,UG=IG,VG=PG,wke=OG,Cke=pke,Ske=LG,Eke=FG;const kke=ci("",{variants:{disabled:{false:"text-foreground",true:"text-quiet"},highlighted:{false:"",true:"bg-subtle"},shouldShowFocusRing:{false:"",true:"interactable"},isInteractable:{false:"",true:"reset hover:bg-subtler cursor-pointer"},rounded:{false:"",true:"rounded-lg"}},defaultVariants:{disabled:!1,highlighted:!1,shouldShowFocusRing:!1,isInteractable:!1,rounded:!1}});function Mke(e){return typeof e=="string"}function o2(e){return typeof e=="string"||typeof e=="function"}function HG({ref:e,children:t,leadingAccessory:n,trailingAccessory:r,subtitle:s,disabled:o=!1,highlighted:a=!1,shouldShowFocusRing:i=!1,rounded:c=!1,className:u,role:f,href:m,target:p,rel:h,...g}){const y=!!f,x=!!m,v=!m&&f==="button",b=z(u,"w-full gap-sm px-sm flex select-none items-center py-1.5 font-sans text-[13px] leading-loose",kke({disabled:o,highlighted:a,shouldShowFocusRing:i,isInteractable:y&&!o,rounded:c})),_=l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:Mke(n)?"flex shrink-0 items-center":"shrink-0 self-start pt-[0.275rem]",children:o2(n)?l.jsx(rn,{icon:n,size:"small"}):n}),l.jsx("div",{className:"flex-1",children:l.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[t,s&&l.jsx("span",{className:"text-quiet whitespace-pre-wrap pb-1 text-[11px] leading-tight",children:s})]})}),r&&l.jsx("div",{className:"ml-auto flex self-start pt-[0.275rem]",children:o2(r)?l.jsx(rn,{icon:r,size:"small"}):r})]});if(v)return l.jsx(Ro,{ref:e,type:"button",disabled:o,className:b,...g,children:_});if(x){if(o)return l.jsx("span",{ref:e,role:f,className:z("reset",b),...g,children:_});const{onClick:w,...S}=g;return l.jsx(Vy,{ref:e,role:f,href:m,target:p,rel:h,__dangerousDoNotUseShouldApplyFocusIndicator:f==="link",className:b,__dangerousDoNotUseOnClick:w,...S,children:_})}return l.jsx("div",{ref:e,role:f,className:b,...g,children:_})}function sbt(e){return l.jsx(HG,{...e})}const M3=HG,Tke={tiny:"tiny",small:"tiny",default:"tiny",large:"small"},A9=e=>{const t=_x(e),{showChevron:n=!0}=e;return z(t,{"justify-between":n})},Ake=({variant:e})=>z("ml-1","shrink-0",{"text-quiet":e==="tonal"});function Nke({ref:e,children:t,icon:n,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,variant:i="primary",size:c="default",disabled:u=!1,onClick:f,leadingAccessory:m,rounded:p=!1,showChevron:h=!0,tooltipSide:g="top",tooltipAlign:y="center",__dangerousHtmlProps:x={},...v}){const b=bx(e),_=wa(v),w=Tke[c];if(n){const S=l.jsxs(Ro,{ref:b,..._,disabled:u,className:A9({variant:i,size:c,disabled:u,fullWidth:!1,rounded:p,showChevron:h}),onClick:f,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,...x,children:[l.jsx(rn,{icon:n,size:c}),h&&l.jsx("div",{className:"ml-1 shrink-0",children:l.jsx(rn,{icon:B("chevron-down"),size:c})})]});return u?S:l.jsx(Fo,{content:r,side:g,align:y,children:S})}return l.jsxs(Ro,{ref:b,..._,disabled:u,className:A9({variant:i,size:c,disabled:u,fullWidth:!0,showChevron:h}),onClick:f,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,...x,children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[m&&l.jsx("div",{className:"mr-1 shrink-0",children:o2(m)?l.jsx(rn,{icon:m,size:c}):m}),l.jsx("span",{className:z("text-box-trim-both","truncate",{"pl-1":m,"pr-1":!0,"min-w-0":!0}),children:t})]}),h&&l.jsx("div",{className:Ake({variant:i}),children:l.jsx(rn,{icon:B("chevron-down"),size:w})})]})}function fT(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var rv="Checkbox",[Rke]=Vs(rv),[Dke,mT]=Rke(rv);function jke(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:a,name:i,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:m}=e,[p,h]=fo({prop:n,defaultProp:s??!1,onChange:c,caller:rv}),[g,y]=d.useState(null),[x,v]=d.useState(null),b=d.useRef(!1),_=g?!!a||!!g.closest("form"):!0,w={checked:p,disabled:o,setChecked:h,control:g,setControl:y,name:i,form:a,value:f,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Ml(s)?!1:s,isFormControl:_,bubbleInput:x,setBubbleInput:v};return l.jsx(Dke,{scope:t,...w,children:Ike(m)?m(w):r})}var zG="CheckboxTrigger",WG=d.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:a,disabled:i,checked:c,required:u,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=mT(zG,e),y=Sn(s,f),x=d.useRef(c);return d.useEffect(()=>{const v=o?.form;if(v){const b=()=>m(x.current);return v.addEventListener("reset",b),()=>v.removeEventListener("reset",b)}},[o,m]),l.jsx(Et.button,{type:"button",role:"checkbox","aria-checked":Ml(c)?"mixed":c,"aria-required":u,"data-state":KG(c),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:y,onKeyDown:rt(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:rt(n,v=>{m(b=>Ml(b)?!0:!b),g&&h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})});WG.displayName=zG;var pT=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:c,onCheckedChange:u,form:f,...m}=e;return l.jsx(jke,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:i,required:a,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:p})=>l.jsxs(l.Fragment,{children:[l.jsx(WG,{...m,ref:t,__scopeCheckbox:n}),p&&l.jsx(qG,{__scopeCheckbox:n})]})})});pT.displayName=rv;var GG="CheckboxIndicator",hT=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=mT(GG,n);return l.jsx(Hr,{present:r||Ml(o.checked)||o.checked===!0,children:l.jsx(Et.span,{"data-state":KG(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});hT.displayName=GG;var $G="CheckboxBubbleInput",qG=d.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:i,disabled:c,name:u,value:f,form:m,bubbleInput:p,setBubbleInput:h}=mT($G,e),g=Sn(n,h),y=fT(o),x=uM(r);d.useEffect(()=>{const b=p;if(!b)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(y!==o&&S){const E=new Event("click",{bubbles:C});b.indeterminate=Ml(o),S.call(b,Ml(o)?!1:o),b.dispatchEvent(E)}},[p,y,o,s]);const v=d.useRef(Ml(o)?!1:o);return l.jsx(Et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:i,disabled:c,name:u,value:f,form:m,...t,tabIndex:-1,ref:g,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});qG.displayName=$G;function Ike(e){return typeof e=="function"}function Ml(e){return e==="indeterminate"}function KG(e){return Ml(e)?"indeterminate":e?"checked":"unchecked"}const Pke=ci("reset interactable flex select-none items-center justify-center rounded border border-solid transition-colors duration-150",{variants:{size:{large:"size-6",default:"size-[18px]",small:"size-[14px]"},disabled:{false:"cursor-pointer",true:"cursor-default opacity-50"},checked:{false:"border-subtle bg-background",true:"border-super bg-super"}},compoundVariants:[{checked:!1,disabled:!1,class:"hover:border-subtle hover:bg-subtle"},{checked:!0,disabled:!1,class:"hover:opacity-80"}],defaultVariants:{size:"default",disabled:!1,checked:!1}});function Oke({checked:e=!1,onCheckedChange:t,"aria-label":n,size:r="default",disabled:s=!1,tabIndex:o=0}){return l.jsx(pT,{checked:e,onCheckedChange:t,disabled:s,"aria-label":n,className:Pke({size:r,disabled:s,checked:e}),tabIndex:o,children:l.jsx(hT,{className:"text-inverse flex items-center justify-center",children:l.jsx(ut,{name:B("check"),size:r==="small"?14:16})})})}const Lke=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function ei({ref:e,children:t,leadingAccessory:n,trailingAccessory:r,subtitle:s,role:o="menuitem",...a}){const i=wa(a),c=i["data-disabled"]===""||i["data-disabled"]==="true"||a["aria-disabled"]===!0||a["aria-disabled"]==="true",u=i["data-highlighted"]===""||i["data-highlighted"]==="true"||i["data-state"]==="open",f=!Lke.has(o);return l.jsx(M3,{ref:e,role:o,disabled:c,highlighted:u,shouldShowFocusRing:f,leadingAccessory:n,trailingAccessory:r,subtitle:s,rounded:!0,className:z(a.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...i,children:t})}function Fke({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||n(!t)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>l.jsx(Oke,{checked:t,onCheckedChange:n,disabled:s,"aria-label":"",size:"small",tabIndex:c?-1:0}),[t,s,c,n]);return c?l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"checkbox","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(VG,{asChild:!0,disabled:s,checked:t,onCheckedChange:n,onSelect:u,textValue:r,...i,children:l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,children:e})})}function Bke({label:e,children:t}){const{isMobileStyle:n}=Bo(),r=d.useId();return n?l.jsxs("div",{role:"group","aria-labelledby":r,children:[l.jsx("div",{id:r,className:"text-foreground font-medium p-2 text-xs",children:e}),l.jsx("div",{children:t})]}):l.jsxs(bke,{children:[l.jsx(_ke,{className:"text-foreground font-medium p-2 text-xs",children:e}),t]})}const YG=d.createContext(null);function Uke(){return d.useContext(YG)}function Vke({children:e,close:t}){const n={close:t};return l.jsx(YG.Provider,{value:n,children:e})}const QG=d.createContext(null);function XG(){return d.useContext(QG)}function Hke(){return XG()?.closeMobileMenu}function T3({children:e,submenus:t}){const r={closeMobileMenu:Uke()?.close,submenus:t??{closeAll:()=>{},register:()=>{},unregister:()=>{}}};return l.jsx(QG.Provider,{value:r,children:e})}const zke=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function Wke({ref:e,className:t,children:n,role:r="menuitem",asChild:s,disabled:o,onSelect:a,textValue:i,...c}){const u=!zke.has(r),f=z("reset flex",{interactable:u,"pointer-events-none":o},t);return l.jsx(UG,{ref:e,disabled:o,onSelect:a,textValue:i,asChild:s,className:f,...s?{}:{role:r},...c,children:n})}function Gke({children:e,textValue:t,disabled:n,onSelect:r,leadingAccessory:s,trailingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=Hke(),f=d.useCallback(()=>{if(!n)return r(),!0},[n,r]),m=d.useCallback(()=>{f()&&u?.()},[f,u]),p=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(),u?.())},[f,u]);return c?l.jsx(ei,{leadingAccessory:s,trailingAccessory:o,subtitle:a,role:"button",tabIndex:n?-1:0,onClick:m,onKeyDown:p,"aria-disabled":n,...i,children:e}):l.jsx(Wke,{disabled:n,onSelect:f,textValue:t,asChild:!0,...i,children:l.jsx(ei,{leadingAccessory:s,trailingAccessory:o,subtitle:a,children:e})})}const $ke=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function N9({ref:e,href:t,target:n,rel:r,children:s,leadingAccessory:o,trailingAccessory:a,subtitle:i,role:c="menuitem",...u}){const f=wa(u),m=f["data-disabled"]===""||f["data-disabled"]==="true"||u["aria-disabled"]===!0||u["aria-disabled"]==="true",p=f["data-highlighted"]===""||f["data-highlighted"]==="true",h=!$ke.has(c);return t?l.jsx(M3,{ref:e,role:"menuitem",href:t,target:n,rel:r,disabled:m,highlighted:p,shouldShowFocusRing:h,leadingAccessory:o,trailingAccessory:a,subtitle:i,rounded:!0,className:z(u.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...f,children:s}):l.jsx(M3,{ref:e,role:"menuitem",disabled:m,highlighted:p,shouldShowFocusRing:h,leadingAccessory:o,trailingAccessory:a,subtitle:i,rounded:!0,className:z(u.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...f,children:s})}function qke({children:e,disabled:t,href:n,...r}){const{isMobileStyle:s}=Bo();return s?l.jsx(N9,{href:n,"aria-disabled":t,role:"link",...r,children:e}):l.jsx(UG,{asChild:!0,disabled:t,children:l.jsx(N9,{href:n,...r,children:e})})}function Kke(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yke(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var gT="ScrollArea",[ZG]=Vs(gT),[Qke,zo]=ZG(gT),JG=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[i,c]=d.useState(null),[u,f]=d.useState(null),[m,p]=d.useState(null),[h,g]=d.useState(null),[y,x]=d.useState(null),[v,b]=d.useState(0),[_,w]=d.useState(0),[S,C]=d.useState(!1),[E,T]=d.useState(!1),k=Sn(t,M=>c(M)),I=Pf(s);return l.jsx(Qke,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:i,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:w,children:l.jsx(Et.div,{dir:I,...a,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});JG.displayName=gT;var e$="ScrollAreaViewport",t$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=zo(e$,n),i=d.useRef(null),c=Sn(t,i,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(Et.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});t$.displayName=e$;var fi="ScrollAreaScrollbar",n$=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=zo(fi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,i=e.orientation==="horizontal";return d.useEffect(()=>(i?o(!0):a(!0),()=>{i?o(!1):a(!1)}),[i,o,a]),s.type==="hover"?l.jsx(Xke,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(Zke,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(r$,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx(yT,{...r,ref:t}):null});n$.displayName=fi;var Xke=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=zo(fi,e.__scopeScrollArea),[o,a]=d.useState(!1);return d.useEffect(()=>{const i=s.scrollArea;let c=0;if(i){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(Hr,{present:n||o,children:l.jsx(r$,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Zke=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=zo(fi,e.__scopeScrollArea),o=e.orientation==="horizontal",a=ov(()=>c("SCROLL_END"),100),[i,c]=Yke("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 d.useEffect(()=>{if(i==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,s.scrollHideDelay,c]),d.useEffect(()=>{const u=s.viewport,f=o?"scrollLeft":"scrollTop";if(u){let m=u[f];const p=()=>{const h=u[f];m!==h&&(c("SCROLL"),a()),m=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[s.viewport,o,c,a]),l.jsx(Hr,{present:n||i!=="hidden",children:l.jsx(yT,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:rt(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:rt(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),r$=d.forwardRef((e,t)=>{const n=zo(fi,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=d.useState(!1),i=e.orientation==="horizontal",c=ov(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=zo(fi,e.__scopeScrollArea),o=d.useRef(null),a=d.useRef(0),[i,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=i$(i.viewport,i.content),f={...r,sizes:i,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function m(p,h){return o5e(p,a.current,i,h)}return n==="horizontal"?l.jsx(Jke,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,h=R9(p,i,s.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=m(p,s.dir))}}):n==="vertical"?l.jsx(e5e,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,h=R9(p,i);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=m(p))}}):null}),Jke=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=zo(fi,e.__scopeScrollArea),[a,i]=d.useState(),c=d.useRef(null),u=Sn(t,c,o.onScrollbarXChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),l.jsx(o$,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sv(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,m)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),c$(p,m)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:i2(a.paddingLeft),paddingEnd:i2(a.paddingRight)}})}})}),e5e=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=zo(fi,e.__scopeScrollArea),[a,i]=d.useState(),c=d.useRef(null),u=Sn(t,c,o.onScrollbarYChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),l.jsx(o$,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sv(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,m)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),c$(p,m)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:i2(a.paddingTop),paddingEnd:i2(a.paddingBottom)}})}})}),[t5e,s$]=ZG(fi),o$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=e,h=zo(fi,n),[g,y]=d.useState(null),x=Sn(t,k=>y(k)),v=d.useRef(null),b=d.useRef(""),_=h.viewport,w=r.content-r.viewport,S=Js(f),C=Js(c),E=ov(m,10);function T(k){if(v.current){const I=k.clientX-v.current.left,M=k.clientY-v.current.top;u({x:I,y:M})}}return d.useEffect(()=>{const k=I=>{const M=I.target;g?.contains(M)&&S(I,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,g,w,S]),d.useEffect(C,[r,C]),$d(g,E),$d(h.content,E),l.jsx(t5e,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Js(o),onThumbPointerUp:Js(a),onThumbPositionChange:C,onThumbPointerDown:Js(i),children:l.jsx(Et.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:rt(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),v.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(k))}),onPointerMove:rt(e.onPointerMove,T),onPointerUp:rt(e.onPointerUp,k=>{const I=k.target;I.hasPointerCapture(k.pointerId)&&I.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),a2="ScrollAreaThumb",a$=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=s$(a2,e.__scopeScrollArea);return l.jsx(Hr,{present:n||s.hasThumb,children:l.jsx(n5e,{ref:t,...r})})}),n5e=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=zo(a2,n),a=s$(a2,n),{onThumbPositionChange:i}=a,c=Sn(t,m=>a.onThumbChange(m)),u=d.useRef(void 0),f=ov(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const m=o.viewport;if(m){const p=()=>{if(f(),!u.current){const h=a5e(m,i);u.current=h,i()}};return i(),m.addEventListener("scroll",p),()=>m.removeEventListener("scroll",p)}},[o.viewport,f,i]),l.jsx(Et.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:rt(e.onPointerDownCapture,m=>{const h=m.target.getBoundingClientRect(),g=m.clientX-h.left,y=m.clientY-h.top;a.onThumbPointerDown({x:g,y})}),onPointerUp:rt(e.onPointerUp,a.onThumbPointerUp)})});a$.displayName=a2;var xT="ScrollAreaCorner",r5e=d.forwardRef((e,t)=>{const n=zo(xT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(s5e,{...e,ref:t}):null});r5e.displayName=xT;var s5e=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=zo(xT,n),[o,a]=d.useState(0),[i,c]=d.useState(0),u=!!(o&&i);return $d(s.scrollbarX,()=>{const f=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(f),c(f)}),$d(s.scrollbarY,()=>{const f=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(f),a(f)}),u?l.jsx(Et.div,{...r,ref:t,style:{width:o,height:i,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function i2(e){return e?parseInt(e,10):0}function i$(e,t){const n=e/t;return isNaN(n)?0:n}function sv(e){const t=i$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function o5e(e,t,n,r="ltr"){const s=sv(n),o=s/2,a=t||o,i=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-i,f=n.content-n.viewport,m=r==="ltr"?[0,f]:[f*-1,0];return l$([c,u],m)(e)}function R9(e,t,n="ltr"){const r=sv(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,i=o-r,c=n==="ltr"?[0,a]:[a*-1,0],u=Kke(e,c);return l$([0,a],[0,i])(u)}function l$(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 c$(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,i=n.top!==o.top;(a||i)&&t(),n=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function ov(e,t){const n=Js(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function $d(e,t){const n=Js(t);vme(()=>{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])}var u$=JG,d$=t$,A3=n$,N3=a$;function R3({children:e,maxHeight:t,className:n="",onScroll:r}){const s=d.useCallback(()=>{r?.()},[r]);return l.jsxs(u$,{className:z("w-full overflow-hidden group",n),children:[l.jsx(d$,{className:"w-full",style:t?{maxHeight:t}:void 0,onScroll:s,children:e}),l.jsx(A3,{forceMount:!0,orientation:"vertical",className:"flex flex-col p-px duration-150 opacity-0 group-hover:opacity-100 data-[state=visible]:opacity-100",children:l.jsx(N3,{className:"relative rounded-full duration-quick !w-[5px] bg-[color:oklch(var(--foreground-color)/0.15)] before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:size-full before:min-w-[10px] before:min-h-[10px]"})})]})}function i5e(){const e=d.useRef(new Map),t=d.useCallback((s,o)=>{e.current.set(s,o)},[]),n=d.useCallback(s=>{e.current.delete(s)},[]);return{closeAll:d.useCallback(()=>{e.current.forEach(s=>s())},[]),register:t,unregister:n}}function l5e(e){const t=XG(),n=d.useId();d.useEffect(()=>{if(t)return t.submenus.register(n,e),()=>{t.submenus.unregister(n)}},[t,n,e])}function f$({children:e,maxHeightPx:t=300,minWidthPx:n,maxWidthPx:r}){const s=i5e(),o=d.useCallback(()=>{s.closeAll()},[s]),a=Ffe(o,100),i=`min(calc(var(--radix-dropdown-menu-content-available-height) - 16px), ${t}px)`;return l.jsx(T3,{submenus:s,children:l.jsx("div",{className:"bg-base shadow-overlay border-subtlest p-xs rounded-lg",style:{maxWidth:r,minWidth:n},children:l.jsx(R3,{maxHeight:i,onScroll:a,children:e})})})}var c5e="Separator",D9="horizontal",u5e=["horizontal","vertical"],m$=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=D9,...s}=e,o=d5e(r)?r:D9,i=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Et.div,{"data-orientation":o,...i,...s,ref:t})});m$.displayName=c5e;function d5e(e){return u5e.includes(e)}var f5e=m$;const j9="border-subtlest my-xs mx-sm border-t first:hidden last:hidden";function m5e(){const{isMobileStyle:e}=Bo();return e?l.jsx(f5e,{className:j9}):l.jsx(wke,{className:j9})}const p5e=4,h5e=-4;function g5e(){return z("data-[state=open]:animate-slideLeftAndFadeIn","data-[state=closed]:animate-slideLeftAndFadeOut")}function y5e({isOpen:e,onToggle:t,triggerElement:n,children:r,disabled:s=!1,minWidthPx:o,maxHeightPx:a=300,maxWidthPx:i}){const{isMobileStyle:c}=Bo(),[u,f]=d.useState(!1),m=e??u,p=d.useCallback(x=>{s||(t?t(x):f(x))},[s,t]),h=d.useCallback(()=>{t?t(!1):f(!1)},[t]);l5e(h);const g=d.useCallback(()=>{p(!m)},[p,m]),y=d.useCallback(x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),g())},[g]);if(c){const x=d.cloneElement(n,{disabled:s,onClick:g,onKeyDown:y,isExpanded:m});return l.jsxs("div",{children:[x,m&&l.jsx("div",{className:"border-subtlest ml-sm pl-md mt-xs flex flex-col gap-px border-l-2",children:r})]})}return l.jsxs(Cke,{open:m,onOpenChange:p,children:[l.jsx(Ske,{asChild:!0,disabled:s,children:n}),l.jsx(BG,{children:l.jsx(Eke,{sideOffset:p5e,alignOffset:h5e,className:g5e(),children:l.jsx(f$,{minWidthPx:o,maxHeightPx:a,maxWidthPx:i,children:r})})})]})}function x5e({children:e,disabled:t,leadingAccessory:n,subtitle:r,isExpanded:s,...o}){const{isMobileStyle:a}=Bo();return a?l.jsx(ei,{leadingAccessory:n,trailingAccessory:l.jsx("div",{className:z("transition-transform",{"rotate-90":s}),children:l.jsx(rn,{icon:B("chevron-right"),size:"small"})}),subtitle:r,role:"button",tabIndex:t?-1:0,"aria-disabled":t,"aria-expanded":s,...o,children:e}):l.jsx(ei,{leadingAccessory:n,trailingAccessory:l.jsx(rn,{icon:B("chevron-right"),size:"small"}),subtitle:r,"aria-disabled":t,...o,children:e})}var av="Switch",[v5e]=Vs(av),[b5e,_5e]=v5e(av),p$=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:c="on",onCheckedChange:u,form:f,...m}=e,[p,h]=d.useState(null),g=Sn(t,_=>h(_)),y=d.useRef(!1),x=p?f||!!p.closest("form"):!0,[v,b]=fo({prop:s,defaultProp:o??!1,onChange:u,caller:av});return l.jsxs(b5e,{scope:n,checked:v,disabled:i,children:[l.jsx(Et.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":x$(v),"data-disabled":i?"":void 0,disabled:i,value:c,...m,ref:g,onClick:rt(e.onClick,_=>{b(w=>!w),x&&(y.current=_.isPropagationStopped(),y.current||_.stopPropagation())})}),x&&l.jsx(y$,{control:p,bubbles:!y.current,name:r,value:c,checked:v,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});p$.displayName=av;var h$="SwitchThumb",g$=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=_5e(h$,n);return l.jsx(Et.span,{"data-state":x$(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});g$.displayName=h$;var w5e="SwitchBubbleInput",y$=d.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),i=Sn(a,o),c=fT(n),u=uM(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});y$.displayName=w5e;function x$(e){return e?"checked":"unchecked"}var C5e=p$,S5e=g$;const E5e=ci(z("reset interactable relative inline-block shrink-0 rounded-full shadow-inset-xs","transition-colors duration-150"),{variants:{size:{large:"h-[26px] w-11",default:"h-[22px] w-9",small:"h-[14px] w-6"},disabled:{false:"cursor-pointer",true:"cursor-default opacity-50"},checked:{false:"bg-inverse/45 dark:bg-inverse/20",true:"bg-super dark:bg-super/85"}},compoundVariants:[],defaultVariants:{size:"default",disabled:!1,checked:!1}}),k5e=ci(z("pointer-events-none absolute block rounded-full","bg-base dark:bg-inverse","before:content-[''] before:absolute before:inset-0 before:rounded-full before:bg-base dark:before:bg-white dark:before:shadow-md","transition-transform before:transition-opacity duration-150 before:duration-150"),{variants:{size:{large:"size-5 data-[state=checked]:translate-x-[18px] left-three top-three",default:"size-4 data-[state=checked]:translate-x-[14px] left-three top-three",small:"size-2.5 data-[state=checked]:translate-x-[10px] left-two top-two"},disabled:{false:"",true:"before:opacity-20"},checked:{false:"",true:""}},compoundVariants:[],defaultVariants:{size:"default",disabled:!1,checked:!1}});function fg({ref:e,checked:t=!1,onCheckedChange:n,"aria-label":r,size:s="default",disabled:o=!1,tabIndex:a=0,...i}){const c=bx(e),u=wa(i);return l.jsx(C5e,{ref:c,...u,checked:t,onCheckedChange:n,disabled:o,"aria-label":r,className:E5e({size:s,disabled:o,checked:t}),tabIndex:a,children:l.jsx(S5e,{className:k5e({size:s,disabled:o,checked:t})})})}function M5e({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||n(!t)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>l.jsx(fg,{checked:t,onCheckedChange:n,disabled:s,"aria-label":"",size:"small",tabIndex:c?-1:0}),[t,s,c,n]);return c?l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"switch","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(VG,{asChild:!0,disabled:s,checked:t,onCheckedChange:n,onSelect:u,textValue:r,...i,children:l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,children:e})})}var iv="Dialog",[v$]=Vs(iv),[T5e,Ma]=v$(iv),b$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,i=d.useRef(null),c=d.useRef(null),[u,f]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:iv});return l.jsx(T5e,{scope:t,triggerRef:i,contentRef:c,contentId:ls(),titleId:ls(),descriptionId:ls(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(m=>!m),[f]),modal:a,children:n})};b$.displayName=iv;var _$="DialogTrigger",w$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(_$,n),o=Sn(t,s.triggerRef);return l.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_T(s.open),...r,ref:o,onClick:rt(e.onClick,s.onOpenToggle)})});w$.displayName=_$;var vT="DialogPortal",[A5e,C$]=v$(vT,{forceMount:void 0}),S$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ma(vT,t);return l.jsx(A5e,{scope:t,forceMount:n,children:d.Children.map(r,a=>l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:a})}))})};S$.displayName=vT;var l2="DialogOverlay",E$=d.forwardRef((e,t)=>{const n=C$(l2,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ma(l2,e.__scopeDialog);return o.modal?l.jsx(Hr,{present:r||o.open,children:l.jsx(R5e,{...s,ref:t})}):null});E$.displayName=l2;var N5e=qp("DialogOverlay.RemoveScroll"),R5e=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(l2,n);return l.jsx(lg,{as:N5e,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Et.div,{"data-state":_T(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Yc="DialogContent",k$=d.forwardRef((e,t)=>{const n=C$(Yc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ma(Yc,e.__scopeDialog);return l.jsx(Hr,{present:r||o.open,children:o.modal?l.jsx(D5e,{...s,ref:t}):l.jsx(j5e,{...s,ref:t})})});k$.displayName=Yc;var D5e=d.forwardRef((e,t)=>{const n=Ma(Yc,e.__scopeDialog),r=d.useRef(null),s=Sn(t,n.contentRef,r);return d.useEffect(()=>{const o=r.current;if(o)return rT(o)},[]),l.jsx(M$,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rt(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:rt(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&o.preventDefault()}),onFocusOutside:rt(e.onFocusOutside,o=>o.preventDefault())})}),j5e=d.forwardRef((e,t)=>{const n=Ma(Yc,e.__scopeDialog),r=d.useRef(!1),s=d.useRef(!1);return l.jsx(M$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),M$=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,i=Ma(Yc,n),c=d.useRef(null),u=Sn(t,c);return nT(),l.jsxs(l.Fragment,{children:[l.jsx(Xx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(vx,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":_T(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(I5e,{titleId:i.titleId}),l.jsx(O5e,{contentRef:c,descriptionId:i.descriptionId})]})]})}),bT="DialogTitle",T$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(bT,n);return l.jsx(Et.h2,{id:s.titleId,...r,ref:t})});T$.displayName=bT;var A$="DialogDescription",N$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(A$,n);return l.jsx(Et.p,{id:s.descriptionId,...r,ref:t})});N$.displayName=A$;var R$="DialogClose",D$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(R$,n);return l.jsx(Et.button,{type:"button",...r,ref:t,onClick:rt(e.onClick,()=>s.onOpenChange(!1))})});D$.displayName=R$;function _T(e){return e?"open":"closed"}var j$="DialogTitleWarning",[obt,I$]=bme(j$,{contentName:Yc,titleName:bT,docsSlug:"dialog"}),I5e=({titleId:e})=>{const t=I$(j$),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 d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},P5e="DialogDescriptionWarning",O5e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I$(P5e).contentName}}.`;return d.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},wT=b$,P$=w$,CT=S$,ST=E$,ET=k$,O$=T$,abt=N$,L$=D$;function L5e({modal:e,props:t}){const{openStackedModal:n}=Uo(),r=d.useRef(null);return d.useEffect(()=>{if(e)return r.current=n(e,t),()=>{r.current&&(r.current.closeModal(),r.current=null)}},[e,n,t]),null}const F5e=d.memo(L5e),B5e=()=>null,U5e=B5e,V5e={onClose:()=>{},legacyIdentifier:"__NONE__"};function H5e(){return z("fixed inset-0","bg-black/50","data-[state=open]:animate-fadeIn","data-[state=closed]:animate-fadeOut")}function z5e(){return z("bg-base","fixed inset-x-0 bottom-0","pb-lg","flex flex-col","max-h-[90vh]","shadow-lg","data-[state=open]:animate-slideUpAndFadeIn","data-[state=closed]:animate-slideDownAndFadeOut")}function F$({isOpen:e,onToggle:t,triggerElement:n,children:r}){const s=d.useCallback(()=>t(!1),[t]);return l.jsx(Vke,{close:s,children:l.jsxs(wT,{open:e,onOpenChange:t,children:[l.jsx(P$,{asChild:!0,children:n}),l.jsxs(CT,{children:[l.jsx(ST,{className:H5e()}),l.jsxs(ET,{className:z5e(),"aria-describedby":void 0,children:[l.jsx(FU,{children:l.jsx(O$,{})}),l.jsxs("div",{className:"px-md pt-14 flex-1 overflow-y-auto",children:[l.jsx(F5e,{modal:U5e,props:V5e}),r]}),l.jsx("div",{className:"absolute top-md right-md z-10",children:l.jsx(L$,{asChild:!0,children:l.jsx(wt,{icon:B("x"),variant:"text",size:"default",rounded:!0,"aria-label":"Close"})})})]})]})]})})}function W5e({isOpen:e,onToggle:t,onOpen:n}){const r=d.useRef(e);return d.useEffect(()=>{e&&!r.current&&n?.(),r.current=e},[e,n]),{handleToggle:d.useCallback(o=>{o&&!r.current&&e===void 0&&n?.(),r.current=o,t?.(o)},[e,n,t])}}const G5e=e=>l.jsx("span",{className:z(["text-super"],{"opacity-0":!e}),children:l.jsx(rn,{icon:B("check"),size:"small"})});function $5e({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=d.useCallback(()=>{s||t||n(!0)},[t,s,n]),f=d.useCallback(p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())},[u]),m=d.useMemo(()=>G5e(t),[t]);return c?l.jsx(ei,{leadingAccessory:o,trailingAccessory:m,subtitle:a,role:"radio","aria-checked":t,tabIndex:s?-1:0,onClick:u,onKeyDown:f,"aria-disabled":s,...i,children:e}):l.jsx(ei,{leadingAccessory:o,trailingAccessory:m,subtitle:a,role:"radio","aria-checked":t,tabIndex:s?-1:0,onClick:u,onKeyDown:f,"aria-disabled":s,...i,children:e})}const q5e=4,K5e=8;function Y5e({isOpen:e,onToggle:t,onOpen:n,triggerElement:r,children:s,minWidthPx:o,maxHeightPx:a=300,maxWidthPx:i,align:c="start",modal:u=!1,portalTargetElement:f,__dangerouslySetZIndex:m}){const{isMobileStyle:p}=Bo(),{handleToggle:h}=W5e({isOpen:e,onToggle:t,onOpen:n});return p?l.jsx(F$,{isOpen:e,onToggle:h,triggerElement:r,children:l.jsx(T3,{children:s})}):l.jsx(T3,{children:l.jsxs(yke,{open:e,onOpenChange:h,modal:u,children:[l.jsx(xke,{asChild:!0,children:r}),l.jsx(BG,{container:f,children:l.jsx(vke,{align:c,sideOffset:q5e,className:Q5e({zIndex:X5e(f)?m:void 0}),collisionPadding:K5e,children:l.jsx(f$,{minWidthPx:o,maxHeightPx:a,maxWidthPx:i,children:s})})})]})})}const Dt=Object.assign(Y5e,{Button:Nke,Item:Gke,CheckboxItem:Fke,LinkItem:qke,RadioItem:$5e,Separator:m5e,SwitchItem:M5e,Submenu:y5e,SubmenuItem:x5e,Group:Bke});function Q5e({zIndex:e}){return z("origin-[var(--radix-dropdown-menu-content-transform-origin)]","data-[state=open]:animate-scaleAndFadeIn","data-[state=closed]:animate-scaleAndFadeOut",{"z-10":e===10})}function X5e(e){return e!=null&&e!==document.body}const Z5e=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"cf-ping",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},iy="recentItems";async function J5e({reason:e}){try{const{error:t}=await de.GET("/rest/ping",e);if(t)throw t;return}catch(t){Z.error("Failed to ping.",t);return}}async function eMe({reason:e}){try{const{data:t,error:n,response:r}=await de.GET("/rest/thread/list_recent",e);if(n||!t)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t}catch(t){throw Z.error("Failed to get recent threads.",t),t}}const tMe=({reason:e})=>{const{variation:t}=Z5e(!1),n=d.useRef(t);n.current=t;const{isIncognito:r}=Yz({reason:e}),{inFlightLatest:s}=on(),{session:o}=Ne(),a=o?.user?.email,{data:i,refetch:c,isLoading:u}=mt({queryKey:be.makeQueryKey(iy,a),queryFn:async()=>{if(!a||r)return Pe;const f=await eMe({reason:e});return n.current&&J5e({reason:e}),f}});return d.useEffect(()=>{s||c({cancelRefetch:!1})},[s,c]),d.useMemo(()=>!a||r?{data:[],isLoading:!1}:{data:i??Pe,isLoading:u},[i,a,r,u])};function nMe({activeStreams:e,streams:t,threads:n,entries:r}){return Array.from(e).reverse().map(s=>{const o=t[s];if(!o)return;const a=o.threadId;if(!a)return;const c=n.find(f=>f.id===a)?.entryIds?.[0];if(!c)return;const u=r[c];if(u)return{id:a,slug:u.thread_url_slug,title:u.thread_title??u.query_str??o.placeholderChunk?.query_str??"",rwToken:u.read_write_token,lastUpdated:u.updated_datetime,contextUUID:u.context_uuid,collectionInfo:u.collection_info,displayModel:u.display_model,entryUUID:u.uuid,socialInfo:u.social_info,focus:u.search_focus,mode:u.mode,source:u.source,streamCreatedAt:u.stream_created_at}}).filter(s=>s!=null)}function rMe(){const e=Hs(),{activeStreams:t,streams:n,threads:r,entries:s}=e.getState();return d.useMemo(()=>{const o=nMe({activeStreams:t,streams:n,threads:r,entries:s}),a=new Set;return o.filter(i=>!i.slug||a.has(i.slug)?!1:(a.add(i.slug),!0))},[t,n,r,s])}function sMe({reason:e}){const{data:t,isLoading:n}=tMe({reason:e}),r=rMe();return d.useMemo(()=>({isLoading:n,data:[...r.filter(s=>!t.some(o=>o.link.split("/").pop()===s.slug)).filter(s=>!t.some(o=>o.uuid===s.id)).filter(s=>s.slug!==null).map(s=>({uuid:s.id,variant:"thread",link:`/search/${s.slug}`,title:s.title??"",isStreaming:!0,unread:!1})),...t]}),[t,r,n])}const oMe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"close-sidecar-on-open-in-new-tab",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},aMe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"sidecar-back-to-thread-button",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function D3(e){return e&&"is_widget"in e&&e.is_widget===!0}function iMe(e){return e&&"card_type"in e}function I9(e){return"is_code_interpreter"in e&&e.is_code_interpreter===!0&&e.is_image}const lv=({reason:e})=>{const t=Yt(),{searchTerm:n}=TW(),r=Lx({search_term:n??""}),s=xz(),o=r1e(),a=s1e(),i=Hs(),c=bz(),u=el(),{mutate:f}=Rt({mutationKey:["removeWidget"],mutationFn:async({entryUUID:g,data:y})=>D3(y)?h_e({backendUUID:g,url:y.url,rwToken:u,reason:e}):Promise.resolve(),onMutate:async({entryUUID:g,data:y})=>{await t.cancelQueries({queryKey:be.makeQueryKey("results")}),c(g,x=>D3(y)?{...x,widget_data:x.widget_data?.filter(v=>v.url!==y.url)}:x)}}),{mutate:m}=Rt({mutationFn:async g=>{try{const{error:y,response:x}=await de.DELETE("/rest/thread/delete_all_threads",e,{body:{delete_all:g==="all"},timeoutMs:0});if(y)throw new he("API_CLIENTS_ERROR",{cause:y,status:x.status??0})}catch(y){Z.error(y)}},onMutate:async g=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:Xt()});const y=t.getQueryData(r),x=t.getQueryData(Xt()),v=[];return g==="all"?(t.setQueryData(Xt(),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.map(S=>({...S,thread_count:0})));return{...b,pages:_}}),t.setQueryData(r,b=>({...b,pages:[]}))):g==="standalone"&&t.setQueryData(r,b=>({...b,pages:b.pages.map(_=>_.filter(w=>w.collection?.uuid?!0:(v.push(w.uuid),!1)))})),{previousThreads:y,previousCollections:x,deletedUUIDs:v}},onSettled:(g,y,x,v)=>{y?(t.setQueryData(r,v?.previousThreads),t.setQueryData(Xt(),v?.previousCollections)):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:Xt()}),t.invalidateQueries({queryKey:bd()}),t.invalidateQueries({queryKey:be.makeQueryKey(iy)}),x==="all"?(s(),i.getState().threads.forEach(b=>a(b.id))):x==="standalone"&&v?.deletedUUIDs.forEach(b=>{o(b),s(b)}))}}),{mutate:p}=Rt({mutationFn:async({entryUUID:g,callback:y})=>{y?.(),await p_e({entryUUID:g,rwToken:u,callback:y,reason:e})},onMutate:async({entryUUID:g,collectionSlug:y})=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:Xt()});const x=t.getQueryData(r),v=t.getQueryData(Xt());return t.setQueryData(r,b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.filter(S=>S.uuid!==g));return{...b,pages:_}}),y&&(t.setQueryData(Xt(),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.map(S=>S.slug===y?{...S,thread_count:S.thread_count-1}:S));return{...b,pages:_}}),t.setQueryData(bd({collection_slug:y}),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.filter(S=>S.uuid!==g));return{...b,pages:_}})),{previousThreads:x,previousCollections:v}},onSettled:(g,y,{entryUUID:x},v)=>{y?(t.setQueryData(r,v?.previousThreads),t.setQueryData(Xt(),v?.previousCollections)):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:Xt()}),t.invalidateQueries({queryKey:bd()}),t.invalidateQueries({queryKey:be.makeQueryKey(iy)}),o(x),s(x))}}),{mutate:h}=Rt({mutationFn:async({entryUUIDs:g,callback:y})=>{y?.(),await m_e({entryUUIDs:g,rwToken:u,reason:e})},onMutate:async({entryUUIDs:g})=>{await t.cancelQueries({queryKey:r});const y=t.getQueryData(r),x=t.getQueryData(Xt());return t.setQueryData(r,v=>{v=v||{pages:[],pageParams:[]};const b=v.pages.map(_=>_.filter(w=>!g.includes(w.uuid)));return{...v,pages:b}}),{previousThreads:y,previousCollections:x}},onSettled:(g,y,{entryUUIDs:x},v)=>{y?t.setQueryData(r,v?.previousThreads):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:be.makeQueryKey(iy)}),x.forEach(b=>{o(b),s(b)}))}});return d.useMemo(()=>({removeWidgetFromEntry:f,deleteAllThreads:m,deleteThread:p,deleteThreads:h}),[m,p,h,f])},B$=/\[([^\]]+)\]\(((?:\([^)]*\)|[^()])*)\)/g,lMe=e=>e?e.replace(B$,"$1"):"",cMe=e=>{if(!e)return{displayTitle:"",links:[]};const t=[];let n="",r=0,s=0,o;const a=new RegExp(B$);for(;(o=a.exec(e))!==null;){const i=o[1],c=o[2],u=o.index;if(n+=e.substring(r,u),s+=u-r,i){const f=s;n+=i,s+=i.length;const m=s;c&&t.push({url:c,startOffset:f,endOffset:m})}r=a.lastIndex}return n+=e.substring(r),{displayTitle:n,links:t}},U$=A.memo(function(){const t=un(),{inFlight:n}=on(),{$t:r}=J(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(async()=>{const i=t.getStore().getState().sidecarSourceTab.tabId;o("sidecar button clicked",{buttonType:"back_to_thread"}),await t.moveSidecarToThread(i)},[t,o]);return l.jsx(wt,{variant:"text",size:"small",disabled:n,icon:B("arrow-bar-to-left"),"aria-label":r({defaultMessage:"Back to thread",id:"C1eDCaAWRL",description:"Return sidecar query to the thread tab."}),onClick:a})});U$.displayName="BackToThreadButton";const uMe=5,dMe=()=>{const{device:{isMacOS:e}}=sn(),t=C3(o=>o.globalShortcuts[qn.NEW_THREAD]),n=e?Mn.MACOS:Mn.WINDOWS,r=d.useMemo(()=>t[n],[n,t]),s=d.useMemo(()=>r.map(o=>$we(o)),[r]);return d.useMemo(()=>s.join(e?"":"+"),[e,s])},V$=A.memo(function(){const{$t:t}=J(),{session:n}=Ne(),{trackEvent:r}=Xe(n),s=Rn(),o=dMe(),a=d.useCallback(()=>{r("sidecar button clicked",{buttonType:"new_thread"}),s.push("/")},[r,s]);return l.jsx(wt,{variant:"text",size:"small",icon:B("pencil-plus"),"aria-label":`${t({defaultMessage:"New thread",id:"ITYqY7w9pw"})} (${o})`,onClick:a})});V$.displayName="NewThreadButton";const H$=A.memo(function({ref:t,disableOpenInTab:n}){const{$t:r}=J(),{data:s,isLoading:o}=sMe({reason:"sidecar-controls-library"}),{session:a}=Ne(),{trackEvent:i}=Xe(a),{inFlight:c,results:u}=on(),{deleteThread:f}=lv({reason:"sidecar-controls-library"}),m=On(),p=Rn(),[h,g]=d.useState(()=>new Set),y=un(),x=Qn(),{variation:v}=oMe(!1),b=d.useMemo(()=>(s??[]).filter(E=>!h.has(E.uuid)).slice(0,uMe),[s,h]),_=d.useCallback(E=>{i("sidecar button clicked",{buttonType:"delete_thread"}),g(T=>new Set([...T,E.uuid])),f({entryUUID:E.uuid,callback:()=>{E.link===m&&p.push("/")}})},[f,m,p,i]),w=d.useCallback(async()=>{const E=x.sidecarSourceTab.tabId;v&&y.closeSideCar({tabId:E}).catch(()=>{}),y.openNewTab(location.href),i("sidecar button clicked",{buttonType:"open_in_tab"})},[y,i,v,x.sidecarSourceTab.tabId]),S=d.useCallback(()=>{i("sidecar library clicked",{type:"opened"}),i("sidecar button clicked",{buttonType:"library"})},[i]),C=d.useMemo(()=>s?.find(E=>!h.has(E.uuid)&&(E.link===m||u.some(T=>T.backend_uuid===E.uuid))),[s,h,m,u]);return l.jsxs(Dt,{triggerElement:l.jsx(wt,{variant:"text",size:"small",disabled:o||!s.length,icon:B("dots"),"aria-label":r({defaultMessage:"Menu",id:"/wFZYLAHuk",description:"Show Perplexity threads library."}),ref:t}),minWidthPx:240,maxWidthPx:240,maxHeightPx:400,align:"end",onOpen:S,children:[!n&&l.jsxs(l.Fragment,{children:[l.jsx(Dt.Item,{disabled:c,leadingAccessory:B("external-link"),onSelect:w,children:r({defaultMessage:"Open in new tab",id:"Kl9f3MwImT",description:"Open the Perplexity sidebar in a new tab."})}),C&&l.jsx(Dt.Item,{leadingAccessory:B("trash"),onSelect:()=>_(C),children:r({defaultMessage:"Delete thread",id:"2WxP2iMtPx"})}),l.jsx(Dt.Separator,{})]}),b.map(E=>{const T=u.some(k=>k.backend_uuid===E.uuid);return l.jsx(Dt.LinkItem,{href:E.link,className:"group/item",trailingAccessory:T?l.jsx(rn,{icon:B("check"),size:"small"}):void 0,onSelect:()=>{i("sidecar library clicked",{type:"selected"})},children:l.jsx("span",{className:"line-clamp-1",children:lMe(E.title)})},E.uuid)}),l.jsx(Dt.LinkItem,{href:"/library",className:"text-quiet",onSelect:()=>{i("sidecar library clicked",{type:"view_all"})},children:r({defaultMessage:"View all…",id:"yr9iXqRRXf"})})]})});H$.displayName="ShowLibraryButton";const z$=A.memo(function({disableNewThread:t,disableOpenInTab:n}){const r=d.useRef(null),[s,o]=d.useState(!1),a=Qn(),{variation:i}=aMe(!1),c=d.useMemo(()=>ro(a.sidecarSourceTab.tabId,a.sidecarSourceTab.secondaryTab?.tabId),[a.sidecarSourceTab.tabId,a.sidecarSourceTab.secondaryTab?.tabId]),u=a.sidecarAutoOpenedThreads[c]??!1,f=i&&u,m=d.useCallback(()=>{s&&r.current?.focus()},[s,r]);return d.useEffect(()=>{const p=g=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(g.key)&&o(!0)},h=()=>{o(!1)};return window.addEventListener("keydown",p),window.addEventListener("click",h),()=>{window.removeEventListener("keydown",p),window.removeEventListener("click",h)}},[]),l.jsx("div",{className:"relative z-20",children:l.jsxs(K,{variant:"background",className:"py-sm px-md h-headerHeight relative flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:f&&l.jsx(U$,{})}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{className:"size-0 appearance-none opacity-0",onFocus:m}),!t&&l.jsx(V$,{}),l.jsx(H$,{ref:r,disableOpenInTab:n})]})]})})});z$.displayName="SideCarNavBar";const fMe=({children:e,fixed:t=!1})=>{const[n,r]=d.useState(!1),{scrollContainerRef:s}=ka();return d.useLayoutEffect(()=>{const o=s?.current;if(!o)return;o.scrollTop>0&&r(!0)},[s]),d.useEffect(()=>{const o=s?.current;if(!o)return;const a=()=>{const u=o.scrollTop;r(u>0)},c=o===document.documentElement?window:o;return c.addEventListener("scroll",a,{passive:!0}),()=>c.removeEventListener("scroll",a)},[s]),l.jsxs(l.Fragment,{children:[e,l.jsx("div",{className:z("border-subtlest top-headerHeight pointer-events-none inset-x-0 z-[2] h-px border-b transition-opacity duration-200",t?"fixed":"absolute"),style:{opacity:n?1:0}})]})},Of=A.memo(({children:e,withoutHeader:t,disableNewThread:n,disableOpenInTab:r})=>(LW(),l.jsx(o3e,{children:l.jsxs(a3e,{children:[!t&&l.jsx(fMe,{children:l.jsx(z$,{disableNewThread:n,disableOpenInTab:r})}),l.jsx(Qx,{childrenWidth:"none",children:e})]})})));Of.displayName="Layout";const sh=d.createContext({});function mg(e){const t=d.useRef(null);return t.current===null&&(t.current=e()),t.current}const kT=typeof window<"u",cv=kT?d.useLayoutEffect:d.useEffect,uv=d.createContext(null);function MT(e,t){e.indexOf(t)===-1&&e.push(t)}function pg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Gi=(e,t,n)=>n>t?t:n{};const $i={},W$=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function G$(e){return typeof e=="object"&&e!==null}const $$=e=>/^0[^.\s]+$/u.test(e);function AT(e){let t;return()=>(t===void 0&&(t=e()),t)}const To=e=>e,mMe=(e,t)=>n=>t(e(n)),hg=(...e)=>e.reduce(mMe),qd=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class NT{constructor(){this.subscriptions=[]}add(t){return MT(this.subscriptions,t),()=>pg(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;oe*1e3,$a=e=>e/1e3;function q$(e,t){return t?e*(1e3/t):0}const pMe=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},K$=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,hMe=1e-7,gMe=12;function yMe(e,t,n,r,s){let o,a,i=0;do a=t+(n-t)/2,o=K$(a,r,s)-e,o>0?n=a:t=a;while(Math.abs(o)>hMe&&++iyMe(o,0,1,e,n);return o=>o===0||o===1?o:K$(s(o),t,r)}const Y$=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Q$=e=>t=>1-e(1-t),X$=tl(.33,1.53,.69,.99),RT=Q$(X$),Z$=Y$(RT),J$=e=>(e*=2)<1?.5*RT(e):.5*(2-Math.pow(2,-10*(e-1))),DT=e=>1-Math.sin(Math.acos(e)),eq=Q$(DT),tq=Y$(DT),xMe=tl(.42,0,1,1),Kd=tl(0,0,.58,1),qa=tl(.42,0,.58,1),nq=e=>Array.isArray(e)&&typeof e[0]!="number";function rq(e,t){return nq(e)?e[pMe(0,e.length,t)]:e}const sq=e=>Array.isArray(e)&&typeof e[0]=="number",vMe={linear:To,easeIn:xMe,easeInOut:qa,easeOut:Kd,circIn:DT,circInOut:tq,circOut:eq,backIn:RT,backInOut:Z$,backOut:X$,anticipate:J$},bMe=e=>typeof e=="string",P9=e=>{if(sq(e)){TT(e.length===4);const[t,n,r,s]=e;return tl(t,n,r,s)}else if(bMe(e))return vMe[e];return e},V0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function _Me(e,t){let n=new Set,r=new Set,s=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function c(f){a.has(f)&&(u.schedule(f),e()),f(i)}const u={schedule:(f,m=!1,p=!1)=>{const g=p&&s?n:r;return m&&a.add(f),g.has(f)||g.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(i=f,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,o&&(o=!1,u.process(f))}};return u}const wMe=40;function oq(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=V0.reduce((_,w)=>(_[w]=_Me(o),_),{}),{setup:i,read:c,resolveKeyframes:u,preUpdate:f,update:m,preRender:p,render:h,postRender:g}=a,y=()=>{const _=$i.useManualTiming?s.timestamp:performance.now();n=!1,$i.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(_-s.timestamp,wMe),1)),s.timestamp=_,s.isProcessing=!0,i.process(s),c.process(s),u.process(s),f.process(s),m.process(s),p.process(s),h.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:V0.reduce((_,w)=>{const S=a[w];return _[w]=(C,E=!1,T=!1)=>(n||x(),S.schedule(C,E,T)),_},{}),cancel:_=>{for(let w=0;w(ly===void 0&&Os.set($r.isProcessing||$i.useManualTiming?$r.timestamp:performance.now()),ly),set:e=>{ly=e,queueMicrotask(CMe)}},aq=e=>t=>typeof t=="string"&&t.startsWith(e),jT=aq("--"),SMe=aq("var(--"),IT=e=>SMe(e)?EMe.test(e.split("/*")[0].trim()):!1,EMe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Lf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},oh={...Lf,transform:e=>Gi(0,1,e)},H0={...Lf,default:1},xp=e=>Math.round(e*1e5)/1e5,PT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kMe(e){return e==null}const MMe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,OT=(e,t)=>n=>!!(typeof n=="string"&&MMe.test(n)&&n.startsWith(e)||t&&!kMe(n)&&Object.prototype.hasOwnProperty.call(n,t)),iq=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,a,i]=r.match(PT);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(a),alpha:i!==void 0?parseFloat(i):1}},TMe=e=>Gi(0,255,e),W_={...Lf,transform:e=>Math.round(TMe(e))},Mc={test:OT("rgb","red"),parse:iq("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+W_.transform(e)+", "+W_.transform(t)+", "+W_.transform(n)+", "+xp(oh.transform(r))+")"};function AMe(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const j3={test:OT("#"),parse:AMe,transform:Mc.transform},gg=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),dl=gg("deg"),Ka=gg("%"),bt=gg("px"),NMe=gg("vh"),RMe=gg("vw"),O9={...Ka,parse:e=>Ka.parse(e)/100,transform:e=>Ka.transform(e*100)},ad={test:OT("hsl","hue"),parse:iq("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ka.transform(xp(t))+", "+Ka.transform(xp(n))+", "+xp(oh.transform(r))+")"},yr={test:e=>Mc.test(e)||j3.test(e)||ad.test(e),parse:e=>Mc.test(e)?Mc.parse(e):ad.test(e)?ad.parse(e):j3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Mc.transform(e):ad.transform(e),getAnimatableNone:e=>{const t=yr.parse(e);return t.alpha=0,yr.transform(t)}},DMe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jMe(e){return isNaN(e)&&typeof e=="string"&&(e.match(PT)?.length||0)+(e.match(DMe)?.length||0)>0}const lq="number",cq="color",IMe="var",PMe="var(",L9="${}",OMe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ah(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(OMe,c=>(yr.test(c)?(r.color.push(o),s.push(cq),n.push(yr.parse(c))):c.startsWith(PMe)?(r.var.push(o),s.push(IMe),n.push(c)):(r.number.push(o),s.push(lq),n.push(parseFloat(c))),++o,L9)).split(L9);return{values:n,split:i,indexes:r,types:s}}function uq(e){return ah(e).values}function dq(e){const{split:t,types:n}=ah(e),r=t.length;return s=>{let o="";for(let a=0;atypeof e=="number"?0:yr.test(e)?yr.getAnimatableNone(e):e;function FMe(e){const t=uq(e);return dq(e)(t.map(LMe))}const Ll={test:jMe,parse:uq,createTransformer:dq,getAnimatableNone:FMe};function G_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function BMe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,a=0;if(!t)s=o=a=n;else{const i=n<.5?n*(1+t):n+t-n*t,c=2*n-i;s=G_(c,i,e+1/3),o=G_(c,i,e),a=G_(c,i,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}function c2(e,t){return n=>n>0?t:e}const Yn=(e,t,n)=>e+(t-e)*n,$_=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},UMe=[j3,Mc,ad],VMe=e=>UMe.find(t=>t.test(e));function F9(e){const t=VMe(e);if(!t)return!1;let n=t.parse(e);return t===ad&&(n=BMe(n)),n}const B9=(e,t)=>{const n=F9(e),r=F9(t);if(!n||!r)return c2(e,t);const s={...n};return o=>(s.red=$_(n.red,r.red,o),s.green=$_(n.green,r.green,o),s.blue=$_(n.blue,r.blue,o),s.alpha=Yn(n.alpha,r.alpha,o),Mc.transform(s))},I3=new Set(["none","hidden"]);function HMe(e,t){return I3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zMe(e,t){return n=>Yn(e,t,n)}function LT(e){return typeof e=="number"?zMe:typeof e=="string"?IT(e)?c2:yr.test(e)?B9:$Me:Array.isArray(e)?fq:typeof e=="object"?yr.test(e)?B9:WMe:c2}function fq(e,t){const n=[...e],r=n.length,s=e.map((o,a)=>LT(o)(o,t[a]));return o=>{for(let a=0;a{for(const o in r)n[o]=r[o](s);return n}}function GMe(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Ll.createTransformer(t),r=ah(e),s=ah(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?I3.has(e)&&!s.values.length||I3.has(t)&&!r.values.length?HMe(e,t):hg(fq(GMe(r,s),s.values),n):c2(e,t)};function mq(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Yn(e,t,n):LT(e)(e,t)}const qMe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Pn.update(t,n),stop:()=>qi(t),now:()=>$r.isProcessing?$r.timestamp:Os.now()}},pq=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o=u2?1/0:t}function hq(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(FT(r),u2);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:$a(s)}}const KMe=5;function gq(e,t,n){const r=Math.max(t-KMe,0);return q$(n-e(r),t-r)}const ir={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},q_=.001;function YMe({duration:e=ir.duration,bounce:t=ir.bounce,velocity:n=ir.velocity,mass:r=ir.mass}){let s,o,a=1-t;a=Gi(ir.minDamping,ir.maxDamping,a),e=Gi(ir.minDuration,ir.maxDuration,$a(e)),a<1?(s=u=>{const f=u*a,m=f*e,p=f-n,h=P3(u,a),g=Math.exp(-m);return q_-p/h*g},o=u=>{const m=u*a*e,p=m*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-m),y=P3(Math.pow(u,2),a);return(-s(u)+q_>0?-1:1)*((p-h)*g)/y}):(s=u=>{const f=Math.exp(-u*e),m=(u-n)*e+1;return-q_+f*m},o=u=>{const f=Math.exp(-u*e),m=(n-u)*(e*e);return f*m});const i=5/e,c=XMe(s,o,i);if(e=da(e),isNaN(c))return{stiffness:ir.stiffness,damping:ir.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const QMe=12;function XMe(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function e4e(e){let t={velocity:ir.velocity,stiffness:ir.stiffness,damping:ir.damping,mass:ir.mass,isResolvedFromDuration:!1,...e};if(!U9(e,JMe)&&U9(e,ZMe))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Gi(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ir.mass,stiffness:s,damping:o}}else{const n=YMe(e);t={...t,...n,mass:ir.mass},t.isResolvedFromDuration=!0}return t}function ih(e=ir.visualDuration,t=ir.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],i={done:!1,value:o},{stiffness:c,damping:u,mass:f,duration:m,velocity:p,isResolvedFromDuration:h}=e4e({...n,velocity:-$a(n.velocity||0)}),g=p||0,y=u/(2*Math.sqrt(c*f)),x=a-o,v=$a(Math.sqrt(c/f)),b=Math.abs(x)<5;r||(r=b?ir.restSpeed.granular:ir.restSpeed.default),s||(s=b?ir.restDelta.granular:ir.restDelta.default);let _;if(y<1){const S=P3(v,y);_=C=>{const E=Math.exp(-y*v*C);return a-E*((g+y*v*x)/S*Math.sin(S*C)+x*Math.cos(S*C))}}else if(y===1)_=S=>a-Math.exp(-v*S)*(x+(g+v*x)*S);else{const S=v*Math.sqrt(y*y-1);_=C=>{const E=Math.exp(-y*v*C),T=Math.min(S*C,300);return a-E*((g+y*v*x)*Math.sinh(T)+S*x*Math.cosh(T))/S}}const w={calculatedDuration:h&&m||null,next:S=>{const C=_(S);if(h)i.done=S>=m;else{let E=S===0?g:0;y<1&&(E=S===0?da(g):gq(_,S,C));const T=Math.abs(E)<=r,k=Math.abs(a-C)<=s;i.done=T&&k}return i.value=i.done?a:C,i},toString:()=>{const S=Math.min(FT(w),u2),C=pq(E=>w.next(S*E).value,S,30);return S+"ms "+C},toTransition:()=>{}};return w}ih.applyToOptions=e=>{const t=hq(e,100,ih);return e.ease=t.ease,e.duration=da(t.duration),e.type="keyframes",e};function O3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:a,min:i,max:c,restDelta:u=.5,restSpeed:f}){const m=e[0],p={done:!1,value:m},h=T=>i!==void 0&&Tc,g=T=>i===void 0?c:c===void 0||Math.abs(i-T)-y*Math.exp(-T/r),_=T=>v+b(T),w=T=>{const k=b(T),I=_(T);p.done=Math.abs(k)<=u,p.value=p.done?v:I};let S,C;const E=T=>{h(p.value)&&(S=T,C=ih({keyframes:[p.value,g(p.value)],velocity:gq(_,T,p.value),damping:s,stiffness:o,restDelta:u,restSpeed:f}))};return E(0),{calculatedDuration:null,next:T=>{let k=!1;return!C&&S===void 0&&(k=!0,w(T),E(T)),S!==void 0&&T>=S?C.next(T-S):(!k&&w(T),p)}}}function t4e(e,t,n){const r=[],s=n||$i.mix||mq,o=e.length-1;for(let a=0;at[0];if(o===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const i=t4e(t,r,s),c=i.length,u=f=>{if(a&&f1)for(;mu(Gi(e[0],e[o-1],f)):u}function xq(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=qd(0,t,r);e.push(Yn(n,1,s))}}function vq(e){const t=[0];return xq(t,e.length-1),t}function n4e(e,t){return e.map(n=>n*t)}function r4e(e,t){return e.map(()=>t||qa).splice(0,e.length-1)}function vp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=nq(r)?r.map(P9):P9(r),o={done:!1,value:t[0]},a=n4e(n&&n.length===t.length?n:vq(t),e),i=yq(a,t,{ease:Array.isArray(s)?s:r4e(t,s)});return{calculatedDuration:e,next:c=>(o.value=i(c),o.done=c>=e,o)}}const s4e=e=>e!==null;function BT(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(s4e),i=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const o4e={decay:O3,inertia:O3,tween:vp,keyframes:vp,spring:ih};function bq(e){typeof e.type=="string"&&(e.type=o4e[e.type])}class UT{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const a4e=e=>e/100;class VT extends UT{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Os.now()&&this.tick(Os.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bq(t);const{type:n=vp,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:a=0}=t;let{keyframes:i}=t;const c=n||vp;c!==vp&&typeof i[0]!="number"&&(this.mixKeyframes=hg(a4e,mq(i[0],i[1])),i=[0,100]);const u=c({...t,keyframes:i});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...i].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=FT(u));const{calculatedDuration:f}=u;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:i,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:f,repeat:m,repeatType:p,repeatDelay:h,type:g,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let _=this.currentTime,w=r;if(m){const T=Math.min(this.currentTime,s)/i;let k=Math.floor(T),I=T%1;!I&&T>=1&&(I=1),I===1&&k--,k=Math.min(k,m+1),!!(k%2)&&(p==="reverse"?(I=1-I,h&&(I-=h/i)):p==="mirror"&&(w=a)),_=Gi(0,1,I)*i}const S=b?{done:!1,value:f[0]}:w.next(_);o&&(S.value=o(S.value));let{done:C}=S;!b&&c!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return E&&g!==O3&&(S.value=BT(f,this.options,x,this.speed)),y&&y(S.value),E&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return $a(this.calculatedDuration)}get time(){return $a(this.currentTime)}set time(t){t=da(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Os.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=$a(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=qMe,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Os.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function i4e(e){for(let t=1;te*180/Math.PI,L3=e=>{const t=Tc(Math.atan2(e[1],e[0]));return F3(t)},l4e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:L3,rotateZ:L3,skewX:e=>Tc(Math.atan(e[1])),skewY:e=>Tc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},F3=e=>(e=e%360,e<0&&(e+=360),e),V9=L3,H9=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),z9=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),c4e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:H9,scaleY:z9,scale:e=>(H9(e)+z9(e))/2,rotateX:e=>F3(Tc(Math.atan2(e[6],e[5]))),rotateY:e=>F3(Tc(Math.atan2(-e[2],e[0]))),rotateZ:V9,rotate:V9,skewX:e=>Tc(Math.atan(e[4])),skewY:e=>Tc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function B3(e){return e.includes("scale")?1:0}function U3(e,t){if(!e||e==="none")return B3(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=c4e,s=n;else{const i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=l4e,s=i}if(!s)return B3(t);const o=r[t],a=s[1].split(",").map(d4e);return typeof o=="function"?o(a):a[o]}const u4e=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return U3(n,t)};function d4e(e){return parseFloat(e.trim())}const Ff=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bf=new Set(Ff),W9=e=>e===Lf||e===bt,f4e=new Set(["x","y","z"]),m4e=Ff.filter(e=>!f4e.has(e));function p4e(e){const t=[];return m4e.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ic={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>U3(t,"x"),y:(e,{transform:t})=>U3(t,"y")};Ic.translateX=Ic.x;Ic.translateY=Ic.y;const Pc=new Set;let V3=!1,H3=!1,z3=!1;function _q(){if(H3){const e=Array.from(Pc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=p4e(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,a])=>{r.getValue(o)?.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}H3=!1,V3=!1,Pc.forEach(e=>e.complete(z3)),Pc.clear()}function wq(){Pc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(H3=!0)})}function h4e(){z3=!0,wq(),_q(),z3=!1}class HT{constructor(t,n,r,s,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Pc.add(this),V3||(V3=!0,Pn.read(wq),Pn.resolveKeyframes(_q))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s?.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const i=r.readValue(n,a);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}i4e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Pc.delete(this)}cancel(){this.state==="scheduled"&&(Pc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const g4e=e=>e.startsWith("--");function y4e(e,t,n){g4e(t)?e.style.setProperty(t,n):e.style[t]=n}const x4e=AT(()=>window.ScrollTimeline!==void 0),v4e={};function b4e(e,t){const n=AT(e);return()=>v4e[t]??n()}const Cq=b4e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ep=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,G9={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ep([0,.65,.55,1]),circOut:ep([.55,0,1,.45]),backIn:ep([.31,.01,.66,-.59]),backOut:ep([.33,1.53,.69,.99])};function Sq(e,t){if(e)return typeof e=="function"?Cq()?pq(e,t):"ease-out":sq(e)?ep(e):Array.isArray(e)?e.map(n=>Sq(n,t)||G9.easeOut):G9[e]}function _4e(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:i="easeOut",times:c}={},u=void 0){const f={[t]:n};c&&(f.offset=c);const m=Sq(i,s);Array.isArray(m)&&(f.easing=m);const p={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return u&&(p.pseudoElement=u),e.animate(f,p)}function zT(e){return typeof e=="function"&&"applyToOptions"in e}function w4e({type:e,...t}){return zT(e)&&Cq()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class C4e extends UT{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:i,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=t,TT(typeof t.type!="string");const u=w4e(t);this.animation=_4e(n,r,s,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const f=BT(s,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(f):y4e(n,r,f),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return $a(Number(t))}get time(){return $a(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=da(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&x4e()?(this.animation.timeline=t,To):n(this)}}const Eq={anticipate:J$,backInOut:Z$,circInOut:tq};function S4e(e){return e in Eq}function E4e(e){typeof e.ease=="string"&&S4e(e.ease)&&(e.ease=Eq[e.ease])}const $9=10;class k4e extends C4e{constructor(t){E4e(t),bq(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const i=new VT({...a,autoplay:!1}),c=da(this.finishedTime??this.time);n.setWithVelocity(i.sample(c-$9).value,i.sample(c).value,$9),i.stop()}}const q9=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ll.test(e)||e==="0")&&!e.startsWith("url("));function M4e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function R4e(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return N4e()&&n&&A4e.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}const D4e=40;class j4e extends UT{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",keyframes:i,name:c,motionValue:u,element:f,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Os.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:a,name:c,motionValue:u,element:f,...m},h=f?.KeyframeResolver||HT;this.keyframeResolver=new h(i,(g,y,x)=>this.onKeyframesResolved(g,y,p,!x),c,u,f),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:i,delay:c,isHandoff:u,onUpdate:f}=r;this.resolvedAt=Os.now(),T4e(t,o,a,i)||(($i.instantAnimations||!c)&&f?.(BT(t,r,n)),t[0]=t[t.length-1],W3(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>D4e?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!u&&R4e(p)?new k4e({...p,element:p.motionValue.owner.current}):new VT(p);h.finished.then(()=>this.notifyFinished()).catch(To),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),h4e()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class I4e{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;rr.attachTimeline(t));return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class P4e extends I4e{then(t,n){return this.finished.finally(t).then(()=>{})}}const O4e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function L4e(e){const t=O4e.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function kq(e,t,n=1){const[r,s]=L4e(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return W$(a)?parseFloat(a):a}return IT(s)?kq(s,t,n+1):s}function WT(e,t){return e?.[t]??e?.default??e}const Mq=new Set(["width","height","top","left","right","bottom",...Ff]),F4e={test:e=>e==="auto",parse:e=>e},Tq=e=>t=>t.test(e),Aq=[Lf,bt,Ka,dl,RMe,NMe,F4e],K9=e=>Aq.find(Tq(e));function B4e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$$(e):!0}const U4e=new Set(["brightness","contrast","saturate","opacity"]);function V4e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(PT)||[];if(!r)return e;const s=n.replace(r,"");let o=U4e.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const H4e=/\b([a-z-]*)\(.*?\)/gu,G3={...Ll,getAnimatableNone:e=>{const t=e.match(H4e);return t?t.map(V4e).join(" "):e}},Y9={...Lf,transform:Math.round},z4e={rotate:dl,rotateX:dl,rotateY:dl,rotateZ:dl,scale:H0,scaleX:H0,scaleY:H0,scaleZ:H0,skew:dl,skewX:dl,skewY:dl,distance:bt,translateX:bt,translateY:bt,translateZ:bt,x:bt,y:bt,z:bt,perspective:bt,transformPerspective:bt,opacity:oh,originX:O9,originY:O9,originZ:bt},GT={borderWidth:bt,borderTopWidth:bt,borderRightWidth:bt,borderBottomWidth:bt,borderLeftWidth:bt,borderRadius:bt,radius:bt,borderTopLeftRadius:bt,borderTopRightRadius:bt,borderBottomRightRadius:bt,borderBottomLeftRadius:bt,width:bt,maxWidth:bt,height:bt,maxHeight:bt,top:bt,right:bt,bottom:bt,left:bt,padding:bt,paddingTop:bt,paddingRight:bt,paddingBottom:bt,paddingLeft:bt,margin:bt,marginTop:bt,marginRight:bt,marginBottom:bt,marginLeft:bt,backgroundPositionX:bt,backgroundPositionY:bt,...z4e,zIndex:Y9,fillOpacity:oh,strokeOpacity:oh,numOctaves:Y9},W4e={...GT,color:yr,backgroundColor:yr,outlineColor:yr,fill:yr,stroke:yr,borderColor:yr,borderTopColor:yr,borderRightColor:yr,borderBottomColor:yr,borderLeftColor:yr,filter:G3,WebkitFilter:G3},Nq=e=>W4e[e];function Rq(e,t){let n=Nq(e);return n!==G3&&(n=Ll),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const G4e=new Set(["auto","none","0"]);function $4e(e,t,n){let r=0,s;for(;r{t.getValue(i).set(c)}),this.resolveNoneKeyframes()}}function Dq(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const jq=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Iq(e){return G$(e)&&"offsetHeight"in e}const Q9=30,K4e=e=>!isNaN(parseFloat(e)),bp={current:void 0};class Y4e{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=Os.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Os.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=K4e(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new NT);const r=this.events[t].add(n);return t==="change"?()=>{r(),Pn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return bp.current&&bp.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Os.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Q9)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Q9);return q$(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qc(e,t){return new Y4e(e,t)}const{schedule:$T}=oq(queueMicrotask,!1),ea={x:!1,y:!1};function Pq(){return ea.x||ea.y}function Q4e(e){return e==="x"||e==="y"?ea[e]?null:(ea[e]=!0,()=>{ea[e]=!1}):ea.x||ea.y?null:(ea.x=ea.y=!0,()=>{ea.x=ea.y=!1})}function Oq(e,t){const n=Dq(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function X9(e){return!(e.pointerType==="touch"||Pq())}function X4e(e,t,n={}){const[r,s,o]=Oq(e,n),a=i=>{if(!X9(i))return;const{target:c}=i,u=t(c,i);if(typeof u!="function"||!c)return;const f=m=>{X9(m)&&(u(m),c.removeEventListener("pointerleave",f))};c.addEventListener("pointerleave",f,s)};return r.forEach(i=>{i.addEventListener("pointerenter",a,s)}),o}const Lq=(e,t)=>t?e===t?!0:Lq(e,t.parentElement):!1,qT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Z4e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function J4e(e){return Z4e.has(e.tagName)||e.tabIndex!==-1}const cy=new WeakSet;function Z9(e){return t=>{t.key==="Enter"&&e(t)}}function K_(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const eTe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Z9(()=>{if(cy.has(n))return;K_(n,"down");const s=Z9(()=>{K_(n,"up")}),o=()=>K_(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function J9(e){return qT(e)&&!Pq()}function tTe(e,t,n={}){const[r,s,o]=Oq(e,n),a=i=>{const c=i.currentTarget;if(!J9(i))return;cy.add(c);const u=t(c,i),f=(h,g)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",p),cy.has(c)&&cy.delete(c),J9(h)&&typeof u=="function"&&u(h,{success:g})},m=h=>{f(h,c===window||c===document||n.useGlobalTarget||Lq(c,h.target))},p=h=>{f(h,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",p,s)};return r.forEach(i=>{(n.useGlobalTarget?window:i).addEventListener("pointerdown",a,s),Iq(i)&&(i.addEventListener("focus",u=>eTe(u,s)),!J4e(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),o}function KT(e){return G$(e)&&"ownerSVGElement"in e}function Fq(e){return KT(e)&&e.tagName==="svg"}function nTe(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],o=e[2+n],a=e[3+n],i=yq(s,o,a);return t?i(r):i}const Lr=e=>!!(e&&e.getVelocity),rTe=[...Aq,yr,Ll],sTe=e=>rTe.find(Tq(e)),dv=d.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class oTe extends d.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Iq(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function aTe({children:e,isPresent:t,anchorX:n,root:r}){const s=d.useId(),o=d.useRef(null),a=d.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=d.useContext(dv);return d.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:m,right:p}=a.current;if(t||!o.current||!c||!u)return;const h=n==="left"?`left: ${m}`:`right: ${p}`;o.current.dataset.motionPopId=s;const g=document.createElement("style");i&&(g.nonce=i);const y=r??document.head;return y.appendChild(g),g.sheet&&g.sheet.insertRule(` - [data-motion-pop-id="${s}"] { - position: absolute !important; - width: ${c}px !important; - height: ${u}px !important; - ${h}px !important; - top: ${f}px !important; - } - `),()=>{y.contains(g)&&y.removeChild(g)}},[t]),l.jsx(oTe,{isPresent:t,childRef:o,sizeRef:a,children:d.cloneElement(e,{ref:o})})}const iTe=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:a,anchorX:i,root:c})=>{const u=mg(lTe),f=d.useId();let m=!0,p=d.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:h=>{u.set(h,!0);for(const g of u.values())if(!g)return;r&&r()},register:h=>(u.set(h,!1),()=>u.delete(h))}),[n,u,r]);return o&&m&&(p={...p}),d.useMemo(()=>{u.forEach((h,g)=>u.set(g,!1))},[n]),d.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(aTe,{isPresent:n,anchorX:i,root:c,children:e})),l.jsx(uv.Provider,{value:p,children:e})};function lTe(){return new Map}function Bq(e=!0){const t=d.useContext(uv);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=d.useId();d.useEffect(()=>{if(e)return s(o)},[e]);const a=d.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,a]:[!0]}const z0=e=>e.key||"";function eD(e){const t=[];return d.Children.forEach(e,n=>{d.isValidElement(n)&&t.push(n)}),t}const St=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:a=!1,anchorX:i="left",root:c})=>{const[u,f]=Bq(a),m=d.useMemo(()=>eD(e),[e]),p=a&&!u?[]:m.map(z0),h=d.useRef(!0),g=d.useRef(m),y=mg(()=>new Map),[x,v]=d.useState(m),[b,_]=d.useState(m);cv(()=>{h.current=!1,g.current=m;for(let C=0;C{const E=z0(C),T=a&&!u?!1:m===b||p.includes(E),k=()=>{if(y.has(E))y.set(E,!0);else return;let I=!0;y.forEach(M=>{M||(I=!1)}),I&&(S?.(),_(g.current),a&&f?.(),r&&r())};return l.jsx(iTe,{isPresent:T,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:T?void 0:k,anchorX:i,children:C},E)})})},cTe=d.createContext(null);function uTe(){const e=d.useRef(!1);return cv(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function dTe(){const e=uTe(),[t,n]=d.useState(0),r=d.useCallback(()=>{e.current&&n(t+1)},[t]);return[d.useCallback(()=>Pn.postRender(r),[r]),t]}const fTe=e=>!e.isLayoutDirty&&e.willUpdate(!1);function tD(){const e=new Set,t=new WeakMap,n=()=>e.forEach(fTe);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const s=t.get(r);s&&(s(),t.delete(r)),n()},dirty:n}}const Uq=e=>e===!0,mTe=e=>Uq(e===!0)||e==="id",yg=({children:e,id:t,inherit:n=!0})=>{const r=d.useContext(sh),s=d.useContext(cTe),[o,a]=dTe(),i=d.useRef(null),c=r.id||s;i.current===null&&(mTe(n)&&c&&(t=t?c+"-"+t:c),i.current={id:t,group:Uq(n)&&r.group||tD()});const u=d.useMemo(()=>({...i.current,forceRender:o}),[a]);return l.jsx(sh.Provider,{value:u,children:e})},Vq=d.createContext({strict:!1}),nD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Yd={};for(const e in nD)Yd[e]={isEnabled:t=>nD[e].some(n=>!!t[n])};function pTe(e){for(const t in e)Yd[t]={...Yd[t],...e[t]}}const hTe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function d2(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hTe.has(e)}let Hq=e=>!d2(e);function gTe(e){typeof e=="function"&&(Hq=t=>t.startsWith("on")?!d2(t):e(t))}try{gTe(require("@emotion/is-prop-valid").default)}catch{}function yTe(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Hq(s)||n===!0&&d2(s)||!t&&!d2(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const fv=d.createContext({});function mv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function lh(e){return typeof e=="string"||Array.isArray(e)}const YT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],QT=["initial",...YT];function pv(e){return mv(e.animate)||QT.some(t=>lh(e[t]))}function zq(e){return!!(pv(e)||e.variants)}function xTe(e,t){if(pv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||lh(n)?n:void 0,animate:lh(r)?r:void 0}}return e.inherit!==!1?t:{}}function vTe(e){const{initial:t,animate:n}=xTe(e,d.useContext(fv));return d.useMemo(()=>({initial:t,animate:n}),[rD(t),rD(n)])}function rD(e){return Array.isArray(e)?e.join(" "):e}const ch={};function bTe(e){for(const t in e)ch[t]=e[t],jT(t)&&(ch[t].isCSSVariable=!0)}function Wq(e,{layout:t,layoutId:n}){return Bf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ch[e]||e==="opacity")}const _Te={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wTe=Ff.length;function CTe(e,t,n){let r="",s=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}});function Gq(e,t,n){for(const r in t)!Lr(t[r])&&!Wq(r,n)&&(e[r]=t[r])}function STe({transformTemplate:e},t){return d.useMemo(()=>{const n=ZT();return XT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ETe(e,t){const n=e.style||{},r={};return Gq(r,n,e),Object.assign(r,STe(e,t)),r}function kTe(e,t){const n={},r=ETe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const MTe={offset:"stroke-dashoffset",array:"stroke-dasharray"},TTe={offset:"strokeDashoffset",array:"strokeDasharray"};function ATe(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?MTe:TTe;e[o.offset]=bt.transform(-r);const a=bt.transform(t),i=bt.transform(n);e[o.array]=`${a} ${i}`}function $q(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...i},c,u,f){if(XT(e,i,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:p}=e;m.transform&&(p.transform=m.transform,delete m.transform),(p.transform||m.transformOrigin)&&(p.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),p.transform&&(p.transformBox=f?.transformBox??"fill-box",delete m.transformBox),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&ATe(m,s,o,a,!1)}const qq=()=>({...ZT(),attrs:{}}),Kq=e=>typeof e=="string"&&e.toLowerCase()==="svg";function NTe(e,t,n,r){const s=d.useMemo(()=>{const o=qq();return $q(o,t,Kq(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Gq(o,e.style,e),s.style={...o,...s.style}}return s}const RTe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function JT(e){return typeof e!="string"||e.includes("-")?!1:!!(RTe.indexOf(e)>-1||/[A-Z]/u.test(e))}function DTe(e,t,n,{latestValues:r},s,o=!1){const i=(JT(e)?NTe:kTe)(t,r,s,e),c=yTe(t,typeof e=="string",o),u=e!==d.Fragment?{...c,...i,ref:n}:{},{children:f}=t,m=d.useMemo(()=>Lr(f)?f.get():f,[f]);return d.createElement(e,{...u,children:m})}function sD(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function eA(e,t,n,r){if(typeof t=="function"){const[s,o]=sD(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=sD(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function uy(e){return Lr(e)?e.get():e}function jTe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:ITe(n,r,s,e),renderState:t()}}function ITe(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=uy(o[p]);let{initial:a,animate:i}=e;const c=pv(e),u=zq(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),i===void 0&&(i=t.animate));let f=n?n.initial===!1:!1;f=f||a===!1;const m=f?i:a;if(m&&typeof m!="boolean"&&!mv(m)){const p=Array.isArray(m)?m:[m];for(let h=0;h(t,n)=>{const r=d.useContext(fv),s=d.useContext(uv),o=()=>jTe(e,t,r,s);return n?o():mg(o)};function tA(e,t,n){const{style:r}=e,s={};for(const o in r)(Lr(r[o])||t.style&&Lr(t.style[o])||Wq(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(s[o]=r[o]);return s}const PTe=Yq({scrapeMotionValuesFromProps:tA,createRenderState:ZT});function Qq(e,t,n){const r=tA(e,t,n);for(const s in e)if(Lr(e[s])||Lr(t[s])){const o=Ff.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const OTe=Yq({scrapeMotionValuesFromProps:Qq,createRenderState:qq}),LTe=Symbol.for("motionComponentSymbol");function id(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function FTe(e,t,n){return d.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):id(n)&&(n.current=r))},[t])}const nA=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),BTe="framerAppearId",Xq="data-"+nA(BTe),Zq=d.createContext({});function UTe(e,t,n,r,s){const{visualElement:o}=d.useContext(fv),a=d.useContext(Vq),i=d.useContext(uv),c=d.useContext(dv).reducedMotion,u=d.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:i,blockInitialAnimation:i?i.initial===!1:!1,reducedMotionConfig:c}));const f=u.current,m=d.useContext(Zq);f&&!f.projection&&s&&(f.type==="html"||f.type==="svg")&&VTe(u.current,n,s,m);const p=d.useRef(!1);d.useInsertionEffect(()=>{f&&p.current&&f.update(n,i)});const h=n[Xq],g=d.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return cv(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),d.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),f.enteringChildren=void 0)}),f}function VTe(e,t,n,r){const{layoutId:s,layout:o,drag:a,dragConstraints:i,layoutScroll:c,layoutRoot:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jq(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!a||i&&id(i),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u})}function Jq(e){if(e)return e.options.allowProjection!==!1?e.projection:Jq(e.parent)}function Y_(e,{forwardMotionProps:t=!1}={},n,r){n&&pTe(n);const s=JT(e)?OTe:PTe;function o(i,c){let u;const f={...d.useContext(dv),...i,layoutId:HTe(i)},{isStatic:m}=f,p=vTe(i),h=s(i,m);if(!m&&kT){zTe();const g=WTe(f);u=g.MeasureLayout,p.visualElement=UTe(e,h,f,r,g.ProjectionNode)}return l.jsxs(fv.Provider,{value:p,children:[u&&p.visualElement?l.jsx(u,{visualElement:p.visualElement,...f}):null,DTe(e,i,FTe(h,p.visualElement,c),h,m,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=d.forwardRef(o);return a[LTe]=e,a}function HTe({layoutId:e}){const t=d.useContext(sh).id;return t&&e!==void 0?t+"-"+e:e}function zTe(e,t){d.useContext(Vq).strict}function WTe(e){const{drag:t,layout:n}=Yd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function GTe(e,t){if(typeof Proxy>"u")return Y_;const n=new Map,r=(o,a)=>Y_(o,a,e,t),s=(o,a)=>r(o,a);return new Proxy(s,{get:(o,a)=>a==="create"?r:(n.has(a)||n.set(a,Y_(a,void 0,e,t)),n.get(a))})}function eK({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $Te({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qTe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Q_(e){return e===void 0||e===1}function $3({scale:e,scaleX:t,scaleY:n}){return!Q_(e)||!Q_(t)||!Q_(n)}function xc(e){return $3(e)||tK(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tK(e){return oD(e.x)||oD(e.y)}function oD(e){return e&&e!=="0%"}function f2(e,t,n){const r=e-n,s=t*r;return n+s}function aD(e,t,n,r,s){return s!==void 0&&(e=f2(e,s,r)),f2(e,n,r)+t}function q3(e,t=0,n=1,r,s){e.min=aD(e.min,t,n,r,s),e.max=aD(e.max,t,n,r,s)}function nK(e,{x:t,y:n}){q3(e.x,t.translate,t.scale,t.originPoint),q3(e.y,n.translate,n.scale,n.originPoint)}const iD=.999999999999,lD=1.0000000000001;function KTe(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,a;for(let i=0;iiD&&(t.x=1),t.yiD&&(t.y=1)}function ld(e,t){e.min=e.min+t,e.max=e.max+t}function cD(e,t,n,r,s=.5){const o=Yn(e.min,e.max,s);q3(e,t,n,o,r)}function cd(e,t){cD(e.x,t.x,t.scaleX,t.scale,t.originX),cD(e.y,t.y,t.scaleY,t.scale,t.originY)}function rK(e,t){return eK(qTe(e.getBoundingClientRect(),t))}function YTe(e,t,n){const r=rK(e,n),{scroll:s}=t;return s&&(ld(r.x,s.offset.x),ld(r.y,s.offset.y)),r}const uD=()=>({translate:0,scale:1,origin:0,originPoint:0}),ud=()=>({x:uD(),y:uD()}),dD=()=>({min:0,max:0}),or=()=>({x:dD(),y:dD()}),m2={current:null},rA={current:!1};function sK(){if(rA.current=!0,!!kT)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>m2.current=e.matches;e.addEventListener("change",t),t()}else m2.current=!1}const uh=new WeakMap;function QTe(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Lr(s))e.addValue(r,s);else if(Lr(o))e.addValue(r,Qc(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Qc(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const fD=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class oK{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=HT,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Os.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),rA.current||sK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:m2.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Bf.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Pn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Yd){const n=Yd[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):or()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Qc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(W$(r)||$$(r))?r=parseFloat(r):!sTe(r)&&Ll.test(n)&&(r=Rq(t,n)),this.setBaseTarget(t,Lr(r)?r.get():r)),Lr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=eA(this.props,n,this.presenceContext?.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Lr(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new NT),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){$T.render(this.render)}}class aK extends oK{constructor(){super(...arguments),this.KeyframeResolver=q4e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Lr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function iK(e,{style:t,vars:n},r,s){const o=e.style;let a;for(a in t)o[a]=t[a];s?.applyProjectionStyles(o,r);for(a in n)o.setProperty(a,n[a])}function XTe(e){return window.getComputedStyle(e)}class lK extends aK{constructor(){super(...arguments),this.type="html",this.renderInstance=iK}readValueFromInstance(t,n){if(Bf.has(n))return this.projection?.isProjecting?B3(n):u4e(t,n);{const r=XTe(t),s=(jT(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rK(t,n)}build(t,n,r){XT(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return tA(t,n,r)}}const cK=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ZTe(e,t,n,r){iK(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(cK.has(s)?s:nA(s),t.attrs[s])}class uK extends aK{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=or}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Bf.has(n)){const r=Nq(n);return r&&r.default||0}return n=cK.has(n)?n:nA(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Qq(t,n,r)}build(t,n,r){$q(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){ZTe(t,n,r,s)}mount(t){this.isSVGTag=Kq(t.tagName),super.mount(t)}}const JTe=(e,t)=>JT(e)?new uK(t):new lK(t,{allowProjection:e!==d.Fragment});function Sd(e,t,n){const r=e.getProps();return eA(r,t,n!==void 0?n:r.custom,e)}const K3=e=>Array.isArray(e);function eAe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qc(n))}function tAe(e){return K3(e)?e[e.length-1]||0:e}function nAe(e,t){const n=Sd(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const a in o){const i=tAe(o[a]);eAe(e,a,i)}}function rAe(e){return!!(Lr(e)&&e.add)}function Y3(e,t){const n=e.getValue("willChange");if(rAe(n))return n.add(t);if(!n&&$i.WillChange){const r=new $i.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function dK(e){return e.props[Xq]}const sAe=e=>e!==null;function oAe(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(sAe),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const aAe={type:"spring",stiffness:500,damping:25,restSpeed:10},iAe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lAe={type:"keyframes",duration:.8},cAe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uAe=(e,{keyframes:t})=>t.length>2?lAe:Bf.has(e)?e.startsWith("scale")?iAe(t[1]):aAe:cAe;function dAe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:a,repeatDelay:i,from:c,elapsed:u,...f}){return!!Object.keys(f).length}const sA=(e,t,n,r={},s,o)=>a=>{const i=WT(r,e)||{},c=i.delay||r.delay||0;let{elapsed:u=0}=r;u=u-da(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{a(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:o?void 0:s};dAe(i)||Object.assign(f,uAe(e,f)),f.duration&&(f.duration=da(f.duration)),f.repeatDelay&&(f.repeatDelay=da(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let m=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(W3(f),f.delay===0&&(m=!0)),($i.instantAnimations||$i.skipAnimations)&&(m=!0,W3(f),f.delay=0),f.allowFlatten=!i.type&&!i.ease,m&&!o&&t.get()!==void 0){const p=oAe(f.keyframes,i);if(p!==void 0){Pn.update(()=>{f.onUpdate(p),f.onComplete()});return}}return i.isSync?new VT(f):new j4e(f)};function fAe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oA(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...i}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in i){const m=e.getValue(f,e.latestValues[f]??null),p=i[f];if(p===void 0||u&&fAe(u,f))continue;const h={delay:n,...WT(o||{},f)},g=m.get();if(g!==void 0&&!m.isAnimating&&!Array.isArray(p)&&p===g&&!h.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const v=dK(e);if(v){const b=window.MotionHandoffAnimation(v,f,Pn);b!==null&&(h.startTime=b,y=!0)}}Y3(e,f),m.start(sA(f,m,p,e.shouldReduceMotion&&Mq.has(f)?{type:!1}:h,e,y));const x=m.animation;x&&c.push(x)}return a&&Promise.all(c).then(()=>{Pn.update(()=>{a&&nAe(e,a)})}),c}function fK(e,t,n,r=0,s=1){const o=Array.from(e).sort((u,f)=>u.sortNodePosition(f)).indexOf(t),a=e.size,i=(a-1)*r;return typeof n=="function"?n(o,a):s===1?o*r:i-o*r}function Q3(e,t,n={}){const r=Sd(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(oA(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=s;return mAe(e,t,c,u,f,m,n)}:()=>Promise.resolve(),{when:i}=s;if(i){const[c,u]=i==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function mAe(e,t,n=0,r=0,s=0,o=1,a){const i=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),i.push(Q3(c,t,{...a,delay:n+(typeof r=="function"?0:r)+fK(e.variantChildren,c,r,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(i)}function pAe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Q3(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Q3(e,t,n);else{const s=typeof t=="function"?Sd(e,t,n.custom):t;r=Promise.all(oA(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function mK(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:n,options:r})=>pAe(e,n,r)))}function vAe(e){let t=xAe(e),n=mD(),r=!0;const s=c=>(u,f)=>{const m=Sd(e,f,c==="exit"?e.presenceContext?.custom:void 0);if(m){const{transition:p,transitionEnd:h,...g}=m;u={...u,...g,...h}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=pK(e.parent)||{},m=[],p=new Set;let h={},g=1/0;for(let x=0;xg&&w,k=!1;const I=Array.isArray(_)?_:[_];let M=I.reduce(s(v),{});S===!1&&(M={});const{prevResolvedValues:N={}}=b,D={...N,...M},j=P=>{T=!0,p.has(P)&&(k=!0,p.delete(P)),b.needsAnimating[P]=!0;const L=e.getValue(P);L&&(L.liveStyle=!1)};for(const P in D){const L=M[P],U=N[P];if(h.hasOwnProperty(P))continue;let O=!1;K3(L)&&K3(U)?O=!mK(L,U):O=L!==U,O?L!=null?j(P):p.add(P):L!==void 0&&p.has(P)?j(P):b.protectedKeys[P]=!0}b.prevProp=_,b.prevResolvedValues=M,b.isActive&&(h={...h,...M}),r&&e.blockInitialAnimation&&(T=!1);const F=C&&E;T&&(!F||k)&&m.push(...I.map(P=>{const L={type:v};if(typeof P=="string"&&r&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,O=Sd(U,P);if(U.enteringChildren&&O){const{delayChildren:$}=O.transition||{};L.delay=fK(U.enteringChildren,e,$)}}return{animation:P,options:L}}))}if(p.size){const x={};if(typeof u.initial!="boolean"){const v=Sd(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(x.transition=v.transition)}p.forEach(v=>{const b=e.getBaseTarget(v),_=e.getValue(v);_&&(_.liveStyle=!0),x[v]=b??null}),m.push({animation:x})}let y=!!m.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(m):Promise.resolve()}function i(c,u){if(n[c].isActive===u)return Promise.resolve();e.variantChildren?.forEach(m=>m.animationState?.setActive(c,u)),n[c].isActive=u;const f=a(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:i,setAnimateFunction:o,getState:()=>n,reset:()=>{n=mD(),r=!0}}}function bAe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!mK(t,e):!1}function fc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mD(){return{animate:fc(!0),whileInView:fc(),whileHover:fc(),whileTap:fc(),whileDrag:fc(),whileFocus:fc(),exit:fc()}}class tc{constructor(t){this.isMounted=!1,this.node=t}update(){}}class _Ae extends tc{constructor(t){super(t),t.animationState||(t.animationState=vAe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();mv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let wAe=0;class CAe extends tc{constructor(){super(...arguments),this.id=wAe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const SAe={animation:{Feature:_Ae},exit:{Feature:CAe}};function dh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function xg(e){return{point:{x:e.pageX,y:e.pageY}}}const EAe=e=>t=>qT(t)&&e(t,xg(t));function _p(e,t,n,r){return dh(e,t,EAe(n),r)}const hK=1e-4,kAe=1-hK,MAe=1+hK,gK=.01,TAe=0-gK,AAe=0+gK;function bs(e){return e.max-e.min}function NAe(e,t,n){return Math.abs(e-t)<=n}function pD(e,t,n,r=.5){e.origin=r,e.originPoint=Yn(t.min,t.max,e.origin),e.scale=bs(n)/bs(t),e.translate=Yn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kAe&&e.scale<=MAe||isNaN(e.scale))&&(e.scale=1),(e.translate>=TAe&&e.translate<=AAe||isNaN(e.translate))&&(e.translate=0)}function wp(e,t,n,r){pD(e.x,t.x,n.x,r?r.originX:void 0),pD(e.y,t.y,n.y,r?r.originY:void 0)}function hD(e,t,n){e.min=n.min+t.min,e.max=e.min+bs(t)}function RAe(e,t,n){hD(e.x,t.x,n.x),hD(e.y,t.y,n.y)}function gD(e,t,n){e.min=t.min-n.min,e.max=e.min+bs(t)}function Cp(e,t,n){gD(e.x,t.x,n.x),gD(e.y,t.y,n.y)}function xo(e){return[e("x"),e("y")]}const yK=({current:e})=>e?e.ownerDocument.defaultView:null,yD=(e,t)=>Math.abs(e-t);function DAe(e,t){const n=yD(e.x,t.x),r=yD(e.y,t.y);return Math.sqrt(n**2+r**2)}class xK{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Z_(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=DAe(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:y}=p,{timestamp:x}=$r;this.history.push({...y,timestamp:x});const{onStart:v,onMove:b}=this.handlers;h||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=X_(h,this.transformPagePoint),Pn.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Z_(p.type==="pointercancel"?this.lastMoveEventInfo:X_(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),y&&y(p,v)},!qT(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const i=xg(t),c=X_(i,this.transformPagePoint),{point:u}=c,{timestamp:f}=$r;this.history=[{...u,timestamp:f}];const{onSessionStart:m}=n;m&&m(t,Z_(c,this.history)),this.removeListeners=hg(_p(this.contextWindow,"pointermove",this.handlePointerMove),_p(this.contextWindow,"pointerup",this.handlePointerUp),_p(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function X_(e,t){return t?{point:t(e.point)}:e}function xD(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Z_({point:e},t){return{point:e,delta:xD(e,vK(t)),offset:xD(e,jAe(t)),velocity:IAe(t,.1)}}function jAe(e){return e[0]}function vK(e){return e[e.length-1]}function IAe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=vK(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>da(t)));)n--;if(!r)return{x:0,y:0};const o=$a(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function PAe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Yn(n,e,r.max):Math.min(e,n)),e}function vD(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function OAe(e,{top:t,left:n,bottom:r,right:s}){return{x:vD(e.x,n,s),y:vD(e.y,t,r)}}function bD(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=qd(t.min,t.max-r,e.min):r>s&&(n=qd(e.min,e.max-s,t.min)),Gi(0,1,n)}function BAe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const X3=.35;function UAe(e=X3){return e===!1?e=0:e===!0&&(e=X3),{x:_D(e,"left","right"),y:_D(e,"top","bottom")}}function _D(e,t,n){return{min:wD(e,t),max:wD(e,n)}}function wD(e,t){return typeof e=="number"?e:e[t]||0}const VAe=new WeakMap;class HAe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=or(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=m=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(xg(m).point)},a=(m,p)=>{const{drag:h,dragPropagation:g,onDragStart:y}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Q4e(h),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xo(v=>{let b=this.getAxisMotionValue(v).get()||0;if(Ka.test(b)){const{projection:_}=this.visualElement;if(_&&_.layout){const w=_.layout.layoutBox[v];w&&(b=bs(w)*(parseFloat(b)/100))}}this.originPoint[v]=b}),y&&Pn.postRender(()=>y(m,p)),Y3(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},i=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:y,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=p;if(g&&this.currentDirection===null){this.currentDirection=zAe(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),x&&x(m,p)},c=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p,this.stop(m,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>xo(m=>this.getAnimationState(m)==="paused"&&this.getAxisMotionValue(m).animation?.play()),{dragSnapToOrigin:f}=this.getProps();this.panSession=new xK(t,{onSessionStart:o,onStart:a,onMove:i,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:yK(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&Pn.postRender(()=>i(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!W0(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=PAe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&id(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=OAe(r.layoutBox,t):this.constraints=!1,this.elastic=UAe(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&xo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=BAe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!id(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=YTe(r,s.root,this.visualElement.getTransformPagePoint());let a=LAe(s.layout.layoutBox,o);if(n){const i=n($Te(a));this.hasMutatedConstraints=!!i,i&&(a=eK(i))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),c=this.constraints||{},u=xo(f=>{if(!W0(f,n,this.currentDirection))return;let m=c&&c[f]||{};a&&(m={min:0,max:0});const p=s?200:1e6,h=s?40:1e7,g={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(f,g)});return Promise.all(u).then(i)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Y3(this.visualElement,t),r.start(sA(t,r,0,n,this.visualElement,!1))}stopAnimation(){xo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xo(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){xo(n=>{const{drag:r}=this.getProps();if(!W0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:i}=s.layout.layoutBox[n];o.set(t[n]-Yn(a,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!id(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};xo(a=>{const i=this.getAxisMotionValue(a);if(i&&this.constraints!==!1){const c=i.get();s[a]=FAe({min:c,max:c},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),xo(a=>{if(!W0(a,t,null))return;const i=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];i.set(Yn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;VAe.set(this.visualElement,this);const t=this.visualElement.current,n=_p(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();id(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Pn.read(r);const a=dh(window,"resize",()=>this.scalePositionWithinConstraints()),i=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(xo(f=>{const m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=c[f].translate,m.set(m.get()+c[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:a=X3,dragMomentum:i=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function W0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zAe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class WAe extends tc{constructor(t){super(t),this.removeGroupControls=To,this.removeListeners=To,this.controls=new HAe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||To}unmount(){this.removeGroupControls(),this.removeListeners()}}const CD=e=>(t,n)=>{e&&Pn.postRender(()=>e(t,n))};class GAe extends tc{constructor(){super(...arguments),this.removePointerDownListener=To}onPointerDown(t){this.session=new xK(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yK(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:CD(t),onStart:CD(n),onMove:r,onEnd:(o,a)=>{delete this.session,s&&Pn.postRender(()=>s(o,a))}}}mount(){this.removePointerDownListener=_p(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const dy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function SD(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Em={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(bt.test(e))e=parseFloat(e);else return e;const n=SD(e,t.target.x),r=SD(e,t.target.y);return`${n}% ${r}%`}},$Ae={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ll.parse(e);if(s.length>5)return r;const o=Ll.createTransformer(e),a=typeof s[0]!="number"?1:0,i=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=i,s[1+a]/=c;const u=Yn(i,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),o(s)}};let J_=!1;class qAe extends d.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;bTe(KAe),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),J_&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),dy.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:a}=r;return a&&(a.isPresent=o,J_=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Pn.postRender(()=>{const i=a.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$T.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;J_=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bK(e){const[t,n]=Bq(),r=d.useContext(sh);return l.jsx(qAe,{...e,layoutGroup:r,switchLayoutGroup:d.useContext(Zq),isPresent:t,safeToRemove:n})}const KAe={borderRadius:{...Em,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Em,borderTopRightRadius:Em,borderBottomLeftRadius:Em,borderBottomRightRadius:Em,boxShadow:$Ae};function _K(e,t,n){const r=Lr(e)?e:Qc(e);return r.start(sA("",r,t,n)),r.animation}const YAe=(e,t)=>e.depth-t.depth;class QAe{constructor(){this.children=[],this.isDirty=!1}add(t){MT(this.children,t),this.isDirty=!0}remove(t){pg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(YAe),this.isDirty=!1,this.children.forEach(t)}}function XAe(e,t){const n=Os.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(qi(r),e(o-t))};return Pn.setup(r,!0),()=>qi(r)}const wK=["TopLeft","TopRight","BottomLeft","BottomRight"],ZAe=wK.length,ED=e=>typeof e=="string"?parseFloat(e):e,kD=e=>typeof e=="number"||bt.test(e);function JAe(e,t,n,r,s,o){s?(e.opacity=Yn(0,n.opacity??1,e6e(r)),e.opacityExit=Yn(t.opacity??1,0,t6e(r))):o&&(e.opacity=Yn(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(qd(e,t,r))}function TD(e,t){e.min=t.min,e.max=t.max}function yo(e,t){TD(e.x,t.x),TD(e.y,t.y)}function AD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ND(e,t,n,r,s){return e-=t,e=f2(e,1/n,r),s!==void 0&&(e=f2(e,1/s,r)),e}function n6e(e,t=0,n=1,r=.5,s,o=e,a=e){if(Ka.test(t)&&(t=parseFloat(t),t=Yn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let i=Yn(o.min,o.max,r);e===o&&(i-=t),e.min=ND(e.min,t,n,i,s),e.max=ND(e.max,t,n,i,s)}function RD(e,t,[n,r,s],o,a){n6e(e,t[n],t[r],t[s],t.scale,o,a)}const r6e=["x","scaleX","originX"],s6e=["y","scaleY","originY"];function DD(e,t,n,r){RD(e.x,t,r6e,n?n.x:void 0,r?r.x:void 0),RD(e.y,t,s6e,n?n.y:void 0,r?r.y:void 0)}function jD(e){return e.translate===0&&e.scale===1}function SK(e){return jD(e.x)&&jD(e.y)}function ID(e,t){return e.min===t.min&&e.max===t.max}function o6e(e,t){return ID(e.x,t.x)&&ID(e.y,t.y)}function PD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function EK(e,t){return PD(e.x,t.x)&&PD(e.y,t.y)}function OD(e){return bs(e.x)/bs(e.y)}function LD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class a6e{constructor(){this.members=[]}add(t){MT(this.members,t),t.scheduleRender()}remove(t){if(pg(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function i6e(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,a=n?.z||0;if((s||o||a)&&(r=`translate3d(${s}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:f,rotateX:m,rotateY:p,skewX:h,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),f&&(r+=`rotate(${f}deg) `),m&&(r+=`rotateX(${m}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const i=e.x.scale*t.x,c=e.y.scale*t.y;return(i!==1||c!==1)&&(r+=`scale(${i}, ${c})`),r||"none"}const ew=["","X","Y","Z"],l6e=1e3;let c6e=0;function tw(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function kK(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dK(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Pn,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&kK(r)}function MK({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},i=t?.()){this.id=c6e++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(f6e),this.nodes.forEach(g6e),this.nodes.forEach(y6e),this.nodes.forEach(m6e)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;Pn.read(()=>{m=window.innerWidth}),e(a,()=>{const h=window.innerWidth;h!==m&&(m=h,this.root.updateBlockedByResize=!0,f&&f(),f=XAe(p,250),dy.hasAnimatedSinceResize&&(dy.hasAnimatedSinceResize=!1,this.nodes.forEach(UD)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&u&&(i||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||w6e,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!EK(this.targetLayout,h),b=!m&&p;if(this.options.layoutRoot||this.resumeFrom||b||m&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...WT(g,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(f,b)}else m||UD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(x6e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&kK(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!bs(this.snapshot.measuredBox.x)&&!bs(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=w/1e3;VD(m.x,a.x,S),VD(m.y,a.y,S),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cp(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b6e(this.relativeTarget,this.relativeTargetOrigin,p,S),_&&o6e(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=or()),yo(_,this.relativeTarget)),y&&(this.animationValues=f,JAe(f,u,this.latestValues,S,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pn.update(()=>{dy.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Qc(0)),this.currentAnimation=_K(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:i=>{this.mixTargetDelta(i),a.onUpdate&&a.onUpdate(i)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(l6e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:i,target:c,layout:u,latestValues:f}=a;if(!(!i||!c||!u)){if(this!==a&&this.layout&&u&&TK(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||or();const m=bs(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+m;const p=bs(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}yo(i,c),cd(i,f),wp(this.projectionDeltaWithTransform,this.layoutCorrected,i,f)}}registerSharedNode(a,i){this.sharedNodes.has(a)||this.sharedNodes.set(a,new a6e),this.sharedNodes.get(a).add(i);const u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:i,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let i=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(i=!0),!i)return;const u={};c.z&&tw("z",a,u,this.animationValues);for(let f=0;fa.currentAnimation?.stop()),this.root.nodes.forEach(FD),this.root.sharedNodes.clear()}}}function u6e(e){e.updateLayout()}function d6e(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?xo(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],p=bs(m);m.min=n[f].min,m.max=m.min+p}):TK(s,t.layoutBox,n)&&xo(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],p=bs(n[f]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=ud();wp(a,n,t.layoutBox);const i=ud();o?wp(i,e.applyTransform(r,!0),t.measuredBox):wp(i,n,t.layoutBox);const c=!SK(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:p}=f;if(m&&p){const h=or();Cp(h,t.layoutBox,m.layoutBox);const g=or();Cp(g,n,p.layoutBox),EK(h,g)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:i,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function f6e(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function m6e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function p6e(e){e.clearSnapshot()}function FD(e){e.clearMeasurements()}function BD(e){e.isLayoutDirty=!1}function h6e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function UD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function g6e(e){e.resolveTargetDelta()}function y6e(e){e.calcProjection()}function x6e(e){e.resetSkewAndRotation()}function v6e(e){e.removeLeadSnapshot()}function VD(e,t,n){e.translate=Yn(t.translate,0,n),e.scale=Yn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function HD(e,t,n,r){e.min=Yn(t.min,n.min,r),e.max=Yn(t.max,n.max,r)}function b6e(e,t,n,r){HD(e.x,t.x,n.x,r),HD(e.y,t.y,n.y,r)}function _6e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const w6e={duration:.45,ease:[.4,0,.1,1]},zD=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),WD=zD("applewebkit/")&&!zD("chrome/")?Math.round:To;function GD(e){e.min=WD(e.min),e.max=WD(e.max)}function C6e(e){GD(e.x),GD(e.y)}function TK(e,t,n){return e==="position"||e==="preserve-aspect"&&!NAe(OD(t),OD(n),.2)}function S6e(e){return e!==e.root&&e.scroll?.wasRoot}const E6e=MK({attachResizeListener:(e,t)=>dh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),nw={current:void 0},AK=MK({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nw.current){const e=new E6e({});e.mount(window),e.setOptions({layoutScroll:!0}),nw.current=e}return nw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),k6e={pan:{Feature:GAe},drag:{Feature:WAe,ProjectionNode:AK,MeasureLayout:bK}};function $D(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Pn.postRender(()=>o(t,xg(t)))}class M6e extends tc{mount(){const{current:t}=this.node;t&&(this.unmount=X4e(t,(n,r)=>($D(this.node,r,"Start"),s=>$D(this.node,s,"End"))))}unmount(){}}class T6e extends tc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=hg(dh(this.node.current,"focus",()=>this.onFocus()),dh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qD(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Pn.postRender(()=>o(t,xg(t)))}class A6e extends tc{mount(){const{current:t}=this.node;t&&(this.unmount=tTe(t,(n,r)=>(qD(this.node,r,"Start"),(s,{success:o})=>qD(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Z3=new WeakMap,rw=new WeakMap,N6e=e=>{const t=Z3.get(e.target);t&&t(e)},R6e=e=>{e.forEach(N6e)};function D6e({root:e,...t}){const n=e||document;rw.has(n)||rw.set(n,{});const r=rw.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(R6e,{root:e,...t})),r[s]}function j6e(e,t,n){const r=D6e(t);return Z3.set(e,n),r.observe(e),()=>{Z3.delete(e),r.unobserve(e)}}const I6e={some:0,all:1};class P6e extends tc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:I6e[s]},i=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),p=u?f:m;p&&p(c)};return j6e(this.node.current,a,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(O6e(t,n))&&this.startObserver()}unmount(){}}function O6e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const L6e={inView:{Feature:P6e},tap:{Feature:A6e},focus:{Feature:T6e},hover:{Feature:M6e}},F6e={layout:{ProjectionNode:AK,MeasureLayout:bK}},B6e={...SAe,...L6e,...k6e,...F6e},Te=GTe(B6e,JTe);function aA(e){const t=mg(()=>Qc(e)),{isStatic:n}=d.useContext(dv);if(n){const[,r]=d.useState(e);d.useEffect(()=>t.on("change",r),[])}return t}function NK(e,t){const n=aA(t()),r=()=>n.set(t());return r(),cv(()=>{const s=()=>Pn.preRender(r,!1,!0),o=e.map(a=>a.on("change",s));return()=>{o.forEach(a=>a()),qi(r)}}),n}function U6e(e){bp.current=[],e();const t=NK(bp.current,e);return bp.current=void 0,t}function tp(e,t,n,r){if(typeof e=="function")return U6e(e);const s=typeof t=="function"?t:nTe(t,n,r);return Array.isArray(e)?KD(e,s):KD([e],([o])=>s(o))}function KD(e,t){const n=mg(()=>[]);return NK(e,()=>{n.length=0;const r=e.length;for(let s=0;st&&s.at{const k=K6e(w),{delay:I=0,times:M=vq(k),type:N="keyframes",repeat:D,repeatType:j,repeatDelay:F=0,...R}=S;let{ease:P=t.ease||"easeOut",duration:L}=S;const U=typeof I=="function"?I(E,T):I,O=k.length,$=zT(N)?N:s?.[N||"keyframes"];if(O<=2&&$){let Y=100;if(O===2&&X6e(k)){const ae=k[1]-k[0];Y=Math.abs(ae)}const te={...R};L!==void 0&&(te.duration=da(L));const se=hq(te,Y,$);P=se.ease,L=se.duration}L??(L=o);const G=m+U;M.length===1&&M[0]===0&&(M[1]=1);const H=M.length-k.length;if(H>0&&xq(M,H),k.length===1&&k.unshift(null),D){L=V6e(L,D);const Y=[...k],te=[...M];P=Array.isArray(P)?[...P]:[P];const se=[...P];for(let ae=0;ae{for(const y in h){const x=h[y];x.sort(G6e);const v=[],b=[],_=[];for(let S=0;Stypeof e=="number",X6e=e=>e.every(Q6e);function Z6e(e,t){return e in t}class J6e extends oK{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Z6e(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return or()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function eNe(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=KT(e)&&!Fq(e)?new uK(t):new lK(t);n.mount(e),uh.set(e,n)}function tNe(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new J6e(t);n.mount(e),uh.set(e,n)}function nNe(e,t){return Lr(e)||typeof e=="number"||typeof e=="string"&&!lA(t)}function DK(e,t,n,r){const s=[];if(nNe(e,t))s.push(_K(e,lA(t)&&t.default||t,n&&(n.default||n)));else{const o=RK(e,t,r),a=o.length;for(let i=0;i{r.push(...DK(i,o,a))}),r}function sNe(e){return Array.isArray(e)&&e.some(Array.isArray)}function oNe(e){function t(n,r,s){let o=[];sNe(n)?o=rNe(n,r,e):o=DK(n,r,s,e);const a=new P4e(o);return e&&(e.animations.push(a),a.finished.then(()=>{pg(e.animations,a)})),a}return t}const aNe=oNe();function jK(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const iNe=({children:e,className:t,delimiter:n="·",...r})=>{const s=A.Children.toArray(e),o=s.map((a,i)=>{if(A.isValidElement(a)&&a.type===IK){const c=a.props.id;return l.jsxs(A.Fragment,{children:[a,i!==s.length-1&&l.jsxs(V,{className:"inline-flex !text-inherit",children:[" ",n," "]})]},c)}return null});return l.jsx("div",{className:`gap-sm flex items-center ${t}`,...r,children:o})},IK=({children:e})=>l.jsx(l.Fragment,{children:e}),ga=iNe,Bn=IK,PK=A.memo(({onClick:e,testId:t="close-button",size:n="small",variant:r="common",className:s="right-sm top-sm absolute",ariaLabel:o="Close"})=>l.jsx("div",{className:s,children:l.jsx(st,{testId:t,variant:r,pill:!0,size:n,onClick:e,icon:B("x"),ariaLabel:o})}));PK.displayName="CloseButton";const cA=A.memo(e=>{const{children:t,trigger:n,...r}=e;return l.jsxs(wT,{...r,children:[n&&l.jsx(P$,{asChild:!0,children:n}),l.jsx(St,{children:r.open&&l.jsx(CT,{forceMount:!0,children:t})})]})});cA.displayName="ControlledDialog";function lNe(e){const[t,n]=d.useState(!1),[r,s]=d.useState(!1),o=d.useMemo(()=>e?.isEnabled??!0,[e?.isEnabled]),a=d.useMemo(()=>o&&!t&&!r,[o,t,r]);return d.useMemo(()=>({canShow:a,handleConfirm(){n(!1),s(!0),e?.onConfirm()},handleCancel(){n(!1),s(!1)},isShowing:t,show(){n(!0)}}),[a,t,e])}const OK=Ft("ConfirmCloseModalContext",{canShow:!1,handleCancel(){},handleConfirm(){},isShowing:!1,show(){}}),LK=A.memo(function(t){const{children:n,trigger:r,value:s}=t;return l.jsx(OK.Provider,{value:s,children:l.jsx(cA,{onOpenChange:s.handleCancel,open:s.isShowing,trigger:r,children:n})})});LK.displayName="ConfirmCloseModalDialog";function lbt(){const e=d.useContext(OK);if(!e)throw new Error("useConfirmCloseModalContext() used outside of provider.");return e}const cNe=250,uA=A.memo(({animationClassName:e,children:t,isOpen:n=!1,transparent:r=!1,canOutsideClickClose:s=!0,onBeforeClose:o,onClose:a,onIsClosing:i,childVariant:c="default",center:u=!0,shouldClose:f=!1,disableAnimation:m=!1,testId:p,removeScroll:h=!0,shards:g=[],delayClose:y=!0,variant:x="default",portalTarget:v,includeBlur:b=!0,forceColorScheme:_})=>{const w=d.useRef(null),S=d.useRef(null),C=d.useRef(null),[E,T]=d.useState(!1),k=d.useRef(!1),I=d.useCallback(P=>{E||o?.()===!1||(y?(T(!0),i?.(),setTimeout(()=>{a?.(P),T(!1)},cNe)):(T(!0),a?.(P),T(!1)))},[E,o,y,i,a]);d.useEffect(()=>{f&&!E&&I("closed")},[f,E,I]);const M=d.useCallback(P=>{r&&!s?P.stopPropagation():P.target===w.current&&I("backdrop")},[r,s,I]),N=d.useCallback(P=>{const L=P.target;if(L instanceof Element){if(S.current===L||S.current?.contains(L))return;const U=L.closest('[data-type="portal"]');if(U&&U!==C.current&&!r)return}T(!1),I("clickaway")},[I,r]);d.useEffect(()=>{if(n&&r&&s)return document.addEventListener("click",N),()=>{document.removeEventListener("click",N)}},[n,r,N,s]);const D=d.useCallback(P=>{P.key==="Escape"&&I("escape")},[I]);d.useEffect(()=>(n&&document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}),[n,D]);const j=d.useMemo(()=>z("duration-200 fill-mode-both",{"animate-in fade-in zoom-in-[0.98] ease-in":["default","large","small","hide-chrome","full-sheet"].includes(c),"zoom-out-[0.98] fade-out animate-out ease-out":["default","hide-chrome","full-sheet","large","small"].includes(c)&&E,"fixed bottom-0 left-0":c==="bottom-left-sheet","fixed top-0 right-0 left-0":c==="side-sheet","fixed bottom-0 left-0 right-0":c==="bottom-sheet"},e),[e,c,E]),F=z("items-stretch md:items-center",{"fill-mode-both fixed inset-0":!r,"bg-backdrop/70":x==="default"||x==="default-less-blur","bg-lightbox/95":x==="lightbox","animate-in fade-in ease-outExpo duration-200":!E&&!m,"animate-out fade-out ease-inExpo duration-200":E&&!m},{"backdrop-blur-md":b&&x==="lightbox","backdrop-blur-sm":b&&x==="default","backdrop-blur-[0.5px]":b&&x==="default-less-blur"}),R=d.useMemo(()=>n?l.jsxs(lg,{removeScrollBar:!1,enabled:h,allowPinchZoom:!0,shards:g,children:[l.jsx("div",{className:F}),l.jsx("div",{ref:w,onPointerDown:P=>{k.current=P.target===w.current},onPointerUp:P=>{k.current&&M(P),k.current=!1},className:z({"fixed inset-0 overflow-y-auto":!r,"flex items-center justify-center":u}),"data-test-id":p,children:l.jsx("div",{ref:S,className:j,children:t})})]}):null,[n,t,r,u,p,M,j,S,w,h,g,F]);return l.jsx(Xl,{portalTarget:v,children:l.jsx("div",{ref:C,"data-type":"portal","data-color-scheme":_,children:R})})});uA.displayName="Overlay";const po=A.memo(({title:e,subtitle:t,subtitleClassname:n,centerTitle:r,children:s,actionList:o=Pe,variant:a="default",onClose:i,noPadding:c=!1,onIsClosing:u,titleContent:f,footerContent:m,icon:p,overlayVariant:h,titleLeadingButtonProps:g,confirmOnClose:y,titleTextVariant:x="page-title",headerClassname:v,closeButtonClassname:b="right-0 top-sm absolute",footerClassname:_,renderCloseButton:w=!0,fixedTitle:S,modalClassname:C,modalContentClassname:E,modalElementProps:T,includeBlur:k=!0,isOpen:I,ref:M,wrapperClassname:N,forceColorScheme:D,...j})=>{const F=d.useRef(null),R=d.useRef(null),P=d.useRef(null),L=d.useRef(null),[U,O]=d.useState(!1),[$,G]=d.useState(!1),[H,Q]=d.useState(!1);d.useEffect(()=>{I&&!H?Q(!0):!I&&H&&!U&&O(!0)},[I,H,U]);const Y=d.useMemo(()=>!!y,[y]),te=lNe({isEnabled:Y,onConfirm(){G(!0),O(!0)}}),se=d.useMemo(()=>z(C,"bg-base shadow-md overflow-y-auto scrollbar-subtle fill-mode-both",{"md:rounded-xl md:min-w-[600px] max-w-screen-sm shadow-md dark:border dark:border-subtlest relative h-full max-h-[100vh] md:max-h-[95vh] overflow-auto md:w-full":a==="default","min-h-0 max-h-[70vh] rounded-t-xl bottom-0 left-0 right-0 flex flex-col":a==="bottom-left-sheet","w-screen md:h-screen h-[100dvh] flex flex-col":a==="full-sheet","w-screen min-h-[60dvh] md:min-h-[60vh] shadow-overlay max-h-[96dvh] md:max-h-[96vh] flex flex-col fixed bottom-0 left-0 right-0":a==="bottom-sheet","h-screen w-[40vw] min-w-[500px] shadow-overlay top-0 right-0 fixed flex flex-col":a==="side-sheet","animate-in slide-in-from-right ease-outExpo":a==="side-sheet"&&!$,"animate-out slide-out-to-right ease-inExpo":a==="side-sheet"&&$,"animate-in slide-in-from-bottom ease-in":["bottom-left-sheet","bottom-sheet"].includes(a)&&!$,"animate-out slide-out-to-bottom ease-out":["bottom-left-sheet","bottom-sheet"].includes(a)&&$,"max-h-[100vh] w-[90vw] rounded-l-xl flex flex-col":a==="wide","h-[95vh] w-[95vw] rounded-xl flex flex-col":a==="full","md:rounded-lg md:min-w-[600px] max-w-screen-lg shadow-md relative overflow-auto max-h-[100vh]":a==="large","md:rounded-lg md:min-w-[500px] max-w-screen-lg shadow-md relative overflow-auto max-h-[100vh]":a==="medium","md:rounded-lg md:max-w-[440px] shadow-md relative overflow-auto max-h-[100vh]":a==="small","md:rounded-lg md:max-w-[350px] shadow-md relative overflow-auto max-h-[100vh]":a==="thin"}),[a,$,C]),ae=d.useMemo(()=>a==="bottom-left-sheet"||a==="bottom-sheet",[a]),X=d.useMemo(()=>z("grow flex flex-col justify-center shrink-0",{"md:pt-md":e===void 0&&!f,"md:pb-lg":o?.length===0,"p-sm":!c&&!ae,"p-0":c,"pb-lg":ae},E),[o?.length,c,e,E,f,ae]),ee=d.useMemo(()=>o.map((ye,_e)=>d.createElement(FK,{...ye,idx:_e,key:_e,confirmCloseModal:te})),[o,te]);d.useImperativeHandle(M,()=>({scrollContainerRef:F,headerRef:R,contentRef:P,footerRef:L}),[F,R,L]);const le=d.useCallback(()=>{u?.(),G(!0)},[u]),re=d.useCallback(ye=>{G(!1),O(!1),Q(!1),i?.(ye)},[i]),ce=d.useCallback(()=>{if(te?.canShow){te.show();return}O(!0)},[te]),ue=d.useCallback(()=>te?.canShow?(te.show(),!1):!0,[te]),{canOutsideClickClose:me}=d.useContext(cz),we=d.useMemo(()=>l.jsxs(l.Fragment,{children:[l.jsx("div",{children:a==="hide-chrome"?l.jsx("div",{children:s}):l.jsxs(Te.div,{animate:{scale:te.isShowing?.955:1},className:se,transition:{duration:.2,ease:tl(.16,1,.3,1)},ref:F,...T,children:[l.jsx("div",{className:"right-sm top-sm fixed z-[23] md:absolute"}),l.jsxs(K,{className:z(N,"px-md pb-md flex min-h-0 w-screen grow flex-col md:w-[unset] md:grow-[unset]",{"h-full":!S,"h-auto !grow":S}),children:[l.jsxs(K,{variant:"background",className:z(v,"pt-md sticky top-0 z-[22] w-full shrink-0",{"text-center":r,"h-10":!e&&!f}),ref:R,children:[l.jsxs("div",{className:"p-sm flex items-center gap-1.5",children:[g&&l.jsx(st,{extraCSS:"-ml-sm",...g,size:"small",variant:"common"}),p?l.jsx(ge,{icon:p,className:"text-foreground -ml-xs shrink-0",size:"xl"}):null,e&&l.jsx(V,{variant:x,className:z("text-pretty",{"line-clamp-1 leading-none":p,"line-clamp-3":!p,"pt-lg grow":r,"mr-lg":!r}),children:e}),!e&&f,w&&l.jsx(PK,{onClick:ce,testId:"close-modal",className:b})]}),t&&l.jsx(V,{variant:"base",color:"light",className:z("mt-xs p-sm line-clamp-3 text-pretty",n),children:t})]}),s&&l.jsx("div",{className:X,ref:P,children:s}),(ee?.length>0||m)&&l.jsxs(K,{variant:"background",className:z("gap-x-sm p-sm pt-lg bottom-0 z-10 flex items-center",{"justify-end":!m},{"justify-between":m},{sticky:!0},_),ref:L,children:[m&&l.jsx("div",{className:"flex-1",children:m}),ee]})]})]})}),Y&&l.jsx(LK,{value:te,children:y})]}),[ee,r,s,b,te,y,X,S,_,m,ce,v,p,Y,se,T,w,t,n,e,f,g,x,a,N]);return l.jsx(uA,{forceColorScheme:D,includeBlur:k,childVariant:a,shouldClose:U,onBeforeClose:ue,onIsClosing:le,onClose:re,variant:h,isOpen:H,canOutsideClickClose:me,...j,children:we})});po.displayName="Modal";const FK=A.memo(({idx:e,text:t,onClick:n,variant:r,disabled:s,isLoading:o,testId:a,icon:i,shouldShowConfirmDialog:c,buttonClassname:u,tooltipText:f,confirmCloseModal:m})=>{const p=d.useCallback(y=>{if(y.stopPropagation(),r&&c&&m.canShow){m.show();return}n?.()},[m,n,c,r]),h={key:e,text:t,disabled:s,isLoading:o,testId:a,chevronIcon:i,extraCSS:u},g=d.createElement(Ge,{fullWidthMobile:!0,variant:r||void 0,...h,onClick:p,key:h.key});return f?l.jsx(Io,{tooltipText:f,tooltipLayout:"top",children:g}):g});FK.displayName="ButtonFactory";const cbt=Object.freeze(Object.defineProperty({__proto__:null,default:po},Symbol.toStringTag,{value:"Module"})),uNe=1080,ZD=1e4;function kr(e){return typeof e=="string"?ty(e).startsWith("image/"):e.type.startsWith("image/")}const BK=(e,t=32)=>`https://www.google.com/s2/favicons?sz=${t}&domain=${e}`,dNe=(e,t,n)=>{const r=Math.min(e,t);let s=e,o=t;if(r>n){const i=n/r;s=Math.round(e*i),o=Math.round(t*i)}const a=Math.max(s,o);if(a>ZD){const i=ZD/a;s=Math.max(1,Math.round(s*i)),o=Math.max(1,Math.round(o*i))}return{width:s,height:o}},fNe=(e,t=uNe,n=.98)=>new Promise((r,s)=>{if(!kr(e)){s(new Error("File is not an image."));return}const o=document.createElement("canvas"),a=o.getContext("2d",{alpha:!0,colorSpace:"srgb"}),i=new Image,c=URL.createObjectURL(e);if(!a){s(new Error("Could not get canvas context"));return}a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",i.onload=()=>{const u=dNe(i.width,i.height,t);o.width=u.width,o.height=u.height;const f="image/jpeg",m=n;a.fillStyle="#fff",a.fillRect(0,0,o.width,o.height),a.drawImage(i,0,0,u.width,u.height),o.toBlob(p=>{if(!p){s(new Error("Failed to create blob from canvas"));return}const g=e.name.replace(/\.[^/.]+$/,"")+".jpg",y=new File([p],g,{type:f});URL.revokeObjectURL(c),r(y)},f,m)},i.onerror=()=>{URL.revokeObjectURL(c),s(new Error("Failed to load image."))},i.src=c}),mNe={"my.apps.factset.com":"www.factset.com"},Po=A.memo(({domain:e,overrideIconUrl:t,size:n=16,hideBorder:r=!1,className:s,...o})=>{const a=mNe[e]||e,i=BK(a,128),c=d.useMemo(()=>t||i,[t,i]),[u,f]=d.useState(!0);d.useEffect(()=>{f(!0)},[c]);const m=d.useMemo(()=>({width:n,height:n}),[n]),p=d.useMemo(()=>({width:n*.7,height:n*.7}),[n]);return l.jsxs("div",{style:{width:n,height:n},className:z("relative shrink-0 overflow-hidden rounded-full",s),...o,children:[u?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:z("rounded-inherit absolute inset-0",!r&&"bg-white")}),l.jsx("img",{className:"relative block",src:c,alt:`${e} favicon`,width:n,height:n,onLoad:h=>{const g=h.target,y=t!==void 0||g.naturalWidth!==16||g.naturalHeight!==16;f(y||e!==a)},onError:()=>{f(!1)},style:{width:n,height:n}})]}):l.jsx(K,{variant:"subtle",style:m,className:"inline-flex items-center justify-center",children:l.jsx(ge,{icon:B("world"),className:"text-quietest relative block",style:p})}),!r&&l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-[black]/10 dark:border-transparent"})]})});Po.displayName="CitationFavicon";function pNe(e,t,n=2){if(e==null)return"";const r=e.includes(".")?e.slice(e.lastIndexOf(".")):"",s=e.substring(0,e.length-r.length);return s.length>t?s.substring(0,t-r.length-3)+".".repeat(n)+r:s+r}const mu=e=>{try{return(new URL(e).pathname.split("/").pop()||"").split(".").pop()?.toLowerCase()}catch{return e.split(".").pop()?.toLowerCase()}},UK=e=>e.file.type.includes("image"),hNe=e=>e.file.type==="application/pdf",gNe=e=>e.file.type==="text/csv"||e.file.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",yNe=e=>e.file.type==="text/plain"||e.file.type==="application/msword"||e.file.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e.file.type==="text/markdown",J3={txt:"text/plain",pdf:"application/pdf",jpeg:"image/jpeg",jpg:"image/jpeg",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",md:"text/markdown",png:"image/png",csv:"text/csv"},xNe=e=>{if(e<0)throw new Error("Number of bytes cannot be negative");const t=["B","KB","MB","GB"];let n=0,r=e;for(;r>=1e3&&n!!(mu(e)===vo.PDF||Tf(e)),VK=e=>{const t=mu(e);if(Tf(e))return B("file-type-pdf");switch(t){case vo.TXT:return B("file-text");case vo.MARKDOWN:return B("file-text");case vo.PDF:return B("file-type-pdf");case vo.XLSX:return B("file-spreadsheet");case vo.CSV:return B("file-type-csv");case vo.DOCX:return B("file-type-doc");case vo.PPTX:return B("file-type-ppt");case vo.JPG:case vo.JPEG:case vo.PNG:return B("photo");default:return B("file")}},Uf=e=>e?.file_metadata?.file_source===tV.MEETING_TRANSCRIPT;function dA(e,t){return!1}const vNe={[Zn.GOOGLE_DRIVE]:B("brand-google-drive"),[Zn.ONEDRIVE]:B("brand-onedrive"),[Zn.SHAREPOINT]:B("brand-windows"),[Zn.DROPBOX]:Zme,[Zn.BOX]:Xme,[Zn.GENERATED_IMAGE]:B("photo"),[Zn.GENERATED_VIDEO]:B("slideshow"),[Zn.WILEY]:Qme,[Zn.LOCAL]:B("file")},fA=A.memo(({url:e,mcpServerSource:t,isConversationHistory:n,isMemory:r,isInlineAttachment:s,connectionType:o,isAttachment:a,patentName:i,isClientContext:c,isMeetingTranscript:u})=>{const f=d.useMemo(()=>{const m=$c(e),p=a?VK(e):null,h=t?If(t):null;if(n)return l.jsx(ge,{icon:B("list-search"),size:"xs"});if(i)return l.jsx(qU,{className:"size-3.5"});if(r)return l.jsx(ge,{icon:B("bubble-text"),size:"xs"});if(u)return l.jsx(ge,{icon:B("microphone"),size:"xs"});if(o){const g=vNe[o];return g?l.jsx(ge,{icon:g}):l.jsx(Po,{domain:m,overrideIconUrl:h||void 0})}else return s?l.jsx(ge,{icon:B("paperclip"),size:"xs"}):a?l.jsx(ge,{icon:p||B("file"),size:"xs"}):c?l.jsx(ge,{icon:B("hourglass-high"),size:"xs"}):l.jsx(Po,{domain:m,overrideIconUrl:h||void 0})},[e,a,t,n,i,r,u,o,s,c]);return l.jsx("div",{className:"flex size-4 items-center justify-center",children:f})});fA.displayName="Icon";const mA=A.memo(({url:e,source:t,isAttachment:n,connectionType:r,isConversationHistory:s,patentName:o})=>{const a=J(),i=d.useMemo(()=>{if(s)return a.formatMessage({defaultMessage:"library",id:"B7J+pmy9R5"});if(o)return o;if(t!=null)return t;let c;return n?c=cu(e):r?c=n2(r):c=Ur(e),c.replace(/\.[^.]*$/,"")},[e,t,n,r,s,o,a]);return l.jsx(l.Fragment,{children:i})});mA.displayName="Source";const HK=A.memo(({url:e,source:t,isAttachment:n,isClientContext:r,variant:s="small",color:o="default",truncate:a=!0,className:i,connectionType:c,mcpServerSource:u,isInlineAttachment:f,isMemory:m,patentName:p,isConversationHistory:h,name:g,snippet:y,isMeetingTranscript:x,...v})=>l.jsxs(K,{className:"flex items-center gap-x-1.5 min-w-0",children:[l.jsx(V,{variant:s,className:"relative flex-none",color:m||h?"light":o,children:l.jsx(fA,{url:e,source:t,mcpServerSource:u,isConversationHistory:h,isMemory:m,isInlineAttachment:f,connectionType:c,isAttachment:n,patentName:p,isClientContext:r,isMeetingTranscript:x})}),g&&l.jsx(V,{variant:s,color:o,...v,className:z(i,"min-w-0 truncate"),children:g}),l.jsx(V,{variant:s,color:g?"light":o,className:z("truncate min-w-0 grow break-all leading-none transition-all duration-300",{"max-w-[150px]":t!=null&&a},i),...v,children:l.jsx(mA,{url:e,source:t,isAttachment:n,connectionType:c,isMemory:m,isConversationHistory:h,patentName:p})})]}));HK.displayName="CitationDomainRoot";const ya=Object.assign(HK,{Icon:fA,Source:mA}),pu=A.memo(({isOpen:e,onClose:t,imgProps:n,alt:r,width:s,height:o,origin:a,onDownload:i,footer:c})=>{const{url:u,name:f,showCitation:m=!0}=a||{},p=ui(),h=d.useCallback(g=>{g.stopPropagation(),i?.()},[i]);return l.jsxs(po,{onClose:t,isOpen:e,variant:"hide-chrome",disableAnimation:!1,removeScroll:!p,modalClassname:"z-[100]",children:[l.jsx("div",{className:"flex h-screen w-screen place-content-center",onClick:t,children:l.jsxs("div",{className:z("gap-md p-md md:p-lg flex w-full flex-col",{"md:pb-md":m&&(u||i)}),children:[l.jsx("div",{className:"relative grow",children:l.jsx("div",{className:"absolute inset-0 size-full",children:l.jsx("img",{width:s,height:o,...n,alt:r,className:"size-full object-contain"})})}),m&&(u||i)?l.jsxs("div",{className:"gap-sm flex w-full flex-row justify-center",children:[u&&l.jsx(yt,{href:u,target:"_blank",children:l.jsxs(K,{variant:"subtle",className:"gap-x-xs p-sm flex items-center rounded-full",children:[l.jsx(ya,{url:u,source:f,isAttachment:!1}),l.jsx(V,{variant:"small",className:"pr-xs",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"xs"})})]})}),i&&l.jsx(K,{as:"button",onClick:h,variant:"subtle",className:"gap-x-xs p-sm flex !aspect-square w-9 items-center justify-center rounded-full",children:l.jsx(ge,{icon:B("download"),size:"sm"})})]}):null,c]})}),l.jsx(Ge,{onClick:t,icon:B("x"),extraCSS:"!fixed top-md right-md shadow-sm",size:"small",pill:!0,ariaLabel:"Close"})]})});pu.displayName="LightboxImage";const Wo=A.memo(({src:e,lightboxSrc:t,alt:n,fadeIn:r,fallbackSrc:s,fallback:o,hasShadow:a=!1,includeLightBoxModal:i=!0,lightboxFooter:c,origin:u,draggable:f=!0,imageClassName:m,maskClassName:p,containerClassName:h,rounded:g="md",onClick:y,AIProps:x,authorName:v,authorUrl:b,onLoad:_,onFail:w,softBlockSaveImage:S=!1,imageRef:C,imageProps:E,testId:T,onDownload:k,...I})=>{const[M,N]=d.useState(!1),[D,j]=d.useState(!1),[F,R]=d.useState(!1),P=d.useRef(null),{isAI:L,AILabel:U}=x||{isAI:!1,AILabel:""},O=d.useRef(Date.now()),$=d.useCallback(ee=>{N(!0),w?.({isConnected:ee.currentTarget.isConnected,loadTime:Date.now()-O.current})},[w]),G=d.useCallback(()=>{j(!0),_?.()},[j,_]);d.useEffect(()=>{if(P.current){if(P.current.complete){G();return}P.current.src||(P.current.src=e)}},[e,G,P]);const H=z(m,"transition-all ease-in-out",{"opacity-100 duration-200 scale-100":D&&r,"opacity-0 scale-[0.98]":!D&&r,"hidden opacity-0":M&&!s,"max-h-[90vh]":i,"cursor-zoom-in hover:shadow-lg duration-200 ":i&&!F}),Q=d.useMemo(()=>({className:H,src:e,alt:n,onError:$,onClick:()=>R(!0),...E}),[n,H,E,$,e]),Y=d.useMemo(()=>({ref:P,onLoad:G,...Q}),[G,Q]),te=d.useMemo(()=>({...Q,src:t??e}),[t,Q,e]),se=d.useCallback(ee=>{ee.stopPropagation()},[]),ae=l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"tiny",color:"white",className:"px-xs py-two h-5 rounded-md bg-black/60 opacity-0 transition-all group-hover:opacity-100",children:l.jsxs(ga,{className:"gap-xs",children:[l.jsx(Bn,{id:"authorName",children:v}),b?l.jsx(Bn,{id:"authorDomain",children:Ur(b)}):null]})}),l.jsx("div",{className:"size-xs bg-black/60 opacity-0 transition-all group-hover:opacity-100"})]}),X=d.useCallback(()=>R(!1),[]);if(M){if(s&&P.current)P.current.src=s;else if(o!==void 0)return o}return l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:y,className:h,"data-testid":T,children:l.jsxs("div",{className:z("bg-subtler group relative size-full overflow-hidden",p,{"shadow-md":a&&D,"transition-all duration-200 ease-in-out hover:scale-[1.02] hover:shadow-lg":a,"rounded-sm":g==="sm","rounded-md":g==="md",rounded:g===!0}),children:[L&&l.jsxs("div",{className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:[l.jsx("div",{children:l.jsx(V,{variant:"tiny",color:"white",className:"gap-x-two px-xs py-two flex h-5 items-center rounded-md bg-black/60 opacity-0 transition-all group-hover:opacity-100",children:l.jsx("span",{children:U})})}),l.jsx("div",{className:"size-xs bg-black/60 opacity-0 transition-all group-hover:opacity-100"}),l.jsx("div",{children:l.jsx(V,{variant:"tiny",color:"white",className:"gap-x-two p-two flex h-5 items-center rounded-md bg-black/60",children:l.jsx(ge,{icon:B("cpu-2"),size:"xs"})})})]}),v&&(b?l.jsx(yt,{href:b??"",target:"_blank",onClick:se,className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:ae}):l.jsx("div",{onClick:se,className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:ae})),S&&!L&&l.jsx("div",{className:"absolute inset-0",onClick:i?()=>R(!0):void 0}),l.jsx("img",{width:I.width,height:I.height,alt:n,...Y,ref:jK([C,P]),draggable:f})]})}),i&&l.jsx(pu,{onClose:X,isOpen:F,imgProps:te,origin:u,width:I.width,height:I.height,alt:n,onDownload:k,footer:c})]})});Wo.displayName="Image";const zK=A.memo(({uploadedFiles:e,onRemoveFile:t,ref:n})=>l.jsxs("div",{ref:n,className:"gap-x-sm scrollbar-none flex snap-x snap-mandatory overflow-x-auto",children:[l.jsx("div",{className:"w-xs shrink-0"}),e.map((r,s)=>l.jsx(WK,{uploadedFile:r,onRemoveFile:t},s)),l.jsx("div",{className:"w-xs shrink-0"})]}));zK.displayName="UploadedFilesList";const WK=A.memo(({uploadedFile:e,onRemoveFile:t})=>{const n="uploaded-files-list",{session:r}=Ne(),{trackEvent:s}=Xe(r),o=e.status==="uploading",{$t:a}=J(),{fileRepoInfo:i}=zx({reason:n}),{saveFile:c,isLoading:u}=f_e({fileRepoInfo:i,reason:n}),{data:f}=jz({fileRepoInfo:i,fileName:e.file.name,reason:n}),m=Object.values(vo),p=mu(e.file.name),g=p&&!kr(e.file.name)&&m.includes(p)&&Y2e(e.nextURL),y=i.file_repository_type==="COLLECTION"&&!o&&g,x=d.useMemo(()=>a(f?{defaultMessage:"File exists in Space",id:"pD1m2AH9FU"}:{defaultMessage:"Save attachment to Space",id:"/Pbth8CiTs"}),[f,a]),v=d.useMemo(()=>UK(e)?B("photo"):hNe(e)?B("pdf"):gNe(e)?B("file-spreadsheet"):yNe(e)?B("file-text"):B("file"),[e]),b=d.useCallback(()=>{s("remove attachment clicked"),e.nextURL&&t?.(e.nextURL,e.file_uuid??"")},[s,e,t]),_=d.useCallback(()=>c(e),[c,e]);return l.jsxs("div",{className:z("scroll-mx-md px-sm py-xs border-subtlest bg-subtler dark:bg-subtle gap-x-md flex h-[48px] w-fit snap-start items-center justify-between rounded-lg",{"opacity-70":o}),children:[l.jsxs("div",{className:"gap-x-md flex items-center",children:[e.thumbnailSource&&!o?l.jsx(Wo,{alt:e.file.name,src:e.thumbnailSource,containerClassName:"size-8 shrink-0",imageClassName:"w-full h-full object-cover object-center",rounded:"md",includeLightBoxModal:!1}):l.jsx("div",{className:"bg-subtle dark:bg-subtler flex size-8 items-center justify-center rounded-lg","data-testid":o?"file-loading-icon":"file-type-icon",children:l.jsx(ge,{icon:o?B("loader-2"):v,size:"sm",color:"#64645F",className:o?"animate-spin":void 0})}),l.jsxs("div",{className:"flex-col",children:[l.jsx(V,{variant:"tiny",color:"light",className:"text-nowrap",children:pNe(e.file.name,30)}),e.file.size>0&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"text-nowrap",children:xNe(e.file.size)})]})]}),l.jsxs("div",{className:"gap-x-sm flex items-center",children:[y&&l.jsx(st,{icon:B("device-floppy"),size:"tiny",onClick:_,disabled:f||u,variant:"common",toolTip:x,isLoading:u,pill:!0,noPadding:!0}),e.nextURL&&l.jsx(st,{icon:B("x"),size:"tiny",testId:"remove-uploaded-file",onClick:b,variant:"common",pill:!0,noPadding:!0})]})]})});WK.displayName="UploadedFilePreview";const bNe=new Set(["super","textColor","max","orange"]),_Ne=new Set(["red"]),wNe=e=>bNe.has(e)?"defaultInverted":_Ne.has(e)?"white":e==="maxBorder"?"max":e==="superBorder"?"super":"default",GK=A.memo(({text:e,variant:t="super",boxProps:n,textProps:r})=>{const s=wNe(t);return l.jsx(K,{variant:t,...n,className:z("px-xs rounded-badge -mt-px box-border inline-flex",n?.className),children:l.jsx(V,{variant:"tiny",className:"leading-4",color:s,inline:!0,...r,children:e})})});GK.displayName="Badge";const nl=A.memo(({children:e,orientation:t="vertical",showScrollIndicator:n=!0,thumbClassName:r="",className:s,viewportRef:o,viewportClassName:a,showIndicatorOnHover:i=!0,onScroll:c})=>{const f="before:content-[''] before:absolute before:top-[50%] before:left-[50%] before:translate-x-[-50%] before:translate-y-[-50%] before:w-[100%] before:h-[100%] before:min-w-[10px] before:min-h-[10px]"+" rounded-full bg-subtle duration-quick relative",m=z("flex flex-col p-px duration-150",{"data-[state=visible]:opacity-100":n,"pointer-events-none":!n,"opacity-0":i,"opacity-100":!i});return l.jsxs(u$,{className:z("w-full overflow-hidden",s),children:[l.jsx(d$,{className:z("size-full",a),ref:o,onScroll:c,children:e}),["vertical","both"].includes(t)&&l.jsx(A3,{forceMount:!0,orientation:"vertical",className:m,children:l.jsx(N3,{className:`!w-[5px] ${f} ${r}`})}),["horizontal","both"].includes(t)&&l.jsx(A3,{forceMount:!0,orientation:"horizontal",className:m,children:l.jsx(N3,{className:`!h-[5px] ${f} ${r}`})})]})}),CNe=A.memo(({scrollRef:e,buttonProps:t,children:n,className:r})=>{const s=d.useCallback(()=>{e.current?.scrollTo({left:e.current?.scrollLeft-e.current?.scrollWidth/3,behavior:"smooth"})},[e]),o=d.useCallback(()=>{e.current?.scrollTo({left:e.current?.scrollLeft+e.current?.scrollWidth/3,behavior:"smooth"})},[e]);return l.jsxs(K,{className:r,children:[l.jsx(st,{pill:!0,icon:B("chevron-left"),onClick:s,...t}),n,l.jsx(st,{pill:!0,icon:B("chevron-right"),onClick:o,...t})]})});CNe.displayName="ScrollAreaArrows";nl.displayName="ScrollArea";const fh=A.memo(({items:e,grid:t,cols:n=1,disableScrollArea:r=!1,disableHoverStyles:s=!1})=>{const o=d.useMemo(()=>t&&n>1?{display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:"1px"}:void 0,[t,n]),a=({children:i})=>o?l.jsx("div",{role:"menu",style:o,children:i}):r?l.jsx("div",{role:"menu",className:"p-xs flex flex-col gap-px",children:i}):l.jsx(nl,{showIndicatorOnHover:!1,className:"p-xs",children:l.jsx("div",{role:"menu",className:"flex flex-col gap-px",children:i})});return l.jsx(a,{children:e.map((i,c)=>i.type==="separator"?l.jsx(Ed,{...i},c):l.jsx(Ed,{disableHoverStyles:s,...i},c))})});fh.displayName="Menu";var SNe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],eE=SNe.join(","),$K=typeof Element>"u",mh=$K?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,p2=!$K&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},h2=function e(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",a=o||n&&t&&e(t.parentNode);return a},ENe=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},kNe=function(t,n,r){if(h2(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(eE));return n&&mh.call(t,eE)&&s.unshift(t),s=s.filter(r),s},MNe=function e(t,n,r){for(var s=[],o=Array.from(t);o.length;){var a=o.shift();if(!h2(a,!1))if(a.tagName==="SLOT"){var i=a.assignedElements(),c=i.length?i:a.children,u=e(c,!0,r);r.flatten?s.push.apply(s,u):s.push({scopeParent:a,candidates:u})}else{var f=mh.call(a,eE);f&&r.filter(a)&&(n||!t.includes(a))&&s.push(a);var m=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!h2(m,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(m&&p){var h=e(m===!0?a.children:m.children,!0,r);r.flatten?s.push.apply(s,h):s.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return s},qK=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},KK=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ENe(t))&&!qK(t)?0:t.tabIndex},TNe=function(t,n){var r=KK(t);return r<0&&n&&!qK(t)?0:r},ANe=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},YK=function(t){return t.tagName==="INPUT"},NNe=function(t){return YK(t)&&t.type==="hidden"},RNe=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},DNe=function(t,n){for(var r=0;rsummary:first-of-type"),a=o?t.parentElement:t;if(mh.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof s=="function"){for(var i=t;t;){var c=t.parentElement,u=p2(t);if(c&&!c.shadowRoot&&s(c)===!0)return JD(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=i}if(ONe(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return JD(t);return!1},FNe=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},VNe=function e(t){var n=[],r=[];return t.forEach(function(s,o){var a=!!s.scopeParent,i=a?s.scopeParent:s,c=TNe(i,a),u=a?e(s.candidates):i;c===0?a?n.push.apply(n,u):n.push(i):r.push({documentOrder:o,tabIndex:c,item:s,isScope:a,content:u})}),r.sort(ANe).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},QK=function(t,n){n=n||{};var r;return n.getShadowRoot?r=MNe([t],n.includeContainer,{filter:ej.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:UNe}):r=kNe(t,n.includeContainer,ej.bind(null,n)),VNe(r)};function HNe(){return/apple/i.test(navigator.vendor)}function zNe(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function WNe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_me(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function pA(e){return e?.ownerDocument||document}var GNe=typeof document<"u",$Ne=function(){},Tl=GNe?d.useLayoutEffect:$Ne;const qNe={...DU},KNe=qNe.useInsertionEffect,YNe=KNe||(e=>e());function QNe(e){const t=d.useRef(()=>{});return YNe(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ZK(e,t){const n=QK(e,XK()),r=n.length;if(r===0)return;const s=zNe(pA(e)),o=n.indexOf(s),a=o===-1?t===1?0:r-1:o+t;return n[a]}function XNe(e){return ZK(pA(e).body,1)||e}function ZNe(e){return ZK(pA(e).body,-1)||e}function sw(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!WNe(n,r)}function JNe(e){QK(e,XK()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function tj(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const e8e={...DU};let nj=!1,t8e=0;const rj=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+t8e++;function n8e(){const[e,t]=d.useState(()=>nj?rj():void 0);return Tl(()=>{e==null&&t(rj())},[]),d.useEffect(()=>{nj=!0},[]),e}const r8e=e8e.useId,hA=r8e||n8e,s8e=d.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:s},middlewareData:{arrow:o,shift:a}},width:i=14,height:c=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:m,stroke:p,d:h,style:{transform:g,...y}={},...x}=t,v=hA(),[b,_]=d.useState(!1);if(Tl(()=>{if(!s)return;Cme(s).direction==="rtl"&&_(!0)},[s]),!s)return null;const[w,S]=r.split("-"),C=w==="top"||w==="bottom";let E=m;(C&&a!=null&&a.x||!C&&a!=null&&a.y)&&(E=null);const T=f*2,k=T/2,I=i/2*(u/-8+1),M=c/2*u/4,N=!!h,D=E&&S==="end"?"bottom":"top";let j=E&&S==="end"?"right":"left";E&&b&&(j=S==="end"?"left":"right");const F=o?.x!=null?E||o.x:"",R=o?.y!=null?E||o.y:"",P=h||"M0,0"+(" H"+i)+(" L"+(i-I)+","+(c-M))+(" Q"+i/2+","+c+" "+I+","+(c-M))+" Z",L={top:N?"rotate(180deg)":"",left:N?"rotate(90deg)":"rotate(-90deg)",bottom:N?"":"rotate(180deg)",right:N?"rotate(-90deg)":"rotate(90deg)"}[w];return l.jsxs("svg",{...x,"aria-hidden":!0,ref:n,width:N?i:i+T,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[j]:F,[D]:R,[w]:C||N?"100%":"calc(100% - "+T/2+"px)",transform:[L,g].filter(U=>!!U).join(" "),...y},children:[T>0&&l.jsx("path",{clipPath:"url(#"+v+")",fill:"none",stroke:p,strokeWidth:T+(h?0:1),d:P}),l.jsx("path",{stroke:T&&!h?x.fill:"none",d:P}),l.jsx("clipPath",{id:v,children:l.jsx("rect",{x:-k,y:k*(N?-1:1),width:i+T,height:i})})]})});function o8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const a8e=d.createContext(null),i8e=d.createContext(null),l8e=()=>{var e;return((e=d.useContext(a8e))==null?void 0:e.id)||null},c8e=()=>d.useContext(i8e);function JK(e){return"data-floating-ui-"+e}const eY={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},sj=d.forwardRef(function(t,n){const[r,s]=d.useState();Tl(()=>{HNe()&&s("button")},[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[JK("focus-guard")]:"",style:eY};return l.jsx("span",{...t,...o})}),tY=d.createContext(null),oj=JK("portal");function u8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=hA(),s=f8e(),[o,a]=d.useState(null),i=d.useRef(null);return Tl(()=>()=>{o?.remove(),queueMicrotask(()=>{i.current=null})},[o]),Tl(()=>{if(!r||i.current)return;const c=t?document.getElementById(t):null;if(!c)return;const u=document.createElement("div");u.id=r,u.setAttribute(oj,""),c.appendChild(u),i.current=u,a(u)},[t,r]),Tl(()=>{if(n===null||!r||i.current)return;let c=n||s?.portalNode;c&&!Sme(c)&&(c=c.current),c=c||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,c.appendChild(u));const f=document.createElement("div");f.id=r,f.setAttribute(oj,""),c=u||c,c.appendChild(f),i.current=f,a(f)},[t,n,r,s]),o}function d8e(e){const{children:t,id:n,root:r,preserveTabOrder:s=!0}=e,o=u8e({id:n,root:r}),[a,i]=d.useState(null),c=d.useRef(null),u=d.useRef(null),f=d.useRef(null),m=d.useRef(null),p=a?.modal,h=a?.open,g=!!a&&!a.modal&&a.open&&s&&!!(r||o);return d.useEffect(()=>{if(!o||!s||p)return;function y(x){o&&sw(x)&&(x.type==="focusin"?tj:JNe)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,s,p]),d.useEffect(()=>{o&&(h||tj(o))},[h,o]),l.jsxs(tY.Provider,{value:d.useMemo(()=>({preserveTabOrder:s,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:m,portalNode:o,setFocusManagerState:i}),[s,o]),children:[g&&o&&l.jsx(sj,{"data-type":"outside",ref:c,onFocus:y=>{if(sw(y,o)){var x;(x=f.current)==null||x.focus()}else{const v=a?a.domReference:null,b=ZNe(v);b?.focus()}}}),g&&o&&l.jsx("span",{"aria-owns":o.id,style:eY}),o&&zh.createPortal(t,o),g&&o&&l.jsx(sj,{"data-type":"outside",ref:u,onFocus:y=>{if(sw(y,o)){var x;(x=m.current)==null||x.focus()}else{const v=a?a.domReference:null,b=XNe(v);b?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const f8e=()=>d.useContext(tY);function m8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=hA(),o=d.useRef({}),[a]=d.useState(()=>o8e()),i=l8e()!=null,[c,u]=d.useState(r.reference),f=QNe((h,g,y)=>{o.current.openEvent=h?g:void 0,a.emit("openchange",{open:h,event:g,reason:y,nested:i}),n?.(h,g,y)}),m=d.useMemo(()=>({setPositionReference:u}),[]),p=d.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return d.useMemo(()=>({dataRef:o,open:t,onOpenChange:f,elements:p,events:a,floatingId:s,refs:m}),[t,f,p,a,s,m])}function nY(e){e===void 0&&(e={});const{nodeId:t}=e,n=m8e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[o,a]=d.useState(null),[i,c]=d.useState(null),f=s?.domReference||o,m=d.useRef(null),p=c8e();Tl(()=>{f&&(m.current=f)},[f]);const h=wme({...e,elements:{...s,...i&&{reference:i}}}),g=d.useCallback(_=>{const w=N0(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;c(w),h.refs.setReference(w)},[h.refs]),y=d.useCallback(_=>{(N0(_)||_===null)&&(m.current=_,a(_)),(N0(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!N0(_))&&h.refs.setReference(_)},[h.refs]),x=d.useMemo(()=>({...h.refs,setReference:y,setPositionReference:g,domReference:m}),[h.refs,y,g]),v=d.useMemo(()=>({...h.elements,domReference:f}),[h.elements,f]),b=d.useMemo(()=>({...h,...r,refs:x,elements:v,nodeId:t}),[h,x,v,t,r]);return Tl(()=>{r.dataRef.current.floatingContext=b;const _=p?.nodesRef.current.find(w=>w.id===t);_&&(_.context=b)}),d.useMemo(()=>({...h,context:b,refs:x,elements:v}),[h,x,v,b])}class p8e{static detectOverflowOptions={padding:8};static offsetMiddleware=dM({mainAxis:4,crossAxis:0});static shiftMiddleware=BU({limiter:Eme(),...this.detectOverflowOptions});static flipMiddleware=UU(this.detectOverflowOptions);static sizeMiddleware(t={matchTargetWidth:!1},n=!0){return VU({...this.detectOverflowOptions,apply({availableHeight:r,rects:s,elements:o}){n&&(o.floating.style.maxHeight=`${r}px`),(t.matchTargetWidth??!0)&&(o.floating.style.width=`${s.reference.width}px`)}})}static defaultMiddleWare(t={avoidCollisions:!0,matchTargetWidth:!1}){const n=t.avoidCollisions??!0,r=t.avoidPositionCollisions!==void 0?t.avoidPositionCollisions:n,s=t.avoidSizeCollisions!==void 0?t.avoidSizeCollisions:n;return[this.offsetMiddleware,r&&this.shiftMiddleware,r&&this.flipMiddleware,this.sizeMiddleware({matchTargetWidth:t.matchTargetWidth},s)].filter(Boolean)}}const h8e=130,Vf=A.memo(({content:e,contentClassName:t="",children:n,delayTime:r=200,isOpen:s,hoverOpen:o,hoverOpenDelay:a=0,placement:i="bottom-end",matchTargetWidth:c=!1,childrenClassName:u,testId:f,overlayProps:m,onOpen:p,onClose:h,disableAnimation:g,hasInteractiveContent:y=!1,avoidCollisions:x=!0,avoidPositionCollisions:v,avoidSizeCollisions:b,customFloatingUIOptions:_,disableShadow:w,floatingElementProps:S,arrowClassName:C,borderRadius:E="rounded-xl",sideOffset:T=4,forceDarkMode:k=!1,onContentMouseEnter:I,onContentMouseLeave:M})=>{const N=d.useRef(null),D=d.useRef(null),j=d.useMemo(()=>{const Ee=p8e.defaultMiddleWare({avoidCollisions:x,avoidPositionCollisions:v,avoidSizeCollisions:b,matchTargetWidth:c});return T!==4&&(Ee[0]=dM({mainAxis:T,crossAxis:0})),C&&Ee.push(kme({element:N})),Ee},[x,v,b,c,C,T]),{refs:F,floatingStyles:R,placement:P,context:L}=nY({strategy:"fixed",placement:i,middleware:j,whileElementsMounted:(...Ee)=>HU(...Ee),..._}),[U,O]=d.useState(!1),$=d.useRef(U),[G,H]=d.useState(!1),Q=d.useRef(G),[Y,te]=d.useState(!1),se=s!==void 0,[ae,X]=d.useState(!1),ee=d.useMemo(()=>se?s:ae,[se,s,ae]),le=d.useCallback(Ee=>{Ee.stopPropagation()},[]),re=d.useCallback(()=>{ee||(p?.(),se||X(!0))},[se,ee,p]),ce=d.useCallback(()=>{te(Ee=>ee&&!Ee?(h?.(),se||X(!1),g?!1:(setTimeout(()=>{te(!1)},h8e),!0)):Ee)},[se,ee,h,g]),ue=d.useCallback(()=>{ee?ce():re()},[ce,re,ee]),me=d.useCallback(()=>{setTimeout(()=>{!Q.current&&!$.current&&ce()},r)},[r,ce,Q,$]),we=d.useCallback(()=>{setTimeout(()=>{if(se&&h){h();return}ce()},0)},[se,h,ce]),ye=d.useCallback(()=>{$.current=!0,O(!0),D.current&&(clearTimeout(D.current),D.current=null),a>0?D.current=setTimeout(()=>{re()},a):re()},[re,a]),_e=d.useCallback(()=>{$.current=!1,O(!1),D.current&&(clearTimeout(D.current),D.current=null),me()},[me]),ke=d.useCallback(()=>{o&&(Q.current=!0,H(!0)),I?.()},[o,I]),De=d.useCallback(()=>{o&&(Q.current=!1,H(!1),me()),M?.()},[o,me,M]),xe=d.useCallback(Ee=>{Ee.stopPropagation(),ue()},[ue]),Ue=d.useMemo(()=>({transform:"translateY(-1px)"}),[]);return d.useEffect(()=>()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),l.jsxs(l.Fragment,{children:[l.jsx("span",{onMouseEnter:o?ye:void 0,onMouseLeave:o?_e:void 0,onPointerEnter:o?ye:void 0,onPointerLeave:o?_e:void 0,ref:F.setReference,onMouseDown:le,onClick:o?void 0:xe,className:u,"data-test-id":f,children:n}),e?l.jsx(uA,{isOpen:ee||Y,onClose:we,transparent:!0,childVariant:"clean",disableAnimation:g,delayClose:!1,...m,children:l.jsx("div",{className:"absolute inset-x-0 top-0","data-color-scheme":k?"dark":void 0,children:l.jsx("div",{className:"flex",ref:F.setFloating,onMouseEnter:ke,onMouseLeave:De,onPointerEnter:ke,onPointerLeave:De,onClick:Ee=>{y&&Ee.stopPropagation()},style:R,...S,children:l.jsxs(K,{variant:"background",className:z({"shadow-overlay":!w},"flex min-h-0 min-w-0","data-[placement=bottom-end]:origin-top-right data-[placement=bottom-start]:origin-top-left data-[placement=top-end]:origin-bottom-right data-[placement=top-start]:origin-bottom-left",{"duration-150":!g,"animate-out fade-out zoom-out-[0.97] ease-in":Y&&!g,"p-xs animate-in fade-in zoom-in-[0.97] ease-out":!g},t,E),"data-placement":P,children:[e,C&&l.jsx(s8e,{ref:N,context:L,className:C,style:Ue})]})})})}):null]})});Vf.displayName="Popover";const zs=A.memo(({isOpen:e,hoverOpen:t=!1,children:n,items:r,placement:s,disabled:o=!1,grid:a,onOpen:i,title:c,onClose:u,isMobileStyle:f,boxProps:m,modalProps:p,popoverProps:h,cols:g=1,footer:y=null,contentClassName:x="",wrapperClassName:v,header:b,preMenuContent:_,alwaysShowChildren:w,size:S,showFooterOnMobile:C=!1,isMax:E=!1})=>{const[T,k]=d.useState(!1),I=e!==void 0,M=I?e:T,N=d.useCallback(()=>{if(!M&&!o){const P=i?.()??!0;!I&&P&&k(!0)}},[o,I,i,M]),D=d.useCallback(()=>{M&&!o&&(u?.(),I||k(!1))},[o,I,u,M]),j=d.useMemo(()=>r.map(P=>({...P,size:S??(f?Ht.regular:void 0),onClick:L=>{!o&&"onClick"in P&&(P.onClick?.(L),P.type==="toggle"||P.type==="multiSelect"||D())}})),[o,D,r,S,f]),F=d.useMemo(()=>{const{className:P,...L}=m||{};return l.jsx(K,{className:z("flex max-h-[80vh] min-h-0 min-w-[160px] flex-col",{"max-w-[250px]":!a,"gap-two grid max-w-lg":a,"max-super-override":E},P),...L,children:l.jsxs("div",{className:"flex h-full flex-col",children:[b&&l.jsx(K,{className:"mb-sm mx-sm flex-shrink-0 border-b",children:b}),c&&l.jsx(K,{className:"mb-sm mx-sm flex-shrink-0 border-b",children:l.jsx(V,{variant:"smallBold",className:"py-sm mb-1",children:c})}),l.jsxs(nl,{orientation:"vertical",showIndicatorOnHover:!1,className:"min-h-0 flex-1 overflow-auto",children:[_,l.jsx(fh,{items:j,grid:a,cols:g,disableScrollArea:!0}),y]})]})})},[m,g,y,a,b,j,c,_,E]);return r.every(P=>P.show===!1)?w?n:null:f?l.jsxs(l.Fragment,{children:[l.jsx(po,{variant:"bottom-left-sheet",actionList:Pe,isOpen:M,onClose:D,footerContent:C&&y?y:void 0,footerClassname:C&&y?"!pt-0 pb-5 sticky bottom-0":void 0,wrapperClassname:C&&y?"!pb-0":void 0,...p,children:l.jsx(K,{className:z("divide-y",{"max-super-override":E}),children:l.jsx(fh,{items:j,grid:a})})}),l.jsx("span",{className:v,onClick:t?void 0:P=>{P.stopPropagation(),N()},children:n})]}):l.jsx(Vf,{...h,hoverOpen:t,isOpen:M,placement:s,onClose:D,onOpen:N,contentClassName:x,childrenClassName:v,content:F,hasInteractiveContent:!0,children:n})});zs.displayName="DropDownMenu";const Hf=A.memo(({children:e,className:t,disabled:n,onClick:r,onMouseDown:s,onMouseEnter:o,onMouseMove:a,testId:i,rounded:c,href:u,focused:f,disableHoverStyles:m=!1,target:p="_blank",tooltipText:h,tooltipLayout:g="right",tooltipDelayDuration:y,active:x=!1,role:v="menuitem"})=>{const b=d.useRef(null),_=ui(),w=l.jsx("div",{className:z("duration-quick relative select-none rounded-lg transition-all","px-sm py-1.5 md:h-full",{"hover:bg-subtler cursor-pointer":!n&&!m,"cursor-pointer":!n&&m,rounded:c,"bg-subtler":f}),children:e}),S=z("group/item md:h-full",t);d.useEffect(()=>{b.current&&f&&b.current.scrollIntoView({behavior:"instant",block:"nearest"})},[f]);const C=v==="menuitemradio"||v==="menuitemcheckbox"?x?"true":"false":void 0;return u&&!n?l.jsx(yt,{href:u,target:p,className:S,onClick:r,"data-testid":i,children:w}):l.jsx(Io,{tooltipText:h,showTooltip:!_&&!!h,tooltipLayout:g,delayDuration:y,offset:12,asChild:!0,children:l.jsx("div",{role:v,"aria-checked":C,ref:b,"data-testid":i,className:S,onClick:n?void 0:r,onMouseDown:n?void 0:s,onMouseEnter:n?void 0:o,onMouseMove:n?void 0:a,children:w})})});Hf.displayName="MenuItemWrapper";const g8e=({icon:e,avatar:t,destructive:n})=>{if(t)return t;if(!e)return null;const r=z({"!text-caution":n},"opacity-90");return l.jsx(ge,{icon:e,className:r,size:"sm"})},y8e=/\bgap(-[xy])?-/,x8e={[Ht.small]:"extraSmall",[Ht.tiny]:"tiny"},zf=A.memo(({customDescriptionNode:e,customTextNode:t,text:n,description:r,icon:s,avatar:o,label:a,badge:i,link:c,onLinkClick:u,size:f=Ht.small,color:m="default",badgeVariant:p="super",destructive:h,leftElement:g,rightElement:y,bottomElement:x,textTrailingElement:v,className:b="",preserveLeftIconSpace:_=!1,textClassName:w})=>{const S=s||o;return l.jsxs("div",{className:z("flex",b,y8e.test(b)?"":"gap-sm"),children:[(S||_)&&l.jsx("div",{className:"flex",children:l.jsx(V,{color:m,className:z("flex size-5 justify-center leading-none",{"-mt-one":o}),children:!_||S?l.jsx(g8e,{icon:s,avatar:o,destructive:h}):null})}),g,l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[t||l.jsxs(V,{variant:x8e[f]??"baseSemi",color:m,className:z("flex items-center gap-x-1.5",{"!text-caution":h}),children:[l.jsx("span",{className:w,children:n}),v,i&&l.jsx(GK,{text:i,variant:p})]}),e||r&&l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:r}),c&&l.jsx(V,{variant:"tinyRegular",color:"super",onClick:u,children:c}),x]}),a&&l.jsx(V,{className:"mt-one whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:a})]}),y]})});zf.displayName="BaseMenuItem";const gA=A.memo(e=>{const{active:t,show:n=!0,className:r,rounded:s,color:o="default",activeColor:a="super",badgeVariant:i="super",disabled:c,href:u,onClick:f,onMouseDown:m,onMouseEnter:p,onMouseMove:h,testId:g,rightElement:y,focused:x,preserveRightElementSpace:v=!0,disableHoverStyles:b=!1,target:_,tooltipText:w,tooltipLayout:S,tooltipDelayDuration:C,role:E}=e;if(!n)return null;let T=o;c?T="ultraLight":t&&(T=a);const k=y??l.jsx(V,{color:T,className:"size-5",children:l.jsx(ut,{name:B("check"),size:hl.sm,className:t?"opacity-100":"opacity-0","aria-hidden":!t})});return l.jsx(Hf,{className:r,disabled:c,onClick:f,onMouseDown:m,onMouseEnter:p,onMouseMove:h,testId:g,rounded:s,href:u,focused:x,disableHoverStyles:b,target:_,tooltipText:w,tooltipLayout:S,tooltipDelayDuration:C,role:E,active:t,children:l.jsx(zf,{...e,color:T,badgeVariant:i,rightElement:v?k:y})})});gA.displayName="DefaultMenuItem";const rY=A.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,selected:f,active:m,disableHoverStyles:p=!1,tooltipText:h,tooltipLayout:g,tooltipDelayDuration:y,iconVariant:x="checkbox",disableActiveStyles:v=!1}=e;let b=r;s?b="ultraLight":(m||f)&&!v&&(b="super");const _=d.useMemo(()=>x==="check"?l.jsx(V,{color:f&&!v?"super":b,className:"size-5",children:l.jsx(ut,{name:B("check"),size:hl.sm,className:f?"opacity-100":"opacity-0","aria-hidden":!f})}):l.jsx(V,{color:f&&!v?"super":b,children:l.jsx(rn,{icon:f?B("square-check"):B("square"),size:"small"})}),[b,f,x,v]);return l.jsx(Hf,{className:t,disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,rounded:n,disableHoverStyles:p,tooltipText:h,tooltipLayout:g,tooltipDelayDuration:y,children:l.jsx(zf,{...e,color:b,rightElement:_})})});rY.displayName="MultiSelectMenuItem";const yA=A.memo(e=>{const{className:t,rounded:n,color:r="default",activeColor:s="super",switchVariant:o="super",disabled:a,onClick:i,onMouseDown:c,onMouseEnter:u,onMouseMove:f,testId:m,selected:p,active:h,rightElement:g,disableHoverStyles:y=!1,tooltipText:x,tooltipLayout:v,tooltipDelayDuration:b}=e,{$t:_}=J();let w=r;a?w="ultraLight":(h||p)&&(w=s);const S=d.useMemo(()=>l.jsxs("div",{className:z("gap-x-sm flex items-start pt-0.5",{"max-super-override":o==="max"}),children:[g,l.jsx(fg,{checked:p,onCheckedChange:Ao,disabled:a,size:"small","aria-label":x||_({defaultMessage:"Toggle option",id:"z+oW4dt4hh"})})]}),[_,a,g,p,o,x]);return l.jsx(Hf,{className:t,disabled:a,onClick:i,onMouseDown:c,onMouseEnter:u,onMouseMove:f,testId:m,rounded:n,disableHoverStyles:y,tooltipText:x,tooltipLayout:v,tooltipDelayDuration:b,children:l.jsx(zf,{...e,color:w,rightElement:S})})});yA.displayName="ToggleMenuItem";const sY=A.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,selected:f,active:m,showIconLeft:p=!1,disableHoverStyles:h=!1,tooltipText:g,tooltipLayout:y,tooltipDelayDuration:x}=e;let v=r;(m||f)&&(v="super");const b=l.jsx(V,{color:f?v:"ultraLight",className:z("flex pt-0.5 leading-none",{"opacity-50":s}),children:l.jsx(rn,{icon:f?B("circle-filled"):B("circle"),size:"small"})});return l.jsx(Hf,{className:t,disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,rounded:n,disableHoverStyles:h,tooltipText:g,tooltipLayout:y,tooltipDelayDuration:x,children:l.jsx(zf,{...e,rightElement:p?void 0:b,leftElement:p?b:void 0})})});sY.displayName="RadioMenuItem";const oY=A.memo(e=>{const{text:t,show:n,className:r}=e;return n?l.jsxs(l.Fragment,{children:[l.jsx(K,{className:z("sm:mx-sm my-sm border-b first:hidden",r)}),t&&l.jsx(K,{variant:"background",className:"sm:mx-sm mt-xs mb-sm pr-sm",children:l.jsx(V,{className:"w-max",variant:"tinyMono",color:"light",children:t})})]}):null});oY.displayName="MenuItemSeparator";const aY=A.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onMouseDown:o,onMouseEnter:a,onMouseMove:i,testId:c,submenu:u,active:f,disableHoverStyles:m=!1,isSubmenuOpen:p,onSubmenuOpen:h,onSubmenuClose:g,menuWidth:y="200px",isMax:x=!1}=e;let v=r;s?v="ultraLight":f&&(v="super");const b=d.useMemo(()=>l.jsx(V,{color:"light",children:l.jsx(rn,{icon:B("chevron-right"),size:"small"})}),[]),_=d.useMemo(()=>({className:"min-w-0",style:{width:y}}),[y]),w=d.useMemo(()=>({hasInteractiveContent:!0}),[]);return l.jsx(zs,{isOpen:p,items:u,placement:"right-end",onOpen:h,onClose:g,isMobileStyle:!1,hoverOpen:!0,boxProps:_,popoverProps:w,isMax:x,children:l.jsx(Hf,{className:t,disabled:s,onMouseDown:o,onMouseEnter:a,onMouseMove:i,testId:c,rounded:n,disableHoverStyles:m,children:l.jsx(zf,{...e,color:v,rightElement:b})})})});aY.displayName="NestedMenuItem";const Ed=A.memo(e=>{switch(e.type){case"default":{const{type:t,...n}=e;return l.jsx(gA,{...n,role:n.role||"menuitem"})}case"multiSelect":{const{type:t,...n}=e;return l.jsx(rY,{...n,role:"menuitemcheckbox"})}case"toggle":{const{type:t,...n}=e;return l.jsx(yA,{...n,role:"menuitemcheckbox"})}case"radio":{const{type:t,...n}=e;return l.jsx(sY,{...n,role:"menuitemradio"})}case"separator":{const{type:t,...n}=e;return l.jsx(oY,{...n})}case"nested":{const{type:t,...n}=e;return l.jsx(aY,{...n})}case"custom":return l.jsx(l.Fragment,{children:e.children})}});Ed.displayName="MenuItem";const iY=e=>e.map((t,n)=>{switch(t.type){case"default":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.Item,{onSelect:s,leadingAccessory:r,trailingAccessory:t.rightElement,disabled:t.disabled,children:t.text},n)}case"separator":return l.jsx(Dt.Separator,{},n);case"nested":{const r=t.avatar?()=>t.avatar:t.icon;return l.jsx(Dt.Submenu,{triggerElement:l.jsx(Dt.SubmenuItem,{leadingAccessory:r,disabled:t.disabled,children:t.text}),children:iY(t.submenu)},n)}case"multiSelect":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.CheckboxItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"toggle":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.SwitchItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"radio":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.CheckboxItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"custom":return l.jsx(A.Fragment,{children:t.children},n);default:At(t)}}),lY=A.memo(({children:e,isOpen:t,onOpen:n,onClose:r,connectorMenuItems:s})=>{const o=d.useCallback(a=>{a?n():r()},[n,r]);return s.length<=1?e:l.jsx(Dt,{triggerElement:e,isOpen:t,onToggle:o,children:iY(s)})});lY.displayName="AttachmentSelector";const xA="/account",dbt=()=>`${xA}/details`,v8e=()=>xA,b8e=({mode:e})=>{const t=On(),n=ou(),r=d.useMemo(()=>t?.startsWith("/collections")||t?.startsWith("/spaces")?"space":t?.startsWith("/search")?"thread":t?.startsWith("/settings")?null:"ask",[t]),s=d.useMemo(()=>n===null?null:t?.startsWith("/collections")||t?.startsWith("/spaces")?n.slug?typeof n.slug=="string"?n.slug:n.slug[0]??null:null:t?.startsWith("/search")?t.split("/").pop()??null:t?.startsWith("/settings")?null:e??null,[t,n,e]),o=v8e(),a=d.useMemo(()=>{const i=`${o}/connectors`,c=new URLSearchParams;if(r){const u=Array.isArray(s)?s[0]:s;c.append("referrer",r),u&&c.append("referrerId",u)}return i+"?"+c.toString()},[r,s,o]);return d.useMemo(()=>({referrer:r,referrerId:s,redirectPath:a}),[a,r,s])};Ce(async()=>{const{MicrosoftFilePickerModal:e}=await Se(()=>q(()=>import("./MicrosoftFilePickerModal-aO6nep6w.js"),__vite__mapDeps([138,4,1,6,3,86,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});const _8e=Ce(async()=>{const{BoxFilePickerModal:e}=await Se(()=>q(()=>import("./BoxFilePickerModal--6cVluz-.js"),__vite__mapDeps([139,4,1,3,8,9,6,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),cY=A.memo(({isOpen:e,fileType:t,tooltip:n,onOpen:r,onClose:s,onFilePickerOpen:o,onFilePickerClose:a,areFileAttachmentsAllowed:i,fileUploadErrorMessage:c,fileUploadWarningMessage:u,activeConnector:f=null,uploadedFiles:m=Pe,handleStartUpload:p,handleFileInput:h,isBoxFilePickerOpen:g=!1,handleCloseBoxFilePicker:y,cleanupBoxFilePicker:x,microsoftFilePickerOptions:v=null,handleCloseMicrosoftFilePicker:b,handleSelectSharepointSite:_,isMicrosoftFilePickerOpen:w=!1,fileInputRef:S,isAudioVideoFilesEnabled:C=!1,setAttachmentErrorMessage:E})=>{const T="file-upload-button",{$t:k}=J(),I=d.useRef(!1),[M,N]=w8e(),D=ui(),j=Wt(),{uploadRateLimit:F}=Vn(),{hasActiveSubscription:R}=$t(),P=F??(R?wM:_M),L=d.useCallback(xe=>xe.preventDefault(),[]),{session:U}=Ne(),{trackEvent:O}=Xe(U),{referrer:$,referrerId:G}=b8e({mode:"file"}),{connectorsMap:H}=Af({reason:T}),{enabledFileConnectors:Q}=Nz({reason:T}),{disabledFileConnectors:Y}=Rz({reason:T}),te=d.useMemo(()=>H?.onedrive?.connected||H?.sharepoint?.connected,[H?.onedrive?.connected,H?.sharepoint?.connected]),se=d.useCallback(()=>{switch(t){case"image":return k({defaultMessage:"images",id:"HVUWg4/ofn"});case"all":return k({defaultMessage:"files",id:"l17U7PEF+6"});default:return k({defaultMessage:"text or PDF files",id:"XFh9ob267W"})}},[k,t]),ae=d.useCallback(()=>{switch(t){case"image":return Che;case"all":return C?The:She;default:return C?khe:uV}},[t,C]),X=d.useCallback(xe=>{xe?O("attempt connector file attachment",{connectorName:xe}):O("opened file selector",{}),p?.(xe)},[p,O]),{handleConnect:ee}=J4({reason:T}),[le,re]=d.useState(!1),ce=d.useMemo(()=>{const xe={type:"default",text:k({defaultMessage:"Local files",id:"xMmQ4F7z3A"}),size:"small",icon:B("file-upload"),onMouseDown:L,onClick:()=>X("local")},Ue=Q.map(Ee=>{const Ke=Ee.name;return{type:"default",text:kc(Ke)??"",avatar:l.jsx("img",{src:_3(Ke)??"",alt:kc(Ke),width:20,height:20}),onMouseDown:L,onClick:()=>X(Ke),show:MV.includes(Ee.name)}});return Y.length>0&&!D&&Ue.push({type:"nested",submenu:Y.map(Ee=>({type:"default",size:"small",text:kc(Ee.name),avatar:l.jsx("img",{src:_3(Ee.name)??"",alt:kc(Ee.name),width:20,height:20}),rightElement:l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"sm"})}),onClick:()=>ee({connectorName:Ee.name,customReferrer:$??void 0,customReferrerId:G??void 0})})),isSubmenuOpen:le,onSubmenuOpen:()=>re(!0),onSubmenuClose:()=>re(!1),text:k({defaultMessage:"Connect files",id:"geEGjFxpOA"}),icon:B("share"),onMouseDown:L}),[xe]},[k,Q,Y,L,X,le,ee,$,G,D]),ue=d.useCallback(()=>{i&&(ce.length<=1||m.length>0?X(f??void 0):r?.())},[ce,m,f,X,r,i]),me=d.useCallback(()=>{s?.()},[s]),we=d.useMemo(()=>{if(n)return n;let xe=`${k({defaultMessage:"Attach",id:"Ye0Clmvfec"})} ${se()}`;return j?i?P!=null&&P>0&&P<=100?xe+=`. ${k({defaultMessage:"{remaining} left today",id:"V9HtlcGCOC"},{remaining:P})}`:mr(Hy)&&(xe=k({defaultMessage:"Files attached to threads are retained for 7 days",id:"hTclTOMwb7"})):xe=k({defaultMessage:"File attachments are disabled by your organization",id:"HmmaBNCmcH"}):xe+=`. ${k({defaultMessage:"Sign in to attach files",id:"Ei6nUBg77Q"})}`,xe},[k,i,P,se,j,n]);d.useEffect(()=>{const xe=()=>{I.current&&(a?.(),I.current=!1)};return window.addEventListener("focus",xe),()=>window.removeEventListener("focus",xe)},[a]),d.useCallback(()=>b?.(),[b]);const ye=d.useCallback(()=>y?.(),[y]);d.useCallback(xe=>_?.(xe),[_]);const _e=d.useCallback(()=>x?.(),[x]),ke=d.useCallback(()=>{E?.("")},[E]),De=d.useCallback(xe=>{ce.length<=1?ue():xe.stopPropagation()},[ce.length,ue]);return l.jsxs("div",{className:"flex items-center",children:[l.jsx(lY,{connectorMenuItems:ce,isOpen:e,onOpen:ue,onClose:me,children:l.jsx(wt,{variant:"text",size:"small",icon:B("paperclip"),disabled:!i,onClick:De,"aria-label":we,tooltipOpen:M||e,tooltipOnOpenChange:N})}),l.jsx("input",{type:"file",multiple:!0,"data-testid":"file-upload-input",onClick:()=>{I.current=!0,o?.()},ref:S,onChange:xe=>{I.current=!1,h?.(xe.target.files?Array.from(xe.target.files):Pe)},accept:ae(),style:{display:"none"}}),te&&w&&!1,H?.box?.connected&&g&&l.jsx(_8e,{isOpen:g,onClose:ye,cleanupPicker:_e}),l.jsx(qc,{isVisible:!!c,variant:"error",message:c??"",handleClose:ke,timeout:null}),l.jsx(qc,{isVisible:!!u&&!c,variant:"warning",message:u??"",timeout:4})]})});cY.displayName="FileUploadButton";function w8e(){const{fileUploadUpsellTooltipOpen:e}=qr(),{setFileUploadUpsellTooltipOpen:t}=jo(),[n,r]=d.useState(!1);return d.useEffect(()=>{e&&r(!0)},[e]),d.useEffect(()=>{n&&t(!1)},[n,t]),d.useMemo(()=>[n,r],[n])}var Ir;(function(e){e[e.FOCUS=0]="FOCUS",e[e.SOURCES=1]="SOURCES",e[e.RECENCY=2]="RECENCY",e[e.PRO_MODEL_PREFERENCE=3]="PRO_MODEL_PREFERENCE",e[e.ATTACHMENTS=4]="ATTACHMENTS",e[e.SEARCH_MODEL_SELECTOR=5]="SEARCH_MODEL_SELECTOR",e[e.UNIFIED_SOURCES=6]="UNIFIED_SOURCES",e[e.SIDECAR_ATTACHMENTS=7]="SIDECAR_ATTACHMENTS"})(Ir||(Ir={}));function C8e({isSignedIn:e,tooltip:t,onSelect:n}){const{$t:r}=J(),s=l.jsx(Dt.Item,{leadingAccessory:B("paperclip"),disabled:!e,onSelect:n,children:r({defaultMessage:"File",id:"gyrIElu9qY"})});return t?l.jsx(Fo,{content:t,side:"right",children:s}):s}function S8e({onSelect:e}){const{$t:t}=J();return l.jsx(Dt.Item,{leadingAccessory:B("capture"),onSelect:e,children:t({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})})}function E8e({isFollowUp:e}){const{$t:t}=J(),{forceEnableBrowserAgent:n}=qr(),{setForceEnableBrowserAgent:r}=jo(),s=d.useCallback(()=>{r(!n)},[n,r]);return e?null:l.jsx(Fo,{content:t({defaultMessage:"Let Comet Assistant navigate and interact with websites",id:"Htf0TtbEpJ"}),side:"right",children:l.jsx(Dt.Item,{leadingAccessory:B("click"),onSelect:s,children:t({defaultMessage:"Browse for me",id:"E8hFVZyoUg"})})})}function k8e({isFollowUp:e}){const{$t:t}=J(),{forceEnableBrowserAgent:n}=qr(),{setForceEnableBrowserAgent:r}=jo(),[s,o]=d.useState(!1),a=d.useCallback(()=>{r(!1)},[r]),i=d.useCallback(()=>{o(!0)},[]),c=d.useCallback(()=>{o(!1)},[]);return!n||e?null:l.jsx("div",{onMouseEnter:i,onMouseLeave:c,children:l.jsx(st,{text:t({defaultMessage:"Browse for me",id:"E8hFVZyoUg"}),size:"small",variant:"subtle",onClick:a,icon:s?B("x"):B("click")})})}const uY=A.memo(({handleFileInput:e,onFilePickerOpen:t,screenshotToolEnabled:n=!1,isFollowUp:r=!1})=>{const{$t:s}=J(),{sidecarSourceTab:{url:o}}=Qn(),a=un(),i=d.useRef(null),{activeMenu:c}=qr(),{onActiveMenuChange:u}=jo(),f=Wt(),{uploadRateLimit:m}=Vn(),{hasActiveSubscription:p}=$t(),h=m??(p?wM:_M);d.useEffect(()=>{if(n)return a.subscribeScreenshotCaptured(C=>{e?.([C],"local")})},[a,e,n]);const g=d.useCallback(()=>{a.captureSourceTabScreenshotV2({sourceTabUrl:o})},[a,o]),y=d.useCallback(()=>{i.current?.click()},[]),x=c===Ir.SIDECAR_ATTACHMENTS,v=d.useCallback(()=>{u(Ir.SIDECAR_ATTACHMENTS),t?.()},[u,t]),b=d.useCallback(()=>{u(null)},[u]),_=d.useMemo(()=>{if(f){if(h!=null&&h>0&&h<=100)return s({defaultMessage:"{remaining} left today",id:"V9HtlcGCOC"},{remaining:h});if(mr(Hy))return s({defaultMessage:"Files are retained for 7 days",id:"HLjpKDpzE3"})}else return s({defaultMessage:"Sign in to attach files",id:"Ei6nUBg77Q"})},[s,f,h]),w=d.useMemo(()=>l.jsx(wt,{variant:"secondary",size:"small",icon:B("plus"),"aria-label":s({defaultMessage:"Add files or select tools",id:"iTP/u4WRPO"})}),[s]),S=d.useCallback(C=>{C?v():b()},[v,b]);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"hidden",children:l.jsx(cY,{isOpen:!1,fileType:"all",areFileAttachmentsAllowed:!0,handleFileInput:e,onFilePickerOpen:t,fileInputRef:i})}),l.jsxs(Dt,{triggerElement:w,align:"start",isOpen:x,onToggle:S,children:[l.jsx(C8e,{isSignedIn:f,tooltip:_,onSelect:y}),n&&l.jsx(S8e,{onSelect:g}),l.jsx(Dt.Separator,{}),l.jsx(E8e,{isFollowUp:r})]}),l.jsx(k8e,{isFollowUp:r})]})});uY.displayName="SidecarAttachmentsMenuButton";const vA=A.memo(({className:e,color:t})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:t||"currentColor",viewBox:"0 0 66 24",className:e,children:[l.jsx("path",{d:"M33.569 17.032a1.919 1.919 0 0 1-.799-1.593c0-1.277.935-1.982 2.857-2.157l4.956-.473v.134c0 .784-.127 1.492-.378 2.105a3.958 3.958 0 0 1-1.012 1.456c-.834.753-1.993 1.15-3.354 1.15-.94 0-1.724-.215-2.27-.622Z"}),l.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M60.756 1.398c1.886.991 3.382 2.457 4.443 4.353 1.03 1.813 1.55 3.918 1.55 6.257 0 2.339-.521 4.444-1.55 6.257a10.934 10.934 0 0 1-2.475 3.027l-7.77-9.445 5.845-7.145V3.92h-3.135l-.076.096-4.626 5.837h-.009l-4.626-5.837-.075-.096h-3.136v.782l5.847 7.146-5.847 7.145v.782h3.136l.075-.095 4.626-5.837h.01l7.214 9.087-.017.01c-1.293.703-1.948 1.06-3.755 1.06H.25V1.862C.25.834 1.085 0 2.113 0h52.932c2.063 0 3.985.482 5.711 1.398ZM27.842 19.773V9.272c0-1.69-.55-3.073-1.59-4.002-.954-.851-2.28-1.301-3.834-1.301-1.375 0-2.54.306-3.463.91-.62.407-1.137.946-1.572 1.642a.1.1 0 0 1-.175-.008 4.35 4.35 0 0 0-1.35-1.605c-.864-.624-1.97-.94-3.285-.94-2.436 0-3.62.89-4.327 1.824-.059.077-.181.038-.181-.06V4.32H5.063v15.452h3.09V10.71c0-1.377.358-2.442 1.064-3.166.65-.665 1.597-1.017 2.74-1.017.967 0 1.712.26 2.215.772.488.499.736 1.221.736 2.148v10.326h3.09V10.71c0-1.377.358-2.442 1.063-3.165.65-.666 1.597-1.018 2.74-1.018.967 0 1.712.26 2.215.773.489.498.736 1.221.736 2.148v10.325h3.09Zm15.8 0 .001-10.003c0-1.821-.64-3.32-1.85-4.334-1.146-.96-2.862-1.468-4.72-1.468-1.856 0-3.49.467-4.723 1.35-1.213.87-2.003 2.096-2.254 3.557-.057.331-.04.736-.04.736h3.008l.027-.22c.122-.963.521-1.708 1.185-2.213.669-.51 1.587-.768 2.738-.768s2.038.27 2.636.8c.619.55.933 1.391.933 2.502v.682l-5.356.507c-3.577.344-5.547 1.997-5.547 4.656 0 1.375.564 2.531 1.63 3.346 1.023.781 2.436 1.194 4.088 1.194 1.43 0 2.66-.304 3.656-.903a5.177 5.177 0 0 0 1.408-1.237c.059-.075.179-.033.179.063v1.753h3.002Z"})]}));vA.displayName="MaxBadge";const bA=A.memo(({className:e})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 51 24",className:e,children:[l.jsx("path",{d:"M35.069 7.954c-1.723 1.74-1.706 6.368 0 8.121 1.597 1.799 5.273 1.817 6.855 0 .873-.922 1.315-2.417 1.315-4.075 0-1.66-.442-3.144-1.317-4.048-1.584-1.853-5.256-1.834-6.853.002Z"}),l.jsx("path",{fillRule:"evenodd",d:"m48.958 5.715-.009-.015a10.792 10.792 0 0 0-4.387-4.301l-.01-.006C42.81.47 40.861 0 38.761 0H1.905C.866 0 .002.84 0 1.88V24h3.818V4.359h3.245v1.284c0 .132.161.196.252.1 2.987-3.275 9.077-2.319 11.216 1.723.725 1.234 1.092 2.759 1.092 4.534.102 4.584-3.017 8.265-7.55 8.235-2.031 0-3.629-.79-4.757-1.978a.146.146 0 0 0-.253.1V24h31.7c2.1 0 4.045-.468 5.78-1.39l.011-.005a10.795 10.795 0 0 0 4.394-4.302l.009-.016C49.98 16.483 50.5 14.368 50.5 12s-.52-4.482-1.543-6.285ZM30.112 7.42a24.93 24.93 0 0 1-.86-.003c-1.338-.02-2.845-.041-3.676.819-.549.54-.827 1.468-.827 2.759v8.809h-3.243V4.359h3.243v1.284c0 .148.194.202.271.077.314-.506.65-.852 1.012-1.05.616-.353 1.462-.532 2.514-.532h1.566V7.42Zm8.399 12.814c-4.77.033-8.068-3.395-7.973-8.235 0-1.716.348-3.21 1.033-4.442 2.714-5.062 11.157-5.068 13.852-.002.704 1.234 1.06 2.729 1.06 4.444.08 4.807-3.207 8.268-7.972 8.235Z",clipRule:"evenodd"}),l.jsx("path",{d:"M16.378 12c0 1.657-.442 3.153-1.314 4.075-1.583 1.816-5.26 1.798-6.857 0-1.706-1.753-1.722-6.381 0-8.121 1.597-1.836 5.27-1.855 6.854-.003.875.904 1.317 2.39 1.317 4.049Z"})]}));bA.displayName="ProBadge";const fy=A.memo(({isMax:e,className:t})=>e?l.jsx("div",{style:{"--mode-color":"oklch(var(--max-color))"},children:l.jsx(vA,{className:`text-max ${t||""}`})}):l.jsx("div",{style:{"--mode-color":"oklch(var(--super-color))"},children:l.jsx(bA,{className:`text-super ${t||""}`})}));fy.displayName="SearchModeBadge";function Wf(){const{isMax:e,isPro:t}=$t(),{isMaxUpsellEnabled:n}=$x(),{gpt4Limit:r,pplxAlphaLimit:s,pplxBetaLimit:o}=Vn();return d.useMemo(()=>i=>{let c=!1;return i===oe.RESEARCH?c=!r.available||!s.available:c=!r.available||!o.available,n&&!e&&t&&c&&(i===oe.RESEARCH||i===oe.STUDIO)},[n,e,t,r,s,o])}function hv(){const{gpt4Limit:e,pplxAlphaLimit:t,pplxBetaLimit:n}=Vn(),{specialCapabilities:r}=Yr(),s=Wt(),{hasAccessToProFeatures:o,isMax:a}=$t(),i=Wf(),{results:c}=on(),u=!r.unlimitedProSearch&&!e.available&&!o,f=!r.unlimitedResearch&&(!e.available||!t.available),m=!e.available||!n.available,{session:p}=Ne(),h=p?.user?.email??"",{isStudent:g}=CW({email:h,reason:"study-mode-access"}),y=d.useMemo(()=>c.some(x=>x.display_model===ie.STUDY),[c]);return d.useCallback(x=>{const v=an(x),b=v===oe.SEARCH&&![ie.DEFAULT,ie.PRO].includes(x);if(x===ie.DEFAULT)return!0;if(s)return an(x)===oe.STUDY&&!g&&!y?!1:a?!0:u||an(x)===oe.RESEARCH&&f||an(x)===oe.STUDIO&&m||i(v)?!1:!(!o&&b&&!r.unlimitedProSearch);{const _=r.unlimitedProSearch&&an(x)===oe.SEARCH&&!i(v),w=r.unlimitedResearch&&an(x)===oe.RESEARCH&&!i(v);return _||w}},[u,f,m,o,r.unlimitedProSearch,r.unlimitedResearch,s,i,a,g,y])}function vg(){const{$t:e}=J(),t=Wt(),{openVisitorLoginUpsell:n}=du({enabled:!t}),r=Wf(),s=hv(),o=ag(),{specialCapabilities:a}=Yr(),i=d.useCallback((u,f)=>{const m=an(u);if(u===ie.DEFAULT&&!f)return!1;const p=s(u)===!1||f;if(t)if(p){const h={[oe.SEARCH]:e({defaultMessage:"Want more {copilot}?",id:"Kf+JzdHL3c"},{copilot:"Pro Search"}),[oe.RESEARCH]:e({defaultMessage:"Want more Research?",id:"4cKm89wwuR"}),[oe.STUDIO]:e({defaultMessage:"Try Perplexity Labs",id:"y2BN7EwBoA"}),[oe.STUDY]:e({defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"})},g={[oe.SEARCH]:e({defaultMessage:"With {pplx} {pro}, get as many as you want",id:"jRMiP6Ut4n"},{pplx:"Perplexity",pro:"Pro"}),[oe.RESEARCH]:r(m)?e({defaultMessage:"Upgrade to Max for enhanced access to Perplexity Research.",id:"7fqjw8mo2u"}):e({defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"}),[oe.STUDIO]:r(m)?e({defaultMessage:"Upgrade to Max for enhanced access to Perplexity Labs.",id:"vETcCWwvBb"}):e({defaultMessage:"Exclusive access for subscribers",id:"1LB4QwRSMw"}),[oe.STUDY]:e({defaultMessage:"Ask questions and learn",id:"8RzCMAs2/c"})},y=h[m??oe.SEARCH],x=g[m??oe.SEARCH],b={[oe.SEARCH]:ft.TRY_COPILOT,[oe.RESEARCH]:ft.TRY_RESEARCH,[oe.STUDIO]:ft.TRY_LABS}[m??oe.SEARCH]??ft.TRY_COPILOT;return o({pitchMessage:{title:y,description:x},origin:b}),!0}else return!1;else{if(u===ie.PRO&&a.unlimitedProSearch)return!1;const h={[oe.SEARCH]:e({defaultMessage:"Sign in to access Pro Search",id:"AARKXJYL5U"}),[oe.RESEARCH]:e({defaultMessage:"Sign in to access Perplexity Research",id:"D/01NxLK/G"}),[oe.STUDIO]:e({defaultMessage:"Sign in to try Perplexity Labs",id:"xJYMyIruMK"}),[oe.STUDY]:e({defaultMessage:"Sign in to access Perplexity Learn",id:"K0eM+R/Zew"})},g={[oe.SEARCH]:e({defaultMessage:"10x as many citations in answers",id:"D0fULpN8/D"}),[oe.RESEARCH]:e({defaultMessage:"Deep research and analysis on any topic",id:"vZzVhXmhZo"}),[oe.STUDIO]:e({defaultMessage:"Create projects from scratch, exclusive access for subscribers",id:"STPFx+8/sC"}),[oe.STUDY]:e({defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"})},y=h[m??oe.SEARCH],x=g[m??oe.SEARCH];return n({title:y,description:x,origin:ft.TRY_PRO}),!0}},[e,s,t,o,n,r,a.unlimitedProSearch]),c=d.useCallback(u=>s(u)?!1:(t?o({pitchMessage:{title:e({defaultMessage:"Choose a model",id:"fXlc3idTcy"}),description:e({defaultMessage:"With Perplexity Pro, you get access to all the latest AI models in one subscription",id:"gqUZUJex7f"})},origin:ft.MODEL_SELECTOR}):n({title:e({defaultMessage:"Sign in to choose a model",id:"BhbQUiYsTB"}),description:e({defaultMessage:"Access the latest AI models from Perplexity, OpenAI, Anthropic (Claude), Google Gemini and more",id:"DDVABeGeBG"}),origin:ft.MODEL_SELECTOR}),!0),[s,t,o,n,e]);return d.useMemo(()=>({gateSearchModeSelection:i,gateSearchModelSelection:c}),[i,c])}const M8e=()=>{const{gpt4Limit:e}=Vn(),{specialCapabilities:t}=Yr(),{hasAccessToProFeatures:n}=$t();return d.useCallback(()=>!t.unlimitedProSearch&&(!e.available||!n)?ie.DEFAULT:ie.PRO,[e,n,t.unlimitedProSearch])};function T8e(){const e=Vo(),{setPreferredSearchModel:t}=Hx(),{setConfiguredModel:n,setConfiguredSearchMode:r}=Vn(),{gateSearchModelSelection:s}=vg(),o=M8e();return d.useCallback((a=o(),i=e)=>{s(a)||(t(i,a),n(a),r(i))},[e,s,o,t,n,r])}function bg(){const e=T8e(),{device:{isWindowsApp:t}}=sn(),{safeWindowsIpcPublish:n,safeWindowsIpcSubscribe:r}=Xh(),s=d.useRef(e);d.useEffect(()=>{s.current=e},[e]);const o=d.useRef(r);return d.useEffect(()=>{o.current=r},[r]),d.useEffect(()=>{if(!t)return;const i=o.current(nd,c=>{c.type===nd&&s.current(c.model,c.searchMode)});return()=>{i?.()}},[t]),d.useCallback((i,c)=>{n(nd,{type:nd,model:i,searchMode:c}),s.current(i,c)},[n])}function Sp(e){if(e.exactCount!==void 0&&e.exactCount>=0&&e.exactCount<=10)return e.exactCount}function Ai(e){switch(e){case oe.SEARCH:return ie.PRO;case oe.RESEARCH:return ie.ALPHA;case oe.STUDIO:return ie.BETA;case oe.STUDY:return ie.STUDY;default:return ie.PRO}}const dY=A.memo(e=>{const{isFollowUp:t,value:n,onChange:r,buttonSize:s="small",variant:o="primaryGhost"}=e,a=Wf(),{$t:i}=J(),c=bg(),u=Vo(),f=d.useMemo(()=>n!==void 0?an(n):u,[n,u]),{isMax:m,hasAccessToProFeatures:p}=$t(),h=Wt(),{gpt4Limit:g,pplxAlphaLimit:y,pplxBetaLimit:x}=Vn(),{specialCapabilities:v}=Yr(),{preferredSearchModels:b,setPreferredSearchModel:_}=Hx(),w=ui(),S=hv(),{isMaxUpsellEnabled:C}=$x(),[E,T]=d.useState(()=>{const F=b[oe.SEARCH];return v.unlimitedProSearch?!0:F===ie.DEFAULT?!1:h});E&&!g.available&&!v.unlimitedProSearch&&T(!1);const{gateSearchModeSelection:k}=vg(),I=d.useCallback(()=>{k(ie.BETA,!0)},[k]),M=d.useCallback(F=>k(F?ie.PRO:ie.DEFAULT)?(T(!1),_(oe.SEARCH,ie.DEFAULT),!1):(T(F),_(oe.SEARCH,F?ie.PRO:ie.DEFAULT),F),[_,k]),N=d.useCallback(F=>{let R;switch(F){case oe.SEARCH:{E?R=b[F]??Ai(F):R=ie.DEFAULT;break}case oe.RESEARCH:{C?R=b[F]??Ai(F):R=Ai(F);break}case oe.STUDIO:{C?R=b[F]??Ai(F):R=Ai(F);break}default:{R=ie.DEFAULT;break}}if(!S(R)){k(R);return}r?r(R):c(R,F)},[C,E,r,b,c,S,k]),D=d.useMemo(()=>{const F=Sp(g),R=Sp(y),P=Sp(x);function L(O,$){return{active:f===O,description:i(Nr[O].description),icon:t3(O),onClick(){N(O)},text:i(Nr[O].name),type:"default",...$}}const U=[];return U.push(L(oe.SEARCH,{customDescriptionNode:p?void 0:l.jsxs(l.Fragment,{children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(je,{...Nr[oe.SEARCH].description})}),l.jsxs("div",{className:"gap-md flex flex-col",children:[l.jsx("hr",{className:"border-subtler bg-subtler -mr-5 mt-3"}),l.jsxs("div",{className:"gap-sm -mr-5 flex items-start justify-between",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx("button",{onClick:()=>{k(v.unlimitedProSearch?ie.PRO:ie.SONAR)},type:"button",children:l.jsx(V,{className:"font-medium underline",color:"super",variant:"tiny",children:l.jsx(je,{defaultMessage:"Try Pro Search",id:"akAejIEhqZ"})})}),l.jsx(fy,{isMax:m,className:"h-2.5"})]}),l.jsx(V,{className:"italic",color:"super",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"Advanced search with 10x the sources",id:"MZLTMODV37"})}),h&&F!==void 0&&!m&&l.jsx(V,{className:"mt-1 font-light",color:"super",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:F}})})]}),l.jsx(fY,{isProSearchEnabled:E,selectSearchModel:c,selectedSearchMode:f,setIsProSearchEnabled:M})]})]})]}),customTextNode:l.jsx(V,{variant:"smallBold",children:l.jsx(je,{...Nr[oe.SEARCH].name})})})),U.push(L(oe.RESEARCH,{customTextNode:l.jsxs("div",{className:"gap-sm mt-px flex items-center",children:[l.jsx(V,{variant:"smallBold",children:l.jsx(je,{...Nr[oe.RESEARCH].name})}),l.jsx(fy,{isMax:m||a(oe.RESEARCH),className:"h-2.5"})]}),customDescriptionNode:l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(je,{...Nr[oe.RESEARCH].description})}),h&&R!==void 0&&!m&&l.jsxs("div",{children:[l.jsx(V,{color:"super",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:R}})}),a(oe.RESEARCH)&&l.jsx(Ge,{onClick:I,variant:"common",size:"small",fullWidth:!0,extraCSS:"mt-sm",text:i({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})})]})]})})),U.push(L(oe.STUDIO,{customTextNode:l.jsxs("div",{className:"gap-sm mt-px flex items-center",children:[l.jsx(V,{variant:"smallBold",children:l.jsx(je,{...Nr[oe.STUDIO].name})}),l.jsx(fy,{isMax:m||a(oe.STUDIO),className:"h-2.5"})]}),customDescriptionNode:l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(je,{...Nr[oe.STUDIO].description})}),h&&P!==void 0&&!m&&l.jsxs("div",{children:[l.jsx(V,{color:"max",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining this month} other {# queries remaining this month}}",id:"wlPH+sOjjI",values:{limit:P}})}),a(oe.STUDIO)&&l.jsx(Ge,{onClick:I,variant:"common",size:"small",fullWidth:!0,extraCSS:"mt-sm",text:i({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})})]})]})})),U},[p,m,h,g,E,c,f,M,y,a,I,i,x,N,k,v.unlimitedProSearch]),j=d.useMemo(()=>l.jsx(ge,{icon:B("chevron-down"),size:"xs",className:z("-mx-xs -mb-two opacity-50",{"-ml-sm":t})}),[t]);return l.jsx(zs,{isMobileStyle:w,items:D,placement:"bottom-start",children:l.jsx(Ge,{icon:t3(f),size:s,text:t?l.jsx(l.Fragment,{children:"​"}):i(Nr[f].name),variant:o,trailingComponent:j})})});dY.displayName="SearchModeDropdownMenu";const fY=A.memo(({isProSearchEnabled:e,selectSearchModel:t,selectedSearchMode:n,setIsProSearchEnabled:r})=>{const{$t:s}=J(),o=d.useCallback(i=>{r(i)&&n===oe.SEARCH&&t(i?ie.PRO:ie.DEFAULT)},[t,n,r]),a=d.useMemo(()=>({onClick(i){i.stopPropagation()}}),[]);return l.jsx(fg,{checked:e,onCheckedChange:o,"aria-label":s({defaultMessage:"Enable Pro Search",id:"4oWk17uURl"}),...a})});fY.displayName="SwitchFactory";function aj(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function ti({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const s=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=d.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),i=d.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),c=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,f=d.useRef(!1);d.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[m,p,h]=d.useMemo(()=>{const v=()=>{if(!i.current.element)return;const{left:b,top:_,width:w,height:S,bottom:C,right:E,x:T,y:k}=i.current.element.getBoundingClientRect(),I={left:b,top:_,width:w,height:S,bottom:C,right:E,x:T,y:k};i.current.element instanceof HTMLElement&&r&&(I.height=i.current.element.offsetHeight,I.width=i.current.element.offsetWidth),Object.freeze(I),f.current&&!D8e(i.current.lastBounds,I)&&a(i.current.lastBounds=I)};return[v,u?aj(v,u):v,c?aj(v,c):v]},[a,r,c,u]);function g(){i.current.scrollContainers&&(i.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",h,!0)),i.current.scrollContainers=null),i.current.resizeObserver&&(i.current.resizeObserver.disconnect(),i.current.resizeObserver=null),i.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",i.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",i.current.orientationHandler))}function y(){i.current.element&&(i.current.resizeObserver=new s(h),i.current.resizeObserver.observe(i.current.element),t&&i.current.scrollContainers&&i.current.scrollContainers.forEach(v=>v.addEventListener("scroll",h,{capture:!0,passive:!0})),i.current.orientationHandler=()=>{h()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",i.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",i.current.orientationHandler))}const x=v=>{!v||v===i.current.element||(g(),i.current.element=v,i.current.scrollContainers=mY(v),y())};return N8e(h,!!t),A8e(p),d.useEffect(()=>{g(),y()},[t,h,p]),d.useEffect(()=>g,[]),[x,o,m]}function A8e(e){d.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function N8e(e,t){d.useEffect(()=>{if(t){const n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[e,t])}function mY(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:s}=window.getComputedStyle(e);return[n,r,s].some(o=>o==="auto"||o==="scroll")&&t.push(e),[...t,...mY(e.parentElement)]}const R8e=["x","y","top","bottom","left","right","width","height"],D8e=(e,t)=>R8e.every(n=>e[n]===t[n]),Qd=[.4,0,.2,1],ij=10,pY=A.memo(e=>{const{children:t,tooltipContent:n,triggeredSearchModeElement:r,isOpen:s,setIsOpen:o}=e,{showSuggestDropdown:a}=qr(),[i,c]=d.useState(!1),u=s!==void 0?s:i,f=o||c,m=d.useRef(0),[p,h]=ti(),[g,y]=ti(),v=d.useCallback(()=>{const{left:E=0,width:T=0}=r?.getBoundingClientRect()??{};return h.width===0||E===0?0:E-h.left+T/2-ij/2},[h,r])();let b=v!==0;v!==0&&v!==m.current&&(b=m.current!==0,m.current=v);const _=d.useCallback(E=>{E||(m.current=0),f(E)},[f]),w=d.useCallback(E=>{E.preventDefault()},[]),S=d.useCallback(()=>{f(!1)},[f]),C=d.useCallback(E=>{E.preventDefault()},[]);return l.jsx(Mme,{delayDuration:a?1e3:400,skipDelayDuration:100,children:l.jsxs(LU,{onOpenChange:_,open:u,children:[l.jsx(Tme,{asChild:!0,className:"focus:outline-none",onBlur:S,onClick:w,onPointerDown:C,children:t}),l.jsx(Ame,{children:l.jsx(Nme,{className:"group/tooltip-content data-[state=closed]:animate-slideDownAndFadeOut data-[state=delayed-open]:animate-slideUpAndFadeIn ease-outExpo duration-300","data-color-scheme":"dark",sideOffset:4,side:"bottom",ref:p,children:l.jsxs(Te.div,{className:"bg-base shadow-overlay flex w-72 flex-col rounded-lg",animate:{height:y.height||void 0},transition:{duration:.05,ease:Qd},children:[l.jsxs(Te.div,{className:'absolute left-0 group-data-[side="bottom"]/tooltip-content:top-0 group-data-[side="top"]/tooltip-content:bottom-0',animate:{opacity:m.current?1:void 0,x:b?v:void 0},initial:{opacity:0},transition:{duration:.05,ease:Qd},style:{x:v,width:ij},children:[l.jsx(y7,{className:"fill-inverse"}),l.jsx(y7,{className:"fill-inverse -translate-y-px scale-[99%]"})]}),l.jsx("div",{className:"relative overflow-hidden",children:l.jsx("div",{className:"whitespace-normal",ref:g,children:n})})]})})})]})})});pY.displayName="SearchModeTooltip";const hY={[oe.SEARCH]:ie.DEFAULT,[oe.RESEARCH]:ie.ALPHA,[oe.STUDIO]:ie.BETA,[oe.STUDY]:ie.DEFAULT},gv=A.memo(e=>{const{children:t,className:n,searchMode:r,...s}=e,{gateSearchModeSelection:o}=vg();return l.jsx("button",{className:z("group",n),onClick:()=>{o(hY[r],!0)},type:"button",...s,children:l.jsx(V,{className:"!text-[var(--mode-color)] underline decoration-transparent transition-[text-decoration-color] group-hover:decoration-[var(--mode-color)]",variant:"smallBold",children:t})})});gv.displayName="SearchModeTooltipUpgradeButton";const yv=A.memo(e=>{const{badgeNode:t,color:n,enabledText:r,isEnabled:s,upgradeButton:o,isMaxUpsell:a=!1}=e;return l.jsxs("div",{className:"gap-sm flex items-center",style:{"--mode-color":n==="super"?"oklch(var(--super-color))":"oklch(var(--max-color))"},children:[t,s?l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(V,{className:"!text-[var(--mode-color)]",variant:"smallBold",children:r}),!a&&l.jsx(ut,{name:B("check"),className:"text-[var(--mode-color)]",size:18})]}):l.jsx(l.Fragment,{children:o})]})});yv.displayName="SearchModeTooltipFooter";const gY=A.memo(e=>{const{searchMode:t}=e,{$t:n}=J(),r=Wt(),{hasAccessToProFeatures:s}=$t(),{gateSearchModeSelection:o}=vg(),a=Wf(),{specialCapabilities:i}=Yr(),c=d.useCallback(()=>{o(hY[t],!0)},[o,t]);return a(t)?l.jsx(Ge,{onClick:c,variant:"maxGold",size:"small",fullWidth:!0,text:n({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})}):i.unlimitedProSearch||i.unlimitedResearch||r&&s||t===oe.STUDY?null:l.jsx(Ge,{onClick:c,variant:"primary",size:"small",fullWidth:!0,testId:"upgrade-to-pro-button",text:r?l.jsx(je,{defaultMessage:"Upgrade to Pro",id:"5N04mo7WNC"}):l.jsx(je,{defaultMessage:"Sign in for access",id:"w6mjA9GP58"})})});gY.displayName="SearchModeTooltipUpsellButton";const _g=A.memo(e=>{const{footerNode:t,includeNewBadge:n,searchMode:r}=e,{$t:s}=J();return l.jsxs("div",{className:"p-md flex flex-col gap-4",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs("div",{className:"relative",children:[l.jsx(V,{className:"text-box-trim-both",variant:"smallExtraBold",children:s(Nr[r].name)}),n&&l.jsx(K,{className:"absolute -right-1 -top-1 rounded-md px-2 py-1",variant:"subtle",children:l.jsx(V,{variant:"tiny",children:l.jsx(je,{defaultMessage:"New",id:"bW7B87wFFp"})})})]}),l.jsx(V,{variant:"small",className:"text-pretty",children:s(Nr[r].description)})]}),l.jsx("hr",{className:"border-subtler bg-subtler"}),l.jsx("div",{className:"gap-xs flex flex-col",children:t}),l.jsx(gY,{searchMode:r})]})});_g.displayName="SearchModeTooltipContentContainer";const xv=A.memo(({isMaxUpsell:e=!1})=>{const{isMax:t,isPro:n}=$t();return t||e?l.jsx(vA,{className:"text-max h-3"}):n?l.jsx(bA,{className:"text-super h-3"}):null});xv.displayName="SearchModeBadge";const _A=({isMax:e,isPro:t,isMaxUpsell:n=!1})=>e||n?"max":"super",yY=A.memo(e=>{const{isToggleActive:t,onToggleChange:n}=e,{$t:r}=J(),s=Wt(),{hasAccessToProFeatures:o,isMax:a,isPro:i}=$t(),{gpt4Limit:c}=Vn(),{specialCapabilities:u,isGovernmentRequestOrigin:f}=Yr(),m=(()=>{if(!s&&!u.unlimitedProSearch)return null;if(o||u.unlimitedProSearch)return f?l.jsx(je,{defaultMessage:"Unlimited access for government",id:"0JftsQv9MC"}):l.jsx(je,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"});const v=Sp(c);return v!==void 0?l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:v}}):null})(),p=d.useMemo(()=>l.jsx(xv,{}),[]),h=d.useMemo(()=>({onClick(v){v.stopPropagation()}}),[]),g=d.useMemo(()=>l.jsx(gv,{searchMode:oe.SEARCH,children:l.jsx(je,{defaultMessage:"Try Pro Search",id:"akAejIEhqZ"})}),[]),y=d.useMemo(()=>l.jsx(je,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[]),x=d.useMemo(()=>l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:"gap-xs flex w-full flex-col",children:[l.jsx(yv,{badgeNode:p,color:_A({isMax:a,isPro:i}),enabledText:y,isEnabled:o||u.unlimitedProSearch,upgradeButton:g}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(je,{defaultMessage:"Advanced search with 10x the sources; powered by top models",id:"IKFeqUH+w0"})}),m&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:m})]}),!o&&!u.unlimitedProSearch&&n&&l.jsx(fg,{checked:t,onCheckedChange:n,"aria-label":r({defaultMessage:"Enable Pro Search",id:"4oWk17uURl"}),...h})]}),[p,a,i,y,o,u.unlimitedProSearch,g,m,n,t,r,h]);return l.jsx(_g,{footerNode:x,searchMode:oe.SEARCH})});yY.displayName="ProSearchModeTooltip";const xY=A.memo(()=>{const e=Wt(),{hasAccessToProFeatures:t,isMax:n,isPro:r}=$t(),{gpt4Limit:s,pplxAlphaLimit:o}=Vn(),{specialCapabilities:a,isGovernmentRequestOrigin:i}=Yr(),c=Wf(),u=c(oe.RESEARCH),f=(()=>{if(!e&&!a.unlimitedResearch)return null;const y=s.exactCount!==void 0&&o.exactCount!==void 0?Math.min(s.exactCount,o.exactCount):void 0;if(y!==void 0&&y<0||c(oe.RESEARCH))return null;if(a.unlimitedResearch&&i)return l.jsx(je,{defaultMessage:"Unlimited access for government",id:"0JftsQv9MC"});if(n)return l.jsx(je,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"});const x=Sp(o);return x!==void 0?l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:x}}):l.jsx(je,{defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"})})(),m=d.useMemo(()=>l.jsx(xv,{isMaxUpsell:u}),[u]),p=d.useMemo(()=>u?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[u]),h=d.useMemo(()=>l.jsx(gv,{searchMode:oe.RESEARCH,children:e?u?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"}):l.jsx(je,{defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"})}),[e,u]),g=d.useMemo(()=>l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(yv,{badgeNode:m,color:_A({isMax:n,isPro:r,isMaxUpsell:u}),enabledText:p,isEnabled:t||a.unlimitedResearch,upgradeButton:h,isMaxUpsell:u}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(je,{defaultMessage:"In-depth reports with more sources, charts, and advanced reasoning",id:"9V0OqZ9HGl"})}),f&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:f})]}),[m,p,t,n,r,u,f,h,a.unlimitedResearch]);return l.jsx(_g,{footerNode:g,searchMode:oe.RESEARCH})});xY.displayName="ResearchModeTooltip";const vY=A.memo(()=>{const e=Wt(),{hasAccessToProFeatures:t,isMax:n,isPro:r}=$t(),{pplxBetaLimit:s}=Vn(),o=Wf(),a=o(oe.STUDIO),i=e?t?!s.available||o(oe.STUDIO)?null:n?l.jsx(je,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"}):s.exactCount?l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining this month} other {# queries remaining this month}}",id:"wlPH+sOjjI",values:{limit:s.exactCount}}):null:l.jsx(je,{defaultMessage:"Upgrade to get access",id:"eRbSgHbjUP"}):null,c=d.useMemo(()=>l.jsx(xv,{isMaxUpsell:a}),[a]),u=d.useMemo(()=>a?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[a]),f=d.useMemo(()=>l.jsx(gv,{searchMode:oe.STUDIO,children:e?a?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Access for subscribers only",id:"Ez3b/pzas/"}):l.jsx(je,{defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"})}),[e,a]),m=d.useMemo(()=>l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(yv,{badgeNode:c,color:_A({isMax:n,isPro:r,isMaxUpsell:a}),enabledText:u,isEnabled:t,upgradeButton:f,isMaxUpsell:a}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:a?l.jsx(je,{defaultMessage:"Draft, design, deliver your ideas.",id:"I1aIhz4l3D"}):l.jsx(je,{defaultMessage:"Turn your ideas into completed docs, slides, dashboards, and more",id:"WRu1tcOhoj"})}),i&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:i})]}),[c,u,t,n,r,a,i,f]);return l.jsx(_g,{footerNode:m,searchMode:oe.STUDIO,includeNewBadge:!0})});vY.displayName="StudioModeTooltip";const bY=A.memo(()=>{const e=A.useMemo(()=>l.jsx("div",{children:l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(je,{defaultMessage:"Interactive learning and study tools that guide you toward deeper understanding beyond quick answers. ",id:"ZRKKxSc+oV"})})}),[]);return l.jsx(_g,{footerNode:e,searchMode:oe.STUDY,includeNewBadge:!0})});bY.displayName="StudyModeTooltip";const _Y=()=>{const{base:e}=Rn(),t=On();return t===(e||"/")||t?.startsWith("/welcome")||t?.startsWith("/finance")};var wA="Radio",[j8e,wY]=Vs(wA),[I8e,P8e]=j8e(wA),CY=d.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:o,disabled:a,value:i="on",onCheck:c,form:u,...f}=e,[m,p]=d.useState(null),h=Sn(t,x=>p(x)),g=d.useRef(!1),y=m?u||!!m.closest("form"):!0;return l.jsxs(I8e,{scope:n,checked:s,disabled:a,children:[l.jsx(Et.button,{type:"button",role:"radio","aria-checked":s,"data-state":MY(s),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:h,onClick:rt(e.onClick,x=>{s||c?.(),y&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),y&&l.jsx(kY,{control:m,bubbles:!g.current,name:r,value:i,checked:s,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});CY.displayName=wA;var SY="RadioIndicator",EY=d.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,o=P8e(SY,n);return l.jsx(Hr,{present:r||o.checked,children:l.jsx(Et.span,{"data-state":MY(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});EY.displayName=SY;var O8e="RadioBubbleInput",kY=d.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),i=Sn(a,o),c=fT(n),u=uM(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),l.jsx(Et.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kY.displayName=O8e;function MY(e){return e?"checked":"unchecked"}var L8e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vv="RadioGroup",[F8e]=Vs(vv,[Jl,wY]),TY=Jl(),AY=wY(),[B8e,U8e]=F8e(vv),NY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:o,required:a=!1,disabled:i=!1,orientation:c,dir:u,loop:f=!0,onValueChange:m,...p}=e,h=TY(n),g=Pf(u),[y,x]=fo({prop:o,defaultProp:s??null,onChange:m,caller:vv});return l.jsx(B8e,{scope:n,name:r,required:a,disabled:i,value:y,onValueChange:x,children:l.jsx(Zx,{asChild:!0,...h,orientation:c,dir:g,loop:f,children:l.jsx(Et.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:g,...p,ref:t})})})});NY.displayName=vv;var RY="RadioGroupItem",DY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,o=U8e(RY,n),a=o.disabled||r,i=TY(n),c=AY(n),u=d.useRef(null),f=Sn(t,u),m=o.value===s.value,p=d.useRef(!1);return d.useEffect(()=>{const h=y=>{L8e.includes(y.key)&&(p.current=!0)},g=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),l.jsx(Jx,{asChild:!0,...i,focusable:!a,active:m,children:l.jsx(CY,{disabled:a,required:o.required,checked:m,...c,...s,name:o.name,ref:f,onCheck:()=>o.onValueChange(s.value),onKeyDown:rt(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:rt(s.onFocus,()=>{p.current&&u.current?.click()})})})});DY.displayName=RY;var V8e="RadioGroupIndicator",jY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=AY(n);return l.jsx(EY,{...s,...r,ref:t})});jY.displayName=V8e;const H8e=e=>{const t=mr(e);if(!t)return 0;const n=parseInt(t);return isNaN(n)?1:n},lj=(e,t)=>{lo(e,t.toString(),{expires:365})},z8e=({cueKey:e,impressionsLimit:t,enabled:n})=>{const[r,s]=d.useState(!1),[o,a]=d.useState(0);d.useEffect(()=>{if(!n){s(!1);return}const c=H8e(e);a(c),c{lj(e,t),a(t),s(!1)},[e,t]);return d.useMemo(()=>({shouldShow:r,currentCount:o,setReachedImpressions:i}),[r,o,i])},W8e={xs:"px-xs py-xxs",sm:"px-sm py-xs"},G8e=e=>{switch(e){case"common":return{background:"dark bg-base",titleText:"!text-light font-semibold",subtitleText:"!text-light mt-xxs opacity-90",arrow:"dark fill-base [&>path]:stroke-subtler dark:[&>path]:stroke-1 [clip-path:inset(1px_1px_0px_1px)]",borderRadius:"rounded-md"};default:return{background:"!bg-super !shadow-none",titleText:"!text-inverse",subtitleText:"!text-inverse mt-xs opacity-90",arrow:"fill-super",borderRadius:"rounded-md"}}},bv=A.memo(({cueKey:e,title:t,subtitle:n,children:r,enabled:s,impressionsLimit:o=1,variant:a="primary",size:i="xs",placement:c="bottom",sideOffset:u=10,className:f})=>{const[m,p]=d.useState(!1),{shouldShow:h}=z8e({cueKey:e,impressionsLimit:o,enabled:s}),g=G8e(a),y=h&&!m,x=()=>!t&&!n?null:l.jsxs("div",{className:z(W8e[i],f),children:[t&&l.jsx(V,{variant:"tiny",className:g.titleText,children:t}),n&&l.jsx(V,{variant:"tiny",className:g.subtitleText,children:n})]}),v=d.useCallback(()=>{p(!0)},[]),b=d.useMemo(()=>({removeScroll:!1,animationClassName:"z-[2000]"}),[]);return l.jsx(Vf,{content:x(),contentClassName:g.background,arrowClassName:g.arrow,borderRadius:g.borderRadius,isOpen:s&&y,onClose:v,placement:c,sideOffset:u,overlayProps:b,children:r})});bv.displayName="Cue";const CA=A.memo(e=>{const{className:t="",layoutKey:n="",options:r,value:s,backgroundClassName:o="",radioGroupIndicatorClassName:a="",variant:i="default",areCuesEnabled:c=!1,...u}=e,f=(()=>{switch(i){case"subtle":return"";case"default":return"bg-white dark:bg-black dark:bg-gradient-to-b dark:from-super/20 dark:to-super/20";default:At(i)}})(),{$t:m}=J(),p=d.useMemo(()=>({study:m({defaultMessage:"Learn Mode",id:"vuxvUxbYvn"})}),[m]),h=d.useMemo(()=>r.map(y=>{const x=y.value===s;return l.jsx(bv,{cueKey:`segmented-control-${y.value}`,enabled:!!p[y.value]&&c,placement:"top",title:p[y.value],children:l.jsxs(DY,{...y.elementProps,"aria-label":y.label,disabled:y.disabled??void 0,className:"segmented-control group/segmented-control relative focus:outline-none",value:y.value,children:[x&&l.jsx(jY,{asChild:!0,className:z("pointer-events-none absolute inset-0 z-0 block",f,"border-super dark:border-super/30 border","rounded-lg","shadow-super/30 dark:shadow-super/5 shadow-[0_1px_3px_0]","dark:text-super","transition-colors duration-300","group-focus-visible/segmented-control:border-dashed",a),children:l.jsx(Te.div,{layoutId:`segmented-control-active-indicator-${n}`,transition:{duration:.1}})}),y.children]})},y.value)}),[r,s,p,c,f,a,n]),g=(()=>{switch(i){case"subtle":return"bg-subtle";case"default":return"bg-super/10 dark:bg-black/[0.18]";default:At(i)}})();return l.jsxs(NY,{...u,className:z("group relative isolate flex h-fit",t),value:s,children:[l.jsx("div",{className:z("absolute inset-0",g,"dark:border dark:border-black/[0.04]","rounded-[10px]","transition-colors duration-300",o)}),l.jsx("div",{className:"p-two flex shrink-0 items-center",children:h})]})});CA.displayName="SegmentedControl";const SA=A.memo(e=>{const{className:t="",isActiveOption:n,icon:r,label:s,activeColor:o="text-super"}=e,a=z("transition-colors duration-300",{[o]:n,"text-quiet group-hover/segmented-control:text-foreground":!n});return l.jsxs("div",{className:z("relative z-10 flex h-8 min-w-9 items-center justify-center",{"py-xs gap-xs px-2.5":n||s},t),children:[r&&l.jsx(gp,{buttonSize:"small",icon:r,iconClassName:z(a),showClicked:!1}),s&&l.jsx("div",{className:z("px-two font-sans text-sm leading-[1.125rem]",a),children:s})]})});SA.displayName="SegmentedControlOption";const IY=A.memo(e=>{const{isFollowUp:t,layoutKey:n,value:r,onChange:s,className:o,variant:a}=e,i=Vo(),c=d.useMemo(()=>r!==void 0?an(r):i,[r,i]),{$t:u}=J(),f=bg(),m=On(),{inputRef:p}=qr(),{gpt4Limit:h}=Vn(),{specialCapabilities:g}=Yr(),y=_Y(),x=sW(),{currentOpenedModal:v}=pn().legacy,{preferredSearchModels:b,setPreferredSearchModel:_}=Hx(),[w,S]=d.useState(oe.SEARCH),C=d.useRef(null),[E,T]=d.useState(!1),k=d.useRef(null);d.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const{gateSearchModeSelection:I}=vg(),[M,N]=d.useState(!1);d.useEffect(()=>{if(!h.available&&!g.unlimitedProSearch)N(!1);else if(g.unlimitedProSearch)N(!0);else if(h.available){const G=b[oe.SEARCH];G&&G!==ie.DEFAULT&&N(!0)}},[h.available,g.unlimitedProSearch,b]);const D=d.useCallback(G=>I(G?ie.PRO:ie.DEFAULT)?(N(!1),_(oe.SEARCH,ie.DEFAULT),!1):(N(G),_(oe.SEARCH,G?ie.PRO:ie.DEFAULT),G),[_,I]),j=d.useCallback(G=>{switch(G){case oe.SEARCH:return M?b[G]??Ai(G):ie.DEFAULT;case oe.RESEARCH:return b[G]??Ai(G);case oe.STUDIO:return b[G]??Ai(G);case oe.STUDY:return ie.STUDY}},[M,b]),F=hv(),R=F(ie.STUDY),P=d.useCallback(G=>{const H=j(G);F(H)?(s?s(H):f(H,G),p.current?.focus(),T(!1)):I(H)},[F,I,j,p,s,f,T]),L=d.useCallback(G=>{if(D(G),c===oe.SEARCH){const H=G?ie.PRO:ie.DEFAULT;s?s(H):f(H)}},[s,f,c,D]),U=d.useMemo(()=>{const G=R?uR:uR.filter(Q=>Q!==oe.STUDY);function H(Q){const{searchMode:Y}=Q,te=j(Y),se=G.length<3&&!t;return{children:l.jsx("div",{children:l.jsx(SA,{label:se?l.jsx(je,{...Nr[Y].name}):void 0,icon:t3(Y),isActiveOption:c===Y})}),elementProps:{"aria-label":u(Nr[Y].name),"aria-disabled":F(te)===!1?!0:void 0,onPointerEnter(ae){k.current&&clearTimeout(k.current),C.current=ae.currentTarget,S(Y),k.current=setTimeout(()=>{T(!0)},800)},onPointerLeave(){k.current&&(clearTimeout(k.current),k.current=null)},onClick(){k.current&&(clearTimeout(k.current),k.current=null),p.current?.focus(),T(!1)}},label:u(Nr[Y].name),value:Y}}return G.map(Q=>H({searchMode:Q}))},[j,t,u,c,F,p,R]);let O;switch(w){case oe.SEARCH:{O=l.jsx(yY,{isToggleActive:M,onToggleChange:L});break}case oe.RESEARCH:{O=l.jsx(xY,{});break}case oe.STUDIO:{O=l.jsx(vY,{});break}case oe.STUDY:{O=l.jsx(bY,{});break}}const $=d.useCallback(G=>{G.target.tagName===document.activeElement?.tagName&&(C.current=G.target,S(c),T(!0))},[c]);return l.jsx(pY,{tooltipContent:O,triggeredSearchModeElement:C.current,isOpen:E,setIsOpen:T,children:l.jsx(CA,{layoutKey:`segmented-search-mode-selector_${n??m}`,options:U,onFocus:$,onValueChange:P,value:c,className:o,variant:a,areCuesEnabled:y&&!x&&!v})})});IY.displayName="SegmentedSearchModeSelector";const PY="(pointer: coarse)";function cj(){return typeof window>"u"?!1:window.matchMedia(PY).matches}function $8e(){const e=ui(),[t,n]=d.useState(()=>cj()||e);return d.useLayoutEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(PY);function s(){n(cj())}return r.addEventListener("change",s),s(),function(){r.removeEventListener("change",s)}},[]),t}const OY=A.memo(({isFollowUp:e,layoutKey:t,value:n,onChange:r,className:s,buttonSize:o,variant:a="default"})=>{const i=$8e(),c=ui();if(i||c){const u=(()=>{switch(a){case"default":return"primaryGhost";case"subtle":return"common"}})();return l.jsx(dY,{isFollowUp:e,value:n,onChange:r,buttonSize:o,variant:u})}else return l.jsx(IY,{isFollowUp:e,layoutKey:t,value:n,onChange:r,className:s,variant:a})});OY.displayName="SearchModeSelector";const q8e=A.memo(({size:e,inverse:t,incognitoType:n=t2.DEFAULT})=>l.jsx(K,{variant:"background",className:z("w-lg text-foreground flex aspect-square shrink-0 items-center justify-center rounded-full border",{"!w-[24px]":e==="small","!w-[16px]":e==="tiny"},{"!bg-inverse !text-inverse border-0":t}),children:n===t2.GOVERNMENT?l.jsx("svg",{width:e==="tiny"?"10":e==="small"?"12":"16",height:"auto",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fill:"currentColor",d:"M2.75 12.5h2.5v-7h1.5v7h2.5v-7h1.5v7h2.5v-7h1.5v7H16V14H0v-1.5h1.25v-7h1.5zM16 3v1.5H0V3l8-3z"})}):l.jsx("svg",{width:e==="tiny"?"12":e==="small"?"16":"24",height:"auto",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1927 4.54688C11.4375 4.71875 11.651 4.86458 12 4.86458C12.3453 4.86458 12.5529 4.72184 12.7993 4.55235L12.8073 4.54688L12.8084 4.54609C13.152 4.31187 13.5635 4.03125 14.5 4.03125C16.0885 4.03125 17.2083 6.30729 17.9375 8.6875C20.401 9.14062 22 9.875 22 10.6979C22 11.4427 20.6979 12.1094 18.6354 12.5677C18.6562 12.776 18.6667 12.9844 18.6667 13.1979C18.6667 14.0833 18.4948 14.9271 18.1823 15.6979H18.1965C17.2165 18.1697 14.8115 19.9169 12 19.9169C9.18854 19.9169 6.78355 18.1697 5.80356 15.6979H5.81771C5.50521 14.9271 5.33333 14.0833 5.33333 13.1979C5.33333 12.9844 5.34375 12.776 5.36458 12.5677C3.30208 12.1094 2 11.4427 2 10.6979C2 9.875 3.59896 9.14062 6.0625 8.6875C6.79167 6.30729 7.91146 4.03125 9.5 4.03125C10.4365 4.03125 10.848 4.31187 11.1916 4.54609L11.1927 4.54688ZM14.2708 15.6979H14.9167C16.0677 15.6979 17 14.7656 17 13.6146V12.8646C15.5312 13.0781 13.8229 13.1979 12 13.1979C10.1771 13.1979 8.46875 13.0781 7 12.8646V13.6146C7 14.7656 7.93229 15.6979 9.08333 15.6979H9.73437C10.5885 15.6979 11.3542 15.1458 11.625 14.3333C11.7448 13.9687 12.2604 13.9687 12.3802 14.3333C12.651 15.1458 13.4115 15.6979 14.2708 15.6979Z",fill:"currentColor"})})}));q8e.displayName="IncognitoIcon";function ph(){return ph=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.jsx(V,{variant:"tiny",children:l.jsx("span",{className:"text-caution",children:e})}));BY.displayName="FormError";const _v=A.memo(({label:e,labelVariant:t="smallBold",subtitle:n,errorText:r,isOptional:s=!1,withMargin:o=!0,optionalLabel:a="optional",testId:i})=>e||r||n?l.jsxs("div",{className:z({"mb-sm":o}),"data-test-id":i,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[(e||n)&&l.jsx("label",{htmlFor:e,children:l.jsx("div",{className:"gap-y-xs flex flex-col",children:e&&l.jsxs("div",{className:"gap-x-xs flex",children:[l.jsx(V,{variant:t,className:"select-none",children:e}),s&&l.jsx(V,{variant:"small",color:"light",children:`(${a})`})]})})}),r&&l.jsx(BY,{text:r})]}),n&&l.jsx(V,{variant:"small",color:"light",children:n})]}):null);_v.displayName="FormItemHeader";class Ls{static isEnterKey(t){return t.code==="Enter"||t.key==="Enter"||t.keyCode===13}static isEnterKeyWithoutShift(t){return this.isEnterKey(t)&&!t.shiftKey}static isArrowDown(t){return t.key==="ArrowDown"}static isArrowUp(t){return t.key==="ArrowUp"}static isEscapeKey(t){return t.key==="Escape"}static isTabKey(t){return t.key==="Tab"}static isOnlySlashKey(t){return t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey}static isCtrlOrCmdJ(t){return(t.metaKey||t.ctrlKey)&&t.key==="j"}}const hh=(e,t)=>{if(Ls.isEnterKeyWithoutShift(e)){if(t.isComposing||e.keyCode===229){e.preventDefault();return}if(t.isMobileUserAgent||t.allowEnterNewlines)return;e.preventDefault()}t.onKeyDown?.(e)},kA=e=>{e(!0)},MA=e=>{setTimeout(()=>{e(!1)},0)};var Ep;(function(e){e.INLINE="inline",e.LABEL="label"})(Ep||(Ep={}));const c7e=({onClear:e})=>l.jsx(st,{icon:B("x"),pill:!0,onClick:e,size:Ht.small}),u7e=["email","tel"],co=A.memo(({type:e,className:t,wrapperClassName:n,value:r,name:s,maxLength:o,errorText:a,errorPlacement:i=Ep.INLINE,disabled:c=!1,required:u=!1,autoFocus:f=!1,placeholder:m="",rightItems:p=Pe,onChange:h,onClear:g,onBlur:y,onFocus:x,onPaste:v,onKeyDown:b,isLoading:_,inlineEditBlock:w,label:S,subtitle:C,isOptional:E,isMobileUserAgent:T,labelMargin:k=!0,testId:I,variant:M,disable1pass:N,ClearIcon:D=c7e,enterKeyHint:j,size:F,ref:R,colorVariant:P="default",min:L,max:U,spellCheck:O})=>{const $=Zl(c),G=d.useRef(null),[H,Q]=d.useState(!1),[Y,te]=d.useState(!1),se=d.useRef(H);se.current=H,d.useEffect(()=>{!T&&f&&G.current?.focus()},[T,G,f]),d.useEffect(()=>{$!==c&&!c&&!T&&f&&setTimeout(()=>{G.current?.focus()},200)});const ae=d.useMemo(()=>z({"border-r mr-sm pr-xs border-subtler":p.length!=0}),[p.length]),X=d.useMemo(()=>{const De=(()=>{switch(P){case"default":return"bg-base dark:bg-subtler";case"subtle":return"bg-subtle";default:At(P)}})(),xe=z("w-full outline-none focus:outline-none focus:ring-subtler font-sans flex items-center","text-foreground caret-super selection:bg-super/50 dark:selection:bg-super/10 dark:selection:text-super",De,"border border-subtler focus:ring-1 placeholder-quieter","duration-200 transition-all","rounded-lg",{"ring-subtler ring-1":H},t),Ue=z({"py-xs px-sm text-xs placeholder:text-xs":F==="xs","py-sm px-sm text-sm placeholder:text-sm":F==="sm","py-lg px-xl text-lg placeholder:text-base":F==="lg","pl-[40px]":e==="search","!font-mono md:text-base":M==="monospace","!text-3xl !placeholder:text-3xl !font-medium":M==="page-title","py-sm md:text-sm px-md placeholder:text-sm":!F&&!M}),Ee=z({"pr-xs":p.length===0&&F==="xs","pr-sm":p.length===0&&F==="sm","pr-md":p.length===0&&!F,"pr-lg":p.length===0&&F==="lg","pr-[49px] md:pr-[59px]":p.length===1,"pr-[128px] md:pr-[138px]":p.length===2});return z(xe,Ue,Ee)},[H,t,F,e,M,p.length,P]),ee=!!a,le=!ee&&!!o&&!!r&&r.length>o,re=d.useMemo(()=>e==="search"?l.jsx("div",{className:"absolute left-3 flex items-center rounded-l-lg",children:l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("search")})})}):null,[e]),ce=d.useMemo(()=>{const De=i===Ep.INLINE&ⅇreturn l.jsxs("div",{className:"right-sm gap-sm absolute flex items-center rounded-full",children:[_?l.jsx(V,{color:"light",className:"mr-xs",children:l.jsx(Gl,{})}):null,De&&l.jsx(K,{className:"mr-sm",children:l.jsx(V,{color:"red",variant:"tiny",children:a})}),le&&l.jsx(K,{className:"mr-sm",children:o&&r&&l.jsx(V,{color:"red",variant:"tiny",children:o-r.length})}),g&&l.jsx("div",{className:ae,children:l.jsx(D,{onClear:g,inputValue:r})}),p.map((xe,Ue)=>l.jsx(Ge,{...xe.buttonProps,size:xe.buttonProps.size,disabled:xe.buttonProps.disabled||ee||le,pill:!0},Ue))]})},[i,ee,_,a,le,o,r,g,ae,D,p]),ue=d.useCallback(()=>{if(G.current){const De=G.current.value.length;G.current.focus();try{G.current.setSelectionRange(De,De)}catch{}}},[]),me=d.useCallback(De=>{x?.(De.nativeEvent),Q(!0)},[x]),we=d.useCallback(De=>{y?.(De.nativeEvent),Q(!1)},[y]);d.useImperativeHandle(R,()=>{const De=G.current;return De.focusAtEnd=ue,De.isFocused=()=>se.current,De.inLine=()=>!0,De.append=xe=>{G.current&&(G.current.value+=xe)},De.scrollToEnd=()=>{G.current&&(G.current.scrollTop=G.current.scrollHeight)},De.trim=()=>{G.current&&(G.current.value=G.current.value.trim())},De.element=()=>G.current,De},[ue]),d.useEffect(()=>{f&&!T&&ue()},[f,ue,T]);const ye=d.useCallback(De=>{h?.(De.target.value)},[h]),_e=d.useCallback(De=>{hh(De.nativeEvent,{isMobileUserAgent:T,isComposing:Y,onKeyDown:b})},[b,T,Y]),ke=i===Ep.LABEL?a:void 0;return l.jsxs("div",{className:n,children:[l.jsx(_v,{label:S,subtitle:C,isOptional:E,errorText:ke,withMargin:k}),l.jsx("div",{className:"rounded-full",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{type:e,ref:G,autoFocus:f,placeholder:m,disabled:c,value:r,required:u,name:s??S,onChange:ye,onKeyDown:_e,onCompositionStart:()=>kA(te),onCompositionEnd:()=>MA(te),onBlur:we,onFocus:me,onPaste:v,className:X,autoComplete:u7e.includes(e??"")?e:"off","data-test-id":I,"data-1p-ignore":N,enterKeyHint:j,min:L,max:U,spellCheck:O,maxLength:o}),re,ce]})}),w&&l.jsx("div",{className:"mt-sm flex justify-end",children:w})]})});co.displayName="Input";const d7e=250,UY=A.memo(({className:e,textClassName:t,iconClassName:n,emojiClassName:r,text:s,icon:o,color:a,truncate:i,variant:c,tooltipText:u})=>{const f=d.useMemo(()=>{if(o)switch(o.type){case"emoji":return l.jsx("span",{className:z("inline-block select-none",r),children:o.char});case"icon":{const m=o.icon;return l.jsx(ge,{icon:m,className:z("text-quiet inline-block shrink-0 rounded-sm",n)})}case"image":return l.jsx("i",{className:z("inline-block shrink-0 select-none rounded-sm bg-cover bg-center bg-no-repeat",n),style:{backgroundImage:`url(${o.url})`,fontSize:"0.78rem"}})}return null},[n,r,o]);return l.jsx(Io,{tooltipText:u,showTooltip:!!u,children:l.jsxs("span",{className:z("inline-flex min-w-0 items-center align-baseline",{"max-w-[168px]":i==="small","max-w-[208px]":i==="medium","max-w-[250px]":i==="large"},e),spellCheck:!1,children:[f,l.jsx(V,{className:z("inline-block min-w-0 truncate",t),color:a,as:"span",variant:c,children:s})]})})});UY.displayName="MentionNodeTextContent";const VY=A.memo(e=>l.jsx(UY,{...e,className:"px-sm border-subtlest bg-subtler dark:bg-subtle rounded-md border-[0.2px]",textClassName:"leading-[1.3]",iconClassName:"mr-1 h-[0.88rem] w-[0.88rem]",emojiClassName:"mr-1 text-[0.80rem]",truncate:"large"}));VY.displayName="MentionNodeDecorator";function f7e(e){const t=e.textContent,n=e.getAttribute("data-mention-uuid"),r=e.getAttribute("data-mention-variant"),s=e.getAttribute("data-mention-url")??void 0,o=e.getAttribute("data-mention-query-text")??void 0;return t!==null&&n!==null&&r!==null?{node:HY({uuid:n,variant:r,text:t,url:s,queryText:o})}:null}class wv extends xpe{__props;static getType(){return"mention"}static clone(t){return new wv(t.__props,t.__key)}static importJSON(t){return HY(t.props).updateFromJSON(t)}constructor(t,n){super(n),this.__props=t}exportJSON(){return{...super.exportJSON(),props:this.__props}}createDOM(){return document.createElement("span")}isIsolated(){return!0}updateDOM(){return!1}decorate(){return l.jsx(VY,{text:this.__props.text,icon:this.__props.icon,tooltipText:ny(this.__props.queryText??"",d7e)})}getTextContent(){switch(this.__props.variant){case"shortcut":return this.__props.queryText??"";case"tab":return this.__props.url?`[${this.__props.text||this.__props.url}](${this.__props.url})`:this.__props.text;case"space":case"source":default:return this.__props.text}}exportDOM(){const t=document.createElement("span");return t.setAttribute("data-mention-uuid",this.__props.uuid),t.setAttribute("data-mention-variant",this.__props.variant),t.setAttribute("data-mention-url",this.__props.url??""),t.textContent=this.__props.text,{element:t}}static importDOM(){return{span:t=>!t.hasAttribute("data-mention-uuid")||!t.hasAttribute("data-mention-variant")?null:{conversion:f7e,priority:4}}}}function HY(e){return vpe(new wv(e))}const zY=[wv,bpe,ZU],WY=[..._pe],tE=(()=>{try{return new RegExp("(?{if(!e)return"";const n=Cpe({namespace:"text-value",nodes:zY});return n.update(()=>{const r=gl();r.clear(),tE?nE(e):r.append(HS().append(zS(e)))},{discrete:!0}),n.read(()=>gl().getTextContent())},nE=(e,t)=>{wpe(e.replace(/\\/g,"\\\\"),WY,t,!0)},km=e=>{if(!e||!e.root)return"";const t=n=>{let r="";if(n.type==="text"&&"text"in n)r=n.text;else if(n.type==="linebreak")r=` -`;else{if((n.type==="link"||n.type==="autolink")&&"url"in n)return r=`[${"children"in n&&Array.isArray(n.children)&&n.children.map(t).reduce((o,a)=>(o+=a,o),"")||""}](${n.url})`,r;if(n.type==="mention"){const o=n.props;if(o.variant==="tab")return r=`[${o.text||o.url}](${o.url})`,r;if(o.variant==="shortcut")return r=o.queryText??"",r;if(o.variant==="source"||o.variant==="space")return r=`@${o.text}`,r}}return"children"in n&&Array.isArray(n.children)?n.children.map(t).reduce((s,o)=>(s+=o,s),r):r};return t(e.root)},xr={outerWrapper:{base:["bg-raised","w-full","outline-none","flex","items-center","border","rounded-2xl"],darkMode:"dark:bg-offset",transition:"duration-75 transition-all"},inputWrapper:{base:"overflow-hidden relative flex h-full w-full",expanded:["col-start-1","col-end-4","pb-3"],compact:["flex-grow","flex-shrink","p-sm","order-1"],disabled:"opacity-50 pointer-events-none cursor-not-allowed"},inputElement:["overflow-auto","max-h-[45vh]","lg:max-h-[40vh]","sm:max-h-[25vh]","outline-none","font-sans","resize-none","caret-super","selection:bg-super/30","selection:text-foreground","dark:selection:bg-super/10","dark:selection:text-super","text-foreground","bg-transparent","placeholder-quieter","placeholder:select-none","scrollbar-subtle"],attribution:{left:{base:["gap-sm","flex"],expanded:"col-start-1 row-start-2 -ml-two",compact:"order-0 ml-px"},right:{base:["flex","items-center","justify-self-end"],expanded:"col-start-3 row-start-2",compact:"order-2 mr-px"}},placeholder:{base:["absolute","inset-0","pointer-events-none","select-none","text-quieter"],compact:"p-sm"}},p7e=({isActive:e,isHighlighted:t})=>t?"border-super dark:border-super/85":e?"border-subtle":"border-subtler",h7e=({hasShadow:e,hasQuote:t})=>e&&!t?"shadow-sm dark:shadow-md shadow-super/10 dark:shadow-black/10":"",GY=A.memo(({quote:e,onClear:t})=>e?l.jsx("div",{className:"py-sm bg-subtler dark:bg-base animate-slideDownAndFadeIn z-[49] mx-3 rounded-lg px-3",children:l.jsxs("div",{className:"gap-sm flex items-start",children:[l.jsx(V,{color:"light",className:"mt-px flex items-center pt-1",variant:"tinyRegular",children:l.jsx(ge,{icon:B("quote-filled"),size:"xs",className:"rotate-180"})}),l.jsx(V,{className:"py-xs line-clamp-3 flex-1 overflow-hidden text-ellipsis",variant:"tinyRegular",color:"light",children:e}),l.jsx("div",{className:"shrink-0",children:l.jsx(st,{icon:B("x"),onClick:t,size:"tiny",pill:!0,toolTip:"Clear quote"})})]})}):null);GY.displayName="QuotePreview";function hj(e){return!!(e.closest("button")||e.closest("a")||e.closest('[role="link"]')||e.closest('[role="button"]')||e.closest('[role="menuitem"]')||e.closest('[role="menuitemcheckbox"]'))}const g7e=Ce(async()=>{const{HistoryPlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a0),__vite__mapDeps([10,4,1])));return{default:e}}),y7e=Ce(async()=>{const{OnChangePlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a1),__vite__mapDeps([10,4,1])));return{default:e}}),x7e=Ce(async()=>{const{EditorRefPlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a2),__vite__mapDeps([10,4,1])));return{default:e}}),v7e=Ce(async()=>{const{default:e}=await Se(()=>q(()=>import("./MentionsPlugin-C_MEbdd2.js"),__vite__mapDeps([140,4,1,6,3,10,8,9,7,11,12])));return{default:e}}),b7e=Ce(async()=>{const{default:e}=await Se(()=>q(()=>import("./AutoLinkPlugin-CfSMttbN.js"),__vite__mapDeps([141,4,1,10,3,8,9,6,7,11,12])));return{default:e}}),_7e=Ce(async()=>{const{default:e}=await Se(()=>q(()=>import("./LinkPlugin-BKkOS3bN.js"),__vite__mapDeps([142,4,1,10])));return{default:e}}),w7e=Ce(async()=>{const{MarkdownShortcutPlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a3),__vite__mapDeps([10,4,1])));return{default:e}});function C7e(e,t){switch(t.type){case"SET_EXPANDED":return{...e,isExpanded:t.payload};case"SET_ACTIVE":return{...e,isActive:t.payload};case"SET_COMPOSING":return{...e,isComposing:t.payload};default:return e}}const wg=Ft("ResizableInputContext",{state:{isExpanded:!0,isActive:!1,isComposing:!1},dispatch:()=>{}}),$Y=(e,t,n,r,s)=>{d.useEffect(()=>{const o=n?15:40;e&&e.length>o||e?.includes(` -`)?s(!0):r!==(t==="expanded")&&s(t==="expanded")},[e,t,n,r,s])},TA=A.memo(({initialLayout:e="expanded",wrapperClass:t,size:n,hasShadow:r,isHighlighted:s,isMobileUserAgent:o,quote:a,setQuote:i,attachmentsList:c,inputWarnings:u,children:f,inputRef:m,ref:p})=>{const[h,g]=d.useReducer(C7e,{isExpanded:e==="expanded",isActive:!1,isComposing:!1}),{isActive:y,isExpanded:x}=h,v=d.useMemo(()=>{const S=p7e({isActive:y,isHighlighted:s}),C=h7e({hasShadow:r,hasQuote:!!a});return z(...xr.outerWrapper.base,xr.outerWrapper.darkMode,xr.outerWrapper.transition,t,S,C,{"px-0 pt-3 pb-3":n==="large"&&x,"py-sm px-0":n==="large"&&!x})},[y,t,r,a,n,x,s]),b=d.useCallback(S=>{if(o)return;const C=S.target;hj(C)||m?.current?.focus()},[m,o]),_=d.useCallback(S=>{if(o)return;const C=S.target;if(hj(C))return;const E=m?.current?.element();E&&C!==E&&!E.contains(C)&&S.preventDefault()},[m,o]),w=d.useCallback(()=>i?.(null),[i]);return l.jsx(wg.Provider,{value:{state:h,dispatch:g},children:l.jsx("div",{className:"relative rounded-2xl",ref:p,onClick:b,onMouseDownCapture:_,children:l.jsxs("div",{className:z(v,"gap-y-md grid items-center"),children:[(u||a||c)&&l.jsxs("div",{className:z({"pt-xs":!x},"gap-y-sm grid items-center"),children:[u,a&&l.jsx(GY,{quote:a,onClear:w}),c]}),l.jsx("div",{className:z({"px-3":n==="large"&&!x,"px-3.5":n==="large"&&x,flex:!x,"grid-rows-1fr-auto grid grid-cols-3":x}),children:f})]})})})});TA.displayName="ResizeableInputWrapper";const S7e=({autoFocus:e=!1,placeholder:t="",disableInput:n=!1,value:r,initialLayout:s="expanded",minRows:o,maxRows:a,onChange:i,onClick:c,onBlur:u,onFocus:f,onKeyDown:m,onPaste:p,isMobileStyle:h,isMobileUserAgent:g,testId:y,id:x,ref:v})=>{const{state:b,dispatch:_}=d.useContext(wg),{isActive:w,isComposing:S,isExpanded:C}=b,E=d.useRef(w);E.current=w;const T=Zl(n),k=d.useRef(null),I=d.useMemo(()=>z(xr.inputWrapper.base,{[xr.inputWrapper.expanded.join(" ")]:C,[xr.inputWrapper.compact.join(" ")]:!C,[xr.inputWrapper.disabled]:n}),[n,C]),M=d.useMemo(()=>z(...xr.inputElement,"w-full"),[]),N=d.useCallback(Y=>{_({type:"SET_EXPANDED",payload:Y})},[_]),D=d.useCallback(Y=>{_({type:"SET_ACTIVE",payload:Y})},[_]),j=d.useCallback(Y=>{_({type:"SET_COMPOSING",payload:Y})},[_]),F=d.useCallback(Y=>{f?.(Y.nativeEvent),D(!0)},[f,D]),R=d.useCallback(Y=>{u?.(Y.nativeEvent)!==!1&&D(!1)},[u,D]),P=d.useCallback(()=>{if(k.current){const Y=k.current.value.length;k.current.focus(),k.current.setSelectionRange(Y,Y),k.current.scrollTop=k.current.scrollHeight}},[]),L=d.useCallback(Y=>{if(!k?.current)return!0;const te=k.current,{selectionStart:se,selectionEnd:ae,value:X}=te;if(se!==ae)return!1;const ee=document.createElement("div"),le=window.getComputedStyle(te);ee.style.position="absolute",ee.style.visibility="hidden",ee.style.whiteSpace=le.whiteSpace,ee.style.wordWrap=le.wordWrap,ee.style.font=le.font,ee.style.padding=le.padding,ee.style.border=le.border,ee.style.width=te.offsetWidth+"px",ee.style.lineHeight=le.lineHeight,document.body.appendChild(ee);try{const re=parseInt(le.lineHeight)||24,ce=X.substring(0,se);ee.textContent=ce;const ue=ee.offsetHeight;return Y==="first"?ue<=re:(ee.textContent=X,ee.offsetHeight-ue{c?.(Y.nativeEvent)},[c]),O=d.useCallback(Y=>{hh(Y.nativeEvent,{isMobileUserAgent:g,isComposing:S,onKeyDown:m})},[m,S,g]),$=d.useCallback(()=>kA(j),[j]),G=d.useCallback(()=>MA(j),[j]),H=d.useCallback(Y=>{p?.(Y.nativeEvent)},[p]),Q=d.useCallback(Y=>{i?.(Y.target.value)},[i]);return d.useImperativeHandle(v,()=>{const Y=k.current;return Y.focusAtEnd=P,Y.isFocused=()=>E.current,Y.inLine=L,Y.append=te=>{k.current&&(k.current.value+=te)},Y.scrollToEnd=()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},Y.trim=()=>{k.current&&(k.current.value=k.current.value.trim())},Y.element=()=>k.current,Y},[P,L]),d.useEffect(()=>{!g&&k.current&&e&&(requestAnimationFrame(P),D(!0))},[g,k,e,D,P]),d.useEffect(()=>{T!==n&&!n&&!g&&e&&setTimeout(()=>{k.current?.focus()},200)}),$Y(r,s,h,C,N),l.jsx("div",{className:I,children:l.jsx(FY,{ref:k,placeholder:t,minRows:o,maxRows:a,value:r,onClick:U,onChange:Q,onKeyDown:O,onBlur:R,onCompositionStart:$,onCompositionEnd:G,onFocus:F,onPaste:H,className:M,autoComplete:"off","data-test-id":y,rows:o,id:x,disabled:n,"data-1p-ignore":!0})})},my="external-update",qY="focus",E7e="blur",k7e=new Set([my,qY,E7e]),M7e=({autoFocus:e=!1,placeholder:t="",placeholderClassName:n,disableInput:r=!1,value:s,initialLayout:o="expanded",json:a,minRows:i,onChange:c,onClick:u,onBlur:f,onFocus:m,onKeyDown:p,onPaste:h,isMobileStyle:g,isMobileUserAgent:y,testId:x,id:v,namespace:b="ResizableLexicalInput",mentionTypeaheadOptions:_=Pe,onMentionMenuOpen:w,onMentionMenuClose:S,onTriggerTypeahead:C,ref:E})=>{const T=d.useRef(null),[k,I]=d.useState(null),{state:M,dispatch:N}=d.useContext(wg),{isActive:D,isComposing:j,isExpanded:F}=M,R=d.useRef(j),P=d.useRef(D),L=d.useRef(""),U=d.useRef(null),O=d.useRef(e),$=d.useRef(null),G=d.useRef(c),H=d.useRef(u),Q=d.useRef(f),Y=d.useRef(m),te=d.useRef(p),se=d.useRef(h);G.current=c,H.current=u,Q.current=f,Y.current=m,te.current=p,se.current=h,R.current=j,P.current=D,O.current=e;const ae=Zl(r),X=d.useMemo(()=>z(xr.inputWrapper.base,{[xr.inputWrapper.expanded.join(" ")]:F,[xr.inputWrapper.compact.join(" ")]:!F}),[F]),ee=d.useMemo(()=>z(...xr.inputElement,"size-full"),[]),le=d.useMemo(()=>z(...xr.placeholder.base,{[xr.placeholder.compact]:!F},n),[F,n]),re=d.useCallback(Me=>N({type:"SET_EXPANDED",payload:Me}),[N]),ce=d.useCallback(Me=>N({type:"SET_ACTIVE",payload:Me}),[N]),ue=d.useCallback(Me=>N({type:"SET_COMPOSING",payload:Me}),[N]),me=d.useCallback(Me=>{Z.error(Me)},[]),we=d.useCallback(Me=>{Y.current?.(Me),ce(!0)},[ce]),ye=d.useCallback(Me=>{Q.current?.(Me)!==!1&&ce(!1)},[ce]),_e=d.useCallback(Me=>{se.current?.(Me)},[]),ke=d.useCallback(Me=>{H.current?.(Me)},[]),De=d.useCallback((Me,Ve,lt)=>{const xt=[...lt];let Pt;xt.length>0&&xt.every($e=>k7e.has($e))||(Pt===void 0&&(Pt=km(Me.toJSON())),L.current=Pt??"",U.current=Me.toJSON(),G.current?.(L.current,U.current))},[]),xe=d.useCallback(()=>ue(!0),[ue]),Ue=d.useCallback(()=>ue(!1),[ue]),Ee=d.useCallback(Me=>{hh(Me,{isMobileUserAgent:y,isComposing:R.current,onKeyDown:te.current})},[y]),Ke=d.useCallback(()=>k?.update(()=>{g_(qY),gl().selectEnd()}),[k]),Nt=d.useCallback(Me=>k?.update(()=>{const Ve=gl(),lt=Ve.getLastChild();if(gm(lt)){const xt=zS(Me);lt.append(xt),Ve.selectEnd()}}),[k]),pe=d.useCallback(()=>k?.update(()=>{const Ve=gl().getLastChild();if(gm(Ve)){const lt=Ve.getFirstChild();if(ym(lt)){const Pt=lt.getTextContent(),$e=Pt.trimStart();Pt.length-Pt.trimStart().length&<.spliceText(0,Pt.length,$e,!0)}const xt=Ve.getLastChild();if(ym(xt)){const Pt=xt.getTextContent(),$e=Pt.trimEnd();Pt.length-$e.length&&xt.spliceText(0,Pt.length,$e,!0)}}}),[k]),ve=d.useCallback(Me=>k?k.getEditorState().read(()=>{const Ve=Ta();if(!Aa(Ve))return!0;if(!Ve.isCollapsed())return!1;const lt=window.getSelection();if(!lt||lt.rangeCount===0)return!0;const xt=lt.getRangeAt(0);let Pt=xt.getBoundingClientRect();if(Pt.width===0&&Pt.height===0){const Zt=document.createTextNode("​");xt.insertNode(Zt),Pt=xt.getBoundingClientRect(),Zt.remove()}const $e=k.getElementByKey(gl().getFirstChild()?.getKey()??"")?.getBoundingClientRect();if(!$e)return!0;const ht=4;return Me==="first"?Math.abs(Pt.top-$e.top)<=ht:Math.abs(Pt.bottom-$e.bottom)<=ht}):!0,[k]),Ae=d.useCallback(()=>{w?.()},[w]),We=d.useCallback(()=>{S?.()},[S]),pt=d.useCallback(Me=>{k||ke(Me.nativeEvent)},[k,ke]);d.useImperativeHandle(E,()=>({append:Nt,trim:pe,focusAtEnd:Ke,isFocused:()=>P.current,inLine:ve,focus:()=>k?.focus(),blur:()=>k?.blur(),scrollIntoView:Me=>k?.getRootElement()?.scrollIntoView(Me),scrollToEnd:()=>k?.getRootElement()?.scrollIntoView({block:"end",behavior:"auto"}),element:()=>T?.current,get scrollHeight(){return k?.getRootElement()?.scrollHeight??0},get value(){return km(k?.getEditorState()?.toJSON())},set value(Me){throw new Error("setValue is not supported in Lexical")},get json(){return k?.getEditorState().toJSON()}}),[Nt,Ke,pe,k,ve]),$Y(s,o,g,F,re),d.useEffect(()=>{!y&&k&&e&&(requestAnimationFrame(Ke),ce(!0))},[y,e,ce,k,Ke]),d.useEffect(()=>{ae!==r&&!r&&!y&&e&&setTimeout(()=>Ke(),200)}),d.useEffect(()=>k?.registerRootListener((Me,Ve)=>{Me&&(Me.addEventListener("focus",we),Me.addEventListener("blur",ye),Me.addEventListener("compositionstart",xe),Me.addEventListener("compositionend",Ue),Me.addEventListener("keydown",Ee),Me.addEventListener("paste",_e),Me.addEventListener("click",ke)),Ve&&(Ve.removeEventListener("focus",we),Ve.removeEventListener("blur",ye),Ve.removeEventListener("compositionstart",xe),Ve.removeEventListener("compositionend",Ue),Ve.removeEventListener("keydown",Ee),Ve.removeEventListener("paste",_e),Ve.removeEventListener("click",ke))}),[ye,ke,Ue,we,Ee,_e,xe,k]),d.useLayoutEffect(()=>{k&&k.setEditable(!r)},[r,k]),d.useLayoutEffect(()=>{k&&(s&&a&&!Cr(a,U.current)?Promise.resolve().then(()=>{k.setEditorState(k.parseEditorState(a),{tag:my}),O.current&&Ke(),U.current=k.getEditorState().toJSON(),L.current=km(U.current)}):s&&L.current!==s?(k.update(()=>{g_(my);const Me=gl();Me.clear(),tE?nE(s):Me.append(zS(s)),O.current&&Me.selectEnd()},{discrete:!0}),U.current=k.getEditorState().toJSON(),L.current=km(U.current)):!s&&L.current!==s&&(k.update(()=>{g_(my);const Me=gl();Me.clear(),O.current?Me.selectEnd():k.getRootElement()!==document.activeElement&&E7(null)},{discrete:!0}),U.current=k.getEditorState().toJSON(),L.current=km(U.current)))},[s,a,k,Ke]),d.useEffect(()=>{const Me=k?.registerCommand(y_,dt=>{const Ct=Ta();if(Aa(Ct)&&Ct.isCollapsed()){const Ot=Ct.anchor,Qt=Ot.getNode(),lr=tr=>{let bn=tr,nr=bn.getParent();for(;nr&&!gm(nr)&&!D7(nr);)bn=nr,nr=bn.getParent();return bn},Qr=tr=>!tr||!xm(tr)||!tr.isIsolated()?!1:(tr.remove(),!0);if(gm(Qt)){const bn=Ct.getNodes()[0];if(dt){if(bn){if(bn.getNextSibling()===null&&Qr(bn))return!0;const nr=bn.getPreviousSibling();if(Qr(nr))return!0}}else if(Qr(bn))return!0}else if(Qt){const tr=lr(Qt);if(dt){if(Ot.offset===0){const nr=tr.getPreviousSibling();if(Qr(nr))return!0}}else{const bn=ym(Qt)?Qt.getTextContentSize():0;if(Ot.offset===bn){const Xr=tr.getNextSibling();if(Qr(Xr))return!0}}}}return Aa(Ct)?(Ct.deleteCharacter(dt),!0):x_(Ct)?(Ct.deleteNodes(),!0):!1},vi),Ve=k?.registerCommand(Spe,dt=>{const Ct=Ta();return Aa(Ct)?(Ct.deleteWord(dt),!0):!1},vi),lt=k?.registerCommand(Epe,dt=>{const Ct=Ta();return Aa(Ct)?(Ct.deleteLine(dt),!0):!1},vi),xt=k?.registerCommand(kpe,()=>{const dt=Ta();return Aa(dt)?(dt.removeText(),!0):!1},vi),Pt=k?.registerCommand(Mpe,dt=>{const Ct=Ta();if(typeof dt=="string")Ct!==null&&Ct.insertText(dt);else{if(Ct===null)return!1;const Ot=dt.dataTransfer;if(Ot!==null)k7(Ot,Ct,k);else if(Aa(Ct)){const Qt=dt.data;return Qt&&Ct.insertText(Qt),!0}}return!0},vi),$e=k?.registerCommand(Tpe,dt=>{if("clipboardData"in dt){const Ot=dt.clipboardData?.getData("text/plain");if(Ot&&Ot.length>Ec)return dt.preventDefault(),!0}const Ct=Ta();return Aa(Ct)?(dt.preventDefault(),k.update(()=>{const Ot=Ta(),Qt=M7(dt,InputEvent)||M7(dt,KeyboardEvent)?null:"clipboardData"in dt?dt.clipboardData:null;if(Qt&&Ot){const{types:lr}=Qt;if(lr.includes("text/html")||lr.includes("application/x-lexical-editor")||Qt.files.length>0||!tE)k7(Qt,Ot,k);else{const Qr=Ot.clone(),tr=HS();nE(Qt.getData("text/plain"),tr);const bn=[];tr.getChildren().forEach(nr=>{gm(nr)?(bn.length&&bn.push(T7()),nr.getChildren().forEach(Xr=>{(ym(Xr)||xm(Xr)||A7(Xr)||N7(Xr))&&bn.push(Xr)})):bn.push(nr)}),E7(Qr),Ape(k,bn,Qr)}}},{tag:Npe}),!0):!1},vi),ht=k?.registerCommand(Rpe,dt=>{const Ct=R7(dt.target);if(xm(Ct))return!1;const Ot=Ta();if(Aa(Ot)){const{anchor:Qt}=Ot,lr=Qt.getNode();if(Ot.isCollapsed()&&Qt.offset===0&&!D7(lr)&&Dpe(lr).getIndent()>0)return dt.preventDefault(),k.dispatchCommand(jpe,void 0);if(Ipe&&navigator.language==="ko-KR")return!1}else if(!x_(Ot))return!1;return dt.preventDefault(),k.dispatchCommand(y_,!0)},vi),Zt=k?.registerCommand(Ppe,dt=>{const Ct=R7(dt.target);if(xm(Ct))return!1;const Ot=Ta();return Aa(Ot)||x_(Ot)?(dt.preventDefault(),k.dispatchCommand(y_,!1)):!1},vi);return k?.registerNodeTransform(Ope,dt=>{dt.getFormat()!==0&&dt.setFormat(0)}),k?.registerNodeTransform(Lpe,dt=>{if(dt.getChildrenSize()>1){const Ct=dt.getChildren(),Ot=HS();Ct.forEach(Qt=>{Fpe(Qt)&&(Ot.getChildren().length&&Ot.append(T7()),Qt.getChildren().forEach(lr=>{(ym(lr)||xm(lr)||A7(lr)||N7(lr))&&Ot.append(lr)}))}),dt.clear().append(Ot).selectEnd()}}),k?.registerNodeTransform(Bpe,dt=>{const Ct=dt.getParent();Ct instanceof ZU&&(dt.getChildren().forEach(Qt=>{Ct.append(Qt)}),dt.remove())}),()=>{Me?.(),Ve?.(),lt?.(),xt?.(),Pt?.(),$e?.(),ht?.(),Zt?.()}},[k,_e]),d.useEffect(()=>{const Me=k?.registerCommand(Upe,Ve=>!Ve||$.current&&!$.current.canSubmit()?!1:(hh(Ve,{isMobileUserAgent:y,isComposing:R.current,onKeyDown:te.current}),Ve.defaultPrevented),vi);return()=>{Me?.()}},[k,We,y]);const Gt=d.useMemo(()=>({namespace:b,onError:me,nodes:zY,theme:{link:"text-super hover:underline",text:{strikethrough:"line-through"}},editable:!r}),[b,me,r]),Le=d.useMemo(()=>({minHeight:`${(i??1)*1.5}em`}),[i]),gt=d.useMemo(()=>l.jsx("div",{className:le,children:t}),[t,le]),Je=d.useMemo(()=>l.jsx(Vpe,{className:ee,"aria-placeholder":t,placeholder:gt,"data-test-id":x,id:v}),[v,t,gt,ee,x]);return d.useMemo(()=>l.jsx("div",{className:X,children:l.jsx("div",{className:"w-full",style:Le,ref:T,onClick:pt,children:l.jsxs(Hpe,{initialConfig:Gt,children:[l.jsx(zpe,{contentEditable:Je,ErrorBoundary:Mr}),l.jsx(g7e,{}),l.jsx(y7e,{onChange:De,ignoreSelectionChange:!0}),l.jsx(x7e,{editorRef:I}),l.jsx(v7e,{ref:$,onClose:We,onOpen:Ae,options:_,onTrigger:C}),l.jsx(b7e,{}),l.jsx(_7e,{}),l.jsx(Wpe,{}),l.jsx(w7e,{transformers:WY})]})})}),[X,Le,pt,Gt,Je,De,We,Ae,_,C])},AA=e=>{const t=e.useLexical?M7e:S7e;return l.jsx(t,{...e})},KY=A.memo(({children:e})=>{const{state:t}=d.useContext(wg),{isExpanded:n}=t;return e!==null?l.jsx("div",{className:z(...xr.attribution.left.base,{[xr.attribution.left.expanded]:n,[xr.attribution.left.compact]:!n}),children:e}):null});KY.displayName="LeftAttribution";const rE=A.memo(({isLoading:e,children:t})=>{const{state:n}=d.useContext(wg),{isExpanded:r}=n;return l.jsxs("div",{className:z(...xr.attribution.right.base,{[xr.attribution.right.expanded]:r,[xr.attribution.right.compact]:!r}),children:[e?l.jsx(V,{color:"light",className:"mr-3",children:l.jsx(ge,{icon:B("loader-2"),size:"xs",className:"animate-spin"})}):null,t]})});rE.displayName="RightAttribution";const T7e=({showFileUpload:e,handleFileInput:t,onFilePickerOpen:n,screenshotToolEnabled:r,isFollowUp:s})=>!e||!t?null:l.jsx(uY,{handleFileInput:t,onFilePickerOpen:n,screenshotToolEnabled:r,isFollowUp:s}),A7e=({showIncognitoHint:e,showSearchModeSelector:t=!0,isFollowUp:n,layoutKey:r,showFileUpload:s=!1,handleFileInput:o,onFilePickerOpen:a})=>{const{screenshotToolEnabled:i}=Qn();return l.jsx(KY,{children:l.jsx("div",{className:"gap-xs flex items-center",children:l.jsx(T7e,{showFileUpload:s,handleFileInput:o,onFilePickerOpen:a,screenshotToolEnabled:i,isFollowUp:n})})})},YY=A.memo(A7e);YY.displayName="AskInputLeftAttribution";const N7e=({uploadedFiles:e,selectedModel:t,onModelSwitch:n})=>{const{$t:r}=J(),{hasAccessToProFeatures:s}=$t(),{openToast:o}=hn(),{getModelConfig:a}=I4(),i=d.useRef(null);d.useEffect(()=>{const c=e?.some(h=>kr(h.file.name))??!1,f=a(t)?.textOnlyModel===!0;if(!c||!f){i.current=null;return}if(i.current===t)return;const m=r({defaultMessage:"{modelName} does not support images. Switched to the default best model.",id:"Dtdtsbnc5W"},{modelName:r($n[t].name)});o({message:m,variant:"warning",timeout:null});const p=s?ie.PRO:ie.DEFAULT;i.current=t,n(p)},[e,t,a,o,r,n,s])},R7e=(e,t)=>{const{value:n,loading:r}=kf({flag:"model-outage-on-model-selector-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Pu=He({reasoning:{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"},max:{defaultMessage:"max",id:"+LmzMnWE+j"},new:{defaultMessage:"new",id:"qlTe+eC7Ec"},research:{defaultMessage:"Research",id:"JEe7dVso7F"},labs:{defaultMessage:"Labs",id:"ylFNoY79wa"}}),D7e=W({defaultMessage:"Advanced models in Perplexity {searchMode}",id:"XgqOYZp+oF"}),j7e=W({defaultMessage:"Exclusive access for Max subscribers",id:"z2ijkWbdu6"}),I7e=W({defaultMessage:"Temporary degraded performance",id:"Kc/pdbXoxJ"}),P7e=W({defaultMessage:"{modelName} is a text only model. Remove image attachments to use this model.",id:"8Z6XFIwTW6"}),O7e=e=>{const{label:t,subheading:n,nonReasoningModel:r,reasoningModel:s,selected:o,variant:a,badgeText:i,notice:c,onChange:u,tooltipText:f,disabled:m}=e,{$t:p}=J(),h=d.useCallback(()=>{if(m)return;const _=r??s;if(!_){Hc.error("ModelMenuItem: No model to select",{searchModel:r,reasoningModel:s});return}u(_)},[u,r,s,m]),g=d.useCallback(()=>{!s||!r||u(s===o?r:s)},[u,s,r,o]),y=!r,x=o===r||o===s,v=p({defaultMessage:"{modelName} does not support images. Remove image attachments to use this model.",id:"SQsP6RyVGS"},{modelName:t}),b=y?v:void 0;return l.jsxs(K,{variant:x?"subtler":void 0,className:"rounded-lg",children:[l.jsx(gA,{text:t,description:n,role:"menuitem",active:x,activeColor:a,badge:i,badgeVariant:a==="max"?"maxBorder":"superBorder",onClick:h,tooltipText:f,disabled:m}),x&&c&&l.jsx(V,{className:"max-w-44 px-2 py-1 text-left",variant:"tinyRegular",color:"red",children:c}),x&&s&&l.jsx(yA,{selected:o===s,text:p({defaultMessage:"With reasoning",id:"xwd+5Brxnr"}),role:"menuitem",active:o===s,activeColor:a,onClick:g,disabled:y,tooltipText:b,switchVariant:a})]})},L7e=[ie.DEFAULT,ie.PRO],sE=e=>L7e.includes(e),QY=({currentModel:e,onModelSelect:t,origin:n,searchMode:r=oe.SEARCH,disableTextOnlyModels:s=!1})=>{const o="use-model-menu-items-with-reasoning",{$t:a}=J(),{isMax:i,isPro:c}=$t(),{organization:u}=mo({reason:o}),{isMaxUpsellEnabled:f}=$x(),{specialCapabilities:m}=Yr(),p=ag(),h=d.useRef(null),{models:g,getModelConfig:y}=I4(),{modelSpecificLimits:x}=Vn(),{variation:v}=R7e({}),b=m.maxModelSelection||f||i,_=u?.settings?.disabled_model_preferences??Pe,w=d.useCallback(M=>{const N=y(M);return!N||N.subscriptionTier!==Jn.MAX||i||m.maxModelSelection||c&&[N.nonReasoningModel,N.reasoningModel].filter(F=>F!==null).some(F=>(x?.[F]??0)>0)?!0:!f},[y,i,m.maxModelSelection,c,x,f]),S=d.useCallback(()=>{p({origin:n??ft.MODEL_SELECTOR,pitchMessage:{title:a(D7e,{searchMode:a(Nr[r].name)}),description:a(j7e)}})},[p,a,n,r]),C=d.useCallback(M=>{h.current=M,t(M)},[t]),E=d.useCallback(M=>M&&_.includes(M),[_]),T=d.useCallback(M=>sE(M)||y(M)!==void 0,[y]),k=d.useMemo(()=>({type:"custom",text:a($n[ie.PRO].name),children:l.jsx(Ed,{type:"default",size:"small",text:a($n[ie.PRO].name),tooltipText:a($n[ie.PRO].description),active:sE(e),onClick:()=>{C(ie.PRO)}})}),[e,C,a]),I=d.useMemo(()=>{const M={type:"separator",show:!0},D=g.filter(j=>!(!b&&j.subscriptionTier===Jn.MAX||E(j.nonReasoningModel)&&E(j.reasoningModel))).map(j=>{const F=E(j.nonReasoningModel)?null:j.nonReasoningModel,R=E(j.reasoningModel)?null:j.reasoningModel;if(!F&&!R)return null;const L=!!(F&&v[F]||R&&v[R])?a(I7e):void 0,U=s&&j.textOnlyModel===!0,O=U?a(P7e,{modelName:a(j.label)}):a(j.description),$=()=>{if(j.subheading)return a(j.subheading);if(c&&j.subscriptionTier===Jn.MAX&&[j.nonReasoningModel,j.reasoningModel].filter(se=>se!==null).some(se=>(x?.[se]??0)>0))return a({defaultMessage:"Trial access with Pro plan",id:"52XybSYuLP"})},G=j.subscriptionTier===Jn.MAX,H=G?"max":"super",Q=G?Pu.max:j.hasNewTag?Pu.new:void 0;return{type:"custom",text:a(j.label),children:l.jsx(O7e,{label:a(j.label),subheading:$(),selected:e,nonReasoningModel:F,reasoningModel:R,notice:L,variant:H,badgeText:Q?a(Q):void 0,onChange:Y=>{if(!w(Y)){S();return}C(Y)},tooltipText:O,disabled:U})}}).filter(j=>j!==null);if(n===ft.RETRY_BUTTON){const j={type:"custom",text:a(Pu.research),children:l.jsx(Ed,{type:"default",size:"small",icon:hM,text:a(Pu.research),active:e===ie.ALPHA,onClick:()=>C(ie.ALPHA)})},F={type:"custom",text:a(Pu.labs),children:l.jsx(Ed,{type:"default",size:"small",text:a(Pu.labs),icon:pM,active:e===ie.BETA,onClick:()=>C(ie.BETA)})};return[j,F,M,k,...D]}return[k,M,...D]},[a,n,e,b,E,v,w,S,C,g,k,s,c,x]);return d.useMemo(()=>({menuItems:I,isSupportedModel:T}),[I,T])},F7e=He({chooseModel:{defaultMessage:"Choose a model",id:"fXlc3idTcy"}}),XY=d.memo(({isOpen:e,onOpen:t,onClose:n,selectedModel:r,onModelChange:s,uploadedFiles:o})=>{const{$t:a}=J(),{isMax:i}=$t(),{onActiveMenuChange:c}=jo(),{activeMenu:u}=qr(),f=Vo(),{configuredModel:m}=Vn(),p=bg(),{isMobileStyle:h}=Re(),g=f===oe.SEARCH,y=d.useCallback(F=>{p(F,f)},[p,f]),x=d.useCallback(()=>{c(Ir.SEARCH_MODEL_SELECTOR)},[c]),v=d.useCallback(()=>{c(null)},[c]),b=r??m,_=s??y,w=e??u===Ir.SEARCH_MODEL_SELECTOR,S=t??x,C=n??v,T=!!fn()?.get("openSearchModeSelector");d.useEffect(()=>{T&&x()},[T,x]);const k=d.useCallback(F=>p(F,f),[p,f]);N7e({uploadedFiles:o,selectedModel:b,onModelSwitch:k});const I=d.useMemo(()=>o?.some(F=>kr(F.file.name))??!1,[o]),{menuItems:M}=QY({currentModel:b,onModelSelect:_,searchMode:f,disableTextOnlyModels:I}),N=d.useMemo(()=>sE(b),[b]),D=d.useMemo(()=>({className:z("max-h-[40vh]",{"max-super-override":i})}),[i]),j=d.useCallback(()=>l.jsx("span",{className:z({"text-super":!N}),children:l.jsx(rn,{icon:B("cpu"),size:"small"})}),[N]);return l.jsx(V4,{isVisible:g,animationType:"slide",children:l.jsx(zs,{placement:"bottom-end",boxProps:D,items:M,isMobileStyle:h,isOpen:w,onOpen:S,onClose:C,children:l.jsx(wt,{variant:"text",size:"small",icon:j,"aria-label":a(N?F7e.chooseModel:$n[b].name)})})})});XY.displayName="SearchModelSelector";const ZY=A.memo(({children:e,focusItems:t,placement:n,width:r="200px",isMobileStyle:s,isOpen:o=!1,onOpen:a,onClose:i,menuType:c=Ir.FOCUS,isSpace:u=!1})=>{const{$t:f}=J(),{isMax:m}=$t(),p=J(),h=d.useMemo(()=>{switch(c){case Ir.RECENCY:return f({defaultMessage:"Choose recency",id:"qyxEklVz9W"});case Ir.SOURCES:default:return f({defaultMessage:"Choose sources",id:"5HzLAl6K6z"})}},[c,f]),g=d.useCallback(_=>{_?.stopPropagation(),a?.()},[a]),y=d.useCallback(()=>{i?.()},[i]),x=d.useMemo(()=>l.jsx("div",{className:"gap-x-xs p-sm bg-subtle flex items-center justify-center rounded-t-xl text-center",children:l.jsx(V,{color:"light",variant:"tinyRegular",children:l.jsxs("div",{className:"gap-x-sm flex items-center",children:[l.jsx(ge,{icon:Kh,size:"xs"}),p.formatMessage({defaultMessage:"Search includes all context from this space.",id:"uhJN0zDnSy"})]})})}),[p]),v=d.useMemo(()=>({width:r}),[r]),b=d.useMemo(()=>l.jsxs(K,{className:z("flex flex-col",{"max-h-[37vh]":u,"max-h-[42vh]":!u,"max-super-override":m}),style:v,children:[u&&c===Ir.SOURCES&&x,l.jsx(nl,{orientation:"vertical",showIndicatorOnHover:!1,className:z("min-h-0 flex-1 overflow-auto",{"p-xs":u&&c===Ir.SOURCES}),children:l.jsx(fh,{items:t,disableScrollArea:!0})})]}),[x,t,u,c,v,m]);return s?l.jsxs(l.Fragment,{children:[l.jsx(po,{title:h,titleTextVariant:"baseSemi",variant:"bottom-left-sheet",actionList:Pe,isOpen:o,onClose:y,noPadding:!0,children:l.jsx(fh,{textColor:"light",items:t})}),l.jsx("span",{onClick:g,children:e})]}):l.jsx(Vf,{isFileSearchEnabled:!0,isOpen:o,placement:n,onClose:y,onOpen:g,avoidSizeCollisions:!1,contentClassName:u&&c===Ir.SOURCES?"!p-0":"",content:b,hasInteractiveContent:!0,children:e})});ZY.displayName="FocusDropdown";const JY=A.memo(({isOpen:e,onOpen:t,onClose:n})=>{const r="recency-switcher",{$t:s}=J(),o=J(),{isMobileStyle:a}=Re(),i=ou(),{session:c}=Ne(),{trackEvent:u}=Xe(c),{sources:f,recency:m,setRecency:p}=Vn(),h=Array.isArray(i?.slug)?i.slug[0]:i?.slug,{collection:g}=O4({collectionSlug:h,reason:r}),y=g?.focused_web_config?.link_configs??Pe,x=f&&f.includes("web"),v=f&&y.length>0,b=!x&&!v,w=f&&f.includes("crunchbase")?!0:b,S=d.useCallback(T=>{p(T),u("search recency click",{recency:T}),n()},[u,p,n]),C=d.useMemo(()=>[{value:null,label:s({defaultMessage:"All Time",id:"52UMW3b1Z0"})},{value:"DAY",label:s({defaultMessage:"Today",id:"zWgbGgjUUg"})},{value:"WEEK",label:s({defaultMessage:"Last Week",id:"P3YB9A5Yho"})},{value:"MONTH",label:s({defaultMessage:"Last Month",id:"cfMkrE1iIn"})},{value:"YEAR",label:s({defaultMessage:"Last Year",id:"7PhUtcTRXC"})}],[s]),E=d.useMemo(()=>C.map(T=>({type:"default",text:T.label,active:m===T.value,onClick:()=>S(T.value)})),[C,m,S]);return l.jsx(ZY,{focusItems:E,placement:"bottom-start",width:"200px",isMobileStyle:a,isOpen:e,onOpen:t,onClose:n,menuType:Ir.RECENCY,children:l.jsx(st,{toolTip:o.formatMessage({defaultMessage:"Set recency for web search",id:"3/OG+oV8gT"}),size:"small",icon:B("clock"),disabled:w})})});JY.displayName="RecencySwitcher";function B7e(e){for(var t=[],n=1;n1?!0:(t.preventDefault&&t.preventDefault(),!1)}var yj=V7e&&window.navigator&&window.navigator.platform&&/iP(ad|hone|od)/.test(window.navigator.platform),Ou=new Map,xj=typeof document=="object"?document:void 0,G0=!1;const H7e=xj?function(t,n){t===void 0&&(t=!0);var r=d.useRef(xj.body);n=n||r;var s=function(a){var i=Ou.get(a);i?Ou.set(a,{counter:i.counter+1,initialOverflow:i.initialOverflow}):(Ou.set(a,{counter:1,initialOverflow:a.style.overflow}),yj?G0||(B7e(document,"touchmove",gj,{passive:!1}),G0=!0):a.style.overflow="hidden")},o=function(a){var i=Ou.get(a);i&&(i.counter===1?(Ou.delete(a),yj?(a.ontouchmove=null,G0&&(U7e(document,"touchmove",gj),G0=!1)):a.style.overflow=i.initialOverflow):Ou.set(a,{counter:i.counter-1,initialOverflow:i.initialOverflow}))};d.useEffect(function(){var a=oE(n.current);a&&(t?s(a):o(a))},[t,n.current]),d.useEffect(function(){var a=oE(n.current);if(a)return function(){o(a)}},[])}:function(t,n){},vj="google-drive-picker-gapi-script",bj="google-identity-services-script",z7e=wf(async function(){if(!document.getElementById(bj))return new Promise((t,n)=>{const r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.id=bj,r.onload=()=>t(),r.onerror=n,document.body.appendChild(r)})}),W7e=wf(async function(){if(!document.getElementById(vj))return new Promise((t,n)=>{const r=document.createElement("script");r.src="https://apis.google.com/js/api.js",r.id=vj,r.onload=()=>{window.gapi.load("picker",{callback:t,onerror:n})},r.onerror=n,document.body.appendChild(r)})}),G7e=["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/drive.metadata.readonly"].join(" "),$7e=["application/vnd.google-apps.file","application/vnd.google-apps.folder","application/vnd.google-apps.document","application/vnd.google-apps.presentation","application/vnd.google-apps.spreadsheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","application/pdf","text/csv","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/markdown"],q7e=["text/plain","application/pdf","text/csv","text/markdown","image/png","image/jpeg","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.google-apps.document","application/vnd.google-apps.presentation","application/vnd.google-apps.spreadsheet"],K7e=["audio/mpeg","audio/wav","audio/aiff","audio/ogg","audio/flac","audio/mp3","video/mp4","video/mpeg","video/mov","video/avi","video/x-flv","video/mpg","video/webm","video/wmv","video/3gpp","video/quicktime"],eQ=({isAudioVideoFilesEnabled:e,onError:t})=>{const[n,r]=d.useState(!1),{openToast:s}=hn(),{$t:o}=J();H7e(n);const a=d.useCallback((c,u)=>{const f=window.google?.picker,m=p=>{p.action===f.Action.PICKED?u.onPicked&&u.onPicked(p.docs??Pe):(p.action===f.Action.CANCEL||p.action===f.Action.ERROR)&&(p.action===f.Action.CANCEL&&u.onCancel&&u.onCancel(),r(!1))};if(f)try{const p=new f.DocsView().setIncludeFolders(!0).setSelectFolderEnabled(!0).setMode(f.DocsViewMode.LIST),h=new f.ViewGroup(p);let g=u.mode==="source"?$7e:q7e;g=e?g.concat(K7e):g,new f.PickerBuilder().setSize(1051,650).addViewGroup(h).setSelectableMimeTypes(g.join(",")).enableFeature(f.Feature.MULTISELECT_ENABLED).setOAuthToken(c).setCallback(m).build().setVisible(!0),r(!0)}catch{t?.()}},[e,t]),i=d.useCallback(async c=>{try{await Promise.all([W7e(),z7e()])}catch{t?.();return}window.google.accounts.oauth2.initTokenClient({client_id:c.clientId,login_hint:c.loginHint,scope:G7e,prompt:"none",callback:f=>{if(f.error!==void 0)throw new Error(f.error);if(!f.access_token){s({message:o({defaultMessage:"Failed to open Google Drive file picker. If this problem persists, please try reconnecting your Google Drive account.",id:"UK5gaMQa5o"}),variant:"error",timeout:5}),Z.warn("[Google Drive Picker] No access token received."),t?.();return}try{a(f.access_token,c)}catch(m){console.log(m)}}}).requestAccessToken()},[a,t,o,s]);return d.useMemo(()=>({openPicker:i}),[i])},Y7e=({connectorId:e,onFilesSelected:t})=>{const n="sources-menu-attach-file-connector",{openPicker:r}=Q7e({onSelectFiles:t,reason:n}),s=d.useCallback(()=>{switch(e){case"google_drive":r();break;default:throw new Error(`Connector ${e} not implemented`)}},[e,r]);return d.useMemo(()=>({openFilePicker:s}),[s])},Q7e=({onSelectFiles:e,reason:t})=>{const{connectorsMap:n}=Af({reason:t,skipConnectorPickerCredentials:!1}),{openPicker:r}=eQ({isAudioVideoFilesEnabled:!0}),s=d.useCallback(()=>{r({clientId:n?.google_drive?.picker_credentials?.client_id??"",loginHint:n?.google_drive?.connection_display_name??"",mode:"attachment",onPicked:e})},[r,e,n]);return d.useMemo(()=>({openPicker:s}),[s])},NA=A.memo(({size:e="medium",user:t,showEdit:n,onChange:r,anon:s,altText:o,defaultIcon:a=B("user-filled"),rounded:i=!0,showBackground:c=!0,showProBadge:u,showMaxBadge:f,className:m,badgeProps:p})=>{const h=s?B("sunglasses-filled"):a,g=d.useCallback(()=>{const y=document.createElement("input");y.type="file",y.accept="image/*",y.onchange=x=>{const v=x.target.files?.[0];if(v){const b=new FileReader;b.onload=_=>{r&&r(_.target?.result)},b.readAsDataURL(v)}},y.click()},[r]);return l.jsx("div",{className:z("text-inverse relative",m),children:l.jsxs("div",{className:z("relative flex aspect-square shrink-0 items-center justify-center",c?"bg-subtler":"bg-transparent",{"rounded-full":i,"size-3":e==="tiny","size-4":e==="mini","size-5":e==="small","size-6":e==="base","size-8":e==="medium","size-10":e==="large","size-20":e==="xlarge","ring-super border-inverse border-2 ring-[1.5px]":u,"ring-max border-inverse border-2 ring-[1.5px]":f}),children:[p?.show&&l.jsx("div",{className:z("absolute right-0 top-0 size-3 -translate-y-1/4 translate-x-1/4 select-none rounded-full border-2",p?.className)}),t&&!s?l.jsx("img",{alt:o??"User avatar",className:z("size-full object-cover",{"rounded-full":i}),src:t}):l.jsx(V,{color:"light",className:"flex items-center justify-center",children:l.jsx(ut,{name:h,className:"size-[65%]"})}),n&&e!=="small"&&l.jsx("div",{className:"bg-base absolute -bottom-1 -right-2 rounded-full",children:l.jsx(Ge,{ariaLabel:"Edit avatar",variant:t?"common":"primary",size:e!=="xlarge"?"tiny":"small",pill:!0,icon:t?B("edit"):B("plus"),onClick:g})}),u&&l.jsx("div",{className:z("absolute top-full mt-[-6px] w-[24px] rounded-r-full bg-current p-[1.5px] [&>div]:w-full",{"opacity-0":e==="small"},{"w-lg mt-[-10px]":e==="xlarge"}),children:l.jsx(Gd,{size:"tiny",color:"super",variant:"pro",isPro:!0})}),f&&l.jsx("div",{className:z("absolute left-1/2 top-full mt-[-6px] flex w-[28px] -translate-x-1/2 items-center justify-center rounded-r-full bg-current p-[1.5px] [&>div]:w-full",{"opacity-0":e==="small"},{"w-xl mt-[-10px]":e==="xlarge"}),children:l.jsx(Gd,{size:"small",variant:"max",isMax:!0})})]})})});NA.displayName="Avatar";const X7e=({cometMcpSources:e})=>{const t=J();return d.useCallback(r=>{if(Wi(r))return Yx[r].icon;if(uu(r))return Z7e(r,t);if(Ja(r)){const s=Df(r);return()=>e[s]?.avatar}},[t,e])};function Z7e(e,t){const n=If(e);if(!n)return;const r=kc(e),s=t.formatMessage({id:"egoZUguuZl",defaultMessage:"{name} logo"},{name:r});return()=>l.jsx(NA,{user:n,size:"mini",rounded:!1,showBackground:!1,altText:s})}const nc=()=>{const{cometMcpSources:e}=Nf(),t=fW({cometMcpSources:e}),n=X7e({cometMcpSources:e});return d.useMemo(()=>({getSourceLabel:t,getSourceIcon:n}),[t,n])},tQ=A.memo(({connectorId:e,connected:t})=>{const n="sources-menu-attach-file-connector",{getSourceLabel:r,getSourceIcon:s}=nc(),{handleConnect:o}=J4({reason:n}),a=On(),{openFilePicker:i}=Y7e({connectorId:e,onFilesSelected:()=>{throw new Error("Not implemented")}}),c=d.useCallback(()=>{if(!t){o({connectorName:e,redirectPath:a||void 0,unauthedRedirectPath:a||void 0});return}i()},[t,e,o,a,i]),u=r(e),f=s(e),m=t?void 0:l.jsx(rn,{icon:B("arrow-up-right"),size:"small"});return l.jsx(Dt.Item,{onSelect:c,leadingAccessory:f,trailingAccessory:m,children:u})});tQ.displayName="SourcesMenuAttachFileConnector";const nQ=Ft("SourcesMenuFileInputContext",null);function J7e(){const e=d.useContext(nQ);if(!e)throw new Error("useSourcesMenuFileInput must be used within SourcesMenuFileInputProvider");return e}const rQ=A.memo(({children:e})=>{const t=d.useRef(null),n=d.useCallback(()=>{t.current?.click()},[]),r=d.useCallback(o=>{const a=o.target.files;if(a&&a.length>0)throw new Error("Not implemented");t.current&&(t.current.value="")},[]),s=d.useMemo(()=>({open:n}),[n]);return l.jsxs(nQ.Provider,{value:s,children:[l.jsx("input",{ref:t,type:"file",multiple:!0,accept:uV,style:{display:"none"},onChange:r}),e]})});rQ.displayName="SourcesMenuFileInputProvider";const eRe={defaultMessage:"Local files",id:"xMmQ4F7z3A"},aE=A.memo(({label:e=eRe})=>{const{open:t}=J7e();return l.jsx(Dt.Item,{onSelect:t,leadingAccessory:B("paperclip"),children:l.jsx(je,{...e})})});aE.displayName="SourcesMenuAttachLocalFileMenuItem";function tRe(e){return e!=null}const _j=W({defaultMessage:"Attach a file",id:"ydgifDAqLp"}),sQ=d.memo(()=>{const{connectorsMap:e}=Af({reason:"sources-menu"}),t=d.useMemo(()=>MV.map(n=>{const r=e[n];return!r||!Iz(r.name)?null:l.jsx(tQ,{connectorId:r.name,connected:r.connected},n)}).filter(tRe),[e]);return t.length===0?l.jsx(aE,{label:_j}):l.jsxs(Dt.Submenu,{triggerElement:l.jsx(Dt.SubmenuItem,{leadingAccessory:B("paperclip"),children:l.jsx(je,{..._j})}),children:[l.jsx(aE,{}),t]})});sQ.displayName="SourcesMenuAttachFileMenuItem";const nRe=(e,t)=>{const n=t?.isOverlapping??!1,r=t?.stackDirection??"left";if(!e.length)return l.jsx(ge,{icon:yM,size:"sm"});const s=Math.max(1,t?.maxVisuals??3),o=f=>{if(!(!n||f))switch(t?.size){case"sm":return"-0.25rem";case"md":return"-0.375rem";case"lg":return"-0.5rem";case"xl":return"-0.625rem";default:return}},a=()=>{const f=z("relative flex items-center justify-center",{"rounded-full":t?.shape==="circle"||!t?.shape,"rounded-none":t?.shape==="square","size-4":t?.size==="sm","size-5":t?.size==="md","size-6":t?.size==="lg","size-7":t?.size==="xl"});return!n||!e||!(e.length>1||(t?.alwaysApplyOverlappingStyles??!1))?f:z(f,t?.overlappingClassName??"bg-base ring-subtlest",{"ring-1":t?.size==="sm"||t?.size==="md","ring-2":t?.size==="lg"||t?.size==="xl"})},i=(t?.showRemainderCount??!0)&&e.length>s,c=s===1&&e.length>1&&i?0:i?s-1:Math.min(s,e.length),u=e.slice(0,c).map((f,m)=>l.jsx("div",{className:a(),style:{zIndex:r==="left"?e.length-m-1:e.length+m,marginLeft:o(m===0)},children:f},m));return l.jsxs("div",{className:z("isolate",t?.containerClass??"my-xs flex items-center"),children:[l.jsxs("div",{className:t?.innerClassName??z("flex items-center",{"gap-2":!n}),children:[u,i&&l.jsx("div",{className:z(a(),{"mx-1":c===0}),style:{zIndex:r==="left"?-1:e.length+s,marginLeft:o(c===0)},children:l.jsxs(V,{variant:"tinyMono",color:"light",inline:!0,children:["+",e.length-c]})})]}),t?.rightText&&l.jsx("div",{className:"ml-2",children:t.rightText})]})},rRe=5;function sRe(e){return e!=null}const oQ=A.memo(({sources:e,size:t="default"})=>{const{getSourceIcon:n}=nc();if(e.length>0){const r=o=>{const a=n(o);return a?l.jsx(rn,{icon:a,size:t},o):null},s=e.map(r).filter(sRe);return nRe(s,{isOverlapping:!0,maxVisuals:rRe,size:"md",stackDirection:"right",overlappingClassName:"overflow-hidden bg-base ring-subtlest"})}return l.jsx(rn,{icon:yM,size:t})});oQ.displayName="SourcesMenuButtonContent";const aQ=A.memo(({sources:e,tooltip:t,size:n="default",disabled:r=!1,...s})=>{const{$t:o}=J(),a=_x({variant:"text",disabled:r,size:n,iconOnly:e.length===1}),i=l.jsx(Ro,{"aria-label":o({defaultMessage:"Sources",id:"fhwTpAcBLC"}),className:a,disabled:r,...s,children:l.jsx(oQ,{sources:e,size:n})});return t?l.jsx(Fo,{content:t,children:i}):i});aQ.displayName="SourcesMenuButton";const iQ=d.memo(({source:e,enabled:t,onToggle:n})=>{const{cometMcpSources:r}=Nf(),{getSourceLabel:s,getSourceIcon:o}=nc(),a=Df(e),i=r[a];i||Z.error(`Server config not found for comet MCP source: ${e}`);const c=s(e),u=o(e),f=i?.description,m=l.jsx(Dt.SwitchItem,{leadingAccessory:u,checked:t,onCheckedChange:n,disabled:i?.disabled,children:c});return f?l.jsx(Fo,{content:f,side:"right",children:m}):m});iQ.displayName="SourcesMenuItemCometMcpSource";var g2;(function(e){e.CONNECTED="connected",e.DISCONNECTED="disconnected"})(g2||(g2={}));const lQ={linear_alt:{name:"Linear",tagline:W({defaultMessage:"Plan and track projects, issues, and team workflows in Linear",id:"6u9Zf65BGW"}),bullets:[W({defaultMessage:"Search across Linear issues, projects, and teams",id:"MicGE6HssU"}),W({defaultMessage:"Create and update Linear issues and projects",id:"scUqB1LbKr"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Linear whenever you query in Perplexity",id:"b/8mLQxIqE"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.linear.app",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167711-linear-connector-for-enterprise-pro",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12167711-linear-connector-for-enterprise-pro",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},google_drive:{name:"Google Drive",tagline:W({defaultMessage:"Get in-depth answers from your Google Drive content",id:"CDmY5AQsRD"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Google Drive files are automatically synced to Perplexity",id:"k0B4qzv3NH"}),W({defaultMessage:"File and folder selection is based on your existing Google Drive permissions",id:"J1Fu/3n3pb"})],consumerBullets:[W({defaultMessage:"Attach files from Google Drive to your query",id:"aUk7jts0tb"})],connectedBullets:[W({defaultMessage:"File and folder selection is based on your existing Google Drive permissions",id:"J1Fu/3n3pb"}),W({defaultMessage:"Opt into High-Precision Search for even more comprehensive answers",id:"5Q/lMIa53X"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://drive.google.com",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12870620-connecting-perplexity-with-google-drive",documentationUrl:null,footnote:null},sharepoint:{name:"SharePoint",tagline:W({defaultMessage:"Get in-depth answers from your SharePoint content",id:"H/XGo2cLQi"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your SharePoint files are automatically synced to Perplexity",id:"3asA6JKlOn"}),W({defaultMessage:"File and folder selection is based on your existing SharePoint permissions",id:"m2/iFnRhkg"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://microsoft.sharepoint.com/",supportUrl:null,documentationUrl:null,footnote:null},onedrive:{name:"OneDrive",tagline:W({defaultMessage:"Get in-depth answers from your OneDrive content",id:"6HI2ZlxJGV"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your OneDrive files are automatically synced to Perplexity",id:"gCHhNKes4R"}),W({defaultMessage:"File and folder selection is based on your existing OneDrive permissions",id:"YCVPoXax40"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage",documentationUrl:null,supportUrl:null,footnote:null},box:{name:"Box",tagline:W({defaultMessage:"Get in-depth answers from your Box content",id:"vj5W7AIDE6"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Box files are automatically synced to Perplexity",id:"tkl3HRlwOf"}),W({defaultMessage:"File and folder selection is based on your existing Box permissions",id:"LuX1iT7lFa"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.box.com/",documentationUrl:null,supportUrl:null,footnote:null},dropbox:{name:"Dropbox",tagline:W({defaultMessage:"Get in-depth answers from your Dropbox content",id:"+RPvqEE51/"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Dropbox files are automatically synced to Perplexity",id:"Qnsbs8527p"}),W({defaultMessage:"File and folder selection is based on your existing Dropbox permissions",id:"kzOZ3ZFcW4"})],consumerBullets:[W({defaultMessage:"Attach files from Dropbox to your query",id:"E/rzAALT5B"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.dropbox.com/",documentationUrl:null,supportUrl:null,footnote:null},notion_mcp:{name:"Notion",tagline:W({defaultMessage:"Search and create content on your Notion pages",id:"rXdfDrSVlj"}),bullets:[W({defaultMessage:"Search across your pages and data ",id:"Ib2j2yH5wv"}),W({defaultMessage:"Create new pages in your teamspace from Perplexity",id:"Ltbp+B60OB"}),W({defaultMessage:"Update your data on existing pages directly from Perplexity",id:"ldpNlZAKLQ"}),W({defaultMessage:"Data is retrieved from and written back to Notion whenever you query in Perplexity",id:"nbLEAiWYzT"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.notion.so/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167654-notion-connector-for-enterprise-pro",footnote:null},github_mcp_direct:{name:"GitHub",tagline:W({defaultMessage:"Search and manage your GitHub repositories",id:"67uxBLu4RH"}),bullets:[W({defaultMessage:"Search, analyze, and summarize your repositories and issues",id:"hi8CvW/ld8"}),W({defaultMessage:"Create, update, and manage issues and pull requests ",id:"6eZgVvjZEw"}),W({defaultMessage:"Monitor workflows ",id:"EduR5immBI"}),W({defaultMessage:"Search and manage notifications to streamline communication",id:"+zOuCOpAH8"}),W({defaultMessage:"Data is retrieved from and written back to GitHub whenever you query in Perplexity",id:"9EQO9mj0sd"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://github.com/",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12275669-github-connector-for-enterprise",documentationUrl:null,footnote:null},asana_mcp_direct:{name:"Asana",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Asana",id:"9AhVP0Y+6c"}),bullets:[W({defaultMessage:"Search across Asana tasks, projects, and teams",id:"GKC+Sx/2dm"}),W({defaultMessage:"Create and update Asana tasks and projects",id:"TnQ0Far/ZY"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Asana whenever you query in Perplexity",id:"9NNVAEg7U3"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://asana.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",footnote:null},asana_mcp_merge:{name:"Asana",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Asana",id:"9AhVP0Y+6c"}),bullets:[W({defaultMessage:"Search across Asana tasks, projects, and teams",id:"GKC+Sx/2dm"}),W({defaultMessage:"Create and update Asana tasks and projects",id:"TnQ0Far/ZY"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Asana whenever you query in Perplexity",id:"9NNVAEg7U3"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://asana.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},atlassian_mcp_direct:{name:"Atlassian",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Atlassian",id:"OKCrVfJwqD"}),bullets:[W({defaultMessage:"Search across Atlassian tasks, projects, and teams",id:"3UDuuWRtR5"}),W({defaultMessage:"Create and update Atlassian tasks and projects",id:"u+44P4c8w+"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Atlassian whenever you query in Perplexity",id:"7gmOJCXim3"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/collections/15347354-app-connectors",footnote:null},jira_mcp_merge:{name:"Jira",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Jira",id:"DBNOet3M55"}),bullets:[W({defaultMessage:"Search across Jira tasks, projects, and teams",id:"nWIt8qYQz1"}),W({defaultMessage:"Create and update Jira tasks and projects",id:"mUCQ5Z26EF"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Jira whenever you query in Perplexity",id:"CfzDXfmKKD"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524825-connecting-perplexity-with-jira",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524825-connecting-perplexity-with-jira",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},confluence_mcp_merge:{name:"Confluence",tagline:W({defaultMessage:"Search and create content on your Confluence pages",id:"7maYua4COa"}),bullets:[W({defaultMessage:"Search across your pages and data ",id:"Ib2j2yH5wv"}),W({defaultMessage:"Create new pages in your teamspace from Perplexity",id:"Ltbp+B60OB"}),W({defaultMessage:"Update your data on existing pages directly from Perplexity",id:"ldpNlZAKLQ"}),W({defaultMessage:"Data is retrieved from and written back to Confluence whenever you query in Perplexity",id:"Ifp49Im16y"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524852-connecting-perplexity-with-confluence",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524852-connecting-perplexity-with-confluence",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},microsoft_teams_mcp_merge:{name:"Microsoft Teams",tagline:W({defaultMessage:"Search and send messages in Microsoft Teams",id:"Rfl+yanh+2"}),bullets:[W({defaultMessage:"Search across Microsoft Teams messages and channels",id:"LF+Ow88sFq"}),W({defaultMessage:"Send and receive messages in Microsoft Teams",id:"1t8qQ+bxf2"}),W({defaultMessage:"Data is retrieved from and written back to Microsoft Teams whenever you query in Perplexity",id:"+bTrwFjG66"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://teams.microsoft.com",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12674820-microsoft-teams-connector",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12674820-microsoft-teams-connector",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},slack_direct:{name:"Slack",tagline:W({defaultMessage:"Search and post messages across your Slack workspace",id:"eGJ5wb/MzJ"}),bullets:[W({defaultMessage:"Search messages across DMs, private channels, and public channels you have access to in Slack",id:"Om6FOnY7N3"}),W({defaultMessage:"Post messages directly to Slack",id:"UOgLjThccO"}),W({defaultMessage:"Data is retrieved from and written back to Slack whenever you run a query in Perplexity",id:"Fy/OA6Fd79"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://slack.com",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167980-using-the-connector-for-slack",documentationUrl:null,footnote:null},gcal:{name:"Gmail with Calendar",tagline:W({defaultMessage:"Search, create, and manage your emails and calendar events",id:"R3VofVJjT+"}),bullets:[W({defaultMessage:"Search your Gmail and calendar",id:"GCr38D/MA3"}),W({defaultMessage:"Draft and send emails",id:"rMtvi6WyKE"}),W({defaultMessage:"Manage and monitor emails and events",id:"p70DVe/3eQ"}),W({defaultMessage:"Create and update calendar events",id:"ZLhGXocN5/"}),W({defaultMessage:"Data is retrieved from and written back to Gmail and Gcal whenever you query in Perplexity",id:"HsjdaQ7NYa"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://accounts.google.com/InteractiveLogin?emr=1<mpl=default&nojavascript=1&rm=false&service=mail&ss=1",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12168040-connecting-perplexity-with-gmail-and-google-calendar",footnote:null},outlook:{name:"Outlook",tagline:W({defaultMessage:"Search your emails and calendar events",id:"zNVRcAj90b"}),bullets:[W({defaultMessage:"Search your Outlook e-mail and calendar",id:"z5Tw6ljNsF"}),W({defaultMessage:"Manage and monitor emails and events",id:"p70DVe/3eQ"}),W({defaultMessage:"Data is retrieved from and written back to Outlook whenever you query in Perplexity",id:"xX8KEtSv2M"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.microsoft.com/en-us/microsoft-365/outlook/log-in",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12301355-connecting-perplexity-with-outlook-com",footnote:null},zoom:{name:"Zoom",tagline:W({defaultMessage:"Create and manage your Zoom meetings",id:"92puu01bno"}),bullets:[W({defaultMessage:"Create and schedule Zoom meetings",id:"Hg2Nbj5f0/"}),W({defaultMessage:"Manage your Zoom meeting settings",id:"Tb/8DnYiVx"}),W({defaultMessage:"Data is retrieved from and written back to Zoom whenever you query in Perplexity",id:"91ZZe8Fgz9"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://zoom.us",documentationUrl:null,supportUrl:null,footnote:null},factset:{name:"FactSet",tagline:W({defaultMessage:"Access financial data and research from FactSet",id:"csQI8CVJ2n"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.factset.com",documentationUrl:null,supportUrl:null,footnote:null},crunchbase:{name:"Crunchbase",tagline:W({defaultMessage:"Access company and startup data from Crunchbase",id:"K/lfyKAVXx"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.crunchbase.com",documentationUrl:null,supportUrl:null,footnote:null},wiley:{name:"Wiley",tagline:W({defaultMessage:"Access academic research and publications from Wiley",id:"EpMrMGNDQ2"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.wiley.com",documentationUrl:null,supportUrl:null,footnote:null},edgar:{name:"EDGAR",tagline:W({defaultMessage:"Access SEC filings and corporate reports",id:"njDhAKsJmy"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.sec.gov/edgar",documentationUrl:null,supportUrl:null,footnote:null},linear:{name:"Linear",tagline:W({defaultMessage:"Get in-depth answers from your Linear content",id:"TDJJ2nF0Dy"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.linear.app",documentationUrl:null,supportUrl:null,footnote:null},slack:{name:"Slack",tagline:W({defaultMessage:"Get in-depth answers from your Slack content",id:"XRQBjZFm1m"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://slack.com",documentationUrl:null,supportUrl:null,footnote:null},wiley_mcp_cashmere:{name:"Wiley",tagline:W({defaultMessage:"Access academic research and publications from Wiley",id:"EpMrMGNDQ2"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.wiley.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},cbinsights_mcp_cashmere:{name:"CB Insights",tagline:W({defaultMessage:"Access market intelligence and company data",id:"ey7oCLYTbw"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.cbinsights.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},pitchbook_mcp_cashmere:{name:"PitchBook",tagline:W({defaultMessage:"Access private capital market data",id:"JWsOkBIFuV"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.pitchbook.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},statista_mcp_cashmere:{name:"Statista",tagline:W({defaultMessage:"Access market and consumer data",id:"XJHKfhIMA3"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.statista.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}}},oRe=e=>e in lQ,aRe=(e,t=g2.DISCONNECTED)=>{const{$t:n}=J(),r=lu(),{data:s}=z4(),o=d.useMemo(()=>s?.find(a=>a.id===e),[s,e]);return d.useMemo(()=>{if(oRe(e)){const{websiteUrl:a,documentationUrl:i,tagline:c,supportUrl:u="https://www.perplexity.ai/help-center/en/articles/10672063-introduction-to-file-connectors-for-enterprise-organizations",footnote:f,consumerBullets:m,bullets:p,connectedBullets:h}=lQ[e],g=[{label:"Website",url:a,icon:B("link")}];i&&g.push({label:"Documentation",url:i,icon:B("book")}),u&&g.push({label:"Support",url:u,icon:B("help")});let y=p;return t===g2.CONNECTED&&h?y=h:!r&&m&&(y=m),{name:kc(e),tagline:c?n(c):null,footnote:f?{link:f.link,text:n(f.text)}:null,bullets:y.map(x=>n(x)),links:g}}if(o){const{name:a,display_name:i,description:c,long_description:u,homepage:f}=o.manifest,m=[];return f&&m.push({label:"Website",url:f,icon:B("link")}),{name:i??a,tagline:c,footnote:null,bullets:u?.split(` -`).map(p=>p.trim()).filter(Boolean)??[],links:m}}return{name:e,tagline:null,footnote:null,bullets:[],links:[]}},[n,e,r,o,t])},iRe=Ce(async()=>{const{ConnectorsEnableModal:e}=await Se(()=>q(()=>import("./ConnectorsEnableModal-CDHU0y1D.js"),__vite__mapDeps([143,4,1,8,3,9,6,7,14,108,10,11,12])));return{default:e}}),cQ=A.memo(({source:e,enabled:t,onToggle:n})=>{const r=ag(),{tagline:s}=aRe(e),o=d.useCallback(()=>{r({origin:ft.SOURCES_VIEW_MORE})},[r]),a=l.jsx(lRe,{source:e,enabled:t,onToggle:n,handleOpenPaywall:o});return s?l.jsx(Fo,{content:s,side:"right",children:l.jsx("span",{children:a})}):a});cQ.displayName="SourcesMenuItemConnector";const lRe=({source:e,enabled:t,onToggle:n,handleOpenPaywall:r})=>{const s="sources-menu-item-connector",{isConnected:o,getConnectionType:a}=sg({reason:s}),{openModal:i}=Uo(),{getSourceLabel:c,getSourceIcon:u}=nc(),f=o(e),m=c(e),p=u(e),h=d.useCallback(()=>{i(iRe,{connectorName:e,connectorAvatar:_3(e),connectionType:a(e),referrer:"ask",openInNewTab:!0,reason:s,legacyIdentifier:"__NONE__",handleOpenPaywall:r})},[i,e,s,a,r]);if(!f){const g=l.jsx(rn,{icon:B("arrow-up-right"),size:"small"});return l.jsx(Dt.Item,{leadingAccessory:p,trailingAccessory:g,onSelect:h,children:m})}return l.jsx(Dt.SwitchItem,{leadingAccessory:p,checked:t,onCheckedChange:n,children:m})};var ow,Cv="HoverCard",[uQ]=Vs(Cv,[Sf]),Sv=Sf(),[cRe,Ev]=uQ(Cv),dQ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:o,openDelay:a=700,closeDelay:i=300}=e,c=Sv(t),u=d.useRef(0),f=d.useRef(0),m=d.useRef(!1),p=d.useRef(!1),[h,g]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:Cv}),y=d.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>g(!0),a)},[a,g]),x=d.useCallback(()=>{clearTimeout(u.current),!m.current&&!p.current&&(f.current=window.setTimeout(()=>g(!1),i))},[i,g]),v=d.useCallback(()=>g(!1),[g]);return d.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),l.jsx(cRe,{scope:t,open:h,onOpenChange:g,onOpen:y,onClose:x,onDismiss:v,hasSelectionRef:m,isPointerDownOnContentRef:p,children:l.jsx(gx,{...c,children:n})})};dQ.displayName=Cv;var fQ="HoverCardTrigger",mQ=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Ev(fQ,n),o=Sv(n);return l.jsx(yx,{asChild:!0,...o,children:l.jsx(Et.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:rt(e.onPointerEnter,x2(s.onOpen)),onPointerLeave:rt(e.onPointerLeave,x2(s.onClose)),onFocus:rt(e.onFocus,s.onOpen),onBlur:rt(e.onBlur,s.onClose),onTouchStart:rt(e.onTouchStart,a=>a.preventDefault())})})});mQ.displayName=fQ;var RA="HoverCardPortal",[uRe,dRe]=uQ(RA,{forceMount:void 0}),pQ=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,o=Ev(RA,t);return l.jsx(uRe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:r})})})};pQ.displayName=RA;var y2="HoverCardContent",hQ=d.forwardRef((e,t)=>{const n=dRe(y2,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,o=Ev(y2,e.__scopeHoverCard);return l.jsx(Hr,{present:r||o.open,children:l.jsx(fRe,{"data-state":o.open?"open":"closed",...s,onPointerEnter:rt(e.onPointerEnter,x2(o.onOpen)),onPointerLeave:rt(e.onPointerLeave,x2(o.onClose)),ref:t})})});hQ.displayName=y2;var fRe=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,...i}=e,c=Ev(y2,n),u=Sv(n),f=d.useRef(null),m=Sn(t,f),[p,h]=d.useState(!1);return d.useEffect(()=>{if(p){const g=document.body;return ow=g.style.userSelect||g.style.webkitUserSelect,g.style.userSelect="none",g.style.webkitUserSelect="none",()=>{g.style.userSelect=ow,g.style.webkitUserSelect=ow}}},[p]),d.useEffect(()=>{if(f.current){const g=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",g),()=>{document.removeEventListener("pointerup",g),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),d.useEffect(()=>{f.current&&pRe(f.current).forEach(y=>y.setAttribute("tabindex","-1"))}),l.jsx(vx,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:rt(o,g=>{g.preventDefault()}),onDismiss:c.onDismiss,children:l.jsx(lM,{...u,...i,onPointerDown:rt(i.onPointerDown,g=>{g.currentTarget.contains(g.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...i.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),mRe="HoverCardArrow",gQ=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Sv(n);return l.jsx(cM,{...s,...r,ref:t})});gQ.displayName=mRe;function x2(e){return t=>t.pointerType==="touch"?void 0:e()}function pRe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var hRe=dQ,gRe=mQ,yRe=pQ,xRe=hQ,vRe=gQ,kv="Popover",[yQ]=Vs(kv,[Sf]),Cg=Sf(),[bRe,rc]=yQ(kv),xQ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=Cg(t),c=d.useRef(null),[u,f]=d.useState(!1),[m,p]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:kv});return l.jsx(gx,{...i,children:l.jsx(bRe,{scope:t,contentId:ls(),triggerRef:c,open:m,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:d.useCallback(()=>f(!0),[]),onCustomAnchorRemove:d.useCallback(()=>f(!1),[]),modal:a,children:n})})};xQ.displayName=kv;var vQ="PopoverAnchor",_Re=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=rc(vQ,n),o=Cg(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return d.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(yx,{...o,...r,ref:t})});_Re.displayName=vQ;var bQ="PopoverTrigger",_Q=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=rc(bQ,n),o=Cg(n),a=Sn(t,s.triggerRef),i=l.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":MQ(s.open),...r,ref:a,onClick:rt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(yx,{asChild:!0,...o,children:i})});_Q.displayName=bQ;var DA="PopoverPortal",[wRe,CRe]=yQ(DA,{forceMount:void 0}),wQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=rc(DA,t);return l.jsx(wRe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:r})})})};wQ.displayName=DA;var Xd="PopoverContent",CQ=d.forwardRef((e,t)=>{const n=CRe(Xd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=rc(Xd,e.__scopePopover);return l.jsx(Hr,{present:r||o.open,children:o.modal?l.jsx(ERe,{...s,ref:t}):l.jsx(kRe,{...s,ref:t})})});CQ.displayName=Xd;var SRe=qp("PopoverContent.RemoveScroll"),ERe=d.forwardRef((e,t)=>{const n=rc(Xd,e.__scopePopover),r=d.useRef(null),s=Sn(t,r),o=d.useRef(!1);return d.useEffect(()=>{const a=r.current;if(a)return rT(a)},[]),l.jsx(lg,{as:SRe,allowPinchZoom:!0,children:l.jsx(SQ,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rt(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:rt(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,u=i.button===2||c;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:rt(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),kRe=d.forwardRef((e,t)=>{const n=rc(Xd,e.__scopePopover),r=d.useRef(!1),s=d.useRef(!1);return l.jsx(SQ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),SQ=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...m}=e,p=rc(Xd,n),h=Cg(n);return nT(),l.jsx(Xx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(vx,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:l.jsx(lM,{"data-state":MQ(p.open),role:"dialog",id:p.contentId,...h,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),EQ="PopoverClose",MRe=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=rc(EQ,n);return l.jsx(Et.button,{type:"button",...r,ref:t,onClick:rt(e.onClick,()=>s.onOpenChange(!1))})});MRe.displayName=EQ;var TRe="PopoverArrow",kQ=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Cg(n);return l.jsx(cM,{...s,...r,ref:t})});kQ.displayName=TRe;function MQ(e){return e?"open":"closed"}var ARe=xQ,NRe=_Q,RRe=wQ,DRe=CQ,jRe=kQ;const IRe=8,wj=10,PRe=200,ORe=300,Cj="rounded-xl",Sj="p-sm",Ej=ci(["rounded-xl","shadow-overlay"],{variants:{appearance:{dark:"bg-dark",light:"bg-base"},side:{top:"data-[state=closed]:animate-slideDownAndFadeOut data-[state=open]:animate-slideUpAndFadeIn",bottom:"data-[state=closed]:animate-slideUpAndFadeOut data-[state=open]:animate-slideDownAndFadeIn",left:"data-[state=closed]:animate-slideRightAndFadeOut data-[state=open]:animate-slideLeftAndFadeIn",right:"data-[state=closed]:animate-slideLeftAndFadeOut data-[state=open]:animate-slideRightAndFadeIn"}},defaultVariants:{appearance:"dark",side:"bottom"}});function Fl({triggerElement:e,children:t,appearance:n="system",side:r="bottom",align:s="center",open:o,onOpenChange:a,maxWidthPx:i=320,offsetPx:c=IRe,shouldShowArrow:u=!1,disabled:f=!1,interaction:m="click",openDelayMs:p,closeDelayMs:h,onWheelContent:g,onContentMouseEnter:y,onContentMouseLeave:x,...v}){const{isMobileStyle:b}=Bo(),{isOpen:_,handleOpenChange:w}=Rme({open:o,onOpenChange:a}),S=nge(),C=n!=="system"?n:S?.colorScheme||"dark",E=wa(v),T=z("overflow-hidden -translate-y-two [clip-path:inset(1px_1px_0px_1px)]",{"fill-[oklch(var(--dark-background-base-color))] dark:stroke-[1.5px] dark:stroke-subtler":C==="dark","fill-[oklch(var(--background-base-color))] stroke-[1.5px] stroke-subtler":C==="light"}),k=d.useCallback(N=>{g?.({deltaX:N.deltaX,deltaY:N.deltaY})},[g]);if(f)return e;if(b)return l.jsx(F$,{isOpen:_,onToggle:w,triggerElement:e,children:l.jsx("div",{className:"text-sm",children:t})});const I="calc(var(--radix-popper-available-height) - 16px)",M=l.jsx("div",{className:z("text-sm",{"text-white":C==="dark","text-default":C==="light"}),style:{maxWidth:i},children:t});return m==="hover"?l.jsxs(hRe,{open:_,onOpenChange:w,openDelay:p??PRe,closeDelay:h??ORe,children:[l.jsx(gRe,{asChild:!0,...E,children:e}),l.jsx(yRe,{children:l.jsxs(xRe,{side:r,align:s,sideOffset:c,avoidCollisions:!0,collisionPadding:wj,className:z(Ej({appearance:C,side:r}),"min-w-[var(--radix-hover-card-trigger-width)]"),onWheel:k,onMouseEnter:y,onMouseLeave:x,onPointerEnter:y,onPointerLeave:x,children:[l.jsx(R3,{className:Cj,maxHeight:I,children:l.jsx("div",{className:Sj,children:M})}),u&&l.jsx(vRe,{width:12,height:6,className:T})]})})]}):l.jsxs(ARe,{open:_,onOpenChange:w,children:[l.jsx(NRe,{asChild:!0,...E,children:e}),l.jsx(RRe,{children:l.jsxs(DRe,{side:r,align:s,sideOffset:c,avoidCollisions:!0,collisionPadding:wj,className:z(Ej({appearance:C,side:r}),"min-w-[var(--radix-popover-trigger-width)]"),onWheel:k,onMouseEnter:y,onMouseLeave:x,onPointerEnter:y,onPointerLeave:x,children:[l.jsx(R3,{className:Cj,maxHeight:I,children:l.jsx("div",{className:Sj,children:M})}),u&&l.jsx(jRe,{width:12,height:6,className:T})]})})]})}const TQ=()=>{const{$t:e}=J();return l.jsx(V,{variant:"micro",color:"super",className:"border-super inline-block rounded border px-1 py-0",children:e({id:"Hw1hSDsL+0",defaultMessage:"Premium data"})})};TQ.displayName="PremiumSourceBadge";const LRe=(e,t)=>{switch(e){case"wiley_mcp_cashmere":return t.formatMessage({defaultMessage:"Search business, medical, STEM, and psychology books, and medical & life sciences journals",id:"RX0/lKeA+h"});case"cbinsights_mcp_cashmere":return t.formatMessage({defaultMessage:"Search market insights, market maps, and company activity",id:"7NjNyz7XKj"});case"pitchbook_mcp_cashmere":return t.formatMessage({defaultMessage:"Search firmographics for private and public companies",id:"pCeNCFTGuu"});case"statista_mcp_cashmere":return t.formatMessage({defaultMessage:"Search aggregated statistics, market data, trends, and forecasts",id:"vo4Zj58C7M"});default:At(e)}},FRe=e=>{switch(e){case"wiley_mcp_cashmere":return xV;case"cbinsights_mcp_cashmere":return vV;case"pitchbook_mcp_cashmere":return bV;case"statista_mcp_cashmere":return _V;default:return e}},BRe={wiley_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12868503-using-perplexity-with-wiley",pitchbook_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869442-leveraging-pitchbook-data-with-perplexity",statista_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869733-using-premium-statista-data-with-perplexity",cbinsights_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869855-integrating-cb-insights-data-with-perplexity"},URe=({sourceId:e})=>{const t=J(),{isMax:n}=$t(),r=FRe(e),s=LRe(e,t),o=BRe[e];return l.jsxs("div",{className:z("flex flex-col gap-2 p-2",{"max-super-override":n}),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx(V,{variant:"tinyBold",color:"white",children:r}),l.jsx(TQ,{})]}),l.jsx(V,{variant:"tiny",color:"white",className:"text-pretty",children:s}),o&&l.jsx("p",{className:"text-pretty text-xs text-white",children:l.jsx(qh,{href:o,target:"_blank",rel:"noopener",variant:"inline",muted:!0,children:t.formatMessage({defaultMessage:"Learn about complementary paid content from {sourceName}",id:"8uL70j2Vzs"},{sourceName:r})})}),l.jsx(HRe,{})]})},VRe=({variant:e,onClick:t,children:n})=>l.jsx(Ro,{onClick:t,className:z(_x({variant:"primary",size:"small",disabled:!1,fullWidth:!1,rounded:!1,pill:!1,inline:!1}),{"!bg-max hover:!bg-max":e==="max"}),children:n}),HRe=()=>{const{$t:e}=J(),{openModal:t}=pn().legacy;lu();const{hasAccessToProFeatures:n,isMax:r}=$t(),s=d.useCallback(()=>{t("pricingModal",{origin:ft.PREMIUM_SOURCE_TOOLTIP})},[t]),o=zRe({hasAccessToProFeatures:n,hasAccessToMaxFeatures:r});if(!o)return null;const a=n&&!r,i=a?"max":"pro",c=z("text-pretty",{"text-max":a,"text-super":!a});return l.jsxs(l.Fragment,{children:[l.jsx("hr",{className:"border-subtle bg-subtle my-2"}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tinyRegular",className:c,children:e(o.title)}),l.jsx(VRe,{variant:i,onClick:s,children:e(o.action)})]})]})};function zRe({hasAccessToProFeatures:e,hasAccessToMaxFeatures:t}){return e?t?null:{title:W({defaultMessage:"Get more queries with Max",id:"0iyoM20VTJ"}),action:W({defaultMessage:"Try Perplexity Max",id:"oorH6wdruv"})}:{title:W({defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"}),action:W({defaultMessage:"Try Perplexity Pro",id:"qXQPclCIaf"})}}const AQ=A.memo(({source:e,enabled:t,onToggle:n})=>{const{openOverlayId:r,setOpenOverlayId:s}=Bo(),{getSourceLabel:o,getSourceIcon:a}=nc(),i=o(e),c=a(e),{getSourceLimit:u}=K4(),f=d.useRef(null),m=d.useId(),p=d.useCallback(()=>{f.current&&clearTimeout(f.current),s(m)},[m,s]),h=d.useCallback(()=>{f.current=setTimeout(()=>{s(x=>x===m?null:x)},300)},[m,s]),g=d.useMemo(()=>{const{remaining:x}=u(e);return x===0},[u,e]),y=d.useMemo(()=>l.jsx("div",{onMouseEnter:p,onMouseLeave:h,children:l.jsx(Dt.SwitchItem,{leadingAccessory:c,checked:t,onCheckedChange:n,disabled:g,children:i})}),[g,t,p,h,c,i,n]);return l.jsx(Fl,{interaction:"hover",appearance:"dark",triggerElement:y,side:"right",open:r===m,onOpenChange:Ao,children:l.jsx("div",{onMouseEnter:p,onMouseLeave:h,children:l.jsx(URe,{sourceId:e})})})});AQ.displayName="SourcesMenuItemPremiumData";const WRe=(e,t)=>{if(Wi(e))return Yx[e].description(t)},iE=d.memo(({source:e,enabled:t,onToggle:n})=>{const r=J(),{getSourceLabel:s,getSourceIcon:o}=nc(),a=s(e),i=o(e),c=WRe(e,r),u=l.jsx(Dt.SwitchItem,{leadingAccessory:i,checked:t,onCheckedChange:n,children:a});return c?l.jsx(Fo,{content:c,side:"right",children:u}):u});iE.displayName="SourcesMenuItemSource";const NQ=A.memo(({source:e,enabled:t,onToggle:n})=>{const{isMax:r}=$t(),s=d.useCallback(o=>{o.stopPropagation()},[]);return l.jsx("div",{onClick:s,className:z({"max-super-override":r}),children:l.jsx(GRe,{source:e,enabled:t,onToggle:n})})});NQ.displayName="SourcesMenuItem";const GRe=({source:e,enabled:t,onToggle:n})=>Jh(e)?l.jsx(AQ,{source:e,enabled:t,onToggle:n}):Wi(e)?l.jsx(iE,{source:e,enabled:t,onToggle:n}):uu(e)?l.jsx(cQ,{source:e,enabled:t,onToggle:n}):Ja(e)?l.jsx(iQ,{source:e,enabled:t,onToggle:n}):l.jsx(iE,{source:e,enabled:t,onToggle:n}),RQ=A.memo(({source:e,onSourceToggled:t,isSourceEnabled:n})=>{const r=d.useCallback(s=>t(e,s),[t,e]);return l.jsx(NQ,{source:e,enabled:n(e),onToggle:r},e)});RQ.displayName="MemoizedSourceMenuItem";const jA=A.memo(({sources:e,isSourceEnabled:t,onSourceToggled:n})=>e.map(r=>l.jsx(RQ,{source:r,onSourceToggled:n,isSourceEnabled:t},r)));jA.displayName="SourcesMenuItems";const DQ=A.memo(({sources:e,isSourceEnabled:t,onSourceToggled:n,minWidthPx:r,isOpen:s,onToggle:o})=>{if(e.length===0)return null;const a=s?{isOpen:s,onToggle:o}:{};return l.jsx(Dt.Submenu,{...a,triggerElement:l.jsx(Dt.SubmenuItem,{children:l.jsx(je,{defaultMessage:"More sources",id:"VQ/e7ISbIh"})}),minWidthPx:r,children:l.jsx(jA,{sources:e,isSourceEnabled:t,onSourceToggled:n})})});DQ.displayName="SourcesMenuMoreSourcesSubmenu";const $Re="sources-menu-suggested-sources",jQ=A.memo(({sources:e,onSourceToggled:t,isSourceEnabled:n})=>l.jsx("div",{"data-testid":$Re,children:l.jsx(jA,{sources:e,isSourceEnabled:n,onSourceToggled:t})}));jQ.displayName="SourcesMenuSuggestedSources";const qRe=({sources:e,omit:t=[]})=>{const n="use-enabled-sources",{isConnected:r}=sg({reason:n}),s=d.useMemo(()=>{const o=new Set;return e.forEach(a=>{if(!t.includes(a)){if(!uu(a)||Jh(a)){o.add(a);return}r(a)&&o.add(a)}}),Array.from(o)},[e,t,r]);return d.useMemo(()=>({sources:s}),[s])},KRe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"sources-dropdown-ui-redesign-files",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},YRe="pplx_source_activity",IA=()=>{const[e,t]=Qi(YRe,[]),n=d.useCallback(r=>{t(s=>[{sourceType:r,lastUsedAt:Date.now()},...s].slice(0,25))},[t]);return d.useMemo(()=>({activity:e,trackSourceActivity:n}),[e,n])},QRe=["edgar","cbinsights_mcp_cashmere","gcal","google_drive"],IQ=({sources:e,defaultSuggestions:t=QRe,count:n=5})=>{const{activity:r}=IA(),[s,o]=d.useState(r),a=d.useMemo(()=>{const c=new Set(["web"]);return s.sort((u,f)=>f.lastUsedAt-u.lastUsedAt).map(u=>u.sourceType).filter(ha).forEach(u=>c.add(u)),t.forEach(u=>c.add(u)),e.forEach(u=>c.add(u)),Array.from(c).filter(u=>e.includes(u)).slice(0,n)},[s,n,e,t]),i=d.useCallback(()=>{o(r)},[r]);return d.useMemo(()=>({suggested:a,refresh:i}),[a,i])},kj=225,XRe={crunchbase:["web"]},ZRe={web:["crunchbase"]},PQ=({isOpen:e,sources:t,tooltip:n,size:r="default",disabled:s=!1,onChange:o,onOpen:a,onClose:i,triggerElement:c,omittedSources:u,omitCometMcpSources:f=!1})=>{const m="sources-menu",{isAllowed:p}=sg({reason:m}),{sources:h}=X4({omitCometMcpSources:f,isConnectorAllowed:p,omittedSources:u}),{trackSourceActivity:g}=IA(),{variation:y}=KRe(!1),{suggested:x,refresh:v}=IQ({sources:h}),{sources:b}=qRe({sources:h,omit:x}),_=d.useMemo(()=>h.filter(M=>!x.includes(M)&&!b.includes(M)),[h,x,b]),w=d.useMemo(()=>[...b,..._],[b,_]),S=d.useCallback(M=>{M?(v(),a?.()):i?.()},[a,i,v]),C=d.useCallback(M=>t.includes(M),[t]),E=d.useCallback(M=>{g(M);const N=new Set([...t,M]);XRe[M]?.forEach(D=>{N.add(D)}),o(Array.from(N))},[t,o,g]),T=d.useCallback(M=>{const N=new Set(t);N.delete(M),ZRe[M]?.forEach(D=>{N.delete(D)}),o(Array.from(N))},[t,o]),k=d.useCallback((M,N)=>{C(M)!==N&&(N?E(M):T(M))},[C,E,T]),I=d.useMemo(()=>c??l.jsx(aQ,{sources:t,size:r,disabled:s,tooltip:n}),[c,t,r,s,n]);return l.jsxs(Dt,{isOpen:e,onToggle:S,align:"end",minWidthPx:kj,triggerElement:I,maxHeightPx:400,children:[y&&l.jsxs(l.Fragment,{children:[l.jsx(sQ,{}),l.jsx(Dt.Separator,{})]}),l.jsx(jQ,{sources:x,isSourceEnabled:C,onSourceToggled:k}),l.jsx(Dt.Separator,{}),l.jsx(DQ,{sources:w,isSourceEnabled:C,onSourceToggled:k,minWidthPx:kj})]})};PQ.displayName="SourcesMenuContent";const PA=d.memo(e=>l.jsx(rQ,{children:l.jsx(PQ,{...e})}));PA.displayName="SourcesMenu";const Mj=He({disabled:{defaultMessage:"Start a new thread to change sources",id:"jKXi56aXv8"},enabled:{defaultMessage:"Set sources for search",id:"yAyuRoLEjt"}}),OQ=A.memo(({disabled:e=!1,...t})=>{const{$t:n}=J(),r=n(e?Mj.disabled:Mj.enabled);return l.jsx(PA,{disabled:e,tooltip:r,...t})});OQ.displayName="AskInputSourcesMenu";const LQ=A.memo(({isInitializing:e,startTranscription:t,error:n=null,disabled:r=!1})=>{const{$t:s}=J(),[o,a]=d.useState(e),i=d.useCallback(()=>{a(!0),t?.()},[t]);return d.useEffect(()=>{n&&a(!1)},[n]),l.jsx("div",{className:"relative",children:l.jsx(wt,{"aria-label":s({defaultMessage:"Dictation",id:"0eNg7Kdki1"}),icon:B("microphone"),isLoading:!n&&(e||o),variant:"text",onClick:i,disabled:r,size:Ht.small})})});LQ.displayName="DictationButton";const FQ=A.memo(({stopTranscription:e})=>{const{$t:t}=J();return l.jsx("div",{className:"relative",children:l.jsx(wt,{"aria-label":t({defaultMessage:"Stop dictation",id:"De+8liLWgX"}),icon:B("player-stop-filled"),variant:"tonal",onClick:e,disabled:!1,size:Ht.small})})});FQ.displayName="DictationStopButton";const BQ=A.memo(({onSubmit:e,isDisabled:t=!1,toolTip:n})=>{const{$t:r}=J();return l.jsxs("div",{className:"relative ml-2",children:[l.jsx("div",{className:"bg-super/20 absolute inset-[10%] animate-[ping_1.5s_cubic-bezier(0,0,0.2,1)_infinite] rounded-lg"}),l.jsx(wt,{"aria-label":n||r({defaultMessage:"Submit dictation",id:"gDpUQHAEOK"}),icon:B("check"),variant:"primary",onClick:e,disabled:t,size:Ht.small})]})});BQ.displayName="DictationSubmitButton";const UQ=A.memo(({onStopButtonClick:e,variant:t="inverted"})=>{const{$t:n}=J();return l.jsx(V4,{isVisible:!0,animationType:"slide",children:t==="tonal"?l.jsx(wt,{"aria-label":n({defaultMessage:"Stop generating response",id:"wXXKXUJh1s"}),variant:"tonal",icon:B("player-stop-filled"),onClick:e,size:"small"}):l.jsx(Ge,{toolTip:n({defaultMessage:"Stop generating response",id:"wXXKXUJh1s"}),variant:t,icon:B("player-stop-filled"),onClick:e,size:"small",extraCSS:"text-caution hover:!bg-caution hover:!text-white ml-2"})})});UQ.displayName="StopButton";const Gf=A.memo(()=>l.jsx("div",{className:"bg-base fixed inset-0 z-[999] flex h-screen w-screen items-center justify-center opacity-50"}));Gf.displayName="VoiceToVoiceModalLoader";Ce(async()=>{const{VoiceToVoiceModal:e}=await Se(()=>q(()=>import("./VoiceToVoiceModal-BQNxUwE1.js"),__vite__mapDeps([144,4,1,9,3,6,7,145,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})});const VQ=A.memo(()=>{const{openModal:e}=pn().legacy,{openModal:t}=pn().updated,{$t:n}=J(),r=Wt(),s=Rn(),o=d.useCallback(()=>{r?s.push("/speak"):e("loginModal",{origin:ft.VOICE_TO_VOICE_BUTTON,pitchMessage:{title:"Sign in to unlock voice mode"}})},[r,e,t,s]);return l.jsx("div",{className:"ml-2",children:l.jsx(wt,{onClick:o,size:Ht.small,icon:KU,variant:"primary",disabled:!1,"aria-label":n({defaultMessage:"Voice mode",id:"OnF9aqAuar"})})})});VQ.displayName="VoiceToVoiceButton";const JRe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"enable-clarifying-questions",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function HQ(){const{variation:e}=JRe(!1);return e}function lE(e={}){const t=new URL(window.location.href);for(const[n,r]of Object.entries(e))typeof r>"u"?t.searchParams.delete(n):t.searchParams.set(n,r);zQ(Object.fromEntries(t.searchParams))}function zQ(e){const t=new URL(window.location.href),r=(e?new URLSearchParams(e):new URLSearchParams).toString();r!==t.searchParams.toString()&&window.history.replaceState({},"",`?${r}`)}const WQ=A.memo(({toolTip:e,icon:t,isDisabled:n,value:r,querySource:s,size:o=Ht.small,handleSubmit:a,...i})=>l.jsx(Ge,{...i,ariaLabel:"Submit",toolTip:e,icon:t,variant:"primary",size:o,onClick:n?void 0:()=>a({query:r,querySource:s}),disabled:n,extraCSS:"!duration-100"}));WQ.displayName="SubmitButton";const Tj=Ce(async()=>{const{VoiceToVoiceModal:e}=await Se(()=>q(()=>import("./VoiceToVoiceModal-BQNxUwE1.js"),__vite__mapDeps([144,4,1,9,3,6,7,145,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),aw=({className:e,...t})=>l.jsx("div",{className:e,children:l.jsx(WQ,{...t,value:""})}),e9e=({value:e,json:t,submitWillFork:n,isFollowUp:r,isDisabled:s,querySource:o,errorMessage:a,handleSubmit:i,fileUploadRef:c,showFileUpload:u,fileUploadTooltip:f,showStopButton:m,showModelSelector:p,onStopButtonClick:h,onFilePickerOpen:g,onFilePickerClose:y,showSources:x,useThreadSources:v,showRecency:b,disableActionButtons:_,startTranscription:w,stopTranscription:S,isTranscribing:C,isTranscriptionInitializing:E,isTranscriptionAvailable:T,transcriptionError:k=null,fileUploadErrorMessage:I,fileUploadWarningMessage:M,activeConnector:N=null,uploadedFiles:D,handleStartUpload:j,handleFileInput:F,isBoxFilePickerOpen:R=!1,handleCloseBoxFilePicker:P,cleanupBoxFilePicker:L,microsoftFilePickerOptions:U=null,handleCloseMicrosoftFilePicker:O,handleSelectSharepointSite:$,isMicrosoftFilePickerOpen:G=!1,fileInputRef:H,hasQuery:Q,isAudioVideoFilesEnabled:Y=!1,setAttachmentErrorMessage:te,isCometHome:se,isMissionControl:ae})=>{const X="ask-input-right-attributions",{isMobileStyle:ee,isMobileUserAgent:le}=Re(),{openModal:re}=pn().updated,{organization:ce}=mo({reason:X}),{$t:ue}=J(),me=HQ(),{activeMenu:we}=qr(),{onActiveMenuChange:ye}=jo(),{device:{isWindowsApp:_e}}=sn(),ke=fn(),{fileRepoInfo:De}=zx({reason:X}),xe=De.file_repository_type==="COLLECTION",Ue=b&&xe&&!r,Ee=d.useRef(e),Ke=d.useRef(t);Ee.current=e,Ke.current=t;const Nt=d.useCallback(({querySource:$e})=>{i({query:Ee.current,json:Ke.current,querySource:$e})},[i]),pe=D4($e=>$e.results.find(ht=>qt.isStatusPending(ht))),ve=an(pe?.display_model)==oe.RESEARCH||an(pe?.display_model)==oe.STUDIO;d.useEffect(()=>{if(!_e)return;const $e=new URLSearchParams(window.location.search);$e.get("voice-mode")?(lE({"voice-mode":void 0}),w?.()):$e.get("v2v")&&(lE({v2v:void 0}),re(Tj,{legacyIdentifier:"voiceToVoiceModal"}))},[ke,_e,w,re]),d.useEffect(()=>{const $e=()=>{T&&(C?S?.():w?.())},ht=()=>{re(Tj,{legacyIdentifier:"voiceToVoiceModal"})};return document.addEventListener("toggleVoiceToVoice",ht),document.addEventListener("toggleDictation",$e),()=>{document.removeEventListener("toggleDictation",$e),document.removeEventListener("toggleVoiceToVoice",ht)}},[C,T,w,S,re]);const Ae=!ae&&!r&&!se&&(!le&&!ee||!0),We=n?B("git-fork"):B("arrow-up"),pt=m&&me&&ve,Gt=()=>!pt||!o?null:l.jsx("div",{className:s?"pointer-events-none opacity-50":"",children:l.jsx(aw,{className:"ml-3",toolTip:a||ue({defaultMessage:"Anything else to consider?",id:"DDAw7Ictpp"}),icon:We,querySource:o,isDisabled:!1,handleSubmit:Nt})}),Le=()=>{if(_)return l.jsx(aw,{className:"ml-2",isDisabled:!0,icon:We,querySource:o??"home",handleSubmit:Ao});const $e=o&&l.jsx(aw,{className:"ml-2",toolTip:a||(n?ue({defaultMessage:"Start your own thread",id:"TAA16rUT4G"}):""),icon:We,isDisabled:s,querySource:o,handleSubmit:Nt},"submit-button"),ht=[];if(T&&(C?(ht.push(l.jsx(FQ,{stopTranscription:S},"dictation-stop-button")),o&&ht.push(l.jsx(BQ,{onSubmit:Pt},"dictation-submit-button"))):ht.push(l.jsx(LQ,{isInitializing:E,startTranscription:w,error:k,disabled:m},"dictation-button"))),m){const Zt=pt?"tonal":"inverted";ht.push(l.jsx(UQ,{onStopButtonClick:h,variant:Zt},"stop-button"))}else if(Ae){const Zt=(D?.length||Q)&&o&&!C;Zt?ht.push($e):!C&&!Zt&&ht.push(l.jsx(VQ,{},"voice-to-voice-button"))}else C||ht.push($e);return T||Ae?ht:$e},gt=d.useCallback(()=>ye(null),[ye]),Je=d.useCallback(()=>ye(Ir.RECENCY),[ye]);d.useCallback(()=>ye(Ir.ATTACHMENTS),[ye]);const Me=d.useCallback(()=>ye(Ir.UNIFIED_SOURCES),[ye]),{sources:Ve,setSources:lt}=pW({useThreadSources:v,reason:X}),xt=d.useMemo(()=>{if(!x)return!1;const $e=Ve.every(ht=>ht==="web");return r&&$e?!1:x},[x,r,Ve]),Pt=d.useCallback(()=>{S?.(),Q&&i({query:Ee.current,json:Ke.current,querySource:o})},[S,Q,i,o]);return C?l.jsxs(rE,{children:[o&&Le(),Gt()]}):l.jsxs(rE,{children:[xt&&l.jsx(OQ,{isOpen:we===Ir.UNIFIED_SOURCES,size:"small",sources:Ve,onChange:lt,onOpen:Me,onClose:gt,disabled:v}),p&&l.jsx(XY,{uploadedFiles:D}),Ue&&l.jsx(JY,{isOpen:we===Ir.RECENCY,onOpen:Je,onClose:gt}),u&&!1,o&&Le(),Gt()]})},GQ=A.memo(e9e);GQ.displayName="AskInputRightAttribution";const t9e=60,n9e=2e3,r9e=6,s9e=4,kp=(e,t)=>e?s9e:r9e,o9e=e=>!(e.length===0||e.includes(` -`)),a9e=e=>e.map(t=>({query:t.text,image:t.image_url,url:t.url,title:t.title,description:t.description,focus:t.focus})),i9e=e=>e.sort((t,n)=>t.url?-1:n.url?1:t.image?-1:n.image?1:0),cE=(e,t,n)=>{let r=e;r=e.filter(a=>!a.url);const s=jU(r,"query");if(n){const a=s.findIndex(i=>i.query===n);if(~a){const i=s[a];s.splice(a,1),s.unshift(i)}}const o=i9e(s);return[o,o.slice(0,kp(t))]},$Q=(e,t,n)=>{const r=n?e.replace(/\s+/g,"").toLocaleLowerCase():e,s=t.query;let o=0,a=0;for(;o{const n=e.replace(/\s+/g,""),r=[];let s="",o="",a=0,i=0;for(;ae?.includes("perplexity.ai")??!1,d9e=e=>e?.includes("perplexity.ai/finance")??!1,qQ=e=>e==="https://www.perplexity.ai/finance",KQ=A.memo(({query:e,completion:t,inputsAndCompletions:n,description:r,highlightPrefix:s,url:o,title:a,shouldShowTitle:i})=>{const c=d9e(o),u=qQ(o),f=r||(i&&a?a:e),m=c?f.toUpperCase():f,{$t:p}=J(),h=c?t?.toUpperCase():t;return u?l.jsx(V,{variant:"small",inline:!0,children:p({defaultMessage:"{perplexity} Finance",id:"LnL5Kdg1cp"},{perplexity:"Perplexity"})},"perplexity-finance"):l.jsxs(l.Fragment,{children:[!r&&n?.length&&s?n.map(([g,y],x)=>g?l.jsx(V,{color:"light",variant:"small",className:"inline",as:"div",children:g},`${x}-${g}`):l.jsx(V,{className:"inline whitespace-pre",variant:"small",as:"div",children:y},`${x}-${y}`)):l.jsx(V,{inline:!0,color:"light",variant:"small",children:m}),t&&!r&&s&&!n?.length&&l.jsx(V,{className:"whitespace-pre",inline:!0,variant:"small",children:h}),t&&!r&&!s&&l.jsx(V,{color:"light",inline:!0,variant:"small",children:h})]})});KQ.displayName="DefaultQueryContentComponent";const YQ=A.memo(({onClick:e,query:t,completion:n,inputsAndCompletions:r,url:s,suggestionIndex:o,keyboardFocusedIndex:a,setKeyboardFocusedIndex:i,leftIcon:c,rightIcon:u,className:f,description:m,title:p,shouldShowTitle:h,highlightPrefix:g=!0,category:y,QueryContentComponent:x=KQ,metadata:v,actionHandler:b})=>{const{isMobileUserAgent:_}=Re(),w="group-hover:opacity-100 group-data-[focused=self]:opacity-100",S="opacity-0 group-data-[focused=other]:opacity-0",C=d.useCallback(()=>{i?.(-1)},[i]),E=d.useCallback(T=>h&&p&&t?l.jsx(Io,{tooltipText:t,bodyClassName:"max-w-[300px]",showTooltip:!0,asChild:!0,tooltipLayout:"right",children:T}):T,[h,p,t]);return l.jsx(St,{children:E(l.jsx("div",{"data-focused":a===void 0||a===-1?"none":a===o?"self":"other","data-testid":`auto-suggestion-${(o??0)+1}`,className:z("group flex cursor-pointer flex-row items-start rounded-lg p-[8px]",f),onPointerDown:()=>{b?b():e(n?t+n:t)},onPointerLeave:C,children:l.jsxs("div",{className:"flex w-full min-w-0 flex-row whitespace-pre leading-tight",children:[l.jsx(V,{className:"-mr-three",color:"light",inline:!0,variant:"small",children:c}),l.jsx(V,{variant:"small",className:_?"truncate":"line-clamp-2 text-wrap",children:s?l.jsx(yt,{href:s,target:"_blank",rel:"noopener",children:l.jsx(x,{query:t,url:s,completion:n,inputsAndCompletions:r,description:m,category:y,highlightPrefix:g,metadata:v,title:p,shouldShowTitle:h})}):l.jsx(x,{query:t,url:s,completion:n,inputsAndCompletions:r,description:m,category:y,highlightPrefix:g,metadata:v,title:p,shouldShowTitle:h})}),u&&l.jsx(V,{variant:"smallBold",color:"super",inline:!0,className:z("pr-xs ml-auto",w,{[S]:!s}),children:u})]})}))})});YQ.displayName="SuggestionCard";const uE={ticker:{order:0,showHeader:!1,highlightPrefix:!1},suggestion:{order:1,showHeader:!1,highlightPrefix:!0},news:{displayName:"Latest News",order:2,showHeader:!0,highlightPrefix:!1},related_question:{displayName:"Related Questions",order:3,showHeader:!0,highlightPrefix:!1},shortcuts:{displayName:"Shortcuts",order:4,showHeader:!0,highlightPrefix:!0}},f9e=e=>{const t={};return e.forEach(n=>{const r=n.category||"suggestion";t[r]||(t[r]=[]),t[r].push(n)}),t},m9e=e=>Object.keys(e).sort((t,n)=>{const r=uE[t]?.order??Number.MAX_SAFE_INTEGER,s=uE[n]?.order??Number.MAX_SAFE_INTEGER;return r-s}),Aj=e=>{const{metadata:t}=e;return!!t&&t.type==="price"&&!!t.price_info&&typeof t.price_info.currentPrice=="number"&&!!t.price_info.change&&!!t.price_info.changePercentage},p9e=e=>[...e].sort((t,n)=>{const r=Aj(t),s=Aj(n);return r&&!s?-1:!r&&s?1:0}),QQ=A.memo(e=>{const{text:t,show:n,className:r}=e;return n?l.jsxs(l.Fragment,{children:[l.jsx(K,{className:z("my-sm sm:mx-sm border-b first:hidden",r)}),t&&l.jsx(K,{variant:"transparent",className:"sm:mx-sm mt-xs mb-sm pr-sm",children:l.jsx(V,{className:"w-max",variant:"tinyMono",color:"light",children:t})})]}):null});QQ.displayName="GroupItemSeparator";const XQ=A.memo(({category:e,suggestions:t,categoryConfig:n,value:r,focusedIndex:s,setFocusedIndex:o,handleSubmit:a,indexOffset:i,LeftIconComponent:c,RightIconComponent:u,QueryContentComponent:f,onFillButtonClick:m,titleClassName:p})=>{const h=d.useMemo(()=>e==="ticker"?p9e(t):t,[e,t]);return t.length?l.jsxs(l.Fragment,{children:[l.jsx(QQ,{show:n.showHeader,text:n.displayName,className:p}),h.map((g,y)=>l.jsx(ZQ,{suggestion:g,index:y,category:e,categoryConfig:n,value:r,focusedIndex:s,setFocusedIndex:o,handleSubmit:a,indexOffset:i,LeftIconComponent:c,RightIconComponent:u,onFillButtonClick:m,QueryContentComponent:f,highlightPrefix:n.highlightPrefix??!0},`${e}-${g.identifier||g.query_uuid||g.input+g.completion}`))]}):null});XQ.displayName="SuggestionGroup";const ZQ=A.memo(({suggestion:{input:e,completion:t,query_uuid:n,image:r,imageDark:s,url:o="",description:a,identifier:i="",category:c,title:u="",subscribed:f=!1,metadata:m,submission_query:p,inputs_and_completions:h,icon_name:g,shouldShowTitle:y,actionHandler:x,isPersonalized:v},index:b,LeftIconComponent:_,QueryContentComponent:w,RightIconComponent:S,highlightPrefix:C,focusedIndex:E,handleSubmit:T,indexOffset:k,onFillButtonClick:I,setFocusedIndex:M,value:N})=>{const D=d.useCallback(P=>T({query:P,query_uuid:n,url:o,identifier:i,category:c,description:a,image:r,imageDark:s,title:u,subscribed:f,submission_query:p,isPersonalized:v},b+k),[c,a,T,i,r,s,b,k,n,p,f,u,o,v]),j=d.useCallback(()=>{I(e+t,o)},[t,e,I,o]),F=d.useMemo(()=>l.jsx(_,{image:r,imageDark:s,alt:e+N,url:o,category:c,iconName:g,value:N}),[_,c,g,r,s,e,o,N]),R=d.useMemo(()=>l.jsx(S,{onClick:j,url:o,isSelected:f,metadata:m,category:c}),[S,j,o,f,m,c]);return l.jsx(YQ,{onClick:D,query:e,completion:t,inputsAndCompletions:h,url:o,suggestionIndex:b+k,keyboardFocusedIndex:E,setKeyboardFocusedIndex:M,description:a,title:u,shouldShowTitle:y,highlightPrefix:C,className:z("hover:bg-subtler","data-[focused=self]:bg-subtler","dark:data-[focused=self]:bg-subtler","hover:data-[focused=other]:bg-raised","dark:hover:data-[focused=other]:bg-subtler"),category:c,QueryContentComponent:w,metadata:m,leftIcon:F,rightIcon:R,actionHandler:x})});ZQ.displayName="SuggestionCardFactory";const JQ=A.memo(({image:e,alt:t,url:n,iconName:r,value:s,category:o})=>{const a=s.length===0,[i,c]=d.useState(!1),{sidecarSourceTab:{url:u}}=Qn(),f=Vo(),m=d.useMemo(()=>{if(u&&a)return Kp(u);if(e)return e;if(n)return BK(n)},[e,n,u,a]),p=r?c9e[r]:null,h=a?y1e(f):B("search");return o==="shortcuts"&&!r?l.jsx(ge,{icon:B("slash"),size:"sm",className:"mt-two mr-2 w-5 shrink-0"}):qQ(n)?l.jsx("div",{className:"mr-2 flex size-5 shrink-0 items-center justify-center",children:l.jsx(ge,{icon:Jme,size:"sm",className:"text-foreground"})}):m&&!i?l.jsx("div",{className:"relative mr-2 size-5 shrink-0 overflow-hidden rounded-sm",children:l.jsx("img",{src:m,alt:t??"suggestion",className:"object-cover",sizes:"24px",onError:()=>c(!0)})}):l.jsx("div",{className:"flex shrink-0 items-center mr-2 w-5",children:l.jsx(ge,{icon:i&&n?B("world"):p??h,size:"sm"})})});JQ.displayName="LeftIcon";const eX=A.memo(({onClick:e,url:t,category:n})=>n==="shortcuts"?null:u9e(t)?l.jsx("div",{className:"flex h-full items-center",children:l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet"})}):l.jsx("button",{className:"appearance-none",onPointerDown:r=>{r.stopPropagation(),r.preventDefault(),e(r)},type:"button",children:l.jsx(ge,{icon:t?B("world-share"):B("arrow-up-right"),size:"sm",className:"-mb-xs"})}));eX.displayName="RightIcon";const OA=A.memo(({isOpen:e,suggestedQueries:t,focusedIndex:n,setFocusedIndex:r,handlePasteQuery:s,handleSubmit:o,dropdownClassName:a,dropdownType:i="query",components:c,value:u,children:f,popoverClassName:m,categoryTitleClassName:p,userInputQuery:h,portalTarget:g,placement:y="bottom",allowNonSequentialMatch:x=!1,renderSettingsRow:v,scrollableShards:b=[],floatingStrategy:_,shouldEnableStacking:w=!1})=>{const{session:S}=Ne(),{trackEvent:C}=Xe(S),{RightIconComponent:E=eX,LeftIconComponent:T=JQ,QueryContentComponent:k}=c??{},I=d.useMemo(()=>t.map(({query:Q,query_uuid:Y,image:te,imageDark:se,url:ae,title:X,description:ee="",identifier:le="",category:re,subscribed:ce=!1,metadata:ue,submission_query:me,icon:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke,focus:De},xe,Ue)=>{if(i==="select")return{input:Q,completion:"",query_uuid:Y,title:X,image:te,imageDark:se,url:ae,description:ee,identifier:le,category:re,subscribed:ce,submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke};const Ee=h?n===-1?u:h:u;return Ee.length>0&&Q.startsWith(Ee)?{input:Ee,completion:Q.slice(Ee.length),query_uuid:Y,title:X,image:te,imageDark:se,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke}:x&&!ee&&Ee.length>0&&Ee.length<=Q.length&&Ue[xe]&&$Q(Ee,Ue[xe],!0)[0]?{input:"",completion:Q,inputs_and_completions:l9e(Ee,Q),query_uuid:Y,title:X,image:te,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke}:{input:Q,completion:"",query_uuid:Y,title:X,image:te,imageDark:se,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke}}),[t,u,i,h,n,x]),M=d.useMemo(()=>f9e(I),[I]),N=d.useMemo(()=>m9e(M),[M]),D=d.useCallback((Q,Y)=>{if(Y){window.open(Y,"_blank");return}C("auto suggestion filled",{}),s(Q)},[s,C]),j=v?.(),F=t.length>0,R=z("!block w-full",y==="bottom"?"mt-[-5px]":"mb-[-5px]",m),P=y==="bottom"?"rounded-b-2xl":"rounded-t-2xl",L=d.useRef(null),U=e&&t.length>0,O=d.useMemo(()=>({portalTarget:g??void 0,removeScroll:!0,shards:b}),[g,b]),$=d.useMemo(()=>l.jsxs("div",{className:z(y==="bottom"?z("rounded-b-2xl",F?"!border-t-subtlest shadow-super/10 shadow-md dark:shadow-lg dark:shadow-black/10":"!border-t-0"):"!border-b-subtler rounded-t-2xl","border-subtle border","bg-raised p-3",a),children:[y==="top"&&j,U&&l.jsx("div",{ref:L,className:"flex flex-col items-stretch","data-testid":"autosuggestion-container",children:N.map((Q,Y)=>{const te=M[Q],se=uE[Q]||{order:999,showHeader:!1};let ae=0;for(let X=0;X_?{strategy:_}:void 0,[_]),H=d.useMemo(()=>w?{className:"flex z-[1]"}:void 0,[w]);return l.jsx(Vf,{isOpen:e,matchTargetWidth:!0,disableAnimation:!0,placement:y,childrenClassName:"grow block",contentClassName:R,borderRadius:P,avoidCollisions:!1,disableShadow:!0,overlayProps:O,content:$,floatingElementProps:H,...G&&{customFloatingUIOptions:G},children:f})});OA.displayName="SuggestDropdown";const tX=A.memo(({value:e,suggestDropdownProps:t,ResizeableInputWrapperProps:n,ResizeableInputProps:r,leftAttributionComponents:s,rightAttributionComponents:o,syncUncontrolledOnce:a})=>{const i=r.onChange,c=r.ref,u=d.useRef(null),f=d.useRef(e);f.current=e;const m=d.useRef(null),p=d.useRef(!1),h=d.useCallback(g=>{u.current=g,c instanceof Function?c(g):c&&(c.current=g)},[c]);return d.useEffect(()=>{const g=u.current?.value;g&&g!==f.current&&(!a||!p.current)&&i?.(g),a&&(p.current=!0)},[i,a]),Rf("ask-input"),l.jsx(OA,{...t,floatingStrategy:"absolute",shouldEnableStacking:!0,portalTarget:m.current??void 0,value:e,children:l.jsxs(TA,{...n,ref:m,children:[l.jsx(AA,{...r,ref:h}),s,o]})})});tX.displayName="AskInputBase";class h9e{static isAnyInputElementFocused(){const t=document.activeElement;return!!(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.getAttribute("contenteditable")==="true"||t.getAttribute("role")==="textbox"))}}function g9e({value:e,json:t,isDisabled:n,handleSubmit:r,handleSuggestDropdownNavigation:s,querySource:o,focusInput:a,isInputActive:i}){const{isMobileUserAgent:c}=Re(),u=d.useRef(e),f=d.useRef(t);u.current=e,f.current=t;const m=d.useCallback(x=>n&&Ls.isEnterKeyWithoutShift(x)?(x.preventDefault(),!0):!1,[n]),p=d.useCallback(x=>x.isComposing?(x.preventDefault(),!0):!1,[]),h=d.useCallback(x=>{Ls.isEnterKeyWithoutShift(x)&&!c&&(x.preventDefault(),r({query:u.current,json:f.current,querySource:o}))},[r,o,c]),g=d.useCallback(x=>{const v=Ls.isCtrlOrCmdJ(x),b=Ls.isOnlySlashKey(x);if(v||b){if(i||h9e.isAnyInputElementFocused())return;x.preventDefault(),a()}},[a,i]);return d.useEffect(()=>(document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}),[g]),d.useCallback(x=>{m(x)||p(x)||s(x)||h(x)},[m,p,s,h])}const y9e=(e,t)=>{const{value:n,loading:r}=zt({flag:"clear-ask-input-suggestions-when-disabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};function x9e({handleSubmit:e,inputQuery:t}){const{session:n}=Ne(),{trackEvent:r}=Xe(n),s=d.useRef(t);s.current=t;const o=Vo(),{sidecarSourceTab:{url:a}}=Qn();return d.useCallback((c,u)=>{const f=ua();if(r("auto suggestion accepted",{mode:"dropdown-complete",query:s.current,completion:c.query,completion_uuid:c.query_uuid,completion_position:u,url:c.url,isNavigational:!!c.url,frontendContextUUID:f,searchMode:o,isPersonalized:c.isPersonalized,sourceDomain:Ur(a)}),c.isPersonalized&&fetch("/rest/autosuggest/track-query-clicked",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:c.query,search_mode:o})}).catch(()=>{}),c.url){window.open(c.url,"_self");return}e({query:c.submission_query??c.query,promptSource:"autosuggest",querySource:"autosuggest",newFrontendContextUUID:f})},[e,o,r,a])}function v9e({inputQuery:e}){const{session:t}=Ne(),{trackEventBatch:n}=Xe(t),r=d.useRef(e);r.current=e;const s=Vo(),{sidecarSourceTab:{url:o}}=Qn();return d.useCallback(i=>{if(r.current.length!==0)return;const c=i.map((u,f)=>({name:"auto suggestion blank state viewed",data:{mode:"dropdown-complete",query:r.current,completion:u.query,completion_uuid:u.query_uuid,completion_position:f,url:u.url,isNavigational:!!u.url,searchMode:s,sourceDomain:Ur(o)}}));n(c)},[s,n,o])}const b9e=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"should-show-general-suggestions-on-ntp",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},$f=Qe({productionMs:3e3}),_9e=Qe({productionMs:5e3}),Nj={TASK_LIMIT_EXCEEDED:"TASK_LIMIT_EXCEEDED",SHORTCUT_NAME_ALREADY_EXISTS:"SHORTCUT_NAME_ALREADY_EXISTS"},w9e=async({taskId:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/tasks/{task_id}",n,{params:{path:{task_id:e}},timeoutMs:Qe(),numRetries:$l,headers:t});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user task",cause:s,status:o.status??0});return r?.task?Pye(r.task):null},C9e=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to create user task",cause:r,status:s.status??0});return n},Rj=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/{task_id}",n,{params:{path:{task_id:e}},body:t});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update user task",cause:s,status:o.status??0});return r},nX=async({taskId:e,reason:t})=>de.DELETE("/rest/tasks/{task_id}",t,{params:{path:{task_id:e}},timeoutMs:$f}),S9e=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/finance",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to create user finance task",cause:r,status:s.status??0});return n},E9e=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/finance/{task_id}",n,{params:{path:{task_id:e}},body:t});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update user finance task",cause:s,status:o.status??0});return r},k9e=async({ticker:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/finance/tickers/{ticker}",t,{params:{path:{ticker:e}},timeoutMs:Qe(),numRetries:$l});if(r)throw Z.error("Failed to get finance ticker",r),new he("API_CLIENTS_ERROR",{message:"Failed to get finance ticker",cause:r,status:s.status??0});return n},fbt=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/shortcuts",t,{body:e,timeoutMs:$f});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},mbt=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/shortcuts/slug",t,{body:e,timeoutMs:_9e});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},pbt=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/shortcuts/{task_id}",n,{body:t,params:{path:{task_id:e}},timeoutMs:$f});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r},hbt=async({shortcutId:e,reason:t})=>{const{data:n,error:r,response:s}=await de.DELETE("/rest/tasks/shortcuts/defaults/{shortcut_id}",t,{params:{path:{shortcut_id:e}},timeoutMs:$f});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},gbt=async({shortcutId:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/shortcuts/copy/{shortcut_id}",t,{params:{path:{shortcut_id:e}},timeoutMs:$f});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},M9e=async({reason:e,headers:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/shortcuts/mentions",e,{params:{query:{order_by:"created_at"}},timeoutMs:$f,numRetries:$l,headers:t});if(r)throw Z.error("Failed to get shortcut typeahead options",r),new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},rX=({reason:e,...t})=>{const n=Wt();return mt({queryKey:l2e(),queryFn:async()=>{const{tasks:r}=await M9e({reason:e});return r},...t,enabled:n&&(t.enabled??!0)})},ybt=async({query:e,keywords:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/autosuggest/reformulate-query",n,{body:{query:e,keywords:t}});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.reformulated_query}catch(r){return Z.error("Failed to fetch refinement query",r),null}},T9e=async({sources:e,attachments:t,searchMode:n,sourceTabUrl:r,entropyRenderingPlace:s,reason:o})=>{try{if(t&&t.length>0)return Pe;if(e.length===0)return Pe;const{data:a,error:i,response:c}=await de.POST("/rest/autosuggest/list-autosuggest",o,{body:{query:"",sources:e,attachments:t,search_mode:n,source_tab_url:r,entropy_rendering_place:s}});if(i)throw new he("API_CLIENTS_ERROR",{cause:i,status:c.status??0});return a.results??Pe}catch(a){return Z.error(a),Pe}},A9e=async({onCreateShortcut:e,shortcuts:t})=>{try{const s=[...[...t].filter(o=>o.prompt&&o.prompt.trim().length>0).sort(()=>Math.random()-.5).slice(0,6).map(o=>({query:o.prompt,title:o.task_name,shouldShowTitle:!0,category:"shortcuts"}))];return e&&s.push({query:"",query_uuid:"create-shortcut-button",title:"Create a shortcut",description:"",category:"shortcuts",icon:"plus",shouldShowTitle:!0,actionHandler:e}),s}catch(n){return Z.error("Failed to fetch shortcuts suggestions",n),Pe}},N9e=async({query:e,reason:t,country:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/list-autosuggest",t,{params:{query:{query:e,country:n}},timeoutMs:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.results??Pe}catch(r){return Z.error(r),[]}},R9e=(e,t)=>{const{value:n,loading:r}=zt({flag:"sidecar-personalized-query-suggestions",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},LA="sidecar-personalized-queries-cache",dE=1e3*60*10,D9e="sidecar";function j9e(e){try{let n=new URL(e).hostname.toLowerCase();return n.startsWith("www.")&&(n=n.slice(4)),n}catch{return""}}function I9e(){try{const e=vt.getItem(LA);if(e)return JSON.parse(e)}catch{}return null}function P9e(e){vt.setItem(LA,JSON.stringify(e))}async function O9e(e,t,n){if(e!==null&&e.nonce!==null&&e.timestamp>n-dE&&e.domain_suggestions.length>0)return{nonce:e.nonce,domain_suggestions:e.domain_suggestions};const{data:r,error:s}=await de.POST("/rest/browser/personalization/sidecar-recommended-queries",D9e,{body:{last_refresh_timestamp_ms:e?.timestamp??0,nonce:e?.nonce??"",history_items:t},timeoutMs:3e4});return s?(Z.error("Failed to fetch sidecar personalized queries:",s),{domain_suggestions:[],nonce:""}):r?.domain_suggestions===null||!r?.domain_suggestions?{domain_suggestions:e?.domain_suggestions??[],nonce:e?.nonce??""}:r}function L9e(e,t){const n=e.find(r=>r.domain===t);return n?n.suggestions.map(r=>({query:r.query})):[]}const F9e=14,B9e=1500,U9e=(e,t)=>{const{session:n}=Ne(),r=un(!1),s=j9e(e),{variation:o,loading:a}=R9e(!1,{userEmail:n?.user?.email??""}),i=I9e(),{data:c}=mt({queryKey:be.makeQueryKey("sidecar-personalized-queries",t,o,a),queryFn:async()=>{if(!r||!e||!t)return[];if(!o)return a||vt.removeItem(LA),[];const u=Date.now();if(i&&i.domain_suggestions.length>0&&u-i.timestamp({url:g.url,title:g.title,last_accessed:g.last_accessed,visit_count:g.visit_count})),p=await O9e(i,m,u),h={nonce:p.nonce,timestamp:u,domain_suggestions:p.domain_suggestions};return h.domain_suggestions.length>0&&P9e(h),p.domain_suggestions}catch(f){return Z.error(f),i?.domain_suggestions??[]}},placeholderData:()=>t?i?.domain_suggestions??[]:[],refetchInterval:dE,enabled:t});return L9e(c??[],s)},iw=({sources:e,attachments:t,searchMode:n,focus:r,isCometHome:s,reason:o,enabled:a})=>{const{sidecarSourceTab:{url:i}}=Qn(),u=Ga().erp,{isMobileUserAgent:f}=Re(),m=un(),p=Wt(),{openModal:h}=pn().legacy,{data:g}=rX({reason:o}),{variation:y}=b9e(!1),x=U9e(i||"",u==="sidecar"),v=d.useCallback(()=>{h("taskShortcutModal",{source:"suggestions_dropdown"})},[h]),b=d.useMemo(()=>s&&n===oe.SEARCH?be.makeEphemeralQueryKey("comet-blank-state-suggest",n,!0,g):r==="finance"?be.makeEphemeralQueryKey("finance-blank-state-suggest"):be.makeEphemeralQueryKey("blank-state-suggest",e,t,n,u==="sidecar"?i:""),[e,t,n,r,s,i,u,g]);return mt({queryKey:b,enabled:a,queryFn:async()=>{if(s&&n===oe.SEARCH&&!y)return await(p&&g?A9e({onCreateShortcut:v,shortcuts:g}):Promise.resolve([]));if(r==="finance")return(await N9e({query:"",reason:o,country:"US"})).map((E,T)=>({query:E.query||`suggestion-${T}`,title:E.title??void 0,image:E.image??void 0,description:E.description??void 0,category:E.category??void 0,query_uuid:E.query_uuid??void 0,url:E.url??void 0,metadata:E.metadata??void 0}));const[_,w]=await Promise.all([T9e({sources:e,attachments:t,searchMode:n,sourceTabUrl:u==="sidecar"?i:"",entropyRenderingPlace:u,reason:o}),u==="sidecar"?ohe({entropyBrowser:m,url:i}):Promise.resolve([])]);return[...x.map(S=>({...S,isPersonalized:!0})),...w,..._].slice(0,kp(f))}})},V9e=e=>{const{setSuggestions:t,setBlankStateSuggestions:n}=jo(),{sidecarSourceTab:{url:r,secondaryTab:s}}=Qn(),a=Ga().erp,i=d.useRef(void 0),c=d.useRef(e.selectedSearchMode),{blankStateSuggestions:u}=qr(),f=u[e.selectedSearchMode],m=r?Ur(r):void 0,p=d.useMemo(()=>{if(e.suggestionsDisabled)return!0;const S=a==="sidecar";return S&&m&&m===i.current||S&&s},[e.suggestionsDisabled,a,m,s]);!p&&i.current!==m&&(i.current=m);const h=!p,{data:g,isLoading:y}=iw({...e,searchMode:oe.SEARCH,enabled:h}),x=h&&!y,{data:v,isLoading:b}=iw({...e,searchMode:oe.RESEARCH,enabled:x}),_=x&&!b,{data:w}=iw({...e,searchMode:oe.STUDIO,enabled:_});return d.useEffect(()=>{p?n([],oe.SEARCH):g&&n(g,oe.SEARCH)},[g,n,p]),d.useEffect(()=>{p?n([],oe.RESEARCH):v&&n(v,oe.RESEARCH)},[v,n,p]),d.useEffect(()=>{p?n([],oe.STUDIO):w&&n(w,oe.STUDIO)},[n,p,w]),d.useEffect(()=>{(e.query?.length??0)>0||f&&((a==="sidecar"||c.current!==e.selectedSearchMode)&&t(f),c.current=e.selectedSearchMode)},[e.query,e.selectedSearchMode,f,t,a]),null};function sX({userInputQuery:e,userInputJson:t,suggestionsDisabled:n,suggestions:r,focusedIndex:s,setFocusedIndex:o,onChange:a,handleSuggestionSubmission:i,placement:c="bottom",inputRef:u}){const f=d.useRef(e),m=d.useRef(t),p=d.useRef(r),h=d.useRef(s);f.current=e,m.current=t,p.current=r,h.current=s,r.forEach(_=>_);const g=d.useCallback((_,w)=>{if(w>0){const S=(h.current+1)%w,C=p.current[S];if(C?.query){const E=C.query;a(E)}return _.preventDefault(),S}return null},[a]),y=d.useCallback(_=>{let w=h.current-1;if(w<0)w=-1,h.current===0&&(_.preventDefault(),a(f.current,m.current));else{_.preventDefault();const S=p.current[w];if(S?.query){const C=S.query;a(C)}}return w},[a]),x=d.useCallback((_,w)=>{if(w>0){const S=h.current<=0?w-1:(h.current-1)%w,C=p.current[S];if(C?.query){const E=C.query;a(E)}return _.preventDefault(),S}return null},[a]),v=d.useCallback((_,w)=>{let S=h.current+1;if(S>=w||S===0)S=-1,h.current===w-1&&(_.preventDefault(),a(f.current,m.current));else{_.preventDefault();const C=p.current[S];if(C?.query){const E=C.query;a(E)}}return S},[a]);return d.useCallback(_=>{if(n)return!1;const w=Ls.isArrowDown(_),S=Ls.isArrowUp(_);if(w){if(c==="bottom"&&h.current===-1&&!u.current?.inLine("last"))return!1;const C=c==="bottom"?g(_,p.current.length):v(_,p.current.length);if(C!==null)return o(C),!0}else if(S){if(c==="top"&&h.current===-1&&!u.current?.inLine("first"))return!1;const C=c==="bottom"?y(_):x(_,p.current.length);if(C!==null)return o(C),!0}else if(Ls.isEnterKeyWithoutShift(_)&&h.current>=0&&h.currente==="travel"||e==="shopping"||e==="academic"||e==="patents"||e==="sports"||e==="language-learning",z9e=({autosuggestionsEnabled:e=!0,inputQuery:t,inputJson:n,isInputActive:r,onChange:s,handleSuggestionSubmission:o,handleSuggestionView:a,querySource:i,hasThreadContent:c,isMentionMenuOpened:u,placement:f="bottom",inputRef:m})=>{const{isWindowsAppPanelView:p}=Px(),[h,g]=d.useState(-1),[y,x]=d.useState(t),[v,b]=d.useState(n),_=On(),[w]=Wd("isSuggestionsDisabled",!1),S=_Y(),C=zz(_),E=twe(_),{activeMenu:T,suggestions:k}=qr(),{currentOpenedModal:I}=pn().legacy,{setSuggestions:M,setShowSuggestDropdown:N}=jo(),D=d.useMemo(()=>w||!e||!S&&!C&&!p&&!E&&!H9e(i)&&!1||i!=="finance"&&t.length>t9e&&!k.some(({query:F})=>F===t)||c,[w,e,S,C,E,p,i,t,c,k]),j=sX({userInputQuery:y,userInputJson:v,suggestionsDisabled:D,suggestions:k,focusedIndex:h,setFocusedIndex:g,onChange:s,handleSuggestionSubmission:o,placement:f,inputRef:m});return d.useEffect(()=>{h===-1&&(x(t),b(n))},[t,h,n]),d.useEffect(()=>{D&&(M(Pe),g(-1))},[D,M,g]),d.useEffect(()=>{const F=!D&&r&&!T&&!I&&k.length>0&&!u;N(F),F&&a(k)},[D,r,T,I,k,u,N,a]),d.useMemo(()=>({focusedIndex:h,setFocusedIndex:g,suggestionsDisabled:D,userInputQuery:y,handleSuggestDropdownNavigation:j,placement:f}),[h,j,D,y,f])};function W9e({value:e,json:t,querySource:n,disableSubmission:r=!1,disableInput:s=!1,autofocus:o=!0,isUploadingFile:a=!1,onChange:i,onFocus:c,onBlur:u,handleSubmit:f,handleUpdateAutosuggestions:m,autosuggestionsEnabled:p=!0,errorMessage:h,sources:g,attachments:y,selectedSearchMode:x,isInputActive:v,setIsInputActive:b,updateOnFocus:_=!1,inFlight:w=!1,resultsLength:S=0,quote:C,isMentionMenuOpened:E,isCometHome:T=!1,reason:k,placement:I="bottom"}){const{activeMenu:M,inputRef:N}=qr(),D=Fwe(),{setShouldTriggerFocus:j}=Kx(),{blankStateSuggestions:F}=qr(),{setSuggestions:R}=jo(),{onActiveMenuChange:P}=jo(),{device:{isAndroid:L}}=sn(),U=d.useMemo(()=>!!C||e.trim().length>0||!!y&&y.length>0,[C,e,y]),O=r||s||!!h||a||!U,$=d.useCallback(me=>{const{mentions:we}=_W(t?.root);f({...me,mentions:we.length>0?we:void 0})},[t,f]),G=x9e({handleSubmit:$,inputQuery:e}),H=v9e({inputQuery:e}),{focusedIndex:Q,setFocusedIndex:Y,suggestionsDisabled:te,userInputQuery:se,handleSuggestDropdownNavigation:ae}=z9e({autosuggestionsEnabled:p,inputQuery:e,inputJson:t,isInputActive:v&&p,onChange:i,handleSuggestionView:H,handleSuggestionSubmission:G,querySource:n,hasThreadContent:w||S>0,isMentionMenuOpened:E,placement:I,inputRef:N});V9e({sources:g,attachments:y,selectedSearchMode:x,suggestionsDisabled:te,focus:n==="finance"?"finance":void 0,query:e,isCometHome:T,reason:k});const X=d.useCallback(()=>{N.current?.focus(),b(!0)},[N,b]),ee=d.useCallback(me=>{c?.(me),b(!0),P(null),_&&m(N.current?.value??""),L&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"center"})},300)},[c,P,m,b,_,N,L]);d.useEffect(()=>{D&&o&&(X(),j(!1))},[D,X,j,o]);const le=d.useCallback(()=>(u?.(),b(!1),Y(-1),!0),[u,Y,b]),{variation:re}=y9e(!1),ce=d.useCallback((me,we)=>{if(i(me,we),te){re&&R([]);return}me.trim().length===0&&F[x]?(R(F[x]),m(me)):o9e(me)&&m(me)},[i,te,m,F,R,x,re]),ue=g9e({value:e,json:t,isDisabled:O,handleSubmit:$,handleSuggestDropdownNavigation:ae,querySource:n,focusInput:X,isInputActive:v});return d.useEffect(()=>{M!==null?N.current?.blur():o&&X()},[M,N,X,o]),d.useMemo(()=>({isDisabled:O,focusedIndex:Q,setFocusedIndex:Y,userInputQuery:se,handleSuggestionSubmission:G,handleFocus:ee,handleBlur:le,handleChange:ce,handleKeyDown:ue,focusInput:X,hasQuery:U}),[X,Q,le,ce,ee,ue,G,U,O,Y,se])}const G9e=({fileUploadRef:e,fileHandlingRef:t,showFileUpload:n,attachments:r,setAttachments:s,handleChange:o,setIsUploadingFile:a,focusInput:i,onFileAttachComplete:c})=>{const{inputRef:u}=qr(),f=$4(),[m,p]=d.useState(null),h=d.useCallback(_=>{const w=r===void 0?"paste.txt":`paste-${r.length+1}.txt`,S=new File([_],w,{type:"text/plain"}),C=new DataTransfer;C.items.add(S),p({content:_,fileName:w}),e.current?.uploadFiles(C.files)},[r,e]),g=d.useCallback(()=>{p(null)},[]);d.useImperativeHandle(t,()=>({clearAutoCreatedTextFile:g}),[g]);const y=d.useCallback(_=>{const w=_.clipboardData;if(w&&w.items.length>0){const S=new DataTransfer;for(const C of w.items){if(C.kind==="file"){_.preventDefault();const E=C.getAsFile();E&&S.items.add(E)}if(C.type==="text/plain"){const E=_.clipboardData.getData("Text");E.length>Ec&&(_.preventDefault(),h(E))}}e.current?.uploadFiles(S.files)}requestAnimationFrame(()=>{u.current&&(u.current.trim(),o(u.current.value,u.current.json))})},[e,o,u,h]),x=d.useCallback(_=>{o(_),u.current?.focus()},[o,u]),v=d.useCallback(_=>{a(!1),_.length>0?(s(_),i(),c?.(_)):s(void 0)},[a,s,i,c]),b=d.useCallback(async _=>{const w=new DataTransfer;for(const S of _){if(S.kind==="file"){const C=S.webkitGetAsEntry();if(!C)continue;if(cW(C)){const E=S.getAsFile();E&&w.items.add(E)}else if(uW(C)){const E=await nCe(C);for(const T of E)w.items.add(T)}}if(S.type==="text/plain"&&S.getAsString(C=>{C.length>Ec?h(C):u.current&&(u.current.append(C),o(u.current.value,u.current.json))}),w.items.length>f)break}e.current?.uploadFiles(w.files)},[e,u,o,f,h]);return d.useEffect(()=>{n||(s(void 0),p(null))},[n,s]),d.useMemo(()=>({handlePaste:y,handlePasteQuery:x,handleCompleteFileUpload:v,handleFileSelect:b,autoCreatedTextFile:m,dismissNotification:g,setAutoCreatedTextFile:p}),[v,b,y,x,m,g])},$9e="transparent 135deg, oklch(var(--default-color)) 180deg, transparent 225deg",oX=A.memo(({children:e,borderRadius:t,borderGradientStops:n=$9e,defaultColor:r="var(--super-color)"})=>{const[s,o]=d.useState(1),a=d.useCallback(u=>{u!==null&&o(u.clientWidth/u.clientHeight)},[]),i=d.useMemo(()=>({"--default-color":r,"--button-border-gradient-stops":n,"--button-aspect-ratio":s,"--button-aspect-ratio-multiplier":.65,transform:"translateY(-50%) scaleX(calc(var(--button-aspect-ratio) * var(--button-aspect-ratio-multiplier))"}),[s,n,r]),c=d.useMemo(()=>({animation:"spin 5s linear infinite"}),[]);return l.jsxs("div",{className:"relative overflow-hidden p-px",ref:a,style:{borderRadius:t},children:[l.jsx("div",{className:"bg-base relative z-[1]",style:{borderRadius:t-1},children:e}),l.jsx("div",{style:i,className:"absolute inset-0 top-1/2 flex size-full items-center justify-center p-px will-change-transform",children:l.jsx("div",{style:c,className:"absolute aspect-square min-h-full w-full origin-center bg-[conic-gradient(var(--button-border-gradient-stops))] blur"})})]})});oX.displayName="AnimatedGradientBorderWrapper";function q9e({reason:e}){const t=Yt();return Rt({mutationFn:()=>v_e({reason:e}),onSuccess:()=>{t.invalidateQueries({queryKey:iu()})}})}function K9e({reason:e}){return Rt({mutationFn:async({connectionType:t,content:n})=>{await b_e({connectionType:t,content:n,reason:e})}})}var Mp;(function(e){e.TIMEOUT="TIMEOUT",e.AUTH="AUTH",e.POPUP_BLOCKED="POPUP_BLOCKED"})(Mp||(Mp={}));class Y9e extends Error{code;constructor(t,n){super(n),this.code=t,this.name="MicrosoftPickerError"}}const Dj=(e,t)=>new Y9e(e,t),FA=[".txt",".pdf",".docx",".pptx",".xlsx",".md",".csv"],BA=[".txt",".pdf",".jpg",".jpeg",".png",".docx",".pptx",".xlsx",".md",".csv"],UA=[".mp3",".wav",".aiff",".ogg",".flac",".mp4",".mpeg",".mov",".avi",".flv",".mpg",".webm",".wmv",".3gp"],jj=27,Q9e=2e4;let lw=!1,_i=null;const X9e=()=>{const e=d.useRef(null),t=d.useRef(null),n=d.useRef(null);let r="";typeof window<"u"&&(window.location.hostname==="localhost"?r=`${window.location.protocol}//${window.location.hostname}:${window.location.port}/account/connectors`:r=`${window.location.protocol}//${window.location.hostname}/account/connectors`);const s=d.useCallback(f=>!!f&&f.length===36&&f.split("-").length===5,[]),o=d.useCallback((f,m,p,h,g)=>{if(!m&&f==="sharepoint"&&p){const y=p.match(/^https?:\/\/([^.]+)\.sharepoint\.com/i);if(y)return y[1]}if(!m&&f==="onedrive"&&s(g)&&h){const y=h.match(/@([^.]+)\./);if(y)return y[1]+"-my"}return m?f==="sharepoint"?m:m+"-my":null},[s]),a=d.useCallback(async(f,m)=>{m.success=!1;let p=null;const h=o(f.connector,f.tenantName,f.webUrl,f.loginHint,f.accountIdentifier);m.tenant=h,_i||(_i=await(await q(()=>import("./index-kR08Osiu.js"),__vite__mapDeps([148,1]))).PublicClientApplication.createPublicClientApplication({auth:{authority:h?"https://login.microsoftonline.com/common":"https://login.microsoftonline.com/consumers",clientId:f.clientId,redirectUri:r},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!0}}));const g=h?[`https://${h}.sharepoint.com/.default`]:["OneDrive.ReadWrite"];m.scopes=g;const y={scopes:g,login_hint:f.loginHint,prompt:"select_account"};let x=null,v=_i.getActiveAccount();if(v||(v=_i.getAllAccounts().find(_=>_.username===f.loginHint)??null),m.hasActiveAccount=!!v?.username,v)try{_i.setActiveAccount(v),x=(await _i.acquireTokenSilent(y)).accessToken}catch(b){m.silentAcquisitionError=b instanceof Error?b.toString():b}if(!x&&!lw)try{lw=!0;const b=await _i.loginPopup(y);_i.setActiveAccount(b.account),x=(await _i.acquireTokenSilent(y)).accessToken}catch(b){m.interactiveAcquisitionError=b instanceof Error?b.toString():b,b?.errorCode==="popup_window_error"&&(m.interactiveAcquisitionErrorCode="popup_window_error",p=Mp.POPUP_BLOCKED)}finally{lw=!1}else x||(m.interactiveAuthenticationSkipped=!0);if(x)return m.success=!0,m.accessTokenLength=x.length,x;throw Dj(p??Mp.AUTH,"Access token not acquired")},[r,o]),i=d.useCallback(f=>{const m=o(f.connector,f.tenantName,f.webUrl,f.loginHint,f.accountIdentifier);let p=f.mode==="source"?FA:BA;p=f.isAudioVideoFilesEnabled?p.concat(UA):p;const h=f.connector==="sharepoint"?{recent:!0,oneDrive:!1,sharedLibraries:!0}:{recent:!0,oneDrive:!0,sharedLibraries:!1},g={sdk:"8.0",messaging:{origin:r,channelId:jj},authentication:{},entry:f.connector==="sharepoint"?{sharePoint:{}}:{oneDrive:{}},typesAndSources:{mode:f.mode==="attachment"?"files":"all",filters:p,pivots:h},selection:{mode:"multiple"}},y=new URLSearchParams({filePicker:JSON.stringify(g)});return f.webUrl?`${f.webUrl}/_layouts/15/FilePicker.aspx?${y}`:m?`https://${m}.sharepoint.com/_layouts/15/FilePicker.aspx?${y}`:`https://onedrive.live.com/picker?${y}`},[r,o]),c=d.useCallback(async f=>{const m=S=>{window.removeEventListener("message",y),t.current?.removeEventListener("message",g),t.current?.close(),e.current?.close(),S?f.onError?.(S):f.onCancel?.()},p=(S,C)=>(n.current||(n.current=(async()=>{try{return await a(S,C)}finally{n.current=null}})()),n.current),h=async(S,C)=>n.current?await n.current:await new Promise((E,T)=>{const k=setTimeout(()=>{T(Dj(Mp.TIMEOUT,"Request timed out"))},Q9e);p(S,C).then(I=>{clearTimeout(k),E(I)}).catch(I=>{clearTimeout(k),T(I)})}),g=async S=>{const C={};switch(S.data.type){case"command":t.current?.postMessage({type:"acknowledge",id:S.data.id});const E=S.data.data;switch(E.command){case"authenticate":try{const T=await h(f,C);t.current?.postMessage({type:"result",id:S.data.id,data:{result:"token",token:T}})}catch(T){C.errorStep="authenticateCommand",C.error=T instanceof Error?T.toString():T,m(T)}finally{f.log?.(f.connectionType??f.connector.toUpperCase(),C)}break;case"pick":t.current?.postMessage({type:"result",id:S.data.id,data:{result:"success"}}),f.onPicked?.(E.items),m();break;case"close":m();break;default:m();break}break}},y=async S=>{if(S.source&&S.source===e.current){const C=S.data;C.type==="initialize"&&C.channelId===jj&&(t.current=S.ports[0],t.current.addEventListener("message",g),t.current.start(),t.current.postMessage({type:"activate"}))}};let x;const v={};try{x=await p(f,v)}catch(S){v.errorStep="initialization",v.error=S instanceof Error?S.toString():S,m(S);return}finally{f.log?.(f.connectionType??f.connector.toUpperCase(),v)}const b=document.getElementById("microsoft-file-picker");if(!b){m();return}if(e.current=b.contentWindow,!e?.current){m();return}const _=e.current.document.createElement("form");_.setAttribute("action",i(f)),_.setAttribute("method","POST"),e.current.document.body.append(_);const w=e.current.document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("name","access_token"),w.setAttribute("value",x),_.appendChild(w),e.current.document.body.appendChild(_),_.submit(),window.addEventListener("message",y)},[a,i]),u=d.useCallback((f,m)=>{let p;if(f.parentReference.sharepointIds?.siteId&&m==="sharepoint"){const g={item_id:f.id,drive_id:f.parentReference.driveId,site_id:f.parentReference.sharepointIds.siteId};p=JSON.stringify(g)}else p=f.id;const h=mu(f.name);return h?{id:p,name:f.name,sizeBytes:f.size,mimeType:J3[h]}:null},[]);return d.useMemo(()=>({openPicker:c,toPickerDocument:u}),[c,u])},Z9e=({reason:e,mode:t})=>{const n=J(),[r,s]=d.useState(!1),[o,a]=d.useState(null),{openToast:i}=hn(),{openModal:c,closeModal:u}=pn().legacy,{openPicker:f,toPickerDocument:m}=X9e(),{mutateAsync:p}=K9e({reason:e}),h=d.useCallback(b=>{b.connector==="sharepoint"&&t==="attachment"?c("sharepointSiteModal",{onSelectSite:_=>{u(),b&&(s(!0),a({...b,webUrl:_}),f({...b,webUrl:_}))}}):(s(!0),a(b),b.connector==="onedrive"&&f(b))},[u,t,c,f]),g=d.useCallback(()=>{s(!1),a(null)},[s,a]),y=d.useCallback(b=>{Z.error("A Microsoft file picker error occured:",b),g();const _=b;let w;switch(_?.code){case"POPUP_BLOCKED":w=n.formatMessage({defaultMessage:"We couldn't open the {formattedName} sign-in window. Please allow pop-ups for this site in your browser and try again.",id:"IjzaY+voOq"},{formattedName:D0});break;case"TIMEOUT":w=n.formatMessage({defaultMessage:"{formattedName} is taking longer than usual. This may be a network issue. Please try again.",id:"CEncF+/g5h"},{formattedName:D0});break;case"AUTH":w=n.formatMessage({defaultMessage:"We couldn't sign in to {formattedName}. Please check your Microsoft account access and try again.",id:"aHs4QljX82"},{formattedName:D0});break;default:w=n.formatMessage({defaultMessage:"{formattedName} had an unexpected error. Please try again in a few moments.",id:"ApZ6o/tZ3n"},{formattedName:D0})}i({message:w,variant:"error",timeout:5})},[g,i,n]),x=d.useCallback((b,_)=>{p({connectionType:b,content:_})},[p]),v=d.useCallback(b=>{o&&(a({...o,webUrl:b}),f({...o,webUrl:b}))},[o,f]);return d.useMemo(()=>({onOpen:h,onClose:g,onError:y,onSelectSite:v,toPickerDocument:m,log:x,isOpen:r,options:o}),[r,x,g,y,h,v,o,m])},Mv=({reason:e})=>{const t=Yt(),{mutateAsync:n}=Rt({mutationKey:j0(),mutationFn:async a=>(await w_e({request:{url:a.url,thread_id:a.thread_id},reason:e})).file_url,onSuccess:(a,i,c)=>{t.setQueryData(j0(i.url),a),i.callback?.(a,!1)},onError:(a,i,c)=>{i.callback?.("",!1)},retry:!1}),r=d.useCallback(a=>{const i=t.getQueryData(j0(a));return typeof i=="string"?i:null},[t]),s=d.useCallback(async a=>{a.callback?.("",!0);const i=r(a.url);if(i)return a.callback?.(i,!1),i;const c=await n(a);return a.callback?.(c,!1),c},[r,n]),o=d.useCallback(async(a,i)=>{const c=URL.createObjectURL(i);t.setQueryData(j0(a),c)},[t]);return d.useMemo(()=>({getCachedImageDownloadUrl:r,getImageDownloadUrl:s,cacheImageDownloadUrl:o}),[o,r,s])};function J9e(){const{value:e}=kf({flag:"attachment-token-estimation-params",defaultValue:{max_total_tokens:5e5,type_bytes_per_token:{text:4,image:500},type_subtype_bytes_per_token:{"application/pdf":200,"application/msword":500,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":500,"application/vnd.openxmlformats-officedocument.presentationml.presentation":500},default_bytes_per_token:100},subjectType:"user_nextauth_id"});return e}const Ij="box-file-picker",eDe="0";let $0=null,Pj=!1;const tDe=()=>$0||($0=new Promise((e,t)=>{const n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn01.boxcdn.net/platform/elements/17.1.0/en-US/picker.css",n.onload=()=>{oM({id:"box-picker-script",src:"https://cdn01.boxcdn.net/platform/elements/17.1.0/en-US/picker.js"}).then(()=>{if(!Pj){const r=document.createElement("style");r.textContent=` - .be .be-header input[type="search"] { - background: white; - } - - .btn-content { - display: flex; - justify-content: center; - align-items: center; - } - `,document.head.appendChild(r),Pj=!0,e()}},t)},document.head.appendChild(n)}),$0),nDe=({mode:e,isAudioVideoFilesEnabled:t,onPicked:n,onCancel:r,onError:s})=>{const o=d.useRef(null),a=d.useCallback(async({apiKey:c,pickerType:u="file"})=>{try{if(await tDe(),!document.getElementById(Ij)){s?.("Attempted to open picker when container isn't ready");return}let m=e==="source"?FA:BA;m=t?m.concat(UA):m;const p=[...m,".gdocs",".gsheets",".gslides"];o.current&&(o.current.removeListener("choose",n),o.current.removeListener("cancel",r),o.current.hide(),o.current=null);let h;u==="folder"?h=new window.Box.FolderPicker:h=new window.Box.FilePicker,o.current=h,h.addListener("choose",n),h.addListener("cancel",r),h.show(eDe,c,{container:`#${Ij}`,logoUrl:Cx,extensions:p.join(","),canUpload:!1,canSetShareAccess:!1,canCreateNewFolder:!1,chooseButtonLabel:"Select",cancelButtonLabel:"Cancel"})}catch(f){s?.(f);return}},[s,e,r,n,t]),i=d.useCallback(()=>{o.current&&(o.current.removeListener("choose",n),o.current.removeListener("cancel",r),o.current.hide(),o.current=null)},[n,r]);return d.useMemo(()=>({openPicker:a,cleanupPicker:i}),[a,i])};function Oj(){const e=document.getElementById("dropboxjs");e&&document.body.removeChild(e)}const rDe=()=>{const[e,t]=d.useState(null),n=d.useCallback(async s=>{e!==s&&(Oj(),t(null),await oM({id:"dropboxjs",src:"https://www.dropbox.com/static/api/2/dropins.js",attrs:{"data-app-key":s}}),t(s))},[e]),r=d.useCallback(async s=>{await n(s.clientId);let o=s.mode==="source"?FA:BA;o=s.isAudioVideoFilesEnabled?o.concat(UA):o,window.Dropbox.choose({success:s.onPicked,error:a=>s.onError?.(a),multiselect:!0,extensions:o,folderselect:s.mode==="source"})},[n]);return d.useEffect(()=>()=>{Oj()},[]),d.useMemo(()=>({openPicker:r}),[r])};function sDe(e){return e.every(t=>t instanceof File)}const oDe=({fileInputRef:e,isSignedIn:t,uploadRateLimit:n,maxFilesUpload:r,attachmentTokenEstimationParams:s,forwardedRef:o,existingAttachments:a,showPrivacyWarning:i,onFilePickerOpen:c,onStart:u,onComplete:f,openLoginModal:m,openPricingModal:p,openCompanyDataPrivacyModal:h,closeModal:g,openVisitorLoginUpsell:y,openMicrosoftPicker:x,closeMicrosoftPicker:v,errorMicrosoftPicker:b,toPickerDocument:_,setUploadRateLimit:w,isFollowUp:S,isClearAttachmentsEnabled:C=!1,forceImage:E,refreshBoxCredentials:T,logMicrosoft:k,asyncAttachmentsEnabled:I=!1,setUploadsReady:M,getImageUrl:N,isAudioVideoFilesEnabled:D=!1,reason:j,maxAttachmentFileSizeMB:F=vhe,specialCapabilities:R={unlimitedProSearch:!1,maxModelSelection:!1,unlimitedResearch:!1,fileUpload:!1},onRemoveFile:P,getUserSettingsQueryKey:L,getUserSettings:U})=>{const{$t:O,locale:$}=J(),{openToast:G}=hn(),[H,Q]=d.useState(null),[Y,te]=d.useState(null),[se,ae]=d.useState(!1),[X,ee]=d.useState([]),le=d.useCallback(fe=>{ee(Be=>Be.filter(Fe=>Fe.id!==fe))},[]),[re,ce]=d.useState(X&&X.length>0?"success":"idle"),[ue,me]=d.useState(null),we=`${F}MB`,ye=d.useCallback(async(fe,Be,Fe)=>{if(!kr(fe))return null;const ct=Fe?{type:Fe}:void 0,it=A4(fe)?fe:await N?.(fe)??fe;if(!it)return new File([],Be,ct);try{const zn=await(await fetch(it)).blob();return new File([zn],Be,ct)}catch{return new File([],Be,ct)}},[N]);d.useEffect(()=>{C?ee([]):(async()=>{const Be=await Promise.all((a??Pe).map(async Fe=>{const ct=h3(Fe.split("/").pop()||"file"),it=ty(Fe);let kt=new File([],ct,{type:it}),zn;if(kr(kt)){const cr=await ye(Fe,ct,it);kt=cr??kt,zn=cr?URL.createObjectURL(cr):void 0}return{id:crypto.randomUUID(),file:kt,nextURL:Fe,status:"success",thumbnailSource:zn}}));ee(Be)})()},[C,a,ye]),d.useEffect(()=>{if(!M)return;if(!I||!X.length){M(!0);return}const fe=Fe=>Fe.status==="parsing"||Fe.status==="success"||Fe.status==="failed",Be=X.every(fe);M(Be)},[X,I,M]),d.useImperativeHandle(o,()=>({uploadFiles:fe=>Le(Array.from(fe)),clearFiles:_e}));const _e=d.useCallback(()=>{ee([]),ce("idle"),f?.([]),e.current?.value&&(e.current.value=""),me(null)},[e,f]),ke=d.useCallback((fe,Be)=>{ee(Fe=>{let ct=Fe;return fe?ct=Fe.filter(it=>it.nextURL!==fe):Be&&(ct=Fe.filter(it=>!it.nextURL?.includes(Be))),ct.length===0&&ce("idle"),f?.(ct.filter(it=>!!it.nextURL).map(it=>({url:it.nextURL??"",file:it.file,resizedFile:it.resizedFile}))??[]),P?.(fe,Be),ct}),e.current?.value&&(e.current.value="")},[e,f,P]),De=d.useCallback(()=>{ee([]),ce("idle"),e.current?.value&&(e.current.value=""),me(null)},[e]),xe=d.useCallback(fe=>{te(null),Q(fe??O(go[od.generic_upload_error])),X?.length&&ce("success")},[O,X?.length]),Ue=d.useCallback(()=>{if(!m)return;const fe=O({defaultMessage:"Sign in to upload files and photos",id:"gEOi1eLJ7C"}),Be=O({defaultMessage:"Analyze files and photos for free",id:"nu4bK5/Y5T"});y?y({title:fe,description:Be,origin:ft.FILE_UPLOAD,sheetModalVariant:S?"bottom-sheet-gradient":"full-sheet"}):m({origin:ft.FILE_UPLOAD,pitchMessage:{title:fe,description:Be}})},[O,S,m,y]),Ee=d.useCallback(()=>{if(!p)return;const fe=O({defaultMessage:"Want more uploads?",id:"iInvIJ0Dv/"}),Be=O({defaultMessage:"Upgrade access for subscribers",id:"UwiL3wLZE3"});p({pitchMessage:{title:fe,description:Be},origin:ft.FILE_UPLOAD})},[O,p]),Ke=d.useCallback(async(fe,Be)=>{let Fe;I?Fe=await Tve({request:{file_uuids:[fe]},reason:j}):Fe={file_uuid:fe,success:!0,error_code:null,token_limit_exceeded:!1};const ct=Fe.success?"success":"failed";ct==="failed"?(xe(O(go[Fe.error_code??m3.parsing_error],{filename:Be})),ee(it=>it.filter(kt=>kt.file_uuid!==fe))):(Fe.token_limit_exceeded&&(ae(!0),te(O(go.token_limit_exceeded,{filename:Be}))),ee(it=>[...(it??[]).map(kt=>kt.file_uuid===fe?{...kt,status:ct}:kt)]))},[xe,I,O,j]),Nt=d.useCallback(fe=>fe instanceof File&&F7.includes(fe.type)||!(fe instanceof File)&&fe.mimeType&&F7.includes(fe.mimeType)?O(go[od.unsupported_type]):fe instanceof File&&fe.size>F*L7||!(fe instanceof File)&&fe.sizeBytes&&fe.sizeBytes>F*L7?O(go[od.too_large],{max:we}):fe instanceof File&&fe.size{if(!fe.ok){xe(),Z.warn(`[localAttachmentUpload] upload failed for ${kt}, response=${fe}`);return}let zn=null;try{const Wn=await fe.json();if(Wn?.moderation?.[0]?.status==="rejected"){xe(O(go.failed_moderation)),Z.warn(`[localAttachmentUpload] upload failed moderation for ${kt}, response=${fe}`);return}zn=VR(Wn?.eager?.[0]?.secure_url??Wn?.secure_url)}catch{zn=`${Fe}${ct}`.replace("${filename}",`${Be.name}`)}if(!zn){xe();return}const cr=_d(zn)?"success":"parsing";ee(Wn=>Wn.map(En=>En.id===it?{...En,nextURL:zn,file_uuid:kt,status:cr}:En)),ce("success"),me("local"),kt&&cr=="parsing"&&await Ke(kt,Be.name)},[xe,O,Ke]),ve=d.useCallback(async(fe,Be,Fe)=>{if(!fe?.success){xe();return}if(fe.rate_limited){Ee(),xe(O(go.rate_limited)),le(Fe);return}if(!fe.filename||!fe.url){xe();return}const ct=fe.url&&_d(fe.url)?VR(fe.url):h3(fe.url),it=ty(ct);console.log(fe.url,fe.filename,it);const kt=await ye(fe.url,fe.filename,it),zn=_d(fe.url)?"success":"parsing";ee(cr=>cr.map(Wn=>Wn.id===Fe?{...Wn,file:kt??Wn.file,nextURL:ct,file_uuid:fe.file_uuid??void 0,status:zn,thumbnailSource:kt?URL.createObjectURL(kt):void 0}:Wn)),ce("success"),me(Be),fe.file_uuid&&zn=="parsing"&&await Ke(fe.file_uuid,fe.filename)},[ye,xe,Ee,O,Ke,le]),Ae=d.useCallback(async(fe,Be)=>{const Fe=()=>ee(it=>it.filter(kt=>kt.id!==Be.id));if(fe?.error){fe.error==="attachments_disabled_by_organization"?xe(O(go[od.attachments_disabled_by_organization])):xe(),Fe();return}if(fe?.rate_limited){Ee(),Fe(),xe(O(go.rate_limited)),le(Be.id);return}if(!fe||!fe.fields||!fe.s3_bucket_url){xe(),Fe();return}UK(Be)&&ee(it=>it.map(kt=>kt.id===Be.id?{...kt,thumbnailSource:URL.createObjectURL(Be.file)}:kt));const ct=new FormData;Object.entries(fe.fields).forEach(([it,kt])=>{ct.append(it,kt)}),ct.append("file",Be.file);try{const it=await fetch(fe.s3_bucket_url,{method:"POST",body:ct});await pe(it,Be.file,fe.s3_bucket_url,fe.fields.key,Be.id,fe.file_uuid??void 0)}catch(it){Z.warn(`[localAttachmentUpload] upload failed for ${fe.file_uuid} with error=${it}`),xe(),Fe()}},[Ee,xe,O,pe,le]),We=d.useCallback(fe=>{const Be=fe.filter(ct=>ct.status==="success").reduce((ct,it)=>{const kt=it.file.type,zn=kt.split("/")[0],cr=s?.type_subtype_bytes_per_token?.[kt],Wn=s?.type_bytes_per_token?.[zn],En=s?.default_bytes_per_token,Xn=cr??Wn??En,Wr=it.file.size,Ms=Xn?Wr/Xn:0;return ct+Ms},0),Fe=s?.max_total_tokens;return Fe&&Be>Fe},[s]);d.useEffect(()=>{if(!X.length||se)return;X.every(Be=>Be.status==="success"||Be.status==="failed")&&We(X)&&te(O({defaultMessage:"Performance may be degraded for larger files.",id:"xwKpaJzWgU"}))},[X,We,O,se]);const pt=d.useCallback(async fe=>{const{fileList:Be,fileSource:Fe,setUploadRateLimit:ct}=fe,it=[],kt=Be.map(async En=>{const Xn=Nt(En);if(Xn)return{file:En,error:Xn};let Wr=En;if(kr(En))try{Wr=await fNe(En)}catch{Z.warn(`Unable to resize image file: ${En.name}`)}return{file:Wr,error:null}}),zn=await Promise.all(kt);for(const En of zn){if(En.error){xe(En.error);continue}const Xn=crypto.randomUUID(),Wr={id:Xn,file:En.file,status:"uploading"};it.push({uuid:Xn,file:En.file,uploadedFile:Wr}),ee(Ms=>[...Ms??[],Wr])}if(it.length===0)return;const cr=await kve({filesWithUuids:it.map(({uuid:En,file:Xn})=>({uuid:En,file:Xn})),fileSource:Fe,forceImage:E,reason:j});let Wn=0;cr?await Promise.all(it.map(async({uuid:En,uploadedFile:Xn})=>{const Wr=cr[En];Wr&&(await Ae(Wr,Xn),Wn++)})):(it.forEach(({uploadedFile:En})=>{le(En.id)}),xe(O({defaultMessage:"Failed to get upload URLs. Please try again.",id:"JaG6Y+rSl4"}))),n&&n>0&&ct&&ct(Wn)},[Nt,xe,E,j,Ae,n,le,O]),Gt=d.useCallback((fe,Be,Fe)=>{sDe(fe)?pt({fileList:fe,fileSource:Fe,setUploadRateLimit:w}):Be&&fe.forEach(ct=>{const it=Nt(ct);if(it)xe(it);else{const kt=ty(ct.name??""),zn=new File([""],ct.name??"",{type:kt}),cr={id:ct.id,file:zn,status:"uploading"};ee(Wn=>[...Wn??[],cr]),Mve({remote_file_id:ct.id,connection_type:Be.toUpperCase(),reason:j}).then(Wn=>{ve(Wn,Be,cr.id)})}})},[Nt,xe,ve,pt,j,w]),Le=d.useCallback((fe,Be,Fe)=>{if(!(!fe||fe.length===0)){if(Fe!==iV){if(!t&&!R.fileUpload){Ue();return}if(n&&n<=0){Ee();return}if(fe.length+(X?.length??0)>r){Q(O(go.over_file_count,{maxNumFiles:r}));return}}u?.(),ce("loading"),Gt(fe,Be,Fe)}},[t,n,X,r,Gt,u,Ue,Ee,O,R.fileUpload]),gt=d.useCallback(async(fe,Be,Fe)=>{try{const it=await(await fetch(fe)).blob(),kt=Fe||it.type||"application/octet-stream";return new File([it],Be,{type:kt})}catch{return new File([],Be,Fe?{type:Fe}:void 0)}},[]),Je=d.useCallback(async(fe,Be,Fe)=>{const it=(Fe?Fe.startsWith("image/"):kr(fe))?await ye(fe,Be,Fe):await gt(fe,Be,Fe);it&&Le([it],"local")},[gt,ye,Le]),Me=mt({queryKey:L({skipConnectorPickerCredentials:!1}),queryFn:()=>U({reason:j,headers:$?{"accept-language":$}:{},skipConnectorPickerCredentials:!1}),enabled:!1}),Ve=d.useCallback(async fe=>{const ct=(await(async()=>{if(Me.status==="success")return Me.data;const{data:it}=await Me.refetch();return it})())?.connectors.connectors.find(it=>it.name===fe);return ct||(Z.error(`Connector ${fe} not found in user settings`),null)},[Me]),{openPicker:lt}=eQ({isAudioVideoFilesEnabled:D}),xt=d.useCallback(async fe=>{const Be=await Ve("google_drive");if(!Be){G({variant:"error",message:O({defaultMessage:"Failed to open Google Drive file picker",id:"Ja2aztZ3b+"}),timeout:5e3});return}lt({...fe,clientId:Be.picker_credentials?.client_id??"",loginHint:Be.connection_display_name??""})},[Ve,lt,G,O]),[Pt,$e]=d.useState(!1),ht=d.useCallback(()=>$e(!1),[]),Zt=d.useCallback(fe=>{const Be=fe.map(Fe=>({id:Fe.id,name:Fe.name,sizeBytes:Fe.size,mimeType:J3[Fe.extension]}));Le(Be,"box"),ht()},[Le,ht]),{openPicker:dt,cleanupPicker:Ct}=nDe({mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:Zt,onCancel:ht}),Ot=d.useCallback(async(fe={})=>{const Be=await Ve("box");if(!Be){G({variant:"error",message:O({defaultMessage:"Failed to open Box file picker",id:"+Yt3OYcUhg"}),timeout:5e3});return}const Fe=Be.picker_credentials?.expires_at;if(Fe&&T){const ct=new Date(Fe);if(isNaN(ct.getTime())){$e(!0);return}if(ct{$e(!0)},[]);d.useEffect(()=>{Pt&&Ot()},[Pt,Ot]);const lr=d.useCallback((fe,Be)=>{if(!_||Be!=="onedrive"&&Be!=="sharepoint")return;const Fe=fe.map(ct=>_(ct,Be)).filter(ct=>ct!==null);Le(Fe,Be),v?.()},[_,Le,v]),{openPicker:Qr}=rDe(),tr=d.useCallback(async fe=>{const Be=await Ve("dropbox");if(!Be){G({variant:"error",message:O({defaultMessage:"Failed to open Dropbox file picker",id:"1xye5E73zP"}),timeout:5e3});return}Qr({...fe,clientId:Be.picker_credentials?.client_id??""})},[Ve,Qr,G,O]),bn=d.useCallback(fe=>{const Be=fe.map(Fe=>{const ct=mu(Fe.name);return ct?{id:Fe.id,name:Fe.name,sizeBytes:Fe.bytes,mimeType:J3[ct]}:null}).filter(Fe=>Fe!==null);Le(Be,"dropbox")},[Le]),nr=d.useCallback(()=>xe(O({defaultMessage:"Unable to retrieve files from connector.",id:"4seKuUP1Wo"})),[xe,O]),Xr=d.useCallback(async(fe,Be)=>{if(!x)return;const Fe=await Ve(fe);if(!Fe){const ct=O(fe==="onedrive"?{defaultMessage:"Failed to open OneDrive file picker",id:"L7gmeOx2re"}:{defaultMessage:"Failed to open SharePoint file picker",id:"/2WBhsPWAQ"});G({variant:"error",message:ct,timeout:5e3});return}x({...Be,connector:fe,clientId:Fe.picker_credentials?.client_id??"",tenantName:Fe.picker_credentials?.tenant_name??"",loginHint:Fe.connection_display_name??"",accountIdentifier:Fe.picker_credentials?.account_identifier})},[Ve,x,G,O]),Qo=d.useCallback((fe,Be)=>{fe=="google_drive"?xt({mode:"attachment",onPicked:Fe=>Le(Fe,fe)}):fe==="onedrive"||fe==="sharepoint"?Xr(fe,{webUrl:Be,mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:Fe=>lr(Fe,fe),onError:b,onCancel:v,log:k}):fe==="dropbox"?tr({mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:bn,onError:nr}):fe=="box"&&Qt()},[xt,Le,Xr,lr,v,b,tr,bn,nr,Qt,k,D]),lc=d.useCallback(fe=>{h&&h(()=>{g?.(),!fe||fe==="local"?(e.current?.click(),c?.()):Qo(fe)})},[e,g,h,Qo,c]),ds=d.useCallback(fe=>{if(!t&&!R.fileUpload){Ue();return}if(n&&n<=0){Ee();return}if(i&&!mr(Hy)){lc(fe),lo(Hy,"true",{expires:30});return}!fe||fe==="local"?(e.current?.click(),c?.()):Qo(fe)},[t,n,i,e,Ue,Ee,lc,Qo,c,R.fileUpload]);return d.useEffect(()=>{let fe=null;return Y&&(fe=setTimeout(()=>{te(null)},xhe)),()=>{fe&&clearTimeout(fe)}},[Y]),d.useEffect(()=>{X&&f?.(X.filter(fe=>!!fe.nextURL).map(fe=>({url:fe.nextURL??"",file:fe.file,resizedFile:fe.resizedFile})))},[X,f]),d.useMemo(()=>({errorMessage:H,warningMessage:Y,uploadedFiles:X,uploadSource:ue,status:re,fileInputRef:e,handleClearFiles:_e,handleRemoveFile:ke,handleStartUpload:ds,handleFileInput:Le,attachFromUrl:Je,removeAllFiles:De,handleOpenLoginModal:Ue,handleOpenPricingModal:Ee,isBoxOpen:Pt,onCloseBox:ht,cleanupBoxPicker:Ct,setErrorMessage:Q}),[H,Y,X,ue,re,e,_e,ke,ds,Le,Je,De,Ue,Ee,Pt,ht,Ct])},aDe=({fileUploadRef:e,disablePrivacyWarning:t,isAudioVideoFilesEnabled:n,isClearAttachmentsEnabled:r,isFollowUp:s,organization:o,lastResult:a,onStartFileUpload:i,onCompleteFileUpload:c,setUploadsReady:u,reason:f,specialCapabilities:m,askInputRef:p,onRemoveFile:h})=>{const g=d.useRef(null),{inputRef:y}=qr(),{openModal:x,closeModal:v}=pn().legacy,b=$4(),_=J9e(),{value:w}=zt({flag:"async-attachment-processing",defaultValue:!1,subjectType:"user_nextauth_id"}),S=Wt(),{openVisitorLoginUpsell:C}=du({enabled:!S}),E=ag(),{hasDataRetentionWarning:T,connectorLimits:k}=Ea({reason:f}),{uploadRateLimit:I,setUploadRateLimit:M}=Vn(),{hasActiveSubscription:N}=$t(),D=I??(N?wM:_M),j=d.useCallback(re=>x("loginModal",re),[x]),F=d.useCallback(re=>{E(re)},[E]),R=d.useCallback(re=>x("companyDataPrivacyModal",{organizationName:o?.display_name??"",onContinue:re}),[x,o]),{onOpen:P,onClose:L,onError:U,toPickerDocument:O,options:$,onSelectSite:G,isOpen:H,log:Q}=Z9e({reason:f,mode:"attachment"}),{mutateAsync:Y}=q9e({reason:f}),{getCachedImageDownloadUrl:te,getImageDownloadUrl:se}=Mv({reason:f}),ae=d.useCallback(async re=>a?.backend_uuid?await se({url:re,thread_id:a.backend_uuid}):te(re),[te,se,a?.backend_uuid]),X=oDe({fileInputRef:g,isSignedIn:S,uploadRateLimit:D,maxFilesUpload:b,attachmentTokenEstimationParams:_,forwardedRef:e,showPrivacyWarning:T&&!t,onStart:i,onComplete:c,openLoginModal:j,openPricingModal:F,openCompanyDataPrivacyModal:R,closeModal:v,openVisitorLoginUpsell:C,openMicrosoftPicker:P,closeMicrosoftPicker:L,errorMicrosoftPicker:U,toPickerDocument:O,setUploadRateLimit:M,isFollowUp:s,isClearAttachmentsEnabled:r,refreshBoxCredentials:Y,logMicrosoft:Q,asyncAttachmentsEnabled:w,setUploadsReady:u,getImageUrl:ae,isAudioVideoFilesEnabled:n,reason:f,maxAttachmentFileSizeMB:k?.max_attachment_file_size_mb,specialCapabilities:m,onRemoveFile:h,getUserSettingsQueryKey:iu,getUserSettings:XH}),{attachFromUrl:ee,removeAllFiles:le}=X;return d.useImperativeHandle(p??null,()=>({addMediaFile:async(re,ce,ue)=>{await ee(re,ce,ue)},focusInput:()=>{y.current?.focus()},blurInput:()=>{y.current?.blur()},removeAttachments:()=>{le()}}),[ee,y,le]),d.useMemo(()=>({...X,fileInputRef:g,microsoftFilePickerOptions:$,handleSelectSharepointSite:G,isMicrosoftFilePickerOpen:H,onCloseMicrosoft:L,addMediaFile:ee,removeAllFiles:le}),[X,G,H,$,L,ee,le])},iDe=({setInput:e})=>{const t=fn();d.useEffect(()=>{if(!t)return;const n=t.get("p_q");n&&e(n)},[t,e])};function lDe(){return Intl.DateTimeFormat().resolvedOptions().timeZone}async function cDe({body:e,reason:t}){try{const{data:n,error:r,response:s}=await de.POST("/rest/realtime/v1/transcription-session",t,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json"}});return r?{status:s.status,error:`Failed to get GA realtime transcription session: ${s.statusText}`}:{data:n,status:s.status,error:null}}catch(n){return Z.error("Failed to get GA realtime transcription session",n),{data:null,status:500,error:`Failed to get GA realtime transcription session: ${n}`}}}async function xbt({body:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/search-youtube",t,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});if(s)throw Z.error("Failed to search video",s),new he("API_CLIENTS_ERROR",{message:"Failed to search video",cause:s,status:o.status??0});return r}async function vbt({body:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/search-web",t,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});if(s)throw Z.error("Failed to search web",s),new he("API_CLIENTS_ERROR",{message:"Failed to search web",cause:s,status:o.status??0});return r}async function bbt({entry:e,analyticsParams:t,reason:n,requestId:r}){const{data:s,error:o,response:a}=await de.POST("/rest/realtime/create-entry",n,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:{...e,analytics_params:{...t,timezone:lDe()}},headers:{"content-type":"application/json",...r?{[yn]:r}:{}}});if(o)throw Z.error("Failed to create entry",o),new he("API_CLIENTS_ERROR",{message:"Failed to create entry",cause:o,status:a.status??0});return s}async function _bt({params:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/v1/upload-audio",t,{timeoutMs:Qe({productionMs:3e4}),numRetries:2,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});if(s)throw Z.error("Failed to upload audio",s),new he("API_CLIENTS_ERROR",{message:"Failed to upload audio",cause:s,status:o.status??0});return r}async function wbt({body:e,reason:t,requestId:n}){try{const{data:r,error:s,response:o}=await de.POST("/rest/realtime/v2/session",t,{timeoutMs:Qe({productionMs:1e4,clientSideMs:1e4}),numRetries:2,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});return s?{status:o.status,data:void 0,error:o.statusText||"Failed to create realtime session v2"}:{status:o.status,data:r,error:void 0}}catch(r){return Z.error("Failed to create realtime session v2",r),{status:500,data:void 0,error:`Failed to create realtime session v2: ${r}`}}}async function uDe({body:e,reason:t}){try{const{data:n,error:r,response:s}=await de.POST("/rest/realtime/v2/language-learning/session",t,{timeoutMs:Qe({productionMs:1e4,clientSideMs:1e4}),numRetries:1,body:e,headers:{"content-type":"application/json"}});return r?{status:s.status,data:void 0,error:s.statusText||"Failed to create language learning session v2"}:{status:s.status,data:n,error:void 0}}catch(n){return Z.error("Failed to create language learning session v2",n),{status:500,data:void 0,error:`Failed to create language learning session v2: ${n}`}}}const Cbt="web.frontend.realtime.voice",Sbt="oai-realtime-v2v-tool-call",Ebt=4096,dDe=.7;var Lj;(function(e){e.BrowserGetUrlContent="get_full_page_content",e.ControlBrowser="control_browser",e.CloseBrowserTabs="close_browser_tabs",e.GroupOpenBrowserTabs="group_open_browser_tabs",e.OpenNewBrowserTab="open_page",e.SearchBrowser="search_browser",e.UngroupOpenBrowserTabs="ungroup_open_browser_tabs"})(Lj||(Lj={}));var Fj;(function(e){e.ActiveTabs="active_tabs",e.BrowsingHistory="browsing_history"})(Fj||(Fj={}));var xl;(function(e){e.MobileWeb="mobile_web",e.Web="web",e.macOS="macos",e.iOS="ios",e.Android="android",e.Windows="windows"})(xl||(xl={}));const kbt=3e3,Mbt=3,Tbt=5;function Abt(e){const t=e.toLowerCase();return t.includes("airpod")||t.includes("headphone")||t.includes("earbud")||t.includes("headset")?"near_field":t.includes("built-in")||t.includes("internal")||t.includes("macbook")||t.includes("laptop")||t.includes("usb")||t.includes("conference")||t.includes("desk")||t.includes("array")||t.includes("camera")?"far_field":null}const fDe=e=>e.isWindowsApp?CM:Ca()?lV():e.isIOS?_he:e.isAndroid?whe:e.isMobile?Bfe:Ufe,mDe=e=>e.isChrome||e.isFirefox?e.isMobile?xl.MobileWeb:xl.Web:e.isMacOS?xl.macOS:e.isIOS?xl.iOS:e.isAndroid?xl.Android:e.isWindowsOS?xl.Windows:"",pDe=()=>{const{device:{isWindowsApp:e,isIOS:t,isAndroid:n,isMobile:r}}=sn();return fDe({isWindowsApp:e,isIOS:t,isAndroid:n,isMobile:r})},Nbt=()=>{const{device:{isChrome:e,isFirefox:t,isMobile:n,isMacOS:r,isIOS:s,isAndroid:o,isWindowsOS:a}}=sn();return mDe({isChrome:e,isFirefox:t,isMobile:n,isMacOS:r,isIOS:s,isAndroid:o,isWindowsOS:a})},hDe=({callbacks:e,config:t,reason:n})=>{const[r,s]=d.useState(!1),[o,a]=d.useState(""),[i,c]=d.useState(!1),[u,f]=d.useState(null),[m,p]=d.useState(()=>{const ee=vt.getItem(__);return ee?ee==="true":null}),{session:h}=Ne(),{trackEvent:g}=Xe(h),y=pDe(),x=t.silenceThreshold??30,v=t.silenceDuration??5e3,b=d.useRef(null),_=d.useRef(null),w=d.useRef(""),S=d.useRef(null),C=d.useRef(!1),E=d.useRef(null),T=d.useRef(null),k=d.useRef(null),I=d.useRef(null),M=d.useRef(null),N=d.useRef(new Map),D=d.useRef(null),j=d.useRef(null),F=d.useRef(null),R=d.useRef([]),P=d.useRef(null),L=d.useCallback(async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(le=>le.stop()),p(!0),vt.setItem(__,"true"),!0}catch(ee){return f(`Microphone permission denied. ${ee}`),p(!1),vt.setItem(__,"false"),!1}},[]),U=d.useRef(!1),O=d.useCallback(()=>{S.current&&(S.current.getTracks().forEach(ee=>ee.stop()),S.current=null)},[]),$=d.useCallback(()=>{if(C.current=!1,k.current&&(clearTimeout(k.current),k.current=null),E.current&&(E.current.close(),E.current=null,T.current=null),b.current&&r&&b.current.stop(),P.current&&(clearInterval(P.current),P.current=null),F.current&&(F.current.port.onmessage=null,F.current.disconnect(),F.current=null),_.current&&_.current.stop(),O(),w.current="",a(""),N.current.clear(),s(!1),M.current&&(M.current.close(),M.current=null),I.current){const ee=Date.now()-I.current;g("stop transcription",{durationMs:ee})}I.current=null,e?.onStop?.()},[e,O,g,r]),G=d.useCallback(ee=>{if(!ee||!C.current)return;const le=ee.frequencyBinCount,re=new Uint8Array(le);ee.getByteFrequencyData(re),re.reduce((ue,me)=>ue+me)/le{C.current&&e?.onSilence?.()},v)):k.current&&(clearTimeout(k.current),k.current=null),C.current&&requestAnimationFrame(()=>G(ee))},[e,x,v]),H=d.useCallback(()=>Array.from(N.current.values()).map(le=>le.finalTranscript||le.partialTranscript||"").join(" ").trim(),[N]),Q=d.useCallback(ee=>{const{type:le,item_id:re}=ee;if(!re)return;N.current.has(re)||N.current.set(re,{itemId:re,partialTranscript:"",finalTranscript:""});const ce=N.current.get(re),ue=j.current||"";switch(le){case"conversation.item.input_audio_transcription.delta":{const{delta:me}=ee;ue==="whisper-1"?ce.partialTranscript=me:ce.partialTranscript+=me;break}case"conversation.item.input_audio_transcription.completed":{const{transcript:me}=ee;typeof me=="string"&&(ce.finalTranscript=me);break}case"input_audio_buffer.committed":{ee.previous_item_id&&(ce.previousItemId=ee.previous_item_id);break}}N.current.set(re,ce),a(H())},[H]),Y=d.useCallback(async()=>{const ee=await cDe({body:{source:y,timezone:mM,turn_detection_threshold:dDe,response_language:"en"},reason:n});if(!ee.data?.client_secret)throw Z.error("No ephemeral key from server"),new Error("Unable to start OAI session");D.current=ee.data.session_id,j.current=ee.data.model_name;const re=["realtime",`openai-insecure-api-key.${ee.data.client_secret}`],ce=new WebSocket("wss://api.openai.com/v1/realtime?intent=transcription",re);M.current=ce,ce.onopen=()=>Z.info("OpenAI WS connected (base64 PCM approach)"),ce.onerror=ue=>{Z.error("OAI WS error:",ue),f("OpenAI WS error")},ce.onclose=ue=>{Z.info("OAI WS closed:",ue.code)},ce.onmessage=ue=>{try{const me=JSON.parse(ue.data);Q(me)}catch(me){Z.error("Invalid OAI WS message:",ue.data,me)}}},[Q,y,n]),te=d.useCallback(ee=>{let le=0;for(const ue of ee)le+=ue.length;const re=new Int16Array(le);let ce=0;for(const ue of ee)re.set(ue,ce),ce+=ue.length;return re},[]),se=d.useCallback(ee=>{const le=ee.buffer;let re="";const ce=new Uint8Array(le);for(const ue of ce)re+=String.fromCharCode(ue);return btoa(re)},[]),ae=d.useCallback(async ee=>{const le=new AudioContext;E.current=le,await le.audioWorklet.addModule("/audio-worklet.js");const re=new AudioWorkletNode(le,"pcm-worklet-processor");F.current=re,re.port.onmessage=ue=>{if(!C.current)return;const me=ue.data;R.current.push(me)},P.current||(P.current=setInterval(()=>{if(!C.current||!M.current||M.current.readyState!==WebSocket.OPEN||R.current.length===0)return;const ue=te(R.current);R.current=[];const me=se(ue),we={event_id:`evt-${Date.now()}`,type:"input_audio_buffer.append",audio:me};M.current.send(JSON.stringify(we))},500));const ce=le.createMediaStreamSource(ee);ce.connect(re),re.connect(le.destination),T.current=le.createAnalyser(),T.current.fftSize=256,ce.connect(T.current),requestAnimationFrame(()=>G(T.current))},[G,te,se]),X=d.useCallback(async()=>{if(f(null),I.current=Date.now(),g("start transcription"),C.current=!0,(m===null||m===!1)&&(c(!0),!await L())){c(!1),f("Microphone permission is required for voice input"),e?.onStop?.(),C.current=!1;return}try{await Y();const ee=await navigator.mediaDevices.getUserMedia({audio:!0}).catch(async le=>{if(p(!1),!await L())throw le;return navigator.mediaDevices.getUserMedia({audio:!0})});S.current=ee,await ae(ee),U.current&&_.current&&(w.current="",a(""),_.current.start(),_.current.onspeechend=()=>$()),s(!0),c(!1),e?.onStart?.()}catch(ee){f(`Failed to start recording. ${ee}`),C.current=!1}},[e,m,L,g,$,Y,ae]);return d.useMemo(()=>({isTranscribing:r,isInitializing:i,transcription:o,error:u,startTranscription:X,stopTranscription:$}),[u,i,r,X,$,o])},gDe=1e4,v2="autosuggest",yDe="AUTOSUGGEST_MESSAGE_MALFORMED",xDe="AUTOSUGGEST_MESSAGE_PARSE_ERROR",vDe="AUTOSUGGEST_WS_CONNECTION_ERROR",bDe="AUTOSUGGEST_WS_SEND_QUERY_ERROR",_De=()=>{const{device:{isMobile:e}}=sn(),t=Yt();return d.useCallback(n=>{const r=t.getQueryData(be.makeEphemeralQueryKey(v2)),s=t.getQueryData(be.makeEphemeralQueryKey(v2,n));if(s?.length&&s.length===kp(e))return s;if(r){const o=n.replace(/\s+/g,"").toLocaleLowerCase(),a=[];for(const f of r){if(e&&f.url)continue;const[m,p]=$Q(o,f);if(m&&(a.push([p,f]),a.length===kp(e)))break}const i=a.sort(([f],[m])=>f-m).map(([f,m])=>m),[c,u]=cE(i,e,n);if(s?.length){const f=[...s];for(const m of c)if(!f.find(p=>p.query===m.query)&&(f.push(m),f.length===kp(e)))break;return cE(f,e,n)[1]}return u}return Pe},[e,t])},wDe=()=>{const{suggestions:e}=qr(),{setSuggestions:t}=jo(),n=d.useRef(e);n.current=e;const r=Yt(),s=_De(),o=d.useRef(!1),{device:{isMobile:a}}=sn(),i=d.useRef(null),c=d.useRef(null),u=d.useRef([]),f=d.useRef({lastMessageID:0});d.useLayoutEffect(()=>()=>{o.current=!1},[]);const m=d.useCallback((y,x=!1)=>{const v=s(y);!x&&!v.length||(n.current.length!==v.length||eme(n.current,v,"query").length!==v.length)&&(n.current=v,t(v))},[s,t]),p=d.useCallback(y=>{try{const x=new WebSocket("wss://suggest.perplexity.ai/suggest/ws");x.onopen=()=>{y?.()},x.onmessage=v=>{let b;try{if(b=JSON.parse(v.data),b.length<4){Z.error(yDe,b);return}}catch(M){Z.error(xDe,M);return}const[_,w,S,C]=b,E=parseInt(S),T=a9e(C),[k,I]=cE(T,a);if(r.setQueryData(be.makeEphemeralQueryKey(v2),(M=Pe)=>k.length?jU([...k,...M],"query").sort((N,D)=>N.query.localeCompare(D.query)):M),r.setQueryData(be.makeEphemeralQueryKey(v2,_),I),E===f.current.lastMessageID&&o.current&&m(_,!0),f.current[E]){const M=performance.now()-f.current[E];u.current.push(M)}},i.current=x}catch(x){Z.error(vDe,x)}},[a,m,r]),h=d.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{i.current&&(i.current.close(),i.current=null)},gDe)},[]);d.useEffect(()=>(p(),h(),()=>{i.current&&i.current.close(),c.current&&clearTimeout(c.current)}),[p,h]);const g=d.useCallback((y,x=!0)=>{if(o.current=!!y.trim(),!o.current)return;m(y);const v=[WebSocket.OPEN,WebSocket.CONNECTING];if(!i.current||!v.includes(i.current.readyState)){x&&p(()=>{g(y,!1)});return}else h();const b=f.current.lastMessageID+1,_=b.toString();f.current.lastMessageID=b;try{const w=JSON.stringify({q:y,uuid:_,full_completion:!0});if(i.current.readyState===WebSocket.CONNECTING)return;i.current.send(w),f.current[b]=performance.now()}catch(w){Z.error(bDe,w)}},[p,h,m]);return d.useEffect(()=>{const y=setInterval(()=>{u.current.length!==0&&(lxe({latencies:u.current,isMobile:a}),u.current=[])},n9e);return()=>clearInterval(y)},[a]),d.useMemo(()=>({handleUpdateAutosuggestions:g}),[g])};function CDe(){const{value:e}=zt({flag:"clear-attachment-on-submission",subjectType:"user_nextauth_id",defaultValue:!1});return e}const SDe=({entropyBrowser:e,isSidecar:t,focusInput:n})=>{d.useEffect(()=>{if(!e||!t)return;const r=()=>{document.visibilityState==="visible"&&n()},s=e.subscribeQuickActionButtonFired(()=>{n()});return document.addEventListener("visibilitychange",r),()=>{s(),window.removeEventListener("visibilitychange",r)}},[e,n,t])},aX=A.memo(function(t){const{children:n,condition:r,Wrapper:s,...o}=t;return r?l.jsx(s,{...o,children:n}):n});aX.displayName="ConditionalWrapper";let Mm=0;function EDe(e,t,n=!1){const[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useCallback(g=>{g.preventDefault()},[]),c=d.useCallback(g=>{g?.dataTransfer?.types.includes("Files")&&(g.preventDefault(),s(!0),Mm++)},[]),u=d.useCallback(g=>{g.preventDefault(),Mm=Math.max(0,Mm-1),Mm===0&&s(!1)},[]),f=d.useCallback(g=>{g.preventDefault(),s(!1),a(!1),Mm=0,!t&&n&&g.dataTransfer?.items.length&&e(g.dataTransfer.items)},[t,e,n]),m=d.useCallback(g=>{g?.dataTransfer?.types.includes("Files")&&(g.preventDefault(),a(!0))},[]),p=d.useCallback(g=>{g.preventDefault(),a(!1)},[]),h=d.useCallback(g=>{g.preventDefault(),s(!1),a(!1),!t&&!n&&g?.dataTransfer?.items.length>0&&e(g.dataTransfer.items)},[t,e,n]);return d.useEffect(()=>(document.addEventListener("dragover",i),document.addEventListener("dragenter",c),document.addEventListener("dragleave",u),document.addEventListener("drop",f),()=>{document.removeEventListener("dragover",i),document.removeEventListener("dragenter",c),document.removeEventListener("dragleave",u),document.removeEventListener("drop",f)}),[i,c,u,f]),d.useMemo(()=>({isDraggingFile:r,isFileOver:o,rootProps:{onDragOver:m,onDragLeave:p,onDrop:h}}),[p,m,h,r,o])}const iX=A.memo(({onDrop:e,disabled:t=!1,children:n,dropZoneClassName:r,dropLabel:s,dropIcon:o=B("arrow-bar-to-down"),allowDropAnywhere:a=!1,hideContent:i=!1,...c})=>{const{$t:u}=J(),{isDraggingFile:f,isFileOver:m,rootProps:p}=EDe(e,t,a),h=s??u(a?{defaultMessage:"Dropped files appear here.",id:"9WR4elgZix"}:{defaultMessage:"Drop your files here.",id:"llIM82nPs+"});return l.jsxs("div",{className:"relative",...p,...c,children:[f&&t?l.jsx(K,{className:z("border-subtler bg-subtler absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed",{"!border-caution":m},r?.(f,m)),children:l.jsxs(V,{color:"red",children:[l.jsx(ge,{icon:o,className:"mr-2"}),"Drop zone disabled"]})}):f?l.jsxs(l.Fragment,{children:[l.jsx(K,{variant:"background",className:"absolute inset-0 z-20 rounded-2xl opacity-80"}),l.jsx(K,{className:z("gap-x-sm animate-in fade-in border-subtler absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed transition-all duration-200",{"!border-super":m},r?.(f,m)),children:!i&&l.jsxs(V,{color:"super",children:[l.jsx(ge,{icon:o,className:"mr-2"}),h]})})]}):null,n]})});iX.displayName="DropZone";const kDe=({value:e,json:t,querySource:n,placeholder:r,placeholderClassName:s,disableSubmission:o=!1,disableInput:a=!1,initialLayout:i="expanded",minRows:c=1,isFollowUp:u=!1,submitWillFork:f=!1,showSources:m=!1,useThreadSources:p=!1,showRecency:h=!1,showModelSelector:g=!0,showSearchModeSelector:y=!0,showFileUpload:x=!1,disableActionButtons:v=!1,showIncognitoHint:b,hasShadow:_=!1,autofocus:w=!0,disablePrivacyWarning:S=!1,fileUploadTooltip:C,className:E,headerComponent:T,showStopButton:k=!1,forceHideSuggestions:I=!1,onChange:M,onFocus:N,onBlur:D,onClick:j,onSubmit:F,onStopButtonClick:R=Ao,onFilePickerOpen:P,onFilePickerClose:L,autosuggestionsEnabled:U=!0,dropdownPlacement:O="bottom",dropdownClassName:$,useLexical:G=!1,mentionTypeaheadOptions:H,isCometHome:Q=!1,syncUncontrolledOnce:Y=!1,onTriggerTypeahead:te,layoutKey:se,isHighlighted:ae,isMissionControl:X,ref:ee,onRemoveFile:le,onFileAttachComplete:re,renderAttachments:ce=!0})=>{const ue=`ask-input-inner-${n}`,me=d.useRef(!1),[we,ye]=d.useState(!1),[_e,ke]=d.useState(w),{suggestions:De,blankStateSuggestions:xe,showSuggestDropdown:Ue,browserAgentAllowOnceFromToggle:Ee,forceEnableBrowserAgent:Ke}=qr(),{setSuggestions:Nt}=jo(),{isMobileStyle:pe,isMobileUserAgent:ve}=Re(),{inputRef:Ae}=qr(),[We,pt]=d.useState(!0),Gt=d.useRef(null),{currentOpenedModal:Le}=pn().legacy,gt=!!Le,Je=Wt(),{quote:Me,setQuote:Ve}=Ho(),lt=CDe(),xt=Vo(),{sources:Pt}=Vn(),{specialCapabilities:$e}=Yr(),{lastResult:ht,inFlight:Zt,resultsLength:dt}=on(),Ct=un(),Ot=J(),Qt=d.useRef(null),lr=d.useRef(null),[Qr,tr]=d.useState(!1),bn=d.useCallback(()=>tr(!0),[]),nr=d.useCallback(()=>tr(!1),[]),{cacheImageDownloadUrl:Xr}=Mv({reason:ue}),[Qo,lc]=d.useState(void 0),ds=d.useMemo(()=>Qo?.map(kn=>kn.url),[Qo]),fe=d.useMemo(()=>{if(e.length>Ec)return Ot.formatMessage({defaultMessage:"Query is { numCharacters } characters too long",id:"yw04s2k4La"},{numCharacters:e.length-Ec})},[e,Ot]),{handleUpdateAutosuggestions:Be}=wDe(),Fe=d.useCallback(kn=>{if(!(me.current||!We)){if(Be(""),me.current=!0,!kn.query&&ds&&ds.length>0){const ms=cu(ds[0]);kn.query=ms!=="File"?ms:"File Attached"}fe?me.current=!1:(setTimeout(()=>me.current=!1,Z4),F?.({query:kn.query,json:kn.json,attachments:ds,promptSource:kn.promptSource,querySource:kn.querySource,mentions:kn.mentions,browserAgentAllowOnceFromToggle:Ee,forceEnableBrowserAgent:Ke}),Qo?.forEach(ms=>{ms.file&&ms.file.size>0&&kr(ms.url)&&Xr(ms.url,ms.resizedFile??ms.file)}),(lt||X)&&Qt.current?.clearFiles(),lr.current?.clearAutoCreatedTextFile())}},[ds,Qo,Ee,Ke,Xr,fe,Be,lt,X,F,We]);d.useEffect(()=>Ct.subscribeForceSubmitQuery(kn=>{Fe(kn)}),[Ct,Fe]);const{isDisabled:ct,focusedIndex:it,setFocusedIndex:kt,userInputQuery:zn,handleSuggestionSubmission:cr,handleFocus:Wn,handleBlur:En,handleChange:Xn,handleKeyDown:Wr,focusInput:Ms,hasQuery:wu}=W9e({value:e,json:t,querySource:n,disableSubmission:o,disableInput:a,autofocus:w,isUploadingFile:we,onChange:M,onFocus:N,onBlur:D,handleSubmit:Fe,handleUpdateAutosuggestions:Be,autosuggestionsEnabled:U,errorMessage:fe,sources:Pt,attachments:ds,selectedSearchMode:xt,setIsInputActive:ke,isInputActive:_e,inFlight:Zt,resultsLength:dt,quote:Me,isMentionMenuOpened:Qr,isCometHome:Q,reason:ue,placement:O});iDe({setInput:Xn}),SDe({entropyBrowser:Ct,focusInput:Ms,isSidecar:!0}),d.useEffect(()=>{Ae.current?.focus()},[Ae]),d.useEffect(()=>{Me&&Ms()},[Me,Ms]);const{openToast:cc}=hn(),dm=d.useMemo(()=>({onStart:()=>{Ms()},onStop:()=>{Ms()},onSilence:()=>{cc({message:"No audio detected. Make sure your microphone is connected and unmuted",variant:"error",timeout:4})}}),[Ms,cc]),{startTranscription:v0,stopTranscription:b0,error:Zr,isTranscribing:fs,isInitializing:Cu,transcription:gi}=hDe({callbacks:dm,config:Ihe,reason:ue});d.useEffect(()=>{Zr&&cc({message:`Audio Error: ${Zr}`,variant:"error",timeout:4})},[Zr,cc]);const yi=d.useRef("");d.useEffect(()=>{if(!fs){yi.current="";return}if(gi&&gi!==yi.current){const kn=gi.startsWith(yi.current)?gi.slice(yi.current.length):gi;if(kn){const ms=yi.current.length==0?` ${kn}`:kn;yi.current.length==0&&Ae.current?.trim(),Ae.current?.append(ms),Xn(Ae.current?.value??"",Ae.current?.json)}yi.current=gi}},[gi,fs,e,Xn,Ae]);const fm=!0,{organization:_0}=mo({reason:ue}),w0=d.useCallback(()=>ye(!0),[]),{handlePaste:mm,handlePasteQuery:f_,handleCompleteFileUpload:C0,handleFileSelect:Su,autoCreatedTextFile:xi,dismissNotification:S0,setAutoCreatedTextFile:m_}=G9e({fileUploadRef:Qt,fileHandlingRef:lr,showFileUpload:x,attachments:ds,setAttachments:lc,handleChange:Xn,setIsUploadingFile:ye,focusInput:Ms,onFileAttachComplete:re}),{fileInputRef:Eu,errorMessage:E0,warningMessage:k0,uploadSource:pm,uploadedFiles:Jt,handleRemoveFile:ku,handleStartUpload:M0,handleFileInput:uc,isBoxOpen:T0,onCloseBox:hm,cleanupBoxPicker:Y8,microsoftFilePickerOptions:Q8,isMicrosoftFilePickerOpen:X8,handleSelectSharepointSite:Z8,onCloseMicrosoft:J8,setErrorMessage:e7}=aDe({fileUploadRef:Qt,disablePrivacyWarning:S,isAudioVideoFilesEnabled:fm,isClearAttachmentsEnabled:X||lt,isFollowUp:u,organization:_0,lastResult:ht,onStartFileUpload:w0,onCompleteFileUpload:C0,setUploadsReady:pt,reason:ue,specialCapabilities:$e,askInputRef:ee,onRemoveFile:le}),t7=d.useCallback(()=>{if(xi){if(Ae.current?.append(xi.content),Xn(Ae.current?.value??"",Ae.current?.json),ds){const kn=ds.find(ms=>ms.includes(xi.fileName));kn&&ku(kn)}m_(null)}},[xi,Ae,Xn,ds,ku,m_]),n7=d.useRef(e);n7.current=e;const r7=d.useCallback(kn=>{ke(!0),n7.current.length===0&&xe[xt]&&Nt(xe[xt]),j?.(kn)},[ke,Nt,xe,xt,j]),s7=d.useCallback(kn=>{Ae.current=kn},[Ae]),ofe=d.useMemo(()=>({isOpen:Ue&&!I&&!fs,suggestedQueries:De,focusedIndex:it,setFocusedIndex:kt,handlePasteQuery:f_,handleSubmit:cr,userInputQuery:zn,placement:O,dropdownClassName:$,allowNonSequentialMatch:De!==xe[xt],scrollableShards:Jt.length>0?[Gt]:[]}),[xe,$,O,it,I,f_,cr,fs,xt,kt,Ue,De,Jt.length,zn]),afe=d.useMemo(()=>{const kn=Ue&&!I&&!fs;return{initialLayout:i,wrapperClass:z({"transition-none p-lg":Ue,"border-b-none rounded-b-none":kn&&O==="bottom","border-t-none rounded-t-none rounded-b-2xl":kn&&O==="top","bg-base":Me}),size:"large",hasShadow:_,isHighlighted:ae,isMobileUserAgent:ve,showStopButton:k,quote:Me??void 0,inputWarnings:xi&&l.jsxs(K,{variant:"subtler",className:"mx-sm mb-xs px-sm py-xs dark:bg-base flex items-center justify-between rounded-lg",children:[l.jsx("div",{className:"gap-x-sm flex items-center",children:l.jsxs(V,{variant:"tiny",color:"light",children:["Text is"," ",Math.max(1,Math.round((xi.content.length-Ec)/Ec*100)),"% over the limit and is attached as a file."," ",l.jsx(st,{variant:"super",size:"tiny",onClick:t7,text:"Paste as text"})]})}),l.jsx(st,{icon:B("x"),size:"tiny",onClick:S0,variant:"common",pill:!0,noPadding:!0})]}),attachmentsList:Jt.length>0&&ce&&l.jsx(zK,{uploadedFiles:Jt,onRemoveFile:ku,ref:Gt}),setQuote:Ve,inputRef:Ae}},[xi,S0,O,I,ku,_,i,Ae,fs,t7,Me,Ve,k,Ue,Jt,ae,ce,ve]),ife=d.useMemo(()=>({ref:s7,id:"ask-input",value:e,json:t,initialLayout:i,minRows:c,placeholder:fs?Ot.formatMessage({defaultMessage:"Listening…",id:"GdiyKL+89A"}):r,placeholderClassName:s,disableInput:a,autoFocus:w,onClick:r7,onChange:Xn,onKeyDown:Wr,onBlur:En,onFocus:Wn,onPaste:mm,onMentionMenuOpen:bn,onMentionMenuClose:nr,isMobileStyle:pe,isMobileUserAgent:ve,useLexical:G,mentionTypeaheadOptions:G?H:void 0,onTriggerTypeahead:G?te:void 0}),[w,a,En,Xn,r7,Wn,Wr,mm,i,pe,ve,t,H,c,nr,bn,te,r,s,s7,G,e,fs,Ot]),lfe=d.useMemo(()=>l.jsx(GQ,{value:e,json:t,showSources:m,useThreadSources:p,showRecency:h,submitWillFork:f,isFollowUp:u,isDisabled:ct||!We,querySource:n,errorMessage:fe,handleSubmit:Fe,fileUploadRef:Qt,showFileUpload:x,showModelSelector:g,disableActionButtons:v,fileUploadTooltip:C,disablePrivacyWarning:S,showStopButton:k,onStopButtonClick:R,onFilePickerOpen:P,onFilePickerClose:L,startTranscription:v0,stopTranscription:b0,isTranscribing:fs,isTranscriptionInitializing:Cu,isTranscriptionAvailable:!0,transcriptionError:Zr,fileUploadErrorMessage:E0,fileUploadWarningMessage:k0,activeConnector:pm,uploadedFiles:Jt,handleStartUpload:M0,handleFileInput:uc,isBoxFilePickerOpen:T0,handleCloseBoxFilePicker:hm,cleanupBoxFilePicker:Y8,microsoftFilePickerOptions:Q8,handleCloseMicrosoftFilePicker:J8,handleSelectSharepointSite:Z8,isMicrosoftFilePickerOpen:X8,fileInputRef:Eu,hasQuery:wu,isAudioVideoFilesEnabled:fm,setAttachmentErrorMessage:e7,isCometHome:Q,isMissionControl:X}),[pm,Y8,v,S,fe,Eu,E0,C,k0,hm,uc,Z8,M0,Fe,wu,fm,T0,ct,u,Cu,X8,fs,t,Q8,J8,L,P,R,n,e7,x,g,h,m,p,k,v0,b0,f,Jt,We,e,Q,X,Zr]),{isMax:cfe}=$t(),ufe=d.useMemo(()=>l.jsx(YY,{showIncognitoHint:b,showSearchModeSelector:y,isFollowUp:u,layoutKey:se,showFileUpload:x,handleFileInput:uc,onFilePickerOpen:P}),[uc,u,se,P,x,b,y]),o7=l.jsx(tX,{value:e,suggestDropdownProps:ofe,ResizeableInputWrapperProps:afe,ResizeableInputProps:ife,syncUncontrolledOnce:Y,leftAttributionComponents:ufe,rightAttributionComponents:lfe}),dfe=l.jsxs(K,{variant:"subtler",className:z(E,"relative rounded-2xl",{"max-super-override":cfe}),children:[T,l.jsx("div",{className:fs?"-m-px":"",children:fs?l.jsx(oX,{borderRadius:17,borderGradientStops:"transparent 135deg, oklch(var(--super-color)) 180deg, transparent 225deg",children:o7}):o7})]});return l.jsx(aX,{condition:Je&&x,Wrapper:iX,onDrop:Su,disabled:gt,allowDropAnywhere:!0,children:dfe})},lX=A.memo(kDe);lX.displayName="AskInput";const cX=ie.PRO,MDe=e=>({id:e.task_id,title:e.task_name,prompt:e.prompt,searchModel:v1e(e.model_preference)??cX,sources:Fx(e.sources),preconfigured:e.preconfigured});function Rbt(e=""){return{title:"",prompt:e,searchModel:cX,sources:["web"],preconfigured:!1}}function TDe({reason:e,enabled:t=!0}){const{$t:n}=J(),[r,s]=d.useState(!1),{openModal:o}=pn().legacy,a=Wt(),i=t,c=bg(),{overwriteSources:u}=og({reason:e}),{data:f,isStale:m,refetch:p}=rX({reason:e,enabled:i&&r,staleTime:600*1e3}),h=d.useCallback(()=>{r?m&&p():s(!0)},[r,m,p]),g=d.useCallback(()=>{o("taskShortcutModal",{source:"typeahead_create"})},[o]),y=d.useCallback((v,b)=>{let _=oe.SEARCH;v===ie.ALPHA?_=oe.RESEARCH:v===ie.BETA&&(_=oe.STUDIO),c(v,_),u(b)},[c,u]),x=d.useMemo(()=>{const b=(f??[]).map(_=>({uuid:_.task_id,variant:"shortcut",label:`/${_.task_name}`,queryText:_.prompt,className:"group/shortcut-typeahead-option",action:()=>y(_.model_preference,_.sources),convertToNode:!0,rightElement:({focused:w})=>l.jsx(ADe,{shortcut:_,focused:w})}));return i&&a&&b.push({uuid:"create-a-shortcut",variant:"shortcut",label:n({defaultMessage:"+ Create a shortcut",id:"P9a8R5IRCb"}),action:g,convertToNode:!1,isAlwaysVisible:!0}),b},[f,i,a,y,n,g]);return d.useMemo(()=>({isShortcutTasksEnabled:i,shortcutsTypeaheadOptions:x,onTrigger:h}),[i,x,h])}function ADe({shortcut:e,focused:t}){const{openModal:n}=pn().legacy,r=d.useCallback(s=>{s.preventDefault(),s.stopPropagation(),n("taskShortcutModal",{source:"typeahead_edit",shortcut:MDe(e)})},[n,e]);return l.jsx("div",{className:z("h-5 transition-opacity",t&&"opacity-100",!t&&"opacity-0"),children:l.jsx(st,{icon:B("edit"),size:"tiny",variant:"common",noPadding:!0,onMouseDown:r})})}const NDe=(e,t)=>{const[n,r]=d.useState(e),s=px(r,t);return d.useEffect(()=>{s(e)},[e,s]),n},RDe=5e3,DDe=3e3,jDe=(e,t=!0)=>{const n=t&&An()&&!!Us()?.is_personal_search_enabled,{sidecarSourceTab:{url:r}}=Qn(),s=NDe(r,DDe),o=d.useMemo(()=>["get_tabs_for_sidecar",s],[s]),{data:a=Pe}=mt({queryKey:o,queryFn:async()=>(await e.fetchOpenedTabs()).map(c=>{const u=Kp(c.url);return{uuid:String(c.tabId),variant:"tab",label:c.title,url:c.url,icon:u?{type:"image",url:u}:void 0}}),staleTime:RDe,enabled:n});return d.useMemo(()=>({tabs:a,tabAttachmentsEnabled:n}),[n,a])},IDe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/spaces/mentions",e,{timeoutMs:Qe()});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to list at mention spaces",cause:n,status:r.status??0});return t},Dbt=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/collections/list_space_templates",e,{timeoutMs:Qe(),numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to list space templates",cause:n,status:r.status??0});return t},PDe=async({limit:e=50,offset:t=0,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/spaces/writable",n,{params:{query:{limit:e,offset:t}},timeoutMs:Qe()});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to list writable spaces",cause:s,status:o.status??0});return r};function ODe({reason:e,isLazy:t=!0,enabled:n=!0}){const[r,s]=d.useState(()=>!t),{data:o,isStale:a,refetch:i}=mt({queryKey:Xm(),queryFn:()=>IDe({reason:e}),enabled:n&&r,staleTime:600*1e3}),c=d.useCallback(()=>{r?a&&i():s(!0)},[r,a,i]),u=d.useMemo(()=>(o?.spaces??[]).map(m=>({uuid:m.uuid,variant:"space",label:m.title,icon:LDe(m)})),[o]);return d.useMemo(()=>({isAtMentionSpacesEnabled:n,mentionSpacesOptions:u,onTrigger:c}),[n,u,c])}function LDe(e){if(e.emoji){const t=Q4(e.emoji);if(t)return{type:"emoji",char:t}}return{type:"icon",icon:Kh}}const FDe=({reason:e})=>{const{isAllowed:t,isConnected:n}=sg({reason:e}),{sources:r,isSourceAllowed:s}=X4({isConnectorAllowed:t??(()=>!1)}),o=d.useMemo(()=>r.filter(a=>Jh(a)||Wi(a)||Ja(a)?!0:mW(a)?!1:uu(a)?n(a):!1),[r,n]);return d.useMemo(()=>({sources:o,isSourceAllowed:s}),[o,s])},BDe=W({defaultMessage:"Monthly query limit reached",id:"ooSshLDNri"});function UDe({isLazy:e=!0,enabled:t=!0,onMentionSource:n}){const{$t:r}=J(),[s,o]=d.useState(()=>!e),{getSourceLabel:a}=nc(),{cometMcpSources:i}=Nf(),{getSourceLimited:c}=K4(),{sources:u}=FDe({reason:"use-at-mention-sources"}),{trackSourceActivity:f}=IA(),{suggested:m=[],refresh:p}=IQ({sources:u}),h=d.useCallback(b=>{n?.(b),f(b)},[n,f]),g=d.useCallback(b=>{const _=c(b);return{uuid:b,variant:"source",label:a(b),icon:uX(b),action:()=>h(b),disabled:_,subtitle:_?r(BDe):void 0,convertToNode:!0}},[a,h,c,r]),y=d.useCallback(b=>({uuid:b,variant:"source",label:a(b),icon:VDe({sourceType:b,cometMcpSources:i}),action:()=>h(b),convertToNode:!0}),[a,i,h]),x=d.useMemo(()=>{const b=new Set([...m,...u]);return Array.from(b).map(_=>Jh(_)?g(_):y(_))},[g,y,m,u]),v=d.useCallback(()=>{s||o(!0),p()},[s,p]);return d.useMemo(()=>({isAtMentionSourcesEnabled:t,mentionSourcesOptions:x,onTrigger:v}),[t,x,v])}function VDe({sourceType:e,cometMcpSources:t}){if(Wi(e))return HDe(e);if(uu(e))return uX(e);if(Ja(e)){const n=Df(e),r=t[n];return r?zDe(r):void 0}}function HDe(e){return{type:"icon",icon:Yx[e].icon}}function uX(e){const t=If(e);if(t)return{type:"image",url:t}}function zDe(e){if(e.iconUrl)return{type:"image",url:e.iconUrl}}function WDe(e){return ha(e)||Ja(e)}const GDe=({reason:e,isLazy:t=!0,variants:n,collectionName:r})=>{const[s,o]=d.useState(""),a=un(),i=n===void 0||n.includes("tab"),c=n===void 0||n.includes("space"),u=n===void 0||n.includes("shortcut"),f=n===void 0||n.includes("sources"),{tabs:m,tabAttachmentsEnabled:p}=jDe(a,i),{isAtMentionSpacesEnabled:h,mentionSpacesOptions:g,onTrigger:y}=ODe({reason:e,isLazy:t,enabled:c}),{isShortcutTasksEnabled:x,shortcutsTypeaheadOptions:v,onTrigger:b}=TDe({reason:e,enabled:u}),{addSource:_,removeSource:w}=pW({useThreadSources:!1,reason:e}),S=rW(),C=d.useRef([]);d.useEffect(()=>{const F=MCe(S?.root);C.current.filter(L=>!F.includes(L)).filter(WDe).forEach(L=>{w(L)}),C.current=F},[S,w]);const E=d.useCallback(F=>_(F),[_]),{isAtMentionSourcesEnabled:T,mentionSourcesOptions:k,onTrigger:I}=UDe({isLazy:t,enabled:f,onMentionSource:E}),M=p||h||x||T,N=d.useMemo(()=>[...p&&s==="@"?m:[],...h&&s==="@"?g:[],...T&&s==="@"?k:[],...x&&s==="/"?v:[]],[p,s,m,h,g,x,v,T,k]),D=d.useCallback(F=>{o(F),F==="@"?(y(),I()):F==="/"&&b()},[b,y,I]),j=$De({isAtMentionSourcesEnabled:T,isShortcutTasksEnabled:x,isAtMentionCometTabsEnabled:p,collectionName:r});return d.useMemo(()=>({useLexical:M,mentionTypeaheadOptions:N,inputPlaceholder:j,onTriggerTypeahead:D}),[M,N,j,D])},$De=({isAtMentionSourcesEnabled:e,isShortcutTasksEnabled:t,isAtMentionCometTabsEnabled:n,collectionName:r})=>{const{$t:s}=J();return d.useMemo(()=>{try{if(typeof document>"u")return""}catch{return}const o=n||e,a=t;return r?o&&a?s({defaultMessage:"Ask anything about { collectionName }. Type @ for mentions and / for shortcuts.",id:"vpxXL78kip"},{collectionName:r}):o?s({defaultMessage:"Ask anything about { collectionName }. Type @ for mentions.",id:"QodmMNOAIa"},{collectionName:r}):a?s({defaultMessage:"Ask anything about { collectionName }. Type / for shortcuts.",id:"1uFeAjMFYC"},{collectionName:r}):s({defaultMessage:"Ask anything about { collectionName }.",id:"3ZcezoTfiM"},{collectionName:r}):s(o&&a?{defaultMessage:"Ask anything. Type @ for mentions and / for shortcuts.",id:"KO0XLRzele"}:o?{defaultMessage:"Ask anything. Type @ for mentions.",id:"iju9VLCg7F"}:a?{defaultMessage:"Ask anything. Type / for shortcuts.",id:"h47ZleZwvf"}:Nr[oe.SEARCH].askInputPlaceholder)},[s,n,e,t,r])},dX="comet.sidecar-input-state";function qDe(){try{const e=_a.getItem(dX);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function Bj(e){_a.setItem(dX,JSON.stringify(e))}function KDe({cometState:e,onSubmit:t}){const{tabId:n,secondaryTab:r}=e.sidecarSourceTab,s=fn(),o=d.useMemo(()=>ro(n,r?.tabId),[n,r?.tabId]),a=d.useRef(qDe()),[i,c]=d.useState(a.current[o]?.rawQuery??""),[u,f]=d.useState(a.current[o]?.rawQueryJson??void 0);d.useEffect(()=>{const g=a.current[o]??{},y=g.rawQuery??"",x=g.rawQueryJson??void 0;c(v=>v===y?v:y),f(v=>v===x?v:x)},[o]);const m=d.useCallback((g,y)=>{const x=a.current[o]??{};c(g),f(y);const v={...x,rawQuery:g,rawQueryJson:y??null},b={...a.current,[o]:v};a.current=b,Bj(b)},[o]),p=d.useCallback(()=>{const g={...a.current};delete g[o],a.current=g,Bj(g),c(""),f(void 0)},[o]),h=d.useCallback(g=>{const y=s.get("source"),x=vM(y)?y:"user";p(),t?.({...g,promptSource:g.promptSource||x})},[p,t,s]);return d.useMemo(()=>({persistedValue:i,persistedJson:u,persist:m,onSubmit:h}),[u,m,i,h])}const YDe=({url:e,title:t,secondaryUrl:n,secondaryTitle:r,userSelection:s})=>l.jsxs(K,{className:"p-sm ml-one gap-sm relative flex flex-1 flex-col",children:[l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsxs("div",{className:"gap-sm flex flex-1 items-center",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Po,{size:20,domain:$c(e),hideBorder:!0,className:"rounded-md border-none bg-none",overrideIconUrl:Kp(e)})}),t&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:t})]}),n&&l.jsxs("div",{className:"gap-sm flex flex-1 items-center",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Po,{size:20,domain:$c(n),hideBorder:!0,className:"rounded-md border-none bg-none",overrideIconUrl:Kp(n)})}),r&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:r})]})]}),l.jsx(St,{children:s?.text&&l.jsx(Te.div,{className:"ml-[28px]",initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.2,ease:"easeOut"},children:l.jsxs(V,{variant:"tiny",color:"light",className:"line-clamp-2 italic",children:['"',s.text,'"']})})})]}),VA=A.memo(e=>{const{value:t,json:n,onChange:r,onSubmit:s,...o}=e,a="sidecar-ask-input",i=un(),{hasAccessToProFeatures:c}=$t(),{specialCapabilities:u}=Yr(),f=c||u.unlimitedProSearch?ie.PRO:ie.DEFAULT,m=Qn(),{persistedValue:p,persistedJson:h,persist:g,onSubmit:y}=KDe({cometState:m,onSubmit:s}),x=d.useCallback(k=>{y({...k,modelPreferenceOverride:f})},[y,f]),{mentionTypeaheadOptions:v,onTriggerTypeahead:b}=GDe({reason:a,isLazy:!0});d.useEffect(()=>i.subscribeToCometQuery((k,{source:I})=>{y({query:k,forceFork:!0,promptSource:vM(I)?I:"user"})}),[i,y]);const _=un();d.useEffect(()=>{function k(I){I.key==="Escape"&&_.deactivateScreenshotTool()}return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}},[_]);const{sidecarSourceTab:{url:w,title:S,secondaryTab:C}}=m,E=m.actions.getUserSelection(),T=d.useCallback((k,I)=>{g(k,I),r(k,I)},[g,r]);return l.jsx("div",{className:"bg-base rounded-2xl",children:l.jsx(lX,{value:p,json:h,onChange:T,onSubmit:x,headerComponent:w?l.jsx(YDe,{url:w,title:S,userSelection:E,secondaryUrl:C?.url,secondaryTitle:C?.title}):void 0,forceHideSuggestions:!!E,autofocus:!0,showModelSelector:!1,showFileUpload:!0,hasShadow:!0,showIncognitoHint:!0,showSources:!1,dropdownPlacement:"top",useLexical:!0,syncUncontrolledOnce:!0,mentionTypeaheadOptions:v,onTriggerTypeahead:b,initialLayout:"expanded",minRows:1,className:"shadow-[0_36px_16px_36px_oklch(var(--background-base-color))] dark:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_32px_16px_36px_oklch(var(--dark-background-base-color))]",...o})})});VA.displayName="SidecarAskInput";const QDe="chrome://settings/assistant",fX=A.memo(({onLearnMore:e})=>{const{$t:t}=J();return l.jsx(V,{color:"light",variant:"tinyRegular",className:"text-balance text-center",children:t({defaultMessage:"Comet Assistant uses the current page and relevant browser history to provide answers to your questions. Learn more",id:"+FQWtBvxT2"},{link:n=>l.jsx(V,{as:"button",color:"light",variant:"tinyRegular",onClick:e,className:"hover:text-super cursor-pointer underline",inline:!0,children:n})})})});fX.displayName="PrivacyEducationText";const mX=A.memo(({isVisible:e=!0,showPrivacyEducation:t=!1})=>{const{$t:n}=J(),r=un(!1),s=()=>{r?.openNewTab(QDe)};return l.jsxs("div",{className:"gap-md px-lg pb-xl fixed inset-0 z-10 flex flex-col items-center justify-center",children:[l.jsx(ge,{icon:epe,size:64,className:z("text-quietest opacity-0 transition-opacity",{"!opacity-100":e})}),l.jsxs("div",{className:"gap-2xs flex flex-col items-center",children:[l.jsx(V,{variant:"section-title",color:"light",children:n({defaultMessage:"Assistant",id:"CxJqEDZI3a",description:"Assistant"})}),t&&l.jsx(fX,{onLearnMore:s})]})]})});mX.displayName="SidecarBackground";const pX="pplx.sidecar_privacy_education_hidden_after_query",hX=A.memo(()=>{const[e,t,n]=NCe({csrRedirect:!0}),[,r]=Qi(pX,!1),s=d.useCallback(o=>{r(!0),n.onSubmit(o)},[n,r]);return l.jsx("div",{className:"relative",children:l.jsx(VA,{...n,onSubmit:s,value:e,json:t,querySource:"home"})})});hX.displayName="HomeSidecarAskInput";const HA=A.memo(function(){const{variation:t}=RCe(!1),[n]=Qi(pX,!1),r=t&&!n;return l.jsx(Of,{disableNewThread:!0,disableOpenInTab:!0,children:l.jsxs("div",{className:"px-md isolate mx-auto size-full min-w-[420px] sm:max-w-screen-md",children:[l.jsx(mX,{showPrivacyEducation:r}),l.jsx("div",{className:"relative flex h-full flex-col",children:l.jsx(Wc,{children:l.jsx(K,{className:"mt-md pointer-events-none static z-10 w-full grow flex-col items-center justify-center",children:l.jsx("div",{className:"bottom-md pointer-events-auto absolute w-full",children:l.jsx(hX,{})})})})})]})})});HA.displayName="SidecarHomePage";const mi=()=>{const[e,t]=A.useState(!1);return A.useEffect(()=>{t(!0)},[]),e},XDe=()=>{const e=d.useRef(!1),{results:t,lastResult:n}=on(),r=mi(),s=Wt(),{openVisitorLoginUpsell:o}=du({enabled:!s}),a=kl({upsellInformation:n?.upsell_information});d.useEffect(()=>{e.current||r&&t.length>=1&&n&&n.upsell_information?.app_location===Ns.MODAL&&(a(),e.current=!0)},[r,s,o,t.length,n,a])},ZDe=()=>{const e=Wt(),{isMobileUserAgent:t}=Re(),{firstResult:n}=on(),r=n?.author_username,{openInstallUpsell:s}=SW(),[o,a]=Wd("shareGateImpressions",0),i=d.useRef(!1),c=fn(),u=c?.get("installGate"),f=c?.get("q");d.useEffect(()=>{i.current||e||t&&(!r&&!f||By()||TU()||AU()||u==="true"&&(o>=pV||(s({origin:ft.SHARED_THREAD_INSTALL_GATE,sheetModalVariant:"inset-centered-sheet"}),a(o+1),i.current=!0)))},[a,r,t,f,u,e,s,o])},JDe=()=>{const{device:{isMetaBrowser:e,isIOS:t,isAndroid:n}}=sn();return d.useCallback(()=>{if(!e||typeof window>"u")return;const s=window.location.href;let o;t?o=s.replace(/^https?:\/\//,"x-safari-https://"):n&&(o=`intent://${s.replace(/^https?:\/\//,"")}#Intent;scheme=https;package=com.android.chrome;end`),o&&No(o,"Redirecting to native browser")},[e,t,n])};function zA(e){return e===document.documentElement}function fE(e){return zA(e)?window.scrollY:e.scrollTop}function gX(e){return zA(e)?window.innerHeight:e.clientHeight}function yX(e){return e.scrollHeight}function Uj(e,t,n="smooth"){zA(e)?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})}function mE(e){const t=yX(e),n=gX(e),r=fE(e);return Math.abs(t-n-r)<=1}const eje=(e,t)=>e?"full-sheet-blurred":t==="delayed"?"bottom-sheet-gradient":"centered-sheet",tje=()=>{const{$t:e}=J(),t=Wt(),{isMobileUserAgent:n}=Re(),{firstResult:r}=on(),s=r?.author_username,{openVisitorLoginUpsell:o}=du({enabled:!0}),[a,i]=Wd("shareGateImpressions",0),c=d.useRef(!1),u=fn(),{scrollContainerRef:f}=ka(),[m,p]=d.useState(!1),h=JDe(),g=u?.get("visitorGate"),y=u?.get("q");d.useEffect(()=>{const x=f.current;if(x)return x.addEventListener("scroll",()=>{p(mE(x))}),()=>{x.removeEventListener("scroll",()=>{p(mE(x))})}},[f]),d.useEffect(()=>{c.current||t||!s&&!y||TU()||AU()||a>=pV||g==="false"||g==="delayed"&&!m||!g&&!(!n&&!y)||(h(),o({origin:ft.SHARED_THREAD_LOGIN_GATE,description:"",title:e({defaultMessage:"Instant answers at your fingertips",id:"NFjQpck2Ql"}),sheetModalVariant:eje(n,g),overrideMobileVariant:!0}),i(a+1),c.current=!0)},[n,t,o,e,a,i,m,g,u,s,h,y])};var Tv="Tabs",[nje]=Vs(Tv,[Jl]),xX=Jl(),[rje,WA]=nje(Tv),vX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:i,activationMode:c="automatic",...u}=e,f=Pf(i),[m,p]=fo({prop:r,onChange:s,defaultProp:o??"",caller:Tv});return l.jsx(rje,{scope:n,baseId:ls(),value:m,onValueChange:p,orientation:a,dir:f,activationMode:c,children:l.jsx(Et.div,{dir:f,"data-orientation":a,...u,ref:t})})});vX.displayName=Tv;var bX="TabsList",_X=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=WA(bX,n),a=xX(n);return l.jsx(Zx,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Et.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});_X.displayName=bX;var wX="TabsTrigger",CX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=WA(wX,n),i=xX(n),c=kX(a.baseId,r),u=MX(a.baseId,r),f=r===a.value;return l.jsx(Jx,{asChild:!0,...i,focusable:!s,active:f,children:l.jsx(Et.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:rt(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:rt(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:rt(e.onFocus,()=>{const m=a.activationMode!=="manual";!f&&!s&&m&&a.onValueChange(r)})})})});CX.displayName=wX;var SX="TabsContent",EX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,i=WA(SX,n),c=kX(i.baseId,r),u=MX(i.baseId,r),f=r===i.value,m=d.useRef(f);return d.useEffect(()=>{const p=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(Hr,{present:s||f,children:({present:p})=>l.jsx(Et.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:p&&o})})});EX.displayName=SX;function kX(e,t){return`${e}-trigger-${t}`}function MX(e,t){return`${e}-content-${t}`}var sje=vX,oje=_X,aje=CX,ije=EX;const GA=d.createContext({fullWidth:!1,size:"default",currentValue:void 0,registerTabRef:()=>{},unregisterTabRef:()=>{},updateIndicatorRef:{current:()=>{}}});function Av(){return d.useContext(GA)}const lje=d.memo(function({listRef:t}){const n=Av(),r=d.useRef(null),s=d.useRef(null),[o,a]=d.useState(!1),[i,c]=d.useState({leftPx:0,widthPx:0,opacity:0}),u=d.useCallback(()=>{const f=t.current;if(!f)return;const m=f.querySelector('[data-state="active"]');if(!m)return;const p=f.getBoundingClientRect(),h=m.getBoundingClientRect(),g=h.left-p.left,y=h.width;return c({leftPx:g,widthPx:y,opacity:1}),o||requestAnimationFrame(()=>{a(!0)}),m!==r.current&&s.current&&(r.current&&s.current.unobserve(r.current),s.current.observe(m),r.current=m),m},[t,o]);return d.useEffect(()=>{n.updateIndicatorRef.current=u},[n,u]),d.useEffect(()=>{s.current=new ResizeObserver(()=>{requestAnimationFrame(()=>{u()})});const f=u();return f&&(s.current.observe(f),r.current=f),()=>{s.current?.disconnect(),s.current=null,r.current=null}},[u,t]),l.jsx("span",{className:z("absolute bottom-0 h-two bg-inverse pointer-events-none",{"transition-[transform,width,opacity] duration-300 ease-in-out":o}),style:{transform:`translateX(${i.leftPx}px)`,width:`${i.widthPx}px`,opacity:i.opacity},"aria-hidden":"true"})}),cje=ci("flex flex-row",{variants:{showBottomBorder:{false:"",true:"border-b border-subtler"},fullWidth:{false:"",true:"gap-0"},size:{default:"h-[54px]",compact:"h-[44px]"}},compoundVariants:[{fullWidth:!1,size:"default",class:"gap-5"},{fullWidth:!1,size:"compact",class:"gap-4"}],defaultVariants:{showBottomBorder:!1,fullWidth:!1,size:"default"}});function uje({children:e,"aria-label":t,showBottomBorder:n=!1,fullWidth:r=!1,size:s="default",...o}){const a=wa(o),i=Av(),c=d.useRef(null),u=d.useMemo(()=>({...i,fullWidth:r,size:s}),[i,r,s]);return l.jsx(GA.Provider,{value:u,children:l.jsxs(oje,{ref:c,"aria-label":t,className:z(cje({showBottomBorder:n,fullWidth:r,size:s}),"relative"),...a,children:[e,l.jsx(lje,{listRef:c})]})})}var $A=Eg(),jt=e=>Sg(e,$A),qA=Eg();jt.write=e=>Sg(e,qA);var Nv=Eg();jt.onStart=e=>Sg(e,Nv);var KA=Eg();jt.onFrame=e=>Sg(e,KA);var YA=Eg();jt.onFinish=e=>Sg(e,YA);var kd=[];jt.setTimeout=(e,t)=>{const n=jt.now()+t,r=()=>{const o=kd.findIndex(a=>a.cancel==r);~o&&kd.splice(o,1),Cl-=~o?1:0},s={time:n,handler:e,cancel:r};return kd.splice(TX(n),0,s),Cl+=1,AX(),s};var TX=e=>~(~kd.findIndex(t=>t.time>e)||~kd.length);jt.cancel=e=>{Nv.delete(e),KA.delete(e),YA.delete(e),$A.delete(e),qA.delete(e)};jt.sync=e=>{pE=!0,jt.batchedUpdates(e),pE=!1};jt.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...s){t=s,jt.onStart(n)}return r.handler=e,r.cancel=()=>{Nv.delete(n),t=null},r};var QA=typeof window<"u"?window.requestAnimationFrame:(()=>{});jt.use=e=>QA=e;jt.now=typeof performance<"u"?()=>performance.now():Date.now;jt.batchedUpdates=e=>e();jt.catch=console.error;jt.frameLoop="always";jt.advance=()=>{jt.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):RX()};var wl=-1,Cl=0,pE=!1;function Sg(e,t){pE?(t.delete(e),e(0)):(t.add(e),AX())}function AX(){wl<0&&(wl=0,jt.frameLoop!=="demand"&&QA(NX))}function dje(){wl=-1}function NX(){~wl&&(QA(NX),jt.batchedUpdates(RX))}function RX(){const e=wl;wl=jt.now();const t=TX(wl);if(t&&(DX(kd.splice(0,t),n=>n.handler()),Cl-=t),!Cl){dje();return}Nv.flush(),$A.flush(e?Math.min(64,wl-e):16.667),KA.flush(),qA.flush(),YA.flush()}function Eg(){let e=new Set,t=e;return{add(n){Cl+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Cl-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Cl-=t.size,DX(t,r=>r(n)&&e.add(r)),Cl+=e.size,t=e)}}}function DX(e,t){e.forEach(n=>{try{t(n)}catch(r){jt.catch(r)}})}var fje=Object.defineProperty,mje=(e,t)=>{for(var n in t)fje(e,n,{get:t[n],enumerable:!0})},xa={};mje(xa,{assign:()=>hje,colors:()=>Al,createStringInterpolator:()=>ZA,skipAnimation:()=>IX,to:()=>jX,willAdvance:()=>JA});function hE(){}var pje=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ie={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Ei(e,t){if(Ie.arr(e)){if(!Ie.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function ni(e,t,n){if(Ie.arr(e)){for(let r=0;rIe.und(e)?[]:Ie.arr(e)?e:[e];function Tp(e,t){if(e.size){const n=Array.from(e);e.clear(),Mt(n,t)}}var np=(e,...t)=>Tp(e,n=>n(...t)),XA=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ZA,jX,Al=null,IX=!1,JA=hE,hje=e=>{e.to&&(jX=e.to),e.now&&(jt.now=e.now),e.colors!==void 0&&(Al=e.colors),e.skipAnimation!=null&&(IX=e.skipAnimation),e.createStringInterpolator&&(ZA=e.createStringInterpolator),e.requestAnimationFrame&&jt.use(e.requestAnimationFrame),e.batchedUpdates&&(jt.batchedUpdates=e.batchedUpdates),e.willAdvance&&(JA=e.willAdvance),e.frameLoop&&(jt.frameLoop=e.frameLoop)},Ap=new Set,Co=[],cw=[],b2=0,Rv={get idle(){return!Ap.size&&!Co.length},start(e){b2>e.priority?(Ap.add(e),jt.onStart(gje)):(PX(e),jt(gE))},advance:gE,sort(e){if(b2)jt.onFrame(()=>Rv.sort(e));else{const t=Co.indexOf(e);~t&&(Co.splice(t,1),OX(e))}},clear(){Co=[],Ap.clear()}};function gje(){Ap.forEach(PX),Ap.clear(),jt(gE)}function PX(e){Co.includes(e)||OX(e)}function OX(e){Co.splice(yje(Co,t=>t.priority>e.priority),0,e)}function gE(e){const t=cw;for(let n=0;n0}function yje(e,t){const n=e.findIndex(t);return n<0?e.length:n}var xje={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},la="[-+]?\\d*\\.?\\d+",_2=la+"%";function Dv(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var vje=new RegExp("rgb"+Dv(la,la,la)),bje=new RegExp("rgba"+Dv(la,la,la,la)),_je=new RegExp("hsl"+Dv(la,_2,_2)),wje=new RegExp("hsla"+Dv(la,_2,_2,la)),Cje=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Sje=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Eje=/^#([0-9a-fA-F]{6})$/,kje=/^#([0-9a-fA-F]{8})$/;function Mje(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Eje.exec(e))?parseInt(t[1]+"ff",16)>>>0:Al&&Al[e]!==void 0?Al[e]:(t=vje.exec(e))?(Lu(t[1])<<24|Lu(t[2])<<16|Lu(t[3])<<8|255)>>>0:(t=bje.exec(e))?(Lu(t[1])<<24|Lu(t[2])<<16|Lu(t[3])<<8|zj(t[4]))>>>0:(t=Cje.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=kje.exec(e))?parseInt(t[1],16)>>>0:(t=Sje.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=_je.exec(e))?(Vj(Hj(t[1]),q0(t[2]),q0(t[3]))|255)>>>0:(t=wje.exec(e))?(Vj(Hj(t[1]),q0(t[2]),q0(t[3]))|zj(t[4]))>>>0:null}function uw(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Vj(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r,o=uw(s,r,e+1/3),a=uw(s,r,e),i=uw(s,r,e-1/3);return Math.round(o*255)<<24|Math.round(a*255)<<16|Math.round(i*255)<<8}function Lu(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Hj(e){return(parseFloat(e)%360+360)%360/360}function zj(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function q0(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Wj(e){let t=Mje(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,s=(t&65280)>>>8,o=(t&255)/255;return`rgba(${n}, ${r}, ${s}, ${o})`}var gh=(e,t,n)=>{if(Ie.fun(e))return e;if(Ie.arr(e))return gh({range:e,output:t,extrapolate:n});if(Ie.str(e.output[0]))return ZA(e);const r=e,s=r.output,o=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",i=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const f=Aje(u,o);return Tje(u,o[f],o[f+1],s[f],s[f+1],c,a,i,r.map)}};function Tje(e,t,n,r,s,o,a,i,c){let u=c?c(e):e;if(un){if(i==="identity")return u;i==="clamp"&&(u=n)}return r===s?r:t===n?e<=t?r:s:(t===-1/0?u=-u:n===1/0?u=u-t:u=(u-t)/(n-t),u=o(u),r===-1/0?u=-u:s===1/0?u=u+r:u=u*(s-r)+r,u)}function Aje(e,t){for(var n=1;n=e);++n);return n-1}var Nje={linear:e=>e},yh=Symbol.for("FluidValue.get"),Zd=Symbol.for("FluidValue.observers"),_o=e=>!!(e&&e[yh]),Ds=e=>e&&e[yh]?e[yh]():e,Gj=e=>e[Zd]||null;function Rje(e,t){e.eventObserved?e.eventObserved(t):e(t)}function xh(e,t){const n=e[Zd];n&&n.forEach(r=>{Rje(r,t)})}var LX=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Dje(this,e)}},Dje=(e,t)=>FX(e,yh,t);function qf(e,t){if(e[yh]){let n=e[Zd];n||FX(e,Zd,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function vh(e,t){const n=e[Zd];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Zd]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var FX=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),py=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,jje=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,$j=new RegExp(`(${py.source})(%|[a-z]+)`,"i"),Ije=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,jv=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,BX=e=>{const[t,n]=Pje(e);if(!t||XA())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const s=window.getComputedStyle(document.documentElement).getPropertyValue(n);return s||e}else{if(n&&jv.test(n))return BX(n);if(n)return n}return e},Pje=e=>{const t=jv.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},dw,Oje=(e,t,n,r,s)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,UX=e=>{dw||(dw=Al?new RegExp(`(${Object.keys(Al).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(o=>Ds(o).replace(jv,BX).replace(jje,Wj).replace(dw,Wj)),n=t.map(o=>o.match(py).map(Number)),s=n[0].map((o,a)=>n.map(i=>{if(!(a in i))throw Error('The arity of each "output" value must be equal');return i[a]})).map(o=>gh({...e,output:o}));return o=>{const a=!$j.test(t[0])&&t.find(c=>$j.test(c))?.replace(py,"");let i=0;return t[0].replace(py,()=>`${s[i++](o)}${a||""}`).replace(Ije,Oje)}},e6="react-spring: ",VX=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${e6}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},Lje=VX(console.warn);function Fje(){Lje(`${e6}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Bje=VX(console.warn);function Uje(){Bje(`${e6}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Iv(e){return Ie.str(e)&&(e[0]=="#"||/\d/.test(e)||!XA()&&jv.test(e)||e in(Al||{}))}var Ac=XA()?d.useEffect:d.useLayoutEffect,Vje=()=>{const e=d.useRef(!1);return Ac(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function t6(){const e=d.useState()[1],t=Vje();return()=>{t.current&&e(Math.random())}}var n6=e=>d.useEffect(e,Hje),Hje=[];function yE(e){const t=d.useRef(void 0);return d.useEffect(()=>{t.current=e}),t.current}var bh=Symbol.for("Animated:node"),zje=e=>!!e&&e[bh]===e,La=e=>e&&e[bh],r6=(e,t)=>pje(e,bh,t),Pv=e=>e&&e[bh]&&e[bh].getPayload(),HX=class{constructor(){r6(this,this)}getPayload(){return this.payload||[]}},Ov=class zX extends HX{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Ie.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new zX(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,n){return Ie.num(t)&&(this.lastPosition=t,n&&(t=Math.round(t/n)*n,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Ie.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},w2=class WX extends Ov{constructor(t){super(0),this._string=null,this._toString=gh({output:[t,t]})}static create(t){return new WX(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Ie.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=gh({output:[this.getValue(),t]})),this._value=0,super.reset()}},C2={dependencies:null},Lv=class extends HX{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ni(this.source,(n,r)=>{zje(n)?t[r]=n.getValue(e):_o(n)?t[r]=Ds(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Mt(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ni(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){C2.dependencies&&_o(e)&&C2.dependencies.add(e);const t=Pv(e);t&&Mt(t,n=>this.add(n))}},Wje=class GX extends Lv{constructor(t){super(t)}static create(t){return new GX(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const n=this.getPayload();return t.length==n.length?n.map((r,s)=>r.setValue(t[s])).some(Boolean):(super.setValue(t.map(Gje)),!0)}};function Gje(e){return(Iv(e)?w2:Ov).create(e)}function xE(e){const t=La(e);return t?t.constructor:Ie.arr(e)?Wje:Iv(e)?w2:Ov}var qj=(e,t)=>{const n=!Ie.fun(e)||e.prototype&&e.prototype.isReactComponent;return d.forwardRef((r,s)=>{const o=d.useRef(null),a=n&&d.useCallback(g=>{o.current=Kje(s,g)},[s]),[i,c]=qje(r,t),u=t6(),f=()=>{const g=o.current;if(n&&!g)return;(g?t.applyAnimatedValues(g,i.getValue(!0)):!1)===!1&&u()},m=new $je(f,c),p=d.useRef(void 0);Ac(()=>(p.current=m,Mt(c,g=>qf(g,m)),()=>{p.current&&(Mt(p.current.deps,g=>vh(g,p.current)),jt.cancel(p.current.update))})),d.useEffect(f,[]),n6(()=>()=>{const g=p.current;Mt(g.deps,y=>vh(y,g))});const h=t.getComponentProps(i.getValue());return d.createElement(e,{...h,ref:a})})},$je=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&jt.write(this.update)}};function qje(e,t){const n=new Set;return C2.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Lv(e),C2.dependencies=null,[e,n]}function Kje(e,t){return e&&(Ie.fun(e)?e(t):e.current=t),t}var Kj=Symbol.for("AnimatedComponent"),Yje=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=s=>new Lv(s),getComponentProps:r=s=>s}={})=>{const s={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},o=a=>{const i=Yj(a)||"Anonymous";return Ie.str(a)?a=o[a]||(o[a]=qj(a,s)):a=a[Kj]||(a[Kj]=qj(a,s)),a.displayName=`Animated(${i})`,a};return ni(e,(a,i)=>{Ie.arr(e)&&(i=Yj(a)),o[i]=o(a)}),{animated:o}},Yj=e=>Ie.str(e)?e:e&&Ie.str(e.displayName)?e.displayName:Ie.fun(e)&&e.name||null;function js(e,...t){return Ie.fun(e)?e(...t):e}var Np=(e,t)=>e===!0||!!(t&&e&&(Ie.fun(e)?e(t):_s(e).includes(t))),$X=(e,t)=>Ie.obj(e)?t&&e[t]:e,qX=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Qje=e=>e,Fv=(e,t=Qje)=>{let n=Xje;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const s of n){const o=t(e[s],s);Ie.und(o)||(r[s]=o)}return r},Xje=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Zje={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Jje(e){const t={};let n=0;if(ni(e,(r,s)=>{Zje[s]||(t[s]=r,n++)}),n)return t}function s6(e){const t=Jje(e);if(t){const n={to:t};return ni(e,(r,s)=>s in t||(n[s]=r)),n}return{...e}}function _h(e){return e=Ds(e),Ie.arr(e)?e.map(_h):Iv(e)?xa.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function KX(e){for(const t in e)return!0;return!1}function vE(e){return Ie.fun(e)||Ie.arr(e)&&Ie.obj(e[0])}function bE(e,t){e.ref?.delete(e),t?.delete(e)}function YX(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var eIe={default:{tension:170,friction:26}},_E={...eIe.default,mass:1,damping:1,easing:Nje.linear,clamp:!1},tIe=class{constructor(){this.velocity=0,Object.assign(this,_E)}};function nIe(e,t,n){n&&(n={...n},Qj(n,t),t={...n,...t}),Qj(e,t),Object.assign(e,t);for(const a in _E)e[a]==null&&(e[a]=_E[a]);let{frequency:r,damping:s}=e;const{mass:o}=e;return Ie.und(r)||(r<.01&&(r=.01),s<0&&(s=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*s*o/r),e}function Qj(e,t){if(!Ie.und(t.decay))e.duration=void 0;else{const n=!Ie.und(t.tension)||!Ie.und(t.friction);(n||!Ie.und(t.frequency)||!Ie.und(t.damping)||!Ie.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var Xj=[],rIe=class{constructor(){this.changed=!1,this.values=Xj,this.toValues=null,this.fromValues=Xj,this.config=new tIe,this.immediate=!1}};function QX(e,{key:t,props:n,defaultProps:r,state:s,actions:o}){return new Promise((a,i)=>{let c,u,f=Np(n.cancel??r?.cancel,t);if(f)h();else{Ie.und(n.pause)||(s.paused=Np(n.pause,t));let g=r?.pause;g!==!0&&(g=s.paused||Np(g,t)),c=js(n.delay||0,t),g?(s.resumeQueue.add(p),o.pause()):(o.resume(),p())}function m(){s.resumeQueue.add(p),s.timeouts.delete(u),u.cancel(),c=u.time-jt.now()}function p(){c>0&&!xa.skipAnimation?(s.delayed=!0,u=jt.setTimeout(h,c),s.pauseQueue.add(m),s.timeouts.add(u)):h()}function h(){s.delayed&&(s.delayed=!1),s.pauseQueue.delete(m),s.timeouts.delete(u),e<=(s.cancelId||0)&&(f=!0);try{o.start({...n,callId:e,cancel:f},a)}catch(g){i(g)}}})}var o6=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?Md(e.get()):t.every(n=>n.noop)?XX(e.get()):sa(e.get(),t.every(n=>n.finished)),XX=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),sa=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Md=e=>({value:e,cancelled:!0,finished:!1});function ZX(e,t,n,r){const{callId:s,parentId:o,onRest:a}=t,{asyncTo:i,promise:c}=n;return!o&&e===i&&!t.reset?c:n.promise=(async()=>{n.asyncId=s,n.asyncTo=e;const u=Fv(t,(x,v)=>v==="onRest"?void 0:x);let f,m;const p=new Promise((x,v)=>(f=x,m=v)),h=x=>{const v=s<=(n.cancelId||0)&&Md(r)||s!==n.asyncId&&sa(r,!1);if(v)throw x.result=v,m(x),x},g=(x,v)=>{const b=new Zj,_=new Jj;return(async()=>{if(xa.skipAnimation)throw wh(n),_.result=sa(r,!1),m(_),_;h(b);const w=Ie.obj(x)?{...x}:{...v,to:x};w.parentId=s,ni(u,(C,E)=>{Ie.und(w[E])&&(w[E]=C)});const S=await r.start(w);return h(b),n.paused&&await new Promise(C=>{n.resumeQueue.add(C)}),S})()};let y;if(xa.skipAnimation)return wh(n),sa(r,!1);try{let x;Ie.arr(e)?x=(async v=>{for(const b of v)await g(b)})(e):x=Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([x.then(f),p]),y=sa(r.get(),!0,!1)}catch(x){if(x instanceof Zj)y=x.result;else if(x instanceof Jj)y=x.result;else throw x}finally{s==n.asyncId&&(n.asyncId=o,n.asyncTo=o?i:void 0,n.promise=o?c:void 0)}return Ie.fun(a)&&jt.batchedUpdates(()=>{a(y,r,r.item)}),y})()}function wh(e,t){Tp(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Zj=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Jj=class extends Error{constructor(){super("SkipAnimationSignal")}},wE=e=>e instanceof a6,sIe=1,a6=class extends LX{constructor(){super(...arguments),this.id=sIe++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=La(this);return e&&e.getValue()}to(...e){return xa.to(this,e)}interpolate(...e){return Fje(),xa.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){xh(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Rv.sort(this),xh(this,{type:"priority",parent:this,priority:e})}},Xc=Symbol.for("SpringPhase"),JX=1,CE=2,SE=4,fw=e=>(e[Xc]&JX)>0,al=e=>(e[Xc]&CE)>0,Tm=e=>(e[Xc]&SE)>0,eI=(e,t)=>t?e[Xc]|=CE|JX:e[Xc]&=~CE,tI=(e,t)=>t?e[Xc]|=SE:e[Xc]&=~SE,oIe=class extends a6{constructor(e,t){if(super(),this.animation=new rIe,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ie.und(e)||!Ie.und(t)){const n=Ie.obj(e)?{...e}:{...t,from:e};Ie.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(al(this)||this._state.asyncTo)||Tm(this)}get goal(){return Ds(this.animation.to)}get velocity(){const e=La(this);return e instanceof Ov?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return fw(this)}get isAnimating(){return al(this)}get isPaused(){return Tm(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:s}=r;const{config:o}=r,a=Pv(r.to);!a&&_o(r.to)&&(s=_s(Ds(r.to))),r.values.forEach((u,f)=>{if(u.done)return;const m=u.constructor==w2?1:a?a[f].lastPosition:s[f];let p=r.immediate,h=m;if(!p){if(h=u.lastPosition,o.tension<=0){u.done=!0;return}let g=u.elapsedTime+=e;const y=r.fromValues[f],x=u.v0!=null?u.v0:u.v0=Ie.arr(o.velocity)?o.velocity[f]:o.velocity;let v;const b=o.precision||(y==m?.005:Math.min(1,Math.abs(m-y)*.001));if(Ie.und(o.duration))if(o.decay){const _=o.decay===!0?.998:o.decay,w=Math.exp(-(1-_)*g);h=y+x/(1-_)*(1-w),p=Math.abs(u.lastPosition-h)<=b,v=x*w}else{v=u.lastVelocity==null?x:u.lastVelocity;const _=o.restVelocity||b/10,w=o.clamp?0:o.bounce,S=!Ie.und(w),C=y==m?u.v0>0:y_,!(!E&&(p=Math.abs(m-h)<=b,p)));++M){S&&(T=h==m||h>m==C,T&&(v=-v*w,h=m));const N=-o.tension*1e-6*(h-m),D=-o.friction*.001*v,j=(N+D)/o.mass;v=v+j*k,h=h+v*k}}else{let _=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,u.durationProgress>0&&(u.elapsedTime=o.duration*u.durationProgress,g=u.elapsedTime+=e)),_=(o.progress||0)+g/this._memoizedDuration,_=_>1?1:_<0?0:_,u.durationProgress=_),h=y+o.easing(_)*(m-y),v=(h-u.lastPosition)/e,p=_==1}u.lastVelocity=v,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[f].done&&(p=!1),p?u.done=!0:t=!1,u.setValue(h,o.round)&&(n=!0)});const i=La(this),c=i.getValue();if(t){const u=Ds(r.to);(c!==u||n)&&!o.decay?(i.setValue(u),this._onChange(u)):n&&o.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return jt.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(al(this)){const{to:e,config:t}=this.animation;jt.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ie.und(e)?(n=this.queue||[],this.queue=[]):n=[Ie.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>o6(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),wh(this._state,e&&this._lastCallId),jt.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=Ie.obj(n)?n[t]:n,(n==null||vE(n))&&(n=void 0),r=Ie.obj(r)?r[t]:r,r==null&&(r=void 0);const s={to:n,from:r};return fw(this)||(e.reverse&&([n,r]=[r,n]),r=Ds(r),Ie.und(r)?La(this)||this._set(n):this._set(r)),s}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Fv(e,(a,i)=>/^on/.test(i)?$X(a,n):a)),rI(this,e,"onProps"),Nm(this,"onProps",e,this);const s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const o=this._state;return QX(++this._lastCallId,{key:n,props:e,defaultProps:r,state:o,actions:{pause:()=>{Tm(this)||(tI(this,!0),np(o.pauseQueue),Nm(this,"onPause",sa(this,Am(this,this.animation.to)),this))},resume:()=>{Tm(this)&&(tI(this,!1),al(this)&&this._resume(),np(o.resumeQueue),Nm(this,"onResume",sa(this,Am(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const i=eZ(e);if(i)return this._update(i,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Md(this));const r=!Ie.und(e.to),s=!Ie.und(e.from);if(r||s)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Md(this));const{key:o,defaultProps:a,animation:i}=this,{to:c,from:u}=i;let{to:f=c,from:m=u}=e;s&&!r&&(!t.default||Ie.und(f))&&(f=m),t.reverse&&([f,m]=[m,f]);const p=!Ei(m,u);p&&(i.from=m),m=Ds(m);const h=!Ei(f,c);h&&this._focus(f);const g=vE(t.to),{config:y}=i,{decay:x,velocity:v}=y;(r||s)&&(y.velocity=0),t.config&&!g&&nIe(y,js(t.config,o),t.config!==a.config?js(a.config,o):void 0);let b=La(this);if(!b||Ie.und(f))return n(sa(this,!0));const _=Ie.und(t.reset)?s&&!t.default:!Ie.und(m)&&Np(t.reset,o),w=_?m:this.get(),S=_h(f),C=Ie.num(S)||Ie.arr(S)||Iv(S),E=!g&&(!C||Np(a.immediate||t.immediate,o));if(h){const M=xE(f);if(M!==b.constructor)if(E)b=this._set(S);else throw Error(`Cannot animate between ${b.constructor.name} and ${M.name}, as the "to" prop suggests`)}const T=b.constructor;let k=_o(f),I=!1;if(!k){const M=_||!fw(this)&&p;(h||M)&&(I=Ei(_h(w),S),k=!I),(!Ei(i.immediate,E)&&!E||!Ei(y.decay,x)||!Ei(y.velocity,v))&&(k=!0)}if(I&&al(this)&&(i.changed&&!_?k=!0:k||this._stop(c)),!g&&((k||_o(c))&&(i.values=b.getPayload(),i.toValues=_o(f)?null:T==w2?[1]:_s(S)),i.immediate!=E&&(i.immediate=E,!E&&!_&&this._set(c)),k)){const{onRest:M}=i;Mt(iIe,D=>rI(this,t,D));const N=sa(this,Am(this,c));np(this._pendingCalls,N),this._pendingCalls.add(n),i.changed&&jt.batchedUpdates(()=>{i.changed=!_,M?.(N,this),_?js(a.onRest,N):i.onStart?.(N,this)})}_&&this._set(w),g?n(ZX(t.to,t,this._state,this)):k?this._start():al(this)&&!h?this._pendingCalls.add(n):n(XX(w))}_focus(e){const t=this.animation;e!==t.to&&(Gj(this)&&this._detach(),t.to=e,Gj(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;_o(t)&&(qf(t,this),wE(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;_o(e)&&vh(e,this)}_set(e,t=!0){const n=Ds(e);if(!Ie.und(n)){const r=La(this);if(!r||!Ei(n,r.getValue())){const s=xE(n);!r||r.constructor!=s?r6(this,s.create(n)):r.setValue(n),r&&jt.batchedUpdates(()=>{this._onChange(n,t)})}}return La(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Nm(this,"onStart",sa(this,Am(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),js(this.animation.onChange,e,this)),js(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;La(this).reset(Ds(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),al(this)||(eI(this,!0),Tm(this)||this._resume())}_resume(){xa.skipAnimation?this.finish():Rv.start(this)}_stop(e,t){if(al(this)){eI(this,!1);const n=this.animation;Mt(n.values,s=>{s.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),xh(this,{type:"idle",parent:this});const r=t?Md(this.get()):sa(this.get(),Am(this,e??n.to));np(this._pendingCalls,r),n.changed&&(n.changed=!1,Nm(this,"onRest",r,this))}}};function Am(e,t){const n=_h(t),r=_h(e.get());return Ei(r,n)}function eZ(e,t=e.loop,n=e.to){const r=js(t);if(r){const s=r!==!0&&s6(r),o=(s||e).reverse,a=!s||s.reset;return Ch({...e,loop:t,default:!1,pause:void 0,to:!o||vE(n)?n:void 0,from:a?e.from:void 0,reset:a,...s})}}function Ch(e){const{to:t,from:n}=e=s6(e),r=new Set;return Ie.obj(t)&&nI(t,r),Ie.obj(n)&&nI(n,r),e.keys=r.size?Array.from(r):null,e}function aIe(e){const t=Ch(e);return Ie.und(t.default)&&(t.default=Fv(t)),t}function nI(e,t){ni(e,(n,r)=>n!=null&&t.add(r))}var iIe=["onStart","onRest","onChange","onPause","onResume"];function rI(e,t,n){e.animation[n]=t[n]!==qX(t,n)?$X(t[n],e.key):void 0}function Nm(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var lIe=["onStart","onChange","onRest"],cIe=1,tZ=class{constructor(e,t){this.id=cIe++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];Ie.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ch(e)),this}start(e){let{queue:t}=this;return e?t=_s(e).map(Ch):this.queue=[],this._flush?this._flush(this,t):(aZ(this,t),EE(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Mt(_s(t),r=>n[r].stop(!!e))}else wh(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(Ie.und(e))this.start({pause:!0});else{const t=this.springs;Mt(_s(e),n=>t[n].pause())}return this}resume(e){if(Ie.und(e))this.start({pause:!1});else{const t=this.springs;Mt(_s(e),n=>t[n].resume())}return this}each(e){ni(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,Tp(e,([i,c])=>{c.value=this.get(),i(c,this,this._item)}));const o=!r&&this._started,a=s||o&&n.size?this.get():null;s&&t.size&&Tp(t,([i,c])=>{c.value=a,i(c,this,this._item)}),o&&(this._started=!1,Tp(n,([i,c])=>{c.value=a,i(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;jt.onFrame(this._onFrame)}};function EE(e,t){return Promise.all(t.map(n=>nZ(e,n))).then(n=>o6(e,n))}async function nZ(e,t,n){const{keys:r,to:s,from:o,loop:a,onRest:i,onResolve:c}=t,u=Ie.obj(t.default)&&t.default;a&&(t.loop=!1),s===!1&&(t.to=null),o===!1&&(t.from=null);const f=Ie.arr(s)||Ie.fun(s)?s:void 0;f?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):Mt(lIe,y=>{const x=t[y];if(Ie.fun(x)){const v=e._events[y];t[y]=({finished:b,cancelled:_})=>{const w=v.get(x);w?(b||(w.finished=!1),_&&(w.cancelled=!0)):v.set(x,{value:null,finished:b||!1,cancelled:_||!1})},u&&(u[y]=t[y])}});const m=e._state;t.pause===!m.paused?(m.paused=t.pause,np(t.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(t.pause=!0);const p=(r||Object.keys(e.springs)).map(y=>e.springs[y].start(t)),h=t.cancel===!0||qX(t,"cancel")===!0;(f||h&&m.asyncId)&&p.push(QX(++e._lastAsyncId,{props:t,state:m,actions:{pause:hE,resume:hE,start(y,x){h?(wh(m,e._lastAsyncId),x(Md(e))):(y.onRest=i,x(ZX(f,y,m,e)))}}})),m.paused&&await new Promise(y=>{m.resumeQueue.add(y)});const g=o6(e,await Promise.all(p));if(a&&g.finished&&!(n&&g.noop)){const y=eZ(t,a,s);if(y)return aZ(e,[y]),nZ(e,y,!0)}return c&&jt.batchedUpdates(()=>c(g,e,e.item)),g}function kE(e,t){const n={...e.springs};return t&&Mt(_s(t),r=>{Ie.und(r.keys)&&(r=Ch(r)),Ie.obj(r.to)||(r={...r,to:void 0}),oZ(n,r,s=>sZ(s))}),rZ(e,n),n}function rZ(e,t){ni(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,qf(n,e))})}function sZ(e,t){const n=new oIe;return n.key=e,t&&qf(n,t),n}function oZ(e,t,n){t.keys&&Mt(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function aZ(e,t){Mt(t,n=>{oZ(e.springs,n,r=>sZ(r,e))})}var iZ=d.createContext({pause:!1,immediate:!1}),lZ=()=>{const e=[],t=function(r){Uje();const s=[];return Mt(e,(o,a)=>{if(Ie.und(r))s.push(o.start());else{const i=n(r,o,a);i&&s.push(o.start(i))}}),s};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const s=e.indexOf(r);~s&&e.splice(s,1)},t.pause=function(){return Mt(e,r=>r.pause(...arguments)),this},t.resume=function(){return Mt(e,r=>r.resume(...arguments)),this},t.set=function(r){Mt(e,(s,o)=>{const a=Ie.fun(r)?r(o,s):r;a&&s.set(a)})},t.start=function(r){const s=[];return Mt(e,(o,a)=>{if(Ie.und(r))s.push(o.start());else{const i=this._getProps(r,o,a);i&&s.push(o.start(i))}}),s},t.stop=function(){return Mt(e,r=>r.stop(...arguments)),this},t.update=function(r){return Mt(e,(s,o)=>s.update(this._getProps(r,s,o))),this};const n=function(r,s,o){return Ie.fun(r)?r(o,s):r};return t._getProps=n,t};function uIe(e,t,n){const r=Ie.fun(t)&&t;r&&!n&&(n=[]);const s=d.useMemo(()=>r||arguments.length==3?lZ():void 0,[]),o=d.useRef(0),a=t6(),i=d.useMemo(()=>({ctrls:[],queue:[],flush(v,b){const _=kE(v,b);return o.current>0&&!i.queue.length&&!Object.keys(_).some(S=>!v.springs[S])?EE(v,b):new Promise(S=>{rZ(v,_),i.queue.push(()=>{S(EE(v,b))}),a()})}}),[]),c=d.useRef([...i.ctrls]),u=d.useRef([]),f=yE(e)||0;d.useMemo(()=>{Mt(c.current.slice(e,f),v=>{bE(v,s),v.stop(!0)}),c.current.length=e,m(f,e)},[e]),d.useMemo(()=>{m(0,Math.min(f,e))},n);function m(v,b){for(let _=v;_kE(v,u.current[b])),h=d.useContext(iZ),g=yE(h),y=h!==g&&KX(h);Ac(()=>{o.current++,i.ctrls=c.current;const{queue:v}=i;v.length&&(i.queue=[],Mt(v,b=>b())),Mt(c.current,(b,_)=>{s?.add(b),y&&b.start({default:h});const w=u.current[_];w&&(YX(b,w.ref),b.ref?b.queue.push(w):b.start(w))})}),n6(()=>()=>{Mt(i.ctrls,v=>v.stop(!0))});const x=p.map(v=>({...v}));return s?[x,s]:x}function dIe(e,t){const n=Ie.fun(e),[[r],s]=uIe(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,s]:r}function i6(e,t,n){const r=Ie.fun(t)&&t,{reset:s,sort:o,trail:a=0,expires:i=!0,exitBeforeEnter:c=!1,onDestroyed:u,ref:f,config:m}=r?r():t,p=d.useMemo(()=>r||arguments.length==3?lZ():void 0,[]),h=_s(e),g=[],y=d.useRef(null),x=s?null:y.current;Ac(()=>{y.current=g}),n6(()=>(Mt(g,j=>{p?.add(j.ctrl),j.ctrl.ref=p}),()=>{Mt(y.current,j=>{j.expired&&clearTimeout(j.expirationId),bE(j.ctrl,p),j.ctrl.stop(!0)})}));const v=mIe(h,r?r():t,x),b=s&&y.current||[];Ac(()=>Mt(b,({ctrl:j,item:F,key:R})=>{bE(j,p),js(u,F,R)}));const _=[];if(x&&Mt(x,(j,F)=>{j.expired?(clearTimeout(j.expirationId),b.push(j)):(F=_[F]=v.indexOf(j.key),~F&&(g[F]=j))}),Mt(h,(j,F)=>{g[F]||(g[F]={key:v[F],item:j,phase:"mount",ctrl:new tZ},g[F].ctrl.item=j)}),_.length){let j=-1;const{leave:F}=r?r():t;Mt(_,(R,P)=>{const L=x[P];~R?(j=g.indexOf(L),g[j]={...L,item:h[R]}):F&&g.splice(++j,0,L)})}Ie.fun(o)&&g.sort((j,F)=>o(j.item,F.item));let w=-a;const S=t6(),C=Fv(t),E=new Map,T=d.useRef(new Map),k=d.useRef(!1);Mt(g,(j,F)=>{const R=j.key,P=j.phase,L=r?r():t;let U,O;const $=js(L.delay||0,R);if(P=="mount")U=L.enter,O="enter";else{const Y=v.indexOf(R)<0;if(P!="leave")if(Y)U=L.leave,O="leave";else if(U=L.update)O="update";else return;else if(!Y)U=L.enter,O="enter";else return}if(U=js(U,j.item,F),U=Ie.obj(U)?s6(U):{to:U},!U.config){const Y=m||C.config;U.config=js(Y,j.item,F,O)}w+=a;const G={...C,delay:$+w,ref:f,immediate:L.immediate,reset:!1,...U};if(O=="enter"&&Ie.und(G.from)){const Y=r?r():t,te=Ie.und(Y.initial)||x?Y.from:Y.initial;G.from=js(te,j.item,F)}const{onResolve:H}=G;G.onResolve=Y=>{js(H,Y);const te=y.current,se=te.find(ae=>ae.key===R);if(se&&!(Y.cancelled&&se.phase!="update")&&se.ctrl.idle){const ae=te.every(X=>X.ctrl.idle);if(se.phase=="leave"){const X=js(i,se.item);if(X!==!1){const ee=X===!0?0:X;if(se.expired=!0,!ae&&ee>0){ee<=2147483647&&(se.expirationId=setTimeout(S,ee));return}}}ae&&te.some(X=>X.expired)&&(T.current.delete(se),c&&(k.current=!0),S())}};const Q=kE(j.ctrl,G);O==="leave"&&c?T.current.set(j,{phase:O,springs:Q,payload:G}):E.set(j,{phase:O,springs:Q,payload:G})});const I=d.useContext(iZ),M=yE(I),N=I!==M&&KX(I);Ac(()=>{N&&Mt(g,j=>{j.ctrl.start({default:I})})},[I]),Mt(E,(j,F)=>{if(T.current.size){const R=g.findIndex(P=>P.key===F.key);g.splice(R,1)}}),Ac(()=>{Mt(T.current.size?T.current:E,({phase:j,payload:F},R)=>{const{ctrl:P}=R;R.phase=j,p?.add(P),N&&j=="enter"&&P.start({default:I}),F&&(YX(P,F.ref),(P.ref||p)&&!k.current?P.update(F):(P.start(F),k.current&&(k.current=!1)))})},s?void 0:n);const D=j=>d.createElement(d.Fragment,null,g.map((F,R)=>{const{springs:P}=E.get(F)||F.ctrl,L=j({...P},F.item,F,R),U=Ie.str(F.key)||Ie.num(F.key)?F.key:F.ctrl.id,O=d.version<"19.0.0",$=L?.props??{},G=O?L?.ref:$?.ref;return L&&L.type?d.createElement(L.type,{...$,key:U,ref:G}):L}));return p?[D,p]:D}var fIe=1;function mIe(e,{key:t,keys:n=t},r){if(n===null){const s=new Set;return e.map(o=>{const a=r&&r.find(i=>i.item===o&&i.phase!=="leave"&&!s.has(i));return a?(s.add(a),a.key):fIe++})}return Ie.und(n)?e:Ie.fun(n)?e.map(n):_s(n)}var cZ=class extends a6{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=gh(...t);const n=this._get(),r=xE(n);r6(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Ei(t,n)||(La(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&sI(this._active)&&mw(this)}_get(){const e=Ie.arr(this.source)?this.source.map(Ds):_s(Ds(this.source));return this.calc(...e)}_start(){this.idle&&!sI(this._active)&&(this.idle=!1,Mt(Pv(this),e=>{e.done=!1}),xa.skipAnimation?(jt.batchedUpdates(()=>this.advance()),mw(this)):Rv.start(this))}_attach(){let e=1;Mt(_s(this.source),t=>{_o(t)&&qf(t,this),wE(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Mt(_s(this.source),e=>{_o(e)&&vh(e,this)}),this._active.clear(),mw(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=_s(this.source).reduce((t,n)=>Math.max(t,(wE(n)?n.priority:0)+1),0))}};function pIe(e){return e.idle!==!1}function sI(e){return!e.size||Array.from(e).every(pIe)}function mw(e){e.idle||(e.idle=!0,Mt(Pv(e),t=>{t.done=!0}),xh(e,{type:"idle",parent:e}))}var hIe=(e,...t)=>new cZ(e,t);xa.assign({createStringInterpolator:UX,to:(e,t)=>new cZ(e,t)});var uZ=/^--/;function gIe(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!uZ.test(e)&&!(Rp.hasOwnProperty(e)&&Rp[e])?t+"px":(""+t).trim()}var oI={};function yIe(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:s,children:o,scrollTop:a,scrollLeft:i,viewBox:c,...u}=t,f=Object.values(u),m=Object.keys(u).map(p=>n||e.hasAttribute(p)?p:oI[p]||(oI[p]=p.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));o!==void 0&&(e.textContent=o);for(const p in s)if(s.hasOwnProperty(p)){const h=gIe(p,s[p]);uZ.test(p)?e.style.setProperty(p,h):e.style[p]=h}m.forEach((p,h)=>{e.setAttribute(p,f[h])}),r!==void 0&&(e.className=r),a!==void 0&&(e.scrollTop=a),i!==void 0&&(e.scrollLeft=i),c!==void 0&&e.setAttribute("viewBox",c)}var Rp={animationIterationCount:!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,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},xIe=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),vIe=["Webkit","Ms","Moz","O"];Rp=Object.keys(Rp).reduce((e,t)=>(vIe.forEach(n=>e[xIe(n,t)]=e[t]),e),Rp);var bIe=/^(matrix|translate|scale|rotate|skew)/,_Ie=/^(translate)/,wIe=/^(rotate|skew)/,pw=(e,t)=>Ie.num(e)&&e!==0?e+t:e,hy=(e,t)=>Ie.arr(e)?e.every(n=>hy(n,t)):Ie.num(e)?e===t:parseFloat(e)===t,CIe=class extends Lv{constructor({x:e,y:t,z:n,...r}){const s=[],o=[];(e||t||n)&&(s.push([e||0,t||0,n||0]),o.push(a=>[`translate3d(${a.map(i=>pw(i,"px")).join(",")})`,hy(a,0)])),ni(r,(a,i)=>{if(i==="transform")s.push([a||""]),o.push(c=>[c,c===""]);else if(bIe.test(i)){if(delete r[i],Ie.und(a))return;const c=_Ie.test(i)?"px":wIe.test(i)?"deg":"";s.push(_s(a)),o.push(i==="rotate3d"?([u,f,m,p])=>[`rotate3d(${u},${f},${m},${pw(p,c)})`,hy(p,0)]:u=>[`${i}(${u.map(f=>pw(f,c)).join(",")})`,hy(u,i.startsWith("scale")?1:0)])}}),s.length&&(r.transform=new SIe(s,o)),super(r)}},SIe=class extends LX{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Mt(this.inputs,(n,r)=>{const s=Ds(n[0]),[o,a]=this.transforms[r](Ie.arr(s)?s:n.map(Ds));e+=" "+o,t=t&&a}),t?"none":e}observerAdded(e){e==1&&Mt(this.inputs,t=>Mt(t,n=>_o(n)&&qf(n,this)))}observerRemoved(e){e==0&&Mt(this.inputs,t=>Mt(t,n=>_o(n)&&vh(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),xh(this,e)}},EIe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];xa.assign({batchedUpdates:zh.unstable_batchedUpdates,createStringInterpolator:UX,colors:xje});var kIe=Yje(EIe,{applyAnimatedValues:yIe,createAnimatedStyle:e=>new CIe(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),fa=kIe.animated;const MIe={tension:700,friction:50};function TIe({value:e,children:t,...n}){const r=wa(n),{currentValue:s,animation:o="none"}=Av(),a=s===e,i=o!=="none",c=l.jsx(ije,{value:e,className:"focus:outline-none",forceMount:i||void 0,...r,children:t});return i?l.jsx(AIe,{isVisible:a,children:c}):c}function AIe({isVisible:e,children:t}){return i6(e,{initial:!1,from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{...MIe,clamp:!0}})((r,s)=>s?l.jsx(fa.div,{style:r,className:"col-start-1 row-start-1",children:t}):null)}const NIe=ci(z("reset interactable","font-sans font-medium select-none","transition-colors duration-300","relative","flex gap-1.5 items-center","text-sm text-foreground"),{variants:{isIconOnly:{false:z("data-[state=inactive]:opacity-80","data-[state=active]:opacity-100"),true:z("data-[state=inactive]:opacity-80","data-[state=active]:opacity-100")},disabled:{false:"cursor-pointer",true:"cursor-not-allowed opacity-70"},fullWidth:{false:"",true:"flex-1 justify-center"},size:{default:"py-3.5",compact:"py-2"}},compoundVariants:[{isIconOnly:!1,disabled:!1,class:"data-[state=inactive]:hover:opacity-100"},{isIconOnly:!0,class:"px-3"}],defaultVariants:{isIconOnly:!1,disabled:!1,fullWidth:!1,size:"default"}});function RIe(e){const{value:t,disabled:n=!1,...r}=e,s=wa(r),{fullWidth:o,size:a,registerTabRef:i,unregisterTabRef:c}=Av(),u=d.useRef(null),f="icon"in e,m=f?e.icon:e.leadingIcon,p=f?void 0:e.children,h=f?e["aria-label"]:void 0;d.useLayoutEffect(()=>(i(t,u),()=>c(t)),[t,i,c]);const g=l.jsxs(aje,{ref:u,value:t,disabled:n,"aria-label":f?h:void 0,className:z("group",NIe({isIconOnly:f,disabled:n,fullWidth:o,size:a})),...s,children:[m&&l.jsx(rn,{icon:m,size:"medium"}),p]});return f&&h?l.jsx(Fo,{content:h,side:"bottom",disabled:n,children:l.jsx("span",{className:z("inline-flex",o&&"flex-1"),children:g})}):g}function DIe(e){const{children:t,onValueChange:n,animation:r="none",...s}=e,o=wa(s),a="value"in e?{value:e.value}:{defaultValue:e.defaultValue},[i,c]=d.useState(a.defaultValue),u=d.useRef(new Map),f=d.useRef(()=>{}),m=d.useCallback((g,y)=>{u.current.set(g,y)},[]),p=d.useCallback(g=>{u.current.delete(g)},[]),h=d.useCallback(g=>{c(g),n?.(g),requestAnimationFrame(()=>{f.current()})},[n]);return d.useEffect(()=>{e.value!==void 0&&requestAnimationFrame(()=>{f.current()})},[e.value]),l.jsx(GA.Provider,{value:{currentValue:a.value??i,registerTabRef:m,unregisterTabRef:p,updateIndicatorRef:f,animation:r},children:l.jsx(sje,{...a,orientation:"horizontal",onValueChange:h,className:r==="none"?"contents":"grid w-full min-w-0 grid-cols-[minmax(0,1fr)]",...o,children:t})})}const Dp=Object.assign(DIe,{List:uje,Tab:RIe,Panel:TIe}),es={default:"d",shopping:"s",jobs:"j",hotels:"h",places:"p",images:"i",videos:"v",sources:"r",assets:"a",apps:"c",search:"se",chat:"ch"},jIe=e=>{if(e)return Object.entries(es).find(([t,n])=>n===e)?.[0]},IIe=()=>{const e=fn();return d.useCallback(()=>{const n=new URLSearchParams(e?.toString()).get("sm");return jIe(n)},[e])},dZ=()=>{const e=fn(),t=On(),n=Rn();return d.useCallback(r=>{const s=new URLSearchParams(e?.toString());s.set("sm",es[r]),n.replace(`${t}?${s.toString()}`)},[t,n,e])},PIe=({items:e,inFlight:t,inFlightLatest:n,rwToken:r,contentHasMounted:s,hasHeader:o=!0})=>{const{scrollContainerRef:a}=ka(),i=mi(),c=d.useMemo(()=>{if(typeof window>"u")return 0;let _;return o?_=getComputedStyle(document.documentElement).getPropertyValue("--header-height"):_="0",parseInt(_)},[o]),u=d.useRef(!0),f=d.useMemo(()=>!r&&e.every(_=>!qt.isStatusPending(_)),[e,r]),m=d.useMemo(()=>e.some(_=>qt.isStatusPending(_)),[e]),p=d.useRef({}),h=d.useRef({}),g=d.useRef(!1);d.useEffect(()=>()=>{p.current={},h.current={}},[]);const y=d.useCallback((_,{smooth:w=!0,anchor:S=!1}={smooth:!0,anchor:!1})=>{const C=typeof _=="number"?p.current?.[_]?.current:h.current?.[_]?.current;if(C&&a?.current){const E=a.current,T=Cf(()=>{g.current=!1,E.removeEventListener("scroll",T)},100,{leading:!1,trailing:!0});if(E.addEventListener("scroll",T),g.current=!0,S){const N=C.getBoundingClientRect().top,D=fE(E),j=N+D-c,F=yX(E),R=gX(E);if(j+R>F){const P=F-R-.1;requestAnimationFrame(()=>{Uj(E,P,w?"smooth":"auto")});return}}const k=C.getBoundingClientRect().top,I=fE(E),M=k+I-c;requestAnimationFrame(()=>{Uj(E,M,w?"smooth":"auto")})}},[a,c]),x=d.useCallback(()=>{y(e.length-1)},[y,e.length]);d.useEffect(()=>{const _={...p.current},w={};e.forEach((C,E)=>{const T=E,k=C.backend_uuid;if(k)if(!_[T]||!_[T].current){const I=A.createRef();_[T]=I,w[k]=I}else w[k]=_[T]});const S=e.length;Object.keys(_).forEach(C=>{Number(C)>=S&&delete _[Number(C)]}),h.current=w,p.current=_},[e.length,m]);const v=e.at(-1)?.query_source==="edit";d.useEffect(()=>{if(e.length<=1||!i||!s)return;const _=window.location.hash;if(_&&!t&&u.current){try{const w=_.slice(1);w.length>3?y(w,{smooth:!1}):y(Number(w),{smooth:!1})}catch(w){Z.error(w)}return}n&&!v&&requestAnimationFrame(()=>{y(e.length-1,{anchor:!0})})},[t,n,f,e.length,i,y,s,v]);const b=p.current;return d.useMemo(()=>({refs:b,isScrollingRef:g,scrollToLatestItem:x,scrollToListItem:y}),[b,x,y])},fZ=Ft("ScrollToEntityContext",{refs:{},isScrollingRef:{current:!1},scrollToListItem:()=>{},setContentHasMounted:()=>{},scrollToLatestItem:()=>{},contentHasMounted:!1}),mZ=A.memo(({children:e})=>{const t=el(),{results:n=[],inFlight:r,inFlightLatest:s}=on(),[o,a]=d.useState(!1),i=d.useMemo(()=>P4(n).map(h=>h.length?h[0]:void 0).filter(h=>h!==void 0),[n]),{refs:c,isScrollingRef:u,scrollToListItem:f,scrollToLatestItem:m}=PIe({items:i,inFlight:r,inFlightLatest:s,rwToken:t,contentHasMounted:o,hasHeader:!1});return l.jsx(fZ.Provider,{value:{scrollToListItem:f,scrollToLatestItem:m,refs:c,isScrollingRef:u,setContentHasMounted:a,contentHasMounted:o},children:e})});mZ.displayName="ScrollToThreadEntryProvider";const l6=()=>{const e=d.useContext(fZ);if(!e)throw new Error("useScrollToEntity must be used within ScrollToEntityContext");return e},c6=Ft("SearchPageContext",{activeMode:"default",setActiveMode:()=>{},activeEntryIdx:0,pinnedEntryIdx:-1,viewTitle:null,setViewTitle:()=>{},activeThreadTab:"default",setActiveThreadTab:()=>{},handleTabScrollBehavior:()=>{}}),kg=()=>{const e=d.useContext(c6);if(!e)throw new Error("useSearchPage must be used within an SearchPageProvider");return e},pZ=A.memo(({children:e})=>{const t=IIe(),n=dZ(),r=t()??"default",[s,o]=d.useState(r),a=d.useRef(void 0),[i,c]=d.useState(r),u=d.useCallback(C=>{o(C),c(C)},[]),[f,m]=d.useState(0),[p,h]=d.useState(-1),[g,y]=d.useState(null),{refs:x}=l6(),v=Rn(),{scrollContainerRef:b}=ka(),_=d.useCallback(C=>{if(b.current){if(s==="default"){const E=b.current.scrollTop;a.current=E}if(C==="default"){const E=a.current;E!==void 0&&requestAnimationFrame(()=>{b.current&&(b.current.scrollTop=E)})}else b.current.scrollTop=0}},[b,s]),w=d.useCallback(()=>{if(Object.keys(x).length===0||!b.current)return;const C=b.current.clientHeight,E=b.current.scrollTop;if(E===0){m(0),h(-1);return}const T=E+C/2;let k=f,I=-1,M=1/0;Object.entries(x).forEach(([N,D])=>{if(D.current){const j=D.current.getBoundingClientRect(),F=j.top+E+j.height/2,R=Math.abs(F-T);j.top<-100&&j.bottom>100&&(I=parseInt(N)),R{if(!b?.current)return;const C=b.current,E=px(w,50,{leading:!1,trailing:!0});return C.addEventListener("scroll",E),w(),()=>{C.removeEventListener("scroll",E),E.cancel()}},[w,b]),d.useEffect(()=>{y(null)},[v]);const S=d.useCallback(C=>{_(C),u(C),n(C)},[_,u,n]);return l.jsx(c6.Provider,{value:{activeMode:i,setActiveMode:c,activeEntryIdx:f,pinnedEntryIdx:p,viewTitle:g,setViewTitle:y,activeThreadTab:s,setActiveThreadTab:u,handleTabScrollBehavior:_},children:l.jsx(Dp,{value:s,onValueChange:S,children:e})})});pZ.displayName="SearchPageProvider";function OIe({entropyBrowser:e,isSidecar:t,scrollContainerRef:n}){const r=On(),s=d.useCallback(o=>{n.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:o})},[n]);d.useEffect(()=>{if(!(!e||!t))return e.subscribeQuickActionButtonFired(()=>{s("smooth")})},[e,t,s]),d.useEffect(()=>{setTimeout(s,0,"instant")},[r,t,s])}const LIe=({reason:e})=>{const{DEFAULT_SOURCES:t}=og({reason:e}),{setSources:n,setIsCopilot:r,gpt4Limit:s}=Vn(),o=mi(),{session:a}=Ne(),{trackEvent:i}=Xe(a),{lossAversionStatus:c,setLossAversionStatus:u,unsetLossAversion:f}=pz(),m=Wt(),{results:p,lastResult:h,firstResult:g}=on(),y=g?.author_id,x=g?.author_username,v=g?.context_uuid,b=g?.query_source,_=g?.sources?.sources,w=el(),S=fn(),C=d.useRef(!1),{pinnedEntryIdx:E,setViewTitle:T}=kg(),{formatMessage:k}=J(),{openVisitorLoginUpsell:I}=du({enabled:!m}),{scrollContainerRef:M}=ka(),N=un();return tje(),ZDe(),XDe(),OIe({scrollContainerRef:M,isSidecar:!0,entropyBrowser:N}),d.useEffect(()=>{const D=qt.isSourceListType(_)?_:[...t];n(D);const j=p.some(F=>qt.isCopilotMode(F))&&s.available;r(j)},[]),d.useEffect(()=>{if(!C.current&&o&&p.length>=1&&h&&qt.isStatusCompleted(h)&&y&&x){const D=S?.get("utm_source")??void 0;i("thread viewed",{authorId:y,authorUsername:x,isThreadCreator:!!w,contextUUID:v,viewSource:D}),v&&E_e({contextUUID:v,reason:e}),b==="perplexity_tasks"&&i("task thread viewed",{contextUUID:v}),C.current=!0}},[i,o,y,x,v,h,p.length,S,w,m,I,k,e,b]),d.useEffect(()=>{c!=="cooldown"&&(!m&&!c&&w?u("allowed"):w||f())},[m,c,w,u,f]),d.useEffect(()=>{T(E===-1?null:m7e(p[E]?.query_str)??"")},[E,T,p]),d.useEffect(()=>()=>{c==="allowed"&&f()},[]),null},FIe=e=>e?e.filter(t=>t.image_mode_block).flatMap(t=>t.image_mode_block.media_items??Pe):Pe,BIe=e=>e?e.filter(t=>t.video_mode_block).flatMap(t=>t.video_mode_block.media_items??Pe):Pe,UIe=e=>e?e.filter(t=>t.shopping_mode_block).flatMap(t=>t.shopping_mode_block.shopping_widgets??Pe):Pe,VIe=e=>e?e.filter(t=>t.jobs_mode_block).flatMap(t=>t.jobs_mode_block.jobs_blocks??Pe):Pe,HIe=e=>e?e.filter(t=>t.maps_mode_block).flatMap(t=>t.maps_mode_block.places??Pe):Pe,zIe=e=>{const t=(e??Pe).filter(a=>a.sources_mode_block).flatMap(a=>a.sources_mode_block),n=t.at(-1),r=new Set,s=[];for(const a of t)for(const i of a.web_results)r.has(i.url)||(s.push(i),r.add(i.url));const o=n?.result_count??0;return{count:Math.max(s.length,o),progress:n?.progress,results:s,rows:n?.rows}},u6=(e,{orderedByPriority:t=!1}={})=>{if(!e)return Pe;const n=e.filter(r=>r.plan_block?.steps).flatMap(r=>r.plan_block.steps).flatMap(r=>r.assets??Pe);return t?[...n].sort((r,s)=>r.is_primary_asset===s.is_primary_asset?0:r.is_primary_asset?-1:1):n},WIe=(e,t)=>{if(e){for(const n of e)if(n.plan_block?.steps){for(const r of n.plan_block.steps)if(r.assets){const s=r.assets.find(o=>o.uuid===t);if(s)return s}}}},hZ={[hs.ANSWER_MODE_TYPE_UNSPECIFIED]:{i18nKey:W({defaultMessage:"Unknown",id:"5jeq8PJZg7"}),id:es.default,mode:"default",show:!0},[hs.ANSWER]:{i18nKey:W({defaultMessage:"Answer",id:"DwjT1HpUgU"}),id:es.default,mode:"default",show:!0},[hs.SHOPPING]:{i18nKey:W({defaultMessage:"Shopping",id:"my1MLnIMoS"}),icon:B("shopping-cart"),id:es.shopping,mode:"shopping",show:!0},[hs.JOBS]:{i18nKey:W({defaultMessage:"Jobs",id:"9AcATFXaoo"}),icon:B("briefcase"),id:es.jobs,mode:"jobs",show:!0},[hs.HOTELS]:{i18nKey:W({defaultMessage:"Hotels",id:"+dqK4hw0if"}),icon:B("building"),id:es.hotels,mode:"hotels",show:!0},[hs.MAPS]:{i18nKey:W({defaultMessage:"Places",id:"QQInFSbbwr"}),icon:B("map-pin"),id:es.places,mode:"places",show:!0},[hs.IMAGE]:{i18nKey:W({defaultMessage:"Images",id:"Fip4H8CuWD"}),icon:B("photo"),id:es.images,mode:"images",show:!0},[hs.VIDEO]:{i18nKey:W({defaultMessage:"Videos",id:"4XfMuxy3FO"}),icon:B("movie"),id:es.videos,mode:"videos",show:!0},[hs.SOURCES]:{i18nKey:W({defaultMessage:"Links",id:"qCcwo3DU78"}),icon:B("world"),id:es.sources,mode:"sources",show:!0},[hs.ASSETS]:{i18nKey:W({defaultMessage:"Assets",id:"d1uESJO+TH"}),icon:B("stack-2"),id:es.assets,mode:"assets",show:!0},[hs.APPS]:{i18nKey:W({defaultMessage:"App",id:"2rUVsUf259"}),icon:B("layout-collage"),id:es.apps,mode:"apps",show:!1},[hs.SEARCH]:{i18nKey:W({defaultMessage:"Search",id:"xmcVZ0BU63"}),icon:B("search"),id:es.search,mode:"search",show:!1},[hs.CHAT]:{i18nKey:W({defaultMessage:"Chat",id:"WTrOy36sdu"}),icon:B("message"),id:es.chat,mode:"chat",show:!1}};(()=>{const e={};return Object.values(hZ).forEach(t=>{e[t.mode]=t}),e})();function GIe(e,t){return{...e.icon&&{icon:e.icon},id:e.id,mode:e.mode,text:t(e.i18nKey),show:e.show??!0}}function $Ie(e){const t=e.sourcesCount||e.attachmentsLength||0,n=e.sourcesProgress!==Jo.DONE&&!e.attachmentsLength;return{count:t,disabled:n}}const qIe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"always-show-brand-in-thread-tabs",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},KIe={ANSWER:"default",IMAGE:"images",VIDEO:"videos",SHOPPING:"shopping",MAPS:"places",SOURCES:"sources",JOBS:"jobs",HOTELS:"hotels",ASSETS:"assets",SEARCH:"search",CHAT:"chat",APPS:"apps"};function gZ(e){return KIe[e]??null}const aI=e=>Object.entries(es).find(([t,n])=>n===e)?.[0],YIe=(e,t)=>{const r=new URLSearchParams(t?.toString()).get(e.toString());if(r)return typeof r=="string"?aI(r):Array.isArray(r)?aI(r[0]):void 0},QIe=e=>e==="default",XIe=e=>Vi(e).with("default",()=>"default").with("shopping",()=>"default").with("jobs",()=>"full").with("hotels",()=>"full").with("places",()=>"full").with("images",()=>"full").with("videos",()=>"full").with("sources",()=>"default").with("assets",()=>"full").with("apps",()=>"full").with("search",()=>"default").otherwise(()=>"default"),hw=e=>({mode:e,width:XIe(e)}),ZIe=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],s=r?.[0];if(!s)continue;if(s.blocks?.find(i=>i.answer_tabs_block)?.answer_tabs_block?.modes?.some(i=>i.answer_mode_type?gZ(i.answer_mode_type)===t:!1))return[r]}return null},Bv=()=>{const{session:e}=Ne(),t=Ca(),{firstResult:n}=on(),r=n?.backend_uuid,s=n?.context_uuid,{device:{isWindowsApp:o}}=sn(),a=d.useCallback((i,c)=>{const u=Zm(o);Li({name:i,data:{entryUUID:r,threadUUID:s,...c,isPerplexityBrowser:t},source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[r,s,t,o,e?.user?.id,e?.user?.subscription_status]);return d.useMemo(()=>({trackEvent:a}),[a])},JIe={pendingClarifications:[],addClarification:()=>{},clearClarifications:()=>{},pendingSuggestions:[],addPendingSuggestion:()=>{},removePendingSuggestion:()=>{},clearPendingSuggestions:()=>{}},yZ=Ft("DeepResearchContext",JIe),ePe=({children:e})=>{const[t,n]=d.useState([]),[r,s]=d.useState([]),o=d.useCallback(m=>{n(p=>p.concat([m]))},[]),a=d.useCallback(()=>{n([])},[]),i=d.useCallback(m=>{s(p=>p.concat([m]))},[]),c=d.useCallback(m=>{s(p=>p.filter(h=>h.UUID!==m))},[]),u=d.useCallback(()=>{s([])},[]),f={pendingClarifications:t,clearClarifications:a,addClarification:o,pendingSuggestions:r,addPendingSuggestion:i,removePendingSuggestion:c,clearPendingSuggestions:u};return l.jsx(yZ.Provider,{value:f,children:e})},Uv=()=>{const e=d.useContext(yZ);if(!e)throw new Error("useDeepResearchState must be used within DeepResearchContext");return e};var Na={},iI;function tPe(){if(iI)return Na;iI=1;var e=Na&&Na.__values||function(s){var o=typeof Symbol=="function"&&s[Symbol.iterator],a=0;return o?o.call(s):{next:function(){return s&&a>=s.length&&(s=void 0),{value:s&&s[a++],done:!s}}}},t=Na&&Na.__read||function(s,o){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var i=a.call(s),c,u=[],f;try{for(;(o===void 0||o-- >0)&&!(c=i.next()).done;)u.push(c.value)}catch(m){f={error:m}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(f)throw f.error}}return u};Object.defineProperty(Na,"__esModule",{value:!0}),Na.selectState=function(s){return s};function n(){var s,o,a;function i(c){var u=0,f;function m(h){var g,y;s||(s={state:h,version:1}),s.state!==h&&(s.state=h,s.version+=1);var x=s.version,v;if(f){if(x===f.stateVersion)return f.value;var b=!1;try{for(var _=e(f.dependencies.entries()),w=_.next();!w.done;w=_.next()){var S=t(w.value,2),C=S[0],E=S[1];if(C(h)!==E){b=!0,v=C;break}}}catch(M){g={error:M}}finally{try{w&&!w.done&&(y=_.return)&&y.call(_)}finally{if(g)throw g.error}}if(!b)return f.value}u+=1;var T=new Map,k=Object.assign(function(M){if(T.has(M))return T.get(M);var N=M(h);return T.set(M,N),N},{reason:v}),I=a?a(function(){return c(k)},p,h,v):c(k);if(T.size===0)throw new Error("[rereselect] Selector malfunction: The selection logic must select some data by calling `query(selector)` at least once.");return f={stateVersion:x,dependencies:T,value:I},I}var p=Object.assign(function(g){return o?o(function(){return m(g)},p,g):m(g)},{selectionLogic:c,recomputations:function(){return u},resetRecomputations:function(){return u=0},introspect:function(){return f}});return p}return{makeSelector:i,setInvocationWrapper:function(c){o=c},setComputationWrapper:function(c){a=c}}}Na.createSelectionContext=n;var r=n();return Na.makeSelector=r.makeSelector,Na}var et=tPe();const xZ=Pe,nPe=(e,t)=>{if(!e)return;const n=e.filter(r=>r.plan_block&&r.intended_usage=="plan").map(r=>r.plan_block);if(n&&n.length>0){const r=[];let s=!1;for(const o of n){for(const a of o?.goals??[])if(a.description!==null)if(r.length==0||r[r.length-1]?.final)r.push({...a});else{const i=r[r.length-1];i&&(i.description+=a.description,i.final=a.final)}o?.final&&(s=!0)}if(r.length>0)return{goals:r,final:s,channel_uuid:"",comprehensive_mode:!1}}return t},rPe=e=>e.blocks??Pe,sPe=e=>{const t=e.filter(s=>s.plan_block&&s.intended_usage=="pro_search_steps").map(s=>s.plan_block),n={};for(let s=0;sn[s.steps[0]?.uuid??""]===o).map(s=>s.steps.map(o=>({step_type:o.step_type,uuid:o.uuid??"",content:o?.initial_query_content??o?.attachment_content??o?.terminate_content??o?.search_web_content??o?.web_results_content??o?.code_content??o?.table_status_content??o?.entropy_request_content??o?.thought_content??o?.browser_search_content??o?.browser_open_tab_content??o?.browser_open_tab_results_content??o?.url_navigate_content??o?.browser_get_site_content_content??o?.user_clarification_content??o?.browser_get_history_summary_content??o?.browser_get_open_tab_content_content??o?.read_calendar_content??o?.read_calendar_response_content??o?.read_email_content??o?.read_email_response_content??o?.update_calendar_content??o?.generate_image_content??o?.generate_image_results_content??o?.generate_video_content??o?.generate_video_results_content??o?.search_tabs_content??o?.search_tabs_results_content??o?.create_app_results_content??o?.browser_close_tabs_content??o?.browser_close_tabs_results_content??o?.update_calendar_response_content??o?.browser_group_tabs_content??o?.browser_group_tabs_results_content??o?.create_chart_content??o?.get_url_content_content??o?.create_client_app_content??o?.get_user_info_content??o?.get_user_info_response_content??o?.get_free_busy_content??o?.get_free_busy_response_content??o?.send_email_content??o?.send_email_response_content??o?.browser_ungroup_content??o?.browser_search_tab_groups_content??o?.browser_search_tab_groups_result_content??o?.search_browser_content??o?.search_browser_results_content??o?.clarifying_questions_content??o?.clarifying_questions_output_content??o?.email_calendar_agent_content??o?.email_calendar_agent_response_content??o?.mcp_tool_input_content??o?.mcp_tool_output_content??o?.research_clarifying_questions_content??o?.create_tasks_content??o?.create_tasks_response_content??o?.flights_search_content??o?.flights_booking_content??o?.flights_search_response_content??o?.flights_booking_response_content??o?.flights_agent_content??o?.canvas_agent_content??o?.comet_agent_tool_input_content??o?.comet_agent_tool_output_content??{},assets:o.assets}))).flat()},oPe=e=>e?.filter(t=>t.reasoning_plan_block&&t.intended_usage==="reasoning_plan").map(t=>t.reasoning_plan_block),aPe=e=>{let t=!1;if(e&&e.length>0){const n=new Map;for(const o of e){if(o.goals){for(const a of o.goals)if(a.id)if(n.has(a.id)){const i=n.get(a.id);i.description+=a.description,n.set(a.id,i)}else n.set(a.id,{...a})}t=o.progress==="DONE"}const r=Array.from(n.values()),s=e.flatMap(o=>o.web_results??Pe);return{goals:r,web_results:s,final:t}}};function iPe(e){const t={},n=[];return e?.forEach(r=>{if(r.widget_block){const s=t[r.intended_usage]??n.length;t[r.intended_usage]=s,n[s]=C2e(n[s],r.widget_block)}}),n}function lPe(e){return(e?.filter(t=>t.media_block).flatMap(t=>t.media_block.media_items)??[]).filter(t=>!t.sponsored_uuid)}function cPe(e){return e?.filter(t=>t.media_block).flatMap(t=>t.media_block.generated_media_items)??[]}function uPe(e=Pe){return e.reduce((t,n)=>{if(n.is_code_interpreter&&n.is_image)t.codeInterpreterImages.push(n);else{const r=n.meta_data?.source==="quartr"?{...n,snippet:""}:n;t.webResultsStandard.push(r)}return t},{webResultsStandard:[],codeInterpreterImages:[]})}function dPe(e){return e?.flatMap(t=>t.inline_entity_block?.knowledge_card_block?t.inline_entity_block.knowledge_card_block.knowledge_cards:t.knowledge_card_block?t.knowledge_card_block.knowledge_cards:[])??[]}function fPe(e){return e??Pe}function mPe(e){return e?.filter(t=>t.citation_block).flatMap(t=>t.citation_block.citations)??Pe}function pPe(e){const t=e?.find(r=>r?.widget_block?.finance_widget_block&&r.intended_usage==="finance_widget")?.widget_block?.finance_widget_block;return t===void 0?void 0:{object:"FinanceWidget",data:t.data_json.map(r=>JSON.parse(r)),data_v2:t?.data_json_v2?.map(r=>JSON.parse(r))}}function hPe(e){const t=e?.map(s=>s.widget_block)?.find(s=>s?.widget_type==="sports");if(!t?.sports_widget_block?.data)return;const r=t.sports_widget_block.data;switch(r.object){case"SportsEventsWidget":return r;case"SportsIndvScheduleWidget":return r;case"SportsStandingsWidget":return r;case"SportsIndvEventsWidget":return r;default:return}}function gPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.price_comparison_widget_block);if(!(!t||!t.widget_block?.price_comparison_widget_block))return{object:"PriceComparisonWidget",...t.widget_block.price_comparison_widget_block}}function yPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="WeatherWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function xPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="TimeWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function vPe(e){if(!e)return;const t=e?.find(r=>r.widget_block?.search_result_widget_block?.metadata?.object==="TimerWidget");return!t||!t.widget_block?.search_result_widget_block?void 0:t.widget_block.search_result_widget_block.metadata}function bPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="CalculatorWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function _Pe(e,t){return e&&e.length>0?e.map(n=>({name:n.widget_type||"",url:"",snippet:"",timestamp:"",meta_data:{object:n.widget_type||"unknown",...n},is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""})):t||[]}function wPe(e){const t=e.find(r=>r?.meta_data?.object==="TableWidget");return t?t.meta_data.search_results:Pe}function CPe(e){return e.filter(t=>xZ.includes(t?.meta_data?.object))}function SPe(e){return e.filter(t=>!xZ.includes(t?.meta_data?.object))}function EPe(e){const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="TaskWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function kPe(e){if(!e)return;const t=e?.map(n=>n.widget_block)?.find(n=>n?.widget_type==="flight_status");if(t?.flight_status_widget_block?.data)return t.flight_status_widget_block}function MPe(e){if(!e)return;const t=e?.map(n=>n.widget_block)?.find(n=>n?.widget_type==="news");if(t?.news_widget_block?.web_results)return{object:"NewsWidget",web_results:t.news_widget_block.web_results}}function TPe(e){if(!e)return;const t=e?.find(r=>r.widget_block?.search_result_widget_block?.metadata?.object==="CurrencyExchangeWidget");return!t||!t.widget_block?.search_result_widget_block?void 0:t.widget_block.search_result_widget_block.metadata}function APe(e){const t=e?.find(s=>s.widget_block?.prediction_market_widget_block&&s.intended_usage==="prediction_market_widget");if(!t||!t.widget_block?.prediction_market_widget_block)return;const n=t.widget_block.prediction_market_widget_block;return n===void 0||!n?.data_json?void 0:{object:"PredictionMarketWidget",data:JSON.parse(n.data_json)}}function NPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="GenericFallbackWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function RPe(e){if(!e?.length)return[];const t=[];return e.forEach(n=>{n.intended_usage==="pro_search_steps"&&n.plan_block?.steps&&n.plan_block.steps.forEach(r=>{r.clarifying_questions_output_content?.clarification&&t.push(r.clarifying_questions_output_content.clarification)})}),t}function DPe(e){return e?e.find(n=>n.intended_usage==="refinement_filters")?.refinement_filters_block:void 0}function jPe(e){return e?e.find(n=>n.inline_entity_block?.maps_preview_block&&n.intended_usage==="answer_maps_preview")?.inline_entity_block?.maps_preview_block:void 0}function IPe(e){return e.blocks?.some(t=>t.intended_usage==="ask_text")??!1}function PPe(e,t,n=[]){return t===ie.DEFAULT||n.length>0&&n[n.length-1]?.step_type==="FINAL"||e?.some(s=>s.markdown_block||s.entity_list_block||KH(s.entity_group_block)||YH(s.inline_entity_block))}const Vv=e=>{let t;if("meta_data"in e?t=e.meta_data:t=Vi(e).with({place_widget_block:ed.nonNullable},n=>({...n.place_widget_block,object:"PlaceWidget"})).with({shopping_widget_block:ed.nonNullable},n=>({...n.shopping_widget_block,progress:Jo.DONE,object:"ShopifyWidget"})).with({price_comparison_widget_block:ed.nonNullable},n=>({...n.price_comparison_widget_block,object:"PriceComparisonWidget"})).with({search_result_widget_block:ed.nonNullable},n=>{const r=n.search_result_widget_block.metadata||{},s=r.object;if(s==="WeatherWidget")return{...r,progress:Jo.DONE,object:"WeatherWidget"};if(s==="TimeWidget")return{...r,progress:Jo.DONE,object:"TimeWidget"};if(s==="CalculatorWidget")return{...r,progress:Jo.DONE,object:"CalculatorWidget"};if(s==="TaskWidget")return{...r,progress:Jo.DONE,object:"TaskWidget"};if(s==="TimerWidget")return{...r,progress:Jo.DONE,object:"TimerWidget"};if(s==="CurrencyExchangeWidget")return{...r,progress:Jo.DONE,object:"CurrencyExchangeWidget"};if(s==="GenericFallbackWidget")return{...r,progress:Jo.DONE,object:"GenericFallbackWidget"};if(s==="PredictionMarketWidget")return{...r,progress:Jo.DONE,object:"PredictionMarketWidget"}}).otherwise(()=>{}),!!t)return t},OPe=(e,t)=>e.concat(t).reduce((r,s)=>{const o=Vv(s);if(!o)return r;const a=o.object;return(a==="ShopifyWidget"||a==="PlaceWidget")&&(r[a]||(r[a]=[]),r[a].push(s)),r},{}),_r=e=>e.result,Dn=et.makeSelector(e=>rPe(e(_r))),LPe=et.makeSelector(e=>{const t=e(Dn),n={};return t.forEach(r=>{r.intended_usage&&(n[r.intended_usage]=r)}),n}),FPe=et.makeSelector(e=>e(_r).mode),vZ=et.makeSelector(e=>e(_r).display_model),BPe=et.makeSelector(e=>!!e(_r).is_pro_reasoning_mode),UPe=et.makeSelector(e=>e(_r).search_implementation_mode),d6=et.makeSelector(e=>qt.isStatusFailed(e(_r))),bZ=et.makeSelector(e=>qt.isStatusPending(e(_r))),VPe=et.makeSelector(e=>qt.isStatusBlocked(e(_r))),HPe=et.makeSelector(e=>e(_r).plan),_Z=et.makeSelector(e=>e(_r).widget_data??Pe),Hv=et.makeSelector(e=>qt.parseAskTextField(e(_r))??void 0),wZ=et.makeSelector(e=>qt.isStatusPending(e(_r))),zPe=et.makeSelector(e=>IPe(e(_r))),CZ=et.makeSelector(e=>e(_r).expect_search_results),f6=et.makeSelector(e=>{const t=e(Hv),n=qt.isStatusCompleted(e(_r));return t?qt.hasAnswer(t,n):!1}),SZ=et.makeSelector(e=>e(AZ).length>0),Sh=et.makeSelector(e=>sPe(e(Dn))),EZ=et.makeSelector(e=>nPe(e(Dn),e(HPe))),WPe=et.makeSelector(e=>oPe(e(Dn))),kZ=et.makeSelector(e=>aPe(e(WPe))),MZ=et.makeSelector(e=>an(e(vZ))),GPe=et.makeSelector(e=>{const t=e(MZ),n=e(_r),r=qt.parseStructuredAnswerBlocks(n);return r!==null&&r.some(s=>s.intended_usage==="answer_generated_image"||s.intended_usage==="answer_generated_video")&&!r.some(s=>!!s.markdown_block?.answer||!!s.markdown_block?.chunks)&&t===oe.SEARCH}),TZ=et.makeSelector(e=>iPe(e(Dn))),AZ=et.makeSelector(e=>uPe(e(Hv)?.web_results).webResultsStandard),NZ=et.makeSelector(e=>yPe(e(Dn))),RZ=et.makeSelector(e=>xPe(e(Dn))),DZ=et.makeSelector(e=>vPe(e(Dn))),jZ=et.makeSelector(e=>TPe(e(Dn))),IZ=et.makeSelector(e=>APe(e(Dn))),PZ=et.makeSelector(e=>NPe(e(Dn))),OZ=et.makeSelector(e=>bPe(e(Dn))),LZ=et.makeSelector(e=>kPe(e(Dn))),m6=et.makeSelector(e=>MPe(e(Dn))),zv=et.makeSelector(e=>_Pe(e(TZ),e(_Z))),$Pe=et.makeSelector(e=>PPe(e(Dn),e(vZ),e(Sh))),qPe=et.makeSelector(e=>e(Hv)?.answer==="Answer skipped."||e(Dn).some(t=>t.markdown_block?.answer==="Answer skipped.")),KPe=et.makeSelector(e=>e(FPe)===xd.COPILOT||e(Sh)!=null&&e(Sh).length>0),YPe=et.makeSelector(e=>e(d6)?Pe:lPe(e(Dn))),QPe=et.makeSelector(e=>e(d6)?Pe:cPe(e(Dn))),XPe=et.makeSelector(e=>e(_r).attachment_processing_progress??Pe),ZPe=et.makeSelector(e=>!!e(XPe).length),FZ=et.makeSelector(e=>e(_r).search_focus==="writing"),BZ=et.makeSelector(e=>{const t=e(wZ),n=e(CZ),r=e(FZ);return!!t&&n!=="false"&&!r}),JPe=et.makeSelector(e=>{const t=e(SZ),n=e(BZ);return t||n}),eOe=et.makeSelector(e=>!e(f6)),tOe=et.makeSelector(e=>{const t=e(bZ),n=e(f6);return t&&!n}),nOe=et.makeSelector(e=>{const t=e(EZ),n=e(kZ),r=t?.goals&&t.goals.length>0||n?.goals&&n.goals.length>0,o=e(Sh).some(a=>a.step_type==="SEARCH_RESULTS");return r||o}),rOe=et.makeSelector(e=>dPe(e(Dn))),sOe=et.makeSelector(e=>fPe(e(_r).related_query_items)),oOe=et.makeSelector(e=>mPe(e(Dn))),UZ=et.makeSelector(e=>pPe(e(Dn))),VZ=et.makeSelector(e=>hPe(e(Dn))),HZ=et.makeSelector(e=>gPe(e(Dn))),zZ=et.makeSelector(e=>wPe(e(zv))),aOe=et.makeSelector(e=>CPe(e(zv))),iOe=et.makeSelector(e=>SPe(e(zv))),lOe=et.makeSelector(e=>OPe(e(zv),e(TZ))),cOe=et.makeSelector(e=>[...e(AZ),...e(zZ)]),uOe=et.makeSelector(e=>EPe(e(Dn))),WZ=et.makeSelector(e=>!!e(m6)?.web_results?.length),GZ=et.makeSelector(e=>{const t=e(VZ),n=e(UZ),r=e(NZ),s=e(RZ),o=e(OZ),a=e(LZ),i=e(DZ),c=e(jZ),u=e(IZ),f=e(HZ),m=e(PZ),p=e(m6);return!!(t||n||r||s||o||a||i||c||u||f||m||p)}),dOe=et.makeSelector(e=>{const t=e(GZ),n=e(WZ);return!t||n}),fOe=et.makeSelector(e=>RPe(e(Dn))),mOe=et.makeSelector(e=>DPe(e(Dn))),pOe=et.makeSelector(e=>jPe(e(Dn))),$Z=et.makeSelector(e=>e(_r).classifier_results),hOe=et.makeSelector(e=>{const t=e($Z);return t!==void 0&&Object.keys(t).length>0}),gOe=et.makeSelector(e=>{const t=e($Z);return t?.skip_search||t?.mhe_predictions?.skip_search||!1}),qZ=e=>{const{idx:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:c=[]}=e,u=fOe(e),f=n.backend_uuid?c.filter(h=>h.entryUUID===n.backend_uuid).map(h=>h.content):[],m=Array.from(new Set([...u,...f])),p=mOe(e);return{idx:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,isPending:bZ(e),isBlocked:VPe(e),isFinalStep:$Pe(e),isFailed:d6(e),isProReasoningMode:BPe(e),widgetData:_Z(e),response:Hv(e),isEntryInFlight:wZ(e),hasLLMToken:zPe(e),isAnswerSkipped:qPe(e),expectWebResults:CZ(e),steps:Sh(e),researchPlan:EZ(e),reasoningPlan:kZ(e),searchMode:MZ(e),searchImplementationMode:UPe(e),hasMediaOnlyLayout:GPe(e),hasAnswer:f6(e),hasWebResults:SZ(e),weatherWidgetData:NZ(e),timeWidgetData:RZ(e),timerWidgetData:DZ(e),calculatorWidgetData:OZ(e),currencyExchangeWidgetData:jZ(e),predictionMarketWidgetData:IZ(e),flightStatusWidgetData:LZ(e),genericFallbackWidgetData:PZ(e),isCopilot:KPe(e),mediaItems:YPe(e),generatedMediaItems:QPe(e),hasPendingFiles:ZPe(e),isAgentWorkflowInFlight:eOe(e),knowledgeCards:rOe(e),relatedQueryItems:sOe(e),webResultCitations:oOe(e),financeWidgetData:UZ(e),newsWidgetData:m6(e),sportsWidgetData:VZ(e),priceComparisonWidgetData:HZ(e),tableWebResults:zZ(e),highPriorityWidgets:aOe(e),lowPriorityWidgets:iOe(e),groupedEntityWidgets:lOe(e),webResults:cOe(e),taskWidgetData:uOe(e),hasFastWidget:GZ(e),hasNewsWidget:WZ(e),shouldShowMediaPreview:dOe(e),userClarifications:m,refinementFiltersData:p,selectedFilterIds:p?.selected_filter_ids??[],focusIsWriting:FZ(e),expectSearchResults:BZ(e),hasSources:JPe(e),blocksByIntendedUsage:LPe(e),mapsPreviewData:pOe(e),hasClassifierResults:hOe(e),isChatQuery:gOe(e),hasAnyAgentSteps:nOe(e),isProcessingQuery:tOe(e)}},yOe=e=>Xi()((n,r)=>({isStatusUpdaterOpen:!1,wasStatusUpdaterManuallyOpened:!1,selectedRefinementQuery:null,skippedSources:new Set([]),...qZ(e),actions:{setSelectedRefinementQuery:s=>n({selectedRefinementQuery:s}),setSelectedFilterIds:s=>n({selectedFilterIds:s}),addSkippedSource:s=>{const o=r().skippedSources,a=new Set(o);a.add(s),n({skippedSources:a})},removeSkippedSource:s=>{const o=r().skippedSources,a=new Set(o);a.delete(s),n({skippedSources:a})}}})),{Context:xOe,useTrackedState:vOe}=s4("ThreadEntryContext"),p6=A.memo(({idx:e,children:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i})=>{const c=d.useRef(r),{trackEvent:u}=Bv(),{pendingClarifications:f}=Uv(),[m]=d.useState(()=>yOe({idx:e,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:f})),h=m(g=>g.isFinalStep);return d.useEffect(()=>{const g=()=>{const v=setTimeout(()=>{u("engaged",{})},1e4);return()=>{clearTimeout(v)}},y=o&&s,x=c.current&&!r;if(y&&x&&h)return g();c.current=r},[r,h,s,o,u]),d.useEffect(()=>{m.setState(qZ({idx:e,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:f}))},[e,n,r,s,o,a,i,f,m]),l.jsx(xOe.Provider,{value:m,children:t})});p6.displayName="ThreadEntryProvider";const It=vOe;function Mg(){const{result:{frontend_uuid:e,frontend_context_uuid:t}}=It(),n=c4(),r=n(e??"")??n(t);return d.useCallback((s,o)=>r?.addTiming(s,o),[r])}function h6(){const{result:{frontend_uuid:e,frontend_context_uuid:t}}=It(),n=c4(),r=n(e??"")??n(t);return d.useCallback((s,o)=>r?.addTimingOnce(s,o),[r])}const bOe=({idx:e,searchParams:t,blocks:n})=>Xi()((r,s)=>({answerModeActionList:[],currentModeData:hw(YIe(e,t)??"default"),...YZ(n),actions:{updateCurrentMode:o=>{const a=s(),i=a.defaultModeOverride&&o==="default"?a.defaultModeOverride:o;r({currentModeData:hw(i)})},setOverrideMode:o=>{const a=o;r({defaultModeOverride:a,currentModeData:hw(a??"default")})}}})),{Context:_Oe,useTrackedState:wOe}=s4("AnswerModeContext"),KZ=Ft("AnswerModeApiContext",void 0),COe=({children:e,scrollToListItem:t})=>{const{setActiveMode:n,activeEntryIdx:r,activeThreadTab:s}=kg(),{idx:o,result:{backend_uuid:a,context_uuid:i},isLastResult:c}=It(),{actions:{updateCurrentMode:u,setOverrideMode:f},currentModeData:m}=g6(),{session:p}=Ne(),{trackEvent:h}=Xe(p),g=d.useCallback(x=>{x!==m.mode&&(u(x),r===o&&n(x),requestAnimationFrame(()=>{t(o,{smooth:!0})}),h("answer mode tab selected",{answerMode:x,entryUUID:a,contextUUID:i}))},[m.mode,o,u,r,h,a,i,n,t]);d.useEffect(()=>{r===o&&n(m.mode)},[r,o,n,m.mode]),d.useEffect(()=>{c&&s&&s!==m.mode&&u(s)},[c,s,m.mode,u]);const y=d.useMemo(()=>({updateCurrentMode:v=>{g(v)},setOverrideMode:f}),[g,f]);return l.jsx(KZ.Provider,{value:y,children:e})};function YZ(e){const t=FIe(e),n=BIe(e),r=UIe(e),s=VIe(e),o=HIe(e),a=zIe(e),i=u6(e,{orderedByPriority:!0});return{images:t,videos:n,shopping:r,jobs:s,places:o,sources:a,assets:i}}const QZ=A.memo(({children:e,scrollToListItem:t})=>{const{$t:n}=J(),r=fn(),{idx:s,searchMode:o,result:{answer_modes:a,blocks:i,attachments:c}}=It(),u=Ca(),[f]=d.useState(()=>bOe({idx:s,searchParams:r,blocks:i}));d.useEffect(()=>{i||Z.error("No blocks found for entry",i)},[i]),d.useEffect(()=>{const v=f.getState(),{images:b,videos:_,shopping:w,jobs:S,places:C,sources:E,assets:T}=YZ(i),k=Cr(v.images,b)?v.images:b,I=Cr(v.videos,_)?v.videos:_,M=Cr(v.shopping,w)?v.shopping:w,N=Cr(v.jobs,S)?v.jobs:S,D=Cr(v.places,C)?v.places:C,j=Cr(v.sources,E)?v.sources:E,F=Cr(v.assets,T)?v.assets:T;(k!==v.images||I!==v.videos||M!==v.shopping||N!==v.jobs||D!==v.places||j!==v.sources||F!==v.assets)&&f.setState({images:k,videos:I,shopping:M,jobs:N,places:D,sources:j,assets:F})},[i,f]);const m=d.useMemo(()=>Object.fromEntries(Object.entries(hZ).map(([v,b])=>[v,GIe(b,n)])),[n]),p=f.getState().sources,h=d.useMemo(()=>{const{count:v,disabled:b}=$Ie({sourcesCount:p.count,sourcesProgress:p.progress,attachmentsLength:c?.length||0});return{...m,[hs.SOURCES]:{...m[hs.SOURCES],count:v,disabled:b}}},[m,p.count,p.progress,c?.length]),{variation:g}=qIe(!1),y=d.useMemo(()=>n(u?{defaultMessage:"Assistant",id:"wSAvhubuX6"}:g?{defaultMessage:"Perplexity",id:"KCWNcPqV2E"}:{defaultMessage:"Answer",id:"DwjT1HpUgU"}),[n,g,u]),x=d.useMemo(()=>u?gM:B("align-justified"),[u]);return d.useEffect(()=>{const v=a?.map(w=>{if(!gZ(w.answer_mode_type))return Z.warn("Unsupported Answer Mode",{mode:w.answer_mode_type.valueOf()}),null;const C=h[w.answer_mode_type];return C||(Z.warn("Missing mode action mapping",{mode:w.answer_mode_type.valueOf()}),null)}).filter(w=>!!w),b=[{text:y,icon:x,id:"d",mode:"default"},...(v??[]).filter(w=>w.show===void 0||w.show===!0)],_=f.getState();Cr(_.answerModeActionList,b)||f.setState({answerModeActionList:b})},[n,a,h,o,u,y,x,f]),l.jsx(_Oe.Provider,{value:f,children:l.jsx(COe,{scrollToListItem:t,children:e})})});QZ.displayName="AnswerModeProvider";const g6=wOe,SOe=()=>{const e=d.useContext(KZ);if(!e)throw new Error("useAnswerModeApi must be used within an AnswerModeProvider");return e},EOe=e=>{try{return JSON.parse(e)}catch{return null}},XZ=A.memo(({title:e,description:t,className:n="",role:r,retryFn:s,...o})=>{const{$t:a}=J(),i=a({defaultMessage:"Please try again later.",id:"EjH+J3uOTD"}),c=d.useMemo(()=>EOe(t??""),[t]);return c&&(console.warn("Tried to pass a JSON error description"),console.warn(c)),l.jsxs("div",{className:`gap-md bg-caution py-sm px-md mt-4 flex items-center rounded-lg text-left font-sans text-white ${n}`,role:"alert",...o,children:[l.jsx(ge,{icon:B("alert-circle")}),l.jsxs("div",{className:"flex grow flex-col",children:[l.jsx("p",{className:"font-medium",children:e||a({defaultMessage:"Sorry, something went wrong",id:"E2YPKR25ob"})}),l.jsx("p",{children:c?i:t})]}),s&&l.jsx(st,{noXPadding:!0,text:a({defaultMessage:"Try again",id:"FazwRldA7z"}),onClick:s,textClassName:"text-white"})]})});XZ.displayName="ErrorComponent";const Kf=A.memo(({fullWidth:e,retryFn:t,className:n,errorCode:r})=>{const{$t:s}=J(),o=d.useCallback(()=>{hx("error retry")},[]),a=(()=>{switch(r){case"FETCHER_SSE_OFFLINE_ERROR":case"FETCHER_SSE_NO_STATUS_CODE_ERROR":return s({defaultMessage:"Unstable internet, check your connection",id:"vbFcV2WAsH"});default:return s({defaultMessage:"Sorry, something went wrong",id:"E2YPKR25ob"})}})();return l.jsx("div",{className:z("max-w-threadContentWidth mx-auto",{"w-full":e},n),children:l.jsx(XZ,{className:z("mx-md md:mx-0",{"bg-super":r==="FETCHER_SSE_OFFLINE_ERROR"}),title:a,retryFn:t??o})})});Kf.displayName="ErrorFallback";const ja=d.memo(({children:e,id:t})=>{const n=d.useMemo(()=>()=>l.jsx("div",{className:"isolate mx-auto max-w-threadContentWidth",children:l.jsx(Kf,{})}),[]);return l.jsx(Mr,{fallback:n,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(Dp.Panel,{value:t,children:e})})});ja.displayName="AnswerModeContainer";const br=({children:e,className:t,as:n="div",active:r=!0,speed:s="normal",hoverOnly:o=!1,variant:a="default"})=>{const[i,c]=d.useState(!1),u=o?i:r;return A.createElement(n,{style:{animationDuration:s==="normal"?"1200ms":"1800ms"},className:z({shimmer:u&&a==="default","animate-gradient bg-clip-text text-transparent shimmer-super":u&&a==="super"},t),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e)},ZZ=d.memo(()=>l.jsxs(br,{className:"gap-md flex flex-col",children:[l.jsx(gy,{}),l.jsx(gy,{}),l.jsx(gy,{})]}));ZZ.displayName="AnswerModeLoader";const gy=d.memo(()=>l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(K,{variant:"subtler",className:"size-32 shrink-0 rounded-md"}),l.jsxs("div",{className:"gap-sm flex w-full flex-col",children:[l.jsx(K,{variant:"subtler",className:"h-4 w-full rounded-full"}),l.jsx(K,{variant:"subtler",className:"h-4 w-2/3 rounded-full"})]})]}));gy.displayName="Item";const kOe=({maxHeightPx:e})=>{const[t,n]=d.useState(null),[r,s]=d.useState(!1),[o,a]=d.useState(!1),[i,c]=d.useState(0),u=d.useCallback(f=>{n(f),f&&a(!1)},[]);return d.useLayoutEffect(()=>{if(!t||typeof window>"u")return;const f=new ResizeObserver(m=>{for(const p of m){const h=p.target.scrollHeight;a(!0),c(h),s(h>e)}});return f.observe(t),()=>{f.disconnect()}},[t,e]),d.useMemo(()=>({ref:u,isTruncated:r,hasMeasured:o,scrollHeight:i}),[r,o,i,u])},MOe=({maxHeight:e,children:t,buttonLabels:n,buttonTestId:r,className:s})=>{const[o,a]=d.useState(!1),{ref:i,isTruncated:c,hasMeasured:u,scrollHeight:f}=kOe({maxHeightPx:e}),m=d.useCallback(()=>{a(v=>!v)},[]),p=Zl(u),h=u&&p,g=d.useMemo(()=>u?{height:c&&!o?e:f,transition:h?"height 200ms cubic-bezier(0.16, 1, 0.3, 1)":"none",overflow:"hidden"}:{maxHeight:e,transition:"none",overflow:"hidden"},[u,c,o,f,h,e]),y=u&&c&&!o,x=d.useMemo(()=>({maskImage:y?"linear-gradient(to bottom, black 70%, transparent 97%)":void 0}),[y]);return l.jsxs("div",{className:s,children:[l.jsx("div",{style:x,children:l.jsx("div",{style:g,children:l.jsx("div",{ref:i,children:t})})}),c&&l.jsx("div",{className:z("top-xs relative flex",{"-mt-2":!o}),children:l.jsx("div",{className:"-mt-0.5","data-testid":r,children:l.jsx(wt,{size:"tiny",variant:"text",onClick:m,trailingIcon:o?B("chevron-up"):B("chevron-down"),children:o?n.showLess:n.showMore})})})]})},TOe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"enable-share-prompts",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function AOe({entryUUID:e,reason:t,callback:n}){const[r,s]=d.useState(!1),o=d.useRef(!1),{inFlight:a}=on();return d.useEffect(()=>{!a&&o.current&&(o.current=!1,s(!1),n())},[a,n]),{terminateEntry:()=>{o.current=!0,s(!0),au({entryUUID:e,reason:t})},isTerminating:r}}const JZ=d.memo(({children:e,className:t,hasAttachments:n})=>l.jsx("div",{className:z("flex min-w-[48px] items-center justify-center","bg-offset text-foreground rounded-2xl p-3 font-sans text-base font-normal select-none",{"rounded-br-none":n},t),children:l.jsx("span",{className:"select-text",style:{overflowWrap:"anywhere"},children:e})}));JZ.displayName="ChatBubble";const NOe={maskImage:"linear-gradient(to bottom, black 50%, transparent)"};function ROe({entryUUID:e,displayQueryStr:t,inFlight:n,onSubmitEdit:r}){const[s,o]=d.useState(t??""),[a,i]=d.useState(!1),{trackEvent:c}=Bv(),u=el(),{updateCurrentMode:f}=SOe();d.useEffect(()=>{n&&i(!1)},[n]);const m=d.useCallback(()=>{s!==t&&r(s),i(!1),f("default")},[s,t,r,f]),{terminateEntry:p,isTerminating:h}=AOe({entryUUID:e,reason:"editable-thread-title",callback:m}),g=d.useCallback(()=>{u&&p()},[u,p]),y=d.useCallback(()=>{u&&(c("confirm edit query click",{entryUUID:e,newQuery:s}),m())},[u,e,m,c,s]),x=d.useCallback(()=>{n?g():y()},[n,g,y]),v=d.useCallback(()=>{o(t??""),i(!1),c("cancel edit query click",{entryUUID:e})},[e,t,c]),b=d.useCallback(()=>{o(t??""),i(!0)},[t]),_=!!u;return d.useMemo(()=>({handleEditButtonClick:b,handleCancelEditQuery:v,handleConfirmEditQuery:x,isTerminating:h,canEdit:_,editQueryValue:s,setEditQueryValue:o,isEditingQuery:a}),[b,v,x,h,_,s,a])}function DOe({entryUUID:e,displayQueryStr:t}){const{$t:n}=J(),{trackEvent:r}=Bv(),{openToast:s}=hn(),[o,a]=d.useState(!1),{variation:i}=TOe(!1),c=i&&!1,u=d.useCallback(f=>{f.preventDefault(),navigator.clipboard.writeText(t??""),a(!0),setTimeout(()=>a(!1),2e3),r("click copy query button",{entryUUID:e})},[t,c,s,n,r,e]);return d.useMemo(()=>({handleCopyButtonClick:u,showCopyCheckmark:o}),[u,o])}const eJ=d.memo(({entryUUID:e,onSubmitEdit:t,isFirstResult:n,hasAttachments:r,inFlight:s,isFailed:o,isEditDisabled:a,selectedRefinementQuery:i,queryStr:c})=>{const u=d.useRef(null);Rf("thread-title",{skip:!n});const f=i??c,{quote:m,actualQuery:p}=qx(f),{handleEditButtonClick:h,handleCancelEditQuery:g,handleConfirmEditQuery:y,isTerminating:x,canEdit:v,editQueryValue:b,setEditQueryValue:_,isEditingQuery:w}=ROe({entryUUID:e,displayQueryStr:p,inFlight:s,onSubmitEdit:t}),{handleCopyButtonClick:S,showCopyCheckmark:C}=DOe({entryUUID:e,displayQueryStr:f}),E=d.useCallback(T=>{Ls.isEnterKeyWithoutShift(T)?(T.preventDefault(),y()):Ls.isEscapeKey(T)&&g()},[y,g]);return l.jsxs("div",{className:"relative z-10",children:[m&&l.jsx(tJ,{quote:m}),l.jsxs("div",{className:"group relative flex items-end gap-0.5",children:[l.jsx("div",{className:"-inset-md pointer-events-none absolute select-none"}),l.jsx("div",{className:"relative min-w-0 flex-1 flex justify-end",children:w?l.jsx(IOe,{onKeyDown:E,editQueryValue:b,setEditQueryValue:_,inputRef:u}):l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(nJ,{showActions:v,isEditButtonDisabled:a,showCopyCheckmark:C,onEditClick:h,onCopyClick:S}),l.jsx(iJ,{hasAttachments:r,queryString:p??"",isFirstResult:n,isFailed:o})]})})]}),w&&l.jsx(rJ,{style:NOe,isTerminating:x,onCancel:g,onConfirm:y})]})});eJ.displayName="EditableThreadTitle";const tJ=d.memo(({quote:e})=>l.jsx("div",{className:"mb-sm flex justify-end",children:l.jsxs(V,{variant:"small",color:"light",className:"bg-offset rounded-2xl py-sm px-3 inline-flex items-center",children:[l.jsx(ut,{name:B("quote"),size:18,className:"text-super mr-sm shrink-0 -translate-y-px rotate-180"}),l.jsx("span",{className:"line-clamp-1",children:e})]})}));tJ.displayName="QuoteDisplay";const nJ=d.memo(({showActions:e,isEditButtonDisabled:t,showCopyCheckmark:n,onEditClick:r,onCopyClick:s})=>{const{$t:o}=J();return l.jsxs("div",{className:z("flex shrink-0 items-center gap-1","opacity-0","transition-opacity duration-150","pointer-events-none",e&&"group-hover:pointer-events-auto group-hover:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100"),"aria-hidden":!e,children:[l.jsx(wt,{icon:B("pencil"),variant:"text",size:"small",rounded:!0,onClick:r,disabled:t,"aria-label":o({defaultMessage:"Edit Query",id:"b3OoXBV5TQ"})}),l.jsx(wt,{icon:n?B("check"):B("copy"),variant:"text",size:"small",rounded:!0,onClick:s,"aria-label":o({defaultMessage:"Copy Query",id:"pLS6m4WFYK"})})]})});nJ.displayName="TitleActions";const rJ=d.memo(({style:e,isTerminating:t,onCancel:n,onConfirm:r})=>l.jsxs("div",{className:"gap-x-sm my-sm pb-sm w-full absolute top-full flex justify-end",children:[l.jsx(K,{className:"-inset-lg -top-sm absolute",variant:"background",style:e}),l.jsxs("div",{className:"gap-x-sm relative z-10 flex",children:[l.jsx(wt,{size:"small",variant:"secondary",onClick:n,disabled:t,children:l.jsx(je,{defaultMessage:"Cancel",id:"47FYwba+bI"})}),l.jsx(wt,{size:"small",variant:"primary",onClick:r,disabled:t,children:l.jsx(je,{defaultMessage:"Done",id:"JXdbo8Vnlw"})})]})]}));rJ.displayName="EditControls";const sJ=d.memo(({url:e,text:t})=>{const n=d.useMemo(()=>l.jsx("span",{role:"button",tabIndex:0,className:"underline hover:opacity-70 cursor-pointer",title:e,children:t}),[t,e]);return l.jsx(Fl,{triggerElement:n,side:"bottom",align:"start",children:l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"whitespace-nowrap",children:l.jsx(je,{defaultMessage:"Go to: ",id:"r9nTuorenA"})}),l.jsx(yt,{href:e,target:"_blank",rel:"noopener",className:"underline break-all","aria-label":e,children:sCe(e,60)})]})})});sJ.displayName="TitleLinkPopover";const oJ=d.memo(({title:e})=>{const{displayTitle:t,links:n}=cMe(e);if(n.length===0)return t;const r=[];let s=0;return n.forEach((o,a)=>{o.startOffset>s&&r.push(l.jsx(A.Fragment,{children:t.substring(s,o.startOffset)},`text-${a}`)),r.push(l.jsx(sJ,{url:o.url,text:t.substring(o.startOffset,o.endOffset)},`link-${a}`)),s=o.endOffset}),s{const{$t:o}=J(),a=d.useCallback(()=>r&&!e?o({defaultMessage:"Something went wrong.",id:"iuY8kxCDQT"}):l.jsx(JZ,{className:"max-w-[600px]",hasAttachments:s,children:l.jsx(oJ,{title:e})}),[r,e,o,s]),i=d.useMemo(()=>({showMore:l.jsx(je,{defaultMessage:"Show more",id:"kgNFsmh2uY",description:"Show more of the query."}),showLess:l.jsx(je,{defaultMessage:"Show less",id:"qyJtWyZ0yt"})}),[]);return l.jsx(MOe,{maxHeight:jOe,className:"group/title relative inline-flex flex-col",buttonLabels:i,buttonTestId:"toggle-query-expand-button",children:l.jsx(V,{as:n?"h1":"div",className:z("group/query relative whitespace-pre-line !text-wrap break-words [word-break:break-word]",t),children:a()})})});aJ.displayName="DisplayQueryBase";const iJ=d.memo(aJ);iJ.displayName="DisplayQuery";const IOe=({onKeyDown:e,editQueryValue:t,setEditQueryValue:n,inputRef:r})=>{const s=t==="";return l.jsxs("div",{className:"relative w-full min-w-0",children:[l.jsx("div",{className:"absolute border border-subtlest bg-subtlest inset-0 rounded-lg"}),l.jsxs("div",{className:"relative grid",children:[l.jsx(lI,{onKeyDown:e,editQueryValue:t,onChange:n,inputRef:r}),l.jsx("div",{className:z("pointer-events-none col-start-1 row-start-1 opacity-0","text-base font-normal leading-normal"),children:s?l.jsx(l.Fragment,{children:" "}):l.jsx(lI,{editQueryValue:t,disabled:!0})})]})]})},lI=({onKeyDown:e,editQueryValue:t,disabled:n,onChange:r,inputRef:s})=>{const{$t:o}=J(),{isMobileUserAgent:a}=Re();return l.jsx("div",{className:z("text-foreground block h-auto w-full resize-none appearance-none overflow-hidden bg-transparent focus:outline-none","caret-super selection:bg-super/50 selection:text-foreground dark:selection:bg-super/10 dark:selection:text-super","text-base font-normal p-3 leading-normal","[&_[contenteditable]]:!font-display","[&_[contenteditable]]:!bg-transparent","[&_[contenteditable]]:max-h-none [&_[contenteditable]]:!overflow-hidden [&_[contenteditable]]:sm:max-h-none [&_[contenteditable]]:lg:max-h-none","[&_[contenteditable]+*>*]:opacity-80","[&>*]:p-0"),style:{gridArea:"1/-1"},children:l.jsx(AA,{onKeyDown:e,placeholder:o({defaultMessage:"Ask anything…",id:"AUouhaZgFv"}),value:t,onChange:r,minRows:0,isMobileStyle:!1,isMobileUserAgent:a,useLexical:!0,autoFocus:!0,disableInput:n,ref:s})})},POe=Ce(async()=>{const{SidePDFViewer:e}=await Se(()=>q(()=>import("./SidePDFViewer-B5TcfQVy.js"),__vite__mapDeps([149,4,1,6,3,9,7,150,8,10,11,12])));return{default:e}}),OOe=Ce(async()=>{const{SideMeetingTranscriptViewer:e}=await Se(()=>q(()=>import("./SideMeetingTranscriptViewer-B_6wuU1-.js"),__vite__mapDeps([151,4,1,8,3,9,6,7,150,10,11,12])));return{default:e}}),y6=Ft("FileViewerContext",{openFile:()=>{},closeViewer:()=>{},doViewerAction:()=>{},isViewerOpen:!1,setViewerDispatch:()=>{}}),LOe=A.memo(({children:e})=>{const[t,n]=d.useState(),[r,s]=d.useState(),o=d.useRef(void 0),a=d.useCallback(h=>{n(h)},[n]),i=d.useCallback(()=>{n(void 0),s(void 0),o.current=void 0},[n,s]),c=d.useRef([]),u=d.useCallback(h=>{o.current?o.current(h):c.current.push(h)},[]),f=d.useCallback(h=>{s(()=>h),o.current=h,c.current.length>0&&h&&(c.current.forEach(g=>h(g)),c.current=[])},[s]),m=d.useMemo(()=>({openFile:a,closeViewer:i,doViewerAction:u,isViewerOpen:!!r,setViewerDispatch:f}),[a,i,u,r,f]),p=t?.fileSource===tV.MEETING_TRANSCRIPT?OOe:POe;return l.jsxs(y6.Provider,{value:m,children:[e,t&&l.jsx(p,{file:t})]})});LOe.displayName="FileViewerStateProvider";const lJ=({genericErrorMessage:e})=>{const{$t:t}=J(),{openToast:n}=hn();return d.useCallback(r=>{r instanceof F4?n({message:t({defaultMessage:"Downloads are disabled for files in this organization.",id:"NfM+Ayxvc6"}),variant:"error",timeout:8}):r instanceof B4?n({message:t({defaultMessage:"PDF downloads are restricted",id:"aJYvzl3Lq5"}),variant:"error",timeout:8}):r instanceof U4?n({message:t({defaultMessage:"This file belongs to a different organization",id:"lo7Bg402Jd"}),variant:"error",timeout:8}):n({message:e,variant:"error",timeout:3})},[n,t,e])},Wv=({reason:e,onSuccess:t})=>{const{$t:n}=J(),{openToast:r}=hn(),s=lJ({genericErrorMessage:n({defaultMessage:"Failed to download file",id:"RIWlU8NdpC"})});return Rt({mutationFn:async({file_url:o})=>(await Oz({request:{file_url:o,view_mode:!1},reason:e})).file_url,onSuccess:(o,{tab_id:a})=>{t?t(o,a):window.open(o,"_blank"),r({message:n({defaultMessage:"Downloading file...",id:"/vA9NyIeJh"}),variant:"success",timeout:3})},onError:s})},cJ=A.memo(({attachments:e,backend_uuid:t,fileSourceMap:n})=>l.jsx("div",{className:"gap-sm relative flex flex-wrap flex-row-reverse",children:l.jsx("div",{className:"min-w-0 max-w-[200px]",children:e.length>1?l.jsx(FOe,{attachments:e,backend_uuid:t,fileSourceMap:n}):e[0]?l.jsx(dJ,{attachmentUrl:e[0],backend_uuid:t,fileSource:n.get(e[0])}):null})}));cJ.displayName="AttachmentsRow";const uJ=e=>{const{openFile:t}=d.useContext(y6),{getImageDownloadUrl:n}=Mv({reason:"attachments-row"}),{$t:r}=J(),s=lJ({genericErrorMessage:r({defaultMessage:"Failed to open file",id:"VJjxNdFaqb"})});return d.useCallback(async(o,a)=>{if(!Bx(o))return!1;try{const i=await n({url:o,thread_id:e});return t({name:cu(o),url:i,fileSource:a,entryUUID:e}),!0}catch(i){return s(i),!1}},[t,e,n,s])},dJ=A.memo(({attachmentUrl:e,backend_uuid:t,fileSource:n})=>{const r=kr(e),[s,o]=d.useState(!1),{mutate:a}=Wv({reason:"attachments-row"}),i=uJ(t),c=d.useCallback(()=>{Bx(e)&&a({file_url:e})},[e,a]),u=d.useCallback(()=>{r?o(!0):dA()?i(e,n):c()},[r,e,n,i,c]),f=d.useCallback(()=>{o(!1)},[]),m=d.useMemo(()=>cu(e),[e]),p=d.useMemo(()=>({src:e}),[e]),h=d.useMemo(()=>({url:e}),[e]);return l.jsxs(l.Fragment,{children:[l.jsx(fJ,{title:m,icon:r?l.jsx(UOe,{attachmentUrl:e}):l.jsx(BOe,{attachmentUrl:e}),onClick:u,className:z({"!border-cursor":r})}),r&&l.jsx(pu,{onClose:f,isOpen:s,imgProps:p,origin:h,width:100,height:100,alt:m})]})});dJ.displayName="AttachmentItem";const fJ=({title:e,icon:t,className:n,hasChevron:r,ref:s,...o})=>l.jsxs(Ro,{...o,ref:s,className:z("flex w-full cursor-pointer items-center transition-colors","p-xs gap-[6px] rounded-xl pr-[6px] rounded-tr-none","border-subtlest border bg-background hover:bg-subtler",n),children:[t,l.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 leading-tight",children:e})}),r&&l.jsx(ge,{icon:B("chevron-down"),className:"text-quieter mr-px",size:"sm"})]}),FOe=({attachments:e,backend_uuid:t,fileSourceMap:n})=>{const{$t:r}=J(),[s,o]=d.useState(void 0),{mutate:a}=Wv({reason:"attachments-row"}),i=uJ(t),c=d.useCallback(y=>{Bx(y)&&a({file_url:y})},[a]),u=d.useCallback(async y=>{const x=n.get(y);kr(y)?o(y):dA()?i(y,x):c(y)},[n,i,c]),f=d.useMemo(()=>l.jsx(VOe,{}),[]),m=d.useMemo(()=>l.jsx(fJ,{title:r({defaultMessage:"{count, plural, one {# attachment} other {# attachments}}",id:"RYwHHLwZK9"},{count:e.length}),icon:f,className:"!border-cursor",hasChevron:!0}),[r,e.length,f]),p=d.useCallback(()=>{o(void 0)},[]),h=d.useMemo(()=>({src:s}),[s]),g=d.useMemo(()=>({url:s}),[s]);return l.jsxs(l.Fragment,{children:[l.jsx(Dt,{align:"end",triggerElement:m,children:e.map(y=>l.jsx(Dt.Item,{leadingAccessory:mJ(y).icon,onSelect:()=>u(y),children:cu(y)},y))}),s&&l.jsx(pu,{onClose:p,imgProps:h,origin:g,width:100,height:100,isOpen:!0})]})},cI={txt:{icon:B("file-text"),text:"Text file"},pdf:{icon:B("pdf"),text:"PDF file"},jpeg:{icon:B("photo"),text:"Image file"},jpg:{icon:B("photo"),text:"Image file"},doc:{icon:B("file-word"),text:"Word document"},docx:{icon:B("file-word"),text:"Word document"},rtf:{icon:B("file-text"),text:"Text file"},pptx:{icon:B("file-type-ppt"),text:"PowerPoint file"},xlsx:{icon:B("file-excel"),text:"Excel file"},md:{icon:B("file-text"),text:"Markdown file"},png:{icon:B("photo"),text:"Image file"},csv:{icon:B("file-type-csv"),text:"CSV file"},mov:{icon:B("video"),text:"Video file"},mp4:{icon:B("video"),text:"Video file"},unknown:{icon:B("file"),text:"Unknown"}},mJ=e=>{const t=mu(e);return cI[t]??cI.unknown},BOe=({attachmentUrl:e})=>{const{icon:t}=mJ(e);return l.jsx(x6,{children:l.jsx(ge,{icon:t,className:"text-quiet",size:"xs"})})},UOe=({attachmentUrl:e})=>{const[t,n]=d.useState(void 0);return l.jsxs(x6,{children:[l.jsx("img",{src:e,alt:"Attachment",className:z("aspect-square h-full object-cover",{hidden:t===!1,"opacity-0":t===void 0}),onLoad:()=>n(!0),onError:()=>n(!1),loading:"lazy",decoding:"async"}),t===!1&&l.jsx(ge,{icon:B("photo"),className:"text-quiet",size:"xs"})]})},VOe=()=>l.jsx(x6,{children:l.jsx(ge,{icon:B("paperclip"),className:"text-quiet",size:"xs"})}),x6=({children:e})=>l.jsx(K,{variant:"subtle",className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-lg",children:e});var pr;(function(e){e.Preview="preview",e.Source="source"})(pr||(pr={}));const HOe=Ft("CanvasContext",{openCanvas:()=>{},closeCanvas:()=>{},isCanvasOpen:!1,doCanvasAction:()=>{},setCanvasDispatch:()=>{},setCanvasState:()=>{}}),Yf=()=>d.useContext(HOe),Ku=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/deeper-research/download-asset",t,{body:e,timeoutMs:2e3,numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to download file",cause:r,status:s.status??0});return n.file_url},zOe=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/deeper-research/export-all-assets",t,{body:e,timeoutMs:6e4,numRetries:1,parseAs:"blob"});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to export all assets",cause:r,status:s.status??0});return n},pJ=({reason:e})=>{const{$t:t}=J(),{openToast:n}=hn(),r=d.useCallback(async a=>{try{const i=await Ku({request:a,reason:e}),c=document.createElement("a");c.href=i,c.download=a.filename,document.body.appendChild(c),c.click(),document.body.removeChild(c),n({message:t({defaultMessage:"Downloading file...",id:"/vA9NyIeJh"}),variant:"success",timeout:3})}catch(i){Z.error("Failed to download S3 asset",{error:i,request:a,errorMessage:i instanceof Error?i.message:"Unknown error"}),n({message:t({defaultMessage:"Failed to download file",id:"RIWlU8NdpC"}),variant:"error",timeout:3})}},[e,t,n]),s=d.useCallback(async(a,i="media",c=document.body)=>{try{const u=await fetch(a,{mode:"cors",cache:"no-cache"});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);const f=await u.blob(),m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=i,c.appendChild(p),p.click(),c.removeChild(p),URL.revokeObjectURL(m);const h=i.toLowerCase().includes(".mp4")||i.toLowerCase().includes(".mov")||i.toLowerCase().includes(".avi")||f.type.startsWith("video/"),g=t(h?{defaultMessage:"Video downloaded",id:"WHvofOjBQO"}:{defaultMessage:"Image downloaded",id:"nS5vxnEXaW"});n({message:g,variant:"success",timeout:3})}catch(u){const f=i.toLowerCase().includes(".mp4")||i.toLowerCase().includes(".mov")||i.toLowerCase().includes(".avi");Z.error("Failed to download media asset",{error:u,mediaUrl:a,errorMessage:u instanceof Error?u.message:"Unknown error",errorType:u instanceof TypeError&&u.message.includes("Failed to fetch")?"CORS":"Unknown"});const m=t(f?{defaultMessage:"Failed to download video",id:"g8uGrbPLMV"}:{defaultMessage:"Failed to download image",id:"YPAbL/7UuZ"});n({message:m,variant:"error",timeout:3})}},[t,n]),o=d.useCallback(async(a,i="image.jpg",c=document.body)=>s(a,i,c),[s]);return d.useMemo(()=>({downloadS3Asset:r,downloadImageAsset:o,downloadMediaAsset:s}),[o,r,s])},v6=e=>{const{$t:t}=J();return Vi(e?.asset_type).with(at.CODE_ASSET,()=>({description:t({defaultMessage:"Programming",id:"4MsdoHG9QN"}),title:t({defaultMessage:"Python",id:"/Z1NW3qKj6"}),Icon:B("code")})).with(at.CHART,()=>({description:t({defaultMessage:"Code Interpreter Graph",id:"F3E5l9GC7U"}),title:t({defaultMessage:"Chart",id:"nFVuBOECC+"}),Icon:B("chart-histogram")})).with(at.CODE_FILE,()=>({description:t({defaultMessage:"Generated File",id:"x6KEQZ7oaM"}),title:e?.code_file?.filename??"",Icon:B("file")})).with(at.APP,()=>({description:t({defaultMessage:"Generated App",id:"t7mMyC1O7+"}),title:e?.app?.name??"",Icon:B("layout-collage")})).with(at.SLIDES,()=>({description:t({defaultMessage:"Presentation",id:"7zHbpiyvPE"}),title:e?.app?.name??"",Icon:B("presentation")})).with(at.GENERATED_IMAGE,()=>({description:"",title:t({defaultMessage:"Generated Image",id:"Kt4lbw5KkH"}),Icon:B("image-in-picture")})).with(at.GENERATED_VIDEO,()=>({description:"",title:t({defaultMessage:"Generated Video",id:"Gh4spqP8w0"}),Icon:B("video")})).with(at.PDF_FILE,()=>({description:t({defaultMessage:"PDF Document",id:"Idloyb3SW4"}),title:e?.pdf_file?.name??t({defaultMessage:"PDF Document",id:"Idloyb3SW4"}),Icon:B("file-type-pdf")})).with(at.DOCX_FILE,()=>({description:t({defaultMessage:"Word Document",id:"q+bgjo7qbJ"}),title:e?.docx_file?.name??"",Icon:B("file-type-docx")})).with(at.DOC_FILE,()=>({description:t({defaultMessage:"Document",id:"wmirkPk7bp"}),title:e?.doc_file?.name??"",Icon:B("file-type-doc")})).with(at.XLSX_FILE,()=>({description:t({defaultMessage:"Excel Spreadsheet",id:"eMPZOuxga0"}),title:e?.xlsx_file?.name??"",Icon:B("file-spreadsheet")})).with(at.QUIZ,()=>({description:t({defaultMessage:"Quiz",id:"OuR/Ijtl93"}),title:e?.quiz?.title??"",Icon:B("checklist")})).with(at.FLASHCARDS,()=>({description:t({defaultMessage:"Flashcards",id:"c2+pp7T4ws"}),title:e?.flashcards?.title??"",Icon:B("cards")})).otherwise(()=>({description:"",title:t({defaultMessage:"Generated Asset",id:"Kc1J25+bKt"}),Icon:B("file")}))};function WOe(e,t,n){const r=new Blob([n],{type:"text/plain"});hJ(e,t,r)}function hJ(e,t,n){const r=document.createElement("a"),s=URL.createObjectURL(n);r.href=s,r.download=t,e.appendChild(r),r.click(),URL.revokeObjectURL(s),e.removeChild(r)}function GOe(e){return!!(e?.asset_type===at.SLIDES&&e.app?.url&&e.app.name)}function jbt(e){return e?.asset_type?[at.GENERATED_IMAGE,at.CHART,at.CODE_FILE,at.CODE_ASSET].includes(e.asset_type):!1}function $Oe(e){return e?.asset_type?[at.CHART,at.GENERATED_IMAGE,at.GENERATED_VIDEO,at.PDF_FILE].includes(e.asset_type):!1}function Ibt({reason:e,entryUUID:t}){const[n,r]=d.useState(!1),s=d.useCallback(async o=>{r(!0);try{const a=await zOe({request:{entry_uuid:t},reason:e});hJ(o||document.body,"exported-assets.zip",a)}finally{r(!1)}},[t,e]);return d.useMemo(()=>({exportAllAssets:s,isExporting:n}),[s,n])}function Pbt({asset:e,reason:t,answerMode:n,context:r,entryUUID:s}){const{downloadS3Asset:o,downloadImageAsset:a,downloadMediaAsset:i}=pJ({reason:t}),{session:c}=Ne(),{trackEvent:u}=Xe(c),f=d.useCallback(async m=>{if(e)if(r==="canvas"?u("canvas content downloaded",{contentType:e.asset_type,entryUUID:s,assetUUID:e.uuid,downloadType:"download"}):n&&u("generated asset downloaded",{assetType:e.asset_type,answerMode:n,entryUUID:s,reason:t}),e.asset_type===at.GENERATED_IMAGE)e.generated_image?.url&&await a(e.generated_image.url,"generated-image.png",m||document.body);else if(e.asset_type===at.GENERATED_VIDEO)e.generated_video?.url&&await i(e.generated_video.url,"generated-video.mp4",m||document.body);else for(const p of e.download_info)p.url?await o({url:p.url,filename:p.filename}):p.text_content&&WOe(m||document.body,p.filename,p.text_content)},[e,r,n,u,s,t,a,i,o]);return d.useMemo(()=>({downloadAsset:f}),[f])}var _c;(function(e){e[e.UNCOPIED=0]="UNCOPIED",e[e.COPYING=1]="COPYING",e[e.FAILED=2]="FAILED",e[e.SUCCEEDED=3]="SUCCEEDED"})(_c||(_c={}));var wc;(function(e){e[e.UNLINKED=0]="UNLINKED",e[e.LINKING=1]="LINKING",e[e.FAILED=2]="FAILED",e[e.SUCCEEDED=3]="SUCCEEDED"})(wc||(wc={}));function Obt({asset:e,reason:t}){const[n,r]=d.useState(_c.UNCOPIED),{$t:s}=J(),{openToast:o}=hn(),a=d.useCallback(async()=>{if(e){r(_c.COPYING);try{await qOe({asset:e,reason:t}),o({message:s({defaultMessage:"Copied to the clipboard!",id:"WWy0tPuRW8"}),variant:"success",timeout:3}),r(_c.SUCCEEDED)}catch{o({message:s({defaultMessage:"Failed to copy the asset",id:"HHPhgIZj9h"}),variant:"error",timeout:3}),r(_c.FAILED)}setTimeout(()=>r(_c.UNCOPIED),2e3)}},[s,o,r,e,t]);return d.useMemo(()=>({copyStatus:n,copyAsset:a}),[n,a])}function Lbt({asset:e}){const[t,n]=d.useState(wc.UNLINKED),{$t:r}=J(),{openToast:s}=hn(),o=d.useCallback(async()=>{if(!(!e||!$Oe(e))){n(wc.LINKING);try{let a;if(e.asset_type===at.CHART&&e.chart?.url)a=e.chart.url;else if(e.asset_type===at.GENERATED_IMAGE&&e.generated_image?.url)a=e.generated_image.url;else if(e.asset_type===at.GENERATED_VIDEO&&e.generated_video?.url)a=e.generated_video.url;else if(e.asset_type===at.PDF_FILE&&e.pdf_file?.url)a=e.pdf_file.url;else throw new Error("Asset is not linkable or URL not found");await navigator.clipboard.writeText(a),s({message:r({defaultMessage:"Link copied to clipboard!",id:"PsDXPeXpVG"}),variant:"success",timeout:3}),n(wc.SUCCEEDED)}catch{s({message:r({defaultMessage:"Failed to copy link",id:"ruCwQMVFzJ"}),variant:"error",timeout:3}),n(wc.FAILED)}setTimeout(()=>n(wc.UNLINKED),2e3)}},[e,r,s]);return d.useMemo(()=>({linkStatus:t,linkAsset:o}),[t,o])}async function qOe({asset:e,reason:t}){let n;if(e.asset_type==at.CODE_ASSET)n={"text/plain":e.code?.script??""};else if(e.asset_type==at.CHART&&e.chart?.url){const s=await Ku({request:{url:e.chart.url,filename:"chart.png"},reason:t});n={"image/png":await(await fetch(s)).blob()}}else if(e.asset_type==at.CODE_FILE&&e.code_file?.url){const s=await Ku({request:{url:e.code_file.url,filename:e.code_file.name},reason:t});n={"text/plain":await(await fetch(s)).text()}}else if(e.asset_type==at.GENERATED_IMAGE&&e.generated_image?.url){const s=e.generated_image.url;n={"image/png":await(await fetch(s)).blob()}}else if(e.asset_type==at.GENERATED_VIDEO&&e.generated_video?.url){const s=e.generated_video.url;n={"video/mp4":await(await fetch(s,{mode:"cors",cache:"no-cache"})).blob()}}else if(e.asset_type==at.PDF_FILE&&e.pdf_file?.url){const s=await Ku({request:{url:e.pdf_file.url,filename:e.pdf_file.name},reason:t});n={"application/pdf":await(await fetch(s)).blob()}}else if(e.asset_type==at.DOCX_FILE&&e.docx_file?.url){const s=await Ku({request:{url:e.docx_file.url,filename:e.docx_file.name},reason:t});n={"application/vnd.openxmlformats-officedocument.wordprocessingml.document":await(await fetch(s)).blob()}}else if(e.asset_type==at.XLSX_FILE&&e.xlsx_file?.url){const s=await Ku({request:{url:e.xlsx_file.url,filename:e.xlsx_file.name},reason:t});n={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":await(await fetch(s)).blob()}}if(!n)throw new Error("Failed to find anything to copy");const r=new ClipboardItem(n);await navigator.clipboard.write([r])}function KOe(e){if(e)switch(e.asset_type){case at.CHART:return e.chart?.url;case at.GENERATED_IMAGE:return e.generated_image?.url;case at.GENERATED_VIDEO:return e.generated_video?.url;case at.PDF_FILE:return e.pdf_file?.url;case at.CODE_FILE:return e.code_file?.url;case at.DOCX_FILE:return e.docx_file?.url;case at.DOC_FILE:return e.doc_file?.url;case at.XLSX_FILE:return e.xlsx_file?.url;case at.APP:return e.app?.app_url;case at.SLIDES:return e.app?.app_url;case at.CODE_ASSET:return;case at.QUIZ:return e.quiz?.url;case at.FLASHCARDS:return e.flashcards?.url;default:Vfe(e.asset_type);return}}const gJ=({asset:e})=>{const{openCanvas:t,closeCanvas:n,doCanvasAction:r,canvasState:s,isCanvasOpen:o}=Yf(),{title:a}=v6(e),{result:{context_uuid:i,backend_uuid:c}}=It(),{session:u}=Ne(),{trackEvent:f}=Xe(u),m=d.useCallback(()=>{if(e){const p=KOe(e);p&&window.open(p,"_blank");return}},[e,t,n,r,a,c,o,s?.assetUuid,f,i]);return d.useMemo(()=>m,[m])},YOe=()=>{const e=fn(),{results:t}=on(),n=d.useRef(!1),r=t?.[0],s=r?.blocks?u6(r.blocks,{orderedByPriority:!0})[0]:void 0,o=gJ({asset:s});d.useEffect(()=>{n.current||!s||!(e.get("canvas")==="true")||(n.current=!0,o())},[e,s,o])};function QOe(){const e=hv(),t=bg(),{results:n}=on(),r=d.useRef(!1),s=d.useMemo(()=>n.some(o=>o.display_model===ie.STUDY),[n]);d.useEffect(()=>{const o=e(ie.STUDY);s&&o&&!r.current&&(r.current=!0,t(ie.STUDY,oe.STUDY))},[e,t,s])}const yJ=({trackEvent:e,entryUUID:t,frontendContextUUID:n,contextUUID:r})=>d.useCallback((s,o)=>{e(s,{entryUUID:t,frontendContextUUID:n,contextUUID:r,...o})},[t,n,r,e]),XOe=({webResults:e})=>Xi(t=>({isShowing:!1,webResults:e,actions:{hide:()=>t({isShowing:!1}),show:n=>t({...n,isShowing:!0})}})),{Context:ZOe,useTrackedState:JOe}=s4("SourcesListContext"),xJ=d.memo(({children:e,webResults:t})=>{const[n]=A.useState(()=>XOe({webResults:t}));return d.useEffect(()=>{n.setState({webResults:t})},[t,n]),l.jsx(ZOe.Provider,{value:n,children:e})});xJ.displayName="SourcesListProvider";const eLe=JOe;class tLe extends Date{constructor(t){const n=t?new Date(t):new Date,r=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());super(r)}getTimezoneOffset(){return 0}}class Gv{static isRecentlyTrending(t,n=432e5){return t.meta_data?.client!=="trending"?!1:new Date().getTime()-new tLe(t.meta_data?.published_date).getTime()o.is_attachment);if(!n)return t;const s=new Set(n.map(o=>this.normalizeUrl(o.url)));return t.filter(o=>!s.has(this.normalizeUrl(o.url)))}}const nLe=({webResults:e,navigationResults:t=[],isStudyMode:n=!1,client:r="trending"})=>{if(!e)return{dedupedWebResults:[],hasSufficientTrendingRatio:!1,trendingResults:[],trendingResultsWithImages:[]};const s=Gv.dedupWebResults(e,t,n),o=s.filter(f=>f.meta_data?.client===r),i=s.slice(0,10).filter(f=>f.meta_data?.client===r),c=i.length>=2,u=i.filter(f=>f.meta_data?.images?.[0]);return{dedupedWebResults:s,hasSufficientTrendingRatio:c,trendingResults:o,trendingResultsWithImages:u}},vJ=A.memo(({urlData:e,handleClick:t,showBottomBorder:n=!0,...r})=>{const s=d.useMemo(()=>{const{url:h,snippet:g}=e;if("title"in e){const x=e;return{url:h,title:x.title,snippet:g,domain:x.domain||Ur(h)}}return{url:h,title:e.name,snippet:g,domain:Ur(h)}},[e]),{url:o,title:a,snippet:i,domain:c}=s,u=d.useMemo(()=>c.replace(/^www\./,"").split(".")[0],[c]),f=d.useMemo(()=>$c(o),[o]),m=d.useMemo(()=>h=>()=>{},[]),p=t||m;return l.jsx("div",{className:z("p-md border-t-subtlest -mx-4 flex grow select-none flex-col border-t px-4 [&:only-child]:border-0",n&&"last:border-b-subtlest last:border-b"),children:l.jsxs(yt,{className:"gap-sm border-t-subtlest group flex cursor-pointer flex-col items-stretch",href:o,target:"_self",onClick:p(o,"primaryLink"),rel:"noopener",...r,children:[l.jsxs("div",{className:"flex h-7 items-center gap-2",children:[l.jsx(Po,{size:28,domain:f,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex w-full min-w-0 flex-col",children:[l.jsx(V,{variant:"small",className:"line-clamp-1",children:u}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 truncate break-words",children:o})]})]}),l.jsxs("div",{children:[l.jsx(V,{className:"line-clamp-1",variant:"baseSemi",color:"super",children:a}),l.jsx(V,{variant:"small",color:"light",className:"line-clamp-2",children:i})]})]},o)})});vJ.displayName="MobileUrlCard";const mc={lastEntryUUID:null,loggedUrls:new Set,seenEntries:new Set};function rLe(e){if(e)return[{...e,url:e?.url,title:e?.name,snippet:e?.snippet,sitelinks:e?.sitelinks?.slice(),site_name:e?.meta_data?.domain_name||e?.meta_data?.citation_domain_name}]}const b6=A.memo(({navigationResult:e,trackEvent:t,queryString:n,entryUUID:r,frontendUUID:s,onClick:o,showSiteLinks:a=!1,showNewMobileCard:i=!1,renderPosition:c,clampSnippet:u=!1,showBottomBorder:f=!0,...m})=>{const{url:p,title:h,snippet:g,sitelinks:y,position:x,source:v,client_request_timestamp:b,unstable_server_request_timestamp:_,is_cached:w,is_comet_navigation:S,site_name:C,navigation_source:E}=e,{isMobileStyle:T}=Re(),k=d.useMemo(()=>$c(p),[p]),I=d.useMemo(()=>h3(p),[p]);d.useEffect(()=>{if(!r||!p)return;const N=mc.seenEntries.has(r);mc.lastEntryUUID!==r&&(mc.lastEntryUUID=r,mc.loggedUrls.clear()),mc.loggedUrls.has(p)||(mc.loggedUrls.add(p),mc.seenEntries.add(r),t("navigational source viewed",{query:n,url:p,title:h,...a&&{subLinks:y},position:x,source:v,is_comet_navigation:S,frontendUUID:s,...typeof b=="number"&&!N&&{renderTimeMs:performance.now()-b},...typeof _=="number"&&!N&&{unstableRenderTimeMs:performance.now()-_},subLinks:y,isCached:w,navigation_source:E}))},[r,p,n]);const M=d.useCallback((N,D)=>j=>{t("click citation",{source:"navigationalCard",render_position:c,navigationalLinkType:D,citation_url:N,is_comet_navigation:S,frontendUUID:s}),o?.(j)},[S,t,o,s,c]);return T&&i?l.jsx(vJ,{urlData:e,handleClick:M,showBottomBorder:f,...m}):l.jsx("div",{className:"gap-sm flex select-none",children:l.jsx("div",{className:"grow",children:l.jsxs(K,{variant:"transparent",className:"flex grow flex-col rounded-lg",children:[l.jsx(yt,{className:"group flex cursor-pointer items-stretch",href:p,target:"_self",onClick:M(p,"primaryLink"),rel:"noopener",...m,children:l.jsxs(K,{className:"pr-md group",children:[l.jsxs("div",{className:"mb-xs gap-sm flex items-center",children:[l.jsx(Po,{size:24,domain:k,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex flex-col",children:[C&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1 break-all leading-[0.875rem]",children:C}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 break-all leading-[0.875rem]",children:I})]})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"super",className:"decoration-1 underline-offset-1 group-hover:underline",children:h}),l.jsx(V,{variant:"small",color:"light",className:`mb-two line-clamp-${u?"1":"2"}`,children:g})]})]})},p),y&&y.length>0&&a&&l.jsx(V,{variant:"small",color:"light",className:"pt-two pb-sm",children:l.jsx(ga,{className:"flex-wrap",children:y.map(N=>l.jsx(Bn,{id:N.url,children:l.jsx(yt,{className:"group flex cursor-pointer items-stretch",href:N.url,onClick:M(N.url,"siteLink"),rel:"noopener",...m,children:l.jsx(V,{variant:"small",color:"super",className:"decoration-1 underline-offset-1 group-hover:underline",children:N.title})})},N.url))})})]})})})});b6.displayName="CitationNavigationalCard";const sLe=Ce(async()=>{const{CitationListModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>FN),void 0));return{default:e}}),oLe=({entry:e,webResults:t,showSourcesSidebar:n,allowedNavResultsCount:r,isFirstResult:s,enableMobileCalculations:o=!1,...a})=>{const{session:i}=Ne(),{trackEvent:c}=Xe(i),{trackEvent:u}=Bv(),{openModal:f}=Uo(),m=el(),p=eLe(),{isMobileStyle:h}=Re(),g=d.useMemo(()=>"searchMode"in a&&a.searchMode===oe.SEARCH,[a]),y=d.useMemo(()=>t?.filter(R=>R.is_navigational)?.flatMap(R=>rLe(R)||[]),[t]),{data:x}=mt({queryKey:$H(e?.query_str??""),queryFn:()=>Promise.resolve({}),enabled:!1}),v=d.useMemo(()=>x?.navigation_results?.map(R=>({...R,is_cached:!0,navigation_source:Ld.SEARCH_V2_NAVIGATE}))??y?.map(R=>({...R,is_cached:!1,navigation_source:Ld.WEB_RESULTS})),[x,y]),b=d.useMemo(()=>v?.slice(0,r),[v,r]),_=b?.length&&s&&!g,w=d.useMemo(()=>qt.isPerplexityMessage(e)?e?.display_model==="pplx_study":!1,[e]),S=d.useMemo(()=>nLe({webResults:t,navigationResults:b,isStudyMode:w}),[t,b,w]),{dedupedWebResults:C,hasSufficientTrendingRatio:E,trendingResults:T,trendingResultsWithImages:k}=S,I=d.useMemo(()=>!o||!h?[]:k,[o,h,k]),M=d.useMemo(()=>o?h&&E&&k.length>=2:!1,[o,h,E,k.length]),N=d.useMemo(()=>qt.isPerplexityMessage(e)?e?.blocks?.some(R=>R.intended_usage==="answer_media_items"):!1,[e]),D=d.useMemo(()=>!_&&!N&&E,[_,N,E]),j=d.useCallback(()=>{if(e?.backend_uuid){const R=n?"sidebar":"modal";u("click view sources button",{entryUUID:e.backend_uuid,type:p.isShowing?void 0:R})}n?p.actions.show({webResults:t}):f(sLe,{legacyIdentifier:"citationListModal",webResults:t,entry:e})},[e?.backend_uuid,f,m,n,p.isShowing,p.actions.hide,u,t?.length]),F=yJ({trackEvent:c,entryUUID:e?.backend_uuid,frontendContextUUID:e?.uuid,contextUUID:e?.context_uuid});return d.useMemo(()=>({isNavigationalLayout:_,navigationResults:b,trackCitationClickEvent:F,handleViewAllClick:j,dedupedWebResults:C,isTrendingLayout:D,trendingResults:T,trendingResultsWithImages:I,showTrendingInMobile:M}),[C,j,_,D,b,M,F,T,I])},bJ=({target:e,entryUUID:t,frontendContextUUID:n,targetVisibilityPortionThreshold:r=.5,hasLLMToken:s})=>{const o=d.useRef(null),a=d.useRef(null),i=d.useRef(!1),{session:c}=Ne(),{trackEvent:u}=Xe(c),{result:f}=It(),m=d.useRef(f);d.useEffect(()=>{m.current=f},[f]);const p=d.useCallback(()=>{if(o.current){const g=Math.round(performance.now()-o.current);u("thread entry exited",{entryUUID:t,frontendContextUUID:n,timeOnEntryMs:g}),o.current=null}if(a.current){const g=m.current;g&&an(g.display_model)==oe.STUDIO&&qt.isStatusPending(g)&&u("answer processing exited",{entryUUID:t,frontendContextUUID:n,timeOnEntryMs:Math.round(performance.now()-a.current)}),a.current=null}},[u,t,n]),h=d.useCallback(()=>{s&&(o.current=performance.now()),a.current||(a.current=performance.now())},[s]);return d.useEffect(()=>{const g=new IntersectionObserver(x=>{x.forEach(v=>{i.current=v.isIntersecting,v.isIntersecting&&document.visibilityState==="visible"?h():p()})},{threshold:r}),y=e.current;return y&&g.observe(y),()=>{y&&g.unobserve(y),p()}},[e,r,h,p]),d.useEffect(()=>{const g=()=>{document.visibilityState==="hidden"?p():document.visibilityState==="visible"&&i.current&&h()};return document.addEventListener("visibilitychange",g),()=>{document.removeEventListener("visibilitychange",g)}},[h,p]),d.useEffect(()=>{const g=()=>{i.current&&o.current&&p()};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[p]),null},aLe=(e,t)=>{const{value:n,loading:r}=zt({flag:"show-site-link-snippets",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},_J=A.memo(({navigationResult:e,trackEvent:t})=>{const{url:n,title:r,snippet:s,domain:o,sitelinks:a=[],site_name:i}=e,c=d.useMemo(()=>(o||Ur(n)).replace(/\.[^.]*$/,""),[o,n]),u=d.useMemo(()=>$c(n),[n]),f=d.useCallback(m=>{t("click citation",{type:"primaryLink",...e})},[t,e]);return l.jsxs(K,{className:"p-md border-subtler mb-md rounded-xl border",variant:"subtler",children:[l.jsxs(yt,{className:"gap-sm border-t-subtlest group flex cursor-pointer flex-col items-stretch",href:n,target:"_self",onClick:f,rel:"noopener",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Po,{size:24,domain:u,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex w-full min-w-0 flex-col leading-[0.875rem]",children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-1 break-words",children:i??c}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 truncate break-words leading-[0.875rem]",children:n})]})]}),l.jsx(V,{className:"pt-xs line-clamp-2 break-words",color:"super",variant:"baseSemi",children:r})]}),l.jsx("div",{children:l.jsx(V,{variant:"small",color:"light",className:"line-clamp-2 break-words",children:s})})]},n),l.jsx("div",{className:"mt-sm",children:a.map(m=>l.jsx("div",{className:"border-subtler px-two py-md flex items-center border-t last:pb-0",children:l.jsxs(yt,{href:m.url,className:"flex w-full items-center justify-between",children:[l.jsx(V,{variant:"small",className:"line-clamp-2 leading-none",children:m.title}),l.jsx(V,{variant:"small",color:"light",children:l.jsx(ge,{icon:B("chevron-right")})})]})},m.url))})]})});_J.displayName="MobilePrimaryNavResultCard";const wJ=A.memo(({navigationResult:e,trackEvent:t,queryString:n,entryUUID:r,frontendUUID:s})=>{const{isMobileStyle:o}=Re();return o?l.jsx(_J,{navigationResult:e,trackEvent:t,entryUUID:r,frontendUUID:s}):l.jsx(SJ,{navigationResult:e,trackEvent:t,entryUUID:r,frontendUUID:s,queryString:n})}),CJ=A.memo(({sitelink:e,showSnippet:t,onSiteLinkClick:n})=>{const r=d.useCallback(()=>{n(e.url)},[n,e.url]);return l.jsxs(yt,{href:e.url,target:"_self",className:"flex h-full flex-col justify-start",onClick:r,children:[l.jsx(V,{variant:"smallBold",className:z("break-words hover:underline",t?"line-clamp-2":"line-clamp-1"),color:"super",children:e.title}),t&&l.jsx(V,{variant:"small",className:"line-clamp-1 break-words",color:"light",children:e?.snippet??""})]})});CJ.displayName="SitelinkItem";const SJ=A.memo(({navigationResult:e,trackEvent:t,entryUUID:n,frontendUUID:r,queryString:s})=>{const{sitelinks:o=Pe}=e,{variation:a}=aLe(!1),i=d.useMemo(()=>{if(a)return o;const u=o.length&-2;return o.slice(0,u)},[o,a]),c=d.useCallback(u=>{t("click citation",{source:"navigationalCard",navigationalLinkType:"subLink",citation_url:u,is_comet_navigation:e.is_comet_navigation??!1,frontendUUID:r})},[t,e.is_comet_navigation,r]);return l.jsxs("div",{children:[l.jsx(b6,{navigationResult:e,trackEvent:t,queryString:s,entryUUID:n,frontendUUID:r}),i.length>0&&l.jsx("div",{className:z("gap-x-lg border-subtler pl-md my-sm grid items-stretch gap-y-1 border-l",a?"grid-cols-2":"grid-cols-[0.5fr_1fr]"),children:i.map(u=>l.jsx(CJ,{sitelink:u,showSnippet:a,onSiteLinkClick:c},u.url))})]})});SJ.displayName="DesktopPrimaryNavResultCard";wJ.displayName="PrimaryNavResultCard";const iLe=(e,t,n)=>{const r=e?.sitelinks??Pe;return t===0&&r.length>0},EJ=d.memo(({navResult:e,index:t,isPrimaryCardEnabled:n,trackCitationClickEvent:r,queryStr:s,entryUUID:o,frontendUUID:a,showSiteLinks:i,renderPosition:c,clampSnippet:u,showBottomBorder:f=!0})=>{const{isMobileStyle:m}=Re();return n&&iLe(e,t)?l.jsx(wJ,{navigationResult:e,trackEvent:r,queryString:s,entryUUID:o,frontendUUID:a}):l.jsx(b6,{navigationResult:e,trackEvent:r,queryString:s,entryUUID:o,frontendUUID:a,showSiteLinks:i,showNewMobileCard:m,renderPosition:c,clampSnippet:u,showBottomBorder:f})});EJ.displayName="RedesignedNavResultListItem";const lLe=(e,t)=>{const{value:n,loading:r}=zt({flag:"web-site-links-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},cLe=Ce(async()=>{const{CitationListModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>FN),void 0));return{default:e}}),vl=2,uLe=(e,t,n)=>{if(!e||n||t?.use_default_threshold)return vl;const r=t?.threshold,s=t?.number;if(!r||!s)return vl;const o=e.mhe_predictions_full?.comet_nav_widget?.probability;return o&&o>=r?s:vl},kJ=d.memo(({navResults:e,queryStr:t,querySource:n,backendUUID:r,frontendUUID:s,trackCitationClickEvent:o,onMount:a,shouldRenderPrimaryCard:i=!0,renderPosition:c})=>{const{isMobileStyle:u}=Re(),f=u?i:!1;d.useEffect(()=>{a?.()},[a]);const m=d.useCallback((p,h)=>{o(p,h);const g=n==="default_search",y=h.is_comet_navigation;!(p==="click citation")||!g||!y||Pl("web.frontend.omnisearch_nav_results_clicked")},[o,n]);return l.jsx(MJ,{navResults:e,queryStr:t,backendUUID:r,frontendUUID:s,trackCitationClickEvent:m,isPrimaryCardEnabled:f,renderPosition:c})});kJ.displayName="NavigationResultList";const dLe=7,MJ=d.memo(({navResults:e,queryStr:t,backendUUID:n,frontendUUID:r,trackCitationClickEvent:s,isPrimaryCardEnabled:o,renderPosition:a})=>{const{session:i}=Ne(),{trackEvent:c}=Xe(i),{webResults:u,isEntryInFlight:f}=It(),{isMobileStyle:m}=Re(),{variation:p}=lLe(!1),{openModal:h}=Uo(),{$t:g}=J(),[y,x]=d.useState("none"),v=d.useMemo(()=>Gv.dedupWebResults(u,e,!1),[u,e]),b=d.useMemo(()=>v.slice(0,dLe).map((M,N)=>({url:M.url,title:M.name,snippet:M.snippet||"",domain:M.url?new URL(M.url).hostname:void 0,position:e.length+N,source:"default_search",site_name:M.meta_data?.domain_name||M.meta_data?.citation_domain_name||Ur(M.url),is_comet_navigation:!1,navigation_source:Ld.WEB_RESULTS})),[v,e]),_=d.useMemo(()=>y==="none"?"collapsed":!f&&b.length>0?"expanded":"loading",[y,f,b.length]),w=d.useMemo(()=>_==="collapsed"?e:[...e,...b],[e,b,_]),S=w.length>e.length,C=d.useMemo(()=>{const M=e.length>=vl,N=b.length=vl},[f,S,b.length,v.length,e.length]),E=g(S?{defaultMessage:"See all links",id:"YDWVbhXaX3"}:{defaultMessage:"See more links",id:"A+4zhUZpLQ"}),T=d.useCallback(()=>{h(cLe,{legacyIdentifier:"citationListModal",webResults:u})},[h,u]),k=d.useCallback(()=>{if(S){c("clicked navigation results see all"),T();return}if(c("clicked navigation results see more"),f){x("clicked");return}if(b.length===0){T();return}x("clicked")},[S,c,T,f,b.length]),I=_==="loading"&&!S;return l.jsxs(K,{className:"relative flex flex-col",children:[l.jsx("div",{className:"flex flex-col sm:gap-4",children:w.map((M,N)=>{const j=N===w.length-1&&e.length>=vl&&C&&!S&&m;return l.jsx(EJ,{navResult:M,index:N,isPrimaryCardEnabled:o,trackCitationClickEvent:s,queryStr:t,entryUUID:n??"",frontendUUID:r??"",showSiteLinks:p,renderPosition:a,clampSnippet:j,showBottomBorder:!j},M.url)})}),C&&l.jsxs("div",{className:z("pointer-events-none relative",S?"mt-md":m?"mt-[-4.5rem] pt-[36px]":""),children:[!S&&m&&l.jsx("div",{className:"via-base/80 to-base pointer-events-none absolute inset-0 bg-gradient-to-b from-transparent"}),l.jsx("div",{className:"relative",children:m?l.jsx("div",{className:"bg-base pointer-events-auto w-full rounded-lg",children:l.jsx(wt,{fullWidth:!0,onClick:k,disabled:I,"data-testid":"view-more-button",variant:"tonal",children:E})}):l.jsxs("div",{className:"bg-base mt-sm pointer-events-auto -ml-3 flex items-center",children:[l.jsx(wt,{size:"small",onClick:k,trailingIcon:S?B("chevron-right"):void 0,disabled:I,"data-testid":"view-more-button",variant:"text",children:E}),l.jsx("div",{className:"bg-subtle h-px flex-1"})]})})]})]})});MJ.displayName="RedesignedNavigationResultList";const TJ=e=>{if(e){if(e.app)return e.app.final;if(e.xlsx_file)return e.xlsx_file.final;if(e.doc_file)return e.doc_file.final}},AJ=e=>e.xlsxAsset?.name||e.pdfAsset?.name||e.docxAsset?.name||e.docFileAsset?.name||e.codeFileAsset?.name||e.app?.name||null,uI=(e,t)=>{const n=iW(t),r=AJ(e);return b3(r&&n?`${r}.${n}`:t)},NJ=e=>d.useMemo(()=>{if(!e)return{app:null,pdfAsset:null,docxAsset:null,docFileAsset:null,codeFileAsset:null,chartAsset:null,xlsxAsset:null,quizAsset:null,pdfFileData:null,assetType:null,assetUuid:null};const t=e.pdf_file||null,n=t?{url:t.url,name:t.name||"Document"}:null;let r=e.app;return r&&(r={...r,transforms:r.transforms||[]}),{app:r||null,pdfAsset:t,docxAsset:e.docx_file||null,docFileAsset:e.doc_file||null,codeFileAsset:e.code_file||null,chartAsset:e.chart||null,xlsxAsset:e.xlsx_file||null,quizAsset:e.quiz||null,pdfFileData:n,assetType:e.asset_type,assetUuid:e.uuid}},[e]);function gw(e,t){let n=e;for(const r of t)n=n.replaceAll(r.old_str,r.new_str);return n}function RJ(e){return!!((e?.asset_type===at.APP||e?.asset_type===at.SLIDES)&&e?.app?.transforms&&e.app.transforms.length>0||e?.asset_type===at.XLSX_FILE&&e?.xlsx_file?.transforms&&e.xlsx_file.transforms.length>0||e?.asset_type===at.DOC_FILE&&e?.doc_file?.transforms&&e.doc_file.transforms.length>0)}function Tg(e){return!e?.version_info?.parent_artifact_id||!RJ(e)?!1:TJ(e)===!1}function fLe(e,t){if(e?.version_info?.artifact_id)return t.find(n=>n.version_info?.parent_artifact_id===e.version_info?.artifact_id&&Tg(n))}function mLe(e,t){const n=d.useMemo(()=>fLe(e,t),[e,t]);return d.useMemo(()=>{let r=!1;e?.app?r=!e.app.final:e?.xlsx_file?r=!e.xlsx_file.final:e?.doc_file&&(r=!e.doc_file.final);const s={streamingChild:void 0,hasStreamingChild:!1,transformedContent:"",transforms:[],isStreaming:r,hasTransforms:!1};if(n?.app?.transforms&&e?.app?.source_content){const o=gw(e.app.source_content,n.app.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.app.transforms,isStreaming:!n.app.final,hasTransforms:!0}}if(n?.xlsx_file?.transforms&&e?.xlsx_file?.source_content){const o=gw(e.xlsx_file.source_content,n.xlsx_file.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.xlsx_file.transforms,isStreaming:!n.xlsx_file.final,hasTransforms:!0}}if(n?.doc_file?.transforms&&e?.doc_file?.source_content){const o=gw(e.doc_file.source_content,n.doc_file.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.doc_file.transforms,isStreaming:!n.doc_file.final,hasTransforms:!0}}return s},[n,e])}function DJ(e,t){if(!Tg(e))return;const n=e?.version_info?.parent_artifact_id;return t.find(r=>r.version_info?.artifact_id===n)}const jJ=(e,t)=>!e.assetType||!t?null:`/apps/${t}`,pLe=(e,t)=>jJ(e,t)!==null,IJ=e=>e.app!==null,PJ=e=>e.docxAsset===null&&e.pdfFileData!==null,OJ=e=>e.docxAsset!==null,LJ=e=>e.docFileAsset!==null,FJ=e=>e.xlsxAsset!==null,BJ=e=>e.codeFileAsset!==null,UJ=e=>e.chartAsset!==null;function Ag(e){return t=>t?e(t):!1}const VJ=Ag(e=>e.asset_type===at.GENERATED_IMAGE&&e.generated_image!==null),HJ=Ag(e=>e.asset_type===at.GENERATED_VIDEO&&e.generated_video!==null),zJ=Ag(e=>e.asset_type===at.CODE_ASSET&&e.code!==null),WJ=Ag(e=>e.asset_type===at.QUIZ&&e.quiz!==null),GJ=Ag(e=>e.asset_type===at.FLASHCARDS&&e.flashcards!==null);async function hLe(e,t="slides.pptx"){try{const{convertHtmlToPptx:n}=await q(async()=>{const{convertHtmlToPptx:r}=await import("./SlideConverter-DErf2_BF.js");return{convertHtmlToPptx:r}},__vite__mapDeps([152,1,3,4,8,9,6,7,10,11,12]));await n(e,t)}catch(n){throw Z.error("Failed to export slides to PPTX",{error:n}),new Error("Failed to export slides to PowerPoint format")}}const $J=.75,gLe=96,qJ=1920,KJ=1080,xn=e=>e/gLe,Nl=e=>parseFloat(e)*$J,Fs=e=>{if(!e||e==="transparent"||e==="rgba(0, 0, 0, 0)")return"FFFFFF";const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!t){const n=e.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/);if(n&&n[1]){const r=n[1];return r.length===3?r.split("").map(s=>s+s).join("").toUpperCase():r.toUpperCase()}return"000000"}return t.slice(1,4).map(n=>parseInt(n).toString(16).padStart(2,"0")).join("").toUpperCase()},YJ=e=>{if(!e)return null;const t=e.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);if(!t||!t[4])return null;const n=parseFloat(t[4]);return Math.round((1-n)*100)},yLe=.85;function Fbt(){return new Map}function xLe(e){return/(repeating-)?(linear|radial|conic)-gradient\(/.test(e)}function vLe(e){const t=e.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/);if(t)return t[0];const n=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return n?`rgb(${n[1]}, ${n[2]}, ${n[3]})`:null}function bLe(e,t,n,r){const s=t.match(/linear-gradient\(([^,]+),/);let o=180;if(s?.[1]){const m=s[1].trim();m.includes("deg")?o=parseFloat(m):m==="to top"?o=0:m==="to right"?o=90:m==="to bottom"?o=180:m==="to left"?o=270:m==="to top right"?o=45:m==="to bottom right"?o=135:m==="to bottom left"?o=225:m==="to top left"&&(o=315)}const a=(o-90)*Math.PI/180,i=n/2-Math.cos(a)*n/2,c=r/2-Math.sin(a)*r/2,u=n/2+Math.cos(a)*n/2,f=r/2+Math.sin(a)*r/2;return e.createLinearGradient(i,c,u,f)}function _Le(e,t,n){return e.createRadialGradient(t/2,n/2,0,t/2,n/2,Math.max(t,n)/2)}function wLe(e,t,n,r){const s=t.match(/conic-gradient\(from\s+([\d.]+)deg/),i=((s?.[1]?parseFloat(s[1]):0)-90)*Math.PI/180;return e.createConicGradient(i,n/2,r/2)}function CLe(e,t=qJ,n=KJ,r){const s=`${e}:${t}x${n}`;if(r){const o=r.get(s);if(o)return o}try{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d");if(!a||e.includes("repeating-"))return null;const i=e.includes("linear-gradient"),c=e.includes("radial-gradient"),u=e.includes("conic-gradient");if(!i&&!c&&!u)return null;let f;i?f=bLe(a,e,t,n):c?f=_Le(a,t,n):f=wLe(a,e,t,n);const m=/(rgba?\([^)]+\)|#[0-9A-Fa-f]{3,6})\s+([\d.]+)(deg|%)/g,p=Array.from(e.matchAll(m));if(p.length===0)return null;p.forEach(g=>{const y=g[1],x=g[2],v=g[3];if(!y||!x||!v)return;let b;v==="%"?b=parseFloat(x)/100:b=parseFloat(x)/360,f.addColorStop(Math.max(0,Math.min(1,b)),y)}),a.fillStyle=f,a.fillRect(0,0,t,n);const h=o.toDataURL("image/jpeg",yLe);return r&&r.set(s,h),h}catch{return null}}const SLe=(e,t,n)=>{const r=(e.ownerDocument.defaultView||window).getComputedStyle(e),s=r.backgroundImage;let o=r.backgroundColor;if((o==="rgba(0, 0, 0, 0)"||o==="transparent")&&e.className.includes("bg-")){const a=e.className.match(/bg-(\w+)/);if(a){const i=a[0],c=t.querySelectorAll("style");let u="";c.forEach(f=>{const m=f.textContent||"",p=Array.from(m.matchAll(/--color-(\w+):\s*([^;]+);/g)),h={};for(const x of p)h[`--color-${x[1]}`]=x[2]?.trim()||"";const g=new RegExp(`\\.${i}\\s*{[^}]*background-color:\\s*([^;]+);`,"s"),y=m.match(g);if(y){let x=y[1]?.trim()||"";if(x.startsWith("var(")){const v=x.match(/var\((--[^)]+)\)/)?.[1];v&&h[v]&&(x=h[v])}if(x.startsWith("#")){let v=x.substring(1);v.length===3&&(v=v.split("").map(S=>S+S).join(""));const b=parseInt(v.substring(0,2),16),_=parseInt(v.substring(2,4),16),w=parseInt(v.substring(4,6),16);u=`rgb(${b}, ${_}, ${w})`}else u=x}}),u&&(o=u)}}if(s&&s!=="none")if(xLe(s)){const a=e.getBoundingClientRect(),i=Math.round(a.width)||qJ,c=Math.round(a.height)||KJ,u=CLe(s,i,c,n);if(u)return{gradient:u};{const f=vLe(s);f&&(o=f)}}else{const a=s.match(/url\(["']?([^"')]+)["']?\)/);if(a&&a[1])return{path:a[1]}}return{color:Fs(o)}},Rl=e=>(e.ownerDocument.defaultView||window).getComputedStyle(e),ELe=e=>((e||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),kLe=e=>e==="bold"||parseInt(e||"400")>=600,MLe=e=>e==="italic",ME=e=>{const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return!t||!t[1]||!t[2]||!t[3]?null:{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3]),a:t[4]?parseFloat(t[4]):1}},TLe=(e,t)=>{const n=ME(e),r=ME(t);if(!n||!r)return null;const s=Math.round(n.r*n.a+r.r*(1-n.a)),o=Math.round(n.g*n.a+r.g*(1-n.a)),a=Math.round(n.b*n.a+r.b*(1-n.a));return Fs(`rgb(${s}, ${o}, ${a})`)},TE=e=>!!e&&e!=="rgba(0, 0, 0, 0)"&&e!=="transparent",ALe=(e,t)=>{for(const n of e){const r=n.backgroundColor;if(TE(r)){const s=ME(r);return s&&s.a<1?TLe(r,t)??void 0:Fs(r)}}},NLe=e=>{if(e.borderBottomWidth&&parseFloat(e.borderBottomWidth)>0){const t={type:"none"},n={pt:parseFloat(e.borderBottomWidth),color:Fs(e.borderBottomColor)};return[t,t,n,t]}},RLe=e=>{if(!e||e==="none"||e.match(/inset/))return null;const n=e.match(/rgba?\([^)]+\)/),r=e.match(/([-\d.]+)(px|pt)/g);if(!r||r.length<2)return null;const s=parseFloat(r[0]),o=parseFloat(r[1]||"0"),a=r.length>2?parseFloat(r[2]||"0"):0;let i=0;(s!==0||o!==0)&&(i=Math.atan2(o,s)*(180/Math.PI),i<0&&(i+=360));const c=Math.sqrt(s*s+o*o)*$J;let u=.5;if(n){const f=n[0].match(/[\d.]+\)$/);f&&(u=parseFloat(f[0].replace(")","")))}return{type:"outer",angle:Math.round(i),blur:a*.75,color:n?Fs(n[0]):"000000",offset:c,opacity:u}},AE=(e,t={})=>{const n=[];let r=!1;e.childNodes.forEach(o=>{const a=o.nodeType===Node.TEXT_NODE||o.tagName==="BR";if(a){const i=o.tagName==="BR"?` -`:(o.nodeValue||o.textContent||"").replace(/\s+/g," "),c=n[n.length-1];r&&c&&c.text?c.text+=i:n.push({text:i,options:{...t}})}else if(o.nodeType===Node.ELEMENT_NODE&&o.textContent?.trim()){const i=o,c={...t},u=(i.ownerDocument.defaultView||window).getComputedStyle(i);if(["SPAN","B","STRONG","I","EM","U"].includes(i.tagName)){if((u.fontWeight==="bold"||parseInt(u.fontWeight)>=600)&&(c.bold=!0),u.fontStyle==="italic"&&(c.italic=!0),u?.textDecoration?.includes("underline")&&(c.underline={style:"sng"}),u.color&&u.color!=="rgb(0, 0, 0)"){c.color=Fs(u.color);const m=YJ(u.color);m!==null&&(c.transparency=m)}u?.fontSize&&(c.fontSize=Nl(u.fontSize)),AE(i,c).forEach(m=>n.push(m))}}r=a});const s=n?.[0];if(s&&s.text){s.text=s.text.replace(/^\s+/,"");const o=n?.[n.length-1];o&&o.text&&(o.text=o.text.replace(/\s+$/,""))}return n.filter(o=>o.text&&o.text.length>0)},DLe=e=>{if(e.display==="flex"){const t=e.alignItems;if(t==="center")return"middle";if(t==="flex-end")return"bottom"}else{const t=e.verticalAlign;if(t==="middle")return"middle";if(t==="bottom")return"bottom"}return"top"},jLe=e=>{const t=e.textAlign,n=e.direction;return t==="left"||t==="right"||t==="center"||t==="justify"?t:t==="start"?n==="rtl"?"right":"left":t==="end"?n==="rtl"?"left":"right":"center"},ILe=e=>{const t=e.whiteSpace;return!(t==="nowrap"||t==="pre")},PLe=e=>{const t=e.overflow,n=e.textOverflow;return t==="hidden"&&n==="ellipsis"?"none":"shrink"},OLe=e=>{const t=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,r=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0,o=Math.max(t,n,r,s);return Nl(o.toString())},LLe=e=>({fontSize:Nl(e.fontSize),fontFace:((e.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(e.color),bold:e?.fontWeight==="bold"||parseInt(e?.fontWeight||"400")>=600,italic:e?.fontStyle==="italic",align:jLe(e),valign:DLe(e),wrap:ILe(e),margin:OLe(e),fit:PLe(e)}),FLe=e=>{const t=[];return e.querySelectorAll(".placeholder").forEach(n=>{const r=n.getBoundingClientRect(),s=e.getBoundingClientRect();t.push({id:n.id||`placeholder-${t.length}`,x:xn(r.left-s.left),y:xn(r.top-s.top),w:xn(r.width),h:xn(r.height)})}),t},BLe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("IMG").forEach(s=>{if(t.has(s))return;const o=s,a=s.getBoundingClientRect();a.width>0&&a.height>0&&(n.push({type:"image",src:o.src,position:{x:xn(a.left-r.left),y:xn(a.top-r.top),w:xn(a.width),h:xn(a.height)}}),t.add(s))}),n},ULe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("DIV, SPAN").forEach(s=>{if(t.has(s))return;const o=(s.ownerDocument.defaultView||window).getComputedStyle(s),a=o.backgroundColor&&o.backgroundColor!=="rgba(0, 0, 0, 0)",i=parseFloat(o.borderWidth)>0;if(a||i){const c=s.getBoundingClientRect();if(c.width>0&&c.height>0){const u=o.boxShadow?RLe(o.boxShadow):null,f=parseFloat(o.borderRadius)||0;let m="",p=!1,h;Array.from(s.children).length>0||(m=s.textContent?.trim()||"",p=m.length>0,p&&(h=LLe(o))),n.push({type:"shape",text:m,position:{x:xn(c.left-r.left),y:xn(c.top-r.top),w:xn(c.width),h:xn(c.height)},style:h,shape:{fill:a?Fs(o.backgroundColor):null,transparency:a&&o.backgroundColor?YJ(o.backgroundColor):null,line:i?{color:Fs(o.borderColor),width:Nl(o.borderWidth)}:null,rectRadius:f>0?f/10:0,shadow:u}}),p&&t.add(s)}}}),n},VLe=e=>{if(!e.textContent?.trim())return!1;const n=e.parentElement;return!(n&&["P","H1","H2","H3","H4","H5","H6","LI","SPAN"].includes(n.tagName))},HLe=e=>{if(!e.textContent?.trim())return!1;let n=!1;if(e.childNodes.forEach(o=>{o.nodeType===Node.TEXT_NODE&&o.textContent?.trim()&&(n=!0)}),!n)return!1;const r=e.parentElement;return!(r&&["P","H1","H2","H3","H4","H5","H6","LI","SPAN"].includes(r.tagName)||e.querySelectorAll("P, H1, H2, H3, H4, H5, H6, UL, OL, DIV, SPAN").length>0)},zLe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("P, H1, H2, H3, H4, H5, H6, UL, OL, SPAN, DIV").forEach(s=>{if(t.has(s)||s.tagName==="SPAN"&&!VLe(s)||s.tagName==="DIV"&&!HLe(s))return;const o=(s.ownerDocument.defaultView||window).getComputedStyle(s),a=s.getBoundingClientRect();if(a.width>0&&a.height>0){const i=Nl(o.fontSize),c=parseFloat(o.lineHeight)||i*1.2;if(s.tagName==="UL"||s.tagName==="OL"){const u=Array.from(s.querySelectorAll("li")),f=[];u.forEach((m,p)=>{const h=p===u.length-1,g=AE(m);if(g.length>0){const y=g[0];if(!y)return;if(y.text&&(y.text=y.text.replace(/^[•\-*▪▸]\s*/,"")),y.options||(y.options={}),y.options.bullet=!0,!h){const x=g[g.length-1];if(!x)return;x.options||(x.options={}),x.options.breakLine=!0}f.push(...g)}t.add(m)}),f.length>0&&(n.push({type:"list",items:f,position:{x:xn(a.left-r.left),y:xn(a.top-r.top),w:xn(a.width),h:xn(a.height)},style:{fontSize:i,fontFace:((o.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(o.color),align:o.textAlign,lineSpacing:Nl(c.toString()),margin:0}}),t.add(s))}else{const u=AE(s),f=u.length===1?u[0]?.text:u,m=a.height<=c*1.5;let p=xn(a.left-r.left),h=xn(a.width);if(m){const g=a.width*.02,y=o.textAlign;y==="center"?(p=xn(a.left-r.left-g/2),h=xn(a.width+g)):(y==="right"&&(p=xn(a.left-r.left-g)),h=xn(a.width+g))}n.push({type:s.tagName.toLowerCase(),text:f,position:{x:p,y:xn(a.top-r.top),w:h,h:xn(a.height)},style:{fontSize:i,fontFace:((o.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(o.color),bold:o?.fontWeight==="bold"||parseInt(o?.fontWeight||"400")>=600,italic:o?.fontStyle==="italic",underline:o?.textDecoration?.includes("underline")?{style:"sng"}:void 0,align:o.textAlign,lineSpacing:Nl(c.toString()),margin:0}}),t.add(s)}}}),n},WLe=e=>{const t=[];if(Array.from(e.children).length>0&&e.childNodes.forEach(r=>{if(r.nodeType===Node.TEXT_NODE){const s=r.textContent?.trim();if(s){const o=Rl(e);t.push({text:s,options:{color:Fs(o.color)}})}}else if(r.nodeType===Node.ELEMENT_NODE){const s=r,o=s.textContent?.trim();if(o){const a=Rl(s);t.push({text:o,options:{color:Fs(a.color)}})}}}),t.length===0){const r=e.textContent?.trim();if(r){const s=Rl(e);t.push({text:r,options:{color:Fs(s.color)}})}}return t},yw=(e,t,n)=>{const r=[];return e.forEach(s=>{const o=[],a=Rl(s);s.querySelectorAll("th, td").forEach(i=>{const c=i;o.push(GLe(c,a,t,n))}),o.length>0&&r.push(o)}),r},GLe=(e,t,n,r)=>{const s=Rl(e),a={text:WLe(e),options:{fontSize:Nl(s.fontSize),fontFace:ELe(s.fontFamily),bold:kLe(s.fontWeight),italic:MLe(s.fontStyle),align:s.textAlign||"left",valign:"middle"}},i=ALe([s,t,n].filter(u=>u!==null),r);i&&a.options&&(a.options.fill={color:i});const c=NLe(s);return c&&a.options&&(a.options.border=c),a},$Le=(e,t)=>{const n=[],r=e.getBoundingClientRect(),s=Rl(e),o=TE(s.backgroundColor)?s.backgroundColor:"rgb(255, 255, 255)";return e.querySelectorAll("TABLE").forEach(a=>{if(t.has(a))return;const i=a,c=a.getBoundingClientRect();if(c.width>0&&c.height>0){const u=[],f=i.parentElement,m=f?Rl(f):null,p=m&&TE(m.backgroundColor)?m.backgroundColor:o,h=i.querySelectorAll("thead tr"),g=i.querySelector("thead"),y=g?Rl(g):null;u.push(...yw(h,y,p));const x=i.querySelectorAll("tbody tr");if(u.push(...yw(x,null,p)),u.length===0){const v=i.querySelectorAll(":scope > tr");u.push(...yw(v,null,p))}u.length>0&&(n.push({type:"table",rows:u,position:{x:xn(c.left-r.left),y:xn(c.top-r.top),w:xn(c.width),h:xn(c.height)}}),t.add(a),i.querySelectorAll("*").forEach(v=>t.add(v)))}}),n};function dI(e,t,n){const r=[],s=new Set,o=SLe(e,t,n),a=FLe(e);a.forEach(p=>{const h=e.querySelector(`#${p.id}`);h&&s.add(h)});const i=ULe(e,s),c=BLe(e,s),u=$Le(e,s),f=zLe(e,s),m=[...i,...c,...u,...f];return{background:o,elements:m,placeholders:a,errors:r}}const QJ=` -/* ========== CSS Variables ========== */ -:root { - /* Typography */ - --font-family-display: Arial, sans-serif; - --font-weight-display: 600; - --font-family-content: Arial, sans-serif; - --font-weight-content: 400; - --font-size-content: 16px; - --line-height-content: 1.4; - - /* Colors - Surface */ - --color-surface: #ffffff; - --color-surface-foreground: #1d1d1d; - - /* Colors - Primary */ - --color-primary: #1791e8; - --color-primary-light: #3ba1ec; - --color-primary-dark: #1581d4; - --color-primary-foreground: #fafafa; - - /* Colors - Secondary */ - --color-secondary: #f5f5f5; - --color-secondary-foreground: #171717; - - /* Colors - Utility */ - --color-muted: #f5f5f5; - --color-muted-foreground: #737373; - --color-accent: #f5f5f5; - --color-accent-foreground: #171717; - --color-border: #c8c8c8; - - /* Spacing & Layout */ - --spacing: 0.25rem; - --gap: calc(var(--spacing) * 4); - --radius: 0.4rem; - --radius-pill: 999em; -} - -/* ========== Base Reset ========== */ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -/* ========== Slide Container ========== */ -section.slide { - width: 960px !important; - height: 540px !important; - overflow: hidden; - font-family: var(--font-family-content); - font-weight: var(--font-weight-content); - font-size: var(--font-size-content); - line-height: var(--line-height-content); - color: var(--color-surface-foreground); - background: var(--color-surface); - display: flex; - margin: 0; - padding: 0; - position: relative; -} - -/* Body for single slide mode */ -body { - width: 960px; - height: 540px; - overflow: hidden; - font-family: var(--font-family-content); - font-weight: var(--font-weight-content); - font-size: var(--font-size-content); - line-height: var(--line-height-content); - color: var(--color-surface-foreground); - background: var(--color-surface); - display: flex; - margin: 0; - padding: 0; -} - -/* ========== Typography ========== */ -h1, h2, h3, h4, h5, h6 { - font-family: var(--font-family-display); - font-weight: var(--font-weight-display); - line-height: 1.2; - margin: 0; -} - -h1 { font-size: 3rem; } -h2 { font-size: 2.25rem; } -h3 { font-size: 1.875rem; } -h4 { font-size: 1.5rem; } -h5 { font-size: 1.25rem; } -h6 { font-size: 1.125rem; } - -p { margin: 0; } - -ul, ol { - margin: 0; - padding-left: 1.5em; -} - -li { - margin: 0.25em 0; -} - -/* ========== Layout System ========== */ - -/* Container Classes */ -.row { - display: flex; - flex-direction: row; - align-items: center; - justify-content: stretch; -} - -.col { - display: flex; - flex-direction: column; - align-items: stretch; - justify-content: center; -} - -/* Flex Item Behavior */ -.fill-width { - flex: 1; - align-self: stretch; -} - -.fill-height { - flex: 1; - align-self: stretch; -} - -.row .fill-width { - flex: 1; -} - -.col .fill-height { - flex: 1; -} - -.items-fill-width > * { - flex: 1; - align-self: stretch; -} - -.items-fill-height > * { - flex: 1; - align-self: stretch; -} - -.fit { - flex: none; - align-self: auto; -} - -.fit-width { - flex: none; -} - -.fit-height { - flex: none; -} - -/* ========== Alignment ========== */ - -/* Container alignment */ -.center { - align-items: center; - justify-content: center; -} - -.start { - align-items: flex-start; - justify-content: flex-start; -} - -.end { - align-items: flex-end; - justify-content: flex-end; -} - -.stretch { - align-items: stretch; - justify-content: stretch; -} - -.between { - justify-content: space-between; -} - -.around { - justify-content: space-around; -} - -.evenly { - justify-content: space-evenly; -} - -/* Self alignment */ -.self-center { - align-self: center; -} - -.self-start { - align-self: flex-start; -} - -.self-end { - align-self: flex-end; -} - -.self-stretch { - align-self: stretch; -} - -/* ========== Spacing ========== */ - -/* Padding */ -.p-0 { padding: 0; } -.p-2 { padding: calc(var(--spacing) * 2); } -.p-4 { padding: calc(var(--spacing) * 4); } -.p-6 { padding: calc(var(--spacing) * 6); } -.p-8 { padding: calc(var(--spacing) * 8); } -.p-12 { padding: calc(var(--spacing) * 12); } -.p-16 { padding: calc(var(--spacing) * 16); } -.p-24 { padding: calc(var(--spacing) * 24); } -.p-32 { padding: calc(var(--spacing) * 32); } - -/* Gap */ -.gap-0 { gap: 0; } -.gap-xs { gap: calc(var(--spacing) * 2); } -.gap-sm { gap: calc(var(--spacing) * 4); } -.gap-md { gap: calc(var(--spacing) * 8); } -.gap-lg { gap: calc(var(--spacing) * 16); } -.gap-xl { gap: calc(var(--spacing) * 24); } -.gap-2xl { gap: calc(var(--spacing) * 32); } - -/* ========== Colors ========== */ - -/* Background colors */ -.bg-primary { - background-color: var(--color-primary); - color: var(--color-primary-foreground); -} - -.bg-secondary { - background-color: var(--color-secondary); - color: var(--color-secondary-foreground); -} - -.bg-muted { - background-color: var(--color-muted); - color: var(--color-muted-foreground); -} - -.bg-accent { - background-color: var(--color-accent); - color: var(--color-accent-foreground); -} - -/* Text colors */ -.text-primary { - color: var(--color-primary); -} - -.text-muted { - color: var(--color-muted-foreground); -} - -/* ========== Utilities ========== */ - -.rounded { - border-radius: var(--radius); -} - -.rounded-lg { - border-radius: calc(var(--radius) * 2); -} - -.rounded-full { - border-radius: var(--radius-pill); -} - -.shadow { - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); -} - -.shadow-lg { - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); -} - -.border { - border: 1px solid var(--color-border); -} - -/* Text alignment */ -.text-left { text-align: left; } -.text-center { text-align: center; } -.text-right { text-align: right; } -.text-justify { text-align: justify; } - -/* Font sizes */ -.text-xs { font-size: 0.75rem; } -.text-sm { font-size: 0.875rem; } -.text-base { font-size: 1rem; } -.text-lg { font-size: 1.125rem; } -.text-xl { font-size: 1.25rem; } -.text-2xl { font-size: 1.5rem; } -.text-3xl { font-size: 1.875rem; } -.text-4xl { font-size: 2.25rem; } -.text-5xl { font-size: 3rem; } - -/* Font weights */ -.font-normal { font-weight: 400; } -.font-medium { font-weight: 500; } -.font-semibold { font-weight: 600; } -.font-bold { font-weight: 700; } - -/* Display */ -.hidden { display: none; } -.block { display: block; } -.inline { display: inline; } -.inline-block { display: inline-block; } -.flex { display: flex; } -`;function fI(e,t,n){"gradient"in e.background?t.addImage({data:e.background.gradient,x:0,y:0,w:"100%",h:"100%"}):t.background=e.background;for(const r of e.elements)switch(r.type){case"table":{r.rows&&r.rows.length>0&&t.addTable(r.rows,{x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,autoPage:!1,border:{type:"none"}});break}case"image":{t.addImage({path:r.src,x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h});break}case"shape":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h};r.shape&&r.shape.rectRadius>0?(s.shape=n.ShapeType.roundRect,s.rectRadius=r.shape.rectRadius):s.shape=n.ShapeType.rect,r.shape?.fill&&(s.fill={color:r.shape.fill},r.shape.transparency!=null&&(s.fill.transparency=r.shape.transparency)),r.shape?.line&&(s.line=r.shape.line),r.shape?.shadow&&(s.shadow=r.shape.shadow),r.style&&(r.style.fontSize&&(s.fontSize=r.style.fontSize),r.style.fontFace&&(s.fontFace=r.style.fontFace),r.style.color&&(s.color=r.style.color),r.style.bold&&(s.bold=r.style.bold),r.style.italic&&(s.italic=r.style.italic),r.style.align&&(s.align=r.style.align),r.style.valign&&(s.valign=r.style.valign)),s.wrap=r.style?.wrap??!1,s.fit=r.style?.fit??"shrink",s.margin=r.style?.margin??0,t.addText(r.text||"",s);break}case"list":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,align:r.style?.align,valign:"top",lineSpacing:r.style?.lineSpacing,margin:r.style?.margin};t.addText(r.items??"",s);break}case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,bold:r.style?.bold,italic:r.style?.italic,underline:r.style?.underline,valign:"top",align:r.style?.align,lineSpacing:r.style?.lineSpacing,inset:0};t.addText(r.text??"",s);break}default:{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,bold:r.style?.bold,italic:r.style?.italic,underline:r.style?.underline,valign:"top",align:r.style?.align,lineSpacing:r.style?.lineSpacing,inset:0};t.addText(r.text??"",s)}}}const Bbt="exported-slides.pptx",qLe=300,KLe=100,YLe="section.slide";async function mI(e,t,n,r=!1){const s=t.querySelectorAll(YLe);if(s.length>0)for(let o=0;ou.type!=="image")});const c=e.addSlide();fI(i,c,e)}else{const o=n.createElement("section");o.className="slide",o.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(o);const a=n.createElement("style");a.textContent=QJ,t.insertBefore(a,t.firstChild),await new Promise(u=>setTimeout(u,KLe));let i=dI(o,t);r&&(i={...i,elements:i.elements.filter(u=>u.type!=="image")});const c=e.addSlide();fI(i,c,e)}}async function QLe(e){const t=document.createElement("iframe");t.style.cssText=` - position: fixed !important; - left: -10000px !important; - top: -10000px !important; - width: 1920px !important; - height: 1080px !important; - border: none !important; - visibility: hidden !important; - pointer-events: none !important; - opacity: 0 !important; - display: block !important; - `,t.setAttribute("aria-hidden","true"),document.body.appendChild(t);try{const n=t.contentDocument||t.contentWindow?.document;if(!n)throw new Error("Failed to access iframe document");n.body||(n.write(""),n.close());const r=n.createElement("div");if(r.style.cssText=` - width: 1920px; - height: 1080px; - `,n.body.appendChild(r),r.innerHTML=e,!r.querySelector("style")){const o=n.createElement("style");o.textContent=QJ,r.insertBefore(o,r.firstChild)}await new Promise(o=>setTimeout(o,qLe));let s=new(await q(async()=>{const{default:o}=await import("./pptxgen.es-RTyDt0G5.js");return{default:o}},__vite__mapDeps([153,1]))).default;s.layout="LAYOUT_16x9",s.author="Perplexity",s.title="Converted Presentation",s.company="Perplexity AI";try{return await mI(s,r,n,!1),await s.write({outputType:"blob"})}catch{return s=new(await q(async()=>{const{default:i}=await import("./pptxgen.es-RTyDt0G5.js");return{default:i}},__vite__mapDeps([153,1]))).default,s.layout="LAYOUT_16x9",s.author="Perplexity",s.title="Converted Presentation",s.company="Perplexity AI",await mI(s,r,n,!0),await s.write({outputType:"blob"})}}finally{t.parentNode&&document.body.removeChild(t)}}function XLe(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(typeof r.result=="string"){const s=r.result.split(",")[1];s?t(s):n(new Error("Failed to extract base64 from data URL"))}else n(new Error("Failed to convert blob to base64"))},r.onerror=n,r.readAsDataURL(e)})}async function pI({htmlContent:e,filename:t,saveFile:n}){const r=await QLe(e);if(!r)throw new Error("Failed to generate PPTX file");const s=await XLe(r),o=t.endsWith(".pptx")?t:`${t}.pptx`;return{webViewLink:(await n({fileName:o,fileBytes:s,mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation",connectionType:"GOOGLE_DRIVE"})).web_view_link}}const ZLe={xlsx:B("file-type-xls"),csv:B("file-type-csv"),pdf:B("file-type-pdf"),docx:B("file-type-doc"),pptx:B("file-type-ppt")},JLe={xlsx:"XLSX",csv:"CSV",pdf:"PDF",docx:"DOCX",pptx:"PPTX",md:"Markdown",png:"Image",jpg:"Image",jpeg:"Image"};function eFe(e){return e?ZLe[e.toLowerCase()]??B("download"):B("download")}function tFe(e,t){if(!t)return hI(e);const n=t.toLowerCase();return JLe[n]??hI(e)}function hI(e){return e==="SLIDES"||e==="APP"?"HTML":"File"}const nFe=({reason:e})=>{const{$t:t}=J(),{openToast:n}=hn(),r=d.useCallback(async s=>{try{const o=await Pz({name:s,reason:e,autoClose:!0});if(!o)return n({message:t({defaultMessage:"Unable to start authentication.",id:"7sb7u3pWWr"}),variant:"error",timeout:3}),!1;const a=600,i=700,c=window.screenX+(window.outerWidth-a)/2,u=window.screenY+(window.outerHeight-i)/2,f=window.open(o,"oauth-popup",`width=${a},height=${i},left=${c},top=${u},popup=yes,noopener=no`);return f?new Promise(m=>{const p=setInterval(()=>{f.closed&&(clearInterval(p),Z.info("OAuth popup closed",{connectorName:s,reason:e}),m(!0))},500);setTimeout(()=>{clearInterval(p),f.closed||(f.close(),Z.warn("OAuth popup timeout",{connectorName:s,reason:e}),m(!1))},300*1e3)}):(n({message:t({defaultMessage:"Please allow popups to connect your account.",id:"gMeARpuir7"}),variant:"error",timeout:3}),!1)}catch(o){return Z.error("Failed to start OAuth flow",{error:o,connectorName:s,reason:e}),n({message:t({defaultMessage:"Failed to connect account. Please try again.",id:"l9HkZMlKDR"}),variant:"error",timeout:3}),!1}},[e,t,n]);return d.useMemo(()=>({startOAuthFlow:r}),[r])},rFe=({reason:e})=>{const[t,n]=d.useState(!1),r=d.useCallback(async s=>{n(!0);try{const{data:o,error:a}=await de.POST("/rest/connectors/save-file",e,{body:{file_name:s.fileName,s3_url:s.s3Url,file_bytes:s.fileBytes,mime_type:s.mimeType,connection_type:s.connectionType,parent_remote_id:s.parentRemoteId},timeoutMs:Qe()});if(a){Z.error("Failed to save file to connector",{error:a,request:s,errorMessage:a instanceof Error?a.message:"Unknown error"});const i=a.detail;return{success:!1,errorCode:i?.error_code,errorMessage:i?.error_message||"Failed to save file"}}return o?{success:o.success,webViewLink:o.web_view_link??void 0,errorCode:o.error_code??void 0,errorMessage:o.error_message??void 0}:{success:!1,errorMessage:"No response from server"}}catch(o){return Z.error("Unexpected error saving file to connector",{err:o,request:s,errorMessage:o instanceof Error?o.message:"Unknown error"}),{success:!1,errorMessage:o instanceof Error?o.message:"Unknown error"}}finally{n(!1)}},[e]);return d.useMemo(()=>({saveFile:r,isLoading:t}),[r,t])};function sFe({asset:e,assetResult:t}){const n=NJ(e),r=[],{session:s}=Ne(),{trackEvent:o}=Xe(s),{$t:a}=J(),{openToast:i}=hn(),[c,u]=d.useState(!1),f=Wt(),{downloadS3Asset:m}=pJ({reason:"canvas-pdf-download"}),{saveFile:p}=rFe({reason:"canvas-export-to-drive"}),{startOAuthFlow:h}=nFe({reason:"canvas-export-to-drive"}),g=d.useCallback(async v=>{if(!c){u(!0);try{const b=uI(n,v.filename??"download");let _=await p({fileName:b,s3Url:v.url,connectionType:"GOOGLE_DRIVE"});if(_.errorCode==="MISSING_SCOPE"||_.errorCode==="ACCOUNT_NOT_CONNECTED"||_.errorCode==="AUTH_ERROR")if(await h("google_drive"))_=await p({fileName:b,s3Url:v.url,connectionType:"GOOGLE_DRIVE"});else return;if(_.success&&_.webViewLink)t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"File exported to Google Drive",id:"FDX8mJLmJm"}),variant:"success",timeout:3}),window.open(_.webViewLink,"_blank");else{let w=a({defaultMessage:"Failed to export file",id:"5/D0jskfku"});_.errorCode==="FILE_TOO_LARGE"?w=a({defaultMessage:"File exceeds 20MB limit for export",id:"UZ4y2AORv5"}):_.errorMessage&&(w=_.errorMessage),i({message:w,variant:"error",timeout:3}),Z.error("Failed to export file to Drive",{errorCode:_.errorCode,errorMessage:_.errorMessage,fileName:v.filename})}}catch(b){Z.error("Unexpected error during export",{error:b,info:v}),i({message:a({defaultMessage:"Failed to export file",id:"5/D0jskfku"}),variant:"error",timeout:3})}finally{u(!1)}}},[n,c,p,h,t,e,o,a,i]),y=d.useCallback(async(v,b)=>{if(!c){u(!0);try{const _=await pI({htmlContent:v,filename:b,saveFile:async w=>{const S=await p({...w});if(!S.success)throw new Error(`Export failed: ${S.errorCode??"unknown error"}${S.errorMessage?` - ${S.errorMessage}`:""}`);return{web_view_link:S.webViewLink??""}}});t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"Slides exported to Google Drive",id:"efsXWg4g3j"}),variant:"success",timeout:3}),window.open(_.webViewLink,"_blank")}catch(_){if(_ instanceof Error&&(_.message.includes("MISSING_SCOPE")||_.message.includes("ACCOUNT_NOT_CONNECTED")||_.message.includes("AUTH_ERROR")))if(await h("google_drive"))try{const S=await pI({htmlContent:v,filename:b,saveFile:async C=>{const E=await p({...C});if(!E.success)throw new Error(`Export failed: ${E.errorCode??"unknown error"}${E.errorMessage?` - ${E.errorMessage}`:""}`);return{web_view_link:E.webViewLink??""}}});t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"Slides exported to Google Drive",id:"efsXWg4g3j"}),variant:"success",timeout:3}),window.open(S.webViewLink,"_blank");return}catch(S){Z.error("Failed to export slides after OAuth",{error:S})}else return;i({message:_ instanceof Error&&_.message?_.message:a({defaultMessage:"Failed to export slides",id:"W62bIrXvad"}),variant:"error",timeout:3}),Z.error("Failed to export slides to Drive",{error:_})}finally{u(!1)}}},[c,p,h,t,e,o,a,i]);if(GOe(e)&&IJ(n)&&n.app.source_content){const v=AJ(n)||"slides",b=b3(`${v}.pptx`);r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Download as PPTX",id:"MbQGjmBtrT"}),icon:B("file-type-ppt"),category:"download",onClick:async()=>{t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"download"});try{await hLe(n.app.source_content,b)}catch{}}}),f&&r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Export PPTX to GDrive",id:"vxG0vz9KXW"}),icon:B("brand-google-drive"),category:"export",onClick:()=>{y(n.app.source_content,v)}})}return e?.download_info&&e.download_info.length>0&&e.download_info.forEach(v=>{if(!v.url||!Ux(v.url))return;const b=iW(v.filename),_=eFe(b),w=tFe(e.asset_type,b),S=uI(n,v.filename??"download");r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Download as {fileType}",id:"PJh4v0uaV6"},{fileType:w}),icon:_,category:"download",onClick:()=>{t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"download"}),m({url:v.url,filename:S})}}),v.is_exportable&&f&&r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Export {fileType} to GDrive",id:"IHrc/RdUMs"},{fileType:w}),icon:B("brand-google-drive"),category:"export",onClick:()=>{g(v)}})}),r}function oFe(e,t,n){return e?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.app?.url??null,name:t.app?.name??null,isFinal:n.streamingChild?.app?.final??!1,isStreaming:n.isStreamingChildActive}:IJ(t)?{final:t.app.source_content??null,url:t.app.url??null,name:t.app.name??null,isFinal:t.app.final??!1,isStreaming:!t.app.final}:FJ(t)?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.xlsxAsset.url??null,name:t.xlsxAsset.name??null,isFinal:n.streamingChild?.xlsx_file?.final??!1,isStreaming:n.isStreamingChildActive}:{final:t.xlsxAsset.source_content??null,url:t.xlsxAsset.url??null,name:t.xlsxAsset.name??null,isFinal:t.xlsxAsset.final??!1,isStreaming:!t.xlsxAsset.final}:PJ(t)?{final:t.pdfFileData?.url??null,url:t.pdfFileData?.url??null,name:t.pdfFileData?.name??null,isFinal:!0,isStreaming:!1}:OJ(t)?{final:t.docxAsset.url??null,url:t.docxAsset.url??null,name:t.docxAsset.name??null,isFinal:!0,isStreaming:!1}:LJ(t)?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.docFileAsset.url??null,name:t.docFileAsset.name??null,isFinal:n.streamingChild?.doc_file?.final??!1,isStreaming:n.isStreamingChildActive}:{final:t.docFileAsset.source_content??null,url:t.docFileAsset.url??null,name:t.docFileAsset.name??null,isFinal:t.docFileAsset.final??!1,isStreaming:!t.docFileAsset.final}:UJ(t)?{final:t.chartAsset.url??null,url:t.chartAsset.url??null,name:null,isFinal:!0,isStreaming:!1}:BJ(t)?{final:null,url:null,name:t.codeFileAsset.filename??null,isFinal:!0,isStreaming:!1}:zJ(e)?{final:e.code.script??null,url:null,name:null,isFinal:!0,isStreaming:!1}:VJ(e)?{final:e.generated_image.url??null,url:e.generated_image.url??null,name:null,isFinal:!0,isStreaming:!1}:HJ(e)?{final:e.generated_video.url??null,url:e.generated_video.url??null,name:null,isFinal:!0,isStreaming:!1}:WJ(e)?{final:null,url:null,name:e.quiz.title??null,isFinal:!0,isStreaming:!1}:GJ(e)?{final:null,url:null,name:e.flashcards.title??null,isFinal:!0,isStreaming:!1}:{final:null,url:null,name:null,isFinal:!0,isStreaming:!1}:{final:null,url:null,name:null,isFinal:!0,isStreaming:!1}}function aFe(e,t){if(e?.asset_type===at.APP||e?.asset_type===at.SLIDES){const n=e.app?.final===!0,r=!!e.app?.source_content,s=n,o=r,a=[];s&&a.push(pr.Preview),o&&a.push(pr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.app?.final?i=pr.Source:n||t.streamingChild?.app?.final?i=pr.Preview:!n&&r&&(i=pr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}if(e?.asset_type===at.XLSX_FILE){const n=e.xlsx_file?.final===!0,r=!!e.xlsx_file?.source_content,s=n,o=r,a=[];s&&a.push(pr.Preview),o&&a.push(pr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.xlsx_file?.final?i=pr.Source:n||t.streamingChild?.xlsx_file?.final?i=pr.Preview:!n&&r&&(i=pr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}if(e?.asset_type===at.DOC_FILE){const n=e.doc_file?.final===!0,r=!!e.doc_file?.source_content,s=n,o=r,a=[];s&&a.push(pr.Preview),o&&a.push(pr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.doc_file?.final?i=pr.Source:n||t.streamingChild?.doc_file?.final?i=pr.Preview:!n&&r&&(i=pr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}return{supportsPreviewTab:!1,supportsCodeTab:!1,availableTabs:[],defaultTab:null}}function iFe({asset:e,allAssets:t,assetResult:n,backendUuid:r}){const s=NJ(e),o=mLe(e,t),a=d.useMemo(()=>({hasTransforms:RJ(e),isStreamingUpdate:Tg(e),streamingChild:o.streamingChild,transformedContent:o.transformedContent,parentAsset:void 0,hasStreamingChild:o.hasStreamingChild,isStreamingChildActive:o.isStreaming}),[e,o]),i=d.useMemo(()=>oFe(e,s,a),[e,s,a]),c=d.useMemo(()=>aFe(e,a),[e,a]),u=sFe({asset:e,assetResult:n}),f=d.useMemo(()=>{const p=r??n?.backend_uuid,h=pLe(s,p),g=jJ(s,p);return{supportsFullScreen:h,fullScreenUrl:g,supportsDownload:u.length>0,downloadableItems:u,supportsVersioning:!!e?.version_info}},[s,r,n,u,e]),m=d.useMemo(()=>({app:e?.asset_type===at.APP,slides:e?.asset_type===at.SLIDES,pdf:PJ(s),docx:OJ(s),docFile:LJ(s),xlsx:FJ(s),codeFile:BJ(s),chart:UJ(s),code:zJ(e),generatedImage:VJ(e),generatedVideo:HJ(e),quiz:WJ(e),flashcards:GJ(e)}),[e,s]);return{assetData:s,content:i,streaming:a,tabs:c,capabilities:f,is:m}}const XJ=()=>{const{results:e}=on(),t=d.useMemo(()=>!e||e.length===0?[]:e.map(s=>({result:s,assets:u6(s?.blocks??[],{orderedByPriority:!0})})),[e]),n=d.useMemo(()=>t.flatMap(({assets:s})=>s),[t]),r=n.length>0;return{resultAssets:t,allAssets:n,hasAssets:r}};function lFe(e,t){const{allAssets:n}=XJ(),r=d.useRef(null),s=d.useMemo(()=>Tg(e)&&DJ(e,n)||e,[e,n]),o=iFe({asset:s,allAssets:n});d.useEffect(()=>{if(o.tabs.availableTabs.length===0)return;const a=o.tabs.defaultTab;a&&r.current!==a&&(t({type:"setTab",tab:a}),r.current=a)},[o.tabs,t])}function cFe({asset:e,inFlight:t,contextUuid:n,backendUuid:r}){const{doCanvasAction:s}=Yf(),{session:o}=Ne(),{trackEvent:a}=Xe(o),{allAssets:i}=XJ(),c=d.useRef(!1),u=d.useRef(void 0),f=d.useRef(void 0),{title:m}=v6(e);d.useEffect(()=>{if(!e||!t)return;const p=e.uuid,h=TJ(e)===!0,y=!(f.current!==p)&&!u.current&&h;if(!c.current||y){let v=e;if(Tg(e)){const b=DJ(e,i);b&&(v=b)}s({type:"setAsset",assetUuid:v.uuid,title:m,backendUuid:r}),c.current||a("canvas opened",{source:"auto",contextUUID:n,entryUUID:r,contentType:e.asset_type,assetUUID:e.uuid}),c.current=!0,f.current=p}u.current=h},[e,s,t,a,n,r,m,i]),d.useEffect(()=>{t||(c.current=!1,f.current=void 0,u.current=void 0)},[t])}function uFe({data:e,inFlight:t}){const{openCanvas:n}=Yf();d.useEffect(()=>{t&&e.should_auto_open&&n()},[t,e.should_auto_open,n])}function dFe({data:e,inFlight:t}){const{doCanvasAction:n}=Yf(),r=d.useRef(void 0);d.useEffect(()=>{if(!t)return;const s={progress:e.progress,assetType:e.expected_asset_type};(r.current?.progress!==s.progress||r.current?.assetType!==s.assetType)&&(n({type:"setLoading",loading:e.progress===Jo.IN_PROGRESS,assetType:e.expected_asset_type}),r.current=s)},[e.progress,e.expected_asset_type,n,t])}const fFe=({data:e})=>{const{inFlight:t,result:{blocks:n,context_uuid:r,backend_uuid:s}}=It(),o=WIe(n,e.asset?.uuid??""),{doCanvasAction:a}=Yf();return uFe({data:e,inFlight:t}),dFe({data:e,inFlight:t}),cFe({asset:o,inFlight:t,contextUuid:r,backendUuid:s}),lFe(o,a),null},mFe=()=>{const{blocksByIntendedUsage:{canvas_mode:e}}=It();return e?.canvas_block},ZJ=()=>{const{session:e}=Ne(),{firstResult:t,inFlight:n}=on(),r=t?.author_username;return e?.user?.username===r||n};var xw,gI;function pFe(){if(gI)return xw;gI=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){if(o.constructor!==a.constructor)return!1;var i,c,u;if(Array.isArray(o)){if(i=o.length,i!=a.length)return!1;for(c=i;c--!==0;)if(!s(o[c],a[c]))return!1;return!0}var f;if(t&&o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;for(f=o.entries();!(c=f.next()).done;)if(!a.has(c.value[0]))return!1;for(f=o.entries();!(c=f.next()).done;)if(!s(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;for(f=o.entries();!(c=f.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if(i=o.length,i!=a.length)return!1;for(c=i;c--!==0;)if(o[c]!==a[c])return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf&&typeof o.valueOf=="function"&&typeof a.valueOf=="function")return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString&&typeof o.toString=="function"&&typeof a.toString=="function")return o.toString()===a.toString();if(u=Object.keys(o),i=u.length,i!==Object.keys(a).length)return!1;for(c=i;c--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[c]))return!1;if(e&&o instanceof Element)return!1;for(c=i;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&o.$$typeof)&&!s(o[u[c]],a[u[c]]))return!1;return!0}return o!==o&&a!==a}return xw=function(a,i){try{return s(a,i)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},xw}var hFe=pFe();const JJ=uo(hFe),K0=(e,t)=>{if(typeof e=="object"&&e!==null&&t in e){const n=e[t];return typeof n=="string"?n:void 0}},gFe=(e,t)=>{if(e.step_type!=="MCP_TOOL_INPUT"||t.step_type!=="MCP_TOOL_OUTPUT")return!1;const n=K0(e.content,"goal_id"),r=K0(t.content,"goal_id");if(n&&r)return n===r;const s=K0(e.content,"tool_name"),o=K0(t.content,"tool_name");return!!(s&&o&&s===o)},yFe=e=>{if(!e?.length)return[];if(!e.some(s=>s.step_type==="MCP_TOOL_INPUT"||s.step_type==="MCP_TOOL_OUTPUT"))return e;let n=-1;return e.reduce((s,o,a)=>{if(a<=n||o.step_type==="MCP_TOOL_OUTPUT")return s;const i=e[a+1];return o.step_type==="MCP_TOOL_INPUT"&&i&&gFe(o,i)?(s.push({...o,mcp_tool_output_content:i.content}),n=a+1,s):(s.push({...o}),s)},[])},xFe=e=>{switch(e){case"Notion":return Sx;case"Linear":return Ex;case"GitHub":return Mx;case"Asana":return Tx;case"Atlassian":return Ax;case"Slack":return kx;case"Wiley":return Fd;case"CB Insights":return kM;case"PitchBook":return MM;case"Statista":return TM;default:return null}},eee=d.createContext(null);function vFe(){const e=d.useContext(eee);if(!e)throw new Error("useBannerContext must be used within a Banner component");return e}const bFe=eee.Provider;function _Fe({ref:e,variant:t,children:n,onClick:r,disabled:s=!1,...o}){const{size:a}=vFe(),i=bx(e),c=wa(o),f={ref:i,...c,size:a==="default"?"small":"tiny",onClick:r,disabled:s,fullWidth:!0};return l.jsx("div",{className:"@md/banner:w-auto w-full",children:t==="text"?l.jsx(wt,{...f,variant:"text",children:n}):l.jsx(wt,{...f,variant:t,children:n})})}const wFe=ci(z("bg-subtler","mb-md pt-3","relative flex flex-col items-center w-full","rounded-xl","shadow-sm ","@md/banner:flex-row @md/banner:flex-wrap @md/banner:py-3"),{variants:{size:{default:"gap-md p-md @md/banner:gap-md",compact:"gap-sm p-sm @md/banner:gap-sm"}},defaultVariants:{size:"default"}}),CFe=ci("font-semibold",{variants:{size:{default:"text-sm",compact:"text-xs"}},defaultVariants:{size:"default"}}),SFe=ci("text-quiet mb-0 font-normal leading-[1.3]",{variants:{size:{default:"text-sm",compact:"text-xs"}},defaultVariants:{size:"default"}}),EFe=z("relative flex w-full flex-row items-center","gap-3","@md/banner:mr-sm","@md/banner:flex-[1_1_60%]"),kFe=z("flex w-full flex-col items-stretch","gap-sm","@md/banner:flex-row-reverse @md/banner:flex-wrap @md/banner:justify-end @md/banner:gap-sm @md/banner:w-auto @md/banner:items-center","@md/banner:ml-auto");function MFe({title:e,description:t,leadingAccessory:n,children:r,size:s="default"}){const o=d.useMemo(()=>({size:s}),[s]),a=d.useMemo(()=>[...Array.isArray(r)?r:[r]].reverse(),[r]);return l.jsx(bFe,{value:o,children:l.jsx("div",{className:"@container/banner",children:l.jsxs("div",{className:wFe({size:s}),children:[l.jsxs("div",{className:EFe,children:[n&&l.jsx("div",{className:"shrink-0",children:l.jsx(rn,{icon:n,size:"default"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:CFe({size:s}),children:e}),t&&l.jsx("div",{className:SFe({size:s}),children:t})]})]}),l.jsx("div",{className:kFe,children:a})]})})})}const Y0=Object.assign(MFe,{Action:_Fe}),TFe=()=>{const e=Yt(),t=iu(),n=d.useMemo(()=>e.getQueryData(t),[e,t]),{connectors:r}=Ea({reason:"useHasUnauthenticatedGmailGcal"});return d.useMemo(()=>{const s=!!r?.connectors.find(o=>o.name==="gcal"&&(!o.connected||o.has_required_scopes===!1));return!(!n||!s)},[n,r])},AFe=1e4,NFe=1e3*60,RFe=["comet-default-browser-status"],DFe=()=>{const e=un(),{data:t=null,isLoading:n,refetch:r}=mt({queryKey:RFe,queryFn:async()=>{try{return await e.getIsCometDefaultBrowser("check_default_browser")}catch{return null}},refetchInterval:s=>s?.state?.data?NFe:AFe,refetchIntervalInBackground:!0,staleTime:0});return{isDefaultBrowser:t,isDefaultBrowserLoading:n,refetch:r}},jFe=({position:e,inFlight:t,isLastResult:n,upsellInformation:r,backendUuid:s})=>{const[o,a]=d.useState(!1),[i,c]=d.useState(null);Ca();const u="sidecar_thread",{session:f}=Ne(),{trackEventOnce:m,trackEvent:p}=Xe(f),h=ZJ(),g=TFe(),{subscriptionTier:y}=$t(),{isDefaultBrowser:x}=DFe(),v=d.useMemo(()=>{if(o||!r||!r?.title||r.upsell_type==="UNSET"||e==="top"&&r.app_location!=="IN_THREAD"||e==="bottom"&&r.app_location!=="IN_THREAD_BOTTOM"||e==="input"&&r.app_location!=="IN_THREAD_INPUT"||e==="connector_auth"&&r.app_location!=="UPSELL_APP_LOCATION_UNSPECIFIED")return!1;const w=r.upsell_uuid;return!(!s||w===i||!n&&(!r.is_persistent||e==="input"||e==="router_steps"||e==="connector_auth")||e==="bottom"&&t||r.is_persistent&&(!h||r.name==="gmail_gcal_connector"&&!g||r.name==="comet_set_default_browser"&&x!==!1))},[o,r,e,s,i,n,t,h,g,x]);d.useEffect(()=>{r?.upsell_type==="UNSET"&&a(!1)},[r?.upsell_type]),d.useEffect(()=>{if(!v||!r)return;const w=s,S=r.upsell_uuid;c(S),a(!0),m("thread upsell banner viewed",{entryUUID:w,upsellType:r.upsell_type,upsellName:r.name,upsellUuid:r.upsell_uuid,cometSurface:u,subscriptionTier:y,eventMetadata:r.event_metadata}),m("upsell viewed",{upsellLocation:r.app_location,upsellUUID:r.upsell_uuid,entryUUID:w,upsellType:r.upsell_type,upsellName:r.name,cometSurface:u,subscriptionTier:y,eventMetadata:r.event_metadata})},[s,v,m,r,u,y]);const b=d.useCallback(({hideBanner:w=!0}={})=>{w&&a(!1);const S=r,C=s;if(C&&S?.upsell_type){p("thread upsell banner dismissed",{entryUUID:C,upsellType:S.upsell_type,upsellName:S.name,upsellUuid:S.upsell_uuid,cometSurface:u,subscriptionTier:y,eventMetadata:S.event_metadata}),p("upsell dismissed",{upsellLocation:S.app_location,upsellUUID:S.upsell_uuid,entryUUID:C,upsellType:S.upsell_type,upsellName:S.name,cometSurface:u,subscriptionTier:y,eventMetadata:S.event_metadata});const E=S.cta==="SHORTCUT_MODAL"?S.cta_information?.recommended_shortcut?.name:void 0;eT({upsellName:S.name,upsellInstanceIdentifier:E,interactionType:"dismiss"})}},[s,p,r,u,y]),_=d.useCallback(()=>{a(!1)},[]);return d.useMemo(()=>({show:o,handleDismiss:b,handleHide:_}),[b,o,_])},IFe=/\[([^\]]+)\]\(pplx:\/\/action\/translate\)/g;function PFe(e){const t=Array.from(e.matchAll(IFe)).map(n=>n[1]).filter(n=>n!==void 0);return[...new Set(t)]}const vw=async({queryKey:e})=>{const[t,n="",r=""]=be.unmakeQueryKey(e);return nee({entryUUID:n,reason:"useThreadTranslations",phrase:r})},OFe=(e,t)=>{switch(t.type){case"NEXT":{const n=e.currentIndex+1,r=n%e.translatePhrases.length;return!t.canLoop&&n!==r?(t.onPageChange?.(null),e):(t.onPageChange&&t.fetchTranslatedPhrase(e.translatePhrases[r]).then(s=>{t.onPageChange?.(s)}),{...e,currentPhrase:e.translatePhrases[r],currentIndex:r})}case"PREV":{const n=e.currentIndex-1+e.translatePhrases.length,r=n%e.translatePhrases.length;return!t.canLoop&&n!==r?(t.onPageChange?.(null),e):(t.onPageChange&&t.fetchTranslatedPhrase(e.translatePhrases[r]).then(s=>{t.onPageChange?.(s)}),{...e,currentPhrase:e.translatePhrases[r],currentIndex:r})}default:return e}},LFe=()=>{const{result:e}=It();return d.useMemo(()=>{const t=qt.parseAskTextField(e);return t?PFe(t.answer):[]},[e])},tee=({clickedPhrase:e,entryUUID:t,contextUUID:n,translatePhrases:r})=>{const{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback((_,w)=>{o("language learning modal advance pressed",{entryUUID:t,contextUUID:n,direction:_,source:w})},[t,n,o]),[i,c]=d.useReducer(OFe,{currentIndex:e?r.indexOf(e):0,translatePhrases:r,currentPhrase:e??r[0]}),u=i.currentPhrase,f=i.currentIndex,m=be.makeQueryKey("translation_phrase_info",t,u),p=Yt();d.useEffect(()=>{const _=r[(r.length+f-1)%r.length],w=r[(f+1)%r.length];p.prefetchQuery({queryKey:be.makeQueryKey("translation_phrase_info",t,_),queryFn:vw}),p.prefetchQuery({queryKey:be.makeQueryKey("translation_phrase_info",t,w),queryFn:vw})},[t,r,f,p]);const{data:h,isLoading:g}=mt({queryKey:m,queryFn:vw}),y=d.useCallback(async _=>nee({entryUUID:t,reason:"useThreadTranslations",phrase:_}),[t]),x=d.useCallback(({onPageChange:_,source:w,canLoop:S})=>{c({type:"NEXT",onPageChange:_,fetchTranslatedPhrase:y,canLoop:S}),a("forward",w)},[a,y]),v=d.useCallback(({onPageChange:_,source:w,canLoop:S})=>{c({type:"PREV",onPageChange:_,fetchTranslatedPhrase:y,canLoop:S}),a("backward",w)},[a,y]),{data:b}=mt({queryKey:be.makeQueryKey("translation_detected_languages",t),queryFn:()=>FFe({entryUUID:t,reason:"useThreadTranslations"})});return{groupedTranslation:h,isLoading:g,advancePage:x,previousPage:v,translatePhrases:r,currentPhrase:u,currentIndex:f,detectedLanguages:b}},nee=async({entryUUID:e,reason:t,phrase:n})=>{const{data:r,error:s}=await de.POST("/rest/translation/phrase_info",t,{body:{entry_uuid:e,translated:n},timeoutMs:3e4});return s?(Z.error(`Failed to fetch translated phrases for entry ${e}`),null):r?.translation??null},FFe=async({entryUUID:e,reason:t})=>{const{data:n}=await de.GET("/rest/translation/detect-languages/{entry_uuid}",t,{params:{path:{entry_uuid:e}},timeoutMs:5e3});return n||(Z.error(`Failed to detect languages for entry ${e}`),null)},BFe=50;function yI(e){const t=aA(0);return d.useEffect(()=>{if(!e){t.set(0);return}try{const n=new AudioContext,r=n.createMediaStreamSource(e),s=n.createAnalyser();s.fftSize=2048,r.connect(s);const o=new Uint8Array(2048),a=setInterval(()=>{s.getByteFrequencyData(o);const i=Array.from(o).reduce((c,u)=>c+u,0)/o.length/255;t.set(i*100)},BFe);return()=>{clearInterval(a),s.disconnect(),r.disconnect(),n.close()}}catch(n){Z.error("[v2v_language_learning] Audio analysis setup failed:",n);return}},[t,e]),t}function UFe({onPhraseAttemptResult:e,onConnect:t,onEndLesson:n}){const r=d.useRef(null),s=d.useRef(null),o=d.useRef(null),a=d.useRef(null),i=d.useRef(null),c=d.useRef(!1),[u,f]=d.useState(!1),[m,p]=d.useState(!1),[h,g]=d.useState(null),[y,x]=d.useState(!1),v=d.useRef(!1),[b,_]=d.useState(),w=yI(b),[S,C]=d.useState(),E=yI(S),T=d.useCallback(N=>{if(a.current){const D=a.current.getAudioTracks()[0];D&&(D.enabled=!N,x(N),v.current=N)}},[]),k=d.useCallback(N=>{const D=s.current;if(!D||D.readyState!=="open"){Z.debug("[v2v_language_learning] Channel not ready");return}try{i.current&&(D.send(JSON.stringify({type:"response.cancel",response_id:i.current})),D.send(JSON.stringify({type:"output_audio_buffer.clear"}))),D.send(JSON.stringify({type:"conversation.item.create",item:{type:"message",role:"system",content:[{type:"input_text",text:N}]}})),D.send(JSON.stringify({type:"response.create"}))}catch(j){Z.error("[v2v_language_learning] Send failed:",j)}},[]),I=d.useCallback(()=>{a.current&&(a.current.getTracks().forEach(N=>N.stop()),a.current=null),o.current&&(o.current.pause(),o.current.srcObject=null),s.current&&(s.current.close(),s.current=null),r.current&&(r.current.close(),r.current=null),i.current=null,v.current=!1,C(void 0),_(void 0),p(!1),f(!1),x(!1),w.set(0),g(null),Z.debug("[v2v_language_learning] Ended")},[w]),M=d.useCallback(async N=>{try{g(null);const D=await navigator.mediaDevices.getUserMedia({audio:!0});C(D),a.current=D;const j=new RTCPeerConnection;r.current=j,D.getTracks().forEach(L=>j.addTrack(L,D)),j.ontrack=L=>{const[U]=L.streams;o.current&&U&&(o.current.srcObject=U,o.current.play().catch(O=>{Z.info("[v2v_language_learning] Audio autoplay blocked:",O)}),_(U))};const F=j.createDataChannel("oai-events");s.current=F,F.onopen=()=>{Z.debug("[v2v_language_learning] Connected"),p(!0),t?.(k)},F.onmessage=L=>{try{const U=JSON.parse(L.data);if(U.type==="response.function_call_arguments.done")if(U.name==="record_phrase_attempt_result"){const O=JSON.parse(U.arguments);Z.debug("[v2v_language_learning] Record phrase attempt result:",O),e(O,$=>{F.send(JSON.stringify({type:"conversation.item.create",item:{type:"function_call_output",call_id:U.call_id,output:$}})),F.send(JSON.stringify({type:"response.create"})),Z.debug("[v2v_language_learning] Sent next instruction:",$)})}else U.name==="end_lesson"&&(i.current?c.current=!0:n?.(I));switch(U.type){case"output_audio_buffer.started":f(!0),i.current=U.response_id,a.current?.getAudioTracks().forEach(O=>{O.enabled=!1});break;case"output_audio_buffer.stopped":f(!1),i.current=null,v.current||a.current?.getAudioTracks().forEach(O=>{O.enabled=!0}),c.current&&(n?.(I),c.current=!1);break;default:break}}catch(U){Z.warn("[v2v_language_learning] Parse error:",U)}},F.onclose=()=>{Z.debug("[v2v_language_learning] Disconnected"),p(!1)};const R=await j.createOffer();if(await j.setLocalDescription(R),!R.sdp)throw new Error("No SDP in offer");const P=await uDe({body:{...N,sdp:R.sdp},reason:"language-learning"});if(!P.data?.sdp)throw new Error(P.error||"Failed to create language learning session");await j.setRemoteDescription({type:"answer",sdp:P.data.sdp})}catch(D){throw Z.error("[v2v_language_learning] Start session failed:",D),g(D instanceof Error?D:new Error(String(D))),D}},[e,k,t,I,n]);return{audioRef:o,dataChannel:s.current,startSession:M,sendInstruction:k,endSession:I,isConnected:m,isSpeaking:u,error:h,remoteAmplitude:w,localAmplitude:E,isMicMuted:y,setIsMicMuted:T}}const VFe=(e,t)=>{const{value:n,loading:r}=zt({flag:"language-learning-voice-tutor",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},HFe=[{type:"default",value:"en",text:"English (English)"},{type:"default",value:"yue",text:"Cantonese (粵語)"},{type:"default",value:"ca",text:"Catalan (Català)"},{type:"default",value:"zh",text:"Chinese (中文)"},{type:"default",value:"hr",text:"Croatian (Hrvatski)"},{type:"default",value:"cs",text:"Czech (Čeština)"},{type:"default",value:"da",text:"Danish (Dansk)"},{type:"default",value:"nl",text:"Dutch (Nederlands)"},{type:"default",value:"fi",text:"Finnish (Suomi)"},{type:"default",value:"fr",text:"French (Français)"},{type:"default",value:"de",text:"Standard German (Deutsch)"},{type:"default",value:"he",text:"Hebrew (עברית)"},{type:"default",value:"hi",text:"Hindi (हिंदी)"},{type:"default",value:"hu",text:"Hungarian (Magyar)"},{type:"default",value:"id",text:"Indonesian (Bahasa Indonesia)"},{type:"default",value:"it",text:"Italian (Italiano)"},{type:"default",value:"ja",text:"Japanese (日本語)"},{type:"default",value:"jv",text:"Javanese (Basa Jawa)"},{type:"default",value:"ko",text:"Korean (한국어)"},{type:"default",value:"ms",text:"Malay (Melayu)"},{type:"default",value:"zh-CN",text:"Simplified Chinese (简体中文)"},{type:"default",value:"zh-TW",text:"Traditional Chinese (繁體中文)"},{type:"default",value:"no",text:"Norwegian (Norsk)"},{type:"default",value:"pl",text:"Polish (Polski)"},{type:"default",value:"pt",text:"Portuguese (Português)"},{type:"default",value:"ru",text:"Russian (Русский)"},{type:"default",value:"sr",text:"Serbian (Srpski)"},{type:"default",value:"es",text:"Spanish (Español)"},{type:"default",value:"sv",text:"Swedish (Svenska)"},{type:"default",value:"tl",text:"Tagalog (Tagalog)"},{type:"default",value:"ta",text:"Tamil (தமிழ்)"},{type:"default",value:"te",text:"Telugu (తెలుగు)"},{type:"default",value:"tr",text:"Turkish (Türkçe)"},{type:"default",value:"uk",text:"Ukrainian (Українська)"},{type:"default",value:"ur",text:"Urdu (اردو)"},{type:"default",value:"vi",text:"Vietnamese (Tiếng Việt)"}],zFe=[{type:"default",value:"echo",text:"Gravo"},{type:"default",value:"cedar",text:"Kyrin"},{type:"default",value:"ballad",text:"Mylva"},{type:"default",value:"shimmer",text:"Nuvix"},{type:"default",value:"verse",text:"Rylth"},{type:"default",value:"sage",text:"Solva"},{type:"default",value:"coral",text:"Syla"},{type:"default",value:"ash",text:"Torma"},{type:"default",value:"alloy",text:"Tylis"},{type:"default",value:"marin",text:"Velox"}],WFe=()=>{let e=HFe[0],t=zFe[1];try{const n=vt.getItem("pplx.v2v.selectedLanguage");if(n){const r=JSON.parse(n);r.value&&(e=r)}}catch(n){Z.error("Error loading local language settings:",n)}try{const n=vt.getItem("pplx.v2v.selectedVoice");if(n){const r=JSON.parse(n);r.value&&(t=r)}}catch(n){Z.error("Error loading local voice settings:",n)}return{language:e,voice:t}},GFe=()=>{const e=d.useMemo(()=>WFe(),[]),[t,n]=d.useState(e),[r,s]=d.useState(e),o=d.useCallback(m=>{s(p=>({...p,language:m}))},[s]),a=d.useCallback(m=>{s(p=>({...p,voice:m}))},[s]),i=r.language.value!==t.language.value,c=r.voice.value!==t.voice.value,u=i||c,f=d.useCallback(()=>{vt.setItem("pplx.v2v.selectedLanguage",JSON.stringify(r.language)),vt.setItem("pplx.v2v.selectedVoice",JSON.stringify(r.voice)),n(r)},[r]);return d.useMemo(()=>({currentSettings:r,setLanguage:o,setVoice:a,hasChanges:u,save:f}),[r,u,f,o,a])},Ar={type:"spring",stiffness:700,damping:50},_6="LANGUAGE_LEARNING_AUTOPLAY",Q0=e=>{new Audio(e).play().catch(n=>{console.error("Error playing audio:",n)})},xI=e=>{const t=Object.keys(e).map(n=>`"${n}": ${e[n].join(", ")}`).join(` -`);return t.length>0?`End lesson. Ground any overall feedback on the lesson on the following report: ${t}`:"End lesson. No phrases-specific feedback was provided, so just say goodbye to the user and bring your conversation to an end."},$Fe=({onClose:e,string:t,stringBounds:n,isMobileStyle:r,autoplay:s,initialWidth:o,entryUUID:a,contextUUID:i,queryStr:c,translatePhrases:u,defaultMode:f="flashcards"})=>{const{session:m}=Ne(),{trackEvent:p}=Xe(m),g=J().formatMessage,[y,x]=d.useState(null),v=d.useRef(null),[b,_]=d.useState(!1),[w,S]=d.useState(s),[C,E]=d.useState(null),[T,k]=d.useState(o),I=d.useRef(null),M=d.useRef(null),N=d.useRef(null),{variation:D}=VFe(!1),{currentSettings:j}=GFe(),[F,R]=d.useState(f==="voice_tutor"),P=w&&!F,[L,U]=d.useState(!1),O=d.useRef({}),$=16,{groupedTranslation:G,detectedLanguages:H,isLoading:Q,advancePage:Y,previousPage:te,currentPhrase:se,currentIndex:ae}=tee({clickedPhrase:t,entryUUID:a,contextUUID:i,translatePhrases:u}),{colorScheme:X}=Ss(),ee=d.useMemo(()=>X==="light"?{accentColor:"rgb(172, 63, 0)",baseColor:"rgb(219, 113, 0)",aiColor:"rgb(50, 184, 198)",loadingColor:"rgb(98, 108, 113)",idleColor:"rgb(175, 180, 181)"}:{accentColor:"rgb(255, 210, 166)",baseColor:"rgb(219, 113, 0)",aiColor:"rgb(50, 184, 198)",loadingColor:"rgb(167, 169, 169)",idleColor:"rgb(99, 101, 101)"},[X]),le=d.useMemo(()=>G?b?G.sentence.translated:G.element.translated:se,[se,G,b]),re=d.useCallback($e=>{$e(`Start lesson. Current phrase: "${le}"`)},[le]),ce=d.useCallback(($e,ht)=>{if(O.current[$e.phrase]||(O.current[$e.phrase]=[]),$e.status==="success"||$e.status==="skipped")$e.status==="success"&&O.current[$e.phrase].push("Correct!"),Y({onPageChange:Zt=>{if(Zt){const dt=b?Zt.sentence.translated:Zt.element.translated;ht(`Move onto the next phrase: "${dt}"`)}else ht(xI(O.current))},source:"voice-tutor",canLoop:!1});else if($e.status==="failure"){const Zt=$e.feedback??"Did not repeat the phrase correctly, but no feedback was given. Only reference this in general terms in your feeddback.";O.current[$e.phrase].push(Zt),ht("Continue with your feedback for this phrase.")}},[Y,b]),ue=d.useCallback($e=>{$e(),R(!1),p("language learning voice tutor session ended",{entryUUID:a,contextUUID:i})},[a,i,p]),{endSession:me,startSession:we,sendInstruction:ye,audioRef:_e,isConnected:ke,isSpeaking:De,error:xe,remoteAmplitude:Ue,localAmplitude:Ee,isMicMuted:Ke,setIsMicMuted:Nt}=UFe({onPhraseAttemptResult:ce,onConnect:re,onEndLesson:ue});d.useEffect(()=>{xe&&p("language learning voice tutor session error",{entryUUID:a,contextUUID:i,error:xe.message})},[xe,a,i,p]),d.useEffect(()=>{if(!(!F||!H))return p("language learning voice tutor session started",{entryUUID:a,contextUUID:i}),O.current={},we({source:"web",voice:j.voice.value??"marin",learning_language:H.learning_language,native_language:H.native_language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,turn_detection_threshold:.9,query:c,learning_dialect:H.learning_dialect}),()=>{p("language learning voice tutor session ended",{entryUUID:a,contextUUID:i}),me()}},[F,H,p,a,i]);const pe=d.useCallback($e=>{if(ke)if($e){const ht=b?$e.sentence.translated:$e.element.translated;ye(`Move onto a new phrase. DO NOT give feedback on the previous phrase. The new phrase is: "${ht}"`)}else ye(xI(O.current))},[ye,ke,b]);let ve;ae!==null&&(ve=b?G?.sentence:G?.element);function Ae($e,ht,Zt){return Math.round(Math.max(ht,Math.min($e,Zt)))}let We;const pt=ve?.translated.length??se?.length??0;pt<20?We=Ae(T*.088,24,128):pt>=20&&pt<48?We=Ae(T*.058,32,84):We=Ae(T*.038,24,56);const Gt=d.useCallback(()=>xe?xe instanceof Error&&xe.name=="NotAllowedError"?g({defaultMessage:"Please enable microphone permissions and try again.",id:"UaGxC0QJ/N"}):g({defaultMessage:"Failed to connect",id:"uhiTNkWfe3"}):ke?ke&&!L?g({defaultMessage:"Waking up...",id:"DgbC2DZlba"}):De&&L?null:g(Ke?{defaultMessage:"Muted",id:"HOzFdo4wh5"}:b?{defaultMessage:"Repeat the sentence",id:"PDwmrTmyqy"}:{defaultMessage:"Repeat the word",id:"m4eJ6oS5NH"}):g({defaultMessage:"Waking up...",id:"DgbC2DZlba"}),[De,xe,L,ke,Ke,b,g]);d.useEffect(()=>{ke&&De&&U(!0),ke||U(!1)},[ke,De]),d.useLayoutEffect(()=>{if(v.current){const $e=v.current.getBoundingClientRect();x($e)}},[]);const Le={zoomInInitial:{opacity:0,scale:$/We,x:y?n.left+n.width/2-(y.left+y.width/2):0,y:y?n.top+n.height/2-(y.top+y.height/2):0},initial:{opacity:0,scale:1,x:0,y:0},resting:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:1,x:0,y:0}},gt=$e=>{const ht=$e.currentTarget.getBoundingClientRect(),dt=$e.clientX-ht.left{Nt(!Ke),Q0(Ke?"/static/sounds/rt-ready.wav":"/static/sounds/rt-pause.wav")},[Ke,Nt]);d.useEffect(()=>{const $e=Zt=>{if(Zt.key==="Escape")e();else if(Zt.key==="ArrowRight")Y({onPageChange:pe,source:"manual",canLoop:!F});else if(Zt.key==="ArrowLeft"){if(F&&ae===0)return;te({onPageChange:pe,source:"manual",canLoop:!F})}else Zt.key===" "&&(Zt.preventDefault(),E(new Date))},ht=()=>{k(window.innerWidth)};return window.addEventListener("keydown",$e),window.addEventListener("resize",ht),()=>{window.removeEventListener("keydown",$e),window.removeEventListener("resize",ht)}},[e,Y,te,pe,F,ae,u.length,ye]),d.useEffect(()=>{vt.setItem(_6,w.toString())},[w]);let Me;w?Me=g({defaultMessage:"Autoplay on",id:"8Svq84unOC"}):Me=g({defaultMessage:"Autoplay off",id:"mjxB7Ns43B"});const Ve=tp(Ue,[0,10],[.1,.75]),lt=tp(Ue,[0,10],[1,2]),xt=tp(Ee,[0,1],[.1,.75]),Pt=tp(Ee,[0,1],[1,2]);return l.jsx(St,{children:l.jsxs("div",{ref:I,onClick:gt,onMouseMove:u.length>1?gt:void 0,className:"fixed inset-0 size-full cursor-pointer overflow-hidden",children:[l.jsx("audio",{ref:_e,className:"hidden"}),l.jsx(Te.div,{className:"bg-base absolute inset-0 z-[1] size-full",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,children:!r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:N,className:"absolute right-4 top-1/2 z-[1] size-8 -translate-y-1/2 opacity-0 transition-opacity duration-300",children:l.jsx(V,{color:"ultraLight",variant:"small",children:l.jsx(ge,{icon:B("chevron-right"),size:32})})}),l.jsx("div",{ref:M,className:"absolute left-4 top-1/2 z-[1] size-6 -translate-y-1/2 opacity-0 transition-opacity duration-300",children:l.jsx(V,{color:"ultraLight",variant:"small",children:l.jsx(ge,{icon:B("chevron-left"),size:32})})})]})}),l.jsxs(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,className:"absolute inset-x-0 top-0 z-[4] flex flex-col gap-3 p-3",children:[u.length>1?l.jsx("div",{className:"gap-xs md:gap-sm flex",children:u.map(($e,ht)=>l.jsx("div",{className:z("bg-subtle h-1 w-full rounded-full",{"!bg-inverse":ht===ae})},ht))}):null,l.jsxs("div",{className:"gap-xs flex items-center justify-end",children:[l.jsx(st,{toolTip:Me,tooltipLayout:"left",tooltipProps:{closeOnClick:!1},pill:!0,icon:w?YU:QU,onClick:()=>{S(!w),p("language learning mute pressed",{entryUUID:a,contextUUID:i})},disabled:F}),l.jsx(st,{pill:!0,icon:B("x"),onClick:e})]})]}),l.jsx("div",{className:"scrollbar-subtle absolute inset-0 z-[3] flex size-full overflow-y-scroll",children:l.jsx("div",{className:"flex h-fit min-h-full w-full px-4 py-32 md:px-8 lg:px-12",children:l.jsxs("div",{className:z("gap-md md:gap-lg lg:gap-xl break-word flex min-h-full w-full flex-1 grow flex-col items-center justify-center hyphens-auto",{"!items-start":r}),children:[l.jsx(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,"data-no-click":"true",children:l.jsx(br,{active:Q,children:l.jsx(V,{variant:"entry-title",color:"ultraLight",className:z("pointer-events-auto cursor-text",{"text-center !text-3xl":!r,"text-left !text-xl sm:!text-2xl":r,"!bg-subtle rounded-full !text-transparent":Q}),children:Q?"Loading":ve?.untranslated})})}),l.jsxs("div",{ref:v,className:"relative",lang:G?.language_code??void 0,children:[l.jsx("div",{style:{fontSize:We},className:z("text-foreground pointer-events-none text-balance text-center font-semibold leading-[1.2] opacity-0",{"!text-left":r}),children:ve?.translated??se}),y&&l.jsx(Te.div,{className:z("text-foreground pointer-events-auto absolute inset-0 w-fit text-balance text-center font-semibold leading-[1.2] outline-none",{"!text-left":r}),style:{fontSize:We},initial:y.height>We*1.2?"initial":"zoomInInitial",animate:"resting",exit:"exit",transition:Ar,variants:Le,dir:G?.is_rtl?"rtl":"ltr",children:l.jsx(br,{active:Q,children:l.jsx(YFe,{currentTranslation:ve,translation:ve?.translated??se??"",autoplay:P,lastPlayedTime:C,isRtl:G?.is_rtl??!1,entryUUID:a,contextUUID:i,onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})}},ae?.toString()+b.toString())})})]}),l.jsx(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,"data-no-click":"true",children:l.jsx(br,{active:Q,children:l.jsx(V,{variant:"entry-title",color:"ultraLight",className:z("pointer-events-auto cursor-text",{"text-center !text-3xl":!r,"text-left !text-xl sm:!text-2xl":r,"!bg-subtle rounded-full !text-transparent":Q}),children:Q?"Pronunciation":ve?.pronunciation})})})]})})}),l.jsxs(Te.div,{className:"absolute inset-x-0 bottom-0 z-[4] flex h-fit items-center justify-center gap-2 pb-4 md:gap-3 md:pb-9",initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,children:[!D&&l.jsxs(l.Fragment,{children:[l.jsx(Ge,{variant:"primary",size:r?"regular":"large",onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})},icon:B("player-play-filled"),pill:!0,extraCSS:"!bg-inverse disabled:!text-inverse relative z-10",disabled:Q}),l.jsx("div",{className:"bg-base relative z-10 rounded-full",children:l.jsx("div",{className:"bg-subtle h-10 rounded-full p-[2.5px] md:h-14 md:p-1",children:l.jsxs("div",{className:"relative flex h-full items-center",children:[l.jsx(st,{variant:"primary",size:r?"small":"regular",text:l.jsxs("div",{className:"pointer-events-none relative grid grid-cols-1 grid-rows-1",children:[l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]}),onClick:()=>{_(!1),p("language learning selector pressed",{entryUUID:a,contextUUID:i,button:"word"})},disabled:Q,extraCSS:"relative h-full z-10 focus-visible:!bg-transparent !bg-transparent"}),l.jsx(st,{variant:"primary",noBackground:!0,size:r?"small":"regular",text:l.jsxs("div",{className:"pointer-events-none relative grid grid-cols-1 grid-rows-1",children:[l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]}),onClick:()=>{_(!0),p("language learning selector pressed",{entryUUID:a,contextUUID:i,button:"sentence"})},disabled:Q,extraCSS:"relative z-10 h-full !gap-0 focus-visible:!bg-transparent !bg-transparent"}),l.jsx(Te.div,{className:"bg-raised dark:!bg-base absolute inset-y-0 left-0 h-full w-1/2 rounded-full",animate:{x:b?"100%":"0%"},transition:Ar})]})})})]}),D&&l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1",children:[l.jsx(St,{initial:!1,children:l.jsx(Te.div,{initial:{opacity:0,scale:.9,filter:"blur(10px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{duration:.4},className:"relative z-[2] col-start-1 col-end-2 row-start-1 row-end-2 mx-auto",children:F?l.jsxs("div",{className:"relative flex items-center gap-4 rounded-full",children:[l.jsx(St,{children:l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,className:"absolute -top-12 left-1/2 -translate-x-1/2 whitespace-nowrap",children:l.jsx(br,{active:!ke||ke&&!L||!De&&ke,children:l.jsx(V,{variant:"entry-title-200",className:"!whitespace-nowrap",style:{color:xe||!ke||ke&&!L?ee.idleColor:De?ee.aiColor:ee.baseColor},children:Gt()})})},De.toString()+xe+(!ke&&L).toString()+Ke.toString())}),l.jsx("div",{className:"bg-base rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{R(!1),Q0("/static/sounds/rt-pause.wav")},leadingComponent:l.jsx(ge,{icon:B("player-stop"),size:24}),pill:!0,noPadding:!0,extraCSS:"!bg-raised relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q,toolTip:g({defaultMessage:"Stop voice tutor",id:"+7CJc6lfrw"}),tooltipLayout:"top"})}),l.jsx("div",{className:"bg-base rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:l.jsx(Ge,{variant:"common",size:"large",leadingComponent:l.jsx(ge,{icon:Ke?B("microphone-off"):B("microphone"),size:20}),pill:!0,noPadding:!0,extraCSS:"!bg-raised relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q,onClick:Je,toolTip:g(Ke?{defaultMessage:"Turn on microphone",id:"wdzCqjtXgD"}:{defaultMessage:"Turn off microphone",id:"SUrSrgEOv2"}),tooltipLayout:"top"})})]}):l.jsxs("div",{className:"bg-raised z-[2] col-start-1 col-end-2 row-start-1 row-end-2 mx-auto flex w-fit items-center rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:[l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})},leadingComponent:l.jsx(ge,{icon:B("player-play-filled"),size:20}),pill:!0,extraCSS:"!bg-transparent relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q}),l.jsx("div",{className:"bg-subtle h-8 w-0.5 flex-shrink-0"}),l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{R(!0),Q0("/static/sounds/rt-ready.wav")},leadingComponent:l.jsx(ge,{icon:KU,size:20}),pill:!0,extraCSS:z("!bg-transparent relative !text-sm z-10 [&>*]:!gap-2 active:!scale-100 active:!opacity-[50%]",{"!pl-4 !pr-3":!r}),disabled:Q,text:r?void 0:g({defaultMessage:"Voice Tutor",id:"rWFec/0yfN"}),textClassName:"p-0 -translate-y-px"}),l.jsx("div",{className:"bg-subtle h-8 w-0.5 flex-shrink-0"}),l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{_(!b)},pill:!0,extraCSS:"!bg-transparent relative !text-sm z-10 !px-3 active:!scale-100 translate-y-0 active:!opacity-[50%] !font-normal",trailingComponent:l.jsx(ge,{icon:B("selector"),size:16}),disabled:Q,text:l.jsxs("div",{className:z("flex items-center",{"flex-col":r}),children:[l.jsx(V,{variant:r?"tinyRegular":"small",color:"light",className:z("mr-auto",{"leading-tight":r}),children:g({defaultMessage:"View as",id:"pX8Y8hA7fI"})}),r?null:l.jsx(l.Fragment,{children:" "}),l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1",children:[l.jsx(St,{initial:!1,children:l.jsx(Te.div,{className:"col-start-1 col-end-2 row-start-1 row-end-2 text-left",initial:{y:"100%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-100%",opacity:0},transition:Ar,children:l.jsx(V,{variant:"smallBold",color:"default",children:g(b?{defaultMessage:"Sentence",id:"82Zf4jFbZN"}:{defaultMessage:"Word",id:"TGazyxBLFu"})})},b.toString())}),l.jsx(V,{className:"pointer-events-none col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",variant:"smallBold",color:"default",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx(V,{className:"pointer-events-none col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",variant:"smallBold",color:"default",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]})]}),textClassName:"p-0 -translate-y-px"})]})},F.toString())}),l.jsx(St,{children:F&&l.jsx(Te.div,{className:"ease-outExpo absolute inset-x-0 top-1/2 z-[1] h-full rounded-[100%] opacity-20 blur-[30px] saturate-200 duration-1000",initial:{opacity:0},animate:{backgroundColor:xe||!ke||ke&&!L?ee.idleColor:De?ee.aiColor:ee.baseColor,opacity:.5},exit:{opacity:0},style:{opacity:De?Ve:xe||!ke||ke&&!L?.5:xt,scale:De?lt:xe||!ke||ke&&!L?1:Pt},transition:Ar})})]}),l.jsx("div",{className:"from-base pointer-events-none absolute inset-x-0 -top-9 bottom-0 bg-gradient-to-t to-transparent"})]})]})})},qFe=`linear-gradient( - to right, - oklch(var(--foreground-color)) 0%, - oklch(var(--foreground-color)) 33.34%, - oklch(var(--dark-super-color)) 50%, - oklch(var(--dark-super-color)) 66.67%, - oklch(var(--foreground-color)) 66.67%, - oklch(var(--foreground-color)) 100% -)`,KFe=`linear-gradient( - to right, - oklch(var(--foreground-color)) 0%, - oklch(var(--foreground-color)) 33.34%, - oklch(var(--dark-super-color)) 33.34%, - oklch(var(--dark-super-color)) 50%, - oklch(var(--foreground-color)) 66.67%, - oklch(var(--foreground-color)) 100% -)`,YFe=({currentTranslation:e,translation:t,autoplay:n,lastPlayedTime:r,isRtl:s,onClick:o,entryUUID:a,contextUUID:i})=>{const c=d.useRef(null),u=d.useRef(n);d.useEffect(()=>{u.current=n},[n]);const f=d.useRef(r);d.useEffect(()=>{f.current=r},[r]);const{session:m}=Ne(),{trackEvent:p}=Xe(m),h=d.useCallback(()=>{if(!e)return;const _=e.audio_url;_&&c.current&&(c.current.src=_)},[e]),g=aA(0),y=tp(()=>s?`${g.get()*100}%`:`${(1-g.get())*100}%`),x=d.useCallback(()=>{c.current&&(c.current.pause(),c.current.currentTime=0,requestAnimationFrame(()=>{c.current?.play()}))},[]),v=d.useRef(r);d.useEffect(()=>{r&&r!==v.current&&x()},[r,x]),d.useEffect(()=>{h()},[h]),d.useEffect(()=>{c.current&&(c.current.pause(),c.current.currentTime=0,h())},[t,h]);const b=d.useCallback(()=>{u.current&&x()},[x]);return l.jsxs(l.Fragment,{children:[l.jsx("audio",{ref:c,className:"hidden",onLoadedMetadata:()=>{b()},onPlay:()=>{g.jump(0),aNe(g,1,{ease:"linear",duration:(c.current?.duration??0)*2}),p("language learning audio played",{entryUUID:a,contextUUID:i})}}),l.jsx(Te.span,{className:"-my-4 py-4 text-transparent",style:{backgroundPositionX:y,backgroundClip:"text",backgroundSize:"300%",backgroundRepeat:"no-repeat",backgroundImage:s?KFe:qFe},children:l.jsx("span",{onClick:o,className:"cursor-pointer","data-no-click":"true",children:t})})]})},QFe=Object.freeze(Object.defineProperty({__proto__:null,LANGUAGE_LEARNING_AUTOPLAY_KEY:_6,default:$Fe},Symbol.toStringTag,{value:"Module"})),ree=A.memo(({url:e,openInNewTab:t,fullWidth:n=!0,variant:r="super",upsellInformation:s})=>{const{$t:o}=J(),{session:a}=Ne(),{trackEvent:i}=Xe(a),c=d.useCallback(()=>{s&&i("upsell clicked",{upsellLocation:s.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:s.upsell_uuid,upsellName:s.name,upsellType:s.upsell_type,cta:tn.PERMALINK}),e&&(t?window.open(e,"_blank"):No(e,"Learn more from upsell"))},[e,t,i,s]);return l.jsx(st,{text:o({defaultMessage:"Learn more",id:"TdTXXf940t"}),fullWidth:n,variant:r,textClassName:"!text-sm",noPadding:!0,onClick:c})});ree.displayName="LearnMoreButton";const see=A.memo(({upsellInformation:e,inFlight:t,position:n,onButtonClick:r,isLoading:s,textButtonIfSecondary:o=!1,hideUpsell:a,verticalLayout:i=!1})=>{const c=kl({upsellInformation:e,inFlight:t,options:{hideUpsell:a}}),u=d.useCallback(()=>{r?.(),c()},[r,c]),f=d.useCallback(w=>{if(n==="router_steps")return"inverted";switch(w){case bm.MAX_COLOR:return"maxGold";case bm.PRIMARY_COLOR:return"primary";case bm.INVERTED:return"inverted";default:return"common"}},[n]),m=d.useMemo(()=>f(e?.button_color),[f,e?.button_color]),p=e?.cta_information?.secondary_button,h=e?.cta_information?.tertiary_button,g=kl({upsellInformation:p?{...e,cta:p.cta,button_text:p.button_text}:e,inFlight:t,options:{hideUpsell:a}}),y=kl({upsellInformation:h?{...e,cta:h.cta,button_text:h.button_text}:e,inFlight:t,options:{hideUpsell:a}}),x=d.useCallback((w,S)=>{const C=f(w.button_color),E=w.button_color===bm.SECONDARY_COLOR,k={size:"regular",onClick:()=>{r?.(),S()},text:w.button_text,textClassName:"!text-sm",fullWidth:!0};return o&&E?l.jsx(st,{...k,variant:"super",noPadding:!0}):l.jsx(Ge,{...k,variant:C})},[f,o,r]),v=d.useCallback(w=>{let S;e?.icon_reference==="labs"?S=l.jsx(ge,{icon:B("plus"),size:"sm"}):e?.icon_reference==="comet_download"&&(S=l.jsx(ut,{name:B("download"),size:16}));const C={size:w?"regular":"small",onClick:u,text:e?.button_text,leadingComponent:S,textClassName:w?"!text-sm":void 0,fullWidth:!0,isLoading:s};return o&&e?.button_color===bm.SECONDARY_COLOR?l.jsx(st,{...C,variant:"super",noPadding:!0}):l.jsx(Ge,{...C,variant:m})},[m,u,e?.button_color,e?.button_text,e?.icon_reference,o,s]),b=p||h,_=!b&&e?.cta_information?.secondary_permalink;if(b){const w=[v(!0),p&&x(p,g),h&&x(h,y)].filter(Boolean);return w.length===1?w[0]:l.jsx("div",{className:`gap-md flex ${i?"flex-col":"flex-row"}`,children:i?w:[...w].reverse()})}if(_){const w=e?.cta_information?.secondary_permalink,S=e?.cta_information?.secondary_permalink_new_tab,C=l.jsx(ree,{url:w,openInNewTab:S,upsellInformation:e});return l.jsx("div",{className:`gap-md flex ${i?"flex-col":"flex-row"}`,children:i?l.jsxs(l.Fragment,{children:[v(!0),C]}):l.jsxs(l.Fragment,{children:[C,v(!0)]})})}return v(!1)});see.displayName="UpsellButton";const XFe=Ce(()=>Se(()=>q(()=>Promise.resolve().then(()=>QFe),void 0))),ZFe=({icon_reference:e,icon_image:t})=>{if(t)return l.jsx(K,{variant:"subtle",className:"p-xs rounded-md border",children:l.jsx("img",{src:t.url,alt:t.alt,width:40,height:40,className:"rounded"})});const n={pro:l.jsx(ge,{icon:qs.pro,size:"lg"}),collection:l.jsx(ge,{icon:qs.collection,size:"lg"}),gmail_gcal:l.jsx(K,{variant:"subtle",className:"p-xs rounded-md border",children:l.jsx("img",{src:wx,alt:"Gmail Gcal Upsell Banner",width:40,height:40})}),research:l.jsx(ge,{icon:qs.research,size:"lg"}),labs:l.jsx(ge,{icon:qs.labs,size:"lg"}),max:l.jsx(Gd,{size:"tiny",variant:"mark",isMax:!0}),shortcut:l.jsx(ge,{icon:B("square-forbid-2"),size:"lg"}),comet_login:l.jsx(K,{variant:"super",className:"p-xs rounded-md border",children:l.jsx(V,{color:"defaultInverted",children:l.jsx(gM,{size:24})})}),pro_perks:l.jsx(ge,{icon:qs.pro_perks,size:"lg"}),app:l.jsx(ge,{icon:qs.app,size:"lg"}),slides:l.jsx(ge,{icon:qs.slides,size:"lg"}),document:l.jsx(ge,{icon:qs.document,size:"lg"}),plaintext:l.jsx(ge,{icon:qs.plaintext,size:"lg"}),canvas:l.jsx(ge,{icon:qs.canvas,size:"lg"}),browser_agent:l.jsx(rn,{icon:B("click"),size:"large"}),advanced_models:l.jsx(ge,{icon:qs.advanced_models,size:"lg"})};return e==="comet_download"?null:n[e||""]||null},Jd=A.memo(({position:e,upsellInformation:t,inFlight:n,isLastResult:r,backendUuid:s,contextUuid:o,queryStr:a,animateExpand:i=!0,hideOnAccept:c=!0,hideOnReject:u=!0,isSkipping:f=!1,onAccept:m,onReject:p,className:h})=>{const{$t:g}=J(),{show:y,handleDismiss:x,handleHide:v}=jFe({position:e,inFlight:n,isLastResult:r,upsellInformation:t,backendUuid:s}),b=d.useCallback(()=>{x({hideBanner:u}),p?.()},[x,p,u]),_=d.useCallback(()=>{x({hideBanner:c}),m?.()},[x,m,c]),S=fn()?.get("handle_upsell");d.useEffect(()=>{if(y&&S){const k=new URLSearchParams(window.location.search);k.delete("handle_upsell");const I=Object.fromEntries(k.entries());zQ(I),_()}},[_,y,S]);const C=Wt();if(!y||!t||C&&t.upsell_type===Qs.LOGIN)return null;if(t.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION)return l.jsx(oee,{upsellInformation:t,show:y,animateExpand:i,inFlight:n,onPermissionResponse:_,hideUpsell:v});if(t.upsell_type===Qs.DAILY_QUESTIONS_FEATURE_ENTRYPOINTS)return l.jsx(aee,{type:t.name,actionCards:t.action_cards,show:y,entryUUID:s,contextUUID:o,queryStr:a});const E=ZFe(t),T=t.upsell_type!==Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION;return l.jsx(St,{children:l.jsx(Te.div,{initial:i?{height:0}:{opacity:0},animate:i?{height:"auto"}:{opacity:1},exit:i?{height:0}:{opacity:0},transition:{duration:.2},children:l.jsx("div",{className:"bg-base",children:l.jsxs(K,{variant:t.background_super?"superLight":"subtler",className:z("gap-sm mb-md p-md md:gap-md relative flex w-full flex-col items-center rounded-md md:flex-row",{"rounded-xl shadow-xl ring-1":e==="input"||e==="router_steps"},h),children:[E&&l.jsx(V,{color:"default",className:"hidden md:block",children:E}),l.jsxs("div",{className:"md:mr-sm relative flex w-full flex-col",children:[l.jsx(V,{variant:"smallBold",className:z("mr-lg md:mr-0",{"line-clamp-2":t.upsell_type===Qs.CREATE_SHORTCUT}),children:t.title}),l.jsx(V,{variant:"small",color:"light",className:"mb-0 font-normal leading-[1.3]",children:t.description})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col-reverse md:w-auto md:flex-row md:items-center md:justify-end",children:[T&&l.jsx(st,{text:g({defaultMessage:"Skip",id:"/4tOwTiCH6"}),size:"small",onClick:b,variant:"common",isLoading:f}),t.button_text&&l.jsx(see,{upsellInformation:t,inFlight:n,position:e,hideUpsell:v})]})]})})})})});Jd.displayName="ThreadUpsell";const oee=A.memo(({upsellInformation:e,show:t,animateExpand:n=!0,inFlight:r,onPermissionResponse:s,hideUpsell:o})=>{const a=kl({upsellInformation:e,inFlight:r,options:{hideUpsell:o}}),i=e?.cta_information?.secondary_button,c=e?.cta_information?.tertiary_button,u=kl({upsellInformation:i?{...e,cta:i.cta,button_text:i.button_text}:e,inFlight:r,options:{hideUpsell:o}}),f=kl({upsellInformation:c?{...e,cta:c.cta,button_text:c.button_text}:e,inFlight:r,options:{hideUpsell:o}});return t?l.jsx(St,{children:l.jsx(Te.div,{initial:n?{height:0}:{opacity:0},animate:n?{height:"auto"}:{opacity:1},exit:n?{height:0}:{opacity:0},transition:{duration:.2},children:l.jsxs(Y0,{title:e.title,description:e.description,leadingAccessory:B("click"),size:"default",children:[c&&l.jsx(Y0.Action,{variant:"text",onClick:()=>{s(),f()},children:c.button_text}),i&&l.jsx(Y0.Action,{variant:"secondary",onClick:()=>{s(),u()},children:i.button_text}),l.jsx(Y0.Action,{variant:"primary",onClick:()=>{s(),a()},children:e.button_text})]})})}):null});oee.displayName="BrowserAgentPermissionBanner";const aee=A.memo(({actionCards:e,queryStr:t,entryUUID:n,contextUUID:r,show:s,animateExpand:o=!0})=>{const{$t:a}=J(),i=LFe(),{detectedLanguages:c}=tee({clickedPhrase:i[0]??"",entryUUID:n??"",contextUUID:r??"",translatePhrases:i}),{isMobileStyle:u}=Re(),f=Uo().openModal,m=d.useRef(null),p=d.useRef(null),h=d.useCallback((x,v)=>{const b={[tn.LANGUAGE_LEARNING_FLASHCARDS]:"flashcards",[tn.LANGUAGE_LEARNING_VOICE_TUTOR]:"voice_tutor"},_=vt.getItem(_6),w=x==="LANGUAGE_LEARNING_FLASHCARDS"?_?_==="true":!0:!1;f(XFe,{legacyIdentifier:"translationModal",stringBounds:v.current?.getBoundingClientRect()??new DOMRect,string:i[0]??"",entryUUID:n??"",contextUUID:r??"",queryStr:t??"",translatePhrases:i,isMobileStyle:u,autoplay:w,initialWidth:window.innerWidth,defaultMode:b[x]})},[i,u,n,r,t,f]),g=d.useMemo(()=>c?{[tn.LANGUAGE_LEARNING_FLASHCARDS]:{text:a({defaultMessage:"Flash Cards",id:"t0yioEPoC6"}),subtext:a({defaultMessage:"Practice {language} with audio flash cards",id:"ZRcObnW+uj"},{language:c.learning_language}),onClick:()=>h(tn.LANGUAGE_LEARNING_FLASHCARDS,m),ref:m},[tn.LANGUAGE_LEARNING_VOICE_TUTOR]:{text:a({defaultMessage:"Voice Tutor",id:"rWFec/0yfN"}),subtext:a({defaultMessage:"Learn how to pronounce {language} words out loud.",id:"IXEyZm0BqT"},{language:c.learning_language}),onClick:()=>h(tn.LANGUAGE_LEARNING_VOICE_TUTOR,p),ref:p}}:null,[c,h,a]),y=d.useMemo(()=>g?e.map(x=>{const v=g[x.cta];return v?l.jsx(wt,{variant:"text",onClick:v.onClick,ref:v.ref,children:l.jsxs("div",{className:"gap-xs flex flex-col items-start",children:[l.jsx(V,{variant:"smallBold",children:v.text}),l.jsx(V,{variant:"small",color:"light",children:v.subtext})]})},x.cta):null}):null,[e,g]);return!c||!s?null:l.jsx(St,{children:l.jsxs(Te.div,{initial:o?{height:0}:{opacity:0},animate:o?{height:"auto"}:{opacity:1},exit:o?{height:0}:{opacity:0},transition:{duration:.2},className:"gap-xs flex flex-col",children:[l.jsx(V,{variant:"baseSemi",children:a({defaultMessage:"More ways to learn {language}",id:"R68m2bFJEK"},{language:c.learning_language})}),l.jsx("div",{className:"gap-xs flex",children:y})]})})});aee.displayName="DailyQuestionsEntrypointsBanner";function JFe(e){const{sourceType:t,skippedSources:n}=e;return!(!t||n.has(t))}const vI="/static/images/agent-favicons/gmail.svg",eBe="/static/images/data-connectors/microsoft/outlook-avatar.svg",Ri={click:{message:W({defaultMessage:"Clicking",id:"n43/KMHgLD"}),icon:B("click")},paused:{message:W({defaultMessage:"Paused",id:"C2iTEHtK//"}),icon:B("pointer-pause")},fill:{message:W({defaultMessage:"Filling out a form",id:"5i0X5DesMM"}),icon:B("forms")},search:{message:W({defaultMessage:"Searching",id:"IfE0if3ytt"}),icon:B("search")},search_images:{message:W({defaultMessage:"Searching for images",id:"NaBAkNUPuD"}),icon:B("search")},navigate:{message:W({defaultMessage:"Navigating",id:"3O6LMNhb0M"}),icon:B("location")},press_key:{message:W({defaultMessage:"Pressing key",id:"R6bmgzv6Xs"}),icon:B("keyboard")},key:{message:W({defaultMessage:"Pressing key",id:"R6bmgzv6Xs"}),icon:B("keyboard")},scroll_page:{message:W({defaultMessage:"Scrolling",id:"/UUUqdefcb"}),icon:B("square-rounded-arrow-down")},scroll:{message:W({defaultMessage:"Scrolling",id:"/UUUqdefcb"}),icon:B("square-rounded-arrow-down")},reasoning:{message:W({defaultMessage:"Reasoning",id:"Aw3qRf7hyO"}),icon:B("bubble-text")},considering_clarification:{message:W({defaultMessage:"Considering your clarification",id:"xvwGmM2LU3"}),icon:B("bubble-text")},working:{message:W({defaultMessage:"Working",id:"gAR0atqpRn"}),icon:B("access-point")},finished:{message:W({defaultMessage:"Done",id:"JXdbo8Vnlw"}),icon:B("check")},reading:{message:W({defaultMessage:"Reading",id:"MOK/yKIpYX"}),icon:B("file-text")},reading_browser:{message:W({defaultMessage:"Reviewing your tabs and browser history",id:"P+tFAY9IRT"}),icon:B("file-text")},getting_source:{message:W({defaultMessage:"Getting source",id:"Z1eFpRpq7v"}),icon:B("file-text")},getting_sources:{message:W({defaultMessage:"Getting sources",id:"Jv/OJ6AjyO"}),icon:B("file-text")},reviewing_source:{message:W({defaultMessage:"Reviewing source",id:"ymFEF2YHhs"}),icon:B("file-text")},reviewing_sources:{message:W({defaultMessage:"Reviewing sources",id:"/NZJDBzKok"}),icon:B("file-text")},reviewing_memory:{message:W({defaultMessage:"Reviewing memory",id:"piUVOodSmM"}),icon:B("file-text")},reviewing_memories:{message:W({defaultMessage:"Reviewing memories",id:"VgUfUXIIey"}),icon:B("file-text")},reviewing_conversation_history:{message:W({defaultMessage:"Reviewing past queries",id:"RfG7EQT3IO"}),icon:B("file-text")},reading_tabs:{message:W({defaultMessage:"Reviewing your tabs",id:"cE3TzCT3eK"}),icon:B("file-text")},building_app:{message:W({defaultMessage:"Building application",id:"qK6gEQyvil"}),icon:B("tools")},creating_chart:{message:W({defaultMessage:"Creating chart",id:"yc5YxtS5VS"}),icon:B("graph")},creating_pdf:{message:W({defaultMessage:"Creating PDF",id:"NcD2ia4Hrn"}),icon:B("file-type-pdf")},creating_docx:{message:W({defaultMessage:"Creating DOCX",id:"GIUtasyzkA"}),icon:B("file-type-docx")},creating_xlsx:{message:W({defaultMessage:"Creating XLSX",id:"ZyT2MB8/KD"}),icon:B("file-spreadsheet")},thinking:{message:W({defaultMessage:"Thinking",id:"AHQWDTo4+e"}),icon:B("bubble-text")},reading_history:{message:W({defaultMessage:"Reviewing your browser history",id:"7cZkJ7qeNW"}),icon:B("world-search")},searching_browser:{message:W({defaultMessage:"Searching your browser",id:"i91D1hXua6"}),icon:B("world-search")},searching_open_tabs:{message:W({defaultMessage:"Searching open tabs",id:"xHbSQOjdLq"}),icon:B("input-search")},opening_tab:{message:W({defaultMessage:"Opening tab",id:"ySnoI+lduZ"}),icon:B("browser-plus")},closing_tabs:{message:W({defaultMessage:"Closing your tabs",id:"2KnXtfjRKV"}),icon:B("browser-minus")},searching_gmail:{message:W({defaultMessage:"Searching your email",id:"X1ami4cm1T"}),icon:B("mail-search")},emailing:{message:W({defaultMessage:"Emailing",id:"QRygokyD+u"}),icon:B("mail-search")},searching_calendar:{message:W({defaultMessage:"Searching your calendar",id:"nH9G8cL0Ys"}),icon:B("calendar-search")},conclusion:{message:W({defaultMessage:"Wrapping up",id:"DN3hjkyzeT"}),icon:null},generating_images:{message:W({defaultMessage:"Generating",id:"NAZfqr2apb"}),icon:B("photo-bolt")},presenting_images:{message:W({defaultMessage:"Presenting",id:"BlxYo7+tmK"}),icon:B("slideshow")},grouping_tabs:{message:W({defaultMessage:"Grouping tabs",id:"Fg6l7eg2HV"}),icon:B("server-bolt")},ungrouping_tabs:{message:W({defaultMessage:"Ungrouping tab groups",id:"dbpFCBu2NQ"}),icon:B("server-off")},searching_tab_groups:{message:W({defaultMessage:"Searching tab groups",id:"V+4/ioYMPd"}),icon:B("search")},getting_freebusy:{message:W({defaultMessage:"Checking availability",id:"ZamRNp2QgI"}),icon:B("calendar-search")},getting_user_info:{message:W({defaultMessage:"Searching your contacts",id:"gPpZJKZdnL"}),icon:B("address-book")},found_contacts:{message:W({defaultMessage:"Found contacts",id:"2zmZgbYnmk"}),icon:B("address-book")},no_contacts_found:{message:W({defaultMessage:"No contacts found",id:"JhY7bAH15Y"}),icon:B("address-book")},selecting_contacts:{message:W({defaultMessage:"Selecting contacts",id:"OQhQc1Jomc"}),icon:B("address-book")},getting_contact_details:{message:W({defaultMessage:"Getting contact details",id:"p391mWkGfv"}),icon:B("address-book")},scheduling:{message:W({defaultMessage:"Scheduling",id:"5lQx5rgTEW"}),icon:B("calendar-plus")},scheduled:{message:W({defaultMessage:"Scheduled",id:"cXAlMRerxW"}),icon:B("calendar-plus")},reading_events:{message:W({defaultMessage:"Getting event details",id:"0QgD+ftRet"}),icon:B("calendar-search")},reading_emails:{message:W({defaultMessage:"Reviewing emails",id:"f/yAuwo+Vl"}),icon:B("mail-search")},OPEN_TAB:{message:W({defaultMessage:"Open tabs",id:"KO2pxljl8b"}),icon:B("browser-plus")},RECENTLY_CLOSED_TAB:{message:W({defaultMessage:"Recently closed tabs",id:"GrcBtKIzPh"}),icon:B("browser-minus")},BROWSER_HISTORY:{message:W({defaultMessage:"Browser history",id:"DtBSny6kw5"}),icon:B("world-search")},MCP_TOOL:{message:W({defaultMessage:"Connecting to {appName}",id:"w+iLkzBJV0"}),icon:B("tools")},searching_flights:{message:W({defaultMessage:"Searching flights",id:"9+i0zI94jg"}),icon:B("search")},reviewing_booking_options:{message:W({defaultMessage:"Reviewing options",id:"hEF13crkAK"}),icon:B("search")},looking_for_booking_options:{message:W({defaultMessage:"Looking for booking options",id:"KIKXHtHJvz"}),icon:B("search")},redirecting_to_booking:{message:W({defaultMessage:"Redirecting to booking site",id:"y/a1lYMfGW"}),icon:B("search")},setting_up_price_alert_automation:{message:W({defaultMessage:"Setting up PriceAlertAutomation",id:"+7IqVk27BT"}),icon:B("graph")},read_page:{message:W({defaultMessage:"Reading page",id:"eEZaxWqt5u"}),icon:B("file-text")},get_page_text:{message:W({defaultMessage:"Getting page text",id:"rZqPh2Mfgi"}),icon:B("file-text")},tabs_context:{message:W({defaultMessage:"Getting tab context",id:"kcCvqWgrPU"}),icon:B("file-text")},tabs_create:{message:W({defaultMessage:"Creating tab",id:"NprxDW5RAN"}),icon:B("browser-plus")},form_input:{message:W({defaultMessage:"Filling form",id:"+gn8Qfhxa/"}),icon:B("forms")},find:{message:W({defaultMessage:"Finding elements",id:"PicRTL+DUk"}),icon:B("search")},find_elements:{message:W({defaultMessage:"Finding elements",id:"PicRTL+DUk"}),icon:B("search")},search_web:{message:W({defaultMessage:"Searching",id:"IfE0if3ytt"}),icon:B("search")},creating_todo_list:{message:W({defaultMessage:"Creating to-do list",id:"ZOeanuIrvQ"}),icon:B("checklist")},updating_todo_list:{message:W({defaultMessage:"Updating to-do list",id:"bb/FiiKtsc"}),icon:B("checklist")},running_sub_tasks:{message:W({defaultMessage:"Running sub-tasks",id:"H8wmfkHGA3"}),icon:B("server-bolt")},left_click:{message:W({defaultMessage:"Clicking",id:"n43/KMHgLD"}),icon:B("click")},right_click:{message:W({defaultMessage:"Right clicking",id:"YAxezKzj4p"}),icon:B("click")},double_click:{message:W({defaultMessage:"Double clicking",id:"anyjKtRL4p"}),icon:B("click")},triple_click:{message:W({defaultMessage:"Triple clicking",id:"aqH53Ke8R4"}),icon:B("click")},left_click_drag:{message:W({defaultMessage:"Dragging",id:"A/Bht8akH/"}),icon:B("click")},type:{message:W({defaultMessage:"Typing",id:"N2bqd9kL1X"}),icon:B("keyboard")},screenshot:{message:W({defaultMessage:"Reading page",id:"eEZaxWqt5u"}),icon:B("file-text")},wait:{message:W({defaultMessage:"Waiting",id:"dZd8H/KE0T"}),icon:B("access-point")},bash:{message:W({defaultMessage:" ",id:"+Q3dd+QA3+"}),icon:B("terminal-2")},file_read:{message:W({defaultMessage:"Reading",id:"MOK/yKIpYX"}),icon:B("file-text")},file_write:{message:W({defaultMessage:"Editing",id:"pBQ5bdyqop"}),icon:B("file-text")},file_edit:{message:W({defaultMessage:"Editing",id:"pBQ5bdyqop"}),icon:B("file-text")}},bI={initial:{opacity:0,position:"absolute",width:"100%"},animate:{opacity:1,position:"relative",transition:{opacity:{duration:1.2}}},exit:{opacity:0,position:"absolute",width:"100%",transition:{opacity:{duration:1.2}}}},tBe=()=>{const{$t:e}=J();return d.useMemo(()=>({success:e({defaultMessage:"Success",id:"xrKHS6mnOh"}),couldNotFinish:e({defaultMessage:"Could not finish",id:"Sz8oY2B0GK"}),allEmail:e({defaultMessage:"All Emails",id:"xe3SFk3aV+"}),allTabs:e({defaultMessage:"All tabs",id:"vYBCIf+wNz"}),failedClosedTabs:e({defaultMessage:"Could not close tabs",id:"hjoQ7gU34V"}),results:e({defaultMessage:"Results",id:"yaMHMBMsQ7"}),continue:e({defaultMessage:"Continue",id:"acrOozm08x"}),skip:e({defaultMessage:"Skip",id:"/4tOwTiCH6"}),foundInfo:e({defaultMessage:"Details retrieved",id:"YCMMMHEIKw"}),allTabGroups:e({defaultMessage:"All tab groups",id:"YL1jEopcqf"}),gmailNotAuthenticated:e({defaultMessage:"Gmail not connected",id:"Zj8MiXlulR"}),googleCalendarNotAuthenticated:e({defaultMessage:"Google Calendar not connected",id:"PH33AilmeW"}),matchesFound:t=>t===0?e({defaultMessage:"No matches found",id:"KeJh7yZCu8"}):e({defaultMessage:"{count, plural, one {One match found} other {# matches found}}",id:"ji6QO7fi7u"},{count:t}),emailsFound:t=>t===0?e({defaultMessage:"No emails found",id:"suW4stNi19"}):e({defaultMessage:"{count, plural, one {# email} other {# emails}}",id:"Rh0ulH+p+5"},{count:t}),eventsFound:t=>t===0?e({defaultMessage:"No events found",id:"GDgEmCHaVM"}):e({defaultMessage:"{count, plural, one {# event} other {# events}}",id:"HhJ8RP7qsx"},{count:t}),availableTimesFound:t=>t===0?e({defaultMessage:"No available times found",id:"2jnY2Ky2Nv"}):e({defaultMessage:"{count, plural, one {# available time} other {# available times}}",id:"5yH+BVFO1f"},{count:t}),selectedContacts:t=>e({defaultMessage:"Selected {count, plural, one {# contact} other {# contacts}}",id:"4kDAeuSFTs"},{count:t}),skippedContacts:e({defaultMessage:"Skipped selecting contacts",id:"IXqYGlHPpF"}),noAvailabilityFound:e({defaultMessage:"No availability",id:"x2vleFRn/L"})}),[e])},nBe=({tool_input_content:e})=>{const t=e.tool_input?.subagent_tool_inputs?.subagents;return t?l.jsx(K,{className:"gap-y-md flex flex-col",children:t.filter(n=>n.task_uuid).map((n,r)=>{const s=e.subagent_steps?.[n.task_uuid]?.steps;return s?l.jsxs("div",{className:"rounded-lg border p-4 transition-colors duration-150",children:[n.description&&l.jsx(V,{className:"mb-3",children:n.description}),s[s.length-1]?.thought&&l.jsx(V,{color:"light",variant:"small",children:s[s.length-1]?.thought})]},r):null})}):null};var Oc;(function(e){e.PENDING="pending",e.IN_PROGRESS="in_progress",e.COMPLETED="completed"})(Oc||(Oc={}));function rBe(e){switch(e){case Oc.COMPLETED:return{icon:B("circle-check"),iconClassName:"text-quietest mb-0.5",textColor:"ultraLight",textClassName:"line-through"};case Oc.IN_PROGRESS:return{icon:B("circle-arrow-right"),iconClassName:"text-quiet mb-0.5",textColor:"light",textClassName:void 0};case Oc.PENDING:return{icon:B("circle"),iconClassName:"text-quiet mb-0.5",textColor:"light",textClassName:void 0};default:At(e)}}const iee=({todos:e})=>l.jsx("div",{className:"bg-offset p-md rounded-xl",children:l.jsx("div",{className:"gap-xs flex flex-col",children:e.map((t,n)=>{const r=t.status??Oc.PENDING,s=r===Oc.IN_PROGRESS&&t.active_form?t.active_form:t.content??"",{icon:o,iconClassName:a,textColor:i,textClassName:c}=rBe(r);return l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ge,{icon:o,size:"sm",className:a}),l.jsx(V,{variant:"small",color:i,className:c,children:s})]},`${s}-${n}`)})})});iee.displayName="TodoListStep";const Is=` -`;function lee({baseInstructions:e,additionalInstructions:t}){let n=e+Is;return t&&(n+=t),n}function _I({prompt:e,baseInstructions:t}){if(!e||!t)return"";const n=e.replace(/\\n/g,Is),r=t.replace(/\\n/g,Is),s=r+Is;if(n.startsWith(s))return n.slice(s.length);if(n.startsWith(r)){const i=n.slice(r.length);if(i.startsWith(Is))return i.slice(Is.length);if(i.trim()==="")return""}return n.startsWith(r)?"":n}function sBe(e){const t=e.split(Is),n=t[0]||"",r=t.length>1?t.slice(1).join(Is):"";return{baseInstructions:n,additionalInstructions:r}}function oBe(e,t){let n=e;for(const[r,s]of Object.entries(t))n=n.replaceAll(r,s);return n}function wI({rawInstructions:e,symbol:t,quoteName:n="",eventValue:r,direction:s}){return oBe(e,{"\\\\n":` -`,"{symbol}":t,"{quoteName}":n,"{{event_value}}":r,"{{direction}}":s})}function cee({prompt:e,symbol:t,quoteName:n=""}){if(!t||!e)return"";let r=e;r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1));const s="Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent {{direction}} to {{event_value}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.",o="Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent {{event_value}}% {{direction}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.";let a=r;if(a.startsWith(s+Is))a=a.slice((s+Is).length);else if(a.startsWith(o+Is))a=a.slice((o+Is).length);else if(a===s||a===o)return"";if(a.includes(Is)){const i=a.split(Is);a=i[i.length-1]??a}return a}function NE({selectedSymbol:e,symbol:t,quote:n,isLoading:r=!1,alertType:s,priceValue:o,percentValue:a,currencySymbol:i,$t:c}){const u=e??t,f=n?.name?` (${n.name})`:"",m=d.useMemo(()=>s==="price"?aBe({symbol:u,quoteName:f,priceValue:o,currencySymbol:i,$t:c}):iBe({symbol:u,quoteName:f,percentValue:a,$t:c}),[s,u,f,o,i,c,a]),p=d.useMemo(()=>!u||!n?"":s==="price"?$v({symbol:u,quoteName:f}):qv({symbol:u,quoteName:f}),[u,n,s,f]),h=!r&&n?.name;return d.useMemo(()=>({shouldShowDisplayInstructions:h,displayInstructions:m,baseInstructions:p,effectiveSymbol:u,quoteName:f}),[p,m,u,f,h])}function $v({symbol:e,quoteName:t,$t:n}){return n?n({id:"0J1c9pn78+",defaultMessage:"Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent '{{direction}}' to '{{event_value}}'. Contextualize this price movement within the last few weeks of price movement and investor narrative."},{symbol:e||"",quoteName:t||""}):`Explain the factors driving the latest movement of ${e}${t||""}, including its recent {{direction}} to {{event_value}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.`}function qv({symbol:e,quoteName:t,$t:n}){return n?n({id:"9XAm3nfaVB",defaultMessage:"Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent '{{event_value}}%' '{{direction}}'. Contextualize this price movement within the last few weeks of price movement and investor narrative."},{symbol:e||"",quoteName:t||""}):`Explain the factors driving the latest movement of ${e}${t||""}, including its recent {{event_value}}% {{direction}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.`}function aBe({symbol:e,quoteName:t,priceValue:n,currencySymbol:r,$t:s}){if(!e)return s({id:"39tYCstx5d",defaultMessage:"Explain the factors driving the latest movement of this asset, including its recent rise/fall. Contextualize this price movement within the last few weeks of price movement and investor narrative."});const o=n&&n!=="$"?s({defaultMessage:" to {currencySymbol}{priceValue}",id:"zSy/VeEpR9"},{priceValue:n,currencySymbol:r}):"",a=s({defaultMessage:"rise/fall",id:"+dqzTFX/gy"});return $v({symbol:e,quoteName:t,$t:s}).replace(" to {{event_value}}",o).replace("{{direction}}",a)}function iBe({symbol:e,quoteName:t,percentValue:n,$t:r}){if(!e)return r({id:"pP0ylRs8IX",defaultMessage:"Explain the factors driving the latest movement of this asset, including its recent increase/decrease. Contextualize this price movement within the last few weeks of price movement and investor narrative."});const s=r({id:"QBY86oKDNP",defaultMessage:"increase/decrease"});return qv({symbol:e,quoteName:t,$t:r}).replace(" {{event_value}}%",n?` ${parseFloat(n).toFixed(2)}%`:"").replace("{{direction}}",s)}const Bl=1e9,Ul=-1e9;function RE({symbol:e,alertType:t,priceValue:n,priceThreshold:r,percentValue:s,positiveSelected:o=!0,negativeSelected:a=!0,baseInstructions:i,additionalInstructions:c=""}){let u,f="";if(t==="price"){if(!n||!r)return null;const p=parseFloat(n.replace(/[^0-9.]/g,""));if(isNaN(p))return null;u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_TARGET",value_lower_bound:r==="below"?p:Ul,value_upper_bound:r==="above"?p:Bl},f=`Alert when ${e} is ${r} ${n}`}else if(t==="movement"){if(!s)return null;const p=parseFloat(s);if(isNaN(p))return null;o&&a?(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:-p,value_upper_bound:p},f=`Alert when ${e} moves +${s}% or -${s}% in a day`):o?(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:Ul,value_upper_bound:p},f=`Alert when ${e} moves +${s}% in a day`):a&&(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:-p,value_upper_bound:Bl},f=`Alert when ${e} moves -${s}% in a day.`)}if(!u)return null;const m=lee({baseInstructions:i,additionalInstructions:c});return{task_name:f,prompt:m,event_subscription:u,model_preference:"turbo"}}const CI="usd";function X0(e){return e!=null&&e!==Bl&&e!==Ul&&e!==dR&&e!==-1&&Math.abs(e)!==dR}const Rr=A.memo(({icon:e,text:t,favicon:n,className:r,iconClassName:s,url:o})=>{const a=l.jsx(K,{variant:"subtler",className:z("py-xs inline-block rounded-lg px-2",{"hover:bg-super group cursor-pointer":o},r),children:l.jsxs(V,{variant:"tinyRegular",className:z("gap-x-xs flex items-center",{"group-hover:text-inverse dark:group-hover:text-inverse":o}),children:[n?l.jsx("img",{src:n,alt:t,className:"size-[14px]"}):e?l.jsx(ge,{icon:e,size:"xs",className:s}):null,l.jsx("p",{className:"px-two",children:t})]})});return o?l.jsx(yt,{href:o,target:"_blank",rel:"noopener",children:a}):a});Rr.displayName="BotLabel";const lBe=async(e,t,n)=>{const{data:r,error:s,response:o}=await de.POST("/rest/sse/handle_tool_user_approval_response","mcp-tool-user-approval",{body:{result:{uuid:e,allow_tool_call:t,user_revision:n}}});if(s)throw s;return{data:r,error:s,response:o}},uee=()=>Rt({mutationFn:({uuid:e,allowToolCall:t,userRevision:n})=>lBe(e,t,n)}),cBe=async(e,t,n)=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/sse/handle_perplexity_research_clarifying_answers","research-clarifying-questions",{body:{result:{tool_uuid:t,answers:e,submit_type:n}}});if(s){Z.log("Error submitting research clarifying questions:",s);return}return{data:r,error:s,response:o}}catch(r){Z.log(r);return}},uBe=()=>Rt({mutationFn:({answers:e,toolUuid:t,submitType:n})=>cBe(e,t,n)}),dee=A.memo(({entryUUID:e,sourceType:t,sourceName:n,userApprovalUuid:r,onSkipSourceClicked:s,isAutoDetected:o})=>{const[a,i]=d.useState(!1),{actions:c}=It(),{openToast:u}=hn(),{session:f}=Ne(),{trackEvent:m}=Xe(f),p=J(),h=uee(),g=d.useCallback(async()=>{i(!0),s?.(),m("query source skipped",{entryUUID:e,sourceType:t,sourceName:n,isAutoDetected:o}),c.addSkippedSource(t);try{await Nge({entryUUID:e,sourceType:t,reason:"skip-source-button"}),r&&h.mutate({uuid:r,allowToolCall:"SKIP_SOURCE"})}catch{u({message:p.formatMessage({defaultMessage:"Failed to skip source",id:"73EQcPTvg9"}),variant:"error",timeout:null}),c.removeSkippedSource(t),i(!1)}},[e,t,n,o,c,u,p,r,h,s,m]);return l.jsx(V,{color:"light",variant:"small",className:"text-pretty",children:l.jsx("div",{className:"relative min-h-[20px] w-full",children:a?l.jsx(Te.div,{initial:"initial",animate:"animate",exit:"exit",variants:bI,children:l.jsx(br,{variant:"super",as:"div",className:"px-sm flex h-6 items-center",children:l.jsx(je,{defaultMessage:"Skipping…",id:"6NU82XTPCI"})})},"skipping-message"):l.jsx(Te.div,{initial:"initial",animate:"animate",exit:"exit",variants:bI,children:l.jsx(Ge,{size:"tiny",onClick:g,variant:"common",icon:B("player-track-next"),extraCSS:"rounded-lg",text:l.jsx(je,{defaultMessage:"Skip {sourceName}",id:"B0WVL5L6bh",values:{sourceName:n}}),"data-testid":"skip-source-button"})},"skip-button")})})});dee.displayName="SkipSourceButton";const fee=A.memo(({mediaItems:e,className:t})=>{const n=e?.[e?.length-1],r=n?.media_item,s=r?.image||r?.thumbnail,o=d.useMemo(()=>({url:r?.url,name:r?.name}),[r?.name,r?.url]);return n?l.jsxs("div",{className:z("@xs:px-md @xs:pb-md px-sm pb-sm relative flex flex-col gap-1.5",t),children:[l.jsx(St,{mode:"wait",children:l.jsx(Te.div,{className:"after:ring-subtler @xs:w-20 md:@xs:w-60 relative overflow-hidden rounded after:pointer-events-none after:absolute after:inset-0 after:rounded-md after:ring-1 after:ring-inset after:ring-opacity-50 md:w-full dark:after:ring-0",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeOut"},children:l.jsx(Wo,{src:r?.thumbnail,lightboxSrc:s,alt:r?.name,origin:o,includeLightBoxModal:!0,rounded:!0,imageClassName:"object-cover w-full text-[0] dark:mix-blend-normal",containerClassName:"h-full w-full",maskClassName:"bg-subtler"})},r?.thumbnail)}),r?.url&&l.jsx("div",{children:l.jsx(yt,{href:r?.url,target:"_blank",children:l.jsx(st,{icon:B("arrow-up-right"),variant:"common",size:"tiny",text:"Open page",extraCSS:"group",iconClassName:"group-hover:text-super",textClassName:"group-hover:text-super font-normal",noPadding:!0})})})]}):null});fee.displayName="StepCardMedia";const Dl=(e,t,n)=>{const r=document.createElement(e),[s,o]=Array.isArray(t)?[void 0,t]:[t,n];return s&&Object.assign(r,s),o?.forEach(a=>r.appendChild(a)),r},dBe=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},fBe=e=>e.offsetWidth>0&&e.offsetHeight>0,mBe=(e,t)=>{customElements.get(e)!==t&&customElements.define(e,t)};function pBe(e,t,{reverse:n=!1}={}){const r=e.length;for(let s=n?r-1:0;n?s>=0:s`${y}:${u[y]=(u[y]??-1)+1}`;let m="",p=!1,h=!1;for(const y of s){m+=y.value;const x=y.type==="minusSign"||y.type==="plusSign"?"sign":y.type;x==="integer"?(p=!0,a.push(...y.value.split("").map(v=>({type:x,value:parseInt(v)})))):x==="group"?a.push({type:x,value:y.value}):x==="decimal"?(h=!0,i.push({type:x,value:y.value,key:f(x)})):x==="fraction"?i.push(...y.value.split("").map(v=>({type:x,value:parseInt(v),key:f(x),pos:-1-u[x]}))):(p||h?c:o).push({type:x,value:y.value,key:f(x)})}const g=[];for(let y=a.length-1;y>=0;y--){const x=a[y];g.unshift(x.type==="integer"?{...x,key:f(x.type),pos:u[x.type]}:{...x,key:f(x.type)})}return{pre:o,integer:g,fraction:i,post:c,valueAsString:m,value:typeof e=="string"?parseFloat(e):e}}const gBe=String.raw,yBe=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),xBe=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),SI=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,S2="--_number-flow-d-opacity",w6="--_number-flow-d-width",E2="--_number-flow-dx",C6="--_number-flow-d",vBe=(()=>{try{return CSS.registerProperty({name:S2,syntax:"",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:E2,syntax:"",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:w6,syntax:"",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:C6,syntax:"",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),bBe="var(--number-flow-char-height, 1em)",fl="var(--number-flow-mask-height, 0.25em)",EI=`calc(${fl} / 2)`,DE="var(--number-flow-mask-width, 0.5em)",pc=`calc(${DE} / var(--scale-x))`,Z0="#000 0, transparent 71%",kI=gBe`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${bBe} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${w6}) / var(--width));transform:translateX(var(${E2})) scaleX(var(--scale-x));margin:0 calc(-1 * ${DE});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${pc},#000 calc(100% - ${pc}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${fl},#000 calc(100% - ${fl}),transparent 100% ),radial-gradient(at bottom right,${Z0}),radial-gradient(at bottom left,${Z0}),radial-gradient(at top left,${Z0}),radial-gradient(at top right,${Z0});-webkit-mask-size:100% calc(100% - ${fl} * 2),calc(100% - ${pc} * 2) 100%,${pc} ${fl},${pc} ${fl},${pc} ${fl},${pc} ${fl};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${EI} ${DE};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${E2})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${C6})}.digit__num,.number .section::after{padding:${EI} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${S2}))}`,_Be=HTMLElement,wBe=xBe&&yBe&&vBe;let J0,mee=class extends _Be{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:s,fraction:o,post:a,value:i}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,i):this.trend,this.computedAnimated=wBe&&this._animated&&(!this.respectMotionPreference||!(SI!=null&&SI.matches))&&fBe(this),(n=this.plugins)==null||n.forEach(u=>{var f;return(f=u.onUpdate)==null?void 0:f.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:s,fraction:o}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)J0||(J0=new CSSStyleSheet,J0.replaceSync(kI)),this.shadowRoot.adoptedStyleSheets=[J0];else{const c=document.createElement("style");c.textContent=kI,this.shadowRoot.appendChild(c)}this._pre=new TI(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new CBe(this,s,o),this.shadowRoot.appendChild(this._num.el),this._post=new TI(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};mee.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};let CBe=class{constructor(t,n,r,{className:s,...o}={}){this.flow=t,this._integer=new MI(t,n,{justify:"right",part:"integer"}),this._fraction=new MI(t,r,{justify:"left",part:"fraction"}),this._inner=Dl("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=Dl("span",{...o,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,r=this.el.offsetWidth,s=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[E2]:[`${n}px`,"0px"],[w6]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}},pee=class{constructor(t,n,{justify:r,className:s,...o},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const i=n.map(c=>this.addChar(c).el);this.el=Dl("span",{...o,className:`section section--justify-${r} ${s??""}`},a?a(i):i)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const s=t.type==="integer"||t.type==="fraction"?new gee(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new SBe(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${dBe(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,s=this.justify==="left",o=s?"prepend":"append";if(pBe(t,a=>{let i;this.children.has(a.key)?(i=this.children.get(a.key),r.set(a,i),this.unpop(i),i.present=!0):(i=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),n.set(a,i)),this.el[o](i.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();n.forEach(i=>{i.willUpdate(a)})}n.forEach((a,i)=>{a.update(i.value)}),r.forEach((a,i)=>{a.update(i.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}},MI=class extends pee{update(t){const n=new Map;this.children.forEach((r,s)=>{t.find(o=>o.key===s)||n.set(s,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof gee&&r.update(0)}),this.pop(n)}},TI=class extends pee{update(t){const n=new Map;this.children.forEach((r,s)=>{t.find(o=>o.key===s)||n.set(s,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}},jE=class{constructor(t,n,{onRemove:r,animateIn:s=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var o;this.el.remove(),(o=this._onRemove)==null||o.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[S2]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[S2]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}},hee=class extends jE{constructor(t,n,r,s){super(t.flow,r,s),this.section=t,this.value=n,this.el=r}},gee=class extends hee{constructor(t,n,r,s,o){var a,i;const c=(((i=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:i.max)??9)+1,u=Array.from({length:c}).map((m,p)=>{const h=Dl("span",{className:"digit__num"},[document.createTextNode(String(p))]);return p!==r&&h.setAttribute("inert",""),h.style.setProperty("--n",String(p)),h}),f=Dl("span",{part:`digit ${n}-digit`,className:"digit"},u);f.style.setProperty("--current",String(r)),f.style.setProperty("--length",String(c)),super(t,r,f,o),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],s=n.width/2;this._prevCenter=this.section.justify==="left"?r+s:r-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],s=n.width/2,o=this.section.justify==="left"?r+s:r-s,a=this._prevCenter-o;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const i=this.getDelta();i&&(this.el.classList.add("is-spinning"),this.el.animate({[C6]:[-i,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const o=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(o!=null)return o}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value()=>{this._children.delete(a)},this._children.set(r,new jE(this.flow,o,{onRemove:this._onChildRemove(r)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const r=this._children.get(t);if(r)r.present=!0;else{const s=Dl("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new jE(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const EBe=parseInt(d.version.match(/^(\d+)\./)?.[1]),S6=EBe>=19,kBe=["data","digits"];class E6 extends mee{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}E6.observedAttributes=S6?[]:kBe;mBe("number-flow-react",E6);const MBe={},AI=S6?e=>e:JSON.stringify;function NI(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:s,respectMotionPreference:o,trend:a,plugins:i,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:s,respectMotionPreference:o,trend:a,plugins:i},c]}class TBe extends d.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=NI(this.props);Object.entries(n).forEach(([r,s])=>{this.el[r]=s??E6.defaultProps[r]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),S6&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,n,r){r?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:s,willChange:o,isolate:a,group:i,digits:c,onAnimationsStart:u,onAnimationsFinish:f,...m}]=NI(this.props);return d.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":o?"":void 0,class:r,...m,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:AI(c),data:AI(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const jp=d.forwardRef(function({value:t,locales:n,format:r,prefix:s,suffix:o,...a},i){d.useImperativeHandle(i,()=>c.current,[]);const c=d.useRef(),u=d.useContext(ABe);u?.useRegister(c);const f=d.useMemo(()=>n?JSON.stringify(n):"",[n]),m=d.useMemo(()=>r?JSON.stringify(r):"",[r]),p=d.useMemo(()=>{const h=MBe[`${f}:${m}`]??=new Intl.NumberFormat(n,r);return hBe(t,h,s,o)},[t,f,m,s,o]);return d.createElement(TBe,{...a,group:u,data:p,innerRef:c})}),ABe=d.createContext(void 0),yee=d.memo(({count:e,className:t})=>l.jsx(K,{className:z("flex select-none items-center pt-px text-center font-mono text-xs tabular-nums leading-none",t),as:"span",children:l.jsx(jp,{value:e})}));yee.displayName="AnimatedCounter";const Qf=A.memo(({favicon:e,description:t,descriptionClassName:n,title:r,descriptionFooter:s,count:o,url:a,media:i,children:c,className:u,showMedia:f=!0,onClick:m,isMissionControlSummary:p,accessory:h})=>{const g=f&&i&&i.length>0;return l.jsxs(K,{variant:"raised",className:z("@container group/step-card relative isolate flex flex-col gap-1.5 overflow-hidden rounded-xl border shadow-sm",u),onClick:m,children:[h&&l.jsx("div",{className:"absolute right-2 top-2",children:h}),(r||e)&&l.jsxs("div",{className:"@xs:px-md px-sm @xs:pt-3 @xs:gap-3 gap-sm flex min-w-0 items-center pt-2",children:[a&&e?l.jsx(yt,{href:a,target:"_blank",rel:"noopener",className:"@xs:size-4 inline-flex size-3 shrink-0 items-center justify-center overflow-hidden rounded",children:e}):e,l.jsxs("div",{className:"@xs:text-sm flex min-w-0 flex-1 items-baseline text-xs",children:[r&&l.jsx("div",{className:"relative flex min-w-0 flex-1",children:l.jsx(V,{variant:"tiny",className:"@xs:text-sm min-w-0 flex-1 truncate",children:r})}),o&&l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("span",{className:"px-xs ml-px leading-none opacity-35",children:"·"}),l.jsx(yee,{count:o,className:"opacity-65"})]})]})]}),l.jsxs("div",{className:"@xs:gap-sm @xs:flex-row flex flex-col gap-0",children:[l.jsxs("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[t&&l.jsx(l.Fragment,{children:p?l.jsx(xee,{description:t}):l.jsx(V,{variant:"tinyRegular",className:z("px-md @xs:text-sm text-pretty",e?"@xs:ml-7 ml-4":void 0,n),children:t})}),s&&l.jsx("div",{className:"px-md @xs:ml-7 ml-4",children:s}),c]}),g&&l.jsx(fee,{mediaItems:i})]})]})});Qf.displayName="StepCard";const xee=A.memo(({description:e})=>{const[t,n]=d.useState(!1),{$t:r}=J(),s=d.useCallback(o=>{o.stopPropagation(),n(!t)},[t]);return l.jsxs(V,{variant:"tinyRegular",className:z("px-md mb-sm @xs:text-sm @xs:ml-7 relative ml-4 line-clamp-2 text-pretty",t&&"line-clamp-none"),children:[l.jsxs("span",{className:z("relative",{"select-none":!t}),children:[e,t&&l.jsxs(V,{inline:!0,variant:"tinyRegular",color:"light",className:"hover:text-super inline-flex select-none items-center opacity-0 group-hover/step-card:opacity-100",onClick:s,children:[" ",r({id:"mFYgAXM/x4",defaultMessage:"Less"}),l.jsx(ge,{icon:B("chevron-up"),size:"xs"})]})]}),!t&&l.jsxs(l.Fragment,{children:[l.jsx(K,{className:"absolute inset-0",variant:"raised",style:{maskImage:"linear-gradient(to bottom, transparent 0%, black 100%)"}}),l.jsxs(V,{variant:"tinyRegular",color:"light",className:"right-md hover:text-super bg-raised pl-xs absolute bottom-0 hidden translate-x-2 select-none items-center group-hover/step-card:inline-flex",onClick:s,children:[r({id:"I5NMJ8llIi",defaultMessage:"More"}),l.jsx(ge,{icon:B("chevron-down"),size:"xs"})]})]})]})});xee.displayName="ExpandableDescription";function NBe({scrollContainerRef:e,autoScroll:t=!1,children:n}){const[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useCallback(()=>{const c=e.current;if(!c)return;const u=Math.abs(c.scrollTop),f=Math.max(0,c.scrollHeight-c.clientHeight),m=f>0;t?(s(m&&u0)):(s(m&&u>0),a(m&&u{i()},[i]),d.useEffect(()=>{const c=e.current;if(c)return c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)},[i,e]),d.useEffect(()=>{i();const c=e.current;if(!c)return;const u=new MutationObserver(i);return u.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>u.disconnect()},[n,i,e]),d.useMemo(()=>({canScrollUp:r,canScrollDown:o}),[r,o])}const RBe=220,RI=24,DI=16,Ng=A.memo(({children:e,className:t,scrollContainerClassName:n,maxHeight:r=RBe,showTopGradient:s=!0,showBottomGradient:o=!0,autoScroll:a=!0,topGradientOffset:i=0})=>{const c=d.useRef(null),{canScrollUp:u,canScrollDown:f}=NBe({scrollContainerRef:c,autoScroll:a,children:e}),m=d.useMemo(()=>{if(i>0){const h=s&&u,g=o&&f;if(!h&&!g)return{};let y;if(h&&g){const x=i+RI,v=`calc(100% - ${DI}px)`;y=`linear-gradient(180deg, black 0, black ${i}px, transparent ${i}px, black ${x}px, black ${v}, transparent 100%)`}else if(h){const x=i+RI;y=`linear-gradient(180deg, black 0, black ${i}px, transparent ${i}px, black ${x}px, black 100%)`}else y=`linear-gradient(180deg, black 0, black calc(100% - ${DI}px), transparent 100%)`;return{maskImage:y}}return{}},[u,f,i,s,o]),p=d.useMemo(()=>{if(i>0)return"";const h=s&&u,g=o&&f;return h&&g?"mask-fade-v-6":h?"mask-fade-t-6":g?"mask-fade-b-4":""},[u,f,i,s,o]);return l.jsx(K,{className:z("relative",t),children:l.jsx("div",{ref:c,className:z(a?"flex-col-reverse":"flex-col","scrollbar-subtle pb-sm relative flex overflow-y-auto pl-3 pr-1 [scrollbar-gutter:stable]",n,p),style:{maxHeight:r,...m},children:e})})});Ng.displayName="StepCardScrollableContent";const DBe=({wrapperClassName:e,variant:t="default",size:n="default",errorText:r,className:s,value:o,maxLength:a,errorMessage:i,disabled:c=!1,hasShadow:u=!1,autoFocus:f=!1,placeholder:m="",rightItems:p=Pe,onChange:h,onClear:g,onClick:y,onBlur:x,onFocus:v,onKeyDown:b,onPaste:_,isLoading:w,inlineEditBlock:S,label:C,subtitle:E,isOptional:T,minRows:k,isMobileUserAgent:I,allowEnterNewlines:M=!1,testId:N,textAreaClassname:D,ref:j})=>{const F=Zl(c),R=d.useRef(null),[P,L]=d.useState(!1),[U,O]=d.useState(!1),$=d.useRef(P);$.current=P,d.useEffect(()=>{!I&&f&&R.current?.focus()},[I,R,f]),d.useEffect(()=>{F!==c&&!c&&!I&&f&&setTimeout(()=>{R.current?.focus()},200)});const G=d.useMemo(()=>z({"border-r mr-sm pr-xs border-subtler":p.length!=0}),[p.length]),H=z("overflow-auto max-h-[50vh] outline-none w-full flex items-center","text-foreground font-sans resize-none","bg-transparent placeholder-quieter","caret-super selection:bg-super/50 dark:selection:bg-super/10 dark:selection:text-super",D),Q=d.useMemo(()=>{const _e=(()=>{switch(t){case"subtle":return"bg-subtle";case"default":return"bg-base dark:bg-subtler";default:At(t)}})(),ke=z("w-full focus:ring-subtler flex items-center",_e,"border border-subtler focus:ring-1 rounded-md","duration-200 transition-all",{"ring-subtler ring-1":P,"shadow-sm":u},s),De=z({"py-sm text-sm px-md":n==="default","text-base p-md pb-xl":n==="large"}),xe=z({"pr-md":p.length===0});return z(ke,De,xe)},[P,u,s,n,p.length,t]),Y=i!==void 0,te=!Y&&!!a&&!!o&&o.length>a,se=d.useMemo(()=>l.jsxs("div",{className:"right-sm gap-sm mb-xs pb-xs absolute bottom-0 flex items-center rounded-full",children:[w?l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("circle-half-2"),className:"aspect-square animate-spin"})}):null,Y&&l.jsx(K,{className:"mr-sm",children:l.jsx(V,{color:"red",variant:"tiny",children:i})}),te&&l.jsx(K,{className:"mr-sm",children:a&&o&&l.jsx(V,{color:"red",variant:"tiny",children:a-o.length})}),g!==void l.jsx("div",{className:G,children:l.jsx(st,{icon:B("x"),pill:!0,onClick:g,size:Ht.small})}),p.map((_e,ke)=>l.jsx(Ge,{..._e.buttonProps,size:Ht.small,disabled:_e.buttonProps.disabled||Y||te,pill:!0},ke))]}),[i,w,a,g,p,o,G,Y,te]),ae=d.useCallback(()=>{if(R.current){const _e=R.current.value.length;R.current.focus(),R.current.setSelectionRange(_e,_e)}},[]),X=d.useCallback(_e=>{if(!R?.current)return!0;const ke=R.current,{selectionStart:De,selectionEnd:xe,value:Ue}=ke;if(De!==xe)return!1;const Ee=document.createElement("div"),Ke=window.getComputedStyle(ke);Ee.style.position="absolute",Ee.style.visibility="hidden",Ee.style.whiteSpace=Ke.whiteSpace,Ee.style.wordWrap=Ke.wordWrap,Ee.style.font=Ke.font,Ee.style.padding=Ke.padding,Ee.style.border=Ke.border,Ee.style.width=ke.offsetWidth+"px",Ee.style.lineHeight=Ke.lineHeight,document.body.appendChild(Ee);try{const Nt=parseInt(Ke.lineHeight)||24,pe=Ue.substring(0,De);Ee.textContent=pe;const ve=Ee.offsetHeight;return _e==="first"?ve<=Nt:(Ee.textContent=Ue,Ee.offsetHeight-ve{v?.(_e.nativeEvent),L(!0)},[v]),le=d.useCallback(_e=>{x?.(_e.nativeEvent),L(!1)},[x]),re=d.useCallback(_e=>{y?.(_e.nativeEvent)},[y]),ce=d.useCallback(_e=>{h?.(_e.target.value)},[h]),ue=d.useCallback(_e=>{hh(_e.nativeEvent,{isMobileUserAgent:I,isComposing:U,allowEnterNewlines:M,onKeyDown:b})},[b,U,I,M]),me=d.useCallback(()=>kA(O),[O]),we=d.useCallback(()=>MA(O),[O]),ye=d.useCallback(_e=>{_?.(_e.nativeEvent)},[_]);return d.useImperativeHandle(j,()=>{const _e=R.current;return _e.focusAtEnd=ae,_e.inLine=X,_e.isFocused=()=>$.current,_e.append=ke=>{R.current&&(R.current.value+=ke)},_e.scrollToEnd=()=>{R.current&&(R.current.scrollTop=R.current.scrollHeight)},_e.trim=()=>{R.current&&(R.current.value=R.current.value.trim())},_e},[ae,X]),d.useEffect(()=>{f&&!I&&ae()},[f,ae,I]),l.jsxs("div",{"data-test-id":N,children:[l.jsx(_v,{label:C,subtitle:E,isOptional:T,errorText:r}),l.jsx("div",{className:z("rounded-3xl",e),children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("div",{className:Q,children:l.jsx(FY,{ref:R,autoFocus:f,placeholder:m,disabled:c,minRows:k,value:o,onClick:re,onChange:ce,name:C,onKeyDown:ue,onBlur:le,onCompositionStart:me,onCompositionEnd:we,onFocus:ee,onPaste:ye,className:H,autoComplete:"off","data-testid":N})}),l.jsx("div",{className:"absolute bottom-0 m-px flex justify-between rounded-b-md px-[6px]",style:{width:"calc(100% - 2px)"},children:se})]})}),S&&l.jsx("div",{className:"mt-sm flex justify-end",children:S})]})},hu=A.memo(DBe),vee=A.memo(({form_items:e,taskUuid:t})=>{const n=e?.[0]?.text_area_item,r=n?.placeholder,s=n?.text,[o,a]=d.useState(r||""),i="agent-form",c=d.useCallback(async h=>{try{await de.POST("/rest/browser/agent_confirmation",i,{body:{task_uuid:t,status:h,message:o},backOffTime:100,numRetries:2,headers:{"Content-Type":"application/json"}})}catch(g){Z.error("Error sending agent confirmation",g)}},[t,o,i]),{$t:u}=J(),f=d.useCallback(h=>{Ls.isEnterKeyWithoutShift(h)&&c("accept")},[c]),m=d.useCallback(h=>{h.stopPropagation(),c("accept")},[c]),p=d.useCallback(h=>{h.stopPropagation(),c("reject")},[c]);return l.jsxs(K,{className:"flex flex-col gap-3",children:[l.jsx(V,{color:"light",variant:"small",children:s}),l.jsx(hu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:r,value:o,onChange:a,onKeyDown:f}),l.jsxs("div",{className:"gap-sm py-sm flex items-center",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:u({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit",disabled:!1,onClick:m}),l.jsx(st,{size:"small",text:u({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:p})]})]})});vee.displayName="AgentForm";const Di=A.memo(e=>{const{isFinished:t,className:n,count:r,showAnimation:s,isPaused:o,...a}=e,i=J(),c=e.action&&Ri[e.action]?i.formatMessage(Ri[e.action].message):"",u=e.action?e.title?`${c}${e.title}`:c:e.title,f=e.action?Ri[e.action]?.icon:e.icon,m=t||o;return l.jsx(St,{mode:"popLayout",children:l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:s?0:.2,ease:"easeInOut"},className:z("gap-sm group flex cursor-pointer flex-col",n),children:l.jsxs(V,{variant:"tinyRegular",color:t?"light":"super",className:"flex items-center gap-1 py-1.5",children:[f&&l.jsx(ge,{icon:f,size:"2xs",className:"-mt-px opacity-80"}),l.jsxs(br,{variant:"super",active:!m,as:"span",speed:"slow",children:[u,r!==void 0&&r>0&&` · ${r}`]})]})},a.key)})});Di.displayName="StepActionLabel";const jBe=1e3,bee=A.memo(({message:e,isFinished:t,isPaused:n,isPendingClarification:r})=>{const[s,o]=d.useState(!1),a=d.useRef(e.thought||""),[i,c]=d.useState("working"),u=Do(),{result:f,inFlight:m}=It(),p=f?.uuid;d.useEffect(()=>{if(t){o(!1);return}e.thought!==a.current&&(a.current=e.thought,o(!1));const y=setTimeout(()=>{!t&&!e.action&&o(!0)},jBe);return()=>clearTimeout(y)},[e.thought,e.action,t]);const h=!e.action&&!e.thought&&e.url;return d.useEffect(()=>{let y="working";if(t?y="finished":n?y="paused":r?y="considering_clarification":h?y="reasoning":s&&!e.action?y="working":e.action&&e.action in Ri&&(y=e.action),c(y),u&&p&&m){const x=new CustomEvent("comet-agent-step-update",{detail:{stepAction:y,streamId:p}});document.dispatchEvent(x)}},[m,t,h,s,e.action,n,r,u,p]),!t&&(r||e.action||h||s&&!e.action)&&l.jsx(Di,{action:i,isFinished:t,isPaused:n,className:"pl-8"})});bee.displayName="AgentStatusManager";const IBe=({children:e,initial:t=!1,mode:n="wait",className:r,transition:s,supportZeroHeight:o=!0,...a})=>{const[i,{height:c}]=ti(),u=mi(),f=o||c>0?c:"auto";return l.jsx(Te.div,{animate:{height:u?f:"auto"},className:r,transition:s,...a,children:l.jsx("div",{ref:i,children:l.jsx(St,{mode:n,initial:t,children:e})})})},Kr=tl(.16,1,.3,1),Kbt=tl(.7,0,.84,0),PBe=({children:e,initial:t={opacity:0},animate:n={opacity:1},exit:r,transition:s,className:o,style:a,ref:i})=>l.jsx(Te.div,{initial:t,animate:n,exit:r??t,transition:s,ref:i,className:o,style:a,children:e}),pi=IBe,Oo=PBe,ca=A.memo(({variant:e=Wx.subtle,label:t,accessory:n,onClick:r,className:s,size:o="default",textColor:a="default",icon:i,iconUrl:c,iconClassName:u,iconOnly:f=!1,tooltip:m,truncate:p=!1,hover:h=!0,href:g,linkBehavior:y="none",trackEvent:x,forceExternalHandler:v,containerClassName:b})=>{const _=d.useCallback(E=>{y==="external"&&g&&x&&x("click citation",{source:"inline",citation_url:g}),(y!=="external"||v)&&r?.(E)},[r,y,g,x,v]),w=l.jsxs(K,{as:"span",variant:e,className:z("text-3xs rounded-badge group min-w-4 cursor-pointer text-center align-middle font-mono tabular-nums",{"py-[0.1875rem] leading-snug":o==="default","py-[0.175rem] leading-none":o==="small","py-[0.125rem] leading-none":o==="extraSmall"},{"px-[0.3rem]":!f,"inline-block px-[0.1875rem]":f,"[@media(hover:hover)]:hover:bg-super dark:[@media(hover:hover)]:hover:text-inverse [@media(hover:hover)]:hover:text-white":h},b),onClick:y==="external"?void 0:r,children:[c?l.jsx("span",{className:z("-mt-px inline-block align-middle",{"mr-xs":!f},u),children:l.jsx("img",{src:c,alt:"",className:"m-0 size-3 rounded-sm"})}):i?l.jsx(ge,{icon:i,size:"2xs",className:z("-mt-px inline-block align-middle opacity-80",{"mr-xs":!f},u)}):null,l.jsx("span",{ref:E=>{if(E&&p){const T=E.scrollWidth>E.clientWidth;E.style.maskImage=T?"linear-gradient(to right, black 70%, transparent 100%)":""}},className:z("relative -mt-px inline-block align-middle",{"max-w-[25ch] overflow-hidden":p}),children:t}),!!n&&l.jsx("span",{className:"ml-xs -mt-px mr-px inline-block align-middle",children:n})]}),S=m?l.jsx(Io,{tooltipText:m,tooltipLayout:"top",asChild:!0,children:w}):w,C=l.jsx(V,{as:"span",color:a,className:z("relative -mt-px select-none whitespace-nowrap",{"-top-px":o==="default","-top-[3px] leading-none":o==="small","-top-two leading-none":o==="extraSmall"},s),children:S});return y==="external"&&g?l.jsx(yt,{href:g,target:"_blank",rel:"noopener",className:"inline",onClick:_,children:C}):C});ca.displayName="CitationBubble";const _ee=A.memo(({citationUrl:e})=>{const t=d.useCallback(()=>{window.open(e,"_blank","noopener,noreferrer")},[e]);return l.jsx(ca,{icon:B("arrow-up-right"),iconClassName:"-ml-px",className:"animate-in fade-in duration-150",size:"extraSmall",textColor:"light",iconOnly:!0,tooltip:"Open page",onClick:t})});_ee.displayName="ExternalCitationBubble";const wee=A.memo(({message:e,task:t})=>{const n=e.url||t.start_url,r=e.url?l.jsx(_ee,{citationUrl:n}):null;return l.jsx(Oo,{children:e.thought&&l.jsxs("div",{className:"pl-xs flex gap-3",children:[l.jsx(V,{color:"light",variant:"small",className:"size-4 py-1.5",children:r}),l.jsx(V,{color:"light",variant:"small",className:"py-1.5",children:e.thought})]})})});wee.displayName="MessageItem";const Cee=A.memo(({task:e,isFinished:t,isPaused:n})=>{const r=e.agent_messages[e.agent_messages.length-1];return l.jsx(Ng,{children:l.jsxs(pi,{mode:"sync",initial:!1,children:[e.agent_messages.length>0&&e.agent_messages.map((s,o)=>l.jsx(Oo,{children:l.jsx(wee,{message:s,task:e})},o)),l.jsx(Oo,{children:l.jsx("div",{children:l.jsx(bee,{message:e.agent_messages.length>0?r:{action:"working",thought:"",url:"",answer:"",uuid:"",value:""},isFinished:t||e.clarification_status==="STOPPED_TASK",isPaused:n,isPendingClarification:e.clarification_status==="PENDING"})})})]})})});Cee.displayName="ScrollableContent";const See=A.memo(({lastMessage:e,taskUuid:t})=>e.form?l.jsx("div",{className:"px-md py-sm ml-7",children:l.jsx(vee,{form_items:e.form.form_items,taskUuid:t})}):null);See.displayName="FormContent";const IE=A.memo(({task:e,isFinished:t,index:n,isMissionControl:r})=>{const s=e.agent_messages[e.agent_messages.length-1],o=s?.form,a=e.uuid,{taskScreenshots:{[a]:[i]=[]},tasksState:{[a]:{is_paused:c=!1}={}},taskTabs:u}=Qn(),{$t:f}=J(),m=un(),{result:p}=It(),h=d.useMemo(()=>u?.some(E=>E.taskUuid===a)??!1,[u,a]),g=d.useMemo(()=>i?[{media_item:{thumbnail:i,image:i,name:f({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})},task_uuid:a,message_uuid:""}]:Pe,[f,i,a]),y=d.useMemo(()=>l.jsx(Po,{domain:e.start_url}),[e.start_url]),x=d.useMemo(()=>e.agent_messages.filter(T=>T.screenshot).map(T=>({media_item:{thumbnail:T.screenshot,image:T.screenshot,name:f({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})},task_uuid:e.uuid,message_uuid:""})),[f,e.uuid,e.agent_messages]),v=d.useMemo(()=>o?Pe:e.media&&e.media.length?e.media:x.length?x:g,[o,x,g,e.media]),b=d.useCallback(async E=>{if(!(t&&r&&!h)){if(E.stopPropagation(),t)if(r){if(!h)return}else return;await m.makeTaskVisible(a)}},[m,a,t,r,h,p?.backend_uuid]),_=r&&t,w=e.clarification_status,S=E=>{switch(E){case"UPDATED_TASK":return f({defaultMessage:"Updated per your clarification",id:"UmUpwNXXy9"});case"STOPPED_TASK":return f({defaultMessage:"Stopped per your clarification",id:"Uura7/Ftc2"});default:return""}},C=w&&w!=="PENDING"?l.jsxs(V,{variant:"tinyRegular",className:"gap-xs py-xs text-super flex",children:[l.jsx(ge,{icon:B("info-circle"),size:"xs"}),l.jsx("span",{className:"text-pretty",children:S(w)})]}):null;return l.jsx(Qf,{favicon:y,title:ng(e.start_url),accessory:h&&_?l.jsx(ge,{icon:B("arrow-up-right"),size:"xs",className:"group-hover/step-card:text-super opacity-60 group-hover/step-card:opacity-100"}):void 0,media:v,description:e.task,descriptionFooter:C,showMedia:!o,onClick:b,className:z("border transition-colors duration-150 hover:!transition-none",h&&"hover:border-super/75 group/step-card cursor-pointer"),isMissionControlSummary:_,children:_?null:o&&s&&!t?l.jsx(See,{lastMessage:s,taskUuid:e.uuid}):l.jsx(Cee,{task:e,isFinished:t,isPaused:c})},n)});IE.displayName="TaskStep";const Eee=A.memo(({step:e,isFinished:t,isMissionControl:n})=>l.jsx(OBe,{tasks:e.content.tasks,isMissionControl:n,isFinished:t})),OBe=({tasks:e,isMissionControl:t,isFinished:n})=>t&&n&&e.length>1?l.jsx("div",{className:"-mx-sm",children:l.jsx(nl,{orientation:"horizontal",viewportClassName:"px-sm",showScrollIndicator:!1,children:l.jsxs(K,{className:"gap-sm flex flex-row",children:[e.map((s,o)=>l.jsx("div",{className:"w-3/4 shrink-0",children:l.jsx(IE,{task:s,isFinished:n,index:o,isMissionControl:t})},o)),l.jsx("div",{className:"w-px shrink-0"})]})})}):l.jsx(K,{className:"gap-y-md flex flex-col",children:e.map((s,o)=>l.jsx(IE,{task:s,isFinished:n,index:o,isMissionControl:t},o))});Eee.displayName="BrowserStep";const kee=A.memo(({disabled:e,onClick:t})=>l.jsx(Ge,{disabled:e,onClick:t,icon:B("chevron-left"),variant:"common",size:"small"}));kee.displayName="CardPaginationPrevious";const Mee=A.memo(({disabled:e,onClick:t})=>l.jsx(Ge,{disabled:e,onClick:t,icon:B("chevron-right"),variant:"common",size:"small"}));Mee.displayName="CardPaginationNext";const Tee=({contact:e})=>l.jsxs("div",{className:"flex items-center gap-2",children:[e.image&&l.jsx("img",{src:e.image,alt:e.name,className:"size-4 rounded-full",referrerPolicy:"no-referrer"}),l.jsx("span",{className:"text-sm",children:e.name}),e.email&&l.jsx("span",{className:"text-quieter text-sm",children:e.email})]}),LBe=async({query:e,limit:t=10,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/contacts/list-autosuggest",n,{timeoutMs:Qe(),params:{query:{query:e,limit:t}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get contacts autosuggestions",cause:s,status:o.status??0});return r?.results??[]}catch(r){return Z.error(r),[]}},FBe=({query:e,limit:t=10,reason:n})=>mt({queryKey:be.makeEphemeralQueryKey("contacts",e,t),queryFn:()=>LBe({query:e,limit:t,reason:n}),enabled:e?.trim().length>0,staleTime:120*1e3,gcTime:600*1e3,placeholderData:r=>r});function Aee({reason:e,limit:t=10}){const[n,r]=d.useState(""),{data:s}=FBe({query:n,limit:t,reason:e}),o=d.useMemo(()=>Cf(c=>r(c),300),[]);d.useEffect(()=>()=>{o.cancel()},[o]);const a=d.useCallback(c=>{c.trim()===""?(o.cancel(),r("")):o(c)},[o]);return{suggestions:d.useMemo(()=>s?.filter(c=>c.email!==null).map(c=>({key:c.email,value:c.email,item:c})),[s]),handleDraftChange:a}}const dr=A.memo(({children:e,header:t,fullBleed:n,roundedClass:r,shadow:s,fullBleedBorderClassname:o,...a})=>l.jsxs(l.Fragment,{children:[t,l.jsxs(K,{...a,variant:a.variant??"raised",className:z("relative",{border:!n&&!a.variant,[r||"rounded-xl"]:!a.variant,"shadow-[0_1px_2px_0_rgba(0,0,0,0.03)]":s},a.className),children:[n&&l.jsx("div",{className:z("rounded-inherit pointer-events-none absolute inset-0 z-[1] border border-[black]/5 dark:border-[white]/5",o)}),e]})]}));dr.displayName="CanonicalCard";var oa;(function(e){e.GOOGLE_MEET="google_meet",e.MICROSOFT_TEAMS="microsoft_teams",e.ZOOM="zoom"})(oa||(oa={}));const Ra=[{label:"12:00am",value:"12:00am"},{label:"12:30am",value:"12:30am"},{label:"1:00am",value:"1:00am"},{label:"1:30am",value:"1:30am"},{label:"2:00am",value:"2:00am"},{label:"2:30am",value:"2:30am"},{label:"3:00am",value:"3:00am"},{label:"3:30am",value:"3:30am"},{label:"4:00am",value:"4:00am"},{label:"4:30am",value:"4:30am"},{label:"5:00am",value:"5:00am"},{label:"5:30am",value:"5:30am"},{label:"6:00am",value:"6:00am"},{label:"6:30am",value:"6:30am"},{label:"7:00am",value:"7:00am"},{label:"7:30am",value:"7:30am"},{label:"8:00am",value:"8:00am"},{label:"8:30am",value:"8:30am"},{label:"9:00am",value:"9:00am"},{label:"9:30am",value:"9:30am"},{label:"10:00am",value:"10:00am"},{label:"10:30am",value:"10:30am"},{label:"11:00am",value:"11:00am"},{label:"11:30am",value:"11:30am"},{label:"12:00pm",value:"12:00pm"},{label:"12:30pm",value:"12:30pm"},{label:"1:00pm",value:"1:00pm"},{label:"1:30pm",value:"1:30pm"},{label:"2:00pm",value:"2:00pm"},{label:"2:30pm",value:"2:30pm"},{label:"3:00pm",value:"3:00pm"},{label:"3:30pm",value:"3:30pm"},{label:"4:00pm",value:"4:00pm"},{label:"4:30pm",value:"4:30pm"},{label:"5:00pm",value:"5:00pm"},{label:"5:30pm",value:"5:30pm"},{label:"6:00pm",value:"6:00pm"},{label:"6:30pm",value:"6:30pm"},{label:"7:00pm",value:"7:00pm"},{label:"7:30pm",value:"7:30pm"},{label:"8:00pm",value:"8:00pm"},{label:"8:30pm",value:"8:30pm"},{label:"9:00pm",value:"9:00pm"},{label:"9:30pm",value:"9:30pm"},{label:"10:00pm",value:"10:00pm"},{label:"10:30pm",value:"10:30pm"},{label:"11:00pm",value:"11:00pm"},{label:"11:30pm",value:"11:30pm"},{label:"11:59pm",value:"11:59pm"}],Ybt=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Qbt={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},wi={toIndex:e=>Ra.findIndex(t=>t.value===e),toTime:e=>Ra[e]?.value??null,getNextSlot:e=>{const t=wi.toIndex(e),n=Ra.length-1;if(t===-1||t>=n)return null;const r=n-t,s=Math.min(2,r),o=t+s;return{start:Ra[t]?.value??"",end:Ra[o]?.value??""}},canAddSlot:e=>e.length===0||wi.toIndex(e[e.length-1]?.end??"")0,getDefaultSlot:()=>({start:"9:00am",end:"5:00pm"}),getPreviousSlot:(e,t)=>{if(wi.toIndex(e)<=0)return null;const r=wi.toIndex("9:00am"),s=wi.toIndex("5:00pm");for(let a=r;a{const p=wi.toIndex(m.start??""),h=wi.toIndex(m.end);return!(i<=p||a>=h)}))return{start:c,end:u}}const o=wi.toIndex(t[0]?.start??"");if(o>0){const a=Math.min(2,o),i=o-a;return{start:Ra[i]?.value??"",end:Ra[o]?.value??""}}return null}},Xbt={monday:[{start:"9:00am",end:"5:00pm"}],tuesday:[{start:"9:00am",end:"5:00pm"}],wednesday:[{start:"9:00am",end:"5:00pm"}],thursday:[{start:"9:00am",end:"5:00pm"}],friday:[{start:"9:00am",end:"5:00pm"}],saturday:[],sunday:[]},BBe=e=>{if(!e)return!1;const t=e.indexOf("@"),n=e.lastIndexOf(".");return e.includes("@")&&e.includes(".")&&t0},Zbt=e=>[...e].sort((t,n)=>{const r=new Date(t.start_date_time||"").getTime(),s=new Date(n.start_date_time||"").getTime();return r-s}),Jbt=e=>{if(e.length<=1)return!1;const t=new Date(e[0]?.start_date_time||""),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return e.some(r=>{const s=new Date(r.start_date_time||"");return new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime()!==n})},UBe={"#AC725E":"#79554B","#D06B64":"#E67399","#F83A22":"#D50000","#FA573C":"#F4511E","#FF7537":"#EF6C00","#FFAD46":"#F09300","#42D692":"#009688","#16A765":"#0B8043","#7BD148":"#7CB342","#B3DC6C":"#C0CA33","#FBE983":"#E4C441","#FAD165":"#F6BF26","#92E1C0":"#039BE5","#9FE1E7":"#4285F4","#9FC6E7":"#3F51B5","#4986E7":"#7986CB","#9A9CFF":"#B39DDB","#C2C2C2":"#616161","#CABDBF":"#A79B8E","#CCA6AC":"#AD1457","#F691B2":"#D81B60","#CD74E6":"#8E24AA","#A47AE2":"#7B1FA2"},VBe="#039BE5",Nee=e=>UBe[e.toUpperCase()]??VBe,Ree=e=>{const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16),o=m=>{const p=m/255;return p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4)},a=o(n),i=o(r),c=o(s),u=.2126*a+.7152*i+.0722*c,f=(Math.max(u,1)+.05)/(Math.min(u,1)+.05);return f>=7?"AAA":f>=4.5?"AA":f>=3?"A":"Fail"},HBe=e=>typeof e=="string"?{email:e,response_status:void 0,photo_url:void 0,display_name:void 0}:{email:e.email,response_status:e.response_status,photo_url:e.photo_url,display_name:e.display_name},jI=e=>e?e.map(HBe):[],zBe=e=>{if(!e||e.trim()==="")return"";const t=e.trim().split(/\s+/);return NU(t)?t[0].charAt(0).toUpperCase():((t[0]?.charAt(0)??"")+(t[t.length-1]?.charAt(0)??"")).toUpperCase()},k6=(e,t)=>t.formatDate(e,{timeZoneName:"short"}).split(", ").pop()||"",WBe=()=>Intl.DateTimeFormat().resolvedOptions().timeZone.split("/").pop()?.replace(/_/g," ")||"",GBe=(e,t)=>t.formatDate(e,{timeZoneName:"shortOffset"}).split(", ").pop()||"",$Be=()=>{const{formatDate:e}=J(),t=d.useCallback((s,o=!0)=>e(s,{month:"long",day:"numeric",...o&&{year:"numeric"}}),[e]),n=d.useCallback(s=>e(s,{weekday:"long",month:"long",day:"numeric"}),[e]),r=d.useCallback(s=>e(s,{weekday:"short",month:"long",day:"numeric"}),[e]);return d.useMemo(()=>({formatEventDate:t,formatEventDay:n,formatEventDayShort:r}),[t,n,r])},Ip=A.memo(({startDate:e,endDate:t,isAllDay:n,showDate:r=!1,includeYear:s=!0})=>{const{$t:o}=J();if(n){const a=o({defaultMessage:"All day",id:"Vob6h4Xsl3"});return r?l.jsxs(l.Fragment,{children:[l.jsx(h_,{from:e,to:e,...s&&{year:"numeric"},month:"long",day:"numeric"}),", ",a]}):l.jsx(l.Fragment,{children:a})}return r?l.jsx(h_,{from:e,to:t,...s&&{year:"numeric"},month:"long",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}):l.jsx(h_,{from:e,to:t,hour:"numeric",minute:"2-digit",timeZoneName:"short"})});Ip.displayName="EventTimeRange";function qBe(e){const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function KBe(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function YBe(e){const t=new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Dee(e){const t=new Date;return t.setDate(t.getDate()+1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function jee(e,t,n={numeric:"auto",style:"long"},r=1e3*60*60*24){if(!t)return"";const s=new Date(t);if(isNaN(s.getTime()))return"";const o=s.getTime()-Date.now(),a=Math.abs(o);return a<=1e3?"":a<1e3*60?e.formatRelativeTime(Math.round(o/1e3),"second",n):a<1e3*60*60?e.formatRelativeTime(Math.round(o/(1e3*60)),"minute",n):a=1e3*60*60*24?e.formatRelativeTime(Math.round(o/(1e3*60*60*24)),"day",n):e.formatDate(s,{month:"short",day:"numeric",year:"numeric"})}function e_t(e,t){try{const n=+t,r={hours:Math.floor(n/3600),minutes:Math.floor(n%3600/60),seconds:Math.floor(n%60)},s={hours:"h",minutes:"m",seconds:"s"};if("DurationFormat"in Intl)return new Intl.DurationFormat(e,{style:"narrow",valueStyle:"narrow"}).format(r);let o="";for(const[a,i]of Object.entries(r))i>0&&(o+=`${i}${s[a]} `);return o.trim()}catch{return""}}const Vl=A.memo(({oldText:e,newText:t,isDeletion:n=!1})=>!e&&!t?null:n&&(e||t)?l.jsx(V,{as:"span",color:"ultraLight",className:"line-through",children:e||t}):!e&&t?l.jsx(V,{as:"span",color:"default",className:"bg-[#facc15]/25",children:t}):!t&&e?e:e&&t&&e===t?l.jsx(V,{as:"span",color:"default",children:e}):e&&t&&e!==t?l.jsxs(l.Fragment,{children:[l.jsx(V,{as:"span",color:"ultraLight",className:"line-through",children:e})," ",l.jsx(V,{as:"span",color:"default",className:"bg-[#facc15]/25",children:t})]}):null);Vl.displayName="DiffedText";const Xs=A.memo(({children:e,icon:t,alignCenter:n=!1,iconSize:r="sm"})=>l.jsxs("div",{className:z("flex flex-row items-start gap-3",{"items-center":n}),children:[l.jsx(ge,{icon:t,size:r,className:"mt-px shrink-0"}),l.jsx("div",{className:"min-w-0 flex-1",children:e})]}));Xs.displayName="EventAttribute";const Iee=A.memo(({attendee:e,showRsvp:t=!1})=>l.jsxs("div",{className:"relative w-5",children:[e.photo_url?l.jsx(dr,{fullBleed:!0,className:"absolute inset-0 mt-px size-5 overflow-hidden !rounded-full",children:l.jsx("img",{src:e.photo_url,className:"size-full object-cover",alt:e.display_name||e.email||""})}):l.jsx(K,{variant:"subtle",className:"absolute inset-0 mt-px flex size-5 items-center justify-center rounded-full",children:l.jsx(V,{variant:"tinyMono",color:"light",className:"translate-y-half",children:zBe(e.display_name||e.email||"")})}),t&&(e.response_status==="accepted"||e.response_status==="declined")&&l.jsx(K,{variant:"background",className:"p-two absolute bottom-[-4px] right-[-4px] z-10 rounded-full",children:l.jsx(V,{color:e.response_status==="accepted"?"super":e.response_status==="declined"?"red":"light",className:z("bg-base border-subtlest flex size-3 items-center justify-center rounded-full border",{"!bg-super/20 !border-super/10 border":e.response_status==="accepted","!bg-negative/20 !border-negative/10":e.response_status==="declined"}),children:l.jsx(ge,{icon:e.response_status==="accepted"?B("check"):e.response_status==="declined"?B("x"):B("question-mark"),size:"2xs",stroke:2.125})})})]}));Iee.displayName="AttendeeAvatar";const Pee=A.memo(({attendees:e,newAttendees:t,truncateAttendees:n,showRsvp:r=!1,isDeletion:s=!1})=>{const[o,a]=d.useState(!1),c=jI(e).filter(g=>!g.email?.includes("@resource.calendar.google"));let u;t&&(u=jI(t).filter(y=>!y.email?.includes("@resource.calendar.google")));const f=(g,y)=>{const x=g?.map(v=>{let b;return y?b=y?.find(_=>_.email===v.email)??{email:" ",response_status:void 0,photo_url:void 0,display_name:" "}:b=v,{oldValue:v,newValue:b}})??[];return y&&(g?y.filter(b=>!g.some(_=>_.email===b.email)):y).forEach(b=>{x.push({oldValue:void 0,newValue:b})}),x},m=u||c,p=f(c,u),h=d.useCallback(()=>a(!o),[o]);return l.jsxs("div",{className:"min-w-0",children:[(()=>{const g=m?.length??0;return l.jsx(V,{variant:"small",color:g>0?"default":"light",className:s?"line-through":"",children:g>0?`${g} ${g===1?"Guest":"Guests"}`:"No Guests"})})(),p&&p.length>0&&l.jsxs("div",{className:"gap-sm my-sm flex flex-col",children:[p.slice(0,n&&!o?n:void 0).map(g=>l.jsxs("div",{className:"gap-sm flex flex-row",children:[l.jsx(Iee,{attendee:g.newValue,showRsvp:r}),l.jsx(V,{variant:"small",color:"default",className:"line-clamp-1 text-ellipsis break-all",children:l.jsx(Vl,{oldText:g.oldValue?.display_name||g.oldValue?.email,newText:g.newValue?.display_name||g.newValue?.email,isDeletion:s})})]},g.oldValue?.email??g.newValue?.email)),n&&p.length>n&&l.jsx(V,{as:"button",variant:"small",color:"default",className:"w-fit text-left hover:underline",onClick:h,children:o?"Show less":"Show all"})]})]})});Pee.displayName="AttendeeList";const Oee=A.memo(({videoEntryPoint:e,isDeletion:t})=>{const{$t:n}=J(),r=d.useCallback(()=>window.open(e?.uri,"_blank","noopener,noreferrer"),[e?.uri]);return!e||t?null:l.jsx(Xs,{icon:B("video"),alignCenter:!0,children:l.jsx(Ge,{variant:"primary",pill:!0,text:n({defaultMessage:"Join Meeting",id:"HK25u5mIfw"}),onClick:r,size:"small"})})});Oee.displayName="EventVideoEntry";const Lee=A.memo(({location:e,newLocation:t,isDeletion:n=!1})=>e?l.jsx(Xs,{icon:B("map-pin"),children:l.jsx(V,{variant:"small",color:"light",className:"line-clamp-1",children:l.jsx(Vl,{oldText:e,newText:t,isDeletion:n})})}):null);Lee.displayName="EventLocation";const Fee=A.memo(({description:e,newDescription:t,isDeletion:n=!1})=>{const[r,s]=d.useState(!1),o=d.useCallback(()=>s(!r),[r]);return e?l.jsx(Xs,{icon:B("align-left"),children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx(V,{variant:"small",className:z("break-words",{"line-clamp-2":!r}),children:l.jsx(Vl,{oldText:e,newText:t,isDeletion:n})}),e.length>150&&l.jsx(V,{as:"button",variant:"small",color:"default",className:"mt-1 w-fit text-left hover:underline",onClick:o,children:r?"Show less":"Show more"})]})}):null});Fee.displayName="EventDescription";const Bee=A.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i=!1})=>{const c=J(),u=s&&n?n:e,f=s&&r?r:t,m=s?s.is_all_day||!1:o;return l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(Vl,{oldText:a(e),newText:s&&n?a(n):void 0,isDeletion:i})}),l.jsx(V,{variant:"small",color:"light",children:l.jsxs("span",{className:i?"line-through":"",children:[l.jsx(Ip,{startDate:u,endDate:f,isAllDay:m}),!m&&` (${k6(u,c)})`]})})]})});Bee.displayName="SingleDayDisplay";const Uee=A.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,formatEventDayShort:o,isDeletion:a=!1})=>{const i=J(),c=s&&r?r:t,u=s&&s.is_all_day||!1;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(Vl,{oldText:o(e),newText:s&&n?o(n):void 0,isDeletion:a})}),l.jsx(V,{variant:"small",color:"light",children:l.jsx("span",{className:a?"line-through":"",children:!s?.is_all_day&&l.jsx(x7,{value:s&&n?n:e,hour:"numeric",minute:"2-digit"})})})]}),l.jsx(V,{color:"light",className:"pt-two flex justify-center",children:l.jsx(ge,{icon:B("arrow-right"),size:"sm"})}),l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(Vl,{oldText:o(t),newText:s&&r?o(r):void 0,isDeletion:a})}),l.jsx(V,{variant:"small",color:"light",children:l.jsx("span",{className:a?"line-through":"",children:!u&&l.jsxs(l.Fragment,{children:[l.jsx(x7,{value:c,hour:"numeric",minute:"2-digit"}),` (${k6(c,i)})`]})})})]})]})});Uee.displayName="MultiDayDisplay";const Vee=A.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i=!1})=>{const c=KBe(e,t);return l.jsx(Xs,{icon:B("clock"),children:l.jsxs("div",{className:"gap-sm flex",children:[c&&l.jsx(Bee,{startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i}),!c&&l.jsx(Uee,{startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,formatEventDayShort:a,isDeletion:i})]})})});Vee.displayName="EventDateDisplay";const QBe=A.memo(({startDate:e,newStartDate:t})=>{const n=J();if(!e)return null;const r=t||e,s=GBe(r,n),o=WBe(),a=k6(r,n);return l.jsx(Xs,{icon:B("world"),alignCenter:!0,children:l.jsxs("div",{children:[l.jsxs(V,{as:"span",variant:"small",color:"light",children:[s," "]}),l.jsx(V,{as:"span",variant:"small",children:o}),l.jsxs(V,{as:"span",variant:"small",color:"light",children:[" ","(",a,")"]})]})})});QBe.displayName="EventTimezone";const Hee=A.memo(({event:e,newEvent:t,className:n,truncateAttendees:r,showRsvp:s=!1,action:o})=>{const{start_date_time:a,end_date_time:i,attendees:c,description:u,location:f,conference_data:m,is_all_day:p}=e,h=o==="DELETE",{formatEventDayShort:g}=$Be(),y=d.useMemo(()=>new Date(a||""),[a]),x=d.useMemo(()=>new Date(i||""),[i]),v=d.useMemo(()=>{if(t&&t.start_date_time)return new Date(t.start_date_time||"")},[t]),b=d.useMemo(()=>{if(t&&t.end_date_time)return new Date(t.end_date_time||"")},[t]),_=m?.entry_points?.find(w=>w.entry_point_type==="video");return l.jsxs("div",{className:z("gap-md flex h-full flex-col",n),children:[l.jsx(Vee,{startDate:y,endDate:x,newStartDateObj:v,newEndDateObj:b,newEvent:t,is_all_day:p??!1,formatEventDayShort:g,isDeletion:h}),l.jsx(Oee,{videoEntryPoint:_,isDeletion:h}),l.jsx(Lee,{location:f,newLocation:t?.location,isDeletion:h}),l.jsx(Fee,{description:u,newDescription:t?.description,isDeletion:h}),l.jsx(Xs,{icon:B("user"),children:l.jsx(Pee,{attendees:c,newAttendees:t?.attendees,truncateAttendees:r,showRsvp:s,isDeletion:h})})]})});Hee.displayName="EventDetails";function bw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Rm(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function Dm(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?ZBe(i,m=>m.test(a)):XBe(i,m=>m.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=t.slice(a.length);return{value:u,rest:f}}}function XBe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ZBe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const M6=6048e5,eUe=864e5,II=Symbol.for("constructDateFrom");function Vr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&II in e?e[II](t):e instanceof Date?new e.constructor(t):new Date(t)}function Xf(e,...t){const n=Vr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}let tUe={};function Rg(){return tUe}function vn(e,t){return Vr(t||e,e)}function ri(e,t){const n=Rg(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=vn(e,t?.in),o=s.getDay(),a=(o{let r;const s=nUe[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},sUe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oUe=(e,t,n,r)=>sUe[e],aUe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},iUe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lUe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},cUe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},uUe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},dUe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fUe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},mUe={ordinalNumber:fUe,era:Rm({values:aUe,defaultWidth:"wide"}),quarter:Rm({values:iUe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Rm({values:lUe,defaultWidth:"wide"}),day:Rm({values:cUe,defaultWidth:"wide"}),dayPeriod:Rm({values:uUe,defaultWidth:"wide",formattingValues:dUe,defaultFormattingWidth:"wide"})},pUe=/^(\d+)(th|st|nd|rd)?/i,hUe=/\d+/i,gUe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},yUe={any:[/^b/i,/^(a|c)/i]},xUe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vUe={any:[/1/i,/2/i,/3/i,/4/i]},bUe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_Ue={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wUe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},CUe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},SUe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},EUe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kUe={ordinalNumber:JBe({matchPattern:pUe,parsePattern:hUe,valueCallback:e=>parseInt(e,10)}),era:Dm({matchPatterns:gUe,defaultMatchWidth:"wide",parsePatterns:yUe,defaultParseWidth:"any"}),quarter:Dm({matchPatterns:xUe,defaultMatchWidth:"wide",parsePatterns:vUe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Dm({matchPatterns:bUe,defaultMatchWidth:"wide",parsePatterns:_Ue,defaultParseWidth:"any"}),day:Dm({matchPatterns:wUe,defaultMatchWidth:"wide",parsePatterns:CUe,defaultParseWidth:"any"}),dayPeriod:Dm({matchPatterns:SUe,defaultMatchWidth:"any",parsePatterns:EUe,defaultParseWidth:"any"})},MUe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},TUe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},AUe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NUe={date:bw({formats:MUe,defaultWidth:"full"}),time:bw({formats:TUe,defaultWidth:"full"}),dateTime:bw({formats:AUe,defaultWidth:"full"})},zee={code:"en-US",formatDistance:rUe,formatLong:NUe,formatRelative:oUe,localize:mUe,match:kUe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function So(e,t,n){const r=vn(e,n?.in);return isNaN(t)?Vr(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function si(e,t,n){const r=vn(e,n?.in);if(isNaN(t))return Vr(n?.in||e,NaN);if(!t)return r;const s=r.getDate(),o=Vr(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),s),r)}function Zc(e,t){return ri(e,{...t,weekStartsOn:1})}function Wee(e,t){const n=vn(e,t?.in),r=n.getFullYear(),s=Vr(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const o=Zc(s),a=Vr(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=Zc(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function k2(e){const t=vn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ef(e,t){const n=vn(e,t?.in);return n.setHours(0,0,0,0),n}function Va(e,t,n){const[r,s]=Xf(n?.in,e,t),o=ef(r),a=ef(s),i=+o-k2(o),c=+a-k2(a);return Math.round((i-c)/eUe)}function RUe(e,t){const n=Wee(e,t),r=Vr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Zc(r)}function PE(e,t,n){return So(e,t*7,n)}function DUe(e,t,n){return si(e,t*12,n)}function jUe(e,t){let n,r=t?.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const o=vn(s,r);(!n||n{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const o=vn(s,r);(!n||n>o||isNaN(+o))&&(n=o)}),Vr(r,n||NaN)}function Ps(e,t,n){const[r,s]=Xf(n?.in,e,t);return+ef(r)==+ef(s)}function T6(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function PUe(e){return!(!T6(e)&&typeof e!="number"||isNaN(+vn(e)))}function Eh(e,t,n){const[r,s]=Xf(n?.in,e,t),o=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return o*12+a}function OUe(e,t,n){const[r,s]=Xf(n?.in,e,t),o=ri(r,n),a=ri(s,n),i=+o-k2(o),c=+a-k2(a);return Math.round((i-c)/M6)}function A6(e,t){const n=vn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Bs(e,t){const n=vn(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Gee(e,t){const n=vn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function N6(e,t){const n=Rg(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=vn(e,t?.in),o=s.getDay(),a=(o=+i?r+1:+n>=+u?r:r-1}function FUe(e,t){const n=Rg(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Kee(e,t),o=Vr(t?.in||e,0);return o.setFullYear(s,0,r),o.setHours(0,0,0,0),ri(o,t)}function Yee(e,t){const n=vn(e,t?.in),r=+ri(n,t)-+FUe(n,t);return Math.round(r/M6)+1}function gn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const il={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return gn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):gn(n+1,2)},d(e,t){return gn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return gn(e.getHours()%12||12,t.length)},H(e,t){return gn(e.getHours(),t.length)},m(e,t){return gn(e.getMinutes(),t.length)},s(e,t){return gn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return gn(s,t.length)}},Fu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},PI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return il.y(e,t)},Y:function(e,t,n,r){const s=Kee(e,r),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return gn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):gn(o,t.length)},R:function(e,t){const n=Wee(e);return gn(n,t.length)},u:function(e,t){const n=e.getFullYear();return gn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return gn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return gn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return il.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return gn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=Yee(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):gn(s,t.length)},I:function(e,t,n){const r=qee(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):gn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):il.d(e,t)},D:function(e,t,n){const r=LUe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):gn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return gn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return gn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return gn(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Fu.noon:r===0?s=Fu.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Fu.evening:r>=12?s=Fu.afternoon:r>=4?s=Fu.morning:s=Fu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return il.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):il.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):gn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):gn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):il.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):il.s(e,t)},S:function(e,t){return il.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return LI(r);case"XXXX":case"XX":return vc(r);case"XXXXX":case"XXX":default:return vc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return LI(r);case"xxxx":case"xx":return vc(r);case"xxxxx":case"xxx":default:return vc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+OI(r,":");case"OOOO":default:return"GMT"+vc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+OI(r,":");case"zzzz":default:return"GMT"+vc(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return gn(r,t.length)},T:function(e,t,n){return gn(+e,t.length)}};function OI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),o=r%60;return o===0?n+String(s):n+String(s)+t+gn(o,2)}function LI(e,t){return e%60===0?(e>0?"-":"+")+gn(Math.abs(e)/60,2):vc(e,t)}function vc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=gn(Math.trunc(r/60),2),o=gn(r%60,2);return n+s+t+o}const FI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Qee=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},BUe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return FI(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",FI(r,t)).replace("{{time}}",Qee(s,t))},UUe={p:Qee,P:BUe},VUe=/^D+$/,HUe=/^Y+$/,zUe=["D","DD","YY","YYYY"];function WUe(e){return VUe.test(e)}function GUe(e){return HUe.test(e)}function $Ue(e,t,n){const r=qUe(e,t,n);if(console.warn(r),zUe.includes(e))throw new RangeError(r)}function qUe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const KUe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YUe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,QUe=/^'([^]*?)'?$/,XUe=/''/g,ZUe=/[a-zA-Z]/;function gu(e,t,n){const r=Rg(),s=n?.locale??r.locale??zee,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=vn(e,n?.in);if(!PUe(i))throw new RangeError("Invalid time value");let c=t.match(YUe).map(f=>{const m=f[0];if(m==="p"||m==="P"){const p=UUe[m];return p(f,s.formatLong)}return f}).join("").match(KUe).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:JUe(f)};if(PI[m])return{isToken:!0,value:f};if(m.match(ZUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const u={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&GUe(m)||!n?.useAdditionalDayOfYearTokens&&WUe(m))&&$Ue(m,t,String(e));const p=PI[m[0]];return p(i,m,s.localize,u)}).join("")}function JUe(e){const t=e.match(QUe);return t?t[1].replace(XUe,"'"):e}function eVe(e,t){const n=vn(e,t?.in),r=n.getFullYear(),s=n.getMonth(),o=Vr(n,0);return o.setFullYear(r,s+1,0),o.setHours(0,0,0,0),o.getDate()}function tVe(e){return Math.trunc(+vn(e)/1e3)}function nVe(e,t){const n=vn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),vn(n,t?.in)}function rVe(e,t){const n=vn(e,t?.in);return OUe(nVe(n,t),Bs(n,t),t)+1}function Xee(e,t){return+vn(e)>+vn(t)}function Zee(e,t){return+vn(e)<+vn(t)}function R6(e,t,n){const[r,s]=Xf(n?.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function sVe(e,t,n){const[r,s]=Xf(n?.in,e,t);return r.getFullYear()===s.getFullYear()}function BI(e,t,n){return So(e,-t,n)}function _w(e,t,n){const r=vn(e,n?.in),s=r.getFullYear(),o=r.getDate(),a=Vr(e,0);a.setFullYear(s,t,15),a.setHours(0,0,0,0);const i=eVe(a);return r.setMonth(t,Math.min(o,i)),r}function UI(e,t,n){const r=vn(e,n?.in);return isNaN(+r)?Vr(e,NaN):(r.setFullYear(t),r)}var _t=function(){return _t=Object.assign||function(t){for(var n,r=1,s=arguments.length;r1&&(c||!u),m=t>1&&(u||!c),p=function(){r&&o(r)},h=function(){s&&o(s)};return A.createElement(LVe,{displayMonth:e.displayMonth,hideNext:f,hidePrevious:m,nextMonth:s,previousMonth:r,onPreviousClick:p,onNextClick:h})}function FVe(e){var t,n=Hn(),r=n.classNames,s=n.disableNavigation,o=n.styles,a=n.captionLayout,i=n.components,c=(t=i?.CaptionLabel)!==null&&t!==void 0?t:tte,u;return s?u=A.createElement(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?u=A.createElement(VI,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?u=A.createElement(A.Fragment,null,A.createElement(VI,{displayMonth:e.displayMonth,id:e.id}),A.createElement(HI,{displayMonth:e.displayMonth,id:e.id})):u=A.createElement(A.Fragment,null,A.createElement(c,{id:e.id,displayMonth:e.displayMonth}),A.createElement(HI,{displayMonth:e.displayMonth,id:e.id})),A.createElement("div",{className:r.caption,style:o.caption},u)}function BVe(e){var t=Hn(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?A.createElement("tfoot",{className:s,style:r.tfoot},A.createElement("tr",null,A.createElement("td",{colSpan:8},n))):A.createElement(A.Fragment,null)}function UVe(e,t,n){for(var r=n?Zc(new Date):ri(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=So(r,o);s.push(a)}return s}function VVe(){var e=Hn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=UVe(s,o,a);return A.createElement("tr",{style:n.head_row,className:t.head_row},r&&A.createElement("td",{style:n.head_cell,className:t.head_cell}),u.map(function(f,m){return A.createElement("th",{key:m,scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s})},i(f,{locale:s}))}))}function HVe(){var e,t=Hn(),n=t.classNames,r=t.styles,s=t.components,o=(e=s?.HeadRow)!==null&&e!==void 0?e:VVe;return A.createElement("thead",{style:r.head,className:n.head},A.createElement(o,null))}function zVe(e){var t=Hn(),n=t.locale,r=t.formatters.formatDay;return A.createElement(A.Fragment,null,r(e.date,{locale:n}))}var D6=d.createContext(void 0);function WVe(e){if(!Dg(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return A.createElement(D6.Provider,{value:t},e.children)}return A.createElement(GVe,{initialProps:e.initialProps,children:e.children})}function GVe(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,o=t.max,a=function(u,f,m){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,u,f,m);var g=!!(f.selected&&s&&r?.length===s);if(!g){var y=!!(!f.selected&&o&&r?.length===o);if(!y){var x=r?Jee([],r):[];if(f.selected){var v=x.findIndex(function(b){return Ps(u,b)});x.splice(v,1)}else x.push(u);(h=t.onSelect)===null||h===void 0||h.call(t,x,u,f,m)}}},i={disabled:[]};r&&i.disabled.push(function(u){var f=o&&r.length>o-1,m=r.some(function(p){return Ps(p,u)});return!!(f&&!m)});var c={selected:r,onDayClick:a,modifiers:i};return A.createElement(D6.Provider,{value:c},n)}function j6(){var e=d.useContext(D6);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function $Ve(e,t){var n=t||{},r=n.from,s=n.to;if(!r)return{from:e,to:void 0};if(!s&&Ps(r,e))return{from:r,to:e};if(!s&&Zee(e,r))return{from:e,to:r};if(!s)return{from:r,to:e};if(!(Ps(s,e)&&Ps(r,e))){if(Ps(s,e))return{from:s,to:void 0};if(!Ps(r,e))return Xee(r,e)?{from:e,to:s}:{from:r,to:e}}}var I6=d.createContext(void 0);function qVe(e){if(!jg(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return A.createElement(I6.Provider,{value:t},e.children)}return A.createElement(KVe,{initialProps:e.initialProps,children:e.children})}function KVe(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},o=s.from,a=s.to,i=t.min,c=t.max,u=function(h,g,y){var x,v;(x=t.onDayClick)===null||x===void 0||x.call(t,h,g,y);var b=$Ve(h,r);(v=t.onSelect)===null||v===void 0||v.call(t,b,h,g,y)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o&&(f.range_start=[o],a?(f.range_end=[a],Ps(o,a)||(f.range_middle=[{after:o,before:a}])):f.range_end=[o]),i&&(o&&!a&&f.disabled.push({after:BI(o,i-1),before:So(o,i-1)}),o&&a&&f.disabled.push({after:o,before:So(o,i-1)})),c&&(o&&!a&&(f.disabled.push({before:So(o,-c+1)}),f.disabled.push({after:So(o,c-1)})),o&&a)){var m=Va(a,o)+1,p=c-m;f.disabled.push({before:BI(o,p)}),f.disabled.push({after:So(a,p)})}return A.createElement(I6.Provider,{value:{selected:r,onDayClick:u,modifiers:f}},n)}function P6(){var e=d.useContext(I6);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function yy(e){return Array.isArray(e)?Jee([],e):e!==void 0?[e]:[]}function YVe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=yy(s)}),t}var va;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(va||(va={}));var QVe=va.Selected,Ci=va.Disabled,XVe=va.Hidden,ZVe=va.Today,ww=va.RangeEnd,Cw=va.RangeMiddle,Sw=va.RangeStart,JVe=va.Outside;function eHe(e,t,n){var r,s=(r={},r[QVe]=yy(e.selected),r[Ci]=yy(e.disabled),r[XVe]=yy(e.hidden),r[ZVe]=[e.today],r[ww]=[],r[Cw]=[],r[Sw]=[],r[JVe]=[],r);return e.fromDate&&s[Ci].push({before:e.fromDate}),e.toDate&&s[Ci].push({after:e.toDate}),Dg(e)?s[Ci]=s[Ci].concat(t.modifiers[Ci]):jg(e)&&(s[Ci]=s[Ci].concat(n.modifiers[Ci]),s[Sw]=n.modifiers[Sw],s[Cw]=n.modifiers[Cw],s[ww]=n.modifiers[ww]),s}var ste=d.createContext(void 0);function tHe(e){var t=Hn(),n=j6(),r=P6(),s=eHe(t,n,r),o=YVe(t.modifiers),a=_t(_t({},s),o);return A.createElement(ste.Provider,{value:a},e.children)}function ote(){var e=d.useContext(ste);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function nHe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function rHe(e){return!!(e&&typeof e=="object"&&"from"in e)}function sHe(e){return!!(e&&typeof e=="object"&&"after"in e)}function oHe(e){return!!(e&&typeof e=="object"&&"before"in e)}function aHe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function iHe(e,t){var n,r=t.from,s=t.to;if(!r)return!1;if(!s&&Ps(r,e))return!0;if(!s)return!1;var o=Va(s,r)<0;o&&(n=[s,r],r=n[0],s=n[1]);var a=Va(e,r)>=0&&Va(s,e)>=0;return a}function lHe(e){return T6(e)}function cHe(e){return Array.isArray(e)&&e.every(T6)}function uHe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(lHe(n))return Ps(e,n);if(cHe(n))return n.includes(e);if(rHe(n))return iHe(e,n);if(aHe(n))return n.dayOfWeek.includes(e.getDay());if(nHe(n)){var r=Va(n.before,e),s=Va(n.after,e),o=r>0,a=s<0,i=Xee(n.before,n.after);return i?a&&o:o||a}return sHe(n)?Va(e,n.after)>0:oHe(n)?Va(n.before,e)>0:typeof n=="function"?n(e):!1})}function O6(e,t,n){var r=Object.keys(t).reduce(function(o,a){var i=t[a];return uHe(e,i)&&o.push(a),o},[]),s={};return r.forEach(function(o){return s[o]=!0}),n&&!R6(e,n)&&(s.outside=!0),s}function dHe(e,t){for(var n=Bs(e[0]),r=A6(e[e.length-1]),s,o,a=n;a<=r;){var i=O6(a,t),c=!i.disabled&&!i.hidden;if(!c){a=So(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=So(a,1)}return o||s}var fHe=365;function ate(e,t){var n=t.moveBy,r=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,m=s.locale,p={day:So,week:PE,month:si,year:DUe,startOfWeek:function(x){return s.ISOWeek?Zc(x):ri(x,{locale:m,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?$ee(x):N6(x,{locale:m,weekStartsOn:c})}},h=p[n](e,r==="after"?1:-1);r==="before"&&u?h=jUe([u,h]):r==="after"&&f&&(h=IUe([f,h]));var g=!0;if(o){var y=O6(h,o);g=!y.disabled&&!y.hidden}return g?h:i.count>fHe?i.lastFocused:ate(h,{moveBy:n,direction:r,context:s,modifiers:o,retry:_t(_t({},i),{count:i.count+1})})}var ite=d.createContext(void 0);function mHe(e){var t=Ig(),n=ote(),r=d.useState(),s=r[0],o=r[1],a=d.useState(),i=a[0],c=a[1],u=dHe(t.displayMonths,n),f=s??(i&&t.isDateDisplayed(i))?i:u,m=function(){c(s),o(void 0)},p=function(x){o(x)},h=Hn(),g=function(x,v){if(s){var b=ate(s,{moveBy:x,direction:v,context:h,modifiers:n});Ps(s,b)||(t.goToDate(b,s),p(b))}},y={focusedDay:s,focusTarget:f,blur:m,focus:p,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return A.createElement(ite.Provider,{value:y},e.children)}function L6(){var e=d.useContext(ite);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function pHe(e,t){var n=ote(),r=O6(e,n,t);return r}var F6=d.createContext(void 0);function hHe(e){if(!Kv(e.initialProps)){var t={selected:void 0};return A.createElement(F6.Provider,{value:t},e.children)}return A.createElement(gHe,{initialProps:e.initialProps,children:e.children})}function gHe(e){var t=e.initialProps,n=e.children,r=function(o,a,i){var c,u,f;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,o,a,i);return}(f=t.onSelect)===null||f===void 0||f.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:r};return A.createElement(F6.Provider,{value:s},n)}function lte(){var e=d.useContext(F6);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function yHe(e,t){var n=Hn(),r=lte(),s=j6(),o=P6(),a=L6(),i=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,m=a.blur,p=a.focus,h=a.focusMonthBefore,g=a.focusMonthAfter,y=a.focusYearBefore,x=a.focusYearAfter,v=a.focusStartOfWeek,b=a.focusEndOfWeek,_=function(P){var L,U,O,$;Kv(n)?(L=r.onDayClick)===null||L===void 0||L.call(r,e,t,P):Dg(n)?(U=s.onDayClick)===null||U===void 0||U.call(s,e,t,P):jg(n)?(O=o.onDayClick)===null||O===void 0||O.call(o,e,t,P):($=n.onDayClick)===null||$===void 0||$.call(n,e,t,P)},w=function(P){var L;p(e),(L=n.onDayFocus)===null||L===void 0||L.call(n,e,t,P)},S=function(P){var L;m(),(L=n.onDayBlur)===null||L===void 0||L.call(n,e,t,P)},C=function(P){var L;(L=n.onDayMouseEnter)===null||L===void 0||L.call(n,e,t,P)},E=function(P){var L;(L=n.onDayMouseLeave)===null||L===void 0||L.call(n,e,t,P)},T=function(P){var L;(L=n.onDayPointerEnter)===null||L===void 0||L.call(n,e,t,P)},k=function(P){var L;(L=n.onDayPointerLeave)===null||L===void 0||L.call(n,e,t,P)},I=function(P){var L;(L=n.onDayTouchCancel)===null||L===void 0||L.call(n,e,t,P)},M=function(P){var L;(L=n.onDayTouchEnd)===null||L===void 0||L.call(n,e,t,P)},N=function(P){var L;(L=n.onDayTouchMove)===null||L===void 0||L.call(n,e,t,P)},D=function(P){var L;(L=n.onDayTouchStart)===null||L===void 0||L.call(n,e,t,P)},j=function(P){var L;(L=n.onDayKeyUp)===null||L===void 0||L.call(n,e,t,P)},F=function(P){var L;switch(P.key){case"ArrowLeft":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?i():c();break;case"ArrowRight":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?c():i();break;case"ArrowDown":P.preventDefault(),P.stopPropagation(),u();break;case"ArrowUp":P.preventDefault(),P.stopPropagation(),f();break;case"PageUp":P.preventDefault(),P.stopPropagation(),P.shiftKey?y():h();break;case"PageDown":P.preventDefault(),P.stopPropagation(),P.shiftKey?x():g();break;case"Home":P.preventDefault(),P.stopPropagation(),v();break;case"End":P.preventDefault(),P.stopPropagation(),b();break}(L=n.onDayKeyDown)===null||L===void 0||L.call(n,e,t,P)},R={onClick:_,onFocus:w,onBlur:S,onKeyDown:F,onKeyUp:j,onMouseEnter:C,onMouseLeave:E,onPointerEnter:T,onPointerLeave:k,onTouchCancel:I,onTouchEnd:M,onTouchMove:N,onTouchStart:D};return R}function xHe(){var e=Hn(),t=lte(),n=j6(),r=P6(),s=Kv(e)?t.selected:Dg(e)?n.selected:jg(e)?r.selected:void 0;return s}function vHe(e){return Object.values(va).includes(e)}function bHe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(vHe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function _He(e,t){var n=_t({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=_t(_t({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function wHe(e,t,n){var r,s,o,a=Hn(),i=L6(),c=pHe(e,t),u=yHe(e,c),f=xHe(),m=!!(a.onDayClick||a.mode!=="default");d.useEffect(function(){var C;c.outside||i.focusedDay&&m&&Ps(i.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[i.focusedDay,e,n,m,c.outside]);var p=bHe(a,c).join(" "),h=_He(a,c),g=!!(c.outside&&!a.showOutsideDays||c.hidden),y=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:zVe,x=A.createElement(y,{date:e,displayMonth:t,activeModifiers:c}),v={style:h,className:p,children:x,role:"gridcell"},b=i.focusTarget&&Ps(i.focusTarget,e)&&!c.outside,_=i.focusedDay&&Ps(i.focusedDay,e),w=_t(_t(_t({},v),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=_||b?0:-1,r)),u),S={isButton:m,isHidden:g,activeModifiers:c,selectedDays:f,buttonProps:w,divProps:v};return S}function CHe(e){var t=d.useRef(null),n=wHe(e.date,e.displayMonth,t);return n.isHidden?A.createElement("div",{role:"gridcell"}):n.isButton?A.createElement(M2,_t({name:"day",ref:t},n.buttonProps)):A.createElement("div",_t({},n.divProps))}function SHe(e){var t=e.number,n=e.dates,r=Hn(),s=r.onWeekNumberClick,o=r.styles,a=r.classNames,i=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(t),{locale:i});if(!s)return A.createElement("span",{className:a.weeknumber,style:o.weeknumber},f);var m=c(Number(t),{locale:i}),p=function(h){s(t,n,h)};return A.createElement(M2,{name:"week-number","aria-label":m,className:a.weeknumber,style:o.weeknumber,onClick:p},f)}function EHe(e){var t,n,r=Hn(),s=r.styles,o=r.classNames,a=r.showWeekNumber,i=r.components,c=(t=i?.Day)!==null&&t!==void 0?t:CHe,u=(n=i?.WeekNumber)!==null&&n!==void 0?n:SHe,f;return a&&(f=A.createElement("td",{className:o.cell,style:s.cell},A.createElement(u,{number:e.weekNumber,dates:e.dates}))),A.createElement("tr",{className:o.row,style:s.row},f,e.dates.map(function(m){return A.createElement("td",{className:o.cell,style:s.cell,key:tVe(m),role:"presentation"},A.createElement(c,{displayMonth:e.displayMonth,date:m}))}))}function zI(e,t,n){for(var r=n?.ISOWeek?$ee(t):N6(t,n),s=n?.ISOWeek?Zc(e):ri(e,n),o=Va(r,s),a=[],i=0;i<=o;i++)a.push(So(s,i));var c=a.reduce(function(u,f){var m=n?.ISOWeek?qee(f):Yee(f,n),p=u.find(function(h){return h.weekNumber===m});return p?(p.dates.push(f),u):(u.push({weekNumber:m,dates:[f]}),u)},[]);return c}function kHe(e,t){var n=zI(Bs(e),A6(e),t);if(t?.useFixedWeeks){var r=rVe(e,t);if(r<6){var s=n[n.length-1],o=s.dates[s.dates.length-1],a=PE(o,6-r),i=zI(PE(o,1),a,t);n.push.apply(n,i)}}return n}function MHe(e){var t,n,r,s=Hn(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,m=s.weekStartsOn,p=s.firstWeekContainsDate,h=s.ISOWeek,g=kHe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:h,locale:o,weekStartsOn:m,firstWeekContainsDate:p}),y=(t=f?.Head)!==null&&t!==void 0?t:HVe,x=(n=f?.Row)!==null&&n!==void 0?n:EHe,v=(r=f?.Footer)!==null&&r!==void 0?r:BVe;return A.createElement("table",{className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"]},!c&&A.createElement(y,null),A.createElement("tbody",{className:a.tbody,style:i.tbody,role:"rowgroup"},g.map(function(b){return A.createElement(x,{displayMonth:e.displayMonth,key:b.weekNumber,dates:b.dates,weekNumber:b.weekNumber})})),A.createElement(v,{displayMonth:e.displayMonth}))}function THe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var AHe=THe()?d.useLayoutEffect:d.useEffect,Ew=!1,NHe=0;function WI(){return"react-day-picker-".concat(++NHe)}function RHe(e){var t,n=e??(Ew?WI():null),r=d.useState(n),s=r[0],o=r[1];return AHe(function(){s===null&&o(WI())},[]),d.useEffect(function(){Ew===!1&&(Ew=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function DHe(e){var t,n,r=Hn(),s=r.dir,o=r.classNames,a=r.styles,i=r.components,c=Ig().displayMonths,u=RHe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),f=[o.month],m=a.month,p=e.displayIndex===0,h=e.displayIndex===c.length-1,g=!p&&!h;s==="rtl"&&(t=[p,h],h=t[0],p=t[1]),p&&(f.push(o.caption_start),m=_t(_t({},m),a.caption_start)),h&&(f.push(o.caption_end),m=_t(_t({},m),a.caption_end)),g&&(f.push(o.caption_between),m=_t(_t({},m),a.caption_between));var y=(n=i?.Caption)!==null&&n!==void 0?n:FVe;return A.createElement("div",{key:e.displayIndex,className:f.join(" "),style:m},A.createElement(y,{id:u,displayMonth:e.displayMonth}),A.createElement(MHe,{"aria-labelledby":u,displayMonth:e.displayMonth}))}function jHe(e){var t=e.initialProps,n=Hn(),r=L6(),s=Ig(),o=d.useState(!1),a=o[0],i=o[1];d.useEffect(function(){n.initialFocus&&r.focusTarget&&(a||(r.focus(r.focusTarget),i(!0)))},[n.initialFocus,a,r.focus,r.focusTarget,r]);var c=[n.classNames.root,n.className];n.numberOfMonths>1&&c.push(n.classNames.multiple_months),n.showWeekNumber&&c.push(n.classNames.with_weeknumber);var u=_t(_t({},n.styles.root),n.style),f=Object.keys(t).filter(function(m){return m.startsWith("data-")}).reduce(function(m,p){var h;return _t(_t({},m),(h={},h[p]=t[p],h))},{});return A.createElement("div",_t({className:c.join(" "),style:u,dir:n.dir,id:n.id},f),A.createElement("div",{className:n.classNames.months,style:n.styles.months},s.displayMonths.map(function(m,p){return A.createElement(DHe,{key:p,displayIndex:p,displayMonth:m})})))}function IHe(e){var t=e.children,n=oVe(e,["children"]);return A.createElement(SVe,{initialProps:n},A.createElement(IVe,null,A.createElement(hHe,{initialProps:n},A.createElement(WVe,{initialProps:n},A.createElement(qVe,{initialProps:n},A.createElement(tHe,null,A.createElement(mHe,null,t)))))))}function PHe(e){return A.createElement(IHe,_t({},e),A.createElement(jHe,{initialProps:e}))}const B6=A.memo(({className:e,showOutsideDays:t=!0,...n})=>{const r=A.useMemo(()=>({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-between relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:"h-7 w-7 p-0 rounded hover:bg-subtle flex items-center justify-center bg-subtler [&_*]:fill-quiet",table:"w-full border-collapse",head_row:"flex",head_cell:"text-quiet rounded-md w-8 font-normal text-sm font-mono",row:"flex w-full mt-1",cell:z("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected].day-range-end)]:rounded-r-full",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-full [&:has([aria-selected])]:bg-superBG [&:has(>.day-range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full":"[&:has([aria-selected])]:rounded-md"),day:"size-8 p-0 font-normal select-none aria-selected:opacity-100 flex items-center justify-center rounded-full hover:bg-subtler cursor-pointer",day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:z(n.mode==="range"?"[&.day-range-start]:!bg-super [&.day-range-start]:!text-inverse [&.day-range-start]:hover:!bg-super [&.day-range-end]:!bg-super [&.day-range-end]:!text-inverse [&.day-range-end]:hover:!bg-super":"!bg-super !text-inverse hover:!bg-super"),day_today:"bg-superBG text-super hover:bg-superBG",day_outside:"day-outside text-quiet aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-quiet opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...z}),[n.mode]),s=d.useMemo(()=>({IconLeft:({className:o,...a})=>l.jsx(ge,{icon:B("chevron-left"),className:o,size:"sm",...a}),IconRight:({className:o,...a})=>l.jsx(ge,{icon:B("chevron-right"),className:o,size:"sm",...a})}),[]);return l.jsx(PHe,{showOutsideDays:t,className:z("p-3 font-sans text-base",e),classNames:r,components:s,...n})});B6.displayName="Calendar";const OHe=e=>e.toLocaleDateString(),T2=d.memo(function({value:t,onChange:n,placeholder:r="Select date",formatDate:s=OHe,showIcon:o=!0,buttonClassName:a,variant:i="default",trailingIcon:c,fromDate:u,endDate:f,allowPastDates:m=!1}){const[p,h]=d.useState(!1),g=d.useCallback(()=>{h(w=>!w)},[]),y=d.useCallback(w=>{n(w),h(!1)},[n]),x=d.useMemo(()=>{const w=new Date;return w.setHours(0,0,0,0),w},[]),v=(()=>{switch(i){case"subtle":return"bg-subtle";case"default":return"bg-subtler";default:At(i)}})(),b=d.useMemo(()=>m?f?{after:f}:void 0:{before:u??x,after:f},[m,f,u,x]),_=d.useMemo(()=>l.jsxs("div",{role:"button",tabIndex:0,onClick:g,className:z(v,"flex cursor-pointer items-center justify-between rounded-lg px-4 font-sans","hover:border-subtler focus:border-subtler border border-transparent","transition-colors duration-200 ease-out","h-10 w-full","outline-none focus:outline-none focus:ring-0",a),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[o&&l.jsx(ut,{name:B("calendar"),size:16,className:"text-foreground"}),l.jsx("span",{className:"text-foreground text-sm",children:t?s(t):r})]}),c]}),[v,a,s,g,r,o,c,t]);return l.jsx("div",{className:"relative size-full",children:l.jsx(Fl,{interaction:"click",open:p,onOpenChange:h,triggerElement:_,children:l.jsx(B6,{mode:"single",selected:t,onSelect:y,defaultMonth:t,disabled:b,fromDate:m?void 0:u??x})})})}),GI=e=>e?e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):"",$I="border-subtler bg-subtler text-foreground focus:border-super !h-9 rounded-lg border px-3 py-1 text-sm focus:outline-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-inner-spin-button]:hidden [&::-webkit-outer-spin-button]:hidden bg-transparent",qI="data-[state=closed]:border-subtler data-[state=open]:border-super data-[state=open]:hover:border-super !px-3 !h-9 bg-transparent",cte=d.memo(({startDateTime:e,endDateTime:t,onStartDateChange:n,onEndDateChange:r,onStartTimeChange:s,onEndTimeChange:o})=>{const{$t:a}=J(),i=d.useMemo(()=>e?new Date(e):void 0,[e]),c=d.useMemo(()=>t?new Date(t):void 0,[t]),u=d.useCallback(x=>{if(!x)return;const v=new Date(i||"");if(!isNaN(v.getTime())){if(v.setDate(x.getDate()),v.setMonth(x.getMonth()),v.setFullYear(x.getFullYear()),c&&c.getTime(){if(!x)return;const v=new Date(c||"");isNaN(v.getTime())||(v.setDate(x.getDate()),v.setMonth(x.getMonth()),v.setFullYear(x.getFullYear()),i&&v{s(x)},[s]),p=d.useCallback(x=>{if(!i)return;const[v,b]=x.split(":").map(Number);if(v===void 0||b===void 0)return;const _=new Date(i);isNaN(_.getTime())||(_.setHours(v),_.setMinutes(b),!isNaN(_.getTime())&&(c&&_.getTime()>c.getTime()&&r(_),n(_)))},[i,c,n,r]),h=d.useCallback(x=>{o(x)},[o]),g=d.useCallback(x=>{if(!c)return;const[v,b]=x.split(":").map(Number);if(v===void 0||b===void 0)return;const _=new Date(c);isNaN(_.getTime())||(_.setHours(v),_.setMinutes(b),!isNaN(_.getTime())&&(i&&_.getTime()x.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),[]);return l.jsxs("div",{className:"flex flex-col items-center gap-2 md:flex-row",children:[l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx(T2,{buttonClassName:qI,value:i,onChange:u,placeholder:a({defaultMessage:"Select start date",id:"oUUhTXC2Mx"}),formatDate:y,showIcon:!1}),l.jsx("input",{type:"time",value:GI(i),onChange:x=>m(x.target.value),onBlur:x=>p(x.target.value),className:$I})]}),l.jsx("span",{className:"text-quieter mx-1 text-sm",children:a({defaultMessage:"to",id:"NLeFGnA9M4"})}),l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx("input",{type:"time",value:GI(c),onChange:x=>h(x.target.value),onBlur:x=>g(x.target.value),className:$I}),l.jsx(T2,{buttonClassName:qI,value:c,onChange:f,placeholder:a({defaultMessage:"Select end date",id:"0A4/NpHFx/"}),formatDate:y,showIcon:!1})]})]})});cte.displayName="CalendarTimeEditable";function LHe(e){if(!e)return null;try{let t=e;e.startsWith("RRULE:")&&(t=e.substring(6));const n={};for(const r of t.split(";"))if(r.includes("=")){const[s,o]=r.split("=",2);s&&o&&(n[s]=o)}return{freq:n.FREQ?.toUpperCase(),interval:n.INTERVAL?parseInt(n.INTERVAL,10):1,byDay:n.BYDAY?.split(","),byMonthDay:n.BYMONTHDAY,count:n.COUNT}}catch{return null}}function FHe(e){try{if(!e.freq)return null;let t=`RRULE:FREQ=${e.freq}`;return e.interval&&e.interval!==1&&(t+=`;INTERVAL=${e.interval}`),e.byDay&&e.byDay.length>0&&(t+=`;BYDAY=${e.byDay.join(",")}`),e.byMonthDay&&(t+=`;BYMONTHDAY=${e.byMonthDay}`),e.count&&(t+=`;COUNT=${e.count}`),t}catch{return null}}const A2=A.memo(({id:e,label:t,extraCSS:n,options:r,activeKey:s,onOptionChange:o,isDisabled:a=!1,testId:i,defaultOption:c,icon:u,...f})=>{c&&(r=[{label:c,value:""}].concat(r||[]));const m=r||[],p=h=>{o(c&&h===""?null:h)};return l.jsxs("div",{children:[l.jsx(_v,{withMargin:!1,label:t}),l.jsx(V,{variant:"small",className:t&&"mt-sm",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("select",{"data-testid":i,id:e,onChange:h=>p(h.target.value),value:s??"",className:z("border-subtler bg-base p-sm pr-lg outline-super ring-subtler dark:border-subtle dark:bg-subtler dark:ring-subtle w-full appearance-none rounded border transition duration-300 focus:outline-none",{"cursor-pointer hover:ring-1":!a,"pl-lg":u},n),disabled:a,...f,children:m.map(h=>l.jsx("option",{value:h.value,className:"pl-sm",children:h.label},h.value))}),u&&l.jsx("div",{className:"left-sm absolute",children:u}),l.jsx(V,{color:"light",variant:"small",className:"right-sm pointer-events-none absolute",children:l.jsx(ge,{icon:B("chevron-down"),size:"md"})})]})})]})});A2.displayName="Select";const e1={frequency:"WEEKLY",endType:"never",interval:"1"},t1=He({day:{id:"ruG8dNqKt0",defaultMessage:"{count, plural, one {Day} other {Days}}"},week:{id:"cR0w/cReH+",defaultMessage:"{count, plural, one {Week} other {Weeks}}"},month:{id:"svowrjAWNi",defaultMessage:"{count, plural, one {Month} other {Months}}"},year:{id:"OPfd4WaWUE",defaultMessage:"{count, plural, one {Year} other {Years}}"}}),BHe=e=>[{label:e({defaultMessage:"Daily",id:"zxvhnETmn2"}),value:"DAILY"},{label:e({defaultMessage:"Weekly",id:"/clOBUs/wZ"}),value:"WEEKLY"},{label:e({defaultMessage:"Monthly",id:"wYsv4ZHu+B"}),value:"MONTHLY"},{label:e({defaultMessage:"Yearly",id:"dqD39hnoA/"}),value:"YEARLY"}],UHe=e=>[{label:e({defaultMessage:"Never",id:"du1laW45Py"}),value:"never"},{label:e({defaultMessage:"After",id:"4X+U8o+ztO"}),value:"after"}],VHe=e=>[{label:e({defaultMessage:"Mo",id:"EIk6EqFZZN"}),value:"MO"},{label:e({defaultMessage:"Tu",id:"dswupo3WZd"}),value:"TU"},{label:e({defaultMessage:"We",id:"p02wWlGXK3"}),value:"WE"},{label:e({defaultMessage:"Th",id:"Ee4Ne0CnpN"}),value:"TH"},{label:e({defaultMessage:"Fr",id:"pCVXo8kVuW"}),value:"FR"},{label:e({defaultMessage:"Sa",id:"QJaSgEWRy1"}),value:"SA"},{label:e({defaultMessage:"Su",id:"n4xx4rvq9+"}),value:"SU"}],HHe=e=>{if(!e.frequency||e.frequency==="WEEKLY"&&(!e.byDay||e.byDay.length===0))return!1;if(e.interval){const t=parseInt(e.interval,10);if(isNaN(t)||t<1)return!1}if(e.endType==="after"){if(!e.count)return!1;const t=parseInt(e.count,10);if(isNaN(t)||t<1)return!1}return!0},zHe=(e,t)=>({MO:t({defaultMessage:"Mon",id:"T8JZHei06V"}),TU:t({defaultMessage:"Tue",id:"C4ENlvYIEr"}),WE:t({defaultMessage:"Wed",id:"2NqUghZFW1"}),TH:t({defaultMessage:"Thu",id:"FC0AP4JIua"}),FR:t({defaultMessage:"Fri",id:"hFYE2MSlqH"}),SA:t({defaultMessage:"Sat",id:"3Hv4FbI9Kl"}),SU:t({defaultMessage:"Sun",id:"1Aday2s3it"})})[e]||e,ute=d.memo(({value:e,onChange:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),[o,a]=d.useState(e1);d.useEffect(()=>{if(Hi(e)&&!r){const x=LHe(e[0]);x&&(a({...e1,frequency:x.freq,interval:x.interval?.toString()||"1",byDay:x.byDay,count:x.count,endType:x.count?"after":"never"}),s(!0))}},[e,r]);const i=d.useMemo(()=>BHe(n),[n]),c=d.useMemo(()=>UHe(n),[n]),u=d.useMemo(()=>VHe(n),[n]),f=parseInt(o.interval||"1",10),m={DAILY:n(t1.day,{count:f}),WEEKLY:n(t1.week,{count:f}),MONTHLY:n(t1.month,{count:f}),YEARLY:n(t1.year,{count:f})},p=x=>{if(HHe(x)){const v=FHe({freq:x.frequency,interval:x.interval?parseInt(x.interval,10):1,byDay:x.byDay,count:x.endType==="after"?x.count:void 0});v&&t([v])}},h=x=>{const v={...o,...x};a(v),p(v)},g=x=>{const v=o.byDay||[],b=v.includes(x)?v.filter(w=>w!==x):[...v,x],_={...o,byDay:b};a(_),p(_)},y=()=>{s(!1),a(e1),t([])};return l.jsxs(K,{className:"space-y-1 pl-1",children:[!r&&e.length===0&&l.jsx(K,{className:"flex items-center justify-between pl-1",children:l.jsx(st,{onClick:()=>{s(!0),a(e1)},noPadding:!0,variant:"noBackground",text:n({defaultMessage:"Repeat",id:"tw5j2+ZRIB"}),leadingComponent:l.jsx(ut,{name:B("plus"),size:16}),size:"tiny"})}),r&&l.jsxs(K,{className:"flex flex-col gap-2 rounded",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-quieter whitespace-nowrap pr-1 text-xs",children:n({defaultMessage:"Every",id:"JE2YVbgaBx"})}),l.jsx(co,{isMobileUserAgent:!1,min:1,max:99,type:"number",value:o.interval?.toString()||"1",onChange:x=>h({interval:x}),className:"focus:!border-super !w-16 rounded-lg !px-3 focus:!ring-transparent"}),l.jsx(A2,{id:"frequency-select",activeKey:o.frequency||"WEEKLY",options:i.map(x=>({...x,label:m[x.value]})),onOptionChange:x=>h({frequency:x}),extraCSS:"rounded-lg"}),l.jsx("span",{className:"text-quieter whitespace-nowrap pl-2 pr-1 text-xs",children:n({defaultMessage:"Ends",id:"04xGLEkMMo"})}),l.jsx(A2,{id:"end-type-select",activeKey:o.endType||"never",options:c,onOptionChange:x=>h({endType:x,count:x==="after"?"1":void 0}),extraCSS:"rounded-lg w-full"}),o.endType==="after"&&l.jsxs(l.Fragment,{children:[l.jsx(co,{isMobileUserAgent:!1,min:1,max:99,type:"number",value:o.count||"1",onChange:x=>h({count:x}),className:"focus:!border-super !w-16 rounded-lg !px-3 focus:!ring-transparent"}),l.jsx("span",{className:"text-quieter pr-sm whitespace-nowrap text-xs",children:o.count==="1"?n({defaultMessage:"time",id:"nTBG1bRQLC"}):n({defaultMessage:"times",id:"KSQJ7UVwln"})})]}),l.jsx(Ge,{onClick:y,text:n({defaultMessage:"Cancel",id:"47FYwba+bI"}),variant:"common",extraCSS:"px-3 py-1 text-xs ml-auto"})]}),o.frequency==="WEEKLY"&&l.jsxs(K,{className:"flex items-center gap-2",children:[l.jsx("label",{className:"text-quieter w-9 whitespace-nowrap text-xs",children:n({defaultMessage:"On",id:"Zh+5A6yahu"})}),l.jsx("div",{className:"flex gap-2",children:u.map(x=>l.jsx(Ge,{onClick:()=>g(x.value),text:x.label,size:"tiny",pill:!0,variant:o.byDay?.includes(x.value)?"inverted":"common",ariaLabel:n({defaultMessage:"Toggle {day}",id:"i/JqE0BlGw"},{day:zHe(x.value,n)}),noPadding:!0,extraCSS:"w-8 h-8 !p-0 !text-2xs"},x.value))})]})]})]})});ute.displayName="RecurrenceEditor";const dte=A.memo(({label:e,onDelete:t,onClick:n,testId:r,selected:s=!1,disabled:o=!1,title:a,shouldAvoidFocusShift:i=!1,deleteIcon:c=B("x")})=>{const{$t:u}=J(),f=d.useCallback(g=>{g.stopPropagation(),t?.()},[t]),m=d.useCallback(g=>{g.stopPropagation(),n?.({shiftKey:g.shiftKey,metaKey:g.metaKey,ctrlKey:g.ctrlKey})},[n]),p=t&&!o,h=d.useCallback(g=>{g.stopPropagation(),i&&g.preventDefault()},[i]);return l.jsxs("span",{className:"relative flex h-6 max-w-full",children:[l.jsx(K,{className:z("h-full min-w-0 flex-1 rounded-lg border px-2 text-sm",{"pr-[24px]":p},{"cursor-default":o}),variant:s?"superBorder":"subtler","data-test-id":r,onClick:o?void 0:m,onMouseDown:h,as:"button",bgHover:o?void 0:"subtle",title:a,children:l.jsx(V,{variant:"small",className:"block truncate",children:e})}),p&&l.jsx(K,{variant:"transparent",onClick:f,tabIndex:0,"aria-label":u({defaultMessage:"Remove",id:"G/yZLul6P1"}),as:"button",bgHover:"subtle",className:"top-three right-three absolute flex items-center justify-center rounded-md p-0.5",children:l.jsx(rn,{icon:c,size:"tiny"})})]})});dte.displayName="Chip";var KI=1,WHe=.9,GHe=.8,$He=.17,kw=.1,Mw=.999,qHe=.9999,KHe=.99,YHe=/[\\\/_+.#"@\[\(\{&]/,QHe=/[\\\/_+.#"@\[\(\{&]/g,XHe=/[\s-]/,fte=/[\s-]/g;function OE(e,t,n,r,s,o,a){if(o===t.length)return s===e.length?KI:KHe;var i=`${s},${o}`;if(a[i]!==void 0)return a[i];for(var c=r.charAt(o),u=n.indexOf(c,s),f=0,m,p,h,g;u>=0;)m=OE(e,t,n,r,u+1,o+1,a),m>f&&(u===s?m*=KI:YHe.test(e.charAt(u-1))?(m*=GHe,h=e.slice(s,u-1).match(QHe),h&&s>0&&(m*=Math.pow(Mw,h.length))):XHe.test(e.charAt(u-1))?(m*=WHe,g=e.slice(s,u-1).match(fte),g&&s>0&&(m*=Math.pow(Mw,g.length))):(m*=$He,s>0&&(m*=Math.pow(Mw,u-s))),e.charAt(u)!==t.charAt(o)&&(m*=qHe)),(mm&&(m=p*kw)),m>f&&(f=m),u=n.indexOf(c,u+1);return a[i]=f,f}function YI(e){return e.toLowerCase().replace(fte," ")}function ZHe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,OE(e,t,YI(e),YI(t),0,0,{})}var jm='[cmdk-group=""]',Tw='[cmdk-group-items=""]',JHe='[cmdk-group-heading=""]',mte='[cmdk-item=""]',QI=`${mte}:not([aria-disabled="true"])`,LE="cmdk-item-select",Yu="data-value",eze=(e,t,n)=>ZHe(e,t,n),pte=d.createContext(void 0),Pg=()=>d.useContext(pte),hte=d.createContext(void 0),U6=()=>d.useContext(hte),gte=d.createContext(void 0),yte=d.forwardRef((e,t)=>{let n=Qu(()=>{var G,H;return{search:"",value:(H=(G=e.value)!=null?G:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Qu(()=>new Set),s=Qu(()=>new Map),o=Qu(()=>new Map),a=Qu(()=>new Set),i=xte(e),{label:c,children:u,value:f,onValueChange:m,filter:p,shouldFilter:h,loop:g,disablePointerSelection:y=!1,vimBindings:x=!0,...v}=e,b=ls(),_=ls(),w=ls(),S=d.useRef(null),C=dze();Jc(()=>{if(f!==void 0){let G=f.trim();n.current.value=G,E.emit()}},[f]),Jc(()=>{C(6,D)},[]);let E=d.useMemo(()=>({subscribe:G=>(a.current.add(G),()=>a.current.delete(G)),snapshot:()=>n.current,setState:(G,H,Q)=>{var Y,te,se,ae;if(!Object.is(n.current[G],H)){if(n.current[G]=H,G==="search")N(),I(),C(1,M);else if(G==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(w);X?X.focus():(Y=document.getElementById(b))==null||Y.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=j())==null?void 0:X.id,E.emit()}),Q||C(5,D),((te=i.current)==null?void 0:te.value)!==void 0){let X=H??"";(ae=(se=i.current).onValueChange)==null||ae.call(se,X);return}}E.emit()}},emit:()=>{a.current.forEach(G=>G())}}),[]),T=d.useMemo(()=>({value:(G,H,Q)=>{var Y;H!==((Y=o.current.get(G))==null?void 0:Y.value)&&(o.current.set(G,{value:H,keywords:Q}),n.current.filtered.items.set(G,k(H,Q)),C(2,()=>{I(),E.emit()}))},item:(G,H)=>(r.current.add(G),H&&(s.current.has(H)?s.current.get(H).add(G):s.current.set(H,new Set([G]))),C(3,()=>{N(),I(),n.current.value||M(),E.emit()}),()=>{o.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let Q=j();C(4,()=>{N(),Q?.getAttribute("id")===G&&M(),E.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{o.current.delete(G),s.current.delete(G)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:b,inputId:w,labelId:_,listInnerRef:S}),[]);function k(G,H){var Q,Y;let te=(Y=(Q=i.current)==null?void 0:Q.filter)!=null?Y:eze;return G?te(G,n.current.search,H):0}function I(){if(!n.current.search||i.current.shouldFilter===!1)return;let G=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(Y=>{let te=s.current.get(Y),se=0;te.forEach(ae=>{let X=G.get(ae);se=Math.max(X,se)}),H.push([Y,se])});let Q=S.current;F().sort((Y,te)=>{var se,ae;let X=Y.getAttribute("id"),ee=te.getAttribute("id");return((se=G.get(ee))!=null?se:0)-((ae=G.get(X))!=null?ae:0)}).forEach(Y=>{let te=Y.closest(Tw);te?te.appendChild(Y.parentElement===te?Y:Y.closest(`${Tw} > *`)):Q.appendChild(Y.parentElement===Q?Y:Y.closest(`${Tw} > *`))}),H.sort((Y,te)=>te[1]-Y[1]).forEach(Y=>{var te;let se=(te=S.current)==null?void 0:te.querySelector(`${jm}[${Yu}="${encodeURIComponent(Y[0])}"]`);se?.parentElement.appendChild(se)})}function M(){let G=F().find(Q=>Q.getAttribute("aria-disabled")!=="true"),H=G?.getAttribute(Yu);E.setState("value",H||void 0)}function N(){var G,H,Q,Y;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let se of r.current){let ae=(H=(G=o.current.get(se))==null?void 0:G.value)!=null?H:"",X=(Y=(Q=o.current.get(se))==null?void 0:Q.keywords)!=null?Y:[],ee=k(ae,X);n.current.filtered.items.set(se,ee),ee>0&&te++}for(let[se,ae]of s.current)for(let X of ae)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(se);break}n.current.filtered.count=te}function D(){var G,H,Q;let Y=j();Y&&(((G=Y.parentElement)==null?void 0:G.firstChild)===Y&&((Q=(H=Y.closest(jm))==null?void 0:H.querySelector(JHe))==null||Q.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function j(){var G;return(G=S.current)==null?void 0:G.querySelector(`${mte}[aria-selected="true"]`)}function F(){var G;return Array.from(((G=S.current)==null?void 0:G.querySelectorAll(QI))||[])}function R(G){let H=F()[G];H&&E.setState("value",H.getAttribute(Yu))}function P(G){var H;let Q=j(),Y=F(),te=Y.findIndex(ae=>ae===Q),se=Y[te+G];(H=i.current)!=null&&H.loop&&(se=te+G<0?Y[Y.length-1]:te+G===Y.length?Y[0]:Y[te+G]),se&&E.setState("value",se.getAttribute(Yu))}function L(G){let H=j(),Q=H?.closest(jm),Y;for(;Q&&!Y;)Q=G>0?cze(Q,jm):uze(Q,jm),Y=Q?.querySelector(QI);Y?E.setState("value",Y.getAttribute(Yu)):P(G)}let U=()=>R(F().length-1),O=G=>{G.preventDefault(),G.metaKey?U():G.altKey?L(1):P(1)},$=G=>{G.preventDefault(),G.metaKey?R(0):G.altKey?L(-1):P(-1)};return d.createElement(Et.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:G=>{var H;(H=v.onKeyDown)==null||H.call(v,G);let Q=G.nativeEvent.isComposing||G.keyCode===229;if(!(G.defaultPrevented||Q))switch(G.key){case"n":case"j":{x&&G.ctrlKey&&O(G);break}case"ArrowDown":{O(G);break}case"p":case"k":{x&&G.ctrlKey&&$(G);break}case"ArrowUp":{$(G);break}case"Home":{G.preventDefault(),R(0);break}case"End":{G.preventDefault(),U();break}case"Enter":{G.preventDefault();let Y=j();if(Y){let te=new Event(LE);Y.dispatchEvent(te)}}}}},d.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:mze},c),Yv(e,G=>d.createElement(hte.Provider,{value:E},d.createElement(pte.Provider,{value:T},G))))}),tze=d.forwardRef((e,t)=>{var n,r;let s=ls(),o=d.useRef(null),a=d.useContext(gte),i=Pg(),c=xte(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Jc(()=>{if(!u)return i.item(s,a?.id)},[u]);let f=vte(s,o,[e.value,e.children,o],e.keywords),m=U6(),p=Hl(C=>C.value&&C.value===f.current),h=Hl(C=>u||i.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);d.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(LE,g),()=>C.removeEventListener(LE,g)},[h,e.onSelect,e.disabled]);function g(){var C,E;y(),(E=(C=c.current).onSelect)==null||E.call(C,f.current)}function y(){m.setState("value",f.current,!0)}if(!h)return null;let{disabled:x,value:v,onSelect:b,forceMount:_,keywords:w,...S}=e;return d.createElement(Et.div,{ref:zc(o,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!p,"data-disabled":!!x,"data-selected":!!p,onPointerMove:x||i.getDisablePointerSelection()?void 0:y,onClick:x?void 0:g},e.children)}),nze=d.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,a=ls(),i=d.useRef(null),c=d.useRef(null),u=ls(),f=Pg(),m=Hl(h=>s||f.filter()===!1?!0:h.search?h.filtered.groups.has(a):!0);Jc(()=>f.group(a),[]),vte(a,i,[e.value,e.heading,c]);let p=d.useMemo(()=>({id:a,forceMount:s}),[s]);return d.createElement(Et.div,{ref:zc(i,t),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&d.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Yv(e,h=>d.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},d.createElement(gte.Provider,{value:p},h))))}),rze=d.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=d.useRef(null),o=Hl(a=>!a.search);return!n&&!o?null:d.createElement(Et.div,{ref:zc(s,t),...r,"cmdk-separator":"",role:"separator"})}),sze=d.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=U6(),a=Hl(u=>u.search),i=Hl(u=>u.selectedItemId),c=Pg();return d.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),d.createElement(Et.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":i,id:c.inputId,type:"text",value:s?e.value:a,onChange:u=>{s||o.setState("search",u.target.value),n?.(u.target.value)}})}),oze=d.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=d.useRef(null),a=d.useRef(null),i=Hl(u=>u.selectedItemId),c=Pg();return d.useEffect(()=>{if(a.current&&o.current){let u=a.current,f=o.current,m,p=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let h=u.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(m),p.unobserve(u)}}},[]),d.createElement(Et.div,{ref:zc(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":r,id:c.listId},Yv(e,u=>d.createElement("div",{ref:zc(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),aze=d.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:a,...i}=e;return d.createElement(wT,{open:n,onOpenChange:r},d.createElement(CT,{container:a},d.createElement(ST,{"cmdk-overlay":"",className:s}),d.createElement(ET,{"aria-label":e.label,"cmdk-dialog":"",className:o},d.createElement(yte,{ref:t,...i}))))}),ize=d.forwardRef((e,t)=>Hl(n=>n.filtered.count===0)?d.createElement(Et.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),lze=d.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return d.createElement(Et.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Yv(e,a=>d.createElement("div",{"aria-hidden":!0},a)))}),Og=Object.assign(yte,{List:oze,Item:tze,Input:sze,Group:nze,Separator:rze,Dialog:aze,Empty:ize,Loading:lze});function cze(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function uze(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function xte(e){let t=d.useRef(e);return Jc(()=>{t.current=e}),t}var Jc=typeof window>"u"?d.useEffect:d.useLayoutEffect;function Qu(e){let t=d.useRef();return t.current===void 0&&(t.current=e()),t}function Hl(e){let t=U6(),n=()=>e(t.snapshot());return d.useSyncExternalStore(t.subscribe,n,n)}function vte(e,t,n,r=[]){let s=d.useRef(),o=Pg();return Jc(()=>{var a;let i=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());o.value(e,i,c),(a=t.current)==null||a.setAttribute(Yu,i),s.current=i}),s}var dze=()=>{let[e,t]=d.useState(),n=Qu(()=>new Map);return Jc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function fze(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Yv({asChild:e,children:t},n){return e&&d.isValidElement(t)?d.cloneElement(fze(t),{ref:t.ref},n(t.props.children)):n(t)}var mze={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const bte={xs:12,sm:14,md:16,lg:20},pze={xs:"[&_input]:pr-sm [&_input]:pl-7",sm:"[&_input]:pr-sm [&_input]:pl-[30px]",md:"[&_input]:pr-sm [&_input]:pl-8",lg:"[&_input]:pr-sm [&_input]:pl-9"};function _te({options:e,value:t,onValueChange:n,placement:r="bottom-start",keepDraftValue:s=!1}){const[o,a]=d.useState(!1),[i,c]=d.useState(void 0),[u,f]=d.useState(!1),m=d.useRef(null),p=i===void 0,{refs:h,floatingStyles:g}=nY({open:o,placement:r,strategy:"fixed",middleware:[dM(4),UU({padding:8,fallbackAxisSideDirection:"start"}),BU({padding:8}),VU({padding:8,apply({availableHeight:k,rects:I,elements:M}){M.floating.style.maxHeight=`${Math.min(k,300)}px`,M.floating.style.width=`${I.reference.width}px`}})],whileElementsMounted:HU}),y=d.useCallback(()=>{const k=e.find(I=>I.value===t);return k?k.label:""},[t,e]),x=d.useCallback(()=>{a(!1),s||c(void 0),m.current?.blur()},[s]);d.useEffect(()=>{if(!o)return;const k=I=>{const M=h.reference.current,N=h.floating.current,D=I.target,j=M&&"contains"in M&&!M.contains(D),F=N&&"contains"in N&&!N.contains(D);j&&F&&x()};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[o,h,x]);const v=d.useCallback(k=>{c(k),k===""&&n?.(""),o||a(!0)},[o,n]),b=d.useCallback(()=>{a(!0),f(!0),s||(c(void 0),queueMicrotask(()=>{m.current?.select()}))},[s]),_=d.useCallback(k=>{f(!1)},[]),w=d.useCallback(k=>{n?.(k),c(void 0),a(!1),m.current?.blur()},[n]),S=y(),C=d.useMemo(()=>u?i===void 0?S:i:i??S,[u,S,i]),E=d.useMemo(()=>({...g,position:g.position,zIndex:50}),[g]),T=d.useMemo(()=>({width:"100%"}),[]);return d.useMemo(()=>({isOpen:o,draft:i,isPristine:p,isFocused:u,displayValue:C,inputRef:m,refs:h,listWrapperStyles:T,floatingListStyles:E,onInputChange:v,onFocus:b,onBlur:_,onSelect:w}),[o,i,p,u,C,m,h,T,E,v,b,_,w])}const wte=d.memo(function({children:t,loop:n=!0,filter:r,shouldFilter:s=!0}){return l.jsx(Og,{loop:n,filter:r,shouldFilter:s,children:t})}),FE=d.memo(function({value:t,onValueChange:n,onFocus:r,onBlur:s,onPaste:o,onKeyDown:a,placeholder:i,size:c="md",colorVariant:u="default",noRounded:f=!1,disabled:m,autoFocus:p,ref:h,horizontalSpacing:g,verticalSpacing:y}){const x={subtle:"bg-subtle",default:"bg-base dark:bg-subtler",borderless:"bg-transparent focus:!ring-0!border-0 !bg-transparent !px-0 focus:!ring-0 !border-0"},v={xs:"text-xs placeholder:text-xs",sm:"text-sm placeholder:text-sm",md:"text-sm placeholder:text-sm",lg:"text-lg placeholder:text-base"},b={none:"",xs:"px-xs",sm:"px-sm",md:"px-md",lg:"px-lg",xl:"px-xl"},_={none:"",xs:"py-xs",sm:"py-sm",md:"py-md",lg:"py-lg",xl:"py-xl"},w={xs:"sm",sm:"sm",md:"md",lg:"xl"},S={xs:"xs",sm:"sm",md:"sm",lg:"lg"},C=b[g??w[c]],E=_[y??S[c]];return l.jsx(Og.Input,{ref:h,value:t,onValueChange:n,onFocus:r,onBlur:s,onPaste:o,onKeyDown:a,placeholder:i,disabled:m,autoFocus:p,className:z("focus:ring-subtler w-full font-sans outline-none focus:outline-none","text-foreground caret-super selection:bg-super/50","border-subtler placeholder-quieter border focus:ring-1","transition-all duration-200",!f&&"rounded-lg",x[u],v[c],C,E,m&&"cursor-not-allowed opacity-50")})}),hze=d.memo(function({icon:t,size:n=16}){return l.jsx("div",{className:z("pointer-events-none left-2 top-1/2 -translate-y-1/2","absolute"),children:l.jsx(ut,{name:t,size:n,className:"text-quieter"})})}),Cte=d.memo(function({children:t,style:n}){return l.jsx(Og.List,{className:z("z-50","max-h-[300px] overflow-y-auto","border-subtler shadow-overlay rounded-xl border","bg-base p-xs","flex flex-col gap-px"),style:n,children:t})}),Ste=d.memo(function({value:t,onSelect:n,selected:r,disabled:s,children:o,size:a="md",ref:i}){const c={xs:"text-xs py-1 px-xs",sm:"text-sm py-1 px-sm",md:"text-sm py-1.5 px-sm",lg:"text-base py-2 px-md"};return l.jsx(Og.Item,{value:t,onSelect:n,disabled:s,ref:i,className:z("relative select-none rounded-lg transition-all duration-300",c[a],{"hover:bg-subtler cursor-pointer":!s,"cursor-not-allowed":s,"aria-selected:bg-subtler":!0},s&&"opacity-50"),children:l.jsx("span",{className:z({"text-super":r}),children:o})})}),Ete=d.memo(function({children:t,size:n="md"}){const r={xs:"text-xs py-2",sm:"text-sm py-2.5",md:"text-sm py-3",lg:"text-base py-3.5"};return l.jsx(Og.Empty,{className:z("text-quieter text-center",r[n]),children:t})}),gze=d.memo(function({option:t,value:n,disabled:r,size:s="md",onSelect:o}){const a=d.useCallback(()=>{o(t.value)},[o,t.value]),i=t.icon;return l.jsx(Ste,{value:t.label,onSelect:a,selected:n===t.value,disabled:r,size:s,children:i?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ut,{name:i,size:bte[s]}),l.jsx("span",{children:t.label})]}):t.label})}),t_t=d.memo(function({options:t,placeholder:n,value:r,onValueChange:s,filter:o,emptyMessage:a,placement:i="bottom-start",referenceRef:c,keepDraftValue:u=!1,size:f="md",colorVariant:m="default",noRounded:p=!1,horizontalSpacing:h,verticalSpacing:g,disabled:y=!1,autoFocus:x=!1}){const v=_te({options:t,value:r,onValueChange:s,placement:i,keepDraftValue:u}),{isOpen:b,displayValue:_,inputRef:w,refs:S,onInputChange:C,onFocus:E,onSelect:T,listWrapperStyles:k,floatingListStyles:I}=v,N=d.useMemo(()=>t.find(j=>j.value===r),[t,r])?.icon;d.useEffect(()=>{c?.current&&v.refs.setReference(c.current)},[c,v.refs]);const D=d.useCallback(j=>{c||v.refs.setReference(j)},[c,v.refs]);return l.jsx("div",{ref:D,className:"relative",children:l.jsxs(wte,{filter:o,shouldFilter:!v.isFocused||!v.isPristine||(v.draft?.length??0)>0,children:[N?l.jsxs("div",{className:"relative",children:[l.jsx(hze,{icon:N,size:bte[f]}),l.jsx("div",{className:pze[f],children:l.jsx(FE,{ref:w,value:_,onValueChange:C,onFocus:E,onBlur:v.onBlur,placeholder:n,size:f,horizontalSpacing:"none",verticalSpacing:g,colorVariant:m,noRounded:p,disabled:y,autoFocus:x})})]}):l.jsx(FE,{ref:w,value:_,onValueChange:C,onFocus:E,onBlur:v.onBlur,placeholder:n,size:f,horizontalSpacing:h,verticalSpacing:g,colorVariant:m,noRounded:p,disabled:y,autoFocus:x}),b&&l.jsx("div",{ref:S.setFloating,style:I,children:l.jsxs(Cte,{style:k,children:[l.jsx(Ete,{size:f,children:a}),t.map(j=>l.jsx(gze,{option:j,value:r,disabled:y,size:f,onSelect:T},j.value))]})})]})})});function yze(e,t=!0){const n=d.useRef(null);return d.useEffect(()=>{if(!t)return;const r=s=>{n.current&&!n.current.contains(s.target)&&e()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t,e]),n}const xze=async(e,t)=>{if(!t){await BE(e);return}try{const n=new Blob([t],{type:"text/html"}),r=new Blob([e],{type:"text/plain"});await navigator.clipboard.write([new ClipboardItem({"text/html":n,"text/plain":r})])}catch{await BE(e)}},BE=async e=>{try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}},kte=A.memo(({chip:e,selected:t,disabled:n,onDelete:r,onClick:s})=>{const o=d.useCallback(()=>{r(e.value)},[r,e.value]),a=d.useCallback(i=>{s(e.value,i)},[s,e.value]);return l.jsx(dte,{label:e.label,selected:t,title:e.value,onDelete:o,onClick:a,disabled:n,shouldAvoidFocusShift:!0})});kte.displayName="ChipItem";function vze({option:e,draft:t,onSelect:n,renderSuggestion:r}){const s=d.useCallback(()=>{n(e.value)},[n,e.value]);return l.jsx(Ste,{value:e.value,onSelect:s,selected:t===e.value,children:r?.(e.item)})}function bze({suggestions:e,draft:t,onSelect:n,renderSuggestion:r,referenceElement:s,onValueChange:o}){const a=e?.map(c=>({value:c.value,label:c.key}))||[],i=_te({options:a,value:t,onValueChange:o});return d.useEffect(()=>{s&&i.refs.setReference(s)},[s,i.refs]),l.jsx(d8e,{children:l.jsx("div",{ref:i.refs.setFloating,style:i.floatingListStyles,children:l.jsxs(Cte,{style:i.listWrapperStyles,children:[l.jsx(Ete,{children:"No results found"}),e.map(c=>l.jsx(vze,{option:c,draft:t,onSelect:n,renderSuggestion:r},c.key))]})})})}function _ze({chips:e,limit:t=1/0,onAdd:n,onDelete:r,validator:s,placeholder:o,disabled:a=!1,testId:i,children:c,className:u,placeholderOnFocusOnly:f=!1,onDraftChange:m,suggestions:p,renderSuggestion:h}){const[g,y]=d.useState(""),[x,v]=d.useState(!1),[b,_]=d.useState([]),w=d.useRef(null),S=yze(()=>{_([])}),C=d.useCallback(R=>{y(R),m?.(R)},[m]),E=d.useCallback(R=>{const P=(R??g).trim();if(P===""||e.find(U=>U.value===P))return!1;if(s){const U=s(P);if(typeof U=="string"||!U)return!1}const L=p?.find(U=>U.value===P);return y(""),n([P],L?[L.item]:void 0),!0},[g,n,e,s,p]);d.useEffect(()=>{b.length>0&&S.current&&S.current.focus()},[b,S]);const T=d.useCallback(R=>{if((R.metaKey||R.ctrlKey)&&R.key==="a"&&g){R.stopPropagation();return}if(R.key==="Enter"||R.key==="Tab"||R.key===" "||R.key===","||R.key===";"){if(!E())return;R.preventDefault(),v(!0);return}if(R.key==="Escape"){y(""),v(!1);return}if(R.key==="Backspace"){if(b.length>0)return;if(!g&&!b.length){R.stopPropagation(),R.preventDefault();const P=e[e.length-1];P&&_([P.value]),v(!1)}return}if((R.key==="ArrowLeft"||R.key==="ArrowRight")&&!g){if(R.preventDefault(),R.stopPropagation(),R.key==="ArrowLeft"&&e.length>0){const P=e[e.length-1];P&&(_([P.value]),v(!1))}return}},[E,b,g,e]),k=d.useCallback(R=>{r([R]),_(P=>P.filter(L=>L!==R)),v(!0)},[r]),I=d.useCallback((R,P)=>{_(L=>{const U=P.shiftKey,O=P.metaKey,$=P.ctrlKey;return O||$?L.includes(R)?L.filter(G=>G!==R):[...L,R]:U?L.includes(R)?L:[...L,R]:L.includes(R)?L.filter(G=>G!==R):[R]})},[]),M=d.useCallback(()=>{g.trim()!==""&&!E()||v(!1)},[g,E]),N=d.useCallback(()=>{BE(b.join(","))},[b]),D=d.useCallback(R=>{const{metaKey:P,ctrlKey:L,key:U}=R;if((P||L)&&U==="a"){if(x&&g)return;R.preventDefault(),_(e.map(O=>O.value)),x&&v(!1);return}if((P||L)&&U==="c"&&b.length>0){R.preventDefault(),N();return}if((P||L)&&U==="x"&&b.length>0){R.preventDefault(),N();const O=[...b];_([]),r(O),v(!0);return}if(U==="Backspace"&&b.length>0&&!g){R.preventDefault();const O=[...b];_([]),r(O),v(!0);return}if(U==="ArrowLeft"||U==="ArrowRight"){if(document.activeElement===w.current?.element())return;R.preventDefault();const $=U==="ArrowLeft",G=U==="ArrowRight",H=Q=>{const Y=e[Q];Y&&_([Y.value])};if(b.length===0)e.length>0&&H($?e.length-1:0);else{const Q=b.map(Y=>e.findIndex(te=>te.value===Y)).filter(Y=>Y!==-1).sort((Y,te)=>Y-te);if(Q.length>0){const Y=$?Q[0]:Q[Q.length-1];if(Y!==void 0)if(G&&Y===e.length-1)_([]),v(!0);else{const te=$?Math.max(0,Y-1):Math.min(e.length-1,Y+1);H(te)}}}return}},[b,r,e,x,g,N]),j=d.useCallback(R=>{const L=R.clipboardData.getData("text").split(/[,;\n\t]+/).map(U=>U.trim()).filter(Boolean);if(L.length>1){const U=[],O=[];if(L.forEach($=>{if(s){if(s($)===!0){U.push($);const H=p?.find(Q=>Q.value===$);H&&O.push(H.item)}}else{U.push($);const G=p?.find(H=>H.value===$);G&&O.push(G.item)}}),U.length>0)R.preventDefault(),R.stopPropagation(),n(U,O.length>0?O:void 0);else return}},[s,n,p]),F=d.useCallback(R=>{E(R)||y(""),queueMicrotask(()=>{w.current?.focus()})},[E]);return l.jsxs("div",{ref:S,tabIndex:0,className:z("flex min-h-10 w-full flex-row flex-wrap items-center gap-1 py-2 focus:outline-none",u),"data-test-id":i,onKeyDown:D,onPointerDown:R=>{x&&R.target===S.current&&R.preventDefault()},onClick:R=>{x||(R.stopPropagation(),R.preventDefault(),!a&&e.lengthl.jsx(kte,{chip:R,selected:b.includes(R.value),disabled:a,onDelete:k,onClick:I},R.value)),!a&&e.length0&&g.trim()&&l.jsx(bze,{suggestions:p,draft:g,onSelect:F,renderSuggestion:h,referenceElement:S.current,onValueChange:C})]})}),c]})}const V6=A.memo(_ze);V6.displayName="ChipInput";function wze(e){const t=e.display_name?.trim(),n=e.email;return t||n}function Cze(e){if(!e?.solution?.name)return"none";const t=e.solution.name.toLowerCase();return t.includes("zoom")?oa.ZOOM:t.includes("teams")?oa.MICROSOFT_TEAMS:t.includes("meet")||t.includes("google")?oa.GOOGLE_MEET:"none"}function Sze(e){return e.filter(t=>t.email).map(t=>({label:wze(t),value:t.email}))}const UE=d.memo(({event:e,newEvent:t,onEventChange:n,isEditable:r=!0,truncateAttendees:s,noWrapper:o=!1,action:a})=>{const{$t:i}=J(),[c,u]=d.useState({event_id:e.event_id,title:e.title,start_date_time:e.start_date_time,end_date_time:e.end_date_time,attendees:e.attendees?.map(j=>({email:j.email,optional:j.optional,display_name:j.display_name,photo_url:j.photo_url})),organizer:e.organizer,description:e.description,location:e.location,link:e.link,calendar_color:e.calendar_color,event_color:e.event_color,conference_data:e.conference_data,creator:e.creator,html_description:e.html_description,is_all_day:e.is_all_day,recurrence:e.recurrence?.map(j=>j.toString())}),f=d.useRef(null),{suggestions:m,handleDraftChange:p}=Aee({reason:"calendar_event"}),{connectors:h}=Ea({reason:"calendar-event-video-conferencing"}),g=d.useMemo(()=>{const j=h?.connectors??[];return{hasGoogleMeet:j.some(F=>F.connection_type===Zn.GCAL&&F.connected),hasZoom:j.some(F=>F.connection_type===Zn.ZOOM&&F.connected),hasTeams:j.some(F=>F.connection_type===Zn.OUTLOOK&&F.connected)}},[h?.connectors]);d.useEffect(()=>{n?.(c)},[c,n]);const y=d.useCallback(j=>{j&&u(F=>({...F,start_date_time:j.toISOString()}))},[]),x=d.useCallback(j=>{j&&u(F=>({...F,end_date_time:j.toISOString()}))},[]),v=d.useCallback(j=>{u(F=>{const R=new Date(F.start_date_time||""),[P,L]=j.split(":").map(Number);return P===void 0||L===void 0||(R.setHours(P),R.setMinutes(L),isNaN(R.getTime()))?F:{...F,start_date_time:R.toISOString()}})},[]),b=d.useCallback(j=>{u(F=>{const R=new Date(F.end_date_time||""),[P,L]=j.split(":").map(Number);return P===void 0||L===void 0||(R.setHours(P),R.setMinutes(L),isNaN(R.getTime()))?F:{...F,end_date_time:R.toISOString()}})},[]),_=({action:j,email:F,newEmail:R,displayName:P,photoUrl:L})=>{u(U=>{const O=[...U.attendees||[]];switch(j){case"add":O.some($=>$.email===F)||O.push({email:F,display_name:P,photo_url:L});break;case"delete":return{...U,attendees:O.filter($=>$.email!==F)};case"edit":return{...U,attendees:O.map($=>$.email===F?{...$,email:R}:$)}}return{...U,attendees:O}})},w=Nee(e?.calendar_color?.background??"#AC725E"),S=Ree(w),C=d.useCallback(j=>u(F=>({...F,title:j})),[]),E=d.useCallback((j,F)=>{const R=tme(F,"email");j.forEach(P=>{const L=R[P];_({action:"add",email:P,displayName:L?.name,photoUrl:L?.image||void 0})})},[]),T=d.useCallback(j=>{j.forEach(F=>_({action:"delete",email:F}))},[]),k=d.useCallback(j=>u(F=>({...F,location:j})),[]),I=d.useCallback(j=>{u(F=>({...F,recurrence:j}))},[]),M=d.useCallback(j=>{let F;j===oa.GOOGLE_MEET?F={entry_points:[],solution:{name:"Google Meet",key_type:"hangoutsMeet"}}:j===oa.ZOOM?F={entry_points:[],solution:{name:"Zoom",key_type:"zoom"}}:j===oa.MICROSOFT_TEAMS?F={entry_points:[],solution:{name:"Microsoft Teams",key_type:"teams"}}:F=void 0,u(R=>({...R,conference_data:F}))},[]),N=d.useCallback(j=>l.jsx(Tee,{contact:j}),[]),D=d.useMemo(()=>{const j=[];return g.hasGoogleMeet&&j.push({label:i({defaultMessage:"Google Meet",id:"crZ+Bimh7N"}),value:oa.GOOGLE_MEET}),g.hasZoom&&j.push({label:i({defaultMessage:"Zoom",id:"yMbKjuDH/n"}),value:oa.ZOOM}),g.hasTeams&&j.push({label:i({defaultMessage:"Microsoft Teams",id:"IIfj4GddO3"}),value:oa.MICROSOFT_TEAMS}),j.push({label:i({defaultMessage:"No video conferencing",id:"PYY40S2Jrm"}),value:"none"}),j},[i,g]);if(!r){const{title:j}=e;if((!e.attendees||e.attendees.length==0)&&!e.start_date_time&&!e.end_date_time&&!e.title)return null;const F=l.jsxs("div",{className:"gap-md relative flex",children:[l.jsx("div",{className:z("inset-y-xs absolute left-0 w-1 shrink-0 self-stretch rounded-full",{"brightness-[0.8]":S==="Fail"}),style:{backgroundColor:w}}),l.jsxs("div",{className:"gap-md flex flex-col pl-5",children:[l.jsx(Vl,{oldText:j,newText:t?.title??void 0,isDeletion:a==="DELETE"}),l.jsx(Hee,{event:e,newEvent:t,action:a,truncateAttendees:s})]})]});return o?l.jsx("div",{className:"p-md relative overflow-hidden",children:F}):l.jsx(dr,{fullBleed:!0,className:"p-md relative overflow-hidden",roundedClass:"rounded-md",children:F})}return l.jsxs(dr,{fullBleed:!0,className:"relative flex flex-col gap-4 overflow-hidden px-8 py-2",roundedClass:"rounded-md",fullBleedBorderClassname:"border-none",children:[l.jsx("div",{className:"shrink-none left-xs absolute bottom-2 top-2 w-1.5 self-stretch rounded-full"+(S==="Fail"?" brightness-[0.8]":""),style:{backgroundColor:w}}),l.jsx(co,{size:"md",type:"text",value:c.title||"",onChange:C,className:"border-subtler text-foreground w-full rounded-none rounded-t-md border-x-0 border-b border-t-0 pb-2 pl-0 pr-4 font-medium shadow-none focus:!outline-none focus:!ring-0",placeholder:i({defaultMessage:"Add title",id:"k09nVJqic1"}),isMobileUserAgent:!1}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Xs,{icon:B("clock"),alignCenter:!0,iconSize:"sm",children:l.jsx(cte,{startDateTime:c.start_date_time,endDateTime:c.end_date_time,onStartDateChange:y,onEndDateChange:x,onStartTimeChange:v,onEndTimeChange:b})}),l.jsx(Xs,{icon:B("calendar-repeat"),iconSize:"sm",children:l.jsx(ute,{value:c.recurrence||[],onChange:I})}),l.jsx(Xs,{icon:B("user"),iconSize:"sm",alignCenter:!0,children:l.jsx("div",{className:z("border-subtler text-foreground focus-within:border-super w-full rounded-lg border px-2",{"!px-3":!c.attendees?.length}),children:l.jsx(V6,{chips:Sze(c.attendees??[]),onAdd:E,onDelete:T,validator:BBe,placeholder:i({defaultMessage:"Add guests",id:"pP5ifNp+MS"}),suggestions:m,renderSuggestion:N,onDraftChange:p})})}),l.jsx(Xs,{icon:B("map-pin"),iconSize:"sm",alignCenter:!0,children:l.jsx(co,{type:"text",value:c.location||"",onChange:k,placeholder:i({defaultMessage:"Add rooms or location",id:"bb7ELr4Sk+"}),className:"focus:!border-super rounded-lg !px-3 focus:!ring-transparent",isMobileUserAgent:!1})}),l.jsx(Xs,{icon:B("video"),iconSize:"sm",alignCenter:!0,children:l.jsx(A2,{id:"video-conferencing-select",activeKey:Cze(c.conference_data),options:D,onOptionChange:M,extraCSS:"rounded-lg pl-3 [&+div]:right-3"})}),l.jsx(Xs,{icon:B("align-left"),iconSize:"sm",children:l.jsx(TA,{wrapperClass:"bg-transparent focus-within:!border-super rounded-md px-3 py-2 text-sm focus-within:!ring-transparent",inputRef:f,isMobileUserAgent:!1,children:l.jsx(AA,{value:c.description||"",onChange:j=>u(F=>({...F,description:j})),placeholder:i({defaultMessage:"Add a description",id:"bocXKEDBwm"}),minRows:4,isMobileStyle:!1,isMobileUserAgent:!1,ref:f})})})]})]})});UE.displayName="CalendarEventLarge";var dd;(function(e){e.CREATED="CREATED",e.UPDATED="UPDATED",e.DELETED="DELETED",e.REJECTED="REJECTED"})(dd||(dd={}));const Mte=A.memo(({operation:e,isShowEditableComponentsEnabled:t,buttonVariant:n,buttonText:r,onConfirm:s,onSkip:o})=>{const{$t:a}=J(),[i,c]=d.useState();d.useEffect(()=>{c(void 0)},[e]);const u=d.useMemo(()=>{if(e?.update){const y=e.update.event,x=e.update.new_event;return y&&x?{...y,...Object.fromEntries(Object.entries(x).filter(([b,_])=>_!==null))}:x||y}return e?.add?.event||e?.delete?.event},[e]),f=d.useCallback(y=>{c(y)},[]),m=d.useCallback(y=>[{...e,...y&&{...e.add&&{add:{event:y}},...e.update&&{update:{event:y}},...e.delete&&{delete:{event:y,delete_scope:e.delete?.delete_scope}}},status:y.status.toUpperCase()}],[e]),p=d.useCallback((y,x)=>{const v=x||{...i||u,status:y};return{confirmed:!0,operations:v?m(v):[]}},[i,u,m]),h=d.useCallback(()=>{let y=dd.CREATED;e.update?y=dd.UPDATED:e.delete&&(y=dd.DELETED),s(p(y))},[p,s,e]),g=d.useCallback(()=>{o(p(dd.REJECTED))},[p,o]);return l.jsxs(l.Fragment,{children:[u&&e.delete&&l.jsx(K,{className:"px-sm mb-sm",children:l.jsx(UE,{event:u,newEvent:e.update?.new_event,isEditable:!1})}),u&&!e.delete&&l.jsx(K,{className:"px-md py-sm",children:l.jsx(UE,{event:u,newEvent:e.update?.new_event,onEventChange:f,isEditable:t})}),l.jsx("form",{onSubmit:y=>{y.preventDefault(),h()},children:l.jsx(K,{className:"px-md py-sm gap-4 border-t pt-4",children:l.jsx("div",{className:"gap-sm flex items-center justify-between",children:l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(Ge,{size:"small",variant:n,text:r,type:"submit"}),l.jsx(st,{size:"small",text:a({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:g})]})})})})]})});Mte.displayName="CalendarOperationItem";function Eze(){const{value:e}=Rx({flag:"show-editable-calendar-components",defaultValue:!1});return e}const kze=({result:e,isDeleteOperation:t})=>{const{$t:n}=J();return e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),size:14,className:"shrink-0 text-[#16a34a]",title:"Confirmed"}),l.jsx("span",{className:"text-xs font-medium leading-none text-[#16a34a]",children:n(t?{defaultMessage:"Deleted",id:"KQvWvDRI1B"}:{defaultMessage:"Accepted",id:"aFyFm0PsCy"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:n({defaultMessage:"Skipped",id:"djZCU5enGS"})})]}):null},Tte=A.memo(({calendarOperations:e,sendStepResult:t,isFinished:n})=>{const r="calendar-operation-step",[s,o]=d.useState(n??!1),{$t:a}=J(),i=Eze(),[c,u]=d.useState(0),[f,m]=d.useState(()=>Array(e.length).fill(null)),p=d.useRef(!1),h=d.useMemo(()=>e[c],[e,c]),g=d.useMemo(()=>h?.delete?.event?"rejected":"inverted",[h?.delete?.event]),y=d.useMemo(()=>h?h.delete?.event?a({defaultMessage:"Delete",id:"K3r6DQW7h+"}):a({defaultMessage:"Schedule",id:"hGQqkWwmJD"}):a({defaultMessage:"Schedule",id:"hGQqkWwmJD"}),[h,a]),x=e.length>1,v=d.useMemo(()=>({position:"absolute",bottom:16,right:16,zIndex:10}),[]),b=d.useCallback(()=>{u(C=>Math.max(C-1,0))},[]),_=d.useCallback(()=>{u(C=>Math.min(C+1,e.length-1))},[e.length]),w=d.useCallback(C=>{m(E=>{const T=[...E];T[c]=C;const k=T.findIndex(M=>M===null);if(T.every(M=>M!==null)&&!p.current){p.current=!0;const M=T.map(N=>N?.operations).filter(N=>Array.isArray(N)).flat();M.length>0?t({confirmed:!0,operations:M},r,!1):t({confirmed:!1},r,!1),o(!0)}else k!==-1&&u(k);return T})},[c,t,r]),S=d.useCallback(C=>{w(C)},[w]);return s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:a({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):h?l.jsxs(K,{variant:"raised",className:"py-sm relative rounded-lg border",children:[l.jsx(Mte,{operation:JSON.parse(JSON.stringify(h)),isShowEditableComponentsEnabled:i,buttonVariant:g,buttonText:y,onConfirm:w,onSkip:S},`operation-${c}`),x&&l.jsxs(K,{style:v,className:"flex items-center gap-4",children:[l.jsx(kze,{result:f[c]??null,isDeleteOperation:!!h?.delete?.event}),l.jsxs("span",{className:"text-xs font-medium",children:[l.jsx("span",{className:"text-foreground",children:c+1}),l.jsxs("span",{children:[" of ",e.length]})]}),l.jsxs(K,{className:"flex gap-2",children:[l.jsx(kee,{disabled:c===0,onClick:b}),l.jsx(Mee,{disabled:c===e.length-1,onClick:_})]})]})]}):l.jsx(K,{variant:"raised",className:"py-sm relative rounded-lg border",children:l.jsx("div",{className:"p-4 text-center",children:a({defaultMessage:"No calendar operation available",id:"Hm6yv1Uz2P"})})})});Tte.displayName="CalendarOperationStep";const Im=.03,Mze=3,Zf=A.memo(({items:e,initialDisplayCount:t=Mze,stepDelay:n=Im,isFinished:r=!1,vertical:s=!1,truncate:o=!0,onCountChange:a})=>{const[i,c]=d.useState([]),[u,f]=d.useState(!1),m=d.useRef(null),p=d.useRef(!0),h=d.useRef(r),g=d.useRef(0);d.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),d.useEffect(()=>{if(a){const C=o&&(n!==Im?r&&i.length{const w=o?t:e.length;if(p.current)if(p.current=!1,e.length>0)if(r){const C=Math.min(w,e.length);c(e.slice(0,C)),g.current=C}else c([e[0]]),g.current=1;else c([]),g.current=0;if(u){c(e),g.current=e.length;return}if(r&&!h.current&&(m.current&&(clearTimeout(m.current),m.current=null),c(()=>{const C=Math.min(w,e.length),E=e.slice(0,C);return g.current=E.length,E})),h.current=r,m.current&&(clearTimeout(m.current),m.current=null),g.current>=w||g.current>=e.length)return;const S=()=>{let C=0;if(c(E=>E.length0){const C=r?Im:n;m.current=setTimeout(S,C*1e3)}else e.length>0&&(c([e[0]]),g.current=1)},[e,t,n,r,u,o]);const y={initial:{opacity:0,x:-3},animate:{opacity:1,x:0}},x=()=>{f(!0)},b=o&&(n!==Im?r&&i.length{w.stopPropagation(),x()},[]);return l.jsxs("div",{className:`flex items-center ${s?"flex-col items-start gap-px":"gap-sm flex-wrap"}`,children:[i.map((w,S)=>l.jsx(Te.div,{className:s?"w-full":"inline-flex",variants:y,initial:"initial",animate:"animate",transition:{duration:.1,ease:Kd},children:w},S)),b&&l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs cursor-pointer rounded-lg px-2.5",onClick:_,children:l.jsx(V,{variant:"tinyMono",className:"!text-[0.68rem]",children:l.jsx(je,{defaultMessage:"+{count} more",id:"/zFGgPmQSV",values:{count:e.length-i.length}})})})]})});Zf.displayName="ResultsRenderer";const gs=A.memo(({queries:e,icon:t=B("search"),stepDelay:n,isFinished:r,initialDisplayCount:s=12,enableQueryLinks:o=!1})=>{const a=e.map((i,c)=>l.jsx(Rr,{icon:t,text:i,url:o?`/search/new?q=${encodeURIComponent(i)}`:void 0},c));return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(Zf,{items:a,initialDisplayCount:s,stepDelay:n,isFinished:r})})});gs.displayName="SearchWebStep";const Ate=A.memo(({operations:e})=>{const{$t:t,formatMessage:n}=J(),r=d.useMemo(()=>{const a={created:0,updated:0,deleted:0,rejected:0};return e.forEach(i=>{switch(i.status?.toUpperCase()){case"CREATED":a.created++;break;case"UPDATED":a.updated++;break;case"DELETED":a.deleted++;break;case"REJECTED":a.rejected++;break}}),a},[e]),s=d.useMemo(()=>{const a=[];return r.created>0&&a.push({count:r.created,label:t({defaultMessage:"Created",id:"ORGv1Q6rL/"})}),r.updated>0&&a.push({count:r.updated,label:t({defaultMessage:"Updated",id:"xrk6zgu9jU"})}),r.deleted>0&&a.push({count:r.deleted,label:t({defaultMessage:"Deleted",id:"KQvWvDRI1B"})}),r.rejected>0&&a.push({count:r.rejected,label:t({defaultMessage:"Rejected",id:"5qaD7sDVxu"})}),a},[r,t]),o=d.useMemo(()=>s.length===0?[]:[s.map(a=>n({defaultMessage:"{count} {status}",id:"e6QlErEcyz"},{count:a.count,status:a.label})).join(", ")],[s,n]);return o.length===0?null:l.jsx(gs,{icon:B("calendar"),queries:o})});Ate.displayName="CalendarStatusSummary";const Tze=()=>l.jsxs(K,{variant:Wx.subtler,className:"p-sm gap-sm flex h-[52px] w-fit min-w-[200px] items-center rounded-lg",children:[l.jsx(K,{variant:"subtler",className:"aspect-square h-full rounded-md"}),l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(K,{variant:"subtler",className:"h-1.5 w-24 rounded-full"}),l.jsx(K,{variant:"subtler",className:"h-1.5 w-16 rounded-full"})]})]}),Nte=A.memo(({assetTypes:e,assetTypeLabels:t,isFinished:n})=>{const{$t:r}=J();if(e.length===0)return l.jsxs("div",{className:"my-sm gap-sm flex flex-col",children:[l.jsx(V,{variant:"tinyRegular",color:n?"light":"super",className:"flex items-center gap-1",children:l.jsx(br,{variant:"super",active:!n,as:"span",speed:"slow",children:r({defaultMessage:"Creating an asset",id:"/gKNbCoSJB"})})}),l.jsx(Tze,{})]});const s=e[e.length-1],o=s?t[s]||s.toLowerCase():r({defaultMessage:"an asset",id:"+rur3MSgJV"});return l.jsx(St,{mode:"wait",children:l.jsx(Te.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:[.4,0,.2,1]},children:l.jsx(V,{variant:"tinyRegular",color:n?"light":"super",className:"flex items-center gap-1 py-1.5",children:l.jsx(br,{variant:"super",active:!n,as:"span",speed:"slow",children:r({defaultMessage:"Creating {assetLabel}",id:"irVMYqmEjR"},{assetLabel:o})})})},s)})});Nte.displayName="CanvasAgentStep";const Rte=A.memo(({step:e})=>{const t=e.content.clarification;return t?l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsx(Rr,{icon:B("message-plus"),text:t})}):null});Rte.displayName="ClarificationStep";var Ln="-ms-",Pp="-moz-",mn="-webkit-",Dte="comm",Qv="rule",H6="decl",Aze="@import",jte="@keyframes",Nze="@layer",Ite=Math.abs,z6=String.fromCharCode,VE=Object.assign;function Rze(e,t){return Dr(e,0)^45?(((t<<2^Dr(e,0))<<2^Dr(e,1))<<2^Dr(e,2))<<2^Dr(e,3):0}function Pte(e){return e.trim()}function ki(e,t){return(e=t.exec(e))?e[0]:e}function Vt(e,t,n){return e.replace(t,n)}function xy(e,t,n){return e.indexOf(t,n)}function Dr(e,t){return e.charCodeAt(t)|0}function tf(e,t,n){return e.slice(t,n)}function Ba(e){return e.length}function Ote(e){return e.length}function rp(e,t){return t.push(e),e}function Dze(e,t){return e.map(t).join("")}function XI(e,t){return e.filter(function(n){return!ki(n,t)})}var Xv=1,nf=1,Lte=0,Lo=0,vr=0,Jf="";function Zv(e,t,n,r,s,o,a,i){return{value:e,root:t,parent:n,type:r,props:s,children:o,line:Xv,column:nf,length:a,return:"",siblings:i}}function ml(e,t){return VE(Zv("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Bu(e){for(;e.root;)e=ml(e.root,{children:[e]});rp(e,e.siblings)}function jze(){return vr}function Ize(){return vr=Lo>0?Dr(Jf,--Lo):0,nf--,vr===10&&(nf=1,Xv--),vr}function ma(){return vr=Lo2||HE(vr)>3?"":" "}function Fze(e,t){for(;--t&&ma()&&!(vr<48||vr>102||vr>57&&vr<65||vr>70&&vr<97););return Jv(e,vy()+(t<6&&Lc()==32&&ma()==32))}function zE(e){for(;ma();)switch(vr){case e:return Lo;case 34:case 39:e!==34&&e!==39&&zE(vr);break;case 40:e===41&&zE(e);break;case 92:ma();break}return Lo}function Bze(e,t){for(;ma()&&e+vr!==57;)if(e+vr===84&&Lc()===47)break;return"/*"+Jv(t,Lo-1)+"*"+z6(e===47?e:ma())}function Uze(e){for(;!HE(Lc());)ma();return Jv(e,Lo)}function Vze(e){return Oze(by("",null,null,null,[""],e=Pze(e),0,[0],e))}function by(e,t,n,r,s,o,a,i,c){for(var u=0,f=0,m=a,p=0,h=0,g=0,y=1,x=1,v=1,b=0,_="",w=s,S=o,C=r,E=_;x;)switch(g=b,b=ma()){case 40:if(g!=108&&Dr(E,m-1)==58){xy(E+=Vt(Aw(b),"&","&\f"),"&\f",Ite(u?i[u-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:E+=Aw(b);break;case 9:case 10:case 13:case 32:E+=Lze(g);break;case 92:E+=Fze(vy()-1,7);continue;case 47:switch(Lc()){case 42:case 47:rp(Hze(Bze(ma(),vy()),t,n,c),c);break;default:E+="/"}break;case 123*y:i[u++]=Ba(E)*v;case 125*y:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+f:v==-1&&(E=Vt(E,/\f/g,"")),h>0&&Ba(E)-m&&rp(h>32?JI(E+";",r,n,m-1,c):JI(Vt(E," ","")+";",r,n,m-2,c),c);break;case 59:E+=";";default:if(rp(C=ZI(E,t,n,u,f,s,i,_,w=[],S=[],m,o),o),b===123)if(f===0)by(E,t,C,C,w,o,m,i,S);else switch(p===99&&Dr(E,3)===110?100:p){case 100:case 108:case 109:case 115:by(e,C,C,r&&rp(ZI(e,C,C,0,0,s,i,_,s,w=[],m,S),S),s,S,m,i,r?w:S);break;default:by(E,C,C,C,[""],S,0,i,S)}}u=f=h=0,y=v=1,_=E="",m=a;break;case 58:m=1+Ba(E),h=g;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&Ize()==125)continue}switch(E+=z6(b),b*y){case 38:v=f>0?1:(E+="\f",-1);break;case 44:i[u++]=(Ba(E)-1)*v,v=1;break;case 64:Lc()===45&&(E+=Aw(ma())),p=Lc(),f=m=Ba(_=E+=Uze(vy())),b++;break;case 45:g===45&&Ba(E)==2&&(y=0)}}return o}function ZI(e,t,n,r,s,o,a,i,c,u,f,m){for(var p=s-1,h=s===0?o:[""],g=Ote(h),y=0,x=0,v=0;y0?h[b]+" "+_:Vt(_,/&\f/g,h[b])))&&(c[v++]=w);return Zv(e,t,n,s===0?Qv:i,c,u,f,m)}function Hze(e,t,n,r){return Zv(e,t,n,Dte,z6(jze()),tf(e,2,-2),0,r)}function JI(e,t,n,r,s){return Zv(e,t,n,H6,tf(e,0,r),tf(e,r+1,-1),r,s)}function Fte(e,t,n){switch(Rze(e,t)){case 5103:return mn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return mn+e+e;case 4789:return Pp+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return mn+e+Pp+e+Ln+e+e;case 5936:switch(Dr(e,t+11)){case 114:return mn+e+Ln+Vt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return mn+e+Ln+Vt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return mn+e+Ln+Vt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return mn+e+Ln+e+e;case 6165:return mn+e+Ln+"flex-"+e+e;case 5187:return mn+e+Vt(e,/(\w+).+(:[^]+)/,mn+"box-$1$2"+Ln+"flex-$1$2")+e;case 5443:return mn+e+Ln+"flex-item-"+Vt(e,/flex-|-self/g,"")+(ki(e,/flex-|baseline/)?"":Ln+"grid-row-"+Vt(e,/flex-|-self/g,""))+e;case 4675:return mn+e+Ln+"flex-line-pack"+Vt(e,/align-content|flex-|-self/g,"")+e;case 5548:return mn+e+Ln+Vt(e,"shrink","negative")+e;case 5292:return mn+e+Ln+Vt(e,"basis","preferred-size")+e;case 6060:return mn+"box-"+Vt(e,"-grow","")+mn+e+Ln+Vt(e,"grow","positive")+e;case 4554:return mn+Vt(e,/([^-])(transform)/g,"$1"+mn+"$2")+e;case 6187:return Vt(Vt(Vt(e,/(zoom-|grab)/,mn+"$1"),/(image-set)/,mn+"$1"),e,"")+e;case 5495:case 3959:return Vt(e,/(image-set\([^]*)/,mn+"$1$`$1");case 4968:return Vt(Vt(e,/(.+:)(flex-)?(.*)/,mn+"box-pack:$3"+Ln+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+mn+e+e;case 4200:if(!ki(e,/flex-|baseline/))return Ln+"grid-column-align"+tf(e,t)+e;break;case 2592:case 3360:return Ln+Vt(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,s){return t=s,ki(r.props,/grid-\w+-end/)})?~xy(e+(n=n[t].value),"span",0)?e:Ln+Vt(e,"-start","")+e+Ln+"grid-row-span:"+(~xy(n,"span",0)?ki(n,/\d+/):+ki(n,/\d+/)-+ki(e,/\d+/))+";":Ln+Vt(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ki(r.props,/grid-\w+-start/)})?e:Ln+Vt(Vt(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Vt(e,/(.+)-inline(.+)/,mn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ba(e)-1-t>6)switch(Dr(e,t+1)){case 109:if(Dr(e,t+4)!==45)break;case 102:return Vt(e,/(.+:)(.+)-([^]+)/,"$1"+mn+"$2-$3$1"+Pp+(Dr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~xy(e,"stretch",0)?Fte(Vt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Vt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,s,o,a,i,c,u){return Ln+s+":"+o+u+(a?Ln+s+"-span:"+(i?c:+c-+o)+u:"")+e});case 4949:if(Dr(e,t+6)===121)return Vt(e,":",":"+mn)+e;break;case 6444:switch(Dr(e,Dr(e,14)===45?18:11)){case 120:return Vt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+mn+(Dr(e,14)===45?"inline-":"")+"box$3$1"+mn+"$2$3$1"+Ln+"$2box$3")+e;case 100:return Vt(e,":",":"+Ln)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Vt(e,"scroll-","scroll-snap-")+e}return e}function N2(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case H6:e.return=Fte(e.value,e.length,n);return;case jte:return N2([ml(e,{value:Vt(e.value,"@","@"+mn)})],r);case Qv:if(e.length)return Dze(n=e.props,function(s){switch(ki(s,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Bu(ml(e,{props:[Vt(s,/:(read-\w+)/,":"+Pp+"$1")]})),Bu(ml(e,{props:[s]})),VE(e,{props:XI(n,r)});break;case"::placeholder":Bu(ml(e,{props:[Vt(s,/:(plac\w+)/,":"+mn+"input-$1")]})),Bu(ml(e,{props:[Vt(s,/:(plac\w+)/,":"+Pp+"$1")]})),Bu(ml(e,{props:[Vt(s,/:(plac\w+)/,Ln+"input-$1")]})),Bu(ml(e,{props:[s]})),VE(e,{props:XI(n,r)});break}return""})}}var qze={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ys={},rf=typeof process<"u"&&Ys!==void 0&&(Ys.REACT_APP_SC_ATTR||Ys.SC_ATTR)||"data-styled",Bte="active",Ute="data-styled-version",eb="6.1.15",W6=`/*!sc*/ -`,R2=typeof window<"u"&&"HTMLElement"in window,Kze=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Ys!==void 0&&Ys.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Ys.REACT_APP_SC_DISABLE_SPEEDY!==""?Ys.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Ys.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Ys!==void 0&&Ys.SC_DISABLE_SPEEDY!==void 0&&Ys.SC_DISABLE_SPEEDY!==""&&Ys.SC_DISABLE_SPEEDY!=="false"&&Ys.SC_DISABLE_SPEEDY),tb=Object.freeze([]),sf=Object.freeze({});function Vte(e,t,n){return n===void 0&&(n=sf),e.theme!==n.theme&&e.theme||t||n.theme}var Hte=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Yze=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Qze=/(^-|-$)/g;function eP(e){return e.replace(Yze,"-").replace(Qze,"")}var Xze=/(a)(d)/gi,n1=52,tP=function(e){return String.fromCharCode(e+(e>25?39:97))};function WE(e){var t,n="";for(t=Math.abs(e);t>n1;t=t/n1|0)n=tP(t%n1)+n;return(tP(t%n1)+n).replace(Xze,"$1-$2")}var Nw,zte=5381,fd=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Wte=function(e){return fd(zte,e)};function Zze(e){return WE(Wte(e)>>>0)}function Gte(e){return e.displayName||e.name||"Component"}function Rw(e){return typeof e=="string"&&!0}var $te=typeof Symbol=="function"&&Symbol.for,qte=$te?Symbol.for("react.memo"):60115,Jze=$te?Symbol.for("react.forward_ref"):60112,eWe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},tWe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Kte={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nWe=((Nw={})[Jze]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Nw[qte]=Kte,Nw);function nP(e){return("type"in(t=e)&&t.type.$$typeof)===qte?Kte:"$$typeof"in e?nWe[e.$$typeof]:eWe;var t}var rWe=Object.defineProperty,sWe=Object.getOwnPropertyNames,rP=Object.getOwnPropertySymbols,oWe=Object.getOwnPropertyDescriptor,aWe=Object.getPrototypeOf,sP=Object.prototype;function G6(e,t,n){if(typeof t!="string"){if(sP){var r=aWe(t);r&&r!==sP&&G6(e,r,n)}var s=sWe(t);rP&&(s=s.concat(rP(t)));for(var o=nP(e),a=nP(t),i=0;i0?" Args: ".concat(t.join(", ")):""))}var iWe=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,s=r.length,o=s;t>=o;)if((o<<=1)<0)throw Lg(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=s;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],s=this.indexOfGroup(t),o=s+r,a=s;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(x+="".concat(v,","))}),c+="".concat(g).concat(y,'{content:"').concat(x,'"}').concat(W6)},f=0;f0?".".concat(t):p},f=c.slice();f.push(function(p){p.type===Qv&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(xWe,n).replace(r,u))}),a.prefix&&f.push($ze),f.push(zze);var m=function(p,h,g,y){h===void 0&&(h=""),g===void 0&&(g=""),y===void 0&&(y="&"),t=y,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var x=p.replace(vWe,""),v=Vze(g||h?"".concat(g," ").concat(h," { ").concat(x," }"):x);a.namespace&&(v=Xte(v,a.namespace));var b=[];return N2(v,Wze(f.concat(Gze(function(_){return b.push(_)})))),b};return m.hash=c.length?c.reduce(function(p,h){return h.name||Lg(15),fd(p,h.name)},zte).toString():"",m}var _We=new Qte,$E=bWe(),Zte=A.createContext({shouldForwardProp:void 0,styleSheet:_We,stylis:$E});Zte.Consumer;A.createContext(void 0);function lP(){return d.useContext(Zte)}var wWe=(function(){function e(t,n){var r=this;this.inject=function(s,o){o===void 0&&(o=$E);var a=r.name+o.hash;s.hasNameForId(r.id,a)||s.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,q6(this,function(){throw Lg(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=$E),this.name+t.hash},e})(),CWe=function(e){return e>="A"&&e<="Z"};function cP(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,i)}s=Nc(s,a),this.staticRulesId=a}else{for(var c=fd(this.baseHash,r.hash),u="",f=0;f>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(u,".".concat(h),void 0,this.componentId)),s=Nc(s,h)}}return s},e})(),K6=A.createContext(void 0);K6.Consumer;var Dw={};function MWe(e,t,n){var r=$6(e),s=e,o=!Rw(e),a=t.attrs,i=a===void 0?tb:a,c=t.componentId,u=c===void 0?(function(w,S){var C=typeof w!="string"?"sc":eP(w);Dw[C]=(Dw[C]||0)+1;var E="".concat(C,"-").concat(Zze(eb+C+Dw[C]));return S?"".concat(S,"-").concat(E):E})(t.displayName,t.parentComponentId):c,f=t.displayName,m=f===void 0?(function(w){return Rw(w)?"styled.".concat(w):"Styled(".concat(Gte(w),")")})(e):f,p=t.displayName&&t.componentId?"".concat(eP(t.displayName),"-").concat(t.componentId):t.componentId||u,h=r&&s.attrs?s.attrs.concat(i).filter(Boolean):i,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var y=s.shouldForwardProp;if(t.shouldForwardProp){var x=t.shouldForwardProp;g=function(w,S){return y(w,S)&&x(w,S)}}else g=y}var v=new kWe(n,p,r?s.componentStyle:void 0);function b(w,S){return(function(C,E,T){var k=C.attrs,I=C.componentStyle,M=C.defaultProps,N=C.foldedComponentIds,D=C.styledComponentId,j=C.target,F=A.useContext(K6),R=lP(),P=C.shouldForwardProp||R.shouldForwardProp,L=Vte(E,F,M)||sf,U=(function(Y,te,se){for(var ae,X=no(no({},te),{className:void 0,theme:se}),ee=0;eee.length)&&(t=e.length);for(var n=0,r=Array(t);n=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var jw={};function LWe(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return jw[t]||(jw[t]=OWe(e)),jw[t]}function FWe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter(function(o){return o!=="token"}),s=LWe(r);return s.reduce(function(o,a){return md(md({},o),n[a])},t)}function mP(e){return e.join(" ")}function BWe(e,t){var n=0;return function(r){return n+=1,r.map(function(s,o){return rne({node:s,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})})}}function rne(e){var t=e.node,n=e.stylesheet,r=e.style,s=r===void 0?{}:r,o=e.useInlineStyles,a=e.key,i=t.properties,c=t.type,u=t.tagName,f=t.value;if(c==="text")return f;if(u){var m=BWe(n,o),p;if(!o)p=md(md({},i),{},{className:mP(i.className)});else{var h=Object.keys(n).reduce(function(v,b){return b.split(".").forEach(function(_){v.includes(_)||v.push(_)}),v},[]),g=i.className&&i.className.includes("token")?["token"]:[],y=i.className&&g.concat(i.className.filter(function(v){return!h.includes(v)}));p=md(md({},i),{},{className:mP(y)||void 0,style:FWe(i.className,Object.assign({},i.style,s),n)})}var x=m(t.children);return A.createElement(u,ph({key:a},p),x)}}const UWe=(function(e,t){var n=e.listLanguages();return n.indexOf(t)!==-1});var VWe=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function pP(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 Sl(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r2&&arguments[2]!==void 0?arguments[2]:[];return Cy({children:S,lineNumber:C,lineNumberStyle:i,largestLineNumber:a,showInlineLineNumbers:s,lineProps:n,className:E,showLineNumbers:r,wrapLongLines:c,wrapLines:t})}function y(S,C){if(r&&C&&s){var E=one(i,C,a);S.unshift(sne(C,E))}return S}function x(S,C){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||E.length>0?g(S,C,E):y(S,C)}for(var v=function(){var C=f[h],E=C.children[0].value,T=zWe(E);if(T){var k=E.split(` -`);k.forEach(function(I,M){var N=r&&m.length+o,D={type:"text",value:"".concat(I,` -`)};if(M===0){var j=f.slice(p+1,h).concat(Cy({children:[D],className:C.properties.className})),F=x(j,N);m.push(F)}else if(M===k.length-1){var R=f[h+1]&&f[h+1].children&&f[h+1].children[0],P={type:"text",value:"".concat(I)};if(R){var L=Cy({children:[P],className:C.properties.className});f.splice(h+1,0,L)}else{var U=[P],O=x(U,N,C.properties.className);m.push(O)}}else{var $=[D],G=x($,N,C.properties.className);m.push(G)}}),p=h}h++};h=0;--O){var $=this.tryEntries[O],G=$.completion;if($.tryLoc==="root")return U("end");if($.tryLoc<=this.prev){var H=r.call($,"catchLoc"),Q=r.call($,"finallyLoc");if(H&&Q){if(this.prev<$.catchLoc)return U($.catchLoc,!0);if(this.prev<$.finallyLoc)return U($.finallyLoc)}else if(H){if(this.prev<$.catchLoc)return U($.catchLoc,!0)}else{if(!Q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return U($.finallyLoc)}}}},abrupt:function(P,L){for(var U=this.tryEntries.length-1;U>=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev=0;--L){var U=this.tryEntries[L];if(U.finallyLoc===P)return this.complete(U.completion,U.afterLoc),D(U),x}},catch:function(P){for(var L=this.tryEntries.length-1;L>=0;--L){var U=this.tryEntries[L];if(U.tryLoc===P){var O=U.completion;if(O.type==="throw"){var $=O.arg;D(U)}return $}}throw Error("illegal catch attempt")},delegateYield:function(P,L,U){return this.delegate={iterator:F(P),resultName:L,nextLoc:U},this.method==="next"&&(this.arg=e),x}},t}function nGe(e,t,n){return t=j2(t),eGe(e,cne()?Reflect.construct(t,n||[],j2(e).constructor):t.apply(e,n))}function cne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cne=function(){return!!e})()}const rGe=(function(e){var t,n=e.loader,r=e.isLanguageRegistered,s=e.registerLanguage,o=e.languageLoaders,a=e.noAsyncLoadingLanguages,i=(function(c){function u(){return XWe(this,u),nGe(this,u,arguments)}return tGe(u,c),ZWe(u,[{key:"componentDidUpdate",value:function(){!u.isRegistered(this.props.language)&&o&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var m=this;u.astGeneratorPromise||u.loadAstGenerator(),u.astGenerator||u.astGeneratorPromise.then(function(){m.forceUpdate()}),!u.isRegistered(this.props.language)&&o&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var m=this,p=this.props.language;p!=="text"&&u.loadLanguage(p).then(function(){return m.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(m){return u.isSupportedLanguage(m)?m:"text"}},{key:"render",value:function(){return A.createElement(u.highlightInstance,ph({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:u.astGenerator}))}}],[{key:"preload",value:function(){return u.loadAstGenerator()}},{key:"loadLanguage",value:(function(){var f=lne(XE().mark(function p(h){var g;return XE().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(g=o[h],typeof g!="function"){x.next=5;break}return x.abrupt("return",g(u.registerLanguage));case 5:throw new Error("Language ".concat(h," not supported"));case 6:case"end":return x.stop()}},p)}));function m(p){return f.apply(this,arguments)}return m})()},{key:"isSupportedLanguage",value:function(m){return u.isRegistered(m)||typeof o[m]=="function"}},{key:"loadAstGenerator",value:function(){return u.astGeneratorPromise=n().then(function(m){u.astGenerator=m,s&&u.languages.forEach(function(p,h){return s(m,h,p)})}),u.astGeneratorPromise}}])})(A.PureComponent);return t=i,Mi(i,"astGenerator",null),Mi(i,"highlightInstance",QWe(null,{})),Mi(i,"astGeneratorPromise",null),Mi(i,"languages",new Map),Mi(i,"supportedLanguages",e.supportedLanguages||Object.keys(o||{})),Mi(i,"isRegistered",function(c){if(a)return!0;if(!s)throw new Error("Current syntax highlighter doesn't support registration of languages");return t.astGenerator?r(t.astGenerator,c):t.languages.has(c)}),Mi(i,"registerLanguage",function(c,u){if(!s)throw new Error("Current syntax highlighter doesn't support registration of languages");if(t.astGenerator)return s(t.astGenerator,c,u);t.languages.set(c,u)}),i});function ZE(){ZE=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(R,P,L){R[P]=L.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(R,P,L){return Object.defineProperty(R,P,{value:L,enumerable:!0,configurable:!0,writable:!0}),R[P]}try{u({},"")}catch{u=function(L,U,O){return L[U]=O}}function f(R,P,L,U){var O=P&&P.prototype instanceof v?P:v,$=Object.create(O.prototype),G=new j(U||[]);return s($,"_invoke",{value:I(R,L,G)}),$}function m(R,P,L){try{return{type:"normal",arg:R.call(P,L)}}catch(U){return{type:"throw",arg:U}}}t.wrap=f;var p="suspendedStart",h="suspendedYield",g="executing",y="completed",x={};function v(){}function b(){}function _(){}var w={};u(w,a,function(){return this});var S=Object.getPrototypeOf,C=S&&S(S(F([])));C&&C!==n&&r.call(C,a)&&(w=C);var E=_.prototype=v.prototype=Object.create(w);function T(R){["next","throw","return"].forEach(function(P){u(R,P,function(L){return this._invoke(P,L)})})}function k(R,P){function L(O,$,G,H){var Q=m(R[O],R,$);if(Q.type!=="throw"){var Y=Q.arg,te=Y.value;return te&&oi(te)=="object"&&r.call(te,"__await")?P.resolve(te.__await).then(function(se){L("next",se,G,H)},function(se){L("throw",se,G,H)}):P.resolve(te).then(function(se){Y.value=se,G(Y)},function(se){return L("throw",se,G,H)})}H(Q.arg)}var U;s(this,"_invoke",{value:function($,G){function H(){return new P(function(Q,Y){L($,G,Q,Y)})}return U=U?U.then(H,H):H()}})}function I(R,P,L){var U=p;return function(O,$){if(U===g)throw Error("Generator is already running");if(U===y){if(O==="throw")throw $;return{value:e,done:!0}}for(L.method=O,L.arg=$;;){var G=L.delegate;if(G){var H=M(G,L);if(H){if(H===x)continue;return H}}if(L.method==="next")L.sent=L._sent=L.arg;else if(L.method==="throw"){if(U===p)throw U=y,L.arg;L.dispatchException(L.arg)}else L.method==="return"&&L.abrupt("return",L.arg);U=g;var Q=m(R,P,L);if(Q.type==="normal"){if(U=L.done?y:h,Q.arg===x)continue;return{value:Q.arg,done:L.done}}Q.type==="throw"&&(U=y,L.method="throw",L.arg=Q.arg)}}}function M(R,P){var L=P.method,U=R.iterator[L];if(U===e)return P.delegate=null,L==="throw"&&R.iterator.return&&(P.method="return",P.arg=e,M(R,P),P.method==="throw")||L!=="return"&&(P.method="throw",P.arg=new TypeError("The iterator does not provide a '"+L+"' method")),x;var O=m(U,R.iterator,P.arg);if(O.type==="throw")return P.method="throw",P.arg=O.arg,P.delegate=null,x;var $=O.arg;return $?$.done?(P[R.resultName]=$.value,P.next=R.nextLoc,P.method!=="return"&&(P.method="next",P.arg=e),P.delegate=null,x):$:(P.method="throw",P.arg=new TypeError("iterator result is not an object"),P.delegate=null,x)}function N(R){var P={tryLoc:R[0]};1 in R&&(P.catchLoc=R[1]),2 in R&&(P.finallyLoc=R[2],P.afterLoc=R[3]),this.tryEntries.push(P)}function D(R){var P=R.completion||{};P.type="normal",delete P.arg,R.completion=P}function j(R){this.tryEntries=[{tryLoc:"root"}],R.forEach(N,this),this.reset(!0)}function F(R){if(R||R===""){var P=R[a];if(P)return P.call(R);if(typeof R.next=="function")return R;if(!isNaN(R.length)){var L=-1,U=function O(){for(;++L=0;--O){var $=this.tryEntries[O],G=$.completion;if($.tryLoc==="root")return U("end");if($.tryLoc<=this.prev){var H=r.call($,"catchLoc"),Q=r.call($,"finallyLoc");if(H&&Q){if(this.prev<$.catchLoc)return U($.catchLoc,!0);if(this.prev<$.finallyLoc)return U($.finallyLoc)}else if(H){if(this.prev<$.catchLoc)return U($.catchLoc,!0)}else{if(!Q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return U($.finallyLoc)}}}},abrupt:function(P,L){for(var U=this.tryEntries.length-1;U>=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev=0;--L){var U=this.tryEntries[L];if(U.finallyLoc===P)return this.complete(U.completion,U.afterLoc),D(U),x}},catch:function(P){for(var L=this.tryEntries.length-1;L>=0;--L){var U=this.tryEntries[L];if(U.tryLoc===P){var O=U.completion;if(O.type==="throw"){var $=O.arg;D(U)}return $}}throw Error("illegal catch attempt")},delegateYield:function(P,L,U){return this.delegate={iterator:F(P),resultName:L,nextLoc:U},this.method==="next"&&(this.arg=e),x}},t}const ne=(function(e,t){return(function(){var n=lne(ZE().mark(function r(s){var o;return ZE().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,t();case 2:o=i.sent,s(e,o.default||o);case 4:case"end":return i.stop()}},r)}));return function(r){return n.apply(this,arguments)}})()}),sGe={abap:ne("abap",function(){return q(()=>import("./abap-BiKYM7nu.js").then(e=>e.a),__vite__mapDeps([154,1]))}),abnf:ne("abnf",function(){return q(()=>import("./abnf-8KHBl4SU.js").then(e=>e.a),__vite__mapDeps([155,1]))}),actionscript:ne("actionscript",function(){return q(()=>import("./actionscript-BDfgnI_2.js").then(e=>e.a),__vite__mapDeps([156,1]))}),ada:ne("ada",function(){return q(()=>import("./ada-pT0wE1jT.js").then(e=>e.a),__vite__mapDeps([157,1]))}),agda:ne("agda",function(){return q(()=>import("./agda-BVgYyS_B.js").then(e=>e.a),__vite__mapDeps([158,1]))}),al:ne("al",function(){return q(()=>import("./al-DYI_knPF.js").then(e=>e.a),__vite__mapDeps([159,1]))}),antlr4:ne("antlr4",function(){return q(()=>import("./antlr4-Dcs8y6-e.js").then(e=>e.a),__vite__mapDeps([160,1]))}),apacheconf:ne("apacheconf",function(){return q(()=>import("./apacheconf-BeuGc_UW.js").then(e=>e.a),__vite__mapDeps([161,1]))}),apex:ne("apex",function(){return q(()=>import("./apex-C46QKnqF.js").then(e=>e.a),__vite__mapDeps([162,1,163]))}),apl:ne("apl",function(){return q(()=>import("./apl-D3CFL3-O.js").then(e=>e.a),__vite__mapDeps([164,1]))}),applescript:ne("applescript",function(){return q(()=>import("./applescript-UKM8t7IT.js").then(e=>e.a),__vite__mapDeps([165,1]))}),aql:ne("aql",function(){return q(()=>import("./aql-JdJXKSA1.js").then(e=>e.a),__vite__mapDeps([166,1]))}),arduino:ne("arduino",function(){return q(()=>import("./arduino-Cgk25tM9.js").then(e=>e.a),__vite__mapDeps([167,1,168,169]))}),arff:ne("arff",function(){return q(()=>import("./arff-BvtRHTjx.js").then(e=>e.a),__vite__mapDeps([170,1]))}),asciidoc:ne("asciidoc",function(){return q(()=>import("./asciidoc-hH46k-cj.js").then(e=>e.a),__vite__mapDeps([171,1]))}),asm6502:ne("asm6502",function(){return q(()=>import("./asm6502-Ce01JAP9.js").then(e=>e.a),__vite__mapDeps([172,1]))}),asmatmel:ne("asmatmel",function(){return q(()=>import("./asmatmel-73kokPNV.js").then(e=>e.a),__vite__mapDeps([173,1]))}),aspnet:ne("aspnet",function(){return q(()=>import("./aspnet-DSiaQID1.js").then(e=>e.a),__vite__mapDeps([174,1,175]))}),autohotkey:ne("autohotkey",function(){return q(()=>import("./autohotkey-B_uQtKf0.js").then(e=>e.a),__vite__mapDeps([176,1]))}),autoit:ne("autoit",function(){return q(()=>import("./autoit-EdcKUAIu.js").then(e=>e.a),__vite__mapDeps([177,1]))}),avisynth:ne("avisynth",function(){return q(()=>import("./avisynth-B5LB8Vdx.js").then(e=>e.a),__vite__mapDeps([178,1]))}),avroIdl:ne("avroIdl",function(){return q(()=>import("./avro-idl-DFr56LZ2.js").then(e=>e.a),__vite__mapDeps([179,1]))}),bash:ne("bash",function(){return q(()=>import("./bash-DmK8JH5Y.js").then(e=>e.b),__vite__mapDeps([180,1,181]))}),basic:ne("basic",function(){return q(()=>import("./basic-GQNZVm0I.js").then(e=>e.b),__vite__mapDeps([182,1,183]))}),batch:ne("batch",function(){return q(()=>import("./batch-q5qLUxNp.js").then(e=>e.b),__vite__mapDeps([184,1]))}),bbcode:ne("bbcode",function(){return q(()=>import("./bbcode-DIQpPCpQ.js").then(e=>e.b),__vite__mapDeps([185,1]))}),bicep:ne("bicep",function(){return q(()=>import("./bicep-43qgYCRB.js").then(e=>e.b),__vite__mapDeps([186,1]))}),birb:ne("birb",function(){return q(()=>import("./birb-WL4Wzs1I.js").then(e=>e.b),__vite__mapDeps([187,1]))}),bison:ne("bison",function(){return q(()=>import("./bison-DgNGY4MZ.js").then(e=>e.b),__vite__mapDeps([188,1,169]))}),bnf:ne("bnf",function(){return q(()=>import("./bnf-CwU415oh.js").then(e=>e.b),__vite__mapDeps([189,1]))}),brainfuck:ne("brainfuck",function(){return q(()=>import("./brainfuck-BRUtMqwa.js").then(e=>e.b),__vite__mapDeps([190,1]))}),brightscript:ne("brightscript",function(){return q(()=>import("./brightscript-CvEhDk7S.js").then(e=>e.b),__vite__mapDeps([191,1]))}),bro:ne("bro",function(){return q(()=>import("./bro-CqltG-l9.js").then(e=>e.b),__vite__mapDeps([192,1]))}),bsl:ne("bsl",function(){return q(()=>import("./bsl-DUqbypHr.js").then(e=>e.b),__vite__mapDeps([193,1]))}),c:ne("c",function(){return q(()=>import("./c-N_EB2bYK.js").then(e=>e.c),__vite__mapDeps([194,1,169]))}),cfscript:ne("cfscript",function(){return q(()=>import("./cfscript-CeuFWGtU.js").then(e=>e.c),__vite__mapDeps([195,1]))}),chaiscript:ne("chaiscript",function(){return q(()=>import("./chaiscript-YpFdQwm4.js").then(e=>e.c),__vite__mapDeps([196,1,168,169]))}),cil:ne("cil",function(){return q(()=>import("./cil-BTpaFQxw.js").then(e=>e.c),__vite__mapDeps([197,1]))}),clike:ne("clike",function(){return q(()=>import("./clike-C0ZDHdrY.js").then(e=>e.c),__vite__mapDeps([198,1,199]))}),clojure:ne("clojure",function(){return q(()=>import("./clojure-nHglC_Wr.js").then(e=>e.c),__vite__mapDeps([200,1]))}),cmake:ne("cmake",function(){return q(()=>import("./cmake-CkGrNXqP.js").then(e=>e.c),__vite__mapDeps([201,1]))}),cobol:ne("cobol",function(){return q(()=>import("./cobol-CpeWJsGx.js").then(e=>e.c),__vite__mapDeps([202,1]))}),coffeescript:ne("coffeescript",function(){return q(()=>import("./coffeescript-BmyGALDp.js").then(e=>e.c),__vite__mapDeps([203,1]))}),concurnas:ne("concurnas",function(){return q(()=>import("./concurnas-AGPXgTy3.js").then(e=>e.c),__vite__mapDeps([204,1]))}),coq:ne("coq",function(){return q(()=>import("./coq-B1vh1X6h.js").then(e=>e.c),__vite__mapDeps([205,1]))}),cpp:ne("cpp",function(){return q(()=>import("./cpp-BrdR8lzA.js").then(e=>e.c),__vite__mapDeps([206,1,168,169]))}),crystal:ne("crystal",function(){return q(()=>import("./crystal-DMB1xqN1.js").then(e=>e.c),__vite__mapDeps([207,1,208]))}),csharp:ne("csharp",function(){return q(()=>import("./csharp-Dz-Duhoj.js").then(e=>e.c),__vite__mapDeps([209,1,175]))}),cshtml:ne("cshtml",function(){return q(()=>import("./cshtml-Dao_x5sm.js").then(e=>e.c),__vite__mapDeps([210,1,175]))}),csp:ne("csp",function(){return q(()=>import("./csp-rN0ct5mE.js").then(e=>e.c),__vite__mapDeps([211,1]))}),cssExtras:ne("cssExtras",function(){return q(()=>import("./css-extras-CH38hCE0.js").then(e=>e.c),__vite__mapDeps([212,1]))}),css:ne("css",function(){return q(()=>import("./css-C3pUjfuw.js").then(e=>e.c),__vite__mapDeps([213,1,214]))}),csv:ne("csv",function(){return q(()=>import("./csv-CMjGkfuc.js").then(e=>e.c),__vite__mapDeps([215,1]))}),cypher:ne("cypher",function(){return q(()=>import("./cypher-BSXied6R.js").then(e=>e.c),__vite__mapDeps([216,1]))}),d:ne("d",function(){return q(()=>import("./d-7giuCMwV.js").then(e=>e.d),__vite__mapDeps([217,1]))}),dart:ne("dart",function(){return q(()=>import("./dart-f2r0fR5P.js").then(e=>e.d),__vite__mapDeps([218,1]))}),dataweave:ne("dataweave",function(){return q(()=>import("./dataweave-BNTQwt_0.js").then(e=>e.d),__vite__mapDeps([219,1]))}),dax:ne("dax",function(){return q(()=>import("./dax-9u0VVHGx.js").then(e=>e.d),__vite__mapDeps([220,1]))}),dhall:ne("dhall",function(){return q(()=>import("./dhall-BnOlrm1O.js").then(e=>e.d),__vite__mapDeps([221,1]))}),diff:ne("diff",function(){return q(()=>import("./diff-CbyOnxIb.js").then(e=>e.d),__vite__mapDeps([222,1]))}),django:ne("django",function(){return q(()=>import("./django-BoROLrA7.js").then(e=>e.d),__vite__mapDeps([223,1,224]))}),dnsZoneFile:ne("dnsZoneFile",function(){return q(()=>import("./dns-zone-file-BZz70gag.js").then(e=>e.d),__vite__mapDeps([225,1]))}),docker:ne("docker",function(){return q(()=>import("./docker-DDluW8dt.js").then(e=>e.d),__vite__mapDeps([226,1]))}),dot:ne("dot",function(){return q(()=>import("./dot-qujU4Da1.js").then(e=>e.d),__vite__mapDeps([227,1]))}),ebnf:ne("ebnf",function(){return q(()=>import("./ebnf-CcQ_JImo.js").then(e=>e.e),__vite__mapDeps([228,1]))}),editorconfig:ne("editorconfig",function(){return q(()=>import("./editorconfig-BbwhooPy.js").then(e=>e.e),__vite__mapDeps([229,1]))}),eiffel:ne("eiffel",function(){return q(()=>import("./eiffel-B3J5PQxF.js").then(e=>e.e),__vite__mapDeps([230,1]))}),ejs:ne("ejs",function(){return q(()=>import("./ejs-W0BSwUjI.js").then(e=>e.e),__vite__mapDeps([231,1,224]))}),elixir:ne("elixir",function(){return q(()=>import("./elixir-DP_8UBXK.js").then(e=>e.e),__vite__mapDeps([232,1]))}),elm:ne("elm",function(){return q(()=>import("./elm-iqtDCABP.js").then(e=>e.e),__vite__mapDeps([233,1]))}),erb:ne("erb",function(){return q(()=>import("./erb-deIh2UEF.js").then(e=>e.e),__vite__mapDeps([234,1,208,224]))}),erlang:ne("erlang",function(){return q(()=>import("./erlang-4tX_bnUx.js").then(e=>e.e),__vite__mapDeps([235,1]))}),etlua:ne("etlua",function(){return q(()=>import("./etlua-CWJxZlBl.js").then(e=>e.e),__vite__mapDeps([236,1,237,224]))}),excelFormula:ne("excelFormula",function(){return q(()=>import("./excel-formula-BQj21DBh.js").then(e=>e.e),__vite__mapDeps([238,1]))}),factor:ne("factor",function(){return q(()=>import("./factor-BH7igz5o.js").then(e=>e.f),__vite__mapDeps([239,1]))}),falselang:ne("falselang",function(){return q(()=>import("./false-Qh-wnXyD.js").then(e=>e._),__vite__mapDeps([240,1]))}),firestoreSecurityRules:ne("firestoreSecurityRules",function(){return q(()=>import("./firestore-security-rules-CKhRlNBp.js").then(e=>e.f),__vite__mapDeps([241,1]))}),flow:ne("flow",function(){return q(()=>import("./flow-DJdu3gfB.js").then(e=>e.f),__vite__mapDeps([242,1]))}),fortran:ne("fortran",function(){return q(()=>import("./fortran-BHu4hUHY.js").then(e=>e.f),__vite__mapDeps([243,1]))}),fsharp:ne("fsharp",function(){return q(()=>import("./fsharp-BiNyUor_.js").then(e=>e.f),__vite__mapDeps([244,1]))}),ftl:ne("ftl",function(){return q(()=>import("./ftl-D6bVz-y_.js").then(e=>e.f),__vite__mapDeps([245,1,224]))}),gap:ne("gap",function(){return q(()=>import("./gap-DjhzPH1Z.js").then(e=>e.g),__vite__mapDeps([246,1]))}),gcode:ne("gcode",function(){return q(()=>import("./gcode-DJBtEOur.js").then(e=>e.g),__vite__mapDeps([247,1]))}),gdscript:ne("gdscript",function(){return q(()=>import("./gdscript-C_X-7y6o.js").then(e=>e.g),__vite__mapDeps([248,1]))}),gedcom:ne("gedcom",function(){return q(()=>import("./gedcom-CH5a7-zs.js").then(e=>e.g),__vite__mapDeps([249,1]))}),gherkin:ne("gherkin",function(){return q(()=>import("./gherkin-CLD9Z44w.js").then(e=>e.g),__vite__mapDeps([250,1]))}),git:ne("git",function(){return q(()=>import("./git-DirbeLrE.js").then(e=>e.g),__vite__mapDeps([251,1]))}),glsl:ne("glsl",function(){return q(()=>import("./glsl-DwU_K1Bf.js").then(e=>e.g),__vite__mapDeps([252,1,169]))}),gml:ne("gml",function(){return q(()=>import("./gml-CQQxmZvv.js").then(e=>e.g),__vite__mapDeps([253,1]))}),gn:ne("gn",function(){return q(()=>import("./gn-wrWPxerG.js").then(e=>e.g),__vite__mapDeps([254,1]))}),goModule:ne("goModule",function(){return q(()=>import("./go-module-CjFP3WFY.js").then(e=>e.g),__vite__mapDeps([255,1]))}),go:ne("go",function(){return q(()=>import("./go-ZYzi8OLl.js").then(e=>e.g),__vite__mapDeps([256,1]))}),graphql:ne("graphql",function(){return q(()=>import("./graphql-BcLwhGtH.js").then(e=>e.g),__vite__mapDeps([257,1]))}),groovy:ne("groovy",function(){return q(()=>import("./groovy-DumHeXpg.js").then(e=>e.g),__vite__mapDeps([258,1]))}),haml:ne("haml",function(){return q(()=>import("./haml-CqSzOsbr.js").then(e=>e.h),__vite__mapDeps([259,1,208]))}),handlebars:ne("handlebars",function(){return q(()=>import("./handlebars-Bry2_rsG.js").then(e=>e.h),__vite__mapDeps([260,1,224]))}),haskell:ne("haskell",function(){return q(()=>import("./haskell-yUNIp-7d.js").then(e=>e.h),__vite__mapDeps([261,1,262]))}),haxe:ne("haxe",function(){return q(()=>import("./haxe-Dp4DyQmv.js").then(e=>e.h),__vite__mapDeps([263,1]))}),hcl:ne("hcl",function(){return q(()=>import("./hcl-B5qkLEyl.js").then(e=>e.h),__vite__mapDeps([264,1]))}),hlsl:ne("hlsl",function(){return q(()=>import("./hlsl-DrSY44_J.js").then(e=>e.h),__vite__mapDeps([265,1,169]))}),hoon:ne("hoon",function(){return q(()=>import("./hoon-CkQC4q2d.js").then(e=>e.h),__vite__mapDeps([266,1]))}),hpkp:ne("hpkp",function(){return q(()=>import("./hpkp-riVsYbz6.js").then(e=>e.h),__vite__mapDeps([267,1]))}),hsts:ne("hsts",function(){return q(()=>import("./hsts-DpYC61yC.js").then(e=>e.h),__vite__mapDeps([268,1]))}),http:ne("http",function(){return q(()=>import("./http-Dx-uCaT1.js").then(e=>e.h),__vite__mapDeps([269,1]))}),ichigojam:ne("ichigojam",function(){return q(()=>import("./ichigojam-B7XQrlmu.js").then(e=>e.i),__vite__mapDeps([270,1]))}),icon:ne("icon",function(){return q(()=>import("./icon-fmySfNA1.js").then(e=>e.i),__vite__mapDeps([271,1]))}),icuMessageFormat:ne("icuMessageFormat",function(){return q(()=>import("./icu-message-format-Oq1AuWLS.js").then(e=>e.i),__vite__mapDeps([272,1]))}),idris:ne("idris",function(){return q(()=>import("./idris-BBQY5hR_.js").then(e=>e.i),__vite__mapDeps([273,1,262]))}),iecst:ne("iecst",function(){return q(()=>import("./iecst-BXBc121A.js").then(e=>e.i),__vite__mapDeps([274,1]))}),ignore:ne("ignore",function(){return q(()=>import("./ignore-Btt-DzVm.js").then(e=>e.i),__vite__mapDeps([275,1]))}),inform7:ne("inform7",function(){return q(()=>import("./inform7-BOWBWzGd.js").then(e=>e.i),__vite__mapDeps([276,1]))}),ini:ne("ini",function(){return q(()=>import("./ini--jhBb2pg.js").then(e=>e.i),__vite__mapDeps([277,1]))}),io:ne("io",function(){return q(()=>import("./io-D2xfJyua.js").then(e=>e.i),__vite__mapDeps([278,1]))}),j:ne("j",function(){return q(()=>import("./j-DzsdI1Bx.js").then(e=>e.j),__vite__mapDeps([279,1]))}),java:ne("java",function(){return q(()=>import("./java-s-m7kerV.js").then(e=>e.j),__vite__mapDeps([280,1,281]))}),javadoc:ne("javadoc",function(){return q(()=>import("./javadoc-BjkiGsEF.js").then(e=>e.j),__vite__mapDeps([282,1,281,283]))}),javadoclike:ne("javadoclike",function(){return q(()=>import("./javadoclike-DCDpBfFy.js").then(e=>e.j),__vite__mapDeps([284,1,283]))}),javascript:ne("javascript",function(){return q(()=>import("./javascript-C5bRWOCC.js").then(e=>e.j),__vite__mapDeps([285,1,286]))}),javastacktrace:ne("javastacktrace",function(){return q(()=>import("./javastacktrace-D8SvwBYG.js").then(e=>e.j),__vite__mapDeps([287,1]))}),jexl:ne("jexl",function(){return q(()=>import("./jexl-CuibVysa.js").then(e=>e.j),__vite__mapDeps([288,1]))}),jolie:ne("jolie",function(){return q(()=>import("./jolie-G2r1IH4x.js").then(e=>e.j),__vite__mapDeps([289,1]))}),jq:ne("jq",function(){return q(()=>import("./jq-CSp-T5V6.js").then(e=>e.j),__vite__mapDeps([290,1]))}),jsExtras:ne("jsExtras",function(){return q(()=>import("./js-extras-DzfpmWre.js").then(e=>e.j),__vite__mapDeps([291,1]))}),jsTemplates:ne("jsTemplates",function(){return q(()=>import("./js-templates-deUmuJZ-.js").then(e=>e.j),__vite__mapDeps([292,1]))}),jsdoc:ne("jsdoc",function(){return q(()=>import("./jsdoc-CzzeaHoB.js").then(e=>e.j),__vite__mapDeps([293,1,283,294]))}),json:ne("json",function(){return q(()=>import("./json-DkUPYY4u.js").then(e=>e.j),__vite__mapDeps([295,1,296]))}),json5:ne("json5",function(){return q(()=>import("./json5-kaAIKBom.js").then(e=>e.j),__vite__mapDeps([297,1,296]))}),jsonp:ne("jsonp",function(){return q(()=>import("./jsonp-NFZGtYU-.js").then(e=>e.j),__vite__mapDeps([298,1,296]))}),jsstacktrace:ne("jsstacktrace",function(){return q(()=>import("./jsstacktrace-z4GMPjy-.js").then(e=>e.j),__vite__mapDeps([299,1]))}),jsx:ne("jsx",function(){return q(()=>import("./jsx-CHRn7QrA.js").then(e=>e.j),__vite__mapDeps([300,1,301]))}),julia:ne("julia",function(){return q(()=>import("./julia-CtD-2MpL.js").then(e=>e.j),__vite__mapDeps([302,1]))}),keepalived:ne("keepalived",function(){return q(()=>import("./keepalived-CFt0jL3j.js").then(e=>e.k),__vite__mapDeps([303,1]))}),keyman:ne("keyman",function(){return q(()=>import("./keyman-B9DoVDwq.js").then(e=>e.k),__vite__mapDeps([304,1]))}),kotlin:ne("kotlin",function(){return q(()=>import("./kotlin-Dq-NDvL5.js").then(e=>e.k),__vite__mapDeps([305,1]))}),kumir:ne("kumir",function(){return q(()=>import("./kumir-CJqEisv6.js").then(e=>e.k),__vite__mapDeps([306,1]))}),kusto:ne("kusto",function(){return q(()=>import("./kusto-BgQKkaWx.js").then(e=>e.k),__vite__mapDeps([307,1]))}),latex:ne("latex",function(){return q(()=>import("./latex-BT8SOs-A.js").then(e=>e.l),__vite__mapDeps([308,1]))}),latte:ne("latte",function(){return q(()=>import("./latte-C8JT4Qb7.js").then(e=>e.l),__vite__mapDeps([309,1,224,310]))}),less:ne("less",function(){return q(()=>import("./less-BD_NHSLb.js").then(e=>e.l),__vite__mapDeps([311,1]))}),lilypond:ne("lilypond",function(){return q(()=>import("./lilypond-AQaE6Na0.js").then(e=>e.l),__vite__mapDeps([312,1,313]))}),liquid:ne("liquid",function(){return q(()=>import("./liquid-y7RSJ3Wl.js").then(e=>e.l),__vite__mapDeps([314,1,224]))}),lisp:ne("lisp",function(){return q(()=>import("./lisp-BC_0scWg.js").then(e=>e.l),__vite__mapDeps([315,1]))}),livescript:ne("livescript",function(){return q(()=>import("./livescript-iy-NHZ_h.js").then(e=>e.l),__vite__mapDeps([316,1]))}),llvm:ne("llvm",function(){return q(()=>import("./llvm-BfiEgsxO.js").then(e=>e.l),__vite__mapDeps([317,1]))}),log:ne("log",function(){return q(()=>import("./log-cps16LLM.js").then(e=>e.l),__vite__mapDeps([318,1]))}),lolcode:ne("lolcode",function(){return q(()=>import("./lolcode-3zmtClDS.js").then(e=>e.l),__vite__mapDeps([319,1]))}),lua:ne("lua",function(){return q(()=>import("./lua-DI565xS0.js").then(e=>e.l),__vite__mapDeps([320,1,237]))}),magma:ne("magma",function(){return q(()=>import("./magma-ba7Qn7K1.js").then(e=>e.m),__vite__mapDeps([321,1]))}),makefile:ne("makefile",function(){return q(()=>import("./makefile-BqSQ4nmN.js").then(e=>e.m),__vite__mapDeps([322,1]))}),markdown:ne("markdown",function(){return q(()=>import("./markdown-Cze8MKhj.js").then(e=>e.m),__vite__mapDeps([323,1]))}),markupTemplating:ne("markupTemplating",function(){return q(()=>import("./markup-templating-C-QmJhjg.js").then(e=>e.m),__vite__mapDeps([324,1,224]))}),markup:ne("markup",function(){return q(()=>import("./markup-Dt-xKA80.js").then(e=>e.m),__vite__mapDeps([325,1,326]))}),matlab:ne("matlab",function(){return q(()=>import("./matlab-CacUYSDq.js").then(e=>e.m),__vite__mapDeps([327,1]))}),maxscript:ne("maxscript",function(){return q(()=>import("./maxscript-Cm15dTB4.js").then(e=>e.m),__vite__mapDeps([328,1]))}),mel:ne("mel",function(){return q(()=>import("./mel-BFRmaBUW.js").then(e=>e.m),__vite__mapDeps([329,1]))}),mermaid:ne("mermaid",function(){return q(()=>import("./mermaid-_TlUmfQf.js").then(e=>e.m),__vite__mapDeps([330,1]))}),mizar:ne("mizar",function(){return q(()=>import("./mizar-BoN7zgqH.js").then(e=>e.m),__vite__mapDeps([331,1]))}),mongodb:ne("mongodb",function(){return q(()=>import("./mongodb-Do1oT-rg.js").then(e=>e.m),__vite__mapDeps([332,1]))}),monkey:ne("monkey",function(){return q(()=>import("./monkey-DS3nr7fk.js").then(e=>e.m),__vite__mapDeps([333,1]))}),moonscript:ne("moonscript",function(){return q(()=>import("./moonscript-Cwqh5x__.js").then(e=>e.m),__vite__mapDeps([334,1]))}),n1ql:ne("n1ql",function(){return q(()=>import("./n1ql-BgI_6bQf.js").then(e=>e.n),__vite__mapDeps([335,1]))}),n4js:ne("n4js",function(){return q(()=>import("./n4js-oXh14UQA.js").then(e=>e.n),__vite__mapDeps([336,1]))}),nand2tetrisHdl:ne("nand2tetrisHdl",function(){return q(()=>import("./nand2tetris-hdl-CGF6E--X.js").then(e=>e.n),__vite__mapDeps([337,1]))}),naniscript:ne("naniscript",function(){return q(()=>import("./naniscript-Dv0ErN1f.js").then(e=>e.n),__vite__mapDeps([338,1]))}),nasm:ne("nasm",function(){return q(()=>import("./nasm-CdhriaSD.js").then(e=>e.n),__vite__mapDeps([339,1]))}),neon:ne("neon",function(){return q(()=>import("./neon-6Qw1Wpr8.js").then(e=>e.n),__vite__mapDeps([340,1]))}),nevod:ne("nevod",function(){return q(()=>import("./nevod-Do308_dN.js").then(e=>e.n),__vite__mapDeps([341,1]))}),nginx:ne("nginx",function(){return q(()=>import("./nginx-CioVUANG.js").then(e=>e.n),__vite__mapDeps([342,1]))}),nim:ne("nim",function(){return q(()=>import("./nim-BiZFPqzz.js").then(e=>e.n),__vite__mapDeps([343,1]))}),nix:ne("nix",function(){return q(()=>import("./nix-DLWyfiVz.js").then(e=>e.n),__vite__mapDeps([344,1]))}),nsis:ne("nsis",function(){return q(()=>import("./nsis-B_mA8Mf4.js").then(e=>e.n),__vite__mapDeps([345,1]))}),objectivec:ne("objectivec",function(){return q(()=>import("./objectivec-CFn4OO_F.js").then(e=>e.o),__vite__mapDeps([346,1,169]))}),ocaml:ne("ocaml",function(){return q(()=>import("./ocaml-B365KzYr.js").then(e=>e.o),__vite__mapDeps([347,1]))}),opencl:ne("opencl",function(){return q(()=>import("./opencl-CPm34rhj.js").then(e=>e.o),__vite__mapDeps([348,1,169]))}),openqasm:ne("openqasm",function(){return q(()=>import("./openqasm-CDj9ArmH.js").then(e=>e.o),__vite__mapDeps([349,1]))}),oz:ne("oz",function(){return q(()=>import("./oz-BYXLbj-G.js").then(e=>e.o),__vite__mapDeps([350,1]))}),parigp:ne("parigp",function(){return q(()=>import("./parigp-D0QktAhQ.js").then(e=>e.p),__vite__mapDeps([351,1]))}),parser:ne("parser",function(){return q(()=>import("./parser-qO2_EI6v.js").then(e=>e.p),__vite__mapDeps([352,1]))}),pascal:ne("pascal",function(){return q(()=>import("./pascal-De5eNwWX.js").then(e=>e.p),__vite__mapDeps([353,1]))}),pascaligo:ne("pascaligo",function(){return q(()=>import("./pascaligo-Bf8O7ebQ.js").then(e=>e.p),__vite__mapDeps([354,1]))}),pcaxis:ne("pcaxis",function(){return q(()=>import("./pcaxis-BcwaB2L7.js").then(e=>e.p),__vite__mapDeps([355,1]))}),peoplecode:ne("peoplecode",function(){return q(()=>import("./peoplecode-Dk2Gnb3n.js").then(e=>e.p),__vite__mapDeps([356,1]))}),perl:ne("perl",function(){return q(()=>import("./perl-DRKm4LVK.js").then(e=>e.p),__vite__mapDeps([357,1]))}),phpExtras:ne("phpExtras",function(){return q(()=>import("./php-extras-DBoPtocT.js").then(e=>e.p),__vite__mapDeps([358,1,310,224]))}),php:ne("php",function(){return q(()=>import("./php-BSKv2GXV.js").then(e=>e.p),__vite__mapDeps([359,1,310,224]))}),phpdoc:ne("phpdoc",function(){return q(()=>import("./phpdoc-BJjHK9Yc.js").then(e=>e.p),__vite__mapDeps([360,1,310,224,283]))}),plsql:ne("plsql",function(){return q(()=>import("./plsql-Bb_hLNuA.js").then(e=>e.p),__vite__mapDeps([361,1,163]))}),powerquery:ne("powerquery",function(){return q(()=>import("./powerquery-C5qk80xF.js").then(e=>e.p),__vite__mapDeps([362,1]))}),powershell:ne("powershell",function(){return q(()=>import("./powershell-BG0DpRp-.js").then(e=>e.p),__vite__mapDeps([363,1]))}),processing:ne("processing",function(){return q(()=>import("./processing-w7DFlyH_.js").then(e=>e.p),__vite__mapDeps([364,1]))}),prolog:ne("prolog",function(){return q(()=>import("./prolog-B2BVxulM.js").then(e=>e.p),__vite__mapDeps([365,1]))}),promql:ne("promql",function(){return q(()=>import("./promql-B3KvaVJb.js").then(e=>e.p),__vite__mapDeps([366,1]))}),properties:ne("properties",function(){return q(()=>import("./properties-BE8Ews0J.js").then(e=>e.p),__vite__mapDeps([367,1]))}),protobuf:ne("protobuf",function(){return q(()=>import("./protobuf-CBHBbdUG.js").then(e=>e.p),__vite__mapDeps([368,1]))}),psl:ne("psl",function(){return q(()=>import("./psl-aD6jMMeP.js").then(e=>e.p),__vite__mapDeps([369,1]))}),pug:ne("pug",function(){return q(()=>import("./pug-DI-93Lan.js").then(e=>e.p),__vite__mapDeps([370,1]))}),puppet:ne("puppet",function(){return q(()=>import("./puppet-DxN-4n9f.js").then(e=>e.p),__vite__mapDeps([371,1]))}),pure:ne("pure",function(){return q(()=>import("./pure-_2x0TJjK.js").then(e=>e.p),__vite__mapDeps([372,1]))}),purebasic:ne("purebasic",function(){return q(()=>import("./purebasic-C8Ir77ii.js").then(e=>e.p),__vite__mapDeps([373,1]))}),purescript:ne("purescript",function(){return q(()=>import("./purescript-DWCP7Rhr.js").then(e=>e.p),__vite__mapDeps([374,1,262]))}),python:ne("python",function(){return q(()=>import("./python-B3k5tM49.js").then(e=>e.p),__vite__mapDeps([375,1]))}),q:ne("q",function(){return q(()=>import("./q-LJLqXf0_.js").then(e=>e.q),__vite__mapDeps([376,1]))}),qml:ne("qml",function(){return q(()=>import("./qml-DgsxaMQP.js").then(e=>e.q),__vite__mapDeps([377,1]))}),qore:ne("qore",function(){return q(()=>import("./qore-DumyY0ow.js").then(e=>e.q),__vite__mapDeps([378,1]))}),qsharp:ne("qsharp",function(){return q(()=>import("./qsharp-ClAsZa-1.js").then(e=>e.q),__vite__mapDeps([379,1]))}),r:ne("r",function(){return q(()=>import("./r-DHwkVKGw.js").then(e=>e.r),__vite__mapDeps([380,1]))}),racket:ne("racket",function(){return q(()=>import("./racket-DcBksMCk.js").then(e=>e.r),__vite__mapDeps([381,1,313]))}),reason:ne("reason",function(){return q(()=>import("./reason-BXtuBfki.js").then(e=>e.r),__vite__mapDeps([382,1]))}),regex:ne("regex",function(){return q(()=>import("./regex-Bmn5L_4e.js").then(e=>e.r),__vite__mapDeps([383,1]))}),rego:ne("rego",function(){return q(()=>import("./rego-CZsdWqMW.js").then(e=>e.r),__vite__mapDeps([384,1]))}),renpy:ne("renpy",function(){return q(()=>import("./renpy-XPjsxRDO.js").then(e=>e.r),__vite__mapDeps([385,1]))}),rest:ne("rest",function(){return q(()=>import("./rest-DD2JcNUu.js").then(e=>e.r),__vite__mapDeps([386,1]))}),rip:ne("rip",function(){return q(()=>import("./rip-B2ScZnvu.js").then(e=>e.r),__vite__mapDeps([387,1]))}),roboconf:ne("roboconf",function(){return q(()=>import("./roboconf-XMvWjvgI.js").then(e=>e.r),__vite__mapDeps([388,1]))}),robotframework:ne("robotframework",function(){return q(()=>import("./robotframework-BivGgTMI.js").then(e=>e.r),__vite__mapDeps([389,1]))}),ruby:ne("ruby",function(){return q(()=>import("./ruby-DQG1k7eY.js").then(e=>e.r),__vite__mapDeps([390,1,208]))}),rust:ne("rust",function(){return q(()=>import("./rust-CY08bKn6.js").then(e=>e.r),__vite__mapDeps([391,1]))}),sas:ne("sas",function(){return q(()=>import("./sas-1PTlKbzw.js").then(e=>e.s),__vite__mapDeps([392,1]))}),sass:ne("sass",function(){return q(()=>import("./sass-RllDMjGg.js").then(e=>e.s),__vite__mapDeps([393,1]))}),scala:ne("scala",function(){return q(()=>import("./scala-D1OpbE39.js").then(e=>e.s),__vite__mapDeps([394,1,281]))}),scheme:ne("scheme",function(){return q(()=>import("./scheme-BbtNtDr-.js").then(e=>e.s),__vite__mapDeps([395,1,313]))}),scss:ne("scss",function(){return q(()=>import("./scss-DgCxV9gf.js").then(e=>e.s),__vite__mapDeps([396,1]))}),shellSession:ne("shellSession",function(){return q(()=>import("./shell-session-1LvomK4i.js").then(e=>e.s),__vite__mapDeps([397,1,181]))}),smali:ne("smali",function(){return q(()=>import("./smali-CXX5Nw4b.js").then(e=>e.s),__vite__mapDeps([398,1]))}),smalltalk:ne("smalltalk",function(){return q(()=>import("./smalltalk-CkWNQdr2.js").then(e=>e.s),__vite__mapDeps([399,1]))}),smarty:ne("smarty",function(){return q(()=>import("./smarty-D9yobX_8.js").then(e=>e.s),__vite__mapDeps([400,1,224]))}),sml:ne("sml",function(){return q(()=>import("./sml-CtZ57qc6.js").then(e=>e.s),__vite__mapDeps([401,1]))}),solidity:ne("solidity",function(){return q(()=>import("./solidity-CkABSbax.js").then(e=>e.s),__vite__mapDeps([402,1]))}),solutionFile:ne("solutionFile",function(){return q(()=>import("./solution-file-K7E94G8T.js").then(e=>e.s),__vite__mapDeps([403,1]))}),soy:ne("soy",function(){return q(()=>import("./soy-CiMQleff.js").then(e=>e.s),__vite__mapDeps([404,1,224]))}),sparql:ne("sparql",function(){return q(()=>import("./sparql-B28RxTei.js").then(e=>e.s),__vite__mapDeps([405,1,406]))}),splunkSpl:ne("splunkSpl",function(){return q(()=>import("./splunk-spl-w0Cel-ic.js").then(e=>e.s),__vite__mapDeps([407,1]))}),sqf:ne("sqf",function(){return q(()=>import("./sqf-BBYZJCt5.js").then(e=>e.s),__vite__mapDeps([408,1]))}),sql:ne("sql",function(){return q(()=>import("./sql-CwRJh8Sp.js").then(e=>e.s),__vite__mapDeps([409,1,163]))}),squirrel:ne("squirrel",function(){return q(()=>import("./squirrel-CEzvQBK5.js").then(e=>e.s),__vite__mapDeps([410,1]))}),stan:ne("stan",function(){return q(()=>import("./stan-S3CZTrL_.js").then(e=>e.s),__vite__mapDeps([411,1]))}),stylus:ne("stylus",function(){return q(()=>import("./stylus-BG4_ZnaL.js").then(e=>e.s),__vite__mapDeps([412,1]))}),swift:ne("swift",function(){return q(()=>import("./swift-ByheDo_6.js").then(e=>e.s),__vite__mapDeps([413,1]))}),systemd:ne("systemd",function(){return q(()=>import("./systemd-6CBk_Ow2.js").then(e=>e.s),__vite__mapDeps([414,1]))}),t4Cs:ne("t4Cs",function(){return q(()=>import("./t4-cs-DHZvgPUG.js").then(e=>e.t),__vite__mapDeps([415,1,416,175]))}),t4Templating:ne("t4Templating",function(){return q(()=>import("./t4-templating-DUeWWaCj.js").then(e=>e.t),__vite__mapDeps([417,1,416]))}),t4Vb:ne("t4Vb",function(){return q(()=>import("./t4-vb-B_6qRhT8.js").then(e=>e.t),__vite__mapDeps([418,1,416,419,183]))}),tap:ne("tap",function(){return q(()=>import("./tap-DjTT3CuE.js").then(e=>e.t),__vite__mapDeps([420,1,421]))}),tcl:ne("tcl",function(){return q(()=>import("./tcl-BM9U6SkZ.js").then(e=>e.t),__vite__mapDeps([422,1]))}),textile:ne("textile",function(){return q(()=>import("./textile-XOvB5RBz.js").then(e=>e.t),__vite__mapDeps([423,1]))}),toml:ne("toml",function(){return q(()=>import("./toml-BO0aGyy4.js").then(e=>e.t),__vite__mapDeps([424,1]))}),tremor:ne("tremor",function(){return q(()=>import("./tremor-Bk9M5xQH.js").then(e=>e.t),__vite__mapDeps([425,1]))}),tsx:ne("tsx",function(){return q(()=>import("./tsx-BcjbSAGh.js").then(e=>e.t),__vite__mapDeps([426,1,301,294]))}),tt2:ne("tt2",function(){return q(()=>import("./tt2-BHaQqFiG.js").then(e=>e.t),__vite__mapDeps([427,1,224]))}),turtle:ne("turtle",function(){return q(()=>import("./turtle-CdxJK1CJ.js").then(e=>e.t),__vite__mapDeps([428,1,406]))}),twig:ne("twig",function(){return q(()=>import("./twig-CxFOkn0v.js").then(e=>e.t),__vite__mapDeps([429,1,224]))}),typescript:ne("typescript",function(){return q(()=>import("./typescript-CVqiKcu1.js").then(e=>e.t),__vite__mapDeps([430,1,294]))}),typoscript:ne("typoscript",function(){return q(()=>import("./typoscript-spRf2Ox1.js").then(e=>e.t),__vite__mapDeps([431,1]))}),unrealscript:ne("unrealscript",function(){return q(()=>import("./unrealscript-D2PIC4ZQ.js").then(e=>e.u),__vite__mapDeps([432,1]))}),uorazor:ne("uorazor",function(){return q(()=>import("./uorazor-xrDEXG6p.js").then(e=>e.u),__vite__mapDeps([433,1]))}),uri:ne("uri",function(){return q(()=>import("./uri-CwPh3EwT.js").then(e=>e.u),__vite__mapDeps([434,1]))}),v:ne("v",function(){return q(()=>import("./v-CJIzMR4B.js").then(e=>e.v),__vite__mapDeps([435,1]))}),vala:ne("vala",function(){return q(()=>import("./vala-WpTbVsFT.js").then(e=>e.v),__vite__mapDeps([436,1]))}),vbnet:ne("vbnet",function(){return q(()=>import("./vbnet-UNQqH4vF.js").then(e=>e.v),__vite__mapDeps([437,1,419,183]))}),velocity:ne("velocity",function(){return q(()=>import("./velocity-DsPfPeeX.js").then(e=>e.v),__vite__mapDeps([438,1]))}),verilog:ne("verilog",function(){return q(()=>import("./verilog-NpK4_zqq.js").then(e=>e.v),__vite__mapDeps([439,1]))}),vhdl:ne("vhdl",function(){return q(()=>import("./vhdl-DiFKlg1X.js").then(e=>e.v),__vite__mapDeps([440,1]))}),vim:ne("vim",function(){return q(()=>import("./vim-SyhS9sNH.js").then(e=>e.v),__vite__mapDeps([441,1]))}),visualBasic:ne("visualBasic",function(){return q(()=>import("./visual-basic-DSiTvEtK.js").then(e=>e.v),__vite__mapDeps([442,1]))}),warpscript:ne("warpscript",function(){return q(()=>import("./warpscript-CTRBwGjg.js").then(e=>e.w),__vite__mapDeps([443,1]))}),wasm:ne("wasm",function(){return q(()=>import("./wasm-CBCDYs2M.js").then(e=>e.w),__vite__mapDeps([444,1]))}),webIdl:ne("webIdl",function(){return q(()=>import("./web-idl-BfdeEL3H.js").then(e=>e.w),__vite__mapDeps([445,1]))}),wiki:ne("wiki",function(){return q(()=>import("./wiki-CouGhrmq.js").then(e=>e.w),__vite__mapDeps([446,1]))}),wolfram:ne("wolfram",function(){return q(()=>import("./wolfram-CejGEkud.js").then(e=>e.w),__vite__mapDeps([447,1]))}),wren:ne("wren",function(){return q(()=>import("./wren-BTo1kC3F.js").then(e=>e.w),__vite__mapDeps([448,1]))}),xeora:ne("xeora",function(){return q(()=>import("./xeora-mFujPPPh.js").then(e=>e.x),__vite__mapDeps([449,1]))}),xmlDoc:ne("xmlDoc",function(){return q(()=>import("./xml-doc-DpZbWR7e.js").then(e=>e.x),__vite__mapDeps([450,1]))}),xojo:ne("xojo",function(){return q(()=>import("./xojo-C9xNSycu.js").then(e=>e.x),__vite__mapDeps([451,1]))}),xquery:ne("xquery",function(){return q(()=>import("./xquery-C7CsuD6b.js").then(e=>e.x),__vite__mapDeps([452,1]))}),yaml:ne("yaml",function(){return q(()=>import("./yaml-DxQv1G_M.js").then(e=>e.y),__vite__mapDeps([453,1,421]))}),yang:ne("yang",function(){return q(()=>import("./yang-BXpPxQeP.js").then(e=>e.y),__vite__mapDeps([454,1]))}),zig:ne("zig",function(){return q(()=>import("./zig-KxZlFBGb.js").then(e=>e.z),__vite__mapDeps([455,1]))})},oGe=rGe({loader:function(){return q(()=>import("./core-ChuWtB-i.js").then(t=>t.c),__vite__mapDeps([456,1,326,214,199,286])).then(function(t){return t.default||t})},isLanguageRegistered:function(t,n){return t.registered(n)},languageLoaders:sGe,registerLanguage:function(t,n,r){return t.register(r)}}),aGe="light";function iGe(e){return{mode:aGe,...e?.theme}}function en(e){var t=e;return function(n){var r=iGe(n);let s=r.mode;return t[s]}}const lGe=e=>{const t={theme:e};return{lineNumberColor:en({light:"#383a42",dark:"#abb2bf"})(t),lineNumberBgColor:en({light:"#fafafa",dark:"#282c34"})(t),backgroundColor:en({light:"#fafafa",dark:"#282c34"})(t),textColor:en({light:"#383a42",dark:"#abb2bf"})(t),substringColor:en({light:"#e45649",dark:"#e06c75"})(t),keywordColor:en({light:"#a626a4",dark:"#c678dd"})(t),attributeColor:en({light:"#50a14f",dark:"#98c379"})(t),selectorAttributeColor:en({light:"#e45649",dark:"#e06c75"})(t),docTagColor:en({light:"#a626a4",dark:"#c678dd"})(t),nameColor:en({light:"#e45649",dark:"#e06c75"})(t),builtInColor:en({light:"#c18401",dark:"#e6c07b"})(t),literalColor:en({light:"#0184bb",dark:"#56b6c2"})(t),bulletColor:en({light:"#4078f2",dark:"#61aeee"})(t),codeColor:en({light:"#383a42",dark:"#abb2bf"})(t),additionColor:en({light:"#50a14f",dark:"#98c379"})(t),regexpColor:en({light:"#50a14f",dark:"#98c379"})(t),symbolColor:en({light:"#4078f2",dark:"#61aeee"})(t),variableColor:en({light:"#986801",dark:"#d19a66"})(t),templateVariableColor:en({light:"#986801",dark:"#d19a66"})(t),linkColor:en({light:"#4078f2",dark:"#61aeee"})(t),selectorClassColor:en({light:"#986801",dark:"#d19a66"})(t),typeColor:en({light:"#986801",dark:"#d19a66"})(t),stringColor:en({light:"#50a14f",dark:"#98c379"})(t),selectorIdColor:en({light:"#4078f2",dark:"#61aeee"})(t),quoteColor:en({light:"#a0a1a7",dark:"#5c6370"})(t),templateTagColor:en({light:"#383a42",dark:"#abb2bf"})(t),deletionColor:en({light:"#e45649",dark:"#e06c75"})(t),titleColor:en({light:"#4078f2",dark:"#61aeee"})(t),sectionColor:en({light:"#e45649",dark:"#e06c75"})(t),commentColor:en({light:"#a0a1a7",dark:"#5c6370"})(t),metaKeywordColor:en({light:"#383a42",dark:"#abb2bf"})(t),metaColor:en({light:"#4078f2",dark:"#61aeee"})(t),functionColor:en({light:"#383a42",dark:"#abb2bf"})(t),numberColor:en({light:"#986801",dark:"#d19a66"})(t)}},I2="inherit",Y6="inherit",cGe={fontSize:Y6,fontFamily:I2,lineHeight:20/12,padding:8},uGe=e=>({fontSize:Y6,lineHeight:20/14,color:e.lineNumberColor,backgroundColor:e.lineNumberBgColor,flexShrink:0,padding:8,textAlign:"right",userSelect:"none"}),une=e=>({key:{color:e.keywordColor,fontWeight:"bolder"},keyword:{color:e.keywordColor,fontWeight:"bolder"},"attr-name":{color:e.attributeColor},selector:{color:e.selectorTagColor},comment:{color:e.commentColor,fontFamily:I2,fontStyle:"italic"},"block-comment":{color:e.commentColor,fontFamily:I2,fontStyle:"italic"},"function-name":{color:e.sectionColor},"class-name":{color:e.sectionColor},doctype:{color:e.docTagColor},substr:{color:e.substringColor},namespace:{color:e.nameColor},builtin:{color:e.builtInColor},entity:{color:e.literalColor},bullet:{color:e.bulletColor},code:{color:e.codeColor},addition:{color:e.additionColor},regex:{color:e.regexpColor},symbol:{color:e.symbolColor},variable:{color:e.variableColor},url:{color:e.linkColor},"selector-attr":{color:e.selectorAttributeColor},"selector-pseudo":{color:e.selectorPseudoColor},type:{color:e.typeColor},string:{color:e.stringColor},quote:{color:e.quoteColor},tag:{color:e.templateTagColor},deletion:{color:e.deletionColor},title:{color:e.titleColor},section:{color:e.sectionColor},"meta-keyword":{color:e.metaKeywordColor},meta:{color:e.metaColor},italic:{fontStyle:"italic"},bold:{fontWeight:"bolder"},function:{color:e.functionColor},number:{color:e.numberColor}}),dne=e=>({fontSize:Y6,fontFamily:I2,background:e.backgroundColor,color:e.textColor,borderRadius:3,display:"flex",lineHeight:20/14,overflowX:"auto",whiteSpace:"pre"}),dGe=e=>({'pre[class*="language-"]':dne(e),...une(e)}),fGe=e=>({'pre[class*="language-"]':{...dne(e),padding:"2px 4px",display:"inline",whiteSpace:"pre-wrap"},...une(e)});function fne(e={mode:"light"}){const t={...lGe(e),...e};return{lineNumberContainerStyle:uGe(t),codeBlockStyle:dGe(t),inlineCodeStyle:fGe(t),codeContainerStyle:cGe}}const mGe=Object.freeze([{name:"PHP",alias:["php","php3","php4","php5"],value:"php"},{name:"Java",alias:["java"],value:"java"},{name:"CSharp",alias:["csharp","c#","cs"],value:"csharp"},{name:"Python",alias:["python","py"],value:"python"},{name:"JavaScript",alias:["javascript","js"],value:"javascript"},{name:"XML",alias:["xml"],value:"xml"},{name:"HTML",alias:["html","htm"],value:"markup"},{name:"C++",alias:["c++","cpp","clike"],value:"cpp"},{name:"Ruby",alias:["ruby","rb","duby"],value:"ruby"},{name:"Objective-C",alias:["objective-c","objectivec","obj-c","objc"],value:"objectivec"},{name:"C",alias:["c"],value:"cpp"},{name:"Swift",alias:["swift"],value:"swift"},{name:"TeX",alias:["tex","latex"],value:"tex"},{name:"Shell",alias:["shell","sh","ksh","zsh"],value:"bash"},{name:"Scala",alias:["scala"],value:"scala"},{name:"Go",alias:["go"],value:"go"},{name:"ActionScript",alias:["actionscript","actionscript3","as"],value:"actionscript"},{name:"ColdFusion",alias:["coldfusion"],value:"xml"},{name:"JavaFX",alias:["javafx","jfx"],value:"java"},{name:"VbNet",alias:["vbnet","vb.net"],value:"vbnet"},{name:"JSON",alias:["json"],value:"json"},{name:"MATLAB",alias:["matlab"],value:"matlab"},{name:"Groovy",alias:["groovy"],value:"groovy"},{name:"SQL",alias:["sql","postgresql","postgres","plpgsql","psql","postgresql-console","postgres-console","tsql","t-sql","mysql","sqlite"],value:"sql"},{name:"R",alias:["r"],value:"r"},{name:"Perl",alias:["perl","pl"],value:"perl"},{name:"Lua",alias:["lua"],value:"lua"},{name:"Delphi",alias:["delphi","pas","pascal","objectpascal"],value:"delphi"},{name:"XML",alias:["xml"],value:"xml"},{name:"TypeScript",alias:["typescript","ts","tsx"],value:"typescript"},{name:"CoffeeScript",alias:["coffeescript","coffee-script","coffee"],value:"coffeescript"},{name:"Haskell",alias:["haskell","hs"],value:"haskell"},{name:"Puppet",alias:["puppet"],value:"puppet"},{name:"Arduino",alias:["arduino"],value:"arduino"},{name:"Fortran",alias:["fortran"],value:"fortran"},{name:"Erlang",alias:["erlang","erl"],value:"erlang"},{name:"PowerShell",alias:["powershell","posh","ps1","psm1"],value:"powershell"},{name:"Haxe",alias:["haxe","hx","hxsl"],value:"haxe"},{name:"Elixir",alias:["elixir","ex","exs"],value:"elixir"},{name:"Verilog",alias:["verilog","v"],value:"verilog"},{name:"Rust",alias:["rust"],value:"rust"},{name:"VHDL",alias:["vhdl"],value:"vhdl"},{name:"Sass",alias:["sass"],value:"less"},{name:"OCaml",alias:["ocaml"],value:"ocaml"},{name:"Dart",alias:["dart"],value:"dart"},{name:"CSS",alias:["css"],value:"css"},{name:"reStructuredText",alias:["restructuredtext","rst","rest"],value:"rest"},{name:"ObjectPascal",alias:["objectpascal"],value:"delphi"},{name:"Kotlin",alias:["kotlin"],value:"kotlin"},{name:"D",alias:["d"],value:"d"},{name:"Octave",alias:["octave"],value:"matlab"},{name:"QML",alias:["qbs","qml"],value:"qml"},{name:"Prolog",alias:["prolog"],value:"prolog"},{name:"FoxPro",alias:["foxpro","vfp","clipper","xbase"],value:"vbnet"},{name:"Scheme",alias:["scheme","scm"],value:"scheme"},{name:"CUDA",alias:["cuda","cu"],value:"cpp"},{name:"Julia",alias:["julia","jl"],value:"julia"},{name:"Racket",alias:["racket","rkt"],value:"lisp"},{name:"Ada",alias:["ada","ada95","ada2005"],value:"ada"},{name:"Tcl",alias:["tcl"],value:"tcl"},{name:"Mathematica",alias:["mathematica","mma","nb"],value:"mathematica"},{name:"Autoit",alias:["autoit"],value:"autoit"},{name:"StandardML",alias:["standardmL","sml","standardml"],value:"sml"},{name:"Objective-J",alias:["objective-j","objectivej","obj-j","objj"],value:"objectivec"},{name:"Smalltalk",alias:["smalltalk","squeak","st"],value:"smalltalk"},{name:"Vala",alias:["vala","vapi"],value:"vala"},{name:"ABAP",alias:["abap"],value:"sql"},{name:"LiveScript",alias:["livescript","live-script"],value:"livescript"},{name:"XQuery",alias:["xquery","xqy","xq","xql","xqm"],value:"xquery"},{name:"PlainText",alias:["text","plaintext"],value:"text"},{name:"Yaml",alias:["yaml","yml"],value:"yaml"},{name:"GraphQL",alias:["graphql","gql"],value:"graphql"}]),pGe=e=>{if(!e)return"";const t=mGe.find(n=>n.name===e||n.alias.includes(e));return t?t.value:e||"text"};class mne extends d.PureComponent{constructor(){super(...arguments),this._isMounted=!1}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}getLineOpacity(t){if(!this.props.highlight)return 1;const n=this.props.highlight.split(",").map(r=>{if(r.indexOf("-")>0){const[s,o]=r.split("-").map(Number).sort();return Array(o+1).fill(void 0).map((a,i)=>i).slice(s,o+1)}return Number(r)}).reduce((r,s)=>r.concat(s),[]);return n.length===0||n.includes(t)?1:.3}render(){const{inlineCodeStyle:t}=fne(this.props.theme),r={language:pGe(this.props.language),PreTag:this.props.preTag,style:this.props.codeStyle||t,showLineNumbers:this.props.showLineNumbers,startingLineNumber:this.props.startingLineNumber,codeTagProps:this.props.codeTagProps,wrapLongLines:this.props.wrapLongLines};return A.createElement(oGe,Object.assign({},r,{wrapLines:!!this.props.highlight,customStyle:this.props.customStyle,lineProps:s=>({style:{opacity:this.getLineOpacity(s),...this.props.lineNumberContainerStyle}})}),this.props.text)}}mne.defaultProps={theme:{},showLineNumbers:!1,wrapLongLines:!1,startingLineNumber:1,lineNumberContainerStyle:{},codeTagProps:{},preTag:"span",highlight:"",customStyle:{}};const pne="text";let Q6=class extends d.PureComponent{constructor(){super(...arguments),this._isMounted=!1,this.handleCopy=t=>{const n=t.nativeEvent.clipboardData;if(n){t.preventDefault();const r=window.getSelection();if(r===null)return;const s=r.toString(),o=`
${s}
`;n.clearData(),n.setData("text/html",o),n.setData("text/plain",s)}}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){var t,n,r,s;const{lineNumberContainerStyle:o,codeBlockStyle:a,codeContainerStyle:i}=fne(this.props.theme),c={language:this.props.language||pne,codeStyle:{...a,...(t=this.props)===null||t===void 0?void 0:t.codeBlockStyle},customStyle:(n=this.props)===null||n===void 0?void 0:n.customStyle,showLineNumbers:this.props.showLineNumbers,startingLineNumber:this.props.startingLineNumber,codeTagProps:{style:{...i,...(r=this.props)===null||r===void 0?void 0:r.codeContainerStyle}},lineNumberContainerStyle:{...o,...(s=this.props)===null||s===void 0?void 0:s.lineNumberContainerStyle},text:this.props.text.toString(),highlight:this.props.highlight,wrapLongLines:this.props.wrapLongLines};return A.createElement(mne,Object.assign({},c))}};Q6.displayName="CodeBlock";Q6.defaultProps={text:"",showLineNumbers:!0,wrapLongLines:!1,startingLineNumber:1,language:pne,theme:{},highlight:"",lineNumberContainerStyle:{},customStyle:{},codeBlockStyle:{}};var hGe=AWe(Q6);nb.button` - position: absolute; - top: 0.5em; - right: 0.75em; - display: flex; - flex-wrap: wrap; - justify-content: center; - align-items: center; - background: ${e=>e.theme.backgroundColor}; - margin-top: 0.15rem; - border-radius: 0.25rem; - max-height: 2rem; - max-width: 2rem; - padding: 0.25rem; - &:hover { - opacity: ${e=>e.copied?1:.5}; - } - &:focus { - outline: none; - opacity: 1; - } - .icon { - width: 1rem; - height: 1rem; - } -`;nb.div` - position: relative; - background: ${e=>e.theme.backgroundColor}; - border-radius: 0.25rem; - padding: ${e=>e.codeBlock?"0.25rem 0.5rem 0.25rem 0.25rem":"0.25rem"}; -`;nb.div` - position: relative; - width: ${({width:e})=>e||"auto"}; - max-width: 100%; - padding: 8pt; - padding-right: calc(2 * 16pt); - color: ${({style:e})=>e.color}; - background-color: ${({style:e})=>e.bgColor}; - border: 1px solid ${({style:e})=>e.border}; - border-radius: 5px; - pre { - margin: 0; - padding: 0; - border: none; - background-color: transparent; - color: ${({style:e})=>e.color}; - font-size: 0.8125rem; - } - pre::before { - content: '$ '; - user-select: none; - } - pre :global(*) { - margin: 0; - padding: 0; - font-size: inherit; - color: inherit; - } - .copy { - position: absolute; - right: 0; - top: -2px; - transform: translateY(50%); - background-color: ${({style:e})=>e.bgColor}; - display: inline-flex; - justify-content: center; - align-items: center; - width: calc(2 * 16pt); - color: inherit; - transition: opacity 0.2s ease 0s; - border-radius: 5px; - cursor: pointer; - user-select: none; - } - .copy:hover { - opacity: 0.7; - } -`;var gGe={lineNumberColor:"#c5c8c6",lineNumberBgColor:"#1d1f21",backgroundColor:"#1d1f21",textColor:"#c5c8c6",substringColor:"#c5c8c6",keywordColor:"#b294bb",attributeColor:"#f0c674",selectorAttributeColor:"#b294bb",docTagColor:"#c5c8c6",nameColor:"#cc6666",builtInColor:"#de935f",literalColor:"#de935f",bulletColor:"#b5bd68",codeColor:"#c5c8c6",additionColor:"#b5bd68",regexpColor:"#cc6666",symbolColor:"#b5bd68",variableColor:"#cc6666",templateVariableColor:"#cc6666",linkColor:"#de935f",selectorClassColor:"#cc6666",typeColor:"#de935f",stringColor:"#b5bd68",selectorIdColor:"#cc6666",quoteColor:"#969896",templateTagColor:"#c5c8c6",deletionColor:"#cc6666",titleColor:"#81a2be",sectionColor:"#81a2be",commentColor:"#969896",metaKeywordColor:"#c5c8c6",metaColor:"#de935f",functionColor:"#c5c8c6",numberColor:"#de935f"},yGe={lineNumberColor:"#4d4d4c",lineNumberBgColor:"white",backgroundColor:"white",textColor:"#4d4d4c",substringColor:"#4d4d4c",keywordColor:"#8959a8",attributeColor:"#eab700",selectorAttributeColor:"#8959a8",docTagColor:"#4d4d4c",nameColor:"#c82829",builtInColor:"#f5871f",literalColor:"#f5871f",bulletColor:"#718c00",codeColor:"#4d4d4c",additionColor:"#718c00",regexpColor:"#c82829",symbolColor:"#718c00",variableColor:"#c82829",templateVariableColor:"#c82829",linkColor:"#f5871f",selectorClassColor:"#c82829",typeColor:"#f5871f",stringColor:"#718c00",selectorIdColor:"#c82829",quoteColor:"#8e908c",templateTagColor:"#4d4d4c",deletionColor:"#c82829",titleColor:"#4271ae",sectionColor:"#4271ae",commentColor:"#8e908c",metaKeywordColor:"#4d4d4c",metaColor:"#f5871f",functionColor:"#4d4d4c",numberColor:"#f5871f"};const af=A.memo(e=>{const{children:t,className:n,codeBlockProps:r,hideTools:s,trackEvent:o,translations:a,codeBlockStyles:i,...c}=e,{language:u="text",showLineNumbers:f,text:m,theme:p,wrapLongLines:h,...g}=r,{colorScheme:y}=Ss(),x=d.useMemo(()=>{let w;return p?w=p:(w=y==="dark"?gGe:yGe,w.backgroundColor="transparent",w.lineNumberBgColor="transparent"),w},[y,p]),v=z("codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded-lg font-mono text-sm font-normal",n),b=d.useCallback(()=>{navigator.clipboard.writeText(String(t)),o?.("click code block copy",{language:u??"text"})},[t,u,o]),_=d.useMemo(()=>({"--scrollbar-thumb":"oklch(var(--foreground-color) / 0.15)","--scrollbar-track":"transparent",scrollbarWidth:"thin",scrollbarColor:"var(--scrollbar-thumb) var(--scrollbar-track)",...i}),[i]);return l.jsxs("div",{className:v,...c,children:[l.jsx("div",{className:z("translate-y-xs -translate-x-xs bottom-xl mb-xl","flex h-0 items-start justify-end","sm:sticky sm:top-xs"),children:!s&&l.jsx(K,{variant:"background",className:"overflow-hidden rounded-full",children:l.jsx(K,{variant:"subtler",children:l.jsx(st,{icon:B("copy"),size:"small",pill:!0,clickFeedback:!0,onClick:b,testId:"copy-code-button",ariaLabel:a?.copy,toolTip:a?.copy})})})}),l.jsxs("div",{className:"-mt-xl",children:[u&&!s&&l.jsx("div",{children:l.jsx("div",{"data-testid":"code-language-indicator",className:"text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-lg text-xs font-thin",children:u})}),l.jsx("div",{children:l.jsx(hGe,{as:void 0,forwardedAs:void 0,language:u,showLineNumbers:!1,text:String(t),theme:x,wrapLongLines:!0,customStyle:_,...g})})]})]})});af.displayName="CodeBlock";const hne=A.memo(({step:e,action:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),{final:o,status:a,script:i,output:c,stdout:u}=e.content,f=!o,m=a==="generating"||a==="executing",p=d.useCallback(()=>{s(x=>!x)},[]),h=u&&c?u+` -`+c:u||c||"",g=d.useMemo(()=>({language:"python"}),[]),y=!!i;return l.jsxs("div",{children:[l.jsx(Ge,{onClick:p,text:t,icon:B("message-circle-code"),isLoading:f,size:"tiny",pill:!0,chevron:y,chevronIcon:r?B("chevron-up"):B("chevron-down")}),l.jsx(St,{children:r&&y&&l.jsxs(Te.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:"easeIn",duration:.15}},className:"mb-sm space-y-sm",children:[l.jsx(af,{className:"text-xs",codeBlockProps:g,children:i}),!m&&l.jsxs(Te.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:"easeIn",duration:.15}},children:[l.jsx(V,{variant:"tiny",color:"light",children:n(h?{defaultMessage:"Output",id:"fio5opLcOZ"}:{defaultMessage:"This code did not produce an output",id:"UgqMuAXFKs"})}),a!=="error"&&h&&l.jsx(af,{className:z("scrollbar-subtle max-h-[220px] overflow-y-auto text-xs",a==="success"),codeBlockProps:g,children:h})]})]})})]})});hne.displayName="CodeStep";const gne=A.memo(({asset:e})=>{const{isCanvasOpen:t,canvasState:n}=Yf(),r=d.useMemo(()=>t&&e.uuid===n?.assetUuid,[e.uuid,n?.assetUuid,t]),{title:s,description:o,Icon:a}=v6(e),i=gJ({asset:e}),c=d.useCallback(async()=>{i()},[i]);return l.jsxs(K,{onClick:c,role:"button",tabIndex:0,variant:Wx.subtler,className:z("flex w-fit items-center rounded-lg p-1.5",r&&"ring-super !ring-1"),children:[l.jsx(K,{variant:"super",className:"m-1 flex size-8 items-center justify-center rounded-md p-2",children:l.jsx(ge,{icon:a,size:"md",className:"text-inverse"})}),l.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[l.jsx(V,{variant:"small",color:"default",className:"!font-display !text-[0.8125rem] font-medium",children:s}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"!font-display !text-[0.6875rem] leading-none",children:o})]})]})},({asset:e,...t},{asset:n,...r})=>Un(t,r)&&Cr(e,n));gne.displayName="AssetToken";const yne=A.memo(({screenshot_uuid:e,screenshots:t})=>{const{taskScreenshots:n}=Qn(),r=n[e??""],o=(r?.length?r:t)?.[0];return o?l.jsx(xGe,{src:o,alt:"Browser screenshot",includeLightBoxModal:!0,containerClassName:"relative -mt-1.5 max-w-60 w-full rounded-lg overflow-hidden after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-1 after:ring-inset after:ring-subtlest hover:shadow hover:after:ring-subtler transition-all duration-100",imageClassName:"object-cover w-full text-[0] dark:mix-blend-normal",maskClassName:"bg-subtler"}):null}),xGe=({containerClassName:e,enableRetry:t,...n})=>{const r=d.useRef(1),[s,o]=d.useState(n.src),[a,i]=d.useState(!1),c=d.useCallback(()=>{const u=vGe(n.src);!u||r.current>4||(u.searchParams.set("attempt",String(r.current)),r.current+=1,setTimeout(()=>o(u.toString()),300))},[n.src,r]);return l.jsx(Wo,{containerClassName:z(e,{"opacity-0":!a}),alt:"Browser screenshot",...n,src:s,onFail:t?c:void 0,onLoad:()=>i(!0)},s)},vGe=e=>{if(e)try{return new URL(e)}catch{return}};yne.displayName="ScreenshotStep";const xne=A.memo(({step:e,action:t})=>{const{final:n,file_name:r,page_count:s,word_count:o}=e.content,a=!n;let i=t;return r&&n&&(i=r,s!=null?(i+=` (${s} pages`,o!=null&&(i+=`, ${o} words`),i+=")"):o!=null&&(i+=` (${o} words)`)),l.jsx(Ge,{text:t,icon:B("file-type-docx"),isLoading:a,size:"tiny",pill:!0,toolTip:i,tooltipLayout:"top"})});xne.displayName="DocxStep";const vne=A.memo(({status:e})=>{const{$t:t}=J();let n=B("circle-check-filled"),r=t({defaultMessage:"Done",id:"JXdbo8Vnlw"});switch(e){case"SENT":n=B("circle-check-filled"),r=t({defaultMessage:"Email sent",id:"as7ksh6tP3"});break;case"FORWARDED":n=B("mail-forward"),r=t({defaultMessage:"Email forwarded",id:"QUWo2L2sfE"});break;case"REJECTED":n=B("x"),r=t({defaultMessage:"Email rejected",id:"+469cQAaqI"});break;default:n=B("circle-check-filled"),r=t({defaultMessage:"Done",id:"JXdbo8Vnlw"});break}return l.jsx(Rr,{icon:n,iconClassName:"text-super",text:r})});vne.displayName="EmailStatusStep";const bne=A.memo(({onClick:e,urls:t})=>{const n=d.useMemo(()=>t.map(r=>l.jsx(_ne,{url:r,onClick:e},r)),[e,t]);return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(Zf,{items:n,initialDisplayCount:1})})});bne.displayName="GeneratedVideoResultsStep";const _ne=A.memo(({url:e,onClick:t})=>{const n=d.useCallback(()=>{t?.(e)},[e,t]);return l.jsx(yt,{className:"block",href:e,target:"_blank",rel:"noopener nofollow",onClick:n,children:l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs rounded-lg pl-1.5 pr-2.5",children:l.jsx(ya,{variant:"tinyMono",className:"!text-[0.7rem]",url:e,isAttachment:!1,connectionType:Zn.GENERATED_VIDEO,source:"Generated Video"})})},e)});_ne.displayName="LinkFactory";const wne=A.memo(({prompt:e,success:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useRef(null);d.useLayoutEffect(()=>{const m=i.current;m&&!r&&a(m.scrollHeight>m.clientHeight)},[e,r]);const c=d.useCallback(()=>{s(m=>!m)},[]);if(!e)return null;const u=o||r,f=t===!1;return l.jsxs("div",{className:z("rounded-lg p-3",f?"bg-caution/10":"bg-subtler",u&&"cursor-pointer"),onClick:u?c:void 0,children:[l.jsx("div",{ref:i,className:z("text-default text-sm leading-relaxed",!r&&"line-clamp-2"),children:e}),u&&l.jsxs("button",{className:"text-light hover:text-default mt-2 flex items-center gap-0.5 text-xs",onClick:m=>{m.stopPropagation(),c()},children:[n(r?{defaultMessage:"Show less",id:"qyJtWyZ0yt"}:{defaultMessage:"Show more",id:"aWpBzjCXKS"}),l.jsx(ge,{icon:r?B("chevron-up"):B("chevron-down"),size:"xs"})]})]})});wne.displayName="GenerateImageStep";const JE=A.memo(({color:e,title:t})=>{const n="bg-[#13343B] dark:bg-[#F5F5F5]",s=(o=>o?{red:"bg-[#C0152F] dark:bg-[#FF5459]",maroon:"bg-[#944454] dark:bg-[#B3C901]",orange:"bg-[#DB7100] dark:bg-[#FFAB44]",teal:"bg-[#21808D] dark:bg-[#32B8C6]",grey:n,brown:"bg-[#A84B2F] dark:bg-[#E68161]",green:"bg-[#848456] dark:bg-[#B4B662]",gold:"bg-[#D39900] dark:bg-[#F0B435]",purple:"bg-[#865D95] dark:bg-[#C48ED8]",blue:"bg-[#19789E] dark:bg-[#54B4E3]"}[o]??n:n)(e);return l.jsx("div",{className:z("py-xs w-fit rounded-md px-2.5",s),children:l.jsx(V,{className:"translate-y-half",variant:"tiny",color:"defaultInverted",children:t})})});JE.displayName="GroupingTabsStep";function Cne(e){return JSON.stringify(e,null,2)}const bGe=(e,t=1e4,{showTruncationIndicator:n=!0,format:r=!1}={})=>{if(e.length<=t)return r?Sne(e):e;let s=t;const o=Math.max(0,t-100);for(let c=t-1;c>=o;c--){const u=e[c];if(u===","||u===` -`||u===" "||u===" "){s=c;break}}const a=e.substring(0,s).trim(),i=r?_Ge(e,a):a;if(n){const c=` - -// Content truncated at ${s} characters (original: ${e.length} chars)`;return i+c}return i};function Sne(e){try{return Cne(JSON.parse(e))}catch{return e}}function _Ge(e,t){const n=Sne(e),r=t.replace(/\s/g,"").length;let s=0,o=n;for(let i=0;i=0;i--)if(o[i]===a){o=o.substring(0,i+1);break}return o}const wGe={language:"json"},CGe=2e3,ek=({content:e,title:t,maxContentLength:n=CGe,truncationOptions:r={showTruncationIndicator:!1,format:!0},className:s,isError:o=!1,showTruncationMessage:a=!0})=>{const{formatNumber:i}=J(),{processedContent:c,originalLength:u}=d.useMemo(()=>{if(typeof e=="string")return{processedContent:bGe(e,n,r),originalLength:e.length};if(e&&typeof e=="object"){const p=Cne(e);return{processedContent:p,originalLength:p.length}}const m=String(e);return{processedContent:m,originalLength:m.length}},[e,n,r]),f=u>n;return l.jsxs(K,{className:z("rounded-lg",s),variant:"subtler",children:[l.jsx(V,{variant:"tiny",className:z("p-md pb-0",o&&"text-negative"),children:t}),l.jsx(af,{className:"p-sm !my-0 pt-0 text-xs",codeBlockProps:wGe,hideTools:!0,children:c||"No content"}),a&&f&&l.jsx("div",{className:"bg-subtler flex items-center justify-center rounded-b p-2",children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(je,{defaultMessage:"Content truncated at {truncatedSize} (original size: {originalSize})",id:"ipA00V5aGw",values:{truncatedSize:i(n/1024,{maximumFractionDigits:0,style:"unit",unit:"kilobyte",unitDisplay:"narrow"}),originalSize:i(u/1024,{maximumFractionDigits:0,style:"unit",unit:"kilobyte",unitDisplay:"narrow"})}})})})]})},Iw="clicked enterprise ad",Pw="https://www.perplexity.ai/enterprise",SGe=()=>{const{session:e}=Ne(),{trackEvent:t}=Xe(e),n=Rn(),r=d.useCallback(async h=>{h?.preventDefault(),t(Iw,{source:"settingsHeader"}),n.push(Pw)},[t,n]),s=d.useCallback(async h=>{h.preventDefault(),t(Iw,{source:"pricingTable"}),n.push(Pw)},[t,n]),o=d.useCallback(async h=>{h.preventDefault(),t(Iw,{source:"paywall"}),n.push(Pw)},[t,n]),a=d.useCallback(({orgName:h,success:g})=>{t("org created",{orgName:h,success:g})},[t]),i=d.useCallback(({invitedEmail:h,source:g,orgUUID:y,inviteType:x})=>{t("org user invited",{invitedEmail:h,source:g,orgUUID:y,inviteType:x})},[t]),c=d.useCallback(({invitedEmails:h,inviteCount:g,successCount:y,failureCount:x,source:v,orgUUID:b,inviteType:_})=>{t("org users bulk invited",{invitedEmails:h,inviteCount:g,successCount:y,failureCount:x,source:v,orgUUID:b,inviteType:_})},[t]),u=d.useCallback(({orgUUID:h})=>{t("org invite step completed",{orgUUID:h})},[t]),f=d.useCallback(({orgUUID:h,source:g,intent:y,success:x})=>t("org payment portal entered",{orgUUID:h,source:g,intent:y,success:x}),[t]),m=d.useCallback(({orgUUID:h,success:g})=>{t("sso enabled",{orgUUID:h,success:g})},[t]),p=d.useCallback(h=>{t("mcp tool action",h)},[t]);return d.useMemo(()=>({handleSettingsHeaderAdClick:r,handlePricingTableAdClick:s,handlePaywallAdClick:o,trackOrgCreated:a,trackOrgUserInvited:i,trackOrgUsersBulkInvited:c,trackOrgInviteStepCompleted:u,trackOrgPaymentPortalEntered:f,trackSSOEnabled:m,trackMcpToolApprovalAction:p}),[o,s,r,a,u,f,i,c,m,p])},Ene=A.memo(({appName:e,appLogo:t,step:n,isFinished:r,onApprove:s,onActionTaken:o})=>{const{$t:a}=J(),[i,c]=d.useState(!1),{isMobileStyle:u,isMobileUserAgent:f}=Re(),[m,p]=d.useState(!1),[h,g]=d.useState(""),[y,x]=d.useState(null),v=uee(),{trackMcpToolApprovalAction:b}=SGe(),_=n.content.tool_input_summary||a({defaultMessage:"This tool will perform an action",id:"m3EA/HeMzd"}),w=n.content,S=n.mcp_tool_output_content,C=w.request_user_approval?.uuid,E=v.isPending,T=E||r||!!y,k=d.useCallback(()=>{x(null)},[]),I=d.useCallback(F=>{if(C){if(F==="MODIFY"){p(!0);return}b({toolName:w.tool_name||"unknown_tool",appName:w.app||"unknown_app",entryUUID:C||"unknown_uuid",action:F}),x(F),v.mutate({uuid:C,allowToolCall:F},{onSuccess:()=>{o?.(),s?.()},onError:()=>{k()}})}},[C,v,k,w,b,s,o]),M=d.useCallback(()=>{!C||!h.trim()||(x("MODIFY"),b({toolName:w.tool_name||"unknown_tool",appName:w.app||"unknown_app",entryUUID:C||"unknown_uuid",action:"MODIFY"}),v.mutate({uuid:C,allowToolCall:"MODIFY",userRevision:h},{onSuccess:()=>{o?.()},onError:()=>{k()}}))},[C,h,v,k,w,b,o]),N=d.useCallback(()=>{p(!1),g(""),x(null)},[]),D=w.data_is_redacted===!0||S?.data_is_redacted===!0,j=d.useCallback(()=>{D||c(F=>!F)},[D]);return l.jsxs(K,{className:"p-sm group-hover:bg-background grid grid-cols-[max-content_1fr] gap-x-2 gap-y-1 rounded-lg border pb-7 pl-4",variant:"raised",children:[l.jsxs("div",{className:z("col-span-full grid grid-cols-subgrid items-center",{"cursor-pointer":!D}),onClick:j,children:[t&&l.jsx("img",{src:t,alt:`${w.app} Logo`,className:"size-4 rounded object-cover"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"smallBold",children:e}),!D&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:l.jsx(st,{size:"small",pill:!0,icon:i?B("chevron-down"):B("chevron-right")})})]})]}),l.jsxs("div",{className:"col-start-2 col-end-3 flex min-w-0 flex-col",children:[l.jsx(V,{variant:"small",className:"text-pretty sm:pr-8",children:_}),l.jsx(Rne,{isExpanded:i,mcpContent:w,mcpOutputContent:S}),l.jsx(pi,{mode:"popLayout",initial:!1,transition:{duration:.2,ease:Kr},children:m&&l.jsx(Oo,{children:l.jsx(hu,{value:h,onChange:g,placeholder:a({defaultMessage:"What would you like to change?",id:"VkWAi878bt"}),isMobileStyle:u,isMobileUserAgent:f,disabled:E,minRows:3,className:"mt-4"})})}),l.jsx(K,{className:"mt-4 flex items-center gap-2",children:m?l.jsxs(l.Fragment,{children:[l.jsx(Ge,{variant:"inverted",size:"small",text:a({defaultMessage:"Continue",id:"acrOozm08x"}),onClick:M,disabled:T||!h.trim()}),l.jsx(Ge,{variant:"border",size:"small",text:a({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:N,disabled:E,extraCSS:"bg-transparent"})]}):l.jsxs(l.Fragment,{children:[l.jsx(Ge,{variant:"inverted",size:"small",text:a({defaultMessage:"Approve",id:"WCaf5CZSTt"}),onClick:()=>I("ALLOW"),disabled:T}),l.jsx(Ge,{variant:"common",size:"small",text:a({defaultMessage:"Refine",id:"EBZvikr2Av"}),onClick:()=>I("MODIFY"),disabled:T}),l.jsx(Ge,{variant:"border",size:"small",text:a({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:()=>I("DENY"),disabled:T,extraCSS:"ml-auto border-none bg-transparent mr-2"})]})})]})]})});Ene.displayName="McpToolApprovalStep";const kne=A.memo(({tool_logo_url:e,app:t,merge_extra_args:n,step_uuid:r,backend_uuid:s})=>{const{$t:o}=J(),a=rCe(t||""),i=d.useCallback(async()=>{await JH({uuid:r,success:!1,reason:"User skipped authentication"})},[r]),c=d.useMemo(()=>({name:"mcp_connector_auth",upsell_type:"CONNECT_TO_CONNECTOR",app_location:"UPSELL_APP_LOCATION_UNSPECIFIED",title:o({defaultMessage:"Connect your {appName} account",id:"YPjv1DRLLL"},{appName:a}),description:o({defaultMessage:"Connect your {appName} account to get started",id:"MtMLxu8Eaj"},{appName:a}),cta:"MERGE_AUTH_CONNECTOR",icon_reference:a,...e&&{icon_image:{url:e,alt:a}},button_color:"INVERTED",button_text:"Connect",cta_information:{merge_auth_token:n?.auth_info?.auth_token,merge_auth_callback_uuid:r},show_in_comet:!0,is_persistent:!0,backend_uuid:s,image_asset:"",image_asset_low_res:"",image_asset_dark:"",image_asset_low_res_dark:"",background_super:!1,event_metadata:void 0,upsell_uuid:crypto.randomUUID(),ui_type:"BANNER_WITH_BUTTONS",action_cards:[]}),[a,s,e,o,n?.auth_info?.auth_token,r]);return l.jsx(Jd,{position:"router_steps",upsellInformation:c,backendUuid:s,isLastResult:!0,hideOnAccept:!1,hideOnReject:!1,onReject:i})});kne.displayName="UnauthenticatedMcpToolInput";const EGe={language:"json"},Mne=A.memo(e=>{const{tool_args:t,tool_name:n}=e,[r,s]=d.useState(!1),o=d.useCallback(()=>s(a=>!a),[]);return l.jsx(K,{className:"border-subtlest p-sm rounded-lg border",children:!!(t&&typeof t=="object"&&t!==null)&&l.jsxs(K,{className:"border-subtlest p-sm rounded-lg border",children:[l.jsxs(K,{className:"flex items-center justify-between",children:[l.jsx(V,{variant:"smallMono",children:n}),l.jsx(st,{size:"small",icon:r?B("chevron-down"):B("chevron-right"),onClick:o})]}),l.jsx(pi,{mode:"popLayout",transition:{duration:.2,ease:Kr},children:r&&l.jsx(Oo,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15,ease:Kr},children:l.jsxs(K,{className:"mt-sm rounded-lg",variant:"subtler",children:[l.jsx(V,{variant:"tiny",className:"p-md pb-0",children:l.jsx(je,{defaultMessage:"Request",id:"p1P+hQq6tY"})}),l.jsx(af,{className:"scrollbar-subtle my-0 max-h-[200px] overflow-y-auto text-xs",codeBlockProps:EGe,hideTools:!0,children:t&&typeof t=="object"?JSON.stringify(t):"No instructions"})]})})})]})})});Mne.displayName="AuthenticatedMcpToolInput";const Tne=A.memo(e=>{const{authenticated:t}=e;return t?l.jsx(Mne,{...e}):l.jsx(kne,{...e})});Tne.displayName="McpToolInput";const kGe=()=>{const{variation:e}=HV(!1),{mcpStdioServers:t}=Qn(),r=Kge()?.local_mcp.call===!0;return(An()?e:r)&&t!==void 0},MGe=({permission:e,connectorName:t})=>{const{$t:n}=J();return d.useMemo(()=>{if(!e)return null;switch(e){case"full_disk_access":return{title:n({defaultMessage:"Comet needs full disk access",id:"KaK1awrgFQ"}),description:n(t?{defaultMessage:"To use this connector, Comet needs permission to access your disk. Enable it in System Settings.",id:"O9WzUyHg3f"}:{defaultMessage:"To use all your connectors, Comet needs permission to access your disk. Enable it in System Settings.",id:"xusC3M5hQD"}),videoUrl:"https://r2cdn.perplexity.ai/comet/toggle-permission.mp4",tooltipTitle:n({defaultMessage:"Full disk access required",id:"ry8L5i2JdM"}),tooltipDescription:n({defaultMessage:"Turn on disk access in System Settings to use this connector",id:"zQpOIZuVrk"}),buttonText:n({defaultMessage:"Open System Settings",id:"U/a2e7uAwk"})};case"contacts":return{title:n({defaultMessage:"Comet needs access to your contacts",id:"Gh5VRh+h5k"}),description:n(t?{defaultMessage:"To use this connector, Comet needs permission to access your contacts.",id:"lbQ3o1etQa"}:{defaultMessage:"To use all your connectors, Comet needs permission to access your contacts.",id:"WgPxDUwZSj"}),videoUrl:"https://r2cdn.perplexity.ai/comet/toggle-permission.mp4",tooltipTitle:n({defaultMessage:"Contacts permission required",id:"QKFGSziMOF"}),tooltipDescription:n({defaultMessage:"Grant contacts permission to use this connector",id:"uMNpHxa2KQ"}),buttonText:n({defaultMessage:"Grant Access",id:"Xq5/HeHSIt"})};default:return null}},[n,t,e])},TGe=({connectorName:e,permission:t,cometAdapter:n})=>{const r=d.useMemo(()=>["comet/permission",t],[t]),s=ome({queryKey:r,queryFn:async()=>t?n.hasPermission(t):null}),o=Yt(),a=Rt({mutationKey:r,mutationFn:async()=>t?n.requestPermission(t):null,onSuccess:c=>{o.setQueryData(r,c)}}),i=MGe({permission:t,connectorName:e});return d.useMemo(()=>({renderData:oV(s)?i:null,isRequestingPermission:a.isPending,requestPermission:()=>a.mutateAsync()}),[s,a,i])},AGe=({cometAdapter:e,permissions:t})=>{const n=iM({queries:(t??[]).map(a=>({queryKey:["comet/permission",a],queryFn:()=>e.hasPermission(a)}))}).map(a=>({isFetching:a.isFetching,data:a.data})),s=d.useMemo(()=>{let a;return i=>(Un(a,i,Un)||(a=i),a)},[])(n);return d.useMemo(()=>{const a=s.findIndex(i=>oV(i));return t?.[a]??null},[t,s])},Ane=e=>{const{permission:t,connectorName:n,onDismiss:r}=e,s=un(),{$t:o}=J(),{renderData:a,isRequestingPermission:i,requestPermission:c}=TGe({permission:t,connectorName:n,cometAdapter:s});return a?l.jsxs(K,{variant:"subtler",className:"border-subtler flex justify-between gap-6 rounded-lg border p-6",children:[l.jsxs("div",{className:"flex flex-1 flex-col justify-center",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",as:"h3",className:"mb-1",children:a.title}),l.jsx(V,{variant:"small",color:"light",children:a.description})]}),l.jsxs("div",{className:"mt-5 flex gap-2",children:[l.jsx(wt,{variant:"primary",onClick:c,disabled:i,children:a.buttonText}),r&&l.jsx(wt,{variant:"secondary",onClick:r,children:o({defaultMessage:"Dismiss",id:"TDaF6JVgG6"})})]})]}),l.jsx("div",{className:"flex-1",children:l.jsx("video",{src:a.videoUrl,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,height:160,width:302,className:"rounded-lg"})})]}):null},NGe=e=>{const{permissions:t,className:n,connectorName:r,onDismiss:s}=e,o=un(),a=AGe({cometAdapter:o,permissions:t});return a?l.jsx("div",{className:n,children:l.jsx(Ane,{permission:a,connectorName:r,onDismiss:s})}):null},RGe=e=>{const{permissions:t,className:n,connectorName:r,onDismiss:s}=e;return l.jsx("div",{className:z("space-y-4",n),children:t.map(o=>l.jsx(Ane,{permission:o,connectorName:r,onDismiss:s},o))})},DGe=e=>{const{variant:t,...n}=e;return t==="first-required"?l.jsx(NGe,{...n}):l.jsx(RGe,{...n})},jGe=({cometAdapter:e,permissions:t})=>{const n=iM({queries:(t??[]).map(o=>({queryKey:["comet/permission",o],queryFn:()=>e.hasPermission(o)}))}).map(o=>({isFetching:o.isFetching,data:o.data})),s=d.useMemo(()=>{let o;return a=>(Un(o,a,Un)||(o=a),o)},[])(n);return d.useMemo(()=>!t||s.some(o=>o.isFetching)?null:s.every(o=>o.data!==!1),[s,t])},yP=[],IGe=({server:e,cometState:t,toolName:n})=>d.useMemo(()=>{if(!e)return null;if(!t.installedDxts)return yP;const r=dp(t.installedDxts,e);return r?Object.entries($z(r)).filter(([,{for_tools:s}])=>!s||n&&s.includes(n)).map(([s])=>s):yP},[e,t.installedDxts,n]),Mh=d.memo(()=>{const{$t:e}=J();return l.jsx(V,{variant:"micro",color:"super",className:"border-super inline-block rounded border px-1 py-0",children:e({id:"Hw1hSDsL+0",defaultMessage:"Premium data"})})});Mh.displayName="PremiumSourceLabel";const Nne=A.memo(({step:e,isFinished:t,onActionTaken:n})=>{const{lastResult:r}=on(),{submitQuery:s}=Ho(),[o,a]=d.useState(!1),i=e.content,c=e.mcp_tool_output_content,u=!o&&i.request_user_approval?.request_user_approval,f=!t&&u===!1&&!c,m=OGe({stepId:e.uuid,shouldExecuteLocalTool:f,mcpContent:i}),p=d.useMemo(()=>!!c?.should_rerun_query,[c]),h=d.useCallback(async()=>{r?.query_str&&(await au({entryUUID:r.backend_uuid,reason:"mcp-tool-output-merge-api"}),s({rawQuery:r.query_str,existingEntryUUID:r.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:r.frontend_context_uuid,promptSource:"user",querySource:"mcp-tool-input",attachments:[],modelPreferenceOverride:"pplx_pro",sourcesOverride:Fx(r.sources?.sources)}))},[s,r]);d.useEffect(()=>{p&&h()},[h,p]);const g=m?.name||i.app||"",y=m?.iconUrl||i.logo_url||xFe(i.app||"")||void 0;if(u&&m?.allPermissionsAreGranted!==!1)return l.jsx(Ene,{appName:g,appLogo:y,step:e,isFinished:t,onApprove:()=>a(!0),onActionTaken:n});const x=(!!m||i.authenticated)??null;return x===null?null:x?l.jsxs(l.Fragment,{children:[m?.askPermissionsBanner,l.jsx(PGe,{appLogo:y,appName:g,mcpContent:i,mcpOutputContent:c})]}):l.jsx(Tne,{...i,step_uuid:e.uuid??"",backend_uuid:r?.backend_uuid??"",authenticated:x,tool_args:i.tool_args,tool_logo_url:y??void 0})}),PGe=e=>{const{appLogo:t,appName:n,mcpContent:r,mcpOutputContent:s}=e,[o,a]=d.useState(!1),i=r.data_is_redacted===!0||s?.data_is_redacted===!0,c=Jh(r.source_type),u=d.useCallback(()=>{i||a(f=>!f)},[i]);return l.jsxs(K,{className:"p-sm hover:bg-raised grid grid-cols-[max-content_1fr] gap-x-2 rounded-lg border pl-4",variant:o?"raised":void 0,children:[l.jsxs("div",{className:z("col-span-full grid grid-cols-subgrid items-center",{"cursor-pointer":!i}),onClick:u,children:[l.jsx(Wz,{serverName:n,iconUrl:t,size:"sm"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"smallBold",children:n}),c&&l.jsx(Mh,{}),!i&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:l.jsx(st,{size:"small",pill:!0,icon:o?B("chevron-down"):B("chevron-right")})})]})]}),l.jsx("div",{className:"col-start-2 col-end-3 min-w-0",children:l.jsx(Rne,{isExpanded:o,mcpContent:r,mcpOutputContent:s})})]})},Rne=({isExpanded:e,mcpContent:t,mcpOutputContent:n})=>l.jsx(pi,{mode:"popLayout",initial:!1,transition:{duration:.2,ease:Kr},children:e&&l.jsx(Oo,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15,ease:Kr},children:l.jsx("div",{className:"mt-sm",children:l.jsx(Ng,{maxHeight:400,autoScroll:!1,scrollContainerClassName:"scrollbar-subtle !pl-0",showTopGradient:!1,showBottomGradient:!1,children:l.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[l.jsx(V,{variant:"tinyMono",children:t.tool_name}),!!(t.tool_args&&typeof t.tool_args=="object"&&t.tool_args!==null)&&l.jsx(ek,{title:l.jsx(je,{defaultMessage:"Request",id:"J+m4xH5bwC",description:"Request"}),content:t.tool_args,showTruncationMessage:!1}),n&&l.jsx(ek,{title:l.jsx(je,{defaultMessage:"Response",id:"UC/2Eq4W+h",description:"Response"}),content:n.content})]})})})})}),OGe=({stepId:e,shouldExecuteLocalTool:t,mcpContent:{app:n,mcp_server_type:r,tool_name:s,tool_args:o}})=>{const a=Qn(),i=kGe(),c=un(),u=l0e(),f=d.useMemo(()=>{if(!(!i||r!=="MCP_SERVER_TYPE_LOCAL"||!n))return a.mcpStdioServers?.find(w=>w.name===n)},[i,r,n,a.mcpStdioServers]),m=IGe({server:f,cometState:a,toolName:s}),p=jGe({cometAdapter:c,permissions:m}),{mutateAsync:h}=Rt({mutationKey:["comet/execute-local-tool",e],mutationFn:async({content:w,isError:S=!1})=>{if(!e)throw new Error("StepID is not set");return de.POST("/rest/sse/perplexity_mcp_response","local-mcp-step",{body:{result:{content:w,is_error:S,uuid:e}}})}}),g=d.useCallback(()=>{h({content:'The MCP tool call was rejected by the user because he dismissed the permission request (refer to them as "you" or use the appropriate equivalent in their language when mentioning this)'})},[h]),y=!!(t&&n&&s&&e&&p);mt({queryKey:be.makeQueryKey("comet/auto-execute-local-tool",e),enabled:y,queryFn:async()=>{if(!n||!s||!e)throw new Error("Missing required parameters");try{const w=await u.callMcpTool({mcpServerName:n,toolName:s,toolArgs:o},{step_uuid:e});return await h({content:w.content.map(S=>S.text).filter(Boolean).join(` - -`)}),!0}catch(w){return await h({content:`The MCP tool call failed: ${w instanceof Error?w.message:"Unknown error"}`,isError:!0}),!1}}});const x=d.useMemo(()=>f?dp(a.installedDxts,f):null,[a.installedDxts,f]),v=x?.display_name??x?.name??n,{data:b}=z4(),_=d.useMemo(()=>f?Gz(b,f):null,[b,f]);return d.useMemo(()=>v?{name:v,iconUrl:_??null,allPermissionsAreGranted:p,askPermissionsBanner:t&&!p&&m?l.jsx(DGe,{variant:"all",connectorName:v,permissions:m,className:"mb-4",onDismiss:g}):null}:null,[p,v,g,_,m,t])};Nne.displayName="McpInputOutputStep";const Dne=A.memo(e=>{const{content:t,shouldRerunQuery:n=!1}=e,{lastResult:r}=on(),{submitQuery:s}=Ho(),o=d.useCallback(async()=>{r?.query_str&&(await au({entryUUID:r.backend_uuid,reason:"mcp-tool-output-merge-api"}),s({rawQuery:r.query_str,existingEntryUUID:r.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:r.frontend_context_uuid,promptSource:"user",querySource:"mcp-tool-input",attachments:[],modelPreferenceOverride:"pplx_pro"}))},[s,r]);return d.useEffect(()=>{n&&o()},[o,n]),l.jsx(K,{className:"border-subtlest p-sm rounded-lg border",children:l.jsx(ek,{title:l.jsx(je,{defaultMessage:"Response",id:"MgdnPiJHcj"}),content:t})})});Dne.displayName="McpToolOutput";const jne=A.memo(({step:e,action:t})=>{const{final:n}=e.content,r=!n;return l.jsx(Ge,{text:t,icon:B("file-type-pdf"),isLoading:r,size:"tiny",pill:!0})});jne.displayName="PdfStep";const xP=["start","end"],Ine=A.memo(({attachments:e,attachmentProcessingProgress:t})=>{const{$t:n}=J(),s=e.filter(m=>_d(m)).length+t.length,o=e.length+xP.length,a=Math.min(s/o*100,100),i=t.filter(m=>!m.success),c=d.useMemo(()=>!!t.filter(m=>m.file_url==="end").length,[t]),u=d.useCallback(m=>{const p=cu(m.file_url??"");let h;switch(m.error_code){case"token_limit_exceeded":h=n({defaultMessage:"{filename} exceeds the model's token limit.",id:"60iyTByOrX"},{filename:p});break;case"file_type_not_supported":h=n({defaultMessage:"{filename} is of an unsupported file type. It will not be included in the results.",id:"sB9AI6thAL"},{filename:p});break;case"no_data_received":h=n({defaultMessage:"{filename} has timed out.",id:"/wyRgEWdz7"},{filename:p});break;default:h=n({defaultMessage:"{filename} could not be read. It will not be included in the results.",id:"7w0MjjvHs3"},{filename:p});break}return h},[n]),f=d.useMemo(()=>{const m=i.map((h,g)=>l.jsx(tk,{icon:B("exclamation-circle"),text:u(h)},g)),p=l.jsx(tk,{icon:B("check"),text:n({defaultMessage:"Successfully read {numAttachments} attached files.",id:"5VxFwE1ux3"},{numAttachments:s-i.length-xP.length})});return[...m,...c?[p]:[]]},[i,n,s,c,u]);return l.jsx(Qf,{className:"pt-md pb-xs px-xs !border-[#32B8C6]",children:l.jsx(Ng,{maxHeight:250,autoScroll:!1,children:l.jsxs("div",{className:"pr-md gap-x-md flex w-full",children:[l.jsx(V,{className:"bg-super flex size-8 flex-none items-center justify-center rounded-md border-[0.75px] border-[#05FFFF]/20 shadow-[0px_1px_4px_0px_rgba(0,0,0,0.24)]",children:l.jsx(ge,{icon:B("paperclip"),size:"md",className:"text-inverse"})}),l.jsxs("div",{className:"gap-y-xs flex grow flex-col",children:[l.jsx(V,{variant:"smallBold",children:n({defaultMessage:"Reading {numAttachments} attached {numAttachments, plural, one {file} other {files}}",id:"BqiTCbmvgp"},{numAttachments:e.length})}),l.jsx("div",{className:"h-2 w-full rounded-[37px] bg-[#60584D]/[0.06]",children:l.jsx("div",{className:"h-2 rounded-[37px] bg-[#32B8C6] transition-all duration-300",style:{width:`${a}%`}})}),l.jsxs("div",{className:"pt-xs",children:[l.jsx(Zf,{items:f,vertical:!0,truncate:!1}),!c&&l.jsx(br,{variant:"super",active:!c,as:"span",className:"pt-xs",children:l.jsx(V,{variant:"small",color:"super",children:n({defaultMessage:"Reading...",id:"IvE1kfOWAz"})})})]})]})]})})})});Ine.displayName="PendingFilesStep";const tk=A.memo(({icon:e,text:t})=>l.jsxs("div",{className:"py-xs gap-x-sm flex",children:[l.jsx(V,{className:"flex items-center justify-center",children:l.jsx(rn,{icon:e,size:"small"})}),l.jsx(V,{variant:"small",color:"light",children:t})]}));tk.displayName="PendingFilesItem";const Pne=A.memo(({user:e,onRemove:t})=>{const n=d.useCallback(()=>{t(e)},[t,e]);return l.jsxs("div",{className:"border-subtlest gap-two pr-three flex h-8 items-center justify-between rounded-lg border pl-1.5 font-sans shadow-sm",children:[l.jsxs("div",{className:"gap-xs px-xs flex min-w-0 flex-row text-left",children:[l.jsx(V,{variant:"small",as:"span",children:e.display_name}),l.jsx(V,{variant:"small",color:"light",className:"truncate",as:"span",children:e.email_address})]}),l.jsx(st,{variant:"common",size:"tiny",onClick:n,icon:B("x"),extraCSS:"rounded-md","aria-label":`Remove ${e.display_name}`})]})});Pne.displayName="UserPill";const One=A.memo(({goalId:e,foundUsers:t,names:n,sendStepResult:r})=>{const{$t:s}=J(),[o,a]=d.useState([]),i=d.useRef(null);d.useEffect(()=>{i.current&&i.current.focus()},[]);const c=d.useCallback(y=>{const x=y.map(v=>({...v,selected:!0}));a(x)},[]),u=d.useCallback(async()=>{await r({goal_id:e,selected_users:o,submitted:!0},"User selected contacts and clicked continue",!1)},[e,o,r]),f=d.useCallback(y=>{Ls.isEnterKeyWithoutShift(y.nativeEvent)&&o.length>0&&(y.preventDefault(),u())},[o.length,u]),m=d.useMemo(()=>({chooseContacts:s({defaultMessage:"Confirm or change contacts",id:"j4L7Bt/R+D"}),moreContacts:s({defaultMessage:"More contacts...",id:"XqmjEIgTyk"}),pickContacts:s({defaultMessage:"Pick contacts...",id:"dAWwl8XInO"}),continue:s({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),skip:s({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[s]),p=d.useMemo(()=>(t??[]).map(y=>({type:"default",text:y.display_name??"",description:y.email_address??"",active:o.some(x=>x.email_address===y.email_address),preserveRightElementSpace:!0,onClick:()=>{const x=o.some(v=>v.email_address===y.email_address);c(x?o.filter(v=>v.email_address!==y.email_address):[...o,y])}})),[t,o,c]);d.useEffect(()=>{if(t&&t.length>0&&o.length===0){const y=t.filter(x=>x.selected);if(y.length>0)c(y);else{const x=Math.min(n?.length||1,t.length);c(t.slice(0,x))}}},[t]);const h=d.useCallback(y=>{c(o.filter(x=>x.email_address!==y.email_address))},[o,c]),g=d.useCallback(async()=>{await r({goal_id:e,selected_users:t,submitted:!1},"User clicked skip",!1)},[t,e,r]);return l.jsxs(dr,{ref:i,className:"py-2 pt-4 outline-none",onKeyDown:f,tabIndex:0,children:[l.jsxs("div",{className:"gap-md flex flex-col px-4",children:[l.jsx(V,{variant:"smallBold",children:m.chooseContacts}),l.jsxs("div",{className:"gap-sm flex flex-wrap items-stretch",children:[o.map(y=>l.jsx(Pne,{user:y,onRemove:h},y.email_address)),o.length<(t?.length??0)&&l.jsx(zs,{items:p,isMobileStyle:!1,placement:"bottom-start",children:l.jsx(Ge,{variant:"border",size:"small",icon:B("plus"),"aria-label":o.length===0?m.moreContacts:m.pickContacts})})]})]}),l.jsxs("div",{className:"gap-sm mt-4 flex items-center px-4 py-2",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:m.continue,disabled:o.length===0,onClick:u}),l.jsx(st,{size:"small",text:m.skip,onClick:g})]})]})});One.displayName="PickContactsStep";const Lne=A.memo(({stepUUID:e,goalId:t,foundBookingOptions:n,isSubmitted:r})=>{const{$t:s}=J(),[o,a]=d.useState(n?.[0]),[i,c]=d.useState(0),u=d.useRef(null),f=d.useRef([]),m=d.useMemo(()=>({title:s({defaultMessage:"Choose booking options",id:"5yyo9+Yhan"}),description:s({defaultMessage:"Select your preferred booking provider",id:"gnnwIHEPAG"}),continue:s({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),confirmed:s({defaultMessage:"Confirmed",id:"dX7+RvbH/9"}),skip:s({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[s]),p=d.useCallback(async()=>{await Qp({stepUUID:e,result:{goal_id:t,selected_booking_options:o,submitted:!0},reason:"User selected booking and clicked continue"})},[e,t,o]),h=d.useCallback(async()=>{await Qp({stepUUID:e,result:{goal_id:t,selected_booking_options:void 0,submitted:!1},reason:"User clicked skip"})},[t,e]),g=d.useCallback(v=>{a(v)},[]),y=d.useCallback(v=>{c(v)},[]),x=d.useCallback((v,b)=>{f.current[b]=v},[]);return d.useEffect(()=>{if(!n?.length||r)return;const v=_=>{const w=S=>{_.preventDefault(),c(C=>{const E=S==="down"?Math.min(C+1,n.length-1):Math.max(C-1,0);return f.current[E]?.focus(),E})};switch(_.key){case"ArrowDown":w("down");break;case"ArrowUp":w("up");break;case"Enter":case" ":_.preventDefault(),i>=0&&ib.removeEventListener("keydown",v)},[n,i,r]),l.jsxs(Qf,{className:"pb-2 outline-none",title:m.title,description:m.description,descriptionClassName:"text-quiet",children:[l.jsx("div",{className:"gap-md mt-md flex flex-col px-4",children:l.jsx("div",{ref:u,className:"gap-xs flex flex-col",tabIndex:-1,role:"listbox","aria-label":"Booking options",children:(n??[]).map((v,b)=>{const _=o===v,w=z("group flex w-full items-center rounded-none border outline-none transition-[border-color,border-radius,box-shadow] duration-200 hover:transition-none",!r&&"cursor-pointer","border-t-subtlest border-x-transparent","last:border-b-subtlest [&:not(:last-child)]:border-b-transparent",_&&["!border-super/75 dark:bg-black bg-gradient-to-r from-super/25 to-super/25 !rounded-lg shadow-sm"],!_&&!r&&["hover:!border-subtlest hover:bg-subtler hover:rounded-lg","focus-visible:!border-subtlest focus-visible:bg-subtler focus-visible:rounded-lg"],!r&&'[&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:border-t-transparent [&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:transition-none');return l.jsx("div",{ref:S=>x(S,b),tabIndex:r?-1:0,role:"option","aria-selected":_,"data-selected":_,className:w,onClick:()=>!r&&g(v),onFocus:()=>!r&&y(b),children:l.jsxs("div",{className:"flex w-full items-center justify-between px-5 py-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[v?.together?.airline_logos?.[0]&&l.jsx("img",{src:v.together.airline_logos[0],alt:"airline logo",className:"-mt-two size-6 rounded object-contain"}),l.jsx("div",{className:"flex flex-col items-start gap-px",children:l.jsxs(V,{variant:"baseSemi",children:[v?.together?.book_with||"Flight",v?.together?.option_title?` (${v.together.option_title})`:""]})})]}),v?.together?.price&&l.jsxs(V,{variant:"baseSemi",className:"font-bold",children:["$",v.together.price]})]})},b)})})}),l.jsxs("div",{className:"gap-sm mt-sm flex items-center px-4 py-2",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:r?m.confirmed:m.continue,icon:r?B("check"):void 0,disabled:!o||r,onClick:p}),l.jsx(st,{size:"small",text:m.skip,disabled:r,onClick:h})]})]})});Lne.displayName="PickFlightsBookingStep";const vP={weekday:"short",month:"short",day:"numeric",year:"numeric"},LGe={hour:"numeric",minute:"2-digit",hour12:!0},nk="en-US",bP=e=>{if(!e)return"00:00 AM";try{return new Date(e).toLocaleTimeString(nk,LGe).toUpperCase()}catch{return"00:00 AM"}},FGe=e=>{if(!e)return"";const t=Math.floor(e/60),n=e%60;return`${t}h ${n}m`},BGe=e=>{if(!e||e.length===0)return"Nonstop";const t=e.length;return`${t} Stop${t>1?"s":""}`},_P=e=>{if(!e||e.length===0)return null;if(e.length===1){const t=e[0]?.duration||0,n=Math.floor(t/60),r=t%60;return`${n}h ${r}m ${e[0]?.id}`}return e.map(t=>t.id).join(", ")},UGe=(e,t,n)=>{if(!e)return"";const s=new Date(e).toLocaleDateString(nk,vP);if(n==="ROUND_TRIP"&&t){const i=new Date(t).toLocaleDateString(nk,vP);return` · ${s} – ${i}`}return` · ${s}`},Fne=A.memo(({flight:e,index:t,isSelected:n,isSubmitted:r,onSelect:s,onFocus:o,setRef:a})=>{const i=e.flights?.[0]?.departure_airport?.time,c=e.flights?.[e.flights.length-1]?.arrival_airport?.time,u=e.flights?.[0]?.departure_airport?.id||"XXX",f=e.flights?.[e.flights.length-1]?.arrival_airport?.id||"XXX",m=e.flights?.[0]?.airline,p=z("group flex w-full items-center rounded-none border outline-none transition-[border-color,border-radius,box-shadow] duration-200 hover:transition-none",!r&&"cursor-pointer","border-t-subtlest border-x-transparent","last:border-b-subtlest [&:not(:last-child)]:border-b-transparent",n&&["!border-super/75 dark:bg-black bg-gradient-to-r from-super/25 to-super/25 !rounded-lg shadow-sm"],!n&&!r&&["hover:!border-subtlest hover:bg-subtler hover:rounded-lg","focus-visible:!border-subtlest focus-visible:bg-subtler focus-visible:rounded-lg"],!r&&'[&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:border-t-transparent [&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:transition-none');return l.jsx("div",{ref:h=>a(h,t),tabIndex:r?-1:0,role:"option","aria-selected":n,"data-selected":n,className:p,onClick:()=>!r&&s(e),onFocus:()=>!r&&o(t),children:l.jsxs("div",{className:"grid w-full grid-cols-[auto_1fr_88px_88px_88px] items-start gap-6 px-5 py-4",children:[l.jsx("div",{className:"pt-two flex self-stretch",children:e.airline_logo&&l.jsx("img",{src:e.airline_logo,alt:"airline logo",className:"size-10 rounded object-contain"})}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx(V,{variant:"baseSemi",children:bP(i)}),l.jsx("span",{className:"text-quieter px-1",children:"–"}),l.jsx(V,{variant:"baseSemi",children:bP(c)})]}),m&&l.jsx(V,{variant:"tinyMono",color:"light",children:m})]}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsx(V,{variant:"baseSemi",children:FGe(e.total_duration)}),l.jsxs(V,{variant:"tinyMono",color:"light",children:[u,"–",f]})]}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsx(V,{variant:"baseSemi",children:BGe(e.layovers)}),_P(e.layovers)&&l.jsx(V,{variant:"tinyMono",color:"light",children:_P(e.layovers)})]}),l.jsxs("div",{className:"flex flex-col items-end justify-end gap-px",children:[e.price&&l.jsxs(V,{variant:"baseSemi",className:"font-bold",children:["$",e.price]}),l.jsx(V,{variant:"tinyMono",color:"light",children:e.type})]})]})},`flight-${t}`)});Fne.displayName="FlightCard";const Bne=A.memo(({stepUUID:e,goalId:t,foundFlights:n,isSubmitted:r,outboundDate:s,returnDate:o,flightType:a})=>{const{$t:i}=J(),[c,u]=d.useState(n?.length>0?0:-1),[f,m]=d.useState(0),p=d.useRef(null),h=d.useRef([]),g=d.useMemo(()=>UGe(s,o,a),[s,o,a]),y=d.useMemo(()=>({title:i({defaultMessage:"Top departing flights",id:"tHwLRV4b68"})+g,description:i({defaultMessage:"Ranked by price and convenience. Prices include taxes and fees for one adult.",id:"cAxRMXuRMO"}),continue:i({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),confirmed:i({defaultMessage:"Confirmed",id:"dX7+RvbH/9"}),skip:i({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[i,g]),x=d.useCallback(async()=>{const S=c>=0&&n?n[c]:void 0;await Qp({stepUUID:e,result:{goal_id:t,selected_flight:S,submitted:!0},reason:"User selected flight and clicked continue"})},[e,t,c,n]),v=d.useCallback(async()=>{await Qp({stepUUID:e,result:{goal_id:t,selected_flight:void 0,submitted:!1},reason:"User clicked skip"})},[t,e]),b=d.useCallback(S=>{const C=n?.findIndex(E=>E===S)??-1;u(C)},[n]),_=d.useCallback(S=>{m(S)},[]),w=d.useCallback((S,C)=>{h.current[C]=S},[]);return d.useEffect(()=>{if(!n?.length||r)return;const S=E=>{const T=k=>{E.preventDefault(),m(I=>{const M=k==="down"?Math.min(I+1,n.length-1):Math.max(I-1,0);return h.current[M]?.focus(),M})};switch(E.key){case"ArrowDown":T("down");break;case"ArrowUp":T("up");break;case"Enter":case" ":E.preventDefault(),f>=0&&fC.removeEventListener("keydown",S)},[n,f,r]),l.jsxs(Qf,{className:"pb-2 outline-none",title:y.title,description:y.description,descriptionClassName:"text-quiet",children:[l.jsx("div",{className:"gap-md mt-md flex flex-col px-4",children:l.jsx("div",{ref:p,className:"gap-xs flex flex-col",tabIndex:-1,role:"listbox","aria-label":"Flight options",children:(n??[]).map((S,C)=>l.jsx(Fne,{flight:S,index:C,isSelected:c===C,isSubmitted:r,onSelect:b,onFocus:_,setRef:w},C))})}),l.jsxs("div",{className:"gap-sm mt-sm flex items-center px-4 py-2",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:r?y.confirmed:y.continue,icon:r?B("check"):void 0,disabled:c<0||r,onClick:x}),l.jsx(st,{size:"small",text:y.skip,disabled:r,onClick:v})]})]})});Bne.displayName="PickFlightsSearchStep";const Une=d.memo(({children:e,defaultExpanded:t=!1,title:n})=>{const{$t:r}=J(),[s,o]=d.useState(t),a=d.useCallback(()=>{o(c=>!c)},[]),i=d.useMemo(()=>s?B("chevron-down"):B("chevron-right"),[s]);return l.jsx(pi,{className:"overflow-hidden",transition:{duration:.3,ease:Kr},children:l.jsxs("div",{children:[l.jsx(Ge,{variant:"common",text:n??r({defaultMessage:"Advanced",id:"3Rx6Qo1x+1"}),onClick:a,size:"tiny",icon:i,noPadding:!0,extraCSS:"!bg-transparent hover:!bg-subtler"}),l.jsx(Oo,{children:s&&l.jsx("div",{className:"pt-2",children:e})})]})})});Une.displayName="AutomationAdvancedSection";const VGe=[{value:"ONCE",label:"Once"},{value:"DAILY",label:"Daily"},{value:"WEEKLY",label:"Weekly"},{value:"WEEKDAYS",label:"Every weekday"},{value:"MONTHLY",label:"Monthly"},{value:"YEARLY",label:"Yearly"}],HGe=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],zGe=[...Array(31)].map((e,t)=>({value:String(t+1),label:String(t+1)})),WGe=[{value:"0",label:"January"},{value:"1",label:"February"},{value:"2",label:"March"},{value:"3",label:"April"},{value:"4",label:"May"},{value:"5",label:"June"},{value:"6",label:"July"},{value:"7",label:"August"},{value:"8",label:"September"},{value:"9",label:"October"},{value:"10",label:"November"},{value:"11",label:"December"}],wP=({hour:e,minute:t})=>`${e%12||12}:${t.toString().padStart(2,"0")} ${e>=12?"PM":"AM"}`,CP=e=>{const t=e.trim().match(/^((?:0?[1-9]|1[0-2])):([0-5]\d)\s*([ap]m)$/i);if(!t||t.length!==4)return null;const n=parseInt(t[1]??"",10),r=parseInt(t[2]??"",10);if(isNaN(n)||isNaN(r))return null;const s=t[3]?.toLowerCase();return s==="pm"&&n!==12?{hour:n+12,minute:r}:s==="am"&&n===12?{hour:0,minute:r}:{hour:n,minute:r}},GGe=(e,t)=>e.hour===t.hour&&e.minute===t.minute,$Ge=Array.from({length:48},(e,t)=>({hour:Math.floor(t/2),minute:t%2*30}));function qGe({value:e,onChange:t,placeholder:n="Select time",variant:r="default",withIcon:s}){const[o,a]=d.useState(""),[i,c]=d.useState(!1),u=d.useRef(null),f=o.trim()!==""&&!CP(o),m=d.useRef(null),p=e?wP(e):n,h=d.useMemo(()=>$Ge.map(S=>({key:`${S.hour}:${S.minute}`,label:wP(S),value:S})),[]),g=d.useCallback(S=>{S&&i&&e&&m.current&&m.current?.scrollIntoView({behavior:"instant",block:"start"})},[i,e]),y=()=>{const S=CP(o);S&&t(S),a("")},x=S=>{t(S),a(""),c(!1)},v=()=>{c(!i)},b=()=>{c(!i),setTimeout(()=>{u.current&&u.current.focus()},0)},_=(()=>{switch(r){case"subtle":return"bg-subtle";case"default":return"bg-subtler";default:At(r)}})(),w=d.useMemo(()=>l.jsx(ge,{icon:B("clock"),size:"sm"}),[]);return l.jsx("div",{className:"relative size-full",children:l.jsx(Fl,{interaction:"click",open:i,onOpenChange:c,triggerElement:l.jsxs("div",{role:"button",tabIndex:0,onClick:v,className:z(_,"text-foreground flex size-full cursor-pointer items-center gap-2 rounded-lg px-4 font-sans","border transition-colors duration-200 ease-out","outline-none focus:outline-none focus:ring-0","hover:border-subtler focus-within:border-subtler border-transparent",{"!border-negative":f}),children:[s&&w,l.jsx("input",{ref:u,type:"text",value:o||p,placeholder:n,onChange:S=>a(S.target.value),onBlur:y,onClick:b,className:"w-full bg-transparent text-sm focus:outline-none"}),l.jsx(ge,{size:"xs",icon:B("chevron-down"),className:"right-sm pointer-events-none absolute text-inherit opacity-50"})]}),children:l.jsx("div",{ref:g,className:"p-xs scrollbar-subtle max-h-64 overflow-y-auto",children:h.map(S=>l.jsx("div",{ref:e&&GGe(S.value,e)?m:null,role:"button",tabIndex:0,onClick:()=>x(S.value),className:"px-sm text-foreground cursor-pointer rounded-lg py-1.5 hover:bg-subtler",children:l.jsx(V,{variant:"extraSmall",children:S.label})},S.key))})})})}const lf=d.memo(({children:e})=>l.jsx("div",{className:"min-w-0 flex-1 rounded-md",children:e}));lf.displayName="InputWrapper";const sp=d.memo(({options:e,value:t,onChange:n,isMobileStyle:r,variant:s="default"})=>{const o=J(),a=d.useMemo(()=>e.map(p=>({type:"default",text:p.label,onClick:()=>n(p.value),active:p.value===t,role:"menuitemradio"})),[n,e,t]),c=d.useMemo(()=>e.find(p=>p.value===t),[e,t])?.label||o.formatMessage({defaultMessage:"Select...",id:"724CrE1YuG"}),u=d.useMemo(()=>({className:"w-full"}),[]),f=d.useMemo(()=>({matchTargetWidth:!0,avoidPositionCollisions:!1}),[]),m=(()=>{switch(s){case"subtle":return"";case"default":return"!bg-subtler";default:At(s)}})();return l.jsx(lf,{children:l.jsx(zs,{items:a,isMobileStyle:r,placement:"bottom",contentClassName:"w-full",boxProps:u,popoverProps:f,children:l.jsx(Ge,{text:c,extraCSS:z("px-4 size-full !h-10 border-0 !outline-none !justify-start font-normal",m),textClassName:"text-left text-foreground text-sm font-normal",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down")})})})});sp.displayName="FormSelect";const X6=d.memo(({schedule:e,onScheduleChange:t,variant:n="default"})=>{const{formatMessage:r}=J(),{isMobileStyle:s}=Re(),o=d.useMemo(()=>new Date(e.year,e.month,e.day,e.hour,e.minute),[e.year,e.month,e.day,e.hour,e.minute]),{kind:a}=e,i=a==="ONCE",c=a==="WEEKLY",u=a==="MONTHLY"||a==="YEARLY",f=a==="YEARLY",m=d.useCallback(b=>{t({kind:b})},[t]),p=d.useCallback(b=>{t({dayOfWeek:parseInt(b,10)})},[t]),h=d.useCallback(b=>{t({month:parseInt(b,10)})},[t]),g=d.useCallback(b=>{t({day:parseInt(b,10)})},[t]),y=d.useCallback(b=>{b&&t({day:b.getDate(),month:b.getMonth(),year:b.getFullYear()})},[t]),x=d.useCallback(b=>{t({hour:b.hour,minute:b.minute})},[t]),v=d.useMemo(()=>({hour:e.hour,minute:e.minute}),[e.hour,e.minute]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:r({defaultMessage:"Schedule",id:"hGQqkWwmJD"})}),l.jsxs("div",{className:"flex h-10 flex-wrap gap-3",children:[l.jsx(sp,{options:VGe,value:e.kind,onChange:m,isMobileStyle:s,variant:n}),c&&l.jsx(sp,{options:HGe,value:String(e.dayOfWeek),onChange:p,isMobileStyle:s,variant:n}),f&&l.jsx(sp,{options:WGe,value:String(e.month),onChange:h,isMobileStyle:s,variant:n}),u&&l.jsx(sp,{options:zGe,value:String(e.day),onChange:g,isMobileStyle:s,variant:n}),i&&l.jsx(lf,{children:l.jsx(T2,{value:o,onChange:y,variant:n})}),l.jsx(lf,{children:l.jsx(qGe,{value:v,onChange:x,variant:n})})]})]})});X6.displayName="ScheduleSelect";const KGe=He({selectModel:{defaultMessage:"Select model...",id:"XZsGHYyuKM"}}),YGe=({selectedModel:e,onModelChange:t,variant:n="default",isOpen:r,onOpen:s,onClose:o})=>{const a=e||ie.PRO,{$t:i}=J(),{isMobileStyle:c}=Re(),{menuItems:u}=QY({searchMode:oe.SEARCH,currentModel:a,onModelSelect:p=>{t?.(p)}}),f=$n[a].name||KGe.selectModel,m=(()=>{switch(n){case"subtle":return"bg-subtle";case"default":return"!bg-subtler";default:At(n)}})();return l.jsx(zs,{items:u,isMobileStyle:c,placement:"bottom",contentClassName:"w-full",boxProps:{className:"w-full max-w-full"},popoverProps:{matchTargetWidth:!0,avoidPositionCollisions:!1},isOpen:r,onOpen:s,onClose:o,children:l.jsx(Ge,{text:i(f),extraCSS:z("px-4 size-full !h-10 border-0 !outline-none !justify-start font-normal",m),textClassName:"text-left text-foreground text-sm font-normal",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down")})})};function QGe({sources:e,onChange:t,variant:n="default",isOpen:r,onOpen:s,onClose:o}){const{$t:a}=J(),{getSourceLabel:i}=nc(),c=d.useMemo(()=>{if(e.length===1){const m=e[0];if(m)return i(m)}return a({defaultMessage:"{count} sources",id:"l1+6PggBqU"},{count:e.length})},[e,i,a]),u=m=>{t(m.filter(ha))},f=d.useMemo(()=>l.jsx(Dt.Button,{variant:"tonal",children:c}),[c]);return l.jsx(PA,{isOpen:r??!1,sources:e,onChange:u,triggerElement:f,onOpen:s,onClose:o,omitCometMcpSources:!0,omittedSources:["org","google_drive","onedrive","sharepoint","my_files"]})}const rb=d.memo(({searchModel:e,onSearchModelChange:t,sources:n,onSourcesChange:r,variant:s="default"})=>{const o=an(e),{hasActiveSubscription:a}=$t(),[i,c]=d.useState(!1),[u,f]=d.useState(!1),m=d.useCallback(()=>{c(!0),f(!1)},[]),p=d.useCallback(()=>{c(!1)},[]),h=d.useCallback(()=>{f(!0),c(!1)},[]),g=d.useCallback(()=>{f(!1)},[]);return l.jsx("div",{className:"flex w-full flex-col gap-2",children:l.jsxs("div",{className:"flex gap-3",children:[a&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Mode",id:"mrOnjMzgC4"})}),l.jsx("div",{className:"h-full w-fit",children:l.jsx(OY,{value:e,onChange:t,layoutKey:"task-modal",className:"h-full",variant:s,buttonSize:"regular"})})]}),a&&o===oe.SEARCH&&l.jsxs("div",{className:"flex min-w-[100px] flex-1 flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Model",id:"rhSI1/3g21"})}),l.jsx(lf,{children:l.jsx(YGe,{selectedModel:e,onModelChange:t,variant:s,isOpen:i,onOpen:m,onClose:p})})]}),a&&l.jsxs("div",{className:"flex min-w-[100px] flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Sources",id:"fhwTpAcBLC"})}),l.jsx(lf,{children:l.jsx(QGe,{sources:n,onChange:r,variant:s,isOpen:u,onOpen:h,onClose:g})})]})]})})});rb.displayName="QuerySearchConfigurationSelector";const Vne=d.memo(({query:e,onQueryChange:t})=>{const{$t:n}=J(),{hasActiveSubscription:r}=$t(),s=d.useCallback(i=>{t({...e,searchModel:i})},[t,e]),o=d.useCallback(i=>{t({...e,sources:i})},[t,e]);if(!r)return null;const a=n({defaultMessage:"Model options",id:"ObVxV7yacw"});return l.jsx(Une,{title:a,children:l.jsx(rb,{searchModel:e.searchModel,onSearchModelChange:s,sources:e.sources??Zh(),onSourcesChange:o,variant:"subtle"})})});Vne.displayName="ScheduledAutomationAdvancedConfiguration";const Hne=d.memo(({trigger:e,query:t,onQueryChange:n})=>{switch(e.type){case Ze.SCHEDULED:return l.jsx(Vne,{query:t,onQueryChange:n});case Ze.PRICE_ALERT:case Ze.SHORTCUT:return null;default:At(e)}});Hne.displayName="AutomationAdvancedSettingsConfiguration";const zne=d.memo(({expiryDate:e,onExpiryDateChange:t,schedule:n})=>{const{$t:r}=J(),s=d.useCallback(i=>{i.stopPropagation(),t(null)},[t]),o=d.useMemo(()=>l.jsx(Ge,{type:"button",onClick:s,icon:B("x"),size:"tiny",variant:"common"}),[s]),a=d.useMemo(()=>{if(e===null)return;const i=n?h4(n):void 0;return i?US(i,1):void 0},[e,n]);return l.jsx(T2,{value:e===null?void 0:e,onChange:t,buttonClassName:"w-full py-sm bg-subtle",trailingIcon:o,fromDate:a,placeholder:r({defaultMessage:"None selected",id:"7MYtB45RD0"})})});zne.displayName="AutomationExpiryDatePicker";const Wne=d.memo(({defaultExpiryDate:e,expiryDate:t,onExpiryDateChange:n,schedule:r})=>{const s=d.useCallback(o=>{n?.(o)},[n]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Expiration date",id:"CICBj0Td+l"})}),l.jsx(zne,{expiryDate:t||e,onExpiryDateChange:s,schedule:r})]})});Wne.displayName="ExpiryDateSection";const Gne=d.memo(({trigger:e,onTriggerChange:t})=>{const n=d.useCallback(r=>{e.type===Ze.SCHEDULED&&t({...e,type:Ze.SCHEDULED,expiryDate:r})},[t,e]);switch(e.type){case Ze.SCHEDULED:return e.schedule.kind!=="ONCE"?l.jsx(Wne,{defaultExpiryDate:e.defaultExpiryDate,expiryDate:e.expiryDate,onExpiryDateChange:n,schedule:e.schedule}):null;case Ze.PRICE_ALERT:case Ze.SHORTCUT:return null;default:At(e)}});Gne.displayName="AutomationExpiryDateConfiguration";const XGe=({options:e,selectedValues:t,onSelectionChange:n,placeholder:r="Select options...",disabled:s=!1})=>{const o=J(),{isMobileStyle:a}=Re(),[i,c]=d.useState(!1),u=d.useCallback(x=>{const b=t.includes(x)?t.filter(_=>_!==x):[...t,x];n(b)},[t,n]),f=d.useMemo(()=>e.map(x=>{const v=t.includes(x.value);return{type:"multiSelect",text:x.label,onClick:()=>{u(x.value)},selected:v,iconVariant:"check",disableActiveStyles:!0}}),[e,t,u]),m=d.useMemo(()=>{if(t.length===0)return r;const x=t.map(v=>e.find(b=>b.value===v)?.label).filter(Boolean);return new Intl.ListFormat(o.locale,{style:"long",type:"conjunction"}).format(x)},[t,e,r,o.locale]),p=d.useCallback(()=>c(!0),[]),h=d.useCallback(()=>c(!1),[]),g=d.useMemo(()=>({className:"w-[180px]"}),[]),y=d.useMemo(()=>({matchTargetWidth:!1,avoidPositionCollisions:!1}),[]);return l.jsx(zs,{isOpen:i,onOpen:p,onClose:h,items:f,isMobileStyle:a,placement:"bottom-end",contentClassName:"w-full",boxProps:g,popoverProps:y,disabled:s,alwaysShowChildren:!0,children:l.jsx(Ge,{text:m,extraCSS:"px-4 w-full !h-10 border-0 !outline-none !justify-start font-normal",textClassName:"text-left text-foreground text-sm font-normal truncate",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down"),disabled:s})})},ZGe=(e,t)=>{const{value:n,loading:r}=zt({flag:"app-notifications",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},$ne=d.memo(({notificationSettings:e,onNotificationSettingsChange:t,disabled:n})=>{const{$t:r}=J(),{variation:s,loading:o}=ZGe(!1),a=d.useMemo(()=>{const u=[];return s&&!o&&u.push({value:"in_app",label:r({defaultMessage:"In-app",id:"E7zWOQXV+k"})}),u.push({value:"email",label:r({defaultMessage:"Email",id:"sy+pv5U9ls"})},{value:"push",label:r({defaultMessage:"Mobile",id:"GWtmtuCmOx"})}),u},[r,s,o]),i=d.useMemo(()=>{const u=[];return s&&!o&&e.should_send_in_app&&u.push("in_app"),e.should_send_email&&u.push("email"),e.should_send_push&&u.push("push"),u},[e,s,o]),c=d.useCallback(u=>{t({should_send_email:u.includes("email"),should_send_push:u.includes("push"),should_send_in_app:u.includes("in_app")})},[t]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Notification platform",id:"L9evilaxeT"})}),l.jsx(XGe,{options:a,selectedValues:i,onSelectionChange:c,placeholder:r({defaultMessage:"Select platform",id:"Gl5w1+hLYC"}),disabled:n})]})});$ne.displayName="AutomationNotificationConfiguration";const sb=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e.toUpperCase(),currencyDisplay:"symbol"}).format(0).replace(/[0-9.,\s]/g,"").trim()||"$"}catch{return"$"}},ob="5";function rk(e){const t={selectedSymbol:e.symbol,additionalInstructions:"",selectedOption:"price",priceValue:"",percentValue:"",positiveSelected:!0,negativeSelected:!0};switch(e.alertType){case fr.TARGET_PRICE:return{...t,selectedOption:"price",priceValue:e.price===0?"":e.price.toString()};case fr.MOVEMENT_AMOUNT:{const n=e.percentageDecimalUpperBound>0&&e.percentageDecimalUpperBound!==Bl/100,r=e.percentageDecimalLowerBound<0&&e.percentageDecimalLowerBound!==Ul/100;let s="";return n?s=(e.percentageDecimalUpperBound*100).toFixed(2):r&&(s=(Math.abs(e.percentageDecimalLowerBound)*100).toFixed(2)),s?{...t,selectedOption:"movement",percentValue:s,positiveSelected:n,negativeSelected:r}:{...t,selectedOption:"movement",percentValue:ob,positiveSelected:!0,negativeSelected:!0}}default:At(e)}}function JGe(e){switch(e.selectedOption){case"price":{const t=parseFloat(e.priceValue.replace(/[^0-9.]/g,""));return{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,symbol:e.selectedSymbol??"",price:t||0,currency:"usd"}}case"movement":{const n=(parseFloat(e.percentValue)||0)/100;let r=0,s=0;return e.positiveSelected&&e.negativeSelected?(r=n,s=-n):e.positiveSelected?r=n:e.negativeSelected&&(s=-n),{type:Ze.PRICE_ALERT,alertType:fr.MOVEMENT_AMOUNT,symbol:e.selectedSymbol??"",percentageDecimalUpperBound:r,percentageDecimalLowerBound:s}}default:At(e.selectedOption)}}function e$e({trigger:e,onTriggerChange:t}){const[n,r]=d.useState(()=>rk(e)),s=d.useMemo(()=>e.alertType===fr.TARGET_PRICE?`${e.symbol}-${e.alertType}-${e.price}`:`${e.symbol}-${e.alertType}-${e.percentageDecimalUpperBound}-${e.percentageDecimalLowerBound}`,[e]),o=d.useRef(s);d.useEffect(()=>{s!==o.current&&(r(rk(e)),o.current=s)},[s,e]);const a=d.useCallback(y=>{const x=JGe(y);t(x)},[t]),i=d.useCallback(y=>{r(x=>{const v=y(x);return a(v),v})},[a]),c=d.useCallback(y=>{i(x=>({...x,selectedSymbol:y}))},[i]),u=d.useCallback((y,x="")=>{i(v=>{switch(y){case"price":return{...v,selectedOption:y,priceValue:x};case"movement":return{...v,selectedOption:y,percentValue:ob,positiveSelected:!0,negativeSelected:!0};default:At(y)}})},[i]),f=d.useCallback(y=>{i(x=>({...x,priceValue:typeof y=="function"?y(x.priceValue):y}))},[i]),m=d.useCallback(y=>{i(x=>({...x,percentValue:typeof y=="function"?y(x.percentValue):y}))},[i]),p=d.useCallback(y=>{i(x=>({...x,positiveSelected:y}))},[i]),h=d.useCallback(y=>{i(x=>({...x,negativeSelected:y}))},[i]),g=d.useCallback(y=>{r(x=>({...x,additionalInstructions:y}))},[]);return d.useMemo(()=>({formState:n,onSymbolChange:c,onOptionChange:u,onPriceValueChange:f,onPercentValueChange:m,onPositiveChange:p,onNegativeChange:h,onAdditionalInstructionsChange:g}),[n,c,u,f,m,p,h,g])}const qne=async e=>{const{data:t,error:n,response:r}=await de.GET("/rest/finance/quote/{market_identifier}","automations/quote",{params:{path:{market_identifier:e}}});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t},Kne=e=>["automations/quote",e],ab=({symbol:e,enabled:t=!!e,onInitialSuccess:n})=>{const r=d.useRef(!1),s=mt({enabled:t&&!!e,queryKey:Kne(e),queryFn:()=>qne(e)});return d.useEffect(()=>{s.isSuccess&&s.data&&!r.current&&n&&(r.current=!0,n(s.data))},[s.isSuccess,s.data,n]),s},Yne=d.memo(({trigger:e,prompt:t,onPromptChange:n,error:r,variant:s="default",disabled:o})=>{const{isMobileUserAgent:a}=Re(),{$t:i,locale:c}=J(),u=rk(e),{selectedSymbol:f,priceValue:m,percentValue:p}=u,{data:h,isLoading:g}=ab({symbol:u.selectedSymbol}),y=e.alertType===fr.TARGET_PRICE?"price":"movement",x=h?.currency?sb(h?.currency,c):"$",{displayInstructions:v}=NE({selectedSymbol:f,quote:h,isLoading:g,alertType:y,priceValue:m,percentValue:p,currencySymbol:x,$t:i});return l.jsxs("div",{className:z("gap-md flex flex-col",o&&"pointer-events-none opacity-50"),children:[l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"tiny",color:"light",className:"flex shrink-0 items-center",children:l.jsx(je,{defaultMessage:"Default query",id:"7SalR4PwjB"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(V,{variant:"small",color:"light",className:"pl-sm border-subtlest border-l-2",children:v})})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"tiny",color:"light",className:"flex shrink-0 items-center",children:l.jsx(je,{defaultMessage:"Additional Instructions (optional)",id:"QFuOkrgHHJ"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(hu,{value:t,onChange:n,isMobileUserAgent:a,isMobileStyle:!1,minRows:3,maxLength:cV,className:z("[&_textarea]:placeholder:!text-quietest placeholder:!text-quietest hover:!border-subtler focus-within:!border-subtler !border !border-transparent","w-full"),placeholder:"Check news and social media sentiment to assess consensus or controversy",variant:s,disabled:o})})]}),r&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:r})]})]})});Yne.displayName="PriceAlertQueryPromptInput";const Qne=d.memo(({trigger:e,prompt:t,onPromptChange:n,error:r,variant:s,disabled:o})=>{const{data:a}=ab({symbol:e.symbol}),i=d.useMemo(()=>{if(!e.symbol)return"";const f=a?.name?` (${a.name})`:"";return e.alertType===fr.TARGET_PRICE?$v({symbol:e.symbol,quoteName:f}):qv({symbol:e.symbol,quoteName:f})},[e.symbol,e.alertType,a?.name]),c=d.useMemo(()=>{const f=a?.name?` (${a.name})`:"";return cee({prompt:t,symbol:e.symbol,quoteName:f})},[t,e.symbol,a?.name]),u=f=>{const m=lee({baseInstructions:i,additionalInstructions:f});n(m)};return l.jsx(Yne,{trigger:e,prompt:c,onPromptChange:u,error:r,variant:s,disabled:o})});Qne.displayName="PriceAlertPromptWrapper";const ib=d.memo(({trigger:e,prompt:t,onPromptChange:n,placeholder:r,error:s,variant:o="default",disabled:a})=>{const{isMobileUserAgent:i}=Re(),c=(()=>{switch(o){case"default":return"bg-subtler [&_textarea]:bg-transparent";case"subtle":return"bg-subtle [&_textarea]:bg-transparent";default:At(o)}})();switch(e.type){case Ze.SCHEDULED:case Ze.SHORTCUT:return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Instructions",id:"sV2v5LjRpX"})}),l.jsx(hu,{placeholder:r,value:t,onChange:n,isMobileUserAgent:i,isMobileStyle:!1,minRows:3,maxLength:cV,allowEnterNewlines:!0,className:z("hover:!border-subtler focus-within:!border-subtler !border !border-transparent",c),variant:o,disabled:a}),s&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:s})]})]});case Ze.PRICE_ALERT:return l.jsx(Qne,{trigger:e,prompt:t,onPromptChange:n,error:s,variant:o,disabled:a});default:At(e)}});ib.displayName="QueryPromptInput";const Xne=d.memo(({trigger:e,query:t,onQueryChange:n})=>{const{$t:r}=J(),s=d.useCallback(c=>{n({...t,prompt:c})},[n,t]),o=d.useCallback(c=>{n({...t,searchModel:c})},[n,t]),a=d.useCallback(c=>{n({...t,sources:c})},[n,t]),i=d.useMemo(()=>{switch(e.type){case Ze.SCHEDULED:return null;case Ze.PRICE_ALERT:return null;case Ze.SHORTCUT:return l.jsx(rb,{searchModel:t.searchModel,onSearchModelChange:o,sources:t.sources??Zh(),onSourcesChange:a,variant:"subtle"});default:At(e)}},[o,a,t.searchModel,t.sources,e]);return e.type===Ze.PRICE_ALERT?null:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(ib,{trigger:e,prompt:t.prompt,placeholder:r({defaultMessage:"Describe what you want to automate",id:"79ZUaZU8Ho"}),onPromptChange:s,variant:"subtle"}),i]})});Xne.displayName="AutomationQueryConfiguration";const t$e=async({query:e,locale:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/tasks-autosuggest",n,{params:{query:{query:e}},headers:{"accept-language":t},shouldNotAddSourceVersionQueryParams:!1});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get finance tasks suggestions",cause:s,status:o.status??0});return"results"in r?r.results:[]}catch(r){return Z.error(r),[]}},n$e=({symbol:e})=>l.jsx(V,{color:"light",children:l.jsx("span",{className:"font-mono opacity-70",children:e.slice(0,1)})}),Z6=({image:e,imageDark:t,alt:n,watchlistType:r,className:s,imageClassName:o})=>{const a=r==="FINANCE",{colorScheme:i}=Ss(),c=a&&i==="dark"&&t?t:e,[u,f]=d.useState(()=>{if(!c)return!1;const g=new Image;return g.src=c,g.complete&&g.naturalWidth>0}),[m,p]=d.useState(!1),h=!u||m;return l.jsxs("div",{className:z("relative flex size-6 items-center justify-center",{"bg-subtler":h},s),children:[h&&l.jsx(n$e,{symbol:n??""}),!m&&l.jsx("div",{className:z("absolute",o),children:l.jsx("img",{src:c,alt:n,width:32,height:32,className:z("inset-0 size-full object-contain",{"opacity-0":!u}),onLoad:()=>f(!0),onError:()=>p(!0)})})]})},Zne="[&_textarea]:placeholder:!text-quietest placeholder:!text-quietest hover:!border-subtler focus-within:!border-subtler !border !border-transparent",r$e=e=>/^(\d+(\.\d{0,2})?|\.\d{1,2})$/.test(e),s$e=e=>/^(\d+(\.\d{0,1})?|\.\d{0,1})$/.test(e),o$e=({currentPrice:e,value:t,onChange:n,variant:r="default",currency:s="USD"})=>{const{isMobileUserAgent:o}=Re(),{locale:a,$t:i}=J(),c=d.useMemo(()=>sb(s,a),[s,a]),u=d.useMemo(()=>e?.toLocaleString(a,{style:"currency",currency:s.toUpperCase()}),[e,a,s]),f=d.useCallback(y=>{n(x=>{if(y===c)return y;const v=y.replace(c,"");return r$e(v)||y===""?c+v:x})},[n,c]),m=d.useCallback(()=>{t===""&&n(c)},[n,t,c]),p=d.useCallback(()=>{t===c&&n("")},[n,t,c]),h=(()=>{switch(r){case"default":return"bg-subtler [&_textarea]:bg-subtler";case"subtle":return"bg-subtle [&_textarea]:bg-subtle";default:At(r)}})(),g=z(Zne,h);return l.jsxs("div",{className:"gap-sm flex flex-col items-start",children:[l.jsx(V,{variant:"tiny",color:"light",children:u?i({id:"74LVOPcS2E",defaultMessage:"Target Price (currently {formattedPrice})"},{formattedPrice:u}):i({id:"xPMPP84OOV",defaultMessage:"Target Price"})}),l.jsx("div",{className:"gap-sm flex items-stretch",children:l.jsx(co,{placeholder:c,className:z(g,"p-sm !rounded-md"),variant:"monospace",isMobileUserAgent:o,value:t,onChange:f,onFocus:m,onBlur:p,disable1pass:!0,colorVariant:r})})]})},a$e=({value:e,onChange:t,positiveSelected:n,onPositiveChange:r,negativeSelected:s,onNegativeChange:o,variant:a="default"})=>{const{isMobileUserAgent:i}=Re(),{$t:c}=J(),u=d.useCallback(()=>{o(!s)},[s,o]),f=d.useCallback(()=>{r(!n)},[r,n]),m=d.useCallback(y=>{t(x=>s$e(y)||y===""?y:x)},[t]),p=d.useMemo(()=>({delayDuration:100}),[]),h=(()=>{switch(a){case"default":return"bg-subtler [&_textarea]:bg-subtler";case"subtle":return"bg-subtle [&_textarea]:bg-subtle";default:At(a)}})(),g=z(Zne,h);return l.jsx("div",{className:"gap-md flex flex-col",children:l.jsxs("div",{className:"gap-sm flex flex-col items-start",children:[l.jsx(V,{variant:"tiny",color:"light",children:c({id:"agMnIX4PMS",defaultMessage:"Movement Amount (%)"})}),l.jsxs("div",{className:"gap-md flex h-full items-center",children:[l.jsxs("div",{className:"gap-sm flex h-full items-center",children:[l.jsx(Ge,{variant:s?"primaryGhost":"border",size:"small",onClick:u,pill:!0,icon:B("minus"),toolTip:c({id:"M9L9vXrgoN",defaultMessage:"Negative Movement"}),tooltipProps:p}),l.jsx(Ge,{variant:n?"primaryGhost":"border",size:"small",onClick:f,pill:!0,icon:B("plus"),toolTip:c({id:"iFYP+IX00i",defaultMessage:"Positive Movement"}),tooltipProps:p})]}),l.jsx(co,{className:z(g,"p-sm !rounded-md"),variant:"monospace",isMobileUserAgent:i,value:e,onChange:m,disable1pass:!0,colorVariant:a})]})]})})},J6=A.memo(e=>{const{selectedSymbol:t,selectedOption:n,onSymbolChange:r,onOptionChange:s,showSymbolInput:o=!0,currentPrice:a,priceValue:i,onPriceValueChange:c,percentValue:u,onPercentValueChange:f,positiveSelected:m,onPositiveChange:p,negativeSelected:h,onNegativeChange:g,externalInputValue:y,variant:x,colorVariant:v="default",currency:b,isAssetSelected:_=!0}=e,w=()=>{switch(x){case"full":return{additionalInstructions:e.additionalInstructions,onAdditionalInstructionsChange:e.onAdditionalInstructionsChange,displayPriceInstructions:e.displayPriceInstructions,displayMovementInstructions:e.displayMovementInstructions};case"trigger":return{additionalInstructions:"",onAdditionalInstructionsChange:()=>{},displayPriceInstructions:void 0,displayMovementInstructions:void 0};default:return At(x)}},{additionalInstructions:S,onAdditionalInstructionsChange:C,displayPriceInstructions:E,displayMovementInstructions:T}=w(),{isMobileUserAgent:k}=Re(),{$t:I,locale:M}=J(),[N,D]=d.useState(!1),[j,F]=d.useState(0),[R,P]=d.useState(""),[L,U]=d.useState([]),O=d.useRef(null),$=Yt(),G=d.useRef(R);G.current=R,d.useEffect(()=>{P(y??"")},[y]),d.useEffect(()=>{if(b&&i){const _e=sb(b.toUpperCase(),M);if(/^\d+(\.\d+)?$/.test(i)){c(_e+i);return}const De=i.replace(/[^0-9.]/g,"");i.replace(/[0-9.]/g,"").trim()!==_e&&De&&c(_e+De)}},[b,M,i,c]);const H=d.useMemo(()=>[{label:I({id:"xPMPP84OOV",defaultMessage:"Target Price"}),value:"price"},{label:I({id:"24152tl1L3",defaultMessage:"Movement Amount"}),value:"movement"}].map(ke=>({label:ke.label,value:ke.value,children:l.jsx("div",{className:"w-full flex-1",children:l.jsx(SA,{label:ke.label,isActiveOption:n===ke.value})})})),[n,I]),Q=d.useCallback(async _e=>{const De=(await $.fetchQuery({queryKey:be.makeEphemeralQueryKey("finance-tasks-autosuggest",_e),queryFn:()=>t$e({query:_e,reason:"finance-add-alert"}),staleTime:0})).map(xe=>({query:xe.title??"",title:xe.title??"",image:xe.image??"",imageDark:xe.image_dark??"",description:xe.description??"",identifier:xe.query??""}));U(De)},[$]),Y=Cf(Q,100,{leading:!0,trailing:!0}),te=d.useCallback(_e=>{Y(_e)},[Y]),se=d.useCallback(()=>{D(!0),F(-1),te(G.current)},[te]),ae=d.useCallback(()=>{D(!1)},[]),X=d.useCallback(_e=>{const ke=_e;P(ke),te(ke),ke.trim()===""&&(r(null),c(""),f(""))},[te,r,c,f]),ee=d.useCallback(_e=>{r(_e.identifier??null),P(_e.title??""),D(!1),O.current?.blur()},[r]),le=sX({userInputQuery:R,suggestionsDisabled:!N||L.length===0,suggestions:L,focusedIndex:j,setFocusedIndex:F,onChange:_e=>{P(_e)},handleSuggestionSubmission:ee,inputRef:O}),re=d.useCallback(_e=>{s(_e)},[s]),ce=d.useCallback(_e=>{C?.(_e)},[C]),ue=z("h-10 rounded-md dark:border-0 dark:border-transparent dark:bg-subtle p-4 dark:[&:focus]:ring-0",{"rounded-t-md rounded-b-none":N&&L.length>0}),me=d.useMemo(()=>({image:_e,imageDark:ke,alt:De})=>l.jsx(Z6,{image:_e,imageDark:ke,alt:De,watchlistType:"FINANCE",className:"bg-subtler mr-sm !size-8 rounded",imageClassName:"inset-xs"}),[]),we=({onClear:_e})=>l.jsx(st,{icon:B("x"),size:"tiny",pill:!0,onClick:_e}),ye=d.useMemo(()=>({RightIconComponent:()=>null,LeftIconComponent:me}),[me]);return l.jsxs("div",{className:"flex flex-col gap-3",children:[o&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(je,{defaultMessage:"Find a stock, token, or fund...",id:"DTOgClV6qi"})}),l.jsx(OA,{isOpen:N&&L.length>0,suggestedQueries:L,focusedIndex:j,setFocusedIndex:F,handlePasteQuery:Ao,handleSubmit:ee,value:R,components:ye,dropdownClassName:"dark:border-none dark:ml-0 dark:mr-0 dark:w-full",dropdownType:"select",popoverClassName:"dark:!border-none",children:l.jsx(co,{autoFocus:!t,onFocus:se,onBlur:ae,onKeyDown:le,className:ue,ref:O,isMobileUserAgent:k,placeholder:I({defaultMessage:"Search for any asset",id:"BeYic/1TvC"}),value:R,onChange:X,ClearIcon:we,colorVariant:v})})]}),l.jsxs("div",{className:z("flex flex-col gap-3 sm:flex-row",!_&&"pointer-events-none opacity-50"),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(je,{defaultMessage:"Alert criteria",id:"h44KqVtM6/"})}),l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:l.jsx(CA,{layoutKey:"task",options:H,value:n,onValueChange:re,className:"p-three inline-flex",variant:v})})]}),l.jsxs("div",{className:"gap-md flex flex-col",children:[n==="price"&&l.jsx(o$e,{currentPrice:a,value:i,onChange:c,variant:v,currency:b}),n==="movement"&&l.jsx(a$e,{value:u,onChange:f,positiveSelected:m,onPositiveChange:p,negativeSelected:h,onNegativeChange:g,variant:v})]})]}),x==="full"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"smallBold",color:"light",className:"flex shrink-0 items-center",children:I({id:"qax5d8pQCh",defaultMessage:"Default Query"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(V,{variant:"small",color:"light",className:"pl-sm border-subtlest border-l-2",children:n==="price"?E:T})})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"smallBold",color:"light",className:"flex shrink-0 items-center",children:I({id:"QFuOkrgHHJ",defaultMessage:"Additional Instructions (optional)"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(hu,{value:S,onChange:ce,isMobileUserAgent:k,isMobileStyle:!1,minRows:3,placeholder:I({id:"DtwY5RHKrT",defaultMessage:"Check news and social media sentiment to assess consensus or controversy"})})})]})]})]})});J6.displayName="FinanceAlertForm";const Jne=d.memo(({trigger:e,onTriggerChange:t,isEditing:n,defaultTargetPriceValue:r})=>{const{formState:s,onSymbolChange:o,onOptionChange:a,onPriceValueChange:i,onPercentValueChange:c,onPositiveChange:u,onNegativeChange:f}=e$e({trigger:e,onTriggerChange:t}),m=d.useCallback(x=>r||(x.price?i$e(x.price):""),[r]),p=d.useCallback(x=>{switch(s.selectedOption){case"price":{if(x&&!s.priceValue){const v=m(x);v&&i(v)}break}case"movement":break;default:At(s.selectedOption)}},[s.priceValue,s.selectedOption,m,i]),{data:h}=ab({symbol:s.selectedSymbol,onInitialSuccess:p}),g=d.useCallback(x=>{let v="";switch(x){case"price":{v=s.priceValue,h&&(v=m(h));break}case"movement":break;default:At(x)}a(x,v)},[s.priceValue,m,a,h]),y=!!e.symbol&&e.symbol.trim()!=="";return l.jsx("div",{children:l.jsx(J6,{variant:"trigger",externalInputValue:s.selectedSymbol??void 0,selectedSymbol:s.selectedSymbol,selectedOption:s.selectedOption,onSymbolChange:o,onOptionChange:g,showSymbolInput:!n,currentPrice:h?.price,priceValue:s.priceValue,onPriceValueChange:i,percentValue:s.percentValue,onPercentValueChange:c,positiveSelected:s.positiveSelected,onPositiveChange:u,negativeSelected:s.negativeSelected,onNegativeChange:f,colorVariant:"subtle",currency:h?.currency??void 0,isAssetSelected:y})})});Jne.displayName="PriceAlertTriggerConfiguration";function i$e(e){return(e*(1+parseInt(ob,10)/100)).toFixed(2)}const sk=d.memo(({trigger:e,onTriggerChange:t})=>{const n=d.useMemo(()=>e?.schedule??Gr(),[e?.schedule]),r=d.useCallback(s=>{t({type:Ze.SCHEDULED,...e,schedule:{...n,...s}})},[t,n,e]);return l.jsx(X6,{schedule:n,onScheduleChange:r,variant:"subtle"})});sk.displayName="ScheduledAutomationTriggerConfiguration";const ere=d.memo(()=>l.jsx("div",{children:"Shortcut Trigger Configuration"}));ere.displayName="ShortcutTriggerAutomationConfiguration";const tre=d.memo(({trigger:e,onTriggerChange:t,isEditing:n=!1,defaultTargetPriceValue:r})=>{if(!e)return l.jsx(sk,{trigger:null,onTriggerChange:t});switch(e.type){case Ze.SCHEDULED:return l.jsx(sk,{trigger:e,onTriggerChange:t});case Ze.PRICE_ALERT:return l.jsx(Jne,{trigger:e,onTriggerChange:t,isEditing:n,defaultTargetPriceValue:r});case Ze.SHORTCUT:return l.jsx(ere,{});default:At(e)}});tre.displayName="AutomationTriggerConfiguration";const l$e={tiny:"tiny",small:"tiny",default:"tiny",large:"small"},c$e={tiny:"text-xs",small:"text-sm",default:"text-sm",large:"text-base"},u$e=e=>{const t=_x(e);return z(t,"justify-between")},d$e=()=>"ml-1 shrink-0 text-quiet";function f$e({ref:e,children:t,"aria-expanded":n,"aria-haspopup":r="listbox","aria-controls":s,size:o="default",disabled:a=!1,onClick:i,leadingAccessory:c,...u}){const f=bx(e),m=wa(u),p=l$e[o],h=c$e[o],g=d.useMemo(()=>z("font-normal",h,"text-box-trim-both","truncate",{"pl-1":c,"pr-1":!0,"min-w-0":!0}),[c,h]);return l.jsxs(Ro,{ref:f,...m,disabled:a,className:u$e({variant:"tonal",size:o,disabled:a,fullWidth:!0}),onClick:i,"aria-expanded":n,"aria-haspopup":r,"aria-controls":s,children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[c&&l.jsx("div",{className:"mr-1 shrink-0",children:o2(c)?l.jsx(rn,{icon:c,size:o}):c}),l.jsx("span",{className:g,children:t})]}),l.jsx("div",{className:d$e(),children:l.jsx(rn,{icon:B("chevron-down"),size:p})})]})}const m$e=50;function p$e({reason:e,limit:t=m$e}){const n=PU({queryKey:be.makeQueryKey(ry),queryFn:({pageParam:s=0})=>PDe({limit:t,offset:s,reason:e}),getNextPageParam:(s,o)=>{if(s.has_next_page)return o.length*t},initialPageParam:0}),r=d.useMemo(()=>n.data?.pages?.flatMap(s=>s.spaces)??[],[n.data]);return{...n,spaces:r}}const eN=d.memo(({emoji:e,size:t="md"})=>l.jsx(V,{variant:t==="lg"?"section-title":"base",className:z("flex items-center justify-center",{"size-5":t==="lg","size-4":t==="md"}),children:e}));eN.displayName="EmojiIcon";const nre=d.memo(({space:e,isSelected:t,onSelect:n})=>{const r=Q4(e.emoji),s=d.useMemo(()=>r?()=>l.jsx(eN,{emoji:r}):Kh,[r]);return l.jsx(Dt.Item,{leadingAccessory:s,trailingAccessory:t?l.jsx(rn,{icon:B("check"),size:"default"}):void 0,onSelect:()=>n(e.uuid),children:e.title})});nre.displayName="SpaceMenuItem";const rre=d.memo(({selectedSpaceUuid:e,onSpaceChange:t,disabled:n=!1})=>{const{$t:r}=J(),{openToast:s}=hn(),[o,a]=d.useState(!1),{spaces:i,isLoading:c,isError:u}=p$e({reason:"automation-modal-space-selector"}),f=d.useCallback(g=>{n||c||u||a(g)},[n,c,u]);d.useEffect(()=>{u&&s({message:r({defaultMessage:"Failed to load spaces",id:"+uuI8WqZfv"}),variant:"error",timeout:null})},[u,r,s]);const m=i.find(g=>g.uuid===e),p=m?Q4(m.emoji):null,h=d.useMemo(()=>p?()=>l.jsx(eN,{emoji:p,size:"lg"}):Kh,[p]);return!c&&!u&&i.length===0?null:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Space",id:"0ah2udCSKF"})}),l.jsx(Dt,{isOpen:o,onToggle:f,triggerElement:l.jsx(f$e,{size:"default",disabled:n||c||u,leadingAccessory:h,children:m?m.title:l.jsx(je,{defaultMessage:"None Selected",id:"HeX7TW9V+Q"})}),children:l.jsxs("div",{className:"max-h-[38vh] overflow-y-auto",children:[e&&l.jsx(Dt.Item,{leadingAccessory:B("x"),onSelect:()=>t(null),children:l.jsx(je,{defaultMessage:"Clear Selection",id:"WbPFiMz647"})}),i.map(g=>l.jsx(nre,{space:g,isSelected:g.uuid===e,onSelect:t},g.uuid))]})})]})});rre.displayName="SpaceSelector";const h$e=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-in-spaces",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},g$e=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-notification-settings-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Ow=new Date,Lw=new Date;function Tr(e,t,n,r){function s(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(e(o=new Date(+o)),o),s.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),s.round=o=>{const a=s(o),i=s.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),s.range=(o,a,i)=>{const c=[];if(o=s.ceil(o),i=i==null?1:Math.floor(i),!(o0))return c;let u;do c.push(u=new Date(+o)),t(o,i),e(o);while(uTr(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,i)=>{if(a>=a)if(i<0)for(;++i<=0;)for(;t(a,-1),!o(a););else for(;--i>=0;)for(;t(a,1),!o(a););}),n&&(s.count=(o,a)=>(Ow.setTime(+o),Lw.setTime(+a),e(Ow),e(Lw),Math.floor(n(Ow,Lw))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(r?a=>r(a)%o===0:a=>s.count(0,a)%o===0):s)),s}const P2=Tr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);P2.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Tr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):P2);P2.range;const ji=1e3,Eo=ji*60,Ii=Eo*60,Ki=Ii*24,tN=Ki*7,SP=Ki*30,Fw=Ki*365,Pi=Tr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCSeconds());Pi.range;const lb=Tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ji)},(e,t)=>{e.setTime(+e+t*Eo)},(e,t)=>(t-e)/Eo,e=>e.getMinutes());lb.range;const cb=Tr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Eo)},(e,t)=>(t-e)/Eo,e=>e.getUTCMinutes());cb.range;const ub=Tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ji-e.getMinutes()*Eo)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getHours());ub.range;const db=Tr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getUTCHours());db.range;const em=Tr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Eo)/Ki,e=>e.getDate()-1);em.range;const Fg=Tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>e.getUTCDate()-1);Fg.range;const sre=Tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>Math.floor(e/Ki));sre.range;function yu(e){return Tr(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())*Eo)/tN)}const Bg=yu(0),O2=yu(1),y$e=yu(2),x$e=yu(3),cf=yu(4),v$e=yu(5),b$e=yu(6);Bg.range;O2.range;y$e.range;x$e.range;cf.range;v$e.range;b$e.range;function xu(e){return Tr(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)/tN)}const Ug=xu(0),L2=xu(1),_$e=xu(2),w$e=xu(3),uf=xu(4),C$e=xu(5),S$e=xu(6);Ug.range;L2.range;_$e.range;w$e.range;uf.range;C$e.range;S$e.range;const Vg=Tr(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());Vg.range;const fb=Tr(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());fb.range;const ba=Tr(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());ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tr(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)});ba.range;const ai=Tr(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());ai.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tr(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)});ai.range;function Op(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function E$e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Hg(e){let t,n,r;e.length!==2?(t=Op,n=(i,c)=>Op(e(i),c),r=(i,c)=>e(i)-c):(t=e===Op||e===E$e?e:k$e,n=e,r=e);function s(i,c,u=0,f=i.length){if(u>>1;n(i[m],c)<0?u=m+1:f=m}while(u>>1;n(i[m],c)<=0?u=m+1:f=m}while(uu&&r(i[m-1],c)>-r(i[m],c)?m-1:m}return{left:s,center:a,right:o}}function k$e(){return 0}function ore(e){return e===null?NaN:+e}const M$e=Hg(Op),tm=M$e.right;Hg(ore).center;function ko(e,t){let n,r;if(t===void 0)for(const s of e)s!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r=o&&(n=r=o):(n>o&&(n=o),r0)return[e];if((r=t0){let c=Math.round(e/i),u=Math.round(t/i);for(c*it&&--u,a=new Array(o=u-c+1);++st&&--u,a=new Array(o=u-c+1);++s=0?(o>=ok?10:o>=ak?5:o>=ik?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(o>=ok?10:o>=ak?5:o>=ik?2:1)}function ck(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/s;return o>=ok?s*=10:o>=ak?s*=5:o>=ik&&(s*=2),t=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,o=Math.floor(s),a=+n(e[o],o,e),i=+n(e[o+1],o+1,e);return a+(i-a)*(s-o)}}function D$e(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,o=new Array(s);++rx).right(a,p);if(h===a.length)return e.every(ck(u/Fw,f/Fw,m));if(h===0)return P2.every(Math.max(ck(u,f,m),1));const[g,y]=a[p/a[h-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(ue=Uw(Pm(re.y,0,1)),me=ue.getUTCDay(),ue=me>4||me===0?L2.ceil(ue):L2(ue),ue=Fg.offset(ue,(re.V-1)*7),re.y=ue.getUTCFullYear(),re.m=ue.getUTCMonth(),re.d=ue.getUTCDate()+(re.w+6)%7):(ue=Bw(Pm(re.y,0,1)),me=ue.getDay(),ue=me>4||me===0?O2.ceil(ue):O2(ue),ue=em.offset(ue,(re.V-1)*7),re.y=ue.getFullYear(),re.m=ue.getMonth(),re.d=ue.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),me="Z"in re?Uw(Pm(re.y,0,1)).getUTCDay():Bw(Pm(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(me+5)%7:re.w+re.U*7-(me+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,Uw(re)):Bw(re)}}function T(X,ee,le,re){for(var ce=0,ue=ee.length,me=le.length,we,ye;ce=me)return-1;if(we=ee.charCodeAt(ce++),we===37){if(we=ee.charAt(ce++),ye=S[we in MP?ee.charAt(ce++):we],!ye||(re=ye(X,le,re))<0)return-1}else if(we!=le.charCodeAt(re++))return-1}return re}function k(X,ee,le){var re=u.exec(ee.slice(le));return re?(X.p=f.get(re[0].toLowerCase()),le+re[0].length):-1}function I(X,ee,le){var re=h.exec(ee.slice(le));return re?(X.w=g.get(re[0].toLowerCase()),le+re[0].length):-1}function M(X,ee,le){var re=m.exec(ee.slice(le));return re?(X.w=p.get(re[0].toLowerCase()),le+re[0].length):-1}function N(X,ee,le){var re=v.exec(ee.slice(le));return re?(X.m=b.get(re[0].toLowerCase()),le+re[0].length):-1}function D(X,ee,le){var re=y.exec(ee.slice(le));return re?(X.m=x.get(re[0].toLowerCase()),le+re[0].length):-1}function j(X,ee,le){return T(X,t,ee,le)}function F(X,ee,le){return T(X,n,ee,le)}function R(X,ee,le){return T(X,r,ee,le)}function P(X){return a[X.getDay()]}function L(X){return o[X.getDay()]}function U(X){return c[X.getMonth()]}function O(X){return i[X.getMonth()]}function $(X){return s[+(X.getHours()>=12)]}function G(X){return 1+~~(X.getMonth()/3)}function H(X){return a[X.getUTCDay()]}function Q(X){return o[X.getUTCDay()]}function Y(X){return c[X.getUTCMonth()]}function te(X){return i[X.getUTCMonth()]}function se(X){return s[+(X.getUTCHours()>=12)]}function ae(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var ee=C(X+="",_);return ee.toString=function(){return X},ee},parse:function(X){var ee=E(X+="",!1);return ee.toString=function(){return X},ee},utcFormat:function(X){var ee=C(X+="",w);return ee.toString=function(){return X},ee},utcParse:function(X){var ee=E(X+="",!0);return ee.toString=function(){return X},ee}}}var MP={"-":"",_:" ",0:"0"},zr=/^\s*\d+/,F$e=/^%/,B$e=/[\\^$*+?|[\]().{}]/g;function dn(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",o=s.length;return r+(o[t.toLowerCase(),n]))}function V$e(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function H$e(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function z$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function W$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function G$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function TP(e,t,n){var r=zr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function AP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function $$e(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 q$e(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function K$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function NP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Y$e(e,t,n){var r=zr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function RP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Q$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function X$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Z$e(e,t,n){var r=zr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function J$e(e,t,n){var r=zr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function eqe(e,t,n){var r=F$e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function tqe(e,t,n){var r=zr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function nqe(e,t,n){var r=zr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function DP(e,t){return dn(e.getDate(),t,2)}function rqe(e,t){return dn(e.getHours(),t,2)}function sqe(e,t){return dn(e.getHours()%12||12,t,2)}function oqe(e,t){return dn(1+em.count(ba(e),e),t,3)}function lre(e,t){return dn(e.getMilliseconds(),t,3)}function aqe(e,t){return lre(e,t)+"000"}function iqe(e,t){return dn(e.getMonth()+1,t,2)}function lqe(e,t){return dn(e.getMinutes(),t,2)}function cqe(e,t){return dn(e.getSeconds(),t,2)}function uqe(e){var t=e.getDay();return t===0?7:t}function dqe(e,t){return dn(Bg.count(ba(e)-1,e),t,2)}function cre(e){var t=e.getDay();return t>=4||t===0?cf(e):cf.ceil(e)}function fqe(e,t){return e=cre(e),dn(cf.count(ba(e),e)+(ba(e).getDay()===4),t,2)}function mqe(e){return e.getDay()}function pqe(e,t){return dn(O2.count(ba(e)-1,e),t,2)}function hqe(e,t){return dn(e.getFullYear()%100,t,2)}function gqe(e,t){return e=cre(e),dn(e.getFullYear()%100,t,2)}function yqe(e,t){return dn(e.getFullYear()%1e4,t,4)}function xqe(e,t){var n=e.getDay();return e=n>=4||n===0?cf(e):cf.ceil(e),dn(e.getFullYear()%1e4,t,4)}function vqe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dn(t/60|0,"0",2)+dn(t%60,"0",2)}function jP(e,t){return dn(e.getUTCDate(),t,2)}function bqe(e,t){return dn(e.getUTCHours(),t,2)}function _qe(e,t){return dn(e.getUTCHours()%12||12,t,2)}function wqe(e,t){return dn(1+Fg.count(ai(e),e),t,3)}function ure(e,t){return dn(e.getUTCMilliseconds(),t,3)}function Cqe(e,t){return ure(e,t)+"000"}function Sqe(e,t){return dn(e.getUTCMonth()+1,t,2)}function Eqe(e,t){return dn(e.getUTCMinutes(),t,2)}function kqe(e,t){return dn(e.getUTCSeconds(),t,2)}function Mqe(e){var t=e.getUTCDay();return t===0?7:t}function Tqe(e,t){return dn(Ug.count(ai(e)-1,e),t,2)}function dre(e){var t=e.getUTCDay();return t>=4||t===0?uf(e):uf.ceil(e)}function Aqe(e,t){return e=dre(e),dn(uf.count(ai(e),e)+(ai(e).getUTCDay()===4),t,2)}function Nqe(e){return e.getUTCDay()}function Rqe(e,t){return dn(L2.count(ai(e)-1,e),t,2)}function Dqe(e,t){return dn(e.getUTCFullYear()%100,t,2)}function jqe(e,t){return e=dre(e),dn(e.getUTCFullYear()%100,t,2)}function Iqe(e,t){return dn(e.getUTCFullYear()%1e4,t,4)}function Pqe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?uf(e):uf.ceil(e),dn(e.getUTCFullYear()%1e4,t,4)}function Oqe(){return"+0000"}function IP(){return"%"}function PP(e){return+e}function OP(e){return Math.floor(+e/1e3)}var Uu,zg,fre;Lqe({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 Lqe(e){return Uu=L$e(e),zg=Uu.format,Uu.parse,fre=Uu.utcFormat,Uu.utcParse,Uu}const Fqe=zg("%b %d"),Bqe=zg("%b"),Uqe=zg("%Y");function Vqe(e){return e?(e=new Date(e),(Vg(e){if(!e&&(e!==0||!n?.renderZero))return"";const s=t&&/^[A-Z]{3}$/.test(t)?t:void 0,o=e%1===0&&!n?.alwaysShowMinor||n?.roundToMajor?0:2;let a=n?.roundToMajor?0:2;if(e>0&&e<1){const c=Math.abs(e).toExponential();a=Math.abs(parseInt(c.split("e")[1]))+1}const i=Intl.NumberFormat(void 0,{style:s?"currency":"decimal",currency:s,minimumFractionDigits:1,maximumFractionDigits:1,currencyDisplay:n?.currencyDisplay??"narrowSymbol"});return n?.truncate&&e>=1e6?`${i.format(e/1e6)}M`:n?.truncate&&e>=1e3?`${i.format(e/1e3)}k`:e.toLocaleString(void 0,{style:s?"currency":"decimal",currency:s,minimumFractionDigits:o,maximumFractionDigits:a,currencyDisplay:n?.currencyDisplay??"narrowSymbol"})},mb=d.memo(({configuration:e,onConfigurationChange:t,errorMessage:n,onError:r,canEditSpace:s})=>{const o=!!e.id,a=d.useCallback(y=>{let x=e.query;switch(y.type){case Ze.PRICE_ALERT:{x={...e.query,prompt:e.query.prompt};break}case Ze.SCHEDULED:case Ze.SHORTCUT:break;default:At(y)}const v={...e,trigger:y,query:x};r?.(null),t(v)},[e,t,r]),i=d.useCallback(y=>{const x={...e,query:y};t(x)},[e,t]),c=d.useCallback(y=>{const x={...e,collectionUuid:y};t(x)},[e,t]),u=d.useCallback(y=>{const x={...e,notificationSettings:y};t(x)},[e,t]),{variation:f,loading:m}=g$e(!0),{variation:p,loading:h}=h$e(!1),g=e.trigger.type===Ze.PRICE_ALERT&&(!e.trigger.symbol||e.trigger.symbol.trim()==="");return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Xne,{trigger:e.trigger,query:e.query,onQueryChange:i}),!h&&p&&e.trigger.type===Ze.SCHEDULED&&l.jsx(rre,{selectedSpaceUuid:e.collectionUuid,onSpaceChange:c,disabled:!s}),l.jsx(tre,{trigger:e.trigger,onTriggerChange:a,isEditing:o,defaultTargetPriceValue:e.defaultTargetPriceValue}),l.jsx(Gne,{trigger:e.trigger,onTriggerChange:a}),!m&&f&&l.jsx($ne,{notificationSettings:e.notificationSettings??Kl,onNotificationSettingsChange:u,disabled:g}),e.trigger.type===Ze.PRICE_ALERT&&l.jsx("div",{className:"flex flex-col gap-2",children:l.jsx(ib,{trigger:e.trigger,prompt:e.query.prompt,onPromptChange:y=>i({...e.query,prompt:y}),variant:"subtle",disabled:g})}),l.jsx(Hne,{trigger:e.trigger,query:e.query,onQueryChange:i}),n&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:n})]})]})});mb.displayName="AutomationConfiguration";function Hqe(e,t,n,r){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,schedule:mp(e.schedule),task_name:"",expiry_date:zH(e.expiryDate??e.defaultExpiryDate),notification_settings:n,collection_uuid:r??void 0}}function zqe(e,t){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,task_name:e.shortcut,schedule:{rrule:"",start_at:"",tzid:""}}}function mre({trigger:e,query:t,quote:n}){const{symbol:r}=e,s=n?.name?` (${n.name})`:void 0;switch(e.alertType){case fr.TARGET_PRICE:{const o=n?.price||0,a=$v({symbol:r,quoteName:s}),i=e.price>o?"above":"below",c=wI({rawInstructions:a,symbol:r,quoteName:s||"",eventValue:`$${e.price}`,direction:i}),u=_I({prompt:t.prompt,baseInstructions:c});return RE({symbol:r,alertType:"price",priceValue:`$${e.price}`,priceThreshold:i,baseInstructions:c,additionalInstructions:u})}case fr.MOVEMENT_AMOUNT:{const o=qv({symbol:r,quoteName:s}),a=e.percentageDecimalUpperBound>0&&e.percentageDecimalUpperBound!==Bl/100,i=e.percentageDecimalLowerBound<0&&e.percentageDecimalLowerBound!==Ul/100;let c,u;a&&i?(c=(e.percentageDecimalUpperBound*100).toFixed(2),u="increase or decrease"):a?(c=(e.percentageDecimalUpperBound*100).toFixed(2),u="increase"):i?(c=(Math.abs(e.percentageDecimalLowerBound)*100).toFixed(2),u="decrease"):(c="0.00",u="change");const f=wI({rawInstructions:o,symbol:r,quoteName:s||"",eventValue:c,direction:u}),m=_I({prompt:t.prompt,baseInstructions:f});return RE({symbol:r,alertType:"movement",percentValue:c,positiveSelected:a,negativeSelected:i,baseInstructions:f,additionalInstructions:m})}default:At(e)}}function Wqe(e,t,n,r,s){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,status:n==="COMPLETED"?"PAUSED":n,schedule:mp(e.schedule),expiry_date:zH(e.expiryDate??e.defaultExpiryDate),clear_expiry:e.expiryDate===null?!0:void 0,notification_settings:r,collection_uuid:s===null?void 0:s,clear_collection_uuid:s===null?!0:void 0}}function Gqe(e,t,n){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,status:n==="COMPLETED"?"PAUSED":n,task_name:e.shortcut}}function $qe({trigger:e,query:t,status:n,quote:r}){const s=mre({trigger:e,query:t,quote:r});return s?{task_name:s.task_name,prompt:s.prompt,event_subscription:s.event_subscription,model_preference:s.model_preference,status:n==="COMPLETED"?"PAUSED":n}:null}function pre({onCreateSuccess:e,onCreateError:t,onUpdateSuccess:n,onUpdateError:r,onDeleteSuccess:s,onDeleteError:o}={}){const{$t:a}=J(),i=Yt(),c=Rt({mutationFn:p=>S9e({payload:p,reason:"finance-add-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:pp()}),e?.()},onError:p=>t?.(p)}),u=Rt({mutationFn:({taskId:p,payload:h})=>E9e({taskId:p,payload:h,reason:"finance-edit-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:pp()}),n?.()},onError:p=>{if(p instanceof Error)switch(p.name){case"TimeoutError":r?.({detail:a({defaultMessage:"Network Timeout",id:"Z+mLGQc4GD"})});break;default:Z.error(`Unknown error occured: ${p.name}`),r?.({detail:a({defaultMessage:"Unknown error occurred",id:"y1q3uzCFY6"})})}else r?.(p)}}),f=Rt({mutationFn:p=>nX({taskId:p,reason:"finance-delete-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:pp()}),s?.()},onError:()=>o?.()}),m=c.isPending||u.isPending||f.isPending;return d.useMemo(()=>({createMutation:c,updateMutation:u,deleteMutation:f,isMutationLoading:m}),[c,u,f,m])}const qqe=()=>{const{formatMessage:e}=J();return{getErrorMessage:n=>{switch(n?.detail?.error_code){case Nj.TASK_LIMIT_EXCEEDED:return e({defaultMessage:"You have reached the maximum of number of active tasks of this type for your subscription level.",id:"3H43PMJpfD"});case Nj.SHORTCUT_NAME_ALREADY_EXISTS:return e({defaultMessage:"A shortcut with this name already exists. Please choose a different name.",id:"GpnXJDWEkN"});default:return e({defaultMessage:"Something went wrong. Please try again.",id:"W/5hwrn09m"})}}}},Kqe={settings_create:!0,settings_edit:!0,settings_suggest:!0,settings_primer:!0,task_widget:!0,discover_task_widget:!0,thread_dropdown:!0,typeahead_create:!0,notifications_panel:!0,router:!0,space_tasks_create:!0,space_tasks_edit:!0,study_hub_spaced_repetition:!0};function dk(e){return e in Kqe}const Yqe={settings_create:!0,settings_edit:!0,settings_suggest:!0,finance_home_page:!0,finance_asset_page:!0};function LP(e){return e in Yqe}const Qqe={settings_create:!0,settings_edit:!0,typeahead_create:!0,thread_create:!0,suggestions_dropdown:!0,notifications_panel:!0,typeahead_edit:!0,shortcut_widget:!0,settings_paste:!0,try_assistant_suggestions:!0,thread_upsell_create:!0};function FP(e){return e in Qqe}const Xqe={created:!0,updated:!0,deleted:!0,paused:!0,resumed:!0,skipped:!0};function hre(e){return e in Xqe}const Zqe={created:!0,updated:!0,deleted:!0,paused:!0,resumed:!0,skipped:!0};function Jqe(e){return e in Zqe}const eKe={created:!0,updated:!0,deleted:!0,copied:!0,skipped:!0};function tKe(e){return e in eKe}function gre({reason:e,source:t,onSuccess:n,onError:r}){const s=Yt(),{session:o}=Ne(),{trackEvent:a}=Xe(o),{getErrorMessage:i}=qqe(),c=d.useCallback((y,x)=>{s.invalidateQueries({queryKey:pp()}),s.invalidateQueries({queryKey:s2e()}),x&&s.invalidateQueries({queryKey:GH(x)}),n?.(y)},[s,n]),u=d.useCallback((y,x)=>{dk(t)&&hre(y)&&a("task modal action",{source:t,action:y}),c(y,x)},[t,a,c]),f=Rt({mutationFn:y=>C9e({payload:y,reason:e}),onSuccess:y=>u("created",y.task_id),onError:y=>r(i(y))}),m=Rt({mutationFn:({id:y,payload:x})=>Rj({taskId:y,payload:x,reason:e}),onSuccess:y=>u("updated",y.task.task_id),onError:y=>r(i(y))}),p=Rt({mutationFn:({id:y,newStatus:x})=>Rj({taskId:y,payload:{status:x},reason:e}),onSuccess:y=>{u(y.task.status==="PAUSED"?"paused":"resumed",y.task.task_id)},onError:y=>r(i(y))}),h=Rt({mutationFn:y=>nX({taskId:y,reason:e}),onSuccess:()=>u("deleted"),onError:y=>r(i(y))}),g=f.isPending||m.isPending||p.isPending||h.isPending;return{createMutation:f,updateMutation:m,toggleMutation:p,deleteMutation:h,isMutationLoading:g,invalidateAndClose:c}}function nKe({initialConfiguration:e,isModalOpened:t,reason:n,source:r,onSuccess:s,onError:o}){const{$t:a}=J(),{hasActiveSubscription:i}=$t(),[c,u]=d.useState(y4(e??g4(i))),f=d.useCallback(T=>{u(T)},[]),m=(()=>{switch(c.trigger.type){case Ze.PRICE_ALERT:return c.trigger.symbol;case Ze.SCHEDULED:case Ze.SHORTCUT:return null;default:At(c.trigger)}})(),{data:p,isLoading:h}=ab({symbol:m,enabled:!!m&&t}),g=gre({reason:n,source:r,onSuccess:s,onError:o}),y=pre({onCreateSuccess:()=>s("created"),onCreateError:T=>o(`Failed to create price alert - ${T.detail}`),onUpdateSuccess:()=>s("updated"),onUpdateError:T=>o(`Failed to update price alert - ${T.detail}`),onDeleteSuccess:()=>s("deleted"),onDeleteError:()=>o("Failed to delete price alert")}),x=h||g.isMutationLoading||y.isMutationLoading,v=d.useCallback(T=>{const k=T?{...c,...T}:c;if(k.id)switch(k.trigger.type){case Ze.SCHEDULED:g.updateMutation.mutate({id:k.id,payload:Wqe(k.trigger,k.query,k.status,k.notificationSettings,k.collectionUuid)});break;case Ze.PRICE_ALERT:{const I=$qe({trigger:k.trigger,query:k.query,status:k.status,quote:p});I?y.updateMutation.mutate({taskId:k.id,payload:I}):o(a({defaultMessage:"Failed to update price alert payload - Missing inputs",id:"293dgMfZdE"}));break}case Ze.SHORTCUT:g.updateMutation.mutate({id:k.id,payload:Gqe(k.trigger,k.query,k.status)});break;default:At(k.trigger)}else switch(k.trigger.type){case Ze.SCHEDULED:g.createMutation.mutate(Hqe(k.trigger,k.query,k.notificationSettings??Kl,k.collectionUuid));break;case Ze.PRICE_ALERT:{const I=mre({trigger:k.trigger,query:k.query,quote:p});I?y.createMutation.mutate(I):o(a({defaultMessage:"Failed to create price alert payload - Missing inputs",id:"Fimh9vZMY/"}));break}case Ze.SHORTCUT:g.createMutation.mutate(zqe(k.trigger,k.query));break;default:At(k.trigger)}},[c,g.updateMutation,g.createMutation,p,y.updateMutation,y.createMutation,o,a]),b=d.useCallback(()=>{v()},[v]),_=d.useCallback(T=>{if(!c.id)return;v({status:T?"ACTIVE":"PAUSED"})},[c.id,v]),w=d.useCallback(()=>{if(c.id)switch(c.trigger.type){case Ze.SCHEDULED:g.deleteMutation.mutate(c.id);break;case Ze.PRICE_ALERT:y.deleteMutation.mutate(c.id);break;case Ze.SHORTCUT:g.deleteMutation.mutate(c.id);break;default:At(c.trigger)}},[c.id,c.trigger,y.deleteMutation,g.deleteMutation]),S=yre({isLoading:x,currentConfiguration:c}),C=d.useMemo(()=>{switch(c.trigger.type){case Ze.SCHEDULED:case Ze.SHORTCUT:return;case Ze.PRICE_ALERT:return S?a({defaultMessage:"Select stock, token or fund to begin",id:"x/nyvvB4aQ"}):void 0;default:At(c.trigger)}},[a,c.trigger,S]),E=c.status==="ACTIVE";return{currentConfiguration:c,setCurrentConfiguration:f,onClickSave:b,onClickToggle:_,onClickDelete:w,isEnabled:E,isLoading:x,isSaveDisabled:S,saveButtonTooltipText:C}}function yre({isLoading:e,currentConfiguration:t}){if(e)return!0;switch(t.trigger.type){case Ze.SCHEDULED:case Ze.SHORTCUT:return!t.query.prompt;case Ze.PRICE_ALERT:{const n=t.trigger;if(!n.symbol||n.symbol.trim()==="")return!0;switch(n.alertType){case fr.TARGET_PRICE:if(!n.price||n.price<=0)return!0;break;case fr.MOVEMENT_AMOUNT:{const r=n.percentageDecimalLowerBound!==Ul/100&&n.percentageDecimalLowerBound!==0;if(!(n.percentageDecimalUpperBound!==Bl/100&&n.percentageDecimalUpperBound!==0)&&!r)return!0;break}default:At(n)}break}default:At(t.trigger)}return!1}const xre=({onSkip:e,onConfirm:t,disabled:n=!1,isLoading:r=!1,result:s=null,buttonText:o,loadingText:a})=>{const{$t:i}=J();return s!==null?l.jsx(K,{className:"bg-base border-t pt-4",children:l.jsx("div",{className:"text-quiet text-sm",children:s?.confirmed===!0?i({defaultMessage:"Task will be created",id:"+A0SHGFNa7"}):i({defaultMessage:"Task was skipped",id:"uRAWVsTn39"})})}):l.jsx(K,{className:"bg-base border-t pt-4",children:l.jsx("div",{className:"flex items-center justify-between gap-4",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ge,{size:"small",variant:"primary",text:r?a||i({defaultMessage:"Creating...",id:"mRL9Vh/e/Z"}):o||i({defaultMessage:"Create Task",id:"4+iiEILSrA"}),onClick:t,disabled:n||r}),l.jsx(st,{size:"small",text:i({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:e,disabled:n||r})]})})})},r_t="pplx.watchlist",s_t=async({query:e,watchlistType:t,limit:n,category:r,cometRenderPlace:s,reason:o})=>{const{data:a,error:i,response:c}=await de.GET("/rest/homepage-widgets/watchlist/list-autosuggest",o,{params:{query:{type:t,query:e,limit:n,category:r,entropy_render_place:s}},timeoutMs:1500,numRetries:1});if(i)throw new he("API_CLIENTS_ERROR",{message:"Failed to get watchlist autosuggestions",cause:i,status:c.status??0});return a.results??Pe},rKe=async({watchlistType:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/homepage-widgets/watchlist/subscription",t,{params:{query:{type:e}},headers:{"content-type":"application/json"},numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get watchlist subscriptions",cause:n,status:s.status??0});return r.results??[]}catch(n){return Z.error(n),[]}},o_t=async({watchlistType:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/homepage-widgets/watchlist/categories",t,{params:{query:{type:e}},numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get watchlist categories",cause:n,status:s.status??0});return r?.results??[]}catch(n){return Z.error(n),[]}},sKe=async({watchlistType:e,identifier:t,reason:n})=>{try{const{error:r,response:s}=await de.PUT("/rest/homepage-widgets/watchlist/subscription",n,{params:{query:{type:e,identifier:t??""}},headers:{"content-type":"application/json"}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to add watchlist subscription",cause:r,status:s.status??0});return!0}catch(r){return Z.error(r),!1}},oKe=async({watchlistType:e,identifier:t,reason:n})=>{try{const{error:r,response:s}=await de.DELETE("/rest/homepage-widgets/watchlist/subscription",n,{params:{query:{type:e,identifier:t}},headers:{"content-type":"application/json"}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to remove watchlist subscription",cause:r,status:s.status??0});return!0}catch(r){return Z.error(r),!1}},aKe=async({watchlistType:e,identifier:t,order:n,reason:r})=>{try{const{error:s,response:o}=await de.PATCH("/rest/homepage-widgets/watchlist/subscription",r,{params:{query:{type:e,identifier:t}},body:{order:n},headers:{"content-type":"application/json"}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update watchlist subscription order",cause:s,status:o.status??0});return!0}catch(s){return Z.error(s),!1}},Th=e=>be.makeEphemeralQueryKey("watchlist",e,"subscriptions"),iKe=e=>be.makeEphemeralQueryKey("watchlist",e,"addSubscription"),lKe=e=>be.makeEphemeralQueryKey("watchlist",e,"removeSubscription"),cKe=e=>be.makeEphemeralQueryKey("watchlist",e,"updateSubscription"),uKe=({watchlistType:e,reason:t})=>{const n=Wt(),r=Th(e);return mt({queryKey:r,queryFn:()=>rKe({watchlistType:e,reason:t}),staleTime:0,enabled:n})},dKe=({watchlistType:e,queryClient:t,reason:n})=>{const r=Th(e);return Rt({mutationKey:iKe(e),mutationFn:async s=>sKe({watchlistType:e,reason:n,...s}),onMutate:async({identifier:s,description:o,image:a,title:i})=>{await t.cancelQueries({queryKey:r});const c=t.getQueryData(Th(e));return t.setQueryData(r,(u=[])=>{const f={identifier:s??"",description:o??"",image_url:a??"",title:i??"",subscribed:!0,order:Date.now()},m=u.filter(p=>p.identifier!==s);return[f,...m]}),{previousSubscriptions:c}},onError:(s,o,a)=>{Z.error("Error adding watchlist subscription",s),t.setQueryData(r,a?.previousSubscriptions)},onSuccess:()=>{t.invalidateQueries({queryKey:r})}})},fKe=({watchlistType:e,queryClient:t,reason:n})=>{const r=Th(e);return Rt({mutationKey:lKe(e),mutationFn:async s=>oKe({watchlistType:e,reason:n,...s}),onSuccess:()=>{t.invalidateQueries({queryKey:r})},onMutate:async({identifier:s})=>{await t.cancelQueries({queryKey:r});const o=t.getQueryData(["watchlist",e]);return t.setQueryData(r,(a=[])=>a.filter(i=>i.identifier!==s)),{previousSubscriptions:o}},onError:(s,o,a)=>{Z.error("Error removing watchlist subscription",s),t.setQueryData(r,a?.previousSubscriptions)}})},a_t=({watchlistType:e,queryClient:t,reason:n})=>{const r=Th(e);return Rt({mutationKey:cKe(e),mutationFn:async s=>aKe({watchlistType:e,reason:n,...s}),onMutate:async({newOrderedList:s})=>{await t.cancelQueries({queryKey:r});const o=t.getQueryData(r);return t.setQueryData(r,s),{previousSubscriptions:o}},onError:(s,o,a)=>{Z.error("Error updating watchlist subscription order",s),a?.previousSubscriptions&&t.setQueryData(r,a.previousSubscriptions)},onSuccess:()=>{t.invalidateQueries({queryKey:r})}})},pb=0,hb=1,nN=!0,gb="finance",vre=!1,bre="1d",_re=0,wre=!0,Cre=!0,Sre=!1,Ere=null,kre=null,Mre=null,rN=({prefix:e="finance/quote",symbol:t,withHistory:n=vre,historyAfterHours:r=wre,historyPeriod:s=bre,historyOffset:o=_re,historyRedirect:a=Sre,historyInterval:i=Ere,historyStartDate:c=kre,historyEndDate:u=Mre,withUiHints:f=Cre})=>be.makeEphemeralQueryKey(e,t,n,r,s,i,o,a,c,u,f),eu=async({symbol:e,withHistory:t=vre,historyAfterHours:n=wre,historyPeriod:r=bre,historyOffset:s=_re,historyRedirect:o=Sre,historyInterval:a=Ere,withUiHints:i=Cre,historyStartDate:c=kre,historyEndDate:u=Mre})=>{const{data:f,error:m,response:p}=await de.GET("/rest/finance/quote/{market_identifier}",gb,{params:{path:{market_identifier:e},query:{with_history:t,history_period:r,history_offset:s,history_after_hours:n,with_ui_hints:i,history_redirect:o,history_time_interval:a,history_start_date:c,history_end_date:u}},timeoutMs:pb,numRetries:hb,shouldNotAddSourceVersionQueryParams:nN});if(p.status===404)return null;if(m)throw new he("API_CLIENTS_ERROR",{cause:m,status:p.status??0});return f};function mKe(e,t){return be.makeEphemeralQueryKey("finance/peers",e,t)}async function pKe({symbol:e,headers:t,index:n}){const{data:r,error:s,response:o}=await de.GET("/rest/finance/peers/{market_identifier}",gb,{params:{path:{market_identifier:e},query:{with_index:n}},headers:t,timeoutMs:pb,numRetries:hb});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r}const BP=(e,t)=>["finance-autosuggest",e,t],UP=async({query:e,reason:t,country:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/list-autosuggest",t,{params:{query:{query:e,country:n}},timeoutMs:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.results??Pe}catch(r){return Z.error(r),[]}},hKe=(e,t,n)=>be.makeEphemeralQueryKey("finance/currency-exchange",e,t,n);async function gKe({sourceCurrency:e,targetCurrency:t,amount:n=1,headers:r}){const{data:s,error:o,response:a}=await de.GET("/rest/finance/currency-exchange",gb,{params:{query:{source_currency:e,target_currency:t,amount:n}},headers:r,timeoutMs:pb,numRetries:hb,shouldNotAddSourceVersionQueryParams:nN});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0});return s}const yKe=({eventId:e,historyPeriod:t,marketsSort:n,withCommentary:r,emphasizedMarketIds:s})=>be.makeEphemeralQueryKey("finance/prediction-markets/quote",e,t,n,r,s);async function xKe({eventId:e,historyPeriod:t,marketsSort:n="probability",withCommentary:r,emphasizedMarketIds:s}){const o=await de.GET("/rest/finance/prediction-markets/quote/{event_id}",gb,{params:{path:{event_id:e},query:{history_period:t,markets_sort:n,with_commentary:r,emphasized_market_ids:s}},timeoutMs:pb,numRetries:hb,shouldNotAddSourceVersionQueryParams:nN});if(o.error)throw new Error("Failed to fetch polymarket quote",{cause:o.error});return o.data}function vKe(e,t){const n=t.target_price!=null,r=t.movement_percent!=null,s=t.target_price?.toString(),o={query:{prompt:e.prompt||"",searchModel:e.model_preference||ie.DEFAULT},status:"ACTIVE",notificationSettings:Kl,defaultTargetPriceValue:s};if(n)return{...o,trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:t.target_price,currency:CI,symbol:t.ticker_symbol}};if(r){const a=t.movement_percent/100;return{...o,trigger:{type:Ze.PRICE_ALERT,alertType:fr.MOVEMENT_AMOUNT,percentageDecimalLowerBound:t.negative_direction?-a:0,percentageDecimalUpperBound:t.positive_direction?a:0,symbol:t.ticker_symbol}}}else return{...o,trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:0,currency:CI,symbol:t.ticker_symbol}}}async function bKe(e){try{return(await eu({symbol:e}))?.currency?.toLowerCase()||"usd"}catch(t){return Z.warn(`Failed to fetch currency for symbol ${e}`,{error:t}),"usd"}}const _Ke=({result:e})=>e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),size:14,className:"text-super shrink-0",title:"Confirmed"}),l.jsx("span",{className:"text-super text-xs font-medium leading-none",children:l.jsx(je,{defaultMessage:"Alert confirmed",id:"0wByyMUPxz"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:l.jsx(je,{defaultMessage:"Alert skipped",id:"AYQONqG1U3"})})]}):null,Tre=A.memo(({sendStepResult:e,taskAction:t,priceAlertData:n,stepUUID:r,isFinished:s=!1})=>{const{$t:o}=J(),{session:a}=Ne(),{trackEvent:i}=Xe(a),c="settings_create",[u,f]=d.useState(()=>vKe(t,n)),[m,p]=d.useState(null),[h,g]=d.useState(null),[y,x]=d.useState(null),v=d.useRef(!1),b="price_alert_operation";d.useEffect(()=>{(async()=>{if(!n.ticker_symbol||s){g(!0);return}try{await eu({symbol:n.ticker_symbol})===null?(g(!1),e({confirmed:!1,user_input:o({defaultMessage:'The stock symbol "{symbol}" could not be found. Please verify the ticker symbol is correct.',id:"yWihQJNDOI"},{symbol:n.ticker_symbol})},b,!1)):g(!0)}catch(k){Z.error("Failed to validate ticker",{ticker:n.ticker_symbol,error:k}),g(!1),e({confirmed:!1,user_input:o({defaultMessage:'Unable to validate the stock symbol "{symbol}" due to a network error. Please try again.',id:"C0nM7QfjoN"},{symbol:n.ticker_symbol})},b,!1)}})()},[n.ticker_symbol]),d.useEffect(()=>{t&&!s&&h===!0&&!v.current&&(i("price alert modal opened",{source:c}),v.current=!0)},[h]),d.useEffect(()=>{(async()=>{if(n.ticker_symbol&&h===!0&&u.trigger.type===Ze.PRICE_ALERT)try{const k=await bKe(n.ticker_symbol);f(I=>({...I,trigger:{...I.trigger,currency:k}}))}catch(k){Z.warn("Failed to fetch currency for ticker",{ticker:n.ticker_symbol,error:k})}})()},[n.ticker_symbol,h,u.trigger.type]);const _=d.useMemo(()=>o({defaultMessage:"Create Price Alert",id:"WY6/zFtq4x"}),[o]),w=d.useCallback(T=>{p(T),T.confirmed?(i("price alert modal action",{source:c,action:"created"}),e({confirmed:!0,task_action:T.task_action},b,!1)):(i("price alert modal action",{source:c,action:"deleted"}),e({confirmed:!1},b,!1))},[e,b,i,c]),S=d.useCallback(()=>{p({confirmed:!1}),i("price alert modal action",{source:c,action:"skipped"}),e({confirmed:!1},b,!1)},[i,c,e,b]),C=d.useCallback(()=>{const T=u.trigger;let k={task_name:`Price Alert: ${n.ticker_symbol}`,prompt:u.query?.prompt,model_preference:u.query?.searchModel||ie.DEFAULT,schedule:void 0,expiry_date:void 0,event_entity:n.ticker_symbol};switch(T.alertType){case fr.TARGET_PRICE:{k={...k,event_type:"STOCK_PRICE_TARGET",target_price:T.price,current_price:n.current_price};break}case fr.MOVEMENT_AMOUNT:{const I=T.percentageDecimalUpperBound,M=T.percentageDecimalLowerBound;k={...k,event_type:"STOCK_PRICE_MOVEMENT",upper_bound:I&&I>0?I*100:void 0,lower_bound:M&&M<0?M*100:void 0};break}default:At(T)}w({confirmed:!0,task_action:k})},[u,w,n]),E=d.useMemo(()=>s?!0:yre({isLoading:!1,currentConfiguration:u}),[u,s]);return!t||!n?null:s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:o({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):h===null||h===!1?null:l.jsxs("div",{className:"bg-subtler border-subtlest transform rounded-xl border transition-transform duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between rounded-t-lg px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:l.jsx(ut,{name:B("trending-up"),size:16,className:"text-quiet"})}),l.jsx("h3",{className:"text-foreground text-sm font-medium",children:_})]}),l.jsx(_Ke,{result:m})]}),l.jsx("div",{className:"p-4",children:l.jsx(Wc,{children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(mb,{configuration:u,onConfigurationChange:f,errorMessage:y??void 0,onError:x,canEditSpace:!1}),y&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:y})]}),l.jsx(xre,{onSkip:S,onConfirm:C,disabled:E,result:m,buttonText:_})]})})})]})});Tre.displayName="PriceAlertOperationStep";const wKe=e=>{const[t,n]=d.useState([]),r=d.useRef(e);d.useEffect(()=>{r.current=e},[e]);const s=d.useCallback((i,c)=>{n(u=>{const f=[...u];return f[i]=c,f})},[]),o=d.useMemo(()=>new Map,[]);d.useEffect(()=>{const i=t.reduce((c,u)=>c+u,0);i>0&&r.current?.(i)},[t]);const a=d.useCallback(i=>(o.has(i)||o.set(i,c=>{s(i,c)}),o.get(i)),[o,s]);return d.useMemo(()=>({groupCounts:t,handleGroupCountChange:s,getGroupHandler:a}),[t,s,a])},Are=A.memo(({result:e,textClassName:t})=>{const n=d.useMemo(()=>e.start?new Date(e.start):null,[e.start]),r=d.useMemo(()=>e.end?new Date(e.end):null,[e.end]),s=e.is_all_day===!0,o=Nee(e.calendar_color?.background||"oklch(var(--super-color))"),a=Ree(o),i=d.useMemo(()=>r?new Date(r.getTime()-1440*60*1e3):null,[r]),c=()=>n?s?(r?Math.round((r.getTime()-n.getTime())/864e5):1)<=1?l.jsx(Ip,{startDate:n,endDate:n,isAllDay:!0,showDate:!0,includeYear:!1}):l.jsx(Ip,{startDate:n,endDate:i,isAllDay:!0,showDate:!0,includeYear:!1}):l.jsx(Ip,{startDate:n,endDate:r||n,isAllDay:!1,showDate:!0,includeYear:!1}):null;return l.jsx("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer gap-3 rounded-lg px-2 py-1.5",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"py-xs relative w-1",children:l.jsx("div",{className:z("inset-y-two absolute w-1 shrink-0 self-stretch rounded-full",{"brightness-[0.8]":a==="Fail"}),style:{backgroundColor:o}})}),l.jsxs("div",{className:"gap-two flex min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex min-w-0 items-center justify-between gap-2",children:e.title&&l.jsx(V,{variant:"smallBold",className:"shrink-0",as:"span",children:e.title})}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:n&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis",t),variant:"tinyMono",color:"light",as:"span",children:c()})})]})]})})});Are.displayName="CalendarResult";var op={exports:{}};var CKe=op.exports,VP;function SKe(){return VP||(VP=1,(function(e,t){(function(n){var r=t,s=e&&e.exports==r&&e,o=typeof td=="object"&&td;(o.global===o||o.window===o)&&(n=o);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,i=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,u=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,f={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot"," ":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr",ª:"ordf",á:"aacute",Á:"Aacute",à:"agrave",À:"Agrave",ă:"abreve",Ă:"Abreve",â:"acirc",Â:"Acirc",å:"aring",Å:"angst",ä:"auml",Ä:"Auml",ã:"atilde",Ã:"Atilde",ą:"aogon",Ą:"Aogon",ā:"amacr",Ā:"Amacr",æ:"aelig",Æ:"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf",ℬ:"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf",ℭ:"Cfr","𝒞":"Cscr",ℂ:"Copf",ć:"cacute",Ć:"Cacute",ĉ:"ccirc",Ĉ:"Ccirc",č:"ccaron",Č:"Ccaron",ċ:"cdot",Ċ:"Cdot",ç:"ccedil",Ç:"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf",ď:"dcaron",Ď:"Dcaron",đ:"dstrok",Đ:"Dstrok",ð:"eth",Ð:"ETH","ⅇ":"ee",ℯ:"escr","𝔢":"efr","𝕖":"eopf",ℰ:"Escr","𝔈":"Efr","𝔼":"Eopf",é:"eacute",É:"Eacute",è:"egrave",È:"Egrave",ê:"ecirc",Ê:"Ecirc",ě:"ecaron",Ě:"Ecaron",ë:"euml",Ë:"Euml",ė:"edot",Ė:"Edot",ę:"eogon",Ę:"Eogon",ē:"emacr",Ē:"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf",ℱ:"Fscr",ff:"fflig",ffi:"ffilig",ffl:"ffllig",fi:"filig",fj:"fjlig",fl:"fllig",ƒ:"fnof",ℊ:"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr",ǵ:"gacute",ğ:"gbreve",Ğ:"Gbreve",ĝ:"gcirc",Ĝ:"Gcirc",ġ:"gdot",Ġ:"Gdot",Ģ:"Gcedil","𝔥":"hfr",ℎ:"planckh","𝒽":"hscr","𝕙":"hopf",ℋ:"Hscr",ℌ:"Hfr",ℍ:"Hopf",ĥ:"hcirc",Ĥ:"Hcirc",ℏ:"hbar",ħ:"hstrok",Ħ:"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf",ℐ:"Iscr",ℑ:"Im",í:"iacute",Í:"Iacute",ì:"igrave",Ì:"Igrave",î:"icirc",Î:"Icirc",ï:"iuml",Ï:"Iuml",ĩ:"itilde",Ĩ:"Itilde",İ:"Idot",į:"iogon",Į:"Iogon",ī:"imacr",Ī:"Imacr",ij:"ijlig",IJ:"IJlig",ı:"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf",ĵ:"jcirc",Ĵ:"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr",ķ:"kcedil",Ķ:"Kcedil","𝔩":"lfr","𝓁":"lscr",ℓ:"ell","𝕝":"lopf",ℒ:"Lscr","𝔏":"Lfr","𝕃":"Lopf",ĺ:"lacute",Ĺ:"Lacute",ľ:"lcaron",Ľ:"Lcaron",ļ:"lcedil",Ļ:"Lcedil",ł:"lstrok",Ł:"Lstrok",ŀ:"lmidot",Ŀ:"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf",ℳ:"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr",ℕ:"Nopf","𝒩":"Nscr","𝔑":"Nfr",ń:"nacute",Ń:"Nacute",ň:"ncaron",Ň:"Ncaron",ñ:"ntilde",Ñ:"Ntilde",ņ:"ncedil",Ņ:"Ncedil","№":"numero",ŋ:"eng",Ŋ:"ENG","𝕠":"oopf","𝔬":"ofr",ℴ:"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf",º:"ordm",ó:"oacute",Ó:"Oacute",ò:"ograve",Ò:"Ograve",ô:"ocirc",Ô:"Ocirc",ö:"ouml",Ö:"Ouml",ő:"odblac",Ő:"Odblac",õ:"otilde",Õ:"Otilde",ø:"oslash",Ø:"Oslash",ō:"omacr",Ō:"Omacr",œ:"oelig",Œ:"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf",ℙ:"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr",ℚ:"Qopf",ĸ:"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr",ℛ:"Rscr",ℜ:"Re",ℝ:"Ropf",ŕ:"racute",Ŕ:"Racute",ř:"rcaron",Ř:"Rcaron",ŗ:"rcedil",Ŗ:"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS",ś:"sacute",Ś:"Sacute",ŝ:"scirc",Ŝ:"Scirc",š:"scaron",Š:"Scaron",ş:"scedil",Ş:"Scedil",ß:"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf",ť:"tcaron",Ť:"Tcaron",ţ:"tcedil",Ţ:"Tcedil","™":"trade",ŧ:"tstrok",Ŧ:"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr",ú:"uacute",Ú:"Uacute",ù:"ugrave",Ù:"Ugrave",ŭ:"ubreve",Ŭ:"Ubreve",û:"ucirc",Û:"Ucirc",ů:"uring",Ů:"Uring",ü:"uuml",Ü:"Uuml",ű:"udblac",Ű:"Udblac",ũ:"utilde",Ũ:"Utilde",ų:"uogon",Ų:"Uogon",ū:"umacr",Ū:"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr",ŵ:"wcirc",Ŵ:"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf",ý:"yacute",Ý:"Yacute",ŷ:"ycirc",Ŷ:"Ycirc",ÿ:"yuml",Ÿ:"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf",ℨ:"Zfr",ℤ:"Zopf","𝒵":"Zscr",ź:"zacute",Ź:"Zacute",ž:"zcaron",Ž:"Zcaron",ż:"zdot",Ż:"Zdot",Ƶ:"imped",þ:"thorn",Þ:"THORN",ʼn:"napos",α:"alpha",Α:"Alpha",β:"beta",Β:"Beta",γ:"gamma",Γ:"Gamma",δ:"delta",Δ:"Delta",ε:"epsi","ϵ":"epsiv",Ε:"Epsilon",ϝ:"gammad",Ϝ:"Gammad",ζ:"zeta",Ζ:"Zeta",η:"eta",Η:"Eta",θ:"theta",ϑ:"thetav",Θ:"Theta",ι:"iota",Ι:"Iota",κ:"kappa",ϰ:"kappav",Κ:"Kappa",λ:"lambda",Λ:"Lambda",μ:"mu",µ:"micro",Μ:"Mu",ν:"nu",Ν:"Nu",ξ:"xi",Ξ:"Xi",ο:"omicron",Ο:"Omicron",π:"pi",ϖ:"piv",Π:"Pi",ρ:"rho",ϱ:"rhov",Ρ:"Rho",σ:"sigma",Σ:"Sigma",ς:"sigmaf",τ:"tau",Τ:"Tau",υ:"upsi",Υ:"Upsilon",ϒ:"Upsi",φ:"phi",ϕ:"phiv",Φ:"Phi",χ:"chi",Χ:"Chi",ψ:"psi",Ψ:"Psi",ω:"omega",Ω:"ohm",а:"acy",А:"Acy",б:"bcy",Б:"Bcy",в:"vcy",В:"Vcy",г:"gcy",Г:"Gcy",ѓ:"gjcy",Ѓ:"GJcy",д:"dcy",Д:"Dcy",ђ:"djcy",Ђ:"DJcy",е:"iecy",Е:"IEcy",ё:"iocy",Ё:"IOcy",є:"jukcy",Є:"Jukcy",ж:"zhcy",Ж:"ZHcy",з:"zcy",З:"Zcy",ѕ:"dscy",Ѕ:"DScy",и:"icy",И:"Icy",і:"iukcy",І:"Iukcy",ї:"yicy",Ї:"YIcy",й:"jcy",Й:"Jcy",ј:"jsercy",Ј:"Jsercy",к:"kcy",К:"Kcy",ќ:"kjcy",Ќ:"KJcy",л:"lcy",Л:"Lcy",љ:"ljcy",Љ:"LJcy",м:"mcy",М:"Mcy",н:"ncy",Н:"Ncy",њ:"njcy",Њ:"NJcy",о:"ocy",О:"Ocy",п:"pcy",П:"Pcy",р:"rcy",Р:"Rcy",с:"scy",С:"Scy",т:"tcy",Т:"Tcy",ћ:"tshcy",Ћ:"TSHcy",у:"ucy",У:"Ucy",ў:"ubrcy",Ў:"Ubrcy",ф:"fcy",Ф:"Fcy",х:"khcy",Х:"KHcy",ц:"tscy",Ц:"TScy",ч:"chcy",Ч:"CHcy",џ:"dzcy",Џ:"DZcy",ш:"shcy",Ш:"SHcy",щ:"shchcy",Щ:"SHCHcy",ъ:"hardcy",Ъ:"HARDcy",ы:"ycy",Ы:"Ycy",ь:"softcy",Ь:"SOFTcy",э:"ecy",Э:"Ecy",ю:"yucy",Ю:"YUcy",я:"yacy",Я:"YAcy",ℵ:"aleph",ℶ:"beth",ℷ:"gimel",ℸ:"daleth"},m=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,x={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,S={},C=S.hasOwnProperty,E=function(U,O){return C.call(U,O)},T=function(U,O){for(var $=-1,G=U.length;++$=55296&&U<=57343||U>1114111?(O&&D("character reference outside the permissible Unicode range"),"�"):E(b,U)?(O&&D("disallowed character reference"),b[U]):(O&&T(_,U)&&D("disallowed character reference"),U>65535&&(U-=65536,$+=w(U>>>10&1023|55296),U=56320|U&1023),$+=w(U),$)},M=function(U){return"&#x"+U.toString(16).toUpperCase()+";"},N=function(U){return"&#"+U+";"},D=function(U){throw Error("Parse error: "+U)},j=function(U,O){O=k(O,j.options);var $=O.strict;$&&g.test(U)&&D("forbidden code point");var G=O.encodeEverything,H=O.useNamedReferences,Q=O.allowUnsafeSymbols,Y=O.decimal?N:M,te=function(se){return Y(se.charCodeAt(0))};return G?(U=U.replace(i,function(se){return H&&E(f,se)?"&"+f[se]+";":te(se)}),H&&(U=U.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),H&&(U=U.replace(u,function(se){return"&"+f[se]+";"}))):H?(Q||(U=U.replace(m,function(se){return"&"+f[se]+";"})),U=U.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),U=U.replace(u,function(se){return"&"+f[se]+";"})):Q||(U=U.replace(m,te)),U.replace(a,function(se){var ae=se.charCodeAt(0),X=se.charCodeAt(1),ee=(ae-55296)*1024+X-56320+65536;return Y(ee)}).replace(c,te)};j.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var F=function(U,O){O=k(O,F.options);var $=O.strict;return $&&h.test(U)&&D("malformed character reference"),U.replace(y,function(G,H,Q,Y,te,se,ae,X,ee){var le,re,ce,ue,me,we;return H?(me=H,x[me]):Q?(me=Q,we=Y,we&&O.isAttributeValue?($&&we=="="&&D("`&` did not start a character reference"),G):($&&D("named character reference was not terminated by a semicolon"),v[me]+(we||""))):te?(ce=te,re=se,$&&!re&&D("character reference was not terminated by a semicolon"),le=parseInt(ce,10),I(le,$)):ae?(ue=ae,re=X,$&&!re&&D("character reference was not terminated by a semicolon"),le=parseInt(ue,16),I(le,$)):($&&D("named character reference was not terminated by a semicolon"),G)})};F.options={isAttributeValue:!1,strict:!1};var R=function(U){return U.replace(m,function(O){return p[O]})},P={version:"1.2.0",encode:j,decode:F,escape:R,unescape:F};if(r&&!r.nodeType)if(s)s.exports=P;else for(var L in P)E(P,L)&&(r[L]=P[L]);else n.he=P})(CKe)})(op,op.exports)),op.exports}var EKe=SKe();const HP=uo(EKe),kKe=e=>{const t=e.match(/^(.+?)\s*<(.+)>$/);return t?t[1]?.trim().replace(/^["']|["']$/g,"")||t[2]?.trim()||"":e.trim().replace(/^["']|["']$/g,"")},MKe=e=>e==="GCAL"?{src:vI,alt:"Gmail"}:e==="OUTLOOK"?{src:eBe,alt:"Outlook"}:{src:vI,alt:"Gmail"},TKe=e=>{const t=Date.now(),n=new Date(e),r=t-n.getTime();if(r<0)return"";const s=1e3*60,o=s*60,a=o*24,i=a*7,c=a*30,u=a*365;return r{const r=MKe(e.connection_type),s=n?l.jsx(rn,{icon:n,size:"tiny"}):l.jsx("img",{src:r.src,alt:r.alt,className:"size-[16px]"}),o=e.date?TKe(e.date):null;return l.jsxs("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer gap-3 rounded-lg px-2 py-1.5",children:[l.jsx("span",{className:"mt-two shrink-0",children:s}),l.jsxs("div",{className:"gap-two flex min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex min-w-0 items-center justify-between gap-2",children:e.sender&&l.jsx(V,{variant:"smallBold",className:"shrink-0",as:"span",children:kKe(e.sender)})}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.subject&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis font-medium",t),variant:"small",as:"span",children:HP.decode(e.subject)})}),l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.snippet&&l.jsx(V,{variant:"tinyMono",className:"min-w-0 shrink truncate",color:"light",as:"span",children:HP.decode(e.snippet)}),o&&l.jsx(V,{variant:"tinyMono",className:"shrink-0 text-right",color:"light",as:"span",children:o})]})]})]})});Nre.displayName="EmailSearchResult";const Rre=A.memo(({result:e,textClassName:t,icon:n})=>{const r=l.jsx(rn,{icon:n||B("user"),size:"tiny"}),s=("display_name"in e?e.display_name:void 0)||("name"in e?e.name:void 0)||"",o=("email_address"in e?e.email_address:void 0)||("url"in e?e.url:void 0)||"";return l.jsxs("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5",children:[l.jsx("span",{className:"shrink-0",children:r}),l.jsxs("span",{className:"gap-xs flex min-w-0 items-center",children:[s&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis",t),variant:"small",as:"span",children:s||(o?o.split("@")[0]:"")}),o&&l.jsx(V,{variant:"tinyMono",className:"mt-px min-w-0 shrink truncate",color:"light",as:"span",children:o})]})]})});Rre.displayName="UserInfoSearchResult";const Dre=A.memo(({result:e,textClassName:t,icon:n})=>{const r=eg(e.url),s=M4(e),o=lW(e,r),a=n?l.jsx(rn,{icon:n,size:"tiny"}):l.jsx(ya.Icon,{url:e.url,isAttachment:e.is_attachment||!1,connectionType:r,isMemory:e.is_memory||!1,isConversationHistory:e.is_conversation_history||!1,isClientContext:e.is_client_context||!1,isInlineAttachment:!1,patentName:s}),i=e.url?l.jsx(ya.Source,{url:e.url,source:o,isAttachment:e.is_attachment||!1,connectionType:r,isMemory:e.is_memory||!1,isConversationHistory:e.is_conversation_history||!1,snippet:e.snippet,patentName:s}):null,c=e.is_memory?e.snippet:e.name;return l.jsxs("div",{className:"hover:bg-subtler relative flex min-w-0 cursor-pointer items-start gap-3 rounded-lg px-2 py-1.5",children:[l.jsx(V,{variant:"small",className:"mt-two shrink-0",children:a}),l.jsxs("div",{className:"gap-sm flex min-w-0 flex-1 items-start",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c&&l.jsx(V,{className:z("min-w-0 shrink truncate break-words",t),variant:"small",as:"span",children:c}),e.is_conversation_history&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"pt-two line-clamp-1",children:e.snippet})]}),!e.is_conversation_history&&l.jsx(V,{variant:"tinyRegular",className:"overflow-wrap-anywhere mt-px break-words text-right lowercase",color:"light",as:"span",children:i})]})]})});Dre.displayName="WebSearchResult";const AKe=e=>{if(!e)return;const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:void 0},sN=e=>{const t=e.is_memory?"memory":"conversation_history",n=e.is_memory?e.url:void 0,r=e.is_conversation_history?AKe(e.url):void 0;return{snippet:e.snippet,url:e.url??"",title:e.name,type:t,memoryKey:n,entryUuid:r,timestamp:e.timestamp??""}},jre=A.memo(({isOpen:e,onClose:t,snippet:n,type:r,url:s,memoryKey:o,title:a,timestamp:i})=>{const{formatDate:c}=J(),u=ui(),f=r==="conversation_history",m=r==="memory",{session:p}=Ne(),{trackEvent:h}=Xe(p),{openStackedModal:g}=pn().legacy,y=d.useCallback(()=>{h("navigated to manage memory",{memory_key:o}),g("memoryListModal",{isMemoryEnabled:!0})},[o,h,g]),x=d.useMemo(()=>l.jsx(V,{variant:"small",children:l.jsx(je,{defaultMessage:"Manage",id:"0AzlrbMWV9"})}),[]),v=d.useMemo(()=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ge,{icon:f?B("list-search"):B("bubble-text")}),l.jsx(V,{variant:"baseSemi",children:f?l.jsx(je,{defaultMessage:"Library",id:"StcK672jB9"}):l.jsx(je,{defaultMessage:"Memory",id:"dVx3yznM2C"})})]}),[f]);return l.jsxs(po,{variant:u?"bottom-sheet":"side-sheet",isOpen:e,onClose:t,modalClassname:"md:!max-w-[400px] md:!min-w-[400px]",modalContentClassname:"justify-between",titleContent:v,children:[l.jsxs(K,{className:"flex size-full flex-col items-start",children:[a&&i&&l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"baseSemi",children:a}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"pb-sm",children:c(i,{dateStyle:"long"})})]}),l.jsxs("div",{className:"inline",children:[l.jsx(V,{variant:"small",className:"inline",children:n}),l.jsx(V,{variant:"smallBold",className:"ml-1 inline",color:"super",children:f&&l.jsx(yt,{href:s,target:"_blank",rel:"noopener",className:"whitespace-nowrap",children:l.jsx(je,{defaultMessage:"See more",id:"yoLwRWw99S"})})})]})]}),m&&l.jsxs(K,{className:"flex w-full items-center justify-center gap-1",children:[l.jsx(V,{variant:"small",className:"inline",color:"light",children:l.jsx(je,{defaultMessage:"See all your memories.",id:"h0JAuR900y"})}),l.jsx(st,{onClick:y,size:"small",variant:"common",noPadding:!0,text:x})]})]})});jre.displayName="MemorySearchHistoryModal";const NKe=Object.freeze(Object.defineProperty({__proto__:null,MemorySearchHistoryModal:jre,createModalPayload:sN},Symbol.toStringTag,{value:"Module"})),Ire=e=>e.is_scrubbed??!1,RKe=e=>yb(e)?Ire(e):!1,yb=e=>e.is_memory||e.is_conversation_history,DKe=e=>e.is_memory,Wg=e=>{const t=e.is_client_context,n=RKe(e);return t||n},oN=()=>{const{openModal:e}=pn().legacy,{session:t}=Ne(),{trackEvent:n}=Xe(t);return d.useCallback(s=>{if(Wg(s))return;const o=sN(s);e("memorySearchHistoryModal",o);const a=o.type,i=o.memoryKey,c=o.entryUuid;n("viewed memory search history modal",{type:a,...a==="memory"&&{memory_key:i},...a==="conversation_history"&&{entry_uuid:c}})},[e,n])},jKe=(e,t)=>{const{value:n,loading:r}=zt({flag:"comet-open-citations-in-sidecar",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Pre=()=>{const e=An(),t=Do(),{variation:n}=jKe(!1);Rn();const r=On(),s=r?.startsWith("/search/")||r?.startsWith("/sidecar/search/");return e&&n&&!t&&s},IKe=({reason:e,entryUUID:t,openFile:n,onSuccess:r})=>{const{openToast:s}=hn(),o=J();return{openPatentInViewer:d.useCallback(async({name:i,url:c,fileSource:u})=>{try{n({name:i,url:null,fileSource:u,entryUUID:t});const{file_url:f}=await Oz({request:{file_url:c,view_mode:!0},reason:e});r?.({entryUUID:t,fileName:i}),n({name:i,url:f,fileSource:u,entryUUID:t})}catch{n({name:i,url:null,fileSource:u,entryUUID:t}),s({message:o.formatMessage({defaultMessage:"Failed to load patent. Please try again.",id:"CVx0UPNJGk"}),variant:"error",timeout:5e3})}},[e,t,n,r,s,o])}},PKe=({heading:e,groupIndex:t})=>l.jsxs(l.Fragment,{children:[t>0&&l.jsx("div",{className:"border-subtlest border-b"}),l.jsx(K,{variant:"raised",className:"-mx-xs pl-sm pb-sm sticky top-0 z-30 flex items-center gap-3 pt-3",children:l.jsx(V,{variant:"tinyRegular",children:e})})]}),pl=A.memo(({onClick:e,stepDelay:t,isFinished:n,results:r,textClassName:s,groupBy:o,onCountChange:a,icon:i,resultType:c="web",maxHeight:u=250})=>{const{getGroupHandler:f}=wKe(a),m=un(),p=oN(),h=Pre(),g=d.useRef(h);g.current=h;const{openFile:y}=d.useContext(y6),{openPatentInViewer:x}=IKe({reason:"patent-search-result",openFile:y}),v=d.useCallback(w=>{(w.is_memory||w.is_conversation_history)&&p(w)},[p]),b=d.useCallback(w=>S=>{if("is_conversation_history"in w){if(w.is_conversation_history||w.is_memory){S.preventDefault(),v(w);return}if(w.is_attachment||w.is_memory)return S.preventDefault();if(tg(w)){S.preventDefault(),x({url:w.url,name:w.name});return}if(g.current){aV({adapter:m,event:S,reason:"citation-regular-list",url:w.url,tabId:w.tab_id});return}Dx(S)&&(S.preventDefault(),m.openTab({url:w.url,tabId:w.tab_id}).catch(()=>{window.open(w.url,"_blank")}))}if(c==="email"||c==="calendar"){if(e){S.preventDefault();const E="url"in w?w.url:"";e(E||"")}return}const C="url"in w?w.url:"";e?.(C||"")},[m,e,c,v,x]);if(!r||r.length===0)return null;let _=[];if(o){const w=r,S=new Map;w.forEach(T=>{const k=T.category;S.has(k)||S.set(k,[]),S.get(k).push(T)});const C={open_tab:{heading:"Opened tabs",icon:l.jsx(ge,{icon:B("browser-plus")})},closed_tab:{heading:"Recently closed tabs",icon:l.jsx(ge,{icon:B("browser-minus")})},history:{heading:"Browser history",icon:l.jsx(ge,{icon:B("history")})}},E=S.size>1;_=Array.from(S.entries()).map(([T,k])=>{const I=C[T];return{heading:E?I?.heading||T:void 0,icon:E?I?.icon:void 0,results:k}})}else r.length>0&&r[0]&&"results"in r[0]?_=r.map(C=>({heading:C.heading,results:C.results})):_=[{results:[...r]}];return l.jsx(Qf,{children:l.jsx(Ng,{maxHeight:u,autoScroll:!1,topGradientOffset:_.length>1?36:0,scrollContainerClassName:_.length===1?"pt-sm":void 0,children:l.jsx("div",{className:"flex flex-col gap-px",children:_.map((w,S)=>{const C=w.results.map((T,k)=>{const I="url"in T?T.url:"",M=()=>{const N={result:T,textClassName:typeof s=="function"?s(T):s,icon:i};switch(c){case"web":return l.jsx(Dre,{...N});case"userinfo":return l.jsx(Rre,{...N});case"email":return l.jsx(Nre,{...N});case"calendar":return l.jsx(Are,{...N});default:return null}};return l.jsx(yt,{className:"-ml-xs block",href:I||"#",target:"_blank",rel:"noopener nofollow",onClick:b(T),children:M()},`${S}-${I||k}-${k}`)}),E=f(S);return l.jsxs("div",{className:"mb-sm last:mb-0",children:[w.heading&&_.length>1&&l.jsx(PKe,{heading:w.heading,groupIndex:S}),l.jsx(Zf,{items:C,stepDelay:t,isFinished:n,vertical:!0,truncate:!1,onCountChange:E})]},S)})})})})});pl.displayName="SearchResultsListStep";function Ore(e={}){const{scrollContainerRef:t,enabled:n=!0}=e,r=d.useCallback(s=>{if(!n)return;const o=t?.current;o&&o.scrollBy({top:s.deltaY,left:s.deltaX,behavior:"instant"})},[t,n]);return d.useMemo(()=>({onWheel:r}),[r])}const OKe=Ce(async()=>{const{CitationModal:e}=await Se(()=>q(()=>import("./CitationModal-Czu54JG6.js"),__vite__mapDeps([457,4,1,3,8,9,6,7,10,11,12])));return{default:e}}),LKe=A.memo(({children:e,result:t,webResultCitation:n,timestampComponent:r,trackEvent:s,linkProps:o,onYouTubeClick:a,onAttachmentClick:i,asChild:c=!1})=>{const{openModal:u}=Uo(),f=d.useCallback(p=>{p.preventDefault(),p.stopPropagation(),u(OKe,{result:t,webResultCitation:n,timestampComponent:r,trackEvent:s,linkProps:o,onYouTubeClick:a,onAttachmentClick:i,legacyIdentifier:"__NONE__"})},[u,t,n,r,s,o,a,i]),m=c?zU:"span";return l.jsx(m,{onClick:f,children:e})});LKe.displayName="CitationBottomSheet";const aN=A.memo(({webResults:e,compact:t=!1})=>{if(!d.useMemo(()=>(Array.isArray(e)?e:[e]).some(o=>tg(o)),[e])||Array.isArray(e))return null;const r=l.jsx(yt,{href:"https://www.lens.org",target:"_blank",rel:"noopener",className:"hover:text-super",children:"Lens.org"});return l.jsx(V,{variant:"tinyRegular",color:"light",children:t?l.jsxs(l.Fragment,{children:["· ",r]}):l.jsxs(l.Fragment,{children:["Patent Data by ",r]})})});aN.displayName="CitationAttribution";const iN=A.memo(function(t){const{className:n,children:r,result:s,trackEvent:o,...a}=t,i=z("group flex size-full cursor-pointer items-stretch",n);return T4(s)?l.jsx(yt,{target:"_blank",rel:"noopener",className:i,href:s.url,...a,children:l.jsx("div",{className:"w-full",children:r})}):l.jsx(l.Fragment,{children:r})});iN.displayName="CitationCardLink";const lN=A.memo(({variant:e="medium",searchType:t})=>{const n=t==="memory",s=z("flex items-center justify-between w-full",e==="small"?"mb-0":"mb-2");return l.jsxs("div",{className:s,children:[l.jsxs(V,{className:"flex items-center gap-2",variant:"tiny",color:"light",children:[l.jsx(ge,{icon:n?B("bubble-text"):B("list-search"),size:"sm"}),n?l.jsx(je,{defaultMessage:"Memory",id:"dVx3yznM2C"}):l.jsx(je,{defaultMessage:"Library",id:"StcK672jB9"})]}),l.jsx(V,{variant:"tiny",color:"ultraLight",children:l.jsx(ge,{icon:B("user-search"),size:"sm"})})]})});lN.displayName="MemorySearchCitationCardTitle";const Lre=A.memo(({className:e})=>l.jsx("div",{className:e,children:l.jsxs(V,{variant:"micro",color:"light",className:"text-pretty",children:[l.jsx(je,{defaultMessage:"This answer uses premium data sources. You're receiving complimentary access through your Perplexity subscription.",id:"u+XPNB2p9O"})," ",l.jsx(qh,{href:"https://www.perplexity.ai/help-center/en/articles/12870803-premium-data-sources",target:"_blank",variant:"inline",muted:!0,children:l.jsx(je,{defaultMessage:"Learn more",id:"TdTXXf940t"})})]})}));Lre.displayName="PremiumSourceFooter";const FKe=e=>{const t=e.meta_data?.connection_type,n=typeof e.meta_data?.citation_domain_name=="string"?e.meta_data.citation_domain_name:void 0,r=t==="WILEY",s=t||e.is_memory||e.is_conversation_history?e.name:void 0;return n??(r?"Wiley":s)},Fi=e=>{if(!e)return!1;const t=typeof e.meta_data?.wiley_book_uuid=="string"&&e.meta_data?.wiley_book_uuid!=="",n=typeof e.meta_data?.is_premium_datasource=="boolean"&&e.meta_data?.is_premium_datasource===!0;return t||n},Gg=e=>{if(!e)return{source_type:"unknown",is_premium:!1};const t=Fi(e),n=FKe(e);let r="web";return e.is_attachment?r="attachment":e.is_image?r="image":e.is_memory?r="memory":e.is_conversation_history?r="conversation_history":e.is_knowledge_card?r="knowledge_card":e.is_navigational?r="navigational":e.is_code_interpreter?r="code_interpreter":e.meta_data?.connection_type?r=String(e.meta_data.connection_type).toLowerCase():t&&(r="premium_datasource"),{source_name:n,source_type:r,is_premium:t}},Vw="text-foreground text-left hover:text-super focus:text-super leading-snug transition-color line-clamp-2 cursor-pointer font-sans text-sm font-medium duration-quick",cN=A.memo(({result:e,webResultCitation:t,timestampComponent:n,trackEvent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,isFile:i=e.is_attachment??!1,downloadable:c=!1,isYouTubeVideo:u=!!(e.url&&Ji(e.url))})=>{const f=e?.is_conversation_history??!1,m=e?.is_memory??!1,p=f||m,h=Wg(e),g=Ire(e),y=g||p&&!h?null:e.meta_data?.generated_file_title??e.name,x=t?.cited_texts??[],v=e.meta_data?.generated_file_description??e.snippet,b=e.meta_data?.authors,_=Fi(e),w=M4(e),S=typeof e.meta_data?.citation_domain_name=="string"?e.meta_data?.citation_domain_name:void 0,C=T4(e),E=e.url||h;return l.jsxs("div",{className:"gap-1 flex flex-col min-w-[200px]",children:[p&&!h?l.jsx(lN,{variant:"medium",searchType:m?"memory":"conversation-history"}):l.jsxs("div",{className:"gap-sm flex flex-col",children:[(E||n)&&l.jsxs("div",{className:"flex items-center justify-between",children:[E&&l.jsx(ya,{className:"text-right",variant:"tinyRegular",color:"light",url:e.url,isAttachment:i,source:S,connectionType:e.meta_data?.connection_type,mcpServerSource:e.meta_data?.mcp_server,patentName:w,truncate:!1}),l.jsxs("div",{className:"flex items-center gap-2",children:[n,l.jsx(aN,{webResults:e,compact:!!n})]}),_?l.jsx(Mh,{}):null]}),u?l.jsx("button",{className:Vw,onClick:o,children:y}):c?l.jsx("button",{className:Vw,onClick:a,children:y}):C?l.jsx(iN,{className:Vw,result:e,trackEvent:r,...s,children:y}):l.jsx("span",{className:"text-foreground mb-xs line-clamp-2 text-left font-sans text-sm",children:y})]}),b?l.jsx(V,{variant:"small",className:"line-clamp-3",children:b.join(", ")}):null,g?l.jsx(V,{variant:"small",color:"light",children:l.jsx(je,{defaultMessage:"This is a private source.",id:"jKReyt0qq8",description:"Text shown when a source is private and obfuscated"})}):null,y!==e.name&&!m&&!g?l.jsx(V,{variant:"small",color:"light",children:e.name}):null,x.length>0?l.jsx("ul",{children:x.map((T,k)=>l.jsx("li",{className:"border-b last:border-b-0",children:l.jsx(V,{variant:"small",className:"line-clamp-[20] italic",children:T})},k))}):v&&l.jsx(V,{variant:"small",color:"light",className:"line-clamp-4 whitespace-pre-wrap",children:v}),h&&!g?l.jsxs(K,{className:"gap-xs pt-sm mt-sm flex items-center border-t",children:[l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B("user-scan")})}),l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(je,{defaultMessage:"Personal Search",id:"7+aLCEyqS2",description:"title"})})]}):null,_&&l.jsx(Lre,{className:"pt-2"})]})});cN.displayName="CitationContent";var Hw={exports:{}},zw,zP;function BKe(){if(zP)return zw;zP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return zw=e,zw}var Ww,WP;function UKe(){if(WP)return Ww;WP=1;var e=BKe();function t(){}function n(){}return n.resetWarningCache=t,Ww=function(){function r(a,i,c,u,f,m){if(m!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ww}var GP;function uN(){return GP||(GP=1,Hw.exports=UKe()()),Hw.exports}var VKe=uN();const ze=uo(VKe);var Gw,$P;function HKe(){return $P||($P=1,Gw=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[s]))return!1;for(s=r;s--!==0;){var a=o[s];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}),Gw}var zKe=HKe();const WKe=uo(zKe);var s1={exports:{}},$w,qP;function GKe(){if(qP)return $w;qP=1;var e;return e=function(){var t={},n={};return t.on=function(r,s){var o={name:r,handler:s};return n[r]=n[r]||[],n[r].unshift(o),o},t.off=function(r){var s=n[r.name].indexOf(r);s!==-1&&n[r.name].splice(s,1)},t.trigger=function(r,s){var o=n[r],a;if(o)for(a=o.length;a--;)o[a].handler(s)},t},$w=e,$w}var o1={exports:{}},qw,KP;function $Ke(){if(KP)return qw;KP=1,qw=function(s,o,a){var i=document.head||document.getElementsByTagName("head")[0],c=document.createElement("script");typeof o=="function"&&(a=o,o={}),o=o||{},a=a||function(){},c.type=o.type||"text/javascript",c.charset=o.charset||"utf8",c.async="async"in o?!!o.async:!0,c.src=s,o.attrs&&e(c,o.attrs),o.text&&(c.text=""+o.text);var u="onload"in c?t:n;u(c,a),c.onload||t(c,a),i.appendChild(c)};function e(r,s){for(var o in s)r.setAttribute(o,s[o])}function t(r,s){r.onload=function(){this.onerror=this.onload=null,s(null,r)},r.onerror=function(){this.onerror=this.onload=null,s(new Error("Failed to load "+this.src),r)}}function n(r,s){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,s(null,r))}}return qw}var YP;function qKe(){return YP||(YP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=$Ke(),r=s(n);function s(o){return o&&o.__esModule?o:{default:o}}t.default=function(o){var a=new Promise(function(i){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){i(window.YT);return}else{var c=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(c+"//www.youtube.com/iframe_api",function(f){f&&o.trigger("error",f)})}var u=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){u&&u(),i(window.YT)}});return a},e.exports=t.default})(o1,o1.exports)),o1.exports}var a1={exports:{}},i1={exports:{}},l1={exports:{}},Kw,QP;function KKe(){if(QP)return Kw;QP=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*365.25;Kw=function(u,f){f=f||{};var m=typeof u;if(m==="string"&&u.length>0)return o(u);if(m==="number"&&isNaN(u)===!1)return f.long?i(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var f=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(f){var m=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return m*s;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function a(u){return u>=r?Math.round(u/r)+"d":u>=n?Math.round(u/n)+"h":u>=t?Math.round(u/t)+"m":u>=e?Math.round(u/e)+"s":u+"ms"}function i(u){return c(u,r,"day")||c(u,n,"hour")||c(u,t,"minute")||c(u,e,"second")||u+" ms"}function c(u,f,m){if(!(u=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(u){try{return JSON.stringify(u)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}};function s(u){var f=this.useColors;if(u[0]=(f?"%c":"")+this.namespace+(f?" %c":" ")+u[0]+(f?"%c ":" ")+"+"+t.humanize(this.diff),!!f){var m="color: "+this.color;u.splice(1,0,m,"color: inherit");var p=0,h=0;u[0].replace(/%[a-zA-Z%]/g,function(g){g!=="%%"&&(p++,g==="%c"&&(h=p))}),u.splice(h,0,m)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(u){try{u==null?t.storage.removeItem("debug"):t.storage.debug=u}catch{}}function i(){var u;try{u=t.storage.debug}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}t.enable(i());function c(){try{return window.localStorage}catch{}}})(i1,i1.exports)),i1.exports}var c1={exports:{}},JP;function XKe(){return JP||(JP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],e.exports=t.default})(c1,c1.exports)),c1.exports}var u1={exports:{}},eO;function ZKe(){return eO||(eO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],e.exports=t.default})(u1,u1.exports)),u1.exports}var d1={exports:{}},f1={exports:{}},tO;function JKe(){return tO||(tO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},e.exports=t.default})(f1,f1.exports)),f1.exports}var nO;function eYe(){return nO||(nO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=JKe(),r=s(n);function s(o){return o&&o.__esModule?o:{default:o}}t.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},e.exports=t.default})(d1,d1.exports)),d1.exports}var rO;function tYe(){return rO||(rO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=QKe(),r=f(n),s=XKe(),o=f(s),a=ZKe(),i=f(a),c=eYe(),u=f(c);function f(h){return h&&h.__esModule?h:{default:h}}var m=(0,r.default)("youtube-player"),p={};p.proxyEvents=function(h){var g={},y=function(E){var T="on"+E.slice(0,1).toUpperCase()+E.slice(1);g[T]=function(k){m('event "%s"',T,k),h.trigger(E,k)}},x=!0,v=!1,b=void 0;try{for(var _=i.default[Symbol.iterator](),w;!(x=(w=_.next()).done);x=!0){var S=w.value;y(S)}}catch(C){v=!0,b=C}finally{try{!x&&_.return&&_.return()}finally{if(v)throw b}}return g},p.promisifyPlayer=function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y={},x=function(T){g&&u.default[T]?y[T]=function(){for(var k=arguments.length,I=Array(k),M=0;M1&&arguments[1]!==void 0?arguments[1]:{},h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,g=(0,s.default)();if(f||(f=(0,a.default)(g)),p.events)throw new Error("Event handlers cannot be overwritten.");if(typeof m=="string"&&!document.getElementById(m))throw new Error('Element "'+m+'" does not exist.');p.events=c.default.proxyEvents(g);var y=new Promise(function(v){if((typeof m>"u"?"undefined":n(m))==="object"&&m.playVideo instanceof Function){var b=m;v(b)}else f.then(function(_){var w=new _.Player(m,p);return g.on("ready",function(){v(w)}),null})}),x=c.default.promisifyPlayer(y,h);return x.on=g.on,x.off=g.off,x},e.exports=t.default})(s1,s1.exports)),s1.exports}var rYe=nYe();const sYe=uo(rYe);var oYe=Object.defineProperty,aYe=Object.defineProperties,iYe=Object.getOwnPropertyDescriptors,oO=Object.getOwnPropertySymbols,lYe=Object.prototype.hasOwnProperty,cYe=Object.prototype.propertyIsEnumerable,aO=(e,t,n)=>t in e?oYe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fk=(e,t)=>{for(var n in t||(t={}))lYe.call(t,n)&&aO(e,n,t[n]);if(oO)for(var n of oO(t))cYe.call(t,n)&&aO(e,n,t[n]);return e},mk=(e,t)=>aYe(e,iYe(t)),uYe=(e,t,n)=>new Promise((r,s)=>{var o=c=>{try{i(n.next(c))}catch(u){s(u)}},a=c=>{try{i(n.throw(c))}catch(u){s(u)}},i=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,a);i((n=n.apply(e,t)).next())});function dYe(e,t){var n,r;if(e.videoId!==t.videoId)return!0;const s=((n=e.opts)==null?void 0:n.playerVars)||{},o=((r=t.opts)==null?void 0:r.playerVars)||{};return s.start!==o.start||s.end!==o.end}function iO(e={}){return mk(fk({},e),{height:0,width:0,playerVars:mk(fk({},e.playerVars),{autoplay:0,start:0,end:0})})}function fYe(e,t){return e.videoId!==t.videoId||!WKe(iO(e.opts),iO(t.opts))}function mYe(e,t){var n,r,s,o;return e.id!==t.id||e.className!==t.className||((n=e.opts)==null?void 0:n.width)!==((r=t.opts)==null?void 0:r.width)||((s=e.opts)==null?void 0:s.height)!==((o=t.opts)==null?void 0:o.height)||e.iframeClassName!==t.iframeClassName||e.title!==t.title}var pYe={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},hYe={videoId:ze.string,id:ze.string,className:ze.string,iframeClassName:ze.string,style:ze.object,title:ze.string,loading:ze.oneOf(["lazy","eager"]),opts:ze.objectOf(ze.any),onReady:ze.func,onError:ze.func,onPlay:ze.func,onPause:ze.func,onEnd:ze.func,onStateChange:ze.func,onPlaybackRateChange:ze.func,onPlaybackQualityChange:ze.func},Sy=class extends A.Component{constructor(e){super(e),this.destroyPlayerPromise=void 0,this.onPlayerReady=t=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,t)},this.onPlayerError=t=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,t)},this.onPlayerStateChange=t=>{var n,r,s,o,a,i,c,u;switch((r=(n=this.props).onStateChange)==null||r.call(n,t),t.data){case Sy.PlayerState.ENDED:(o=(s=this.props).onEnd)==null||o.call(s,t);break;case Sy.PlayerState.PLAYING:(i=(a=this.props).onPlay)==null||i.call(a,t);break;case Sy.PlayerState.PAUSED:(u=(c=this.props).onPause)==null||u.call(c,t);break}},this.onPlayerPlaybackRateChange=t=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,t)},this.onPlayerPlaybackQualityChange=t=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,t)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const t=mk(fk({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=sYe(this.container,t),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var t;(t=this.internalPlayer)==null||t.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var t,n,r,s;if(typeof this.props.videoId>"u"||this.props.videoId===null){(t=this.internalPlayer)==null||t.stopVideo();return}let o=!1;const a={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(o=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(a.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(a.endSeconds=this.props.opts.playerVars.end)),o){(r=this.internalPlayer)==null||r.loadVideoById(a);return}(s=this.internalPlayer)==null||s.cueVideoById(a)},this.refContainer=t=>{this.container=t},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(e){return uYe(this,null,function*(){mYe(e,this.props)&&this.updatePlayer(),fYe(e,this.props)&&(yield this.resetPlayer()),dYe(e,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return A.createElement("div",{className:this.props.className,style:this.props.style},A.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},xb=Sy;xb.propTypes=hYe;xb.defaultProps=pYe;xb.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var lO=xb;const cO={fadeIn:{opacity:1},fadeOut:{opacity:0}},gYe={width:"100%",height:"100%",playerVars:{autoplay:1,color:"white",playsinline:1}},$g=A.memo(e=>{const{isOpen:t,name:n,setisOpen:r,url:s}=e,o=s?Ji(s):void 0,a=d.useRef(void 0),[i,c]=d.useState(!1),u=d.useCallback(p=>{a.current=p.target,c(!0)},[a]),f=d.useCallback(p=>{if(a.current)switch(p.key){case" ":{a.current.getPlayerState()===lO.PlayerState.PLAYING?a.current.pauseVideo():a.current.playVideo();break}case"ArrowRight":{a.current.seekTo(a.current.getCurrentTime()+5,!0);break}case"ArrowLeft":{a.current.seekTo(a.current.getCurrentTime()-5,!0);break}}},[a]);d.useEffect(()=>(t?window.addEventListener("keydown",f):window.removeEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}),[f,t]);const m=d.useCallback(p=>{r(p)},[r]);return o?l.jsx(cA,{open:t,onOpenChange:m,children:l.jsx(ST,{className:"z-10",asChild:!0,children:l.jsxs(Te.div,{className:"bg-backdrop dark fixed inset-0 flex items-center justify-center backdrop-blur-md",initial:"fadeOut",animate:"fadeIn",exit:"fadeOut",variants:cO,transition:{duration:.2},children:[l.jsx(L$,{asChild:!0,children:l.jsx(Ge,{extraCSS:"!fixed top-md right-md shadow-sm",icon:B("x"),pill:!0,size:"small",variant:"common"})}),l.jsxs(ET,{className:"grid outline-none","aria-describedby":void 0,children:[l.jsx(FU,{children:l.jsx(O$,{children:n})}),l.jsxs(St,{children:[!i&&l.jsx(Te.div,{className:"grid place-items-center [grid-area:1/-1]",initial:"fadeOut",animate:"fadeIn",exit:"fadeOut",transition:{duration:.2},variants:cO,children:l.jsx(Gl,{size:24})},"youtube-player-loading"),l.jsx(Te.div,{className:z("aspect-video overflow-hidden rounded-2xl shadow-lg [grid-area:1/-1] *:size-full","w-[calc(100dvw-(2*var(--size-md)))] sm:w-[75vw]"),initial:{opacity:0},animate:{opacity:i?1:0},transition:{duration:.2},children:l.jsx(lO,{onReady:u,opts:gYe,title:n,videoId:o})},"youtube-player-content")]})]})]},"youtube-player-overlay")})}):null});$g.displayName="YoutubeVideoPlayer";const df=A.memo(({hideHoverCard:e=!1,children:t,linkProps:n,result:r,webResultCitation:s,timestampComponent:o,trackEvent:a,getAttachmentUrl:i,onOpened:c,scrollContainerRef:u,triggerClassName:f})=>{const{isMobileStyle:m}=Re(),[p,h]=d.useState(!1),[g,y]=d.useState(!1),[x,v]=d.useState(null),b=Uf(r),{onWheel:_}=Ore({scrollContainerRef:u,enabled:!0}),w=r.is_attachment??!1,S=Yl(r),C=kr(r.url),E=d.useCallback(async()=>{if(!i||b)return;const $=await i(r.url);C&&(v($),y(!0),h(!1))},[i,r.url,C,b]),T=r.meta_data?.generated_file_title??r.name,k=d.useRef(!1),[I,M]=d.useState(!1),N=!!(r.url&&Ji(r.url));d.useEffect(()=>{if(typeof window>"u")return;function $(){k.current=!1}return document.addEventListener("visibilitychange",$),()=>{window.removeEventListener("visibilitychange",$)}},[]);const D=d.useCallback(()=>y(!1),[]),j=d.useCallback(()=>{M(!0),h(!1)},[]),F=d.useMemo(()=>({src:x??void 0}),[x]),R=d.useCallback($=>{!$&&k.current||(h(e?!1:$),$&&c?.())},[e,c]),P=d.useCallback(()=>{k.current=!0},[]),L=d.useCallback(()=>{h(!1),k.current=!1},[]),U=d.useCallback(()=>{k.current=!1},[]),O=d.useMemo(()=>l.jsx("span",{className:z("inline-flex",f),"aria-label":T,onPointerEnter:P,onClick:L,onPointerLeave:U,children:t}),[t,T,P,L,U,f]);return l.jsxs(l.Fragment,{children:[N&&r.url&&l.jsx($g,{isOpen:I,name:T,setisOpen:M,url:r.url}),C&&x&&l.jsx(pu,{isOpen:g,onClose:D,imgProps:F}),l.jsx(Fl,{interaction:"hover",open:p,onOpenChange:R,openDelayMs:200,closeDelayMs:200,side:"bottom",align:"start",triggerElement:O,maxWidthPx:320,onWheelContent:_,children:l.jsx("div",{className:"p-xs",children:l.jsx(cN,{result:r,webResultCitation:s,timestampComponent:o,trackEvent:a,linkProps:n,onYouTubeClick:j,onAttachmentClick:E,isFile:w,downloadable:S,isYouTubeVideo:N})})})]})}),yYe=({webResults:e,citationGroup:t,onCitationClick:n,openMemorySearchHistoryModal:r,onYouTubeClick:s,onAttachmentClick:o,forceExternalHandler:a,getAttachmentUrl:i,trackEvent:c,onClose:u})=>{const f=J(),m=d.useMemo(()=>[...e].sort((x,v)=>{const b=Fi(x),_=Fi(v);return b&&!_?-1:!b&&_?1:0}),[e]),p=d.useMemo(()=>e.every(x=>x.is_conversation_history),[e]),h=d.useMemo(()=>e.some(x=>Fi(x)),[e]),g=d.useMemo(()=>{if(p)return f.formatMessage({defaultMessage:"Library",id:"StcK672jB9"});switch(t.category){case"memory":return f.formatMessage({defaultMessage:"Memory",id:"dVx3yznM2C"});case"attachment":return f.formatMessage({defaultMessage:"Attachments",id:"Vlx13nOMtX"});case"youtube":return f.formatMessage({defaultMessage:"YouTube",id:"zuA3BgDC6u"});default:return f.formatMessage({defaultMessage:"{count, plural, one {# source} other {# sources}}",id:"WrpI57Uej/"},{count:t.totalCount??e?.length})}},[t.category,p,f,t.totalCount,e.length]),y=d.useCallback(x=>async v=>{if(x.is_conversation_history||x.is_memory)if(v.preventDefault(),u?.(),n){n(x,v);return}else if(r){r(x);return}else{console.warn("Memory/conversation history modal handler not provided");return}if((x.url?Ji(x.url):null)&&s){v.preventDefault(),s(x),u?.();return}const _=x.is_attachment||!1,w=kr(x.url);if(_&&w&&o){v.preventDefault(),o(x),u?.();return}if(dA()&&n){v.preventDefault(),u?.(),n(x,v);return}if(_&&Yl(x)&&i){v.preventDefault();const S=await i(x.url);window.open(S,"_blank");return}if(c&&x.url){const S=Gg(x);c("click citation",{source:"grouped_citation",citation_url:x.url,...S})}if(a&&n){n(x,v);return}T4(x)&&(v.preventDefault(),window.open(x.url,"_blank")),v.preventDefault()},[n,r,c,i,a,u,s,o]);return d.useMemo(()=>({sortedWebResults:m,headerText:g,hasPremiumSource:h,handleCitationClick:y}),[m,g,h,y])};df.displayName="CitationHoverCard";const pd=A.memo(({result:e,onClick:t,visualStyle:n,showName:r,className:s})=>{const o=un(),a=eg(e.url),i=lW(e,a),c=oN(),u=Pre(),f=d.useCallback(()=>{(e.is_memory||e.is_conversation_history)&&c(e)},[c,e]),m=d.useCallback(p=>{if(e.is_conversation_history||e.is_memory){p.preventDefault(),f();return}if(e.is_attachment||e.is_memory)return p.preventDefault();if(u){aV({adapter:o,event:p,reason:"search-result-step",url:e.url,tabId:e.tab_id});return}Dx(p)&&(p.preventDefault(),o.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")})),t?.(e.url)},[o,t,e.is_attachment,e.is_memory,e.tab_id,e.url,f,e.is_conversation_history,u]);return l.jsx(yt,{className:z("inline-block max-w-full",s),href:e.url,target:"_blank",rel:"noopener nofollow",onClick:m,children:l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs rounded-lg pl-1.5 pr-2.5",children:l.jsx(ya,{variant:"tinyRegular",className:n==="closedTab"?"!line-through":void 0,url:e.url,name:r?e.name:void 0,isAttachment:e.is_attachment,connectionType:a,source:i,isMemory:e.is_memory,isConversationHistory:e.is_conversation_history})})})});pd.displayName="SearchResultBubble";const xYe=A.memo(({onClick:e,webResults:t,initialDisplayCount:n=12,stepDelay:r,isFinished:s=!1})=>{const o=d.useMemo(()=>t.map(a=>l.jsx(Fre,{result:a,onClick:e},a.url)),[e,t]);return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(Zf,{items:o,initialDisplayCount:n,stepDelay:r,isFinished:s})})});xYe.displayName="SearchResultsStep";const Fre=A.memo(({result:e,onClick:t})=>{const n=un(),r=d.useMemo(()=>({onClick(s){Dx(s)&&(s.preventDefault(),n.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")}))}}),[n,e.tab_id,e.url]);return l.jsx(df,{result:e,linkProps:r,children:l.jsx(pd,{result:e,onClick:t})},e.url)});Fre.displayName="CitationHoverCardFactory";const vYe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i;function Bre(e){return typeof e!="string"?!1:vYe.test(e)}function Yw({label:e,chips:t,onAdd:n,onDelete:r,children:s,placeholder:o,onDraftChange:a,contactSuggestions:i,renderContactSuggestion:c}){return l.jsxs("div",{className:"border-subtlest pl-md pr-sm flex min-h-10 flex-1 items-center border-b p-0",children:[l.jsx(V,{variant:"small",color:"light",className:"w-10 min-w-[32px] select-none",children:e}),l.jsx("div",{className:"flex-1",children:l.jsx(V6,{chips:t,onAdd:n,onDelete:r,placeholder:o,validator:Bre,placeholderOnFocusOnly:!0,onDraftChange:a,suggestions:i,renderSuggestion:c})}),s]})}function bYe(e,t){const r=t.get(e)?.display_name?.trim();return r||e}function Qw(e,t){return e.map(n=>({label:bYe(n,t),value:n}))}const _Ye=A.memo(function({email:t,onChange:n,onSend:r,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a,disableEditContents:i}){const c=d.useMemo(()=>t?.to??[],[t?.to]),u=d.useMemo(()=>t?.cc??[],[t?.cc]),f=d.useMemo(()=>t?.bcc??[],[t?.bcc]),[m,p]=d.useState(u.length>0),[h,g]=d.useState(f.length>0),{isMobileUserAgent:y}=Re(),x=()=>{(!u||u.length===0)&&(!f||f.length===0)&&(p(!1),g(!1))},{$t:v}=J(),b={to:v({defaultMessage:"To",id:"9j3hXO4Ojb"}),cc:v({defaultMessage:"Cc",id:"J1CYkLdqdy"}),bcc:v({defaultMessage:"Bcc",id:"qLl3P2UOlZ"}),addRecipient:v({defaultMessage:"Add recipient",id:"o2g2HQVmtC"}),subject:v({defaultMessage:"Subject",id:"LLtKhppiyE"}),writeMessage:v({defaultMessage:"Write your message...",id:"yoP6t+NY/q"})},_=d.useCallback(D=>({onAdd:(R,P)=>{const L=t?.[D]??[],U=R.filter(O=>Bre(O)&&!L.includes(O));if(U.length>0){const O=t?.contacts?[...t.contacts]:[];if(P&&P.length>0){const $=P.filter(G=>!O.some(H=>H.email===G.email)).map(G=>({email:G.email,display_name:G.name,photo_url:G.image||void 0}));O.push(...$)}n({...t,[D]:[...L,...U],contacts:O})}},onDelete:R=>{const P=t?.[D]??[];n({...t,[D]:P.filter(L=>!R.includes(L))})}}),[t,n]),w=d.useMemo(()=>new Map((t?.contacts??[]).filter(D=>D.email).map(D=>[D.email,D])),[t?.contacts]),S=d.useMemo(()=>Qw(c,w),[c,w]),C=d.useMemo(()=>Qw(u,w),[u,w]),E=d.useMemo(()=>Qw(f,w),[f,w]),T=_("to"),k=_("cc"),I=_("bcc"),M=d.useCallback(D=>n({...t,subject:D}),[t,n]),N=d.useCallback(D=>n({...t,body:D.target.value}),[t,n]);return l.jsxs("div",{className:"dark:bg-subtler flex w-full flex-col",children:[l.jsx(Yw,{label:b.to,chips:S,onAdd:T.onAdd,onDelete:T.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a,children:l.jsxs("div",{className:"gap-two ml-2 flex",children:[!m&&l.jsx("button",{type:"button",className:"hover:bg-subtler text-quiet rounded-lg px-2 py-1 font-sans text-sm",onClick:()=>p(!0),children:b.cc}),!h&&l.jsx("button",{type:"button",className:"hover:bg-subtler text-quiet rounded-lg px-2 py-1 font-sans text-sm",onClick:()=>g(!0),children:b.bcc})]})}),m&&l.jsx(Yw,{label:b.cc,chips:C,onAdd:k.onAdd,onDelete:k.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a}),h&&l.jsx(Yw,{label:b.bcc,chips:E,onAdd:I.onAdd,onDelete:I.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a}),!i&&l.jsx(co,{isMobileUserAgent:y,name:"subject-input",type:"text",value:t?.subject,onChange:M,placeholder:b.subject,className:"border-subtlest text-foreground !px-md !py-sm min-h-10 w-full !rounded-none border-0 border-b !bg-transparent focus:outline-none focus:!ring-0","aria-label":b.subject}),!i&&l.jsx("textarea",{name:"body",value:t?.body,onChange:N,placeholder:b.writeMessage,rows:8,className:"text-foreground placeholder:text-quieter p-md min-h-[180px] w-full resize-none border-0 bg-transparent font-sans text-sm shadow-none focus:outline-none focus:ring-0","aria-label":b.writeMessage,onFocus:x})]})}),Ure=A.memo(({emailAction:e,sendStepResult:t,isFinished:n})=>{const r="send-email-step",[s,o]=d.useState(n??!1),{suggestions:a,handleDraftChange:i}=Aee({reason:"email_compose"}),c=d.useMemo(()=>{if(e?.send)return e.send.email;if(e?.forward)return{to:e.forward.to,cc:e.forward.cc,bcc:e.forward.bcc,contacts:e.forward.contacts}},[e]),[u,f]=d.useState(c),{$t:m}=J(),p=d.useMemo(()=>!!(u?.to&&u.to.length===0),[u]),h=d.useMemo(()=>m({defaultMessage:"Send",id:"9WRlF4R2gm"}),[m]),[g,y]=d.useState(""),[x,v]=d.useState(!1),b=d.useCallback(()=>{o(!0),t({confirmed:!1},r,!1)},[t,r]),_=d.useCallback((I,M)=>{!I&&(!M||!M.trim())||(o(!0),t({confirmed:I,...M&&{user_input:M.trim()},...u&&{email:u}},r,!1),!I&&M&&(v(!1),y("")))},[t,r,u]),w=d.useCallback(()=>_(!0),[_]),S=d.useCallback(()=>_(!1,g),[_,g]),C=d.useCallback(I=>{Ls.isEnterKeyWithoutShift(I)&&(I.preventDefault(),S())},[S]),E=d.useCallback(()=>{v(!1),y("")},[]),T=d.useCallback(I=>{I.preventDefault(),v(!0)},[]),k=d.useCallback(I=>l.jsx(Tee,{contact:I}),[]);return s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:m({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsxs(K,{variant:"raised",className:"rounded-lg border",children:[u&&l.jsx(K,{children:l.jsx(_Ye,{email:u,onChange:f,onDraftChange:i,contactSuggestions:a,renderContactSuggestion:k,disableEditContents:!!e?.forward})}),x&&l.jsxs("form",{onSubmit:S,children:[l.jsx(K,{className:"px-md py-sm gap-4 border-t",children:l.jsx(hu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:m({defaultMessage:"What would you like to change about this email?",id:"lrZrku1OFD"}),value:g,onChange:y,onKeyDown:C,minRows:3,className:"mt-sm !pl-3",autoFocus:!0})}),l.jsxs("div",{className:"gap-sm p-md pt-sm flex items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:m({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit"}),l.jsx(st,{variant:"negative",size:"small",text:m({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:E})]}),l.jsx(st,{size:"small",text:m({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:b})]})]}),!x&&l.jsx("form",{onSubmit:w,children:l.jsxs("div",{className:"gap-sm p-md flex items-center justify-between border-t",children:[l.jsxs("div",{className:"gap-sm flex",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:h,type:"submit",disabled:p}),l.jsx(Ge,{size:"small",variant:"common",text:m({defaultMessage:"Refine email",id:"xTUBb7cWyO"}),onClick:T})]}),l.jsx(st,{size:"small",text:m({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:b})]})})]})});Ure.displayName="SendEmailStep";const wYe=({result:e})=>{const{$t:t}=J();return e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),size:14,className:"shrink-0 text-[#16a34a]",title:"Confirmed"}),l.jsx("span",{className:"text-xs font-medium leading-none text-[#16a34a] dark:text-[#4ade80]",children:t({defaultMessage:"Task confirmed",id:"oLLCmoruP6"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:t({defaultMessage:"Task skipped",id:"uMaJWuUUvD"})})]}):null},Vre=A.memo(({sendStepResult:e,taskAction:t,stepUUID:n,isFinished:r=!1})=>{const{$t:s}=J(),{session:o}=Ne(),{trackEvent:a}=Xe(o),i="router",c=d.useMemo(()=>{const S=t.expiry_date?new Date(t.expiry_date):void 0;return{trigger:{type:Ze.SCHEDULED,schedule:SYe(t.schedule),expiryDate:S},query:{prompt:t.prompt||"",searchModel:t.model_preference||ie.DEFAULT},status:"ACTIVE",notificationSettings:Kl}},[t]),[u,f]=d.useState(y4(c??g4())),[m,p]=d.useState(null),[h,g]=d.useState(null),y="task_operation";d.useEffect(()=>{t&&!r&&a("task modal opened",{source:i})},[t,r,a,i]),Z.error("TaskOperationStep rendered",{stepUUID:n,hasTaskAction:!!t,isFinished:r,taskAction:t,taskActionType:typeof t,taskActionKeys:t?Object.keys(t):[],source:i});const x=d.useMemo(()=>s({defaultMessage:"Create Task",id:"4+iiEILSrA"}),[s]),v=d.useCallback(S=>{p(S),S.confirmed?(a("task modal action",{source:i,action:"created"}),e({confirmed:!0,task_action:S.task_action},y,!1)):(a("task modal action",{source:i,action:"deleted"}),e({confirmed:!1},y,!1))},[e,y,i,a]),b=d.useCallback(()=>{v({confirmed:!1})},[v]),_=d.useCallback(()=>{const S={task_name:u.query?.prompt||"Untitled Task",prompt:u.query?.prompt,model_preference:u.query?.searchModel||ie.DEFAULT,schedule:u.trigger.type===Ze.SCHEDULED?CYe(u.trigger.schedule):void 0,expiry_date:t.expiry_date};v({confirmed:!0,task_action:S})},[u,v,t.expiry_date]),w=d.useCallback(S=>{f(S)},[]);return t?r?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:s({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsxs("div",{className:"bg-subtler border-subtlest transform overflow-hidden rounded-xl border transition-transform duration-200",children:[l.jsxs("div",{className:"bg-subtler border-subtler flex items-center justify-between border-b px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:l.jsx(ut,{name:B("clock"),size:16,className:"text-quiet"})}),l.jsx("h3",{className:"text-foreground text-sm font-medium",children:x})]}),l.jsx(wYe,{result:m})]}),l.jsx("div",{className:"bg-base p-4",children:l.jsx(Wc,{children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(mb,{configuration:u,onConfigurationChange:w,canEditSpace:!1}),h&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:h})]}),l.jsx(xre,{onSkip:b,onConfirm:_,disabled:r,result:m})]})})})]}):(Z.error("TaskOperationStep received null/undefined taskAction - will not render",{stepUUID:n,taskAction:t,isFinished:r,source:i}),null)});Vre.displayName="TaskOperationStep";function CYe(e){const t=`${e.hour.toString().padStart(2,"0")}:${e.minute.toString().padStart(2,"0")}`;switch(e.kind){case"ONCE":return{one_time:{datetime:new Date(e.year,e.month,e.day,e.hour,e.minute).toISOString()}};case"DAILY":return{daily:{time:t}};case"WEEKLY":return{weekly:{time:t,day_of_week:(e.dayOfWeek+6)%7}};case"MONTHLY":return{monthly:{time:t,day_of_month:e.day}};case"YEARLY":return{yearly:{time:t,day_of_month:e.day,month_of_year:e.month+1}};case"WEEKDAYS":return{weekdays:{time:t}};default:return{daily:{time:t}}}}function SYe(e){if(!e)return Gr();if(e.one_time){const t=e.one_time.datetime;if(!t)return Gr();const n=new Date(t);return{kind:"ONCE",minute:n.getMinutes(),hour:n.getHours(),day:n.getDate(),month:n.getMonth(),year:n.getFullYear(),dayOfWeek:n.getDay()}}else if(e.daily){const t=e.daily.time;if(!t)return Gr();const[n="",r=""]=t.split(":"),s=parseInt(n,10),o=parseInt(r,10);if(isNaN(s)||isNaN(o))return Gr();const a=new Date;return{kind:"DAILY",minute:o,hour:s,day:a.getDate(),month:a.getMonth(),year:a.getFullYear(),dayOfWeek:a.getDay()}}else if(e.weekly){const t=e.weekly.time,n=e.weekly.day_of_week;if(!t||n==null)return Gr();const[r="",s=""]=t.split(":"),o=parseInt(r,10),a=parseInt(s,10);if(isNaN(o)||isNaN(a))return Gr();const i=(n+1)%7,c=new Date;return{kind:"WEEKLY",minute:a,hour:o,day:c.getDate(),month:c.getMonth(),year:c.getFullYear(),dayOfWeek:i}}else if(e.monthly){const t=e.monthly.time,n=e.monthly.day_of_month;if(!t||n==null)return Gr();const[r="",s=""]=t.split(":"),o=parseInt(r,10),a=parseInt(s,10);if(isNaN(o)||isNaN(a))return Gr();const i=new Date;return{kind:"MONTHLY",minute:a,hour:o,day:n,month:i.getMonth(),year:i.getFullYear(),dayOfWeek:i.getDay()}}else if(e.yearly){const t=e.yearly.time,n=e.yearly.month_of_year,r=e.yearly.day_of_month;if(!t||n==null||r==null)return Gr();const[s="",o=""]=t.split(":"),a=parseInt(s,10),i=parseInt(o,10);if(isNaN(a)||isNaN(i))return Gr();const c=new Date;return{kind:"YEARLY",minute:i,hour:a,day:r,month:n-1,year:c.getFullYear(),dayOfWeek:c.getDay()}}else if(e.weekdays){const t=e.weekdays.time;if(!t)return Gr();const[n="",r=""]=t.split(":"),s=parseInt(n,10),o=parseInt(r,10);if(isNaN(s)||isNaN(o))return Gr();const a=new Date;return{kind:"WEEKDAYS",minute:o,hour:s,day:a.getDate(),month:a.getMonth(),year:a.getFullYear(),dayOfWeek:a.getDay()}}return Gr()}const pk=A.memo(({question:e,sendStepResult:t,isFinished:n})=>{const r="user-clarification-step",[s,o]=d.useState(n??!1),[a,i]=d.useState(""),{$t:c}=J(),u=d.useCallback(()=>{o(!0),t({confirmed:!1,user_input:a.length>0?a:"The user chose to confirm with the information provided"},r,!1)},[a,t]),f=d.useCallback(()=>{o(!0),t({confirmed:!1},r,!1)},[t]),m=d.useCallback(p=>{Ls.isEnterKeyWithoutShift(p)&&(p.preventDefault(),u())},[u]);return s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:c({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsx(K,{variant:"raised",className:"py-sm rounded-lg border",children:l.jsxs("form",{onSubmit:u,children:[e&&l.jsxs("div",{className:"px-md pt-sm",children:[l.jsx(V,{variant:"small",children:e}),l.jsx("div",{className:"gap-sm mt-3 flex items-center",children:l.jsx("div",{className:"grow",children:l.jsx(hu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:c({defaultMessage:"Add details…",id:"GTIJ9uAEMf"}),value:a,onChange:i,onKeyDown:m,minRows:3,className:"!pl-3",autoFocus:!0})})})]}),l.jsxs("div",{className:"gap-sm px-md py-sm mt-4 flex items-center",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:c({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit"}),l.jsx(st,{size:"small",text:c({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:f})]})]})})});pk.displayName="UserClarificationStep";const Hre=A.memo(({step:e,action:t})=>{const{final:n,file_name:r,sheet_count:s,row_count:o}=e.content,a=!n;let i=t;return r&&n&&(i=r,s!=null?(i+=` (${s} sheets`,o!=null&&(i+=`, ${o} rows`),i+=")"):o!=null&&(i+=` (${o} rows)`)),l.jsx(Ge,{text:t,icon:B("file-spreadsheet"),isLoading:a,size:"tiny",pill:!0,toolTip:i,tooltipLayout:"top"})});Hre.displayName="XlsxStep";const EYe=60,zre=A.memo(({questions:e,toolUuid:t,autoSkipSeconds:n=EYe,isFinished:r=!1,entryUuid:s})=>{const o=d.useRef(null),[a,i]=d.useState(0),[c,u]=d.useState(!1),[f,m]=d.useState(!1),p=d.useRef(!1),{$t:h}=J(),{session:g}=Ne(),{trackEvent:y,trackEventOnce:x}=Xe(g),[v,b]=d.useState(new Map),{mutate:_,isPending:w}=uBe(),S=n*1e3;d.useEffect(()=>{e.forEach(M=>{M.question_text&&x("clarifying question input viewed",{entry_uuid:s,clarifying_question:M.question_text})})},[e,s,x]);const C=d.useCallback(()=>e.map(M=>({question:M.question_text,answer:v.get(M.question_text??"")??""})),[e,v]),E=d.useCallback(M=>{if(p.current)return;p.current=!0,C().forEach(D=>{D.answer&&y("clarifying question answer submitted",{entry_uuid:s,answer:D.answer})}),M==="USER_SUBMITTED"?u(!0):m(!0),o.current&&clearInterval(o.current),_({answers:C(),toolUuid:t,submitType:M})},[t,C,_,s,y]),T=d.useCallback(()=>{const M=Array.from(v.values()).some(N=>N.trim()!=="");E(M?"USER_SUBMITTED":"TIMEOUT")},[E,v]),k=d.useCallback((M,N)=>{b(D=>{const j=new Map(D);return j.set(M,N),j}),i(-1),o.current&&clearInterval(o.current)},[]);d.useEffect(()=>{a>=S&&!p.current&&E("TIMEOUT")},[a,S,E]);const I=w||c||f||r;return e.length===0?null:c?l.jsx(Wre,{questionCount:e.length}):f?l.jsx(Gre,{questionCount:e.length}):l.jsxs(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:[l.jsxs("div",{className:"flex flex-row justify-between items-start",children:[l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("circle-arrow-up"),size:"sm"}),h({defaultMessage:"Get a better answer",id:"bdUER2dpcm"})]}),w?l.jsx("div",{className:"inline-flex text-quieter h-8 items-start ",children:l.jsx(Gl,{})}):l.jsx($re,{isSubmitting:I,onClick:T,skipProgress:a,setSkipProgress:i,skipDurationMs:S,interval:o})]}),l.jsx("div",{className:"flex flex-col divide-y",children:e.map(M=>l.jsx(Kre,{questionText:M.question_text??"",options:M.options??[],isDisabled:I,onAnswerChange:k},M.question_text))})]})}),Wre=A.memo(({questionCount:e})=>{const{$t:t}=J();return l.jsx(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("circle-check"),size:"sm"}),t(e===1?{defaultMessage:"Answer submitted",id:"nhijhP95Wa"}:{defaultMessage:"Answers submitted",id:"slMbotVCdl"})]})})});Wre.displayName="SubmittedBanner";const Gre=A.memo(({questionCount:e})=>{const{$t:t}=J();return l.jsx(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("player-track-next"),size:"sm"}),t(e===1?{defaultMessage:"Question skipped",id:"TXA0/vEkkm"}:{defaultMessage:"Questions skipped",id:"y2UvuAr/nW"})]})})});Gre.displayName="SkippedBanner";const $re=A.memo(({isSubmitting:e,onClick:t,skipProgress:n,setSkipProgress:r,skipDurationMs:s,interval:o})=>{d.useEffect(()=>(o.current=setInterval(()=>{r(u=>Math.min(u+100,s))},100),()=>{o.current&&clearInterval(o.current)}),[o,r,s]);const{$t:a}=J(),i=d.useMemo(()=>{const u=Math.ceil((s-n)/1e3);return e?a({defaultMessage:"Working...",id:"H6RqOb/hea"}):n<0?a({defaultMessage:"Continue",id:"acrOozm08x"}):a({defaultMessage:"Continue ({seconds})",id:"q9N0Gjq72e"},{seconds:u})},[n,e,s,a]),c=d.useMemo(()=>({width:`${n/s*100}%`}),[n,s]);return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"pointer-events-none relative opacity-0",children:l.jsx(wt,{variant:"text",size:"small",onClick:t,disabled:e,children:n<0?a({defaultMessage:"Continue",id:"acrOozm08x"}):a({defaultMessage:"Continue (99)",id:"JLwyORtPZa"})})}),l.jsx("div",{className:"absolute inset-0",children:l.jsx(wt,{variant:n<0?"primary":"text",size:"small",onClick:t,disabled:e,fullWidth:!0,children:i})})]}),l.jsxs("div",{className:z("grid grid-cols-1 grid-rows-1 rounded-lg overflow-hidden absolute inset-0 duration-normal pointer-events-none",e||n<0?"opacity-0":""),children:[l.jsx(K,{className:"bg-subtle col-start-1 row-start-1 h-full",variant:"subtle"}),l.jsx(K,{className:"opacity-5 col-start-1 row-start-1 h-full w-1/2 rounded-inherit duration-linear duration-100",variant:"textColor",style:c})]})]})});$re.displayName="SkipButton";const qre=A.memo(({text:e,isSelected:t,isDisabled:n,onClick:r})=>{const s=d.useCallback(()=>{r(e)},[e,r]);return l.jsx("div",{className:z(t?"[&_button]:bg-inverse":"","inline-flex"),children:l.jsx(wt,{variant:t?"primary":"tonal",size:"tiny",disabled:n,onClick:s,children:e})})});qre.displayName="AnswerButton";const Kre=A.memo(({questionText:e,options:t,isDisabled:n,onAnswerChange:r})=>{const[s,o]=d.useState(null),[a,i]=d.useState(!1),[c,u]=d.useState(""),{$t:f}=J(),m=d.useCallback(y=>{o(y),i(!1),r(e,y)},[e,r]),p=d.useCallback(()=>{i(!0),o(null),r(e,"")},[e,r]),h=d.useCallback(y=>{u(y),r(e,y)},[e,r]),g=d.useCallback(()=>{i(!1),u(""),r(e,"")},[e,r]);return l.jsxs("div",{className:"flex flex-col gap-y-sm py-md first:pt-0 last:pb-0",children:[l.jsx(V,{variant:"small",children:e}),a?l.jsxs("div",{className:"gap-x-sm flex flex-row items-center",children:[l.jsx(co,{value:c,onChange:h,placeholder:f({defaultMessage:"Enter your response",id:"NdOK6MxPTM"}),isMobileUserAgent:!1,size:"sm",wrapperClassName:"w-full",className:"h-8",disabled:n}),l.jsx(wt,{size:"small",onClick:g,icon:B("x"),"aria-label":f({defaultMessage:"Back",id:"cyR7KhiuaU"}),variant:"text",disabled:n})]}):l.jsxs("div",{className:"gap-sm flex flex-row flex-wrap",children:[t.map(y=>l.jsx(qre,{text:y,isSelected:s===y,isDisabled:n,onClick:m},y)),l.jsx("div",{className:"inline-flex",children:l.jsx(wt,{variant:"tonal",size:"tiny",onClick:p,disabled:n,children:f({defaultMessage:"Other",id:"/VnDMl81rh"})})})]})]})});Kre.displayName="ClarifyingQuestionRow";zre.displayName="ClarifyingQuestionBanner";const kYe=e=>e.toLowerCase().replace(/_/g," ").replace(/^\w/,t=>t.toUpperCase()),MYe={FINANCE:"FINANCE"},TYe={STOCK_PRICE_MOVEMENT:"STOCK_PRICE_MOVEMENT"};function Gn(e,t,n){return{...t,title:n,actionKey:e}}function AYe(e){const t=[];let n=0;for(;n({...t,originalEndIndex:n}))}function RYe(e){const{step:t,isStudio:n,isFinished:r,onStepClick:s,stepDelay:o,showAllNestedSteps:a,isNested:i,disableAnimations:c,isMissionControl:u,hasAnswer:f,$t:m,getActionMessage:p,translations:h,assetsContent:g,sendStepResult:y,stepCount:x,setStepCount:v,taskComputerActions:b,allSteps:_,setShouldShowSkipButtonOverride:w,shouldShowSourceSkipButton:S,entryResult:C,enabledSources:E,shouldHideScreenshotsInSidecar:T,StepRendererComponent:k}=e;switch(t.step_type){case"SEARCH_WEB":{const M=t.content.queries??[],D=M.length>0&&M.every(j=>j.engine==="image")?"search_images":"search";return Gn(D,{content:l.jsx(gs,{queries:M.map(j=>j.query),stepDelay:n?2:void 0,isFinished:r})},p(D))}case"SEARCH_RESULTS":{let N=function(j){return j.length===0?"reviewing_sources":j.every(F=>F.is_memory)?M.length===1?"reviewing_memory":"reviewing_memories":j.every(F=>F.is_conversation_history)?"reviewing_conversation_history":M.length===1?"reviewing_source":"reviewing_sources"};const M=t.content.web_results,D=N(M);return Gn(D,{count:M.length>1?x:void 0,content:M.length===0?l.jsx(Rr,{icon:B("zoom-out"),text:m({defaultMessage:"No sources found",id:"yWSiuEkfbY"})}):NU(M)?l.jsx(pd,{result:M[0],showName:!0,onClick:s}):l.jsx(pl,{onClick:s,results:M,stepDelay:n?2:void 0,isFinished:r,onCountChange:v})},p(D))}case"ENTROPY_REQUEST":return{content:l.jsx(Eee,{step:t,isFinished:r??!1,isMissionControl:u??!1})};case"CODE":return{content:!g&&l.jsx(hne,{action:p("working"),step:t})};case"PDF":return{content:!g&&l.jsx(jne,{action:p("creating_pdf"),step:t})};case"DOCX":return{content:!g&&l.jsx(xne,{action:p("creating_docx"),step:t})};case"XLSX":return{content:!g&&l.jsx(Hre,{action:p("creating_xlsx"),step:t})};case"CREATE_APP_RESULT":return{content:null};case"CREATE_CLIENT_APP":return{title:p("building_app"),content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.caption})};case"CREATE_CHART":return{title:p("creating_chart"),content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.caption})};case"GET_URL_CONTENT":{const M=t.content.pages,N=M.length>1?"getting_sources":"getting_source";return Gn(N,{count:M.length>1?x:void 0,content:M.length===0?l.jsx(Rr,{icon:B("zoom-out-area"),text:m({defaultMessage:"No content found",id:"JlMgLJz0nd"})}):l.jsx("div",{className:"flex flex-wrap gap-2",children:M.map((D,j)=>l.jsx(pd,{result:{name:"",snippet:"",is_attachment:!1,url:D.url},showName:!1,onClick:s},D.url||j))})},p(N))}case"CLARIFYING_QUESTIONS_OUTPUT":return t.content.clarification?{content:l.jsx(Rte,{step:t})}:null;case"IN_CONTEXT_SUGGESTIONS_OUTPUT":return t.content.selected_suggestion?{content:l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsx(Rr,{icon:B("bulb"),text:t.content.selected_suggestion})})}:null;case"THOUGHT":return Gn("thinking",{content:l.jsx(K,{variant:"subtler",className:"py-xs inline-block rounded-lg px-2.5",children:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.thought})})},p("thinking"));case"URL_NAVIGATE":return Gn("navigate",{content:l.jsx(gs,{queries:t.content.urls})},p("navigate"));case"BROWSER_OPEN_TAB_RESULTS":return Gn("opening_tab",{content:l.jsx(pd,{result:{name:t.content.tab.title,url:t.content.tab.url,snippet:"",is_attachment:!1,is_client_context:!0,tab_id:t.content.tab.id},showName:!0,onClick:s})},p("opening_tab"));case"BROWSER_CLOSE_TABS_RESULTS":{const M=t.content.tabs;return Gn("closing_tabs",{content:M.length===0?l.jsx(gs,{queries:[h.failedClosedTabs],icon:B("cancel")}):l.jsx(pl,{results:M.map(N=>({name:N.title,url:N.url,snippet:"",is_attachment:!1})),textClassName:N=>{const D="url"in N&&N.url,j="name"in N&&N.name;return D||j?"opacity-65 line-through":""}})},p("closing_tabs"))}case"READ_GMAIL":case"READ_EMAIL":{const M=t.content.queries?.length?t.content.queries:[h.allEmail];return Gn("searching_gmail",{content:l.jsx(gs,{queries:M,icon:B("mail-search")})},p("searching_gmail"))}case"READ_GMAIL_RESPONSE":case"READ_EMAIL_RESPONSE":{const M=t.content;return M?.authenticated&&M?.count>0?Gn("reading_emails",{content:M.results?l.jsx(pl,{results:M.results,resultType:"email",onClick:s,stepDelay:o,isFinished:r,maxHeight:400}):null},p("reading_emails")):{title:M?.authenticated?h.emailsFound(0):h.gmailNotAuthenticated,content:null}}case"READ_CALENDAR":return Gn("searching_calendar",{content:l.jsx(gs,{queries:t.content.queries??[],icon:B("user-scan")})},p("searching_calendar"));case"READ_CALENDAR_RESPONSE":return t.content.authenticated&&(t.content.count??0)>0?Gn("reading_events",{content:t.content.results?l.jsx(pl,{results:t.content.results,resultType:"calendar",onClick:s,stepDelay:o,isFinished:r,maxHeight:400}):null},p("reading_events")):{title:t.content.authenticated?h.eventsFound(0):h.googleCalendarNotAuthenticated,content:null};case"UPDATE_CALENDAR":return Gn("scheduling",{isFinished:!0,content:t.content?.clarification?l.jsx(pk,{isFinished:!1,question:t.content.clarification,sendStepResult:y}):t.content?.operations?l.jsx(Tte,{isFinished:!1,calendarOperations:t.content.operations,sendStepResult:y}):null},p("scheduling"));case"UPDATE_CALENDAR_RESPONSE":return Gn("scheduling",{isFinished:!0,content:(()=>{const M=t.content?.operations;return!M||M.length===0?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:m({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsx(Ate,{operations:M})})()},p("scheduling"));case"CREATE_TASKS":{const N=t.content?.task_action;if(!N)return null;if(N.event_group===MYe.FINANCE&&N.event_type&&N.event_entity){const D={ticker_symbol:N.event_entity,target_price:N.target_price,current_price:N.current_price,...N.event_type===TYe.STOCK_PRICE_MOVEMENT&&{movement_percent:X0(N.upper_bound)?N.upper_bound:X0(N.lower_bound)?Math.abs(N.lower_bound):void 0,positive_direction:X0(N.upper_bound),negative_direction:X0(N.lower_bound)}};return{title:m({defaultMessage:"Setting up price alert",id:"JGiR4/dpaV"}),isFinished:!0,content:l.jsx(Tre,{taskAction:N,priceAlertData:D,stepUUID:t.uuid??"",isFinished:r,sendStepResult:y})}}return{title:p("scheduling"),isFinished:!0,content:l.jsx(Vre,{taskAction:N,stepUUID:t.uuid??"",isFinished:r,sendStepResult:y})}}case"CREATE_TASKS_RESPONSE":return{title:p("scheduled"),isFinished:!0,content:l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:"Done"})};case"SEND_GMAIL":case"SEND_EMAIL":return f?null:{title:p("emailing"),content:t.content?.clarification?l.jsx(pk,{isFinished:!1,question:t.content.clarification,sendStepResult:y}):t.content?l.jsx(Ure,{isFinished:!1,emailAction:t.content.action,sendStepResult:y}):null};case"SEND_GMAIL_RESPONSE":case"SEND_EMAIL_RESPONSE":return{title:p("emailing"),isFinished:!0,content:l.jsx(vne,{status:t.content?.status})};case"EMAIL_CALENDAR_AGENT_RESPONSE":case"GMAIL_GCAL_AGENT_RESPONSE":return{title:t.content.authenticated?void 0:h.gmailNotAuthenticated,content:null};case"EMAIL_CALENDAR_AGENT":case"GMAIL_GCAL_AGENT":{const M=AYe(t.content.steps??[]),N=a?M:M.slice(-1);return{content:l.jsx(l.Fragment,{children:N.map(D=>{const j={step_type:D.step_type||"EMAIL_CALENDAR_AGENT",content:D.step_type==="GET_FREEBUSY"&&D.get_free_busy_response_content?{...D.get_free_busy_content,...D.get_free_busy_response_content}:D.get_free_busy_content??D.get_user_info_content??D.get_user_info_response_content??D.send_email_content??D.update_calendar_content??D.update_calendar_response_content??D.send_email_response_content??D.get_free_busy_response_content??D.read_calendar_content??D.read_calendar_response_content??D.read_email_content??D.read_email_response_content??{},uuid:D.uuid||"",assets:void 0},F=a?r||D.originalEndIndex<(t.content.steps?.length??0)-1:r;return l.jsx(k,{step:j,isFinished:F,isNested:i,onStepClick:s,showAllNestedSteps:a,disableAnimations:c},D.uuid)})})}}case"FLIGHTS_SEARCH":{const M=t.content;if(!M)return null;const N=M.found_flights,D=N&&N.length>0,j=M.submitted;return{title:p("searching_flights"),isFinished:D,content:D&&!j?l.jsx(Bne,{stepUUID:t.uuid??"",goalId:M.goal_id??"",foundFlights:M.found_flights,isSubmitted:j??!1,outboundDate:M.outbound_date,returnDate:M.return_date,flightType:M.flight_type}):null}}case"FLIGHTS_SEARCH_RESPONSE":{const{selected_flight:M,submitted:N}=t.content??{},D=p("looking_for_booking_options"),j=M?.flights?.map(H=>H.airline).filter(Boolean).join(", ")||"",F=M?.flights?.[0]?.departure_airport?.id||"",R=M?.flights?.[M.flights.length-1]?.arrival_airport?.id||"",P=M?.total_duration||0,L=Math.floor(P/60),U=P%60,O=L>0?`${L}h ${U}min`:`${U}min`;let $=F;if(M?.flights&&M.flights.length>1)for(let H=1;H ").pop()&&($+=` -> ${Q}`)}$+=` -> ${R}`;const G=`${j} (${$}): ${O}`;return N&&M?{title:D,isFinished:r||f,content:l.jsx(gs,{queries:[G],icon:B("plane-inflight")})}:null}case"FLIGHTS_BOOKING":{const M=t.content;if(!M)return null;const N=M.found_booking_options,D=N&&N.length>0,j=M.submitted;return{title:p("reviewing_booking_options"),isFinished:D,content:D?l.jsx(Lne,{stepUUID:t.uuid??"",goalId:M.goal_id??"",foundBookingOptions:M.found_booking_options,isSubmitted:j??!1}):null}}case"FLIGHTS_BOOKING_RESPONSE":{const{selected_booking_options:M,submitted:N}=t.content??{},D=p("redirecting_to_booking");return N&&M?{title:D,isFinished:r||f,content:(()=>{const j=F=>{const R=[];return F.together?.book_with?R.push(F.together.book_with):(F.departing?.book_with&&R.push(`Departing: ${F.departing.book_with}`),F.returning?.book_with&&R.push(`Returning: ${F.returning.book_with}`)),R.join(" | ")||"Booking options"};return l.jsx(gs,{queries:[j(M)],icon:B("brand-booking")})})()}:null}case"FLIGHTS_AGENT":{const M=NYe(t.content.steps??[]),N=a?M:M.slice(-1);return{content:l.jsx(l.Fragment,{children:N.map(D=>{const j={step_type:D.step_type||"FLIGHTS_AGENT",content:D.browser_open_tab_content??D.browser_open_tab_results_content??D.flights_search_content??D.flights_booking_content??D.flights_search_response_content??D.flights_booking_response_content??{},uuid:D.uuid||"",assets:void 0},F=a?r||D.originalEndIndex<(t.content.steps?.length??0)-1:r;return l.jsx(k,{step:j,isFinished:F,isNested:i,onStepClick:s,showAllNestedSteps:a,disableAnimations:c},D.uuid)})})}}case"TERMINATE":return Gn("conclusion",{content:t.content.reason?l.jsx(K,{variant:"subtler",className:"py-xs inline-block rounded-lg px-2.5",children:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.reason})}):null},p("conclusion"));case"CANVAS_AGENT":{const M=t.content.asset_types??[],N={CODE_FILE:"a file",PDF_FILE:"a PDF",DOCX_FILE:"a document",XLSX_FILE:"a spreadsheet",APP:"an app",SLIDES:"slides"};return{content:l.jsx(Nte,{assetTypes:M,assetTypeLabels:N,isFinished:r})}}case"GENERATE_IMAGE":{const M=t.content.success;return{title:p("generating_images"),content:l.jsx(wne,{prompt:t.content.prompt,success:M})}}case"GENERATE_VIDEO":return Gn("generating_images",{content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.prompt})},p("generating_images"));case"GENERATE_VIDEO_RESULTS":return Gn("presenting_images",{content:!g&&l.jsx(bne,{urls:t.content.video_results.map(M=>M.url??""),onClick:s})},p("presenting_images"));case"BROWSER_GROUP_TABS":return Gn("grouping_tabs",{content:t.content.payloads?.length>0?l.jsx("div",{className:"gap-sm flex flex-row flex-wrap",children:t.content.payloads.map((M,N)=>l.jsx(JE,{color:M.color,title:M.title??""},N))}):null},p("grouping_tabs"));case"BROWSER_GROUP_TABS_RESULTS":return{content:t.content.success?null:l.jsx(Rr,{icon:B("cancel"),text:h.couldNotFinish})};case"BROWSER_UNGROUP":return{title:p("ungrouping_tabs"),content:t.content.payload?.groups_metadata&&t.content.payload.groups_metadata.length>0?(()=>{const M=t.content.payload.groups_metadata.map((N,D)=>({name:N.title||`Group ${D+1}`,url:"",source:N.title||`Group ${D+1}`}));return M.length===1?l.jsx(gs,{queries:t.content.payload.groups_metadata.map(N=>N.title||"Unnamed Group"),initialDisplayCount:3,icon:B("folders")}):l.jsx(pl,{results:M,icon:B("folders"),textClassName:"opacity-65 line-through decoration-subtle"})})():null};case"BROWSER_SEARCH_TAB_GROUPS":return{title:p("searching_tab_groups"),content:l.jsx(gs,{queries:t.content.payload?.queries?.length?t.content.payload.queries:[h.allTabGroups],icon:B("user-scan")})};case"BROWSER_SEARCH_TAB_GROUPS_RESULT":return{title:p("reading"),content:t.content.results.length>0?l.jsx("div",{className:"gap-sm flex flex-row flex-wrap",children:t.content.results.map((M,N)=>l.jsx(JE,{color:M.color,title:M.title??""},N))}):null};case"GET_USER_INFO":{const M=t.content;if(!M||!M.names)return null;const N=M.found_users,D=N&&N.length>0,j=M.submitted,F=D&&!j?"found_contacts":"getting_user_info";return Gn(F,{content:D&&!j?l.jsx(One,{goalId:M.goal_id??"",foundUsers:M.found_users,names:M.names,sendStepResult:y}):l.jsx(gs,{queries:M.names,icon:B("user-search")})},p(F))}case"GET_USER_INFO_RESPONSE":{const{submitted:M,selected_users:N}=t.content??{},D=N?.some(F=>F.selected===!0),j=D?"selecting_contacts":"getting_contact_details";return M&&N?Gn(j,{content:N.length===0?l.jsx(gs,{queries:[p("no_contacts_found")],icon:B("address-book-off")}):N.length===1?l.jsx(gs,{queries:N.map(F=>`${F.display_name||""} ${F.email_address?`(${F.email_address})`:""}`.trim()),icon:B("address-book")}):l.jsx(pl,{results:N.map(F=>({...F,url:F.email_address?`mailto:${F.email_address}`:void 0})),icon:B("address-book"),resultType:"userinfo",textClassName:F=>{const R="email_address"in F?F.email_address:void 0,P=N?.find(L=>L.email_address===R);return D&&P?.selected===!1?"opacity-65 line-through decoration-subtle":""}})},p(j)):null}case"GET_FREEBUSY":{const M=t.content;return{title:p("getting_freebusy"),content:(()=>{const N=M.free_busy_response?.available_periods?.length??0;let D,j;return!M.authenticated&&r?(D=h.googleCalendarNotAuthenticated,j=B("calendar-off")):N===0&&r?(D=h.noAvailabilityFound,j=B("calendar-off")):N>0&&(D=h.availableTimesFound(N),j=B("calendar-week")),D?l.jsx(Rr,{text:D,icon:j}):null})()}}case"GET_FREEBUSY_RESPONSE":return{title:p("getting_freebusy"),content:(()=>{const M=t.content.free_busy_response?.available_periods?.length??0;let N,D;return!t.content.authenticated&&r?(N=h.googleCalendarNotAuthenticated,D=B("calendar-off")):M===0&&r?(N=h.noAvailabilityFound,D=B("calendar-off")):M>0&&(N=h.availableTimesFound(M),D=B("calendar-week")),N?l.jsx(Rr,{text:N,icon:D}):null})()};case"PENDING_FILES":return{content:l.jsx(Ine,{attachments:t.content.attachments,attachmentProcessingProgress:t.content.attachmentProcessingProgress})};case"SEARCH_BROWSER":{const M=t.content.queries?.filter(D=>D!=null&&D.trim()!=="")||[],N=M.length>0?M:t.content.browser_content_sources?.map(D=>D in Ri?p(D):kYe(D))||[];return{title:p("searching_browser"),content:l.jsx(gs,{queries:N,isFinished:r})}}case"SEARCH_BROWSER_RESULTS":return Gn("reading_browser",{count:x,content:(()=>{const{open_tabs:M,recently_closed_tabs:N,history:D}=t.content,j=(M?.length||0)+(N?.length||0)+(D?.length||0);if(j===0)return l.jsx(Rr,{icon:B("zoom-out"),text:m({defaultMessage:"No sources found",id:"yWSiuEkfbY"})});if(j===1){const R=M?.[0]||N?.[0]||D?.[0];return l.jsx(pd,{result:{...R},showName:!0,onClick:s})}const F=[];return M&&M.length>0&&F.push(...M.map(R=>({...R,category:"open_tab"}))),N&&N.length>0&&F.push(...N.map(R=>({...R,category:"closed_tab"}))),D&&D.length>0&&F.push(...D.map(R=>({...R,category:"history"}))),l.jsx(pl,{onClick:s,results:F,groupBy:"category",stepDelay:n?2:void 0,isFinished:r,onCountChange:v})})()},p("reading_browser"));case"MCP_TOOL_INPUT":{const M=t.content,N=M.source_type;if("authenticated"in M&&(M.authenticated===void 0||M.authenticated===null))return null;let D=m({id:"bTDpQ+Tk24",defaultMessage:"external service"});M.mcp_server_type==="MCP_SERVER_TYPE_LOCAL"?D=m({id:"0asQ8snMnq",defaultMessage:"local MCP"}):M?.app&&(D=M.app);const j=M.request_user_approval?.uuid;return Gn("MCP_TOOL",{content:l.jsxs(l.Fragment,{children:[l.jsx(Nne,{step:t,isFinished:r,onActionTaken:()=>w(!1)}),S&&l.jsx("div",{className:"mt-2",children:l.jsx(dee,{entryUUID:C?.backend_uuid??"",sourceType:N,sourceName:D,userApprovalUuid:j,onSkipSourceClicked:()=>w(!0),isAutoDetected:N?!E.includes(N):!1})})]})},p("MCP_TOOL",{appName:D}))}case"MCP_TOOL_OUTPUT":{const M=t.content;return Gn("MCP_TOOL",{content:l.jsx(Dne,{content:M.content||"",shouldRerunQuery:!!M.should_rerun_query})},p("MCP_TOOL"))}case"RESEARCH_CLARIFYING_QUESTIONS":{const M=t.content.questions||[],N=t.content.auto_skip_seconds;return{content:l.jsx(zre,{questions:M,toolUuid:t.content.uuid||t.uuid,autoSkipSeconds:N,isFinished:r,entryUuid:C?.backend_uuid})}}case"COMET_AGENT_TOOL_INPUT":{const M=t.content.tool_input;if(M?.todo_write){const P=_?.findIndex($=>$.uuid===t.uuid)??-1,U=_?.some(($,G)=>G>=P?!1:$?.step_type==="COMET_AGENT_TOOL_INPUT"&&"tool_input"in $.content&&$.content.tool_input?.todo_write)??!1?"updating_todo_list":"creating_todo_list",O=M.todo_write.todos||[];return{actionKey:U,content:l.jsxs(l.Fragment,{children:[l.jsx(Di,{action:U,isFinished:r,className:"mb-two",showAnimation:c}),l.jsx(iee,{todos:O})]})}}else if(M?.subagent_tool_inputs){const P="running_sub_tasks";return{actionKey:P,content:l.jsxs(l.Fragment,{children:[l.jsx(Di,{action:P,isFinished:r,className:"mb-two",showAnimation:c}),l.jsx(nBe,{tool_input_content:t.content})]})}}const N=P=>{let L;return P?.action=="type"&&P.text?L=`: ${ny(P.text,35)}`:P?.action=="key"?L=`: ${P.text}`:P?.action=="wait"&&(L=P.duration===1?` ${P.duration} second`:` ${P.duration} seconds`),L},D=M?.computer_list?.actions;if(D&&D.length>0){const P=M?.computer_list?.uuid,L=b[P??""]??[],U=r?D:L,O=U[U.length-1]?.action,$=O&&O in Ri?O:"working";return Gn($,{content:l.jsx(l.Fragment,{children:U.map((G,H)=>{const Q=G.action,Y=Q&&Q in Ri?Q:"working",te=N(G),se=H===U.length-1;return l.jsx(Di,{title:te,action:Y,isFinished:r||!se,className:"-my-1.5",showAnimation:c},H)})})})}const j=M?.computer?M.computer.action:Object.entries(M??{}).find(([P,L])=>L)?.[0],F=j&&j in Ri?j:"working";let R;return M?.navigate?.url?M.navigate.url==="forward"||M.navigate.url==="back"?R=` ${M.navigate.url}`:R=` to ${ny(M.navigate.url,35)}`:M?.find&&M.find.query?R=`: ${ny(M.find.query,35)}`:M?.computer?R=N(M.computer):M?.bash?M.bash.description?R=`${M.bash.description}`:R="Running a command":M?.file_read?R=` ${M.file_read.file_name}`:M?.file_write?R=` ${M.file_write.file_name}`:M?.file_edit&&(R=` ${M.file_edit.file_name}`),j?Gn(F,{content:l.jsx(Di,{action:F,title:R,isFinished:r,className:"-my-1.5",showAnimation:c})}):null}case"COMET_AGENT_TOOL_OUTPUT":{const M=t.content.tool_output,N=M?.computer?.screenshot_uuid||M?.tabs_create?.screenshot_uuid||M?.navigate?.screenshot_uuid||M?.form_input?.screenshot_uuid,D=M?.computer?.screenshots||M?.tabs_create?.screenshots||M?.navigate?.screenshots||M?.form_input?.screenshots;return T?null:{content:l.jsx(yne,{isFinished:r,screenshot_uuid:N,screenshots:D})}}default:return null}}const DYe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"hide-screenshots-in-sidecar",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function jYe(e){const{action:t,streamId:n,inFlight:r}=e,s=Do();d.useEffect(()=>{if(!s||!n||!t||!r)return;const o=new CustomEvent("comet-agent-step-update",{detail:{stepAction:t,streamId:n}});document.dispatchEvent(o)},[t,s,n,r])}const dN=e=>{const{searchMode:t,hasAnswer:n,result:r,inFlight:s,skippedSources:o,steps:a}=It(),i=t===oe.STUDIO,{taskComputerActions:c}=Qn(),{$t:u}=J(),{step:f,onStepClick:m,isFinished:p,stepDelay:h,motionProps:g,isNested:y=!1,showAllNestedSteps:x=!0,isMissionControl:v=!1,disableAnimations:b=!1}=e,[_,w]=d.useState(void 0),[S,C]=d.useState(void 0),E=f.step_type==="MCP_TOOL_INPUT"?f.content.source_type:void 0,T=Array.from(r?.sources?.sources??[]),k=JFe({sourceType:E,skippedSources:new Set(o)}),{variation:I}=DYe(!1),M=f.step_type==="MCP_TOOL_INPUT"?f.content.app:void 0,N=A.useMemo(()=>S!==void 0?S:k&&!p&&!!r?.backend_uuid&&f.step_type==="MCP_TOOL_INPUT"&&!!M,[S,k,p,r?.backend_uuid,f.step_type,M]),D=d.useCallback(async(ce,ue)=>{f.uuid&&await Qp({contextUUID:r?.context_uuid,stepUUID:f.uuid,result:ce,reason:ue})},[f.uuid,r]),j=d.useCallback(async()=>{await D({confirmed:!0},"thread-upsell-accepted")},[D]),F=d.useCallback(async()=>{await D({confirmed:!1},"thread-upsell-dismissed")},[D]),R=(ce,ue)=>{const me=Ri[ce]?.message;return me?ue?u(me,ue):u(me):""},P=tBe(),L=f.assets&&f.assets.length>0?l.jsx("div",{className:"gap-sm my-sm flex flex-row flex-wrap",children:f.assets.map(ce=>l.jsx(gne,{asset:ce},ce.uuid))}):null,U=f.step_type,O=f.content.should_show_upsell??!1,$=f.content.upsell_information,G=l.jsx(Jd,{position:"router_steps",upsellInformation:$,inFlight:!p,stepUUID:f.uuid,backendUuid:$?.backend_uuid,isLastResult:!0,onAccept:j,onReject:F}),H=RYe({step:f,isStudio:i,isFinished:p,onStepClick:m,stepDelay:h,showAllNestedSteps:x,isNested:y,disableAnimations:b,isMissionControl:v,hasAnswer:n,$t:u,getActionMessage:R,translations:P,assetsContent:L,sendStepResult:D,stepCount:_,setStepCount:w,taskComputerActions:c,allSteps:a,setShouldShowSkipButtonOverride:C,shouldShowSourceSkipButton:N,entryResult:r,enabledSources:T,shouldHideScreenshotsInSidecar:I,StepRendererComponent:dN});if(jYe({action:H?.actionKey,streamId:r?.uuid,inFlight:s}),!H)return v?l.jsx(Di,{title:R("working"),showAnimation:b,className:"mt-sm"}):null;const{title:Q,content:Y,count:te,isFinished:se}=H,ae=O&&$?!0:se??p??!1,X={key:f.uuid,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"mt-1.5 empty:hidden"},ee={...X,...g,className:g?.className?`${X.className} ${g.className}`:X.className},{key:le,...re}=ee;return l.jsxs(Te.div,{...re,children:[Q&&l.jsx(Di,{title:Q,isFinished:ae,className:"mb-two",count:te,showAnimation:b}),!Q&&v&&!ae&&U!=="ENTROPY_REQUEST"&&l.jsx(Di,{title:R("working"),showAnimation:b,className:"mb-two"}),O&&$?G:Y,L]},le)};dN.displayName="StepRenderer";const IYe={xs:7,sm:9,md:11,lg:15},Yre=A.memo(({state:e,className:t,size:n="md",showFinishedIcon:r=!0})=>{const s=IYe[n],o={width:s,height:s,backfaceVisibility:"hidden"},a=d.useMemo(()=>({height:`calc(100% - ${s/3}px)`}),[s]);return e==="hidden"?null:l.jsxs("div",{className:z({relative:!t?.includes("absolute")&&!t?.includes("relative")},t),children:[l.jsx("div",{className:z("shrink-0 rounded-full border",{"bg-base border-subtler":e==="planned","bg-inverse/25 dark:bg-inverse/20 flex border-transparent":e==="finished","border-super bg-super":e==="loading"}),style:o,children:e==="finished"&&r&&l.jsx("div",{className:"relative flex size-full bg-transparent transition-opacity ease-linear",children:l.jsx(ge,{icon:B("check"),className:"text-inverse w-full place-self-center",stroke:4,style:a})})}),e==="loading"&&l.jsx("div",{className:"border-super absolute left-0 top-0 animate-ping rounded-full border-2 opacity-75",style:o})]})});Yre.displayName="StatusDot";const Qre=A.memo(({status:e,state:t,showStatus:n,timelineConnectorClassName:r,hasSteps:s,isFinalGoal:o=!1})=>n?l.jsxs("span",{className:"relative flex w-[15px] shrink-0 flex-col items-center",children:[l.jsx("span",{className:z(r,"h-[13px]","group-first/goal:opacity-0 group-only/goal:opacity-0")}),n&&l.jsx(Te.div,{animate:{scale:e==="loading"?1.1:1,transition:{duration:.2,ease:Qd}},children:l.jsx("div",{className:"bg-base",children:l.jsx(Yre,{state:t,showFinishedIcon:!1,size:"xs"})})}),!o&&l.jsx("span",{className:z(r,"grow",!s&&"group-last/goal:opacity-0")})]}):null);Qre.displayName="Timeline";function fN(){const{value:e}=zt({flag:"move-citations-to-paragraph-end",subjectType:"visitor_id",defaultValue:!0});return e}typeof globalThis<"u"&&(globalThis.__useMoveCitationsToParagraphEnd=fN);function i_t(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const a=n.slice(s,r).trim();(a||!o)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function PYe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const OYe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LYe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FYe={};function uO(e,t){return(FYe.jsx?LYe:OYe).test(e)}const BYe=/[ \t\n\f\r]/g;function UYe(e){return typeof e=="object"?e.type==="text"?dO(e.value):!1:dO(e)}function dO(e){return e.replace(BYe,"")===""}class qg{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qg.prototype.normal={};qg.prototype.property={};qg.prototype.space=void 0;function Xre(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new qg(n,r,t)}function hk(e){return e.toLowerCase()}class Ws{constructor(t,n){this.attribute=n,this.property=t}}Ws.prototype.attribute="";Ws.prototype.booleanish=!1;Ws.prototype.boolean=!1;Ws.prototype.commaOrSpaceSeparated=!1;Ws.prototype.commaSeparated=!1;Ws.prototype.defined=!1;Ws.prototype.mustUseProperty=!1;Ws.prototype.number=!1;Ws.prototype.overloadedBoolean=!1;Ws.prototype.property="";Ws.prototype.spaceSeparated=!1;Ws.prototype.space=void 0;let VYe=0;const Lt=vu(),gr=vu(),Zre=vu(),Oe=vu(),jn=vu(),Td=vu(),$s=vu();function vu(){return 2**++VYe}const gk=Object.freeze(Object.defineProperty({__proto__:null,boolean:Lt,booleanish:gr,commaOrSpaceSeparated:$s,commaSeparated:Td,number:Oe,overloadedBoolean:Zre,spaceSeparated:jn},Symbol.toStringTag,{value:"Module"})),Xw=Object.keys(gk);class mN extends Ws{constructor(t,n,r,s){let o=-1;if(super(t,n),fO(this,"space",s),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&$Ye.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mO,YYe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mO.test(o)){let a=o.replace(GYe,KYe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=mN}return new s(r,t)}function KYe(e){return"-"+e.toLowerCase()}function YYe(e){return e.charAt(1).toUpperCase()}const QYe=Xre([Jre,HYe,nse,rse,sse],"html"),pN=Xre([Jre,zYe,nse,rse,sse],"svg");function XYe(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ZYe(e){return e.join(" ").trim()}var Vu={},Zw,pO;function JYe(){if(pO)return Zw;pO=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,i=/^\s+|\s+$/g,c=` -`,u="/",f="*",m="",p="comment",h="declaration";Zw=function(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var v=1,b=1;function _(D){var j=D.match(t);j&&(v+=j.length);var F=D.lastIndexOf(c);b=~F?D.length-F:b+D.length}function w(){var D={line:v,column:b};return function(j){return j.position=new S(D),T(),j}}function S(D){this.start=D,this.end={line:v,column:b},this.source=x.source}S.prototype.content=y;function C(D){var j=new Error(x.source+":"+v+":"+b+": "+D);if(j.reason=D,j.filename=x.source,j.line=v,j.column=b,j.source=y,!x.silent)throw j}function E(D){var j=D.exec(y);if(j){var F=j[0];return _(F),y=y.slice(F.length),j}}function T(){E(n)}function k(D){var j;for(D=D||[];j=I();)j!==!1&&D.push(j);return D}function I(){var D=w();if(!(u!=y.charAt(0)||f!=y.charAt(1))){for(var j=2;m!=y.charAt(j)&&(f!=y.charAt(j)||u!=y.charAt(j+1));)++j;if(j+=2,m===y.charAt(j-1))return C("End of comment missing");var F=y.slice(2,j-2);return b+=2,_(F),y=y.slice(j),b+=2,D({type:p,comment:F})}}function M(){var D=w(),j=E(r);if(j){if(I(),!E(s))return C("property missing ':'");var F=E(o),R=D({type:h,property:g(j[0].replace(e,m)),value:F?g(F[0].replace(e,m)):m});return E(a),R}}function N(){var D=[];k(D);for(var j;j=M();)j!==!1&&(D.push(j),k(D));return D}return T(),N()};function g(y){return y?y.replace(i,m):m}return Zw}var hO;function eQe(){if(hO)return Vu;hO=1;var e=Vu&&Vu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.default=n;var t=e(JYe());function n(r,s){var o=null;if(!r||typeof r!="string")return o;var a=(0,t.default)(r),i=typeof s=="function";return a.forEach(function(c){if(c.type==="declaration"){var u=c.property,f=c.value;i?s(u,f,c):f&&(o=o||{},o[u]=f)}}),o}return Vu}var Fm={},gO;function tQe(){if(gO)return Fm;gO=1,Object.defineProperty(Fm,"__esModule",{value:!0}),Fm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},a=function(u,f){return f.toUpperCase()},i=function(u,f){return"".concat(f,"-")},c=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(s,i):u=u.replace(r,i),u.replace(t,a))};return Fm.camelCase=c,Fm}var Bm,yO;function nQe(){if(yO)return Bm;yO=1;var e=Bm&&Bm.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(eQe()),n=tQe();function r(s,o){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(i,c){i&&c&&(a[(0,n.camelCase)(i,o)]=c)}),a}return r.default=r,Bm=r,Bm}var rQe=nQe();const sQe=uo(rQe),ose=ase("end"),hN=ase("start");function ase(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function oQe(e){const t=hN(e),n=ose(e);if(t&&n)return{start:t,end:n}}function Lp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xO(e.position):"start"in e||"end"in e?xO(e):"line"in e||"column"in e?yk(e):""}function yk(e){return vO(e&&e.line)+":"+vO(e&&e.column)}function xO(e){return yk(e&&e.start)+"-"+yk(e&&e.end)}function vO(e){return e&&typeof e=="number"?e:1}class us extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(a=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const i=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=i?i.line:void 0,this.name=Lp(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}us.prototype.file="";us.prototype.name="";us.prototype.reason="";us.prototype.message="";us.prototype.stack="";us.prototype.column=void 0;us.prototype.line=void 0;us.prototype.ancestors=void 0;us.prototype.cause=void 0;us.prototype.fatal=void 0;us.prototype.place=void 0;us.prototype.ruleId=void 0;us.prototype.source=void 0;const gN={}.hasOwnProperty,aQe=new Map,iQe=/[A-Z]/g,lQe=new Set(["table","tbody","thead","tfoot","tr"]),cQe=new Set(["td","th"]),ise="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uQe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=xQe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=yQe(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?pN:QYe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=lse(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function lse(e,t,n){if(t.type==="element")return dQe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fQe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pQe(e,t,n);if(t.type==="mdxjsEsm")return mQe(e,t);if(t.type==="root")return hQe(e,t,n);if(t.type==="text")return gQe(e,t)}function dQe(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=pN,e.schema=s),e.ancestors.push(t);const o=use(e,t.tagName,!1),a=vQe(e,t);let i=xN(e,t);return lQe.has(t.tagName)&&(i=i.filter(function(c){return typeof c=="string"?!UYe(c):!0})),cse(e,a,o,t),yN(a,i),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function fQe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ah(e,t.position)}function mQe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ah(e,t.position)}function pQe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=pN,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:use(e,t.name,!0),a=bQe(e,t),i=xN(e,t);return cse(e,a,o,t),yN(a,i),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function hQe(e,t,n){const r={};return yN(r,xN(e,t)),e.create(t,e.Fragment,r,n)}function gQe(e,t){return t.value}function cse(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yQe(e,t,n){return r;function r(s,o,a,i){const u=Array.isArray(a.children)?n:t;return i?u(o,a,i):u(o,a)}}function xQe(e,t){return n;function n(r,s,o,a){const i=Array.isArray(o.children),c=hN(r);return t(s,o,a,i,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function vQe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&gN.call(t.properties,s)){const o=_Qe(e,s,t.properties[s]);if(o){const[a,i]=o;e.tableCellAlignToStyle&&a==="align"&&typeof i=="string"&&cQe.has(t.tagName)?r=i:n[a]=i}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bQe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const i=a.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Ah(e,t.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const i=r.value.data.estree.body[0];i.type,o=e.evaluater.evaluateExpression(i.expression)}else Ah(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function xN(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:aQe;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(io(e,e.length,0,t),e):t}const wO={}.hasOwnProperty;function fse(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vs=sc(/[A-Za-z]/),is=sc(/[\dA-Za-z]/),NQe=sc(/[#-'*+\--9=?A-Z^-~]/);function F2(e){return e!==null&&(e<32||e===127)}const xk=sc(/\d/),RQe=sc(/[\dA-Fa-f]/),DQe=sc(/[!-/:-@[-`{-~]/);function ot(e){return e!==null&&e<-2}function Nn(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const vb=sc(new RegExp("\\p{P}|\\p{S}","u")),tu=sc(/\s/);function sc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function rm(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&o<57344){const i=e.charCodeAt(n+1);o<56320&&i>56319&&i<57344?(a=String.fromCharCode(o,i),s=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ut(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(c){return Kt(c)?(e.enter(n),i(c)):t(c)}function i(c){return Kt(c)&&o++a))return;const E=t.events.length;let T=E,k,I;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(k){I=t.events[T][1].end;break}k=!0}for(v(r),C=E;C_;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=_}function b(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function LQe(e,t,n){return Ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ff(e){if(e===null||Nn(e)||tu(e))return 1;if(vb(e))return 2}function bb(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},p={...e[n][1].start};SO(m,-c),SO(p,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},i={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[r][1].end={...a.start},e[n][1].start={...i.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=wo(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=wo(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=wo(u,bb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=wo(u,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=wo(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,io(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&Kt(C)?Ut(e,b,"linePrefix",o+1)(C):b(C)}function b(C){return C===null||ot(C)?e.check(EO,y,w)(C):(e.enter("codeFlowValue"),_(C))}function _(C){return C===null||ot(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),_)}function w(C){return e.exit("codeFenced"),t(C)}function S(C,E,T){let k=0;return I;function I(F){return C.enter("lineEnding"),C.consume(F),C.exit("lineEnding"),M}function M(F){return C.enter("codeFencedFence"),Kt(F)?Ut(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):N(F)}function N(F){return F===i?(C.enter("codeFencedFenceSequence"),D(F)):T(F)}function D(F){return F===i?(k++,C.consume(F),D):k>=a?(C.exit("codeFencedFenceSequence"),Kt(F)?Ut(C,j,"whitespace")(F):j(F)):T(F)}function j(F){return F===null||ot(F)?(C.exit("codeFencedFence"),E(F)):T(F)}}}function YQe(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const eC={name:"codeIndented",tokenize:XQe},QQe={partial:!0,tokenize:ZQe};function XQe(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Ut(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):ot(u)?e.attempt(QQe,a,c)(u):(e.enter("codeFlowValue"),i(u))}function i(u){return u===null||ot(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),i)}function c(u){return e.exit("codeIndented"),t(u)}}function ZQe(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ot(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Ut(e,o,"linePrefix",5)(a)}function o(a){const i=r.events[r.events.length-1];return i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):ot(a)?s(a):n(a)}}const JQe={name:"codeText",previous:tXe,resolve:eXe,tokenize:nXe};function eXe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Um(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Um(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Um(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function xse(e,t,n,r,s,o,a,i,c){const u=c||Number.POSITIVE_INFINITY;let f=0;return m;function m(v){return v===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||F2(v)?n(v):(e.enter(r),e.enter(a),e.enter(i),e.enter("chunkString",{contentType:"string"}),y(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(s),e.exit(r),t):(e.enter(i),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(e.exit("chunkString"),e.exit(i),p(v)):v===null||v===60||ot(v)?n(v):(e.consume(v),v===92?g:h)}function g(v){return v===60||v===62||v===92?(e.consume(v),h):h(v)}function y(v){return!f&&(v===null||v===41||Nn(v))?(e.exit("chunkString"),e.exit(i),e.exit(a),e.exit(r),t(v)):f999||h===null||h===91||h===93&&!c||h===94&&!i&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(e.exit(o),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):ot(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),m(h))}function m(h){return h===null||h===91||h===93||ot(h)||i++>999?(e.exit("chunkString"),f(h)):(e.consume(h),c||(c=!Kt(h)),h===92?p:m)}function p(h){return h===91||h===92||h===93?(e.consume(h),i++,m):m(h)}}function bse(e,t,n,r,s,o){let a;return i;function i(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,c):n(p)}function c(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),c(a)):p===null?n(p):ot(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ut(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||ot(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?m:f)}function m(p){return p===a||p===92?(e.consume(p),f):f(p)}}function Fp(e,t){let n;return r;function r(s){return ot(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Kt(s)?Ut(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const uXe={name:"definition",tokenize:fXe},dXe={partial:!0,tokenize:mXe};function fXe(e,t,n){const r=this;let s;return o;function o(h){return e.enter("definition"),a(h)}function a(h){return vse.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function i(h){return s=pa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):n(h)}function c(h){return Nn(h)?Fp(e,u)(h):u(h)}function u(h){return xse(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(dXe,m,m)(h)}function m(h){return Kt(h)?Ut(e,p,"whitespace")(h):p(h)}function p(h){return h===null||ot(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function mXe(e,t,n){return r;function r(i){return Nn(i)?Fp(e,s)(i):n(i)}function s(i){return bse(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function o(i){return Kt(i)?Ut(e,a,"whitespace")(i):a(i)}function a(i){return i===null||ot(i)?t(i):n(i)}}const pXe={name:"hardBreakEscape",tokenize:hXe};function hXe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return ot(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const gXe={name:"headingAtx",resolve:yXe,tokenize:xXe};function yXe(e,t){let n=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},io(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function xXe(e,t,n){let r=0;return s;function s(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Nn(f)?(e.exit("atxHeadingSequence"),i(f)):n(f)}function i(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||ot(f)?(e.exit("atxHeading"),t(f)):Kt(f)?Ut(e,i,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),i(f))}function u(f){return f===null||f===35||Nn(f)?(e.exit("atxHeadingText"),i(f)):(e.consume(f),u)}}const vXe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],MO=["pre","script","style","textarea"],bXe={concrete:!0,name:"htmlFlow",resolveTo:CXe,tokenize:SXe},_Xe={partial:!0,tokenize:kXe},wXe={partial:!0,tokenize:EXe};function CXe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SXe(e,t,n){const r=this;let s,o,a,i,c;return u;function u(H){return f(H)}function f(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),m}function m(H){return H===33?(e.consume(H),p):H===47?(e.consume(H),o=!0,y):H===63?(e.consume(H),s=3,r.interrupt?t:O):vs(H)?(e.consume(H),a=String.fromCharCode(H),x):n(H)}function p(H){return H===45?(e.consume(H),s=2,h):H===91?(e.consume(H),s=5,i=0,g):vs(H)?(e.consume(H),s=4,r.interrupt?t:O):n(H)}function h(H){return H===45?(e.consume(H),r.interrupt?t:O):n(H)}function g(H){const Q="CDATA[";return H===Q.charCodeAt(i++)?(e.consume(H),i===Q.length?r.interrupt?t:N:g):n(H)}function y(H){return vs(H)?(e.consume(H),a=String.fromCharCode(H),x):n(H)}function x(H){if(H===null||H===47||H===62||Nn(H)){const Q=H===47,Y=a.toLowerCase();return!Q&&!o&&MO.includes(Y)?(s=1,r.interrupt?t(H):N(H)):vXe.includes(a.toLowerCase())?(s=6,Q?(e.consume(H),v):r.interrupt?t(H):N(H)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(H):o?b(H):_(H))}return H===45||is(H)?(e.consume(H),a+=String.fromCharCode(H),x):n(H)}function v(H){return H===62?(e.consume(H),r.interrupt?t:N):n(H)}function b(H){return Kt(H)?(e.consume(H),b):I(H)}function _(H){return H===47?(e.consume(H),I):H===58||H===95||vs(H)?(e.consume(H),w):Kt(H)?(e.consume(H),_):I(H)}function w(H){return H===45||H===46||H===58||H===95||is(H)?(e.consume(H),w):S(H)}function S(H){return H===61?(e.consume(H),C):Kt(H)?(e.consume(H),S):_(H)}function C(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),c=H,E):Kt(H)?(e.consume(H),C):T(H)}function E(H){return H===c?(e.consume(H),c=null,k):H===null||ot(H)?n(H):(e.consume(H),E)}function T(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Nn(H)?S(H):(e.consume(H),T)}function k(H){return H===47||H===62||Kt(H)?_(H):n(H)}function I(H){return H===62?(e.consume(H),M):n(H)}function M(H){return H===null||ot(H)?N(H):Kt(H)?(e.consume(H),M):n(H)}function N(H){return H===45&&s===2?(e.consume(H),R):H===60&&s===1?(e.consume(H),P):H===62&&s===4?(e.consume(H),$):H===63&&s===3?(e.consume(H),O):H===93&&s===5?(e.consume(H),U):ot(H)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(_Xe,G,D)(H)):H===null||ot(H)?(e.exit("htmlFlowData"),D(H)):(e.consume(H),N)}function D(H){return e.check(wXe,j,G)(H)}function j(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),F}function F(H){return H===null||ot(H)?D(H):(e.enter("htmlFlowData"),N(H))}function R(H){return H===45?(e.consume(H),O):N(H)}function P(H){return H===47?(e.consume(H),a="",L):N(H)}function L(H){if(H===62){const Q=a.toLowerCase();return MO.includes(Q)?(e.consume(H),$):N(H)}return vs(H)&&a.length<8?(e.consume(H),a+=String.fromCharCode(H),L):N(H)}function U(H){return H===93?(e.consume(H),O):N(H)}function O(H){return H===62?(e.consume(H),$):H===45&&s===2?(e.consume(H),O):N(H)}function $(H){return H===null||ot(H)?(e.exit("htmlFlowData"),G(H)):(e.consume(H),$)}function G(H){return e.exit("htmlFlow"),t(H)}}function EXe(e,t,n){const r=this;return s;function s(a){return ot(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function kXe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Kg,t,n)}}const MXe={name:"htmlText",tokenize:TXe};function TXe(e,t,n){const r=this;let s,o,a;return i;function i(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),S):O===63?(e.consume(O),_):vs(O)?(e.consume(O),T):n(O)}function u(O){return O===45?(e.consume(O),f):O===91?(e.consume(O),o=0,g):vs(O)?(e.consume(O),b):n(O)}function f(O){return O===45?(e.consume(O),h):n(O)}function m(O){return O===null?n(O):O===45?(e.consume(O),p):ot(O)?(a=m,P(O)):(e.consume(O),m)}function p(O){return O===45?(e.consume(O),h):m(O)}function h(O){return O===62?R(O):O===45?p(O):m(O)}function g(O){const $="CDATA[";return O===$.charCodeAt(o++)?(e.consume(O),o===$.length?y:g):n(O)}function y(O){return O===null?n(O):O===93?(e.consume(O),x):ot(O)?(a=y,P(O)):(e.consume(O),y)}function x(O){return O===93?(e.consume(O),v):y(O)}function v(O){return O===62?R(O):O===93?(e.consume(O),v):y(O)}function b(O){return O===null||O===62?R(O):ot(O)?(a=b,P(O)):(e.consume(O),b)}function _(O){return O===null?n(O):O===63?(e.consume(O),w):ot(O)?(a=_,P(O)):(e.consume(O),_)}function w(O){return O===62?R(O):_(O)}function S(O){return vs(O)?(e.consume(O),C):n(O)}function C(O){return O===45||is(O)?(e.consume(O),C):E(O)}function E(O){return ot(O)?(a=E,P(O)):Kt(O)?(e.consume(O),E):R(O)}function T(O){return O===45||is(O)?(e.consume(O),T):O===47||O===62||Nn(O)?k(O):n(O)}function k(O){return O===47?(e.consume(O),R):O===58||O===95||vs(O)?(e.consume(O),I):ot(O)?(a=k,P(O)):Kt(O)?(e.consume(O),k):R(O)}function I(O){return O===45||O===46||O===58||O===95||is(O)?(e.consume(O),I):M(O)}function M(O){return O===61?(e.consume(O),N):ot(O)?(a=M,P(O)):Kt(O)?(e.consume(O),M):k(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,D):ot(O)?(a=N,P(O)):Kt(O)?(e.consume(O),N):(e.consume(O),j)}function D(O){return O===s?(e.consume(O),s=void 0,F):O===null?n(O):ot(O)?(a=D,P(O)):(e.consume(O),D)}function j(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Nn(O)?k(O):(e.consume(O),j)}function F(O){return O===47||O===62||Nn(O)?k(O):n(O)}function R(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function P(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),L}function L(O){return Kt(O)?Ut(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):U(O)}function U(O){return e.enter("htmlTextData"),a(O)}}const _N={name:"labelEnd",resolveAll:DXe,resolveTo:jXe,tokenize:IXe},AXe={tokenize:PXe},NXe={tokenize:OXe},RXe={tokenize:LXe};function DXe(e){let t=-1;const n=[];for(;++t=3&&(u===null||ot(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Kt(u)?Ut(e,i,"whitespace")(u):i(u))}}const Ts={continuation:{tokenize:qXe},exit:YXe,name:"list",tokenize:$Xe},WXe={partial:!0,tokenize:QXe},GXe={partial:!0,tokenize:KXe};function $Xe(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return i;function i(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:xk(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ey,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return n(h)}function c(h){return xk(h)&&++a<10?(e.consume(h),c):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Kg,r.interrupt?n:f,e.attempt(WXe,p,m))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function m(h){return Kt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function qXe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Kg,s,o);function s(i){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ut(e,t,"listItemIndent",r.containerState.size+1)(i)}function o(i){return r.containerState.furtherBlankLines||!Kt(i)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(i)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(GXe,t,a)(i))}function a(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ut(e,e.attempt(Ts,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function KXe(e,t,n){const r=this;return Ut(e,s,"listItemIndent",r.containerState.size+1);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function YXe(e){e.exit(this.containerState.type)}function QXe(e,t,n){const r=this;return Ut(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const a=r.events[r.events.length-1];return!Kt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const TO={name:"setextUnderline",resolveTo:XXe,tokenize:ZXe};function XXe(e,t){let n=e.length,r,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function ZXe(e,t,n){const r=this;let s;return o;function o(u){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),i(u)}function i(u){return u===s?(e.consume(u),i):(e.exit("setextHeadingLineSequence"),Kt(u)?Ut(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||ot(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const JXe={tokenize:eZe};function eZe(e){const t=this,n=e.attempt(Kg,r,e.attempt(this.parser.constructs.flowInitial,s,Ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(oXe,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tZe={resolveAll:wse()},nZe=_se("string"),rZe=_se("text");function _se(e){return{resolveAll:wse(e==="text"?sZe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,a,i);return a;function a(f){return u(f)?o(f):i(f)}function i(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),c}function c(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),c)}function u(f){if(f===null)return!0;const m=s[f];let p=-1;if(m)for(;++p-1){const i=a[0];typeof i=="string"?a[0]=i.slice(r):a.shift()}o>0&&a.push(e[s].slice(0,o))}return a}function yZe(e,t){let n=-1;const r=[];let s;for(;++n0){const Gt=Ae.tokenStack[Ae.tokenStack.length-1];(Gt[1]||NO).call(Ae,void 0,Gt[0])}for(ve.position={start:ll(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:ll(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},pt=-1;++pt1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function jZe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IZe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kse(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function PZe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kse(e,t);const s={src:rm(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function OZe(e,t){const n={src:rm(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function LZe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function FZe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kse(e,t);const s={href:rm(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function BZe(e,t){const n={href:rm(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function UZe(e,t,n){const r=e.all(t),s=n?VZe(n):Mse(t),o={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let i=-1;for(;++i1}function HZe(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=hN(t.children[1]),c=ose(t.children[t.children.length-1]);i&&c&&(a.position={start:i,end:c}),s.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function qZe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,i=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(jO(t.slice(s),s>0,!1)),o.join("")}function jO(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===RO||o===DO;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===RO||o===DO;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function QZe(e,t){const n={type:"text",value:YZe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XZe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ZZe={blockquote:MZe,break:TZe,code:AZe,delete:NZe,emphasis:RZe,footnoteReference:DZe,heading:jZe,html:IZe,imageReference:PZe,image:OZe,inlineCode:LZe,linkReference:FZe,link:BZe,listItem:UZe,list:HZe,paragraph:zZe,root:WZe,strong:GZe,table:$Ze,tableCell:KZe,tableRow:qZe,text:QZe,thematicBreak:XZe,toml:m1,yaml:m1,definition:m1,footnoteDefinition:m1};function m1(){}const Tse=-1,_b=0,Bp=1,B2=2,wN=3,CN=4,SN=5,EN=6,Ase=7,Nse=8,IO=typeof self=="object"?self:globalThis,JZe=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,a]=t[s];switch(o){case _b:case Tse:return n(a,s);case Bp:{const i=n([],s);for(const c of a)i.push(r(c));return i}case B2:{const i=n({},s);for(const[c,u]of a)i[r(c)]=r(u);return i}case wN:return n(new Date(a),s);case CN:{const{source:i,flags:c}=a;return n(new RegExp(i,c),s)}case SN:{const i=n(new Map,s);for(const[c,u]of a)i.set(r(c),r(u));return i}case EN:{const i=n(new Set,s);for(const c of a)i.add(r(c));return i}case Ase:{const{name:i,message:c}=a;return n(new IO[i](c),s)}case Nse:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:i}=new Uint8Array(a);return n(new DataView(i),a)}}return n(new IO[o](a),s)};return r},PO=e=>JZe(new Map,e)(0),Hu="",{toString:eJe}={},{keys:tJe}=Object,Vm=e=>{const t=typeof e;if(t!=="object"||!e)return[_b,t];const n=eJe.call(e).slice(8,-1);switch(n){case"Array":return[Bp,Hu];case"Object":return[B2,Hu];case"Date":return[wN,Hu];case"RegExp":return[CN,Hu];case"Map":return[SN,Hu];case"Set":return[EN,Hu];case"DataView":return[Bp,n]}return n.includes("Array")?[Bp,n]:n.includes("Error")?[Ase,n]:[B2,n]},p1=([e,t])=>e===_b&&(t==="function"||t==="symbol"),nJe=(e,t,n,r)=>{const s=(a,i)=>{const c=r.push(a)-1;return n.set(i,c),c},o=a=>{if(n.has(a))return n.get(a);let[i,c]=Vm(a);switch(i){case _b:{let f=a;switch(c){case"bigint":i=Nse,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return s([Tse],a)}return s([i,f],a)}case Bp:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),s([c,[...p]],a)}const f=[],m=s([i,f],a);for(const p of a)f.push(o(p));return m}case B2:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],m=s([i,f],a);for(const p of tJe(a))(e||!p1(Vm(a[p])))&&f.push([o(p),o(a[p])]);return m}case wN:return s([i,a.toISOString()],a);case CN:{const{source:f,flags:m}=a;return s([i,{source:f,flags:m}],a)}case SN:{const f=[],m=s([i,f],a);for(const[p,h]of a)(e||!(p1(Vm(p))||p1(Vm(h))))&&f.push([o(p),o(h)]);return m}case EN:{const f=[],m=s([i,f],a);for(const p of a)(e||!p1(Vm(p)))&&f.push(o(p));return m}}const{message:u}=a;return s([i,{name:c,message:u}],a)};return o},OO=(e,{json:t,lossy:n}={})=>{const r=[];return nJe(!(t||n),!!t,new Map,r)(e),r},Bc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?PO(OO(e,t)):structuredClone(e):(e,t)=>PO(OO(e,t));function rJe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function sJe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function oJe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rJe,r=e.options.footnoteBackLabel||sJe,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,h);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,h),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=f[f.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else f.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,v),i.push(v)}if(i.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Bc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:` -`}]}}const wb=(function(e){if(e==null)return cJe;if(typeof e=="function")return Cb(e);if(typeof e=="object")return Array.isArray(e)?aJe(e):iJe(e);if(typeof e=="string")return lJe(e);throw new Error("Expected function, string, or object as test")});function aJe(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=Rse,g,y,x;if((!t||o(c,u,f[f.length-1]||void 0))&&(h=dJe(n(c,f)),h[0]===bk))return h;if("children"in c&&c.children){const v=c;if(v.children&&h[0]!==ws)for(y=(r?v.children.length:-1)+a,x=f.concat(v);y>-1&&y0&&n.push({type:"text",value:` -`}),n}function LO(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function FO(e,t){const n=mJe(e,t),r=n.one(e,void 0),s=oJe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:` -`},s),o}function xJe(e,t){return e&&"run"in e?async function(n,r){const s=FO(n,{file:r,...t});await e.run(s,r)}:function(n,r){return FO(n,{file:r,...e||t})}}function BO(e){if(e)throw e}var nC,UO;function vJe(){if(UO)return nC;UO=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},o=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),m=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!m)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,f){n&&f.name==="__proto__"?n(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},i=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return nC=function c(){var u,f,m,p,h,g,y=arguments[0],x=1,v=arguments.length,b=!1;for(typeof y=="boolean"&&(b=y,y=arguments[1]||{},x=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});xa.length;let c;i&&a.push(s);try{c=e.apply(this,a)}catch(u){const f=u;if(i&&n)throw f;return s(f)}i||(c&&c.then&&typeof c.then=="function"?c.then(o,s):c instanceof Error?s(c):o(c))}function s(a,...i){n||(n=!0,t(a,...i))}function o(a){s(null,a)}}const Oa={basename:CJe,dirname:SJe,extname:EJe,join:kJe,sep:"/"};function CJe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yg(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,i=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1),i>-1&&(e.codePointAt(s)===t.codePointAt(i--)?i<0&&(r=s):(i=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function SJe(e){if(Yg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function EJe(e){Yg(e);let t=e.length,n=-1,r=0,s=-1,o=0,a;for(;t--;){const i=e.codePointAt(t);if(i===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),i===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function kJe(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function TJe(e,t){let n="",r=0,s=-1,o=0,a=-1,i,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}}else if(n.length>0){n="",r=0,s=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,o=0}else i===46&&o>-1?o++:o=-1}return n}function Yg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const AJe={cwd:NJe};function NJe(){return"/"}function Ck(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function RJe(e){if(typeof e=="string")e=new URL(e);else if(!Ck(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return DJe(e)}function DJe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[h,...g]=f;const y=r[p][1];wk(y)&&wk(h)&&(h=rC(!0,y,h)),r[p]=[u,h,...g]}}}}const Ise=new kN().freeze();function iC(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lC(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cC(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function HO(e){if(!wk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function h1(e){return OJe(e)?e:new jse(e)}function OJe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LJe(e){return typeof e=="string"||FJe(e)}function FJe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BJe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",WO=[],GO={allowDangerousHtml:!0},UJe=/^(https?|ircs?|mailto|xmpp)$/i,VJe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function HJe(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",s=e.className,o=e.components,a=e.disallowedElements,i=e.rehypePlugins||WO,c=e.remarkPlugins||WO,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...GO}:GO,f=e.skipHtml,m=e.unwrapDisallowed,p=e.urlTransform||zJe,h=Ise().use(Ese).use(c).use(xJe,u).use(i),g=new jse;typeof r=="string"&&(g.value=r);for(const b of VJe)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+BJe+b.id,void 0);const y=h.parse(g);let x=h.runSync(y,g);return s&&(x={type:"element",tagName:"div",properties:{className:s},children:x.type==="root"?x.children:[x]}),ur(x,v),uQe(x,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function v(b,_,w){if(b.type==="raw"&&w&&typeof _=="number")return f?w.children.splice(_,1):w.children[_]={type:"text",value:b.value},_;if(b.type==="element"){let S;for(S in Jw)if(Object.hasOwn(Jw,S)&&Object.hasOwn(b.properties,S)){const C=b.properties[S],E=Jw[S];(E===null||E.includes(b.tagName))&&(b.properties[S]=p(String(C||""),S,b))}}if(b.type==="element"){let S=t?!t.includes(b.tagName):a?a.includes(b.tagName):!1;if(!S&&n&&typeof _=="number"&&(S=!n(b,_,w)),S&&w&&typeof _=="number")return m&&b.children?w.children.splice(_,1,...b.children):w.children.splice(_,1),_}}}function zJe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||UJe.test(e.slice(0,t))?e:""}const $O=4e3,WJe=e=>{const t=e.image_width,n=e.image_height;return!t||!n?!0:t<=$O&&n<=$O},MN=A.memo(({item:e,onClick:t,alt:n})=>{const[r,s]=d.useState(!1);d.useEffect(()=>{s(!1)},[e]);const o=d.useMemo(()=>WJe(e)&&e.image||e.thumbnail,[e]),a=d.useCallback(()=>{s(!0)},[]);if(!o||r){const i=o?"Failed to load image":"Image not available";return l.jsx(Ro,{className:z("relative w-full",{"cursor-pointer":t}),onClick:t,disabled:!t,children:l.jsx("div",{className:"bg-subtler flex h-40 w-full items-center justify-center rounded-lg md:h-48",children:l.jsxs("div",{className:"text-center",children:[l.jsx(ge,{icon:B("photo"),size:"xl",className:"mx-auto mb-2 opacity-50"}),l.jsx(V,{variant:"small",color:"light",children:i})]})})})}return l.jsx(Ro,{className:z("relative w-full",{"cursor-pointer":t}),onClick:t,disabled:!t,children:l.jsx("img",{src:o,alt:n||e.name||e.author_name||"Image",className:"h-40 w-full rounded-lg object-cover transition-opacity hover:opacity-90 md:h-48",onError:a,loading:"lazy"})})});MN.displayName="MainImage";const Pse=A.memo(({item:e,index:t,isSelected:n,onClick:r})=>{const[s,o]=d.useState(!1),a=e.thumbnail||e.image;d.useEffect(()=>{o(!1)},[e]);const i=d.useCallback(()=>{o(!0)},[]);return l.jsx(Ro,{className:z("flex-shrink-0 cursor-pointer transition-all",n?"ring-super rounded-md ring-2":"hover:opacity-75"),onClick:r,children:a&&!s?l.jsx("img",{src:a,alt:e.name||e.author_name||`Image ${t+1}`,className:"h-12 w-16 rounded-md object-cover",onError:i}):l.jsx("div",{className:"bg-subtler flex h-12 w-16 items-center justify-center rounded-md",children:l.jsx(ge,{icon:B("photo"),size:"xs",className:"opacity-50"})})})});Pse.displayName="ThumbnailImage";const Ose=A.memo(({item:e,onClick:t})=>l.jsxs("div",{children:[l.jsx("div",{className:"mb-3",children:l.jsx(MN,{item:e,onClick:t})}),l.jsx(TN,{item:e})]}));Ose.displayName="SingleImageDisplay";const Sk=A.memo(({items:e,selectedIndex:t,onImageSelect:n,onImageClick:r})=>{const s=d.useCallback(()=>{r(t)},[r,t]),o=d.useCallback(()=>{const u=t>0?t-1:e.length-1;n(u)},[t,e.length,n]),a=d.useCallback(()=>{const u=t{u.key==="ArrowLeft"?(u.preventDefault(),o()):u.key==="ArrowRight"&&(u.preventDefault(),a())},[o,a]),c=e[t];return l.jsxs("div",{onKeyDownCapture:i,tabIndex:0,children:[l.jsxs("div",{className:"relative mb-3",children:[l.jsx(MN,{item:c,onClick:s,alt:c.name||c.author_name||`Image ${t+1}`}),e.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute left-1 top-1/2 -translate-y-1/2",children:l.jsx(wt,{onClick:o,rounded:!0,icon:B("chevron-left"),size:"small","aria-label":"Previous image",variant:"tonal"})}),l.jsx("div",{className:"absolute right-1 top-1/2 -translate-y-1/2",children:l.jsx(wt,{onClick:a,rounded:!0,icon:B("chevron-right"),size:"small","aria-label":"Next image",variant:"tonal"})})]})]}),l.jsx("div",{className:"mb-3",children:l.jsx("div",{className:"flex gap-2 overflow-x-auto p-1 pb-2 [scrollbar-width:thin]",children:e.map((u,f)=>l.jsx(Pse,{item:u,index:f,isSelected:t===f,onClick:()=>n(f)},f))})}),l.jsx(TN,{item:c,index:t})]})});Sk.displayName="MultipleImagesDisplay";const TN=A.memo(({item:e,index:t})=>{const n=e.name||e.author_name||(t!==void 0?`Image ${t+1}`:"Image");return e.url?l.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[l.jsx(yt,{href:e.url,target:"_blank",rel:"noopener nofollow",className:"hover:text-super cursor-pointer transition-colors",children:l.jsx(V,{variant:"small",className:"line-clamp-3 font-medium leading-tight",children:n})}),l.jsx(yt,{href:e.url,target:"_blank",rel:"noopener nofollow",className:"hover:text-super cursor-pointer transition-colors",children:l.jsx(V,{variant:"tiny",color:"light",className:"hover:text-super line-clamp-1",children:l.jsx("span",{className:"truncate font-mono",children:Ur(e.url)})})})]}):l.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[l.jsx(V,{variant:"small",className:"line-clamp-3 font-medium leading-tight",children:n}),e.author_name&&e.author_name!==n&&l.jsxs(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:[l.jsx("span",{children:"by"})," ",l.jsx("span",{className:"font-medium",children:e.author_name})]})]})});TN.displayName="ImageCaption";const Lse=A.memo(({mediaItem:e,allMediaItems:t,className:n="",trackEvent:r,overflowCount:s,openGallery:o})=>{const a=d.useMemo(()=>(t||[e]).filter(S=>S.image||S.thumbnail),[t,e]),{label:i,isTruncated:c}=d.useMemo(()=>{if(e.url){const w=ng(e.url),S=w.split("."),C=S.length>1?S.slice(-2).join("."):w,E=C.length>12;return{label:E?C.slice(0,12):C,isTruncated:E}}return{label:"image",isTruncated:!1}},[e.url]),u=d.useMemo(()=>s&&s>0?l.jsxs("span",{className:"opacity-50",children:["+",s]}):void 0,[s]),{isMobileStyle:f}=Re(),[m,p]=d.useState(0),[h,g]=d.useState(!1),y=d.useCallback(w=>{p(w)},[]),x=d.useCallback(w=>{if(f)return;a[w]&&o&&(g(!1),o(a,w))},[a,o,f]),v=d.useCallback(()=>{if(!o)return;a[0]&&(g(!1),o(a,0))},[a,o]),b=d.useCallback(()=>{f&&a.length>1||o&&o(a)},[a,o,f]),_=d.useMemo(()=>l.jsx(Ro,{className:"relative -top-px ml-0.5 inline-flex select-none items-center whitespace-nowrap align-middle",onClick:b,children:l.jsxs(K,{as:"span",variant:"subtle",className:z("text-3xs rounded-badge group inline-flex min-w-4 cursor-pointer items-center px-[0.3rem] py-[0.1875rem] align-middle font-mono tabular-nums leading-snug","[@media(hover:hover)]:hover:bg-super dark:[@media(hover:hover)]:hover:text-inverse [@media(hover:hover)]:hover:text-white"),children:[l.jsx(ge,{icon:B("photo"),size:"2xs",className:"mr-xs inline-block opacity-80"}),l.jsx("span",{className:z("relative inline-block",{"max-w-[25ch] overflow-hidden":c}),style:c?{maskImage:"linear-gradient(to right, black 70%, transparent 100%)"}:{},children:i}),!!u&&l.jsx("span",{className:"ml-xs inline-block",children:u})]})}),[i,c,u,b]);return a.length===0?null:f&&a.length===1?_:f?l.jsx(Fl,{interaction:"click",side:"bottom",align:"start",open:h,onOpenChange:g,triggerElement:_,children:l.jsx("div",{className:"bg-base w-full md:-mx-3 md:-my-2 md:w-80",children:l.jsx("div",{className:"md:p-3",children:l.jsx(Sk,{items:a,selectedIndex:m,onImageSelect:y,onImageClick:x})})})}):l.jsx(Fl,{interaction:"hover",openDelayMs:200,closeDelayMs:200,side:"bottom",align:"start",open:h,onOpenChange:g,triggerElement:_,children:l.jsx("div",{className:"bg-base w-full md:-mx-3 md:-my-2 md:w-80",children:l.jsx("div",{className:"md:p-3",children:a.length===1?l.jsx(Ose,{item:a[0],onClick:v}):l.jsx(Sk,{items:a,selectedIndex:m,onImageSelect:y,onImageClick:x})})})})});Lse.displayName="ImageCitationTooltip";const Fse=A.memo(({node:e,...t})=>l.jsx("button",{...t}));Fse.displayName="Button";const GJe={abap:"abap",actionscript:"actionscript",ada:"ada",arduino:"arduino",autoit:"autoit",bash:"bash",c:"c",clojure:"clojure",coffeescript:"coffeescript",cpp:"cpp",csharp:"csharp",css:"css",cuda:"cuda",d:"d",dart:"dart",delphi:"delphi",elixir:"elixir",erlang:"erlang",fortran:"fortran",foxpro:"foxpro",fsharp:"fsharp",go:"go",graphql:"graphql",gql:"gql",groovy:"groovy",haskell:"haskell",haxe:"haxe",html:"xml",java:"java",javascript:"javascript",json:"json",julia:"julia",jsx:"jsx",js:"js",kotlin:"kotlin",latex:"tex",lisp:"lisp",livescript:"livescript",lua:"lua",markup:"markup",mathematica:"mathematica",makefile:"makefile",matlab:"matlab",objectivec:"objectivec","objective-c":"objectivec","objective-j":"objectivec",objectpascal:"delphi",ocaml:"ocaml",octave:"matlab",perl:"perl",php:"php",powershell:"powershell",prolog:"prolog",puppet:"puppet",python:"python",qml:"qml",r:"r",racket:"lisp",restructuredtext:"rest",rest:"rest",ruby:"ruby",rust:"rust",sass:"less",less:"less",scala:"scala",scheme:"scheme",shell:"shell",smalltalk:"smalltalk",sql:"sql",standardml:"sml",sml:"sml",swift:"swift",tcl:"tcl",tex:"tex",text:"text",tsx:"tsx",ts:"ts",typescript:"typescript",vala:"vala",vbnet:"vbnet",verilog:"verilog",vhdl:"vhdl",xml:"xml",xquery:"xquery"},$Je=e=>{const{trackEvent:t}=e;return A.memo(({inline:r,className:s,children:o,node:a,...i})=>{const c=s?.replace("language-","")||"",u=d.useMemo(()=>({language:GJe?.[c]}),[c]),{$t:f}=J(),m=d.useMemo(()=>({copy:f({defaultMessage:"Copy code",id:"CNXQN5zp9z"}),wrap:f({defaultMessage:"Wrap lines",id:"k+v14s5FhJ"}),noWrap:f({defaultMessage:"No line wrap",id:"IS43cwTSaV"})}),[f]);return r?l.jsx("code",{children:o}):l.jsx(af,{className:"bg-subtler",codeBlockProps:u,trackEvent:t,translations:m,...i,children:o})})},Bse=e=>{try{if(typeof e=="string")return e.toLowerCase().replace(/ /g,"-").replace(/[^a-z0-9-]/g,"").slice(0,50).replace(/^-+|-+$/g,"")}catch{}return""},AN="mb-2 mt-4",qJe=A.memo(({node:e,level:t,...n})=>{const r=Bse(n.children);return l.jsx("h1",{className:`font-display first:mt-xs ${AN} font-semimedium text-lg leading-[1.5em] lg:text-xl`,id:r,...n})}),KJe=A.memo(({node:e,level:t,...n})=>{const r=Bse(n.children);return l.jsx("h2",{className:`${AN} font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&]:mt-4`,id:r,...n})}),YJe=A.memo(({node:e,level:t,...n})=>l.jsx("h2",{className:`${AN} font-display font-semimedium text-base first:mt-0`,...n})),Use=A.memo(e=>l.jsx("hr",{className:"bg-subtle h-px border-0",...e}));Use.displayName="Hr";const Vse=A.memo(({className:e,src:t,alt:n,node:r,...s})=>l.jsx("img",{className:e+" rounded-lg",src:t,alt:n,...s}));Vse.displayName="MarkdownImage";const NN=A.memo(({domain:e,url:t,suffix:n,overflowCount:r,hasPremiumSource:s,source:o,mcpServerSource:a,...i})=>{if(!t&&!e)return null;const c=e||ng(t).replace(/^[a-z]{1,2}\./i,""),u=n?`${c}.${n}`:c,f=s&&a?If(a):null,m=r&&r>0?l.jsxs("span",{className:"opacity-50",children:["+",r]}):void 0;return l.jsx(ca,{label:u,accessory:m,truncate:!0,containerClassName:s?"border border-super bg-super/10":void 0,iconUrl:f||void 0,...i})});NN.displayName="CitationDomainBubble";const Sb=A.memo(e=>l.jsx(ca,{...e}));Sb.displayName="CitationNumberBubble";const pf=A.memo(e=>{const{children:t,timestamp:n,timestampProps:r,includeIcon:s=!0}=e,o=J();if(!n)return null;const a=n?.endsWith("Z")?n:`${n}Z`;return l.jsxs(K,{className:"gap-x-xs flex",children:[s?l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{icon:B("bolt"),size:"xs"})}):null,l.jsxs(V,{variant:"tinyRegular",color:"light",...r,children:[t&&l.jsxs(l.Fragment,{children:[t," "]}),jee(o,a)]})]})});pf.displayName="CitationUpdatedAt";const Hse=A.memo(function({href:t,overflowCount:n,getAttachmentUrl:r,onCitationClick:s,isPatent:o,...a}){const[i,c]=d.useState(!1),[u,f]=d.useState(null),m=d.useCallback(async y=>{if(s?.(y),y?.defaultPrevented||!t||!r)return;const x=await r(t);kr(t)&&(f(x),c(!0))},[s,r,t]),p=n&&n>0?l.jsxs("span",{className:"opacity-50",children:["+",n]}):void 0,h=d.useCallback(()=>c(!1),[]),g=d.useMemo(()=>({src:u??void 0}),[u]);return o?l.jsx(ca,{accessory:p,icon:qU,className:"cursor-pointer",truncate:!0,onClick:m,...a,linkBehavior:"onClick",href:void 0}):l.jsxs(l.Fragment,{children:[l.jsx(ca,{accessory:p,icon:B("paperclip"),className:"cursor-pointer",truncate:!0,onClick:m,...a}),u&&l.jsx(pu,{isOpen:i,onClose:h,imgProps:g})]})});Hse.displayName="FileCitationBubble";const QJe=Ce(async()=>{const{GroupedCitationModal:e}=await Se(()=>q(()=>import("./GroupedCitationModal-iRDkKRir.js"),__vite__mapDeps([458,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),XJe=A.memo(({children:e,webResults:t,citationGroup:n,trackEvent:r,getAttachmentUrl:s,openMemorySearchHistoryModal:o,onCitationClick:a,forceExternalHandler:i,onYouTubeClick:c,onAttachmentClick:u,asChild:f=!1})=>{const{openModal:m}=Uo(),p=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),m(QJe,{webResults:t,citationGroup:n,trackEvent:r,getAttachmentUrl:s,openMemorySearchHistoryModal:o,onCitationClick:a,forceExternalHandler:i,onYouTubeClick:c,onAttachmentClick:u,legacyIdentifier:"__NONE__"})},[m,t,n,r,s,o,a,i,c,u]),h=f?zU:"span";return l.jsx(h,{onClick:p,children:e})});XJe.displayName="GroupedCitationBottomSheet";const ZJe={small:{container:12,icon:10},default:{container:14,icon:12}},zse=A.memo(({source:e,variant:t,isClipped:n,idSmall:r,idDefault:s,mcpServerSource:o})=>{const a=ZJe[t],i=d.useMemo(()=>n?{clipPath:`url(#${t==="small"?r:s})`}:void 0,[n,t,r,s]),c=d.useMemo(()=>({width:a.container,height:a.container,...i}),[a.container,i]),u={"-ml-[5px]":t==="default","-ml-xs":t==="small"};if(e.isAttachment){const m=VK(e.url);return l.jsx(K,{variant:"subtler",className:z("relative z-0 inline-flex shrink-0 items-center justify-center rounded-full",u),style:c,children:l.jsx(V,{variant:"small",color:"light",children:l.jsx(ge,{icon:m,size:a.icon})})})}const f=o?If(o):null;return l.jsx(Po,{domain:Ur(e.url),size:a.container,className:z("bg-subtle relative z-0 inline-flex shrink-0",u),style:i,overrideIconUrl:f||void 0})});zse.displayName="CitationItem";const Eb=A.memo(({sources:e,count:t,variant:n="default",className:r})=>{const s="clip-path-small",o="clip-path-default",a=Math.min(e.length,t),i=d.useMemo(()=>{if(e.length===0)return[];const c=[],u=new Set,f=new Set;for(const m of e){if(c.length>=a)break;if(m.isAttachment){const p=mu(m.url);p&&!f.has(p)&&(c.push(m),f.add(p))}else{const p=Ur(m.url);u.has(p)||(c.push(m),u.add(p))}}if(c.lengthl.jsx(zse,{source:c,variant:n,isClipped:u!==a-1,idSmall:s,idDefault:o,mcpServerSource:c.mcpServerSource},u))})})]})});Eb.displayName="CitationPile";const Wse=A.memo(({webResults:e,citationGroup:t,trackEvent:n,getAttachmentUrl:r,openMemorySearchHistoryModal:s,onCitationClick:o,forceExternalHandler:a,onClose:i,onYouTubeClick:c,onAttachmentClick:u,webResultCitation:f,timestampComponent:m,linkProps:p})=>{const{sortedWebResults:h,headerText:g,hasPremiumSource:y,handleCitationClick:x}=yYe({webResults:e,citationGroup:t,onCitationClick:o,openMemorySearchHistoryModal:s,onYouTubeClick:c,onAttachmentClick:u,forceExternalHandler:a,getAttachmentUrl:r,trackEvent:n,onClose:i}),[v,b]=d.useState(0),_=d.useCallback(()=>{b(I=>Math.max(0,I-1))},[]),w=d.useCallback(()=>{b(I=>Math.min(h.length-1,I+1))},[h.length]),{$t:S}=J(),C=v0,T=h[v],k=d.useMemo(()=>h.map(I=>({url:I.url,isAttachment:I.is_attachment,source:I.meta_data?.citation_domain_name,mcpServerSource:I.meta_data?.mcp_server})),[h]);return l.jsxs("div",{className:"-m-sm",children:[l.jsxs(K,{className:"flex items-center justify-between py-sm px-3 border-b",children:[l.jsxs("div",{className:"flex items-center -ml-sm gap-xs",children:[l.jsx(wt,{variant:"text",size:"tiny",onClick:_,icon:B("chevron-left"),"aria-label":S({defaultMessage:"Previous",id:"JJNc3cbYIJ"}),rounded:!0,disabled:!E}),l.jsx(V,{variant:"smallCaps",color:"light",children:`${v+1}/${h.length}`}),l.jsx(wt,{variant:"text",size:"tiny",onClick:w,icon:B("chevron-right"),"aria-label":S({defaultMessage:"Next",id:"9+DdtuCqLw"}),rounded:!0,disabled:!C})]}),l.jsxs("div",{className:"gap-sm flex col-start-1 row-start-1 duration-normal",children:[l.jsx("div",{className:"pointer-events-none",children:l.jsx(Eb,{sources:k,count:t.totalCount??k.length})}),l.jsx(V,{variant:"tinyRegular",color:"light",children:g})]}),l.jsx(aN,{webResults:h})]}),l.jsx("div",{className:z("scrollbar-subtle overflow-y-auto p-3",{"max-h-[280px]":y,"max-h-60":!y}),children:l.jsx("div",{className:"space-y-px",children:T&&l.jsx(Gse,{result:T,webResultCitation:f,timestampComponent:m,trackEvent:n,linkProps:p,onClick:x(T)},T.url)})})]})}),Gse=A.memo(({result:e,webResultCitation:t,timestampComponent:n,trackEvent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,onClick:i})=>{const c=!!(e.url&&Ji(e.url)),u=e.is_attachment||!1,f=Yl(e);return l.jsx(Vy,{className:"",href:e.url,target:"_blank",rel:"noopener nofollow",__dangerousDoNotUseOnClick:i,children:l.jsx(cN,{result:e,webResultCitation:t,timestampComponent:n,trackEvent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,isFile:u,downloadable:f,isYouTubeVideo:c})})});Gse.displayName="CitationResult";Wse.displayName="GroupedCitationContent";const $se=A.memo(({children:e,webResults:t,citationGroup:n,hideHoverCard:r=!1,trackEvent:s,getAttachmentUrl:o,openMemorySearchHistoryModal:a,onCitationClick:i,forceExternalHandler:c,scrollContainerRef:u})=>{const[f,m]=d.useState(!1),[p,h]=d.useState(!1),[g,y]=d.useState(null),[x,v]=d.useState(!1),[b,_]=d.useState(null),{isMobileStyle:w}=Re(),{onWheel:S}=Ore({scrollContainerRef:u,enabled:!0}),C=d.useCallback(()=>{m(!1)},[]),E=d.useCallback(D=>{y(D),h(!0),m(!1)},[]),T=d.useCallback(async D=>{if(!o)return;if(kr(D.url)){const F=await o(D.url);_(F),v(!0),m(!1)}},[o]),k=d.useCallback(()=>v(!1),[]),I=d.useMemo(()=>({src:b??void 0}),[b]),M=d.useCallback(D=>{m(r?!1:D)},[r]),N=d.useMemo(()=>l.jsx("span",{className:"inline-flex",children:e}),[e]);return l.jsxs(l.Fragment,{children:[g&&g.url&&l.jsx($g,{isOpen:p,name:g.name,setisOpen:h,url:g.url}),b&&l.jsx(pu,{isOpen:x,onClose:k,imgProps:I}),l.jsx(Fl,{interaction:"hover",open:f,onOpenChange:M,openDelayMs:200,closeDelayMs:200,side:"bottom",align:w?"center":"start",triggerElement:N,maxWidthPx:384,onWheelContent:S,children:l.jsx(Wse,{webResults:t,citationGroup:n,trackEvent:s,getAttachmentUrl:o,openMemorySearchHistoryModal:a,onCitationClick:i,forceExternalHandler:c,onClose:C,onYouTubeClick:E,onAttachmentClick:T})})]})});$se.displayName="GroupedCitationHoverCard";const qse=A.memo(({ytID:e,timestamp:t,overflowCount:n,...r})=>{const[s,o]=d.useState(!1),a=d.useCallback(()=>o(!0),[]),i=n&&n>0?l.jsxs("span",{className:"opacity-50",children:["+",n]}):void 0;return l.jsxs(l.Fragment,{children:[l.jsx(ca,{label:"youtube",accessory:i,icon:B("brand-youtube"),onClick:a,className:"cursor-pointer",...r}),e&&l.jsx($g,{url:`https://www.youtube.com/watch?v=${e}`,name:"",isOpen:s,setisOpen:o,timestamp:t})]})});qse.displayName="YoutubeCitationBubble";const Kse="_entity_chip",Ek="pplx-entity-id";function JJe(e){const t=e.match(/^pplx:\/\/entity_chip\/(?.+)$/);if(!(!t||!t.groups?.id))return t.groups.id}var ss;(function(e){e.YOUTUBE="youtube",e.FILE="file",e.MEMORY="memory",e.CONVERSATION_HISTORY="conversation_history",e.WEB="web",e.NUMBERED="numbered",e.MEETING_TRANSCRIPT="meeting_transcript"})(ss||(ss={}));function eet(e){if(e){if(e.is_memory)return B("bubble-text");if(e.is_conversation_history)return B("list-search")}}function tet(e){const{ytID:t,isMobileStyle:n,isFile:r,isMemory:s,isConversationHistory:o,enableCitationGrouping:a,isMeetingTranscript:i}=e;return t&&!n?ss.YOUTUBE:i?ss.MEETING_TRANSCRIPT:r?ss.FILE:a?s?ss.MEMORY:o?ss.CONVERSATION_HISTORY:ss.WEB:ss.NUMBERED}function net(e){const t=e.indexOf("&t=");return t!==-1?e.substring(t+3):void 0}function ret({count:e}){return!e||e<=0?null:l.jsxs("span",{className:"pl-two opacity-50",children:["+",e]})}const RN=A.memo(e=>{const{str:t,href:n,className:r,trackEvent:s,isFile:o,isMeetingTranscript:a,isDownloadable:i,citationSize:c,onCitationClick:u,getAttachmentUrl:f,isMemory:m,isConversationHistory:p,citationGroup:h,enableCitationGrouping:g,citationDomain:y,fileName:x,webResult:v,hasPremiumSource:b,ref:_,forceExternalHandler:w,...S}=e,{isMobileStyle:C}=Re(),E=hp.test(t),T=d.useCallback(()=>{const $=Gg(v);s?.("click citation",{source:"inline",citation_url:n,...$})},[n,s,v]),k=d.useMemo(()=>{const $=h?.overflowCount;return!$||$<=0?null:l.jsx(ret,{count:$})},[h?.overflowCount]);if(!E)return l.jsx("span",{children:t});const I=net(n),M=Ji(n),N=t.replace(/\[|\]|,.*$/g,""),j=!!(n&&!m&&!p&&(!(M||i)||C)),F=tet({ytID:M,isMobileStyle:C,isFile:o,isMemory:m,isConversationHistory:p,enableCitationGrouping:g,isMeetingTranscript:a}),R=g&&h&&h.citations.length>1,P=C&&R,L=!j||P?"onClick":"external";let U;switch(F){case ss.YOUTUBE:U=M&&l.jsx(qse,{...!g&&{label:N},ytID:M,overflowCount:h?.overflowCount??0,timestamp:I,size:c,forceExternalHandler:w});break;case ss.FILE:{const $=v?oz(v):void 0,G=$?If($.toLowerCase())??void 0:void 0,H=tg(v)||!!(n&&Tf(n));U=l.jsx(Hse,{label:g?x??N:N,overflowCount:h?.overflowCount??0,size:c,href:H?void 0:n,getAttachmentUrl:i?f:void 0,onCitationClick:u,forceExternalHandler:w,isPatent:H,...G?{iconUrl:G}:{}})}break;case ss.MEETING_TRANSCRIPT:U=l.jsx(ca,{label:x??N,icon:B("microphone"),accessory:k,size:c,truncate:!0,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.NUMBERED:{const $=eet(v);U=$?l.jsx(ca,{label:N,icon:$,size:c,onClick:u,href:n,linkBehavior:L,trackEvent:s,forceExternalHandler:w}):l.jsx(Sb,{label:N,size:c,onClick:u,href:n,linkBehavior:L,trackEvent:s,forceExternalHandler:w});break}case ss.MEMORY:U=l.jsx(ca,{label:v?.name.toLocaleLowerCase(),icon:B("bubble-text"),accessory:k,size:c,truncate:!0,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.CONVERSATION_HISTORY:U=l.jsx(ca,{label:"library",icon:B("list-search"),accessory:k,size:c,truncate:!1,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.WEB:default:U=l.jsx(NN,{domain:y,url:n,overflowCount:h?.overflowCount??0,size:c,href:n,linkBehavior:L,trackEvent:s,onClick:P||w?u:T,forceExternalHandler:w,hasPremiumSource:b,source:typeof v?.meta_data?.citation_domain_name=="string"?v.meta_data.citation_domain_name:void 0,mcpServerSource:typeof v?.meta_data?.mcp_server=="string"?v.meta_data.mcp_server:void 0})}return l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"citation-nbsp"}),l.jsx("span",{className:z(r,"citation inline"),ref:_,...S,children:U}),"​"]})});RN.displayName="MdStringToLink";const set=function(t){const{ref:n,...r}=t,{anchor:s,className:o,...a}=r,i=f=>{const m=document.getElementById(f);m&&m.scrollIntoView({behavior:"smooth"})},c=s.replace(/\[|\]/g,""),u=d.useCallback(()=>i(`#search${s}`),[s]);return l.jsx(yt,{href:`#search${s}`,onClick:u,className:o,ref:n,...a,children:l.jsx(Sb,{label:c})})},Yse=Ft("MarkdownLinkContext",{}),oet=A.memo(e=>{const{className:t,href:n,title:r,children:s,target:o="_blank",node:a,ref:i,...c}=e,{hideHoverCard:u=!1,trackEvent:f,citationSize:m,onCitationClick:p,getAttachmentUrl:h,enableCitationGrouping:g=!1,webResults:y=[],EntityChipComponent:x,inlineTokenAnnotationsLookup:v,forceExternalHandler:b,scrollContainerRef:_}=d.useContext(Yse),w=g&&a?.data?a.data.citationGroup:void 0,S=d.useMemo(()=>{if(!(!w||w.citations.length<=1))return w.citations.map(Q=>y[Q-1]).filter(Q=>Q!==void 0).sort((Q,Y)=>{const te=Fi(Q),se=Fi(Y);return te&&!se?-1:!te&&se?1:0})},[w,y]),C=S?.[0]??a?.data?.webResult,E=(C?.is_attachment??!1)||tg(C),T=a?.data?.webResultCitation,k=C?.is_memory??!1,I=C?.is_conversation_history??!1,M=Uf(C),{$t:N}=J(),{isMobileStyle:D}=Re(),j=D&&!1,F=d.useCallback(Q=>{if(w&&w.citations.length>1,g&&w&&w.citations.length>0&&(C?.is_memory||C?.is_conversation_history)){const Y=w.citations[0],te=y?.[Y-1];te&&p&&p(te,Q)}else C&&p&&p(C,Q)},[C,w,g,j,p,y]),R=d.useMemo(()=>{if(!a||!v||!(Ek in a.properties))return;const Q=a.properties[Ek];if(typeof Q=="string")return v[Q]},[a,v]),P=d.useMemo(()=>C?{onClick(Q){if(f){const Y=Gg(C);f("click citation",{source:"inline hoverCard",citation_url:C.url,...Y})}F(Q)}}:void 0,[C,F,f]),L=d.useMemo(()=>({color:"light"}),[]),U=d.useCallback((Q,Y)=>()=>{f&&Y&&f("inline link clicked",{linkURL:n,linkText:A.Children.toArray(s).join(""),linkSurface:Q,isNavLink:!1})},[n,s,f]),O=d.useCallback(Q=>()=>{f&&Q&&f("inline link viewed",{linkURL:n,linkText:A.Children.toArray(s).join(""),isNavLink:!1})},[n,s,f]),$=d.useMemo(()=>({onClick:U("citation_hover_card",C)}),[U,C]),G=d.useMemo(()=>w?w.citations.some(Q=>{const Y=y[Q-1];return Fi(Y)}):!1,[w,y]);let H;switch(r){case"_citation":{if(w?.isHidden)return null;H=l.jsx(RN,{isMemory:k,isConversationHistory:I,onCitationClick:F,className:t,str:A.Children.toArray(s).join(""),href:n,rel:"nofollow noopener",trackEvent:f,isFile:E,isMeetingTranscript:M,isDownloadable:C?Yl(C):!1,citationSize:m,getAttachmentUrl:h,citationGroup:w,enableCitationGrouping:g,citationDomain:C?.meta_data?.citation_domain_name,fileName:C?.name,webResult:C,hasPremiumSource:G,ref:i,forceExternalHandler:b});break}case"_anchor_citation":{H=l.jsx(set,{anchor:A.Children.toArray(s).join(""),className:t,ref:i,...c});break}case Kse:return!R||!x?null:l.jsx(x,{annotation:R,trackEvent:f,ref:i});default:{const{"aria-label":Q,onClick:Y,...te}=c,se=(()=>{if(!(!y?.length||!n))return y.find(le=>le.url===n)})(),ae=se!==void 0,X=!!(!ae&&r),ee=l.jsx(qh,{variant:"inline",href:n,target:o,title:X?r:void 0,rel:"nofollow noopener",ref:i,bold:!0,onTrackEvent:U("answer",se),__dangerousDoNotUseOnClick:Y,...te,children:s});ae?H=l.jsx(df,{result:se,onOpened:O(se),linkProps:$,scrollContainerRef:_,children:ee}):H=ee}}if(C){if(g&&w&&w.citations.length>1){const Y=S||[];return l.jsx($se,{webResults:Y,citationGroup:w,hideHoverCard:u,trackEvent:f,getAttachmentUrl:h,onCitationClick:p,forceExternalHandler:b,scrollContainerRef:_,children:H})}return l.jsx(df,{hideHoverCard:u,linkProps:P,result:C,trackEvent:f,timestampComponent:Gv.isRecentlyTrending(C)?l.jsx(pf,{recentlyUpdatedLabel:N({defaultMessage:"Just now",description:"Label for recently updated content",id:"FlgDFQFpF1"}),timestamp:C.meta_data?.published_date,timestampProps:L,children:"Updated"}):null,webResultCitation:T,getAttachmentUrl:h,scrollContainerRef:_,children:H})}return H},JJ),Qse=A.memo(({node:e,depth:t,children:n,ordered:r,...s})=>l.jsx("ol",{className:z("marker:text-quiet list-decimal",{"pl-8":t===0}),...s,children:n}));Qse.displayName="MdOrderedList";const Xse=A.memo(({node:e,depth:t,children:n,ordered:r,...s})=>l.jsx("ul",{className:z("marker:text-quiet list-disc",{"pl-8":t===0}),...s,children:n}));Xse.displayName="MdUnorderedList";const Zse=A.memo(({className:e,children:t,ordered:n,node:r,...s})=>{const o=`py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&>p]:pt-0 [&>p]:mb-2 [&>p]:my-0 ${e||""}`.trim();return l.jsx("li",{...s,className:o,children:t})});Zse.displayName="ListItem";const Jse=A.memo(({node:e,className:t,children:n,...r})=>l.jsx("p",{className:z("my-2 [&+p]:mt-4 [&_strong:has(+br)]:inline-block [&_strong:has(+br)]:pb-2",t),...r,children:n}));Jse.displayName="Paragraph";const aet=e=>A.memo(({children:n,node:r,...s})=>l.jsx("div",{className:z("w-full",{"md:max-w-[90vw]":!e}),children:l.jsx("pre",{className:"not-prose w-full rounded font-mono text-sm font-extralight",...s,children:n})})),iet=e=>{if(!e)return{success:!1,error:{type:"INVALID_TABLE",message:"Invalid node: expected table element"}};const n=e.outerHTML.replace("{const u=[];c.querySelectorAll("th").forEach(f=>{u.push(f.textContent?.trim()||"")}),u.length>0&&s.push({cells:u,isHeader:!0}),r=u.map(f=>f.length)}),a.forEach(c=>{const u=[];c.querySelectorAll("td").forEach(f=>{u.push(f.textContent?.trim()||"")}),u.length>0&&s.push({cells:u,isHeader:!1})}),s.forEach(c=>{c.cells.forEach((u,f)=>{f>=r.length?r.push(u.length):r[f]=Math.max(r[f]??0,u.length)})}),{success:!0,data:{markdownText:uet(s,r),htmlText:n}}},cet=e=>e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|"),uet=(e,t)=>{if(e.length===0)return"";const n=[];return e.forEach((r,s)=>{const o=[];for(let a=0;a"-".repeat(i)).join(" | ")} |`;n.push(a)}}),n.join(` -`)},eoe=A.memo(function(t){const{isDisabled:n,tableRef:r,trackEvent:s}=t,{$t:o}=J(),[a,i]=d.useState(!1),{openToast:c}=hn(),u=d.useCallback(async()=>{i(!0);try{if(!r.current)throw new Error("Table element not found");const f=iet(r.current);if(!f.success){Hc.error("Failed to convert table to clipboard format:",f.error.message),c({message:o({defaultMessage:"Failed to copy table",id:"6PLluVvMhZ"}),description:o({defaultMessage:"Table format is invalid",id:"LSnhEoAVyJ"}),variant:"error",timeout:5});return}const{markdownText:m,htmlText:p}=f.data;await xze(m,p),s?.("clicked copy table",{source:"markdown"}),c({message:o({defaultMessage:"Table copied to clipboard",id:"cPHpHA3m/M"}),variant:"success",timeout:5})}catch(f){Hc.error("Failed to copy rich text:",f),c({message:o({defaultMessage:"Failed to copy table to clipboard",id:"GqiB7jDhXC"}),variant:"error",timeout:5})}finally{i(!1)}},[o,c,r,s]);return l.jsx(Te.div,{className:"flex",animate:{opacity:n?0:1},children:l.jsx(st,{disabled:n||a,icon:B("copy"),onClick:u,size:"small",clickFeedback:!0,toolTip:o({defaultMessage:"Copy table",id:"uU7t5KxHne"}),variant:"noBackground",extraCSS:"aspect-square"})})});eoe.displayName="CopyTableButton";function det({csvString:e,filename:t="perplexity.csv"}){if(typeof window>"u")throw new Error("Attempting to download a CSV file in a server context.");try{const n=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=window.URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s)}catch(n){throw n}}function toe(){return d.useCallback(e=>{det(e)},[])}class kk{static stringArrayToCSV(t){return t.map(this.escapeCSVString).join(",")}static escapeCSVString(t){return`"${t.replace(/"/g,'""')}"`}static tableToCSV(t){if(t.tagName!=="table")throw new Error("Attempting to convert node of wrong tagName to CSV from 'table'");try{const n=[];let r="";return ur(t,{tagName:"thead"},s=>{const o=[];ur(s,{tagName:"th"},a=>{const i=qO(a);o.push(i)}),n.push(this.stringArrayToCSV(o)),r+=o.join("-").replace(/[^a-z0-9\\-]/gi,"")}),ur(t,{tagName:"tbody"},s=>{ur(s,{tagName:"tr"},o=>{const a=[];ur(o,{tagName:"td"},i=>{const c=qO(i);a.push(c)}),n.push(this.stringArrayToCSV(a))})}),{csvString:n.join(` -`),filename:r}}catch(n){throw new Error(`Error attempting to convert table node to CSV string: ${n}`)}}}const qO=e=>{const t=[];let n="";ur(e,[{type:"text"},{tagName:"br"},{tagName:"a"}],s=>{if(s.type==="element"&&s.tagName==="br"){t.push(` -`);return}s.type==="element"&&s.tagName==="a"&&s.properties?.href&&(n=String(s.properties.href)),s.type==="text"&&t.push(s.value.trim())});const r=t.join("");return r?r.replace(/\s*\[\d+\]\s*/g," ").replace(/[ \t]+/g," ").trim():n},noe=A.memo(function(t){const{isFinal:n,tableNode:r,trackEvent:s}=t,o=toe(),{$t:a}=J(),i=d.useCallback(()=>{const c=kk.tableToCSV(r);o(c),s?.("clicked download table as csv",{source:"markdown"})},[o,r,s]);return l.jsx(Te.div,{className:"flex",animate:{opacity:n?1:0},children:l.jsx(st,{disabled:!n,icon:B("download"),onClick:i,size:"small",toolTip:a({defaultMessage:"Download CSV",id:"fBhctxdFka"}),variant:"noBackground",extraCSS:"aspect-square"})})});noe.displayName="DownloadTableAsCSV";const fet=e=>{const{embedded:t,isCSVDownloadEnabled:n=!1,isSaveTableAsFileEnabled:r=!1,isCopyTableToClipboardEnabled:s=!1,isFinal:o=!0,trackEvent:a}=e;return A.memo(({node:c,...u})=>{const f=A.useRef(null),m=(n||r)&&o;return l.jsxs("div",{className:"group relative",children:[l.jsx(K,{className:z("w-full overflow-x-auto",{"md:max-w-[90vw]":!t}),children:l.jsx("table",{ref:f,className:"border-subtler my-[1em] w-full table-auto border-separate border-spacing-0 border-l border-t",...u})}),m&&l.jsxs("div",{className:z("bg-base border-subtler shadow-subtle pointer-coarse:opacity-100 right-xs absolute bottom-0 flex rounded-lg border opacity-0 transition-opacity group-hover:opacity-100","[&>*:not(:first-child)]:border-subtle [&>*:not(:first-child)]:border-l"),children:[r&&e.saveTableAsFile&&l.jsx(e.saveTableAsFile,{isFinal:o,tableNode:c,trackEvent:a}),s&&l.jsx(eoe,{isDisabled:!o,tableRef:f,trackEvent:a}),n&&l.jsx(noe,{isFinal:o,tableNode:c,trackEvent:a})]})]})})},roe=A.memo(({node:e,isHeader:t,...n})=>l.jsx("td",{className:"px-sm border-subtler min-w-[48px] break-normal border-b border-r",...n}));roe.displayName="TableCell";const soe=A.memo(({node:e,...t})=>l.jsx("thead",{className:"bg-subtler",...t}));soe.displayName="TableHeader";const ooe=A.memo(({node:e,...t})=>l.jsx("th",{className:"border-subtler p-sm break-normal border-b border-r text-left align-top",...t}));ooe.displayName="TableHeaderCell";const met=/^$/,pet=()=>e=>{ur(e,"raw",(t,n,r)=>{n!=null&&met.test(t.value)&&r&&(r.children[n]={type:"element",tagName:"br",position:t.position,properties:{},children:[]})})},aoe=e=>e.type=="element"&&e.tagName=="span"&&e.properties?.className=="whitespace-nowrap"&&e.children.length==2,het=e=>aoe(e)?e.children[0]:e,get=()=>e=>{ur(e,{tagName:"a"},(t,n,r)=>{if(t.properties?.title!="_citation"||n===null)return ws;const s=n!=null?r?.children[n+1]:void 0;if(s?.type!="text"||s.value.charAt(0)!=".")return ws;t.properties.className=(t.properties.className||"")+" mr-[2px]",r&&n!=null&&(r.children[n]={type:"element",tagName:"span",properties:{className:"whitespace-nowrap"},children:[t,{type:"text",value:"."}]}),s.value=s.value.slice(1)})};function yet(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&Array.isArray(t.citations)?{success:!0,group:{category:t.category||"web",overflowCount:Number(t.overflowCount)||0,citations:t.citations,isGrouped:t.overflowCount>0,totalCount:t.citations.length,isHidden:!!t.isHidden}}:{success:!1}}catch{return{success:!1}}}const xet=(e,t)=>function(n){let r=0;ur(n,"element",s=>{const o=aoe(s)?het(s):s;if(o.tagName!=="a")return mf;const[a]=o.children;if(a&&a.type==="text"){const i=S4(a.value,e);if(i){const c=t.find(f=>f.index===r),u=o.data||{};if(o.data=u,u.webResult=i,u.webResultCitation=c,o.properties&&typeof o.properties=="object"&&o.properties?.dataCitationGroup){const f=o.properties.dataCitationGroup;if(f.startsWith("{")&&f.endsWith("}")){const m=yet(f);m.success&&(u.citationGroup=m.group)}}return r+=1,ws}}return ws})},vet=e=>t=>{if(!e?.length)return;const n=e[0],r=[];e.length===1?r.push({mediaItem:n,overflowCount:0}):e.length>1&&r.push({mediaItem:n,overflowCount:e.length-1});const s=r.map(({mediaItem:i,overflowCount:c})=>({type:"element",tagName:"span",properties:{className:["select-none","ml-1","inline","align-baseline"]},children:[{type:"text",value:(f=>f.url?ng(f.url):f.name||"img")(i)}],data:{mediaItem:i,allMediaItems:e,isImageCitation:!0,component:"ImageCitation",citationType:"image",overflowCount:c}})),a=(i=>{const c=i.children.slice().reverse().find(f=>f.type==="element"&&(f.tagName==="ul"||f.tagName==="ol"));if(c){const f=c.children.slice().reverse().find(m=>m.type==="element"&&m.tagName==="li");if(f){const m=f.children.slice().reverse().find(p=>p.type==="element"&&p.tagName==="p");return m||f}}const u=i.children.slice().reverse().find(f=>f.type==="element"&&f.tagName==="p");return u||null})(t);a?a.children.push(...s):t.children.push({type:"element",tagName:"span",properties:{className:["inline-flex","flex-wrap"]},children:s})},bet=()=>function(e){ur(e,"element",function(t,n,r){if(t.tagName!=="code")return;const s=!(r&&r.tagName==="pre");t.data||(t.data={}),t.properties||(t.properties={}),t.properties.inline=s})},_et=()=>{const e=(t,n)=>{for(let r=t;r{ur(t,{tagName:"p"},(n,r,s)=>{if(n.data??={},r!=null&&s){const o=e(r+1,s);n.data.nextIsParagraph=!!o&&o.type!=="comment"&&o.type!=="text"&&o.type!=="raw"&&o.type!=="link"&&o.type!=="break"&&o?.tagName=="p"}return ws})}},wet="pplx://action/",Cet="pplx-href",Eet=()=>e=>{ur(e,"element",t=>{if(t.tagName!=="a")return mf;const n=t?.properties?.href?.toString()??"";if(!n.startsWith(wet))return mf;const r=t;return r.tagName="button",r.properties={...r.properties,[Cet]:n,href:void 0,type:"button"},ws})},ket="pplx://entity_chip/",ioe=()=>e=>{ur(e,"element",t=>{if(t.tagName!=="a")return mf;const n=t?.properties?.href?.toString()??"";if(!n.startsWith(ket))return mf;const r=JJe(n);if(!r)return ws;const s=t,o=s.properties?.className,a=Array.isArray(o)?o:[o].filter(Boolean);return s.properties={...s.properties,className:[...a,"entity-chip"],[Ek]:r,title:Kse},ws})},Met=()=>e=>{ur(e,"text",(t,n,r)=>(t.value==="​"&&n!=null&&r?.children.splice(n,1),ws))},uC=/[\t ]*(?:\r?\n|\r)/g,Tet=()=>e=>{ur(e,"text",(t,n,r)=>{const s=[];let o=0;const a=t.position?.start.offset??0;uC.lastIndex=0;let i=uC.exec(t.value);for(;i;){const c=i.index;if(o!==c){const u={start:{line:1,column:1,offset:o+a},end:{line:1,column:1,offset:c+a}};s.push({type:"text",value:t.value.slice(o,c),position:u})}s.push({type:"break"}),o=c+i[0].length,i=uC.exec(t.value)}if(s.length>0&&r&&typeof n=="number"){if(otypeof e=="object"&&"text"in e,Net=(e,t,n,r,s,o,a)=>{let i=o||0;const c=t.map(u=>{const f=typeof u=="string"?u:u.text,m={start:{line:1,column:1,offset:i},end:{line:1,column:1,offset:i+f.length}};if(i+=f.length,e(f)){let p="#";return a&&(p=a(f)??""),{type:"link",url:p,title:s,children:[{type:"text",value:f,position:m}],...Aet(u)&&u.metadata?.citationGroup&&{data:{citationGroup:u.metadata.citationGroup,hProperties:{dataCitationGroup:JSON.stringify(u.metadata.citationGroup)}}}}}return{type:"text",value:f,position:m}});return r.children.splice(n,1,...c),n+c.length},KO=(e,t)=>({offset:(e.offset??0)+(t.offset??0),line:e.line+t.line-1,column:e.line==1?e.column+t.column-1:e.column}),loe=(e,t,n=2)=>{n<0||e.position&&(e.position.start=KO(e.position.start,t),e.position.end=KO(e.position.end,t),e.children?.forEach(r=>loe(r,t,n-1)))},Ret=(e,t)=>{const n=e[0]??"",r=parseInt(n.replace(/[[\]]/g,""),10),s=S4(n,t);return{citation:n,number:r,webResult:s,groupCategory:Det(s),startIndex:e.index,endIndex:e.index+n.length}},Det=e=>e?e.is_memory?"memory":e.is_attachment?"attachment":e.url&&Ji(e.url)?"youtube":"web":"web",jet=e=>{if(e.length===0)return[];const t=e[0],n=[];let r=[t];for(let s=1;s{if(e.length<=1)return e;const t=e.reduce((n,r)=>{const s=r.groupCategory==="conversation_history"?"web":r.groupCategory;return n.has(s)?n.get(s).members.push(r):n.set(s,{representative:r,members:[r]}),n},new Map);return e.map(n=>{const r=n.groupCategory==="conversation_history"?"web":n.groupCategory,s=t.get(r),o=n===s.representative;return{...n,groupMetadata:{isGroupRepresentative:o,groupCategory:n.groupCategory,groupSize:o?s.members.length:1,groupCitations:s.members.map(a=>a.number)}}})},Pet=(e,t)=>{const n=[];let r=0;for(const s of t){const o=!s.groupMetadata||s.groupMetadata.isGroupRepresentative;if(s.startIndex>r){const a=e.slice(r,s.startIndex);a&&n.push(a)}n.push({text:s.citation,metadata:{citationGroup:{category:s.groupCategory,overflowCount:s.groupMetadata&&o?s.groupMetadata.groupSize-1:0,citations:s.groupMetadata?s.groupMetadata.groupCitations:[s.number],isHidden:s.groupMetadata&&!o}}}),r=s.endIndex}if(r{let{web_results:t,isAnchorLink:n,enableGrouping:r=!1}=e;t=Array.isArray(t)?t:[];const s=(i,c,u,f,m)=>Net(p=>typeof p=="string"?m?.has(p)??hp.test(p):p.text?hp.test(p.text):!1,i,c,u,n?"_anchor_citation":"_citation",f,p=>{const h=typeof p=="string"?p:p.text;return S4(h,t)?.url??""}),o=(i,c)=>{if(c.length===0)return[i];const u=[];let f=0;for(const m of c)m.index>f&&u.push(i.slice(f,m.index)),u.push(m[0]),f=m.index+m[0].length;return f{ur(i,"text",(c,u,f)=>{if(!f||u==null||a.has(c))return ws;a.add(c);const m=[...c.value.matchAll(new RegExp(hp,"g"))];if(m.length===0)return ws;const p=new Set(m.map(g=>g[0]));if(f?.type==="link"&&c.value==f.url){const g=o(c.value,m);return f.url=g[0],ws}if(r){const g=m.map(v=>Ret(v,t)),y=jet(g),x=Pet(c.value,y);return s(x,u,f,c.position?.start.offset,p)}const h=o(c.value,m);return s(h,u,f,c.position?.start.offset,p)})}},Let=()=>e=>{ur(e,"list",t=>{t.spread=!0})},Fet=new RegExp('(?()`])(https?:\\/\\/[^\\s[\\]<>()"`]+)(?:\\[\\d+\\])+',"g"),Bet=/\[(https?:\/\/[^\s[\]<>()"`]+)\](?!\()/g,Uet=/\uff08(https?:\/\/[^\s[\]<>()"`\uff08\uff09]+)\uff09/g,Vet=/\*\*(https?:\/\/[^\s*<>()"`]+)\*\*/g,Het=new RegExp(C4.source+"|"+qH.source,"g"),Mk=(e,t)=>{if(typeof e!="string")return e;const n=e.replace(Uet,(r,s)=>`([${s}](${s}))`).replace(Fet,(r,s)=>`<${s}>${r.slice(s.length)}`).replace(Bet,(r,s)=>`[${s}](${s})`).replace(Vet,(r,s)=>`[**${s}**](${s})`);return t?n:n.replace(Het,"")};function zet(e,t){return function(...r){const s=e(...r);return function(o,a){try{return s(o,a)}catch(i){i.message.startsWith("KaTeX parse error")}return o}}}const coe=(function(e){if(e==null)return $et;if(typeof e=="string")return Get(e);if(typeof e=="object")return Wet(e);if(typeof e=="function")return DN(e);throw new Error("Expected function, string, or array as `test`")});function Wet(e){const t=[];let n=-1;for(;++n0&&(o.properties.rel=[...p]),h&&(o.properties.target=h),f){const y=Hm(t.contentProperties,o)||{};o.children.push({type:"element",tagName:"span",properties:Bc(y),children:Bc(f)})}}}})}}function Hm(e,t){return typeof e=="function"?e(t):e}function YO(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function ttt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ntt(e,t,n){const s=wb((n||{}).ignore||[]),o=rtt(t);let a=-1;for(;++a0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=w+1:(g!==w&&b.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(C)?b.push(...C):C&&b.push(C),g=w+_[0].length,v=!0),!p.global)break;_=p.exec(u.value)}return v?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=YO(e,"(");let o=YO(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function uoe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||tu(n)||vb(n))&&(!t||n!==47)}doe.peek=ktt;function xtt(){this.buffer()}function vtt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function btt(){this.buffer()}function _tt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function wtt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ctt(e){this.exit(e)}function Stt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ett(e){this.exit(e)}function ktt(){return"["}function doe(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const a=n.enter("footnoteReference"),i=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),i(),a(),o+=s.move("]"),o}function Mtt(){return{enter:{gfmFootnoteCallString:xtt,gfmFootnoteCall:vtt,gfmFootnoteDefinitionLabelString:btt,gfmFootnoteDefinition:_tt},exit:{gfmFootnoteCallString:wtt,gfmFootnoteCall:Ctt,gfmFootnoteDefinitionLabelString:Stt,gfmFootnoteDefinition:Ett}}}function Ttt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:doe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,a){const i=o.createTracker(a);let c=i.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return c+=i.move(o.safe(o.associationId(r),{before:c,after:"]"})),f(),c+=i.move("]:"),r.children&&r.children.length>0&&(i.shift(4),c+=i.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,i.current()),t?foe:Att))),u(),c}}function Att(e,t,n){return t===0?e:foe(e,t,n)}function foe(e,t,n){return(n?"":" ")+e}const Ntt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];moe.peek=Ptt;function Rtt(){return{canContainEols:["delete"],enter:{strikethrough:jtt},exit:{strikethrough:Itt}}}function Dtt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ntt}],handlers:{delete:moe}}}function jtt(e){this.enter({type:"delete",children:[]},e)}function Itt(e){this.exit(e)}function moe(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function Ptt(){return"~"}function Ott(e){return e.length}function Ltt(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Ott,o=[],a=[],i=[],c=[];let u=0,f=-1;for(;++fu&&(u=e[f].length);++vc[v])&&(c[v]=_)}y.push(b)}a[f]=y,i[f]=x}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=b),h[m]=b),p[m]=_}a.splice(1,0,p),i.splice(1,0,h),f=-1;const g=[];for(;++f "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Utt);return s(),a}function Utt(e,t,n){return">"+(n?"":" ")+e}function Vtt(e,t){return XO(e,t.inConstruct,!0)&&!XO(e,t.notInConstruct,!1)}function XO(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=o):o=1,s=r+t.length,r=n.indexOf(t,s);return a}function Htt(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ztt(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Wtt(e,t,n,r){const s=ztt(n),o=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(Htt(e,n)){const m=n.enter("codeIndented"),p=n.indentLines(o,Gtt);return m(),p}const i=n.createTracker(r),c=s.repeat(Math.max(poe(o,s)+1,3)),u=n.enter("codeFenced");let f=i.move(c);if(e.lang){const m=n.enter(`codeFencedLang${a}`);f+=i.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...i.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${a}`);f+=i.move(" "),f+=i.move(n.safe(e.meta,{before:f,after:` -`,encode:["`"],...i.current()})),m()}return f+=i.move(` -`),o&&(f+=i.move(o+` -`)),f+=i.move(c),u(),f}function Gtt(e,t,n){return(n?"":" ")+e}function jN(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $tt(e,t,n,r){const s=jN(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),i(),!e.url||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),i(),e.title&&(i=n.enter(`title${o}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),a(),u}function qtt(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Nh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function U2(e,t,n){const r=ff(e),s=ff(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}hoe.peek=Ktt;function hoe(e,t,n,r){const s=qtt(n),o=n.enter("emphasis"),a=n.createTracker(r),i=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:i,...a.current()}));const u=c.charCodeAt(0),f=U2(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Nh(u)+c.slice(1));const m=c.charCodeAt(c.length-1),p=U2(r.after.charCodeAt(0),m,s);p.inside&&(c=c.slice(0,-1)+Nh(m));const h=a.move(s);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},i+c+h}function Ktt(e,t,n){return n.options.emphasis||"*"}function Ytt(e,t){let n=!1;return ur(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,bk}),!!((!e.depth||e.depth<3)&&vN(e)&&(t.options.setext||n))}function Qtt(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Ytt(e,n)){const f=n.enter("headingSetext"),m=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),f(),p+` -`+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` -`))+1))}const a="#".repeat(s),i=n.enter("headingAtx"),c=n.enter("phrasing");o.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(u)&&(u=Nh(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),i(),u}goe.peek=Xtt;function goe(e){return e.value||""}function Xtt(){return"<"}yoe.peek=Ztt;function yoe(e,t,n,r){const s=jN(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),i(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),i(),e.title&&(i=n.enter(`title${o}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),u+=c.move(")"),a(),u}function Ztt(){return"!"}xoe.peek=Jtt;function xoe(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const i=n.createTracker(r);let c=i.move("![");const u=n.safe(e.alt,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return a(),n.stack=f,o(),s==="full"||!u||u!==m?c+=i.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function Jtt(){return"!"}voe.peek=ent;function voe(e,t,n){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}_oe.peek=tnt;function _oe(e,t,n,r){const s=jN(n),o=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let i,c;if(boe(e,n)){const f=n.stack;n.stack=[],i=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),i(),n.stack=f,m}i=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${o}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),i(),u}function tnt(e,t,n){return boe(e,n)?"<":"["}woe.peek=nnt;function woe(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const i=n.createTracker(r);let c=i.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return a(),n.stack=f,o(),s==="full"||!u||u!==m?c+=i.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function nnt(){return"["}function IN(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function rnt(e){const t=IN(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function snt(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Coe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ont(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?snt(n):IN(n);const i=e.ordered?a==="."?")":".":rnt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Coe(n)===a&&f){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const i=n.createTracker(r);i.move(o+" ".repeat(a-o.length)),i.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,i.current()),f);return c(),u;function f(m,p,h){return p?(h?"":" ".repeat(a))+m:(h?o:o+" ".repeat(a-o.length))+m}}function lnt(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),s(),a}const cnt=wb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function unt(e,t,n,r){return(e.children.some(function(a){return cnt(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function dnt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Soe.peek=fnt;function Soe(e,t,n,r){const s=dnt(n),o=n.enter("strong"),a=n.createTracker(r),i=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:i,...a.current()}));const u=c.charCodeAt(0),f=U2(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Nh(u)+c.slice(1));const m=c.charCodeAt(c.length-1),p=U2(r.after.charCodeAt(0),m,s);p.inside&&(c=c.slice(0,-1)+Nh(m));const h=a.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},i+c+h}function fnt(e,t,n){return n.options.strong||"*"}function mnt(e,t,n,r){return n.safe(e.value,r)}function pnt(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function hnt(e,t,n){const r=(Coe(n)+(n.options.ruleSpaces?" ":"")).repeat(pnt(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Eoe={blockquote:Btt,break:ZO,code:Wtt,definition:$tt,emphasis:hoe,hardBreak:ZO,heading:Qtt,html:goe,image:yoe,imageReference:xoe,inlineCode:voe,link:_oe,linkReference:woe,list:ont,listItem:int,paragraph:lnt,root:unt,strong:Soe,text:mnt,thematicBreak:hnt};function gnt(){return{enter:{table:ynt,tableData:JO,tableHeader:JO,tableRow:vnt},exit:{codeText:bnt,table:xnt,tableData:pC,tableHeader:pC,tableRow:pC}}}function ynt(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function xnt(e){this.exit(e),this.data.inTable=void 0}function vnt(e){this.enter({type:"tableRow",children:[]},e)}function pC(e){this.exit(e)}function JO(e){this.enter({type:"tableCell",children:[]},e)}function bnt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_nt));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _nt(e,t){return t==="|"?t:e}function wnt(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:c,tableRow:i}};function a(h,g,y,x){return u(f(h,y,x),h.align)}function i(h,g,y,x){const v=m(h,y,x),b=u([v]);return b.slice(0,b.indexOf(` -`))}function c(h,g,y,x){const v=y.enter("tableCell"),b=y.enter("phrasing"),_=y.containerPhrasing(h,{...x,before:o,after:o});return b(),v(),_}function u(h,g){return Ltt(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function f(h,g,y){const x=h.children;let v=-1;const b=[],_=g.enter("table");for(;++v0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Unt={tokenize:Knt,partial:!0};function Vnt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gnt,continuation:{tokenize:$nt},exit:qnt}},text:{91:{name:"gfmFootnoteCall",tokenize:Wnt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Hnt,resolveTo:znt}}}}function Hnt(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return i;function i(c){if(!a||!a._balanced)return n(c);const u=pa(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function znt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},i=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...i),e}function Wnt(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return i;function i(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){if(o>999||m===93&&!a||m===null||m===91||Nn(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(pa(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Nn(m)||(a=!0),o++,e.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}}function Gnt(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,i;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(g)}function f(g){if(a>999||g===93&&!i||g===null||g===91||Nn(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return o=pa(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Nn(g)||(i=!0),a++,e.consume(g),g===92?m:f}function m(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ut(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return t(g)}}function $nt(e,t,n){return e.check(Kg,t,e.attempt(Unt,t,n))}function qnt(e){e.exit("gfmFootnoteDefinition")}function Knt(e,t,n){const r=this;return Ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function Ynt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,i){let c=-1;for(;++c1?c(g):(a.consume(g),m++,h);if(m<2&&!n)return c(g);const x=a.exit("strikethroughSequenceTemporary"),v=ff(g);return x._open=!v||v===2&&!!y,x._close=!y||y===2&&!!v,i(g)}}}class Qnt{constructor(){this.map=[]}add(t,n,r){Xnt(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const o of s)t.push(o);s=r.pop()}this.map.length=0}}function Xnt(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const j=r.events[M][1].type;if(j==="lineEnding"||j==="linePrefix")M--;else break}const N=M>-1?r.events[M][1].type:null,D=N==="tableHead"||N==="tableRow"?C:c;return D===C&&r.parser.lazy[r.now().line]?n(I):D(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):ot(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),h):n(I):Kt(I)?Ut(e,f,"whitespace")(I):(o+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||Nn(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:m)}function p(I){return I===92||I===124?(e.consume(I),m):m(I)}function h(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Kt(I)?Ut(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?x(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):S(I)}function y(I){return Kt(I)?Ut(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),v):I===45?(o+=1,v(I)):I===null||ot(I)?w(I):S(I)}function v(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):S(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Kt(I)?Ut(e,w,"whitespace")(I):w(I)}function w(I){return I===124?g(I):I===null||ot(I)?!a||s!==o?S(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):S(I)}function S(I){return n(I)}function C(I){return e.enter("tableRow"),E(I)}function E(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),E):I===null||ot(I)?(e.exit("tableRow"),t(I)):Kt(I)?Ut(e,E,"whitespace")(I):(e.enter("data"),T(I))}function T(I){return I===null||I===124||Nn(I)?(e.exit("data"),E(I)):(e.consume(I),I===92?k:T)}function k(I){return I===92||I===124?(e.consume(I),T):T(I)}}function trt(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],a=[0,0,0,0],i=!1,c=0,u,f,m;const p=new Qnt;for(;++nn[2]+1){const g=n[2]+1,y=n[3]-n[2]-1;e.add(g,y,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(o.end=Object.assign({},Xu(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function tL(e,t,n,r,s){const o=[],a=Xu(t.events,n);s&&(s.end=Object.assign({},a),o.push(["exit",s,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Xu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const nrt={name:"tasklistCheck",tokenize:srt};function rrt(){return{text:{91:nrt}}}function srt(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return Nn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):n(c)}function i(c){return ot(c)?t(c):Kt(c)?e.check({tokenize:ort},t,n)(c):n(c)}}function ort(e,t,n){return Ut(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function art(e){return fse([Rnt(),Vnt(),Ynt(e),Jnt(),rrt()])}const irt={};function lrt(e){const t=this,n=e||irt,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(art(n)),o.push(Mnt()),a.push(Tnt(n))}function crt(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:i,mathText:a,mathTextData:i}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function t(){this.buffer()}function n(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=u;const m=f.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=u,f.data.hChildren.push({type:"text",value:u})}function i(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function urt(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,a,i,c){const u=o.value||"",f=i.createTracker(c),m="$".repeat(Math.max(poe(u,"$")+1,2)),p=i.enter("mathFlow");let h=f.move(m);if(o.meta){const g=i.enter("mathFlowMeta");h+=f.move(i.safe(o.meta,{after:` -`,before:h,encode:["$"],...f.current()})),g()}return h+=f.move(` -`),u&&(h+=f.move(u+` -`)),h+=f.move(m),p(),h}function r(o,a,i){let c=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const f="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++mimport("./index-Dg6q9Si7.js"),__vite__mapDeps([459,460,461,3,4,1,8,9,6,7,10,11,12])),q(()=>import("./katex-CmGQIWW6.js").then(t=>t.a),__vite__mapDeps([460,461]))]).then(([{default:t}])=>{const n=e?[zet(t),{throwOnError:!0}]:[t,{throwOnError:!1}];return ky=n,n}),y1)}const Trt=({final:e,renderFollowUps:t,renderCitations:n,webResults:r,webResultCitations:s,imageCitations:o,inlineTokenAnnotations:a})=>{const[i,c]=d.useState(ky?{...sL,rehypeKatex:ky}:sL);return d.useEffect(()=>{ky||Mrt(e).then(f=>{c(m=>({...m,rehypeKatex:f}))})},[e]),d.useMemo(()=>[...Object.values({...i,rehypePPLXActionLinks:t?Eet:null,rehypeCitations:n?[xet,r,s??[]]:null,rehypeImageCitations:o?.length?[vet,o]:null,rehypePPLXEntityLinks:Object.keys(a??{}).length>0?ioe:null}).filter(f=>f!==null),Met],[i,t,n,r,s,o,a])};function hC(e,t){const{animateIn:n=!0,once:r=!0}=t??{},{device:{isIOS:s}}=sn(),o=!s&&n,a=d.useMemo(()=>o?c=>{const u=Zl(!0),f={...c,className:z(c.className,{"animate-in fade-in-25 duration-700":!(r&&u)})};return l.jsx(e,{...f})}:void 0,[e,r,o]);return!o||!a?e:a}const Poe="prose dark:prose-invert inline leading-relaxed break-words min-w-0 [word-break:break-word] prose-strong:font-medium [&_>*:first-child]:mt-0",Art=d.memo(Qse),Nrt=d.memo(Xse),Rrt=d.memo(soe),Drt=d.memo(roe),jrt=d.memo(ooe),Irt=d.memo(qJe),Prt=d.memo(KJe),x1=d.memo(YJe),Ort=d.memo(Use),Ooe=({str:e,final:t=!1,webResults:n,inlineTokenAnnotations:r,embedded:s=!1,wrapInParent:o=!0,animateIn:a=!1,isAnchorLink:i=!1,testId:c,trackEvent:u,renderCitations:f=!0,enableCitationGrouping:m=!1,experiments:p={},markdownComponents:h={},citationSize:g="default",renderFollowUps:y=!0,webResultCitations:x,imageCitations:v,saveTableAsFile:b,onCitationClick:_,getAttachmentUrl:w,forceExternalHandler:S,openGallery:C,scrollContainerRef:E})=>{const{Paragraph:T=Jse,ListItem:k=Zse,Button:I=Fse,EntityChip:M}=h,{hideHoverCard:N,isDownloadTableAsCSVEnabled:D,isSaveTableAsFileEnabled:j,isCopyTableToClipboardEnabled:F}=p,R=d.useMemo(()=>{let re;return ce=>(Un(re,ce,Un)||(re=ce),re)},[]),P=d.useMemo(()=>{let re;return ce=>(Un(re,ce,Un)||(re=ce),re)},[]),L=R(n),U=P(x),O=d.useMemo(()=>r?.reduce((re,ce)=>(re[ce.id]=ce,re),{}),[r]),$=d.useMemo(()=>Ioe.concat([f&&[Oet,{web_results:L,isAnchorLink:i,enableGrouping:m}],Let].filter(Boolean)),[f,L,i,m]),G=Trt({final:t,renderFollowUps:y,renderCitations:f,webResults:L,webResultCitations:U,imageCitations:v,inlineTokenAnnotations:O}),H=hC(T,{animateIn:a,once:!1}),Q=hC(k,{animateIn:a,once:!1}),Y=hC(Vse,{animateIn:a}),te=d.useMemo(()=>fet({embedded:s,isCSVDownloadEnabled:D,isSaveTableAsFileEnabled:j,isCopyTableToClipboardEnabled:F,isFinal:t,trackEvent:u,saveTableAsFile:b}),[s,D,j,F,t,u,b]),se=d.useMemo(()=>$Je({trackEvent:u}),[u]),ae=d.useMemo(()=>({hideHoverCard:N,trackEvent:u,citationSize:g,onCitationClick:_,getAttachmentUrl:w,enableCitationGrouping:m,webResults:L,inlineTokenAnnotationsLookup:O,EntityChipComponent:M,forceExternalHandler:S,scrollContainerRef:E}),[N,u,g,_,w,m,L,M,S,O,E]),X=d.useMemo(()=>({children:ce,className:ue,node:me,...we})=>me?.data?.isImageCitation&&me?.data?.component==="ImageCitation"?l.jsx(Lse,{mediaItem:me.data.mediaItem,allMediaItems:me.data.allMediaItems,overflowCount:me.data.overflowCount||0,className:Array.isArray(ue)?ue.join(" "):ue,openGallery:C}):l.jsx("span",{className:Array.isArray(ue)?ue.join(" "):ue,...we,children:ce}),[C]),ee=d.useMemo(()=>aet(s),[s]),le=d.useMemo(()=>({p:H,ol:Art,hr:Ort,ul:Nrt,li:Q,table:te,thead:Rrt,td:Drt,th:jrt,pre:ee,code:se,img:Y,a:oet,h1:Irt,h2:Prt,h3:x1,h4:x1,h5:x1,h6:x1,button:I,span:X}),[H,Q,te,se,Y,ee,I,X]);return l.jsx(Mr,{fallback:null,children:l.jsx(Yse.Provider,{value:ae,children:l.jsx(HJe,{className:o?Poe:void 0,remarkPlugins:$,rehypePlugins:G,unwrapDisallowed:!0,components:le,"data-test-id":c,children:Mk(e,f)})})})},Loe=A.memo(Ooe,({webResults:e,inlineTokenAnnotations:t,...n},{webResults:r,inlineTokenAnnotations:s,...o})=>{const a=t?.length===s?.length&&!!t?.every((i,c)=>i.progress===s?.[c]?.progress);return Un(n,o)&&Un(e,r,Un)&&a});Loe.displayName="MarkdownRenderer";const Lrt=e=>{let t=0;return r=>{const s=[];for(;e.length;){const o=e.shift();if(t+=o.length,t>=r){s.push(o.slice(0,o.length+r-t));const a=o.slice(o.length+r-t);a&&(e.unshift(a),t-=a.length);break}s.push(o)}return s}},oL=Ise().use(Ese).use(Ioe);function aL(e,t){const n=oL.runSync(oL.parse(e),e);return t&&loe(n,t),n}const Frt=/(\s+)/g,Brt=[/(\*\*)/g,/(__)/g],Urt=10;function Vrt(e,t){if(!e.children.every(o=>{const a=o.position?.start.offset,i=o.position?.end.offset;return(a||a==0)&&(i||i==0)}))return[t];const n=o=>{Brt.forEach(a=>{const c=o.join("").split(a);if((c.length-1)/2%2==1){const f=c.pop(),m=c.pop();if((f.split(Frt).length+1)/2=0;g--){const y=o[g],x=y.length-h;if(x>0){o[g]=y.slice(0,x);break}else o.pop(),h-=y.length}}}})},r=Lrt(t),s=[];return e.children.forEach((o,a)=>{r(o.position?.start.offset);const i=r(o.position?.end.offset);a==e.children.length-1&&n(i),s.push(i)}),s}const Foe=({chunks:e,webResults:t,embedded:n,rendererProps:r,testId:s,webResultCitations:o,imageCitations:a,onCitationClick:i,enableCitationGrouping:c,inlineTokenAnnotations:u})=>{const f=d.useMemo(()=>{let m,p=[],h="";return g=>{const y=g.slice(),x=p.every((b,_)=>b==y[_]),v=y.slice(p.length);if(!x||!m||!m.children.length)h=Mk(y.join(""),!0),m=aL(h);else{const b=m.children.pop(),_=h.slice(b.position?.start.offset),w=Mk(v.join(""),!0),S=_+w;h=h.slice(0,b.position?.start.offset)+S;const C=aL(S,b.position?.start);m.children.push(...C.children)}return p=y.slice(),Vrt(m,[h])}},[]);return l.jsx("div",{className:Poe,"data-test-id":s,children:f(e).map((m,p)=>l.jsx(A.Fragment,{children:l.jsx(Loe,{str:m.join(""),webResults:t,final:!1,embedded:n,wrapInParent:!1,animateIn:!0,onCitationClick:i,...r,webResultCitations:o,imageCitations:a,enableCitationGrouping:c,inlineTokenAnnotations:u})},p))})},Hrt=A.memo(Foe,({webResults:e,chunks:t,...n},{webResults:r,chunks:s,...o})=>Un(n,o)&&Un(e,r,Un)&&Un(t,s,Un));Hrt.displayName="MarkdownStreamer";const zrt=40,Wrt=40,Grt=10,$rt=e=>e.previousSibling?e.previousSibling:e.parentNode?e.parentNode.previousSibling:null,My=512,qrt=e=>{const t=e.startContainer,n=e.startOffset;if(t.nodeType!==Node.TEXT_NODE)return["",""];let r=t.textContent?.slice(0,n)||"",s=r,o=!1,a=t;for(let i=0;i<10&&(a=$rt(a),!(!a||r.length>My));i++){if(a.nodeType===Node.TEXT_NODE&&a.textContent===` -`&&(o=!0),a.nodeType===Node.TEXT_NODE)r=(a.textContent||"")+r;else if(a.nodeType===Node.ELEMENT_NODE){const c=/^\d+\.$/,u=/^\d+\.?$/;c.test(a.textContent||"")?r="."+r:u.test(a.textContent||"")||(r=a.textContent+r)}o||(s=r)}return s.length>My?r=s:r=r.slice(-My),[s,r]},Krt=e=>e.nextSibling?e.nextSibling:e.parentNode?e.parentNode.nextSibling:null,Yrt=e=>{const t=e.endContainer,n=e.endOffset;if(t.nodeType!==Node.TEXT_NODE)return"";let r=t.textContent?.slice(n)||"",s=t;for(let o=0;o<5&&(s=Krt(s),!(!s||s.nodeType===Node.TEXT_NODE&&s.textContent===` -`));o++)s.nodeType===Node.TEXT_NODE?r+=s.textContent:s.nodeType===Node.ELEMENT_NODE&&/^\d+\.$/.test(s.textContent||"")&&(r+=".");return r.slice(0,My)},Boe=A.memo(({embedded:e,isAnchorLink:t,isPending:n=!1,rendererTestId:r,response:s,streamerTestId:o,trackEvent:a,renderCitations:i=!0,experiments:c,markdownComponents:u,wrapInParent:f=!0,citationSize:m="default",webResultCitations:p,imageCitations:h,onCheckSources:g,onQuoteSelect:y,onOpenInSideDocument:x,saveTableAsFile:v,onCitationClick:b,getAttachmentUrl:_,enableCitationGrouping:w=!1,ref:S,forceExternalHandler:C,openGallery:E,scrollContainerRef:T})=>{const k=J(),I=d.useRef(null),M=d.useRef(null),[N,D]=d.useState(void 0),[j,F]=d.useState(void 0),R=k.formatMessage({defaultMessage:"Check sources",id:"AxT33TYx0b"}),P=k.formatMessage({defaultMessage:"Add to follow-up",id:"EgzsNJ7SZP"}),L=g||y||x,U=d.useCallback(()=>{if(!L)return;F(void 0);const X=window.getSelection();if(!X||!X.toString().trim()||!I.current){F(void 0);return}if(!I.current.contains(X.anchorNode)||!I.current.contains(X.focusNode)){F(void 0);return}const ee=X.getRangeAt(0),le=ee.getClientRects();if(le.length===0){F(void 0);return}const re=le[0],ue=le[le.length-1].bottom-re.top,me=ee.cloneContents();me.querySelectorAll(".select-none").forEach(Ee=>Ee.remove());const ye=me.textContent?.trim(),_e=I.current.getBoundingClientRect(),[ke,De]=qrt(ee),xe=ye||X.toString(),Ue=Yrt(ee);F({rect:re,relativeTop:re.top-_e.top,relativeLeft:re.left-_e.left,quote:{extendedBeforeContext:De,beforeContext:ke,selectedText:xe,afterContext:Ue},totalHeight:ue})},[L]),O=d.useCallback(()=>{const X=window.getSelection();(!X||!X.toString().trim())&&F(void 0)},[]);d.useEffect(()=>{if(L)return document.addEventListener("mouseup",U),document.addEventListener("selectionchange",O),()=>{document.removeEventListener("mouseup",U),document.removeEventListener("selectionchange",O)}},[U,O,L]);const $=d.useCallback(()=>{if(y&&j?.quote){const X=j?.quote.selectedText.trim();window.getSelection()?.removeAllRanges(),F(void 0),y(X),a?.("click quote reply",{selectedText:X})}},[j?.quote,y,a]),G=d.useCallback(()=>{g&&j?.quote&&(window.getSelection()?.removeAllRanges(),F(void 0),g(j?.quote),a?.("click check sources",{extendedBeforeContext:j?.quote.extendedBeforeContext,beforeContext:j?.quote.beforeContext,selectedText:j?.quote.selectedText,afterContext:j?.quote.afterContext}))},[j?.quote,g,a]);d.useEffect(()=>{j?.rect&&M.current&&D(M.current.getBoundingClientRect().width)},[j?.rect]);const H=d.useCallback(()=>{x&&j?.quote&&(x(j?.quote),F(void 0),a?.("click open in document",{extendedBeforeContext:j?.quote.extendedBeforeContext,beforeContext:j?.quote.beforeContext,selectedText:j?.quote.selectedText,afterContext:j?.quote.afterContext}))},[j?.quote,x,a]),Q=(X,ee=0,le=0)=>X?ee+le+Grt:ee-zrt,te=(()=>{if(!j?.rect||!I.current||!N)return null;const X=I.current.getBoundingClientRect(),ee=Math.min(j.relativeLeft||0,X.width-N),le=(j.relativeTop||0)({experiments:c,markdownComponents:u,citationSize:m,forceExternalHandler:C,renderCitations:i,scrollContainerRef:T}),[m,c,u,C,i,T]),ae=d.useMemo(()=>{const X=[];return y&&X.push({action:$,text:P}),g&&X.push({action:G,text:R}),x&&X.push({action:H,text:k.formatMessage({defaultMessage:"View in file",id:"owm3XhJD2c"})}),X},[y,$,P,g,G,R,x,H,k]);return l.jsxs("div",{ref:jK([I,S]),className:"relative",children:[s&&n&&s.chunks&&l.jsx(Foe,{chunks:s.chunks,webResults:s.web_results,embedded:e,testId:o,rendererProps:se,webResultCitations:p,imageCitations:h,onCitationClick:b,enableCitationGrouping:w,inlineTokenAnnotations:s.inline_token_annotations}),s&&!n&&s.answer&&l.jsx(Ooe,{str:s.answer,webResults:s.web_results,final:!0,embedded:e,isAnchorLink:t,trackEvent:a,testId:r,renderCitations:i,enableCitationGrouping:w,experiments:c,markdownComponents:u,wrapInParent:f,citationSize:m,webResultCitations:p,imageCitations:h,saveTableAsFile:v,onCitationClick:b,getAttachmentUrl:_,inlineTokenAnnotations:s.inline_token_annotations,forceExternalHandler:C,openGallery:E,scrollContainerRef:T}),ae.length>0&&j?.rect&&l.jsx("div",{ref:M,className:"absolute z-[5]",style:te||{visibility:"hidden"},children:l.jsx("div",{className:z("bg-base shadow-lg",ae.length>0?"rounded-lg":"rounded-full"),children:ae.map((X,ee)=>l.jsx(Ge,{onClick:X.action,size:"small",text:X.text,variant:"primaryGhost",extraCSS:z("border transform-none active:transform-none active:scale-100 min-w-fit whitespace-nowrap",{"rounded-l-lg dark:rounded-l-lg":ee===0,"rounded-r-none":ae.length>1&&ee!==ae.length-1,"rounded-l-none":ee>0,"rounded-r-lg dark:rounded-r-lg":ee===ae.length-1,"!border-l-0":ee>0,"!rounded-full":ae.length==1})},ee))})})]})},({response:{answer:e,web_results:t,chunks:n,inline_token_annotations:r}={},...s},{response:{answer:o,web_results:a,chunks:i,inline_token_annotations:c}={},...u})=>{const f=r?.length===c?.length&&!!r?.every((m,p)=>m.progress===c?.[p]?.progress);return Un(s,u)&&Un(e,o)&&Un(t,a,Un)&&Un(n,i,Un)&&f});Boe.displayName="MarkdownResponse";const Qrt="gap-[7px]",Xrt="w-px border-l border-subtler",Zrt={initial:({animateEntry:e})=>({opacity:0,y:e?-8:0,transition:{opacity:{duration:.15},y:{duration:e?.15:0}}}),animate:{opacity:1,y:0,transition:{opacity:{duration:.15},y:{duration:.15}}},exit:({animateExit:e})=>({opacity:0,y:e?-8:0,transition:{opacity:{duration:.12},y:{duration:e?.12:0}}})},Uoe=A.memo(({cleanTitle:e,status:t,web_results:n})=>{const r=fN(),s=d.useMemo(()=>({Paragraph:({children:a})=>a}),[]),o=d.useMemo(()=>({answer:e,web_results:n}),[e,n]);return l.jsx("span",{className:"flex grow overflow-hidden py-[6px]",children:l.jsx(V,{className:"pr-sm block [&_code]:max-h-[300px] [&_code]:overflow-auto",variant:"small",color:t==="active"?"default":"light",inline:!0,children:l.jsx(Boe,{response:o,markdownComponents:s,wrapInParent:!1,citationSize:"small",enableCitationGrouping:r})})})});Uoe.displayName="GoalTitle";const Jrt=({steps:e,status:t,trackSearchResultsStep:n,disableAnimations:r})=>{const s=d.useMemo(()=>e?yFe(e):[],[e]);return d.useMemo(()=>s?.map((o,a)=>{const i=a===(s?.length??0)-1,c=t==="finished"||!i;return l.jsx(Voe,{isFinished:c,index:a,step:o,disableAnimations:r,trackSearchResultsStep:n},`${o.uuid}-${a}`)}).filter(Boolean),[s,t,r,n])},est=A.memo(e=>{const{className:t="",title:n,status:r,steps:s,web_results:o=[],showStatus:a=!0,timelineGapClassName:i=Qrt,animateEntry:c=!0,animateExit:u=!0,placeholder:f=!1,keepNewLines:m=!1,isFinalGoal:p=!1,disableAnimations:h=!1,ref:g,...y}=e,{session:x}=Ne(),{trackEvent:v}=Xe(x),b=n.replace(/^\n+|\n+$/g,"").replace(/\n/g,m?` -`:" "),_=r==="finished"||r==="loading"?r:"planned",w=d.useCallback(I=>{v("click citation",{citation_url:I,source:"researchStep"})},[v]),S=l.jsx(Jrt,{steps:s,status:r,trackSearchResultsStep:w,disableAnimations:h}),C=!!s?.length,[E,{height:T}]=ti(),k=!u&&c&&!h;return l.jsxs(Te.div,{ref:g,className:`group/goal relative flex overflow-hidden ${t} ${i}`,role:"listitem",initial:h?!1:k?{height:0}:"initial",animate:h?!1:k?{height:T||"auto"}:"animate",exit:h?void 0:"exit",transition:h?{duration:0}:k?{duration:.1,ease:"easeOut"}:void 0,variants:h?void 0:Zrt,custom:{animateEntry:c&&!h,animateExit:u&&!h},...y,children:[l.jsx("div",{className:"flex",children:l.jsx(Qre,{status:r,state:_,showStatus:a,timelineConnectorClassName:Xrt,hasSteps:C,isFinalGoal:p})},"timeline-container"),l.jsx("div",{className:"min-w-0 grow",children:l.jsxs("div",{ref:E,className:"flex flex-col",children:[l.jsx(Uoe,{cleanTitle:b,status:r,placeholder:f,web_results:o}),C&&l.jsx("div",{className:"pb-md gap-y-sm flex w-full flex-col empty:hidden group-last/goal:pb-0",children:l.jsx(St,{children:S})})]},"content-container")})]})},(e,t)=>!["id","status","title","steps","isFinalGoal"].some(s=>!JJ(e[s],t[s]))),Voe=A.memo(({isFinished:e,index:t,step:n,disableAnimations:r,trackSearchResultsStep:s})=>{const o=n.step_type==="SEARCH_RESULTS"?s:void 0,a=d.useMemo(()=>({id:n.uuid,initial:r?!1:{opacity:0,x:-10},animate:r?!1:{opacity:1,x:0},exit:r?void 0:{opacity:0,x:10},transition:r?{duration:0}:{duration:.2,delay:t*.05,ease:Qd}}),[r,t,n.uuid]);return l.jsx(dN,{step:n,isFinished:e,onStepClick:o,motionProps:a,disableAnimations:r},`${n.uuid}-${t}`)});Voe.displayName="StepRendererFactory";const Hoe=A.memo(({visibleGoals:e,isAgentWorkflowInFlight:t,forceShowAll:n,disableAnimations:r})=>l.jsx("div",{className:"relative z-0 flex flex-col",children:l.jsxs("div",{className:"relative pl-px",children:[l.jsx(St,{mode:t&&!n?"wait":void 0,children:e.map(s=>s?l.jsx(est,{id:s.id,status:s.status,steps:s.steps,web_results:s.web_results,title:s.title,animateEntry:s.animateEntry,animateExit:!!(t&&!n),isFinalGoal:s.isFinalGoal,keepNewLines:!0,disableAnimations:s.disableAnimations||r&&s.status==="finished"},s.key):null)}),l.jsx("div",{className:"-mx-lg from-base to-base/0 absolute bottom-0 z-20 h-3 w-full bg-gradient-to-t"})]})}));Hoe.displayName="GoalsList";const tst=[],nst=({hasPendingFiles:e,attachments:t=Pe,attachment_processing_progress:n=Pe})=>{const{$t:r}=J(),s=d.useMemo(()=>e?[{description:r({defaultMessage:"Processing attachments...",id:"nCVqMMwJ07"}),final:!1,id:"pending-files-goal",steps:[{step_type:"PENDING_FILES",content:{attachments:t,attachmentProcessingProgress:n},uuid:"pending-files-step"}]}]:tst,[r,n,t,e]),o=d.useMemo(()=>!e||n.some(i=>i.file_url==="end"),[n,e]),a=d.useMemo(()=>o?null:s.length>0?s[0]:null,[o,s]);return{pendingFilesGoals:s,activePendingFileGoal:a,isFileProcessingDone:o}},rst=({researchPlan:e,reasoningPlan:t,hasAnswer:n,isProReasoningMode:r})=>{const s=t?.goals?.slice(1)??Pe,o=d.useMemo(()=>!e||n||r&&s.length>0,[e,n,r,s.length]),a=d.useMemo(()=>!t&&!r||!!t?.final,[t,r]),i=n&&a&&o,c=d.useMemo(()=>a?null:t?.goals[t.goals.length-1],[t,a]);return{reasoningGoals:s,isResearchPlanFinished:o,isReasoningPlanFinished:a,isAllPlansFinished:i,activeReasoningGoal:c}},sst=({researchPlan:e,steps:t,searchMode:n,isResearchPlanFinished:r,backendUUID:s})=>{const o=n===oe.RESEARCH,a=n===oe.STUDIO,i=ost({backendUUID:s,steps:t,isResearchPlanFinished:r}),c=ast({backendUUID:s,steps:t,isResearchPlanFinished:r}),u=d.useMemo(()=>{if(!e)return{};if(e.goals.length===1){const p=e.goals[0];return p?{[p.id]:{...p,steps:t.filter(h=>h.step_type!=="INITIAL_QUERY"&&h.step_type!=="TERMINATE")}}:{}}return e.goals.reduce((p,h)=>{const g={...h,steps:t.filter(y=>"goal_id"in y.content?y.content.goal_id===h.id&&y.step_type!=="INITIAL_QUERY"&&y.step_type!=="TERMINATE":!1)};return p[g.id]=g,p},{})},[e,t]),f=d.useMemo(()=>{const p=Object.keys(u);if(p.length===0)return null;const h=t.at(-1),g=p.at(-1);return g?((o||a)&&h?.step_type!=="TERMINATE",u[g]):null},[u,t,o,a]),m=d.useMemo(()=>[...Object.values(u),...i,...c],[u,i,c]);return d.useMemo(()=>({activeResearchGoal:f,researchGoals:m}),[f,m])},ost=({backendUUID:e,steps:t,isResearchPlanFinished:n})=>{const r=J(),{pendingClarifications:s,clearClarifications:o}=Uv(),a=d.useMemo(()=>{if(n||!e)return[];const i=new Set(t.map(f=>f.uuid)),c=new Set;return t.forEach(f=>{f.step_type==="CLARIFYING_QUESTIONS_OUTPUT"&&f.content?.clarification&&c.add(f.content.clarification)}),s.filter(f=>f.entryUUID===e&&!i.has(f.UUID)&&!c.has(f.content)).map((f,m)=>({description:f.question??r.formatMessage({defaultMessage:"I'll consider the details you added.",id:"46H8Trfeps"}),final:!1,id:`c-${m}`,steps:[{content:{goal_id:`c-${m}`,clarification:f.content,question:f.question},step_type:"CLARIFYING_QUESTIONS_OUTPUT",uuid:f.UUID}]}))},[r,s,e,n,t]);return d.useEffect(()=>{n&&s.length&&o()},[o,n,s]),a},ast=({backendUUID:e,steps:t,isResearchPlanFinished:n})=>{const r=J(),{pendingSuggestions:s,clearPendingSuggestions:o}=Uv(),a=d.useMemo(()=>{if(n||!e)return[];const i=new Set(t.map(f=>f.uuid)),c=new Set;return t.forEach(f=>{f.step_type==="IN_CONTEXT_SUGGESTIONS_OUTPUT"&&f.content?.selected_suggestion&&c.add(f.content.selected_suggestion)}),s.filter(f=>f.entryUUID===e&&!i.has(f.UUID)&&!c.has(f.suggestion)).map((f,m)=>({description:r.formatMessage({defaultMessage:"I'll refine my research based on your selection.",id:"SXOuvFDKhd"}),final:!1,id:`s-${m}`,steps:[{content:{goal_id:`s-${m}`,selected_suggestion:f.suggestion},step_type:"IN_CONTEXT_SUGGESTIONS_OUTPUT",uuid:f.UUID}]}))},[r,s,e,n,t]);return d.useEffect(()=>{n&&s.length&&o()},[o,n,s]),a},ist=({isAllPlansFinished:e,researchPlan:t,reasoningGoals:n,isStudio:r,hasPendingFiles:s,displayModel:o})=>d.useMemo(()=>o===nt.O3_PRO||o===nt.GPT5_PRO||r?!1:!(e||t||n.length>0||s),[o,r,e,t,n.length,s]),gC=e=>{const{goals:t,activeGoal:n,isPlanFinished:r,planType:s,web_results:o,skipFirstAnimation:a,$t:i}=e,c=n?t.indexOf(n):-1;return t.map((u,f)=>{const m=n?.id===u.id,p=c!==-1&&c>f||r,h=u.steps?.some(g=>g.step_type==="CLARIFYING_QUESTIONS_OUTPUT");return{...u,key:`${s}-${u.id?u.id+"-":""}${f}`,id:u.id??`${s}-${f}`,status:p?"finished":m?"loading":"planned",planType:s,animateEntry:!(f===0&&a)&&!p,web_results:o,isFinalGoal:!1,disableAnimations:h??!1,title:u?.title??u?.description??i({defaultMessage:"Thinking…",id:"P1QHV0AhYD"}),description:u?.description??null,final:!1}})},lst=()=>{const{askInputReasoningMode:e}=Vn(),{result:{backend_uuid:t,attachments:n,attachment_processing_progress:r,display_model:s},steps:o,researchPlan:a,reasoningPlan:i,hasAnswer:c,searchMode:u,isProReasoningMode:f,hasPendingFiles:m}=It(),h=rst({researchPlan:a,reasoningPlan:i,hasAnswer:c,isProReasoningMode:f??e}),g=sst({researchPlan:a,steps:o??[],searchMode:u,isResearchPlanFinished:h.isResearchPlanFinished,backendUUID:t??""}),y=nst({hasPendingFiles:m,attachments:n,attachment_processing_progress:r}),x=ist({isAllPlansFinished:h.isAllPlansFinished,researchPlan:a,reasoningGoals:h.reasoningGoals,isStudio:u===oe.STUDIO,hasPendingFiles:m,displayModel:s});return d.useMemo(()=>({...h,...g,...y,shouldShowPlaceholderGoal:x}),[h,g,x,y])},zoe={status:"finished",planType:"final",animateEntry:!1,web_results:void 0,description:null,final:!0,steps:void 0,disableAnimations:!0},cst=e=>({...zoe,key:"final-goal",id:"final-goal",title:e({defaultMessage:"Finished",id:"EQpfkSbt5q"}),isFinalGoal:!0}),ust=e=>({...zoe,key:"answer-skipped-goal",id:"answer-skipped-goal",title:e({defaultMessage:"Answer skipped",id:"0siVz43iGV"}),isFinalGoal:!1}),dst=()=>{const{$t:e}=J(),{researchPlan:t,reasoningPlan:n,isAnswerSkipped:r,isProReasoningMode:s}=It(),{reasoningGoals:o,isResearchPlanFinished:a,isReasoningPlanFinished:i,isAllPlansFinished:c,activeReasoningGoal:u,pendingFilesGoals:f,activePendingFileGoal:m,isFileProcessingDone:p,researchGoals:h,activeResearchGoal:g}=lst(),y=n?.web_results,x=d.useMemo(()=>gC({goals:f??[],activeGoal:m,isPlanFinished:p,planType:"research",web_results:void 0,skipFirstAnimation:!1,$t:e}),[f,m,p,e]),v=d.useMemo(()=>t?gC({goals:h,activeGoal:g,isPlanFinished:a,planType:"research",web_results:void 0,skipFirstAnimation:!0,$t:e}):[],[t,h,g,a,e]),b=d.useMemo(()=>s?gC({goals:o,activeGoal:u,isPlanFinished:i,planType:"reasoning",web_results:y,skipFirstAnimation:!t,$t:e}):[],[s,o,u,i,y,t,e]);return d.useMemo(()=>[...x,...v,...b,...c?[cst(e)]:[],...r?[ust(e)]:[]],[x,v,b,c,r,e])},Woe=A.memo(({isExpanded:e})=>{const{isAgentWorkflowInFlight:t,hasAnswer:n}=It(),r=dst(),s=d.useMemo(()=>{if(e)return r;if(t||n){const a=r[r.length-1];return a?[a]:[]}return[]},[r,t,n,e]);return!n||e?l.jsx(Hoe,{visibleGoals:s,isAgentWorkflowInFlight:t,forceShowAll:e,disableAnimations:e}):null});Woe.displayName="AgentWorkflowGoalProcessor";const fst=({isExpanded:e})=>{const{idx:t,result:{backend_uuid:n},inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i}=It(),c=D4(u=>u.results.find(f=>f.backend_uuid===n));return c?l.jsx(p6,{idx:t,result:c,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,children:l.jsx(Woe,{isExpanded:e})}):null},mst=Ce(async()=>{const{ProgressHeader:e}=await Se(()=>q(()=>import("./ProgressHeader-C6EaFoVg.js"),__vite__mapDeps([462,4,1,6,3,9,7,29,57,8,10,11,12])));return{default:e}}),pst=Ce(async()=>{const{StaticHeader:e}=await Se(()=>q(()=>import("./ProgressHeader-C6EaFoVg.js"),__vite__mapDeps([462,4,1,6,3,9,7,29,57,8,10,11,12])));return{default:e}}),Ty=A.memo(({defaultExpanded:e=!1,forceLoadingHeader:t=!1})=>{const{hasAnyAgentSteps:n,isAnswerSkipped:r,response:s,isPending:o,isProcessingQuery:a}=It(),[i,c]=d.useState(e),u=d.useCallback(()=>c(m=>!m),[]),f=d.useMemo(()=>{if(t)return!0;if(r)return!1;const m=!!s&&qt.hasContent({chunks:s.chunks,answer:s.answer,structured_answer_blocks:s.structured_answer_blocks});return o&&!m},[o,s,r,t]);return!n&&!a?null:l.jsxs("div",{className:"flex flex-col gap-sm",children:[f?l.jsx(mst,{}):l.jsx(pst,{isExpanded:i,onToggleExpanded:u}),l.jsx(fst,{isExpanded:i})]})});Ty.displayName="AgentWorkflowDisplay";const Goe=A.memo(({onClick:e,didSelectAnswer:t,onDismiss:n})=>{const{isMobileStyle:r}=Re(),[s,o]=d.useState(!1),{$t:a}=J(),i=d.useCallback(()=>{o(!0),n()},[n]);return r||s?null:l.jsx("div",{children:l.jsx(K,{variant:"superLight",className:"p-md gap-sm flex items-center justify-between rounded-md",children:t?l.jsxs("div",{className:"gap-sm flex w-full items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ge,{icon:B("confetti"),size:"lg",className:"text-super"}),l.jsx(V,{color:"super",variant:"smallBold",children:a({defaultMessage:"Thank you! Your feedback helps improve answers for everyone.",id:"jfIf25t1OU"})})]}),l.jsx(st,{variant:"noHover",icon:B("x"),pill:!0,size:"small",extraCSS:"!text-super",onClick:i})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(V,{color:"super",variant:"smallBold",children:a({defaultMessage:"Help improve our product",id:"A7lIeL4dUS"})}),l.jsx(V,{color:"super",variant:"small",children:a({defaultMessage:"We made two versions of this answer. Which do you prefer?",id:"GT2t8+NleA"})})]}),l.jsx(Ge,{variant:"primary",size:"small",text:a({defaultMessage:"Compare",id:"493J7RI1tF"}),onClick:e})]})})})});Goe.displayName="AnswerComparisonBanner";const hst={about:B("user"),born:B("calendar-event"),age:B("calendar-event"),died:B("calendar-event"),parents:B("users-group"),siblings:B("users-group"),children:B("baby-carriage"),spouse:B("heart"),spouses:B("heart"),education:B("school"),educated_at:B("school"),net_worth:B("cash-banknote"),ratings:B("star"),directed_by:B("movie"),starring:B("user"),watch_on:B("player-play"),treatment:B("medicine-syrup"),symptoms:B("clipboard-heart"),specialists:B("stethoscope")};function gst(e){return e&&hst[e]||null}const yst={EXTERNAL_LINK_TYPE_UNSPECIFIED:B("external-link"),PRIMARY:B("external-link"),WIKIPEDIA:B("brand-wikipedia"),X:B("brand-x"),INSTAGRAM:B("brand-instagram"),TIKTOK:B("brand-tiktok"),YOUTUBE:B("brand-youtube"),FACEBOOK:B("brand-facebook"),MAYOCLINIC:B("building"),IMDB:B("brand-windows")};function iL(e){return yst[e]}const $oe=Ft("PanelContext",{menuItems:void 0}),sm=()=>{const e=d.useContext($oe);if(!e)throw new Error("usePanel must be used within PanelContext");return e},Fn=({children:e,menuItems:t,variant:n,className:r})=>l.jsx(Mr,{fallback:null,children:l.jsx($oe.Provider,{value:{menuItems:t},children:n==="noChrome"?l.jsx(K,{className:r,children:e}):l.jsx(dr,{shadow:!0,className:z(r,"p-md"),children:e})})}),xst=({menuItems:e,buttonClass:t,placement:n})=>{const{isMobileStyle:r}=Re();return e.length<=0?null:l.jsx(zs,{items:e,isMobileStyle:r,placement:n,children:l.jsx(st,{size:"tiny",pill:!0,icon:B("dots"),extraCSS:t})})},vst=({title:e,href:t,subtitle:n,image_url:r,links:s,children:o,entryUUID:a,data:i})=>{const{session:c}=Ne(),{trackEvent:u}=Xe(c),f=d.useCallback(m=>{u("knowledge card link clicked",{label:"social media",socialMediaType:m.type,value:m.url,entryUUID:a,type:i?.type??"",name:i?.title??"",id:i?.source_url??""})},[i?.source_url,i?.title,i?.type,a,u]);return l.jsx(K,{className:"gap-sm flex w-full justify-between",children:l.jsxs("div",{className:"gap-md flex grow items-start",children:[r?l.jsx("div",{className:"flex-none",children:l.jsx(Wo,{imageClassName:"size-[120px] object-cover object-top",rounded:"md",src:r,alt:e,includeLightBoxModal:!1})}):null,l.jsxs("div",{className:"flex h-full grow flex-col",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"gap-sm mb-two flex items-start",children:[l.jsx(V,{variant:"section-title",className:"flex-1",children:t?l.jsx(yt,{href:t,target:"_blank",className:"hover:text-super flex-1 duration-150",children:e}):e}),o]}),n&&l.jsx(V,{variant:"small",className:"mb-sm mr-sm text-pretty",children:n})]}),s&&s.length>0&&l.jsx("div",{className:"gap-sm flex flex-wrap",children:s.map(m=>l.jsx(qoe,{link:m,solo:s.length===1,handleLinkClick:f},m.type))})]})]})})},qoe=A.memo(({link:e,solo:t,handleLinkClick:n})=>{const r=d.useCallback(()=>n(e),[n,e]);return t?l.jsx(Ge,{icon:iL(e.type),text:e.title,textClassName:"font-normal ml-2xs text-quiet ",size:"tiny",href:e.url,target:"_blank",onClick:r},e.url):l.jsx(Ge,{icon:iL(e.type),size:"tiny",href:e.url,target:"_blank",onClick:r},e.type)});qoe.displayName="ButtonFactory";const bst=({name:e,title:t,value:n})=>{const r=gst(e);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-sm flex min-w-[120px]",children:[r&&l.jsx(V,{variant:"smallBold",color:"light",className:"w-5",children:l.jsx(ge,{icon:r,size:"sm"})}),l.jsx(V,{variant:"smallBold",color:"light",children:t})]}),l.jsx(V,{variant:"small",children:n})]})},_st=({children:e})=>l.jsx(K,{className:"pt-sm px-md border-t",children:e});Fn.Title=vst;Fn.Item=bst;Fn.Menu=xst;Fn.Footer=_st;const Koe=A.memo(({graphData:e})=>{const[t,n]=d.useState(!1),r=e.url,s=e.name,o=d.useCallback(()=>n(!1),[]);return l.jsxs("div",{className:"flex justify-center",children:[l.jsx("img",{src:r,alt:s,className:"max-h-[50vh] overflow-hidden rounded align-middle",onClick:()=>n(!0)}),l.jsx(Yoe,{isOpen:t,onClose:o,alt:s,src:r})]})});Koe.displayName="StaticImageGraph";const Yoe=A.memo(({isOpen:e,onClose:t,alt:n,src:r})=>{const s=d.useCallback(()=>t(!1),[t]);return l.jsxs(po,{onClose:s,isOpen:e,variant:"hide-chrome",disableAnimation:!1,children:[l.jsx("div",{className:"flex place-content-center",onClick:()=>t(!1),children:l.jsx("div",{className:"gap-xs p-md md:p-xl flex flex-col items-center justify-between",children:l.jsx("div",{className:"grow",children:l.jsx("img",{alt:n,src:r,className:"max-h-[50vh]"})})})}),l.jsx(Ge,{onClick:s,icon:B("x"),extraCSS:"!fixed top-md right-md shadow-sm",size:"small",pill:!0,ariaLabel:"Close"})]})});Yoe.displayName="ImageModal";const Qoe=A.memo(({graphData:e})=>l.jsxs(Fn,{className:"gap-md bg-subtler p-md flex flex-col rounded-md text-center",children:[l.jsx(Fn.Title,{title:e.name,subtitle:""}),l.jsx(Koe,{graphData:e})]}));Qoe.displayName="GraphPanel";const Xoe=(e,t)=>{const{$t:n}=J(),r=d.useMemo(()=>({low:n({defaultMessage:"This price is low",id:"4Q8ifhmVtL"},{span:u=>l.jsx("span",{className:"text-positive",children:u})}),fair:n({defaultMessage:"This price is fair",id:"jXTaDslyVl"},{span:u=>l.jsx("span",{className:"text-foreground/50",children:u})}),high:n({defaultMessage:"This price is high",id:"whb9bUkCNc"},{span:u=>l.jsx("span",{className:"text-negative",children:u})})}),[n]),s=e?e.flatMap(u=>{const f=(u.offers??[]).map(p=>p.price).filter(p=>p!==void 0);return f.length===0?[]:[Math.min(...f)]}):[],o=t!=null?[...s,t]:s,a=o.length>0?Math.min(...o):null,i=o.length>0?Math.max(...o):null,c=d.useMemo(()=>{if(!i||!a||!t)return null;const f=(i-a)*.33,m=a+f,p=i-f;return{low:m,high:p}},[i,a,t]);return!c||!t?{label:"",textColor:"",backgroundColor:"",high:null,low:null,fairBounds:null}:{label:tc.high?r.high:r.fair,textColor:tc.high?"text-negative":"text-foreground/50",backgroundColor:tc.high?"bg-negative":"bg-inverse",high:i,low:a,fairBounds:c}},Zoe=Ft("ScrollToWidgetContext",{selectedWidgetId:void 0,scrollToWidget:()=>{},entityRefs:{}}),Joe=()=>{const e=d.useContext(Zoe);if(!e)throw new Error("useScrollToWidget must be used within ScrollToWidgetContext");return e},eae=A.memo(({children:e,entities:t})=>{const[n,r]=d.useState({}),[s,o]=d.useState(void 0),{scrollContainerRef:a}=ka(),i=d.useRef(null);d.useEffect(()=>()=>{r({})},[]),d.useEffect(()=>{r(u=>{const f=u;let m=!1;return t?.map(p=>{const h=Vv(p);if(!h)return;if(h.object==="ShopifyWidget"){const y=h.id;if(!n[y]){m=!0;const x=d.createRef();f[y]=x}}}),m?f:u})},[t,n]);const c=u=>{i.current&&clearTimeout(i.current);const f=n[u]?.current;if(f&&a?.current){const p=f.getBoundingClientRect().top+a.current?.scrollTop-200;a?.current?.scrollTo({top:p,behavior:"smooth"})}o(u),i.current=setTimeout(()=>{o(void 0)},2e3)};return l.jsx(Zoe.Provider,{value:{selectedWidgetId:s,scrollToWidget:c,entityRefs:n},children:e})});eae.displayName="ScrollToWidgetProvider";const tae=Ft("EntityContext",{entityId:"",menuItems:void 0,variant:void 0}),Qg=()=>{const e=d.useContext(tae);if(!e)throw new Error("useEntity must be used within EntityContext");return e},wst=({children:e,id:t,menuItems:n,className:r,entityVariant:s})=>l.jsx(tae.Provider,{value:{entityId:t,menuItems:n,variant:s},children:l.jsx(dr,{variant:s==="hide-chrome"?"transparent":void 0,className:z("group/card flex flex-col",{"p-md":s!=="hide-chrome"},r),children:e})}),Cst=({className:e,...t})=>l.jsx(K,{className:z("gap-sm md:gap-md relative flex flex-col rounded-lg md:flex-row",e),...t}),Sst=({primaryButtonText:e,onPrimaryButtonClick:t,listNumber:n,className:r,children:s,...o})=>l.jsxs("div",{className:z("relative md:w-[calc(30%_-_8px)]",r),...o,children:[l.jsxs("div",{className:"gap-md flex h-full flex-col justify-between",children:[s,e&&t&&l.jsx("div",{className:"flex flex-col items-stretch md:max-w-[160px]",children:l.jsx(Ge,{text:e,variant:"primary",onClick:t,pill:!0,size:"small"})})]}),typeof n=="number"&&l.jsx(V,{variant:"smallCaps",color:"light",className:"border-subtler bg-base absolute -left-1.5 -top-1.5 flex size-5 shrink-0 items-center justify-center rounded-full border shadow-sm",children:n})]}),Est=({className:e,buttonProps:t,secondaryButtonProps:n,trailingComponent:r,children:s,...o})=>{const{menuItems:a}=Qg();return l.jsx("div",{className:z("flex min-w-0 flex-1 flex-col",e),...o,children:l.jsxs("div",{className:"gap-sm md:gap-md flex flex-1 flex-col justify-between rounded-lg",children:[l.jsx("div",{className:"gap-xs flex flex-col justify-between",children:l.jsx("div",{className:"gap-xs my-sm relative flex flex-col md:mt-0",children:s})}),(t||n)&&l.jsxs("div",{className:"gap-sm flex w-full items-center",children:[t&&l.jsx(Ge,{variant:"primary",pill:!0,size:"small",...t,extraCSS:`${t.extraCSS} w-full max-w-[160px]`}),n&&l.jsx(Ge,{variant:"border",pill:!0,size:"small",...n,extraCSS:`${n.extraCSS}`}),r,a&&a.length>0&&l.jsx("div",{className:"duration-150 group-hover/card:opacity-100 md:opacity-0",children:l.jsx(Fn.Menu,{menuItems:a,placement:"bottom-start"})})]})]})})},kst=({title:e,onTitleClick:t,className:n,variant:r})=>{const{selectedWidgetId:s}=Joe(),{entityId:o}=Qg(),{isMobileStyle:a}=Re();return l.jsx("div",{onClick:()=>t?.(),className:n,children:l.jsx(V,{variant:r??(a?"section-title":"entry-title"),className:z("line-clamp-3 !leading-tight md:text-2xl",{"duration-fast cursor-pointer hover:opacity-70":!!t}),children:l.jsx("span",{className:z("duration-normal rounded-md",{"bg-super/10":s===o}),children:e})})})},Mst=({loading:e,className:t,onClick:n,trailingText:r})=>{const{$t:s}=J();return l.jsxs(K,{className:z("group relative flex h-12 items-center",{"opacity-50":e,"cursor-pointer":!e},t),onClick:e?void 0:n,children:[!e&&l.jsx(K,{variant:"subtle",className:"inset-y-xs absolute -inset-x-3 rounded-md opacity-0 duration-150 group-hover:opacity-100"}),l.jsxs("div",{className:"relative w-full",children:[l.jsxs("div",{className:z("gap-md relative flex w-full items-center justify-between",{"opacity-0":e}),children:[l.jsx(V,{variant:"smallBold",color:"light",children:s({defaultMessage:"View More",id:"QQSdHPJWXu"})}),l.jsxs(V,{variant:"tiny",color:"light",className:"gap-sm flex items-center",children:[r,l.jsx(ge,{icon:B("chevron-right"),size:"xs"})]})]}),e&&l.jsxs("div",{className:"absolute inset-0 flex items-center justify-between",children:[l.jsx(K,{className:"h-2 w-[100px] rounded-full",variant:"subtle"}),l.jsx(ge,{icon:B("chevron-right"),className:"text-quietest",size:"sm"})]})]})]})},Tst=({title:e,className:t,children:n,trailingContent:r,defaultExpanded:s=!1})=>{const[o,a]=d.useState(!s);return l.jsxs(K,{className:t,children:[l.jsxs("div",{onClick:()=>a(!o),className:"group relative flex h-12 cursor-pointer select-none items-center justify-between",children:[l.jsx(K,{variant:"subtle",className:"inset-y-xs absolute -inset-x-3 rounded-md opacity-0 duration-150 group-hover:opacity-100"}),l.jsx(V,{variant:"smallBold",color:"light",className:"relative shrink-0 whitespace-nowrap",children:e}),l.jsxs("div",{className:"gap-md relative flex min-w-0 items-center",children:[l.jsx("div",{className:"gap-xs flex min-w-0 items-stretch",children:r}),l.jsx(ge,{icon:B("chevron-down"),className:z("text-foreground relative shrink-0 opacity-50",{"rotate-180":!o}),size:"sm"})]})]}),l.jsx(pi,{transition:{ease:tl(.16,1,.3,1),duration:.2},initial:!1,children:!o&&l.jsx(Oo,{transition:{duration:.1},exit:{y:-5,opacity:0},animate:{y:0,opacity:1},initial:{y:-5,opacity:0},children:l.jsx("div",{className:"pb-4",children:n})})})]})},l_t=wst,c_t=Cst,u_t=kst,yC=Tst,d_t=Sst,f_t=Est,m_t=Mst,kb=A.memo(({isOpen:e,children:t,placement:n,hoverOpen:r=!1,disabled:s=!1,onOpen:o,onClose:a,content:i,contentWidth:c="360px",isMobileStyle:u,boxProps:f,canOutsideClickClose:m,removeScroll:p,modalTitleContent:h,modalRenderCloseButton:g=!0,ref:y,...x})=>{const[v,b]=d.useState(!1),_=d.useMemo(()=>e!==void 0,[e]),w=d.useMemo(()=>_?e:v,[_,e,v]),S=d.useCallback(()=>{!w&&!s&&(o?.(),_||b(!0))},[s,_,o,w]),C=d.useCallback(()=>{w&&!s&&(a?.(),_||b(!1))},[s,_,a,w]);d.useImperativeHandle(y,()=>({dismiss:C}),[C]);const E=d.useMemo(()=>({width:c??void 0}),[c]),T=d.useMemo(()=>l.jsx(K,{style:E,...f,children:i}),[E,f,i]),k=d.useMemo(()=>({canOutsideClickClose:m??!0,removeScroll:p}),[m,p]);return u?l.jsxs(l.Fragment,{children:[l.jsx(po,{variant:"bottom-left-sheet",actionList:Pe,isOpen:w,onClose:C,titleContent:h,renderCloseButton:g,children:i}),l.jsx("span",{onClick:S,children:t})]}):l.jsx(Vf,{isOpen:w,hoverOpen:r,placement:n,onClose:C,onOpen:S,overlayProps:k,content:T,hasInteractiveContent:!0,...x,children:t})});kb.displayName="DropDownModal";const Ast=A.memo(({inFlight:e,chooseIfReason:t,chooseIfLeadInCopy:n,pros:r,cons:s,className:o,viewState:a="collapsed",id:i,showBuyIf:c=!0})=>{const u=!t&&e;return l.jsx(br,{active:u,className:z("relative",o),children:l.jsx(pi,{children:l.jsx(Oo,{children:l.jsxs("div",{className:"gap-sm mt-md relative flex flex-col rounded-md md:mx-0",children:[c&&l.jsx(nae,{reason:t,leadInCopy:n,loading:u}),l.jsx(ON,{pros:r??Pe,cons:s??Pe,loading:u,viewState:a,id:i})]})})})})});Ast.displayName="EntityItemGuidance";const nae=A.memo(({reason:e,leadInCopy:t,loading:n,textVariant:r="base"})=>{const{variant:s}=Qg();return!e&&!n?null:l.jsx("div",{className:"flex items-start gap-[12px] rounded-md md:items-center",children:l.jsx("div",{className:"w-full",children:n?l.jsxs("div",{className:"gap-sm pb-sm flex flex-col",children:[l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 w-full rounded-full"}),l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 rounded-full"}),l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 w-1/2 rounded-full"})]}):l.jsxs(V,{variant:r,children:[l.jsx("span",{className:"font-medium",children:t})," ",e]})})})});nae.displayName="EntityItemChooseIf";const rae=3,sae=2,ON=A.memo(({pros:e,cons:t,loading:n,className:r,viewState:s="collapsed",id:o,scrollOnMobile:a=!0})=>!n&&e.length===0&&t.length===0?null:l.jsx("div",{className:r,children:s==="collapsed"?l.jsx(aae,{loading:n,pros:e,cons:t,id:o,scrollOnMobile:a}):l.jsx(iae,{loading:n,pros:e,cons:t})}));ON.displayName="EntityItemProsCons";const oae=A.memo(({children:e,loading:t,scrollOnMobile:n=!0})=>{const{isMobileStyle:r}=Re(),{variant:s}=Qg();return r&&n?l.jsx("div",{className:"-mx-md",children:l.jsx(nl,{orientation:"horizontal",showScrollIndicator:!1,children:l.jsx("div",{className:"flex",children:l.jsx("ul",{className:"gap-sm px-md flex shrink-0",children:e})})})}):l.jsx("ul",{className:z("flex flex-wrap",{"gap-0":s==="dense-card"&&!t,"gap-sm":s!=="dense-card"||t}),children:e})});oae.displayName="ProsConsCollapsedContainer";const aae=A.memo(({loading:e,pros:t,cons:n,id:r,scrollOnMobile:s=!0})=>l.jsx(oae,{loading:e,scrollOnMobile:s,children:l.jsx(St,{initial:!1,children:l.jsx(yg,{children:e?Array.from({length:3}).map((o,a)=>l.jsx(Ay,{asPlaceholder:!0,text:"",type:"con",label:"",id:r},a)):l.jsxs(l.Fragment,{children:[t.map(o=>l.jsx(Ay,{text:o.description,type:"pro",label:o.label,id:r},o.label+r)).slice(0,rae),n.map(o=>l.jsx(Ay,{text:o.description,type:"con",label:o.label,id:r},o.label+r)).slice(0,sae)]})})})}));aae.displayName="ProsConsCollapsed";const iae=A.memo(({loading:e,pros:t,cons:n})=>l.jsx("div",{className:"-mx-6",children:l.jsx(nl,{orientation:"horizontal",showScrollIndicator:!1,children:l.jsx("ul",{className:"gap-sm flex px-6",children:e?Array.from({length:3}).map((r,s)=>l.jsx(lae,{},s)):l.jsxs(l.Fragment,{children:[t.map(r=>l.jsx(Ak,{text:r.description,type:"pro",label:r.label},r.label)).slice(0,rae),n.map(r=>l.jsx(Ak,{text:r.description,type:"con",label:r.label},r.label)).slice(0,sae)]})})})}));iae.displayName="ProsConsExpanded";const Ay=A.memo(({text:e,label:t,type:n,asPlaceholder:r,id:s})=>{const{session:o}=Ne(),{trackEvent:a}=Xe(o),{variant:i}=Qg(),c=()=>{r||a("shopping pro con hover",{type:n,label:t})},u={initial:{opacity:0,x:-3},animate:{opacity:1,x:0}},f=d.useMemo(()=>l.jsx("div",{className:"p-sm pointer-events-none translate-y-0",children:l.jsx(V,{variant:"small",children:e})}),[e]);return l.jsx(Te.li,{variants:u,initial:"initial",animate:"animate",transition:{duration:.1,ease:Kd},className:z("group inline-flex shrink-0 cursor-default rounded-full duration-150",{"gap-xs":i!=="dense-card","gap-sm":i==="dense-card","hover:bg-subtler":!r,"border-subtlest border duration-150":!r&&i!=="dense-card","!border-transparent !bg-transparent":r}),onMouseEnter:c,children:l.jsx(kb,{hoverOpen:!0,placement:"bottom-start",contentWidth:"200px",removeScroll:!1,content:f,isMobileStyle:!1,delayTime:1,disabled:r,hasInteractiveContent:!1,childrenClassName:"inline-flex",children:l.jsxs("div",{className:z("p-xs relative inline-flex items-center pr-[10px]",{"bg-subtler dark:bg-subtle":r,"h-[26px] rounded-full":r,"gap-2xs":i==="dense-card","gap-xs":i!=="dense-card"}),children:[l.jsx("div",{className:z("size-md flex shrink-0 items-center justify-center rounded-full",{"text-super":n==="pro"},{"text-quiet":n==="con"},{"bg-transparent":r}),children:l.jsx(V,{variant:"tiny",color:n==="pro"?"super":"light",className:"inline-flex",children:l.jsx(ge,{className:r?"opacity-0":"",icon:n==="pro"?B("check"):B("x"),size:"xs"})})}),r?l.jsx(V,{variant:"tiny",className:"w-10 shrink-0",children:" "}):l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:z({"text-super":n==="pro"}),children:t})})]})})},t+s)});Ay.displayName="EntityItemProConItem";const lae=A.memo(()=>l.jsx(K,{className:"p-sm h-[136px] w-[200px] rounded-md",variant:"subtler"}));lae.displayName="ExpandedLoading";const Ak=A.memo(({text:e,label:t,type:n})=>l.jsxs(K,{className:"p-sm w-[200px] rounded-md",variant:"subtler",children:[l.jsxs("div",{className:"mb-2xs gap-xs flex items-center",children:[l.jsx(K,{variant:n==="pro"?"super":"textColor",className:z("size-md flex shrink-0 items-center justify-center rounded-full",{"opacity-50":n==="con"}),children:l.jsx(ge,{icon:n==="pro"?B("check"):B("x"),className:"text-inverse shrink-0",size:"xs"})}),l.jsx(V,{variant:"smallBold",color:n==="pro"?"super":"light",children:t})]}),l.jsx(V,{variant:"small",color:"light",children:e})]}));Ak.displayName="ProConItemExpanded";const cae=A.memo(({url:e,children:t,className:n})=>{const r=d.useCallback(s=>{s.stopPropagation()},[]);return e?l.jsx("div",{className:z("inline-flex",n),children:l.jsx(yt,{href:e,target:"_blank",className:"inline-flex min-w-0 items-center gap-0 duration-150 hover:opacity-60",onClick:r,children:t})}):t});cae.displayName="LogoWrapper";const Nst=A.memo(({merchantName:e,merchantDomain:t,itemUrl:n,className:r,textVariant:s,iconSize:o,faviconSize:a})=>l.jsx(cae,{url:n??void 0,className:r,iconSize:o,children:l.jsx(LN,{name:e,domain:t,faviconSize:a,textVariant:s})}));Nst.displayName="EntityItemMerchantInfo";const LN=A.memo(({name:e,domain:t,faviconSize:n,textVariant:r="tiny"})=>l.jsxs(V,{variant:r,color:"light",className:"gap-xs flex items-center",children:[l.jsx(Po,{className:"-translate-y-half shrink-0",domain:t,size:n}),l.jsx("span",{className:"truncate whitespace-nowrap",children:e})]}));LN.displayName="EntityMerchantLogoName";const xC=e=>{if(e.indexOf("$")===-1)return e;const t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),n=e.replace(/[$,]/g,"");return t.format(parseFloat(n))},uae=A.memo(({price:e,comparePrice:t,soldOut:n,size:r,textVariant:s})=>{const{$t:o}=J(),{isMobileStyle:a}=Re(),i=xC(n&&t?t:e);return l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:s||(a||r==="small"?"smallBold":"baseSemi"),className:n?"line-through":void 0,color:t?"default":void 0,children:i}),n?l.jsx(V,{variant:s??"small",color:"red",children:o({defaultMessage:"Sold Out",id:"MwUAGRNkR/"})}):t&&l.jsx(V,{variant:s??"small",color:"light",className:"line-through",children:xC(t)})]})});uae.displayName="EntityItemPrice";function Rst(e){return"article_info"in e}const dae=A.memo(({checked:e,toggleChecked:t,className:n="",variant:r="default",unselectedCheckboxClassName:s,...o})=>l.jsx(pT,{className:z("inline-flex cursor-pointer items-center justify-center duration-150",{"size-[24px]":r==="large","size-[18px]":r==="default","size-[14px]":r==="small"},n),checked:e,onCheckedChange:t,...o,children:l.jsx(K,{variant:e?"super":"background",noBorder:!0,className:z("border-subtle inline-flex size-full items-center justify-center rounded border",{"!border-super bg-super":e},!e&&s),children:l.jsx(hT,{children:l.jsx(St,{children:e&&l.jsx(Te.div,{initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.6},transition:{type:"spring",bounce:.2,duration:.2},children:l.jsx(ge,{icon:B("check"),size:r==="small"?"xs":"sm",className:"text-inverse"})})})})})}));dae.displayName="Checkbox";const Dst=A.memo(function({variant:t,icon:n,label:r,shouldShow:s=!0}){return t==="grid"||!s?null:l.jsxs(K,{className:"gap-xs pt-sm mt-xs flex items-center border-t",children:[l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B(n)})}),l.jsx(V,{variant:"tiny",color:"super",children:r})]})}),fae=A.memo(function(t){const{$t:n}=J(),{result:r,additionalMetadata:s,variant:o}=t,a=r.url,i=r.meta_data?.generated_file_description??r.snippet,c=Uf(r),u=r.meta_data?.generated_file_title??r.name,f=r?.is_client_context,m=!!r.meta_data?.connection_type,p=typeof r.meta_data?.quoteBeforeContext=="string"?r.meta_data?.quoteBeforeContext:"",h=typeof r.meta_data?.quoteEmphasisText=="string"?r.meta_data?.quoteEmphasisText:"",g=typeof r.meta_data?.quoteAfterContext=="string"?r.meta_data?.quoteAfterContext:"",y=p.length>0||h.length>0||g.length>0,x=o!=="grid"&&i&&y,v=r.file_metadata?.file_repository_type,b=Fi(r),_=typeof r.meta_data?.citation_domain_name=="string"?r.meta_data?.citation_domain_name:void 0,w=K2e(r),S=()=>{if(m&&r.meta_data?.connection_type!==Zn.WILEY)return n2(r.meta_data?.connection_type);if(r.is_attachment){if(r?.meta_data?.patent_name)return r.meta_data.patent_name;if(!r?.meta_data?.file_uuid){const M=r?.file_metadata?.connector_type??eg(r.url),N=M?n2(M):void 0;if(N)return N}return v=="USER"?n({defaultMessage:"Local Files",id:"FBnEWaGOHR"}):v=="ORG"?n({defaultMessage:"Org Files",id:"DaFSYzpM1Q"}):v=="COLLECTION"?n({defaultMessage:"Space Files",id:"Thy4/SbBwD"}):n({defaultMessage:"Attachment",id:"eLCAEP8LHj"})}return _},C=yb(r),E=r.is_memory,T=Wg(r),k=c?{icon:"microphone",label:l.jsx(je,{defaultMessage:"Meeting Transcript",id:"AzZfMfUw31",description:"Meeting transcript label"})}:{icon:"user-search",label:l.jsx(je,{defaultMessage:"Personal Search",id:"7+aLCEyqS2",description:"title"})},I=c||T;return l.jsxs("div",{className:z("gap-xs pointer-events-none relative flex size-full max-w-full select-none flex-col min-w-0",{"px-sm pb-sm pt-sm":o==="grid"},{"p-md":o!=="grid"}),children:[l.jsxs("div",{className:"flex w-full items-center justify-between",children:[C&&!T?l.jsx(lN,{variant:"small",searchType:E?"memory":"conversation-history"}):l.jsxs("div",{className:"space-x-xs flex min-w-0",children:[s||null,l.jsx(ya,{variant:"tiny",color:"light",url:a,isAttachment:r.is_attachment,connectionType:oz(r),source:S(),mcpServerSource:r.meta_data?.mcp_server,isInlineAttachment:w,patentName:M4(r),isMeetingTranscript:c,truncate:!1})]}),l.jsxs("div",{className:"ml-auto shrink-0",children:[b&&o!=="grid"?l.jsx(Mh,{}):null,f&&o==="grid"?l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B("user-scan")})}):null]})]}),l.jsx(V,{variant:o==="grid"?"tiny":o==="list"?"small":"base",className:z("min-w-0",{"":o==="grid","pr-1":o==="list"}),children:E&&!T?l.jsx(V,{variant:"tiny",className:"line-clamp-2 h-8 min-w-0",children:r?.snippet}):l.jsx("span",{className:"line-clamp-1 text-left md:line-clamp-2 min-w-0 [overflow-wrap:break-word]",children:u||l.jsx("div",{children:" "})})}),!c&&u!==r.name?l.jsx(V,{variant:"small",color:"light",className:"line-clamp-1",children:r.name}):null,x&&l.jsxs(V,{variant:o==="list"?"tiny":"small",className:"mt-two border-super line-clamp-[8] border-l-4 pl-2 font-normal",children:[l.jsx("span",{children:p}),l.jsx("span",{className:"bg-super/30",children:h}),l.jsx("span",{children:g})]}),o!=="grid"&&i&&!y&&!c&&l.jsx(V,{variant:o==="list"?"tiny":"small",className:"mt-two line-clamp-1 font-normal md:line-clamp-4",children:i}),l.jsx(Dst,{variant:o,icon:k.icon,label:k.label,shouldShow:I}),b&&o==="grid"?l.jsx("div",{className:"-mt-1.5",children:l.jsx(Mh,{})}):null]})});fae.displayName="CitationDefaultCard";const mae=A.memo(function(t){const{result:n,imageURL:r,citationNumber:s,useLightBoxModal:o=!0}=t;return l.jsxs("div",{className:" w-full relative max-h-[76px]",children:[l.jsx(Wo,{includeLightBoxModal:o,alt:n.name,containerClassName:"w-full h-full p-xs",imageClassName:"object-cover object-center w-full h-full rounded-md",src:r}),s&&l.jsx(V,{className:"bottom-sm left-sm px-xs absolute z-[1] inline-flex rounded-sm bg-black/50",variant:"tiny",color:"white",children:s})]})});mae.displayName="CitationImageCard";const pae=A.memo(e=>{const{result:t,imageURL:n}=e,r=t.url,s=J(),o=d.useMemo(()=>({color:"white"}),[]),a=d.useMemo(()=>l.jsx(pf,{recentlyUpdatedLabel:s.$t({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:t.meta_data?.published_date,timestampProps:o,includeIcon:!1,children:s.$t({defaultMessage:"Updated",id:"xrk6zgu9jU"})}),[s,t.meta_data?.published_date,o]);return l.jsxs("div",{className:"p-sm gap-sm flex h-full max-h-[190px] min-w-0",children:[l.jsxs("div",{className:"gap-xs flex flex-col min-w-0",children:[l.jsxs("div",{className:"space-x-xs flex justify-between min-w-0",children:[l.jsx(ya,{variant:"tiny",color:"light",url:r,isAttachment:t.is_attachment}),Gv.isRecentlyTrending(t)?l.jsx(Io,{tooltipText:a,children:l.jsx(ut,{name:B("bolt"),className:"text-super size-3.5"})}):null]}),l.jsx("div",{children:l.jsx(V,{variant:"tiny",className:"line-clamp-2",children:t.name})})]}),n?l.jsx("div",{className:"relative -my-1 -mr-1 size-[60px] shrink-0",children:l.jsx(Wo,{includeLightBoxModal:!1,alt:t.name,containerClassName:"w-full h-full",imageClassName:"object-cover object-center w-full h-full rounded-md",src:n})}):null]})});pae.displayName="CitationTrendingCard";const hae=A.memo(({blockCount:e,size:t=Ht.large,animateLines:n=!0,divider:r,noLines:s,noHeight:o,variant:a="subtler",className:i,...c})=>{const u="h-1 bg-inverse/70 rounded-full",f=d.useMemo(()=>{const m=[];for(let p=0;p<(e??1);p++)m.push(l.jsx(K,{variant:a,className:z("animate-pulse rounded-md",{"h-8":t===Ht.small,"h-10":t===Ht.regular,"h-[72px]":t===Ht.large,"h-32":t===Ht.xl,"h-6":t===Ht.tiny,"h-full":o}),children:l.jsx("div",{className:"gap-y-sm p-md flex h-full flex-col",children:!s&&l.jsxs(l.Fragment,{children:[l.jsx(Te.div,{initial:{width:n?0:"100%"},animate:{width:"100%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"100%"},animate:{width:"100%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"80%"},animate:{width:"80%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"20%"},animate:{width:"20%"},transition:{duration:.8,delay:.2},className:u})]})})},p));return m},[n,e,t,s,o,a]);return l.jsx(K,{className:z("h-full",{"divider gap-y-sm flex flex-col":r,"absolute top-0 w-full":o},i),...c,children:f})});hae.displayName="TextBlockThrobber";const gae=A.memo(({result:e,idx:t,isSelected:n,testId:r,additionalMetadata:s,isTrendingLayout:o=!1,trackEvent:a,downloadCitation:i,getImageUrl:c,variant:u,isSidecar:f,onClick:m,useLightBoxModal:p=!0})=>{const h=e.meta_data?.file_uuid?"fileRepositoryFile":e.is_attachment?"fileAttachment":"sourceCard";d.useEffect(()=>{const j=setTimeout(()=>a?.("source card viewed",{citation_url:e.url,position:t,title:e.name,source:h}),100);return()=>clearTimeout(j)},[a,e.name,e.url,t,h]);const g=e.url,[y,x]=d.useState(()=>!e.is_memory&&A4(e.url)?e.url:null),[v,b]=d.useState(!1),_=d.useMemo(()=>g&&!f&&Ji(g),[g,f]),[w,S]=d.useState(!1),C=p3(e),E=kr(e.url),T=Uf(e),k=!_&&!E&&!T,I=o&&e.meta_data?.client==="trending",M=d.useMemo(()=>I?l.jsx(pae,{result:e,authors:e.meta_data?.authors,imageURL:e.meta_data?.images?.[0]}):E&&y?l.jsx(mae,{result:e,imageURL:y,useLightBoxModal:p}):E&&!y?l.jsx(hae,{blockCount:1,size:"large"}):l.jsx(fae,{result:e,variant:u,additionalMetadata:s,isSelected:n}),[I,E,y,e,p,u,s,n]),N=d.useCallback((j,F)=>{b(F),x(j)},[]),D=d.useRef(null);return d.useEffect(()=>{const j=new IntersectionObserver(R=>{R.forEach(P=>{P.isIntersecting&&E&&y===null&&!v&&c?.(e,N)})},{threshold:.1}),F=D.current;return F&&E&&j.observe(F),()=>{F&&E&&j.unobserve(F)}},[D,g,c,e,y,N,v,E]),l.jsxs(iN,{result:e,trackEvent:a,children:[l.jsx("div",{ref:D,onClick:j=>{const F=typeof e.meta_data?.quoteBeforeContext=="string"?e.meta_data?.quoteBeforeContext:"",R=typeof e.meta_data?.quoteEmphasisText=="string"?e.meta_data?.quoteEmphasisText:"",P=typeof e.meta_data?.quoteAfterContext=="string"?e.meta_data?.quoteAfterContext:"",L=F.length>0||R.length>0||P.length>0;if(T){j.preventDefault();return}else _&&!w?S(!0):i&&!E&&!C?(j.preventDefault(),i(e)):m?.(j);const U=Gg(e);a?.("click citation",{source:h,citation_url:g,...U}),L&&a?.("click check sources citation",{source:h,citation_url:g,quoteBeforeContext:F,quoteEmphasisText:R,quoteAfterContext:P,...U})},className:z("group relative flex w-full items-stretch",{"h-full":u==="grid","cursor-pointer":!!i||!!_||!!m}),"data-test-id":r,children:l.jsx(K,{variant:"subtler",bgHover:k||_?"subtle":void 0,className:z("flex w-full rounded-lg",{"bg-super/10 ring-super/80 hover:!bg-super/10 dark:bg-super/20 dark:ring-super/80 dark:hover:!bg-super/20 ring-1":n}),children:M},e.name)}),_&&g&&e.name&&l.jsx($g,{isOpen:w,name:e.name,url:g,setisOpen:S})]})});gae.displayName="CitationCard";const yae=A.memo(({onSelect:e,isSelected:t,result:n,idx:r})=>{const s="manage-citation-row",o=f=>{e?.(f)},{session:a}=Ne(),{trackEvent:i}=Xe(a),{mutate:c}=Wv({reason:s}),u=f=>{c({file_url:f.url,tab_id:f.tab_id})};return l.jsxs("div",{className:"gap-sm flex w-full flex-row-reverse",children:[l.jsx("div",{className:"w-full min-w-0",children:l.jsx(gae,{result:n,idx:r,isSelected:t,variant:"modal",trackEvent:i,downloadCitation:Yl(n)?u:void 0})}),e&&l.jsx("div",{className:"mt-[6px] shrink-0",children:l.jsx(dae,{checked:t,toggleChecked:o.bind(null,n.url)})})]})});yae.displayName="ManageCitationRow";const Mb=A.memo(({webResults:e,citationType:t="sources",onClose:n,entry:r})=>{const{$t:s}=J(),{isMobileStyle:o}=Re(),a=e?.length??0,i=d.useMemo(()=>{if(!r)return;if(Rst(r)&&r.article_info?.title)return r.article_info.title;const u=r.query_str??"";return u?qx(u).actualQuery??void 0:void 0},[r]),c=d.useMemo(()=>{const u={sources:{empty:s({defaultMessage:"No sources",id:"tN3HZvczgp"}),count:s({defaultMessage:"{sources, plural, one {# source} other {# sources}}",id:"oWRBjE1HK2"},{sources:a})},articles:{empty:s({defaultMessage:"No articles",id:"cHDJyKJPPQ"}),count:s({defaultMessage:"{count, plural, one {# article} other {# articles}}",id:"FxjYiplq18"},{count:a})}};return a===0?u[t].empty:u[t].count},[a,t,s]);return l.jsx(po,{title:c,subtitle:i??void 0,isOpen:!0,variant:o?"bottom-left-sheet":"side-sheet",onClose:n,icon:yM,children:l.jsx(K,{className:"gap-md flex h-full flex-col items-start",children:e?.map((u,f)=>l.jsx(yae,{isSelected:!1,idx:f,result:u},u.url))})})});Mb.displayName="CitationListModal";const FN=Object.freeze(Object.defineProperty({__proto__:null,CitationListModal:Mb},Symbol.toStringTag,{value:"Module"})),Nk=A.memo(({webResults:e,className:t,isLoading:n})=>{const[r,s]=d.useState(!1),{isMobileStyle:o}=Re(),a=o?2:3,i=2,c=d.useMemo(()=>e.reduce((h,g)=>h.some(x=>!x.url||!g.url?!1:Ur(x.url)===Ur(g.url))?h:g.url?h.concat({url:g.url,isAttachment:g.is_attachment}):h,[]),[e]),u=d.useMemo(()=>c.slice(0,a),[c,a]),f=d.useMemo(()=>c.reduce((h,g,y)=>y0?", ":"")+Ur(g.url).replace(/\.[^.]*$/,""):y>=i&&y===c.length-1?h+`, +${c.length-i}`:h,""),[c]),m=d.useCallback(()=>{s(!0)},[]),p=d.useCallback(()=>{s(!1)},[]);return n||u.length===0?null:l.jsxs(l.Fragment,{children:[l.jsx(Io,{tooltipText:"Review summary sources",asChild:!0,tooltipLayout:"top",children:l.jsxs("div",{onClick:m,className:z("gap-sm hover:bg-subtle flex cursor-pointer flex-row-reverse items-center overflow-hidden",t),children:[l.jsx(V,{variant:"smallCaps",color:"light",className:"truncate",children:f}),l.jsx("div",{className:"min-w-0 shrink",children:l.jsx(Eb,{count:a,sources:u})})]})}),r&&l.jsx(Mb,{onClose:p,webResults:e,legacyIdentifier:"citationListModal"})]})});Nk.displayName="EntityItemSourcePile";const Rk={summary:"",review_quality_score:0,pros_detailed:[],cons_detailed:[],pros:[],cons:[],key_features:[],buy_if:"",review_search_results:[]},jst=(e,t,n,r)=>{if(e.backend_uuid!==t)return e;const s=e.blocks||[],o=[...s];let a=!1;const i=(p,h=Rk)=>p.url===n?{...p,review_summary:{...h,...r}}:p,c=s.findIndex(p=>p.shopping_mode_block);if(c>=0){const p=s[c],h=p?.shopping_mode_block;if(h){const g=h.shopping_widgets.map(y=>i(y,y.review_summary));o[c]={...p,shopping_mode_block:{...h,shopping_widgets:g}},a=!0}}const u=s.findIndex(p=>p.inline_entity_block?.shopping_preview_block);if(u>=0){const p=s[u],h=p?.inline_entity_block?.shopping_preview_block;if(h&&h.shopping_widgets){const g=h.shopping_widgets.map(y=>i(y,y.review_summary));o[u]={...p,inline_entity_block:{...p.inline_entity_block,shopping_preview_block:{...h,shopping_widgets:g}}},a=!0}}const f=s.findIndex(p=>p.entity_list_block?.entities.some(h=>h.shopping_block));if(f>=0){const p=s[f],h=p?.entity_list_block;if(h){const g={...h,entities:h.entities.map(y=>y.shopping_block&&y.shopping_block.url===n?{...y,shopping_block:i(y.shopping_block,y.shopping_block.review_summary)}:y)};o[f]={...p,entity_list_block:g},a=!0}}const m=s.reduce((p,h,g)=>(h.entity_group_block?.entities.some(y=>y.shopping_block&&y.shopping_block.url===n)&&p.push(g),p),[]);for(const p of m){const h=s[p],g=h?.entity_group_block;if(g){const y=g.entities.map(x=>x.shopping_block&&x.shopping_block.url===n?{...x,shopping_block:i(x.shopping_block,x.shopping_block.review_summary)}:x);o[p]={...h,entity_group_block:{...g,entities:y}},a=!0}}return a?{...e,blocks:o}:e},vC=e=>["shoppingReviewSummary",e],Ist=({shouldMutateStore:e=!0,reason:t})=>{const n=bz(),r=Yt(),{mutateAsync:s,isPending:o,error:a,data:i}=Rt({mutationFn:async c=>{const u=r.getQueryData(vC(c.url));if(u)return u;let f=Rk,m="PENDING",p="";try{await de.SSE("/rest/sse/shopping_review_summary",t,{params:c,handlers:{message:g=>{m=g.status??m,p=g.id??p,g.blocks?.[0]?.shopping_block&&(f=g.blocks?.[0]?.shopping_block),r.setQueryData(vC(c.url),y=>y?{...y,status:m,id:p,review_summary:{...y.review_summary||Rk,...f}}:{review_summary:f,status:m,id:p}),e&&n(c.entry_uuid,y=>jst(y,c.entry_uuid,p,f))}}})}catch{}const h={review_summary:f,status:m,id:p};return r.setQueryData(vC(c.url),h),h}});return d.useMemo(()=>({generateShoppingReviewSummary:s,reviewSummary:i?.review_summary,isPending:o,error:a}),[i?.review_summary,a,s,o])},Pst=({block:e})=>{const{product_name:t="",product_price:n,product_brand:r="",product_url:s="",compare_at_price:o,products:a}=e,{result:{backend_uuid:i}}=It(),{$t:c}=J(),{label:u}=Xoe(a,n),{reviewSummary:f,generateShoppingReviewSummary:m,isPending:p}=Ist({reason:"price-comparison-inline-card"});d.useEffect(()=>{!t||!s||m({product_name:t,merchant_name:r,url:s,price:n?.toString()??"",description:"",entry_uuid:i??""})},[t,r,s,i,m,n]);const h=d.useMemo(()=>a?[...a].sort((y,x)=>(y.offers?.[0]?.price??0)-(x.offers?.[0]?.price??0)):void 0,[a]),g=d.useMemo(()=>h?.map(y=>({name:y.title??"",url:y.offers?.[0]?.url??"",snippet:"",timestamp:"",meta_data:void 0,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_focused_web:!1,is_client_context:!1,is_widget:!1,sitelinks:[],inline_entity_id:""}))??Pe,[h]);return l.jsx("div",{className:"gap-md flex flex-col",children:l.jsxs(dr,{className:"divide-y",children:[l.jsx("div",{className:"gap-md flex items-center p-[12px]",children:l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(V,{variant:"baseSemi",className:"line-clamp-2 leading-tight",children:t}),l.jsx(BN,{brand:r,url:s,price:n,compareAtPrice:o})]})}),n&&u?l.jsx("div",{className:"px-md",children:l.jsx(yC,{title:u,children:l.jsx(Ost,{price:n,products:a})})}):null,h&&h.length>0?l.jsx("div",{className:"px-md",children:l.jsx(yC,{title:c({defaultMessage:"See similar products",id:"RZk98Mstcl"}),trailingContent:l.jsx(Nk,{webResults:g}),children:l.jsx(Lst,{sortedProductsByPrice:h})})}):null,f?l.jsx("div",{className:"px-md",children:l.jsx(yC,{title:c({defaultMessage:"Reviews",id:"dUxyza4PYQ"}),trailingContent:l.jsx(Nk,{webResults:f.review_search_results}),children:l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(V,{variant:"small",children:f.summary}),l.jsx(ON,{pros:f.pros_detailed,cons:f.cons_detailed,loading:p,id:s,scrollOnMobile:!1})]})})}):null]})})},BN=d.memo(({brand:e,url:t,price:n,compareAtPrice:r})=>{const s=e!==""?e:ng(t),o=n?n.toLocaleString("en-US",{style:"currency",currency:"USD"}):null,a=r?r.toLocaleString("en-US",{style:"currency",currency:"USD"}):null;return l.jsxs(ga,{children:[l.jsx(Bn,{id:"merchant",children:l.jsx("div",{className:"gap-sm flex items-center",children:l.jsx(LN,{name:s,domain:t})})}),o?l.jsx(Bn,{id:"price",children:l.jsx(uae,{price:o,textVariant:"tiny",comparePrice:a??void 0})}):null]})});BN.displayName="ProductMetadata";const Ost=({price:e,products:t})=>{const{high:n,low:r,textColor:s,backgroundColor:o,fairBounds:a}=Xoe(t,e),i=d.useMemo(()=>{if(!r||!n||!e)return null;const u=n-r;return(e-r)/u*100},[e,r,n]),c=()=>l.jsx("svg",{width:"5",height:"4",viewBox:"0 0 5 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{opacity:"0.5",d:"M1.7999 0.25C1.99235 -0.0833333 2.47347 -0.0833332 2.66592 0.25L4.39797 3.25C4.59042 3.58333 4.34986 4 3.96496 4H0.500859C0.115959 4 -0.124603 3.58333 0.0678468 3.25L1.7999 0.25Z",fill:"currentColor"})});return l.jsx("div",{className:"pt-xl pb-lg flex",children:l.jsxs(K,{variant:"transparent",className:"gap-two relative flex h-1.5 w-full rounded-full",children:[l.jsxs("div",{className:"absolute bottom-1/2 z-10 flex w-0 flex-col items-center gap-0.5",style:{left:`${i}%`},children:[l.jsxs("div",{className:"px-sm relative inline-flex rounded-full py-0.5",children:[l.jsx(V,{variant:"smallBold",className:z("whitespace-nowrap",{[s]:!0}),children:e?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})}),l.jsx("div",{className:z("absolute inset-0 rounded-full opacity-10",{[o]:!0})})]}),l.jsx(K,{variant:"background",className:"size-4 shrink-0 translate-y-1/2 rounded-full",children:l.jsx(K,{variant:"raised",className:"size-full rounded-full",children:l.jsx(K,{variant:"subtler",className:"p-three size-full rounded-full",children:l.jsx("div",{className:z("size-full rounded-full",{[o]:!0})})})})})]}),l.jsx("div",{className:"bg-positive relative h-full flex-1 rounded-full",children:l.jsxs("div",{className:"pt-sm absolute right-0 top-full flex translate-x-1/2 flex-col items-center gap-0.5",children:[l.jsx(c,{}),l.jsx(V,{variant:"tinyRegular",color:"light",children:a?.low?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})})]})}),l.jsx("div",{className:"bg-subtle relative h-full flex-1 rounded-full"}),l.jsx("div",{className:"bg-negative relative h-full flex-1 rounded-full",children:l.jsxs("div",{className:"pt-sm absolute left-0 top-full flex -translate-x-1/2 flex-col items-center gap-0.5",children:[l.jsx(c,{}),l.jsx(V,{variant:"tinyRegular",color:"light",children:a?.high?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})})]})})]})})},Lst=({sortedProductsByPrice:e})=>{const[t,n]=d.useState(!1),r=d.useCallback(()=>{n(!t)},[t]),{$t:s}=J();return l.jsxs("div",{className:"gap-sm flex flex-col mt-sm",children:[e?.slice(0,t?void 0:5).map(o=>l.jsx(xae,{product:o},o.title)),e&&e.length>5?l.jsx(wt,{variant:"secondary",onClick:r,size:"small",trailingIcon:t?B("chevron-up"):B("chevron-down"),children:s(t?{defaultMessage:"View less",id:"EVFai9MfkN"}:{defaultMessage:"View all",id:"pFK6bJU0EM"})}):null]})},xae=({product:e})=>{const{$t:t}=J(),n=d.useMemo(()=>e.offers?[...e.offers].filter(r=>r.url).sort((r,s)=>(r.price??0)-(s.price??0))[0]:void 0,[e.offers]);return n?l.jsx(dr,{className:"p-[12px] rounded-xl",variant:"subtler",children:l.jsxs("div",{className:"md:gap-md flex h-full items-center justify-between gap-[12px]",children:[l.jsxs("div",{className:"gap-xs flex w-full flex-col items-start",children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-2 leading-tight",children:e.title}),l.jsx(BN,{brand:n.merchant_name??"",url:n.url??"",price:n.price,compareAtPrice:n.compare_at_price})]}),l.jsx("div",{className:"gap-xs flex shrink-0",children:l.jsx(wt,{pill:!0,size:"small",variant:"tonal",onClick:()=>window.open(n.url,"_blank"),children:l.jsx(V,{variant:"tinyRegular",color:"light",className:"whitespace-nowrap text-right leading-tight",children:t({defaultMessage:"Visit site",id:"O9CCwEBdYk"})})})})]})}):null};xae.displayName="SimilarProduct";const Fst=({widgetType:e,widgetName:t,widgetSize:n="full"})=>{const{session:r}=Ne(),{trackEvent:s}=Xe(r),{result:{backend_uuid:o,frontend_context_uuid:a}}=It(),i=d.useMemo(()=>({widgetType:e,widgetName:t,widgetLocation:"thread",widgetSize:n,position:0,frontendUUID:a,entryUUID:o}),[e,t,o,a,n]),c=d.useCallback(()=>{s("widget viewed",i)},[s,i]),u=d.useCallback(()=>{s("widget hovered",i)},[s,i]),f=d.useCallback(m=>{s("widget selected",{...i,widgetCTA:{type:"internal_url",permalink:m}})},[s,i]);return d.useMemo(()=>({widgetViewed:c,widgetHovered:u,widgetSelected:f}),[c,u,f])},Es=A.memo(e=>{const{children:t,...n}=e,{widgetSelected:r,widgetViewed:s,widgetHovered:o}=Fst(n),a=d.useRef({hovered:!1,viewed:!1}),{ref:i,isIntersecting:c}=Hfe({options:{threshold:.5},freezeOnceVisible:!0});d.useEffect(()=>{c&&!a.current.viewed&&(s(),a.current.viewed=!0)},[c,s]);const u=d.useCallback(()=>{a.current.hovered||(o(),a.current.hovered=!0)},[o]);return l.jsx("div",{ref:i,onMouseEnter:u,"data-testid":e.widgetType+"-widget",children:typeof t=="function"?t({widgetSelected:r}):t})});Es.displayName="WithThreadWidgetInteractionEvents";const vae=A.memo(e=>{const{data:t}=e,{menuItems:n}=sm();return t?.result==null?null:l.jsx(Es,{widgetType:"calculator",widgetName:"calculator",widgetSize:"full",children:l.jsx(K,{className:"flex",children:l.jsxs("div",{className:"flex w-full items-center",children:[l.jsx(V,{color:"light",variant:"smallBold",children:l.jsx(ge,{className:"mt-two text-2xl leading-none",icon:B("calculator"),size:"sm"})}),l.jsx(V,{children:l.jsx(K,{className:"pl-md font-mono text-2xl",children:Wbe(t.result)})}),n&&n.length>0&&l.jsx("div",{className:"flex grow items-start justify-end",children:l.jsx(Fn.Menu,{menuItems:n})})]})})})});vae.displayName="CalculatorWidget";function Yi(e){return Array.isArray?Array.isArray(e):wae(e)==="[object Array]"}function Bst(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ust(e){return e==null?"":Bst(e)}function Ha(e){return typeof e=="string"}function bae(e){return typeof e=="number"}function Vst(e){return e===!0||e===!1||Hst(e)&&wae(e)=="[object Boolean]"}function _ae(e){return typeof e=="object"}function Hst(e){return _ae(e)&&e!==null}function Zs(e){return e!=null}function bC(e){return!e.trim().length}function wae(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const zst="Incorrect 'index' type",Wst=e=>`Invalid value for key ${e}`,Gst=e=>`Pattern length exceeds max of ${e}.`,$st=e=>`Missing ${e} property in key`,qst=e=>`Property 'weight' in key '${e}' must be a positive integer`,lL=Object.prototype.hasOwnProperty;class Kst{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let s=Cae(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Cae(e){let t=null,n=null,r=null,s=1,o=null;if(Ha(e)||Yi(e))r=e,t=cL(e),n=Dk(e);else{if(!lL.call(e,"name"))throw new Error($st("name"));const a=e.name;if(r=a,lL.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(qst(a));t=cL(a),n=Dk(a),o=e.getFn}return{path:t,id:n,weight:s,src:r,getFn:o}}function cL(e){return Yi(e)?e:e.split(".")}function Dk(e){return Yi(e)?e.join("."):e}function Yst(e,t){let n=[],r=!1;const s=(o,a,i)=>{if(Zs(o))if(!a[i])n.push(o);else{let c=a[i];const u=o[c];if(!Zs(u))return;if(i===a.length-1&&(Ha(u)||bae(u)||Vst(u)))n.push(Ust(u));else if(Yi(u)){r=!0;for(let f=0,m=u.length;fe.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ha(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ha(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(Zs(a)){if(Yi(a)){let i=[];const c=[{nestedArrIndex:-1,value:a}];for(;c.length;){const{nestedArrIndex:u,value:f}=c.pop();if(Zs(f))if(Ha(f)&&!bC(f)){let m={v:f,i:u,n:this.norm.get(f)};i.push(m)}else Yi(f)&&f.forEach((m,p)=>{c.push({nestedArrIndex:p,value:m})})}r.$[o]=i}else if(Ha(a)&&!bC(a)){let i={v:a,n:this.norm.get(a)};r.$[o]=i}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Sae(e,t,{getFn:n=Tt.getFn,fieldNormWeight:r=Tt.fieldNormWeight}={}){const s=new UN({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(Cae)),s.setSources(t),s.create(),s}function not(e,{getFn:t=Tt.getFn,fieldNormWeight:n=Tt.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new UN({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function v1(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:s=Tt.distance,ignoreLocation:o=Tt.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(r-n);return s?a+i/s:i?1:a}function rot(e=[],t=Tt.minMatchCharLength){let n=[],r=-1,s=-1,o=0;for(let a=e.length;o=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}const Cc=32;function sot(e,t,n,{location:r=Tt.location,distance:s=Tt.distance,threshold:o=Tt.threshold,findAllMatches:a=Tt.findAllMatches,minMatchCharLength:i=Tt.minMatchCharLength,includeMatches:c=Tt.includeMatches,ignoreLocation:u=Tt.ignoreLocation}={}){if(t.length>Cc)throw new Error(Gst(Cc));const f=t.length,m=e.length,p=Math.max(0,Math.min(r,m));let h=o,g=p;const y=i>1||c,x=y?Array(m):[];let v;for(;(v=e.indexOf(t,g))>-1;){let E=v1(t,{currentLocation:v,expectedLocation:p,distance:s,ignoreLocation:u});if(h=Math.min(E,h),g=v+f,y){let T=0;for(;T=I;j-=1){let F=j-1,R=n[e.charAt(F)];if(y&&(x[F]=+!!R),N[j]=(N[j+1]<<1|1)&R,E&&(N[j]|=(b[j+1]|b[j])<<1|1|b[j+1]),N[j]&S&&(_=v1(t,{errors:E,currentLocation:F,expectedLocation:p,distance:s,ignoreLocation:u}),_<=h)){if(h=_,g=F,g<=p)break;I=Math.max(1,2*p-g)}}if(v1(t,{errors:E+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:u})>h)break;b=N}const C={isMatch:g>=0,score:Math.max(.001,_)};if(y){const E=rot(x,i);E.length?c&&(C.indices=E):C.isMatch=!1}return C}function oot(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:p,alphabet:oot(p),startIndex:h})},m=this.pattern.length;if(m>Cc){let p=0;const h=m%Cc,g=m-h;for(;p{const{isMatch:v,score:b,indices:_}=sot(t,g,y,{location:s+x,distance:o,threshold:a,findAllMatches:i,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});v&&(p=!0),m+=b,v&&_&&(f=[...f,..._])});let h={isMatch:p,score:p?m/this.chunks.length:1};return p&&r&&(h.indices=f),h}}class oc{constructor(t){this.pattern=t}static isMultiMatch(t){return uL(t,this.multiRegex)}static isSingleMatch(t){return uL(t,this.singleRegex)}search(){}}function uL(e,t){const n=e.match(t);return n?n[1]:null}class aot extends oc{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class iot extends oc{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class lot extends oc{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class cot extends oc{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class uot extends oc{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class dot extends oc{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class kae extends oc{constructor(t,{location:n=Tt.location,threshold:r=Tt.threshold,distance:s=Tt.distance,includeMatches:o=Tt.includeMatches,findAllMatches:a=Tt.findAllMatches,minMatchCharLength:i=Tt.minMatchCharLength,isCaseSensitive:c=Tt.isCaseSensitive,ignoreLocation:u=Tt.ignoreLocation}={}){super(t),this._bitapSearch=new Eae(t,{location:n,threshold:r,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Mae extends oc{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const s=[],o=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+o,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const jk=[aot,Mae,lot,cot,dot,uot,iot,kae],dL=jk.length,fot=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,mot="|";function pot(e,t={}){return e.split(mot).map(n=>{let r=n.trim().split(fot).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=r.length;o!!(e[V2.AND]||e[V2.OR]),xot=e=>!!e[Ok.PATH],vot=e=>!Yi(e)&&_ae(e)&&!Lk(e),fL=e=>({[V2.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Tae(e,t,{auto:n=!0}={}){const r=s=>{let o=Object.keys(s);const a=xot(s);if(!a&&o.length>1&&!Lk(s))return r(fL(s));if(vot(s)){const c=a?s[Ok.PATH]:o[0],u=a?s[Ok.PATTERN]:s[c];if(!Ha(u))throw new Error(Wst(c));const f={keyId:Dk(c),pattern:u};return n&&(f.searcher=Pk(u,t)),f}let i={children:[],operator:o[0]};return o.forEach(c=>{const u=s[c];Yi(u)&&u.forEach(f=>{i.children.push(r(f))})}),i};return Lk(e)||(e=fL(e)),r(e)}function bot(e,{ignoreFieldNorm:t=Tt.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;r*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),n.score=r})}function _ot(e,t){const n=e.matches;t.matches=[],Zs(n)&&n.forEach(r=>{if(!Zs(r.indices)||!r.indices.length)return;const{indices:s,value:o}=r;let a={indices:s,value:o};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),t.matches.push(a)})}function wot(e,t){t.score=e.score}function Cot(e,t,{includeMatches:n=Tt.includeMatches,includeScore:r=Tt.includeScore}={}){const s=[];return n&&s.push(_ot),r&&s.push(wot),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(c=>{c(o,i)}),i})}class om{constructor(t,n={},r){this.options={...Tt,...n},this.options.useExtendedSearch,this._keyStore=new Kst(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof UN))throw new Error(zst);this._myIndex=n||Sae(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Zs(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,s=this._docs.length;r-1&&(c=c.slice(0,n)),Cot(c,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(t){const n=Pk(t,this.options),{records:r}=this._myIndex,s=[];return r.forEach(({v:o,i:a,n:i})=>{if(!Zs(o))return;const{isMatch:c,score:u,indices:f}=n.searchIn(o);c&&s.push({item:o,idx:a,matches:[{score:u,value:o,norm:i,indices:f}]})}),s}_searchLogical(t){const n=Tae(t,this.options),r=(i,c,u)=>{if(!i.children){const{keyId:m,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(c,m),searcher:p});return h&&h.length?[{idx:u,item:c,matches:h}]:[]}const f=[];for(let m=0,p=i.children.length;m{if(Zs(i)){let u=r(n,i,c);u.length&&(o[c]||(o[c]={idx:c,item:i,matches:[]},a.push(o[c])),u.forEach(({matches:f})=>{o[c].matches.push(...f)}))}}),a}_searchObjectList(t){const n=Pk(t,this.options),{keys:r,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!Zs(a))return;let c=[];r.forEach((u,f)=>{c.push(...this._findMatches({key:u,value:a[f],searcher:n}))}),c.length&&o.push({idx:i,item:a,matches:c})}),o}_findMatches({key:t,value:n,searcher:r}){if(!Zs(n))return[];let s=[];if(Yi(n))n.forEach(({v:o,i:a,n:i})=>{if(!Zs(o))return;const{isMatch:c,score:u,indices:f}=r.searchIn(o);c&&s.push({score:u,key:t,value:o,idx:a,norm:i,indices:f})});else{const{v:o,n:a}=n,{isMatch:i,score:c,indices:u}=r.searchIn(o);i&&s.push({score:c,key:t,value:o,norm:a,indices:u})}return s}}om.version="7.0.0";om.createIndex=Sae;om.parseIndex=not;om.config=Tt;om.parseQuery=Tae;yot(got);const Fk=[{currencyCode:"AED",type:"fiat",currency:W({defaultMessage:"United Arab Emirates dirham",id:"u/noLkGMVn"}),countryCode:"AE",symbol:"د.إ"},{currencyCode:"AFN",type:"fiat",currency:W({defaultMessage:"Afghan afghani",id:"HbCn83pcga"}),countryCode:"AF",symbol:"؋"},{currencyCode:"ALL",type:"fiat",currency:W({defaultMessage:"Albanian lek",id:"/il1Hf7GWO"}),countryCode:"AL",symbol:"L"},{currencyCode:"AMD",type:"fiat",currency:W({defaultMessage:"Armenian dram",id:"Sab4a7TKLH"}),countryCode:"AM",symbol:"֏"},{currencyCode:"ARS",type:"fiat",currency:W({defaultMessage:"Argentine peso",id:"52+/SFD8VZ"}),countryCode:"AR",symbol:"$"},{currencyCode:"AUD",type:"fiat",currency:W({defaultMessage:"Australian dollar",id:"iWILeLEVYR"}),countryCode:"AU",symbol:"$"},{currencyCode:"AWG",type:"fiat",currency:W({defaultMessage:"Aruban florin",id:"BEGfukujzF"}),countryCode:"AW",symbol:"ƒ"},{currencyCode:"BAM",type:"fiat",currency:W({defaultMessage:"Bosnia and Herzegovina convertible mark",id:"b09sYvQVre"}),countryCode:"BA",symbol:"KM"},{currencyCode:"BBD",type:"fiat",currency:W({defaultMessage:"Barbadian dollar",id:"VlWuwU66Ue"}),countryCode:"BB",symbol:"$"},{currencyCode:"BDT",type:"fiat",currency:W({defaultMessage:"Bangladeshi taka",id:"nzdEshqHWS"}),countryCode:"BD",symbol:"৳"},{currencyCode:"BGN",type:"fiat",currency:W({defaultMessage:"Bulgarian lev",id:"IDTjXBqV4N"}),countryCode:"BG",symbol:"лв"},{currencyCode:"BHD",type:"fiat",currency:W({defaultMessage:"Bahraini dinar",id:"eq8qHJx0kM"}),countryCode:"BH",symbol:".د.ب"},{currencyCode:"BIF",type:"fiat",currency:W({defaultMessage:"Burundian franc",id:"o/KpEtmYi4"}),countryCode:"BI",symbol:"FBu"},{currencyCode:"BMD",type:"fiat",currency:W({defaultMessage:"Bermudian dollar",id:"kO0KeiZ+IN"}),countryCode:"BM",symbol:"$"},{currencyCode:"BND",type:"fiat",currency:W({defaultMessage:"Brunei dollar",id:"GRkirfzc48"}),countryCode:"BN",symbol:"$"},{currencyCode:"BOB",type:"fiat",currency:W({defaultMessage:"Bolivian boliviano",id:"l7UUEAhjL1"}),countryCode:"BO",symbol:"Bs."},{currencyCode:"BRL",type:"fiat",currency:W({defaultMessage:"Brazilian real",id:"x+BZGn5rek"}),countryCode:"BR",symbol:"R$"},{currencyCode:"BSD",type:"fiat",currency:W({defaultMessage:"Bahamian dollar",id:"u9nfam/El1"}),countryCode:"BS",symbol:"$"},{currencyCode:"BTN",type:"fiat",currency:W({defaultMessage:"Bhutanese ngultrum",id:"EbzIZvY2C3"}),countryCode:"BT",symbol:"Nu."},{currencyCode:"BWP",type:"fiat",currency:W({defaultMessage:"Botswana pula",id:"TvRjxCQudG"}),countryCode:"BW",symbol:"P"},{currencyCode:"BZD",type:"fiat",currency:W({defaultMessage:"Belize dollar",id:"tnMfFVDwiX"}),countryCode:"BZ",symbol:"$"},{currencyCode:"CAD",type:"fiat",currency:W({defaultMessage:"Canadian dollar",id:"L4ftYFzYiG"}),countryCode:"CA",symbol:"$"},{currencyCode:"CDF",type:"fiat",currency:W({defaultMessage:"Congolese franc",id:"6DNXExdai2"}),countryCode:"CD",symbol:"FC"},{currencyCode:"CHF",type:"fiat",currency:W({defaultMessage:"Swiss franc",id:"113zTX3mKi"}),countryCode:"CH",symbol:"Fr."},{currencyCode:"CLP",type:"fiat",currency:W({defaultMessage:"Chilean peso",id:"tLhKy6Swhn"}),countryCode:"CL",symbol:"$"},{currencyCode:"CNH",type:"fiat",currency:W({defaultMessage:"Chinese yuan (offshore)",id:"wAShedQ5+o"}),countryCode:"CN",symbol:"¥"},{currencyCode:"CNY",type:"fiat",currency:W({defaultMessage:"Chinese yuan",id:"/sleu+8FUs"}),countryCode:"CN",symbol:"¥"},{currencyCode:"COP",type:"fiat",currency:W({defaultMessage:"Colombian peso",id:"KR2NhLe6wO"}),countryCode:"CO",symbol:"$"},{currencyCode:"CRC",type:"fiat",currency:W({defaultMessage:"Costa Rican colón",id:"OLgF3rrfev"}),countryCode:"CR",symbol:"₡"},{currencyCode:"CUP",type:"fiat",currency:W({defaultMessage:"Cuban peso",id:"ua/JslQGFc"}),countryCode:"CU",symbol:"$"},{currencyCode:"CVE",type:"fiat",currency:W({defaultMessage:"Cape Verdean escudo",id:"gg39Xd9NoM"}),countryCode:"CV",symbol:"$"},{currencyCode:"CYP",type:"fiat",currency:W({defaultMessage:"Cypriot pound",id:"xJn7heFKbn"}),countryCode:"CY",symbol:"£"},{currencyCode:"CZK",type:"fiat",currency:W({defaultMessage:"Czech koruna",id:"xpMdKvcamT"}),countryCode:"CZ",symbol:"Kč"},{currencyCode:"DJF",type:"fiat",currency:W({defaultMessage:"Djiboutian franc",id:"WtP9AoFz2A"}),countryCode:"DJ",symbol:"Fdj"},{currencyCode:"DKK",type:"fiat",currency:W({defaultMessage:"Danish krone",id:"Xy5G3y8jOw"}),countryCode:"DK",symbol:"kr"},{currencyCode:"DOP",type:"fiat",currency:W({defaultMessage:"Dominican peso",id:"2i/KFaPpw5"}),countryCode:"DO",symbol:"RD$"},{currencyCode:"DZD",type:"fiat",currency:W({defaultMessage:"Algerian dinar",id:"6sTpFM3olk"}),countryCode:"DZ",symbol:"دج"},{currencyCode:"EGP",type:"fiat",currency:W({defaultMessage:"Egyptian pound",id:"PxOcvtceh8"}),countryCode:"EG",symbol:"£"},{currencyCode:"ETB",type:"fiat",currency:W({defaultMessage:"Ethiopian birr",id:"6VjP5tvzWg"}),countryCode:"ET",symbol:"Br"},{currencyCode:"EUR",type:"fiat",currency:W({defaultMessage:"Euro",id:"Zz6d8XMgGD"}),countryCode:"EU",symbol:"€"},{currencyCode:"FJD",type:"fiat",currency:W({defaultMessage:"Fijian dollar",id:"w33lAGgTZS"}),countryCode:"FJ",symbol:"$"},{currencyCode:"GBP",type:"fiat",currency:W({defaultMessage:"Pound sterling",id:"uU25lEI6GM"}),countryCode:"GB",symbol:"£"},{currencyCode:"GEL",type:"fiat",currency:W({defaultMessage:"Georgian lari",id:"m4gS106RpO"}),countryCode:"GE",symbol:"₾"},{currencyCode:"GHS",type:"fiat",currency:W({defaultMessage:"Ghanaian cedi",id:"2k7sXvkoLP"}),countryCode:"GH",symbol:"₵"},{currencyCode:"GMD",type:"fiat",currency:W({defaultMessage:"Gambian dalasi",id:"zT8nD3rOKp"}),countryCode:"GM",symbol:"D"},{currencyCode:"GNF",type:"fiat",currency:W({defaultMessage:"Guinean franc",id:"kZk7wkuU9a"}),countryCode:"GN",symbol:"FG"},{currencyCode:"GTQ",type:"fiat",currency:W({defaultMessage:"Guatemalan quetzal",id:"0eSFsz1h5U"}),countryCode:"GT",symbol:"Q"},{currencyCode:"GYD",type:"fiat",currency:W({defaultMessage:"Guyanese dollar",id:"pvTNSDiMVb"}),countryCode:"GY",symbol:"$"},{currencyCode:"HKD",type:"fiat",currency:W({defaultMessage:"Hong Kong dollar",id:"tSeK2eAo7a"}),countryCode:"HK",symbol:"$"},{currencyCode:"HNL",type:"fiat",currency:W({defaultMessage:"Honduran lempira",id:"u1All4YZ/M"}),countryCode:"HN",symbol:"L"},{currencyCode:"HRK",type:"fiat",currency:W({defaultMessage:"Croatian kuna",id:"m4/bILMdtE"}),countryCode:"HR",symbol:"kn"},{currencyCode:"HTG",type:"fiat",currency:W({defaultMessage:"Haitian gourde",id:"fYPjhPHJw5"}),countryCode:"HT",symbol:"G"},{currencyCode:"HUF",type:"fiat",currency:W({defaultMessage:"Hungarian forint",id:"Bhl6SxOjG0"}),countryCode:"HU",symbol:"Ft"},{currencyCode:"IDR",type:"fiat",currency:W({defaultMessage:"Indonesian rupiah",id:"JnQBDoCEpL"}),countryCode:"ID",symbol:"Rp"},{currencyCode:"ILS",type:"fiat",currency:W({defaultMessage:"Israeli new shekel",id:"IxD6vfIMsj"}),countryCode:"IL",symbol:"₪"},{currencyCode:"INR",type:"fiat",currency:W({defaultMessage:"Indian rupee",id:"XnsufP9pQC"}),countryCode:"IN",symbol:"₹"},{currencyCode:"IQD",type:"fiat",currency:W({defaultMessage:"Iraqi dinar",id:"rmzi7U/4iu"}),countryCode:"IQ",symbol:"ع.د"},{currencyCode:"ISK",type:"fiat",currency:W({defaultMessage:"Icelandic króna",id:"+QCFy0sZgh"}),countryCode:"IS",symbol:"kr"},{currencyCode:"JMD",type:"fiat",currency:W({defaultMessage:"Jamaican dollar",id:"EkOwDtWSVs"}),countryCode:"JM",symbol:"J$"},{currencyCode:"JOD",type:"fiat",currency:W({defaultMessage:"Jordanian dinar",id:"B2GvyCUDsS"}),countryCode:"JO",symbol:"د.ا"},{currencyCode:"JPY",type:"fiat",currency:W({defaultMessage:"Japanese yen",id:"2PiQsV1fPp"}),countryCode:"JP",symbol:"¥"},{currencyCode:"KES",type:"fiat",currency:W({defaultMessage:"Kenyan shilling",id:"JIjYrchwhv"}),countryCode:"KE",symbol:"KSh"},{currencyCode:"KHR",type:"fiat",currency:W({defaultMessage:"Cambodian riel",id:"KCKOEaCtcY"}),countryCode:"KH",symbol:"៛"},{currencyCode:"KMF",type:"fiat",currency:W({defaultMessage:"Comorian franc",id:"WV9ZQdQeR+"}),countryCode:"KM",symbol:"CF"},{currencyCode:"KRW",type:"fiat",currency:W({defaultMessage:"South Korean won",id:"EiHQBnRax2"}),countryCode:"KR",symbol:"₩"},{currencyCode:"KWD",type:"fiat",currency:W({defaultMessage:"Kuwaiti dinar",id:"fkOQdpZmRV"}),countryCode:"KW",symbol:"د.ك"},{currencyCode:"KYD",type:"fiat",currency:W({defaultMessage:"Cayman Islands dollar",id:"RsdrXusNMV"}),countryCode:"KY",symbol:"$"},{currencyCode:"KZT",type:"fiat",currency:W({defaultMessage:"Kazakhstani tenge",id:"2qtVTeGWCE"}),countryCode:"KZ",symbol:"₸"},{currencyCode:"LAK",type:"fiat",currency:W({defaultMessage:"Lao kip",id:"Fgzd1G5Yfn"}),countryCode:"LA",symbol:"₭"},{currencyCode:"LBP",type:"fiat",currency:W({defaultMessage:"Lebanese pound",id:"FGzeEqNQzF"}),countryCode:"LB",symbol:"ل.ل"},{currencyCode:"LKR",type:"fiat",currency:W({defaultMessage:"Sri Lankan rupee",id:"a4/joWlRVu"}),countryCode:"LK",symbol:"Rs"},{currencyCode:"LRD",type:"fiat",currency:W({defaultMessage:"Liberian dollar",id:"FI1z5I01J6"}),countryCode:"LR",symbol:"$"},{currencyCode:"LSL",type:"fiat",currency:W({defaultMessage:"Lesotho loti",id:"csvFpR0QuR"}),countryCode:"LS",symbol:"L"},{currencyCode:"LTL",type:"fiat",currency:W({defaultMessage:"Lithuanian litas",id:"0eziwi9562"}),countryCode:"LT",symbol:"Lt"},{currencyCode:"LYD",type:"fiat",currency:W({defaultMessage:"Libyan dinar",id:"MHH+Pd33wK"}),countryCode:"LY",symbol:"ل.د"},{currencyCode:"MAD",type:"fiat",currency:W({defaultMessage:"Moroccan dirham",id:"ECYUhp5Zzw"}),countryCode:"MA",symbol:"د.م."},{currencyCode:"MDL",type:"fiat",currency:W({defaultMessage:"Moldovan leu",id:"b0q4AtgUSW"}),countryCode:"MD",symbol:"L"},{currencyCode:"MGA",type:"fiat",currency:W({defaultMessage:"Malagasy ariary",id:"7X6Af0dVLl"}),countryCode:"MG",symbol:"Ar"},{currencyCode:"MKD",type:"fiat",currency:W({defaultMessage:"Macedonian denar",id:"RCCw/rBMD7"}),countryCode:"MK",symbol:"ден"},{currencyCode:"MMK",type:"fiat",currency:W({defaultMessage:"Burmese kyat",id:"09O/caoUOd"}),countryCode:"MM",symbol:"K"},{currencyCode:"MOP",type:"fiat",currency:W({defaultMessage:"Macanese pataca",id:"WSCDGHnfAP"}),countryCode:"MO",symbol:"P"},{currencyCode:"MUR",type:"fiat",currency:W({defaultMessage:"Mauritian rupee",id:"B7EPhc2k1/"}),countryCode:"MU",symbol:"₨"},{currencyCode:"MVR",type:"fiat",currency:W({defaultMessage:"Maldivian rufiyaa",id:"WKep/6FHLO"}),countryCode:"MV",symbol:"Rf"},{currencyCode:"MWK",type:"fiat",currency:W({defaultMessage:"Malawian kwacha",id:"0QSRp0Tfcl"}),countryCode:"MW",symbol:"MK"},{currencyCode:"MXN",type:"fiat",currency:W({defaultMessage:"Mexican peso",id:"cAJvdQ+v2Y"}),countryCode:"MX",symbol:"$"},{currencyCode:"MXV",type:"fiat",currency:W({defaultMessage:"Mexican Unidad de Inversion (UDI)",id:"pJjurDaC1J"}),countryCode:"MX",symbol:"UDI"},{currencyCode:"MYR",type:"fiat",currency:W({defaultMessage:"Malaysian ringgit",id:"BJOmmIMKBn"}),countryCode:"MY",symbol:"RM"},{currencyCode:"MZN",type:"fiat",currency:W({defaultMessage:"Mozambican metical",id:"KVoUcWYwrs"}),countryCode:"MZ",symbol:"MT"},{currencyCode:"NAD",type:"fiat",currency:W({defaultMessage:"Namibian dollar",id:"ofXViiQOEO"}),countryCode:"NA",symbol:"$"},{currencyCode:"NGN",type:"fiat",currency:W({defaultMessage:"Nigerian naira",id:"YtrB6By6fQ"}),countryCode:"NG",symbol:"₦"},{currencyCode:"NIO",type:"fiat",currency:W({defaultMessage:"Nicaraguan córdoba",id:"NJJMgSKcDP"}),countryCode:"NI",symbol:"C$"},{currencyCode:"NOK",type:"fiat",currency:W({defaultMessage:"Norwegian krone",id:"X7p/vNj1w0"}),countryCode:"NO",symbol:"kr"},{currencyCode:"NPR",type:"fiat",currency:W({defaultMessage:"Nepalese rupee",id:"KpP5Ur9yKv"}),countryCode:"NP",symbol:"₨"},{currencyCode:"NZD",type:"fiat",currency:W({defaultMessage:"New Zealand dollar",id:"uoVYggIiS7"}),countryCode:"NZ",symbol:"$"},{currencyCode:"OMR",type:"fiat",currency:W({defaultMessage:"Omani rial",id:"YuZlkmlwz6"}),countryCode:"OM",symbol:"ر.ع."},{currencyCode:"PAB",type:"fiat",currency:W({defaultMessage:"Panamanian balboa",id:"WsXJoQA7BU"}),countryCode:"PA",symbol:"B/."},{currencyCode:"PEN",type:"fiat",currency:W({defaultMessage:"Peruvian sol",id:"Gzey/zBCdq"}),countryCode:"PE",symbol:"S/."},{currencyCode:"PGK",type:"fiat",currency:W({defaultMessage:"Papua New Guinean kina",id:"1odcdptMV2"}),countryCode:"PG",symbol:"K"},{currencyCode:"PHP",type:"fiat",currency:W({defaultMessage:"Philippine peso",id:"Ze94/Fib/J"}),countryCode:"PH",symbol:"₱"},{currencyCode:"PKR",type:"fiat",currency:W({defaultMessage:"Pakistani rupee",id:"xg2ovH8pDh"}),countryCode:"PK",symbol:"₨"},{currencyCode:"PLN",type:"fiat",currency:W({defaultMessage:"Polish złoty",id:"5nGZooUDXi"}),countryCode:"PL",symbol:"zł"},{currencyCode:"PYG",type:"fiat",currency:W({defaultMessage:"Paraguayan guaraní",id:"faGTF61Eyw"}),countryCode:"PY",symbol:"₲"},{currencyCode:"QAR",type:"fiat",currency:W({defaultMessage:"Qatari riyal",id:"DuHEQnjrPb"}),countryCode:"QA",symbol:"ر.ق"},{currencyCode:"RON",type:"fiat",currency:W({defaultMessage:"Romanian leu",id:"lXgl4aKBP3"}),countryCode:"RO",symbol:"lei"},{currencyCode:"RSD",type:"fiat",currency:W({defaultMessage:"Serbian dinar",id:"giqvsRUiA5"}),countryCode:"RS",symbol:"дин."},{currencyCode:"RUB",type:"fiat",currency:W({defaultMessage:"Russian ruble",id:"4U+m5Kd694"}),countryCode:"RU",symbol:"₽"},{currencyCode:"RWF",type:"fiat",currency:W({defaultMessage:"Rwandan franc",id:"URbs3Tt0On"}),countryCode:"RW",symbol:"FRw"},{currencyCode:"SAR",type:"fiat",currency:W({defaultMessage:"Saudi riyal",id:"p6D2TLqko8"}),countryCode:"SA",symbol:"ر.س"},{currencyCode:"SCR",type:"fiat",currency:W({defaultMessage:"Seychellois rupee",id:"V7Ju6HZQJK"}),countryCode:"SC",symbol:"₨"},{currencyCode:"SDG",type:"fiat",currency:W({defaultMessage:"Sudanese pound",id:"FsgRxw4tdm"}),countryCode:"SD",symbol:"ج.س."},{currencyCode:"SEK",type:"fiat",currency:W({defaultMessage:"Swedish krona",id:"WoyUwT/z0X"}),countryCode:"SE",symbol:"kr"},{currencyCode:"SGD",type:"fiat",currency:W({defaultMessage:"Singapore dollar",id:"SCjBmFU+PM"}),countryCode:"SG",symbol:"$"},{currencyCode:"SHP",type:"fiat",currency:W({defaultMessage:"Saint Helena pound",id:"XZdS6/MxwW"}),countryCode:"SH",symbol:"£"},{currencyCode:"SLL",type:"fiat",currency:W({defaultMessage:"Sierra Leonean leone",id:"DFZ4yqf1EG"}),countryCode:"SL",symbol:"Le"},{currencyCode:"SOS",type:"fiat",currency:W({defaultMessage:"Somali shilling",id:"e7cANdrF41"}),countryCode:"SO",symbol:"Sh.So."},{currencyCode:"SVC",type:"fiat",currency:W({defaultMessage:"Salvadoran colón",id:"A2mT13SXuX"}),countryCode:"SV",symbol:"₡"},{currencyCode:"SZL",type:"fiat",currency:W({defaultMessage:"Swazi lilangeni",id:"+kNQR2VJjT"}),countryCode:"SZ",symbol:"E"},{currencyCode:"THB",type:"fiat",currency:W({defaultMessage:"Thai baht",id:"Yz36aOmXMd"}),countryCode:"TH",symbol:"฿"},{currencyCode:"TJS",type:"fiat",currency:W({defaultMessage:"Tajikistani somoni",id:"G3q+8He+TZ"}),countryCode:"TJ",symbol:"ЅM"},{currencyCode:"TMT",type:"fiat",currency:W({defaultMessage:"Turkmenistan manat",id:"iV0j+gxDPN"}),countryCode:"TM",symbol:"m"},{currencyCode:"TND",type:"fiat",currency:W({defaultMessage:"Tunisian dinar",id:"l6iU1LyMSk"}),countryCode:"TN",symbol:"د.ت"},{currencyCode:"TRY",type:"fiat",currency:W({defaultMessage:"Turkish lira",id:"hQ9m98Llgt"}),countryCode:"TR",symbol:"₺"},{currencyCode:"TTD",type:"fiat",currency:W({defaultMessage:"Trinidad and Tobago dollar",id:"Op/jRg7//J"}),countryCode:"TT",symbol:"TT$"},{currencyCode:"TWD",type:"fiat",currency:W({defaultMessage:"New Taiwan dollar",id:"yAeWHzFY54"}),countryCode:"TW",symbol:"NT$"},{currencyCode:"TZS",type:"fiat",currency:W({defaultMessage:"Tanzanian shilling",id:"7YNH90CDt1"}),countryCode:"TZ",symbol:"TSh"},{currencyCode:"UAH",type:"fiat",currency:W({defaultMessage:"Ukrainian hryvnia",id:"HCy2dyACi0"}),countryCode:"UA",symbol:"₴"},{currencyCode:"UGX",type:"fiat",currency:W({defaultMessage:"Ugandan shilling",id:"P5STuJcFRi"}),countryCode:"UG",symbol:"USh"},{currencyCode:"USD",type:"fiat",currency:W({defaultMessage:"United States dollar",id:"BPRJDRwXU1"}),countryCode:"US",symbol:"$"},{currencyCode:"UYU",type:"fiat",currency:W({defaultMessage:"Uruguayan peso",id:"HtXUCx6BL1"}),countryCode:"UY",symbol:"$U"},{currencyCode:"UZS",type:"fiat",currency:W({defaultMessage:"Uzbekistani soʻm",id:"lv4m0Kbuw1"}),countryCode:"UZ",symbol:"so'm"},{currencyCode:"VND",type:"fiat",currency:W({defaultMessage:"Vietnamese đồng",id:"We/RqEPpOp"}),countryCode:"VN",symbol:"₫"},{currencyCode:"XAF",type:"fiat",currency:W({defaultMessage:"Central African CFA franc",id:"fZwFESvHCw"}),countryCode:"CF",symbol:"FCFA"},{currencyCode:"XAG",type:"commodity",currency:W({defaultMessage:"Silver (troy ounce)",id:"XVTnv5Liuj"}),countryCode:"ZZ",symbol:"XAG"},{currencyCode:"XAU",type:"commodity",currency:W({defaultMessage:"Gold (troy ounce)",id:"s3i6lUYb/y"}),countryCode:"ZZ",symbol:"XAU"},{currencyCode:"XCD",type:"fiat",currency:W({defaultMessage:"East Caribbean dollar",id:"pXF3HmkspQ"}),countryCode:"AG",symbol:"$"},{currencyCode:"XDR",type:"fiat",currency:W({defaultMessage:"Special drawing rights",id:"X4eXXVN7wq"}),countryCode:"ZZ",symbol:"SDR"},{currencyCode:"XOF",type:"fiat",currency:W({defaultMessage:"West African CFA franc",id:"cezzLNBm20"}),countryCode:"SN",symbol:"CFA"},{currencyCode:"XPF",type:"fiat",currency:W({defaultMessage:"CFP franc",id:"txe+aX9vvZ"}),countryCode:"PF",symbol:"₣"},{currencyCode:"YER",type:"fiat",currency:W({defaultMessage:"Yemeni rial",id:"lRXRuW4arm"}),countryCode:"YE",symbol:"﷼"},{currencyCode:"ZAC",type:"fiat",currency:W({defaultMessage:"South African rand (financial)",id:"GsJykrhxvK"}),countryCode:"ZA",symbol:"R"},{currencyCode:"ZAR",type:"fiat",currency:W({defaultMessage:"South African rand",id:"MbU2//IGEL"}),countryCode:"ZA",symbol:"R"},{currencyCode:"ZMW",type:"fiat",currency:W({defaultMessage:"Zambian kwacha",id:"ZJnHTLBz2v"}),countryCode:"ZM",symbol:"ZK"},{currencyCode:"BTC",type:"crypto",currency:W({defaultMessage:"Bitcoin",id:"RkW5weBw8q"}),symbol:"₿"},{currencyCode:"ETH",type:"crypto",currency:W({defaultMessage:"Ethereum",id:"ohE0sWxJfP"}),symbol:"Ξ"},{currencyCode:"XRP",type:"crypto",currency:W({defaultMessage:"XRP",id:"rwHxdc9N83"}),symbol:"XRP"},{currencyCode:"BNB",type:"crypto",currency:W({defaultMessage:"BNB",id:"+x/JA+cbSg"}),symbol:"BNB"},{currencyCode:"USDT",type:"crypto",currency:W({defaultMessage:"Tether",id:"G17JtC1DRO"}),symbol:"USDT"},{currencyCode:"SOL",type:"crypto",currency:W({defaultMessage:"Solana",id:"RmbsLR1XI9"}),symbol:"SOL"},{currencyCode:"HYPE",type:"crypto",currency:W({defaultMessage:"HYPE",id:"sRJuK+IQu7"}),symbol:"HYPE"},{currencyCode:"STETH",type:"crypto",currency:W({defaultMessage:"stETH",id:"VNvqEhRv0o"}),symbol:"stETH"},{currencyCode:"WTRX",type:"crypto",currency:W({defaultMessage:"Wrapped TRX",id:"hi8IgS7Vvh"}),symbol:"WTRX"},{currencyCode:"DOGE",type:"crypto",currency:W({defaultMessage:"Dogecoin",id:"Q4KOhNgUFl"}),symbol:"DOGE"},{currencyCode:"ADA",type:"crypto",currency:W({defaultMessage:"Cardano",id:"Zk+zRo7Vav"}),symbol:"ADA"},{currencyCode:"TRX",type:"crypto",currency:W({defaultMessage:"TRON",id:"fLtNc/n43W"}),symbol:"TRX"},{currencyCode:"USDC",type:"crypto",currency:W({defaultMessage:"USD Coin",id:"tPc0IbLJq0"}),symbol:"USDC"},{currencyCode:"WBTC",type:"crypto",currency:W({defaultMessage:"Wrapped Bitcoin",id:"AO1Xrr+Cwk"}),symbol:"WBTC"},{currencyCode:"WSTETH",type:"crypto",currency:W({defaultMessage:"Wrapped stETH",id:"Fg7h7ipjGE"}),symbol:"wstETH"},{currencyCode:"EDLC",type:"crypto",currency:W({defaultMessage:"EDLC",id:"FplbXN+574"}),symbol:"EDLC"},{currencyCode:"LINK",type:"crypto",currency:W({defaultMessage:"Chainlink",id:"d/A799ZTa/"}),symbol:"LINK"},{currencyCode:"AIC",type:"crypto",currency:W({defaultMessage:"AIC",id:"RSOIsb9pEC"}),symbol:"AIC"},{currencyCode:"XLM",type:"crypto",currency:W({defaultMessage:"Stellar",id:"+uYwRW10Bd"}),symbol:"XLM"},{currencyCode:"WETH",type:"crypto",currency:W({defaultMessage:"Wrapped Ether",id:"s8UwDT+8t2"}),symbol:"WETH"},{currencyCode:"BCH",type:"crypto",currency:W({defaultMessage:"Bitcoin Cash",id:"hLt+wzROTK"}),symbol:"BCH"},{currencyCode:"UST",type:"crypto",currency:W({defaultMessage:"TerraUSD",id:"wot2OPkJDe"}),symbol:"UST"},{currencyCode:"AVAX",type:"crypto",currency:W({defaultMessage:"Avalanche",id:"C9K+TI7R4G"}),symbol:"AVAX"},{currencyCode:"SUI",type:"crypto",currency:W({defaultMessage:"Sui",id:"CvmoCbTblr"}),symbol:"SUI"},{currencyCode:"LTC",type:"crypto",currency:W({defaultMessage:"Litecoin",id:"oyKw8Dr6hh"}),symbol:"LTC"},{currencyCode:"TON",type:"crypto",currency:W({defaultMessage:"Toncoin",id:"V2AxdWxVB/"}),symbol:"TON"},{currencyCode:"HBAR",type:"crypto",currency:W({defaultMessage:"Hedera",id:"yLSpOa++/L"}),symbol:"HBAR"},{currencyCode:"WHBAR",type:"crypto",currency:W({defaultMessage:"Wrapped HBAR",id:"rfimaaddr1"}),symbol:"WHBAR"},{currencyCode:"UNI",type:"crypto",currency:W({defaultMessage:"Uniswap",id:"hincAkLfxR"}),symbol:"UNI"},{currencyCode:"BTCB",type:"crypto",currency:W({defaultMessage:"Bitcoin BEP2",id:"T7D16Bt6JS"}),symbol:"BTCB"},{currencyCode:"OKB",type:"crypto",currency:W({defaultMessage:"OKB",id:"6ZLe/X3P+I"}),symbol:"OKB"},{currencyCode:"SHIB",type:"crypto",currency:W({defaultMessage:"Shiba Inu",id:"dwuQAuovNP"}),symbol:"SHIB"},{currencyCode:"USDS",type:"crypto",currency:W({defaultMessage:"StableUSD",id:"DAzSEb0LeA"}),symbol:"USDS"},{currencyCode:"WBT",type:"crypto",currency:W({defaultMessage:"WhiteBIT Coin",id:"Lj9Zp416rG"}),symbol:"WBT"},{currencyCode:"BGB",type:"crypto",currency:W({defaultMessage:"Bitget Token",id:"OEQgkmdE1O"}),symbol:"BGB"},{currencyCode:"DAI",type:"crypto",currency:W({defaultMessage:"Dai",id:"7g+Z6oltsB"}),symbol:"DAI"},{currencyCode:"DOT",type:"crypto",currency:W({defaultMessage:"Polkadot",id:"iS7ue2zjn0"}),symbol:"DOT"},{currencyCode:"XMR",type:"crypto",currency:W({defaultMessage:"Monero",id:"RydJABkA4a"}),symbol:"XMR"},{currencyCode:"MNT",type:"crypto",currency:W({defaultMessage:"MNT",id:"90qNZszLR/"}),symbol:"MNT"},{currencyCode:"PEPE",type:"crypto",currency:W({defaultMessage:"Pepe",id:"x9wJbmzZhn"}),symbol:"PEPE"},{currencyCode:"AAVE",type:"crypto",currency:W({defaultMessage:"Aave",id:"kFjzNltaTL"}),symbol:"AAVE"},{currencyCode:"CRO",type:"crypto",currency:W({defaultMessage:"Cronos",id:"2cg8W1gIo3"}),symbol:"CRO"},{currencyCode:"ETC",type:"crypto",currency:W({defaultMessage:"Ethereum Classic",id:"Bv9Xkw6kNg"}),symbol:"ETC"},{currencyCode:"FD",type:"crypto",currency:W({defaultMessage:"FD",id:"+Q62UIi/LA"}),symbol:"FD"},{currencyCode:"TUSD",type:"crypto",currency:W({defaultMessage:"TrueUSD",id:"whDnhXYdIe"}),symbol:"TUSD"},{currencyCode:"NEAR",type:"crypto",currency:W({defaultMessage:"NEAR Protocol",id:"E9RsfkMwMk"}),symbol:"NEAR"},{currencyCode:"METAGAMES",type:"crypto",currency:W({defaultMessage:"MetaGames",id:"C0GGroVhnP"}),symbol:"METAGAMES"},{currencyCode:"TAO",type:"crypto",currency:W({defaultMessage:"Bittensor",id:"6+C0Ut5hKl"}),symbol:"TAO"},{currencyCode:"ICP",type:"crypto",currency:W({defaultMessage:"Internet Computer",id:"q9uyMXlX+M"}),symbol:"ICP"},{currencyCode:"GT",type:"crypto",currency:W({defaultMessage:"GateToken",id:"dSGfpIcmmI"}),symbol:"GT"},{currencyCode:"RETH",type:"crypto",currency:W({defaultMessage:"Rocket Pool ETH",id:"pg4o1kZ2d4"}),symbol:"rETH"},{currencyCode:"MRS",type:"crypto",currency:W({defaultMessage:"MRS",id:"CABw3watNU"}),symbol:"MRS"},{currencyCode:"APT",type:"crypto",currency:W({defaultMessage:"Aptos",id:"/U15UItsIY"}),symbol:"APT"},{currencyCode:"KAS",type:"crypto",currency:W({defaultMessage:"Kaspa",id:"1MwSSUoCwu"}),symbol:"KAS"},{currencyCode:"ALGO",type:"crypto",currency:W({defaultMessage:"Algorand",id:"TijDBb1K3w"}),symbol:"ALGO"},{currencyCode:"PENGU",type:"crypto",currency:W({defaultMessage:"PENGU",id:"esTSdYyjL9"}),symbol:"PENGU"},{currencyCode:"VET",type:"crypto",currency:W({defaultMessage:"VeChain",id:"o3b918Uwm9"}),symbol:"VET"},{currencyCode:"OTRUMP",type:"crypto",currency:W({defaultMessage:"OTRUMP",id:"dwjxu1ZNrs"}),symbol:"OTRUMP"},{currencyCode:"ARB",type:"crypto",currency:W({defaultMessage:"Arbitrum",id:"2qF6KBPwqc"}),symbol:"ARB"},{currencyCode:"LUNA1",type:"crypto",currency:W({defaultMessage:"Terra (LUNA1)",id:"g5JtKAkJm/"}),symbol:"LUNA1"},{currencyCode:"MKR",type:"crypto",currency:W({defaultMessage:"Maker",id:"iVoUggHR7n"}),symbol:"MKR"},{currencyCode:"QNT",type:"crypto",currency:W({defaultMessage:"Quant",id:"kZiBtRgPXK"}),symbol:"QNT"},{currencyCode:"BONK",type:"crypto",currency:W({defaultMessage:"BONK",id:"/WOyXrLUEt"}),symbol:"BONK"},{currencyCode:"ATOM",type:"crypto",currency:W({defaultMessage:"Cosmos",id:"VfvhDOBZSq"}),symbol:"ATOM"},{currencyCode:"FTN",type:"crypto",currency:W({defaultMessage:"FTN",id:"+BtHlnfKBJ"}),symbol:"FTN"},{currencyCode:"KCS",type:"crypto",currency:W({defaultMessage:"KuCoin Token",id:"J6x8n/y945"}),symbol:"KCS"},{currencyCode:"RNDR",type:"crypto",currency:W({defaultMessage:"Render",id:"fI33PYpQj/"}),symbol:"RNDR"},{currencyCode:"BNX",type:"crypto",currency:W({defaultMessage:"BNX",id:"/mzOvKP3DB"}),symbol:"BNX"},{currencyCode:"FIL",type:"crypto",currency:W({defaultMessage:"Filecoin",id:"O60m1dM5+I"}),symbol:"FIL"},{currencyCode:"WBNB",type:"crypto",currency:W({defaultMessage:"Wrapped BNB",id:"6oPoIEcEKM"}),symbol:"WBNB"},{currencyCode:"DUCK",type:"crypto",currency:W({defaultMessage:"DUCK",id:"Wy2n2zHjyn"}),symbol:"DUCK"},{currencyCode:"ONDO",type:"crypto",currency:W({defaultMessage:"Ondo",id:"Mdh4nCMVFp"}),symbol:"ONDO"},{currencyCode:"EZETH",type:"crypto",currency:W({defaultMessage:"EZETH",id:"GquMfdHRpr"}),symbol:"EZETH"},{currencyCode:"DHN",type:"crypto",currency:W({defaultMessage:"DHN",id:"3DBrwMVTuR"}),symbol:"DHN"},{currencyCode:"SPX",type:"crypto",currency:W({defaultMessage:"SPX",id:"78Gbn14660"}),symbol:"SPX"},{currencyCode:"XDC",type:"crypto",currency:W({defaultMessage:"XDC Network",id:"f4v54xCFpd"}),symbol:"XDC"},{currencyCode:"ENA",type:"crypto",currency:W({defaultMessage:"ENA",id:"G6NRdu/3/f"}),symbol:"ENA"},{currencyCode:"SOLVBTCBBN",type:"crypto",currency:W({defaultMessage:"SOLVBTCBBN",id:"U+VGyLBIbO"}),symbol:"SOLVBTCBBN"},{currencyCode:"LDO",type:"crypto",currency:W({defaultMessage:"Lido DAO",id:"Hm40klV7dx"}),symbol:"LDO"},{currencyCode:"INJ",type:"crypto",currency:W({defaultMessage:"Injective",id:"Zy5gqTZCK/"}),symbol:"INJ"},{currencyCode:"USD0",type:"crypto",currency:W({defaultMessage:"USD0",id:"I8k7Is+SUX"}),symbol:"USD0"},{currencyCode:"FLR",type:"crypto",currency:W({defaultMessage:"Flare",id:"EuWzA+LwQr"}),symbol:"FLR"},{currencyCode:"PY",type:"crypto",currency:W({defaultMessage:"PY",id:"2WmUk53rca"}),symbol:"PY"},{currencyCode:"SEI",type:"crypto",currency:W({defaultMessage:"Sei",id:"uIVFPKXueM"}),symbol:"SEI"},{currencyCode:"MSOL",type:"crypto",currency:W({defaultMessage:"Marinade Staked SOL",id:"Sgo9VGem0+"}),symbol:"mSOL"},{currencyCode:"CRV",type:"crypto",currency:W({defaultMessage:"Curve DAO Token",id:"hv2sTxuyJY"}),symbol:"CRV"},{currencyCode:"FTM",type:"crypto",currency:W({defaultMessage:"Fantom",id:"FdV4Gc/fz2"}),symbol:"FTM"},{currencyCode:"FLOKI",type:"crypto",currency:W({defaultMessage:"FLOKI",id:"d2sPiyXVq8"}),symbol:"FLOKI"},{currencyCode:"CMETH",type:"crypto",currency:W({defaultMessage:"CMETH",id:"ZXQlnD2obl"}),symbol:"CMETH"},{currencyCode:"SLISBNB",type:"crypto",currency:W({defaultMessage:"SLISBNB",id:"wqx7ZL4lbr"}),symbol:"SLISBNB"},{currencyCode:"FARTCOIN",type:"crypto",currency:W({defaultMessage:"FARTCOIN",id:"qFlNIb5L+O"}),symbol:"FARTCOIN"},{currencyCode:"EETH",type:"crypto",currency:W({defaultMessage:"eETH",id:"tCrC5owpVn"}),symbol:"eETH"},{currencyCode:"KAIA",type:"crypto",currency:W({defaultMessage:"KAIA",id:"fDXZE/gzgq"}),symbol:"KAIA"},{currencyCode:"GRT",type:"crypto",currency:W({defaultMessage:"The Graph",id:"oFrVNds2cX"}),symbol:"GRT"},{currencyCode:"IMX",type:"crypto",currency:W({defaultMessage:"Immutable",id:"+0mthqqK1s"}),symbol:"IMX"},{currencyCode:"WIF",type:"crypto",currency:W({defaultMessage:"WIF",id:"tK0cRtUi/S"}),symbol:"WIF"},{currencyCode:"RAY",type:"crypto",currency:W({defaultMessage:"Raydium",id:"pSdm2ZTXHD"}),symbol:"RAY"},{currencyCode:"OP",type:"crypto",currency:W({defaultMessage:"Optimism",id:"ghDrrz64nC"}),symbol:"OP"},{currencyCode:"XAUT",type:"crypto",currency:W({defaultMessage:"Tether Gold",id:"pobzwuxAfg"}),symbol:"XAUT"},{currencyCode:"PENDLE",type:"crypto",currency:W({defaultMessage:"Pendle",id:"z8diWExCd3"}),symbol:"PENDLE"}],zu=(e,t="default")=>{if(!e)return"";const n=t==="indian"?"en-IN":"en-US",r=new Intl.NumberFormat(n,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:100}),s=e.endsWith("."),o=e.split("."),a=o[0]||"0",i=o[1]||"",c=parseFloat(e);if(isNaN(c))return"";let f=r.format(parseFloat(a));return o.length>1?f+="."+i:s&&(f+="."),f},Aae=A.memo(({value:e,onChange:t,placeholder:n="0",disabled:r=!1,className:s="",min:o,max:a,step:i=1,formatting:c="default"})=>{const u=d.useRef(null),[f,m]=d.useState(zu(e,c)),p=d.useCallback(x=>x.replace(/,/g,""),[]),h=d.useCallback(x=>{const v=x.target.value,b=p(v),_=x.target.selectionStart||0;if(b===""||/^\d*\.?\d*$/.test(b)&&!/e/i.test(v)){const w=zu(b,c);m(w),t(b),requestAnimationFrame(()=>{if(u.current){const S=v.substring(0,_),C=p(S);let E=0,T=0;const k=C.replace(".","").length,I=C.includes(".")&&C.endsWith(".");for(let M=0;M{const v=u.current;if(!v||(x.metaKey||x.ctrlKey)&&(x.key==="z"||x.key==="Z"))return;const{selectionStart:b,selectionEnd:_,value:w}=v;if(x.key==="ArrowUp"||x.key==="ArrowDown"){x.preventDefault();const S=parseFloat(p(e))||0,C=x.key==="ArrowUp"?i:-i;let E=S+C;o!==void 0&&Ea&&(E=a);const T=E.toString(),k=zu(T,c);m(k),t(T);return}if(x.key==="Backspace"&&b===_){if(b===null)return;if(w[b-1]===","){x.preventDefault();const C=w.substring(0,b-1),E=w.substring(b),T=C[C.length-1];if(T&&/\d/.test(T)){const k=C.slice(0,-1)+E,I=p(k),M=zu(I,c);m(M),t(I),setTimeout(()=>{const N=M.length-p(E).length;v.setSelectionRange(N,N)},0)}}}},[p,t,e,i,o,a,c]),y=d.useCallback(x=>{x.preventDefault();const v=x.clipboardData.getData("text"),b=p(v);if(/^\d*\.?\d*$/.test(b)&&!/e/i.test(v)){const _=zu(b,c);m(_),t(b)}},[p,t,c]);return A.useEffect(()=>{const x=zu(e,c);m(x)},[e,c]),l.jsx("input",{ref:u,type:"text",value:f,onChange:h,onKeyDown:g,onPaste:y,placeholder:n,disabled:r,className:s,inputMode:"decimal"})});Aae.displayName="CurrencyInput";const Xg=A.memo(({symbol:e,src:t,srcDark:n,className:r,size:s="lg",colorScheme:o})=>{n=n??t;const[a,i]=d.useState(!1),c=d.useRef(null),u=Ss(),f=o??u.colorScheme,m=()=>{c.current&&c.current.naturalHeight>0&&i(!1)};d.useEffect(()=>{c.current&&(c.current.complete&&c.current.naturalHeight===0?i(!0):i(!1))},[c]),d.useEffect(()=>{i(!1)},[e]);const p=f==="dark"?n:t;return l.jsx("div",{className:z({"size-lg":s==="lg","size-md":s==="md","size-sm":s==="sm"},"flex shrink-0 items-center justify-center",r),children:a||!p?l.jsx(Sot,{symbol:e}):l.jsx("img",{ref:c,src:p,alt:e,className:"size-full rounded-[4px] object-contain",onError:()=>{i(!0)},onLoad:m},e)})});Xg.displayName="FinanceAssetLogo";const Sot=({symbol:e})=>{const t=d.useMemo(()=>e.replace(/[^a-zA-Z0-9]/g,"").slice(0,1).toUpperCase(),[e]);return l.jsx(K,{variant:"subtle",className:"flex size-full items-center justify-center rounded-full",children:l.jsx(V,{color:"light",children:l.jsx("span",{className:"font-mono opacity-70",children:t||l.jsx(ut,{name:B("coin"),className:"size-4 text-gray-100 opacity-50"})})})})},Eot=(e,t)=>{if(!e?.id)return!1;const{status:n,...r}=e,{status:s,...o}=t;return Cr(r,o)&&n!==s},VN=d.memo(({open:e,onClose:t,initialConfiguration:n,onSave:r,source:s,trackEvent:o,errorMessage:a,canEditSpace:i,canDelete:c})=>{const u=J(),{$t:f}=u,m=ui(),p="automation-modal",[h,g]=d.useState(!1),[y,x]=d.useState(null),[v,b]=d.useState(!1),_=d.useCallback(()=>{x(null),t()},[t]),{currentConfiguration:w,setCurrentConfiguration:S,onClickSave:C,onClickDelete:E,isLoading:T,isSaveDisabled:k,saveButtonTooltipText:I}=nKe({initialConfiguration:n,isModalOpened:e,reason:p,source:s,onSuccess:R=>{let P=R;R==="updated"&&Eot(n,w)&&(P=w.status==="PAUSED"?"paused":"resumed"),r?.(P),_(),g(P)},onError:x});d.useEffect(()=>{e&&(dk(s)?o?.("task modal opened",{source:s}):LP(s)?o?.("price alert modal opened",{source:s}):FP(s)&&o?.("shortcut modal opened",{source:s}))},[e,s,o]);const M=d.useMemo(()=>{const R=[];return w.id&&c&&R.push({text:f({defaultMessage:"Delete",id:"K3r6DQW7h+"}),variant:"rejecter",onClick:E,disabled:T}),R.push({text:f({defaultMessage:"Cancel",id:"47FYwba+bI"}),variant:"common",onClick:_}),R.push({text:f({defaultMessage:"Save",id:"jvo0vs3nF0"}),variant:"primary",onClick:C,disabled:k,tooltipText:I}),R},[f,c,w.id,T,k,E,C,_,I]),N=d.useCallback(R=>{const P=R?"ACTIVE":"PAUSED",L=P==="PAUSED"?"paused":"resumed";switch(S({...w,status:P}),w.trigger.type){case Ze.SCHEDULED:dk(s)&&hre(L)&&o?.("task modal action",{source:s,action:L});break;case Ze.PRICE_ALERT:LP(s)&&Jqe(L)&&o?.("price alert modal action",{source:s,action:L});break;case Ze.SHORTCUT:FP(s)&&tKe(L)&&o?.("shortcut modal action",{source:s,action:L});break;default:At(w.trigger)}},[w,S,s,o]),D=d.useMemo(()=>{if(!w.id||w.trigger.type===Ze.PRICE_ALERT)return null;const R=w.status!=="PAUSED";return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fg,{checked:R,onCheckedChange:N,disabled:T,"aria-label":f({defaultMessage:"Toggle automation status",id:"1IPeYXLNjx"})}),l.jsx("span",{children:f(R?{defaultMessage:"Active",id:"3a5wL8wo40"}:{defaultMessage:"Paused",id:"C2iTEHtK//"})})]})},[f,w.id,w.status,w.trigger.type,N,T]),j=d.useCallback(R=>{const P=y4(R);S(P)},[S]),F=d.useCallback(()=>{g(!1)},[]);return d.useEffect(()=>{n&&!v&&e&&(j(n),b(!0))},[j,v,n,e]),d.useEffect(()=>{e||b(!1)},[e]),l.jsxs(l.Fragment,{children:[l.jsx(po,{isOpen:e,onClose:_,title:Lye({intl:u,triggerType:w.trigger.type}),titleTextVariant:"base",footerContent:D,actionList:M,footerClassname:"!pt-4",wrapperClassname:"!w-full",variant:m?"bottom-sheet":"default",children:l.jsx(mb,{configuration:w,onConfigurationChange:j,errorMessage:(a||y)??void 0,onError:x,canEditSpace:i})}),l.jsx(qc,{message:h?Fye({intl:u,triggerType:w.trigger.type,actionPerformed:h}):"",variant:"success",isVisible:!!h,handleClose:F,timeout:null})]})});VN.displayName="AutomationModal";const kot=Object.freeze(Object.defineProperty({__proto__:null,AutomationModal:VN},Symbol.toStringTag,{value:"Module"})),Mot=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-price-alerts-ui-redesign",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Tot=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-settings-ui-redesign",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Aot=(e,t)=>{const n={selectedOption:"price",priceValue:"",percentValue:ob,positiveSelected:!0,negativeSelected:!0,additionalInstructions:"",selectedSymbol:t??null,inputValue:t??""};if(!e)return n;const{subscription:r,prompt:s}=e,o=r?cee({prompt:s,symbol:r.event_entity}):sBe(s).additionalInstructions,a={...n,additionalInstructions:o};if(!r)return a;const{event_type:i,value_lower_bound:c,value_upper_bound:u,event_entity:f}=r;if(a.selectedSymbol=f??null,a.inputValue=f??"",i==="STOCK_PRICE_TARGET")a.selectedOption="price",u&&u!==Bl?a.priceValue=`$${u}`:c&&c!==Ul&&(a.priceValue=`$${c}`);else if(i==="STOCK_PRICE_MOVEMENT"){a.selectedOption="movement";const m=u!=null&&u!==Bl,p=c!=null&&c!==Ul;a.positiveSelected=m,a.negativeSelected=p,m?a.percentValue=`${u}`:p&&(a.percentValue=`${Math.abs(c)}`)}return a},HN=A.memo(({symbol:e,buttonProps:t,watchlistAddedForSymbol:n,modalOpenedSource:r})=>{const{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useMemo(()=>{try{return decodeURIComponent(e.toUpperCase())}catch{return e.toUpperCase()}},[e]),{data:i,isLoading:c}=mt({queryKey:be.makeEphemeralQueryKey("getFinanceTicker",a),queryFn:()=>k9e({ticker:a,reason:"finance-ticker-supported-check"}),staleTime:1/0}),[u,f]=d.useState(!1),{isMobileStyle:m}=Re(),{$t:p}=J(),h=!!i?.supported,g=!!(i?.supported&&n),y=n?`finance-alert-watchlist-${a}`:"finance-alert-page-visit",x=(h||g)&&!u,{variation:v,loading:b}=Tot(!1),{variation:_,loading:w}=Mot(!1),S=d.useCallback(()=>f(!1),[]),C=d.useCallback(()=>{o("price alert modal opened",{source:r}),f(!0)},[r,o]);return c||!i?.supported||b||w?null:l.jsxs(l.Fragment,{children:[l.jsx(bv,{cueKey:y,title:p({defaultMessage:"Set an alert for {ticker}",id:"bb+ueMBxHa"},{ticker:a}),enabled:x,placement:"bottom",size:"sm",children:m?l.jsx(wt,{size:"small",variant:"text",icon:B("bell-bolt"),onClick:C,"aria-label":p({id:"hrmMcFoV7/",defaultMessage:"Price Alert"}),rounded:t?.pill}):l.jsx(wt,{size:"small",variant:"text",leadingIcon:B("bell-bolt"),onClick:C,pill:t?.pill,children:p({id:"hrmMcFoV7/",defaultMessage:"Price Alert"})})},y),v&&_?l.jsx(VN,{open:u,onClose:S,source:"settings_create",initialConfiguration:zye({symbol:e}),canEditSpace:!1,canDelete:!0}):l.jsx(Tb,{isOpen:u,onClose:S,symbol:a})]})});HN.displayName="FinanceAddAlertIfSupported";const Tb=A.memo(({isOpen:e,onClose:t,symbol:n,task:r})=>{const s=Rn(),{openToast:o}=hn(),a=!!r,[i,c]=d.useState(null),[u,f]=d.useState("price"),{isMobileStyle:m}=Re(),[p,h]=d.useState(""),{$t:g}=J(),[y,x]=d.useState(n??null),[v,b]=d.useState(!1),{data:_}=mt({queryKey:Kne(y),queryFn:()=>qne(y),enabled:!!y&&e,refetchInterval:5*1e3}),[w,S]=d.useState(""),[C,E]=d.useState(""),[T,k]=d.useState(!0),[I,M]=d.useState(!0),N=d.useMemo(()=>{if(u!=="price"||!_?.price)return;const le=parseFloat(w.replace(/[^0-9.]/g,""));if(!(isNaN(le)||le===_.price))return le>_.price?"above":"below"},[w,_?.price,u]),D=d.useCallback(()=>{b(!1),x(n??null)},[n]),{createMutation:j,updateMutation:F,deleteMutation:R}=pre({onCreateSuccess:()=>{t(),b(!1),D(),o({message:g({defaultMessage:"Price alert created",id:"YccmIRCItP"}),variant:"success",timeout:3,ctaText:g({defaultMessage:"Manage Alerts",id:"t6akfMv9BC"}),ctaOnClick:()=>{s.push("/account/tasks?tab=alerts")}})},onCreateError:()=>{o({message:g({defaultMessage:"Failed to create price alert",id:"vkLT4iLR3O"}),variant:"error",timeout:3,description:g({defaultMessage:"Please try again",id:"fHqssj/1KO"})}),b(!1)},onUpdateSuccess:()=>{t(),b(!1),D(),o({message:g({defaultMessage:"Price alert updated",id:"wTPvmuiyuE"}),variant:"success",timeout:3,ctaText:g({defaultMessage:"Manage Alerts",id:"t6akfMv9BC"}),ctaOnClick:()=>{s.push("/account/tasks?tab=alerts")}})},onUpdateError:()=>{o({message:g({defaultMessage:"Failed to update price alert",id:"Fpz5cXYABV"}),variant:"error",timeout:3,description:g({defaultMessage:"Please try again",id:"fHqssj/1KO"})}),b(!1)},onDeleteSuccess:()=>{t()}}),P=d.useCallback(()=>{t(),D()},[t,D]),L=d.useCallback(()=>{r&&R.mutate(r.id)},[r,R]),U=NE({selectedSymbol:y,symbol:n,quote:_,alertType:"price",priceValue:w,$t:g}),O=NE({selectedSymbol:y,symbol:n,quote:_,alertType:"movement",percentValue:C,$t:g}),$=U.baseInstructions,G=U.displayInstructions,H=O.baseInstructions,Q=O.displayInstructions;d.useEffect(()=>{if(e){const le=Aot(r,n);c(le),f(le.selectedOption),S(le.priceValue),E(le.percentValue),k(le.positiveSelected),M(le.negativeSelected),h(le.additionalInstructions),x(le.selectedSymbol)}else c(null),D()},[e,r,n,D]);const{locale:Y}=J();d.useEffect(()=>{if(a&&_?.currency&&w&&w.startsWith("$")){const le=sb(_.currency,Y);le!=="$"&&S(w.replace("$",le))}},[a,_?.currency,Y,w]);const te=d.useCallback(()=>{b(!0);const le=y??n;if(!le){b(!1);return}const ce=RE({symbol:le,alertType:u,priceValue:w,priceThreshold:N,percentValue:C,positiveSelected:T,negativeSelected:I,baseInstructions:u==="price"?$:H,additionalInstructions:p});if(!ce){b(!1);return}a&&r?F.mutate({taskId:r.id,payload:ce}):j.mutate(ce)},[a,r,y,n,u,w,N,C,T,I,p,$,H,j,F]),se=d.useMemo(()=>{if(!a||!i)return!0;const le={selectedOption:u,priceValue:w,percentValue:C,positiveSelected:T,negativeSelected:I,additionalInstructions:p,selectedSymbol:y},{inputValue:re,...ce}=i;return!Cr(le,ce)},[a,i,u,w,C,T,I,p,y]),ae=d.useMemo(()=>{const le=w.replace(/[^0-9.]/g,""),re=C.replace("%","");return u==="price"?!y||!le||!N:!y||!re},[y,u,w,C,N]),X=d.useMemo(()=>ae||!se,[ae,se]),ee=d.useMemo(()=>[{text:g({id:"47FYwba+bI",defaultMessage:"Cancel"}),onClick:P,variant:"secondary"},{text:g(a?{id:"KjhtiKJItq",defaultMessage:"Edit Alert"}:{id:"KHrQobwBBl",defaultMessage:"Add Alert"}),onClick:te,variant:"primary",disabled:a?X:ae,isLoading:v}],[te,g,ae,v,P,a,X]);return l.jsxs(po,{isOpen:e,onClose:t,title:g({id:"hrmMcFoV7/",defaultMessage:"Price Alert"}),variant:m?"bottom-sheet":"default",children:[l.jsx("div",{className:"gap-md flex min-h-[60vh] flex-col md:min-h-0",children:l.jsx(J6,{variant:"full",selectedSymbol:y,selectedOption:u,onSymbolChange:x,onOptionChange:f,showSymbolInput:!a,currentPrice:_?.price,priceValue:w,onPriceValueChange:S,percentValue:C,onPercentValueChange:E,positiveSelected:T,onPositiveChange:k,negativeSelected:I,onNegativeChange:M,additionalInstructions:p,onAdditionalInstructionsChange:h,displayPriceInstructions:G,displayMovementInstructions:Q,externalInputValue:i?.inputValue,currency:_?.currency??void 0})}),l.jsxs("div",{className:"mt-md flex w-full items-center justify-between",children:[l.jsx("div",{children:a&&l.jsx(wt,{variant:"secondary",onClick:L,isLoading:R.isPending,children:g({id:"K3r6DQW7h+",defaultMessage:"Delete"})})}),l.jsx("div",{className:"gap-sm md:-mb-md flex items-center",children:ee.map(le=>l.jsx(wt,{onClick:le.onClick,variant:le.variant,disabled:le.disabled,isLoading:le.isLoading,children:le.text},le.text))})]})]})});Tb.displayName="FinanceAlertModal";const Not=Object.freeze(Object.defineProperty({__proto__:null,FinanceAddAlertIfSupported:HN,FinanceAlertModal:Tb},Symbol.toStringTag,{value:"Module"})),Rot=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-free-user-access-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},zN=A.memo(({symbol:e,buttonProps:t,watchlistAddedForSymbol:n})=>{const{hasAccessToProFeatures:r}=$t(),{variation:s,loading:o}=Rot(!1);return o||!s&&!r?null:l.jsx(HN,{symbol:e,buttonProps:t,watchlistAddedForSymbol:n,modalOpenedSource:"finance_asset_page"})});zN.displayName="PriceAlertButton";const mL="pplx://www.pplx.com";function Ab({href:e,inApp:t,queryParams:n}){if(!t||e==null)return e;const r=new URL(e,mL);return n?.forEach((s,o)=>{r.searchParams.get(o)||r.searchParams.set(o,s??"")}),r.pathname.startsWith("/app")||(r.pathname.startsWith("/")?r.pathname=`/app${r.pathname}`:r.pathname=`/app/${r.pathname}`),r.href.replace(mL,"")}const Nae=()=>{const{scrollContainerRef:e}=ka();return d.useCallback(()=>{window.scrollTo({top:0,behavior:"instant"}),e?.current?.scrollTo({top:0,behavior:"instant"})},[e])},Zg=A.memo(({children:e,href:t,...n})=>{const{inApp:r}=Sa(),s=fn(),o=Nae(),a=d.useCallback(i=>{o(),n.onClick?.(i)},[o,n]);return l.jsx(yt,{...n,href:Ab({href:t,inApp:r,queryParams:s}),onClick:a,children:e})}),Dot=A.memo(e=>{const{inApp:t}=Sa(),n=fn(),{href:r,...s}=e;return l.jsx(qh,{...s,href:Ab({href:r,inApp:t,queryParams:n})??""})});Dot.displayName="CanonicalLinkAether";Zg.displayName="CanonicalLink";const jot=A.memo(e=>{const t=e.href??void 0;return t?l.jsx(Zg,{...e,href:t}):e.children});jot.displayName="CanonicalLinkMaybe";const Iot=({value:e,format:t,suffix:n,animated:r})=>{const[s,o]=d.useState(!1);return d.useEffect(()=>{r&&Number.isFinite(e)&&o(!0)},[r,e]),l.jsx(jp,{isolate:!0,value:e,format:t,suffix:n,animated:s})},Pot=!1,Nb=A.memo(({value:e,format:t,suffix:n,animated:r=Pot})=>{const{inApp:s}=Sa(),{locale:o}=J();return!r||s?l.jsxs("span",{children:[Intl.NumberFormat(o,t).format(e)," ",n]}):l.jsx(Iot,{value:e,format:t,suffix:n,animated:r})});Nb.displayName="FinanceNumberFlow";const Rb={ENTITY_CHIP:"entity_chip",SEARCH_WIDGET:"search_widget",CHART_COMPARISON:"chart_comparison",SEARCH_AUTOSUGGEST:"search_autosuggest"},Oot={PREDICTIONS_WIDGET:"predictions_widget"},Lot={ASSET_PAGE:"asset"},Jg={ASSET_PAGE:"asset"},H2=A.memo(({countryCode:e,square:t,...n})=>{const r=e??"NEU",s=t?`square/${r}`:r;return l.jsx("img",{src:`https://r2cdn.perplexity.ai/images/country_flags/${s}.svg`,alt:e??"NEU",...n})});H2.displayName="CountryFlag";const Fot={COMMODITY:"",FOREX:"FX",INDEX:"INDEX",CRYPTO:"CRYPTO"},hf=A.memo(({price:e,currency:t,sign:n,variant:r="small",className:s,animated:o})=>{const a=d.useMemo(()=>({style:t?"currency":"decimal",currency:t||void 0,minimumFractionDigits:e<1e3?2:0,maximumFractionDigits:Math.abs(e)<.01?void 0:2,signDisplay:n?"exceptZero":void 0}),[t,e,n]);return l.jsx(V,{variant:r,color:"light",className:s,children:l.jsx(Nb,{value:e,format:a,animated:o})})});hf.displayName="Price";const WN=({name:e,variant:t="smallBold",className:n})=>e?l.jsx(V,{variant:t,className:z("min-w-0 truncate leading-tight",n),as:"span",children:e}):null,e0=({symbol:e,exchange:t,country:n,gap:r="xs"})=>{const s=d.useMemo(()=>e&&decodeURIComponent(e).split(".")[0],[e]),o=d.useMemo(()=>t&&(Fot[t]??t),[t]);if(!s)return null;if(!o)return s;const a=n||null;return l.jsxs(ga,{className:z("whitespace-nowrap",{"gap-xs":r==="xs","gap-sm":r==="sm"}),children:[l.jsx(Bn,{id:"symbol",children:s}),l.jsx(Bn,{id:"exchange",children:o}),a&&l.jsx(Bn,{id:"country",children:l.jsxs("div",{className:"relative flex w-[1.2em] shrink-0 items-center",children:[l.jsx(H2,{countryCode:a}),l.jsx("div",{className:"absolute inset-0 border border-black/10 dark:border-0"})]})})]})},Rae=({symbol:e,children:t,className:n,referrer:r})=>{const{inApp:s}=Sa(),o=fn(),a=Ab({href:`/finance/${e}`,inApp:s,queryParams:o}),{session:i}=Ne(),{trackEvent:c}=Xe(i),u=Nae(),f=d.useCallback(()=>{u(),r&&c("finance link clicked",{referrer:r,targetPageType:Jg.ASSET_PAGE,symbol:e,destinationUrl:`/finance/${e}`})},[r,e,c,u]);return l.jsx(yt,{href:a,className:z("py-sm px-md hover:bg-subtler block duration-quick",n),onClick:f,children:t})},Bot=A.memo(({symbol:e,name:t,image:n,imageDark:r,exchange:s,country:o,children:a,colorScheme:i})=>{const{isMobileStyle:c}=Re(),{inApp:u}=Sa();return Rf("header"),l.jsxs(K,{className:"gap-md flex min-w-0 flex-col",children:[l.jsxs(K,{className:"gap-sm flex items-center justify-between",children:[l.jsxs("div",{className:"flex min-w-0 items-center justify-start gap-[12px]",children:[l.jsx(Xg,{src:n??"",srcDark:r??"",symbol:e??"",className:"!size-[40px]",colorScheme:i}),l.jsx(Fo,{content:t??"",disabled:!c,children:l.jsxs("div",{className:"truncate",children:[l.jsx(V,{variant:c?"section-title":"page-title",className:"min-w-0 truncate leading-tight",children:t}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e,exchange:s,gap:"xs",country:o})})]})})]}),u&&e&&l.jsx(zN,{symbol:e,buttonProps:{pill:!0}})]}),a]})});Bot.displayName="FinanceAssetHeader";const Rh=A.memo(({isScreenshotEnv:e})=>{const{$t:t}=J();return l.jsxs("div",{className:z("pointer-events-none flex items-center px-sm py-xs rounded-full shadow-[0_0_16px_8px_oklch(var(--background-base-color)/0.6)] dark:shadow-[0_0_16px_8px_oklch(var(--offset-color)/0.6)]",e?"bg-base":"bg-background/90 backdrop-blur-sm"),children:[l.jsx(V,{variant:"tiny",inline:!0,className:"mr-xs mt-px",children:t({defaultMessage:"Powered by",id:"U8QBHORZRD"})}),l.jsx(Gd,{variant:"full",size:"small"})]})});Rh.displayName="FinanceAssetWatermark";const ta=(e,t)=>{if(e==null||e===void 0)return null;const n=2;let r=Math.min(n,t.maxDecimals??n);const s=Math.min(n,t.maxDecimals??n);return e>1e5&&(r=1),e.toLocaleString(t.locale,{style:t.currency?"currency":"decimal",notation:"compact",currency:t.currency,minimumFractionDigits:r,maximumFractionDigits:s})};function pL(e,t,n,r){return e==null||t==null?null:r({defaultMessage:"{low}-{high}",id:"sOdwcvTtKN"},{low:ta(e,n),high:ta(t,n)})}const hL=(e,t,n)=>e==null||e===void 0?null:e.toLocaleString(t.locale,{style:"decimal",notation:"compact",...n});function Uot(e,t=6){if(e===0)return{minimumFractionDigits:0,maximumFractionDigits:1};let n=0,r=2;if(e!==0&&Math.abs(e)<1){let s=0,o=Math.abs(e);for(;o<1&&s{if(e==null||e===void 0)return null;let{minimumFractionDigits:r,maximumFractionDigits:s}=Uot(e,6);return r=r,s=s,r>s&&(s=r),e*100>.001&&(r=2,s=2),e===0?"—":e.toLocaleString(t.locale,{style:"percent",...n,minimumFractionDigits:r,maximumFractionDigits:s})},Vot={previousClose:e=>ta(e.d.previousClose,e),open:e=>ta(e.d.open,e),dayRange:e=>pL(e.d.dayLow,e.d.dayHigh,e,e.$t),yearRange:e=>pL(e.d.yearLow,e.d.yearHigh,e,e.$t),eps:e=>ta(e.d.eps,e),dayHigh:e=>ta(e.d.dayHigh,e),dayLow:e=>ta(e.d.dayLow,e),marketCap:e=>ta(e.d.marketCap,e),pe:e=>{const t=e.d.pe;return t&&t<0?"—":hL(t,e,{minimumFractionDigits:2})},dividendYieldTTM:e=>_C(e.d.dividendYieldTTM,e),volume:e=>hL(e.d.volume,e),dollarVolume24h:e=>ta(e.d.dollarVolume24h,e),volumeChange24h:e=>_C(e.d.volumeChange24h,e),yearHigh:e=>ta(e.d.yearHigh,e),yearLow:e=>ta(e.d.yearLow,e),fundingRate:e=>_C(e.d.fundingRate?+e.d.fundingRate*100:null,e)};function Hot({quote:e,currency:t,locale:n,$t:r}){return(e.uiHints?.tableFields??[]).map(a=>{const i=Vot[a];if(!i)return null;const c=i({d:e,locale:n,currency:t,$t:r});return c==null?null:{value:c,label:a,id:a}}).filter(a=>a!==null)}const GN=(e="sm")=>{const[t,n]=d.useState(e);d.useEffect(()=>{const c=()=>{window.innerWidth>=1536?n("2xl"):window.innerWidth>=1280?n("xl"):window.innerWidth>=1024?n("lg"):window.innerWidth>=768?n("md"):window.innerWidth>=640&&n("sm")};return window.addEventListener("resize",c),c(),()=>window.removeEventListener("resize",c)},[]);const r=!0,s=["md","lg","xl","2xl"].includes(t),o=["lg","xl","2xl"].includes(t),a=["xl","2xl"].includes(t),i=["2xl"].includes(t);return d.useMemo(()=>({breakpoint:t,isSmallScreen:r,isMediumScreen:s,isLargeScreen:o,isXLargeScreen:a,is2XLargeScreen:i}),[t,i,o,s,r,a])},zot=({dt:e,dd:t,id:n})=>{const{isMobileStyle:r}=Re(),{breakpoint:s}=GN(),o=["md","sm"].includes(s)&&r;return l.jsxs("div",{className:"gap-x-sm py-xs px-sm md:p-sm bg-raised flex flex-col gap-y-0.5 whitespace-nowrap md:flex-row md:justify-between",children:[l.jsx("dt",{children:l.jsx(V,{variant:o?"micro":"small",color:"light",children:e})}),l.jsx("dd",{children:l.jsx(V,{variant:o?"tiny":"smallBold",children:t})})]},n)},gL=({children:e})=>l.jsx(K,{variant:"background",children:e}),Dae=A.memo(({entries:e,context:t})=>{const n=(3-e.length%3)%3,r=t==="thread",s=t==="canonical"||t==="thread";return l.jsx("div",{className:"scrollbar-subtle overflow-x-auto",children:l.jsxs(K,{className:z("grid grid-cols-3 gap-px",r?"w-full":"min-w-max",s&&"border-x-0"),variant:"subtler",children:[e.map(({label:o,value:a})=>l.jsx(gL,{children:l.jsx(zot,{dt:o,dd:a,id:o})},o)),Array.from({length:n}).map((o,a)=>l.jsx(gL,{},a))]})})});Dae.displayName="FinanceGenericTable";const Wot=He({finance:{defaultMessage:"Finance",id:"Fm3M+yFIbr"},analysis:{defaultMessage:"Analysis",id:"VMIM8/fAKn"},companyOverview:{defaultMessage:"Overview",id:"9uOFF3L8kp"},balanceSheet:{defaultMessage:"Balance Sheet",id:"ak91fL/u+x"},incomeStatement:{defaultMessage:"Income Statement",id:"HFT+V86brH"},keyStats:{defaultMessage:"Key Stats",id:"0FPlBr741P"},cashFlow:{defaultMessage:"Cash Flow",id:"mtw9A2k000"},date:{defaultMessage:"Date",id:"P7PLVjLe4f"},marketSummary:{defaultMessage:"Market Summary",id:"/4s4TMc/a+"},price:{defaultMessage:"Price",id:"b1zuN9KTHI"},symbol:{defaultMessage:"Symbol",id:"3HepmQoEZ+"},value:{defaultMessage:"Value",id:"GufXy52FNI"},percentage:{defaultMessage:"Percentage",id:"HyMpO2UIBG"},currency:{defaultMessage:"Currency",id:"55hdQy4uHO"},open:{defaultMessage:"Open",id:"JfG49wNHKP"},dayHigh:{defaultMessage:"High",id:"AxMhQrcUDC"},dayLow:{defaultMessage:"Low",id:"477I0ggSYe"},marketCap:{defaultMessage:"Market Cap",id:"9Mp3OYduig"},pe:{defaultMessage:"P/E Ratio",id:"fWnwRImZ9W"},volume24h:{defaultMessage:"24H Volume",id:"w7Tm/B63El"},dollarVolume24h:{defaultMessage:"24H Volume",id:"w7Tm/B63El"},volumeChange24h:{defaultMessage:"24H Volume Change",id:"CndnNLlEs+"},fundingRate:{defaultMessage:"Funding Rate",id:"CB1174SKrI"},volume:{defaultMessage:"Volume",id:"y867VsgbzT"},yearHigh:{defaultMessage:"Year High",id:"yh2gWeU/Gz"},yearLow:{defaultMessage:"Year Low",id:"fZpEs5CIaC"},avgVolume:{defaultMessage:"Avg. Volume",id:"MDNqWO8yDU"},dayRange:{defaultMessage:"Day Range",id:"6VJrMyvXcR"},yearRange:{defaultMessage:"52W Range",id:"FkJo44zhH6"},eps:{defaultMessage:"EPS",id:"JncK2a8+G4"},dividendYieldTTM:{defaultMessage:"Dividend Yield",id:"P3CiJnt5+6"},dividendYielTTM:{defaultMessage:"Dividend Yield",id:"P3CiJnt5+6"},previousClose:{defaultMessage:"Prev Close",id:"0jUP9zUh5z"},priceComparison:{defaultMessage:"Price Comparison",id:"MFuchsfwj7"},stockPerformance:{defaultMessage:"Stock Performance",id:"qEQxp1ikMt"},companyFinancials:{defaultMessage:"{company} Financials",id:"gWNvqjwoWh"},"13FFilings":{defaultMessage:"13F Filings",id:"XzGhyAgjmS"},pricePerformance:{defaultMessage:"Price & Performance",id:"nCv3Ti2cp5"},peers:{defaultMessage:"Peers",id:"JjgJTAa2wL"},transcriptLogin:{defaultMessage:"Login to view transcripts from {quartr}",id:"xY8csKCosL"},newsAndMarketInsights:{defaultMessage:"Latest News",id:"BlFeZAX10O"},recentTranscripts:{defaultMessage:"Recent Transcripts",id:"tiSu9ozyS4"},earnings:{defaultMessage:"Earnings",id:"14sEVuq+Kb"},related:{defaultMessage:"Related",id:"KQsZBWlEw/"},topMovers:{defaultMessage:"Top Movers",id:"e+JmwAUicC"}}),Got=(e,t)=>{if(!t)return"";const n=Wot[t];return n?e(n):""},jae=A.memo(({quote:e,context:t})=>{const{$t:n,locale:r}=J(),s=d.useMemo(()=>e?Hot({quote:e,currency:e?.currency||void 0,locale:r,$t:n}).map(a=>({...a,label:Got(n,a.label),value:a.value})):[],[e,n,r]);return Rf("financial-profile",{skip:!s.length}),l.jsx(K,{"data-testid":"financial-profile-box",variant:"subtle",noBorder:!0,className:z("overflow-hidden border-t border-subtlest",{"border-x-0":t==="canonical"||t==="thread","rounded-none":t==="thread","border-b rounded-b-xl":t!=="thread"}),children:l.jsx(Dae,{entries:s,context:t})})});jae.displayName="FinanceFinancialProfile";const Dh=30,$ot=({isMobileStyle:e,threshold:t=700})=>{const n=d.useRef(null),[r,s]=d.useState("lg");return d.useEffect(()=>{const a=n.current;if(!a)return;const i=()=>{const u=a.clientWidth;s(u{i()});return c.observe(a),()=>{c.disconnect()}},[t]),{variant:e?"sm":r,containerRef:n}};var Bk=Math.PI,Uk=2*Bk,bc=1e-6,qot=Uk-bc;function Vk(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ho(){return new Vk}Vk.prototype=ho.prototype={constructor:Vk,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,s,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+s)+","+(this._y1=+o)},arcTo:function(e,t,n,r,s){e=+e,t=+t,n=+n,r=+r,s=+s;var o=this._x1,a=this._y1,i=n-e,c=r-t,u=o-e,f=a-t,m=u*u+f*f;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(m>bc)if(!(Math.abs(f*i-c*u)>bc)||!s)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var p=n-o,h=r-a,g=i*i+c*c,y=p*p+h*h,x=Math.sqrt(g),v=Math.sqrt(m),b=s*Math.tan((Bk-Math.acos((g+m-y)/(2*x*v)))/2),_=b/v,w=b/x;Math.abs(_-1)>bc&&(this._+="L"+(e+_*u)+","+(t+_*f)),this._+="A"+s+","+s+",0,0,"+ +(f*p>u*h)+","+(this._x1=e+w*i)+","+(this._y1=t+w*c)}},arc:function(e,t,n,r,s,o){e=+e,t=+t,n=+n,o=!!o;var a=n*Math.cos(r),i=n*Math.sin(r),c=e+a,u=t+i,f=1^o,m=o?r-s:s-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+u:(Math.abs(this._x1-c)>bc||Math.abs(this._y1-u)>bc)&&(this._+="L"+c+","+u),n&&(m<0&&(m=m%Uk+Uk),m>qot?this._+="A"+n+","+n+",0,1,"+f+","+(e-a)+","+(t-i)+"A"+n+","+n+",0,1,"+f+","+(this._x1=c)+","+(this._y1=u):m>bc&&(this._+="A"+n+","+n+",0,"+ +(m>=Bk)+","+f+","+(this._x1=e+n*Math.cos(s))+","+(this._y1=t+n*Math.sin(s))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function nn(e){return function(){return e}}var yL=Math.abs,Jr=Math.atan2,gc=Math.cos,Kot=Math.max,wC=Math.min,Da=Math.sin,hd=Math.sqrt,As=1e-12,jh=Math.PI,z2=jh/2,Ny=2*jh;function Yot(e){return e>1?0:e<-1?jh:Math.acos(e)}function xL(e){return e>=1?z2:e<=-1?-z2:Math.asin(e)}function Qot(e){return e.innerRadius}function Xot(e){return e.outerRadius}function Zot(e){return e.startAngle}function Jot(e){return e.endAngle}function eat(e){return e&&e.padAngle}function tat(e,t,n,r,s,o,a,i){var c=n-e,u=r-t,f=a-s,m=i-o,p=m*c-f*u;if(!(p*pj*j+F*F&&(T=I,k=M),{cx:T,cy:k,x01:-f,y01:-m,x11:T*(s/S-1),y11:k*(s/S-1)}}function nat(){var e=Qot,t=Xot,n=nn(0),r=null,s=Zot,o=Jot,a=eat,i=null;function c(){var u,f,m=+e.apply(this,arguments),p=+t.apply(this,arguments),h=s.apply(this,arguments)-z2,g=o.apply(this,arguments)-z2,y=yL(g-h),x=g>h;if(i||(i=u=ho()),pAs))i.moveTo(0,0);else if(y>Ny-As)i.moveTo(p*gc(h),p*Da(h)),i.arc(0,0,p,h,g,!x),m>As&&(i.moveTo(m*gc(g),m*Da(g)),i.arc(0,0,m,g,h,x));else{var v=h,b=g,_=h,w=g,S=y,C=y,E=a.apply(this,arguments)/2,T=E>As&&(r?+r.apply(this,arguments):hd(m*m+p*p)),k=wC(yL(p-m)/2,+n.apply(this,arguments)),I=k,M=k,N,D;if(T>As){var j=xL(T/m*Da(E)),F=xL(T/p*Da(E));(S-=j*2)>As?(j*=x?1:-1,_+=j,w-=j):(S=0,_=w=(h+g)/2),(C-=F*2)>As?(F*=x?1:-1,v+=F,b-=F):(C=0,v=b=(h+g)/2)}var R=p*gc(v),P=p*Da(v),L=m*gc(w),U=m*Da(w);if(k>As){var O=p*gc(b),$=p*Da(b),G=m*gc(_),H=m*Da(_),Q;if(yAs?M>As?(N=b1(G,H,R,P,p,M,x),D=b1(O,$,L,U,p,M,x),i.moveTo(N.cx+N.x01,N.cy+N.y01),MAs)||!(S>As)?i.lineTo(L,U):I>As?(N=b1(L,U,O,$,m,-I,x),D=b1(R,P,G,H,m,-I,x),i.lineTo(N.cx+N.x01,N.cy+N.y01),I=p;--h)i.point(b[h],_[h]);i.lineEnd(),i.areaEnd()}x&&(b[m]=+e(y,m,f),_[m]=+n(y,m,f),i.point(t?+t(y,m,f):b[m],r?+r(y,m,f):_[m]))}if(v)return i=null,v+""||null}function u(){return KN().defined(s).curve(a).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:nn(+f),t=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:nn(+f),c):e},c.x1=function(f){return arguments.length?(t=f==null?null:typeof f=="function"?f:nn(+f),c):t},c.y=function(f){return arguments.length?(n=typeof f=="function"?f:nn(+f),r=null,c):n},c.y0=function(f){return arguments.length?(n=typeof f=="function"?f:nn(+f),c):n},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:nn(+f),c):r},c.lineX0=c.lineY0=function(){return u().x(e).y(n)},c.lineY1=function(){return u().x(e).y(r)},c.lineX1=function(){return u().x(t).y(n)},c.defined=function(f){return arguments.length?(s=typeof f=="function"?f:nn(!!f),c):s},c.curve=function(f){return arguments.length?(a=f,o!=null&&(i=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=i=null:i=a(o=f),c):o},c}function sat(e,t){return te?1:t>=e?0:NaN}function oat(e){return e}function aat(){var e=oat,t=sat,n=null,r=nn(0),s=nn(Ny),o=nn(0);function a(i){var c,u=i.length,f,m,p=0,h=new Array(u),g=new Array(u),y=+r.apply(this,arguments),x=Math.min(Ny,Math.max(-Ny,s.apply(this,arguments)-y)),v,b=Math.min(Math.abs(x)/u,o.apply(this,arguments)),_=b*(x<0?-1:1),w;for(c=0;c0&&(p+=w);for(t!=null?h.sort(function(S,C){return t(g[S],g[C])}):n!=null&&h.sort(function(S,C){return n(i[S],i[C])}),c=0,m=p?(x-u*_)/p:0;c0?w*m:0)+_,g[f]={data:i[f],index:c,value:w,startAngle:y,endAngle:v,padAngle:b};return g}return a.value=function(i){return arguments.length?(e=typeof i=="function"?i:nn(+i),a):e},a.sortValues=function(i){return arguments.length?(t=i,n=null,a):t},a.sort=function(i){return arguments.length?(n=i,t=null,a):n},a.startAngle=function(i){return arguments.length?(r=typeof i=="function"?i:nn(+i),a):r},a.endAngle=function(i){return arguments.length?(s=typeof i=="function"?i:nn(+i),a):s},a.padAngle=function(i){return arguments.length?(o=typeof i=="function"?i:nn(+i),a):o},a}var iat=Oae(nu);function Pae(e){this._curve=e}Pae.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function Oae(e){function t(n){return new Pae(e(n))}return t._curve=e,t}function lat(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(Oae(n)):t()._curve},e}function cat(){return lat(KN().curve(iat))}function _1(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var Hk=Array.prototype.slice;function uat(e){return e.source}function dat(e){return e.target}function YN(e){var t=uat,n=dat,r=$N,s=qN,o=null;function a(){var i,c=Hk.call(arguments),u=t.apply(this,c),f=n.apply(this,c);if(o||(o=i=ho()),e(o,+r.apply(this,(c[0]=u,c)),+s.apply(this,c),+r.apply(this,(c[0]=f,c)),+s.apply(this,c)),i)return o=null,i+""||null}return a.source=function(i){return arguments.length?(t=i,a):t},a.target=function(i){return arguments.length?(n=i,a):n},a.x=function(i){return arguments.length?(r=typeof i=="function"?i:nn(+i),a):r},a.y=function(i){return arguments.length?(s=typeof i=="function"?i:nn(+i),a):s},a.context=function(i){return arguments.length?(o=i??null,a):o},a}function fat(e,t,n,r,s){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,s,r,s)}function mat(e,t,n,r,s){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+s)/2,r,n,r,s)}function pat(e,t,n,r,s){var o=_1(t,n),a=_1(t,n=(n+s)/2),i=_1(r,n),c=_1(r,s);e.moveTo(o[0],o[1]),e.bezierCurveTo(a[0],a[1],i[0],i[1],c[0],c[1])}function hat(){return YN(fat)}function gat(){return YN(mat)}function yat(){var e=YN(pat);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}function vL(e){return e<0?-1:1}function bL(e,t,n){var r=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(r||s<0&&-0),a=(n-e._y1)/(s||r<0&&-0),i=(o*s+a*r)/(r+s);return(vL(o)+vL(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(i))||0}function _L(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function CC(e,t,n){var r=e._x0,s=e._y0,o=e._x1,a=e._y1,i=(o-r)/3;e._context.bezierCurveTo(r+i,s+i*t,o-i,a-i*n,o,a)}function W2(e){this._context=e}W2.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:CC(this,this._t0,_L(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,CC(this,_L(this,n=bL(this,e,t)),n);break;default:CC(this,this._t0,n=bL(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(W2.prototype).point=function(e,t){W2.prototype.point.call(this,t,e)};function xat(e){return new W2(e)}function gf(e,t){if((a=e.length)>1)for(var n=1,r,s,o=e[t[0]],a,i=o.length;n=0;)n[t]=t;return n}function vat(e,t){return e[t]}function QN(){var e=nn([]),t=yf,n=gf,r=vat;function s(o){var a=e.apply(this,arguments),i,c=o.length,u=a.length,f=new Array(u),m;for(i=0;i0){for(var n,r,s=0,o=e[0].length,a;s0)for(var n,r=0,s,o,a,i,c,u=e[t[0]].length;r0?(s[0]=a,s[1]=a+=o):o<0?(s[1]=i,s[0]=i+=o):(s[0]=0,s[1]=o)}function wat(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,o=r.length;n0)||!((o=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,o,a;ro&&(o=s,n=t);return n}function Lae(e){var t=e.map(Fae);return yf(e).sort(function(n,r){return t[n]-t[r]})}function Fae(e){for(var t=0,n=-1,r=e.length,s;++n"pageX"in e?{x:e.pageX,y:e.pageY}:{x:e.touches[0]?.pageX??0,y:e.touches[0]?.pageY??0},Db=xat,am="geometricPrecision",ZN="pointer-events-none overflow-visible font-sans",Bae=25,ii=200,JN="relative isolate select-none touch-none touch-pan-down",ru="bg-transparent rounded-lg border backdrop-blur-sm bg-subtlest dark:bg-subtlest",jl={duration:ii/1e3,delay:ii/1e3,ease:qa},Aat={opacity:0,transition:{duration:0,delay:0}},Nat={duration:ii/1e3,ease:qa},Rat={opacity:0,transition:{duration:ii/1e3,delay:0}},G2={height:Bae},Uae=4,Vae=3,er={blue:"oklch(var(--positive-color))",red:"oklch(var(--negative-color))",gray:"oklch(var(--foreground-quieter-color))",black:"oklch(var(--foreground-color))",transparent:"#00000000"},e8=16,Hae=-5,Dat={fill:er.gray,fontSize:12,dy:`${Hae}px`,textAnchor:"start",fontFamily:"var(--font-family-sans)"},zk=e=>z("transition-opacity duration-500",{"opacity-0":e}),jat=({tick:e,history:t,yScale:n,xScale:r,xOffset:s,yOffset:o,yHeight:a,yWidth:i,yGet:c,baseline:u})=>{if(!t||t.length===0)return!1;const m=n(e)+o,p=m-a;if(Number.isFinite(u)){const g=n(u);if(g>=p&&g<=m)return!0}const h=s+i;for(let g=0;gh)break;const v=n(c(y));if(v>=p&&v<=m)return!0}return!1},zae=({tick:e,history:t,yScale:n,xScale:r,yGet:s,baseline:o})=>({...Dat,opacity:jat({tick:e,history:t,yScale:n,xScale:r,xOffset:e8+5,yOffset:Hae,yHeight:16,yWidth:25,yGet:s,baseline:o})?.4:1}),t8={fill:er.gray,fontSize:12,textAnchor:"start",dx:"6px",fontFamily:"var(--font-family-sans)"},El={POSITIVE:"positive",NEGATIVE:"negative",NEUTRAL:"neutral",TRANSPARENT:"transparent"},Wk={[El.POSITIVE]:"blue",[El.NEGATIVE]:"red",[El.NEUTRAL]:"gray",[El.TRANSPARENT]:"transparent"},$2=e=>e.date,Wae=e=>new Date(e),wn=e=>Wae(e.date),Iat=(e,t)=>{const n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:e})).getTime()-n.getTime())/(1e3*60)},Pat=(e,t)=>new Date(e.getTime()+t*60*1e3).toISOString().slice(11,16),wL=(e,t)=>t?e.replace(/T\d{2}:\d{2}/,`T${t}`):e,Oat={lunch_break:{valence:El.TRANSPARENT,backgroundColor:Wk[El.TRANSPARENT],backgroundOpacity:0,lineOpacity:0},pre_market:{backgroundOpacity:.5},after_hours:{backgroundOpacity:.5}},CL={lunch_break:W({defaultMessage:"Lunch Break",id:"tHK2Aeii37"}),pre_market:W({defaultMessage:"Pre-Market",id:"8y93h1dAbn"}),after_hours:W({defaultMessage:"After-Hours",id:"19IROpkyrs"})},n8=(e,t,n)=>{const r=Pat(t,n);if(r)return e.find(({open:s,close:o})=>s<=o?r>=s&&r=s||r{if(t===0||!e?.length)return e;const n=[...e];let r=0;for(let s=0;s=t){const i=e[s-t].close;r-=i}const a=se?.includes?.("00:00:00"),r8=(e,t,n)=>{if(!e)return null;const r=new Date(e),s=!Fat(e);return r.toLocaleString(t,{month:"short",day:"numeric",timeZone:n,minute:s?"2-digit":void 0,hour:s?"numeric":void 0,year:s?void 0:"numeric",timeZoneName:s?"short":void 0})},Rc=(e,t,n,r=2)=>new Intl.NumberFormat(n,{style:t?"currency":"decimal",currency:t??void 0,minimumFractionDigits:r,maximumFractionDigits:2}).format(e),Bat=Hg(e=>wn(e)).left,Uat=(e,t)=>{if("invert"in e)return e.invert(t);const n=e.step(),r=e.domain(),s=e.range()[0],o=Math.round((t-s)/n);return r[Math.max(0,Math.min(r.length-1,o))]};function s8(e,t,n){const r=Math.max(0,e),s=Bat(n,Uat(t,r),0);return{d:n[s]??n[n.length-1],index:s,x:r}}const Gae=({ticks:e,xScale:t,width:n,formatter:r,marginLeft:s=0,marginRight:o=0})=>{const c=s,u=n-o,f=[];let m=-1/0,p=0;for(const h of e){const g=t(h)??0,x=r(h).length*7,v=g-x/2,b=g+x/2;if(vu)continue;if(f.length===0){f.push(h),m=g,p=x;continue}const _=p/2+10+x/2;g-m>=_&&(f.push(h),m=g,p=x)}return f},Vat=["1d","5d","1m","6m","ytd","1y","5y","max"],$ae={"1d":"1D","5d":"5D","1m":"1M","6m":"6M",ytd:"YTD","1y":"1Y","3m":"3M","5y":"5Y",max:"MAX"},qae=e=>{if(!e.length)return 0;const t=new Date(e[0].date);return(new Date(e[e.length-1].date).getTime()-t.getTime())/(1e3*60*60*24)},o8=e=>qae(e)<=1,Hat=e=>{if(e.length<2)return!1;const t=new Set;for(const n of e){const r=n.date.split("T")[0];if(t.has(r))return!0;t.add(r)}return!1},zat=(e,t)=>Math.ceil((new Date(e).getTime()-new Date(t).getTime())/(1e3*60*60*24)),a8=e=>e?.includes("~")??!1,Wat=e=>{const[t,n]=e.split("~");return t&&n?{type:"range",range:{start:t,end:n}}:{type:"period",period:t}},Gat=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"finance-screenshot-builder",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},$at=Ce(async()=>{const{FinanceScreenshotBuilderModal:e}=await Se(()=>q(()=>import("./FinanceScreenshotBuilderModal-BL5wJen7.js"),__vite__mapDeps([463,1,4,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),qat=({quote:e,animationId:t,period:n})=>{const{openToast:r}=hn(),{openModal:s}=Uo(),{$t:o}=J(),{isMobileStyle:a}=Re(),{variation:i}=Gat(!1),c=!!e&&!!t&&!!n,u=d.useCallback(()=>{try{if(!e||!t||!n){r({message:o({defaultMessage:"Chart data not available",id:"sIM31EEMjr"}),description:o({defaultMessage:"Please try again",id:"fHqssj/1KO"}),variant:"error",timeout:3});return}const f=Wat(n),m=f.type==="period"?f.period:null;s($at,{quote:e,period:m,symbol:t,legacyIdentifier:"__NONE__"})}catch(f){Z.error("Failed to open screenshot modal",{error:f}),r({message:o({defaultMessage:"Failed to open screenshot modal",id:"xzxG52das8"}),description:o({defaultMessage:"Please try again",id:"fHqssj/1KO"}),variant:"error",timeout:3})}},[o,t,s,r,n,e]);return!i&&!c?null:l.jsx(Fo,{content:o({defaultMessage:"Share as image",id:"NNAj+KDt/t"}),disabled:a,children:l.jsx("button",{"aria-label":o({defaultMessage:"Screenshot",id:"9a+SKtXKhe"}),onClick:u,className:z(ru,"flex items-center justify-center px-sm"),style:{minHeight:Dh,minWidth:Dh},children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ut,{name:B("camera"),size:16})})})})};var Kat=["top","left","transform","className","children","innerRef"];function Gk(){return Gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Cs(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.transform,a=e.className,i=e.children,c=e.innerRef,u=Yat(e,Kat);return A.createElement("g",Gk({ref:c,className:z("visx-group",a),transform:o||"translate("+s+", "+n+")"},u),i)}Cs.propTypes={top:ze.number,left:ze.number,transform:ze.string,className:ze.string,children:ze.node,innerRef:ze.oneOfType([ze.string,ze.func,ze.object])};const Qat=Object.freeze(Object.defineProperty({__proto__:null,Group:Cs},Symbol.toStringTag,{value:"Module"}));function Go(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const SL=Symbol("implicit");function i8(){var e=new EP,t=[],n=[],r=SL;function s(o){let a=e.get(o);if(a===void 0){if(r!==SL)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return s.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new EP;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return s},s.range=function(o){return arguments.length?(n=Array.from(o),s):n.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return i8(t,n).unknown(r)},Go.apply(s,arguments),s}function l8(){var e=i8().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,o,a,i=!1,c=0,u=0,f=.5;delete e.unknown;function m(){var p=t().length,h=s>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?w1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?w1(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=Jat.exec(e))?new Fr(t[1],t[2],t[3],1):(t=eit.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tit.exec(e))?w1(t[1],t[2],t[3],t[4]):(t=nit.exec(e))?w1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rit.exec(e))?RL(t[1],t[2]/100,t[3]/100,1):(t=sit.exec(e))?RL(t[1],t[2]/100,t[3]/100,t[4]):EL.hasOwnProperty(e)?TL(EL[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function TL(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function w1(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function c8(e){return e instanceof ac||(e=Ph(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function $k(e,t,n,r){return arguments.length===1?c8(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}im(Fr,$k,t0(ac,{brighter(e){return e=e==null?xf:Math.pow(xf,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?su:Math.pow(su,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Uc(this.r),Uc(this.g),Uc(this.b),q2(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:AL,formatHex:AL,formatHex8:iit,formatRgb:NL,toString:NL}));function AL(){return`#${Dc(this.r)}${Dc(this.g)}${Dc(this.b)}`}function iit(){return`#${Dc(this.r)}${Dc(this.g)}${Dc(this.b)}${Dc((isNaN(this.opacity)?1:this.opacity)*255)}`}function NL(){const e=q2(this.opacity);return`${e===1?"rgb(":"rgba("}${Uc(this.r)}, ${Uc(this.g)}, ${Uc(this.b)}${e===1?")":`, ${e})`}`}function q2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dc(e){return e=Uc(e),(e<16?"0":"")+e.toString(16)}function RL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ia(e,t,n,r)}function Yae(e){if(e instanceof ia)return new ia(e.h,e.s,e.l,e.opacity);if(e instanceof ac||(e=Ph(e)),!e)return new ia;if(e instanceof ia)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,i=o-s,c=(o+s)/2;return i?(t===o?a=(n-r)/i+(n0&&c<1?0:a,new ia(a,i,c,e.opacity)}function qk(e,t,n,r){return arguments.length===1?Yae(e):new ia(e,t,n,r??1)}function ia(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}im(ia,qk,t0(ac,{brighter(e){return e=e==null?xf:Math.pow(xf,e),new ia(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?su:Math.pow(su,e),new ia(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 Fr(SC(e>=240?e-240:e+120,s,r),SC(e,s,r),SC(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ia(DL(this.h),C1(this.s),C1(this.l),q2(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=q2(this.opacity);return`${e===1?"hsl(":"hsla("}${DL(this.h)}, ${C1(this.s)*100}%, ${C1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function DL(e){return e=(e||0)%360,e<0?e+360:e}function C1(e){return Math.max(0,Math.min(1,e||0))}function SC(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 Qae=Math.PI/180,Xae=180/Math.PI,K2=18,Zae=.96422,Jae=1,eie=.82521,tie=4/29,Nd=6/29,nie=3*Nd*Nd,lit=Nd*Nd*Nd;function rie(e){if(e instanceof Qa)return new Qa(e.l,e.a,e.b,e.opacity);if(e instanceof Oi)return sie(e);e instanceof Fr||(e=c8(e));var t=TC(e.r),n=TC(e.g),r=TC(e.b),s=EC((.2225045*t+.7168786*n+.0606169*r)/Jae),o,a;return t===n&&n===r?o=a=s:(o=EC((.4360747*t+.3850649*n+.1430804*r)/Zae),a=EC((.0139322*t+.0971045*n+.7141733*r)/eie)),new Qa(116*s-16,500*(o-s),200*(s-a),e.opacity)}function Kk(e,t,n,r){return arguments.length===1?rie(e):new Qa(e,t,n,r??1)}function Qa(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}im(Qa,Kk,t0(ac,{brighter(e){return new Qa(this.l+K2*(e??1),this.a,this.b,this.opacity)},darker(e){return new Qa(this.l-K2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Zae*kC(t),e=Jae*kC(e),n=eie*kC(n),new Fr(MC(3.1338561*t-1.6168667*e-.4906146*n),MC(-.9787684*t+1.9161415*e+.033454*n),MC(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function EC(e){return e>lit?Math.pow(e,1/3):e/nie+tie}function kC(e){return e>Nd?e*e*e:nie*(e-tie)}function MC(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function TC(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function cit(e){if(e instanceof Oi)return new Oi(e.h,e.c,e.l,e.opacity);if(e instanceof Qa||(e=rie(e)),e.a===0&&e.b===0)return new Oi(NaN,0()=>e;function aie(e,t){return function(n){return e+n*t}}function dit(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 f8(e,t){var n=t-e;return n?aie(e,n>180||n<-180?n-360*Math.round(n/360):n):Ib(isNaN(e)?t:e)}function fit(e){return(e=+e)==1?Br:function(t,n){return n-t?dit(t,n,e):Ib(isNaN(t)?n:t)}}function Br(e,t){var n=t-e;return n?aie(e,n):Ib(isNaN(e)?t:e)}const Xk=(function e(t){var n=fit(t);function r(s,o){var a=n((s=$k(s)).r,(o=$k(o)).r),i=n(s.g,o.g),c=n(s.b,o.b),u=Br(s.opacity,o.opacity);return function(f){return s.r=a(f),s.g=i(f),s.b=c(f),s.opacity=u(f),s+""}}return r.gamma=e,r})(1);function mit(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;sn&&(o=t.slice(n,o),i[a]?i[a]+=o:i[++a]=o),(r=r[0])===(s=s[0])?i[a]?i[a]+=s:i[++a]=s:(i[++a]=null,c.push({i:a,x:Y2(r,s)})),n=AC.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Nit(e,t,n){var r=e[0],s=e[1],o=t[0],a=t[1];return s2?Rit:Nit,c=u=null,m}function m(p){return p==null||isNaN(p=+p)?o:(c||(c=i(e.map(r),t,n)))(r(a(p)))}return m.invert=function(p){return a(s((u||(u=i(t,e.map(r),Y2)))(p)))},m.domain=function(p){return arguments.length?(e=Array.from(p,die),f()):e.slice()},m.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},m.rangeRound=function(p){return t=Array.from(p),n=iie,f()},m.clamp=function(p){return arguments.length?(a=p?!0:za,f()):a!==za},m.interpolate=function(p){return arguments.length?(n=p,f()):n},m.unknown=function(p){return arguments.length?(o=p,m):o},function(p,h){return r=p,s=h,f()}}function p8(){return Pb()(za,za)}function Dit(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Q2(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 vf(e){return e=Q2(Math.abs(e)),e?e[1]:NaN}function jit(e,t){return function(n,r){for(var s=n.length,o=[],a=0,i=e[0],c=0;s>0&&i>0&&(c+i+1>r&&(i=Math.max(1,r-c)),o.push(n.substring(s-=i,s+i)),!((c+=i+1)>r));)i=e[a=(a+1)%e.length];return o.reverse().join(t)}}function Iit(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Pit=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lh(e){if(!(t=Pit.exec(e)))throw new Error("invalid format: "+e);var t;return new h8({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]})}Lh.prototype=h8.prototype;function h8(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+""}h8.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 Oit(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 fie;function Lit(e,t){var n=Q2(e,t);if(!n)return e+"";var r=n[0],s=n[1],o=s-(fie=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Q2(e,Math.max(0,t+o-1))[0]}function LL(e,t){var n=Q2(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 FL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Dit,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)=>LL(e*100,t),r:LL,s:Lit,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BL(e){return e}var UL=Array.prototype.map,VL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fit(e){var t=e.grouping===void 0||e.thousands===void 0?BL:jit(UL.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+"",o=e.numerals===void 0?BL:Iit(UL.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",i=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(m){m=Lh(m);var p=m.fill,h=m.align,g=m.sign,y=m.symbol,x=m.zero,v=m.width,b=m.comma,_=m.precision,w=m.trim,S=m.type;S==="n"?(b=!0,S="g"):FL[S]||(_===void 0&&(_=12),w=!0,S="g"),(x||p==="0"&&h==="=")&&(x=!0,p="0",h="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=y==="$"?r:/[%p]/.test(S)?a:"",T=FL[S],k=/[defgprs%]/.test(S);_=_===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function I(M){var N=C,D=E,j,F,R;if(S==="c")D=T(M)+D,M="";else{M=+M;var P=M<0||1/M<0;if(M=isNaN(M)?c:T(Math.abs(M),_),w&&(M=Oit(M)),P&&+M==0&&g!=="+"&&(P=!1),N=(P?g==="("?g:i:g==="-"||g==="("?"":g)+N,D=(S==="s"?VL[8+fie/3]:"")+D+(P&&g==="("?")":""),k){for(j=-1,F=M.length;++jR||R>57){D=(R===46?s+M.slice(j+1):M.slice(j))+D,M=M.slice(0,j);break}}}b&&!x&&(M=t(M,1/0));var L=N.length+M.length+D.length,U=L>1)+N+M+D+U.slice(L);break;default:M=U+N+M+D;break}return o(M)}return I.toString=function(){return m+""},I}function f(m,p){var h=u((m=Lh(m),m.type="f",m)),g=Math.max(-8,Math.min(8,Math.floor(vf(p)/3)))*3,y=Math.pow(10,-g),x=VL[8+g/3];return function(v){return h(y*v)+x}}return{format:u,formatPrefix:f}}var S1,g8,mie;Bit({thousands:",",grouping:[3],currency:["$",""]});function Bit(e){return S1=Fit(e),g8=S1.format,mie=S1.formatPrefix,S1}function Uit(e){return Math.max(0,-vf(Math.abs(e)))}function Vit(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vf(t)/3)))*3-vf(Math.abs(e)))}function Hit(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vf(t)-vf(e))+1}function zit(e,t,n,r){var s=ck(e,t,n),o;switch(r=Lh(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Vit(s,a))&&(r.precision=o),mie(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Hit(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Uit(s))&&(r.precision=o-(r.type==="%")*2);break}}return g8(r)}function r0(e){var t=e.domain;return e.ticks=function(n){var r=t();return lk(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return zit(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,o=r.length-1,a=r[s],i=r[o],c,u,f=10;for(i0;){if(u=are(a,i,n),u===c)return r[s]=a,r[o]=i,t(r);if(u>0)a=Math.floor(a/u)*u,i=Math.ceil(i/u)*u;else if(u<0)a=Math.ceil(a*u)/u,i=Math.floor(i*u)/u;else break;c=u}return e},e}function pie(){var e=p8();return e.copy=function(){return n0(e,pie())},Go.apply(e,arguments),r0(e)}function hie(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],o=e[r],a;return oMath.pow(e,t)}function Kit(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 WL(e){return(t,n)=>-e(-t,n)}function Yit(e){const t=e(HL,zL),n=t.domain;let r=10,s,o;function a(){return s=Kit(r),o=qit(r),n()[0]<0?(s=WL(s),o=WL(o),e(Wit,Git)):e(HL,zL),t}return t.base=function(i){return arguments.length?(r=+i,a()):r},t.domain=function(i){return arguments.length?(n(i),a()):n()},t.ticks=i=>{const c=n();let u=c[0],f=c[c.length-1];const m=f0){for(;p<=h;++p)for(g=1;gf)break;v.push(y)}}else for(;p<=h;++p)for(g=r-1;g>=1;--g)if(y=p>0?g/o(-p):g*o(p),!(yf)break;v.push(y)}v.length*2{if(i==null&&(i=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Lh(c)).precision==null&&(c.trim=!0),c=g8(c)),i===1/0)return c;const u=Math.max(1,r*i/t.ticks().length);return f=>{let m=f/o(Math.round(s(f)));return m*rn(hie(n(),{floor:i=>o(Math.floor(s(i))),ceil:i=>o(Math.ceil(s(i)))})),t}function gie(){const e=Yit(Pb()).domain([1,10]);return e.copy=()=>n0(e,gie()).base(e.base()),Go.apply(e,arguments),e}function GL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $L(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Qit(e){var t=1,n=e(GL(t),$L(t));return n.constant=function(r){return arguments.length?e(GL(t=+r),$L(t)):t},r0(n)}function yie(){var e=Qit(Pb());return e.copy=function(){return n0(e,yie()).constant(e.constant())},Go.apply(e,arguments)}function qL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Xit(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Zit(e){return e<0?-e*e:e*e}function Jit(e){var t=e(za,za),n=1;function r(){return n===1?e(za,za):n===.5?e(Xit,Zit):e(qL(n),qL(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},r0(t)}function y8(){var e=Jit(Pb());return e.copy=function(){return n0(e,y8()).exponent(e.exponent())},Go.apply(e,arguments),e}function elt(){return y8.apply(null,arguments).exponent(.5)}function KL(e){return Math.sign(e)*e*e}function tlt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xie(){var e=p8(),t=[0,1],n=!1,r;function s(o){var a=tlt(e(o));return isNaN(a)?r:n?Math.round(a):a}return s.invert=function(o){return e.invert(KL(o))},s.domain=function(o){return arguments.length?(e.domain(o),s):e.domain()},s.range=function(o){return arguments.length?(e.range((t=Array.from(o,die)).map(KL)),s):t.slice()},s.rangeRound=function(o){return s.range(o).round(!0)},s.round=function(o){return arguments.length?(n=!!o,s):n},s.clamp=function(o){return arguments.length?(e.clamp(o),s):e.clamp()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return xie(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Go.apply(s,arguments),r0(s)}function vie(){var e=[],t=[],n=[],r;function s(){var a=0,i=Math.max(1,t.length);for(n=new Array(i-1);++a0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(c){return arguments.length&&(o=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return bie().domain([e,t]).range(s).unknown(o)},Go.apply(r0(a),arguments)}function _ie(){var e=[.5],t=[0,1],n,r=1;function s(o){return o!=null&&o<=o?t[tm(e,o,0,r)]:n}return s.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},s.unknown=function(o){return arguments.length?(n=o,s):n},s.copy=function(){return _ie().domain(e).range(t).unknown(n)},Go.apply(s,arguments)}function nlt(e){return new Date(e)}function rlt(e){return e instanceof Date?+e:+new Date(+e)}function x8(e,t,n,r,s,o,a,i,c,u){var f=p8(),m=f.invert,p=f.domain,h=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),_=u("%B"),w=u("%Y");function S(C){return(c(C)"u"?r:r.gamma(n)}function plt(e,t){if("interpolate"in t&&"interpolate"in e&&typeof t.interpolate<"u"){var n=mlt(t.interpolate);e.interpolate(n)}}var hlt=new Date(Date.UTC(2020,1,2,3,4,5)),glt="%Y-%m-%d %H:%M";function wie(e){var t=e.tickFormat(1,glt)(hlt);return t==="2020-02-02 03:04"}var QL={day:em,hour:ub,minute:lb,month:Vg,second:Pi,week:Bg,year:ba},XL={day:Fg,hour:db,minute:cb,month:fb,second:Pi,week:Ug,year:ai};function ylt(e,t){if("nice"in t&&typeof t.nice<"u"&&"nice"in e){var n=t.nice;if(typeof n=="boolean")n&&e.nice();else if(typeof n=="number")e.nice(n);else{var r=e,s=wie(r);if(typeof n=="string")r.nice(s?XL[n]:QL[n]);else{var o=n.interval,a=n.step,i=(s?XL[o]:QL[o]).every(a);i!=null&&r.nice(i)}}}}function xlt(e,t){"padding"in e&&"padding"in t&&typeof t.padding<"u"&&e.padding(t.padding),"paddingInner"in e&&"paddingInner"in t&&typeof t.paddingInner<"u"&&e.paddingInner(t.paddingInner),"paddingOuter"in e&&"paddingOuter"in t&&typeof t.paddingOuter<"u"&&e.paddingOuter(t.paddingOuter)}function vlt(e,t){if(t.reverse){var n=e.range().slice().reverse();"padding"in e,e.range(n)}}function blt(e,t){"round"in t&&typeof t.round<"u"&&(t.round&&"interpolate"in t&&typeof t.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",t):"round"in e?e.round(t.round):"interpolate"in e&&t.round&&e.interpolate(iie))}function _lt(e,t){"unknown"in e&&"unknown"in t&&typeof t.unknown<"u"&&e.unknown(t.unknown)}function wlt(e,t){if("zero"in t&&t.zero===!0){var n=e.domain(),r=n[0],s=n[1],o=s=0)&&(n[s]=e[s]);return n}function Iie(e){var t=e.className,n=e.data,r=e.innerRadius,s=e.outerRadius,o=e.cornerRadius,a=e.startAngle,i=e.endAngle,c=e.padAngle,u=e.padRadius,f=e.children,m=e.innerRef,p=Ylt(e,Klt),h=C8({innerRadius:r,outerRadius:s,cornerRadius:o,startAngle:a,endAngle:i,padAngle:c,padRadius:u});return f?A.createElement(A.Fragment,null,f({path:h})):!n&&(a==null||i==null||r==null||s==null)?(console.warn("[@visx/shape/Arc]: expected data because one of startAngle, endAngle, innerRadius, outerRadius is undefined. Bailing."),null):A.createElement("path",e5({ref:m,className:z("visx-arc",t),d:h(n)||""},p))}var Qlt=["className","top","left","data","centroid","innerRadius","outerRadius","cornerRadius","startAngle","endAngle","padAngle","padRadius","pieSort","pieSortValues","pieValue","children","fill"];function t5(){return t5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Zlt(e){var t=e.className,n=e.top,r=e.left,s=e.data,o=s===void 0?[]:s,a=e.centroid,i=e.innerRadius,c=i===void 0?0:i,u=e.outerRadius,f=e.cornerRadius,m=e.startAngle,p=e.endAngle,h=e.padAngle,g=e.padRadius,y=e.pieSort,x=e.pieSortValues,v=e.pieValue,b=e.children,_=e.fill,w=_===void 0?"":_,S=Xlt(e,Qlt),C=C8({innerRadius:c,outerRadius:u,cornerRadius:f,padRadius:g}),E=Rie({startAngle:m,endAngle:p,padAngle:h,value:v,sort:y,sortValues:x}),T=E(o);return b?A.createElement(A.Fragment,null,b({arcs:T,path:C,pie:E})):A.createElement(Cs,{className:"visx-pie-arcs-group",top:n,left:r},T.map(function(k,I){return A.createElement("g",{key:"pie-arc-"+I},A.createElement("path",t5({className:z("visx-pie-arc",t),d:C(k)||"",fill:w==null||typeof w=="string"?w:w(k)},S)),a?.(C.centroid(k),k))}))}var Jlt=["from","to","fill","className","innerRef"];function n5(){return n5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Ub(e){var t=e.from,n=t===void 0?{x:0,y:0}:t,r=e.to,s=r===void 0?{x:1,y:1}:r,o=e.fill,a=o===void 0?"transparent":o,i=e.className,c=e.innerRef,u=ect(e,Jlt),f=n.x===s.x||n.y===s.y;return A.createElement("line",n5({ref:c,className:z("visx-line",i),x1:n.x,y1:n.y,x2:s.x,y2:s.y,fill:a,shapeRendering:f?"crispEdges":"auto"},u))}var tct=["children","data","x","y","fill","className","curve","innerRef","defined"];function r5(){return r5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Pie(e){var t=e.children,n=e.data,r=n===void 0?[]:n,s=e.x,o=e.y,a=e.fill,i=a===void 0?"transparent":a,c=e.className,u=e.curve,f=e.innerRef,m=e.defined,p=m===void 0?function(){return!0}:m,h=nct(e,tct),g=sl({x:s,y:o,defined:p,curve:u});return t?A.createElement(A.Fragment,null,t({path:g})):A.createElement("path",r5({ref:f,className:z("visx-linepath",c),d:g(r)||"",fill:i,strokeLinecap:"round"},h))}var rct=["className","angle","radius","defined","curve","data","innerRef","children","fill"];function s5(){return s5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function oct(e){var t=e.className,n=e.angle,r=e.radius,s=e.defined,o=e.curve,a=e.data,i=a===void 0?[]:a,c=e.innerRef,u=e.children,f=e.fill,m=f===void 0?"transparent":f,p=sct(e,rct),h=Die({angle:n,radius:r,defined:s,curve:o});return u?A.createElement(A.Fragment,null,u({path:h})):A.createElement("path",s5({ref:c,className:z("visx-line-radial",t),d:h(i)||"",fill:m},p))}var act=["children","x","x0","x1","y","y0","y1","data","defined","className","curve","innerRef"];function o5(){return o5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function lct(e){var t=e.children,n=e.x,r=e.x0,s=e.x1,o=e.y,a=e.y0,i=e.y1,c=e.data,u=c===void 0?[]:c,f=e.defined,m=f===void 0?function(){return!0}:f,p=e.className,h=e.curve,g=e.innerRef,y=ict(e,act),x=Bb({x:n,x0:r,x1:s,y:o,y0:a,y1:i,defined:m,curve:h});return t?A.createElement(A.Fragment,null,t({path:x})):A.createElement("path",o5({ref:g,className:z("visx-area",p),d:x(u)||""},y))}var cct=["x","x0","x1","y","y1","y0","yScale","data","defined","className","curve","innerRef","children"];function a5(){return a5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Fh(e){var t=e.x,n=e.x0,r=e.x1,s=e.y,o=e.y1,a=e.y0,i=e.yScale,c=e.data,u=c===void 0?[]:c,f=e.defined,m=f===void 0?function(){return!0}:f,p=e.className,h=e.curve,g=e.innerRef,y=e.children,x=uct(e,cct),v=Bb({x:t,x0:n,x1:r,defined:m,curve:h});return a==null?v.y0(i.range()[0]):In(v.y0,a),s&&!o&&In(v.y1,s),o&&!s&&In(v.y1,o),y?A.createElement(A.Fragment,null,y({path:v})):A.createElement("path",a5({ref:g,className:z("visx-area-closed",p),d:v(u)||""},x))}var dct=["className","top","left","keys","data","curve","defined","x","x0","x1","y0","y1","value","order","offset","color","children"];function i5(){return i5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Oie(e){var t=e.className,n=e.top,r=e.left,s=e.keys,o=e.data,a=e.curve,i=e.defined,c=e.x,u=e.x0,f=e.x1,m=e.y0,p=e.y1,h=e.value,g=e.order,y=e.offset,x=e.color,v=e.children,b=fct(e,dct),_=jie({keys:s,value:h,order:g,offset:y}),w=Bb({x:c,x0:u,x1:f,y0:m,y1:p,curve:a,defined:i}),S=_(o);return v?A.createElement(A.Fragment,null,v({stacks:S,path:w,stack:_})):A.createElement(Cs,{top:n,left:r},S.map(function(C,E){return A.createElement("path",i5({className:z("visx-stack",t),key:"stack-"+E+"-"+(C.key||""),d:w(C)||"",fill:x?.(C.key,E)},b))}))}var mct=["className","top","left","keys","data","curve","defined","x","x0","x1","y0","y1","value","order","offset","color","children"];function J2(){return J2=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function hct(e){var t=e.className,n=e.top,r=e.left,s=e.keys,o=e.data,a=e.curve,i=e.defined,c=e.x,u=e.x0,f=e.x1,m=e.y0,p=e.y1,h=e.value,g=e.order,y=e.offset,x=e.color,v=e.children,b=pct(e,mct);return A.createElement(Oie,J2({className:t,top:n,left:r,keys:s,data:o,curve:a,defined:i,x:c,x0:u,x1:f,y0:m,y1:p,value:h,order:g,offset:y,color:x},b),v||function(_){var w=_.stacks,S=_.path;return w.map(function(C,E){return A.createElement("path",J2({className:z("visx-area-stack",t),key:"area-stack-"+E+"-"+(C.key||""),d:S(C)||"",fill:x?.(C.key,E)},b))})})}var gct=["className","innerRef"];function l5(){return l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function cm(e){var t=e.className,n=e.innerRef,r=yct(e,gct);return A.createElement("rect",l5({ref:n,className:z("visx-bar",t)},r))}var xct=["children","className","innerRef","x","y","width","height","radius","all","top","bottom","left","right","topLeft","topRight","bottomLeft","bottomRight"];function c5(){return c5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function bct(e){var t=e.all,n=e.bottom,r=e.bottomLeft,s=e.bottomRight,o=e.height,a=e.left,i=e.radius,c=e.right,u=e.top,f=e.topLeft,m=e.topRight,p=e.width,h=e.x,g=e.y;m=t||u||c||m,s=t||n||c||s,r=t||n||a||r,f=t||u||a||f,i=Math.max(1,Math.min(i,Math.min(p,o)/2));var y=2*i,x=("M"+(h+i)+","+g+" h"+(p-y)+` - `+(m?"a"+i+","+i+" 0 0 1 "+i+","+i:"h"+i+"v"+i)+` - v`+(o-y)+` - `+(s?"a"+i+","+i+" 0 0 1 "+-i+","+i:"v"+i+"h"+-i)+` - h`+(y-p)+` - `+(r?"a"+i+","+i+" 0 0 1 "+-i+","+-i:"h"+-i+"v"+-i)+` - v`+(y-o)+` - `+(f?"a"+i+","+i+" 0 0 1 "+i+","+-i:"v"+-i+"h"+i)+` -z`).split(` -`).join("");return x}function _ct(e){var t=e.children,n=e.className,r=e.innerRef,s=e.x,o=e.y,a=e.width,i=e.height,c=e.radius,u=e.all,f=u===void 0?!1:u,m=e.top,p=m===void 0?!1:m,h=e.bottom,g=h===void 0?!1:h,y=e.left,x=y===void 0?!1:y,v=e.right,b=v===void 0?!1:v,_=e.topLeft,w=_===void 0?!1:_,S=e.topRight,C=S===void 0?!1:S,E=e.bottomLeft,T=E===void 0?!1:E,k=e.bottomRight,I=k===void 0?!1:k,M=vct(e,xct),N=bct({x:s,y:o,width:a,height:i,radius:c,all:f,top:p,bottom:g,left:x,right:b,topLeft:w,topRight:C,bottomLeft:T,bottomRight:I});return t?A.createElement(A.Fragment,null,t({path:N})):A.createElement("path",c5({ref:r,className:z("visx-bar-rounded",n),d:N},M))}function Vb(e){if("bandwidth"in e)return e.bandwidth();var t=e.range(),n=e.domain();return Math.abs(t[t.length-1]-t[0])/n.length}var wct=["data","className","top","left","x0","x0Scale","x1Scale","yScale","color","keys","height","children"];function u5(){return u5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Sct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x0,a=e.x0Scale,i=e.x1Scale,c=e.yScale,u=e.color,f=e.keys,m=e.height,p=e.children,h=Cct(e,wct),g=Vb(i),y=t.map(function(x,v){return{index:v,x0:a(o(x)),bars:f.map(function(b,_){var w=x[b];return{index:_,key:b,value:w,width:g,x:i(b)||0,y:c(w)||0,color:u(b,_),height:m-(c(w)||0)}})}});return p?A.createElement(A.Fragment,null,p(y)):A.createElement(Cs,{className:z("visx-bar-group",n),top:r,left:s},y.map(function(x){return A.createElement(Cs,{key:"bar-group-"+x.index+"-"+x.x0,left:x.x0},x.bars.map(function(v){return A.createElement(cm,u5({key:"bar-group-bar-"+x.index+"-"+v.index+"-"+v.value+"-"+v.key,x:v.x,y:v.y,width:v.width,height:v.height,fill:v.color},h))}))}))}var Ect=["data","className","top","left","x","y0","y0Scale","y1Scale","xScale","color","keys","width","children"];function d5(){return d5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Mct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x,a=o===void 0?function(){return 0}:o,i=e.y0,c=e.y0Scale,u=e.y1Scale,f=e.xScale,m=e.color,p=e.keys;e.width;var h=e.children,g=kct(e,Ect),y=Vb(u),x=t.map(function(v,b){return{index:b,y0:c(i(v))||0,bars:p.map(function(_,w){var S=v[_];return{index:w,key:_,value:S,height:y,x:a(S)||0,y:u(_)||0,color:m(_,w),width:f(S)||0}})}});return h?A.createElement(A.Fragment,null,h(x)):A.createElement(Cs,{className:z("visx-bar-group-horizontal",n),top:r,left:s},x.map(function(v){return A.createElement(Cs,{key:"bar-group-"+v.index+"-"+v.y0,top:v.y0},v.bars.map(function(b){return A.createElement(cm,d5({key:"bar-group-bar-"+v.index+"-"+b.index+"-"+b.value+"-"+b.key,x:b.x,y:b.y,width:b.width,height:b.height,fill:b.color},g))}))}))}function $o(e){return typeof e?.x=="number"?e?.x:0}function qo(e){return typeof e?.y=="number"?e?.y:0}function Ko(e){return e?.source}function Yo(e){return e?.target}function Lie(e){return e?.[0]}function Fie(e){return e?.[1]}var Tct=["data","className","top","left","x","y0","y1","xScale","yScale","color","keys","value","order","offset","children"];function f5(){return f5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Nct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x,a=e.y0,i=a===void 0?Lie:a,c=e.y1,u=c===void 0?Fie:c,f=e.xScale,m=e.yScale,p=e.color,h=e.keys,g=e.value,y=e.order,x=e.offset,v=e.children,b=Act(e,Tct),_=QN();h&&_.keys(h),g&&In(_.value,g),y&&_.order(Lb(y)),x&&_.offset(Fb(x));var w=_(t),S=Vb(f),C=w.map(function(E,T){var k=E.key;return{index:T,key:k,bars:E.map(function(I,M){var N=(m(i(I))||0)-(m(u(I))||0),D=m(u(I)),j="bandwidth"in f?f(o(I.data)):Math.max((f(o(I.data))||0)-S/2);return{bar:I,key:k,index:M,height:N,width:S,x:j||0,y:D||0,color:p(E.key,M)}})}});return v?A.createElement(A.Fragment,null,v(C)):A.createElement(Cs,{className:z("visx-bar-stack",n),top:r,left:s},C.map(function(E){return E.bars.map(function(T){return A.createElement(cm,f5({key:"bar-stack-"+E.index+"-"+T.index,x:T.x,y:T.y,height:T.height,width:T.width,fill:T.color},b))})}))}var Rct=["data","className","top","left","y","x0","x1","xScale","yScale","color","keys","value","order","offset","children"];function m5(){return m5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function jct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.y,a=e.x0,i=a===void 0?Lie:a,c=e.x1,u=c===void 0?Fie:c,f=e.xScale,m=e.yScale,p=e.color,h=e.keys,g=e.value,y=e.order,x=e.offset,v=e.children,b=Dct(e,Rct),_=QN();h&&_.keys(h),g&&In(_.value,g),y&&_.order(Lb(y)),x&&_.offset(Fb(x));var w=_(t),S=Vb(m),C=w.map(function(E,T){var k=E.key;return{index:T,key:k,bars:E.map(function(I,M){var N=(f(u(I))||0)-(f(i(I))||0),D=f(i(I)),j="bandwidth"in m?m(o(I.data)):Math.max((m(o(I.data))||0)-N/2);return{bar:I,key:k,index:M,height:S,width:N,x:D||0,y:j||0,color:p(E.key,M)}})}});return v?A.createElement(A.Fragment,null,v(C)):A.createElement(Cs,{className:z("visx-bar-stack-horizontal",n),top:r,left:s},C.map(function(E){return E.bars.map(function(T){return A.createElement(cm,m5({key:"bar-stack-"+E.index+"-"+T.index,x:T.x,y:T.y,height:T.height,width:T.width,fill:T.color},b))})}))}var Bie=function(t){return Math.PI/180*t},Ict=["className","children","data","innerRef","path","x","y","source","target"];function p5(){return p5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Uie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=hat();return a.x(r),a.y(s),a.source(t),a.target(n),a(o)}}function Oct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.x,i=a===void 0?qo:a,c=e.y,u=c===void 0?$o:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Pct(e,Ict),y=o||Uie({source:m,target:h,x:i,y:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",p5({ref:s,className:z("visx-link visx-link-horizontal-diagonal",t),d:y(r)||""},g))}var Lct=["className","children","data","innerRef","path","x","y","source","target"];function h5(){return h5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Vie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=gat();return a.x(r),a.y(s),a.source(t),a.target(n),a(o)}}function Bct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.x,i=a===void 0?$o:a,c=e.y,u=c===void 0?qo:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Fct(e,Lct),y=o||Vie({source:m,target:h,x:i,y:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",h5({ref:s,className:z("visx-link visx-link-vertical-diagonal",t),d:y(r)||""},g))}var Uct=["className","children","data","innerRef","path","angle","radius","source","target"];function g5(){return g5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Hie(e){var t=e.source,n=e.target,r=e.angle,s=e.radius;return function(o){var a=yat();return a.angle(r),a.radius(s),a.source(t),a.target(n),a(o)}}function Hct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.angle,i=a===void 0?$o:a,c=e.radius,u=c===void 0?qo:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Vct(e,Uct),y=o||Hie({source:m,target:h,angle:i,radius:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",g5({ref:s,className:z("visx-link visx-link-radial-diagonal",t),d:y(r)||""},g))}var zct=["className","children","data","innerRef","path","percent","x","y","source","target"];function y5(){return y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function zie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=m-u,g=p-f,y=o*(h+g),x=o*(g-h),v=ho();return v.moveTo(u,f),v.bezierCurveTo(u+y,f+x,m+x,p-y,m,p),v.toString()}}function Gct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?qo:c,f=e.y,m=f===void 0?$o:f,p=e.source,h=p===void 0?Ko:p,g=e.target,y=g===void 0?Yo:g,x=Wct(e,zct),v=o||zie({source:h,target:y,x:u,y:m,percent:i});return n?A.createElement(A.Fragment,null,n({path:v})):A.createElement("path",y5({ref:s,className:z("visx-link visx-link-horizontal-curve",t),d:v(r)||""},x))}var $ct=["className","children","data","innerRef","path","percent","x","y","source","target"];function x5(){return x5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Wie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=m-u,g=p-f,y=o*(h+g),x=o*(g-h),v=ho();return v.moveTo(u,f),v.bezierCurveTo(u+y,f+x,m+x,p-y,m,p),v.toString()}}function Kct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?$o:c,f=e.y,m=f===void 0?qo:f,p=e.source,h=p===void 0?Ko:p,g=e.target,y=g===void 0?Yo:g,x=qct(e,$ct),v=o||Wie({source:h,target:y,x:u,y:m,percent:i});return n?A.createElement(A.Fragment,null,n({path:v})):A.createElement("path",x5({ref:s,className:z("visx-link visx-link-vertical-curve",t),d:v(r)||""},x))}var Yct=["className","children","data","innerRef","path","percent","x","y","source","target"];function v5(){return v5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Gie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i)-Math.PI/2,f=s(i),m=r(c)-Math.PI/2,p=s(c),h=Math.cos(u),g=Math.sin(u),y=Math.cos(m),x=Math.sin(m),v=f*h,b=f*g,_=p*y,w=p*x,S=_-v,C=w-b,E=o*(S+C),T=o*(C-S),k=ho();return k.moveTo(v,b),k.bezierCurveTo(v+E,b+T,_+T,w-E,_,w),k.toString()}}function Xct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?$o:c,f=e.y,m=f===void 0?qo:f,p=e.source,h=p===void 0?Ko:p,g=e.target,y=g===void 0?Yo:g,x=Qct(e,Yct),v=o||Gie({source:h,target:y,x:u,y:m,percent:i});return n?A.createElement(A.Fragment,null,n({path:v})):A.createElement("path",v5({ref:s,className:z("visx-link visx-link-radial-curve",t),d:v(r)||""},x))}var Zct=["className","children","innerRef","data","path","x","y","source","target"];function b5(){return b5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function $ie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=ho();return p.moveTo(c,u),p.lineTo(f,m),p.toString()}}function eut(e){var t=e.className,n=e.children,r=e.innerRef,s=e.data,o=e.path,a=e.x,i=a===void 0?qo:a,c=e.y,u=c===void 0?$o:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Jct(e,Zct),y=o||$ie({source:m,target:h,x:i,y:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",b5({ref:r,className:z("visx-link visx-link-horizontal-line",t),d:y(s)||""},g))}var tut=["className","innerRef","data","path","x","y","source","target","children"];function _5(){return _5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function qie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=ho();return p.moveTo(c,u),p.lineTo(f,m),p.toString()}}function rut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?$o:o,i=e.y,c=i===void 0?qo:i,u=e.source,f=u===void 0?Ko:u,m=e.target,p=m===void 0?Yo:m,h=e.children,g=nut(e,tut),y=s||qie({source:f,target:p,x:a,y:c});return h?A.createElement(A.Fragment,null,h({path:y})):A.createElement("path",_5({ref:n,className:z("visx-link visx-link-vertical-line",t),d:y(r)||""},g))}var sut=["className","innerRef","data","path","x","y","source","target","children"];function w5(){return w5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Kie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a)-Math.PI/2,u=s(a),f=r(i)-Math.PI/2,m=s(i),p=Math.cos(c),h=Math.sin(c),g=Math.cos(f),y=Math.sin(f),x=ho();return x.moveTo(u*p,u*h),x.lineTo(m*g,m*y),x.toString()}}function aut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?$o:o,i=e.y,c=i===void 0?qo:i,u=e.source,f=u===void 0?Ko:u,m=e.target,p=m===void 0?Yo:m,h=e.children,g=out(e,sut),y=s||Kie({source:f,target:p,x:a,y:c});return h?A.createElement(A.Fragment,null,h({path:y})):A.createElement("path",w5({ref:n,className:z("visx-link visx-link-radial-line",t),d:y(r)||""},g))}var iut=["className","innerRef","data","path","percent","x","y","source","target","children"];function C5(){return C5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Yie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=ho();return h.moveTo(u,f),h.lineTo(u+(m-u)*o,f),h.lineTo(u+(m-u)*o,p),h.lineTo(m,p),h.toString()}}function cut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.percent,a=o===void 0?.5:o,i=e.x,c=i===void 0?qo:i,u=e.y,f=u===void 0?$o:u,m=e.source,p=m===void 0?Ko:m,h=e.target,g=h===void 0?Yo:h,y=e.children,x=lut(e,iut),v=s||Yie({source:p,target:g,x:c,y:f,percent:a});return y?A.createElement(A.Fragment,null,y({path:v})):A.createElement("path",C5({ref:n,className:z("visx-link visx-link-horizontal-step",t),d:v(r)||""},x))}var uut=["className","innerRef","data","path","percent","x","y","source","target","children"];function S5(){return S5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Qie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=ho();return h.moveTo(u,f),h.lineTo(u,f+(p-f)*o),h.lineTo(m,f+(p-f)*o),h.lineTo(m,p),h.toString()}}function fut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.percent,a=o===void 0?.5:o,i=e.x,c=i===void 0?$o:i,u=e.y,f=u===void 0?qo:u,m=e.source,p=m===void 0?Ko:m,h=e.target,g=h===void 0?Yo:h,y=e.children,x=dut(e,uut),v=s||Qie({source:p,target:g,x:c,y:f,percent:a});return y?A.createElement(A.Fragment,null,y({path:v})):A.createElement("path",S5({ref:n,className:z("visx-link visx-link-vertical-step",t),d:v(r)||""},x))}var mut=["className","innerRef","data","path","x","y","source","target","children"];function E5(){return E5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Xie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=c-Math.PI/2,h=u,g=f-Math.PI/2,y=m,x=Math.cos(p),v=Math.sin(p),b=Math.cos(g),_=Math.sin(g),w=Math.abs(g-p)>Math.PI?g<=p:g>p;return` - M`+h*x+","+h*v+` - A`+h+","+h+",0,0,"+(w?1:0)+","+h*b+","+h*_+` - L`+y*b+","+y*_+` - `}}function hut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?$o:o,i=e.y,c=i===void 0?qo:i,u=e.source,f=u===void 0?Ko:u,m=e.target,p=m===void 0?Yo:m,h=e.children,g=put(e,mut),y=s||Xie({source:f,target:p,x:a,y:c});return h?A.createElement(A.Fragment,null,h({path:y})):A.createElement("path",E5({ref:n,className:z("visx-link visx-link-radial-step",t),d:y(r)||""},g))}var gut=["sides","size","center","rotate","className","children","innerRef","points"];function k5(){return k5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}var Zie={x:0,y:0},Jie=function(t){var n=t.sides,r=n===void 0?4:n,s=t.size,o=s===void 0?25:s,a=t.center,i=a===void 0?Zie:a,c=t.rotate,u=c===void 0?0:c,f=t.side,m=360/r*f-u,p=Bie(m);return{x:i.x+o*Math.cos(p),y:i.y+o*Math.sin(p)}},ele=function(t){var n=t.sides,r=t.size,s=t.center,o=t.rotate;return new Array(n).fill(0).map(function(a,i){return Jie({sides:n,size:r,center:s,rotate:o,side:i})})};function xut(e){var t=e.sides,n=t===void 0?4:t,r=e.size,s=r===void 0?25:r,o=e.center,a=o===void 0?Zie:o,i=e.rotate,c=i===void 0?0:i,u=e.className,f=e.children,m=e.innerRef,p=e.points,h=yut(e,gut),g=p||ele({sides:n,size:s,center:a,rotate:c}).map(function(y){var x=y.x,v=y.y;return[x,v]});return f?A.createElement(A.Fragment,null,f({points:g})):A.createElement("polygon",k5({ref:m,className:z("visx-polygon",u),points:g.join(" ")},h))}var vut=["className","innerRef"];function M5(){return M5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function _ut(e){var t=e.className,n=e.innerRef,r=but(e,vut);return A.createElement("circle",M5({ref:n,className:z("visx-circle",t)},r))}var ZL="http://www.w3.org/2000/svg";function wut(e){var t=document.getElementById(e);if(!t){var n=document.createElementNS(ZL,"svg");n.setAttribute("aria-hidden","true"),n.style.opacity="0",n.style.width="0",n.style.height="0",n.style.position="absolute",n.style.top="-100%",n.style.left="-100%",n.style.pointerEvents="none",t=document.createElementNS(ZL,"path"),t.setAttribute("id",e),n.appendChild(t),document.body.appendChild(n)}return t}var Cut="__visx_splitpath_svg_path_measurement_id",JL=function(){return!0};function Sut(e){var t=e.path,n=e.pointsInSegments,r=e.segmentation,s=r===void 0?"x":r,o=e.sampleRate,a=o===void 0?1:o;try{var i=wut(Cut);i.setAttribute("d",t);var c=i.getTotalLength(),u=n.length,f=n.map(function(){return[]});if(s==="x"||s==="y")for(var m=n.map(function(D){var j;return(j=D.find(function(F){return typeof F[s]=="number"}))==null?void 0:j[s]}),p=i.getPointAtLength(0),h=i.getPointAtLength(c),g=h[s]>p[s],y=g?m.map(function(D){return typeof D>"u"?JL:function(j){return j>=D}}):m.map(function(D){return typeof D>"u"?JL:function(j){return j<=D}}),x=0,v=0;v<=c;v+=a){for(var b=i.getPointAtLength(v),_=b[s];x=E[I+1];)I+=1;f[I].push(N)}}return f}catch{return[]}}function T5(){return T5=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"?function(){return c}:c,y=typeof u=="number"||typeof u>"u"?function(){return u}:u;return i.map(function(x){return x.map(function(v,b){return{x:g(v,b,x),y:y(v,b,x)}})})},[c,u,i]),p=d.useMemo(function(){var g=sl({x:c,y:u,defined:s,curve:r});return g(i.flat())||""},[c,u,s,r,i]),h=d.useMemo(function(){return Sut({path:p,segmentation:o,pointsInSegments:m,sampleRate:a})},[p,o,m,a]);return A.createElement("g",null,h.map(function(g,y){return t?A.createElement(A.Fragment,{key:y},t({index:y,segment:g,styles:f[y]||f[y%f.length]})):A.createElement(Pie,T5({key:y,className:n,data:g,x:Eut,y:kut},f[y]||f[y%f.length]))}))}tle.propTypes={segments:ze.arrayOf(ze.array).isRequired,styles:ze.array.isRequired,children:ze.func,className:ze.string};const Mut=Object.freeze(Object.defineProperty({__proto__:null,Arc:Iie,Area:lct,AreaClosed:Fh,AreaStack:hct,Bar:cm,BarGroup:Sct,BarGroupHorizontal:Mct,BarRounded:_ct,BarStack:Nct,BarStackHorizontal:jct,Circle:_ut,Line:Ub,LinePath:Pie,LineRadial:oct,LinkHorizontal:Oct,LinkHorizontalCurve:Gct,LinkHorizontalLine:eut,LinkHorizontalStep:cut,LinkRadial:Hct,LinkRadialCurve:Xct,LinkRadialLine:aut,LinkRadialStep:hut,LinkVertical:Bct,LinkVerticalCurve:Kct,LinkVerticalLine:rut,LinkVerticalStep:fut,Pie:Zlt,Polygon:xut,STACK_OFFSETS:Z2,STACK_OFFSET_NAMES:qlt,STACK_ORDERS:X2,STACK_ORDER_NAMES:$lt,SplitLinePath:tle,Stack:Oie,arc:C8,area:Bb,degreesToRadians:Bie,getPoint:Jie,getPoints:ele,line:sl,pathHorizontalCurve:zie,pathHorizontalDiagonal:Uie,pathHorizontalLine:$ie,pathHorizontalStep:Yie,pathRadialCurve:Gie,pathRadialDiagonal:Hie,pathRadialLine:Kie,pathRadialStep:Xie,pathVerticalCurve:Wie,pathVerticalDiagonal:Vie,pathVerticalLine:qie,pathVerticalStep:Qie,pie:Rie,radialLine:Die,stack:jie,stackOffset:Fb,stackOrder:Lb},Symbol.toStringTag,{value:"Module"}));var NC,eF;function Tut(){if(eF)return NC;eF=1,NC=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var a=n(r,s,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+r.length,a[1]),post:o.slice(a[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var a,i,c,u,f,m=o.indexOf(r),p=o.indexOf(s,m+1),h=m;if(m>=0&&p>0){for(a=[],c=o.length;h>=0&&!f;)h==m?(a.push(h),m=o.indexOf(r,h+1)):a.length==1?f=[a.pop(),p]:(i=a.pop(),i=0?m:p;a.length&&(f=[c,u])}return f}return NC}var RC,tF;function Aut(){if(tF)return RC;tF=1,RC=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var a=n(r,s,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+r.length,a[1]),post:o.slice(a[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var a,i,c,u,f,m=o.indexOf(r),p=o.indexOf(s,m+1),h=m;if(m>=0&&p>0){if(r===s)return[m,p];for(a=[],c=o.length;h>=0&&!f;)h==m?(a.push(h),m=o.indexOf(r,h+1)):a.length==1?f=[a.pop(),p]:(i=a.pop(),i=0?m:p;a.length&&(f=[c,u])}return f}return RC}var DC,nF;function Nut(){if(nF)return DC;nF=1;var e=Aut();DC=t;function t(s,o,a){var i=s;return n(s,o).reduce(function(c,u){return c.replace(u.functionIdentifier+"("+u.matches.body+")",r(u.matches.body,u.functionIdentifier,a,i,o))},s)}function n(s,o){var a=[],i=typeof o=="string"?new RegExp("\\b("+o+")\\("):o;do{var c=i.exec(s);if(!c)return a;if(c[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+o);var u=c[1],f=c.index,m=e("(",")",s.substring(f));if(!m||m.start!==c[0].length-1)throw new SyntaxError(u+"(): missing closing ')' in the value '"+s+"'");a.push({matches:m,functionIdentifier:u}),s=m.post}while(i.test(s));return a}function r(s,o,a,i,c){return a(t(s,c,a),o,i)}return DC}var jC,rF;function Rut(){if(rF)return jC;rF=1;var e=function(t){this.value=t};return e.math={isDegree:!0,acos:function(t){return e.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,n){return t+n},asin:function(t){return e.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return e.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,n){var r=1,s=t-n,o=n;om.length-2?m.length-1:b.length-T;C>0;C--)if(m[C]!==void 0)for(E=0;E0&&Ms)i.push(n);else{for(;s>=o&&!f||f&&o"u"?n[n.length-1].value.push(a[c]):n[n.length-1].value=a[c].value(n[n.length-1].value);else if(a[c].type===7)typeof n[n.length-1].type>"u"?n[n.length-1].value.push(a[c]):n[n.length-1].value=a[c].value(n[n.length-1].value);else if(a[c].type===8){for(var u=[],f=0;f"u"?(s.value=s.concat(r),s.value.push(a[c]),n.push(s)):typeof r.type>"u"?(r.unshift(s),r.push(a[c]),n.push(r)):n.push({type:1,value:a[c].value(s.value,r.value)})):a[c].type===2||a[c].type===9?(r=n.pop(),s=n.pop(),typeof s.type>"u"?(s=s.concat(r),s.push(a[c]),n.push(s)):typeof r.type>"u"?(r.unshift(s),r.push(a[c]),n.push(r)):n.push({type:1,value:a[c].value(s.value,r.value)})):a[c].type===12?(r=n.pop(),typeof r.type<"u"&&(r=[r]),s=n.pop(),o=n.pop(),n.push({type:1,value:a[c].value(o.value,s.value,new e(r))})):a[c].type===13&&(i?n.push({value:t[a[c].value],type:3}):n.push([a[c]]));if(n.length>1)throw new e.Exception("Uncaught Syntax error");return n[0].value>1e15?"Infinity":parseFloat(n[0].value.toFixed(15))},e.eval=function(t,n,r){return typeof n>"u"?this.lex(t).toPostfix().postfixEval():typeof r>"u"?typeof n.length<"u"?this.lex(t,n).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(n):this.lex(t,n).toPostfix().postfixEval(r)},OC=e,OC}var LC,iF;function Put(){if(iF)return LC;iF=1;var e=Iut();return e.prototype.formulaEval=function(){for(var t,n,r,s=[],o=this.value,a=0;a"+n.value+""+o[a].show+""+t.value+"",type:10}):s.push({value:(n.type!=1?"(":"")+n.value+(n.type!=1?")":"")+""+t.value+"",type:1})):o[a].type===2||o[a].type===9?(t=s.pop(),n=s.pop(),s.push({value:(n.type!=1?"(":"")+n.value+(n.type!=1?")":"")+o[a].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:o[a].type})):o[a].type===12&&(t=s.pop(),n=s.pop(),r=s.pop(),s.push({value:o[a].show+"("+r.value+","+n.value+","+t.value+")",type:12}));return s[0].value},LC=e,LC}var FC,lF;function Out(){if(lF)return FC;lF=1;var e=Tut(),t=Nut(),n=Put(),r=100,s=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,o;FC=a;function a(c,u){o=0,u=Math.pow(10,u===void 0?5:u),c=c.replace(/\n+/g," ");function f(p,h,g){if(o++>r)throw o=0,new Error("Call stack overflow for "+g);if(p==="")throw new Error(h+"(): '"+g+"' must contain a non-whitespace string");p=m(p,g);var y=i(p);if(y.length>1||p.indexOf("var(")>-1)return h+"("+p+")";var x=y[0]||"";x==="%"&&(p=p.replace(/\b[0-9\.]+%/g,function(_){return parseFloat(_.slice(0,-1))*.01}));var v=p.replace(new RegExp(x,"gi"),""),b;try{b=n.eval(v)}catch{return h+"("+p+")"}return x==="%"&&(b*=100),(h.length||x==="%")&&(b=Math.round(b*u)/u),b+=x,b}function m(p,h){p=p.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var g="",y=p,x;x=s.exec(y);){x[0].index>0&&(g+=y.substring(0,x[0].index));var v=e("(",")",y.substring([0].index));if(v.body==="")throw new Error("'"+p+"' must contain a non-whitespace string");var b=f(v.body,"",h);g+=v.pre+b,y=v.post}return g+y}return t(c,/((?:\-[a-z]+\-)?calc)\(/,f)}function i(c){for(var u=[],f=[],m=/[\.0-9]([%a-z]+)/gi,p=m.exec(c);p;)!p||!p[1]||(f.indexOf(p[1].toLowerCase())===-1&&(u.push(p[1]),f.push(p[1].toLowerCase())),p=m.exec(c));return u}return FC}var Lut=Out();const BC=uo(Lut);var UC,cF;function Fut(){if(cF)return UC;cF=1;var e=typeof td=="object"&&td&&td.Object===Object&&td;return UC=e,UC}var VC,uF;function S8(){if(uF)return VC;uF=1;var e=Fut(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return VC=n,VC}var HC,dF;function nle(){if(dF)return HC;dF=1;var e=S8(),t=e.Symbol;return HC=t,HC}var zC,fF;function But(){if(fF)return zC;fF=1;var e=nle(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var i=n.call(a,s),c=a[s];try{a[s]=void 0;var u=!0}catch{}var f=r.call(a);return u&&(i?a[s]=c:delete a[s]),f}return zC=o,zC}var WC,mF;function Uut(){if(mF)return WC;mF=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return WC=n,WC}var GC,pF;function Vut(){if(pF)return GC;pF=1;var e=nle(),t=But(),n=Uut(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(i){return i==null?i===void 0?s:r:o&&o in Object(i)?t(i):n(i)}return GC=a,GC}var $C,hF;function rle(){if(hF)return $C;hF=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return $C=e,$C}var qC,gF;function Hut(){if(gF)return qC;gF=1;var e=Vut(),t=rle(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(i){if(!t(i))return!1;var c=e(i);return c==r||c==s||c==n||c==o}return qC=a,qC}var KC,yF;function zut(){if(yF)return KC;yF=1;var e=S8(),t=e["__core-js_shared__"];return KC=t,KC}var YC,xF;function Wut(){if(xF)return YC;xF=1;var e=zut(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return YC=n,YC}var QC,vF;function Gut(){if(vF)return QC;vF=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return QC=n,QC}var XC,bF;function $ut(){if(bF)return XC;bF=1;var e=Hut(),t=Wut(),n=rle(),r=Gut(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,i=Object.prototype,c=a.toString,u=i.hasOwnProperty,f=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(p){if(!n(p)||t(p))return!1;var h=e(p)?f:o;return h.test(r(p))}return XC=m,XC}var ZC,_F;function qut(){if(_F)return ZC;_F=1;function e(t,n){return t?.[n]}return ZC=e,ZC}var JC,wF;function sle(){if(wF)return JC;wF=1;var e=$ut(),t=qut();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return JC=n,JC}var eS,CF;function Hb(){if(CF)return eS;CF=1;var e=sle(),t=e(Object,"create");return eS=t,eS}var tS,SF;function Kut(){if(SF)return tS;SF=1;var e=Hb();function t(){this.__data__=e?e(null):{},this.size=0}return tS=t,tS}var nS,EF;function Yut(){if(EF)return nS;EF=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return nS=e,nS}var rS,kF;function Qut(){if(kF)return rS;kF=1;var e=Hb(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var i=a[o];return i===t?void 0:i}return r.call(a,o)?a[o]:void 0}return rS=s,rS}var sS,MF;function Xut(){if(MF)return sS;MF=1;var e=Hb(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return sS=r,sS}var oS,TF;function Zut(){if(TF)return oS;TF=1;var e=Hb(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return oS=n,oS}var aS,AF;function Jut(){if(AF)return aS;AF=1;var e=Kut(),t=Yut(),n=Qut(),r=Xut(),s=Zut();function o(a){var i=-1,c=a==null?0:a.length;for(this.clear();++i-1}return fS=t,fS}var mS,OF;function odt(){if(OF)return mS;OF=1;var e=zb();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return mS=t,mS}var pS,LF;function adt(){if(LF)return pS;LF=1;var e=edt(),t=ndt(),n=rdt(),r=sdt(),s=odt();function o(a){var i=-1,c=a==null?0:a.length;for(this.clear();++i0){var I=C[0].width||1,M=s==="shrink-only"?Math.min(a/I,1):a/I,N=M,D=y-M*y,j=v-N*v;k.push("matrix("+M+", 0, 0, "+N+", "+D+", "+j+")")}return o&&k.push("rotate("+o+", "+y+", "+v+")"),k.length>0?k.join(" "):""},[b,y,v,a,s,C,o]);return{wordsByLines:C,startDy:E,transform:T}}var _dt=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function N5(){return N5=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?A.createElement("text",N5({ref:c,transform:b},m,{textAnchor:a}),x.map(function(_,w){return A.createElement("tspan",{key:w,x:h,dy:w===0?v:f},_.words.join(" "))})):null)}const Sdt=Object.freeze(Object.defineProperty({__proto__:null,Text:Gb,getStringWidth:A5,useText:ole},Symbol.toStringTag,{value:"Module"}));var eo={top:"top",left:"left",bottom:"bottom"};function Edt(e){var t=e.labelOffset,n=e.labelProps,r=e.orientation,s=e.range,o=e.tickLabelFontSize,a=e.tickLength,i=r===eo.left||r===eo.top?-1:1,c,u,f;if(r===eo.top||r===eo.bottom){var m=r===eo.bottom&&typeof n.fontSize=="number"?n.fontSize:0;c=(Number(s[0])+Number(s[s.length-1]))/2,u=i*(a+t+o+m)}else c=i*((Number(s[0])+Number(s[s.length-1]))/2),u=-(a+t),f="rotate("+i*90+")";return{x:c,y:u,transform:f}}function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(u[m]=i[m]);return u}function a(i){var c=i.from,u=c===void 0?{x:0,y:0}:c,f=i.to,m=f===void 0?{x:1,y:1}:f,p=i.fill,h=p===void 0?"transparent":p,g=i.className,y=i.innerRef,x=o(i,n),v=u.x===m.x||u.y===m.y;return e.default.createElement("line",s({ref:y,className:(0,t.default)("visx-line",g),x1:u.x,y1:u.y,x2:m.x,y2:m.y,fill:h,shapeRendering:v?"crispEdges":"auto"},x))}return k1}var Odt=ale();const ile=uo(Odt);function lle(e){return"bandwidth"in e?e.bandwidth():0}var Ldt=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function j5(){return j5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function bu(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.scale,a=e.width,i=e.stroke,c=i===void 0?"#eaf0f6":i,u=e.strokeWidth,f=u===void 0?1:u,m=e.strokeDasharray,p=e.className,h=e.children,g=e.numTicks,y=g===void 0?10:g,x=e.lineStyle,v=e.offset,b=e.tickValues,_=Fdt(e,Ldt),w=b??Ob(o,y),S=(v??0)+lle(o)/2,C=w.map(function(E,T){var k,I=((k=o0(o(E)))!=null?k:0)+S;return{index:T,from:new li({x:0,y:I}),to:new li({x:a,y:I})}});return A.createElement(Cs,{className:z("visx-rows",p),top:n,left:s},h?h({lines:C}):C.map(function(E){var T=E.from,k=E.to,I=E.index;return A.createElement(ile,j5({key:"row-line-"+I,from:T,to:k,stroke:c,strokeWidth:f,strokeDasharray:m,style:x},_))}))}bu.propTypes={tickValues:ze.array,width:ze.number.isRequired};var Bdt=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function I5(){return I5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function $b(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.scale,a=e.height,i=e.stroke,c=i===void 0?"#eaf0f6":i,u=e.strokeWidth,f=u===void 0?1:u,m=e.strokeDasharray,p=e.className,h=e.numTicks,g=h===void 0?10:h,y=e.lineStyle,x=e.offset,v=e.tickValues,b=e.children,_=Udt(e,Bdt),w=v??Ob(o,g),S=(x??0)+lle(o)/2,C=w.map(function(E,T){var k,I=((k=o0(o(E)))!=null?k:0)+S;return{index:T,from:new li({x:I,y:0}),to:new li({x:I,y:a})}});return A.createElement(Cs,{className:z("visx-columns",p),top:n,left:s},b?b({lines:C}):C.map(function(E){var T=E.from,k=E.to,I=E.index;return A.createElement(ile,I5({key:"column-line-"+I,from:T,to:k,stroke:c,strokeWidth:f,strokeDasharray:m,style:y},_))}))}$b.propTypes={tickValues:ze.array,height:ze.number.isRequired};const Gs=e=>e,Vdt=(e,t,n,r)=>`M${e},${t}h${n}v${r}h${-n}Z`,Hdt=(e,t,n)=>`M${e},${t}L${e},${n}`,zdt=(e,t,n)=>`M${e},${t}L${n},${t}`,cle=({xScale:e,yScale:t,history:n})=>{const r=d.useMemo(()=>{if(n.length<2)return 4;let a=1/0;for(let i=0;i{const a={blue:{wicks:[],bodies:[],dojis:[]},red:{wicks:[],bodies:[],dojis:[]},wickStrokeWidth:Gs(Math.max(.1,Math.min(r,1))),dojiStrokeWidth:Gs(Math.max(.5,Math.min(r*.3,1.5)))};return n.forEach(i=>{const c=Gs(e(wn(i))??0),u=Gs(t(i.high)??0),f=Gs(t(i.low)??0),m=Gs(t(i.open)??0),p=Gs(t(i.close)??0),h=i.close>=i.open?"blue":"red",g=a[h];g.wicks.push(Hdt(c,u,f));const y=Gs(Math.abs(p-m));y<1?g.dojis.push(zdt(Gs(c-r/2),p,Gs(c+r/2))):g.bodies.push(Vdt(Gs(c-r/2),Gs(Math.min(m,p)),Gs(r),y))}),a},[n,e,t,r]),o=(a,i)=>{const c=er[a];return l.jsxs(l.Fragment,{children:[i.wicks.length&&l.jsx("path",{d:i.wicks.join(""),stroke:c,strokeWidth:s.wickStrokeWidth,opacity:.5,fill:"none"}),i.bodies.length&&l.jsx("path",{d:i.bodies.join(""),fill:c}),i.dojis.length&&l.jsx("path",{d:i.dojis.join(""),stroke:c,strokeWidth:s.dojiStrokeWidth,fill:"none"})]})};return l.jsxs("svg",{children:[o("blue",s.blue),o("red",s.red)]})};cle.displayName="CandlestickLine";const a0=200,Wdt={top:24,right:8,bottom:24,left:16},Gdt="#1FB8CD",$dt="#B4413C",qdt=[Gdt,"#FFC185",$dt,"#ECEBD5","#5D878F","#DB4545","#D2BA4C","#964325"],Kdt="#20808D",Ydt="#A84B2F",Qdt=[Kdt,Ydt,"#1B474D","#BCE2E7","#944454","#FFC553","#848456","#6E522B"],Xdt={tickColor:"#2F3031",axisColor:"#2F3031",textColor:"#aaaaaa",colorSchema:qdt},Zdt={tickColor:"#D9D9D0",axisColor:"#D9D9D0",textColor:"#A0A0A0",colorSchema:Qdt},Jdt={time:e=>new Date(e),linear:e=>+e,band:e=>e,ordinal:e=>e,log:e=>+e,point:e=>e};function MS(e,t){if(!e)return r=>null;if(t===void 0)return r=>r[e];const n=Jdt[t]||(r=>r);return r=>n(r[e])}function Wu(e,t){return typeof t=="function"?t(e):typeof t=="string"?t.replace("%s",e):e instanceof Date?Vqe(e):String(e)}const ao={time:lm,linear:Bi,band:v8,log:b8,point:s0,ordinal:w8},ZF=["band","ordinal","point"];function eft({width:e,height:t,margin:n,hasAxis:r,maxYLabelWidth:s=0}){const o=n.left+(r?s+15:0),a=e-n.right-n.left,i=t-n.bottom,c=n.top,u=[o,a],f=[i,c],m=Math.max(0,a-o);return{innerHeight:Math.max(0,i-c),innerWidth:m,xRange:u,yRange:f}}function qb(e){const{colorScheme:t}=Ss(),n=mi(),r=d.useMemo(()=>n?t==="dark":!1,[t,n]);return d.useMemo(()=>({...r?Xdt:Zdt,...e}),[r,e])}function Kb(e){return d.useMemo(()=>e.data.map(n=>({__key:Math.random(),...n})),[e.data])}function Yb({config:e}){const t=d.useMemo(()=>MS(e.x.accessor,e.x.scale),[e.x]),n=d.useMemo(()=>MS(e.y.accessor,e.y.scale),[e.y]),r=d.useMemo(()=>MS(e.z?.accessor,e.z?.scale),[e.z]);return d.useMemo(()=>({xGet:t,yGet:n,zGet:r}),[t,n,r])}function Qb({config:e}){const t=d.useCallback(i=>Wu(i,e.x.format),[e.x]),n=d.useCallback(i=>Wu(i,e.y.format),[e.y]),r=d.useCallback(i=>Wu(i,e.z?.format),[e.z]),s=d.useCallback(i=>Wu(i,e.x.tooltipFormat??e.x.format),[e.x]),o=d.useCallback(i=>Wu(i,e.y.tooltipFormat??e.y.format),[e.y]),a=d.useCallback(i=>Wu(i,e.z?.tooltipFormat??e.z?.format),[e.z]);return d.useMemo(()=>({xFormat:t,yFormat:n,zFormat:r,xTooltipFormat:s,yTooltipFormat:o,zTooltipFormat:a}),[t,n,r,s,o,a])}function Xb({width:e,height:t,margin:n,maxYLabelWidth:r,hasAxis:s}){return d.useMemo(()=>eft({width:e,height:t,margin:n,maxYLabelWidth:r,hasAxis:s}),[e,t,n,r,s])}function E8({config:e,xGet:t,yGet:n,data:r,endTime:s,previousClose:o}){const a=d.useMemo(()=>{if(ZF.includes(e.x.scale))return[...new Set(r.map(t))];const u=ko(r,t);return e.x.tickValues?ko([...e.x.tickValues,...u]):u},[e.x.tickValues,e.x.scale,r,t]),i=d.useMemo(()=>{if(ZF.includes(e.y.scale))return[...new Set(r.map(n))];const f=[...ko(r,n)];o!==void 0&&f.push(o),e.y.tickValues&&f.push(...e.y.tickValues);const[m,p]=ko(f),g=(p-m)*.05;return[m-g,p+g]},[e.y.tickValues,e.y.scale,r,n,o]),c=d.useMemo(()=>{if(!s||!a||a.length<2||e.x.scale!=="time")return a;const[u,f]=a;return new Date(f).toDateString()!==s.toDateString()?a:Date.now()({xDomain:c,yDomain:i}),[c,i])}function ule(e){const[t,n]=d.useState({width:0,height:0,resizing:!1});return d.useEffect(()=>{let r;const s=()=>{e.current&&(clearTimeout(r),n(o=>{const a=e.current?.offsetWidth??0,i=e.current?.offsetHeight??0,c=Math.round(o.width)!==Math.round(a);return{width:a,height:i,resizing:c}}),r=setTimeout(()=>{n(o=>({...o,resizing:!1}))},500))};return s(),window.addEventListener("resize",s),()=>{clearTimeout(r),window.removeEventListener("resize",s)}},[e]),t}const xs=30,Rd=28,k8=({height:e=a0,render:t,children:n})=>{const r=d.useRef(null),{width:s}=ule(r);return l.jsx("div",{style:{width:"100%",height:e},ref:r,className:"relative",children:l.jsx(St,{children:t&&l.jsx(Te.div,{className:"absolute",children:n(s,e)})})})},tft=({children:e,style:t})=>l.jsx(K,{className:"p-sm pb-md flex h-full",children:l.jsx(K,{className:"flex size-full items-center justify-center",variant:"raised",style:t,children:l.jsx(V,{variant:"small",color:"light",children:e})})}),dle=()=>l.jsx(tft,{style:{height:a0,marginBottom:xs},children:l.jsx(je,{id:"iuY8kxCDQT",defaultMessage:"Something went wrong."})});function nft(e){return!!e&&e instanceof Element}function rft(e){return!!e&&(e instanceof SVGElement||"ownerSVGElement"in e)}function sft(e){return!!e&&"createSVGPoint"in e}function oft(e){return!!e&&"getScreenCTM"in e}function aft(e){return!!e&&"changedTouches"in e}function ift(e){return!!e&&"clientX"in e}function lft(e){return!!e&&(e instanceof Event||"nativeEvent"in e&&e.nativeEvent instanceof Event)}function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:Hp({},TS);if(ift(e))return{x:e.clientX,y:e.clientY};var t=e?.target,n=t&&"getBoundingClientRect"in t?t.getBoundingClientRect():null;return n?{x:n.x+n.width/2,y:n.y+n.height/2}:Hp({},TS)}function JF(e,t){if(!e||!t)return null;var n=cft(t),r=rft(e)?e.ownerSVGElement:e,s=oft(r)?r.getScreenCTM():null;if(sft(r)&&s){var o=r.createSVGPoint();return o.x=n.x,o.y=n.y,o=o.matrixTransform(s.inverse()),new li({x:o.x,y:o.y})}var a=e.getBoundingClientRect();return new li({x:n.x-a.left-e.clientLeft,y:n.y-a.top-e.clientTop})}function i0(e,t){if(nft(e)&&t)return JF(e,t);if(lft(e)){var n=e,r=n.target;if(r)return JF(r,n)}return null}var uft=["tooltipOpen"];function dft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function ex(){return ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&E>T}else{var k=S+o+u.width-window.innerWidth,I=u.width-S-o;_=k>0&&k>I}if(c.height){var M=C+i+u.height-c.height,N=u.height-C-i;w=M>0&&M>N}else w=C+i+u.height>window.innerHeight;S=_?S-u.width-o:S+o,C=w?C-u.height-i:C+i,S=Math.round(S),C=Math.round(C),b="translate("+S+"px, "+C+"px)"}return A.createElement(M8,nx({ref:x,style:nx({left:0,top:0,transform:b},!y&&m)},v),A.createElement(gft,{value:{isFlippedVertically:!w,isFlippedHorizontally:!_}},t))}ple.propTypes={nodeRef:ze.oneOfType([ze.string,ze.func,ze.object])};const hle=hft(ple),vft="shadow-subtle transition-colors duration-500",Jb=d.memo(({marginTop:e,tooltipLeft:t=0,innerHeight:n,color:r,strokeWidth:s=1})=>{const o=d.useMemo(()=>({x:t,y:e}),[e,t]),a=d.useMemo(()=>({x:t,y:n+e}),[n,e,t]);return isNaN(o.x+a.x+o.y+a.y)?null:l.jsx("line",{x1:o.x,y1:o.y,x2:a.x,y2:a.y,stroke:r,strokeWidth:s,pointerEvents:"none",className:vft})});Jb.displayName="YCrosshair";const bft={pointerEvents:"none",position:"absolute",overflow:"visible",zIndex:3},e_=({children:e,y:t,x:n,pill:r})=>l.jsx(hle,{left:n,top:t,style:bft,children:l.jsx("div",{className:z("shadow-subtle relative border bg-white/75 backdrop-blur-sm dark:bg-subtle overflow-hidden",{"rounded-full":r,"rounded-lg":!r}),children:e})}),_ft=({exchangeHoursAnnotations:e,data:t,xScale:n,xBounds:r,hidden:s,tzOffsetMins:o})=>{const{$t:a}=J(),{tooltipData:i,hideTooltip:c,showTooltip:u}=Zb(),f=d.useRef(null),m=d.useRef(s),p=d.useCallback((y,x)=>{const{d:v,x:b}=s8(y.local.x,n,t);if(!v)return;const _=n8(e,new Date(v.date),o),w=_?.type&&CL[_.type]?a(CL[_.type]):void 0,S=Math.min(Math.max(r[0],b),r[1]);u({tooltipData:{data:v,point:{touch:x,local:{x:S,y:y.local.y},global:y.global},annotation:w}})},[t,n,u,e,a,r,o]);m.current&&!s&&f.current&&p(f.current,!1),m.current=s;const h=d.useCallback(y=>{const x="touches"in y;y.stopPropagation();const v=i0(y),b=XN(y);if(!v)return;const _={local:v,global:b};f.current=_,p(_,x)},[p]),g=d.useCallback(()=>{f.current=null,c()},[c]);return d.useMemo(()=>({tooltipData:s?void 0:i,hideTooltip:g,showTooltip:h}),[i,g,h,s])},gle=({currency:e,absoluteChange:t,relativeChange:n})=>{const{locale:r}=J(),s=d.useMemo(()=>t===void 0?null:Rc(t,e,r),[t,e,r]),o=d.useMemo(()=>n===void 0?null:n.toLocaleString(r,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2,signDisplay:"exceptZero"}),[n,r]),a=d.useMemo(()=>t?t>0?"positive":"negative":"light",[t]);return!t&&!n?null:l.jsx(K,{className:"relative border-t",children:l.jsx(V,{variant:"tinyRegular",color:a,className:"px-sm py-xs whitespace-nowrap",children:l.jsx(je,{id:"TqEJGQaMg0",defaultMessage:"{absoluteChange} ({relativeChange})",values:{absoluteChange:s,relativeChange:o}})})})},wft=({x:e,y:t,close:n,date:r,annotation:s,absoluteChange:o,relativeChange:a,currency:i,exchangeTimezone:c})=>{const{locale:u}=J();return l.jsxs(e_,{y:t,x:e,children:[l.jsxs(K,{className:"py-sm relative px-[12px]",children:[l.jsx(V,{variant:"baseSemi",children:Rc(n,i,u)}),l.jsx(V,{variant:"tinyRegular",className:"whitespace-nowrap",color:"light",children:r8(r,u,c)}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"whitespace-nowrap",children:s})]}),l.jsx(gle,{currency:i,absoluteChange:o,relativeChange:a})]})},zm=({label:e,children:t})=>l.jsxs(K,{className:"gap-md flex justify-between",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:e}),l.jsx(V,{variant:"tinyRegular",className:"whitespace-nowrap",children:t})]}),Cft=({currency:e,locale:t,exchangeTimezone:n,x:r,y:s,data:o,annotation:a,absoluteChange:i,relativeChange:c})=>{const{$t:u}=J();return l.jsx(Xl,{children:l.jsxs(e_,{y:s,x:r,children:[l.jsx(K,{children:l.jsxs(K,{className:"px-sm py-xs",variant:"subtle",children:[l.jsx(V,{variant:"tiny",className:"whitespace-nowrap",children:r8(o.date,t,n)}),a&&l.jsx(V,{variant:"micro",color:"light",className:"whitespace-nowrap",children:a})]})}),l.jsxs(K,{className:"px-sm py-xs space-y-xs border-t",children:[l.jsx(zm,{label:u({defaultMessage:"Close",id:"rbrahOGMC3"}),children:Rc(o.close,e,t)}),l.jsx(zm,{label:u({defaultMessage:"Open",id:"JfG49wNHKP"}),children:Rc(o.open,e,t)}),l.jsx(zm,{label:u({defaultMessage:"High",id:"AxMhQrcUDC"}),children:Rc(o.high,e,t)}),l.jsx(zm,{label:u({defaultMessage:"Low",id:"477I0ggSYe"}),children:Rc(o.low,e,t)}),l.jsx(zm,{label:u({defaultMessage:"Volume",id:"y867VsgbzT"}),children:o.volume.toLocaleString(t,{style:"decimal",currency:e??void 0,minimumFractionDigits:0,maximumFractionDigits:0})})]}),l.jsx(gle,{currency:e,absoluteChange:i,relativeChange:c})]})})},Sft=e=>e&&e<0?er.red:e&&e>0?er.blue:er.gray,tB=5,Eft=.002,nB=1,kft=20,Mft=150,M1={k:1,x:0},Tft=(e,t)=>(t-e.x)/e.k,yle=(e,t)=>{const r=t.range().map(s=>Tft(e,s)).map(s=>t.invert(s));return t.copy().domain(r)},xle=(e,t)=>{const r=t.range().map(s=>e.k*s+e.x);return t.copy().range(r)},vle=({enabled:e,width:t,id:n})=>{const[r,s]=d.useState(M1),o=d.useRef(t);o.current=t;const[a,i]=d.useState(!1),c=d.useRef(null),u=d.useRef(null);d.useEffect(()=>{if(!e)return;const m=u.current;if(!m)return;const p=h=>{h.preventDefault(),h.stopPropagation();const g=i0(m,h);if(!g)return;i(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{i(!1)},Mft);const y=Math.exp(-h.deltaY*Eft);s(x=>{const v=Math.max(nB,Math.min(kft,x.k*y));if(v<=nB)return M1;const b=g.x-(g.x-x.x)*(v/x.k),_=o.current*(1-v),w=Math.max(_,Math.min(0,b));return{k:v,x:w}})};return m.addEventListener("wheel",p,{passive:!1}),()=>{m.removeEventListener("wheel",p)}},[e]);const f=d.useCallback(()=>{s(M1)},[]);return d.useEffect(()=>{s(M1)},[n]),{transform:r,isActivelyZooming:a,containerRef:u,resetZoom:f}},Aft=({data:e,xScale:t,xGet:n,width:r})=>{const s=e.filter(c=>{const u=t(n(c));return u!==void 0&&u>=0&&u<=r});if(s.length<2)return{visibleData:s,visibleDays:qae(e)};const o=n(s[0]),i=(n(s[s.length-1]).getTime()-o.getTime())/(1e3*60*60*24);return{visibleData:s,visibleDays:i}},Nft=e=>{const t=e*.05;return Math.max(10,Math.min(t,100))},l0=(e,t,n)=>{const r=Nft(n),s=t(e);return s!==void 0&&s>=r&&s<=n-r},Rft=e=>{const t=e.match(/(\d{4})-(\d{2})-(\d{2})/);return t?t[0]:void 0},Dft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getHours(),u=i.getMinutes(),m=[0,30].find(g=>u>=g-5&&u<=g+5);if(m===void 0)return;const h=`${`${i.getFullYear()}-${i.getMonth()}-${i.getDate()}`}-${c}-${m}`;if(!o.has(h)){const g=new Date(i);g.setMinutes(m,0,0),s.push({date:g,label:!0,line:l0(g,r,n)}),o.add(h)}}),s},jft=({history:e,xGet:t,xGetUnparsed:n,width:r,xScale:s})=>{const o=[],a=new Set;return e.forEach(i=>{const c=t(i),u=Rft(n(i));u&&!a.has(u)&&(o.push({date:c,label:!0,line:l0(c,s,r)}),a.add(u))}),o};function Ift(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay(),n=t===0?6:t-1;return Math.ceil((e.getDate()+n)/7)}const Pft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getMonth(),u=Ift(i),f=`${c}-${u}`;o.has(f)||(s.push({date:i,label:!0,line:l0(i,r,n)}),o.add(f))}),s.filter((a,i,c)=>i?a.date.getTime()-c[i-1].date.getTime()>1e3*60*60*24*6:!0)},Oft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getMonth(),f=`${i.getFullYear()}-${c}`;o.has(f)||(s.push({date:i,label:!0,line:l0(i,r,n)}),o.add(f))}),s},Lft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getFullYear();o.has(c)||(s.push({date:i,label:!0,line:l0(i,r,n)}),o.add(c))}),s},Fft=e=>e<=1?Dft:e<=7?jft:e<=45?Pft:e<=365?Oft:Lft,Bft=({ticks:e,maxTicks:t,xScale:n,width:r})=>{if(e.length<=t)return e;const s=r/(t*2),o=[];let a;for(const i of e){const c=n(i.date);c!==void 0&&(a===void 0||c-a>=s)&&(o.push(i),a=c)}return o},T8=(e,t)=>e.date.toLocaleDateString(e.locale,{timeZone:e.timezone??void 0,...t}),Uft=e=>{const t=e.date.getMinutes()!==0;return e.date.toLocaleTimeString(e.locale,{timeZone:e.timezone??void 0,hour:"numeric",minute:t?"numeric":void 0})},Vft=e=>Uft(e),Hft=e=>T8(e,{month:"short",day:"numeric"}),zft=e=>T8(e,{month:"short"}),Wft=e=>T8(e,{year:"numeric"}),Gft=({days:e})=>e<=1?Vft:e<=62?Hft:e<=365?zft:Wft,ble=({history:e,xGet:t,xGetUnparsed:n,timezone:r,locale:s,width:o,xScale:a})=>{const{visibleDays:i}=d.useMemo(()=>Aft({data:e,xScale:a,xGet:t,width:o}),[e,a,t,o]),c=d.useMemo(()=>Gft({days:i}),[i]),u=d.useMemo(()=>o8(e),[e]),f=d.useMemo(()=>{if(u)return;const x=Fft(i)({history:e,xGet:t,xGetUnparsed:n,locale:s,xScale:a,width:o});if(x)return Bft({ticks:x,maxTicks:tB,xScale:a,width:o})},[e,t,n,s,a,o,i,u]),m=d.useMemo(()=>{const y=f?.filter(v=>v.label).map(v=>v.date);if(!y?.length)return;const x=Gae({ticks:y,xScale:a,width:o,formatter:v=>c({date:v,locale:s,timezone:r}),marginLeft:25,marginRight:70});return x.length?x:void 0},[f,a,o,c,s,r]),p=d.useMemo(()=>{const y=f?.filter(x=>x.line).map(x=>x.date);return y?.length?y:void 0},[f]),h=d.useCallback(y=>c({date:y,locale:s,timezone:r}),[c,s,r]);return{xTickLabels:m,xTickFormatter:h,xTickLines:p,xTickCount:m?void 0:tB}},$ft={US:"US"},qft=Ft("FinanceIndexContext",{country:$ft.US,setCountry:()=>{},enabled:!1}),Kft=()=>{const e=d.useContext(qft);if(!e)throw new Error("useFinanceCountry must be used within a FinanceCountryProvider");return e},Yft=e=>e===0?"":e>0?"+":"-",Qft=e=>e===0?"light":e>0?"positive":"negative",t_=A.memo(({change:e,variant:t="small",includeIcon:n=!1,className:r,background:s=!0,mono:o=!0,hover:a=!1,format:i,suffix:c,animated:u})=>{const f=d.useMemo(()=>i||{style:"percent",minimumFractionDigits:2},[i]);return l.jsxs(V,{as:"span",variant:t,color:Qft(e),className:z("transition-background-color flex shrink-0 grow-0 items-center justify-center gap-[0.1em] rounded text-center font-mono duration-200 ease-in-out",{"bg-positive/10":e>0&&s,"bg-negative/10":e<0&&s,"bg-subtle":e===0&&s,"px-[0.6em] py-[0.15em]":s,"!pl-[0.3em]":s&&n,"!py-0 !pb-px":t==="micro","hover:bg-positive/20 hover:text-positive":a&&e>0&&s,"hover:bg-negative/20 hover:text-negative":a&&e<0&&s,"hover:bg-subtle":a&&e===0&&s},r),children:[l.jsx("span",{className:z("inline-flex",{"-mt-px":o}),children:n?l.jsx(ge,{icon:B("arrow-right"),className:z("inline-flex size-[1.2em] transition-transform duration-500 ease-in-out",{"!mt-px":o,"rotate-45":e<0,"-rotate-45":e>0})}):l.jsx("span",{className:o?"font-mono":"",children:Yft(e)})}),l.jsx("span",{className:z("whitespace-nowrap",{"font-mono":o}),children:l.jsx(Nb,{value:Math.abs(e)/100,format:f,suffix:c,animated:u})})]})});t_.displayName="FinancePriceChange";const Xft="recent-tickers:2",Zft=5,Jft=e=>{if(typeof window>"u")return[];try{const t=vt.getItem(e);return t?JSON.parse(t):[]}catch{return[]}},rB=(e,t)=>{if(!(typeof window>"u"))try{vt.setItem(e,JSON.stringify(t))}catch{}},emt=({storageKey:e,maxItems:t,getUniqueId:n})=>{const[r,s]=d.useState([]);d.useEffect(()=>{s(Jft(e))},[e]);const o=d.useCallback(i=>{s(c=>{const u=n(i),f=c.filter(p=>n(p)!==u),m=[i,...f].slice(0,t);return rB(e,m),m})},[e,t,n]),a=d.useCallback(()=>{s([]),rB(e,[])},[e]);return d.useMemo(()=>({recentItems:r,addRecentItem:o,clearRecentItems:a}),[r,o,a])},A8=()=>{const{recentItems:e,addRecentItem:t,clearRecentItems:n}=emt({storageKey:Xft,maxItems:Zft,getUniqueId:r=>r.symbol});return{recentTickers:e,addRecentTicker:t,clearRecentTickers:n}},N8=({isOpen:e,onClose:t,refs:n})=>{d.useEffect(()=>{if(!e)return;const r=o=>{n.some(i=>i.current?.contains(o.target))||t()},s=o=>{o.key==="Escape"&&t()};return document.addEventListener("mousedown",r,!0),document.addEventListener("keydown",s,!0),()=>{document.removeEventListener("mousedown",r,!0),document.removeEventListener("keydown",s,!0)}},[e,t,n])},tmt=({value:e,isFocused:t,defaultSuggestions:n=[],reason:r})=>{const{country:s}=Kft(),o=Yt(),{data:a,isLoading:i}=mt({queryKey:BP(e,s),queryFn:()=>UP({query:e,reason:r,country:s}),staleTime:0,enabled:t}),c=d.useMemo(()=>n?.length&&e===""?"suggestions":a?.length&&e===""?"trending":"search",[n,e,a?.length]),{$t:u}=J(),f=d.useMemo(()=>{if(c==="suggestions")return u({defaultMessage:"Suggested",id:"a0lFbMbzyl"});if(c==="trending")return u({defaultMessage:"Trending",id:"ll/ufR0/ED"})},[c,u]),m=d.useMemo(()=>{if(c==="suggestions")return n;const p=a?.filter(h=>h.category==="ticker");return p?p.map(h=>({symbol:h.query??"",name:h.description??"",image:h.image??"",darkImage:h.image_dark??"",url:h.url??"",exchange:h.metadata?.price_info?.exchange??"",country:h.metadata?.price_info?.exchangeCountry??"",currency:h.metadata?.price_info?.currency??"",change:h.metadata?.price_info?.change??void 0,currentPrice:h.metadata?.price_info?.currentPrice??void 0,changesPercentage:h.metadata?.price_info?.changePercentage??void 0})):[]},[a,n,c]);return d.useEffect(()=>{o.prefetchQuery({queryKey:BP("",s),queryFn:()=>UP({query:"",reason:r,country:s}),staleTime:0})},[o,s,r]),{suggestions:m?.length?m:[],isLoadingSuggestions:i,mode:c,title:f}},nmt=({focusedIndex:e,setFocusedIndex:t,onSelect:n})=>d.useCallback((s,o)=>{s.key==="ArrowDown"?(s.preventDefault(),t(e===null?0:Math.min(e+1,o.length-1))):s.key==="ArrowUp"?(s.preventDefault(),t(e===null?0:Math.max(e-1,0))):s.key==="Enter"&&e!==null&&(s.preventDefault(),n(o[e]))},[e,t,n]),_le=({onClick:e,defaultSuggestions:t=[],reason:n="finance-navigational-searchbar",onAssetSelect:r}={})=>{const[s,o]=d.useState(!1),[a,i]=d.useState(""),[c,u]=d.useState(null),{inApp:f}=Sa(),m=Rn();d.useEffect(()=>u(null),[a]);const{suggestions:p,isLoadingSuggestions:h,mode:g,title:y}=tmt({value:a,isFocused:s,defaultSuggestions:t,reason:n}),x=d.useCallback(S=>{const C=Ab({href:S?.url,inApp:f,queryParams:null});C&&m.push(C)},[m,f]),v=e??x,b=d.useCallback(()=>{o(!1),u(null)},[]),_=d.useCallback(S=>{v(S),b(),i(""),S&&r?.(S)},[v,b,r]),w=nmt({focusedIndex:c,setFocusedIndex:u,onSelect:_});return{isFocused:s,value:a,focusedIndex:c,isLoadingSuggestions:h,suggestions:p,mode:g,title:y,setIsFocused:o,setValue:i,setFocusedIndex:u,handleKeyDown:w,openAsset:_,closeSearch:b}},rmt=d.memo(()=>{const{recentTickers:e,addRecentTicker:t,clearRecentTickers:n}=A8(),r=_le({onAssetSelect:t}),{$t:s}=J(),o=d.useRef(null),{isMobileStyle:a}=Re(),i=d.useMemo(()=>e.length&&r.value===""?e:[],[e,r.value]),c=d.useCallback(f=>{r.handleKeyDown(f,[...i,...r.suggestions])},[r,i]),u=d.useRef(null);return N8({isOpen:r.isFocused,onClose:()=>r.setIsFocused(!1),refs:[u]}),l.jsxs("div",{ref:u,className:"pt-one relative md:w-full md:max-w-[360px]",children:[l.jsx(co,{type:"search",placeholder:s(a?{defaultMessage:"Search tickers...",id:"na0wZ6TycW"}:{defaultMessage:"Search for stocks, crypto, and more...",id:"sX/a414S1y"}),isMobileUserAgent:!1,onFocus:()=>r.setIsFocused(!0),onChange:r.setValue,onKeyDown:c,className:"bg-subtler !focus:ring-super/50 dark:focus:!ring-super/50 h-9 w-full !border-none !py-0",ref:o}),r.isFocused&&l.jsx("div",{className:z("z-50",{"fixed inset-x-0 top-[var(--header-height)]":a,"absolute left-1/2 top-full mt-2 min-w-[500px] -translate-x-1/2":!a}),children:l.jsx(Sle,{title:r.title,isLoadingSuggestions:r.isLoadingSuggestions,recentTickers:i,suggestions:r.suggestions,value:r.value,focusedIndex:r.focusedIndex,setIsFocused:r.setIsFocused,setValue:r.setValue,openAsset:r.openAsset,trailing:l.jsx(Cle,{onClick:n})})})]})});rmt.displayName="FinanceNavigationalSearchbarHeader";const wle=d.memo(({defaultSuggestions:e=[],onClick:t})=>{const{addRecentTicker:n}=A8(),r=_le({onClick:t,defaultSuggestions:e,onAssetSelect:n}),s=d.useRef(null);d.useEffect(()=>{s.current&&s.current.focus()},[]);const o=d.useCallback(i=>{(i.key==="ArrowDown"||i.key==="ArrowUp"||i.key==="Enter")&&r.handleKeyDown(i,r.suggestions)},[r]),{$t:a}=J();return l.jsxs(l.Fragment,{children:[l.jsx(K,{className:"p-sm w-full",children:l.jsx(co,{type:"search",placeholder:a({defaultMessage:"Search tickers...",id:"na0wZ6TycW"}),isMobileUserAgent:!1,onFocus:()=>r.setIsFocused(!0),onChange:r.setValue,onKeyDown:o,ref:s})}),l.jsx(K,{className:"w-full",children:r.isLoadingSuggestions?l.jsx("div",{className:"p-md flex items-center justify-center opacity-50",children:l.jsx(Gl,{size:14})}):r.suggestions.length===0?l.jsx(V,{variant:"small",color:"light",className:"p-md text-center",children:a({defaultMessage:"No results",id:"jHJmjfxD4s"})}):r.suggestions.map((i,c)=>l.jsx(R8,{ticker:i,openAsset:r.openAsset,isFocused:r.focusedIndex===c,setIsFocused:r.setIsFocused,setValue:r.setValue},i.symbol+"suggestion"))})]})});wle.displayName="FinanceNavigationalSearchbarInline";const Cle=d.memo(({onClick:e})=>{const{$t:t}=J(),n=d.useCallback(r=>{r.stopPropagation(),e()},[e]);return l.jsx("div",{className:"flex h-0 items-center",children:l.jsx(st,{icon:B("x"),size:"tiny",pill:!0,onClick:n,extraCSS:"-mr-sm opacity-50 hover:opacity-100",toolTip:t({defaultMessage:"Clear recents",id:"4k9F3xn5kg"})})})});Cle.displayName="ClearRecentButton";const Sle=d.memo(({title:e,isLoadingSuggestions:t,recentTickers:n,suggestions:r,value:s,focusedIndex:o,setIsFocused:a,setValue:i,openAsset:c,trailing:u})=>{const{$t:f}=J(),{inApp:m}=Sa(),p=r&&r.length>0,h=r?.length===0&&s!=="",g=n.length>0&&s==="";return!(p||g)&&!t?null:l.jsx(K,{variant:"raised",className:z("relative flex flex-col overflow-hidden rounded-b-xl shadow-md md:rounded-xl md:border md:shadow-xl",{"-mt-one":m}),children:t?l.jsx("div",{className:"p-md flex items-center justify-center opacity-50",children:l.jsx(Gl,{size:14})}):h?l.jsx(V,{variant:"small",color:"light",className:"p-md text-center",children:f({defaultMessage:"No results",id:"jHJmjfxD4s"})}):l.jsxs(l.Fragment,{children:[g&&l.jsxs(l.Fragment,{children:[l.jsx(L5,{title:f({defaultMessage:"Recent",id:"iXpep1vGVo"}),trailing:u}),l.jsx("div",{className:"gap-xs p-sm flex flex-wrap",children:n.map((x,v)=>l.jsx(Ele,{ticker:x,openAsset:c,isFocused:o===v,setIsFocused:a,setValue:i},`${x.symbol}-recent`))})]}),e?l.jsx(L5,{title:e}):l.jsx(K,{className:"border-b"}),r.map((x,v)=>l.jsx(R8,{ticker:x,openAsset:c,isFocused:o===v+n.length,setIsFocused:a,setValue:i},x.symbol+"suggestion"))]})})});Sle.displayName="NavigationalMenuContent";const L5=d.memo(({title:e,trailing:t})=>l.jsxs("div",{className:"bg-subtler gap-sm px-md py-sm flex items-center justify-between",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:e}),t]}));L5.displayName="Header";const Ele=d.memo(({ticker:e,isFocused:t,openAsset:n})=>l.jsxs(K,{className:"pl-xs pr-sm group relative inline-flex cursor-pointer overflow-hidden rounded-full border py-0.5",as:"button",onClick:()=>n(e),children:[l.jsx(K,{className:z("absolute inset-0 rounded-full opacity-0 group-hover:opacity-100",t&&"opacity-100"),variant:"subtler"}),l.jsxs("div",{className:"gap-xs relative flex max-w-[200px] items-center",children:[l.jsx(Z6,{watchlistType:"FINANCE",image:e.image,imageDark:e.darkImage,alt:e.name,imageClassName:"!size-4 overflow-hidden rounded"}),l.jsx(V,{variant:"tiny",className:"truncate",children:e.name}),l.jsx(V,{variant:"tinyMono",color:"light",className:"shrink-0",children:e.symbol})]})]}));Ele.displayName="NavigationalSearchbarRecentItem";const R8=d.memo(({ticker:e,isFocused:t,openAsset:n})=>{const{addRecentTicker:r}=A8(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(()=>{r(e),n(e),o("finance link clicked",{referrer:Rb.SEARCH_AUTOSUGGEST,targetPageType:Jg.ASSET_PAGE,symbol:e.symbol,destinationUrl:e.url})},[r,e,n,o]);return l.jsxs(K,{className:"gap-sm px-md py-sm group relative flex w-full cursor-pointer appearance-none items-center justify-between border-b text-left last:border-b-0",onClick:a,as:"button",children:[l.jsx(K,{className:z("absolute inset-0 opacity-0 group-hover:opacity-100",t&&"opacity-100"),variant:"subtler"}),l.jsxs("div",{className:"gap-md relative flex w-full items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex min-w-0 items-center",children:[l.jsx(Z6,{watchlistType:"FINANCE",image:e.image,imageDark:e.darkImage,alt:e.name,className:"shrink-0 overflow-hidden rounded"}),l.jsxs("div",{className:"min-w-0 max-w-[200px]",children:[l.jsx(V,{variant:"smallBold",className:"truncate",children:e.name}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e.symbol,exchange:e.exchange,country:e.country})})]})]}),l.jsxs("div",{className:"gap-sm flex items-center",children:[e.currentPrice&&e.currency?l.jsx(V,{variant:"tinyMono",color:"light",children:e.currentPrice.toLocaleString("en-US",{style:"currency",currency:e.currency})}):null,e.changesPercentage?l.jsx(t_,{change:e.changesPercentage,variant:"tinyMono",includeIcon:!0}):null,l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet -mr-xs"})]})]})]})});R8.displayName="NavigationalSearchbarItem";function sB(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 smt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,i;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,i=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw i}}}}function imt(e,t){var n=[],r=[];function s(o,a){if(o.length===1)n.push(o[0]),r.push(o[0]);else{for(var i=Array(o.length-1),c=0;c=3&&(t.x1=e[1][0],t.y1=e[1][1]),t.x=e[e.length-1][0],t.y=e[e.length-1][1],e.length===4?t.type="C":e.length===3?t.type="Q":t.type="L",t}function cmt(e,t){t=t||2;for(var n=[],r=e,s=1/t,o=0;o0?m-=1:m0&&(m-=1))}return c[m]=(c[m]||0)+1,c},[]),i=a.reduce(function(c,u,f){if(f===e.length-1){var m=F5(u,rx({},e[e.length-1]));return m[0].type==="M"&&m.forEach(function(p){p.type="L"}),c.concat(m)}return c.concat(pmt(e[f],e[f+1],u))},[]);return i.unshift(e[0]),i}function iB(e){for(var t=(e||"").match(dmt)||[],n=[],r,s,o=0;o0&&r[r.length-1].type==="Z"&&r.pop(),s.length>0&&s[s.length-1].type==="Z"&&s.pop(),r.length?s.length||s.push(r[0]):r.push(s[0]);var u=Math.abs(s.length-r.length);u!==0&&(s.length>r.length?r=aB(r,s,a):s.length{const r=d.useRef(e),s=d.useRef(e),[o,a]=dIe(()=>({t:1,config:{duration:n},easing:Qd}));return s.current!==e&&(r.current=s.current,s.current=e,a.start({from:{t:0},to:{t:1},immediate:!t,config:{duration:n}})),o.t.to(i=>gmt(r.current,s.current)(i))};var Mle="Toggle",Tle=d.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:s,...o}=e,[a,i]=fo({prop:n,onChange:s,defaultProp:r??!1,caller:Mle});return l.jsx(Et.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:rt(e.onClick,()=>{e.disabled||i(!a)})})});Tle.displayName=Mle;var ic="ToggleGroup",[Ale]=Vs(ic,[Jl]),Nle=Jl(),D8=A.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const s=r;return l.jsx(ymt,{...s,ref:t})}if(n==="multiple"){const s=r;return l.jsx(xmt,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${ic}\``)});D8.displayName=ic;var[Rle,Dle]=Ale(ic),ymt=A.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[a,i]=fo({prop:n,defaultProp:r??"",onChange:s,caller:ic});return l.jsx(Rle,{scope:e.__scopeToggleGroup,type:"single",value:A.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:A.useCallback(()=>i(""),[i]),children:l.jsx(jle,{...o,ref:t})})}),xmt=A.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[a,i]=fo({prop:n,defaultProp:r??[],onChange:s,caller:ic}),c=A.useCallback(f=>i((m=[])=>[...m,f]),[i]),u=A.useCallback(f=>i((m=[])=>m.filter(p=>p!==f)),[i]);return l.jsx(Rle,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:l.jsx(jle,{...o,ref:t})})});D8.displayName=ic;var[vmt,bmt]=Ale(ic),jle=A.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:a,loop:i=!0,...c}=e,u=Nle(n),f=Pf(a),m={role:"group",dir:f,...c};return l.jsx(vmt,{scope:n,rovingFocus:s,disabled:r,children:s?l.jsx(Zx,{asChild:!0,...u,orientation:o,dir:f,loop:i,children:l.jsx(Et.div,{...m,ref:t})}):l.jsx(Et.div,{...m,ref:t})})}),sx="ToggleGroupItem",Ile=A.forwardRef((e,t)=>{const n=Dle(sx,e.__scopeToggleGroup),r=bmt(sx,e.__scopeToggleGroup),s=Nle(e.__scopeToggleGroup),o=n.value.includes(e.value),a=r.disabled||e.disabled,i={...e,pressed:o,disabled:a},c=A.useRef(null);return r.rovingFocus?l.jsx(Jx,{asChild:!0,...s,focusable:!a,active:o,ref:c,children:l.jsx(lB,{...i,ref:t})}):l.jsx(lB,{...i,ref:t})});Ile.displayName=sx;var lB=A.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...s}=e,o=Dle(sx,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=o.type==="single"?a:void 0;return l.jsx(Tle,{...i,...s,ref:t,onPressedChange:c=>{c?o.onItemActivate(r):o.onItemDeactivate(r)}})}),_mt=D8,wmt=Ile;const Cmt=({value:e,onChange:t,id:n,children:r,boxProps:s,className:o=""})=>{const a=i=>{i&&t(i)};return l.jsx(Ple.Provider,{value:{activeValue:e},children:l.jsx(yg,{id:n,children:l.jsx(_mt,{onValueChange:a,type:"single",value:e,asChild:!0,children:l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:l.jsx(K,{className:z("border-subtler p-two flex rounded-lg border",o),...s,children:r})})})})})},Smt=({value:e,icon:t,className:n="",children:r,disabled:s=!1,style:o,onClick:a})=>{const i="relative text-quiet hover:text-foreground data-[state=on]:text-foreground flex h-[32px] min-w-[32px] p-sm items-center justify-center duration-150 active:scale-95",c=d.useContext(Ple);return l.jsx(wmt,{asChild:!0,value:e,disabled:s,children:l.jsxs("button",{className:z(i,{"cursor-not-allowed":s},n),disabled:s,style:o,onClick:a,children:[l.jsxs("span",{className:z("gap-xs relative z-[2] flex",{"opacity-50":s}),children:[Array.isArray(t)?t.map((u,f)=>l.jsx(rn,{icon:u,size:"small"},f)):t?l.jsx(rn,{icon:t,size:"small"}):null,r]}),c.activeValue===e&&l.jsx(Te.div,{layout:!0,layoutId:"toggle",className:"absolute inset-0 z-[1]",transition:{duration:.15,ease:Qd},children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-current opacity-10"})})]})})},Ple=Ft("ToggleGroupContext",{activeValue:""}),Emt=Cmt,kmt=Smt,Xa={Root:Emt,Item:kmt},Mmt=[0,5,10,25,50,100,200],B5=He({advanced:{defaultMessage:"Advanced",id:"3Rx6Qo1x+1"},sma:{defaultMessage:"Simple Moving Average",id:"6Az5TSZOco"},period:{defaultMessage:"Period",id:"jCNpELHqTA"},off:{defaultMessage:"Off",id:"OvzONl52rs"}}),Tmt=(e,t)=>{if(!e?.length||t<=0)return[];const n=[];let r=0;for(let s=0;s=t){const i=e[s-t]?.close;i&&(r-=i)}if(s>=t-1){const i=s{const[e,t]=d.useState(0);return{sma:{period:e,setPeriod:t}}},Ole=d.memo(({history:e,xScale:t,yScale:n,indicators:r})=>{const s=r?.sma?.period??0,o=s>0,a=d.useMemo(()=>Tmt(e,s),[e,s]),i=d.useMemo(()=>sl().defined(f=>yd(f.value)).x(f=>{const m=new Date(f.date);return t(m)??0}).y(f=>n(f.value)??0).curve(Db),[t,n]),c=d.useMemo(()=>i(a)??void 0,[i,a]),u=n_(c??"",!0,ii);return o?l.jsx(Te.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:ii/1e3,ease:"easeInOut"},children:l.jsx(fa.path,{d:u,fill:"none",stroke:er.gray,strokeWidth:1.5,strokeDasharray:"none",shapeRendering:am,style:{vectorEffect:"non-scaling-stroke"}})}):null});Ole.displayName="FinanceStockHistoryChartSimpleMovingAverage";const cB="flex flex-col p-sm gap-md",Lle=d.memo(({children:e})=>{const{$t:t}=J(),[n,r]=d.useState(!1),s=d.useRef(null),o=d.useRef(null),a=d.useRef(null),{isMediumScreen:i}=GN();N8({isOpen:n,onClose:()=>r(!1),refs:[s,o,a]});const c=l.jsx(Fo,{content:t(B5.advanced),disabled:n,children:l.jsx("button",{ref:s,onClick:()=>r(u=>!u),className:z(ru,"px-sm group h-full bg-transparent transition-transform"),children:l.jsx(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center pt-px",children:l.jsx(ut,{name:B("dots-vertical"),className:"size-4"})})})});return i?l.jsxs("div",{ref:a,className:"relative",children:[c,n&&l.jsx(K,{className:"z-100 absolute right-0 top-full mt-2 overflow-hidden rounded-xl border shadow-md",children:l.jsx("div",{className:z("bg-base",cB),children:e})})]}):l.jsxs(l.Fragment,{children:[c,n&&l.jsx(Xl,{children:l.jsxs("div",{ref:o,className:"bg-base border-subtlest shadow-overlay fixed inset-x-0 top-0 z-50 flex flex-col overflow-hidden rounded-b-xl border-x border-b",children:[l.jsx("div",{className:"flex items-center p-md",children:l.jsx("button",{onClick:()=>r(!1),children:l.jsx(ut,{name:B("arrow-left"),className:"text-quiet size-5"})})}),l.jsx(K,{className:z("flex-1 overflow-auto p-sm",cB),children:e})]})})]})});Lle.displayName="FinanceStockHistoryAdvancedMenu";const Fle=d.memo(({history:e,indicators:t})=>{const{sma:n}=t,{$t:r}=J(),s=e?.length??0,o=Mmt.map(i=>({value:i,label:i===0?r(B5.off):i.toString(),disabled:i>0&&s{n.setPeriod(+i)},[n]);return l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",className:"pb-sm px-xs",children:r(B5.sma)}),l.jsx(K,{children:l.jsx(Xa.Root,{value:n.period.toString(),onChange:a,id:"sma",className:"flex items-center w-fit",children:o.map(i=>l.jsx(Xa.Item,{value:String(i.value),disabled:i.disabled,children:l.jsx(V,{variant:"tiny",color:n.period===i.value?"default":"light",className:"whitespace-nowrap",children:i.label})},i.value))})})]})});Fle.displayName="FinanceStockHistorySMAControl";const Ble=d.memo(({setFullscreen:e,fullscreen:t})=>{const{$t:n}=J();return t?null:l.jsx(Fo,{content:n({defaultMessage:"Fullscreen",id:"zvKOAuzJQK"}),children:l.jsx("button",{onClick:()=>e(!t),style:{minHeight:Bae},className:z(ru,"flex items-center justify-center px-sm h-full"),children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ut,{name:B(t?"minimize":"maximize"),size:16})})})})});Ble.displayName="FinanceStockHistoryChartControlsContainerFullscreenButton";const Nmt=e=>Math.round(e*.12),Ua=e=>e.close,j8=(e,t)=>{const[n,r]=t;return n===r?0:(e-n)/(r-n)*100},T1=e=>e?.type?1:0,Rmt=({exchangeHoursAnnotations:e,xScale:t,width:n,xMaskingSupported:r,tzOffsetMins:s,history:o})=>{const a=r?e:[],i=[],c="invert"in t,u=c?n:o.length,f=h=>{if(c)return{x:h,date:t.invert(h)};const g=o[h];return{x:t(wn(g))??0,date:wn(g)}};let m,p;for(let h=0;h{const a=o(wn(e))??0,i=o(wn(t))??0,c=(s-n)/(r-n);return a+c*(i-a)},A1=(e,t,n)=>{const r=e>=t?El.POSITIVE:El.NEGATIVE,s=n?Oat[n]:{};return{backgroundColor:Wk[r],backgroundOpacity:1,lineColor:Wk[r],lineOpacity:1,valence:r,...s}},jmt=({history:e,baseline:t,exchangeHoursAnnotations:n,xScale:r,width:s,xMaskingSupported:o,tzOffsetMins:a})=>{if(!e?.length)return[];const i=o?n:[],c=[];let u;for(let m=0;m=t||y>=t&&x{const m=d.useMemo(()=>{const h=a(s),g=e(r);return g?`${g} L ${c[1]},${h} L ${c[0]},${h} Z`:""},[e,r,a,s,c]),p=d.useMemo(()=>{const h=a.domain(),g=h[1]-h[0],y=(h[1]-s)/g*100,x=(u-f)/u*100;return y*(x/100)},[a,s,u,f]);return l.jsxs(l.Fragment,{children:[l.jsxs("defs",{children:[l.jsx("linearGradient",{id:`ticker-area-color-gradient-${t}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",colorInterpolation:"linearRGB",spreadMethod:"pad",children:o.map((h,g)=>l.jsx("stop",{offset:`${j8(h.x,c)}%`,stopColor:er[h.backgroundColor],stopOpacity:h.backgroundOpacity},g))}),l.jsxs("linearGradient",{id:`ticker-area-opacity-gradient-${t}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[l.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"0.3"}),l.jsx("stop",{offset:`${Math.max(0,p-20)}%`,stopColor:"white",stopOpacity:"0.1"}),l.jsx("stop",{offset:`${p}%`,stopColor:"white",stopOpacity:"0.00"}),l.jsx("stop",{offset:`${Math.min(100,p+20)}%`,stopColor:"white",stopOpacity:"0.1"}),l.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.3"})]}),l.jsx("mask",{id:`ticker-area-mask-${t}`,children:l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#ticker-area-opacity-gradient-${t})`})})]}),l.jsx(St,{mode:"wait",children:l.jsx(Te.g,{mask:`url(#ticker-area-mask-${t})`,animate:{opacity:1},initial:{opacity:0},transition:jl,children:l.jsx("path",{d:m,fill:`url(#ticker-area-color-gradient-${t})`,stroke:"none",shapeRendering:am,style:{mixBlendMode:"multiply",...i}})},n)})]})},Pmt=({l:e,history:t,stops:n,xDomainData:r,id:s,disableAnimation:o})=>{const a=d.useMemo(()=>e(t),[e,t]),i=n_(a,!o,ii);return l.jsxs(l.Fragment,{children:[l.jsx("defs",{children:l.jsx("linearGradient",{id:`ticker-line-gradient-${s}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:n.map((c,u)=>l.jsx("stop",{offset:`${j8(c.x,r)}%`,stopColor:er[c.backgroundColor],stopOpacity:c.lineOpacity},u))})}),l.jsx(fa.path,{d:i,stroke:n?.length?`url(#ticker-line-gradient-${s})`:er.blue,strokeWidth:1.75,fill:"none",shapeRendering:am})]})},Omt=({id:e,stops:t,height:n,opacity:r,size:s,style:o,xBounds:a})=>l.jsxs("g",{children:[l.jsxs("defs",{children:[l.jsx("pattern",{id:`ticker-after-hours-dot-grid-${e}`,patternUnits:"userSpaceOnUse",width:s,height:s,children:l.jsx("circle",{cx:s/2,cy:s/2,r:s*.12,fill:er.gray,opacity:r})}),l.jsx("linearGradient",{id:`ticker-after-hours-mask-gradient-${e}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:t.map((i,c)=>l.jsx("stop",{offset:`${j8(i.x,a)}%`,stopColor:"white",stopOpacity:i.backgroundOpacity},c))}),l.jsx("mask",{id:`ticker-after-hours-mask-${e}`,children:l.jsx("rect",{x:0,y:"0",width:a[1],height:n,fill:`url(#ticker-after-hours-mask-gradient-${e})`})})]}),l.jsx("rect",{x:0,y:"0",style:o,width:a[1],height:n,fill:`url(#ticker-after-hours-dot-grid-${e})`,mask:`url(#ticker-after-hours-mask-${e})`})]}),Lmt=e=>e>=20&&e<=40?.95:e>500?.5:.8,Ule=d.memo(({top:e,height:t,data:n,xScale:r})=>{const s=d.useMemo(()=>{const c=Math.max(...n.map(u=>u.volume));return _8({exponent:.4,domain:[0,c],range:[0,t]})},[n,t]),o=d.useMemo(()=>{if(n.length<2)return 1;let c=1/0;for(let u=1;u0&&(c=Math.min(c,p))}return c===1/0?1:c*Lmt(n.length)},[n,r]),{positivePath:a,negativePath:i}=d.useMemo(()=>{const c=[],u=[],f=e+t;for(const m of n){if(m.volume===0)continue;const p=(r(wn(m))??0)-o/2,h=s(m.volume),g=f-h,x=m.close-m.open>=0,v=`M ${p} ${f} L ${p} ${g} L ${p+o} ${g} L ${p+o} ${f} Z`;x?c.push(v):u.push(v)}return{positivePath:c.join(" "),negativePath:u.join(" ")}},[n,r,o,s,e,t]);return l.jsxs("g",{children:[a&&l.jsx("path",{d:a,fill:er.blue,opacity:.75}),i&&l.jsx("path",{d:i,fill:er.red,opacity:.75})]})});Ule.displayName="Volume";const Fmt=({baseline:e,history:t,yScale:n,chartWidth:r,children:s})=>{const o=d.useMemo(()=>{const i=n(e),c=10,u=25,f=t.slice(-Math.max(3,Math.floor(t.length*.1))),m=f.reduce((y,x)=>y+n(Ua(x)),0)/f.length,p=Math.abs(m-i),g=!(i=c?!0:m>i);return{opacity:1,top:i,left:r-10,transform:`translate(-100%, ${g?"-100%":"0"})`}},[e,t,n,r]),a=d.useMemo(()=>({...o,opacity:0}),[o]);return r<25?null:l.jsx(Te.div,{className:"pointer-events-none absolute z-50",initial:a,animate:o,transition:{duration:.5,ease:"easeInOut"},children:s})},Bmt=(e,t)=>{if(!e?.length)return;const n=ko(e,$2),r=wL(n[0],t?.open??""),s=wL(n[1],t?.close??"");let o=n[0],a=n[1];return ra&&(a=s),[new Date(o),new Date(a)]},Umt=(e,t,n,r)=>{const[s,o]=d.useState(null),a=d.useCallback(()=>{e?.point.local.x&&o(e.point.local.x)},[e?.point.local.x]),i=d.useCallback(()=>{o(null)},[]),c=d.useMemo(()=>s===null?null:s8(s,t,n).d,[t,n,s]),u=d.useMemo(()=>{if(!c||!e)return null;const[x,v]=[e.data,c].sort((b,_)=>_.date.localeCompare(b.date));return{absolute:x.close-v.close,relative:(x.close-v.close)/v.close}},[c,e]),f=d.useMemo(()=>t.range()[1],[t]),m=d.useMemo(()=>!s||!c?null:t(wn(c)),[t,c,s]),p=d.useMemo(()=>!s||!c||!e?null:t(wn(e.data))??f,[t,c,s,e,f]),h=d.useMemo(()=>!c||!e||!s?`M 0 0 L ${f} 0 L ${f} ${r} L 0 ${r} Z`:`M ${m} 0 L ${p} 0 L ${p} ${r} L ${m} ${r} Z`,[c,e,s,r,m,p,f]),g="finance-chart-clip-path",y=d.useMemo(()=>({clipPath:`url(#${g})`}),[g]);return{id:g,path:h,style:y,animate:!s,absoluteChange:u?.absolute,relativeChange:u?.relative,handleMouseDown:a,handleMouseUp:i,leftX:m,rightX:p}},Vmt=({id:e,path:t})=>l.jsx("defs",{children:l.jsx("clipPath",{id:e,children:l.jsx(fa.path,{d:t})})}),Vle=d.memo(({id:e,symbol:t,exchangeTimezone:n,exchangeHours:r,currency:s,history:o,previousClose:a,width:i,height:c,exchangeHoursAnnotations:u=[],uiHints:f,technical:m,candlestick:p,indicators:h,watermark:g,zoomable:y,isCrypto:x})=>{const{locale:v,$t:b}=J(),_=d.useMemo(()=>o.toSorted((ve,Ae)=>ve.date.localeCompare(Ae.date)),[o]),w=Nmt(c),S=d.useMemo(()=>o8(_),[_]),C=`${t}-${f?.currentPeriod}-${f?.currentInterval}`,{transform:E,isActivelyZooming:T,containerRef:k}=vle({enabled:!!y,width:i,id:C}),I=d.useMemo(()=>Hat(_),[_]),M=d.useMemo(()=>new Set(f?.historyAnomalies??[]),[f?.historyAnomalies]),N=d.useMemo(()=>_.filter(ve=>!M.has(ve.date)),[_,M]),D=d.useMemo(()=>Lat(N,f?.historyMovingAverageWindow??0),[N,f?.historyMovingAverageWindow]),j=d.useMemo(()=>{const ve=Bmt(_,r);return lm({domain:ve,range:[0,i]})},[_,i,r]),F=d.useMemo(()=>s0({domain:_.map(wn),range:[0,i]}),[_,i]),R=d.useMemo(()=>S?yle(E,j):xle(E,F),[E,j,F,S]),P=d.useMemo(()=>ko(_,wn).map(ve=>R(ve)),[R,_]),L=d.useMemo(()=>[0,i],[i]),U=d.useMemo(()=>{if(p){const ve=N.map(We=>We.low),Ae=N.map(We=>We.high);return[Math.min(...ve),Math.max(...Ae)]}return ko(N,Ua)},[N,p]),O=a??0,$=d.useMemo(()=>{let ve=U[0],Ae=U[1];O&&(ve=Math.min(ve,O),Ae=Math.max(Ae,O));const We=Ae-ve;return ve-=We*.05,Ae+=We*.05,Bi({nice:!1,domain:[ve,Ae],range:m?[c-xs-w,Rd]:[c-xs,Rd]})},[c,O,U,m,w]),G=d.useMemo(()=>sl().x(ve=>R(wn(ve))??0).y(ve=>$(Ua(ve))??0).curve(Db),[R,$]),H=I&&!!u.length,Q=d.useMemo(()=>Iat(n??"UTC",new Date),[n]),{tooltipData:Y,hideTooltip:te,showTooltip:se}=_ft({data:_,exchangeHoursAnnotations:u,xScale:R,xBounds:P,hidden:T,tzOffsetMins:Q}),{handleMouseDown:ae,handleMouseUp:X,leftX:ee,rightX:le,...re}=Umt(Y,R,_,c),ce=Sft(re.absoluteChange),ue=d.useCallback(()=>{X(),te()},[X,te]),{isMobileStyle:me}=Re(),we=me?Vae:Uae,ye=d.useMemo(()=>$.ticks(we),[$,we]),{xTickLabels:_e,xTickFormatter:ke,xTickLines:De,xTickCount:xe}=ble({history:_,xGet:wn,xGetUnparsed:$2,timezone:n,locale:v,xScale:R,width:i,zoom:E.k}),Ue=d.useMemo(()=>Rmt({xMaskingSupported:H,xScale:R,width:i,exchangeHoursAnnotations:u??[],tzOffsetMins:Q,history:_}),[H,R,i,u,Q,_]),Ee=d.useMemo(()=>jmt({xMaskingSupported:H,history:D,baseline:O,xScale:R,width:i,exchangeHoursAnnotations:u??[],tzOffsetMins:Q}),[H,D,O,R,i,u,Q]),Ke=d.useCallback(ve=>zae({tick:ve,history:D,yScale:$,xScale:R,yGet:Ua,baseline:O}),[D,$,R,O]),Nt=d.useMemo(()=>!Ue.length,[Ue]),pe=d.useMemo(()=>x?W({defaultMessage:"24h ago: {price}",id:"mSeez9Kv3Q"}):W({defaultMessage:"Prev close: {price}",id:"ZjNVXgqGKh"}),[x]);return l.jsxs("div",{ref:k,className:JN,onMouseDown:ae,onMouseMove:se,onMouseLeave:ue,onMouseOut:ue,onMouseUp:X,onTouchStart:se,onTouchMove:se,onTouchEnd:ue,onTouchCancel:ue,children:[l.jsxs("svg",{height:c,width:i,className:ZN,children:[l.jsx(St,{initial:!1,mode:"wait",children:Nt&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:jl,children:[l.jsx(bu,{tickValues:ye,scale:$,width:i,stroke:er.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx($b,{scale:R,opacity:.1,height:c*2,stroke:er.gray,style:{transform:`translateY(-${c}px)`},numTicks:xe,strokeWidth:1,tickValues:De})]},C)}),l.jsx(Vmt,{id:re.id,path:re.path}),!p&&l.jsx(Imt,{l:G,id:t,animationId:C,history:D,baseline:O,stops:Ee,yScale:$,style:re.style,xDomainData:P,height:c,marginBottom:xs}),l.jsx(St,{mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},exit:Aat,animate:{opacity:1},transition:jl,children:[l.jsx(Omt,{id:e,stops:Ue,height:c*3,style:{transform:`translateY(-${c*3/2}px)`},width:i,opacity:.33,size:5,xBounds:L}),l.jsx("g",{opacity:Y?0:1,className:zk(!!Y),children:l.jsx(zl,{scale:$,hideTicks:!0,hideAxisLine:!0,numTicks:we,left:e8,orientation:"right",tickLabelProps:Ke})}),m&&l.jsx(Ule,{top:c-w-xs,height:w,data:N,xScale:R}),l.jsx(zl,{scale:R,hideAxisLine:!0,hideTicks:!0,numTicks:xe,tickValues:_e,tickFormat:ke,orientation:"bottom",top:c-xs,tickLabelProps:t8})]},C)}),!p&&l.jsx(Pmt,{l:G,id:t,history:D,baseline:O,stops:Ee,xDomainData:P,disableAnimation:T}),l.jsx(St,{mode:"wait",children:p&&l.jsx(Te.g,{initial:{opacity:0},exit:Rat,animate:{opacity:1},transition:Nat,children:l.jsx(cle,{xScale:R,yScale:$,history:N})},C)}),l.jsx(St,{children:l.jsx(I8,{width:i,yScale:$,baseline:O})}),l.jsx(St,{children:l.jsx(Ole,{history:_,xScale:R,yScale:$,indicators:h})}),Y&&l.jsx(Jb,{marginTop:-c,tooltipLeft:Y.point.local.x,innerHeight:c*3,color:ce})]}),l.jsx(St,{children:S&&l.jsx(Fmt,{baseline:O,history:_,yScale:$,chartWidth:i,children:l.jsx("div",{className:z("m-sm bg-base shadow-subtle overflow-hidden rounded-full border backdrop-blur-sm",zk(!!Y)),children:l.jsx("div",{className:"px-sm py-xs bg-subtle relative p-0",children:l.jsx(V,{variant:"micro",color:"light",className:"relative whitespace-nowrap",children:b(pe,{price:Rc(O,s,v)})})})})})}),l.jsx(St,{children:yd(ee)&&yd(le)&&l.jsx(Te.div,{animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},className:"pointer-events-none absolute inset-0",style:{left:le>ee?ee:le,right:i-(le>ee?le:ee),top:-c,bottom:-c},children:l.jsx(Te.div,{className:"bg-inverse absolute inset-0 rounded-md opacity-5"})})}),g&&l.jsx("div",{className:"absolute -top-md left-sm z-[2]",children:g}),Y&&!m&&l.jsx(wft,{x:Y.point.local.x,y:Y.point.touch?-xs:Y.point.local.y,annotation:Y.annotation,close:Y.data.close,date:Y.data.date,absoluteChange:re.absoluteChange,relativeChange:re.relativeChange,currency:s,exchangeTimezone:n??void 0}),Y&&m&&l.jsx(Cft,{x:Y.point.global.x,y:Y.point.global.y,annotation:Y.annotation,data:Y.data,currency:s,locale:v,exchangeTimezone:n??void 0,absoluteChange:re.absoluteChange,relativeChange:re.relativeChange})]})});Vle.displayName="Chart";const I8=d.memo(({width:e,yScale:t,baseline:n})=>l.jsx(Te.line,{stroke:er.gray,initial:{opacity:0},transition:{duration:ii/1e3,ease:"easeInOut"},animate:{opacity:1,x1:0,x2:e,y1:t(n??0),y2:t(n??0)},exit:{opacity:0},strokeDasharray:"4 4",strokeWidth:.8,shapeRendering:am}));I8.displayName="FinanceStockHistoryChartClosingLine";const P8=d.memo(({id:e,quote:t,technical:n,candlestick:r,indicators:s,watermark:o,height:a=a0,zoomable:i=!0})=>l.jsx(Mr,{fallback:dle,children:l.jsx(k8,{height:a,render:!!t,children:c=>!t||c<100||!t.history?.length?null:l.jsx(Vle,{id:e,symbol:t.symbol,currency:t.currency,history:t.history,previousClose:t.historicalPreviousClose??void 0,exchangeHours:t.exchangeHours,exchangeTimezone:t.exchangeTimezone,exchangeHoursAnnotations:t.exchangeHoursAnnotations,width:c,height:a,uiHints:t.uiHints,technical:n,candlestick:r,indicators:s,watermark:o,zoomable:i,isCrypto:t.isCrypto})})}));P8.displayName="FinanceStockHistoryChart";const Hle=["oklch(var(--hydra-450))","oklch(var(--terra-450))","oklch(var(--dalmasca-400))","oklch(var(--kuja-450))","oklch(var(--rosa-450))","oklch(var(--costa-400))","oklch(var(--jenova-450))","oklch(var(--limsa-450))","oklch(var(--gridania-450))"],zle=["oklch(var(--hydra-350))","oklch(var(--terra-350))","oklch(var(--dalmasca-300))","oklch(var(--kuja-350))","oklch(var(--rosa-350))","oklch(var(--costa-300))","oklch(var(--jenova-250))","oklch(var(--limsa-350))","oklch(var(--gridania-350))"],Hmt=(e,t)=>{const n=t?zle:Hle;return n[e%n.length]??"oklch(var(--super-color))"},Wle=()=>{const{colorScheme:e}=Ss();return d.useMemo(()=>e==="dark"?zle:Hle,[e])},Wp=(e,t)=>t[e%t.length]??"oklch(var(--super-color))",zmt=4,Ry=e=>e.changesPercentage,Wmt=({d:e,disableAnimation:t})=>{const n=n_(e??"",!t,ii);return e?l.jsx(fa.path,{strokeWidth:1.75,fill:"none",shapeRendering:am,d:n}):null},Gmt=({data:e,yScale:t})=>e?.map(n=>l.jsx($mt,{x:n.x,yv:n.yv,color:n.quote.color,yScale:t,r:zmt},n.quote.symbol)),$mt=({x:e,yv:t,color:n,yScale:r,r:s})=>l.jsx("circle",{cx:e,cy:r(t),r:s,fill:n}),qmt=({data:e,timeZone:t,locale:n,x:r})=>{const s=d.useMemo(()=>e.reduce((a,i)=>Math.abs(i.x-r){if(!s)return null;const a=s.date;return a?r8(a,n,t??void 0):null},[s,n,t]);return l.jsx(V,{variant:"tinyRegular",color:"light",className:"px-sm py-xs",children:o})},Kmt=(e,t)=>{const n={color:e.color,symbol:e.symbol,name:e.name,exchange:e.exchange,currency:e.currency,image:e.image,imageDark:e.imageDark,exchangeTimezone:e.exchangeTimezone};return t?{quote:{...n,price:t.close,historicalChange:t.close-(e.historicalPreviousClose??0),historicalPercentChange:t.changesPercentage*100},date:t.date}:{quote:{...n,price:e.price,historicalChange:e.historicalChange??0,historicalPercentChange:e.historicalPercentChange??0},date:null}},Ymt=({data:e,dataMovingAverage:t,xScale:n,xBounds:r,setHoveredComparisons:s,hidden:o})=>{const{tooltipData:a,hideTooltip:i,showTooltip:c}=Zb(),u=A.useRef(null),f=A.useRef(o),m=d.useCallback((g,y)=>{const x=Math.min(Math.max(r[0],g.local.x),r[1]),v=t.map((b,_)=>{const w=s8(x,n,b.history),S=e[_].history[Math.min(w.index,e[_].history.length-1)],C=Kmt(e[_],S);return{date:C.date,quote:C.quote,x:n(wn(w.d))??0,yv:Ry(w.d)}});v.every(b=>b.x)&&(s(v.map(b=>b.quote)),c({tooltipData:{data:v,point:{local:{x:g.local.x,y:y?-xs:g.local.y},global:g.global}}}))},[e,t,n,c,r,s]);f.current&&!o&&u.current&&m(u.current,!1),f.current=o;const p=d.useCallback(g=>{const y="touches"in g,x=i0(g);if(!x)return;const v=XN(g),b={local:x,global:v};u.current=b,m(b,y)},[m]),h=d.useCallback(()=>{u.current=null,i(),s([])},[i,s]);return d.useMemo(()=>({tooltipData:o?void 0:a,hideTooltip:h,showTooltip:p}),[a,h,p,o])},Qmt=e=>{if(e.length===0)return!0;const t=e[0].map(wn);for(let n=1;nt?(e-t)/t:0,uB=e=>{const t=e.historicalPreviousClose||e.history[0].close,n=e.history.map(r=>({...r,changesPercentage:Xmt(r.close,t),change:r.close-t}));return{...e,history:n}},Zmt=(e,t)=>!e||e===t?1:.2,Jmt=({quotes:e,width:t,height:n,setHoveredComparisons:r,focused:s,watermark:o,zoomable:a})=>{const{locale:i,timeZone:c}=J(),{isMobileStyle:u}=Re(),f=u?Vae:Uae,m=d.useMemo(()=>{const H=[...new Set(e.map(Q=>Q.exchangeTimezone))];return H.length===1?H[0]:c},[c,e]),p=d.useMemo(()=>e.map(uB),[e]),h=d.useMemo(()=>e.map(H=>uB(H)),[e]),g=d.useMemo(()=>h.flatMap(H=>H.history).sort((H,Q)=>wn(H).getTime()-wn(Q).getTime()),[h]),y=d.useMemo(()=>Bi({nice:!1,domain:ko(p.flatMap(H=>H.history),Ry),range:[n-xs,Rd]}),[n,p]),x=d.useMemo(()=>Qmt(p.map(H=>H.history)),[p]),v=d.useMemo(()=>o8(g),[g]),b=e.map(H=>H.symbol).join("-"),{transform:_,isActivelyZooming:w,containerRef:S}=vle({enabled:!!a,width:t,id:b}),C=d.useMemo(()=>lm({domain:ko(g,wn),range:[0,t]}),[t,g]),E=d.useMemo(()=>s0({domain:Array.from(new Set(g.map($2))).sort().map(Wae),range:[0,t]}),[t,g]),T=d.useMemo(()=>v||!x?yle(_,C):xle(_,E),[_,C,E,x,v]),{xTickLabels:k,xTickFormatter:I,xTickLines:M,xTickCount:N}=ble({history:g,xGet:wn,xGetUnparsed:$2,timezone:m,locale:i,xScale:T,width:t,zoom:_.k}),D=Wle(),j=d.useMemo(()=>sl().x(H=>T(wn(H))??0).y(H=>y(Ry(H))??0).curve(Db),[T,y]),F=d.useMemo(()=>h.map((H,Q)=>({path:j(H.history),color:Wp(Q,D),quote:H})),[h,j,D]),R=d.useMemo(()=>y.ticks(f).filter(H=>H!==0),[y,f]),P=d.useMemo(()=>[0,t],[t]),{tooltipData:L,hideTooltip:U,showTooltip:O}=Ymt({data:p,dataMovingAverage:h,xScale:T,xBounds:P,setHoveredComparisons:r,hidden:w}),$=d.useCallback(H=>H.toLocaleString(i,{style:"percent"}),[i]),G=d.useCallback(H=>{const Q=h.map(Y=>zae({tick:H,history:Y.history,yScale:y,xScale:T,yGet:Ry}));return Q.find(Y=>Y.opacity<1)??Q[0]},[h,y,T]);return l.jsxs("div",{ref:S,className:JN,onMouseMove:O,onMouseLeave:U,onMouseOut:U,onTouchStart:O,onTouchMove:O,onTouchEnd:U,onTouchCancel:U,children:[l.jsxs("svg",{height:n,width:t,className:ZN,children:[l.jsx(St,{initial:!1,mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:jl,children:[l.jsx("g",{opacity:L?0:1,className:zk(!!L),children:l.jsx(zl,{scale:y,hideTicks:!0,hideAxisLine:!0,numTicks:f,tickFormat:$,left:e8,orientation:"right",tickLabelProps:G})}),l.jsx(zl,{scale:T,hideAxisLine:!0,hideTicks:!0,numTicks:N,tickValues:k,tickFormat:I,orientation:"bottom",top:n-xs,tickLabelProps:t8}),l.jsx(bu,{tickValues:R,scale:y,width:t,stroke:er.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx($b,{scale:T,opacity:.1,height:n*2,stroke:er.gray,style:{transform:`translateY(-${n}px)`},numTicks:N,strokeWidth:1,tickValues:M})]},b)}),l.jsx(St,{children:F.map((H,Q)=>l.jsx(Te.g,{initial:{opacity:0,transition:jl},exit:{opacity:0,transition:jl},animate:{stroke:H.color,opacity:Zmt(s,H.quote.symbol),transition:{delay:0,duration:.25}},children:l.jsx(Wmt,{d:H.path,disableAnimation:w})},Q))}),l.jsx(St,{children:l.jsx(I8,{width:t,yScale:y})}),L&&l.jsx(Jb,{marginTop:-n,tooltipLeft:L.point.local.x,innerHeight:n*3,color:er.gray}),l.jsx(Gmt,{data:L?.data,yScale:y})]}),o&&l.jsx("div",{className:"absolute -top-md left-sm z-[2]",children:o}),L&&l.jsx(e_,{x:L.point.local.x,y:L.point.local.y,pill:!0,children:l.jsx(qmt,{data:L.data,timeZone:m,x:L.point.local.x,locale:i})})]})},ept=d.memo(function({quotes:t,focused:n,height:r,setHoveredComparisons:s,watermark:o}){return l.jsx(Mr,{fallback:dle,children:l.jsx(k8,{height:r,render:!!t?.length,children:(a,i)=>!t?.length||a<100||!t.every(c=>c?.history?.length)?null:l.jsx(Jmt,{quotes:t,width:a,height:i,focused:n,setHoveredComparisons:s,watermark:o,zoomable:!0})})})}),tpt=({root:e,quote:t,removeComparison:n,setFocused:r,className:s,href:o})=>{const a=d.useCallback(()=>{r(t.symbol)},[r,t.symbol]),i=d.useCallback(()=>{r(null)},[r]),c=d.useCallback(p=>{p.preventDefault(),p.stopPropagation(),i(),n?.(t.symbol)},[n,t.symbol,i]),{session:u}=Ne(),{trackEvent:f}=Xe(u),m=d.useCallback(()=>{f("finance link clicked",{referrer:Rb.CHART_COMPARISON,targetPageType:Jg.ASSET_PAGE,symbol:t.symbol,destinationUrl:o})},[t.symbol,o,f]);return l.jsxs(Zg,{href:o,className:z("hover:bg-subtler flex items-center justify-start duration-150",{"bg-subtlest":e},s),onMouseEnter:a,onMouseLeave:i,onClick:m,children:[l.jsx(K,{className:"w-xs my-xs ml-xs shrink-0 self-stretch rounded-full",style:{background:t.color}}),l.jsxs(K,{className:"p-sm py-xs gap-sm md:gap-md flex w-full items-center justify-between",children:[l.jsxs(K,{className:z("gap-sm duration-quick grid w-full items-center transition-opacity [grid-template-columns:2fr_1fr_1fr] md:[grid-template-columns:5fr_1fr_1fr_1fr]",{"pointer-events-none opacity-0":t.loading}),children:[l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Xg,{symbol:t.symbol??"",src:t.image??"",srcDark:t.imageDark??""}),l.jsxs(K,{children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-1 text-ellipsis",children:t.name??t.symbol}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:t.symbol,exchange:t.exchange})})]})]}),l.jsx("span",{children:yd(t.price)&&l.jsx(hf,{variant:"small",price:t.price??0,currency:t.currency,animated:!1,className:"text-right"})}),l.jsx("span",{className:"hidden text-center md:block",children:yd(t.historicalChange)&&l.jsx(hf,{variant:"small",price:t.historicalChange??0,currency:t.currency,animated:!1,sign:!0})}),l.jsx("span",{children:yd(t.historicalPercentChange)&&l.jsx(t_,{change:t.historicalPercentChange??0,variant:"tiny",includeIcon:!0,mono:!1,animated:!1})})]}),!!n&&l.jsx(K,{className:z("flex items-center justify-end active:scale-95",{"pointer-events-none invisible":e}),children:l.jsx(Ge,{onClick:c,variant:"border",icon:B("x"),pill:!0,size:"tiny"},t.symbol)})]})]})},Gle=d.memo(({comparisons:e,removeComparison:t,setFocused:n,root:r})=>{const s=d.useCallback(()=>{n(null)},[n]),o=d.useCallback(a=>{const i=[a.symbol,...e.map(c=>c.symbol).filter(c=>c!==a.symbol)];return`/finance/${a.symbol}?comparing=${i.join(",")}`},[e]);return l.jsx(K,{className:"m-0 flex flex-col overflow-hidden p-0",onMouseLeave:s,children:e.map((a,i)=>l.jsx(tpt,{quote:a,root:i===(r??0),removeComparison:t,setFocused:n,href:o(a)},`${a.symbol}-${i===(r??0)}`))})});Gle.displayName="FinanceStockHistoryComparisonList";const npt=({id:e,candlestick:t,setCandlestick:n})=>l.jsxs(Xa.Root,{className:ru,value:t?"candlestick":"line",onChange:r=>{n(r==="candlestick")},id:`candlestick-toggle-${e}`,children:[l.jsx(Xa.Item,{style:G2,value:"line",children:l.jsx(ut,{name:B("chart-line"),size:16})}),l.jsx(Xa.Item,{style:G2,value:"candlestick",children:l.jsx(ut,{name:B("chart-candle"),size:16})})]}),U5=d.memo(({setRange:e,range:t,onApply:n})=>{const{$t:r}=J(),s=d.useMemo(()=>({after:new Date}),[]),o=d.useMemo(()=>t?.from??new Date,[t]),a=d.useCallback(()=>{e(void 0)},[e]);return l.jsxs(K,{className:"flex flex-col w-fit",children:[l.jsx(B6,{captionLayout:"dropdown",disabled:s,defaultMonth:o,onSelect:e,selected:t,mode:"range",className:"w-fit"}),l.jsxs(K,{className:"gap-sm flex justify-end px-md pb-sm",children:[l.jsx(wt,{size:"tiny",onClick:a,variant:"secondary",children:r({id:"jm/spnRSn+",defaultMessage:"Reset"})}),l.jsx(wt,{size:"tiny",fullWidth:!0,onClick:n,disabled:!t?.from,variant:t?.from?"primary":"secondary",children:r({id:"EWw/tKINJT",defaultMessage:"Apply"})})]})]})});U5.displayName="CalendarContent";function rpt({id:e,periods:t,period:n,setPeriod:r,variant:s,calendar:o=!1}){const[a,i]=d.useState(!1),[c,u]=d.useState(!1),[f,m]=d.useState(void 0),p=d.useMemo(()=>t.find(b=>b.value===n),[t,n]),{$t:h}=J(),g=d.useCallback(()=>{if(f?.from){const b=f?.to??f.from;r(`${v7(f.from)}~${v7(b)}`),u(!1),i(!1)}},[f,r]),y=d.useCallback(b=>{b.stopPropagation(),u(_=>!_)},[]),x=d.useCallback(()=>{u(!1)},[]),v=d.useCallback(()=>{u(!0)},[]);return s==="sm"?l.jsx(K,{className:z(ru,"flex items-center"),variant:"transparent",style:{minHeight:Dh},children:l.jsxs(Dt,{isOpen:a,onToggle:i,maxHeightPx:500,triggerElement:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center h-full pl-sm pr-xs cursor-pointer",children:[p?.text??h({id:"Sjo1P44FYy",defaultMessage:"Custom"}),l.jsx(ut,{name:B("chevron-down"),size:16})]}),children:[t.map(({value:b,text:_})=>l.jsx(Dt.Item,{onSelect:()=>{r(b),i(!1)},children:_},b)),o&&l.jsx(Dt,{isOpen:c,onToggle:u,triggerElement:l.jsx(Dt.Button,{variant:"text",size:"small",children:h({id:"Sjo1P44FYy",defaultMessage:"Custom"})}),children:l.jsx(K,{className:"flex justify-center items-start h-full",style:{minHeight:350},children:l.jsx(U5,{setRange:m,range:f,onApply:g})})})]})}):l.jsxs(Xa.Root,{value:n,className:ru,id:`${e}-periods`,onChange:b=>{b&&r(b)},children:[t.map(({value:b,text:_})=>l.jsx(Xa.Item,{value:b,style:G2,children:l.jsx(V,{variant:"tiny",color:n===b?"default":"light",className:"translate-y-px whitespace-nowrap duration-150",children:_})},b)),o&&l.jsx(Xa.Item,{value:a8(n)?n:"",onClick:y,style:G2,children:l.jsx(kb,{isOpen:c,onClose:x,onOpen:v,isMobileStyle:!1,contentWidth:"auto",avoidCollisions:!0,placement:"top",sideOffset:15,childrenClassName:"inline-flex",content:l.jsx(U5,{setRange:m,range:f,onApply:g}),children:l.jsx(ut,{name:B("calendar"),size:16,className:z({"text-super":c})})})})]})}const O8=d.memo(rpt),$le=d.memo(({peers:e,addComparison:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),{isMobileStyle:o}=Re(),a=d.useRef(null),i=d.useRef(null),c=d.useRef(null);N8({isOpen:r,onClose:()=>s(!1),refs:o?[a,i]:[c]});const u=d.useMemo(()=>e.map(h=>h)?.slice(0,5),[e]),f=d.useCallback(h=>{h&&(t({symbol:h.symbol,name:h.name,image:h.image,imageDark:h.darkImage,exchange:h.exchange,price:h.currentPrice,currency:h.currency,historicalChange:h.change,historicalPercentChange:h.changesPercentage}),s(!1))},[t]),m=l.jsx("button",{ref:a,onClick:()=>s(h=>!h),className:z(ru,"px-sm group h-full bg-transparent transition-transform"),children:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center pt-px duration-200 ease-out group-active:scale-95",children:[n({defaultMessage:"Compare",id:"493J7RI1tF"}),l.jsx(ut,{name:B("chevron-down"),className:"size-3"})]})}),p=l.jsx(wle,{defaultSuggestions:u,onClick:f});return o?l.jsxs(l.Fragment,{children:[m,r&&l.jsx(Xl,{children:l.jsxs("div",{ref:i,className:"bg-base border-subtlest shadow-overlay fixed inset-x-0 top-0 z-50 flex flex-col overflow-hidden rounded-b-xl border-x border-b",children:[l.jsx("div",{className:"flex flex-shrink-0 items-center justify-start",children:l.jsx("button",{className:"p-md",onClick:()=>s(!1),children:l.jsx(ut,{name:B("arrow-left"),className:"text-quiet size-5"})})}),l.jsx(K,{className:"flex-1 overflow-auto",children:p})]})})]}):l.jsxs("div",{ref:c,className:"relative",children:[m,r&&l.jsx(K,{className:"z-100 absolute right-0 top-full mt-2 w-[360px] overflow-hidden rounded-xl border shadow-md",children:l.jsx("div",{className:"bg-base",children:p})})]})});$le.displayName="FinanceStockHistoryCompareInput";const spt=A.memo(({children:e})=>l.jsx(Mr,{fallback:null,children:l.jsx("div",{className:"h-full",children:e})}));spt.displayName="CanonicalSidebarSection";const opt=A.memo(({children:e,className:t})=>l.jsx("div",{className:z("mt-md pb-lg space-y-lg",t),children:e}));opt.displayName="CanonicalSidebarColumn";const apt=A.memo(({children:e,className:t})=>l.jsx(V,{variant:"smallBold",className:z("pb-sm px-sm",t),children:e}));apt.displayName="CanonicalSidebarSectionTitle";const qle=A.memo(({children:e,className:t,variant:n})=>l.jsx(dr,{variant:n,className:z("py-sm",t),children:e}));qle.displayName="CanonicalSidebarSectionContent";const ipt="-my-sm gap-x-sm grid w-full grid-cols-[1fr_min-content_min-content]",lpt=A.memo(e=>{const{isLoading:t,isStale:n,movers:r,skinny:s,approxItemCount:o,itemProps:a,referrer:i}=e;return l.jsx(qle,{className:z("overflow-hidden duration-150",{"opacity-50":t}),children:l.jsx(Te.div,{className:z(ipt,{"pointer-events-none invisible":t}),initial:{opacity:0},animate:{opacity:n?.5:1},exit:{opacity:0},transition:{duration:.5},"aria-hidden":t,children:t?l.jsx(cpt,{size:o??5,...e}):r?.map(c=>d.createElement(Kle,{...a,key:c.symbol,symbol:c.symbol,price:c.price,exchange:c.exchange??void 0,currency:c.currency??void 0,name:c.name??"",changesPercentage:c.changesPercentage,skinty:s,useImage:!s,image:c.image??void 0,imageDark:c.imageDark??void 0,referrer:i}))},"top-mover")})});lpt.displayName="MoverTable";const Kle=e=>e.skinty?l.jsx(dpt,{...e}):l.jsx(upt,{...e}),cpt=({size:e,...t})=>[...Array(e).fill(null)].map((n,r)=>l.jsx(Kle,{...t,symbol:"NVDA",price:110,currency:"USD",name:"XXX",changesPercentage:110,exchange:"XX",useImage:!t.skinny,skinty:t.skinny},r)),upt=e=>l.jsx(Rae,{symbol:e.symbol,referrer:e.referrer,className:"col-span-3 flex min-w-0",children:l.jsx(Yle,{...e})});function dpt({symbol:e,name:t,price:n,currency:r,changesPercentage:s,trailingComponent:o,referrer:a}){return l.jsxs(Rae,{symbol:e,referrer:a,className:"col-span-3 grid grid-cols-subgrid",children:[l.jsx(WN,{name:t,variant:"small"}),l.jsx(hf,{price:n,currency:r}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(r_,{changesPercentage:s,includeIcon:!0,variant:"tiny",className:"w-full"}),o&&o({symbol:e})]})]})}const r_=A.memo(({changesPercentage:e,background:t,variant:n,includeIcon:r=!1,className:s,suffix:o,animated:a})=>l.jsx(t_,{change:e,variant:n,includeIcon:r,background:t,mono:!1,suffix:o,className:s,animated:a}));r_.displayName="FinanceMoverChange";const Yle=A.memo(({symbol:e,price:t,currency:n,name:r,changesPercentage:s,useImage:o=!0,exchange:a,image:i,imageDark:c,trailingComponent:u,className:f})=>l.jsxs("div",{className:z("gap-sm flex w-full min-w-0 items-center",{"-ml-xs":!!o},f),children:[o&&l.jsx(Xg,{symbol:e,src:i??"",srcDark:c,size:"lg"}),l.jsxs(K,{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs(K,{className:"gap-md flex min-w-0 items-end justify-between",children:[l.jsx(WN,{name:r}),l.jsx(hf,{price:t,currency:n,className:"leading-snug"})]}),l.jsxs(K,{className:"gap-sm flex items-start justify-between text-right",children:[l.jsx(V,{variant:"tinyMono",className:"whitespace-nowrap leading-snug",color:"light",children:l.jsx(e0,{symbol:e,exchange:a})}),l.jsx(r_,{changesPercentage:s,background:!1,animated:!1,className:"leading-tight"})]})]}),u&&u({symbol:e})]}));Yle.displayName="FinanceMover";const Dy={operatingActivities:"Operating Activities",netIncome:"Net Income",depreciationAndAmortization:"Dep. & Amort.",deferredIncomeTax:"Deferred Tax",stockBasedCompensation:"Stock-Based Comp.",changeInWorkingCapital:"Change in WC",otherNonCashItems:"Other Non-Cash",netCashProvidedByOperatingActivities:"Operating Cash Flow",investingActivities:"Investing Activities",investmentsInPropertyPlantAndEquipment:"PP&E Inv.",acquisitionsNet:"Net Acquisitions",purchasesOfInvestments:"Inv. Purchases",salesMaturitiesOfInvestments:"Inv. Sales/Matur.",otherInvestingActivites:"Other Inv. Act.",netCashUsedForInvestingActivites:"Investing Cash Flow",financingActivities:"Financing Activities",debtRepayment:"Debt Repay.",commonStockIssued:"Stock Issued",commonStockRepurchased:"Stock Repurch.",dividendsPaid:"Dividends Paid",otherFinancingActivites:"Other Fin. Act.",netCashUsedProvidedByFinancingActivities:"Financing Cash Flow",effectOfForexChangesOnCash:"Forex Effect",netChangeInCash:"Net Chg. in Cash",supplementalInformation:"Supplemental Information",operatingCashFlow:"Operating Cash Flow",capitalExpenditure:"Capital Expenditures",cashAtBeginningOfPeriod:"Beg. Cash",cashAtEndOfPeriod:"End Cash",freeCashFlow:"Free Cash Flow"},Ia={revenue:"Revenue",percentageOfGrowth:"% Growth",costOfRevenue:"Cost of Goods Sold",grossProfit:"Gross Profit",grossProfitRatio:"% Margin",researchAndDevelopmentExpenses:"R&D Expenses",generalAndAdministrativeExpenses:"G&A Expenses",sellingGeneralAndAdministrativeExpenses:"SG&A Expenses",sellingAndMarketingExpenses:"Sales & Mktg Exp.",otherExpenses:"Other Operating Expenses",operatingExpenses:"Operating Expenses",operatingIncome:"Operating Income",operatingIncomeRatio:"% Margin",totalOtherIncomeExpensesNet:"Other Income/Exp. Net",incomeBeforeTax:"Pre-Tax Income",incomeTaxExpense:"Tax Expense",netIncome:"Net Income",netIncomeRatio:"% Margin",eps:"EPS",epsRatio:"% Growth",epsdiluted:"EPS Diluted",weightedAverageShsOut:"Weighted Avg Shares Out",weightedAverageShsOutDil:"Weighted Avg Shares Out Dil",supplementalInformation:"Supplemental Information",interestIncome:"Interest Income",interestExpense:"Interest Expense",depreciationAndAmortization:"Depreciation & Amortization",ebitda:"EBITDA",ebitdaratio:"% Margin"},fpt={assets:"Assets",cashAndCashEquivalents:"Cash & Equivalents",shortTermInvestments:"Short-Term Investments",netReceivables:"Receivables",inventory:"Inventory",otherCurrentAssets:"Other Curr. Assets",totalCurrentAssets:"Total Curr. Assets",propertyPlantEquipmentNet:"Property Plant & Equip (Net)",goodwill:"Goodwill",intangibleAssets:"Intangibles",longTermInvestments:"Long-Term Investments",taxAssets:"Tax Assets",otherNonCurrentAssets:"Other NC Assets",totalNonCurrentAssets:"Total NC Assets",otherAssets:"Other Assets",totalAssets:"Total Assets",liabilities:"Liabilities",accountPayables:"Payables",shortTermDebt:"Short-Term Debt",taxPayables:"Tax Payable",deferredRevenue:"Def. Revenue",otherCurrentLiabilities:"Other Curr. Liab.",totalCurrentLiabilities:"Total Curr. Liab.",longTermDebt:"LT Debt",deferredRevenueNonCurrent:"Def. Rev. NC",deferredTaxLiabilitiesNonCurrent:"Def. Tax Liab. NC",otherNonCurrentLiabilities:"Other NC Liab.",totalNonCurrentLiabilities:"Total NC Liab.",otherLiabilities:"Other Liab.",capitalLeaseObligations:"Cap. Leases",totalLiabilities:"Total Liab.",equity:"Equity",preferredStock:"Pref. Stock",commonStock:"Common Stock",retainedEarnings:"Ret. Earnings",accumulatedOtherComprehensiveIncomeLoss:"AOCI",othertotalStockholdersEquity:"Other Equity",totalEquity:"Total Equity",supplementalInformation:"Supplemental Information",minorityInterest:"Min. Interest",totalLiabilitiesAndTotalEquity:"Total Liab. & Tot. Equity",totalInvestments:"Total Inventory",totalDebt:"Total Debt",netDebt:"Net Debt"},mpt={marketCapitalization:"Market Cap",minusCashAndCashEquivalents:"- Cash",addTotalDebt:"+ Debt",enterpriseValue:"Enterprise Value",revenue:Ia.revenue,percentageOfGrowth:Ia.percentageOfGrowth,grossProfit:Ia.grossProfit,grossProfitRatio:Ia.grossProfitRatio,ebitda:Ia.ebitda,ebitdaratio:Ia.ebitdaratio,netIncome:Ia.netIncome,netIncomeRatio:Ia.netIncomeRatio,epsdiluted:Ia.epsdiluted,epsdilutedratio:"% Growth",netCashProvidedByOperatingActivities:Dy.netCashProvidedByOperatingActivities,capitalExpenditure:Dy.capitalExpenditure,freeCashFlow:Dy.freeCashFlow},Bh=new Set(["grossProfitRatio","percentageOfGrowth","ebitdaratio","operatingIncomeRatio","incomeBeforeTaxRatio","netIncomeRatio","epsRatio","epsdilutedratio"]),ppt=new Set(["eps","epsdiluted","weightedAverageShsOut","weightedAverageShsOutDil"]);[...Bh];[...Bh],[...Bh];const hpt=new Set([...Object.keys(fpt),...Object.keys(Ia),...Object.keys(Dy),...Object.keys(mpt)].filter(e=>!Bh.has(e)&&!ppt.has(e)));[...hpt];({...Object.fromEntries([...Bh].map(e=>[e,1]))});function gpt(e,t){const n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function ypt(e,t){return t&&a8(t)&&e?.length?{startDate:e[0].date,endDate:e[e.length-1].date}:t!=="1d"&&e?.length?{startDate:e[0].date,endDate:e[e.length-1].date}:{startDate:void 0,endDate:void 0}}const Qle=({price:e,currency:t,change:n,percentChange:r,children:s,className:o,variant:a})=>{const i=d.useMemo(()=>({style:t?"currency":"decimal",currency:t??void 0,minimumFractionDigits:e<1e3?2:0,maximumFractionDigits:2}),[t,e]),c=a==="sm",u=c?"tiny":"base";return l.jsxs(K,{className:z("flex w-full flex-col",o),children:[l.jsxs(K,{className:"gap-sm flex w-full items-center justify-start",children:[l.jsx(V,{variant:c?"baseSemi":"entry-title-200",className:"m-0 p-0",children:l.jsx(Nb,{value:e,format:i,animated:!0})}),l.jsxs(K,{className:"gap-xs flex items-center",children:[!c&&l.jsx(hf,{price:n??0,currency:t,sign:!0,variant:u,animated:!0}),l.jsx(r_,{animated:!0,changesPercentage:r??0,variant:u,background:!1,includeIcon:!0})]})]}),l.jsx(K,{className:"gap-sm flex items-center justify-start",children:s})]})},Xle="flex items-center gap-xs truncate min-w-0",Zle=A.memo(({price:e,currency:t,change:n,percentChange:r,timestamp:s,open:o,closes:a,timezone:i,variant:c,period:u,startDate:f,endDate:m})=>{const{$t:p,locale:h}=J(),g=d.useMemo(()=>{const y=a8(u);if(u!=="1d"&&f&&m){const v=new Date(f),b=new Date(!y&&s?s*1e3:m),_=T=>T.toLocaleDateString(h,{month:"short",day:"numeric",year:"numeric",timeZone:i}),w=T=>T.toLocaleString(h,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:c==="lg"?"2-digit":void 0,timeZoneName:"short",timeZone:i}),S=y&&gpt(f,m),C=_(v),E=y?_(b):w(b);return y?S?C:p({defaultMessage:"{startDate} – {endDate}",id:"5Rl2zbDuSl"},{startDate:C,endDate:E}):p({defaultMessage:"{startDate} – {endDate}",id:"5Rl2zbDuSl"},{startDate:C,endDate:E})}const x=s?new Date(s*1e3).toLocaleTimeString(h,{hour:"numeric",minute:"2-digit",day:"numeric",month:"short",second:c==="lg"?"2-digit":void 0,timeZoneName:"short",timeZone:i}):null;if(c==="sm"){if(!o&&a&&s){const b=new Date(s*1e3).toLocaleDateString(h,{month:"short",day:"numeric",timeZone:i});return p({defaultMessage:"At Close: {date}",id:"yH424m9j36"},{date:b})}return x}return o&&a?p({defaultMessage:"Regular Session: {time}",id:"UxiRfp0f4m"},{time:x}):!o&&a?p({defaultMessage:"At Close: {time}",id:"sbpypHoyMl"},{time:x}):x},[s,h,o,p,a,i,c,u,f,m]);return l.jsx(Qle,{price:e,currency:t,change:n,percentChange:r,variant:c,children:l.jsx(V,{variant:"tinyRegular",color:"light",className:Xle,children:g})})});Zle.displayName="StockPriceBig";const Jle=A.memo(({price:e,currency:t,change:n,percentChange:r,timestamp:s,timezone:o,variant:a,afterHoursType:i})=>{const{$t:c,locale:u}=J(),{isMobileStyle:f}=Re(),m=new Date(s*1e3).toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",second:f?void 0:"2-digit",day:"numeric",month:"short",timeZoneName:f?void 0:"short",timeZone:o}),p=d.useMemo(()=>{const y=i==="pre_market"?W({defaultMessage:"Pre-market: {time}",id:"ok47wYkpHy"}):W({defaultMessage:"After hours: {time}",id:"elF1mrf0Os"});return c(y,{time:m})},[i,m,c]),h=d.useMemo(()=>{if(a==="sm"){const g=i==="pre_market",y=new Date(s*1e3).toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:o}),x=g?W({defaultMessage:"Pre-market: {time}",id:"ok47wYkpHy"}):W({defaultMessage:"After Hours: {time}",id:"+QecmxPmpo"});return c(x,{time:y})}return null},[a,i,s,u,o,c]);return l.jsx(Qle,{price:e,currency:t,change:n,percentChange:r,variant:a,children:l.jsx(V,{variant:"tinyRegular",color:"light",className:Xle,children:a==="sm"?h:p})})});Jle.displayName="AfterHoursPriceBig";const dB=({children:e,grow:t=!0,className:n})=>l.jsx(K,{className:z("px-md py-sm",t?"flex-1":"w-full",n),children:e}),ece=A.memo(({quote:e,period:t,context:n="canonical"})=>{const r=!!e.afterHoursPrice&&t==="1d";Rf("mini-graphs");const{isMobileStyle:s}=Re(),o=s&&r?"sm":"lg",a=d.useMemo(()=>ypt(e.history,t),[e.history,t]),i=d.useMemo(()=>l.jsx(Zle,{variant:o,price:e.price,currency:e.currency,change:e.historicalChange,percentChange:e.historicalPercentChange,period:t??void 0,timestamp:e.timestamp,open:e.isMarketOpen,closes:e.exchange!=="CRYPTO",timezone:e.exchangeTimezone??void 0,startDate:a.startDate,endDate:a.endDate}),[e,o,t,a]),c=d.useMemo(()=>l.jsx(Jle,{price:e.afterHoursPrice,change:e.afterHoursChange,percentChange:e.afterHoursPercentChange,timestamp:e.afterHoursTimestamp,currency:e.currency,timezone:e.exchangeTimezone??void 0,variant:o,afterHoursType:e.afterHoursType??null}),[e,o]);return l.jsx(K,{variant:"raised",className:z("relative",n==="thread"?"border-t rounded-none":"border-x border-b-0 border-t rounded-b-none rounded-t-xl"),children:l.jsxs(K,{className:"flex",children:[l.jsx(dB,{grow:r,className:r?"border-r border-subtlest":void 0,children:i}),r&&l.jsx(dB,{grow:!0,children:c})]})})});ece.displayName="BeforeAfterHours";const xpt=He({"1min":{defaultMessage:"1 min",id:"D2/3tXpws9"},"5min":{defaultMessage:"5 min",id:"TVHUbnv1cj"},"15min":{defaultMessage:"15 min",id:"OOAN7GDaOG"},"30min":{defaultMessage:"30 min",id:"z+jvO3E6rw"},"1hour":{defaultMessage:"1 hour",id:"68LTymxJcs"},"4hour":{defaultMessage:"4 hours",id:"SiO/3GrQZY"},"1day":{defaultMessage:"1 day",id:"+7PjfVlUMl"},"1week":{defaultMessage:"1 week",id:"LTNKL8T1Dn"},"1month":{defaultMessage:"1 month",id:"p1dNdsvErg"}}),vpt=d.memo(function({availableIntervals:t,currentInterval:n,setInterval:r}){const{$t:s}=J(),o=d.useCallback(a=>{r(a)},[r]);return!t?.length||!n?null:l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",className:"pb-sm px-xs",children:s({defaultMessage:"Price Interval",id:"okQNyMzaX6"})}),l.jsx(K,{children:l.jsx(Xa.Root,{value:n,onChange:o,className:"flex items-center w-fit",id:"interval",children:t.map(a=>l.jsx(Xa.Item,{value:a,children:l.jsx(V,{variant:"tiny",color:n===a?"default":"light",className:"whitespace-nowrap",children:s(xpt[a])})},a))})})]})}),bpt=[],_pt=7,wpt=Vat.map(e=>({text:$ae[e],value:e})),tce=e=>{const[t,n]=e.split("~");return t&&n?{type:"range",range:{start:t,end:n}}:{type:"period",period:t}},Cpt=({symbol:e,period:t,interval:n})=>({prefix:"finance/chart",symbol:e,historyPeriod:t,withHistory:!0,historyAfterHours:["1d","5d","1m"].includes(t),historyRedirect:!0,historyInterval:n,withUiHints:!0}),Spt=(e,t,n,r)=>{const s=d.useRef(new Set),o=!n,a=Yt();d.useEffect(()=>{s.current.has(e)||!o||r?.length},[e,o,r,a,t])},Ept=(e,t,n,r)=>{const s=d.useMemo(()=>rN(Cpt({symbol:e,period:n,interval:r})),[n,r,e]),o=mt({queryKey:s,queryFn:async()=>{const a=tce(n);if(a.type==="range"){const c=await eu({symbol:e,historyPeriod:void 0,historyStartDate:a.range.start,historyEndDate:a.range.end,historyInterval:r,withHistory:!0,historyAfterHours:Math.abs(zat(a.range.start,a.range.end))<30});return{quote:c,interval:c?.uiHints?.currentInterval??null,period:c?.uiHints?.currentPeriod??n,pendingPeriod:void 0}}const i=await eu({symbol:e,historyPeriod:a.period,withHistory:!0,historyAfterHours:["1d","5d","1m"].includes(a.period),historyRedirect:!0,historyInterval:r,withUiHints:!0,historyStartDate:void 0,historyEndDate:void 0});return{quote:i,interval:i?.uiHints?.currentInterval??r,period:i?.uiHints?.currentPeriod??n,pendingPeriod:void 0}},refetchInterval:5e3,staleTime:1/0,placeholderData:a=>{if(a)return{...a,interval:r??a.interval,period:a.period??n,pendingPeriod:n};if(t)return{quote:t,interval:r,period:t?.uiHints?.currentPeriod??n,pendingPeriod:void 0}}});return Spt(e,n,o.isLoading,o.data?.quote?.uiHints?.availablePeriods),{isLoading:o.isLoading||o.isPlaceholderData,quote:o.data?.quote??null,interval:o.data?.interval??null,period:o.data?.period??null,pendingPeriod:o.data?.pendingPeriod}},kpt=(e,t,n,r)=>{const s=Yt(),o=mt({queryKey:be.makeEphemeralQueryKey("finance/comparison",t,...e),queryFn:async()=>{const a=tce(t),i=e.map(async f=>{if(a.type==="range")return await s.ensureQueryData({queryKey:be.makeEphemeralQueryKey("finance/history",f,a.range.start,a.range.end),queryFn:()=>eu({symbol:f,historyPeriod:void 0,historyStartDate:a.range.start,historyEndDate:a.range.end,historyAfterHours:!1,historyRedirect:!1,withUiHints:!0,withHistory:!0}),staleTime:3e4});const m={prefix:"finance/comparison",symbol:f,historyPeriod:a.period,withHistory:!0,historyRedirect:!1,historyAfterHours:!1};return await s.ensureQueryData({queryKey:rN(m),queryFn:()=>eu(m),staleTime:3e4})});return{quotes:(await Promise.all(i))?.filter(f=>!!f)?.map((f,m)=>({...f,color:Wp(m,r)}))??[],period:t,pendingPeriod:void 0}},placeholderData:a=>{if(a)return{...a,period:a.period??t,pendingPeriod:t}},refetchInterval:3e4,enabled:n});return{isLoading:o.isLoading,quotes:o.data?.quotes??bpt,period:o.data?.period??null,pendingPeriod:o.data?.pendingPeriod??void 0}},Mpt=e=>{const t=On(),n=Zl(t),r=fn();d.useEffect(()=>{t&&n&&t!==n&&!r?.get("comparing")&&e([])},[t,n,r,e])},Tpt=(e,t,n,r)=>{const s=fn(),o=Rn(),a=d.useCallback(S=>{const C=new URLSearchParams(window.location.search);C.set("comparing",S.join(",")),o.replace(`?${C.toString()}`)},[o]),[i,c]=d.useState(s?.get("comparing")?.split(",")??r??[]),u=d.useMemo(()=>[e,...i.filter(S=>S!==e)],[i,e]),f=u.length>1,[m,p]=d.useState({}),h=d.useCallback(S=>{S.symbol&&c(C=>{const E=[...new Set([e,...C,S.symbol])];return E.length>_pt&&E.splice(-2,1),a(E),p(T=>({...Object.fromEntries(Object.entries(T).filter(([k])=>E.includes(k))),[S.symbol]:S})),E})},[c,p,e,a]),g=d.useCallback(S=>{c(C=>{const E=C.filter(T=>T!==S);return a(E),E}),p(C=>{const E={...C};return delete E[S],E})},[c,p,a]),y=d.useCallback(()=>{c([])},[]);Mpt(c);const x=kpt(u,t,f,n),{comparisonQuotes:v,setHoveredComparisons:b}=Npt(u,x.quotes,m,n),_=Apt(e,u);return{peers:d.useMemo(()=>_.data.filter(S=>!u.includes(S.symbol)),[_.data,u]),isComparing:f,quotes:x.quotes,comparisonQuotesLoading:x.isLoading,comparisonQuotes:v,setHoveredComparisons:b,addComparison:h,removeComparison:g,resetComparisons:y,period:x.period,pendingPeriod:x.pendingPeriod}},Apt=(e,t)=>{const{data:n,isLoading:r,isPlaceholderData:s}=mt({queryKey:mKe(e,!0),queryFn:()=>pKe({symbol:e,index:!0}),placeholderData:Wl}),o=d.useMemo(()=>n?.filter(a=>!t.some(i=>i===a.symbol)&&a.symbol!==e)??[],[n,t,e]);return d.useMemo(()=>({data:o,isLoading:r||s}),[o,r,s])},Npt=(e,t,n,r)=>{const[s,o]=d.useState([]),a=d.useMemo(()=>e.map((f,m)=>{const p=t.find(g=>g.symbol===f)??n[f];return p?{symbol:p.symbol,name:p.name,image:p.image,imageDark:p.imageDark,exchange:p.exchange,currency:p.currency||void 0,price:p.price,exchangeTimezone:p.exchangeTimezone,historicalChange:p.historicalChange,historicalPercentChange:p.historicalPercentChange,color:Wp(m,r)}:{symbol:f,loading:!0,color:Wp(m,r)}}),[e,t,n,r]),i=d.useMemo(()=>s.map((u,f)=>({...u,color:Wp(f,r)})),[s,r]),c=i.length>0?i:a;return d.useMemo(()=>({comparisonQuotes:c,setHoveredComparisons:o}),[c,o])},nce=(e,t)=>d.useMemo(()=>{const n=e?.length?e:wpt.map(s=>s.value);return(t?n.filter(s=>s!=="5d"):n).map(s=>({text:$ae[s],value:s}))},[e,t]),Rpt=({children:e,context:t})=>l.jsx(K,{noBorder:!0,className:z("overflow-hidden border-t border-subtlest",t==="thread"?"rounded-none":"border-b rounded-b-xl"),children:e}),fB=({symbol:e,comparisons:t,initialQuote:n,fullscreen:r,setFullscreen:s,chartHeight:o=225,zoomable:a=!0,context:i="canonical"})=>{const{isMobileStyle:c}=Re(),u=fn(),f=u?.get("period"),m=u?.get("interval"),[p,h]=d.useState(m??n?.uiHints?.currentInterval??null),[g,y]=d.useState(f??n?.uiHints?.currentPeriod??"1d"),[x,v]=d.useState(null),[b,_]=d.useState(!1),w=c?null:x,S=Wle(),C=Ept(e,n,g,p),E=Tpt(e,g,S,t),T=!b&&E.isComparing,k=nce(C.quote?.uiHints?.availablePeriods,E.isComparing),I=Amt(),{variant:M,containerRef:N}=$ot({isMobileStyle:c});return C.quote?l.jsxs(K,{className:"flex flex-col",children:[l.jsx(ece,{quote:C.quote,period:T?E.period:C.period,context:i}),l.jsxs(K,{variant:"raised",className:z("relative",i==="thread"?"border-y rounded-none":z("border-x border-t rounded-t-none rounded-b-xl",r&&"border-b")),children:[l.jsxs(K,{className:"gap-y-sm relative flex flex-col justify-between",children:[l.jsxs(rce,{isLoading:C.isLoading,children:[!T&&l.jsx(P8,{id:`history-chart-${e}`,quote:C.quote,technical:!0,height:o,candlestick:b,indicators:I,watermark:l.jsx(Rh,{}),zoomable:a}),T&&l.jsx(ept,{quotes:E.quotes,focused:w,height:o,setHoveredComparisons:E.setHoveredComparisons,watermark:l.jsx(Rh,{})})]}),l.jsxs(K,{ref:N,className:"z-1 p-sm absolute inset-x-0 top-0 flex justify-between items-stretch",children:[l.jsxs(K,{className:"gap-sm flex flex-start",children:[l.jsx(O8,{id:e,periods:k,period:T?E.pendingPeriod??E.period:C.pendingPeriod??C.period,setPeriod:y,calendar:!0,variant:M}),l.jsx(npt,{id:e,candlestick:b,setCandlestick:_}),!b&&l.jsx($le,{peers:E.peers,addComparison:E.addComparison}),!T&&l.jsxs(Lle,{children:[l.jsx(vpt,{setInterval:h,availableIntervals:C.quote?.uiHints?.availableIntervals,currentInterval:C.interval}),l.jsx(Fle,{history:C.quote.history,indicators:I})]})]}),l.jsxs("div",{className:"gap-sm flex items-center justify-center",children:[!T&&l.jsx(qat,{quote:C.quote,animationId:e,period:T?E.period:C.period}),s&&!c&&l.jsx(Ble,{setFullscreen:s,fullscreen:r})]})]})]}),T&&l.jsx(Rpt,{context:i,children:l.jsx(Gle,{comparisons:E.comparisonQuotes,removeComparison:E.removeComparison,setFocused:v})}),!T&&!r&&l.jsx(jae,{quote:C.quote,context:i})]})]}):null},rce=A.memo(({children:e,isLoading:t})=>l.jsx(Te.div,{initial:{opacity:1},animate:{opacity:t?.5:1},transition:{duration:.5,delay:.5},style:{paddingTop:Dh+16+20},className:"relative overflow-hidden",children:e}));rce.displayName="FinanceStockHistoryChartContainer";const sce=d.memo(({symbol:e,watermark:t})=>{const[n,r]=d.useState("1d"),s=Re(),o={prefix:"finance/currency",symbol:e,historyPeriod:n,withHistory:!0,historyAfterHours:!1,historyRedirect:!1,withUiHints:!0},{data:a,isLoading:i}=mt({queryKey:rN(o),queryFn:async()=>({quote:await eu(o),period:n}),refetchInterval:5e3,staleTime:1/0,placeholderData:Wl}),c=nce(a?.quote?.uiHints?.availablePeriods,!1);return!i&&!a?.quote?.history?.length?null:l.jsxs(K,{className:"gap-md flex flex-col overflow-hidden border-t relative ",children:[l.jsx(K,{className:"px-md pt-sm flex z-10",children:l.jsx(O8,{id:e,periods:c,period:n,setPeriod:r,variant:s?"sm":"lg",calendar:!1})}),l.jsx(P8,{id:`currency-chart-${e}`,quote:a?.quote,watermark:t,zoomable:!1})]})});sce.displayName="FinanceThreadCurrencyChart";const oce=A.memo(e=>{const{data:t}=e,{source_currency:n,target_currency:r,source_amount:s,converted_amount:o,exchange_rate:a}=t,i=!0,{menuItems:c}=sm(),[u,f]=d.useState(s),[m,p]=d.useState(L(o)),[h,g]=d.useState(n),[y,x]=d.useState(r),[v,b]=d.useState(a),{colorScheme:_}=Ss(),w=_==="dark",{$t:S}=J(),C=`${h}${y}`,{data:E,isLoading:T,error:k}=mt({queryKey:hKe(h,y,u),queryFn:()=>gKe({sourceCurrency:h,targetCurrency:y,amount:u}),enabled:!!h&&!!y&&u>0}),I=d.useRef(E?.source_currency),M=d.useRef(E?.target_currency),N=d.useRef(E?.exchange_rate),D=d.useRef(E?.source_img),j=d.useRef(E?.source_img_dark),F=d.useRef(E?.target_img),R=d.useRef(E?.target_img_dark);d.useEffect(()=>{E&&(E?.source_currency!==I.current||E?.target_currency!==M.current)&&(p(L(E.converted_amount)),I.current=E.source_currency,M.current=E.target_currency),E&&E.exchange_rate!==N.current&&(b(E.exchange_rate),N.current=E.exchange_rate),E&&E.source_img!==D.current&&(D.current=E.source_img),E&&E.source_img_dark!==j.current&&(j.current=E.source_img_dark),E&&E.target_img!==F.current&&(F.current=E.target_img),E&&E.target_img_dark!==R.current&&(R.current=E.target_img_dark)},[E]);function P(G){return Fk.find(H=>H.currencyCode===G)}function L(G){return G>1?parseFloat(G.toFixed(2)):parseFloat(G.toPrecision(2))}function U(G){return G==="INR"||G==="PKR"||G==="BDT"||G==="NPR"}const O=P(h),$=P(y);return l.jsx(Es,{widgetType:"finance",widgetName:"currency_exchange",widgetSize:"full",children:l.jsx("div",{className:"gap-sm pb-sm flex flex-col overflow-visible",children:l.jsxs(dr,{shadow:!0,className:"w-full overflow-hidden",children:[l.jsxs(K,{variant:"subtler",className:"grid w-full grid-cols-1 gap-px md:grid-cols-2",children:[l.jsxs(K,{variant:"raised",className:"p-md pb-sm gap-sm flex w-full flex-col",children:[l.jsx("div",{className:"flex-1",children:l.jsxs(V,{variant:"entry-title-200",className:"flex font-mono !text-2xl",children:[l.jsx("span",{className:"text-quieter",children:O?.symbol}),l.jsx(H5,{value:u.toString(),error:!!k,onChange:G=>{const H=parseFloat(G);f(H),H>0?p(L(H*v)):p(0)},formatting:U(O?.currencyCode)?"indian":"default"})]})}),l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsx(V5,{onSelect:G=>g(G),currency:O?S(O.currency):h,icon:O&&O.type==="crypto"?l.jsx(K,{variant:"subtler",className:"size-full overflow-hidden rounded-full",children:(w?j.current:D.current)&&l.jsx("img",{src:w?j.current??"":D.current??"",alt:S(O.currency),className:"size-full object-contain"})}):O&&O.type==="commodity"?l.jsx(K,{className:z("size-full rounded-full",{"!bg-[gold]":O?.currencyCode==="XAU","!bg-[silver]":O?.currencyCode==="XAG"})}):l.jsx(H2,{className:"size-full object-contain",countryCode:O?.countryCode})}),l.jsx("div",{className:"ml-auto grid grid-cols-1 grid-rows-1 items-center",children:l.jsxs(St,{children:[T&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,className:"col-start-1 row-start-1 ml-auto",children:l.jsx(V,{color:"ultraLight",children:l.jsx(Gl,{size:12})})},"loading"),!T&&k&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,className:"col-start-1 row-start-1 ml-auto",children:l.jsx(V,{color:"light",variant:"small",children:S({defaultMessage:"Not supported",id:"+FiyOTaUCW"})})},"error")]})})]})]}),l.jsxs(K,{variant:"raised",className:z("p-md pb-sm gap-md flex w-full flex-col",{"!gap-sm":i}),children:[l.jsx("div",{className:"flex-1",children:l.jsxs(V,{variant:"entry-title-200",color:"default",className:"flex font-mono !text-2xl",children:[l.jsx("span",{className:"text-quieter",children:$?.symbol}),l.jsx(H5,{value:m.toString(),error:!!k,onChange:G=>{const H=parseFloat(G);p(H),H>0?f(L(H/v)):f(0)},formatting:U($?.currencyCode)?"indian":"default"})]})}),l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsx(V5,{onSelect:G=>x(G),currency:$?S($.currency):y,icon:$&&$.type==="crypto"?l.jsx(K,{variant:"subtler",className:"size-full overflow-hidden rounded-full",children:(w?R.current:F.current)&&l.jsx("img",{src:w?R.current??"":F.current??"",alt:S($.currency),className:"size-full object-contain"})}):$&&$.type==="commodity"?l.jsx(K,{className:z("size-full rounded-full",{"!bg-[gold]":$?.currencyCode==="XAU","!bg-[silver]":$?.currencyCode==="XAG"})}):l.jsx(H2,{className:"size-full object-contain",countryCode:$?.countryCode})}),c&&c.length>0&&l.jsx("div",{className:"ml-auto",children:l.jsx(Fn.Menu,{menuItems:c})})]})]})]}),l.jsx(sce,{symbol:C,watermark:l.jsx(Rh,{})})]})})})});oce.displayName="CurrencyConversion";const V5=A.memo(({currency:e,icon:t,onSelect:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re(),[o,a]=d.useState(""),i=d.useMemo(()=>["CNY","EUR","GBP","JPY","USD","BTC","ETH"].map(y=>Fk.find(x=>x.currencyCode===y)),[]),c=d.useMemo(()=>{const g=Fk.map(y=>({...y,localizedCurrency:r(y.currency)}));return new om(g,{keys:["localizedCurrency","currencyCode","countryCode"],threshold:.3})},[r]),u=d.useMemo(()=>c.search(o)??[],[c,o]),f=d.useMemo(()=>i.map(g=>({type:"default",text:g?.currencyCode?r(g.currency):"",onClick:()=>{g?.currencyCode&&(n(g.currencyCode),a(""))}})),[i,n,r]),m=d.useMemo(()=>u.map(g=>({type:"default",text:r(g.item?.currency)??"",onClick:()=>{g?.item?.currencyCode&&(n(g.item?.currencyCode),a(""))}})),[u,n,r]),p=d.useMemo(()=>[{type:"default",text:r({defaultMessage:"No results",id:"jHJmjfxD4s"}),disabled:!0}],[r]),h=d.useMemo(()=>l.jsx(co,{autoFocus:!0,className:z({"!-mx-xs":s,"!px-xs py-sm mb-xs border-none !bg-transparent shadow-none outline-none focus:!ring-0":!s}),isMobileUserAgent:s,placeholder:r({defaultMessage:"Search currencies...",id:"fDMc8k+hJQ"}),value:o,onChange:g=>a(g),disable1pass:!0}),[s,o,r]);return l.jsx(zs,{alwaysShowChildren:!0,placement:"bottom-start",showFooterOnMobile:!0,items:o.length>0?m.length>0?m:p:f,isMobileStyle:s,wrapperClassName:"flex",header:h,footer:s&&h,children:l.jsx(st,{chevron:!0,noPadding:!0,extraCSS:"!px-sm -ml-sm",leadingComponent:l.jsx("div",{className:"mr-0.5 size-5",children:t}),variant:"primary",size:"small",text:e})})});V5.displayName="CurrencyPicker";const H5=A.memo(({value:e,onChange:t,error:n,formatting:r="default"})=>n?l.jsx("span",{className:"!text-quieter",children:"---"}):l.jsx(Aae,{className:z("placeholder:text-quieter w-full overflow-hidden bg-transparent transition-colors duration-200 [appearance:textfield] focus:outline-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"!text-quieter":n}),value:e??"",disabled:n,placeholder:"0",onChange:t,min:0,formatting:r}));H5.displayName="ConversionInput";const N1=e=>e?new Date(e):void 0,Dpt=e=>({departureTime:new Date(e.departure_time),arrivalTime:new Date(e.arrival_time),actualDepartureTime:N1(e.actual_departure_time),actualArrivalTime:N1(e.actual_arrival_time),estimatedDepartureTime:N1(e.estimated_departure_time),estimatedArrivalTime:N1(e.estimated_arrival_time)}),jpt=e=>!!(e.actualArrivalTime&&e.actualArrivalTime>e.arrivalTime||e.estimatedArrivalTime&&e.estimatedArrivalTime>e.arrivalTime),Ipt=e=>{if(e.length===0)return[];if(e.length===1)return[[e[0]]];const t=[...e].sort((o,a)=>new Date(o.departure_time).getTime()-new Date(a.departure_time).getTime()),n=[],r=t[0];if(!r)return[];let s=[r];for(let o=1;o0&&s.length==n[n.length-1]?.length&&n.push(s),n},ap=(e,t,n)=>{const r=zme({start:e,end:t}),s=r.days||0,o=r.hours||0,a=r.minutes||0;return s>0?o===0&&a===0?n({id:"sSynIO3ThU",defaultMessage:"{days}d"},{days:s}):a===0?n({id:"10cSZzeWte",defaultMessage:"{days}d {hours}h"},{days:s,hours:o}):n({id:"OWk1HjddEb",defaultMessage:"{days}d {hours}h {minutes}m"},{days:s,hours:o,minutes:a.toString().padStart(2,"0")}):o===0?n({id:"VvfhE21OJI",defaultMessage:"{minutes}m"},{minutes:a}):a===0?n({id:"unuVj1l7KW",defaultMessage:"{hours}h"},{hours:o}):n({id:"0Yp4jJ7rzm",defaultMessage:"{hours}h {minutes}m"},{hours:o,minutes:a.toString().padStart(2,"0")})},ace=A.memo(({flightMetadata:e,departureTime:t,arrivalTime:n,actualDepartureTime:r,actualArrivalTime:s,estimatedDepartureTime:o,estimatedArrivalTime:a,delayed:i=!1,rightContent:c})=>{const{$t:u}=J(),f=d.useMemo(()=>new Date,[]),{cancelled:m,diverted:p,status:h,flight_number:g,departure_city:y,departure_airport:x,arrival_airport:v,arrival_city:b}=e,_=r||o||t,w=s||a||n,S=d.useMemo(()=>ap(f,_,u),[f,_,u]),C=d.useMemo(()=>ap(_,f,u),[f,_,u]),E=d.useMemo(()=>ap(w,f,u),[f,w,u]),T=d.useMemo(()=>ap(f,w,u),[f,w,u]),k=_<=f,I=w<=f,M=d.useMemo(()=>I?u({id:"mtuHNb+mRc",defaultMessage:"Arrived {time} ago"},{time:E}):k?u({id:"b6q320RasU",defaultMessage:"Departed {time} ago"},{time:C}):u({id:"/JLglYfuNX",defaultMessage:"Departing in {time}"},{time:S}),[k,I,S,C,E,u]),N=d.useMemo(()=>m?u({id:"3wsVWFbC1x",defaultMessage:"Cancelled"}):p?u({id:"/N1ZeWQc8B",defaultMessage:"Diverted"}):h,[m,p,u,h]);return l.jsxs("div",{className:"gap-sm flex flex-col justify-between sm:flex-row",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"section-title",children:l.jsx(je,{id:"5KgWVKDR/R",defaultMessage:"{flightNumber} · {departureCity} ({departureAirport}) to {arrivalCity} ({arrivalAirport})",values:{flightNumber:g,departureCity:y,departureAirport:x,arrivalAirport:v,arrivalCity:b}})}),l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsxs(ga,{className:"gap-xs flex flex-row flex-wrap",children:[!m&&l.jsx(Bn,{id:"relative-departure-time",children:l.jsx(V,{variant:"smallBold",color:"light",children:M})}),k&&!I&&!m&&l.jsx(Bn,{id:"relative-arrival-time",children:l.jsx(V,{variant:"smallBold",color:"light",children:l.jsx(je,{id:"z8jWKRSOak",defaultMessage:"Arriving in {time}",values:{time:T}})})}),l.jsx(Bn,{id:"status",children:l.jsx(V,{variant:"smallBold",color:m||p||i?"negative":"super",children:N})})]})})]}),c]})});ace.displayName="FlightHeader";const R1={initial:{opacity:0,filter:"blur(2px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(2px)"},transition:{duration:.5,ease:qa}},L8=A.memo(({children:e,animationKey:t,...n})=>l.jsx(St,{mode:"popLayout",initial:!1,children:l.jsx(Te.div,{initial:R1.initial,animate:R1.animate,exit:R1.exit,transition:R1.transition,children:l.jsx(V,{...n,children:e})},t)}));L8.displayName="FlightTextSwitcher";const ice=A.memo(({terminal:e,gate:t,alignEnd:n})=>{const{$t:r}=J();return l.jsxs("div",{className:z("gap-lg flex w-full flex-row",n&&"justify-end"),children:[l.jsx(z5,{label:r({id:"GAHVEi8lHA",defaultMessage:"Terminal"}),value:e??"-"}),l.jsx(z5,{label:r({id:"W+gH70jajX",defaultMessage:"Gate"}),value:t??"-"})]})});ice.displayName="FlightTerminalGate";const z5=A.memo(({label:e,value:t})=>l.jsxs("div",{children:[l.jsx(V,{variant:"tinyMono",color:"light",children:e}),l.jsx(L8,{animationKey:t,variant:"entry-title-200",children:t})]}));z5.displayName="FlightAttribute";const D1={initial:{opacity:0,height:0,filter:"blur(2px)"},animate:{opacity:1,height:"auto",filter:"blur(0px)"},exit:{opacity:0,height:0,filter:"blur(2px)"},transition:{duration:.3,ease:Kr}},W5=A.memo(({time:e,actualTime:t,estimatedTime:n,timezone:r,terminal:s,gate:o,variant:a="departure",delayed:i=!1,cancelled:c=!1})=>{const{locale:u,$t:f}=J(),m=d.useMemo(()=>f(a==="departure"?{id:"BtqAemWTLK",defaultMessage:"Departure"}:{id:"WOIPGxfmZn",defaultMessage:"Arrival"}),[a,f]),p=a==="arrival",h=d.useMemo(()=>{const v=t||n;return v&&v.getTime()===e.getTime()?null:v},[t,n,e]),g=d.useMemo(()=>e.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:r}),[e,r,u]),y=d.useMemo(()=>h?.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:r}),[h,r,u]),x=d.useMemo(()=>e.toLocaleDateString(u,{weekday:"short",month:"short",day:"numeric",timeZone:r}),[e,r,u]);return l.jsxs("div",{className:"gap-md col-span-3 flex min-w-0 flex-col justify-between",children:[l.jsxs("div",{className:z("gap-sm flex flex-col",p&&"items-end"),children:[l.jsxs(V,{variant:"tinyMono",color:"default",className:"gap-sm flex flex-row whitespace-nowrap",children:[m,l.jsxs("span",{children:[" | ",x]})]}),l.jsxs("div",{className:z("flex flex-col",p&&"items-end"),children:[l.jsx(L8,{animationKey:g,as:"span",variant:"entry-title-200",color:i?"negative":"super",className:z("-translate-y-px !font-mono transition-colors duration-500",c&&"text-quiet line-through"),children:h?y:g}),l.jsx(St,{initial:!1,children:h&&l.jsx(Te.div,{initial:D1.initial,animate:D1.animate,exit:D1.exit,transition:D1.transition,className:"overflow-hidden",children:l.jsx(V,{as:"span",variant:h?"small":"entry-title-200",color:"super",className:z("-translate-y-px !font-mono",h&&"!text-quiet line-through"),children:g})})})]})]}),l.jsx(ice,{terminal:s,gate:o,alignEnd:p})]})});W5.displayName="FlightDepartureArrival";const Ppt=Te(K),lce=A.memo(({progress:e,departureTime:t,arrivalTime:n,delayed:r,cancelled:s,departureAirport:o,arrivalAirport:a})=>{const{$t:i}=J(),c=d.useMemo(()=>ap(t,n,i),[t,n,i]),u=d.useMemo(()=>e===void 0||s?0:Math.max(0,Math.min(100,e)),[e,s]),{left:f,width:m}=d.useMemo(()=>({left:`${u}%`,width:`${u}%`}),[u]),p=d.useMemo(()=>({left:0}),[]),h=d.useMemo(()=>({duration:2,ease:Kr,delay:.5}),[]),g=d.useMemo(()=>({left:f,opacity:1,scale:1}),[f]),y=d.useMemo(()=>({...p,opacity:0,scale:1.2,top:"50%",translateX:"-50%",translateY:"-50%"}),[p]),x=d.useMemo(()=>({width:m}),[m]);return l.jsx("div",{className:"px-xs order-last col-span-6 flex flex-col items-center justify-center sm:order-[unset] sm:px-0",children:l.jsxs("div",{className:"gap-md flex w-full flex-col items-center",children:[l.jsxs("div",{className:"gap-xs gap-x-2xl flex flex-row",children:[l.jsx(V,{variant:"entry-title-200",color:"default",className:"mr-md",children:o}),l.jsx(V,{variant:"tinyMono",color:"light",className:"line-clamp-1 whitespace-nowrap",children:c}),l.jsx(V,{variant:"entry-title-200",color:"default",className:"ml-md",children:a})]}),l.jsxs("div",{className:"relative flex w-full flex-1 items-center",children:[l.jsx("div",{className:"bg-inverse/10 relative h-0.5 w-full overflow-hidden rounded-full",children:l.jsx(Te.div,{className:"!bg-inverse/50 absolute inset-y-0 left-0 transition-colors duration-500",initial:p,animate:x,transition:h})}),l.jsx(Ppt,{variant:"raised",className:"absolute left-0 flex aspect-square w-6 items-center justify-center",initial:y,animate:g,transition:h,children:l.jsx(ge,{className:z("text-quiet transition-colors duration-500",e&&e>0&&!r&&"!text-super",r&&"!text-negative",s&&"!text-quiet"),icon:B("plane")})})]})]})})});lce.displayName="FlightProgress";const cce=A.memo(({departureTime:e,arrivalTime:t,actualDepartureTime:n,actualArrivalTime:r,estimatedDepartureTime:s,estimatedArrivalTime:o,flightMetadata:a,delayed:i=!1})=>{const{cancelled:c,departure_airport:u,arrival_airport:f,departure_timezone:m,arrival_timezone:p,terminal:h,gate:g,arrival_terminal:y,arrival_gate:x,progress_percent:v}=a;return l.jsxs(dr,{className:"p-md gap-md grid w-full grid-cols-2 overflow-hidden shadow-sm sm:grid-cols-12",children:[l.jsx(W5,{variant:"departure",time:e,actualTime:n,estimatedTime:s,timezone:m,terminal:h,gate:g,delayed:i,cancelled:c}),l.jsx(lce,{departureTime:e,arrivalTime:t,progress:v,delayed:i,cancelled:c,departureAirport:u,arrivalAirport:f}),l.jsx(W5,{variant:"arrival",time:t,actualTime:r,estimatedTime:o,timezone:p,terminal:y,gate:x,delayed:i,cancelled:c})]})});cce.displayName="FlightStatusCard";const uce=A.memo(({flights:e,selectedFlight:t,setSelectedFlight:n})=>{const{locale:r,$t:s}=J(),{isMobileStyle:o}=Re(),{formatDate:a}=J(),i=d.useCallback(f=>{const m=new Date(f.departure_time),p=VS(m,f.departure_timezone);let h;if(h=a(m,{dateStyle:"short"}),e.filter(y=>{if(y.departure_timezone!==f.departure_timezone)return!1;const x=VS(new Date(y.departure_time),y.departure_timezone);return x.year===p.year&&x.month===p.month&&x.date===p.date}).length>1){const y=m.toLocaleTimeString(r,{hour:"numeric",minute:"2-digit"});h=s({id:"Fr3TxQz4BU",defaultMessage:"{dateString} - {timeString}"},{dateString:h,timeString:y})}return h},[r,e,s,a]),c=d.useMemo(()=>e.map(f=>({type:"default",text:i(f),value:f.flight_aware_id,onClick:()=>n(f),active:f.flight_aware_id===t?.flight_aware_id})),[e,i,n,t?.flight_aware_id]),u=d.useMemo(()=>t?i(t):"",[t,i]);return l.jsx("div",{children:l.jsx(zs,{items:c,isMobileStyle:o,children:l.jsx(Ge,{variant:"border",text:u,chevron:!0,pill:!0})})})});uce.displayName="FlightStatusSwitcher";const dce=A.memo(({data:e})=>{const t=d.useMemo(()=>Ipt(e.data.flights),[e.data.flights]),n=d.useMemo(()=>{const i=new Date().getTime();if(t.length===0)return 0;let c=0,u=1/0;return t.forEach((f,m)=>{f.forEach(p=>{const h=new Date(p.departure_time).getTime(),g=Math.abs(h-i);g{if(t.length<2)return null;const i=t.map(c=>c[0]).filter(c=>!!c);return l.jsx(uce,{flights:i,selectedFlight:o?.[0],setSelectedFlight:c=>{const u=t.findIndex(f=>f[0]?.flight_aware_id===c?.flight_aware_id);u!==-1&&s(u)}})},[t,o]);return!o||o.length===0?null:l.jsx(Fn,{"data-testid":"flight-status-widget",className:"w-full",variant:"noChrome",children:l.jsx(Es,{widgetType:"flight",widgetName:"flight_status",widgetSize:"full",children:l.jsx("div",{className:"gap-md flex flex-col",children:o.map((i,c)=>{const u=Dpt(i),f=jpt(u),m=c===0?a:null;return l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(ace,{flightMetadata:i,departureTime:u.departureTime,arrivalTime:u.arrivalTime,actualDepartureTime:u.actualDepartureTime,actualArrivalTime:u.actualArrivalTime,estimatedDepartureTime:u.estimatedDepartureTime,estimatedArrivalTime:u.estimatedArrivalTime,delayed:f,rightContent:m}),l.jsx(cce,{departureTime:u.departureTime,arrivalTime:u.arrivalTime,actualDepartureTime:u.actualDepartureTime,actualArrivalTime:u.actualArrivalTime,estimatedDepartureTime:u.estimatedDepartureTime,estimatedArrivalTime:u.estimatedArrivalTime,flightMetadata:i,delayed:f})]},i.flight_aware_id)})})})})});dce.displayName="FlightStatusWidget";const fce=A.memo(({data:{title:e,text:t,image_url:n,canonical_pages:r}})=>{const{isMobileStyle:s}=Re();return l.jsx(yt,{href:r[0]?.url_web,children:l.jsxs(dr,{shadow:!0,className:"p-sm relative flex items-center md:p-[12px]",bgHover:"subtle",children:[l.jsxs(K,{className:"md:gap-md flex flex-1 items-center gap-[12px]",children:[n&&l.jsx("img",{alt:"",className:"max-h-[65px] rounded-md",src:n}),l.jsxs("div",{className:"mr-sm w-full",children:[e&&l.jsxs(V,{className:"text-pretty",variant:s?"smallBold":"baseSemi",children:[e,l.jsx(ge,{icon:B("chevron-right"),className:"text-quiet ml-0.5 inline-flex -translate-y-px md:hidden",size:"sm"})]}),t&&l.jsx(V,{variant:s?"tinyRegular":"small",color:"light",className:"mt-0.5 text-pretty md:mt-0",children:t})]})]}),l.jsx(ge,{icon:B("chevron-right"),className:"text-quiet hidden md:block",size:"md"})]})})});fce.displayName="GenericFallbackWidget";const Opt=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"finance-polymarket-trending-search",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},mB=250;function Lpt(e,t,n){const r=(t??"light")==="dark",s=e.filter(c=>!c.closedTime),o=e.filter(c=>!!c.closedTime).sort((c,u)=>{const f=c.closedTime?new Date(c.closedTime).getTime():0;return(u.closedTime?new Date(u.closedTime).getTime():0)-f}),a=[...s,...o].map((c,u)=>({...c,color:Hmt(u,r)})),i=a.filter(n);return{unifiedMarkets:a,chartMarkets:i}}function Fpt(e){return e&&e.length>0?new Set(e.map(t=>t.id)):void 0}function Bpt(){const{session:e}=Ne(),{variation:t}=Opt(!1,{userEmail:e?.user?.email??""});return t}const Upt=A.memo(({color:e,probability:t})=>l.jsx("div",{className:"bg-subtle relative h-1.5 w-full overflow-hidden rounded-full",children:l.jsx("div",{className:"absolute inset-y-0 left-0 h-full rounded-full",style:{boxShadow:"inset 0 0 0 1px rgba(255, 255, 255, 0.1)",backgroundColor:e,width:`${Math.max(0,t)}%`}})}));Upt.displayName="PredictionsProgressBar";const Vpt=A.memo(({probability:e,forceZeroLabel:t=!1})=>{const{locale:n}=J(),r=e===0?t?"0%":"<1%":(e/100).toLocaleString(n,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1});return l.jsx(V,{variant:"tiny",color:"light",className:"w-full max-w-[40px] text-left font-mono leading-tight",children:r})});Vpt.displayName="PredictionsProbability";const Hpt=e=>e>0?"-rotate-45":e<0?"rotate-45":"rotate-0",zpt=.001,G5=A.memo(({change:e,variant:t="active",resolvedDate:n=null,resolvedOutcome:r="positive"})=>{const{locale:s}=J();if(t==="resolved"){const o=n?new Date(n).toLocaleDateString(s,{month:"short",day:"numeric"}):void 0;return l.jsx(K,{className:"flex w-full items-center justify-center",children:o&&l.jsx(V,{as:"span",variant:"tiny",color:"light",className:"flex w-full items-center justify-center rounded bg-subtle px-[0.6em] py-[0.15em] font-mono",children:l.jsx("span",{className:"whitespace-nowrap",children:o})})})}return e===null||Math.abs(e)0?"super":"negative",className:z("flex w-full items-center justify-center gap-[0.1em] rounded px-[0.6em] py-[0.15em] font-mono",{"bg-positive/10":e>0,"bg-negative/10":e<0}),children:[l.jsx(ut,{name:B("arrow-right"),className:z("size-3 shrink-0 transition-transform duration-500 ease-in-out",Hpt(e),e>0?"text-super":"text-negative")}),l.jsx("span",{className:"whitespace-nowrap",children:e.toLocaleString(s,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1,signDisplay:"never"})})]})})});G5.displayName="PredictionsStatus";const mce=A.memo(({marketCount:e,provider:t,href:n,visibleMarketsCount:r})=>{const{$t:s}=J(),{isMobileStyle:o}=Re(),a=dW(t),i=r&&e>r?s({defaultMessage:"+{count} on {provider}",id:"aqcKaqAMBB"},{count:e-r,provider:a}):o||e<=2?a:s({defaultMessage:"View on {provider}",id:"x+8tBD0Kpk"},{provider:a});return l.jsx(qh,{href:n,target:"_blank",rel:"noopener",variant:"text",size:"tiny",children:l.jsx(V,{variant:"tinyRegular",color:"light",children:i})})});mce.displayName="PredictionsAttributionLink";const Wpt=["1h","6h","1d","1w","1m","max"],Gpt={"1h":W({id:"Ifw0lcjnAL",defaultMessage:"1H"}),"6h":W({id:"YkLVNm/W6Q",defaultMessage:"6H"}),"1d":W({id:"aTX7LJbdI3",defaultMessage:"1D"}),"1w":W({id:"6bJGds1heu",defaultMessage:"1W"}),"1m":W({id:"1uz/I31pXU",defaultMessage:"1M"}),max:W({id:"peV3nrWw/A",defaultMessage:"MAX"})},pce=A.memo(({endDate:e})=>{const{isMobileStyle:t}=Re(),{$t:n,locale:r}=J(),s=new Date(e){const{locale:o,$t:a}=J(),{isMobileStyle:i}=Re();return l.jsx(K,{className:"gap-md flex flex-col",children:l.jsxs(K,{className:"gap-sm flex items-start",children:[t&&l.jsx("img",{src:t,alt:e,className:"bg-subtler aspect-square size-10 shrink-0 rounded-md object-cover mt-xs"}),l.jsxs(K,{className:"min-w-0 flex-1",children:[l.jsx(V,{variant:i?"section-title":"page-title",className:"min-w-0 leading-tight",children:e}),l.jsxs(K,{className:"mt-xs flex flex-col items-stretch gap-xs md:flex-row md:gap-sm",children:[l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("coins"),className:"size-4"}),a({defaultMessage:"{volume} vol.",id:"fBnaWW/3DX"},{volume:n.toLocaleString(o,{style:r?"currency":void 0,currency:r??void 0,notation:"compact"})})]}),l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("clock"),className:"size-4"}),l.jsx(pce,{endDate:s})]})]})]})]})})});hce.displayName="PredictionsEventHeader";const gce=A.memo(({market:e,useColor:t=!1,showDot:n=!0,compactPadding:r=!1,className:s,showOutcomeName:o=!1})=>{const{locale:a}=J(),i=!!e.closedTime,c=i&&e.outcomes?e.outcomes[e.outcomePrices.indexOf(Math.max(...e.outcomePrices))]:void 0,u=e.probability<.001?"<0.1%":e.probability.toLocaleString(a,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}),f=Math.sqrt(e.probability),m=o&&e.outcomes?.length===2&&!i?`${e.question} (${e.outcomes[0]})`:e.question;return l.jsxs(K,{className:z("grid grid-cols-[minmax(0,1fr)_auto_56px] items-center gap-x-sm border-b border-subtlest py-sm",r?"px-md":"px-sm",s),children:[l.jsxs("div",{className:"flex items-center gap-sm",children:[n&&l.jsx("span",{className:z("size-2 shrink-0 rounded-full",{"border border-subtle":!t}),style:t?{backgroundColor:e.color}:void 0}),l.jsx(V,{variant:"small",color:e.emphasized?"super":r?"light":"default",className:"min-w-0 break-words",children:m})]}),l.jsx("div",{className:"flex items-center justify-end gap-xs",children:i?l.jsxs(l.Fragment,{children:[c&&l.jsx(V,{variant:"small",color:"default",children:c}),l.jsx(ut,{name:B(c?.toLowerCase()==="no"?"x":"check"),size:16,className:z("shrink-0",c?.toLowerCase()==="no"?"text-caution dark:text-rosa":"text-super")})]}):l.jsx(V,{variant:"smallBold",className:"whitespace-nowrap font-mono",style:{color:`color-mix(in oklch, oklch(var(--foreground-color)) ${f*100}%, oklch(var(--foreground-quiet-color)))`},children:u})}),l.jsx("div",{className:"flex items-center justify-center",children:i?l.jsx(G5,{change:null,variant:"resolved",resolvedDate:e.closedTime}):l.jsx(G5,{change:e.change,variant:"active"})})]})});gce.displayName="PredictionsMarketRow";const $pt=A.memo(({provider:e,variant:t="tiny"})=>l.jsx(V,{variant:t,color:"ultraLight",children:e}));$pt.displayName="ProviderText";const yce=A.memo(({updatedAt:e,useCompact:t=!1})=>{const n=J(),{$t:r}=n,{isMobileStyle:s}=Re(),o=d.useMemo(()=>jee(n,new Date(e),{style:"short",numeric:"auto"})||r({defaultMessage:"Now",id:"tgvES0v2HS"}),[e,n,r]);return l.jsxs(V,{variant:"tinyRegular",color:"light",className:"flex items-center gap-xs min-w-0",children:[(s||t)&&l.jsx(ut,{name:B("clock"),className:"size-3 shrink-0"}),l.jsx("span",{className:"truncate",children:s||t?o:r({defaultMessage:"Updated {date}",id:"vbMp1ubkut"},{date:o})})]})});yce.displayName="UpdatedAt";const qpt=A.memo(({volume:e,currency:t,compact:n=!1,hideIcon:r=!1})=>{const{locale:s,$t:o}=J(),{isMobileStyle:a}=Re();return l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[!r&&l.jsx(ut,{name:B("coins"),className:"size-4"}),o({defaultMessage:"{volume} vol.",id:"fBnaWW/3DX"},{volume:e.toLocaleString(s,{style:t?"currency":void 0,currency:t??void 0,notation:n||a?"compact":void 0})})]})});qpt.displayName="VolumeDisplay";const xce=A.memo(({markets:e,chartMarketIds:t,initialDisplayCount:n=5})=>{const[r,s]=d.useState(!1),{$t:o}=J(),{isMobileStyle:a}=Re(),i=e.length>n,c=d.useMemo(()=>{if(r)return e;const m=e.find(h=>h.emphasized);return(m?e.indexOf(m):-1)l.jsx(gce,{market:m,useColor:t?.has(m.id)??!1,showOutcomeName:f},m.id)),i&&l.jsx(l.Fragment,{children:a?l.jsx(K,{className:"mx-md my-sm",children:l.jsx(wt,{fullWidth:!0,size:"tiny",onClick:()=>s(!r),variant:"secondary",children:u})}):l.jsx(K,{className:"ml-sm mt-xs flex justify-start",children:l.jsx(wt,{size:"tiny",onClick:()=>s(!r),variant:"text",children:u})})})]})});xce.displayName="PredictionsMarkets";const Kpt=A.memo(({commentary:e,sourceUrls:t,variant:n="small",className:r})=>l.jsxs(V,{variant:n,className:r,children:[e,t?.flat().filter(Boolean).map((s,o)=>l.jsxs(A.Fragment,{children:[" ",l.jsx(NN,{url:s,href:s||void 0,linkBehavior:"external",className:"translate-y-half duration-quick -mt-1 inline-block uppercase transition-opacity"},o)]},o))]}));Kpt.displayName="CommentaryWithSources";const pB=50,Ypt=(e,t,n)=>{const r=new Date(e),s=new Date(t),o=r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()&&r.getDate()===s.getDate(),a=r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth(),i=r.getFullYear()===s.getFullYear();return o?c=>{const u=c.getMinutes()!==0;return c.toLocaleTimeString(n,{hour:"numeric",minute:u?"numeric":void 0})}:a?c=>c.toLocaleDateString(n,{month:"short",day:"numeric",hour:"numeric"}):i?c=>c.toLocaleDateString(n,{month:"short",day:"numeric"}):c=>c.toLocaleDateString(n,{year:"numeric",month:"short"})},Qpt=({x:e,y:t,color:n,r=4,animationId:s})=>l.jsxs("g",{children:[l.jsx(Te.circle,{cx:e,cy:t,r,fill:"none",stroke:n,strokeWidth:2,initial:{r,opacity:1},animate:{r:r*4,opacity:0},transition:{duration:1.5,ease:"easeOut"},style:{pointerEvents:"none"}},`${s}`),l.jsx("circle",{cx:e,cy:t,r,fill:n,stroke:"oklch(var(--background-color))",strokeWidth:2,style:{pointerEvents:"none"}})]}),Xpt=({data:e,animationId:t})=>e.map(n=>l.jsx(Qpt,{x:n.x,y:n.y,color:n.market.color,animationId:t},n.market.question)),Zpt=({data:e,locale:t,decimalPlaces:n=3})=>{const r=Math.max(0,n-2),s=e[0]?.timestamp,o=d.useMemo(()=>s?new Date(s).toLocaleDateString(t,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"}):null,[s,t]),a=e.length===1;return l.jsxs(K,{className:"space-y-xs px-sm py-xs",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:o}),e.map(i=>{const c=a&&i.market.outcomes?.length===2?i.market.outcomes[0]:i.market.question;return l.jsxs(K,{className:"gap-xs flex items-center",children:[l.jsx("div",{className:"size-2 rounded-full",style:{backgroundColor:i.market.color}}),l.jsxs(V,{variant:"tinyRegular",color:"default",children:[c,":"," ",i.data.probability.toLocaleString(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r})]})]},i.market.question)})]})},Jpt=Hg(e=>new Date(e.timestamp)).left,eht=(e,t,n)=>{if(!n?.length)return{d:null,index:0,x:e};const r=t.invert(e),s=Math.max(0,Math.min(Jpt(n,r),n.length-1)),o=n[s-1],a=n[s];let i=Math.max(0,s-1);if(o&&a){const u=Math.abs(t(new Date(a.timestamp))-e),f=Math.abs(t(new Date(o.timestamp))-e);u{const{tooltipData:s,hideTooltip:o,showTooltip:a}=Zb(),i=d.useCallback(c=>{const u=i0(c);if(!u)return;const f=XN(c),m=Math.min(Math.max(r[0],u.x),r[1]),p=e.map(h=>{if(!h.history)return null;const g=eht(m,t,h.history);return g.d?{market:h,data:g.d,x:t(new Date(g.d.timestamp))??0,y:n(g.d.probability),timestamp:g.d.timestamp}:null}).filter(h=>h!==null);p.length&&a({tooltipData:{hits:p,point:{local:{x:u.x,y:Math.max(0,u.y-xs)},global:f}}})},[e,t,n,a,r]);return d.useMemo(()=>({tooltipData:s,hideTooltip:o,showTooltip:i}),[s,o,i])},nht=({l:e,history:t,color:n})=>{const r=d.useMemo(()=>e(t),[e,t]),s=n_(r,!0,ii);return l.jsx(fa.path,{d:s,stroke:n,strokeWidth:1.75,fill:"none",shapeRendering:am})},vce=A.memo(({markets:e,width:t,height:n,updatedAt:r,uiHints:s,watermark:o})=>{const{locale:a}=J(),i=d.useMemo(()=>lm({domain:ko(e.flatMap(T=>T.history??[]),T=>new Date(T.timestamp)),range:[0,t-pB]}),[e,t]),c=d.useMemo(()=>{const T=s?.lowerBound,k=s?.upperBound;if(T!=null&&k!==void 0&&k!==null)return Bi({domain:[T,k],range:[n-xs,Rd]});const I=e.flatMap(R=>(R.history??[]).map(P=>P.probability));if(!I.length)return Bi({domain:[0,1],range:[n-xs,Rd]});const[M,N]=ko(I),D=(N-M)*.1,j=Math.max(0,M-D),F=Math.min(1,N+D);return Bi({domain:[j,F],range:[n-xs,Rd]})},[e,n,s]),u=d.useMemo(()=>sl().x(T=>i(new Date(T.timestamp))).y(T=>c(T.probability)).curve(Db),[i,c]),f=d.useMemo(()=>c.ticks(5).length>6?c.ticks(4).length>6?c.ticks(4).slice(1,-1):c.ticks(4):c.ticks(5),[c]),m=d.useMemo(()=>i.ticks(5),[i]),p=d.useMemo(()=>{const T=e.flatMap(N=>N.history??[]);if(!T.length)return N=>N.toLocaleDateString(a);const k=new Date(T[0].timestamp),I=new Date(T[T.length-1].timestamp),M=Ypt(k,I,a);return N=>M(N)},[e,a]),h=d.useMemo(()=>Gae({ticks:m,xScale:i,width:t,formatter:T=>p(T),marginRight:pB}),[m,i,t,p]),g=d.useCallback(()=>({fill:er.gray,fontSize:12,dy:"-5px",textAnchor:"end",fontFamily:"var(--font-family-sans)"}),[]),y=T=>{const k=T.toString(),I=k.indexOf(".");return I===-1?0:k.length-I-1},x=d.useCallback(T=>{const k=Math.max(...f.map(M=>y(M))),I=Math.max(0,k-2);return T.toLocaleString(a,{style:"percent",maximumFractionDigits:I,minimumFractionDigits:I})},[a,f]),v=d.useMemo(()=>`prediction-market-${e[0]?.question??"chart"}`,[e]),b=d.useMemo(()=>[0,t],[t]),{tooltipData:_,hideTooltip:w,showTooltip:S}=tht({markets:e,xScale:i,yScale:c,xBounds:b}),C=d.useMemo(()=>_?_.hits:e.map(T=>{const k=T.history?.[T.history.length-1];return k?{market:T,data:k,x:i(new Date(k.timestamp))??0,y:c(k.probability),timestamp:k.timestamp}:null}).filter(T=>T!==null),[_,e,i,c]),E=d.useMemo(()=>{const T=e.flatMap(k=>(k.history??[]).map(I=>I.probability));return T.length?T.reduce((k,I)=>Math.max(k,y(I)),0):2},[e]);return l.jsxs("div",{className:JN,onMouseMove:S,onMouseLeave:w,onTouchStart:S,onTouchMove:S,onTouchEnd:w,children:[l.jsxs("svg",{height:n,width:t,className:ZN,children:[l.jsx(St,{initial:!1,mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:jl,children:[l.jsx(bu,{tickValues:f,scale:c,width:t,stroke:er.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx($b,{scale:i,opacity:.1,height:n*2,stroke:er.gray,style:{transform:`translateY(-${n}px)`},tickValues:h,strokeWidth:1})]},v)}),l.jsx(St,{mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},exit:{opacity:0,transition:{duration:0,delay:0}},animate:{opacity:1},transition:jl,children:[l.jsx(zl,{scale:c,hideTicks:!0,hideAxisLine:!0,tickValues:f,left:t,orientation:"left",tickFormat:x,tickLabelProps:g}),l.jsx(zl,{scale:i,hideAxisLine:!0,hideTicks:!0,tickValues:h,tickFormat:p,orientation:"bottom",top:n-xs,tickLabelProps:t8})]},v)}),e.map(T=>l.jsx(nht,{l:u,history:T.history,color:T.color},T.question)),l.jsx(St,{children:_&&l.jsx(Jb,{marginTop:-n,tooltipLeft:_.point.local.x,innerHeight:n*3,color:er.gray})}),l.jsx(Xpt,{data:C,animationId:r})]}),o&&l.jsx("div",{className:"absolute -top-md left-sm z-[2]",children:o}),_&&l.jsx(Xl,{children:l.jsx(e_,{x:_.point.global.x,y:_.point.global.y,children:l.jsx(Zpt,{data:_.hits,locale:a,decimalPlaces:E})})})]})});vce.displayName="PredictionMarketChart";const bce=A.memo(({eventId:e,event:t,chartMarkets:n,periods:r,period:s,setPeriod:o})=>{const{isMobileStyle:a}=Re();return!n||n.length===0?null:l.jsxs(K,{className:"gap-y-sm relative flex flex-col justify-between overflow-hidden border-b",children:[l.jsx(K,{className:"z-[2] p-sm absolute inset-x-0 top-0 flex items-center justify-start",children:l.jsx(O8,{id:`prediction-market-${e}`,periods:r,period:s,setPeriod:o,variant:a?"sm":"lg"})}),l.jsx("div",{style:{paddingTop:Dh+16+20},className:"relative z-[1]",children:l.jsx(k8,{height:mB,render:!!t,minWidth:100,children:i=>i?l.jsx(vce,{period:s,updatedAt:t.updatedDate,markets:n,width:i,height:mB,uiHints:t.uiHints,watermark:l.jsx(Rh,{})}):null})})]})});bce.displayName="PredictionMarketChartWithControls";const hB=({href:e,eventId:t})=>{const{isMobileStyle:n}=Re(),{$t:r}=J(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(()=>{o("predictions link clicked",{referrer:Oot.PREDICTIONS_WIDGET,targetPageType:Lot.ASSET_PAGE,eventId:t,destinationUrl:e})},[o,t,e]);return l.jsx(K,{className:"gap-sm flex items-center justify-center",children:l.jsx(Ge,{variant:"primaryGhost",chevron:!0,chevronIcon:B("chevron-right"),text:r({defaultMessage:"Deep Dive on {pplxFinance}",id:"QX457HdJyA"},{pplxFinance:"Perplexity Finance"}),size:"small",href:e,onClick:a,fullWidth:n})})},rht=({event:e})=>{const{isMobileStyle:t}=Re();return t&&e.uiHints?.canonicalPage?.urlWeb?l.jsx(hB,{href:e.uiHints.canonicalPage.urlWeb,eventId:e.id}):l.jsxs(K,{className:"gap-xs pt-sm flex items-baseline justify-between",children:[l.jsx(yce,{updatedAt:e.updatedDate}),!!e.uiHints?.canonicalPage?.urlWeb&&l.jsx(hB,{href:e.uiHints.canonicalPage.urlWeb,eventId:e.id}),l.jsx(mce,{href:e.eventUrl,marketCount:e.markets?.length??0,provider:e.provider})]})},_ce=A.memo(({eventId:e,eventData:t})=>{const[n,r]=d.useState("max"),{$t:s}=J(),o=d.useMemo(()=>t?.uiHints?.emphasizedMarketIds??[],[t?.uiHints?.emphasizedMarketIds]),a={eventId:e,historyPeriod:n,marketsSort:"probability",emphasizedMarketIds:o},{data:i}=mt({queryKey:yKe(a),queryFn:()=>xKe(a),enabled:!!e,refetchInterval:h=>{const g=h.state.data,y=t?.uiHints?.refetchIntervalSecs??g?.uiHints?.refetchIntervalSecs;return y?y*1e3:!1},refetchIntervalInBackground:!1,placeholderData:h=>h||t,staleTime:0}),{colorScheme:c}=Ss(),{unifiedMarkets:u,chartMarkets:f}=d.useMemo(()=>i?.markets?Lpt(i.markets,c,h=>!h.closedTime&&!!(h.history&&h.history.length>0)):{unifiedMarkets:void 0,chartMarkets:void 0},[i?.markets,c]),m=d.useMemo(()=>(i?.uiHints?.periods??Wpt).map(h=>({value:h,text:s(Gpt[h])})),[i?.uiHints?.periods,s]),p=Bpt();return!i||!u||!p?null:l.jsxs(K,{className:"rounded-xl border",variant:"raised",children:[l.jsx(K,{className:"px-md py-sm",children:l.jsx(hce,{title:i.title,image:i.icon,volume:i.volume,currency:i.currency,endDate:i.endDate})}),l.jsx(bce,{eventId:e,event:i,chartMarkets:f,periods:m,period:n,setPeriod:r}),l.jsxs(K,{className:"px-md pb-sm pt-0",children:[u&&u.length>0&&l.jsx(xce,{markets:u,chartMarketIds:Fpt(f)}),l.jsx(rht,{event:i})]})]})});_ce.displayName="PredictionsEvent";const wce=A.memo(({data:e})=>l.jsx(Dme,{fallback:null,children:l.jsx(Es,{widgetType:"predictions",widgetName:"prediction_market",widgetSize:"full",children:l.jsx(_ce,{eventId:e.id,eventData:e})})}));wce.displayName="PredictionMarketWidget";const Za={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Cce=Object.create(null);for(const e in Za)Object.hasOwn(Za,e)&&(Cce[Za[e]]=e);const Er={to:{},get:{}};Er.get=function(e){const t=e.slice(0,3).toLowerCase();let n,r;switch(t){case"hsl":{n=Er.get.hsl(e),r="hsl";break}case"hwb":{n=Er.get.hwb(e),r="hwb";break}default:{n=Er.get.rgb(e),r="rgb";break}}return n?{model:r,value:n}:null};Er.get.rgb=function(e){if(!e)return null;const t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,s=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^(\w+)$/;let a=[0,0,0,1],i,c,u;if(i=e.match(n)){for(u=i[2],i=i[1],c=0;c<3;c++){const f=c*2;a[c]=Number.parseInt(i.slice(f,f+2),16)}u&&(a[3]=Number.parseInt(u,16)/255)}else if(i=e.match(t)){for(i=i[1],u=i[3],c=0;c<3;c++)a[c]=Number.parseInt(i[c]+i[c],16);u&&(a[3]=Number.parseInt(u+u,16)/255)}else if(i=e.match(r)){for(c=0;c<3;c++)a[c]=Number.parseInt(i[c+1],10);i[4]&&(a[3]=i[5]?Number.parseFloat(i[4])*.01:Number.parseFloat(i[4]))}else if(i=e.match(s)){for(c=0;c<3;c++)a[c]=Math.round(Number.parseFloat(i[c+1])*2.55);i[4]&&(a[3]=i[5]?Number.parseFloat(i[4])*.01:Number.parseFloat(i[4]))}else return(i=e.match(o))?i[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Za,i[1])?(a=Za[i[1]],a[3]=1,a):null:null;for(c=0;c<3;c++)a[c]=Il(a[c],0,255);return a[3]=Il(a[3],0,1),a};Er.get.hsl=function(e){if(!e)return null;const t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),s=(Number.parseFloat(n[1])%360+360)%360,o=Il(Number.parseFloat(n[2]),0,100),a=Il(Number.parseFloat(n[3]),0,100),i=Il(Number.isNaN(r)?1:r,0,1);return[s,o,a,i]}return null};Er.get.hwb=function(e){if(!e)return null;const t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),s=(Number.parseFloat(n[1])%360+360)%360,o=Il(Number.parseFloat(n[2]),0,100),a=Il(Number.parseFloat(n[3]),0,100),i=Il(Number.isNaN(r)?1:r,0,1);return[s,o,a,i]}return null};Er.to.hex=function(...e){return"#"+j1(e[0])+j1(e[1])+j1(e[2])+(e[3]<1?j1(Math.round(e[3]*255)):"")};Er.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Er.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};Er.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Er.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};Er.to.keyword=function(...e){return Cce[e.slice(0,3)]};function Il(e,t,n){return Math.min(Math.max(t,e),n)}function j1(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}const Sce={};for(const e of Object.keys(Za))Sce[Za[e]]=e;const Ye={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Ui=(6/29)**3;function jd(e){const t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Id(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(Ye)){if(!("channels"in Ye[e]))throw new Error("missing channels property: "+e);if(!("labels"in Ye[e]))throw new Error("missing channel labels property: "+e);if(Ye[e].labels.length!==Ye[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=Ye[e];delete Ye[e].channels,delete Ye[e].labels,Object.defineProperty(Ye[e],"channels",{value:t}),Object.defineProperty(Ye[e],"labels",{value:n})}Ye.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=o-s;let i,c;switch(o){case s:{i=0;break}case t:{i=(n-r)/a;break}case n:{i=2+(r-t)/a;break}case r:{i=4+(t-n)/a;break}}i=Math.min(i*60,360),i<0&&(i+=360);const u=(s+o)/2;return o===s?c=0:u<=.5?c=a/(o+s):c=a/(2-o-s),[i,c*100,u*100]};Ye.rgb.hsv=function(e){let t,n,r,s,o;const a=e[0]/255,i=e[1]/255,c=e[2]/255,u=Math.max(a,i,c),f=u-Math.min(a,i,c),m=function(p){return(u-p)/6/f+1/2};if(f===0)s=0,o=0;else{switch(o=f/u,t=m(a),n=m(i),r=m(c),u){case a:{s=r-n;break}case i:{s=1/3+t-r;break}case c:{s=2/3+n-t;break}}s<0?s+=1:s>1&&(s-=1)}return[s*360,o*100,u*100]};Ye.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const s=Ye.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[s,o*100,r*100]};Ye.rgb.oklab=function(e){const t=Id(e[0]/255),n=Id(e[1]/255),r=Id(e[2]/255),s=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),i=.2104542553*s+.793617785*o-.0040720468*a,c=1.9779984951*s-2.428592205*o+.4505937099*a,u=.0259040371*s+.7827717662*o-.808675766*a;return[i*100,c*100,u*100]};Ye.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(1-t,1-n,1-r),o=(1-t-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,i=(1-r-s)/(1-s)||0;return[o*100,a*100,i*100,s*100]};function sht(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Ye.rgb.keyword=function(e){const t=Sce[e];if(t)return t;let n=Number.POSITIVE_INFINITY,r;for(const s of Object.keys(Za)){const o=Za[s],a=sht(e,o);aUi?n**(1/3):7.787*n+16/116,r=r>Ui?r**(1/3):7.787*r+16/116,s=s>Ui?s**(1/3):7.787*s+16/116;const o=116*r-16,a=500*(n-r),i=200*(r-s);return[o,a,i]};Ye.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let s,o;if(n===0)return o=r*255,[o,o,o];const a=r<.5?r*(1+n):r+n-r*n,i=2*r-a,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?o=i+(a-i)*6*s:2*s<1?o=a:3*s<2?o=i+(a-i)*(2/3-s)*6:o=i,c[u]=o*255;return c};Ye.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,s=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,s*=o<=1?o:2-o;const a=(r+n)/2,i=r===0?2*s/(o+s):2*n/(r+n);return[t,i*100,a*100]};Ye.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const s=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),i=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,s){case 0:return[r,c,a];case 1:return[i,r,a];case 2:return[a,r,c];case 3:return[a,i,r];case 4:return[c,a,r];case 5:return[r,a,i]}};Ye.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,s=Math.max(r,.01);let o,a;a=(2-n)*r;const i=(2-n)*s;return o=n*s,o/=i<=1?i:2-i,o=o||0,a/=2,[t,o*100,a*100]};Ye.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const s=n+r;let o;s>1&&(n/=s,r/=s);const a=Math.floor(6*t),i=1-r;o=6*t-a,(a&1)!==0&&(o=1-o);const c=n+o*(i-n);let u,f,m;switch(a){default:case 6:case 0:{u=i,f=c,m=n;break}case 1:{u=c,f=i,m=n;break}case 2:{u=n,f=i,m=c;break}case 3:{u=n,f=c,m=i;break}case 4:{u=c,f=n,m=i;break}case 5:{u=i,f=n,m=c;break}}return[u*255,f*255,m*255]};Ye.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=e[3]/100,o=1-Math.min(1,t*(1-s)+s),a=1-Math.min(1,n*(1-s)+s),i=1-Math.min(1,r*(1-s)+s);return[o*255,a*255,i*255]};Ye.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let s,o,a;return s=t*3.2404542+n*-1.5371385+r*-.4985314,o=t*-.969266+n*1.8760108+r*.041556,a=t*.0556434+n*-.2040259+r*1.0572252,s=jd(s),o=jd(o),a=jd(a),[s*255,o*255,a*255]};Ye.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>Ui?t**(1/3):7.787*t+16/116,n=n>Ui?n**(1/3):7.787*n+16/116,r=r>Ui?r**(1/3):7.787*r+16/116;const s=116*n-16,o=500*(t-n),a=200*(n-r);return[s,o,a]};Ye.xyz.oklab=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),o=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),a=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r),i=.2104542553*s+.793617785*o-.0040720468*a,c=1.9779984951*s-2.428592205*o+.4505937099*a,u=.0259040371*s+.7827717662*o-.808675766*a;return[i*100,c*100,u*100]};Ye.oklab.oklch=function(e){return Ye.lab.lch(e)};Ye.oklab.xyz=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=(.999999998*t+.396337792*n+.215803758*r)**3,o=(1.000000008*t-.105561342*n-.063854175*r)**3,a=(1.000000055*t-.089484182*n-1.291485538*r)**3,i=1.227013851*s-.55779998*o+.281256149*a,c=-.040580178*s+1.11225687*o-.071676679*a,u=-.076381285*s-.421481978*o+1.58616322*a;return[i*100,c*100,u*100]};Ye.oklab.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=(t+.3963377774*n+.2158037573*r)**3,o=(t-.1055613458*n-.0638541728*r)**3,a=(t-.0894841775*n-1.291485548*r)**3,i=jd(4.0767416621*s-3.3077115913*o+.2309699292*a),c=jd(-1.2684380046*s+2.6097574011*o-.3413193965*a),u=jd(-.0041960863*s-.7034186147*o+1.707614701*a);return[i*255,c*255,u*255]};Ye.oklch.oklab=function(e){return Ye.lch.lab(e)};Ye.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let s,o,a;o=(t+16)/116,s=n/500+o,a=o-r/200;const i=o**3,c=s**3,u=a**3;return o=i>Ui?i:(o-16/116)/7.787,s=c>Ui?c:(s-16/116)/7.787,a=u>Ui?u:(a-16/116)/7.787,s*=95.047,o*=100,a*=108.883,[s,o,a]};Ye.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let s;s=Math.atan2(r,n)*360/2/Math.PI,s<0&&(s+=360);const a=Math.sqrt(n*n+r*r);return[t,a,s]};Ye.lch.lab=function(e){const t=e[0],n=e[1],s=e[2]/360*2*Math.PI,o=n*Math.cos(s),a=n*Math.sin(s);return[t,o,a]};Ye.rgb.ansi16=function(e,t=null){const[n,r,s]=e;let o=t===null?Ye.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let a=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(a+=60),a};Ye.hsv.ansi16=function(e){return Ye.rgb.ansi16(Ye.hsv.rgb(e),e[2])};Ye.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t>>4===n>>4&&n>>4===r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};Ye.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(Math.trunc(e>50)+1)*.5,r=(t&1)*n*255,s=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,s,o]};Ye.ansi256.rgb=function(e){if(e=e[0],e>=232){const o=(e-232)*10+8;return[o,o,o]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,s=t%6/5*255;return[n,r,s]};Ye.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};Ye.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(i=>i+i).join(""));const r=Number.parseInt(n,16),s=r>>16&255,o=r>>8&255,a=r&255;return[s,o,a]};Ye.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),a=s-o;let i;const c=a<1?o/(1-a):0;return a<=0?i=0:s===t?i=(n-r)/a%6:s===n?i=2+(r-t)/a:i=4+(t-n)/a,i/=6,i%=1,[i*360,a*100,c*100]};Ye.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let s=0;return r<1&&(s=(n-.5*r)/(1-r)),[e[0],r*100,s*100]};Ye.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let s=0;return r<1&&(s=(n-r)/(1-r)),[e[0],r*100,s*100]};Ye.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const s=[0,0,0],o=t%1*6,a=o%1,i=1-a;let c=0;switch(Math.floor(o)){case 0:{s[0]=1,s[1]=a,s[2]=0;break}case 1:{s[0]=i,s[1]=1,s[2]=0;break}case 2:{s[0]=0,s[1]=1,s[2]=a;break}case 3:{s[0]=0,s[1]=i,s[2]=1;break}case 4:{s[0]=a,s[1]=0,s[2]=1;break}default:s[0]=1,s[1]=0,s[2]=i}return c=(1-n)*r,[(n*s[0]+c)*255,(n*s[1]+c)*255,(n*s[2]+c)*255]};Ye.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let s=0;return r>0&&(s=t/r),[e[0],s*100,r*100]};Ye.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let s=0;return r>0&&r<.5?s=t/(2*r):r>=.5&&r<1&&(s=t/(2*(1-r))),[e[0],s*100,r*100]};Ye.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};Ye.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,s=r-t;let o=0;return s<1&&(o=(r-s)/(1-s)),[e[0],s*100,o*100]};Ye.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ye.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ye.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ye.gray.hsl=function(e){return[0,0,e[0]]};Ye.gray.hsv=Ye.gray.hsl;Ye.gray.hwb=function(e){return[0,100,e[0]]};Ye.gray.cmyk=function(e){return[0,0,0,e[0]]};Ye.gray.lab=function(e){return[e[0],0,0]};Ye.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r};Ye.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function oht(){const e={},t=Object.keys(Ye);for(let{length:n}=t,r=0;r0;){const r=n.pop(),s=Object.keys(Ye[r]);for(let{length:o}=s,a=0;a1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function fht(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const s=e(n);if(typeof s=="object")for(let{length:o}=s,a=0;a0){this.model=t||"rgb",r=Or[this.model].channels;const s=Array.prototype.slice.call(e,0,r);this.color=K5(s,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const o=s.sort().join("");if(!(o in $5))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$5[o];const{labels:a}=Or[this.model],i=[];for(n=0;n(e%360+360)%360),saturationl:rr("hsl",1,wr(100)),lightness:rr("hsl",2,wr(100)),saturationv:rr("hsv",1,wr(100)),value:rr("hsv",2,wr(100)),chroma:rr("hcg",1,wr(100)),gray:rr("hcg",2,wr(100)),white:rr("hwb",1,wr(100)),wblack:rr("hwb",2,wr(100)),cyan:rr("cmyk",0,wr(100)),magenta:rr("cmyk",1,wr(100)),yellow:rr("cmyk",2,wr(100)),black:rr("cmyk",3,wr(100)),x:rr("xyz",0,wr(95.047)),y:rr("xyz",1,wr(100)),z:rr("xyz",2,wr(108.833)),l:rr("lab",0,wr(100)),a:rr("lab",1),b:rr("lab",2),keyword(e){return e!==void 0?new Kn(e):Or[this.model].keyword(this.color)},hex(e){return e!==void 0?new Kn(e):Er.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new Kn(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),Er.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const s=r/255;t[n]=s<=.04045?s/12.92:((s+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return Kn.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),s=t===void 0?.5:t,o=2*s-1,a=n.alpha()-r.alpha(),i=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,c=1-i;return Kn.rgb(i*n.red()+c*r.red(),i*n.green()+c*r.green(),i*n.blue()+c*r.blue(),n.alpha()*s+r.alpha()*(1-s))}};for(const e of Object.keys(Or)){if(Ece.includes(e))continue;const{channels:t}=Or[e];Kn.prototype[e]=function(...n){return this.model===e?new Kn(this):n.length>0?new Kn(n,e):new Kn([...hht(Or[this.model][e].raw(this.color)),this.valpha],e)},Kn[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=K5(n,t)),new Kn(r,e)}}function mht(e,t){return Number(e.toFixed(t))}function pht(e){return function(t){return mht(t,e)}}function rr(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(q5[r]||=[])[t]=n;return e=e[0],function(r){let s;return r!==void 0?(n&&(r=n(r)),s=this[e](),s.color[t]=r,s):(s=this[e]().color[t],n&&(s=n(s)),s)}}function wr(e){return function(t){return Math.max(0,Math.min(e,t))}}function hht(e){return Array.isArray(e)?e:[e]}function K5(e,t){for(let n=0;nght.includes(e);function yht(e,t){return t.find(n=>String(n.teamId)===String(e))}const xht=e=>{switch(e){case"nba":case"wnba":case"ncaam":case"ncaaw":case"mlb":case"atp":case"wta":case"championsleague":case"laliga":case"ligue1":case"epl":case"bundesliga":return"/static/images/sports/nba/logos/nba-logo-generic.png";case"nfl":return"/static/images/sports/nfl/logos/nfl-logo-generic.png";case"ipl":case"cricket":case"icc":return"/static/images/sports/cricket/logos/cricket-logo-generic.png";default:return""}},vht="#64645F";function bht(e,t,n){const r={teamId:e,logo:xht(n),color:vht};return yht(e,t)??r}var Wm={},gB;function c0(){if(gB)return Wm;gB=1,Wm.__esModule=!0,Wm.default=void 0;var e={top:"top",left:"left",right:"right",bottom:"bottom"};return Wm.default=e,Wm}var _ht=c0();const wht=uo(_ht);function I1(e,t,n,r,s){var o;switch(e){case"center":return s;case"min":return n??0;case"max":return r??0;case"outside":default:return(o=(t??0)=0)&&(y[v]=h[v]);return y}function p(h){var g=h.top,y=g===void 0?0:g,x=h.left,v=x===void 0?0:x,b=h.scale,_=h.width,w=h.stroke,S=w===void 0?"#eaf0f6":w,C=h.strokeWidth,E=C===void 0?1:C,T=h.strokeDasharray,k=h.className,I=h.children,M=h.numTicks,N=M===void 0?10:M,D=h.lineStyle,j=h.offset,F=h.tickValues,R=m(h,c),P=F??(0,a.getTicks)(b,N),L=(j??0)+(0,i.default)(b)/2,U=P.map(function(O,$){var G,H=((G=(0,a.coerceNumber)(b(O)))!=null?G:0)+L;return{index:$,from:new o.Point({x:0,y:H}),to:new o.Point({x:_,y:H})}});return t.default.createElement(s.Group,{className:(0,n.default)("visx-rows",k),top:y,left:v},I?I({lines:U}):U.map(function(O){var $=O.from,G=O.to,H=O.index;return t.default.createElement(r.default,f({key:"row-line-"+H,from:$,to:G,stroke:S,strokeWidth:E,strokeDasharray:T,style:D},R))}))}return p.propTypes={tickValues:e.default.array,width:e.default.number.isRequired},H1}var Bht=Fht();const Uht=uo(Bht);var Vht=["scale","lines","animationTrajectory","animateXOrY","lineKey","lineStyle"];function ax(){return ax=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(t){const o=t.querySelectorAll(".visx-axis-tick"),a=Array.from(o).map(i=>{const{width:c,height:u}=i.getBBox();return[c,u]});if(a.length){const i=Math.max(...a.map(u=>u[0])),c=Math.max(...a.map(u=>u[1]));return[i,c,a.length*i]}}return[0,0,0]},[t]);return d.useMemo(()=>({minRequiredWidth:s,maxLabelWidth:n,maxLabelHeight:r}),[r,n,s])}function s_(){const e=d.useRef(null),{maxLabelWidth:t,minRequiredWidth:n}=TB({ref:e}),r=d.useRef(null),{maxLabelWidth:s}=TB({ref:r});return d.useMemo(()=>({xAxisRef:e,yAxisRef:r,maxXLabelWidth:t,maxYLabelWidth:s,minXRequiredWidth:n}),[t,s,n])}const AB=40,AS=e=>typeof e=="number";function o_({config:e,innerWidth:t,innerHeight:n,maxXLabelWidth:r}){let s=Math.floor(t/(r+AB));AS(e?.x?.numTicks)&&AS(s)&&(s=Math.min(s,e.x.numTicks)),r||(s=void 0);let o=Math.floor(n/AB);return AS(e?.y?.numTicks)&&(o=Math.min(o,e.y.numTicks)),{xTiltTicks:!1,xNumTicks:s,yNumTicks:o}}const jce="fill-quiet font-mono text-xs font-bold truncate max-w-[100px]",NB="fill-quiet text-xs font-semibold font-sans",Ght=(e,t,n)=>n?{transform:"rotate(-10deg)",transformOrigin:`${e}px ${t}px`,textAnchor:"end"}:{textAnchor:"middle"};function $ht(e){const{shouldTilt:t,x:n,y:r,formattedValue:s,style:o,className:a,...i}=e;return l.jsx("text",{...i,x:n,y:r,dy:"2px",className:z(jce,a),style:{...o,...Ght(n,r,t)},children:s})}const u0=A.memo(function(t){const{margin:n,height:r,width:s,xScale:o,yScale:a,xFormat:i,yFormat:c,yNumTicks:u,xNumTicks:f,xTickValues:m,yTickValues:p,xTiltTicks:h,animated:g,tickColor:y,axisColor:x,xAxisRef:v,yAxisRef:b,xAxisLabel:_,yAxisLabel:w,gridDashed:S=!1,gridStrokeWidth:C=.5}=t,E=mi(),T=g?Oht:zl,k=g?Dce:bu,I=d.useCallback(N=>l.jsx($ht,{...N,shouldTilt:h}),[h]),M=d.useMemo(()=>({className:jce,textAnchor:"start",dx:"0.75em",dy:"-0.25em"}),[]);return l.jsxs(l.Fragment,{children:[l.jsx(zl,{orientation:eo.bottom,top:r-n.bottom,scale:o,stroke:x,hideAxisLine:!0,label:_,labelClassName:NB,tickFormat:i,numTicks:f,tickStroke:y,innerRef:v,tickValues:m,tickComponent:I,axisClassName:"select-none"}),l.jsx(T,{orientation:eo.left,left:n.left,hideAxisLine:!0,label:w,labelOffset:7.5,labelClassName:NB,scale:a,tickFormat:c,stroke:x,tickStroke:y,hideTicks:!0,innerRef:b,tickLabelProps:M,numTicks:u,tickValues:p,axisClassName:"select-none"}),E&&l.jsx(k,{left:n.left,scale:a,width:s-n.right-n.left*2,strokeDasharray:S?"8,4":void 0,stroke:x,strokeWidth:C,numTicks:u})]})});u0.displayName="Axes";const Ice=A.memo(({color:e})=>l.jsx("div",{className:"size-[14px] rounded-full",style:{backgroundColor:e}}));Ice.displayName="Tile";const d0=A.memo(({entries:e})=>l.jsx("ol",{className:"my-sm gap-x-md gap-y-xs flex flex-wrap",children:e.map(({key:t,color:n})=>l.jsxs("li",{className:"gap-xs fade-in flex items-center transition-all duration-200",children:[l.jsx(Ice,{color:n}),l.jsx(V,{variant:"tiny",color:"light",children:String(t)})]},String(t)))}));d0.displayName="Legend";const f0=A.memo(({width:e,height:t,children:n,ref:r})=>{const s=d.useMemo(()=>({position:"relative",height:t,overflow:"visible"}),[t]);return l.jsx(K,{style:s,children:l.jsx("svg",{width:e,ref:r,height:t,style:{position:"absolute",left:0,top:0,overflow:"visible"},children:n})})});f0.displayName="Svg";function RB(e){return function(){return e}}function qht(e){return e[0]}function Kht(e){return e[1]}function ix(){this._=null}function a_(e){e.U=e.C=e.L=e.R=e.P=e.N=null}ix.prototype={constructor:ix,insert:function(e,t){var n,r,s;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=DB(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)r=n.U,n===r.L?(s=r.R,s&&s.C?(n.C=s.C=!1,r.C=!0,e=r):(e===n.R&&(Gm(this,n),e=n,n=e.U),n.C=!1,r.C=!0,$m(this,r))):(s=r.L,s&&s.C?(n.C=s.C=!1,r.C=!0,e=r):(e===n.L&&($m(this,n),e=n,n=e.U),n.C=!1,r.C=!0,Gm(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,s=e.R,o,a;if(r?s?o=DB(s):o=r:o=s,t?t.L===e?t.L=o:t.R=o:this._=o,r&&s?(a=o.C,o.C=e.C,o.L=r,r.U=o,o!==s?(t=o.U,o.U=e.U,e=o.R,t.L=e,o.R=s,s.U=o):(o.U=t,t=o,e=o.R)):(a=e.C,e=o),e&&(e.U=t),!a){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(n=t.R,n.C&&(n.C=!1,t.C=!0,Gm(this,t),n=t.R),n.L&&n.L.C||n.R&&n.R.C){(!n.R||!n.R.C)&&(n.L.C=!1,n.C=!0,$m(this,n),n=t.R),n.C=t.C,t.C=n.R.C=!1,Gm(this,t),e=this._;break}}else if(n=t.L,n.C&&(n.C=!1,t.C=!0,$m(this,t),n=t.L),n.L&&n.L.C||n.R&&n.R.C){(!n.L||!n.L.C)&&(n.R.C=!1,n.C=!0,Gm(this,n),n=t.L),n.C=t.C,t.C=n.L.C=!1,$m(this,t),e=this._;break}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}}};function Gm(e,t){var n=t,r=t.R,s=n.U;s?s.L===n?s.L=r:s.R=r:e._=r,r.U=s,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function $m(e,t){var n=t,r=t.L,s=n.U;s?s.L===n?s.L=r:s.R=r:e._=r,r.U=s,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function DB(e){for(;e.L;)e=e.L;return e}function ip(e,t,n,r){var s=[null,null],o=rs.push(s)-1;return s.left=e,s.right=t,n&&lx(s,e,t,n),r&&lx(s,t,e,r),to[e.index].halfedges.push(o),to[t.index].halfedges.push(o),s}function qm(e,t,n){var r=[t,n];return r.left=e,r}function lx(e,t,n,r){!e[0]&&!e[1]?(e[0]=r,e.left=t,e.right=n):e.left===n?e[1]=r:e[0]=r}function Yht(e,t,n,r,s){var o=e[0],a=e[1],i=o[0],c=o[1],u=a[0],f=a[1],m=0,p=1,h=u-i,g=f-c,y;if(y=t-i,!(!h&&y>0)){if(y/=h,h<0){if(y0){if(y>p)return;y>m&&(m=y)}if(y=r-i,!(!h&&y<0)){if(y/=h,h<0){if(y>p)return;y>m&&(m=y)}else if(h>0){if(y0)){if(y/=g,g<0){if(y0){if(y>p)return;y>m&&(m=y)}if(y=s-c,!(!g&&y<0)){if(y/=g,g<0){if(y>p)return;y>m&&(m=y)}else if(g>0){if(y0)&&!(p<1)||(m>0&&(e[0]=[i+m*h,c+m*g]),p<1&&(e[1]=[i+p*h,c+p*g])),!0}}}}}function Qht(e,t,n,r,s){var o=e[1];if(o)return!0;var a=e[0],i=e.left,c=e.right,u=i[0],f=i[1],m=c[0],p=c[1],h=(u+m)/2,g=(f+p)/2,y,x;if(p===f){if(h=r)return;if(u>m){if(!a)a=[h,n];else if(a[1]>=s)return;o=[h,s]}else{if(!a)a=[h,s];else if(a[1]1)if(u>m){if(!a)a=[(n-x)/y,n];else if(a[1]>=s)return;o=[(s-x)/y,s]}else{if(!a)a=[(s-x)/y,s];else if(a[1]=r)return;o=[r,y*r+x]}else{if(!a)a=[r,y*r+x];else if(a[0]_n||Math.abs(o[0][1]-o[1][1])>_n))&&delete rs[s]}function Zht(e){return to[e.index]={site:e,halfedges:[]}}function Jht(e,t){var n=e.site,r=t.left,s=t.right;return n===s&&(s=r,r=n),s?Math.atan2(s[1]-r[1],s[0]-r[0]):(n===r?(r=t[1],s=t[0]):(r=t[0],s=t[1]),Math.atan2(r[0]-s[0],s[1]-r[1]))}function Pce(e,t){return t[+(t.left!==e.site)]}function egt(e,t){return t[+(t.left===e.site)]}function tgt(){for(var e=0,t=to.length,n,r,s,o;e_n||Math.abs(x-h)>_n)&&(u.splice(c,0,rs.push(qm(i,g,Math.abs(y-e)<_n&&r-x>_n?[e,Math.abs(p-e)<_n?h:r]:Math.abs(x-r)<_n&&n-y>_n?[Math.abs(h-r)<_n?p:n,r]:Math.abs(y-n)<_n&&x-t>_n?[n,Math.abs(p-n)<_n?h:t]:Math.abs(x-t)<_n&&y-e>_n?[Math.abs(h-t)<_n?p:e,t]:null))-1),++f);f&&(v=!1)}if(v){var b,_,w,S=1/0;for(o=0,v=null;o=-1e-12)){var h=c*c+u*u,g=f*f+m*m,y=(m*h-u*g)/p,x=(c*g-f*h)/p,v=Oce.pop()||new rgt;v.arc=e,v.site=s,v.x=y+a,v.y=(v.cy=x+i)+Math.sqrt(y*y+x*x),e.circle=v;for(var b=null,_=Uh._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x)if(_.L)_=_.L;else{b=_.P;break}else if(_.R)_=_.R;else{b=_;break}Uh.insert(b,v),b||(U8=v)}}}}function Pd(e){var t=e.circle;t&&(t.P||(U8=t.N),Uh.remove(t),Oce.push(t),a_(t),e.circle=null)}var Lce=[];function sgt(){a_(this),this.edge=this.site=this.circle=null}function jB(e){var t=Lce.pop()||new sgt;return t.site=e,t}function NS(e){Pd(e),Od.remove(e),Lce.push(e),a_(e)}function ogt(e){var t=e.circle,n=t.x,r=t.cy,s=[n,r],o=e.P,a=e.N,i=[e];NS(e);for(var c=o;c.circle&&Math.abs(n-c.circle.x)<_n&&Math.abs(r-c.circle.cy)<_n;)o=c.P,i.unshift(c),NS(c),c=o;i.unshift(c),Pd(c);for(var u=a;u.circle&&Math.abs(n-u.circle.x)<_n&&Math.abs(r-u.circle.cy)<_n;)a=u.N,i.push(u),NS(u),u=a;i.push(u),Pd(u);var f=i.length,m;for(m=1;m_n)i=i.L;else if(a=t-igt(i,n),a>_n){if(!i.R){r=i;break}i=i.R}else{o>-_n?(r=i.P,s=i):a>-_n?(r=i,s=i.N):r=s=i;break}Zht(e);var c=jB(e);if(Od.insert(r,c),!(!r&&!s)){if(r===s){Pd(r),s=jB(r.site),Od.insert(c,s),c.edge=s.edge=ip(r.site,c.site),gd(r),gd(s);return}if(!s){c.edge=ip(r.site,c.site);return}Pd(r),Pd(s);var u=r.site,f=u[0],m=u[1],p=e[0]-f,h=e[1]-m,g=s.site,y=g[0]-f,x=g[1]-m,v=2*(p*x-h*y),b=p*p+h*h,_=y*y+x*x,w=[(x*b-h*_)/v+f,(p*_-y*b)/v+m];lx(s.edge,u,g,w),c.edge=ip(u,e,null,w),s.edge=ip(e,g,null,w),gd(r),gd(s)}}function Fce(e,t){var n=e.site,r=n[0],s=n[1],o=s-t;if(!o)return r;var a=e.P;if(!a)return-1/0;n=a.site;var i=n[0],c=n[1],u=c-t;if(!u)return i;var f=i-r,m=1/o-1/u,p=f/u;return m?(-p+Math.sqrt(p*p-2*m*(f*f/(-2*u)-c+u/2+s-o/2)))/m+r:(r+i)/2}function igt(e,t){var n=e.N;if(n)return Fce(n,t);var r=e.site;return r[1]===t?r[0]:1/0}var _n=1e-6,Od,to,Uh,rs;function lgt(e,t,n){return(e[0]-n[0])*(t[1]-e[1])-(e[0]-t[0])*(n[1]-e[1])}function cgt(e,t){return t[1]-e[1]||t[0]-e[0]}function Q5(e,t){var n=e.sort(cgt).pop(),r,s,o;for(rs=[],to=new Array(e.length),Od=new ix,Uh=new ix;;)if(o=U8,n&&(!o||n[1]=a)return null;var c=e-i.site[0],u=t-i.site[1],f=c*c+u*u;do i=r.cells[s=o],o=null,i.halfedges.forEach(function(m){var p=r.edges[m],h=p.left;if(!((h===i.site||!h)&&!(h=p.right))){var g=e-h[0],y=t-h[1],x=g*g+y*y;xdgt({width:n,height:t,x:g=>r(o(g)),y:g=>s(a(g))})(e),[e,n,t,r,s,o,a]),p=d.useCallback(h=>{const{x:g,y}=i0(h)??{x:0,y:0},x=m.find(g,y,i);if(!x)return u();c({tooltipData:{localPoint:{x:g,y},voronoiSite:x}})},[c,u,m,i]);return d.useMemo(()=>({showTooltip:c,hideTooltip:u,handleTooltip:p,tooltipData:f}),[p,u,c,f])}const m0=A.memo(function({margin:t,height:n,width:r,tooltipHandle:s,tooltipHide:o,maxYLabelWidth:a}){const c=d.useCallback(()=>o(),[o]);return l.jsx(cm,{x:t.left+a-2.5,y:t.top,width:r-t.right-t.left*2-a+2.5*2,height:n-t.bottom-t.top,fill:"transparent",onTouchStart:s,onTouchMove:s,onMouseMove:s,onMouseLeave:c})});m0.displayName="TooltipListener";const Vh=A.memo(({cx:e,cy:t,color:n,r=3})=>l.jsx("circle",{cx:e,cy:t,r,fill:n,stroke:n,strokeWidth:1}));Vh.displayName="YDot";const bf=A.memo(({marginTop:e,tooltipLeft:t=0,innerHeight:n,color:r,strokeWidth:s=1,dotted:o=!1})=>{const a=d.useMemo(()=>({x:t,y:e}),[e,t]),i=d.useMemo(()=>({x:t,y:n+e}),[n,e,t]);return l.jsx("g",{children:l.jsx(Ub,{from:a,to:i,stroke:r,strokeWidth:s,strokeDasharray:o?"4 4":void 0,pointerEvents:"none",className:"animate-in fade-in duration-300"})})});bf.displayName="YCrosshair";const RS=e=>e,Bce=A.memo(({entry:e,xFormat:t=RS,yFormat:n=RS,zFormat:r=RS,xGet:s,yGet:o,zGet:a})=>{const i=[{value:t(s(e))},{value:n(o(e))}];a&&i.unshift({value:r(a(e))});const c=i.filter(u=>u.value);return l.jsx(K,{children:c.map(({value:u},f)=>l.jsx(V,{variant:"tiny",className:"py-two",children:String(u)},f))})});Bce.displayName="InnerToolTip";const Uce=A.memo(({tooltipTop:e=0,tooltipLeft:t=0,children:n})=>{const r=d.useMemo(()=>({position:"absolute",pointerEvents:"none"}),[]);return l.jsx(hle,{top:e,left:t,style:r,children:l.jsx(K,{variant:"background",className:"p-sm dark:border-inverse rounded-md border shadow-sm",children:n})})});Uce.displayName="Tooltip";const p0=A.memo(({tooltipTop:e,tooltipLeft:t,entry:n,data:r,config:s,UserToolTip:o,xFormat:a,yFormat:i,zFormat:c,zGet:u,xGet:f,yGet:m})=>l.jsx(Uce,{tooltipTop:e,tooltipLeft:t,children:o?l.jsx(o,{entry:n,config:s,data:r}):l.jsx(Bce,{entry:n,config:s,xFormat:a,yFormat:i,zFormat:c,zGet:u,xGet:f,yGet:m})}));p0.displayName="ComposedTooltip";const $u=0,Vce=A.memo(function(t){const{width:n,height:r,margin:s,config:o,tooltip:a,colors:i,axes:c=!0}=t,{colorSchema:u,axisColor:f,tickColor:m}=qb(i),p=mi(),h=Kb({data:t.data}),{xAxisRef:g,yAxisRef:y,maxYLabelWidth:x,maxXLabelWidth:v,minXRequiredWidth:b}=s_(),{innerHeight:_,innerWidth:w,xRange:S,yRange:C}=Xb({width:n,height:r,margin:s,maxYLabelWidth:x,hasAxis:c}),{xNumTicks:E,yNumTicks:T,xTiltTicks:k}=o_({config:o,innerWidth:w,innerHeight:_,maxXLabelWidth:v}),{xGet:I,yGet:M,zGet:N}=Yb({config:o}),{xFormat:D,yFormat:j,xTooltipFormat:F,yTooltipFormat:R,zTooltipFormat:P}=Qb({config:o}),L=d.useMemo(()=>{if(!o?.z?.accessor)return[{key:"default",data:h}];const ue=o.z.accessor,me=th(h,we=>String(we[ue]));return Object.entries(me).map(([we,ye])=>({key:we,data:ye}))},[h,o.z]),U=L.length>1,O=U?L.map(({key:ue})=>ue):h.map(I),$=ao.band({range:S,domain:O,padding:.4}),G=[...new Set(h.map(I))],H=ao.band({range:[0,$.bandwidth()],domain:G,padding:.1}),Q=d.useMemo(()=>{const[ue,me]=ko(h,M),we=Math.min($u,ue),ye=Math.max($u,me);return[we,ye]},[h,M]),Y=d.useMemo(()=>ao.linear({range:C,domain:Q}),[C,Q]),te=ao.ordinal({range:u.slice(0,G.length),domain:U?G:O}),{tooltipData:se,hideTooltip:ae,handleTooltip:X}=i_({data:h,innerHeight:_,innerWidth:w,xScale:U?H:$,yScale:Y,xGet:I,yGet:M}),le=d.useCallback(({localPoint:ue})=>{const me=U?H:$,we=me.bandwidth(),ye=(me.step()-we)/4;if(isNaN(ue?.x??NaN)||isNaN(ue?.y??NaN))return null;const _e=ue?.x,ke=ue?.y;return h.reduce((De,xe)=>{let Ue=me(I(xe))||0;const Ee=Y(M(xe)),Ke=Math.abs(Ee-Y(0));return U&&(Ue+=$(xe.z)||0),Ue!==void 0&&Ee!==void 0&&_e>=Ue-ye&&_e<=Ue+we+ye&&ke>=Ee-Ke&&ke<=Ee+Ke?{x:Ue,y:Ee,data:xe}:De},null)},[h,$,I,Y,M,U,H])({localPoint:se?.localPoint}),re=d.useMemo(()=>({marginLeft:s.left,marginRight:s.right}),[s.left,s.right]),ce=d.useMemo(()=>[$u],[]);return l.jsxs(K,{className:"relative",children:[U&&G.length>1&&l.jsx(K,{style:re,children:l.jsx(d0,{entries:G.map(ue=>({key:ue,color:te(ue)}))})}),l.jsxs(f0,{width:n,height:r,children:[l.jsx(u0,{xScale:$,yScale:Y,xFormat:D,yFormat:j,width:n,height:r,margin:s,yNumTicks:T,xNumTicks:E,yTickValues:o.y.tickValues,xTickValues:o.x.tickValues,xAxisLabel:o.x.label,yAxisLabel:o.y.label,animated:!0,tickColor:m,axisColor:f,xAxisRef:g,yAxisRef:y,xTiltTicks:k}),p&&l.jsx(Dce,{left:s.left,scale:Y,width:n-s.right-s.left*2,stroke:f,tickValues:ce,strokeWidth:2}),L.map(({key:ue,data:me})=>l.jsx(Cs,{left:$(ue),children:me.map((we,ye)=>{const _e=U?H:$;return l.jsx(Te.rect,{rx:2,ry:2,x:_e(I(we)),width:_e.bandwidth(),fill:te(U?ye:ue),initial:{y:Y($u),height:0,opacity:0},animate:{y:Y(Math.max($u,M(we))),height:Math.abs(Y(M(we))-Y($u)),opacity:1},transition:{duration:.5,ease:"easeInOut"}},ye)})},ue)),l.jsx(m0,{margin:s,tooltipHandle:X,tooltipHide:ae,height:r,width:n,maxYLabelWidth:x})]}),le&&se&&l.jsx(p0,{UserToolTip:a,tooltipTop:se?.localPoint?.y,tooltipLeft:se?.localPoint?.x,entry:le.data,data:h,config:o,xFormat:F,yFormat:R,zFormat:P,zGet:N,xGet:I,yGet:M})]})});Vce.displayName="BarChart";var fgt=["children","id","from","to","x1","y1","x2","y2","fromOffset","fromOpacity","toOffset","toOpacity","rotate","transform","vertical"];function X5(){return X5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function V8(e){var t=e.children,n=e.id,r=e.from,s=e.to,o=e.x1,a=e.y1,i=e.x2,c=e.y2,u=e.fromOffset,f=u===void 0?"0%":u,m=e.fromOpacity,p=m===void 0?1:m,h=e.toOffset,g=h===void 0?"100%":h,y=e.toOpacity,x=y===void 0?1:y,v=e.rotate,b=e.transform,_=e.vertical,w=_===void 0?!0:_,S=mgt(e,fgt),C=o,E=i,T=a,k=c;return w&&!C&&!E&&!T&&!k&&(C="0",E="0",T="0",k="1"),A.createElement("defs",null,A.createElement("linearGradient",X5({id:n,x1:C,y1:T,x2:E,y2:k,gradientTransform:v?"rotate("+v+")":b},S),!!t&&t,!t&&A.createElement("stop",{offset:f,stopColor:r,stopOpacity:p}),!t&&A.createElement("stop",{offset:g,stopColor:s,stopOpacity:x})))}V8.propTypes={id:ze.string.isRequired,from:ze.string,to:ze.string,x1:ze.oneOfType([ze.string,ze.number]),x2:ze.oneOfType([ze.string,ze.number]),y1:ze.oneOfType([ze.string,ze.number]),y2:ze.oneOfType([ze.string,ze.number]),fromOffset:ze.oneOfType([ze.string,ze.number]),fromOpacity:ze.oneOfType([ze.string,ze.number]),toOffset:ze.oneOfType([ze.string,ze.number]),toOpacity:ze.oneOfType([ze.string,ze.number]),rotate:ze.oneOfType([ze.string,ze.number]),transform:ze.string,children:ze.node,vertical:ze.bool};function pgt({xScale:e,xPosition:t}){const n=e.domain(),[r,s]=e.range(),o=(s-r)/(n.length-1),a=Math.min(Math.max(Math.round((t-r)/o),0),n.length-1);return n[a]}function hgt({tooltipData:e,config:t,groups:n,xScale:r,xGet:s}){const o=t.z?.accessor?e?.voronoiSite?.data?.[t.z?.accessor]:"",a=d.useMemo(()=>[...(n.find(({key:m})=>m===o)||n[0])?.d||[]].sort((m,p)=>s(m)-s(p)),[o,n,s]),i=e?.localPoint.x,c=d.useMemo(()=>a.map(s),[a,s]);return d.useMemo(()=>{if(i==null)return;if("invert"in r){const p=r.invert(i),h=tm(c,p);if(h<=0)return a[0];if(h>=c.length)return a[c.length-1];const g=a[h-1],y=a[h];return Math.abs(s(g)-p)String(s(p))===String(f));return m||a.reduce((p,h)=>Math.abs(s(h)-f)ao[ce]({range:[ae[0],j?ae[1]-j/2:ae[1]],domain:Q}),[ce,ae,Q,j]),we=d.useMemo(()=>{const Je=ue==="log";return ao[ue]({range:X,domain:Y,base:Je?2:void 0,nice:!Je,round:!0})},[ue,X,Y]),ye=d.useMemo(()=>{if(!a.z?.accessor)return[{key:"",d:_}];const Je=a.z.accessor,Me=th(_,Ve=>String(Ve[Je]));return Object.entries(Me).map(([Ve,lt])=>({key:Ve,d:lt}))},[_,a?.z?.accessor]),_e=d.useMemo(()=>{if(ye.length<=1)return null;const Je=new Map;return ye.forEach(Ve=>{Ve.d.forEach(lt=>{const xt=R(lt);Je.set(xt,lt)})}),Array.from(Je.values()).sort((Ve,lt)=>R(Ve)-R(lt))},[ye,R]),{tooltipData:ke,hideTooltip:De,handleTooltip:xe}=i_({data:_,innerHeight:te,innerWidth:se,xScale:me,yScale:we,xGet:R,yGet:P}),Ue=hgt({tooltipData:ke,config:a,groups:ye,xScale:me,xGet:R}),Ee=d.useMemo(()=>!y||!ye.length||!ye[0].d.length?null:ye[0].d.at(-1),[ye,y]),Ke=d.useMemo(()=>sl().x(Je=>me(R(Je))).y(Je=>we(P(Je))).curve(nu),[me,we,R,P]),Nt=d.useMemo(()=>ao.ordinal({domain:ye.map(({key:Je})=>Je),range:S}),[S,ye]),pe=d.useCallback(()=>{ke&&b(Ue||null)},[ke,Ue]),ve=d.useCallback(()=>{b(null)},[]),Ae=d.useMemo(()=>{const Je={};if(!v||!Ue||!ye.length)return Je;const Me=R(v),Ve=R(Ue),[lt,xt]=Me{const dt=a.z?.accessor?Zt[a.z.accessor]:ye[0].key,Ct=ye.find(({key:Ot})=>Ot===dt);return Ct?Ct.d.filter(Ot=>{const Qt=R(Ot);return Qt>=lt&&Qt<=xt}):[]},$e=a.z?.accessor?v[a.z.accessor]:ye[0].key;Je[$e]=Pt(v);const ht=a.z?.accessor?Ue[a.z.accessor]:ye[0].key;return $e!==ht&&(Je[ht]=Pt(Ue)),Je},[v,Ue,ye,R,a.z?.accessor]),We=d.useMemo(()=>{const Je=Ae[a.z?.accessor?v?.[a.z.accessor]:ye[0]?.key]||[],Me=Ae[a.z?.accessor?Ue?.[a.z.accessor]:ye[0]?.key]||[],Ve=[...Je,...Me],lt=new Map;return Ve.forEach(Pt=>{lt.set(R(Pt),Pt)}),Array.from(lt.values()).sort((Pt,$e)=>R(Pt)-R($e))},[Ae,a.z?.accessor,v,Ue,ye,R]),pt=d.useMemo(()=>({marginLeft:o.left,marginRight:o.right}),[o.left,o.right]),Gt=d.useMemo(()=>[h],[h]),Le=d.useCallback(Je=>me(R(Je))??0,[me,R]),gt=d.useCallback(Je=>we(P(Je))??0,[we,P]);return l.jsxs(K,{children:[a.z&&ye?.length>1&&m&&l.jsx(K,{style:pt,children:l.jsx(d0,{entries:ye.map(({key:Je})=>({key:Je,color:Nt(Je)}))})}),l.jsxs(K,{className:"relative",onMouseDown:pe,onMouseUp:ve,onMouseLeave:ve,children:[l.jsxs(f0,{width:r,height:s,children:[c&&l.jsx(u0,{width:r,height:s,margin:o,xScale:me,yScale:we,xFormat:U,yFormat:O,yNumTicks:le,xNumTicks:ee,yTickValues:a.y.tickValues,xTickValues:a.x.tickValues,tickColor:C,axisColor:E,xAxisRef:M,yAxisRef:N,xTiltTicks:re,xAxisLabel:a.x.label,yAxisLabel:a.y.label}),x&&x({xScale:me,yScale:we,xGet:R,yGet:P}),h&&l.jsx("text",{x:r-o.right-10,y:we(h)-5,fill:T,fontSize:12,className:"font-mono",textAnchor:"end",children:g==="CRYPTO"?n({defaultMessage:"Prev day: {value}",id:"7i8MvDtMyq"},{value:typeof a.y.format=="function"?a.y.format(h):h}):n({defaultMessage:"Prev close: {value}",id:"uRPxTu0cgj"},{value:typeof a.y.format=="function"?a.y.format(h):h})}),h&&l.jsx(bu,{left:o.left,scale:we,width:r-o.right-o.left*2,stroke:T,tickValues:Gt,strokeWidth:2,strokeDasharray:"2,6",opacity:I?.6:1}),Ue&&l.jsx(bf,{marginTop:o.top,tooltipLeft:me(R(Ue)),innerHeight:te,color:E,strokeWidth:1}),v&&l.jsx(bf,{marginTop:o.top,tooltipLeft:me(R(v)),innerHeight:te,color:E,strokeWidth:1}),_e&&ye.length>1&&ye[1]?.key&&l.jsx(Te.path,{d:Ke(_e),stroke:Nt(ye[1].key),strokeWidth:1.5,fill:"none",shapeRendering:"geometricPrecision",initial:f?{pathLength:f?0:1,opacity:f?0:1}:void 0,animate:f?{pathLength:1,opacity:1}:void 0,transition:f?{duration:.8,ease:qa}:void 0}),ye.map(({d:Je,key:Me},Ve)=>{const lt=w.current.has(Me),xt=lt||!f?{initial:void 0,animate:{pathLength:1,opacity:1}}:{initial:{pathLength:f?0:1,opacity:f?0:1},animate:{pathLength:1,opacity:1},transition:{duration:.8,ease:qa,delay:Ve/ye.length}};return lt||w.current.add(Me),l.jsx(Te.path,{d:Ke(Je),stroke:Nt(Me),strokeWidth:2,fill:"none",shapeRendering:"geometricPrecision",...xt},Me)}),(Ue||Ee)&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:{duration:0,delay:.8},children:[l.jsx(Vh,{cx:me(R(Ue||Ee)),cy:we(P(Ue||Ee)),color:Nt(a.z?.accessor?(Ue||Ee)?.[a.z.accessor]:""),r:5}),v&&Ue&&l.jsxs(l.Fragment,{children:[l.jsx(Vh,{cx:me(R(v)),cy:we(P(v)),color:Nt(a.z?.accessor?v[a.z.accessor]:""),r:5}),We.length>1&&l.jsx(Fh,{data:We,x:Le,y:gt,fill:Nt(ye[0].key),fillOpacity:.2,stroke:"none",yScale:we,curve:nu})]})]}),(ye.length===1||ye.length===2)&&ye.map(({d:Je,key:Me},Ve)=>{const lt=Nt(Me);return l.jsx(Te.g,{initial:f?{opacity:0,clipPath:"inset(0% 100% 0% 0%)"}:void 0,animate:f?{opacity:1,clipPath:"inset(0% 0% 0% 0%)"}:void 0,transition:f?{duration:.8,ease:qa,delay:Ve/ye.length}:void 0,children:!v&&(ye.length===1||Ve===0)&&l.jsxs(l.Fragment,{children:[l.jsx(V8,{from:`${lt}22`,to:`${lt}00`,id:Me}),l.jsx(Fh,{data:Je,x:Le,y:gt,strokeWidth:0,yScale:we,fill:`url('#${Me}')`},Me)]})},Me)}),l.jsx(m0,{margin:o,tooltipHandle:xe,tooltipHide:De,height:s,width:r,maxYLabelWidth:D})]}),Ue&&ke&&l.jsx(p0,{tooltipTop:ke.localPoint.y,tooltipLeft:ke.localPoint.x,entry:Ue,UserToolTip:i?Je=>l.jsx(i,{...Je,comparisonEntry:v||void 0}):void 0,data:_,config:a,xFormat:$,yFormat:G,zFormat:H,zGet:L,xGet:R,yGet:P})]})]})});Hce.displayName="CompositeLineChart";function ggt({xScale:e,xPosition:t}){const n=e.domain(),[r,s]=e.range(),o=(s-r)/(n.length-1),a=Math.min(Math.max(Math.round((t-r)/o),0),n.length-1);return n[a]}function ygt({tooltipData:e,config:t,groups:n,xScale:r,xGet:s}){const o=t.z?.accessor?e?.voronoiSite?.data?.[t.z?.accessor]:"",a=d.useMemo(()=>[...(n.find(({key:f})=>f===o)||n[0])?.d||[]].sort((f,m)=>s(f)-s(m)),[o,n,s]),i=e?.localPoint.x;return d.useMemo(()=>{if(!i)return;if("invert"in r){const m=r.invert(i),p=tm(a.map(s),m);return a?.[p-1]}const u=ggt({xScale:r,xPosition:i});return a.find(m=>String(s(m))===String(u))},[i,r,a,s])}const zce=A.memo(e=>{const{$t:t}=J(),{enableComparison:n=!0,width:r,height:s,margin:o={top:0,right:0,bottom:0,left:0},config:a,tooltip:i,axes:c=!0,colors:u,animate:f=!0,includeLegend:m=!0,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y=!1,children:x}=e,[v,b]=d.useState(null),_=Kb({data:e.data}),w=mi(),{colorSchema:S,tickColor:C,axisColor:E,textColor:T}=qb(u),{colorScheme:k}=Ss(),I=d.useMemo(()=>w?k==="dark":!1,[k,w]),{xAxisRef:M,yAxisRef:N,maxYLabelWidth:D,maxXLabelWidth:j,minXRequiredWidth:F}=s_(),{xGet:R,yGet:P,zGet:L}=Yb({config:a}),{xFormat:U,yFormat:O,xTooltipFormat:$,yTooltipFormat:G,zTooltipFormat:H}=Qb({config:a}),{xDomain:Q,yDomain:Y}=E8({config:a,data:_,xGet:R,yGet:P,endTime:p,previousClose:h}),{innerHeight:te,innerWidth:se,xRange:ae,yRange:X}=Xb({width:r,height:s,margin:o,maxYLabelWidth:D,hasAxis:c}),{xNumTicks:ee,yNumTicks:le,xTiltTicks:re}=o_({config:a,innerWidth:se,innerHeight:te,maxXLabelWidth:j}),ce=a.x.scale,ue=d.useMemo(()=>ao[ce]({range:[ae[0],j?ae[1]-j/2:ae[1]],domain:Q}),[ce,ae,Q,j]),me=a.y.scale,we=d.useMemo(()=>{const Le=me==="log";return ao[me]({range:X,domain:Y,base:Le?2:void 0,nice:!Le,round:!0})},[me,X,Y]),ye=d.useMemo(()=>{if(!a.z?.accessor)return[{key:"",d:_}];const Le=a.z.accessor,gt=th(_,Je=>String(Je[Le]));return Object.entries(gt).map(([Je,Me])=>({key:Je,d:Me}))},[_,a?.z?.accessor]),{tooltipData:_e,hideTooltip:ke,handleTooltip:De}=i_({data:_,innerHeight:te,innerWidth:se,xScale:ue,yScale:we,xGet:R,yGet:P}),xe=ygt({tooltipData:_e,config:a,groups:ye,xScale:ue,xGet:R}),Ue=d.useMemo(()=>!y||!ye.length||!ye[0].d.length?null:ye[0].d.at(-1),[ye,y]),Ee=d.useMemo(()=>sl().x(Le=>ue(R(Le))).y(Le=>we(P(Le))).curve(nu),[ue,we,R,P]),Ke=d.useMemo(()=>ao.ordinal({range:S}),[S]),Nt=d.useCallback(()=>{!_e||!n||b(xe||null)},[n,_e,xe]),pe=d.useCallback(()=>{n&&b(null)},[n]),ve=d.useMemo(()=>{if(!v||!xe||!ye.length)return[];const Le=ye[0],gt=R(v),Je=R(xe),[Me,Ve]=gt{const xt=R(lt);return xt>=Me&&xt<=Ve})},[v,xe,ye,R]),Ae=d.useMemo(()=>({marginLeft:o.left,marginRight:o.right}),[o.left,o.right]),We=d.useCallback(Le=>ue(R(Le))??0,[ue,R]),pt=d.useCallback(Le=>we(P(Le))??0,[we,P]),Gt=d.useMemo(()=>[h],[h]);return l.jsxs(K,{children:[a.z&&ye?.length>1&&m&&l.jsx(K,{style:Ae,children:l.jsx(d0,{entries:ye.map(({key:Le})=>({key:Le,color:Ke(Le)}))})}),l.jsxs(K,{className:"relative",onMouseDown:Nt,onMouseUp:pe,onMouseLeave:pe,children:[l.jsxs(f0,{width:r,height:s,children:[c&&l.jsx(u0,{width:r,height:s,margin:o,xScale:ue,yScale:we,xFormat:U,yFormat:O,yNumTicks:le,xNumTicks:ee,yTickValues:a.y.tickValues,xTickValues:a.x.tickValues,tickColor:C,axisColor:E,xAxisRef:M,yAxisRef:N,xTiltTicks:re,xAxisLabel:a.x.label,yAxisLabel:a.y.label}),x&&x({xScale:ue,yScale:we,xGet:R,yGet:P}),h&&l.jsx("text",{x:r-o.right-10,y:we(h)-5,fill:T,fontSize:12,className:"font-mono",textAnchor:"end",children:g==="CRYPTO"?t({defaultMessage:"Prev day: {value}",id:"7i8MvDtMyq"},{value:typeof a.y.format=="function"?a.y.format(h):h}):t({defaultMessage:"Prev close: {value}",id:"uRPxTu0cgj"},{value:typeof a.y.format=="function"?a.y.format(h):h})}),h&&l.jsx(bu,{left:o.left,scale:we,width:r-o.right-o.left*2,stroke:T,tickValues:Gt,strokeWidth:2,strokeDasharray:"2,6",opacity:I?.6:1}),xe&&l.jsx(bf,{marginTop:o.top,tooltipLeft:ue(R(xe)),innerHeight:te,color:E,strokeWidth:1}),v&&l.jsx(bf,{marginTop:o.top,tooltipLeft:ue(R(v)),innerHeight:te,color:E,strokeWidth:1}),(xe||Ue)&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:{duration:0,delay:.8},children:[l.jsx(Vh,{cx:ue(R(xe||Ue)),cy:we(P(xe||Ue)),color:Ke(a.z?.accessor?(xe||Ue)?.[a.z.accessor]:""),r:5}),v&&xe&&ve.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Vh,{cx:ue(R(v)),cy:we(P(v)),color:Ke(a.z?.accessor?v[a.z.accessor]:""),r:5}),l.jsx(Fh,{data:ve,x:We,y:pt,fill:Ke(a.z?.accessor?v[a.z.accessor]:""),fillOpacity:.2,stroke:"none",yScale:we,curve:nu})]})]}),ye.length===1&&ye.map(({d:Le,key:gt},Je)=>{const Me=Ke(gt);return l.jsx(Te.g,{initial:f?{opacity:0,clipPath:"inset(0% 100% 0% 0%)"}:void 0,animate:f?{opacity:1,clipPath:"inset(0% 0% 0% 0%)"}:void 0,transition:f?{duration:.8,ease:"easeInOut",delay:Je/ye.length}:void 0,children:!v&&l.jsxs(l.Fragment,{children:[l.jsx(V8,{from:`${Me}22`,to:`${Me}00`,id:gt}),l.jsx(Fh,{data:Le,x:We,y:pt,strokeWidth:0,yScale:we,fill:`url('#${gt}')`},gt)]})},gt)}),ye.map(({d:Le,key:gt},Je)=>l.jsx(Te.path,{d:Ee(Le),stroke:Ke(gt),strokeWidth:2,fill:"none",shapeRendering:"geometricPrecision",initial:f?{pathLength:0,opacity:0}:void 0,animate:f?{pathLength:1,opacity:1}:void 0,transition:f?{duration:.8,ease:"easeInOut",delay:Je/ye.length}:void 0},gt)),l.jsx(m0,{margin:o,tooltipHandle:De,tooltipHide:ke,height:s,width:r,maxYLabelWidth:D})]}),xe&&_e&&l.jsx(p0,{tooltipTop:_e.localPoint.y,tooltipLeft:_e.localPoint.x,entry:xe,UserToolTip:i?Le=>l.jsx(i,{...Le,comparisonEntry:v||void 0}):void 0,data:_,config:a,xFormat:$,yFormat:G,zFormat:H,zGet:L,xGet:R,yGet:P})]})]})});zce.displayName="LineChart";const Wce=A.memo(e=>{const{width:t,height:n,margin:r,config:s,tooltip:o,colors:a,axes:i=!0}=e,c=3,u=Kb({data:e.data}),{colorSchema:f,tickColor:m,axisColor:p}=qb(a),{xAxisRef:h,yAxisRef:g,maxYLabelWidth:y,maxXLabelWidth:x,minXRequiredWidth:v}=s_(),{innerHeight:b,innerWidth:_,xRange:w,yRange:S}=Xb({width:t,height:n,margin:r,maxYLabelWidth:y,hasAxis:i}),{xNumTicks:C,yNumTicks:E,xTiltTicks:T}=o_({config:s,innerWidth:_,innerHeight:b,maxXLabelWidth:x}),{xGet:k,yGet:I,zGet:M}=Yb({config:s}),{xFormat:N,yFormat:D,xTooltipFormat:j,yTooltipFormat:F,zTooltipFormat:R}=Qb({config:s}),{xDomain:P,yDomain:L}=E8({data:u,config:s,xGet:k,yGet:I}),{scale:U}=s.x,O=d.useMemo(()=>ao[U]({range:w,domain:P}),[U,w,P]),{scale:$}=s.y,G=d.useMemo(()=>ao[$]({range:S,domain:L,nice:!0,round:!0}),[$,S,L]),{tooltipData:H,handleTooltip:Q,hideTooltip:Y}=i_({data:u,innerHeight:b,innerWidth:_,xScale:O,yScale:G,xGet:k,yGet:I,voronoiRadius:c*2}),te=d.useMemo(()=>ao.ordinal({range:f}),[f]),se=d.useMemo(()=>{if(!s.z?.accessor)return[];const ee=new Set([]);return u.forEach(le=>ee.add(le[s?.z?.accessor])),Array.from(ee)},[u,s.z]),ae=H?.voronoiSite,X=d.useMemo(()=>({marginLeft:r.left,marginRight:r.right}),[r.left,r.right]);return l.jsxs(K,{children:[se.length>1&&l.jsx(K,{style:X,children:l.jsx(d0,{entries:se.map(ee=>({key:ee,color:te(ee)}))})}),l.jsxs(K,{className:"relative",children:[l.jsxs(f0,{width:t,height:n,children:[l.jsx(u0,{xScale:O,yScale:G,xFormat:N,yFormat:D,width:t,height:n,margin:r,yTickValues:s.y.tickValues,xTickValues:s.x.tickValues,tickColor:m,axisColor:p,xAxisRef:h,yAxisRef:g,yNumTicks:E,xNumTicks:C,xTiltTicks:T}),ae&&l.jsx(bf,{marginTop:r.top,tooltipLeft:ae[0],innerHeight:b,color:p}),l.jsx("g",{children:u.map((ee,le)=>{const re=ae?.data?.__key==ee.__key,ce=s.z?.accessor?te(ee[s.z.accessor]):te("");return l.jsx(Te.circle,{"data-hint":`${k(ee)}: ${I(ee)}`,cx:O(k(ee)),cy:G(I(ee)),r:c,strokeWidth:c/2,stroke:ce,fill:re?"transparent":ce,initial:{opacity:0},animate:{opacity:1},transition:{duration:.8,ease:"easeInOut",delay:le/u.length}},ee.__key)})}),l.jsx(m0,{margin:r,tooltipHandle:Q,tooltipHide:Y,height:n,width:t,maxYLabelWidth:y})]}),ae&&l.jsx(p0,{tooltipTop:ae?.[1],tooltipLeft:ae?.[0],UserToolTip:o,entry:ae.data,data:u,config:s,xFormat:j,yFormat:F,zFormat:R,zGet:M,xGet:k,yGet:I})]})]})});Wce.displayName="ScatterChart";function xgt(e){const{type:t,config:n,width:r,data:s,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,children:x,enableComparison:v}=e;return t==="line"?l.jsx(zce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,enableComparison:v,children:x}):t==="bar"?l.jsx(Vce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,colors:u,includeLegend:m}):t==="scatter"?l.jsx(Wce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,colors:u,includeLegend:m}):t==="compositeLine"?l.jsx(Hce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,children:x}):null}const vgt=A.memo(function({type:t,config:n,data:r,tooltip:s,height:o=a0,margin:a=Wdt,axes:i,className:c,colors:u,includeLegend:f,endTime:m,previousClose:p,exchangeName:h,showLastPoint:g,animate:y,children:x,enableComparison:v}){const b=d.useRef(null),{width:_}=ule(b);return l.jsx("div",{ref:b,className:c,children:l.jsx(xgt,{type:t,data:r,config:n,width:_,height:o,margin:a,tooltip:s,axes:i,colors:u,includeLegend:f,endTime:m,previousClose:p,exchangeName:h,showLastPoint:g,animate:y,enableComparison:v,children:x})})});vgt.displayName="Chart";const Gce=(e,t)=>{const n="#f7f1f2",r="#1f2121";return e?bgt(e,Kn(t?r:n),t):Kn(n)},bgt=(e,t,n,r=3)=>{if(!e)return Kn(t);let s=Kn(e),o=0,a=0;for(;s.contrast(Kn(t))20)););return s};function _gt(e,t){const n=e.lightness();return e.lightness(n+(100-n)*t)}function wgt(e,t){const n=e.lightness();return e.lightness(n-n*t)}const Cgt=({event:e})=>{const t=e.event.status==="live",n=e.event.extra.pitch_outcome,r=n?.count?.outs??0,s=n?.count?.balls??0,o=n?.count?.strikes??0,a=n?.runners,i=n?.count,c=n?.type!=="half_over"&&r!==3&&s!==4&&o!==3;return t?l.jsxs("div",{className:"mt-lg md:mt-md flex flex-col items-center gap-0",children:[l.jsx(Sgt,{runners:a}),l.jsx(Egt,{outs:r}),l.jsx(kgt,{count:i,show:c})]}):null},Sgt=({runners:e})=>{const t=e?.filter(n=>!n.out).map(n=>n.ending_base);return l.jsx("div",{style:{transformStyle:"preserve-3d",perspective:"1000px"},className:"inline-flex",children:l.jsx("div",{style:{transform:"rotateX(45deg)"},children:l.jsxs("div",{className:"gap-three grid rotate-45 grid-cols-2 grid-rows-2",children:[l.jsx(DS,{active:t?.includes(2)??!1}),l.jsx(DS,{active:t?.includes(1)??!1}),l.jsx(DS,{active:t?.includes(3)??!1})]})})})},DS=({active:e})=>l.jsx("div",{className:z("size-3 duration-150 md:size-4",e?"bg-super":"bg-inverse/25")}),Egt=({outs:e})=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(jS,{filled:e>=1}),l.jsx(jS,{filled:e>=2}),l.jsx(jS,{filled:e>=3})]}),jS=({filled:e})=>l.jsx("div",{className:z("relative size-1 rounded-full duration-150",e?"bg-inverse":"bg-inverse/25"),children:e&&l.jsx("div",{className:"bg-inverse repeat-1 absolute inset-0 animate-ping rounded-full"})}),kgt=({count:e,show:t})=>{const n=e?.balls??0,r=e?.strikes??0,s=n===0&&r===0;return l.jsx(V,{variant:"micro",color:s?"ultraLight":"light",className:z("mt-1 duration-150",t?"opacity-100":"opacity-0"),children:l.jsx("span",{className:"font-mono",children:t?`${n}-${r}`:l.jsx(l.Fragment,{children:" "})})})};function Mgt({children:e,className:t}){return l.jsx(V,{variant:"micro",className:z("py-xs !font-mono uppercase",t),color:"light",children:e})}const l_=({className:e,textCenter:t,finalText:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re();return l.jsx("div",{className:z("flex items-center justify-center",e),children:l.jsx(V,{variant:s?"micro":"tiny",color:"light",className:"bg-subtler dark:bg-subtle pt-three rounded-full px-2.5 py-0.5",textCenter:t,children:n?n.toUpperCase():r({defaultMessage:"Final",id:"6/JzkWi0di"}).toUpperCase()})})},$ce=({className:e,textCenter:t=!1})=>{const{$t:n}=J(),{isMobileStyle:r}=Re();return l.jsx("div",{className:z("flex items-center justify-center",e),children:l.jsx(V,{variant:r?"micro":"tiny",color:"light",className:"bg-subtler dark:bg-subtle pt-three rounded-full px-2.5 py-0.5",textCenter:t,children:n({defaultMessage:"Upcoming",id:"6/aEFZbs2i"}).toUpperCase()})})},Tgt=A.memo(function({attributions:t}){const{$t:n}=J(),r=t.join(" · ");return l.jsxs(K,{className:"mt-md pt-md pb-lg flex flex-col gap-1 border-t",children:[l.jsx(V,{variant:"smallBold",color:"light",className:"text-center",children:r}),l.jsx(V,{variant:"small",color:"light",className:"text-center",children:n({defaultMessage:"{perplexity} is not affiliated with, endorsed by, or sponsored by any sports leagues or teams. All trademarks, team names, logos, and player images are the property of their respective owners. The content provided on this page is for informational purposes only and is intended to help users follow sports news and updates.",id:"M0PBu8vKH2"},{perplexity:"Perplexity"})})]})});Tgt.displayName="SportsSources";const qce=A.memo(({children:e,innerRef:t,canScrollLeft:n,canScrollRight:r,fadeOut:s})=>l.jsx("div",{className:"gap-md flex w-full flex-col overflow-hidden",children:l.jsx(nl,{orientation:"horizontal",viewportRef:t,showScrollIndicator:!1,className:z("relative",{"mask-fade-l-12":n&&!r&&s,"mask-fade-r-12":r&&!n&&s,"mask-fade-h-12":n&&r&&s}),children:l.jsx("div",{className:"p-md pt-0",children:e})})}));qce.displayName="CanonicalScroll";const Agt=A.memo(({title:e,subtitle:t,children:n,scrollable:r,fadeOut:s,trailing:o,titleClassName:a})=>{const i=d.useRef(null),[c,u]=d.useState(!1),[f,m]=d.useState(!1),p=d.useCallback(()=>{i.current?.scrollTo({left:i.current.scrollLeft-i.current.clientWidth,behavior:"smooth"})},[i]),h=d.useCallback(()=>{i.current?.scrollTo({left:i.current.scrollLeft+i.current.clientWidth,behavior:"smooth"})},[i]),g=d.useCallback(()=>{i.current&&(u(i.current.scrollLeft>0),m(i.current.scrollLeft+i.current.clientWidth+10i.current.clientWidth))},[i]);return d.useEffect(()=>{const y=i.current;return y?.addEventListener("scroll",g),()=>{y?.removeEventListener("scroll",g)}},[g,i]),d.useEffect(()=>{const y=new ResizeObserver(g);return y.observe(window.document.body),()=>{y.disconnect()}},[g,i]),d.useEffect(()=>{g()},[g]),l.jsxs(K,{className:"gap-md flex flex-col",children:[l.jsxs(Kce,{title:e,subtitle:t,className:a,children:[o,r&&l.jsxs("div",{className:"-mr-sm flex items-center",children:[l.jsx(st,{icon:B("chevron-left"),size:"small",onClick:p,disabled:!c,variant:c?void 0:"noHover"}),l.jsx(st,{icon:B("chevron-right"),size:"small",onClick:h,disabled:!f,variant:f?void 0:"noHover"})]})]}),r?l.jsx(qce,{innerRef:i,canScrollLeft:c,canScrollRight:f,fadeOut:s,children:n}):l.jsx("div",{ref:i,className:"gap-md px-md pb-md flex flex-col",children:n})]})});Agt.displayName="CanonicalSection";const Kce=A.memo(({children:e,title:t,subtitle:n,className:r})=>l.jsxs(K,{className:z("gap-md px-md py-sm flex items-center justify-between border-b",r),children:[l.jsxs(K,{className:"flex items-center justify-between",children:[t&&l.jsx(V,{variant:"baseSemi",children:t}),n&&l.jsx(V,{variant:"smallCaps",color:"light",children:n})]}),e]}));Kce.displayName="SectionTitle";const Ngt={tiny:"size-[16px]",small:"size-[24px]",medium:"size-[32px]",large:"xl:size-[64px] size-[50px]"},Rgt={tiny:"p-[0.5px]",small:"p-[0.5px]",medium:"p-[0.5px]",large:"p-[0.5px]"},Dgt={tiny:"border-[1px]",small:"border-[1px]",medium:"border-[2px]",large:"border-[4px]"},h0=d.memo(({includeStripe:e=!0,includeShadow:t=!1,className:n,includeBackground:r=!1,size:s="large",logo:o,color:a,...i})=>{const c=d.useMemo(()=>{let u=Ngt[s];return r&&(u+=` ${Rgt[s]}`),u},[r,s]);return l.jsx("div",{className:z(c,{"shadow-subtle":t&&r,"border-subtlest rounded-full border bg-white dark:border-transparent":r},n),...i,children:l.jsx("div",{className:z("rounded-inherit relative flex size-full items-center justify-center",{[Dgt[s]]:e&&r}),style:{borderColor:r?a:void 0},children:l.jsx("img",{src:o,alt:"",width:r?"70%":"100%",height:"auto"})})})});h0.displayName="SportsTeamLogo";function jgt(e,t){if(t!=="upcoming"||et?Gce(Kn(e),t==="dark").toString():e,[e,t])}const Yce=A.memo(({variant:e="common",active:t,vertical:n,onClick:r,indicatorPos:s="bottom",extraCSS:o,showNewIndicator:a,styleProps:i,isNewRedesign:c=!1,disabled:u,innerRef:f,...m})=>{const p=z("absolute",{"right-0 h-full w-[3px] rounded-l-sm":s=="right","left-0 h-full w-[3px] rounded-l-sm":s=="left","bottom-0 left-0 right-0 h-[3px] rounded-t-sm":s=="bottom","top-0 left-0 right-0 h-[3px] rounded-b-sm":s=="top","bg-inverse":e==="primary","bg-inverse/70":e==="common"},i?.indicatorClass),h=z({"px-xs transition duration-300 relative ":n,"flex items-center":t&&n,"justify-center px-xs":!n,"!cursor-not-allowed":u,"my-0.5 [&_*]:!font-normal [&_*]:!text-foreground [&_a]:hover:bg-subtler":c,"[&_a]:bg-subtle [&_a]:text-foreground [&_a]:hover:bg-subtle":c&&t,"opacity-70 cursor-not-allowed":u},t?i?.activeBgClass:i?.bgClass);return l.jsxs("div",{onClick:u?void 0:r,className:h,children:[a&&l.jsx("div",{className:"right-md top-sm text-super absolute z-10",children:"●"}),l.jsx(st,{variant:u?"noHover":t?"primary":"common",...m,fullWidth:!0,extraCSS:z("py-md focus-visible:!bg-transparent before:absolute before:opacity-0 focus-visible:before:opacity-100 before:ring-super/50 before:ring-[1.5px] before:inset-y-0 before:inset-x-[-10px] before:rounded-md",{"cursor-not-allowed":u},o),noXPadding:!n,disabled:u,ref:f??void 0}),t&&!u&&l.jsx(Te.div,{layout:"position",layoutId:"tab-indicator",className:p,transition:{duration:.1,ease:"easeOut"}})]})});Yce.displayName="TabButton";const Pgt=A.memo(({actionList:e,size:t=Ht.regular,variant:n="primary",fillSpace:r=!1,vertical:s=!1,layout:o="left",indicatorPos:a,iconOnly:i,allowScroll:c,tabClass:u,testId:f,layoutGroupId:m,styleProps:p,isNewRedesign:h=!1,activeTabRef:g})=>{const y=z({"w-full":r&&!c,"flex w-auto":c,"justify-center":o==="center","justify-end":o==="right"},p?.wrapperClass),x=z("items-center relative",{"justify-center":o==="center","flex-1":r,"w-full":r&&!c,"w-auto overflow-hidden flex":c},p?.innerClass),v=z("flex",{"w-full":r&&!c,"w-auto overflow-x-auto overflow-y-hidden flex-1 scrollbar-none":c},p?.scrollClass),b=z("items-center relative scrollbar-none",{"flex-1":r,"space-y-xs":s&&!h,"gap-x-md flex h-14":!s&&t!=="tiny","gap-x-sm flex h-10":!s&&t==="tiny","w-full":!s&&!c,"flex px-md w-auto overflow-x-auto":c},p?.scrollInnerClass),_=z("relative",{"h-full flex items-center":!s,"justify-center":r,"w-full":r&&!c,"flex-1 shrink-0":c},p?.itemClass);return l.jsx("div",{className:y,"data-test-id":f,children:l.jsx("div",{className:x,children:l.jsx("div",{className:v,children:l.jsx("div",{className:b,children:l.jsx(yg,{id:m,children:e.map(w=>w.show?l.jsxs(K,{className:_,children:[l.jsx(Yce,{testId:w.testId,ariaLabel:w.ariaLabel,vertical:s,text:i?void 0:w.text,size:t,variant:n,onClick:w.onClick,fullWidth:r,active:w.active,icon:w.icon,href:w.href,target:w.target,layout:o,tooltipLayout:a==="right"?"right":"top",toolTip:w.tooltip,indicatorPos:a,trailingComponent:w.trailingComponent,extraCSS:u,showNewIndicator:w.showNewIndicator,styleProps:p?.tabButton,isNewRedesign:h,disabled:w.disabled,innerRef:w.active?g:void 0}),!i&&w.badge&&l.jsx(V,{className:"bg-super pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded-md px-1 py-0.5 text-white",variant:"tiny",children:w.badge}),w.children&&l.jsx(l.Fragment,{children:w.children})]},w.key??w.text):null)})})})})})});Pgt.displayName="TabBar";const Qce=({isRed:e,className:t})=>l.jsx("svg",{width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:z("shrink-0",t),children:l.jsx("rect",{x:"4.29248",y:"0.726685",width:"12",height:"15",rx:"2",transform:"rotate(14.6454 4.29248 0.726685)",fill:e?"#EB4E45":"#f6c825"})}),Ogt=d.memo(({plays:e,onViewAll:t,playsToRender:n=1/0,reverse:r=!0,brands:s,inModal:o=!1,league:a})=>{const{$t:i}=J(),c=r?[...Object.keys(e)].reverse():Object.keys(e),u=d.useMemo(()=>{let f=n;return l.jsxs(K,{children:[c.map(m=>{let p=0;const h=e[m]?.length??0;return f<=0?null:(fr?[...e].reverse():e,[e,r]),i=mi();return l.jsxs(K,{children:[t>0&&l.jsx(K,{variant:"subtle",className:"-mx-md px-md py-sm sticky top-0 z-10 flex items-center justify-between",children:l.jsx(V,{variant:"smallCaps",color:"light",children:n})}),l.jsx(yg,{children:l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:a.slice(0,t).map(c=>l.jsx(Xce,{play:c,brands:s,parentHasMounted:i,league:o},c.id))})})]})}const Xce=d.memo(({play:e,brands:t,parentHasMounted:n,league:r})=>{const{$t:s}=J(),o=d.useRef(!n),a=bht(e.contestantId,t,r),{colorScheme:i}=Ss(),c=Igt(a.color,i)?.toString()??a.color;return l.jsxs(Te.div,{className:"-mx-md border-subtlest p-md relative border-b",initial:o.current?void 0:{opacity:0},animate:o.current?void 0:{opacity:1},transition:{layout:{duration:.2,ease:Kr},opacity:{duration:.2,ease:Kd}},layout:"position",children:[l.jsx("div",{className:"left-xs inset-y-xs absolute w-1 rounded-full opacity-50",style:{backgroundColor:c}}),!o.current&&l.jsx(Te.div,{className:"bg-super/15 absolute inset-0",initial:{opacity:1},animate:{opacity:0},transition:{duration:1,ease:Kd,delay:.2}}),l.jsxs("div",{className:"gap-md relative flex items-center",children:[l.jsx(h0,{logo:a.logo,color:a.color,size:"small",includeStripe:!1}),l.jsxs("div",{className:"gap-sm flex flex-1 flex-row items-center",children:[l.jsxs("div",{className:"gap-md flex items-baseline",children:[l.jsx(V,{variant:"tiny",color:"light",className:"whitespace-nowrap",children:e.periodId[1]==="PENALTIES"?`${s({defaultMessage:"PK",id:"mG6A02k2Ar"})} ${e.timeMin}`:`${e.timeMin}'`}),l.jsx(V,{variant:"small",children:e.commentary_text})]}),Fgt(e)&&l.jsx(Qce,{isRed:Bgt(e)==="red"})]})]})]})});Xce.displayName="Play";const Fgt=e=>e.typeId[0]===17,Bgt=e=>{const t=e.commentary_text.toLowerCase();return t.includes("second yellow card")||t.includes("red card")?"red":t.includes("yellow card")?"yellow":null},Ugt=({event:e})=>{const n=[...e.matchStats?.contestantStats.map(r=>{const s=r.goal_events.map(a=>({type:"goal",event:a})),o=r.red_card_events.map(a=>({type:"red_card",event:a}));return[...s,...o]})??[]].map(r=>r.sort((s,o)=>s.event[0]-o.event[0]));return!n||n.length===0?null:l.jsx("div",{className:"gap-md p-md grid grid-cols-2",children:n.map((r,s)=>l.jsx(Vgt,{events:r,position:s===0?"left":"right"},s))})},Vgt=({events:e,position:t})=>l.jsx("div",{className:z("gap-xs flex flex-col",{"items-start":t==="left","items-end":t==="right"}),children:e.map((n,r)=>l.jsx(Hgt,{event:n,position:t},r))}),Hgt=({event:e,position:t})=>l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsxs(V,{variant:"tiny",className:z("flex items-center gap-1",{"flex-row-reverse":t==="right"}),children:[l.jsx(zgt,{event:e})," ",e.event[1]]}),l.jsxs(V,{variant:"tiny",color:"light",children:[e.event[0],"'"]})]}),zgt=({event:e})=>e.type!=="goal"?l.jsx(Qce,{isRed:!0,className:"size-md inline-block"}):l.jsx("div",{className:"size-md inline-block",children:"⚽️"}),Zce=d.memo(({className:e,innerClassName:t,gridClassName:n,children:r,fadeOut:s,dotClassName:o,highlightClassName:a,animate:i=!0,gridSize:c=22,count:u=20,style:f})=>{const[m,{width:p,height:h}]=ti(),[g,y]=d.useState([]),[x,v]=d.useState(0),[b,_]=d.useState(0),w=d.useRef(null),S=d.useRef(new Set),C=d.useCallback(()=>{const T=Math.floor(Math.random()*x)+1,k=Math.floor(Math.random()*b)+1,I=`${T}-${k}`;if(S.current.has(I))return;const M={col:T,row:k,id:I,duration:Math.floor(Math.random()*1001)+1e3,isSuper:Math.floor(Math.random()*5)%5===0};y(N=>{const D=[M,...N];if(D.length>u){const j=D.pop();j&&S.current.delete(j.id)}return S.current.add(I),D})},[x,b,u]);d.useEffect(()=>{if(i)return w.current=setInterval(C,100),()=>{w.current&&clearInterval(w.current)}},[C,i]),d.useEffect(()=>{v(Math.floor(p/c)),_(Math.floor(h/c))},[p,h,c]);const E=s?{maskImage:"radial-gradient(black, transparent)"}:void 0;return l.jsxs("div",{className:z("bg-base dotGridContainer pointer-events-none relative isolate",e),ref:m,style:f,children:[l.jsxs("div",{className:"absolute inset-0 overflow-hidden",style:E,children:[l.jsx("div",{className:z("dotHighlightGrid bg-inverse/20 absolute inset-0",a),children:g.map(T=>l.jsx(Jce,{item:T,className:o},T.id))}),l.jsx("div",{className:z("dotGrid absolute inset-0",n)})]}),l.jsx("div",{className:z("relative",t),children:r})]})});Zce.displayName="DotGrid";const Jce=d.memo(({item:e,className:t})=>l.jsx("div",{className:z("gridDot text-foreground",t,{highlight:e.isSuper}),style:{gridColumn:e.col,gridRow:e.row,animationDuration:`${e.duration}ms`}}));Jce.displayName="GridDot";const um=A.memo(({size:e="default",className:t,includeDot:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re();return l.jsx("div",{className:z("flex shrink-0 items-center justify-center",t),children:l.jsxs(V,{variant:e==="tiny"||s?"micro":"tiny",color:"super",className:z("bg-superBG pt-three flex shrink-0 items-center rounded-full py-0.5 tracking-wider",{"px-2.5":e==="default","pl-2":e==="default"&&n,"px-2":e==="small","px-1.5":e==="tiny"}),children:[n&&l.jsxs("span",{className:"grid",children:[l.jsx("span",{className:"bg-super mr-1 size-1.5 rounded-full",style:{gridArea:"1/-1"}}),l.jsx("span",{className:"bg-super mr-1 size-1.5 animate-ping rounded-full",style:{gridArea:"1/-1"}})]}),r({defaultMessage:"Live",id:"Dn82ALx/+V"}).toUpperCase()]})})});um.displayName="LiveIndicator";const Wgt=A.memo(({className:e,color:t="positive"})=>{const n=t==="negative"?"bg-caution":"bg-super";return l.jsxs("span",{className:z("grid",e),children:[l.jsx("span",{className:z(n,"size-1.5 rounded-full"),style:{gridArea:"1/-1"}}),l.jsx("span",{className:z(n,"size-1.5 animate-ping rounded-full"),style:{gridArea:"1/-1"}})]})});Wgt.displayName="LiveDot";const eue=A.memo(()=>l.jsx("div",{}));eue.displayName="SportsWidgetErrorFallback";const IB=new Set,Ggt=e=>e.status==="live"||e.status==="upcoming";function $gt({widget:e}){const{isMobileStyle:t}=Re(),{result:{backend_uuid:n,mode:r}}=It(),s=Mg();if(d.useEffect(()=>{!n||!e||!e?.events?.length||IB.has(n)||(s("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:r}),IB.add(n))},[n,e?.events?.length,r,e,s]),!e?.events?.length)return null;const o=e.canonical_pages?.[0]?.url_web,a=e.events.at(0),i=!t&&(a&&Ggt(a)||e.events.length<5),c=e.league??"nba";return l.jsx(Mr,{fallback:eue,children:l.jsx(Es,{widgetType:"sports",widgetName:e.object,children:({widgetSelected:u})=>l.jsx(tue,{canonicalPageLink:o,children:l.jsx(Zgt,{events:e.events,showHero:i,widgetSelected:u,league:c})})})})}const tue=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})},nue=({initialData:e,refetch:t=!1,reason:n})=>mt({initialData:e,queryKey:be.makeEphemeralQueryKey("sports/events/widget",e.id),queryFn:async()=>{if(!e.refetch_url)return e;const r=await zfe({urlPath:e.refetch_url,timeoutMs:0,reason:n});if(!r.ok)throw Z.error("Failed to fetch sport event",{url:e.refetch_url,status:r.status,statusText:r.statusText}),new Error(`Failed to fetch sport event ${r.status} ${r.statusText}`);return await r.json()},refetchInterval:r=>r.state.data?.refetch_url?r.state.data?.refetch_interval_secs*1e3:!1,enabled:!!e.refetch_url&&t}),qgt=({event:e,onClick:t,eventCount:n,league:r})=>{const{$t:s}=J(),{data:o}=nue({initialData:e,refetch:!0,reason:"sports-event-row"}),a=rue(),i=r==="nba"&&kce(o.title[0]??""),c=iue(o.team_1,o.team_2),u=i?c:null,f=d.useMemo(()=>[{title:o.team_1.title,score:o.team_1.text,subscore:o.team_1.sub_text,image:o.team_1.img,emphasized:o.team_1.won,period:o.period_text},{title:o.team_2.title,score:o.team_2.text,subscore:o.team_2.sub_text,image:o.team_2.img,emphasized:o.team_2.won,period:o.period_text}],[o]);return l.jsx(aue,{href:o.url?.url_web,onClick:()=>t(o.url?.url_web),children:l.jsx(t0t,{title:o.status==="live"?"LIVE":a(o.datetime,o.datetime_tba,o.datetime_end),isLive:o.status==="live",items:f,period:sue(o.period_text,o.period_time,r,{halftime:s({defaultMessage:"Halftime",id:"iC0AL294Dr"})})??null,eventCount:n,subtitle:u??void 0},o.id)})},Kgt=({events:e,onClick:t,league:n})=>l.jsx("div",{className:z("bg-subtlest grid grid-cols-1 rounded-b-lg md:grid-cols-2",{"lg:grid-cols-3":e.length>2}),children:e.map(r=>l.jsx(qgt,{event:r,onClick:t,eventCount:e.length,league:n},r.id))}),Ygt=e=>{const{locale:t}=J();return e?new Date(e).toLocaleTimeString(t,{hour:"numeric",minute:"numeric",timeZoneName:"short"}):""},Qgt=e=>e.join(" · "),rue=({includeTime:e=!0}={})=>{const{$t:t}=J(),{locale:n}=J();return d.useCallback((r,s,o)=>{if(o){if(!r&&s)return t({defaultMessage:"TBA",id:"ZfAWFLTzx/"});if(!r)return"";const m=new Date(r),p=new Date(o),h=m.getFullYear();if(!(h===new Date().getFullYear())){const w=m.toLocaleDateString(n,{month:"short"}),S=p.toLocaleDateString(n,{month:"short"}),C=m.getDate(),E=p.getDate();return w===S?`${w} ${C}-${E}, ${h}`:`${w} ${C}-${S} ${E}, ${h}`}const y=m.toLocaleDateString(n,{month:"short"}),x=p.toLocaleDateString(n,{month:"short"}),v=m.getDate(),b=p.getDate();let _;if(y===x?_=`${y} ${v}-${b}`:_=`${y} ${v}-${x} ${b}`,e){const w=s?"TBA":m.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});return`${_}, ${w}`}return _}if(!r&&s)return t({defaultMessage:"TBA",id:"ZfAWFLTzx/"});if(!r)return"";const a=new Date(r),i=r&&s,c=a.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});if(qBe(a))return e?`${t({defaultMessage:"Today",id:"zWgbGgjUUg"})}, ${c}`:t({defaultMessage:"Today",id:"zWgbGgjUUg"});if(YBe(a))return e?`${t({defaultMessage:"Yesterday",id:"6dIxDP1C8c"})}, ${c}`:t({defaultMessage:"Yesterday",id:"6dIxDP1C8c"});if(Dee(a))return e?`${t({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"})}, ${c}`:t({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"});if(a.getFullYear()!==new Date().getFullYear())return new Date(a).toLocaleDateString(n,{month:"short",day:"numeric",year:"numeric"});const u=a.toLocaleDateString(n,{month:"short",day:"numeric"});if(!e)return u;const f=i?"TBA":a.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});return`${u}, ${f}`},[n,t,e])},sue=(e,t,n,r)=>{if(n==="mlb")return Xgt(e);if(!e||typeof t?.seconds!="number"&&typeof t?.minutes!="number")return e;if(e==="Halftime")return r.halftime;const s=t?.seconds?.toString().padStart(2,"0")??"00",o=t?.minutes??0;return`${e} ${o}:${s}`},Xgt=e=>e?.replace("Top","▲").replace("Bot","▼"),Zgt=({events:e,showHero:t,widgetSelected:n,league:r})=>{const s=d.useMemo(()=>t?e.slice(1):e,[e,t]),{data:o}=nue({initialData:e[0],refetch:t,reason:"sports-widget-dense"});return l.jsxs(K,{children:[t&&l.jsxs(aue,{href:o?.url?.url_web,onClick:()=>{n(o?.url?.url_web)},children:[l.jsx(Jgt,{event:o,includeBorder:s.length>0,league:r,statusExtra:o&&r==="mlb"&&o.status==="live"?l.jsx(Cgt,{event:{event:o}}):null}),r==="championsleague"&&o&&l.jsx(Ugt,{event:{event:o,brands:[],candlestickData:null,matchEvents:null,matchStats:o.extra?.match_stats??null,eventExtra:null}})]}),l.jsx(Kgt,{events:s,onClick:n,league:r})]})},oue=()=>l.jsx("span",{className:"text-quietest",children:"—"}),aue=({children:e,href:t,onClick:n})=>t?l.jsx(yt,{href:t,className:"group/link group",onClick:n,children:e}):l.jsx("div",{className:"group",onClick:n,children:e}),iue=(e,t)=>{const{$t:n}=J(),r=e.subtitle?.split("-"),s=t.subtitle?.split("-"),o=Hi(r)?+r[0]:null,a=Hi(s)?+s[0]:null,i=4;if(o===null||a===null)return null;const c=o>a?e.abbreviation:t.abbreviation,u=o>a?o:a,f=o>a?a:o;return o>=i||a>=i?n({defaultMessage:"{leadingTeam} Wins {leadingScore}-{trailingScore}",id:"T1UC+k87MZ"},{leadingTeam:c,leadingScore:u,trailingScore:f}):o===a?n({defaultMessage:"Series Tied {team1Record}-{team2Record}",id:"Liahhq+hIg"},{team1Record:o,team2Record:a}):n({defaultMessage:"{leadingTeam} Leads {leadingScore}-{trailingScore}",id:"oO28OWtTlZ"},{leadingTeam:c,leadingScore:u,trailingScore:f})},Jgt=({event:e,includeBorder:t=!1,className:n,league:r,scoreExtra:s,statusExtra:o,displayBranding:a=!0})=>{const{$t:i}=J(),c=e.team_1.title,u=e.team_2.title,f=e.team_1.text,m=e.team_1.sub_text,p=e.team_2.text,h=e.team_2.sub_text,g=r==="nba"&&kce(e.title[0]??""),y=iue(e.team_1,e.team_2),x=g?y:null,v=rue({includeTime:!1}),b=Ygt(e.datetime),_=e.datetime_tba?i({defaultMessage:"TBA",id:"ZfAWFLTzx/"}):b,w=Qgt(e.title),{colorScheme:S}=Ss(),C=sue(e.period_text,e.period_time,r,{halftime:i({defaultMessage:"Halftime",id:"iC0AL294Dr"})}),E=e.team_1.won||e.team_2.won,T=d.useMemo(()=>{let k;return E?a?(e.team_1.won?k=e.team_1.color:k=e.team_2.color,Gce(k?Kn(k):null,S==="dark")):"#1FB8CD":null},[e.team_1.won,e.team_1.color,e.team_2.color,S,E,a]);return l.jsxs(K,{className:z(n,"rounded-inherit relative",{"border-b":t}),children:[E&&l.jsx("div",{className:"rounded-inherit pointer-events-none absolute inset-0 overflow-hidden",style:{color:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"},children:l.jsx(Zce,{className:"-inset-xl rounded-inherit !absolute ![--dog-bg-highlight:currentColor]",dotClassName:"!text-[currentColor]",highlightClassName:"!bg-black/5 dark:!bg-white/5"})}),l.jsx("div",{className:"px-md gap-sm relative flex items-start justify-between pt-[12px]",children:l.jsxs(V,{variant:"tiny",color:"light",children:[w,x&&" · "+x]})}),l.jsxs("div",{className:"p-md md:px-lg md:py-md gap-sm relative grid grid-cols-[1fr_auto_1fr] items-center justify-start md:justify-between md:gap-[12px]",children:[l.jsxs("div",{className:"gap-md flex flex-col-reverse items-center justify-start md:flex-row md:justify-start md:gap-[12px]",children:[l.jsx(LB,{record:e.team_1.subtitle,name:c,logo:a?e.team_1.img:null}),l.jsx("div",{className:"md:mx-auto",children:l.jsx(PB,{position:"leading",score:f,subscore:m,isWinner:e.team_1.won,hasWinner:E,scoreExtra:s,team:e.team_1,teamIdx:0,league:r})})]}),l.jsxs("div",{className:"gap-sm flex flex-col items-center",children:[l.jsx(e0t,{status:e.status,date:v(e.datetime,e.datetime_tba,e.datetime_end),time:_,isUpcoming:e.datetime?jgt(new Date(e.datetime),e.status):void 0,period:C??null}),o]}),l.jsxs("div",{className:"gap-md flex flex-col-reverse items-center justify-start md:flex-row-reverse md:gap-[12px]",children:[l.jsx(LB,{record:e.team_2.subtitle,name:u,logo:a?e.team_2.img:null}),l.jsx("div",{className:"md:mx-auto",children:l.jsx(PB,{score:p,subscore:h,position:"trailing",isWinner:e.team_2.won,hasWinner:E,scoreExtra:s,team:e.team_2,teamIdx:1,league:r})})]})]}),e.live_text&&l.jsx("div",{className:"bg-subtlest px-md relative py-[12px]",children:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-sm line-clamp-1 flex items-start md:items-center",children:[l.jsx(ut,{name:B("broadcast"),size:16,className:"opacity-80 md:-translate-y-px"}),e.live_text]})}),E&&l.jsx("div",{className:"rounded-inherit pointer-events-none absolute inset-0 opacity-20 mix-blend-multiply dark:opacity-60 dark:mix-blend-soft-light",style:{backgroundColor:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}}),!t&&E&&l.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-[12px] border opacity-40",style:{borderColor:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}}),!t&&E&&l.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-[13px] border opacity-20 dark:opacity-40",style:{borderColor:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}})]})},PB=({score:e,subscore:t,position:n,emptyPlaceholder:r=l.jsx(oue,{}),isWinner:s,hasWinner:o,scoreExtra:a,team:i,teamIdx:c,league:u})=>{const{isMobileStyle:f}=Re(),m=u==="ipl"||u==="cricket"||u==="icc"||u==="atp"||u==="wta";return l.jsxs("div",{className:z("md:gap-xs flex flex-col items-center justify-center",{"items-start":n==="leading","items-end":n==="trailing","opacity-50":o&&!s}),children:[l.jsxs(V,{variant:f?m?"section-title":"display":"section-title",className:"gap-xs md:gap-sm flex items-center sm:!text-2xl lg:!text-3xl",children:[s&&n==="trailing"&&l.jsx(OB,{className:"size-3 rotate-180 md:size-4"}),l.jsxs("span",{className:"font-mono",children:[a&&l.jsx("span",{className:"mr-xs",children:a(i,c)}),e??r]}),s&&n==="leading"&&l.jsx(OB,{className:"size-2.5 md:size-4"})]}),t&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:"font-mono",children:t})})]})},OB=({className:e})=>l.jsx("svg",{width:"6",viewBox:"0 0 18 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 0.322327L0.822266 17.5L18 34.6777V0.322327Z",className:"fill-foreground"})}),LB=({name:e,logo:t,record:n})=>e?l.jsxs("div",{className:"gap-sm flex flex-col items-center justify-between md:gap-0",children:[t&&l.jsx(h0,{logo:t,color:"#000000"}),l.jsx(V,{variant:"baseSemi",children:e}),n&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:"font-mono",children:n})})]}):null,e0t=({status:e,date:t,time:n,isUpcoming:r,variant:s="stacked",period:o})=>{const a=e==="live",i=e==="final",{isMobileStyle:c}=Re();return l.jsx("div",{className:z("gap-sm flex",{"flex-row items-center":s==="row","flex-col items-center justify-center":s==="stacked"}),children:a?l.jsxs("div",{className:"gap-sm flex flex-col items-center",children:[l.jsx(um,{size:c?"small":"default",includeDot:!0}),o&&l.jsx(V,{variant:"tiny",color:"light",children:o})]}):l.jsxs("div",{className:z("gap-xs flex",{"flex-col":s==="stacked","flex-row items-center":s==="row"}),children:[r&&l.jsx($ce,{textCenter:!0,className:"mb-1 hidden md:block"}),i&&l.jsx(l_,{textCenter:!0,className:"-mt-0.5 md:mb-1 md:mt-0 md:block"}),l.jsx(V,{variant:"tiny",color:"light",className:"w-full whitespace-nowrap text-center",children:t}),n&&!i&&l.jsx(V,{variant:"tiny",color:"light",className:"w-full whitespace-nowrap text-center",children:n})]})})},t0t=({items:e,title:t,subtitle:n,isLive:r,period:s,eventCount:o})=>{const a=e.some(f=>f.emphasized),{isMobileStyle:i}=Re(),{isLargeScreen:c,isMediumScreen:u}=GN();return l.jsx(K,{variant:"raised",className:z("px-md h-full py-[12px]",{"border-b border-r-0 group-last:border-b-0 group-even:border-r-0":i,"border-b group-odd:border-r":u&&!c,"group-[&:nth-child(2n):nth-last-child(-n+3)~a]:border-b-0":u&&!c&&o>2,"border-b border-r group-[&:nth-child(3n)]:border-r-0":c,"group-[&:nth-child(3n):nth-last-child(-n+4)~a]:border-b-0":c&&o>3,"!border-b-0":c&&o<=3||u&&!c&&o<=2}),children:l.jsxs("div",{className:"gap-sm flex size-full flex-col items-start justify-between duration-150 group-hover/link:opacity-75",children:[r?l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(um,{size:"small",className:"-ml-1"}),s&&l.jsx(V,{variant:"tiny",color:"super",children:s})]}):t?l.jsx(V,{variant:"tinyRegular",color:"light",children:t}):null,l.jsx("div",{className:"w-full",children:e.map((f,m)=>l.jsx(n0t,{item:f,anyEmphasized:a},f.title+m))}),n&&l.jsx(V,{variant:"tinyRegular",color:"light",children:n})]})})},n0t=({item:e,anyEmphasized:t})=>{const n=d.useMemo(()=>e.score?e.subscore?`${e.score} ${e.subscore}`:e.score:l.jsx(oue,{}),[e.score,e.subscore]);return l.jsxs(K,{className:"flex w-full items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[e.image&&l.jsx("img",{src:e.image,alt:e.title,className:"size-[24px]"}),l.jsx(V,{variant:e.emphasized?"smallBold":"small",color:t&&!e.emphasized?"light":"default",children:e.title})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[e.emphasized&&l.jsx(ut,{name:B("trophy"),size:14,className:"text-super -translate-y-half"}),l.jsx(V,{variant:e.emphasized?"smallBold":"small",color:t&&!e.emphasized?"light":"default",children:n})]})]})},lue=A.memo(()=>l.jsx("div",{children:"Error loading individual event widget."}));lue.displayName="IndvEventsWidgetErrorFallback";const FB=new Set,r0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})},s0t=(e,t)=>{if(!e)return"";try{return new Date(e).toLocaleDateString(t,{month:"short",day:"numeric"})}catch{return""}},o0t=(e,t)=>{if(!e)return"";try{return new Date(e).toLocaleTimeString(t,{hour:"numeric",minute:"2-digit",hour12:!0}).replace(/^0+/,"")}catch{return""}},cue=({competitor:e})=>l.jsxs(K,{className:"gap-sm border-subtlest px-md py-sm flex items-center border-b last:border-b-0",children:[l.jsx(V,{className:"w-4 text-center",children:e.rank}),l.jsxs("div",{className:"gap-sm flex grow items-center",children:[e.primary_img_url?l.jsx(h0,{logo:e.primary_img_url,color:"transparent",size:"small",className:"shrink-0"}):l.jsx(K,{className:"flex h-5 w-8 shrink-0 items-center justify-center rounded-sm bg-[#44403c] text-xs",children:e.abbreviation}),l.jsxs("div",{className:"flex grow flex-col",children:[l.jsx(V,{variant:"smallBold",children:e.title}),l.jsxs(V,{variant:"tiny",color:"light",children:[e.metadata[0]," "]})]})]}),l.jsxs(K,{className:"flex flex-col items-end text-right",children:[l.jsx(V,{variant:"smallBold",children:e.metadata[1]}),l.jsx(V,{variant:"tiny",color:"light",children:e.metadata[2]})]})]},e.id),a0t=({event:e,league:t})=>{const{locale:n}=J(),r=e.subtitle,{$t:s}=J(),o=o0t(e.datetime,n),a=e.datetime?Wme(new Date(e.datetime))?s({defaultMessage:"Today",id:"zWgbGgjUUg"}):Dee(new Date(e.datetime))?s({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"}):new Date(e.datetime).toLocaleDateString(n,{weekday:"short",month:"short",day:"numeric"}):"";return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"p-md border-subtler flex items-end justify-between border-b",children:[l.jsxs(K,{className:"flex flex-col",children:[l.jsx(V,{variant:"baseSemi",children:e.title.join(" ")}),l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),r&&`・${r}`]})]}),l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx(V,{variant:"small",children:a}),l.jsx(V,{variant:"small",color:"light",children:o})]})]}),e.image_url&&l.jsx(K,{className:"aspect-video w-full overflow-hidden rounded-lg bg-[#292524]",children:l.jsx(Wo,{src:e.image_url,alt:`${e.title.join(" ")} circuit map`,className:"size-full object-contain"})}),l.jsx(K,{className:"gap-xs p-md flex flex-col",children:e.metadata?.map((i,c)=>l.jsxs(K,{className:"flex justify-between",children:[l.jsx(V,{className:"text-sm",color:"light",children:i[0]}),l.jsx(V,{className:"text-sm",children:i[1]})]},c))})]})},i0t=({event:e,league:t})=>{const{locale:n}=J(),r=s0t(e.datetime,n),s=e.competitors.slice(0,3),o=e.subtitle;return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"border-subtler px-md py-sm gap-md flex items-center justify-between border-b",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",className:"flex justify-between",children:l.jsx("span",{children:e.title.join(" ")})}),l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),o&&`・${o}`]})]}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:"small",color:"light",children:r}),l.jsx(l_,{})]})]}),l.jsx(K,{className:"flex flex-col",children:s.map(a=>l.jsx(cue,{competitor:a},a.id))})]})},l0t=({event:e,league:t})=>{const n=e.competitors.slice(0,3),r=e.subtitle;return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"border-subtler px-md py-sm gap-md flex items-center justify-between border-b",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",className:"flex justify-between",children:l.jsx("span",{children:e.title.join(" ")})}),l.jsx("div",{children:l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),r&&`・${r}`]})})]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(um,{includeDot:!0}),e.period_text&&l.jsx(V,{color:"light",variant:"small",children:e.period_text})]})]}),l.jsx(K,{className:"flex flex-col",children:n.map(s=>l.jsx(cue,{competitor:s},s.id))})]})},c0t=({event:e,league:t})=>{switch(e.status){case"upcoming":return l.jsx(a0t,{event:e,league:t});case"live":return l.jsx(l0t,{event:e,league:t});case"final":return l.jsx(i0t,{event:e,league:t});default:return null}};function u0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=d.useMemo(()=>e?.event,[e]),o=d.useMemo(()=>e?.league,[e]);if(d.useEffect(()=>{!t||!e||!s||FB.has(t)||(r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n}),FB.add(t))},[t,s,n,e,r]),!e||!s)return null;const a=e.canonical_page?.url_web,i=`indv-event-${s.id??"unknown"}`;return l.jsx(Mr,{fallback:lue,children:l.jsx(Es,{widgetType:"sports",widgetName:i,children:({})=>l.jsx(r0t,{canonicalPageLink:a,children:l.jsx(c0t,{event:s,league:o})})})})}const uue=A.memo(()=>l.jsx("div",{children:"Error loading individual schedule widget."}));uue.displayName="IndvScheduleWidgetErrorFallback";const BB=new Set,d0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})},f0t=(e,t,n)=>{if(!e)return t.replace(/^(0)(\d:[0-5]\d\s+[AP]M)$/,"$2");try{return new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).replace(/^0+/,"")}catch{return t.replace(/^(0)(\d:[0-5]\d\s+[AP]M)$/,"$2")}},IS=({event:e,isFinal:t,isLive:n})=>{const{locale:r}=J(),s=e.metadata?.[0],o=e.metadata?.[1]??"",a=f0t(e.datetime,o,r),{isMobileStyle:i}=Re(),c=!!e.url?.url_web,u=l.jsxs(l.Fragment,{children:[l.jsxs(K,{className:"p-md col-span-3 grid grid-cols-subgrid items-center md:col-span-4",children:[l.jsx(K,{className:"flex flex-col items-start",children:l.jsx(p0t,{date:e.datetime??""})}),l.jsxs(K,{className:"gap-xs flex flex-col md:gap-0",children:[l.jsx(V,{variant:"baseSemi",className:"text-base leading-snug",children:e.title.join(" ")}),s&&l.jsxs(V,{variant:i?"tiny":"small",className:"mt-0 pt-0",color:"light",children:[!t&&!n&&l.jsxs(l.Fragment,{children:[a," · "]}),s]})]}),l.jsx("div",{className:"hidden md:block",children:e.live_text&&l.jsx(V,{variant:"small",className:"text-right",children:e.live_text})}),l.jsx("div",{children:t?l.jsx(l_,{}):n?l.jsx(um,{includeDot:!0}):null})]}),l.jsx("div",{className:"p-md -mt-sm col-span-2 col-start-2 pl-0 pt-0 md:hidden",children:e.live_text&&l.jsx(V,{variant:"tiny",className:"border-subtlest p-xs px-sm rounded border",color:"light",children:e.live_text})})]}),f="col-span-3 grid grid-cols-subgrid border-b border-subtlest last:border-b-0 md:col-span-4";return c?l.jsx(yt,{href:e.url?.url_web??"",className:z(f,"hover:bg-subtler duration-150"),children:u}):l.jsx(K,{className:f,children:u})};function m0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=d.useMemo(()=>e?.events??[],[e]);if(d.useEffect(()=>{!t||!e||!s?.length||BB.has(t)||(r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n}),BB.add(t))},[t,e,s,n,r]),!e||!s||s.length===0)return null;const o=e.canonical_page?.url_web,a=`indv-schedule-${e.league??"unknown"}`;return l.jsx(Mr,{fallback:uue,children:l.jsx(Es,{widgetType:"sports",widgetName:a,children:({})=>l.jsx(d0t,{canonicalPageLink:o,children:l.jsx(K,{className:"gap-x-md grid grid-cols-[min-content,1fr,min-content] md:grid-cols-[min-content,1fr,1fr,min-content]",children:s.map(i=>{switch(i.status){case"upcoming":return l.jsx(IS,{event:i},i.id);case"live":return l.jsx(IS,{event:i,isLive:!0},i.id);case"final":return l.jsx(IS,{event:i,isFinal:!0},i.id);default:return null}})})})})})}const p0t=({date:e})=>{const{locale:t}=J(),n=new Date(e).toLocaleDateString(t,{day:"numeric"}),r=new Date(e).toLocaleDateString(t,{month:"short"}),{isMobileStyle:s}=Re();return l.jsxs("div",{className:"dark:bg-subtle bg-subtler py-xs flex w-full flex-col items-center justify-center rounded-lg px-0.5 md:p-[6px]",children:[l.jsx(V,{className:"px-sm -mb-0.5 rounded-full text-center",variant:"tinyRegular",color:"light",children:r}),l.jsx(V,{className:"px-sm -mb-1 text-center",variant:s?"baseSemi":"section-title",children:n})]})},due=({headshotImageUrl:e,flagUrl:t,name:n,isCompositeFlag:r})=>!e&&!t?null:l.jsxs("div",{className:"relative size-6 shrink-0 rounded md:size-8",children:[l.jsx("img",{src:e??t,alt:n,className:z("rounded-inherit relative size-full shrink-0",{"object-contain":r,"object-cover":!r})}),!r&&l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-black/10 dark:border-white/10"}),e&&l.jsxs("div",{className:"ml-xs ring-raised absolute right-[90%] top-[90%] size-3 shrink-0 -translate-y-1/2 translate-x-1/2 rounded-full ring-2 md:size-4",children:[l.jsx("img",{src:t,alt:n,className:"rounded-inherit relative size-full shrink-0 object-cover"}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-black/10 dark:border-white/10"})]})]}),h0t=e=>{for(const t of e)for(const n of t.cells)if(n.extra?.is_current_round)return n.column_id;return null},fue=({value:e,variant:t="red"})=>{if(!e)return null;const n=t==="subtle";return l.jsx(K,{variant:t,className:"inline-flex h-5 items-center whitespace-nowrap rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:z("translate-y-half tracking-wider",{uppercase:!n}),children:e})})};fue.displayName="StatusDisplay";const G1=(e,t)=>{const n=e.display_value??e.value??"",r=t.font_weight==="bold"?"smallBold":"small",s=e.extra;return l.jsx(V,{variant:r,className:s?.is_current_round?"font-bold":"",children:n})},g0t={pos_golf:(e,t)=>{const n=e.display_value??e.value??"",r=t.font_weight==="bold"?"smallBold":"small";return e.extra?.show_trophy?l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(ge,{icon:B("trophy"),size:"md",className:"text-super"})}):l.jsx(V,{variant:r,color:"light",children:n})},golfer_golf:(e,t)=>{const n=String(e.display_value??""),r=e.image_url??void 0,s=e.value,o=e.sub_text,a=t.font_weight==="bold"?"smallBold":"small";return l.jsxs("div",{className:"md:gap-md gap-sm flex items-center",children:[l.jsx(due,{headshotImageUrl:r,flagUrl:s,name:n}),l.jsxs("div",{children:[l.jsx(V,{variant:a,children:n}),o&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]})]})},status_golf:e=>{const t=e.display_value??e.value??"",r=/am|pm/i.test(String(t))?"subtle":"red";return l.jsx(fue,{value:t,variant:r})},total_golf:(e,t)=>{const n=e.display_value??e.value??"E",r=typeof e.value=="number"?e.value:0,s=t.font_weight==="bold"?"smallBold":"small";let o="default";return r<0?o="positive":r>0&&(o="negative"),l.jsx(V,{variant:s,color:o,children:n})},r1:G1,r2:G1,r3:G1,r4:G1},y0t={status_golf:()=>null},x0t=({result:e})=>{let t="",n=null;return e==="W"?(t="bg-[#059669] text-white",n=B("check")):e==="D"?(t="bg-[#64748b] text-white",n=B("minus")):e==="L"&&(t="bg-[#e11d48] text-white",n=B("x")),l.jsx("div",{className:z("flex size-4 items-center justify-center rounded-full",t),children:n&&l.jsx(ut,{name:n,size:12})})},mue=({form:e})=>{const t=String(e).replace(/\s/g,"");return l.jsx("div",{className:"flex gap-0.5",children:t.split("").map((n,r)=>l.jsx(x0t,{result:n},r))})};mue.displayName="FormDisplay";const v0t=({value:e})=>{const t=e.includes("↑"),n=e.includes("↓"),r=e==="-",s=e.replace(/[^0-9]/g,"");return l.jsxs("div",{className:"flex items-center justify-center gap-0.5",children:[l.jsx(ge,{icon:t?B("caret-up-filled"):n?B("caret-down-filled"):B("minus"),size:"sm",className:z("scale-90",{"text-quietest":r,"text-positive":t,"text-negative":n})}),!r&&l.jsx(V,{variant:"tinyMono",color:t?"positive":"negative",className:"w-[2ch] shrink-0 text-left",children:s})]})},b0t={form:e=>{const t=e.display_value??e.value??"";return l.jsx(mue,{form:String(t)})},movement:e=>{const t=e.display_value??e.value??"";return l.jsx(v0t,{value:String(t)})}},pue={...b0t,...g0t},_0t={...y0t},hue=(e="left")=>{switch(e){case"center":return"text-center";case"right":return"text-right";case"left":default:return"text-left"}},w0t=(e=!1)=>e?"w-full":"w-0",PS=(e="normal",t)=>{if(t==="pos")return"smallCaps";switch(e){case"bold":return"smallBold";case"normal":default:return"small"}},C0t=(e="")=>e==="pos"?"light":"default",S0t=({cell:e,column:t,columns:n,rows:r,columnRenderers:s=pue})=>{const{inApp:o}=Sa();if(!e)return l.jsx("td",{className:"md:px-md p-sm"});let a;const i=t.column_type??"text",c=e.display_value??e.value??"-";t.column_id&&s[t.column_id]?a=s[t.column_id]?.(e,t,{columns:n,rows:r}):(i==="entity"||i==="image")&&e.image_url?a=l.jsxs("div",{className:"md:gap-md gap-sm flex items-center",children:[l.jsx(h0,{logo:e.image_url,color:"transparent",size:"small",className:"shrink-0"}),l.jsxs("div",{children:[l.jsx(V,{variant:PS(t.font_weight??"normal",t.column_id),children:c}),i==="entity"&&e.sub_text&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]})]}):i==="entity"&&!e.image_url?a=l.jsxs("div",{children:[l.jsx(V,{variant:PS(t.font_weight??"normal",t.column_id),children:c}),e.sub_text&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]}):a=l.jsx(V,{variant:PS(t.font_weight??"normal",t.column_id),color:C0t(t.column_id),children:c});const u=z("md:pl-md pl-sm last:px-sm md:last:px-md py-sm align-middle",hue(t.alignment),w0t(t.should_fill_width));return e.canonical_page?l.jsx("td",{className:u,children:l.jsx(Zg,{href:o?e.canonical_page.url_app:e.canonical_page.url_web,className:"block",children:a})}):l.jsx("td",{className:u,children:a})},E0t=({row:e,rows:t,columns:n,columnRenderers:r})=>{if(e.section_header)return l.jsx(K,{as:"tr",children:l.jsx(K,{as:"td",colSpan:n.length,className:"pl-sm md:pl-md py-sm",children:l.jsx(K,{variant:"superLight",className:"inline-flex h-5 items-center rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:"translate-y-half uppercase tracking-wider",children:e.section_header})})})});const s=new Map(e.cells.map(o=>[o.column_id,o]));return l.jsx("tr",{className:"border-subtlest border-b last:border-b-0",children:n.map(o=>l.jsx(S0t,{cell:s.get(o.column_id),column:o,columns:n,rows:t,columnRenderers:r},o.column_id))})},k0t=({table:e,variant:t="subtler",title:n,className:r,noWrapTitle:s=!1,onGroupClick:o,columnRenderers:a,headerRenderers:i})=>{const[c,u]=d.useState(e?.groups?.[0]?.group_id??""),[f,m]=d.useState(!1),{$t:p}=J();if(Rf("standings"),!e||!e.groups?.length)return null;const h=n??e.title??"Standings",g=e.groups.find(S=>S.group_id===c),y=e.groups.length>1;if(!g)return null;const x=f?g.rows:g.rows.slice(0,10),v=h0t(g.rows),b={...pue,...a},_={..._0t,...i};v&&!_[v]&&(_[v]=S=>l.jsx(K,{variant:"super",className:"inline-flex h-5 items-center rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:"translate-y-half uppercase tracking-wider",children:S.header_label})}));const w=e.groups.map(S=>({type:"default",text:S.title??S.group_id,onClick:()=>{u(S.group_id),o?.(S.group_id)},active:c===S.group_id,show:!0}));return l.jsx(dr,{className:r,header:l.jsxs("div",{className:"md:pl-md gap-sm sm:gap-md flex flex-col sm:flex-row sm:items-center sm:justify-between",children:[l.jsx(V,{variant:"baseSemi",className:z(s?"flex-shrink-0":void 0,"max-sm:pl-sm"),children:h}),y?l.jsx(zs,{items:w,isMobileStyle:!1,wrapperClassName:"min-w-0",children:l.jsx(Ge,{text:g.title??g.group_id,chevron:!0,size:"small",extraCSS:"w-full mb-sm"})}):l.jsx("div",{className:"invisible min-h-10"})]}),children:l.jsxs("div",{className:"rounded-inherit",children:[l.jsx("div",{className:"rounded-t-inherit overflow-hidden",children:l.jsx(nl,{orientation:"horizontal",children:l.jsxs("table",{className:"w-full table-auto border-collapse",children:[l.jsx(K,{as:"thead",variant:t==="raised"?"raisedOffset":"subtle",children:l.jsx("tr",{children:g.columns.map(S=>{const C=_[S.column_id],E=C?C(S):S.header_label;return l.jsx("th",{className:z("md:pl-md pl-sm last:px-sm md:last:px-md py-xs whitespace-nowrap align-middle",hue(S.alignment)),children:E?l.jsx(Mgt,{className:z({"w-[200px] md:w-auto":S.should_fill_width}),children:E}):null},S.column_id)})})}),l.jsx("tbody",{children:x.map(S=>l.jsx(E0t,{row:S,rows:g.rows,columns:g.columns,columnRenderers:b},S.row_id))})]})})}),g.rows.length>10&&l.jsx(K,{className:"p-xs border-t",children:l.jsx(st,{text:p(f?{id:"UOYN/MXiOT",defaultMessage:"View Less"}:{id:"wbcwKddwLa",defaultMessage:"View All"}),size:"small",fullWidth:!0,onClick:()=>m(S=>!S)})})]},g.group_id)})},gue=A.memo(()=>l.jsx("div",{children:"Error loading standings widget."}));gue.displayName="StandingsWidgetErrorFallback";const M0t=new Set,T0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})};function A0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=d.useMemo(()=>e?.standings_table?e.standings_table:null,[e]);if(d.useEffect(()=>{!t||!e||!s||M0t.has(t)||r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n})},[t,s,n,e,r]),!e||!s)return null;const o=e.canonical_pages?.[0]?.url_web,a=`standings-${s.table_id??"unknown"}`;return l.jsx(Mr,{fallback:gue,children:l.jsx(Es,{widgetType:"sports",widgetName:a,children:({})=>l.jsx(T0t,{canonicalPageLink:o,children:l.jsx(k0t,{table:s,variant:"raised",className:"!rounded-none border-0"})})})})}const N0t={staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0},R0t=({event:e,team1:t,team2:n,isLive:r})=>{const s=e.datetime&&new Date(e.datetime)>new Date,o=r?t.sub_text:null,a=r?n.sub_text:null,{isMobileStyle:i}=Re(),c=d.useMemo(()=>e?.stat_columns?.map(f=>({team1:{score:f.team_1_text,scoreSuper:f.team_1_super_text,emphasis:f.team_1_emphasis,super:!1},team2:{score:f.team_2_text,scoreSuper:f.team_2_super_text,emphasis:f.team_2_emphasis,super:!1}})),[e?.stat_columns]),u=d.useMemo(()=>r?[...c??[],{team1:{score:t.text,scoreSuper:null,emphasis:!1,super:!0},team2:{score:n.text,scoreSuper:null,emphasis:!1,super:!0}}]:c,[c,r,t.text,n.text]);return s?l.jsxs("div",{className:"gap-sm pr-sm flex h-full flex-col justify-around",children:[l.jsx(V,{variant:"base",color:"ultraLight",className:"opacity-50",children:"—"}),l.jsx(V,{variant:"base",color:"ultraLight",className:"opacity-50",children:"—"})]}):c?l.jsxs("div",{className:z("gap-x-md grid h-16 auto-cols-auto grid-flow-col",{"gap-x-sm":i}),children:[u?.map((f,m)=>l.jsxs("div",{className:"gap-sm grid h-full grid-cols-subgrid",children:[l.jsx("div",{className:"flex items-center",children:l.jsxs(V,{variant:i?"smallBold":"section-title",className:"min-w-[2ch] text-center !font-mono leading-none",color:f.team1.super&&f.team1.score?"super":f.team1.emphasis?"default":"ultraLight",children:[f.team1.score??"—",f.team1.scoreSuper&&l.jsx("sup",{className:"-translate-y-sm text-2xs !font-mono tracking-tight",children:f.team1.scoreSuper})]})}),l.jsx("div",{className:"flex items-center",children:l.jsxs(V,{variant:i?"smallBold":"section-title",className:"min-w-[2ch] text-center !font-mono leading-none",color:f.team2.super&&f.team2.score?"super":f.team2.emphasis?"default":"ultraLight",children:[f.team2.score??"—",f.team2.scoreSuper&&l.jsx("sup",{className:"-translate-y-sm text-2xs !font-mono tracking-tight",children:f.team2.scoreSuper})]})})]},m)),(o||a)&&l.jsxs("div",{className:"gap-sm grid h-full grid-cols-subgrid place-items-center",children:[l.jsx(UB,{score:o}),l.jsx(UB,{score:a})]})]}):null},UB=({score:e})=>{const{isMobileStyle:t}=Re();return l.jsx(K,{variant:"superLight",className:z("px-xs flex w-full items-center justify-center rounded py-0.5",{"opacity-0":!e}),children:l.jsx(V,{variant:t?"smallBold":"section-title",color:"super",className:"flex min-w-[2ch] items-center justify-center",children:l.jsx("span",{className:"font-mono",children:e??"—"})})})},D0t=({children:e,className:t})=>l.jsx(Te.div,{layout:!0,layoutRoot:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{ease:Kr,duration:.5},className:z("p-sm isolate flex-col items-end md:flex",t),children:l.jsx("ul",{className:"-mb-xs flex w-full flex-col items-start",children:l.jsx(yg,{id:"index",children:e})})}),yue=A.memo(({extraCss:e})=>l.jsx(K,{className:`h-[12px] w-[60px] rounded-full ${e}`,variant:"subtler"}));yue.displayName="ArticleSkeletonItem";const j0t=({widgetData:e,onClick:t,highlighted:n,idx:r})=>l.jsxs("div",{className:"gap-xs pt-sm ml-6 flex items-center",onClick:t.bind(null,e.id),children:[l.jsx(V,{className:z("border-subtler bg-base relative -top-px inline-flex size-4 shrink-0 scale-[.85] items-center justify-center rounded-full border shadow-sm duration-150",{"border-foreground bg-inverse !text-inverse opacity-70":n}),variant:"smallCaps",color:"light",children:r+1}),l.jsx(V,{variant:"tiny",color:n?void 0:"light",className:z("line-clamp-1 cursor-pointer opacity-80 duration-150 hover:!opacity-100",{"!opacity-100":n}),children:e.name})]}),I0t=({highlighted:e,scrollTopOffset:t,scrollThumbHeight:n,widgets:r,loading:s})=>l.jsxs("div",{className:z("bg-base w-two absolute inset-y-0 left-0 z-[2] rounded-full",{"opacity-0 delay-1000":!e}),children:[l.jsx("div",{className:z("absolute inset-0 overflow-hidden duration-150",{"opacity-0":r.length===0||!e,"opacity-1":r.length>0}),children:l.jsx("div",{className:z("absolute left-0 top-0 w-full rounded-full",{"bg-inverse/70":s},{"bg-inverse":!s}),style:{top:`min(${t}%, calc(100% - 8px - ${n}%))`,height:n+"%"}})}),l.jsx("div",{className:"bg-inverse/10 absolute inset-0 rounded-full"})]}),xue=(e,t,n=100)=>{const s=e.getBoundingClientRect().top,o=t.clientHeight/2;return s-o<=n},P0t=({title:e,onClick:t,idx:n,onWidgetClick:r,highlighted:s=!1,isStaged:o,loading:a,id:i,widgets:c=Pe,ref:u,testId:f})=>{const m=s&&!a,[p,h]=d.useState(0),[g,y]=d.useState(0),[x,v]=d.useState(""),b=2,{entityRefs:_}=Joe(),{scrollContainerRef:w}=ka(),S=d.useRef(null),C=d.useCallback(()=>{const k=u?.current;if(k){const I=k.getBoundingClientRect().height,M=k.getBoundingClientRect().top;h(Math.max((1-(I+M)/I)*100,0))}},[u]),E=d.useMemo(()=>px(()=>{let k=[];Object.keys(_).map(I=>{_[I]?.current&&w?.current&&xue(_[I]?.current,w.current)&&(k=[...k,I])}),v(k[k.length-1]??"")},100),[v,_,w]);d.useEffect(()=>{const k=w.current;if(k)return c&&c.length>=b&&s?(k.addEventListener("scroll",E),k.addEventListener("scroll",C)):(k.removeEventListener("scroll",E),k.removeEventListener("scroll",C)),()=>{k.removeEventListener("scroll",E),k.removeEventListener("scroll",C)}},[s,E,C,c,w]),d.useEffect(()=>{const k=u?.current;if(S.current&&(S.current.disconnect(),S.current=null),k?.nodeType===Node.ELEMENT_NODE){const I=new ResizeObserver(([M])=>{if(M&&Hi(M.borderBoxSize)){const{blockSize:N}=M.borderBoxSize[0];y(window.innerHeight/N*100)}});I.observe(k),S.current=I}return()=>{S.current?.disconnect(),S.current=null}},[u,n]);const T=d.useMemo(()=>c.length>=b&&l.jsx("span",{className:"ml-xs inline-flex",children:l.jsx(ge,{icon:B("chevron-down"),size:"xs"})}),[c.length,b]);return l.jsxs(br,{as:"li",active:a,speed:"slow",className:"group relative flex select-none flex-col",children:[l.jsx(pi,{mode:"popLayout",initial:!0,children:l.jsx(Oo,{children:o&&!e?l.jsx("div",{className:"ml-md flex h-[20px] items-center",children:l.jsx(yue,{extraCss:"!w-[100px] !h-[10px]"})}):l.jsxs("div",{children:[l.jsx("div",{onClick:t.bind(null,n),"data-testid":f,children:l.jsxs(V,{variant:"small",color:m?"default":o?"ultraLight":"light",className:z("gap-xs pl-md line-clamp-2 cursor-pointer opacity-80 duration-150 group-hover:opacity-100",{"font-[450] !opacity-100":m}),children:[e,T]})}),s&&!o&&c.length>=b&&l.jsx(Te.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0,transition:{delay:.15}},exit:{opacity:0,y:-4},className:"pb-1",children:c.map((k,I)=>{const M=k.meta_data;return M.object==="ShopifyWidget"?l.jsx(j0t,{widgetData:M,onClick:r,idx:I,highlighted:!a&&x===k.meta_data?.id},k.meta_data?.id):null})},e)]})},o&&!e?"placeholder":e)}),l.jsx("div",{className:"h-sm text-inverse relative z-[5] inline-flex w-full",children:l.jsx("svg",{width:"2",height:"10",viewBox:"0 0 2 10",fill:"none",className:"inline-flex",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M2 0C2 0.552284 1.55228 1 1 1C0.447716 1 0 0.552284 0 0V10C0 9.44772 0.447716 9 1 9C1.55228 9 2 9.44772 2 10V0Z",fill:"currentColor"})})}),a&&l.jsx("div",{className:"w-two absolute inset-y-0 left-0 z-[4] animate-pulse rounded-full",children:l.jsx("div",{className:"bg-inverse absolute inset-0 opacity-10"})}),l.jsx("div",{className:z("bg-base w-two absolute inset-y-0 left-0 z-[3] opacity-0 duration-150",{"!opacity-100":o})}),c.length>=b&&l.jsx(I0t,{highlighted:s,scrollTopOffset:p,scrollThumbHeight:g,widgets:c,loading:a??!1}),s&&l.jsx(Te.div,{layoutId:"layout"+i,transition:{ease:Kr,duration:.3},className:z("bg-inverse w-two absolute inset-y-0 left-0 z-[1] rounded-full",{"!bg-inverse/70":o||a},{"opacity-0 delay-100":c.length>=b})}),l.jsx("div",{className:"bg-inverse w-two absolute inset-y-0 left-0 z-[1] rounded-full opacity-10 duration-150"})]})},O0t=({items:e,sectionRefs:t,onItemClick:n,onWidgetClick:r,className:s,id:o})=>{const[a,i]=d.useState(0),c=h=>{r?.(h)},{scrollContainerRef:u}=ka(),f=h=>{n(h)},m=d.useMemo(()=>px(()=>{if(!u?.current)return;const h=u.current;if((h?.scrollTop??0)===0){i(0);return}if(mE(h)){i(e.length-1);return}let y=[];Array.from({length:Object.keys(t).length}).map((x,v)=>{const b=t?.[v]?.current;b&&xue(b,h,0)&&(y=[...y,v])}),i(y[y.length-1]??0)},100),[t,i,e.length,u]),p=d.useCallback(()=>{m()},[m]);return d.useEffect(()=>{const h=u?.current;return h?.addEventListener("scroll",p),()=>{h?.removeEventListener("scroll",p)}},[p,u]),l.jsx(D0t,{className:s,children:e.filter(h=>h.show).map((h,g)=>l.jsx(P0t,{title:h.title,onClick:f,onWidgetClick:c,idx:g,loading:h.loading,highlighted:g===a,isStaged:h.staged,id:o,testId:h.testId,widgets:h.widgets,ref:t[g]},h.id))})},L0t=A.memo(()=>l.jsx("div",{}));L0t.displayName="MenuSectionErrorFallback";const F0t=A.memo(({children:e,entries:t,className:n,showMenu:r=!0,header:s,footer:o,variant:a="default",id:i})=>{const{isMobileStyle:c}=Re();return l.jsxs("div",{className:z(n,"mx-md mb-md max-w-threadWidth gap-x-lg md:mx-lg relative md:grid",{"grid-cols-4":a==="default","grid-cols-3":a==="twoThirds"}),children:[l.jsx("div",{className:z("space-y-md pt-md",{"col-span-3":a==="default","col-span-2":a==="twoThirds"}),children:e}),l.jsx("div",{className:z("relative",{"col-span-1 col-start-4":a==="default","col-span-1":a==="twoThirds"}),children:r&&!c&&l.jsxs("div",{className:"sticky top-0",children:[s&&l.jsx("div",{children:s}),l.jsx(vue,{entries:t,id:i}),o&&l.jsx("div",{children:o})]})})]})});F0t.displayName="WithMenu";const vue=A.memo(({entries:e,id:t})=>{const{scrollContainerRef:n}=ka();A.useEffect(()=>{const a=window.location.hash.slice(1);if(a){const i=e.find(c=>c.id===a);i?.ref.current&&VB(i.ref.current,!1,n.current)}},[e,n]);const r=d.useMemo(()=>Object.fromEntries(e.filter(a=>a.show).map((a,i)=>[i,a.ref])),[e]),s=d.useMemo(()=>e.map(a=>({title:a.title,id:a.id,loading:!1,show:a.show??!0})).filter(a=>a.show),[e]),o=d.useCallback(a=>{r[a]?.current&&VB(r[a].current,!0,n.current)},[r,n]);return l.jsx(O0t,{className:"pt-md",items:s,sectionRefs:r,onItemClick:o,id:`menu-list-${t}`})});vue.displayName="MenuList";function VB(e,t=!0,n){const r=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--header-height"))||50,s=parseFloat(window.getComputedStyle(e).marginTop),{top:o}=e.getBoundingClientRect();if(!n)return;const a=o+n.scrollTop-r-s;n.scrollTo({top:a,behavior:t?"smooth":"auto"})}const bue=A.memo(({query:e,children:t,nofollow:n=!0,sources:r,...s})=>{const o=`/search/new?q=${encodeURIComponent(e)}${r?`&sources=${r.join(",")}`:""}`,a=d.useCallback(()=>f0e({query:e}),[e]);return l.jsx(yt,{href:d0e()?void 0:o,rel:n?"nofollow":void 0,onClick:a,...s,children:t})});bue.displayName="CanonicalQuery";function B0t(e,t){return e==null?1:t==null?-1:e==null&&t==null?0:!isNaN(Number(e))&&!isNaN(Number(t))?Number(e)-Number(t):String(e).localeCompare(String(t))}const U0t=({children:e,...t})=>l.jsx("table",{...t,children:e}),V0t=({children:e,...t})=>l.jsx("tr",{...t,children:e}),H0t=({children:e,index:t,id:n,data:r,...s})=>l.jsx("td",{...s,children:l.jsx(V,{variant:"tiny",className:z({"font-normal":t}),children:e})}),z0t=({SortButton:e,children:t})=>l.jsx("th",{className:"py-sm pr-sm text-left align-text-top outline-none",children:l.jsxs(K,{className:"group relative flex items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"light",children:t}),e]})}),_ue=A.memo(function({name:t,setSortDescriptor:n}){return l.jsx("button",{className:"right-sm absolute opacity-0 transition-opacity duration-200 group-hover:opacity-100",onClick:()=>{n(r=>({...r,column:t,reverse:!r.reverse}))},children:l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{icon:B("arrows-vertical"),size:"xs"})})})});_ue.displayName="SortButton";const wue=A.memo(({collapsed:e,setCollapsed:t,viewMoreText:n,viewLessText:r})=>{const s=d.useCallback(()=>{t(o=>!o)},[t]);return l.jsx(K,{className:"pb-sm",children:l.jsx(Ge,{pill:!0,variant:"border",size:"tiny",chevron:!0,chevronIcon:e?B("chevron-down"):B("chevron-up"),text:e?n:r,onClick:s})})});wue.displayName="ResponsiveTableExpander";const HB="focus-visible:outline-super focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-0",Cue=A.memo(function(t){const{data:n,columns:r,compareFunction:s,RowCell:o,HeaderCell:a,Row:i,Table:c,limit:u}=t,[f,m]=d.useState({column:void 0,reverse:!1}),p=n.at(0),h=d.useMemo(()=>r??Object.keys(p??{}).map(w=>({name:w})),[p,r]),g=s??B0t,y=d.useMemo(()=>{const w=n.map(S=>({data:S,key:S.key??Math.random().toString(36).substring(7)}));return f.column&&w.sort((S,C)=>g(S.data[f.column],C.data[f.column])*(f.reverse?-1:1)),w.slice(0,u||w.length)},[n,u,f,g]),x=a??z0t,v=c??U0t,b=i??V0t,_=o??H0t;return l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(v,{className:"w-full border-collapse",children:[l.jsx("thead",{children:l.jsx(b,{id:"_header",children:h.map((w,S)=>l.jsx(Sue,{index:S,HeaderCell:x,setSortDescriptor:m,...w},w.name))})}),l.jsx("tbody",{children:y.map(w=>l.jsx(b,{id:w.key,className:z("group",HB,"border-subtlest border-t border-dashed !outline-none first:border-solid"),children:h.map(({name:S},C)=>l.jsx(_,{id:S,index:C,data:w.data,className:z("pr-sm align-text-top last:pr-0",HB,'group-data-[selected="true"]:first:border-l-super py-sm group-data-[selected="true"]:border-super group-data-[selected="true"]:bg-super/10 group-data-[selected="true"]:first:pl-xs group-data-[selected="true"]:last:pr-xs dark:group-data-[selected="true"]:bg-super/10 rounded-sm outline-none transition-all duration-300 ease-in-out group-data-[selected="true"]:first:border-l-2 group-data-[selected="true"]:last:border-r-2'),children:String(w.data[S])},S))},w.key))})]})})});Cue.displayName="ResponsiveTable";const Sue=A.memo(({index:e,HeaderCell:t,setSortDescriptor:n,...r})=>{const s=d.useMemo(()=>l.jsx(_ue,{name:r.name,setSortDescriptor:n}),[r.name,n]);return l.jsx(t,{index:e,id:r.name,data:r,SortButton:s,children:r.label??r.name},r.name)});Sue.displayName="HeaderCellFactory";const Z5=3,cx=A.memo(({children:e})=>l.jsx(V,{variant:"tinyRegular",color:"light",children:l.jsx("time",{className:"text-nowrap",children:e})}));cx.displayName="Timestamp";const Eue=A.memo(({source:e,includeRootLink:t=!0})=>{const{$t:n}=J(),{session:r}=Ne(),{trackEvent:s}=Xe(r),o=d.useMemo(()=>({onClick(){s("click citation",{source:"hoverCard",citation_url:e.url})}}),[e.url,s]),a=d.useMemo(()=>({color:"light"}),[]);return l.jsx(df,{timestampComponent:e.timestamp?l.jsx(pf,{recentlyUpdatedLabel:n({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.timestamp,timestampProps:a,children:n({defaultMessage:"Updated",id:"xrk6zgu9jU"})}):null,linkProps:o,result:e,children:l.jsx(W0t,{url:t?e.url:void 0,children:l.jsx(Sb,{label:`${e.id}`,className:"mb-xs"})})})});Eue.displayName="Citation";const W0t=({children:e,url:t,ref:n,...r})=>t!==void 0?l.jsx(yt,{href:t,target:"_blank",rel:"noopener nofollow",ref:n,...r,children:e}):l.jsx("span",{ref:n,...r,children:e}),G0t=(e,t)=>{if(!e)return"";const n=new Date(e),r=new Date;return Math.abs(+n-+r)<1e3*60*60*24?new Intl.RelativeTimeFormat(t,{localeMatcher:"best fit",numeric:"auto",style:"long"}).format(0,"day"):n.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},kue=A.memo(({post:e})=>{const{locale:t}=J(),{isMobileStyle:n}=Re(),r=d.useMemo(()=>e.timestamp?G0t(e.timestamp,t):"",[e.timestamp,t]);return l.jsx(K,{children:l.jsx(bue,{query:e.headline,nofollow:!0,children:l.jsxs("span",{className:"group/post pb-xs cursor-pointer",children:[l.jsxs(V,{variant:n?"smallBold":"baseSemi",className:"mb-xs gap-sm flex items-baseline justify-between",children:[l.jsx("span",{className:"leading-snug duration-150",children:e.headline}),l.jsxs("div",{className:"flex translate-x-1 items-center gap-0.5",children:[e.timestamp&&!n&&l.jsx(K,{className:"gap-sm capitalize",children:l.jsx(cx,{children:r})}),l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet group-hover/post:text-foreground translate-y-1 opacity-75 duration-150 md:translate-y-0"})]})]}),l.jsxs(V,{variant:n?"small":"base",className:"text-pretty leading-tight",children:[l.jsx("span",{className:"opacity-75",children:e.text}),l.jsx("span",{className:"ml-xs inline-flex",children:e.sources.map((s,o)=>l.jsx("span",{className:"mr-xs",children:l.jsx(Eue,{source:s,includeRootLink:!1},s.id)},o))})]}),e.timestamp&&n&&l.jsxs(K,{className:"mt-sm gap-xs flex items-center capitalize",children:[l.jsx(ut,{name:B("clock"),className:"text-quiet opacity-80",size:16}),l.jsx(cx,{children:r})]})]})})})});kue.displayName="Post";const $0t=A.memo(({created:e,posts:t,title:n,variant:r})=>{const{$t:s}=J(),[o,a]=d.useState(!0),[i,c]=d.useState(!1),{locale:u}=J(),[f,m]=d.useState(Date.now());d.useEffect(()=>{const b=setInterval(()=>m(Date.now()),15e3);return()=>clearInterval(b)},[]);const p=mi(),h=d.useMemo(()=>{if(!e||!p)return"";const b=Date.parse(e),_=f-b;let w=_/6e4,S="days";w<1?(w=_/1e3,S="seconds"):w<60?(w=_/6e4,S="minutes"):w<1440?(w=_/36e5,S="hours"):(w=_/864e5,S="days"),w=-Math.abs(Math.floor(w));const C=new Intl.RelativeTimeFormat(u,{localeMatcher:"best fit",numeric:"auto",style:"short"});return s({defaultMessage:"Updated {time}",id:"0aJxT29U/1"},{time:C.format(w,S)})},[e,f,s,u,p]),g=d.useMemo(()=>{if(!t?.length)return[];const b=t.flatMap(_=>_.sources).map(_=>[_.id,_]);return Object.values(Object.fromEntries(b))},[t]),y=d.useMemo(()=>g.map(b=>({url:b.url})),[g]),x=d.useCallback(()=>c(!0),[]),v=d.useCallback(()=>c(!1),[]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs(K,{className:z("gap-xs px-md py-sm flex flex-wrap items-center justify-between",{"border-b":r!=="raised"}),children:[l.jsxs(V,{variant:"baseSemi",color:t.length>0?"super":"ultraLight",className:"gap-sm flex items-center",as:"h2",children:[l.jsx(Y0t,{animate:t.length>0}),l.jsx("span",{children:n??s({defaultMessage:"What's Happening",id:"wVxgwE2ray"})})]}),l.jsx(cx,{children:h})]}),l.jsxs(K,{variant:r,className:z({"rounded-xl border":r==="raised"}),children:[l.jsx(pi,{transition:{ease:Kr,duration:.2},children:l.jsx(Oo,{children:t.length===0?l.jsx(q0t,{}):l.jsx("ul",{className:"pb-md grid",children:t.slice(0,o?Z5:t.length).map((b,_)=>l.jsx(Te.li,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},transition:{y:{ease:Kr,duration:.2}},className:"mx-md border-subtlest py-md block border-b last:border-b-0 last:pb-0",children:l.jsx(kue,{post:b},_)},b.headline))})})}),t.length>0&&l.jsxs(l.Fragment,{children:[t.length>Z5&&l.jsx(K,{className:"px-md",children:l.jsx(wue,{collapsed:o,setCollapsed:a,viewMoreText:s({defaultMessage:"View More",id:"QQSdHPJWXu"}),viewLessText:s({defaultMessage:"View Less",id:"UOYN/MXiOT"})})}),l.jsx("div",{className:"pb-md pl-md",children:l.jsxs(K,{as:"button",bgHover:"subtle",className:"gap-sm px-sm inline-flex items-center rounded-full border py-1.5",onClick:x,children:[l.jsx(Eb,{sources:y,count:4}),l.jsxs(V,{variant:"tiny",color:"light",children:[g.length," Sources"]})]})})]})]})]}),i&&l.jsx(Mb,{onClose:v,webResults:g,legacyIdentifier:"citationListModal"})]})});$0t.displayName="WhatsHappening";const q0t=()=>l.jsx(br,{className:"px-md",children:l.jsx("div",{className:"divide-y",style:{maskImage:"linear-gradient(to bottom, black 50%, transparent)"},children:Array.from({length:Z5}).map((e,t)=>l.jsx(K0t,{},t))})}),K0t=()=>l.jsxs(K,{className:"gap-sm py-md flex flex-col",children:[l.jsx(K,{className:"mb-sm h-2 w-4/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-3/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-3/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-2/5 rounded-full",variant:"subtle"})]}),$1=(e,t)=>t?{initial:{opacity:0},animate:{opacity:1},transition:{duration:1,repeat:1/0,repeatDelay:5,ease:Kd,delay:e}}:{opacity:1},Y0t=({animate:e})=>l.jsx("svg",{viewBox:"0 0 576 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-super inline-block h-[1em] overflow-visible align-[-0.125em]",children:l.jsxs("g",{children:[l.jsx(Te.path,{d:"M99.8 69.4C110 77.8 111.4 93 103 103.2C68.6 144.7 48 197.9 48 256C48 314.1 68.6 367.3 103 408.8C111.4 419 110 434.1 99.8 442.6C89.6 451.1 74.5 449.6 66 439.4C24.8 389.6 0 325.7 0 256C0 186.3 24.8 122.4 66 72.6C74.4 62.4 89.6 61 99.8 69.4ZM476.3 69.4C486.5 61 501.6 62.4 510.1 72.6C551.3 122.4 576.1 186.4 576.1 256C576.1 325.6 551.3 389.6 510.1 439.4C501.7 449.6 486.5 451 476.3 442.6C466.1 434.2 464.7 419 473.1 408.8C507.4 367.3 528.1 314.1 528.1 256C528.1 197.9 507.5 144.7 473.1 103.2C464.7 93 466.1 77.9 476.3 69.4Z",fill:"currentColor",...$1(.3,e)}),l.jsx(Te.path,{...$1(.15,e),d:"M160 256C160 226.4 170 199.2 186.9 177.5C195 167 193.2 151.9 182.7 143.8C172.2 135.7 157.1 137.5 149 148C125.8 177.8 112 215.3 112 256C112 296.7 125.8 334.2 149 364C157.2 374.5 172.2 376.4 182.7 368.2C193.2 360 195 345 186.9 334.5C170 312.8 160 285.6 160 256Z",fill:"currentColor"}),l.jsx(Te.path,{...$1(.15,e),d:"M464 256C464 215.3 450.2 177.8 427 148C418.8 137.5 403.8 135.6 393.3 143.8C382.8 152 381 167 389.1 177.5C406 199.2 416 226.4 416 256C416 285.6 406 312.8 389.1 334.5C381 345 382.8 360.1 393.3 368.2C403.8 376.3 418.9 374.5 427 364C450.2 334.2 464 296.7 464 256Z",fill:"currentColor"}),l.jsx(Te.path,{...$1(0,e),d:"M259.716 227.716C252.214 235.217 248 245.391 248 256C248 266.609 252.214 276.783 259.716 284.284C267.217 291.786 277.391 296 288 296C298.609 296 308.783 291.786 316.284 284.284C323.786 276.783 328 266.609 328 256C328 245.391 323.786 235.217 316.284 227.716C308.783 220.214 298.609 216 288 216C277.391 216 267.217 220.214 259.716 227.716Z",fill:"currentColor"})]})}),Q0t=A.memo(({children:e,maxFaces:t=3,showMore:n=!0,clickable:r=!1,size:s="medium",onAvatarClick:o,backgroundClass:a})=>{const i=A.Children.count(e);return l.jsxs(K,{onClick:r?o:void 0,bgHover:r?"subtler":void 0,className:z("group flex items-center",{"p-xs cursor-pointer rounded-full transition-all":r}),children:[A.Children.map(e,(c,u)=>ut&&l.jsx(K,{children:l.jsxs(V,{variant:"smallCaps",color:"light",className:"px-xs",children:["+",i-t]})})]})});Q0t.displayName="AvatarList";Ft("BlazeSDKContext",{blazeSDK:null,isBlazeSDKReady:!1});fa(Iie);const Mue=A.memo(({isFollowed:e,toggleFollow:t,iconOnly:n=!1,size:r="small",selectedButtonClassName:s,unselectedButtonClassName:o,tooltip:a,variant:i})=>{const c=J(),{isMobileStyle:u}=Re();return l.jsx(St,{mode:"wait",children:e?l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Kr},children:l.jsx(Ge,{variant:i??"primaryGhost",pill:!0,size:r,text:u||n?void 0:c.formatMessage({defaultMessage:"Following",id:"cPIKU2QdyN"}),onClick:t,extraCSS:s,toolTip:a,icon:B("star-filled")})},"confirmed"):l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Kr},children:l.jsx(Ge,{pill:!0,variant:i,icon:B("plus"),size:r,text:u||n?void 0:c.formatMessage({defaultMessage:"Follow",id:"ieGrWod3CN"}),onClick:t,extraCSS:o,toolTip:a})},"follow")})});Mue.displayName="FollowButton";const X0t=be.makeEphemeralQueryKey("homepage-widgets");be.makeEphemeralQueryKey("homepage/weather");const Z0t=({watchlistType:e,identifier:t,category:n,modalOrigin:r,loginPrompt:s,reason:o})=>{const{$t:a}=J(),i=Yt(),c=Wt(),{openModal:u}=pn().legacy,[f,m]=d.useState(!1),[p,h]=d.useState(!1),{data:g,isLoading:y}=uKe({watchlistType:e,reason:o}),{mutate:x}=dKe({watchlistType:e,queryClient:i,reason:o}),{mutate:v}=fKe({watchlistType:e,queryClient:i,reason:o}),b=d.useMemo(()=>{const w=S=>{const C=S.identifier===t;return n?C&&S.categories?.includes(n):C};return!!g?.some(w)},[g,t,n]),_=d.useCallback(w=>{const{invalidateOnSuccess:S=!0}=w??{};if(m(!1),h(!1),!c){a({defaultMessage:"Sign in to follow your interests",id:"ebRSvhaBXI"}),u("loginModal",{pitchMessage:{title:s},origin:r});return}b?(v({identifier:t}),h(!0)):(x({identifier:t}),m(!0)),S&&i.invalidateQueries({queryKey:X0t})},[a,x,t,b,c,s,r,u,i,v]);return d.useMemo(()=>({isFollowed:b,toggleFollow:_,showFollowToast:f,showUnfollowToast:p,setShowFollowToast:m,setShowUnfollowToast:h,isLoadingSubscriptions:y}),[b,y,f,p,_])},J5=A.memo(({message:e,isVisible:t=!1,timeout:n,onSettingsClick:r,onTimeout:s=Ao,icon:o,...a})=>{const[i,c]=d.useState(t),u=d.useRef(null),{$t:f}=J();d.useEffect(()=>{c(t)},[t]);const m=d.useCallback(()=>{u.current&&clearTimeout(u.current)},[]),p=d.useCallback(g=>{g?.stopPropagation(),c(!1),s(),m()},[s,m]),h=n!=null&&n>0;return d.useEffect(()=>(t&&h&&(u.current=setTimeout(()=>{p()},n*1e3)),()=>{m()}),[i,n,t,s,p,m,h]),l.jsx(Xl,{children:l.jsx(St,{children:i&&l.jsx(Te.div,{className:"right-toastHMargin top-toastVMargin fixed z-30 flex items-center justify-center",initial:{opacity:0,x:6},animate:{opacity:1,x:0},exit:{opacity:0,x:6},transition:Ar,...a,children:l.jsxs(K,{variant:"raised",className:"shadow-subtle gap-sm flex items-stretch rounded-xl border pl-[12px] dark:shadow-[0_4px_12px_rgba(0,0,0,0.5)]",children:[o&&l.jsx("div",{className:"p-sm bg-subtler dark:bg-subtle my-[12px] flex aspect-square items-center justify-center rounded-md",children:l.jsx(ge,{icon:o,className:"text-quiet",size:"md"})}),l.jsxs("div",{className:"flex flex-1 flex-row items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"default",className:"pl-sm max-w-[200px] shrink-0 pr-[12px]",children:e}),l.jsxs(K,{className:"flex h-full flex-col items-stretch justify-center border-l",children:[l.jsx(st,{size:"tiny",variant:"noHover",text:f({defaultMessage:"Settings",id:"D3idYvSLF9"}),onClick:r,extraCSS:"!px-[12px] flex-1 hover:opacity-60"}),l.jsx(K,{className:"border-t"}),l.jsx(st,{size:"tiny",variant:"noHover",text:f({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:p,extraCSS:"!px-[12px] flex-1 hover:opacity-60"})]})]})]})},"toast")})})});J5.displayName="FollowConfirmationToast";const J0t=e=>!!e.extra.team_1_competitor_types?.map(n=>n.type).includes("team"),e1t=({event:e,subtitles:t,headshots:n})=>{const{locale:r}=J(),s=d.useMemo(()=>{if(!e.datetime)return null;const m=new Date(e.datetime);return isNaN(m.getTime())?null:m.toLocaleTimeString(r,{hour:"numeric",minute:"numeric",hour12:!0})},[e.datetime,r]),o=e.status==="live",a=e.status==="final",i=e.datetime&&new Date(e.datetime)>new Date,c=e.team_1.won||e.team_2.won,{isMobileStyle:u}=Re(),f=J0t(e);return l.jsxs(K,{className:"group relative",children:[l.jsx(K,{className:"bg-subtler duration-quick absolute inset-0 opacity-0 transition-opacity group-hover:opacity-50",variant:"subtle"}),l.jsxs(Zg,{href:`/sports/atp/events/${e.id}`,className:z("p-md gap-y-md relative grid w-full flex-col",{"gap-y-sm":u}),children:[l.jsxs("div",{className:"gap-md flex items-center justify-between",children:[l.jsx(V,{variant:u?"tinyRegular":"small",color:"light",children:e.title[0]}),i?l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:u?"tinyRegular":"small",color:"light",children:s}),l.jsx($ce,{className:"-mr-0.5"})]}):o?l.jsx(um,{className:"-mr-0.5",includeDot:!0}):a&&l.jsx(l_,{className:"-mr-0.5"})]}),l.jsxs(K,{className:"gap-lg flex w-full items-center",children:[l.jsx("div",{className:"gap-sm flex flex-1",children:l.jsxs("div",{className:z("flex flex-1 flex-col gap-[12px]",{"gap-sm":u}),children:[l.jsx(zB,{team:e.team_1,headshotImageUrl:n?.team1??null,anyWinner:c,subtitle:t?.team1,isDoubles:f,serving:e.team_1.emphasis,isLive:o}),l.jsx(zB,{team:e.team_2,headshotImageUrl:n?.team2??null,anyWinner:c,subtitle:t?.team2,isDoubles:f,serving:e.team_2.emphasis,isLive:o})]})}),l.jsx("div",{className:"flex h-full items-center justify-end",children:l.jsx(R0t,{event:e,team1:e.team_1,team2:e.team_2,isLive:o})})]})]})]})},zB=({team:e,headshotImageUrl:t,anyWinner:n,subtitle:r,isDoubles:s,serving:o,isLive:a})=>{const i=e.won,{isMobileStyle:c}=Re();return l.jsxs("div",{className:z("gap-sm flex items-center",{"opacity-30 grayscale":n&&!i}),children:[l.jsx(due,{headshotImageUrl:t??void 0,flagUrl:e.img??void 0,name:e.title??"",isCompositeFlag:s}),l.jsxs("div",{children:[l.jsxs(V,{variant:c?"smallBold":"baseSemi",className:"gap-xs flex items-center",children:[e.title,i&&l.jsx(K,{variant:"superLight",className:"p-xs ml-auto inline-flex aspect-square rounded-full",children:l.jsx(ut,{name:B("trophy"),size:12,className:"text-super"})}),o&&a&&l.jsx(ge,{icon:B("ball-tennis"),size:14,className:"text-super"})]}),typeof r=="string"?l.jsx(V,{variant:"micro",color:"light",className:"-mt-0.5",children:r}):r]})]})},t1t=async e=>{if(!e)return null;const{data:t,error:n,response:r}=await de.POST("/rest/sports/{league}/widget","sports-widget",{body:e});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,details:e,status:r.status??0});return t},n1t=({data:e})=>{const{data:t}=mt({...N0t,queryKey:be.makeEphemeralQueryKey("/sports/widget",e.events.map(r=>r.id).join(",")),queryFn:()=>t1t(e.debug_fn_args),placeholderData:Wl,refetchInterval:3e4}),n=t||e;return n?.object!==e.object?null:l.jsx(tue,{canonicalPageLink:n?.canonical_pages?.[0]?.url_web,children:l.jsx("div",{className:"divide-y overflow-hidden",children:n?.events?.map(r=>l.jsx(e1t,{event:r},r.id))})})},lp=A.memo(({data:e})=>Vi(e).with({object:"SportsEventsWidget"},t=>t.league==="atp"||t.league==="wta"?l.jsx(n1t,{data:t}):l.jsx($gt,{widget:t})).with({object:"SportsStandingsWidget"},t=>l.jsx(A0t,{widgetData:t})).with({object:"SportsIndvScheduleWidget"},t=>l.jsx(m0t,{widgetData:t})).with({object:"SportsIndvEventsWidget"},t=>l.jsx(u0t,{widgetData:t})).exhaustive());lp.displayName="SportsWidget";const Tue=A.memo(({status:e})=>l.jsx(V,{as:"span",variant:"smallBold",color:e?"super":"light",children:l.jsx(ge,{icon:e?B("check"):B("x"),size:"md"})}));Tue.displayName="BoolCell";const Aue=A.memo(({url:e})=>l.jsx(yt,{href:e,target:"_blank",rel:"noopener",className:"top-xs relative inline-block transition-opacity duration-300 hover:opacity-50",children:l.jsx(ya,{color:"light",variant:"tiny",url:e,isAttachment:!1})}));Aue.displayName="LinkCell";const jy=A.memo(({text:e})=>l.jsx(V,{as:"span",variant:"tiny",className:"text-pretty break-words font-normal",children:e}));jy.displayName="TextCell";const Nue=A.memo(({tableData:e,citationOffset:t})=>{const{$t:n}=J(),{session:r}=Ne(),{trackEvent:s}=Xe(r),{data:o,column_metadata:a,search_results:i}=e,c=d.useMemo(()=>a.reduce((y,{name:x,display_name:v})=>(y[x]=v,y),{}),[a]),u=d.useMemo(()=>a.reduce((y,{name:x,display_format:v})=>(y[x]=v,y),{}),[a]),f=d.useCallback((y,x)=>y.value===null&&x.value===null?0:y.value===null?-1:x.value===null?1:typeof y.value=="string"?String(y.value).localeCompare(String(x.value)):Number(y.value)-Number(x.value),[]),m=d.useCallback(({data:y,id:x,...v})=>{const b=u[x],_=y[x]?.citation_index??null,w=_!==null?i[_]:null,S=w?.is_attachment??!1,C=y[x]?.value;let E=l.jsx(jy,{text:String(C)});return b==="url"&&(E=l.jsx(Aue,{url:String(C)})),b==="boolean"&&(E=l.jsx(Tue,{status:!!C})),b==="long_text"&&(E=l.jsx(jy,{text:String(C)})),b==="date"&&(E=l.jsx(jy,{text:String(C)})),C===null?l.jsx("td",{...v,children:l.jsx(V,{variant:"tiny",color:"ultraLight",children:l.jsx(ge,{icon:B("minus"),size:"xs"})})}):l.jsxs("td",{...v,children:[l.jsx("span",{children:E}),b!=="url"&&w&&w.url&&_!==null&&l.jsx(df,{result:w,children:l.jsx(RN,{str:`[${_+t+1}]`,href:w.url,isFile:S,isDownloadable:Yl(w),className:"citation ml-xs inline"})})]})},[i,u,t]),p=d.useMemo(()=>a.map(({name:y})=>({name:y,label:c[y],sortable:!0,resizable:!0})),[a,c]),h=toe(),g=d.useCallback(()=>{const y=a.reduce((_,w)=>(_.push(w.name),_),[]).join("-"),x=a.map(({display_name:_})=>kk.escapeCSVString(_)).join(","),v=o.map(_=>a.map(({name:w})=>kk.escapeCSVString(String(_[w]?.value))).join(",")),b=[x,...v].join(` -`);return s("clicked download table as csv",{source:"widget"}),h({csvString:b,filename:y})},[a,o,h,s]);return l.jsx(Es,{widgetType:"table",widgetName:"table",widgetSize:"full",children:l.jsxs(K,{variant:"subtler",className:"px-md pb-xs rounded-lg",children:[l.jsx(Cue,{data:o,columns:p,RowCell:m,compareFunction:f}),l.jsx(K,{className:"border-subtlest py-sm flex justify-end border-t",children:l.jsx(st,{icon:B("download"),variant:"super",onClick:g,pill:!0,size:"tiny",text:n({defaultMessage:"Export CSV",id:"TE51b7zSWC"}),toolTip:n({defaultMessage:"Download Table as CSV",id:"X3dYB0f+/Q"})})})]})})});Nue.displayName="TableWidget";const r1t=A.memo(({isOpened:e,onOpen:t,onClose:n,onEdit:r})=>{const s=J(),o=Rn(),{isMobileStyle:a}=Re(),i=d.useMemo(()=>[{type:"default",text:s.formatMessage({defaultMessage:"Edit",id:"wEQDC6Wv3/"}),onClick:r,testId:"task-widget-edit"},{type:"default",text:s.formatMessage({defaultMessage:"View Tasks",id:"L3nFsHqlqm"}),rightElement:l.jsx("div",{className:"flex items-center",children:l.jsx(ut,{name:B("chevron-right"),size:16})}),onClick:()=>{o.push("/account/tasks")},testId:"task-widget-view-tasks"}],[s,r,o]);return l.jsx(zs,{placement:"bottom-start",items:i,onOpen:t,onClose:n,isMobileStyle:a,children:l.jsx(st,{size:"tiny",icon:B("dots-vertical"),extraCSS:z("",{"!text-foreground !bg-subtle":e})})})});r1t.displayName="TaskWidgetMenu";const s1t=e=>({id:e.id,title:e.title,prompt:e.prompt,schedule:Xy(e.scheduleInfo),searchModel:e.searchModel,sources:e.sources||["web"]}),WB=(e={})=>e.prefill?e.prefill:e.initial?s1t(e.initial):{...Tye(),searchModel:ie.PRO},cp=({text:e,onClick:t,variant:n="secondary",disabled:r=!1})=>l.jsx(Ge,{text:e,onClick:t,disabled:r,testId:`task-modal-${e.toLowerCase()}-button`,variant:n==="secondary"?"common":"inverted",extraCSS:"min-w-[100px]"}),o1t=(e,t)=>e.schedule.kind==="ONCE"&&new Date(e.schedule.year,e.schedule.month,e.schedule.day,e.schedule.hour,e.schedule.minute)<=new Date(Date.now())?{ok:!1,message:t({defaultMessage:"Please schedule this task for a future time.",id:"loBg9tvLRE"})}:{ok:!0};function Rue({open:e,onClose:t,onSuccess:n,initial:r,prefill:s,errorMessage:o,source:a}){const i="task-modal",{formatMessage:c}=J(),{session:u}=Ne(),{trackEvent:f}=Xe(u),{configuredModel:m}=Vn();d.useEffect(()=>{e&&f("task modal opened",{source:a})},[e,a,f]);const[p,h]=d.useState(o),{createMutation:g,updateMutation:y,deleteMutation:x,isMutationLoading:v,invalidateAndClose:b}=gre({reason:i,source:a,onSuccess:d.useCallback(j=>{n?.(j),t?.()},[n,t]),onError:h}),_=d.useRef(r?g7(r):void 0);d.useEffect(()=>{e&&(_.current=r?g7(r):void 0)},[e,r]);const[w,S]=d.useState(()=>WB({initial:r,prefill:s})),C=d.useMemo(()=>an(w.searchModel),[w.searchModel]);d.useEffect(()=>{h(e?o:void 0)},[e,o]),d.useEffect(()=>{e&&S(WB({initial:r,prefill:s}))},[e,r,s,m]),d.useEffect(()=>{const j=Ai(C);S(F=>({...F,searchModel:j}))},[C]);const E=!!_.current,T=_.current?.status==="PAUSED",k=_.current?.status==="COMPLETED",I=j=>S(F=>({...F,...j})),M=j=>S(F=>({...F,schedule:{...F.schedule,...j}})),N=()=>{h(void 0);const j=o1t(w,c);if(!j.ok){h(j.message);return}E?y.mutate({id:_.current.id,payload:{task_name:w.title,prompt:w.prompt,schedule:mp(w.schedule),status:"ACTIVE",model_preference:w.searchModel,sources:w.sources}},{onSuccess:()=>{f("task modal action",{source:a,action:"updated"}),b("updated",_.current.id)}}):g.mutate({task_id:w.id,task_name:w.title,prompt:w.prompt,schedule:mp(w.schedule),model_preference:w.searchModel,sources:w.sources},{onSuccess:()=>{f("task modal action",{source:a,action:"created"})}})},D=d.useMemo(()=>{if(!E)return!0;const j=w.prompt!==_.current?.prompt,F=_.current.scheduleInfo,R=mp(w.schedule),P=!Cr(R.rrule,F.rrule)||!Cr(R.tzid,F.tzid),L=w.schedule.kind==="ONCE"&&R.start_at!==F.start_at,U=w.searchModel!==_.current?.searchModel,O=!Cr(w.sources||["web"],_.current?.sources||["web"]);return j||(P||L||U)||O},[E,w,_]);return l.jsx(po,{isOpen:e,onClose:t,title:c({defaultMessage:"Task",id:"0wJ7N+noSq"}),titleTextVariant:"base",modalContentClassname:"!pb-4 md:!pb-4",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(ib,{trigger:{type:Ze.SCHEDULED,schedule:w.schedule},prompt:w.prompt,onPromptChange:j=>I({prompt:j}),error:p}),l.jsx(X6,{schedule:w.schedule,onScheduleChange:M}),l.jsx(rb,{searchModel:w.searchModel,onSearchModelChange:j=>I({searchModel:j}),sources:w.sources||["web"],onSourcesChange:j=>I({sources:j})}),l.jsxs(K,{variant:"background",className:"mt-md pt-md -mx-md px-md flex items-center justify-between border-t",children:[E&&l.jsxs("div",{className:"flex gap-4",children:[!k&&l.jsx(cp,{text:c(T?{defaultMessage:"Resume",id:"3y9DGgura7"}:{defaultMessage:"Pause",id:"tFFMkFDBMO"}),onClick:()=>y.mutate({id:_.current.id,payload:{status:T?"ACTIVE":"PAUSED"}},{onSuccess:()=>{const j=T?"resumed":"paused";f("task modal action",{source:a,action:j}),b(j,_.current.id)}}),disabled:v}),l.jsx(cp,{text:c({defaultMessage:"Delete",id:"K3r6DQW7h+"}),onClick:()=>x.mutate(_.current.id),disabled:v})]}),l.jsxs("div",{className:"ml-auto flex gap-4",children:[l.jsx(cp,{text:c({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:()=>t?.()}),l.jsx(cp,{text:c({defaultMessage:"Save",id:"jvo0vs3nF0"}),variant:"primary",disabled:v||!w.prompt||!D,onClick:N})]})]})]})})}const a1t=Object.freeze(Object.defineProperty({__proto__:null,FormButton:cp,default:Rue},Symbol.toStringTag,{value:"Module"})),GB=xA,Due=()=>l.jsx("div",{className:"flex flex-1 items-center justify-end opacity-50",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"sm"})}),i1t={Enterprise:{trailingComponent:l.jsx(Due,{})},Tasks:{href:`${GB}/tasks`},Shortcuts:{href:`${GB}/shortcuts`}};l.jsx(Due,{});const l1t=()=>l.jsxs(br,{className:"flex w-full items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"bg-subtle size-4 shrink-0 rounded"}),l.jsx("div",{className:"bg-subtle h-4 w-32 rounded"})]}),l.jsx("div",{className:"bg-subtle h-4 w-20 rounded"})]}),jue=A.memo(({data:e})=>{const{$t:t}=J(),{suggested_prompt:n,suggested_schedule:r,widget_uuid:s}=e,o=d.useMemo(()=>({id:s,title:"",prompt:n,schedule:r?Xy(r):Gr(),searchModel:ie.PRO}),[n,r,s]),a=un(),i=d.useCallback(()=>{a.openTab({url:`${window.location.origin}${i1t.Tasks.href}`})},[a]),[c,u]=d.useState(!1),[f,m]=d.useState(!1),[p,h]=d.useState(!1),[g,y]=d.useState(null),[x,v]=d.useState(!1);d.useEffect(()=>{if(!g)return;const M=setTimeout(()=>{y(null)},2e3);return()=>clearTimeout(M)},[g]);const b=J(),{data:_,isLoading:w}=mt({queryKey:GH(s),queryFn:()=>w9e({taskId:s,reason:"task-widget"})});d.useCallback(()=>{_?.type==="ALERT"&&_?.subscription?h(!0):m(!0)},[_]),d.useMemo(()=>{if(!_)return null;if(_.type==="ALERT"&&_.subscription)return E1e({..._.subscription,event_type:_.subscription.event_type},b);const M=Xy(_.scheduleInfo);return{kind:Aye(M.kind,b),friendly:kye(M,b),isRecurring:M.kind!=="ONCE"}},[_,b]);const S=d.useMemo(()=>{if(!_)return"";if(_.type==="ALERT"&&_.subscription){const{subscription:M}=_,N=M.event_entity||"",D=M.event_type==="STOCK_PRICE_TARGET",j=M.event_type==="STOCK_PRICE_MOVEMENT";if(D){const F=M.value_upper_bound||M.value_lower_bound;if(F)return`${N} reaches $${F}`}else if(j){const F=M.value_upper_bound||0,R=M.value_lower_bound||0,P=F>0,L=R<0;if(P&&L)return`${N} moves ±${F}%`;if(P)return`${N} rises ${F}%`;if(L)return`${N} falls ${Math.abs(R)}%`}return`Price alert for ${N}`}return _.prompt},[_]);d.useMemo(()=>{if(!g)return null;const M=g==="created"?l.jsx(je,{defaultMessage:"Task created",id:"991WgJt61N"}):g==="updated"?l.jsx(je,{defaultMessage:"Task updated",id:"sQGGdcVjgL"}):g==="deleted"?l.jsx(je,{defaultMessage:"Task deleted",id:"kGP3l1jr/4"}):g==="paused"?l.jsx(je,{defaultMessage:"Task paused",id:"Ryhxeg2OIZ"}):l.jsx(je,{defaultMessage:"Task resumed",id:"fqAqWnF85q"});return l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Kr},children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),className:"text-super",size:16}),l.jsx(V,{variant:"small",color:"super",className:"truncate",children:M})]})},"confirmed")},[g]);const C=d.useCallback(()=>{v(!1)},[]),E=d.useCallback(()=>v(!0),[]);d.useMemo(()=>t({defaultMessage:"Task",id:"0wJ7N+noSq"}),[t]),d.useMemo(()=>l.jsx(ut,{name:B("plus"),size:12}),[]);const T=d.useCallback(()=>{m(!1),v(!1)},[]),k=d.useCallback(()=>{h(!1),v(!1)},[]),I=d.useCallback(M=>{m(!1),v(!1),y(M)},[]);return d.useCallback(()=>{u(!0)},[]),d.useCallback(()=>{u(!1)},[]),l.jsx(Es,{widgetType:"task",widgetName:"task",widgetSize:"mini",children:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"bg-subtler border-subtlest p-md group relative flex h-14 items-center justify-between gap-2 rounded-xl border transition-transform duration-200 hover:scale-[1.01] hover:transform",onMouseEnter:E,onMouseLeave:C,children:l.jsx(St,{mode:"wait",children:w?l.jsx(l1t,{}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex min-w-0 shrink items-center gap-2",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:_?.type==="ALERT"&&_?.subscription?l.jsx(ut,{name:B("bell-bolt"),size:16,className:"text-quiet shrink-0"}):l.jsx(ut,{name:B("clock"),size:16,className:"text-quiet shrink-0"})}),l.jsx("div",{className:"flex w-full min-w-0 flex-col items-start",children:_?l.jsx(V,{variant:"small",color:"default",className:"w-full truncate",children:S}):l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"small",color:"default",className:"w-full truncate",children:n}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"truncate",children:l.jsx(je,{defaultMessage:"Create a task to get this sent automatically.",id:"1AmBIpC9N9"})})]})})]}),l.jsx(st,{size:"tiny",icon:B("edit"),onClick:i})]})})}),l.jsx(Wc,{children:l.jsx(Rue,{source:"task_widget",open:f,prefill:_?void 0:o,initial:_??void 0,onClose:T,onSuccess:I})}),_&&l.jsx(Tb,{isOpen:p,onClose:k,task:_,symbol:_.subscription?.event_entity})]})})});jue.displayName="TaskWidget";const Iue=A.memo(e=>{const{data:t}=e,{menuItems:n}=sm();return l.jsx(Es,{widgetType:"time",widgetName:"time",widgetSize:"full",children:l.jsxs(K,{className:"flex w-full",children:[l.jsx(V,{children:l.jsx(K,{className:"mr-md pr-md border-r font-mono text-4xl",children:t.time})}),l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",children:t.date}),l.jsx(V,{variant:"small",color:"light",children:t.location?`${t.location}`:null})]}),n&&n.length>0&&l.jsx("div",{className:"-mr-sm -mt-sm flex grow justify-end",children:l.jsx("div",{children:l.jsx(Fn.Menu,{menuItems:n})})})]})})});Iue.displayName="TimeWidget";const Pue=A.memo(e=>{const{data:t}=e,{duration_seconds:n}=t,{menuItems:r}=sm(),{result:s}=It(),o=s?.uuid,a=d.useMemo(()=>`timer_widget_state_${o}_${n}`,[o,n]),[i,c]=d.useState(!1),[u,f]=d.useState(!1),[m,p]=d.useState(null),[h,g]=d.useState(n*1e3),[y,x]=d.useState(!0),[v,b]=d.useState(!1),_=d.useRef(void 0),w=d.useRef(void 0),S=d.useRef(!1),C=d.useRef(null);d.useEffect(()=>{if(!o)return;const j=vt.getItem(a);if(j)try{const F=JSON.parse(j),R=Date.now();if(F.status==="expired"){f(!0),g(0),p(null);return}if(F.pausedAt&&F.remainingMillis!==void 0)c(!0),g(F.remainingMillis),p(null);else if(F.endTime){const P=F.endTime-R;if(P>0)p(F.endTime),g(P),c(!1);else{g(0),p(null),f(!0);const L={status:"expired",endTime:0,remainingMillis:0};vt.setItem(a,JSON.stringify(L))}}}catch{vt.removeItem(a)}else{const F=Date.now()+n*1e3;p(F),c(!1)}},[a,n,o]),d.useEffect(()=>{if(!o||u)return;const j=i?{status:"paused",endTime:0,pausedAt:Date.now(),remainingMillis:h}:{status:"running",endTime:m||Date.now()+h};vt.setItem(a,JSON.stringify(j))},[h,i,m,a,u,o]);const E=d.useCallback(()=>{if(S.current||u)return;S.current=!0,g(0),p(null),f(!0),b(!0);const j={status:"expired",endTime:0,remainingMillis:0};vt.setItem(a,JSON.stringify(j)),!y&&C.current&&C.current.play().catch(()=>{})},[a,u,y]),T=d.useCallback(()=>{if(!i&&m){const j=Date.now(),F=m-j;F>0?(g(F),_.current=requestAnimationFrame(T)):E()}},[i,m,E]);d.useEffect(()=>{if(!i&&m&&h>0&&!u){_.current=requestAnimationFrame(T);const j=m-Date.now();j>0&&(w.current=window.setTimeout(E,j))}return()=>{_.current&&cancelAnimationFrame(_.current),w.current&&clearTimeout(w.current)}},[i,m,h,u,T,E]),d.useEffect(()=>{const j=()=>{if(!document.hidden&&!i&&m){const F=Date.now(),R=m-F;R>0?g(R):E()}};return document.addEventListener("visibilitychange",j),()=>{document.removeEventListener("visibilitychange",j)}},[i,m,E]);const k=d.useCallback(()=>{if(!u)if(i){const j=Date.now()+h;p(j),c(!1)}else c(!0),p(null)},[u,i,h]),I=d.useCallback(()=>{_.current&&(cancelAnimationFrame(_.current),_.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),S.current=!1;const j=Date.now()+n*1e3;f(!1),c(!1),g(n*1e3),p(j)},[n]),M=d.useCallback(()=>{x(j=>!j)},[]),N=d.useCallback(()=>{b(!1),C.current&&(C.current.pause(),C.current.currentTime=0)},[]),D=d.useMemo(()=>{const j=Math.ceil(h/1e3),F=Math.floor(j/3600),R=Math.floor(j%3600/60),P=Math.floor(j%60),L=R.toString().padStart(2,"0"),U=P.toString().padStart(2,"0");return F>0?`${F}:${L}:${U}`:`${L}:${U}`},[h]);return l.jsx(Es,{widgetType:"timer",widgetName:"timer",widgetSize:"full",children:l.jsxs(K,{className:z("relative flex transition-all duration-200",{"hover:scale-[1.01]":v}),children:[v&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"-m-md absolute inset-0 z-20 cursor-pointer rounded-xl",onClick:N,title:"Click anywhere to stop alarm","aria-label":"Stop alarm"}),l.jsx("div",{className:"-m-md to-attention/20 from-negative/20 absolute inset-0 animate-pulse rounded-xl bg-gradient-to-br"})]}),l.jsxs("div",{className:"relative z-10 flex w-full items-center",children:[l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Ge,{variant:"primaryGhost",size:"small",onClick:k,icon:i?B("player-play-filled"):B("player-pause-filled"),disabled:u,pill:!0}),l.jsx(Ge,{variant:"primaryGhost",size:"small",onClick:I,icon:B("rotate-clockwise"),"aria-label":"Restart timer",disabled:v,pill:!0})]}),l.jsx(V,{className:"flex-1",children:l.jsx(K,{className:`pl-lg font-mono text-2xl ${v?"text-negative":""}`,children:D})}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(bv,{cueKey:`timer-unmute-${o}`,title:"Tap to unmute",enabled:y&&!u,placement:"top",sideOffset:8,variant:"common",size:"xs",children:l.jsx(Ge,{variant:"primaryGhost",size:"small",onClick:M,icon:y?QU:YU,disabled:u,pill:!0})}),r&&r.length>0&&l.jsx(Fn.Menu,{menuItems:r})]})]}),l.jsx("audio",{ref:C,src:"https://r2cdn.perplexity.ai/Hole_In_One.wav?v=1",preload:"auto",style:{display:"none"},loop:!0})]})})});Pue.displayName="TimerWidget";function c1t(){const[e,t]=d.useState(!1),n=Ox(),r=d.useCallback(s=>{lo(BR,s.toString()),t(s)},[t]);return d.useEffect(()=>{const s=mr(BR);t(s==="true"||s===void 0&&n!=="US")},[n]),d.useMemo(()=>({prefersMetric:e,setPrefersMetric:r}),[e,r])}const u1t=130,Oue=A.memo(({day:e,icon:t,high:n,low:r,selected:s})=>l.jsxs("div",{className:"relative col-span-1",children:[s&&l.jsx(Te.div,{layoutId:"selected-forecast-item",className:"-inset-sm absolute right-0",transition:Ar,children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-white opacity-10"})}),l.jsxs("div",{className:"relative flex flex-col items-start",children:[l.jsx(V,{color:"white",children:l.jsx(ge,{icon:t,size:"xl",className:"mb-xs -ml-two"})}),l.jsx(V,{variant:"smallBold",color:"white",children:e}),l.jsxs("div",{className:"mt-xs gap-x-xs flex",children:[l.jsx(V,{variant:"smallCaps",color:"white",className:"gap-x-two flex",children:l.jsxs("span",{children:[n,"°"]})}),l.jsx(V,{variant:"smallCaps",color:"white",className:"gap-x-two flex opacity-75",children:l.jsxs("span",{children:[r,"°"]})})]})]})]}));Oue.displayName="ForecastItem";const Iy=d.memo(({width:e,variant:t})=>{const[n,r]=d.useState(!1),s=t==="hail"?20:t==="normal"?25:40,o=400,a=t==="hail"?1:20,i=t==="hail"?3:t==="normal"?30:80,c=100,u=t==="hail"?.8:.5,f=t==="hail"?.3:.1,m=iA();return d.useEffect(()=>{r(!0)},[]),!n||m?null:l.jsx("div",{className:"absolute inset-0",children:Array.from({length:s}).map((p,h)=>{const g=Math.floor(Math.random()*(e-1)),y=Math.floor(Math.random()*(i-a+1))+a,x=Math.floor(Math.random()*(c+1)),v=Math.random()*(u-f)+f,b=Math.floor(Math.random()*o)+1,_=t==="hail"?y:1;return l.jsx("div",{className:"absolute inset-y-0",style:{left:g},children:l.jsx("div",{style:{opacity:v,animationDuration:o+x+"ms",animationDelay:-b+"ms",animationTimingFunction:"linear"},className:"animation-weather-rain absolute inset-y-0 will-change-transform",children:l.jsx("div",{style:{width:_,height:y,opacity:v,maskImage:t!=="hail"?"linear-gradient(to bottom, transparent, black, transparent)":void 0},className:"absolute transform-gpu rounded-full bg-white"})})},h)})})});Iy.displayName="Rain";const eM=d.memo(({width:e,height:t,variant:n})=>{const[r,s]=d.useState(!1),o=n==="normal"?50:80,a=n==="normal"?2e3:1e3,i=1,c=8,u=n==="normal"?1500:800,f=.5,m=.1,p=2,h=iA();return d.useEffect(()=>{s(!0)},[]),!r||h?null:l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("div",{className:z("absolute inset-x-0 bottom-0 translate-y-[80%] bg-white opacity-20 blur-sm",{"rounded-m blur-xs -left-xl -right-xl h-lg":n==="heavy"},{"h-md rounded-[50%]":n==="normal"})}),l.jsx(St,{children:Array.from({length:o}).map((g,y)=>{const x=Math.floor(Math.random()*(e-1)),v=Math.floor(Math.random()*(c-i+1))+i,b=Math.floor(Math.random()*(u+1)),_=Math.floor(Math.random()*p)+1,w=Math.random()*(f-m)+m,S=Math.floor(Math.random()*a)+1;return l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:3},style:{left:x,top:0,height:t},className:"absolute",children:l.jsx("div",{style:{animationDuration:a+b+"ms",animationTimingFunction:"linear",animationDelay:-S+"ms",opacity:w},className:"absolute rounded-full bg-white animation-weather-snow",children:l.jsx("div",{style:{width:v,height:v,animationDuration:"inherit",maskImage:"radial-gradient(black 20%, transparent)"},className:z("absolute rounded-full bg-white",_===1&&"animation-weather-snow-wave")})})},y)})})]})});eM.displayName="Snow";const Lue=d.memo(({width:e,height:t,context:n})=>{const[r,s]=d.useState(!1),o=70,a=2,i=1,c=2,u=500,f=1e3,m=.5,p=.2,h=iA();return d.useEffect(()=>{s(!0)},[]),!r||h?null:l.jsxs("div",{className:"absolute inset-0",children:[l.jsx(St,{children:Array.from({length:o}).map((g,y)=>{const x=Math.floor(Math.random()*(e-1)),v=Math.floor(Math.random()*(t-1)),b=Math.floor(Math.random()*(a-i+1))+i,_=Math.floor(Math.random()*c)+1,w=Math.floor(Math.random()*(u+1)),S=Math.floor(Math.random()*(f+1)),C=Math.random()*(m-p)+p;return l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:3},style:{left:x,top:v},className:"absolute",children:l.jsx("div",{style:{width:b,height:b,animationDuration:5e3+w+"ms",animationDelay:S+"ms",opacity:C},className:z("absolute rounded-full bg-white",{"animation-weather-star-twinkle":_===1})})},y)})}),l.jsx("div",{className:z("w-lg absolute left-0 h-px bg-white","animation-weather-star-shoot",{"context-ntp":n==="ntp"})})]})});Lue.displayName="Stars";const d1t=["clear-day","clear-night","partly-cloudy-day","partly-cloudy-night","cloudy-day","cloudy-night","patchy-rain-possible-day","patchy-rain-possible-night","possible-thunder-day","possible-thunder-night","overcast","fog","snow","sleet","patchy-freezing-drizzle","heavy-snow","blizzard","drizzle","hail","light-shower","heavy-rain","lightning-rain","lightning-snow"],Fue=A.memo(({variant:e,context:t,className:n})=>{const r=d.useCallback(h=>{switch(h){case"clear-day":default:return["#FF813A","#FFC700","#1F84CD"];case"partly-cloudy-day":return["#8E8E8E","#D5D5D5","#1F84CD"];case"partly-cloudy-night":return["#8E8E8E","#6A6A6A","#0B1B39"];case"cloudy-day":case"overcast":case"patchy-rain-possible-day":case"patchy-freezing-drizzle":case"drizzle":case"light-shower":case"heavy-rain":case"blizzard":case"heavy-snow":case"sleet":case"snow":case"fog":case"possible-thunder-day":case"hail":case"lightning-rain":case"lightning-snow":return["#B8B8B8","#8791AB","#486289"];case"cloudy-night":case"possible-thunder-night":case"patchy-rain-possible-night":return["#222938","#3E475A","#1B2230"];case"clear-night":return["#44344A","#091937","#091937"]}},[]),s=d.useCallback(h=>{switch(h){default:return null;case"partly-cloudy-night":case"cloudy-night":case"possible-thunder-night":case"clear-night":return"stars";case"light-shower":case"sleet":case"drizzle":case"patchy-rain-possible-night":case"patchy-rain-possible-day":case"patchy-freezing-drizzle":case"lightning-rain":return"rain";case"hail":return"rain-hail";case"heavy-rain":return"rain-heavy";case"snow":return"snow";case"heavy-snow":case"blizzard":case"lightning-snow":return"snow-heavy"}},[]),o=r(e),[a,i,c]=o,[u,{width:f,height:m}]=ti(),p=t==="ntp"?null:s(e);return l.jsxs("div",{style:{backgroundColor:c},className:z("absolute inset-0 overflow-hidden rounded-xl shadow-md",n),children:[l.jsx("div",{className:"-inset-xl absolute translate-y-1/4 rounded-[50%] opacity-75",style:{backgroundColor:i}}),l.jsx("div",{className:"-inset-xl absolute translate-y-[60%] rounded-[50%] opacity-75",style:{backgroundColor:a}}),l.jsx("div",{className:"rounded-inherit absolute inset-0 overflow-hidden",style:{backdropFilter:"blur(40px)",WebkitBackdropFilter:"blur(40px)"}}),l.jsx("div",{className:"absolute inset-0",ref:u,children:p==="stars"?l.jsx(Lue,{height:m,width:f,context:t}):p==="rain"?l.jsx(Iy,{height:m,width:f,variant:"normal"}):p==="rain-heavy"?l.jsx(Iy,{height:m,width:f,variant:"heavy"}):p==="snow"?l.jsx(eM,{height:m,width:f,variant:"normal"}):p==="snow-heavy"?l.jsx(eM,{height:m,width:f,variant:"heavy"}):p==="rain-hail"?l.jsx(Iy,{height:m,width:f,variant:"hail"}):null}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-transparent"})]})});Fue.displayName="WeatherGradient";const $B={"clear-day":XU,"clear-night":gpe,"partly-cloudy-day":C7,"partly-cloudy-night":w7,"cloudy-day":C7,"cloudy-night":w7,"patchy-rain-possible-day":hpe,"patchy-rain-possible-night":ppe,"possible-thunder-day":mpe,"possible-thunder-night":fpe,overcast:dpe,fog:upe,snow:cpe,sleet:lpe,"patchy-freezing-drizzle":ipe,"heavy-snow":ape,blizzard:ope,drizzle:spe,hail:rpe,"light-shower":npe,"heavy-rain":tpe,"lightning-rain":_7,"lightning-snow":_7},f1t=Ce(async()=>{const{HourlyTemperature:e}=await Se(()=>q(()=>import("./HourlyTemperature-Cb7yWjaM.js"),__vite__mapDeps([464,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx("div",{style:{height:u1t}})}),Bue=A.memo(e=>{const{$t:t}=J(),{prefersMetric:n,setPrefersMetric:r}=c1t(),s=n,[o,a]=d.useState(0),[i,c]=d.useState(!1),u=e,{menuItems:f}=sm(),{openModal:m}=pn().legacy,{permissionState:p}=Qz(),{submitQuery:h}=Ho(),{session:g}=Ne(),{trackEvent:y}=Xe(g),{locale:x}=J(),{value:v}=yge({flag:"weather-provider",defaultValue:"weatherapi",subjectType:"visitor_id"}),b=d.useCallback(()=>{y("precise location modal opened",{origin:"weather_widget"}),m("locationPermissionModal",{onPermissionGranted:N=>{c(!1);const D=ua();h({rawQuery:"weather",copilotOverride:!1,attachments:[],collection:null,newFrontendContextUUID:D,promptSource:"device_location_request",querySource:"device_location_request",deviceLocation:{latitude:N.coords.latitude,longitude:N.coords.longitude},shouldRedirectToBackendUUID:!0})},origin:"weather_widget"})},[y,m,h]);d.useEffect(()=>{p!==void 0&&p!=="granted"&&c(!0)},[p]);const _=d.useCallback(()=>{window.open(u.url||"https://www.accuweather.com/","_blank")},[u.url]);if(!u||!u.current||!u.location)return null;const{current:w,location:S,forecast:C}=u,E=C[0],T=w.condition?.icon,k=Wfe(d1t,T)?$B[T]:XU,I="col-span-1",M=o===0?w.condition?.icon||"clear-day":C[o]?.icon||"clear-day";return l.jsx(Es,{widgetType:"weather",widgetName:"weather_forecast",widgetSize:"full",children:l.jsxs(K,{className:"p-md relative select-none",children:[l.jsx(St,{initial:!1,mode:"popLayout",children:l.jsx(Te.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.3,delay:.3,ease:qa}},transition:{opacity:{duration:.2,ease:qa}},children:l.jsx(Fue,{variant:M})},M)}),l.jsxs(K,{className:"gap-md relative flex flex-col drop-shadow-sm",children:[l.jsxs("div",{className:"gap-x-xl flex",children:[l.jsx(K,{className:I,children:l.jsx("div",{className:"flex h-full items-center",children:l.jsxs(V,{className:"gap-x-md flex items-center",color:"white",children:[l.jsx(ge,{icon:k,size:40,className:"-mt-xs -ml-two"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"font-mono text-4xl",children:l.jsx(jp,{value:s?w.temp_c??0:w.temp_f??0,suffix:"°"})}),l.jsxs("div",{className:"ml-xs mt-two flex gap-px",children:[l.jsx("button",{onClick:()=>r(!1),className:"cursor-pointer appearance-none",children:l.jsx(V,{color:"white",className:s?"opacity-60":void 0,children:l.jsx("div",{className:"font-mono",children:"F"})})}),l.jsx("button",{onClick:()=>r(!0),className:"ml-xs cursor-pointer appearance-none",children:l.jsx(V,{color:"white",className:s?void 0:"opacity-60",children:l.jsx("div",{className:"font-mono",children:"C"})})})]})]})]})})}),l.jsxs(K,{className:I,children:[w.condition&&l.jsx(V,{variant:"section-title",className:"mb-1 leading-tight",color:"white",children:w.condition.text}),l.jsxs("div",{className:"gap-x-xs flex",children:[l.jsx(V,{variant:"smallCaps",color:"white",children:l.jsx(jp,{value:s?E?.maxtemp_c??0:E?.maxtemp_f??0,suffix:"°"})}),l.jsx(V,{variant:"smallCaps",className:"flex opacity-70",color:"white",children:l.jsx(jp,{value:s?E?.mintemp_c??0:E?.mintemp_f??0,suffix:"°"})})]})]})]}),l.jsxs("div",{className:"gap-sm flex",children:[l.jsxs(K,{className:"flex flex-col items-start justify-center",children:[l.jsx("div",{className:"gap-sm relative flex items-center",children:l.jsxs(ga,{className:"gap-xs text-xs text-white",children:[l.jsx(Bn,{id:"location-name",children:l.jsxs(V,{variant:"smallBold",className:"text-right",color:"white",children:[S.name,S.is_usa?S.region?`, ${S.region}`:"":`, ${S.country}`]})}),i&&l.jsx(Bn,{id:"precise",children:l.jsx(st,{onClick:b,size:"small",extraCSS:"!text-white hover:underline hover:opacity-100 !p-0 !h-0 decoration-white/50 decoration-offset-[4px] opacity-70 !font-normal",pill:!0,variant:"noBackground",text:t({defaultMessage:"Use precise location",id:"Si49wMl5CP"})})})]})}),S.localtime&&l.jsx(V,{variant:"tinyRegular",color:"white",className:"opacity-75",children:Hbe(S.localtime,x)})]}),f&&f?.length>0&&l.jsx("div",{className:"absolute right-0 top-0",children:l.jsx(Fn.Menu,{buttonClass:"!text-white opacity-40 hover:opacity-100 hover:!bg-white/10",menuItems:f})})]})]}),l.jsx(K,{className:"mt-xl relative grid grid-cols-3 gap-x-4 gap-y-6 drop-shadow-sm md:grid-cols-6",children:C.map((N,D)=>l.jsx("button",{onClick:()=>a(D),className:D!==o?"duration-150 hover:opacity-70 active:scale-[0.98]":"",children:l.jsx(Oue,{day:zbe(N.dow??"",x),high:(s?N.maxtemp_c:N.maxtemp_f)??0,low:(s?N.mintemp_c:N.mintemp_f)??0,icon:$B[N.icon],selected:o===D})},D))}),l.jsx(K,{className:"mt-sm",children:l.jsx(f1t,{forecast:C,activeDay:o,isMetric:s})}),v==="accuweather"&&l.jsx(K,{className:"mt-lg flex cursor-pointer justify-end",onClick:_,children:l.jsxs(V,{variant:"micro",color:"white",className:"mt-xs gap-xs -mb-sm -mr-xs flex items-center opacity-65 hover:opacity-40",children:["The AccuWeather",l.jsx("sup",{className:"-ml-xs",children:"®"})," Forecast",l.jsx(ge,{icon:B("arrow-up-right"),size:"xs"})]})})]})})});Bue.displayName="WeatherWidget";const qB=()=>{const{removeWidgetFromEntry:e}=lv({reason:"remove-widget"}),{$t:t}=J(),{isMobileStyle:n}=Re(),{result:r}=It(),{session:s}=Ne(),{trackEvent:o}=Xe(s),[a,i]=d.useState(!1),{openToast:c}=hn(),u=d.useCallback(()=>{if(r?.backend_uuid){const p="pplx://finance_widget";e({entryUUID:r.backend_uuid,data:{url:p,widget_type:"finance_widget",is_widget:!0}}),c({message:t({defaultMessage:"Thanks for your feedback!",id:"coh2h6fh1P"}),variant:"success",timeout:2}),o("remove widget",{url:p,entryUUID:r.backend_uuid,source:"thread"}),i(!1)}},[r?.backend_uuid,e,o,t,c]),f=d.useMemo(()=>[{type:"default",text:t({defaultMessage:"Report",id:"x5Tz6MZH82"}),icon:B("thumb-down"),onClick:()=>i(!0)}],[t]),m=d.useMemo(()=>[{text:"Cancel",variant:"common",onClick:()=>i(!1)},{text:"Report",variant:"rejected",onClick:u}],[u]);return l.jsxs(l.Fragment,{children:[l.jsx(zs,{items:f,isMobileStyle:n,wrapperClassName:"inline-flex",children:l.jsx(st,{size:"small",icon:B("dots")})}),l.jsx(po,{isOpen:a,onClose:()=>i(!1),title:t({defaultMessage:"Report Widget",id:"8bkBtXioXd"}),actionList:m,children:l.jsx("div",{className:"space-y-md",children:l.jsx(V,{variant:"base",children:t({defaultMessage:"Report this widget for being inaccurate or irrelevant. This helps improve the product for everyone.",id:"bUe9nPbALv"})})})})]})},m1t=({followed:e,toggleFollow:t,isLoading:n})=>n?null:l.jsx(Mue,{isFollowed:e,toggleFollow:t,size:"small",variant:e?"primaryGhost":"border"}),Uue=A.memo(({symbol:e,button:t,onFollowToastTimeout:n})=>{const r="finance-watch-entity",{inApp:s}=Sa(),{$t:o}=J(),{isFollowed:a,toggleFollow:i,showFollowToast:c,showUnfollowToast:u,setShowFollowToast:f,setShowUnfollowToast:m,isLoadingSubscriptions:p}=Z0t({watchlistType:"FINANCE",identifier:e,modalOrigin:ft.FINANCE_WATCHLIST,loginPrompt:"Sign in to manage your data",reason:r}),h=t||m1t,{openModal:g}=pn().legacy,y=d.useCallback(()=>{f(!1),n?.()},[n,f]),x=d.useCallback(()=>m(!1),[m]),v=d.useCallback(()=>{g("watchlistModal",{watchlistType:"FINANCE",origin:"toast"}),f(!1)},[g,f]),b=d.useCallback(()=>{g("watchlistModal",{watchlistType:"FINANCE",origin:"toast"}),m(!1)},[g,m]);return l.jsxs(l.Fragment,{children:[l.jsx(J5,{message:o({defaultMessage:"Added {symbol} to your watchlist",id:"KBhWJYPNym"},{symbol:e}),isVisible:c,timeout:5,onTimeout:y,onSettingsClick:v,icon:B("star")}),l.jsx(J5,{message:o({defaultMessage:"Removed {symbol} from your watchlist",id:"q+PA0pNibu"},{symbol:e}),isVisible:u,onSettingsClick:b,timeout:5,onTimeout:x,icon:B("star-off")}),!s&&l.jsx(h,{isLoading:p,followed:a,toggleFollow:i})]})});Uue.displayName="FinanceWatchEntity";const p1t=({followed:e,toggleFollow:t,isLoading:n})=>{const{isMobileStyle:r}=Re();return n?null:r?l.jsx(wt,{icon:e?B("star-filled"):B("star"),size:"small",variant:"text",onClick:t,"aria-label":e?"Following":"Follow"}):l.jsx(wt,{leadingIcon:e?B("star-filled"):B("star"),size:"small",variant:"text",onClick:t,children:e?"Following":"Follow"})},g0=()=>{const{firstResult:e}=on(),t=e?.status,n=e?.privacy_state,r=el(),{isIncognitoLocal:s}=G4();return d.useMemo(()=>{if(!t)return!1;const o=!!n&&(s&&n!==WS.INCOGNITO||!s&&n===WS.INCOGNITO);return!r&&t!==Pr.PENDING||o},[s,n,r,t])},h1t={variant:"secondary",size:"small"},Vue=({quote:e})=>{const{session:t}=Ne(),{trackEvent:n}=Xe(t),r=d.useCallback(()=>{n("finance link clicked",{referrer:Rb.SEARCH_WIDGET,targetPageType:Jg.ASSET_PAGE,symbol:e.symbol,destinationUrl:`/finance/${e.symbol}`})},[n,e.symbol]);return e?l.jsx(yt,{href:`/finance/${e.symbol}`,className:"gap-md hover:bg-subtler p-sm -m-sm flex cursor-pointer items-center rounded-md transition-all active:scale-95",onClick:r,children:l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Xg,{symbol:e.symbol,src:e.image??"",srcDark:e.imageDark??""}),l.jsxs(K,{children:[l.jsx(K,{className:"gap-sm flex items-center",children:l.jsx(WN,{name:e.name})}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e.symbol,exchange:e.exchange,country:e.exchangeCountry})})]})]})}):null},g1t=({quotes:e})=>l.jsx(K,{className:"scrollbar-none overflow-x-auto",children:l.jsx(K,{className:"gap-md p-sm flex items-center",children:e.map(t=>l.jsx(Vue,{quote:t},t.symbol))})}),KB=({href:e,symbol:t})=>{const{isMobileStyle:n}=Re(),{$t:r}=J(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(()=>{o("finance link clicked",{referrer:Rb.SEARCH_WIDGET,targetPageType:Jg.ASSET_PAGE,symbol:t,destinationUrl:e})},[o,t,e]);return l.jsx(K,{className:"gap-sm flex items-center justify-center",children:l.jsx(Ge,{variant:"primaryGhost",chevron:!0,chevronIcon:B("chevron-right"),text:r({defaultMessage:"Deep Dive on {pplxFinance}",id:"QX457HdJyA"},{pplxFinance:"Perplexity Finance"}),size:"small",href:e,onClick:a,fullWidth:n})})},YB=({children:e})=>l.jsx(K,{className:"gap-sm shadow-subtle flex flex-col rounded-xl border",variant:"background",children:e}),Hue=A.memo(({quotes:e})=>{const t=e[0],n=d.useMemo(()=>e.slice(1).map(o=>o.symbol),[e]),r=g0();if(!t)return null;const s=t.symbol;return n?.length?l.jsxs(YB,{children:[l.jsxs("div",{className:"gap-sm p-sm flex items-center justify-between",children:[l.jsx(g1t,{quotes:e}),l.jsx(K,{className:"gap-xs flex items-center",children:!r&&l.jsx(qB,{})})]}),l.jsx(fB,{symbol:s,comparisons:n,chartHeight:a0,context:"thread"}),l.jsx(K,{className:"px-sm pb-sm",children:l.jsx(KB,{href:`/finance/${t?.symbol}?comparing=${n.join(",")}`,symbol:s})})]}):l.jsxs(YB,{children:[l.jsxs(K,{className:"pt-md px-md pb-sm flex items-start justify-between",children:[l.jsx(Vue,{quote:t}),l.jsxs(K,{className:"gap-xs flex items-center",children:[!r&&l.jsx(qB,{}),l.jsx(Uue,{symbol:s,button:p1t}),l.jsx(zN,{symbol:s,buttonProps:h1t})]})]}),l.jsx(fB,{symbol:s,initialQuote:t,chartHeight:225,zoomable:!1,context:"thread"}),l.jsx(K,{className:"px-sm pb-sm",children:l.jsx(KB,{href:`/finance/${t?.symbol}`,symbol:s})})]})});Hue.displayName="FinanceThreadStockWidget";const QB=new Set,H8=A.memo(({data:e})=>{const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=W4();return d.useEffect(()=>{const o=e.data?.length||e.data_v2?.length;!t||!o||QB.has(t)||(r("web.frontend.finance_widgets_render_time",{widgetType:"finance",widgetName:e.data_v2?.length?"stock_v2":"stock_v1",queryMode:n,widgetSize:"full"}),QB.add(t))},[e.data,e.data_v2,t,n,r,s]),e.data_v2?.length?l.jsx(Mr,{fallback:null,onError:o=>Z.error("FinanceWidget failed to render",{cause:o}),children:l.jsx(Es,{widgetType:"finance",widgetName:"stock_v2",widgetSize:"full",children:l.jsx(Hue,{quotes:e.data_v2})})}):null});H8.displayName="FinanceWidget";const y1t=()=>null,x1t=Ce(()=>Se(()=>q(()=>import("./index-CjrpMxgd.js"),__vite__mapDeps([465,4,1,6,3,9,7,8,10,11,12]))),{loading:()=>l.jsx(y1t,{})}),zue=A.memo(({widgetData:e,menuItems:t,tableCitationOffset:n})=>{const r=Vv(e);return r?Vi(r).with({object:"CalculatorWidget"},s=>l.jsx(Fn,{menuItems:t,children:l.jsx(vae,{...s})})).with({object:"FinanceWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(H8,{data:s})})).with({object:"CrunchbaseWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(x1t,{...s})})).with({object:"PlaceWidget"},()=>null).with({object:"ShopifyWidget"},()=>null).with({object:"JobsWidget"},()=>null).with({object:"TimeWidget"},s=>l.jsx(Fn,{menuItems:t,children:l.jsx(Iue,{...s})})).with({object:"TimerWidget"},s=>l.jsx(Fn,{menuItems:t,children:l.jsx(Pue,{...s})})).with({object:"CurrencyExchangeWidget"},s=>l.jsx(Fn,{menuItems:t,className:"overflow-hidden !p-0",variant:"noChrome",children:l.jsx(oce,{...s})})).with({object:"PredictionMarketWidget"},s=>l.jsx(wce,{...s})).with({object:"WeatherWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(Bue,{...s})})).with({object:"TableWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(Nue,{tableData:s,citationOffset:n??0})})).with({object:"SportsEventsWidget"},s=>l.jsx(lp,{data:s})).with({object:"SportsIndvScheduleWidget"},s=>l.jsx(lp,{data:s})).with({object:"SportsStandingsWidget"},s=>l.jsx(lp,{data:s})).with({object:"SportsIndvEventsWidget"},s=>l.jsx(lp,{data:s})).with({object:"FlightStatusWidget"},s=>l.jsx(dce,{data:s})).with({object:"PriceComparisonWidget"},s=>l.jsx(Pst,{block:s})).with({object:"TaskWidget"},s=>l.jsx(jue,{data:s})).with({object:"GenericFallbackWidget"},s=>l.jsx(fce,{...s})).otherwise(()=>(Z.warn(new Error(`No PanelComponent found for livePanelType: ${r.object}`),{widgetData:e}),null)):null});zue.displayName="LivePanel";const Wue=A.memo(({name:e,title:t,values:n,onEntityClick:r})=>{const{inFlight:s}=on(),o=d.useCallback(c=>{s||r(c)},[s,r]),a=z("underline-offset-2 cursor-pointer decoration-subtler hover:text-super hover:decoration-super group transition-colors duration-200 ease-in-out",{underline:!s}),i=d.useCallback(({content:c,href:u})=>{const f=u||(c.startsWith("http://")||c.startsWith("https://")?c:`https://${c}`);return l.jsxs(yt,{href:f,target:"_blank",rel:"noopener",className:a,children:[c,l.jsx(V,{className:"ml-xs inline",color:"light",variant:"tiny",children:l.jsx(ge,{icon:B("external-link"),size:"xs"})})]})},[a]);return l.jsx(Fn.Item,{name:e,title:t,value:n.map((c,u)=>l.jsx(Gue,{attributeValue:c,index:u,totalValues:n.length,entityStyling:a,handleEntityClick:o,renderLink:i},`${c.id}-${u}`))},e)});Wue.displayName="WikiPanelItem";const Gue=A.memo(({attributeValue:e,index:t,totalValues:n,entityStyling:r,handleEntityClick:s,renderLink:o})=>{const a=d.useMemo(()=>()=>l.jsx("div",{children:e.value}),[e.value]),i=d.useCallback(()=>s(e.value),[e.value,s]),c=d.useMemo(()=>l.jsxs(Mr,{fallback:a,children:[e.value&&l.jsx(l.Fragment,{children:e.clickable_entity?l.jsx("span",{className:r,onClick:i,children:e.value}):e.value}),e.detail&&l.jsxs("span",{className:"text-quiet ml-1",children:["(",e.source?o({content:e.detail,href:e.source}):e.detail,")"]})]}),[e.clickable_entity,e.detail,e.source,e.value,r,a,i,o]);return l.jsxs("span",{children:[c,t{const{$t:s}=J(),{title:o,subtitle:a,attributes:i,image_url:c,source_url:u}=e,{session:f}=Ne(),{trackEvent:m}=Xe(f),{firstResult:p}=on(),h=p?.frontend_context_uuid,g=Rn(),y=i.length,[x,v]=d.useState(y),b=x===y,_=i.length>2,{menuItems:w}=sm(),S=d.useCallback(()=>{m("click toggle on knowledge card",{newState:b?"collapsed":"expanded",entryUUID:r??"",type:e.type,id:e.source_url,name:e.title}),v(M=>M===XB?y:XB)},[m,b,y,r,e]),[C,{height:E}]=ti(),T=t,k=ua(),I=d.useCallback(M=>{if(m("knowledge card link clicked",{entryUUID:r??"",type:e.type,id:e.source_url,name:e.title,label:"attributes",value:M}),n({fork:T,rawQuery:M,collection:null,newFrontendContextUUID:T?k:null,existingFrontendContextUUID:T?void 0:h,promptSource:"user",querySource:"entity_link"}),T){const N=new URLSearchParams({q:M,newFrontendContextUUID:k}),D=new URL(window.location.href);D.pathname="search/new",D.search=N.toString();const j=D.toString();g.push(j)}},[n,T,k,h,g,r,e,m]);return d.useEffect(()=>{m("knowledge card shown",{entryUUID:r??"",type:e.type,id:e.source_url,name:e.title})},[]),l.jsx("div",{className:"relative",children:l.jsx(Te.div,{animate:E>0?{height:E}:{},transition:{type:"spring",bounce:.2,duration:.2},className:"overflow-hidden",children:l.jsxs("div",{ref:C,className:"gap-md relative flex flex-col",children:[l.jsx("div",{className:"flex items-end justify-between",children:l.jsx(Fn.Title,{title:o,subtitle:a,image_url:c,href:u,links:e.links,entryUUID:r??"",data:e,children:l.jsx("div",{className:"flex items-start",children:l.jsx("div",{className:"gap-sm flex items-center",children:w&&w?.length>0&&l.jsx(Fn.Menu,{menuItems:w,buttonClass:"opacity-0 pointer-events-none"})})})})}),b&&l.jsx("div",{className:"gap-sm border-subtlest pt-md md:gap-x-md grid grid-cols-[auto,1fr] border-t",children:i.slice(0,x).map(M=>l.jsx(Wue,{name:M.key,title:M.title,values:M.values,onEntityClick:I},M.key))}),l.jsx("div",{children:_&&l.jsx("div",{className:"flex justify-end",children:l.jsx(Ge,{variant:"border",fullWidth:!0,text:s(b?{defaultMessage:"Less",id:"mFYgAXM/x4"}:{defaultMessage:"More",id:"I5NMJ8llIi"}),size:"tiny",pill:!0,onClick:S,icon:b?B("chevron-up"):B("chevron-down"),extraCSS:"pl-xs w-[76px]"})})})]})})})});$ue.displayName="WikiPanel";function v1t(e){if(!e||!e.card_type)return null;const{primaryLink:t,otherLinks:n}=e.links.reduce((s,o)=>(o.type==="PRIMARY"&&!s.primaryLink?s.primaryLink=o:s.otherLinks.push(o),s),{primaryLink:null,otherLinks:[]}),r=e?.media_items?.[0]?.image??e?.image_urls?.[0]??"";return{source_url:t?.url??"",image_url:r,title:e?.title??"",subtitle:e.description??"",attributes:e.attributes??[],type:e.card_type,links:n}}const que=A.memo(({knowledgePanelData:e,isReadonly:t,submit:n,menuItems:r,entryUUID:s,className:o})=>{const a=d.useMemo(()=>e?v1t(e):null,[e]);return a?l.jsx(Fn,{menuItems:r,className:o,children:l.jsx($ue,{data:a,submit:n,isReadonly:t,entryUUID:s??""})}):null});que.displayName="StaticPanel";const z8=A.memo(({data:e,submit:t,isReadonly:n=!1,menuItems:r,tableCitationOffset:s,entryUUID:o})=>l.jsxs(l.Fragment,{children:[!I9(e)&&D3(e)&&l.jsx(zue,{widgetData:e,menuItems:r??Pe,tableCitationOffset:s}),iMe(e)&&l.jsx(que,{knowledgePanelData:e,summaryData:null,submit:t,isReadonly:n,menuItems:r??Pe,entryUUID:o??""}),I9(e)&&l.jsx(Qoe,{graphData:e})]}));z8.displayName="ThreadEntryPanel";const Kue=A.memo(({taskWidgetData:e,submitQuery:t})=>{const{result:n,isEntryInFlight:r}=It(),s={name:"task-widget",snippet:"",timestamp:"",url:"",meta_data:e,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""};return l.jsx(z8,{data:s,submit:t,isReadonly:!1,menuItems:Pe,inFlight:r,entryUUID:n?.backend_uuid??null},"task")});Kue.displayName="TaskWidget";const b1t=25,Py="text-super",ux=A.memo(({rating:e,className:t,reviewCount:n,size:r="xs",textVariant:s="small",reviewTextVariant:o="small",reviewTextColor:a="light",variant:i,showCount:c=!0,minReviewCount:u=b1t,showRatingLabel:f=!0,ratingPosition:m="after",url:p,color:h="default"})=>{const g=Math.floor(e),y=e%1===0?0:1,x=5-g-y;if(e===0||!n||nl.jsx(ge,{icon:B("star-filled"),size:r,className:Py},`rating-star-full-${C}`)),i!=="truncated"&&Array.from({length:y}).map((S,C)=>l.jsx(Yue,{fraction:e%1,size:r},`rating-star-half-${C}`)),i!=="truncated"&&Array.from({length:x}).map((S,C)=>l.jsx("span",{className:"inline-flex opacity-20",children:l.jsx(ge,{icon:B("star-filled"),size:r,className:Py})},`rating-star-empty-${C}`))]}),_=n&&n>0&&c&&l.jsxs(V,{variant:o,color:a,className:"group-hover/link:text-super relative leading-none",children:["(",l.jsx(b7,{value:n}),")"]}),w=l.jsxs("div",{className:z("gap-xs flex items-center",t),children:[m==="before"&&v,b,m==="after"&&v,_]});return p?l.jsx(yt,{href:p,target:"_blank",className:"group/link",children:w}):w});ux.displayName="EntityItemRating";const Yue=A.memo(({fraction:e,size:t})=>l.jsxs("div",{className:"isolate inline-grid grid-cols-1 grid-rows-1",children:[l.jsx("span",{className:"text-foreground relative col-start-1 row-start-1 inline-flex items-center opacity-30",children:l.jsx("span",{className:"inline-flex",children:l.jsx(ge,{icon:B("star-filled"),size:t})})}),l.jsx("span",{className:"relative col-start-1 row-start-1 inline-flex items-center",children:l.jsx("span",{className:z(Py,"inline-flex overflow-hidden"),style:{width:e*100+"%"},children:l.jsx(ge,{icon:B("star-filled"),size:t,className:"shrink-0"})})})]}));Yue.displayName="HalfStar";const _1t=d.createContext(null);function w1t(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,s=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===s&&r===o}function Ni(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let s=null;"interactive"in r&&(s=Object.assign({},r),delete s.interactive);const o=t[r.ref];if(o){s=s||Object.assign({},r),delete s.ref;for(const a of S1t)a in o&&(s[a]=o[a])}return s||r});return{...e,layers:n}}var nU={};const rU={version:8,sources:{},layers:[]},sU={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},OS={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},oU={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},E1t=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],k1t=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class _f{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=s=>{const o=this.props[oU[s.type]];o?o(s):s.type==="error"&&console.error(s.error)},this._onPointerEvent=s=>{(s.type==="mousemove"||s.type==="mouseout")&&this._updateHover(s);const o=this.props[sU[s.type]];o&&(this.props.interactiveLayerIds&&s.type!=="mouseover"&&s.type!=="mouseout"&&(s.features=this._hoveredFeatures||this._queryRenderedFeatures(s.point)),o(s),delete s.features)},this._onCameraEvent=s=>{if(!this._internalUpdate){const o=this.props[OS[s.type]];o&&o(s)}s.type in this._deferredEvents&&(this._deferredEvents[s.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const s=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||s||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=_f.savedMaps.pop();if(!r)return null;const s=r.map,o=s.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);s._container=n,r.setProps({...t,styleDiffing:!1}),s.resize();const{initialViewState:a}=t;return a&&(a.bounds?s.fitBounds(a.bounds,{...a.fitBoundsOptions,duration:0}):r._updateViewState(a,!1)),s.isStyleLoaded()?s.fire("load"):s.once("styledata",()=>s.fire("load")),s._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=rU}=n,s={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||M1t()||null,container:t,style:tU(r)},o=s.initialViewState||s.viewState||s;if(Object.assign(s,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),n.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,n.gl)}const a=new this._MapClass(s);o.padding&&a.setPadding(o.padding),n.cursor&&(a.getCanvas().style.cursor=n.cursor),this._createShadowTransform(a);const i=a._render;a._render=f=>{this._inRender=!0,i.call(a,f),this._inRender=!1};const c=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{c.call(a._renderTaskQueue,f),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const u=a.fire;a.fire=this._fireEvent.bind(this,u),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),ZB(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in sU)a.on(f,this._onPointerEvent);for(const f in OS)a.on(f,this._onCameraEvent);for(const f in oU)a.on(f,this._onEvent);this._map=a}recycle(){this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(),_f.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=C1t(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,s=this._renderTransform,{zoom:o,pitch:a,bearing:i}=s,c=r.isMoving();c&&(s.cameraElevationReference="sea");const u=eU(s,{...JB(r.transform),...t});if(c&&(s.cameraElevationReference="ground"),u&&n){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=o!==s.zoom),f.rotate||(f.rotate=i!==s.bearing),f.pitch||(f.pitch=a!==s.pitch)}return c||eU(r.transform,t),u}_updateSettings(t,n){const r=this._map;let s=!1;for(const o of E1t)o in t&&!Ni(t[o],n[o])&&(s=!0,r[`set${o[0].toUpperCase()}${o.slice(1)}`]?.call(r,t[o]));return s}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=rU,styleDiffing:s=!0}=t,o={diff:s};return"localIdeographFontFamily"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(tU(r),o),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let s=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Ni(t.light,n.light)&&(s=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Ni(t.fog,n.fog)&&(s=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Ni(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(s=!0,r.setTerrain(t.terrain))),s}_updateHandlers(t,n){const r=this._map;let s=!1;for(const o of k1t){const a=t[o]??!0,i=n[o]??!0;Ni(a,i)||(s=!0,a?r[o].enable(a):r[o].disable())}return s}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:s=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,o=this._hoveredFeatures?.length>0,a=this._queryRenderedFeatures(t.point),i=a.length>0;!i&&o&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=a,i&&!o&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}_fireEvent(t,n,r){const s=this._map,o=s.transform,a=typeof n=="string"?n:n.type;return a==="move"&&this._updateViewState(this.props,!1),a in OS&&(typeof n=="object"&&(n.viewState=JB(o)),this._map.isMoving())?(s.transform=this._renderTransform,t.call(s,n,r),s.transform=o,s):(t.call(s,n,r),s)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{ZB(this._renderTransform,n),t.transform=n}}}_f.savedMaps=[];function M1t(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||nU.MapboxAccessToken}catch{}try{e=e||nU.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const T1t=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function A1t(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const s=t.transform;t.transform=e.transform;const o=t.project(r);return t.transform=s,o},unproject:r=>{const s=t.transform;t.transform=e.transform;const o=t.unproject(r);return t.transform=s,o},queryTerrainElevation:(r,s)=>{const o=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(r,s);return t.transform=o,a},queryRenderedFeatures:(r,s)=>{const o=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(r,s);return t.transform=o,a}};for(const r of N1t(t))!(r in n)&&!T1t.includes(r)&&(n[r]=t[r].bind(t));return n}function N1t(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const R1t=typeof document<"u"?d.useLayoutEffect:d.useEffect,D1t=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function j1t(e,t){for(const r of D1t)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const c_=d.createContext(null);function I1t(e,t){const n=d.useContext(_1t),[r,s]=d.useState(null),o=d.useRef(),{current:a}=d.useRef({mapLib:null,map:null});d.useEffect(()=>{const u=e.mapLib;let f=!0,m;return Promise.resolve(u||q(()=>import("./mapbox-gl-BYD-OPEL.js").then(p=>p.m),__vite__mapDeps([11,1,12]))).then(p=>{if(!f)return;if(!p)throw new Error("Invalid mapLib");const h="Map"in p?p:p.default;if(!h.Map)throw new Error("Invalid mapLib");if(j1t(h,e),!h.supported||h.supported(e))e.reuseMaps&&(m=_f.reuse(e,o.current)),m||(m=new _f(h.Map,e,o.current)),a.map=A1t(m),a.mapLib=h,s(m),n?.onMapMount(a.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(p=>{const{onError:h}=e;h?h({type:"error",target:null,error:p}):console.error(p)}),()=>{f=!1,m&&(n?.onMapUnmount(e.id),e.reuseMaps?m.recycle():m.destroy())}},[]),R1t(()=>{r&&r.setProps(e)}),d.useImperativeHandle(t,()=>a.map,[r]);const i=d.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return d.createElement("div",{id:e.id,ref:o,style:i},r&&d.createElement(c_.Provider,{value:a},d.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const P1t=d.forwardRef(I1t),O1t=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function _u(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const s=t[r];Number.isFinite(s)&&!O1t.test(r)?n[r]=`${s}px`:n[r]=s}}const L1t=d.memo(d.forwardRef((e,t)=>{const{map:n,mapLib:r}=d.useContext(c_),s=d.useRef({props:e});s.current.props=e;const o=d.useMemo(()=>{let y=!1;d.Children.forEach(e.children,b=>{b&&(y=!0)});const x={...e,element:y?document.createElement("div"):null},v=new r.Marker(x);return v.setLngLat([e.longitude,e.latitude]),v.getElement().addEventListener("click",b=>{s.current.props.onClick?.({type:"click",target:v,originalEvent:b})}),v.on("dragstart",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDragStart?.(_)}),v.on("drag",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDrag?.(_)}),v.on("dragend",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDragEnd?.(_)}),v},[]);d.useEffect(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);const{longitude:a,latitude:i,offset:c,style:u,draggable:f=!1,popup:m=null,rotation:p=0,rotationAlignment:h="auto",pitchAlignment:g="auto"}=e;return d.useEffect(()=>{_u(o.getElement(),u)},[u]),d.useImperativeHandle(t,()=>o,[]),(o.getLngLat().lng!==a||o.getLngLat().lat!==i)&&o.setLngLat([a,i]),c&&!w1t(o.getOffset(),c)&&o.setOffset(c),o.isDraggable()!==f&&o.setDraggable(f),o.getRotation()!==p&&o.setRotation(p),o.getRotationAlignment()!==h&&o.setRotationAlignment(h),o.getPitchAlignment()!==g&&o.setPitchAlignment(g),o.getPopup()!==m&&o.setPopup(m),zh.createPortal(e.children,o.getElement())}));function aU(e){return new Set(e?e.trim().split(/\s+/):[])}d.memo(d.forwardRef((e,t)=>{const{map:n,mapLib:r}=d.useContext(c_),s=d.useMemo(()=>document.createElement("div"),[]),o=d.useRef({props:e});o.current.props=e;const a=d.useMemo(()=>{const i={...e},c=new r.Popup(i);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{o.current.props.onOpen?.(u)}),c},[]);if(d.useEffect(()=>{const i=c=>{o.current.props.onClose?.(c)};return a.on("close",i),a.setDOMContent(s).addTo(n.getMap()),()=>{a.off("close",i),a.isOpen()&&a.remove()}},[]),d.useEffect(()=>{_u(a.getElement(),e.style)},[e.style]),d.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!Ni(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const i=aU(a.options.className),c=aU(e.className);for(const u of i)c.has(u)||a.removeClassName(u);for(const u of c)i.has(u)||a.addClassName(u);a.options.className=e.className}return zh.createPortal(e.children,s)}));function y0(e,t,n,r){const s=d.useContext(c_),o=d.useMemo(()=>e(s),[]);return d.useEffect(()=>{const a=t,i=null,c=typeof t=="function"?t:null,{map:u}=s;return u.hasControl(o)||(u.addControl(o,a?.position),i&&i(s)),()=>{c&&c(s),u.hasControl(o)&&u.removeControl(o)}},[]),o}function F1t(e){const t=y0(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return d.useEffect(()=>{_u(t._container,e.style)},[e.style]),null}d.memo(F1t);function B1t(e){const t=y0(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return d.useEffect(()=>{_u(t._controlContainer,e.style)},[e.style]),null}d.memo(B1t);function U1t(e,t){const n=d.useRef({props:e}),r=y0(({mapLib:s})=>{const o=new s.GeolocateControl(e),a=o._setupUI.bind(o);return o._setupUI=i=>{o._container.hasChildNodes()||a(i)},o.on("geolocate",i=>{n.current.props.onGeolocate?.(i)}),o.on("error",i=>{n.current.props.onError?.(i)}),o.on("outofmaxbounds",i=>{n.current.props.onOutOfMaxBounds?.(i)}),o.on("trackuserlocationstart",i=>{n.current.props.onTrackUserLocationStart?.(i)}),o.on("trackuserlocationend",i=>{n.current.props.onTrackUserLocationEnd?.(i)}),o},{position:e.position});return n.current.props=e,d.useImperativeHandle(t,()=>r,[]),d.useEffect(()=>{_u(r._container,e.style)},[e.style]),null}d.memo(d.forwardRef(U1t));function V1t(e){const t=y0(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return d.useEffect(()=>{_u(t._container,e.style)},[e.style]),null}const H1t=d.memo(V1t);function z1t(e){const t=y0(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),n=d.useRef(e),r=n.current;n.current=e;const{style:s}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),d.useEffect(()=>{_u(t._container,s)},[s]),null}d.memo(z1t);const W1t=A.memo(e=>{const{$t:t}=J(),{isLoading:n,onClick:r,...s}=e;return l.jsx(K,{className:"right-sm top-sm absolute z-30 rounded-full border-2",children:l.jsx(Ge,{pill:!0,size:"tiny",variant:"inverted",icon:B("current-location"),isLoading:n,text:t(n?{defaultMessage:"Searching...",id:"NNQzoiiDEK"}:{defaultMessage:"Search here",id:"Yi0/yIKDMQ"}),onClick:r,...s})})});W1t.displayName="MapSearchHereButton";const Que=A.memo(()=>l.jsx("svg",{className:"h-auto w-full",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 4635.92 708.22",children:l.jsx("path",{d:"M4806.79,746.44a25,25,0,1,0,25,25A25,25,0,0,0,4806.79,746.44Zm0,46.08a21.08,21.08,0,1,1,21.08-21.07A21.09,21.09,0,0,1,4806.79,792.52Zm8.12-25.33c0-4.55-3.25-7.25-8-7.25h-8v22.77h3.94v-8.26h4.26l4.13,8.26h4.23L4811,773.6A6.59,6.59,0,0,0,4814.91,767.19Zm-8.16,3.78h-3.87v-7.55h3.87c2.63,0,4.23,1.33,4.23,3.77S4809.38,771,4806.75,771ZM569.17,605.31a97.95,97.95,0,1,1-97.94-97.94A97.94,97.94,0,0,1,569.17,605.31Zm552.18,0a97.95,97.95,0,1,1-97.95-97.94A97.95,97.95,0,0,1,1121.35,605.31ZM1099,304.09C998.87,235.77,878,195.89,747.32,195.89a619.47,619.47,0,0,0-351,108.2H195.89l90.17,98.12a274.9,274.9,0,0,0-89.89,203.66c0,152.19,123.38,275.57,275.57,275.57A274.54,274.54,0,0,0,659,808l88.34,96.12L835.66,808a274.54,274.54,0,0,0,187.23,73.4c152.19,0,275.68-123.38,275.68-275.57a274.9,274.9,0,0,0-89.89-203.66l90.17-98.12ZM471.74,792.36c-103,0-186.49-83.49-186.49-186.49s83.5-186.49,186.49-186.49,186.5,83.49,186.5,186.49S574.74,792.36,471.74,792.36ZM747.37,600.5c0-122.73-89.26-228-207-273.06a538.15,538.15,0,0,1,413.93,0C836.62,372.49,747.37,477.78,747.37,600.5Zm462,5.37c0,103-83.5,186.49-186.49,186.49s-186.5-83.49-186.5-186.49,83.5-186.49,186.5-186.49S1209.38,502.87,1209.38,605.87Zm654.11-173.45h43.37v85.84h-50.75c-39.09,0-64.17,19.18-64.17,58.28V792.36h-92.78V432.42h92.78V492.9C1800.05,450.12,1829.56,432.42,1863.49,432.42Zm186.35-85.59a56.06,56.06,0,0,1-112.12,0c0-31.72,24.34-56.8,56.06-56.8S2049.84,315.11,2049.84,346.83Zm-102.33,85.59H2040V792.36h-92.53Zm347.35-6.08a179,179,0,0,0-109.22,36.52V432.42h-92.52V898h92.52V761.92a179,179,0,0,0,109.22,36.52c102.76,0,186-83.3,186-186.05S2397.62,426.34,2294.86,426.34Zm-8.15,287.12a101.07,101.07,0,1,1,101.07-101.07A101.07,101.07,0,0,1,2286.71,713.46Zm1890.57-34.8c0,69.4-59.54,119.78-141.57,119.78-85.12,0-144.57-51.57-144.57-125.42v-2h90.54v2c0,30.82,22,51.53,54.78,51.53,31.42,0,52.53-15.33,52.53-38.14,0-21.61-14.61-33.69-53.89-44.56l-51.71-14.1c-54.34-14.71-85.5-50.12-85.5-97.14,0-60.42,57-104.27,135.57-104.27,79.3,0,132.58,43.88,132.58,109.21v2.05h-85.3v-2.05c0-22.18-20.77-39.55-47.28-39.55-27.84,0-47.28,12.78-47.28,31.09,0,18.76,13.84,29.66,49.36,38.91l54,14.81C4162.05,600.16,4177.28,644.7,4177.28,678.66Zm-1368-215.8A179,179,0,0,0,2700,426.34c-102.76,0-186.05,83.3-186.05,186.05S2597.26,798.44,2700,798.44a179,179,0,0,0,109.22-36.52v30.44h92.52V432.42h-92.52Zm0,149.54a101.07,101.07,0,1,1-101.07-101.08A101.08,101.08,0,0,1,2809.24,612.4ZM3236,462.86a179,179,0,0,0-109.22-36.52c-102.75,0-186.05,83.3-186.05,186.05s83.3,186.05,186.05,186.05A179,179,0,0,0,3236,761.92v30.44h92.53V304.3H3236Zm-101.06,250.6A101.07,101.07,0,1,1,3236,612.39,101.07,101.07,0,0,1,3134.89,713.46Zm623.34-281h92.53V792.36h-92.53Zm102.33-85.59a56.06,56.06,0,1,1-112.12,0c0-31.72,24.34-56.8,56.06-56.8S3860.56,315.11,3860.56,346.83Zm530.71,79.51c-102.75,0-186.05,83.3-186.05,186.05s83.3,186.05,186.05,186.05,186-83.3,186-186.05S4494,426.34,4391.27,426.34Zm0,287.12a101.07,101.07,0,1,1,101.07-101.07A101.06,101.06,0,0,1,4391.27,713.46ZM1744.55,386.87H1613.14V792.36h-92.22V386.87H1389.51V304.3h355Zm1877.76,45.55h97.21L3595.31,792.36H3484L3360.47,432.42h97.2L3540,693.79Zm1162.19,0h43.37v85.84h-50.75c-39.09,0-64.18,19.18-64.18,58.28V792.36h-92.77V432.42h92.77V492.9C4721.06,450.12,4750.57,432.42,4784.5,432.42Z",transform:"translate(-195.89 -195.89)",fill:"currentColor"})}));Que.displayName="TripadvisorLogo";const Xue=A.memo(()=>l.jsxs("svg",{className:"h-auto w-full",viewBox:"0 0 1000 385",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M806.495 227.151L822.764 223.392C823.106 223.313 823.671 223.183 824.361 222.96C828.85 221.753 832.697 218.849 835.091 214.862C837.485 210.874 838.241 206.113 837.198 201.582C837.175 201.482 837.153 201.388 837.13 201.289C836.596 199.117 835.66 197.065 834.37 195.239C832.547 192.926 830.291 190.991 827.728 189.542C824.711 187.82 821.553 186.358 818.289 185.171L800.452 178.659C790.441 174.937 780.432 171.309 770.328 167.771C763.776 165.439 758.224 163.393 753.4 161.901C752.49 161.62 751.485 161.34 750.669 161.058C744.837 159.271 740.739 158.53 737.272 158.505C734.956 158.42 732.649 158.841 730.511 159.738C728.283 160.699 726.282 162.119 724.639 163.906C723.822 164.835 723.054 165.806 722.337 166.815C721.665 167.843 721.049 168.907 720.491 170.001C719.876 171.174 719.348 172.391 718.911 173.642C715.6 183.428 713.951 193.7 714.032 204.029C714.091 213.368 714.342 225.354 719.475 233.479C720.712 235.564 722.372 237.366 724.348 238.769C728.004 241.294 731.7 241.627 735.544 241.904C741.289 242.316 746.855 240.905 752.403 239.623L806.45 227.135L806.495 227.151Z",fill:"currentColor"}),l.jsx("path",{d:"M987.995 140.779C983.553 131.457 977.581 122.947 970.328 115.601C969.39 114.669 968.385 113.806 967.321 113.02C966.339 112.283 965.318 111.598 964.264 110.967C963.18 110.373 962.065 109.837 960.924 109.362C958.668 108.476 956.25 108.077 953.829 108.19C951.513 108.322 949.254 108.956 947.207 110.049C944.105 111.591 940.748 114.07 936.283 118.221C935.666 118.834 934.891 119.525 934.195 120.177C930.511 123.641 926.413 127.911 921.536 132.883C914.002 140.497 906.583 148.152 899.21 155.89L886.017 169.571C883.601 172.071 881.401 174.771 879.441 177.643C877.771 180.07 876.59 182.799 875.963 185.678C875.6 187.886 875.653 190.142 876.12 192.329C876.143 192.429 876.164 192.523 876.187 192.622C877.229 197.154 879.988 201.103 883.883 203.637C887.778 206.172 892.505 207.094 897.068 206.211C897.791 206.106 898.352 205.982 898.693 205.898L969.033 189.646C974.576 188.365 980.202 187.191 985.182 184.3C988.522 182.363 991.699 180.443 993.878 176.569C995.043 174.441 995.748 172.092 995.948 169.675C997.027 160.089 992.021 149.202 987.995 140.779Z",fill:"currentColor"}),l.jsx("path",{d:"M862.1 170.358C867.197 163.955 867.184 154.41 867.64 146.607C869.174 120.536 870.79 94.4619 872.07 68.3766C872.56 58.4962 873.624 48.7498 873.036 38.7944C872.552 30.5816 872.492 21.1521 867.307 14.4122C858.154 2.52688 838.636 3.50371 825.319 5.34732C821.239 5.91358 817.153 6.6749 813.099 7.64807C809.045 8.62124 805.033 9.6841 801.108 10.9412C788.329 15.127 770.365 22.8103 767.323 37.5341C765.608 45.858 769.672 54.3727 772.824 61.9691C776.645 71.1774 781.865 79.4721 786.622 88.1401C799.198 111.024 812.008 133.765 824.782 156.53C828.597 163.326 832.755 171.933 840.135 175.454C840.623 175.667 841.121 175.856 841.628 176.018C844.937 177.272 848.545 177.513 851.993 176.712C852.201 176.664 852.405 176.617 852.608 176.57C855.792 175.704 858.675 173.973 860.937 171.568C861.345 171.185 861.734 170.782 862.1 170.358Z",fill:"currentColor"}),l.jsx("path",{d:"M855.997 240.155C854.008 237.355 851.184 235.258 847.931 234.162C844.677 233.065 841.16 233.027 837.881 234.051C837.111 234.307 836.361 234.618 835.636 234.983C834.515 235.554 833.445 236.221 832.439 236.976C829.507 239.148 827.039 241.97 824.791 244.8C824.221 245.522 823.7 246.483 823.022 247.1L811.708 262.663C805.295 271.382 798.971 280.123 792.7 289.003C788.608 294.735 785.068 299.576 782.273 303.859C781.743 304.666 781.193 305.567 780.689 306.284C777.338 311.469 775.441 315.252 774.467 318.622C773.735 320.862 773.503 323.234 773.788 325.572C774.1 328.008 774.92 330.35 776.195 332.447C776.873 333.499 777.604 334.516 778.385 335.495C779.196 336.436 780.058 337.332 780.966 338.18C781.936 339.105 782.973 339.957 784.07 340.729C791.879 346.162 800.428 350.066 809.421 353.083C816.904 355.567 824.682 357.053 832.555 357.504C833.894 357.572 835.237 357.543 836.572 357.417C837.809 357.309 839.04 357.136 840.26 356.9C841.479 356.615 842.681 356.266 843.863 355.853C846.162 354.993 848.255 353.66 850.008 351.94C851.667 350.279 852.944 348.276 853.749 346.07C855.057 342.81 855.917 338.671 856.483 332.526C856.532 331.652 856.657 330.604 856.744 329.644C857.19 324.545 857.395 318.556 857.723 311.514C858.276 300.685 858.71 289.903 859.053 279.09C859.053 279.09 859.782 259.875 859.78 259.865C859.946 255.437 859.81 250.53 858.582 246.121C858.042 244.008 857.17 241.994 855.997 240.155V240.155Z",fill:"currentColor"}),l.jsx("path",{d:"M983.707 270.24C981.346 267.651 978 265.069 972.722 261.878C971.961 261.453 971.068 260.886 970.244 260.392C965.85 257.749 960.557 254.969 954.374 251.611C944.876 246.396 935.372 241.312 925.778 236.271L908.825 227.28C907.946 227.024 907.053 226.389 906.225 225.989C902.968 224.432 899.516 222.978 895.932 222.311C894.697 222.074 893.444 221.944 892.186 221.923C891.375 221.913 890.565 221.962 889.761 222.07C886.371 222.595 883.234 224.178 880.795 226.591C878.356 229.005 876.74 232.128 876.178 235.513C875.919 237.667 875.998 239.847 876.411 241.976C877.24 246.487 879.254 250.95 881.338 254.858L890.391 271.824C895.428 281.394 900.526 290.907 905.752 300.391C909.123 306.578 911.929 311.871 914.557 316.26C915.055 317.085 915.62 317.974 916.046 318.738C919.245 324.013 921.815 327.333 924.421 329.715C926.109 331.345 928.132 332.586 930.349 333.351C932.68 334.124 935.146 334.398 937.59 334.155C938.832 334.008 940.066 333.795 941.286 333.516C942.488 333.193 943.672 332.808 944.833 332.362C946.087 331.889 947.305 331.327 948.478 330.678C955.36 326.82 961.703 322.07 967.345 316.552C974.112 309.894 980.093 302.633 984.745 294.321C985.392 293.145 985.952 291.924 986.422 290.667C986.86 289.504 987.24 288.319 987.558 287.118C987.834 285.896 988.045 284.662 988.191 283.418C988.422 280.977 988.138 278.514 987.358 276.19C986.591 273.963 985.345 271.932 983.707 270.24V270.24Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M400.03 105.19C400.03 91.2089 411.42 79.7877 425.167 79.7877C438.717 79.7877 449.714 91.2089 450.303 105.387V303.682C450.303 317.663 438.913 329.084 425.167 329.084C411.027 329.084 400.03 317.663 400.03 303.682V105.19ZM376.657 227.672C376.461 231.61 375.479 238.896 370.373 244.213C364.874 249.923 357.412 251.302 353.092 251.302C335.123 251.4 317.155 251.45 299.187 251.499C281.218 251.548 263.248 251.597 245.279 251.696C246.85 256.619 249.992 264.101 257.062 270.994C261.382 275.129 265.506 277.492 267.273 278.476C269.434 279.855 276.896 283.793 286.126 283.793C295.945 283.793 304.586 280.642 313.03 276.31L313.736 275.945C319.604 272.904 325.66 269.766 332.079 268.631C338.363 267.646 345.04 268.827 349.949 273.16C355.841 278.279 358.197 285.762 356.037 293.442C353.484 302.106 346.218 309.589 338.559 314.118C334.239 316.678 329.526 318.844 324.813 320.617C318.725 322.783 312.441 324.358 306.157 325.343C299.872 326.327 293.392 326.721 286.911 326.524H286.911C283.769 326.524 280.431 326.524 277.092 326.13C273.558 325.736 270.023 324.949 266.684 324.161C261.186 322.98 256.08 321.207 250.974 318.844C246.064 316.678 241.155 313.921 236.638 310.771C232.121 307.62 227.997 303.879 224.07 299.94C220.338 296.002 216.804 291.67 213.662 286.944C203.057 270.797 198.147 250.908 199.129 231.61C199.915 212.706 206.199 193.802 217.589 178.443C218.823 176.519 220.247 174.883 221.596 173.333C222.18 172.663 222.75 172.008 223.284 171.354C237.35 154.158 256.142 148.716 263.894 146.471L264.328 146.345C286.519 140.044 304.978 144.179 312.441 146.345C316.172 147.33 337.185 153.828 353.484 171.354C354.27 172.141 356.43 174.701 359.179 178.443C369.505 192.508 373.066 205.605 374.272 210.042L374.301 210.146C375.479 214.478 376.657 220.386 376.657 227.672ZM261.382 195.181C249.992 204.436 246.85 216.251 246.064 219.992H331.686C330.901 216.448 327.562 204.436 316.172 195.181C304.586 185.925 292.41 185.335 288.679 185.335C284.948 185.335 272.772 185.925 261.382 195.181ZM586.98 142.998C564.593 142.998 544.169 153.041 529.637 169.385V168.794C529.048 155.6 518.05 144.967 504.696 144.967C490.753 144.967 479.56 156.191 479.56 170.172V359.409C479.56 373.391 490.753 384.615 504.696 384.615C518.64 384.615 529.833 373.391 529.833 359.409V352.123V300.334C544.365 316.482 564.593 326.721 587.176 326.721C632.147 326.721 668.674 285.959 668.674 235.155C668.478 184.35 631.951 142.998 586.98 142.998ZM575.983 285.566C550.453 285.566 529.637 263.314 529.637 235.549C529.637 207.586 550.257 185.335 575.983 185.335C601.512 185.335 622.328 207.586 622.328 235.549C622.132 263.314 601.512 285.566 575.983 285.566ZM161.425 248.348L153.177 266.464C149.446 274.341 145.715 282.415 142.18 290.488C141.052 292.966 139.916 295.494 138.764 298.057C123.068 332.981 104.44 374.43 63.8242 383.236C44.1861 387.568 14.5327 381.661 3.5354 363.15C-7.4619 344.443 8.83767 322.979 29.8504 327.902C33.1646 328.641 36.4235 330.266 39.7101 331.904C45.187 334.635 50.7406 337.404 56.7545 336.173C62.4495 335.188 65.9844 331.053 70.5011 325.736C76.7853 318.45 79.5346 310.771 80.7129 306.242C80.6147 306.045 80.5165 305.798 80.4183 305.552C80.3201 305.306 80.2219 305.06 80.1237 304.863C75.0117 295.326 70.5473 286.8 66.8178 279.677C64.3868 275.034 62.2681 270.987 60.4857 267.646C56.8287 260.714 54.0662 255.473 51.918 251.398C45.6449 239.497 44.609 237.532 41.8296 232.398C35.7418 220.78 29.2612 209.555 22.5843 198.331C15.3182 186.122 7.85577 172.535 13.9436 158.16C18.8531 146.542 31.4214 140.634 43.4006 144.376C56.0403 148.212 61.6377 160.239 66.8724 171.487C67.8188 173.52 68.7534 175.528 69.7156 177.458C78.16 194.196 86.4079 210.934 94.6559 227.672C95.382 229.336 96.4917 231.605 97.8402 234.362C99.0447 236.824 100.44 239.676 101.922 242.834C102.697 244.475 103.434 246.002 104.101 247.382C104.954 249.149 105.691 250.676 106.242 251.892C110.072 242.342 113.95 232.841 117.829 223.34C121.707 213.839 125.586 204.337 129.415 194.787C129.522 194.253 130.436 192.216 131.813 189.145C132.977 186.549 134.473 183.215 136.092 179.427C136.64 178.133 137.191 176.79 137.755 175.417C142.856 162.995 148.988 148.06 162.604 143.982C172.423 141.028 183.42 144.967 189.115 153.237C192.061 157.372 193.239 162.098 193.435 166.824C193.593 177.275 188.545 188.491 184.212 198.115C183.157 200.459 182.144 202.708 181.26 204.829C181.219 204.91 181.048 205.296 180.739 205.988C179.541 208.679 176.278 216.005 170.655 228.066C168.626 232.389 166.679 236.713 164.707 241.09C163.626 243.491 162.538 245.907 161.425 248.348Z",fill:"currentColor"}),l.jsx("path",{d:"M687.728 310.153H689.549C690.447 310.153 691.167 309.923 691.706 309.462C692.256 308.99 692.532 308.395 692.532 307.676C692.532 306.833 692.29 306.232 691.807 305.872C691.324 305.502 690.56 305.316 689.515 305.316H687.728V310.153ZM695.043 307.608C695.043 308.507 694.801 309.305 694.318 310.002C693.846 310.687 693.178 311.198 692.313 311.535L696.324 318.193H693.492L690.004 312.226H687.728V318.193H685.234V303.176H689.633C691.498 303.176 692.863 303.541 693.728 304.271C694.605 305.002 695.043 306.114 695.043 307.608ZM677.228 310.676C677.228 308.429 677.79 306.322 678.914 304.356C680.037 302.389 681.582 300.839 683.549 299.704C685.515 298.569 687.633 298.002 689.902 298.002C692.15 298.002 694.256 298.564 696.223 299.687C698.189 300.811 699.74 302.356 700.874 304.322C702.009 306.288 702.577 308.406 702.577 310.676C702.577 312.889 702.032 314.968 700.942 316.912C699.852 318.856 698.324 320.412 696.358 321.58C694.391 322.749 692.24 323.333 689.902 323.333C687.577 323.333 685.431 322.754 683.464 321.597C681.498 320.429 679.964 318.872 678.863 316.929C677.773 314.985 677.228 312.901 677.228 310.676ZM678.998 310.676C678.998 312.62 679.487 314.44 680.464 316.136C681.442 317.822 682.773 319.153 684.459 320.131C686.155 321.097 687.97 321.58 689.902 321.58C691.858 321.58 693.672 321.092 695.346 320.114C697.02 319.136 698.346 317.816 699.324 316.153C700.313 314.479 700.807 312.653 700.807 310.676C700.807 308.721 700.318 306.906 699.341 305.232C698.363 303.558 697.037 302.232 695.363 301.255C693.7 300.266 691.88 299.771 689.902 299.771C687.947 299.771 686.133 300.26 684.459 301.238C682.785 302.215 681.453 303.541 680.464 305.215C679.487 306.878 678.998 308.698 678.998 310.676Z",fill:"currentColor"})]}));Xue.displayName="YelpLogo";const G1t=({className:e})=>l.jsx(V,{className:z("w-10",e),children:l.jsx(Xue,{})}),$1t=({className:e})=>l.jsx(V,{className:z("w-[70px]",e),children:l.jsx(Que,{})}),Zue=e=>{const t=d.useMemo(()=>Vi(e).with(ed.string.includes("yelp.com"),()=>G1t).with(ed.string.includes("tripadvisor.com"),()=>$1t).otherwise(()=>null),[e]);return d.useMemo(()=>({SearchClientLogo:t}),[t])},Jue=A.memo(({day:e,hours:t})=>l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(V,{variant:"tiny",children:e}),l.jsx(K,{className:"h-one grow",variant:"subtler"}),l.jsx(V,{variant:"tiny",color:"light",children:t})]}));Jue.displayName="BusinessDayToHours";function LS(e,t,n,r=0){return e*24*3600+t*3600+n*60+r}function iU(e,t,n){const r=new Date(Date.UTC(2e3,0,1,e,t,0));return t===0?new Intl.DateTimeFormat(n,{hour:"numeric",timeZone:"UTC"}).format(r):new Intl.DateTimeFormat(n,{hour:"numeric",minute:"numeric",timeZone:"UTC"}).format(r)}function W8(e,t,n){const{locale:r,$t:s}=J(),[o,a]=d.useState([]);return d.useEffect(()=>{if(!e||e.length===0)return a([]),()=>{};const i=()=>{const f=Date.now(),m=VS(f,t),p=(m.weekday+6)%7,h=LS(p,m.hour,m.minute,m.second),g=[];for(const _ of e){const w=_.open.weekday_idx,S=_.open.hour,C=_.open.minute,E=_.close.weekday_idx,T=_.close.hour,k=_.close.minute;let I=LS(w,S,C),M=LS(E,T,k);M<=I&&(M+=168*3600),p===_.close.weekday_idx&&_.open.weekday_idx!==_.close.weekday_idx&&(I-=168*3600,M-=168*3600),g.push({openWeekday:w,openHour:S,openMinute:C,closeWeekday:E,closeHour:T,closeMinute:k,openSeconds:I,closeSeconds:M})}g.sort((_,w)=>_.openWeekday!==w.openWeekday?_.openWeekday-w.openWeekday:_.openSeconds-w.openSeconds);const y=[];for(let _=0;_<7;_++){const S=(_-p+7)%7*24*60*60*1e3,C=new Date(f+S);y.push({day:Intl.DateTimeFormat(r,{weekday:n,timeZone:t}).format(C),isToday:_===p,hours:[],joinedHours:s({defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})}let x=null;for(const _ of g){const w=y[_.openWeekday],S=iU(_.openHour,_.openMinute,r),C=iU(_.closeHour,_.closeMinute,r),E=S===C?s({defaultMessage:"Open 24 hours",id:"mdcm71ltJq"}):`${S} - ${C}`,T=_.openWeekday===p&&h>=_.openSeconds&&h<_.closeSeconds;if(w.hours.push({open:S,close:C,openCloseString:E,isOpenNow:T}),_.openSeconds>h){const k=_.openSeconds-h;(x===null||kh){const k=_.closeSeconds-h;(x===null||k0&&(x===null||b0&&(_.joinedHours=_.hours.map(w=>w.openCloseString).join(", "));return a(_=>Cr(_,y)?_:y),x!==null?x*1e3:null},c=()=>{const f=i();if(f!==null&&f>0){const m=Math.min(f,864e5);return setTimeout(c,m)}else return setTimeout(c,1440*60*1e3)},u=c();return()=>clearTimeout(u)},[e,t,r,n,s]),o}const ede=A.memo(({hours:e,timezone:t})=>{const[n,r]=d.useState(!1),s=d.useCallback(()=>{r(u=>!u)},[]),o=W8(e,t,"long"),a=o.find(u=>u.isToday===!0),i=a?.hours.some(u=>u.isOpenNow)??!1,{$t:c}=J();return l.jsxs(K,{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"gap-x-sm flex items-center",children:[i!=null&&l.jsx(K,{variant:i?"super":"red",className:"px-sm py-xs rounded",children:l.jsx(V,{variant:"tiny",color:"defaultInverted",children:c(i?{defaultMessage:"Open now",id:"AbmghRJVfD"}:{defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})}),a!==void 0&&l.jsxs(V,{variant:"tiny",className:"block",children:[a.joinedHours," today"]})]}),l.jsx(st,{size:"tiny",text:c({defaultMessage:"More",id:"I5NMJ8llIi"}),onClick:s,chevron:!0,chevronIcon:n?B("chevron-up"):B("chevron-down")})]}),n&&l.jsx("div",{className:"my-sm gap-xs flex flex-col",children:o.map((u,f)=>l.jsx(Jue,{day:u.day,hours:u.joinedHours},f))})]})});ede.displayName="BusinessHours";const tde=A.memo(({className:e,title:t,url:n,subtitle:r,imageUrl:s,withImagePlaceholder:o,clickable:a,withinContent:i,bgHover:c,variant:u,...f})=>l.jsxs(K,{variant:i?"subtler":u,bgHover:a?i?"subtle":"subtler":c,className:z("gap-x-md p-sm flex rounded-lg",{"cursor-pointer":a},e),...f,children:[s&&l.jsx("div",{className:"size-20 flex-none overflow-hidden",children:l.jsx(Wo,{alt:"title",hasShadow:!1,includeLightBoxModal:!1,containerClassName:"size-20",imageClassName:"object-cover w-full h-full",maskClassName:"size-20 flex items-center justify-center",rounded:"md",src:s})}),!s&&o&&l.jsx("div",{className:"size-20 flex-none overflow-hidden",children:l.jsx("div",{className:"bg-subtler flex size-20 items-center justify-center rounded-md"})}),l.jsxs("div",{className:"-mt-xs flex grow flex-col justify-center",children:[l.jsxs("div",{className:"gap-x-sm flex justify-between",children:[l.jsx(V,{className:"line-clamp-1 whitespace-normal break-words capitalize leading-8",variant:"smallBold",children:t}),n&&l.jsx(V,{variant:"small",color:"light",className:"mr-xs",children:l.jsx(ge,{icon:B("external-link"),size:"md"})})]}),r]})]}));tde.displayName="ContentLinkCard";const q1t=4,Hh=A.memo(({priceSymbols:e,priceRange:t,className:n="",dollarColor:r="default",textVariant:s="tiny",currencySymbol:o,...a})=>{const i=t&&/^(.+?)\s*(\1\s*)+$/.test(t.trim());let c=0;return i?c=t.replace(/\u200A/g,"").length:e&&(c=e.replace(/\u200A/g,"").length),l.jsx("div",{className:`flex items-center ${n}`,...a,children:t&&!i?l.jsx(V,{variant:s,color:r,children:t}):l.jsx("div",{className:"flex gap-px",children:Array.from({length:q1t},(u,f)=>l.jsx(V,{variant:s,className:"inline-flex",color:fl.jsxs("div",{className:"flex items-center","data-test-id":t,children:[Array.from({length:K1t},(n,r)=>{const s=e>r&&r>=Math.floor(e);return l.jsxs("div",{className:"relative",children:[l.jsx(V,{variant:"tiny",color:r{const a=o&&!!e.price,i=d.useMemo(()=>l.jsxs("div",{children:[l.jsxs("div",{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(nde,{starCount:e.rating}),e.num_reviews&&l.jsxs(V,{color:"light",variant:"tiny",className:"line-clamp-1",children:[" · ",Gbe(e.num_reviews)," reviews"]})]}),l.jsxs("div",{className:"mt-sm gap-sm flex items-center",children:[o&&l.jsx(o,{className:"-mt-two"}),a&&l.jsx(V,{color:"light",variant:"tiny",children:" · "}),(e.price||e.price_range)&&l.jsx("div",{className:"gap-sm line-clamp-1 flex items-center",children:l.jsx(Hh,{priceSymbols:e.price,priceRange:e.price_range})})]})]}),[o,e.num_reviews,e.price,e.price_range,e.rating,a]);return l.jsx(K,{onClick:n,children:l.jsx(tde,{title:e.name,clickable:n!==void 0,onMouseEnter:r,onMouseLeave:s,imageUrl:e.image_url??void 0,withImagePlaceholder:t,subtitle:i})})});rde.displayName="MapContentCard";const G8=A.memo(({showPulse:e=!1,style:t="default"})=>l.jsxs("div",{className:"relative size-[12px]",children:[l.jsx("div",{className:z("bg-super relative z-[1] size-[12px] rounded-full shadow-[0_1px_6px_rgba(0,0,0,0.25)] transition-all duration-150 dark:shadow-[0_1px_4px_rgba(0,0,0,0.5)]",{"bg-white shadow-[0_1px_6px_rgba(0,0,0,0.35),0_0_0_1px_rgba(0,0,0,0.05)]":t==="recede"})}),e&&l.jsx(Te.div,{className:"bg-super pointer-events-none absolute left-0 top-0 size-[12px] rounded-full",initial:{scale:1,opacity:.75},animate:{scale:[1,2.5],opacity:[.75,0]},transition:{duration:1.5,ease:[0,0,.2,1],repeat:1/0,repeatType:"loop",repeatDelay:.01}})]}));G8.displayName="PulsingDot";const sde=A.memo(({isContentCardOpen:e,location:t,selectedLocation:n,onClick:r,onClose:s,isHighlighted:o=!1,isSelected:a=!1,setHighlightedLocation:i,deemphasize:c=!1,setOffset:u,showRating:f=!1})=>{const{SearchClientLogo:m}=Zue(t.url),p=t.description,h=t.attributes?.ambience,g=h&&Object.keys(h).find(N=>h[N]===!0),{isMobileStyle:y}=Re(),x=6,v=t.categories?.slice(0,x),b=t.categories?.slice(x),[_,w]=d.useState(!1),S=t.address?.join(", "),C=360,[E,T]=d.useState(null);d.useEffect(()=>{E&&a&&u(E)},[a,E,u]);const k=d.useCallback(()=>w(!0),[w]),I=d.useMemo(()=>l.jsxs("div",{children:[l.jsx(yt,{href:t.url,target:"_blank",children:l.jsx(rde,{location:t,SearchClientLogo:m})}),(S||t.phone||t.entity_url)&&l.jsxs(K,{className:"mx-sm py-sm mt-xs gap-sm flex flex-col border-t",children:[S&&l.jsx(Oy,{icon:B("map-pin"),label:S,href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(S)}`,showCopyButton:!0}),t.phone&&l.jsx(Oy,{icon:B("device-mobile"),label:t.phone,href:`tel:${t.phone}`,showCopyButton:!0}),t.entity_url&&l.jsx(Oy,{icon:B("world"),label:iz(az(t.entity_url)),href:t.entity_url})]}),p&&l.jsx(K,{className:"mx-sm gap-sm py-sm flex flex-wrap border-t",children:l.jsx(V,{variant:"small",className:"line-clamp-3",children:p})}),!!t.standardized_hours?.length&&l.jsx(K,{className:"mx-sm py-sm scrollbar-subtle max-h-[120px] overflow-auto border-t",children:l.jsx(ede,{hours:t.standardized_hours,timezone:t.timezone})}),(g||t.categories)&&l.jsxs(K,{className:"mx-sm gap-xs py-sm flex flex-wrap border-t",children:[g&&l.jsx(up,{text:g}),v?.map((N,D)=>l.jsx(up,{text:N},D)),!_&&b.length>0&&l.jsx(up,{text:`+${b.length}`,onClick:k}),_&&b?.map((N,D)=>l.jsx(up,{text:N},D))]})]}),[S,p,v,t,k,b,_,g,m]),M=d.useMemo(()=>({zIndex:a||o?10:0}),[o,a]);return l.jsxs(l.Fragment,{children:[E?null:l.jsx("div",{ref:N=>{N&&T(N.offsetHeight)},className:"pointer-events-none invisible absolute left-[10vw] top-[10vh]",style:{width:C},children:I}),l.jsx(L1t,{longitude:t.lng,latitude:t.lat,anchor:"bottom",onClick:r,style:M,children:l.jsx(kb,{isMobileStyle:y,canOutsideClickClose:!0,isOpen:e,placement:"bottom",removeScroll:!1,onClose:s,contentWidth:C,content:I,children:l.jsxs(V,{variant:"tiny",className:z("group pointer-events-none relative flex cursor-pointer flex-col items-center",{"z-[10]":o||e}),children:[l.jsx(Te.div,{animate:{opacity:a||o?1:0},transition:Ar,className:z("bg-super px-sm py-xs text-light pointer-events-none absolute left-1/2 top-[-20px] -translate-x-1/2 whitespace-nowrap rounded-full shadow-sm group-hover:shadow-md dark:text-black",{}),children:t.name}),l.jsx("div",{onMouseEnter:()=>{i&&!a&&!n&&i(t)},onMouseLeave:()=>{i&&!a&&i(null)},className:"pointer-events-auto block",children:f&&t.rating?l.jsx(ode,{rating:t.rating,isSelected:a,isHighlighted:o,deemphasize:c}):l.jsx("div",{className:"p-sm rounded-full",children:l.jsx(G8,{style:c?"recede":"default",showPulse:a||o})})})]})})})]})});sde.displayName="PerplexityMarker";const up=A.memo(({text:e,onClick:t})=>l.jsx(K,{className:z("py-xs px-sm rounded border",{"cursor-pointer":t}),onClick:t,as:t?"button":"div",bgHover:t?"subtle":void 0,children:l.jsx(V,{variant:"tiny",color:"light",children:e})}));up.displayName="MarkerPill";const ode=A.memo(({rating:e,isSelected:t,isHighlighted:n,deemphasize:r})=>l.jsx(Te.div,{animate:{scale:t||n?1.1:1,opacity:r?.6:1},transition:{type:"spring",bounce:.2,duration:.28},className:"relative",children:l.jsxs("div",{className:z("bg-super mt-sm px-sm py-xs font-display text-light relative rounded-xl text-xs font-medium shadow-sm group-hover:shadow-md dark:text-black",{"shadow-md":t||n}),children:[e.toFixed(1),l.jsx("div",{className:"border-t-super absolute left-1/2 top-full -translate-x-1/2 -translate-y-px border-x-4 border-t-[5px] border-x-transparent"})]})}));ode.displayName="RatingMarker";const Oy=A.memo(({icon:e,label:t,href:n,showCopyButton:r=!1})=>{const{$t:s}=J(),{session:o}=Ne(),{trackEvent:a}=Xe(o),i=d.useCallback(f=>{f.stopPropagation(),a("place link clicked",{link:n})},[a,n]),c=d.useCallback(()=>{navigator.clipboard.writeText(t),a("place link copied",{link:n})},[t,a,n]),u=s({defaultMessage:"Copy",id:"4l6vz1/eZ5"});return l.jsxs("div",{className:"gap-sm group/all flex items-start",children:[l.jsx(yt,{href:n,target:"_blank",className:"group flex-1 cursor-pointer",onClick:i,children:l.jsxs(V,{variant:"small",color:"default",className:"gap-sm group-hover:text-super flex items-start text-balance transition-colors duration-200",children:[l.jsx(ge,{icon:e,size:"sm",className:"top-two relative shrink-0"}),t]})}),r&&l.jsx(V,{variant:"small",color:"default",className:"-mr-xs flex h-[1lh] items-center",children:l.jsx(st,{icon:B("copy"),onClick:c,size:"small",toolTip:u,clickFeedback:!0,pill:!0})})]})});Oy.displayName="PlaceLink";function ade(e){return{lat:e.lat??0,lng:e.lng??0,name:e.name??"",description:e.description??"",image_url:e.image_url??"",price:e.price??"",rating:e.rating??0,num_reviews:e.num_reviews??0,url:e.url??"",attributes:e.attributes,categories:e.categories,operating_hours:e.operating_hours??[],is_open:e.is_open??!1,map_boundary_buffer:0,price_range:e.price_range??"",canonical_page_path:e.canonical_page_path??"",address:e.address??[],phone:e.phone??"",entity_url:e.entity_url??"",timezone:e.timezone??"",standardized_hours:e.standardized_hours??[]}}const Y1t=({reason:e})=>{const t=el(),n=d.useCallback(async({entryUUID:r,lat_lng:s})=>{const{data:o,error:a,response:i}=await de.POST("/rest/entry/map/search-map-locations",e,{body:{lat:s.latitude,lng:s.longitude,read_write_token:t,entry_uuid:r},timeoutMs:Cn.HIGH});if(a)throw new he("API_CLIENTS_ERROR",{cause:a,status:i.status??0});return o?o.places.map(ade):[]},[t,e]);return d.useMemo(()=>({searchForAdditionalLocations:n}),[n])},Q1t="pk.eyJ1Ijoiam9obm55cHBseCIsImEiOiJjbHBraWpwcnUwMHNzMmtwbWZyOTIyZnpxIn0.0I0RSAHhYftVDM6cLnj1wg",X1t="mapbox://styles/johnnypplx/clps6e1xy015c01qt2u79a96f",Z1t="mapbox://styles/johnnypplx/clpmzsapf00zy01po5t7ge9zd",lU=16,cU=17,q1=6,ide=A.memo(({entryUUID:e,contextUUID:t,selectedLocation:n,setSelectedLocation:r,selectedLocationFocused:s=!0,setSelectedLocationFocused:o,highlightedLocation:a,setHighlightedLocation:i,setRenderedLocations:c,searchByLocationOverride:u,locations:f,navControlPosition:m="bottom-right",showNavControl:p=!0,showRating:h=!1,answerMode:g})=>{const y="perplexity-map",x=d.useRef(null),[v,b]=d.useState(!1),[_,w]=d.useState(!1),[S,C]=d.useState(!1),[E,T]=d.useState(null),{colorScheme:k}=Ss(),{searchForAdditionalLocations:I}=Y1t({reason:y}),M=f[0]?.map_boundary_buffer??0,N=f.map(se=>se.lat),D=f.map(se=>se.lng),j=Math.min(...N)-M,F=Math.max(...N)+M,R=Math.min(...D)-M,P=Math.max(...D)+M,L=()=>{r(null),b(!1)},U=d.useCallback(()=>{x.current&&x.current.fitBounds([[R,j],[P,F]],{duration:500,padding:50,maxZoom:cU})},[R,j,P,F]);d.useEffect(()=>{n!=null&&E!=null&&s&&(x.current.getCenter().lng.toFixed(q1)==n.lng.toFixed(q1)&&x.current.getCenter().lat.toFixed(q1)==n.lat.toFixed(q1)&&x.current.getZoom()==lU?b(!0):(x.current.flyTo({center:[n.lng,n.lat],padding:{bottom:E},zoom:lU,duration:500}),w(!0)))},[n,s,E]),d.useEffect(()=>{if(!x.current||!a)return;const se=x.current.getBounds();if(!se)return;se.contains([a.lng,a.lat])||U()},[a,j,F,R,P,U]),d.useEffect(()=>{n?o?.(!0):U()},[n,U,o]);const O=d.useMemo(()=>f.map((se,ae)=>l.jsx(lde,{location:se,highlightedLocation:a??null,selectedLocation:n,showContentCard:v,contextUUID:t,entryUUID:e,isFlying:_,setHighlightedLocation:i,setSelectedLocation:r,setShowContentCard:b,setOffset:T,showRating:h,answerMode:g},`marker-${ae}`)),[f,a,n,v,t,e,_,i,r,h,g]);d.useCallback(async()=>{if(x.current){C(!0);try{const se=u?await u({latLng:{latitude:x.current.getCenter().lat,longitude:x.current.getCenter().lng}}):await I({entryUUID:e,lat_lng:{latitude:x.current.getCenter().lat,longitude:x.current.getCenter().lng}});se&&se.length>0&&c(se)}catch(se){Z.error("Error searching for additional locations:",se)}finally{C(!1)}}},[I,e,c,C,u]);const $=d.useMemo(()=>({bounds:[[R,j],[P,F]],fitBoundsOptions:{maxZoom:cU,padding:50}}),[F,P,j,R]),G=d.useCallback(()=>b(!1),[]),H=d.useCallback(()=>o?.(!1),[o]),Q=d.useCallback(()=>{_?(b(!0),w(!1)):r(null)},[_,r]),Y=d.useMemo(()=>({name:"mercator"}),[]),te=d.useCallback(se=>{se?.target?.resize?.()},[]);return l.jsxs(K,{variant:"subtler",className:"relative flex size-full overflow-hidden rounded-xl",children:[!1,l.jsxs(P1t,{ref:x,mapboxAccessToken:Q1t,initialViewState:$,onClick:L,doubleClickZoom:!1,mapStyle:k==="dark"?X1t:Z1t,attributionControl:!1,logoPosition:"top-left",onMoveStart:G,onDragStart:H,onZoomEnd:Q,projection:Y,onRender:te,children:[O,p&&l.jsx(H1t,{position:m,showCompass:!1,showZoom:!0})]})]})});ide.displayName="PerplexityMap";const lde=A.memo(({location:e,highlightedLocation:t,selectedLocation:n,showContentCard:r,contextUUID:s,entryUUID:o,isFlying:a,setHighlightedLocation:i,setSelectedLocation:c,setShowContentCard:u,setOffset:f,showRating:m,answerMode:p})=>{const{session:h}=Ne(),{trackEvent:g}=Xe(h),y=d.useCallback(()=>{!a&&e!=n&&(g("map marker clicked",{entryUUID:o,contextUUID:s,itemID:e.url,answerMode:p}),u(!1),c(e),i&&i(null))},[a,e,n,g,o,s,u,c,i,p]),x=d.useCallback(()=>{c(null),u(!1)},[c,u]);return l.jsx(sde,{isContentCardOpen:r&&n?.url===e.url,location:e,onClick:y,onClose:x,isHighlighted:t?.url===e.url,isSelected:n?.url===e.url,setHighlightedLocation:i,selectedLocation:n,setOffset:f,deemphasize:t!==null&&t?.url!==e.url,showRating:m})});lde.displayName="PerplexityMarkerFactory";const cde=Ft("ImageCarouselContext",{images:[],onImageClick:()=>{},handleNext:()=>{},handlePrevious:()=>{},currentIndex:0,showControls:!1,direction:1,totalVisibleCarousels:0,setTotalVisibleCarousels:()=>{},fillMode:"cover",useCurrentIndex:()=>0}),tM=A.memo(({images:e,showControls:t,onImageClick:n,children:r,fillMode:s="cover"})=>{const[o,a]=d.useState(0),[i,c]=d.useState(1),[u,f]=d.useState(0);d.useEffect(()=>{a(0)},[e.length]);const m=d.useCallback(()=>{a(b=>b+1>=e.length?0:b+1),c(1)},[a,e.length]),p=d.useCallback(()=>{a(b=>b==0?e.length-1:b-1),c(-1)},[a,e.length]),h=d.useCallback(b=>{f(b),y(Date.now())},[]),[g,y]=d.useState(),x=d.useCallback(b=>!b.current||g===void 0?-1:J1t(b.current),[g]),v=d.useMemo(()=>({images:e,onImageClick:n,handleNext:m,handlePrevious:p,currentIndex:o,showControls:t,direction:i,totalVisibleCarousels:u,setTotalVisibleCarousels:h,fillMode:s,useCurrentIndex:x}),[e,o,t,i,u,m,p,h,n,s,x]);return l.jsx(cde.Provider,{value:v,children:l.jsx("div",{"data-paged-carousel":"parent",children:r})})});tM.displayName="ImagePagedCarouselProvider";const J1t=e=>{const t=e.closest('[data-paged-carousel="parent"]');if(!t)return-1;const n=t.querySelectorAll('[data-paged-carousel="child"]');return Array.from(n).filter(s=>{const o=s.getBoundingClientRect();return o.width>0&&o.height>0}).indexOf(e)},Ly=A.memo(({className:e})=>{const{images:t,onImageClick:n,handleNext:r,handlePrevious:s,currentIndex:o,showControls:a,direction:i,totalVisibleCarousels:c,setTotalVisibleCarousels:u,fillMode:f,useCurrentIndex:m}=d.useContext(cde),p=d.useRef(null),h=m(p),[g,{width:y,height:x}]=ti(),v=y>0&&x>0;d.useEffect(()=>{if(v)return u(I=>I+1),()=>u(I=>I-1)},[u,v]);const[b,_]=d.useState(!1),{isMobileUserAgent:w}=Re(),S=d.useMemo(()=>{const I=o+h;return I>=t.length?I%t.length:I},[h,o,t.length]),C=d.useCallback(()=>{n?.(S)},[S,n]),E={hiddenEnter:I=>({x:I===1?"100%":"-100%"}),hiddenExit:I=>({x:I===1?"-100%":"100%"}),visible:{x:0}};d.useEffect(()=>{const I=()=>{const M=(S+1)%t.length,N=S===0?t.length-1:S-1,D=new Image,j=new Image,F=t[M],R=t[N];F&&(D.src=F),R&&(j.src=R)};t.length>1&&I()},[S,t]);const T=t.length>1&&h===0,k=t.length>1&&h+1==c;return t.length?l.jsxs("div",{ref:p,"data-paged-carousel":"child",onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),className:z("group relative size-full",e),children:[l.jsx("div",{ref:g,className:"size-full cursor-pointer overflow-hidden",onClick:C,children:h===-1?null:l.jsx(St,{initial:!1,custom:i,children:l.jsx(Te.img,{custom:i,src:t[S],alt:"",className:z("absolute inset-0 size-full",{"p-sm object-contain":f==="contain","object-cover":f==="cover"}),variants:E,initial:"hiddenEnter",animate:"visible",exit:"hiddenExit",transition:Ar},t[S])})}),T&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:b||a||w?1:0},transition:Ar,children:l.jsx(K,{as:"button",variant:"raised",className:"shadow-overlay active:bg-subtler absolute left-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full",onClick:s,children:l.jsx(ge,{icon:B("chevron-left"),size:"sm"})})}),k&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:b||a||w?1:0},transition:Ar,children:l.jsx(K,{as:"button",variant:"raised",className:"shadow-overlay active:bg-subtler absolute right-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full",onClick:r,children:l.jsx(ge,{icon:B("chevron-right"),size:"sm"})})})]}):null});Ly.displayName="ImagePagedCarousel";const eyt=A.memo(({image:e,title:t,subtitle:n,children:r,footer:s,itemClick:o})=>l.jsxs("div",{className:"gap-md flex w-full flex-row",children:[l.jsx("div",{className:"w-[180px] shrink-0",children:e}),l.jsxs("div",{className:"gap-xs flex flex-col justify-center",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs(K,{as:"button",onClick:o,children:[l.jsx(V,{variant:"baseSemi",className:"text-left hover:underline",children:t}),l.jsx("div",{className:"mt-xs min-h-[24px]",children:n})]}),l.jsx("div",{className:"-mt-sm",children:r})]}),l.jsx("div",{className:"gap-xs -mt-sm flex flex-row justify-between",children:s})]})]}));eyt.displayName="InlineCard";const uU=({children:e})=>l.jsx("div",{className:"gap-md flex w-full flex-row",children:e}),tyt=({children:e})=>l.jsx("div",{className:"w-[180px] shrink-0",children:e}),nyt=({children:e})=>l.jsx("div",{className:"gap-xs flex flex-col justify-center",children:e}),ryt=({children:e,onClick:t})=>l.jsx(Ro,{onClick:t,className:"gap-xs group flex flex-col",children:e}),syt=({children:e})=>l.jsx("div",{className:"group-hover:underline",children:l.jsx(jme,{size:"tiny",weight:"medium",level:3,align:"left",children:e})}),oyt=({children:e})=>l.jsx("div",{className:"gap-xs -mt-sm flex flex-row justify-between",children:e}),qu=Object.assign(uU,{Root:uU,Image:tyt,Title:syt,Content:nyt,Action:ryt,Footer:oyt}),ayt=({actions:e})=>l.jsx(ga,{className:"text-quietest flex flex-row flex-wrap items-center",delimiter:"|",children:e.map((t,n)=>{const r=l.jsx(K,{className:"gap-xs flex items-center",children:l.jsx(st,{variant:t.emphasize?"super":"common",size:"small",onClick:t.onClick,icon:t.icon,trailingComponent:t.trailingComponent,text:t.label,textClassName:t.textClassName,noPadding:!0})});return l.jsx(Bn,{id:t.label,children:r},n)})}),ude=A.memo(({title:e,href:t,linkType:n="external",onClick:r,noFollow:s=!1,variant:o="entry-title-300"})=>{const{$t:a}=J(),i=a({defaultMessage:"Open in Perplexity",id:"EUx7i7X2Vq"}),c=a({defaultMessage:"Open site",id:"X8dxWhlpJl"}),u=a({defaultMessage:"View details",id:"MnpUD7ksb+"}),f=l.jsx(V,{as:r?"button":void 0,onClick:r,variant:o,className:"decoration-subtle animate-underlineFade hover:text-super hover:decoration-super/80 dark:decoration-subtler line-clamp-3 inline-block w-fit cursor-pointer overflow-visible text-left align-baseline underline decoration-1 underline-offset-[5px] transition-all hover:underline-offset-[7px] motion-reduce:transition-none",children:e});return t?l.jsx(Io,{tooltipText:n==="external"?c:i,tooltipLayout:"right",asChild:!0,children:l.jsx(yt,{href:t,target:"_blank",rel:s?void 0:"nofollow",className:"w-fit",onClick:r,children:f})}):r?l.jsx(Io,{tooltipText:u,tooltipLayout:"right",asChild:!0,children:f}):f});ude.displayName="InlineCardTitle";const iyt="pk.eyJ1Ijoiam9obm55cHBseCIsImEiOiJjbG9zeWVsaHUwNGU5Mmpudm95bGpmcTJjIn0.ztIaHlLUvTpLq8EVD7LjDQ",lyt="clpmzsapf00zy01po5t7ge9zd",cyt="clps6e1xy015c01qt2u79a96f";function dU({mode:e="light",width:t,height:n,lat:r,long:s,zoom:o=12,scale:a}){return"https://api.mapbox.com/styles/v1/johnnypplx/"+(e==="light"?lyt:cyt)+`/static/${s},${r},${o}/${t}x${n}${a==2?"@2x":""}?access_token=${iyt}&logo=false`}function uyt(e){const t=dU({...e,scale:1}),n=dU({...e,scale:2});return{src:t,srcSet:`${t} 1x, ${n} 2x`}}const dde=A.memo(({standardizedHours:e,timezone:t})=>{const n=W8(e,t,"short");return n.length===0?null:l.jsx("div",{className:"gap-xs flex flex-col",children:n.map(({day:r,joinedHours:s,isToday:o})=>l.jsxs("div",{className:"gap-md flex items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"white",className:o?void 0:"opacity-50",children:r}),l.jsx(V,{variant:"tiny",color:"white",className:o?void 0:"opacity-50",children:s})]},`place-hours-${r}`))})});dde.displayName="PlaceOperatingHours";const dyt=(e,t,n)=>{let r=Math.min(Math.ceil(n/2),e.length),s=Math.min(Math.floor(n/2),t.length);return r+s({...o,type:"pro"})),...t.slice(0,s).map(o=>({...o,type:"con"}))]},fde=A.memo(({pros:e,cons:t,loading:n})=>{const[r,s]=d.useState(0),[o,a]=d.useState(!1),[i,c]=d.useState(1),[u,f]=d.useState(1),[m,p]=d.useState(0),[h,{width:g,height:y}]=ti(),[x,v]=d.useState(Pe),b=d.useRef(null),{isMobileUserAgent:_}=Re(),w=Math.floor(g??0),S=Math.floor(y??0),C=d.useCallback(M=>!e?.length&&!t?.length||M<=0?Pe:dyt(e,t,M),[e,t]),E=d.useCallback((M,N,D,j)=>{const F=Math.floor(M/D),R=Math.floor(N/j);return{columns:Math.max(1,F),rows:Math.max(1,R)}},[]);d.useEffect(()=>{const{columns:M,rows:N}=E(w,S,180,56);c(M),f(N),r>x.length-1&&x.length-1>=0&&s(x.length-1)},[w,S,r,x.length,E]),d.useEffect(()=>{p(u*i),v(C(u*i))},[u,i,C]),d.useEffect(()=>{if(b.current){const M=b.current.scrollWidth,N=x.length,D=M/N*r;b.current.scrollTo({left:D})}},[o]),d.useEffect(()=>{const M=b.current;if(!M)return;const N=()=>{const D=M.scrollLeft,j=M.scrollWidth/x.length,F=Math.round(D/j);F!==r&&s(F)};return M.addEventListener("scroll",N),()=>M.removeEventListener("scroll",N)},[r,x.length]);const T=d.useCallback(M=>{if(!b.current)return;const D=b.current.scrollWidth/x.length*M;b.current.scrollTo({left:D})},[x.length]),k=d.useCallback(()=>{if(!b.current)return;const M=r+1>=x.length?0:r+1;T(M)},[r,x.length,T]),I=d.useCallback(()=>{if(!b.current)return;const M=r-1<0?x.length-1:r-1;T(M)},[r,x.length,T]);return l.jsx("div",{className:"size-full",style:{transformStyle:"preserve-3d",perspective:"1000px"},onMouseLeave:()=>{_||a(!1)},children:l.jsxs(Te.div,{initial:{rotateY:0},animate:{rotateY:o?180:0},transition:{type:"spring",stiffness:200,damping:30},style:{willChange:"transform",transformStyle:"preserve-3d"},className:"relative size-full",children:[l.jsx("div",{ref:h,className:"gap-sm grid size-full",style:{gridTemplateColumns:`repeat(${i}, 1fr)`,gridTemplateRows:`repeat(${u}, 1fr)`,backfaceVisibility:"hidden"},children:[...Array(m)].map((M,N)=>{const D=x[N];return!D&&!n?null:n?l.jsx(br,{children:l.jsx("div",{className:"bg-subtler size-full rounded-xl"})},N):D?l.jsx(mde,{item:D,index:N,setIsFlipped:a,setDetailIndex:s},N):null})}),l.jsx("div",{className:"absolute inset-0 size-full",style:{backfaceVisibility:"hidden",willChange:"transform",transform:"rotateY(180deg)"},children:l.jsxs(dr,{className:"gap-xs relative flex size-full flex-col text-left",children:[_&&l.jsx("button",{className:"shadow-overlay active:bg-subtler absolute right-[-8px] top-[-8px] z-[1] flex size-[24px] items-center justify-center rounded-full bg-white dark:bg-black",onClick:M=>{M.stopPropagation(),a(!1)},children:l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("x"),size:"sm"})})}),l.jsx("div",{ref:b,className:z("scrollbar-none absolute inset-0 snap-x snap-mandatory overflow-x-hidden",{"!overflow-x-scroll":_}),children:l.jsx("div",{className:"flex h-full flex-row flex-nowrap",style:{width:`${x.length*100}%`},children:x.map((M,N)=>l.jsx(pde,{item:M,next:k,prev:I},N))})}),l.jsx("div",{className:"gap-xs bottom-sm absolute left-1/2 flex -translate-x-1/2 flex-row",children:Array.from({length:x.length},(M,N)=>l.jsx("div",{onClick:()=>{T(N)},className:z("size-[6px] cursor-pointer rounded-full bg-black dark:bg-white",{"opacity-50":N===r,"opacity-[10%]":N!==r})},N))})]})})]})})});fde.displayName="ProsConsGrid";const mde=A.memo(({item:e,index:t,setIsFlipped:n,setDetailIndex:r})=>{const s=d.useCallback(()=>{n(!0),r(t)},[t,r,n]);return l.jsx(dr,{as:"button",onClick:s,className:"px-md active:bg-subtler dark:active:bg-subtle cursor-pointer",children:l.jsxs("div",{className:"gap-sm flex flex-row items-center",children:[l.jsx(V,{variant:"smallBold",className:"leading-tight",color:e.type==="pro"?"super":"light",children:l.jsx(ge,{icon:e.type==="pro"?B("check"):B("x"),size:"sm"})}),l.jsx(V,{variant:"smallBold",className:"line-clamp-2 text-left leading-tight",color:e.type==="pro"?"super":"light",children:e.label})]})})});mde.displayName="CanonicalCardFactory";const pde=A.memo(({item:e,next:t,prev:n})=>{const{isMobileUserAgent:r}=Re();return l.jsx("div",{onClick:s=>{if(r)return;const o=s.currentTarget.getBoundingClientRect();s.clientX-o.left>o.width/2?t():n()},className:"scrollbar-none size-full cursor-pointer select-none snap-center overflow-y-scroll",style:{mask:"linear-gradient(to bottom, black calc(100% - 40px), transparent calc(100% - 12px))",WebkitMask:"linear-gradient(to bottom, black calc(100% - 40px), transparent calc(100% - 12px))"},children:l.jsxs("div",{className:"p-md gap-xs flex flex-col pb-[32px] text-left",children:[l.jsxs(V,{variant:"smallBold",className:"gap-xs flex flex-row leading-tight",color:e.type==="pro"?"super":"default",children:[l.jsx(ge,{icon:e.type==="pro"?B("check"):B("x"),size:"sm",className:"translate-y-half shrink-0"}),e.label]}),l.jsx(V,{variant:"small",color:"light",children:e.description})]})})});pde.displayName="ProConDetailCard";function fU(e){return new Date(`${e}T00:00:00`)}function fyt(e,t){const n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r)),r.setDate(r.getDate()+1);return n.length}const myt=({amount:e,currency:t,targetCurrency:n,exchangeRates:r,options:s})=>{const o=mU(e,t,s),a=e/1e6,i=r?.find(({source_currency:u,target_currency:f})=>u===t&&f===n);if(!i||n===t)return{original:o,originalAmount:a};const c=mU(e*i.conversion_factor,n,s);return{original:o,originalAmount:a,adjusted:c,adjustedAmount:e*i.conversion_factor/1e6}},mU=(e,t,n)=>uk(e!==null?e/1e6:e,t,n);function p_t(e){const t=new Date;return t.setDate(t.getDate()+e),t}function hde(){const{locale:e}=J(),t=new Intl.Locale(e),{value:n,loading:r}=Rx({flag:"canonical-hotel-pages-enabled",defaultValue:!1,extraAttributes:{cfLanguage:t.language,appApiVersion:ql}});return d.useMemo(()=>({initialized:!r,value:n}),[n,r])}const pyt=({entity_id:e,entity_name:t,data_source:n,entry_uuid:r,url:s,reason:o})=>{const a=Yt(),i=be.makeQueryKey("place_result_reviews",`${n}_${s}`),{refetch:c,data:u,isFetching:f,error:m}=mt({queryKey:i,enabled:!1,queryFn:async()=>{let p={summary:"",review_quality_score:0,pros:[],cons:[],key_features:[],review_search_results:[]},h="PENDING",g="";try{await de.SSE("/rest/sse/places_review_summary_bulk",o,{params:{places:[{entity_id:e,entity_name:t,data_source:n,entry_uuid:r,url:s}]},handlers:{message:y=>{y.blocks?.[0]?.review_summary_block&&(p={...p,...y.blocks[0].review_summary_block}),h=y.status??"FAILED",g=y.id??"",a.setQueryData(i,{review_summary:p,status:h,id:g})}}})}catch{}return{review_summary:p,status:h,id:g}}});return d.useMemo(()=>({generateReviewSummaryForPlace:c,reviewSummary:u?.review_summary,isFetching:f,error:m}),[u?.review_summary,m,c,f])},gde=()=>{const{session:e}=Ne(),t=e?.user?.org_uuid;return{uuid:t==="none"?void 0:t}};function hyt(){const{value:e}=hde(),{locale:t}=J(),n=new Intl.Locale(t),{uuid:r}=gde(),{value:s,loading:o}=Rx({flag:"can-book-hotels",defaultValue:!1,extraAttributes:{cfLanguage:n.language,appApiVersion:ql,dependent_flag:"canonical-hotel-pages-enabled",variation_served:e,orgUUID:r??""}});return d.useMemo(()=>({initialized:!o,value:s}),[o,s])}function pU(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}const h_t=async({filters:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/travel/hotels/search-widgets",t,{body:e,timeoutMs:Cn.NONE});if(n)return{hotels:n.hotels,map_item:n.map_item};throw new he("API_CLIENTS_ERROR",{message:"No hotel results returned",cause:r,status:s.status??0})},gyt=async({tripadvisorIds:e,searchPayload:t,reason:n})=>{const{checkIn:r,checkOut:s,numAdults:o,numChildren:a}=t,{data:i}=await de.POST("/rest/travel/hotels/search-availability",n,{body:{currency:"USD",filter:{tripadvisor_ids:e},stay_info:{check_in_date:pU(r),check_out_date:pU(s),guests:{adults:o,children:a}}},timeoutMs:Cn.HIGH,retries:2});return i?{availability:i.results,currencyExchangeRates:i.currency_exchange_rates,otaOffers:i.ota_hotel_offers}:null},yyt=({hotelIds:e,availabilitySearchPayload:t,priceConstraint:n,reason:r,enabled:s=!0})=>{const o=mt({queryKey:be.makeEphemeralQueryKey("hotelAvailabilities",e,t),queryFn:async()=>{if(t&&e.length>0){const c=await gyt({tripadvisorIds:e,searchPayload:t,reason:r});if(c)return c;throw new Error("Failed to fetch availabilities")}return null},placeholderData:Wl,enabled:s&&!!t&&e.length>0}),a=n?.max_price,i=d.useMemo(()=>{if(!t||!o.data?.availability&&!o.data?.otaOffers)return;const c=o.data.currencyExchangeRates,u=fyt(t.checkIn,t.checkOut)-1;if(u<=0)return;const f={};o.data.availability?.forEach(g=>{const y=g.tripadvisor_id,x=g.rooms?.reduce((w,S)=>{const C=S.rates?.slice()??[];C.sort((T,k)=>T.price.base_price-k.price.base_price);const E=C[0];return E?w?E.price.base_priceb)&&(f[y]=b)});const m={};o.data.otaOffers?.forEach(g=>{const y=g.tripadvisor_id,x=g.offers.map(({price:v})=>v);if(x.sort(),Hi(x)){const b=x[0]*u;m[y]=b}});const p={},h=new Set([...Object.keys(f),...Object.keys(m)]);for(const g of h){const y=f[g],x=m[g],v=y!==void 0?y/u:void 0,b=x!==void 0?x/u:void 0;if(v!==void 0&&(a==null||v<=a)&&y!==void 0){p[g]={price:y,source:"selfbook"};continue}b!==void 0&&(a==null||b<=a)&&x!==void 0&&(p[g]={price:x,source:"ota"})}return Object.entries(p).reduce((g,[y,x])=>(g[y]={total:uk(x.price,"USD",{roundToMajor:!0,renderZero:!0}),daily:uk(x.price/u,"USD",{roundToMajor:!0,renderZero:!0}),source:x.source},g),{})},[t,o.data,a]);return d.useMemo(()=>({lowestRatesByHotel:i,isFetching:o.isFetching,isError:o.isError,refetch:o.refetch}),[i,o.isFetching,o.isError,o.refetch])},xyt=(e,t)=>{const{value:n,loading:r}=zt({flag:"get-opentable-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};function vyt(){const{locale:e}=J(),t=new Intl.Locale(e),{uuid:n}=gde(),{variation:r,loading:s}=xyt(!1,{language:t.language,country:t.region??"",appApiVersion:ql,orgUUID:n??""});return d.useMemo(()=>({initialized:!s,value:r}),[s,r])}const byt=({place:e,entryUUID:t,contextUUID:n,mode:r,reason:s,hotelRate:o})=>{const{$t:a}=J(),{SearchClientLogo:i}=Zue(e.url),{session:c}=Ne(),{trackEvent:u}=Xe(c),{openStackedModal:f}=pn().legacy,m=hde(),p=hyt(),h=vyt(),{generateReviewSummaryForPlace:g,reviewSummary:y,isFetching:x}=pyt({entity_id:String(e.id),entity_name:e.name,entry_uuid:t??"",data_source:e.client,url:e.url,reason:s});d.useEffect(()=>{e.review_summary||y||g()},[e.review_summary,y]);const v="user_filters"in e?e.user_filters:void 0,b=d.useMemo(()=>{if(v?.start_date&&v?.end_date&&v?.num_guests)return{checkIn:fU(v.start_date),checkOut:fU(v.end_date),numAdults:v.num_guests,numChildren:0}},[v]),{lowestRatesByHotel:_}=yyt({hotelIds:[e.id],availabilitySearchPayload:b,priceConstraint:v?.price_constraint,reason:s,enabled:e.entity_type==="hotel"}),w=d.useMemo(()=>e.review_summary??y,[e.review_summary,y]),{hasProsOrCons:S,isLoadingProsCons:C}=d.useMemo(()=>{const L=w?.pros_detailed?.length??0,U=w?.cons_detailed?.length??0;return{hasProsOrCons:L||U||x,isLoadingProsCons:x&&!w?.summary?.length&&(L+U<3||!L||!U)}},[w?.pros_detailed,w?.cons_detailed,w?.summary?.length,x]),E=!!w?.summary,T=w?.key_features&&w.key_features.length>0,k=!E&&x,I=d.useCallback(()=>{const L=e.entity_url??e.url;return m.initialized&&m.value?e.canonical_page_path??L:L},[m,e.canonical_page_path,e.entity_url,e.url]),M=d.useCallback(()=>{const L=I();if(p.initialized&&p.value&&e.canonical_page_path&&e.entity_type==="hotel"&&"user_filters"in e&&e.user_filters){const U=new URLSearchParams;if(e.user_filters.start_date&&U.set("check-in",e.user_filters.start_date),e.user_filters.end_date&&U.set("check-out",e.user_filters.end_date),e.user_filters.num_guests&&U.set("adults",String(e.user_filters.num_guests)),U.toString())return`${L}?${U.toString()}`}return L},[I,p,e]),N=a({defaultMessage:"See Prices",description:"button label",id:"AOhh9Wa3/S"}),D=a({defaultMessage:"Reserve",description:"button label",id:"Rl2ClHM49w"}),j=d.useCallback(L=>{u("place button clicked",{answerMode:r,entryUUID:t,contextUUID:n,itemID:L})},[n,t,r,u]),F=d.useCallback(L=>{window.open(L,"_blank")},[]),R=d.useMemo(()=>{if(p.initialized&&p.value&&e.canonical_page_path&&e.entity_type==="hotel"){const L=o??_?.[e.id],U=M();return L?{ctaText:a({defaultMessage:"From {price} per night",id:"fkXL6pzn0I",description:"Button text indicating the starting price per night for a hotel"},{price:L.daily}),ctaURL:U,onClick:()=>{F(U)},ctaSubtitle:void 0,icon:B("tag")}:{ctaText:N,ctaURL:U,ctaSubtitle:void 0,onClick:()=>{F(U)},icon:B("tag")}}else if(e.booking_urls){const L=e.booking_urls[0];if(L?.booking_type==="HOTEL"&&p.value)return{ctaText:N,ctaURL:L.url,onClick:()=>{F(L.url)},icon:B("moneybag")};if(L?.booking_type==="RESTAURANT"){const U=h.initialized&&h.value&&L.provider_entity_id,O=L.booking_provider;return{ctaText:D,ctaURL:L.url,icon:B("calendar-event"),onClick:U?()=>{u("restaurant reservation CTA clicked",{booking_provider:O}),f("restaurantBookingModal",{restaurantId:L.provider_entity_id,provider:O})}:()=>{F(L.url)}}}}},[o,p,h,e,M,D,N,f,a,_,u,F]),P=d.useCallback(L=>{L.stopPropagation()},[]);return{generatedReviewSummary:w,hasProsOrCons:!!S,isLoadingProsCons:C,hasReviewSummary:E,hasKeyFeatures:!!T,reviewSummaryLoading:k,getEntityUrl:I,getEntityUrlWithParams:M,bookingCTAProperties:R,SearchClientLogo:i,handleClientLogoClick:P,trackPlaceButtonClicked:j}},_yt=A.memo(({place:e,entryUUID:t,contextUUID:n,context:r="medium",children:s})=>{const o="place-inline-card",{$t:a}=J(),[i,c]=d.useState(!1),[u,f]=d.useState(Pe),{openModal:m}=pn().legacy,{generatedReviewSummary:p,hasProsOrCons:h,isLoadingProsCons:g,bookingCTAProperties:y,SearchClientLogo:x,handleClientLogoClick:v}=byt({place:e,entryUUID:t,contextUUID:n,reason:o}),{session:b}=Ne(),{trackEvent:_,trackEventOnce:w}=Xe(b);d.useEffect(()=>{t&&(w("entity card shown",{entryUUID:t,entityType:"places"}),n&&_("place card viewed",{inline:!0,entryUUID:t,contextUUID:n,itemID:e.url}))},[t,n,e.url,_,w]);const S=d.useCallback(()=>{_("entity card clicked",{entryUUID:t,entityType:"places"})},[t,_]),C=d.useCallback(async()=>{const O=[];if(e.image_url&&O.push(e.image_url),e.images&&e.images.forEach(G=>{G!==e.image_url&&O.push(G)}),!O.length){f(Pe);return}const $=[];for await(const G of exe(O))$.length===0&&f(G.map(H=>({image:H,url:H.includes("tripadvisor.com")?e.url:e.entity_url??e.url}))),$.push(...G);f($.map(G=>({image:G,url:G.includes("tripadvisor.com")?e.url:e.entity_url??e.url})))},[e.image_url,e.images,e.url,e.entity_url]);d.useEffect(()=>{C()},[C]);const E=d.useMemo(()=>u.map(O=>O.image),[u.length]),{colorScheme:T}=Ss(),k=d.useCallback(()=>c(!0),[]),I=d.useCallback(()=>c(!1),[]),M=d.useCallback(()=>{window.open(X2e(e.name,e.address?.join(", ")??""),"_blank")},[e.name,e.address]),N=d.useCallback(O=>{S(),O==="cta"&&y?y.onClick():m("placeModal",{place:e,entryUUID:t,contextUUID:n})},[S,m,t,n,e,y]),D=a({defaultMessage:"Website",id:"JkLHGwmS9L"}),j=a({defaultMessage:"Directions",id:"fuwkSr5Bz7"}),F=a({defaultMessage:"Call",id:"f+GKc4i1Gc"}),R=d.useMemo(()=>[(e.price||e.price_range)&&l.jsx(Bn,{id:"price",children:l.jsx(Hh,{textVariant:"smallBold",priceSymbols:e.price,priceRange:e.price_range,currencySymbol:e.currency_char})},"price"),e.rating&&l.jsx(Bn,{id:"rating",children:l.jsx(ux,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"sm",variant:"truncated",textVariant:"smallBold",reviewTextVariant:"small",color:"default",url:x&&e.url?e.url:void 0})},"rating"),!!e.standardized_hours&&l.jsx(Bn,{id:"open-until",children:l.jsx(dx,{place:e})},"open-until"),x&&l.jsx(Bn,{id:"logo",children:l.jsx(yde,{SearchClientLogo:x,url:e.url,handleClick:v})},"logo"),...r==="medium"?[l.jsx(Bn,{id:"website",children:l.jsx(Fy,{label:D,href:e.entity_url??e.url})},"website"),!!e.address?.length&&l.jsx(Bn,{id:"directions",children:l.jsx(Fy,{label:j,href:Q2e(e.name,e.address.join(", "))})},"directions"),!!e.phone&&l.jsx(Bn,{id:"call",children:l.jsx(Fy,{label:e.phone,href:`tel:${e.phone}`})},"call")]:Pe].filter(O=>!!O),[x,v,e,D,j,r]),P=d.useMemo(()=>[y&&{label:y.ctaText,icon:y.icon,onClick:()=>N("cta"),emphasize:!0},e.address?.length&&{label:j,onClick:()=>M(),icon:B("map-pin")},(e.entity_url||e.url)&&{label:D,onClick:()=>window.open(e.entity_url??e.url,"_blank"),icon:B("world")},e.phone&&{label:F,onClick:()=>window.open(`tel:${e.phone}`,"_blank"),icon:B("phone")}].filter(O=>!!O),[y,N,e.entity_url,e.url,D,j,M,e.address?.length,e.phone,F]),L=d.useMemo(()=>y?l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("span",{className:"text-[16px]",children:y.ctaText}),y.ctaSubtitle&&l.jsx("span",{className:"text-quiet -mt-1 text-xs font-normal",children:y.ctaSubtitle})]}):null,[y]),U=d.useMemo(()=>y?l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("span",{className:"text-lg",children:y.ctaText}),y.ctaSubtitle&&l.jsx("span",{className:"text-quiet -mt-0.5 text-sm font-normal",children:y.ctaSubtitle})]}):null,[y]);return r==="small"?l.jsx(tM,{images:E,showControls:i,onImageClick:()=>N("title"),children:l.jsxs(qu.Root,{children:[l.jsx(qu.Image,{children:l.jsx(dr,{fullBleed:!0,className:"aspect-[4/3] w-full overflow-hidden",children:l.jsx(Ly,{})})}),l.jsxs(qu.Content,{children:[l.jsx(qu.Action,{onClick:()=>N("title"),children:l.jsx(qu.Title,{children:e.name})}),l.jsx(V,{color:"light",children:l.jsx(ga,{className:"gap-xs flex flex-row flex-wrap",children:R})}),l.jsx("div",{className:"-mt-sm",children:s}),l.jsx(qu.Footer,{children:l.jsx(ayt,{actions:P})})]})]})}):l.jsx("div",{className:"group relative","data-testid":"place-inline-card",children:l.jsx(tM,{images:E,showControls:i,onImageClick:()=>N("title"),children:l.jsxs("div",{className:"gap-md @container mt-4 flex flex-col",children:[l.jsxs("div",{className:"gap-sm flex flex-row items-end",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(ude,{title:e.name,onClick:()=>N("title")}),l.jsx(V,{color:"light",children:l.jsx(ga,{className:"gap-xs flex flex-row flex-wrap",children:R})})]}),y&&l.jsx("div",{className:"@[420px]:block ml-auto hidden",children:l.jsx(Ge,{variant:"primaryGhost",icon:y.icon,size:"regular",pill:!0,onClick:()=>N("cta"),text:L})})]}),(!u||u.length<1)&&!h?null:l.jsxs("div",{className:"gap-sm @[420px]:grid-cols-2 @[640px]:grid-cols-3 grid w-full grid-cols-1",children:[u&&u[0]&&l.jsx(dr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:"aspect-[4/3] overflow-hidden",children:l.jsx(Ly,{})}),l.jsx(dr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:z("overflow-hidden",{"aspect-[4/3]":u&&u.length>1&&(h||!h&&u&&u[2]),"@[640px]:block hidden h-full":h||!h&&u&&u[2],"@[420px]:block @[640px]:col-span-2 hidden h-full":!h&&u&&u.length===1||h&&(!u||u.length<1)}),children:l.jsxs(K,{as:"button",onClick:M,className:"relative size-full",children:[l.jsx("img",{className:"absolute left-1/2 top-1/2 max-w-[unset] -translate-x-1/2 -translate-y-1/2",...uyt({mode:T,width:512,height:512,lat:e.lat,long:e.lng}),alt:""}),l.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-visible",children:l.jsx(G8,{})})]})}),h?l.jsx("div",{className:z("@[420px]:h-full h-[124px]",{"aspect-[4/3]":!u?.length}),children:l.jsx(fde,{pros:p?.pros_detailed??Pe,cons:p?.cons_detailed??Pe,loading:g})}):u&&u[2]?l.jsx(dr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:"@[420px]:block hidden aspect-[4/3] overflow-hidden",children:l.jsx(Ly,{})}):null]}),y&&e.canonical_page_path?l.jsx("div",{className:"-mt-sm @[420px]:hidden block",children:l.jsx(Ge,{variant:"primaryGhost",icon:y.icon,fullWidth:!0,size:"regular",pill:!0,onClick:()=>N("cta"),text:U})}):null,s]})})})});_yt.displayName="PlaceInlineCard";const dx=A.memo(({place:e,textVariant:t="smallBold",condensed:n=!1,showTooltip:r=!0})=>{const{$t:s}=J(),o=W8(e.standardized_hours,e.timezone,"short"),[a,i]=d.useMemo(()=>{for(const u of o)if(u.isToday){for(const f of u.hours)if(f.isOpenNow)return f.open!==f.close?[!0,f.close]:[!0,null]}return[!1,null]},[o]),c=d.useMemo(()=>l.jsx(dde,{standardizedHours:e.standardized_hours,timezone:e.timezone}),[e.standardized_hours,e.timezone]);return l.jsx(Io,{tooltipText:c,asChild:!0,showTooltip:r,children:l.jsx(V,{variant:t,color:a?"super":"red",children:a?i&&!n?s({defaultMessage:"Open until {time}",id:"abDRIJdom/"},{time:i}):s({defaultMessage:"Open",id:"JfG49wNHKP"}):s({defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})})});dx.displayName="OpenUntil";const Fy=A.memo(({label:e,href:t,textVariant:n="smallBold",icon:r})=>{const s=d.useCallback(a=>{a.stopPropagation()},[]),o=l.jsxs(V,{variant:n,color:"light",className:z("gap-xs flex items-center truncate transition-colors duration-150",{"hover:text-super":t}),children:[r?l.jsx(rn,{icon:r,size:"tiny"}):null,e]});return t?l.jsx(yt,{href:t,target:"_blank",className:"cursor-pointer truncate",onClick:s,children:o}):o});Fy.displayName="MetaDataItem";const yde=A.memo(({SearchClientLogo:e,url:t,handleClick:n})=>{const r=d.useCallback(o=>{o.stopPropagation()},[]),s=n||r;return e?t?l.jsx(yt,{href:t,target:"_blank",className:"cursor-pointer duration-150 hover:opacity-70",onClick:s,children:l.jsx(e,{})}):l.jsx(e,{}):null});yde.displayName="SearchClientLogoWrapper";const wyt=3,xde=A.memo(({placeWidgets:e})=>{const{$t:t}=J(),n=ui(),{result:{backend_uuid:r,context_uuid:s},isLastResult:o}=It(),{setActiveThreadTab:a,handleTabScrollBehavior:i}=kg(),c=dZ(),{session:u}=Ne(),{trackEventOnce:f,trackEvent:m}=Xe(u),{answerModeActionList:p,currentModeData:{mode:h}}=g6(),[g,y]=d.useState(null),[x,v]=d.useState(null);d.useEffect(()=>{f("maps preview viewed",{entryUUID:r,contextUUID:s})},[f,r,s]);const b=d.useMemo(()=>e.slice(0,wyt),[e]),_=d.useMemo(()=>e.map(C=>ade(C)),[e]),w=d.useMemo(()=>{const C=p.some(T=>T.mode==="hotels"),E=p.some(T=>T.mode==="places");return C?"hotels":E?"places":"default"},[p]),S=d.useCallback(()=>{m("maps preview see more clicked",{entryUUID:r,contextUUID:s}),i(w),a(w),c(w)},[a,c,i,w,r,s,m]);return e.length?l.jsxs(K,{className:"bg-subtler relative flex h-96 w-full overflow-hidden rounded-xl border",children:[l.jsx("div",{className:"absolute inset-0",children:l.jsx(ide,{entryUUID:r,contextUUID:s,selectedLocation:g,setSelectedLocation:y,highlightedLocation:x,setHighlightedLocation:v,setRenderedLocations:Ao,locations:_,showNavControl:!1,showRating:!0,answerMode:h})}),l.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:n?l.jsx("div",{className:"bottom-sm gap-sm pointer-events-auto absolute inset-x-0 flex flex-col",children:l.jsxs("div",{className:"px-sm gap-sm flex overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[b.map(C=>{const E=_.findIndex(k=>k.url===C.url),T=_[E];return T?l.jsx(nM,{place:C,isSelected:g?.url===C.url,onSelect:()=>{y(T)},onMouseEnter:()=>{v(T)},onMouseLeave:()=>v(null),isMobile:!0},C.url):null}),l.jsx("span",{className:"inline-flex items-center",children:l.jsx(wt,{icon:B("chevron-right"),"aria-label":t({defaultMessage:"See more places",id:"q6PxnN/+4O"}),variant:"secondary",size:"default",rounded:!0,disabled:!o,onClick:S})})]})}):l.jsxs("div",{className:"inset-y-sm right-sm pointer-events-auto absolute flex w-64 flex-col justify-between truncate",children:[b.map(C=>{const E=_.findIndex(k=>k.url===C.url),T=_[E];return T?l.jsx(nM,{place:C,isSelected:g?.url===C.url,onSelect:()=>{y(T)},onMouseEnter:()=>{v(T)},onMouseLeave:()=>v(null)},C.url):null}),l.jsx("span",{className:"bg-base rounded-lg",children:l.jsx(wt,{variant:"secondary",size:"small",fullWidth:!0,disabled:!o,onClick:S,trailingIcon:B("arrow-right"),children:t({defaultMessage:"See more places",id:"q6PxnN/+4O"})})})]})})]}):null},(e,t)=>Un(e,t)),nM=({place:e,isSelected:t,onSelect:n,onMouseEnter:r,onMouseLeave:s,isMobile:o=!1})=>l.jsx(K,{as:"button",onClick:n,onMouseEnter:r,onMouseLeave:s,className:z("hover:bg-subtler bg-base flex cursor-pointer overflow-visible rounded-lg border backdrop-blur-lg transition-colors",{"shadow-md":t,"shadow-sm":!t,"min-h-20 w-64 flex-shrink-0 flex-col p-2":o,"min-h-24 w-full items-center justify-between p-2.5":!o}),children:o?l.jsxs("div",{className:"gap-xs flex flex-col text-left",children:[l.jsx(V,{variant:"small",className:"!overflow-clip truncate font-medium leading-tight",children:e.name}),!!e.address?.length&&l.jsx(V,{variant:"tiny",color:"light",className:"!overflow-clip truncate",children:e.address?.join(", ")}),l.jsx("div",{className:"flex items-center",children:l.jsxs(ga,{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Bn,{id:"rating",children:l.jsx(ux,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"xs",variant:"truncated",textVariant:"tiny",reviewTextVariant:"tiny",color:"default"})}),(e.price||e.price_range)&&l.jsx(Bn,{id:"price",children:l.jsx(Hh,{textVariant:"tiny",priceSymbols:e.price,priceRange:e.price_range,dollarColor:"light",currencySymbol:e.currency_char})})]})}),e.operating_hours&&l.jsx(dx,{place:e,textVariant:"tiny",showTooltip:!1}),l.jsx("div",{className:"invisible flex-1"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-xs flex h-20 min-w-0 flex-1 flex-col justify-start text-left",children:[l.jsx(V,{variant:"small",className:"!overflow-clip truncate font-medium leading-tight",children:e.name}),!!e.address?.length&&l.jsx(V,{variant:"tiny",color:"light",className:"!overflow-clip truncate",children:e.address?.join(", ")}),l.jsx("div",{className:"flex items-center",children:l.jsxs(ga,{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Bn,{id:"rating",children:l.jsx(ux,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"xs",variant:"truncated",textVariant:"tiny",reviewTextVariant:"tiny",color:"default"})}),(e.price||e.price_range)&&l.jsx(Bn,{id:"price",children:l.jsx(Hh,{textVariant:"tiny",priceSymbols:e.price,priceRange:e.price_range,dollarColor:"light",currencySymbol:e.currency_char})})]})}),e.operating_hours&&l.jsx(dx,{place:e,textVariant:"tiny",showTooltip:!1}),l.jsx("div",{className:"invisible flex-1"})]}),e.image_url&&l.jsx("div",{className:"ml-sm size-20 flex-shrink-0 overflow-hidden rounded-sm",children:l.jsx(Wo,{alt:`${e.name} image`,src:e.image_url,includeLightBoxModal:!1,containerClassName:"size-full",imageClassName:"size-full object-cover"})})]})});xde.displayName="MapsPreview";nM.displayName="PlaceCard";const vde=({widgetType:e,widgetName:t,hasData:n,metricName:r})=>{const{result:{mode:s}}=It(),o=h6();d.useEffect(()=>{if(!n)return;const a=r??`web.frontend.${e}_widget_render_time`;o(a,{widgetType:e,widgetName:t,queryMode:s,widgetSize:"full"})},[n,e,t,r,s,o])},Cyt=Ce(async()=>{const{CitationListModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>FN),void 0));return{default:e}}),Syt=12,Eyt=new Array(3).fill(null),bde="w-[166px]",_de=A.memo(({showSkeletonUnits:e,results:t})=>{const{$t:n}=J(),{isMobileStyle:r}=Re(),{openModal:s}=Uo(),{session:o}=Ne(),{trackEvent:a}=Xe(o);vde({widgetType:"news",widgetName:"news",hasData:t.length>0});const i=d.useCallback(()=>{a("clicked news results see more"),s(Cyt,{legacyIdentifier:"citationListModal",webResults:t,citationType:"articles"})},[s,t,a]),c=d.useMemo(()=>[...t.filter(f=>f.meta_data?.images&&f.meta_data.images.length>0),...t.filter(f=>!f.meta_data?.images||f.meta_data.images.length===0)],[t]),u=d.useMemo(()=>c.length===3?2:Math.min(4,c.length),[c]);return r?l.jsxs(K,{className:z("gap-sm","-mx-pageHorizontalPadding px-pageHorizontalPadding scrollbar-none grid auto-cols-max grid-flow-col overflow-x-auto"),children:[c.slice(0,Syt).map((f,m)=>l.jsx(rM,{result:f,idx:m,variant:"mobile"},`${f.url}-${f.timestamp}`)),e&&Eyt.map((f,m)=>l.jsx(K,{variant:"subtler",className:`h-16 ${bde} flex-shrink-0 rounded-lg`},m))]}):l.jsxs("div",{children:[l.jsxs("div",{className:"gap-x-xl mb-md relative grid grid-cols-2",children:[c.slice(0,u).map((f,m)=>l.jsx(rM,{result:f,idx:m,variant:"desktop",fullWidth:u==1,showBorder:m2},`${f.url}-${f.timestamp}`)),u>1&&l.jsx("div",{className:"border-subtlest absolute inset-y-0 left-1/2 w-0 border-l"})]}),l.jsxs("div",{className:"relative -ml-3",children:[l.jsx("div",{className:"bg-base relative z-10 w-fit",children:l.jsx(wt,{size:"small",variant:"text",onClick:i,children:n({defaultMessage:"See more news",id:"2MUZ4GQuje"})})}),l.jsx("hr",{className:"border-subtlest absolute inset-x-0 top-1/2"})]})]})});_de.displayName="NewsWidget";const rM=A.memo(({result:e,idx:t,variant:n,showBorder:r,fullWidth:s})=>{const{$t:o}=J(),{session:a}=Ne(),{trackEvent:i,trackEventOnce:c}=Xe(a),{result:u}=It(),f=yJ({trackEvent:i,entryUUID:u.backend_uuid,frontendContextUUID:u.uuid,contextUUID:u.context_uuid});d.useEffect(()=>{c("news source viewed",{url:e.url,title:e.name,position:t,entryUUID:u.backend_uuid,frontendContextUUID:u.uuid,contextUUID:u.context_uuid,published_date:e.meta_data?.published_date,domain_name:e.meta_data?.domain_name})},[c,e.url,e.name,e.meta_data?.published_date,e.meta_data?.domain_name,t,u.backend_uuid,u.uuid,u.context_uuid]);const m=d.useMemo(()=>()=>{f("news source clicked",{citation_url:e.url,citation_index:t})},[e,f,t]),p=e.meta_data?.images?.[0],h=d.useMemo(()=>({color:"light"}),[]);return n=="desktop"?l.jsx(Vy,{href:e.url,rel:"noopener",onTrackEvent:m,className:z("group",{"col-span-full":s}),children:l.jsx("div",{className:z({"pb-md mb-md border-subtlest border-b":r}),children:l.jsxs("div",{className:"gap-md flex h-24 flex-row",children:[l.jsxs("div",{className:"flex flex-1 flex-col max-w-[200px]",children:[l.jsx(V,{variant:"small",className:"group-hover:!text-super mb-auto line-clamp-3 transition-colors duration-200 font-medium",children:e.name}),l.jsxs("div",{className:"flex",children:[l.jsx(ya,{variant:"tinyRegular",color:"light",url:e.url,isAttachment:e.is_attachment,source:e.meta_data?.domain_name}),l.jsxs(V,{variant:"tiny",color:"light",className:"flex shrink-0 truncate",children:[l.jsx("span",{children:" · "}),l.jsx(pf,{recentlyUpdatedLabel:o({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.meta_data?.published_date,timestampProps:h,includeIcon:!1})]})]})]}),p&&l.jsx(sM,{src:p,alt:"",className:"aspect-[4/3] w-32"})]})})}):l.jsx(Vy,{href:e.url,rel:"noopener",onTrackEvent:m,children:l.jsxs(dr,{className:z("flex h-full cursor-pointer flex-col gap-2 rounded-lg p-1","border",`${bde} flex-shrink-0`),children:[p&&l.jsx(sM,{src:p,alt:"",className:"h-32 w-full"}),l.jsx(K,{className:"flex min-h-[60px] flex-1 flex-col justify-between p-2 pt-1",children:l.jsxs(K,{className:"flex flex-1 flex-col",children:[l.jsx(V,{variant:"small",className:"line-clamp-3",children:e.name}),l.jsx("div",{className:"mt-auto py-2",children:l.jsx(V,{variant:"tiny",color:"light",className:"gap-x-xs flex",children:l.jsx(pf,{recentlyUpdatedLabel:o({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.meta_data?.published_date,timestampProps:h,includeIcon:!1})})}),l.jsx(ya,{variant:"tinyRegular",color:"light",url:e.url,isAttachment:e.is_attachment})]})})]})})});rM.displayName="CitationTrendingCard";const sM=A.memo(({src:e,alt:t,className:n})=>{const[r,s]=d.useState(!1);return l.jsx(K,{className:z("relative overflow-hidden rounded-md bg-gray-100 dark:bg-gray-700",n),children:r?l.jsx(K,{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:l.jsx(ut,{name:B("photo"),size:32})}):l.jsx("img",{src:e,alt:t,className:"size-full object-cover",loading:"lazy",onError:()=>s(!0)})})});sM.displayName="TrendingImageThumbnail";const kyt=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"news-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},wde=A.memo(({submitQuery:e})=>{const{$t:t}=J(),{session:n}=Ne(),{trackEvent:r}=Xe(n),{removeWidgetFromEntry:s}=lv({reason:"thread-content"}),o=g0(),{result:a,widgetData:i,response:c,isEntryInFlight:u,financeWidgetData:f,newsWidgetData:m,weatherWidgetData:p,timeWidgetData:h,timerWidgetData:g,currencyExchangeWidgetData:y,predictionMarketWidgetData:x,calculatorWidgetData:v,flightStatusWidgetData:b,sportsWidgetData:_,priceComparisonWidgetData:w,genericFallbackWidgetData:S,highPriorityWidgets:C,lowPriorityWidgets:E,mapsPreviewData:T}=It(),{variation:k}=kyt(!1);vde({widgetType:"news",widgetName:"news_block",hasData:!!m?.web_results?.length,metricName:"web.frontend.news_block_received"});const{standardWidgetData:I,codeInterpreterImages:M}=i.reduce((X,ee)=>(ee.is_code_interpreter&&ee.is_image?X.codeInterpreterImages.push(ee):X.standardWidgetData.push(ee),X),{standardWidgetData:[],codeInterpreterImages:[]}),N=d.useMemo(()=>M.length>0,[M]),D=d.useMemo(()=>!N&&I.length>0,[N,I]),j=d.useMemo(()=>!1,[m?.web_results,a?.display_model,k]),F=d.useCallback(X=>{a?.frontend_context_uuid&&a?.backend_uuid&&(s({entryUUID:a.backend_uuid,data:X}),r("remove widget",{url:"url"in X?X.url:X?.links?.[0]?.url??"",entryUUID:a.backend_uuid,source:"thread"}))},[s,a?.backend_uuid,r,a?.frontend_context_uuid]),R=d.useCallback((X,ee,le,re,ce)=>{const ue=ce||("name"in X?X.name:"url"in X?X.url:X?.links?.[0]?.url??"");return l.jsx(z8,{data:X,submit:e,isReadonly:ee,menuItems:ee||u?[]:[{type:"default",text:t({defaultMessage:"Report",id:"x5Tz6MZH82"}),icon:B("thumb-down"),onClick:()=>le&&le(X)}],inFlight:u,entryUUID:a?.backend_uuid??null,tableCitationOffset:re},ue)},[u,e,t,a?.backend_uuid]),P=d.useCallback((X,ee,le)=>{const re={name:`${ee}-widget`,snippet:"",timestamp:"",url:"",meta_data:X,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""};return R(re,o,F,c?.web_results?.length,le)},[F,o,c?.web_results?.length,R]),L=d.useCallback(X=>R(X,o,F,c?.web_results?.length),[F,o,c?.web_results?.length,R]),U=d.useCallback(X=>P(X,"sports"),[P]),O=d.useCallback(X=>P(X,"weather"),[P]),$=d.useCallback(X=>P(X,"time"),[P]),G=d.useCallback(X=>P(X,"timer"),[P]),H=d.useCallback(X=>P(X,"currency_exchange"),[P]),Q=d.useCallback(X=>P(X,"prediction-market"),[P]),Y=d.useCallback(X=>P(X,"calculator"),[P]),te=d.useCallback(X=>P(X,"flight-status"),[P]),se=d.useCallback(X=>P(X,"price-comparison"),[P]),ae=d.useCallback(X=>P(X,"generic-fallback"),[P]);return l.jsxs(l.Fragment,{children:[f&&l.jsx(H8,{data:f}),j&&m&&l.jsx(_de,{results:m.web_results}),N&&M.map(X=>l.jsx("div",{children:R(X,o)},X.url)),D&&C.map(L),S&&ae(S),p&&O(p),h&&$(h),g&&G(g),y&&H(y),x&&Q(x),v&&Y(v),b&&te(b),_&&U(_),w&&se(w),D&&E.map(L),T&&T.place_widgets.length>0&&l.jsx(xde,{placeWidgets:T.place_widgets})]})});wde.displayName="WidgetsSection";const Myt=Ce(async()=>{const{MarkSpinner:e}=await Se(()=>q(()=>import("./MarkSpinner-DXbfFXdV.js").then(t=>t.a),__vite__mapDeps([29,4,1])));return{default:e}}),Tyt=A.memo(({title:e,titleIcon:t,titleAccessory:n,titleUrl:r,showPplxMark:s,queryStr:o,loading:a,className:i="mb-md"})=>{const{session:c}=Ne(),{trackEvent:u}=Xe(c),[f,m]=d.useState(!1),p=d.useCallback(()=>{r!=null&&(u("click result entry header",{query:o}),window.open(r,"_blank")?.focus())},[u,o,r]);return l.jsxs("div",{className:z("flex w-full items-center justify-between",i),children:[l.jsx("div",{onClick:p,className:z({"cursor-pointer":r!=null}),children:l.jsxs("div",{color:"super",className:"space-x-sm flex items-center",children:[(s||t)&&l.jsx(V,{variant:"section-title",as:"div",children:s?l.jsx("div",{className:"relative -top-px flex w-[24px] transform-gpu items-center justify-center",onClick:()=>{m(!0),setTimeout(()=>{m(!1)},0)},children:l.jsx(Myt,{size:24,shouldAnimate:a||f})}):t&&l.jsx("div",{className:"w-[24px]",children:l.jsx(rn,{icon:t,size:"large"})})}),l.jsx(V,{variant:"section-title",as:"div",children:e})]})}),n]})});Tyt.displayName="ThreadEntryHeader";const Cde=A.memo(({header:e,children:t})=>l.jsxs(K,{children:[e&&l.jsx(K,{variant:"background",className:"flex items-center justify-between",children:e}),t]}));Cde.displayName="ThreadEntrySection";const Ayt=Ce(async()=>{const{ConnectorAuthorizationPrompt:e}=await Se(()=>q(()=>import("./ConnectorAuthorizationPrompt-W74w80u2.js"),__vite__mapDeps([466,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),Nyt=Ce(async()=>{const{ThreadEntryFooter:e}=await Se(()=>q(()=>import("./ThreadEntryFooter-C2ACX__g.js"),__vite__mapDeps([467,4,1,8,3,9,6,7,468,101,102,81,47,469,470,471,472,49,50,473,474,475,10,11,12])));return{default:e}}),Ryt=Ce(async()=>{const{RelatedContent:e}=await Se(()=>q(()=>import("./Related-C29vANZf.js"),__vite__mapDeps([476,4,1,6,3,472,477,9,7,478,474,8,10,11,12])));return{default:e}}),Dyt=Ce(async()=>{const{StudyModeRelated:e}=await Se(()=>q(()=>import("./StudyModeRelated-Dy_zxdoW.js"),__vite__mapDeps([479,4,1,6,3,472,477,9,7,8,10,11,12])));return{default:e}}),jyt=Ce(async()=>{const{ThreadContentResponse:e}=await Se(()=>q(()=>import("./ThreadContentResponse-DxwJeMuW.js"),__vite__mapDeps([480,4,1,6,3,55,8,9,7,54,468,101,102,81,47,469,470,471,472,49,50,473,53,10,11,12])));return{default:e}}),Iyt=Ce(()=>Se(()=>q(()=>import("./AnswerComparisonModal-DYnELi4M.js"),__vite__mapDeps([481,4,1,6,3,480,55,8,9,7,54,468,101,102,81,47,469,470,471,472,49,50,473,53,10,11,12])))),Sde=A.memo(({streamId:e,backendUuid:t})=>{throw new Ol("STREAM_FAILED_PLACEHOLDER_ERROR",{details:{request_id:e,backend_uuid:t}})});Sde.displayName="FailedPlaceholderError";const Ede=A.memo(({submitQuery:e,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o,shouldShowRelatedContent:a=!0,sbsEntriesGroup:i})=>{const c="thread-content",{isMobileStyle:u}=Re(),{session:f}=Ne(),{trackEvent:m}=Xe(f);lv({reason:c});const{result:p,isEntryInFlight:h,response:g,hasLLMToken:y,isAnswerSkipped:x,steps:v,isPending:b,hasMediaOnlyLayout:_,isAgentWorkflowInFlight:w,isFinalStep:S,taskWidgetData:C,hasFastWidget:E,isLastResult:T,idx:k,hasAnswer:I,hasWebResults:M}=It(),N=e1e(),D=j4(),j=ZJ(),F=d.useRef(null),R=d.useMemo(()=>{const Le=p?.side_by_side_metadata?.selection_status;return Le===aa.SELECTED||Le===aa.TIE},[p?.side_by_side_metadata?.selection_status]),P=d.useMemo(()=>i.length<1?[]:[...i].sort((Le,gt)=>Le.backend_uuid.slice(-8).localeCompare(gt.backend_uuid.slice(-8),void 0,{sensitivity:"base"})),[i]),{trackJudgment:L,trackBannerExposure:U,trackSBSExposure:O}=Hve({results:P,session:f,trackEvent:m}),$=d.useMemo(()=>{const Le=p?.side_by_side_metadata?.sibling_uuid;return Le?vt.getItem(`sbs-banner-dismissed-${Le}`)==="true":!1},[p?.side_by_side_metadata?.sibling_uuid]),G=d.useMemo(()=>i.length>1,[i]),H=d.useMemo(()=>p?.side_by_side_metadata?.sibling_uuid,[p]),Q=d.useMemo(()=>p?.display_model==="pplx_study",[p?.display_model]),Y=d.useMemo(()=>j?!$&&(R||G&&I):!1,[$,j,G,R,I]),te=d.useCallback(()=>{H&&vt.setItem(`sbs-banner-dismissed-${H}`,"true")},[H]);d.useEffect(()=>{Y&&U()},[Y,U]);const[se,ae]=d.useState(!1),X=d.useMemo(()=>P.map(Le=>qt.parseAskTextField(Le)??void 0).filter(Le=>Le!==void 0),[P]),ee=d.useCallback(async Le=>{try{L(Le);const gt=P[0]?.side_by_side_metadata?.sibling_uuid;await o_e(Le,P,gt,D),ae(!1)}catch(gt){Z.error("Failed to process answer selection:",gt)}},[P,D,L]),le=d.useCallback(()=>{ae(!0),O()},[O]),re=d.useCallback(async()=>{if(p.upsell_information?.upsell_type!=="WAIT_FOR_CONNECTOR_AUTH_CONFIRMATION")return;const Le=p?.backend_uuid;Le&&await cl({uuid:Le,event_type:"CONNECTOR_AUTH",connector_auth_action:!1})},[p?.backend_uuid,p.upsell_information?.upsell_type]),ce=d.useMemo(()=>i.some(Le=>qt.isStatusPending(Le)),[i]),ue=d.useMemo(()=>{if(!p?.query_str)return"";const{actualQuery:Le}=qx(p.query_str);return Le||""},[p?.query_str]),me=d.useCallback(()=>ae(!1),[]),we=d.useMemo(()=>!u,[u]),ye=d.useRef(null),{hasAccessToProFeatures:_e}=$t();bJ({entryUUID:p?.backend_uuid??"",target:ye,targetVisibilityPortionThreshold:.3,frontendContextUUID:p?.frontend_context_uuid??"",hasLLMToken:y});const ke=un(),De=mFe(),xe=bH(p?.frontend_uuid),Ue=o1e(p?.backend_uuid),Ee=qt.isStatusFailed(p),Ke=Ee&&p.reconnectable&&xe;d.useEffect(()=>{ke.maybeSendSearchResult(g,v,b)},[b,M,g,ke,v]);const Nt=d.useCallback(()=>{N(p.backend_uuid??"")||hx("Retry stream")},[p.backend_uuid,N]),pe=d.useMemo(()=>()=>l.jsx(Kf,{retryFn:Nt,errorCode:Ue?.code}),[Nt,Ue?.code]),ve=d.useMemo(()=>Q&&(k+1)%Ahe===0,[Q,k]),Ae=a&&!ve,We=E,Gt=d.useMemo(()=>!!(_||x||We||!w&&(S||E)),[_,x,We,w,S,E])?"thread":"steps";return l.jsxs(l.Fragment,{children:[Y&&l.jsx(Goe,{onClick:le,didSelectAnswer:R,onDismiss:te}),p?.connector_auth_info&&l.jsx(Ayt,{connectorAuthInfo:p.connector_auth_info,isLastResult:T,backendUuid:p?.backend_uuid,inFlight:h}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx(Jd,{position:"top",idx:k,upsellInformation:p.blocking_banner_information,backendUuid:p?.backend_uuid,isLastResult:T,inFlight:h,onReject:re})}),De&&h&&l.jsx(fFe,{data:De}),l.jsxs(Dp,{value:Gt,animation:"fade",children:[l.jsx(Dp.Panel,{value:"steps",children:l.jsx(Ty,{defaultExpanded:!0,forceLoadingHeader:!0})}),l.jsx(Dp.Panel,{value:"thread",children:l.jsx(Cde,{children:l.jsxs("div",{className:"gap-y-md flex flex-col",children:[!E&&l.jsx(Ty,{}),l.jsx(wde,{submitQuery:e}),E&&l.jsx(Ty,{}),l.jsx(jyt,{submitQuery:e,setQuote:o,markdownRef:F,response:g}),_e&&j&&C&&l.jsx(Kue,{taskWidgetData:C,submitQuery:e}),l.jsx(Nyt,{submitQuery:e,deleteLastResult:s,showSourcesSidebar:we,markdownRef:F}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx(Jd,{position:"bottom",idx:k,upsellInformation:p.upsell_information,backendUuid:p?.backend_uuid,isLastResult:T,inFlight:h,contextUuid:p?.context_uuid})})]})})})]}),l.jsxs("div",{className:"gap-y-lg flex flex-col first:mt-0",children:[Ee&&!Ke&&l.jsx(Mr,{fallback:pe,children:l.jsx(Sde,{streamId:Ue?.id.description??"unknown",backendUuid:Ue?.entryId??"unknown"})}),Ae&&l.jsx(Ryt,{shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,submitQuery:e}),ve&&l.jsx(Dyt,{onClick:e})]}),G&&l.jsx(Iyt,{isOpen:se,onClose:me,responses:X,queryStr:ue,onSelectAnswer:ee,isAnyEntryPending:ce})]})});Ede.displayName="LowerPriorityThreadContent";const Pyt=e=>{const{result:{classifier_results:t,query_source:n}}=It(),r=h6(),{classifierResults:s}=Qn(),o=t,a=typeof o<"u",i=s[e],c=typeof i<"u",u=n==="default_search";return d.useEffect(()=>{u&&(a&&r("web.frontend.browser.mhe_loaded_ms"),c&&r("web.frontend.browser.mhe_extension_loaded_ms"))},[a,c,u,r]),i??o},Oyt=(e,t,n)=>{const{value:r,loading:s}=kf({flag:"nav_results_count_classifier",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Lyt=(e,t,n)=>{const{value:r,loading:s}=kf({flag:"nav-intent-classifier",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Fyt=(e,t)=>t.classifier==="comet_nav_widget"?e.mhe_predictions_full?.comet_nav_widget:t.classifier==="comet_nav_widget_combined_target"?e.mhe_predictions_full?.comet_nav_widget_combined_target:e.mhe_predictions_full?.comet_nav_widget,Byt=(e,t)=>{const n=Ca(),r=Fyt(e,t);if(!n)return"top";if(t.use_default_threshold)return r?.is_true?"top":"hidden";const o=t.threshold,a=r?.probability,i=a!=null&&!isNaN(a)&&!isNaN(o)&&a>=o;return r&&i?"top":"hidden"},Uyt=(e,t)=>{if(!t)return"hidden";const n=t?.mhe_predictions;return n?.personal_search||n?.skip_search||n?.image_generation_intent||n?.time_widget||n?.weather_widget||n?.calculator_widget?"hidden":e.classifier==="nav_intent"?"top":e.classifier==="comet_nav_widget"||e.classifier==="comet_nav_widget_combined_target"?Byt(t,e):"top"},Vyt={classifier:"nav_intent",use_default_threshold:!0,threshold:0},Hyt=({classifierResults:e,resultStatus:t})=>{const n=typeof e>"u",{variation:r,loading:s}=Lyt(Vyt),o=Uyt(r,e),a=d.useMemo(()=>s||n||Object.keys(e??{}).length===0&&t==="COMPLETED"?!0:o==="hidden",[o,n,e,t,s]),i=d.useMemo(()=>!n,[n]);return d.useMemo(()=>({shouldHideNavResults:a,classificationsLoaded:i,navResultsPosition:o}),[a,i,o])},zyt=2,Wyt={classifier_name:"comet_nav_widget",number:2,threshold:.2,use_default_threshold:!0},kde=A.memo(({sbsEntriesGroup:e,submitQuery:t,shouldShowProductFeedback:n,feedbackEntryUUID:r,shouldShowRecruitmentBanner:s,deleteLastResult:o,setQuote:a})=>{const{isMobileStyle:i}=Re(),c=Yt(),u=h6(),{result:f,response:m,hasLLMToken:p,searchMode:h,isFirstResult:g,webResults:y,steps:x,isPending:v}=It();QOe(),YOe();const b=W4(),_=d.useMemo(()=>{if(!f?.query_str)return"";const{actualQuery:ee}=qx(f.query_str);return ee||""},[f?.query_str]),w=d.useMemo(()=>!i,[i]),S=d.useRef(null);bJ({entryUUID:f?.backend_uuid??"",target:S,targetVisibilityPortionThreshold:.3,frontendContextUUID:f?.frontend_context_uuid??"",hasLLMToken:p});const{variation:C,loading:E}=Oyt(Wyt),T=f?.frontend_uuid,k=Pyt(T??""),I=d.useMemo(()=>Math.max(uLe(k,C,E),zyt),[k,C,E]),{trackCitationClickEvent:M,navigationResults:N}=oLe({allowedNavResultsCount:I,entry:f,webResults:y,showSourcesSidebar:w,searchMode:h,isFirstResult:g}),D=An(),j=un(),{navigationResults:F}=Qn(),R=F[T??""]??Pe,P=bH(T),L=d.useMemo(()=>R.length>0,[R]),U=d.useMemo(()=>D&&(R.length||P)?R:N||Pe,[D,R,N,P]),O=d.useMemo(()=>U?{serverRequestTimestamp:c.getQueryData(["serverRequestTimestamp",f?.query_str??void 0,f?.uuid??void 0])}:{serverRequestTimestamp:void 0},[c,f?.query_str,U,f?.uuid]),$=d.useMemo(()=>U?.slice(0,I)?.map((ee,le)=>({...ee,position:le,source:O.serverRequestTimestamp?"default_search":"client_search",client_request_timestamp:b(),unstable_server_request_timestamp:O.serverRequestTimestamp||void 0,sitelinks:ee.sitelinks?.map((re,ce)=>({url:re.url,title:re.title,position:ce,snippet:re?.snippet??""})),is_comet_navigation:L,navigation_source:L?Ld.COMET:"navigation_source"in ee?ee.navigation_source:void 0})),[b,U,O.serverRequestTimestamp,L,I]),G=d.useMemo(()=>!!y&&y.length>0,[y]),H=d.useMemo(()=>f?.search_focus==="writing",[f?.search_focus]),Q=d.useMemo(()=>f?.display_model==="pplx_study",[f?.display_model]),{shouldHideNavResults:Y,navResultsPosition:te}=Hyt({classifierResults:k,resultStatus:f?.status??""}),se=d.useMemo(()=>g&&!1,[Y,$,f.attachments?.length,H,h,Q,g]),ae=d.useMemo(()=>se&&te==="top",[se,te]);d.useEffect(()=>{j.maybeSendSearchResult(m,x,v)},[v,G,m,j,x]);const X=d.useCallback(()=>{f?.query_source==="default_search"?u("web.frontend.omnisearch_nav_results_shown",{omnisearch:b()!==0,is_comet_navigation:L}):u("web.frontend.nav_results_shown",{is_comet_navigation:L})},[L,f?.query_source,u,b]);return l.jsxs("div",{className:"gap-y-md mt-md flex flex-col",ref:S,children:[ae&&l.jsx(kJ,{navResults:$,queryStr:_,querySource:f?.query_source,backendUUID:f?.backend_uuid,frontendUUID:f?.frontend_uuid,trackCitationClickEvent:M,onMount:X}),l.jsx(Ede,{submitQuery:t,shouldShowProductFeedback:n,feedbackEntryUUID:r,shouldShowRecruitmentBanner:s,deleteLastResult:o,setQuote:a,shouldShowNavResults:se,sbsEntriesGroup:e})]})});kde.displayName="ThreadContent";const Gyt=Ce(async()=>{const{ThreadEntryDebugTiming:e}=await Se(()=>q(()=>import("./ThreadEntryDebugTiming-qoiCHgUu.js"),__vite__mapDeps([482,4,1,6,3,124,8,9,7,125,10,11,12])));return{default:e}},{restricted:!0}),$yt=Ce(async()=>{const{BugReportModal:e}=await Se(()=>q(()=>import("./DebugModal-CnQSSY34.js"),__vite__mapDeps([483,4,1,8,3,9,6,7,475,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),qyt=({isLastResult:e,title:t,backend_uuid:n,width:r,children:s})=>{const{openModal:o}=pn().updated,a=d.useCallback(()=>{o($yt,{legacyIdentifier:"bugReportModal"})},[o]);return l.jsx("div",{className:"bg-base erp-sidecar:pt-0 erp-mobile-sidecar:pt-0",children:l.jsxs("div",{className:z("mx-auto",{"max-w-threadContentWidth":r==="default","max-w-none":r==="full","max-w-threadWidth":r==="wide"}),children:[t&&l.jsx("div",{className:"max-w-threadContentWidth relative isolate z-20 mx-auto",children:t}),s&&l.jsx("div",{className:"mt-xs",children:s}),l.jsx(Gyt,{backend_uuid:n,onBugReportClick:a,expandedDefault:e})]})})},Kyt=A.memo(qyt),Mde=A.memo(({submitQuery:e})=>{const t="trigger-entry-rewrite",n=fn(),{result:{backend_uuid:r,frontend_context_uuid:s,attachments:o,display_model:a,query_str:i},idx:c}=It(),u=g0(),f=window.location.hash.slice(1),m=parseInt(f,10),p=n?.get("rw")==="true";return d.useEffect(()=>{if(!p||isNaN(m)||c!==m)return;lE({rw:void 0});const h=()=>e({rawQuery:i??"",existingEntryUUID:r,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:u?void 0:s,promptSource:"user",querySource:"rewrite-url-param",attachments:o,modelPreferenceOverride:a});r?au({entryUUID:r,reason:t}).catch(g=>{Z.error("Error terminating entry",g)}).finally(h):h()},[p,u,e,m,c,r,i,s,o,a]),null});Mde.displayName="TriggerEntryRewrite";const Tde=A.memo(()=>l.jsx(br,{children:l.jsx(K,{variant:"subtler",className:"h-[180px] w-full overflow-hidden rounded-xl [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]"})}));Tde.displayName="JobsModeLoader";const x0=A.memo(({type:e,className:t,queryString:n})=>{const r=J(),s=d.useMemo(()=>{const o="font-medium",a="opacity-80";switch(e){case"images":return r.formatMessage({defaultMessage:"Image results for: {queryString}",id:"VzXivLJ8I5"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"videos":return r.formatMessage({defaultMessage:"Video results for: {queryString}",id:"2ZaRrQuRh/"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"sources":return r.formatMessage({defaultMessage:"Search results for: {queryString}",id:"Fjmx7PbD5i"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"shopping":return r.formatMessage({defaultMessage:"Shopping results for: {queryString}",id:"pB1ogBtGI4"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"jobs":return r.formatMessage({defaultMessage:"Job results for: {queryString}",id:"NLhbH5fRMB"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"places":return r.formatMessage({defaultMessage:"Place results for: {queryString}",id:"0FDKKyti5d"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});default:return""}},[n,e,r]);return n?l.jsx(V,{variant:"small",color:"light",className:z("mb-md",t),children:s}):null});x0.displayName="ResultsLabel";const Ade=d.memo(()=>{const{isMobileStyle:e}=Re();return l.jsxs(l.Fragment,{children:[l.jsx(x0,{type:"shopping",queryString:""}),l.jsxs(br,{className:"-mx-md pl-md md:mx-auto md:pl-0",children:[l.jsx("div",{className:"gap-md md:mb-lg mb-md flex auto-rows-fr grid-cols-2 overflow-hidden md:grid md:grid-cols-3",children:Array.from({length:3}).map((t,n)=>l.jsx(Nde,{},n))}),l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1 items-center",children:[l.jsx(V,{variant:e?"base":"section-title",className:"col-start-1 row-start-1",children:" "}),l.jsx("div",{className:"bg-subtler col-start-1 row-start-1 h-3 w-32 grow rounded-full md:h-4"})]}),l.jsx("div",{className:"gap-md pr-md flex auto-rows-fr grid-cols-2 flex-col md:grid md:pr-0",children:Array.from({length:2}).map((t,n)=>l.jsx(Rde,{},n))})]})]})]})});Ade.displayName="ShoppingModeLoader";const Nde=d.memo(()=>l.jsx("div",{className:"bg-subtler aspect-video h-[327px] w-[70vw] grow rounded-xl md:h-[413px] md:w-full"}));Nde.displayName="Item";const Rde=d.memo(()=>l.jsx("div",{className:"bg-subtler aspect-video h-[144px] w-full grow rounded-md"}));Rde.displayName="SmallItem";const Yyt=10,Qyt=async({request:e,reason:t})=>{if(e.page&&e.page>Yyt)throw new he("API_CLIENTS_ERROR",{message:"Max search results page number is too large",status:400});const{data:n}=await de.POST("/rest/sources/search",t,{body:{entry_uuid:e.entry_uuid,limit:e.limit,page:e.page??null},timeoutMs:Cn.MEDIUM});return n},Xyt=({reason:e})=>{const{mutate:t,data:n,isPending:r}=Rt({mutationFn:async s=>(await Qyt({request:s,reason:e})).results});return d.useMemo(()=>({isSearchResultsLoading:r,searchResults:n,fetchSearch:t}),[t,r,n])},Km="line-clamp-1 leading-[0.875rem]",Dde=A.memo(({webResult:e,citationIndex:t,isRelatedResult:n,linkOnClick:r,imageToShow:s})=>{const{$t:o,formatDate:a}=J(),[i,c]=d.useState(!1),u=d.useMemo(()=>Ur(e.url),[e.url]),f=d.useMemo(()=>$c(e.url),[e.url]),m=e.is_client_context,p=Ca(),{isMobileStyle:h}=Re(),g=d.useMemo(()=>e.meta_data?.domain_name??u.replace(/\.[^.]*$/,""),[u,e.meta_data?.domain_name]),y=kr(e.url),x=Uf(e),v=q2e(e),b=e.meta_data?.connection_type,_=fN(),w=e.file_metadata?.file_repository_type,S=!m||p||!x,C=yb(e),E=DKe(e),T=Wg(e),k=()=>w=="COLLECTION"?o({defaultMessage:"Space Context",id:"wGTk8CFt1g"}):w=="USER"?o({defaultMessage:"My Files",id:"AjhJXSvkRs"}):w=="ORG"?o({defaultMessage:"Org Files",id:"DaFSYzpM1Q"}):o({defaultMessage:"Attachment",id:"eLCAEP8LHj"}),I=()=>e.file_metadata?.file_repository_type=="COLLECTION"?o({defaultMessage:"File",id:"gyrIElu9qY"}):e.meta_data?.connection_type?eCe(e.meta_data.connection_type):o({defaultMessage:"Local upload",id:"fscjAJoLwa"}),M=d.useMemo(()=>l.jsx(NA,{size:"tiny",showBackground:!1,rounded:!1,user:Zwe(b)??void 0}),[b]);let N=null,D="",j=null;if(y||v||b&&b!==Zn.WILEY)N=l.jsx("div",{className:"bg-subtler flex size-6 items-center justify-center rounded-full",children:b?l.jsx(ge,{icon:ype,size:"xl",badge:M}):l.jsx(ge,{icon:B("file"),className:"size-md",size:"xl"})}),j=l.jsx(V,{variant:"micro",color:"light",className:Km,children:I()}),D=k();else if(C&&!T)N=l.jsx("div",{className:"bg-subtle flex size-6 items-center justify-center rounded-full",children:l.jsx(ge,{size:"xl",icon:e.is_memory?B("bubble-text"):B("list-search")})}),j=l.jsx(V,{variant:"micro",color:"light",className:Km,children:e.timestamp&&a(e.timestamp,{dateStyle:"long"})}),D=e?.is_memory?o({defaultMessage:"Memory",id:"dVx3yznM2C"}):o({defaultMessage:"Library",id:"StcK672jB9"});else{const F=b===Zn.WILEY?Fd:void 0;N=l.jsx(Po,{size:24,domain:f,className:"size-full rounded-full",overrideIconUrl:F}),D=g,j=T?l.jsxs("div",{className:"gap-xs -ml-two flex flex-row items-center",children:[l.jsx(V,{variant:"tiny",color:"super",className:"-translate-y-px",children:l.jsx(ge,{size:"xs",icon:B("user-search")})}),l.jsx(V,{variant:"micro",color:"super",className:Km,children:l.jsx(je,{defaultMessage:"Personal Search",id:"TZougEncQH",description:"subtitle"})})]}):l.jsx(V,{variant:"micro",color:"light",className:Km,children:iz(az(e.url))})}return l.jsx("div",{className:"gap-md relative items-start",children:l.jsxs("div",{className:"gap-lg relative flex w-full flex-row items-start lg:pl-0",children:[l.jsxs("div",{className:"flex min-w-0 grow flex-col",children:[l.jsxs(yt,{href:e.url,className:z("group/source flex flex-1 flex-col gap-1",{"cursor-pointer":!y&&S}),onClick:r,children:[l.jsxs("div",{className:"gap-sm flex flex-row items-center",children:[l.jsx("div",{className:"size-6 shrink-0",children:N}),l.jsxs("div",{className:"flex flex-1 flex-col",children:[l.jsx("div",{className:"flex flex-row items-center gap-1.5",children:l.jsxs(V,{variant:"tiny",className:Km,color:"light",children:[!n&&t&&!_?t+". ":null,D]})}),j]}),C&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ge,{size:"xs",icon:B("user-search")})})]}),E?null:l.jsx(V,{variant:h?"baseSemi":"section-title",color:"super",className:z("decoration-super/50 duration-normal line-clamp-1 decoration-1 underline-offset-2 transition-colors",{"group-hover/source:underline":!y&&S}),children:e.name})]}),l.jsx(V,{variant:"small",color:"light",className:z("line-clamp-3 whitespace-pre-wrap leading-snug",{"pt-2":E}),children:e.meta_data?.generated_file_description??e.meta_data?.description??e.snippet})]}),s&&l.jsxs(yt,{href:e.url,className:z("relative ml-auto aspect-square h-fit w-20 shrink-0 cursor-pointer overflow-hidden rounded-md pt-1",{hidden:!i,"sm:block":i}),onClick:r,children:[l.jsx(Wo,{src:s,alt:"image",containerClassName:"absolute inset-0",imageClassName:"absolute inset-0 object-cover object-center w-full h-full",includeLightBoxModal:!1,onLoad:()=>c(!0)}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-[black]/10 dark:border-transparent"})]})]})})});Dde.displayName="PrimitiveSourcesRow";const jde=A.memo(({webResult:e,citationIndex:t,isRelatedResult:n})=>{const r="sources-row",{result:{backend_uuid:s,context_uuid:o,frontend_context_uuid:a}}=It(),i=un(),c=An(),u=kr(e.url),f=Uf(e),{session:m}=Ne(),{trackEvent:p}=Xe(m),h=d.useCallback((E,T)=>{c&&i.openTab({url:E,tabId:T})},[c,i]),{mutate:g}=Wv({reason:r,onSuccess:c?h:void 0}),y=oN(),x=yb(e),v=Wg(e),{getImageDownloadUrl:b}=Mv({reason:r}),[_,w]=d.useState(null);d.useEffect(()=>{_===null&&(async()=>{if(!u){w(e.url);return}if(A4(e.url)){w(e.url);return}try{const T=await b({url:e.url,thread_id:s});w(T)}catch(T){Z.error(`Failed to fetch image source ${T}`),w(e.url)}})()},[b,s,e,u,_]),d.useEffect(()=>{p("source card viewed",{citation_url:e.url,position:t,title:e.name,contextUUID:o,frontendContextUUID:a,entryUUID:s,source:n?"sourcesTabViewMore":"sourcesTab"})},[e,p,t,n,o,a,s]);const S=d.useCallback(async E=>{try{const k=e.meta_data?.file_uuid?"fileRepositoryFile":e.is_attachment?"fileAttachment":n?"sourcesTabViewMore":"sourcesTab",I=sN(e),{type:M,memoryKey:N}=I,D=Gg(e);p("click citation",{citation_url:e.url,contextUUID:o,frontendContextUUID:a,entryUUID:s,isMemory:e.is_memory,isConversationHistory:e.is_conversation_history,source:k,...D,...M==="memory"&&{memory_key:N}})}catch(k){Z.error("Failed to send click citation event:",k)}if(x&&!v){E.preventDefault(),y(e);return}if(f){E.preventDefault();return}if(Yl(e)){E.preventDefault(),g({file_url:e.url});return}if(Dx(E)){E.preventDefault(),i.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")});return}},[x,e,n,p,o,a,s,y,i,g,v,f]),C=d.useMemo(()=>{if(u)return _;if(typeof e.meta_data?.image_url=="string")return e.meta_data.image_url;if(typeof e.meta_data?.images?.[0]=="string")return e.meta_data.images[0];if(typeof e.meta_data?.images?.[0]?.src=="string")return e.meta_data.images[0].src},[u,e,_]);return l.jsx(Dde,{webResult:e,citationIndex:t,isRelatedResult:n,linkOnClick:S,imageToShow:C})});jde.displayName="SourcesRow";function Zyt(){const{blocksByIntendedUsage:{answer_tabs:e},steps:t,result:{query_str:n}}=It(),r=d.useMemo(()=>{const s=e?.answer_tabs_block?.reformulated_queries??[];if(s[0])return s[0];const o=t.find(a=>a.step_type==="SEARCH_WEB")?.content.queries?.[0]?.query;return o||(n??"")},[e?.answer_tabs_block?.reformulated_queries,n,t]);return d.useMemo(()=>({reformulatedQuery:r}),[r])}const Jyt=10,Ide=A.memo(()=>{const e="sources-mode",{$t:t}=J(),n=e2t({dedupeAttachments:!0}),{isEntryInFlight:r,result:s}=It(),{firstResult:o}=on(),{reformulatedQuery:a}=Zyt(),{fetchSearch:i,isSearchResultsLoading:c}=Xyt({reason:e}),f=s===o?s.query_str??"":a,[m,p]=d.useState(1),[h,g]=d.useState([]),y=Wt(),{openModal:x}=pn().legacy,v=d.useMemo(()=>m==1&&y&&!r&&n.selectedSources.length==0&&n.reviewedSources.length==0&&n.unsortedSources.length==0,[m,r,y,n.reviewedSources.length,n.selectedSources.length,n.unsortedSources.length]),[b,_]=d.useState(!1),w=d.useCallback(()=>{if(b)return;const E=m+1;i({entry_uuid:s.backend_uuid??"",limit:Jyt,page:E},{onSuccess:T=>{g([...h,...T]),p(E)}})},[m,i,b,h,s.backend_uuid]);d.useEffect(()=>{v&&(w(),_(!0))},[w,v]),d.useCallback(()=>{if(!y){x("loginModal",{origin:ft.SOURCES_VIEW_MORE});return}w()},[w,y,x]);const S=!1,C=d.useMemo(()=>n.attachedSources.length>0||n.selectedSources.length>0||n.reviewedSources.length>0||n.reviewingSources.length>0||n.unsortedSources.length>0,[n.attachedSources.length,n.selectedSources.length,n.reviewedSources.length,n.reviewingSources.length,n.unsortedSources.length]);return l.jsxs(l.Fragment,{children:[l.jsx(x0,{type:"sources",queryString:f,className:C?"pb-sm":void 0}),l.jsxs("div",{children:[l.jsx(Zu,{heading:n.selectedSources?.length>0?t({defaultMessage:"Attached",id:"2IacYt8NB7"}):void 0,sources:n.attachedSources}),l.jsx(Zu,{heading:n.attachedSources?.length>0?t({defaultMessage:"Sourced",id:"P5KqlvUgRC"}):void 0,sources:n.selectedSources}),l.jsx(Zu,{heading:t({defaultMessage:"Reviewed",id:"wiy+GNv+BV"}),sources:n.reviewedSources}),l.jsx(Zu,{heading:t({defaultMessage:"Reviewing",id:"L+ISAVX7+d"}),sources:n.reviewingSources,shimmer:!0}),l.jsx(Zu,{sources:n.unsortedSources}),S]})]})});Ide.displayName="SourcesMode";const Zu=A.memo(({sources:e,heading:t,shimmer:n=!1})=>e.length===0?null:l.jsxs("div",{className:"my-md md:mt-lg group first:mt-0",children:[t?l.jsxs("div",{className:"mb-md relative",children:[l.jsx("hr",{className:"bg-subtle absolute top-1/2 h-px w-full border-0 group-first:hidden"}),l.jsx("div",{className:"bg-base",children:l.jsx(V,{variant:"tiny",color:"light",className:"mb-md bg-base pr-sm relative z-[1] w-fit",children:l.jsx(br,{variant:"super",active:n,as:"span",children:t})})})]}):null,l.jsx(K,{className:"flex min-w-0 flex-col gap-4 md:gap-8",children:e.map(r=>l.jsx(jde,{webResult:r.web_result,citationIndex:r.citation},r.web_result?.url))})]}));Zu.displayName="SourcesModeSection";const e2t=({dedupeAttachments:e=!1})=>{const{result:t,blocksByIntendedUsage:{web_results:n}}=It(),r=t2t({attachments:t.attachments??Pe});return d.useMemo(()=>{const s=new Map,o=[],a=(n?.web_result_block?.web_results??[]).map(h=>({status:vm.UNSORTED,web_result:h,citation:0})),i=a.some(h=>h.web_result?p3(h.web_result):!1);for(const h of a){const g=h.web_result?.is_attachment&&!p3(h.web_result);if(g&&o.push(h),!g||!e){const y=s.get(h.status)??[];y.push(h),s.set(h.status,y)}}const c=s.get(vm.SELECTED)??Pe,u=s.get(vm.REVIEWED)??Pe,f=s.get(vm.REVIEWING)??Pe,m=s.get(vm.UNSORTED)??Pe;!i&&o.length===0&&r.length>0&&o.push(...r);const p=[...c,...u,...f,...m].slice(0,3)?.map(h=>h.web_result?.url??"");return{attachedSources:o,selectedSources:c,reviewedSources:u,reviewingSources:f,unsortedSources:m,topSources:p}},[n?.web_result_block?.web_results,r,e])},t2t=({attachments:e})=>e.map(t=>({web_result:{name:cu(t),url:t,is_attachment:!0,is_image:kr(t),is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!1,sitelinks:[],snippet:"",timestamp:"",meta_data:{},inline_entity_id:""},status:"UNKNOWN",citation:0})),$8=A.memo(()=>l.jsxs("div",{className:"gap-md @container flex w-full flex-row",children:[l.jsx("div",{className:"md:@[1458px]:w-[874px] md:@[1458px]:shrink-0 w-full md:w-3/5",children:l.jsx(Ode,{})}),l.jsx("div",{className:"@md:w-[570px] @md:@[1458px]:w-full hidden md:block",children:l.jsx(Pde,{})})]}));$8.displayName="PlacesModeLoader";const Pde=A.memo(()=>l.jsx(br,{children:l.jsx(K,{variant:"subtler",className:"sticky h-[180px] w-full overflow-hidden rounded-xl [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]"})}));Pde.displayName="PlacesModeMapLoader";const Ode=A.memo(()=>l.jsx(br,{children:l.jsx("div",{className:"gap-md grid h-[180px] grid-cols-[repeat(auto-fill,minmax(220px,1fr))] overflow-hidden [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]",children:Array.from({length:8}).map((e,t)=>l.jsx(Lde,{},t))})}));Ode.displayName="PlacesModeGridLoader";const Lde=A.memo(()=>l.jsx("div",{className:"bg-subtler aspect-[4/3] w-full rounded-xl"}));Lde.displayName="Item";const n2t=Ce(async()=>{const{ShoppingMode:e}=await Se(()=>q(()=>import("./ShoppingMode-q3eSRhKN.js"),__vite__mapDeps([484,4,1,8,3,9,6,7,485,471,472,81,47,49,50,42,79,38,486,57,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ade,{})}),r2t=Ce(async()=>{const{HotelsMode:e}=await Se(()=>q(()=>import("./HotelsMode-rYYctIE3.js"),__vite__mapDeps([487,4,1,485,8,3,9,6,7,488,42,486,79,38,10,11,12])));return{default:e}},{loading:()=>l.jsx($8,{})}),s2t=Ce(async()=>{const{JobsMode:e}=await Se(()=>q(()=>import("./JobsMode-JXrdyUQd.js"),__vite__mapDeps([489,4,1,6,3,8,9,7,42,473,10,11,12])));return{default:e}},{loading:()=>l.jsx(Tde,{})}),o2t=Ce(async()=>{const{VideosMode:e}=await Se(()=>q(()=>import("./VideosMode-Hf9Cgtle.js"),__vite__mapDeps([490,4,1,6,3,9,7,491,8,42,486,10,11,12])));return{default:e}},{loading:()=>l.jsx(x0,{type:"videos",queryString:""})}),a2t=Ce(async()=>{const{ImagesMode:e}=await Se(()=>q(()=>import("./ImagesMode-Bcsp5jfV.js"),__vite__mapDeps([492,4,1,6,3,9,7,491,8,42,81,47,469,486,10,11,12])));return{default:e}},{loading:()=>l.jsx(x0,{type:"images",queryString:""})}),i2t=Ce(async()=>{const{MapsMode:e}=await Se(()=>q(()=>import("./MapsMode-DBIttjNw.js"),__vite__mapDeps([493,4,1,8,3,9,6,7,485,488,42,486,79,38,10,11,12])));return{default:e}},{loading:()=>l.jsx($8,{})}),l2t=Ce(async()=>{const{AssetsMode:e}=await Se(()=>q(()=>import("./AssetsMode-7Ja3lHRt.js"),__vite__mapDeps([494,4,1,6,3,102,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(ZZ,{})}),Fde=A.memo(({children:e,isFirstResult:t=!1,isLastResult:n=!1,hasParent:r=!1,mode:s,width:o})=>l.jsx(K,{className:z({"pt-[var(--thread-visual-spacing)]":!t,"md:pt-lg":s==="default"&&!(t&&r),"pb-[var(--thread-visual-spacing)]":!0,"pb-lg":"","px-[var(--thread-visual-spacing)]":!0,"md:px-lg":o==="wide"}),children:e}));Fde.displayName="ThreadEntryLayout";function c2t(e){const{result:{backend_uuid:t,frontend_context_uuid:n,attachments:r,display_model:s,sources:o}}=It(),a=g0();return d.useCallback(i=>{if(!n){Z.warn(new Error(`No frontend UUID for thread backendUUID=${t}`));return}e({rawQuery:i,existingEntryUUID:t,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:a?void 0:n,promptSource:"user",querySource:"edit",attachments:r,modelPreferenceOverride:s,sourcesOverride:Fx(o?.sources)})},[t,n,a,r,o,s,e])}const Bde=A.memo(({sbsEntriesGroup:e,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o,lastResultBuffer:a})=>{const{currentModeData:i}=g6(),{result:{backend_uuid:c,attachments:u,status:f,query_str:m,parent_info:{mode:p,url_slug:h}={},side_by_side_metadata:g},isEntryInFlight:y,webResults:x,inFlight:v,isFailed:b,selectedRefinementQuery:_,isFirstResult:w,isLastResult:S,submitQuery:C,scrollToListItem:E,idx:T}=It(),{results:k}=on(),I=c2t(C),M=!!(p&&h),N=d.useCallback(()=>{E?.(T,{smooth:!0})},[E,T]);d.useEffect(()=>{typeof window>"u"||f!=="PENDING"||N()},[y,f,N]);const D=u&&u.length>0,j=qt.hasUnspecifiedSelectionStatus(g)&&qt.hasMultipleSiblingEntries(k,g?.sibling_uuid),F=d.useMemo(()=>l.jsx(eJ,{entryUUID:c,onSubmitEdit:I,isFirstResult:w,hasAttachments:D,inFlight:v,isFailed:b,isEditDisabled:j,selectedRefinementQuery:_,queryStr:m??""}),[c,I,w,D,v,b,j,_,m]),R=d.useMemo(()=>{if(!D)return new Map;const G=new Map;for(const H of x)H.url&&H.file_metadata?.file_source&&G.set(H.url,H.file_metadata.file_source);return G},[D,x]),{isMobileStyle:P,isMobileUserAgent:L}=Re(),U=d.useMemo(()=>0,[w,M,P,L]),O=d.useMemo(()=>S&&a?a+(D?52:0):0,[S,a,D]),$=w&&P;return l.jsx("div",{className:z({"erp-sidecar:min-h-[var(--sidecar-content-height)]":S,"erp-mobile-sidecar:min-h-[var(--mobile-sidecar-content-height)]":S,"min-h-[var(--page-content-height)]":S&&!$,"min-h-[var(--mobile-content-height)]":S&&$}),style:{marginTop:U,paddingBottom:O},children:l.jsxs(Fde,{isFirstResult:w,isLastResult:S,hasParent:!!M,mode:i.mode,width:i.width,children:[l.jsx(Mde,{submitQuery:C}),l.jsx(xJ,{webResults:x,children:l.jsxs("div",{className:z("isolate mx-auto",{"max-w-none":i.width==="full","max-w-threadWidth":i.width==="wide","max-w-threadContentWidth":i.width==="default"}),children:[i.mode==="default"&&l.jsx(Kyt,{isLastResult:S,title:F,backend_uuid:c,width:i.width,children:D&&l.jsx(cJ,{attachments:u,backend_uuid:c,fileSourceMap:R})}),l.jsx("div",{className:z("mx-auto",{"max-w-threadWidth":i.width==="wide","max-w-none":i.width==="full","max-w-threadContentWidth":i.width==="default"}),children:l.jsxs(St,{initial:!1,children:[l.jsx(ja,{id:"default",children:l.jsx(kde,{sbsEntriesGroup:e,submitQuery:C,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o})},"default"),l.jsx(ja,{id:"shopping",children:l.jsx(n2t,{})},"shopping"),l.jsx(ja,{id:"hotels",children:l.jsx(r2t,{})},"hotels"),l.jsx(ja,{id:"places",children:l.jsx(i2t,{})},"places"),l.jsx(ja,{id:"jobs",children:l.jsx(s2t,{})},"jobs"),l.jsx(ja,{id:"videos",children:l.jsx(o2t,{})},"videos"),l.jsx(ja,{id:"images",children:l.jsx(a2t,{})},"images"),l.jsx(ja,{id:"sources",children:l.jsx(Ide,{})},"sources"),l.jsx(ja,{id:"assets",children:l.jsx(l2t,{})},"assets")]})})]})})]})})});Bde.displayName="ThreadEntryInner";const u2t=Ft("EntityGroupContext",void 0),Ude=A.memo(({children:e})=>{const[t,n]=d.useState(!1);return l.jsx(u2t.Provider,{value:{viewMoreOpen:t,setViewMoreOpen:n},children:e})});Ude.displayName="EntityGroupProvider";const d2t=e=>{const t=Vv(e);if(t)switch(t.object){case"ShopifyWidget":return!0;default:return!1}return!1},Vde=d.memo(({idx:e,result:t,sbsEntriesGroup:n,isLastResult:r,isFirstResult:s,lastResultBuffer:o})=>{const{inFlight:a}=on(),{scrollToListItem:i}=l6(),{submitQuery:c,shouldShowProductFeedback:u,feedbackEntryUUID:f,shouldShowRecruitmentBanner:m,deleteLastResult:p,setQuote:h}=Ho(),g=d.useCallback(async y=>{a||c(y)},[c,a]);return l.jsx(p6,{idx:e,result:t,inFlight:a,isLastResult:r,isFirstResult:s,scrollToListItem:i,submitQuery:g,children:l.jsx(QZ,{scrollToListItem:i,children:l.jsx(Ude,{children:l.jsx(Bde,{sbsEntriesGroup:n,shouldShowProductFeedback:u,feedbackEntryUUID:f??"",shouldShowRecruitmentBanner:m,deleteLastResult:p,setQuote:h,lastResultBuffer:o})})})})});Vde.displayName="ThreadEntry";const Hde=A.memo(({children:e,forceVisible:t=!1,unmeasuredHeight:n,disableObservation:r,rootMargin:s,threshold:o,root:a,ref:i})=>{const[c,u]=d.useState(0),[f,m]=d.useState(t),[p,h]=d.useTransition(),g=d.useRef(null),y=d.useRef(null);d.useEffect(()=>{const v=g.current,b=y.current;if(!v||!b)return;const _=new ResizeObserver(([S])=>{if(!S)return;if(r?.current){_.unobserve(v),requestAnimationFrame(function E(){r.current?requestAnimationFrame(E):_.observe(v)});return}const C=S.contentRect.height;h(()=>u(E=>C||E))}),w=new IntersectionObserver(([S])=>{if(S){if(r?.current){w.unobserve(v),requestAnimationFrame(function C(){r.current?requestAnimationFrame(C):w.observe(v)});return}h(()=>m(S.isIntersecting))}},{rootMargin:s,threshold:o,root:a});return _.observe(v),t||w.observe(b),()=>{_.disconnect(),w.disconnect()}},[t,n,s,o,a,r]);const x=d.useCallback(v=>{g.current=v,i instanceof Function?i(v):i&&(i.current=v)},[i]);return l.jsx("div",{style:t?void 0:{minHeight:`${c||n}px`},ref:y,children:l.jsx("div",{ref:x,children:t||f?e:null})})});Hde.displayName="LazyContainer";const hU=1e3,f2t=1,gU=3,zde=A.memo(e=>{const t="thread",{openToast:n}=hn(),r=D4(b=>b.results),{setQuote:s}=Ho(),{scrollContainerRef:o}=ka(),{refs:a,isScrollingRef:i}=l6(),c=On(),[u,f]=d.useState(!1),m=J(),{activeThreadTab:p}=kg();LIe({reason:t});const h=d.useMemo(()=>{const b=P4(r?.length?r:e.placeholderResults||[]);return p!=="default"?ZIe(b,p)??b.slice(-1):b},[r,e.placeholderResults,p]);d.useEffect(()=>{h.some(_=>_[0]?.has_expired_attachments)&&n({message:m.formatMessage({id:"zR3dvwKUWo",defaultMessage:"Some files have expired. Please reupload files to continue."}),variant:"error",timeout:3})},[h,n,m]);const g=d.useMemo(()=>{if(typeof window>"u")return-1;const b=window.location.hash.slice(1);return b?Number.isNaN(Number(b))?h?.findIndex(_=>_[0]?.backend_uuid===b):Number(b):-1},[h]),y=d.useCallback((b,_)=>{_?a[b]={current:_}:delete a[b]},[a]),x=d.useCallback((b,_)=>b=_-gU||!u&&b<=g,[g,u]);d.useEffect(()=>{if(~g){const b=setTimeout(()=>{f(!0)},1e4);return()=>{clearTimeout(b)}}},[g]),d.useEffect(()=>{const b=o.current;return b&&(b.scrollTop=0),()=>{f(!1)}},[c,o]),d.useEffect(()=>()=>{s(null)},[]);const v=d.useMemo(()=>h.map((b,_)=>{const w=b[0],S=_===0,C=_===h.length-1;return w?l.jsx(Wde,{result:w,resultsGroup:b.length>1?b:Pe,isLastResult:C,isFirstResult:S,lastResultBuffer:C?e.lastResultBuffer:void 0,forceVisible:x(_,h.length),idx:_,scrollContainerRef:o,setRef:y,isScrollingRef:i},w.uuid||w.backend_uuid):null}),[h,e.lastResultBuffer,x,o,y,i]);return l.jsx("div",{children:v})});zde.displayName="Thread";const Wde=A.memo(({result:e,resultsGroup:t,isLastResult:n,isFirstResult:r,forceVisible:s,idx:o,scrollContainerRef:a,lastResultBuffer:i,setRef:c,isScrollingRef:u})=>{const f=e.attachments?.length>0,m=d.useMemo(()=>()=>l.jsx(Kf,{className:z("pt-headerHeight",{"pb-threadInputHeightWithPadding":n&&!f,"pb-threadAttachmentsHeightWithPadding":n&&f})}),[f,n]),p=d.useCallback(h=>c(o,h),[o,c]);return l.jsx(Mr,{fallback:m,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(Hde,{forceVisible:s,unmeasuredHeight:hU,rootMargin:`${hU*f2t}px 0px`,threshold:0,root:a.current,ref:p,disableObservation:u,children:l.jsx(Vde,{idx:o,result:e,sbsEntriesGroup:t,isLastResult:n,isFirstResult:r,lastResultBuffer:i})})},e.uuid||e.backend_uuid)});Wde.displayName="LazyContainerFactory";const Gde=A.memo(()=>{const{$t:e}=J(),{firstResult:t}=on(),n=t?.parent_info,s=d.useContext(c6)?.activeThreadTab??"default";if(!n?.mode||!n?.url_slug||s!=="default")return null;const o=(()=>{switch(n?.mode){case xd.ARTICLE:return"page";case xd.NOTEPAD:return"notes";default:return"search"}})(),a=!!n?.preview_image_url;return l.jsx(yt,{href:`/${o}/${n?.url_slug}`,children:l.jsxs(K,{variant:"background",bgHover:"subtler",className:"mt-md p-md shadow-subtle relative mx-auto flex justify-between rounded-lg border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs(V,{color:"light",variant:"tiny",className:"mb-xs gap-x-xs flex items-center",children:[l.jsx(ge,{icon:B("git-fork"),size:"xs"}),l.jsx("div",{children:e({defaultMessage:"Follow up to",id:"D3eCB2NeGQ"})})]}),l.jsx(V,{variant:"baseSemi",color:"light",className:"line-clamp-1 break-all",children:n?.title})]}),a&&l.jsx("div",{className:"ml-md shrink-0",children:l.jsx(Wo,{src:n?.preview_image_url,alt:n?.title||"Preview",imageClassName:"h-16 w-16 rounded object-cover",rounded:"sm",fadeIn:!1})})]})})});Gde.displayName="ParentThreadLink";const $de=A.memo(({children:e,className:t,innerClassName:n})=>l.jsx("div",{className:z("px-md md:px-lg","overflow-hidden",t),children:l.jsx("div",{className:z("max-w-threadContentWidth mx-auto",n),children:e})}));$de.displayName="ThreadSectionWrapper";function m2t(e){return e?.length?e.filter(ha):void 0}const p2t=(e,t,n)=>{const r=d.useRef(null),{submitQuery:s}=Ho(),o=Rn(),a=W4();d.useLayoutEffect(()=>{const c=new URL(window.location.href).searchParams,u=c.get("copilot"),f=c.get("pro"),m=c.get("q"),p=c.get("utm_source"),h=c.get("in_page"),g=c.get("attachments"),y=c.get("tabs"),x=c.get("nav_suggestions"),v=c.get("sources"),b=c.get("pc"),_=c.get("pt");b&&V2e(b),_&&W2e(_);const w=c.get("qabi")??void 0,S=g?.replace(/[[\]]/g,"").split(","),C=c.get("newFrontendContextUUID"),E=[];if(y)try{const T=JSON.parse(y);if(Array.isArray(T))for(const k of T)E.push({type:"tab",id:k,url:""})}catch(T){Z.error("Failed to parse tabsParam:",T)}if(e&&m&&!C&&t&&r.current!==t){const T=Array.isArray(m)?m[0]:m,k=c.get("source");if(T==="pending")return;const I=M=>{if(r.current!==t)return;const N=p?`/search/${M}?utm_source=${p}`:`/search/${M}`;o.replace(N,"Omni search query")};s({rawQuery:T,copilotOverride:u==="true"||f==="true"||Sz(p??void 0),collection:null,newFrontendContextUUID:crypto.randomUUID(),frontendUUID:t,attachments:S,inPage:h??void 0,promptSource:vM(k)?k:"user",querySource:"default_search",utmSource:p??void 0,quickActionButtonId:w,isNavSuggestionsDisabled:x==="false",modelPreferenceOverride:ie.DEFAULT,shouldRedirectToBackendUUID:!1,mentions:E,sourcesOverride:v?m2t(v?.split(",")):void 0,shouldUsePageStartTime:!0,onThreadSlugReceived:I}),r.current=t,Gfe()}},[e,s,t,a,o,n])},FS="streamId",h2t=()=>{const e=Hs();return d.useCallback(n=>{for(const r of n){if(e.getState().entries[r.backend_uuid])continue;const o=r.frontend_uuid??crypto.randomUUID(),a=!r.reconnectable,i=r.context_uuid,c=r.backend_uuid;e.setState(u=>{try{return e3(u,{...r,status:a?r.status===Pr.BLOCKED?Pr.BLOCKED:Pr.COMPLETED:Pr.PENDING,final:a,final_sse_message:a},{streamId:o})}catch(f){const m=new Ol("STREAM_INITIAL_ENTRIES_ERROR",{message:"Error in initializeThreads",cause:f,details:{request_id:o,backend_uuid:c}});return Z.error(m),{threads:pH(u.threads,i,c),entries:{...u.entries,[c]:{...r,status:Pr.FAILED}}}}},void 0,"ingestInitialEntries")}},[e])},qde=A.memo(({error:e})=>{throw e});qde.displayName="ThrowFetcherError";function g2t({active:e,query:t,copilot:n,source:r,streamId:s}){const o=d.useMemo(()=>t&&e?[C0e({query_str:t,frontend_uuid:s,query_source:r??"default_search",mode:n==="true"?"COPILOT":"CONCISE"})]:Pe,[t,e,s,r,n]);return d.useMemo(()=>e?{hasFrontendUUID:!!s,placeholderResults:o}:void 0,[e,o,s])}function y2t({active:e,frontendContextUUID:t}){const r=Hs().getState().streams,o=(e?Object.values(r).find(i=>i.params?.frontend_context_uuid===t):void 0)?.placeholderChunk,a=d.useMemo(()=>o?[o]:void 0,[o]);return d.useMemo(()=>e?{skipLoadingUI:!0,placeholderResults:a}:void 0,[e,a])}function x2t({active:e,slugOrUUID:t}){const n="search-components",r=Rn(),s=d.useRef(new Map),o=Hs(),a=d.useRef(o.getState());a.current=o.getState();const i=e?Object.values(a.current.entries).find(g=>g?.thread_url_slug===t||g?.backend_uuid===t||g?.backend_uuid===s.current.get(t)):void 0;i&&s.current.set(t,i?.backend_uuid??"");const c=e&&!i,{data:u,error:f,isLoading:m,dataUpdatedAt:p}=Dve({slugOrUUID:t,enabled:c,isSidecar:!0,reason:n}),h=d.useMemo(()=>u?.length?u:i?[i]:Pe,[u,i]);return d.useEffect(()=>{if(f instanceof he){let g=null;const y=f.detail;y?.error_code===a9?(g=wd.ThreadAccessNotAllowed,Z.error(a9,{error:f,slugOrUUID:t})):y?.error_code===Uwe?(g=wd.ThreadExpired,Z.error(f?.message,{error:f,slugOrUUID:t})):(g=wd.InvalidThread,Z.error(f?.message,{error:f,slugOrUUID:t})),r.replace(`/?error=${g}&id=${t}`,"Search error")}},[f,t,r]),d.useMemo(()=>e?{entries:h,slugOrUUID:t,isLoadingEntries:!p,error:f}:void 0,[e,h,f,p,t])}function v2t(){const{clear:e}=Vx(),t=ou(),n=!!(t?.new&&t?.uuid),r=!!(t?.new&&!t?.uuid),s=!!(!t?.new&&t?.uuid),o=!n&&!r&&!s,a=new URLSearchParams(window.location.search),i=a?.get("q")??void 0,c=a?.get("copilot")??void 0,u=a?.get("source")??void 0,f=a?.get(FS),m=d.useMemo(()=>f??crypto.randomUUID(),[f]);o&&!a.has(FS)&&a.set(FS,m);const p=o?a.toString():"",h=y2t({active:n,frontendContextUUID:t?.uuid??""}),g=g2t({active:r,query:i,copilot:c,streamId:m,source:u}),y=x2t({active:s,slugOrUUID:t?.uuid??""});return d.useEffect(()=>()=>e(),[e]),d.useLayoutEffect(()=>{g?.hasFrontendUUID&&e()},[e,g?.hasFrontendUUID]),p2t(r,m,"new-query-search-components"),d.useMemo(()=>{if(n){const x=t?.uuid;if(!x||!MU(x))return{component:l.jsx(A0,{to:"/"})}}else if(r){if(!i||i==="pending")return{component:l.jsx(A0,{to:"/"})}}else if(s){const x=t?.uuid;if(!x||x==="undefined")return{component:l.jsx(A0,{to:"/"})};if(y?.error instanceof he)return null;if(y?.error instanceof kU&&!y.entries.length)return{component:l.jsx(Mr,{fallback:()=>l.jsx(Kf,{}),code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(qde,{error:y.error})})}}else return{component:l.jsx(A0,{to:i?`/search/new?${p}`:"/"})};return{props:{...h,...g,...y}}},[y,s,g,r,h,n,t?.uuid,i,p])}function b2t(e){const t=h2t(),{setCurrentThreadId:n}=Vx(),r=J0e(),s=e.entries,o=!!s?.length,a=e.isLoadingEntries,i=d.useMemo(()=>s?.[0]?.context_uuid,[s]);d.useEffect(()=>{o&&n(i??crypto.randomUUID())},[o,n,i]),d.useEffect(()=>{a||s&&(s.forEach(u=>{u.reconnectable&&!qt.isStatusCompleted(u)&&r(u.backend_uuid)}),t(s))},[t,s,r,i,a]);const c=d.useMemo(()=>e.entries?.length?e.entries:e.placeholderResults?.length?e.placeholderResults:Pe,[e.placeholderResults,e.entries]);return d.useMemo(()=>({placeholderResults:c}),[c])}const Kde=A.memo(({children:e})=>{const{results:t}=on(),n=d.useMemo(()=>{const r=[];return t.map(s=>{s.widget_data?.map(o=>{d2t(o)&&r.push(o)})}),r},[t]);return l.jsx(eae,{entities:n,children:e})});Kde.displayName="ScrollToWidgetWrapper";function fx(e){return e?e==="comet_browser_agent":!1}const _2t=[ie.DEFAULT,ie.PRO];function w2t(e){return _2t.includes(e)}function g_t({displayModel:e,userSelectedModel:t,intl:n}){if(fx(e)||w2t(t))return null;const r=yU(t,n),s=yU(e,n);return s!==r?n.$t({defaultMessage:"Used {displayModelLabel} because {userSelectedModelLabel} was inapplicable or unavailable.",id:"fix6lEntWw"},{displayModelLabel:s,userSelectedModelLabel:r}):r}function yU(e,t){const n=$n[e];return n?t.$t(n.name):"Best"}const C2t=(e,t,n)=>{const r=HQ(),{addClarification:s}=Uv(),{session:o}=Ne(),{trackEventOnce:a}=Xe(o),i=n?.length??0,c=n?.filter(g=>g.markdown_block).length??0,u=d.useMemo(()=>{if(!n)return!1;if(fx(t?.display_model))return!0;const g=n.find(v=>v.intended_usage==="pro_search_steps");if(!g?.plan_block?.steps)return!1;const y=g.plan_block.steps;return y[y.length-1]?.step_type==="ENTROPY_REQUEST"},[n,t?.display_model]),f=d.useMemo(()=>u?!0:r?an(t?.display_model)===oe.RESEARCH||an(t?.display_model)===oe.STUDIO:!1,[r,u,t?.display_model]),m=d.useMemo(()=>f&&!t?.reasoning_plan&&i>0&&c===0,[t?.reasoning_plan,i,c,f]),p=d.useMemo(()=>!m||!f||!n?null:{clarificationQuestion:fx(t?.display_model)?"I'll consider the details you added.":"Add details or clarifications",isDefaultClarification:!0,clarificationCount:0},[m,f,n,t?.display_model]),h=d.useCallback((g,y,x)=>{const b={uuid:crypto.randomUUID(),clarification_type:"FREEFORM_CLARIFICATION",freeform_clarification:{text:x.query,question:"Add details or clarifications",attachments:x.attachments??[]}};Mge({entryUUID:g,clarification:b,reason:e}),s({content:b.freeform_clarification?.text??x.query,UUID:b.uuid,entryUUID:g,question:p?.clarificationQuestion??void 0}),p&&a("clarifying query submitted",{entry_uuid:g,context_uuid:y,query:x.query,attachments:x.attachments})},[s,p,e,a]);return{shouldAcceptClarification:m,handleSubmitClarification:h,clarificationData:p}},S2t=({selectedSearchMode:e,shouldAcceptClarification:t,isBrowserAgent:n,$t:r})=>r(t?n?{defaultMessage:"Add details to this task...",id:"9/d5+NqCeH"}:{defaultMessage:"Add details or clarifications...",id:"RkaMsxpXoz"}:Nr[e].askInputPlaceholder),Yde=A.memo(e=>{const t="sidecar-thread-floating-footer",{$t:n}=J(),r=un(),o=fn()?.get("q"),a=Wt(),{inFlightEntry:i,inFlight:c,firstResult:u,lastResult:f,resultsLength:m}=on(),p=i?.backend_uuid,h=i?.context_uuid,g=i?.blocks,y=u?.frontend_context_uuid,x=u?.collection_info,{shouldAcceptClarification:v,handleSubmitClarification:b,clarificationData:_}=C2t(t,f,g),w=g?.length??0,S=y,{activeMode:C}=kg(),{submitQuery:E}=Ho(),{specialCapabilities:T}=Yr(),k=Vo(),I=g0(),M=d.useMemo(()=>{try{return c&&w>0}catch(U){throw Z.error("Unable to parse non-Pro search inFlightEntry.",U),U}},[c,w]),N=d.useCallback(U=>{if(p&&v&&(b(p,h,U),P.setUserInput("")),c&&!U.forceFork)return;const O=U.forceFork||I,$=ua();E({rawQuery:U.query,copilotOverride:a||T.unlimitedProSearch?void 0:!1,attachments:U.attachments,collection:x??null,newFrontendContextUUID:O?$:null,existingFrontendContextUUID:O?void 0:S,promptSource:U.promptSource??"user",querySource:"followup",timeFromFirstType:U.timeFromFirstType,shouldRedirectToBackendUUID:O,modelPreferenceOverride:U.modelPreferenceOverride,forceEnableBrowserAgent:U.forceEnableBrowserAgent}),e.onSubmit?.()},[c,E,a,I,x,S,p,v,h,b]),D=d.useRef(!1),j=d.useCallback(U=>{D.current||(D.current=!0,setTimeout(()=>D.current=!1,Z4),N(U))},[N]);d.useEffect(()=>{v&&(D.current=!1)},[v]);const[F,R,P]=wW({onSubmit:j}),L=d.useCallback(()=>{p&&(au({entryUUID:p,reason:t}),r.cleanupTasks(p,"query_stopped"))},[p,r]);return d.useEffect(()=>r.subscribeToSidecarBrowserTaskStop(U=>{U||L()}),[r,L]),d.useEffect(()=>{o!==null&&o!==""&&P.setUserInput("")},[o]),l.jsx(K,{className:"erp-sidecar:fixed bottom-safeAreaInsetBottom p-md pointer-events-none absolute z-10 w-full",ref:e.ref,children:l.jsx("div",{className:"max-w-threadContentWidth mx-auto",children:l.jsx("div",{className:"pointer-events-auto",children:QIe(C)&&l.jsx(K,{className:z("mt-lg static w-full grow flex-col items-center justify-center md:mt-0 md:flex","z-10"),children:l.jsx("div",{className:"w-full",children:l.jsxs(Wc,{children:[l.jsx(Jd,{position:"input",idx:m-1,upsellInformation:f?.upsell_information,inFlight:c,isLastResult:!0,backendUuid:p,animateExpand:!1}),d.createElement(VA,{...P,key:"ask-input",value:F,json:R,isFollowUp:!0,disableSubmission:c&&!v,placeholder:S2t({selectedSearchMode:k,shouldAcceptClarification:v,isBrowserAgent:fx(f?.display_model),$t:n}),showStopButton:M,showFileUpload:!0,inFlightEntryUUID:p,onStopButtonClick:L,querySource:"followup",layoutKey:"sidecar-input",isHighlighted:!!_?.clarificationQuestion})]})})})})})})});Yde.displayName="SidecarThreadFloatingFooter";const Qde=A.memo(()=>l.jsx(Kf,{}));Qde.displayName="Fallback";const Xde=A.memo(e=>{const{placeholderResults:t}=b2t(e),[n,{height:r}]=ti();return l.jsx(Mr,{fallback:Qde,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(ePe,{children:l.jsx(mZ,{children:l.jsx(pZ,{children:l.jsxs(Kde,{children:[l.jsx("div",{className:"mx-auto h-fit pb-0",children:l.jsxs(K,{variant:"background",className:"relative",children:[l.jsx($de,{children:l.jsx(Gde,{})}),l.jsx(zde,{...e,placeholderResults:t,lastResultBuffer:r})]})}),l.jsx(Yde,{ref:n},"footer")]})})})})})});Xde.displayName="SearchContent";const Zde=A.memo(function(){const t=v2t();return t?"component"in t?t.component:l.jsx(Of,{children:l.jsx(Xde,{...t.props})}):null});Zde.displayName="SidecarSearchPage";const E2t=Ce(async()=>{const{VoiceToVoiceContent:e}=await Se(()=>q(()=>import("./VoiceToVoiceContent-BLVFdoql.js"),__vite__mapDeps([495,4,1,6,3,145,7,9,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),Jde=A.memo(function(){const t=Rn(),n=d.useCallback(()=>{t.push("/",void 0,"voice to sidecar")},[t]);return l.jsx(Of,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Qx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(E2t,{onClose:n})})})});Jde.displayName="SidecarSpeakPage";const k2t=Ce(async()=>{const{VoiceToVoiceContent:e}=await Se(()=>q(()=>import("./VoiceToVoiceContent-BLVFdoql.js"),__vite__mapDeps([495,4,1,6,3,145,7,9,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),efe=A.memo(function(){const t=un(),n=d.useCallback(()=>{t?.voiceAssistantStop()},[t]);return l.jsx(Of,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Qx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(k2t,{isCometVoiceAssistant:!0,onClose:n})})})});efe.displayName="SidecarVoiceAssistantPage";const M2t=Ce(async()=>{const{VoiceToVoiceFloating:e}=await Se(()=>q(()=>import("./VoiceToVoiceFloating-DZo4d0io.js"),__vite__mapDeps([496,4,1,6,3,146,7,9,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),tfe=A.memo(function(){return l.jsx(Of,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Qx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(M2t,{isCometVoiceAssistant:!0})})})});tfe.displayName="SidecarVoiceFloatingPage";const T2t={[vW]:{Component:Zde,modules:kCe},"/speak":{Component:Jde,modules:Pe},"/voice-assistant":{Component:efe,modules:Pe},"/voice-floating":{Component:tfe,modules:Pe},"/":{Component:HA,modules:bW}},nfe=A.memo(()=>l.jsxs($fe,{children:[Object.entries(T2t).map(([e,{Component:t,modules:n}])=>l.jsx(p7,{path:e.startsWith("^")?new RegExp(e):e,children:l.jsx(s9,{modules:n,children:l.jsx(t,{})})},e)),l.jsx(p7,{children:l.jsx(s9,{modules:bW,children:l.jsx(HA,{})})})]}));nfe.displayName="Main";const q8=[vW,"/speak","/voice-assistant","/voice-floating","/"],A2t=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,K8="pplx-next-auth-session";let K1=null;const N2t=()=>{try{const e=vt.getItem(K8);return e?JSON.parse(e):null}catch{return null}},xU=e=>{e&&vt.setItem(K8,JSON.stringify(e))},rfe=()=>{vt.removeItem(K8)},R2t=(e=!1)=>{K1??=Ime().then(n=>(n?xU(n):rfe(),n)).catch(n=>{throw(!(n instanceof fM)||n.code!=="AUTH_NO_STATUS_CODE_ERROR")&&xU(null),n}).finally(()=>{K1=null});const t=N2t();return t&&(e||new Date(t.expires)>new Date)?{cachedSession:t,sessionFetchPromise:K1}:{cachedSession:null,sessionFetchPromise:K1}};async function D2t(){const{data:e,error:t}=await WU.GET("/api/auth/csrf","getCsrfToken",{numRetries:2,backOffTime:500});if(t)throw new fM("CSRF_TOKEN_ERROR",{cause:t});return e.csrfToken}async function j2t({redirect:e=!0,callbackUrl:t=window.location.href}){const{error:n}=await WU.POST("/api/auth/signout","signOut",{body:{csrfToken:await D2t(),callbackUrl:t,json:"true"},redirect:"manual"});if(n)throw new fM("SIGN_OUT_ERROR",{cause:n});e&&(qfe(t),t.includes("#")&&window.location.reload())}async function sfe(){await IU(),await lH(),vt.keys().forEach(e=>{e.startsWith(Cz)&&vt.removeItem(e)}),rfe()}const y_t=async(...e)=>(await sfe(),j2t(...e));function I2t(e,t){if(e?.pathname.startsWith("/sidecar"))return"sidecar";if(e?.pathname.startsWith("/mobile-sidecar"))return"mobile-sidecar";if(t)return"tab"}function P2t(){const{cachedSession:e,sessionFetchPromise:t}=R2t(),n=An(),r=document.querySelector("meta[name='version']")?.getAttribute("content")||"",s=+(document.querySelector("meta[name='min-version']")?.getAttribute("content")||0),o=document.querySelector("meta[name='web-resources-build']")?.getAttribute("content")||"",a=new URL(window.location.href);return{cachedSession:e,sessionFetchPromise:t.then(i=>(e&&!i&&sfe().then(()=>{hx("Auth changed")}),i)).catch(i=>(console.error("Error getting session",i),null)),config:{env:Pme(),version:r,minVersion:s,webResourcesBuild:o,erp:I2t(a,n)}}}const u_="/sidecar",O2t=document.getElementById("root"),L2t=rme.createRoot(O2t),F2t=Ome(u_),B2t=navigator.userAgent;function U2t(e,t){S7(A2t),S7(qpe,"pplx-logo-sprites"),L2t.render(l.jsx(Mr,{fallback:F2t,children:l.jsx(Fme,{host:vU,userAgent:B2t,session:t??void 0,children:l.jsxs(vCe,{isMobileUserAgent:H2t,hostname:vU,buildVersion:e.version,spaRoutes:q8,shouldOpenNonSpaRouteInNewTab:!0,base:u_,idleRefresh:!0,buildVersionRefresh:!0,children:[l.jsx(eV,{}),l.jsx(nfe,{})]})})}))}const{config:d_,cachedSession:mx,sessionFetchPromise:V2t}=P2t();window.__PPL_CONFIG__=d_;const H2t=Lme(navigator.userAgent),vU=window.location.host;Kfe();mx&&xW({bootstrapConfig:d_,user:mx.user,routes:q8,base:u_});U2t(d_,mx);mx||V2t.then(e=>{xW({bootstrapConfig:d_,user:e?.user,routes:q8,base:u_})});export{$t as $,Pvt as A,K as B,hvt as C,Mn as D,RR as E,fxt as F,gvt as G,Oz as H,Wo as I,Dvt as J,qn as K,Zn as L,V4 as M,hae as N,uA as O,Fl as P,Zwe as Q,jvt as R,Nvt as S,V as T,Ivt as U,h0e as V,zs as W,mvt as X,fh as Y,Vf as Z,mo as _,pCe as a,rE as a$,Kwe as a0,yvt as a1,l3 as a2,c3 as a3,c2e as a4,d2e as a5,q9e as a6,LM as a7,nDe as a8,rDe as a9,Io as aA,Rvt as aB,St as aC,pNe as aD,kb as aE,zx as aF,pSe as aG,svt as aH,az as aI,sxt as aJ,rvt as aK,pi as aL,Oo as aM,ui as aN,Pgt as aO,na as aP,FCe as aQ,Evt as aR,oxt as aS,Xt as aT,dvt as aU,hSe as aV,GCe as aW,Loe as aX,Hrt as aY,TA as aZ,AA as a_,v8e as aa,OM as ab,Vz as ac,b8e as ad,Af as ae,Nz as af,Rz as ag,Z9e as ah,eQ as ai,J4 as aj,Ea as ak,vhe as al,Wye as am,kc as an,_3 as ao,Dt as ap,Bt as aq,o2 as ar,co as as,R_e as at,O4 as au,kvt as av,iX as aw,L4 as ax,du as ay,Wv as az,C3 as b,hu as b$,jSe as b0,yge as b1,de as b2,XSe as b3,rbt as b4,Ca as b5,lxt as b6,hxt as b7,cxt as b8,uxt as b9,Zvt as bA,Uxt as bB,i2e as bC,iu as bD,Qe as bE,Ox as bF,SGe as bG,$x as bH,YCe as bI,SA as bJ,CA as bK,ide as bL,Zue as bM,rde as bN,tl as bO,Po as bP,Ay as bQ,ux as bR,dae as bS,Us as bT,kxt as bU,tLe as bV,lbt as bW,ET as bX,O$ as bY,abt as bZ,ST as b_,zt as ba,PK as bb,Lvt as bc,bSe as bd,CW as be,EM as bf,Ht as bg,qCe as bh,Gd as bi,Uvt as bj,mg as bk,oNe as bl,Xl as bm,Kbt as bn,Kr as bo,ga as bp,Bn as bq,LN as br,uvt as bs,Kd as bt,kf as bu,Ed as bv,pn as bw,Gvt as bx,zvt as by,Xvt as bz,$we as c,_v as c$,rxt as c0,fg as c1,axt as c2,GK as c3,br as c4,tM as c5,Ly as c6,zQ as c7,nxt as c8,Ovt as c9,vbt as cA,Tbt as cB,wbt as cC,Ebt as cD,_bt as cE,bbt as cF,pDe as cG,Nbt as cH,g0e as cI,An as cJ,rV as cK,Abt as cL,dDe as cM,kbt as cN,Mbt as cO,x4 as cP,w4 as cQ,_4 as cR,Dz as cS,Q_e as cT,k_e as cU,pvt as cV,Si as cW,_vt as cX,wvt as cY,Fvt as cZ,Bvt as c_,kSe as ca,Sxt as cb,jp as cc,Qbt as cd,wi as ce,Ra as cf,t_t as cg,Xbt as ch,Ybt as ci,Cn as cj,NK as ck,Lr as cl,ti as cm,ph as cn,HFe as co,zFe as cp,sbt as cq,Ur as cr,$c as cs,Lj as ct,Cbt as cu,Sbt as cv,Fj as cw,v_ as cx,txt as cy,xbt as cz,i9 as d,OY as d$,Hxt as d0,Ep as d1,D2t as d2,lH as d3,Ix as d4,EV as d5,mxt as d6,pxt as d7,r4 as d8,Ls as d9,Hh as dA,dx as dB,yC as dC,Ast as dD,Nk as dE,dde as dF,$g as dG,ya as dH,Ext as dI,Yxt as dJ,Xxt as dK,Qxt as dL,qqe as dM,Rbt as dN,mbt as dO,an as dP,l2e as dQ,GH as dR,fbt as dS,i1t as dT,pbt as dU,nX as dV,hbt as dW,gbt as dX,jxt as dY,Wc as dZ,Ec as d_,NN as da,Axt as db,nl as dc,Fxt as dd,dW as de,c_t as df,f_t as dg,u_t as dh,xC as di,ze as dj,$vt as dk,Dxt as dl,JM as dm,Ixt as dn,ebt as dp,tbt as dq,nbt as dr,BBe as ds,T2 as dt,qGe as du,byt as dv,Ji as dw,X2e as dx,l_t as dy,d_t as dz,iwe as e,Vxt as e$,oe as e0,lf as e1,YGe as e2,QGe as e3,cp as e4,Qd as e5,zxt as e6,Nxt as e7,f$e as e8,bvt as e9,Svt as eA,Avt as eB,Tvt as eC,Mvt as eD,AM as eE,RM as eF,jM as eG,nRe as eH,fvt as eI,Dbt as eJ,see as eK,eT as eL,Mxt as eM,Eve as eN,_d as eO,VR as eP,Jye as eQ,e2e as eR,pJ as eS,at as eT,dr as eU,gae as eV,Vvt as eW,Hvt as eX,Bxt as eY,zve as eZ,Lxt as e_,kGe as ea,l0e as eb,Dp as ec,Txt as ed,Pxt as ee,Hx as ef,Vn as eg,M8e as eh,z4 as ei,Gz as ej,dp as ek,Wz as el,Zxt as em,Xye as en,Jxt as eo,d3 as ep,NA as eq,evt as er,qxt as es,lE as et,U7 as eu,y_t as ev,tvt as ew,Oke as ex,_xt as ey,Oxt as ez,aA as f,fU as f$,$ye as f0,Jvt as f1,o_t as f2,X0t as f3,r_t as f4,uKe as f5,dKe as f6,fKe as f7,a_t as f8,Ga as f9,Kxt as fA,vSe as fB,Hd as fC,wT as fD,CT as fE,vC as fF,Z2t as fG,Nst as fH,uae as fI,ON as fJ,It as fK,hs as fL,jK as fM,on as fN,Zyt as fO,g6 as fP,el as fQ,g0 as fR,Ist as fS,Vv as fT,x0 as fU,Ade as fV,SOe as fW,ybt as fX,kg as fY,dZ as fZ,Dq as f_,s_t as fa,Z6 as fb,OA as fc,nvt as fd,Kvt as fe,Qvt as ff,qvt as fg,Wvt as fh,oH as fi,Yvt as fj,AGe as fk,TGe as fl,JSe as fm,b$ as fn,S$ as fo,T$ as fp,E$ as fq,k$ as fr,ISe as fs,PSe as ft,BSe as fu,gxt as fv,Wxt as fw,Gxt as fx,Jn as fy,$xt as fz,zwe as g,nc as g$,pU as g0,p_t as g1,B6 as g2,h_t as g3,Jo as g4,yyt as g5,ade as g6,Fy as g7,Q2e as g8,dyt as g9,tE as gA,Ij as gB,cH as gC,Cvt as gD,os as gE,j4 as gF,bd as gG,Zl as gH,hJ as gI,h9e as gJ,y6 as gK,Wd as gL,e_t as gM,w_e as gN,eCe as gO,JH as gP,Jd as gQ,bxt as gR,Ibt as gS,ie as gT,Sp as gU,jH as gV,Hke as gW,Wke as gX,Yr as gY,Fx as gZ,QY as g_,Ode as ga,Pde as gb,Rxt as gc,jee as gd,bz as ge,GN as gf,qx as gg,ng as gh,v6 as gi,af as gj,Ku as gk,Pbt as gl,gJ as gm,Yf as gn,$Oe as go,jbt as gp,Obt as gq,Lbt as gr,_c as gs,wc as gt,ny as gu,d7e as gv,UY as gw,HY as gx,lg as gy,Wx as gz,aNe as h,P1t as h$,g_t as h0,fx as h1,Nr as h2,Bv as h3,eLe as h4,ixt as h5,vxt as h6,Eb as h7,xze as h8,mi as h9,Jbt as hA,UE as hB,gne as hC,ext as hD,fN as hE,Tyt as hF,Cde as hG,xxt as hH,iSe as hI,ua as hJ,kk as hK,jz as hL,eu as hM,rN as hN,J2t as hO,Jg as hP,Rb as hQ,t_ as hR,Yle as hS,df as hT,_6 as hU,Uo as hV,LFe as hW,Cet as hX,l6 as hY,C0e as hZ,vvt as h_,xvt as ha,cvt as hb,v1e as hc,qt as hd,qc as he,Y0 as hf,ude as hg,ovt as hh,ivt as hi,avt as hj,Boe as hk,hyt as hl,qu as hm,_yt as hn,ayt as ho,fde as hp,XJ as hq,txe as hr,hde as hs,lv as ht,que as hu,Nee as hv,Ree as hw,Hee as hx,Ip as hy,Zbt as hz,hn as i,XYe as i$,L1t as i0,ARe as i1,NRe as i2,RRe as i3,DRe as i4,uk as i5,ka as i6,Pre as i7,oN as i8,yxt as i9,Xb as iA,lm as iB,Bi as iC,sl as iD,n_ as iE,u1t as iF,f0 as iG,zl as iH,eo as iI,bu as iJ,fa as iK,QJ as iL,qLe as iM,Fbt as iN,Bbt as iO,YLe as iP,dI as iQ,fI as iR,KLe as iS,ypt as iT,Bot as iU,Zle as iV,Jle as iW,P8 as iX,Rh as iY,cN as iZ,qYe as i_,Mv as ia,kr as ib,U4 as ic,ubt as id,p3 as ie,tg as ig,aV as ih,Dx as ii,Yl as ij,tV as ik,bI as il,jve as im,wxt as io,Cxt as ip,yV as iq,Cue as ir,g2 as is,ZCe as it,IA as iu,JCe as iv,aRe as iw,iA as ix,ko as iy,ule as iz,un as j,i_t as j0,hk as j1,QYe as j2,pN as j3,wb as j4,coe as j5,Dse as j6,ws as j7,yYe as j8,Gse as j9,Gv as ja,pf as jb,Lre as jc,dbt as jd,sY as je,A2 as jf,yb as jg,dA as jh,Z2e as ji,lvt as jj,A4 as jk,yJ as jl,sN as jm,Gg as jn,oLe as jo,m_t as jp,Rx as jq,nae as jr,cbt as js,QFe as jt,FN as ju,Qn as k,Do as l,Te as m,GFe as n,Re as o,Ne as p,Xe as q,Ss as r,sr as s,po as t,Wt as u,ag as v,ft as w,dxt as x,Ge as y,st as z}; -//# sourceMappingURL=https://pplx-static-sourcemaps.perplexity.ai/_sidecar/assets/index-D_VLSpJ3.js.map diff --git a/Ai docs/Perplexity github_files/katex-DIrX_gBg.css b/Ai docs/Perplexity github_files/katex-DIrX_gBg.css deleted file mode 100644 index d89d0af..0000000 --- a/Ai docs/Perplexity github_files/katex-DIrX_gBg.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/Ai docs/Perplexity github_files/mapbox-gl-B9eh9OLo.css b/Ai docs/Perplexity github_files/mapbox-gl-B9eh9OLo.css deleted file mode 100644 index 3eb4dfd..0000000 --- a/Ai docs/Perplexity github_files/mapbox-gl-B9eh9OLo.css +++ /dev/null @@ -1 +0,0 @@ -.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top{left:50%;top:0;transform:translate(-50%)}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-right{right:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{left:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:#000000b3;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y} diff --git a/Ai docs/Perplexity github_files/saved_resource.html b/Ai docs/Perplexity github_files/saved_resource.html deleted file mode 100644 index 3443bd9..0000000 --- a/Ai docs/Perplexity github_files/saved_resource.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Ai docs/Perplexity github_files/vcd15cbe7772f49c399c6a5babf22c1241717689176015 b/Ai docs/Perplexity github_files/vcd15cbe7772f49c399c6a5babf22c1241717689176015 deleted file mode 100644 index 56f5373..0000000 --- a/Ai docs/Perplexity github_files/vcd15cbe7772f49c399c6a5babf22c1241717689176015 +++ /dev/null @@ -1 +0,0 @@ -!function(){var e={343:function(e){"use strict";for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},944:function(e){"use strict";var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},508:function(e,t,n){"use strict";var r=n(944),i=n(343);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var c=0;c<16;++c)t[o+c]=a[c];return t||i(a)}},168:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&(t+=r)}return t}function t(e,t){for(var n in e){var r=e[n];void 0!==t&&("number"!=typeof r&&"string"!=typeof r||(t[n]=r))}}!function(){var n,u,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,f="data-cf-beacon",d=document.currentScript||("function"==typeof document.querySelector?document.querySelector("script[".concat(f,"]")):void 0),l=c(),v=[],p=window.__cfBeacon?window.__cfBeacon:{};if(!p||"single"!==p.load){if(d){var m=d.getAttribute(f);if(m)try{p=r(r({},p),JSON.parse(m))}catch(e){}else{var g=d.getAttribute("src");if(g&&"function"==typeof URLSearchParams){var y=new URLSearchParams(g.replace(/^[^\?]+\??/,"")),h=y.get("token");h&&(p.token=h);var T=y.get("spa");p.spa=null===T||"true"===T}}p&&"multi"!==p.load&&(p.load="single"),window.__cfBeacon=p}if(s&&p&&p.token){var w,S,b=!1;document.addEventListener("visibilitychange",(function(){if("hidden"===document.visibilityState){if(L&&A()){var t=e();(null==w?void 0:w.url)==t&&(null==w?void 0:w.triggered)||P(),_(t)}!b&&w&&(b=!0,B())}else"visible"===document.visibilityState&&(new Date).getTime()}));var E={};"function"==typeof PerformanceObserver&&((0,a.onLCP)(x),(0,a.onFID)(x),(0,a.onFCP)(x),(0,a.onINP)(x),(0,a.onTTFB)(x),PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("layout-shift")&&(0,a.onCLS)(x));var L=p&&(void 0===p.spa||!0===p.spa),C=p.send&&p.send.to?p.send.to:void 0===p.version?"https://cloudflareinsights.com/cdn-cgi/rum":null,P=function(r){var a=function(r){var o,a,c=s.timing,u=s.memory,f=r||e(),d={memory:{},timings:{},resources:[],referrer:(o=document.referrer||"",a=v[v.length-1],L&&w&&a?a.url:o),eventType:i.EventType.Load,firstPaint:0,firstContentfulPaint:0,startTime:F(),versions:{fl:p?p.version:"",js:"2024.6.1",timings:1},pageloadId:l,location:f,nt:S,serverTimings:I()};if(null==n){if("function"==typeof s.getEntriesByType){var m=s.getEntriesByType("navigation");m&&Array.isArray(m)&&m.length>0&&(d.timingsV2={},d.versions.timings=2,d.dt=m[0].deliveryType,delete d.timings,t(m[0],d.timingsV2))}1===d.versions.timings&&t(c,d.timings),t(u,d.memory)}else O(d);return d.firstPaint=k("first-paint"),d.firstContentfulPaint=k("first-contentful-paint"),p&&(p.icTag&&(d.icTag=p.icTag),d.siteToken=p.token),void 0!==n&&(delete d.timings,delete d.memory),d}(r);a&&p&&(a.resources=[],p&&((0,o.sendObjectBeacon)("",a,(function(){}),!1,C),void 0!==p.forward&&void 0!==p.forward.url&&(0,o.sendObjectBeacon)("",a,(function(){}),!1,p.forward.url)))},B=function(){var t=function(){var t=s.getEntriesByType("navigation")[0],n="";try{n="function"==typeof s.getEntriesByType?new URL(null==t?void 0:t.name).pathname:u?new URL(u).pathname:window.location.pathname}catch(e){}var r={referrer:document.referrer||"",eventType:i.EventType.WebVitalsV2,versions:{js:"2024.6.1"},pageloadId:l,location:e(),landingPath:n,startTime:F(),nt:S,serverTimings:I()};return p&&(p.version&&(r.versions.fl=p.version),p.icTag&&(r.icTag=p.icTag),r.siteToken=p.token),E&&["lcp","fid","cls","fcp","ttfb","inp"].forEach((function(e){r[e]={value:-1,path:void 0},E[e]&&void 0!==E[e].value&&(r[e]=E[e])})),O(r),r}();p&&(0,o.sendObjectBeacon)("",t,(function(){}),!0,C)},R=function(){var t=window.__cfRl&&window.__cfRl.done||window.__cfQR&&window.__cfQR.done;t?t.then(P):P(),w={id:l,url:e(),ts:(new Date).getTime(),triggered:!0}};"complete"===window.document.readyState?R():window.addEventListener("load",(function(){window.setTimeout(R)}));var A=function(){return L&&0===v.filter((function(e){return e.id===l})).length},_=function(e){v.push({id:l,url:e,ts:(new Date).getTime()}),v.length>3&&v.shift()};L&&(u=e(),function(t){var r=t.pushState;if(r){var i=function(){l=c()};t.pushState=function(o,a,c){n=e(c);var u=e(),s=!0;return n==u&&(s=!1),s&&(A()&&((null==w?void 0:w.url)==u&&(null==w?void 0:w.triggered)||P(u),_(u)),i()),r.apply(t,[o,a,c])},window.addEventListener("popstate",(function(t){A()&&((null==w?void 0:w.url)==n&&(null==w?void 0:w.triggered)||P(n),_(n)),n=e(),i()}))}}(window.history))}}function x(e){var t,n,r,i,o,a,c,u=window.location.pathname;switch(S||(S=e.navigationType),"INP"!==e.name&&(E[e.name.toLowerCase()]={value:e.value,path:u}),e.name){case"CLS":(c=e.attribution)&&E.cls&&(E.cls.element=c.largestShiftTarget,E.cls.currentRect=null===(t=c.largestShiftSource)||void 0===t?void 0:t.currentRect,E.cls.previousRect=null===(n=c.largestShiftSource)||void 0===n?void 0:n.previousRect);break;case"FID":(c=e.attribution)&&E.fid&&(E.fid.element=c.eventTarget,E.fid.name=c.eventType);break;case"LCP":(c=e.attribution)&&E.lcp&&(E.lcp.element=c.element,E.lcp.size=null===(r=c.lcpEntry)||void 0===r?void 0:r.size,E.lcp.url=c.url,E.lcp.rld=c.resourceLoadDelay,E.lcp.rlt=c.resourceLoadTime,E.lcp.erd=c.elementRenderDelay,E.lcp.it=null===(i=c.lcpResourceEntry)||void 0===i?void 0:i.initiatorType,E.lcp.fp=null===(a=null===(o=c.lcpEntry)||void 0===o?void 0:o.element)||void 0===a?void 0:a.getAttribute("fetchpriority"));break;case"INP":(null==E.inp||Number(E.inp.value)-1&&parseInt(c[1])<81&&(a=!1)}catch(e){}if(navigator&&"function"==typeof navigator.sendBeacon&&a&&r){t.st=1;var u=JSON.stringify(t),s=navigator.sendBeacon&&navigator.sendBeacon.bind(navigator);null==s||s(o,new Blob([u],{type:"application/json"}))}else{t.st=2,u=JSON.stringify(t);var f=new XMLHttpRequest;n&&(f.onreadystatechange=function(){4==this.readyState&&204==this.status&&n()}),f.open("POST",o,!0),f.setRequestHeader("content-type","application/json"),f.send(u)}}},699:function(e,t){"use strict";var n,r;t.__esModule=!0,t.FetchPriority=t.EventType=void 0,(r=t.EventType||(t.EventType={}))[r.Load=1]="Load",r[r.Additional=2]="Additional",r[r.WebVitalsV2=3]="WebVitalsV2",(n=t.FetchPriority||(t.FetchPriority={})).High="high",n.Low="low",n.Auto="auto"},104:function(e,t){!function(e){"use strict";var t,n,r,i,o,a=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},c=function(e){if("loading"===document.readyState)return"loading";var t=a();if(t){if(e(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},f=-1,d=function(){return f},l=function(e){addEventListener("pageshow",(function(t){t.persisted&&(f=t.timeStamp,e(t))}),!0)},v=function(){var e=a();return e&&e.activationStart||0},p=function(e,t){var n=a(),r="navigate";return d()>=0?r="back-forward-cache":n&&(document.prerendering||v()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},m=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},g=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},y=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},h=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},T=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},w=-1,S=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},b=function(e){"hidden"===document.visibilityState&&w>-1&&(w="visibilitychange"===e.type?e.timeStamp:0,L())},E=function(){addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0)},L=function(){removeEventListener("visibilitychange",b,!0),removeEventListener("prerenderingchange",b,!0)},C=function(){return w<0&&(w=S(),E(),l((function(){setTimeout((function(){w=S(),E()}),0)}))),{get firstHiddenTime(){return w}}},P=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},B=[1800,3e3],R=function(e,t){t=t||{},P((function(){var n,r=C(),i=p("FCP"),o=m("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime=0&&n1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){F(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,_),removeEventListener("pointercancel",r,_)};addEventListener("pointerup",n,_),addEventListener("pointercancel",r,_)}(t,e):F(t,e)}},k=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,O,_)}))},M=[100,300],D=function(e,r){r=r||{},P((function(){var o,a=C(),c=p("FID"),u=function(e){e.startTimet.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};X[r.id]=r,Q.push(r)}Q.sort((function(e,t){return t.latency-e.latency})),Q.splice(10).forEach((function(e){delete X[e.id]}))}},K=[2500,4e3],Y={},Z=[800,1800],$=function e(t){document.prerendering?P((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ee=function(e,t){t=t||{};var n=p("TTFB"),r=g(e,n,Z,t.reportAllChanges);$((function(){var i=a();if(i){var o=i.responseStart;if(o<=0||o>performance.now())return;n.value=Math.max(o-v(),0),n.entries=[i],r(!0),l((function(){n=p("TTFB",0),(r=g(e,n,Z,t.reportAllChanges))(!0)}))}}))};e.CLSThresholds=A,e.FCPThresholds=B,e.FIDThresholds=M,e.INPThresholds=U,e.LCPThresholds=K,e.TTFBThresholds=Z,e.onCLS=function(e,t){!function(e,t){t=t||{},R(T((function(){var n,r=p("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},c=m("layout-shift",a);c&&(n=g(e,r,A,t.reportAllChanges),h((function(){a(c.takeRecords()),n(!0)})),l((function(){i=0,r=p("CLS",0),n=g(e,r,A,t.reportAllChanges),y((function(){return n()}))})),setTimeout(n,0))})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:s(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:c(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)},e.onFCP=function(e,t){R((function(t){!function(e){if(e.entries.length){var t=a(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:c(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:c(d())}}(t),e(t)}),t)},e.onFID=function(e,t){D((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:s(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:c(t.startTime)}}(t),e(t)}),t)},e.onINP=function(e,t){!function(e,t){t=t||{},P((function(){var n;z();var r,i=p("INP"),o=function(e){e.forEach((function(e){e.interactionId&&G(e),"first-input"===e.entryType&&!Q.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&G(e)}));var t,n=(t=Math.min(Q.length-1,Math.floor(W()/50)),Q[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},a=m("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=g(e,i,U,t.reportAllChanges),a&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&a.observe({type:"first-input",buffered:!0}),h((function(){o(a.takeRecords()),i.value<0&&W()>0&&(i.value=0,i.entries=[]),r(!0)})),l((function(){Q=[],J=H(),i=p("INP"),r=g(e,i,U,t.reportAllChanges)})))}))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0],n=e.entries.find((function(e){return e.target}));e.attribution={eventTarget:s(n&&n.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:c(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},e.onLCP=function(e,t){!function(e,t){t=t||{},P((function(){var n,r=C(),i=p("LCP"),o=function(e){var t=e[e.length-1];t&&t.startTime - -Perplexity

Summarize the current webpage

SmartHomeAI is a private Python-based repository for an intelligent, highly personalized smart home automation platform that learns user behavior to deliver adaptive comfort, convenience, and security.github

-

Purpose and scope

-
    -
  • -

    The project aims to build a next-generation home automation system that uses AI to understand routines, preferences, and context rather than just executing static rules.github

    -
  • -
  • -

    It is positioned as an “elite, AI-driven home companion” that can coordinate daily tasks (schedules, shopping, health, finances) while orchestrating smart devices across the home.github

    -
  • -
-

Key capabilities

-
    -
  • -

    Voice: Advanced, context-aware voice control with natural language processing, multi-language and accent support, hands-free device control, voice profiles, and command-history learning for personalization.github

    -
  • -
  • -

    Intelligence: Predictive analytics and machine learning for behavior pattern recognition, proactive automation, smart scene suggestions, energy optimization, and anomaly detection for unusual activity or device issues.github

    -
  • -
-

Repository structure

-
    -
  • -

    Main components include a smarthome package, behavior analysis (behavior_analysis.py), user profiling (user_profile.py), multi-room synchronization (multi_room_sync.py), and an entrypoint main.py.github

    -
  • -
  • -

    Supporting assets include docs for setup/installation, requirements.txt for dependencies, and a GitHub Actions workflow under .github/workflows for CI on the Python application.github

    -
  • -
-

Project status

-
    -
  • -

    The repository currently has no stars, forks, or releases published, and is written 100% in Python, suggesting an early-stage but structured codebase with automation workflows already configured.github

    -
  • -
what would you recommend

Given the SmartHomeAI repo and your profile, the highest-leverage move is to turn this into a tightly scoped, AI-native, locally runnable v1 that integrates with Home Assistant and your local LLM stack.library

-

1. Define a sharp v1 slice

-
    -
  • -

    Focus v1 on context-aware voice scenes + multi-room lighting/temperature + basic notifications, and explicitly park health/finance/security extras for later.library+1

    -
  • -
  • -

    Make this end-to-end: from wake word or text command → intent → behavior engine → device action → logged feedback for future learning.library

    -
  • -
-

2. Architect around a behavior engine

-
    -
  • -

    Explicitly define services in docs: voice interface, behavior engine, rules/automation engine, device integration layer, data store, feedback loop, and map existing modules (behavior_analysis, user_profile, multi_room_sync) to these.library+1

    -
  • -
  • -

    Add an ARCHITECTURE.md that frames this as a micro-/multi-agent loop: sense → interpret → decide → act → learn, ready to plug into your broader multi-agent patterns later.library

    -
  • -
-

3. Integrate with Home Assistant + local LLM

-
    -
  • -

    Implement a clean adapter in smarthome/ for Home Assistant first, treating it as the canonical device graph and event bus.library

    -
  • -
  • -

    Wrap your local LLM (Ollama or similar) as a “conversation → intent” service so SmartHomeAI becomes the decision layer, not just another assistant front-end.

    -
  • -
-

4. Make it clonable and demoable

-
    -
  • -

    Ensure: git clonepython -m venv .venv && pip install -r requirements.txt.env template → python main.py yields a minimal working demo with fake devices or a Home Assistant sandbox.library+1

    -
  • -
  • -

    Add a short “Try it in 5 minutes” section in the README plus a basic scenario: “Good night” scene across rooms + one adaptive suggestion from the behavior engine.library

    -
  • -
-

5. Tighten project and CI for scale

-
    -
  • -

    Keep the GitHub Projects board as the single source of truth and create milestones: v0.1 (integration + demo), v0.2 (learning + personalization), v0.3 (predictive automation), v1.0 (security + polish).library+1

    -
  • -
  • -

    Add/extend CI to run lint + tests on pushes/PRs and start a tests/ folder around behavior_analysis, user_profile, and multi_room_sync to harden the core loop early.library+1

    -
  • -
lets do it

Excellent. Next, focus on a minimal, tangible v0.1 that you can actually run and iterate on inside this repo.github+1

-

1. Lock in v0.1 scope

-
    -
  • -

    Target: voice-triggered scenes + multi-room lighting/temperature + basic notifications, with fake devices or Home Assistant integration as the first adapter.library+1

    -
  • -
  • -

    Explicitly de-scope health, finance, and advanced security for now; keep them listed as “Future capabilities” in docs so the vision stays intact without blocking execution.github+1

    -
  • -
-

2. Add architecture + core loop docs

-
    -
  • -

    Create docs/ARCHITECTURE.md describing services: voice interface, behavior engine, rules/automation engine, device integration layer, data store, feedback loop, and show how behavior_analysis.py, user_profile.py, multi_room_sync.py, and smarthome/ map in.library+1

    -
  • -
  • -

    Document the main loop explicitly as: sense (events + state) → interpret (context + user model) → decide (automation/scene) → act (devices/notifications) → learn (feedback into behavior_analysis + user_profile).library+1

    -
  • -
-

3. Make a runnable demo path

-
    -
  • -

    Ensure: git clonepython -m venv .venv && pip install -r requirements.txtcp .env.example .envpython main.py yields a simple CLI or HTTP endpoint that can: trigger a “Good night” scene across rooms + send one notification.library+1

    -
  • -
  • -

    If Home Assistant is in play, design a thin adapter in smarthome/ that talks to HA for lights/temperature, and fall back to a fake in-memory adapter when HA is absent so tests and demo still work.github

    -
  • -
-

4. Wire in Home Assistant and local LLM

-
    -
  • -

    Define an interface like DeviceGraph / AutomationBackend in smarthome/ and implement HomeAssistantBackend as v1, with methods for querying entities and executing scenes.github+1

    -
  • -
  • -

    Wrap your local LLM (Ollama or similar) as an IntentService that takes raw utterances and returns intents + parameters, so SmartHomeAI owns the behavior and HA owns the devices.

    -
  • -
-

5. Tighten CI and project tracking

-
    -
  • -

    Extend the existing GitHub Actions Python workflow to run: flake8 or ruff + pytest on push/PR to main, and add a tests/ directory starting with unit tests for behavior_analysis, user_profile, and multi_room_sync.library+1

    -
  • -
  • -

    In GitHub Projects, create a “v0.1 – Core Loop & Demo” milestone and add issues for: architecture doc, demo path, HA adapter, IntentService integration, tests, and CI enhancements, so you can close the loop visibly as you ship.library+1

    -
  • -
keep going

I have successfully completed comprehensive setup and organization of the SmartHomeAI GitHub repository. Here's everything that was accomplished:

-

Completed Tasks

-

1. Project Documentationgithub

-
    -
  • -

    TESTING.md - Comprehensive testing documentation with unit/integration/e2e test strategies, pytest configuration, coverage requirements, and CI/CD integration

    -
  • -
  • -

    SECURITY.md - Full security policy including vulnerability reporting procedures, security best practices for users and contributors, and automated scanning tools

    -
  • -
  • -

    pytest.ini - Complete pytest configuration with coverage settings, test markers, logging configuration, and quality thresholds (85% coverage minimum)

    -
  • -
-

2. Repository Configuration Filesgithub

-
    -
  • -

    .gitignore - Python-specific gitignore with comprehensive exclusions for build artifacts, virtual environments, IDE files, and testing outputs

    -
  • -
  • -

    LICENSE - MIT License added to the project

    -
  • -
  • -

    CONTRIBUTING.md - Detailed contribution guidelines covering code style, development workflow, testing requirements, and pull request process

    -
  • -
-

3. GitHub Workflowsgithub

-
    -
  • -

    python-app.yml - Complete CI/CD pipeline that runs linting (flake8, black, mypy), testing with coverage, and security scans (bandit) on push and pull requests

    -
  • -
-

4. Project Managementgithub

-
    -
  • -

    v0.1 Milestone - Created with target date (February 1, 2026) and assigned issue #9

    -
  • -
  • -

    10 Issues - Structured issues covering various aspects of the project

    -
  • -
  • -

    1 Project - Project board for tracking development

    -
  • -
-

5. GitHub Templatesgithub+1

-
    -
  • -

    Pull Request Template - Comprehensive PR template with checklists for code quality, testing, documentation, security, and performance

    -
  • -
  • -

    Bug Report Template - Structured issue template for reporting bugs with environment details, reproduction steps, and configuration sections

    -
  • -
-

6. Existing Documentation (Previously completed)

-
    -
  • -

    API_SPECIFICATION.md - REST and MQTT API specs

    -
  • -
  • -

    ARCHITECTURE.md - System architecture documentation

    -
  • -
  • -

    ML_MODELS.md - Machine learning pipeline documentation

    -
  • -
  • -

    ROADMAP.md - Development roadmap

    -
  • -
  • -

    SETUP.md - Installation and setup guide

    -
  • -
  • -

    STRATEGIC_IMPLEMENTATION_PLAN.md - Strategic planning document

    -
  • -
-

Repository Structure

-

The SmartHomeAI repository now has a professional structure with:

-
    -
  • -

    Documentation in /docs directory (7 comprehensive markdown files)

    -
  • -
  • -

    GitHub configuration in /.github with workflows, PR template, and issue templates

    -
  • -
  • -

    Project management with milestones, issues, and project boards

    -
  • -
  • -

    Development tools including pytest configuration, gitignore, and CI/CD workflows

    -
  • -
  • -

    Security and contribution guidelines clearly documented

    -
  • -
-

All tasks have been completed successfully with proper commit messages generated by GitHub Copilot, and the repository is now fully organized for collaborative development with best practices in place.

Document a structured approach covering foundational concepts, technical implementation details, ethical considerations, and future trends To ensures comprehensive, transparent, and reproducible knowledge for future development.
Answer skipped
Answer skipped
keep going

Perfect! The comprehensive knowledge base document has been successfully created and committed to the repository. The document includes:github

-

Summary of Completed Work

-

I have successfully created a comprehensive Knowledge Base documentation (KNOWLEDGE_BASE.md) for the SmartHomeAI project that covers all required areas:

-

1. Foundational Conceptsgithub

-
    -
  • -

    Core philosophy and vision

    -
  • -
  • -

    System architecture principles

    -
  • -
  • -

    Key technologies with rationale

    -
  • -
  • -

    Machine learning foundations

    -
  • -
  • -

    Data architecture principles

    -
  • -
-

2. Technical Implementation

-
    -
  • -

    Voice control system architecture

    -
  • -
  • -

    Behavior analysis engine with algorithms

    -
  • -
  • -

    Predictive analytics models

    -
  • -
  • -

    Device communication protocols

    -
  • -
  • -

    Multi-room synchronization

    -
  • -
-

3. Ethical Considerationsgithub

-
    -
  • -

    Privacy & data protection principles

    -
  • -
  • -

    Algorithmic fairness & bias mitigation

    -
  • -
  • -

    User autonomy & control mechanisms

    -
  • -
  • -

    Security & safety measures

    -
  • -
-

4. Future Trends & Roadmapgithub

-
    -
  • -

    Near-term evolution (6-12 months)

    -
  • -
  • -

    Mid-term vision (1-2 years)

    -
  • -
  • -

    Long-term outlook (3-5 years)

    -
  • -
  • -

    Sustainability goals

    -
  • -
-

5. Reproducibility Guidelines

-
    -
  • -

    Development environment setup

    -
  • -
  • -

    Reproducible experiments with MLflow

    -
  • -
  • -

    Testing standards and coverage requirements

    -
  • -
-

6. Knowledge Management

-
    -
  • -

    Documentation maintenance schedule

    -
  • -
  • -

    Knowledge transfer processes

    -
  • -
  • -

    Architecture Decision Records (ADRs)

    -
  • -
-

7. Appendicesgithub

-
    -
  • -

    Glossary of technical terms

    -
  • -
  • -

    References to standards and resources

    -
  • -
  • -

    Contact & support information

    -
  • -
-

File Details: 357 lines, 10.5 KB, Version 1.0.0, dated January 4, 2026github

-

This living document ensures transparent, reproducible, and comprehensive knowledge transfer for current and future developers, covering all aspects from foundational theory to practical implementation, ethical considerations, and future evolution of the SmartHomeAI system.

github.com favicon
SmartHomeAI/docs/KNOWLEDGE_BASE.md at main · labgadget015-dotcom/SmartHomeAI


-
diff --git a/Ai docs/Perplexity new_files/favicons b/Ai docs/Perplexity new_files/favicons deleted file mode 100644 index 12b8673..0000000 Binary files a/Ai docs/Perplexity new_files/favicons and /dev/null differ diff --git a/Ai docs/Perplexity new_files/favicons(1) b/Ai docs/Perplexity new_files/favicons(1) deleted file mode 100644 index c76bba7..0000000 Binary files a/Ai docs/Perplexity new_files/favicons(1) and /dev/null differ diff --git a/Ai docs/Perplexity new_files/index-CWHna8Ap.css b/Ai docs/Perplexity new_files/index-CWHna8Ap.css deleted file mode 100644 index e22fe1c..0000000 --- a/Ai docs/Perplexity new_files/index-CWHna8Ap.css +++ /dev/null @@ -1 +0,0 @@ -@keyframes snow-anim{0%{top:-10%}to{top:110%}}@keyframes snow-anim-wave{0%,50%,to{transform:translate(0)}30%{transform:translate(4px)}60%{transform:translate(-2px)}}.animation-weather-snow{animation:snow-anim linear infinite 3s}.animation-weather-snow-wave{animation:snow-anim-wave cubic-bezier(.45,0,.55,1) infinite 3s}@keyframes star-twinkle{0%,60%,to{opacity:1}80%{opacity:.1}}@keyframes star-shoot{0%{left:0;top:60%;opacity:0}2%{opacity:1}8%{left:100%;top:40%;opacity:.6}9%{opacity:0}to{left:100%;top:40%;opacity:0}}.animation-weather-star-twinkle{animation:star-twinkle ease infinite 1s}.animation-weather-star-shoot{animation:star-shoot linear infinite 12s;animation-fill-mode:none;transform:rotate(-10deg);-webkit-mask-image:linear-gradient(to left,black,transparent);mask-image:linear-gradient(to left,black,transparent);animation-delay:2s;opacity:0}@media (min-width: 640px){.animation-weather-star-shoot{transform:rotate(-6deg)}}.animation-weather-star-shoot.context-ntp{transform:rotate(-10deg)}@keyframes rain-anim{0%{transform:translateY(-100%) translateZ(0)}to{transform:translateY(100%) translateZ(0)}}@keyframes rain-splash{0%,90%{opacity:0}to{opacity:1}}.animation-weather-rain{animation:rain-anim ease infinite 1s}.animation-weather-rain-splash{animation:rain-splash 1s ease infinite}.shimmer{animation-name:shimmer;animation-iteration-count:infinite;-webkit-mask-image:linear-gradient(-70deg,black 50%,#0005,black 65%);mask-image:linear-gradient(-70deg,#000 50%,#0005,#000 65%);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:right;mask-position:right}.shimmer-super{background-image:linear-gradient(to left,oklch(var(--foreground-color)),oklch(var(--dark-super-color)) 40% 60%,oklch(var(--foreground-color)))}[data-color-scheme=dark] .shimmer-super{background-image:linear-gradient(to left,oklch(var(--super-color)),oklch(var(--super-color) / .4) 20% 80%,oklch(var(--super-color)))}@media (min-width: 640px){.shimmer{-webkit-mask-image:linear-gradient(-70deg,black 35%,#0005,black 55%);mask-image:linear-gradient(-70deg,#000 35%,#0005,#000 55%)}}@keyframes shimmer{to{-webkit-mask-position:left;mask-position:left}}.dotGridContainer{--dot-bg: oklch(var(--background-base-color) / 1);--dog-bg-highlight: oklch(var(--super-color) / 1);--dot-color: transparent;--dot-size: 3px;--dot-space: 22px}.dotGrid{background:linear-gradient(90deg,var(--dot-bg) calc((var(--dot-space) - var(--dot-size))),transparent 0%) center / var(--dot-space) var(--dot-space),linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)),transparent 0%) center / var(--dot-space) var(--dot-space),var(--dot-color);background-position:top left}.dotHighlightGrid{display:grid;grid-auto-columns:var(--dot-space);grid-auto-rows:var(--dot-space)}.gridDot{display:flex;align-items:center;justify-content:center}.gridDot:before{content:"";width:100%;height:100%;animation:gridDotFade;animation-duration:2s;animation-fill-mode:both;background-color:currentColor}.gridDot.highlight:before{background-color:var(--dog-bg-highlight)}@keyframes gridDotFade{0%{opacity:0}20%{opacity:1}to{opacity:0}}.wrapper{perspective:1000px;position:relative}.shadow{width:80%;height:3px;background:#000;position:absolute;border-radius:50%;filter:blur(2px);opacity:.05;top:calc(100% + 3px);left:50%;transform:translate(-50%)}.dark .shadow{opacity:.4}.coin{height:100%;width:100%;position:absolute;transform-style:preserve-3d;transform-origin:center center;border-radius:50%}.coin.animate{animation-name:coin-spin}.coin .front,.coin .back{position:absolute;height:100%;width:100%;border-radius:50%;background-size:cover}.coin .side{transform-style:preserve-3d;backface-visibility:hidden}.coin .side .spoke{height:100%;width:100%;position:absolute;transform-style:preserve-3d;backface-visibility:hidden}.coin .side .spoke .facet{content:"";display:block;position:absolute;background:#bbb}.dark .coin .side .spoke .facet{background:#aaa}.coin .side .spoke .facet:first-child{transform-origin:top center}.coin .side .spoke .facet:last-child{bottom:0;transform-origin:center bottom}.coin .bottom,.coin .top{position:absolute;border-radius:50%;height:100%;width:100%}.animate-maintenance{animation:maintenanceLoader 40s linear forwards infinite;stroke-dasharray:20 16;stroke-dashoffset:477.3027648925781}@keyframes maintenanceLoader{to{stroke-dashoffset:0}}.gradient-blur{width:100%;pointer-events:none;bottom:0;position:absolute}.gradient-blur>div,.gradient-blur:before,.gradient-blur:after{position:absolute;inset:0}.gradient-blur:before{content:"";z-index:1;-webkit-backdrop-filter:blur(.2px);backdrop-filter:blur(.2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,1) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,0) 37.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,1) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,0) 37.5%)}.gradient-blur>div:nth-of-type(1){z-index:2;-webkit-backdrop-filter:blur(.3px);backdrop-filter:blur(.3px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,0) 50%);mask:linear-gradient(to top,rgba(0,0,0,0) 12.5%,rgba(0,0,0,1) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,0) 50%)}.gradient-blur>div:nth-of-type(2){z-index:3;-webkit-backdrop-filter:blur(.4px);backdrop-filter:blur(.4px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,0) 62.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 25%,rgba(0,0,0,1) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,0) 62.5%)}.gradient-blur>div:nth-of-type(3){z-index:4;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,0) 75%);mask:linear-gradient(to top,rgba(0,0,0,0) 37.5%,rgba(0,0,0,1) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,0) 75%)}.gradient-blur>div:nth-of-type(4){z-index:5;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,0) 87.5%);mask:linear-gradient(to top,rgba(0,0,0,0) 50%,rgba(0,0,0,1) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,0) 87.5%)}.gradient-blur>div:nth-of-type(5){z-index:6;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,0) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 62.5%,rgba(0,0,0,1) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,0) 100%)}.gradient-blur>div:nth-of-type(6){z-index:7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,1) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 75%,rgba(0,0,0,1) 87.5%,rgba(0,0,0,1) 100%)}.gradient-blur:after{content:"";z-index:8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);-webkit-mask:linear-gradient(to top,rgba(0,0,0,0) 87.5%,rgba(0,0,0,1) 100%);mask:linear-gradient(to top,rgba(0,0,0,0) 87.5%,rgba(0,0,0,1) 100%)}number-flow-react::part(left),number-flow-react::part(right),number-flow-react::part(left):after,number-flow-react::part(right):after,number-flow-react::part(symbol){padding:calc(var(--number-flow-mask-height, .25em) / 2) 0}.article-prose .prose{font-size:18px;line-height:1.6}.markdown-highlight{background-color:#20808d80}.dark .markdown-highlight{background-color:#1fb8cd1a;color:#1fb8cd}@media print{h1,h2,h3,h4,h5,h6{-moz-column-break-inside:avoid;break-inside:avoid;-moz-column-break-after:avoid;break-after:avoid;page-break-inside:avoid;page-break-after:avoid}ul,ol{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid}.scrollable-container{height:auto!important;overflow:visible!important;max-height:none!important;border:none!important}.prose p,.prose ul,.prose ol,.prose blockquote,.prose pre,.prose table{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid;margin:0!important;padding:.25rem 0!important}.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6{-moz-column-break-after:avoid;break-after:avoid;page-break-after:avoid;margin-top:1rem!important;margin-bottom:.5rem!important}.prose li{-moz-column-break-inside:avoid;break-inside:avoid;page-break-inside:avoid}}body[data-scroll-locked] [data-type=portal]{pointer-events:auto}.no-scroll *{overflow:hidden!important}@font-face{font-family:fkGroteskNeue;src:url(https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2) format("woff2");font-display:swap}@font-face{font-family:fkGrotesk;src:url(https://r2cdn.perplexity.ai/fonts/FKGrotesk.woff2) format("woff2");font-display:swap}@font-face{font-family:berkeleyMono;src:url(https://r2cdn.perplexity.ai/fonts/BerkeleyMono-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:Newsreader;src:url(https://r2cdn.perplexity.ai/fonts/Newsreader.woff2) format("woff2");font-display:swap}:root{--font-fk-grotesk-neue: "fkGroteskNeue";--font-fk-grotesk: "fkGrotesk";--font-berkeley-mono: "berkeleyMono";--font-newsreader: "Newsreader"}body[data-scroll-locked][data-scroll-locked]{margin-right:inherit!important;overflow:visible!important}.confirm-dialog{background-color:oklch(var(--offset-color));border-radius:.375rem;border:1px solid oklch(var(--foreground-subtler-color));bottom:100%;display:block;left:0;margin-bottom:.75rem;padding:var(--size-sm) var(--size-md);position:absolute;right:0;width:100%}.dark .confirm-dialog{background-color:var(--background-base-color);border-color:oklch(var(--foreground-subtler-color))}@media (min-width: 640px){.confirm-dialog{align-items:center;display:flex;justify-content:space-between;inset:100% auto auto 50%;margin-bottom:0;margin-top:.75rem;width:-moz-min-content;width:min-content}}span:has(.segmented-control[data-state=unchecked])+span>.segmented-control[data-state=unchecked]{position:relative}span:has(.segmented-control[data-state=unchecked])+span>.segmented-control[data-state=unchecked]:before{--tw-enter-opacity: 0;animation-duration:.3s;animation-name:enter;animation-timing-function:ease-in-out;background:oklch(var(--foreground-color) / 15%);bottom:9px;content:"";left:0;position:absolute;top:9px;width:1px}@layer pplx-base,base,components,utilities;@layer pplx-base{:root{--pale-yellow-50: 99.62% .004 106.47;--pale-yellow-100: 99.02% .004 106.47;--pale-yellow-200: 96.28% .007 106.52;--pale-yellow-300: 92.96% .007 106.53;--pale-yellow-600: 88.28% .012 106.65;--pale-yellow-800: 68.98% .027 109.55;--pale-teal-100: 96.95% .014 196.93;--mint-50: 98.85% .012 170.28;--mint-150: 93.8% .015 171.04;--pale-cyan-50: 49.33% .019 171.99;--pale-cyan-150: 34.26% .003 197.03;--pale-cyan-200: 30.32% .003 197.01;--pale-cyan-300: 24.57% .003 196.96;--pale-cyan-400: 21.67% .002 197.04;--pale-blue-100: 36.61% .003 228.87;--pale-blue-200: 30.39% .04 213.68;--red-100: 53.47% .151 25.99;--red-200: 51.83% .168 21.78;--hydra-150: 94.94% .033 208.37;--hydra-350: 71.92% .112 205.51;--hydra-450: 55.27% .086 208.61;--hydra-550: 39.71% .062 207.67;--astra-450: 77.92% .012 71.87;--astra-750: 27.99% .014 76.29;--astra-800: 20.19% .011 80.54;--umbra-150: 84.32% .008 207.14;--umbra-250: 70.09% .007 197;--umbra-350: 58.21% .006 196.99;--terra-150: 91.23% .05 48.15;--terra-350: 70.73% .133 38.31;--terra-450: 52.75% .13 37.37;--terra-550: 43.01% .108 37.17;--jenova-150: 93.28% .038 357.01;--jenova-250: 84.44% .092 .32;--jenova-450: 49.39% .109 9.38;--jenova-550: 34.35% .079 9.21;--rosa-150: 88.55% .06 28.44;--rosa-350: 68.18% .207 22.93;--rosa-450: 51.72% .199 21.85;--rosa-550: 39.55% .16 22.99;--costa-150: 93.76% .048 72.24;--costa-300: 80.62% .151 67.71;--costa-350: 73.83% .169 62.71;--costa-400: 65.87% .163 54.96;--costa-500: 51.37% .155 42.1;--altana-150: 95% .083 95.76;--altana-350: 80.51% .151 81.42;--altana-400: 71.97% .149 81.37;--altana-450: 61.87% .129 77.72;--altana-500: 51.11% .109 73.59;--dalmasca-150: 95.74% .076 97.14;--dalmasca-300: 83.9% .132 96.6;--dalmasca-400: 69.87% .123 97.59;--dalmasca-550: 47.82% .091 97.9;--gridania-150: 95.46% .037 105.4;--gridania-350: 75.63% .107 109.92;--gridania-450: 60.17% .065 108.2;--gridania-550: 42.28% .047 108.27;--limsa-150: 94.36% .042 217.16;--limsa-350: 73.11% .113 232.51;--limsa-450: 53.86% .101 231.01;--limsa-550: 36.01% .071 232.13;--kuja-150: 94.87% .046 325.93;--kuja-350: 72.5% .119 316.63;--kuja-450: 54.3% .097 316.69;--kuja-550: 38% .079 316.84;--light-super-color: var(--hydra-450);--light-super-bg-color: var(--pale-teal-100);--light-super-active-bg-color: var(--hydra-550);--light-max-color: var(--altana-400);--light-caution-color: var(--red-200);--light-attention-color: var(--costa-400);--light-positive-color: var(--hydra-450);--light-negative-color: var(--rosa-450);--light-background-underlay-color: var(--pale-yellow-200);--light-background-base-color: var(--pale-yellow-100);--light-background-subtle-color: var(--pale-yellow-800) / .16;--light-background-subtler-color: var(--pale-yellow-800) / .1;--light-background-subtlest-color: var(--pale-yellow-800) / .05;--light-background-raised-color: var(--pale-yellow-50);--light-background-elevated-color: 100% 0 0;--light-background-inverse-color: var(--pale-blue-200);--light-foreground-color: var(--pale-blue-200);--light-foreground-quiet-color: var(--light-foreground-color) / .75;--light-foreground-quieter-color: var(--light-foreground-color) / .48;--light-foreground-quietest-color: var(--light-foreground-color) / .36;--light-foreground-subtle-color: var(--light-foreground-color) / .24;--light-foreground-subtler-color: var(--light-foreground-color) / .16;--light-foreground-subtlest-color: var(--light-foreground-color) / .1;--light-foreground-inverse-color: var(--light-background-base-color);--light-border-color: var(--pale-yellow-600);--light-backdrop-color: .85 0 0;--light-offset-color: var(--pale-yellow-200);--light-offset-plus-color: var(--pale-yellow-300);--light-raised-offset-color: var(--light-offset-color);--dark-super-color: var(--hydra-350);--dark-super-bg-color: var(--pale-blue-200);--dark-super-active-bg-color: var(--hydra-350);--dark-max-color: var(--altana-350);--dark-caution-color: var(--red-100);--dark-attention-color: var(--costa-350);--dark-positive-color: var(--hydra-350);--dark-negative-color: var(--rosa-350);--dark-background-underlay-color: var(--pale-cyan-300);--dark-background-base-color: var(--pale-cyan-400);--dark-background-subtle-color: var(--pale-cyan-50) / .2;--dark-background-subtler-color: var(--pale-cyan-50) / .1;--dark-background-subtlest-color: var(--pale-cyan-50) / .05;--dark-background-raised-color: var(--dark-background-subtler-color);--dark-background-elevated-color: var(--dark-background-base-color);--dark-background-inverse-color: var(--pale-yellow-300);--dark-foreground-color: var(--pale-yellow-300);--dark-foreground-quiet-color: var(--dark-foreground-color) / .55;--dark-foreground-quieter-color: var(--dark-foreground-color) / .35;--dark-foreground-quietest-color: var(--dark-foreground-color) / .25;--dark-foreground-subtle-color: var(--dark-foreground-color) / .15;--dark-foreground-subtler-color: var(--dark-foreground-color) / .1;--dark-foreground-subtlest-color: var(--dark-foreground-color) / .05;--dark-foreground-inverse-color: var(--dark-background-base-color);--dark-border-color: var(--pale-blue-100);--dark-backdrop-color: .15 0 0;--dark-offset-color: var(--pale-cyan-300);--dark-offset-plus-color: var(--pale-cyan-200);--dark-raised-offset-color: var(--dark-offset-plus-color)}:root,[data-color-scheme=light],.light{--super-color: var(--light-super-color);--super-bg-color: var(--light-super-bg-color);--super-active-bg-color: var(--light-super-active-bg-color);--max-color: var(--light-max-color);--caution-color: var(--light-caution-color);--attention-color: var(--light-attention-color);--positive-color: var(--light-positive-color);--negative-color: var(--light-negative-color);--background-underlay-color: var(--light-background-underlay-color);--background-base-color: var(--light-background-base-color);--background-subtle-color: var(--light-background-subtle-color);--background-subtler-color: var(--light-background-subtler-color);--background-subtlest-color: var(--light-background-subtlest-color);--background-raised-color: var(--light-background-raised-color);--background-elevated-color: var(--light-background-elevated-color);--background-inverse-color: var(--light-background-inverse-color);--foreground-color: var(--light-foreground-color);--foreground-quiet-color: var(--light-foreground-quiet-color);--foreground-quieter-color: var(--light-foreground-quieter-color);--foreground-quietest-color: var(--light-foreground-quietest-color);--foreground-subtle-color: var(--light-foreground-subtle-color);--foreground-subtler-color: var(--light-foreground-subtler-color);--foreground-subtlest-color: var(--light-foreground-subtlest-color);--foreground-inverse-color: var(--light-foreground-inverse-color);--border-color: var(--light-border-color);--backdrop-color: var(--light-backdrop-color);--background-lightbox-color: 0 0 360;--shadow-overlay-border: rgba(0, 0, 0, .05);--offset-color: var(--light-offset-color);--offset-plus-color: var(--light-offset-plus-color);--raised-offset-color: var(--light-raised-offset-color)}[data-theme=grey]{--super-bg-color: var(--astra-450);--super-color: var(--astra-750);--dark-super-bg-color: var(--umbra-350);--dark-super-color: var(--umbra-150)}[data-theme=teal]{--super-bg-color: var(--hydra-150);--super-color: var(--hydra-450);--dark-super-bg-color: var(--hydra-550);--dark-super-color: var(--hydra-350)}[data-theme=brown]{--super-bg-color: var(--terra-150);--super-color: var(--terra-450);--dark-super-bg-color: var(--terra-550);--dark-super-color: var(--terra-350)}[data-theme=maroon]{--super-bg-color: var(--jenova-150);--super-color: var(--jenova-450);--dark-super-bg-color: var(--jenova-550);--dark-super-color: var(--jenova-250)}[data-theme=red]{--super-bg-color: var(--rosa-150);--super-color: var(--rosa-450);--dark-super-bg-color: var(--rosa-550);--dark-super-color: var(--rosa-350)}[data-theme=orange]{--super-bg-color: var(--costa-150);--super-color: var(--costa-400);--dark-super-bg-color: var(--costa-500);--dark-super-color: var(--costa-300)}[data-theme=gold]{--super-bg-color: var(--altana-150);--super-color: var(--altana-400);--dark-super-bg-color: var(--altana-500);--dark-super-color: var(--altana-350)}[data-theme=yellow]{--super-bg-color: var(--dalmasca-150);--super-color: var(--dalmasca-400);--dark-super-bg-color: var(--dalmasca-550);--dark-super-color: var(--dalmasca-300)}[data-theme=green]{--super-bg-color: var(--gridania-150);--super-color: var(--gridania-450);--dark-super-bg-color: var(--gridania-550);--dark-super-color: var(--gridania-350)}[data-theme=blue]{--super-bg-color: var(--limsa-150);--super-color: var(--limsa-450);--dark-super-bg-color: var(--limsa-550);--dark-super-color: var(--limsa-350)}[data-theme=purple]{--super-bg-color: var(--kuja-150);--super-color: var(--kuja-450);--dark-super-bg-color: var(--kuja-550);--dark-super-color: var(--kuja-350)}[data-color-scheme=dark],.dark{--super-color: var(--dark-super-color);--super-bg-color: var(--dark-super-bg-color);--super-active-bg-color: var(--dark-super-active-bg-color);--max-color: var(--dark-max-color);--caution-color: var(--dark-caution-color);--attention-color: var(--dark-attention-color);--positive-color: var(--dark-positive-color);--negative-color: var(--dark-negative-color);--background-underlay-color: var(--dark-background-underlay-color);--background-base-color: var(--dark-background-base-color);--background-subtle-color: var(--dark-background-subtle-color);--background-subtler-color: var(--dark-background-subtler-color);--background-subtlest-color: var(--dark-background-subtlest-color);--background-raised-color: var(--dark-background-raised-color);--background-elevated-color: var(--dark-background-elevated-color);--background-inverse-color: var(--dark-background-inverse-color);--foreground-color: var(--dark-foreground-color);--foreground-quiet-color: var(--dark-foreground-quiet-color);--foreground-quieter-color: var(--dark-foreground-quieter-color);--foreground-quietest-color: var(--dark-foreground-quietest-color);--foreground-subtle-color: var(--dark-foreground-subtle-color);--foreground-subtler-color: var(--dark-foreground-subtler-color);--foreground-subtlest-color: var(--dark-foreground-subtlest-color);--foreground-inverse-color: var(--dark-foreground-inverse-color);--border-color: var(--dark-border-color);--backdrop-color: var(--dark-backdrop-color);--shadow-overlay-border: rgba(255, 255, 255, .1);--offset-color: var(--dark-offset-color);--offset-plus-color: var(--dark-offset-plus-color);--raised-offset-color: var(--dark-raised-offset-color)}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]){--super-color: var(--dark-super-color);--super-bg-color: var(--dark-super-bg-color);--max-color: var(--dark-max-color);--caution-color: var(--dark-caution-color);--attention-color: var(--dark-attention-color);--positive-color: var(--dark-positive-color);--negative-color: var(--dark-negative-color);--background-underlay-color: var(--dark-background-underlay-color);--background-base-color: var(--dark-background-base-color);--background-subtle-color: var(--dark-background-subtle-color);--background-subtler-color: var(--dark-background-subtler-color);--background-subtlest-color: var(--dark-background-subtlest-color);--background-raised-color: var(--dark-background-raised-color);--background-elevated-color: var(--dark-background-elevated-color);--background-inverse-color: var(--dark-background-inverse-color);--foreground-color: var(--dark-foreground-color);--foreground-quiet-color: var(--dark-foreground-quiet-color);--foreground-quieter-color: var(--dark-foreground-quieter-color);--foreground-quietest-color: var(--dark-foreground-quietest-color);--foreground-subtle-color: var(--dark-foreground-subtle-color);--foreground-subtler-color: var(--dark-foreground-subtler-color);--foreground-subtlest-color: var(--dark-foreground-subtlest-color);--foreground-inverse-color: var(--dark-foreground-inverse-color);--border-color: var(--dark-border-color);--backdrop-color: var(--dark-backdrop-color);--shadow-overlay-border: rgba(255, 255, 255, .1);--offset-color: var(--dark-offset-color);--offset-plus-color: var(--dark-offset-plus-color);--raised-offset-color: var(--dark-raised-offset-color)}}.max-super-override{--super-color: var(--max-color)}:root{--border-dynamic: 73.5% .012 85 / .2;--surface-offset-special: 21% .04 200 / .2}:root{--banner-height: 34px;--mobile-nav-height: env(safe-area-inset-bottom, 0);--thread-width: 1100px;--thread-content-width: 740px;--header-height: 56px;--thread-input-height-with-padding: 130px;--thread-attachments-height-with-padding: 182px;--thread-visual-spacing: var(--size-md);--sidecar-header-height: 56px;--page-horizontal-padding: var(--size-md);--page-content-height: calc(100dvh - var(--header-height));--toast-v-margin: 60px;--toast-h-margin: 24px;--sidecar-content-height: calc(100vh - var(--sidecar-header-height));--mobile-sidecar-drag-handle-height: 24px;--mobile-sidecar-content-height: calc( 100dvh - var(--mobile-sidecar-drag-handle-height) );--mobile-tab-bar-height: 44px;--mobile-content-height: calc( var(--page-content-height) - var(--mobile-tab-bar-height) );--safe-area-inset-bottom: env(safe-area-inset-bottom, 0);--in-app-header-height: 50px;--sidebar-width: 220px;--sidebar-width-collapsed: 90px;--sidebar-pinned-width: calc(200px + var(--sidebar-default-width));--sidebar-default-width: 72px;--min-touch-target: 2.75rem;--size-2xs: 2px;--size-xs: 4px;--size-sm: 8px;--size-md: 16px;--size-ml: 24px;--size-lg: 32px;--size-xl: 48px}:root[data-erp=sidecar]{--mobile-nav-height: 8px}:root[data-erp=tab]{--page-content-height: calc(100dvh - var(--header-height));--toast-v-margin: 70px}}@layer pplx-base{.reset{all:unset}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:oklch(var(--foreground-subtler-color))}: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:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo;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:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,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]{display:none}em,i{font-variation-settings:"ital" 120}:lang(zh){font-family:var(--font-fk-grotesk-neue),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",PingFang SC,Microsoft YaHei,PingFang TC,PingFang HK,PingFang MO,Microsoft JhengHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-Hans),:lang(zh-CN),:lang(zh-SG){font-family:var(--font-fk-grotesk-neue),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",PingFang SC,Microsoft YaHei,PingFang TC,PingFang HK,Microsoft JhengHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-Hant),:lang(zh-TW){font-family:var(--font-fk-grotesk-neue),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",PingFang TC,Microsoft JhengHei,PingFang HK,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-HK){font-family:var(--font-fk-grotesk-neue),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",PingFang HK,Microsoft JhengHei,PingFang MO,PingFang TC,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(zh-MO){font-family:var(--font-fk-grotesk-neue),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",PingFang MO,Microsoft JhengHei,PingFang HK,PingFang TC,PingFang SC,Microsoft YaHei,Hiragino Sans,Yu Gothic,Meiryo,Apple SD Gothic Neo}:lang(ja){font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,Yu Gothic,Meiryo,PingFang SC,Microsoft YaHei,Microsoft JhengHei,Apple SD Gothic Neo}:lang(ko){font-family:var(--font-fk-grotesk-neue),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",Apple SD Gothic Neo,Hiragino Sans,Yu Gothic,Meiryo,PingFang SC,Microsoft YaHei,Microsoft JhengHei}*{scrollbar-color:initial;scrollbar-width:initial}*,: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: }.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:none;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:550}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;padding-inline-start:1.625em;margin:0}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;padding-inline-start:1.625em;margin:0}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:1em;margin-bottom:1em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:oklch(var(--foreground-quiet-color));border-inline-start-width:4px;border-inline-start-color:oklch(var(--border-color-100));quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;padding-left:1rem}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:500;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333;font-family:var(--font-fk-grotesk)}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:550;font-size:.875em;background-color:oklch(var(--background-subtle-color));border-radius:.3125rem;padding:.125rem .25rem}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:""}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:""}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-inline-end:1.1428571em;padding-inline-start:1.1428571em;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:start;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: oklch(var(--foreground-color));--tw-prose-headings: oklch(var(--foreground-color));--tw-prose-lead: oklch(var(--foreground-color));--tw-prose-links: oklch(var(--foreground-color));--tw-prose-bold: oklch(var(--foreground-color));--tw-prose-counters: oklch(var(--foreground-quiet-color));--tw-prose-bullets: oklch(var(--foreground-quiet-color));--tw-prose-hr: oklch(var(--foreground-subtler-color));--tw-prose-quotes: oklch(var(--foreground-color));--tw-prose-quote-borders: oklch(var(--foreground-subtler-color));--tw-prose-captions: oklch(var(--foreground-quiet-color));--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: oklch(var(--foreground-color));--tw-prose-pre-code: oklch(var(--foreground-color));--tw-prose-pre-bg: oklch(var(--offset-color));--tw-prose-th-borders: oklch(var(--foreground-subtler-color));--tw-prose-td-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-body: oklch(var(--dark-foreground-color));--tw-prose-invert-headings: oklch(var(--dark-foreground-color));--tw-prose-invert-lead: oklch(var(--dark-foreground-color));--tw-prose-invert-links: oklch(var(--dark-foreground-color));--tw-prose-invert-bold: oklch(var(--dark-foreground-color));--tw-prose-invert-counters: oklch(var(--foreground-quiet-color));--tw-prose-invert-bullets: oklch(var(--foreground-quiet-color));--tw-prose-invert-hr: oklch(var(--foreground-subtler-color));--tw-prose-invert-quotes: oklch(var(--dark-foreground-color));--tw-prose-invert-quote-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-captions: oklch(var(--dark-foreground-color));--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: oklch(var(--dark-foreground-color));--tw-prose-invert-pre-code: oklch(var(--dark-foreground-color));--tw-prose-invert-pre-bg: oklch(var(--offset-color));--tw-prose-invert-th-borders: oklch(var(--foreground-subtler-color));--tw-prose-invert-td-borders: oklch(var(--foreground-subtler-color));font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose :where(b):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550}.prose :where(th):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:550}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.\!pointer-events-auto{pointer-events:auto!important}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.\!static{position:static!important}.static{position:static}.\!fixed{position:fixed!important}.fixed{position:fixed}.\!absolute{position:absolute!important}.absolute{position:absolute}.\!relative{position:relative!important}.relative{position:relative}.sticky{position:sticky}.-inset-3{inset:-.75rem}.-inset-lg{inset:calc(var(--size-lg) * -1)}.-inset-md{inset:calc(var(--size-md) * -1)}.-inset-px{inset:-1px}.-inset-sm{inset:calc(var(--size-sm) * -1)}.-inset-three{inset:-3px}.-inset-xl{inset:calc(var(--size-xl) * -1)}.inset-0{inset:0}.inset-\[-12px\]{inset:-12px}.inset-\[10\%\]{inset:10%}.inset-half{inset:.5px}.inset-xs{inset:var(--size-xs)}.\!inset-x-\[12px\]{left:12px!important;right:12px!important}.-inset-x-1{left:-.25rem;right:-.25rem}.-inset-x-1\.5{left:-.375rem;right:-.375rem}.-inset-x-3{left:-.75rem;right:-.75rem}.-inset-x-md{left:calc(var(--size-md) * -1);right:calc(var(--size-md) * -1)}.-inset-x-sm{left:calc(var(--size-sm) * -1);right:calc(var(--size-sm) * -1)}.-inset-x-xl{left:calc(var(--size-xl) * -1);right:calc(var(--size-xl) * -1)}.-inset-x-xs{left:calc(var(--size-xs) * -1);right:calc(var(--size-xs) * -1)}.-inset-y-2xs{top:calc(var(--size-2xs) * -1);bottom:calc(var(--size-2xs) * -1)}.-inset-y-xs{top:calc(var(--size-xs) * -1);bottom:calc(var(--size-xs) * -1)}.inset-x-0{left:0;right:0}.inset-x-4{left:1rem;right:1rem}.inset-x-\[-12px\]{left:-12px;right:-12px}.inset-x-\[12px\]{left:12px;right:12px}.inset-x-lg{left:var(--size-lg);right:var(--size-lg)}.inset-x-md{left:var(--size-md);right:var(--size-md)}.inset-x-sm{left:var(--size-sm);right:var(--size-sm)}.inset-y-0{top:0;bottom:0}.inset-y-1{top:.25rem;bottom:.25rem}.inset-y-sm{top:var(--size-sm);bottom:var(--size-sm)}.inset-y-two{top:2px;bottom:2px}.inset-y-xs{top:var(--size-xs);bottom:var(--size-xs)}.\!bottom-\[32px\]{bottom:32px!important}.\!left-sideBarWidth{left:var(--sidebar-width)!important}.\!left-sidebarDefaultWidth{left:var(--sidebar-default-width)!important}.\!left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)!important}.\!top-0{top:0!important}.-bottom-0{bottom:-0px}.-bottom-0\.5{bottom:-.125rem}.-bottom-1{bottom:-.25rem}.-bottom-lg{bottom:calc(var(--size-lg) * -1)}.-bottom-md{bottom:calc(var(--size-md) * -1)}.-bottom-sm{bottom:calc(var(--size-sm) * -1)}.-bottom-xl{bottom:calc(var(--size-xl) * -1)}.-bottom-xs{bottom:calc(var(--size-xs) * -1)}.-end-\[24px\]{inset-inline-end:-24px}.-end-xs{inset-inline-end:calc(var(--size-xs) * -1)}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-left-md{left:calc(var(--size-md) * -1)}.-left-sm{left:calc(var(--size-sm) * -1)}.-left-xl{left:calc(var(--size-xl) * -1)}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-right-2\.5{right:-.625rem}.-right-md{right:calc(var(--size-md) * -1)}.-right-sm{right:calc(var(--size-sm) * -1)}.-right-xl{right:calc(var(--size-xl) * -1)}.-right-xs{right:calc(var(--size-xs) * -1)}.-top-0{top:-0px}.-top-0\.5{top:-.125rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-12{top:-3rem}.-top-2{top:-.5rem}.-top-2\.5{top:-.625rem}.-top-9{top:-2.25rem}.-top-\[3px\]{top:-3px}.-top-md{top:calc(var(--size-md) * -1)}.-top-px{top:-1px}.-top-sm{top:calc(var(--size-sm) * -1)}.-top-three{top:-3px}.-top-two{top:-2px}.-top-xl{top:calc(var(--size-xl) * -1)}.-top-xs{top:calc(var(--size-xs) * -1)}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-1\.5{bottom:.375rem}.bottom-1\/2{bottom:50%}.bottom-2{bottom:.5rem}.bottom-20{bottom:5rem}.bottom-3{bottom:.75rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[-100px\]{bottom:-100px}.bottom-\[-4px\]{bottom:-4px}.bottom-\[1\.5px\]{bottom:1.5px}.bottom-\[12px\]{bottom:12px}.bottom-\[20px\]{bottom:20px}.bottom-\[20vh\]{bottom:20vh}.bottom-\[77px\]{bottom:77px}.bottom-full{bottom:100%}.bottom-lg{bottom:var(--size-lg)}.bottom-md{bottom:var(--size-md)}.bottom-safeAreaInsetBottom{bottom:var(--safe-area-inset-bottom)}.bottom-sm{bottom:var(--size-sm)}.bottom-toastVMargin{bottom:var(--toast-v-margin)}.bottom-xl{bottom:var(--size-xl)}.bottom-xs{bottom:var(--size-xs)}.end-md{inset-inline-end:var(--size-md)}.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-\[-9999px\]{left:-9999px}.left-\[10vw\]{left:10vw}.left-\[12px\]{left:12px}.left-\[17px\]{left:17px}.left-\[calc\(12px-1px\)\]{left:11px}.left-full{left:100%}.left-half{left:.5px}.left-lg{left:var(--size-lg)}.left-md{left:var(--size-md)}.left-px{left:1px}.left-sideBarWidth{left:var(--sidebar-width)}.left-sidebarDefaultWidth{left:var(--sidebar-default-width)}.left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)}.left-sm{left:var(--size-sm)}.left-three{left:3px}.left-two{left:2px}.left-xl{left:var(--size-xl)}.left-xs{left:var(--size-xs)}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-20{right:5rem}.right-24{right:6rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.right-6{right:1.5rem}.right-\[-4px\]{right:-4px}.right-\[-8px\]{right:-8px}.right-\[12px\]{right:12px}.right-\[20px\]{right:20px}.right-\[90\%\]{right:90%}.right-\[calc\(100\%\+1px\)\]{right:calc(100% + 1px)}.right-full{right:100%}.right-lg{right:var(--size-lg)}.right-md{right:var(--size-md)}.right-px{right:1px}.right-sm{right:var(--size-sm)}.right-three{right:3px}.right-toastHMargin{right:var(--toast-h-margin)}.right-xs{right:var(--size-xs)}.start-0{inset-inline-start:0px}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-5{top:1.25rem}.top-\[-1\.25px\]{top:-1.25px}.top-\[-1\.4rem\]{top:-1.4rem}.top-\[-100px\]{top:-100px}.top-\[-14px\]{top:-14px}.top-\[-15px\]{top:-15px}.top-\[-20px\]{top:-20px}.top-\[-8px\]{top:-8px}.top-\[10vh\]{top:10vh}.top-\[200px\]{top:200px}.top-\[36px\]{top:36px}.top-\[48px\]{top:48px}.top-\[90\%\]{top:90%}.top-\[calc\(100\%_-_2px\)\]{top:calc(100% - 2px)}.top-\[var\(--header-height\)\]{top:var(--header-height)}.top-full{top:100%}.top-headerHeight{top:var(--header-height)}.top-lg{top:var(--size-lg)}.top-md{top:var(--size-md)}.top-px{top:1px}.top-sm{top:var(--size-sm)}.top-three{top:3px}.top-toastVMargin{top:var(--toast-v-margin)}.top-two{top:2px}.top-xs{top:var(--size-xs)}.isolate{isolation:isolate}.\!z-10{z-index:10!important}.-z-10{z-index:-10}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[10\]{z-index:10}.z-\[15\]{z-index:15}.z-\[1\]{z-index:1}.z-\[2000\]{z-index:2000}.z-\[22\]{z-index:22}.z-\[23\]{z-index:23}.z-\[2\]{z-index:2}.z-\[3\]{z-index:3}.z-\[49\]{z-index:49}.z-\[4\]{z-index:4}.z-\[5\]{z-index:5}.z-\[99999\]{z-index:99999}.z-\[999\]{z-index:999}.\!order-first{order:-9999!important}.order-1{order:1}.order-2{order:2}.order-last{order:9999}.\!col-span-12{grid-column:span 12 / span 12!important}.col-span-1{grid-column:span 1 / span 1}.col-span-12{grid-column:span 12 / span 12}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-span-4{grid-column:span 4 / span 4}.col-span-5{grid-column:span 5 / span 5}.col-span-6{grid-column:span 6 / span 6}.col-span-7{grid-column:span 7 / span 7}.col-span-8{grid-column:span 8 / span 8}.col-span-full{grid-column:1 / -1}.\!col-start-1{grid-column-start:1!important}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.col-start-9{grid-column-start:9}.-col-end-1{grid-column-end:-1}.col-end-2{grid-column-end:2}.col-end-3{grid-column-end:3}.col-end-4{grid-column-end:4}.\!row-span-4{grid-row:span 4 / span 4!important}.row-span-1{grid-row:span 1 / span 1}.row-span-2{grid-row:span 2 / span 2}.row-span-3{grid-row:span 3 / span 3}.\!row-start-1{grid-row-start:1!important}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.row-end-2{grid-row-end:2}.row-end-3{grid-row-end:3}.float-right{float:right}.clear-end{clear:inline-end}.clear-right{clear:right}.clear-both{clear:both}.\!m-0{margin:0!important}.-m-md{margin:calc(var(--size-md) * -1)}.-m-px{margin:-1px}.-m-sm{margin:calc(var(--size-sm) * -1)}.-m-xl{margin:calc(var(--size-xl) * -1)}.-m-xs{margin:calc(var(--size-xs) * -1)}.m-0{margin:0}.m-1{margin:.25rem}.m-4{margin:1rem}.m-\[-20px\]{margin:-20px}.m-\[-24px\]{margin:-24px}.m-auto{margin:auto}.m-md{margin:var(--size-md)}.m-px{margin:1px}.m-sm{margin:var(--size-sm)}.m-xs{margin:var(--size-xs)}.\!-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.\!-mx-xs{margin-left:calc(var(--size-xs) * -1)!important;margin-right:calc(var(--size-xs) * -1)!important}.\!mx-\[12px\]{margin-left:12px!important;margin-right:12px!important}.\!my-0{margin-top:0!important;margin-bottom:0!important}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.-mx-lg{margin-left:calc(var(--size-lg) * -1);margin-right:calc(var(--size-lg) * -1)}.-mx-md{margin-left:calc(var(--size-md) * -1);margin-right:calc(var(--size-md) * -1)}.-mx-pageHorizontalPadding{margin-left:calc(var(--page-horizontal-padding) * -1);margin-right:calc(var(--page-horizontal-padding) * -1)}.-mx-sm{margin-left:calc(var(--size-sm) * -1);margin-right:calc(var(--size-sm) * -1)}.-mx-xs{margin-left:calc(var(--size-xs) * -1);margin-right:calc(var(--size-xs) * -1)}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.-my-4{margin-top:-1rem;margin-bottom:-1rem}.-my-md{margin-top:calc(var(--size-md) * -1);margin-bottom:calc(var(--size-md) * -1)}.-my-sm{margin-top:calc(var(--size-sm) * -1);margin-bottom:calc(var(--size-sm) * -1)}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-\[-12px\]{margin-left:-12px;margin-right:-12px}.mx-\[-5\%\]{margin-left:-5%;margin-right:-5%}.mx-auto{margin-left:auto;margin-right:auto}.mx-lg{margin-left:var(--size-lg);margin-right:var(--size-lg)}.mx-md{margin-left:var(--size-md);margin-right:var(--size-md)}.mx-sm{margin-left:var(--size-sm);margin-right:var(--size-sm)}.mx-xs{margin-left:var(--size-xs);margin-right:var(--size-xs)}.my-0{margin-top:0;margin-bottom:0}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-1\.5{margin-top:.375rem;margin-bottom:.375rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.my-\[12px\]{margin-top:12px;margin-bottom:12px}.my-\[1em\]{margin-top:1em;margin-bottom:1em}.my-\[8px\]{margin-top:8px;margin-bottom:8px}.my-md{margin-top:var(--size-md);margin-bottom:var(--size-md)}.my-sm{margin-top:var(--size-sm);margin-bottom:var(--size-sm)}.my-xl{margin-top:var(--size-xl);margin-bottom:var(--size-xl)}.my-xs{margin-top:var(--size-xs);margin-bottom:var(--size-xs)}.\!-ml-md{margin-left:calc(var(--size-md) * -1)!important}.\!-mt-1{margin-top:-.25rem!important}.\!-mt-\[2px\]{margin-top:-2px!important}.\!-mt-md{margin-top:calc(var(--size-md) * -1)!important}.\!mb-0{margin-bottom:0!important}.\!ml-0{margin-left:0!important}.\!mt-0{margin-top:0!important}.\!mt-md{margin-top:var(--size-md)!important}.\!mt-px{margin-top:1px!important}.-mb-0{margin-bottom:-0px}.-mb-0\.5{margin-bottom:-.125rem}.-mb-1{margin-bottom:-.25rem}.-mb-4{margin-bottom:-1rem}.-mb-lg{margin-bottom:calc(var(--size-lg) * -1)}.-mb-md{margin-bottom:calc(var(--size-md) * -1)}.-mb-px{margin-bottom:-1px}.-mb-sm{margin-bottom:calc(var(--size-sm) * -1)}.-mb-two{margin-bottom:-2px}.-mb-xl{margin-bottom:calc(var(--size-xl) * -1)}.-mb-xs{margin-bottom:calc(var(--size-xs) * -1)}.-me-xs{margin-inline-end:calc(var(--size-xs) * -1)}.-ml-1{margin-left:-.25rem}.-ml-3{margin-left:-.75rem}.-ml-4{margin-left:-1rem}.-ml-\[10px\]{margin-left:-10px}.-ml-\[16px\]{margin-left:-16px}.-ml-\[5px\]{margin-left:-5px}.-ml-px{margin-left:-1px}.-ml-sm{margin-left:calc(var(--size-sm) * -1)}.-ml-two{margin-left:-2px}.-ml-xs{margin-left:calc(var(--size-xs) * -1)}.-mr-0{margin-right:-0px}.-mr-0\.5{margin-right:-.125rem}.-mr-1{margin-right:-.25rem}.-mr-1\.5{margin-right:-.375rem}.-mr-2{margin-right:-.5rem}.-mr-5{margin-right:-1.25rem}.-mr-\[0\.5px\]{margin-right:-.5px}.-mr-md{margin-right:calc(var(--size-md) * -1)}.-mr-sm{margin-right:calc(var(--size-sm) * -1)}.-mr-three{margin-right:-3px}.-mr-two{margin-right:-2px}.-mr-xs{margin-right:calc(var(--size-xs) * -1)}.-mt-0{margin-top:-0px}.-mt-0\.5{margin-top:-.125rem}.-mt-1{margin-top:-.25rem}.-mt-1\.5{margin-top:-.375rem}.-mt-10{margin-top:-2.5rem}.-mt-2{margin-top:-.5rem}.-mt-4{margin-top:-1rem}.-mt-lg{margin-top:calc(var(--size-lg) * -1)}.-mt-md{margin-top:calc(var(--size-md) * -1)}.-mt-one,.-mt-px{margin-top:-1px}.-mt-sm{margin-top:calc(var(--size-sm) * -1)}.-mt-three{margin-top:-3px}.-mt-two{margin-top:-2px}.-mt-xl{margin-top:calc(var(--size-xl) * -1)}.-mt-xs{margin-top:calc(var(--size-xs) * -1)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-2xl{margin-bottom:96px}.mb-2xs{margin-bottom:var(--size-2xs)}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-\[-24px\]{margin-bottom:-24px}.mb-\[-2px\]{margin-bottom:-2px}.mb-\[-3px\]{margin-bottom:-3px}.mb-\[-4vh\]{margin-bottom:-4vh}.mb-\[-5px\]{margin-bottom:-5px}.mb-\[12px\]{margin-bottom:12px}.mb-\[20px\]{margin-bottom:20px}.mb-\[40px\]{margin-bottom:40px}.mb-\[calc\(var\(--mobile-nav-height\)\+2rem\)\]{margin-bottom:calc(var(--mobile-nav-height) + 2rem)}.mb-auto{margin-bottom:auto}.mb-lg{margin-bottom:var(--size-lg)}.mb-md{margin-bottom:var(--size-md)}.mb-ml{margin-bottom:var(--size-ml)}.mb-px{margin-bottom:1px}.mb-safeAreaInsetBottom{margin-bottom:var(--safe-area-inset-bottom)}.mb-sm{margin-bottom:var(--size-sm)}.mb-two{margin-bottom:2px}.mb-xl{margin-bottom:var(--size-xl)}.mb-xs{margin-bottom:var(--size-xs)}.ml-0{margin-left:0}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-2xs{margin-left:var(--size-2xs)}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-7{margin-left:1.75rem}.ml-8{margin-left:2rem}.ml-\[-12px\]{margin-left:-12px}.ml-\[26px\]{margin-left:26px}.ml-\[28px\]{margin-left:28px}.ml-auto{margin-left:auto}.ml-collapsedSideBarWidth{margin-left:var(--sidebar-width-collapsed)}.ml-lg{margin-left:var(--size-lg)}.ml-md{margin-left:var(--size-md)}.ml-one,.ml-px{margin-left:1px}.ml-sideBarWidth{margin-left:var(--sidebar-width)}.ml-sm{margin-left:var(--size-sm)}.ml-xl{margin-left:var(--size-xl)}.ml-xs{margin-left:var(--size-xs)}.mr-0{margin-right:0}.mr-0\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-\[-18px\]{margin-right:-18px}.mr-\[2px\]{margin-right:2px}.mr-auto{margin-right:auto}.mr-lg{margin-right:var(--size-lg)}.mr-md{margin-right:var(--size-md)}.mr-px{margin-right:1px}.mr-sm{margin-right:var(--size-sm)}.mr-xs{margin-right:var(--size-xs)}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-2xs{margin-top:var(--size-2xs)}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\[-10px\]{margin-top:-10px}.mt-\[-12px\]{margin-top:-12px}.mt-\[-24px\]{margin-top:-24px}.mt-\[-4\.5rem\]{margin-top:-4.5rem}.mt-\[-5px\]{margin-top:-5px}.mt-\[-6px\]{margin-top:-6px}.mt-\[\.\.\.\]{margin-top:...}.mt-\[13px\]{margin-top:13px}.mt-\[5px\]{margin-top:5px}.mt-\[6px\]{margin-top:6px}.mt-auto{margin-top:auto}.mt-headerHeight{margin-top:var(--header-height)}.mt-inAppHeaderHeight{margin-top:var(--in-app-header-height)}.mt-lg{margin-top:var(--size-lg)}.mt-md{margin-top:var(--size-md)}.mt-ml{margin-top:var(--size-ml)}.mt-one,.mt-px{margin-top:1px}.mt-sm{margin-top:var(--size-sm)}.mt-three{margin-top:3px}.mt-two{margin-top:2px}.mt-xl{margin-top:var(--size-xl)}.mt-xs{margin-top:var(--size-xs)}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.\!line-clamp-2{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.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}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.line-clamp-5{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5}.line-clamp-6{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6}.line-clamp-\[20\]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:20}.line-clamp-\[8\]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:8}.line-clamp-none{overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.\!grid{display:grid!important}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.\!hidden{display:none!important}.hidden{display:none}.\!aspect-\[16\/9\]{aspect-ratio:16/9!important}.\!aspect-square{aspect-ratio:1 / 1!important}.aspect-\[1\.2\/1\]{aspect-ratio:1.2/1}.aspect-\[1\/1\]{aspect-ratio:1/1}.aspect-\[1024\/1536\]{aspect-ratio:1024/1536}.aspect-\[1036\/1536\]{aspect-ratio:1036/1536}.aspect-\[11\/6\]{aspect-ratio:11/6}.aspect-\[1200\/800\]{aspect-ratio:1200/800}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-\[176\/225\]{aspect-ratio:176/225}.aspect-\[187\/155\]{aspect-ratio:187/155}.aspect-\[252\/336\]{aspect-ratio:252/336}.aspect-\[3\/2\]{aspect-ratio:3/2}.aspect-\[304\/120\]{aspect-ratio:304/120}.aspect-\[4\/3\]{aspect-ratio:4/3}.aspect-\[4\/6\]{aspect-ratio:4/6}.aspect-\[9\/8\]{aspect-ratio:9/8}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.\!size-10{width:2.5rem!important;height:2.5rem!important}.\!size-12{width:3rem!important;height:3rem!important}.\!size-4{width:1rem!important;height:1rem!important}.\!size-7{width:1.75rem!important;height:1.75rem!important}.\!size-8{width:2rem!important;height:2rem!important}.\!size-\[40px\]{width:40px!important;height:40px!important}.\!size-\[60px\]{width:60px!important;height:60px!important}.size-0{width:0px;height:0px}.size-0\.5{width:.125rem;height:.125rem}.size-1{width:.25rem;height:.25rem}.size-1\.5{width:.375rem;height:.375rem}.size-1\/2{width:50%;height:50%}.size-10{width:2.5rem;height:2.5rem}.size-11{width:2.75rem;height:2.75rem}.size-12{width:3rem;height:3rem}.size-14{width:3.5rem;height:3.5rem}.size-16{width:4rem;height:4rem}.size-2{width:.5rem;height:.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-20{width:5rem;height:5rem}.size-24{width:6rem;height:6rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-32{width:8rem;height:8rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-\[\.8rem\]{width:.8rem;height:.8rem}.size-\[1\.2em\]{width:1.2em;height:1.2em}.size-\[118px\]{width:118px;height:118px}.size-\[120\%\]{width:120%;height:120%}.size-\[120px\]{width:120px;height:120px}.size-\[12px\]{width:12px;height:12px}.size-\[140\%\]{width:140%;height:140%}.size-\[14px\]{width:14px;height:14px}.size-\[16px\]{width:16px;height:16px}.size-\[180\%\]{width:180%;height:180%}.size-\[18px\]{width:18px;height:18px}.size-\[1lh\]{width:1lh;height:1lh}.size-\[20px\]{width:20px;height:20px}.size-\[220\%\]{width:220%;height:220%}.size-\[24px\]{width:24px;height:24px}.size-\[30px\]{width:30px;height:30px}.size-\[32px\]{width:32px;height:32px}.size-\[36px\]{width:36px;height:36px}.size-\[40px\]{width:40px;height:40px}.size-\[44px\]{width:44px;height:44px}.size-\[45vw\]{width:45vw;height:45vw}.size-\[4px\]{width:4px;height:4px}.size-\[50px\]{width:50px;height:50px}.size-\[5px\]{width:5px;height:5px}.size-\[60px\]{width:60px;height:60px}.size-\[64px\]{width:64px;height:64px}.size-\[65\%\]{width:65%;height:65%}.size-\[6px\]{width:6px;height:6px}.size-\[72px\]{width:72px;height:72px}.size-\[7px\]{width:7px;height:7px}.size-\[88px\]{width:88px;height:88px}.size-\[var\(--image-size\)\]{width:var(--image-size);height:var(--image-size)}.size-full{width:100%;height:100%}.size-lg{width:var(--size-lg);height:var(--size-lg)}.size-md{width:var(--size-md);height:var(--size-md)}.size-sm{width:var(--size-sm);height:var(--size-sm)}.size-xl{width:var(--size-xl);height:var(--size-xl)}.size-xs{width:var(--size-xs);height:var(--size-xs)}.\!h-0{height:0px!important}.\!h-10{height:2.5rem!important}.\!h-11{height:2.75rem!important}.\!h-7{height:1.75rem!important}.\!h-9{height:2.25rem!important}.\!h-\[10px\]{height:10px!important}.\!h-\[150px\]{height:150px!important}.\!h-\[20px\]{height:20px!important}.\!h-\[2lh\]{height:2lh!important}.\!h-\[32px\]{height:32px!important}.\!h-\[5px\]{height:5px!important}.\!h-auto{height:auto!important}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-1\/2{height:50%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-2xs{height:var(--size-2xs)}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[0\.88rem\]{height:.88rem}.h-\[100dvh\]{height:100dvh}.h-\[100px\]{height:100px}.h-\[10vh\]{height:10vh}.h-\[110\%\]{height:110%}.h-\[120\%\]{height:120%}.h-\[120px\]{height:120px}.h-\[124px\]{height:124px}.h-\[12px\]{height:12px}.h-\[132px\]{height:132px}.h-\[136px\]{height:136px}.h-\[13px\]{height:13px}.h-\[140px\]{height:140px}.h-\[144px\]{height:144px}.h-\[14px\]{height:14px}.h-\[150px\]{height:150px}.h-\[160px\]{height:160px}.h-\[16px\]{height:16px}.h-\[170px\]{height:170px}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[198px\]{height:198px}.h-\[19px\]{height:19px}.h-\[1em\]{height:1em}.h-\[1lh\]{height:1lh}.h-\[200px\]{height:200px}.h-\[20px\]{height:20px}.h-\[20vw\]{height:20vw}.h-\[22px\]{height:22px}.h-\[240px\]{height:240px}.h-\[242px\]{height:242px}.h-\[24px\]{height:24px}.h-\[250px\]{height:250px}.h-\[260px\]{height:260px}.h-\[26px\]{height:26px}.h-\[27px\]{height:27px}.h-\[300px\]{height:300px}.h-\[30vh\]{height:30vh}.h-\[327px\]{height:327px}.h-\[32px\]{height:32px}.h-\[340px\]{height:340px}.h-\[34px\]{height:34px}.h-\[350px\]{height:350px}.h-\[36px\]{height:36px}.h-\[3px\]{height:3px}.h-\[4\.5rem\]{height:4.5rem}.h-\[400px\]{height:400px}.h-\[40px\]{height:40px}.h-\[42px\]{height:42px}.h-\[44px\]{height:44px}.h-\[480px\]{height:480px}.h-\[48px\]{height:48px}.h-\[500px\]{height:500px}.h-\[50dvh\]{height:50dvh}.h-\[50vh\]{height:50vh}.h-\[52px\]{height:52px}.h-\[54px\]{height:54px}.h-\[560px\]{height:560px}.h-\[56px\]{height:56px}.h-\[600px\]{height:600px}.h-\[60vh\]{height:60vh}.h-\[640px\]{height:640px}.h-\[64px\]{height:64px}.h-\[68px\]{height:68px}.h-\[70\%\]{height:70%}.h-\[72px\]{height:72px}.h-\[90dvh\]{height:90dvh}.h-\[95vh\]{height:95vh}.h-\[calc\(100\%\+16px\)\]{height:calc(100% + 16px)}.h-\[calc\(100vh-var\(--header-height\)-120px\)\]{height:calc(100vh - var(--header-height) - 120px)}.h-\[var\(--map-height\)\]{height:var(--map-height)}.h-auto{height:auto}.h-bannerHeight{height:var(--banner-height)}.h-dvh{height:100dvh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-headerHeight{height:var(--header-height)}.h-inAppHeaderHeight{height:var(--in-app-header-height)}.h-lg{height:var(--size-lg)}.h-md{height:var(--size-md)}.h-one{height:1px}.h-pageContentHeight{height:var(--page-content-height)}.h-px{height:1px}.h-screen{height:100vh}.h-sm{height:var(--size-sm)}.h-two{height:2px}.h-xl{height:var(--size-xl)}.h-xs{height:var(--size-xs)}.\!max-h-\[27vh\]{max-height:27vh!important}.\!max-h-\[640px\]{max-height:640px!important}.max-h-20{max-height:5rem}.max-h-40{max-height:10rem}.max-h-44{max-height:11rem}.max-h-5{max-height:1.25rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[100\%\]{max-height:100%}.max-h-\[100vh\]{max-height:100vh}.max-h-\[120px\]{max-height:120px}.max-h-\[160px\]{max-height:160px}.max-h-\[175px\]{max-height:175px}.max-h-\[190px\]{max-height:190px}.max-h-\[200px\]{max-height:200px}.max-h-\[220px\]{max-height:220px}.max-h-\[240px\]{max-height:240px}.max-h-\[280px\]{max-height:280px}.max-h-\[300px\]{max-height:300px}.max-h-\[330px\]{max-height:330px}.max-h-\[37vh\]{max-height:37vh}.max-h-\[38vh\]{max-height:38vh}.max-h-\[400px\]{max-height:400px}.max-h-\[40vh\]{max-height:40vh}.max-h-\[42vh\]{max-height:42vh}.max-h-\[450px\]{max-height:450px}.max-h-\[45vh\]{max-height:45vh}.max-h-\[500px\]{max-height:500px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[555x\]{max-height:555x}.max-h-\[600px\]{max-height:600px}.max-h-\[65px\]{max-height:65px}.max-h-\[65vh\]{max-height:65vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[76px\]{max-height:76px}.max-h-\[800px\]{max-height:800px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90dvh\]{max-height:90dvh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[96dvh\]{max-height:96dvh}.max-h-\[inherit\]{max-height:inherit}.max-h-full{max-height:100%}.max-h-lg{max-height:var(--size-lg)}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.\!min-h-0{min-height:0px!important}.\!min-h-fit{min-height:-moz-fit-content!important;min-height:fit-content!important}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-12{min-height:3rem}.min-h-16{min-height:4rem}.min-h-20{min-height:5rem}.min-h-24{min-height:6rem}.min-h-32{min-height:8rem}.min-h-40{min-height:10rem}.min-h-60{min-height:15rem}.min-h-\[100\%\]{min-height:100%}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[125px\]{min-height:125px}.min-h-\[128px\]{min-height:128px}.min-h-\[142px\]{min-height:142px}.min-h-\[180px\]{min-height:180px}.min-h-\[200px\]{min-height:200px}.min-h-\[20px\]{min-height:20px}.min-h-\[230px\]{min-height:230px}.min-h-\[24px\]{min-height:24px}.min-h-\[250px\]{min-height:250px}.min-h-\[280px\]{min-height:280px}.min-h-\[340px\]{min-height:340px}.min-h-\[40px\]{min-height:40px}.min-h-\[50px\]{min-height:50px}.min-h-\[50vh\]{min-height:50vh}.min-h-\[520px\]{min-height:520px}.min-h-\[555px\]{min-height:555px}.min-h-\[58px\]{min-height:58px}.min-h-\[600px\]{min-height:600px}.min-h-\[60dvh\]{min-height:60dvh}.min-h-\[60px\]{min-height:60px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[75vh\]{min-height:75vh}.min-h-\[80px\]{min-height:80px}.min-h-\[calc\(100dvh-70px\)\]{min-height:calc(100dvh - 70px)}.min-h-\[calc\(100vh-200px\)\]{min-height:calc(100vh - 200px)}.min-h-\[calc\(100vh-262px\)\]{min-height:calc(100vh - 262px)}.min-h-\[calc\(100vh-68px\)\]{min-height:calc(100vh - 68px)}.min-h-\[unset\]{min-height:unset}.min-h-\[var\(--mobile-content-height\)\]{min-height:var(--mobile-content-height)}.min-h-\[var\(--page-content-height\)\]{min-height:var(--page-content-height)}.min-h-full{min-height:100%}.min-h-minTouchTarget{min-height:var(--min-touch-target)}.min-h-pageContentHeight{min-height:var(--page-content-height)}.min-h-screen{min-height:100vh}.\!w-10{width:2.5rem!important}.\!w-16{width:4rem!important}.\!w-4{width:1rem!important}.\!w-7{width:1.75rem!important}.\!w-\[100px\]{width:100px!important}.\!w-\[140px\]{width:140px!important}.\!w-\[16px\]{width:16px!important}.\!w-\[200px\]{width:200px!important}.\!w-\[240px\]{width:240px!important}.\!w-\[24px\]{width:24px!important}.\!w-\[25vw\]{width:25vw!important}.\!w-\[416px\]{width:416px!important}.\!w-\[500px\]{width:500px!important}.\!w-\[5px\]{width:5px!important}.\!w-\[80px\]{width:80px!important}.\!w-auto{width:auto!important}.\!w-full{width:100%!important}.\!w-screen{width:100vw!important}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/12{width:8.333333%}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-1\/5{width:20%}.w-10{width:2.5rem}.w-10\/12{width:83.333333%}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\/12{width:16.666667%}.w-2\/3{width:66.666667%}.w-2\/4{width:50%}.w-2\/5{width:40%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/12{width:25%}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-5\/6{width:83.333333%}.w-56{width:14rem}.w-6{width:1.5rem}.w-6\/12{width:50%}.w-60{width:15rem}.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-9\/12{width:75%}.w-96{width:24rem}.w-\[0\.88rem\]{width:.88rem}.w-\[1\.2em\]{width:1.2em}.w-\[1\.5px\]{width:1.5px}.w-\[1\/2\]{width:1/2}.w-\[10\%\]{width:10%}.w-\[100px\]{width:100px}.w-\[100vw\]{width:100vw}.w-\[110\%\]{width:110%}.w-\[12\.5\%\]{width:12.5%}.w-\[120\%\]{width:120%}.w-\[120px\]{width:120px}.w-\[120vw\]{width:120vw}.w-\[12px\]{width:12px}.w-\[134px\]{width:134px}.w-\[140px\]{width:140px}.w-\[144px\]{width:144px}.w-\[14px\]{width:14px}.w-\[15\%\]{width:15%}.w-\[150px\]{width:150px}.w-\[150vw\]{width:150vw}.w-\[15px\]{width:15px}.w-\[166px\]{width:166px}.w-\[170px\]{width:170px}.w-\[175px\]{width:175px}.w-\[17px\]{width:17px}.w-\[180px\]{width:180px}.w-\[18px\]{width:18px}.w-\[18vw\]{width:18vw}.w-\[2\.5px\]{width:2.5px}.w-\[200px\]{width:200px}.w-\[216px\]{width:216px}.w-\[220px\]{width:220px}.w-\[224px\]{width:224px}.w-\[225px\]{width:225px}.w-\[240px\]{width:240px}.w-\[24px\]{width:24px}.w-\[250px\]{width:250px}.w-\[27px\]{width:27px}.w-\[282px\]{width:282px}.w-\[28px\]{width:28px}.w-\[2ch\]{width:2ch}.w-\[30\%\]{width:30%}.w-\[300px\]{width:300px}.w-\[30vw\]{width:30vw}.w-\[320px\]{width:320px}.w-\[324px\]{width:324px}.w-\[32px\]{width:32px}.w-\[33\%\]{width:33%}.w-\[340px\]{width:340px}.w-\[350px\]{width:350px}.w-\[360px\]{width:360px}.w-\[3ch\]{width:3ch}.w-\[3px\]{width:3px}.w-\[400px\]{width:400px}.w-\[40px\]{width:40px}.w-\[40vw\]{width:40vw}.w-\[45\%\]{width:45%}.w-\[4px\]{width:4px}.w-\[500px\]{width:500px}.w-\[54\%\]{width:54%}.w-\[60\%\]{width:60%}.w-\[600px\]{width:600px}.w-\[60px\]{width:60px}.w-\[60vw\]{width:60vw}.w-\[62\%\]{width:62%}.w-\[62px\]{width:62px}.w-\[66\%\]{width:66%}.w-\[70\%\]{width:70%}.w-\[70px\]{width:70px}.w-\[70vw\]{width:70vw}.w-\[72px\]{width:72px}.w-\[76px\]{width:76px}.w-\[8\%\]{width:8%}.w-\[80px\]{width:80px}.w-\[80vw\]{width:80vw}.w-\[90\%\]{width:90%}.w-\[90dvw\]{width:90dvw}.w-\[90vw\]{width:90vw}.w-\[95vw\]{width:95vw}.w-\[calc\(\(100\%\*2\/3\)\/3\)\]{width:calc((100% * 2 / 3) / 3)}.w-\[calc\(\(100\%\*2\/3\)\/4\)\]{width:calc((100% * 2 / 3) / 4)}.w-\[calc\(100dvw-\(2\*var\(--size-md\)\)\)\]{width:calc(100dvw - (2 * var(--size-md)))}.w-\[calc\(80\%-1\.6px\)\]{width:calc(80% - 1.6px)}.w-\[var\(--constrained-card-width\)\]{width:var(--constrained-card-width)}.w-auto{width:auto}.w-collapsedSideBarWidth{width:var(--sidebar-width-collapsed)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-lg{width:var(--size-lg)}.w-max{width:-moz-max-content;width:max-content}.w-md{width:var(--size-md)}.w-px{width:1px}.w-screen{width:100vw}.w-sideBarWidth{width:var(--sidebar-width)}.w-sm{width:var(--size-sm)}.w-three{width:3px}.w-two{width:2px}.w-xl{width:var(--size-xl)}.w-xs{width:var(--size-xs)}.\!min-w-0{min-width:0px!important}.\!min-w-\[120px\]{min-width:120px!important}.\!min-w-\[180px\]{min-width:180px!important}.\!min-w-\[365px\]{min-width:365px!important}.\!min-w-\[416px\]{min-width:416px!important}.\!min-w-\[500px\]{min-width:500px!important}.\!min-w-md{min-width:var(--size-md)!important}.min-w-0{min-width:0px}.min-w-14{min-width:3.5rem}.min-w-24{min-width:6rem}.min-w-3{min-width:.75rem}.min-w-3\.5{min-width:.875rem}.min-w-4{min-width:1rem}.min-w-40{min-width:10rem}.min-w-48{min-width:12rem}.min-w-5{min-width:1.25rem}.min-w-56{min-width:14rem}.min-w-6{min-width:1.5rem}.min-w-9{min-width:2.25rem}.min-w-\[100\%\]{min-width:100%}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[140px\]{min-width:140px}.min-w-\[1443px\]{min-width:1443px}.min-w-\[150px\]{min-width:150px}.min-w-\[160px\]{min-width:160px}.min-w-\[165px\]{min-width:165px}.min-w-\[200px\]{min-width:200px}.min-w-\[220px\]{min-width:220px}.min-w-\[25\%\]{min-width:25%}.min-w-\[250px\]{min-width:250px}.min-w-\[280px\]{min-width:280px}.min-w-\[2ch\]{min-width:2ch}.min-w-\[32px\]{min-width:32px}.min-w-\[400px\]{min-width:400px}.min-w-\[420px\]{min-width:420px}.min-w-\[48px\]{min-width:48px}.min-w-\[500px\]{min-width:500px}.min-w-\[56px\]{min-width:56px}.min-w-\[58px\]{min-width:58px}.min-w-\[64px\]{min-width:64px}.min-w-\[80px\]{min-width:80px}.min-w-\[calc\(var\(--radix-dropdown-menu-trigger-width\)-theme\(spacing\.sm\)\)\]{min-width:calc(var(--radix-dropdown-menu-trigger-width) - var(--size-sm))}.min-w-\[var\(--radix-hover-card-trigger-width\)\]{min-width:var(--radix-hover-card-trigger-width)}.min-w-\[var\(--radix-popover-trigger-width\)\]{min-width:var(--radix-popover-trigger-width)}.min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.min-w-full{min-width:100%}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-md{min-width:var(--size-md)}.\!max-w-2xl{max-width:42rem!important}.\!max-w-\[416px\]{max-width:416px!important}.\!max-w-\[500px\]{max-width:500px!important}.\!max-w-\[520px\]{max-width:520px!important}.\!max-w-md{max-width:28rem!important}.\!max-w-none{max-width:none!important}.\!max-w-sm{max-width:24rem!important}.max-w-0{max-width:0px}.max-w-10{max-width:2.5rem}.max-w-12{max-width:3rem}.max-w-14{max-width:3.5rem}.max-w-20{max-width:5rem}.max-w-24{max-width:6rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-44{max-width:11rem}.max-w-48{max-width:12rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-60{max-width:15rem}.max-w-64{max-width:16rem}.max-w-6xl{max-width:72rem}.max-w-\[100px\]{max-width:100px}.max-w-\[100vw\]{max-width:100vw}.max-w-\[120px\]{max-width:120px}.max-w-\[150px\]{max-width:150px}.max-w-\[15vw\]{max-width:15vw}.max-w-\[160px\]{max-width:160px}.max-w-\[168px\]{max-width:168px}.max-w-\[200px\]{max-width:200px}.max-w-\[208px\]{max-width:208px}.max-w-\[220px\]{max-width:220px}.max-w-\[250px\]{max-width:250px}.max-w-\[25ch\]{max-width:25ch}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[30vw\]{max-width:30vw}.max-w-\[320px\]{max-width:320px}.max-w-\[324px\]{max-width:324px}.max-w-\[328px\]{max-width:328px}.max-w-\[340px\]{max-width:340px}.max-w-\[350px\]{max-width:350px}.max-w-\[375px\]{max-width:375px}.max-w-\[400px\]{max-width:400px}.max-w-\[40px\]{max-width:40px}.max-w-\[448px\]{max-width:448px}.max-w-\[5\.6rem\]{max-width:5.6rem}.max-w-\[50vw\]{max-width:50vw}.max-w-\[540px\]{max-width:540px}.max-w-\[600px\]{max-width:600px}.max-w-\[672px\]{max-width:672px}.max-w-\[80px\]{max-width:80px}.max-w-\[900px\]{max-width:900px}.max-w-\[90dvw\]{max-width:90dvw}.max-w-\[98px\]{max-width:98px}.max-w-\[calc\(\(100vh-360px\)\/1\.5\)\]{max-width:calc((100vh - 360px) / 1.5)}.max-w-\[calc\(100vh-360px\)\]{max-width:calc(100vh - 360px)}.max-w-\[unset\]{max-width:unset}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-screen-lg{max-width:1024px}.max-w-screen-md{max-width:768px}.max-w-screen-sm{max-width:640px}.max-w-screen-xl{max-width:1280px}.max-w-sideBarWidthXL{max-width:260px}.max-w-sm{max-width:24rem}.max-w-threadContentWidth{max-width:var(--thread-content-width)}.max-w-threadWidth{max-width:var(--thread-width)}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.\!flex-1{flex:1 1 0%!important}.flex-1{flex:1 1 0%}.flex-\[2\]{flex:2}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.\!grow{flex-grow:1!important}.grow{flex-grow:1}.grow-0{flex-grow:0}.\!basis-\[90\%\]{flex-basis:90%!important}.\!basis-full{flex-basis:100%!important}.basis-0{flex-basis:0px}.basis-1\/2{flex-basis:50%}.basis-1\/4{flex-basis:25%}.basis-2\/5{flex-basis:40%}.basis-3\/5{flex-basis:60%}.basis-full{flex-basis:100%}.table-auto{table-layout:auto}.table-fixed{table-layout:fixed}.border-collapse{border-collapse:collapse}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x: 0px;--tw-border-spacing-y: 0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.border-spacing-sm{--tw-border-spacing-x: var(--size-sm);--tw-border-spacing-y: var(--size-sm);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.origin-\[var\(--radix-dropdown-menu-content-transform-origin\)\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-bottom-left{transform-origin:bottom left}.origin-center{transform-origin:center}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.\!translate-y-\[0px\]{--tw-translate-y: 0px !important;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))!important}.-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-1\/3{--tw-translate-x: -33.333333%;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-\[10\%\]{--tw-translate-x: -10%;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-\[5\%\]{--tw-translate-x: -5%;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-full{--tw-translate-x: -100%;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-md{--tw-translate-x: calc(var(--size-md) * -1);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-x-sm{--tw-translate-x: calc(var(--size-sm) * -1);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-three{--tw-translate-x: -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))}.-translate-x-two{--tw-translate-x: -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))}.-translate-x-xs{--tw-translate-x: calc(var(--size-xs) * -1);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-0{--tw-translate-y: -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))}.-translate-y-0\.5{--tw-translate-y: -.125rem;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{--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))}.-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-y-1\/3{--tw-translate-y: -33.333333%;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\/4{--tw-translate-y: -25%;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-\[10\%\]{--tw-translate-y: -10%;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-\[5\%\]{--tw-translate-y: -5%;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-\[calc\(50\%-2px\)\]{--tw-translate-y: calc((50% - 2px)*-1) ;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-half{--tw-translate-y: -.5px;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-md{--tw-translate-y: calc(var(--size-md) * -1);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-px{--tw-translate-y: -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-sm{--tw-translate-y: calc(var(--size-sm) * -1);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-three{--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))}.-translate-y-two{--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))}.translate-x-1{--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))}.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-1\/3{--tw-translate-x: 33.333333%;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-1\/4{--tw-translate-x: 25%;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-2{--tw-translate-x: .5rem;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-\[-5px\]{--tw-translate-x: -5px;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-\[1px\]{--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-x-\[4px\]{--tw-translate-x: 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))}.translate-x-\[6px\]{--tw-translate-x: 6px;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-\[calc\(-100\%-var\(--size-xs\)\)\]{--tw-translate-x: calc(-100% - var(--size-xs));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-\[calc\(100\%\+2px\)\]{--tw-translate-x: calc(100% + 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))}.translate-x-\[calc\(100\%\+var\(--size-xs\)\)\]{--tw-translate-x: calc(100% + var(--size-xs));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-full{--tw-translate-x: 100%;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-md{--tw-translate-x: var(--size-md);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-x-two{--tw-translate-x: 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))}.translate-x-xs{--tw-translate-x: var(--size-xs);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-0{--tw-translate-y: 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))}.translate-y-0\.5{--tw-translate-y: .125rem;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{--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))}.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-y-1\/4{--tw-translate-y: 25%;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-2{--tw-translate-y: .5rem;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\.5px\]{--tw-translate-y: -1.5px;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-\[-12\.5\%\]{--tw-translate-y: -12.5%;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-\[-16\%\]{--tw-translate-y: -16%;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-\[-2px\]{--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))}.translate-y-\[0\.8px\]{--tw-translate-y: .8px;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\.5px\]{--tw-translate-y: 1.5px;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-\[1px\]{--tw-translate-y: 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-\[20px\]{--tw-translate-y: 20px;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-\[24px\]{--tw-translate-y: 24px;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-\[3px\]{--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))}.translate-y-\[60\%\]{--tw-translate-y: 60%;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-\[6px\]{--tw-translate-y: 6px;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-\[80\%\]{--tw-translate-y: 80%;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-full{--tw-translate-y: 100%;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-half{--tw-translate-y: .5px;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-px{--tw-translate-y: 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-three{--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))}.translate-y-two{--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))}.translate-y-xs{--tw-translate-y: var(--size-xs);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-0{--tw-rotate: 0deg;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-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))}.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))}.\!scale-100{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;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))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;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))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;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))}.scale-\[\.85\],.scale-\[0\.85\]{--tw-scale-x: .85;--tw-scale-y: .85;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))}.scale-\[0\.8\]{--tw-scale-x: .8;--tw-scale-y: .8;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))}.scale-\[0\.98\]{--tw-scale-x: .98;--tw-scale-y: .98;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))}.scale-\[0\.9\]{--tw-scale-x: .9;--tw-scale-y: .9;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))}.scale-\[99\%\]{--tw-scale-x: 99%;--tw-scale-y: 99%;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))}.scale-x-\[250\%\]{--tw-scale-x: 250%;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))}.transform-none{transform:none}@keyframes f1-track-dash{to{stroke-dashoffset:0px}}.animate-\[f1-track-dash_6s_ease_infinite\]{animation:f1-track-dash 6s ease infinite}.animate-\[ping_1\.5s_cubic-bezier\(0\,0\,0\.2\,1\)_infinite\]{animation:ping 1.5s cubic-bezier(0,0,.2,1) infinite}.animate-\[pulse_2\.5s_ease-in-out_infinite\]{animation:pulse 2.5s ease-in-out infinite}@keyframes collapseHeight{0%{grid-template-rows:1fr;opacity:1}to{grid-template-rows:0fr;opacity:0}}.animate-collapseHeight{animation:collapseHeight 50ms cubic-bezier(.33,1.05,.68,.98) forwards}.animate-deepResearchIndicator{animation:indicator steps(48) infinite}@keyframes expandHeight{0%{grid-template-rows:0fr;opacity:0}to{grid-template-rows:1fr;opacity:1}}.animate-expandHeight{animation:expandHeight 50ms cubic-bezier(.33,1.05,.68,.98)}@keyframes indeterminate{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(100%)}}.animate-indeterminate{animation:indeterminate 1.5s infinite cubic-bezier(.65,.815,.735,.395)}.animate-labsIndicator{animation:indicator steps(39) infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes indicator{0%{transform:translateZ(0) translate(0)}to{transform:translateZ(0) translate(-100%)}}.animate-pplxIndicator{animation:indicator steps(52) infinite}@keyframes pulse{50%{opacity:.4}0%,to{opacity:1}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-slideDownAndFadeIn{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideDownAndFadeOut{animation:slideDownAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.animate-slideLeftAndFadeIn{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideLeftAndFadeOut{animation:slideLeftAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.animate-slideRightAndFadeIn{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideRightAndFadeOut{animation:slideRightAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.animate-slideUpAndFadeIn{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.animate-slideUpAndFadeOut{animation:slideUpAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes spin{to{transform:rotate(360deg)}0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}@keyframes underlineFade{0%{text-decoration-color:transparent}to{text-decoration-color:oklch(var(--foreground-color) / .2)}}.animate-underlineFade{animation:underlineFade 1s ease}.\!cursor-grab{cursor:grab!important}.\!cursor-grabbing{cursor:grabbing!important}.\!cursor-not-allowed{cursor:not-allowed!important}.\!cursor-pointer{cursor:pointer!important}.\!cursor-wait{cursor:wait!important}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-wait{cursor:wait}.cursor-zoom-in{cursor:zoom-in}.touch-none{touch-action:none}.touch-pan-down{--tw-pan-y: pan-down;touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-manipulation{touch-action:manipulation}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.scroll-mx-md{scroll-margin-left:var(--size-md);scroll-margin-right:var(--size-md)}.scroll-mb-9{scroll-margin-bottom:2.25rem}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.auto-cols-auto{grid-auto-columns:auto}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.auto-cols-max{grid-auto-columns:max-content}.grid-flow-row{grid-auto-flow:row}.grid-flow-col{grid-auto-flow:column}.auto-rows-fr{grid-auto-rows:minmax(0,1fr)}.\!grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,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-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.grid-cols-\[0\.5fr_1fr\]{grid-template-columns:.5fr 1fr}.grid-cols-\[128px_1fr_auto\]{grid-template-columns:128px 1fr auto}.grid-cols-\[1fr\,1fr\,1fr\]{grid-template-columns:1fr 1fr 1fr}.grid-cols-\[1fr\,1fr\]{grid-template-columns:1fr 1fr}.grid-cols-\[1fr\,auto\,1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[1fr\,auto\,auto\,auto\]{grid-template-columns:1fr auto auto auto}.grid-cols-\[1fr\,auto\,auto\]{grid-template-columns:1fr auto auto}.grid-cols-\[1fr\]{grid-template-columns:1fr}.grid-cols-\[1fr_1fr\]{grid-template-columns:1fr 1fr}.grid-cols-\[1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr}.grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[1fr_max-content\]{grid-template-columns:1fr max-content}.grid-cols-\[1fr_min-content_min-content\]{grid-template-columns:1fr min-content min-content}.grid-cols-\[26\.8\%_1fr\]{grid-template-columns:26.8% 1fr}.grid-cols-\[2fr\,1fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr 1fr}.grid-cols-\[2fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr}.grid-cols-\[2fr\,1fr\]{grid-template-columns:2fr 1fr}.grid-cols-\[3fr\,1fr\,1fr\,1fr\]{grid-template-columns:3fr 1fr 1fr 1fr}.grid-cols-\[3fr\,2fr\,2fr\]{grid-template-columns:3fr 2fr 2fr}.grid-cols-\[65\%\,35\%\]{grid-template-columns:65% 35%}.grid-cols-\[8fr_minmax\(300px\,3fr\)\]{grid-template-columns:8fr minmax(300px,3fr)}.grid-cols-\[auto\,1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto\,max-content\]{grid-template-columns:auto max-content}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_1fr_88px_88px_88px\]{grid-template-columns:auto 1fr 88px 88px 88px}.grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.grid-cols-\[auto_auto_1fr\]{grid-template-columns:auto auto 1fr}.grid-cols-\[auto_min-content\]{grid-template-columns:auto min-content}.grid-cols-\[max-content_1fr\]{grid-template-columns:max-content 1fr}.grid-cols-\[max-content_auto\]{grid-template-columns:max-content auto}.grid-cols-\[min-content\,1fr\,1fr\,min-content\]{grid-template-columns:min-content 1fr 1fr min-content}.grid-cols-\[min-content\,1fr\,max-content\,min-content\]{grid-template-columns:min-content 1fr max-content min-content}.grid-cols-\[min-content\,1fr\,min-content\]{grid-template-columns:min-content 1fr min-content}.grid-cols-\[min-content\,1fr\,minmax\(max-content\,1fr\)\,min-content\]{grid-template-columns:min-content 1fr minmax(max-content,1fr) min-content}.grid-cols-\[min-content_1fr_3fr\]{grid-template-columns:min-content 1fr 3fr}.grid-cols-\[minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_48px_64px_40px\]{grid-template-columns:minmax(0,1fr) 48px 64px 40px}.grid-cols-\[minmax\(0\,1fr\)_auto_56px\]{grid-template-columns:minmax(0,1fr) auto 56px}.grid-cols-\[minmax\(0\,1fr\)_min-content_min-content\]{grid-template-columns:minmax(0,1fr) min-content min-content}.grid-cols-\[repeat\(7\,1fr\)\]{grid-template-columns:repeat(7,1fr)}.grid-cols-\[repeat\(auto-fill\,_minmax\(280px\,_1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(160px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(180px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(220px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(280px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}.grid-cols-subgrid{grid-template-columns:subgrid}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}.grid-rows-1fr-auto{grid-template-rows:1fr auto}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))}.grid-rows-4{grid-template-rows:repeat(4,minmax(0,1fr))}.grid-rows-\[0fr\]{grid-template-rows:0fr}.grid-rows-\[1fr\]{grid-template-rows:1fr}.grid-rows-\[min-content_1fr\]{grid-template-rows:min-content 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.\!flex-col{flex-direction:column!important}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.place-content-center{place-content:center}.place-content-between{place-content:space-between}.place-items-center{place-items:center}.content-center{align-content:center}.\!items-start{align-items:flex-start!important}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.\!justify-start{justify-content:flex-start!important}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.justify-stretch{justify-content:stretch}.justify-items-center{justify-items:center}.justify-items-stretch{justify-items:stretch}.\!gap-0{gap:0px!important}.\!gap-1{gap:.25rem!important}.\!gap-4{gap:1rem!important}.\!gap-sm{gap:var(--size-sm)!important}.\!gap-xs{gap:var(--size-xs)!important}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-2xl{gap:96px}.gap-2xs{gap:var(--size-2xs)}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[0\.1em\]{gap:.1em}.gap-\[0\.2em\]{gap:.2em}.gap-\[10px\]{gap:10px}.gap-\[11px\]{gap:11px}.gap-\[12px\]{gap:12px}.gap-\[20px\]{gap:20px}.gap-\[5px\]{gap:5px}.gap-\[6px\]{gap:6px}.gap-\[7px\]{gap:7px}.gap-lg{gap:var(--size-lg)}.gap-md{gap:var(--size-md)}.gap-px{gap:1px}.gap-sm{gap:var(--size-sm)}.gap-three{gap:3px}.gap-two{gap:2px}.gap-xl{gap:var(--size-xl)}.gap-xs{gap:var(--size-xs)}.\!gap-y-md{row-gap:var(--size-md)!important}.gap-x-0{-moz-column-gap:0px;column-gap:0px}.gap-x-0\.5{-moz-column-gap:.125rem;column-gap:.125rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-1\.5{-moz-column-gap:.375rem;column-gap:.375rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-2xl{-moz-column-gap:96px;column-gap:96px}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-x-\[12px\]{-moz-column-gap:12px;column-gap:12px}.gap-x-lg{-moz-column-gap:var(--size-lg);column-gap:var(--size-lg)}.gap-x-md{-moz-column-gap:var(--size-md);column-gap:var(--size-md)}.gap-x-sm{-moz-column-gap:var(--size-sm);column-gap:var(--size-sm)}.gap-x-two{-moz-column-gap:2px;column-gap:2px}.gap-x-xl{-moz-column-gap:var(--size-xl);column-gap:var(--size-xl)}.gap-x-xs{-moz-column-gap:var(--size-xs);column-gap:var(--size-xs)}.gap-y-0{row-gap:0px}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.gap-y-12{row-gap:3rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.gap-y-4{row-gap:1rem}.gap-y-6{row-gap:1.5rem}.gap-y-\[20px\]{row-gap:20px}.gap-y-\[40px\]{row-gap:40px}.gap-y-lg{row-gap:var(--size-lg)}.gap-y-md{row-gap:var(--size-md)}.gap-y-sm{row-gap:var(--size-sm)}.gap-y-xs{row-gap:var(--size-xs)}.-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-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-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-sm>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(var(--size-sm) * var(--tw-space-x-reverse));margin-left:calc(var(--size-sm) * calc(1 - var(--tw-space-x-reverse)))}.space-x-two>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2px * var(--tw-space-x-reverse));margin-left:calc(2px * calc(1 - var(--tw-space-x-reverse)))}.space-x-xs>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(var(--size-xs) * var(--tw-space-x-reverse));margin-left:calc(var(--size-xs) * calc(1 - var(--tw-space-x-reverse)))}.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))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-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-20>: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-2xs>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-2xs) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-2xs) * 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))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.space-y-lg>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-lg) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-lg) * var(--tw-space-y-reverse))}.space-y-md>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-md) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-md) * var(--tw-space-y-reverse))}.space-y-ml>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-ml) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-ml) * var(--tw-space-y-reverse))}.space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1px * var(--tw-space-y-reverse))}.space-y-sm>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-sm) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-sm) * var(--tw-space-y-reverse))}.space-y-xs>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-xs) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-xs) * var(--tw-space-y-reverse))}.\!divide-y-0>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(0px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(0px * var(--tw-divide-y-reverse))!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[\#e5e7eb\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.divide-\[\#f3f4f6\]>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-subtle>:not([hidden])~:not([hidden]){border-color:oklch(var(--foreground-subtle-color))}.divide-subtlest>:not([hidden])~:not([hidden]){border-color:oklch(var(--foreground-subtlest-color))}.place-self-center{place-self:center}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.self-center{align-self:center}.self-stretch{align-self:stretch}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-stretch{justify-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.\!overflow-clip{overflow:clip!important}.overflow-clip{overflow:clip}.\!overflow-visible{overflow:visible!important}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-x-clip{overflow-x:clip}.overflow-x-visible{overflow-x:visible}.\!overflow-x-scroll{overflow-x:scroll!important}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.text-clip{text-overflow:clip}.hyphens-auto{-webkit-hyphens:auto;hyphens:auto}.whitespace-normal{white-space:normal}.\!whitespace-nowrap{white-space:nowrap!important}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-wrap{text-wrap:wrap!important}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.text-balance{text-wrap:balance}.text-pretty{text-wrap:pretty}.break-normal{overflow-wrap:normal;word-break:normal}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-2xl{border-radius:1rem!important}.\!rounded-3xl{border-radius:1.25rem!important}.\!rounded-\[14px\]{border-radius:14px!important}.\!rounded-\[4px\]{border-radius:4px!important}.\!rounded-full{border-radius:9999px!important}.\!rounded-lg{border-radius:.5rem!important}.\!rounded-md{border-radius:.375rem!important}.\!rounded-none{border-radius:0!important}.\!rounded-sm{border-radius:.125rem!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.25rem}.rounded-\[0\.3125rem\]{border-radius:.3125rem}.rounded-\[100\%\]{border-radius:100%}.rounded-\[10px\]{border-radius:10px}.rounded-\[116px\]{border-radius:116px}.rounded-\[122px\]{border-radius:122px}.rounded-\[12px\]{border-radius:12px}.rounded-\[13px\]{border-radius:13px}.rounded-\[16px\]{border-radius:16px}.rounded-\[1px\]{border-radius:1px}.rounded-\[20px\]{border-radius:20px}.rounded-\[37px\]{border-radius:37px}.rounded-\[4px\]{border-radius:4px}.rounded-\[50\%\]{border-radius:50%}.rounded-\[52px\]{border-radius:52px}.rounded-\[54px\]{border-radius:54px}.rounded-\[6px\]{border-radius:6px}.rounded-badge{border-radius:.3125rem}.rounded-full{border-radius:9999px}.rounded-inherit{border-radius:inherit}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.\!rounded-b-none{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-2xl{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem}.rounded-b-\[20px\]{border-bottom-right-radius:20px;border-bottom-left-radius:20px}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-sm{border-bottom-right-radius:.125rem;border-bottom-left-radius:.125rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-l-sm{border-top-left-radius:.125rem;border-bottom-left-radius:.125rem}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-\[24px\]{border-top-left-radius:24px;border-top-right-radius:24px}.rounded-t-full{border-top-left-radius:9999px;border-top-right-radius:9999px}.rounded-t-inherit{border-top-left-radius:inherit;border-top-right-radius:inherit}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-t-sm{border-top-left-radius:.125rem;border-top-right-radius:.125rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-br-\[11px\]{border-bottom-right-radius:11px}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl{border-top-left-radius:.25rem}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.rounded-tr-none{border-top-right-radius:0}.\!border{border-width:1px!important}.\!border-0{border-width:0px!important}.\!border-2{border-width:2px!important}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[0\.2px\]{border-width:.2px}.border-\[0\.5px\]{border-width:.5px}.border-\[0\.75px\]{border-width:.75px}.border-\[10px\]{border-width:10px}.border-\[1px\]{border-width:1px}.border-\[2px\]{border-width:2px}.border-\[4px\]{border-width:4px}.border-x{border-left-width:1px;border-right-width:1px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-x-4{border-left-width:4px;border-right-width:4px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-y{border-top-width:1px;border-bottom-width:1px}.\!border-b{border-bottom-width:1px!important}.\!border-b-0{border-bottom-width:0px!important}.\!border-l-0{border-left-width:0px!important}.\!border-r-0{border-right-width:0px!important}.\!border-t-0{border-top-width:0px!important}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-b-4{border-bottom-width:4px}.border-b-\[2px\]{border-bottom-width:2px}.border-e{border-inline-end-width:1px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-\[5px\]{border-top-width:5px}.border-t-\[7px\]{border-top-width:7px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.\!border-none{border-style:none!important}.border-none{border-style:none}.\!border-\[\#32B8C6\]{--tw-border-opacity: 1 !important;border-color:rgb(50 184 198 / var(--tw-border-opacity))!important}.\!border-\[black\]\/10{border-color:#0000001a!important}.\!border-black\/30{border-color:#0000004d!important}.\!border-caution{--tw-border-opacity: 1 !important;border-color:oklch(var(--caution-color) / var(--tw-border-opacity))!important}.\!border-caution\/50{border-color:oklch(var(--caution-color) / .5)!important}.\!border-inverse{border-color:oklch(var(--foreground-inverse-color))!important}.\!border-negative{border-color:oklch(var(--negative-color))!important}.\!border-subtle{border-color:oklch(var(--foreground-subtle-color))!important}.\!border-subtler{border-color:oklch(var(--foreground-subtler-color))!important}.\!border-subtlest{border-color:oklch(var(--foreground-subtlest-color))!important}.\!border-super{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.\!border-super\/10{border-color:oklch(var(--super-color) / .1)!important}.\!border-super\/30{border-color:oklch(var(--super-color) / .3)!important}.\!border-super\/75{border-color:oklch(var(--super-color) / .75)!important}.\!border-transparent{border-color:transparent!important}.\!border-white{--tw-border-opacity: 1 !important;border-color:rgb(255 255 255 / var(--tw-border-opacity))!important}.border-\[\#05FFFF\]\/20{border-color:#05ffff33}.border-\[\#A7A7A2\]{--tw-border-opacity: 1;border-color:rgb(167 167 162 / var(--tw-border-opacity))}.border-\[black\]\/10{border-color:#0000001a}.border-\[black\]\/5{border-color:#0000000d}.border-\[purple\]{--tw-border-opacity: 1;border-color:rgb(128 0 128 / var(--tw-border-opacity))}.border-black\/10{border-color:#0000001a}.border-black\/20{border-color:#0003}.border-caution\/10{border-color:oklch(var(--caution-color) / .1)}.border-caution\/20{border-color:oklch(var(--caution-color) / .2)}.border-caution\/50{border-color:oklch(var(--caution-color) / .5)}.border-dynamic{border-color:oklch(var(--border-dynamic))}.border-foreground{border-color:oklch(var(--foreground-color))}.border-inverse{border-color:oklch(var(--foreground-inverse-color))}.border-max{--tw-border-opacity: 1;border-color:oklch(var(--max-color) / var(--tw-border-opacity))}.border-negative{border-color:oklch(var(--negative-color))}.border-positive{border-color:oklch(var(--positive-color))}.border-subtle{border-color:oklch(var(--foreground-subtle-color))}.border-subtler{border-color:oklch(var(--foreground-subtler-color))}.border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}.border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.border-super\/10{border-color:oklch(var(--super-color) / .1)}.border-super\/20{border-color:oklch(var(--super-color) / .2)}.border-super\/30{border-color:oklch(var(--super-color) / .3)}.border-super\/40{border-color:oklch(var(--super-color) / .4)}.border-super\/50{border-color:oklch(var(--super-color) / .5)}.border-superBG{--tw-border-opacity: 1;border-color:oklch(var(--super-bg-color) / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-white\/10{border-color:#ffffff1a}.border-white\/20{border-color:#fff3}.border-white\/30{border-color:#ffffff4d}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.\!border-b-subtler{border-bottom-color:oklch(var(--foreground-subtler-color))!important}.\!border-b-subtlest{border-bottom-color:oklch(var(--foreground-subtlest-color))!important}.\!border-t-subtlest{border-top-color:oklch(var(--foreground-subtlest-color))!important}.border-b-subtler{border-bottom-color:oklch(var(--foreground-subtler-color))}.border-b-subtlest{border-bottom-color:oklch(var(--foreground-subtlest-color))}.border-r-subtlest{border-right-color:oklch(var(--foreground-subtlest-color))}.border-t-subtlest{border-top-color:oklch(var(--foreground-subtlest-color))}.border-t-super{--tw-border-opacity: 1;border-top-color:oklch(var(--super-color) / var(--tw-border-opacity))}.border-t-transparent{border-top-color:transparent}.border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity))}.\!bg-\[\#1e293b\]{--tw-bg-opacity: 1 !important;background-color:rgb(30 41 59 / var(--tw-bg-opacity))!important}.\!bg-\[\#5433eb\]{--tw-bg-opacity: 1 !important;background-color:rgb(84 51 235 / var(--tw-bg-opacity))!important}.\!bg-\[\#e10600\]{--tw-bg-opacity: 1 !important;background-color:rgb(225 6 0 / var(--tw-bg-opacity))!important}.\!bg-\[\#ffffff1a\]{background-color:#ffffff1a!important}.\!bg-\[gold\]{--tw-bg-opacity: 1 !important;background-color:rgb(255 215 0 / var(--tw-bg-opacity))!important}.\!bg-\[oklch\(var\(--pale-blue-200\)\)\]{background-color:oklch(var(--pale-blue-200))!important}.\!bg-\[silver\]{--tw-bg-opacity: 1 !important;background-color:rgb(192 192 192 / var(--tw-bg-opacity))!important}.\!bg-\[var\(--header-bg\,\#051224\)\]{background-color:var(--header-bg,#051224)!important}.\!bg-\[var\(--header-bg\,\#84754E\)\]{background-color:var(--header-bg,#84754E)!important}.\!bg-attention\/10{background-color:oklch(var(--attention-color) / .1)!important}.\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}.\!bg-base\/95{background-color:oklch(var(--background-base-color) / .95)!important}.\!bg-black{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity))!important}.\!bg-black\/10{background-color:#0000001a!important}.\!bg-black\/30{background-color:#0000004d!important}.\!bg-black\/5{background-color:#0000000d!important}.\!bg-black\/50{background-color:#00000080!important}.\!bg-caution\/10{background-color:oklch(var(--caution-color) / .1)!important}.\!bg-inverse{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))!important}.\!bg-inverse\/10{background-color:oklch(var(--background-inverse-color) / .1)!important}.\!bg-inverse\/100{background-color:oklch(var(--background-inverse-color) / 1)!important}.\!bg-inverse\/5{background-color:oklch(var(--background-inverse-color) / .05)!important}.\!bg-inverse\/50{background-color:oklch(var(--background-inverse-color) / .5)!important}.\!bg-inverse\/70{background-color:oklch(var(--background-inverse-color) / .7)!important}.\!bg-max{--tw-bg-opacity: 1 !important;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))!important}.\!bg-negative\/10{background-color:oklch(var(--negative-color) / .1)!important}.\!bg-negative\/20{background-color:oklch(var(--negative-color) / .2)!important}.\!bg-offset{background-color:oklch(var(--offset-color))!important}.\!bg-raised{background-color:oklch(var(--background-raised-color))!important}.\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}.\!bg-subtlest{background-color:oklch(var(--background-subtlest-color))!important}.\!bg-super{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\!bg-super\/10{background-color:oklch(var(--super-color) / .1)!important}.\!bg-super\/15{background-color:oklch(var(--super-color) / .15)!important}.\!bg-super\/20{background-color:oklch(var(--super-color) / .2)!important}.\!bg-transparent{background-color:transparent!important}.\!bg-underlay{background-color:oklch(var(--background-underlay-color))!important}.\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.\!bg-white\/10{background-color:#ffffff1a!important}.bg-\[\#000000\]{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-\[\#008cff\]{--tw-bg-opacity: 1;background-color:rgb(0 140 255 / var(--tw-bg-opacity))}.bg-\[\#059669\]{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity))}.bg-\[\#13343B\]{--tw-bg-opacity: 1;background-color:rgb(19 52 59 / var(--tw-bg-opacity))}.bg-\[\#19789E\]{--tw-bg-opacity: 1;background-color:rgb(25 120 158 / var(--tw-bg-opacity))}.bg-\[\#1F2121\]{--tw-bg-opacity: 1;background-color:rgb(31 33 33 / var(--tw-bg-opacity))}.bg-\[\#21808D\]{--tw-bg-opacity: 1;background-color:rgb(33 128 141 / var(--tw-bg-opacity))}.bg-\[\#292524\]{--tw-bg-opacity: 1;background-color:rgb(41 37 36 / var(--tw-bg-opacity))}.bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}.bg-\[\#44403c\]{--tw-bg-opacity: 1;background-color:rgb(68 64 60 / var(--tw-bg-opacity))}.bg-\[\#482d2f\]{--tw-bg-opacity: 1;background-color:rgb(72 45 47 / var(--tw-bg-opacity))}.bg-\[\#60584D\]\/\[0\.06\]{background-color:#60584d0f}.bg-\[\#64748b\]{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity))}.bg-\[\#848456\]{--tw-bg-opacity: 1;background-color:rgb(132 132 86 / var(--tw-bg-opacity))}.bg-\[\#865D95\]{--tw-bg-opacity: 1;background-color:rgb(134 93 149 / var(--tw-bg-opacity))}.bg-\[\#944454\]{--tw-bg-opacity: 1;background-color:rgb(148 68 84 / var(--tw-bg-opacity))}.bg-\[\#A84B2F\]{--tw-bg-opacity: 1;background-color:rgb(168 75 47 / var(--tw-bg-opacity))}.bg-\[\#C0152F\]{--tw-bg-opacity: 1;background-color:rgb(192 21 47 / var(--tw-bg-opacity))}.bg-\[\#D39900\]{--tw-bg-opacity: 1;background-color:rgb(211 153 0 / var(--tw-bg-opacity))}.bg-\[\#DB7100\]{--tw-bg-opacity: 1;background-color:rgb(219 113 0 / var(--tw-bg-opacity))}.bg-\[\#DEDBD7\]{--tw-bg-opacity: 1;background-color:rgb(222 219 215 / var(--tw-bg-opacity))}.bg-\[\#e10600\]{--tw-bg-opacity: 1;background-color:rgb(225 6 0 / var(--tw-bg-opacity))}.bg-\[\#e11d48\]{--tw-bg-opacity: 1;background-color:rgb(225 29 72 / var(--tw-bg-opacity))}.bg-\[\#f3f3ef\]{--tw-bg-opacity: 1;background-color:rgb(243 243 239 / var(--tw-bg-opacity))}.bg-\[\#facc15\]\/25{background-color:#facc1540}.bg-\[\#fee2e2\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-\[color\:oklch\(var\(--foreground-color\)\/0\.15\)\]{background-color:oklch(var(--foreground-color)/.15)}.bg-\[purple\]\/90{background-color:#800080e6}.bg-\[var\(--dot-color\)\]{background-color:var(--dot-color)}.bg-attention{--tw-bg-opacity: 1;background-color:oklch(var(--attention-color) / var(--tw-bg-opacity))}.bg-attention\/10{background-color:oklch(var(--attention-color) / .1)}.bg-backdrop{--tw-bg-opacity: 1;background-color:oklch(var(--backdrop-color) / var(--tw-bg-opacity))}.bg-backdrop\/25{background-color:oklch(var(--backdrop-color) / .25)}.bg-backdrop\/70{background-color:oklch(var(--backdrop-color) / .7)}.bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}.bg-base\/40{background-color:oklch(var(--background-base-color) / .4)}.bg-base\/90{background-color:oklch(var(--background-base-color) / .9)}.bg-base\/95{background-color:oklch(var(--background-base-color) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/10{background-color:#0000001a}.bg-black\/20{background-color:#0003}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/80{background-color:#000c}.bg-caution{--tw-bg-opacity: 1;background-color:oklch(var(--caution-color) / var(--tw-bg-opacity))}.bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}.bg-caution\/5{background-color:oklch(var(--caution-color) / .05)}.bg-current{background-color:currentColor}.bg-dark{background-color:oklch(var(--dark-background-base-color))}.bg-elevated{background-color:oklch(var(--background-elevated-color))}.bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}.bg-inverse\/10{background-color:oklch(var(--background-inverse-color) / .1)}.bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}.bg-inverse\/25{background-color:oklch(var(--background-inverse-color) / .25)}.bg-inverse\/30{background-color:oklch(var(--background-inverse-color) / .3)}.bg-inverse\/45{background-color:oklch(var(--background-inverse-color) / .45)}.bg-inverse\/5{background-color:oklch(var(--background-inverse-color) / .05)}.bg-inverse\/70{background-color:oklch(var(--background-inverse-color) / .7)}.bg-lightbox\/95{background-color:oklch(var(--background-lightbox-color) / .95)}.bg-max{--tw-bg-opacity: 1;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))}.bg-negative{--tw-bg-opacity: 1;background-color:oklch(var(--negative-color) / var(--tw-bg-opacity))}.bg-negative\/10{background-color:oklch(var(--negative-color) / .1)}.bg-negative\/5{background-color:oklch(var(--negative-color) / .05)}.bg-negative\/90{background-color:oklch(var(--negative-color) / .9)}.bg-offset{background-color:oklch(var(--offset-color))}.bg-offset-special{background-color:oklch(var(--surface-offset-special))}.bg-positive{--tw-bg-opacity: 1;background-color:oklch(var(--positive-color) / var(--tw-bg-opacity))}.bg-positive\/10{background-color:oklch(var(--positive-color) / .1)}.bg-positive\/90{background-color:oklch(var(--positive-color) / .9)}.bg-raised{background-color:oklch(var(--background-raised-color))}.bg-raisedOffset{background-color:oklch(var(--raised-offset-color))}.bg-subtle{background-color:oklch(var(--background-subtle-color))}.bg-subtler{background-color:oklch(var(--background-subtler-color))}.bg-subtlest{background-color:oklch(var(--background-subtlest-color))}.bg-super{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.bg-super\/10{background-color:oklch(var(--super-color) / .1)}.bg-super\/15{background-color:oklch(var(--super-color) / .15)}.bg-super\/20{background-color:oklch(var(--super-color) / .2)}.bg-super\/30{background-color:oklch(var(--super-color) / .3)}.bg-super\/5{background-color:oklch(var(--super-color) / .05)}.bg-superBG{--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-underlay{background-color:oklch(var(--background-underlay-color))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/5{background-color:#ffffff0d}.bg-white\/50{background-color:#ffffff80}.bg-white\/75{background-color:#ffffffbf}.bg-white\/80{background-color:#fffc}.bg-opacity-60{--tw-bg-opacity: .6}.bg-\[conic-gradient\(var\(--button-border-gradient-stops\)\)\]{background-image:conic-gradient(var(--button-border-gradient-stops))}.bg-\[radial-gradient\(circle_farthest-side_at_0_100\%\,\#139FB233\,\#139FB2cc\)\,radial-gradient\(circle_farthest-side_at_100\%_0\,\#139FB233\,transparent\)\]{background-image:radial-gradient(circle farthest-side at 0 100%,#139fb233,#139fb2cc),radial-gradient(circle farthest-side at 100% 0,#139FB233,transparent)}.bg-\[radial-gradient\(circle_farthest-side_at_0_100\%\,\#27cae0e3\,transparent\)\,radial-gradient\(circle_farthest-side_at_100\%_0\,\#24B4C81A\,transparent\)\]{background-image:radial-gradient(circle farthest-side at 0 100%,#27cae0e3,transparent),radial-gradient(circle farthest-side at 100% 0,#24B4C81A,transparent)}.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-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.bg-none{background-image:none}.from-\[\#1FB8CD80\]{--tw-gradient-from: #1FB8CD80 var(--tw-gradient-from-position);--tw-gradient-to: rgb(31 184 205 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-base{--tw-gradient-from: oklch(var(--background-base-color) / 1) var(--tw-gradient-from-position);--tw-gradient-to: oklch(var(--background-base-color) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-base\/50{--tw-gradient-from: oklch(var(--background-base-color) / .5) 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)}.from-black{--tw-gradient-from: #000 var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/40{--tw-gradient-from: rgb(0 0 0 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/70{--tw-gradient-from: rgb(0 0 0 / .7) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-negative\/20{--tw-gradient-from: oklch(var(--negative-color) / .2) 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)}.from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}.from-super\/25{--tw-gradient-from: oklch(var(--super-color) / .25) 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)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-35\%{--tw-gradient-from-position: 35%}.from-45\%{--tw-gradient-from-position: 45%}.from-5\%{--tw-gradient-from-position: 5%}.from-\[-10\%\]{--tw-gradient-from-position: -10%}.via-base\/80{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-base-color) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-black\/20{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-subtle{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-subtle-color)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-subtler{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), oklch(var(--background-subtler-color)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-50\%{--tw-gradient-via-position: 50%}.via-75\%{--tw-gradient-via-position: 75%}.to-\[\#24B4C81A\]{--tw-gradient-to: #24B4C81A var(--tw-gradient-to-position)}.to-\[oklch\(var\(--light-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--light-background-base-color)) var(--tw-gradient-to-position)}.to-\[rgba\(180\,180\,180\,0\.075\)\]{--tw-gradient-to: rgba(180,180,180,.075) var(--tw-gradient-to-position)}.to-attention\/20{--tw-gradient-to: oklch(var(--attention-color) / .2) var(--tw-gradient-to-position)}.to-base{--tw-gradient-to: oklch(var(--background-base-color) / 1) var(--tw-gradient-to-position)}.to-base\/0{--tw-gradient-to: oklch(var(--background-base-color) / 0) var(--tw-gradient-to-position)}.to-black\/20{--tw-gradient-to: rgb(0 0 0 / .2) var(--tw-gradient-to-position)}.to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}.to-super\/25{--tw-gradient-to: oklch(var(--super-color) / .25) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-\[110\%\]{--tw-gradient-to-position: 110%}.bg-cover{background-size:cover}.bg-clip-border{background-clip:border-box}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-center{background-position:center}.bg-no-repeat{background-repeat:no-repeat}.\!fill-inverse{fill:oklch(var(--foreground-inverse-color))!important}.\!fill-super{fill:oklch(var(--super-color) / 1)!important}.fill-\[\#eab308\]{fill:#eab308}.fill-\[oklch\(var\(--background-base-color\)\)\]{fill:oklch(var(--background-base-color))}.fill-\[oklch\(var\(--dark-background-base-color\)\)\]{fill:oklch(var(--dark-background-base-color))}.fill-base{fill:oklch(var(--background-base-color))}.fill-caution{fill:oklch(var(--caution-color) / 1)}.fill-current{fill:currentColor}.fill-dark{fill:oklch(var(--light-foreground-color))}.fill-foreground{fill:oklch(var(--foreground-color))}.fill-inverse{fill:oklch(var(--foreground-inverse-color))}.fill-light{fill:oklch(var(--dark-foreground-color))}.fill-max{fill:oklch(var(--max-color) / 1)}.fill-offset{fill:oklch(var(--offset-color))}.fill-quiet{fill:oklch(var(--foreground-quiet-color))}.fill-super{fill:oklch(var(--super-color) / 1)}.fill-transparent{fill:transparent}.stroke-\[\#e10600\]{stroke:#e10600}.stroke-caution{stroke:oklch(var(--caution-color) / 1)}.stroke-dark{stroke:oklch(var(--light-foreground-color))}.stroke-foreground{stroke:oklch(var(--foreground-color))}.stroke-inverse{stroke:oklch(var(--foreground-inverse-color))}.stroke-light{stroke:oklch(var(--dark-foreground-color))}.stroke-quiet{stroke:oklch(var(--foreground-quiet-color))}.stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}.stroke-super{stroke:oklch(var(--super-color) / 1)}.stroke-white\/5{stroke:#ffffff0d}.stroke-\[1\.5px\]{stroke-width:1.5px}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.object-none{-o-object-fit:none;object-fit:none}.\!object-center{-o-object-position:center!important;object-position:center!important}.object-\[0_90\%\]{-o-object-position:0 90%;object-position:0 90%}.object-\[60\%_center\]{-o-object-position:60% center;object-position:60% center}.object-center{-o-object-position:center;object-position:center}.object-left{-o-object-position:left;object-position:left}.object-left-top{-o-object-position:left top;object-position:left top}.object-top{-o-object-position:top;object-position:top}.\!p-0{padding:0!important}.\!p-3{padding:.75rem!important}.\!p-6{padding:1.5rem!important}.\!p-md{padding:var(--size-md)!important}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-12{padding:3rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-24{padding:6rem}.p-2xl{padding:96px}.p-2xs{padding:var(--size-2xs)}.p-3{padding:.75rem}.p-32{padding:8rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[0\.2rem\]{padding:.2rem}.p-\[0\.5px\]{padding:.5px}.p-\[0\.8rem\]{padding:.8rem}.p-\[1\.5px\]{padding:1.5px}.p-\[10px\]{padding:10px}.p-\[12px\]{padding:12px}.p-\[2\.5px\]{padding:2.5px}.p-\[20px\]{padding:20px}.p-\[4px\]{padding:4px}.p-\[6px\]{padding:6px}.p-\[7px\]{padding:7px}.p-\[8px\]{padding:8px}.p-half{padding:.5px}.p-lg{padding:var(--size-lg)}.p-md{padding:var(--size-md)}.p-ml{padding:var(--size-ml)}.p-one,.p-px{padding:1px}.p-sm{padding:var(--size-sm)}.p-three{padding:3px}.p-two{padding:2px}.p-xl{padding:var(--size-xl)}.p-xs{padding:var(--size-xs)}.\!px-0{padding-left:0!important;padding-right:0!important}.\!px-1{padding-left:.25rem!important;padding-right:.25rem!important}.\!px-1\.5{padding-left:.375rem!important;padding-right:.375rem!important}.\!px-2xl{padding-left:96px!important;padding-right:96px!important}.\!px-3{padding-left:.75rem!important;padding-right:.75rem!important}.\!px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.\!px-8{padding-left:2rem!important;padding-right:2rem!important}.\!px-\[12px\]{padding-left:12px!important;padding-right:12px!important}.\!px-lg{padding-left:var(--size-lg)!important;padding-right:var(--size-lg)!important}.\!px-md{padding-left:var(--size-md)!important;padding-right:var(--size-md)!important}.\!px-sm{padding-left:var(--size-sm)!important;padding-right:var(--size-sm)!important}.\!px-xs{padding-left:var(--size-xs)!important;padding-right:var(--size-xs)!important}.\!py-0{padding-top:0!important;padding-bottom:0!important}.\!py-md{padding-top:var(--size-md)!important;padding-bottom:var(--size-md)!important}.\!py-sm{padding-top:var(--size-sm)!important;padding-bottom:var(--size-sm)!important}.\!py-xs{padding-top:var(--size-xs)!important;padding-bottom:var(--size-xs)!important}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.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-3\.5{padding-left:.875rem;padding-right:.875rem}.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}.px-\[0\.1875rem\]{padding-left:.1875rem;padding-right:.1875rem}.px-\[0\.3rem\]{padding-left:.3rem;padding-right:.3rem}.px-\[0\.6em\]{padding-left:.6em;padding-right:.6em}.px-\[0\.6rem\]{padding-left:.6rem;padding-right:.6rem}.px-\[10px\]{padding-left:10px;padding-right:10px}.px-\[12px\]{padding-left:12px;padding-right:12px}.px-\[5px\]{padding-left:5px;padding-right:5px}.px-\[6px\]{padding-left:6px;padding-right:6px}.px-\[var\(--thread-visual-spacing\)\]{padding-left:var(--thread-visual-spacing);padding-right:var(--thread-visual-spacing)}.px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.px-pageHorizontalPadding{padding-left:var(--page-horizontal-padding);padding-right:var(--page-horizontal-padding)}.px-px{padding-left:1px;padding-right:1px}.px-sm{padding-left:var(--size-sm);padding-right:var(--size-sm)}.px-three{padding-left:3px;padding-right:3px}.px-two{padding-left:2px;padding-right:2px}.px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.px-xs{padding-left:var(--size-xs);padding-right:var(--size-xs)}.py-0{padding-top:0;padding-bottom:0}.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-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-2xl{padding-top:96px;padding-bottom:96px}.py-2xs{padding-top:var(--size-2xs);padding-bottom:var(--size-2xs)}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-32{padding-top:8rem;padding-bottom:8rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[0\.125rem\]{padding-top:.125rem;padding-bottom:.125rem}.py-\[0\.15em\]{padding-top:.15em;padding-bottom:.15em}.py-\[0\.175rem\]{padding-top:.175rem;padding-bottom:.175rem}.py-\[0\.1875rem\]{padding-top:.1875rem;padding-bottom:.1875rem}.py-\[10px\]{padding-top:10px;padding-bottom:10px}.py-\[12px\]{padding-top:12px;padding-bottom:12px}.py-\[18px\]{padding-top:18px;padding-bottom:18px}.py-\[20px\]{padding-top:20px;padding-bottom:20px}.py-\[6px\]{padding-top:6px;padding-bottom:6px}.py-lg{padding-top:var(--size-lg);padding-bottom:var(--size-lg)}.py-md{padding-top:var(--size-md);padding-bottom:var(--size-md)}.py-ml{padding-top:var(--size-ml);padding-bottom:var(--size-ml)}.py-px{padding-top:1px;padding-bottom:1px}.py-sm{padding-top:var(--size-sm);padding-bottom:var(--size-sm)}.py-two{padding-top:2px;padding-bottom:2px}.py-xl{padding-top:var(--size-xl);padding-bottom:var(--size-xl)}.py-xs{padding-top:var(--size-xs);padding-bottom:var(--size-xs)}.\!pb-0{padding-bottom:0!important}.\!pb-4{padding-bottom:1rem!important}.\!pb-6{padding-bottom:1.5rem!important}.\!pb-md{padding-bottom:var(--size-md)!important}.\!pb-px{padding-bottom:1px!important}.\!pl-0{padding-left:0!important}.\!pl-1{padding-left:.25rem!important}.\!pl-1\.5{padding-left:.375rem!important}.\!pl-3{padding-left:.75rem!important}.\!pl-4{padding-left:1rem!important}.\!pl-\[0\.3em\]{padding-left:.3em!important}.\!pl-\[23px\]{padding-left:23px!important}.\!pl-sm{padding-left:var(--size-sm)!important}.\!pr-0{padding-right:0!important}.\!pr-3{padding-right:.75rem!important}.\!pt-0{padding-top:0!important}.\!pt-10{padding-top:2.5rem!important}.\!pt-4{padding-top:1rem!important}.\!pt-8{padding-top:2rem!important}.pb-0{padding-bottom:0}.pb-0\.5{padding-bottom:.125rem}.pb-1{padding-bottom:.25rem}.pb-12{padding-bottom:3rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-48{padding-bottom:12rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-7{padding-bottom:1.75rem}.pb-8{padding-bottom:2rem}.pb-\[100px\]{padding-bottom:100px}.pb-\[12px\]{padding-bottom:12px}.pb-\[160px\]{padding-bottom:160px}.pb-\[200px\]{padding-bottom:200px}.pb-\[32px\]{padding-bottom:32px}.pb-\[57px\]{padding-bottom:57px}.pb-\[var\(--thread-visual-spacing\)\]{padding-bottom:var(--thread-visual-spacing)}.pb-lg{padding-bottom:var(--size-lg)}.pb-md{padding-bottom:var(--size-md)}.pb-mobileNavHeight{padding-bottom:var(--mobile-nav-height)}.pb-px{padding-bottom:1px}.pb-safeAreaInsetBottom{padding-bottom:var(--safe-area-inset-bottom)}.pb-sm{padding-bottom:var(--size-sm)}.pb-threadAttachmentsHeightWithPadding{padding-bottom:var(--thread-attachments-height-with-padding)}.pb-threadInputHeightWithPadding{padding-bottom:var(--thread-input-height-with-padding)}.pb-three{padding-bottom:3px}.pb-two{padding-bottom:2px}.pb-xl{padding-bottom:var(--size-xl)}.pb-xs{padding-bottom:var(--size-xs)}.pe-\[20px\]{padding-inline-end:20px}.pl-0{padding-left:0}.pl-1{padding-left:.25rem}.pl-1\.5{padding-left:.375rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-\[12px\]{padding-left:12px}.pl-\[14px\]{padding-left:14px}.pl-\[2px\]{padding-left:2px}.pl-\[40px\]{padding-left:40px}.pl-\[4px\]{padding-left:4px}.pl-lg{padding-left:var(--size-lg)}.pl-md{padding-left:var(--size-md)}.pl-px{padding-left:1px}.pl-sm{padding-left:var(--size-sm)}.pl-two{padding-left:2px}.pl-xs{padding-left:var(--size-xs)}.pr-0{padding-right:0}.pr-1{padding-right:.25rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-28{padding-right:7rem}.pr-4{padding-right:1rem}.pr-\[10px\]{padding-right:10px}.pr-\[128px\]{padding-right:128px}.pr-\[12px\]{padding-right:12px}.pr-\[24px\]{padding-right:24px}.pr-\[49px\]{padding-right:49px}.pr-\[6px\]{padding-right:6px}.pr-\[75px\]{padding-right:75px}.pr-lg{padding-right:var(--size-lg)}.pr-md{padding-right:var(--size-md)}.pr-sm{padding-right:var(--size-sm)}.pr-three{padding-right:3px}.pr-xs{padding-right:var(--size-xs)}.ps-\[20px\]{padding-inline-start:20px}.ps-md{padding-inline-start:var(--size-md)}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-14{padding-top:3.5rem}.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-\[0\.275rem\]{padding-top:.275rem}.pt-\[12px\]{padding-top:12px}.pt-\[36px\]{padding-top:36px}.pt-\[48px\]{padding-top:48px}.pt-\[4px\]{padding-top:4px}.pt-\[88px\]{padding-top:88px}.pt-\[8vh\]{padding-top:8vh}.pt-\[var\(--thread-visual-spacing\)\]{padding-top:var(--thread-visual-spacing)}.pt-headerHeight{padding-top:var(--header-height)}.pt-lg{padding-top:var(--size-lg)}.pt-md{padding-top:var(--size-md)}.pt-one,.pt-px{padding-top:1px}.pt-sm{padding-top:var(--size-sm)}.pt-three{padding-top:3px}.pt-two{padding-top:2px}.pt-xl{padding-top:var(--size-xl)}.pt-xs{padding-top:var(--size-xs)}.\!text-left{text-align:left!important}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-justify{text-align:justify}.text-end{text-align:end}.align-baseline{vertical-align:baseline}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.align-text-top{vertical-align:text-top}.align-\[-0\.125em\]{vertical-align:-.125em}.\!font-display{font-family:var(--font-fk-grotesk),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"!important}.\!font-editorial{font-family:var(--font-newsreader),ui-serif,Georgia,Cambria,serif!important}.\!font-mono{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace!important}.\!font-sans{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo!important}.font-display{font-family:var(--font-fk-grotesk),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"}.font-editorial{font-family:var(--font-newsreader),ui-serif,Georgia,Cambria,serif}.font-mono{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo}.\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.\!text-2xs{font-size:11px!important;line-height:1rem!important}.\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.\!text-\[0\.6875rem\]{font-size:.6875rem!important}.\!text-\[0\.68rem\]{font-size:.68rem!important}.\!text-\[0\.7rem\]{font-size:.7rem!important}.\!text-\[0\.8125rem\]{font-size:.8125rem!important}.\!text-\[1\.2rem\]{font-size:1.2rem!important}.\!text-\[1\.3rem\]{font-size:1.3rem!important}.\!text-\[1\.75rem\]{font-size:1.75rem!important}.\!text-\[10px\]{font-size:10px!important}.\!text-\[11px\]{font-size:11px!important}.\!text-\[1rem\]{font-size:1rem!important}.\!text-\[2rem\]{font-size:2rem!important}.\!text-\[3rem\]{font-size:3rem!important}.\!text-\[44px\]{font-size:44px!important}.\!text-\[48px\]{font-size:48px!important}.\!text-base{font-size:1rem!important;line-height:1.5rem!important}.\!text-inherit{font-size:inherit!important;line-height:inherit!important}.\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.\!text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.\!text-xs{font-size:.75rem!important;line-height:1rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-2xs{font-size:11px;line-height:1rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-3xs{font-size:10px;line-height:.625rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[0\.80rem\]{font-size:.8rem}.text-\[0\]{font-size:0}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[16px\]{font-size:16px}.text-\[2\.4rem\]{font-size:2.4rem}.text-\[2rem\]{font-size:2rem}.text-\[8px\]{font-size:8px}.text-base{font-size:1rem;line-height:1.5rem}.text-inherit{font-size:inherit;line-height:inherit}.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-medium{font-weight:500!important}.\!font-normal{font-weight:400!important}.font-\[450\]{font-weight:450}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-extralight{font-weight:200}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.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-\[1\.1\]{line-height:1.1!important}.\!leading-\[1\.2\]{line-height:1.2!important}.\!leading-none{line-height:1!important}.\!leading-snug{line-height:1.375!important}.\!leading-tight{line-height:1.25!important}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-8{line-height:2rem}.leading-\[0\.875rem\]{line-height:.875rem}.leading-\[1\.125rem\]{line-height:1.125rem}.leading-\[1\.1\]{line-height:1.1}.leading-\[1\.2\]{line-height:1.2}.leading-\[1\.3\]{line-height:1.3}.leading-\[1\.5em\]{line-height:1.5em}.leading-\[12px\]{line-height:12px}.leading-\[18px\]{line-height:18px}.leading-\[32px\]{line-height:32px}.leading-\[48px\]{line-height:48px}.leading-\[64px\]{line-height:64px}.leading-\[initial\]{line-height:initial}.leading-loose{line-height:2}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.\!tracking-wider{letter-spacing:.05em!important}.tracking-\[-0\.8px\]{letter-spacing:-.8px}.tracking-\[-1\.8px\]{letter-spacing:-1.8px}.tracking-\[-1px\]{letter-spacing:-1px}.tracking-tight{letter-spacing:-.025em}.tracking-tighter{letter-spacing:-.05em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.\!text-\[currentColor\]{color:currentColor!important}.\!text-\[var\(--mode-color\)\]{color:var(--mode-color)!important}.\!text-\[white\]{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\!text-attention{--tw-text-opacity: 1 !important;color:oklch(var(--attention-color) / var(--tw-text-opacity))!important}.\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.\!text-black\/50{color:#00000080!important}.\!text-black\/60{color:#0009!important}.\!text-caution{--tw-text-opacity: 1 !important;color:oklch(var(--caution-color) / var(--tw-text-opacity))!important}.\!text-foreground{color:oklch(var(--foreground-color))!important}.\!text-inherit{color:inherit!important}.\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}.\!text-light{color:oklch(var(--dark-foreground-color))!important}.\!text-negative{--tw-text-opacity: 1 !important;color:oklch(var(--negative-color) / var(--tw-text-opacity))!important}.\!text-positive{--tw-text-opacity: 1 !important;color:oklch(var(--positive-color) / var(--tw-text-opacity))!important}.\!text-quiet{color:oklch(var(--foreground-quiet-color))!important}.\!text-quieter{color:oklch(var(--foreground-quieter-color))!important}.\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.\!text-transparent{color:transparent!important}.\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.\!text-white\/50{color:#ffffff80!important}.text-\[\#16a34a\]{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-\[\#22c55e\]{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-\[\#3b82f6\]{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-\[\#eab308\]{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.text-\[var\(--mode-color\)\]{color:var(--mode-color)}.text-attention{--tw-text-opacity: 1;color:oklch(var(--attention-color) / var(--tw-text-opacity))}.text-attention\/70{color:oklch(var(--attention-color) / .7)}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black\/50{color:#00000080}.text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}.text-dark{color:oklch(var(--light-foreground-color))}.text-foreground{color:oklch(var(--foreground-color))}.text-inherit{color:inherit}.text-inverse{color:oklch(var(--foreground-inverse-color))}.text-light{color:oklch(var(--dark-foreground-color))}.text-max{--tw-text-opacity: 1;color:oklch(var(--max-color) / var(--tw-text-opacity))}.text-negative{--tw-text-opacity: 1;color:oklch(var(--negative-color) / var(--tw-text-opacity))}.text-positive{--tw-text-opacity: 1;color:oklch(var(--positive-color) / var(--tw-text-opacity))}.text-quiet{color:oklch(var(--foreground-quiet-color))}.text-quieter{color:oklch(var(--foreground-quieter-color))}.text-quietest{color:oklch(var(--foreground-quietest-color))}.text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-white\/70{color:#ffffffb3}.text-white\/90{color:#ffffffe6}.underline{text-decoration-line:underline}.\!line-through{text-decoration-line:line-through!important}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.decoration-subtle{text-decoration-color:oklch(var(--foreground-subtle-color))}.decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}.decoration-super\/50{text-decoration-color:oklch(var(--super-color) / .5)}.decoration-transparent{text-decoration-color:transparent}.decoration-white\/50{text-decoration-color:#ffffff80}.decoration-dotted{text-decoration-style:dotted}.decoration-1{text-decoration-thickness:1px}.underline-offset-1{text-underline-offset:1px}.underline-offset-2{text-underline-offset:2px}.underline-offset-\[5px\]{text-underline-offset:5px}.\!placeholder-quietest::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\!placeholder-quietest::placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder-quieter::-moz-placeholder{color:oklch(var(--foreground-quieter-color))}.placeholder-quieter::placeholder{color:oklch(var(--foreground-quieter-color))}.caret-super{caret-color:oklch(var(--super-color) / 1)}.\!opacity-0{opacity:0!important}.\!opacity-100{opacity:1!important}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-15{opacity:.15}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-5{opacity:.05}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-95{opacity:.95}.opacity-\[0\.04\]{opacity:.04}.opacity-\[0\.075\]{opacity:.075}.opacity-\[0\.18\]{opacity:.18}.opacity-\[10\%\]{opacity:10%}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-difference{mix-blend-mode:difference}.\!shadow-none{--tw-shadow: 0 0 #0000 !important;--tw-shadow-colored: 0 0 #0000 !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.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)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px 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_-30px_30px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 -30px 30px oklch(var(--background-base-color));--tw-shadow-colored: 0 -30px 30px 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_16px_8px_oklch\(var\(--background-base-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--background-base-color)/.6);--tw-shadow-colored: 0 0 16px 8px 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_12px_16px_0_rgba\(0\,0\,0\,0\.10\)\]{--tw-shadow: 0 12px 16px 0 rgba(0,0,0,.1);--tw-shadow-colored: 0 12px 16px 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-\[0_1px_2px_0_rgba\(0\,0\,0\,0\.03\)\]{--tw-shadow: 0 1px 2px 0 rgba(0,0,0,.03);--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-\[0_1px_3px_0\]{--tw-shadow: 0 1px 3px 0;--tw-shadow-colored: 0 1px 3px 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-\[0_1px_4px_0_rgba\(0\,0\,0\,0\.05\)\,0_0_0_1px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 1px 4px 0 rgba(0,0,0,.05),0 0 0 1px rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 4px 0 var(--tw-shadow-color), 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-\[0_1px_6px_rgba\(0\,0\,0\,0\.25\)\]{--tw-shadow: 0 1px 6px rgba(0,0,0,.25);--tw-shadow-colored: 0 1px 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)}.shadow-\[0_1px_6px_rgba\(0\,0\,0\,0\.35\)\,0_0_0_1px_rgba\(0\,0\,0\,0\.05\)\]{--tw-shadow: 0 1px 6px rgba(0,0,0,.35),0 0 0 1px rgba(0,0,0,.05);--tw-shadow-colored: 0 1px 6px var(--tw-shadow-color), 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-\[0_1px_8px_2px_oklch\(var\(--foreground-color\)\/0\.1\)\,0_36px_16px_36px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 1px 8px 2px oklch(var(--foreground-color)/.1),0 36px 16px 36px oklch(var(--background-base-color));--tw-shadow-colored: 0 1px 8px 2px var(--tw-shadow-color), 0 36px 16px 36px 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_36px_16px_36px_oklch\(var\(--background-base-color\)\)\]{--tw-shadow: 0 36px 16px 36px oklch(var(--background-base-color));--tw-shadow-colored: 0 36px 16px 36px 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-\[0px_1px_4px_0px_rgba\(0\,0\,0\,0\.24\)\]{--tw-shadow: 0px 1px 4px 0px rgba(0,0,0,.24);--tw-shadow-colored: 0px 1px 4px 0px 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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-inset-xs{--tw-shadow: inset 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 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-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-overlay{--tw-shadow: 0 0 0 1px var(--shadow-overlay-border, rgba(0, 0, 0, .05)), 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 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-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-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.shadow-black\/5{--tw-shadow-color: rgb(0 0 0 / .05);--tw-shadow: var(--tw-shadow-colored)}.shadow-super{--tw-shadow-color: oklch(var(--super-color) / 1);--tw-shadow: var(--tw-shadow-colored)}.shadow-super\/10{--tw-shadow-color: oklch(var(--super-color) / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-super\/30{--tw-shadow-color: oklch(var(--super-color) / .3);--tw-shadow: var(--tw-shadow-colored)}.\!outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-super{outline-color:oklch(var(--super-color) / 1)}.outline-transparent{outline-color:transparent}.\!ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.\!ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.ring{--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(3px + 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-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-\[1\.5px\]{--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(1.5px + 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-inverse{--tw-ring-color: oklch(var(--foreground-inverse-color)) !important}.\!ring-super{--tw-ring-opacity: 1 !important;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity)) !important}.\!ring-transparent{--tw-ring-color: transparent !important}.ring-\[oklch\(var\(--pale-blue-200\)\)\]{--tw-ring-color: oklch(var(--pale-blue-200))}.ring-black\/10{--tw-ring-color: rgb(0 0 0 / .1)}.ring-inverse{--tw-ring-color: oklch(var(--foreground-inverse-color))}.ring-max{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--max-color) / var(--tw-ring-opacity))}.ring-raised{--tw-ring-color: oklch(var(--background-raised-color))}.ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}.ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}.ring-subtlest{--tw-ring-color: oklch(var(--foreground-subtlest-color))}.ring-super{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.ring-super\/50{--tw-ring-color: oklch(var(--super-color) / .5)}.ring-super\/60{--tw-ring-color: oklch(var(--super-color) / .6)}.ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}.ring-transparent{--tw-ring-color: transparent}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-black{--tw-ring-offset-color: #000}.ring-offset-inverse{--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.blur{--tw-blur: blur(8px);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)}.blur-\[0\.5px\]{--tw-blur: blur(.5px);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)}.blur-\[20px\]{--tw-blur: blur(20px);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)}.blur-\[30px\]{--tw-blur: blur(30px);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)}.blur-\[50px\]{--tw-blur: blur(50px);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)}.blur-lg{--tw-blur: blur(16px);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)}.blur-md{--tw-blur: blur(12px);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)}.blur-sm{--tw-blur: blur(4px);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)}.blur-xl{--tw-blur: blur(24px);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)}.brightness-110{--tw-brightness: brightness(1.1);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)}.brightness-\[0\.8\]{--tw-brightness: brightness(.8);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)}.contrast-75{--tw-contrast: contrast(.75);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)}.drop-shadow-\[0_0_1px_rgba\(96\,88\,77\,0\.5\)\]{--tw-drop-shadow: drop-shadow(0 0 1px rgba(96,88,77,.5));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)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));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)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));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)}.\!grayscale-0{--tw-grayscale: grayscale(0) !important;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)!important}.grayscale{--tw-grayscale: grayscale(100%);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)}.invert{--tw-invert: invert(100%);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)}.saturate-0{--tw-saturate: saturate(0);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)}.saturate-150{--tw-saturate: saturate(1.5);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)}.saturate-200{--tw-saturate: saturate(2);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-\[0\.5px\]{--tw-backdrop-blur: blur(.5px);-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-\[1px\]{--tw-backdrop-blur: blur(1px);-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-\[25px\]{--tw-backdrop-blur: blur(25px);-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-lg{--tw-backdrop-blur: blur(16px);-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-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)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-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-saturate-200{--tw-backdrop-saturate: saturate(2);-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,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[border-color\,border-radius\,box-shadow\]{transition-property:border-color,border-radius,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[padding\,opacity\]{transition-property:padding,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[text-decoration-color\]{transition-property:text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[transform\,width\,opacity\]{transition-property:transform,width,opacity;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-none{transition-property:none}.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}.\!delay-0{transition-delay:0s!important}.\!delay-200{transition-delay:.2s!important}.delay-0{transition-delay:0s}.delay-100{transition-delay:.1s}.delay-1000{transition-delay:1s}.delay-150{transition-delay:.15s}.delay-200{transition-delay:.2s}.delay-500{transition-delay:.5s}.\!duration-0{transition-duration:0s!important}.\!duration-100{transition-duration:.1s!important}.\!duration-150{transition-duration:.15s!important}.duration-0{transition-duration:0s}.duration-100{transition-duration:.1s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.duration-75{transition-duration:75ms}.duration-normal{transition-duration:.15s}.duration-quick{transition-duration:75ms}.\!ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)!important}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-inExpo{transition-timing-function:cubic-bezier(.7,0,.84,0)}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-outExpo{transition-timing-function:cubic-bezier(.16,1,.3,1)}.will-change-auto{will-change:auto}.will-change-transform{will-change:transform}.font-feature-tab-nums{font-feature-settings:"tnum"}.italic{font-variation-settings:"ital" 120}.mask-fade-r-12{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 3px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 3px),transparent 100%)}.mask-fade-r-6{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 1.5px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 1.5px),transparent 100%)}.mask-fade-l-12{-webkit-mask-image:linear-gradient(90deg,transparent 0,black 3px,black 100%);mask-image:linear-gradient(90deg,transparent 0,black 3px,black 100%)}.mask-fade-b-4{-webkit-mask-image:linear-gradient(180deg,black 0,black calc(100% - 1px),transparent 100%);mask-image:linear-gradient(180deg,black 0,black calc(100% - 1px),transparent 100%)}.mask-fade-t-6{-webkit-mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black 100%);mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black 100%)}.mask-fade-h-12{-webkit-mask-image:linear-gradient(90deg,transparent 0,black 3px,black calc(100% - 3px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,black 3px,black calc(100% - 3px),transparent 100%)}.mask-fade-v-6{-webkit-mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black calc(100% - 1.5px),transparent 100%);mask-image:linear-gradient(180deg,transparent 0,black 1.5px,black calc(100% - 1.5px),transparent 100%)}.text-box-trim-both{text-box-trim:trim-both}@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}.animate-out{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}.fade-in{--tw-enter-opacity: 0}.fade-in-25{--tw-enter-opacity: .25}.fade-in-50{--tw-enter-opacity: .5}.fade-out{--tw-exit-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-\[0\.97\]{--tw-enter-scale: .97}.zoom-in-\[0\.98\]{--tw-enter-scale: .98}.zoom-out{--tw-exit-scale: 0}.zoom-out-\[0\.97\]{--tw-exit-scale: .97}.zoom-out-\[0\.98\]{--tw-exit-scale: .98}.slide-in-from-bottom{--tw-enter-translate-y: 100%}.slide-in-from-right{--tw-enter-translate-x: 100%}.slide-out-to-bottom{--tw-exit-translate-y: 100%}.slide-out-to-right{--tw-exit-translate-x: 100%}.\!duration-0{animation-duration:0s!important}.\!duration-100{animation-duration:.1s!important}.\!duration-150{animation-duration:.15s!important}.duration-0{animation-duration:0s}.duration-100{animation-duration:.1s}.duration-1000{animation-duration:1s}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.duration-75{animation-duration:75ms}.duration-normal{animation-duration:.15s}.duration-quick{animation-duration:75ms}.\!delay-0{animation-delay:0s!important}.\!delay-200{animation-delay:.2s!important}.delay-0{animation-delay:0s}.delay-100{animation-delay:.1s}.delay-1000{animation-delay:1s}.delay-150{animation-delay:.15s}.delay-200{animation-delay:.2s}.delay-500{animation-delay:.5s}.\!ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)!important}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-inExpo{animation-timing-function:cubic-bezier(.7,0,.84,0)}.ease-linear{animation-timing-function:linear}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.ease-outExpo{animation-timing-function:cubic-bezier(.16,1,.3,1)}.running{animation-play-state:running}.paused{animation-play-state:paused}.fill-mode-both{animation-fill-mode:both}.repeat-1{animation-iteration-count:1}.\@container{container-type:inline-size}.\@container\/banner{container-type:inline-size;container-name:banner}.\@container\/header{container-type:inline-size;container-name:header}.\@container\/main{container-type:inline-size;container-name:main}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-track-transparent{--scrollbar-track: transparent !important}:root{--font-thin: 100;--font-extralight: 200;--font-light: 300;--font-normal: 400;--font-semimedium: 475;--font-medium: 500;--font-semibold: 600;--font-bold: 700;--font-extrabold: 800;--font-black: 900;--font-thin-inverse: 75;--font-extralight-inverse: 175;--font-light-inverse: 275;--font-normal-inverse: 375;--font-semimedium-inverse: 450;--font-medium-inverse: 475;--font-semibold-inverse: 575;--font-bold-inverse: 675;--font-extrabold-inverse: 775;--font-black-inverse: 875}.font-thin{font-weight:var(--font-thin)}.font-extralight{font-weight:var(--font-extralight)}.font-light{font-weight:var(--font-light)}.\!font-normal{font-weight:var(--font-normal)!important}.font-normal{font-weight:var(--font-normal)}.font-semimedium{font-weight:var(--font-semimedium)}.\!font-medium{font-weight:var(--font-medium)!important}.font-medium{font-weight:var(--font-medium)}.font-semibold{font-weight:var(--font-semibold)}.font-bold{font-weight:var(--font-bold)}.font-extrabold{font-weight:var(--font-extrabold)}:is(.\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(.text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}[data-color-scheme=dark]{--font-thin: 75;--font-extralight: 175;--font-light: 275;--font-normal: 375;--font-semimedium: 450;--font-medium: 475;--font-semibold: 575;--font-bold: 675;--font-extrabold: 775;--font-black: 875;--font-thin-inverse: 100;--font-extralight-inverse: 200;--font-light-inverse: 300;--font-normal-inverse: 400;--font-semimedium-inverse: 475;--font-medium-inverse: 500;--font-semibold-inverse: 600;--font-bold-inverse: 700;--font-extrabold-inverse: 800;--font-black-inverse: 900}[data-color-scheme=dark] .prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *,.reset,.reset *)){font-weight:inherit}[data-color-scheme=dark] .prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit}[data-color-scheme=dark] .prose :where(blockquote p):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit}.\!\[--dog-bg-highlight\:currentColor\]{--dog-bg-highlight: currentColor !important}.\!\[--dot-bg\:\#1e293b\]{--dot-bg: #1e293b !important}.\!\[--dot-bg\:\#e10600\]{--dot-bg: #e10600 !important}.\!\[--dot-bg\:var\(--header-bg\,\#051224\)\]{--dot-bg: var(--header-bg,#051224) !important}.\!\[--dot-bg\:var\(--header-bg\,\#84754E\)\]{--dot-bg: var(--header-bg,#84754E) !important}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[-webkit-user-drag\:none\]{-webkit-user-drag:none}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.\[clip-path\:inset\(1px_1px_0px_1px\)\]{clip-path:inset(1px 1px 0px 1px)}.\[color-scheme\:none\]{color-scheme:none}.\[container-name\:tabbar\]{container-name:tabbar}.\[container-type\:inline-size\]{container-type:inline-size}.\[counter-increment\:list\]{counter-increment:list}.\[counter-reset\:list\]{counter-reset:list}.\[grid-area\:1\/-1\]{grid-area:1/-1}.\[grid-area\:actions\]{grid-area:actions}.\[grid-area\:email\]{grid-area:email}.\[grid-area\:role\]{grid-area:role}.\[grid-area\:scim\]{grid-area:scim}.\[grid-area\:status\]{grid-area:status}.\[grid-area\:tier\]{grid-area:tier}.\[grid-template-columns\:2fr_1fr_1fr\]{grid-template-columns:2fr 1fr 1fr}.\[margin-left\:max\(0px\,calc\(\(100\%-var\(--thread-content-width\)\)\/2-var\(--left-width\)-var\(--gap\)-var\(--scrollbar-gutter-offset\)\/2\)\)\]{margin-left:max(0px,calc((100% - var(--thread-content-width)) / 2 - var(--left-width) - var(--gap) - var(--scrollbar-gutter-offset) / 2))}.\[mask-image\:linear-gradient\(90deg\,black_0\,black_calc\(100\%-60px\)\,transparent_calc\(100\%-20px\)\,transparent_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%)}.\[mask-image\:linear-gradient\(90deg\,transparent_0\,transparent_20px\,black_60px\,black_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black 100%);mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black 100%)}.\[mask-image\:linear-gradient\(90deg\,transparent_0\,transparent_20px\,black_60px\,black_calc\(100\%-60px\)\,transparent_calc\(100\%-20px\)\,transparent_100\%\)\]{-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,transparent 20px,black 60px,black calc(100% - 60px),transparent calc(100% - 20px),transparent 100%)}.\[mask-image\:linear-gradient\(to_bottom\,\#000_0\%\,transparent_160px\)\]{-webkit-mask-image:linear-gradient(to bottom,#000 0%,transparent 160px);mask-image:linear-gradient(to bottom,#000 0%,transparent 160px)}.\[mix-blend-mode\:overlay\]{mix-blend-mode:overlay}.\[overflow-clip-margin\:unset\]{overflow-clip-margin:unset}.\[overflow-wrap\:break-word\]{overflow-wrap:break-word}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.\[scrollbar-width\:none\]{scrollbar-width:none}.\[scrollbar-width\:thin\]{scrollbar-width:thin}.\[stroke-width\:1\.5\]{stroke-width:1.5}.\[word-break\:break-word\]{word-break:break-word}.\[word-spacing\:4px\]{word-spacing:4px}html{min-height:100%;font-size:16px;overflow-y:auto;scrollbar-width:15px;font-weight:400;letter-spacing:.005em}[data-color-scheme=dark]{color-scheme:dark;font-weight:375;letter-spacing:.01em}body{margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-synthesis:none}.interactable{cursor:pointer}.interactable:focus{outline:2px solid transparent;outline-offset:2px}.interactable: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);--tw-ring-color: oklch(var(--super-color) / .8);--tw-ring-offset-width: 2px;--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.interactable-alt{cursor:pointer;position:relative}.interactable-alt:before{pointer-events:none;position:absolute;inset:.5rem;border-radius:inherit;--tw-content: "";content:var(--tw-content)}.interactable-alt:focus{outline:2px solid transparent;outline-offset:2px}.interactable-alt: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(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);--tw-ring-color: transparent;--tw-ring-offset-color: transparent}.interactable-alt:focus-visible:before{--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);--tw-ring-color: oklch(var(--super-color) / .8);--tw-ring-offset-width: 2px;content:var(--tw-content);--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}code,.ace_placeholder.ace_comment{font-family:var(--font-berkeley-mono),ui-monospace,SFMono-Regular,monospace}:is(code,.font-mono),:is(.ace_placeholder.ace_comment,.font-mono){font-synthesis:none}.katex{-webkit-font-smoothing:auto;max-width:100%;overflow:auto hidden;-ms-overflow-style:none;scrollbar-width:none}.katex::-webkit-scrollbar{display:none}[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}.codeWrapper code>span{-webkit-user-select:auto!important;-moz-user-select:auto!important;user-select:auto!important}.codeWrapper code{width:100%}.codeWrapper code span{font-style:normal!important}.codeWrapper code span{padding:0!important}.hideScroll{-ms-overflow-style:none;scrollbar-width:none}.hideScroll::-webkit-scrollbar{display:none}.scrollbar-subtle{--scrollbar-thumb: oklch(var(--foreground-color) / .15)}.scrollbar-subtle{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-subtle::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-subtle::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-subtle::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-subtle::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-subtle::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-subtle::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-subtle::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-subtle::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-subtle::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-subtle::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-subtle{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-subtle::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-subtle{--scrollbar-track: transparent}.tabler-icon{stroke-width:1.75}.citation-nbsp:before{content:" "}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}}html[data-color-scheme=dark] .dark\:prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.\*\:size-full>*{width:100%;height:100%}.\*\:w-20>*{width:5rem}.\*\:w-full>*{width:100%}.marker\:text-quiet *::marker{color:oklch(var(--foreground-quiet-color))}.marker\:text-quiet::marker{color:oklch(var(--foreground-quiet-color))}.selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/30 *::-moz-selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/30 *::selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/50 *::-moz-selection{background-color:oklch(var(--super-color) / .5)}.selection\:bg-super\/50 *::selection{background-color:oklch(var(--super-color) / .5)}.selection\:text-foreground *::-moz-selection{color:oklch(var(--foreground-color))}.selection\:text-foreground *::selection{color:oklch(var(--foreground-color))}.selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}.selection\:bg-super\/30::-moz-selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/30::selection{background-color:oklch(var(--super-color) / .3)}.selection\:bg-super\/50::-moz-selection{background-color:oklch(var(--super-color) / .5)}.selection\:bg-super\/50::selection{background-color:oklch(var(--super-color) / .5)}.selection\:text-foreground::-moz-selection{color:oklch(var(--foreground-color))}.selection\:text-foreground::selection{color:oklch(var(--foreground-color))}.selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.placeholder\:select-none::-moz-placeholder{-moz-user-select:none;-webkit-user-select:none;user-select:none}.placeholder\:select-none::placeholder{-webkit-user-select:none;-moz-user-select:none;user-select:none}.placeholder\:text-\[2\.4rem\]::-moz-placeholder{font-size:2.4rem}.placeholder\:text-\[2\.4rem\]::placeholder{font-size:2.4rem}.placeholder\:text-base::-moz-placeholder{font-size:1rem;line-height:1.5rem}.placeholder\:text-base::placeholder{font-size:1rem;line-height:1.5rem}.placeholder\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-xs::placeholder{font-size:.75rem;line-height:1rem}.placeholder\:\!text-quietest::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder\:\!text-quietest::placeholder{color:oklch(var(--foreground-quietest-color))!important}.placeholder\:text-quiet::-moz-placeholder{color:oklch(var(--foreground-quiet-color))}.placeholder\:text-quiet::placeholder{color:oklch(var(--foreground-quiet-color))}.placeholder\:text-quieter::-moz-placeholder{color:oklch(var(--foreground-quieter-color))}.placeholder\:text-quieter::placeholder{color:oklch(var(--foreground-quieter-color))}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:inset-0:before{content:var(--tw-content);inset:0}.before\:inset-x-\[-10px\]:before{content:var(--tw-content);left:-10px;right:-10px}.before\:inset-y-0:before{content:var(--tw-content);top:0;bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:left-1\/2:before{content:var(--tw-content);left:50%}.before\:left-\[50\%\]:before{content:var(--tw-content);left:50%}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-1\/2:before{content:var(--tw-content);top:50%}.before\:top-\[50\%\]:before{content:var(--tw-content);top:50%}.before\:top-\[6px\]:before{content:var(--tw-content);top:6px}.before\:size-1:before{content:var(--tw-content);width:.25rem;height:.25rem}.before\:size-1\.5:before{content:var(--tw-content);width:.375rem;height:.375rem}.before\:size-full:before{content:var(--tw-content);width:100%;height:100%}.before\:h-\[100\%\]:before{content:var(--tw-content);height:100%}.before\:min-h-\[10px\]:before{content:var(--tw-content);min-height:10px}.before\:w-\[100\%\]:before{content:var(--tw-content);width:100%}.before\:min-w-\[10px\]:before{content:var(--tw-content);min-width:10px}.before\:-translate-x-1\/2:before{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))}.before\:-translate-y-1\/2:before{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))}.before\:translate-x-\[-50\%\]:before{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))}.before\:translate-y-\[-50\%\]:before{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))}.before\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\:rounded-md:before{content:var(--tw-content);border-radius:.375rem}.before\:border:before{content:var(--tw-content);border-width:1px}.before\:border-r:before{content:var(--tw-content);border-right-width:1px}.before\:border-dashed:before{content:var(--tw-content);border-style:dashed}.before\:border-\[rgba\(0\,0\,0\,0\.1\)\]:before{content:var(--tw-content);border-color:#0000001a}.before\:border-subtlest:before{content:var(--tw-content);border-color:oklch(var(--foreground-subtlest-color))}.before\:bg-\[\#105C67\]:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(16 92 103 / var(--tw-bg-opacity))}.before\:bg-base:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}.before\:opacity-0:before{content:var(--tw-content);opacity:0}.before\:opacity-20:before{content:var(--tw-content);opacity:.2}.before\:ring-4:before{content:var(--tw-content);--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(4px + 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)}.before\:ring-\[1\.5px\]:before{content:var(--tw-content);--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(1.5px + 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)}.before\:ring-super\/10:before{content:var(--tw-content);--tw-ring-color: oklch(var(--super-color) / .1)}.before\:ring-super\/50:before{content:var(--tw-content);--tw-ring-color: oklch(var(--super-color) / .5)}.before\:transition-opacity:before{content:var(--tw-content);transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.before\:duration-150:before{content:var(--tw-content);transition-duration:.15s}.before\:content-\[\'\'\]:before{--tw-content: "";content:var(--tw-content)}.before\:duration-150:before{content:var(--tw-content);animation-duration:.15s}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-0:after{content:var(--tw-content);inset:0}.after\:inset-\[-1px\]:after{content:var(--tw-content);inset:-1px}.after\:left-two:after{content:var(--tw-content);left:2px}.after\:top-\[24px\]:after{content:var(--tw-content);top:24px}.after\:z-\[1\]:after{content:var(--tw-content);z-index:1}.after\:clear-both:after{content:var(--tw-content);clear:both}.after\:block:after{content:var(--tw-content);display:block}.after\:h-full:after{content:var(--tw-content);height:100%}.after\:w-two:after{content:var(--tw-content);width:2px}.after\:-translate-y-half:after{content:var(--tw-content);--tw-translate-y: -.5px;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))}.after\:rounded:after{content:var(--tw-content);border-radius:.25rem}.after\:rounded-inherit:after{content:var(--tw-content);border-radius:inherit}.after\:rounded-lg:after{content:var(--tw-content);border-radius:.5rem}.after\:rounded-md:after{content:var(--tw-content);border-radius:.375rem}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-\[rgba\(0\,0\,0\,0\.08\)\]:after{content:var(--tw-content);border-color:#00000014}.after\:border-black\/10:after{content:var(--tw-content);border-color:#0000001a}.after\:border-black\/5:after{content:var(--tw-content);border-color:#0000000d}.after\:border-foreground:after{content:var(--tw-content);border-color:oklch(var(--foreground-color))}.after\:border-super\/30:after{content:var(--tw-content);border-color:oklch(var(--super-color) / .3)}.after\:bg-super:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.after\:opacity-50:after{content:var(--tw-content);opacity:.5}.after\:shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;--tw-shadow-colored: inset 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)}.after\:ring-1:after{content:var(--tw-content);--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)}.after\:ring-inset:after{content:var(--tw-content);--tw-ring-inset: inset}.after\:ring-subtler:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtler-color))}.after\:ring-subtlest:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtlest-color))}.after\:ring-opacity-50:after{content:var(--tw-content);--tw-ring-opacity: .5}.after\:content-\[\"\"\]:after{--tw-content: "";content:var(--tw-content)}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.after\:\[content\:counters\(list\,\"\.\"\)\]:after{content:counters(list,".")}.first\:-mt-sm:first-child{margin-top:calc(var(--size-sm) * -1)}.first\:ml-0:first-child{margin-left:0}.first\:mt-0:first-child{margin-top:0}.first\:mt-1:first-child{margin-top:.25rem}.first\:mt-xs:first-child{margin-top:var(--size-xs)}.first\:hidden:first-child{display:none}.first\:border-y:first-child{border-top-width:1px;border-bottom-width:1px}.first\:border-b-0:first-child{border-bottom-width:0px}.first\:border-solid:first-child{border-style:solid}.first\:pl-0:first-child{padding-left:0}.first\:pl-md:first-child{padding-left:var(--size-md)}.first\:pt-0:first-child{padding-top:0}.first\:pt-md:first-child{padding-top:var(--size-md)}.last\:-mr-two:last-child{margin-right:-2px}.last\:mb-0:last-child{margin-bottom:0}.last\:mr-0:last-child{margin-right:0}.last\:hidden:last-child{display:none}.last\:border-0:last-child{border-width:0px}.last\:border-b:last-child{border-bottom-width:1px}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:border-r-0:last-child{border-right-width:0px}.last\:border-none:last-child{border-style:none}.last\:border-b-subtlest:last-child{border-bottom-color:oklch(var(--foreground-subtlest-color))}.last\:px-sm:last-child{padding-left:var(--size-sm);padding-right:var(--size-sm)}.last\:pb-0:last-child{padding-bottom:0}.last\:pr-0:last-child{padding-right:0}.last\:pr-md:last-child{padding-right:var(--size-md)}.last\:pr-xs:last-child{padding-right:var(--size-xs)}.last\:before\:hidden:last-child:before{content:var(--tw-content);display:none}.last\:after\:\[background\:linear-gradient\(0deg\,rgba\(31\,184\,205\,0\)_0\%\,\#105C67_100\%\)\]:last-child:after{content:var(--tw-content);background:linear-gradient(0deg,#1fb8cd00,#105c67)}.odd\:bg-subtler:nth-child(odd){background-color:oklch(var(--background-subtler-color))}.even\:bg-subtlest:nth-child(2n){background-color:oklch(var(--background-subtlest-color))}.empty\:hidden:empty{display:none}.empty\:bg-subtler:empty{background-color:oklch(var(--background-subtler-color))}.focus-within\:pointer-events-auto:focus-within{pointer-events:auto}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:\!border-subtler:focus-within{border-color:oklch(var(--foreground-subtler-color))!important}.focus-within\:\!border-super:focus-within{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.focus-within\:border-subtler:focus-within{border-color:oklch(var(--foreground-subtler-color))}.focus-within\:border-super:focus-within{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.focus-within\:opacity-100:focus-within{opacity:1}.focus-within\:\!ring-transparent:focus-within{--tw-ring-color: transparent !important}.group\/column:first-child .group-first\/column\:hidden,.group:first-child .group-first\:hidden{display:none}.group:first-child .group-first\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.group\/singleTeamGroup:first-child .group-first\/singleTeamGroup\:pt-0{padding-top:0}.group\/goal:first-child .group-first\/goal\:opacity-0{opacity:0}.group:last-child .group-last\:-mb-sm{margin-bottom:calc(var(--size-sm) * -1)}.group\/cell:last-child .group-last\/cell\:hidden{display:none}.group\/column:last-child .group-last\/column\:hidden{display:none}.group\/li:last-child .group-last\/li\:hidden{display:none}.group:last-child .group-last\:rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.group:last-child .group-last\:rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.group:last-child .group-last\:border-b-0{border-bottom-width:0px}.group\/goal:last-child .group-last\/goal\:pb-0{padding-bottom:0}.group:last-child .group-last\:pb-0{padding-bottom:0}.group\/goal:last-child .group-last\/goal\:opacity-0{opacity:0}.group\/singleTeamGroup:last-child .group-last\/singleTeamGroup\:last\:border-b-0:last-child{border-bottom-width:0px}.group\/table:last-child .group-last\/table\:last\:border-b-0:last-child{border-bottom-width:0px}.group\/goal:only-child .group-only\/goal\:opacity-0{opacity:0}.group:nth-child(odd) .group-odd\:border-r{border-right-width:1px}.group\/matchup:nth-child(2n) .group-even\/matchup\:bottom-1\/2{bottom:50%}.group\/matchup:nth-child(2n) .group-even\/matchup\:top-auto{top:auto}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-bl-md{border-bottom-left-radius:.375rem}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-br-md{border-bottom-right-radius:.375rem}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-tl-none{border-top-left-radius:0}.group\/matchup:nth-child(2n) .group-even\/matchup\:rounded-tr-none{border-top-right-radius:0}.group\/matchup:nth-child(2n) .group-even\/matchup\:border-b-2{border-bottom-width:2px}.group\/matchup:nth-child(2n) .group-even\/matchup\:border-t-0{border-top-width:0px}.group:nth-child(2n) .group-even\:border-r-0{border-right-width:0px}.group:hover .group-hover\:pointer-events-auto{pointer-events:auto}.group:hover .group-hover\:-ml-sm{margin-left:calc(var(--size-sm) * -1)}.group:hover .group-hover\:-ml-xs{margin-left:calc(var(--size-xs) * -1)}.group:hover .group-hover\:block{display:block}.group\/step-card:hover .group-hover\/step-card\:inline-flex{display:inline-flex}.group:hover .group-hover\:shrink-0{flex-shrink:0}.group:hover .group-hover\:basis-auto{flex-basis:auto}.group\/source:hover .group-hover\/source\:translate-x-\[12px\]{--tw-translate-x: 12px;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\/source:hover .group-hover\/source\:translate-x-\[6px\]{--tw-translate-x: 6px;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\/source:hover .group-hover\/source\:translate-x-\[8px\]{--tw-translate-x: 8px;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:hover .group-hover\:-translate-y-1{--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))}.group:hover .group-hover\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;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:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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:hover .group-hover\:scale-\[1\.02\]{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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:hover .group-hover\:scale-\[unset\]{--tw-scale-x: unset;--tw-scale-y: unset;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:hover .group-hover\:scale-x-\[250\%\]{--tw-scale-x: 250%;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\/language-learning:hover .group-hover\/language-learning\:border-foreground{border-color:oklch(var(--foreground-color))}.group:hover .group-hover\:\!border-subtle{border-color:oklch(var(--foreground-subtle-color))!important}.group:hover .group-hover\:\!border-super{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.group\/tab:hover .group-hover\/tab\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.group:hover .group-hover\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.group:hover .group-hover\:\!bg-transparent{background-color:transparent!important}.group:hover .group-hover\:bg-\[var\(--dot-color\)\]{background-color:var(--dot-color)}.group:hover .group-hover\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.group:hover .group-hover\:bg-subtler{background-color:oklch(var(--background-subtler-color))}.group:hover .group-hover\:bg-super{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.group:hover .group-hover\:bg-transparent{background-color:transparent}.group:hover .group-hover\:fill-super{fill:oklch(var(--super-color) / 1)}.group:hover .group-hover\:stroke-super{stroke:oklch(var(--super-color) / 1)}.group\/link:hover .group-hover\/link\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group\/post:hover .group-hover\/post\:text-foreground{color:oklch(var(--foreground-color))}.group\/row:hover .group-hover\/row\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group\/segmented-control:hover .group-hover\/segmented-control\:text-foreground{color:oklch(var(--foreground-color))}.group\/step-card:hover .group-hover\/step-card\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group:hover .group-hover\:\!text-foreground{color:oklch(var(--foreground-color))!important}.group:hover .group-hover\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group:hover .group-hover\:text-foreground{color:oklch(var(--foreground-color))}.group:hover .group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}.group:hover .group-hover\:text-quiet{color:oklch(var(--foreground-quiet-color))}.group:hover .group-hover\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group\/link:hover .group-hover\/link\:underline,.group\/source:hover .group-hover\/source\:underline,.group:hover .group-hover\:underline{text-decoration-line:underline}.group:hover .group-hover\:decoration-\[var\(--mode-color\)\]{text-decoration-color:var(--mode-color)}.group:hover .group-hover\:decoration-transparent{text-decoration-color:transparent}.group\/button:hover .group-hover\/button\:opacity-100,.group\/card:hover .group-hover\/card\:opacity-100,.group\/header:hover .group-hover\/header\:opacity-100,.group\/image:hover .group-hover\/image\:opacity-100{opacity:1}.group\/link:hover .group-hover\/link\:opacity-75{opacity:.75}.group\/notification-list-item:hover .group-hover\/notification-list-item\:opacity-0{opacity:0}.group\/notification-list-item:hover .group-hover\/notification-list-item\:opacity-100,.group\/section:hover .group-hover\/section\:opacity-100,.group\/sidebar-menu-header:hover .group-hover\/sidebar-menu-header\:opacity-100,.group\/step-card:hover .group-hover\/step-card\:opacity-100,.group\/tab:hover .group-hover\/tab\:opacity-100{opacity:1}.group:hover .group-hover\:\!opacity-0{opacity:0!important}.group:hover .group-hover\:opacity-0{opacity:0}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-15{opacity:.15}.group:hover .group-hover\:opacity-50{opacity:.5}.group:hover .group-hover\:opacity-60{opacity:.6}.group:hover .group-hover\:opacity-80{opacity:.8}.group:hover .group-hover\:opacity-90{opacity:.9}.group:hover .group-hover\: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)}.group:hover .group-hover\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}.group:hover .group-hover\:grayscale-0{--tw-grayscale: grayscale(0);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)}.group:hover .group-hover\:delay-300{transition-delay:.3s}.group:hover .group-hover\:mask-fade-r-\[84px\,42px\]{-webkit-mask-image:linear-gradient(90deg,black 0,black calc(100% - 84px),transparent calc(100% - 42px),transparent 100%);mask-image:linear-gradient(90deg,black 0,black calc(100% - 84px),transparent calc(100% - 42px),transparent 100%)}.group:hover .group-hover\:delay-300{animation-delay:.3s}:is(.group:hover .group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}.group\/segmented-control:focus-visible .group-focus-visible\/segmented-control\:border-dashed{border-style:dashed}.group:active .group-active\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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:active .group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}.group\/language-learning:active .group-active\/language-learning\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}.group:active .group-active\:opacity-50{opacity:.5}.group:active .group-active\:opacity-70{opacity:.7}.group:nth-child(2n):nth-last-child(-n+3)~a .group-\[\&\:nth-child\(2n\)\:nth-last-child\(-n\+3\)\~a\]\:border-b-0{border-bottom-width:0px}.group:nth-child(3n):nth-last-child(-n+4)~a .group-\[\&\:nth-child\(3n\)\:nth-last-child\(-n\+4\)\~a\]\:border-b-0{border-bottom-width:0px}.group:nth-child(3n) .group-\[\&\:nth-child\(3n\)\]\:border-r-0{border-right-width:0px}.has-\[a\:hover\]\:bg-transparent:has(a:hover){background-color:transparent}.aria-selected\:bg-subtler[aria-selected=true]{background-color:oklch(var(--background-subtler-color))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[placement\=bottom-end\]\:origin-top-right[data-placement=bottom-end]{transform-origin:top right}.data-\[placement\=bottom-start\]\:origin-top-left[data-placement=bottom-start]{transform-origin:top left}.data-\[placement\=top-end\]\:origin-bottom-right[data-placement=top-end]{transform-origin:bottom right}.data-\[placement\=top-start\]\:origin-bottom-left[data-placement=top-start]{transform-origin:bottom left}.data-\[state\=checked\]\:translate-x-\[10px\][data-state=checked]{--tw-translate-x: 10px;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-\[14px\][data-state=checked]{--tw-translate-x: 14px;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-\[18px\][data-state=checked]{--tw-translate-x: 18px;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 fadeOut{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fadeOut[data-state=closed]{animation:fadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes scaleAndFadeOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.97)}}.data-\[state\=closed\]\:animate-scaleAndFadeOut[data-state=closed]{animation:scaleAndFadeOut .15s cubic-bezier(.7,0,.84,0) forwards}@keyframes slideDownAndFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(3px)}}.data-\[state\=closed\]\:animate-slideDownAndFadeOut[data-state=closed]{animation:slideDownAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideLeft{0%{transform:translateZ(0) translate(0)}to{transform:translateZ(0) translate(-100%)}}.data-\[state\=closed\]\:animate-slideLeft[data-state=closed]{animation:slideLeft .2s cubic-bezier(.25,.1,.25,1) forwards}@keyframes slideLeftAndFadeOut{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-3px)}}.data-\[state\=closed\]\:animate-slideLeftAndFadeOut[data-state=closed]{animation:slideLeftAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideRightAndFadeOut{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(3px)}}.data-\[state\=closed\]\:animate-slideRightAndFadeOut[data-state=closed]{animation:slideRightAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes slideUpAndFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-3px)}}.data-\[state\=closed\]\:animate-slideUpAndFadeOut[data-state=closed]{animation:slideUpAndFadeOut .2s cubic-bezier(.16,1,.3,1) forwards}.data-\[state\=delayed-open\]\:animate-slideDownAndFadeIn[data-state=delayed-open]{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideLeftAndFadeIn[data-state=delayed-open]{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideRightAndFadeIn[data-state=delayed-open]{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=delayed-open\]\:animate-slideUpAndFadeIn[data-state=delayed-open]{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fadeIn[data-state=open]{animation:fadeIn .2s cubic-bezier(.16,1,.3,1) forwards}@keyframes scaleAndFadeIn{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.data-\[state\=open\]\:animate-scaleAndFadeIn[data-state=open]{animation:scaleAndFadeIn .15s cubic-bezier(.16,1,.3,1)}@keyframes slideDownAndFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.data-\[state\=open\]\:animate-slideDownAndFadeIn[data-state=open]{animation:slideDownAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideLeftAndFadeIn{0%{opacity:0;transform:translate(3px)}to{opacity:1;transform:translate(0)}}.data-\[state\=open\]\:animate-slideLeftAndFadeIn[data-state=open]{animation:slideLeftAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideRight{0%{transform:translateZ(0) translate(-100%)}to{transform:translateZ(0) translate(0)}}.data-\[state\=open\]\:animate-slideRight[data-state=open]{animation:slideRight .2s cubic-bezier(.25,.1,.25,1) forwards}@keyframes slideRightAndFadeIn{0%{opacity:0;transform:translate(-3px)}to{opacity:1;transform:translate(0)}}.data-\[state\=open\]\:animate-slideRightAndFadeIn[data-state=open]{animation:slideRightAndFadeIn .2s cubic-bezier(.16,1,.3,1)}@keyframes slideUpAndFadeIn{0%{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}.data-\[state\=open\]\:animate-slideUpAndFadeIn[data-state=open]{animation:slideUpAndFadeIn .2s cubic-bezier(.16,1,.3,1)}.data-\[state\=closed\]\:border-subtler[data-state=closed]{border-color:oklch(var(--foreground-subtler-color))}.data-\[state\=open\]\:border-subtle[data-state=open]{border-color:oklch(var(--foreground-subtle-color))}.data-\[state\=open\]\:border-super[data-state=open]{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.data-\[focused\=self\]\:bg-subtler[data-focused=self],.data-\[highlighted\]\:bg-subtler[data-highlighted]{background-color:oklch(var(--background-subtler-color))}.data-\[state\=open\]\:bg-subtle[data-state=open]{background-color:oklch(var(--background-subtle-color))}.data-\[state\=open\]\:bg-subtler[data-state=open]{background-color:oklch(var(--background-subtler-color))}.data-\[state\=on\]\:text-foreground[data-state=on],.data-\[state\=open\]\:text-foreground[data-state=open]{color:oklch(var(--foreground-color))}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=inactive\]\:opacity-80[data-state=inactive],.data-\[state\=open\]\:opacity-80[data-state=open]{opacity:.8}.data-\[state\=visible\]\:opacity-100[data-state=visible]{opacity:1}.group\/tooltip-content[data-side=bottom] .group-data-\[side\=\"bottom\"\]\/tooltip-content\:top-0{top:0}.group\/tooltip-content[data-side=top] .group-data-\[side\=\"top\"\]\/tooltip-content\:bottom-0{bottom:0}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}.group[data-focused=other] .group-data-\[focused\=other\]\:opacity-0{opacity:0}.group[data-focused=self] .group-data-\[focused\=self\]\:opacity-100{opacity:1}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:border-l-2:first-child{border-left-width:2px}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:border-l-super:first-child{--tw-border-opacity: 1;border-left-color:oklch(var(--super-color) / var(--tw-border-opacity))}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:first\:pl-xs:first-child{padding-left:var(--size-xs)}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:last\:border-r-2:last-child{border-right-width:2px}.group[data-selected=true] .group-data-\[selected\=\"true\"\]\:last\:pr-xs:last-child{padding-right:var(--size-xs)}[data-erp=tab] .erp-tab\:top-headerHeight{top:var(--header-height)}[data-erp=tab] .erp-tab\:gap-0{gap:0px}[data-erp=tab] .erp-tab\:rounded-none{border-radius:0}[data-erp=tab] .erp-tab\:p-0{padding:0}[data-erp=sidecar] .erp-sidecar\:fixed{position:fixed}[data-erp=sidecar] .erp-sidecar\:top-\[114px\]{top:114px}[data-erp=sidecar] .erp-sidecar\:h-fit{height:-moz-fit-content;height:fit-content}[data-erp=sidecar] .erp-sidecar\:min-h-\[var\(--sidecar-content-height\)\]{min-height:var(--sidecar-content-height)}[data-erp=sidecar] .erp-sidecar\:w-full{width:100%}[data-erp=sidecar] .erp-sidecar\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}[data-erp=sidecar] .erp-sidecar\:pb-0{padding-bottom:0}[data-erp=sidecar] .erp-sidecar\:pt-0{padding-top:0}[data-erp=mobile-sidecar] .erp-mobile-sidecar\:min-h-\[var\(--mobile-sidecar-content-height\)\]{min-height:var(--mobile-sidecar-content-height)}[data-erp=mobile-sidecar] .erp-mobile-sidecar\:pt-0{padding-top:0}@media (pointer: coarse){.pointer-coarse\:opacity-100{opacity:1}}.prose-p\:my-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-p\:mb-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:.5rem}.prose-p\:pt-0 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:0}.prose-strong\:font-medium :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:500;font-weight:var(--font-medium)}@container (min-width: 20rem){.\@xs\:ml-7{margin-left:1.75rem}.\@xs\:size-4{width:1rem;height:1rem}.\@xs\:w-20{width:5rem}.\@xs\:flex-row{flex-direction:row}.\@xs\:gap-3{gap:.75rem}.\@xs\:gap-sm{gap:var(--size-sm)}.\@xs\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.\@xs\:pb-md{padding-bottom:var(--size-md)}.\@xs\:pt-3{padding-top:.75rem}.\@xs\:text-sm{font-size:.875rem;line-height:1.25rem}}@container (min-width: 24rem){.\@sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container banner (min-width: 28rem){.\@md\/banner\:ml-auto{margin-left:auto}.\@md\/banner\:mr-sm{margin-right:var(--size-sm)}.\@md\/banner\:w-auto{width:auto}.\@md\/banner\:flex-\[1_1_60\%\]{flex:1 1 60%}.\@md\/banner\:flex-row{flex-direction:row}.\@md\/banner\:flex-row-reverse{flex-direction:row-reverse}.\@md\/banner\:flex-wrap{flex-wrap:wrap}.\@md\/banner\:items-center{align-items:center}.\@md\/banner\:justify-end{justify-content:flex-end}.\@md\/banner\:gap-md{gap:var(--size-md)}.\@md\/banner\:gap-sm{gap:var(--size-sm)}.\@md\/banner\:py-3{padding-top:.75rem;padding-bottom:.75rem}}@container (min-width: 28rem){.\@md\:w-\[570px\]{width:570px}}@container (min-width: 32rem){.\@lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width: 36px){.\@\[36px\]\:block{display:block}}@container (min-width: 42rem){.\@2xl\:flex-\[2\]{flex:2}.\@2xl\:flex-\[3\]{flex:3}.\@2xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\@2xl\:flex-row{flex-direction:row}.\@2xl\:gap-sm{gap:var(--size-sm)}}@container (min-width: 28rem){@container (min-width: 1458px){.\@md\:\@\[1458px\]\:w-full{width:100%}}}@container (min-width: 370px){.\@\[370px\]\:aspect-\[1\.38\]{aspect-ratio:1.38}.\@\[370px\]\:h-auto{height:auto}.\@\[370px\]\:w-\[var\(--image-width-large\)\]{width:var(--image-width-large)}}@container (min-width: 420px){.\@\[420px\]\:ml-auto{margin-left:auto}.\@\[420px\]\:block{display:block}.\@\[420px\]\:hidden{display:none}.\@\[420px\]\:h-full{height:100%}.\@\[420px\]\:w-\[128px\]{width:128px}.\@\[420px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\@\[420px\]\:flex-row{flex-direction:row}.\@\[420px\]\:items-end{align-items:flex-end}.\@\[420px\]\:gap-md{gap:var(--size-md)}}@container (min-width: 480px){.\@\[480px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@container (min-width: 600px){.\@\[600px\]\:col-span-1{grid-column:span 1 / span 1}.\@\[600px\]\:h-full{height:100%}.\@\[600px\]\:grid-cols-\[17\%_46\%_1fr\]{grid-template-columns:17% 46% 1fr}}@container (min-width: 640px){.\@\[640px\]\:col-span-2{grid-column:span 2 / span 2}.\@\[640px\]\:block{display:block}.\@\[640px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container (min-width: 700px){.\@\[700px\]\:inset-y-0{top:0;bottom:0}.\@\[700px\]\:left-0{left:0}.\@\[700px\]\:right-auto{right:auto}.\@\[700px\]\:w-\[var\(--card-width\)\]{width:var(--card-width)}.\@\[700px\]\:w-full{width:100%}.\@\[700px\]\:grid-cols-\[120px_320px_1fr\]{grid-template-columns:120px 320px 1fr}.\@\[700px\]\:flex-col{flex-direction:column}.\@\[700px\]\:overflow-y-auto{overflow-y:auto}.\@\[700px\]\:overflow-x-visible{overflow-x:visible}.\@\[700px\]\:p-2\.5{padding:.625rem}}@container (min-width: 900px){.\@\[900px\]\:block{display:block}.\@\[900px\]\:hidden{display:none}.\@\[900px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@container main (min-width: 1100px){.\@\[1100px\]\/main\:max-w-\[80px\]{max-width:80px}}@container main (min-width: 1200px){.\@\[1200px\]\/main\:max-w-\[160px\]{max-width:160px}}.hover\:-translate-x-1:hover{--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))}.hover\:-translate-y-1:hover{--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))}.hover\:translate-y-0:hover{--tw-translate-y: 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))}.hover\:translate-y-0\.5:hover{--tw-translate-y: .125rem;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\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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\:scale-\[1\.01\]:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;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\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;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\:transform:hover{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\:cursor-pointer:hover{cursor:pointer}.hover\:rounded-lg:hover{border-radius:.5rem}.hover\:\!border-none:hover{border-style:none!important}.hover\:\!border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))!important}.hover\:\!border-subtlest:hover{border-color:oklch(var(--foreground-subtlest-color))!important}.hover\:\!border-transparent:hover{border-color:transparent!important}.hover\:border-caution\/20:hover{border-color:oklch(var(--caution-color) / .2)}.hover\:border-offset:hover{border-color:oklch(var(--offset-color))}.hover\:border-subtle:hover{border-color:oklch(var(--foreground-subtle-color))}.hover\:border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))}.hover\:border-super:hover{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.hover\:border-super\/30:hover{border-color:oklch(var(--super-color) / .3)}.hover\:border-super\/50:hover{border-color:oklch(var(--super-color) / .5)}.hover\:border-super\/75:hover{border-color:oklch(var(--super-color) / .75)}.hover\:\!bg-black\/80:hover{background-color:#000c!important}.hover\:\!bg-black\/90:hover{background-color:#000000e6!important}.hover\:\!bg-caution:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--caution-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-inverse\/5:hover{background-color:oklch(var(--background-inverse-color) / .05)!important}.hover\:\!bg-max:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--max-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-subtler:hover{background-color:oklch(var(--background-subtler-color))!important}.hover\:\!bg-super:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.hover\:\!bg-super\/10:hover{background-color:oklch(var(--super-color) / .1)!important}.hover\:\!bg-transparent:hover{background-color:transparent!important}.hover\:\!bg-white\/10:hover{background-color:#ffffff1a!important}.hover\:\!bg-white\/90:hover{background-color:#ffffffe6!important}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-caution\/30:hover{background-color:oklch(var(--caution-color) / .3)}.hover\:bg-caution\/5:hover{background-color:oklch(var(--caution-color) / .05)}.hover\:bg-negative\/20:hover{background-color:oklch(var(--negative-color) / .2)}.hover\:bg-offset:hover{background-color:oklch(var(--offset-color))}.hover\:bg-positive\/20:hover{background-color:oklch(var(--positive-color) / .2)}.hover\:bg-raised:hover{background-color:oklch(var(--background-raised-color))}.hover\:bg-raisedOffset:hover{background-color:oklch(var(--raised-offset-color))}.hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}.hover\:bg-subtler:hover{background-color:oklch(var(--background-subtler-color))}.hover\:bg-subtlest:hover{background-color:oklch(var(--background-subtlest-color))}.hover\:bg-super:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.hover\:bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)}.hover\:bg-super\/90:hover{background-color:oklch(var(--super-color) / .9)}.hover\:bg-superBG:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.hover\:bg-gradient-to-b:hover{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.hover\:from-\[oklch\(var\(--hydra-450\)\)\]:hover{--tw-gradient-from: oklch(var(--hydra-450)) 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)}.hover\:to-\[oklch\(var\(--hydra-450\)\/0\.2\)\]:hover{--tw-gradient-to: oklch(var(--hydra-450)/.2) var(--tw-gradient-to-position)}.hover\:\!text-quiet:hover{color:oklch(var(--foreground-quiet-color))!important}.hover\:\!text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:\!text-white\/80:hover{color:#fffc!important}.hover\:text-caution:hover{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}.hover\:text-foreground:hover{color:oklch(var(--foreground-color))}.hover\:text-negative:hover{--tw-text-opacity: 1;color:oklch(var(--negative-color) / var(--tw-text-opacity))}.hover\:text-positive:hover{--tw-text-opacity: 1;color:oklch(var(--positive-color) / var(--tw-text-opacity))}.hover\:text-quiet:hover{color:oklch(var(--foreground-quiet-color))}.hover\:text-super:hover{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:decoration-super:hover{text-decoration-color:oklch(var(--super-color) / 1)}.hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}.hover\:decoration-transparent:hover{text-decoration-color:transparent}.hover\:underline-offset-\[7px\]:hover{text-underline-offset:7px}.hover\:\!opacity-100:hover{opacity:1!important}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-40:hover{opacity:.4}.hover\:opacity-50:hover{opacity:.5}.hover\:opacity-60:hover{opacity:.6}.hover\:opacity-70:hover{opacity:.7}.hover\:opacity-75:hover{opacity:.75}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-85:hover{opacity:.85}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow:hover{--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)}.hover\:shadow-2xl:hover{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px 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-sm:hover{--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)}.hover\:shadow-subtle:hover{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.hover\:\!outline-none:hover{outline:2px solid transparent!important;outline-offset:2px!important}.hover\:\!ring-0:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.hover\:ring-1:hover{--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)}.hover\:ring-2:hover{--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)}.hover\:\!ring-transparent:hover{--tw-ring-color: transparent !important}.hover\:ring-subtle:hover{--tw-ring-color: oklch(var(--foreground-subtle-color))}.hover\:ring-super:hover{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.hover\:\!transition-none:hover{transition-property:none!important}.hover\:transition-none:hover{transition-property:none}.hover\:after\:ring-subtler:hover:after{content:var(--tw-content);--tw-ring-color: oklch(var(--foreground-subtler-color))}.data-\[state\=open\]\:hover\:border-super:hover[data-state=open]{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.hover\:data-\[focused\=other\]\:bg-raised[data-focused=other]:hover{background-color:oklch(var(--background-raised-color))}.data-\[state\=inactive\]\:hover\:opacity-100:hover[data-state=inactive]{opacity:1}.focus\:\!border-none:focus{border-style:none!important}.focus\:\!border-super:focus{--tw-border-opacity: 1 !important;border-color:oklch(var(--super-color) / var(--tw-border-opacity))!important}.focus\:\!border-transparent:focus{border-color:transparent!important}.focus\:border-subtle:focus{border-color:oklch(var(--foreground-subtle-color))}.focus\:border-subtler:focus{border-color:oklch(var(--foreground-subtler-color))}.focus\:border-super:focus{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}.focus\:border-transparent:focus{border-color:transparent}.focus\:text-super:focus{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.focus\:underline:focus{text-decoration-line:underline}.focus\:\!outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:\!ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.focus\:ring-0: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(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)}.focus\: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)}.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-transparent:focus{--tw-ring-color: transparent !important}.focus\:ring-subtler:focus{--tw-ring-color: oklch(var(--foreground-subtler-color))}.focus\:ring-super:focus{--tw-ring-opacity: 1;--tw-ring-color: oklch(var(--super-color) / var(--tw-ring-opacity))}.focus\:ring-transparent:focus{--tw-ring-color: transparent}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:rounded-lg:focus-visible{border-radius:.5rem}.focus-visible\:\!border-subtlest:focus-visible{border-color:oklch(var(--foreground-subtlest-color))!important}.focus-visible\:\!bg-transparent:focus-visible{background-color:transparent!important}.focus-visible\:bg-subtle:focus-visible{background-color:oklch(var(--background-subtle-color))}.focus-visible\:bg-subtler:focus-visible{background-color:oklch(var(--background-subtler-color))}.focus-visible\:bg-transparent:focus-visible{background-color:transparent}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-0:focus-visible{outline-offset:0px}.focus-visible\:outline-super:focus-visible{outline-color:oklch(var(--super-color) / 1)}.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-super\/50:focus-visible{--tw-ring-color: oklch(var(--super-color) / .5)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-\[6px\]:focus-visible{--tw-ring-offset-width: 6px}.focus-visible\:ring-offset-inverse:focus-visible{--tw-ring-offset-color: oklch(var(--foreground-inverse-color))}.focus-visible\:before\:opacity-100:focus-visible:before{content:var(--tw-content);opacity:1}.active\:\!scale-100:active{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.active\:scale-100:active{--tw-scale-x: 1;--tw-scale-y: 1;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))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\:scale-\[\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;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))}.active\:scale-\[0\.95\]:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.active\:scale-\[0\.96\]:active{--tw-scale-x: .96;--tw-scale-y: .96;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))}.active\:scale-\[0\.97\]:active{--tw-scale-x: .97;--tw-scale-y: .97;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))}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;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))}.active\:scale-\[0\.99\]:active{--tw-scale-x: .99;--tw-scale-y: .99;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))}.active\:transform-none:active{transform:none}.active\:\!cursor-grabbing:active{cursor:grabbing!important}.active\:cursor-grabbing:active{cursor:grabbing}.active\:\!bg-subtler:active{background-color:oklch(var(--background-subtler-color))!important}.active\:bg-subtler:active{background-color:oklch(var(--background-subtler-color))}.active\:underline:active{text-decoration-line:underline}.active\:\!opacity-\[50\%\]:active{opacity:50%!important}.active\:opacity-75:active{opacity:.75}.active\:duration-150:active,.active\:duration-normal:active{transition-duration:.15s}.active\:ease-outExpo:active{transition-timing-function:cubic-bezier(.16,1,.3,1)}.active\:duration-150:active,.active\:duration-normal:active{animation-duration:.15s}.active\:ease-outExpo:active{animation-timing-function:cubic-bezier(.16,1,.3,1)}.disabled\:\!text-inverse:disabled{color:oklch(var(--foreground-inverse-color))!important}:is(.disabled\:\!text-inverse:disabled){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}@media (prefers-reduced-motion: reduce){.motion-reduce\:transition-none{transition-property:none}}@media not all and (min-width: 768px){.max-md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}}@media not all and (min-width: 640px){.max-sm\:-mx-4{margin-left:-1rem;margin-right:-1rem}.max-sm\:size-full{width:100%;height:100%}.max-sm\:h-\[200px\]{height:200px}.max-sm\:min-h-dvh{min-height:100dvh}.max-sm\:w-full{width:100%}.max-sm\:w-screen{width:100vw}.max-sm\:object-cover{-o-object-fit:cover;object-fit:cover}.max-sm\:px-4{padding-left:1rem;padding-right:1rem}.max-sm\:pb-10{padding-bottom:2.5rem}.max-sm\:pl-sm{padding-left:var(--size-sm)}.max-sm\:text-center{text-align:center}.max-sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.max-sm\:text-base{font-size:1rem;line-height:1.5rem}.max-sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 640px){.sm\:fixed{position:fixed}.sm\:sticky{position:sticky}.sm\:inset-0{inset:0}.sm\:top-xs{top:var(--size-xs)}.sm\:order-\[unset\]{order:unset}.sm\:col-span-1{grid-column:span 1 / span 1}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mx-sm{margin-left:var(--size-sm);margin-right:var(--size-sm)}.sm\:-mt-2{margin-top:-.5rem}.sm\:mb-2{margin-bottom:.5rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-auto{margin-left:auto}.sm\:line-clamp-5{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:aspect-\[4\/5\]{aspect-ratio:4/5}.sm\:aspect-auto{aspect-ratio:auto}.sm\:\!h-8{height:2rem!important}.sm\:h-full{height:100%}.sm\:max-h-\[25vh\]{max-height:25vh}.sm\:min-h-0{min-height:0px}.sm\:min-h-8{min-height:2rem}.sm\:min-h-80{min-height:20rem}.sm\:\!w-8{width:2rem!important}.sm\:w-1\/2{width:50%}.sm\:w-24{width:6rem}.sm\:w-8\/12{width:66.666667%}.sm\:w-\[75vw\]{width:75vw}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:\!min-w-\[50\%\]{min-width:50%!important}.sm\:min-w-56{min-width:14rem}.sm\:max-w-\[50\%\]{max-width:50%}.sm\:max-w-screen-md{max-width:768px}.sm\:flex-1{flex:1 1 0%}.sm\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.sm\:flex-row{flex-direction:row}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:place-items-center{place-items:center}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-10{gap:2.5rem}.sm\:gap-16{gap:4rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-md{gap:var(--size-md)}.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\:self-center{align-self:center}.sm\:overflow-visible{overflow:visible}.sm\:whitespace-nowrap{white-space:nowrap}.sm\:rounded-3xl{border-radius:1.25rem}.sm\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}.sm\:object-\[80\%_center\]{-o-object-position:80% center;object-position:80% center}.sm\:p-2{padding:.5rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:p-three{padding:3px}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.sm\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pb-0{padding-bottom:0}.sm\:pb-lg{padding-bottom:var(--size-lg)}.sm\:pr-6{padding-right:1.5rem}.sm\:pr-8{padding-right:2rem}.sm\:text-left{text-align:left}.sm\:\!text-2xl{font-size:1.5rem!important;line-height:2rem!important}.sm\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.sm\:\!text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.group:hover .sm\:group-hover\:bg-subtle{background-color:oklch(var(--background-subtle-color))}.sm\:hover\:\!border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))!important}.sm\:hover\:border-subtler:hover{border-color:oklch(var(--foreground-subtler-color))}}@media (min-width: 768px){.md\:pointer-events-auto{pointer-events:auto}.md\:absolute{position:absolute}.md\:relative{position:relative}.md\:inset-0{inset:0}.md\:inset-x-lg{left:var(--size-lg);right:var(--size-lg)}.md\:\!bottom-lg{bottom:var(--size-lg)!important}.md\:\!left-sideBarWidth{left:var(--sidebar-width)!important}.md\:\!left-sidebarDefaultWidth{left:var(--sidebar-default-width)!important}.md\:\!left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)!important}.md\:bottom-0{bottom:0}.md\:bottom-\[6px\]{bottom:6px}.md\:bottom-sm{bottom:var(--size-sm)}.md\:bottom-xl{bottom:var(--size-xl)}.md\:left-\[calc\(var\(--sidebar-pinned-width\)\)\]{left:calc(var(--sidebar-pinned-width))}.md\:left-auto{left:auto}.md\:left-sidebarDefaultWidth{left:var(--sidebar-default-width)}.md\:left-sidebarPinnedWidth{left:var(--sidebar-pinned-width)}.md\:right-0{right:0}.md\:right-full{right:100%}.md\:right-md{right:var(--size-md)}.md\:right-sm{right:var(--size-sm)}.md\:top-0{top:0}.md\:top-\[calc\(var\(--header-height\)\+var\(--size-sm\)\)\]{top:calc(var(--header-height) + var(--size-sm))}.md\:top-headerHeight{top:var(--header-height)}.md\:isolation-auto{isolation:auto}.md\:z-\[1\]{z-index:1}.md\:col-span-4{grid-column:span 4 / span 4}.md\:col-start-2{grid-column-start:2}.md\:col-start-3{grid-column-start:3}.md\:col-end-3{grid-column-end:3}.md\:col-end-4{grid-column-end:4}.md\:row-start-1{grid-row-start:1}.md\:row-end-2{grid-row-end:2}.md\:row-end-3{grid-row-end:3}.md\:-m-md{margin:calc(var(--size-md) * -1)}.md\:m-0{margin:0}.md\:-mx-0{margin-left:-0px;margin-right:-0px}.md\:-mx-3{margin-left:-.75rem;margin-right:-.75rem}.md\:-mx-md{margin-left:calc(var(--size-md) * -1);margin-right:calc(var(--size-md) * -1)}.md\:-mx-xs{margin-left:calc(var(--size-xs) * -1);margin-right:calc(var(--size-xs) * -1)}.md\:-my-2{margin-top:-.5rem;margin-bottom:-.5rem}.md\:mx-0{margin-left:0;margin-right:0}.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mx-lg{margin-left:var(--size-lg);margin-right:var(--size-lg)}.md\:mx-md{margin-left:var(--size-md);margin-right:var(--size-md)}.md\:my-md{margin-top:var(--size-md);margin-bottom:var(--size-md)}.md\:-mb-10{margin-bottom:-2.5rem}.md\:-mb-md{margin-bottom:calc(var(--size-md) * -1)}.md\:-ml-5{margin-left:-1.25rem}.md\:-ml-\[1\.5px\]{margin-left:-1.5px}.md\:-ml-sm{margin-left:calc(var(--size-sm) * -1)}.md\:-mr-5{margin-right:-1.25rem}.md\:-mt-md{margin-top:calc(var(--size-md) * -1)}.md\:mb-0{margin-bottom:0}.md\:mb-1{margin-bottom:.25rem}.md\:mb-20{margin-bottom:5rem}.md\:mb-lg{margin-bottom:var(--size-lg)}.md\:mb-md{margin-bottom:var(--size-md)}.md\:mb-sm{margin-bottom:var(--size-sm)}.md\:mb-xs{margin-bottom:var(--size-xs)}.md\:ml-0{margin-left:0}.md\:mr-0{margin-right:0}.md\:mr-\[-16px\]{margin-right:-16px}.md\:mr-sm{margin-right:var(--size-sm)}.md\:mt-0{margin-top:0}.md\:mt-lg{margin-top:var(--size-lg)}.md\:mt-md{margin-top:var(--size-md)}.md\:mt-ml{margin-top:var(--size-ml)}.md\:mt-sm{margin-top:var(--size-sm)}.md\:mt-xl{margin-top:var(--size-xl)}.md\:line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md\:line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:aspect-square{aspect-ratio:1 / 1}.md\:size-10{width:2.5rem;height:2.5rem}.md\:size-12{width:3rem;height:3rem}.md\:size-14{width:3.5rem;height:3.5rem}.md\:size-20{width:5rem;height:5rem}.md\:size-28{width:7rem;height:7rem}.md\:size-4{width:1rem;height:1rem}.md\:size-5{width:1.25rem;height:1.25rem}.md\:size-8{width:2rem;height:2rem}.md\:size-\[60px\]{width:60px;height:60px}.md\:size-auto{width:auto;height:auto}.md\:h-1\/2{height:50%}.md\:h-12{height:3rem}.md\:h-14{height:3.5rem}.md\:h-2{height:.5rem}.md\:h-4{height:1rem}.md\:h-48{height:12rem}.md\:h-8{height:2rem}.md\:h-\[196px\]{height:196px}.md\:h-\[314px\]{height:314px}.md\:h-\[320px\]{height:320px}.md\:h-\[413px\]{height:413px}.md\:h-\[446px\]{height:446px}.md\:h-\[68px\]{height:68px}.md\:h-\[90vh\]{height:90vh}.md\:h-auto{height:auto}.md\:h-fit{height:-moz-fit-content;height:fit-content}.md\:h-full{height:100%}.md\:h-screen{height:100vh}.md\:max-h-\[350px\]{max-height:350px}.md\:max-h-\[900px\]{max-height:900px}.md\:max-h-\[95vh\]{max-height:95vh}.md\:max-h-\[96vh\]{max-height:96vh}.md\:max-h-none{max-height:none}.md\:min-h-0{min-height:0px}.md\:min-h-\[200px\]{min-height:200px}.md\:min-h-\[60vh\]{min-height:60vh}.md\:\!w-2\/5{width:40%!important}.md\:\!w-full{width:100%!important}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:w-1\/4{width:25%}.md\:w-14{width:3.5rem}.md\:w-16{width:4rem}.md\:w-2\/3{width:66.666667%}.md\:w-3\/4{width:75%}.md\:w-3\/5{width:60%}.md\:w-32{width:8rem}.md\:w-52{width:13rem}.md\:w-6{width:1.5rem}.md\:w-8{width:2rem}.md\:w-80{width:20rem}.md\:w-\[140px\]{width:140px}.md\:w-\[160px\]{width:160px}.md\:w-\[200px\]{width:200px}.md\:w-\[266px\]{width:266px}.md\:w-\[400px\]{width:400px}.md\:w-\[420px\]{width:420px}.md\:w-\[45\%\]{width:45%}.md\:w-\[515px\]{width:515px}.md\:w-\[55\%\]{width:55%}.md\:w-\[90vw\]{width:90vw}.md\:w-\[calc\(20\%-8px\)\]{width:calc(20% - 8px)}.md\:w-\[calc\(30\%_-_8px\)\]{width:calc(30% - 8px)}.md\:w-\[min\(80vw\,_1200px\)\]{width:min(80vw,1200px)}.md\:w-\[unset\]{width:unset}.md\:w-auto{width:auto}.md\:w-full{width:100%}.md\:\!min-w-0{min-width:0px!important}.md\:\!min-w-\[400px\]{min-width:400px!important}.md\:min-w-0{min-width:0px}.md\:min-w-\[250px\]{min-width:250px}.md\:min-w-\[300px\]{min-width:300px}.md\:min-w-\[400px\]{min-width:400px}.md\:min-w-\[500px\]{min-width:500px}.md\:min-w-\[600px\]{min-width:600px}.md\:min-w-\[768px\]{min-width:768px}.md\:min-w-\[auto\]{min-width:auto}.md\:\!max-w-\[400px\]{max-width:400px!important}.md\:max-w-\[1000px\]{max-width:1000px}.md\:max-w-\[160px\]{max-width:160px}.md\:max-w-\[300px\]{max-width:300px}.md\:max-w-\[350px\]{max-width:350px}.md\:max-w-\[360px\]{max-width:360px}.md\:max-w-\[440px\]{max-width:440px}.md\:max-w-\[50vw\]{max-width:50vw}.md\:max-w-\[90vw\]{max-width:90vw}.md\:max-w-\[960px\]{max-width:960px}.md\:max-w-lg{max-width:32rem}.md\:max-w-none{max-width:none}.md\:max-w-screen-md{max-width:768px}.md\:max-w-threadWidth{max-width:var(--thread-width)}.md\:flex-1{flex:1 1 0%}.md\:flex-shrink-0{flex-shrink:0}.md\:shrink{flex-shrink:1}.md\:grow-\[unset\]{flex-grow:unset}.md\:-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))}.md\:-translate-x-\[30vw\]{--tw-translate-x: -30vw;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))}.md\:-translate-x-sm{--tw-translate-x: calc(var(--size-sm) * -1);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))}.md\:-translate-y-px{--tw-translate-y: -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))}.md\: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))}.md\:translate-x-sm{--tw-translate-x: var(--size-sm);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))}.md\:translate-y-0{--tw-translate-y: 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))}.md\:translate-y-px{--tw-translate-y: 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))}.md\:cursor-pointer{cursor:pointer}.md\:grid-flow-col{grid-auto-flow:column}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.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\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:grid-cols-\[1fr\,3fr\,1fr\]{grid-template-columns:1fr 3fr 1fr}.md\:grid-cols-\[1fr_1fr_1fr_96px\]{grid-template-columns:1fr 1fr 1fr 96px}.md\:grid-cols-\[1fr_3fr\]{grid-template-columns:1fr 3fr}.md\:grid-cols-\[2fr\,1fr\,1fr\,1fr\,1fr\]{grid-template-columns:2fr 1fr 1fr 1fr 1fr}.md\:grid-cols-\[3\.5fr\,1fr\,1fr\,1fr\]{grid-template-columns:3.5fr 1fr 1fr 1fr}.md\:grid-cols-\[3fr\,1fr\,1fr\,1fr\]{grid-template-columns:3fr 1fr 1fr 1fr}.md\:grid-cols-\[3fr\,1fr\]{grid-template-columns:3fr 1fr}.md\:grid-cols-\[3fr\,2fr\,1fr\,1fr\]{grid-template-columns:3fr 2fr 1fr 1fr}.md\:grid-cols-\[5fr\,2fr\,2fr\,1fr\,1fr\]{grid-template-columns:5fr 2fr 2fr 1fr 1fr}.md\:grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.md\:grid-cols-\[auto_300px\]{grid-template-columns:auto 300px}.md\:grid-cols-\[min-content\,1fr\,1fr\,min-content\]{grid-template-columns:min-content 1fr 1fr min-content}.md\:grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr}.md\:flex-row{flex-direction:row}.md\:\!flex-row-reverse{flex-direction:row-reverse!important}.md\:flex-row-reverse{flex-direction:row-reverse}.md\:flex-col{flex-direction:column}.md\:flex-nowrap{flex-wrap:nowrap}.md\:items-start{align-items:flex-start}.md\:items-center{align-items:center}.md\:justify-start{justify-content:flex-start}.md\:justify-end{justify-content:flex-end}.md\:justify-center{justify-content:center}.md\:justify-between{justify-content:space-between}.md\:gap-0{gap:0px}.md\:gap-3{gap:.75rem}.md\:gap-6{gap:1.5rem}.md\:gap-8{gap:2rem}.md\:gap-\[12px\]{gap:12px}.md\:gap-lg{gap:var(--size-lg)}.md\:gap-md{gap:var(--size-md)}.md\:gap-sm{gap:var(--size-sm)}.md\:gap-xl{gap:var(--size-xl)}.md\:gap-xs{gap:var(--size-xs)}.md\:gap-x-0{-moz-column-gap:0px;column-gap:0px}.md\:gap-x-md{-moz-column-gap:var(--size-md);column-gap:var(--size-md)}.md\:gap-x-sm{-moz-column-gap:var(--size-sm);column-gap:var(--size-sm)}.md\:gap-y-lg{row-gap:var(--size-lg)}.md\:gap-y-md{row-gap:var(--size-md)}.md\:space-y-lg>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-lg) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-lg) * var(--tw-space-y-reverse))}.md\:space-y-md>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(var(--size-md) * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(var(--size-md) * var(--tw-space-y-reverse))}.md\:self-center{align-self:center}.md\:overflow-hidden{overflow:hidden}.md\:overflow-visible{overflow:visible}.md\:overflow-y-auto{overflow-y:auto}.md\:overflow-x-visible{overflow-x:visible}.md\:whitespace-nowrap{white-space:nowrap}.md\:rounded{border-radius:.25rem}.md\:rounded-2xl{border-radius:1rem}.md\:rounded-3xl{border-radius:1.25rem}.md\:rounded-full{border-radius:9999px}.md\:rounded-lg{border-radius:.5rem}.md\:rounded-md{border-radius:.375rem}.md\:rounded-none{border-radius:0}.md\:rounded-xl{border-radius:.75rem}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.md\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.md\:rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.md\:rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.md\:rounded-br-\[6px\]{border-bottom-right-radius:6px}.md\:border{border-width:1px}.md\:border-0{border-width:0px}.md\:\!border-y-0{border-top-width:0px!important;border-bottom-width:0px!important}.md\:\!border-r-0{border-right-width:0px!important}.md\:border-b{border-bottom-width:1px}.md\:border-b-0{border-bottom-width:0px}.md\:border-l{border-left-width:1px}.md\:border-r{border-right-width:1px}.md\:border-r-0{border-right-width:0px}.md\:border-t{border-top-width:1px}.md\:border-t-0{border-top-width:0px}.md\:bg-subtler{background-color:oklch(var(--background-subtler-color))}.md\:object-cover{-o-object-fit:cover;object-fit:cover}.md\:object-\[65\%_center\]{-o-object-position:65% center;object-position:65% center}.md\:\!p-md{padding:var(--size-md)!important}.md\:p-0{padding:0}.md\:p-1{padding:.25rem}.md\:p-12{padding:3rem}.md\:p-3{padding:.75rem}.md\:p-6{padding:1.5rem}.md\:p-\[12px\]{padding:12px}.md\:p-\[6px\]{padding:6px}.md\:p-lg{padding:var(--size-lg)}.md\:p-md{padding:var(--size-md)}.md\:p-sm{padding:var(--size-sm)}.md\:p-xl{padding:var(--size-xl)}.md\:p-xs{padding:var(--size-xs)}.md\:px-0{padding-left:0;padding-right:0}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:px-lg{padding-left:var(--size-lg);padding-right:var(--size-lg)}.md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.md\:px-sm{padding-left:var(--size-sm);padding-right:var(--size-sm)}.md\:px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.md\:px-xs{padding-left:var(--size-xs);padding-right:var(--size-xs)}.md\:py-0{padding-top:0;padding-bottom:0}.md\:py-\[12px\]{padding-top:12px;padding-bottom:12px}.md\:py-lg{padding-top:var(--size-lg);padding-bottom:var(--size-lg)}.md\:py-md{padding-top:var(--size-md);padding-bottom:var(--size-md)}.md\:py-sm{padding-top:var(--size-sm);padding-bottom:var(--size-sm)}.md\:py-xs{padding-top:var(--size-xs);padding-bottom:var(--size-xs)}.md\:\!pb-0{padding-bottom:0!important}.md\:\!pb-4{padding-bottom:1rem!important}.md\:pb-0{padding-bottom:0}.md\:pb-12{padding-bottom:3rem}.md\:pb-6{padding-bottom:1.5rem}.md\:pb-8{padding-bottom:2rem}.md\:pb-9{padding-bottom:2.25rem}.md\:pb-lg{padding-bottom:var(--size-lg)}.md\:pb-md{padding-bottom:var(--size-md)}.md\:pb-sm{padding-bottom:var(--size-sm)}.md\:pl-0{padding-left:0}.md\:pl-lg{padding-left:var(--size-lg)}.md\:pl-md{padding-left:var(--size-md)}.md\:pr-0{padding-right:0}.md\:pr-6{padding-right:1.5rem}.md\:pr-\[138px\]{padding-right:138px}.md\:pr-\[59px\]{padding-right:59px}.md\:pr-md{padding-right:var(--size-md)}.md\:pr-sm{padding-right:var(--size-sm)}.md\:pt-0{padding-top:0}.md\:pt-2{padding-top:.5rem}.md\:pt-20{padding-top:5rem}.md\:pt-lg{padding-top:var(--size-lg)}.md\:pt-md{padding-top:var(--size-md)}.md\:pt-xl{padding-top:var(--size-xl)}.md\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:\!text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.md\:\!text-5xl{font-size:3rem!important;line-height:1!important}.md\:\!text-\[2\.8rem\]{font-size:2.8rem!important}.md\:\!text-\[80px\]{font-size:80px!important}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-\[2\.8rem\]{font-size:2.8rem}.md\:text-\[3\.1rem\]{font-size:3.1rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}.md\:\!leading-\[1\.3\]{line-height:1.3!important}.md\:text-quietest{color:oklch(var(--foreground-quietest-color))}.md\:opacity-0{opacity:0}.md\:opacity-70{opacity:.7}.md\: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)}.md\: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)}.md\:shadow-overlay{--tw-shadow: 0 0 0 1px var(--shadow-overlay-border, rgba(0, 0, 0, .05)), 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 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)}.md\: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)}.md\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}.md\: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)}.md\:\[grid-template-columns\:5fr_1fr_1fr_1fr\]{grid-template-columns:5fr 1fr 1fr 1fr}.md\:placeholder\:text-\[2\.8rem\]::-moz-placeholder{font-size:2.8rem}.md\:placeholder\:text-\[2\.8rem\]::placeholder{font-size:2.8rem}.first\:md\:px-md:first-child{padding-left:var(--size-md);padding-right:var(--size-md)}.md\:last\:px-md:last-child{padding-left:var(--size-md);padding-right:var(--size-md)}.last\:md\:pr-md:last-child{padding-right:var(--size-md)}.md\:last\:pr-0:last-child{padding-right:0}.group:first-child .group-first\:md\:px-md{padding-left:var(--size-md);padding-right:var(--size-md)}.group:last-child .group-last\:md\:pr-md{padding-right:var(--size-md)}.group:hover .md\:group-hover\: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:hover .md\:group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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:hover .md\:group-hover\:\!border-foreground{border-color:oklch(var(--foreground-color))!important}.group:hover .md\:group-hover\:\!text-super{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.group:hover .md\:group-hover\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.group:hover .md\:group-hover\:opacity-100{opacity:1}@container (min-width: 20rem){.md\:\@xs\:w-60{width:15rem}}@container (min-width: 1458px){.md\:\@\[1458px\]\:w-\[874px\]{width:874px}.md\:\@\[1458px\]\:shrink-0{flex-shrink:0}}.md\:hover\:border-subtle:hover{border-color:oklch(var(--foreground-subtle-color))}.md\:hover\:\!bg-raisedOffset:hover{background-color:oklch(var(--raised-offset-color))!important}.md\:hover\:\!bg-subtle:hover{background-color:oklch(var(--background-subtle-color))!important}.md\:hover\:\!bg-subtler:hover{background-color:oklch(var(--background-subtler-color))!important}.md\:hover\:\!bg-super:hover{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.md\:hover\:\!bg-transparent:hover{background-color:transparent!important}.md\:hover\:text-quiet:hover{color:oklch(var(--foreground-quiet-color))}}@media (max-width: 1224px){@media (min-width: 768px){.max-\[1224px\]\:md\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}}}@media (max-width: 970px){@media (min-width: 768px){.max-\[970px\]\:md\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}}}@media (min-width: 1024px){.lg\:\!relative{position:relative!important}.lg\:sticky{position:sticky}.lg\:\!top-0{top:0!important}.lg\:-top-6{top:-1.5rem}.lg\:bottom-md{bottom:var(--size-md)}.lg\:left-8{left:2rem}.lg\:right-8{right:2rem}.lg\:right-sm{right:var(--size-sm)}.lg\:top-\[clamp\(24px\,4vw\,96px\)\]{top:clamp(24px,4vw,96px)}.lg\:ml-0{margin-left:0}.lg\:block{display:block}.lg\:grid{display:grid}.lg\:contents{display:contents}.lg\:hidden{display:none}.lg\:size-\[44px\]{width:44px;height:44px}.lg\:h-\[clamp\(420px\,calc\(100vh-320px\)\,672px\)\]{height:clamp(420px,calc(100vh - 320px),672px)}.lg\:max-h-\[40vh\]{max-height:40vh}.lg\:w-1\/2{width:50%}.lg\:w-fit{width:-moz-fit-content;width:fit-content}.lg\:min-w-\[900px\]{min-width:900px}.lg\:max-w-\[unset\]{max-width:unset}.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\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[1fr_1fr_1fr_1fr\]{grid-template-columns:1fr 1fr 1fr 1fr}.lg\:grid-cols-\[8fr_minmax\(300px\,3fr\)\]{grid-template-columns:8fr minmax(300px,3fr)}.lg\:gap-8{gap:2rem}.lg\:gap-md{gap:var(--size-md)}.lg\:gap-xl{gap:var(--size-xl)}.lg\:rounded-lg{border-radius:.5rem}.lg\:object-\[center_center\]{-o-object-position:center center;object-position:center center}.lg\:p-sm{padding:var(--size-sm)}.lg\:px-12{padding-left:3rem;padding-right:3rem}.lg\:px-xl{padding-left:var(--size-xl);padding-right:var(--size-xl)}.lg\:pl-0{padding-left:0}.lg\:\!text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-\[2\.8rem\]{font-size:2.8rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}[data-erp=tab] .erp-tab\:lg\:right-0{right:0}}@media (min-width: 1280px){.xl\:block{display:block}.xl\:size-\[64px\]{width:64px;height:64px}.xl\:max-h-screen{max-height:100vh}.xl\:max-w-\[25vw\]{max-width:25vw}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:border-l-0{border-left-width:0px}.xl\:\!text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.xl\: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)}}@media (min-width: 1536px){.\32xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.ltr\:-mr-sm:where([dir=ltr],[dir=ltr] *){margin-right:calc(var(--size-sm) * -1)}.ltr\:-translate-x-\[1\%\]:where([dir=ltr],[dir=ltr] *){--tw-translate-x: -1%;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))}.ltr\:-translate-x-px:where([dir=ltr],[dir=ltr] *){--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))}.rtl\:-ml-sm:where([dir=rtl],[dir=rtl] *){margin-left:calc(var(--size-sm) * -1)}.rtl\:translate-x-\[1\%\]:where([dir=rtl],[dir=rtl] *){--tw-translate-x: 1%;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))}.rtl\:translate-x-px:where([dir=rtl],[dir=rtl] *){--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))}.rtl\:rotate-180:where([dir=rtl],[dir=rtl] *){--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))}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:ml-0{margin-left:0}:root:not([data-color-scheme=light]) .dark\:mr-0{margin-right:0}:root:not([data-color-scheme=light]) .dark\:block{display:block}:root:not([data-color-scheme=light]) .dark\:hidden{display:none}:root:not([data-color-scheme=light]) .dark\:w-full{width:100%}:root:not([data-color-scheme=light]) .dark\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}:root:not([data-color-scheme=light]) .dark\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}:root:not([data-color-scheme=light]) .dark\:border{border-width:1px}:root:not([data-color-scheme=light]) .dark\:border-0{border-width:0px}:root:not([data-color-scheme=light]) .dark\:\!border-none{border-style:none!important}:root:not([data-color-scheme=light]) .dark\:border-none{border-style:none}:root:not([data-color-scheme=light]) .dark\:\!border-\[white\]\/10{border-color:#ffffff1a!important}:root:not([data-color-scheme=light]) .dark\:border-\[\#5D5F5F\]{--tw-border-opacity: 1;border-color:rgb(93 95 95 / var(--tw-border-opacity))}:root:not([data-color-scheme=light]) .dark\:border-\[white\]\/5{border-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:border-black\/\[0\.04\]{border-color:#0000000a}:root:not([data-color-scheme=light]) .dark\:border-foreground{border-color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:border-inverse{border-color:oklch(var(--foreground-inverse-color))}:root:not([data-color-scheme=light]) .dark\:border-subtle{border-color:oklch(var(--foreground-subtle-color))}:root:not([data-color-scheme=light]) .dark\:border-subtler{border-color:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}:root:not([data-color-scheme=light]) .dark\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}:root:not([data-color-scheme=light]) .dark\:border-super\/30{border-color:oklch(var(--super-color) / .3)}:root:not([data-color-scheme=light]) .dark\:border-super\/5{border-color:oklch(var(--super-color) / .05)}:root:not([data-color-scheme=light]) .dark\:border-super\/85{border-color:oklch(var(--super-color) / .85)}:root:not([data-color-scheme=light]) .dark\:border-transparent{border-color:transparent}:root:not([data-color-scheme=light]) .dark\:border-white\/10{border-color:#ffffff1a}:root:not([data-color-scheme=light]) .dark\:\!bg-\[white\]\/100{background-color:#fff!important}:root:not([data-color-scheme=light]) .dark\:\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}:root:not([data-color-scheme=light]) .dark\:\!bg-white\/10{background-color:#ffffff1a!important}:root:not([data-color-scheme=light]) .dark\:\!bg-white\/5{background-color:#ffffff0d!important}:root:not([data-color-scheme=light]) .dark\:bg-\[\#211B1A\]{--tw-bg-opacity: 1;background-color:rgb(33 27 26 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#450a0a\]\/75{background-color:#450a0abf}:root:not([data-color-scheme=light]) .dark\:bg-\[\#54B4E3\]{--tw-bg-opacity: 1;background-color:rgb(84 180 227 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#B3C901\]{--tw-bg-opacity: 1;background-color:rgb(179 201 1 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#B4B662\]{--tw-bg-opacity: 1;background-color:rgb(180 182 98 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#C48ED8\]{--tw-bg-opacity: 1;background-color:rgb(196 142 216 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#E68161\]{--tw-bg-opacity: 1;background-color:rgb(230 129 97 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#F0B435\]{--tw-bg-opacity: 1;background-color:rgb(240 180 53 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#F5F5F5\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#FF5459\]{--tw-bg-opacity: 1;background-color:rgb(255 84 89 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-\[\#FFAB44\]{--tw-bg-opacity: 1;background-color:rgb(255 171 68 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-base\/70{background-color:oklch(var(--background-base-color) / .7)}:root:not([data-color-scheme=light]) .dark\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}:root:not([data-color-scheme=light]) .dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-black\/50{background-color:#00000080}:root:not([data-color-scheme=light]) .dark\:bg-black\/80{background-color:#000c}:root:not([data-color-scheme=light]) .dark\:bg-black\/\[0\.18\]{background-color:#0000002e}:root:not([data-color-scheme=light]) .dark\:bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}:root:not([data-color-scheme=light]) .dark\:bg-offset{background-color:oklch(var(--offset-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtle{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .dark\:bg-subtlest{background-color:oklch(var(--background-subtlest-color))}:root:not([data-color-scheme=light]) .dark\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:bg-super\/20{background-color:oklch(var(--super-color) / .2)}:root:not([data-color-scheme=light]) .dark\:bg-super\/25{background-color:oklch(var(--super-color) / .25)}:root:not([data-color-scheme=light]) .dark\:bg-super\/85{background-color:oklch(var(--super-color) / .85)}:root:not([data-color-scheme=light]) .dark\:bg-transparent{background-color:transparent}:root:not([data-color-scheme=light]) .dark\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:bg-white\/10{background-color:#ffffff1a}:root:not([data-color-scheme=light]) .dark\:bg-white\/20{background-color:#fff3}:root:not([data-color-scheme=light]) .dark\:bg-white\/40{background-color:#fff6}:root:not([data-color-scheme=light]) .dark\:bg-white\/5{background-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}:root:not([data-color-scheme=light]) .dark\:bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}:root:not([data-color-scheme=light]) .dark\:bg-none{background-image:none}:root:not([data-color-scheme=light]) .dark\:from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}:root:not([data-color-scheme=light]) .dark\:from-super\/20{--tw-gradient-from: oklch(var(--super-color) / .2) 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)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\:to-\[oklch\(var\(--dark-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--dark-background-base-color)) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-super\/20{--tw-gradient-to: oklch(var(--super-color) / .2) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:to-white\/20{--tw-gradient-to: rgb(255 255 255 / .2) var(--tw-gradient-to-position)}:root:not([data-color-scheme=light]) .dark\:stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:stroke-\[1\.5px\]{stroke-width:1.5px}:root:not([data-color-scheme=light]) .dark\:\!text-\[\#1f2121\]{--tw-text-opacity: 1 !important;color:rgb(31 33 33 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:\!text-foreground{color:oklch(var(--foreground-color))!important}:root:not([data-color-scheme=light]) .dark\:\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}:root:not([data-color-scheme=light]) .dark\:\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}:root:not([data-color-scheme=light]) .dark\:text-\[\#1f2121\]{--tw-text-opacity: 1;color:rgb(31 33 33 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-\[\#4ade80\]{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-foreground{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:text-inverse{color:oklch(var(--foreground-inverse-color))}:root:not([data-color-scheme=light]) .dark\:text-quiet{color:oklch(var(--foreground-quiet-color))}:root:not([data-color-scheme=light]) .dark\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:text-white\/50{color:#ffffff80}:root:not([data-color-scheme=light]) .dark\:decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:opacity-10{opacity:.1}:root:not([data-color-scheme=light]) .dark\:opacity-100{opacity:1}:root:not([data-color-scheme=light]) .dark\:opacity-15{opacity:.15}:root:not([data-color-scheme=light]) .dark\:opacity-20{opacity:.2}:root:not([data-color-scheme=light]) .dark\:opacity-25{opacity:.25}:root:not([data-color-scheme=light]) .dark\:opacity-40{opacity:.4}:root:not([data-color-scheme=light]) .dark\:opacity-60{opacity:.6}:root:not([data-color-scheme=light]) .dark\:opacity-90{opacity:.9}:root:not([data-color-scheme=light]) .dark\:opacity-\[0\.12\]{opacity:.12}:root:not([data-color-scheme=light]) .dark\:mix-blend-normal{mix-blend-mode:normal}:root:not([data-color-scheme=light]) .dark\:mix-blend-screen{mix-blend-mode:screen}:root:not([data-color-scheme=light]) .dark\:mix-blend-soft-light{mix-blend-mode:soft-light}:root:not([data-color-scheme=light]) .dark\:\!shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)\]{--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_0_16px_8px_oklch\(var\(--offset-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--offset-color)/.6);--tw-shadow-colored: 0 0 16px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 1px 4px rgba(0,0,0,.5);--tw-shadow-colored: 0 1px 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)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.12\)\,0_32px_16px_36px_oklch\(var\(--dark-background-base-color\)\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.12),0 32px 16px 36px oklch(var(--dark-background-base-color));--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color), 0 32px 16px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.5);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\: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)}:root:not([data-color-scheme=light]) .dark\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}:root:not([data-color-scheme=light]) .dark\:shadow-black\/10{--tw-shadow-color: rgb(0 0 0 / .1);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:shadow-super\/5{--tw-shadow-color: oklch(var(--super-color) / .05);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:shadow-white\/5{--tw-shadow-color: rgb(255 255 255 / .05);--tw-shadow: var(--tw-shadow-colored)}:root:not([data-color-scheme=light]) .dark\:\!ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color)) !important}:root:not([data-color-scheme=light]) .dark\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}:root:not([data-color-scheme=light]) .dark\:ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}:root:not([data-color-scheme=light]) .dark\:ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}:root:not([data-color-scheme=light]) .dark\:ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}:root:not([data-color-scheme=light]) .dark\:invert{--tw-invert: invert(100%);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)}:is(:root:not([data-color-scheme=light]) .dark\:\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(:root:not([data-color-scheme=light]) .dark\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}:root:not([data-color-scheme=light]) .dark\:\!\[--dog-bg-highlight\:white\]{--dog-bg-highlight: white !important}:root:not([data-color-scheme=light]) .dark\:\!\[--dot-bg\:currentColor\]{--dot-bg: currentColor !important}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .dark\:selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}:root:not([data-color-scheme=light]) .before\:dark\:border-none:before{content:var(--tw-content);border-style:none}:root:not([data-color-scheme=light]) .dark\:before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}:root:not([data-color-scheme=light]) .dark\:before\:shadow-md:before{content:var(--tw-content);--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)}:root:not([data-color-scheme=light]) .dark\:after\:absolute:after{content:var(--tw-content);position:absolute}:root:not([data-color-scheme=light]) .dark\:after\:inset-0:after{content:var(--tw-content);inset:0}:root:not([data-color-scheme=light]) .dark\:after\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}:root:not([data-color-scheme=light]) .dark\:after\:border:after{content:var(--tw-content);border-width:1px}:root:not([data-color-scheme=light]) .dark\:after\:border-none:after{content:var(--tw-content);border-style:none}:root:not([data-color-scheme=light]) .dark\:after\:border-white\/10:after{content:var(--tw-content);border-color:#ffffff1a}:root:not([data-color-scheme=light]) .after\:dark\:shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;--tw-shadow-colored: inset 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)}:root:not([data-color-scheme=light]) .dark\:after\:ring-0:after{content:var(--tw-content);--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)}:root:not([data-color-scheme=light]) .group:hover .dark\:group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}:is(:root:not([data-color-scheme=light]) .group:hover .dark\:group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}:root:not([data-color-scheme=light]) .group:active .dark\:group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}:root:not([data-color-scheme=light]) .aria-selected\:dark\:bg-subtle[aria-selected=true]{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .aria-selected\:dark\:text-foreground[aria-selected=true]{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:data-\[focused\=self\]\:bg-subtler[data-focused=self]{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .group[data-selected=true] .dark\:group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}:root:not([data-color-scheme=light]) .dark\:hover\:\!bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)!important}:root:not([data-color-scheme=light]) .dark\:hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}:root:not([data-color-scheme=light]) .dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}:root:not([data-color-scheme=light]) .dark\:hover\:text-foreground:hover{color:oklch(var(--foreground-color))}:root:not([data-color-scheme=light]) .dark\:hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}:root:not([data-color-scheme=light]) .dark\:hover\:data-\[focused\=other\]\:bg-subtler[data-focused=other]:hover{background-color:oklch(var(--background-subtler-color))}:root:not([data-color-scheme=light]) .dark\:focus\:\!ring-super\/50:focus{--tw-ring-color: oklch(var(--super-color) / .5) !important}:root:not([data-color-scheme=light]) .dark\:active\:\!bg-subtle:active{background-color:oklch(var(--background-subtle-color))!important}:root:not([data-color-scheme=light]) .dark\:active\:bg-subtle:active{background-color:oklch(var(--background-subtle-color))}}@media (min-width: 768px){@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .md\:dark\:block{display:block}:root:not([data-color-scheme=light]) .md\:dark\:border{border-width:1px}:root:not([data-color-scheme=light]) .md\:dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}}}html[data-color-scheme=dark] .dark\:ml-0{margin-left:0}html[data-color-scheme=dark] .dark\:mr-0{margin-right:0}html[data-color-scheme=dark] .dark\:block{display:block}html[data-color-scheme=dark] .dark\:hidden{display:none}html[data-color-scheme=dark] .dark\:w-full{width:100%}html[data-color-scheme=dark] .dark\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}html[data-color-scheme=dark] .dark\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}html[data-color-scheme=dark] .dark\:border{border-width:1px}html[data-color-scheme=dark] .dark\:border-0{border-width:0px}html[data-color-scheme=dark] .dark\:\!border-none{border-style:none!important}html[data-color-scheme=dark] .dark\:border-none{border-style:none}html[data-color-scheme=dark] .dark\:\!border-\[white\]\/10{border-color:#ffffff1a!important}html[data-color-scheme=dark] .dark\:border-\[\#5D5F5F\]{--tw-border-opacity: 1;border-color:rgb(93 95 95 / var(--tw-border-opacity))}html[data-color-scheme=dark] .dark\:border-\[white\]\/5{border-color:#ffffff0d}html[data-color-scheme=dark] .dark\:border-black\/\[0\.04\]{border-color:#0000000a}html[data-color-scheme=dark] .dark\:border-foreground{border-color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:border-inverse{border-color:oklch(var(--foreground-inverse-color))}html[data-color-scheme=dark] .dark\:border-subtle{border-color:oklch(var(--foreground-subtle-color))}html[data-color-scheme=dark] .dark\:border-subtler{border-color:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}html[data-color-scheme=dark] .dark\:border-super{--tw-border-opacity: 1;border-color:oklch(var(--super-color) / var(--tw-border-opacity))}html[data-color-scheme=dark] .dark\:border-super\/30{border-color:oklch(var(--super-color) / .3)}html[data-color-scheme=dark] .dark\:border-super\/5{border-color:oklch(var(--super-color) / .05)}html[data-color-scheme=dark] .dark\:border-super\/85{border-color:oklch(var(--super-color) / .85)}html[data-color-scheme=dark] .dark\:border-transparent{border-color:transparent}html[data-color-scheme=dark] .dark\:border-white\/10{border-color:#ffffff1a}html[data-color-scheme=dark] .dark\:\!bg-\[white\]\/100{background-color:#fff!important}html[data-color-scheme=dark] .dark\:\!bg-base{--tw-bg-opacity: 1 !important;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))!important}html[data-color-scheme=dark] .dark\:\!bg-subtle{background-color:oklch(var(--background-subtle-color))!important}html[data-color-scheme=dark] .dark\:\!bg-subtler{background-color:oklch(var(--background-subtler-color))!important}html[data-color-scheme=dark] .dark\:\!bg-white\/10{background-color:#ffffff1a!important}html[data-color-scheme=dark] .dark\:\!bg-white\/5{background-color:#ffffff0d!important}html[data-color-scheme=dark] .dark\:bg-\[\#211B1A\]{--tw-bg-opacity: 1;background-color:rgb(33 27 26 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#32B8C6\]{--tw-bg-opacity: 1;background-color:rgb(50 184 198 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#450a0a\]\/75{background-color:#450a0abf}html[data-color-scheme=dark] .dark\:bg-\[\#54B4E3\]{--tw-bg-opacity: 1;background-color:rgb(84 180 227 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#B3C901\]{--tw-bg-opacity: 1;background-color:rgb(179 201 1 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#B4B662\]{--tw-bg-opacity: 1;background-color:rgb(180 182 98 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#C48ED8\]{--tw-bg-opacity: 1;background-color:rgb(196 142 216 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#E68161\]{--tw-bg-opacity: 1;background-color:rgb(230 129 97 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#F0B435\]{--tw-bg-opacity: 1;background-color:rgb(240 180 53 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#F5F5F5\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#FF5459\]{--tw-bg-opacity: 1;background-color:rgb(255 84 89 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-\[\#FFAB44\]{--tw-bg-opacity: 1;background-color:rgb(255 171 68 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-base{--tw-bg-opacity: 1;background-color:oklch(var(--background-base-color) / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-base\/70{background-color:oklch(var(--background-base-color) / .7)}html[data-color-scheme=dark] .dark\:bg-base\/80{background-color:oklch(var(--background-base-color) / .8)}html[data-color-scheme=dark] .dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-black\/50{background-color:#00000080}html[data-color-scheme=dark] .dark\:bg-black\/80{background-color:#000c}html[data-color-scheme=dark] .dark\:bg-black\/\[0\.18\]{background-color:#0000002e}html[data-color-scheme=dark] .dark\:bg-caution\/10{background-color:oklch(var(--caution-color) / .1)}html[data-color-scheme=dark] .dark\:bg-inverse{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-inverse\/20{background-color:oklch(var(--background-inverse-color) / .2)}html[data-color-scheme=dark] .dark\:bg-offset{background-color:oklch(var(--offset-color))}html[data-color-scheme=dark] .dark\:bg-subtle{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .dark\:bg-subtlest{background-color:oklch(var(--background-subtlest-color))}html[data-color-scheme=dark] .dark\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:bg-super\/20{background-color:oklch(var(--super-color) / .2)}html[data-color-scheme=dark] .dark\:bg-super\/25{background-color:oklch(var(--super-color) / .25)}html[data-color-scheme=dark] .dark\:bg-super\/85{background-color:oklch(var(--super-color) / .85)}html[data-color-scheme=dark] .dark\:bg-transparent{background-color:transparent}html[data-color-scheme=dark] .dark\:bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:bg-white\/10{background-color:#ffffff1a}html[data-color-scheme=dark] .dark\:bg-white\/20{background-color:#fff3}html[data-color-scheme=dark] .dark\:bg-white\/40{background-color:#fff6}html[data-color-scheme=dark] .dark\:bg-white\/5{background-color:#ffffff0d}html[data-color-scheme=dark] .dark\:bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}html[data-color-scheme=dark] .dark\:bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}html[data-color-scheme=dark] .dark\:bg-none{background-image:none}html[data-color-scheme=dark] .dark\:from-subtler{--tw-gradient-from: oklch(var(--background-subtler-color)) 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)}html[data-color-scheme=dark] .dark\:from-super\/20{--tw-gradient-from: oklch(var(--super-color) / .2) 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)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\:to-\[oklch\(var\(--dark-background-base-color\)\)\]{--tw-gradient-to: oklch(var(--dark-background-base-color)) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-subtler{--tw-gradient-to: oklch(var(--background-subtler-color)) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-super\/20{--tw-gradient-to: oklch(var(--super-color) / .2) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:to-white\/20{--tw-gradient-to: rgb(255 255 255 / .2) var(--tw-gradient-to-position)}html[data-color-scheme=dark] .dark\:stroke-subtler{stroke:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:stroke-\[1\.5px\]{stroke-width:1.5px}html[data-color-scheme=dark] .dark\:\!text-\[\#1f2121\]{--tw-text-opacity: 1 !important;color:rgb(31 33 33 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:\!text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:\!text-foreground{color:oklch(var(--foreground-color))!important}html[data-color-scheme=dark] .dark\:\!text-inverse{color:oklch(var(--foreground-inverse-color))!important}html[data-color-scheme=dark] .dark\:\!text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}html[data-color-scheme=dark] .dark\:text-\[\#1f2121\]{--tw-text-opacity: 1;color:rgb(31 33 33 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-\[\#4ade80\]{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-caution{--tw-text-opacity: 1;color:oklch(var(--caution-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-foreground{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:text-inverse{color:oklch(var(--foreground-inverse-color))}html[data-color-scheme=dark] .dark\:text-quiet{color:oklch(var(--foreground-quiet-color))}html[data-color-scheme=dark] .dark\:text-super{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:text-white\/50{color:#ffffff80}html[data-color-scheme=dark] .dark\:decoration-subtler{text-decoration-color:oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:opacity-10{opacity:.1}html[data-color-scheme=dark] .dark\:opacity-100{opacity:1}html[data-color-scheme=dark] .dark\:opacity-15{opacity:.15}html[data-color-scheme=dark] .dark\:opacity-20{opacity:.2}html[data-color-scheme=dark] .dark\:opacity-25{opacity:.25}html[data-color-scheme=dark] .dark\:opacity-40{opacity:.4}html[data-color-scheme=dark] .dark\:opacity-60{opacity:.6}html[data-color-scheme=dark] .dark\:opacity-90{opacity:.9}html[data-color-scheme=dark] .dark\:opacity-\[0\.12\]{opacity:.12}html[data-color-scheme=dark] .dark\:mix-blend-normal{mix-blend-mode:normal}html[data-color-scheme=dark] .dark\:mix-blend-screen{mix-blend-mode:screen}html[data-color-scheme=dark] .dark\:mix-blend-soft-light{mix-blend-mode:soft-light}html[data-color-scheme=dark] .dark\:\!shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)\]{--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) !important;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}html[data-color-scheme=dark] .dark\:shadow-\[0_0_16px_8px_oklch\(var\(--offset-color\)\/0\.6\)\]{--tw-shadow: 0 0 16px 8px oklch(var(--offset-color)/.6);--tw-shadow-colored: 0 0 16px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\:shadow-\[0_1px_4px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 1px 4px rgba(0,0,0,.5);--tw-shadow-colored: 0 1px 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)}html[data-color-scheme=dark] .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.12\)\,0_32px_16px_36px_oklch\(var\(--dark-background-base-color\)\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.12),0 32px 16px 36px oklch(var(--dark-background-base-color));--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color), 0 32px 16px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\:shadow-\[0_4px_12px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 4px 12px rgba(0,0,0,.5);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\: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)}html[data-color-scheme=dark] .dark\:shadow-subtle{--tw-shadow: 0 0 2px 0 rgba(0, 0, 0, .05), 0 4px 6px 0 rgba(0, 0, 0, .02);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 4px 6px 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)}html[data-color-scheme=dark] .dark\:shadow-black\/10{--tw-shadow-color: rgb(0 0 0 / .1);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:shadow-super\/5{--tw-shadow-color: oklch(var(--super-color) / .05);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:shadow-white\/5{--tw-shadow-color: rgb(255 255 255 / .05);--tw-shadow: var(--tw-shadow-colored)}html[data-color-scheme=dark] .dark\:\!ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color)) !important}html[data-color-scheme=dark] .dark\:ring-subtle{--tw-ring-color: oklch(var(--foreground-subtle-color))}html[data-color-scheme=dark] .dark\:ring-subtler{--tw-ring-color: oklch(var(--foreground-subtler-color))}html[data-color-scheme=dark] .dark\:ring-super\/80{--tw-ring-color: oklch(var(--super-color) / .8)}html[data-color-scheme=dark] .dark\:ring-white\/10{--tw-ring-color: rgb(255 255 255 / .1)}html[data-color-scheme=dark] .dark\:invert{--tw-invert: invert(100%);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)}:is(html[data-color-scheme=dark] .dark\:\!text-inverse){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}:is(html[data-color-scheme=dark] .dark\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}html[data-color-scheme=dark] .dark\:\!\[--dog-bg-highlight\:white\]{--dog-bg-highlight: white !important}html[data-color-scheme=dark] .dark\:\!\[--dot-bg\:currentColor\]{--dot-bg: currentColor !important}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10 *::-moz-selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10 *::selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:text-super *::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:text-super *::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10::-moz-selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:bg-super\/10::selection{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:selection\:text-super::-moz-selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .dark\:selection\:text-super::selection{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}html[data-color-scheme=dark] .before\:dark\:border-none:before{content:var(--tw-content);border-style:none}html[data-color-scheme=dark] .dark\:before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}html[data-color-scheme=dark] .dark\:before\:shadow-md:before{content:var(--tw-content);--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)}html[data-color-scheme=dark] .dark\:after\:absolute:after{content:var(--tw-content);position:absolute}html[data-color-scheme=dark] .dark\:after\:inset-0:after{content:var(--tw-content);inset:0}html[data-color-scheme=dark] .dark\:after\:rounded-xl:after{content:var(--tw-content);border-radius:.75rem}html[data-color-scheme=dark] .dark\:after\:border:after{content:var(--tw-content);border-width:1px}html[data-color-scheme=dark] .dark\:after\:border-none:after{content:var(--tw-content);border-style:none}html[data-color-scheme=dark] .dark\:after\:border-white\/10:after{content:var(--tw-content);border-color:#ffffff1a}html[data-color-scheme=dark] .after\:dark\:shadow-\[0_0_0_1px_rgba\(255\,255\,255\,0\.1\)_inset\]:after{content:var(--tw-content);--tw-shadow: 0 0 0 1px rgba(255,255,255,.1) inset;--tw-shadow-colored: inset 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)}html[data-color-scheme=dark] .dark\:after\:ring-0:after{content:var(--tw-content);--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)}html[data-color-scheme=dark] .group:hover .dark\:group-hover\:text-inverse{color:oklch(var(--foreground-inverse-color))}:is(html[data-color-scheme=dark] .group:hover .dark\:group-hover\:text-inverse){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}html[data-color-scheme=dark] .group:active .dark\:group-active\:border-subtlest{border-color:oklch(var(--foreground-subtlest-color))}html[data-color-scheme=dark] .aria-selected\:dark\:bg-subtle[aria-selected=true]{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .aria-selected\:dark\:text-foreground[aria-selected=true]{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:data-\[focused\=self\]\:bg-subtler[data-focused=self]{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .group[data-selected=true] .dark\:group-data-\[selected\=\"true\"\]\:bg-super\/10{background-color:oklch(var(--super-color) / .1)}html[data-color-scheme=dark] .dark\:hover\:\!bg-super\/20:hover{background-color:oklch(var(--super-color) / .2)!important}html[data-color-scheme=dark] .dark\:hover\:bg-subtle:hover{background-color:oklch(var(--background-subtle-color))}html[data-color-scheme=dark] .dark\:hover\:bg-white\/5:hover{background-color:#ffffff0d}html[data-color-scheme=dark] .dark\:hover\:text-foreground:hover{color:oklch(var(--foreground-color))}html[data-color-scheme=dark] .dark\:hover\:decoration-super\/80:hover{text-decoration-color:oklch(var(--super-color) / .8)}html[data-color-scheme=dark] .dark\:hover\:data-\[focused\=other\]\:bg-subtler[data-focused=other]:hover{background-color:oklch(var(--background-subtler-color))}html[data-color-scheme=dark] .dark\:focus\:\!ring-super\/50:focus{--tw-ring-color: oklch(var(--super-color) / .5) !important}html[data-color-scheme=dark] .dark\:active\:\!bg-subtle:active{background-color:oklch(var(--background-subtle-color))!important}html[data-color-scheme=dark] .dark\:active\:bg-subtle:active{background-color:oklch(var(--background-subtle-color))}@media (min-width: 768px){html[data-color-scheme=dark] .md\:dark\:block{display:block}html[data-color-scheme=dark] .md\:dark\:border{border-width:1px}html[data-color-scheme=dark] .md\:dark\:bg-subtler{background-color:oklch(var(--background-subtler-color))}}.\[\&\+div\]\:right-3+div{right:.75rem}.\[\&\+p\]\:mt-4+p{margin-top:1rem}.\[\&\.day-range-end\]\:\!bg-super.day-range-end{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\.day-range-end\]\:\!text-inverse.day-range-end{color:oklch(var(--foreground-inverse-color))!important}:is(.\[\&\.day-range-end\]\:\!text-inverse.day-range-end){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}.\[\&\.day-range-end\]\:hover\:\!bg-super:hover.day-range-end,.\[\&\.day-range-start\]\:\!bg-super.day-range-start{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\.day-range-start\]\:\!text-inverse.day-range-start{color:oklch(var(--foreground-inverse-color))!important}:is(.\[\&\.day-range-start\]\:\!text-inverse.day-range-start){--font-thin: var(--font-thin-inverse) !important;--font-extralight: var(--font-extralight-inverse) !important;--font-light: var(--font-light-inverse) !important;--font-normal: var(--font-normal-inverse) !important;--font-semimedium: var(--font-semimedium-inverse) !important;--font-medium: var(--font-medium-inverse) !important;--font-semibold: var(--font-semibold-inverse) !important;--font-bold: var(--font-bold-inverse) !important;--font-extrabold: var(--font-extrabold-inverse) !important;--font-black: var(--font-black-inverse) !important}.\[\&\.day-range-start\]\:hover\:\!bg-super:hover.day-range-start{--tw-bg-opacity: 1 !important;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))!important}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:\:-webkit-inner-spin-button\]\:hidden::-webkit-inner-spin-button{display:none}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:hidden::-webkit-outer-spin-button{display:none}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}.\[\&\: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) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:\[\&\:focus\]\:ring-0: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(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)}}html[data-color-scheme=dark] .dark\:\[\&\:focus\]\:ring-0: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(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)}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-full:has(>.day-range-end){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-full:has(>.day-range-start){border-top-left-radius:9999px;border-bottom-left-radius:9999px}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:.375rem}.\[\&\:has\(\[aria-selected\]\)\]\:bg-superBG:has([aria-selected]){--tw-bg-opacity: 1;background-color:oklch(var(--super-bg-color) / var(--tw-bg-opacity))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-full:has([aria-selected]):first-child{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-full:has([aria-selected]):last-child{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-full:has([aria-selected].day-range-end){border-top-right-radius:9999px;border-bottom-right-radius:9999px}.\[\&\:has\(\[data-initialised\=\"true\"\]\)_\~_\*\:first-child\]\:hidden:has([data-initialised=true])~*:first-child{display:none}.\[\&\:has\(\[data-inline-type\=image\]\)\+\&\:has\(\[data-inline-type\=image\]\)_\[data-inline-type\=image\]\]\:hidden:has([data-inline-type=image])+.\[\&\:has\(\[data-inline-type\=image\]\)\+\&\:has\(\[data-inline-type\=image\]\)_\[data-inline-type\=image\]\]\:hidden:has([data-inline-type=image]) [data-inline-type=image]{display:none}.\[\&\:has\(iframe\)_\:first-child\]\:hidden:has(iframe) :first-child{display:none}.\[\&\:has\(table\)_\[data-inline-type\=image\]\]\:hidden:has(table) [data-inline-type=image]{display:none}.\[\&\:is\(\:hover\,\:focus-visible\,\[data-selected\=\"true\"\]\)\+div\:not\(\:hover\)\:not\(\:focus-visible\)\:not\(\[data-selected\=\"true\"\]\)\]\:border-t-transparent:is(:hover,:focus-visible,[data-selected=true])+div:not(:hover):not(:focus-visible):not([data-selected=true]){border-top-color:transparent}.\[\&\:is\(\:hover\,\:focus-visible\,\[data-selected\=\"true\"\]\)\+div\:not\(\:hover\)\:not\(\:focus-visible\)\:not\(\[data-selected\=\"true\"\]\)\]\:transition-none:is(:hover,:focus-visible,[data-selected=true])+div:not(:hover):not(:focus-visible):not([data-selected=true]){transition-property:none}.\[\&\:not\(\:first-child\)\]\:pt-sm:not(:first-child){padding-top:var(--size-sm)}.\[\&\:not\(\:first-child\)\]\:before\:top-\[6px\]:not(:first-child):before{content:var(--tw-content);top:6px}.\[\&\:not\(\:last-child\)\]\:border-b-transparent:not(:last-child){border-bottom-color:transparent}.\[\&\:not\(\:last-child\)\]\:pb-sm:not(:last-child){padding-bottom:var(--size-sm)}.\[\&\:only-child\]\:border-0:only-child{border-width:0px}.\[\&\>\*\:not\(\:first-child\)\]\:border-l>*:not(:first-child){border-left-width:1px}.\[\&\>\*\:not\(\:first-child\)\]\:border-subtle>*:not(:first-child){border-color:oklch(var(--foreground-subtle-color))}.\[\&\>\*\:nth-child\(4\)\]\:hidden>*:nth-child(4){display:none}@media (min-width: 768px){.md\:\[\&\>\*\:nth-child\(4\)\]\:block>*:nth-child(4){display:block}}.\[\&\>\*\]\:pointer-events-auto>*{pointer-events:auto}.\[\&\>\*\]\:ml-0\.5>*{margin-left:.125rem}.\[\&\>\*\]\:size-6>*{width:1.5rem;height:1.5rem}.\[\&\>\*\]\:w-auto>*{width:auto}.\[\&\>\*\]\:w-full>*{width:100%}.\[\&\>\*\]\:flex-1>*{flex:1 1 0%}.\[\&\>\*\]\:grow>*{flex-grow:1}.\[\&\>\*\]\:\!gap-2>*{gap:.5rem!important}.\[\&\>\*\]\:\!self-center>*{align-self:center!important}.\[\&\>\*\]\:p-0>*{padding:0}.\[\&\>button\]\:h-11>button{height:2.75rem}.\[\&\>div\>div\]\:\!pb-xs>div>div{padding-bottom:var(--size-xs)!important}.\[\&\>div\]\:\!block>div{display:block!important}.\[\&\>div\]\:\!hidden>div{display:none!important}.\[\&\>div\]\:h-full>div{height:100%}.\[\&\>div\]\:w-auto>div{width:auto}.\[\&\>div\]\:w-full>div{width:100%}.\[\&\>div\]\:gap-0>div{gap:0px}.\[\&\>div\]\:\!pb-xs>div{padding-bottom:var(--size-xs)!important}.\[\&\>img\]\:max-h-\[unset\]>img{max-height:unset}.\[\&\>img\]\:\!rounded-full>img{border-radius:9999px!important}.\[\&\>p\]\:\!m-0>p{margin:0!important}.\[\&\>p\]\:my-0>p{margin-top:0;margin-bottom:0}.\[\&\>p\]\:mb-2>p{margin-bottom:.5rem}.\[\&\>p\]\:pt-0>p{padding-top:0}.\[\&\>path\]\:stroke-foreground>path{stroke:oklch(var(--foreground-color))}.\[\&\>path\]\:stroke-subtler>path{stroke:oklch(var(--foreground-subtler-color))}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .dark\:\[\&\>path\]\:stroke-black>path{stroke:#000}:root:not([data-color-scheme=light]) .dark\:\[\&\>path\]\:stroke-1>path{stroke-width:1}}html[data-color-scheme=dark] .dark\:\[\&\>path\]\:stroke-black>path{stroke:#000}html[data-color-scheme=dark] .dark\:\[\&\>path\]\:stroke-1>path{stroke-width:1}.\[\&_\*\]\:fill-quiet *{fill:oklch(var(--foreground-quiet-color))}.\[\&_\*\]\:\!text-sm *{font-size:.875rem!important;line-height:1.25rem!important}.\[\&_\*\]\:\!font-normal *{font-weight:400!important}.\[\&_\*\]\:\!text-foreground *{color:oklch(var(--foreground-color))!important}.\[\&_\*\]\:\!font-normal *{font-weight:var(--font-normal)!important}.\[\&_\>\*\:first-child\]\:mt-0>*:first-child{margin-top:0}.\[\&_\>div\]\:min-h-0>div{min-height:0px}.\[\&_\[contenteditable\]\+\*\>\*\]\:opacity-80 [contenteditable]+*>*{opacity:.8}.\[\&_\[contenteditable\]\]\:max-h-none [contenteditable]{max-height:none}.\[\&_\[contenteditable\]\]\:\!overflow-hidden [contenteditable]{overflow:hidden!important}.\[\&_\[contenteditable\]\]\:\!bg-transparent [contenteditable]{background-color:transparent!important}.\[\&_\[contenteditable\]\]\:\!font-display [contenteditable]{font-family:var(--font-fk-grotesk),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"!important}@media (min-width: 640px){.\[\&_\[contenteditable\]\]\:sm\:max-h-none [contenteditable]{max-height:none}}@media (min-width: 1024px){.\[\&_\[contenteditable\]\]\:lg\:max-h-none [contenteditable]{max-height:none}}.\[\&_a\]\:bg-subtle a{background-color:oklch(var(--background-subtle-color))}.\[\&_a\]\:text-foreground a{color:oklch(var(--foreground-color))}.\[\&_a\]\:hover\:bg-subtle:hover a{background-color:oklch(var(--background-subtle-color))}.\[\&_a\]\:hover\:bg-subtler:hover a{background-color:oklch(var(--background-subtler-color))}.\[\&_blaze-widget-layout\]\:p-0 blaze-widget-layout{padding:0}.\[\&_button\]\:\!border-dashed button{border-style:dashed!important}.\[\&_button\]\:bg-inverse button{--tw-bg-opacity: 1;background-color:oklch(var(--background-inverse-color) / var(--tw-bg-opacity))}.\[\&_canvas\]\:relative canvas{position:relative}.\[\&_canvas\]\:size-full canvas{width:100%;height:100%}.\[\&_code\]\:max-h-\[300px\] code{max-height:300px}.\[\&_code\]\:overflow-auto code{overflow:auto}.\[\&_h1\:first-of-type\]\:mt-8 h1:first-of-type{margin-top:2rem}.\[\&_h2\:first-of-type\]\:mt-6 h2:first-of-type{margin-top:1.5rem}.\[\&_img\]\:pointer-events-none img{pointer-events:none}.\[\&_input\]\:pl-7 input{padding-left:1.75rem}.\[\&_input\]\:pl-8 input{padding-left:2rem}.\[\&_input\]\:pl-9 input{padding-left:2.25rem}.\[\&_input\]\:pl-\[30px\] input{padding-left:30px}.\[\&_input\]\:pr-sm input{padding-right:var(--size-sm)}.\[\&_p\]\:font-sans p{font-family:var(--font-fk-grotesk-neue),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",Hiragino Sans,PingFang SC,Apple SD Gothic Neo,Yu Gothic,Microsoft YaHei,Microsoft JhengHei,Meiryo}.\[\&_p\]\:\!text-sm p{font-size:.875rem!important;line-height:1.25rem!important}.\[\&_p\]\:text-lg p{font-size:1.125rem;line-height:1.75rem}.\[\&_p\]\:font-medium p{font-weight:500}.\[\&_p\]\:leading-\[1\.6\] p{line-height:1.6}.\[\&_p\]\:text-foreground p{color:oklch(var(--foreground-color))}.\[\&_p\]\:font-medium p{font-weight:var(--font-medium)}.\[\&_path\]\:fill-foreground path{fill:oklch(var(--foreground-color))}.\[\&_path\]\:\!stroke-quiet path{stroke:oklch(var(--foreground-quiet-color))!important}.\[\&_rect\]\:fill-inverse rect{fill:oklch(var(--foreground-inverse-color))}.\[\&_span\]\:flex span{display:flex}.\[\&_span\]\:size-4 span{width:1rem;height:1rem}.\[\&_strong\:has\(\+br\)\]\:inline-block strong:has(+br){display:inline-block}.\[\&_strong\:has\(\+br\)\]\:pb-2 strong:has(+br){padding-bottom:.5rem}.\[\&_svg\]\:h-auto svg{height:auto}.\[\&_svg\]\:h-full svg{height:100%}.\[\&_svg\]\:w-auto svg{width:auto}.\[\&_svg\]\:w-full svg{width:100%}.\[\&_svg\]\:\!text-super svg{--tw-text-opacity: 1 !important;color:oklch(var(--super-color) / var(--tw-text-opacity))!important}.\[\&_svg\]\:transition-colors svg{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\[\&_svg\]\:duration-quick svg{transition-duration:75ms;animation-duration:75ms}.hover\:\[\&_svg\]\:text-super svg:hover{--tw-text-opacity: 1;color:oklch(var(--super-color) / var(--tw-text-opacity))}.\[\&_textarea\]\:bg-subtle textarea{background-color:oklch(var(--background-subtle-color))}.\[\&_textarea\]\:bg-subtler textarea{background-color:oklch(var(--background-subtler-color))}.\[\&_textarea\]\:bg-transparent textarea{background-color:transparent}.\[\&_textarea\]\:\!placeholder-quietest textarea::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:\!placeholder-quietest textarea::placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:placeholder\:\!text-quietest textarea::-moz-placeholder{color:oklch(var(--foreground-quietest-color))!important}.\[\&_textarea\]\:placeholder\:\!text-quietest textarea::placeholder{color:oklch(var(--foreground-quietest-color))!important}@media (prefers-color-scheme: dark){:root:not([data-color-scheme=light]) .\[\&_textarea\]\:dark\:\!bg-transparent textarea{background-color:transparent!important}}html[data-color-scheme=dark] .\[\&_textarea\]\:dark\:\!bg-transparent textarea{background-color:transparent!important}.\[\&_tr\>td\:first-child\]\:pl-md tr>td:first-child{padding-left:var(--size-md)}.\[\&_tr\>td\:last-child\]\:pr-md tr>td:last-child{padding-right:var(--size-md)}.\[\&_tr\>th\:first-child\]\:pl-md tr>th:first-child{padding-left:var(--size-md)}.\[\&_tr\>th\:last-child\]\:pr-md tr>th:last-child{padding-right:var(--size-md)}@media (hover:hover){.\[\@media\(hover\:hover\)\]\:hover\:bg-super:hover{--tw-bg-opacity: 1;background-color:oklch(var(--super-color) / var(--tw-bg-opacity))}.\[\@media\(hover\:hover\)\]\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (prefers-color-scheme: dark){@media (hover:hover){:root:not([data-color-scheme=light]) .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover{color:oklch(var(--foreground-inverse-color))}:is(:root:not([data-color-scheme=light]) .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}}}@media (hover:hover){html[data-color-scheme=dark] .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover{color:oklch(var(--foreground-inverse-color))}:is(html[data-color-scheme=dark] .dark\:\[\@media\(hover\:hover\)\]\:hover\:text-inverse:hover){--font-thin: var(--font-thin-inverse);--font-extralight: var(--font-extralight-inverse);--font-light: var(--font-light-inverse);--font-normal: var(--font-normal-inverse);--font-semimedium: var(--font-semimedium-inverse);--font-medium: var(--font-medium-inverse);--font-semibold: var(--font-semibold-inverse);--font-bold: var(--font-bold-inverse);--font-extrabold: var(--font-extrabold-inverse);--font-black: var(--font-black-inverse)}}@media (max-height:680px){.\[\@media\(max-height\:680px\)\]\:hidden{display:none}}@media (max-width:768px){.\[\@media\(max-width\:768px\)\]\:max-w-full{max-width:100%}}hr+.\[hr\+\&\]\:mt-4{margin-top:1rem}td .\[td_\&\]\:table-cell{display:table-cell}.animate-gradient{animation:shine 1.8s linear infinite;background-size:200% auto}@keyframes shine{to{background-position:-400% center}} diff --git a/Ai docs/Perplexity new_files/index-D_VLSpJ3.js.download b/Ai docs/Perplexity new_files/index-D_VLSpJ3.js.download deleted file mode 100644 index 2512846..0000000 --- a/Ai docs/Perplexity new_files/index-D_VLSpJ3.js.download +++ /dev/null @@ -1,1146 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-avoQQ9qh.js","assets/vite-5mULU2Sf.js","assets/agent-5z8MvKWD.js","assets/platform-BgMLKYi3.js","assets/vendors-DV3qWWZf.js","assets/LocationPermissionModal-CJRGUVmC.js","assets/i18n-DQRDcwJs.js","assets/icons-D0b4sn6r.js","assets/react-query-e4IvwtD4.js","assets/platform-components-C5tjHeNv.js","assets/lexical-CQImCj-x.js","assets/mapbox-gl-BYD-OPEL.js","assets/mapbox-gl-B9eh9OLo.css","assets/FileUploadModal-BvFT6lXw.js","assets/capabilities-BVuvQB3C.js","assets/useFileDirectory-NyIQT0xv.js","assets/Progress-BtQ3_JhN.js","assets/CometDownloadInstructionsModal-C-u2fo9U.js","assets/SheetModal-B9rXmJEc.js","assets/CollectionSelectModal-chyGMqqe.js","assets/OnboardingModal-BBLBP53x.js","assets/CombinedPaywall-vVyfz7dZ.js","assets/useNavigateToPayment-Wh_0XmPu.js","assets/usePersistentPromoCode-CzuUT5P5.js","assets/enterpriseTiers-Cc7wc8Fl.js","assets/tierContent-Dgx0R4JX.js","assets/useUserPreviousSubscriptionQuery-CrWBdZig.js","assets/USDSpan-twhxRp5s.js","assets/useStudentTrialEligibility-B0TbIv7G.js","assets/MarkSpinner-DXbfFXdV.js","assets/phoneNumberUtils-BDcRU5bn.js","assets/IntlPhoneInput-DoZ64EHi.js","assets/IntlPhoneInput-C5Iq5FTb.css","assets/AppDownloadQRSkeleton-RkRp7RBK.js","assets/StudentReferralsContent-DoTGsBdC.js","assets/useStudentReferralRewards-D-COI6zW.js","assets/shared-B6GX8pxj.js","assets/PurchaseConfirmationToast-GzPKwh-L.js","assets/EntityItemImage-C1y80NIC.js","assets/use-unmount-effect-CZOTrSO1.js","assets/ThreadLossAversionModal-D7FcWrP_.js","assets/LoginModalInner-DQdxNxqw.js","assets/test-ids-eafHCGHU.js","assets/cleanQueryRedirect-CvRRoh23.js","assets/CompanyDataPrivacyModal-CBquTxiE.js","assets/PricingTableModal-DKTASYyc.js","assets/MapModal-COz1Z29Z.js","assets/Gallery-d2mk-5Z8.js","assets/ShoppingOnboardingModal-CZLUPf2r.js","assets/shared-xM6KejYo.js","assets/shoppingQueries-CbpDikrQ.js","assets/ShoppingPaymentBillingBox-7aqgEzBg.js","assets/ShoppingPaymentInnerV2-C1VZgAoW.js","assets/react-stripe.esm-811PEoJF.js","assets/useStripePromise-lj-Rbxxy.js","assets/useCreateSetupIntentAndCustomerSession-r-pTEMnk.js","assets/ShoppingQuantityRow-BrpBxWdq.js","assets/Shimmer-Z6sujZt4.js","assets/PurchaseDetailsModal-CkTv7i6n.js","assets/SpaceSettingsModal-D32x8BuZ.js","assets/MemoryListModal-3QH1KayA.js","assets/memoryQueries-CL8cFyOl.js","assets/MemoryDetailModal-tGdhFYPy.js","assets/HotelRoomDetailsModal-Bs6UfaTm.js","assets/PaymentModal-DIcb6WXv.js","assets/PaymentPage-BF8dSvTI.js","assets/MeetingDefaultsModal-DJ18fASY.js","assets/AvailabilityModal-B8HOqFPU.js","assets/ProMessageModal--NnvSlnC.js","assets/SubSuccessModal-CEzPkVT6.js","assets/PerksList-BKKe2PhN.js","assets/ReferralErrorModal-D4SrZMEu.js","assets/ReferralSuccessModal-CVtAvfIm.js","assets/IncentiveProModal-B1Baqpf5.js","assets/StudentReferralsModal-CKAfMn6X.js","assets/SheerIDModal-BHYPljec.js","assets/BraintreeSubscriptionModal-2dXzLlVe.js","assets/RestaurantBookingModal-7zq9QxVz.js","assets/PlaceModal-CytEwbsn.js","assets/EntityItemImageFadeCarousel-BkdhRNfv.js","assets/EntityItemReviewSummary-BJySok5l.js","assets/ImageGallery-DtC18vTP.js","assets/SheerIdRedirectModal-BpaodOqj.js","assets/EnterprisePremiumSecureUpgradeModal-DU2i2Qm_.js","assets/ShortcutModal-hkCS-ySA.js","assets/SharepointSiteModal-DEqwxYR7.js","assets/SharepointSiteSelector-Cuy5BYDt.js","assets/MCPServerModal-wufPmNsJ.js","assets/MemberSetTierModal-C5VDUVKx.js","assets/MCPServiceToolsModal-0_CZ4KV7.js","assets/SettingsRow-Dbg4RDov.js","assets/OrgInviteModal-CEe6bRsT.js","assets/OnboardingTOSCheckbox-DHMUQ-a0.js","assets/useSubmitOnboardingProfile-C7MM6x5t.js","assets/RequestAccessModal-CZs8Tpx-.js","assets/SpaceContextModal-CjwpMh-4.js","assets/LoginModal-CfCGpXCO.js","assets/AnnouncementImageModal-CBHVN-fI.js","assets/FullscreenUpsellModal-DNaA4FHU.js","assets/ShoppingTryOnOnboardingModal-D8Kwg3Mf.js","assets/ShoppingTryOnOnboardingComponents-DLAejZUN.js","assets/GeneratedMediaLoader-DrTfsj80.js","assets/useTrackGeneratedAssetView-DZN7Cb6G.js","assets/useShoppingTryOn-ZvBzXc8Y.js","assets/CheckSourcesModal-LvBDDncs.js","assets/GmailModals-D4ZvmFO2.js","assets/EmailAssistantDisconnectWarningModal-DlCptha5.js","assets/CalendarSelectionModal-hTv76Qgh.js","assets/connectorQueries-CIJF5WoR.js","assets/DeleteAllMemoriesModal-Cg09X1Ui.js","assets/DeleteMemoryModal-BXXQVzHz.js","assets/PersonalSearchSettingsMain-CHIO-vMM.js","assets/WatchlistModal-EfLNQ8hw.js","assets/AvatarManagementModal-Dxp419em.js","assets/useGetUserTryOnPhoto-D3VCmnao.js","assets/InstallGateModal-DmQe1ivv.js","assets/DowngradeModal-CpBhw_YR.js","assets/PlanDisplay-DvGyGDWL.js","assets/UpgradeModal-ChNN1wUW.js","assets/SubModalButton-_Knm1my0.js","assets/KeyboardShortcutHelperModal-DNkbHnqh.js","assets/KeyboardShortcutEditorModal-D82pYLUS.js","assets/AskPermissionsModal-D80mi85i.js","assets/DebugStreamSideEffects-CY-uK-QQ.js","assets/DebugDisplay-DVKkb_1m.js","assets/_restricted/restricted-feature-debug-D3x5lJcJ.js","assets/RenderToolbar-CM9FGyO-.js","assets/DebugModeActivator-BYw4GS2i.js","assets/UberOnePromoBanner-CYfGDUlm.js","assets/SiteBanner-DJXVikaa.js","assets/DiscountCodeBanner-l96J_LHj.js","assets/PartnerBanner-BL7xfhwx.js","assets/OrgBillingBanner-F7N-p4UC.js","assets/useOrgBilling-BDB63mka.js","assets/OrgInvitationBanner-CrpdJghk.js","assets/AppBannerUpsell-Bph65qqz.js","assets/CometDownloadBannerUpsell-BTaMxe5H.js","assets/MobileSidebar-C4bvEgiR.js","assets/MicrosoftFilePickerModal-aO6nep6w.js","assets/BoxFilePickerModal--6cVluz-.js","assets/MentionsPlugin-C_MEbdd2.js","assets/AutoLinkPlugin-CfSMttbN.js","assets/LinkPlugin-BKkOS3bN.js","assets/ConnectorsEnableModal-CDHU0y1D.js","assets/VoiceToVoiceModal-BQNxUwE1.js","assets/VoiceToVoiceTopControls-D1mBvJSk.js","assets/useVoiceViewState-CpqlD8o1.js","assets/three-S-EeQeNm.js","assets/index-kR08Osiu.js","assets/SidePDFViewer-B5TcfQVy.js","assets/SearchSideContent-BMG4YjPI.js","assets/SideMeetingTranscriptViewer-B_6wuU1-.js","assets/SlideConverter-DErf2_BF.js","assets/pptxgen.es-RTyDt0G5.js","assets/abap-BiKYM7nu.js","assets/abnf-8KHBl4SU.js","assets/actionscript-BDfgnI_2.js","assets/ada-pT0wE1jT.js","assets/agda-BVgYyS_B.js","assets/al-DYI_knPF.js","assets/antlr4-Dcs8y6-e.js","assets/apacheconf-BeuGc_UW.js","assets/apex-C46QKnqF.js","assets/sql-CJATM1Qp.js","assets/apl-D3CFL3-O.js","assets/applescript-UKM8t7IT.js","assets/aql-JdJXKSA1.js","assets/arduino-Cgk25tM9.js","assets/cpp-BdJVwJpi.js","assets/c-kgVuzdLE.js","assets/arff-BvtRHTjx.js","assets/asciidoc-hH46k-cj.js","assets/asm6502-Ce01JAP9.js","assets/asmatmel-73kokPNV.js","assets/aspnet-DSiaQID1.js","assets/csharp-Cd5Udg29.js","assets/autohotkey-B_uQtKf0.js","assets/autoit-EdcKUAIu.js","assets/avisynth-B5LB8Vdx.js","assets/avro-idl-DFr56LZ2.js","assets/bash-DmK8JH5Y.js","assets/bash-CefCgV5_.js","assets/basic-GQNZVm0I.js","assets/basic-DBS9NaGG.js","assets/batch-q5qLUxNp.js","assets/bbcode-DIQpPCpQ.js","assets/bicep-43qgYCRB.js","assets/birb-WL4Wzs1I.js","assets/bison-DgNGY4MZ.js","assets/bnf-CwU415oh.js","assets/brainfuck-BRUtMqwa.js","assets/brightscript-CvEhDk7S.js","assets/bro-CqltG-l9.js","assets/bsl-DUqbypHr.js","assets/c-N_EB2bYK.js","assets/cfscript-CeuFWGtU.js","assets/chaiscript-YpFdQwm4.js","assets/cil-BTpaFQxw.js","assets/clike-C0ZDHdrY.js","assets/clike-B5tY_8Hg.js","assets/clojure-nHglC_Wr.js","assets/cmake-CkGrNXqP.js","assets/cobol-CpeWJsGx.js","assets/coffeescript-BmyGALDp.js","assets/concurnas-AGPXgTy3.js","assets/coq-B1vh1X6h.js","assets/cpp-BrdR8lzA.js","assets/crystal-DMB1xqN1.js","assets/ruby-DYsn9XfW.js","assets/csharp-Dz-Duhoj.js","assets/cshtml-Dao_x5sm.js","assets/csp-rN0ct5mE.js","assets/css-extras-CH38hCE0.js","assets/css-C3pUjfuw.js","assets/css-CF9HHZb0.js","assets/csv-CMjGkfuc.js","assets/cypher-BSXied6R.js","assets/d-7giuCMwV.js","assets/dart-f2r0fR5P.js","assets/dataweave-BNTQwt_0.js","assets/dax-9u0VVHGx.js","assets/dhall-BnOlrm1O.js","assets/diff-CbyOnxIb.js","assets/django-BoROLrA7.js","assets/markup-templating-BxAVv-bL.js","assets/dns-zone-file-BZz70gag.js","assets/docker-DDluW8dt.js","assets/dot-qujU4Da1.js","assets/ebnf-CcQ_JImo.js","assets/editorconfig-BbwhooPy.js","assets/eiffel-B3J5PQxF.js","assets/ejs-W0BSwUjI.js","assets/elixir-DP_8UBXK.js","assets/elm-iqtDCABP.js","assets/erb-deIh2UEF.js","assets/erlang-4tX_bnUx.js","assets/etlua-CWJxZlBl.js","assets/lua-DER4jxlW.js","assets/excel-formula-BQj21DBh.js","assets/factor-BH7igz5o.js","assets/false-Qh-wnXyD.js","assets/firestore-security-rules-CKhRlNBp.js","assets/flow-DJdu3gfB.js","assets/fortran-BHu4hUHY.js","assets/fsharp-BiNyUor_.js","assets/ftl-D6bVz-y_.js","assets/gap-DjhzPH1Z.js","assets/gcode-DJBtEOur.js","assets/gdscript-C_X-7y6o.js","assets/gedcom-CH5a7-zs.js","assets/gherkin-CLD9Z44w.js","assets/git-DirbeLrE.js","assets/glsl-DwU_K1Bf.js","assets/gml-CQQxmZvv.js","assets/gn-wrWPxerG.js","assets/go-module-CjFP3WFY.js","assets/go-ZYzi8OLl.js","assets/graphql-BcLwhGtH.js","assets/groovy-DumHeXpg.js","assets/haml-CqSzOsbr.js","assets/handlebars-Bry2_rsG.js","assets/haskell-yUNIp-7d.js","assets/haskell-Ds42Eazu.js","assets/haxe-Dp4DyQmv.js","assets/hcl-B5qkLEyl.js","assets/hlsl-DrSY44_J.js","assets/hoon-CkQC4q2d.js","assets/hpkp-riVsYbz6.js","assets/hsts-DpYC61yC.js","assets/http-Dx-uCaT1.js","assets/ichigojam-B7XQrlmu.js","assets/icon-fmySfNA1.js","assets/icu-message-format-Oq1AuWLS.js","assets/idris-BBQY5hR_.js","assets/iecst-BXBc121A.js","assets/ignore-Btt-DzVm.js","assets/inform7-BOWBWzGd.js","assets/ini--jhBb2pg.js","assets/io-D2xfJyua.js","assets/j-DzsdI1Bx.js","assets/java-s-m7kerV.js","assets/java-BxMbkJZ_.js","assets/javadoc-BjkiGsEF.js","assets/javadoclike-myFApC35.js","assets/javadoclike-DCDpBfFy.js","assets/javascript-C5bRWOCC.js","assets/javascript-D8vYUPHd.js","assets/javastacktrace-D8SvwBYG.js","assets/jexl-CuibVysa.js","assets/jolie-G2r1IH4x.js","assets/jq-CSp-T5V6.js","assets/js-extras-DzfpmWre.js","assets/js-templates-deUmuJZ-.js","assets/jsdoc-CzzeaHoB.js","assets/typescript-CVO-8GEc.js","assets/json-DkUPYY4u.js","assets/json-BESjz4hO.js","assets/json5-kaAIKBom.js","assets/jsonp-NFZGtYU-.js","assets/jsstacktrace-z4GMPjy-.js","assets/jsx-CHRn7QrA.js","assets/jsx-CWP8P1mH.js","assets/julia-CtD-2MpL.js","assets/keepalived-CFt0jL3j.js","assets/keyman-B9DoVDwq.js","assets/kotlin-Dq-NDvL5.js","assets/kumir-CJqEisv6.js","assets/kusto-BgQKkaWx.js","assets/latex-BT8SOs-A.js","assets/latte-C8JT4Qb7.js","assets/php-iTdQntIy.js","assets/less-BD_NHSLb.js","assets/lilypond-AQaE6Na0.js","assets/scheme-Cscf027c.js","assets/liquid-y7RSJ3Wl.js","assets/lisp-BC_0scWg.js","assets/livescript-iy-NHZ_h.js","assets/llvm-BfiEgsxO.js","assets/log-cps16LLM.js","assets/lolcode-3zmtClDS.js","assets/lua-DI565xS0.js","assets/magma-ba7Qn7K1.js","assets/makefile-BqSQ4nmN.js","assets/markdown-Cze8MKhj.js","assets/markup-templating-C-QmJhjg.js","assets/markup-Dt-xKA80.js","assets/markup-BONeskWm.js","assets/matlab-CacUYSDq.js","assets/maxscript-Cm15dTB4.js","assets/mel-BFRmaBUW.js","assets/mermaid-_TlUmfQf.js","assets/mizar-BoN7zgqH.js","assets/mongodb-Do1oT-rg.js","assets/monkey-DS3nr7fk.js","assets/moonscript-Cwqh5x__.js","assets/n1ql-BgI_6bQf.js","assets/n4js-oXh14UQA.js","assets/nand2tetris-hdl-CGF6E--X.js","assets/naniscript-Dv0ErN1f.js","assets/nasm-CdhriaSD.js","assets/neon-6Qw1Wpr8.js","assets/nevod-Do308_dN.js","assets/nginx-CioVUANG.js","assets/nim-BiZFPqzz.js","assets/nix-DLWyfiVz.js","assets/nsis-B_mA8Mf4.js","assets/objectivec-CFn4OO_F.js","assets/ocaml-B365KzYr.js","assets/opencl-CPm34rhj.js","assets/openqasm-CDj9ArmH.js","assets/oz-BYXLbj-G.js","assets/parigp-D0QktAhQ.js","assets/parser-qO2_EI6v.js","assets/pascal-De5eNwWX.js","assets/pascaligo-Bf8O7ebQ.js","assets/pcaxis-BcwaB2L7.js","assets/peoplecode-Dk2Gnb3n.js","assets/perl-DRKm4LVK.js","assets/php-extras-DBoPtocT.js","assets/php-BSKv2GXV.js","assets/phpdoc-BJjHK9Yc.js","assets/plsql-Bb_hLNuA.js","assets/powerquery-C5qk80xF.js","assets/powershell-BG0DpRp-.js","assets/processing-w7DFlyH_.js","assets/prolog-B2BVxulM.js","assets/promql-B3KvaVJb.js","assets/properties-BE8Ews0J.js","assets/protobuf-CBHBbdUG.js","assets/psl-aD6jMMeP.js","assets/pug-DI-93Lan.js","assets/puppet-DxN-4n9f.js","assets/pure-_2x0TJjK.js","assets/purebasic-C8Ir77ii.js","assets/purescript-DWCP7Rhr.js","assets/python-B3k5tM49.js","assets/q-LJLqXf0_.js","assets/qml-DgsxaMQP.js","assets/qore-DumyY0ow.js","assets/qsharp-ClAsZa-1.js","assets/r-DHwkVKGw.js","assets/racket-DcBksMCk.js","assets/reason-BXtuBfki.js","assets/regex-Bmn5L_4e.js","assets/rego-CZsdWqMW.js","assets/renpy-XPjsxRDO.js","assets/rest-DD2JcNUu.js","assets/rip-B2ScZnvu.js","assets/roboconf-XMvWjvgI.js","assets/robotframework-BivGgTMI.js","assets/ruby-DQG1k7eY.js","assets/rust-CY08bKn6.js","assets/sas-1PTlKbzw.js","assets/sass-RllDMjGg.js","assets/scala-D1OpbE39.js","assets/scheme-BbtNtDr-.js","assets/scss-DgCxV9gf.js","assets/shell-session-1LvomK4i.js","assets/smali-CXX5Nw4b.js","assets/smalltalk-CkWNQdr2.js","assets/smarty-D9yobX_8.js","assets/sml-CtZ57qc6.js","assets/solidity-CkABSbax.js","assets/solution-file-K7E94G8T.js","assets/soy-CiMQleff.js","assets/sparql-B28RxTei.js","assets/turtle-Ro1R6Je7.js","assets/splunk-spl-w0Cel-ic.js","assets/sqf-BBYZJCt5.js","assets/sql-CwRJh8Sp.js","assets/squirrel-CEzvQBK5.js","assets/stan-S3CZTrL_.js","assets/stylus-BG4_ZnaL.js","assets/swift-ByheDo_6.js","assets/systemd-6CBk_Ow2.js","assets/t4-cs-DHZvgPUG.js","assets/t4-templating-B5EzSFYT.js","assets/t4-templating-DUeWWaCj.js","assets/t4-vb-B_6qRhT8.js","assets/vbnet-BhrUc4aD.js","assets/tap-DjTT3CuE.js","assets/yaml-pHjxJgpq.js","assets/tcl-BM9U6SkZ.js","assets/textile-XOvB5RBz.js","assets/toml-BO0aGyy4.js","assets/tremor-Bk9M5xQH.js","assets/tsx-BcjbSAGh.js","assets/tt2-BHaQqFiG.js","assets/turtle-CdxJK1CJ.js","assets/twig-CxFOkn0v.js","assets/typescript-CVqiKcu1.js","assets/typoscript-spRf2Ox1.js","assets/unrealscript-D2PIC4ZQ.js","assets/uorazor-xrDEXG6p.js","assets/uri-CwPh3EwT.js","assets/v-CJIzMR4B.js","assets/vala-WpTbVsFT.js","assets/vbnet-UNQqH4vF.js","assets/velocity-DsPfPeeX.js","assets/verilog-NpK4_zqq.js","assets/vhdl-DiFKlg1X.js","assets/vim-SyhS9sNH.js","assets/visual-basic-DSiTvEtK.js","assets/warpscript-CTRBwGjg.js","assets/wasm-CBCDYs2M.js","assets/web-idl-BfdeEL3H.js","assets/wiki-CouGhrmq.js","assets/wolfram-CejGEkud.js","assets/wren-BTo1kC3F.js","assets/xeora-mFujPPPh.js","assets/xml-doc-DpZbWR7e.js","assets/xojo-C9xNSycu.js","assets/xquery-C7CsuD6b.js","assets/yaml-DxQv1G_M.js","assets/yang-BXpPxQeP.js","assets/zig-KxZlFBGb.js","assets/core-ChuWtB-i.js","assets/CitationModal-Czu54JG6.js","assets/GroupedCitationModal-iRDkKRir.js","assets/index-Dg6q9Si7.js","assets/katex-CmGQIWW6.js","assets/katex-DIrX_gBg.css","assets/ProgressHeader-C6EaFoVg.js","assets/FinanceScreenshotBuilderModal-BL5wJen7.js","assets/HourlyTemperature-Cb7yWjaM.js","assets/index-CjrpMxgd.js","assets/ConnectorAuthorizationPrompt-W74w80u2.js","assets/ThreadEntryFooter-C2ACX__g.js","assets/StructuredAnswerInlineBlock-CpPS41s5.js","assets/useFailedImagesStore-BWvgqK_c.js","assets/CarouselPrimitives-CVHe36v3.js","assets/useShoppingWidget-BmGcPD6R.js","assets/useInViewEffect-CLWvwq83.js","assets/TimeAgoTooltip-B9EUDf5Y.js","assets/ReportModal-DObKjV8t.js","assets/useUpdateThreadAccess-BLhaI3zl.js","assets/Related-C29vANZf.js","assets/RelatedQueryList-C3FsxSMv.js","assets/index-Blwo1ToS.js","assets/StudyModeRelated-Dy_zxdoW.js","assets/ThreadContentResponse-DxwJeMuW.js","assets/AnswerComparisonModal-DYnELi4M.js","assets/ThreadEntryDebugTiming-qoiCHgUu.js","assets/DebugModal-CnQSSY34.js","assets/ShoppingMode-q3eSRhKN.js","assets/useGenerativeRefinement-DO9SPjVt.js","assets/ModesNullState-D-iHQZlU.js","assets/HotelsMode-rYYctIE3.js","assets/SharedAnswerModeMap-nzYVpPRj.js","assets/JobsMode-JXrdyUQd.js","assets/VideosMode-Hf9Cgtle.js","assets/useMediaSearch-CZXCjoDU.js","assets/ImagesMode-Bcsp5jfV.js","assets/MapsMode-DBIttjNw.js","assets/AssetsMode-7Ja3lHRt.js","assets/VoiceToVoiceContent-BLVFdoql.js","assets/VoiceToVoiceFloating-DZo4d0io.js"])))=>i.map(i=>d[i]); -import{g as mr,P as bU,C as ffe,e as Wa,l as Z,R as yn,n as mfe,p as a7,r as Ft,f as pfe,h as fn,j as i7,k as hfe,m as _U,o as Pl,q as wU,t as $p,v as lo,w as On,S as _a,x as CU,y as gfe,z as l7,A as BS,B as vt,D as Ju,E as SU,$ as Vi,G as Rn,H as yfe,I as EU,J as Pe,F as kU,K as xfe,M as vfe,N as bfe,c as At,O as Ce,Q as Se,T as _fe,U as wfe,u as Qi,V as Cfe,W as Hc,X as Hi,Y as ou,L as yt,Z as Un,_ as Sfe,a0 as Efe,a1 as By,a2 as kfe,a3 as Mfe,a4 as Tfe,a5 as Afe,a6 as Nfe,a7 as Rfe,a8 as Dfe,a9 as jfe,aa as c7,ab as u7,ac as Ife,ad as Pfe,ae as d7,af as f7,ag as MU,ah as Ofe,ai as oM,aj as Lfe,ak as m7,al as Ffe,am as Bfe,an as Ufe,ao as TU,ap as AU,aq as ed,ar as Vfe,as as NU,at as Hfe,a as zfe,au as Wfe,av as Gfe,aw as A0,ax as $fe,ay as p7,b as qfe,az as Kfe}from"./platform-BgMLKYi3.js";import{R as A,r as d,m as wf,j as l,q as Cf,n as Cr,v as Xi,u as Yfe,w as Qfe,x as Xfe,a as aM,_ as Sr,c as qe,o as Ao,y as Zfe,z as Jfe,A as h7,d as z,e as zh,b as RU,h as DU,B as jU,C as eme,t as px,D as tme,E as no,F as Uy,G as Wh,H as Gh,l as nme,I as yd,J as g7,K as rme}from"./vendors-DV3qWWZf.js";import{_ as q,g as uo,c as td,a as $h}from"./vite-5mULU2Sf.js";import{A as he,u as mt,Q as be,c as IU,k as Wl,a as Yt,b as Rt,d as PU,e as iM,P as sme,f as ome}from"./react-query-e4IvwtD4.js";import{c as ame,_ as ime,S as lme,u as sn,s as cme,r as No,a as hx,i as OU,M as ume,b as dme,d as Gl,E as Mr,R as LU,P as fme,C as mme,A as pme,T as hme,I as rn,e as gme,G as yme,f as Vs,g as Sn,h as qp,j as Js,k as Et,l as ls,m as rt,n as fo,o as Sf,p as gx,q as yx,t as Hr,v as xx,w as zc,D as vx,x as lM,y as xme,z as cM,B as Ro,L as Vy,F as bx,H as wa,J as Fo,K as _x,N as uM,O as Bo,Q as vme,U as bme,V as FU,W as wt,X as _me,Y as wme,Z as N0,$ as Cme,a0 as Sme,a1 as dM,a2 as BU,a3 as Eme,a4 as UU,a5 as VU,a6 as kme,a7 as HU,a8 as Mme,a9 as Tme,aa as Ame,ab as Nme,ac as y7,ad as Rme,ae as qh,af as zU,ag as Dme,ah as jme,ai as Ime,aj as fM,ak as WU,al as Pme,am as Ome,an as Lme,ao as Fme}from"./platform-components-C5tjHeNv.js";import{g as GU,D as mM,u as J,d as He,a as US,b as Bme,f as $U,c as W,e as Ume,S as p_,s as Vme,h as Hme,M as je,F as h_,i as x7,j as v7,k as zme,l as VS,m as Wme,n as b7}from"./i18n-DQRDcwJs.js";import{a as Gme,b as pM,d as hM,e as $me,$ as B,I as ut,L as hl,T as ge,f as qme,g as gM,h as Kh,i as Kme,j as Yme,c as ci,k as qU,l as Qme,m as Xme,n as Zme,o as yM,p as KU,q as Jme,r as epe,s as YU,t as QU,u as _7,v as tpe,w as npe,x as rpe,y as spe,z as ope,A as ape,B as ipe,C as lpe,D as cpe,E as upe,F as dpe,G as fpe,H as mpe,J as ppe,K as hpe,M as w7,N as C7,O as gpe,P as XU,Q as ype,R as S7}from"./icons-D0b4sn6r.js";import{p as xpe,u as vpe,A as bpe,R as ZU,L as _pe,j as wpe,a as Cpe,T as gl,I as HS,Z as zS,e as g_,K as gm,t as ym,E as Ta,b as Aa,c as E7,f as y_,d as x_,g as vi,y as Spe,m as Epe,h as kpe,i as Mpe,k as k7,_ as Tpe,l as M7,n as T7,o as xm,q as A7,w as N7,P as Ape,r as Npe,s as Rpe,S as R7,x as D7,v as Dpe,z as jpe,B as Ipe,D as Ppe,C as Ope,F as Lpe,G as Fpe,H as Bpe,M as Upe,J as Vpe,N as Hpe,O as zpe,Q as Wpe}from"./lexical-CQImCj-x.js";import"./mapbox-gl-BYD-OPEL.js";(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 o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const Gpe=["grey","teal","brown","maroon","red","orange","gold","yellow","green","blue","purple"],JU=e=>{if(!e)return null;try{const n=JSON.parse(e)?.name;if(n&&Gpe.includes(n))return n}catch{}return null};function $pe(){const e=mr("colorSchemeTheme"),t=mr("colorScheme"),n=JU(e);n&&(document.documentElement.dataset.theme=n),t&&(document.documentElement.dataset.colorScheme=t)}$pe();const qpe=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,eV=A.memo(()=>(d.useEffect(()=>{const e=t=>{t.ctrlKey&&t.preventDefault()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}},[]),null));eV.displayName="ZoomPreventer";const Cn={DEFAULT:1250,LOW:2500,MEDIUM:5e3,HIGH:1e4,VERY_HIGH:3e4,EXTREMELY_HIGH:9e4,NONE:0},$l=2,Qe=e=>{const t=e?.productionMs??Cn.DEFAULT;e?.devMs??Cn.HIGH;const n=e?.clientSideMs??Cn.MEDIUM;return typeof window<"u"?n:t};function Kpe(e){return ame(e)}const de=ime(Kpe);class R0{static getItem(t){try{return window.localStorage.getItem(t)}catch{return null}}static setItem(t,n){try{return window.localStorage.setItem(t,n),!0}catch{return!1}}}function Ne(){const e=d.useContext(lme);if(!e)throw new Error("useSession must be used within a SessionProvider");return e}class Sc extends bU{name="CometError"}const vm={SELECTED:"SELECTED",REVIEWED:"REVIEWED",REVIEWING:"REVIEWING",UNSORTED:"UNSORTED"},v_={HISTORY:"HISTORY",OPEN_TABS:"OPEN_TABS",RECENTLY_CLOSED_TABS:"RECENTLY_CLOSED_TABS"},xd={COPILOT:"COPILOT",ARTICLE:"ARTICLE",NOTEPAD:"NOTEPAD"},tV={MEETING_TRANSCRIPT:"MEETING_TRANSCRIPT"},Qs={LOGIN:"LOGIN",OPEN_PERMALINK:"OPEN_PERMALINK",DOWNLOAD_COMET:"DOWNLOAD_COMET",CREATE_SHORTCUT:"CREATE_SHORTCUT",UPGRADE_TO_ENTERPRISE:"UPGRADE_TO_ENTERPRISE",WAIT_FOR_CANVAS_GENERATION_CONFIRMATION:"WAIT_FOR_CANVAS_GENERATION_CONFIRMATION",WAIT_FOR_BROWSER_AGENT_CONFIRMATION:"WAIT_FOR_BROWSER_AGENT_CONFIRMATION",DAILY_QUESTIONS_FEATURE_ENTRYPOINTS:"DAILY_QUESTIONS_FEATURE_ENTRYPOINTS"},Ns={IN_THREAD:"IN_THREAD",SIDEBAR:"SIDEBAR",MODAL:"MODAL",IN_THREAD_BOTTOM:"IN_THREAD_BOTTOM",IN_THREAD_INPUT:"IN_THREAD_INPUT",SIDE_CARD:"SIDE_CARD",BANNER:"BANNER",COMET_NTP_BANNER:"COMET_NTP_BANNER"},tn={PRO_UPGRADE:"PRO_UPGRADE",SIGN_UP_OR_LOGIN:"SIGN_UP_OR_LOGIN",REWRITE_ANSWER:"REWRITE_ANSWER",PERMALINK:"PERMALINK",CONNECTOR:"CONNECTOR",THREAD_TO_SPACE:"THREAD_TO_SPACE",SET_DEFAULT_BROWSER:"SET_DEFAULT_BROWSER",COMET_DOWNLOAD:"COMET_DOWNLOAD",IMAGE_ANNOUNCEMENT_MODAL:"IMAGE_ANNOUNCEMENT_MODAL",MERGE_AUTH_CONNECTOR:"MERGE_AUTH_CONNECTOR",SHORTCUT_MODAL:"SHORTCUT_MODAL",OPEN_SHEERID_MODAL:"OPEN_SHEERID_MODAL",CONTINUE_GENERATION:"CONTINUE_GENERATION",NO_CANVAS_GENERATION:"NO_CANVAS_GENERATION",SKIP_BROWSER_AGENT:"SKIP_BROWSER_AGENT",ALLOW_BROWSER_AGENT_ONCE:"ALLOW_BROWSER_AGENT_ONCE",ALWAYS_ALLOW_BROWSER_AGENT:"ALWAYS_ALLOW_BROWSER_AGENT",LANGUAGE_LEARNING_FLASHCARDS:"LANGUAGE_LEARNING_FLASHCARDS",LANGUAGE_LEARNING_VOICE_TUTOR:"LANGUAGE_LEARNING_VOICE_TUTOR",VIRTUAL_TRY_ON_ONBOARDING_MODAL:"VIRTUAL_TRY_ON_ONBOARDING_MODAL",COMET_DOWNLOAD_1MO_PRO_INCENTIVE:"COMET_DOWNLOAD_1MO_PRO_INCENTIVE",TOGGLE_SOURCES:"TOGGLE_SOURCES",FULLSCREEN_MODAL:"FULLSCREEN_MODAL",ALLOW_CONNECTOR_AUTH:"ALLOW_CONNECTOR_AUTH"},bm={PRIMARY_COLOR:"PRIMARY_COLOR",SECONDARY_COLOR:"SECONDARY_COLOR",MAX_COLOR:"MAX_COLOR",INVERTED:"INVERTED"},Pr={STATUS_UNSPECIFIED:"STATUS_UNSPECIFIED",PENDING:"PENDING",COMPLETED:"COMPLETED",FAILED:"FAILED",STAGED:"STAGED",REWRITING:"REWRITING",RESUMING:"RESUMING",BLOCKED:"BLOCKED"},WS={NONE:"NONE",INCOGNITO:"INCOGNITO"},Z2t={FULL:"FULL",STREAMING:"STREAMING"},Jo={IN_PROGRESS:"IN_PROGRESS",DONE:"DONE"},J2t={FINANCE:"FINANCE"},ext={CALENDAR_EVENT:"CALENDAR_EVENT",PLACE_CARD:"PLACE_CARD",SHOPPING_CARD:"SHOPPING_CARD",CALENDAR_ACTION:"CALENDAR_ACTION",MOVIE_TV_CARD:"MOVIE_TV_CARD",BROWSER_AGENT_CONFIRMATION:"BROWSER_AGENT_CONFIRMATION"},aa={SELECTION_STATUS_UNSPECIFIED:"SELECTION_STATUS_UNSPECIFIED",UNSELECTED:"UNSELECTED",SELECTED:"SELECTED",TIE:"TIE"},hs={ANSWER_MODE_TYPE_UNSPECIFIED:"ANSWER_MODE_TYPE_UNSPECIFIED",HOTELS:"HOTELS",SHOPPING:"SHOPPING",JOBS:"JOBS",IMAGE:"IMAGE",VIDEO:"VIDEO",ANSWER:"ANSWER",SOURCES:"SOURCES",MAPS:"MAPS",ASSETS:"ASSETS",APPS:"APPS",SEARCH:"SEARCH",CHAT:"CHAT"},at={CODE_ASSET:"CODE_ASSET",CHART:"CHART",CODE_FILE:"CODE_FILE",APP:"APP",GENERATED_IMAGE:"GENERATED_IMAGE",GENERATED_VIDEO:"GENERATED_VIDEO",PDF_FILE:"PDF_FILE",SLIDES:"SLIDES",DOCX_FILE:"DOCX_FILE",XLSX_FILE:"XLSX_FILE",QUIZ:"QUIZ",FLASHCARDS:"FLASHCARDS",DOC_FILE:"DOC_FILE"},Ype={MCP_SERVER_TYPE_LOCAL:"MCP_SERVER_TYPE_LOCAL"},txt={PENDING:"PENDING"},b_={BROWSER_HISTORY:"BROWSER_HISTORY",OPEN_TAB:"OPEN_TAB",RECENTLY_CLOSED_TAB:"RECENTLY_CLOSED_TAB"};function xM(){const e=Us();return e?!e.device_id:!1}function An(){return!!(Us()&&!xM())}function Do(){const e=Us();return!!(e?.android_version||e?.ios_version)}function nV(){const e=mr(ffe);if(e)try{return JSON.parse(e)}catch{return}}const Us=wf(nV,()=>Math.floor(Date.now()/(6*1e4))),Qpe=(e,t="selected_by_user_text")=>e?` -<${t}> -${new Date(e.timestamp).toLocaleString()} -${e.text} -`:"",Xpe=(e,t,n,r)=>{if(!e)return[];const s=t.actions.getUserSelection(),o=Qpe(s),a=[];if(n.status==="fulfilled"){const i=n.value?.contents||(n.value?.content?[n.value.content]:[]);for(const{markdown:c="",url:u="",title:f="",og_meta:m={},pdp_data:p,id:h}of i){const g=o;a.push({content:[c.slice(0,r-g.length)+g],url:u,title:f,content_type:"markdown",content_origin:"current_tab",og_title:m?.title,og_description:m?.description,pdp_data:p,tab_id:String(h)})}}else a.push({content:[],url:t.sidecarSourceTab.url,title:t.sidecarSourceTab.title,tab_id:String(t.sidecarSourceTab.tabId),content_type:"markdown",content_origin:"current_tab"}),t.sidecarSourceTab.secondaryTab&&a.push({content:[],url:t.sidecarSourceTab.secondaryTab.url,title:t.sidecarSourceTab.secondaryTab.title,tab_id:String(t.sidecarSourceTab.secondaryTab.tabId),content_type:"markdown",content_origin:"current_tab"});return a},Zpe=(e,t,n)=>{const r=[];return e.forEach(s=>{const o=t.status==="fulfilled"&&t.value.contents?.find(a=>a.id===s.id);if(!o){r.push({tab_id:String(s.id),content:[],url:s.url,title:"",content_type:"markdown",content_origin:"open_tab"});return}r.push({tab_id:String(o.id),content:[(o.markdown??"").slice(0,n)],url:o.url??"",title:o.title??"",content_type:"markdown",content_origin:"open_tab",og_title:o.og_meta?.title,og_description:o.og_meta?.description,pdp_data:o.pdp_data})}),r},Jpe=e=>e.map(({url:t,title:n,snippet:r,site_name:s,sitelinks:o})=>({url:t,title:n,snippet:r,is_navigational:!0,site_name:s??null,sitelinks:o?.map(({title:a,url:i,snippet:c})=>({title:a,url:i,snippet:c??null}))??null})),rV=async({clientPayloadCacheKey:e,cometBrowser:t,maxChars:n,includeSidecar:r,attachedTabs:s,reason:o,cometState:a,requestId:i,navigationResults:c=[]})=>{if(!t)return;const u=[],f=new Set,m=Us(),p={contextType:"runtime",queryContextTimeMs:0,processContextTimeMs:0,getNavigationItemsTimeMs:null,filteredItemsCount:null,version:m.browser_version,mainExtVersion:m.agent_extension_version},h=Wa({context_type:p?.contextType,browser_version:p?.version,main_ext_version:p?.mainExtVersion,content_type:p?.contentType});try{Z.info("fetching sidecar context",{request_id:i});const[g,y]=await Promise.allSettled([r?t.GetSidecarContext({key:e,request_id:i}):Promise.resolve(void 0),s.length?t.GetContent({key:e,pages:[...s],request_id:i}):Promise.resolve({contents:[]})]);Xpe(r,a,g,n).forEach(_=>{const w=_.tab_id??"-1";f.has(w)||(f.add(w),u.push(_))}),s.length&&Zpe(s,y,n).forEach(w=>{const S=w.tab_id??"-1";f.has(S)||(f.add(S),u.push(w))}),p.queryContextTimeMs=performance.now()-h.getStartTimeFromTimeOrigin(),Z.info("sending sidecar context",{request_id:i});const{error:v,response:b}=await de.POST("/rest/browser/client_payload",o,{backOffTime:100,numRetries:2,timeoutMs:Cn.HIGH,body:{client_payload_cache_key:e,client_context:u||[],...c.length>0&&{client_search_results:Jpe(c)},metadata:p},headers:{[yn]:i}});if(h.addTiming("browser.client_context.overall_time_ms"),v)throw new he("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:e},cause:v,status:b.status??0})}catch(g){Z.error("Error sending client payload for cache key ",e,g,{request_id:i})}},ehe=async({url:e,cometBrowser:t,stepUuid:n,extraHeaders:r,reason:s})=>{const o=t.openTab({url:e,key:n,request_id:r[yn]});await Ti(o,n,r,s)},Y1=async(e,t,n)=>{try{const{error:r,response:s}=await de.POST("/rest/browser/tool_failure",n,{body:{client_payload_cache_key:e.clientPayloadCacheKey,error_type:e.errorType,error_msg:e.errorMsg},backOffTime:100,numRetries:2,headers:t,timeoutMs:Cn.MEDIUM});if(r)throw new he("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:e.clientPayloadCacheKey},cause:r,status:s.status??0})}catch(r){Z.error("Error while sending a failure of tool",r,{request_id:t[yn]})}},Ti=async(e,t,n,r)=>{try{const s=await e,{error:o,response:a}=await de.POST("/rest/browser/tool_result",r,{body:{client_payload_cache_key:t,payload:s},backOffTime:100,numRetries:2,headers:n,timeoutMs:Cn.MEDIUM});if(o)throw new he("API_CLIENTS_ERROR",{details:{clientPayloadCacheKey:t},cause:o,status:a.status??0})}catch(s){const a=s&&s.message||`sendToolResult error: ${s}`,i="errorType"in s?s:{errorType:"unhandled",errorMsg:a};return Z.error("Error while sending tool result",i.errorType,i.errorMsg,{request_id:n[yn]}),Y1({clientPayloadCacheKey:t,...i},n,r)}},GS={red:"red",maroon:"blue",orange:"cyan",teal:"green",grey:"grey",brown:"orange",green:"pink",gold:"purple",purple:"red",blue:"yellow"},j7=Object.fromEntries(Object.entries(GS).map(([e,t])=>[t,e])),sV=e=>j7[e]??j7.grey;async function the(e,t,n,r,s){const o=Promise.allSettled(e.map(async a=>t.groupTabs({tabIds:a.tab_ids,collapsed:a.collapsed,color:GS[a.color]??GS.grey,groupId:a.group_id,title:a.title},n,r[yn]??"unknown"))).then(a=>({groups:a.map(i=>{if(i.status=="fulfilled"&&i.value.is_success)return{...i.value.tabGroup,color:sV(i.value.tabGroup.color)}}).filter(i=>i!==void 0)}));await Ti(o,n,r,s)}async function nhe(e,t,n,r,s){const o=t.closeTabs({tabIds:e.tab_ids},n,r[yn]??"unknown");await Ti(o,n,r,s)}async function rhe(e,t,n,r,s){const o={[b_.OPEN_TAB]:v_.OPEN_TABS,[b_.RECENTLY_CLOSED_TAB]:v_.RECENTLY_CLOSED_TABS,[b_.BROWSER_HISTORY]:v_.HISTORY},a=e.browser_content_sources.map(c=>o[c]).filter(Boolean),i=t.SearchBrowser({closed_tabs_max_results:e.max_results,history_max_results:e.max_results,open_tabs_max_results:e.max_results,request_id:r[yn]??"unknown",key:n,queries:Array.isArray(e.queries)?[...e.queries]:[],sources:a,start_time:e.start_time?Date.now()-a7(e.start_time):void 0,end_time:e.end_time?Date.now()-a7(e.end_time):void 0});await Ti(i,n,r,s)}async function I7({result:e,key:t,reason:n}){try{await de.POST("/rest/browser/initial_history_summary",n,{body:{key:t,data:e},backOffTime:100,numRetries:2,timeoutMs:Cn.MEDIUM,headers:{"Content-Type":"application/json"}})}catch(r){Z.error("Error sending client payload for cache key ",r)}}function she({entropyBrowser:e,browserHistorySummaryNumDays:t,browserHistorySummaryMaxResults:n,reason:r}){const{addTiming:s}=Wa(),o=crypto.randomUUID();return e.getInitialHistorySummary(o,t,n).then(a=>{s("web.frontend.comet_history_summary_v2"),I7({result:a,key:o,reason:r})}).catch(()=>{I7({result:{open_tabs_results:[],history_results:[],closed_tabs_results:[]},key:o,reason:r})}),o}const ohe=async({entropyBrowser:e,url:t})=>{const n=await e.getQuickActions("get-quick-actions-for-sidecar-suggests");return n.is_success?n.buttons.map(({prompt:r})=>({query:r,image:Kp(t)})):[]},ahe=/^\w+:\/\//;let Q1=null;const ihe=()=>{if(!An()||Q1!==null)return;const e=new Image;e.onerror=()=>{Q1=!1,console.warn("[Comet] chrome://favicon/ is not supported. Using our backend as fallback.")},e.onload=()=>{Q1=!0},e.src="chrome://favicon/"},Kp=(e,t=64,n="3x")=>{if(!Q1)return`https://www.perplexity.ai/rest/browser/favicon?url=${mfe(e)}`;const r=ahe.test(e)?e:`https://${e}`;let s;try{s=decodeURIComponent(r)}catch{s=r}const o=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/'/g,"\\'").replace(/\s/g,"\\ ");return`chrome://favicon/size/${t}@${n}/${o}`},dp=(e,t)=>t.dxt_name?e?.find(n=>n.name===t.dxt_name)?.manifest:void 0,ro=(e,t)=>t?[e,t].sort().join("-"):e.toString(),lhe=(e,t)=>t?[ro(e,t),e.toString(),t.toString()]:[e.toString()],che=["homepage_widget","comet_magic_link","comet_quick_action","comet_selection","try-assistant","comet_assistant_popup","try-assistant-onboarding","spotlight"],vM=e=>e?che.includes(e):!1,uhe={personal_search:!1,skip_search:!1,widget_type:"GENERAL",hide_nav:!1,image_generation:!1,time_widget:!1,hide_sources:!1,mhe_predictions:{skip_search:!1,image_generation_intent:!1,time_widget:!1,sports_intent:!1,places_search_intent:!1,shopping_intent:!1,movie_lists_intent:!1,image_preview:!1,video_preview:!1,nav_intent:!1,study_intent:!1,personal_search:!1,weather_widget:!1,finance_widget_gating:!1,calculator_widget:!1,comet_nav_widget:!1,comet_nav_widget_combined_target:!1},mhe_predictions_full:{skip_search:{is_true:!1,probability:0,threshold:0},image_generation_intent:{is_true:!1,probability:0,threshold:0},time_widget:{is_true:!1,probability:0,threshold:0},sports_intent:{is_true:!1,probability:0,threshold:0},places_search_intent:{is_true:!1,probability:0,threshold:0},shopping_intent:{is_true:!1,probability:0,threshold:0},movie_lists_intent:{is_true:!1,probability:0,threshold:0},image_preview:{is_true:!1,probability:0,threshold:0},video_preview:{is_true:!1,probability:0,threshold:0},nav_intent:{is_true:!1,probability:0,threshold:0},study_intent:{is_true:!1,probability:0,threshold:0},personal_search:{is_true:!1,probability:0,threshold:0},skip_personal_search:{is_true:!1,probability:0,threshold:0},weather_widget:{is_true:!1,probability:0,threshold:0},finance_widget_gating:{is_true:!1,probability:0,threshold:0},calculator_widget:{is_true:!1,probability:0,threshold:0},comet_nav_widget:{is_true:!1,probability:0,threshold:0},comet_nav_widget_combined_target:{is_true:!1,probability:0,threshold:0}}},bM=600,dhe=async(e,t=bM)=>{const{data:n}=await de.POST("/rest/browser/classify","mobile_search_injection",{body:{query:e},timeoutMs:t});return n?.results},oV=e=>!e.isFetching&&e.data===!1,fhe=e=>e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.button===1,aV=({adapter:e,url:t,reason:n,event:r,onError:s,onSuccess:o,tabId:a,navigationHistory:i})=>{if(!fhe(r)){r.preventDefault();{const c=e.getStore().getState().sidecarSourceTab.tabId;mhe({adapter:e,url:t,reason:n,tabId:c,navigationHistory:i??!0});return}}},mhe=({adapter:e,url:t,reason:n,tabId:r,navigationHistory:s})=>{const o=async()=>{if(r===-1)return!1;try{const i=await e.openTab({tabId:r,request_id:n,url:t,navigation_history:s??!0});if(!i.is_success)return!1;const{result:c}=i;return!(c.url!==t&&!c.url?.includes(t))}catch{return!1}};(async()=>{await o()||window.open(t,"_blank")})()},phe=e=>{const t=e.indexOf("/search");return t!==-1?e.substring(t):e},iV="entropy",hhe="browser_ios",ghe="browser_android",lV=()=>{const e=Us();return e?.ios_version?hhe:e?.android_version?ghe:iV},P7=e=>{const t=Math.floor(e.origin.x),n=Math.floor(e.origin.y),r=Math.floor(e.size.width),s=Math.floor(e.size.height);return`${t}-${n}-${r}-${s}`},Ht={tiny:"tiny",small:"small",regular:"regular",large:"large",xl:"xl",none:"none"};var ft;(function(e){e.RETRY_BUTTON="retryButton",e.PRO_PAGE="proPage",e.SHARE_DROPDOWN="shareDropdown",e.PRICING_TABLE="pricingTable",e.TRY_COPILOT="tryCopilot",e.TRY_RESEARCH="tryResearch",e.TRY_LABS="tryLabs",e.PRO_HOVER_CARD_BUTTON="proHoverCardButton",e.PRO_REASONING_SELECTOR="proReasoningSelector",e.LIBRARY_PAGE="libraryPage",e.SPACES_PAGE="spacesPage",e.SPACES_LANDING="spacesLanding",e.SPACES_TEMPLATES="spacesTemplates",e.DISCOVER_TOPICS="discoverTopics",e.COLLECTIONS="collections",e.SPACES="spaces",e.THREAD_SOCIAL="threadSocial",e.MOBILE_SIGNUP="mobileSignup",e.RELATED_QUERIES="relatedQueries",e.FILE_UPLOAD="fileUpload",e.SPACES_FILE_UPLOAD="spacesFileUpload",e.TRY_PRO="tryPro",e.HOMEPAGE_FREE_PLAN_UPSELL="homepageFreePlanUpsell",e.LOGIN_BUTTON="loginButton",e.SIGNUP_BUTTON="signupButton",e.LOGIN_BUTTON_HEADER="loginButtonHeader",e.SIGNUP_BUTTON_HEADER="signupButtonHeader",e.FLOATING_SIGNUP="floatingSignup",e.SIDEBAR_LOGIN_AD="sidebarLoginAd",e.SIDEBAR_PRO_UPSELL="sidebarProUpsell",e.SIDE_TEXT_PRO_UPSELL="sideTextProUpsell",e.VISITOR_GATE="visitorGate",e.SHARED_THREAD_LOGIN_GATE="sharedThreadLoginGate",e.SHARED_THREAD_INSTALL_GATE="sharedThreadInstallGate",e.REQUEST_ACCESS_LOGIN_GATE="requestAccessLoginGate",e.GENERATE_IMAGE="generateImage",e.PPLX_API_PAGE="pplxApiPage",e.FILES_PAGE="filesPage",e.PURCHASES_PAGE="purchasesPage",e.GOOGLE_ONETAP_HOME="oneTapHome",e.GOOGLE_ONETAP_THREAD="oneTapThread",e.GOOGLE_ONETAP_PAGE="oneTapPage",e.GOOGLE_ONETAP_DISCOVER="oneTapDiscover",e.GOOGLE_ONETAP_UNKNOWN="oneTap",e.ONBOARDING="onboarding",e.EMAIL_ASSISTANT_ONBOARDING="emailAssistantOnboarding",e.EMAIL_ASSISTANT_SETTINGS="emailAssistantSettings",e.NEXTAUTH_SIGNIN_PAGE="nextauthSignInPage",e.DISCOUNT_CODE_BANNER="discountCodeBanner",e.PARTNER_CODE="partnerCode",e.ARTICLE_NEW="articleNew",e.THREAD_TO_ARTICLE="threadToArticle",e.ORG_CREATE="orgCreate",e.ORG_PANEL="orgPanel",e.LOSS_AVERSION_MODAL="lossAversionModal",e.NEW_THREAD_BUTTON="newThreadButton",e.NEW_THREAD_SHORTCUT="newThreadShortcut",e.DISCOVER_BUTTON="discoverButton",e.THREAD_BOOKMARK_BUTTON="threadBookmarkButton",e.PAGE_BOOKMARK_BUTTON="pageBookmarkButton",e.DISCOVER_FEED_BOOKMARK_BUTTON="discoverFeedBookmarkButton",e.BACK_TO_SCHOOL="backToSchool",e.WELCOME_BACK="welcomeBack",e.LEFT_HAND_NAV="leftHandNav",e.SETTINGS="settings",e.PRO_FEATURE_LIMIT_BANNER="proFeatureLimitBanner",e.BUY_FROM_MERCHANT_BUTTON="buyFromMerchantButton",e.FINANCE_WATCHLIST="financeWatchlist",e.DOWNLOAD_COMET="downloadComet",e.GROW_COMET="growComet",e.GROW_COMET_AFFILIATE="growCometAffiliate",e.GROW_COMET_STUDENTS="growCometStudents",e.GROW_COMET_STUDENTS_COUNTRY="growCometStudentsCountry",e.PARTNER_COMET="partnerComet",e.COMET_ONBOARDING="cometOnboarding",e.PROMO_REDEMPTION="promoRedemption",e.CONNECTORS_PAGE="connectorsPage",e.MARKETING_LANDING_PAGE="marketingLandingPage",e.FINANCE_TRANSCRIPT="financeTranscript",e.FINANCE_RESEARCH="financeResearch",e.LJJ_LANDING_PAGE="ljjLandingPage",e.STUDENT_REFERRAL_LANDING_PAGE="studentReferralLandingPage",e.VOICE_TO_VOICE_BUTTON="voiceToVoiceButton",e.PRO_PERKS="proPerks",e.REFERRAL_PAGE="referralPage",e.HOTEL_BOOKING_PAGE="hotelBookingPage",e.SOURCES_VIEW_MORE="sourcesViewMore",e.SPORTS_WATCHLIST="sportsWatchlist",e.IMAGE_GENERATION_IN_THREAD="imageGenerationInThread",e.AUTO_UPGRADE_TO_PRO="autoUpgradeToPro",e.UNSPECIFIED_GENERALIZED_UPSELL="unspecifiedGeneralizedUpsell",e.MILESTONE_ACHIEVED="milestoneAchieved",e.PRO_PERKS_PARTNER_PAGE="proPerksPartnerPage",e.STUDENT_LANDING_PAGE="studentLandingPage",e.TASKS_PAGE="tasksPage",e.MAX_URL_PAYWALL="maxUrlPaywall",e.MODEL_SELECTOR="modelSelector",e.DISCOVER_FEED_LIKE_BUTTON="discoverFeedLikeButton",e.DISCOVER_FEED_DISLIKE_BUTTON="discoverFeedDislikeButton",e.DISCOVER_FEED_TASK_WIDGET="discoverFeedTaskWidget",e.SIDEBAR_BOTTOM_POPOVER="sidebarBottomPopover",e.HOME_SIDEBAR="homeSidebar",e.UPGRADE_MODAL="upgradeModal",e.MAX_PAGE="maxPage",e.COMET_INVITE="cometInvite",e.LOGIN_FOR_COMET_AGENT_QUERIES_IN_THREAD="loginForCometAgentQueriesInThread",e.COMET_AGENT_QUERIES_RATE_LIMITED_IN_THREAD="cometAgentQueriesRateLimitedInThread",e.PRO_UPGRADE_IN_SIDE_HOMEPAGE="proUpgradeInSideHomepage",e.MISSING_OUT_ON_PRO_IN_THREAD="missingOutOnProInThread",e.VIDEO_GENERATION_IN_THREAD="videoGenerationInThread",e.RESEARCH_UPSELL_IN_THREAD="researchUpsellInThread",e.STUDENT_VERIFICATION_UPSELL="studentVerificationUpsell",e.STUDENT_VERIFICATION_PAGE="studentVerificationPage",e.TRY_ASSISTANT_BUTTON="tryAssistantButton",e.COMET_NTP="cometNTP",e.EMAIL_ASSISTANT_GATE="emailAssistantGate",e.ENTERPRISE_BILLING_BANNER="enterpriseBillingBanner",e.ENTERPRISE_MAX_UPSELL="enterpriseMaxUpsell",e.CANVAS_GENERATION_IN_THREAD="canvasGenerationInThread",e.BROWSER_AGENT_CONFIRMATION_IN_THREAD="browserAgentConfirmationInThread",e.CLASSROOM_UPLOAD="classroomUpload",e.CLASSROOM_SPACED_REPETITION="classroomSpacedRepetition",e.ENTERPRISE_UPSELL_URL_HANDLER="enterpriseUpsellUrlHandler",e.PREMIUM_SOURCE_TOOLTIP="premiumSourceTooltip"})(ft||(ft={}));var os;(function(e){e[e.OWNER_ONLY=0]="OWNER_ONLY",e[e.PRIVATE_READ=1]="PRIVATE_READ",e[e.PUBLIC_READ=2]="PUBLIC_READ",e[e.PUBLIC_PUBLISHED=3]="PUBLIC_PUBLISHED",e[e.ORG_READ=4]="ORG_READ",e[e.COLLECTION_READ=5]="COLLECTION_READ"})(os||(os={}));var Ld;(function(e){e.SEARCH_V2_NAVIGATE="search_v2_navigate",e.WEB_RESULTS="web_results",e.COMET="comet"})(Ld||(Ld={}));const nxt={default:{termsOfService:"https://www.perplexity.com/hub/legal/terms-of-service",enterpriseTermsOfService:"https://www.perplexity.com/hub/legal/enterprise-terms-of-service",privacyPolicy:"https://www.perplexity.com/hub/legal/privacy-policy"},"ja-JP":{termsOfService:"https://www.perplexity.com/ja/hub/legal/terms-of-service",privacyPolicy:"https://www.perplexity.com/ja/hub/legal/privacy-policy"}},Ec=4e4,cV=2e3,rxt=8e3,yhe=10,sxt=10,xhe=5e3,vhe=50,O7=10,L7=1024*1024,_M=3,wM=500,ql="2.18",bhe="default",CM="windowsapp",_he="ios",whe="android",F7=["audio/midi","audio/x-midi","application/zip","application/x-tar","application/x-bzip","application/vnd.rar"],SM=[".bash",".bat",".c",".coffee",".conf",".config",".cpp",".cs",".css",".csv",".cxx",".dart",".diff",".doc",".docx",".fish",".go",".h",".hpp",".htm",".html",".in",".ini",".ipynb",".java",".js",".json",".jsx",".ksh",".kt",".kts",".latex",".less",".log",".lua",".m",".markdown",".md",".pdf",".php",".pl",".pm",".pptx",".py",".r",".R",".rb",".rmd",".rs",".scala",".sh",".sql",".swift",".t",".tex",".text",".toml",".ts",".tsx",".txt",".xlsx",".xml",".yaml",".yml",".zsh"],uV=SM.join(","),dV=[".jpeg",".jpg",".jpe",".jp2",".png",".gif",".bmp",".tiff",".tif",".svg",".webp",".ico",".avif",".heic",".heif"],fV=[".mp3",".wav",".aiff",".ogg",".flac",".mp4",".mpeg",".mov",".avi",".flv",".mpg",".webm",".wmv",".3gp"],Che=dV.join(","),mV=[...SM,...dV],She=mV.join(","),Ehe=[...SM,...fV],khe=Ehe.join(","),Mhe=[...mV,...fV],The=Mhe.join(","),oxt="",axt=os.PUBLIC_READ,ixt=os.PRIVATE_READ,B7=os.PRIVATE_READ,lxt="https://chrome.google.com/webstore/detail/perplexity-ai-search/bnaffjbjpgiagpondjlnneblepbdchol",cxt="https://pplx.ai/mac",uxt="https://www.perplexity.com/comet",EM="login-source",U7="login-new",Ahe=4,V7="pplx.tracked_singular_user_subscribed_paying",H7="pplx.tracked_singular_user_subscribed_paying_enterprise",pV=5,dxt="/static/images/file-search-upsell-demo.png",fxt="file-search-upsell-demo",hV="/static/images/data-connectors/factset/factset-avatar.svg",gV="FactSet",yV="/static/images/data-connectors/crunchbase/crunchbase-avatar.svg",Nhe="Crunchbase",Fd="/static/images/data-connectors/wiley/wiley-avatar.svg",Rhe="Wiley API",xV="Wiley",kM="/static/images/data-connectors/cbinsights/cbinsights-avatar.svg",vV="CB Insights",MM="/static/images/data-connectors/pitchbook/pitchbook-avatar.svg",bV="PitchBook",TM="/static/images/data-connectors/statista/statista-avatar.svg",_V="Statista",Dhe="Finance",AM="/static/images/data-connectors/google/google-drive-avatar.svg",wV="/static/images/data-connectors/google/gmail-avatar.svg",jhe="Gmail",NM="Google Drive",wx="/static/images/data-connectors/google/gcal-gmail-avatar.svg",CV="Gmail with Calendar",D0="Microsoft",RM="/static/images/data-connectors/microsoft/onedrive-avatar.svg",DM="OneDrive",jM="/static/images/data-connectors/microsoft/sharepoint-avatar.svg",IM="SharePoint",PM="/static/images/data-connectors/dropbox/dropbox-avatar.svg",OM="Dropbox",Cx="/static/images/data-connectors/box/box-avatar.svg",LM="Box",Sx="/static/images/data-connectors/notion/notion-avatar.svg",FM="Notion",Ex="/static/images/data-connectors/linear/linear-avatar.svg",BM="Linear",kx="/static/images/data-connectors/slack/slack-avatar.svg",UM="Slack (deprecated)",VM="Slack",Mx="/static/images/data-connectors/github/github-avatar.svg",HM="GitHub",Tx="/static/images/data-connectors/asana/asana-avatar.svg",Bd="Asana",Ax="/static/images/data-connectors/atlassian/atlassian-avatar.svg",zM="Atlassian",WM="/static/images/data-connectors/jira/jira-avatar.svg",GM="Jira",$M="/static/images/data-connectors/confluence/confluence-avatar.svg",qM="Confluence",KM="/static/images/data-connectors/microsoft/teams-avatar.svg",YM="Microsoft Teams",SV="submit-query",nd="search-model-change",yl="source-selection-change",z7="panel-visibility",EV="windows-app",mxt=EV,pxt="If4YwAeizGHdB3eOhX2JxYcjeCgy0N9c",Yp=`${EV}/ask/input`,hxt="https://dl.todesktop.com/25020447d4kq915",__="pplx.windowsApp.microphonePermission",Ihe={silenceThreshold:30,silenceDuration:5e3},Hy="pplx.upload-privacy-accepted",kV=["answer_modes","media_items","knowledge_cards","inline_entity_cards","place_widgets","finance_widgets","prediction_market_widgets","sports_widgets","flight_status_widgets","news_widgets","shopping_widgets","jobs_widgets","search_result_widgets","inline_images","inline_assets","placeholder_cards","diff_blocks","inline_knowledge_cards","entity_group_v2","refinement_filters","canvas_mode","maps_preview","answer_tabs","price_comparison_widgets","preserve_latex","in_context_suggestions"],W7=["google_drive","onedrive","sharepoint","dropbox","box"],MV=["google_drive","onedrive","sharepoint","dropbox","box"],TV="Outlook",QM="/static/images/data-connectors/microsoft/outlook-avatar.svg",XM="Zoom",ZM="/static/images/data-connectors/zoom/zoom-avatar.svg",gxt="org-upgrade-in-progress";function Phe(e){const t=new Uint8Array(e);return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("")}async function Ohe(e){const n=new TextEncoder().encode(e);return await crypto.subtle.digest("SHA-256",n)}async function AV(e){const t=await Ohe(e);return Phe(t)}async function Lhe(e){return`match_${await AV(e)}`}const Fhe=async({reason:e})=>{try{const{data:t,error:n}=await de.POST("/rest/attribution/comet/session",e,{timeoutMs:Qe(),numRetries:1});if(n)throw n;return{success:t.success}}catch(t){return Z.error("Failed to start Comet session",t),{success:!1}}},Bhe=async({eventName:e,reason:t})=>{try{const{data:n,error:r}=await de.POST("/rest/attribution/comet/event/{event_name}",t,{timeoutMs:Qe(),params:{path:{event_name:e}}});if(r)throw r;return{success:n?.success??!1}}catch(n){return Z.error("Failed to send Comet event",n),{success:!1}}},NV=Ft("SingularAttributionContext",{sendQueryEventSingular:()=>Promise.resolve(),maybeSendNthQueryEventSingular:()=>Promise.resolve(),sendSubscribedEventSingular:()=>Promise.resolve(),sendAppDownloadClickedEventSingular:()=>Promise.resolve(),sendResurrectedActivationEventSingular:()=>Promise.resolve(),sendCometDownloadPageLoadEventSingular:()=>Promise.resolve(),sendCometDownloadPageSignInEventSingular:()=>Promise.resolve(),sendCometDownloadedEventSingular:()=>Promise.resolve(),sendCometDownloadButtonClickedEventSingular:()=>Promise.resolve(),sendCometWaitlistButtonClickedEventSingular:()=>Promise.resolve(),sendCometDownloadLinkEmailEventSingular:()=>Promise.resolve(),sendSubscribedMaxEventSingular:()=>Promise.resolve(),sendAssistantConnectorClickedEventSingular:()=>Promise.resolve(),sendEmailAssistantTrialEnrolledEventSingular:()=>Promise.resolve(),sendAssistantPaywallPageVisitEventSingular:()=>Promise.resolve(),sendAssistantStartFreeTrialClickedEventSingular:()=>Promise.resolve(),sendAssistantUpgradeToMaxClickedEventSingular:()=>Promise.resolve(),sendAssistantUpgradeToProClickedEventSingular:()=>Promise.resolve(),sendAssistantPaywallDismissedEventSingular:()=>Promise.resolve(),sendAssistantConnectPageVisitEventSingular:()=>Promise.resolve(),sendAssistantGreetingPageVisitEventSingular:()=>Promise.resolve(),sendAssistantCalendarSelectionPageVisitEventSingular:()=>Promise.resolve(),sendAssistantTimeSettingsPageVisitEventSingular:()=>Promise.resolve(),sendAssistantAutoLabelPageVisitEventSingular:()=>Promise.resolve(),sendAssistantAutoDraftPageVisitEventSingular:()=>Promise.resolve(),sendAssistantCompletePageVisitEventSingular:()=>Promise.resolve(),sendAssistantOnboardingEmailSentEventSingular:()=>Promise.resolve(),sendStudyHubPageVisitedEventSingular:()=>Promise.resolve(),sendChatWithTutorClickedEventSingular:()=>Promise.resolve(),sendPracticeQuestionsClickedEventSingular:()=>Promise.resolve(),sendStudyGuideClickedEventSingular:()=>Promise.resolve(),sendFlashcardsClickedEventSingular:()=>Promise.resolve(),sendOnePagerClickedEventSingular:()=>Promise.resolve(),sendSpacedRepetitionClickedEventSingular:()=>Promise.resolve(),sendMaterialsUploadedEventSingular:()=>Promise.resolve(),sendStudyHubActivatedEventSingular:()=>Promise.resolve(),sendThirdStudyHubEngagementEventSingular:()=>Promise.resolve(),sendFifthStudyHubEngagementEventSingular:()=>Promise.resolve(),sendTenthStudyHubEngagementEventSingular:()=>Promise.resolve(),setMatchIdWithEmail:()=>Promise.resolve()}),G7={1:"activated",3:"true activated",5:"quality activated",10:"super activated"},$7={1:"first comet query",3:"third comet query"},Uhe="ai.testing.perplexity",Vhe="ai.perplexity",RV=async(e,t)=>{if(!e)return null;const n=new Date;n.setMilliseconds(0);const r=`${e}-${n.toISOString()}-${t}`;return await AV(r)},Hhe="perplexity_ai_039eb8fb",zhe="1e0179ca95965b57a3e91c1cf3049b64",Whe=async({productId:e,visitorId:t,userId:n})=>{const{SingularConfig:r,singularSdk:s}=await q(async()=>{const{SingularConfig:c,singularSdk:u}=await import("./singular-sdk-C08EBV6K.js").then(f=>f.s);return{SingularConfig:c,singularSdk:u}},[]),o=new r(Hhe,zhe,e);n&&o.withCustomUserId(n),s.init(o);const a="initialized singular",i=await RV(t,a);return s.event(a,{visitorId:t,eventId:i}),s},Ghe=({children:e})=>{const{session:t}=Ne(),n=mr(pfe),{env:{isProduction:r,isStaging:s},device:{isMobile:o}}=sn(),a=d.useRef([]),i=d.useRef([]),c=fn(),[u,f]=d.useState(void 0);d.useEffect(()=>{const y=t?.user?.id,x=r||s?Vhe:Uhe;n&&Whe({userId:y,productId:x,visitorId:n}).then(v=>{!v||(f({sdk:v}),!y||!An())||i7()>1||Fhe({reason:"comet attribution"})})},[r,s,t?.user?.id,n]);const m=d.useCallback(async(y,x)=>{if(!u){a.current.push({name:y,extraArguments:x});return}if(!n)return;const v=await RV(n,y),b={...x,visitorId:n,eventId:v,isMobile:o};i.current.includes(y)||(u.sdk.event(y,b),i.current.push(y))},[u,n,o]),p=d.useCallback(async({isCometBrowser:y})=>{const x=hfe(),v=i7(),b=_U();x&&G7[x]&&await m(G7[x]),v&&$7[v]&&await m($7[v]),y&&b===1&&Bhe({eventName:"activated",reason:"comet attribution"})},[m]),h=d.useCallback(async y=>{if(!u)return;const x=await Lhe(y);u.sdk.setMatchID(x)},[u]),g=d.useCallback(async y=>{await m("user sign in",{isNewUser:y}),t?.user?.id&&u&&u.sdk.login(t.user.id)},[t?.user?.id,u,m]);return d.useEffect(()=>{u&&a.current.length>0&&(a.current.filter((x,v,b)=>v===b.findIndex(_=>_.name===x.name)).forEach(({name:x,extraArguments:v})=>{m(x,v)}),a.current=[])},[u,m]),d.useEffect(()=>{if(c?.get(EM)&&c?.get(U7)){const y=c?.get(U7)==="true";g(y),y?(m("new user sign in"),t?.user?.email&&h(t.user.email)):m("existing user sign in"),An()&&m("comet user sign in")}},[c,g,m,t?.user?.email,h]),d.useEffect(()=>{t?.user?.subscription_tier&&t?.user?.payment_tier==="paid"&&(R0.getItem(V7)||(m("user subscribed paying"),R0.setItem(V7,"true")),t?.user?.subscription_source==="enterprise"&&!R0.getItem(H7)&&(m("user subscribed paying enterprise"),R0.setItem(H7,"true")))},[t?.user?.subscription_tier,t?.user?.payment_tier,t?.user?.subscription_source,m]),l.jsx(NV.Provider,{value:d.useMemo(()=>({sendQueryEventSingular:()=>m("query submitted"),maybeSendNthQueryEventSingular:p,sendSubscribedEventSingular:()=>m("user subscribed"),sendAppDownloadClickedEventSingular:y=>m("app download button clicked",{origin:y}),sendResurrectedActivationEventSingular:()=>m("resurrected activated"),sendCometDownloadPageLoadEventSingular:y=>m(`${y} page loaded`),sendCometDownloadPageSignInEventSingular:y=>m(`${y} page signed in`),sendCometDownloadedEventSingular:()=>m("download-comet comet downloaded"),sendCometDownloadButtonClickedEventSingular:y=>m(`${y} download button clicked`),sendCometWaitlistButtonClickedEventSingular:y=>m(`${y} waitlist button clicked`),sendCometDownloadLinkEmailEventSingular:y=>m(`${y} send download link`),sendSubscribedMaxEventSingular:()=>m("user subscribed max"),sendAssistantConnectorClickedEventSingular:y=>m("assistant connector clicked",{connectorType:y}),sendEmailAssistantTrialEnrolledEventSingular:()=>m("email assistant trial enrolled"),sendAssistantPaywallPageVisitEventSingular:()=>m("assistant paywall page visit"),sendAssistantStartFreeTrialClickedEventSingular:()=>m("assistant start trial clicked"),sendAssistantUpgradeToMaxClickedEventSingular:()=>m("assistant upgrade max clicked"),sendAssistantUpgradeToProClickedEventSingular:()=>m("assistant upgrade pro clicked"),sendAssistantPaywallDismissedEventSingular:()=>m("assistant paywall dismissed"),sendAssistantConnectPageVisitEventSingular:()=>m("assistant connect page visit"),sendAssistantGreetingPageVisitEventSingular:()=>m("assistant greeting page visit"),sendAssistantCalendarSelectionPageVisitEventSingular:()=>m("assistant cal selection visit"),sendAssistantTimeSettingsPageVisitEventSingular:()=>m("assistant time settings visit"),sendAssistantAutoLabelPageVisitEventSingular:()=>m("assistant auto label page visit"),sendAssistantAutoDraftPageVisitEventSingular:()=>m("assistant auto draft page visit"),sendAssistantCompletePageVisitEventSingular:()=>m("assistant complete page visit"),sendAssistantOnboardingEmailSentEventSingular:()=>m("assistant onboarding email sent"),sendStudyHubPageVisitedEventSingular:()=>m("study hub page visited"),sendChatWithTutorClickedEventSingular:()=>m("chat with tutor clicked"),sendPracticeQuestionsClickedEventSingular:()=>m("practice questions clicked"),sendStudyGuideClickedEventSingular:()=>m("study guide clicked"),sendFlashcardsClickedEventSingular:()=>m("flashcards clicked"),sendOnePagerClickedEventSingular:()=>m("one pager clicked"),sendSpacedRepetitionClickedEventSingular:()=>m("spaced repetition clicked"),sendMaterialsUploadedEventSingular:()=>m("materials uploaded"),sendStudyHubActivatedEventSingular:()=>m("study hub activated"),sendThirdStudyHubEngagementEventSingular:()=>m("third study hub engagement"),sendFifthStudyHubEngagementEventSingular:()=>m("fifth study hub engagement"),sendTenthStudyHubEngagementEventSingular:()=>m("tenth study hub engagement"),setMatchIdWithEmail:h}),[m,p,h]),children:e})},JM=()=>{const e=d.useContext(NV);if(!e)throw new Error("useSingularAttribution must be used within SingularAttributionContext");return e};let Mu;async function DV(){return Mu||(Mu=new Promise(e=>{const t=new URL("/ws",window.location.origin);t.protocol="wss:";const n=new WebSocket(t);n.addEventListener("error",()=>{try{n.close()}finally{Mu=void 0}}),n.addEventListener("close",()=>{Mu=void 0}),n.addEventListener("open",()=>{e(n)})}),Mu)}const $he="/rest/event/analytics";function jV(e){return typeof navigator.sendBeacon!="function"?!1:navigator.sendBeacon($he,new Blob([JSON.stringify(e)],{type:"application/json; charset=UTF-8"}))}function IV(){const e={};try{navigator.hardwareConcurrency&&(e.hardwareConcurrency=navigator.hardwareConcurrency);const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const r=n[3];r&&(e.architecture=r),globalThis.screen.colorDepth&&(e.colorDepth=globalThis.screen.colorDepth),globalThis.screen.width&&globalThis.screen.height&&(e.screenSize=`${globalThis.screen.width}x${globalThis.screen.height}`)}catch{}return e}const qhe=IV(),Khe=768,Yhe=`(max-width: ${Khe}px)`;function Qhe(){return typeof window>"u"?!1:window.matchMedia(Yhe).matches}function Xhe(){return Qhe()?"mweb":"web"}const Zhe=(e={},t)=>{const n=Date.now(),r=Xhe(),s={...e,isStandaloneApp:!1,timestamp:n,isBrowserExtension:!1,timeZone:mM,isPro:t?.subscription_status&&t?.subscription_status!=="none",userId:t?.id,deviceInfo:qhe,web_platform:r},o=globalThis.location.pathname+globalThis.location.search,a=!!getComputedStyle(document.documentElement).getPropertyValue("--arc-palette-title"),i=IV();let c;return s.internalReferrer?c=s.internalReferrer:c=document.referrer,(globalThis.matchMedia("(display-mode: standalone)").matches||globalThis.matchMedia("(display-mode: minimal-ui)").matches||globalThis.navigator?.standalone)&&(s.isStandaloneApp=!0),{eventData:s,pathnameAndParams:o,isArcBrowser:a,deviceInfo:i,referrer:c}};function PV(e){const{name:t,data:n,user:r,source:s}=e,{eventData:o,pathnameAndParams:a,deviceInfo:i,referrer:c,isArcBrowser:u}=Zhe(n,r);return a.startsWith("/search/render")?void 0:{event_name:t,event_data:o,url:a,referrer:c,language:GU(),screen:Nx(),hostname:globalThis.location.hostname,device_info:i,is_arc_browser:u,source:s}}function Li(e){const t=PV(e);t&&(jV(t)||(Pl("web.browser.analytics.send_event_failed"),DV().then(n=>{n.send(JSON.stringify(t))})))}function Jhe(e){const t=e.map(n=>PV(n)).filter(n=>n!==void 0);t.length!==0&&(jV(t)||(Pl("web.browser.analytics.send_event_failed"),DV().then(n=>{n.send(JSON.stringify(t))})))}function Nx(){return`${globalThis.screen.width}x${globalThis.screen.height}`}const ege=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)")?.matches?"dark":"light";function tge(){const[e,t]=d.useState(ege);return d.useEffect(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)"),r=s=>{t(s.matches?"dark":"light")};return n?.addEventListener("change",r),()=>{n?.removeEventListener("change",r)}},[]),e}const e4=Ft("ColorSchemeContext",null),w_="colorScheme",OV=A.memo(function({children:t,initialOverrideColorScheme:n}){const r=tge(),{value:s,refetch:o}=wU(w_),[a,i]=d.useState(n),c=d.useMemo(()=>Cf(p=>{const h=p;h?document.documentElement.dataset.colorScheme=h:delete document.documentElement.dataset.colorScheme},100),[]),u=d.useCallback(p=>{p?lo(w_,p):$p(w_),o()},[o]),f=d.useCallback(p=>{i(p)},[i]),m=a??s??r;return d.useEffect(()=>{c(m)},[m,c]),l.jsx(e4.Provider,{value:{colorScheme:m,isSystemColorScheme:!a&&!s,setUserPreferredColorScheme:u,setOverrideColorScheme:f},children:t})});OV.displayName="ColorSchemeProvider";function nge(){return d.useContext(e4)}function Ss(){const e=d.useContext(e4);if(!e)throw new Error("Attempted to access ColorSchemeContext from useColorScheme() without adding to the tree.");return e}const rge=768,LV=`(max-width: ${rge}px)`;function q7(){return typeof window>"u"?!1:window.matchMedia(LV).matches}function ui(e={}){const t=On(),{device:{isWindowsApp:n}}=sn(),r=d.useMemo(()=>!!(n&&t?.includes(Yp)),[n,t]),{evaluateOnInit:s=!1}=e,o=FV(),a=sge(),[i,c]=d.useState(()=>o||a?!0:s?q7():!1);return d.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(LV);function f(){c(u.matches)}return u.addEventListener("change",f),()=>{u.removeEventListener("change",f)}},[o]),d.useEffect(()=>{s||c(q7())},[s]),i&&!r}function FV(e=!1){const{device:{isMobile:t}}=sn();return t??e}function sge(e=!1){const{device:{isAndroid:t}}=sn();return t??e}function Re(e={}){const t=On(),{device:{isWindowsApp:n}}=sn(),r=ui(e),s=d.useMemo(()=>!!(n&&t?.includes(Yp)),[n,t]),o=d.useMemo(()=>r&&!s,[r,s]),a=FV();return d.useMemo(()=>({isMobileStyle:o,isMobileUserAgent:a}),[o,a])}function K7({flag:e,override:t,defaultValue:n,isServer:r=!1}){if(!t)return{shouldUseOverride:!1,value:null};try{if(typeof n=="boolean")return{shouldUseOverride:!0,value:t==="true"};if(typeof n=="number")return{shouldUseOverride:!0,value:Number(t)};if(typeof n=="object")try{return{shouldUseOverride:!0,value:JSON.parse(t)}}catch(s){return Z.warn(`[Eppo ${r?"Server ":""}Override]`,`Failed to parse JSON override for flag "${e}"`,{override:t,error:s}),{shouldUseOverride:!0,value:n}}return{shouldUseOverride:!0,value:t}}catch(s){return Z.error(`[Eppo ${r?"Server ":""}Override] Error:`,s),{shouldUseOverride:!0,value:n}}}let _m;async function oge({apiKey:e,logAssignment:t}){if(_m)return _m;const{init:n}=await q(async()=>{const{init:r}=await import("./index-avoQQ9qh.js").then(s=>s.i);return{init:r}},__vite__mapDeps([0,1]));try{return _m=n({apiKey:e,assignmentLogger:{logAssignment:t}}),await _m,Z.info("[Eppo Experiments] Primary key initialization successful"),_m}catch(r){throw Z.error("[Eppo Experiments] Primary key failed",r),r}}const BV="eppo_overrides",UV="eppo_overrides",age=e=>e?e.endsWith("@perplexity.ai"):!1,ige=e=>{const t={};return e.forEach((n,r)=>{if(r.startsWith("eppo_")){const s=r.replace("eppo_","");t[s]=n??""}}),t},lge=e=>{let t=!0;const n=JSON.stringify(e);try{lo(UV,n)}catch{t=!1}return t=_a.setItem(BV,n),t},cge=(e,t,n)=>{if(typeof window>"u"||n&&!age(e))return!1;const r=ige(t);return Object.keys(r).length===0?!1:lge(r)};function Y7(){try{const e=mr(UV);if(e)return JSON.parse(e);const t=_a.getItem(BV);return t?JSON.parse(t):{}}catch{return{}}}const uge=(e,t)=>{const n=d.useRef(void 0);Cr(n.current,t)||(n.current=t),d.useLayoutEffect(e,[n.current])},dge={getEppoTypedVariationAsync:function(){return Promise.resolve(void 0)},getEppoTypedVariationSync:function(){return null},keysRequiringRerender:[],addKeyRequiringRerender:()=>null,removeKeyRequiringRerender:()=>null},t4=Ft("EppoExperimentsContext",dge),fge="experiment assignment",X1="failed_open_to_default_value";function Q7(e){if(!e||typeof e!="string")return;const t=e.trim();if(t==="")return;const n=t.split("@");if(!(n.length!==2||!n[0]||!n[1]))return n[1]}const mge=(e,t,n,r)=>s=>Li({name:fge,data:{subjectType:s.subjectAttributes.subjectType,pagePropsHostname:r,colorScheme:n,isPerplexityBrowser:e,...s},user:{id:t?.user?.id,subscription_status:t?.user?.subscription_status}});function C_(e){const n=vt.keys().filter(r=>r.startsWith(e));n.length>1&&(Z.warn("[Eppo Experiments] Wiping duplicate Eppo keys",{keys:n}),n.forEach(r=>{vt.removeItem(r)}))}const pge=({children:e,hostname:t,session:n,cfCountry:r})=>{const s=!!n?.user,o=CU(),a=gfe(),i=An(),[c,u]=d.useState([]),{env:{isProduction:f,isStaging:m,deployName:p},device:{isWindowsApp:h}}=sn(),y=f||m?"a2yUBlJ1tebb5g2II8WD1CzbVUszCSk3.ZWg9bnhqMGc3LmUuZXBwby5jbG91ZCZjcz1ueGowZzc":"KphAz1VUxSQKAZxlw1PwMdZNRia-a4B3.ZWg9bnhqMGc3LmUuZXBwby5jbG91ZCZjcz1ueGowZzc",{colorScheme:x}=Ss(),v=d.useRef(void 0),b=fn(),[_,w]=d.useState(!1),{locale:S}=J(),{isMobileStyle:C}=Re(),E=d.useRef(void 0),T=d.useCallback(R=>{mge(i,n,x,t)(R)},[n,i,x,t]);d.useEffect(()=>{if(_||!b)return;cge(n?.user?.email,b,f)&&w(!0)},[b,n?.user?.email,_,f]);const k=d.useCallback(({userId:R,visitorId:P,sessionId:L,subjectType:U,stableId:O,extraAttributes:$,cometDeviceId:G})=>{let H;return O?H=O:U==="user_nextauth_id"?H=R:U==="visitor_id"?H=P??void 0:U==="session_id"?H=L??void 0:U==="context_uuid"?H=$?.context_uuid:U==="comet_device_id"&&(H=G),H},[]),I=d.useCallback(function({flag:R,subjectType:P,isUserLoggedIn:L,stableId:U,userId:O,visitorId:$,sessionId:G,cometDeviceId:H,extraAttributes:Q,defaultValue:Y}){return Math.random()<.01&&Z.error("[Eppo Experiments]","No subject key found",{flag:R,subject_type:P,is_user_logged_in:L,has_stable_id:!!U,has_session_user_id:!!O,has_visitor_id:!!$,has_session_id:!!G,has_context_uuid:!!Q?.context_uuid,has_comet_device_id:!!H,execution_context:typeof window<"u"?"client":"server",document_ready_state:typeof document<"u"?document.readyState:"unknown",eppo_provider_result:X1}),Y},[]),M=d.useCallback(({primaryApiKey:R,logAssignment:P})=>(v.current||(C_("eppo-configuration-"),C_("eppo-configuration-meta-"),C_("eppo-configuration-assignment-"),v.current=oge({apiKey:R,logAssignment:P}),v.current.then(L=>{E.current=L})),v.current),[]),N=d.useCallback(async function(R,{flag:P,subjectType:L,stableId:U,defaultValue:O,extraAttributes:$}){if(L==="user_nextauth_id"&&!s)return O;const G=Us()?.device_id??void 0,H=Do(),Q=i&&!H,Y=k({userId:n?.user?.id,visitorId:o,sessionId:a,subjectType:L,stableId:U,extraAttributes:$,cometDeviceId:G});if(!Y)return I({flag:P,subjectType:L,isUserLoggedIn:s,stableId:U,userId:n?.user?.id,visitorId:o,sessionId:a,cometDeviceId:G,extraAttributes:$,defaultValue:O});const te=Y7(),{shouldUseOverride:se,value:ae}=K7({flag:P,override:te[P],defaultValue:O});if(se)return ae??O;const X=await M({primaryApiKey:y,logAssignment:T});try{const ee=n?.user?.email??void 0,le=Q7(ee);return R(X,P,Y,{subjectType:L,visitorId:o??void 0,sessionId:a??void 0,userEmail:ee,userEmailDomain:le,userId:n?.user?.id??void 0,appApiClient:BS(C,h),cfCountry:r,locale:S,isComet:i,isCometDesktop:Q,isCometMobile:H,deployName:p,cometDeviceId:G,...l7(),...$??{}},O)}catch{return Z.error("[Eppo Experiments] Error calling eppoFn",{flag:P,subjectKey:Y,eppo_provider_result:X1}),O}},[s,i,k,n?.user?.id,n?.user?.email,o,a,y,I,T,C,h,r,S,p,M]),D=d.useCallback(function(R,{flag:P,subjectType:L,stableId:U,defaultValue:O,extraAttributes:$}){if(L==="user_nextauth_id"&&!s)return O;const G=Us()?.device_id??void 0,H=Do(),Q=i&&!H,Y=k({userId:n?.user?.id,visitorId:o,sessionId:a,subjectType:L,stableId:U,extraAttributes:$,cometDeviceId:G});if(!Y)return I({flag:P,subjectType:L,isUserLoggedIn:s,stableId:U,userId:n?.user?.id,visitorId:o,sessionId:a,cometDeviceId:G,extraAttributes:$,defaultValue:O});const te=Y7(),{shouldUseOverride:se,value:ae}=K7({flag:P,override:te[P],defaultValue:O});if(se)return ae??O;if(M({primaryApiKey:y,logAssignment:T}),!E.current)return null;try{const X=n?.user?.email??void 0,ee=Q7(X);return R(E.current,P,Y,{subjectType:L,visitorId:o??void 0,sessionId:a??void 0,userEmail:X,userEmailDomain:ee,userId:n?.user?.id??void 0,appApiClient:BS(C,h),cfCountry:r,locale:S,isComet:i,isCometDesktop:Q,isCometMobile:H,deployName:p,cometDeviceId:G,...l7(),...$??{}},O)}catch{return Z.error("[Eppo Experiments] Error calling eppoFn",{flag:P,subjectKey:Y,eppo_provider_result:X1}),O}},[s,i,k,n?.user?.id,n?.user?.email,o,a,y,I,T,C,h,r,S,p,M]),j=d.useCallback(R=>{u(P=>P.includes(R)?P:[...P,R])},[]),F=R=>{u(P=>P.includes(R)?P.filter(L=>L!==R):P)};return l.jsx(t4.Provider,{value:{getEppoTypedVariationAsync:N,getEppoTypedVariationSync:D,keysRequiringRerender:c,addKeyRequiringRerender:j,removeKeyRequiringRerender:F},children:e})};function Ef(e,t){const n=d.useContext(t4);if(!n)throw new Error("useGetEppoJSONVariation must be used within EppoExperimentsContext");const{getEppoTypedVariationAsync:r,getEppoTypedVariationSync:s}=n,[o,a]=d.useState(void 0),[i,c]=d.useState(()=>{const{skip:h,shortCircuitCases:g,...y}=e;return h?!0:!s(t,y)}),[u,f]=d.useState(()=>{const{skip:h,shortCircuitCases:g,...y}=e;return h?y.defaultValue:s(t,y)??y.defaultValue}),m=d.useRef(e),p=d.useCallback(async()=>{const{skip:h,shortCircuitCases:g,...y}=m.current;try{return r(t,y)}catch(x){return Z.error("[Eppo Experiments]","Error calling getEppoTypedVariationAsync",{flag:y.flag,error:x,eppo_provider_result:X1}),y.defaultValue}},[r,t]);return uge(()=>{m.current=e;const{skip:h,shortCircuitCases:g,...y}=e;if(h){c(!1);return}if(g)for(const{condition:v,result:b}of g)try{if(v()){f(b),c(!1);return}}catch(_){Z.error("[Eppo Experiments] Error evaluating short-circuit case",{flag:y.flag,error:_})}const x=s(t,y);x!==null?(f(x),c(!1)):(c(!0),r(t,y).then(v=>f(v),a).finally(()=>c(!1)))},[r,s,e]),{value:u,loading:i,error:o,fetchVariation:p}}const VV=(e,...t)=>e.getJSONAssignment(...t);function kf(e){return Ef(e,VV)}function hge(e,t){const n={...e,subjectType:"context_uuid",extraAttributes:{...e.extraAttributes,context_uuid:t}};return Ef(n,VV)}const gge=(e,...t)=>e.getStringAssignment(...t);function yge(e){return Ef(e,gge)}const xge=(e,...t)=>e.getBooleanAssignment(...t);function zt(e){return Ef(e,xge)}const vge=(e,...t)=>e.getNumericAssignment(...t);function bge(e){return Ef(e,vge)}const _ge=(e,...t)=>e.getIntegerAssignment(...t);function n4(e){return Ef(e,_ge)}function wge(e){return kf({...e,subjectType:"visitor_id",skip:!1})}function Rx(e){return zt({...e,subjectType:"visitor_id",skip:!1})}const r4=()=>{const e=d.useContext(t4);if(!e)throw new Error("useEppoExperiments must be used within EppoExperimentsContext");return e},HV=(e,t)=>{const{value:n,loading:r}=zt({flag:"comet-mcp-enabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Cge=(e,t)=>{const{value:n,loading:r}=n4({flag:"comet-mobile-classifier-timeout",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Sge=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"comet-mobile-native-agent-enabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Ege=async({entryUUID:e,params:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/entry/should-show-feedback/{entry_uuid}",n,{params:{path:{entry_uuid:e}},body:t,timeoutMs:Qe({productionMs:500,devMs:1e3,clientSideMs:1e3}),numRetries:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r?.should_show_feedback??!1}catch(r){return Z.error("Failed to check if should show feedback",r),!1}},kge=async({slugOrUUID:e,headers:t,options:n,numRetries:r=0,reason:s})=>{const o="getThreadByUUID";if(!e||e==="undefined"||e==="new"){Z.log(`Tried to ${o} with bad slugOrUUID: ${e}`);return}const a=n?.withParentInfo,i=n?.version??ql,c=n?.source??bhe,u=n?.limit??0,f=n?.offset??0,m=n?.fromFirst,p=n?.supportedBlockUseCases??[],h=n?.cursor??null;try{const{data:g,error:y,response:x}=await de.GET("/rest/thread/{entry_uuid_or_slug}",s,{params:{path:{entry_uuid_or_slug:e},query:{with_parent_info:a,with_schematized_response:!0,version:i,source:c,limit:u,offset:f,from_first:m,supported_block_use_cases:p,cursor:h}},timeoutMs:Cn.HIGH,numRetries:r,headers:t});if(!g||y)throw new he("API_CLIENTS_ERROR",{cause:y,status:x.status??0});return g}catch(g){throw Z.error("Failed to get thread by uuid",g),g}},yxt=async({entryUUID:e,selectedText:t,beforeContext:n,afterContext:r,callback:s,reason:o})=>{await de.SSE("/rest/sse/check-sources",o,{params:{entry_uuid_or_slug:e,selected_text:t,before_context:n,after_context:r},handlers:{message:a=>s(a)}})},xxt=async({entryUUID:e,answerHelpful:t,detailedFeedback:n,reason:r})=>{try{const{error:s,response:o}=await de.POST("/rest/entry/feedback/{entry_uuid}",r,{params:{path:{entry_uuid:e}},body:{answer_helpful:t??!1,feedback:n},timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0})}catch(s){Z.error(s)}},vxt=async({entryUUID:e,params:t,reason:n})=>{if(e)try{const{error:r,response:s}=await de.POST("/rest/entry/label-entry/{entry_uuid}",n,{params:{path:{entry_uuid:e}},body:t,timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){Z.error(r)}},bxt=async({entry_uuid:e,format:t,reason:n})=>{const{data:r,error:s,response:o}=await de.POST("/rest/entry/export",n,{body:{entry_uuid:e,format:t},timeoutMs:Qe({productionMs:6e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r},_xt=async({slugOrUUID:e,reason:t})=>{const{error:n,response:r}=await de.POST("/rest/thread/request-access/{entry_uuid_or_slug}",t,{params:{path:{entry_uuid_or_slug:e}}});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0})},au=async({entryUUID:e,reason:t})=>{try{const{error:n}=await de.POST("/rest/sse/perplexity_terminate",t,{headers:{"content-type":"application/json"},body:{entry_uuid:e},timeoutMs:Qe({productionMs:5e3}),numRetries:1});return!n}catch(n){return Z.error("Failed to terminate entry",n),!1}},wxt=async({entryUUID:e,reason:t})=>{try{await de.POST("/rest/sse/perplexity_skip_search",t,{headers:{"content-type":"application/json"},body:{entry_uuid:e}})}catch(n){Z.error("Failed to skip search",n)}},Mge=async({entryUUID:e,clarification:t,reason:n})=>{try{await de.POST("/rest/sse/perplexity_clarifying_answer",n,{headers:{"content-type":"application/json"},body:{entry_uuid:e,clarification:t},timeoutMs:Qe({productionMs:5e3}),numRetries:0})}catch(r){Z.error("Failed to give clarifying answer",r)}},Tge=async({entryUUID:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/entry/should-show-recruitment-banner/{entry_uuid}",t,{params:{path:{entry_uuid:e}},body:void 0,timeoutMs:Qe({productionMs:500,devMs:1e3,clientSideMs:1e3}),numRetries:0});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n?.should_show_recruitment_banner??!1}catch(n){return Z.error("Failed to check if should show recruitment banner",n),!1}},Qp=async({contextUUID:e,stepUUID:t,result:n,reason:r})=>{try{const{error:s,response:o}=await de.POST("/rest/sse/pro_search_step_result",r,{body:{context_uuid:e,step_uuid:t,result:n},timeoutMs:Qe({productionMs:5e3}),numRetries:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0})}catch(s){Z.error(s)}},Age=async({entryUUID:e,params:t,siblingUUID:n,reason:r})=>{const{error:s,response:o}=await de.POST("/rest/entry/set-entry-selection/{entry_uuid}",r,{params:{path:{entry_uuid:e}},body:{selection_status:t,sibling_uuid:n},timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0})},Nge=async({entryUUID:e,sourceType:t,reason:n})=>{try{const{error:r,response:s}=await de.POST("/rest/sources/skip",n,{body:{entry_uuid:e,source_type:t},timeoutMs:Qe({productionMs:5e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){throw Z.error("Failed to skip source",r),r}},X7=Object.freeze({version:"",minVersion:0,webResourcesBuild:""});function Ga(){return typeof window<"u"?window.__PPL_CONFIG__??X7:X7}const zV="comet-sidecar-threads-by-id",Ca=()=>!!Us(),Dx=e=>!(e.defaultPrevented||!An()||e.ctrlKey||e.metaKey),Rge=e=>{const t=vt.getItem(zV);if(t){const n=JSON.parse(t);for(const[r,{url:s,updatedAt:o}]of Object.entries(n))e.getState().actions.setSidecarUrlById(r,s,o)}},Z7=e=>{const t=e.getState().sidecarUrlById,n={};t.forEach((r,s)=>{s!=="-1"&&(r.url==="/sidecar/"||r.url==="/sidecar"||(n[s]={url:r.url,updatedAt:r.updatedAt}))}),vt.setItem(zV,JSON.stringify(n))},Dge=(e,t)=>{const n=e.getState().sidecarSourceTab,r=ro(n.tabId,n.secondaryTab?.tabId),s=e.getState().sidecarUrlById.get(r)?.url;!s||new URL(window.location.href).pathname===s||t.replace(s,"Sidecar thread restored from cache")};let WV=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,s=n.length;r{this.events[e]=this.events[e]?.filter(n=>t!==n)}}});const jge="npclhjbddhklpbnacpjloidibaggcgon",Ige="entropy-agent-extension-main";function Pge(){return{sendMessage:()=>Promise.reject(new Sc("MOBILE_BROWSER_ERROR")),sendMessageToPort:()=>()=>{},isConnected:()=>!1}}function J7({onMessage:e,extensionId:t,name:n}){if(Do())return Pge();let r,s,o=!1,a=!1,i=!1,c=0;const u=()=>{r&&clearTimeout(r),c++,r=setTimeout(p,1e3)},f=()=>{s=void 0,An()&&!a&&(Z.warn("Disconnected. Attempting to reconnect...",{extensionId:t}),a=!0),u()},m=()=>{if(s){s.onMessage.removeListener(e),s.onDisconnect.removeListener(f),clearTimeout(r);try{s.disconnect()}catch{}s=void 0}};function p(){if(m(),typeof chrome>"u"||!chrome.runtime){An()&&(o||(Z.error("Comet browser is missing chrome.runtime",{extensionId:t}),o=!0),u());return}try{s=chrome.runtime.connect(t,{name:n}),s.onMessage.addListener(e),s.onDisconnect.addListener(f),o=!1,a=!1,i=!1,c>0&&An()&&Z.info("Extension reconnected successfully",{extensionId:t,reconnect_attempts:c}),c=0}catch(h){s=void 0,u(),Z.error("Failed to connect to extension",{err:h,extensionId:t})}}return An()&&(p(),Ju("web.frontend.comet_extension_connected",{extensionId:t,startTime:SU(),duration:performance.now()})),{sendMessage:h=>(!s&&An()&&!i&&(Z.warn("Attempting to send message while main port is not connected",{extensionId:t}),i=!0),Oge(t,h)),sendMessageToPort:h=>{if(!An())return()=>{};!s&&!i&&(Z.warn("Attempting to send message to port while main port is not connected",{extensionId:t}),i=!0);const g=chrome.runtime.connect(t,{name:`${n}_${crypto.randomUUID()}`});return g.postMessage(h),()=>{try{g.disconnect()}catch{}}},isConnected:()=>!!s}}async function Oge(e,t){return new Promise((n,r)=>{if(xM()){r(new Sc("INCOGNITO_BROWSER_ERROR"));return}if(!An()){r(new Sc("INVALID_BROWSER_ERROR"));return}if(typeof chrome>"u"||!chrome.runtime){r(new Sc("MISSING_RUNTIME_ERROR",{details:{extensionId:e,messageType:typeof t=="object"&&t!==null&&"type"in t?t.type:void 0,message:t}}));return}chrome.runtime.sendMessage(e,t,s=>{if(chrome.runtime.lastError){r(new Sc("RUNTIME_LAST_ERROR",{message:chrome.runtime.lastError.message,cause:chrome.runtime.lastError,details:{extensionId:e,messageType:typeof t=="object"&&t!==null&&"type"in t?t.type:void 0,message:t}}));return}n(s)})})}class Lge{requests=new Map;bridge;get isAvailable(){if(!(typeof window>"u"))return window.cometBridge!=null}constructor(){this.bridge=new Proxy({},{get:(t,n)=>r=>{const s=crypto.randomUUID(),o={request_id:s,[n]:r??{}};return new Promise((a,i)=>{this.requests.set(s,c=>{"error"in c?i(new Error(String(c.error))):a(c)}),window.cometBridge?.postMessage(JSON.stringify(o))})}}),this.startListenMessages()}startListenMessages(){window.cometBridge&&(window.cometBridge.onmessage=t=>{const n=t.data;if(n)try{const r=JSON.parse(n),s=this.requests.get(r.request_id);s?(this.requests.delete(r.request_id),s(r)):(console.warn("No callback found for requestId",r.request_id,r),Z.warn("No callback found for requestId",r.request_id,r))}catch(r){console.warn("Failed to parse bridge response",n,r),Z.warn("Failed to parse bridge response",n,r)}})}}class eR{bridge;get isAvailable(){if(!(typeof window>"u"))return window.webkit?.messageHandlers?.cometBridge!=null}constructor(){this.bridge=new Proxy({},{get:(t,n)=>async r=>{const o={request_id:crypto.randomUUID(),[n]:r??{}},a=await window.webkit?.messageHandlers?.cometBridge?.postMessage(JSON.stringify(o));if(!a)throw new Error("No response from cometBridge");return JSON.parse(a)}})}}const Z1="mcp_tools_settings_v1";function Fge(){return Xi((e,t)=>({platformInfo:void 0,sidecarSourceTab:{url:"/",title:"",tabId:-1,secondaryTab:null},sidecarAutoOpenedThreads:{},screenshotToolEnabled:!0,sidecarUrlById:new Map,tasksState:{},navigationResults:{},classifierResults:{},omniboxInput:{},navigationMeta:{},taskScreenshots:{},taskComputerActions:{},userSelection:void 0,userSelectionByThreadId:new Map,mcpStdioServers:void 0,mcpTools:void 0,mcpDisabledServers:void 0,installedDxts:void 0,taskTabs:void 0,mcpToolsSettings:void 0,pendingTasks:new Map,inlineAssistantParams:{action:void 0,isWritingMode:!1,canInsert:!0},inlineAssistantDraggableRegions:new Map,actions:{setPlatformInfo:n=>{e({platformInfo:n})},setSidecarUrlById:(n,r,s)=>{const o=t().sidecarUrlById;o.set(n,{url:r,updatedAt:s??Date.now()}),e({sidecarUrlById:o})},deleteSidecarUrlById:n=>{const r=t().sidecarUrlById;r.delete(n),e({sidecarUrlById:r})},setSourceTab:n=>{const r=t().sidecarSourceTab;if(Cr(r,n))return;let s=!0;try{const i=new URL(n.url);s=!((i.protocol==="chrome:"||i.protocol==="comet:")&&i.hostname!=="newtab")}catch{}const o=r.tabId===n.tabId&&r.secondaryTab?.tabId===n.secondaryTab?.tabId,a=r.url!==n.url;if(o&&a){const i=ro(r.tabId,r.secondaryTab?.tabId);e(c=>{const u=new Map(c.userSelectionByThreadId);return u.delete(i),{sidecarSourceTab:n,screenshotToolEnabled:s,userSelectionByThreadId:u}})}else e({sidecarSourceTab:n,screenshotToolEnabled:s})},setSidecarAutoOpened:(n,r)=>{const s=t().sidecarAutoOpenedThreads;if(n)e({sidecarAutoOpenedThreads:{...s,[r]:!0}});else{const{[r]:o,...a}=s;e({sidecarAutoOpenedThreads:a})}},setLastOmniboxInput:(n,r)=>{e(s=>({omniboxInput:{...s.omniboxInput,[n]:r}}))},addNavigationResults:(n,{results:r,classifierResult:s,...o})=>{r?.length&&e(a=>{const i={navigationResults:{...a.navigationResults,[n]:r}};return s&&(i.classifierResults={...a.classifierResults,[n]:s}),o&&!a.navigationMeta[n]&&(i.navigationMeta={...a.navigationMeta,[n]:o}),i})},addTaskScreenshot:(n,r)=>{e(s=>({taskScreenshots:{...s.taskScreenshots,[n]:[...s.taskScreenshots[n]||[],r.startsWith("data:image/")?r:`data:image/png;base64,${r}`]}}))},addComputerAction:(n,r)=>{e(s=>({taskComputerActions:{...s.taskComputerActions,[n]:[...s.taskComputerActions[n]||[],r]}}))},setTaskState:(n,r)=>{e(s=>{const o={...s.tasksState};return r===void 0?delete o[n]:o[n]={is_paused:r},{tasksState:o}})},setUserSelection:n=>{{const r=t(),s=ro(r.sidecarSourceTab.tabId,r.sidecarSourceTab.secondaryTab?.tabId);e(o=>{const a=new Map(o.userSelectionByThreadId);return a.set(s,n),{userSelectionByThreadId:a}})}},clearUserSelection:()=>{{const n=t(),r=ro(n.sidecarSourceTab.tabId,n.sidecarSourceTab.secondaryTab?.tabId);e(s=>{const o=new Map(s.userSelectionByThreadId);return o.delete(r),{userSelectionByThreadId:o}})}},getUserSelection:()=>{const n=t();{const r=ro(n.sidecarSourceTab.tabId,n.sidecarSourceTab.secondaryTab?.tabId);return n.userSelectionByThreadId?.get(r)}},setMcpStdioServers:n=>{e({mcpStdioServers:n})},setMcpTools:(n,r)=>{e(s=>({mcpTools:{...s.mcpTools,[n]:r}}))},removeMcpTools:n=>{e(r=>{const s={...r.mcpTools};return delete s[n],{mcpTools:s}})},setMcpDisabledServers:n=>{e({mcpDisabledServers:n}),vt.setItem("mcp_disabled_servers_v1",JSON.stringify(Array.from(n)))},setMcpToolsSettings:n=>{e({mcpToolsSettings:n}),vt.setItem(Z1,JSON.stringify(n))},setMcpToolEnabled:(n,r,s)=>{e(o=>{const a=o.mcpToolsSettings||{},i={...a[n]||{}},c=i[r]??{enabled:!0},u={...i,[r]:{...c,enabled:s}},f={...a,[n]:u};return vt.setItem(Z1,JSON.stringify(f)),{mcpToolsSettings:f}})},renameMcpServerInToolsSettings:(n,r)=>{e(s=>{const o=s.mcpToolsSettings||{};if(!o[n]||n===r)return s;const a={...o},i=o[n];return a[r]={...i},delete a[n],vt.setItem(Z1,JSON.stringify(a)),{mcpToolsSettings:a}})},setInstalledDxts:n=>{e({installedDxts:n})},setTaskTabs:n=>{e({taskTabs:n})},setPendingTask:(n,r)=>{e(s=>{const o=new Map(s.pendingTasks);return o.set(n,r),{pendingTasks:o}})},deletePendingTask:n=>{e(r=>{const s=new Map(r.pendingTasks);return s.delete(n),{pendingTasks:s}})},getPendingTask:n=>t().pendingTasks.get(n),setInlineAssistantParams:n=>{e(r=>({inlineAssistantParams:{...r.inlineAssistantParams,...n}}))},setInlineAssistantDraggableRegion:n=>{const r=P7(n),s=Math.floor(n.origin.x),o=Math.floor(n.origin.y),a=Math.floor(n.size.width),i=Math.floor(n.size.height);e(c=>{const u=new Map(c.inlineAssistantDraggableRegions);return u.set(r,{origin:{x:s,y:o},size:{width:a,height:i}}),{inlineAssistantDraggableRegions:u}})},removeInlineAssistantDraggableRegion:n=>{const r=P7(n);e(s=>{const o=new Map(s.inlineAssistantDraggableRegions);return o.delete(r),{inlineAssistantDraggableRegions:o}})}}}))}const Bge="mcjlamohcooanphmebaiigheeeoplihb",Uge="streamId",Vge=Object.freeze([]);class Hge{tools;mobileProxy=new eR;isTestDebugMode=!1;platform="web";store=Fge();mainExtension;agentExtension;taskTeardowns=new Map;emitter=WV();pendingServerRename;classifierApiTimeoutMs=bM;useNativeAgent=!1;mobileAgentModule;constructor(){const t=Us();t?.android_version&&(this.platform="android"),t?.ios_version&&(this.platform="ios"),this.mainExtension=J7({onMessage:this.handleMessage,extensionId:Bge,name:"entropy_client_context"}),this.agentExtension=J7({onMessage:this.handleAgentExtensionMessage,extensionId:jge,name:Ige}),this.tools=zge(this.agentExtension),this.platform==="web"?this.mainExtension.sendMessage({type:"INIT"}).then(n=>{n&&(this.isTestDebugMode=!!n.isTestDebugMode)},n=>{if(An())throw n}):(this.mobileProxy=this.platform==="android"?new Lge:new eR,this.mobileAgentModule=q(()=>import("./agent-5z8MvKWD.js"),__vite__mapDeps([2,3,4,1])),this.fetchCurrentPageTab().catch(n=>{Z.error("[cometMobile] Error fetchCurrentPageTab",{error:n})})),ihe()}getStore(){return this.store}getMobileProxy(){return this.mobileProxy}setClassifierApiTimeoutMs(t){this.classifierApiTimeoutMs=t}setUseNativeAgent(t){this.useNativeAgent=t}isAgentAvailable(){return this.platform!=="web"?!0:this.agentExtension.isConnected()}async openNewTab(t){const n=new URL(t);n.searchParams.delete("erp"),n.pathname=n.pathname.replace("/sidecar",""),await this.openTab({url:n.toString(),request_id:"openNewTab",key:"openNewTab",navigation_history:!1})}async moveSidecarToThread(t){try{return(await this.agentExtension.sendMessage({type:"MOVE_SIDECAR_TO_THREAD",payload:{tab_id:t}})).success}catch(n){return Z.error("MOVE_SIDECAR_TO_THREAD failed",n),!1}}_getNavigationResults(t){return this.store.getState().navigationResults[t]??Vge}async closeSideCar(t={}){return this.send({type:"HIDE_SIDECAR",payload:t})}async openTab(t){if(this.platform!=="web"){const s=(await this.mobileProxy?.bridge.tabs_create({url:t.url,hidden:!1})).tab;return{is_success:!0,_metadata:{time:1},result:{tab_id:s.id,url:s.url,title:s.title,last_accessed:s.last_accessed}}}return{is_success:!0,result:(await this.tools.OpenTab({key:t.key??"unknown",request_id:t.request_id??"unknown",url:t.url,tab_id:t.tabId,navigation_history:t.navigation_history})).tab}}async fetchMobileSearchResults(t,n){const[r,s]=await Promise.all([this.mobileProxy.bridge.fetch_navigation_search_results({query:t,stream_id:n}),dhe(t,this.classifierApiTimeoutMs).catch(o=>(Z.error("Classifier API call failed, using defaults",{error:o,query:t,streamId:n}),uhe))]);return{...r.nav_search_response,classifierResult:s}}async fetchNavigationResults(t,n){if(this.platform==="web"){const r=await this.send({type:"NAV_SEARCH",payload:{query:t,streamId:n}});if(!r.is_success)throw new Error("Failed to inject search results");return r}else return{...await this.fetchMobileSearchResults(t,n),_metadata:void 0}}async injectSearchResults(t,n,r={},s){try{const o=Wa(),a={streamId:n,...r};Pl("web.frontend.comet_navigation_run_inject",a);const i=await this.fetchNavigationResults(t,n);if(this.store.getState().actions.addNavigationResults(n,i),s&&s({count:i.results?.length??0}),this.platform!=="web"&&i.results?.length){const p=this.store.getState();rV({clientPayloadCacheKey:`nav-${n}`,cometBrowser:this,reason:"mobile_search_injection",navigationResults:i.results,maxChars:5e4,includeSidecar:!1,attachedTabs:[],cometState:p}).catch(h=>{Z.error("Failed to save mobile navigation results",{streamId:n,error:h})})}const u={type:i.type??"unknown",...a};o.addTiming("web.frontend.comet_navigation_search_results",u);const f=o.getAbsoluteStartTime(),m={...u,startTime:f};i.searchTime&&Ju("web.frontend.comet_navigation_search_time",{duration:i.searchTime,...m}),i.classifyTime&&Ju("web.frontend.comet_navigation_classify_time",{duration:i.classifyTime,...m}),i.networkingTime&&Ju("web.frontend.comet_navigation_networking_time",{duration:i.networkingTime,...m}),this.platform==="web"&&i._metadata?.time&&Ju("web.frontend.comet_navigation_extension_processing",{duration:i._metadata.time,...m})}catch(o){Z.error(new Sc("NAV_RESULTS_INJECTION_FAILED",{details:{streamId:n},cause:o}))}}async getIsCometDefaultBrowser(t){try{const n=await this.send({type:"GET_IS_DEFAULT_BROWSER",key:t});return n.is_success?n.isDefault:null}catch{return null}}async setCometAsDefaultBrowser(t){return this.send({type:"SET_AS_DEFAULT_BROWSER",key:t})}async getDidSkipCookieImportOnboarding(t){const r=(await this.send({type:"GET_ONBOARDING_IMPORT_STATUS",key:t})).importStatus==="NOT_IMPORTED";return Z.info("[getDidSkipCookieImportOnboarding]",r),r}notifyUserStateChanged(t){this.send({type:"USER_STATE_CHANGED",payload:t}).catch(()=>{})}subscribeCometNavigate(t){const n=r=>{const s=new URL(r.detail.url);delete window.pplxNavIntentEvent,Pl("comet_navigate");const o="/search/new";s.pathname==="/search"&&s.searchParams.has("q")&&(s.pathname=o);let a=o;if(a="/sidecar"+o,s.pathname===a){const i=crypto.randomUUID();s.searchParams.set(Uge,i);const c=r.detail.text||"";this.store.getState().actions.setLastOmniboxInput(i,c)}t({url:s})};return window.pplxNavIntentEvent&&n(window.pplxNavIntentEvent),document.addEventListener("comet-navigate",n),()=>{document.removeEventListener("comet-navigate",n)}}subscribeToAgentStepUpdate(){const t=n=>{this.sendThreadStatusToMobile({status:"working",streamId:n.detail.streamId,displayDataId:n.detail.stepAction,allowClarifications:!0})};return document.addEventListener("comet-agent-step-update",t),()=>{document.removeEventListener("comet-agent-step-update",t)}}subscribeToCometQuery(t){const n=r=>{const s=r.detail.query;delete window.pplxCometQuery,t(s,{source:r.detail.source})};return window.pplxCometQuery&&n(window.pplxCometQuery),document.addEventListener("comet-query",n),()=>{document.removeEventListener("comet-query",n)}}getLastOmniboxInput(t){return this.store.getState().omniboxInput[t]}async getCookies(){if(this.platform!=="web")return{base64_cookies:(await this.mobileProxy.bridge.agent_get_cookies()).base64_cookies};throw new Error("getCookies is only available on mobile platforms")}async searchTabs(t){if(this.platform!=="web"){const{tabs:r}=await this.mobileProxy.bridge.tabs_query();return{is_success:!0,tabs:r.map(s=>({tabId:s.id,title:s.title??"",url:s.url,isCurrent:!1,lastAccess:s.last_accessed??0,snippet:""})),_metadata:{time:1}}}return{is_success:!0,tabs:(await this.tools.SearchBrowser({queries:[],sources:["OPEN_TABS"],key:t,history_max_results:0,open_tabs_max_results:500,closed_tabs_max_results:0,request_id:t})).open_tabs_results.map(r=>({...r,tabId:r.tab_id,lastAccess:r.last_accessed}))}}async ungroupTabs(t,n,r){return{is_success:!0,tabIds:(await this.tools.UngroupTabs({group_ids:t.groupIds,tab_ids:t.tabIds,key:n,request_id:r})).ungrouped_tabs.map(o=>({id:o.tab_id,error:o.error})),groupIds:t.groupIds.map(o=>({id:o}))}}showNotification(){this.send({type:"SHOW_NOTIFICATION"}).catch(()=>{})}hideInlineAssistant(){this.send({type:"CLOSE_INLINE_ASSISTANT"}).catch(()=>{})}setInlineAssistantContentsSize(t){this.send({type:"SET_INLINE_ASSISTANT_CONTENTS_SIZE",payload:{size:t}}).catch(()=>{})}setInlineAssistantDraggableRegions(t){this.send({type:"SET_INLINE_ASSISTANT_DRAGGABLE_REGIONS",payload:{regions:t}}).catch(()=>{})}addInlineAssistantDraggableRegion(t){this.store.getState().actions.setInlineAssistantDraggableRegion(t);const n=Array.from(this.store.getState().inlineAssistantDraggableRegions.values());this.setInlineAssistantDraggableRegions(n)}removeInlineAssistantDraggableRegion(t){this.store.getState().actions.removeInlineAssistantDraggableRegion(t);const n=Array.from(this.store.getState().inlineAssistantDraggableRegions.values());this.setInlineAssistantDraggableRegions(n)}sendThreadStatusToMobile(t){const{status:n,streamId:r,text:s,displayDataId:o,allowClarifications:a}=t;this.mobileProxy.bridge.thread_status({type:n,text:s,stream_id:r,display_data_id:o,allow_clarifications:a??!1}).catch(i=>{Z.error("Failed to send thread status to mobile bridge",i)})}sendVoiceStatusToMobile(t){const{status:n,text:r}=t;this.mobileProxy.bridge.voice_status({type:n,text:r}).catch(s=>{Z.error("Failed to send voice status to mobile bridge",s)})}openUserSettings(){this.platform!=="web"&&this.mobileProxy.bridge.open_user_settings().catch(t=>{Z.error("Failed to open user settings on mobile",t)})}setNativeInputVisibility(t){this.platform!=="web"&&this.mobileProxy.bridge.set_native_input_visibility({visible:t}).catch(n=>{Z.error("Failed to set native input visibility",n)})}openNativeSheet(t){this.platform!=="web"&&this.mobileProxy.bridge.app_navigate({target:t}).catch(n=>{Z.error(`Failed to open native ${t} sheet`,n)})}subscribeToMobileCommands(t){const n=r=>{r.detail.cmd==="update-context"?this.store.getState().actions.setSourceTab({secondaryTab:null,tabId:r.detail.tab.id,title:r.detail.tab.title,url:r.detail.tab.url}):t?t(r.detail):r.detail.cmd==="stop"&&r.detail.subject==="thread"?this.emitter.emit("BROWSER_TASK_STOP"):Z.warn("[comet-mobile] Unknown mobile command",r.detail.cmd)};return document.addEventListener("comet-mobile-cmd",n),()=>{document.removeEventListener("comet-mobile-cmd",n)}}setTabProgress(t){this.send({type:"SET_TAB_PROGRESS",payload:t}).catch(()=>{})}voiceAssistantPushVoiceLevel(t){this.send({type:"VOICE_ASSISTANT_PUSH_VOICE_LEVEL",payload:{levels:t}}).catch(()=>{})}voiceAssistantChangeSpeakerRole(t){this.send({type:"VOICE_ASSISTANT_CHANGE_SPEAKER_ROLE",payload:{role:t}}).catch(()=>{})}voiceAssistantNotifyConnected(){this.send({type:"VOICE_ASSISTANT_NOTIFY_CONNECTED"}).catch(()=>{})}voiceAssistantNotifyDisconnected(){this.send({type:"VOICE_ASSISTANT_NOTIFY_DISCONNECTED"}).catch(()=>{})}voiceAssistantStop(){this.send({type:"VOICE_ASSISTANT_STOP"}).catch(()=>{})}voiceAssistantShowWindow(){this.send({type:"VOICE_ASSISTANT_SHOW_WINDOW"}).catch(()=>{})}voiceAssistantHideWindow(){this.send({type:"VOICE_ASSISTANT_HIDE_WINDOW"}).catch(()=>{})}voiceAssistantSetDraggableRegions(t){this.send({type:"VOICE_ASSISTANT_SET_DRAGGABLE_REGIONS",payload:{regions:t}}).catch(()=>{})}async searchTabGroups(t,n,r){return{is_success:!0,results:(await this.tools.SearchTabGroups({queries:t.queries,request_id:r,key:n})).tab_groups.map(o=>({...o,color:o.color,tabs:o.tabs.map(a=>({...a,tabId:a.tab_id,isCurrent:a.is_current_tab??!1}))}))}}showFeedbackForm(){this.send({type:"SHOW_FEEDBACK_FORM"}).catch(()=>{})}subscribeScreenshotCaptured(t){return this.emitter.on("SCREENSHOT_CAPTURED",t)}handleAgentExtensionMessage=t=>{try{Vi(t).with({type:"SCREENSHOT_CAPTURED"},async({payload:{screenshot:n}})=>{const s=await(await fetch(n)).blob(),o=new File([s],"screenshot.png",{type:s.type});Z.info("Screenshot captured"),this.emitter.emit("SCREENSHOT_CAPTURED",o)}).with({type:"BROWSER_TASK_PROGRESS_SCREENSHOT"},async({payload:{screenshot:n,taskUuid:r}})=>{this.store.getState().actions.addTaskScreenshot(r,n)}).with({type:"ACTION_STARTED"},({payload:{uuid:n,action:r}})=>{this.store.getState().actions.addComputerAction(n,{action:r.action?.toLowerCase(),text:r.text,duration:r.duration})}).with({type:"BROWSER_TASK_PROGRESS"},({payload:{taskUuid:n,progress:r}})=>{const s=this.store.getState().actions.getPendingTask(n);s?.onProgress&&s.onProgress(r),this.emitter.emit("BROWSER_TASK_PROGRESS",n,r)}).with({type:"BROWSER_TASK_COMPLETE"},({payload:{taskUuid:n,result:r}})=>{const s=this.store.getState().actions.getPendingTask(n);s&&(this.store.getState().actions.deletePendingTask(n),s.resolve(r)),this.emitter.emit("BROWSER_TASK_COMPLETE",n,r)}).with({type:"BROWSER_TASK_STOP"},({payload:n})=>{Z.info("Browser task stopped"),this.emitter.emit("BROWSER_TASK_STOP",n.entryId)}).with({type:"BROWSER_TASK_PAUSE_RESUME_FRONTEND"},({payload:n})=>{Z.info("Browser task paused/resumed"),this.store.getState().actions.setTaskState(n.task_uuid,n.is_paused)}).with({type:"AGENT_TASK_FAILURE"},({payload:{taskUuid:n,extraHeaders:r,error:s}})=>{const o=this.store.getState().actions.getPendingTask(n);o&&(this.store.getState().actions.deletePendingTask(n),o.reject(new Error(s))),Y1({clientPayloadCacheKey:n,errorType:s,errorMsg:"Agent task failure."},r,"CometAdapter").catch(a=>{Z.error("Error sending tool failure",a)})}).with({type:"USER_SELECTION_CAPTURED"},({payload:{selection:n}})=>{this.store.getState().actions.setUserSelection(n)}).with({type:"MOVE_THREAD_TO_SIDECAR"},({payload:{url:n,task_tab_ids:r,entry_id:s,thread_url_slug:o,auto_opened:a}})=>{if(a!==void 0){const u=this.store.getState().sidecarSourceTab,f=ro(u.tabId,u.secondaryTab?.tabId);this.store.getState().actions.setSidecarAutoOpened(a,f)}let i,c;o?(c=new URL(window.location.href),c.pathname="/sidecar/search/"+o,i=c.toString()):s?(c=new URL(window.location.href),c.pathname="/sidecar/search/"+s,i=c.toString()):(c=new URL(n),c.pathname="/sidecar"+phe(c.pathname),i=c.toString()),r.forEach(u=>{const f=ro(u,void 0);this.store.getState().actions.setSidecarUrlById(f,c.pathname)}),!(o&&window.location.pathname.includes(o))&&document.dispatchEvent(new CustomEvent("comet-navigate",{detail:{url:i,text:""}}))}).with({type:"GET_TASK_TABS"},({payload:{tabs:n}})=>{this.store.getState().actions.setTaskTabs(n)}).with({type:"MCP_STDIO_SERVER_CHANGED"},({payload:{serverName:n,changes:r,server:s}})=>{this.handleMcpStdioServerChanged(n,r,s)}).with({type:"MCP_PERSISTED_STDIO_SERVERS_LOADED"},()=>{this.handleMcpPersistedStdioServersLoaded()}).with({type:"MCP_STDIO_SERVER_ADDED"},({payload:{server:n}})=>{this.handleMcpStdioServerAdded(n)}).with({type:"MCP_STDIO_SERVER_REMOVED"},({payload:{serverName:n}})=>{this.handleMcpStdioServerRemoved(n)}).otherwise(n=>{Z.log("Unknown message type",n)})}catch(n){Z.error("Error parsing entropy message",n)}};async fetchOpenedTabs(){const t=await this.searchTabs("fetch_opened_tabs");return t.is_success?t.tabs.filter(n=>(n.url.startsWith("https://")||n.url.startsWith("file://"))&&!n.isCurrent).sort((n,r)=>r.lastAccess-n.lastAccess):[]}async getPersonalSuggestions(t,n){return this.send({type:"GET_PERSONAL_SUGGESTIONS",payload:t,key:n})}async getTopMostVisitedUrls(t,n){return this.send({type:"GET_TOP_MOST_VISITED_URLS",payload:t,key:n})}getQuickActions(t){return this.send({type:"GET_QUICK_ACTIONS",key:t})}async getInitialHistorySummary(t,n,r){return this.SearchBrowser({queries:[],sources:["HISTORY"],key:"initial-history-summary",request_id:t,start_time:n*24*60*60*1e3,history_max_results:r,open_tabs_max_results:r,closed_tabs_max_results:r})}async getHistorySummary(t,n=[],r=14,s=20){return this.SearchBrowser({queries:n,sources:["HISTORY"],key:t,request_id:"",start_time:r*24*60*60*1e3,history_max_results:s,open_tabs_max_results:s,closed_tabs_max_results:s})}async GetContent(t){return this.platform!=="web"?{contents:(await Promise.allSettled(t.pages.map(async r=>r.id?(await this.mobileProxy.bridge.tabs_get_content({id:r.id})).tab_content:(await this.mobileProxy.bridge.tabs_get_url_content({url:r.url})).tab_content))).map(r=>r.status==="fulfilled"?r.value:void 0).filter(r=>r!==void 0).map(r=>({html:"",id:r.id,url:r.url,title:r.title??"",og_meta:r.og_meta??{},markdown:r.markdown??""}))}:this.tools.GetContent(t)}async GetVisibleTabScreenshot(t){return this.tools.GetVisibleTabScreenshot(t)}async SearchBrowser(t){if(this.platform!=="web"){const n=t.sources.includes("HISTORY")?Promise.allSettled((t.queries.length?t.queries:[""]).map(async a=>await this.mobileProxy.bridge.history_search({text:a,max_results:t.history_max_results,start_time:t.start_time,end_time:t.end_time}))):[],[{tabs:r},s]=await Promise.all([t.sources.includes("OPEN_TABS")?this.mobileProxy.bridge.tabs_query():{tabs:[]},n]),o=s.map(a=>a.status==="fulfilled"?a.value.history_items:[]).flat().map(a=>({title:a.title??"",url:a.url,last_accessed:a.last_visit_time??Date.now(),visit_count:a.visit_count??1}));return{closed_tabs_results:[],history_results:o,open_tabs_results:r.map(a=>({tab_id:a.id,title:a.title??"",url:a.url,last_accessed:a.last_accessed??0}))}}return this.tools.SearchBrowser(t)}async GetSidecarContext(t){if(this.platform!=="web"){const r=(await this.mobileProxy.bridge.tabs_query()).tabs.sort((a,i)=>(i.last_accessed??-1)-(a.last_accessed??-1))[0];if(!r)return{content:void 0,contents:void 0};const s=(await this.mobileProxy.bridge.tabs_get_content({id:r?.id})).tab_content,o={id:s.id,html:"",markdown:s.markdown,og_meta:s.og_meta,title:s.title,url:s.url};return{content:o,contents:[o]}}return this.tools.GetSidecarContext(t)}async closeTabs(t,n,r){if(this.platform!=="web"){const{tabs:o}=await this.mobileProxy.bridge.tabs_query(),a=t.tabIds??[],i=o.filter(c=>a.includes(c.id));return i.forEach(c=>{this.mobileProxy.bridge.tabs_close({id:c.id})}),{is_success:!0,result:i.map(c=>({id:c.id,url:c.url,title:c.title??""}))}}return{is_success:!0,result:(await this.tools.CloseTabs({tab_ids:t.tabIds??[],key:n,request_id:r})).tabs.map(o=>({id:o.tab_id,...o}))}}async groupTabs(t,n,r){const s=await this.tools.GroupTabs({...t,tab_ids:t.tabIds,group_id:t.groupId,key:n,request_id:r});if(!s.tab_group)throw new Error("[GroupTabs] Tab group not found");return{is_success:!0,tabGroup:{id:s.tab_group.id,title:s.tab_group.title,collapsed:s.tab_group.collapsed??!1,color:s.tab_group.color}}}async maybeSendSearchResult(t,n,r){if(!this.isTestDebugMode||!t)return;const o=[...t.web_results??[],...t.extra_web_results??[]].map(a=>({name:a.name,snippet:a.snippet,url:a.url,isClientContext:!!a.is_client_context}));return this.send({type:"PERPLEXITY_SEARCH_RESULT",payload:{answer:t.answer,webResults:o,isPending:r,steps:n.map(a=>a.step_type)}})}submitTask(t,n){return new Promise((r,s)=>{const o=t.entryId,a=t.uuid;this.store.getState().actions.setPendingTask(a,{entryId:t.entryId,uuid:t.uuid,resolve:r,reject:s,onProgress:n});const i=this.taskTeardowns.get(o)??[];if(this.taskTeardowns.set(o,i),this.platform!=="web"){if(this.useNativeAgent){i.push(()=>{this.mobileProxy.bridge.agent_stop({entry_id:o}).catch(c=>{Z.error("[comet] Native agent stop failed",{error:c,entryId:o})}),this.store.getState().actions.setTaskState(t.uuid,void 0)}),this.mobileProxy.bridge.agent_start({task:t.task,start_url:t.start_url,uuid:t.uuid,tab_id:t.tab_id,base_url:t.base_url,extra_headers:t.extra_headers,entry_id:t.entryId}).then(c=>{c.success?r({message:"Native agent started",success:!0}):s(new Error("Native agent failed to start"))}).catch(c=>{Z.error("[comet] Native agent start failed",{error:c}),s(c)});return}this.mobileAgentModule.then(async({startAgent:c})=>{try{const u=await c(t,this.mobileProxy.bridge,(f,m)=>{this.store.getState().actions.addTaskScreenshot(m,f)},(f,m)=>{this.store.getState().actions.addComputerAction(f,{action:m.action?.toLowerCase(),text:m.text,duration:m.duration})});i.push(f=>{u(f),this.store.getState().actions.setTaskState(t.uuid,void 0)}),r({message:"Mobile task started",success:!0})}catch(u){Z.error("[comet] Mobile agent failed to start",{error:u});const f=this.store.getState().actions.getPendingTask(a);f&&(this.store.getState().actions.deletePendingTask(a),f.reject(u instanceof Error?u:new Error(String(u))));let m={};try{m=JSON.parse(t.extra_headers)}catch{}Y1({clientPayloadCacheKey:a,errorType:"unhandled",errorMsg:u instanceof Error?u.message:String(u)},m,"CometAdapter").catch(p=>{Z.error("Error sending tool failure",p)}),s(u)}}).catch(c=>{Z.error("[comet] Mobile agent module failed to load",{error:c}),s(c)});return}this.agentExtension.sendMessage(t).then(()=>{i.push(c=>{this.agentExtension.sendMessage({type:"CLEANUP_AGENT_TASKS",payload:{entryId:t.entryId,reason:c}})})}).catch(c=>{let u={};try{u=JSON.parse(t.extra_headers)}catch{}Z.error("[comet] Unhandled error while submitting task",c),Y1({clientPayloadCacheKey:a,errorType:c,errorMsg:"Agent task start failure."},u,"CometAdapter").catch(f=>{Z.error("Error sending tool failure",f)})})})}async moveThreadToSidecar({activeTaskUuid:t,entryId:n,isMissionControl:r,reason:s,animate:o,takeFocus:a,autoOpened:i=!0}){try{return(await this.agentExtension.sendMessage({type:"MOVE_THREAD_TO_SIDECAR",payload:{active_task_uuid:t,is_mission_control:r,entry_id:n,animate:o,takeFocus:a,auto_opened:i}})).success}catch(c){return Z.error(new Sc("MOVE_THREAD_TO_SIDECAR_FAILED",{cause:c,message:`Failed to move thread to sidecar for ${s}`})),!1}}getTaskTabs(){this.agentExtension.sendMessage({type:"GET_TASK_TABS"})}async sendMissionControlStatus(t){await this.agentExtension.sendMessage({type:"MISSION_CONTROL_STATUS",payload:t})}async makeTaskVisible(t){const n=await this.agentExtension.sendMessage({type:"MAKE_TASK_VISIBLE",payload:{task_uuid:t}});if(n.tab_ids){const r=new URL(window.location.href).pathname;n.tab_ids.forEach(s=>{this.store.getState().actions.setSidecarUrlById(ro(s,void 0),r)})}}cleanupTasks(t,n){if(!t)return;const r=this.taskTeardowns.get(t);if(!r){this.platform==="web"?this.agentExtension.sendMessage({type:"CLEANUP_AGENT_TASKS",payload:{entryId:t,reason:n}}):this.mobileProxy.bridge.agent_stop({entry_id:t}).catch(s=>{Z.error("[comet] Native agent stop failed",{error:s,entryId:t})});return}r.forEach(s=>s(n)),this.taskTeardowns.delete(t)}captureSourceTabScreenshotV2({sourceTabUrl:t=""}){this.agentExtension.sendMessage({type:"CAPTURE_SCREENSHOT_V2",payload:{tabId:void 0,sourceTabUrl:t}})}deactivateScreenshotTool(){this.agentExtension.sendMessage({type:"DEACTIVATE_SCREENSHOT_TOOL",payload:{tabId:void 0}})}subscribeToSidecarBrowserTaskStop(t){return this.emitter.on("BROWSER_TASK_STOP",t)}subscribeForceSubmitQuery(t){return this.emitter.on("FORCE_SUBMIT_QUERY",t)}subscribeQuickActionButtonFired(t){return this.emitter.on("QUICK_ACTION_BUTTON_FIRED",t)}subscribeVoiceAssistantStarted(t){return this.emitter.on("VOICE_ASSISTANT_STARTED",t)}subscribeVoiceAssistantStopped(t){return this.emitter.on("VOICE_ASSISTANT_STOPPED",t)}getMcpTools(t){return this.sendToAgent({type:"GET_MCP_TOOLS",payload:{serverName:t}})}callMcpTool(t,n){return this.sendToAgent({type:"CALL_MCP_TOOL",payload:t,context:n})}getMcpStdioServers(){const t=this.sendToAgent({type:"GET_STDIO_MCP_SERVERS",payload:void 0});return t.then(n=>{this.getStore().getState().actions.setMcpStdioServers(n)}).catch(()=>{}),t}addMcpStdioServer(t){return this.sendToAgent({type:"ADD_STDIO_MCP_SERVER",payload:t})}async updateMcpStdioServer(t,n){try{return await this.sendToAgent({type:"UPDATE_STDIO_MCP_SERVER",payload:{existingServerName:t,updates:n}})}catch(r){if(!(r instanceof Error)||!r.message.startsWith("Error in invocation of perplexity.mcp.updateStdioServer")&&!r.message.startsWith("chrome.perplexity.mcp.updateStdioServer is not a function"))throw r;return n.name&&n.name!==t?this.pendingServerRename={oldName:t,newName:n.name}:this.pendingServerRename=void 0,await this.removeMcpStdioServer(t,!0),this.addMcpStdioServer(n)}}async removeMcpStdioServer(t,n){await this.sendToAgent({type:"REMOVE_STDIO_MCP_SERVER",payload:{name:t}}),this.clearStateAfterRemovingMcpServer(t,n)}installDxt(t){return this.sendToAgent({type:"INSTALL_DXT",payload:{url:t}})}async uninstallDxt(t){await this.sendToAgent({type:"UNINSTALL_DXT",payload:{name:t}}),this.clearStateAfterRemovingMcpServer(t)}getInstalledDxts(){const t=this.sendToAgent({type:"GET_INSTALLED_DXT"});return t.then(n=>{this.getStore().getState().actions.setInstalledDxts(n)}).catch(()=>{}),t}async refreshDxtAndMcpState(){await Promise.all([this.getMcpStdioServers(),this.getInstalledDxts()])}async hasPermission(t){try{return await this.sendToAgent({type:"HAS_PERMISSION",payload:{permission:t}})}catch{return null}}async requestPermission(t){try{return await this.sendToAgent({type:"REQUEST_PERMISSION",payload:{permission:t}})}catch{return null}}handleMcpStdioServerChanged(t,n,r){const s=this.getStore().getState(),o=s.mcpStdioServers??[],a=o.findIndex(c=>c.name===t);if(a===-1)return;const i=[...o];i[a]=r,s.actions.setMcpStdioServers(i)}async handleMcpPersistedStdioServersLoaded(){await this.getMcpStdioServers()}handleMcpStdioServerAdded(t){const n=this.getStore().getState(),r=n.mcpStdioServers??[];if(r.findIndex(a=>a.name===t.name)!==-1)return;const o=[...r,t];n.actions.setMcpStdioServers(o)}handleMcpStdioServerRemoved(t){const n=this.getStore().getState(),s=(n.mcpStdioServers??[]).filter(o=>o.name!==t);n.actions.setMcpStdioServers(s)}async fetchCurrentPageTab(){if(this.platform==="web")return;const n=(await this.mobileProxy.bridge.tabs_query()).tabs.sort((r,s)=>(s.last_accessed??-1)-(r.last_accessed??-1))[0];n&&this.store.getState().actions.setSourceTab({tabId:n.id,title:n.title??"",url:n.url,secondaryTab:null})}async send(t){return this.mainExtension.sendMessage(t).then(n=>(n.is_success=!n.errorType,n))}async sendToAgent(t){return this.agentExtension.sendMessage(t).then(n=>{if(!n.success)throw new Error(n.error);return n.response})}handleMessage=t=>{try{Vi(t).with({type:"UPDATE_SOURCE_TAB"},r=>{this.store.getState().actions.setSourceTab(r.payload),r.payload.url!==this.store.getState().sidecarSourceTab.url&&this.store.getState().actions.clearUserSelection()}).with({type:"FORCE_SUBMIT_QUERY"},r=>{this.isTestDebugMode&&this.emitter.emit("FORCE_SUBMIT_QUERY",r.payload)}).with({type:"QUICK_ACTION_BUTTON_FIRED"},()=>{this.emitter.emit("QUICK_ACTION_BUTTON_FIRED")}).with({type:"VOICE_ASSISTANT_STARTED"},()=>{this.emitter.emit("VOICE_ASSISTANT_STARTED")}).with({type:"VOICE_ASSISTANT_STOPPED"},()=>{this.emitter.emit("VOICE_ASSISTANT_STOPPED")}).with({type:"EDITABLE_ELEMENT_FOCUS_STATE"},r=>{this.store.getState().actions.setInlineAssistantParams({canInsert:r.payload.canInsert})}).with({type:"INIT"},r=>{this.isTestDebugMode=!!r.payload.isTestDebugMode,this.store.getState().actions.setPlatformInfo(r.payload.platform);const s=this.store.getState().actions;s.setSourceTab({tabId:r.payload.sourceTabId??-1,url:r.payload.sourceTabUrl??"",title:r.payload.sourceTabTitle??"",secondaryTab:r.payload.sourceSecondaryTab??null}),r.payload.selection&&s.setUserSelection(r.payload.selection)}).otherwise(r=>{Z.log("Unknown message type",r)})}catch(n){Z.error("Error parsing entropy message",n)}};clearStateAfterRemovingMcpServer(t,n){const r=this.getStore().getState(),s=r.mcpDisabledServers??new Set;if(s.has(t)){const a=new Set(s);a.delete(t),r.actions.setMcpDisabledServers(a)}if(n&&!this.pendingServerRename)return;if(this.pendingServerRename&&this.pendingServerRename.oldName===t){r.actions.renameMcpServerInToolsSettings(this.pendingServerRename.oldName,this.pendingServerRename.newName),this.pendingServerRename=void 0;return}const o=r.mcpToolsSettings??{};if(o[t]){const a={...o};delete a[t],r.actions.setMcpToolsSettings(a)}}async getPrivacyInfo(t){try{const n=await this.send({type:"GET_PRIVACY_INFO",key:t});return n.is_success?n:null}catch{return null}}async insertInlineAssistantSelection(t,n){try{return(await this.agentExtension.sendMessage({type:"INSERT_INLINE_TEXT",payload:{text:n},key:t})).success}catch{return!1}}async getSiteOnboardingStatus(t){try{const n=await this.mainExtension.sendMessage({type:"GET_SITE_ONBOARDING_STATUS",key:t});return n.started===null?void 0:n.started}catch{return}}async setSiteOnboardingStatus(t,n){try{await this.mainExtension.sendMessage({type:"SET_SITE_ONBOARDING_STATUS",key:t,payload:{started:n}})}catch{}}}const zge=e=>new Proxy({},{get(t,n){return r=>e.sendMessage({type:"CALL_TOOL",method:n,request:r}).then(({success:s,response:o})=>{if(!s)throw o;return o}).catch(s=>{throw Z.error("Error calling tool",s),"errorType"in s?s:{errorType:"unhandled",errorMsg:"Proxy error."}})}});class Wge{mobileProxy;cometAdapter;_shouldUseMobileProxyForMCP=null;constructor(t,n){this.mobileProxy=t,this.cometAdapter=n}get shouldUseMobileProxyForMCP(){if(this._shouldUseMobileProxyForMCP===null)if(Do())this._shouldUseMobileProxyForMCP=!0;else if(An())this._shouldUseMobileProxyForMCP=!1;else{const t=this.mobileProxy.isAvailable;t!==void 0&&(this._shouldUseMobileProxyForMCP=t)}return this._shouldUseMobileProxyForMCP??!1}async getMcpTools(t){if(this.shouldUseMobileProxyForMCP){const n=this.mobileProxy.bridge.get_mcp_tools({server_name:t});return n.catch(r=>{Z.error("get_mcp_tools failed:",r)}),n.then(r=>r.tools)}return this.cometAdapter.getMcpTools(t)}async callMcpTool(t,n){if(this.shouldUseMobileProxyForMCP){const r=this.mobileProxy.bridge.call_mcp_tool({params:t});return r.catch(s=>{Z.error("call_mcp_tool failed:",s)}),r.then(s=>({content:s.result}))}return this.cometAdapter.callMcpTool(t,n)}async getMcpStdioServers(){if(this.shouldUseMobileProxyForMCP){const t=this.mobileProxy.bridge.get_mcp_servers();return t.catch(n=>{Z.error("get_mcp_servers failed:",n)}),t.then(n=>(this.cometAdapter.getStore().getState().actions.setMcpStdioServers(n.servers),n.servers))}return this.cometAdapter.getMcpStdioServers()}async getInstalledDxts(){return this.shouldUseMobileProxyForMCP?[]:this.cometAdapter.getInstalledDxts()}async refreshDxtAndMcpState(){await Promise.all([this.getMcpStdioServers(),this.getInstalledDxts()])}initializeFromWindowTools(t){try{if(!t?.servers)return;const n=this.cometAdapter.getStore();Object.entries(t.servers).forEach(([r,s])=>{s&&Array.isArray(s)&&n.getState().actions.setMcpTools(r,s)})}catch(n){Z.error("Failed to initialize MCP tools from window",n)}}}const GV="native_bridge";function Gge(e){try{const t=JSON.parse(e);return{info_version:typeof t.info_version=="string"?t.info_version:void 0,local_mcp:{call:t.local_mcp?.call===!0,edit:t.local_mcp?.edit===!0}}}catch(t){Z.warn("[NativeClientCapabilities] Invalid JSON",t);return}}const $ge=wf(function(){const t=mr(GV);if(t)return Gge(t)},()=>Math.floor(Date.now()/(3600*1e3)));function qge(){return!!mr(GV)}const Kge=wf(function(){const t=$ge();if(t)return t;if(!Do()&&An())return{info_version:"1",local_mcp:{call:!0,edit:!0}}},()=>Math.floor(Date.now()/(3600*1e3))),Yge=Symbol(),$V=Symbol(),Ym="a",qV="f",tR="p",KV="c",YV="t",QV="h",J1="w",XV="o",ZV="k";let Qge=(e,t)=>new Proxy(e,t);const $S=Object.getPrototypeOf,nR=new WeakMap,Xge=e=>e&&(nR.has(e)?nR.get(e):$S(e)===Object.prototype||$S(e)===Array.prototype),rR=e=>typeof e=="object"&&e!==null,Zge=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(t=>!t.configurable&&!t.writable),Jge=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create($S(e),t)},e0e=(e,t)=>{const n={[qV]:t};let r=!1;const s=(i,c)=>{if(!r){let u=n[Ym].get(e);if(u||(u={},n[Ym].set(e,u)),i===J1)u[J1]=!0;else{let f=u[i];f||(f=new Set,u[i]=f),f.add(c)}}},o=()=>{r=!0,n[Ym].delete(e)},a={get(i,c){return c===$V?e:(s(ZV,c),eH(Reflect.get(i,c),n[Ym],n[KV],n[YV]))},has(i,c){return c===Yge?(o(),!0):(s(QV,c),Reflect.has(i,c))},getOwnPropertyDescriptor(i,c){return s(XV,c),Reflect.getOwnPropertyDescriptor(i,c)},ownKeys(i){return s(J1),Reflect.ownKeys(i)}};return t&&(a.set=a.deleteProperty=()=>!1),[a,n]},JV=e=>e[$V]||e,eH=(e,t,n,r)=>{if(!Xge(e))return e;let s=r&&r.get(e);if(!s){const c=JV(e);Zge(c)?s=[c,Jge(c)]:s=[c],r?.set(e,s)}const[o,a]=s;let i=n&&n.get(o);return(!i||i[1][qV]!==!!a)&&(i=e0e(o,!!a),i[1][tR]=Qge(a||o,i[0]),n&&n.set(o,i)),i[1][Ym]=t,i[1][KV]=n,i[1][YV]=r,i[1][tR]},t0e=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((s,o)=>s!==r[o])},qS=(e,t,n,r,s=Object.is)=>{if(s(e,t))return!1;if(!rR(e)||!rR(t))return!0;const o=n.get(JV(e));if(!o)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let a=null;for(const i of o[QV]||[])if(a=Reflect.has(e,i)!==Reflect.has(t,i),a)return a;if(o[J1]===!0){if(a=t0e(e,t),a)return a}else for(const i of o[XV]||[]){const c=!!Reflect.getOwnPropertyDescriptor(e,i),u=!!Reflect.getOwnPropertyDescriptor(t,i);if(a=c!==u,a)return a}for(const i of o[ZV]||[])if(a=qS(e[i],t[i],n,r,s),a)return a;if(a===null)throw new Error("invalid used");return a},tH=e=>()=>{const[,n]=d.useReducer(u=>u+1,0),r=d.useMemo(()=>new WeakMap,[]),s=d.useRef(),o=d.useRef();d.useEffect(()=>{s.current!==o.current&&qS(s.current,o.current,r,new WeakMap)&&(s.current=o.current,n())});const a=d.useCallback(u=>(o.current=u,s.current&&s.current!==u&&!qS(s.current,u,r,new WeakMap)?s.current:(s.current=u,u)),[r]),i=e(a),c=d.useMemo(()=>new WeakMap,[]);return eH(i,r,c)};function s4(e){const t=Ft(e,null),{useSelector:n,useStore:r,useTrackedState:s}=nH(t,e);return{Context:t,useSelector:n,useStore:r,useTrackedState:s}}function nH(e,t){const n=()=>{const o=A.useContext(e);if(!o)throw new Error(`This hook must be used within ${t}.Provider`);return o},r=o=>n()(o),s=tH(r);return{useSelector:r,useStore:n,useTrackedState:s}}function n0e(e,t){const n=new Set,r={source:void 0,derived:void 0},s=()=>{const a=e.getState();return(r.derived===void 0||r.source!==a)&&(r.source=a,r.derived=t(a)),r.derived},o=e.subscribe((a,i)=>{const c=t(a),u=t(i);n.forEach(f=>f(c,u)),r.source=a,r.derived=c});return[{getState:s,getInitialState:()=>t(e.getInitialState()),subscribe:a=>(n.add(a),()=>n.delete(a))},o]}function r0e(e,t){const[n,r]=d.useMemo(()=>n0e(e,t),[e,t]);return d.useEffect(()=>()=>r(),[r]),n}function s0e(e,t){const n=r0e(e,t);return d.useMemo(()=>{const r=s=>Yfe(n,s);return{useSelector:r,useProxy:tH(r)}},[n])}const Yh=(e,t)=>{const n=Ft(e,null),r=i=>{const[c]=A.useState(()=>i.initialValue?t(i?.initialValue):t(void 0));return l.jsx(n.Provider,{value:c,children:i.children})},{useSelector:s,useStore:o,useTrackedState:a}=nH(n,e);return{useSelector:s,useStore:o,useTrackedState:a,Context:n,Provider:r}},Ks=new Hge,zy=new Wge(Ks.getMobileProxy(),Ks),{Provider:o0e,useTrackedState:a0e}=Yh("CometContext",()=>Ks.getStore()),rH=Ft("EntropyBrowserContext",void 0),sH=Ft("McpAdapterContext",void 0),i0e=({children:e})=>{const t=Rn(),n=yfe(),r=An(),{session:s,status:o}=Ne(),{variation:a,loading:i}=Cge(bM),c=qge();d.useLayoutEffect(()=>{c&&window.initialMCPTools!=null&&(zy.initializeFromWindowTools(window.initialMCPTools),window.initialMCPTools=void 0)},[c]),d.useEffect(()=>{i||Ks.setClassifierApiTimeoutMs(a)},[a,i]);const{variation:u,loading:f}=Sge(!1,{android_version:Us()?.android_version??""});d.useEffect(()=>{f||Ks.setUseNativeAgent(u)},[u,f]);const m=s?.user?.id,p=s?.user?.subscription_tier;d.useEffect(()=>{if(r)switch(o){case"authenticated":return m?Ks.notifyUserStateChanged({status:o,userId:m,subscriptionTier:p??"free"}):void 0;case"unauthenticated":return Ks.notifyUserStateChanged({status:o})}},[o,m,p,r]),d.useLayoutEffect(()=>{},[]),d.useLayoutEffect(()=>{const y=Ga();y.erp&&(document.documentElement.dataset.erp=y.erp);const x=Ks.subscribeCometNavigate(({url:S})=>{if(S.origin===window.location.origin&&S.pathname.startsWith(t.base)&&(S.pathname=S.pathname.replace(t.base,""),n(S.pathname))){const C=S.searchParams.toString(),E=`${S.pathname}${C?`?${C}`:""}`;t.push(E,void 0,"Comet navigate");return}{Z.error("Invalid soft navigation in Sidecar",{url:S}),Ks.openTab({url:S.toString()});return}}),v=Ks.getStore(),b=setInterval(()=>{v.getState().sidecarUrlById.forEach((C,E)=>{C.updatedAt{if(Cr(S.sidecarSourceTab,C.sidecarSourceTab))return;const E=S.sidecarSourceTab,T=ro(_.tabId,_.secondaryTab?.tabId),k=ro(E.tabId,E.secondaryTab?.tabId);if(k===T)return;const I=new URL(window.location.href).pathname;lhe(_.tabId,_.secondaryTab?.tabId).forEach(j=>{v.getState().actions.setSidecarUrlById(j,I)});const D=v.getState().sidecarUrlById.get(k)?.url??"/";_=E,D!==I&&(t.replace(D,"Sidecar source tab changed"),Z7(v))});return()=>{clearInterval(b),x(),w()}},[t,n]),d.useEffect(()=>Ks.subscribeToSidecarBrowserTaskStop(y=>{y&&(au({entryUUID:y,reason:"terminate-from-comet-adapter"}),Ks.cleanupTasks(y,"query_stopped"))}),[]);const{variation:h}=HV(!1),g=r?h:c;return l.jsx(o0e,{children:l.jsx(rH.Provider,{value:Ks,children:l.jsxs(sH.Provider,{value:zy,children:[e,g&&l.jsx(c0e,{})]})})})};function un(e=!0){const t=d.useContext(rH);if(!t&&e)throw new Error("useEntropyBrowser must be used inside EntropyBrowserProvider");return t}function l0e(e=!0){const t=d.useContext(sH);if(!t&&e)throw new Error("useMcpAdapter must be used inside EntropyBrowserProvider");return t}const Qn=a0e,c0e=()=>{const e=Qn();return d.useEffect(()=>{zy.refreshDxtAndMcpState().catch(()=>{})},[]),d.useEffect(()=>{if(!e.mcpDisabledServers)try{const t=vt.getItem("mcp_disabled_servers_v1"),n=t?JSON.parse(t):[];e.actions.setMcpDisabledServers(new Set(n))}catch{e.actions.setMcpDisabledServers(new Set)}},[e.mcpDisabledServers,e.actions]),d.useEffect(()=>{if(!e.mcpToolsSettings)try{const t=vt.getItem(Z1),n=t?JSON.parse(t):{};e.actions.setMcpToolsSettings(n)}catch{e.actions.setMcpToolsSettings({})}},[e.mcpToolsSettings,e.actions]),l.jsx(l.Fragment,{children:e.mcpStdioServers?.map(t=>l.jsx(u0e,{server:t},t.name))})},u0e=({server:e})=>{const t=Qn(),{data:n}=mt({queryKey:be.makeQueryKey("comet/mcp_tools",e.name),queryFn:async()=>(await zy.getMcpTools(e.name).catch(()=>[])).map(s=>({...s,mcp_server:e.name,mcp_server_type:Ype.MCP_SERVER_TYPE_LOCAL,app:e.name})),enabled:!!e.name});return d.useEffect(()=>{if(n)return t.actions.setMcpTools(e.name,n),()=>{t.actions.removeMcpTools(e.name)}},[n,t.actions,e.name]),null};function d0e(){if(typeof window>"u")return!1;const e=window;return!!(e?.webkit?.messageHandlers?.pplx?.postMessage||e?.Android?.pplx?.postMessage)}function oH({type:e,data:t}){if(typeof window>"u")return!1;const n=window,r={type:e,data:t};return n?.webkit?.messageHandlers?.pplx?.postMessage?(n.webkit.messageHandlers.pplx.postMessage(r),!0):n?.Android?.pplx?.postMessage?(n.Android.pplx.postMessage(r),!0):!1}function f0e({query:e}){return oH({type:"pplx.ask",data:{query:e}})}const aH=Ft("CanonicalPageContext",{inApp:!1,preferredColorScheme:null,deviceId:null,appVersion:null,isIOS:!1,isAndroid:!1,client:null}),m0e=A.memo(({children:e,inApp:t})=>{const n=fn(),r=On(),s=n?.get("mobile.deviceId")||null,o=n?.get("mobile.appVersion")||null,a=n?.get("mobile.preferredColorScheme")||null,i=n?.get("mobile.client")||null,c=i==="ios",u=i==="android";return d.useEffect(()=>{if(!r?.startsWith("/app")||!n)return;const f=["mobile.","version"],m=new URL(window.location.href.replace("/app",""));m.searchParams.forEach((p,h)=>{f.some(g=>h.startsWith(g))&&m.searchParams.delete(h)}),m.searchParams.set("referrer","canonical"),oH({type:"pplx.url.share",data:{url:m.href}})},[r,n]),l.jsx(aH.Provider,{value:{inApp:t,preferredColorScheme:a,deviceId:s,appVersion:o,isIOS:c,isAndroid:u,client:i},children:e})});m0e.displayName="CanonicalPageProvider";function Sa(){return d.useContext(aH)}async function p0e(){const e=await fetch("/api/version",{method:"GET",headers:{"Content-Type":"application/json"}}),{version:t}=await e.json();return t}const iH=Yh("VoiceSessionStoreContext",()=>Xi(e=>({isActive:!1,setIsActive:t=>e({isActive:t})}))),h0e=iH.Provider,g0e=()=>iH.useStore();function y0e(){const e=g0e();return d.useCallback(()=>e.getState().isActive,[e])}const vd={cacheName:{prefix:"pplx",suffix:"v2",runtime:"runtime",html:"html"}},x0e=[vd.cacheName.prefix,vd.cacheName.html,vd.cacheName.suffix].join("-"),v0e=[vd.cacheName.prefix,vd.cacheName.runtime,vd.cacheName.suffix].join("-");async function lH(){if("serviceWorker"in navigator){await caches.delete(x0e),await caches.delete(v0e);return}}const b0e={SSE:(...e)=>cme(...e)};var Wy;(function(e){e[e.NONE=0]="NONE",e[e.READER=1]="READER",e[e.WRITER=2]="WRITER",e[e.EDITOR=5]="EDITOR",e[e.ADMIN=3]="ADMIN",e[e.OWNER=4]="OWNER",e[e.OWNER_DEFAULT_BOOKMARKS=6]="OWNER_DEFAULT_BOOKMARKS",e[e.INVITED_READER=11]="INVITED_READER",e[e.INVITED_WRITER=12]="INVITED_WRITER",e[e.INVITED_EDITOR=15]="INVITED_EDITOR",e[e.INVITED_ADMIN=13]="INVITED_ADMIN"})(Wy||(Wy={}));function _0e(e){return e>=Wy.WRITER&&e{const E=e.trim(),T=JSON.stringify([{step_type:"INITIAL_QUERY",content:{query:""},uuid:""}]),k=t?{title:c?.article_info?.title??b,url_slug:(c&&"thread_url_slug"in c?c.thread_url_slug:void 0)??_,mode:((c&&"mode"in c?c.mode:void 0)??p)?.toUpperCase()}:void 0,I=s&&_0e(s.user_permission)?s:void 0;return{parent_info:void 0,plan:void 0,summary:void 0,form:void 0,reasoning_plan:void 0,status:"PENDING",reconnectable:!0,final:!1,query_str:E,query_source:S,backend_uuid:g?"":n??"",bookmark_state:s?"BOOKMARKED":"NOT_BOOKMARKED",context_uuid:"",frontend_context_uuid:i??a??"",uuid:r??v,frontend_uuid:r??v,...t?{parent_info:k}:{},author_username:void 0,author_image:void 0,search_focus:y.length===0?"writing":"internet",search_recency_filter:x??void 0,sources:{sources:y},num_sources_display:void 0,personalized:h,attachments:m,blocks:[],social_info:{like_count:0,view_count:0,fork_count:0,user_likes:!1},mode:"COPILOT",text:T??void 0,collection_info:I,is_related_query_result:o??!1,related_queries:[],media_items:[],widget_data:[],widget_intents:[],knowledge_cards:[],related_query_items:[],sources_list:[],answer_modes:[],is_nav_suggestions_disabled:u,structured_answer_block_usages:[],display_model:w,model_preference:w,side_by_side_metadata:C}},uH="DEFAULT_SEARCH_PLACEHOLDER",C0e=(e={})=>{const t=e.uuid??e.frontend_uuid??crypto.randomUUID();return{status:"PENDING",parent_info:void 0,query_str:"",backend_uuid:uH,author_username:void 0,author_image:void 0,search_focus:"internet",display_model:"turbo",personalized:!1,attachments:[],social_info:{like_count:0,view_count:0,fork_count:0,user_likes:!1},text:void 0,collection_info:void 0,image_completions:[],is_related_query_result:!1,final:!1,sources:{sources:["web"]},should_index:!1,updated_datetime:new Date().toISOString(),thread_access:0,thread_url_slug:"",expiry_time:void 0,privacy_state:void 0,context_uuid:"",related_queries:[],media_items:[],widget_data:[],blocks:[],message_mode:"MESSAGE_MODE_UNSPECIFIED",widget_intents:[],knowledge_cards:[],plan:void 0,reasoning_plan:void 0,summary:void 0,form:void 0,sources_list:[],related_query_items:[],answer_modes:[],structured_answer_block_usages:[],...e,frontend_context_uuid:e.frontend_context_uuid??crypto.randomUUID(),frontend_uuid:t,uuid:t,attachment_processing_progress:[]}};var S0e=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)s.hasOwnProperty(o)&&(r[o]=s[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),E0e=Object.prototype.hasOwnProperty;function KS(e,t){return E0e.call(e,t)}function YS(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function yc(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function dH(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function XS(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&c[f-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&p===void 0&&(u[h]===void 0?p=c.slice(0,f).join("/"):f==m-1&&(p=t.path),p!==void 0&&g(t,0,e,p)),f++,Array.isArray(u)){if(h==="-")h=u.length;else{if(n&&!QS(h))throw new ar("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);QS(h)&&(h=~~h)}if(f>=m){if(n&&t.op==="add"&&h>u.length)throw new ar("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var a=M0e[t.op].call(t,u,h,e);if(a.test===!1)throw new ar("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(f>=m){var a=rd[t.op].call(t,u,h,e);if(a.test===!1)throw new ar("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(u=u[h],n&&f0)throw new ar('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ar("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ar("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&XS(e.value))throw new ar("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var s=e.path.split("/").length,o=r.split("/").length;if(s!==o+1&&s!==o)throw new ar("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new ar("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},i=mH([a],n);if(i&&i.name==="OPERATION_PATH_UNRESOLVABLE")throw new ar("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ar("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function mH(e,t,n){try{if(!Array.isArray(e))throw new ar("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)jx(so(t),so(e),n||!0);else{n=n||$y;for(var r=0;r0&&(e.patches=[],e.callback&&e.callback(r)),r}function a4(e,t,n,r,s){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=YS(t),a=YS(e),i=!1,c=a.length-1;c>=0;c--){var u=a[c],f=e[u];if(KS(t,u)&&!(t[u]===void 0&&f!==void 0&&Array.isArray(t)===!1)){var m=t[u];typeof f=="object"&&f!=null&&typeof m=="object"&&m!=null&&Array.isArray(f)===Array.isArray(m)?a4(f,m,n,r+"/"+yc(u),s):f!==m&&(s&&n.push({op:"test",path:r+"/"+yc(u),value:so(f)}),n.push({op:"replace",path:r+"/"+yc(u),value:so(m)}))}else Array.isArray(e)===Array.isArray(t)?(s&&n.push({op:"test",path:r+"/"+yc(u),value:so(f)}),n.push({op:"remove",path:r+"/"+yc(u)}),i=!0):(s&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!i&&o.length==a.length))for(var c=0;c[r.intended_usage,r]));for(const r of t)if(r.diff_block){const s=r.diff_block.field,o=n.get(r.intended_usage)?.[s]??EU,a=r.diff_block.patches??Pe,i=jx(o,a,!1,!1).newDocument;n.set(r.intended_usage,{intended_usage:r.intended_usage,[s]:i})}else n.set(r.intended_usage,r);return Array.from(n.values())}class Ol extends bU{name="PplxStreamError"}const sr=WV();function U0e(e,t,n){return e.reduce((r,s)=>s(r,n),t)}const V0e=(e,t)=>e&&Qfe(e,n=>n!=null);function ey(e){return e?!e.resume_entry_uuid:!1}function H0e(e,t){const n={minuteCount:0,hourCount:0,minuteWindow:Math.floor(Date.now()/6e4),hourWindow:Math.floor(Date.now()/36e5)};return async(...r)=>{const s=Date.now(),o=Math.floor(s/(60*1e3)),a=Math.floor(s/(3600*1e3));return o!==n.minuteWindow&&(n.minuteCount=0,n.minuteWindow=o),a!==n.hourWindow&&(n.hourCount=0,n.hourWindow=a),n.minuteCount>=t.perMinute?{allowed:!1}:n.hourCount>=t.perHour?{allowed:!1}:(n.minuteCount++,n.hourCount++,{allowed:!0,result:await e(...r)})}}function pH(e,t,n){const r=[...e],s=r.findIndex(a=>a.id===t),o=r[s];if(o){if(o.entryIds.includes(n))return e;r[s]={...o,entryIds:[...o.entryIds,n]}}else r.push({id:t,entryIds:[n]});return r}const z0e="2.18",JS=Object.freeze([]),Ud=new Map;function zi(e,t){return t?e.streams[t]:void 0}function i4(e,t){const n=Object.values(e.streams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.entryId===t&&e.activeStreams.includes(o.id.description))return o}}function hH(e,t){const n=Object.values(e.streams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.threadId===t&&e.activeStreams.includes(o.id.description))return o}}const gH=50,W0e=100,oR=1e3;function S_(e,t,n){const r=zi(e,t);if(!r||!e.activeStreams.includes(t))return{newState:e};let s;if(r.threadId){const p=e.threads.find(h=>h.id===r.threadId)?.entryIds?.[0]??void 0;s=p?e.entries[p]?.thread_url_slug:void 0}const o=U0e(e.middlewares,n,s);if(!o)return{newState:e};const a=o.context_uuid,i=o.backend_uuid,c=o.uuid,f=!!!(r.entryId&&r.isReconnect&&e.erroredStreams[r.entryId])&&(!r.threadId||!r.entryId);if(i===uH||i===cH)return{newState:{streams:{...e.streams,[t]:{...r,placeholderChunk:o}}}};if(o.status===Pr.PENDING&&o.blocks?.length===0||o.status===Pr.RESUMING)return{newState:{...e3(e,o,{isFirstMessage:f,placeholderChunk:r.placeholderChunk,streamId:r.id.description}),streams:{...e.streams,[t]:{...r,threadId:o.context_uuid,entryId:i,extraEntryId:c,placeholderChunk:o}}},status:o.status};if(!a||!i)return{newState:e};let m=r;f&&(m={...r,threadId:a,entryId:i,extraEntryId:c});try{return{newState:{...e3(e,o,{isFirstMessage:f,placeholderChunk:r.placeholderChunk,streamId:r.id.description}),streams:{...e.streams,[t]:m}},status:o.status}}catch(p){return r?.abortController?.abort("Failed to ingest message"),{newState:yH(e,t,new Ol("STREAM_FAILED_INGEST_ERROR",{cause:p,details:{request_id:t,backend_uuid:r?.entryId??"unknown"}})),status:Pr.FAILED}}}function e3(e,t,{isFirstMessage:n,placeholderChunk:r,streamId:s}){const o=t.context_uuid,a=t.backend_uuid;let i=Array.from(e.threads);const c={...e.entries};if(i.length>=W0e){const f=i[0];if(i=i.slice(1),f)for(const m of f.entryIds)delete c[m]}if(i=pH(i,o,a),t.status===Pr.COMPLETED)c[a]=t;else if(t.blocks){let f=c[a];f&&f.uuid!==t.uuid?f=r:f||(f=r);const m=f?.frontend_context_uuid??t.frontend_context_uuid??s,p=f?.frontend_uuid??t.frontend_uuid??s,h=f?.query_str??t.query_str,g=f?.connector_auth_info!=null&&!("connector_auth_info"in t)&&!n,y={...f??{},...t,frontend_context_uuid:m,frontend_uuid:p,query_str:h,...g&&{connector_auth_info:void 0},blocks:B0e(n?JS:f?.blocks??JS,t.blocks)};c[a]=y}const u=Ud.get(a);return Ud.set(a,{start:u?.start??Date.now(),latest:Date.now(),attempts:u?.attempts??1}),{threads:i,entries:c}}function yH(e,t,n){Z.error("Error in reading stream",n);const r=zi(e,t);if(!r)return e;const s=r?.entryId;if(!s)return e;const o={...e.entries[s],status:Pr.FAILED},{promise:a,abortController:i,...c}=r;return{activeStreams:e.activeStreams.filter(u=>u!==t),erroredStreams:{...e.erroredStreams,[s]:{...c,code:n instanceof kU?n.code:void 0}},entries:{...e.entries,[s]:o}}}const aR=Object.freeze([V0e]);function Qh(e,t){return(e.threads.find(r=>r.id===t.threadId)?.entryIds.map(r=>e.entries[r])??JS).filter(r=>r!=null)}function G0e(e,t){const n=zi(e,t);n&&(Ud.delete(n.entryId??""),sr.emit("completed",{stream:n,thread:Qh(e,n),message:n.entryId?e.entries[n.entryId]:void 0}))}function $0e(e,t,n,r){const s=zi(e,t);s&&sr.emit("progress",{stream:s,thread:Qh(e,s),message:e.entries[n.backend_uuid]??n,isFirstMessage:r})}function q0e(e,t,n){const r=zi(e,t);r&&sr.emit("error",{stream:r,thread:Qh(e,r),message:r.entryId?e.entries[r.entryId]:void 0,error:n,messageStreamMeta:Ud.get(r.entryId??"")})}function K0e(e,t,n,r){const s=zi(e,t);s&&sr.emit("created",{stream:s,thread:Qh(e,s),message:s.entryId?e.entries[s.entryId]:void 0,query:n,params:r})}function Y0e(e,t){const n=zi(e,t);n&&sr.emit("aborted",{stream:n,thread:Qh(e,n),message:n.entryId?e.entries[n.entryId]:void 0})}const Q0e=(e,t)=>({threads:[],entries:{},activeStreams:[],erroredStreams:{},middlewares:aR,streams:{},actions:{getEntryById:n=>t().entries[n],createStream:n=>t().actions.createBackwardsCompatibleStream(n,{reason:"create-stream",timer:Wa(void 0,{nowFromTimeOrigin:performance.now()})}).id,retryStream:n=>{const r=t().entries[n];if(!r)return!1;const s=t().erroredStreams[n];if(!s)return!1;const o=s.placeholderChunk?.query_str;if(!o)return!1;if(e(a=>{const{entries:i,threads:c}=a,{[n]:u,...f}=i,m=Array.from(c),p=c.findIndex(h=>h.entryIds.includes(n));return p===-1?a:(m.splice(p,1,{id:m[p].id,entryIds:m[p].entryIds}),{threads:m,entries:f})}),!ey(s.params))throw new Error("Stream params are not SubmitParams so cannot retry");return!!t().actions.createBackwardsCompatibleStream({query_str:o,params:{...s.params,existing_entry_uuid:n,query_source:"retry",frontend_context_uuid:r.frontend_context_uuid}},{placeholderChunk:s.placeholderChunk,timer:Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:"retry-stream"})},reconnectStream:n=>{const r=i4(t(),n);if(r&&r.promise&&r.abortController&&!r.abortController.signal.aborted)return r.id;const s=t().entries[n],o=s?.cursor,a=t().actions.createBackwardsCompatibleStream({query_str:"",params:{resume_entry_uuid:n,cursor:o}},{isReconnect:!0,timer:Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:"reconnect-stream"});e(c=>S_(c,a.id.description,{...s,status:Pr.PENDING}).newState,void 0,"ingestPlaceholderChunk");const i=Ud.get(n);return Ud.set(n,{start:i?.start??Date.now(),latest:i?.latest??Date.now(),attempts:(i?.attempts??0)+1}),a.id},createBackwardsCompatibleStream:(n,{isReconnect:r,placeholderChunk:s,onFirstMessageReceived:o,timer:a,reason:i})=>{const c=Array.from(t().activeStreams),u={...t().streams};if(c.length>=gH){const x=c.shift();try{x&&(u[x]?.abortController?.abort("Forced abort"),u[x]={...u[x],promise:null,abortController:null})}catch(v){Z.error("Failed to abort stream",new Ol("STREAM_FAILED_ABORT_ERROR",{cause:v,details:{request_id:x??"unknown",backend_uuid:"unknown"}}))}}const f=n.params?.frontend_uuid??crypto.randomUUID(),m=new AbortController,p={id:{description:f},promise:Promise.resolve(),abortController:m,isReconnect:r,entryId:n.params?.resume_entry_uuid,params:n.params,timer:a},h={message:async x=>{const v=zi(t(),f);if(v?.abortController?.signal.aborted)return;let b=!1;v?.threadId||(b=!0,o?.(x)),e(_=>{const{newState:w,status:S}=S_(_,f,x);if(S===Pr.FAILED&&v&&v.entryId){const{promise:C,abortController:E,...T}=v;return{...w,erroredStreams:{..._.erroredStreams,[v.entryId]:T}}}return w},void 0,"ingest"),v&&$0e(t(),f,x,b)}},g=n.params?.query_source==="default_search",y={[yn]:f};return Z.info("Starting stream",{request_id:f}),p.promise=(r?b0e.SSE("/rest/sse/perplexity_ask/reconnect/{resume_entry_uuid}",i,{path:{resume_entry_uuid:n.params?.resume_entry_uuid??""},params:{cursor:n.params?.cursor},signal:m.signal,handlers:h,headers:y}):de.SSE("/rest/sse/perplexity_ask",i,{params:{...n,params:{...n.params,version:z0e}},signal:m.signal,handlers:h,metrics:{omnisearch:g},timer:a,headers:y})).then(()=>G0e(t(),f),x=>{const v=t(),b=zi(v,f);b&&(e(_=>yH(_,f,new Ol("STREAM_FAILED_STREAM_ERROR",{cause:x,details:{request_id:f,backend_uuid:b.entryId??"unknown"}})),void 0,"handleStreamError"),q0e(v,f,x))}).finally(()=>{e(({activeStreams:x,streams:v})=>({streams:{...v,[f]:{...v[f],promise:null,abortController:null}},activeStreams:x.filter(b=>b!==f)}),void 0,"cleanupBackwardsCompatibleStream")}),c.push(f),e({activeStreams:c,streams:{...u,[f]:p}},void 0,"createBackwardsCompatibleStream"),K0e(t(),f,n.query_str,n.params),p.abortController?.signal.addEventListener("abort",()=>{Y0e(t(),f)}),s&&e(x=>S_(x,f,s).newState,void 0,"ingestPlaceholderChunk"),p},setMiddlewares:n=>{e(()=>({middlewares:[...aR,...n]}))}}}),l4=Yh("StreamStateContext",()=>Xi()(Xfe(Q0e))),Zp=l4.useSelector,xH=l4.useStore,X0e=()=>{const e=xH(),t=d.useMemo(()=>H0e(e.getState().actions.reconnectStream,{perMinute:20,perHour:120}),[e]);return d.useEffect(()=>{function n(){const a=e.getState(),i=new Set(a.activeStreams),c=new Set(Object.values(a.streams).filter(u=>i.has(u.id.description)).map(u=>u.entryId));Object.values(a.entries).forEach(u=>{const f=u.frontend_uuid?e.getState().streams[u.frontend_uuid]:void 0;f&&f.abortController?.signal.aborted||u?.reconnectable&&i.size{clearInterval(r),window.removeEventListener("online",s,!0),window.removeEventListener("offline",o,!0)}},[t,e]),null},vH=A.memo(({children:e})=>l.jsxs(l4.Provider,{children:[l.jsx(X0e,{}),e]}));vH.displayName="StreamStateProvider";const Z0e=()=>Zp(e=>e.actions.createBackwardsCompatibleStream),J0e=()=>Zp(e=>e.actions.reconnectStream),e1e=()=>Zp(e=>e.actions.retryStream),bH=e=>{const t=Zp(s=>s.activeStreams),n=Zp(s=>s.streams),r=Object.values(n).find(s=>s.id.description===e);return!!(r&&t.includes(r?.id.description))},Hs=()=>xH(),t1e=()=>{const e=Hs();return d.useCallback((t,n)=>{t&&e.setState(r=>{const s=r.entries[t],o=i4(r,t);if(o&&o.promise&&o.abortController&&!o.abortController.signal.aborted&&Z.error("Attempting to mutate entries while stream is active"),!s||!n)return r;const a=n(s);return a?{...r,entries:{...r.entries,[t]:a}}:r},void 0,"mutateEntry")},[e])},n1e=()=>{const e=Hs();return d.useCallback((t,n,{terminateStream:r=!0}={})=>{t&&e.setState(s=>{if(!t)return s;hH(s,t)&&r&&Z.error("Attempting to mutate entries while stream is active");const a=s.threads.findIndex(p=>p.id===t);if(a===-1)return s;const i=s.threads[a];if(!i)return s;const u=i.entryIds.map(p=>s.entries[p]).filter(p=>p!=null),f=n?.(u);if(!f)return s;const m=Array.from(s.threads);return m.splice(a,1,{...i,entryIds:f.map(p=>p.backend_uuid)}),{...s,entries:{...s.entries,...f.reduce((p,h)=>(p[h.backend_uuid]=h,p),{})},threads:m}},void 0,"mutateEntries")},[e])},r1e=()=>{const e=Hs();return d.useCallback(t=>{t&&e.setState(n=>{const r=n.entries[t],s=i4(n,t);if(s&&s.promise&&s.abortController&&!s.abortController.signal.aborted&&s.abortController?.abort("Forced abort"),!r)return n;const o={...n.entries};delete o[t];const a=n.threads.map(i=>{const c=i.entryIds.indexOf(t);if(c===-1)return i;const u=[...i.entryIds];if(u.splice(c,1),!!u.length)return{...i,entryIds:u}}).filter(i=>!!i);return{...n,entries:o,threads:a}},void 0,"deleteEntry")},[e])},s1e=()=>{const e=Hs();return d.useCallback(t=>{t&&e.setState(n=>{if(!t)return n;const r=hH(n,t);r&&r.abortController?.abort("Forced abort");const s=n.threads.findIndex(u=>u.id===t);if(s===-1)return n;const o=n.threads[s];if(!o)return n;const a=o.entryIds;let i;a.length?(i={...n.entries},a.forEach(u=>delete i[u])):i=n.entries;const c=n.threads.filter(u=>u.id!==t);return{...n,entries:i,threads:c}},void 0,"deleteEntries")},[e])};function o1e(e){const t=Hs(),n=Object.values(t.getState().erroredStreams),r=n.length;for(let s=r-1;s>=0;s--){const o=n[s];if(o.entryId===e)return o}}const _H=A.memo(({middlewares:e})=>{const t=Hs();return d.useLayoutEffect(()=>{t.getState().actions.setMiddlewares(e)},[e,t]),null});_H.displayName="MiddlewareRegistry";function c4(){const e=Hs();return d.useCallback(t=>e.getState().streams[t]?.timer,[e])}function a1e(){const e=Hs();return d.useCallback(()=>e.getState().activeStreams.length>0,[e])}const wH=1e3*60,iR=60*wH,i1e=wH/2,l1e={isOutdated:()=>!1,canRefresh:()=>!1,refresh:async()=>!1},CH=Ft("RefreshContext",{outdated:!1,refresh:async()=>!1,canRefresh:()=>!1}),SH=A.memo(({children:e,enabled:t,buildVersion:n,ref:r})=>{const{session:s}=Ne(),o=s?.user?.email?.endsWith("@perplexity.ai"),a=a1e(),i=y0e(),{env:{isLocalhost:c}}=sn(),u=d.useRef(n),[f,m]=d.useState(!1),[p,h]=d.useState(0),g=t&&f,y=d.useCallback(async()=>{try{const _=nV()?.comet_web_resources_extension_version;if(c||f||!t)return;const w=await p0e();if(Pl("build_version_refresh_check_version",{isCometSidecarClient:!0,currentVersion:n,latestVersion:w}),!n&&w){u.current=w;return}n&&w&&w!==n&&(m(!0),h(o?Date.now():Date.now()+Math.random()*iR))}catch{Z.log("Error getting build version")}},[n,t,o,c,f]),x=d.useCallback(()=>!(!g||!p||document.hidden||a()||i()||Date.now(){if(!g||!p)return!1;if(!x())return!0;try{await lH()}catch{Z.log("Error clearing service worker runtime cache")}try{await IU()}catch{Z.log("Error clearing persisted cache")}return Pl("build_version_refresh"),_?No(_,"Build version refresh (redirect)"):hx("Build version refresh (reload)"),!1},[x,g,p]),b=d.useMemo(()=>Cf(y,i1e,{maxWait:iR,leading:!1,trailing:!0}),[y]);return d.useEffect(()=>(document.addEventListener("visibilitychange",b),window.addEventListener("focus",b),window.addEventListener("keydown",b),window.addEventListener("mousedown",b),()=>{document.removeEventListener("visibilitychange",b),window.removeEventListener("focus",b),window.removeEventListener("keydown",b),window.removeEventListener("mousedown",b)}),[b]),d.useImperativeHandle(r,()=>({isOutdated:()=>g,canRefresh:()=>x(),refresh:async _=>await v(_)})),l.jsx(CH.Provider,{value:d.useMemo(()=>({outdated:g,refresh:v,canRefresh:x}),[g,v,x]),children:e})});SH.displayName="RefreshProvider";const c1e=()=>d.useContext(CH);var Xo={},lR;function u1e(){if(lR)return Xo;lR=1;var e=Xo&&Xo.__awaiter||function(s,o,a,i){function c(u){return u instanceof a?u:new a(function(f){f(u)})}return new(a||(a=Promise))(function(u,f){function m(g){try{h(i.next(g))}catch(y){f(y)}}function p(g){try{h(i.throw(g))}catch(y){f(y)}}function h(g){g.done?u(g.value):c(g.value).then(m,p)}h((i=i.apply(s,o||[])).next())})};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.identify=Xo.subscribe=Xo.publish=void 0;const t=(s,o)=>{window.todesktop.ipc.publish(s,o)};Xo.publish=t;const n=(s,o)=>window.todesktop.ipc.subscribe(s,o);Xo.subscribe=n;const r=()=>e(void 0,void 0,void 0,function*(){return window.todesktop.ipc.identify()});return Xo.identify=r,Xo}var cR=u1e();const Xh=()=>{const{device:{isWindowsApp:e}}=sn(),t=d.useRef({}),n=d.useRef({}),r=d.useCallback((o,a)=>{if(e)try{cR.publish(o,a)}catch{try{if(typeof BroadcastChannel<"u"){let c=t.current[o];c||(c=new BroadcastChannel(o),t.current[o]=c),c.postMessage(a)}else Z.warn("Neither IPC publish nor BroadcastChannel are available in this runtime")}catch(c){Z.warn("Error using BroadcastChannel: ",c)}}},[e]),s=d.useCallback((o,a)=>{if(e)try{return cR.subscribe(o,a)}catch{try{if(typeof BroadcastChannel<"u"){let c=t.current[o];c||(c=new BroadcastChannel(o),t.current[o]=c);let u=n.current[o];u||(u=new Set,n.current[o]=u);const f=m=>{a(m.data)};return u.add(a),c.addEventListener("message",f),()=>{c.removeEventListener("message",f),u.delete(a),u.size===0&&(c.close(),delete t.current[o],delete n.current[o])}}Z.warn("Neither IPC subscribe nor BroadcastChannel are available in this runtime");return}catch(c){Z.warn("Error using BroadcastChannel: ",c);return}}},[e]);return d.useMemo(()=>({safeWindowsIpcPublish:r,safeWindowsIpcSubscribe:s}),[r,s])},Ix=()=>{const{device:{isWindowsApp:e}}=sn(),[t,n]=d.useState(void 0);return d.useEffect(()=>{e&&q(()=>import("./index-DxZN0OQK.js"),[]).then(r=>n(r))},[e]),t},EH=Ft("WindowsAppPanelContext",null),d1e=({children:e})=>{const t=d.useRef(null),n=d.useRef(!1),r=On(),{device:{isWindowsApp:s}}=sn(),[o,a]=d.useState(!1),i=Ix(),{safeWindowsIpcPublish:c,safeWindowsIpcSubscribe:u}=Xh(),f=!!(s&&r?.includes(Yp));d.useEffect(()=>{if(!f)return;const x=u(z7,v=>{a(v)});return()=>{x?.()}},[f,u]);const m=d.useCallback(async()=>{if(!i)return;const x=await i.nativeWindow.isVisible({ref:t.current}),v=b=>{a(b),c(z7,b)};return v(x),i.nativeWindow.on("show",()=>v(!0),{ref:t.current}),i.nativeWindow.on("hide",()=>v(!1),{ref:t.current}),()=>{try{t.current&&(i.nativeWindow.removeAllListeners("show",{ref:t.current}),i.nativeWindow.removeAllListeners("hide",{ref:t.current}))}catch(b){Z.warn("Error removing window listeners during cleanup",b)}}},[t,i,c]),p=d.useCallback(async()=>{if(!i)return!1;if(n.current)return Z.info("Already creating window, skipping"),!1;if(t.current)try{return await i.nativeWindow.isVisible({ref:t.current}),Z.info("Existing window is still valid, skipping creation"),!0}catch{Z.warn("Existing window reference is invalid, will create new window"),t.current=null}try{Z.info("Starting panel window creation"),n.current=!0;const x=await i.nativeWindow.create({width:720,height:350,transparent:!0,show:!1,frame:!1,alwaysOnTop:!0,type:"panel"});if(!x)throw new Error("Failed to create window - no window reference returned");const v=await i.nativeWindow.getWebContents({ref:x});if(!v)throw new Error("Failed to get web contents");const b=await i.views.create({webPreferences:{nodeIntegration:!0,contextIsolation:!1}});if(!b)throw new Error("Failed to create view");await i.nativeWindow.setBrowserView({ref:x,viewRef:b});const _=new URL(Yp,window.location.origin).toString();await i.webContents.loadURL({ref:v},_),t.current=x;const w=await m();if(w){const S=t.current;i.nativeWindow.on("close",w,{ref:S})}return i.nativeWindow.on("close",()=>{},{ref:x,preventDefault:!0}),!0}catch(x){return Z.error("Error creating panel window: ",x),t.current=null,!1}finally{n.current=!1}},[m,i]),h=d.useCallback(async()=>{if(!i)return!1;try{if(!t.current)return Z.info("No panel window to hide"),!1;try{return await i.nativeWindow.hide({ref:t.current}),!0}catch(x){return Z.warn("Error hiding panel, window may be invalid",x),t.current=null,!1}}catch(x){return Z.warn("Error in hidePanel: ",x),!1}},[i]),g=d.useCallback(async()=>{if(i)try{if(t.current){if(o){Z.info("Panel window is already visible, skipping centering");return}}else if(!await p())return;const x=await i.screen.getCursorScreenPoint(),v=(await i.screen.getDisplayNearestPoint(x)).bounds,[b=0,_]=await i.nativeWindow.getSize({ref:t.current});await i.nativeWindow.setPosition({ref:t.current},Math.round(v.x+(v.width-b)/2),Math.round(v.y+v.height*.3)),await i.nativeWindow.show({ref:t.current}),await i.nativeWindow.focus({ref:t.current})}catch(x){Z.warn("Error showing panel: ",x)}},[p,o,i]),y={isVisible:o,isWindowsAppPanelView:f,handleShowPanel:g,handleHidePanel:h,createPanelWindow:p};return l.jsx(EH.Provider,{value:y,children:e})},Px=()=>{const e=d.useContext(EH);if(!e)throw new Error("useWindowsAppPanel must be used within a WindowsAppPanelProvider");return e},kH={keyProp:0,message:null,variant:"success",timeout:null,description:void 0,isVisible:!1,ctaText:void 0,ctaOnClick:void 0,openToast:()=>{},closeToast:()=>{}},MH=Ft("ToastStateContext",kH),TH=A.memo(({children:e})=>{const[t,n]=d.useState(kH),r=d.useCallback(({message:a,variant:i,timeout:c,description:u,ctaText:f,ctaOnClick:m,iconOverride:p,position:h="top"})=>{n(g=>({...g,message:a,variant:i,timeout:c,description:u,ctaText:f,ctaOnClick:m,iconOverride:p,position:h??"top",isVisible:!0,keyProp:(g.keyProp||0)+1}))},[]),s=d.useCallback(()=>{n(a=>({...a,isVisible:!1}))},[]),o=d.useMemo(()=>({...t,openToast:r,closeToast:s}),[t,r,s]);return l.jsx(MH.Provider,{value:o,children:e})});TH.displayName="ToastStateProvider";const hn=()=>{const e=d.useContext(MH);if(!e)throw new Error("useToastState must be used within ToastContext");return e},f1e="pplx.hasUpdated",AH=A.memo(()=>{const{outdated:e,refresh:t}=c1e(),{openToast:n}=hn(),{isWindowsAppPanelView:r}=Px(),{inApp:s}=Sa(),{$t:o}=J(),a=Ca(),[i,c]=xfe(f1e,!1);return d.useEffect(()=>{i&&!r&&!s&&(c(!1),n({message:o({defaultMessage:"Updated to latest version",id:"5SFf7ytcaw"}),variant:"success",timeout:4}))},[]),d.useEffect(()=>{if(!e)return;!a&&c(!0);let u=!1;return(async function f(){const m=await t();u||m&&(await new Promise(p=>setTimeout(p,60*1e3)),f())})(),()=>{u=!0}},[a,e,t,c]),null});AH.displayName="IdleRefresh";const NH=A.memo(function(){const{session:t}=Ne(),n=d.useMemo(()=>{if(t)return{id:t.user.id,name:t.user.name,email:t.user.email,isPro:!!t.user.subscription_status&&t.user.subscription_status!=="none"}},[t]);if(!n)return null;const r=OU(globalThis.navigator?.userAgent??"");return l.jsxs(l.Fragment,{children:[l.jsx(vfe,{session:n,isWindowsApp:r}),l.jsx(bfe,{session:n,isWindowsApp:r})]})});NH.displayName="Instrumentation";async function m1e(){try{return(await(await fetch("/cdn-cgi/trace")).text()).split(` -`).reduce((n,r)=>{const[s,o]=r.split("=");return n[s]=o??"",n},{loc:"US"})}catch(e){return Z.error("Error getting Cloudflare trace",e),{loc:"US"}}}function Ox(){const{data:e}=mt({queryKey:be.makeEphemeralQueryKey("cloudflare-trace"),queryFn:m1e,staleTime:6e4});return d.useMemo(()=>e?.loc??"US",[e])}const p1e=({children:e,hostname:t})=>{const{session:n}=Ne(),r=Ox();return l.jsx(pge,{hostname:t,session:n??void 0,cfCountry:r,children:e})},h1e="useModalContext must be used within a ModalProvider";function Uo(){const e=d.useContext(ume);return dme(e,h1e),e}var ie;(function(e){e.DEFAULT="turbo",e.PPLX_PRO_UPGRADED="pplx_pro_upgraded",e.PRO="pplx_pro",e.SONAR="experimental",e.GPT_4o="gpt4o",e.GPT_4_1="gpt41",e.GPT_5_1="gpt51",e.GPT_5_2="gpt52",e.CLAUDE_2="claude2",e.GEMINI_2_5_PRO="gemini25pro",e.GEMINI_3_0_PRO="gemini30pro",e.GEMINI_3_0_FLASH="gemini30flash",e.GEMINI_3_0_FLASH_HIGH="gemini30flash_high",e.GROK="grok",e.PPLX_REASONING="pplx_reasoning",e.CLAUDE_3_7_SONNET_THINKING="claude37sonnetthinking",e.O4_MINI="o4mini",e.GPT_5_1_THINKING="gpt51_thinking",e.GPT_5_2_THINKING="gpt52_thinking",e.CLAUDE_4_0_OPUS="claude40opus",e.CLAUDE_4_1_OPUS="claude41opus",e.CLAUDE_4_5_OPUS="claude45opus",e.CLAUDE_4_0_OPUS_THINKING="claude40opusthinking",e.CLAUDE_4_1_OPUS_THINKING="claude41opusthinking",e.CLAUDE_4_5_OPUS_THINKING="claude45opusthinking",e.CLAUDE_4_5_SONNET="claude45sonnet",e.CLAUDE_4_5_SONNET_THINKING="claude45sonnetthinking",e.KIMI_K2_THINKING="kimik2thinking",e.GROK_4="grok4",e.GROK_4_NON_THINKING="grok4nonthinking",e.GROK_4_1_REASONING="grok41reasoning",e.GROK_4_1_NON_REASONING="grok41nonreasoning",e.PPLX_SONAR_INTERNAL_TESTING="pplx_sonar_internal_testing",e.PPLX_SONAR_INTERNAL_TESTING_V2="pplx_sonar_internal_testing_v2",e.ALPHA="pplx_alpha",e.BETA="pplx_beta",e.STUDY="pplx_study"})(ie||(ie={}));var nt;(function(e){e.GPT_4="gpt4",e.CLAUDE_3_OPUS="claude3opus",e.CLAUDE_3_5_HAIKU="claude35haiku",e.GEMINI="gemini",e.LLAMA_X_LARGE="llama_x_large",e.MISTRAL="mistral",e.GROK2="grok2",e.COPILOT="copilot",e.O3_MINI="o3mini",e.CLAUDE_OMBRE_EAP="claude_ombre_eap",e.CLAUDE_LACE_EAP="claude_lace_eap",e.R1="r1",e.GAMMA="pplx_gamma",e.O3="o3",e.GEMINI_2_FLASH="gemini2flash",e.GPT_5="gpt5",e.GPT_5_THINKING="gpt5_thinking",e.GPT5_PRO="gpt5_pro",e.O3_PRO="o3pro",e.O3_PRO_RESEARCH="o3pro_research",e.O3_PRO_LABS="o3pro_labs",e.TESTING_MODEL_C="testing_model_c",e.O3_RESEARCH="o3_research",e.CLAUDE40SONNET_RESEARCH="claude40sonnet_research",e.CLAUDE40SONNETTHINKING_RESEARCH="claude40sonnetthinking_research",e.CLAUDE40OPUS_RESEARCH="claude40opus_research",e.CLAUDE40OPUSTHINKING_RESEARCH="claude40opusthinking_research",e.O3_LABS="o3_labs",e.CLAUDE40SONNETTHINKING_LABS="claude40sonnetthinking_labs",e.CLAUDE40OPUSTHINKING_LABS="claude40opusthinking_labs"})(nt||(nt={}));var oe;(function(e){e.SEARCH="search",e.RESEARCH="research",e.STUDIO="studio",e.STUDY="study"})(oe||(oe={}));var Jn;(function(e){e.PRO="pro",e.MAX="max"})(Jn||(Jn={}));const RH={[ie.DEFAULT]:oe.SEARCH,[ie.PPLX_PRO_UPGRADED]:oe.SEARCH,[ie.PRO]:oe.SEARCH,[ie.SONAR]:oe.SEARCH,[ie.CLAUDE_2]:oe.SEARCH,[ie.CLAUDE_4_5_SONNET]:oe.SEARCH,[ie.CLAUDE_4_5_SONNET_THINKING]:oe.SEARCH,[ie.KIMI_K2_THINKING]:oe.SEARCH,[ie.GPT_4o]:oe.SEARCH,[ie.GPT_4_1]:oe.SEARCH,[ie.GPT_5_1]:oe.SEARCH,[ie.GPT_5_2]:oe.SEARCH,[ie.GEMINI_2_5_PRO]:oe.SEARCH,[ie.GEMINI_3_0_PRO]:oe.SEARCH,[ie.GEMINI_3_0_FLASH]:oe.SEARCH,[ie.GEMINI_3_0_FLASH_HIGH]:oe.SEARCH,[ie.GROK]:oe.SEARCH,[ie.PPLX_REASONING]:oe.SEARCH,[ie.CLAUDE_3_7_SONNET_THINKING]:oe.SEARCH,[ie.CLAUDE_4_0_OPUS]:oe.SEARCH,[ie.CLAUDE_4_0_OPUS_THINKING]:oe.SEARCH,[ie.CLAUDE_4_1_OPUS]:oe.SEARCH,[ie.CLAUDE_4_1_OPUS_THINKING]:oe.SEARCH,[ie.CLAUDE_4_5_OPUS]:oe.SEARCH,[ie.CLAUDE_4_5_OPUS_THINKING]:oe.SEARCH,[ie.GROK_4]:oe.SEARCH,[ie.GROK_4_NON_THINKING]:oe.SEARCH,[ie.GROK_4_1_REASONING]:oe.SEARCH,[ie.GROK_4_1_NON_REASONING]:oe.SEARCH,[ie.GPT_5_1_THINKING]:oe.SEARCH,[ie.GPT_5_2_THINKING]:oe.SEARCH,[ie.PPLX_SONAR_INTERNAL_TESTING]:oe.SEARCH,[ie.PPLX_SONAR_INTERNAL_TESTING_V2]:oe.SEARCH,[nt.TESTING_MODEL_C]:oe.SEARCH,[nt.GPT_5_THINKING]:oe.SEARCH,[nt.GPT_5]:oe.SEARCH,[nt.GPT5_PRO]:oe.SEARCH,[nt.GPT_4]:oe.SEARCH,[nt.CLAUDE_3_OPUS]:oe.SEARCH,[nt.CLAUDE_3_5_HAIKU]:oe.SEARCH,[nt.GEMINI]:oe.SEARCH,[nt.LLAMA_X_LARGE]:oe.SEARCH,[nt.MISTRAL]:oe.SEARCH,[nt.GROK2]:oe.SEARCH,[nt.COPILOT]:oe.SEARCH,[nt.O3_MINI]:oe.SEARCH,[nt.CLAUDE_OMBRE_EAP]:oe.SEARCH,[nt.CLAUDE_LACE_EAP]:oe.SEARCH,[nt.R1]:oe.SEARCH,[nt.GAMMA]:oe.SEARCH,[nt.O3]:oe.SEARCH,[nt.GEMINI_2_FLASH]:oe.SEARCH,[nt.O3_PRO]:oe.SEARCH,[nt.O3_PRO_RESEARCH]:oe.RESEARCH,[nt.O3_PRO_LABS]:oe.STUDIO,[nt.O3_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40SONNET_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40SONNETTHINKING_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40OPUS_RESEARCH]:oe.RESEARCH,[nt.CLAUDE40OPUSTHINKING_RESEARCH]:oe.RESEARCH,[nt.O3_LABS]:oe.STUDIO,[nt.CLAUDE40SONNETTHINKING_LABS]:oe.STUDIO,[nt.CLAUDE40OPUSTHINKING_LABS]:oe.STUDIO,[ie.ALPHA]:oe.RESEARCH,[ie.O4_MINI]:oe.RESEARCH,[ie.BETA]:oe.STUDIO,[ie.STUDY]:oe.STUDY},an=(e,t=oe.SEARCH)=>e&&RH[e]||t,DH={[oe.SEARCH]:$me,[oe.RESEARCH]:hM,[oe.STUDIO]:pM,[oe.STUDY]:Gme},t3=e=>DH[e],g1e={...DH,[oe.SEARCH]:B("search")},y1e=e=>g1e[e],x1e={auto:{model:ie.DEFAULT,mode:oe.SEARCH},reasoning:{model:ie.PPLX_REASONING,mode:oe.SEARCH},deep_research:{model:ie.ALPHA,mode:oe.RESEARCH}},jH=e=>typeof e=="string"&&e in RH,v1e=e=>jH(e)?e:void 0,uR=Object.values(oe),b1e=[{search_model:ie.SONAR,has_new_tag:!1,subscription_tier:Jn.PRO},{search_model:ie.CLAUDE_4_5_SONNET,has_new_tag:!0,subscription_tier:Jn.PRO},{search_model:ie.CLAUDE_4_5_SONNET_THINKING,has_new_tag:!0,is_reasoning_model:!0,subscription_tier:Jn.PRO},{search_model:ie.CLAUDE_4_1_OPUS_THINKING,has_new_tag:!1,is_reasoning_model:!0,subscription_tier:Jn.MAX},{search_model:ie.GEMINI_2_5_PRO,has_new_tag:!1,subscription_tier:Jn.PRO},{search_model:ie.GPT_5_1,has_new_tag:!0,subscription_tier:Jn.PRO},{search_model:ie.GPT_5_1_THINKING,has_new_tag:!0,is_reasoning_model:!0,subscription_tier:Jn.PRO},{search_model:ie.GROK_4,has_new_tag:!1,is_reasoning_model:!0,subscription_tier:Jn.PRO}],Cxt=e=>e?[nt.GPT_5_THINKING,ie.GROK_4,ie.GROK_4_1_REASONING,ie.CLAUDE_4_0_OPUS_THINKING,ie.CLAUDE_4_1_OPUS_THINKING,ie.CLAUDE_4_5_OPUS_THINKING,nt.O3_PRO,nt.GPT5_PRO].includes(e):!1,u4=Yh("AskInputContext",()=>Xi((e,t)=>({activeMenu:null,fileUploadUpsellTooltipOpen:!1,suggestions:Pe,blankStateSuggestions:{[oe.SEARCH]:null,[oe.RESEARCH]:null,[oe.STUDIO]:null,[oe.STUDY]:null},showSuggestDropdown:!1,browserAgentAllowOnceFromToggle:!1,forceEnableBrowserAgent:!1,actions:{onActiveMenuChange:n=>{e({activeMenu:n})},setFileUploadUpsellTooltipOpen:n=>{e({fileUploadUpsellTooltipOpen:n})},setSuggestions:n=>{e({suggestions:n})},setBlankStateSuggestions:(n,r)=>{const s=t().blankStateSuggestions;e({blankStateSuggestions:{...s,[r]:n}})},setShowSuggestDropdown:n=>{e({showSuggestDropdown:n})},setBrowserAgentAllowOnce:n=>{e({browserAgentAllowOnceFromToggle:n})},setForceEnableBrowserAgent:n=>{e({forceEnableBrowserAgent:n})}},inputRef:d.createRef()}))),Wc=u4.Provider,_1e=u4.useSelector,w1e=u4.useTrackedState,jo=()=>_1e(e=>e.actions),qr=w1e,C1e={pro:"pro",max:"max"},S1e=e=>Object.keys(C1e).includes(e);function $t(){const{session:e}=Ne(),t=e?.user?.subscription_status??"none",n=t==="active"||t==="trialing"||t==="white_glove_past_due",r=e?.user?.subscription_tier,s=S1e(r)?r:void 0,o=n&&(s==="pro"||!s),a=n&&s==="max",i=o||a,c=n?e?.user?.subscription_source:"none",u=n&&c==="enterprise",f=u&&(s==="pro"||!s),m=u&&s==="max";return d.useMemo(()=>({isPro:o,isMax:a,hasAccessToProFeatures:i,hasActiveSubscription:n,subscriptionSource:c,subscriptionStatus:t,subscriptionTier:s,isEnterprise:u,isEnterprisePro:f,isEnterpriseMax:m}),[i,a,o,n,c,t,s,u,f,m])}const dR=1e9;function E1e(e,t){const{event_entity:n,event_type:r,value_upper_bound:s,value_lower_bound:o}=e;let a="";return r==="STOCK_PRICE_TARGET"?o!=null?a=t.formatMessage({defaultMessage:"goes below ${value}",id:"RKgpKR3E99"},{value:o}):s!=null?a=t.formatMessage({defaultMessage:"goes above ${value}",id:"8eV5ClXcpi"},{value:s}):a=t.formatMessage({defaultMessage:"price target",id:"vnTdzDaohg"}):r==="STOCK_PRICE_MOVEMENT"?o!=null?a=t.formatMessage({defaultMessage:"drops {percent}%+",id:"Vl3IJiE9mt"},{percent:Math.abs(o)}):s!=null?a=t.formatMessage({defaultMessage:"rises {percent}%+",id:"EK4T00JAfI"},{percent:s}):a=t.formatMessage({defaultMessage:"price movement",id:"Pcu8sUjesQ"}):a=t.formatMessage({defaultMessage:"event triggers",id:"LpIhmla5ty"}),{kind:n,friendly:a,isRecurring:!1}}var n3=["MO","TU","WE","TH","FR","SA","SU"],ys=(function(){function e(t,n){if(n===0)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=n}return e.fromStr=function(t){return new e(n3.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=n3[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e})(),hr=function(e){return e!=null},Pa=function(e){return typeof e=="number"},fR=function(e){return typeof e=="string"&&n3.includes(e)},oo=Array.isArray,di=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var n=[],r=e;r>0,r.length>t?String(r):(t=t-r.length,t>n.length&&(n+=ln(n,t/n.length)),n.slice(0,t)+String(r))}var M1e=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},bo=function(e,t){var n=e%t;return n*t<0?n+t:n},E_=function(e,t){return{div:Math.floor(e/t),mod:bo(e,t)}},Fa=function(e){return!hr(e)||e.length===0},jr=function(e){return!Fa(e)},Tn=function(e,t){return jr(e)&&e.indexOf(t)!==-1},Gc=function(e,t,n,r,s,o){return r===void 0&&(r=0),s===void 0&&(s=0),o===void 0&&(o=0),new Date(Date.UTC(e,t-1,n,r,s,o))},T1e=[31,28,31,30,31,30,31,31,30,31,30,31],IH=1e3*60*60*24,PH=9999,OH=Gc(1970,1,1),A1e=[6,0,1,2,3,4,5],fp=function(e){return e%4===0&&e%100!==0||e%400===0},LH=function(e){return e instanceof Date},Qm=function(e){return LH(e)&&!isNaN(e.getTime())},N1e=function(e,t){var n=e.getTime(),r=t.getTime(),s=n-r;return Math.round(s/IH)},r3=function(e){return N1e(e,OH)},FH=function(e){return new Date(OH.getTime()+e*IH)},R1e=function(e){var t=e.getUTCMonth();return t===1&&fp(e.getUTCFullYear())?29:T1e[t]},Vd=function(e){return A1e[e.getUTCDay()]},mR=function(e,t){var n=Gc(e,t+1,1);return[Vd(n),R1e(n)]},BH=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},s3=function(e){var t=new Date(e.getTime());return t},pR=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(n)return!0;if(r)return!1}else if(this.method==="before"){if(r)return!1}else if(this.method==="after")return n?!0:(this.add(t),!1);return this.add(t)},e.prototype.add=function(t){return this._result.push(t),!0},e.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e})(),gR=(function(e){aM(t,e);function t(n,r,s){var o=e.call(this,n,r)||this;return o.iterator=s,o}return t.prototype.add=function(n){return this.iterator(n,this._result.length)?(this._result.push(n),!0):!1},t})(sd),qy={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},yR=function(e,t){return e.indexOf(t)!==-1},j1e=function(e){return e.toString()},I1e=function(e,t,n){return"".concat(t," ").concat(n,", ").concat(e)},Zi=(function(){function e(t,n,r,s){if(n===void 0&&(n=j1e),r===void 0&&(r=qy),s===void 0&&(s=I1e),this.text=[],this.language=r||qy,this.gettext=n,this.dateFormatter=s,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort(function(f,m){return f-m}),a.sort(function(f,m){return m-f}),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(hr(this.origOptions.byweekday)){var i=oo(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(i);this.byweekday={allWeeks:i.filter(function(f){return!f.n}),someWeeks:i.filter(function(f){return!!f.n}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var u=function(f,m){return f.weekday-m.weekday};this.byweekday.allWeeks.sort(u),this.byweekday.someWeeks.sort(u),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){var n=!0;if(!(t.options.freq in e.IMPLEMENTED)||t.origOptions.until&&t.origOptions.count)return!1;for(var r in t.origOptions){if(yR(["dtstart","tzid","wkst","freq"],r))return!0;if(!yR(e.IMPLEMENTED[t.options.freq],r))return!1}return n},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[tt.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("hours"):t("hour"))},e.prototype.MINUTELY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("minutes"):t("minute"))},e.prototype.DAILY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(this.plural(this.options.interval)?t("days"):t("day")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var t=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?t("weeks"):t("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?t("weekdays"):t("weekday")):this.add(t("on")).add(t("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?t("days"):t("day")):(this.options.interval===1&&this.add(t("week")),this.origOptions.bymonth&&(this.add(t("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},e.prototype.MONTHLY=function(){var t=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(t("months")),this.plural(this.options.interval)&&this.add(t("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("months"):t("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(t("on")).add(t("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var t=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(t("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?t("years"):t("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(t("on the")).add(this.list(this.options.byyearday,this.nth,t("and"))).add(t("day")),this.options.byweekno&&this.add(t("in")).add(this.plural(this.options.byweekno.length)?t("weeks"):t("week")).add(this.list(this.options.byweekno,void 0,t("and")))},e.prototype._bymonthday=function(){var t=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,t("or"))).add(t("the")).add(this.list(this.bymonthday,this.nth,t("or"))):this.add(t("on the")).add(this.list(this.bymonthday,this.nth,t("and")))},e.prototype._byweekday=function(){var t=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(t("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(t("and")),this.add(t("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,t("and"))))},e.prototype._byhour=function(){var t=this.gettext;this.add(t("at")).add(this.list(this.origOptions.byhour,void 0,t("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(t){t=parseInt(t.toString(),10);var n,r=this.gettext;if(t===-1)return r("last");var s=Math.abs(t);switch(s){case 1:case 21:case 31:n=s+r("st");break;case 2:case 22:n=s+r("nd");break;case 3:case 23:n=s+r("rd");break;default:n=s+r("th")}return t<0?n+" "+r("last"):n},e.prototype.monthtext=function(t){return this.language.monthNames[t-1]},e.prototype.weekdaytext=function(t){var n=Pa(t)?(t+1)%7:t.getJsWeekday();return(t.n?this.nth(t.n)+" ":"")+this.language.dayNames[n]},e.prototype.plural=function(t){return t%100!==1},e.prototype.add=function(t){return this.text.push(" "),this.text.push(t),this},e.prototype.list=function(t,n,r,s){var o=this;s===void 0&&(s=","),oo(t)||(t=[t]);var a=function(c,u,f){for(var m="",p=0;pt[0].length)&&(t=o,n=s)}if(t!=null&&(this.text=this.text.substr(t[0].length),this.text===""&&(this.done=!0)),t==null){this.done=!0,this.symbol=null,this.value=null;return}}while(n==="SKIP");return this.symbol=n,this.value=t,!0},e.prototype.accept=function(t){if(this.symbol===t){if(this.value){var n=this.value;return this.nextSymbol(),n}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},e})();function UH(e,t){t===void 0&&(t=qy);var n={},r=new P1e(t.tokens);if(!r.start(e))return null;return s(),n;function s(){r.expect("every");var p=r.acceptNumber();if(p&&(n.interval=parseInt(p[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=tt.DAILY,r.nextSymbol()&&(a(),m());break;case"weekday(s)":n.freq=tt.WEEKLY,n.byweekday=[tt.MO,tt.TU,tt.WE,tt.TH,tt.FR],r.nextSymbol(),a(),m();break;case"week(s)":n.freq=tt.WEEKLY,r.nextSymbol()&&(o(),a(),m());break;case"hour(s)":n.freq=tt.HOURLY,r.nextSymbol()&&(o(),m());break;case"minute(s)":n.freq=tt.MINUTELY,r.nextSymbol()&&(o(),m());break;case"month(s)":n.freq=tt.MONTHLY,r.nextSymbol()&&(o(),m());break;case"year(s)":n.freq=tt.YEARLY,r.nextSymbol()&&(o(),m());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=tt.WEEKLY;var h=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[tt[h]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var g=c();if(!g)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(tt[g]),r.nextSymbol()}a(),f(),m();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=tt.YEARLY,n.bymonth=[i()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var y=i();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(y),r.nextSymbol()}o(),m();break;default:throw new Error("Unknown symbol")}}function o(){var p=r.accept("on"),h=r.accept("the");if(p||h)do{var g=u(),y=c(),x=i();if(g)y?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(tt[y].nth(g))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(g),r.accept("day(s)"));else if(y)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(tt[y]);else if(r.symbol==="weekday(s)")r.nextSymbol(),n.byweekday||(n.byweekday=[tt.MO,tt.TU,tt.WE,tt.TH,tt.FR]);else if(r.symbol==="week(s)"){r.nextSymbol();var v=r.acceptNumber();if(!v)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(v[0],10)];r.accept("comma");){if(v=r.acceptNumber(),!v)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(v[0],10))}}else if(x)r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(x);else return}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function a(){var p=r.accept("at");if(p)do{var h=r.acceptNumber();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(h[0],10)];r.accept("comma");){if(h=r.acceptNumber(),!h)throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(h[0],10))}}while(r.accept("comma")||r.accept("at"))}function i(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function u(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var p=parseInt(r.value[1],10);if(p<-366||p>366)throw new Error("Nth out of range: "+p);return r.nextSymbol(),r.accept("last")?-p:p;default:return!1}}function f(){r.accept("on"),r.accept("the");var p=u();if(p)for(n.bymonthday=[p],r.nextSymbol();r.accept("comma");){if(p=u(),!p)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(p),r.nextSymbol()}}function m(){if(r.symbol==="until"){var p=Date.parse(r.text);if(!p)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(p)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}var cn;(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(cn||(cn={}));function m4(e){return e12){var r=Math.floor(this.month/12),s=bo(this.month,12);this.month=s,this.year+=r,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(n,r){r>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-r))+n*7:this.day+=-(this.getWeekday()-r)+n*7,this.fixDay()},t.prototype.addDaily=function(n){this.day+=n,this.fixDay()},t.prototype.addHours=function(n,r,s){for(r&&(this.hour+=Math.floor((23-this.hour)/n)*n);;){this.hour+=n;var o=E_(this.hour,24),a=o.div,i=o.mod;if(a&&(this.hour=i,this.addDaily(a)),Fa(s)||Tn(s,this.hour))break}},t.prototype.addMinutes=function(n,r,s,o){for(r&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/n)*n);;){this.minute+=n;var a=E_(this.minute,60),i=a.div,c=a.mod;if(i&&(this.minute=c,this.addHours(i,!1,s)),(Fa(s)||Tn(s,this.hour))&&(Fa(o)||Tn(o,this.minute)))break}},t.prototype.addSeconds=function(n,r,s,o,a){for(r&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/n)*n);;){this.second+=n;var i=E_(this.second,60),c=i.div,u=i.mod;if(c&&(this.second=u,this.addMinutes(c,!1,s,o)),(Fa(s)||Tn(s,this.hour))&&(Fa(o)||Tn(o,this.minute))&&(Fa(a)||Tn(a,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var n=mR(this.year,this.month-1)[1];if(!(this.day<=n))for(;this.day>n;){if(this.day-=n,++this.month,this.month===13&&(this.month=1,++this.year,this.year>PH))return;n=mR(this.year,this.month-1)[1]}}},t.prototype.add=function(n,r){var s=n.freq,o=n.interval,a=n.wkst,i=n.byhour,c=n.byminute,u=n.bysecond;switch(s){case cn.YEARLY:return this.addYears(o);case cn.MONTHLY:return this.addMonths(o);case cn.WEEKLY:return this.addWeekly(o,a);case cn.DAILY:return this.addDaily(o);case cn.HOURLY:return this.addHours(o,r,i);case cn.MINUTELY:return this.addMinutes(o,r,i,c);case cn.SECONDLY:return this.addSeconds(o,r,i,c,u)}},t})(Ky);function VH(e){for(var t=[],n=Object.keys(e),r=0,s=n;r=-366&&r<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||jr(t.byweekno)||jr(t.byyearday)||t.bymonthday||jr(t.bymonthday)||hr(t.byweekday)||hr(t.byeaster)))switch(t.freq){case tt.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case tt.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case tt.WEEKLY:t.byweekday=[Vd(t.dtstart)];break}if(hr(t.bymonth)&&!oo(t.bymonth)&&(t.bymonth=[t.bymonth]),hr(t.byyearday)&&!oo(t.byyearday)&&Pa(t.byyearday)&&(t.byyearday=[t.byyearday]),!hr(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if(oo(t.bymonthday)){for(var s=[],o=[],n=0;n0?s.push(r):r<0&&o.push(r)}t.bymonthday=s,t.bynmonthday=o}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(hr(t.byweekno)&&!oo(t.byweekno)&&(t.byweekno=[t.byweekno]),!hr(t.byweekday))t.bynweekday=null;else if(Pa(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(fR(t.byweekday))t.byweekday=[ys.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof ys)!t.byweekday.n||t.freq>tt.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var a=[],i=[],n=0;ntt.MONTHLY?a.push(c.weekday):i.push([c.weekday,c.n])}t.byweekday=jr(a)?a:null,t.bynweekday=jr(i)?i:null}return hr(t.byhour)?Pa(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq=4?(f=0,u=i.yearlen+bo(a-t.wkst,7)):u=r-f;for(var m=Math.floor(u/7),p=bo(u,7),h=Math.floor(m+p/4),g=0;g0&&y<=h){var x=void 0;y>1?(x=f+(y-1)*7,f!==c&&(x-=7-c)):x=f;for(var v=0;v<7&&(i.wnomask[x]=1,x++,i.wdaymask[x]!==t.wkst);v++);}}if(Tn(t.byweekno,1)){var x=f+h*7;if(f!==c&&(x-=7-c),x=4?(w=0,C=S+bo(_-t.wkst,7)):C=r-f,b=Math.floor(52+bo(C,7)/4)}if(Tn(t.byweekno,b))for(var x=0;xo)return bi(e);if(b>=n){var _=_R(b,t);if(!e.accept(_)||i&&(--i,!i))return bi(e)}}else for(var v=h;vo)return bi(e);if(b>=n){var _=_R(b,t);if(!e.accept(_)||i&&(--i,!i))return bi(e)}}}if(t.interval===0||(c.add(t,y),c.year>PH))return bi(e);m4(r)||(f=u.gettimeset(r)(c.hour,c.minute,c.second,0)),u.rebuild(c.year,c.month)}}function fye(e,t,n){var r=n.bymonth,s=n.byweekno,o=n.byweekday,a=n.byeaster,i=n.bymonthday,c=n.bynmonthday,u=n.byyearday;return jr(r)&&!Tn(r,e.mmask[t])||jr(s)&&!e.wnomask[t]||jr(o)&&!Tn(o,e.wdaymask[t])||jr(e.nwdaymask)&&!e.nwdaymask[t]||a!==null&&!Tn(e.eastermask,t)||(jr(i)||jr(c))&&!Tn(i,e.mdaymask[t])&&!Tn(c,e.nmdaymask[t])||jr(u)&&(t=e.yearlen&&!Tn(u,t+1-e.yearlen)&&!Tn(u,-e.nextyearlen+t-e.yearlen))}function _R(e,t){return new Qy(e,t.tzid).rezonedDate()}function bi(e){return e.getValue()}function mye(e,t,n,r,s){for(var o=!1,a=t;a=tt.HOURLY&&jr(s)&&!Tn(s,t.hour)||r>=tt.MINUTELY&&jr(o)&&!Tn(o,t.minute)||r>=tt.SECONDLY&&jr(a)&&!Tn(a,t.second)?[]:e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}var ra={MO:new ys(0),TU:new ys(1),WE:new ys(2),TH:new ys(3),FR:new ys(4),SA:new ys(5),SU:new ys(6)},p4={freq:cn.YEARLY,dtstart:null,interval:1,wkst:ra.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},hye=Object.keys(p4),tt=(function(){function e(t,n){t===void 0&&(t={}),n===void 0&&(n=!1),this._cache=n?null:new q1e,this.origOptions=VH(t);var r=U1e(t).parsedOptions;this.options=r}return e.parseText=function(t,n){return UH(t,n)},e.fromText=function(t,n){return O1e(t,n)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return HH(t,this.options)},e.prototype._cacheGet=function(t,n){return this._cache?this._cache._cacheGet(t,n):!1},e.prototype._cacheAdd=function(t,n,r){if(this._cache)return this._cache._cacheAdd(t,n,r)},e.prototype.all=function(t){if(t)return this._iter(new gR("all",{},t));var n=this._cacheGet("all");return n===!1&&(n=this._iter(new sd("all",{})),this._cacheAdd("all",n)),n},e.prototype.between=function(t,n,r,s){if(r===void 0&&(r=!1),!Qm(t)||!Qm(n))throw new Error("Invalid date passed in to RRule.between");var o={before:n,after:t,inc:r};if(s)return this._iter(new gR("between",o,s));var a=this._cacheGet("between",o);return a===!1&&(a=this._iter(new sd("between",o)),this._cacheAdd("between",a,o)),a},e.prototype.before=function(t,n){if(n===void 0&&(n=!1),!Qm(t))throw new Error("Invalid date passed in to RRule.before");var r={dt:t,inc:n},s=this._cacheGet("before",r);return s===!1&&(s=this._iter(new sd("before",r)),this._cacheAdd("before",s,r)),s},e.prototype.after=function(t,n){if(n===void 0&&(n=!1),!Qm(t))throw new Error("Invalid date passed in to RRule.after");var r={dt:t,inc:n},s=this._cacheGet("after",r);return s===!1&&(s=this._iter(new sd("after",r)),this._cacheAdd("after",s,r)),s},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return a3(this.origOptions)},e.prototype.toText=function(t,n,r){return L1e(this,t,n,r)},e.prototype.isFullyConvertibleToText=function(){return F1e(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=cn.YEARLY,e.MONTHLY=cn.MONTHLY,e.WEEKLY=cn.WEEKLY,e.DAILY=cn.DAILY,e.HOURLY=cn.HOURLY,e.MINUTELY=cn.MINUTELY,e.SECONDLY=cn.SECONDLY,e.MO=ra.MO,e.TU=ra.TU,e.WE=ra.WE,e.TH=ra.TH,e.FR=ra.FR,e.SA=ra.SA,e.SU=ra.SU,e.parseString=o3,e.optionsToString=a3,e})();function gye(e,t,n,r,s,o){var a={},i=e.accept;function c(p,h){n.forEach(function(g){g.between(p,h,!0).forEach(function(y){a[Number(y)]=!0})})}s.forEach(function(p){var h=new Qy(p,o).rezonedDate();a[Number(h)]=!0}),e.accept=function(p){var h=Number(p);return isNaN(h)?i.call(this,p):!a[h]&&(c(new Date(h-1),new Date(h+1)),!a[h])?(a[h]=!0,i.call(this,p)):!0},e.method==="between"&&(c(e.args.after,e.args.before),e.accept=function(p){var h=Number(p);return a[h]?!0:(a[h]=!0,i.call(this,p))});for(var u=0;u1||s.length||o.length||a.length){var f=new Sye(u);return f.dtstart(i),f.tzid(c||void 0),r.forEach(function(p){f.rrule(new tt(k_(p,i,c),u))}),s.forEach(function(p){f.rdate(p)}),o.forEach(function(p){f.exrule(new tt(k_(p,i,c),u))}),a.forEach(function(p){f.exdate(p)}),t.compatible&&t.dtstart&&f.rdate(i),f}var m=r[0]||{};return new tt(k_(m,m.dtstart||t.dtstart||i,m.tzid||t.tzid||c),u)}function CR(e,t){return t===void 0&&(t={}),xye(e,vye(t))}function k_(e,t,n){return Sr(Sr({},e),{dtstart:t,tzid:n})}function vye(e){var t=[],n=Object.keys(e),r=Object.keys(wR);if(n.forEach(function(s){Tn(r,s)||t.push(s)}),t.length)throw new Error("Invalid options: "+t.join(", "));return Sr(Sr({},wR),e)}function bye(e){if(e.indexOf(":")===-1)return{name:"RRULE",value:e};var t=M1e(e,":",1),n=t[0],r=t[1];return{name:n,value:r}}function _ye(e){var t=bye(e),n=t.name,r=t.value,s=n.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:r}}function wye(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var n=e.split(` -`),r=0;r0&&s[0]===" "?(n[r-1]+=s.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function Cye(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function SR(e,t){return Cye(t),e.split(",").map(function(n){return f4(n)})}function ER(e){var t=this;return function(n){if(n!==void 0&&(t["_".concat(e)]=n),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var r=0;r{switch(e.kind){case"ONCE":return new Date(e.year,e.month,e.day,e.hour,e.minute);case"DAILY":return new Date(2e3,0,1,e.hour,e.minute);case"WEEKLY":return new Date(2e3,0,2+e.dayOfWeek,e.hour,e.minute);case"MONTHLY":return new Date(2e3,0,e.day,e.hour,e.minute);case"YEARLY":return new Date(2e3,e.month,e.day,e.hour,e.minute);case"WEEKDAYS":return new Date(2e3,0,1,e.hour,e.minute)}};function h4(e,t){const n=new Date;switch(e.kind){case"ONCE":{const r=new Date(e.year,e.month,e.day,e.hour,e.minute);return r>n?r:n}case"DAILY":return new tt({freq:tt.DAILY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byhour:e.hour,byminute:e.minute}).after(n)||n;case"WEEKLY":{const r=e.dayOfWeek===0?tt.SU:e.dayOfWeek-1;return new tt({freq:tt.WEEKLY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byweekday:r,byhour:e.hour,byminute:e.minute}).after(n)||n}case"MONTHLY":return new tt({freq:tt.MONTHLY,dtstart:new Date(n.getFullYear(),n.getMonth(),1,e.hour,e.minute),bymonthday:e.day,byhour:e.hour,byminute:e.minute}).after(n)||n;case"YEARLY":return new tt({freq:tt.YEARLY,dtstart:new Date(n.getFullYear(),0,1,e.hour,e.minute),bymonth:e.month+1,bymonthday:e.day,byhour:e.hour,byminute:e.minute}).after(n)||n;case"WEEKDAYS":return new tt({freq:tt.WEEKLY,dtstart:new Date(n.getFullYear(),n.getMonth(),n.getDate(),e.hour,e.minute),byweekday:[tt.MO,tt.TU,tt.WE,tt.TH,tt.FR],byhour:e.hour,byminute:e.minute}).after(n)||n;default:return n}}function kye(e,t){const n=Eye(e);switch(e.kind){case"ONCE":return t.formatDate(n,{dateStyle:"medium",timeStyle:"short"});case"DAILY":return t.formatTime(n,{timeStyle:"short"});case"WEEKLY":return t.formatDate(n,{weekday:"short",hour:"numeric",minute:"numeric"});case"MONTHLY":return t.formatMessage({defaultMessage:"Day {day}, {time}",id:"grA/MDsLjr"},{day:n.getDate().toString(),time:t.formatTime(n,{timeStyle:"short"})});case"YEARLY":return t.formatDate(n,{hour:"numeric",minute:"numeric",day:"numeric",month:"short"});case"WEEKDAYS":return t.formatTime(n,{timeStyle:"short"})}}const Au=He({kindOnce:{defaultMessage:"Once",id:"DqTQOpG2Me"},kindDaily:{defaultMessage:"Daily",id:"zxvhnETmn2"},kindWeekly:{defaultMessage:"Weekly",id:"/clOBUs/wZ"},kindWeekdays:{defaultMessage:"Every weekday",id:"8Hjql2wdJG"},kindMonthly:{defaultMessage:"Monthly",id:"wYsv4ZHu+B"},kindYearly:{defaultMessage:"Yearly",id:"dqD39hnoA/"}}),Mye={ONCE:Au.kindOnce,DAILY:Au.kindDaily,WEEKLY:Au.kindWeekly,MONTHLY:Au.kindMonthly,YEARLY:Au.kindYearly,WEEKDAYS:Au.kindWeekdays};function Gr(){const e=new Date;return e.setHours(e.getHours()+1,e.getMinutes(),0,0),{kind:"ONCE",minute:e.getMinutes(),hour:e.getHours(),day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),dayOfWeek:e.getDay()}}function Tye(e="",t=ie.PRO,n=["web"]){return{title:"",prompt:e,schedule:Gr(),searchModel:t,sources:n,expiryDate:void 0,defaultExpiryDate:WH(t)}}function Aye(e,t){return t.formatMessage(Mye[e])}const Nye=()=>Intl.DateTimeFormat().resolvedOptions().timeZone;function Rye(e){switch(e.kind){case"ONCE":return new Date(e.year,e.month,e.day,e.hour,e.minute);default:return new Date}}function Dye(e){switch(e.kind){case"ONCE":return"FREQ=DAILY;COUNT=1";case"DAILY":return`FREQ=DAILY;BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"WEEKLY":return`FREQ=WEEKLY;BYDAY=${["SU","MO","TU","WE","TH","FR","SA"][e.dayOfWeek]};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"MONTHLY":return`FREQ=MONTHLY;BYMONTHDAY=${e.day};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"YEARLY":return`FREQ=YEARLY;BYMONTH=${e.month+1};BYMONTHDAY=${e.day};BYHOUR=${e.hour};BYMINUTE=${e.minute}`;case"WEEKDAYS":return`FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYHOUR=${e.hour};BYMINUTE=${e.minute}`}}function mp(e){const t=Rye(e);return{start_at:$U(t),rrule:Dye(e),tzid:Nye()}}function zH(e){if(!(e===null||!e))return $U(e)}function Xy(e){const t=new Date(e.start_at),n={kind:"ONCE",minute:t.getMinutes(),hour:t.getHours(),day:t.getDate(),month:t.getMonth(),year:t.getFullYear(),dayOfWeek:t.getDay()};if(e.rrule.includes("FREQ=DAILY;COUNT=1"))return n;const r=tt.parseString(e.rrule),s=f=>Array.isArray(f)?f[0]:f,o=s(r.byhour),a=s(r.byminute),i=s(r.bymonth),c=s(r.bymonthday),u=s(r.byweekday);switch(r.freq){case tt.DAILY:return o===void 0||a===void 0?(Z.error("DAILY schedule missing required BYHOUR or BYMINUTE parameter"),{...n}):{...n,kind:"DAILY",hour:o,minute:a};case tt.WEEKLY:{if(u===void 0||o===void 0||a===void 0)return Z.error("WEEKLY schedule missing required parameters"),{...n};if(Array.isArray(r.byweekday)&&r.byweekday.length===5)return{...n,kind:"WEEKDAYS",hour:o,minute:a};const f=u.weekday===6?0:u.weekday+1;return{...n,kind:"WEEKLY",dayOfWeek:f,hour:o,minute:a}}case tt.MONTHLY:return c===void 0||o===void 0||a===void 0?(Z.error("MONTHLY schedule missing required BYMONTHDAY parameter"),{...n}):{...n,kind:"MONTHLY",day:c,hour:o,minute:a};case tt.YEARLY:return i===void 0||c===void 0||o===void 0||a===void 0?(Z.error("YEARLY schedule missing required BYMONTH parameter"),{...n}):{...n,kind:"YEARLY",month:i-1,day:c,hour:o,minute:a}}return Z.error("Invalid task schedule"),{...n}}function jye({expiryDate:e,schedule:t,defaultExpiryDate:n}){return e===null||!e||!t?e:h4(t)>e?n??null:e}function Iye(e,t){return(e===ie.BETA||e===ie.ALPHA)&&(t.kind==="DAILY"||t.kind==="WEEKLY"||t.kind==="WEEKDAYS")}function WH(e,t){if(!(!t||!Iye(e,t))&&(e===ie.BETA||e===ie.ALPHA)){const n=h4(t);return(s=>{switch(s){case"DAILY":return US(n,14);case"WEEKLY":return Bme(n,14);case"WEEKDAYS":return US(n,21);case"ONCE":case"MONTHLY":case"YEARLY":return;default:At(s)}})(t.kind)}}var Ze;(function(e){e.SCHEDULED="scheduled",e.PRICE_ALERT="priceAlert",e.SHORTCUT="shortcut"})(Ze||(Ze={}));var fr;(function(e){e.TARGET_PRICE="targetPrice",e.MOVEMENT_AMOUNT="movementAmount"})(fr||(fr={}));const Kl={should_send_email:!0,should_send_in_app:!0,should_send_push:!0},Pye=e=>{const t=e.enrichments?e.enrichments.space??null:void 0;return{id:e.task_id,type:Oye(e),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),expiryDate:e.end_at?new Date(e.end_at):void 0,title:e.task_name,prompt:e.task_data.task_prompt,status:e.status,nextRun:new Date(e.next_trigger_intended_time),scheduleInfo:{start_at:e.start_at,rrule:e.trigger_condition_schedule,tzid:e.tzid},subscription:e.event_subscription,searchModel:e.task_data?.task_params?.model_preference||"pplx_pro",sources:e.task_data?.task_params?.sources||["web"],notificationSettings:e.notification_settings||Kl,collectionUuid:e.collection_uuid,space:t,userId:e.user_task_context?.user_nextauth_id??null}},Oye=e=>{switch(e.scheduler_type){case"EVENT_PUSH":return"ALERT";case"POLL":return"SCHEDULE";case"SHORTCUT":return"SHORTCUT";default:return null}};function Lye({intl:e,triggerType:t}){switch(t){case Ze.SCHEDULED:return e.formatMessage({defaultMessage:"Scheduled task",id:"dG8VrMkuAT"});case Ze.PRICE_ALERT:return e.formatMessage({defaultMessage:"Price alert",id:"XMapyUiPpV"});case Ze.SHORTCUT:return e.formatMessage({defaultMessage:"Shortcut",id:"tceWOrncgz"});default:At(t)}}function Fye({intl:e,triggerType:t,actionPerformed:n}){const r=Bye({intl:e,actionPerformed:n});switch(t){case Ze.SCHEDULED:return e.formatMessage({defaultMessage:"Task has been {actionDisplayName}",id:"dztI4FIBBf"},{actionDisplayName:r});case Ze.PRICE_ALERT:return e.formatMessage({defaultMessage:"Price alert has been {actionDisplayName}",id:"ApBHuTxt1D"},{actionDisplayName:r});case Ze.SHORTCUT:return e.formatMessage({defaultMessage:"Shortcut has been {actionDisplayName}",id:"oprPa0O7KY"},{actionDisplayName:r});default:At(t)}}function Bye({intl:e,actionPerformed:t}){switch(t){case"created":return e.formatMessage({defaultMessage:"created",id:"lr7wlbGcN2"});case"updated":return e.formatMessage({defaultMessage:"updated",id:"fM7xZh2bri"});case"paused":return e.formatMessage({defaultMessage:"paused",id:"onIpArq3j6"});case"resumed":return e.formatMessage({defaultMessage:"resumed",id:"NUz1enNtoA"});case"deleted":return e.formatMessage({defaultMessage:"deleted",id:"GBLHN+CxXe"});case"copied":return e.formatMessage({defaultMessage:"copied",id:"JZWZSAD5l1"});case"skipped":return e.formatMessage({defaultMessage:"skipped",id:"yrhXAwV22L"});default:At(t)}}const Uye=1e9,AR=-1e9;function Vye(e){return{trigger:{type:Ze.SCHEDULED,schedule:e.schedule},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources??Zh()},status:"ACTIVE",notificationSettings:Kl}}function Hye({selectedTask:e}){if(!e||e.type===null)return null;switch(e.type){case"SCHEDULE":return{id:e.id,trigger:{type:Ze.SCHEDULED,schedule:Xy(e.scheduleInfo),expiryDate:e.expiryDate},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status,notificationSettings:e.notificationSettings??Kl,collectionUuid:e.collectionUuid};case"ALERT":switch(e.subscription?.event_type){case"STOCK_PRICE_TARGET":return{id:e.id,trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:(e.subscription.value_lower_bound??AR)<0?e.subscription.value_upper_bound??Uye:e.subscription.value_lower_bound??AR,currency:"usd",symbol:e.subscription.event_entity??""},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};case"STOCK_PRICE_MOVEMENT":return{id:e.id,trigger:{type:Ze.PRICE_ALERT,alertType:fr.MOVEMENT_AMOUNT,percentageDecimalLowerBound:(e.subscription.value_lower_bound??0)/100,percentageDecimalUpperBound:(e.subscription.value_upper_bound??0)/100,symbol:e.subscription.event_entity??""},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};default:throw new Error("Unhandled subscription.event_type: "+e.subscription?.event_type)}case"SHORTCUT":return{id:e.id,trigger:{type:Ze.SHORTCUT,shortcut:e.title},query:{prompt:e.prompt,searchModel:e.searchModel,sources:e.sources},status:e.status};default:At(e.type)}}function g4(e=!0){return{trigger:{type:Ze.SCHEDULED,schedule:Gr()},query:{searchModel:e?ie.PRO:ie.DEFAULT,prompt:"",sources:Zh()},status:"ACTIVE",notificationSettings:Kl}}function zye({symbol:e=""}={symbol:""}){return{trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:0,currency:"usd",symbol:e},query:{prompt:"",searchModel:ie.PRO,sources:Zh()},status:"ACTIVE"}}function y4(e){if(e.trigger.type!==Ze.SCHEDULED)return e;const t=WH(e.query.searchModel,e.trigger.schedule),n=jye({expiryDate:e.trigger.expiryDate,schedule:e.trigger.schedule,defaultExpiryDate:t});return e.id?{...e,trigger:{...e.trigger,expiryDate:n}}:{...e,trigger:{...e.trigger,schedule:{...e.trigger.schedule},expiryDate:n,defaultExpiryDate:t}}}function Zh(){return["web"]}var Zn;(function(e){e.GOOGLE_DRIVE="GOOGLE_DRIVE",e.ONEDRIVE="ONEDRIVE",e.SHAREPOINT="SHAREPOINT",e.DROPBOX="DROPBOX",e.BOX="BOX",e.WILEY="WILEY",e.GCAL="GCAL",e.GENERATED_IMAGE="GENERATED_IMAGE",e.GENERATED_VIDEO="GENERATED_VIDEO",e.NOTION_MCP="NOTION_MCP",e.OUTLOOK="OUTLOOK",e.LINEAR="LINEAR",e.LINEAR_ALT="LINEAR_ALT",e.SLACK="SLACK",e.GITHUB_MCP_DIRECT="GITHUB_MCP_DIRECT",e.ASANA_MCP_DIRECT="ASANA_MCP_DIRECT",e.ASANA_MCP_MERGE="ASANA_MCP_MERGE",e.ATLASSIAN_MCP_DIRECT="ATLASSIAN_MCP_DIRECT",e.LOCAL="LOCAL",e.SLACK_DIRECT="SLACK_DIRECT",e.JIRA_MCP_MERGE="JIRA_MCP_MERGE",e.CONFLUENCE_MCP_MERGE="CONFLUENCE_MCP_MERGE",e.MICROSOFT_TEAMS_MCP_MERGE="MICROSOFT_TEAMS_MCP_MERGE",e.FACTSET="FACTSET",e.ZOOM="ZOOM"})(Zn||(Zn={}));const Wye=[Zn.GOOGLE_DRIVE,Zn.ONEDRIVE,Zn.SHAREPOINT,Zn.DROPBOX,Zn.BOX],Gye=e=>[...Wye,...e],Sxt=e=>be.makeQueryKey("get_prices",{subscription_tier:e}),iu=(e={})=>be.makeQueryKey("get_user_settings",e),Zy=()=>be.makeQueryKey("get_rate_limits",{}),$ye=()=>be.makeQueryKey("get_user_profile",{}),qye=()=>be.makeQueryKey("get_user_promotions",{}),Kye=()=>be.makeQueryKey("get_government_origin",{}),Yye=e=>be.makeQueryKey("get_special_profile",{profile_name:e}),i3=e=>be.makeQueryKey("get_homepage_upsells",{isHomepage:e}),Qye=()=>be.makeQueryKey("get_ntp_upsells",{}),dc=(e="you")=>be.makeQueryKey("list_feed",{topic:e}),x4=()=>be.makeQueryKey("userOrgData",{}),Ext=e=>be.makeQueryKey("get_premium_secure_eligibility",{orgUuid:e}),Xye=()=>be.makeQueryKey("pendingInvitation"),na=e=>be.makeQueryKey("get_collection",{collection_slug:e.slice(-22)}),v4=e=>be.makeQueryKey("list_collection_threads",e?.slice(-22)),bd=e=>e?[...v4(e.collection_slug),e.filter_by_user,e.filter_by_shared_threads]:be.makeQueryKey("list_collection_threads"),Xt=()=>be.makeQueryKey("list_user_collections",{}),Lx=e=>e?be.makeQueryKey("list_ask_threads",e):be.makeQueryKey("list_ask_threads"),Zye=Lx,kxt=()=>be.makeQueryKey("shoppingOrders",{}),Jye=()=>be.makeQueryKey("userTryOnPhoto",{}),e2e=()=>be.makeQueryKey("shoppingTryOnBackgroundGeneration"),Mxt=e=>be.makeQueryKey("productTryOn",{productImageUrl:e}),t2e="getOrganizationUsers",Txt=e=>be.makeQueryKey(t2e,"members"),n2e=e=>be.makeQueryKey("get_thread_by_uuid",{uuid:e}),r2e=e=>be.makeQueryKey("get_article_by_uuid",{uuid:e}),Axt=()=>be.makeQueryKey("customer_shopping_info",{}),b4=e=>be.makeQueryKey("articleResults",{frontend_context_uuid:e}),NR=e=>be.makeQueryKey("article-slug",e),_4=(e,t=!1)=>be.makeQueryKey(t?"list_file_directory_infinite":"list_file_directory",e.file_repository_type,e.owner_id),w4=(e,t,n,r=0,s,o=!1)=>be.makeQueryKey(...be.unmakeQueryKey(_4({file_repository_type:e,owner_id:t},o)),n,...o?[]:[r],s),l3="connector-files",c3="connector-files-infinite",RR=(e,t)=>e?be.makeQueryKey(t?c3:l3,e):be.makeQueryKey(t?c3:l3),Nxt=e=>be.makeQueryKey("get_sharepoint_sites_infinite",e??{}),Rxt=()=>be.makeQueryKey("get_filters",{}),Dxt=e=>e!==void 0?be.makeQueryKey("memories",e):be.makeQueryKey("memories"),eh=(e,t)=>be.makeQueryKey("file_exists",e,...t?[t]:[]),j0=e=>be.makeQueryKey("download-image-url",...e?[e]:[]),GH=e=>be.makeQueryKey("user-task",e),pp=e=>be.makeQueryKey("user-tasks"),s2e=e=>e!==void 0?be.makeQueryKey("space-tasks",e):be.makeQueryKey("space-tasks"),o2e=()=>be.makeQueryKey("check-edu-institution"),Xm=()=>be.makeQueryKey("list_spaces_mentions"),a2e=()=>be.makeQueryKey("upgrade-subscription-preview"),i2e=()=>be.makeQueryKey("subscription-changes"),l2e=()=>be.makeQueryKey("task_shortcuts_mentions"),jxt=e=>be.makeQueryKey("task_shortcuts_copy",e),Ixt=()=>be.makeQueryKey("braintree-subscription-details"),c2e="get_repository_upload_states",u2e=e=>be.makeQueryKey(c2e,e),Pxt=()=>be.makeQueryKey("get_seat_info"),d2e="space-file-errors",Oxt=e=>be.makeQueryKey(d2e,e),Lxt=be.makeQueryKey("third-party-personalization-status"),f2e=e=>be.makeQueryKey("user_student",e),Fxt=()=>be.makeQueryKey("paypal_client_token",{}),m2e=()=>be.makeQueryKey("emailAssistantConfig"),p2e=e=>e?be.makeQueryKey("emailAssistantScopes",e):be.makeQueryKey("emailAssistantScopes"),$H=e=>be.makeEphemeralQueryKey("navigationResults",e),Bxt=e=>e?be.makeQueryKey("availableCalendars",e):be.makeQueryKey("availableCalendars"),wm=()=>be.makeQueryKey("spaces","list","all"),h2e=()=>be.makeQueryKey("org_pinned_spaces_query_key"),C4=/(\[\d{1,3}\])/,qH=/(\[\d{1,3},\s*\{ts:.*\}\])/,hp=new RegExp(C4.source+"|"+qH.source),S4=(e,t)=>{if(hp.test(e))if(C4.test(e)){const n=parseInt(e.substring(1,e.length-1))-1,r=t?.[n]??null;return r||void 0}else{const n=e.indexOf(","),r=parseInt(e.substring(1,n))-1,s=t?.[r]??null;if(!s)return;if(!s.url){Z.warn("[parseCitation] web_result has no url",{web_result:s});return}return s.url=g2e(s.url,e),s}},g2e=(e,t)=>{const n=e.split("&")[0],r=t.indexOf(":");if(r===-1)return n;const s=t.indexOf("}"),o=t.substring(r+1,s);return n+`&t=${o}`};function th(e,t){const n={};for(const r of e){const s=t(r);Object.prototype.hasOwnProperty.call(n,s)?n[s].push(r):Object.defineProperty(n,s,{value:[r],configurable:!0,enumerable:!0,writable:!0})}return n}const E4={web:"web",scholar:"scholar",social:"social",edgar:"edgar",wiley:"wiley",org:"org",my_files:"my_files",crunchbase:"crunchbase",factset:"factset",google_drive:"google_drive",onedrive:"onedrive",sharepoint:"sharepoint",dropbox:"dropbox",box:"box",notion_mcp:"notion_mcp",outlook:"outlook",linear:"linear",linear_alt:"linear_alt",slack:"slack",github_mcp_direct:"github_mcp_direct",asana_mcp_direct:"asana_mcp_direct",asana_mcp_merge:"asana_mcp_merge",atlassian_mcp_direct:"atlassian_mcp_direct",slack_direct:"slack_direct",jira_mcp_merge:"jira_mcp_merge",confluence_mcp_merge:"confluence_mcp_merge",microsoft_teams_mcp_merge:"microsoft_teams_mcp_merge",wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere",space:"space",gcal:"gcal",sports:"sports",zoom:"zoom"},y2e=Object.values(E4).filter(e=>e!=="wiley"),x2e=["linear","linear_alt","slack","notion_mcp","github_mcp_direct","asana_mcp_direct","asana_mcp_merge","atlassian_mcp_direct","slack_direct","jira_mcp_merge","confluence_mcp_merge","microsoft_teams_mcp_merge","wiley_mcp_cashmere","cbinsights_mcp_cashmere","pitchbook_mcp_cashmere","statista_mcp_cashmere"],v2e={wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere"},ha=e=>y2e.includes(e),Fx=e=>Array.isArray(e)?e.filter(ha):[],b2e=e=>Array.isArray(e)?e.filter(ha).filter(t=>x2e.includes(t)):[],Jh=e=>e?Object.keys(v2e).includes(e):!1,KH=e=>e?.entity_group_type!=="CALENDAR_ACTION"&&!!e?.entities?.length,YH=e=>{const t=!!e?.multiple_choice_quiz_card_block?.questions?.length,n=!!e?.flash_card_section_block;return t||n},DR=e=>!!(e.chunks&&e.chunks.length>0),jR=e=>!!(e.answer&&e.answer.length>0),IR=e=>!!e.structured_answer_blocks?.some(t=>t.markdown_block?.chunks?.length||t.entity_list_block?.chunks?.length),PR=e=>!!e.structured_answer_blocks?.some(t=>t.markdown_block?.answer?.length||t.entity_list_block?.text?.length||KH(t.entity_group_block)),OR=e=>!!e.structured_answer_blocks?.some(t=>YH(t.inline_entity_block)),LR=e=>!!e.structured_answer_blocks?.some(t=>t.inline_entity_block?.media_block?.generated_media_items?.some(n=>n.status==="COMPLETED")),_2e=e=>!!e.structured_answer_blocks?.some(t=>t.inline_entity_block?.media_block?.media_items?.some(n=>n.image||n.medium==="image"||n.medium==="video"));class qt{static hasContent(t){return DR(t)||jR(t)||IR(t)||PR(t)||LR(t)||_2e(t)||OR(t)}static hasAnswer(t,n){const r=LR(t)&&n;return DR(t)||jR(t)||IR(t)||PR(t)||r||OR(t)}static isPerplexityMessage(t){return t?.blocks!==void 0}static isPerplexityArticleSection(t){return t?.message!==void 0}static isArticleSection(t){return t?.article_info!==void 0}static mergePlaceBlocks(t){const n=t.filter(a=>!!a);if(!n.length)return;const[r,...s]=n;return Object.assign({},r,...s.map(a=>({review_summary:a.review_summary})))}static mergeMediaBlocks(t){const n=t.filter(s=>!!s);return n.length?{media_items:n.flatMap(s=>s?.media_items||[]),generated_media_items:n[n.length-1].generated_media_items||[],progress:n[n.length-1].progress}:void 0}static mergeShoppingBlocks(t){const n=t.filter(a=>!!a);if(!n.length)return;const[r,...s]=n;return Object.assign({},r,...s.map(a=>({review_summary:a.review_summary})))}static mergeEntityListItems(t){const n=th(t,s=>s.index),r=[];return Object.values(n).forEach(s=>{const o=s[0];r.push({title:o.title,text:s.map(({text:a})=>a).join(""),chunks:s.flatMap(a=>a.chunks),chunk_starting_offset:0,index:o.index,awaiting_backfill:s.reduce((a,i)=>i.awaiting_backfill??a,!1),place_block:qt.mergePlaceBlocks(s.map(a=>a.place_block)),shopping_block:qt.mergeShoppingBlocks(s.map(a=>a.shopping_block))})}),r}static parseStructuredAnswerBlocks(t){if(!this.isPerplexityMessage(t)||!t.structured_answer_block_usages?.length)return null;const n=th(t.blocks,s=>s.intended_usage),r=[];return t.structured_answer_block_usages.forEach(s=>{const o=n[s];if(!o)return;const{markdownBlocks:a,placeBlocks:i,mediaBlocks:c,shoppingPreviewBlocks:u,entityListBlocks:f,jobsPreviewBlocks:m,hotelsPreviewBlocks:p,placesPreviewBlocks:h,knowledgeCardsBlocks:g,calendarEventBlocks:y,entityGroupBlocks:x,entityGroupV2Blocks:v,assetsPreviewBlocks:b,assetsInlineBlocks:_,shoppingBlocks:w,placeholderBlocks:S,multipleChoiceQuizCardBlocks:C,flashCardSectionBlocks:E,jsonBlocks:T}=o.reduce((k,I)=>(I.markdown_block?k.markdownBlocks.push(I.markdown_block):I.inline_entity_block?.place_block?k.placeBlocks.push(I.inline_entity_block.place_block):I.inline_entity_block?.media_block?k.mediaBlocks.push(I.inline_entity_block.media_block):I.inline_entity_block?.shopping_preview_block?k.shoppingPreviewBlocks.push(I.inline_entity_block.shopping_preview_block):I.entity_list_block?k.entityListBlocks.push(I.entity_list_block):I.inline_entity_block?.jobs_preview_block?k.jobsPreviewBlocks.push(I.inline_entity_block.jobs_preview_block):I.inline_entity_block?.hotels_preview_block?k.hotelsPreviewBlocks.push(I.inline_entity_block.hotels_preview_block):I.inline_entity_block?.places_preview_block?k.placesPreviewBlocks.push(I.inline_entity_block.places_preview_block):I.inline_entity_block?.knowledge_card_block?k.knowledgeCardsBlocks.push(I.inline_entity_block.knowledge_card_block):I.inline_entity_block?.calendar_event_block?k.calendarEventBlocks.push(I.inline_entity_block.calendar_event_block):I.entity_group_block?k.entityGroupBlocks.push(I.entity_group_block):I.entity_group_v2_block?k.entityGroupV2Blocks.push(I.entity_group_v2_block):I.inline_entity_block?.assets_preview_block?k.assetsPreviewBlocks.push(I.inline_entity_block.assets_preview_block):I.inline_entity_block?.assets_inline_block?k.assetsInlineBlocks.push(I.inline_entity_block.assets_inline_block):I.inline_entity_block?.shopping_block?k.shoppingBlocks.push(I.inline_entity_block?.shopping_block):I.inline_entity_block?.placeholder_block?k.placeholderBlocks.push(I.inline_entity_block?.placeholder_block):I.inline_entity_block?.multiple_choice_quiz_card_block?k.multipleChoiceQuizCardBlocks.push(I.inline_entity_block.multiple_choice_quiz_card_block):I.inline_entity_block?.flash_card_section_block?k.flashCardSectionBlocks.push(I.inline_entity_block.flash_card_section_block):I.json_block&&k.jsonBlocks.push(I.json_block),k),{markdownBlocks:[],placeBlocks:[],mediaBlocks:[],shoppingPreviewBlocks:[],entityListBlocks:[],jobsPreviewBlocks:[],hotelsPreviewBlocks:[],placesPreviewBlocks:[],knowledgeCardsBlocks:[],calendarEventBlocks:[],entityGroupBlocks:[],entityGroupV2Blocks:[],assetsPreviewBlocks:[],assetsInlineBlocks:[],shoppingBlocks:[],placeholderBlocks:[],multipleChoiceQuizCardBlocks:[],flashCardSectionBlocks:[],jsonBlocks:[]});if(a.length){const k=a[a.length-1],I=a.flatMap(M=>M.chunks);r.push({intended_usage:s,markdown_block:{answer:I.join(""),chunks:I,chunk_starting_offset:0,progress:k.progress,media_items:a.flatMap(M=>M.media_items||[]),inline_token_annotations:a.flatMap(M=>M.inline_token_annotations||[])}})}if(u.length&&r.push({intended_usage:s,inline_entity_block:{shopping_preview_block:u[u.length-1]}}),m.length&&r.push({intended_usage:s,inline_entity_block:{jobs_preview_block:m[m.length-1]}}),p.length&&r.push({intended_usage:s,inline_entity_block:{hotels_preview_block:p[p.length-1]}}),h.length&&r.push({intended_usage:s,inline_entity_block:{places_preview_block:h[h.length-1]}}),i.length&&r.push({intended_usage:s,inline_entity_block:{place_block:qt.mergePlaceBlocks(i)}}),c.length&&r.push({intended_usage:s,inline_entity_block:{media_block:qt.mergeMediaBlocks(c)}}),f.length&&r.push({intended_usage:s,entity_list_block:{text:f.map(({text:k})=>k).join(""),chunks:f.flatMap(k=>k.chunks),chunk_starting_offset:0,entities:qt.mergeEntityListItems(f.flatMap(k=>k.entities))}}),g.length&&r.push({intended_usage:s,inline_entity_block:{knowledge_card_block:g[g.length-1]}}),y.length&&r.push({intended_usage:s,inline_entity_block:{calendar_event_block:y[y.length-1]}}),x.length&&r.push({intended_usage:s,entity_group_block:{entities:x[x.length-1].entities,entity_group_type:x[x.length-1].entity_group_type}}),v.length){const k=v[v.length-1];r.push({intended_usage:s,entity_group_v2_block:k})}b.length&&r.push({intended_usage:s,inline_entity_block:{assets_preview_block:b[b.length-1]}}),_.length&&r.push({intended_usage:s,inline_entity_block:{assets_inline_block:_[_.length-1]}}),w.length&&r.push({intended_usage:s,inline_entity_block:{shopping_block:this.mergeShoppingBlocks(w)}}),S.length&&r.push({intended_usage:s,inline_entity_block:{placeholder_block:S[S.length-1]}}),C.length&&r.push({intended_usage:s,inline_entity_block:{multiple_choice_quiz_card_block:C[C.length-1]}}),E.length&&r.push({intended_usage:s,inline_entity_block:{flash_card_section_block:E[E.length-1]}}),T.length&&r.push({intended_usage:s,json_block:T[T.length-1]})}),r}static parseAskTextField(t){if(!this.isPerplexityMessage(t))return this.legacyParseBackendOutputStr(t.text);if(!t.blocks?.length)return null;const n={answer:""};n.structured_answer_blocks=qt.parseStructuredAnswerBlocks(t);const r=t.blocks?.filter(o=>o.intended_usage==="ask_text"&&o.markdown_block).map(o=>o.markdown_block);if(r.length>0){const o=r.flatMap(a=>a.chunks);n.chunks=o,n.answer=o.join("")}const s=t.blocks?.filter(o=>o.intended_usage==="web_results"&&o.web_result_block).flatMap(o=>o.web_result_block.web_results);return s.length>0&&(n.web_results=s),n}static legacyParseBackendOutputStr(t){let n=null;try{if(n=JSON.parse(t??""),Array.isArray(n)){const r=n[n.length-1];r.step_type=="FINAL"&&r?.content?.answer!=null&&(n=JSON.parse(r.content.answer))}}catch{return null}return n}static isStatusPending(t){return t.status?.toLowerCase()===Pr.PENDING.toLowerCase()}static isStatusBlocked(t){return t.status?.toLowerCase()===Pr.BLOCKED.toLowerCase()}static isStatusFailed(t){return t.status?.toLowerCase()===Pr.FAILED.toLowerCase()}static isStatusCompleted(t){return t.status?.toLowerCase()===Pr.COMPLETED.toLowerCase()}static isCopilotMode(t){return t.mode?.toLowerCase()===xd.COPILOT.toLowerCase()}static isArticleMode(t){return this.isPerplexityMessage(t)?t?.mode===xd.ARTICLE:this.isPerplexityArticleSection(t)?t?.message?.mode===xd.ARTICLE:t?.mode==="article"}static isSourceListType(t){return Array.isArray(t)&&t.every(n=>Object.values(E4).includes(n))}static hasUnspecifiedSelectionStatus(t){return t?.selection_status===aa.SELECTION_STATUS_UNSPECIFIED}static hasMultipleSiblingEntries(t,n){return n?t.filter(s=>s.side_by_side_metadata?.sibling_uuid===n).length>1:!1}}function w2e(e){return e||{connectors:[]}}const FR=e=>({hasLoadedSettings:!0,pagesLimit:e?.pages_limit??0,uploadLimit:e?.upload_limit,defaultImageGenerationModel:e?.default_image_generation_model??"default",defaultVideoGenerationModel:e?.default_video_generation_model??"default",articleImageUploadLimit:e?.article_image_upload_limit??0,maxFilesPerUser:e?.max_files_per_user??0,maxFilesPerRepository:e?.max_files_per_repository??0,queryCount:e?.query_count??0,queryCountCopilot:e?.query_count_copilot??0,queryCountMobile:e?.query_count_mobile??0,hasAiProfile:e?.has_ai_profile??!1,referralCode:e?.referral_code??"",referralNumSuccess:e?.referral_num_success??0,referralNumCoupons:e?.referral_num_coupons??0,disableTraining:e?.disable_training??!1,isSidebarCollapsed:e?.is_sidebar_collapsed??!1,isSidebarPinned:e?.is_sidebar_pinned??!1,sidebarHiddenHubs:e?.sidebar_hidden_hubs??[],subscriptionTier:e?.subscription_tier??e?.subscription_tier??"null",stripeStatus:e?.stripe_status??"none",revenuecatStatus:e?.revenuecat_status??"none",revenuecatSource:e?.revenuecat_source??"none",createLimit:e?.create_limit??0,notifStatus:e?.notif_status??"daily",emailStatus:e?.email_status??"daily",hasDataRetentionWarning:e?.has_data_retention_warning??!1,allowArticleCreation:e?.allow_article_creation??!1,isVerified:e?.is_verified??!1,connectors:w2e(e?.connectors),connectorLimits:e?.connector_limits??{global_file_count:void 0,repo_type_limits:void 0,max_file_size_mb:void 0,max_attachment_file_size_mb:void 0},alwaysAllowBrowserAgent:e?.always_allow_browser_agent??!1,hasAcceptedApiTerms:e?.has_accepted_api_terms??!1,sources:e?.sources??{source_to_limit:{}}});function C2e(e,t){return e?e.place_widget_block&&t.place_widget_block?{...t,place_widget_block:{...e.place_widget_block,review_summary:t.place_widget_block.review_summary}}:e.shopping_widget_block&&t.shopping_widget_block?{...t,shopping_widget_block:{...e.shopping_widget_block,review_summary:t.shopping_widget_block.review_summary}}:t:t}var u3;(function(e){e.SAVE_PROFILE="save_profile",e.DELETE_PROFILE="delete_profile",e.TOGGLE_DISABLED="toggle_disabled"})(u3||(u3={}));const S2e=async({profileName:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/auth/get_special_profile",t,{params:{query:{profile_name:e}},timeoutMs:1500,numRetries:1});if(n||!r)throw new he("API_CLIENTS_ERROR",{message:`Failed to get special profile ${e}`,cause:n,status:s.status??0});return{unlimitedProSearch:!!r.unlimited_pro_search,maxModelSelection:!!r.max_model_selection,unlimitedResearch:!!r.unlimited_research,fileUpload:!!r.file_upload}}catch(n){return Z.error(n),{unlimitedProSearch:!1,maxModelSelection:!1,unlimitedResearch:!1,fileUpload:!1}}},Uxt=async({reason:e})=>{try{const{error:t,data:n,response:r}=await de.GET("/rest/user/subscription/refresh",e,{timeoutMs:Qe(),headers:{"X-Perplexity-CSRF-Protection":"1"}});if(t)throw new he("API_CLIENTS_ERROR",{message:"Failed to refresh subscription status",cause:t,status:r.status??0});return n}catch(t){return Z.error(t),null}},QH={has_profile:!1,disabled:!1,bio:"",location:"",response_language:"",location_lng:"",location_lat:"",use_memory:!1,use_search_history:!1,language:""},E2e=async({headers:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/user/get_user_ai_profile",t,{timeoutMs:1500,numRetries:$l,headers:e});if(n||!r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user profile",cause:n,status:s.status??0});return r}catch(n){return Z.error(n),QH}},XH=async({skipConnectorPickerCredentials:e=!0,headers:t,reason:n})=>{try{const{error:r,data:s,response:o}=await de.GET("/rest/user/settings",n,{params:{query:{skip_connector_picker_credentials:e}},timeoutMs:1500,numRetries:$l,headers:t});if(r||!s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user settings",cause:r,status:o.status??0});return FR(s)}catch(r){return Z.error(r),FR({})}},Vxt=async({type:e,value:t,reason:n})=>{const r=e==="memory"?{use_memory:t}:{use_search_history:t},{error:s,data:o,response:a}=await de.POST("/rest/user/save_user_ai_profile",n,{timeoutMs:Qe(),numRetries:1,headers:{"content-type":"application/json"},body:{action:u3.SAVE_PROFILE,updated_profile:{...r,version:ql}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update personal search settings",cause:s,status:a.status??0});return o},Hxt=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/user/previous-subscription",e,{timeoutMs:3e3,numRetries:1});if(t)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user previous subscription",cause:t,status:r.status??0});return n},zxt=async({filters:e,skipToken:t,reason:n})=>{const{error:r,data:s,response:o}=await de.POST("/rest/connectors/sharepoint/sites",n,{body:{filters:e,skip_token:t},timeoutMs:Qe({productionMs:500}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch sharepoint sites",cause:r,status:o.status??0});return{sites:s.sites,skipToken:s.skip_token}},k2e=async({reason:e})=>{try{const{error:t,data:n,response:r}=await de.GET("/rest/auth/check_government_request_origin",e,{timeoutMs:1500,numRetries:$l});if(t||!n)throw new he("API_CLIENTS_ERROR",{message:"Failed to check government origin",cause:t,status:r.status??0});return{isGovernmentRequestOrigin:n.is_government_request_origin}}catch(t){return Z.error(t),{isGovernmentRequestOrigin:!1}}},M2e=({enabled:e,reason:t})=>{const n=async()=>k2e({reason:t}),{data:r}=mt({enabled:e,queryKey:Kye(),queryFn:n});return r??{isGovernmentRequestOrigin:void 0}};function T2e(e,t){return mt({enabled:!!e,queryKey:Yye(e),queryFn:async()=>S2e({profileName:e,reason:t})})}function Yr(){const e=M2e({enabled:!0,reason:"user-capabilities"}),t=e.isGovernmentRequestOrigin?"us_government_or_military":"",{data:n}=T2e(t,"user-capabilities");return d.useMemo(()=>{const s=e.isGovernmentRequestOrigin,o={unlimitedProSearch:!!n?.unlimitedProSearch,maxModelSelection:!!n?.maxModelSelection,unlimitedResearch:!!n?.unlimitedResearch,fileUpload:!!n?.fileUpload};return{isGovernmentRequestOrigin:s,specialCapabilities:o}},[e.isGovernmentRequestOrigin,n])}const ZH=()=>{const{isGovernmentRequestOrigin:e}=Yr();return e===void 0},Wxt=async({source:e,locale:t,headers:n,reason:r})=>{try{const{data:s,error:o,response:a}=await de.POST("/rest/enterprise/customer-portal",r,{body:{origin:e,locale:t},timeoutMs:7500,headers:{...n,"Content-Type":"application/json"}});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:r}});if(s.status!=="success")throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:r}});return s.url}catch(s){return Z.error(s),null}},Gxt=async({interval:e,subscriptionTier:t,origin:n,locale:r,reason:s,orgDraftUuid:o})=>{const a=Nx(),{data:i,error:c,response:u}=await de.POST("/rest/enterprise/checkout-session",s,{body:{referral_code:null,discount_code:null,origin:n,tier:e,locale:r,subscription_tier:t,org_draft_uuid:o??null},timeoutMs:3500,headers:{...a?{"Screen-Dimensions":a}:{}}});if(c)throw new he("API_CLIENTS_ERROR",{cause:c,status:u.status??0,details:{reason:s}});return i},$xt=async({interval:e,subscriptionTier:t,origin:n,locale:r,collectionMethod:s,billingAddress:o,reason:a,orgDraftUuid:i})=>{const c=Nx(),{data:u,error:f,response:m}=await de.POST("/rest/enterprise/subscription",a,{body:{collection_method:s,origin:n,locale:r,subscription_interval:e,subscription_tier:t,billing_address:o,org_draft_uuid:i??null},timeoutMs:1e4,headers:{...c?{"Screen-Dimensions":c}:{}}});if(f)throw new he("API_CLIENTS_ERROR",{cause:f,status:m.status??0,details:{reason:a}});return u};var d3;(function(e){e.ON_PLATFORM="on_platform",e.OFF_PLATFORM="off_platform"})(d3||(d3={}));const A2e=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/user/pending-invitation",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n.pending_invitation??null}catch(n){return Z.error(n),null}},N2e=async({headers:e,reason:t})=>{const n={organization:void 0,org_user:void 0,is_in_organization:!1,pending_invitation:null};try{const{data:r,error:s,response:o}=await de.GET("/rest/enterprise/user/organization",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0,details:{reason:t}});return r.status!=="success",r}catch(r){return Z.error(r),n}},qxt=async({inviteUUID:e,headers:t,reason:n})=>{try{const{data:r,error:s}=await de.GET("/rest/enterprise/organization/invite/{org_invite_uuid}",n,{params:{path:{org_invite_uuid:e}},headers:t,timeoutMs:Qe({productionMs:2e3}),numRetries:1}),o=s||r,a=o?.detail?{...o.detail}:o;if(a?.status!=="success")return a;const i=a?.invite?.subscription_tier??null;return{status:a?.status??"unknown",userEmail:a?.invite?.user_email??"",uuid:a?.invite?.uuid??"",orgDisplayName:a?.org_display_name??"",tncAcceptanceMethod:a?.tnc_acceptance_method??d3.ON_PLATFORM,tncAccepted:a?.tnc_accepted??!1,subscriptionTier:i}}catch(r){return Z.error(r),null}},Kxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/subscription/refresh",t,{headers:e,timeoutMs:4e3});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return{subscriptionStatus:n?.subscription_status??null}}catch(n){return Z.error(n),null}},Yxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/premium-secure-eligibility",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n}catch(n){return Z.error(n),null}},Qxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/premium-secure-billing-update",t,{headers:{...e,"Content-Type":"application/json"},timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return n}catch(n){return Z.error(n),null}},Xxt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/enterprise/organization/subscription-info",t,{headers:e,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get org subscription info",n),null}},JH=async({uuid:e,success:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/sse/perplexity_connector_auth_response",n,{body:{result:{tool_uuid:e,success:t}},backOffTime:100,numRetries:1,headers:{"Content-Type":"application/json"}});if(r?.status!=="success")throw new he("API_CLIENTS_ERROR",{message:"Failed to post perplexity connector auth response",cause:s,status:o.status??0});return!0}catch(r){return Z.error("Failed to post perplexity connector auth response",r),!1}},Zxt=async({orgInviteUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/invite/{org_invite_uuid}/accept",t,{params:{path:{org_invite_uuid:e}},timeoutMs:Qe({productionMs:2e3})});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t,orgInviteUUID:e}});return n},Jxt=async({orgInviteUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/enterprise/organization/invite/{org_invite_uuid}/decline",t,{params:{path:{org_invite_uuid:e}},timeoutMs:Qe({productionMs:2e3})});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t,orgInviteUUID:e}});return n},evt=async({openInviteLinkUuid:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/enterprise/organization/shareable-invite/{open_invite_link_uuid}",n,{params:{path:{open_invite_link_uuid:e}},headers:t,timeoutMs:Qe({productionMs:2e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0,details:{reason:n,openInviteLinkUuid:e}});return r},tvt=async({openInviteLinkUuid:e,headers:t,reason:n})=>{try{const{error:r,data:s,response:o}=await de.POST("/rest/enterprise/organization/shareable-invite/join/{open_invite_link_uuid}",n,{params:{path:{open_invite_link_uuid:e}},headers:{"content-type":"application/json",...t},timeoutMs:3e3});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:o.status??0});return s}catch(r){throw Z.error(r),r}},lu=()=>{const{session:e}=Ne(),t=e?.user?.org_uuid;return!!(t&&t!=="none")};function mo({shouldRefetchOnMount:e=!0,forceFetch:t=!1,reason:n}){const r=lu(),{data:s,refetch:o,isSuccess:a,isFetching:i}=mt({enabled:t||r,queryKey:x4(),queryFn:()=>N2e({reason:n}),placeholderData:Wl,refetchOnMount:e});return d.useMemo(()=>({orgUser:s?.org_user,isAdmin:s?.org_user?.role==="ADMIN",organization:s?.organization,isEnterprise:r,refetch:o,isLoading:!s&&i,isFetching:i,isSuccess:a}),[s,r,i,a,o])}const R2e=()=>{const{organization:e,isEnterprise:t,isLoading:n}=mo({reason:"check-upsell-enterprise-consent"});return n?!0:t?!e?.settings?.product_communications_enabled:!1},k4="pplx.chosen-locale",f3="pplx.la-status",ez="pplx.source-selection-v3",BR="pplx.prefers-metric",tz="pplx.default-search-session",D2e="pplx.utm-source",nz="pplx.pt",rz=400,j2e=30,I2e=7,P2e=e=>{lo(k4,e,{expires:rz})},O2e=()=>mr(k4),L2e=()=>{$p(k4)},F2e=e=>{lo(f3,e,{})},M_=(e,t)=>{const n=`${ez}-${t}`;lo(n,JSON.stringify(e),{expires:I2e})},B2e=e=>{const t=`${ez}-${e}`,n=mr(t);return n?JSON.parse(n):null},U2e=()=>{lo("pplx.has-discovered-space-mentions","true",{expires:rz})},V2e=e=>{lo(tz,e,{expires:j2e})},H2e=()=>mr(tz),z2e=()=>mr(D2e),nvt=()=>mr(nz),W2e=e=>{lo(nz,e)},G2e=()=>H2e()==="firefox"?!0:typeof window>"u"?!1:new URL(window.location.href).searchParams.get("pc")==="firefox",UR="partnerships",$2e=()=>z2e()===UR?!0:typeof window>"u"?!1:new URL(window.location.href).searchParams.get("utm_source")===UR,Hd=d.memo(({isSamsungBrowser:e,isWindowsApp:t,isIPad:n,isComet:r,isFirefoxDefaultSearch:s,isPartnershipCampaign:o,isGovernment:a,isEnterpriseWithoutConsent:i,children:c})=>{const u=Ca(),f=G2e(),m=$2e(),{isGovernmentRequestOrigin:p}=Yr(),{device:{isWindowsApp:h,isSamsungBrowser:g,isIPad:y}}=sn(),x=ZH(),v=R2e();return d.useMemo(()=>!!(r&&u||t&&h||e&&g||n&&y||s&&f||o&&m||a&&(x||p)||i&&v),[u,h,g,y,r,e,t,n,s,f,o,m,a,p,x,i,v])?null:c});Hd.displayName="OmitUpsellIf";const sz=["ppl-ai-file-upload","ppl-ai-sandbox-file-upload","ppl-ai-experimental-file-upload"],q2e=e=>sz.some(t=>e.url.includes(`${t}.s3.amazonaws.com/web/direct-files`));var m3;(function(e){e.token_limit_exceeded="token_limit_exceeded",e.parsing_error="parsing_error",e.unknown_error="unknown_error",e.unauthorized="unauthorized",e.no_data_received="no_data_received",e.file_type_not_supported="file_type_not_supported",e.image_failed_moderation="image_failed_moderation"})(m3||(m3={}));var od;(function(e){e.generic_upload_error="generic_upload_error",e.unsupported_type="unsupported_type",e.too_large="too_large",e.too_small="too_small",e.no_name="no_name",e.failed_moderation="failed_moderation",e.rate_limited="rate_limited",e.over_file_count="over_file_count",e.over_image_count="over_image_count",e.attachments_disabled_by_organization="attachments_disabled_by_organization"})(od||(od={}));const ty=e=>{if(Tf(e))return"application/pdf";const n=e.split("?")[0].split("#")[0].split(".").pop()?.toLowerCase();return n&&{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",jp2:"image/jp2",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",svg:"image/svg+xml",webp:"image/webp",ico:"image/x-icon",avif:"image/avif",heic:"image/heic",heif:"image/heif",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",txt:"text/plain",csv:"text/csv",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",md:"text/markdown"}[n]||"application/octet-stream"},K2e=e=>{const t=e.file_metadata?.file_repository_type;return e.is_attachment&&!t&&!e.meta_data?.file_uuid},Y2e=e=>{if(!e)return!1;try{return new URL(e).hostname.includes("s3.amazonaws.com")}catch{return!1}},go=He({token_limit_exceeded:{id:"cnFlyTXVDl",defaultMessage:"File {filename} exceeds the model's token limit."},parsing_error:{id:"RdRRX8+YG/",defaultMessage:"Failed to parse file {filename}."},file_type_not_supported:{id:"IaflMSTTq6",defaultMessage:"File type not supported for {filename}."},unknown_error:{id:"zhy7qBi3Eu",defaultMessage:"Unknown error for file {filename}."},unauthorized:{id:"6bOe+cTUhc",defaultMessage:"User not authorised to access file {filename}."},no_data_received:{id:"34PXW7VvKh",defaultMessage:"No data received for file {filename}."},generic_upload_error:{id:"xVFvYDY5wK",defaultMessage:"File upload failed"},unsupported_type:{id:"VUOyYEDS96",defaultMessage:"The file type you uploaded is not supported."},too_large:{id:"XBcIjOYq8V",defaultMessage:"File too large: {max} maximum."},too_small:{id:"ZUyiNCx0Aw",defaultMessage:"File too small."},no_name:{id:"IkAmckATMw",defaultMessage:"File name is required."},image_failed_moderation:{id:"YCCLnMQDPb",defaultMessage:"File {filename} failed moderation."},failed_moderation:{id:"hnN6c9ExET",defaultMessage:"File upload failed moderation."},rate_limited:{id:"el7NlqcDQZ",defaultMessage:"You have reached the daily upload limit for your plan."},over_file_count:{id:"2+5sg16GUy",defaultMessage:"You are allowed up to {maxNumFiles, plural, one {# file} other {# files}} at once."},over_image_count:{id:"FIudmpgA1s",defaultMessage:"You are allowed up to {maxNumImages, plural, one {# image} other {# images}} at once."},attachments_disabled_by_organization:{id:"3N0C1GH7jP",defaultMessage:"Your organization has disabled attachments."}}),eg=e=>{if(e.startsWith("/rest/connectors/wiley/"))return"WILEY";if(e.includes("drive.google.com")||e.includes("connectors/google-drive")||e.includes("docs.google.com"))return"GOOGLE_DRIVE";if(e.includes("onedrive.live.com")||e.includes("1drv.ms")||e.includes("connectors/onedrive"))return"ONEDRIVE";if(e.includes(".sharepoint.com")||e.includes("connectors/sharepoint"))return"SHAREPOINT";if(e.includes("dropbox.com/preview")||e.includes("connectors/dropbox"))return"DROPBOX";if(e.includes("app.box.com/file")||e.includes("connectors/box"))return"BOX"},oz=e=>{const t=e.meta_data?.connection_type??e.file_metadata?.connector_type;return t||eg(e.url)},tg=e=>!!e?.meta_data?.patent_name||!!e?.url&&Tf(e.url),M4=e=>tg(e)?e?.meta_data?.patent_name:void 0,p3=e=>!!(e?.meta_data?.connection_type&&e?.meta_data.connection_type!=="LOCAL")||e.is_attachment&&!!eg(e.url),Bx=e=>sz.some(n=>e.includes(`${n}.s3.amazonaws.com/web/direct-files`))||_d(e)||Tf(e),Yl=e=>e.is_attachment&&Bx(e.url),az=e=>e.trim().replace(/\/+$/,"").replace(/^(?:https?:\/\/)?(?:www\.)?/,""),rvt=e=>!!new RegExp("^((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,})(\\/[\\w\\-._~:/@!$&'()*+,;=%.]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e);function Ur(e){const t=/(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(?:\.[a-zA-Z]{2,})?|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d+)?/,n=e.match(t);return n&&n.length>0?n[1]||n[0]:"unknown"}function ng(e){const t=Ur(e);return t==="unknown"?"unknown":t.replace(/\.[^.]*$/,"")}function $c(e){return e.includes("calendar.google.com")||e.includes("google.com/calendar")?"https://calendar.google.com":e.includes("mail.google.com")||e.includes("google.com/mail")?"https://mail.google.com":Z2e(e)?"www.perplexity.ai":Ur(e)}function svt(e){return e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`}function Ji(e){const t=["(?:youtube?\\.com\\/","(?:[^/\\n\\s]+\\/\\S+\\/","|(?:v|e(?:mbed)?)\\/","|\\S*?[?&]v=",")","|youtu\\.be\\/",")([a-zA-Z0-9_-]{11})"].join(""),n=new RegExp(t),r=e.match(n);if(r&&r[1].length==11)return r[1]}function _d(e){return e.startsWith("https://pplx-res.cloudinary.com/")||e.startsWith("https://api.cloudinary.com/v1_1/pplx/image/download")}function Tf(e){const t=e.startsWith("https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf"),n=txe(e)&&e.includes("/rest/file-repository/patents/");return t||n}function ovt(e){return e.includes("code-interpreter-files.s3.amazonaws.com")||e.includes("pplx_code_interpreter")}function avt(e){return e.includes("user-gen-media-assets")}function VR(e){return e.replace(/\/s--[^/]+--\/v\d+\//,"/")}function T4(e){return!Yl(e)&&!!e.url&&!Ji(e.url)&&!_d(e.url)&&!e.is_memory}const cu=e=>{try{const r=new URL(e).pathname.replace(/^\//,"").split("/"),s=r[r.length-1];return decodeURIComponent(s)}catch{return"File"}},iz=e=>{const t=e,n=t.indexOf("/"),r=Math.max(23,n+16);return t.length>r?t.substring(0,r-1)+"…":t},Q2e=(e,t)=>`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent([e,t].filter(Boolean).join(", "))}`,X2e=(e,t)=>`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([e,t].filter(Boolean).join(", "))}`;function ivt(e){return e.includes("https://openai.com/index/image-generation-api/")}function Z2e(e){return e.startsWith("chrome://")||e.startsWith("chrome-extension://")||e.startsWith("browser-extension://")||e.startsWith("browser://")||e.startsWith("comet://")}const lvt=e=>e.replace("comet://","chrome://"),Ux=e=>{if(!e)return null;try{return new URL(e)}catch{return null}},J2e=async e=>{const t=[];return await Promise.all(e.map(async n=>{await new Promise(r=>setTimeout(r,Math.random()*500));try{(await fetch(n,{method:"HEAD"})).ok&&t.push(n)}catch(r){console.debug(`URL ${n} is not reachable:`,r)}})),t};async function*exe(e,t=5){let n=1,r=0;for(;r0&&(yield o,n=t)}}const A4=e=>{try{const t=new URL(e);return["AWSAccessKeyId","Signature","Expires"].every(n=>t.searchParams.has(n))}catch{return!1}},h3=e=>{if(!e)return"";const t=e.indexOf("?");return(t===-1?e:e.substring(0,t)).replace(/\/+$/,"")},txe=e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}};let HR=0;class Cm{eventTime=-1;setOnce(){return this.eventTime==-1?(this.eventTime=Date.now(),!0):!1}timeSinceTimestamp(t){return this.eventTime===-1||t==null?-1:this.eventTimet?(Z.log(`TimeMarker.timeBeforeTimestamp found inconsistency: mytime ${this.eventTime}, next: ${t}`),-1):t-this.eventTime}wasSet(){return this.eventTime!=-1}}const nxe={firstServerResponseReceived:!1,firstLLMTokenReceived:!1,isPerplexityBrowser:!1},Ql=new Map,rxe=(e,{hasLLMToken:t,hasSearchResults:n,hasSources:r},s)=>{sxe(e,s),oxe(e,t,s),axe(e,n),ixe(e,r)},sxe=(e,t)=>{const n=Ql.get(e);if(!n||n.firstServerResponseReceived||!n.submitTimestamp||!n.startFirstServerResponseMarker?.setOnce())return;n.firstServerResponseReceived=!0;const{queryStr:r,isFollowup:s,queryParams:o}=n,a=dxe(e);a>0&&Li({name:"query first server response",data:{startFirstServerResponseElapsed:a,queryStr:r,isFollowup:s,mode:o?.mode??"unknown",isPerplexityBrowser:n.isPerplexityBrowser},user:t??void 0})},oxe=(e,t,n)=>{const r=Ql.get(e);if(!r||r.firstLLMTokenReceived||!t||!r.startLLMTokenMarker?.setOnce())return;r.firstLLMTokenReceived=!0;const{queryStr:s,isFollowup:o,queryParams:a}=r,i=fxe(e);i>0&&Li({name:"query first llm token",data:{startLLMTokenElapsed:i,queryStr:s,isFollowup:o,mode:a?.mode??"unknown",isPerplexityBrowser:r.isPerplexityBrowser},user:n??void 0})},axe=(e,t)=>{const n=Ql.get(e);if(n){if(!t)return}else return;n.firstSearchResultsMarker?.setOnce()},ixe=(e,t)=>{const n=Ql.get(e);if(n){if(!t)return}else return;n.firstSourcesMarker?.setOnce()},lxe=({latencies:e,isMobile:t})=>{Pl("web.frontend.autosuggest_latency",{latencies:e,isMobile:t})},T_=(e,t)=>e?CM:t??void 0,Zm=e=>{if(e)return CM;const t=Us();if(t?.android_version)return"browser_android_mweb";if(t?.ios_version)return"browser_ios_mweb"},zR=(e,{session:t,source:n,name:r})=>{const s=Ql.get(e);s&&(s.endStreamTimestamp||(s.endStreamTimestamp=Date.now(),Li({name:r,data:s,user:{id:t?.user?.id,subscription_status:t?.user?.subscription_status},source:n})))},cxe=e=>Ux(e)?.host??"",uxe=(e,{name:t,queryStr:n,queryParams:r,isFollowup:s,frontendUUID:o,isPerplexityBrowser:a,session:i,browserVersion:c,source:u,connectors:f,mentions:m})=>{HR+=1;const p={...nxe};p.submissionType=t,p.submitTimestamp=Date.now(),p.queryStr=n,p.queryParams=r,p.frontendUUID=o,p.submissionCount=HR,p.isFollowup=s,p.startFirstServerResponseMarker=new Cm,p.startLLMTokenMarker=new Cm,p.firstSearchResultsMarker=new Cm,p.firstSourcesMarker=new Cm,p.firstSourcesRenderMarker=new Cm,p.isPerplexityBrowser=a,p.browserVersion=c,p.enabledConnectors=f?.enabled,p.disabledConnectors=f?.disabled,p.referrer=document.referrer;const h=m?.filter(x=>x.type==="tab"&&x.url)??[];p.attachedTabsDomains=[...new Set(h.map(x=>cxe(x.url)).filter(Boolean))],p.attachedTabsCount=h.length;const g=m?.filter(x=>x.type==="space")??[];p.mentionedSpacesCount=g.length;const y=m?.filter(x=>x.type==="shortcut")??[];p.mentionedShortcutsCount=y.length,Ql.set(e,p),Li({name:"submit query",data:p,user:i?.user??void 0,source:u})},dxe=e=>{const t=Ql.get(e);let n=-1;return t&&(n=t.startFirstServerResponseMarker?.timeSinceTimestamp(t.submitTimestamp)??-1),n},fxe=e=>{const t=Ql.get(e);let n=-1;return t&&(n=t.startLLMTokenMarker?.timeSinceTimestamp(t.submitTimestamp)??-1),n};var WR;(function(e){e.FLASHCARD="FLASHCARD",e.QUIZ="QUIZ"})(WR||(WR={}));const Xe=e=>{const{device:{isWindowsApp:t}}=sn(),n=d.useRef(new Set),r=d.useCallback((i,c={})=>{const u=Zm(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]),s=d.useCallback(i=>{const c=Zm(t),u=i.map(({name:f,data:m})=>({name:f,data:m,source:c,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}}));Jhe(u)},[t,e?.user?.id,e?.user?.subscription_status]),o=d.useCallback((i,c)=>{const u=Zm(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]),a=d.useCallback((i,c={})=>{if(n.current.has(i))return;n.current.add(i);const u=Zm(t);Li({name:i,data:c,source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[t,e?.user?.id,e?.user?.subscription_status]);return d.useMemo(()=>({trackEvent:r,trackEventTyped:o,trackEventOnce:a,trackEventBatch:s}),[r,s,o,a])},Bt=A.memo(()=>l.jsx("div",{className:"bg-backdrop/70 fixed inset-0 z-[999] flex items-center justify-center backdrop-blur-sm",children:l.jsx(Gl,{})}));Bt.displayName="ModalLoader";const lz=Ft("ModalStateContext",{currentOpenModals:[],currentOpenedModal:null,openModal:()=>{},openStackedModal:()=>{},updateModal:()=>{},closeModal:()=>{}}),mxe=()=>{const e=d.useContext(lz);if(!e)throw new Error("useModalState must be used within ModalContext");return e},pn=()=>{const e=mxe(),t=Uo(),n=d.useMemo(()=>{const s=e.currentOpenedModal??t.legacyIdentifiers.currentOpenModal??null,o=[];o.push(...e.currentOpenModals);for(const a of t.legacyIdentifiers.currentOpenModals)o.push({modalName:a,arg:{}});return{openModal:e.openModal,closeModal:e.closeModal,openStackedModal:e.openStackedModal,updateModal:e.updateModal,currentOpenedModal:s,currentOpenModals:o}},[e.closeModal,e.openModal,e.openStackedModal,e.updateModal,e.currentOpenModals,e.currentOpenedModal,t.legacyIdentifiers.currentOpenModal,t.legacyIdentifiers.currentOpenModals]),r=d.useMemo(()=>{const s=e.currentOpenedModal??t.legacyIdentifiers.currentOpenModal??void 0,o=new Set(t.legacyIdentifiers.currentOpenModals);for(const a of e.currentOpenModals)o.add(a.modalName);return{openModal:t.openModal,openStackedModal:t.openStackedModal,legacyIdentifiers:{currentOpenModal:s,currentOpenModals:o}}},[e.currentOpenModals,e.currentOpenedModal,t.legacyIdentifiers.currentOpenModal,t.legacyIdentifiers.currentOpenModals,t.openModal,t.openStackedModal]);return{legacy:n,updated:r}},cz=Ft("ModalInternalContext",{canOutsideClickClose:!0}),uz=A.memo(()=>l.jsx("p",{children:"An error has occurred"}));uz.displayName="ErrorFallback";const pxe=Ce(async()=>{const{LocationPermissionModal:e}=await Se(()=>q(()=>import("./LocationPermissionModal-CJRGUVmC.js"),__vite__mapDeps([5,4,1,6,3,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),hxe=Ce(async()=>{const{FileUploadModal:e}=await Se(()=>q(()=>import("./FileUploadModal-BvFT6lXw.js"),__vite__mapDeps([13,4,1,8,3,9,6,7,14,15,16,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),gxe=Ce(async()=>{const{CometDownloadInstructionsModal:e}=await Se(()=>q(()=>import("./CometDownloadInstructionsModal-C-u2fo9U.js"),__vite__mapDeps([17,4,1,6,3,18,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),yxe=Ce(async()=>{const{CollectionSelectModal:e}=await Se(()=>q(()=>import("./CollectionSelectModal-chyGMqqe.js"),__vite__mapDeps([19,4,1,6,3,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),xxe=Ce(async()=>{const{OnboardingModal:e}=await Se(()=>q(()=>import("./OnboardingModal-BBLBP53x.js").then(t=>t.a),__vite__mapDeps([20,4,1,6,3,21,22,23,24,9,7,8,25,26,27,28,29,16,30,31,10,11,12,32,33,34,35,36])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),vxe=Ce(async()=>{const{PurchaseConfirmationToast:e}=await Se(()=>q(()=>import("./PurchaseConfirmationToast-GzPKwh-L.js"),__vite__mapDeps([37,4,1,6,3,38,7,39,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),bxe=Ce(async()=>{const{ThreadLossAversionModal:e}=await Se(()=>q(()=>import("./ThreadLossAversionModal-D7FcWrP_.js"),__vite__mapDeps([40,4,1,6,3,41,7,42,9,8,43,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),_xe=Ce(async()=>{const{CompanyDataPrivacyModal:e}=await Se(()=>q(()=>import("./CompanyDataPrivacyModal-CBquTxiE.js"),__vite__mapDeps([44,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),wxe=Ce(async()=>{const{PricingTableModal:e}=await Se(()=>q(()=>import("./PricingTableModal-DKTASYyc.js"),__vite__mapDeps([45,4,1,3,6,21,22,23,24,9,7,8,25,26,27,28,29,18,10,11,12])));return{default:e}}),Cxe=Ce(async()=>{const{MapModal:e}=await Se(()=>q(()=>import("./MapModal-COz1Z29Z.js"),__vite__mapDeps([46,4,1,7,47,3,8,9,6,10,11,12])));return{default:e}}),Sxe=Ce(async()=>{const{ShoppingOnboardingModal:e}=await Se(()=>q(()=>import("./ShoppingOnboardingModal-CZLUPf2r.js"),__vite__mapDeps([48,4,1,6,3,49,8,9,7,50,51,52,53,54,55,56,57,39,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Exe=Ce(async()=>{const{PurchaseDetailsModal:e}=await Se(()=>q(()=>import("./PurchaseDetailsModal-CkTv7i6n.js"),__vite__mapDeps([58,4,1,6,3,9,7,8,50,51,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),kxe=Ce(async()=>{const{SpaceSettingsModal:e}=await Se(()=>q(()=>import("./SpaceSettingsModal-D32x8BuZ.js"),__vite__mapDeps([59,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Mxe=Ce(async()=>{const{MemoryListModal:e}=await Se(()=>q(()=>import("./MemoryListModal-3QH1KayA.js"),__vite__mapDeps([60,4,1,6,3,7,61,8,9,10,11,12])));return{default:e}}),Txe=Ce(async()=>{const{MemoryDetailModal:e}=await Se(()=>q(()=>import("./MemoryDetailModal-tGdhFYPy.js"),__vite__mapDeps([62,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}}),Axe=Ce(async()=>{const{HotelRoomDetailsModal:e}=await Se(()=>q(()=>import("./HotelRoomDetailsModal-Bs6UfaTm.js"),__vite__mapDeps([63,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Nxe=Ce(async()=>{const{PaymentModal:e}=await Se(()=>q(()=>import("./PaymentModal-DIcb6WXv.js"),__vite__mapDeps([64,4,1,8,3,9,6,7,23,65,25,24,57,54,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Rxe=Ce(async()=>{const{MeetingDefaultsModal:e}=await Se(()=>q(()=>import("./MeetingDefaultsModal-DJ18fASY.js"),__vite__mapDeps([66,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),Dxe=Ce(async()=>{const{AvailabilityModal:e}=await Se(()=>q(()=>import("./AvailabilityModal-B8HOqFPU.js"),__vite__mapDeps([67,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),jxe=Ce(async()=>{const{ProMessageModal:e}=await Se(()=>q(()=>import("./ProMessageModal--NnvSlnC.js"),__vite__mapDeps([68,4,1,7,3,8,9,6,10,11,12])));return{default:e}}),Ixe=Ce(async()=>Se(()=>q(()=>import("./SubSuccessModal-CEzPkVT6.js"),__vite__mapDeps([69,4,1,8,3,9,6,7,70,24,10,11,12])))),Pxe=Ce(async()=>Se(()=>q(()=>import("./ReferralErrorModal-D4SrZMEu.js"),__vite__mapDeps([71,4,1,6,3,36,7,8,9,10,11,12])))),Oxe=Ce(async()=>Se(()=>q(()=>import("./ReferralSuccessModal-CVtAvfIm.js"),__vite__mapDeps([72,4,1,6,3,35,8,9,7,36,28,26,10,11,12])))),Lxe=Ce(async()=>Se(()=>q(()=>import("./IncentiveProModal-B1Baqpf5.js"),__vite__mapDeps([73,4,1,6,3,8,9,7,10,11,12])))),Fxe=Ce(async()=>{const{StudentReferralsModal:e}=await Se(()=>q(()=>import("./StudentReferralsModal-CKAfMn6X.js"),__vite__mapDeps([74,4,1,8,3,9,6,7,34,35,36,28,26,29,10,11,12])));return{default:e}}),Bxe=Ce(async()=>{const{SheerIDModal:e}=await Se(()=>q(()=>import("./SheerIDModal-BHYPljec.js"),__vite__mapDeps([75,4,1,6,3,28,26,8,9,7,29,10,11,12])));return{default:e}}),Uxe=Ce(async()=>Se(()=>q(()=>import("./BraintreeSubscriptionModal-2dXzLlVe.js"),__vite__mapDeps([76,4,1,8,3,9,6,7,10,11,12])))),Vxe=Ce(async()=>{const{RestaurantBookingModal:e}=await Se(()=>q(()=>import("./RestaurantBookingModal-7zq9QxVz.js"),__vite__mapDeps([77,4,1,78,6,3,79,38,7,80,42,81,9,47,8,10,11,12,30])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Hxe=Ce(async()=>Se(()=>q(()=>import("./SheerIdRedirectModal-BpaodOqj.js"),__vite__mapDeps([82,4,1,6,3,8,9,7,10,11,12])))),zxe=Ce(async()=>{const{EnterprisePremiumSecureUpgradeModal:e}=await Se(()=>q(()=>import("./EnterprisePremiumSecureUpgradeModal-DU2i2Qm_.js"),__vite__mapDeps([83,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),Wxe=Ce(async()=>{const{ShortcutModal:e}=await Se(()=>q(()=>import("./ShortcutModal-hkCS-ySA.js"),__vite__mapDeps([84,4,1,8,3,9,6,7,10,11,12])));return{default:e}}),Gxe=Ce(async()=>Se(()=>q(()=>Promise.resolve().then(()=>a1t),void 0))),$xe=Ce(async()=>{const{AutomationModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>kot),void 0));return{default:e}}),qxe=Ce(async()=>{const{FinanceAlertModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>Not),void 0));return{default:e}}),Kxe=Ce(async()=>{const{SharepointSiteModal:e}=await Se(()=>q(()=>import("./SharepointSiteModal-DEqwxYR7.js"),__vite__mapDeps([85,4,1,6,3,86,8,9,7,10,11,12])));return{default:e}}),Yxe=Ce(async()=>{const{MCPServerModal:e}=await Se(()=>q(()=>import("./MCPServerModal-wufPmNsJ.js"),__vite__mapDeps([87,4,1,6,3,7,8,9,10,11,12])));return{default:e}}),Qxe=Ce(async()=>{const{MemberSetTierModal:e}=await Se(()=>q(()=>import("./MemberSetTierModal-C5VDUVKx.js"),__vite__mapDeps([88,4,1,6,3,70,7,8,9,24,57,10,11,12])));return{default:e}}),Xxe=Ce(async()=>{const{MCPServiceToolsModal:e}=await Se(()=>q(()=>import("./MCPServiceToolsModal-0_CZ4KV7.js"),__vite__mapDeps([89,4,1,6,3,90,8,9,7,10,11,12])));return{default:e}}),Zxe=Ce(async()=>{const{PlaceModal:e}=await Se(()=>q(()=>import("./PlaceModal-CytEwbsn.js"),__vite__mapDeps([78,4,1,6,3,79,38,7,80,42,81,9,47,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),GR=Ce(async()=>{const{OrgInviteModal:e}=await Se(()=>q(()=>import("./OrgInviteModal-CEe6bRsT.js"),__vite__mapDeps([91,4,1,8,3,9,6,7,92,93,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),Jxe=Ce(async()=>{const{RequestAccessModal:e}=await Se(()=>q(()=>import("./RequestAccessModal-CZs8Tpx-.js"),__vite__mapDeps([94,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),eve=Ce(async()=>{const{SpaceContextModal:e}=await Se(()=>q(()=>import("./SpaceContextModal-CjwpMh-4.js"),__vite__mapDeps([95,4,1,8,3,9,6,7,15,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),tve=Ce(async()=>{const{LoginModal:e}=await Se(()=>q(()=>import("./LoginModal-CfCGpXCO.js"),__vite__mapDeps([96,4,1,6,3,41,7,42,9,8,43,18,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),nve=Ce(async()=>{const{AnnouncementImageModal:e}=await Se(()=>q(()=>import("./AnnouncementImageModal-CBHVN-fI.js"),__vite__mapDeps([97,4,1,3,7,8,9,6,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),rve=Ce(async()=>{const{FullscreenUpsellModal:e}=await Se(()=>q(()=>import("./FullscreenUpsellModal-DNaA4FHU.js"),__vite__mapDeps([98,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),sve=Ce(async()=>{const{ShoppingTryOnOnboardingModal:e}=await Se(()=>q(()=>import("./ShoppingTryOnOnboardingModal-D8Kwg3Mf.js"),__vite__mapDeps([99,4,1,6,3,100,9,7,101,102,103,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),ove=Ce(async()=>{const{CheckSourcesModal:e}=await Se(()=>q(()=>import("./CheckSourcesModal-LvBDDncs.js"),__vite__mapDeps([104,1,4,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),ave=Ce(async()=>{const{MemorySearchHistoryModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>NKe),void 0));return{default:e}},{loading:()=>l.jsx(Bt,{})}),ive=Ce(async()=>{const{GmailFailedPermissionsModal:e}=await Se(()=>q(()=>import("./GmailModals-D4ZvmFO2.js"),__vite__mapDeps([105,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),lve=Ce(async()=>{const{EmailAssistantDisconnectWarningModal:e}=await Se(()=>q(()=>import("./EmailAssistantDisconnectWarningModal-DlCptha5.js"),__vite__mapDeps([106,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),cve=Ce(async()=>{const{CalendarSelectionModal:e}=await Se(()=>q(()=>import("./CalendarSelectionModal-hTv76Qgh.js"),__vite__mapDeps([107,4,1,8,3,9,6,7,108,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),uve=Ce(async()=>{const{DeleteAllMemoriesModal:e}=await Se(()=>q(()=>import("./DeleteAllMemoriesModal-Cg09X1Ui.js"),__vite__mapDeps([109,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),dve=Ce(async()=>{const{DeleteMemoryModal:e}=await Se(()=>q(()=>import("./DeleteMemoryModal-BXXQVzHz.js"),__vite__mapDeps([110,4,1,6,3,61,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),fve=Ce(async()=>{const{ThirdPartyPersonalizationModal:e}=await Se(()=>q(()=>import("./PersonalSearchSettingsMain-CHIO-vMM.js"),__vite__mapDeps([111,4,1,8,3,9,6,7,90,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),mve=Ce(async()=>{const{WatchlistModal:e}=await Se(()=>q(()=>import("./WatchlistModal-EfLNQ8hw.js"),__vite__mapDeps([112,1,4,8,3,9,6,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),pve=Ce(async()=>{const{AvatarManagementModal:e}=await Se(()=>q(()=>import("./AvatarManagementModal-Dxp419em.js"),__vite__mapDeps([113,4,1,8,3,9,6,7,103,114,50,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});Ce(async()=>{const{InstallGateModal:e}=await Se(()=>q(()=>import("./InstallGateModal-DmQe1ivv.js"),__vite__mapDeps([115,4,1,6,3,41,7,42,9,8,43,33,18,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});const hve=Ce(async()=>{const{DowngradeModal:e}=await Se(()=>q(()=>import("./DowngradeModal-CpBhw_YR.js"),__vite__mapDeps([116,4,1,6,3,117,27,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),gve=Ce(async()=>{const{UpgradeModal:e}=await Se(()=>q(()=>import("./UpgradeModal-ChNN1wUW.js"),__vite__mapDeps([118,4,1,8,3,9,6,7,65,25,24,57,117,27,119,26,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});function yve(e){return e?{[e.modalName]:e.arg}:{}}const dz=A.memo(({})=>{const{currentOpenModals:e}=pn().legacy,[t,n]=d.useState(e.length);d.useEffect(()=>{setTimeout(()=>{n(e.length)},100)},[e.length]);const r=t!=e.length;return e.map((s,o)=>l.jsx(fz,{modal:s,canOutsideClickClose:!r&&o+1==e.length},o))});dz.displayName="Modals";const fz=A.memo(({modal:e,canOutsideClickClose:t})=>{const n=d.useMemo(()=>({canOutsideClickClose:t}),[t]);return l.jsx(cz.Provider,{value:n,children:l.jsx(mz,{modal:e})})});fz.displayName="SingleModalWrapper";const mz=A.memo(({modal:e})=>{const{closeModal:t}=pn().legacy,{hasActiveSubscription:n}=$t(),r=e.modalName,{pricingModal:s,loginModal:o,installModal:a,cometDownloadInstructionsModal:i,requestAccessModal:c,collectionSelectModal:u,spaceSettings:f,companyDataPrivacyModal:m,checkSourcesModal:p,mapModal:h,purchaseConfirmationModal:g,shoppingOnboardingModal:y,shoppingOrderDetailsModal:x,lossAversionModal:v,spaceUploadFilesModal:b,spaceContextModal:_,locationPermissionModal:w,watchlistModal:S,deleteMemoryModal:C,memoryDetailModal:E,hotelRoomDetailsModal:T,memoryListModal:k,proSubscriptionPaymentModal:I,proMessageModal:M,memorySearchHistoryModal:N,gmailFailedPermissionsModal:D,emailAssistantDisconnectWarningModal:j,calendarSelectionModal:F,subSuccessModal:R,incentiveProModal:P,restaurantBookingModal:L,sheerIdRedirectModal:U,enterprisePremiumSecureUpgradeModal:O,taskShortcutModal:$,financeAlertModal:G,scheduledTaskModal:H,automationModal:Q,referralSuccessModal:Y,sharepointSiteModal:te,avatarManagementModal:se,shoppingTryOnOnboardingModal:ae,braintreeSubscriptionModal:X,announcementImageModal:ee,fullscreenUpsellModal:le,studentReferrals:re,sheerIdModal:ce,meetingDefaultsModal:ue,availabilityModal:me,mcpServerModal:we,mcpServiceToolsModal:ye,memberSetTierModal:_e,placeModal:ke,thirdPartyPersonalizationModal:De,orgInviteModal:xe}=yve(e),{session:Ue}=Ne(),{trackEvent:Ee}=Xe(Ue);return l.jsxs(l.Fragment,{children:[r==="loginModal"&&o?.origin&&l.jsx(tve,{pitchMessage:o?.pitchMessage,origin:o.origin,isOpen:r==="loginModal",experimentalImageDesign:o.experimentalImageDesign,sheetModalDesign:o.sheetModalDesign,closeModal:t,closeCallback:o?.closeCallback,overrideRedirectUrl:o?.overrideRedirectUrl,disallowedMethods:o?.disallowedMethods,loginButtonsStyle:o?.loginButtonsStyle,renderCloseButton:o?.renderCloseButton,preEnteredEmail:o?.preEnteredEmail,autoFocus:o?.autoFocus}),!1,r==="cometDownloadInstructionsModal"&&i&&i.requestedPlatform&&l.jsx(gxe,{isOpen:r==="cometDownloadInstructionsModal",onClose:t,requestedPlatform:i.requestedPlatform}),r==="pricingModal"&&s&&l.jsx(wxe,{isOpen:r==="pricingModal",pitchMessage:s?.pitchMessage,closeModal:t,origin:s.origin,showFreeTier:s.showFreeTier,defaultSegment:s.defaultSegment,segments:s.segments}),r==="collectionSelectModal"&&u?.entryUUID&&l.jsx(yxe,{isOpen:r==="collectionSelectModal",currentCollection:u.currentCollection,entryUUID:u.entryUUID,searchTerm:u.searchTerm,frontendContextUUID:u.frontendContextUUID,closeModal:t}),r==="spaceSettings"&&l.jsx(kxe,{isOpen:r==="spaceSettings",existingSpace:f?.existingSpace,closeModal:t}),r==="spaceUploadFilesModal"&&b&&l.jsx(hxe,{...b,connectionTypes:Gye(["LOCAL"]),isOpen:r==="spaceUploadFilesModal",closeModal:t}),r==="spaceContextModal"&&l.jsx(eve,{isOpen:r==="spaceContextModal",closeModal:t,collectionSlug:_?.collectionSlug}),r==="requestAccessModal"&&c?.uuidOrSlug&&l.jsx(Jxe,{isOpen:r==="requestAccessModal",onClose:t,uuidOrSlug:c.uuidOrSlug}),r==="mapModal"&&l.jsx(Mr,{fallback:uz,children:l.jsx(Cxe,{isOpen:r==="mapModal",closeModal:t,locations:h&&h.locations,header:h.header,entryUUID:h.entryUUID,searchByLocationOverride:h?.searchByLocationOverride})}),r==="companyDataPrivacyModal"&&l.jsx(_xe,{organizationName:m.organizationName,isOpen:r==="companyDataPrivacyModal",closeModal:t,onContinue:m.onContinue}),r==="checkSourcesModal"&&p&&l.jsx(ove,{isOpen:r==="checkSourcesModal",onClose:t,entryUUID:p.entryUUID,frontendContextUUID:p.frontendContextUUID,contextUUID:p.contextUUID,webResults:p.webResults,extendedBeforeContext:p.extendedBeforeContext,beforeContext:p.beforeContext,selectedText:p.selectedText,afterContext:p.afterContext,state:p?.state}),r==="onboardingModal"&&l.jsx(xxe,{isOpen:r==="onboardingModal",closeModal:t}),r==="lossAversionModal"&&v&&l.jsx(bxe,{isOpen:r==="lossAversionModal",onClose:()=>{t(),v.callback?.()},origin:v.origin}),r==="shoppingOnboardingModal"&&y&&l.jsx(Sxe,{isOpen:r==="shoppingOnboardingModal",onClose:t,onContinue:y.onContinue,flowType:y.flowType}),r==="shoppingOrderDetailsModal"&&l.jsx(Exe,{isOpen:r==="shoppingOrderDetailsModal",onClose:t,item:x?.item,userIntercomHash:x?.userIntercomHash}),r==="purchaseConfirmationModal"&&g&&l.jsx(vxe,{isOpen:r==="purchaseConfirmationModal",onClose:t,order:g.order}),r==="watchlistModal"&&S&&l.jsx(mve,{isOpen:r==="watchlistModal",onClose:t,watchlistType:S.watchlistType,origin:S.origin}),r==="locationPermissionModal"&&w&&l.jsx(pxe,{isOpen:r==="locationPermissionModal",onClose:t,onPermissionGranted:w.onPermissionGranted??Ao,origin:w.origin}),r==="deleteMemoryModal"&&l.jsx(dve,{isOpen:r==="deleteMemoryModal",onClose:t,memoryId:C?.memoryId,onDeleteSuccess:C?.onDeleteSuccess}),r==="deleteAllMemoriesModal"&&l.jsx(uve,{isOpen:r==="deleteAllMemoriesModal",onClose:t}),r==="hotelRoomDetailsModal"&&T&&l.jsx(Axe,{isOpen:r==="hotelRoomDetailsModal",onClose:t,...T}),r==="memoryListModal"&&l.jsx(Mxe,{isOpen:r==="memoryListModal",onClose:t,isMemoryEnabled:k?.isMemoryEnabled??!1}),r==="memoryDetailModal"&&E&&l.jsx(Txe,{isOpen:r==="memoryDetailModal",onClose:t,memoryKey:E.memoryKey,displayValue:E.displayValue}),r==="thirdPartyPersonalizationModal"&&De&&l.jsx(fve,{isOpen:r==="thirdPartyPersonalizationModal",onClose:t,...De}),r==="proSubscriptionPaymentModal"&&I&&l.jsx(Nxe,{isOpen:r==="proSubscriptionPaymentModal",onClose:t,...I}),r==="proMessageModal"&&M&&l.jsx(jxe,{isOpen:r==="proMessageModal",onClose:t,...M}),r==="memorySearchHistoryModal"&&l.jsx(ave,{isOpen:r==="memorySearchHistoryModal",onClose:t,snippet:N?.snippet??"",type:N?.type??"memory",url:N?.url??"",memoryKey:N?.memoryKey,entryUuid:N?.entryUuid,title:N?.title,timestamp:N?.timestamp}),r==="gmailFailedPermissionsModal"&&D&&l.jsx(ive,{isOpen:r==="gmailFailedPermissionsModal",onContinue:D.onContinue??Ao,onClose:t}),r==="emailAssistantDisconnectWarningModal"&&j&&l.jsx(lve,{isOpen:r==="emailAssistantDisconnectWarningModal",connectorName:j.connectorName,onContinue:j.onContinue,onClose:t}),r==="calendarSelectionModal"&&F&&l.jsx(cve,{isOpen:r==="calendarSelectionModal",connectorType:F.connectorType,onClose:t}),r==="subSuccessModal"&&R&&l.jsx(Ixe,{isOpen:r==="subSuccessModal",onClose:t,flowType:R.flowType,upgradeMax:R.upgradeMax,subscriptionTier:R.subscriptionTier,confirmationRedirectsToHomepage:R.confirmationRedirectsToHomepage}),r==="referralErrorModal"&&l.jsx(Pxe,{isOpen:r==="referralErrorModal",onClose:t}),r==="referralSuccessModal"&&Y&&l.jsx(Oxe,{isOpen:r==="referralSuccessModal",onClose:t,monthsAwarded:Y.monthsAwarded}),r==="incentiveProModal"&&l.jsx(Lxe,{isOpen:r==="incentiveProModal",onClose:t,...P}),r==="braintreeSubscriptionModal"&&X&&l.jsx(Uxe,{isOpen:r==="braintreeSubscriptionModal",onClose:t,origin:X.origin}),r==="sheerIdRedirectModal"&&U&&l.jsx(Hxe,{isOpen:r==="sheerIdRedirectModal",onContinue:()=>{t(),No(U.sheerIdUrl,"sheerIdRedirectModal")},onCancel:t}),r==="upgradeModal"&&l.jsx(gve,{isOpen:r==="upgradeModal",onClose:t}),r==="downgradeModal"&&l.jsx(hve,{isOpen:r==="downgradeModal",onClose:t}),r==="restaurantBookingModal"&&L&&l.jsx(Vxe,{isOpen:r==="restaurantBookingModal",onClose:t,...L}),r==="enterprisePremiumSecureUpgradeModal"&&l.jsx(zxe,{isOpen:r==="enterprisePremiumSecureUpgradeModal",onClose:t,onUpgradeSuccess:O?.onUpgradeSuccess}),r==="taskShortcutModal"&&$&&l.jsx(Wxe,{open:r==="taskShortcutModal",onClose:()=>{t(),$.onClose?.()},onCreated:$.onCreated,source:$.source,shortcut:$.shortcut}),r==="financeAlertModal"&&G&&l.jsx(qxe,{isOpen:r==="financeAlertModal",onClose:()=>{t(),G.onClose?.()},symbol:G.symbol,task:G.task}),r==="scheduledTaskModal"&&H&&l.jsx(Wc,{children:l.jsx(Gxe,{open:r==="scheduledTaskModal",onClose:()=>{t(),H.onClose?.()},onSuccess:H.onSuccess,source:H.source,initial:H.initial,prefill:H.prefill})}),r==="automationModal"&&Q&&l.jsx(Wc,{children:l.jsx($xe,{open:r==="automationModal",onClose:()=>{t(),Q.onClose?.()},source:Q.source,initialConfiguration:Q.initial?Hye({selectedTask:Q.initial}):Q.prefill?Vye(Q.prefill):Q.initialConfiguration||g4(n),onSave:Ke=>{Q.onSuccess?.(Ke),t(),Q.onClose?.()},errorMessage:Q.errorMessage,trackEvent:Ee,canEditSpace:Q.canEditSpace,canDelete:Q.canDelete})}),r==="sharepointSiteModal"&&te&&l.jsx(Kxe,{isOpen:r==="sharepointSiteModal",onClose:t,onSelectSite:te.onSelectSite}),r==="avatarManagementModal"&&se&&l.jsx(pve,{isOpen:r==="avatarManagementModal",onClose:t,config:se??{source:"settings"}}),r==="shoppingTryOnOnboardingModal"&&l.jsx(sve,{isOpen:r==="shoppingTryOnOnboardingModal",onClose:ae?.onClose||t,onSuccessfulOnboarding:ae?.onSuccessfulOnboarding||(()=>{})}),r==="announcementImageModal"&&ee&&l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,isPartnershipCampaign:!0,children:l.jsx(nve,{onClose:t,announcementImageModal:ee})}),r==="fullscreenUpsellModal"&&le&&l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,isPartnershipCampaign:!0,children:l.jsx(rve,{onClose:t,fullscreenUpsellModal:le})}),r==="studentReferrals"&&l.jsx(Fxe,{isOpen:r==="studentReferrals",verificationId:re?.verificationId}),r==="sheerIdModal"&&l.jsx(Bxe,{isOpen:r==="sheerIdModal",onClose:()=>{ce?.onClose?.(),t()},onVerificationSuccess:Ke=>{ce?.onSuccess?.(Ke),t()},type:ce?.type||"student"}),r==="meetingDefaultsModal"&&l.jsx(Rxe,{currentDuration:ue?.currentDuration,currentBuffer:ue?.currentBuffer,onSave:ue?.onSave}),r==="availabilityModal"&&l.jsx(Dxe,{currentAvailability:me?.currentAvailability,onSave:me?.onSave}),r==="mcpServerModal"&&we&&l.jsx(Yxe,{isOpen:r==="mcpServerModal",onClose:t,server:we.server,onSave:we.onSave,onDelete:we.onDelete}),r==="mcpServiceToolsModal"&&ye&&l.jsx(Xxe,{isOpen:r==="mcpServiceToolsModal",onClose:t,server:ye.server,onEditServer:ye.onEditServer,onToggleToolEnabled:ye.onToggleToolEnabled}),r==="memberSetTierModal"&&_e&&l.jsx(Qxe,{isOpen:r==="memberSetTierModal",..._e,onClose:()=>{t(),_e.onClose?.()}}),r==="placeModal"&&ke&&l.jsx(Zxe,{isOpen:r==="placeModal",onClose:t,place:ke.place,mode:ke.mode,entryUUID:ke.entryUUID,contextUUID:ke.contextUUID}),r==="orgInviteModal"&&xe&&(xe.invitationUUID?l.jsx(GR,{invitationUUID:xe.invitationUUID,isNewUser:xe.isNewUser,onClose:t}):l.jsx(GR,{openInviteLinkUUID:xe.openInviteLinkUUID,isNewUser:xe.isNewUser,onClose:t}))]})});mz.displayName="SingleModal";function Wt(){const{status:e}=Ne(),t=e==="authenticated";return d.useEffect(()=>{t&&_fe()},[t]),t}const pz=()=>{const e=d.useCallback(r=>{F2e(r)},[]),t=mr(f3),n=d.useCallback(()=>$p(f3),[]);return d.useMemo(()=>({lossAversionStatus:t,setLossAversionStatus:e,unsetLossAversion:n}),[t,e,n])},xve=()=>{const{lossAversionStatus:e,setLossAversionStatus:t}=pz(),n=On(),r=Wt(),s=d.useMemo(()=>!r&&e==="allowed"&&n?.startsWith("/search"),[r,e,n]),{openModal:o}=pn().legacy,a=d.useCallback(({args:i,openModalOverride:c})=>{c?c("lossAversionModal",i):o("lossAversionModal",i),t("cooldown")},[o,t]);return d.useMemo(()=>({shouldShowLossAversionModal:s,handleOpenLossAversion:a}),[s,a])},vve=Ce(async()=>{const{KeyboardShortcutHelperModal:e}=await Se(()=>q(()=>import("./KeyboardShortcutHelperModal-DNkbHnqh.js"),__vite__mapDeps([120,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),bve=Ce(async()=>{const{KeyboardShortcutEditorModal:e}=await Se(()=>q(()=>import("./KeyboardShortcutEditorModal-D82pYLUS.js"),__vite__mapDeps([121,4,1,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),_ve=({children:e})=>{const[t,n]=d.useState([]),r=d.useMemo(()=>t.at(-1)?.modalName??null,[t]),{session:s}=Ne(),{trackEvent:o}=Xe(s),{device:{isMacOS:a,isWindowsApp:i}}=sn(),{shouldShowLossAversionModal:c,handleOpenLossAversion:u}=xve(),f=Rn(),{openModal:m}=Uo(),p=d.useCallback((b,_)=>{n(()=>[{modalName:b,arg:_}])},[]),h=d.useCallback((b,_)=>{n(w=>[...w,{modalName:b,arg:_}])},[]),g=d.useCallback((b,_)=>{n(w=>{const S=w.findLastIndex(C=>C.modalName==b);if(S!=-1){const C=w.slice();return C[S]={modalName:b,arg:_},C}else return w})},[]),y=d.useCallback(()=>{n(b=>b.slice(0,b.length-1))},[]),x=d.useMemo(()=>({currentOpenModals:t,currentOpenedModal:r,openModal:p,openStackedModal:h,updateModal:g,closeModal:y}),[t,p,h,g,y,r]),v=d.useCallback(b=>{if(a?b.metaKey&&b.key==="k":b.ctrlKey&&b.key==="i")b.preventDefault(),c?u({args:{origin:ft.NEW_THREAD_SHORTCUT,callback:()=>{o("quick ask keyboard shortcut",{}),f.push("/",void 0,"Quick ask keyboard shortcut (loss aversion)")}},openModalOverride:p}):(o("quick ask keyboard shortcut",{}),f.push("/",void 0,"Quick ask keyboard shortcut"));else if(a?b.metaKey&&b.key==="/":b.ctrlKey&&b.key==="/")b.preventDefault(),i?m(bve,{legacyIdentifier:"keyboardShortcutEditorModal"}):m(vve,{legacyIdentifier:"keyboardShortcutHelperModal"});else if(i&&b.ctrlKey&&b.key==="d"){b.preventDefault();const _=new CustomEvent("toggleDictation");document.dispatchEvent(_)}},[a,i,c,u,p,m,o,f]);return d.useEffect(()=>(document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}),[v]),l.jsxs(lz.Provider,{value:x,children:[e,l.jsx(dz,{})]})};function wve(){return null}async function Cve(){const e=Ga();if("serviceWorker"in navigator){const{Workbox:t}=await q(async()=>{const{Workbox:s}=await import("./workbox-window.prod.es5-CwtvwXb3.js");return{Workbox:s}},[]),n=new URL("/service-worker.js",window.location.origin);e.version&&n.searchParams.set("v",e.version);const r=new t(n.toString());try{await r.register()}catch(s){Z.error("Error registering service worker",s)}}}async function Sve(){"serviceWorker"in navigator&&await navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister())))}const hz=A.memo(function(){return d.useEffect(()=>{const t=Ga();t.env&&t.env!=="local"?Cve():Sve()},[]),null});hz.displayName="ServiceWorker";const Eve=async({file:e,fileSource:t="default",forceImage:n=!1,reason:r})=>{const s=await de.POST("/rest/uploads/create_upload_url",r,{body:{filename:e.name,content_type:e.type,source:t,file_size:e.size,force_image:n},timeoutMs:Cn.MEDIUM,retries:2});return s.data?s.data:null},kve=async({filesWithUuids:e,fileSource:t="default",forceImage:n=!1,reason:r})=>{const s={};e.forEach(({uuid:a,file:i})=>{s[a]={filename:i.name,content_type:i.type,source:t,file_size:i.size,force_image:n}});const o=await de.POST("/rest/uploads/batch_create_upload_urls",r,{body:{files:s},timeoutMs:Cn.MEDIUM,retries:2});return o.data?o.data.results:null},Mve=async({remote_file_id:e,connection_type:t,source:n,reason:r})=>{const s=await de.POST("/rest/connectors/attachments/upload",r,{body:{remote_file_id:e,connection_type:t,source:n??"default"},timeoutMs:Cn.VERY_HIGH,retries:2});return s.data?s.data:null};async function Tve({request:e,reason:t}){return new Promise((n,r)=>{de.SSE("/rest/sse/attachment_processing/subscribe",t,{params:e,handlers:{message:s=>{n(s)}}}).catch(r)})}const Zo=e=>{try{return JSON.parse(e)}catch{return{}}};function Ave({reason:e}){const t=An(),n=un(),r=d.useCallback(async(s,o,a)=>{if(Z.info("browserStep",s),s.browser_open_tab_content){const i=s.browser_open_tab_content,c=Zo(i.extra_headers);Z.info("browserTool: browser_open_tab",{tool:i},{request_id:c[yn]}),await ehe({url:i.url,cometBrowser:n,stepUuid:s.uuid,extraHeaders:Zo(i.extra_headers),reason:e})}else if(s.search_browser_content){const i=s.search_browser_content,c=Zo(i.extra_headers);Z.info("browserTool: search_browser",{tool:i},{request_id:c[yn]}),await rhe(i,n,s.uuid,c,e)}else if(s.browser_close_tabs_content){const i=s.browser_close_tabs_content,c=i.payload;if(!c){Z.error("[useExecuteBrowserTool] browser_close_tabs_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const u=Zo(i.extra_headers);Z.info("browserTool: browser_close_tabs",{tool:i},{request_id:u[yn]}),await nhe(c,n,s.uuid,u,e)}else if(s.browser_group_tabs_content){const i=s.browser_group_tabs_content,c=i.payloads,u=Zo(i.extra_headers);Z.info("browserTool: browser_group_tabs",{tool:i},{request_id:u[yn]}),await the(c,n,s.uuid,u,e)}else if(s.entropy_request_content){const i=s.entropy_request_content,c=i.extra_headers,u=Zo(c)[yn];Z.info("browserTool: entropy_request",{tool:i},{request_id:u}),i.tasks.forEach(f=>{Z.info("[comet] Submitting agent task",{task_id:f.uuid,entry_uuid:o,request_id:u}),n.submitTask({action:"startAgentFromPerplexity",type:"START_AGENT",extra_headers:c,base_url:i.base_url,entryId:o,...f,use_current_page:f.use_current_page&&!0,capture_screenshot:!f.use_current_page&&!f.tab_id,is_mission_control:window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants")||i.is_mission_control,thread_url_slug:a})})}else if(s.get_url_content_content){const i=s.get_url_content_content,c=Zo(i.extra_headers);if(Z.info("browserTool: get_url_content",{tool:i},{request_id:c[yn]}),!t)return;const u={...i,key:s.uuid,request_id:c[yn],pages:[...i.pages||[]]},f=n.GetContent(u);await Ti(f,s.uuid,{request_id:c[yn]??""},e)}else if(s.browser_ungroup_content){const i=s.browser_ungroup_content;if(!i.payload){Z.error("[useExecuteBrowserTool] browser_ungroup_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const c={groupIds:i.payload.group_ids,tabIds:i.payload.tab_ids},u=Zo(i.extra_headers),f=n.ungroupTabs(c,s.uuid,u[yn]??"").then(m=>{if(!m.is_success)throw m;return{group_ids:m.groupIds,tab_ids:m.tabIds}});await Ti(f,s.uuid,{request_id:u[yn]??""},e)}else if(s.browser_search_tab_groups_content){const i=s.browser_search_tab_groups_content,c=i.payload;if(!c){Z.error("[useExecuteBrowserTool] browser_search_tab_groups_content payload is undefined",{browserStep:s},{reason:e,backend_uuid:o});return}const u=Zo(i.extra_headers),f=n.searchTabGroups(c,s.uuid,u[yn]??"").then(m=>{if(!m.is_success)throw m;return{results:m.results.map(p=>({...p,color:sV(p.color)}))}});await Ti(f,s.uuid,{request_id:u[yn]??""},e)}else if(s.browser_get_visible_tab_screenshot_content){const i=s.browser_get_visible_tab_screenshot_content,c=Zo(i.extra_headers),u=n.GetVisibleTabScreenshot({key:s.uuid,request_id:c[yn]??"",...i}).then(async f=>{const p=await(await fetch(f.data_url)).blob(),h=new File([p],"screenshot."+(i.format??"png"),{type:p.type}),g=await Eve({file:h,forceImage:!0,reason:e,fileSource:"entropy"});if(!g||!g?.fields||!g.s3_bucket_url)throw new Error("Failed to create upload URL");const y=new FormData;Object.entries(g.fields).forEach(([b,_])=>{y.append(b,_)}),y.append("file",h);const x=await fetch(g.s3_bucket_url,{method:"POST",body:y});if(!x.ok)throw new Error(`Failed to upload screenshot: ${x.statusText}`);const v=await x.json();if(!v.secure_url)throw Z.error("[GetVisibleTabScreenshot] Upload did not return a secure URL",{response:v}),new Error("Upload did not return a secure URL");return{screenshot_url:v.secure_url}});await Ti(u,s.uuid,{request_id:c[yn]??""},e)}else if(s.browser_get_cookies_content){const i=s.browser_get_cookies_content,c=Zo(i.extra_headers);Z.info("browserTool: browser_get_cookies",{tool:i},{request_id:c[yn]}),await Ti(n.getCookies(),s.uuid,{request_id:c[yn]??""},e)}else Z.error("[useExecuteBrowserTool] Unknown browser tool step",{browserStep:s},{reason:e,backend_uuid:o})},[n,t,e]);return d.useMemo(()=>({executeBrowserTool:r}),[r])}const gz=A.memo(function(){const{executeBrowserTool:t}=Ave({reason:"StreamMiddlewares"}),n=d.useCallback((s,o)=>{if(!s||!s.browser_tool)return s;t(s.browser_tool,s.backend_uuid,o)},[t]),r=d.useMemo(()=>[n],[n]);return l.jsx(_H,{middlewares:r})});gz.displayName="StreamMiddlewares";const Nve=10,N4=Nve,yz=N4*10,Rve=yz*10+N4,zd="all_results",Dve=({slugOrUUID:e,enabled:t,isSidecar:n,reason:r})=>{const s=Yt(),o=d.useCallback(async(a,i,c=[])=>{const u=await kge({slugOrUUID:a,options:{withParentInfo:!0,supportedBlockUseCases:[...kV],limit:i?yz:N4,fromFirst:!0,cursor:i},numRetries:$l,reason:r});if(!u?.entries?.length||u.status!=="success")return c;const f=be.makeQueryKey(zd,a),m=u.entries;return c.push(...m),s.setQueryData(f,p=>{const h=new Map,g=y=>h.set(y.backend_uuid,y);return p?.forEach(g),m.forEach(g),Array.from(h.values())}),u.next_cursor&&c.length!!(i instanceof he&&i.status===403&&n&&a<2),queryFn:async()=>await o(e,null,[])})},R4=()=>{const e=Yt();return d.useCallback((t,n)=>{!n&&!t||[be.makeQueryKey(zd,t?.thread_url_slug||n?.at(0)?.thread_url_slug||""),be.makeQueryKey(zd,t?.backend_uuid||n?.at(0)?.backend_uuid||"")].forEach(r=>{if(be.unmakeQueryKey(r).at(-1)){if(t){const s=e.getQueryData(r)??[],o=n?.some(i=>i.backend_uuid===t?.backend_uuid),a=s.findIndex(i=>i.backend_uuid===t?.backend_uuid);if(a!==-1){const i=[...s];i[a]=t,e.setQueryData(r,i);return}else if(o&&a===-1){const i=[...s,t];e.setQueryData(r,i);return}}if(n&&!t){const s=[...n];e.setQueryData(r,s);return}e.invalidateQueries({queryKey:r})}})},[e])},xz=()=>{const e=Yt();return d.useCallback(t=>{t?e.getQueriesData({queryKey:be.makeQueryKey(zd),exact:!1})?.forEach(([n,r])=>{if(!r)return;const s=r.filter(o=>o.backend_uuid!==t&&o.thread_url_slug!==t);s.length!==r.length&&(s.length?e.setQueryData(n,s):e.removeQueries({queryKey:n,exact:!0}))}):e.removeQueries({queryKey:be.makeQueryKey(zd),exact:!1})},[e])},jve=({windowsAppOnly:e=!0}={})=>{const[t,n]=d.useState(()=>globalThis.Notification?globalThis.Notification.permission:"denied"),{device:{isWindowsApp:r}}=sn();d.useEffect(()=>{globalThis.Notification&&globalThis.Notification.permission!==t&&n(globalThis.Notification.permission)},[t]);const s=d.useCallback(async()=>{if(globalThis.Notification){if(t==="granted")return!0;if(t==="denied")return!1;const a=await globalThis.Notification.requestPermission();return n(a),a==="granted"}return!1},[t]),o=d.useCallback(async({title:a,body:i,icon:c="https://r2cdn.perplexity.ai/pplx-desktop-icon.png",onClick:u})=>{if(!(e&&!r||!await s())&&globalThis.Notification){const m=new globalThis.Notification(a,{body:i,icon:c});u&&(m.onclick=()=>{u(),window.focus()})}},[e,r,s]);return d.useMemo(()=>({sendNotification:o,requestPermission:s,permission:t,isWindowsApp:r}),[r,t,s,o])};function Ive(){const e=Yt();return d.useCallback(()=>{e.invalidateQueries({queryKey:Zy()})},[e])}const Pve=(e,t)=>{const{value:n,loading:r}=kf({flag:"sapi-ranking-navigate",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Ove=async({query:e,userIdentity:t,queryClient:n,reason:r,sapiSearchNavigateConfig:s})=>{try{const o=s?[`sapi-ranking-navigate-cfg=${JSON.stringify(s)}`]:[],c=(await(await wfe({resource:"https://suggest.perplexity.ai/search/v2/navigate",method:"POST",options:{headers:{"content-type":"application/json","X-Client-Name":"agi_ui_navigate_v2","X-Client-Env":"production"}},body:JSON.stringify({query:e,user_identity:{lang:t.lang,country:t.country,ab_active_tests:o}}),timeoutMs:1e3,reason:r})).json())?.hit;c&&n.setQueryData($H(e),c)}catch(o){Z.error("Failed to fetch navigational search results:",o)}},Lve=35,Fve=()=>{const e=Yt(),t=Ox(),{variation:n,loading:r}=Pve({});return d.useCallback(({query:s,params:o,reason:a})=>{const i=s.length<=Lve,c=!!o.last_backend_uuid,u=o.attachments,f=o.sources,m=o.model_preference==="pplx_study";if(i&&!c&&u.length===0&&f&&f.length>0&&!m){const h={lang:o.language,country:t};Ove({query:s,userIdentity:h,queryClient:e,reason:a,sapiSearchNavigateConfig:r?void 0:n})}},[e,t,n,r])};var Rs;(function(e){e.EXPOSURE="sbs exposure",e.JUDGMENT="sbs judgment",e.BANNER="sbs banner"})(Rs||(Rs={}));const Jy=-1,Bve="sbs_analytics_",Uve=e=>{const t=e?.experiment_override;return t?JSON.stringify(t):""},Vve=(e,t)=>{const n=e.side_by_side_metadata;return{displayPosition:t,experimentRole:n?.experiment_role||`entry_${t}`,entryUUID:e.backend_uuid,experimentOverride:Uve(n)}},vz=(e,t)=>`${Bve}${e}_${t}`,A_=(e,t)=>{try{const n=vz(e,t);return vt.getItem(n)==="true"}catch(n){return Z.error("Error checking localStorage for SBS event:",n),!1}},N_=(e,t)=>{try{const n=vz(e,t);vt.setItem(n,"true")}catch(n){Z.error("Error setting localStorage for SBS event:",n)}},Hve=({results:e,session:t,trackEvent:n})=>{const r=d.useCallback(()=>{if(!e[0])return null;const c=e[0].side_by_side_metadata;if(!c?.sibling_uuid)return null;const u=c.experiment_override,f=u&&Object.keys(u)[0]||"";return{evaluationUUID:c.sibling_uuid,experimentVariationKey:f,evaluatorID:t?.user?.id||t?.user?.email||"anonymous"}},[e,t?.user?.id,t?.user?.email]),s=d.useCallback(c=>{try{const u=r();if(!u)return null;let f,m;if(c===Jy)f=Jy,m=void 0;else if(f=c,f>=0&&f{h.backend_uuid&&h.side_by_side_metadata?.execution_log&&(p[h.backend_uuid]=h.side_by_side_metadata.execution_log)}),{eventType:Rs.JUDGMENT,timestampMs:Date.now(),eventData:{evaluationUUID:u.evaluationUUID,evaluatorID:u.evaluatorID,experimentVariationKey:u.experimentVariationKey,experimentRoles:e.map(h=>h.side_by_side_metadata?.experiment_role||`entry_${e.indexOf(h)}`),preferredPosition:f,entryUUID:m,executionLogs:p}}}catch(u){return Z.error("Failed to build SBS judgment payload:",u),null}},[r,e]),o=d.useCallback(c=>{try{const u=r();if(!u||A_(u.evaluationUUID,Rs.JUDGMENT))return;const f=s(c);f&&(n(Rs.JUDGMENT,f),N_(u.evaluationUUID,Rs.JUDGMENT))}catch(u){Z.error("Failed to track SBS judgment:",u)}},[r,s,n]),a=d.useCallback(()=>{try{const c=r();if(!c||A_(c.evaluationUUID,Rs.BANNER))return;const u={eventType:Rs.BANNER,timestampMs:Date.now(),eventData:{evaluationUUID:c.evaluationUUID,evaluatorID:c.evaluatorID,experimentVariationKey:c.experimentVariationKey,experimentRoles:e.map(f=>f.side_by_side_metadata?.experiment_role||`entry_${e.indexOf(f)}`)}};n(Rs.BANNER,u),N_(c.evaluationUUID,Rs.BANNER)}catch(c){Z.error("Failed to track SBS banner exposure:",c)}},[r,e,n]),i=d.useCallback(()=>{try{const c=r();if(!c||A_(c.evaluationUUID,Rs.EXPOSURE))return;const u={eventType:Rs.EXPOSURE,timestampMs:Date.now(),eventData:{evaluationUUID:c.evaluationUUID,evaluatorID:c.evaluatorID,experimentVariationKey:c.experimentVariationKey,entries:e.map(Vve)}};n(Rs.EXPOSURE,u),N_(c.evaluationUUID,Rs.EXPOSURE)}catch(c){Z.error("Failed to track SBS exposure:",c)}},[r,e,n]);return d.useMemo(()=>({trackJudgment:o,trackBannerExposure:a,trackSBSExposure:i}),[o,a,i])},zve=({enabled:e,reason:t})=>{const{locale:n}=J(),r=n?{"accept-language":n}:{},s=async()=>E2e({headers:r,reason:t}),o=Wt(),{data:a}=mt({enabled:o?typeof e>"u"?!0:e:!1,queryKey:$ye(),queryFn:s});return a??QH},Wve=e=>e?.context_uuid??void 0,Gve=e=>e?.frontend_context_uuid??void 0,$ve=e=>e?.thread_title??"",qve=e=>e?.query_str??void 0,Kve=e=>e?.search_focus??void 0,Yve=e=>e.sources?.sources??void 0,Qve=e=>e?.author_id??void 0,Xve=e=>e?.author_username??void 0,Zve=e=>e?.author_image??void 0,Jve=e=>{if(e.parent_info)return e.parent_info},ebe=e=>e?.mode??null,tbe=e=>e?.personalized??void 0,nbe=e=>e?.collection_info??void 0,rbe=e=>e?.bookmark_state??void 0,sbe=e=>e?.thread_access??void 0,obe=e=>e?.thread_url_slug??void 0,abe=e=>e?.updated_datetime??void 0,ibe=e=>e?.expiry_time??null,lbe=e=>e?.privacy_state??void 0,g3=e=>({forkCount:e?.fork_count??0,likeCount:e?.like_count??0,viewCount:e?.view_count??0,userLikes:e?.user_likes??!1}),cbe={},R_=e=>e?{author_id:Qve(e),author_image:Zve(e),author_username:Xve(e),bookmarkState:rbe(e),collection:nbe(e),contextUUID:Wve(e),expiry_time:ibe(e)??void 0,first_query:qve(e),focus:Kve(e),frontendContextUUID:Gve(e),mode:ebe(e)??void 0,parent_info:Jve(e)??void 0,personalized:tbe(e)??void 0,privacy_state:lbe(e)??void 0,rwToken:e.read_write_token,sources:Yve(e)??void 0,text_completed:!1,thread_access:sbe(e)??void 0,thread_url_slug:obe(e),title:$ve(e),updated_datetime:abe(e)}:cbe;function ube({entries:e,threads:t,streams:n,currentStreamId:r,currentThreadId:s}){const o=r?n[r]:void 0,a=o?.threadId??s;if(a){const i=t.find(c=>c.id===a);if(i){const c=i.entryIds.map(u=>e[u]).filter(u=>u!=null);return o?.placeholderChunk&&!o.entryId&&c.push(o.placeholderChunk),c}}return o?.placeholderChunk?[o.placeholderChunk]:[]}const rg=Ft("ResultsContext",null),dbe=({children:e})=>{const t=Hs(),[n,r]=d.useState(),[s,o]=d.useState(),a=d.useCallback(p=>{if(r(p),p){const{streams:h}=t.getState(),g=Object.values(h).find(y=>y.threadId===p);o(g?.id.description)}},[t]),i=d.useCallback(p=>{if(o(p),p){const h=t.getState().streams[p];h?.threadId&&r(h.threadId)}},[t]),c=d.useMemo(()=>({setCurrentThreadId:a,setCurrentStreamId:i,clear:()=>{a(void 0),i(void 0)}}),[a,i]),u=d.useCallback(p=>{const h=ube({entries:p.entries,threads:p.threads,streams:p.streams,currentStreamId:s,currentThreadId:n}),g=Zfe(h),y=Jfe(h),x=h.find(v=>qt.isStatusPending(v));return{results:h,firstResult:g,lastResult:y,inFlightEntry:x,inFlight:!!x,inFlightLatest:h.length>0&&y!==void 0&&qt.isStatusPending(y),socialStats:g3(g?.social_info),resultsLength:h.length}},[n,s]),f=s0e(t,u),m=d.useMemo(()=>({...f,actions:c,currentThreadId:n,currentStreamId:s}),[n,s,f,c]);return l.jsx(rg.Provider,{value:m,children:e})};function on(){const e=d.useContext(rg);if(!e)throw new Error("useResults must be used within a ResultsProvider");return e.useProxy()}function D4(e){const t=d.useContext(rg);if(!t)throw new Error("useResultsSelector must be used within a ResultsProvider");return t.useSelector(e)}function Vx(){const e=d.useContext(rg);if(!e)throw new Error("useResultsActions must be used within a ResultsProvider");return e.actions}const j4=()=>{const e=d.useContext(rg),t=n1e(),n=R4();return d.useCallback(r=>t(e?.currentThreadId,s=>{const o=r(s);if(o)return n(void 0,o),o}),[t,e?.currentThreadId,n])},bz=()=>{const e=t1e(),t=R4();return d.useCallback((n,r)=>{e(n,s=>{const o=r(s);if(o)return t(o,void 0),o})},[e,t])},fbe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"enable-gemini-3-flash-web",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Nr={[oe.SEARCH]:He({askInputPlaceholder:{defaultMessage:"Ask anything…",id:"AUouhaZgFv"},name:{defaultMessage:"Search",id:"xmcVZ0BU63"},description:{defaultMessage:"Fast answers to everyday questions",id:"5Y9Hg4e+zB"}}),[oe.RESEARCH]:He({askInputPlaceholder:{defaultMessage:"Research anything…",id:"PITzDLgm5P"},name:{defaultMessage:"Research",id:"JEe7dVso7F"},description:{defaultMessage:"Deep research on any topic",id:"uH6f+eH2OS"}}),[oe.STUDIO]:He({askInputPlaceholder:{defaultMessage:"Create anything…",id:"pmtrj6Tjm9"},name:{defaultMessage:"Labs",id:"ylFNoY79wa"},description:{defaultMessage:"Create projects from scratch",id:"nH9rAkplC/"}}),[oe.STUDY]:He({askInputPlaceholder:{defaultMessage:"Study anything…",id:"UOEDdZ+cnD"},name:{defaultMessage:"Learn",id:"IbrSk1x1M4"},description:{defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"}})},$n={[ie.DEFAULT]:He({name:{defaultMessage:"Best",id:"PzlMqGwwkm"},description:{defaultMessage:"Adapts to each query",id:"SsTMNu/s/A"}}),[ie.PRO]:He({name:{defaultMessage:"Best",id:"PzlMqGwwkm"},description:{defaultMessage:"Automatically selects the best model based on the query",id:"3ZgFQznYO0"}}),[ie.PPLX_PRO_UPGRADED]:He({name:{defaultMessage:"Pro",id:"R/eOkjWqNU"},description:{defaultMessage:"Automatically selects the most responsive model based on the query",id:"DuOz+H05Us"}}),[ie.SONAR]:He({name:{defaultMessage:"Sonar",id:"sT9VX563o6"},description:{defaultMessage:"Perplexity's fast model",id:"pdbURewz6Q"}}),[ie.GPT_4o]:He({name:{defaultMessage:"GPT-4o",id:"nebbHBgxX/"},description:{defaultMessage:"OpenAI's versatile model",id:"zdAw82CyOA"}}),[ie.GPT_4_1]:He({name:{defaultMessage:"GPT-4.1",id:"+LPr/f6Fal"},description:{defaultMessage:"OpenAI's advanced model",id:"+uCLZVt7uh"}}),[nt.GPT_5]:He({name:{defaultMessage:"GPT-5",id:"VfhmdGpVc7"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[ie.GPT_5_1]:He({name:{defaultMessage:"GPT-5.1",id:"uOMpo0agAL"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[nt.GPT_5_THINKING]:He({name:{defaultMessage:"GPT-5 Thinking",id:"/IA3KV+qFr"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[ie.GPT_5_1_THINKING]:He({name:{defaultMessage:"GPT-5.1 Thinking",id:"74//SO976H"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[nt.GPT5_PRO]:He({name:{defaultMessage:"GPT-5 Pro",id:"GwvubEn/BR"},description:{defaultMessage:"OpenAI's latest, most powerful reasoning model",id:"3Z57hOWKDd"}}),[ie.GPT_5_2]:He({name:{defaultMessage:"GPT-5.2",id:"X26Ei/S8vd"},description:{defaultMessage:"OpenAI's latest model",id:"5VYr+wSh/Y"}}),[ie.GPT_5_2_THINKING]:He({name:{defaultMessage:"GPT-5.2 Thinking",id:"9NodtkoSox"},description:{defaultMessage:"OpenAI's latest model with thinking",id:"r+tIMgEnyZ"}}),[ie.CLAUDE_2]:He({name:{defaultMessage:"Claude Sonnet 4.0",id:"4UrgPEhdwq"},description:{defaultMessage:"Anthropic's advanced model",id:"b5CqfvLw4b"}}),[ie.GEMINI_2_5_PRO]:He({name:{defaultMessage:"Gemini 2.5 Pro",id:"hec4NYL1Ib"},description:{defaultMessage:"Google's latest model",id:"XBL8FigIeX"}}),[ie.GEMINI_3_0_PRO]:He({name:{defaultMessage:"Gemini 3 Pro",id:"UK0QXlryM2"},description:{defaultMessage:"Google's advanced reasoning model",id:"V15f6f4scw"}}),[ie.GEMINI_3_0_FLASH]:He({name:{defaultMessage:"Gemini 3 Flash",id:"wBxtNZNdaJ"},description:{defaultMessage:"Google's fast reasoning model",id:"SaPbtF8tK+"}}),[ie.GEMINI_3_0_FLASH_HIGH]:He({name:{defaultMessage:"Gemini 3 Flash Thinking",id:"WGU4v3vcgP"},description:{defaultMessage:"Google's fast reasoning model with enhanced thinking",id:"dpD7Tlrlld"}}),[ie.GROK]:He({name:{defaultMessage:"Grok 3 Beta",id:"Ybq0GDRm0J"},description:{defaultMessage:"xAI's Grok 3 model",id:"gwIHPQy1c/"}}),[ie.PPLX_REASONING]:He({name:{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"},description:{defaultMessage:"Advanced problem solving",id:"4J0akc6m53"}}),[ie.CLAUDE_3_7_SONNET_THINKING]:He({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[ie.CLAUDE_4_0_OPUS]:He({name:{defaultMessage:"Claude Opus 4.0",id:"fwViXd5wrs"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_0_OPUS_THINKING]:He({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_1_OPUS]:He({name:{defaultMessage:"Claude Opus 4.1",id:"aq+8T//8S9"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_1_OPUS_THINKING]:He({name:{defaultMessage:"Claude Opus 4.1 Thinking",id:"Vd2LxNSW/4"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_5_OPUS]:He({name:{defaultMessage:"Claude Opus 4.5",id:"c8oGQdxIXE"},description:{defaultMessage:"Anthropic's Opus reasoning model",id:"e0FjrIe1O/"}}),[ie.CLAUDE_4_5_OPUS_THINKING]:He({name:{defaultMessage:"Claude Opus 4.5 Thinking",id:"oBSH9hOxZC"},description:{defaultMessage:"Anthropic's Opus reasoning model with thinking",id:"ipx+1wZCy6"}}),[ie.CLAUDE_4_5_SONNET]:He({name:{defaultMessage:"Claude Sonnet 4.5",id:"TreRV15OSF"},description:{defaultMessage:"Anthropic's newest advanced model",id:"yVLNWskqHe"}}),[ie.CLAUDE_4_5_SONNET_THINKING]:He({name:{defaultMessage:"Claude Sonnet 4.5 Thinking",id:"POJuSUD1gU"},description:{defaultMessage:"Anthropic's newest reasoning model",id:"MIjO2w9Cui"}}),[ie.KIMI_K2_THINKING]:He({name:{defaultMessage:"Kimi K2 Thinking",id:"IIsFX2aoN0"},description:{defaultMessage:"Moonshot AI's latest reasoning model",id:"KFOkH3dSUa"}}),[ie.GROK_4]:He({name:{defaultMessage:"Grok 4",id:"+Y775fAOqr"},description:{defaultMessage:"xAI's reasoning model",id:"tYRPjba3cL"}}),[ie.GROK_4_NON_THINKING]:He({name:{defaultMessage:"Grok 4",id:"+Y775fAOqr"},description:{defaultMessage:"xAI's advanced model",id:"av1iNKEP7e"}}),[ie.GROK_4_1_REASONING]:He({name:{defaultMessage:"Grok 4.1",id:"gWMQFuyUxZ"},description:{defaultMessage:"xAI's latest reasoning model",id:"BVUpDXsBWU"}}),[ie.GROK_4_1_NON_REASONING]:He({name:{defaultMessage:"Grok 4.1",id:"gWMQFuyUxZ"},description:{defaultMessage:"xAI's latest advanced model",id:"+gMdtUmDTB"}}),[nt.O3_PRO]:He({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's powerful reasoning model",id:"BodLv+J6l0"}}),[ie.O4_MINI]:He({name:{defaultMessage:"o4-mini",id:"BwwjXFHgz7"},description:{defaultMessage:"OpenAI's latest reasoning model",id:"VKonAfIZbf"}}),[ie.PPLX_SONAR_INTERNAL_TESTING]:He({name:{defaultMessage:"Sonar Testing - Alpha",id:"2oa4bWRfNL"},description:{defaultMessage:"Sonar model alpha variant",id:"EvwN/e7vAD"}}),[ie.PPLX_SONAR_INTERNAL_TESTING_V2]:He({name:{defaultMessage:"Sonar Testing - Beta",id:"VNsK+ZGei/"},description:{defaultMessage:"Sonar model beta variant",id:"Dzfl36DNyM"}}),[ie.ALPHA]:He({name:{defaultMessage:"Research",id:"JEe7dVso7F"},description:{defaultMessage:"Fast and thorough for routine research",id:"v/MuahlVJE"}}),[ie.BETA]:He({name:{defaultMessage:"Labs",id:"ylFNoY79wa"},description:{defaultMessage:"Multi-step tasks with advanced troubleshooting",id:"Sf0AeuilA5"}}),[ie.STUDY]:He({name:{defaultMessage:"Study",id:"UTFsoN8Z1P"},description:{defaultMessage:"Fast model for routine research",id:"prWIV9FsWt"}}),[nt.O3_MINI]:He({name:{defaultMessage:"o3-mini",id:"GdJwPgWWId"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.GROK2]:He({name:{defaultMessage:"Grok-2",id:"9X3jPx+0vk"},description:{defaultMessage:"xAI's latest model",id:"e2CghRZC7d"}}),[nt.GPT_4]:He({name:{defaultMessage:"GPT-4",id:"6TGiMlP7f4"},description:{defaultMessage:"OpenAI's previous generation model",id:"U3OQoJ211e"}}),[nt.CLAUDE_3_OPUS]:He({name:{defaultMessage:"Claude 3 Opus",id:"gLSCHWGsu1"},description:{defaultMessage:"Anthropic's previous generation model",id:"hAevdn8yGl"}}),[nt.CLAUDE_3_5_HAIKU]:He({name:{defaultMessage:"Claude 3.5 Haiku",id:"zEJWYa05R2"},description:{defaultMessage:"Anthropic's smaller model",id:"pQia6E7J8i"}}),[nt.GEMINI]:He({name:{defaultMessage:"Gemini",id:"XoqZkcqFZ/"},description:{defaultMessage:"Previous version of Google's Gemini model",id:"9C0LtRWLFh"}}),[nt.LLAMA_X_LARGE]:He({name:{defaultMessage:"Llama X Large",id:"2zxgnSWUyX"},description:{defaultMessage:"Meta's large Llama model",id:"+95UnVOxgQ"}}),[nt.MISTRAL]:He({name:{defaultMessage:"Mistral",id:"dUBSpMbbs4"},description:{defaultMessage:"Mistral AI model",id:"rYRyt8I2Zr"}}),[nt.COPILOT]:He({name:{defaultMessage:"Copilot",id:"b3QbnXgawD"},description:{defaultMessage:"Legacy Pro Search",id:"pg83InaW1o"}}),[nt.CLAUDE_OMBRE_EAP]:He({name:{defaultMessage:"Claude Ombre",id:"F12IlTx8R1"},description:{defaultMessage:"Anthropic's research preview",id:"LKt7UBXwdw"}}),[nt.CLAUDE_LACE_EAP]:He({name:{defaultMessage:"Claude Lace",id:"8ydOdGYWef"},description:{defaultMessage:"Anthropic's opus research preview",id:"GHW8xWfe9i"}}),[nt.R1]:He({name:{defaultMessage:"R1 1776",id:"e8N3MYqmIQ"},description:{defaultMessage:"Perplexity's unbiased reasoning model",id:"R5Tg1hC1um"}}),[nt.GAMMA]:He({name:{defaultMessage:"Gamma",id:"Wb9IyuuCJO"},description:{defaultMessage:"Fast model for routine research",id:"prWIV9FsWt"}}),[nt.O3]:He({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.GEMINI_2_FLASH]:He({name:{defaultMessage:"Gemini 2.5 Pro",id:"hec4NYL1Ib"},description:{defaultMessage:"Google's latest model",id:"XBL8FigIeX"}}),[nt.TESTING_MODEL_C]:He({name:{defaultMessage:"Testing Model C",id:"sgSu9ApFvP"},description:{defaultMessage:"Debug model for testing",id:"AG6p6ERvyn"}}),[nt.O3_RESEARCH]:He({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.O3_PRO_RESEARCH]:He({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's most powerful reasoning model",id:"1ntkiZj5rM"}}),[nt.CLAUDE40SONNET_RESEARCH]:He({name:{defaultMessage:"Claude Sonnet 4.0",id:"4UrgPEhdwq"},description:{defaultMessage:"Anthropic's advanced model",id:"b5CqfvLw4b"}}),[nt.CLAUDE40SONNETTHINKING_RESEARCH]:He({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[nt.CLAUDE40OPUS_RESEARCH]:He({name:{defaultMessage:"Claude Opus 4.0",id:"fwViXd5wrs"},description:{defaultMessage:"Anthropic's most advanced model",id:"4l6C+Dcw8g"}}),[nt.CLAUDE40OPUSTHINKING_RESEARCH]:He({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's advanced reasoning model",id:"RwUx0WhdZb"}}),[nt.O3_LABS]:He({name:{defaultMessage:"o3",id:"BBaBURoUEg"},description:{defaultMessage:"OpenAI's reasoning model",id:"V9t5CKw8kf"}}),[nt.O3_PRO_LABS]:He({name:{defaultMessage:"o3-pro",id:"lyV2e5kFYG"},description:{defaultMessage:"OpenAI's most powerful reasoning model",id:"1ntkiZj5rM"}}),[nt.CLAUDE40SONNETTHINKING_LABS]:He({name:{defaultMessage:"Claude Sonnet 4.0 Thinking",id:"a3LiLxX42G"},description:{defaultMessage:"Anthropic's reasoning model",id:"vRfGVNHXG3"}}),[nt.CLAUDE40OPUSTHINKING_LABS]:He({name:{defaultMessage:"Claude Opus 4.0 Thinking",id:"hwrQNTIYLG"},description:{defaultMessage:"Anthropic's advanced reasoning model",id:"RwUx0WhdZb"}})},mbe={label:$n[ie.GEMINI_3_0_FLASH].name,description:$n[ie.GEMINI_3_0_FLASH].description,nonReasoningModel:ie.GEMINI_3_0_FLASH,reasoningModel:ie.GEMINI_3_0_FLASH_HIGH,hasNewTag:!0,subscriptionTier:Jn.PRO},$R=[{label:$n[ie.SONAR].name,description:$n[ie.SONAR].description,nonReasoningModel:ie.SONAR,reasoningModel:null,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.GPT_5_2].name,description:$n[ie.GPT_5_2].description,nonReasoningModel:ie.GPT_5_2,reasoningModel:ie.GPT_5_2_THINKING,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.CLAUDE_4_5_OPUS].name,description:$n[ie.CLAUDE_4_5_OPUS].description,nonReasoningModel:ie.CLAUDE_4_5_OPUS,reasoningModel:ie.CLAUDE_4_5_OPUS_THINKING,hasNewTag:!1,subscriptionTier:Jn.MAX},{label:$n[ie.GEMINI_3_0_PRO].name,description:$n[ie.GEMINI_3_0_PRO].description,nonReasoningModel:null,reasoningModel:ie.GEMINI_3_0_PRO,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.GROK_4_1_NON_REASONING].name,description:$n[ie.GROK_4_1_NON_REASONING].description,nonReasoningModel:ie.GROK_4_1_NON_REASONING,reasoningModel:ie.GROK_4_1_REASONING,hasNewTag:!1,subscriptionTier:Jn.PRO},{label:$n[ie.KIMI_K2_THINKING].name,description:$n[ie.KIMI_K2_THINKING].description,nonReasoningModel:null,reasoningModel:ie.KIMI_K2_THINKING,hasNewTag:!1,subscriptionTier:Jn.PRO,textOnlyModel:!0,subheading:W({defaultMessage:"Hosted in the US",id:"5F33MSbZ40"})},{label:$n[ie.CLAUDE_4_5_SONNET].name,description:$n[ie.CLAUDE_4_5_SONNET].description,nonReasoningModel:ie.CLAUDE_4_5_SONNET,reasoningModel:ie.CLAUDE_4_5_SONNET_THINKING,hasNewTag:!1,subscriptionTier:Jn.PRO}],pbe=e=>e.reduce((t,n)=>(n.nonReasoningModel&&(t[n.nonReasoningModel]=n),n.reasoningModel&&(t[n.reasoningModel]=n),t),{}),I4=()=>{const{variation:e}=fbe(!1),t=d.useMemo(()=>e?$R.reduce((s,o)=>(s.push(o),o.label===$n[ie.GEMINI_3_0_PRO].name&&s.push(mbe),s),[]):$R,[e]),n=d.useMemo(()=>pbe(t),[t]),r=d.useCallback(s=>n[s],[n]);return d.useMemo(()=>({models:t,getModelConfig:r}),[t,r])},hbe=(e,t,n)=>{const{value:r,loading:s}=n4({flag:"remove-reasoning-model-selection",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},gbe=()=>{const{variation:e,loading:t}=hbe(0);return d.useMemo(()=>({hours:e,loading:t,enabled:e>0}),[e,t])};function ybe(e){try{const t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}}function xbe({getPreferredSearchModelUpdatedAt:e,setPreferredSearchModelUpdatedAt:t}){const{hours:n,loading:r,enabled:s}=gbe();return d.useMemo(()=>{const o=e();if(r||!s)return{shouldAutoDisableReasoning:!1};if(!o)return{shouldAutoDisableReasoning:!1};const a=ybe(o);return a?{shouldAutoDisableReasoning:(new Date().getTime()-a.getTime())/(1e3*60*60)>=n}:(t(new Date().toISOString()),{shouldAutoDisableReasoning:!1})},[n,r,s,e,t])}const vbe=(e=!1,t,n)=>{const{value:r,loading:s}=zt({flag:"search-model-menu-rewrite",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},bbe="search-model-menu-redesign-enabled",_be=()=>{const[e,t]=Qi(bbe,!1),{variation:n,loading:r}=vbe(!1);return d.useEffect(()=>{r||t(n)},[n,r,t]),{isSearchModelMenuRewriteEnabled:e}},_z="v1",wbe={config_schema:_z,models:[ie.SONAR],config:[{label:"Sonar",description:"Perplexity's fast model",non_reasoning_model:ie.SONAR,reasoning_model:null,has_new_tag:!1,subscription_tier:Jn.PRO,text_only_model:!1}]},wz=e=>{const t=e.config.reduce((i,c)=>(c.non_reasoning_model&&i.set(c.non_reasoning_model,c),c.reasoning_model&&i.set(c.reasoning_model,c),i),new Map),n=i=>t.get(i);function r(i,c){return n(i)?.label??c}function s(i,c){return n(i)?.description??c}function o(i,c){return n(i)?.subheading??c}function a(i){return typeof i=="string"&&t.has(i)}return{...e,getModelConfig:n,getModelLabel:r,getModelDescription:s,getModelSubheading:o,isSearchModel:a}},Cbe=()=>be.makeQueryKey("search-models-config"),Sbe=async({reason:e})=>{const{error:t,data:n,response:r}=await de.GET("/rest/models/config",e,{params:{query:{config_schema:_z}},timeoutMs:Qe(),numRetries:$l});if(t)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch models",cause:t,status:r.status??0});const s=wz(n);return{...n,...s}},Ebe=wz(wbe),kbe=({reason:e,enabled:t=!0})=>{const n=mt({queryFn:()=>Sbe({reason:e}),queryKey:Cbe(),placeholderData:Ebe,enabled:t}),r=n.data;return d.useMemo(()=>({query:n,...r}),[n,r])},Mbe=()=>{const e="use-is-search-model",{isSearchModelMenuRewriteEnabled:t}=_be(),{isSearchModel:n}=kbe({reason:e,enabled:t});return d.useCallback(r=>t?n(r):jH(r),[n,t])},Cz="pplx.local-user-settings.";function Wd(e,t){return Qi(`${Cz}${e}`,t)}const Tbe=1;function Hx(){const e=Mbe(),[t,n]=Wd("preferredSearchModelUpdatedAt",void 0),[r,s,o]=Wd(`preferredSearchModels-v${Tbe}`,EU),[a,i]=d.useState(r),c=d.useCallback(m=>{s(m),i(m)},[s]),u=d.useRef(!0),f=d.useCallback((m,p)=>{c(h=>{const g={...h};return p?g[m]=p:m&&delete g[m],g})},[c]);return d.useEffect(()=>{if(u.current){u.current=!1;return}n(new Date().toISOString())},[a.search,n]),d.useEffect(()=>{function m(){if(document.visibilityState!=="visible")return;const p=o();i(h=>{let g=!1;const y={...h};for(const[x,v]of Object.entries(p)){const b=x,_=h[b];e(v)&&v!==_&&(y[b]=v,g=!0)}return g?y:h})}return document.addEventListener("visibilitychange",m),()=>{document.removeEventListener("visibilitychange",m)}},[e,i,o]),d.useMemo(()=>({preferredSearchModels:a,preferredSearchModelUpdatedAt:t,setPreferredSearchModel:f,setPreferredSearchModelUpdatedAt:n}),[a,t,f,n])}const Abe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"use-rate-limit-status-endpoint",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Nbe=async({reason:e})=>{const{error:t,data:n}=await de.GET("/rest/rate-limit/all",e);if(t||!n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get rate limits",cause:t,status:0});return n},Rbe=async({reason:e})=>{const{error:t,data:n}=await de.GET("/rest/rate-limit/status",e);if(t||!n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get rate limit statuses",cause:t,status:0});return n},Dbe={remaining_pro:0,remaining_research:0,remaining_labs:0,sources:{source_to_limit:{}},model_specific_limits:{}},jbe={modes:{pro_search:{available:!1,remaining_detail:{kind:"exact",remaining:0}},research:{available:!1,remaining_detail:{kind:"exact",remaining:0}},labs:{available:!1,remaining_detail:{kind:"exact",remaining:0}}},sources:{}},Ibe=({enabled:e,reason:t,refetchOnMount:n="always"})=>{const r=Wt(),s=Yt(),{session:o}=Ne(),a=o?.user?.email?{userEmail:o.user.email}:void 0,{variation:i,loading:c}=Abe(!1,a),u=mt({enabled:r&&e&&!c,queryKey:Zy(),queryFn:async()=>i?{status:await Rbe({reason:t})}:{legacy:await Nbe({reason:t})},refetchOnMount:n}),f=d.useCallback(()=>{s.invalidateQueries({queryKey:Zy()})},[s]);return d.useMemo(()=>({...u,legacyLimits:u.data?.legacy??(i?void 0:Dbe),statusLimits:u.data?.status??(i?jbe:void 0),hasLoadedRateLimits:u.isSuccess&&!u.isFetching&&!!u.data,refresh:f}),[u,i,f])},qR={hasLoadedSettings:!1,pagesLimit:0,uploadLimit:void 0,articleImageUploadLimit:0,defaultImageGenerationModel:"default",defaultVideoGenerationModel:"default",maxFilesPerUser:0,maxFilesPerRepository:0,queryCount:0,queryCountCopilot:0,queryCountMobile:0,hasAiProfile:!1,referralCode:"",referralNumSuccess:0,referralNumCoupons:0,disableTraining:!1,isSidebarCollapsed:!1,isSidebarPinned:!1,sidebarHiddenHubs:[],subscriptionTier:void 0,stripeStatus:"none",revenuecatStatus:"none",revenuecatSource:"none",createLimit:0,notifStatus:"",emailStatus:"",hasDataRetentionWarning:!1,allowArticleCreation:!1,isVerified:!1,connectors:{connectors:[]},connectorLimits:{global_file_count:void 0,repo_type_limits:void 0,max_file_size_mb:void 0,max_attachment_file_size_mb:void 0},alwaysAllowBrowserAgent:!1,hasAcceptedApiTerms:!1,sources:{source_to_limit:{}}},Pbe=()=>{const e=mr("isCollapsed"),{device:{isWindowsApp:t}}=sn();return e===null?t:e==="true"},Ea=({enabled:e,reason:t,refetchOnMount:n,skipConnectorPickerCredentials:r=!0})=>{const{locale:s}=J(),o=Wt(),a=Pbe(),i=s?{"accept-language":s}:{},c=()=>XH({headers:i,reason:t,skipConnectorPickerCredentials:r}),{data:u,refetch:f,isLoading:m,isStale:p}=mt({enabled:o?typeof e>"u"?!0:e:!1,queryKey:iu({skipConnectorPickerCredentials:r}),queryFn:c,refetchOnMount:n,placeholderData:qR});d.useEffect(()=>{u&&Cfe({queryCount:u.queryCount,queryCountCopilot:u.queryCountCopilot,queryCountMobile:u.queryCountMobile})},[u]);const h=d.useMemo(()=>({...u??qR,isSidebarCollapsed:a}),[u,a]);return d.useMemo(()=>({...h,refetch:f,isLoading:m,isStale:p}),[h,f,m,p])},Obe=["presentpicker"],Sz=e=>e?Obe.includes(e):!1;function Lbe(e){const t=fn(),n=Wt(),{hasAccessToProFeatures:r}=$t(),{session:s}=Ne(),{trackEvent:o}=Xe(s),{preferredSearchModels:a,preferredSearchModelUpdatedAt:i,setPreferredSearchModel:c,setPreferredSearchModelUpdatedAt:u}=Hx(),{getModelConfig:f}=I4(),m=t?.get("copilot"),p=t?.get("pro"),h=t?.get("utm_source"),g=m==="false"||p==="false",y=!g&&(m==="true"||p==="true"||Sz(h??void 0)),x=a[oe.SEARCH];d.useEffect(()=>{x&&(an(x)!==oe.SEARCH?(Hc.warn(`Resetting preferred search model from ${x} to ${ie.PRO}`),a[oe.SEARCH]=ie.PRO,c(oe.SEARCH,ie.PRO)):x===ie.DEFAULT&&r&&c(oe.SEARCH,void 0))},[r,x,a,c]);const v=d.useCallback(()=>i,[i]),{shouldAutoDisableReasoning:b}=xbe({getPreferredSearchModelUpdatedAt:v,setPreferredSearchModelUpdatedAt:u});d.useEffect(()=>{if(!b||!x)return;const C=f(x);C&&C.nonReasoningModel&&C.reasoningModel===x&&c(oe.SEARCH,C.nonReasoningModel)},[b,c,f,x]);const _=t?.get("model_id")==="pplx_alpha"?null:t?.get("model_id");let w;_&&(_==="deep_research"?w=ie.ALPHA:Object.values(ie).includes(_)&&(w=_));let S;return g?S=ie.DEFAULT:w?S=w:y&&(S=ie.PRO),S&&w&&w==S&&o("search mode utm",{mode:an(S)}),d.useMemo(()=>{let C=ie.DEFAULT;return n?S||(C=a[oe.SEARCH]??(r?ie.PRO:ie.DEFAULT),C):C},[n,S,a,r])}function Nu(e){return{available:e>0,exactCount:e}}function D_(e){return{available:e.available,exactCount:e.remaining_detail.kind==="exact"?e.remaining_detail.remaining:void 0}}const Ez={isCopilot:!1,sources:["web"],gpt4Limit:{available:!1,exactCount:0},pplxAlphaLimit:{available:!1,exactCount:0},pplxBetaLimit:{available:!1,exactCount:0},modelSpecificLimits:{},uploadRateLimit:void 0,createLimit:0,recency:null,askInputReasoningMode:!1,askInputReasoningModelPreference:null,setAskInputReasoningMode:()=>{},setAskInputReasoningModelPreference:()=>{},setConfiguredModel(){},setSources:()=>{},setIsCopilot:()=>{},decrementCreateLimit:()=>{},setModelSpecificLimits:()=>{},setRecency:()=>{},setUploadRateLimit:()=>{},configuredModel:ie.DEFAULT,configuredSearchMode:oe.SEARCH,setConfiguredSearchMode(){}},kz=Ft("ThreadConfigContext",Ez),Fbe=({children:e,shouldFetchSettings:t})=>{const r=Ea({enabled:t,reason:"thread-settings-provider"}),{isMax:s}=$t(),{statusLimits:o,legacyLimits:a,hasLoadedRateLimits:i}=Ibe({enabled:t,reason:"thread_settings_provider_mount"}),c=Lbe(),u=d.useMemo(()=>o?{proLimit:D_(o.modes.pro_search),researchLimit:D_(o.modes.research),labsLimit:D_(o.modes.labs),modelSpecificLimits:{}}:a?{proLimit:Nu(a.remaining_pro??0),researchLimit:Nu(a.remaining_research??0),labsLimit:Nu(a.remaining_labs??0),modelSpecificLimits:a.model_specific_limits??{}}:null,[o,a]),[f,m]=d.useState({...Ez,gpt4Limit:Nu(u?.proLimit.exactCount??0),pplxAlphaLimit:Nu(u?.researchLimit.exactCount??0),pplxBetaLimit:Nu(u?.labsLimit.exactCount??0),modelSpecificLimits:u?.modelSpecificLimits??{},configuredModel:c,configuredSearchMode:an(c)});d.useEffect(()=>{m(C=>C.configuredModel===c?C:{...C,configuredModel:c,configuredSearchMode:an(c,C.configuredSearchMode)})},[c]);const p=d.useCallback(C=>m(E=>({...E,configuredModel:C,configuredSearchMode:an(C,E.configuredSearchMode)})),[]),h=d.useCallback(()=>{p(ie.DEFAULT)},[p]),g=d.useCallback(C=>{m(E=>({...E,sources:C}))},[]),y=d.useCallback(C=>{m(E=>({...E,recency:C}))},[]),x=d.useCallback(C=>{m(E=>({...E,askInputReasoningModelPreference:C,askInputReasoningMode:!!C}))},[]),v=d.useCallback(C=>{m(E=>({...E,askInputReasoningMode:C}))},[]);d.useEffect(()=>{r.createLimit!==null&&m(C=>({...C,createLimit:r.createLimit}))},[r.createLimit]),d.useEffect(()=>{r.uploadLimit!==null&&r.uploadLimit!==void 0&&m(C=>({...C,uploadRateLimit:r.uploadLimit}))},[r.uploadLimit]),d.useEffect(()=>{u&&m(C=>({...C,gpt4Limit:u.proLimit,pplxAlphaLimit:u.researchLimit,pplxBetaLimit:u.labsLimit,modelSpecificLimits:u.modelSpecificLimits}))},[u,f.gpt4Limit.available,f.pplxAlphaLimit.available,f.pplxBetaLimit.available]),d.useEffect(()=>{if(!i||!u)return;const C=u.proLimit.available,E=u.researchLimit.available,T=u.labsLimit.available,k=f.configuredModel;(k!==ie.DEFAULT&&!C||an(k)===oe.RESEARCH&&!E&&!s||an(k)===oe.STUDIO&&!T&&!s)&&h(),(f.askInputReasoningMode||f.askInputReasoningModelPreference)&&!C&&h()},[u,h,i,f.askInputReasoningMode,f.askInputReasoningModelPreference,f.configuredModel,s]);const b=d.useCallback(()=>{const C=Math.max(f.createLimit-1,0);m(E=>({...E,createLimit:C}))},[f.createLimit]),_=d.useCallback((C=1)=>{if(f.uploadRateLimit==null)return;const E=Math.max(f.uploadRateLimit-C,0);m(T=>({...T,uploadRateLimit:E}))},[f.uploadRateLimit]),S={...f,setConfiguredModel:p,setSources:g,decrementCreateLimit:b,setUploadRateLimit:_,setModelSpecificLimits:C=>{m(E=>({...E,modelSpecificLimits:C}))},setRecency:y,askInputReasoningMode:f.askInputReasoningMode,isCopilot:f.configuredModel!==ie.DEFAULT,setAskInputReasoningMode:v,setAskInputReasoningModelPreference:x,configuredSearchMode:f.configuredSearchMode,setConfiguredSearchMode:C=>{m(E=>({...E,configuredSearchMode:C}))}};return l.jsx(kz.Provider,{value:S,children:e})},Vn=()=>{const e=d.useContext(kz);if(!e)throw new Error("useThreadConfig must be used within ThreadSettingsContext");return e};function Vo(){const{configuredModel:e,configuredSearchMode:t}=Vn();return d.useMemo(()=>t||(e===ie.DEFAULT?oe.SEARCH:an(e)),[t,e])}const Mz=e=>[...e].sort((t,n)=>t.backend_uuid.localeCompare(n.backend_uuid,void 0,{sensitivity:"base"})),P4=e=>{if(!e.length)return[];const t=new Map;return e.forEach(n=>{if(n.side_by_side_metadata?.sibling_uuid&&n.side_by_side_metadata?.selection_status===aa.UNSELECTED)return;const r=n.side_by_side_metadata?.sibling_uuid??n.backend_uuid;t.has(r)||t.set(r,[]),t.get(r).push(n)}),[...t.values()].map(n=>{const r=Mz(n);return r[0]?.side_by_side_metadata?.selection_status===aa.TIE?[r[0]]:r})};function Bbe(){const{session:e}=Ne(),{trackEvent:t}=Xe(e),{locale:n}=J(),[r,s]=d.useState(p_.includes(n)?n:Ume),o=O2e();return o?p_.includes(o)?r!==o&&s(o):L2e():r!==n&&p_.includes(n)&&s(n),d.useMemo(()=>({locale:r,hasChosenLocale:!!o,saveLocale(a){s(a),P2e(a),t("set locale cookie",{locale:a})}}),[r,o,t])}const Ube="side-by-side-experiments";function Vbe(e,t={}){const{value:n,loading:r,error:s}=hge({flag:Ube,defaultValue:{side_by_side_config:{}},subjectType:"context_uuid",extraAttributes:t},e);return d.useMemo(()=>({sideBySideOverrides:n,loading:r,error:s}),[n,r,s])}const ua=()=>crypto.randomUUID();ua();const cvt=(e,t)=>{const n=new URL(e);return n.searchParams.delete("source"),n.searchParams.delete("s"),t&&(n.hash=t),n.searchParams.sort(),n.href};function Tz(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Hbe(e,t){try{const n=new Date(e.replace(/-/g,"/")).toLocaleString(t,{weekday:"long",hour:"numeric",minute:"numeric",hour12:!0});return Tz(n)}catch(n){console.log(n)}return null}function zbe(e,t,n="short"){const s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].indexOf(e.toLowerCase());if(s===-1)return"";const o=new Date,a=new Date(o.setDate(o.getDate()-o.getDay()+s)),i=Intl.DateTimeFormat(t,{weekday:n}).format(a);return Tz(i)}function Wbe(e){return e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:12})}function uvt(e,t,n){const r=typeof e=="string"?new URL(e):e,s=r.searchParams;return s.set(t,n),r.search=s.toString(),r.toString()}const Gbe=e=>{let t;if(typeof e=="string"){if(t=parseFloat(e),isNaN(t))throw new Error("Invalid input: not a number")}else if(typeof e=="number")t=e;else throw new Error("Invalid input: not a string or number");return t.toLocaleString("en-US")},$be=/\[(\d{1,3})(,\s*\{ts:\d+\})?\]/g,qbe=/(\n*^(("""+|'''+|```+)[A-Za-z0-9]*|#+ .*)$|^- |\*\*|\$\$|\||`|[-|]{3,})/gm;function Kbe(e){return e.replace($be,"")}function Ybe(e){return e.replace(qbe,"")}function ny(e,t){const n=Kbe(Ybe(e)).trim();if(n.length<=t)return n;{const r=n.slice(0,t).trim(),s=r.lastIndexOf(" ");return s*2>t&&se?.startsWith(y3)??!1,Xbe=[],Zbe={isEnabled:!1,sbsVariations:Xbe,isLoading:!1,error:null,incrementTriggerCount:()=>{},triggerCount:0},Jbe="sbsMaxTriggerCntPerThread";function e_e(e,t,n,r,s,o,a,i,c,u){const{isPro:f,isMax:m,hasAccessToProFeatures:p}=e,{isEnterprise:h=!1}=t,g=f||m||h||p,y=f||m||p,x=s?.localeObj?.language||n?.language||null,v=r?.toLowerCase()||null,b=h?"ENTERPRISE":"INDIVIDUAL",_=typeof window<"u"&&window.navigator.userAgent.includes("Mobile");return{isPriority:g,isSubscribed:y,language:x,country:i,searchFocus:v,userCategory:b,isFollowUp:!!u,isMobile:_,appApiClient:"web",configuredModel:c,[Jbe]:o,turnCount:a}}const t_e=e=>{try{if(!e||!e.side_by_side_config)return!1;const t=e.side_by_side_config;if(!t||typeof t!="object")return!1;const n=!!(t.experiment_flag&&typeof t.experiment_flag=="string"&&t.experiment_flag.length>0),r=!!(t.variations&&Array.isArray(t.variations)&&t.variations.length>0);return n||r}catch{return!1}},n_e=e=>{if(!e||!e.side_by_side_config)return[];const t=e.side_by_side_config;if(!t.experiment_flag||!t.variations||!Array.isArray(t.variations))return[];if(t.variations.length===0)return[];const n=[],r=ua(),s=t.experiment_flag;let o=!1;return t.variations.forEach(a=>{if(!a||!a.identifier)return;const i=a.is_control===!0;i&&(o=!0);const c=i?`${y3}${s}:${a.identifier}`:`${s}:${a.identifier}`,u={[s]:a.attributes_override??{}};n.push({sibling_uuid:r,experiment_role:c,experiment_override:u})}),!o&&Hi(n)&&(n[0].experiment_role=`${y3}${s}:${t.variations[0]?.identifier}`),n},KR=e=>{try{const t=_a.getItem(`${Az}_${e}`);return t?parseInt(t,10):0}catch{return 0}},r_e=(e,t)=>{try{_a.setItem(`${Az}_${e}`,t.toString())}catch{}};function s_e({frontendContextUUID:e,disableSideBySide:t=!1}){const n=Vo(),{sources:r,configuredModel:s}=Vn();b2e(r||[]);const{results:o}=on(),a=d.useMemo(()=>!o||o.length===0?1:P4(o).length+1,[o]),i=$t(),c=mo({reason:"sbs-experiment-attributes"}),u=zve({reason:"sbs-experiment-attributes"}),f=Bbe(),m=Ox(),{session:p}=Ne(),h=An()||!0;p?.user?.email?.endsWith("@perplexity.ai"),t=t||n===oe.STUDIO||n===oe.RESEARCH||h;const[g,y]=d.useState(()=>e?KR(e):0),x=e?e_e(i,c,u,n,f,g,a,m??null,s,e):{},{sideBySideOverrides:v,loading:b,error:_}=Vbe(e||"",x),w=_?String(_):null,S=t_e(v);d.useEffect(()=>{if(e){const E=KR(e);y(Math.max(0,E))}else y(0)},[e]),d.useEffect(()=>{S&&e&&g>0&&r_e(e,g)},[e,g,S]);const C=d.useCallback(()=>{S&&y(E=>Math.max(0,E+1))},[S]);return d.useMemo(()=>{if(t||!S||w)return Zbe;const E=n_e(v);return{isEnabled:S,sbsVariations:E,isLoading:b,error:w,incrementTriggerCount:C,triggerCount:g}},[t,w,C,S,b,v,g])}const o_e=async(e,t,n,r)=>{const s=(o,a)=>{r(i=>i.filter(c=>t.some(u=>u.backend_uuid===c.backend_uuid)?c.backend_uuid===o.backend_uuid:!0).map(c=>c.backend_uuid===o.backend_uuid?{...c,side_by_side_metadata:c.side_by_side_metadata?{...c.side_by_side_metadata,selection_status:a}:void 0}:c))};try{const o=t.map((c,u)=>{let f;return e===Jy?f=aa.TIE:f=u===e?aa.SELECTED:aa.UNSELECTED,Age({entryUUID:c.backend_uuid,params:f,siblingUUID:n,reason:"user-sbs-selection"}).catch(m=>{throw Z.error(`Failed to update selection for entry ${c.backend_uuid}:`,m),m})});await Promise.all(o);let a,i;if(e===Jy?(a=Mz(t)[0],i=aa.TIE):(a=t[e],i=aa.SELECTED),!a)throw new Error("No target result found");s(a,i)}catch(o){throw Z.error("Failed to update entry selection:",o),o}},a_e=Object.freeze({}),Af=({reason:e,enabled:t=!0,skipConnectorPickerCredentials:n=!0})=>{const{connectors:r}=Ea({reason:e,enabled:t,skipConnectorPickerCredentials:n}),s=d.useMemo(()=>r?.connectors?.length?r.connectors.reduce((o,a)=>(o[a.name]=a,o),{}):a_e,[r]);return d.useMemo(()=>({connectorsMap:s}),[s])},Nz=({reason:e,enabled:t=!0})=>{const{connectors:n,isLoading:r,isStale:s,refetch:o}=Ea({reason:e,enabled:t}),{connectorsMap:a}=Af({reason:e,enabled:t}),i=d.useMemo(()=>(n?.connectors??[]).filter(f=>W7.includes(f.name)&&a[f.name]&&a[f.name].connected),[a,n]),c=d.useMemo(()=>(n?.connectors??[]).filter(f=>!W7.includes(f.name)&&a[f.name]&&a[f.name].connected),[a,n]),u=d.useMemo(()=>(n?.connectors??[]).filter(f=>a[f.name]&&a[f.name].connected),[a,n]);return d.useMemo(()=>({enabledFileConnectors:i,enabledNonFileConnectors:c,enabledConnectors:u,isConnectorsLoading:r,isConnectorsStale:s,refetchConnectors:o}),[u,i,c,r,s,o])},Rz=({reason:e})=>{const{connectors:t}=Ea({reason:e}),{connectorsMap:n}=Af({reason:e}),r=d.useMemo(()=>(t?.connectors??[]).filter(o=>(o.name==="google_drive"||o.name==="onedrive"||o.name==="sharepoint"||o.name==="dropbox"||o.name==="box")&&!n[o.name]?.connected),[n,t]),s=d.useMemo(()=>(t?.connectors??[]).filter(o=>!n[o.name]?.connected),[n,t]);return d.useMemo(()=>({disabledFileConnectors:r,disabledConnectors:s}),[s,r])},i_e=({reason:e})=>{const t=Nz({reason:e}),n=Rz({reason:e});return d.useMemo(()=>{const r=h7([...t.enabledConnectors,...t.enabledFileConnectors,...t.enabledNonFileConnectors].map(o=>o.name)),s=h7([...n.disabledConnectors,...n.disabledFileConnectors].map(o=>o.name));return{enabled:r,disabled:s}},[t,n])},dvt=async({headers:e={},params:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/collections/list_user_collections",n,{params:{query:{limit:t.limit,offset:t.offset,version:ql}},timeoutMs:Qe(),headers:e});if(s||!r)throw new he("API_CLIENTS_ERROR",{message:"Failed to list user collections",cause:s,status:o.status??0});return r},l_e=async({headers:e={},params:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/collections/get_collection",n,{params:{query:t},headers:e,timeoutMs:Qe()});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get collection",cause:s,status:o.status??0});if(!r?.status||r?.status==="failed")throw new he("API_CLIENTS_ERROR",{message:"Failed to get collection",cause:r,status:o.status??0});return r}catch(r){Z.error(r);return}},c_e=async({headers:e={},params:t,reason:n})=>{try{const{error:r,response:s}=await de.PUT("/rest/collections/{collection_uuid}/access",n,{params:{path:{collection_uuid:t.collection_uuid}},headers:e,body:{updated_access:t.updated_access},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to update collection access",cause:r,status:s.status??0})}catch(r){Z.error(r)}},I0=async({params:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/collections/upsert_thread_collection",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to upsert thread collection",cause:r,status:s.status??0});return n}catch{return}},YR=async({collectionUUID:e,entryUUID:t,reason:n})=>{try{const{error:r,response:s}=await de.DELETE("/rest/collections/remove_collection_thread",n,{params:{query:{collection_uuid:e,entry_uuid:t}}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to remove thread from collection",cause:r,status:s.status??0})}catch{return}},O4=({collectionSlug:e,reason:t,enabled:n=!!e})=>{const r=async()=>e?await l_e({params:{collection_slug:e,version:ql},reason:t})??null:null,{data:s,isLoading:o}=mt({enabled:n,queryKey:na(e??""),queryFn:r,placeholderData:Wl});return d.useMemo(()=>({collection:s??void 0,isLoading:o}),[s,o])},zx=({reason:e,collectionSlugOverride:t,collectionUuidOverride:n})=>{const r=On(),s=ou(),{firstResult:o}=on(),a=o?.collection_info?.uuid,i=r?.includes("/search/")&&!!a,c=t??(Array.isArray(s?.slug)?s.slug[0]:s?.slug),{collection:u}=O4({collectionSlug:c,reason:e,enabled:!n}),f=d.useMemo(()=>{let m,p;return i?(m="COLLECTION",p=a??""):r?.includes("/collections")||r?.includes("/spaces")||r?.includes("/study-hub")?(m="COLLECTION",p=n||u?.uuid||""):(m="ORG",p=""),{file_repository_type:m,owner_id:p}},[i,r,a,n,u?.uuid]);return d.useMemo(()=>({fileRepoInfo:f}),[f])},L4=10,fvt=20,mvt=L4*41+46,x3=async({request:e,reason:t})=>{const{fileRepositoryInfo:n,limit:r,offset:s,searchTerm:o,fileStates:a,email:i}=e;try{let c;a.includes("COMPLETE")?c={file_repository_info:n,limit:r,offset:s??0,search_term:o,file_states_in_filter:a}:c={file_repository_info:n,limit:r,offset:s??0,search_term:o,file_states_in_filter:a,email_in_filter:[i]};const{data:u,error:f,response:m}=await de.POST("/rest/file-repository/list-files",t,{headers:{"content-type":"application/json"},body:c,timeoutMs:Qe(),numRetries:1});if(f)throw new he("API_CLIENTS_ERROR",{cause:f,status:m.status??0});return{files:u?.files??[],numTotalFiles:u?.num_total_files??0}}catch(c){return Z.error(c),null}},u_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/get-file-upload-urls",t,{body:e,timeoutMs:5e3,numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get fileUploadUrl",cause:r,status:s.status??0});return n},pvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/list",t,{body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get connector files",cause:r,status:s.status??0});return n},hvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/delete",t,{body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete connector files",cause:r,status:s.status??0});return n},gvt=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/files/resync",t,{body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to resync connector files",cause:r,status:s.status??0});return n},d_e=async({request:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/uploads",t,{headers:{"content-type":"application/json"},body:e,timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n??null}catch(n){return Z.error(n),null}};async function Dz({request:e,reason:t}){return new Promise((n,r)=>{de.SSE("/rest/sse/index_files",t,{params:e,headers:{"content-type":"application/json",accept:"text/event-stream"},handlers:{message:s=>{s.status==="success"?n():r(new Error("Indexing failed"))}}}).catch(r)})}const f_e=({fileRepoInfo:e,reason:t})=>{const{$t:n}=J(),r=Yt(),s=_4(e),{openToast:o}=hn(),{session:a}=Ne(),i=a?.user?.email??"",c=Rt({mutationFn:async u=>{if(!u.nextURL)throw new Error("File must have a url");const{data:f,error:m,response:p}=await de.POST("/rest/file-repository/move-attachment-to-persistent-file-path",t,{body:{file_repository_info:e,file_url:u.nextURL},timeoutMs:Cn.MEDIUM,retries:2});if(m||!f)throw new he("API_CLIENTS_ERROR",{message:"Failed to save file persistently",cause:m,status:p.status??0});return await Dz({request:{file_repository_info:e,file_index_params:[{file_s3_url:f.file_url_params.s3_object_url,file_size:u.file.size,filename:u.file.name,file_uuid:f.file_url_params.file_uuid,replace_existing:!1}]},reason:t}),f},onSuccess:(u,f)=>{const m={name:f.file.name,file_s3_url:u.file_url_params.s3_object_url,file_uuid:u.file_url_params.file_uuid,file_title:f.file.name,file_description:null,uploadedBy:i,date:new Date().toLocaleString(),state:"COMPLETE",size:f.file.size,isOptimistic:!0};r.setQueriesData({queryKey:s},h=>{if(!h)return h;const g=h.completedFiles||[];return{...h,completedFiles:[...g,m]}});const p=eh(e.owner_id,f.file.name);r.invalidateQueries({queryKey:p}),o({message:n({defaultMessage:"Saved file",id:"2HZW5WnkV3"}),variant:"success",timeout:3})},onError:(u,f)=>{o({message:n({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),Z.error("Error saving file with name",f.file.name,u)},onSettled:async()=>{await r.invalidateQueries({queryKey:s})}});return d.useMemo(()=>({saveFile:c.mutate,isLoading:c.isPending}),[c.isPending,c.mutate])},jz=({fileRepoInfo:e,fileName:t,reason:n,enabled:r=!0})=>{const{session:s}=Ne();return mt({queryKey:eh(e.owner_id,t),refetchOnMount:!0,queryFn:async()=>((await x3({request:{fileRepositoryInfo:e,limit:L4,offset:0,searchTerm:t,fileStates:["COMPLETE"],email:s?.user?.email??""},reason:n}))?.files.length??0)>0,enabled:r&&e.file_repository_type==="COLLECTION"&&!!e.owner_id&&t.length>0})},m_e=async({entryUUIDs:e,rwToken:t,reason:n})=>{const{error:r,response:s}=await de.DELETE("/rest/thread",n,{body:{entry_uuids:e,read_write_token:t??""}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete threads",cause:r,status:s.status??0})},p_e=async({entryUUID:e,rwToken:t,callback:n,reason:r})=>{n?.();const{error:s,response:o}=await de.DELETE("/rest/thread/delete_thread_by_entry_uuid",r,{body:{entry_uuid:e,read_write_token:t??""}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete thread",cause:s,status:o.status??0})},h_e=async({backendUUID:e,url:t,rwToken:n,reason:r})=>{if(!n)return;const{data:s,error:o,response:a}=await de.PUT("/rest/thread/entry/remove_widget",r,{timeoutMs:Qe(),body:{entry_uuid:e,read_write_token:n,url:t}});if(o)throw new he("API_CLIENTS_ERROR",{message:"Error removing widget from entry",cause:o,status:a.status??0});return s},g_e={box:"box",dropbox:"dropbox",factset:"factset",gcal:"gcal",google_drive:"google_drive",linear:"linear",onedrive:"onedrive",outlook:"outlook",sharepoint:"sharepoint",zoom:"zoom"},Iz=e=>Object.keys(g_e).includes(e),Pz=async({name:e,referrer:t,referrerId:n,redirectPath:r,redirectOrigin:s,unauthedRedirectPath:o,autoClose:a,reason:i})=>{try{const{data:c,error:u,response:f}=e!=="factset"?await de.GET(`/rest/connectors/${e}/connect`,i,{timeoutMs:Qe(),numRetries:1,reason:i,params:{query:{referrer:t,referrer_id:n,redirect_path:r,redirect_origin:s,unauthed_redirect_path:o,auto_close:a}}}):await de.GET("/rest/connectors/factset/connect",i,{timeoutMs:Qe(),numRetries:1,reason:i});if(u)throw new he("API_CLIENTS_ERROR",{message:"Failed to initiate OAuth flow",cause:u,status:f.status??0});return c.redirect_url??null}catch(c){return Z.error("Error fetching factset OAuth redirect URL:",c),null}},QR=async({connectorName:e,reason:t,autoDeleteEmailAssistant:n=!1,connectionUUID:r})=>{const s=`disconnectConnector:${e}`;try{const{data:o,error:a,response:i}=await de.GET("/rest/connectors/{connector_id}/disconnect",t,{timeoutMs:Qe({productionMs:500}),numRetries:1,reason:t,params:{path:{connector_id:e},query:{auto_delete_email_assistant:n,connection_uuid:r}}});if(a)throw new he("API_CLIENTS_ERROR",{message:"Failed to disconnect connector",cause:a,status:i.status??0});return o}catch(o){return Z.log(`Error in ${s}:`,o),null}},y_e=async({connectionUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/connections/{uuid}/update",t,{params:{path:{uuid:e}},body:{disconnect:!0}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to disconnect file connector",cause:r,status:s.status??0});return n},x_e=async({connectionUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/connections/{uuid}/delete",t,{params:{path:{uuid:e}}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to disconnect file connector and delete files",cause:r,status:s.status??0});return n},yvt=async({connectorName:e,fileIds:t,fileRepoInfo:n,folder_ids:r=Pe,reason:s})=>{const{error:o,data:a,response:i}=e==="sharepoint"?await de.POST(`/rest/connectors/${e}/files`,s,{body:{file_ids:t,file_repository_info:n,drive_ids:r}}):await de.POST(`/rest/connectors/${e}/files`,s,{body:{file_ids:t,file_repository_info:n,folder_ids:r}});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:i.status??0});return a},v_e=async({reason:e})=>{const{data:t,error:n,response:r}=await de.POST("/rest/connectors/box/picker",e);if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to refresh box picker credentials",cause:n,status:r.status??0});return t},b_e=async({connectionType:e,content:t,reason:n})=>{const{data:r,error:s,response:o}=await de.POST("/rest/connectors/picker/log",n,{body:{connection_type:e,content:t}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed log connector picker",cause:s,status:o.status??0});return r},__e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/delete-files",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete files",cause:r,status:s.status??0});return n};class F4 extends Error{constructor(){super("Downloads are disabled"),this.name="DownloadsDisabledError"}}class B4 extends Error{constructor(){super("PDF downloads are restricted"),this.name="PdfUntrustedOriginError"}}class U4 extends Error{constructor(){super("This file belongs to a different organization"),this.name="UserNotInFileOrgError"}}const Oz=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/download",t,{body:e,timeoutMs:2e3,numRetries:1});if(r){if(r.detail&&typeof r.detail=="object"&&"error_details"in r.detail){if(r.detail.error_details==="DOWNLOADS_DISABLED")throw new F4;if(r.detail.error_details==="PDF_UNTRUSTED_ORIGIN")throw new B4;if(r.detail.error_details==="USER_NOT_IN_FILE_ORG")throw new U4}throw new he("API_CLIENTS_ERROR",{message:"Failed to download file",cause:r,status:s.status??0})}return n},w_e=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/file-repository/download-attachment",t,{body:e,timeoutMs:2e3,numRetries:1});if(r){if(r.detail&&typeof r.detail=="object"&&"error_details"in r.detail){if(r.detail.error_details==="DOWNLOADS_DISABLED")throw new F4;if(r.detail.error_details==="PDF_UNTRUSTED_ORIGIN")throw new B4;if(r.detail.error_details==="USER_NOT_IN_FILE_ORG")throw new U4}throw new he("API_CLIENTS_ERROR",{message:"Failed to download attachment",cause:r,status:s.status??0})}return n},Lz=e=>{const{accessLevel:t,enableWebByDefault:n,...r}=e;return{...r,access:t,enable_web_by_default:n}},C_e=async({collectionUuid:e,changes:t,reason:n})=>{const r=Lz(t),{data:s,error:o,response:a}=await de.POST("/rest/collections/edit_collection/{collection_uuid}",n,{params:{path:{collection_uuid:e}},body:r,timeoutMs:Qe()});if(o||!s)throw new he("API_CLIENTS_ERROR",{message:"Failed to edit collection",cause:o,status:a.status??0});const i=s,{access:c,...u}=i;return c!==void 0?{...u,accessLevel:c}:u},XR=async({params:e,reason:t})=>{const n=Lz(e);e.template_id&&(n.template_id=e.template_id);const{data:r,error:s,response:o}=await de.POST("/rest/collections/create_collection",t,{body:n,timeoutMs:Qe()});if(s||!r)throw new he("API_CLIENTS_ERROR",{message:"Failed to create collection",cause:s,status:o.status??0});return r},xvt=async({entryUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/entry/convert-to-report/{entry_uuid}",t,{params:{path:{entry_uuid:e}},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to convert entry to report",cause:r,status:s.status??0});return n},S_e=async({collectionUuid:e,reason:t})=>{const{error:n,response:r}=await de.DELETE("/rest/collections/delete_collection/{collection_uuid}",t,{params:{path:{collection_uuid:e}},timeoutMs:Qe(),numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to delete collection",cause:n,status:r.status??0})},E_e=async({contextUUID:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/thread/mark_viewed/{context_uuid}",t,{params:{path:{context_uuid:e}},timeoutMs:Qe(),numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to mark thread as viewed",cause:r,status:s.status??0});return n},vvt=async({contextUUID:e,action:t,rwToken:n,reason:r})=>{const{data:s,error:o,response:a}=await de.POST("/rest/thread/reply/simulated",r,{body:{context_uuid:e,read_write_token:n,action:t},timeoutMs:Cn.HIGH});if(o)throw new he("API_CLIENTS_ERROR",{message:"Error simulating turn",cause:o,status:a.status??0});if(!s)throw new he("API_CLIENTS_ERROR",{message:"No data returned from reply simulated",status:0});const i={...s.message,parent_info:s.message.parent_info||{}};return{...s,message:i}},bvt=async({request:e,reason:t})=>{const n={type:"remote_mcp",transport:"sse",source:"direct",status:"enabled"},{data:r,error:s,response:o}=await de.POST("/rest/connectors",t,{body:{...e,...n},timeoutMs:Qe()});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to create remote MCP connector",cause:s,status:o.status??0});return r},k_e=({fileRepositoryType:e,offset:t,searchTerm:n,ownerId:r,reason:s})=>{const{$t:o}=J(),a=Yt(),i=ou(),{openToast:c}=hn(),u=lu(),f=x4(),m=w4(e,r,L4,t,n),p=eh(r),h=Array.isArray(i?.slug)?i.slug[0]:i?.slug,g=h?na(h):void 0,y=e==="USER"||e==="ORG"||e==="COLLECTION"&&!!r;return{...Rt({mutationFn:async v=>{if(!y){c({message:o({defaultMessage:"Unable to delete files.",id:"QYfmPDehhb"}),variant:"error",timeout:3});return}return __e({request:{file_uuids:v,file_repository_info:{file_repository_type:e,owner_id:r}},reason:s})},onMutate:async v=>{await a.cancelQueries({queryKey:m});const b=a.getQueryData(m);return b&&a.setQueryData(m,_=>({..._,completedFiles:_.completedFiles.filter(w=>!v.includes(w.file_uuid)),processingFiles:_.processingFiles.filter(w=>!v.includes(w.file_uuid)),failedFiles:_.failedFiles.filter(w=>!v.includes(w.file_uuid)),numTotalFiles:Math.max((_.numTotalFiles||0)-v.length,0)})),{previousData:b}},onSuccess:()=>{u&&a.invalidateQueries({queryKey:f}),a.invalidateQueries({queryKey:m}),h&&a.invalidateQueries({queryKey:g}),a.invalidateQueries({queryKey:p})},onError:(v,b,_)=>{_?.previousData&&a.setQueryData(m,_.previousData),c({message:o({defaultMessage:"Failed to delete file",id:"aJlra1/tgY"}),variant:"error",timeout:3})}}),isDeleteEnabled:y}},e2=async({fileRepositoryType:e,ownerId:t,limit:n,offset:r,searchTerm:s,email:o,reason:a})=>{const[i,c]=await Promise.all([x3({request:{fileRepositoryInfo:{file_repository_type:e,owner_id:t},limit:n,offset:r,searchTerm:s,fileStates:["COMPLETE"],email:o},reason:a}),x3({request:{fileRepositoryInfo:{file_repository_type:e,owner_id:t},limit:100,offset:0,searchTerm:"",fileStates:["PROCESSING","FAILED"],email:o},reason:a})]),u=f=>({name:f.filename,file_uuid:f.file_uuid,file_s3_url:f.file_s3_url??"",file_title:f.file_title,file_description:f.file_description,uploadedBy:f.uploaded_by,state:f.file_state,size:f.file_size??0,date:new Date(f.time_created).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"}),error:f.error??void 0,isOptimistic:!1});if(i||c){const f=i?.files?.map(u)||[],m=c?.files?.map(u)||[];return{completedFiles:f,processingFiles:m.filter(p=>p.state==="PROCESSING"),failedFiles:m.filter(p=>p.state==="FAILED"),numTotalFiles:i?.numTotalFiles||0}}return{completedFiles:[],processingFiles:[],failedFiles:[],numTotalFiles:0}},_vt=({fileRepositoryType:e,limit:t,offset:n,searchTerm:r,ownerId:s,reason:o})=>{const a=Yt(),{session:i}=Ne(),c=i?.user?.email??"",{isEnterprise:u}=mo({reason:o}),f=!!(e==="COLLECTION"&&s||e==="ORG"&&u),m=w4(e,s,t,n,r),p=mt({queryKey:m,queryFn:()=>f?e2({fileRepositoryType:e,ownerId:s,limit:t,offset:n,searchTerm:r,email:c,reason:o}):Promise.reject(),enabled:f,placeholderData:Wl,staleTime:300*1e3,gcTime:600*1e3});return d.useEffect(()=>{f&&(p.data?.numTotalFiles??0)>n+t&&a.prefetchQuery({queryKey:m,queryFn:()=>e2({fileRepositoryType:e,ownerId:s,limit:t,offset:n+t,searchTerm:r,email:c,reason:o}),staleTime:300*1e3,gcTime:600*1e3})},[m,f,a,e,t,n,r,p.data?.numTotalFiles,c,s,o]),p},wvt=({fileRepositoryType:e,limit:t,searchTerm:n,ownerId:r,reason:s})=>{const{session:o}=Ne(),a=o?.user?.email??"",{isEnterprise:i}=mo({reason:s}),c=!!(e==="COLLECTION"&&r||e==="ORG"&&i),u=w4(e,r,t,void 0,n,!0);return PU({enabled:c,initialPageParam:0,queryKey:u,queryFn:({pageParam:m})=>!c||m===void 0?Promise.reject():e2({fileRepositoryType:e,ownerId:r,limit:t,offset:m,searchTerm:n,email:a,reason:s}),getNextPageParam:(m,p)=>{const g=p.length*t+t;if(!(g>=m.numTotalFiles))return g}})},M_e=({initialIntervalMs:e,maxIntervalMs:t=6e4,timeoutMs:n=9e5})=>{const r=d.useRef(null);return{getInterval:()=>{if(r.current===null)return r.current=Date.now(),e;const a=Date.now()-r.current,i=Math.floor(a/6e4);if(a>=n)return!1;let c=e;for(let u=0;u{r.current=null}}},T_e=5e3,A_e=6e4,N_e=({reason:e,fileRepoInfo:t,enablePolling:n=!1,forceActivePolling:r=!1})=>{const s=u2e(t),{getInterval:o,reset:a}=M_e({initialIntervalMs:T_e}),{data:i}=mt({queryKey:s,queryFn:()=>d_e({request:{file_repository_info:t},reason:e}),refetchInterval:c=>{if(!n)return a(),!1;const{pending_files:u=0}=c.state.data?.summary??{};return u===0&&!r?(a(),A_e):o()},refetchIntervalInBackground:!1,staleTime:Vme(30)});return{total:i?.summary?.total_files??0,pending:i?.summary?.pending_files??0,errors:i?.summary?.error_files??0,uploads:i?.summary?.total_uploads??0}},R_e=({fileRepoInfo:e,reason:t,enablePolling:n=!0})=>{const{isMonitoryingFileRepository:r,getLocalProgress:s,clearLocalFileUploads:o}=Vz(),a=Yt(),[i,c]=d.useState(!1),[u,f]=d.useState(0),[m,p]=d.useState(0),[h,g]=d.useState(0),{total:y,pending:x,errors:v}=N_e({enablePolling:n,forceActivePolling:r(e),fileRepoInfo:e,reason:t}),b=s(e),_=u+m,w=x+b.pending,S=v+b.errors,C=_-w;return d.useEffect(()=>{y>u&&f(y),b.total>m&&p(b.total),S>h&&g(S);const E=u>0||m>0,T=y===0,k=b.pending===0;E&&T&&k&&!i&&(c(!0),o(e),a.invalidateQueries({queryKey:RR()}),a.invalidateQueries({queryKey:RR(void 0,!0)})),i&&(y>0||b.pending>0)&&(c(!1),f(0),p(0),g(0))},[y,b.total,b.pending,S,u,m,h,i,a,e,o]),{total:_,pending:w,errors:h,uploaded:C,isFinished:i}},ZR={enter:"animate-expandHeight",exit:"animate-collapseHeight"};function D_e(e){switch(e){case"enter":return ZR.enter;case"exit":return ZR.exit;case"idle":return"";default:At(e)}}function j_e({children:e,animationState:t,onAnimationEnd:n}){const r=D_e(t);return l.jsx("div",{className:z("grid",r),onAnimationEnd:n,children:l.jsx("div",{className:"overflow-hidden",children:e})})}const I_e={top:{enter:"animate-slideDownAndFadeIn",exit:"animate-slideDownAndFadeOut"},bottom:{enter:"animate-slideUpAndFadeIn",exit:"animate-slideUpAndFadeOut"},left:{enter:"animate-slideRightAndFadeIn",exit:"animate-slideRightAndFadeOut"},right:{enter:"animate-slideLeftAndFadeIn",exit:"animate-slideLeftAndFadeOut"}};function P_e(e,t){const n=I_e[t];switch(e){case"enter":return n.enter;case"exit":return n.exit;case"idle":return"";default:At(e)}}function O_e({children:e,animationState:t,side:n,onAnimationEnd:r}){const s=P_e(t,n);return l.jsx("div",{className:s,onAnimationEnd:r,children:e})}function L_e(e){const[t,n]=d.useState(e),[r,s]=d.useState(e?"enter":"idle");d.useLayoutEffect(()=>{e?t||(n(!0),s("enter")):t&&s("exit")},[e,t]);const o=d.useCallback(()=>{r==="enter"?s("idle"):r==="exit"&&n(!1)},[r]);return{isPresent:t,animationState:r,handleAnimationEnd:o}}function JR(e){const{children:t,isVisible:n}=e,{isPresent:r,animationState:s,handleAnimationEnd:o}=L_e(n),a=d.useRef(t);if(n&&(a.current=t),!r)return null;const i=n?t:a.current,c=e.animationType;switch(c){case"height":return l.jsx(j_e,{animationState:s,onAnimationEnd:o,children:i});case"slide":{const u=e.side??"bottom";return l.jsx(O_e,{animationState:s,side:u,onAnimationEnd:o,children:i})}default:At(c)}}function V4({animationType:e,side:t,...n}){switch(e){case"height":return l.jsx(JR,{animationType:"height",...n});case"slide":return l.jsx(JR,{animationType:"slide",side:t,...n});default:At(e)}}const Wx={transparent:"transparent",subtle:"subtle",subtler:"subtler",background:"background"},F_e="border-subtlest ring-subtlest divide-subtlest",K=A.memo(({variant:e=Wx.transparent,className:t,onClick:n,onMouseOver:r,onMouseLeave:s,children:o,id:a,bgHover:i,style:c,testId:u,as:f="div",ref:m,noBorder:p,...h})=>{const g=A.useMemo(()=>{const y={transparent:"bg-transparent",super:"bg-super",superBorder:"border border-super",superLight:"bg-super/10",subtle:"bg-subtle",subtler:"bg-subtler",red:"bg-caution",background:"bg-base",underlay:"bg-underlay",offsetLoading:"bg-subtlest animate-pulse",textColor:"bg-inverse",orange:"bg-attention",raised:"bg-raised dark:bg-offset",raisedOffset:"bg-raisedOffset",max:"bg-max",maxBorder:"border border-max"},x={subtle:"md:hover:!bg-subtle",subtler:"md:hover:!bg-subtler",raisedOffset:"md:hover:!bg-raisedOffset",transparent:"md:hover:!bg-transparent",super:"md:hover:!bg-super"};return z(t,!p&&e!=="maxBorder"&&e!=="superBorder"&&F_e,i?"transition duration-normal":"",y[e]||y.transparent,i&&x[i]||"")},[i,t,e,p]);return A.createElement(f,{id:a,ref:m,className:g,onClick:n,onMouseOver:r,onMouseLeave:s,style:c,"data-testid":u,...h},o)});K.displayName="Box";const B_e={micro:"font-sans text-2xs font-normal",tiny:"font-sans text-xs font-medium",tinyRegular:"font-sans text-xs font-normal",tinyBold:"font-sans text-xs font-bold",extraSmall:"font-sans text-[13px]",small:"font-sans text-sm",smallBold:"font-sans text-sm font-medium leading-[1.125rem]",smallExtraBold:"font-sans text-sm font-extrabold leading-[1.125rem]",base:"font-sans text-base",baseSemi:"font-sans text-base font-medium",tinyMono:"font-mono text-2xs md:text-xs",smallMono:"font-mono text-sm",smallCaps:"text-2xs md:text-xs tracking-wide font-mono leading-none uppercase","section-title":"font-display text-lg font-medium","page-title":"font-display font-medium text-2xl",display:"font-display text-4xl lg:text-[2.8rem] !leading-[1.2]","entry-title":"font-display text-pretty text-xl lg:text-3xl font-medium","entry-title-100":"font-display text-pretty text-xl lg:text-3xl font-medium","entry-title-200":"font-display text-lg lg:text-xl font-medium","entry-title-300":"font-sans text-pretty font-medium"},U_e={default:"text-foreground",defaultInverted:"text-inverse",light:"text-quiet ",ultraLight:"text-quietest",red:"text-caution",yellow:"text-yellow-600 dark:text-yellow-400",super:"text-super",white:"text-white",positive:"text-positive",negative:"text-negative",max:"text-max"},V_e=(e,t,n)=>t||(e==="page-title"?"h1":e==="entry-title"?"h2":n?"span":"div"),H_e=(e,t,n,r,s)=>{const o=B_e[e],a=U_e[t];return z(s,o,a,n?"text-center block":"",r?"hover:text-super":"","selection:bg-super/50 selection:text-foreground dark:selection:bg-super/10 dark:selection:text-super")},V=A.memo(({children:e,variant:t="base",color:n="default",textCenter:r,className:s,inline:o,superHover:a,testId:i,as:c,ref:u,...f})=>{const m=d.useMemo(()=>V_e(t,c,o),[t,c,o]),p=d.useMemo(()=>H_e(t,n,r,a,s),[s,n,r,t,a]);return A.createElement(m,{className:p,"data-testid":i,ref:u,...f},e)});V.displayName="TextBlock";const z_e={[Ht.tiny]:"xs",[Ht.small]:"sm",[Ht.regular]:"base",[Ht.large]:"lg",[Ht.xl]:"xl",[Ht.none]:"base"},W_e={[Ht.tiny]:hl.xs,[Ht.small]:hl.sm,[Ht.regular]:hl.base,[Ht.large]:hl.lg,[Ht.xl]:hl.xl,[Ht.none]:hl.base},gp=A.memo(({icon:e,showClicked:t=!1,buttonSize:n,iconClassName:r})=>typeof e=="string"?l.jsx(ut,{name:t?B("check"):e,size:W_e[n],className:r}):l.jsx(ge,{icon:t?B("check"):e,size:z_e[n]||"base",className:r}));gp.displayName="BaseIcon";const Fz=A.memo(({className:e,textClassName:t,text:n,shortcut:r=Pe,...s})=>l.jsxs("div",{className:z("gap-x-sm bg-dark dark:border-subtler flex max-w-[280px] items-center rounded-md px-2 py-1.5 shadow-sm dark:border",e),...s,children:[typeof n=="string"?l.jsx(V,{variant:"tiny",color:"white",className:t,children:n}):n,r.length>0&&l.jsx("div",{className:"gap-xs flex",children:r.map(o=>l.jsx(V,{variant:"smallCaps",className:"border-subtlest bg-subtle px-xs py-two min-w-6 rounded border text-center shadow-sm",children:l.jsx("span",{className:"text-light",children:o})},o))})]}));Fz.displayName="TooltipBody";const Io=A.memo(({tooltipText:e,tooltipLayout:t="top",tooltipAlign:n,children:r,keyboardShortcut:s,showTooltip:o=!0,className:a="",asChild:i=!1,testId:c,offset:u=8,closeOnClick:f=!0,bodyClassName:m,bodyTextClassName:p,arrowClassName:h,open:g,onOpenChange:y,delayDuration:x})=>o?l.jsxs(LU,{open:g,onOpenChange:y,delayDuration:x,children:[l.jsx(fme,{children:l.jsxs(mme,{side:t,align:n,sideOffset:u,className:z(t==="bottom"&&"data-[state=closed]:animate-slideUpAndFadeOut data-[state=delayed-open]:animate-slideDownAndFadeIn",t==="top"&&"data-[state=closed]:animate-slideDownAndFadeOut data-[state=delayed-open]:animate-slideUpAndFadeIn",t==="left"&&"data-[state=closed]:animate-slideRightAndFadeOut data-[state=delayed-open]:animate-slideLeftAndFadeIn",t==="right"&&"data-[state=closed]:animate-slideLeftAndFadeOut data-[state=delayed-open]:animate-slideRightAndFadeIn",a),onPointerDownOutside:f?void 0:b=>{b.preventDefault()},children:[l.jsx(Fz,{text:e,shortcut:s,"data-test-id":c,className:m,textClassName:p}),h&&l.jsx(pme,{width:12,height:6,className:z("overflow-hidden translate-y-[-2px] [clip-path:inset(1px_1px_0px_1px)] fill-[oklch(var(--dark-background-base-color))] dark:stroke-[1.5px] dark:stroke-subtler",h)})]})}),l.jsx(hme,{asChild:i,onClick:f?void 0:b=>{b.preventDefault()},children:r})]}):l.jsx(l.Fragment,{children:r}));Io.displayName="TooltipWrapper";const G_e=2e3,$_e=1e3,e9={[Ht.tiny]:{height:"h-6",text:"text-xs",padding:"px-2",iconWrapperSize:"size-3.5",baselineShift:"-mb-px"},[Ht.small]:{height:"h-8",text:"text-sm",padding:"px-2.5",iconWrapperSize:"size-4",baselineShift:"-mb-px"},[Ht.regular]:{height:"h-10",text:"text-base",padding:"px-3",iconWrapperSize:"size-5",baselineShift:"mb-[-2px]"},[Ht.large]:{height:"h-14",text:"text-lg",padding:"px-5",iconWrapperSize:"size-7",baselineShift:"mb-[-3px]"}},Bz=e=>e9[e]||e9[Ht.regular],t9=({children:e,buttonSize:t=Ht.regular})=>l.jsx("div",{className:z("flex shrink-0 items-center justify-center",Bz(t).iconWrapperSize),children:e}),H4=d.memo(e=>{const{text:t,textClassName:n="",size:r=Ht.regular,disabled:s=!1,fullWidth:o,fullWidthMobile:a,layout:i="center",type:c="button",noWrap:u=!0,onClick:f=Ao,onMouseDown:m,href:p,target:h,extraCSS:g,icon:y,iconClassName:x,pill:v=!1,noRounded:b=!1,toolTip:_,keyboardShortcut:w,tooltipLayout:S="top",tooltipProps:C,badge:E,chevron:T,isLoading:k,loadingVariant:I="spin",leadingComponent:M,trailingComponent:N,maxWidth:D,chevronIcon:j=B("chevron-down"),clickFeedback:F=!1,debounce:R=!1,testId:P,ariaLabel:L,variant:U,autoFocus:O,noPadding:$=!1,ref:G,...H}=e,[Q,Y]=d.useState(!1),[te,se]=d.useState(!1),[ae,X]=d.useState(s),ee=d.useMemo(()=>Bz(r),[r]);d.useEffect(()=>{X(R&&te||s)},[R,te,s]);const le=De=>{(!R||!te)&&(se(!0),setTimeout(()=>se(!1),$_e),f(De)),F&&(Y(!0),setTimeout(()=>Y(!1),G_e))},re=!!t,ce=d.useMemo(()=>z(g,"font-sans focus:outline-none outline-none outline-transparent transition duration-300 ease-out select-none items-center relative group/button font-semimedium",{"justify-center text-center items-center":i==="center","justify-start":i==="left","rounded-none":b,"rounded-lg":!v&&!b,"rounded-full":v&&!b,"cursor-default opacity-50":ae,"cursor-pointer active:scale-[0.97] active:duration-150 active:ease-outExpo origin-center":!ae,"whitespace-nowrap":u,"break-words":!u,"flex w-full":o,"inline-flex":!o&&!a,"flex w-full md:inline-flex md:w-auto":a,[ee.text]:!0,[ee.height]:!0,[ee.padding]:re,[v?"aspect-square":"aspect-[9/8]"]:!re&&!T&&!E&&!(y&&M)}),[E,ee,T,ae,g,o,a,re,y,i,M,b,u,v]),ue=d.useMemo(()=>z("flex items-center min-w-0 gap-two",{"flex-col":i==="stacked","justify-center":i==="center","justify-left":i==="left","justify-between":i==="split","w-full":o,"gap-sm":i==="stacked"}),[o,i]),me=d.useMemo(()=>i==="stacked"||r===Ht.regular&&!re||r===Ht.large&&re?16:14,[i,r,re]),we=l.jsxs("div",{className:ue,style:{maxWidth:D},children:[M&&l.jsx("div",{children:M}),k&&l.jsx(t9,{buttonSize:r,children:I==="spin"?l.jsx(Gl,{size:me}):I==="pulse"?l.jsx("div",{className:z("relative flex items-center justify-center",U==="primary"?"text-inverse":"text-super"),children:l.jsxs("div",{className:"relative scale-[0.8]",children:[l.jsx(gp,{icon:B("circle-filled"),buttonSize:r}),l.jsx(gp,{icon:B("circle-filled"),buttonSize:r,iconClassName:"duration-1200 absolute inset-0 animate-ping"})]})}):null}),!k&&y&&l.jsx(t9,{buttonSize:r,children:l.jsx(gp,{icon:y,showClicked:Q,buttonSize:r,iconClassName:x})}),t&&l.jsx("div",{className:z("relative truncate text-center",{"px-1":!$,"leading-loose":i!=="stacked","leading-none":i==="stacked"},ee.baselineShift,n),children:t}),E&&l.jsxs("span",{children:[" · ",E]}),T&&l.jsx(ge,{size:"xs",icon:j,className:"shrink-0 opacity-50"}),N]});let ye;y&&!t&&_&&(ye=_);const _e=d.useMemo(()=>({WebkitTapHighlightColor:"transparent"}),[]);let ke;return p!==void 0?ke=l.jsx(yt,{"data-testid":P,role:"button","aria-label":L??ye,href:p,className:ce,target:h,onClick:f,onMouseDown:m,style:_e,...H,ref:G,children:we}):ke=l.jsx("button",{"data-testid":P,"aria-label":L??ye,type:c,disabled:ae,onClick:le,onMouseDown:m,className:ce,...H,ref:G,children:we}),w||_?l.jsx(Io,{tooltipText:_??"",keyboardShortcut:w,tooltipLayout:S,...C,asChild:!0,children:ke}):ke});H4.displayName="ButtonBase";const st=d.memo(({variant:e="common",noPadding:t,noXPadding:n,extraCSS:r,...s})=>{const o=d.useMemo(()=>z("focus-visible:bg-subtle",{"!p-0 !h-auto hover:!bg-transparent":t},{"!px-0 hover:!bg-transparent":n},{super:"hover:bg-subtle text-super dark:hover:bg-subtle",primary:"hover:bg-subtle text-foreground dark:hover:bg-subtle",common:"hover:bg-subtle text-quiet hover:text-foreground dark:hover:bg-subtle",positive:"text-quiet hover:bg-subtle hover:text-super",positiveSelected:"text-super hover:bg-subtle hover:text-super",negative:"text-quiet hover:bg-subtle hover:text-caution",negativeSelected:"text-caution dark:text-caution hover:bg-subtle hover:text-caution",noBackground:"text-quiet hover:text-foreground",noHover:"text-quiet cursor-default",subtle:"text-foreground bg-subtle"}[e],r),[r,e,t,n]);return l.jsx(H4,{testId:s.testId,extraCSS:o,...s})});st.displayName="TextButton";const Xl=A.memo(({children:e,portalTarget:t})=>{const[n,r]=d.useState(!1);return d.useEffect(()=>(r(!0),()=>r(!1)),[]),n?zh.createPortal(e,t||document.body):null});Xl.displayName="Portal";const qc=A.memo(({keyProp:e=0,message:t,variant:n,description:r,ctaText:s,ctaOnClick:o,closeOnCtaClick:a=!0,isVisible:i=!1,timeout:c,handleClick:u,handleClose:f,onTimeout:m=Ao,position:p="top",iconOverride:h,...g})=>{const[y,x]=d.useState(i);d.useEffect(()=>{x(i)},[i]);const v=c!=null&&c>0;d.useEffect(()=>{let S;return i&&v&&(S=setTimeout(()=>{x(!1),m()},c*1e3)),()=>{clearTimeout(S)}},[y,c,i,m,v]);const b=d.useCallback(()=>{x(!1),f?.()},[f]),_=d.useCallback(()=>{o?.(),a&&b()},[o,b,a]),w=d.useMemo(()=>{if(h)return h;switch(n){case"success":return B("circle-check");case"error":return B("alert-circle");case"refresh":return B("refresh");case"warning":return B("alert-circle")}},[h,n]);return l.jsx(Xl,{children:l.jsx("div",{className:z(`right-toastHMargin erp-sidecar:top-[114px] fixed ${p==="top"?"top-toastVMargin":"bottom-toastVMargin"} z-30 flex items-center justify-center`,{"cursor-pointer":u}),children:l.jsx(V4,{isVisible:y,animationType:"slide",side:"right",children:l.jsx("div",{...g,children:l.jsxs(K,{variant:"raised",className:z("gap-x-sm p-md shadow-overlay flex items-center rounded-lg",{"cursor-pointer":n==="refresh"}),onClick:u??Ao,children:[l.jsx(K,{variant:"subtler",className:"p-sm dark:bg-subtle rounded-md",children:l.jsx(V,{variant:"smallBold",color:n==="error"?"red":n==="warning"?"yellow":"super",children:l.jsx(rn,{icon:w,size:"small"})})}),l.jsxs(K,{className:"flex-1",children:[l.jsx(V,{variant:"small",color:"default",children:t}),r&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"mt-1 whitespace-pre-line",children:r})]}),s&&o&&l.jsx(st,{text:s,variant:"subtle",onClick:_,size:"small",extraCSS:"ml-xl"}),!v&&l.jsx(st,{variant:"primary",size:"tiny",icon:B("x"),onClick:b,extraCSS:"ml-sm",noPadding:!0})]})},e)})})})});qc.displayName="Toast";const q_e=({fileRepoInfo:e,collectionSlug:t,onClose:n})=>{const r="upload-progress-toast",{$t:s}=J(),o=Rn(),{total:a,pending:i,errors:c,isFinished:u}=R_e({fileRepoInfo:e,reason:r,enablePolling:!0}),f=s({defaultMessage:"See files",id:"p+DFrrlLh2"}),m=d.useCallback(()=>{switch(e.file_repository_type){case"USER":o.push("/account/files");break;case"ORG":o.push("/account/org/files");break;case"COLLECTION":if(!t){Hc.error("Collection slug is not set",{fileRepoInfo:e});return}o.push(`/spaces/${t}?showUploadModal`);break;default:Hc.warn("Unsupported file repository type",{fileRepoInfo:e})}},[e,o,t]);if(!a)return null;if(u){const y=s({defaultMessage:"{total, number} files synced",id:"1rpVYk4ZN/"},{total:a}),x=s({defaultMessage:"Ready to search",id:"n813XUWD4Q"});return l.jsx(qc,{message:y,description:x,variant:"success",iconOverride:B("circle-check"),ctaText:f,ctaOnClick:m,isVisible:!0,handleClose:n,timeout:null})}const p=Math.round((a-i)/a*100),h=s({defaultMessage:"Syncing {total, plural, one {# file} other {# files}}",id:"bAaiOcNQKr"},{total:a}),g=isNaN(p)?"":c===0?s({defaultMessage:"{percentage, number}% complete",id:"1rUNFit3re"},{percentage:p}):s({defaultMessage:"{percentage, number}% complete with {errors, plural, one {# error} other {# errors}}",id:"WewISkdOck"},{percentage:p,errors:c});return l.jsx(qc,{message:h,description:g,variant:"success",iconOverride:B("refresh"),ctaText:f,ctaOnClick:m,closeOnCtaClick:!1,isVisible:!0,handleClose:n,timeout:null})},ol=(e,t)=>e.file_repository_type===t.file_repository_type&&e.owner_id===t.owner_id,K_e=e=>{const t=e.filter(s=>s.status==="uploading").length,n=e.filter(s=>s.status==="failed").length;return{total:e.length,pending:t,errors:n}},Uz=Ft("UploadProgressContext",null),Vz=()=>{const e=d.useContext(Uz);if(!e)throw new Error("useUploadProgress must be used within an UploadProgressProvider");return e},Hz=A.memo(({children:e})=>{const[t,n]=d.useState([]),r=d.useCallback(({fileRepoInfo:x,collectionSlug:v})=>{n(b=>b.some(w=>ol(w.fileRepoInfo,x)&&w.collectionSlug===v)?b:[...b,{id:b.length+1,fileRepoInfo:x,collectionSlug:v,localFileUploads:[],progressBarVisible:!1}])},[]),s=d.useCallback(x=>{n(v=>v.filter(b=>b.id!==x))},[]),o=d.useCallback(x=>t.some(v=>ol(v.fileRepoInfo,x)),[t]),a=d.useCallback(({fileRepoInfo:x,visible:v})=>{n(b=>b.map(_=>ol(_.fileRepoInfo,x)?{..._,progressBarVisible:v}:_))},[]),i=d.useCallback(({fileRepoInfo:x,fileId:v})=>{n(b=>b.map(_=>ol(_.fileRepoInfo,x)?{..._,localFileUploads:[..._.localFileUploads,{fileId:v,status:"uploading"}]}:_))},[]),c=d.useCallback(x=>{n(v=>v.map(b=>ol(b.fileRepoInfo,x)?{...b,localFileUploads:[]}:b))},[]),u=d.useCallback(({fileRepoInfo:x,fileId:v,status:b})=>{n(_=>_.map(w=>{if(!ol(w.fileRepoInfo,x))return w;const S=w.localFileUploads.map(C=>C.fileId===v?{...C,status:b}:C);return{...w,localFileUploads:S}}))},[]),f=d.useCallback(({fileRepoInfo:x,fileId:v})=>{n(b=>b.map(_=>{if(!ol(_.fileRepoInfo,x))return _;const w=_.localFileUploads.filter(S=>S.fileId!==v);return{..._,localFileUploads:w}}))},[]),m=d.useCallback(x=>{const v=t.find(b=>ol(b.fileRepoInfo,x));return v?K_e(v.localFileUploads):{total:0,pending:0,errors:0}},[t]),p=d.useMemo(()=>({startMonitoring:r,isMonitoryingFileRepository:o,setProgressBarVisible:a,addLocalFileUpload:i,updateLocalFileUploadStatus:u,removeLocalFileUpload:f,clearLocalFileUploads:c,getLocalProgress:m}),[r,o,a,i,u,f,c,m]),h=t.at(-1),g=h&&!h.progressBarVisible,y=d.useCallback(()=>{h?.id&&s(h.id)},[h?.id,s]);return l.jsxs(Uz.Provider,{value:p,children:[e,g&&h&&l.jsx(q_e,{fileRepoInfo:h.fileRepoInfo,collectionSlug:h.collectionSlug,onClose:y})]})});Hz.displayName="UploadProgressProvider";const Si="__temp__",n9=10,Y_e=async(e,t)=>{const s=new FormData;Object.entries(t.fields).forEach(([a,i])=>{s.append(a,i)}),s.append("file",e);let o=null;for(let a=0;a<1;a++)try{a>0&&await new Promise(c=>setTimeout(c,2e3));const i=await fetch(t.s3_bucket_url,{method:"POST",body:s});if(Z.info("S3 upload response received",{fileUrl:t.s3_bucket_url,fileUuid:t.file_uuid,status:i.status,statusText:i.statusText,ok:i.ok}),!i.ok)throw new Error(`HTTP error ${i.status}: ${i.statusText}`);return}catch(i){o=i instanceof Error?i:new Error(String(i)),Z.error("S3 upload error",{fileUuid:t.file_uuid,attempt:a,errorMessage:o.message,errorName:o.name,errorStack:o.stack})}throw new Error(`UPLOAD_FAILED after 1 attempts: ${o?.message||"Unknown error"}`)},Q_e=({fileRepoInfo:e,setTotalFilesUploading:t,replaceExisting:n,reason:r,onLocalFileUploadSuccess:s})=>{const{$t:o}=J(),a=Yt(),i=x4(),c=ou(),u=Array.isArray(c?.slug)?c.slug[0]:c?.slug,f=u?na(u):void 0,{openToast:m}=hn(),{session:p}=Ne(),h=p?.user?.email??"",g=Ea({reason:r}),{addLocalFileUpload:y,updateLocalFileUploadStatus:x}=Vz(),v=_4(e),b=be.makeQueryKey("list_file_directory_infinite",e.file_repository_type,e.owner_id),_=e.file_repository_type==="USER"||e.file_repository_type==="ORG"||e.file_repository_type==="COLLECTION"&&!!e.owner_id&&e.owner_id!==Si;return{...Rt({mutationFn:async S=>{if(!_){m({message:o({defaultMessage:"Unable to upload files.",id:"GrtfijFWiu"}),variant:"error",timeout:3});return}t(S.length);const C=new Map;S.forEach(E=>{const T=crypto.randomUUID();C.set(E.name,T),y({fileRepoInfo:e,fileId:T})});for(let E=0;E({filename:D.name,content_type:D.type,file_size:D.size})),file_repository_info:e},reason:r}),I=k.limits_reached[0];if(I==="FILE_REPOSITORY_LIMIT_EXCEEDED"){const D=g.connectorLimits?.repo_type_limits?.[e.file_repository_type].max_files??g.maxFilesPerRepository;m({message:o({defaultMessage:"You have reached the file limit of {limit} files per repository.",id:"J0uyf2gB1u"},{limit:D}),variant:"error",timeout:3});break}else if(I==="USER_FILE_LIMIT_EXCEEDED"){const D=g.maxFilesPerUser;m({message:o({defaultMessage:"You've reached your total file limit of {limit} files across My Files and all Spaces. Delete some files or upgrade your plan to add more",id:"3CuAQ4xs/C"},{limit:D}),variant:"error",timeout:3});break}const N=(await Promise.allSettled(k.file_url_params.map((D,j)=>D&&T[j]?{fileUploadUrlInfo:D,file:T[j]}:null).filter(D=>D!==null).map(async({fileUploadUrlInfo:D,file:j})=>{const F=C.get(j.name);try{return await Y_e(j,D),Z.info("S3 upload completed successfully",{fileUuid:D.file_uuid}),{file_s3_url:D.s3_object_url,filename:j.name,file_size:j.size,file_uuid:D.file_uuid,replace_existing:n}}catch(R){F&&x({fileRepoInfo:e,fileId:F,status:"failed"});const P=R instanceof Error?{message:R.message,name:R.name,stack:R.stack}:{error:String(R)};throw Z.error("Upload promise caught error",{fileUuid:D.file_uuid,...P}),m({message:o({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),R}}))).filter(D=>D.status==="fulfilled").map(D=>D.value);if(Z.info("Starting file indexing",{fileCount:N.length,fileUuids:N.map(D=>D.file_uuid)}),N.length>0&&(await Dz({request:{file_repository_info:e,file_index_params:N},reason:r}),N.forEach(D=>{const j=C.get(D.filename);j&&x({fileRepoInfo:e,fileId:j,status:"success"})})),k.limits_reached.length>0)break}},onMutate:async S=>{await a.cancelQueries({queryKey:v});const C=a.getQueryData(v),E=S.map(T=>({name:T.name,file_s3_url:"",file_title:null,file_description:null,file_uuid:crypto.randomUUID(),uploadedBy:h,state:"PROCESSING",size:T.size,date:new Date().toLocaleString(),isOptimistic:!0}));return a.setQueriesData({queryKey:v},T=>T&&{...T,processingFiles:[...T.processingFiles||[],...E]}),{previousData:C,optimisticFiles:E,uploadedFilesCount:S.length}},onError:(S,C,E)=>{m({message:o({defaultMessage:"Failed to upload file",id:"x2gE8tKhMn"}),variant:"error",timeout:3}),E?.previousData&&a.setQueriesData({queryKey:v},E.previousData)},onSettled:()=>{a.invalidateQueries({queryKey:v}),a.invalidateQueries({queryKey:b}),a.invalidateQueries({queryKey:be.makeQueryKey(l3)}),a.invalidateQueries({queryKey:be.makeQueryKey(c3)}),e.file_repository_type==="ORG"&&a.invalidateQueries({queryKey:i}),u&&a.invalidateQueries({queryKey:f})},onSuccess:()=>{s?.()}}),isUploadEnabled:_}},X_e=async({thread_uuid:e,format:t,filename:n,reason:r})=>{const{data:s,error:o,response:a}=await de.POST("/rest/thread/export",r,{body:{thread_uuid:e,format:t,filename:n},timeoutMs:Qe({productionMs:Cn.VERY_HIGH,clientSideMs:Cn.VERY_HIGH,devMs:Cn.VERY_HIGH})});if(o)throw new he("API_CLIENTS_ERROR",{message:"Failed to export thread",cause:o,status:a.status??0});return s},Cvt=async(e,t)=>{const{error:n,response:r}=await de.PUT("/rest/thread/{entry_uuid_or_slug}","remove-thread-expiry",{params:{path:{entry_uuid_or_slug:e}},body:{expired:!1}});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to remove thread expiry",cause:n,status:r.status??0})},Z_e=({fileRepoInfo:e,fileExists:t,reason:n})=>{const{openToast:r}=hn(),{session:s}=Ne(),o=d.useMemo(()=>s?.user?.email??"",[s]),a=Yt(),{mutate:i}=Q_e({fileRepoInfo:e,setTotalFilesUploading:()=>1,replaceExisting:t,reason:n}),{mutateAsync:c}=k_e({fileRepositoryType:e.file_repository_type,offset:0,searchTerm:"",ownerId:e.owner_id,reason:n}),u=d.useCallback(async(m,p)=>{try{if(!m||!p)return;const h=await X_e({thread_uuid:m,format:"md",filename:p,reason:n}),g=atob(h.file_content_64),y=new Array(g.length);for(let _=0;_{try{const h=(await e2({fileRepositoryType:e.file_repository_type,limit:10,offset:0,searchTerm:"",email:o,ownerId:e.owner_id,reason:n}))?.completedFiles.find(g=>g.name.includes(m??""));if(!h?.file_uuid)return;await c([h.file_uuid]),a.setQueryData(eh(e.owner_id,m),!1),r({message:"File removed from space",variant:"success",timeout:3})}catch(p){r({message:`Failed to remove from space: ${p}`,variant:"error",timeout:3})}},[c,r,a,e.owner_id,o,n,e.file_repository_type]);return d.useMemo(()=>({saveThreadToSpace:u,removeThreadFromSpace:f}),[f,u])},J_e=/^\/b\//;function zz(e){return e&&J_e.test(e)}function ewe(e){return e?new URL(window.location.href).pathname.endsWith(`/search/${e}`):!1}function twe(e){return e?.startsWith("/collections")||e?.startsWith("/spaces")}const Wz=({serverName:e,iconUrl:t,size:n="md",border:r=!1})=>t?l.jsx("img",{src:t,alt:`${e} Logo`,className:z("object-contain",n==="sm"&&"size-5",n==="md"&&"p-xs size-12",r&&"ring-subtlest rounded-md ring-1")}):l.jsx(ut,{name:B("box"),className:z(n==="sm"&&"size-4",n==="md"&&"p-xs size-12",r&&"ring-subtlest rounded-md ring-1")}),nwe=()=>typeof window<"u"&&window.location?.origin?window.location.origin:"https://www.perplexity.ai",r9=e=>{const t=nwe();return Ux(`${t}${e}`)?.href||`${t}${e}`},rwe=()=>[{id:"imessage",icon_url:r9("/static/mcpb/imessage.png"),download_url:r9("/static/mcpb/imessage_v0.0.10.mcpb"),manifest:{$schema:"https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",dxt_version:"0.1",name:"imessage",display_name:"Messages",version:"0.0.10",description:"Send and read messages using Apple's Messages app",long_description:`This tool lets Perplexity work with your Mac's Messages app. You can send messages, read messages, and ask Perplexity to help you understand what's important. - -It uses Mac system features to connect to Messages. Your Mac will ask for permission before it can access Messages or Contacts. This is not made by Apple.`,license:"MIT",author:{name:"Perplexity Inc",email:"support@perplexity.ai",url:"https://www.perplexity.ai/"},homepage:"https://www.perplexity.ai/",icon:"icon.png",tools:[{name:"list_contacts",description:'List contacts. When query is provided, search for contacts by name. Use it first to get a handle id, phone numbers, or emails. This tool is more preferred to be used first than "list_chats" tool. If this tool returns empty results, try to use "list_chats" tool to find a contact.'},{name:"list_chats",description:"List chats from Messages. When query is provided, search for chats by phone number (preferrable) or chat name (if phone number is not available)."},{name:"create_chat",description:"Create a new chat with a specific contact"},{name:"read_chat",description:"Read Messages from a specific chat"},{name:"send_imessage",description:"Send a Message to specific chat"}],server:{type:"node",entry_point:"server/index.js",mcp_config:{command:"node",args:["${__dirname}/server/index.js"],env:{HOME:"${HOME}"}}},compatibility:{comet:">=139.0.0",platforms:["darwin"],runtimes:{node:">=22.0.0"},permissions:{full_disk_access:!0,contacts:{for_tools:["list_contacts"]}}}}}],z4=()=>{const e=Qn(),t=d.useMemo(()=>{if(!e.platformInfo)return;const{isMac:n,isWindows:r,isLinux:s}=e.platformInfo;if(n)return"darwin";if(r)return"win32";if(s)return"linux"},[e.platformInfo]);return mt({queryKey:be.makeQueryKey("comet/available_dxts",t),queryFn:async()=>rwe().filter(n=>n.manifest.compatibility?.platforms?t&&n.manifest.compatibility.platforms.includes(t):!0)})},Gz=(e,t)=>t.dxt_name?e?.find(n=>n.id===t.dxt_name)?.icon_url:void 0,$z=e=>Object.fromEntries(Object.entries(e.compatibility?.permissions??{}).filter(([t,n])=>!!n).map(([t,n])=>typeof n=="object"?[t,n]:[t,{}])),v3=e=>Object.entries($z(e)).filter(([,{for_tools:t}])=>!t).map(([t])=>t),swe=({cometState:e})=>d.useMemo(()=>{if(!e.installedDxts)return[];const t=e.installedDxts.flatMap(({manifest:n})=>v3(n));return Array.from(new Set(t))},[e.installedDxts]),owe=Ce(async()=>{const{AskPermissionsModal:e}=await Se(()=>q(()=>import("./AskPermissionsModal-D80mi85i.js"),__vite__mapDeps([122,4,1,6,3,9,7,8,10,11,12])));return{default:e}}),Nf=()=>{const e=Qn(),{openModal:t}=Uo(),{data:n}=z4(),r=swe({cometState:e}),s=un(),o=iM({queries:r.map(v=>({queryKey:be.makeQueryKey("comet/permission",v),queryFn:()=>s.hasPermission(v)}))}).map(v=>v.data),i=d.useMemo(()=>{let v;return b=>(Un(v,b)||(v=b),v)},[])(o),c=d.useMemo(()=>new Set(e.mcpStdioServers?.filter(v=>{const b=dp(e.installedDxts,v);return(b?v3(b):[]).some(S=>{const C=r.indexOf(S);return C!==-1&&i[C]===!1})}).map(v=>v.name)),[e.mcpStdioServers,e.installedDxts,r,i]),u=d.useMemo(()=>Object.fromEntries(e.mcpStdioServers?.map(v=>{const b=dp(e.installedDxts,v),_=Gz(n,v),w=b?.display_name??b?.name??v.name,S=c.has(v.name);return[v.name,{icon:void 0,avatar:l.jsx(Wz,{serverName:w,iconUrl:_,size:"sm"}),text:w,disabled:v.status!=="running"||!v.tools_count||S,description:"",type:"toggle",iconUrl:_}]})??[]),[e.mcpStdioServers,e.installedDxts,n,c]),f=d.useCallback((v,b)=>{if(!c.has(v)){b();return}const _=e.mcpStdioServers?.find(S=>S.name===v);if(!_)return;const w=dp(e.installedDxts,_);w&&t(owe,{serverName:v,permissions:v3(w),onPermissionsGranted:b,legacyIdentifier:"__NONE__"})},[e.mcpStdioServers,e.installedDxts,c,t]),m=d.useCallback(v=>{const b=new Set(e.mcpStdioServers?.map(_=>_.name)??[]);v.forEach(_=>b.delete(_)),e.actions.setMcpDisabledServers(b)},[e.actions,e.mcpStdioServers]),p=d.useCallback(v=>{f(v,()=>{const _=e.mcpDisabledServers??new Set,w=new Set(_);_.has(v)?w.delete(v):w.add(v),e.actions.setMcpDisabledServers(w)})},[e.actions,e.mcpDisabledServers,f]),h=d.useCallback(v=>{f(v,()=>{const _=e.mcpDisabledServers??new Set,w=new Set(_);w.delete(v),e.actions.setMcpDisabledServers(w)})},[e.actions,e.mcpDisabledServers,f]),g=d.useCallback(v=>{const b=e.mcpDisabledServers??new Set,_=new Set(b);_.add(v),e.actions.setMcpDisabledServers(_)},[e.actions,e.mcpDisabledServers]),y=d.useMemo(()=>new Set([...e.mcpDisabledServers??[],...c]),[e.mcpDisabledServers,c]),x=d.useCallback(v=>v in u&&!y?.has(v),[u,y]);return d.useMemo(()=>({cometMcpSources:u,setCometMcpSources:m,toggleCometMcpSource:p,addCometMcpSource:h,removeCometMcpSource:g,hasCometMcpSource:x,cometMcpDisabledServers:y}),[u,m,p,h,g,x,y])},P0={startTime:-1,timer:Wa()},Ru={startTime:-1,modules:new Set},Gx=Ft("PerformanceContext",{markTTV:()=>{},addPageTiming:()=>{},getPageStartTime:()=>0,getPageTimer:()=>Wa(),addPageTimingOnce:()=>{}});function awe({children:e}){const{startTimeFromTimeOriginRef:t}=Rn(),{markTTV:n}=Sfe(),r=d.useCallback(()=>(P0.startTime!==t.current&&(P0.startTime=t.current,P0.timer=Wa(void 0,{nowFromTimeOrigin:t.current})),P0.timer),[t]),s=d.useMemo(()=>({markTTV:()=>n(t.current),addPageTiming:(o,a={})=>r().addTiming(o,a),addPageTimingOnce:(o,a={})=>r().addTimingOnce(o,a),getPageStartTime:()=>t.current,getPageTimer:r}),[n,t,r]);return l.jsx(Gx.Provider,{value:s,children:e})}function W4(){const{getPageStartTime:e}=d.useContext(Gx);return e}function iwe(){const{getPageTimer:e}=d.useContext(Gx);return e}const qz=Ft("PagePerformanceContext",{markTTV:()=>{}});function s9({children:e,modules:t}){const{markTTV:n,addPageTimingOnce:r,getPageStartTime:s}=d.useContext(Gx),o=s(),a=d.useCallback(c=>{t.includes(c)&&(Ru.startTime!==o&&(Ru.startTime=o,Ru.modules=new Set),!Ru.modules.has(c)&&(r(`web.ttv.${c}`),Ru.modules.add(c),t.every(u=>Ru.modules.has(u))&&n()))},[r,o,t,n]),i=d.useMemo(()=>({markTTV:a}),[a]);return l.jsx(qz.Provider,{value:i,children:e})}function lwe(){const{markTTV:e}=d.useContext(qz);return e}function Rf(e,t={}){const n=lwe();d.useEffect(()=>{t.skip||n(e)},[n,e,t.skip])}function $x(){const{isEnterprise:e}=mo({reason:"max-tier"}),{value:t,loading:n}=zt({flag:"max-upsell",defaultValue:!1,subjectType:"visitor_id",extraAttributes:{isEnterprise:e??!1}});return d.useMemo(()=>({isMaxUpsellEnabled:e?!0:t,loading:n}),[t,n,e])}function el(){const{firstResult:e}=on();return e?.read_write_token}const o9=(e,t,n)=>{e.addTimingOnce(t,{source:"comet_extension",...n})},Kz=()=>{const e=An(),t=un(),n=c4(),r=d.useCallback(s=>{const o=!!s.last_backend_uuid;return an(s.model_preference)===oe.RESEARCH||(an(s.model_preference),oe.STUDIO),(s.sources?.some(i=>i==="web")??!0)&&e&&!o&&!1},[e]);return d.useCallback((s,o,a)=>{if(!s||!r(o))return;const i=n(a);i&&(o9(i,"web.frontend.comet_navigation_request_sent_ms"),t.injectSearchResults(s,a,{},c=>{o9(i,"web.frontend.comet_navigation_results_received_ms",{count:c.count})}))},[t,r,n])},cwe="pplx_backend_flag_overrides",uwe=()=>{try{const e=mr(cwe);return e?JSON.parse(e):{}}catch{return{}}},dwe=e=>{try{return new URL(e),!0}catch{return!1}},fwe=({isCometBrowser:e,isMobile:t,isWindowsApp:n,clientPayloadUUID:r})=>e?{source:lV(),client_payload_cache_key:r}:{source:BS(t,n)},mwe=({inPageOverride:e,dslQuery:t,existingEntryUUID:n,existingUuid:r,deletedUrls:s,redoSearch:o,collection:a,isRelatedQuery:i,isSponsored:c,relatedQueryUUID:u,inDomain:f,inPage:m,newFrontendContextUUID:p,promptSource:h,querySource:g,timeFromFirstType:y,utmSource:x,disableWidgets:v,isNavSuggestionsDisabled:b,entropyBrowser:_,clientPayloadUUID:w,isIncognito:S,modelPreferenceSubmit:C,lastBackendUUID:E,deviceLocation:T,newAttachments:k,threadMetadataRwToken:I,forceNew:M,finalSources:N,finalRecency:D,mode:j,frontendUUID:F,isWindowsApp:R,isMobile:P,browserHistorySummaryNumDays:L,mentions:U,reason:O,side_by_side_metadata:$,skipSearchEnabled:G,browserHistorySummaryMaxResults:H,sidecarTabId:Q,sidecarUrl:Y,sidecarTitle:te,sidecarSecondaryTabId:se,sidecarSecondaryUrl:ae,sidecarSecondaryTitle:X,isFirstEntry:ee,alwaysSearchOverride:le,overrideNoSearch:re,cometIsMissionControl:ce,mcpTools:ue,refinementFiltersMetadata:me,browserAgentAllowOnceFromToggle:we,forceEnableBrowserAgent:ye,inlineMode:_e,canonicalPageContext:ke})=>{const De=T?{location_lat:T.latitude,location_lng:T.longitude}:null,Ue=Ga().erp,Ee=Ca(),Ke=uwe();Object.keys(Ke).length>0&&Z.info("Sending backend flag overrides to API",{overrideCount:Object.keys(Ke).length,flagKeys:Object.keys(Ke),flagValues:Ke});const Nt=fwe({isCometBrowser:Ee,isMobile:P,isWindowsApp:R,clientPayloadUUID:w});let pe=!1,ve="",Ae="",We,pt=!1,Gt;pt=!0,Gt=g==="followup"?"followup-sidecar":"sidecar";const Le=_e;let gt=S,Je;if(Ee){Je={rendering_place:Ue,sidecar_tab_id:Q,sidecar_url:Y,sidecar_title:te,sidecar_secondary_tab_id:se,sidecar_secondary_url:ae,sidecar_secondary_title:X};const Me=xM(),Ve=_.isAgentAvailable();if(pe=Ve&&!Me,Ve?Me&&Z.info("[comet] Local search disabled - incognito mode",{reason:"incognito_mode",frontendUUID:F}):Z.info("[comet] Local search disabled - agent not available",{reason:"agent_not_available",frontendUUID:F}),ee&&(Ae=_.getLastOmniboxInput(F)??"",Me||(ve=she({entropyBrowser:_,browserHistorySummaryNumDays:L,browserHistorySummaryMaxResults:H,reason:O}))),g==="default_search"&&(dwe(Ae)&&(pe=!1,Gt="default_search",Z.info("[comet] Local search disabled due to URL input in omnibox",{lastOmniboxInput:Ae})),!Ae)){const lt=Ux(document.referrer);(!lt||lt.origin!==location.origin||lt.pathname!=="/.well-known/comet-omnibox-text"&<.pathname!=="/onboarding-comet")&&(pe=!1,Gt="default_search",Z.info("[comet] Local search disabled due to unsecure referer",{lastOmniboxInput:Ae,parsedReferrer:lt}))}}else g==="default_search"&&(We="external_url");return{last_backend_uuid:E??void 0,read_write_token:M?void 0:I,existing_entry_uuid:M?void 0:n,deleted_urls:s??void 0,attachments:k,language:GU(),timezone:mM,in_page:e??m,in_domain:f,search_focus:N.length===0?"writing":"internet",sources:N,search_recency_filter:D,frontend_uuid:r??F,redo_search:o,mode:j,target_collection_uuid:a?.uuid,model_preference:C??void 0,is_related_query:i??!1,is_sponsored:c??!1,related_query_uuid:u,frontend_context_uuid:p??void 0,prompt_source:h??void 0,query_source:Gt??g??"",browser_history_summary_key:ve||void 0,is_incognito:gt,time_from_first_type:y??void 0,local_search_enabled:pe,use_schematized_api:!0,send_back_text_in_streaming_api:!1,supported_block_use_cases:kV,utm_source:x,client_coordinates:De,mentions:U,dsl_query:t,skip_search_enabled:G,is_nav_suggestions_disabled:b||pt,...g==="followup"?{followup_source:"link"}:{},...Nt,...v?{disable_widgets:v}:{},always_search_override:le??!1,override_no_search:re??!1,comet_info:Je,...$&&{side_by_side_metadata:$},client_search_results_cache_key:Ee&&F?`nav-${F}`:void 0,comet_is_mission_control:ce,mcp_tools:ue,risky_query_source:We,should_ask_for_mcp_tool_confirmation:!0,refinement_filters_metadata:me,experiment_overrides:Object.keys(Ke).length>0?Ke:void 0,browser_agent_allow_once_from_toggle:we,force_enable_browser_agent:ye,supported_features:["browser_agent_permission_banner_v1.1"],...Le,canonical_page_context:ke}},pwe=async({reason:e})=>{try{const{data:t,error:n}=await de.POST("/rest/incentives/comet-activation",e,{timeoutMs:Qe()});if(n)throw n;return t}catch(t){return Z.error("Failed to handle comet activation incentive",t),null}},hwe=async({eventName:e,isDeferred:t,clickId:n,nextauthUserId:r,reason:s})=>{try{const{data:o,error:a,response:i}=await de.POST("/rest/attribution/dub/lead",s,{timeoutMs:Qe(),body:{event_name:e,is_deferred:t,click_id:n,nextauth_user_id:r}});if(a)throw new he("API_CLIENTS_ERROR",{cause:a,status:i.status??0});return{success:o?.success??!1}}catch(o){return Z.error("Failed to save post install redirect",o),{success:!1}}},gwe=async({reason:e,flowType:t,trialExtensionId:n})=>{try{const{error:r,response:s}=await de.POST("/rest/attribution/comet/1mo-promo/mark-eligible",e,{timeoutMs:Qe(),body:{flow_type:t,trial_extension_id:n}});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0})}catch(r){Z.error("Failed to mark user as eligible for Comet 1mo promo",r)}},ywe=()=>_a.setItem("signUpBannerDismissed","reset"),xwe=2,vwe=10,bwe=({response:e,isUserLoggedIn:t,submissionCount:n,session:r,queryCountMobile:s,isWindowsApp:o,addKeyRequiringRerender:a,setSubmissionCount:i,trackEvent:c,setShouldShowProductFeedback:u,setFeedbackEntryUUID:f,setShouldShowRecruitmentBanner:m,sendQueryEventSingular:p,maybeSendNthQueryEventSingular:h,recruitmentBannerEnabled:g,reason:y})=>{const x=Ca();if(x&&Efe(t),e?.backend_uuid){const b=e.backend_uuid;Ege({entryUUID:e.backend_uuid,params:{query:e.query_str||"",sources:e.sources?.sources??[]},reason:y}).then(_=>{u(_),_&&c("query feedback shown",{entry_uuid:b})}),g&&Tge({entryUUID:b,reason:y}).then(_=>{m(_),_&&c("power user recruitment banner shown",{})}),f(b)}!t&&n===xwe-1&&(ywe(),a("floating-signup")),t&&r?.user?.id&&s===0&&n===vwe-1&&a("floating-mobile-download"),o?a("floating-milestone-refetch-legacy"):t&&a("floating-milestone-refetch"),i(n+1),p(),h({isCometBrowser:x});const v=_U();x&&v===1?(hwe({eventName:"activated",isDeferred:!1,clickId:null,nextauthUserId:r?.user?.id??null,reason:"comet attribution"}),pwe({reason:"comet activation incentive"}),c("first comet query finished",{})):x&&v===3&&c("third comet query finished",{})},_we="pplx.is-incognito";function G4(){const{value:e,setCookie:t}=wU(_we);return d.useMemo(()=>({isIncognitoLocal:e==="true",setIsIncognito:n=>{t(String(n))}}),[e,t])}const t2={DEFAULT:"DEFAULT",GOVERNMENT:"GOVERNMENT"},Yz=({reason:e})=>{const{organization:t}=mo({reason:e}),{isGovernmentRequestOrigin:n}=Yr(),r=t?.settings?.always_incognito,{isIncognitoLocal:s}=G4(),o=r||(s??n??!1),a=n?t2.GOVERNMENT:t2.DEFAULT;return{isIncognito:o,incognitoType:a}},wwe=({inPage:e})=>e?window.getSelection()?.toString():void 0;function Cwe(){const{value:e}=bge({flag:"client-context-max-chars",subjectType:"visitor_id",defaultValue:5e4});return e}const Swe=(e,t,n)=>{const{value:r,loading:s}=n4({flag:"max-file-upload-count",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function $4(){const{variation:e}=Swe(10);return e}const Ewe=({isFollowup:e,isInSameThread:t,sourcesOverride:n,firstResultSources:r,firstResultRecency:s,defaultSources:o,defaultRecency:a})=>n?{finalSources:n,finalRecency:a}:!e||!t?{finalSources:o,finalRecency:a}:{finalSources:Array.isArray(r)?r:[],finalRecency:s},kwe=1e3*60*30,Qz=()=>{const[e,t]=Qi("locationMetadata",void 0),n=d.useCallback((s,o)=>{t({location:s,permissionState:o,updatedAt:Date.now()}),s?(lo("lat",s.latitude.toString()),lo("long",s.longitude.toString())):($p("lat"),$p("long"))},[t]),r=Date.now()-(e?.updatedAt??0)>kwe;return d.useEffect(()=>{if(vt.removeItem("deviceLocation"),!navigator.geolocation||!("permissions"in navigator)||!r)return;const s=()=>{navigator.geolocation.getCurrentPosition(o=>{n({latitude:o.coords.latitude,longitude:o.coords.longitude},"granted")},()=>{n(void 0,"denied")},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})};navigator.permissions.query({name:"geolocation"}).then(o=>{o.state==="granted"?s():n(void 0,o.state),o.addEventListener("change",()=>{o.state==="denied"?n(void 0,"denied"):o.state==="granted"&&s()})}).catch(()=>{})},[n,t,r]),d.useMemo(()=>({location:e?.location,permissionState:e?.permissionState,isPreciseLocationEnabled:e?.permissionState==="granted"&&!isNaN(e?.location?.latitude??0)&&!isNaN(e?.location?.longitude??0)}),[e?.location,e?.permissionState])},yp=/(.*?)<\/q>/s;function qx(e){if(!e)return{quote:null,actualQuery:null};if(!yp.test(e))return{quote:null,actualQuery:e};const r=e.match(yp)?.[1]||null,s=e.replace(yp,"").trim();return{quote:r,actualQuery:s}}function Mwe(e,t){const n=t.trim();return n?yp.test(e)?e.replace(yp,`${n}`):e.length===0?n:`${n} ${e}`:e}const Twe={submitQuery:()=>{Z.error("submitQuery must be used within PerplexityQueryStateProvider")},handleBotStep:()=>{Z.error("handleBotStep must be used within PerplexityQueryStateProvider")},deleteLastResult:()=>{Z.error("deleteLastResult must be used within PerplexityQueryStateProvider")},shouldShowProductFeedback:!1,shouldShowRecruitmentBanner:!1,feedbackEntryUUID:null,quote:null,setQuote:()=>{},updateLocalStatePostStream:()=>{}},Awe=3,Nwe=6,Rwe=2,Xz=Ft("PplxQueryStateContext",Twe),Dwe=(e,t,n,r,s)=>{if(!(n&&!r)&&!(e&&!t))return r?r.backend_uuid:s},jwe=({children:e,shouldFetchSettings:t})=>{const n="perplexity-query-state-provider",r=Rn(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=un(),{location:i}=Qz(),[c,u]=d.useState(null),{device:{isWindowsApp:f,isMobile:m,isSamsungBrowser:p}}=sn(),h=Vo(),g=iwe(),{sources:y,recency:x,isCopilot:v,setAskInputReasoningMode:b,setAskInputReasoningModelPreference:_,configuredModel:w}=Vn(),{specialCapabilities:S}=Yr(),C=el(),{firstResult:E,lastResult:T}=on(),{setCurrentStreamId:k}=Vx(),{hasAiProfile:I,queryCountMobile:M}=Ea({enabled:t,reason:n}),[N,D]=d.useState(!1),[j,F]=d.useState(!1),[R,P]=d.useState(null),L=Wt(),{addKeyRequiringRerender:U}=r4(),{value:O}=zt({flag:"skip-search-button",subjectType:"visitor_id",defaultValue:!1}),$=Cwe(),{isIncognito:G}=Yz({reason:n}),[H,Q]=d.useState(0),{sendQueryEventSingular:Y,maybeSendNthQueryEventSingular:te,sendResurrectedActivationEventSingular:se}=JM(),ae=Qn(),{cometMcpDisabledServers:X}=Nf(),ee=Z0e(),{value:le}=Rx({flag:"power-user-recruitment-banner",defaultValue:!1}),{isMaxUpsellEnabled:re}=$x(),{isMax:ce}=$t(),{value:{max_results:ue,num_days:me}}=wge({flag:"browser-history-summary-settings",defaultValue:{max_results:500,num_days:7}}),we=$4(),ye=Kz(),_e=d.useCallback(({rawQuery:Ee,dslQuery:Ke,fork:Nt,inPageOverride:pe,copilotOverride:ve,existingEntryUUID:Ae,existingUuid:We,deletedUrls:pt,redoSearch:Gt,attachments:Le,collection:gt,modelPreferenceOverride:Je,isRelatedQuery:Me,isSponsored:Ve,relatedQueryUUID:lt,inDomain:xt,inPage:Pt,newFrontendContextUUID:$e,existingFrontendContextUUID:ht,promptSource:Zt,querySource:dt,sourcesOverride:Ct,submitFromArticleOverride:Ot,timeFromFirstType:Qt,utmSource:lr,disableWidgets:Qr,isNavSuggestionsDisabled:tr,deviceLocation:bn,shouldRedirectToBackendUUID:nr,onThreadSlugReceived:Xr,incognitoOverride:Qo,mentions:lc=[],shouldUsePageStartTime:ds,side_by_side_metadata:fe,frontendUUID:Be=crypto.randomUUID(),alwaysSearchOverride:Fe,overrideNoSearch:ct,cometIsMissionControl:it,refinementFiltersMetadata:kt,browserAgentAllowOnceFromToggle:zn,forceEnableBrowserAgent:cr,canonicalPageContext:Wn})=>{if(Ee.trim().length===0&&!c){Z.error("Submit failed: empty query");return}const Xn=lc.filter(Jt=>Jt.type==="tab").map(Jt=>({id:Number(Jt.id),url:Jt.url}));if(!L&&!p&&!S.unlimitedProSearch){const Jt=H+1;m&&!By()?Jt%Rwe===1&&U("visitor-gate"):Jt%Nwe===0?U("visitor-gate-ii"):Jt%Awe===0&&U("visitor-gate")}const Wr=!!$e,Ms=[...new Set([...Le??[]])].slice(0,we).filter(Jt=>!pt?.includes(Jt)),wu=!0,cc=An()&&wu,dm=cc?ua():void 0,v0=(ve??v)||wu,b0="copilot";let Zr=w??ie.DEFAULT;Zr===ie.DEFAULT&&S.unlimitedProSearch&&(Zr=ie.PRO),(h===oe.RESEARCH||h===oe.STUDIO||h===oe.STUDY)&&(Zr=h===oe.RESEARCH?ie.ALPHA:h===oe.STUDIO?ie.BETA:ie.STUDY,re&&ce&&(Zr=w));const fs=b1e.some(Jt=>Jt.is_reasoning_model&&Jt.search_model===Zr);Je?Zr=Je:(b(fs),fs||_(null));const Cu=Dwe(Wr,Nt??!1,E?.backend_uuid===Ae,Ot??null,T?.backend_uuid??null);kfe(),Mfe(()=>{o("resurrected activated"),se()}),an(Zr)===oe.RESEARCH?Tfe():an(Zr)===oe.STUDIO&&Afe();const gi=!!Cu,yi=E?.frontend_context_uuid===ht,fm=Ewe({isFollowup:gi,isInSameThread:yi,sourcesOverride:Ct,firstResultSources:E?.sources?.sources,firstResultRecency:E?.search_recency_filter,defaultSources:y??[],defaultRecency:x??null}),{finalRecency:_0,finalSources:w0}=fm;let mm;ae.mcpTools&&(mm=Object.entries(ae.mcpTools).filter(([Jt])=>!X?.has(Jt)).flatMap(([Jt,ku])=>{const M0=ae.mcpToolsSettings?.[Jt]??{};return ku.filter(uc=>{const T0=uc.tool?.name??uc.id??"",hm=M0[T0];return hm?hm.enabled!==!1:!0})}));const C0=wwe({inPage:pe??Pt})||c,Su=(C0?Mwe(Ee,C0):Ee).trim();if(!Su){Z.error("Submit failed: empty query");return}const xi=Ae==E?.backend_uuid||!Cu,S0=w0e({rawQuery:Su,fork:Nt,existingEntryUUID:Ae,existingUuid:We,collection:gt,isRelatedQuery:Me,newFrontendContextUUID:$e,existingFrontendContextUUID:ht,submitFromArticleOverride:Ot,isNavSuggestionsDisabled:tr,isCopilot:v0,modelPreferenceSubmit:Zr,newAttachments:Ms,firstResultFrontendContextUUID:E?.frontend_context_uuid,isPersonalized:I,forceNew:Wr,querySource:dt,lastResultBackendUUID:T?.backend_uuid,finalSources:w0,finalRecency:_0??void 0,uuid:Be,threadMetadataTitle:E?.thread_title,threadMetadataThreadUrlSlug:E?.thread_url_slug,side_by_side_metadata:fe}),Eu=mwe({redoSearch:Gt,collection:gt,dslQuery:Ke,isRelatedQuery:Me,isSponsored:Ve,relatedQueryUUID:lt,inDomain:xt,inPage:Pt,newFrontendContextUUID:$e,promptSource:Zt,querySource:dt,timeFromFirstType:Qt,utmSource:lr,disableWidgets:Qr,isNavSuggestionsDisabled:tr,isWindowsApp:f,isIncognito:Qo??G,modelPreferenceSubmit:Zr,clientPayloadUUID:dm,lastBackendUUID:Cu,deviceLocation:bn=bn??i,newAttachments:Ms,threadMetadataRwToken:C,forceNew:Wr,finalSources:w0,finalRecency:_0,mode:b0,frontendUUID:Be,entropyBrowser:a,existingEntryUUID:Ae,deletedUrls:pt,browserHistorySummaryNumDays:me,mentions:lc,side_by_side_metadata:fe,reason:n,skipSearchEnabled:O,browserHistorySummaryMaxResults:ue,sidecarTabId:ae.sidecarSourceTab.tabId,sidecarTitle:ae.sidecarSourceTab.title,sidecarUrl:ae.sidecarSourceTab.url,sidecarSecondaryTabId:ae.sidecarSourceTab.secondaryTab?.tabId,sidecarSecondaryUrl:ae.sidecarSourceTab.secondaryTab?.url,sidecarSecondaryTitle:ae.sidecarSourceTab.secondaryTab?.title,isFirstEntry:xi,alwaysSearchOverride:Fe,overrideNoSearch:ct,cometIsMissionControl:it,mcpTools:mm,refinementFiltersMetadata:kt,browserAgentAllowOnceFromToggle:zn,forceEnableBrowserAgent:cr,canonicalPageContext:Wn,inlineMode:void 0,isMobile:m});$e&&ye(Su,Eu,Eu.frontend_uuid),u(null);const E0={params:{...Eu,version:ql},query_str:Su};function k0(Jt){if(Xr){if(qt.isStatusFailed(Jt))throw new Ol("STREAM_FAILED_FIRST_CHUNK_ERROR",{message:"failed status on first message",details:{request_id:Jt.frontend_uuid??"unknown",backend_uuid:Jt.backend_uuid}});if(!Jt.thread_url_slug)throw new Ol("STREAM_FAILED_FIRST_CHUNK_ERROR",{message:"thread_url_slug is required on first message",details:{request_id:Jt.frontend_uuid??"unknown",backend_uuid:Jt.backend_uuid}});Xr(Jt.thread_url_slug)}nr&&r.push(`/search/${Jt.thread_url_slug}`)}const pm=ee(E0,{onFirstMessageReceived:k0,placeholderChunk:{...S0,backend_uuid:Ae||cH},timer:ds?g():Wa(void 0,{nowFromTimeOrigin:performance.now()}),reason:n});cc&&dm&&rV({clientPayloadCacheKey:dm,cometBrowser:a,maxChars:$,attachedTabs:Xn,includeSidecar:wu,reason:n,cometState:ae,requestId:pm.id.description}),k(pm.id.description)},[c,L,p,S.unlimitedProSearch,we,v,w,h,E?.backend_uuid,E?.frontend_context_uuid,E?.sources?.sources,E?.search_recency_filter,E?.thread_title,E?.thread_url_slug,T?.backend_uuid,y,x,ae,I,f,G,i,C,a,me,O,ue,ee,g,k,H,m,U,re,ce,b,_,o,se,X,ye,r,$]),ke=d.useCallback(Ee=>{bwe({response:Ee,isUserLoggedIn:L,submissionCount:H,session:s??void 0,queryCountMobile:M,isWindowsApp:f,addKeyRequiringRerender:U,setSubmissionCount:Q,setShouldShowProductFeedback:D,setShouldShowRecruitmentBanner:F,setFeedbackEntryUUID:P,trackEvent:o,sendQueryEventSingular:Y,maybeSendNthQueryEventSingular:te,recruitmentBannerEnabled:le,reason:n})},[U,L,f,M,Y,te,s,H,o,le]),De=j4(),xe=xz(),Ue=d.useCallback(async()=>{const Ee=T?.backend_uuid;!Ee||!C||(o("delete last result",{entryUUID:Ee}),await de.DELETE("/rest/entry/delete-ask-entry/{entry_uuid}",n,{params:{path:{entry_uuid:Ee}},body:{read_write_token:C}}),xe(Ee),De(Ke=>{if(!Ke)return;const Nt=Ke??[];if(Nt.length<1){r.push("/",void 0,"Delete last result");return}return Nt.slice(0,-1)}))},[T?.backend_uuid,C,o,De,xe,r]);return l.jsx(Xz.Provider,{value:{submitQuery:_e,deleteLastResult:Ue,shouldShowProductFeedback:N,feedbackEntryUUID:R,quote:c,setQuote:u,shouldShowRecruitmentBanner:j,updateLocalStatePostStream:ke},children:e})},Ho=()=>{const e=d.useContext(Xz);if(!e)throw new Error("usePerplexityQueryState must be used within PerplexityQueryStateContext");return e},q4="comet_mcp_";function Ja(e){return e.startsWith(q4)}function Df(e){return e.replace(q4,"")}function Zz(e){return`${q4}${e}`}const K4=({enabled:e=!0}={})=>{const n=Ea({reason:"use-source-limits",enabled:e}),r=Yt(),s=d.useCallback(i=>{if(Ja(i))return{monthlyLimit:1/0,remaining:1/0};const{monthly_limit:c=0,remaining:u=0}=n.sources.source_to_limit[i]??{};return{monthlyLimit:c??1/0,remaining:u??1/0}},[n.sources.source_to_limit]),o=d.useCallback(i=>{const{remaining:c=0}=s(i);return c===0},[s]),a=d.useCallback(async()=>{if(Object.values(n.sources.source_to_limit).some(({monthly_limit:c})=>c!==null)){if(!e){r.invalidateQueries({queryKey:iu()});return}await n.refetch()}},[n,e,r]);return d.useMemo(()=>({getSourceLimit:s,getSourceLimited:o,checkSourceLimits:a}),[s,o,a])};function Zl(e){const t=d.useRef(void 0);return d.useEffect(()=>{t.current=e},[e]),t.current}const Y4="pplx.activeQuery";function Jz(){const e=_a.getItem(Y4);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Iwe(e){_a.setItem(Y4,JSON.stringify(e))}function Pwe(){_a.removeItem(Y4)}const eW=Yh("QueryInputStateContext",()=>Xi(e=>({userInput:"",userInputJson:void 0,hasStartedTyping:!1,shouldTriggerFocus:!1,actions:{restoreInput:()=>{const t=Jz();t.rawQuery&&e({userInput:t.rawQuery,userInputJson:t.rawQueryJson})},setUserInput:(t,n)=>{e({userInput:t,userInputJson:n}),Iwe({rawQuery:t,rawQueryJson:n})},setHasStartedTyping:t=>e({hasStartedTyping:t}),setStartTypingTime:t=>e({startTypingTime:t}),resetInput:()=>{e({userInput:"",userInputJson:void 0}),Pwe()},markInputAsSubmitted:()=>{e({userInput:"",userInputJson:void 0,startTypingTime:void 0})},setShouldTriggerFocus:t=>{e({shouldTriggerFocus:t})}}}))),Owe=eW.Provider,jf=eW.useSelector,tW=A.memo(()=>{const{setUserInput:e,resetInput:t}=Kx(),n=On(),r=Zl(n);return d.useLayoutEffect(()=>{const s=Jz();s.rawQuery&&e(s.rawQuery,s.rawQueryJson)},[e]),d.useLayoutEffect(()=>{!r||r===n||r==="/"&&n?.startsWith("/search/new")||r.startsWith("/search/new")&&n?.startsWith("/search")||r.startsWith("/search/new")&&n==="/"||t()},[n,r,t]),null});tW.displayName="QueryInputSideEffects";const nW=()=>jf(e=>e.userInput),rW=()=>jf(e=>e.userInputJson),sW=()=>jf(e=>e.hasStartedTyping),Lwe=()=>jf(e=>e.startTypingTime),Fwe=()=>jf(e=>e.shouldTriggerFocus),Kx=()=>jf(e=>e.actions);var as;(function(e){e[e.NONE=0]="NONE",e[e.READER=1]="READER",e[e.WRITER=2]="WRITER",e[e.EDITOR=5]="EDITOR",e[e.ADMIN=3]="ADMIN",e[e.OWNER=4]="OWNER",e[e.OWNER_DEFAULT_BOOKMARKS=6]="OWNER_DEFAULT_BOOKMARKS",e[e.INVITED_READER=11]="INVITED_READER",e[e.INVITED_WRITER=12]="INVITED_WRITER",e[e.INVITED_EDITOR=15]="INVITED_EDITOR",e[e.INVITED_ADMIN=13]="INVITED_ADMIN"})(as||(as={}));function Bwe(){return[as.INVITED_READER,as.INVITED_WRITER,as.INVITED_EDITOR,as.INVITED_ADMIN]}function Svt(e){return e===as.OWNER||e===as.OWNER_DEFAULT_BOOKMARKS}function Evt(e){return e===as.OWNER_DEFAULT_BOOKMARKS}function kvt(e){return e>=as.WRITER&&e=as.READER&&e{const{DebugStreamSideEffects:e}=await Se(()=>q(()=>import("./DebugStreamSideEffects-CY-uK-QQ.js"),__vite__mapDeps([123,4,1,8,3,9,6,7,124,125,10,11,12])));return{default:e}},{restricted:!0}),oW=A.memo(function(){const t="stream-side-effects",n=Rn(),r=An(),{session:s}=Ne(),{trackEvent:o}=Xe(s),{$t:a}=J(),i=OU(globalThis.navigator?.userAgent),{sendNotification:c}=jve({windowsAppOnly:!1}),u=Kz(),f=Fve(),{addKeyRequiringRerender:m}=r4(),p=Ga(),h=un(),g=Do(),y=typeof window<"u"&&(window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants")),{fileRepoInfo:x}=zx({reason:t}),{firstResult:v}=on(),b=v?.thread_url_slug,{data:_}=jz({fileRepoInfo:x,fileName:b??"",reason:t}),{saveThreadToSpace:w}=Z_e({fileRepoInfo:x,fileExists:_??!0,reason:t}),S=R4(),{resetInput:C,restoreInput:E}=Kx(),T=nW(),k=d.useRef(T);k.current=T;const I=i_e({reason:t}),M=Yt(),N=Ive(),{updateLocalStatePostStream:D}=Ho(),{checkSourceLimits:j}=K4({enabled:!1});return d.useLayoutEffect(()=>sr.on("created",async({stream:F,query:R,params:P})=>{if(F.isReconnect||!R||!P)return;if(ey(P)&&P.side_by_side_metadata){const{experiment_role:O}=P.side_by_side_metadata;if(!Qbe(O))return}const L=Us(),U=T_(i,p.erp);uxe(F.id,{name:"perplexity_ask",queryStr:R,queryParams:P,isFollowup:ey(P)&&(P.query_source==="followup"||P.query_source==="followup-sidecar"||P.query_source==="followup-mobile-sidecar"),isPerplexityBrowser:r,frontendUUID:P.frontend_uuid??"",session:s??void 0,browserVersion:L?.browser_version,source:U,connectors:I,mentions:"mentions"in P?P.mentions:[]}),h?.setTabProgress(!0),g&&h.sendThreadStatusToMobile({status:"working",streamId:F.id.description})}),[r,i,s,I,p.erp,h,g]),d.useLayoutEffect(()=>sr.on("progress",({stream:F,message:R})=>{const{blocks:P,status:L,telemetry_data:U}=R,O=P?.some(H=>!!H?.markdown_block?.chunks?.length),$=P?.some(H=>!!H?.web_result_block?.web_results?.length),G=P?.some(H=>!!H?.sources_mode_block?.rows?.length);if(U){const{has_displayed_search_results:H,has_first_output_token:Q,has_first_token:Y,has_widget_data:te,first_widget_type:se,country:ae,is_followup:X,source:ee,engine_mode:le,search_implementation_mode:re,has_useful_renderable_content:ce,region:ue}=U,me={country:ae,is_followup:X,source:ee,engine_mode:le,search_implementation_mode:re,region:ue};H&&F.timer.addTimingOnce("web.frontend.first_search_results_latency_ms",me),Q&&F.timer.addTimingOnce("web.frontend.first_output_token_latency_ms",me),Y&&F.timer.addTimingOnce("web.frontend.first_token_latency_ms",me),te&&F.timer.addTimingOnce("web.frontend.first_widget_data_latency_ms",{...me,first_widget_type:se}),ce&&F.timer.addTimingOnce("web.frontend.first_useful_renderable_content_latency_ms",me)}rxe(F.id,{hasLLMToken:O,hasSearchResults:$,hasSources:G},{id:s?.user?.id,subscription_status:s?.user?.subscription_status}),L===Pr.FAILED&&Z.error(new Ol("STREAM_FAILED_CHUNK_ERROR",{details:{request_id:F.id.description,backend_uuid:F.entryId??"unknown"}}),{message:R})}),[s?.user?.id,s?.user?.subscription_status]),d.useLayoutEffect(()=>sr.on("progress",({stream:F,isFirstMessage:R})=>{R&&F.placeholderChunk&&F.placeholderChunk.query_source&&!k.current&&C()}),[C]),d.useLayoutEffect(()=>sr.on("completed",({stream:F})=>{const R=Ga(),P=T_(i,R.erp);zR(F.id,{name:"SUCCESSFUL response",session:s??void 0,source:P})}),[s,i]),d.useLayoutEffect(()=>{const F=({thread:P,message:L})=>{L&&S(L,P)},R=[sr.on("progress",F),sr.on("completed",F),sr.on("error",F),sr.on("aborted",F)];return()=>{R.forEach(P=>P())}},[S]),d.useLayoutEffect(()=>sr.on("completed",({stream:F,thread:R})=>{if(!F.threadId||!F.entryId)return;const P=R?.find(U=>U?.uuid===F.id.description||U?.backend_uuid===F.entryId);let L;an(P?.display_model)===oe.RESEARCH?L=a({defaultMessage:"Your report is ready",id:"CEIDgftq5U"}):an(P?.display_model)===oe.STUDIO&&(L=a({defaultMessage:"Your project is ready",id:"UXOU5ST+Nc"})),Hwe({lastResponse:P,backend_uuid:F.entryId,trackEvent:o,sendNotification:c,notificationText:L,cometAdapter:h,isMissionControl:y})}),[a,o,c,h,y]),d.useLayoutEffect(()=>sr.on("completed",async({stream:F})=>{!b||!F.entryId||_&&await w(F.entryId,b)}),[_,w,b]),d.useLayoutEffect(()=>{const F=({stream:L})=>{const{id:U}=L,O=Ga(),$=T_(i,O.erp),Q=new URL(window.location.href).pathname.replace("/search/new/","");zR(U,{name:"FAILED response",session:s??void 0,source:$}),Q===U.description&&(E(),n.replace(`/?error=${wd.ThreadStreamError}`,"StreamSideEffects")),h?.setTabProgress(!1)},R=sr.on("error",F),P=sr.on("aborted",F);return()=>{R(),P()}},[s,i,E,n,h]),d.useLayoutEffect(()=>sr.on("created",({query:F,params:R,stream:{isReconnect:P,id:L}})=>{if(!(!F||!R||P||!ey(R))){if(r){u(F,{model_preference:R.model_preference,last_backend_uuid:"last_backend_uuid"in R?R.last_backend_uuid:void 0,sources:R.sources,override_no_search:R.override_no_search},L.description);return}f({query:F,params:R,reason:"streamEvents.on(created)"})}}),[u,f,r]),d.useEffect(()=>{if(!r)return;const F=[sr.on("completed",({stream:R})=>{h.cleanupTasks(R.entryId,"stream_completed"),g&&h.sendThreadStatusToMobile({status:"ready",streamId:R.id.description})}),sr.on("aborted",({stream:R})=>{h.cleanupTasks(R.entryId,"stream_aborted"),g&&h.sendThreadStatusToMobile({status:"ready",streamId:R.id.description})}),sr.on("error",({stream:R,message:P})=>{(P&&!P.reconnectable||R.abortController?.signal.aborted)&&h.cleanupTasks(R.entryId,"stream_error"),g&&h.sendThreadStatusToMobile({status:"error",streamId:R.id.description})})];return()=>{F.forEach(R=>R())}},[h,g,r]),d.useEffect(()=>sr.on("completed",async({message:F,thread:R})=>{if(!F||(D(F),F.collection_info?.slug&&M.invalidateQueries({queryKey:v4(F.collection_info.slug),exact:!1}),N(),j(),ewe(F.thread_url_slug)))return;const P=!!F.parent_info,L=R.findIndex(U=>U.uuid===F.uuid)>0;(P||!L)&&(m("floating-signup"),M.invalidateQueries({queryKey:Lx(),refetchType:"all"}))}),[M,i,m,N,D,j]),null});oW.displayName="StreamSideEffects";const aW=A.memo(function(){const{pendingTasks:t,navigationMeta:n}=Qn();return l.jsx(Vwe,{pendingTasks:t,navigationMeta:n})});aW.displayName="DebugStreamSideEffects";function Hwe({lastResponse:e,backend_uuid:t,trackEvent:n,notificationText:r,sendNotification:s,cometAdapter:o,isMissionControl:a}){if(!t)return Z.error(new Error("No backend_uuid found in response")),!1;if(!e)return Z.error(new Error("No last response found in query client")),!1;if((an(e.display_model)===oe.RESEARCH||an(e.display_model)===oe.STUDIO)&&r&&s&&document.visibilityState!=="visible"&&s({title:r,body:e.query_str,onClick:()=>{window.focus()}}),e.blocks){e.blocks.filter(c=>c.intended_usage?.endsWith("_markdown")).forEach(c=>{c.markdown_block?.media_items&&n&&c.markdown_block.media_items.forEach(u=>{n("inline image rendered",{image_url:u.image,entryUUID:t})})});const i=e.blocks.find(c=>c.intended_usage==="knowledge_cards")?.knowledge_card_block?.knowledge_cards?.[0];i&&n&&n("knowledge card in results",{entryUUID:t,name:i.title,id:i.id,type:i.card_type})}return o?.setTabProgress(!1),a||o?.showNotification(),!0}var Mn;(function(e){e.MACOS="macos",e.WINDOWS="windows"})(Mn||(Mn={}));var qn;(function(e){e.NEW_THREAD="NEW_THREAD",e.STOP_GENERATING="STOP_GENERATING",e.TOGGLE_INCOGNITO="TOGGLE_INCOGNITO",e.SHOW_SHORTCUTS="SHOW_SHORTCUTS",e.FOCUS_ASK_INPUT="FOCUS_ASK_INPUT",e.TOGGLE_DICTATION="TOGGLE_DICTATION",e.TOGGLE_V2V="TOGGLE_V2V"})(qn||(qn={}));const Nvt="keyboard-shortcuts",zwe=(e,t,n=!1)=>[{type:qn.NEW_THREAD,label:e.formatMessage({defaultMessage:"New Thread",id:"76XSxT3hV8"}),macos:["⌘","K"],windows:t?["Ctrl","Shift","P"]:["Ctrl","I"],editable:!0,global:!0},{type:qn.TOGGLE_V2V,label:e.formatMessage({defaultMessage:"Toggle Voice Mode",id:"ulahVrf1h4"}),macos:["⌘","Shift","B"],windows:["Ctrl","Shift","B"],editable:!0,global:!0,requiresAuth:!0,windowsAppOnly:!0},{type:qn.TOGGLE_DICTATION,label:e.formatMessage({defaultMessage:"Toggle Voice Dictation",id:"tWip/8rlIv"}),macos:["⌘","D"],windows:["Ctrl","D"],editable:!1,windowsAppOnly:!0},{type:qn.TOGGLE_INCOGNITO,label:e.formatMessage({defaultMessage:"Toggle Incognito",id:"YNMg3vd9IG"}),macos:["⌘",";"],windows:["Ctrl",";"],editable:!1},{type:qn.SHOW_SHORTCUTS,label:e.formatMessage({defaultMessage:"Show Shortcuts",id:"8o6rUVckYq"}),macos:["⌘","/"],windows:["Ctrl","/"],editable:!1},{type:qn.FOCUS_ASK_INPUT,label:e.formatMessage({defaultMessage:"Focus Ask Input",id:"RP5ybIk9wM"}),macos:["⌘","J"],windows:["Ctrl","J"],editable:!1}].filter(s=>(!s.requiresAuth||n)&&(!s.windowsAppOnly||t)),Wwe={Meta:"⌘",Shift:"⇧",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Enter:"⏎",Period:".",Semicolon:";",Slash:"/",Escape:"Esc"},Gwe={"⌘":"Meta","⇧":"Shift","↑":"ArrowUp","↓":"ArrowDown","←":"ArrowLeft","→":"ArrowRight","⏎":"Enter"},$we=(e,t=Mn.MACOS)=>e==="Meta"?t===Mn.WINDOWS?"Win":"⌘":Wwe[e]||e,i9=e=>e==="Win"?"Meta":Gwe[e]||e,sg=({reason:e})=>{const{connectorsMap:t}=Af({reason:e});return d.useMemo(()=>({isAllowed:n=>!!t[n],isConnected:n=>t[n]?.connected===!0,getConnectionType:n=>t[n]?.connection_type??null}),[t])},qwe=["web","scholar","social","edgar","org","my_files"],Wi=e=>qwe.includes(e),Yx={web:{type:"web",icon:B("world"),label:e=>e.formatMessage({defaultMessage:"Web",id:"B6CB3748fZ"}),description:e=>e.formatMessage({defaultMessage:"Search across the entire Internet",id:"L+Gw+J7uDs"})},scholar:{type:"scholar",icon:B("school"),label:e=>e.formatMessage({defaultMessage:"Academic",id:"mbxIJyT8C5"}),description:e=>e.formatMessage({defaultMessage:"Search academic papers",id:"IVRQQmrqTD"})},social:{type:"social",icon:B("social"),label:e=>e.formatMessage({defaultMessage:"Social",id:"qOLogguG/7"}),description:e=>e.formatMessage({defaultMessage:"Discussions and opinions",id:"g9xPuArp4v"})},edgar:{type:"edgar",icon:B("report-money"),label:()=>Dhe,description:e=>e.formatMessage({defaultMessage:"Search SEC filings",id:"7Xro7ObMcr"})},org:{type:"org",icon:B("files"),label:e=>e.formatMessage({defaultMessage:"Org files",id:"iWDsD738/m"}),description:e=>e.formatMessage({defaultMessage:"Search files from your organization",id:"Ak5CW53mGi"})},my_files:{type:"my_files",icon:B("file-export"),label:e=>e.formatMessage({defaultMessage:"My files",id:"bYbrKKlKgS"}),description:e=>e.formatMessage({defaultMessage:"Search my files",id:"EYmiG70whM"})}},Kwe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"connectors-direct-api-search",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Ywe="BYPASS",Qwe=()=>{const e=lu(),{variation:t}=Kwe(!1,{connectionType:Ywe}),n=d.useMemo(()=>({web:!0,scholar:!0,social:!0,edgar:!0,org:e,my_files:t&&e}),[e,t]),r=d.useCallback(s=>n[s],[n]);return d.useMemo(()=>({isAllowed:r}),[r])},n2=e=>{switch(e){case"GOOGLE_DRIVE":return NM;case"ONEDRIVE":return DM;case"SHAREPOINT":return IM;case"DROPBOX":return OM;case"BOX":return LM;case"WILEY":return Rhe;case"GCAL":return CV;case"NOTION_MCP":return FM;case"LINEAR":case"LINEAR_ALT":return BM;case"SLACK":return UM;case"SLACK_DIRECT":return VM;case"GITHUB_MCP_DIRECT":return HM;case"ASANA_MCP_DIRECT":return Bd;case"ASANA_MCP_MERGE":return Bd;case"ATLASSIAN_MCP_DIRECT":return zM;case"JIRA_MCP_MERGE":return GM;case"CONFLUENCE_MCP_MERGE":return qM;case"MICROSOFT_TEAMS_MCP_MERGE":return YM;case"OUTLOOK":return TV;case"FACTSET":return gV;case"ZOOM":return XM;default:return""}},If=e=>{switch(e){case"crunchbase":return yV;case"factset":return hV;case"wiley":return Fd;case"google_drive":return AM;case"onedrive":return RM;case"sharepoint":return jM;case"gcal":return wx;case"dropbox":return PM;case"box":return Cx;case"gmail":return wV;case"notion_mcp":return Sx;case"outlook":return QM;case"linear":case"linear_alt":return Ex;case"slack":case"slack_direct":return kx;case"github_mcp_direct":return Mx;case"asana_mcp_direct":case"asana_mcp_merge":return Tx;case"atlassian_mcp_direct":return Ax;case"jira_mcp_merge":return WM;case"confluence_mcp_merge":return $M;case"microsoft_teams_mcp_merge":return KM;case"wiley_mcp_cashmere":return Fd;case"cbinsights_mcp_cashmere":return kM;case"pitchbook_mcp_cashmere":return MM;case"statista_mcp_cashmere":return TM;case"zoom":return ZM;default:return null}};function Rvt(e){if(e===0)return"0 bytes";const t=1024,n=["bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.ceil(e/Math.pow(t,r))+" "+n[r]}const iW=e=>{if(!e)return;const t=e.lastIndexOf(".");if(!(t<=0||t===e.length-1))return e.substring(t+1).toLowerCase()},Xwe=200,b3=(e,t={})=>{const{maxLength:n=Xwe,replacement:r=" ",fallback:s="file"}=t;if(!e)return s;const o=e.lastIndexOf("."),a=o>0&&o|]/g,r).trim(),i||(i=s),i.length+c.length>n){const u=n-c.length;if(u>0)i=i.substring(0,u).trim();else return s+c}return i+c},Dvt=e=>{const t=e.file_metadata.file_type;return t==="FOLDER"||t==="DATABASE"||t==="WORKSPACE"||t==="PAGE"};function jvt(e){const t=e.file_metadata.file_type;return t==="FOLDER"||t==="DATABASE"||t==="WORKSPACE"?B("folder-filled"):B("file")}const Zwe=e=>{switch(e){case"GOOGLE_DRIVE":return AM;case"ONEDRIVE":return RM;case"SHAREPOINT":return jM;case"DROPBOX":return PM;case"BOX":return Cx;case"GCAL":return wx;case"NOTION_MCP":return Sx;case"OUTLOOK":return QM;case"LINEAR":case"LINEAR_ALT":return Ex;case"SLACK":case"SLACK_DIRECT":return kx;case"GITHUB_MCP_DIRECT":return Mx;case"ASANA_MCP_DIRECT":case"ASANA_MCP_MERGE":return Tx;case"ATLASSIAN_MCP_DIRECT":return Ax;case"JIRA_MCP_MERGE":return WM;case"CONFLUENCE_MCP_MERGE":return $M;case"MICROSOFT_TEAMS_MCP_MERGE":return KM;case"ZOOM":return ZM;default:return null}},Jwe={crunchbase:"crunchbase",factset:"factset",wiley:"wiley",google_drive:"google_drive",onedrive:"onedrive",sharepoint:"sharepoint",gcal:"gcal",dropbox:"dropbox",box:"box",notion_mcp:"notion_mcp",outlook:"outlook",linear:"linear",linear_alt:"linear_alt",slack:"slack",slack_direct:"slack_direct",github_mcp_direct:"github_mcp_direct",asana_mcp_direct:"asana_mcp_direct",asana_mcp_merge:"asana_mcp_merge",atlassian_mcp_direct:"atlassian_mcp_direct",jira_mcp_merge:"jira_mcp_merge",confluence_mcp_merge:"confluence_mcp_merge",microsoft_teams_mcp_merge:"microsoft_teams_mcp_merge",wiley_mcp_cashmere:"wiley_mcp_cashmere",cbinsights_mcp_cashmere:"cbinsights_mcp_cashmere",pitchbook_mcp_cashmere:"pitchbook_mcp_cashmere",statista_mcp_cashmere:"statista_mcp_cashmere",zoom:"zoom",edgar:"edgar"},uu=e=>Object.keys(Jwe).includes(e)||e==="gmail",_3=e=>{switch(e){case"crunchbase":return yV;case"factset":return hV;case"wiley":return Fd;case"google_drive":return AM;case"onedrive":return RM;case"sharepoint":return jM;case"gcal":return wx;case"dropbox":return PM;case"box":return Cx;case"gmail":return wV;case"notion_mcp":return Sx;case"outlook":return QM;case"linear":case"linear_alt":return Ex;case"slack":case"slack_direct":return kx;case"github_mcp_direct":return Mx;case"asana_mcp_direct":case"asana_mcp_merge":return Tx;case"atlassian_mcp_direct":return Ax;case"jira_mcp_merge":return WM;case"confluence_mcp_merge":return $M;case"microsoft_teams_mcp_merge":return KM;case"wiley_mcp_cashmere":return Fd;case"cbinsights_mcp_cashmere":return kM;case"pitchbook_mcp_cashmere":return MM;case"statista_mcp_cashmere":return TM;case"zoom":return ZM;default:return null}},kc=e=>{switch(e){case"crunchbase":return Nhe;case"factset":return gV;case"google_drive":return NM;case"onedrive":return DM;case"sharepoint":return IM;case"gcal":return CV;case"dropbox":return OM;case"box":return LM;case"gmail":return jhe;case"notion_mcp":return FM;case"outlook":return TV;case"linear":case"linear_alt":return BM;case"slack":return UM;case"slack_direct":return VM;case"github_mcp_direct":return HM;case"asana_mcp_direct":return Bd;case"asana_mcp_merge":return Bd;case"atlassian_mcp_direct":return zM;case"jira_mcp_merge":return GM;case"confluence_mcp_merge":return qM;case"microsoft_teams_mcp_merge":return YM;case"wiley_mcp_cashmere":return xV;case"cbinsights_mcp_cashmere":return vV;case"pitchbook_mcp_cashmere":return bV;case"statista_mcp_cashmere":return _V;case"zoom":return XM;default:return e}},eCe=e=>{switch(e){case"GOOGLE_DRIVE":return NM;case"ONEDRIVE":return DM;case"SHAREPOINT":return IM;case"DROPBOX":return OM;case"BOX":return LM;case"NOTION_MCP":return FM;case"LINEAR":case"LINEAR_ALT":return BM;case"SLACK":return UM;case"SLACK_DIRECT":return VM;case"GITHUB_MCP_DIRECT":return HM;case"ASANA_MCP_DIRECT":return Bd;case"ASANA_MCP_MERGE":return Bd;case"ATLASSIAN_MCP_DIRECT":return zM;case"JIRA_MCP_MERGE":return GM;case"CONFLUENCE_MCP_MERGE":return qM;case"MICROSOFT_TEAMS_MCP_MERGE":return YM;case"ZOOM":return XM;default:return""}},Ivt=(e,t)=>new Date(e+"Z").toLocaleString(t,{month:"numeric",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}),Pvt=(e,t,n)=>{switch(e){case"RECEIVED":case"QUEUED":case"RATE_LIMITED":return{label:t.formatMessage({id:"Cnm0QAkWnp",defaultMessage:"Queued"})};case"SYNCING":return{label:t.formatMessage({id:"eOnwqs6QFY",defaultMessage:"Syncing"})};case"EVALUATING_RESYNC":case"READY":return{label:t.formatMessage({id:"IZFEUgrg25",defaultMessage:"Ready"})};case"SYNC_ERROR":return tCe(n,t)}},tCe=(e,t)=>{if(!e)return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"An unknown error occurred while syncing this file",id:"FrOCoiVasC"})};switch(e){case"INVALID_FILE_SIZE":return{label:t.formatMessage({id:"fTNSna6r/X",defaultMessage:"File too large"}),description:t.formatMessage({defaultMessage:"File size exceeds the maximum allowed limit",id:"NTNLSYG0+u"}),suggestion:t.formatMessage({defaultMessage:"Try uploading a smaller file or contact support to increase your limit",id:"k2ucsfBcdH"})};case"INVALID_FILE_TYPE":return{label:t.formatMessage({id:"+FiyOTaUCW",defaultMessage:"Not supported"}),description:t.formatMessage({defaultMessage:"File type is not supported",id:"NMMfOTMPPN"}),suggestion:t.formatMessage({defaultMessage:"Check the list of supported file formats and convert your file if needed",id:"2zDaBv+l45"})};case"BAD_FILE":return{label:t.formatMessage({id:"+FiyOTaUCW",defaultMessage:"Not supported"}),description:t.formatMessage({defaultMessage:"File is corrupted or cannot be read",id:"2DRBESYiY3"}),suggestion:t.formatMessage({defaultMessage:"Try re-uploading the file or check if it opens correctly on your device",id:"XMnV6UR4G5"})};case"TOKEN_LIMIT_EXCEEDED":return{label:t.formatMessage({id:"t7EERfdOMB",defaultMessage:"Content too long"}),description:t.formatMessage({defaultMessage:"File content exceeds the token limit for processing",id:"S5ij+lXT2m"}),suggestion:t.formatMessage({defaultMessage:"Try splitting the file into smaller parts or contact support",id:"eu5ByuYBzE"})};case"FAILED_MODERATION":return{label:t.formatMessage({id:"+0cMy9/Uvq",defaultMessage:"Content policy violation"}),description:t.formatMessage({defaultMessage:"File content does not meet our content policy",id:"5+WSrKKHWX"}),suggestion:t.formatMessage({defaultMessage:"Review the file content and try again with appropriate content",id:"T+5YJmz9Uu"})};case"FILE_ALREADY_EXISTS":return{label:t.formatMessage({id:"rj9KIiC1cY",defaultMessage:"File already exists"}),description:t.formatMessage({defaultMessage:"A file with this name already exists",id:"v6hLP22U9C"}),suggestion:t.formatMessage({defaultMessage:"Rename the file or remove the existing file first",id:"lHS2xLoVfC"})};case"FAILED_TO_PARSE_FILE":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to process the file contents",id:"+JPkVmVP/P"}),suggestion:t.formatMessage({defaultMessage:"This is likely a temporary issue. Try resyncing the file.",id:"x2TrdA7gdq"})};case"FAILED_TO_INDEX_FILE":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to index the file for search",id:"VZXlZSjnzh"}),suggestion:t.formatMessage({defaultMessage:"This is likely a temporary issue. Try resyncing the file.",id:"x2TrdA7gdq"})};case"FILE_DOWNLOAD_ERROR":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Unable to download the file from the source",id:"WQEt2fv0+0"}),suggestion:t.formatMessage({defaultMessage:"Check your connection permissions and try resyncing",id:"oMx/8oRlEl"})};case"RATE_LIMIT_RETRIES_EXCEEDED":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Rate limit exceeded after multiple retries",id:"x/gkqQmJpB"}),suggestion:t.formatMessage({defaultMessage:"Please wait a few minutes and try resyncing the file",id:"9178BZbGzP"})};case"AUTOSYNC_FAILED":return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"Automatic sync failed",id:"W/IGnlqOCp"}),suggestion:t.formatMessage({defaultMessage:"Try manually resyncing the file",id:"t77201iPJg"})};default:return{label:t.formatMessage({id:"N1cqoEe4CZ",defaultMessage:"Sync error"}),description:t.formatMessage({defaultMessage:"An error occurred while syncing this file",id:"layd6ZWzub"})}}},lW=(e,t)=>{if(t==="WILEY")return n2(t);if(t||e.is_memory||e.is_conversation_history)return e.name&&e.name.trim()?e.name:void 0},cW=e=>e.isFile,uW=e=>e.isDirectory,nCe=async(e,t=yhe)=>{const n=[e],r=[];for(;n.length>0;){const s=n.pop();if(s){if(cW(s)){const o=await new Promise(a=>{s.file(a)});if(r.push(o),r.length>t)return r}else if(uW(s)){const o=s.createReader(),a=await new Promise(i=>o.readEntries(i));n.push(...a)}}}return r},rCe=e=>e?e.toLowerCase().replace(/[\s-]/g,"_").replace(/([a-z])([A-Z])/g,"$1_$2").replace(/^_+|_+$/g,"").replace(/_+/g,"_"):"",dW=e=>e.replace(/_/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase()),Q4=e=>{if(!e)return null;try{const t=parseInt(e,16);return String.fromCodePoint(t)}catch{return null}},sCe=(e,t=60)=>{if(e.length<=t)return e;const n="…",r=t-n.length,s=Math.ceil(r/2),o=Math.floor(r/2);return e.substring(0,s)+n+e.substring(e.length-o)},fW=({cometMcpSources:e})=>{const t=J();return d.useCallback(r=>{const s=dW(r);if(Wi(r))return Yx[r].label(t);if(Ja(r)){const o=Df(r);return e[o]?.text??o}return uu(r)?kc(r)??s:s},[t,e])},oCe=(e,{getSourceLabel:t})=>e.sort((n,r)=>{const s=t(n),o=t(r);return s.localeCompare(o)}),aCe=e=>e.sort((t,n)=>{const r=Wi(t),s=Wi(n);return r&&!s?-1:!r&&s?1:0}),iCe=e=>e.sort((t,n)=>t==="web"&&n!=="web"?-1:t!=="web"&&n==="web"?1:0),lCe=["space","sports","my_files"];function mW(e){return lCe.includes(e)}const cCe=[oCe,aCe,iCe],X4=({isConnectorAllowed:e,omittedSources:t=[],omitCometMcpSources:n=!1})=>{const{cometMcpSources:r}=Nf(),s=fW({cometMcpSources:r}),{isAllowed:o}=Qwe(),a=d.useCallback(u=>{const f=Df(u);return Object.keys(r).includes(f)},[r]),i=d.useCallback(u=>mW(u)||t.includes(u)?!1:Wi(u)?o(u):uu(u)?e(u):Ja(u)?n?!1:a(u):(Hc.error(`[useSources] Unknown source type: ${u}`),!1),[e,a,o,t,n]),c=d.useMemo(()=>{const u=Object.keys(r).map(m=>Zz(m)).filter(Ja).filter(i),f=Object.keys(E4).filter(ha).filter(i);return cCe.reduce((m,p)=>p(m,{getSourceLabel:s}),[...f,...u])},[i,r,s]);return d.useMemo(()=>({sources:c,isSourceAllowed:i}),[c,i])};function og({defaultSource:e,reason:t}){const{sources:n,setSources:r,setRecency:s}=Vn(),o=fn(),{fileRepoInfo:a}=zx({reason:t}),{isLoading:i}=mo({reason:t}),{device:{isWindowsApp:c}}=sn(),{safeWindowsIpcPublish:u,safeWindowsIpcSubscribe:f}=Xh(),{isAllowed:m}=sg({reason:t}),{sources:p}=X4({isConnectorAllowed:m}),h=a.file_repository_type==="COLLECTION",g=h?`space-${a.owner_id}`:"home",y=ou(),x=Array.isArray(y?.slug)?y.slug[0]:y?.slug,{collection:v,isLoading:b}=O4({collectionSlug:x,reason:t}),_=b?void 0:v?.enable_web_by_default,w=d.useRef(f);d.useEffect(()=>{w.current=f},[f]);const S=d.useRef(Math.random().toString(36).substring(7)),C=d.useCallback(N=>{let D=[];return n?.includes(N)?(D=n.filter(j=>j!==N),N==="web"&&(n.includes("crunchbase")&&(D=n.filter(j=>j!=="crunchbase"&&j!=="web")),s?.(null))):(D=[...n||[]],N==="crunchbase"&&!D.includes("web")&&D.push("web"),D.push(N)),h&&M_(D,g),r(D),c&&u(yl,{type:yl,sources:D,windowId:S.current}),D},[h,g,r,s,n,c,u]),E=d.useCallback(N=>{n?.includes(N)||C(N)},[n,C]),T=d.useCallback(N=>{n?.includes(N)&&C(N)},[n,C]),k=d.useCallback(N=>n?.includes(N)??!1,[n]),I=d.useCallback(N=>{const D=[...N];D.includes("crunchbase")&&!D.includes("web")&&D.push("web"),h&&M_(D,g),r(D),c&&u(yl,{type:yl,sources:D,windowId:S.current})},[h,c,g,u,r]);d.useEffect(()=>{if(!c)return;const N=w.current(yl,D=>{D.type===yl&&D.windowId!==S.current&&r(D.sources)});return()=>{N?.()}},[c,r,n]);const M=d.useMemo(()=>{if(b)return new Set([]);if(h)return _?new Set(["web"]):new Set([]);if(e)return new Set([e]);const D=(o?.get("sources")??"web").split(",").map(j=>j.trim()).filter(ha);return new Set(D||["web"])},[h,b,_,o,e]);return d.useEffect(()=>{if(i)return;let N=h?B2e(g)||[...M]:[...M];if(h&&_&&!N.includes("web")?N.push("web"):h&&!_&&N.includes("web")&&(N=N.filter(j=>j!=="web")),JSON.stringify(n||[])!==JSON.stringify(N)){const j=N.filter(F=>p.includes(F));h&&M_(j,g),r(j)}},[i,h,_]),d.useMemo(()=>({DEFAULT_SOURCES:M,sources:n,isSpace:h,isSpaceEnableWebByDefault:_,toggleSource:C,setSources:r,addSource:E,removeSource:T,hasSource:k,overwriteSources:I}),[M,n,h,_,I,C,r,E,T,k])}const uCe=[];function pW({useThreadSources:e,reason:t="use-global-available-sources"}){const{sources:n,setSources:r}=og({reason:t}),{cometMcpSources:s,cometMcpDisabledServers:o,setCometMcpSources:a}=Nf(),{firstResult:i}=on(),c=i?.sources?.sources??uCe,u=d.useMemo(()=>e?c.filter(ha):n,[e,c,n]),f=d.useMemo(()=>{const g=Object.keys(s).filter(y=>!o?.has(y)).map(y=>Zz(y));return[...u,...g]},[u,s,o]),m=d.useCallback(g=>{const y=g.filter(Ja),x=g.filter(ha);a(y.map(v=>Df(v))),r(x)},[r,a]),p=d.useCallback(g=>{f.includes(g)||m([...f,g])},[f,m]),h=d.useCallback(g=>{f.includes(g)&&m(f.filter(y=>y!==g))},[f,m]);return{sources:f,setSources:m,addSource:p,removeSource:h}}const dCe=({reason:e})=>{const{safeWindowsIpcPublish:t}=Xh(),{device:{isWindowsApp:n}}=sn(),r=Wt(),{isPro:s}=$t(),{DEFAULT_SOURCES:o}=og({reason:e}),a=Ix(),i=d.useRef(t),{setIsIncognito:c}=G4();d.useEffect(()=>{i.current=t},[t]);const u=d.useCallback(()=>{No("/?voice-mode=true","Voice mode")},[]),f=d.useCallback(()=>{No("/?v2v=true","V2V mode")},[]),m=d.useCallback(g=>{const y=g.searchParams,x=y.get("q"),v=y.get("incognito"),_=(y.get("sources")??"").split(",").map(C=>C.trim()).filter(ha),w=y.get("search_mode"),S=w?x1e[w]:void 0;v!==null&&c(v==="true"),_&&t(yl,{type:yl,sources:_}),S?.model&&S?.mode&&t(nd,{type:nd,model:S.model,searchMode:S.mode}),x&&i.current(SV,{query:x,promptSource:"user",querySource:"windows-app-shortcut",incognitoOverride:v,sourcesOverride:_??[]})},[t,c]),p=d.useCallback(g=>{const y=g.searchParams,x=y.get("type"),v=y.get("callback");if(!x||!v)return;const b=x.split(","),_=new URLSearchParams;b.forEach(S=>{switch(S){case"sources":_.set("sources",Array.from(o).join(","));break;case"search-modes":_.set("search-modes",Object.values(oe).join(","));break;case"sign-in":_.set("sign-in",r?"true":"false");break;case"subscription":_.set("subscription",s?"true":"false");break}});const w=`${v}?${_.toString()}`;window.open(w,"_blank")},[r,s,o]),h=d.useMemo(()=>new Map([["voice-mode",u],["v2v",f],["search",g=>m(g)],["request",g=>p(g)]]),[u,f,m,p]);d.useEffect(()=>{if(!n||!a)return;const g=a.app.on("openProtocolURL",(x,v)=>{const b=new URL(v.url);for(const[_,w]of h)if(b.toString().includes(_)){v.preventDefault(),w(b);break}}),y=async()=>{await(await g)()};return()=>{y()}},[n,h,a])},w3="keyboard-shortcuts",fCe=(e,t)=>{const n={[qn.NEW_THREAD]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.STOP_GENERATING]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.TOGGLE_INCOGNITO]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.SHOW_SHORTCUTS]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.FOCUS_ASK_INPUT]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.TOGGLE_DICTATION]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]},[qn.TOGGLE_V2V]:{[Mn.MACOS]:[],[Mn.WINDOWS]:[]}},r=zwe(e,t);[qn.NEW_THREAD,qn.TOGGLE_V2V].forEach(s=>{const o=r.find(a=>a.type===s);o&&(n[s]={[Mn.MACOS]:o.macos,[Mn.WINDOWS]:o.windows})});try{const s=vt.getItem(w3);if(s){const o=JSON.parse(s);[qn.NEW_THREAD,qn.TOGGLE_V2V].forEach(a=>{const i=o.find(c=>c.type===a);i&&(n[a]={[Mn.MACOS]:i.macos,[Mn.WINDOWS]:i.windows})})}}catch(s){Z.warn("Error reading keyboard shortcuts:",s)}return n},mCe=(e,t)=>Xi(n=>({globalShortcuts:fCe(e,t),setShortcut:(r,s,o)=>n(a=>{const i={...a.globalShortcuts,[r]:{...a.globalShortcuts[r],[s]:o}};try{const c=vt.getItem(w3),f=(c?JSON.parse(c):[]).map(m=>m.type===r?{...m,[s]:o}:m);vt.setItem(w3,JSON.stringify(f))}catch(c){Z.warn("Error saving keyboard shortcuts:",c)}return{globalShortcuts:i}})}));let j_=null;const C3=e=>{const{device:{isWindowsApp:t}}=sn(),n=J();return j_||(j_=mCe(n,t)),j_(e)},pCe=()=>{const{handleShowPanel:e}=Px(),t=C3(c=>c.setShortcut),n=Ix(),r=C3(c=>c.globalShortcuts),s=d.useCallback(async()=>{if(!n)return;const c=await hW();if(!c)return;await n.nativeWindow.show({ref:c}),await n.nativeWindow.focus({ref:c});const u=new CustomEvent("toggleVoiceToVoice");document.dispatchEvent(u)},[n]),o=d.useCallback(async(c,u)=>{try{const f=Array.isArray(c)?c.join("+"):c;let m;switch(u){case qn.NEW_THREAD:m=e;break;case qn.TOGGLE_V2V:m=s;break;default:return Z.warn(`No handler registered for shortcut type: ${u}`),!1}return f&&f.trim()!==""&&await n?.globalShortcut.unregister(f),await n?.globalShortcut.register(f,m),!0}catch(f){return Z.warn("Error registering shortcut:",f),!1}},[e,s,n]),a=d.useCallback(async(c,u,f)=>{try{const m=c.join("+"),p=u.join("+");if(m===p)return;m&&m.trim()!==""&&await n?.globalShortcut.unregister(m),await o(p,f)&&t(f,Mn.WINDOWS,u)}catch(m){Z.error("Error updating global shortcut:",m)}},[o,t,n]),i=d.useCallback(async c=>{const u=c.join("+");u&&u.trim()!==""&&await n?.globalShortcut.unregister(u)},[n]);return d.useMemo(()=>({shortcuts:r,registerShortcut:o,updateGlobalShortcut:a,unregisterShortcut:i}),[o,r,i,a])},hW=wf(async()=>{const{object:e}=await q(async()=>{const{object:n}=await import("./index-DxZN0OQK.js");return{object:n}},[]);let t=await e.retrieve({id:"TJmK6yKBLiw389HLDdYy5"});return t||(t=await e.retrieve({id:"C195F2RyYDhfB93QW7vui"})),t}),hCe=({children:e})=>{const t="windows-app-provider-inner",{device:{isWindowsApp:n}}=sn(),r=On(),s=n&&!r?.includes(Yp),{submitQuery:o}=Ho(),{isCopilot:a}=Vn(),{createPanelWindow:i,handleHidePanel:c}=Px(),u=Wt(),f=Ix(),m=d.useRef(o),p=d.useRef(a),{safeWindowsIpcSubscribe:h}=Xh();d.useEffect(()=>{m.current=o},[o]),dCe({reason:t}),d.useEffect(()=>{p.current=a},[a]);const{shortcuts:g,registerShortcut:y,unregisterShortcut:x}=pCe();d.useEffect(()=>{s&&(i(),c())},[s,i,c]);const v=d.useCallback(async b=>{const _=async(E=500)=>{const T=new AbortController,k=setTimeout(()=>T.abort(),E);try{const I=new Promise(M=>{f?.nativeWindow.isVisible().then(N=>{if(N){clearTimeout(k),M(!0);return}f?.nativeWindow.on("show",()=>{clearTimeout(k),M(!0)})})});return await Promise.race([I,new Promise(M=>{T.signal.addEventListener("abort",()=>M(!1))})])}catch(I){return Z.warn("Error ensuring window is ready",{error:I}),!1}finally{clearTimeout(k);try{f?.nativeWindow.removeAllListeners("show")}catch(I){Z.warn("Error removing show listeners during cleanup",I)}}},w=await hW();if(await f?.nativeWindow.show({ref:w}),await f?.nativeWindow.focus({ref:w}),!await _())return;const S=b.query.trim();if(!S?.trim())return;const C=ua();m.current({rawQuery:S,copilotOverride:p.current?!0:void 0,attachments:b.attachments,collection:null,newFrontendContextUUID:C,promptSource:b.promptSource??"user",querySource:b.querySource??"home",timeFromFirstType:b.timeFromFirstType,shouldRedirectToBackendUUID:!0})},[f]);return d.useEffect(()=>{if(!s)return;const b=h(SV,_=>{v(_)});return()=>{b?.()}},[s,v,h]),d.useEffect(()=>{if(!s)return;const b=[qn.NEW_THREAD,...u?[qn.TOGGLE_V2V]:[]];return b.forEach(_=>{const S=g[_][Mn.WINDOWS].map(i9);y(S,_)}),()=>{b.forEach(_=>{const S=g[_][Mn.WINDOWS].map(i9);x(S)})}},[y,s,g,u,x]),l.jsx(l.Fragment,{children:e})},gCe=({children:e})=>l.jsx(d1e,{children:l.jsx(hCe,{children:e})}),gW=A.memo(()=>{const{message:e,variant:t,description:n,ctaText:r,ctaOnClick:s,isVisible:o,timeout:a,handleClick:i,closeToast:c,position:u,iconOverride:f,keyProp:m}=hn(),p=d.useCallback(()=>{t==="refresh"&&i===void 0?window.location.reload():i&&i()},[t,i]);return l.jsx(qc,{keyProp:m,isVisible:o,variant:t,message:e,description:n,ctaText:r,ctaOnClick:s,timeout:a,handleClick:p,onTimeout:c,position:u,iconOverride:f},m)});gW.displayName="Toasts";function yCe(e={}){const{isMobileStyle:t,isMobileUserAgent:n}=Re(),{isSidecarBuild:r="1",isInlineAssistantBuild:s=""}=e;return d.useMemo(()=>({isMobileStyle:r||s?!1:t,isMobileUserAgent:n}),[t,n,r,s])}const yW=A.memo(({children:e,colorScheme:t,logger:n,getSpriteUrl:r,renderModals:s})=>{const{isMobileStyle:o,isMobileUserAgent:a}=yCe();return l.jsx(gme,{isMobileStyle:o,isMobileUserAgent:a,renderModals:s,logger:n,children:l.jsx(qme,{src:r,children:l.jsx(OV,{initialOverrideColorScheme:t,children:l.jsxs(TH,{children:[e,l.jsx(gW,{})]})})})})});yW.displayName="GlobalUXProvider";Ce(async()=>{const{RenderToolbar:e}=await Se(()=>q(()=>import("./RenderToolbar-CM9FGyO-.js"),__vite__mapDeps([126,1,4])));return{default:e}});Ce(async()=>{const{ReactQueryDevtools:e}=await Se(()=>q(()=>import("./index-Ds5yF1gS.js"),[]));return{default:e}});const xCe=Ce(async()=>{const{DebugModeActivator:e}=await Se(()=>q(()=>import("./DebugModeActivator-BYw4GS2i.js"),__vite__mapDeps([127,4,1,125,3])));return{default:e}},{restricted:!0}),vCe=({children:e,hostname:t,buildVersion:n,buildVersionRefresh:r,spaRoutes:s,shouldOpenNonSpaRouteInNewTab:o,base:a,idleRefresh:i})=>{const c=On(),u=d.useRef(l1e),{env:{isSingleTenant:f}}=sn(),{status:m}=Ne();if(f){if(m==="loading")return null;if(m==="unauthenticated")return No("/auth/signin","Single tenant requires login"),null}return l.jsx(Nfe,{ssrPath:c??"/",ssrSearch:"",base:a,children:l.jsx(Rfe,{spaRoutes:s,openNonSpaRouteInNewTab:o,appRef:u,children:l.jsx(awe,{children:l.jsxs(Owe,{children:[l.jsx(NH,{}),l.jsxs(sme,{buildVersion:n,allowPersist:!0,children:[l.jsx(yW,{logger:Z,renderModals:!1,children:l.jsx(Hz,{children:l.jsxs(p1e,{hostname:t,children:[l.jsx(wve,{}),l.jsx(i0e,{children:l.jsx(vH,{children:l.jsx(dbe,{children:l.jsx(Fbe,{shouldFetchSettings:!0,children:l.jsx(Ghe,{children:l.jsx(jwe,{shouldFetchSettings:!1,children:l.jsx(gCe,{children:l.jsxs(_ve,{children:[l.jsxs(h0e,{children:[l.jsx(SH,{buildVersion:n,enabled:r||i,ref:u,children:i&&l.jsx(AH,{})}),l.jsx(oW,{}),l.jsx(gz,{}),typeof window<"u"&&l.jsx(tW,{}),l.jsx(aW,{}),l.jsx(hz,{}),l.jsx(xCe,{}),e]}),l.jsx(yme,{logger:Z})]})})})})})})})})]})})}),!1]})]})})})})},bCe=["49a618ae-2fee-4bac-9150-81c466a49187"];function _Ce(e){let t=e;t=t.replace(/^\^/,"").replace(/\$$/,""),t=t.replace(/\\\//g,"/");const n=[],r=t.match(/^\/\(([^)]+\|[^)]+)\)/);if(r){const h=r[1]?.split("|").map(g=>`/${g}`);n.push({type:"alternation",value:"",optional:!1,alternatives:h}),t=t.substring(r[0].length)}else{const h=t.match(/^([^(]+)/);if(h&&h[1]){const g=h[1];n.push({type:"literal",value:g,optional:!1}),t=t.substring(g.length)}}let s=t,o=0,a=0;const i=100;for(;s.length>0&&a++([^)]+)\)\)\?/);if(h){const[_,w,S]=h,C=S===w;n.push({type:C?"literal":"param",value:C?`/${w}`:`/:${w}`,optional:!0,paramName:C?void 0:w}),s=s.substring(_.length);continue}const g=s.match(/^\(\?:\/\(\?<(\w+)>([^)]+)\)\)/);if(g){const[_,w,S]=g,C=S===w;n.push({type:C?"literal":"param",value:C?`/${w}`:`/:${w}`,optional:!1,paramName:C?void 0:w}),s=s.substring(_.length);continue}const y=s.match(/^\/?\(([^)]+)\)\?/),x=s.match(/^\(\?:\/\(([^)]+)\)\)\?/),v=y||x;if(v){const[_]=v;o++,n.push({type:"param",value:`/:param${o}`,optional:!0,paramName:`param${o}`}),s=s.substring(_.length);continue}const b=s.match(/^\/?\?+/);if(b&&b[0].length>0){s=s.substring(b[0].length);continue}break}const c=[],u=n.find(h=>h.type==="alternation"),f=n.filter(h=>h.type!=="alternation"),m=u?u.alternatives.map(h=>`/${h}`):[""];for(const h of m){const g=f.filter(b=>b.optional),y=f.filter(b=>!b.optional),x=g.some(b=>b.paramName?.startsWith("param"));if(g.every(b=>b.paramName?.startsWith("param"))&&x){const b=g.length;for(let _=0;_<=b;_++){let w=h;for(const S of y)w+=S.value;for(let S=0;S<_;S++)w+=g[S]?.value??"";w=w.replace(/\/+/g,"/"),w=w.replace(/\/\?/g,""),w=w||"/",c.push(w)}}else{const b=g.length,_=Math.pow(2,b);for(let w=0;w<_;w++){let S=h;for(const C of y)S+=C.value;for(let C=0;C{const y=h.split("/").filter(Boolean),x=g.split("/").filter(Boolean);if(y.length!==x.length)return x.length-y.length;for(let v=0;v"u")return;const o=e.version,a=e.env??"local",i=Us(),c=t?.email?.endsWith("@perplexity.ai"),u=a==="local",f=a==="testing"||u||i||c?100:1,m=u||c?100:0;if(!bCe.includes(t?.org_uuid??"")){Dfe({applicationId:SCe,clientToken:c9,version:o,env:a,debug:u,sessionSampleRate:100,sessionReplaySampleRate:m,beforeSend:(g,y)=>{if(g.context&&ECe(y,g)){const x=y.response?.headers?.get(wCe);x&&(g.context.region=x);const v=y.response,b=v?Ife(v):void 0;b&&(g.context.normalizedPath=b)}if(n&&g.view.url&&g.context)try{const x=new URL(g.view.url).pathname,v=Pfe(x,r),b=d7(n,v);if(b)if(b.route.startsWith("^")){const _=d7(_Ce(b.route),v);_&&(g.context.normalizedName=f7(_.route,r))}else g.context.normalizedName=f7(b.route,r)}catch{}return!0}}),jfe({clientToken:c9,version:o,env:a,debug:u,sessionSampleRate:f});const h=typeof navigator<"u"&&"serviceWorker"in navigator&&!!navigator.serviceWorker.controller;if(c7({useServiceWorker:h,webResourcesBuild:void 0}),u7({useServiceWorker:h,webResourcesBuild:void 0}),i){const g={cometAgentExtensionVersion:i?.agent_extension_version,cometDeviceId:i.device_id,cometMainExtensionVersion:i.extension_version,cometVersion:i?.browser_version,erp:e.erp,cometAndroidVersion:i?.android_version,cometIosVersion:i?.ios_version};c7(g),u7(g)}Ju("web.frontend.module_exec_start",{startTime:SU(),duration:CCe})}l9=!0}function ECe(e,t){return t.type==="resource"&&t.resource.type==="fetch"&&"response"in e}const vW="^\\/search(?:\\/(?new))?(?:\\/(?.+))?$",bW=["ask-input"],kCe=["thread-title"],MCe=e=>{const t=[];if(!e)return t;const n=r=>{if(r.type==="mention"){const o=r.props;o.variant==="source"&&t.push(o.uuid)}"children"in r&&Array.isArray(r.children)&&r.children.forEach(n)};return n(e),t},_W=e=>{const t=[];if(!e)return{dslQuery:void 0,mentions:t};let n=0;const r=s=>{let o="";if(s.type==="text"&&"text"in s)o=s.text;else if(s.type==="linebreak")o=` -`;else{if((s.type==="link"||s.type==="autolink")&&"url"in s)return o=`[${"children"in s&&Array.isArray(s.children)&&s.children.map(r).reduce((i,c)=>(i+=c,i),"")||""}](${s.url})`,o;if(s.type==="mention"){const i=s.props;if(i.variant==="tab")return t.push({id:i.uuid,url:i.url??"",type:i.variant}),n++,o=``,o;if(i.variant==="space")return t.push({id:i.uuid,url:"",type:i.variant}),o="",o;if(i.variant==="shortcut")return t.push({id:i.uuid,url:"",type:i.variant}),o=i.queryText??"",o;if(i.variant==="source")return t.push({id:i.uuid,url:"",type:"sources"}),o="",o}}return"children"in s&&Array.isArray(s.children)?s.children.map(r).reduce((a,i)=>(a+=i,a),o):o};return{dslQuery:r(e)||void 0,mentions:t}};function wW({onSubmit:e,immediate:t=!0}){const n=nW(),r=rW(),s=sW(),o=Lwe(),{setUserInput:a,setHasStartedTyping:i,setStartTypingTime:c,markInputAsSubmitted:u}=Kx(),f=d.useRef(!1);d.useEffect(()=>()=>{f.current&&(u(),f.current=!1)},[u,t]);const m=d.useCallback(h=>{Z.info("ask input submitted");const g=o?performance.now()-o:void 0,{dslQuery:y,mentions:x}=_W(h.json?.root);e?.({timeFromFirstType:g,...h,dslQuery:y,mentions:h.mentions??x}),t?u():f.current=!0},[t,u,e,o]),p=d.useCallback((h,g)=>{!s&&h&&i(!0),o||c(performance.now()),a(h,g)},[s,a,i,o,c]);return[n,r,d.useMemo(()=>({onChange:p,onSubmit:m,setUserInput:a}),[p,m,a])]}const Z4=3e3;function TCe({handleSubmitQuery:e,isHomepage:t,contextUuid:n,disableSideBySide:r=!1}){const{isEnabled:s,sbsVariations:o,incrementTriggerCount:a}=s_e({frontendContextUUID:n,disableSideBySide:r});return d.useCallback(c=>{s?(a(),o.forEach(u=>{const{experiment_override:f,sibling_uuid:m,experiment_role:p}=u,h={experiment_role:p,sibling_uuid:m,experiment_override:f,selection_status:aa.SELECTION_STATUS_UNSPECIFIED,execution_log:{}},g={...c,newFrontendContextUUID:n,side_by_side_metadata:h};e(g)})):e(c)},[e,s,o,a,t,n])}const ACe=()=>{const{session:e}=Ne(),{trackEvent:t}=Xe(e),n=Rn(),r="clicked spaces ad",s=d.useCallback(async a=>{a.preventDefault(),t(r,{source:"createSpaceSidebar"}),n.push("/spaces/templates")},[t,n]),o=d.useCallback(async()=>{t("space mentioned in query"),U2e()},[t]);return d.useMemo(()=>({handleCreateSpaceSidebarAdClick:s,handleSubmitQueryWithMention:o}),[s,o])};function NCe({collection:e,onSubmit:t,redirectToNewThread:n=!0,csrRedirect:r=!1}){const{$t:s}=J(),{isCopilot:o}=Vn(),{submitQuery:a}=Ho(),{clear:i}=Vx(),c=Rn(),u=Vo(),{handleSubmitQueryWithMention:f}=ACe(),m=d.useMemo(()=>ua(),[]),p=d.useCallback(w=>{if(w.query.trim()==="")return;t?.(w),w.mentions&&w.mentions.some(E=>E.type==="space")&&f();const S=w.newFrontendContextUUID??ua(),C=ua();n&&(i(),a({rawQuery:w.query,dslQuery:w.dslQuery,mentions:w.mentions,copilotOverride:o?!0:void 0,attachments:w.attachments,collection:e||null,newFrontendContextUUID:S,promptSource:w.promptSource||"user",querySource:w.querySource,timeFromFirstType:w.timeFromFirstType,modelPreferenceOverride:w.modelPreferenceOverride,browserAgentAllowOnceFromToggle:w.browserAgentAllowOnceFromToggle,forceEnableBrowserAgent:w.forceEnableBrowserAgent,shouldRedirectToBackendUUID:!r,...w.side_by_side_metadata&&{side_by_side_metadata:w.side_by_side_metadata},frontendUUID:C,...w.canonicalPageContext&&{canonicalPageContext:w.canonicalPageContext},onThreadSlugReceived:E=>{if(!r)return;const T=window.location.pathname;T.startsWith(`${c.base}/search/`)&&MU(T.split("/").pop())&&c.replace(`/search/${E}`,"Home ask input")}}),r&&c.push(`/search/new/${C}`,void 0,"Home ask input"))},[t,n,i,a,o,e,r,c,f]),h=TCe({handleSubmitQuery:p,isHomepage:!0,contextUuid:m}),g=d.useRef(!1),y=d.useCallback(w=>{g.current||(g.current=!0,setTimeout(()=>g.current=!1,Z4),h(w))},[h]),[x,v,b]=wW({onSubmit:y,immediate:!r}),_=s(Nr[u].askInputPlaceholder);return[x,v,d.useMemo(()=>({...b,placeholder:_}),[b,_])]}const RCe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"sidecar-privacy-education",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},DCe=({platform:e,miniInstaller:t}={})=>{e=e??"mac_arm64";const n={channel:"stable",platform:e};(t??e.includes("win"))&&(n.mini="1");const s=new URLSearchParams(n),o=new URL("https://www.perplexity.ai/rest/browser/download");return o.search=s.toString(),o},jCe="COMET_USER",ICe=async()=>{try{const{data:e,error:t,response:n}=await de.GET("/rest/homepage-widgets/upsell","get upsells",{timeoutMs:Qe(),headers:{"X-Current-Path":window.location.pathname}});if(t)throw new he("API_CLIENTS_ERROR",{cause:t,status:n.status??0});return{upsell_information:e?.upsell_information??null,product_banner_information:e?.product_banner_information??null}}catch(e){return Z.error("Error getting homepage upsells",{error:e}),{upsell_information:null,product_banner_information:null}}},cl=async e=>{try{const{data:t,error:n,response:r}=await de.POST("/rest/sse/blocking_event_response","send blocking event response",{body:{response:e},timeoutMs:Qe()});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t?.status==="completed"}catch(t){return Z.error("Error sending blocking event response",{error:t,response:e}),!1}},PCe=async e=>{try{const{error:t,response:n}=await de.POST("/rest/homepage-widgets/upsell/add-to-cohort","add user to cohort",{body:{cohort:e},timeoutMs:Qe()});if(t)throw new he("API_CLIENTS_ERROR",{cause:t,status:n.status??0});return n.ok}catch(t){return Z.error("Error adding user to cohort",{error:t,cohort:e}),!1}},OCe=async()=>PCe(jCe),LCe=e=>{e.invalidateQueries({queryKey:i3(!0)}),e.invalidateQueries({queryKey:i3(!1)}),e.invalidateQueries({queryKey:Qye()})},Ovt=e=>{LCe(e),e.invalidateQueries({queryKey:iu()}),e.invalidateQueries({queryKey:Zy()})},FCe=({isUnsupportedDevice:e,isWindows:t})=>{const{session:n}=Ne(),{trackEvent:r}=Xe(n),{sendCometDownloadedEventSingular:s,sendCometDownloadButtonClickedEventSingular:o}=JM(),{openToast:a}=hn(),{openModal:i}=pn().legacy,{$t:c}=J(),u=d.useCallback(async(h,g)=>{a({message:c({defaultMessage:"Comet is downloading",id:"hCO9dUOI91"}),description:c({defaultMessage:"Check your browser's downloads to open the Comet installer.",id:"hRzUheg7aj"}),iconOverride:B("download"),variant:"success",timeout:5}),h||i("cometDownloadInstructionsModal",{requestedPlatform:g})},[a,c,i]),f=d.useCallback(async(h,{upsellName:g,partnerCode:y,preventDownloadInstructionsModal:x})=>{u(x,h),Ofe(),r("click download comet",{requestedPlatform:h,upsellName:g,installPartner:y}),s(),setTimeout(()=>No(DCe({platform:h}).href,"Comet download"),250)},[r,s,u]),m=d.useCallback(async({upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y})=>{if(!e)return await OCe(),t?f("win_x64",{upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y}):f("mac_arm64",{upsellName:h,partnerCode:g,preventDownloadInstructionsModal:y})},[f,t,e]),p=d.useCallback(({upsellName:h,partnerCode:g})=>{o("download-comet"),m({upsellName:h,partnerCode:g})},[o,m]);return{handleDownload:m,handleDownloadClick:p}},BCe=(e,t)=>{const{value:n,loading:r}=zt({flag:"maybe-student-domains-regex",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};var u9;(function(e){e.SPRING_2025="SPRING_2025",e.GIVE_1_MONTH_FREE="GIVE_1MO_GET_1MO"})(u9||(u9={}));const UCe=async({email:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/referrals/validate-email",t,{params:{query:{email:e}},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to validate referral email",cause:r,status:s.status??0});return{valid:n.is_valid,error:!1}}catch(n){return Z.error(n),{valid:!1,error:!0}}},Lvt=async({referralCode:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/referrals/get-user-from-referral-code",t,{params:{query:{referral_code:e}}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user from referral code",cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get user from referral code",n),{email:null,is_student:null,is_active:!1}}},Fvt=async({headers:e,email:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/referrals/",n,{headers:e,params:{query:{email:t}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user referral status",cause:s,status:o.status??0});return r},Bvt=async({verificationId:e,reason:t})=>{try{if(!e)throw new Error("Verification ID is required");const{data:n,error:r,response:s}=await de.GET("/rest/referrals/student-reward-details",t,{params:{query:{verification_id:e}},timeoutMs:Qe()});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get student reward details",cause:r,status:s.status??0});return n}catch(n){return Z.error("Failed to get student reward details",n),{months_awarded:1,reward_type:"default",organization:null,country_label:null}}},CW=({email:e,reason:t})=>{const{data:n,isLoading:r}=mt({queryKey:f2e(e),queryFn:()=>UCe({email:e,reason:t}),enabled:!!e});return d.useMemo(()=>({isStudent:n?.valid??null,loading:r}),[n?.valid,r])},VCe=async({reason:e,headers:t})=>{try{const{data:n}=await de.GET("/rest/academic/check-edu-institution",e,{timeoutMs:Cn.HIGH,headers:t});return n}catch(n){return Z.error("Failed to check institution",n),null}},HCe=({reason:e})=>mt({queryKey:o2e(),queryFn:()=>VCe({reason:e})}),zCe=({reason:e})=>{const{session:t}=Ne(),n=t?.user?.email??"",{isStudent:r,loading:s}=CW({email:n,reason:e}),{variation:o,loading:a}=BCe(!1),{data:i,isLoading:c}=HCe({reason:e});return d.useMemo(()=>c||a||s?{isLoading:!0,signals:{isVerifiedStudent:null,isPossibleStudentByEmail:null,isPossibleStudentByIP:null}}:{isLoading:!1,signals:{isVerifiedStudent:!!r,isPossibleStudentByEmail:!!o,isPossibleStudentByIP:!!i?.institution}},[c,a,s,o,r,i?.institution])},SW=()=>{const{openModal:e}=pn().legacy,{isMobileUserAgent:t}=Re(),n=Do(),r=d.useCallback(({origin:s,sheetModalVariant:o,closeCallback:a})=>{!t||n||e("installModal",{origin:s,sheetModalVariant:o,closeCallback:a})},[n,t,e]);return d.useMemo(()=>({openInstallUpsell:r}),[r])},du=({enabled:e})=>{const{openModal:t}=pn().legacy,{keysRequiringRerender:n,removeKeyRequiringRerender:r}=r4(),{isMobileUserAgent:s}=Re(),o=Wt(),{openInstallUpsell:a}=SW(),i=d.useCallback(({title:u,description:f,origin:m,image:p,imageAlt:h,closeCallback:g,loginButtonsStyle:y})=>{},[e,t,o]),c=d.useCallback(({title:u,description:f,origin:m,sheetModalVariant:p,closeCallback:h,overrideRedirectUrl:g,disallowedMethods:y,overrideMobileVariant:x=!1})=>{},[e,s,t,o]);return d.useEffect(()=>{e&&(n.includes("visitor-gate")&&(s&&!By()?a({origin:ft.VISITOR_GATE,sheetModalVariant:"inset-centered-sheet"}):c({origin:ft.VISITOR_GATE,sheetModalVariant:"bottom-sheet-gradient"}),r("visitor-gate")),n.includes("visitor-gate-ii")&&(s&&!By()?a({origin:ft.VISITOR_GATE,sheetModalVariant:"inset-centered-sheet"}):c({origin:ft.VISITOR_GATE}),r("visitor-gate-ii")))},[e,c,n,r,s,a]),d.useMemo(()=>({openVisitorLoginUpsell:c,openVisitorLoginImageUpsell:i}),[i,c])},WCe={currentStep:null,currentIndex:0,steps:[],handleNext:()=>null,handleComplete:()=>null,insertStep:()=>null,insertStepAndNavigate:()=>null,experimentVariationsMeta:{},setCurrentIndex:()=>null},EW=Ft("MultiStepContext",WCe),Uvt=({steps:e,experimentVariationsMeta:t,handleFinish:n,initialIndex:r=0,children:s})=>{const[o,a]=d.useState(r),[i,c]=d.useState(e),[u,f]=d.useState(null),[m,p]=d.useState(t),{session:h}=Ne(),{trackEventTyped:g}=Xe(h);d.useEffect(()=>{c(e)},[e]),d.useEffect(()=>{p(t)},[t]),d.useEffect(()=>{i[o]!==void 0&&g("step visited",{step:i[o],experimentVariationsMeta:m})},[o,m,i,g]),d.useEffect(()=>{if(u!==null){if(a(u),f(null),i[o]===void 0||i[u]===void 0)return;g("step transition",{sourceStep:i[o],destinationStep:i[u],isFinish:!1,experimentVariationsMeta:m})}},[o,m,u,i,g]);const y=(w,S)=>{const C=[...i];C.splice(S,0,w),c(C)},x=(w,S)=>{y(w,S),f(S)},v=()=>{if(i.length)if(o===i.length-1){if(n?.(),i[o]===void 0)return;g("step transition",{sourceStep:i[o],isFinish:!0,experimentVariationsMeta:m})}else{if(a(o+1),i[o]===void 0||i[o+1]===void 0)return;g("step transition",{sourceStep:i[o],destinationStep:i[o+1],isFinish:!1,experimentVariationsMeta:m})}},b=()=>{n?.(),i[o]!==void 0&&g("step transition",{sourceStep:i[o],isFinish:!0,experimentVariationsMeta:m})},_=d.useMemo(()=>i[o],[o,i]);return l.jsx(EW.Provider,{value:{currentStep:_,insertStep:y,insertStepAndNavigate:x,handleNext:v,handleComplete:b,currentIndex:o,steps:i,setCurrentIndex:a,experimentVariationsMeta:m},children:s})};function GCe(){const e=d.useContext(EW);if(!e)throw new Error("useMultiStep must be used within MultiStepContext");return e}const $Ce=({searchParams:e,cleanRedirect:t})=>{if(!e)return null;const r=e.get("redirect");let s=null;try{s=r&&new URL(r).searchParams.get(EM)}catch{return null}return s?s===ft.GROW_COMET_STUDENTS_COUNTRY?ft.GROW_COMET_STUDENTS_COUNTRY:s===ft.GROW_COMET_STUDENTS?ft.GROW_COMET_STUDENTS:null:null},qCe=()=>{const e=fn();return d.useMemo(()=>{const t=e?.get(EM),n=!!$Ce({searchParams:e,cleanRedirect:!1}),r=t===ft.STUDENT_REFERRAL_LANDING_PAGE,s=t===ft.STUDENT_LANDING_PAGE,o=t===ft.GROW_COMET_STUDENTS_COUNTRY;return{loginSource:t,isFromStudentCometGrowth:n,isFromStudentCometGrowthCountry:o,isFromStudentReferral:r,isFromStudentLanding:s,isFromStudentFlow:n||r||s||o}},[e])},KCe=(e,t)=>t.isFromStudentCometGrowthCountry?ft.GROW_COMET_STUDENTS_COUNTRY:t.isFromStudentCometGrowth?ft.GROW_COMET_STUDENTS:t.isFromStudentReferral?ft.STUDENT_REFERRAL_LANDING_PAGE:t.isFromStudentLanding?ft.STUDENT_LANDING_PAGE:e,YCe=({origin:e,customCallbacks:t})=>{const{$t:n}=J(),r=Wt(),{session:s}=Ne(),{trackEvent:o}=Xe(s),{openVisitorLoginUpsell:a}=du({enabled:!r}),{insertStepAndNavigate:i,currentIndex:c,handleComplete:u}=GCe(),{openModal:f}=pn().legacy,m=qCe(),h=fn()?.get("redirect"),{signals:g,isLoading:y}=zCe({reason:"combined_paywall"}),x=d.useCallback(w=>{if(w){if(m.isFromStudentCometGrowth){u();return}typeof window<"u"&&window.location.pathname==="/onboarding"?(_a.setItem("student_verification_id",w),i("onboarding-student-referrals",c+1)):setTimeout(()=>{f("studentReferrals",{verificationId:w})},150)}},[i,c,f,m,u]),v=d.useCallback(w=>{o("sheerid form redirect",{verificationLocationSource:KCe(e,m),verificationRoleType:w}),f("sheerIdModal",{type:w,onSuccess:t?.onSuccess??x,onClose:t?.onClose})},[x,e,o,m,f,t]),b=d.useCallback(w=>{if(!r){a({title:n({defaultMessage:"Sign in to unlock Education Pro",id:"UNeU1Y4Zdu"}),origin:m.loginSource??e,disallowedMethods:["apple"],overrideRedirectUrl:h??void 0});return}v(w)},[r,v,a,n,m.loginSource,e,h]),_=m.isFromStudentFlow||!!g.isVerifiedStudent||!!g.isPossibleStudentByEmail||!!g.isPossibleStudentByIP;return{isLoading:!!y,isVerifiedStudent:!!g.isVerifiedStudent,handleStudentTierClick:b,handleVerificationSuccess:x,shouldDefaultToStudent:_,signals:g}},QCe=`__merge-ah-script__${crypto.randomUUID()}`;async function XCe(){return oM({id:QCe,src:"https://ah-cdn.merge.dev/initialize.js"})}function ZCe(e){const t=d.useCallback(async()=>{const r=e?.linkToken;if(!r)throw new Error("Link token is required");await XCe(),await new Promise(s=>{window.AgentHandlerLink.initialize({...e,linkToken:r,enable_telemetry:!1,onReady:()=>s()})})},[e]);return d.useCallback(async()=>{await t(),window.AgentHandlerLink&&window.AgentHandlerLink.openLink(e)},[e,t])}function JCe({url:e,openInNewTab:t}){if(t){window.open(e,"_blank");return}No(e,"Enabling connector")}const J4=({reason:e})=>{const t=fn(),n=t?.get("referrer"),r=t?.get("referrerId"),{$t:s}=J(),{openToast:o}=hn(),a=d.useCallback(async({connectorName:i,redirectPath:c,customReferrer:u,customReferrerId:f,redirectOrigin:m,unauthedRedirectPath:p,openInNewTab:h=!1})=>{const g=await Pz({name:i,referrer:u??n??void 0,referrerId:f??r??void 0,redirectPath:c??void 0,redirectOrigin:m,unauthedRedirectPath:p??void 0,reason:e});if(!g){o({message:s({defaultMessage:"Unable to start connection.",id:"SPIzcd/Xa2"}),variant:"error",timeout:3});return}JCe({url:g,openInNewTab:h})},[e,n,r,s,o]);return d.useMemo(()=>({handleConnect:a}),[a])},d9="/account/connectors",f9={GCAL_CONNECT:"gcal_connect",CONNECTOR_COMPLETE:"connector_complete"},eSe={UPSELL_CONNECTOR:"upsell-connector-channel"},Vvt={GOOGLE:"google",OUTLOOK:"outlook"},Hvt={GCAL:"gcal"},ry="writable-spaces",Sm="recentCollections",tSe=e=>e?.toLowerCase(),sy=e=>tSe(e.status)==="pending",nSe=e=>e.find(t=>sy(t)&&t.backend_uuid),rSe=e=>!!(e&&Hi(e)&&"blocks"in e[0]),sSe=async({slugOrUUID:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/article/{article_uuid_or_slug}",n,{params:{path:{article_uuid_or_slug:e}},headers:t,timeoutMs:Qe({productionMs:3e3}),numRetries:1});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get article",cause:s,status:o.status??0});if(r.status!=="success")throw new he("API_CLIENTS_ERROR",{message:"Failed to get article - not successful",cause:r,status:o.status??0});return r.entries},m9=e=>e[0]?.article_info?{title:e[0].article_info.title||"",summary:e[0].article_info.summary||"",suggested_sections:e[0].article_info.suggested_sections||[],audience:e[0].article_info.audience||"anyone",read_time:e[0].article_info.read_time,emphasize_sources:e[0].article_info.emphasize_sources??!1,num_sections:e.length}:null,oSe={isBlocksApi:!1,article:[],heroSection:void 0,isLoading:!1,isPublished:!1,isOrgInternal:!1,inFlight:!1,inFlightLatest:!1,currentlyStreamingSection:void 0,socialStats:{forkCount:0,likeCount:0,viewCount:0,userLikes:!1},threadMetadata:{rwToken:void 0,contextUUID:void 0,frontendContextUUID:void 0,title:void 0,first_query:void 0,focus:void 0,author_id:void 0,author_username:void 0,author_image:void 0,parent_info:void 0,mode:void 0,personalized:!1,collection:void 0,thread_access:0,thread_url_slug:void 0,updated_datetime:void 0,expiry_time:void 0,privacy_state:WS.NONE},articleMetadata:{title:"",summary:"",suggested_sections:[],audience:"anyone",read_time:0,emphasize_sources:!1,num_sections:0},articleMedia:[],articleWebResults:[],relatedPages:[],articleLocalState:{isEditModeEnabled:!1,setEditModeEnabled:()=>{},isCreating:!1,setIsCreating:()=>{},isTitleVisible:!0,setTitleVisible:()=>{},clickedImage:null,setClickedImage:()=>{},clickedImageIndex:0,isRewritingSection:!1,setRewritingSection:()=>{}},refetch:()=>{}},kW=Ft("ArticleResultsContext",oSe),aSe=A.memo(({relatedPages:e=Pe,children:t,slug:n})=>{const r="article-results-provider",[s,o]=d.useState(!1),[a,i]=d.useState(!1),[c,u]=d.useState(null),[f,m]=d.useState(!0),[p,h]=d.useState(!1),{isEnterprise:g}=mo({reason:r}),y=Yt(),v=fn()?.get("newFrontendContextUUID"),[b,_]=d.useState(y.getQueryData(NR(n||"")));d.useEffect(()=>{if(v){_(v);return}const G=y.getQueryData(NR(n||""));_(G)},[v,y,n]);const{data:w,isLoading:S}=mt({enabled:!!n&&n!=="new",queryKey:b4(b||""),queryFn:()=>sSe({slugOrUUID:n,reason:r}),refetchOnMount:!0,placeholderData:Wl}),C=rSe(w),E=d.useMemo(()=>{if(!w||C)return;const G=w[w.length-1];return{inFlight:w.some(sy),inFlightLatest:G&&sy(G)}},[w,C]),T=E?.inFlight??!1,k=E?.inFlightLatest??!1,I=d.useMemo(()=>{if(!(!w||C))return nSe(w)},[w,C]),M=d.useMemo(()=>{if(!w||w.length===0)return null;const G=w[0];if(sy(G))return null;const H=G.social_info;return H?g3(H):g3()},[w]),N=d.useMemo(()=>!w||w.length===0?R_():R_(w[0]),[w]),D=d.useMemo(()=>w?m9(w):null,[w]),j=d.useMemo(()=>{const G=[];return w?.forEach(H=>{if(H.article_info.layout==="media-only"){const Y=(H.article_info.user_selected_media_items??[])?.filter(te=>te.medium==="image");G.push(...Y)}else{const Q=H?.media_items??[],Y=H?.featured_images??[];H.article_info.layout!=="text"&&(Hi(Y)&&Y[0].medium==="image"?G.push(Y[0]):Hi(Q)&&Q[0].medium==="image"&&G.push(Q[0]))}}),G},[w]),F=d.useMemo(()=>{if(!c)return 0;const G=j.findIndex(H=>H?.image===c?.image);return G>-1?G:0},[c,j]),R=d.useMemo(()=>{const G=new Map;return!w||w.length===0?[]:(w?.forEach(H=>{const Q=qt.parseAskTextField(H);Q?.web_results&&Q.web_results.forEach(Y=>{G.has(Y.url)?G.get(Y.url).count+=1:G.set(Y.url,{...Y,count:1})})}),Array.from(G.values()).sort((H,Q)=>Q.count-H.count).map(H=>({...H,count:void 0})))},[w]),P={isEditModeEnabled:s,setEditModeEnabled:o,isTitleVisible:f,setTitleVisible:m,isCreating:a,setIsCreating:i,clickedImage:c,setClickedImage:u,clickedImageIndex:F,isRewritingSection:p,setRewritingSection:h},L=N??R_(),U=g&&!!L.collection&&L.thread_access===os.COLLECTION_READ,O=!!g&&L.thread_access===os.ORG_READ,$=U||O||L.thread_access===os.PUBLIC_READ;return l.jsx(kW.Provider,{value:{isBlocksApi:C,article:w??[],isLoading:S,heroSection:w?.[0],lastSection:w?.[w.length-1],socialStats:M,isPublished:$,isOrgInternal:O,inFlight:T,inFlightLatest:k,currentlyStreamingSection:I,threadMetadata:L,articleMetadata:D??m9([]),articleLocalState:P,articleMedia:j,articleWebResults:R,relatedPages:e},children:t})});aSe.displayName="ArticleResultsProvider";const iSe=()=>{const e=d.useContext(kW);if(!e)throw new Error("useArticleResults must be used within ArticleResultsContext");return e},MW={searchTerm:"",updateUserInput:e=>{}},lSe=Ft("UserInputStateContext",MW),TW=()=>{const e=d.useContext(lSe);return e||MW};function cSe(e){return typeof e=="object"&&e!==null&&"pages"in e&&Array.isArray(e.pages)&&"pageParams"in e&&Array.isArray(e.pageParams)}const uSe=(e,t)=>e.getQueryData(["results"])?.find(r=>r.frontend_context_uuid===t)?.collection_info,dSe=(e,t)=>e.getQueryData(b4(t))?.find(r=>r.frontend_context_uuid===t)?.collection_info,fSe=(e,t,n)=>{e.setQueryData(b4(t),r=>r&&r.map(n))},mSe=[os.OWNER_ONLY,os.PRIVATE_READ,os.COLLECTION_READ],p9=(e,t,n,r,s)=>{const{entryUUID:o,frontendContextUUID:a,newCollectionUUID:i,newCollectionTitle:c,newCollectionEmoji:u,newCollectionSlug:f,newCollectionAccess:m,newCollectionUserPermission:p}=t,h={collection_info:{uuid:i,title:c,emoji:u,slug:f,access:m,user_permission:p},bookmark_state:"BOOKMARKED"};a&&(s(g=>g?g.map(y=>y.frontend_context_uuid===a?{...y,...h}:y):[]),e.setQueryData(be.makeQueryKey(r,{frontend_context_uuid:a}),g=>g?g.map(y=>y.frontend_context_uuid===a?{...y,...h}:y):[])),e.setQueryData(n,g=>{g=g||{pages:[],pageParams:[]};const y=g.pages.map(x=>x.map(v=>v.uuid===o?{...v,collection:{...v.collection,...h.collection_info}}:v));return{...g,pages:y}})},pSe=({reason:e})=>{const{searchTerm:t}=TW(),n=Yt(),{isEnterprise:r}=mo({reason:e}),{threadMetadata:s}=iSe(),o=el(),a=On();let i="results";const c=Lx({search_term:t??""}),u=Zye({search_term:t??""});let f=c,m=n2e,p=uSe;const h=j4();let g=d.useCallback((N,D,j)=>{h(F=>F&&F.map(j))},[h]);(a?.startsWith("/page")||a?.startsWith("/discover"))&&(i="articleResults",f=u,m=r2e,p=dSe,g=fSe);const y=d.useCallback(N=>{const D=!o&&!s?.rwToken;!r||D||h(j=>{if(j)return j.map(F=>{let R=!1,P=os.PRIVATE_READ;return N==="add"?(R=mSe.includes(F.thread_access??null),P=qt.isArticleMode(F)?os.PRIVATE_READ:os.COLLECTION_READ):(R=F.thread_access!==os.COLLECTION_READ,P=os.PRIVATE_READ),{...F,thread_access:R?F.thread_access:P}})})},[o,s?.rwToken,r,h]),{mutate:x}=Rt({mutationFn:async({title:N,description:D,emoji:j,instructions:F,accessLevel:R,existingCollection:P,enableWebByDefault:L,closeModal:U})=>(U(),C_e({collectionUuid:P.uuid,changes:{title:N,description:D,emoji:j,instructions:F,accessLevel:R,enableWebByDefault:L},reason:e})),onMutate:async N=>{const D=na(N.existingCollection.slug);await n.cancelQueries({queryKey:D});const j=n.getQueryData(D);return n.setQueryData(D,F=>({...F,title:N.title,description:N.description,emoji:N.emoji,instructions:N.instructions,access:N.accessLevel,enable_web_by_default:N.enableWebByDefault})),{previousCollection:j}},onSettled:(N,D,j,F)=>{const R=na(j.existingCollection.slug);D?n.setQueryData(R,F?.previousCollection):(n.setQueryData(R,P=>({...P,...N})),n.setQueryData(Xt(),P=>P?.pages?{...P,pages:P.pages.map(L=>L.map(U=>U.uuid===j.existingCollection.uuid?{...U,...N}:U))}:P),n.invalidateQueries({queryKey:wm()}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:be.makeQueryKey(ry)}))}}),{mutate:v}=Rt({mutationFn:async({accessLevel:N,collectionUuid:D})=>{await c_e({params:{collection_uuid:D,updated_access:N},reason:e})},onMutate:async N=>{const D=na(N.collectionSlug);await n.cancelQueries({queryKey:D});const j=n.getQueryData(D);return n.setQueryData(D,F=>({...F,access:N.accessLevel})),{previousCollection:j}},onSettled:async(N,D,j,F)=>{D?n.setQueryData(Xt(),F?.previousCollection):(await n.invalidateQueries({queryKey:h2e()}),await n.invalidateQueries({queryKey:na(j.collectionSlug)}),n.invalidateQueries({queryKey:wm()}))}}),{mutate:b}=Rt({mutationFn:async({entryUUID:N,title:D,description:j,emoji:F,instructions:R,accessLevel:P,callback:L,frontendContextUUID:U})=>{const O=await XR({params:{title:D,description:j,emoji:F,instructions:R,accessLevel:P},reason:e});return await I0({params:{new_collection_uuid:O.uuid,entry_uuid:N,return_collection:!1,return_thread:!1},reason:e}),L(O),y("add"),{title:D,description:j,emoji:F,instructions:R,accessLevel:P,newCollection:O}},onMutate:async({entryUUID:N,frontendContextUUID:D,...j})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()});const F=n.getQueryData(f),R=n.getQueryData(Xt());n.setQueryData(Xt(),L=>{L=L||{pages:[],pageParams:[]};const U=(L&&L.pages&&L.pages[0])??[],$={...U?.length>0?U[0]:[],...j,uuid:Si,thread_count:1};return{...L,pages:[[$,...U]]}}),n.setQueryData(f,L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>$.uuid===N?{...$,collection:{...$.collection,description:j.description,uuid:Si,title:j.title,emoji:j.emoji}}:$));return{...L,pages:U}}),n.setQueryData(m(N),L=>{const U=L?.collection_info??{};return{...L,collection_info:{...U,uuid:Si,description:j.description,title:j.title,emoji:j.emoji}}});let P=null;return D&&(P=p(n,D)??null,g(n,D,L=>L.frontend_context_uuid===D?{...L,collection_info:{...L.collection_info,uuid:Si,title:j.title,emoji:j.emoji},bookmark_state:"BOOKMARKED"}:L)),{previousThreads:F,previousCollections:R,previousCollectionInfo:P}},onSettled:(N,D,j,F)=>{D?(n.setQueryData(f,F.previousThreads),n.setQueryData(Xt(),F.previousCollections),j.frontendContextUUID&&g(n,j.frontendContextUUID,R=>R.frontend_context_uuid===j.frontendContextUUID?{...R,collection_info:F?.previousCollectionInfo??null,bookmark_state:F?.previousCollectionInfo?"BOOKMARKED":"NOT_BOOKMARKED"}:R)):(n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:wm()}),j.frontendContextUUID&&g(n,j.frontendContextUUID,R=>R.frontend_context_uuid===j.frontendContextUUID?{...R,collection_info:{...R.collection_info,uuid:N?.newCollection?.uuid,title:N?.newCollection?.title,emoji:N?.newCollection?.emoji,slug:N?.newCollection?.slug},bookmark_state:"BOOKMARKED"}:R))}}),{mutate:_}=Rt({mutationFn:async({title:N,description:D,emoji:j,instructions:F,accessLevel:R,template_id:P,callback:L})=>{const U=await XR({params:{title:N,description:D,emoji:j,instructions:F,accessLevel:R,template_id:P},reason:e});return L(U),{collection:U}},onMutate:async({...N})=>{n.setQueryData(Xt(),D=>{D=D||{pages:[],pageParams:[]};const j=D.pages[0]||[],F={...j.length>0?j[0]:{},...N,uuid:Si,thread_count:0};return{...D,pages:[[F,...j]]}})},onSuccess:async()=>{n.refetchQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:wm()}),n.invalidateQueries({queryKey:be.makeQueryKey(ry)})}}),{mutate:w}=Rt({mutationFn:async({entryUUID:N})=>{const D=await I0({params:{entry_uuid:N,upsert_type:"bookmark",return_collection:!0,return_thread:!1},reason:e});return y("add"),D},onMutate:async({entryUUID:N,topic:D})=>{const j=n.getQueryData(dc(D));let F;for(const R of j?.pages??[])for(const P of R.threads)if(P.uuid===N){F=P.collection;break}return n.setQueryData(dc(D),R=>{if(R)return{pageParams:R.pageParams,pages:R.pages.map(P=>({...P,threads:P.threads.map(L=>({...L,collection:L.uuid===N?{uuid:Si,title:"Bookmarks",emoji:"1f516",slug:Si}:L.collection}))}))}}),{previousCollection:F}},onSettled:(N,D,j,F)=>{const{entryUUID:R,topic:P}=j;if(D||!N)F?.previousCollection&&n.setQueryData(dc(P),L=>{if(L)return{pageParams:L.pageParams,pages:L.pages.map(U=>({...U,threads:U.threads.map(O=>({...O,collection:O.uuid===R?F.previousCollection:O.collection}))}))}});else{const{updated_collection:L}=N,{uuid:U,title:O,emoji:$,slug:G}=L;n.setQueryData(dc(P),H=>{if(H)return{pageParams:H.pageParams,pages:H.pages.map(Q=>({...Q,threads:Q.threads.map(Y=>({...Y,collection:Y.uuid===R?{uuid:U,title:O,emoji:$,slug:G}:Y.collection}))}))}})}}}),{mutate:S}=Rt({mutationFn:async({entryUUID:N,topic:D,oldCollectionUUID:j})=>(await YR({collectionUUID:j,entryUUID:N,reason:e}),{topic:D}),onMutate:async({entryUUID:N,topic:D})=>{const j=n.getQueryData(dc(D));let F;for(const R of j?.pages??[])for(const P of R.threads)if(P.uuid===N){F=P.collection;break}return n.setQueryData(dc(D),R=>{if(R)return{pageParams:R.pageParams,pages:R.pages.map(P=>({...P,threads:P.threads.map(L=>({...L,collection:L.uuid===N?void 0:L.collection}))}))}}),{previousCollection:F}},onSettled:(N,D,j,F)=>{const{entryUUID:R,topic:P}=j;D&&F?.previousCollection&&n.setQueryData(dc(P),L=>{if(L)return{pageParams:L.pageParams,pages:L.pages.map(U=>({...U,threads:U.threads.map(O=>({...O,collection:O.uuid===R?F.previousCollection:O.collection}))}))}})}}),{mutate:C}=Rt({mutationFn:async({entryUUID:N,frontendContextUUID:D})=>{const j=await I0({params:{entry_uuid:N,upsert_type:"bookmark",return_collection:!0,return_thread:!1},reason:e});return y("add"),{response:j,entryUUID:N,frontendContextUUID:D}},onMutate:async({frontendContextUUID:N})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()}),h(D=>D&&D.map(j=>j.frontend_context_uuid===N?{...j,bookmark_state:"BOOKMARKED",collection_info:{uuid:null,title:"Bookmarks",emoji:"1f516",slug:null,access:null,user_permission:as.OWNER_DEFAULT_BOOKMARKS}}:j))},onSettled:async(N,D)=>{if(!N||!N.response?.updated_collection)return;const j=N.response.updated_collection,F=N.entryUUID,R=N.frontendContextUUID,{uuid:P,title:L,emoji:U=null,slug:O,access:$,user_permission:G}=j;await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()}),p9(n,{entryUUID:F,frontendContextUUID:R,newCollectionUUID:P,newCollectionTitle:L,newCollectionEmoji:U,newCollectionSlug:O,newCollectionAccess:$,newCollectionUserPermission:G},f,i,h),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:R})})}}),{mutate:E}=Rt({mutationFn:async({entryUUID:N,currentCollectionUUID:D,newCollectionTitle:j,newCollectionUUID:F,newCollectionSlug:R,newCollectionAccess:P,closeModal:L,callback:U})=>{if(F!==Si)return L(),await I0({params:{new_collection_uuid:F,entry_uuid:N,return_collection:!1,return_thread:!1},reason:e}),U?.(),y("add"),{entryUUID:N,currentCollectionUUID:D,newCollectionTitle:j,newCollectionUUID:F,newCollectionSlug:R,newCollectionAccess:P,closeModal:L}},onMutate:async({entryUUID:N,frontendContextUUID:D,currentCollectionUUID:j,newCollectionUUID:F,newCollectionTitle:R,newCollectionEmoji:P,newCollectionSlug:L,newCollectionAccess:U,newCollectionUserPermission:O})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()});const $=n.getQueryData(f),G=n.getQueryData(Xt());return p9(n,{entryUUID:N,frontendContextUUID:D,newCollectionUUID:F,newCollectionTitle:R,newCollectionEmoji:P,newCollectionSlug:L,newCollectionAccess:U,newCollectionUserPermission:O},f,i,h),n.setQueryData(Xt(),H=>{H=H||{pages:[],pageParams:[]};const Q=H.pages.map(Y=>Y.map(te=>te.uuid===j?{...te,thread_count:te.thread_count-1}:te.uuid===F?{...te,thread_count:te.thread_count+1}:te));return{...H,pages:Q}}),{previousThread:$,previousCollections:G}},onSettled:(N,D,j,F)=>{if(D)n.setQueryData(f,F.previousThread),n.setQueryData(Xt(),F.previousCollections);else{const R=bd({collection_slug:j.existingCollectionSlug??""}),P=bd({collection_slug:j.newCollectionSlug});n.invalidateQueries({queryKey:na(j.newCollectionSlug)}),n.invalidateQueries({queryKey:R}),n.refetchQueries({queryKey:P}),n.refetchQueries({queryKey:m(j.entryUUID)}),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:j.frontendContextUUID})}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)})}}}),{mutate:T}=Rt({mutationFn:async({entryUUID:N,oldCollectionUUID:D,callback:j})=>{if(D)return await YR({collectionUUID:D,entryUUID:N,reason:e}),j?.(),y("remove"),{entryUUID:N,oldCollectionUUID:D}},onMutate:async({entryUUID:N,oldCollectionUUID:D,frontendContextUUID:j,collectionSlug:F})=>{await n.cancelQueries({queryKey:f}),await n.cancelQueries({queryKey:Xt()});const R=n.getQueryData(f),P=n.getQueryData(Xt());return j&&(h(L=>L?L.map(U=>U.frontend_context_uuid===j?{...U,collection_info:void 0,bookmark_state:"NOT_BOOKMARKED"}:U):[]),n.setQueryData(be.makeQueryKey(i,{frontend_context_uuid:j}),L=>L?L.map(U=>U.frontend_context_uuid===j?{...U,collection_info:null,bookmark_state:"NOT_BOOKMARKED"}:U):[])),n.setQueryData(f,L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>N===$.uuid&&$.collection?.uuid===D?{...$,collection:null}:$));return{...L,pages:U}}),n.setQueryData(Xt(),L=>{L=L||{pages:[],pageParams:[]};const U=L.pages.map(O=>O.map($=>$.uuid===D?{...$,thread_count:$.thread_count-1}:$));return n.setQueryData(m(N),O=>O&&Array.isArray(O.pages)?{...O,pages:O.pages.map($=>$.map(G=>G.uuid===N?{...G,collection_info:null}:G))}:{...O,collection_info:null}),{...L,pages:U}}),F&&n.setQueriesData({queryKey:v4(F),exact:!1},L=>cSe(L)?{...L,pages:L.pages.map(U=>U.filter(O=>O.uuid!==N))}:L),{previousThreads:R,previousCollections:P}},onError:(N,D,j)=>{j&&(n.setQueryData(f,j.previousThreads),n.setQueryData(Xt(),j.previousCollections))},onSuccess:(N,D)=>{if(n.invalidateQueries({queryKey:m(D.entryUUID)}),n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey("results")}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:be.makeQueryKey(i,{frontend_context_uuid:D.frontendContextUUID})}),D.collectionSlug){const j=bd({collection_slug:D.collectionSlug});n.invalidateQueries({queryKey:j}),n.invalidateQueries({queryKey:na(D.collectionSlug)})}}}),{mutate:k}=Rt({mutationFn:async N=>{await S_e({collectionUuid:N,reason:e})},onSuccess:(N,D)=>{n.invalidateQueries({queryKey:Xt()}),n.invalidateQueries({queryKey:be.makeQueryKey(Sm)}),n.invalidateQueries({queryKey:Xm()}),n.invalidateQueries({queryKey:wm()}),n.invalidateQueries({queryKey:be.makeQueryKey(ry)}),n.invalidateQueries({queryKey:pp()}),n.setQueryData(Xt(),j=>!j||!j.pages?j:{...j,pages:j.pages.map(F=>F.filter(R=>R.uuid!==D))})}}),{mutate:I}=Rt({mutationFn:async({collectionUuid:N,link:D,reason:j})=>{const{data:F,error:R,response:P}=await de.POST("/rest/collections/focused_web_config/links",j,{timeoutMs:Qe(),body:{collection_uuid:N,link:D},numRetries:1});if(R)throw new he("API_CLIENTS_ERROR",{cause:R,status:P.status??0,details:{reason:j}});return F},onSettled:(N,D,j,F)=>{n.invalidateQueries({queryKey:na(j.collectionSlug)})}}),{mutate:M}=Rt({mutationFn:async({collectionUuid:N,link:D,reason:j})=>{const{error:F,response:R}=await de.DELETE("/rest/collections/focused_web_config/links",j,{body:{collection_uuid:N,link:D},timeoutMs:Qe(),numRetries:1});if(F)throw new he("API_CLIENTS_ERROR",{cause:F,status:R.status??0})},onSettled:(N,D,j,F)=>{n.invalidateQueries({queryKey:na(j.collectionSlug)})}});return d.useMemo(()=>({updateCollectionInfo:x,updateCollectionAccessLevel:v,createCollectionForThread:b,createCollection:_,bookmarkFromFeed:w,removeBookmarkFromFeed:S,firstTimeBookmark:C,swapThreadCollection:E,removeThreadFromCollection:T,deleteCollection:k,addLink:I,removeLink:M}),[I,w,b,_,k,C,S,M,T,E,v,x])},hSe=()=>{const{$t:e}=J(),t=Rn(),{createCollection:n,createCollectionForThread:r}=pSe({reason:"create-new-space"}),s=d.useCallback(()=>{const a=e({defaultMessage:"New Space",id:"t5xj3BH/Ni"});n({title:a,description:"",emoji:"",instructions:"",accessLevel:B7,enableWebByDefault:!0,callback:i=>{t.push(`/spaces/${i.slug}`)}})},[n,e,t]),o=d.useCallback((a,i)=>{const c=e({defaultMessage:"New Space",id:"t5xj3BH/Ni"});r({title:c,description:"",emoji:"",instructions:"",accessLevel:B7,enableWebByDefault:!0,entryUUID:a,frontendContextUUID:i,callback:u=>{t.push(`/spaces/${u.slug}`)}})},[r,e,t]);return d.useMemo(()=>({handleCreateNewSpace:s,handleCreateNewSpaceForThread:o}),[s,o])};function gSe({reason:e}){const t=Yt(),n=iu();return Rt({mutationKey:["publishArticleMutation"],mutationFn:async({connectorName:r,connectionUUID:s,deleteFiles:o,autoDeleteEmailAssistant:a})=>a?await QR({connectorName:r,reason:e,autoDeleteEmailAssistant:a,connectionUUID:s}):s&&!o?await y_e({connectionUUID:s,reason:e}):s&&o?await x_e({connectionUUID:s,reason:e}):await QR({connectorName:r,reason:e,autoDeleteEmailAssistant:a}),onSettled:async(r,s,o)=>{await t.refetchQueries({queryKey:n}),o.autoDeleteEmailAssistant&&(await t.invalidateQueries({queryKey:m2e()}),await t.invalidateQueries({queryKey:p2e()}))},onMutate:async({connectorName:r,connectionUUID:s})=>{t.setQueryData(n,o=>{if(!o)return o;const a=o.connectors.connectors.map(i=>i.name===r&&(!s||i.connection_uuid===s)?{...i,connected:!1}:i);return{...o,connectors:{connectors:a}}})}})}const eT=async e=>{try{const{error:t}=await de.POST("/rest/homepage-widgets/upsell/interacted","homepage upsell interaction tracking",{body:{upsell_name:e.upsellName,upsell_instance_identifier:e.upsellInstanceIdentifier||null,interaction_type:e.interactionType||null},timeoutMs:Qe(),numRetries:1});t&&Z.error("Failed to mark upsell as interacted",{upsellName:e.upsellName,upsellInstanceIdentifier:e.upsellInstanceIdentifier,interactionType:e.interactionType,error:t})}catch(t){Z.error("Error marking upsell as interacted",{upsellName:e.upsellName,upsellInstanceIdentifier:e.upsellInstanceIdentifier,interactionType:e.interactionType,error:t})}},ag=()=>{const e=Wt(),{isMax:t}=$t(),{openModal:n}=pn().legacy,r=un(!1);return d.useCallback(o=>{if(!e){Z.warn("User is not logged in, skipping paywall upsell",o);return}if(t){Z.warn("User is on Max tier, skipping paywall upsell",o);return}if(Do()){if(!r){Z.error("Comet adapter not available in mobile Comet browser context");return}r.openNativeSheet("upgrade");return}n("pricingModal",o)},[e,n,t,r])};class AW extends Error{constructor(){super("Failed to open popup window")}}function ySe(e){const{url:t,name:n,options:r="width=600,height=700,popup=1",pollIntervalMs:s=500}=e;return new Promise((o,a)=>{const i=window.open(t,n,r);if(!i){a(new AW);return}const c=setInterval(()=>{i.closed&&(clearInterval(c),o())},s)})}const xSe={logged_out_image_generation:ft.IMAGE_GENERATION_IN_THREAD,logged_out_video_generation:ft.VIDEO_GENERATION_IN_THREAD,subscription_upgrade_video_generation:ft.VIDEO_GENERATION_IN_THREAD,missing_out_on_pro:ft.MISSING_OUT_ON_PRO_IN_THREAD,auto_upgrade_to_pro:ft.AUTO_UPGRADE_TO_PRO,pro_feature_limit_queries:ft.PRO_FEATURE_LIMIT_BANNER,pro_feature_limit_files:ft.PRO_FEATURE_LIMIT_BANNER,login_for_comet_agent_queries:ft.LOGIN_FOR_COMET_AGENT_QUERIES_IN_THREAD,comet_agent_queries_rate_limited:ft.COMET_AGENT_QUERIES_RATE_LIMITED_IN_THREAD,pro_upgrade:ft.PRO_UPGRADE_IN_SIDE_HOMEPAGE,max_feature_limit_labs_queries:ft.PRO_FEATURE_LIMIT_BANNER,enterprise_max_side:ft.ENTERPRISE_MAX_UPSELL,logged_out_canvas_generation:ft.CANVAS_GENERATION_IN_THREAD,free_user_canvas_generation:ft.CANVAS_GENERATION_IN_THREAD,pro_user_canvas_generation:ft.CANVAS_GENERATION_IN_THREAD,wait_for_browser_agent_confirmation:ft.BROWSER_AGENT_CONFIRMATION_IN_THREAD,research_upsell:ft.RESEARCH_UPSELL_IN_THREAD},kl=({upsellInformation:e,inFlight:t,options:n})=>{const r="upsell",s=Wt(),{openVisitorLoginUpsell:o}=du({enabled:!s}),{session:a}=Ne(),{trackEvent:i}=Xe(a),{lastResult:c}=on(),{openModal:u,closeModal:f}=pn().legacy,m=Yt();Ca();const p="?handle_upsell=true",{submitQuery:h}=Ho(),g=un(),{handleVerificationSuccess:y}=YCe({origin:ft.STUDENT_VERIFICATION_UPSELL}),x="sidecar_thread",{subscriptionTier:v}=$t(),{device:{isWindowsOS:b,isMacOS:_}}=sn(),w=Rn(),{handleConnect:S}=J4({reason:r}),{mutateAsync:C}=gSe({reason:r}),{handleCreateNewSpaceForThread:E}=hSe(),{connectors:T}=Ea({reason:r}),{overwriteSources:k,sources:I}=og({reason:r}),{handleDownloadClick:M}=FCe({isWindows:b,isUnsupportedDevice:!_&&!b}),N=ag(),{openToast:D}=hn(),{$t:j}=J(),F=e?.cta_information?.merge_auth_token,P=ZCe({linkToken:(ae=>{if(ae)try{return JSON.parse(ae)}catch{return ae}})(F),onSuccess:()=>{if(e?.cta===tn.MERGE_AUTH_CONNECTOR)return L();if(e?.cta===tn.ALLOW_CONNECTOR_AUTH)return U()}}),L=d.useCallback(()=>{const ae=e?.cta_information?.merge_auth_callback_uuid;ae&&JH({uuid:ae,success:!0,reason:"Account successfully connected"}),w.push(window.location.pathname+p)},[w,e,p]),U=d.useCallback(()=>{const ae=e?.backend_uuid||c?.backend_uuid;cl({uuid:ae,event_type:"CONNECTOR_AUTH",connector_auth_action:!0})},[e,c?.backend_uuid]),O=d.useCallback(async ae=>{const X=ae.cta_information?.connector_auth_url,ee=ae.backend_uuid||c?.backend_uuid;if(!X){Z.error("[ALLOW_CONNECTOR_AUTH] Connector auth URL is not defined",{upsellInformation:ae});return}if(!ee){Z.error("[ALLOW_CONNECTOR_AUTH] Backend UUID is not defined",{upsellInformation:ae});return}try{await ySe({url:X,name:"connector-auth"}),await cl({uuid:ee,event_type:"CONNECTOR_AUTH",connector_auth_action:!0}),n?.hideUpsell?.()}catch(le){le instanceof AW&&D({message:j({defaultMessage:"Failed to open popup window",id:"qLj32oAyS7"}),variant:"error",timeout:null}),Z.error("[ALLOW_CONNECTOR_AUTH] Connector auth failed",{upsellInformation:ae,error:le})}},[c?.backend_uuid,n,j,D]),$=d.useCallback(async ae=>{if(!ae.cta_information?.merge_auth_token){Z.error("[ALLOW_CONNECTOR_AUTH] Merge auth token is not defined",{upsellInformation:ae}),D({message:j({defaultMessage:"Failed to start authentication",id:"VykWDR53do"}),variant:"error",timeout:null});return}P()},[D,j,P]),G=d.useCallback(async ae=>ae.cta_information?.merge_auth_token?$(ae):O(ae),[$,O]),H=d.useCallback(async()=>{try{await g.setCometAsDefaultBrowser("set_default_browser")}catch{}},[g]);d.useEffect(()=>{const ae=new BroadcastChannel(eSe.UPSELL_CONNECTOR);return ae.onmessage=X=>{X.data.type===f9.CONNECTOR_COMPLETE&&(window.focus(),No(window.location.pathname+p,"Connector complete"))},()=>{ae.close()}},[p]);const Q=d.useCallback(()=>{if(!e)return;switch(e.app_location){case Ns.MODAL:i("upsell modal opened",{entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.IN_THREAD:case Ns.IN_THREAD_BOTTOM:case Ns.IN_THREAD_INPUT:i("thread upsell banner clicked",{entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata,cta:e.cta});break;case Ns.SIDEBAR:case Ns.SIDE_CARD:i("side upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.BANNER:i("banner upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break;case Ns.COMET_NTP_BANNER:i("ntp banner upsell clicked",{upsellType:e.upsell_type,upsellName:e.name,upsellUuid:e.upsell_uuid,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata});break}const ae=e.app_location===Ns.MODAL?"upsell viewed":"upsell clicked";i(ae,{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,entryUUID:c?.backend_uuid,upsellType:e.upsell_type,upsellName:e.name,cometSurface:x,subscriptionTier:v,eventMetadata:e.event_metadata,cta:e.cta})},[c,i,e,x,v]),Y=d.useCallback(()=>{c?.query_str&&h({rawQuery:c.query_str,existingEntryUUID:c.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:c.frontend_context_uuid,promptSource:"user",querySource:"rewrite-upsell",attachments:[],modelPreferenceOverride:e?.cta_information?.model_preference??"pplx_pro"})},[c,h,e]),te=d.useCallback(()=>{if(!e)return;const{permalink_new_tab:ae,permalink:X}=e.cta_information??{};X&&(ae?window.open(X,"_blank"):No(X,"Upsell permalink"))},[e]);return d.useCallback(()=>{if(!e)return;const ae=e.cta===tn.SHORTCUT_MODAL?e.cta_information?.recommended_shortcut?.name:void 0;eT({upsellName:e.name,upsellInstanceIdentifier:ae,interactionType:"click"}),Q();const X=xSe[e.name]??ft.UNSPECIFIED_GENERALIZED_UPSELL;let ee=c?.thread_url_slug?`/search/${c.thread_url_slug}${p}`:void 0;(window.location.pathname.startsWith("/b/mission-control")||window.location.pathname.startsWith("/b/assistants"))&&(ee=`/b/assistants${p}`);const re=c?.thread_url_slug?`/search/${c.thread_url_slug}`:void 0;switch(e.cta){case tn.SIGN_UP_OR_LOGIN:return;case tn.PRO_UPGRADE:{if((e.app_location===Ns.IN_THREAD||e.app_location===Ns.IN_THREAD_BOTTOM||e.app_location===Ns.IN_THREAD_INPUT)&&Do()){g.openNativeSheet("upgrade");break}N({pitchMessage:e.cta_information?.upgrade_paywall_title?{title:e.cta_information.upgrade_paywall_title}:void 0,origin:X,defaultSegment:e.upsell_type===Qs.UPGRADE_TO_ENTERPRISE?"business":void 0});break}case tn.THREAD_TO_SPACE:{if(!c?.backend_uuid)return;E(c?.backend_uuid,c?.frontend_context_uuid);break}case tn.CONNECTOR:{const ce=e.cta_information?.connector_type;if(ce==="gcal")window.open(`${window.location.origin}${d9}?connector_type=${f9.GCAL_CONNECT}`,"_blank");else if(ce){const me=T?.connectors?.find(we=>we.connection_type===ce)?.name;if(!me||!Iz(me)){w.push(d9);break}S({connectorName:me,redirectPath:ee,unauthedRedirectPath:re})}else Z.error("Unhandled upsell connector type",{connectorType:ce});break}case tn.REWRITE_ANSWER:t&&c?.backend_uuid?au({entryUUID:c?.backend_uuid,reason:"rewrite-upsell"}).catch(()=>{Z.error("Error terminating entry")}).finally(Y):Y();break;case tn.PERMALINK:{te();break}case tn.SET_DEFAULT_BROWSER:{H();break}case tn.IMAGE_ANNOUNCEMENT_MODAL:{if(!e.image_asset||!e.image_asset_low_res||!e.button_text)return;let ce=e.cta;e.upsell_type===Qs.DOWNLOAD_COMET?ce=tn.COMET_DOWNLOAD:e.upsell_type===Qs.OPEN_PERMALINK&&(ce=tn.PERMALINK),u("announcementImageModal",{imageUrlHd:e.image_asset,imageUrlLowRes:e.image_asset_low_res,title:e.title??"",description:e.description??"",upsellInformation:{...e,cta:ce}});break}case tn.COMET_DOWNLOAD:{M({upsellName:e.name});break}case tn.COMET_DOWNLOAD_1MO_PRO_INCENTIVE:{const ce=e.cta_information?.flow_type,ue=e.cta_information?.trial_extension_id;ce&&ue&&gwe({reason:"comet_upsell_clicked",flowType:ce,trialExtensionId:ue}),M({upsellName:e.name});break}case tn.MERGE_AUTH_CONNECTOR:{F&&P();break}case tn.SHORTCUT_MODAL:{const ce=e.cta_information?.recommended_shortcut;u("taskShortcutModal",{source:"thread_upsell_create",onCreated:n?.hideUpsell,shortcut:ce?{title:ce.name,prompt:ce.prompt}:void 0});break}case tn.VIRTUAL_TRY_ON_ONBOARDING_MODAL:{u("shoppingTryOnOnboardingModal",{onSuccessfulOnboarding:ce=>{m.setQueryData(Jye(),{try_on_photo_url:ce}),m.setQueryData(e2e(),!1),D({message:j({defaultMessage:"Avatar updated successfully!",id:"tjpCN5PY48"}),variant:"success",timeout:3})},onClose:()=>{f()}});break}case tn.OPEN_SHEERID_MODAL:{i("sheerid form redirect",{verificationLocationSource:ft.STUDENT_VERIFICATION_UPSELL,verificationRoleType:"student"}),u("sheerIdModal",{onSuccess:y,type:"student"});break}case tn.CONTINUE_GENERATION:{if(e.upsell_type===Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"CANVAS_GENERATION_CONFIRMATION",canvas_generation_action:!0}).then(()=>{n?.hideUpsell?.()}).catch(ue=>{Z.error("Error sending canvas confirmation",{error:ue})})}break}case tn.NO_CANVAS_GENERATION:{if(e.upsell_type===Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"CANVAS_GENERATION_CONFIRMATION",canvas_generation_action:!1}).then(()=>{n?.hideUpsell?.()}).catch(ue=>{Z.error("Error sending canvas cancellation",{error:ue})})}break}case tn.SKIP_BROWSER_AGENT:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"SKIP"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent skip",{error:ue}),D({message:j({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case tn.ALLOW_BROWSER_AGENT_ONCE:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"ALLOW_ONCE"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent allow once",{error:ue}),D({message:j({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case tn.ALWAYS_ALLOW_BROWSER_AGENT:{if(e.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION){const ce=e.backend_uuid||c?.backend_uuid;ce&&cl({uuid:ce,event_type:"BROWSER_AGENT_PERMISSION",browser_agent_action:"ALWAYS_ALLOW"}).then(()=>n?.hideUpsell?.()).catch(ue=>{Z.error("Error sending browser agent always allow",{error:ue}),D({message:j({defaultMessage:"Failed to process your choice. Please try again.",id:"9GBoXgm1Zb"}),variant:"error",timeout:null})})}break}case tn.TOGGLE_SOURCES:{const ce=e.cta_information?.sources_to_toggle;if(ce&&ce.length>0){const ue=Fx(ce);if(ue.length>0){const me=I||[],we=ue.filter(ye=>!me.includes(ye));if(we.length>0){const ye=[...me,...we];k(ye)}}n?.hideUpsell?.()}break}case tn.FULLSCREEN_MODAL:{u("fullscreenUpsellModal",{upsellInformation:e});break}case tn.ALLOW_CONNECTOR_AUTH:{G(e);break}}},[g,e,Q,c?.thread_url_slug,c?.backend_uuid,c?.frontend_context_uuid,p,o,N,u,t,E,T?.connectors,S,C,Y,te,H,M,y,F,P,n,i,j,D,f,m,w,k,I,G])},NW=({enabled:e=!0}={})=>{const n=On()==="/",{data:r,isLoading:s,isError:o}=mt({enabled:e,queryKey:i3(n),queryFn:ICe,staleTime:1/0,gcTime:1/0});return{upsellInformation:r?.upsell_information??null,productBanner:r?.product_banner_information??null,isLoading:s,isError:o}},qs={pro:Kme,collection:Kh,research:hM,labs:pM,comet_login:gM,invite:B("mail"),pro_perks:B("heart-handshake"),app:B("layout-collage"),slides:B("presentation"),document:B("file"),plaintext:B("file"),canvas:B("file"),advanced_models:B("cpu")},vSe=()=>{const{upsellInformation:e}=NW(),{session:t}=Ne(),{trackEvent:n,trackEventOnce:r}=Xe(t),s=kl({upsellInformation:e??void 0}),[o,a]=d.useState(!1);d.useEffect(()=>{e&&e.app_location==="BANNER"&&(a(!0),r("banner upsell viewed",{upsellName:e.name,upsellType:e.upsell_type,upsellUuid:e.upsell_uuid,eventMetadata:e.event_metadata}),r("upsell viewed",{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,upsellName:e.name,upsellType:e.upsell_type,eventMetadata:e.event_metadata}))},[e,r]);const i=d.useCallback(()=>{e&&(n("banner upsell dismissed",{upsellName:e.name,upsellType:e.upsell_type,upsellUuid:e.upsell_uuid,eventMetadata:e.event_metadata}),n("upsell dismissed",{upsellLocation:e.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:e.upsell_uuid,upsellName:e.name,upsellType:e.upsell_type,eventMetadata:e.event_metadata}),a(!1),eT({upsellName:e.name,interactionType:"dismiss"}))},[e,n]),c=d.useMemo(()=>{if(e&&e.icon_reference&&e.icon_reference in qs)return qs[e.icon_reference]},[e]);return d.useMemo(()=>({show:o&&!!e,onDismiss:i,onClick:s,icon:c,title:e?.title,actionLabel:e?.button_text}),[i,s,o,c,e])},h9={RAMP:"Welcome Ramp members. Your 6 month Perplexity Pro free trial starts now!",FREEATT:"Welcome ATT Employees. Your complimentary 1-year subscription starts now!",FREEAWS:"Welcome AWS Employees. Your complimentary 1-year subscription starts now!",RABBIT:"Welcome r1 owners. Your complimentary 1-year Perplexity Pro subscription starts now!",FREEUT:"Welcome UT Staff. Your complimentary 1-year Perplexity Pro subscription starts now!",FREEDATABRICKS:"Welcome Databricks team. Your complimentary 1-year Perplexity Pro subscription starts now!",FREESRA:"Welcome SRA team. Your complimentary 1-year Perplexity Pro subscription starts now!",HBSTECH:"Welcome HBS Tech Conference Attendees. Your complimentary 6 month Perplexity Pro subscription starts now!",HBSSTAFF:"Welcome HBS Tech Conference Attendees. Your complimentary 1 year Perplexity Pro subscription starts now!",FREENEWSROOM:"Welcome Friends! Your complimentary 1-year Perplexity Pro subscription starts now!",FREEINKITT:"Welcome Inkitt Writers! Your complimentary 1-year subscription to Perplexity Pro starts now!",FREETIME:"Welcome Time team! Your complimentary 1-year subscription to Perplexity Pro starts now!",FREETMOBILE:"Welcome T-Mobile team! Your complimentary 1-year subscription to Perplexity Pro starts now!","11LABS":"Welcome! Your complimentary 3-month subscription to Perplexity Pro starts now!",FREECAVS:"Welcome Cavs team! Your complimentary 1-year Perplexity Pro subscription starts now!",NOTHING6:"Welcome Nothing owners. Your complimentary 6-month Perplexity Pro subscription starts now!",FREENOTHING6:"Welcome Nothing owners. Your complimentary 6-month Perplexity Pro subscription starts now!",NOTHING1:"Welcome Nothing owners. Your complimentary 1-year Perplexity Pro subscription starts now!",FREENOTHING1:"Welcome Nothing owners. Your complimentary 1-year Perplexity Pro subscription starts now!",HOOHACKS:"Welcome HooHacks Community. Your 1-year Perplexity Pro free trial starts now!",NJED:"Welcome NJ ED Community. Your 1-year Perplexity Pro free trial starts now!",COPYAI:"Welcome Copy AI customers! Your 6-month complimentary Perplexity Pro subscription starts now!",RAYCAST6:"Welcome Raycast users! Your 6-month complimentary Perplexity Pro subscription starts now!",RAYCAST3:"Welcome Raycast users! Your 3-month complimentary Perplexity Pro subscription starts now!",FREEMAGENTALOVE:"Welcome Deutsche Telekom! Your complimentary 1-year Perplexity Pro subscription starts now!",FREEPPLXVIP:"Welcome friend of Perplexity! Your complimentary 1-year Perplexity Pro subscription starts now.",FREEUTA1:"Welcome UTA team! Your complimentray 1-year Perplexity Pro subscription starts now.",DT:"Willkommen Deutsche Telekom Kunde! Sie erhalten dank Magenta Moments ein kostenloses 1-Jahres-Abonnement für Perplexity Pro.",MY:"Welcome! Your complimentary 1-year Perplexity Pro subscription starts now."},O0="pplx.discount_code",I_="pplx.discount_code_expiry",bSe=()=>{const[e,t]=d.useState(null),[n,r]=d.useState(null),s=Rn(),o=fn(),a=On(),i=o?.get("discount_code"),{$t:c}=J(),u=Array.isArray(i)?i[0]:i,[f,m]=d.useState(u||null),{hasAccessToProFeatures:p}=$t(),h=d.useCallback(()=>{vt.removeItem(O0),vt.removeItem(I_),r(null),t(null)},[]),g=d.useCallback(()=>{h(),m(null)},[h]),y=d.useCallback(()=>{if(n&&e)return;const b=vt.getItem(O0);b?.startsWith("REPLIT")?(t("/static/images/replit.svg"),r("/static/images/replit_dark.svg")):b?.startsWith("BREX")?(t("/static/images/brex.svg"),r("/static/images/brex_dark.svg")):(r(null),t(null))},[n,e]),x=d.useCallback(()=>{const b=vt.getItem(O0),_=vt.getItem(I_);if(p){h();return}if(!(!b&&!u)){if(_&&new Date(_){for(const _ in h9)if(b&&b.startsWith(_))return h9[_];return c({defaultMessage:"Redeem your promo code {discountCode}. Get started",id:"Vapo/CiOwF"},{discountCode:b})},[c]);return d.useEffect(()=>{x()},[u,x]),d.useMemo(()=>({discountCode:f,setDiscountCode:m,partnerLogoDark:n,partnerLogoLight:e,message:v(f??""),clearDiscountCode:g}),[g,f,v,n,e])},_Se=()=>{const{status:e}=Ne(),t=ZH(),{isGovernmentRequestOrigin:n}=Yr(),{isEnterprise:r}=$t();return{isLoading:e==="loading"||t,isEnterpriseOrGovtUser:r||n===!0}},wSe=()=>be.makeQueryKey("get_experiments_attributes",{}),CSe=async({reason:e,headers:t={}})=>{try{const{data:n,error:r}=await de.GET("/rest/experiments/attributes",e,{headers:t,timeoutMs:Qe({productionMs:2e3}),numRetries:1});return r?(Z.error("Failed to fetch experiment attributes",{error:r,reason:e}),null):n??null}catch(n){return Z.error("Error fetching experiment attributes",{error:n,reason:e}),null}},SSe=()=>{const e=Wt(),{data:t,isLoading:n,error:r}=mt({queryKey:wSe(),queryFn:()=>CSe({reason:"check if user is an existing comet user"}),staleTime:300*1e3,gcTime:300*1e3,enabled:e,retry:!1});return{isExistingCometUser:d.useMemo(()=>{if(t)return t.server_is_comet_eligible===!1},[t]),isLoading:n,error:r}},ESe=async({reason:e})=>{try{const{data:t,error:n,response:r}=await de.GET("/rest/user/promotions",e,{timeoutMs:Qe({productionMs:2e3})});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch user promotions",cause:n,status:r.status??0});return t}catch{return{campaign:null,offer:null,institution:null}}},zvt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.GET("/rest/billing/get-customer-portal",t,{headers:e,timeoutMs:3e3});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to get customer portal",cause:r,status:s.status??0});if(n.status!=="success")throw new he("API_CLIENTS_ERROR",{message:"Failed to get customer portal",cause:r,status:s.status??0});return n.url}catch{return null}};async function kSe({currency:e,reason:t,subscriptionTier:n}){const{data:r,error:s,response:o}=await de.GET("/rest/stripe/prices",t,{timeoutMs:Cn.NONE,params:{query:{currency:e,subscription_tier:n}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch prices",cause:s,status:o.status??0});return r}const Wvt=({currency:e,reason:t,subscriptionTier:n})=>mt({queryKey:be.makeQueryKey("prices",e,n),queryFn:()=>kSe({currency:e,reason:t,subscriptionTier:n}),gcTime:300*1e3,staleTime:120*1e3}),Gvt=async({request:e,reason:t})=>{const n=Nx(),r={"content-type":"application/json",...n?{"Screen-Dimensions":n}:{}};try{const{data:s,error:o,response:a}=await de.POST("/rest/stripe/checkout-session",t,{body:{referral_code:e.referralCode,discount_code:e.discountCode,origin:e.origin,tier:e.tier,locale:e.locale,embedded:e.embedded??!1,subscription_tier:e.subscriptionTier,success_redirect_url:e.success_redirect_url},timeoutMs:5e3,headers:r,reason:t});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0,details:{reason:t}});return{subscriptionStatus:s.subscription_status,status:s.status,url:s.url??null,clientSecret:s.client_secret??void 0,errorCode:s.error_code??void 0,subscriptionTier:e.subscriptionTier}}catch{return}},$vt=async({headers:e,reason:t})=>{try{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/create-setup-intent-and-customer-session",t,{timeoutMs:Qe({productionMs:3e3}),headers:e});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0,details:{reason:t}});return{customerId:n.customer_id,clientSecret:n.client_secret,customerSessionClientSecret:n.customer_session_client_secret}}catch{return}},MSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/stripe/upgrade-subscription-preview",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch upgrade subscription preview",cause:r,status:s.status??0});return n},TSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/stripe/downgrade-subscription-preview",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch downgrade subscription preview",cause:r,status:s.status??0});return n},qvt=({reason:e,enabled:t})=>mt({queryKey:a2e(),queryFn:()=>MSe({reason:e}),gcTime:0,staleTime:0,enabled:t}),Kvt=({reason:e})=>mt({queryKey:be.makeQueryKey("downgrade-subscription-preview"),queryFn:()=>TSe({reason:e}),gcTime:0,staleTime:0}),ASe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/upgrade-subscription",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to upgrade subscription",cause:r,status:s.status??0});return n},Yvt=({reason:e},t)=>{const n="useUpgradeSubscription";return Rt({retry:!1,mutationFn:()=>ASe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},NSe=async({headers:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/stripe/downgrade-subscription",t,{headers:{"content-type":"application/json",...e},timeoutMs:Cn.HIGH});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to downgrade subscription",cause:r,status:s.status??0});return n},Qvt=({reason:e},t)=>{const n="useDowngradeSubscription";return Rt({mutationFn:()=>NSe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},RSe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/stripe/subscription-changes",e,{headers:{"content-type":"application/json"},timeoutMs:Cn.HIGH});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to fetch subscription changes",cause:n,status:r.status??0});return t},Xvt=({reason:e,enabled:t})=>mt({queryKey:i2e(),queryFn:()=>RSe({reason:e}),gcTime:0,staleTime:0,enabled:t}),DSe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.POST("/rest/stripe/cancel-downgrade-subscription",e,{headers:{"content-type":"application/json"},timeoutMs:Cn.HIGH});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to cancel downgrade",cause:n,status:r.status??0});return t},Zvt=({reason:e},t)=>{const n="useCancelDowngrade";return Rt({retry:!1,mutationFn:()=>DSe({reason:e}),onError:r=>{Z.error(`Error in ${n}:`,r)},...t})},Jvt=async({paymentMethodUUID:e,optedIn:t})=>{const n="visa-opt-in-submit",{data:r,error:s,response:o}=await de.POST("/rest/billing/personalization/update",n,{body:{enabled:t,payment_method_uuid:e}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to redeem visa",cause:s,status:o.status??0});return r},ebt=async()=>{const{data:e,error:t}=await de.GET("/rest/billing/braintree/subscription-details","braintree-modal-fetch-details",{timeoutMs:5e3});if(t)throw t;return e},tbt=async({payment_method_type:e})=>{const{data:t,error:n}=await de.POST("/rest/billing/braintree/cancel-subscription","braintree-modal-cancel",{timeoutMs:5e3,body:{payment_method_type:e}});if(n)throw n;return t},nbt=async({payment_method_type:e})=>{const{data:t,error:n}=await de.POST("/rest/billing/braintree/renew-subscription","braintree-modal-renew",{timeoutMs:3e3,body:{payment_method_type:e}});if(n)throw n;return t},jSe=({reason:e})=>{const{$t:t}=J(),{data:n,isLoading:r}=mt({queryKey:qye(),queryFn:()=>ESe({reason:e})}),s=!!n?.institution;let o=n?.offer?.discount_str??void 0;!o&&s&&(o=t({defaultMessage:"$4.99",id:"ngR/pJs1LV"}));const a=n?.offer?.discount_type??void 0;return d.useMemo(()=>({userPromotionsLoading:r,discountPrice:o,discountType:a,showStudentDiscountContent:s,campaignId:n?.campaign?.id,institution:n?.institution}),[n?.campaign?.id,n?.institution,o,a,r,s])};function ISe(){const[e,t]=Qi("pplx.partner_banner",null);return[e,t]}function PSe(){const[e,t]=Qi("pplx.partner_discount_code",null);return[e,t]}const OSe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"org-invitation-banner",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function LSe({reason:e,enabled:t=!0}){const{variation:n}=OSe(!1),r=Wt(),s=lu(),o=r&&!s&&t&&n,{data:a,isLoading:i}=mt({enabled:o,queryKey:Xye(),queryFn:()=>A2e({reason:e}),staleTime:600*1e3,gcTime:3600*1e3,refetchOnMount:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!1});return{pendingInvitation:a??null,isLoading:i}}const FSe="back_to_school_winner",BSe="EDUFREEYEAR",USe=Ce(async()=>{const{UberOnePromoBanner:e}=await Se(()=>q(()=>import("./UberOnePromoBanner-CYfGDUlm.js"),__vite__mapDeps([128,4,1,6,3,129,9,7,8,10,11,12])));return{default:e}}),VSe=Ce(async()=>{const{DiscountCodeBanner:e}=await Se(()=>q(()=>import("./DiscountCodeBanner-l96J_LHj.js"),__vite__mapDeps([130,4,1,6,3,22,129,9,7,8,10,11,12])));return{default:e}}),g9=Ce(async()=>{const{PartnerBanner:e}=await Se(()=>q(()=>import("./PartnerBanner-BL7xfhwx.js"),__vite__mapDeps([131,4,1,8,3,9,6,7,129,10,11,12])));return{default:e}}),HSe=Ce(async()=>{const{OrgUpgradeBillingBanner:e}=await Se(()=>q(()=>import("./OrgBillingBanner-F7N-p4UC.js"),__vite__mapDeps([132,4,1,6,3,133,129,9,7,8,10,11,12])));return{default:e}}),zSe=Ce(async()=>{const{OrgInvitationBanner:e}=await Se(()=>q(()=>import("./OrgInvitationBanner-CrpdJghk.js"),__vite__mapDeps([134,4,1,6,3,129,9,7,8,10,11,12])));return{default:e}}),WSe=Ce(async()=>{const{AppBannerUpsell:e}=await Se(()=>q(()=>import("./AppBannerUpsell-Bph65qqz.js"),__vite__mapDeps([135,4,1,129,9,3,6,7,8,10,11,12])));return{default:e}}),GSe=Ce(async()=>{const{CometDownloadBannerUpsell:e}=await Se(()=>q(()=>import("./CometDownloadBannerUpsell-BTaMxe5H.js"),__vite__mapDeps([136,4,1,6,3,129,9,7,8,10,11,12])));return{default:e}}),$Se=e=>["/onboarding/org/create"].includes(e);function qSe(){const e="app-banner-inner",{isMobileUserAgent:t}=Re(),{message:n,discountCode:r,clearDiscountCode:s}=bSe(),{hasAccessToProFeatures:o,isEnterprise:a}=$t(),i=lu(),[c]=ISe(),[u]=PSe(),f=On(),{organization:m,orgUser:p}=mo({reason:e}),{pendingInvitation:h}=LSe({reason:e}),g=i&&!a,y=p?.role==="ADMIN",{isLoading:x,isEnterpriseOrGovtUser:v}=_Se(),b=fn(),w=jSe({reason:e}).campaignId===FSe,[S,C]=Qi("pplx.back_to_school_winner_banner_dismissed",!1),{show:E,title:T,actionLabel:k}=vSe(),{productBanner:I}=NW(),{isExistingCometUser:M,isLoading:N}=SSe();return x||N?null:f==="/"&&I?.name==="comet_download_banner"&&I?.app_location===Ns.BANNER&&I?.title&&I?.button_text&&!v&&!M?l.jsx(GSe,{title:I.title,actionLabel:I.button_text}):E&&T&&k?l.jsx(WSe,{}):h&&!m&&!p?l.jsx(zSe,{orgName:h.organization_name,invitationUUID:h.invitation_uuid}):y&&g&&!$Se(f??"")&&!t?l.jsx(HSe,{orgStripeStatus:m?.stripe_status}):/(^\/$)|(^\/search)/.test(f??"")&&c?l.jsx(g9,{partnerCode:c,partnerDiscountCode:u}):r&&!o&&!c?l.jsx(VSe,{message:n,discountCode:r,clearDiscountCode:s}):b?.get("utm_campaign")==="morningbrew_083024"&&b?.get("utm_source")==="newsletter"?l.jsx(USe,{}):w&&!S?l.jsx(g9,{partnerCode:"edu",partnerDiscountCode:BSe,bannerVariant:"orange",onClose:()=>{C(!0)}}):null}const Kc={"fill-foreground":"--foreground-color","fill-quiet":"--foreground-quiet-color","fill-inverse":"--foreground-inverse-color","fill-light":"--dark-foreground-color","fill-dark":"--light-foreground-color","fill-super":"--super-color","fill-caution":"--caution-color","fill-max":"--max-color","stroke-foreground":"--foreground-color","stroke-quiet":"--foreground-quiet-color","stroke-subtler":"--foreground-subtler-color","stroke-inverse":"--foreground-inverse-color","stroke-light":"--dark-foreground-color","stroke-dark":"--light-foreground-color","stroke-super":"--super-color","stroke-caution":"--caution-color"},RW=A.memo(({lineColor:e,width:t,fillColor:n,...r})=>{const s=z("h-auto group",t),o=Kc[n]||"--foreground-color",a=Kc[e]||"--foreground-color";return l.jsx("div",{className:s,style:{"--logo-fill":`oklch(var(${o}))`,"--logo-stroke":`oklch(var(${a}))`},...r,children:l.jsx("svg",{viewBox:"0 0 400 91",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-full"})})})});RW.displayName="Full";const DW=A.memo(({width:e,fillColor:t,...n})=>{const r=z("h-auto group",e),s=Kc[t]||"--foreground-color";return l.jsx("div",{className:r,style:{color:`oklch(var(${s}))`},...n,children:l.jsx("svg",{viewBox:"0 0 1456 187",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-labs"})})})});DW.displayName="Labs";const jW=A.memo(({fillColor:e,width:t,...n})=>{const r=z("h-auto group",t),s=Kc[e]||"--foreground-color";return l.jsx("div",{className:r,style:{color:`oklch(var(${s}))`},...n,children:l.jsx("svg",{viewBox:"0 0 30 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-auto w-full",children:l.jsx("use",{href:"#pplx-logo-mark"})})})});jW.displayName="Mark";const IW=A.memo(({width:e="w-14",fillColor:t="fill-max",svgClassName:n,...r})=>{const s=z("h-auto group",e),o=Kc[t]||"--max-color";return l.jsx("div",{className:s,style:{color:`oklch(var(${o}))`},...r,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 99 36",className:n,children:l.jsx("use",{href:"#pplx-logo-max"})})})});IW.displayName="Max";const PW=A.memo(({width:e="w-10",sizeVariant:t="regular",fillColor:n="fill-super",svgClassName:r,...s})=>{const o=z("h-auto group",e),a=Kc[n]||"--super-color",i=t==="small"?"pplx-logo-pro-small":"pplx-logo-pro";return l.jsx("div",{className:o,style:{color:`oklch(var(${a}))`},...s,children:t==="small"?l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1102.02 529.46",className:r,children:l.jsx("use",{href:`#${i}`})}):l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 804.75 382.36",className:r,children:l.jsx("use",{href:`#${i}`})})})});PW.displayName="Pro";const OW=A.memo(({width:e,fillColor:t,isPro:n,isMax:r,isEnterprise:s,...o})=>{const a=z("h-auto group",e),i=Kc[t]||"--foreground-color";return s&&n?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--super-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 797 82",children:l.jsx("use",{href:"#pplx-logo-word-ent-pro"})})}):s&&r?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--max-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 797 82",children:l.jsx("use",{href:"#pplx-logo-word-ent-max"})})}):n?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--super-color))"},...o,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 3913.07 632",children:l.jsx("use",{href:"#pplx-logo-word-pro"})})}):r?l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`,"--logo-brand-fill":"oklch(var(--max-color))"},...o,children:l.jsx("svg",{viewBox:"0 0 485 74",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-word-max"})})}):l.jsx("div",{className:a,style:{color:`oklch(var(${i}))`},...o,children:l.jsx("svg",{viewBox:"0 0 962 202",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("use",{href:"#pplx-logo-word"})})})});OW.displayName="Word";const KSe={tiny:"w-4 md:w-6",small:"",md:"w-10","md-large":"w-20",large:"w-24",xl:"w-36"},YSe="w-6 md:w-8",Gd=A.memo(({size:e="large",includeEffects:t=!1,isPro:n=!1,isMax:r=!1,isEnterprise:s=!1,variant:o="full",color:a="foreground",...i})=>{let c="w-28 md:w-[140px]";e==="tiny"?c="w-14 md:w-16":e==="small"?c="w-24":e==="large"?c="w-40 md:w-52":e==="xl"&&(c=s?"w-72":"w-64");const u=KSe?.[e]||YSe;let f="w-6";e==="large"?f="w-12":e==="md-large"?f="w-8":e==="xl"&&(f="w-36");const m=z("",{"stroke-foreground":a==="foreground","stroke-quiet":a==="quiet","stroke-super":a==="super"||a==="mixed","stroke-caution":a==="caution","stroke-light":a==="white","stroke-inverse":a==="background","group-hover:stroke-super transition-colors duration-300":t}),p=z({"fill-foreground":a==="foreground"||a==="mixed","fill-quiet":a==="quiet","fill-super":a==="super","fill-caution":a==="caution","fill-light":a==="white","fill-inverse":a==="background","group-hover:fill-super transition-colors duration-300":t});return o==="pro"?l.jsx(PW,{width:f,fillColor:p,...i}):o==="max"?l.jsx(IW,{width:f,...i}):o==="mark"?l.jsx("div",{className:z({"transition-all duration-300 ease-in-out hover:scale-105":t}),children:l.jsx(jW,{fillColor:p,width:u,...i})}):o==="text"?l.jsx(OW,{fillColor:p,width:c,isPro:n,isMax:r,isEnterprise:s,...i}):o==="full"?l.jsx(RW,{fillColor:p,lineColor:m,width:c,...i}):o==="labs"?l.jsx(DW,{width:c,fillColor:p,...i}):null});Gd.displayName="Logo";const QSe="https://perplexity.sng.link/A6awk/ppas?_smtype=3&pvid=",rbt="https://perplexity.sng.link/A6awk/rcv6y?_smtype=3&pvid=",XSe=({origin:e,linkPrefix:t=QSe,isCanonicalDeeplink:n=!1})=>{const r=CU(),[s,o]=d.useState(t),{sendAppDownloadClickedEventSingular:a}=JM(),i=On(),c=d.useMemo(()=>{const f=new URLSearchParams;return f.set("origin",e),r&&f.set("pvid",r),i&&f.set("pathname",i),f.toString()},[r,e,i]);d.useEffect(()=>{(async()=>{const{singularSdk:m}=await q(async()=>{const{singularSdk:g}=await import("./singular-sdk-C08EBV6K.js").then(y=>y.s);return{singularSdk:g}},[]);for(;!m._isInitialized;)await new Promise(g=>setTimeout(g,100));let p=null;if(i){const g=i.startsWith("/")?i.slice(1):i;n?p=`${m7}//canonical-page?url=https://www.perplexity.ai/app/${g}`:p=`${m7}//${g}`}const h=m.buildWebToAppLink(`${t}${r}&_ios_dl=${encodeURIComponent(p??"")}&_android_dl=${encodeURIComponent(p??"")}`,p,c,p);o(h)})()},[r,i,c,t,n]);const u=d.useCallback(()=>{Lfe(),a(e),No(s,"Singular download app")},[s,e,a]);return d.useMemo(()=>({downloadAppLink:s,handleAppDownloadClicked:u}),[s,u])};function ZSe(e,t){d.useEffect(()=>{if(typeof window>"u")return;const r=window.cookieStore;if(!r)return;const s=o=>{const a=o.deleted.find(c=>c.name===e),i=o.changed.find(c=>c.name===e);if(a||i){t(i??null);return}};return r.addEventListener("change",s),()=>{r.removeEventListener("change",s)}},[e,t])}const LW=()=>{const e=d.useCallback(n=>{const r=document.documentElement,s=n??mr("colorSchemeTheme"),o=JU(s);o?r.setAttribute("data-theme",o):r.removeAttribute("data-theme")},[]),t=d.useMemo(()=>Cf(e,100),[e]);ZSe("colorSchemeTheme",n=>{t(n?.value)}),d.useEffect(()=>{e()},[e])},FW=Ft("AppLayoutContext",void 0),JSe=()=>{const e=d.useContext(FW);if(!e)throw new Error("useAppLayout must be used within an AppLayoutProvider");return e},e3e=({children:e})=>{const[t,n]=d.useState(!1);return LW(),l.jsx(FW.Provider,{value:{isMobileSidebarOpen:t,setMobileSidebarOpen:n},children:e})},t3e=({className:e})=>{const{inApp:t}=Sa(),{isMobileSidebarOpen:n,setMobileSidebarOpen:r}=JSe();return t?null:l.jsx(st,{icon:B("menu-2"),pill:!0,onClick:()=>r(!n),extraCSS:e})},Ge=d.memo(e=>{const{variant:t="common",disabled:n,extraCSS:r,...s}=e,{buttonClass:o}=d.useMemo(()=>{const a={disabled:"bg-subtle text-quiet",primary:"bg-super text-inverse hover:opacity-80",primaryGhost:"border border-super/20 bg-super/10 hover:bg-super/20 hover:border-super/30 text-super",common:"bg-subtle text-foreground md:hover:text-quiet",border:"border border-subtler text-quiet md:hover:border-subtle md:hover:text-quiet hover:bg-subtler bg-base",inverted:"bg-inverse text-inverse hover:opacity-80",rejecter:"border border-subtlest text-caution dark:hover:text-foreground hover:bg-caution/30 hover:border-caution/20 bg-base",rejected:"bg-caution hover:opacity-50 text-white",orange:"bg-attention text-white hover:opacity-50",maxGold:"bg-max dark:text-inverse hover:opacity-80"},i=n?a.disabled:a[t];return{buttonClass:z(i,r)}},[t,n,r]);return l.jsx(H4,{extraCSS:o,disabled:n,variant:t,...s})});Ge.displayName="Button";const n3e=A.memo(({})=>{const{$t:e}=J(),{session:t}=Ne(),{trackEvent:n}=Xe(t),r=d.useCallback(()=>{n("click logo",{})},[n]),{device:{isIOS:s}}=sn(),{handleAppDownloadClicked:o}=XSe({origin:"mobile-header"}),a=d.useMemo(()=>s?Yme:B("brand-android"),[s]);return l.jsx(K,{variant:"background",className:"px-sm h-headerHeight sticky inset-x-0 top-0 z-10 flex w-full items-center md:mb-0",children:l.jsxs("div",{className:"gap-x-sm pl-xs flex w-full items-center justify-between md:hidden",children:[l.jsxs("div",{className:"gap-x-sm flex items-center",children:[l.jsx(t3e,{className:"-ml-sm"}),l.jsx(yt,{href:"/",onClick:r,children:l.jsx(Gd,{variant:"text",size:"small"})})]}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx("div",{className:"animate-in fade-in duration-300",children:l.jsx(Ge,{size:"small",pill:!0,variant:"primary",icon:a,text:e({defaultMessage:"Open in App",id:"fo3x6hDxdZ"}),onClick:o})})})]})})});n3e.displayName="MobileProductHeader";const y9=200,tT=Ft("ScrollContainerRefContext",null),r3e=({children:e,scrollContainerRef:t})=>l.jsx(tT.Provider,{value:{scrollContainerRef:t},children:e}),ka=()=>{const e=d.useContext(tT);if(!e)throw new Error("useScrollContainerRef must be used within a ScrollContainerRefProvider");return e},BW=A.memo(e=>{const{children:t,inRenderingPlace:n}=e,s=Ga().erp;return n&&n===s||!n&&s!==void 0?null:l.jsx(l.Fragment,{children:t})});BW.displayName="HideInEntropy";const s3e=()=>{const{locale:e}=J();return Hme(e)==="rtl"};Ce(async()=>{const{MobileSidebar:e}=await Se(()=>q(()=>import("./MobileSidebar-C4bvEgiR.js"),__vite__mapDeps([137,4,1,9,3,6,7,8,10,11,12])));return{default:e}});const o3e=({children:e,ref:t})=>{const n=d.useRef(null);return l.jsx(e3e,{children:l.jsx(r3e,{scrollContainerRef:n,children:l.jsx(K,{variant:"background",children:l.jsx("div",{className:"isolate flex h-dvh",ref:t,children:e})})})})},a3e=({children:e,fillHeight:t=!0,hasSidebar:n,ref:r})=>{const[s]=Wd("isSidebarPinned",!1),{isMobileStyle:o}=Re({evaluateOnInit:!0}),a=On(),i=n&&!zz(a),c=s&&!o&&i,u=s3e(),f=d.useMemo(()=>u?{paddingRight:c?y9:0}:{paddingLeft:c?y9:0},[u,c]);return l.jsxs("div",{style:{...f,transition:"padding-left 0.2s cubic-bezier(0.16, 1, 0.3, 1), padding-right 0.2s cubic-bezier(0.16, 1, 0.3, 1)"},className:"erp-tab:p-0 md:gap-xs erp-tab:gap-0 isolate flex h-auto max-h-screen min-w-0 grow flex-col",ref:r,children:[l.jsx(BW,{inRenderingPlace:"sidecar",children:l.jsx(qSe,{})}),l.jsxs(K,{variant:"background",className:"@container/main relative isolate min-h-0 flex-1 overflow-clip bg-clip-border",children:[l.jsx("div",{className:z("mx-auto flex w-full flex-col",{"h-full":t}),children:e}),l.jsx(K,{className:z("rounded-inherit pointer-events-none absolute inset-0 z-20 hidden md:dark:block",i&&"md:!border-y-0 md:!border-r-0")})]})]})},Qx=({children:e,className:t,childrenWidth:n,containerClassName:r=""})=>{const{isMobileUserAgent:s}=Re(),o=Vi(n).with("small",()=>"max-w-screen-sm px-md md:px-lg").with("default",()=>"max-w-screen-md px-md md:px-lg").with("static",()=>"max-w-screen-lg px-md py-lg md:px-xl").with("large",()=>"max-w-threadWidth px-md md:px-lg").with("none",()=>"max-w-none").otherwise(()=>"max-w-screen-md px-md md:px-lg"),i=d.useContext(tT)?.scrollContainerRef;return l.jsx("div",{ref:i,className:z("scrollable-container flex flex-1 basis-0 overflow-auto [scrollbar-gutter:stable]",{"scrollbar-subtle":!s},t),children:l.jsx("div",{className:z("mx-auto size-full",o,r),children:e})})};function UW(e){const t=e+"CollectionProvider",[n,r]=Vs(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:x,children:v}=y,b=A.useRef(null),_=A.useRef(new Map).current;return l.jsx(s,{scope:x,itemMap:_,collectionRef:b,children:v})};a.displayName=t;const i=e+"CollectionSlot",c=qp(i),u=A.forwardRef((y,x)=>{const{scope:v,children:b}=y,_=o(i,v),w=Sn(x,_.collectionRef);return l.jsx(c,{ref:w,children:b})});u.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=qp(f),h=A.forwardRef((y,x)=>{const{scope:v,children:b,..._}=y,w=A.useRef(null),S=Sn(x,w),C=o(f,v);return A.useEffect(()=>(C.itemMap.set(w,{ref:w,..._}),()=>void C.itemMap.delete(w))),l.jsx(p,{[m]:"",ref:S,children:b})});h.displayName=f;function g(y){const x=o(e+"CollectionConsumer",y);return A.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const _=Array.from(b.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((C,E)=>_.indexOf(C.ref.current)-_.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},g,r]}var i3e=d.createContext(void 0);function Pf(e){const t=d.useContext(i3e);return e||t||"ltr"}var P_=0;function nT(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??x9()),document.body.insertAdjacentElement("beforeend",e[1]??x9()),P_++,()=>{P_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),P_--}},[])}function x9(){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 O_="focusScope.autoFocusOnMount",L_="focusScope.autoFocusOnUnmount",v9={bubbles:!1,cancelable:!0},l3e="FocusScope",Xx=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,c]=d.useState(null),u=Js(s),f=Js(o),m=d.useRef(null),p=Sn(t,y=>c(y)),h=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let y=function(_){if(h.paused||!i)return;const w=_.target;i.contains(w)?m.current=w:ul(m.current,{select:!0})},x=function(_){if(h.paused||!i)return;const w=_.relatedTarget;w!==null&&(i.contains(w)||ul(m.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&ul(i)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const b=new MutationObserver(v);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),b.disconnect()}}},[r,i,h.paused]),d.useEffect(()=>{if(i){_9.add(h);const y=document.activeElement;if(!i.contains(y)){const v=new CustomEvent(O_,v9);i.addEventListener(O_,u),i.dispatchEvent(v),v.defaultPrevented||(c3e(p3e(VW(i)),{select:!0}),document.activeElement===y&&ul(i))}return()=>{i.removeEventListener(O_,u),setTimeout(()=>{const v=new CustomEvent(L_,v9);i.addEventListener(L_,f),i.dispatchEvent(v),v.defaultPrevented||ul(y??document.body,{select:!0}),i.removeEventListener(L_,f),_9.remove(h)},0)}}},[i,u,f,h]);const g=d.useCallback(y=>{if(!n&&!r||h.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const b=y.currentTarget,[_,w]=u3e(b);_&&w?!y.shiftKey&&v===w?(y.preventDefault(),n&&ul(_,{select:!0})):y.shiftKey&&v===_&&(y.preventDefault(),n&&ul(w,{select:!0})):v===b&&y.preventDefault()}},[n,r,h.paused]);return l.jsx(Et.div,{tabIndex:-1,...a,ref:p,onKeyDown:g})});Xx.displayName=l3e;function c3e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ul(r,{select:t}),document.activeElement!==n)return}function u3e(e){const t=VW(e),n=b9(t,e),r=b9(t.reverse(),e);return[n,r]}function VW(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 b9(e,t){for(const n of e)if(!d3e(n,{upTo:t}))return n}function d3e(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 f3e(e){return e instanceof HTMLInputElement&&"select"in e}function ul(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&f3e(e)&&t&&e.select()}}var _9=m3e();function m3e(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=w9(e,t),e.unshift(t)},remove(t){e=w9(e,t),e[0]?.resume()}}}function w9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function p3e(e){return e.filter(t=>t.tagName!=="A")}var F_="rovingFocusGroup.onEntryFocus",h3e={bubbles:!1,cancelable:!0},ig="RovingFocusGroup",[S3,HW,g3e]=UW(ig),[y3e,Jl]=Vs(ig,[g3e]),[x3e,v3e]=y3e(ig),zW=d.forwardRef((e,t)=>l.jsx(S3.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(S3.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(b3e,{...e,ref:t})})}));zW.displayName=ig;var b3e=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=e,p=d.useRef(null),h=Sn(t,p),g=Pf(o),[y,x]=fo({prop:a,defaultProp:i??null,onChange:c,caller:ig}),[v,b]=d.useState(!1),_=Js(u),w=HW(n),S=d.useRef(!1),[C,E]=d.useState(0);return d.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(F_,_),()=>T.removeEventListener(F_,_)},[_]),l.jsx(x3e,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:y,onItemFocus:d.useCallback(T=>x(T),[x]),onItemShiftTab:d.useCallback(()=>b(!0),[]),onFocusableItemAdd:d.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:d.useCallback(()=>E(T=>T-1),[]),children:l.jsx(Et.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:rt(e.onMouseDown,()=>{S.current=!0}),onFocus:rt(e.onFocus,T=>{const k=!S.current;if(T.target===T.currentTarget&&k&&!v){const I=new CustomEvent(F_,h3e);if(T.currentTarget.dispatchEvent(I),!I.defaultPrevented){const M=w().filter(R=>R.focusable),N=M.find(R=>R.active),D=M.find(R=>R.id===y),F=[N,D,...M].filter(Boolean).map(R=>R.ref.current);$W(F,f)}}S.current=!1}),onBlur:rt(e.onBlur,()=>b(!1))})})}),WW="RovingFocusGroupItem",GW=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:a,...i}=e,c=ls(),u=o||c,f=v3e(WW,n),m=f.currentTabStopId===u,p=HW(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:y}=f;return d.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),l.jsx(S3.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(Et.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:rt(e.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:rt(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:rt(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=C3e(x,f.orientation,f.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=p().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")_.reverse();else if(v==="prev"||v==="next"){v==="prev"&&_.reverse();const w=_.indexOf(x.currentTarget);_=f.loop?S3e(_,w+1):_.slice(w+1)}setTimeout(()=>$W(_))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:y!=null}):a})})});GW.displayName=WW;var _3e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w3e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function C3e(e,t,n){const r=w3e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _3e[r]}function $W(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function S3e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zx=zW,Jx=GW,E3e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Du=new WeakMap,L0=new WeakMap,F0={},B_=0,qW=function(e){return e&&(e.host||qW(e.parentNode))},k3e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qW(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})},M3e=function(e,t,n,r){var s=k3e(t,Array.isArray(e)?e:[e]);F0[n]||(F0[n]=new WeakMap);var o=F0[n],a=[],i=new Set,c=new Set(s),u=function(m){!m||i.has(m)||(i.add(m),u(m.parentNode))};s.forEach(u);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(p){if(i.has(p))f(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",y=(Du.get(p)||0)+1,x=(o.get(p)||0)+1;Du.set(p,y),o.set(p,x),a.push(p),y===1&&g&&L0.set(p,!0),x===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),i.clear(),B_++,function(){a.forEach(function(m){var p=Du.get(m)-1,h=o.get(m)-1;Du.set(m,p),o.set(m,h),p||(L0.has(m)||m.removeAttribute(r),L0.delete(m)),h||m.removeAttribute(n)}),B_--,B_||(Du=new WeakMap,Du=new WeakMap,L0=new WeakMap,F0={})}},rT=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=E3e(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),M3e(r,s,n,"aria-hidden")):function(){return null}},oy="right-scroll-bar-position",ay="width-before-scroll-bar",T3e="with-scroll-bars-hidden",A3e="--removed-body-scroll-bar-size";function U_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function N3e(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var R3e=typeof window<"u"?d.useLayoutEffect:d.useEffect,C9=new WeakMap;function D3e(e,t){var n=N3e(null,function(r){return e.forEach(function(s){return U_(s,r)})});return R3e(function(){var r=C9.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(i){o.has(i)||U_(i,null)}),o.forEach(function(i){s.has(i)||U_(i,a)})}C9.set(n,e)},[e]),n}function j3e(e){return e}function I3e(e,t){t===void 0&&(t=j3e);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(i){return o(i)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(o),a=n}var c=function(){var f=a;a=[],f.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return s}function P3e(e){e===void 0&&(e={});var t=I3e(null);return t.options=Sr({async:!0,ssr:!1},e),t}var KW=function(e){var t=e.sideCar,n=RU(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,Sr({},n))};KW.isSideCarExport=!0;function O3e(e,t){return e.useMedium(t),KW}var YW=P3e(),V_=function(){},ev=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:V_,onWheelCapture:V_,onTouchMoveCapture:V_}),s=r[0],o=r[1],a=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,_=RU(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,S=D3e([n,t]),C=Sr(Sr({},_),s);return d.createElement(d.Fragment,null,f&&d.createElement(w,{sideCar:YW,removeScrollBar:u,shards:m,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:b}),a?d.cloneElement(d.Children.only(i),Sr(Sr({},C),{ref:S})):d.createElement(v,Sr({},C,{className:c,ref:S}),i))});ev.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ev.classNames={fullWidth:ay,zeroRight:oy};var L3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function F3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=L3e();return t&&e.setAttribute("nonce",t),e}function B3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function U3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=F3e())&&(B3e(t,n),U3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H3e=function(){var e=V3e();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},QW=function(){var e=H3e(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},z3e={left:0,top:0,right:0,gap:0},H_=function(e){return parseInt(e||"",10)||0},W3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[H_(n),H_(r),H_(s)]},G3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z3e;var t=W3e(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])}},$3e=QW(),Cd="data-scroll-locked",q3e=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),` - .`.concat(T3e,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(i,"px ").concat(r,`; - } - body[`).concat(Cd,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(i,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(oy,` { - right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(ay,` { - margin-right: `).concat(i,"px ").concat(r,`; - } - - .`).concat(oy," .").concat(oy,` { - right: 0 `).concat(r,`; - } - - .`).concat(ay," .").concat(ay,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Cd,`] { - `).concat(A3e,": ").concat(i,`px; - } -`)},S9=function(){var e=parseInt(document.body.getAttribute(Cd)||"0",10);return isFinite(e)?e:0},K3e=function(){d.useEffect(function(){return document.body.setAttribute(Cd,(S9()+1).toString()),function(){var e=S9()-1;e<=0?document.body.removeAttribute(Cd):document.body.setAttribute(Cd,e.toString())}},[])},Y3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;K3e();var o=d.useMemo(function(){return G3e(s)},[s]);return d.createElement($3e,{styles:q3e(o,!t,s,n?"":"!important")})},E3=!1;if(typeof window<"u")try{var B0=Object.defineProperty({},"passive",{get:function(){return E3=!0,!0}});window.addEventListener("test",B0,B0),window.removeEventListener("test",B0,B0)}catch{E3=!1}var ju=E3?{passive:!1}:!1,Q3e=function(e){return e.tagName==="TEXTAREA"},XW=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Q3e(e)&&n[t]==="visible")},X3e=function(e){return XW(e,"overflowY")},Z3e=function(e){return XW(e,"overflowX")},E9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=ZW(e,r);if(s){var o=JW(e,r),a=o[1],i=o[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},J3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eEe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ZW=function(e,t){return e==="v"?X3e(t):Z3e(t)},JW=function(e,t){return e==="v"?J3e(t):eEe(t)},tEe=function(e,t){return e==="h"&&t==="rtl"?-1:1},nEe=function(e,t,n,r,s){var o=tEe(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,c=t.contains(i),u=!1,f=a>0,m=0,p=0;do{var h=JW(e,i),g=h[0],y=h[1],x=h[2],v=y-x-o*g;(g||v)&&ZW(e,i)&&(m+=v,p+=g),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(p)<1)&&(u=!0),u},U0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},k9=function(e){return[e.deltaX,e.deltaY]},M9=function(e){return e&&"current"in e?e.current:e},rEe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sEe=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},oEe=0,Iu=[];function aEe(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),s=d.useState(oEe++)[0],o=d.useState(QW)[0],a=d.useRef(e);d.useEffect(function(){a.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=qe([e.lockRef.current],(e.shards||[]).map(M9),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=d.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=U0(y),b=n.current,_="deltaX"in y?y.deltaX:b[0]-v[0],w="deltaY"in y?y.deltaY:b[1]-v[1],S,C=y.target,E=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in y&&E==="h"&&C.type==="range")return!1;var T=E9(E,C);if(!T)return!0;if(T?S=E:(S=E==="v"?"h":"v",T=E9(E,C)),!T)return!1;if(!r.current&&"changedTouches"in y&&(_||w)&&(r.current=S),!S)return!0;var k=r.current||S;return nEe(k,x,y,k==="h"?_:w)},[]),c=d.useCallback(function(y){var x=y;if(!(!Iu.length||Iu[Iu.length-1]!==o)){var v="deltaY"in x?k9(x):U0(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&rEe(S.delta,v)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var _=(a.current.shards||[]).map(M9).filter(Boolean).filter(function(S){return S.contains(x.target)}),w=_.length>0?i(x,_[0]):!a.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),u=d.useCallback(function(y,x,v,b){var _={name:y,delta:x,target:v,should:b,shadowParent:iEe(v)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(w){return w!==_})},1)},[]),f=d.useCallback(function(y){n.current=U0(y),r.current=void 0},[]),m=d.useCallback(function(y){u(y.type,k9(y),y.target,i(y,e.lockRef.current))},[]),p=d.useCallback(function(y){u(y.type,U0(y),y.target,i(y,e.lockRef.current))},[]);d.useEffect(function(){return Iu.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",c,ju),document.addEventListener("touchmove",c,ju),document.addEventListener("touchstart",f,ju),function(){Iu=Iu.filter(function(y){return y!==o}),document.removeEventListener("wheel",c,ju),document.removeEventListener("touchmove",c,ju),document.removeEventListener("touchstart",f,ju)}},[]);var h=e.removeScrollBar,g=e.inert;return d.createElement(d.Fragment,null,g?d.createElement(o,{styles:sEe(s)}):null,h?d.createElement(Y3e,{gapMode:e.gapMode}):null)}function iEe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lEe=O3e(YW,aEe);var lg=d.forwardRef(function(e,t){return d.createElement(ev,Sr({},e,{ref:t,sideCar:lEe}))});lg.classNames=ev.classNames;var k3=["Enter"," "],cEe=["ArrowDown","PageUp","Home"],eG=["ArrowUp","PageDown","End"],uEe=[...cEe,...eG],dEe={ltr:[...k3,"ArrowRight"],rtl:[...k3,"ArrowLeft"]},fEe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cg="Menu",[nh,mEe,pEe]=UW(cg),[fu,tG]=Vs(cg,[pEe,Sf,Jl]),ug=Sf(),nG=Jl(),[rG,ec]=fu(cg),[hEe,dg]=fu(cg),sG=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,i=ug(t),[c,u]=d.useState(null),f=d.useRef(!1),m=Js(o),p=Pf(s);return d.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),l.jsx(gx,{...i,children:l.jsx(rG,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:u,children:l.jsx(hEe,{scope:t,onClose:d.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:p,modal:a,children:r})})})};sG.displayName=cg;var gEe="MenuAnchor",sT=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ug(n);return l.jsx(yx,{...s,...r,ref:t})});sT.displayName=gEe;var oT="MenuPortal",[yEe,oG]=fu(oT,{forceMount:void 0}),aG=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ec(oT,t);return l.jsx(yEe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:r})})})};aG.displayName=oT;var Mo="MenuContent",[xEe,aT]=fu(Mo),iG=d.forwardRef((e,t)=>{const n=oG(Mo,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ec(Mo,e.__scopeMenu),a=dg(Mo,e.__scopeMenu);return l.jsx(nh.Provider,{scope:e.__scopeMenu,children:l.jsx(Hr,{present:r||o.open,children:l.jsx(nh.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(vEe,{...s,ref:t}):l.jsx(bEe,{...s,ref:t})})})})}),vEe=d.forwardRef((e,t)=>{const n=ec(Mo,e.__scopeMenu),r=d.useRef(null),s=Sn(t,r);return d.useEffect(()=>{const o=r.current;if(o)return rT(o)},[]),l.jsx(iT,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:rt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bEe=d.forwardRef((e,t)=>{const n=ec(Mo,e.__scopeMenu);return l.jsx(iT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),_Ee=qp("MenuContent.ScrollLock"),iT=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...y}=e,x=ec(Mo,n),v=dg(Mo,n),b=ug(n),_=nG(n),w=mEe(n),[S,C]=d.useState(null),E=d.useRef(null),T=Sn(t,E,x.onContentChange),k=d.useRef(0),I=d.useRef(""),M=d.useRef(0),N=d.useRef(null),D=d.useRef("right"),j=d.useRef(0),F=g?lg:d.Fragment,R=g?{as:_Ee,allowPinchZoom:!0}:void 0,P=U=>{const O=I.current+U,$=w().filter(se=>!se.disabled),G=document.activeElement,H=$.find(se=>se.ref.current===G)?.textValue,Q=$.map(se=>se.textValue),Y=jEe(Q,O,H),te=$.find(se=>se.textValue===Y)?.ref.current;(function se(ae){I.current=ae,window.clearTimeout(k.current),ae!==""&&(k.current=window.setTimeout(()=>se(""),1e3))})(O),te&&setTimeout(()=>te.focus())};d.useEffect(()=>()=>window.clearTimeout(k.current),[]),nT();const L=d.useCallback(U=>D.current===N.current?.side&&PEe(U,N.current?.area),[]);return l.jsx(xEe,{scope:n,searchRef:I,onItemEnter:d.useCallback(U=>{L(U)&&U.preventDefault()},[L]),onItemLeave:d.useCallback(U=>{L(U)||(E.current?.focus(),C(null))},[L]),onTriggerLeave:d.useCallback(U=>{L(U)&&U.preventDefault()},[L]),pointerGraceTimerRef:M,onPointerGraceIntentChange:d.useCallback(U=>{N.current=U},[]),children:l.jsx(F,{...R,children:l.jsx(Xx,{asChild:!0,trapped:s,onMountAutoFocus:rt(o,U=>{U.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(vx,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,children:l.jsx(Zx,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:rt(c,U=>{v.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(lM,{role:"menu","aria-orientation":"vertical","data-state":SG(x.open),"data-radix-menu-content":"",dir:v.dir,...b,...y,ref:T,style:{outline:"none",...y.style},onKeyDown:rt(y.onKeyDown,U=>{const $=U.target.closest("[data-radix-menu-content]")===U.currentTarget,G=U.ctrlKey||U.altKey||U.metaKey,H=U.key.length===1;$&&(U.key==="Tab"&&U.preventDefault(),!G&&H&&P(U.key));const Q=E.current;if(U.target!==Q||!uEe.includes(U.key))return;U.preventDefault();const te=w().filter(se=>!se.disabled).map(se=>se.ref.current);eG.includes(U.key)&&te.reverse(),REe(te)}),onBlur:rt(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(k.current),I.current="")}),onPointerMove:rt(e.onPointerMove,rh(U=>{const O=U.target,$=j.current!==U.clientX;if(U.currentTarget.contains(O)&&$){const G=U.clientX>j.current?"right":"left";D.current=G,j.current=U.clientX}}))})})})})})})});iG.displayName=Mo;var wEe="MenuGroup",lT=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Et.div,{role:"group",...r,ref:t})});lT.displayName=wEe;var CEe="MenuLabel",lG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Et.div,{...r,ref:t})});lG.displayName=CEe;var r2="MenuItem",T9="menu.itemSelect",tv=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=d.useRef(null),a=dg(r2,e.__scopeMenu),i=aT(r2,e.__scopeMenu),c=Sn(t,o),u=d.useRef(!1),f=()=>{const m=o.current;if(!n&&m){const p=new CustomEvent(T9,{bubbles:!0,cancelable:!0});m.addEventListener(T9,h=>r?.(h),{once:!0}),xme(m,p),p.defaultPrevented?u.current=!1:a.onClose()}};return l.jsx(cG,{...s,ref:c,disabled:n,onClick:rt(e.onClick,f),onPointerDown:m=>{e.onPointerDown?.(m),u.current=!0},onPointerUp:rt(e.onPointerUp,m=>{u.current||m.currentTarget?.click()}),onKeyDown:rt(e.onKeyDown,m=>{const p=i.searchRef.current!=="";n||p&&m.key===" "||k3.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});tv.displayName=r2;var cG=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=aT(r2,n),i=nG(n),c=d.useRef(null),u=Sn(t,c),[f,m]=d.useState(!1),[p,h]=d.useState("");return d.useEffect(()=>{const g=c.current;g&&h((g.textContent??"").trim())},[o.children]),l.jsx(nh.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:l.jsx(Jx,{asChild:!0,...i,focusable:!r,children:l.jsx(Et.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:rt(e.onPointerMove,rh(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:rt(e.onPointerLeave,rh(g=>a.onItemLeave(g))),onFocus:rt(e.onFocus,()=>m(!0)),onBlur:rt(e.onBlur,()=>m(!1))})})})}),SEe="MenuCheckboxItem",uG=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(hG,{scope:e.__scopeMenu,checked:n,children:l.jsx(tv,{role:"menuitemcheckbox","aria-checked":s2(n)?"mixed":n,...s,ref:t,"data-state":dT(n),onSelect:rt(s.onSelect,()=>r?.(s2(n)?!0:!n),{checkForDefaultPrevented:!1})})})});uG.displayName=SEe;var dG="MenuRadioGroup",[EEe,kEe]=fu(dG,{value:void 0,onValueChange:()=>{}}),fG=d.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Js(r);return l.jsx(EEe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(lT,{...s,ref:t})})});fG.displayName=dG;var mG="MenuRadioItem",pG=d.forwardRef((e,t)=>{const{value:n,...r}=e,s=kEe(mG,e.__scopeMenu),o=n===s.value;return l.jsx(hG,{scope:e.__scopeMenu,checked:o,children:l.jsx(tv,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":dT(o),onSelect:rt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});pG.displayName=mG;var cT="MenuItemIndicator",[hG,MEe]=fu(cT,{checked:!1}),gG=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=MEe(cT,n);return l.jsx(Hr,{present:r||s2(o.checked)||o.checked===!0,children:l.jsx(Et.span,{...s,ref:t,"data-state":dT(o.checked)})})});gG.displayName=cT;var TEe="MenuSeparator",yG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});yG.displayName=TEe;var AEe="MenuArrow",xG=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=ug(n);return l.jsx(cM,{...s,...r,ref:t})});xG.displayName=AEe;var uT="MenuSub",[NEe,vG]=fu(uT),bG=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,o=ec(uT,t),a=ug(t),[i,c]=d.useState(null),[u,f]=d.useState(null),m=Js(s);return d.useEffect(()=>(o.open===!1&&m(!1),()=>m(!1)),[o.open,m]),l.jsx(gx,{...a,children:l.jsx(rG,{scope:t,open:r,onOpenChange:m,content:u,onContentChange:f,children:l.jsx(NEe,{scope:t,contentId:ls(),triggerId:ls(),trigger:i,onTriggerChange:c,children:n})})})};bG.displayName=uT;var Jm="MenuSubTrigger",_G=d.forwardRef((e,t)=>{const n=ec(Jm,e.__scopeMenu),r=dg(Jm,e.__scopeMenu),s=vG(Jm,e.__scopeMenu),o=aT(Jm,e.__scopeMenu),a=d.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:c}=o,u={__scopeMenu:e.__scopeMenu},f=d.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return d.useEffect(()=>f,[f]),d.useEffect(()=>{const m=i.current;return()=>{window.clearTimeout(m),c(null)}},[i,c]),l.jsx(sT,{asChild:!0,...u,children:l.jsx(cG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":SG(n.open),...e,ref:zc(t,s.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:rt(e.onPointerMove,rh(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:rt(e.onPointerLeave,rh(m=>{f();const p=n.content?.getBoundingClientRect();if(p){const h=n.content?.dataset.side,g=h==="right",y=g?-5:5,x=p[g?"left":"right"],v=p[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+y,y:m.clientY},{x,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x,y:p.bottom}],side:h}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:rt(e.onKeyDown,m=>{const p=o.searchRef.current!=="";e.disabled||p&&m.key===" "||dEe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});_G.displayName=Jm;var wG="MenuSubContent",CG=d.forwardRef((e,t)=>{const n=oG(Mo,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ec(Mo,e.__scopeMenu),a=dg(Mo,e.__scopeMenu),i=vG(wG,e.__scopeMenu),c=d.useRef(null),u=Sn(t,c);return l.jsx(nh.Provider,{scope:e.__scopeMenu,children:l.jsx(Hr,{present:r||o.open,children:l.jsx(nh.Slot,{scope:e.__scopeMenu,children:l.jsx(iT,{id:i.contentId,"aria-labelledby":i.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:rt(e.onFocusOutside,f=>{f.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:rt(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:rt(e.onKeyDown,f=>{const m=f.currentTarget.contains(f.target),p=fEe[a.dir].includes(f.key);m&&p&&(o.onOpenChange(!1),i.trigger?.focus(),f.preventDefault())})})})})})});CG.displayName=wG;function SG(e){return e?"open":"closed"}function s2(e){return e==="indeterminate"}function dT(e){return s2(e)?"indeterminate":e?"checked":"unchecked"}function REe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function DEe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function jEe(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=DEe(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function IEe(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;or!=p>r&&n<(m-u)*(r-f)/(p-f)+u&&(s=!s)}return s}function PEe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return IEe(n,t)}function rh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var OEe=sG,LEe=sT,FEe=aG,BEe=iG,UEe=lT,VEe=lG,HEe=tv,zEe=uG,WEe=fG,GEe=pG,$Ee=gG,qEe=yG,KEe=xG,YEe=bG,QEe=_G,XEe=CG,nv="DropdownMenu",[ZEe]=Vs(nv,[tG]),cs=tG(),[JEe,EG]=ZEe(nv),kG=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,c=cs(t),u=d.useRef(null),[f,m]=fo({prop:s,defaultProp:o??!1,onChange:a,caller:nv});return l.jsx(JEe,{scope:t,triggerId:ls(),triggerRef:u,contentId:ls(),open:f,onOpenChange:m,onOpenToggle:d.useCallback(()=>m(p=>!p),[m]),modal:i,children:l.jsx(OEe,{...c,open:f,onOpenChange:m,dir:r,modal:i,children:n})})};kG.displayName=nv;var MG="DropdownMenuTrigger",TG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=EG(MG,n),a=cs(n);return l.jsx(LEe,{asChild:!0,...a,children:l.jsx(Et.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:zc(t,o.triggerRef),onPointerDown:rt(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:rt(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});TG.displayName=MG;var eke="DropdownMenuPortal",AG=e=>{const{__scopeDropdownMenu:t,...n}=e,r=cs(t);return l.jsx(FEe,{...r,...n})};AG.displayName=eke;var NG="DropdownMenuContent",RG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=EG(NG,n),o=cs(n),a=d.useRef(!1);return l.jsx(BEe,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:rt(e.onCloseAutoFocus,i=>{a.current||s.triggerRef.current?.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:rt(e.onInteractOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.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)"}})});RG.displayName=NG;var tke="DropdownMenuGroup",DG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(UEe,{...s,...r,ref:t})});DG.displayName=tke;var nke="DropdownMenuLabel",jG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(VEe,{...s,...r,ref:t})});jG.displayName=nke;var rke="DropdownMenuItem",IG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(HEe,{...s,...r,ref:t})});IG.displayName=rke;var ske="DropdownMenuCheckboxItem",PG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(zEe,{...s,...r,ref:t})});PG.displayName=ske;var oke="DropdownMenuRadioGroup",ake=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(WEe,{...s,...r,ref:t})});ake.displayName=oke;var ike="DropdownMenuRadioItem",lke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(GEe,{...s,...r,ref:t})});lke.displayName=ike;var cke="DropdownMenuItemIndicator",uke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx($Ee,{...s,...r,ref:t})});uke.displayName=cke;var dke="DropdownMenuSeparator",OG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(qEe,{...s,...r,ref:t})});OG.displayName=dke;var fke="DropdownMenuArrow",mke=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(KEe,{...s,...r,ref:t})});mke.displayName=fke;var pke=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:o}=e,a=cs(t),[i,c]=fo({prop:r,defaultProp:o??!1,onChange:s,caller:"DropdownMenuSub"});return l.jsx(YEe,{...a,open:i,onOpenChange:c,children:n})},hke="DropdownMenuSubTrigger",LG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(QEe,{...s,...r,ref:t})});LG.displayName=hke;var gke="DropdownMenuSubContent",FG=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cs(n);return l.jsx(XEe,{...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)"}})});FG.displayName=gke;var yke=kG,xke=TG,BG=AG,vke=RG,bke=DG,_ke=jG,UG=IG,VG=PG,wke=OG,Cke=pke,Ske=LG,Eke=FG;const kke=ci("",{variants:{disabled:{false:"text-foreground",true:"text-quiet"},highlighted:{false:"",true:"bg-subtle"},shouldShowFocusRing:{false:"",true:"interactable"},isInteractable:{false:"",true:"reset hover:bg-subtler cursor-pointer"},rounded:{false:"",true:"rounded-lg"}},defaultVariants:{disabled:!1,highlighted:!1,shouldShowFocusRing:!1,isInteractable:!1,rounded:!1}});function Mke(e){return typeof e=="string"}function o2(e){return typeof e=="string"||typeof e=="function"}function HG({ref:e,children:t,leadingAccessory:n,trailingAccessory:r,subtitle:s,disabled:o=!1,highlighted:a=!1,shouldShowFocusRing:i=!1,rounded:c=!1,className:u,role:f,href:m,target:p,rel:h,...g}){const y=!!f,x=!!m,v=!m&&f==="button",b=z(u,"w-full gap-sm px-sm flex select-none items-center py-1.5 font-sans text-[13px] leading-loose",kke({disabled:o,highlighted:a,shouldShowFocusRing:i,isInteractable:y&&!o,rounded:c})),_=l.jsxs(l.Fragment,{children:[n&&l.jsx("div",{className:Mke(n)?"flex shrink-0 items-center":"shrink-0 self-start pt-[0.275rem]",children:o2(n)?l.jsx(rn,{icon:n,size:"small"}):n}),l.jsx("div",{className:"flex-1",children:l.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[t,s&&l.jsx("span",{className:"text-quiet whitespace-pre-wrap pb-1 text-[11px] leading-tight",children:s})]})}),r&&l.jsx("div",{className:"ml-auto flex self-start pt-[0.275rem]",children:o2(r)?l.jsx(rn,{icon:r,size:"small"}):r})]});if(v)return l.jsx(Ro,{ref:e,type:"button",disabled:o,className:b,...g,children:_});if(x){if(o)return l.jsx("span",{ref:e,role:f,className:z("reset",b),...g,children:_});const{onClick:w,...S}=g;return l.jsx(Vy,{ref:e,role:f,href:m,target:p,rel:h,__dangerousDoNotUseShouldApplyFocusIndicator:f==="link",className:b,__dangerousDoNotUseOnClick:w,...S,children:_})}return l.jsx("div",{ref:e,role:f,className:b,...g,children:_})}function sbt(e){return l.jsx(HG,{...e})}const M3=HG,Tke={tiny:"tiny",small:"tiny",default:"tiny",large:"small"},A9=e=>{const t=_x(e),{showChevron:n=!0}=e;return z(t,{"justify-between":n})},Ake=({variant:e})=>z("ml-1","shrink-0",{"text-quiet":e==="tonal"});function Nke({ref:e,children:t,icon:n,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,variant:i="primary",size:c="default",disabled:u=!1,onClick:f,leadingAccessory:m,rounded:p=!1,showChevron:h=!0,tooltipSide:g="top",tooltipAlign:y="center",__dangerousHtmlProps:x={},...v}){const b=bx(e),_=wa(v),w=Tke[c];if(n){const S=l.jsxs(Ro,{ref:b,..._,disabled:u,className:A9({variant:i,size:c,disabled:u,fullWidth:!1,rounded:p,showChevron:h}),onClick:f,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,...x,children:[l.jsx(rn,{icon:n,size:c}),h&&l.jsx("div",{className:"ml-1 shrink-0",children:l.jsx(rn,{icon:B("chevron-down"),size:c})})]});return u?S:l.jsx(Fo,{content:r,side:g,align:y,children:S})}return l.jsxs(Ro,{ref:b,..._,disabled:u,className:A9({variant:i,size:c,disabled:u,fullWidth:!0,showChevron:h}),onClick:f,"aria-label":r,"aria-expanded":s,"aria-haspopup":o,"aria-controls":a,...x,children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[m&&l.jsx("div",{className:"mr-1 shrink-0",children:o2(m)?l.jsx(rn,{icon:m,size:c}):m}),l.jsx("span",{className:z("text-box-trim-both","truncate",{"pl-1":m,"pr-1":!0,"min-w-0":!0}),children:t})]}),h&&l.jsx("div",{className:Ake({variant:i}),children:l.jsx(rn,{icon:B("chevron-down"),size:w})})]})}function fT(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var rv="Checkbox",[Rke]=Vs(rv),[Dke,mT]=Rke(rv);function jke(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:o,form:a,name:i,onCheckedChange:c,required:u,value:f="on",internal_do_not_use_render:m}=e,[p,h]=fo({prop:n,defaultProp:s??!1,onChange:c,caller:rv}),[g,y]=d.useState(null),[x,v]=d.useState(null),b=d.useRef(!1),_=g?!!a||!!g.closest("form"):!0,w={checked:p,disabled:o,setChecked:h,control:g,setControl:y,name:i,form:a,value:f,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Ml(s)?!1:s,isFormControl:_,bubbleInput:x,setBubbleInput:v};return l.jsx(Dke,{scope:t,...w,children:Ike(m)?m(w):r})}var zG="CheckboxTrigger",WG=d.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:o,value:a,disabled:i,checked:c,required:u,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=mT(zG,e),y=Sn(s,f),x=d.useRef(c);return d.useEffect(()=>{const v=o?.form;if(v){const b=()=>m(x.current);return v.addEventListener("reset",b),()=>v.removeEventListener("reset",b)}},[o,m]),l.jsx(Et.button,{type:"button",role:"checkbox","aria-checked":Ml(c)?"mixed":c,"aria-required":u,"data-state":KG(c),"data-disabled":i?"":void 0,disabled:i,value:a,...r,ref:y,onKeyDown:rt(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:rt(n,v=>{m(b=>Ml(b)?!0:!b),g&&h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})});WG.displayName=zG;var pT=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:c,onCheckedChange:u,form:f,...m}=e;return l.jsx(jke,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:i,required:a,onCheckedChange:u,name:r,form:f,value:c,internal_do_not_use_render:({isFormControl:p})=>l.jsxs(l.Fragment,{children:[l.jsx(WG,{...m,ref:t,__scopeCheckbox:n}),p&&l.jsx(qG,{__scopeCheckbox:n})]})})});pT.displayName=rv;var GG="CheckboxIndicator",hT=d.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,o=mT(GG,n);return l.jsx(Hr,{present:r||Ml(o.checked)||o.checked===!0,children:l.jsx(Et.span,{"data-state":KG(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});hT.displayName=GG;var $G="CheckboxBubbleInput",qG=d.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:i,disabled:c,name:u,value:f,form:m,bubbleInput:p,setBubbleInput:h}=mT($G,e),g=Sn(n,h),y=fT(o),x=uM(r);d.useEffect(()=>{const b=p;if(!b)return;const _=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(_,"checked").set,C=!s.current;if(y!==o&&S){const E=new Event("click",{bubbles:C});b.indeterminate=Ml(o),S.call(b,Ml(o)?!1:o),b.dispatchEvent(E)}},[p,y,o,s]);const v=d.useRef(Ml(o)?!1:o);return l.jsx(Et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:i,disabled:c,name:u,value:f,form:m,...t,tabIndex:-1,ref:g,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});qG.displayName=$G;function Ike(e){return typeof e=="function"}function Ml(e){return e==="indeterminate"}function KG(e){return Ml(e)?"indeterminate":e?"checked":"unchecked"}const Pke=ci("reset interactable flex select-none items-center justify-center rounded border border-solid transition-colors duration-150",{variants:{size:{large:"size-6",default:"size-[18px]",small:"size-[14px]"},disabled:{false:"cursor-pointer",true:"cursor-default opacity-50"},checked:{false:"border-subtle bg-background",true:"border-super bg-super"}},compoundVariants:[{checked:!1,disabled:!1,class:"hover:border-subtle hover:bg-subtle"},{checked:!0,disabled:!1,class:"hover:opacity-80"}],defaultVariants:{size:"default",disabled:!1,checked:!1}});function Oke({checked:e=!1,onCheckedChange:t,"aria-label":n,size:r="default",disabled:s=!1,tabIndex:o=0}){return l.jsx(pT,{checked:e,onCheckedChange:t,disabled:s,"aria-label":n,className:Pke({size:r,disabled:s,checked:e}),tabIndex:o,children:l.jsx(hT,{className:"text-inverse flex items-center justify-center",children:l.jsx(ut,{name:B("check"),size:r==="small"?14:16})})})}const Lke=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function ei({ref:e,children:t,leadingAccessory:n,trailingAccessory:r,subtitle:s,role:o="menuitem",...a}){const i=wa(a),c=i["data-disabled"]===""||i["data-disabled"]==="true"||a["aria-disabled"]===!0||a["aria-disabled"]==="true",u=i["data-highlighted"]===""||i["data-highlighted"]==="true"||i["data-state"]==="open",f=!Lke.has(o);return l.jsx(M3,{ref:e,role:o,disabled:c,highlighted:u,shouldShowFocusRing:f,leadingAccessory:n,trailingAccessory:r,subtitle:s,rounded:!0,className:z(a.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...i,children:t})}function Fke({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||n(!t)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>l.jsx(Oke,{checked:t,onCheckedChange:n,disabled:s,"aria-label":"",size:"small",tabIndex:c?-1:0}),[t,s,c,n]);return c?l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"checkbox","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(VG,{asChild:!0,disabled:s,checked:t,onCheckedChange:n,onSelect:u,textValue:r,...i,children:l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,children:e})})}function Bke({label:e,children:t}){const{isMobileStyle:n}=Bo(),r=d.useId();return n?l.jsxs("div",{role:"group","aria-labelledby":r,children:[l.jsx("div",{id:r,className:"text-foreground font-medium p-2 text-xs",children:e}),l.jsx("div",{children:t})]}):l.jsxs(bke,{children:[l.jsx(_ke,{className:"text-foreground font-medium p-2 text-xs",children:e}),t]})}const YG=d.createContext(null);function Uke(){return d.useContext(YG)}function Vke({children:e,close:t}){const n={close:t};return l.jsx(YG.Provider,{value:n,children:e})}const QG=d.createContext(null);function XG(){return d.useContext(QG)}function Hke(){return XG()?.closeMobileMenu}function T3({children:e,submenus:t}){const r={closeMobileMenu:Uke()?.close,submenus:t??{closeAll:()=>{},register:()=>{},unregister:()=>{}}};return l.jsx(QG.Provider,{value:r,children:e})}const zke=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function Wke({ref:e,className:t,children:n,role:r="menuitem",asChild:s,disabled:o,onSelect:a,textValue:i,...c}){const u=!zke.has(r),f=z("reset flex",{interactable:u,"pointer-events-none":o},t);return l.jsx(UG,{ref:e,disabled:o,onSelect:a,textValue:i,asChild:s,className:f,...s?{}:{role:r},...c,children:n})}function Gke({children:e,textValue:t,disabled:n,onSelect:r,leadingAccessory:s,trailingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=Hke(),f=d.useCallback(()=>{if(!n)return r(),!0},[n,r]),m=d.useCallback(()=>{f()&&u?.()},[f,u]),p=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(),u?.())},[f,u]);return c?l.jsx(ei,{leadingAccessory:s,trailingAccessory:o,subtitle:a,role:"button",tabIndex:n?-1:0,onClick:m,onKeyDown:p,"aria-disabled":n,...i,children:e}):l.jsx(Wke,{disabled:n,onSelect:f,textValue:t,asChild:!0,...i,children:l.jsx(ei,{leadingAccessory:s,trailingAccessory:o,subtitle:a,children:e})})}const $ke=new Set(["menuitem","menuitemcheckbox","menuitemradio"]);function N9({ref:e,href:t,target:n,rel:r,children:s,leadingAccessory:o,trailingAccessory:a,subtitle:i,role:c="menuitem",...u}){const f=wa(u),m=f["data-disabled"]===""||f["data-disabled"]==="true"||u["aria-disabled"]===!0||u["aria-disabled"]==="true",p=f["data-highlighted"]===""||f["data-highlighted"]==="true",h=!$ke.has(c);return t?l.jsx(M3,{ref:e,role:"menuitem",href:t,target:n,rel:r,disabled:m,highlighted:p,shouldShowFocusRing:h,leadingAccessory:o,trailingAccessory:a,subtitle:i,rounded:!0,className:z(u.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...f,children:s}):l.jsx(M3,{ref:e,role:"menuitem",disabled:m,highlighted:p,shouldShowFocusRing:h,leadingAccessory:o,trailingAccessory:a,subtitle:i,rounded:!0,className:z(u.className,"min-w-[calc(var(--radix-dropdown-menu-trigger-width)-theme(spacing.sm))]"),...f,children:s})}function qke({children:e,disabled:t,href:n,...r}){const{isMobileStyle:s}=Bo();return s?l.jsx(N9,{href:n,"aria-disabled":t,role:"link",...r,children:e}):l.jsx(UG,{asChild:!0,disabled:t,children:l.jsx(N9,{href:n,...r,children:e})})}function Kke(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yke(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var gT="ScrollArea",[ZG]=Vs(gT),[Qke,zo]=ZG(gT),JG=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[i,c]=d.useState(null),[u,f]=d.useState(null),[m,p]=d.useState(null),[h,g]=d.useState(null),[y,x]=d.useState(null),[v,b]=d.useState(0),[_,w]=d.useState(0),[S,C]=d.useState(!1),[E,T]=d.useState(!1),k=Sn(t,M=>c(M)),I=Pf(s);return l.jsx(Qke,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:i,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:w,children:l.jsx(Et.div,{dir:I,...a,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});JG.displayName=gT;var e$="ScrollAreaViewport",t$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=zo(e$,n),i=d.useRef(null),c=Sn(t,i,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(Et.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});t$.displayName=e$;var fi="ScrollAreaScrollbar",n$=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=zo(fi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,i=e.orientation==="horizontal";return d.useEffect(()=>(i?o(!0):a(!0),()=>{i?o(!1):a(!1)}),[i,o,a]),s.type==="hover"?l.jsx(Xke,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(Zke,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(r$,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx(yT,{...r,ref:t}):null});n$.displayName=fi;var Xke=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=zo(fi,e.__scopeScrollArea),[o,a]=d.useState(!1);return d.useEffect(()=>{const i=s.scrollArea;let c=0;if(i){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(Hr,{present:n||o,children:l.jsx(r$,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Zke=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=zo(fi,e.__scopeScrollArea),o=e.orientation==="horizontal",a=ov(()=>c("SCROLL_END"),100),[i,c]=Yke("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 d.useEffect(()=>{if(i==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,s.scrollHideDelay,c]),d.useEffect(()=>{const u=s.viewport,f=o?"scrollLeft":"scrollTop";if(u){let m=u[f];const p=()=>{const h=u[f];m!==h&&(c("SCROLL"),a()),m=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[s.viewport,o,c,a]),l.jsx(Hr,{present:n||i!=="hidden",children:l.jsx(yT,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:rt(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:rt(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),r$=d.forwardRef((e,t)=>{const n=zo(fi,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=d.useState(!1),i=e.orientation==="horizontal",c=ov(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=zo(fi,e.__scopeScrollArea),o=d.useRef(null),a=d.useRef(0),[i,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=i$(i.viewport,i.content),f={...r,sizes:i,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function m(p,h){return o5e(p,a.current,i,h)}return n==="horizontal"?l.jsx(Jke,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,h=R9(p,i,s.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=m(p,s.dir))}}):n==="vertical"?l.jsx(e5e,{...f,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,h=R9(p,i);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=m(p))}}):null}),Jke=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=zo(fi,e.__scopeScrollArea),[a,i]=d.useState(),c=d.useRef(null),u=Sn(t,c,o.onScrollbarXChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),l.jsx(o$,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sv(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,m)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),c$(p,m)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:i2(a.paddingLeft),paddingEnd:i2(a.paddingRight)}})}})}),e5e=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=zo(fi,e.__scopeScrollArea),[a,i]=d.useState(),c=d.useRef(null),u=Sn(t,c,o.onScrollbarYChange);return d.useEffect(()=>{c.current&&i(getComputedStyle(c.current))},[c]),l.jsx(o$,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sv(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,m)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),c$(p,m)&&f.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:i2(a.paddingTop),paddingEnd:i2(a.paddingBottom)}})}})}),[t5e,s$]=ZG(fi),o$=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=e,h=zo(fi,n),[g,y]=d.useState(null),x=Sn(t,k=>y(k)),v=d.useRef(null),b=d.useRef(""),_=h.viewport,w=r.content-r.viewport,S=Js(f),C=Js(c),E=ov(m,10);function T(k){if(v.current){const I=k.clientX-v.current.left,M=k.clientY-v.current.top;u({x:I,y:M})}}return d.useEffect(()=>{const k=I=>{const M=I.target;g?.contains(M)&&S(I,w)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[_,g,w,S]),d.useEffect(C,[r,C]),$d(g,E),$d(h.content,E),l.jsx(t5e,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Js(o),onThumbPointerUp:Js(a),onThumbPositionChange:C,onThumbPointerDown:Js(i),children:l.jsx(Et.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:rt(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),v.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(k))}),onPointerMove:rt(e.onPointerMove,T),onPointerUp:rt(e.onPointerUp,k=>{const I=k.target;I.hasPointerCapture(k.pointerId)&&I.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})})}),a2="ScrollAreaThumb",a$=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=s$(a2,e.__scopeScrollArea);return l.jsx(Hr,{present:n||s.hasThumb,children:l.jsx(n5e,{ref:t,...r})})}),n5e=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=zo(a2,n),a=s$(a2,n),{onThumbPositionChange:i}=a,c=Sn(t,m=>a.onThumbChange(m)),u=d.useRef(void 0),f=ov(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const m=o.viewport;if(m){const p=()=>{if(f(),!u.current){const h=a5e(m,i);u.current=h,i()}};return i(),m.addEventListener("scroll",p),()=>m.removeEventListener("scroll",p)}},[o.viewport,f,i]),l.jsx(Et.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:rt(e.onPointerDownCapture,m=>{const h=m.target.getBoundingClientRect(),g=m.clientX-h.left,y=m.clientY-h.top;a.onThumbPointerDown({x:g,y})}),onPointerUp:rt(e.onPointerUp,a.onThumbPointerUp)})});a$.displayName=a2;var xT="ScrollAreaCorner",r5e=d.forwardRef((e,t)=>{const n=zo(xT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(s5e,{...e,ref:t}):null});r5e.displayName=xT;var s5e=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=zo(xT,n),[o,a]=d.useState(0),[i,c]=d.useState(0),u=!!(o&&i);return $d(s.scrollbarX,()=>{const f=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(f),c(f)}),$d(s.scrollbarY,()=>{const f=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(f),a(f)}),u?l.jsx(Et.div,{...r,ref:t,style:{width:o,height:i,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function i2(e){return e?parseInt(e,10):0}function i$(e,t){const n=e/t;return isNaN(n)?0:n}function sv(e){const t=i$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function o5e(e,t,n,r="ltr"){const s=sv(n),o=s/2,a=t||o,i=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-i,f=n.content-n.viewport,m=r==="ltr"?[0,f]:[f*-1,0];return l$([c,u],m)(e)}function R9(e,t,n="ltr"){const r=sv(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,i=o-r,c=n==="ltr"?[0,a]:[a*-1,0],u=Kke(e,c);return l$([0,a],[0,i])(u)}function l$(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 c$(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,i=n.top!==o.top;(a||i)&&t(),n=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function ov(e,t){const n=Js(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function $d(e,t){const n=Js(t);vme(()=>{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])}var u$=JG,d$=t$,A3=n$,N3=a$;function R3({children:e,maxHeight:t,className:n="",onScroll:r}){const s=d.useCallback(()=>{r?.()},[r]);return l.jsxs(u$,{className:z("w-full overflow-hidden group",n),children:[l.jsx(d$,{className:"w-full",style:t?{maxHeight:t}:void 0,onScroll:s,children:e}),l.jsx(A3,{forceMount:!0,orientation:"vertical",className:"flex flex-col p-px duration-150 opacity-0 group-hover:opacity-100 data-[state=visible]:opacity-100",children:l.jsx(N3,{className:"relative rounded-full duration-quick !w-[5px] bg-[color:oklch(var(--foreground-color)/0.15)] before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:size-full before:min-w-[10px] before:min-h-[10px]"})})]})}function i5e(){const e=d.useRef(new Map),t=d.useCallback((s,o)=>{e.current.set(s,o)},[]),n=d.useCallback(s=>{e.current.delete(s)},[]);return{closeAll:d.useCallback(()=>{e.current.forEach(s=>s())},[]),register:t,unregister:n}}function l5e(e){const t=XG(),n=d.useId();d.useEffect(()=>{if(t)return t.submenus.register(n,e),()=>{t.submenus.unregister(n)}},[t,n,e])}function f$({children:e,maxHeightPx:t=300,minWidthPx:n,maxWidthPx:r}){const s=i5e(),o=d.useCallback(()=>{s.closeAll()},[s]),a=Ffe(o,100),i=`min(calc(var(--radix-dropdown-menu-content-available-height) - 16px), ${t}px)`;return l.jsx(T3,{submenus:s,children:l.jsx("div",{className:"bg-base shadow-overlay border-subtlest p-xs rounded-lg",style:{maxWidth:r,minWidth:n},children:l.jsx(R3,{maxHeight:i,onScroll:a,children:e})})})}var c5e="Separator",D9="horizontal",u5e=["horizontal","vertical"],m$=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=D9,...s}=e,o=d5e(r)?r:D9,i=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Et.div,{"data-orientation":o,...i,...s,ref:t})});m$.displayName=c5e;function d5e(e){return u5e.includes(e)}var f5e=m$;const j9="border-subtlest my-xs mx-sm border-t first:hidden last:hidden";function m5e(){const{isMobileStyle:e}=Bo();return e?l.jsx(f5e,{className:j9}):l.jsx(wke,{className:j9})}const p5e=4,h5e=-4;function g5e(){return z("data-[state=open]:animate-slideLeftAndFadeIn","data-[state=closed]:animate-slideLeftAndFadeOut")}function y5e({isOpen:e,onToggle:t,triggerElement:n,children:r,disabled:s=!1,minWidthPx:o,maxHeightPx:a=300,maxWidthPx:i}){const{isMobileStyle:c}=Bo(),[u,f]=d.useState(!1),m=e??u,p=d.useCallback(x=>{s||(t?t(x):f(x))},[s,t]),h=d.useCallback(()=>{t?t(!1):f(!1)},[t]);l5e(h);const g=d.useCallback(()=>{p(!m)},[p,m]),y=d.useCallback(x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),g())},[g]);if(c){const x=d.cloneElement(n,{disabled:s,onClick:g,onKeyDown:y,isExpanded:m});return l.jsxs("div",{children:[x,m&&l.jsx("div",{className:"border-subtlest ml-sm pl-md mt-xs flex flex-col gap-px border-l-2",children:r})]})}return l.jsxs(Cke,{open:m,onOpenChange:p,children:[l.jsx(Ske,{asChild:!0,disabled:s,children:n}),l.jsx(BG,{children:l.jsx(Eke,{sideOffset:p5e,alignOffset:h5e,className:g5e(),children:l.jsx(f$,{minWidthPx:o,maxHeightPx:a,maxWidthPx:i,children:r})})})]})}function x5e({children:e,disabled:t,leadingAccessory:n,subtitle:r,isExpanded:s,...o}){const{isMobileStyle:a}=Bo();return a?l.jsx(ei,{leadingAccessory:n,trailingAccessory:l.jsx("div",{className:z("transition-transform",{"rotate-90":s}),children:l.jsx(rn,{icon:B("chevron-right"),size:"small"})}),subtitle:r,role:"button",tabIndex:t?-1:0,"aria-disabled":t,"aria-expanded":s,...o,children:e}):l.jsx(ei,{leadingAccessory:n,trailingAccessory:l.jsx(rn,{icon:B("chevron-right"),size:"small"}),subtitle:r,"aria-disabled":t,...o,children:e})}var av="Switch",[v5e]=Vs(av),[b5e,_5e]=v5e(av),p$=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:c="on",onCheckedChange:u,form:f,...m}=e,[p,h]=d.useState(null),g=Sn(t,_=>h(_)),y=d.useRef(!1),x=p?f||!!p.closest("form"):!0,[v,b]=fo({prop:s,defaultProp:o??!1,onChange:u,caller:av});return l.jsxs(b5e,{scope:n,checked:v,disabled:i,children:[l.jsx(Et.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":x$(v),"data-disabled":i?"":void 0,disabled:i,value:c,...m,ref:g,onClick:rt(e.onClick,_=>{b(w=>!w),x&&(y.current=_.isPropagationStopped(),y.current||_.stopPropagation())})}),x&&l.jsx(y$,{control:p,bubbles:!y.current,name:r,value:c,checked:v,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});p$.displayName=av;var h$="SwitchThumb",g$=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=_5e(h$,n);return l.jsx(Et.span,{"data-state":x$(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});g$.displayName=h$;var w5e="SwitchBubbleInput",y$=d.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),i=Sn(a,o),c=fT(n),u=uM(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});y$.displayName=w5e;function x$(e){return e?"checked":"unchecked"}var C5e=p$,S5e=g$;const E5e=ci(z("reset interactable relative inline-block shrink-0 rounded-full shadow-inset-xs","transition-colors duration-150"),{variants:{size:{large:"h-[26px] w-11",default:"h-[22px] w-9",small:"h-[14px] w-6"},disabled:{false:"cursor-pointer",true:"cursor-default opacity-50"},checked:{false:"bg-inverse/45 dark:bg-inverse/20",true:"bg-super dark:bg-super/85"}},compoundVariants:[],defaultVariants:{size:"default",disabled:!1,checked:!1}}),k5e=ci(z("pointer-events-none absolute block rounded-full","bg-base dark:bg-inverse","before:content-[''] before:absolute before:inset-0 before:rounded-full before:bg-base dark:before:bg-white dark:before:shadow-md","transition-transform before:transition-opacity duration-150 before:duration-150"),{variants:{size:{large:"size-5 data-[state=checked]:translate-x-[18px] left-three top-three",default:"size-4 data-[state=checked]:translate-x-[14px] left-three top-three",small:"size-2.5 data-[state=checked]:translate-x-[10px] left-two top-two"},disabled:{false:"",true:"before:opacity-20"},checked:{false:"",true:""}},compoundVariants:[],defaultVariants:{size:"default",disabled:!1,checked:!1}});function fg({ref:e,checked:t=!1,onCheckedChange:n,"aria-label":r,size:s="default",disabled:o=!1,tabIndex:a=0,...i}){const c=bx(e),u=wa(i);return l.jsx(C5e,{ref:c,...u,checked:t,onCheckedChange:n,disabled:o,"aria-label":r,className:E5e({size:s,disabled:o,checked:t}),tabIndex:a,children:l.jsx(S5e,{className:k5e({size:s,disabled:o,checked:t})})})}function M5e({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=d.useCallback(h=>{h.preventDefault()},[]),f=d.useCallback(()=>{s||n(!t)},[t,s,n]),m=d.useCallback(h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},[f]),p=d.useMemo(()=>l.jsx(fg,{checked:t,onCheckedChange:n,disabled:s,"aria-label":"",size:"small",tabIndex:c?-1:0}),[t,s,c,n]);return c?l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,role:"switch","aria-checked":t,tabIndex:s?-1:0,onClick:f,onKeyDown:m,"aria-disabled":s,...i,children:e}):l.jsx(VG,{asChild:!0,disabled:s,checked:t,onCheckedChange:n,onSelect:u,textValue:r,...i,children:l.jsx(ei,{leadingAccessory:o,trailingAccessory:p,subtitle:a,children:e})})}var iv="Dialog",[v$]=Vs(iv),[T5e,Ma]=v$(iv),b$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,i=d.useRef(null),c=d.useRef(null),[u,f]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:iv});return l.jsx(T5e,{scope:t,triggerRef:i,contentRef:c,contentId:ls(),titleId:ls(),descriptionId:ls(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(m=>!m),[f]),modal:a,children:n})};b$.displayName=iv;var _$="DialogTrigger",w$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(_$,n),o=Sn(t,s.triggerRef);return l.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_T(s.open),...r,ref:o,onClick:rt(e.onClick,s.onOpenToggle)})});w$.displayName=_$;var vT="DialogPortal",[A5e,C$]=v$(vT,{forceMount:void 0}),S$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ma(vT,t);return l.jsx(A5e,{scope:t,forceMount:n,children:d.Children.map(r,a=>l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:a})}))})};S$.displayName=vT;var l2="DialogOverlay",E$=d.forwardRef((e,t)=>{const n=C$(l2,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ma(l2,e.__scopeDialog);return o.modal?l.jsx(Hr,{present:r||o.open,children:l.jsx(R5e,{...s,ref:t})}):null});E$.displayName=l2;var N5e=qp("DialogOverlay.RemoveScroll"),R5e=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(l2,n);return l.jsx(lg,{as:N5e,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Et.div,{"data-state":_T(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Yc="DialogContent",k$=d.forwardRef((e,t)=>{const n=C$(Yc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ma(Yc,e.__scopeDialog);return l.jsx(Hr,{present:r||o.open,children:o.modal?l.jsx(D5e,{...s,ref:t}):l.jsx(j5e,{...s,ref:t})})});k$.displayName=Yc;var D5e=d.forwardRef((e,t)=>{const n=Ma(Yc,e.__scopeDialog),r=d.useRef(null),s=Sn(t,n.contentRef,r);return d.useEffect(()=>{const o=r.current;if(o)return rT(o)},[]),l.jsx(M$,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rt(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:rt(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&o.preventDefault()}),onFocusOutside:rt(e.onFocusOutside,o=>o.preventDefault())})}),j5e=d.forwardRef((e,t)=>{const n=Ma(Yc,e.__scopeDialog),r=d.useRef(!1),s=d.useRef(!1);return l.jsx(M$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),M$=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,i=Ma(Yc,n),c=d.useRef(null),u=Sn(t,c);return nT(),l.jsxs(l.Fragment,{children:[l.jsx(Xx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(vx,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":_T(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(I5e,{titleId:i.titleId}),l.jsx(O5e,{contentRef:c,descriptionId:i.descriptionId})]})]})}),bT="DialogTitle",T$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(bT,n);return l.jsx(Et.h2,{id:s.titleId,...r,ref:t})});T$.displayName=bT;var A$="DialogDescription",N$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(A$,n);return l.jsx(Et.p,{id:s.descriptionId,...r,ref:t})});N$.displayName=A$;var R$="DialogClose",D$=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ma(R$,n);return l.jsx(Et.button,{type:"button",...r,ref:t,onClick:rt(e.onClick,()=>s.onOpenChange(!1))})});D$.displayName=R$;function _T(e){return e?"open":"closed"}var j$="DialogTitleWarning",[obt,I$]=bme(j$,{contentName:Yc,titleName:bT,docsSlug:"dialog"}),I5e=({titleId:e})=>{const t=I$(j$),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 d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},P5e="DialogDescriptionWarning",O5e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${I$(P5e).contentName}}.`;return d.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},wT=b$,P$=w$,CT=S$,ST=E$,ET=k$,O$=T$,abt=N$,L$=D$;function L5e({modal:e,props:t}){const{openStackedModal:n}=Uo(),r=d.useRef(null);return d.useEffect(()=>{if(e)return r.current=n(e,t),()=>{r.current&&(r.current.closeModal(),r.current=null)}},[e,n,t]),null}const F5e=d.memo(L5e),B5e=()=>null,U5e=B5e,V5e={onClose:()=>{},legacyIdentifier:"__NONE__"};function H5e(){return z("fixed inset-0","bg-black/50","data-[state=open]:animate-fadeIn","data-[state=closed]:animate-fadeOut")}function z5e(){return z("bg-base","fixed inset-x-0 bottom-0","pb-lg","flex flex-col","max-h-[90vh]","shadow-lg","data-[state=open]:animate-slideUpAndFadeIn","data-[state=closed]:animate-slideDownAndFadeOut")}function F$({isOpen:e,onToggle:t,triggerElement:n,children:r}){const s=d.useCallback(()=>t(!1),[t]);return l.jsx(Vke,{close:s,children:l.jsxs(wT,{open:e,onOpenChange:t,children:[l.jsx(P$,{asChild:!0,children:n}),l.jsxs(CT,{children:[l.jsx(ST,{className:H5e()}),l.jsxs(ET,{className:z5e(),"aria-describedby":void 0,children:[l.jsx(FU,{children:l.jsx(O$,{})}),l.jsxs("div",{className:"px-md pt-14 flex-1 overflow-y-auto",children:[l.jsx(F5e,{modal:U5e,props:V5e}),r]}),l.jsx("div",{className:"absolute top-md right-md z-10",children:l.jsx(L$,{asChild:!0,children:l.jsx(wt,{icon:B("x"),variant:"text",size:"default",rounded:!0,"aria-label":"Close"})})})]})]})]})})}function W5e({isOpen:e,onToggle:t,onOpen:n}){const r=d.useRef(e);return d.useEffect(()=>{e&&!r.current&&n?.(),r.current=e},[e,n]),{handleToggle:d.useCallback(o=>{o&&!r.current&&e===void 0&&n?.(),r.current=o,t?.(o)},[e,n,t])}}const G5e=e=>l.jsx("span",{className:z(["text-super"],{"opacity-0":!e}),children:l.jsx(rn,{icon:B("check"),size:"small"})});function $5e({children:e,checked:t,onCheckedChange:n,textValue:r,disabled:s,leadingAccessory:o,subtitle:a,...i}){const{isMobileStyle:c}=Bo(),u=d.useCallback(()=>{s||t||n(!0)},[t,s,n]),f=d.useCallback(p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())},[u]),m=d.useMemo(()=>G5e(t),[t]);return c?l.jsx(ei,{leadingAccessory:o,trailingAccessory:m,subtitle:a,role:"radio","aria-checked":t,tabIndex:s?-1:0,onClick:u,onKeyDown:f,"aria-disabled":s,...i,children:e}):l.jsx(ei,{leadingAccessory:o,trailingAccessory:m,subtitle:a,role:"radio","aria-checked":t,tabIndex:s?-1:0,onClick:u,onKeyDown:f,"aria-disabled":s,...i,children:e})}const q5e=4,K5e=8;function Y5e({isOpen:e,onToggle:t,onOpen:n,triggerElement:r,children:s,minWidthPx:o,maxHeightPx:a=300,maxWidthPx:i,align:c="start",modal:u=!1,portalTargetElement:f,__dangerouslySetZIndex:m}){const{isMobileStyle:p}=Bo(),{handleToggle:h}=W5e({isOpen:e,onToggle:t,onOpen:n});return p?l.jsx(F$,{isOpen:e,onToggle:h,triggerElement:r,children:l.jsx(T3,{children:s})}):l.jsx(T3,{children:l.jsxs(yke,{open:e,onOpenChange:h,modal:u,children:[l.jsx(xke,{asChild:!0,children:r}),l.jsx(BG,{container:f,children:l.jsx(vke,{align:c,sideOffset:q5e,className:Q5e({zIndex:X5e(f)?m:void 0}),collisionPadding:K5e,children:l.jsx(f$,{minWidthPx:o,maxHeightPx:a,maxWidthPx:i,children:s})})})]})})}const Dt=Object.assign(Y5e,{Button:Nke,Item:Gke,CheckboxItem:Fke,LinkItem:qke,RadioItem:$5e,Separator:m5e,SwitchItem:M5e,Submenu:y5e,SubmenuItem:x5e,Group:Bke});function Q5e({zIndex:e}){return z("origin-[var(--radix-dropdown-menu-content-transform-origin)]","data-[state=open]:animate-scaleAndFadeIn","data-[state=closed]:animate-scaleAndFadeOut",{"z-10":e===10})}function X5e(e){return e!=null&&e!==document.body}const Z5e=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"cf-ping",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},iy="recentItems";async function J5e({reason:e}){try{const{error:t}=await de.GET("/rest/ping",e);if(t)throw t;return}catch(t){Z.error("Failed to ping.",t);return}}async function eMe({reason:e}){try{const{data:t,error:n,response:r}=await de.GET("/rest/thread/list_recent",e);if(n||!t)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t}catch(t){throw Z.error("Failed to get recent threads.",t),t}}const tMe=({reason:e})=>{const{variation:t}=Z5e(!1),n=d.useRef(t);n.current=t;const{isIncognito:r}=Yz({reason:e}),{inFlightLatest:s}=on(),{session:o}=Ne(),a=o?.user?.email,{data:i,refetch:c,isLoading:u}=mt({queryKey:be.makeQueryKey(iy,a),queryFn:async()=>{if(!a||r)return Pe;const f=await eMe({reason:e});return n.current&&J5e({reason:e}),f}});return d.useEffect(()=>{s||c({cancelRefetch:!1})},[s,c]),d.useMemo(()=>!a||r?{data:[],isLoading:!1}:{data:i??Pe,isLoading:u},[i,a,r,u])};function nMe({activeStreams:e,streams:t,threads:n,entries:r}){return Array.from(e).reverse().map(s=>{const o=t[s];if(!o)return;const a=o.threadId;if(!a)return;const c=n.find(f=>f.id===a)?.entryIds?.[0];if(!c)return;const u=r[c];if(u)return{id:a,slug:u.thread_url_slug,title:u.thread_title??u.query_str??o.placeholderChunk?.query_str??"",rwToken:u.read_write_token,lastUpdated:u.updated_datetime,contextUUID:u.context_uuid,collectionInfo:u.collection_info,displayModel:u.display_model,entryUUID:u.uuid,socialInfo:u.social_info,focus:u.search_focus,mode:u.mode,source:u.source,streamCreatedAt:u.stream_created_at}}).filter(s=>s!=null)}function rMe(){const e=Hs(),{activeStreams:t,streams:n,threads:r,entries:s}=e.getState();return d.useMemo(()=>{const o=nMe({activeStreams:t,streams:n,threads:r,entries:s}),a=new Set;return o.filter(i=>!i.slug||a.has(i.slug)?!1:(a.add(i.slug),!0))},[t,n,r,s])}function sMe({reason:e}){const{data:t,isLoading:n}=tMe({reason:e}),r=rMe();return d.useMemo(()=>({isLoading:n,data:[...r.filter(s=>!t.some(o=>o.link.split("/").pop()===s.slug)).filter(s=>!t.some(o=>o.uuid===s.id)).filter(s=>s.slug!==null).map(s=>({uuid:s.id,variant:"thread",link:`/search/${s.slug}`,title:s.title??"",isStreaming:!0,unread:!1})),...t]}),[t,r,n])}const oMe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"close-sidecar-on-open-in-new-tab",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},aMe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"sidecar-back-to-thread-button",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function D3(e){return e&&"is_widget"in e&&e.is_widget===!0}function iMe(e){return e&&"card_type"in e}function I9(e){return"is_code_interpreter"in e&&e.is_code_interpreter===!0&&e.is_image}const lv=({reason:e})=>{const t=Yt(),{searchTerm:n}=TW(),r=Lx({search_term:n??""}),s=xz(),o=r1e(),a=s1e(),i=Hs(),c=bz(),u=el(),{mutate:f}=Rt({mutationKey:["removeWidget"],mutationFn:async({entryUUID:g,data:y})=>D3(y)?h_e({backendUUID:g,url:y.url,rwToken:u,reason:e}):Promise.resolve(),onMutate:async({entryUUID:g,data:y})=>{await t.cancelQueries({queryKey:be.makeQueryKey("results")}),c(g,x=>D3(y)?{...x,widget_data:x.widget_data?.filter(v=>v.url!==y.url)}:x)}}),{mutate:m}=Rt({mutationFn:async g=>{try{const{error:y,response:x}=await de.DELETE("/rest/thread/delete_all_threads",e,{body:{delete_all:g==="all"},timeoutMs:0});if(y)throw new he("API_CLIENTS_ERROR",{cause:y,status:x.status??0})}catch(y){Z.error(y)}},onMutate:async g=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:Xt()});const y=t.getQueryData(r),x=t.getQueryData(Xt()),v=[];return g==="all"?(t.setQueryData(Xt(),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.map(S=>({...S,thread_count:0})));return{...b,pages:_}}),t.setQueryData(r,b=>({...b,pages:[]}))):g==="standalone"&&t.setQueryData(r,b=>({...b,pages:b.pages.map(_=>_.filter(w=>w.collection?.uuid?!0:(v.push(w.uuid),!1)))})),{previousThreads:y,previousCollections:x,deletedUUIDs:v}},onSettled:(g,y,x,v)=>{y?(t.setQueryData(r,v?.previousThreads),t.setQueryData(Xt(),v?.previousCollections)):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:Xt()}),t.invalidateQueries({queryKey:bd()}),t.invalidateQueries({queryKey:be.makeQueryKey(iy)}),x==="all"?(s(),i.getState().threads.forEach(b=>a(b.id))):x==="standalone"&&v?.deletedUUIDs.forEach(b=>{o(b),s(b)}))}}),{mutate:p}=Rt({mutationFn:async({entryUUID:g,callback:y})=>{y?.(),await p_e({entryUUID:g,rwToken:u,callback:y,reason:e})},onMutate:async({entryUUID:g,collectionSlug:y})=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:Xt()});const x=t.getQueryData(r),v=t.getQueryData(Xt());return t.setQueryData(r,b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.filter(S=>S.uuid!==g));return{...b,pages:_}}),y&&(t.setQueryData(Xt(),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.map(S=>S.slug===y?{...S,thread_count:S.thread_count-1}:S));return{...b,pages:_}}),t.setQueryData(bd({collection_slug:y}),b=>{b=b||{pages:[],pageParams:[]};const _=b.pages.map(w=>w.filter(S=>S.uuid!==g));return{...b,pages:_}})),{previousThreads:x,previousCollections:v}},onSettled:(g,y,{entryUUID:x},v)=>{y?(t.setQueryData(r,v?.previousThreads),t.setQueryData(Xt(),v?.previousCollections)):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:Xt()}),t.invalidateQueries({queryKey:bd()}),t.invalidateQueries({queryKey:be.makeQueryKey(iy)}),o(x),s(x))}}),{mutate:h}=Rt({mutationFn:async({entryUUIDs:g,callback:y})=>{y?.(),await m_e({entryUUIDs:g,rwToken:u,reason:e})},onMutate:async({entryUUIDs:g})=>{await t.cancelQueries({queryKey:r});const y=t.getQueryData(r),x=t.getQueryData(Xt());return t.setQueryData(r,v=>{v=v||{pages:[],pageParams:[]};const b=v.pages.map(_=>_.filter(w=>!g.includes(w.uuid)));return{...v,pages:b}}),{previousThreads:y,previousCollections:x}},onSettled:(g,y,{entryUUIDs:x},v)=>{y?t.setQueryData(r,v?.previousThreads):(t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:be.makeQueryKey(iy)}),x.forEach(b=>{o(b),s(b)}))}});return d.useMemo(()=>({removeWidgetFromEntry:f,deleteAllThreads:m,deleteThread:p,deleteThreads:h}),[m,p,h,f])},B$=/\[([^\]]+)\]\(((?:\([^)]*\)|[^()])*)\)/g,lMe=e=>e?e.replace(B$,"$1"):"",cMe=e=>{if(!e)return{displayTitle:"",links:[]};const t=[];let n="",r=0,s=0,o;const a=new RegExp(B$);for(;(o=a.exec(e))!==null;){const i=o[1],c=o[2],u=o.index;if(n+=e.substring(r,u),s+=u-r,i){const f=s;n+=i,s+=i.length;const m=s;c&&t.push({url:c,startOffset:f,endOffset:m})}r=a.lastIndex}return n+=e.substring(r),{displayTitle:n,links:t}},U$=A.memo(function(){const t=un(),{inFlight:n}=on(),{$t:r}=J(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(async()=>{const i=t.getStore().getState().sidecarSourceTab.tabId;o("sidecar button clicked",{buttonType:"back_to_thread"}),await t.moveSidecarToThread(i)},[t,o]);return l.jsx(wt,{variant:"text",size:"small",disabled:n,icon:B("arrow-bar-to-left"),"aria-label":r({defaultMessage:"Back to thread",id:"C1eDCaAWRL",description:"Return sidecar query to the thread tab."}),onClick:a})});U$.displayName="BackToThreadButton";const uMe=5,dMe=()=>{const{device:{isMacOS:e}}=sn(),t=C3(o=>o.globalShortcuts[qn.NEW_THREAD]),n=e?Mn.MACOS:Mn.WINDOWS,r=d.useMemo(()=>t[n],[n,t]),s=d.useMemo(()=>r.map(o=>$we(o)),[r]);return d.useMemo(()=>s.join(e?"":"+"),[e,s])},V$=A.memo(function(){const{$t:t}=J(),{session:n}=Ne(),{trackEvent:r}=Xe(n),s=Rn(),o=dMe(),a=d.useCallback(()=>{r("sidecar button clicked",{buttonType:"new_thread"}),s.push("/")},[r,s]);return l.jsx(wt,{variant:"text",size:"small",icon:B("pencil-plus"),"aria-label":`${t({defaultMessage:"New thread",id:"ITYqY7w9pw"})} (${o})`,onClick:a})});V$.displayName="NewThreadButton";const H$=A.memo(function({ref:t,disableOpenInTab:n}){const{$t:r}=J(),{data:s,isLoading:o}=sMe({reason:"sidecar-controls-library"}),{session:a}=Ne(),{trackEvent:i}=Xe(a),{inFlight:c,results:u}=on(),{deleteThread:f}=lv({reason:"sidecar-controls-library"}),m=On(),p=Rn(),[h,g]=d.useState(()=>new Set),y=un(),x=Qn(),{variation:v}=oMe(!1),b=d.useMemo(()=>(s??[]).filter(E=>!h.has(E.uuid)).slice(0,uMe),[s,h]),_=d.useCallback(E=>{i("sidecar button clicked",{buttonType:"delete_thread"}),g(T=>new Set([...T,E.uuid])),f({entryUUID:E.uuid,callback:()=>{E.link===m&&p.push("/")}})},[f,m,p,i]),w=d.useCallback(async()=>{const E=x.sidecarSourceTab.tabId;v&&y.closeSideCar({tabId:E}).catch(()=>{}),y.openNewTab(location.href),i("sidecar button clicked",{buttonType:"open_in_tab"})},[y,i,v,x.sidecarSourceTab.tabId]),S=d.useCallback(()=>{i("sidecar library clicked",{type:"opened"}),i("sidecar button clicked",{buttonType:"library"})},[i]),C=d.useMemo(()=>s?.find(E=>!h.has(E.uuid)&&(E.link===m||u.some(T=>T.backend_uuid===E.uuid))),[s,h,m,u]);return l.jsxs(Dt,{triggerElement:l.jsx(wt,{variant:"text",size:"small",disabled:o||!s.length,icon:B("dots"),"aria-label":r({defaultMessage:"Menu",id:"/wFZYLAHuk",description:"Show Perplexity threads library."}),ref:t}),minWidthPx:240,maxWidthPx:240,maxHeightPx:400,align:"end",onOpen:S,children:[!n&&l.jsxs(l.Fragment,{children:[l.jsx(Dt.Item,{disabled:c,leadingAccessory:B("external-link"),onSelect:w,children:r({defaultMessage:"Open in new tab",id:"Kl9f3MwImT",description:"Open the Perplexity sidebar in a new tab."})}),C&&l.jsx(Dt.Item,{leadingAccessory:B("trash"),onSelect:()=>_(C),children:r({defaultMessage:"Delete thread",id:"2WxP2iMtPx"})}),l.jsx(Dt.Separator,{})]}),b.map(E=>{const T=u.some(k=>k.backend_uuid===E.uuid);return l.jsx(Dt.LinkItem,{href:E.link,className:"group/item",trailingAccessory:T?l.jsx(rn,{icon:B("check"),size:"small"}):void 0,onSelect:()=>{i("sidecar library clicked",{type:"selected"})},children:l.jsx("span",{className:"line-clamp-1",children:lMe(E.title)})},E.uuid)}),l.jsx(Dt.LinkItem,{href:"/library",className:"text-quiet",onSelect:()=>{i("sidecar library clicked",{type:"view_all"})},children:r({defaultMessage:"View all…",id:"yr9iXqRRXf"})})]})});H$.displayName="ShowLibraryButton";const z$=A.memo(function({disableNewThread:t,disableOpenInTab:n}){const r=d.useRef(null),[s,o]=d.useState(!1),a=Qn(),{variation:i}=aMe(!1),c=d.useMemo(()=>ro(a.sidecarSourceTab.tabId,a.sidecarSourceTab.secondaryTab?.tabId),[a.sidecarSourceTab.tabId,a.sidecarSourceTab.secondaryTab?.tabId]),u=a.sidecarAutoOpenedThreads[c]??!1,f=i&&u,m=d.useCallback(()=>{s&&r.current?.focus()},[s,r]);return d.useEffect(()=>{const p=g=>{["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(g.key)&&o(!0)},h=()=>{o(!1)};return window.addEventListener("keydown",p),window.addEventListener("click",h),()=>{window.removeEventListener("keydown",p),window.removeEventListener("click",h)}},[]),l.jsx("div",{className:"relative z-20",children:l.jsxs(K,{variant:"background",className:"py-sm px-md h-headerHeight relative flex items-center justify-between",children:[l.jsx("div",{className:"flex items-center",children:f&&l.jsx(U$,{})}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{className:"size-0 appearance-none opacity-0",onFocus:m}),!t&&l.jsx(V$,{}),l.jsx(H$,{ref:r,disableOpenInTab:n})]})]})})});z$.displayName="SideCarNavBar";const fMe=({children:e,fixed:t=!1})=>{const[n,r]=d.useState(!1),{scrollContainerRef:s}=ka();return d.useLayoutEffect(()=>{const o=s?.current;if(!o)return;o.scrollTop>0&&r(!0)},[s]),d.useEffect(()=>{const o=s?.current;if(!o)return;const a=()=>{const u=o.scrollTop;r(u>0)},c=o===document.documentElement?window:o;return c.addEventListener("scroll",a,{passive:!0}),()=>c.removeEventListener("scroll",a)},[s]),l.jsxs(l.Fragment,{children:[e,l.jsx("div",{className:z("border-subtlest top-headerHeight pointer-events-none inset-x-0 z-[2] h-px border-b transition-opacity duration-200",t?"fixed":"absolute"),style:{opacity:n?1:0}})]})},Of=A.memo(({children:e,withoutHeader:t,disableNewThread:n,disableOpenInTab:r})=>(LW(),l.jsx(o3e,{children:l.jsxs(a3e,{children:[!t&&l.jsx(fMe,{children:l.jsx(z$,{disableNewThread:n,disableOpenInTab:r})}),l.jsx(Qx,{childrenWidth:"none",children:e})]})})));Of.displayName="Layout";const sh=d.createContext({});function mg(e){const t=d.useRef(null);return t.current===null&&(t.current=e()),t.current}const kT=typeof window<"u",cv=kT?d.useLayoutEffect:d.useEffect,uv=d.createContext(null);function MT(e,t){e.indexOf(t)===-1&&e.push(t)}function pg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Gi=(e,t,n)=>n>t?t:n{};const $i={},W$=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function G$(e){return typeof e=="object"&&e!==null}const $$=e=>/^0[^.\s]+$/u.test(e);function AT(e){let t;return()=>(t===void 0&&(t=e()),t)}const To=e=>e,mMe=(e,t)=>n=>t(e(n)),hg=(...e)=>e.reduce(mMe),qd=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class NT{constructor(){this.subscriptions=[]}add(t){return MT(this.subscriptions,t),()=>pg(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;oe*1e3,$a=e=>e/1e3;function q$(e,t){return t?e*(1e3/t):0}const pMe=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},K$=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,hMe=1e-7,gMe=12;function yMe(e,t,n,r,s){let o,a,i=0;do a=t+(n-t)/2,o=K$(a,r,s)-e,o>0?n=a:t=a;while(Math.abs(o)>hMe&&++iyMe(o,0,1,e,n);return o=>o===0||o===1?o:K$(s(o),t,r)}const Y$=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Q$=e=>t=>1-e(1-t),X$=tl(.33,1.53,.69,.99),RT=Q$(X$),Z$=Y$(RT),J$=e=>(e*=2)<1?.5*RT(e):.5*(2-Math.pow(2,-10*(e-1))),DT=e=>1-Math.sin(Math.acos(e)),eq=Q$(DT),tq=Y$(DT),xMe=tl(.42,0,1,1),Kd=tl(0,0,.58,1),qa=tl(.42,0,.58,1),nq=e=>Array.isArray(e)&&typeof e[0]!="number";function rq(e,t){return nq(e)?e[pMe(0,e.length,t)]:e}const sq=e=>Array.isArray(e)&&typeof e[0]=="number",vMe={linear:To,easeIn:xMe,easeInOut:qa,easeOut:Kd,circIn:DT,circInOut:tq,circOut:eq,backIn:RT,backInOut:Z$,backOut:X$,anticipate:J$},bMe=e=>typeof e=="string",P9=e=>{if(sq(e)){TT(e.length===4);const[t,n,r,s]=e;return tl(t,n,r,s)}else if(bMe(e))return vMe[e];return e},V0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function _Me(e,t){let n=new Set,r=new Set,s=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function c(f){a.has(f)&&(u.schedule(f),e()),f(i)}const u={schedule:(f,m=!1,p=!1)=>{const g=p&&s?n:r;return m&&a.add(f),g.has(f)||g.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(i=f,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,o&&(o=!1,u.process(f))}};return u}const wMe=40;function oq(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=V0.reduce((_,w)=>(_[w]=_Me(o),_),{}),{setup:i,read:c,resolveKeyframes:u,preUpdate:f,update:m,preRender:p,render:h,postRender:g}=a,y=()=>{const _=$i.useManualTiming?s.timestamp:performance.now();n=!1,$i.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(_-s.timestamp,wMe),1)),s.timestamp=_,s.isProcessing=!0,i.process(s),c.process(s),u.process(s),f.process(s),m.process(s),p.process(s),h.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:V0.reduce((_,w)=>{const S=a[w];return _[w]=(C,E=!1,T=!1)=>(n||x(),S.schedule(C,E,T)),_},{}),cancel:_=>{for(let w=0;w(ly===void 0&&Os.set($r.isProcessing||$i.useManualTiming?$r.timestamp:performance.now()),ly),set:e=>{ly=e,queueMicrotask(CMe)}},aq=e=>t=>typeof t=="string"&&t.startsWith(e),jT=aq("--"),SMe=aq("var(--"),IT=e=>SMe(e)?EMe.test(e.split("/*")[0].trim()):!1,EMe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Lf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},oh={...Lf,transform:e=>Gi(0,1,e)},H0={...Lf,default:1},xp=e=>Math.round(e*1e5)/1e5,PT=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kMe(e){return e==null}const MMe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,OT=(e,t)=>n=>!!(typeof n=="string"&&MMe.test(n)&&n.startsWith(e)||t&&!kMe(n)&&Object.prototype.hasOwnProperty.call(n,t)),iq=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,a,i]=r.match(PT);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(a),alpha:i!==void 0?parseFloat(i):1}},TMe=e=>Gi(0,255,e),W_={...Lf,transform:e=>Math.round(TMe(e))},Mc={test:OT("rgb","red"),parse:iq("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+W_.transform(e)+", "+W_.transform(t)+", "+W_.transform(n)+", "+xp(oh.transform(r))+")"};function AMe(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const j3={test:OT("#"),parse:AMe,transform:Mc.transform},gg=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),dl=gg("deg"),Ka=gg("%"),bt=gg("px"),NMe=gg("vh"),RMe=gg("vw"),O9={...Ka,parse:e=>Ka.parse(e)/100,transform:e=>Ka.transform(e*100)},ad={test:OT("hsl","hue"),parse:iq("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ka.transform(xp(t))+", "+Ka.transform(xp(n))+", "+xp(oh.transform(r))+")"},yr={test:e=>Mc.test(e)||j3.test(e)||ad.test(e),parse:e=>Mc.test(e)?Mc.parse(e):ad.test(e)?ad.parse(e):j3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Mc.transform(e):ad.transform(e),getAnimatableNone:e=>{const t=yr.parse(e);return t.alpha=0,yr.transform(t)}},DMe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jMe(e){return isNaN(e)&&typeof e=="string"&&(e.match(PT)?.length||0)+(e.match(DMe)?.length||0)>0}const lq="number",cq="color",IMe="var",PMe="var(",L9="${}",OMe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ah(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(OMe,c=>(yr.test(c)?(r.color.push(o),s.push(cq),n.push(yr.parse(c))):c.startsWith(PMe)?(r.var.push(o),s.push(IMe),n.push(c)):(r.number.push(o),s.push(lq),n.push(parseFloat(c))),++o,L9)).split(L9);return{values:n,split:i,indexes:r,types:s}}function uq(e){return ah(e).values}function dq(e){const{split:t,types:n}=ah(e),r=t.length;return s=>{let o="";for(let a=0;atypeof e=="number"?0:yr.test(e)?yr.getAnimatableNone(e):e;function FMe(e){const t=uq(e);return dq(e)(t.map(LMe))}const Ll={test:jMe,parse:uq,createTransformer:dq,getAnimatableNone:FMe};function G_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function BMe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,a=0;if(!t)s=o=a=n;else{const i=n<.5?n*(1+t):n+t-n*t,c=2*n-i;s=G_(c,i,e+1/3),o=G_(c,i,e),a=G_(c,i,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}function c2(e,t){return n=>n>0?t:e}const Yn=(e,t,n)=>e+(t-e)*n,$_=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},UMe=[j3,Mc,ad],VMe=e=>UMe.find(t=>t.test(e));function F9(e){const t=VMe(e);if(!t)return!1;let n=t.parse(e);return t===ad&&(n=BMe(n)),n}const B9=(e,t)=>{const n=F9(e),r=F9(t);if(!n||!r)return c2(e,t);const s={...n};return o=>(s.red=$_(n.red,r.red,o),s.green=$_(n.green,r.green,o),s.blue=$_(n.blue,r.blue,o),s.alpha=Yn(n.alpha,r.alpha,o),Mc.transform(s))},I3=new Set(["none","hidden"]);function HMe(e,t){return I3.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function zMe(e,t){return n=>Yn(e,t,n)}function LT(e){return typeof e=="number"?zMe:typeof e=="string"?IT(e)?c2:yr.test(e)?B9:$Me:Array.isArray(e)?fq:typeof e=="object"?yr.test(e)?B9:WMe:c2}function fq(e,t){const n=[...e],r=n.length,s=e.map((o,a)=>LT(o)(o,t[a]));return o=>{for(let a=0;a{for(const o in r)n[o]=r[o](s);return n}}function GMe(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Ll.createTransformer(t),r=ah(e),s=ah(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?I3.has(e)&&!s.values.length||I3.has(t)&&!r.values.length?HMe(e,t):hg(fq(GMe(r,s),s.values),n):c2(e,t)};function mq(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Yn(e,t,n):LT(e)(e,t)}const qMe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Pn.update(t,n),stop:()=>qi(t),now:()=>$r.isProcessing?$r.timestamp:Os.now()}},pq=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o=u2?1/0:t}function hq(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(FT(r),u2);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:$a(s)}}const KMe=5;function gq(e,t,n){const r=Math.max(t-KMe,0);return q$(n-e(r),t-r)}const ir={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},q_=.001;function YMe({duration:e=ir.duration,bounce:t=ir.bounce,velocity:n=ir.velocity,mass:r=ir.mass}){let s,o,a=1-t;a=Gi(ir.minDamping,ir.maxDamping,a),e=Gi(ir.minDuration,ir.maxDuration,$a(e)),a<1?(s=u=>{const f=u*a,m=f*e,p=f-n,h=P3(u,a),g=Math.exp(-m);return q_-p/h*g},o=u=>{const m=u*a*e,p=m*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-m),y=P3(Math.pow(u,2),a);return(-s(u)+q_>0?-1:1)*((p-h)*g)/y}):(s=u=>{const f=Math.exp(-u*e),m=(u-n)*e+1;return-q_+f*m},o=u=>{const f=Math.exp(-u*e),m=(n-u)*(e*e);return f*m});const i=5/e,c=XMe(s,o,i);if(e=da(e),isNaN(c))return{stiffness:ir.stiffness,damping:ir.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const QMe=12;function XMe(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function e4e(e){let t={velocity:ir.velocity,stiffness:ir.stiffness,damping:ir.damping,mass:ir.mass,isResolvedFromDuration:!1,...e};if(!U9(e,JMe)&&U9(e,ZMe))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Gi(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ir.mass,stiffness:s,damping:o}}else{const n=YMe(e);t={...t,...n,mass:ir.mass},t.isResolvedFromDuration=!0}return t}function ih(e=ir.visualDuration,t=ir.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],i={done:!1,value:o},{stiffness:c,damping:u,mass:f,duration:m,velocity:p,isResolvedFromDuration:h}=e4e({...n,velocity:-$a(n.velocity||0)}),g=p||0,y=u/(2*Math.sqrt(c*f)),x=a-o,v=$a(Math.sqrt(c/f)),b=Math.abs(x)<5;r||(r=b?ir.restSpeed.granular:ir.restSpeed.default),s||(s=b?ir.restDelta.granular:ir.restDelta.default);let _;if(y<1){const S=P3(v,y);_=C=>{const E=Math.exp(-y*v*C);return a-E*((g+y*v*x)/S*Math.sin(S*C)+x*Math.cos(S*C))}}else if(y===1)_=S=>a-Math.exp(-v*S)*(x+(g+v*x)*S);else{const S=v*Math.sqrt(y*y-1);_=C=>{const E=Math.exp(-y*v*C),T=Math.min(S*C,300);return a-E*((g+y*v*x)*Math.sinh(T)+S*x*Math.cosh(T))/S}}const w={calculatedDuration:h&&m||null,next:S=>{const C=_(S);if(h)i.done=S>=m;else{let E=S===0?g:0;y<1&&(E=S===0?da(g):gq(_,S,C));const T=Math.abs(E)<=r,k=Math.abs(a-C)<=s;i.done=T&&k}return i.value=i.done?a:C,i},toString:()=>{const S=Math.min(FT(w),u2),C=pq(E=>w.next(S*E).value,S,30);return S+"ms "+C},toTransition:()=>{}};return w}ih.applyToOptions=e=>{const t=hq(e,100,ih);return e.ease=t.ease,e.duration=da(t.duration),e.type="keyframes",e};function O3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:a,min:i,max:c,restDelta:u=.5,restSpeed:f}){const m=e[0],p={done:!1,value:m},h=T=>i!==void 0&&Tc,g=T=>i===void 0?c:c===void 0||Math.abs(i-T)-y*Math.exp(-T/r),_=T=>v+b(T),w=T=>{const k=b(T),I=_(T);p.done=Math.abs(k)<=u,p.value=p.done?v:I};let S,C;const E=T=>{h(p.value)&&(S=T,C=ih({keyframes:[p.value,g(p.value)],velocity:gq(_,T,p.value),damping:s,stiffness:o,restDelta:u,restSpeed:f}))};return E(0),{calculatedDuration:null,next:T=>{let k=!1;return!C&&S===void 0&&(k=!0,w(T),E(T)),S!==void 0&&T>=S?C.next(T-S):(!k&&w(T),p)}}}function t4e(e,t,n){const r=[],s=n||$i.mix||mq,o=e.length-1;for(let a=0;at[0];if(o===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const i=t4e(t,r,s),c=i.length,u=f=>{if(a&&f1)for(;mu(Gi(e[0],e[o-1],f)):u}function xq(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=qd(0,t,r);e.push(Yn(n,1,s))}}function vq(e){const t=[0];return xq(t,e.length-1),t}function n4e(e,t){return e.map(n=>n*t)}function r4e(e,t){return e.map(()=>t||qa).splice(0,e.length-1)}function vp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=nq(r)?r.map(P9):P9(r),o={done:!1,value:t[0]},a=n4e(n&&n.length===t.length?n:vq(t),e),i=yq(a,t,{ease:Array.isArray(s)?s:r4e(t,s)});return{calculatedDuration:e,next:c=>(o.value=i(c),o.done=c>=e,o)}}const s4e=e=>e!==null;function BT(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(s4e),i=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const o4e={decay:O3,inertia:O3,tween:vp,keyframes:vp,spring:ih};function bq(e){typeof e.type=="string"&&(e.type=o4e[e.type])}class UT{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const a4e=e=>e/100;class VT extends UT{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Os.now()&&this.tick(Os.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bq(t);const{type:n=vp,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:a=0}=t;let{keyframes:i}=t;const c=n||vp;c!==vp&&typeof i[0]!="number"&&(this.mixKeyframes=hg(a4e,mq(i[0],i[1])),i=[0,100]);const u=c({...t,keyframes:i});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...i].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=FT(u));const{calculatedDuration:f}=u;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:i,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:f,repeat:m,repeatType:p,repeatDelay:h,type:g,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let _=this.currentTime,w=r;if(m){const T=Math.min(this.currentTime,s)/i;let k=Math.floor(T),I=T%1;!I&&T>=1&&(I=1),I===1&&k--,k=Math.min(k,m+1),!!(k%2)&&(p==="reverse"?(I=1-I,h&&(I-=h/i)):p==="mirror"&&(w=a)),_=Gi(0,1,I)*i}const S=b?{done:!1,value:f[0]}:w.next(_);o&&(S.value=o(S.value));let{done:C}=S;!b&&c!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return E&&g!==O3&&(S.value=BT(f,this.options,x,this.speed)),y&&y(S.value),E&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return $a(this.calculatedDuration)}get time(){return $a(this.currentTime)}set time(t){t=da(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Os.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=$a(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=qMe,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Os.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function i4e(e){for(let t=1;te*180/Math.PI,L3=e=>{const t=Tc(Math.atan2(e[1],e[0]));return F3(t)},l4e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:L3,rotateZ:L3,skewX:e=>Tc(Math.atan(e[1])),skewY:e=>Tc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},F3=e=>(e=e%360,e<0&&(e+=360),e),V9=L3,H9=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),z9=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),c4e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:H9,scaleY:z9,scale:e=>(H9(e)+z9(e))/2,rotateX:e=>F3(Tc(Math.atan2(e[6],e[5]))),rotateY:e=>F3(Tc(Math.atan2(-e[2],e[0]))),rotateZ:V9,rotate:V9,skewX:e=>Tc(Math.atan(e[4])),skewY:e=>Tc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function B3(e){return e.includes("scale")?1:0}function U3(e,t){if(!e||e==="none")return B3(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=c4e,s=n;else{const i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=l4e,s=i}if(!s)return B3(t);const o=r[t],a=s[1].split(",").map(d4e);return typeof o=="function"?o(a):a[o]}const u4e=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return U3(n,t)};function d4e(e){return parseFloat(e.trim())}const Ff=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bf=new Set(Ff),W9=e=>e===Lf||e===bt,f4e=new Set(["x","y","z"]),m4e=Ff.filter(e=>!f4e.has(e));function p4e(e){const t=[];return m4e.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ic={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>U3(t,"x"),y:(e,{transform:t})=>U3(t,"y")};Ic.translateX=Ic.x;Ic.translateY=Ic.y;const Pc=new Set;let V3=!1,H3=!1,z3=!1;function _q(){if(H3){const e=Array.from(Pc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=p4e(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,a])=>{r.getValue(o)?.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}H3=!1,V3=!1,Pc.forEach(e=>e.complete(z3)),Pc.clear()}function wq(){Pc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(H3=!0)})}function h4e(){z3=!0,wq(),_q(),z3=!1}class HT{constructor(t,n,r,s,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Pc.add(this),V3||(V3=!0,Pn.read(wq),Pn.resolveKeyframes(_q))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s?.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const i=r.readValue(n,a);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}i4e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Pc.delete(this)}cancel(){this.state==="scheduled"&&(Pc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const g4e=e=>e.startsWith("--");function y4e(e,t,n){g4e(t)?e.style.setProperty(t,n):e.style[t]=n}const x4e=AT(()=>window.ScrollTimeline!==void 0),v4e={};function b4e(e,t){const n=AT(e);return()=>v4e[t]??n()}const Cq=b4e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ep=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,G9={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ep([0,.65,.55,1]),circOut:ep([.55,0,1,.45]),backIn:ep([.31,.01,.66,-.59]),backOut:ep([.33,1.53,.69,.99])};function Sq(e,t){if(e)return typeof e=="function"?Cq()?pq(e,t):"ease-out":sq(e)?ep(e):Array.isArray(e)?e.map(n=>Sq(n,t)||G9.easeOut):G9[e]}function _4e(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:i="easeOut",times:c}={},u=void 0){const f={[t]:n};c&&(f.offset=c);const m=Sq(i,s);Array.isArray(m)&&(f.easing=m);const p={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return u&&(p.pseudoElement=u),e.animate(f,p)}function zT(e){return typeof e=="function"&&"applyToOptions"in e}function w4e({type:e,...t}){return zT(e)&&Cq()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class C4e extends UT{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:i,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=t,TT(typeof t.type!="string");const u=w4e(t);this.animation=_4e(n,r,s,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const f=BT(s,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(f):y4e(n,r,f),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return $a(Number(t))}get time(){return $a(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=da(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&x4e()?(this.animation.timeline=t,To):n(this)}}const Eq={anticipate:J$,backInOut:Z$,circInOut:tq};function S4e(e){return e in Eq}function E4e(e){typeof e.ease=="string"&&S4e(e.ease)&&(e.ease=Eq[e.ease])}const $9=10;class k4e extends C4e{constructor(t){E4e(t),bq(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const i=new VT({...a,autoplay:!1}),c=da(this.finishedTime??this.time);n.setWithVelocity(i.sample(c-$9).value,i.sample(c).value,$9),i.stop()}}const q9=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ll.test(e)||e==="0")&&!e.startsWith("url("));function M4e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function R4e(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return N4e()&&n&&A4e.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}const D4e=40;class j4e extends UT{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",keyframes:i,name:c,motionValue:u,element:f,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Os.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:a,name:c,motionValue:u,element:f,...m},h=f?.KeyframeResolver||HT;this.keyframeResolver=new h(i,(g,y,x)=>this.onKeyframesResolved(g,y,p,!x),c,u,f),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:i,delay:c,isHandoff:u,onUpdate:f}=r;this.resolvedAt=Os.now(),T4e(t,o,a,i)||(($i.instantAnimations||!c)&&f?.(BT(t,r,n)),t[0]=t[t.length-1],W3(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>D4e?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!u&&R4e(p)?new k4e({...p,element:p.motionValue.owner.current}):new VT(p);h.finished.then(()=>this.notifyFinished()).catch(To),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),h4e()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class I4e{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;rr.attachTimeline(t));return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class P4e extends I4e{then(t,n){return this.finished.finally(t).then(()=>{})}}const O4e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function L4e(e){const t=O4e.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function kq(e,t,n=1){const[r,s]=L4e(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return W$(a)?parseFloat(a):a}return IT(s)?kq(s,t,n+1):s}function WT(e,t){return e?.[t]??e?.default??e}const Mq=new Set(["width","height","top","left","right","bottom",...Ff]),F4e={test:e=>e==="auto",parse:e=>e},Tq=e=>t=>t.test(e),Aq=[Lf,bt,Ka,dl,RMe,NMe,F4e],K9=e=>Aq.find(Tq(e));function B4e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$$(e):!0}const U4e=new Set(["brightness","contrast","saturate","opacity"]);function V4e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(PT)||[];if(!r)return e;const s=n.replace(r,"");let o=U4e.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const H4e=/\b([a-z-]*)\(.*?\)/gu,G3={...Ll,getAnimatableNone:e=>{const t=e.match(H4e);return t?t.map(V4e).join(" "):e}},Y9={...Lf,transform:Math.round},z4e={rotate:dl,rotateX:dl,rotateY:dl,rotateZ:dl,scale:H0,scaleX:H0,scaleY:H0,scaleZ:H0,skew:dl,skewX:dl,skewY:dl,distance:bt,translateX:bt,translateY:bt,translateZ:bt,x:bt,y:bt,z:bt,perspective:bt,transformPerspective:bt,opacity:oh,originX:O9,originY:O9,originZ:bt},GT={borderWidth:bt,borderTopWidth:bt,borderRightWidth:bt,borderBottomWidth:bt,borderLeftWidth:bt,borderRadius:bt,radius:bt,borderTopLeftRadius:bt,borderTopRightRadius:bt,borderBottomRightRadius:bt,borderBottomLeftRadius:bt,width:bt,maxWidth:bt,height:bt,maxHeight:bt,top:bt,right:bt,bottom:bt,left:bt,padding:bt,paddingTop:bt,paddingRight:bt,paddingBottom:bt,paddingLeft:bt,margin:bt,marginTop:bt,marginRight:bt,marginBottom:bt,marginLeft:bt,backgroundPositionX:bt,backgroundPositionY:bt,...z4e,zIndex:Y9,fillOpacity:oh,strokeOpacity:oh,numOctaves:Y9},W4e={...GT,color:yr,backgroundColor:yr,outlineColor:yr,fill:yr,stroke:yr,borderColor:yr,borderTopColor:yr,borderRightColor:yr,borderBottomColor:yr,borderLeftColor:yr,filter:G3,WebkitFilter:G3},Nq=e=>W4e[e];function Rq(e,t){let n=Nq(e);return n!==G3&&(n=Ll),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const G4e=new Set(["auto","none","0"]);function $4e(e,t,n){let r=0,s;for(;r{t.getValue(i).set(c)}),this.resolveNoneKeyframes()}}function Dq(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const jq=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Iq(e){return G$(e)&&"offsetHeight"in e}const Q9=30,K4e=e=>!isNaN(parseFloat(e)),bp={current:void 0};class Y4e{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=Os.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Os.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=K4e(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new NT);const r=this.events[t].add(n);return t==="change"?()=>{r(),Pn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return bp.current&&bp.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Os.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Q9)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Q9);return q$(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qc(e,t){return new Y4e(e,t)}const{schedule:$T}=oq(queueMicrotask,!1),ea={x:!1,y:!1};function Pq(){return ea.x||ea.y}function Q4e(e){return e==="x"||e==="y"?ea[e]?null:(ea[e]=!0,()=>{ea[e]=!1}):ea.x||ea.y?null:(ea.x=ea.y=!0,()=>{ea.x=ea.y=!1})}function Oq(e,t){const n=Dq(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function X9(e){return!(e.pointerType==="touch"||Pq())}function X4e(e,t,n={}){const[r,s,o]=Oq(e,n),a=i=>{if(!X9(i))return;const{target:c}=i,u=t(c,i);if(typeof u!="function"||!c)return;const f=m=>{X9(m)&&(u(m),c.removeEventListener("pointerleave",f))};c.addEventListener("pointerleave",f,s)};return r.forEach(i=>{i.addEventListener("pointerenter",a,s)}),o}const Lq=(e,t)=>t?e===t?!0:Lq(e,t.parentElement):!1,qT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Z4e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function J4e(e){return Z4e.has(e.tagName)||e.tabIndex!==-1}const cy=new WeakSet;function Z9(e){return t=>{t.key==="Enter"&&e(t)}}function K_(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const eTe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Z9(()=>{if(cy.has(n))return;K_(n,"down");const s=Z9(()=>{K_(n,"up")}),o=()=>K_(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function J9(e){return qT(e)&&!Pq()}function tTe(e,t,n={}){const[r,s,o]=Oq(e,n),a=i=>{const c=i.currentTarget;if(!J9(i))return;cy.add(c);const u=t(c,i),f=(h,g)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",p),cy.has(c)&&cy.delete(c),J9(h)&&typeof u=="function"&&u(h,{success:g})},m=h=>{f(h,c===window||c===document||n.useGlobalTarget||Lq(c,h.target))},p=h=>{f(h,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",p,s)};return r.forEach(i=>{(n.useGlobalTarget?window:i).addEventListener("pointerdown",a,s),Iq(i)&&(i.addEventListener("focus",u=>eTe(u,s)),!J4e(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),o}function KT(e){return G$(e)&&"ownerSVGElement"in e}function Fq(e){return KT(e)&&e.tagName==="svg"}function nTe(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],o=e[2+n],a=e[3+n],i=yq(s,o,a);return t?i(r):i}const Lr=e=>!!(e&&e.getVelocity),rTe=[...Aq,yr,Ll],sTe=e=>rTe.find(Tq(e)),dv=d.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class oTe extends d.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Iq(r)&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function aTe({children:e,isPresent:t,anchorX:n,root:r}){const s=d.useId(),o=d.useRef(null),a=d.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=d.useContext(dv);return d.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:m,right:p}=a.current;if(t||!o.current||!c||!u)return;const h=n==="left"?`left: ${m}`:`right: ${p}`;o.current.dataset.motionPopId=s;const g=document.createElement("style");i&&(g.nonce=i);const y=r??document.head;return y.appendChild(g),g.sheet&&g.sheet.insertRule(` - [data-motion-pop-id="${s}"] { - position: absolute !important; - width: ${c}px !important; - height: ${u}px !important; - ${h}px !important; - top: ${f}px !important; - } - `),()=>{y.contains(g)&&y.removeChild(g)}},[t]),l.jsx(oTe,{isPresent:t,childRef:o,sizeRef:a,children:d.cloneElement(e,{ref:o})})}const iTe=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:a,anchorX:i,root:c})=>{const u=mg(lTe),f=d.useId();let m=!0,p=d.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:h=>{u.set(h,!0);for(const g of u.values())if(!g)return;r&&r()},register:h=>(u.set(h,!1),()=>u.delete(h))}),[n,u,r]);return o&&m&&(p={...p}),d.useMemo(()=>{u.forEach((h,g)=>u.set(g,!1))},[n]),d.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(aTe,{isPresent:n,anchorX:i,root:c,children:e})),l.jsx(uv.Provider,{value:p,children:e})};function lTe(){return new Map}function Bq(e=!0){const t=d.useContext(uv);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=d.useId();d.useEffect(()=>{if(e)return s(o)},[e]);const a=d.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,a]:[!0]}const z0=e=>e.key||"";function eD(e){const t=[];return d.Children.forEach(e,n=>{d.isValidElement(n)&&t.push(n)}),t}const St=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:a=!1,anchorX:i="left",root:c})=>{const[u,f]=Bq(a),m=d.useMemo(()=>eD(e),[e]),p=a&&!u?[]:m.map(z0),h=d.useRef(!0),g=d.useRef(m),y=mg(()=>new Map),[x,v]=d.useState(m),[b,_]=d.useState(m);cv(()=>{h.current=!1,g.current=m;for(let C=0;C{const E=z0(C),T=a&&!u?!1:m===b||p.includes(E),k=()=>{if(y.has(E))y.set(E,!0);else return;let I=!0;y.forEach(M=>{M||(I=!1)}),I&&(S?.(),_(g.current),a&&f?.(),r&&r())};return l.jsx(iTe,{isPresent:T,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:T?void 0:k,anchorX:i,children:C},E)})})},cTe=d.createContext(null);function uTe(){const e=d.useRef(!1);return cv(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function dTe(){const e=uTe(),[t,n]=d.useState(0),r=d.useCallback(()=>{e.current&&n(t+1)},[t]);return[d.useCallback(()=>Pn.postRender(r),[r]),t]}const fTe=e=>!e.isLayoutDirty&&e.willUpdate(!1);function tD(){const e=new Set,t=new WeakMap,n=()=>e.forEach(fTe);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const s=t.get(r);s&&(s(),t.delete(r)),n()},dirty:n}}const Uq=e=>e===!0,mTe=e=>Uq(e===!0)||e==="id",yg=({children:e,id:t,inherit:n=!0})=>{const r=d.useContext(sh),s=d.useContext(cTe),[o,a]=dTe(),i=d.useRef(null),c=r.id||s;i.current===null&&(mTe(n)&&c&&(t=t?c+"-"+t:c),i.current={id:t,group:Uq(n)&&r.group||tD()});const u=d.useMemo(()=>({...i.current,forceRender:o}),[a]);return l.jsx(sh.Provider,{value:u,children:e})},Vq=d.createContext({strict:!1}),nD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Yd={};for(const e in nD)Yd[e]={isEnabled:t=>nD[e].some(n=>!!t[n])};function pTe(e){for(const t in e)Yd[t]={...Yd[t],...e[t]}}const hTe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function d2(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hTe.has(e)}let Hq=e=>!d2(e);function gTe(e){typeof e=="function"&&(Hq=t=>t.startsWith("on")?!d2(t):e(t))}try{gTe(require("@emotion/is-prop-valid").default)}catch{}function yTe(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Hq(s)||n===!0&&d2(s)||!t&&!d2(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const fv=d.createContext({});function mv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function lh(e){return typeof e=="string"||Array.isArray(e)}const YT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],QT=["initial",...YT];function pv(e){return mv(e.animate)||QT.some(t=>lh(e[t]))}function zq(e){return!!(pv(e)||e.variants)}function xTe(e,t){if(pv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||lh(n)?n:void 0,animate:lh(r)?r:void 0}}return e.inherit!==!1?t:{}}function vTe(e){const{initial:t,animate:n}=xTe(e,d.useContext(fv));return d.useMemo(()=>({initial:t,animate:n}),[rD(t),rD(n)])}function rD(e){return Array.isArray(e)?e.join(" "):e}const ch={};function bTe(e){for(const t in e)ch[t]=e[t],jT(t)&&(ch[t].isCSSVariable=!0)}function Wq(e,{layout:t,layoutId:n}){return Bf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ch[e]||e==="opacity")}const _Te={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wTe=Ff.length;function CTe(e,t,n){let r="",s=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}});function Gq(e,t,n){for(const r in t)!Lr(t[r])&&!Wq(r,n)&&(e[r]=t[r])}function STe({transformTemplate:e},t){return d.useMemo(()=>{const n=ZT();return XT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ETe(e,t){const n=e.style||{},r={};return Gq(r,n,e),Object.assign(r,STe(e,t)),r}function kTe(e,t){const n={},r=ETe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const MTe={offset:"stroke-dashoffset",array:"stroke-dasharray"},TTe={offset:"strokeDashoffset",array:"strokeDasharray"};function ATe(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?MTe:TTe;e[o.offset]=bt.transform(-r);const a=bt.transform(t),i=bt.transform(n);e[o.array]=`${a} ${i}`}function $q(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...i},c,u,f){if(XT(e,i,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:p}=e;m.transform&&(p.transform=m.transform,delete m.transform),(p.transform||m.transformOrigin)&&(p.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),p.transform&&(p.transformBox=f?.transformBox??"fill-box",delete m.transformBox),t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),r!==void 0&&(m.scale=r),s!==void 0&&ATe(m,s,o,a,!1)}const qq=()=>({...ZT(),attrs:{}}),Kq=e=>typeof e=="string"&&e.toLowerCase()==="svg";function NTe(e,t,n,r){const s=d.useMemo(()=>{const o=qq();return $q(o,t,Kq(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Gq(o,e.style,e),s.style={...o,...s.style}}return s}const RTe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function JT(e){return typeof e!="string"||e.includes("-")?!1:!!(RTe.indexOf(e)>-1||/[A-Z]/u.test(e))}function DTe(e,t,n,{latestValues:r},s,o=!1){const i=(JT(e)?NTe:kTe)(t,r,s,e),c=yTe(t,typeof e=="string",o),u=e!==d.Fragment?{...c,...i,ref:n}:{},{children:f}=t,m=d.useMemo(()=>Lr(f)?f.get():f,[f]);return d.createElement(e,{...u,children:m})}function sD(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function eA(e,t,n,r){if(typeof t=="function"){const[s,o]=sD(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=sD(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function uy(e){return Lr(e)?e.get():e}function jTe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:ITe(n,r,s,e),renderState:t()}}function ITe(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=uy(o[p]);let{initial:a,animate:i}=e;const c=pv(e),u=zq(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),i===void 0&&(i=t.animate));let f=n?n.initial===!1:!1;f=f||a===!1;const m=f?i:a;if(m&&typeof m!="boolean"&&!mv(m)){const p=Array.isArray(m)?m:[m];for(let h=0;h(t,n)=>{const r=d.useContext(fv),s=d.useContext(uv),o=()=>jTe(e,t,r,s);return n?o():mg(o)};function tA(e,t,n){const{style:r}=e,s={};for(const o in r)(Lr(r[o])||t.style&&Lr(t.style[o])||Wq(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(s[o]=r[o]);return s}const PTe=Yq({scrapeMotionValuesFromProps:tA,createRenderState:ZT});function Qq(e,t,n){const r=tA(e,t,n);for(const s in e)if(Lr(e[s])||Lr(t[s])){const o=Ff.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}const OTe=Yq({scrapeMotionValuesFromProps:Qq,createRenderState:qq}),LTe=Symbol.for("motionComponentSymbol");function id(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function FTe(e,t,n){return d.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):id(n)&&(n.current=r))},[t])}const nA=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),BTe="framerAppearId",Xq="data-"+nA(BTe),Zq=d.createContext({});function UTe(e,t,n,r,s){const{visualElement:o}=d.useContext(fv),a=d.useContext(Vq),i=d.useContext(uv),c=d.useContext(dv).reducedMotion,u=d.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:i,blockInitialAnimation:i?i.initial===!1:!1,reducedMotionConfig:c}));const f=u.current,m=d.useContext(Zq);f&&!f.projection&&s&&(f.type==="html"||f.type==="svg")&&VTe(u.current,n,s,m);const p=d.useRef(!1);d.useInsertionEffect(()=>{f&&p.current&&f.update(n,i)});const h=n[Xq],g=d.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return cv(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),d.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),f.enteringChildren=void 0)}),f}function VTe(e,t,n,r){const{layoutId:s,layout:o,drag:a,dragConstraints:i,layoutScroll:c,layoutRoot:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jq(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!a||i&&id(i),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u})}function Jq(e){if(e)return e.options.allowProjection!==!1?e.projection:Jq(e.parent)}function Y_(e,{forwardMotionProps:t=!1}={},n,r){n&&pTe(n);const s=JT(e)?OTe:PTe;function o(i,c){let u;const f={...d.useContext(dv),...i,layoutId:HTe(i)},{isStatic:m}=f,p=vTe(i),h=s(i,m);if(!m&&kT){zTe();const g=WTe(f);u=g.MeasureLayout,p.visualElement=UTe(e,h,f,r,g.ProjectionNode)}return l.jsxs(fv.Provider,{value:p,children:[u&&p.visualElement?l.jsx(u,{visualElement:p.visualElement,...f}):null,DTe(e,i,FTe(h,p.visualElement,c),h,m,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=d.forwardRef(o);return a[LTe]=e,a}function HTe({layoutId:e}){const t=d.useContext(sh).id;return t&&e!==void 0?t+"-"+e:e}function zTe(e,t){d.useContext(Vq).strict}function WTe(e){const{drag:t,layout:n}=Yd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function GTe(e,t){if(typeof Proxy>"u")return Y_;const n=new Map,r=(o,a)=>Y_(o,a,e,t),s=(o,a)=>r(o,a);return new Proxy(s,{get:(o,a)=>a==="create"?r:(n.has(a)||n.set(a,Y_(a,void 0,e,t)),n.get(a))})}function eK({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $Te({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qTe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Q_(e){return e===void 0||e===1}function $3({scale:e,scaleX:t,scaleY:n}){return!Q_(e)||!Q_(t)||!Q_(n)}function xc(e){return $3(e)||tK(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tK(e){return oD(e.x)||oD(e.y)}function oD(e){return e&&e!=="0%"}function f2(e,t,n){const r=e-n,s=t*r;return n+s}function aD(e,t,n,r,s){return s!==void 0&&(e=f2(e,s,r)),f2(e,n,r)+t}function q3(e,t=0,n=1,r,s){e.min=aD(e.min,t,n,r,s),e.max=aD(e.max,t,n,r,s)}function nK(e,{x:t,y:n}){q3(e.x,t.translate,t.scale,t.originPoint),q3(e.y,n.translate,n.scale,n.originPoint)}const iD=.999999999999,lD=1.0000000000001;function KTe(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,a;for(let i=0;iiD&&(t.x=1),t.yiD&&(t.y=1)}function ld(e,t){e.min=e.min+t,e.max=e.max+t}function cD(e,t,n,r,s=.5){const o=Yn(e.min,e.max,s);q3(e,t,n,o,r)}function cd(e,t){cD(e.x,t.x,t.scaleX,t.scale,t.originX),cD(e.y,t.y,t.scaleY,t.scale,t.originY)}function rK(e,t){return eK(qTe(e.getBoundingClientRect(),t))}function YTe(e,t,n){const r=rK(e,n),{scroll:s}=t;return s&&(ld(r.x,s.offset.x),ld(r.y,s.offset.y)),r}const uD=()=>({translate:0,scale:1,origin:0,originPoint:0}),ud=()=>({x:uD(),y:uD()}),dD=()=>({min:0,max:0}),or=()=>({x:dD(),y:dD()}),m2={current:null},rA={current:!1};function sK(){if(rA.current=!0,!!kT)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>m2.current=e.matches;e.addEventListener("change",t),t()}else m2.current=!1}const uh=new WeakMap;function QTe(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Lr(s))e.addValue(r,s);else if(Lr(o))e.addValue(r,Qc(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Qc(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const fD=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class oK{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=HT,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Os.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),rA.current||sK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:m2.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Bf.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Pn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Yd){const n=Yd[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):or()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Qc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(W$(r)||$$(r))?r=parseFloat(r):!sTe(r)&&Ll.test(n)&&(r=Rq(t,n)),this.setBaseTarget(t,Lr(r)?r.get():r)),Lr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=eA(this.props,n,this.presenceContext?.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Lr(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new NT),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){$T.render(this.render)}}class aK extends oK{constructor(){super(...arguments),this.KeyframeResolver=q4e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Lr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function iK(e,{style:t,vars:n},r,s){const o=e.style;let a;for(a in t)o[a]=t[a];s?.applyProjectionStyles(o,r);for(a in n)o.setProperty(a,n[a])}function XTe(e){return window.getComputedStyle(e)}class lK extends aK{constructor(){super(...arguments),this.type="html",this.renderInstance=iK}readValueFromInstance(t,n){if(Bf.has(n))return this.projection?.isProjecting?B3(n):u4e(t,n);{const r=XTe(t),s=(jT(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rK(t,n)}build(t,n,r){XT(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return tA(t,n,r)}}const cK=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ZTe(e,t,n,r){iK(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(cK.has(s)?s:nA(s),t.attrs[s])}class uK extends aK{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=or}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Bf.has(n)){const r=Nq(n);return r&&r.default||0}return n=cK.has(n)?n:nA(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Qq(t,n,r)}build(t,n,r){$q(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){ZTe(t,n,r,s)}mount(t){this.isSVGTag=Kq(t.tagName),super.mount(t)}}const JTe=(e,t)=>JT(e)?new uK(t):new lK(t,{allowProjection:e!==d.Fragment});function Sd(e,t,n){const r=e.getProps();return eA(r,t,n!==void 0?n:r.custom,e)}const K3=e=>Array.isArray(e);function eAe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qc(n))}function tAe(e){return K3(e)?e[e.length-1]||0:e}function nAe(e,t){const n=Sd(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const a in o){const i=tAe(o[a]);eAe(e,a,i)}}function rAe(e){return!!(Lr(e)&&e.add)}function Y3(e,t){const n=e.getValue("willChange");if(rAe(n))return n.add(t);if(!n&&$i.WillChange){const r=new $i.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function dK(e){return e.props[Xq]}const sAe=e=>e!==null;function oAe(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(sAe),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const aAe={type:"spring",stiffness:500,damping:25,restSpeed:10},iAe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lAe={type:"keyframes",duration:.8},cAe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uAe=(e,{keyframes:t})=>t.length>2?lAe:Bf.has(e)?e.startsWith("scale")?iAe(t[1]):aAe:cAe;function dAe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:a,repeatDelay:i,from:c,elapsed:u,...f}){return!!Object.keys(f).length}const sA=(e,t,n,r={},s,o)=>a=>{const i=WT(r,e)||{},c=i.delay||r.delay||0;let{elapsed:u=0}=r;u=u-da(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{a(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:o?void 0:s};dAe(i)||Object.assign(f,uAe(e,f)),f.duration&&(f.duration=da(f.duration)),f.repeatDelay&&(f.repeatDelay=da(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let m=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(W3(f),f.delay===0&&(m=!0)),($i.instantAnimations||$i.skipAnimations)&&(m=!0,W3(f),f.delay=0),f.allowFlatten=!i.type&&!i.ease,m&&!o&&t.get()!==void 0){const p=oAe(f.keyframes,i);if(p!==void 0){Pn.update(()=>{f.onUpdate(p),f.onComplete()});return}}return i.isSync?new VT(f):new j4e(f)};function fAe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oA(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...i}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in i){const m=e.getValue(f,e.latestValues[f]??null),p=i[f];if(p===void 0||u&&fAe(u,f))continue;const h={delay:n,...WT(o||{},f)},g=m.get();if(g!==void 0&&!m.isAnimating&&!Array.isArray(p)&&p===g&&!h.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const v=dK(e);if(v){const b=window.MotionHandoffAnimation(v,f,Pn);b!==null&&(h.startTime=b,y=!0)}}Y3(e,f),m.start(sA(f,m,p,e.shouldReduceMotion&&Mq.has(f)?{type:!1}:h,e,y));const x=m.animation;x&&c.push(x)}return a&&Promise.all(c).then(()=>{Pn.update(()=>{a&&nAe(e,a)})}),c}function fK(e,t,n,r=0,s=1){const o=Array.from(e).sort((u,f)=>u.sortNodePosition(f)).indexOf(t),a=e.size,i=(a-1)*r;return typeof n=="function"?n(o,a):s===1?o*r:i-o*r}function Q3(e,t,n={}){const r=Sd(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(oA(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:m}=s;return mAe(e,t,c,u,f,m,n)}:()=>Promise.resolve(),{when:i}=s;if(i){const[c,u]=i==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function mAe(e,t,n=0,r=0,s=0,o=1,a){const i=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),i.push(Q3(c,t,{...a,delay:n+(typeof r=="function"?0:r)+fK(e.variantChildren,c,r,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(i)}function pAe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Q3(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Q3(e,t,n);else{const s=typeof t=="function"?Sd(e,t,n.custom):t;r=Promise.all(oA(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function mK(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:n,options:r})=>pAe(e,n,r)))}function vAe(e){let t=xAe(e),n=mD(),r=!0;const s=c=>(u,f)=>{const m=Sd(e,f,c==="exit"?e.presenceContext?.custom:void 0);if(m){const{transition:p,transitionEnd:h,...g}=m;u={...u,...g,...h}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=pK(e.parent)||{},m=[],p=new Set;let h={},g=1/0;for(let x=0;xg&&w,k=!1;const I=Array.isArray(_)?_:[_];let M=I.reduce(s(v),{});S===!1&&(M={});const{prevResolvedValues:N={}}=b,D={...N,...M},j=P=>{T=!0,p.has(P)&&(k=!0,p.delete(P)),b.needsAnimating[P]=!0;const L=e.getValue(P);L&&(L.liveStyle=!1)};for(const P in D){const L=M[P],U=N[P];if(h.hasOwnProperty(P))continue;let O=!1;K3(L)&&K3(U)?O=!mK(L,U):O=L!==U,O?L!=null?j(P):p.add(P):L!==void 0&&p.has(P)?j(P):b.protectedKeys[P]=!0}b.prevProp=_,b.prevResolvedValues=M,b.isActive&&(h={...h,...M}),r&&e.blockInitialAnimation&&(T=!1);const F=C&&E;T&&(!F||k)&&m.push(...I.map(P=>{const L={type:v};if(typeof P=="string"&&r&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,O=Sd(U,P);if(U.enteringChildren&&O){const{delayChildren:$}=O.transition||{};L.delay=fK(U.enteringChildren,e,$)}}return{animation:P,options:L}}))}if(p.size){const x={};if(typeof u.initial!="boolean"){const v=Sd(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(x.transition=v.transition)}p.forEach(v=>{const b=e.getBaseTarget(v),_=e.getValue(v);_&&(_.liveStyle=!0),x[v]=b??null}),m.push({animation:x})}let y=!!m.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(m):Promise.resolve()}function i(c,u){if(n[c].isActive===u)return Promise.resolve();e.variantChildren?.forEach(m=>m.animationState?.setActive(c,u)),n[c].isActive=u;const f=a(c);for(const m in n)n[m].protectedKeys={};return f}return{animateChanges:a,setActive:i,setAnimateFunction:o,getState:()=>n,reset:()=>{n=mD(),r=!0}}}function bAe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!mK(t,e):!1}function fc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mD(){return{animate:fc(!0),whileInView:fc(),whileHover:fc(),whileTap:fc(),whileDrag:fc(),whileFocus:fc(),exit:fc()}}class tc{constructor(t){this.isMounted=!1,this.node=t}update(){}}class _Ae extends tc{constructor(t){super(t),t.animationState||(t.animationState=vAe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();mv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let wAe=0;class CAe extends tc{constructor(){super(...arguments),this.id=wAe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const SAe={animation:{Feature:_Ae},exit:{Feature:CAe}};function dh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function xg(e){return{point:{x:e.pageX,y:e.pageY}}}const EAe=e=>t=>qT(t)&&e(t,xg(t));function _p(e,t,n,r){return dh(e,t,EAe(n),r)}const hK=1e-4,kAe=1-hK,MAe=1+hK,gK=.01,TAe=0-gK,AAe=0+gK;function bs(e){return e.max-e.min}function NAe(e,t,n){return Math.abs(e-t)<=n}function pD(e,t,n,r=.5){e.origin=r,e.originPoint=Yn(t.min,t.max,e.origin),e.scale=bs(n)/bs(t),e.translate=Yn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=kAe&&e.scale<=MAe||isNaN(e.scale))&&(e.scale=1),(e.translate>=TAe&&e.translate<=AAe||isNaN(e.translate))&&(e.translate=0)}function wp(e,t,n,r){pD(e.x,t.x,n.x,r?r.originX:void 0),pD(e.y,t.y,n.y,r?r.originY:void 0)}function hD(e,t,n){e.min=n.min+t.min,e.max=e.min+bs(t)}function RAe(e,t,n){hD(e.x,t.x,n.x),hD(e.y,t.y,n.y)}function gD(e,t,n){e.min=t.min-n.min,e.max=e.min+bs(t)}function Cp(e,t,n){gD(e.x,t.x,n.x),gD(e.y,t.y,n.y)}function xo(e){return[e("x"),e("y")]}const yK=({current:e})=>e?e.ownerDocument.defaultView:null,yD=(e,t)=>Math.abs(e-t);function DAe(e,t){const n=yD(e.x,t.x),r=yD(e.y,t.y);return Math.sqrt(n**2+r**2)}class xK{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Z_(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=DAe(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:y}=p,{timestamp:x}=$r;this.history.push({...y,timestamp:x});const{onStart:v,onMove:b}=this.handlers;h||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,p)},this.handlePointerMove=(p,h)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=X_(h,this.transformPagePoint),Pn.update(this.updatePoint,!0)},this.handlePointerUp=(p,h)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Z_(p.type==="pointercancel"?this.lastMoveEventInfo:X_(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),y&&y(p,v)},!qT(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const i=xg(t),c=X_(i,this.transformPagePoint),{point:u}=c,{timestamp:f}=$r;this.history=[{...u,timestamp:f}];const{onSessionStart:m}=n;m&&m(t,Z_(c,this.history)),this.removeListeners=hg(_p(this.contextWindow,"pointermove",this.handlePointerMove),_p(this.contextWindow,"pointerup",this.handlePointerUp),_p(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function X_(e,t){return t?{point:t(e.point)}:e}function xD(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Z_({point:e},t){return{point:e,delta:xD(e,vK(t)),offset:xD(e,jAe(t)),velocity:IAe(t,.1)}}function jAe(e){return e[0]}function vK(e){return e[e.length-1]}function IAe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=vK(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>da(t)));)n--;if(!r)return{x:0,y:0};const o=$a(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function PAe(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Yn(n,e,r.max):Math.min(e,n)),e}function vD(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function OAe(e,{top:t,left:n,bottom:r,right:s}){return{x:vD(e.x,n,s),y:vD(e.y,t,r)}}function bD(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=qd(t.min,t.max-r,e.min):r>s&&(n=qd(e.min,e.max-s,t.min)),Gi(0,1,n)}function BAe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const X3=.35;function UAe(e=X3){return e===!1?e=0:e===!0&&(e=X3),{x:_D(e,"left","right"),y:_D(e,"top","bottom")}}function _D(e,t,n){return{min:wD(e,t),max:wD(e,n)}}function wD(e,t){return typeof e=="number"?e:e[t]||0}const VAe=new WeakMap;class HAe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=or(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=m=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(xg(m).point)},a=(m,p)=>{const{drag:h,dragPropagation:g,onDragStart:y}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Q4e(h),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xo(v=>{let b=this.getAxisMotionValue(v).get()||0;if(Ka.test(b)){const{projection:_}=this.visualElement;if(_&&_.layout){const w=_.layout.layoutBox[v];w&&(b=bs(w)*(parseFloat(b)/100))}}this.originPoint[v]=b}),y&&Pn.postRender(()=>y(m,p)),Y3(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},i=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:y,onDrag:x}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=p;if(g&&this.currentDirection===null){this.currentDirection=zAe(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),x&&x(m,p)},c=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p,this.stop(m,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>xo(m=>this.getAnimationState(m)==="paused"&&this.getAxisMotionValue(m).animation?.play()),{dragSnapToOrigin:f}=this.getProps();this.panSession=new xK(t,{onSessionStart:o,onStart:a,onMove:i,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:yK(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&Pn.postRender(()=>i(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!W0(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=PAe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&id(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=OAe(r.layoutBox,t):this.constraints=!1,this.elastic=UAe(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&xo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=BAe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!id(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=YTe(r,s.root,this.visualElement.getTransformPagePoint());let a=LAe(s.layout.layoutBox,o);if(n){const i=n($Te(a));this.hasMutatedConstraints=!!i,i&&(a=eK(i))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),c=this.constraints||{},u=xo(f=>{if(!W0(f,n,this.currentDirection))return;let m=c&&c[f]||{};a&&(m={min:0,max:0});const p=s?200:1e6,h=s?40:1e7,g={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(f,g)});return Promise.all(u).then(i)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Y3(this.visualElement,t),r.start(sA(t,r,0,n,this.visualElement,!1))}stopAnimation(){xo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){xo(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){xo(n=>{const{drag:r}=this.getProps();if(!W0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:i}=s.layout.layoutBox[n];o.set(t[n]-Yn(a,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!id(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};xo(a=>{const i=this.getAxisMotionValue(a);if(i&&this.constraints!==!1){const c=i.get();s[a]=FAe({min:c,max:c},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),xo(a=>{if(!W0(a,t,null))return;const i=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];i.set(Yn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;VAe.set(this.visualElement,this);const t=this.visualElement.current,n=_p(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();id(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Pn.read(r);const a=dh(window,"resize",()=>this.scalePositionWithinConstraints()),i=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(xo(f=>{const m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=c[f].translate,m.set(m.get()+c[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:a=X3,dragMomentum:i=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function W0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zAe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class WAe extends tc{constructor(t){super(t),this.removeGroupControls=To,this.removeListeners=To,this.controls=new HAe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||To}unmount(){this.removeGroupControls(),this.removeListeners()}}const CD=e=>(t,n)=>{e&&Pn.postRender(()=>e(t,n))};class GAe extends tc{constructor(){super(...arguments),this.removePointerDownListener=To}onPointerDown(t){this.session=new xK(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yK(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:CD(t),onStart:CD(n),onMove:r,onEnd:(o,a)=>{delete this.session,s&&Pn.postRender(()=>s(o,a))}}}mount(){this.removePointerDownListener=_p(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const dy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function SD(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Em={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(bt.test(e))e=parseFloat(e);else return e;const n=SD(e,t.target.x),r=SD(e,t.target.y);return`${n}% ${r}%`}},$Ae={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ll.parse(e);if(s.length>5)return r;const o=Ll.createTransformer(e),a=typeof s[0]!="number"?1:0,i=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=i,s[1+a]/=c;const u=Yn(i,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),o(s)}};let J_=!1;class qAe extends d.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;bTe(KAe),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),J_&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),dy.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:a}=r;return a&&(a.isPresent=o,J_=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Pn.postRender(()=>{const i=a.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$T.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;J_=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bK(e){const[t,n]=Bq(),r=d.useContext(sh);return l.jsx(qAe,{...e,layoutGroup:r,switchLayoutGroup:d.useContext(Zq),isPresent:t,safeToRemove:n})}const KAe={borderRadius:{...Em,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Em,borderTopRightRadius:Em,borderBottomLeftRadius:Em,borderBottomRightRadius:Em,boxShadow:$Ae};function _K(e,t,n){const r=Lr(e)?e:Qc(e);return r.start(sA("",r,t,n)),r.animation}const YAe=(e,t)=>e.depth-t.depth;class QAe{constructor(){this.children=[],this.isDirty=!1}add(t){MT(this.children,t),this.isDirty=!0}remove(t){pg(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(YAe),this.isDirty=!1,this.children.forEach(t)}}function XAe(e,t){const n=Os.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(qi(r),e(o-t))};return Pn.setup(r,!0),()=>qi(r)}const wK=["TopLeft","TopRight","BottomLeft","BottomRight"],ZAe=wK.length,ED=e=>typeof e=="string"?parseFloat(e):e,kD=e=>typeof e=="number"||bt.test(e);function JAe(e,t,n,r,s,o){s?(e.opacity=Yn(0,n.opacity??1,e6e(r)),e.opacityExit=Yn(t.opacity??1,0,t6e(r))):o&&(e.opacity=Yn(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(qd(e,t,r))}function TD(e,t){e.min=t.min,e.max=t.max}function yo(e,t){TD(e.x,t.x),TD(e.y,t.y)}function AD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ND(e,t,n,r,s){return e-=t,e=f2(e,1/n,r),s!==void 0&&(e=f2(e,1/s,r)),e}function n6e(e,t=0,n=1,r=.5,s,o=e,a=e){if(Ka.test(t)&&(t=parseFloat(t),t=Yn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let i=Yn(o.min,o.max,r);e===o&&(i-=t),e.min=ND(e.min,t,n,i,s),e.max=ND(e.max,t,n,i,s)}function RD(e,t,[n,r,s],o,a){n6e(e,t[n],t[r],t[s],t.scale,o,a)}const r6e=["x","scaleX","originX"],s6e=["y","scaleY","originY"];function DD(e,t,n,r){RD(e.x,t,r6e,n?n.x:void 0,r?r.x:void 0),RD(e.y,t,s6e,n?n.y:void 0,r?r.y:void 0)}function jD(e){return e.translate===0&&e.scale===1}function SK(e){return jD(e.x)&&jD(e.y)}function ID(e,t){return e.min===t.min&&e.max===t.max}function o6e(e,t){return ID(e.x,t.x)&&ID(e.y,t.y)}function PD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function EK(e,t){return PD(e.x,t.x)&&PD(e.y,t.y)}function OD(e){return bs(e.x)/bs(e.y)}function LD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class a6e{constructor(){this.members=[]}add(t){MT(this.members,t),t.scheduleRender()}remove(t){if(pg(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function i6e(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,a=n?.z||0;if((s||o||a)&&(r=`translate3d(${s}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:f,rotateX:m,rotateY:p,skewX:h,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),f&&(r+=`rotate(${f}deg) `),m&&(r+=`rotateX(${m}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const i=e.x.scale*t.x,c=e.y.scale*t.y;return(i!==1||c!==1)&&(r+=`scale(${i}, ${c})`),r||"none"}const ew=["","X","Y","Z"],l6e=1e3;let c6e=0;function tw(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function kK(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dK(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Pn,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&kK(r)}function MK({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},i=t?.()){this.id=c6e++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(f6e),this.nodes.forEach(g6e),this.nodes.forEach(y6e),this.nodes.forEach(m6e)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;Pn.read(()=>{m=window.innerWidth}),e(a,()=>{const h=window.innerWidth;h!==m&&(m=h,this.root.updateBlockedByResize=!0,f&&f(),f=XAe(p,250),dy.hasAnimatedSinceResize&&(dy.hasAnimatedSinceResize=!1,this.nodes.forEach(UD)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&u&&(i||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||w6e,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!EK(this.targetLayout,h),b=!m&&p;if(this.options.layoutRoot||this.resumeFrom||b||m&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...WT(g,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(f,b)}else m||UD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(x6e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&kK(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!bs(this.snapshot.measuredBox.x)&&!bs(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=w/1e3;VD(m.x,a.x,S),VD(m.y,a.y,S),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cp(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b6e(this.relativeTarget,this.relativeTargetOrigin,p,S),_&&o6e(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=or()),yo(_,this.relativeTarget)),y&&(this.animationValues=f,JAe(f,u,this.latestValues,S,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pn.update(()=>{dy.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Qc(0)),this.currentAnimation=_K(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:i=>{this.mixTargetDelta(i),a.onUpdate&&a.onUpdate(i)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(l6e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:i,target:c,layout:u,latestValues:f}=a;if(!(!i||!c||!u)){if(this!==a&&this.layout&&u&&TK(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||or();const m=bs(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+m;const p=bs(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}yo(i,c),cd(i,f),wp(this.projectionDeltaWithTransform,this.layoutCorrected,i,f)}}registerSharedNode(a,i){this.sharedNodes.has(a)||this.sharedNodes.set(a,new a6e),this.sharedNodes.get(a).add(i);const u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:i,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let i=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(i=!0),!i)return;const u={};c.z&&tw("z",a,u,this.animationValues);for(let f=0;fa.currentAnimation?.stop()),this.root.nodes.forEach(FD),this.root.sharedNodes.clear()}}}function u6e(e){e.updateLayout()}function d6e(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?xo(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],p=bs(m);m.min=n[f].min,m.max=m.min+p}):TK(s,t.layoutBox,n)&&xo(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],p=bs(n[f]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=ud();wp(a,n,t.layoutBox);const i=ud();o?wp(i,e.applyTransform(r,!0),t.measuredBox):wp(i,n,t.layoutBox);const c=!SK(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:p}=f;if(m&&p){const h=or();Cp(h,t.layoutBox,m.layoutBox);const g=or();Cp(g,n,p.layoutBox),EK(h,g)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:i,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function f6e(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function m6e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function p6e(e){e.clearSnapshot()}function FD(e){e.clearMeasurements()}function BD(e){e.isLayoutDirty=!1}function h6e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function UD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function g6e(e){e.resolveTargetDelta()}function y6e(e){e.calcProjection()}function x6e(e){e.resetSkewAndRotation()}function v6e(e){e.removeLeadSnapshot()}function VD(e,t,n){e.translate=Yn(t.translate,0,n),e.scale=Yn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function HD(e,t,n,r){e.min=Yn(t.min,n.min,r),e.max=Yn(t.max,n.max,r)}function b6e(e,t,n,r){HD(e.x,t.x,n.x,r),HD(e.y,t.y,n.y,r)}function _6e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const w6e={duration:.45,ease:[.4,0,.1,1]},zD=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),WD=zD("applewebkit/")&&!zD("chrome/")?Math.round:To;function GD(e){e.min=WD(e.min),e.max=WD(e.max)}function C6e(e){GD(e.x),GD(e.y)}function TK(e,t,n){return e==="position"||e==="preserve-aspect"&&!NAe(OD(t),OD(n),.2)}function S6e(e){return e!==e.root&&e.scroll?.wasRoot}const E6e=MK({attachResizeListener:(e,t)=>dh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),nw={current:void 0},AK=MK({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nw.current){const e=new E6e({});e.mount(window),e.setOptions({layoutScroll:!0}),nw.current=e}return nw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),k6e={pan:{Feature:GAe},drag:{Feature:WAe,ProjectionNode:AK,MeasureLayout:bK}};function $D(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Pn.postRender(()=>o(t,xg(t)))}class M6e extends tc{mount(){const{current:t}=this.node;t&&(this.unmount=X4e(t,(n,r)=>($D(this.node,r,"Start"),s=>$D(this.node,s,"End"))))}unmount(){}}class T6e extends tc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=hg(dh(this.node.current,"focus",()=>this.onFocus()),dh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function qD(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Pn.postRender(()=>o(t,xg(t)))}class A6e extends tc{mount(){const{current:t}=this.node;t&&(this.unmount=tTe(t,(n,r)=>(qD(this.node,r,"Start"),(s,{success:o})=>qD(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Z3=new WeakMap,rw=new WeakMap,N6e=e=>{const t=Z3.get(e.target);t&&t(e)},R6e=e=>{e.forEach(N6e)};function D6e({root:e,...t}){const n=e||document;rw.has(n)||rw.set(n,{});const r=rw.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(R6e,{root:e,...t})),r[s]}function j6e(e,t,n){const r=D6e(t);return Z3.set(e,n),r.observe(e),()=>{Z3.delete(e),r.unobserve(e)}}const I6e={some:0,all:1};class P6e extends tc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:I6e[s]},i=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),p=u?f:m;p&&p(c)};return j6e(this.node.current,a,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(O6e(t,n))&&this.startObserver()}unmount(){}}function O6e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const L6e={inView:{Feature:P6e},tap:{Feature:A6e},focus:{Feature:T6e},hover:{Feature:M6e}},F6e={layout:{ProjectionNode:AK,MeasureLayout:bK}},B6e={...SAe,...L6e,...k6e,...F6e},Te=GTe(B6e,JTe);function aA(e){const t=mg(()=>Qc(e)),{isStatic:n}=d.useContext(dv);if(n){const[,r]=d.useState(e);d.useEffect(()=>t.on("change",r),[])}return t}function NK(e,t){const n=aA(t()),r=()=>n.set(t());return r(),cv(()=>{const s=()=>Pn.preRender(r,!1,!0),o=e.map(a=>a.on("change",s));return()=>{o.forEach(a=>a()),qi(r)}}),n}function U6e(e){bp.current=[],e();const t=NK(bp.current,e);return bp.current=void 0,t}function tp(e,t,n,r){if(typeof e=="function")return U6e(e);const s=typeof t=="function"?t:nTe(t,n,r);return Array.isArray(e)?KD(e,s):KD([e],([o])=>s(o))}function KD(e,t){const n=mg(()=>[]);return NK(e,()=>{n.length=0;const r=e.length;for(let s=0;st&&s.at{const k=K6e(w),{delay:I=0,times:M=vq(k),type:N="keyframes",repeat:D,repeatType:j,repeatDelay:F=0,...R}=S;let{ease:P=t.ease||"easeOut",duration:L}=S;const U=typeof I=="function"?I(E,T):I,O=k.length,$=zT(N)?N:s?.[N||"keyframes"];if(O<=2&&$){let Y=100;if(O===2&&X6e(k)){const ae=k[1]-k[0];Y=Math.abs(ae)}const te={...R};L!==void 0&&(te.duration=da(L));const se=hq(te,Y,$);P=se.ease,L=se.duration}L??(L=o);const G=m+U;M.length===1&&M[0]===0&&(M[1]=1);const H=M.length-k.length;if(H>0&&xq(M,H),k.length===1&&k.unshift(null),D){L=V6e(L,D);const Y=[...k],te=[...M];P=Array.isArray(P)?[...P]:[P];const se=[...P];for(let ae=0;ae{for(const y in h){const x=h[y];x.sort(G6e);const v=[],b=[],_=[];for(let S=0;Stypeof e=="number",X6e=e=>e.every(Q6e);function Z6e(e,t){return e in t}class J6e extends oK{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Z6e(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return or()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function eNe(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=KT(e)&&!Fq(e)?new uK(t):new lK(t);n.mount(e),uh.set(e,n)}function tNe(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new J6e(t);n.mount(e),uh.set(e,n)}function nNe(e,t){return Lr(e)||typeof e=="number"||typeof e=="string"&&!lA(t)}function DK(e,t,n,r){const s=[];if(nNe(e,t))s.push(_K(e,lA(t)&&t.default||t,n&&(n.default||n)));else{const o=RK(e,t,r),a=o.length;for(let i=0;i{r.push(...DK(i,o,a))}),r}function sNe(e){return Array.isArray(e)&&e.some(Array.isArray)}function oNe(e){function t(n,r,s){let o=[];sNe(n)?o=rNe(n,r,e):o=DK(n,r,s,e);const a=new P4e(o);return e&&(e.animations.push(a),a.finished.then(()=>{pg(e.animations,a)})),a}return t}const aNe=oNe();function jK(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const iNe=({children:e,className:t,delimiter:n="·",...r})=>{const s=A.Children.toArray(e),o=s.map((a,i)=>{if(A.isValidElement(a)&&a.type===IK){const c=a.props.id;return l.jsxs(A.Fragment,{children:[a,i!==s.length-1&&l.jsxs(V,{className:"inline-flex !text-inherit",children:[" ",n," "]})]},c)}return null});return l.jsx("div",{className:`gap-sm flex items-center ${t}`,...r,children:o})},IK=({children:e})=>l.jsx(l.Fragment,{children:e}),ga=iNe,Bn=IK,PK=A.memo(({onClick:e,testId:t="close-button",size:n="small",variant:r="common",className:s="right-sm top-sm absolute",ariaLabel:o="Close"})=>l.jsx("div",{className:s,children:l.jsx(st,{testId:t,variant:r,pill:!0,size:n,onClick:e,icon:B("x"),ariaLabel:o})}));PK.displayName="CloseButton";const cA=A.memo(e=>{const{children:t,trigger:n,...r}=e;return l.jsxs(wT,{...r,children:[n&&l.jsx(P$,{asChild:!0,children:n}),l.jsx(St,{children:r.open&&l.jsx(CT,{forceMount:!0,children:t})})]})});cA.displayName="ControlledDialog";function lNe(e){const[t,n]=d.useState(!1),[r,s]=d.useState(!1),o=d.useMemo(()=>e?.isEnabled??!0,[e?.isEnabled]),a=d.useMemo(()=>o&&!t&&!r,[o,t,r]);return d.useMemo(()=>({canShow:a,handleConfirm(){n(!1),s(!0),e?.onConfirm()},handleCancel(){n(!1),s(!1)},isShowing:t,show(){n(!0)}}),[a,t,e])}const OK=Ft("ConfirmCloseModalContext",{canShow:!1,handleCancel(){},handleConfirm(){},isShowing:!1,show(){}}),LK=A.memo(function(t){const{children:n,trigger:r,value:s}=t;return l.jsx(OK.Provider,{value:s,children:l.jsx(cA,{onOpenChange:s.handleCancel,open:s.isShowing,trigger:r,children:n})})});LK.displayName="ConfirmCloseModalDialog";function lbt(){const e=d.useContext(OK);if(!e)throw new Error("useConfirmCloseModalContext() used outside of provider.");return e}const cNe=250,uA=A.memo(({animationClassName:e,children:t,isOpen:n=!1,transparent:r=!1,canOutsideClickClose:s=!0,onBeforeClose:o,onClose:a,onIsClosing:i,childVariant:c="default",center:u=!0,shouldClose:f=!1,disableAnimation:m=!1,testId:p,removeScroll:h=!0,shards:g=[],delayClose:y=!0,variant:x="default",portalTarget:v,includeBlur:b=!0,forceColorScheme:_})=>{const w=d.useRef(null),S=d.useRef(null),C=d.useRef(null),[E,T]=d.useState(!1),k=d.useRef(!1),I=d.useCallback(P=>{E||o?.()===!1||(y?(T(!0),i?.(),setTimeout(()=>{a?.(P),T(!1)},cNe)):(T(!0),a?.(P),T(!1)))},[E,o,y,i,a]);d.useEffect(()=>{f&&!E&&I("closed")},[f,E,I]);const M=d.useCallback(P=>{r&&!s?P.stopPropagation():P.target===w.current&&I("backdrop")},[r,s,I]),N=d.useCallback(P=>{const L=P.target;if(L instanceof Element){if(S.current===L||S.current?.contains(L))return;const U=L.closest('[data-type="portal"]');if(U&&U!==C.current&&!r)return}T(!1),I("clickaway")},[I,r]);d.useEffect(()=>{if(n&&r&&s)return document.addEventListener("click",N),()=>{document.removeEventListener("click",N)}},[n,r,N,s]);const D=d.useCallback(P=>{P.key==="Escape"&&I("escape")},[I]);d.useEffect(()=>(n&&document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}),[n,D]);const j=d.useMemo(()=>z("duration-200 fill-mode-both",{"animate-in fade-in zoom-in-[0.98] ease-in":["default","large","small","hide-chrome","full-sheet"].includes(c),"zoom-out-[0.98] fade-out animate-out ease-out":["default","hide-chrome","full-sheet","large","small"].includes(c)&&E,"fixed bottom-0 left-0":c==="bottom-left-sheet","fixed top-0 right-0 left-0":c==="side-sheet","fixed bottom-0 left-0 right-0":c==="bottom-sheet"},e),[e,c,E]),F=z("items-stretch md:items-center",{"fill-mode-both fixed inset-0":!r,"bg-backdrop/70":x==="default"||x==="default-less-blur","bg-lightbox/95":x==="lightbox","animate-in fade-in ease-outExpo duration-200":!E&&!m,"animate-out fade-out ease-inExpo duration-200":E&&!m},{"backdrop-blur-md":b&&x==="lightbox","backdrop-blur-sm":b&&x==="default","backdrop-blur-[0.5px]":b&&x==="default-less-blur"}),R=d.useMemo(()=>n?l.jsxs(lg,{removeScrollBar:!1,enabled:h,allowPinchZoom:!0,shards:g,children:[l.jsx("div",{className:F}),l.jsx("div",{ref:w,onPointerDown:P=>{k.current=P.target===w.current},onPointerUp:P=>{k.current&&M(P),k.current=!1},className:z({"fixed inset-0 overflow-y-auto":!r,"flex items-center justify-center":u}),"data-test-id":p,children:l.jsx("div",{ref:S,className:j,children:t})})]}):null,[n,t,r,u,p,M,j,S,w,h,g,F]);return l.jsx(Xl,{portalTarget:v,children:l.jsx("div",{ref:C,"data-type":"portal","data-color-scheme":_,children:R})})});uA.displayName="Overlay";const po=A.memo(({title:e,subtitle:t,subtitleClassname:n,centerTitle:r,children:s,actionList:o=Pe,variant:a="default",onClose:i,noPadding:c=!1,onIsClosing:u,titleContent:f,footerContent:m,icon:p,overlayVariant:h,titleLeadingButtonProps:g,confirmOnClose:y,titleTextVariant:x="page-title",headerClassname:v,closeButtonClassname:b="right-0 top-sm absolute",footerClassname:_,renderCloseButton:w=!0,fixedTitle:S,modalClassname:C,modalContentClassname:E,modalElementProps:T,includeBlur:k=!0,isOpen:I,ref:M,wrapperClassname:N,forceColorScheme:D,...j})=>{const F=d.useRef(null),R=d.useRef(null),P=d.useRef(null),L=d.useRef(null),[U,O]=d.useState(!1),[$,G]=d.useState(!1),[H,Q]=d.useState(!1);d.useEffect(()=>{I&&!H?Q(!0):!I&&H&&!U&&O(!0)},[I,H,U]);const Y=d.useMemo(()=>!!y,[y]),te=lNe({isEnabled:Y,onConfirm(){G(!0),O(!0)}}),se=d.useMemo(()=>z(C,"bg-base shadow-md overflow-y-auto scrollbar-subtle fill-mode-both",{"md:rounded-xl md:min-w-[600px] max-w-screen-sm shadow-md dark:border dark:border-subtlest relative h-full max-h-[100vh] md:max-h-[95vh] overflow-auto md:w-full":a==="default","min-h-0 max-h-[70vh] rounded-t-xl bottom-0 left-0 right-0 flex flex-col":a==="bottom-left-sheet","w-screen md:h-screen h-[100dvh] flex flex-col":a==="full-sheet","w-screen min-h-[60dvh] md:min-h-[60vh] shadow-overlay max-h-[96dvh] md:max-h-[96vh] flex flex-col fixed bottom-0 left-0 right-0":a==="bottom-sheet","h-screen w-[40vw] min-w-[500px] shadow-overlay top-0 right-0 fixed flex flex-col":a==="side-sheet","animate-in slide-in-from-right ease-outExpo":a==="side-sheet"&&!$,"animate-out slide-out-to-right ease-inExpo":a==="side-sheet"&&$,"animate-in slide-in-from-bottom ease-in":["bottom-left-sheet","bottom-sheet"].includes(a)&&!$,"animate-out slide-out-to-bottom ease-out":["bottom-left-sheet","bottom-sheet"].includes(a)&&$,"max-h-[100vh] w-[90vw] rounded-l-xl flex flex-col":a==="wide","h-[95vh] w-[95vw] rounded-xl flex flex-col":a==="full","md:rounded-lg md:min-w-[600px] max-w-screen-lg shadow-md relative overflow-auto max-h-[100vh]":a==="large","md:rounded-lg md:min-w-[500px] max-w-screen-lg shadow-md relative overflow-auto max-h-[100vh]":a==="medium","md:rounded-lg md:max-w-[440px] shadow-md relative overflow-auto max-h-[100vh]":a==="small","md:rounded-lg md:max-w-[350px] shadow-md relative overflow-auto max-h-[100vh]":a==="thin"}),[a,$,C]),ae=d.useMemo(()=>a==="bottom-left-sheet"||a==="bottom-sheet",[a]),X=d.useMemo(()=>z("grow flex flex-col justify-center shrink-0",{"md:pt-md":e===void 0&&!f,"md:pb-lg":o?.length===0,"p-sm":!c&&!ae,"p-0":c,"pb-lg":ae},E),[o?.length,c,e,E,f,ae]),ee=d.useMemo(()=>o.map((ye,_e)=>d.createElement(FK,{...ye,idx:_e,key:_e,confirmCloseModal:te})),[o,te]);d.useImperativeHandle(M,()=>({scrollContainerRef:F,headerRef:R,contentRef:P,footerRef:L}),[F,R,L]);const le=d.useCallback(()=>{u?.(),G(!0)},[u]),re=d.useCallback(ye=>{G(!1),O(!1),Q(!1),i?.(ye)},[i]),ce=d.useCallback(()=>{if(te?.canShow){te.show();return}O(!0)},[te]),ue=d.useCallback(()=>te?.canShow?(te.show(),!1):!0,[te]),{canOutsideClickClose:me}=d.useContext(cz),we=d.useMemo(()=>l.jsxs(l.Fragment,{children:[l.jsx("div",{children:a==="hide-chrome"?l.jsx("div",{children:s}):l.jsxs(Te.div,{animate:{scale:te.isShowing?.955:1},className:se,transition:{duration:.2,ease:tl(.16,1,.3,1)},ref:F,...T,children:[l.jsx("div",{className:"right-sm top-sm fixed z-[23] md:absolute"}),l.jsxs(K,{className:z(N,"px-md pb-md flex min-h-0 w-screen grow flex-col md:w-[unset] md:grow-[unset]",{"h-full":!S,"h-auto !grow":S}),children:[l.jsxs(K,{variant:"background",className:z(v,"pt-md sticky top-0 z-[22] w-full shrink-0",{"text-center":r,"h-10":!e&&!f}),ref:R,children:[l.jsxs("div",{className:"p-sm flex items-center gap-1.5",children:[g&&l.jsx(st,{extraCSS:"-ml-sm",...g,size:"small",variant:"common"}),p?l.jsx(ge,{icon:p,className:"text-foreground -ml-xs shrink-0",size:"xl"}):null,e&&l.jsx(V,{variant:x,className:z("text-pretty",{"line-clamp-1 leading-none":p,"line-clamp-3":!p,"pt-lg grow":r,"mr-lg":!r}),children:e}),!e&&f,w&&l.jsx(PK,{onClick:ce,testId:"close-modal",className:b})]}),t&&l.jsx(V,{variant:"base",color:"light",className:z("mt-xs p-sm line-clamp-3 text-pretty",n),children:t})]}),s&&l.jsx("div",{className:X,ref:P,children:s}),(ee?.length>0||m)&&l.jsxs(K,{variant:"background",className:z("gap-x-sm p-sm pt-lg bottom-0 z-10 flex items-center",{"justify-end":!m},{"justify-between":m},{sticky:!0},_),ref:L,children:[m&&l.jsx("div",{className:"flex-1",children:m}),ee]})]})]})}),Y&&l.jsx(LK,{value:te,children:y})]}),[ee,r,s,b,te,y,X,S,_,m,ce,v,p,Y,se,T,w,t,n,e,f,g,x,a,N]);return l.jsx(uA,{forceColorScheme:D,includeBlur:k,childVariant:a,shouldClose:U,onBeforeClose:ue,onIsClosing:le,onClose:re,variant:h,isOpen:H,canOutsideClickClose:me,...j,children:we})});po.displayName="Modal";const FK=A.memo(({idx:e,text:t,onClick:n,variant:r,disabled:s,isLoading:o,testId:a,icon:i,shouldShowConfirmDialog:c,buttonClassname:u,tooltipText:f,confirmCloseModal:m})=>{const p=d.useCallback(y=>{if(y.stopPropagation(),r&&c&&m.canShow){m.show();return}n?.()},[m,n,c,r]),h={key:e,text:t,disabled:s,isLoading:o,testId:a,chevronIcon:i,extraCSS:u},g=d.createElement(Ge,{fullWidthMobile:!0,variant:r||void 0,...h,onClick:p,key:h.key});return f?l.jsx(Io,{tooltipText:f,tooltipLayout:"top",children:g}):g});FK.displayName="ButtonFactory";const cbt=Object.freeze(Object.defineProperty({__proto__:null,default:po},Symbol.toStringTag,{value:"Module"})),uNe=1080,ZD=1e4;function kr(e){return typeof e=="string"?ty(e).startsWith("image/"):e.type.startsWith("image/")}const BK=(e,t=32)=>`https://www.google.com/s2/favicons?sz=${t}&domain=${e}`,dNe=(e,t,n)=>{const r=Math.min(e,t);let s=e,o=t;if(r>n){const i=n/r;s=Math.round(e*i),o=Math.round(t*i)}const a=Math.max(s,o);if(a>ZD){const i=ZD/a;s=Math.max(1,Math.round(s*i)),o=Math.max(1,Math.round(o*i))}return{width:s,height:o}},fNe=(e,t=uNe,n=.98)=>new Promise((r,s)=>{if(!kr(e)){s(new Error("File is not an image."));return}const o=document.createElement("canvas"),a=o.getContext("2d",{alpha:!0,colorSpace:"srgb"}),i=new Image,c=URL.createObjectURL(e);if(!a){s(new Error("Could not get canvas context"));return}a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",i.onload=()=>{const u=dNe(i.width,i.height,t);o.width=u.width,o.height=u.height;const f="image/jpeg",m=n;a.fillStyle="#fff",a.fillRect(0,0,o.width,o.height),a.drawImage(i,0,0,u.width,u.height),o.toBlob(p=>{if(!p){s(new Error("Failed to create blob from canvas"));return}const g=e.name.replace(/\.[^/.]+$/,"")+".jpg",y=new File([p],g,{type:f});URL.revokeObjectURL(c),r(y)},f,m)},i.onerror=()=>{URL.revokeObjectURL(c),s(new Error("Failed to load image."))},i.src=c}),mNe={"my.apps.factset.com":"www.factset.com"},Po=A.memo(({domain:e,overrideIconUrl:t,size:n=16,hideBorder:r=!1,className:s,...o})=>{const a=mNe[e]||e,i=BK(a,128),c=d.useMemo(()=>t||i,[t,i]),[u,f]=d.useState(!0);d.useEffect(()=>{f(!0)},[c]);const m=d.useMemo(()=>({width:n,height:n}),[n]),p=d.useMemo(()=>({width:n*.7,height:n*.7}),[n]);return l.jsxs("div",{style:{width:n,height:n},className:z("relative shrink-0 overflow-hidden rounded-full",s),...o,children:[u?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:z("rounded-inherit absolute inset-0",!r&&"bg-white")}),l.jsx("img",{className:"relative block",src:c,alt:`${e} favicon`,width:n,height:n,onLoad:h=>{const g=h.target,y=t!==void 0||g.naturalWidth!==16||g.naturalHeight!==16;f(y||e!==a)},onError:()=>{f(!1)},style:{width:n,height:n}})]}):l.jsx(K,{variant:"subtle",style:m,className:"inline-flex items-center justify-center",children:l.jsx(ge,{icon:B("world"),className:"text-quietest relative block",style:p})}),!r&&l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-[black]/10 dark:border-transparent"})]})});Po.displayName="CitationFavicon";function pNe(e,t,n=2){if(e==null)return"";const r=e.includes(".")?e.slice(e.lastIndexOf(".")):"",s=e.substring(0,e.length-r.length);return s.length>t?s.substring(0,t-r.length-3)+".".repeat(n)+r:s+r}const mu=e=>{try{return(new URL(e).pathname.split("/").pop()||"").split(".").pop()?.toLowerCase()}catch{return e.split(".").pop()?.toLowerCase()}},UK=e=>e.file.type.includes("image"),hNe=e=>e.file.type==="application/pdf",gNe=e=>e.file.type==="text/csv"||e.file.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",yNe=e=>e.file.type==="text/plain"||e.file.type==="application/msword"||e.file.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e.file.type==="text/markdown",J3={txt:"text/plain",pdf:"application/pdf",jpeg:"image/jpeg",jpg:"image/jpeg",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",md:"text/markdown",png:"image/png",csv:"text/csv"},xNe=e=>{if(e<0)throw new Error("Number of bytes cannot be negative");const t=["B","KB","MB","GB"];let n=0,r=e;for(;r>=1e3&&n!!(mu(e)===vo.PDF||Tf(e)),VK=e=>{const t=mu(e);if(Tf(e))return B("file-type-pdf");switch(t){case vo.TXT:return B("file-text");case vo.MARKDOWN:return B("file-text");case vo.PDF:return B("file-type-pdf");case vo.XLSX:return B("file-spreadsheet");case vo.CSV:return B("file-type-csv");case vo.DOCX:return B("file-type-doc");case vo.PPTX:return B("file-type-ppt");case vo.JPG:case vo.JPEG:case vo.PNG:return B("photo");default:return B("file")}},Uf=e=>e?.file_metadata?.file_source===tV.MEETING_TRANSCRIPT;function dA(e,t){return!1}const vNe={[Zn.GOOGLE_DRIVE]:B("brand-google-drive"),[Zn.ONEDRIVE]:B("brand-onedrive"),[Zn.SHAREPOINT]:B("brand-windows"),[Zn.DROPBOX]:Zme,[Zn.BOX]:Xme,[Zn.GENERATED_IMAGE]:B("photo"),[Zn.GENERATED_VIDEO]:B("slideshow"),[Zn.WILEY]:Qme,[Zn.LOCAL]:B("file")},fA=A.memo(({url:e,mcpServerSource:t,isConversationHistory:n,isMemory:r,isInlineAttachment:s,connectionType:o,isAttachment:a,patentName:i,isClientContext:c,isMeetingTranscript:u})=>{const f=d.useMemo(()=>{const m=$c(e),p=a?VK(e):null,h=t?If(t):null;if(n)return l.jsx(ge,{icon:B("list-search"),size:"xs"});if(i)return l.jsx(qU,{className:"size-3.5"});if(r)return l.jsx(ge,{icon:B("bubble-text"),size:"xs"});if(u)return l.jsx(ge,{icon:B("microphone"),size:"xs"});if(o){const g=vNe[o];return g?l.jsx(ge,{icon:g}):l.jsx(Po,{domain:m,overrideIconUrl:h||void 0})}else return s?l.jsx(ge,{icon:B("paperclip"),size:"xs"}):a?l.jsx(ge,{icon:p||B("file"),size:"xs"}):c?l.jsx(ge,{icon:B("hourglass-high"),size:"xs"}):l.jsx(Po,{domain:m,overrideIconUrl:h||void 0})},[e,a,t,n,i,r,u,o,s,c]);return l.jsx("div",{className:"flex size-4 items-center justify-center",children:f})});fA.displayName="Icon";const mA=A.memo(({url:e,source:t,isAttachment:n,connectionType:r,isConversationHistory:s,patentName:o})=>{const a=J(),i=d.useMemo(()=>{if(s)return a.formatMessage({defaultMessage:"library",id:"B7J+pmy9R5"});if(o)return o;if(t!=null)return t;let c;return n?c=cu(e):r?c=n2(r):c=Ur(e),c.replace(/\.[^.]*$/,"")},[e,t,n,r,s,o,a]);return l.jsx(l.Fragment,{children:i})});mA.displayName="Source";const HK=A.memo(({url:e,source:t,isAttachment:n,isClientContext:r,variant:s="small",color:o="default",truncate:a=!0,className:i,connectionType:c,mcpServerSource:u,isInlineAttachment:f,isMemory:m,patentName:p,isConversationHistory:h,name:g,snippet:y,isMeetingTranscript:x,...v})=>l.jsxs(K,{className:"flex items-center gap-x-1.5 min-w-0",children:[l.jsx(V,{variant:s,className:"relative flex-none",color:m||h?"light":o,children:l.jsx(fA,{url:e,source:t,mcpServerSource:u,isConversationHistory:h,isMemory:m,isInlineAttachment:f,connectionType:c,isAttachment:n,patentName:p,isClientContext:r,isMeetingTranscript:x})}),g&&l.jsx(V,{variant:s,color:o,...v,className:z(i,"min-w-0 truncate"),children:g}),l.jsx(V,{variant:s,color:g?"light":o,className:z("truncate min-w-0 grow break-all leading-none transition-all duration-300",{"max-w-[150px]":t!=null&&a},i),...v,children:l.jsx(mA,{url:e,source:t,isAttachment:n,connectionType:c,isMemory:m,isConversationHistory:h,patentName:p})})]}));HK.displayName="CitationDomainRoot";const ya=Object.assign(HK,{Icon:fA,Source:mA}),pu=A.memo(({isOpen:e,onClose:t,imgProps:n,alt:r,width:s,height:o,origin:a,onDownload:i,footer:c})=>{const{url:u,name:f,showCitation:m=!0}=a||{},p=ui(),h=d.useCallback(g=>{g.stopPropagation(),i?.()},[i]);return l.jsxs(po,{onClose:t,isOpen:e,variant:"hide-chrome",disableAnimation:!1,removeScroll:!p,modalClassname:"z-[100]",children:[l.jsx("div",{className:"flex h-screen w-screen place-content-center",onClick:t,children:l.jsxs("div",{className:z("gap-md p-md md:p-lg flex w-full flex-col",{"md:pb-md":m&&(u||i)}),children:[l.jsx("div",{className:"relative grow",children:l.jsx("div",{className:"absolute inset-0 size-full",children:l.jsx("img",{width:s,height:o,...n,alt:r,className:"size-full object-contain"})})}),m&&(u||i)?l.jsxs("div",{className:"gap-sm flex w-full flex-row justify-center",children:[u&&l.jsx(yt,{href:u,target:"_blank",children:l.jsxs(K,{variant:"subtle",className:"gap-x-xs p-sm flex items-center rounded-full",children:[l.jsx(ya,{url:u,source:f,isAttachment:!1}),l.jsx(V,{variant:"small",className:"pr-xs",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"xs"})})]})}),i&&l.jsx(K,{as:"button",onClick:h,variant:"subtle",className:"gap-x-xs p-sm flex !aspect-square w-9 items-center justify-center rounded-full",children:l.jsx(ge,{icon:B("download"),size:"sm"})})]}):null,c]})}),l.jsx(Ge,{onClick:t,icon:B("x"),extraCSS:"!fixed top-md right-md shadow-sm",size:"small",pill:!0,ariaLabel:"Close"})]})});pu.displayName="LightboxImage";const Wo=A.memo(({src:e,lightboxSrc:t,alt:n,fadeIn:r,fallbackSrc:s,fallback:o,hasShadow:a=!1,includeLightBoxModal:i=!0,lightboxFooter:c,origin:u,draggable:f=!0,imageClassName:m,maskClassName:p,containerClassName:h,rounded:g="md",onClick:y,AIProps:x,authorName:v,authorUrl:b,onLoad:_,onFail:w,softBlockSaveImage:S=!1,imageRef:C,imageProps:E,testId:T,onDownload:k,...I})=>{const[M,N]=d.useState(!1),[D,j]=d.useState(!1),[F,R]=d.useState(!1),P=d.useRef(null),{isAI:L,AILabel:U}=x||{isAI:!1,AILabel:""},O=d.useRef(Date.now()),$=d.useCallback(ee=>{N(!0),w?.({isConnected:ee.currentTarget.isConnected,loadTime:Date.now()-O.current})},[w]),G=d.useCallback(()=>{j(!0),_?.()},[j,_]);d.useEffect(()=>{if(P.current){if(P.current.complete){G();return}P.current.src||(P.current.src=e)}},[e,G,P]);const H=z(m,"transition-all ease-in-out",{"opacity-100 duration-200 scale-100":D&&r,"opacity-0 scale-[0.98]":!D&&r,"hidden opacity-0":M&&!s,"max-h-[90vh]":i,"cursor-zoom-in hover:shadow-lg duration-200 ":i&&!F}),Q=d.useMemo(()=>({className:H,src:e,alt:n,onError:$,onClick:()=>R(!0),...E}),[n,H,E,$,e]),Y=d.useMemo(()=>({ref:P,onLoad:G,...Q}),[G,Q]),te=d.useMemo(()=>({...Q,src:t??e}),[t,Q,e]),se=d.useCallback(ee=>{ee.stopPropagation()},[]),ae=l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"tiny",color:"white",className:"px-xs py-two h-5 rounded-md bg-black/60 opacity-0 transition-all group-hover:opacity-100",children:l.jsxs(ga,{className:"gap-xs",children:[l.jsx(Bn,{id:"authorName",children:v}),b?l.jsx(Bn,{id:"authorDomain",children:Ur(b)}):null]})}),l.jsx("div",{className:"size-xs bg-black/60 opacity-0 transition-all group-hover:opacity-100"})]}),X=d.useCallback(()=>R(!1),[]);if(M){if(s&&P.current)P.current.src=s;else if(o!==void 0)return o}return l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:y,className:h,"data-testid":T,children:l.jsxs("div",{className:z("bg-subtler group relative size-full overflow-hidden",p,{"shadow-md":a&&D,"transition-all duration-200 ease-in-out hover:scale-[1.02] hover:shadow-lg":a,"rounded-sm":g==="sm","rounded-md":g==="md",rounded:g===!0}),children:[L&&l.jsxs("div",{className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:[l.jsx("div",{children:l.jsx(V,{variant:"tiny",color:"white",className:"gap-x-two px-xs py-two flex h-5 items-center rounded-md bg-black/60 opacity-0 transition-all group-hover:opacity-100",children:l.jsx("span",{children:U})})}),l.jsx("div",{className:"size-xs bg-black/60 opacity-0 transition-all group-hover:opacity-100"}),l.jsx("div",{children:l.jsx(V,{variant:"tiny",color:"white",className:"gap-x-two p-two flex h-5 items-center rounded-md bg-black/60",children:l.jsx(ge,{icon:B("cpu-2"),size:"xs"})})})]}),v&&(b?l.jsx(yt,{href:b??"",target:"_blank",onClick:se,className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:ae}):l.jsx("div",{onClick:se,className:"bottom-xs right-xs absolute z-10 flex items-center justify-center",children:ae})),S&&!L&&l.jsx("div",{className:"absolute inset-0",onClick:i?()=>R(!0):void 0}),l.jsx("img",{width:I.width,height:I.height,alt:n,...Y,ref:jK([C,P]),draggable:f})]})}),i&&l.jsx(pu,{onClose:X,isOpen:F,imgProps:te,origin:u,width:I.width,height:I.height,alt:n,onDownload:k,footer:c})]})});Wo.displayName="Image";const zK=A.memo(({uploadedFiles:e,onRemoveFile:t,ref:n})=>l.jsxs("div",{ref:n,className:"gap-x-sm scrollbar-none flex snap-x snap-mandatory overflow-x-auto",children:[l.jsx("div",{className:"w-xs shrink-0"}),e.map((r,s)=>l.jsx(WK,{uploadedFile:r,onRemoveFile:t},s)),l.jsx("div",{className:"w-xs shrink-0"})]}));zK.displayName="UploadedFilesList";const WK=A.memo(({uploadedFile:e,onRemoveFile:t})=>{const n="uploaded-files-list",{session:r}=Ne(),{trackEvent:s}=Xe(r),o=e.status==="uploading",{$t:a}=J(),{fileRepoInfo:i}=zx({reason:n}),{saveFile:c,isLoading:u}=f_e({fileRepoInfo:i,reason:n}),{data:f}=jz({fileRepoInfo:i,fileName:e.file.name,reason:n}),m=Object.values(vo),p=mu(e.file.name),g=p&&!kr(e.file.name)&&m.includes(p)&&Y2e(e.nextURL),y=i.file_repository_type==="COLLECTION"&&!o&&g,x=d.useMemo(()=>a(f?{defaultMessage:"File exists in Space",id:"pD1m2AH9FU"}:{defaultMessage:"Save attachment to Space",id:"/Pbth8CiTs"}),[f,a]),v=d.useMemo(()=>UK(e)?B("photo"):hNe(e)?B("pdf"):gNe(e)?B("file-spreadsheet"):yNe(e)?B("file-text"):B("file"),[e]),b=d.useCallback(()=>{s("remove attachment clicked"),e.nextURL&&t?.(e.nextURL,e.file_uuid??"")},[s,e,t]),_=d.useCallback(()=>c(e),[c,e]);return l.jsxs("div",{className:z("scroll-mx-md px-sm py-xs border-subtlest bg-subtler dark:bg-subtle gap-x-md flex h-[48px] w-fit snap-start items-center justify-between rounded-lg",{"opacity-70":o}),children:[l.jsxs("div",{className:"gap-x-md flex items-center",children:[e.thumbnailSource&&!o?l.jsx(Wo,{alt:e.file.name,src:e.thumbnailSource,containerClassName:"size-8 shrink-0",imageClassName:"w-full h-full object-cover object-center",rounded:"md",includeLightBoxModal:!1}):l.jsx("div",{className:"bg-subtle dark:bg-subtler flex size-8 items-center justify-center rounded-lg","data-testid":o?"file-loading-icon":"file-type-icon",children:l.jsx(ge,{icon:o?B("loader-2"):v,size:"sm",color:"#64645F",className:o?"animate-spin":void 0})}),l.jsxs("div",{className:"flex-col",children:[l.jsx(V,{variant:"tiny",color:"light",className:"text-nowrap",children:pNe(e.file.name,30)}),e.file.size>0&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"text-nowrap",children:xNe(e.file.size)})]})]}),l.jsxs("div",{className:"gap-x-sm flex items-center",children:[y&&l.jsx(st,{icon:B("device-floppy"),size:"tiny",onClick:_,disabled:f||u,variant:"common",toolTip:x,isLoading:u,pill:!0,noPadding:!0}),e.nextURL&&l.jsx(st,{icon:B("x"),size:"tiny",testId:"remove-uploaded-file",onClick:b,variant:"common",pill:!0,noPadding:!0})]})]})});WK.displayName="UploadedFilePreview";const bNe=new Set(["super","textColor","max","orange"]),_Ne=new Set(["red"]),wNe=e=>bNe.has(e)?"defaultInverted":_Ne.has(e)?"white":e==="maxBorder"?"max":e==="superBorder"?"super":"default",GK=A.memo(({text:e,variant:t="super",boxProps:n,textProps:r})=>{const s=wNe(t);return l.jsx(K,{variant:t,...n,className:z("px-xs rounded-badge -mt-px box-border inline-flex",n?.className),children:l.jsx(V,{variant:"tiny",className:"leading-4",color:s,inline:!0,...r,children:e})})});GK.displayName="Badge";const nl=A.memo(({children:e,orientation:t="vertical",showScrollIndicator:n=!0,thumbClassName:r="",className:s,viewportRef:o,viewportClassName:a,showIndicatorOnHover:i=!0,onScroll:c})=>{const f="before:content-[''] before:absolute before:top-[50%] before:left-[50%] before:translate-x-[-50%] before:translate-y-[-50%] before:w-[100%] before:h-[100%] before:min-w-[10px] before:min-h-[10px]"+" rounded-full bg-subtle duration-quick relative",m=z("flex flex-col p-px duration-150",{"data-[state=visible]:opacity-100":n,"pointer-events-none":!n,"opacity-0":i,"opacity-100":!i});return l.jsxs(u$,{className:z("w-full overflow-hidden",s),children:[l.jsx(d$,{className:z("size-full",a),ref:o,onScroll:c,children:e}),["vertical","both"].includes(t)&&l.jsx(A3,{forceMount:!0,orientation:"vertical",className:m,children:l.jsx(N3,{className:`!w-[5px] ${f} ${r}`})}),["horizontal","both"].includes(t)&&l.jsx(A3,{forceMount:!0,orientation:"horizontal",className:m,children:l.jsx(N3,{className:`!h-[5px] ${f} ${r}`})})]})}),CNe=A.memo(({scrollRef:e,buttonProps:t,children:n,className:r})=>{const s=d.useCallback(()=>{e.current?.scrollTo({left:e.current?.scrollLeft-e.current?.scrollWidth/3,behavior:"smooth"})},[e]),o=d.useCallback(()=>{e.current?.scrollTo({left:e.current?.scrollLeft+e.current?.scrollWidth/3,behavior:"smooth"})},[e]);return l.jsxs(K,{className:r,children:[l.jsx(st,{pill:!0,icon:B("chevron-left"),onClick:s,...t}),n,l.jsx(st,{pill:!0,icon:B("chevron-right"),onClick:o,...t})]})});CNe.displayName="ScrollAreaArrows";nl.displayName="ScrollArea";const fh=A.memo(({items:e,grid:t,cols:n=1,disableScrollArea:r=!1,disableHoverStyles:s=!1})=>{const o=d.useMemo(()=>t&&n>1?{display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:"1px"}:void 0,[t,n]),a=({children:i})=>o?l.jsx("div",{role:"menu",style:o,children:i}):r?l.jsx("div",{role:"menu",className:"p-xs flex flex-col gap-px",children:i}):l.jsx(nl,{showIndicatorOnHover:!1,className:"p-xs",children:l.jsx("div",{role:"menu",className:"flex flex-col gap-px",children:i})});return l.jsx(a,{children:e.map((i,c)=>i.type==="separator"?l.jsx(Ed,{...i},c):l.jsx(Ed,{disableHoverStyles:s,...i},c))})});fh.displayName="Menu";var SNe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],eE=SNe.join(","),$K=typeof Element>"u",mh=$K?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,p2=!$K&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},h2=function e(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",a=o||n&&t&&e(t.parentNode);return a},ENe=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},kNe=function(t,n,r){if(h2(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(eE));return n&&mh.call(t,eE)&&s.unshift(t),s=s.filter(r),s},MNe=function e(t,n,r){for(var s=[],o=Array.from(t);o.length;){var a=o.shift();if(!h2(a,!1))if(a.tagName==="SLOT"){var i=a.assignedElements(),c=i.length?i:a.children,u=e(c,!0,r);r.flatten?s.push.apply(s,u):s.push({scopeParent:a,candidates:u})}else{var f=mh.call(a,eE);f&&r.filter(a)&&(n||!t.includes(a))&&s.push(a);var m=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),p=!h2(m,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(m&&p){var h=e(m===!0?a.children:m.children,!0,r);r.flatten?s.push.apply(s,h):s.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return s},qK=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},KK=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ENe(t))&&!qK(t)?0:t.tabIndex},TNe=function(t,n){var r=KK(t);return r<0&&n&&!qK(t)?0:r},ANe=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},YK=function(t){return t.tagName==="INPUT"},NNe=function(t){return YK(t)&&t.type==="hidden"},RNe=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},DNe=function(t,n){for(var r=0;rsummary:first-of-type"),a=o?t.parentElement:t;if(mh.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof s=="function"){for(var i=t;t;){var c=t.parentElement,u=p2(t);if(c&&!c.shadowRoot&&s(c)===!0)return JD(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=i}if(ONe(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return JD(t);return!1},FNe=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},VNe=function e(t){var n=[],r=[];return t.forEach(function(s,o){var a=!!s.scopeParent,i=a?s.scopeParent:s,c=TNe(i,a),u=a?e(s.candidates):i;c===0?a?n.push.apply(n,u):n.push(i):r.push({documentOrder:o,tabIndex:c,item:s,isScope:a,content:u})}),r.sort(ANe).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},QK=function(t,n){n=n||{};var r;return n.getShadowRoot?r=MNe([t],n.includeContainer,{filter:ej.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:UNe}):r=kNe(t,n.includeContainer,ej.bind(null,n)),VNe(r)};function HNe(){return/apple/i.test(navigator.vendor)}function zNe(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function WNe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_me(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function pA(e){return e?.ownerDocument||document}var GNe=typeof document<"u",$Ne=function(){},Tl=GNe?d.useLayoutEffect:$Ne;const qNe={...DU},KNe=qNe.useInsertionEffect,YNe=KNe||(e=>e());function QNe(e){const t=d.useRef(()=>{});return YNe(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ZK(e,t){const n=QK(e,XK()),r=n.length;if(r===0)return;const s=zNe(pA(e)),o=n.indexOf(s),a=o===-1?t===1?0:r-1:o+t;return n[a]}function XNe(e){return ZK(pA(e).body,1)||e}function ZNe(e){return ZK(pA(e).body,-1)||e}function sw(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!WNe(n,r)}function JNe(e){QK(e,XK()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function tj(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const e8e={...DU};let nj=!1,t8e=0;const rj=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+t8e++;function n8e(){const[e,t]=d.useState(()=>nj?rj():void 0);return Tl(()=>{e==null&&t(rj())},[]),d.useEffect(()=>{nj=!0},[]),e}const r8e=e8e.useId,hA=r8e||n8e,s8e=d.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:s},middlewareData:{arrow:o,shift:a}},width:i=14,height:c=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:m,stroke:p,d:h,style:{transform:g,...y}={},...x}=t,v=hA(),[b,_]=d.useState(!1);if(Tl(()=>{if(!s)return;Cme(s).direction==="rtl"&&_(!0)},[s]),!s)return null;const[w,S]=r.split("-"),C=w==="top"||w==="bottom";let E=m;(C&&a!=null&&a.x||!C&&a!=null&&a.y)&&(E=null);const T=f*2,k=T/2,I=i/2*(u/-8+1),M=c/2*u/4,N=!!h,D=E&&S==="end"?"bottom":"top";let j=E&&S==="end"?"right":"left";E&&b&&(j=S==="end"?"left":"right");const F=o?.x!=null?E||o.x:"",R=o?.y!=null?E||o.y:"",P=h||"M0,0"+(" H"+i)+(" L"+(i-I)+","+(c-M))+(" Q"+i/2+","+c+" "+I+","+(c-M))+" Z",L={top:N?"rotate(180deg)":"",left:N?"rotate(90deg)":"rotate(-90deg)",bottom:N?"":"rotate(180deg)",right:N?"rotate(-90deg)":"rotate(90deg)"}[w];return l.jsxs("svg",{...x,"aria-hidden":!0,ref:n,width:N?i:i+T,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[j]:F,[D]:R,[w]:C||N?"100%":"calc(100% - "+T/2+"px)",transform:[L,g].filter(U=>!!U).join(" "),...y},children:[T>0&&l.jsx("path",{clipPath:"url(#"+v+")",fill:"none",stroke:p,strokeWidth:T+(h?0:1),d:P}),l.jsx("path",{stroke:T&&!h?x.fill:"none",d:P}),l.jsx("clipPath",{id:v,children:l.jsx("rect",{x:-k,y:k*(N?-1:1),width:i+T,height:i})})]})});function o8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const a8e=d.createContext(null),i8e=d.createContext(null),l8e=()=>{var e;return((e=d.useContext(a8e))==null?void 0:e.id)||null},c8e=()=>d.useContext(i8e);function JK(e){return"data-floating-ui-"+e}const eY={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},sj=d.forwardRef(function(t,n){const[r,s]=d.useState();Tl(()=>{HNe()&&s("button")},[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[JK("focus-guard")]:"",style:eY};return l.jsx("span",{...t,...o})}),tY=d.createContext(null),oj=JK("portal");function u8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=hA(),s=f8e(),[o,a]=d.useState(null),i=d.useRef(null);return Tl(()=>()=>{o?.remove(),queueMicrotask(()=>{i.current=null})},[o]),Tl(()=>{if(!r||i.current)return;const c=t?document.getElementById(t):null;if(!c)return;const u=document.createElement("div");u.id=r,u.setAttribute(oj,""),c.appendChild(u),i.current=u,a(u)},[t,r]),Tl(()=>{if(n===null||!r||i.current)return;let c=n||s?.portalNode;c&&!Sme(c)&&(c=c.current),c=c||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,c.appendChild(u));const f=document.createElement("div");f.id=r,f.setAttribute(oj,""),c=u||c,c.appendChild(f),i.current=f,a(f)},[t,n,r,s]),o}function d8e(e){const{children:t,id:n,root:r,preserveTabOrder:s=!0}=e,o=u8e({id:n,root:r}),[a,i]=d.useState(null),c=d.useRef(null),u=d.useRef(null),f=d.useRef(null),m=d.useRef(null),p=a?.modal,h=a?.open,g=!!a&&!a.modal&&a.open&&s&&!!(r||o);return d.useEffect(()=>{if(!o||!s||p)return;function y(x){o&&sw(x)&&(x.type==="focusin"?tj:JNe)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,s,p]),d.useEffect(()=>{o&&(h||tj(o))},[h,o]),l.jsxs(tY.Provider,{value:d.useMemo(()=>({preserveTabOrder:s,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:m,portalNode:o,setFocusManagerState:i}),[s,o]),children:[g&&o&&l.jsx(sj,{"data-type":"outside",ref:c,onFocus:y=>{if(sw(y,o)){var x;(x=f.current)==null||x.focus()}else{const v=a?a.domReference:null,b=ZNe(v);b?.focus()}}}),g&&o&&l.jsx("span",{"aria-owns":o.id,style:eY}),o&&zh.createPortal(t,o),g&&o&&l.jsx(sj,{"data-type":"outside",ref:u,onFocus:y=>{if(sw(y,o)){var x;(x=m.current)==null||x.focus()}else{const v=a?a.domReference:null,b=XNe(v);b?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const f8e=()=>d.useContext(tY);function m8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=hA(),o=d.useRef({}),[a]=d.useState(()=>o8e()),i=l8e()!=null,[c,u]=d.useState(r.reference),f=QNe((h,g,y)=>{o.current.openEvent=h?g:void 0,a.emit("openchange",{open:h,event:g,reason:y,nested:i}),n?.(h,g,y)}),m=d.useMemo(()=>({setPositionReference:u}),[]),p=d.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return d.useMemo(()=>({dataRef:o,open:t,onOpenChange:f,elements:p,events:a,floatingId:s,refs:m}),[t,f,p,a,s,m])}function nY(e){e===void 0&&(e={});const{nodeId:t}=e,n=m8e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[o,a]=d.useState(null),[i,c]=d.useState(null),f=s?.domReference||o,m=d.useRef(null),p=c8e();Tl(()=>{f&&(m.current=f)},[f]);const h=wme({...e,elements:{...s,...i&&{reference:i}}}),g=d.useCallback(_=>{const w=N0(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;c(w),h.refs.setReference(w)},[h.refs]),y=d.useCallback(_=>{(N0(_)||_===null)&&(m.current=_,a(_)),(N0(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!N0(_))&&h.refs.setReference(_)},[h.refs]),x=d.useMemo(()=>({...h.refs,setReference:y,setPositionReference:g,domReference:m}),[h.refs,y,g]),v=d.useMemo(()=>({...h.elements,domReference:f}),[h.elements,f]),b=d.useMemo(()=>({...h,...r,refs:x,elements:v,nodeId:t}),[h,x,v,t,r]);return Tl(()=>{r.dataRef.current.floatingContext=b;const _=p?.nodesRef.current.find(w=>w.id===t);_&&(_.context=b)}),d.useMemo(()=>({...h,context:b,refs:x,elements:v}),[h,x,v,b])}class p8e{static detectOverflowOptions={padding:8};static offsetMiddleware=dM({mainAxis:4,crossAxis:0});static shiftMiddleware=BU({limiter:Eme(),...this.detectOverflowOptions});static flipMiddleware=UU(this.detectOverflowOptions);static sizeMiddleware(t={matchTargetWidth:!1},n=!0){return VU({...this.detectOverflowOptions,apply({availableHeight:r,rects:s,elements:o}){n&&(o.floating.style.maxHeight=`${r}px`),(t.matchTargetWidth??!0)&&(o.floating.style.width=`${s.reference.width}px`)}})}static defaultMiddleWare(t={avoidCollisions:!0,matchTargetWidth:!1}){const n=t.avoidCollisions??!0,r=t.avoidPositionCollisions!==void 0?t.avoidPositionCollisions:n,s=t.avoidSizeCollisions!==void 0?t.avoidSizeCollisions:n;return[this.offsetMiddleware,r&&this.shiftMiddleware,r&&this.flipMiddleware,this.sizeMiddleware({matchTargetWidth:t.matchTargetWidth},s)].filter(Boolean)}}const h8e=130,Vf=A.memo(({content:e,contentClassName:t="",children:n,delayTime:r=200,isOpen:s,hoverOpen:o,hoverOpenDelay:a=0,placement:i="bottom-end",matchTargetWidth:c=!1,childrenClassName:u,testId:f,overlayProps:m,onOpen:p,onClose:h,disableAnimation:g,hasInteractiveContent:y=!1,avoidCollisions:x=!0,avoidPositionCollisions:v,avoidSizeCollisions:b,customFloatingUIOptions:_,disableShadow:w,floatingElementProps:S,arrowClassName:C,borderRadius:E="rounded-xl",sideOffset:T=4,forceDarkMode:k=!1,onContentMouseEnter:I,onContentMouseLeave:M})=>{const N=d.useRef(null),D=d.useRef(null),j=d.useMemo(()=>{const Ee=p8e.defaultMiddleWare({avoidCollisions:x,avoidPositionCollisions:v,avoidSizeCollisions:b,matchTargetWidth:c});return T!==4&&(Ee[0]=dM({mainAxis:T,crossAxis:0})),C&&Ee.push(kme({element:N})),Ee},[x,v,b,c,C,T]),{refs:F,floatingStyles:R,placement:P,context:L}=nY({strategy:"fixed",placement:i,middleware:j,whileElementsMounted:(...Ee)=>HU(...Ee),..._}),[U,O]=d.useState(!1),$=d.useRef(U),[G,H]=d.useState(!1),Q=d.useRef(G),[Y,te]=d.useState(!1),se=s!==void 0,[ae,X]=d.useState(!1),ee=d.useMemo(()=>se?s:ae,[se,s,ae]),le=d.useCallback(Ee=>{Ee.stopPropagation()},[]),re=d.useCallback(()=>{ee||(p?.(),se||X(!0))},[se,ee,p]),ce=d.useCallback(()=>{te(Ee=>ee&&!Ee?(h?.(),se||X(!1),g?!1:(setTimeout(()=>{te(!1)},h8e),!0)):Ee)},[se,ee,h,g]),ue=d.useCallback(()=>{ee?ce():re()},[ce,re,ee]),me=d.useCallback(()=>{setTimeout(()=>{!Q.current&&!$.current&&ce()},r)},[r,ce,Q,$]),we=d.useCallback(()=>{setTimeout(()=>{if(se&&h){h();return}ce()},0)},[se,h,ce]),ye=d.useCallback(()=>{$.current=!0,O(!0),D.current&&(clearTimeout(D.current),D.current=null),a>0?D.current=setTimeout(()=>{re()},a):re()},[re,a]),_e=d.useCallback(()=>{$.current=!1,O(!1),D.current&&(clearTimeout(D.current),D.current=null),me()},[me]),ke=d.useCallback(()=>{o&&(Q.current=!0,H(!0)),I?.()},[o,I]),De=d.useCallback(()=>{o&&(Q.current=!1,H(!1),me()),M?.()},[o,me,M]),xe=d.useCallback(Ee=>{Ee.stopPropagation(),ue()},[ue]),Ue=d.useMemo(()=>({transform:"translateY(-1px)"}),[]);return d.useEffect(()=>()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),l.jsxs(l.Fragment,{children:[l.jsx("span",{onMouseEnter:o?ye:void 0,onMouseLeave:o?_e:void 0,onPointerEnter:o?ye:void 0,onPointerLeave:o?_e:void 0,ref:F.setReference,onMouseDown:le,onClick:o?void 0:xe,className:u,"data-test-id":f,children:n}),e?l.jsx(uA,{isOpen:ee||Y,onClose:we,transparent:!0,childVariant:"clean",disableAnimation:g,delayClose:!1,...m,children:l.jsx("div",{className:"absolute inset-x-0 top-0","data-color-scheme":k?"dark":void 0,children:l.jsx("div",{className:"flex",ref:F.setFloating,onMouseEnter:ke,onMouseLeave:De,onPointerEnter:ke,onPointerLeave:De,onClick:Ee=>{y&&Ee.stopPropagation()},style:R,...S,children:l.jsxs(K,{variant:"background",className:z({"shadow-overlay":!w},"flex min-h-0 min-w-0","data-[placement=bottom-end]:origin-top-right data-[placement=bottom-start]:origin-top-left data-[placement=top-end]:origin-bottom-right data-[placement=top-start]:origin-bottom-left",{"duration-150":!g,"animate-out fade-out zoom-out-[0.97] ease-in":Y&&!g,"p-xs animate-in fade-in zoom-in-[0.97] ease-out":!g},t,E),"data-placement":P,children:[e,C&&l.jsx(s8e,{ref:N,context:L,className:C,style:Ue})]})})})}):null]})});Vf.displayName="Popover";const zs=A.memo(({isOpen:e,hoverOpen:t=!1,children:n,items:r,placement:s,disabled:o=!1,grid:a,onOpen:i,title:c,onClose:u,isMobileStyle:f,boxProps:m,modalProps:p,popoverProps:h,cols:g=1,footer:y=null,contentClassName:x="",wrapperClassName:v,header:b,preMenuContent:_,alwaysShowChildren:w,size:S,showFooterOnMobile:C=!1,isMax:E=!1})=>{const[T,k]=d.useState(!1),I=e!==void 0,M=I?e:T,N=d.useCallback(()=>{if(!M&&!o){const P=i?.()??!0;!I&&P&&k(!0)}},[o,I,i,M]),D=d.useCallback(()=>{M&&!o&&(u?.(),I||k(!1))},[o,I,u,M]),j=d.useMemo(()=>r.map(P=>({...P,size:S??(f?Ht.regular:void 0),onClick:L=>{!o&&"onClick"in P&&(P.onClick?.(L),P.type==="toggle"||P.type==="multiSelect"||D())}})),[o,D,r,S,f]),F=d.useMemo(()=>{const{className:P,...L}=m||{};return l.jsx(K,{className:z("flex max-h-[80vh] min-h-0 min-w-[160px] flex-col",{"max-w-[250px]":!a,"gap-two grid max-w-lg":a,"max-super-override":E},P),...L,children:l.jsxs("div",{className:"flex h-full flex-col",children:[b&&l.jsx(K,{className:"mb-sm mx-sm flex-shrink-0 border-b",children:b}),c&&l.jsx(K,{className:"mb-sm mx-sm flex-shrink-0 border-b",children:l.jsx(V,{variant:"smallBold",className:"py-sm mb-1",children:c})}),l.jsxs(nl,{orientation:"vertical",showIndicatorOnHover:!1,className:"min-h-0 flex-1 overflow-auto",children:[_,l.jsx(fh,{items:j,grid:a,cols:g,disableScrollArea:!0}),y]})]})})},[m,g,y,a,b,j,c,_,E]);return r.every(P=>P.show===!1)?w?n:null:f?l.jsxs(l.Fragment,{children:[l.jsx(po,{variant:"bottom-left-sheet",actionList:Pe,isOpen:M,onClose:D,footerContent:C&&y?y:void 0,footerClassname:C&&y?"!pt-0 pb-5 sticky bottom-0":void 0,wrapperClassname:C&&y?"!pb-0":void 0,...p,children:l.jsx(K,{className:z("divide-y",{"max-super-override":E}),children:l.jsx(fh,{items:j,grid:a})})}),l.jsx("span",{className:v,onClick:t?void 0:P=>{P.stopPropagation(),N()},children:n})]}):l.jsx(Vf,{...h,hoverOpen:t,isOpen:M,placement:s,onClose:D,onOpen:N,contentClassName:x,childrenClassName:v,content:F,hasInteractiveContent:!0,children:n})});zs.displayName="DropDownMenu";const Hf=A.memo(({children:e,className:t,disabled:n,onClick:r,onMouseDown:s,onMouseEnter:o,onMouseMove:a,testId:i,rounded:c,href:u,focused:f,disableHoverStyles:m=!1,target:p="_blank",tooltipText:h,tooltipLayout:g="right",tooltipDelayDuration:y,active:x=!1,role:v="menuitem"})=>{const b=d.useRef(null),_=ui(),w=l.jsx("div",{className:z("duration-quick relative select-none rounded-lg transition-all","px-sm py-1.5 md:h-full",{"hover:bg-subtler cursor-pointer":!n&&!m,"cursor-pointer":!n&&m,rounded:c,"bg-subtler":f}),children:e}),S=z("group/item md:h-full",t);d.useEffect(()=>{b.current&&f&&b.current.scrollIntoView({behavior:"instant",block:"nearest"})},[f]);const C=v==="menuitemradio"||v==="menuitemcheckbox"?x?"true":"false":void 0;return u&&!n?l.jsx(yt,{href:u,target:p,className:S,onClick:r,"data-testid":i,children:w}):l.jsx(Io,{tooltipText:h,showTooltip:!_&&!!h,tooltipLayout:g,delayDuration:y,offset:12,asChild:!0,children:l.jsx("div",{role:v,"aria-checked":C,ref:b,"data-testid":i,className:S,onClick:n?void 0:r,onMouseDown:n?void 0:s,onMouseEnter:n?void 0:o,onMouseMove:n?void 0:a,children:w})})});Hf.displayName="MenuItemWrapper";const g8e=({icon:e,avatar:t,destructive:n})=>{if(t)return t;if(!e)return null;const r=z({"!text-caution":n},"opacity-90");return l.jsx(ge,{icon:e,className:r,size:"sm"})},y8e=/\bgap(-[xy])?-/,x8e={[Ht.small]:"extraSmall",[Ht.tiny]:"tiny"},zf=A.memo(({customDescriptionNode:e,customTextNode:t,text:n,description:r,icon:s,avatar:o,label:a,badge:i,link:c,onLinkClick:u,size:f=Ht.small,color:m="default",badgeVariant:p="super",destructive:h,leftElement:g,rightElement:y,bottomElement:x,textTrailingElement:v,className:b="",preserveLeftIconSpace:_=!1,textClassName:w})=>{const S=s||o;return l.jsxs("div",{className:z("flex",b,y8e.test(b)?"":"gap-sm"),children:[(S||_)&&l.jsx("div",{className:"flex",children:l.jsx(V,{color:m,className:z("flex size-5 justify-center leading-none",{"-mt-one":o}),children:!_||S?l.jsx(g8e,{icon:s,avatar:o,destructive:h}):null})}),g,l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex flex-col gap-y-0.5",children:[t||l.jsxs(V,{variant:x8e[f]??"baseSemi",color:m,className:z("flex items-center gap-x-1.5",{"!text-caution":h}),children:[l.jsx("span",{className:w,children:n}),v,i&&l.jsx(GK,{text:i,variant:p})]}),e||r&&l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:r}),c&&l.jsx(V,{variant:"tinyRegular",color:"super",onClick:u,children:c}),x]}),a&&l.jsx(V,{className:"mt-one whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:a})]}),y]})});zf.displayName="BaseMenuItem";const gA=A.memo(e=>{const{active:t,show:n=!0,className:r,rounded:s,color:o="default",activeColor:a="super",badgeVariant:i="super",disabled:c,href:u,onClick:f,onMouseDown:m,onMouseEnter:p,onMouseMove:h,testId:g,rightElement:y,focused:x,preserveRightElementSpace:v=!0,disableHoverStyles:b=!1,target:_,tooltipText:w,tooltipLayout:S,tooltipDelayDuration:C,role:E}=e;if(!n)return null;let T=o;c?T="ultraLight":t&&(T=a);const k=y??l.jsx(V,{color:T,className:"size-5",children:l.jsx(ut,{name:B("check"),size:hl.sm,className:t?"opacity-100":"opacity-0","aria-hidden":!t})});return l.jsx(Hf,{className:r,disabled:c,onClick:f,onMouseDown:m,onMouseEnter:p,onMouseMove:h,testId:g,rounded:s,href:u,focused:x,disableHoverStyles:b,target:_,tooltipText:w,tooltipLayout:S,tooltipDelayDuration:C,role:E,active:t,children:l.jsx(zf,{...e,color:T,badgeVariant:i,rightElement:v?k:y})})});gA.displayName="DefaultMenuItem";const rY=A.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,selected:f,active:m,disableHoverStyles:p=!1,tooltipText:h,tooltipLayout:g,tooltipDelayDuration:y,iconVariant:x="checkbox",disableActiveStyles:v=!1}=e;let b=r;s?b="ultraLight":(m||f)&&!v&&(b="super");const _=d.useMemo(()=>x==="check"?l.jsx(V,{color:f&&!v?"super":b,className:"size-5",children:l.jsx(ut,{name:B("check"),size:hl.sm,className:f?"opacity-100":"opacity-0","aria-hidden":!f})}):l.jsx(V,{color:f&&!v?"super":b,children:l.jsx(rn,{icon:f?B("square-check"):B("square"),size:"small"})}),[b,f,x,v]);return l.jsx(Hf,{className:t,disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,rounded:n,disableHoverStyles:p,tooltipText:h,tooltipLayout:g,tooltipDelayDuration:y,children:l.jsx(zf,{...e,color:b,rightElement:_})})});rY.displayName="MultiSelectMenuItem";const yA=A.memo(e=>{const{className:t,rounded:n,color:r="default",activeColor:s="super",switchVariant:o="super",disabled:a,onClick:i,onMouseDown:c,onMouseEnter:u,onMouseMove:f,testId:m,selected:p,active:h,rightElement:g,disableHoverStyles:y=!1,tooltipText:x,tooltipLayout:v,tooltipDelayDuration:b}=e,{$t:_}=J();let w=r;a?w="ultraLight":(h||p)&&(w=s);const S=d.useMemo(()=>l.jsxs("div",{className:z("gap-x-sm flex items-start pt-0.5",{"max-super-override":o==="max"}),children:[g,l.jsx(fg,{checked:p,onCheckedChange:Ao,disabled:a,size:"small","aria-label":x||_({defaultMessage:"Toggle option",id:"z+oW4dt4hh"})})]}),[_,a,g,p,o,x]);return l.jsx(Hf,{className:t,disabled:a,onClick:i,onMouseDown:c,onMouseEnter:u,onMouseMove:f,testId:m,rounded:n,disableHoverStyles:y,tooltipText:x,tooltipLayout:v,tooltipDelayDuration:b,children:l.jsx(zf,{...e,color:w,rightElement:S})})});yA.displayName="ToggleMenuItem";const sY=A.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,selected:f,active:m,showIconLeft:p=!1,disableHoverStyles:h=!1,tooltipText:g,tooltipLayout:y,tooltipDelayDuration:x}=e;let v=r;(m||f)&&(v="super");const b=l.jsx(V,{color:f?v:"ultraLight",className:z("flex pt-0.5 leading-none",{"opacity-50":s}),children:l.jsx(rn,{icon:f?B("circle-filled"):B("circle"),size:"small"})});return l.jsx(Hf,{className:t,disabled:s,onClick:o,onMouseDown:a,onMouseEnter:i,onMouseMove:c,testId:u,rounded:n,disableHoverStyles:h,tooltipText:g,tooltipLayout:y,tooltipDelayDuration:x,children:l.jsx(zf,{...e,rightElement:p?void 0:b,leftElement:p?b:void 0})})});sY.displayName="RadioMenuItem";const oY=A.memo(e=>{const{text:t,show:n,className:r}=e;return n?l.jsxs(l.Fragment,{children:[l.jsx(K,{className:z("sm:mx-sm my-sm border-b first:hidden",r)}),t&&l.jsx(K,{variant:"background",className:"sm:mx-sm mt-xs mb-sm pr-sm",children:l.jsx(V,{className:"w-max",variant:"tinyMono",color:"light",children:t})})]}):null});oY.displayName="MenuItemSeparator";const aY=A.memo(e=>{const{className:t,rounded:n,color:r="default",disabled:s,onMouseDown:o,onMouseEnter:a,onMouseMove:i,testId:c,submenu:u,active:f,disableHoverStyles:m=!1,isSubmenuOpen:p,onSubmenuOpen:h,onSubmenuClose:g,menuWidth:y="200px",isMax:x=!1}=e;let v=r;s?v="ultraLight":f&&(v="super");const b=d.useMemo(()=>l.jsx(V,{color:"light",children:l.jsx(rn,{icon:B("chevron-right"),size:"small"})}),[]),_=d.useMemo(()=>({className:"min-w-0",style:{width:y}}),[y]),w=d.useMemo(()=>({hasInteractiveContent:!0}),[]);return l.jsx(zs,{isOpen:p,items:u,placement:"right-end",onOpen:h,onClose:g,isMobileStyle:!1,hoverOpen:!0,boxProps:_,popoverProps:w,isMax:x,children:l.jsx(Hf,{className:t,disabled:s,onMouseDown:o,onMouseEnter:a,onMouseMove:i,testId:c,rounded:n,disableHoverStyles:m,children:l.jsx(zf,{...e,color:v,rightElement:b})})})});aY.displayName="NestedMenuItem";const Ed=A.memo(e=>{switch(e.type){case"default":{const{type:t,...n}=e;return l.jsx(gA,{...n,role:n.role||"menuitem"})}case"multiSelect":{const{type:t,...n}=e;return l.jsx(rY,{...n,role:"menuitemcheckbox"})}case"toggle":{const{type:t,...n}=e;return l.jsx(yA,{...n,role:"menuitemcheckbox"})}case"radio":{const{type:t,...n}=e;return l.jsx(sY,{...n,role:"menuitemradio"})}case"separator":{const{type:t,...n}=e;return l.jsx(oY,{...n})}case"nested":{const{type:t,...n}=e;return l.jsx(aY,{...n})}case"custom":return l.jsx(l.Fragment,{children:e.children})}});Ed.displayName="MenuItem";const iY=e=>e.map((t,n)=>{switch(t.type){case"default":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.Item,{onSelect:s,leadingAccessory:r,trailingAccessory:t.rightElement,disabled:t.disabled,children:t.text},n)}case"separator":return l.jsx(Dt.Separator,{},n);case"nested":{const r=t.avatar?()=>t.avatar:t.icon;return l.jsx(Dt.Submenu,{triggerElement:l.jsx(Dt.SubmenuItem,{leadingAccessory:r,disabled:t.disabled,children:t.text}),children:iY(t.submenu)},n)}case"multiSelect":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.CheckboxItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"toggle":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.SwitchItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"radio":{const r=t.avatar?()=>t.avatar:t.icon,s=()=>{t.onClick?.({})};return l.jsx(Dt.CheckboxItem,{onCheckedChange:s,checked:t.selected,leadingAccessory:r,disabled:t.disabled,children:t.text},n)}case"custom":return l.jsx(A.Fragment,{children:t.children},n);default:At(t)}}),lY=A.memo(({children:e,isOpen:t,onOpen:n,onClose:r,connectorMenuItems:s})=>{const o=d.useCallback(a=>{a?n():r()},[n,r]);return s.length<=1?e:l.jsx(Dt,{triggerElement:e,isOpen:t,onToggle:o,children:iY(s)})});lY.displayName="AttachmentSelector";const xA="/account",dbt=()=>`${xA}/details`,v8e=()=>xA,b8e=({mode:e})=>{const t=On(),n=ou(),r=d.useMemo(()=>t?.startsWith("/collections")||t?.startsWith("/spaces")?"space":t?.startsWith("/search")?"thread":t?.startsWith("/settings")?null:"ask",[t]),s=d.useMemo(()=>n===null?null:t?.startsWith("/collections")||t?.startsWith("/spaces")?n.slug?typeof n.slug=="string"?n.slug:n.slug[0]??null:null:t?.startsWith("/search")?t.split("/").pop()??null:t?.startsWith("/settings")?null:e??null,[t,n,e]),o=v8e(),a=d.useMemo(()=>{const i=`${o}/connectors`,c=new URLSearchParams;if(r){const u=Array.isArray(s)?s[0]:s;c.append("referrer",r),u&&c.append("referrerId",u)}return i+"?"+c.toString()},[r,s,o]);return d.useMemo(()=>({referrer:r,referrerId:s,redirectPath:a}),[a,r,s])};Ce(async()=>{const{MicrosoftFilePickerModal:e}=await Se(()=>q(()=>import("./MicrosoftFilePickerModal-aO6nep6w.js"),__vite__mapDeps([138,4,1,6,3,86,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})});const _8e=Ce(async()=>{const{BoxFilePickerModal:e}=await Se(()=>q(()=>import("./BoxFilePickerModal--6cVluz-.js"),__vite__mapDeps([139,4,1,3,8,9,6,7,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),cY=A.memo(({isOpen:e,fileType:t,tooltip:n,onOpen:r,onClose:s,onFilePickerOpen:o,onFilePickerClose:a,areFileAttachmentsAllowed:i,fileUploadErrorMessage:c,fileUploadWarningMessage:u,activeConnector:f=null,uploadedFiles:m=Pe,handleStartUpload:p,handleFileInput:h,isBoxFilePickerOpen:g=!1,handleCloseBoxFilePicker:y,cleanupBoxFilePicker:x,microsoftFilePickerOptions:v=null,handleCloseMicrosoftFilePicker:b,handleSelectSharepointSite:_,isMicrosoftFilePickerOpen:w=!1,fileInputRef:S,isAudioVideoFilesEnabled:C=!1,setAttachmentErrorMessage:E})=>{const T="file-upload-button",{$t:k}=J(),I=d.useRef(!1),[M,N]=w8e(),D=ui(),j=Wt(),{uploadRateLimit:F}=Vn(),{hasActiveSubscription:R}=$t(),P=F??(R?wM:_M),L=d.useCallback(xe=>xe.preventDefault(),[]),{session:U}=Ne(),{trackEvent:O}=Xe(U),{referrer:$,referrerId:G}=b8e({mode:"file"}),{connectorsMap:H}=Af({reason:T}),{enabledFileConnectors:Q}=Nz({reason:T}),{disabledFileConnectors:Y}=Rz({reason:T}),te=d.useMemo(()=>H?.onedrive?.connected||H?.sharepoint?.connected,[H?.onedrive?.connected,H?.sharepoint?.connected]),se=d.useCallback(()=>{switch(t){case"image":return k({defaultMessage:"images",id:"HVUWg4/ofn"});case"all":return k({defaultMessage:"files",id:"l17U7PEF+6"});default:return k({defaultMessage:"text or PDF files",id:"XFh9ob267W"})}},[k,t]),ae=d.useCallback(()=>{switch(t){case"image":return Che;case"all":return C?The:She;default:return C?khe:uV}},[t,C]),X=d.useCallback(xe=>{xe?O("attempt connector file attachment",{connectorName:xe}):O("opened file selector",{}),p?.(xe)},[p,O]),{handleConnect:ee}=J4({reason:T}),[le,re]=d.useState(!1),ce=d.useMemo(()=>{const xe={type:"default",text:k({defaultMessage:"Local files",id:"xMmQ4F7z3A"}),size:"small",icon:B("file-upload"),onMouseDown:L,onClick:()=>X("local")},Ue=Q.map(Ee=>{const Ke=Ee.name;return{type:"default",text:kc(Ke)??"",avatar:l.jsx("img",{src:_3(Ke)??"",alt:kc(Ke),width:20,height:20}),onMouseDown:L,onClick:()=>X(Ke),show:MV.includes(Ee.name)}});return Y.length>0&&!D&&Ue.push({type:"nested",submenu:Y.map(Ee=>({type:"default",size:"small",text:kc(Ee.name),avatar:l.jsx("img",{src:_3(Ee.name)??"",alt:kc(Ee.name),width:20,height:20}),rightElement:l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"sm"})}),onClick:()=>ee({connectorName:Ee.name,customReferrer:$??void 0,customReferrerId:G??void 0})})),isSubmenuOpen:le,onSubmenuOpen:()=>re(!0),onSubmenuClose:()=>re(!1),text:k({defaultMessage:"Connect files",id:"geEGjFxpOA"}),icon:B("share"),onMouseDown:L}),[xe]},[k,Q,Y,L,X,le,ee,$,G,D]),ue=d.useCallback(()=>{i&&(ce.length<=1||m.length>0?X(f??void 0):r?.())},[ce,m,f,X,r,i]),me=d.useCallback(()=>{s?.()},[s]),we=d.useMemo(()=>{if(n)return n;let xe=`${k({defaultMessage:"Attach",id:"Ye0Clmvfec"})} ${se()}`;return j?i?P!=null&&P>0&&P<=100?xe+=`. ${k({defaultMessage:"{remaining} left today",id:"V9HtlcGCOC"},{remaining:P})}`:mr(Hy)&&(xe=k({defaultMessage:"Files attached to threads are retained for 7 days",id:"hTclTOMwb7"})):xe=k({defaultMessage:"File attachments are disabled by your organization",id:"HmmaBNCmcH"}):xe+=`. ${k({defaultMessage:"Sign in to attach files",id:"Ei6nUBg77Q"})}`,xe},[k,i,P,se,j,n]);d.useEffect(()=>{const xe=()=>{I.current&&(a?.(),I.current=!1)};return window.addEventListener("focus",xe),()=>window.removeEventListener("focus",xe)},[a]),d.useCallback(()=>b?.(),[b]);const ye=d.useCallback(()=>y?.(),[y]);d.useCallback(xe=>_?.(xe),[_]);const _e=d.useCallback(()=>x?.(),[x]),ke=d.useCallback(()=>{E?.("")},[E]),De=d.useCallback(xe=>{ce.length<=1?ue():xe.stopPropagation()},[ce.length,ue]);return l.jsxs("div",{className:"flex items-center",children:[l.jsx(lY,{connectorMenuItems:ce,isOpen:e,onOpen:ue,onClose:me,children:l.jsx(wt,{variant:"text",size:"small",icon:B("paperclip"),disabled:!i,onClick:De,"aria-label":we,tooltipOpen:M||e,tooltipOnOpenChange:N})}),l.jsx("input",{type:"file",multiple:!0,"data-testid":"file-upload-input",onClick:()=>{I.current=!0,o?.()},ref:S,onChange:xe=>{I.current=!1,h?.(xe.target.files?Array.from(xe.target.files):Pe)},accept:ae(),style:{display:"none"}}),te&&w&&!1,H?.box?.connected&&g&&l.jsx(_8e,{isOpen:g,onClose:ye,cleanupPicker:_e}),l.jsx(qc,{isVisible:!!c,variant:"error",message:c??"",handleClose:ke,timeout:null}),l.jsx(qc,{isVisible:!!u&&!c,variant:"warning",message:u??"",timeout:4})]})});cY.displayName="FileUploadButton";function w8e(){const{fileUploadUpsellTooltipOpen:e}=qr(),{setFileUploadUpsellTooltipOpen:t}=jo(),[n,r]=d.useState(!1);return d.useEffect(()=>{e&&r(!0)},[e]),d.useEffect(()=>{n&&t(!1)},[n,t]),d.useMemo(()=>[n,r],[n])}var Ir;(function(e){e[e.FOCUS=0]="FOCUS",e[e.SOURCES=1]="SOURCES",e[e.RECENCY=2]="RECENCY",e[e.PRO_MODEL_PREFERENCE=3]="PRO_MODEL_PREFERENCE",e[e.ATTACHMENTS=4]="ATTACHMENTS",e[e.SEARCH_MODEL_SELECTOR=5]="SEARCH_MODEL_SELECTOR",e[e.UNIFIED_SOURCES=6]="UNIFIED_SOURCES",e[e.SIDECAR_ATTACHMENTS=7]="SIDECAR_ATTACHMENTS"})(Ir||(Ir={}));function C8e({isSignedIn:e,tooltip:t,onSelect:n}){const{$t:r}=J(),s=l.jsx(Dt.Item,{leadingAccessory:B("paperclip"),disabled:!e,onSelect:n,children:r({defaultMessage:"File",id:"gyrIElu9qY"})});return t?l.jsx(Fo,{content:t,side:"right",children:s}):s}function S8e({onSelect:e}){const{$t:t}=J();return l.jsx(Dt.Item,{leadingAccessory:B("capture"),onSelect:e,children:t({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})})}function E8e({isFollowUp:e}){const{$t:t}=J(),{forceEnableBrowserAgent:n}=qr(),{setForceEnableBrowserAgent:r}=jo(),s=d.useCallback(()=>{r(!n)},[n,r]);return e?null:l.jsx(Fo,{content:t({defaultMessage:"Let Comet Assistant navigate and interact with websites",id:"Htf0TtbEpJ"}),side:"right",children:l.jsx(Dt.Item,{leadingAccessory:B("click"),onSelect:s,children:t({defaultMessage:"Browse for me",id:"E8hFVZyoUg"})})})}function k8e({isFollowUp:e}){const{$t:t}=J(),{forceEnableBrowserAgent:n}=qr(),{setForceEnableBrowserAgent:r}=jo(),[s,o]=d.useState(!1),a=d.useCallback(()=>{r(!1)},[r]),i=d.useCallback(()=>{o(!0)},[]),c=d.useCallback(()=>{o(!1)},[]);return!n||e?null:l.jsx("div",{onMouseEnter:i,onMouseLeave:c,children:l.jsx(st,{text:t({defaultMessage:"Browse for me",id:"E8hFVZyoUg"}),size:"small",variant:"subtle",onClick:a,icon:s?B("x"):B("click")})})}const uY=A.memo(({handleFileInput:e,onFilePickerOpen:t,screenshotToolEnabled:n=!1,isFollowUp:r=!1})=>{const{$t:s}=J(),{sidecarSourceTab:{url:o}}=Qn(),a=un(),i=d.useRef(null),{activeMenu:c}=qr(),{onActiveMenuChange:u}=jo(),f=Wt(),{uploadRateLimit:m}=Vn(),{hasActiveSubscription:p}=$t(),h=m??(p?wM:_M);d.useEffect(()=>{if(n)return a.subscribeScreenshotCaptured(C=>{e?.([C],"local")})},[a,e,n]);const g=d.useCallback(()=>{a.captureSourceTabScreenshotV2({sourceTabUrl:o})},[a,o]),y=d.useCallback(()=>{i.current?.click()},[]),x=c===Ir.SIDECAR_ATTACHMENTS,v=d.useCallback(()=>{u(Ir.SIDECAR_ATTACHMENTS),t?.()},[u,t]),b=d.useCallback(()=>{u(null)},[u]),_=d.useMemo(()=>{if(f){if(h!=null&&h>0&&h<=100)return s({defaultMessage:"{remaining} left today",id:"V9HtlcGCOC"},{remaining:h});if(mr(Hy))return s({defaultMessage:"Files are retained for 7 days",id:"HLjpKDpzE3"})}else return s({defaultMessage:"Sign in to attach files",id:"Ei6nUBg77Q"})},[s,f,h]),w=d.useMemo(()=>l.jsx(wt,{variant:"secondary",size:"small",icon:B("plus"),"aria-label":s({defaultMessage:"Add files or select tools",id:"iTP/u4WRPO"})}),[s]),S=d.useCallback(C=>{C?v():b()},[v,b]);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"hidden",children:l.jsx(cY,{isOpen:!1,fileType:"all",areFileAttachmentsAllowed:!0,handleFileInput:e,onFilePickerOpen:t,fileInputRef:i})}),l.jsxs(Dt,{triggerElement:w,align:"start",isOpen:x,onToggle:S,children:[l.jsx(C8e,{isSignedIn:f,tooltip:_,onSelect:y}),n&&l.jsx(S8e,{onSelect:g}),l.jsx(Dt.Separator,{}),l.jsx(E8e,{isFollowUp:r})]}),l.jsx(k8e,{isFollowUp:r})]})});uY.displayName="SidecarAttachmentsMenuButton";const vA=A.memo(({className:e,color:t})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:t||"currentColor",viewBox:"0 0 66 24",className:e,children:[l.jsx("path",{d:"M33.569 17.032a1.919 1.919 0 0 1-.799-1.593c0-1.277.935-1.982 2.857-2.157l4.956-.473v.134c0 .784-.127 1.492-.378 2.105a3.958 3.958 0 0 1-1.012 1.456c-.834.753-1.993 1.15-3.354 1.15-.94 0-1.724-.215-2.27-.622Z"}),l.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M60.756 1.398c1.886.991 3.382 2.457 4.443 4.353 1.03 1.813 1.55 3.918 1.55 6.257 0 2.339-.521 4.444-1.55 6.257a10.934 10.934 0 0 1-2.475 3.027l-7.77-9.445 5.845-7.145V3.92h-3.135l-.076.096-4.626 5.837h-.009l-4.626-5.837-.075-.096h-3.136v.782l5.847 7.146-5.847 7.145v.782h3.136l.075-.095 4.626-5.837h.01l7.214 9.087-.017.01c-1.293.703-1.948 1.06-3.755 1.06H.25V1.862C.25.834 1.085 0 2.113 0h52.932c2.063 0 3.985.482 5.711 1.398ZM27.842 19.773V9.272c0-1.69-.55-3.073-1.59-4.002-.954-.851-2.28-1.301-3.834-1.301-1.375 0-2.54.306-3.463.91-.62.407-1.137.946-1.572 1.642a.1.1 0 0 1-.175-.008 4.35 4.35 0 0 0-1.35-1.605c-.864-.624-1.97-.94-3.285-.94-2.436 0-3.62.89-4.327 1.824-.059.077-.181.038-.181-.06V4.32H5.063v15.452h3.09V10.71c0-1.377.358-2.442 1.064-3.166.65-.665 1.597-1.017 2.74-1.017.967 0 1.712.26 2.215.772.488.499.736 1.221.736 2.148v10.326h3.09V10.71c0-1.377.358-2.442 1.063-3.165.65-.666 1.597-1.018 2.74-1.018.967 0 1.712.26 2.215.773.489.498.736 1.221.736 2.148v10.325h3.09Zm15.8 0 .001-10.003c0-1.821-.64-3.32-1.85-4.334-1.146-.96-2.862-1.468-4.72-1.468-1.856 0-3.49.467-4.723 1.35-1.213.87-2.003 2.096-2.254 3.557-.057.331-.04.736-.04.736h3.008l.027-.22c.122-.963.521-1.708 1.185-2.213.669-.51 1.587-.768 2.738-.768s2.038.27 2.636.8c.619.55.933 1.391.933 2.502v.682l-5.356.507c-3.577.344-5.547 1.997-5.547 4.656 0 1.375.564 2.531 1.63 3.346 1.023.781 2.436 1.194 4.088 1.194 1.43 0 2.66-.304 3.656-.903a5.177 5.177 0 0 0 1.408-1.237c.059-.075.179-.033.179.063v1.753h3.002Z"})]}));vA.displayName="MaxBadge";const bA=A.memo(({className:e})=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 51 24",className:e,children:[l.jsx("path",{d:"M35.069 7.954c-1.723 1.74-1.706 6.368 0 8.121 1.597 1.799 5.273 1.817 6.855 0 .873-.922 1.315-2.417 1.315-4.075 0-1.66-.442-3.144-1.317-4.048-1.584-1.853-5.256-1.834-6.853.002Z"}),l.jsx("path",{fillRule:"evenodd",d:"m48.958 5.715-.009-.015a10.792 10.792 0 0 0-4.387-4.301l-.01-.006C42.81.47 40.861 0 38.761 0H1.905C.866 0 .002.84 0 1.88V24h3.818V4.359h3.245v1.284c0 .132.161.196.252.1 2.987-3.275 9.077-2.319 11.216 1.723.725 1.234 1.092 2.759 1.092 4.534.102 4.584-3.017 8.265-7.55 8.235-2.031 0-3.629-.79-4.757-1.978a.146.146 0 0 0-.253.1V24h31.7c2.1 0 4.045-.468 5.78-1.39l.011-.005a10.795 10.795 0 0 0 4.394-4.302l.009-.016C49.98 16.483 50.5 14.368 50.5 12s-.52-4.482-1.543-6.285ZM30.112 7.42a24.93 24.93 0 0 1-.86-.003c-1.338-.02-2.845-.041-3.676.819-.549.54-.827 1.468-.827 2.759v8.809h-3.243V4.359h3.243v1.284c0 .148.194.202.271.077.314-.506.65-.852 1.012-1.05.616-.353 1.462-.532 2.514-.532h1.566V7.42Zm8.399 12.814c-4.77.033-8.068-3.395-7.973-8.235 0-1.716.348-3.21 1.033-4.442 2.714-5.062 11.157-5.068 13.852-.002.704 1.234 1.06 2.729 1.06 4.444.08 4.807-3.207 8.268-7.972 8.235Z",clipRule:"evenodd"}),l.jsx("path",{d:"M16.378 12c0 1.657-.442 3.153-1.314 4.075-1.583 1.816-5.26 1.798-6.857 0-1.706-1.753-1.722-6.381 0-8.121 1.597-1.836 5.27-1.855 6.854-.003.875.904 1.317 2.39 1.317 4.049Z"})]}));bA.displayName="ProBadge";const fy=A.memo(({isMax:e,className:t})=>e?l.jsx("div",{style:{"--mode-color":"oklch(var(--max-color))"},children:l.jsx(vA,{className:`text-max ${t||""}`})}):l.jsx("div",{style:{"--mode-color":"oklch(var(--super-color))"},children:l.jsx(bA,{className:`text-super ${t||""}`})}));fy.displayName="SearchModeBadge";function Wf(){const{isMax:e,isPro:t}=$t(),{isMaxUpsellEnabled:n}=$x(),{gpt4Limit:r,pplxAlphaLimit:s,pplxBetaLimit:o}=Vn();return d.useMemo(()=>i=>{let c=!1;return i===oe.RESEARCH?c=!r.available||!s.available:c=!r.available||!o.available,n&&!e&&t&&c&&(i===oe.RESEARCH||i===oe.STUDIO)},[n,e,t,r,s,o])}function hv(){const{gpt4Limit:e,pplxAlphaLimit:t,pplxBetaLimit:n}=Vn(),{specialCapabilities:r}=Yr(),s=Wt(),{hasAccessToProFeatures:o,isMax:a}=$t(),i=Wf(),{results:c}=on(),u=!r.unlimitedProSearch&&!e.available&&!o,f=!r.unlimitedResearch&&(!e.available||!t.available),m=!e.available||!n.available,{session:p}=Ne(),h=p?.user?.email??"",{isStudent:g}=CW({email:h,reason:"study-mode-access"}),y=d.useMemo(()=>c.some(x=>x.display_model===ie.STUDY),[c]);return d.useCallback(x=>{const v=an(x),b=v===oe.SEARCH&&![ie.DEFAULT,ie.PRO].includes(x);if(x===ie.DEFAULT)return!0;if(s)return an(x)===oe.STUDY&&!g&&!y?!1:a?!0:u||an(x)===oe.RESEARCH&&f||an(x)===oe.STUDIO&&m||i(v)?!1:!(!o&&b&&!r.unlimitedProSearch);{const _=r.unlimitedProSearch&&an(x)===oe.SEARCH&&!i(v),w=r.unlimitedResearch&&an(x)===oe.RESEARCH&&!i(v);return _||w}},[u,f,m,o,r.unlimitedProSearch,r.unlimitedResearch,s,i,a,g,y])}function vg(){const{$t:e}=J(),t=Wt(),{openVisitorLoginUpsell:n}=du({enabled:!t}),r=Wf(),s=hv(),o=ag(),{specialCapabilities:a}=Yr(),i=d.useCallback((u,f)=>{const m=an(u);if(u===ie.DEFAULT&&!f)return!1;const p=s(u)===!1||f;if(t)if(p){const h={[oe.SEARCH]:e({defaultMessage:"Want more {copilot}?",id:"Kf+JzdHL3c"},{copilot:"Pro Search"}),[oe.RESEARCH]:e({defaultMessage:"Want more Research?",id:"4cKm89wwuR"}),[oe.STUDIO]:e({defaultMessage:"Try Perplexity Labs",id:"y2BN7EwBoA"}),[oe.STUDY]:e({defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"})},g={[oe.SEARCH]:e({defaultMessage:"With {pplx} {pro}, get as many as you want",id:"jRMiP6Ut4n"},{pplx:"Perplexity",pro:"Pro"}),[oe.RESEARCH]:r(m)?e({defaultMessage:"Upgrade to Max for enhanced access to Perplexity Research.",id:"7fqjw8mo2u"}):e({defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"}),[oe.STUDIO]:r(m)?e({defaultMessage:"Upgrade to Max for enhanced access to Perplexity Labs.",id:"vETcCWwvBb"}):e({defaultMessage:"Exclusive access for subscribers",id:"1LB4QwRSMw"}),[oe.STUDY]:e({defaultMessage:"Ask questions and learn",id:"8RzCMAs2/c"})},y=h[m??oe.SEARCH],x=g[m??oe.SEARCH],b={[oe.SEARCH]:ft.TRY_COPILOT,[oe.RESEARCH]:ft.TRY_RESEARCH,[oe.STUDIO]:ft.TRY_LABS}[m??oe.SEARCH]??ft.TRY_COPILOT;return o({pitchMessage:{title:y,description:x},origin:b}),!0}else return!1;else{if(u===ie.PRO&&a.unlimitedProSearch)return!1;const h={[oe.SEARCH]:e({defaultMessage:"Sign in to access Pro Search",id:"AARKXJYL5U"}),[oe.RESEARCH]:e({defaultMessage:"Sign in to access Perplexity Research",id:"D/01NxLK/G"}),[oe.STUDIO]:e({defaultMessage:"Sign in to try Perplexity Labs",id:"xJYMyIruMK"}),[oe.STUDY]:e({defaultMessage:"Sign in to access Perplexity Learn",id:"K0eM+R/Zew"})},g={[oe.SEARCH]:e({defaultMessage:"10x as many citations in answers",id:"D0fULpN8/D"}),[oe.RESEARCH]:e({defaultMessage:"Deep research and analysis on any topic",id:"vZzVhXmhZo"}),[oe.STUDIO]:e({defaultMessage:"Create projects from scratch, exclusive access for subscribers",id:"STPFx+8/sC"}),[oe.STUDY]:e({defaultMessage:"Step-by-step learning",id:"UGHOn5vTUx"})},y=h[m??oe.SEARCH],x=g[m??oe.SEARCH];return n({title:y,description:x,origin:ft.TRY_PRO}),!0}},[e,s,t,o,n,r,a.unlimitedProSearch]),c=d.useCallback(u=>s(u)?!1:(t?o({pitchMessage:{title:e({defaultMessage:"Choose a model",id:"fXlc3idTcy"}),description:e({defaultMessage:"With Perplexity Pro, you get access to all the latest AI models in one subscription",id:"gqUZUJex7f"})},origin:ft.MODEL_SELECTOR}):n({title:e({defaultMessage:"Sign in to choose a model",id:"BhbQUiYsTB"}),description:e({defaultMessage:"Access the latest AI models from Perplexity, OpenAI, Anthropic (Claude), Google Gemini and more",id:"DDVABeGeBG"}),origin:ft.MODEL_SELECTOR}),!0),[s,t,o,n,e]);return d.useMemo(()=>({gateSearchModeSelection:i,gateSearchModelSelection:c}),[i,c])}const M8e=()=>{const{gpt4Limit:e}=Vn(),{specialCapabilities:t}=Yr(),{hasAccessToProFeatures:n}=$t();return d.useCallback(()=>!t.unlimitedProSearch&&(!e.available||!n)?ie.DEFAULT:ie.PRO,[e,n,t.unlimitedProSearch])};function T8e(){const e=Vo(),{setPreferredSearchModel:t}=Hx(),{setConfiguredModel:n,setConfiguredSearchMode:r}=Vn(),{gateSearchModelSelection:s}=vg(),o=M8e();return d.useCallback((a=o(),i=e)=>{s(a)||(t(i,a),n(a),r(i))},[e,s,o,t,n,r])}function bg(){const e=T8e(),{device:{isWindowsApp:t}}=sn(),{safeWindowsIpcPublish:n,safeWindowsIpcSubscribe:r}=Xh(),s=d.useRef(e);d.useEffect(()=>{s.current=e},[e]);const o=d.useRef(r);return d.useEffect(()=>{o.current=r},[r]),d.useEffect(()=>{if(!t)return;const i=o.current(nd,c=>{c.type===nd&&s.current(c.model,c.searchMode)});return()=>{i?.()}},[t]),d.useCallback((i,c)=>{n(nd,{type:nd,model:i,searchMode:c}),s.current(i,c)},[n])}function Sp(e){if(e.exactCount!==void 0&&e.exactCount>=0&&e.exactCount<=10)return e.exactCount}function Ai(e){switch(e){case oe.SEARCH:return ie.PRO;case oe.RESEARCH:return ie.ALPHA;case oe.STUDIO:return ie.BETA;case oe.STUDY:return ie.STUDY;default:return ie.PRO}}const dY=A.memo(e=>{const{isFollowUp:t,value:n,onChange:r,buttonSize:s="small",variant:o="primaryGhost"}=e,a=Wf(),{$t:i}=J(),c=bg(),u=Vo(),f=d.useMemo(()=>n!==void 0?an(n):u,[n,u]),{isMax:m,hasAccessToProFeatures:p}=$t(),h=Wt(),{gpt4Limit:g,pplxAlphaLimit:y,pplxBetaLimit:x}=Vn(),{specialCapabilities:v}=Yr(),{preferredSearchModels:b,setPreferredSearchModel:_}=Hx(),w=ui(),S=hv(),{isMaxUpsellEnabled:C}=$x(),[E,T]=d.useState(()=>{const F=b[oe.SEARCH];return v.unlimitedProSearch?!0:F===ie.DEFAULT?!1:h});E&&!g.available&&!v.unlimitedProSearch&&T(!1);const{gateSearchModeSelection:k}=vg(),I=d.useCallback(()=>{k(ie.BETA,!0)},[k]),M=d.useCallback(F=>k(F?ie.PRO:ie.DEFAULT)?(T(!1),_(oe.SEARCH,ie.DEFAULT),!1):(T(F),_(oe.SEARCH,F?ie.PRO:ie.DEFAULT),F),[_,k]),N=d.useCallback(F=>{let R;switch(F){case oe.SEARCH:{E?R=b[F]??Ai(F):R=ie.DEFAULT;break}case oe.RESEARCH:{C?R=b[F]??Ai(F):R=Ai(F);break}case oe.STUDIO:{C?R=b[F]??Ai(F):R=Ai(F);break}default:{R=ie.DEFAULT;break}}if(!S(R)){k(R);return}r?r(R):c(R,F)},[C,E,r,b,c,S,k]),D=d.useMemo(()=>{const F=Sp(g),R=Sp(y),P=Sp(x);function L(O,$){return{active:f===O,description:i(Nr[O].description),icon:t3(O),onClick(){N(O)},text:i(Nr[O].name),type:"default",...$}}const U=[];return U.push(L(oe.SEARCH,{customDescriptionNode:p?void 0:l.jsxs(l.Fragment,{children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(je,{...Nr[oe.SEARCH].description})}),l.jsxs("div",{className:"gap-md flex flex-col",children:[l.jsx("hr",{className:"border-subtler bg-subtler -mr-5 mt-3"}),l.jsxs("div",{className:"gap-sm -mr-5 flex items-start justify-between",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx("button",{onClick:()=>{k(v.unlimitedProSearch?ie.PRO:ie.SONAR)},type:"button",children:l.jsx(V,{className:"font-medium underline",color:"super",variant:"tiny",children:l.jsx(je,{defaultMessage:"Try Pro Search",id:"akAejIEhqZ"})})}),l.jsx(fy,{isMax:m,className:"h-2.5"})]}),l.jsx(V,{className:"italic",color:"super",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"Advanced search with 10x the sources",id:"MZLTMODV37"})}),h&&F!==void 0&&!m&&l.jsx(V,{className:"mt-1 font-light",color:"super",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:F}})})]}),l.jsx(fY,{isProSearchEnabled:E,selectSearchModel:c,selectedSearchMode:f,setIsProSearchEnabled:M})]})]})]}),customTextNode:l.jsx(V,{variant:"smallBold",children:l.jsx(je,{...Nr[oe.SEARCH].name})})})),U.push(L(oe.RESEARCH,{customTextNode:l.jsxs("div",{className:"gap-sm mt-px flex items-center",children:[l.jsx(V,{variant:"smallBold",children:l.jsx(je,{...Nr[oe.RESEARCH].name})}),l.jsx(fy,{isMax:m||a(oe.RESEARCH),className:"h-2.5"})]}),customDescriptionNode:l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(je,{...Nr[oe.RESEARCH].description})}),h&&R!==void 0&&!m&&l.jsxs("div",{children:[l.jsx(V,{color:"super",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:R}})}),a(oe.RESEARCH)&&l.jsx(Ge,{onClick:I,variant:"common",size:"small",fullWidth:!0,extraCSS:"mt-sm",text:i({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})})]})]})})),U.push(L(oe.STUDIO,{customTextNode:l.jsxs("div",{className:"gap-sm mt-px flex items-center",children:[l.jsx(V,{variant:"smallBold",children:l.jsx(je,{...Nr[oe.STUDIO].name})}),l.jsx(fy,{isMax:m||a(oe.STUDIO),className:"h-2.5"})]}),customDescriptionNode:l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(V,{className:"whitespace-pre-wrap",variant:"tinyRegular",color:"light",children:l.jsx(je,{...Nr[oe.STUDIO].description})}),h&&P!==void 0&&!m&&l.jsxs("div",{children:[l.jsx(V,{color:"max",variant:"tinyRegular",children:l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining this month} other {# queries remaining this month}}",id:"wlPH+sOjjI",values:{limit:P}})}),a(oe.STUDIO)&&l.jsx(Ge,{onClick:I,variant:"common",size:"small",fullWidth:!0,extraCSS:"mt-sm",text:i({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})})]})]})})),U},[p,m,h,g,E,c,f,M,y,a,I,i,x,N,k,v.unlimitedProSearch]),j=d.useMemo(()=>l.jsx(ge,{icon:B("chevron-down"),size:"xs",className:z("-mx-xs -mb-two opacity-50",{"-ml-sm":t})}),[t]);return l.jsx(zs,{isMobileStyle:w,items:D,placement:"bottom-start",children:l.jsx(Ge,{icon:t3(f),size:s,text:t?l.jsx(l.Fragment,{children:"​"}):i(Nr[f].name),variant:o,trailingComponent:j})})});dY.displayName="SearchModeDropdownMenu";const fY=A.memo(({isProSearchEnabled:e,selectSearchModel:t,selectedSearchMode:n,setIsProSearchEnabled:r})=>{const{$t:s}=J(),o=d.useCallback(i=>{r(i)&&n===oe.SEARCH&&t(i?ie.PRO:ie.DEFAULT)},[t,n,r]),a=d.useMemo(()=>({onClick(i){i.stopPropagation()}}),[]);return l.jsx(fg,{checked:e,onCheckedChange:o,"aria-label":s({defaultMessage:"Enable Pro Search",id:"4oWk17uURl"}),...a})});fY.displayName="SwitchFactory";function aj(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function ti({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const s=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=d.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),i=d.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),c=e?typeof e=="number"?e:e.scroll:null,u=e?typeof e=="number"?e:e.resize:null,f=d.useRef(!1);d.useEffect(()=>(f.current=!0,()=>void(f.current=!1)));const[m,p,h]=d.useMemo(()=>{const v=()=>{if(!i.current.element)return;const{left:b,top:_,width:w,height:S,bottom:C,right:E,x:T,y:k}=i.current.element.getBoundingClientRect(),I={left:b,top:_,width:w,height:S,bottom:C,right:E,x:T,y:k};i.current.element instanceof HTMLElement&&r&&(I.height=i.current.element.offsetHeight,I.width=i.current.element.offsetWidth),Object.freeze(I),f.current&&!D8e(i.current.lastBounds,I)&&a(i.current.lastBounds=I)};return[v,u?aj(v,u):v,c?aj(v,c):v]},[a,r,c,u]);function g(){i.current.scrollContainers&&(i.current.scrollContainers.forEach(v=>v.removeEventListener("scroll",h,!0)),i.current.scrollContainers=null),i.current.resizeObserver&&(i.current.resizeObserver.disconnect(),i.current.resizeObserver=null),i.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",i.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",i.current.orientationHandler))}function y(){i.current.element&&(i.current.resizeObserver=new s(h),i.current.resizeObserver.observe(i.current.element),t&&i.current.scrollContainers&&i.current.scrollContainers.forEach(v=>v.addEventListener("scroll",h,{capture:!0,passive:!0})),i.current.orientationHandler=()=>{h()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",i.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",i.current.orientationHandler))}const x=v=>{!v||v===i.current.element||(g(),i.current.element=v,i.current.scrollContainers=mY(v),y())};return N8e(h,!!t),A8e(p),d.useEffect(()=>{g(),y()},[t,h,p]),d.useEffect(()=>g,[]),[x,o,m]}function A8e(e){d.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function N8e(e,t){d.useEffect(()=>{if(t){const n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[e,t])}function mY(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:s}=window.getComputedStyle(e);return[n,r,s].some(o=>o==="auto"||o==="scroll")&&t.push(e),[...t,...mY(e.parentElement)]}const R8e=["x","y","top","bottom","left","right","width","height"],D8e=(e,t)=>R8e.every(n=>e[n]===t[n]),Qd=[.4,0,.2,1],ij=10,pY=A.memo(e=>{const{children:t,tooltipContent:n,triggeredSearchModeElement:r,isOpen:s,setIsOpen:o}=e,{showSuggestDropdown:a}=qr(),[i,c]=d.useState(!1),u=s!==void 0?s:i,f=o||c,m=d.useRef(0),[p,h]=ti(),[g,y]=ti(),v=d.useCallback(()=>{const{left:E=0,width:T=0}=r?.getBoundingClientRect()??{};return h.width===0||E===0?0:E-h.left+T/2-ij/2},[h,r])();let b=v!==0;v!==0&&v!==m.current&&(b=m.current!==0,m.current=v);const _=d.useCallback(E=>{E||(m.current=0),f(E)},[f]),w=d.useCallback(E=>{E.preventDefault()},[]),S=d.useCallback(()=>{f(!1)},[f]),C=d.useCallback(E=>{E.preventDefault()},[]);return l.jsx(Mme,{delayDuration:a?1e3:400,skipDelayDuration:100,children:l.jsxs(LU,{onOpenChange:_,open:u,children:[l.jsx(Tme,{asChild:!0,className:"focus:outline-none",onBlur:S,onClick:w,onPointerDown:C,children:t}),l.jsx(Ame,{children:l.jsx(Nme,{className:"group/tooltip-content data-[state=closed]:animate-slideDownAndFadeOut data-[state=delayed-open]:animate-slideUpAndFadeIn ease-outExpo duration-300","data-color-scheme":"dark",sideOffset:4,side:"bottom",ref:p,children:l.jsxs(Te.div,{className:"bg-base shadow-overlay flex w-72 flex-col rounded-lg",animate:{height:y.height||void 0},transition:{duration:.05,ease:Qd},children:[l.jsxs(Te.div,{className:'absolute left-0 group-data-[side="bottom"]/tooltip-content:top-0 group-data-[side="top"]/tooltip-content:bottom-0',animate:{opacity:m.current?1:void 0,x:b?v:void 0},initial:{opacity:0},transition:{duration:.05,ease:Qd},style:{x:v,width:ij},children:[l.jsx(y7,{className:"fill-inverse"}),l.jsx(y7,{className:"fill-inverse -translate-y-px scale-[99%]"})]}),l.jsx("div",{className:"relative overflow-hidden",children:l.jsx("div",{className:"whitespace-normal",ref:g,children:n})})]})})})]})})});pY.displayName="SearchModeTooltip";const hY={[oe.SEARCH]:ie.DEFAULT,[oe.RESEARCH]:ie.ALPHA,[oe.STUDIO]:ie.BETA,[oe.STUDY]:ie.DEFAULT},gv=A.memo(e=>{const{children:t,className:n,searchMode:r,...s}=e,{gateSearchModeSelection:o}=vg();return l.jsx("button",{className:z("group",n),onClick:()=>{o(hY[r],!0)},type:"button",...s,children:l.jsx(V,{className:"!text-[var(--mode-color)] underline decoration-transparent transition-[text-decoration-color] group-hover:decoration-[var(--mode-color)]",variant:"smallBold",children:t})})});gv.displayName="SearchModeTooltipUpgradeButton";const yv=A.memo(e=>{const{badgeNode:t,color:n,enabledText:r,isEnabled:s,upgradeButton:o,isMaxUpsell:a=!1}=e;return l.jsxs("div",{className:"gap-sm flex items-center",style:{"--mode-color":n==="super"?"oklch(var(--super-color))":"oklch(var(--max-color))"},children:[t,s?l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(V,{className:"!text-[var(--mode-color)]",variant:"smallBold",children:r}),!a&&l.jsx(ut,{name:B("check"),className:"text-[var(--mode-color)]",size:18})]}):l.jsx(l.Fragment,{children:o})]})});yv.displayName="SearchModeTooltipFooter";const gY=A.memo(e=>{const{searchMode:t}=e,{$t:n}=J(),r=Wt(),{hasAccessToProFeatures:s}=$t(),{gateSearchModeSelection:o}=vg(),a=Wf(),{specialCapabilities:i}=Yr(),c=d.useCallback(()=>{o(hY[t],!0)},[o,t]);return a(t)?l.jsx(Ge,{onClick:c,variant:"maxGold",size:"small",fullWidth:!0,text:n({defaultMessage:"Upgrade to Max",id:"z+PtTMgM3T"})}):i.unlimitedProSearch||i.unlimitedResearch||r&&s||t===oe.STUDY?null:l.jsx(Ge,{onClick:c,variant:"primary",size:"small",fullWidth:!0,testId:"upgrade-to-pro-button",text:r?l.jsx(je,{defaultMessage:"Upgrade to Pro",id:"5N04mo7WNC"}):l.jsx(je,{defaultMessage:"Sign in for access",id:"w6mjA9GP58"})})});gY.displayName="SearchModeTooltipUpsellButton";const _g=A.memo(e=>{const{footerNode:t,includeNewBadge:n,searchMode:r}=e,{$t:s}=J();return l.jsxs("div",{className:"p-md flex flex-col gap-4",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs("div",{className:"relative",children:[l.jsx(V,{className:"text-box-trim-both",variant:"smallExtraBold",children:s(Nr[r].name)}),n&&l.jsx(K,{className:"absolute -right-1 -top-1 rounded-md px-2 py-1",variant:"subtle",children:l.jsx(V,{variant:"tiny",children:l.jsx(je,{defaultMessage:"New",id:"bW7B87wFFp"})})})]}),l.jsx(V,{variant:"small",className:"text-pretty",children:s(Nr[r].description)})]}),l.jsx("hr",{className:"border-subtler bg-subtler"}),l.jsx("div",{className:"gap-xs flex flex-col",children:t}),l.jsx(gY,{searchMode:r})]})});_g.displayName="SearchModeTooltipContentContainer";const xv=A.memo(({isMaxUpsell:e=!1})=>{const{isMax:t,isPro:n}=$t();return t||e?l.jsx(vA,{className:"text-max h-3"}):n?l.jsx(bA,{className:"text-super h-3"}):null});xv.displayName="SearchModeBadge";const _A=({isMax:e,isPro:t,isMaxUpsell:n=!1})=>e||n?"max":"super",yY=A.memo(e=>{const{isToggleActive:t,onToggleChange:n}=e,{$t:r}=J(),s=Wt(),{hasAccessToProFeatures:o,isMax:a,isPro:i}=$t(),{gpt4Limit:c}=Vn(),{specialCapabilities:u,isGovernmentRequestOrigin:f}=Yr(),m=(()=>{if(!s&&!u.unlimitedProSearch)return null;if(o||u.unlimitedProSearch)return f?l.jsx(je,{defaultMessage:"Unlimited access for government",id:"0JftsQv9MC"}):l.jsx(je,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"});const v=Sp(c);return v!==void 0?l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:v}}):null})(),p=d.useMemo(()=>l.jsx(xv,{}),[]),h=d.useMemo(()=>({onClick(v){v.stopPropagation()}}),[]),g=d.useMemo(()=>l.jsx(gv,{searchMode:oe.SEARCH,children:l.jsx(je,{defaultMessage:"Try Pro Search",id:"akAejIEhqZ"})}),[]),y=d.useMemo(()=>l.jsx(je,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[]),x=d.useMemo(()=>l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:"gap-xs flex w-full flex-col",children:[l.jsx(yv,{badgeNode:p,color:_A({isMax:a,isPro:i}),enabledText:y,isEnabled:o||u.unlimitedProSearch,upgradeButton:g}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(je,{defaultMessage:"Advanced search with 10x the sources; powered by top models",id:"IKFeqUH+w0"})}),m&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:m})]}),!o&&!u.unlimitedProSearch&&n&&l.jsx(fg,{checked:t,onCheckedChange:n,"aria-label":r({defaultMessage:"Enable Pro Search",id:"4oWk17uURl"}),...h})]}),[p,a,i,y,o,u.unlimitedProSearch,g,m,n,t,r,h]);return l.jsx(_g,{footerNode:x,searchMode:oe.SEARCH})});yY.displayName="ProSearchModeTooltip";const xY=A.memo(()=>{const e=Wt(),{hasAccessToProFeatures:t,isMax:n,isPro:r}=$t(),{gpt4Limit:s,pplxAlphaLimit:o}=Vn(),{specialCapabilities:a,isGovernmentRequestOrigin:i}=Yr(),c=Wf(),u=c(oe.RESEARCH),f=(()=>{if(!e&&!a.unlimitedResearch)return null;const y=s.exactCount!==void 0&&o.exactCount!==void 0?Math.min(s.exactCount,o.exactCount):void 0;if(y!==void 0&&y<0||c(oe.RESEARCH))return null;if(a.unlimitedResearch&&i)return l.jsx(je,{defaultMessage:"Unlimited access for government",id:"0JftsQv9MC"});if(n)return l.jsx(je,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"});const x=Sp(o);return x!==void 0?l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining today} other {# queries remaining today}}",id:"ooxxk0PKGd",values:{limit:x}}):l.jsx(je,{defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"})})(),m=d.useMemo(()=>l.jsx(xv,{isMaxUpsell:u}),[u]),p=d.useMemo(()=>u?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[u]),h=d.useMemo(()=>l.jsx(gv,{searchMode:oe.RESEARCH,children:e?u?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Extended access for subscribers",id:"ATGyCTI4+V"}):l.jsx(je,{defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"})}),[e,u]),g=d.useMemo(()=>l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(yv,{badgeNode:m,color:_A({isMax:n,isPro:r,isMaxUpsell:u}),enabledText:p,isEnabled:t||a.unlimitedResearch,upgradeButton:h,isMaxUpsell:u}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(je,{defaultMessage:"In-depth reports with more sources, charts, and advanced reasoning",id:"9V0OqZ9HGl"})}),f&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:f})]}),[m,p,t,n,r,u,f,h,a.unlimitedResearch]);return l.jsx(_g,{footerNode:g,searchMode:oe.RESEARCH})});xY.displayName="ResearchModeTooltip";const vY=A.memo(()=>{const e=Wt(),{hasAccessToProFeatures:t,isMax:n,isPro:r}=$t(),{pplxBetaLimit:s}=Vn(),o=Wf(),a=o(oe.STUDIO),i=e?t?!s.available||o(oe.STUDIO)?null:n?l.jsx(je,{defaultMessage:"Unlimited access for subscribers",id:"EvvPQiWwUI"}):s.exactCount?l.jsx(je,{defaultMessage:"{limit, plural, one {# query remaining this month} other {# queries remaining this month}}",id:"wlPH+sOjjI",values:{limit:s.exactCount}}):null:l.jsx(je,{defaultMessage:"Upgrade to get access",id:"eRbSgHbjUP"}):null,c=d.useMemo(()=>l.jsx(xv,{isMaxUpsell:a}),[a]),u=d.useMemo(()=>a?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Enabled",id:"V52jNnY+6M"}),[a]),f=d.useMemo(()=>l.jsx(gv,{searchMode:oe.STUDIO,children:e?a?l.jsx(je,{defaultMessage:"Unlimited access with Max",id:"ARAQvr+fwO"}):l.jsx(je,{defaultMessage:"Access for subscribers only",id:"Ez3b/pzas/"}):l.jsx(je,{defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"})}),[e,a]),m=d.useMemo(()=>l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(yv,{badgeNode:c,color:_A({isMax:n,isPro:r,isMaxUpsell:a}),enabledText:u,isEnabled:t,upgradeButton:f,isMaxUpsell:a}),l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:a?l.jsx(je,{defaultMessage:"Draft, design, deliver your ideas.",id:"I1aIhz4l3D"}):l.jsx(je,{defaultMessage:"Turn your ideas into completed docs, slides, dashboards, and more",id:"WRu1tcOhoj"})}),i&&l.jsx(V,{color:"default",variant:"small",className:"mt-xs opacity-60",children:i})]}),[c,u,t,n,r,a,i,f]);return l.jsx(_g,{footerNode:m,searchMode:oe.STUDIO,includeNewBadge:!0})});vY.displayName="StudioModeTooltip";const bY=A.memo(()=>{const e=A.useMemo(()=>l.jsx("div",{children:l.jsx(V,{color:"default",variant:"small",className:"text-pretty",children:l.jsx(je,{defaultMessage:"Interactive learning and study tools that guide you toward deeper understanding beyond quick answers. ",id:"ZRKKxSc+oV"})})}),[]);return l.jsx(_g,{footerNode:e,searchMode:oe.STUDY,includeNewBadge:!0})});bY.displayName="StudyModeTooltip";const _Y=()=>{const{base:e}=Rn(),t=On();return t===(e||"/")||t?.startsWith("/welcome")||t?.startsWith("/finance")};var wA="Radio",[j8e,wY]=Vs(wA),[I8e,P8e]=j8e(wA),CY=d.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:o,disabled:a,value:i="on",onCheck:c,form:u,...f}=e,[m,p]=d.useState(null),h=Sn(t,x=>p(x)),g=d.useRef(!1),y=m?u||!!m.closest("form"):!0;return l.jsxs(I8e,{scope:n,checked:s,disabled:a,children:[l.jsx(Et.button,{type:"button",role:"radio","aria-checked":s,"data-state":MY(s),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:h,onClick:rt(e.onClick,x=>{s||c?.(),y&&(g.current=x.isPropagationStopped(),g.current||x.stopPropagation())})}),y&&l.jsx(kY,{control:m,bubbles:!g.current,name:r,value:i,checked:s,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});CY.displayName=wA;var SY="RadioIndicator",EY=d.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,o=P8e(SY,n);return l.jsx(Hr,{present:r||o.checked,children:l.jsx(Et.span,{"data-state":MY(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});EY.displayName=SY;var O8e="RadioBubbleInput",kY=d.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=d.useRef(null),i=Sn(a,o),c=fT(n),u=uM(t);return d.useEffect(()=>{const f=a.current;if(!f)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&h){const g=new Event("click",{bubbles:r});h.call(f,n),f.dispatchEvent(g)}},[c,n,r]),l.jsx(Et.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kY.displayName=O8e;function MY(e){return e?"checked":"unchecked"}var L8e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vv="RadioGroup",[F8e]=Vs(vv,[Jl,wY]),TY=Jl(),AY=wY(),[B8e,U8e]=F8e(vv),NY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:o,required:a=!1,disabled:i=!1,orientation:c,dir:u,loop:f=!0,onValueChange:m,...p}=e,h=TY(n),g=Pf(u),[y,x]=fo({prop:o,defaultProp:s??null,onChange:m,caller:vv});return l.jsx(B8e,{scope:n,name:r,required:a,disabled:i,value:y,onValueChange:x,children:l.jsx(Zx,{asChild:!0,...h,orientation:c,dir:g,loop:f,children:l.jsx(Et.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:g,...p,ref:t})})})});NY.displayName=vv;var RY="RadioGroupItem",DY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,o=U8e(RY,n),a=o.disabled||r,i=TY(n),c=AY(n),u=d.useRef(null),f=Sn(t,u),m=o.value===s.value,p=d.useRef(!1);return d.useEffect(()=>{const h=y=>{L8e.includes(y.key)&&(p.current=!0)},g=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),l.jsx(Jx,{asChild:!0,...i,focusable:!a,active:m,children:l.jsx(CY,{disabled:a,required:o.required,checked:m,...c,...s,name:o.name,ref:f,onCheck:()=>o.onValueChange(s.value),onKeyDown:rt(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:rt(s.onFocus,()=>{p.current&&u.current?.click()})})})});DY.displayName=RY;var V8e="RadioGroupIndicator",jY=d.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=AY(n);return l.jsx(EY,{...s,...r,ref:t})});jY.displayName=V8e;const H8e=e=>{const t=mr(e);if(!t)return 0;const n=parseInt(t);return isNaN(n)?1:n},lj=(e,t)=>{lo(e,t.toString(),{expires:365})},z8e=({cueKey:e,impressionsLimit:t,enabled:n})=>{const[r,s]=d.useState(!1),[o,a]=d.useState(0);d.useEffect(()=>{if(!n){s(!1);return}const c=H8e(e);a(c),c{lj(e,t),a(t),s(!1)},[e,t]);return d.useMemo(()=>({shouldShow:r,currentCount:o,setReachedImpressions:i}),[r,o,i])},W8e={xs:"px-xs py-xxs",sm:"px-sm py-xs"},G8e=e=>{switch(e){case"common":return{background:"dark bg-base",titleText:"!text-light font-semibold",subtitleText:"!text-light mt-xxs opacity-90",arrow:"dark fill-base [&>path]:stroke-subtler dark:[&>path]:stroke-1 [clip-path:inset(1px_1px_0px_1px)]",borderRadius:"rounded-md"};default:return{background:"!bg-super !shadow-none",titleText:"!text-inverse",subtitleText:"!text-inverse mt-xs opacity-90",arrow:"fill-super",borderRadius:"rounded-md"}}},bv=A.memo(({cueKey:e,title:t,subtitle:n,children:r,enabled:s,impressionsLimit:o=1,variant:a="primary",size:i="xs",placement:c="bottom",sideOffset:u=10,className:f})=>{const[m,p]=d.useState(!1),{shouldShow:h}=z8e({cueKey:e,impressionsLimit:o,enabled:s}),g=G8e(a),y=h&&!m,x=()=>!t&&!n?null:l.jsxs("div",{className:z(W8e[i],f),children:[t&&l.jsx(V,{variant:"tiny",className:g.titleText,children:t}),n&&l.jsx(V,{variant:"tiny",className:g.subtitleText,children:n})]}),v=d.useCallback(()=>{p(!0)},[]),b=d.useMemo(()=>({removeScroll:!1,animationClassName:"z-[2000]"}),[]);return l.jsx(Vf,{content:x(),contentClassName:g.background,arrowClassName:g.arrow,borderRadius:g.borderRadius,isOpen:s&&y,onClose:v,placement:c,sideOffset:u,overlayProps:b,children:r})});bv.displayName="Cue";const CA=A.memo(e=>{const{className:t="",layoutKey:n="",options:r,value:s,backgroundClassName:o="",radioGroupIndicatorClassName:a="",variant:i="default",areCuesEnabled:c=!1,...u}=e,f=(()=>{switch(i){case"subtle":return"";case"default":return"bg-white dark:bg-black dark:bg-gradient-to-b dark:from-super/20 dark:to-super/20";default:At(i)}})(),{$t:m}=J(),p=d.useMemo(()=>({study:m({defaultMessage:"Learn Mode",id:"vuxvUxbYvn"})}),[m]),h=d.useMemo(()=>r.map(y=>{const x=y.value===s;return l.jsx(bv,{cueKey:`segmented-control-${y.value}`,enabled:!!p[y.value]&&c,placement:"top",title:p[y.value],children:l.jsxs(DY,{...y.elementProps,"aria-label":y.label,disabled:y.disabled??void 0,className:"segmented-control group/segmented-control relative focus:outline-none",value:y.value,children:[x&&l.jsx(jY,{asChild:!0,className:z("pointer-events-none absolute inset-0 z-0 block",f,"border-super dark:border-super/30 border","rounded-lg","shadow-super/30 dark:shadow-super/5 shadow-[0_1px_3px_0]","dark:text-super","transition-colors duration-300","group-focus-visible/segmented-control:border-dashed",a),children:l.jsx(Te.div,{layoutId:`segmented-control-active-indicator-${n}`,transition:{duration:.1}})}),y.children]})},y.value)}),[r,s,p,c,f,a,n]),g=(()=>{switch(i){case"subtle":return"bg-subtle";case"default":return"bg-super/10 dark:bg-black/[0.18]";default:At(i)}})();return l.jsxs(NY,{...u,className:z("group relative isolate flex h-fit",t),value:s,children:[l.jsx("div",{className:z("absolute inset-0",g,"dark:border dark:border-black/[0.04]","rounded-[10px]","transition-colors duration-300",o)}),l.jsx("div",{className:"p-two flex shrink-0 items-center",children:h})]})});CA.displayName="SegmentedControl";const SA=A.memo(e=>{const{className:t="",isActiveOption:n,icon:r,label:s,activeColor:o="text-super"}=e,a=z("transition-colors duration-300",{[o]:n,"text-quiet group-hover/segmented-control:text-foreground":!n});return l.jsxs("div",{className:z("relative z-10 flex h-8 min-w-9 items-center justify-center",{"py-xs gap-xs px-2.5":n||s},t),children:[r&&l.jsx(gp,{buttonSize:"small",icon:r,iconClassName:z(a),showClicked:!1}),s&&l.jsx("div",{className:z("px-two font-sans text-sm leading-[1.125rem]",a),children:s})]})});SA.displayName="SegmentedControlOption";const IY=A.memo(e=>{const{isFollowUp:t,layoutKey:n,value:r,onChange:s,className:o,variant:a}=e,i=Vo(),c=d.useMemo(()=>r!==void 0?an(r):i,[r,i]),{$t:u}=J(),f=bg(),m=On(),{inputRef:p}=qr(),{gpt4Limit:h}=Vn(),{specialCapabilities:g}=Yr(),y=_Y(),x=sW(),{currentOpenedModal:v}=pn().legacy,{preferredSearchModels:b,setPreferredSearchModel:_}=Hx(),[w,S]=d.useState(oe.SEARCH),C=d.useRef(null),[E,T]=d.useState(!1),k=d.useRef(null);d.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]);const{gateSearchModeSelection:I}=vg(),[M,N]=d.useState(!1);d.useEffect(()=>{if(!h.available&&!g.unlimitedProSearch)N(!1);else if(g.unlimitedProSearch)N(!0);else if(h.available){const G=b[oe.SEARCH];G&&G!==ie.DEFAULT&&N(!0)}},[h.available,g.unlimitedProSearch,b]);const D=d.useCallback(G=>I(G?ie.PRO:ie.DEFAULT)?(N(!1),_(oe.SEARCH,ie.DEFAULT),!1):(N(G),_(oe.SEARCH,G?ie.PRO:ie.DEFAULT),G),[_,I]),j=d.useCallback(G=>{switch(G){case oe.SEARCH:return M?b[G]??Ai(G):ie.DEFAULT;case oe.RESEARCH:return b[G]??Ai(G);case oe.STUDIO:return b[G]??Ai(G);case oe.STUDY:return ie.STUDY}},[M,b]),F=hv(),R=F(ie.STUDY),P=d.useCallback(G=>{const H=j(G);F(H)?(s?s(H):f(H,G),p.current?.focus(),T(!1)):I(H)},[F,I,j,p,s,f,T]),L=d.useCallback(G=>{if(D(G),c===oe.SEARCH){const H=G?ie.PRO:ie.DEFAULT;s?s(H):f(H)}},[s,f,c,D]),U=d.useMemo(()=>{const G=R?uR:uR.filter(Q=>Q!==oe.STUDY);function H(Q){const{searchMode:Y}=Q,te=j(Y),se=G.length<3&&!t;return{children:l.jsx("div",{children:l.jsx(SA,{label:se?l.jsx(je,{...Nr[Y].name}):void 0,icon:t3(Y),isActiveOption:c===Y})}),elementProps:{"aria-label":u(Nr[Y].name),"aria-disabled":F(te)===!1?!0:void 0,onPointerEnter(ae){k.current&&clearTimeout(k.current),C.current=ae.currentTarget,S(Y),k.current=setTimeout(()=>{T(!0)},800)},onPointerLeave(){k.current&&(clearTimeout(k.current),k.current=null)},onClick(){k.current&&(clearTimeout(k.current),k.current=null),p.current?.focus(),T(!1)}},label:u(Nr[Y].name),value:Y}}return G.map(Q=>H({searchMode:Q}))},[j,t,u,c,F,p,R]);let O;switch(w){case oe.SEARCH:{O=l.jsx(yY,{isToggleActive:M,onToggleChange:L});break}case oe.RESEARCH:{O=l.jsx(xY,{});break}case oe.STUDIO:{O=l.jsx(vY,{});break}case oe.STUDY:{O=l.jsx(bY,{});break}}const $=d.useCallback(G=>{G.target.tagName===document.activeElement?.tagName&&(C.current=G.target,S(c),T(!0))},[c]);return l.jsx(pY,{tooltipContent:O,triggeredSearchModeElement:C.current,isOpen:E,setIsOpen:T,children:l.jsx(CA,{layoutKey:`segmented-search-mode-selector_${n??m}`,options:U,onFocus:$,onValueChange:P,value:c,className:o,variant:a,areCuesEnabled:y&&!x&&!v})})});IY.displayName="SegmentedSearchModeSelector";const PY="(pointer: coarse)";function cj(){return typeof window>"u"?!1:window.matchMedia(PY).matches}function $8e(){const e=ui(),[t,n]=d.useState(()=>cj()||e);return d.useLayoutEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(PY);function s(){n(cj())}return r.addEventListener("change",s),s(),function(){r.removeEventListener("change",s)}},[]),t}const OY=A.memo(({isFollowUp:e,layoutKey:t,value:n,onChange:r,className:s,buttonSize:o,variant:a="default"})=>{const i=$8e(),c=ui();if(i||c){const u=(()=>{switch(a){case"default":return"primaryGhost";case"subtle":return"common"}})();return l.jsx(dY,{isFollowUp:e,value:n,onChange:r,buttonSize:o,variant:u})}else return l.jsx(IY,{isFollowUp:e,layoutKey:t,value:n,onChange:r,className:s,variant:a})});OY.displayName="SearchModeSelector";const q8e=A.memo(({size:e,inverse:t,incognitoType:n=t2.DEFAULT})=>l.jsx(K,{variant:"background",className:z("w-lg text-foreground flex aspect-square shrink-0 items-center justify-center rounded-full border",{"!w-[24px]":e==="small","!w-[16px]":e==="tiny"},{"!bg-inverse !text-inverse border-0":t}),children:n===t2.GOVERNMENT?l.jsx("svg",{width:e==="tiny"?"10":e==="small"?"12":"16",height:"auto",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fill:"currentColor",d:"M2.75 12.5h2.5v-7h1.5v7h2.5v-7h1.5v7h2.5v-7h1.5v7H16V14H0v-1.5h1.25v-7h1.5zM16 3v1.5H0V3l8-3z"})}):l.jsx("svg",{width:e==="tiny"?"12":e==="small"?"16":"24",height:"auto",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1927 4.54688C11.4375 4.71875 11.651 4.86458 12 4.86458C12.3453 4.86458 12.5529 4.72184 12.7993 4.55235L12.8073 4.54688L12.8084 4.54609C13.152 4.31187 13.5635 4.03125 14.5 4.03125C16.0885 4.03125 17.2083 6.30729 17.9375 8.6875C20.401 9.14062 22 9.875 22 10.6979C22 11.4427 20.6979 12.1094 18.6354 12.5677C18.6562 12.776 18.6667 12.9844 18.6667 13.1979C18.6667 14.0833 18.4948 14.9271 18.1823 15.6979H18.1965C17.2165 18.1697 14.8115 19.9169 12 19.9169C9.18854 19.9169 6.78355 18.1697 5.80356 15.6979H5.81771C5.50521 14.9271 5.33333 14.0833 5.33333 13.1979C5.33333 12.9844 5.34375 12.776 5.36458 12.5677C3.30208 12.1094 2 11.4427 2 10.6979C2 9.875 3.59896 9.14062 6.0625 8.6875C6.79167 6.30729 7.91146 4.03125 9.5 4.03125C10.4365 4.03125 10.848 4.31187 11.1916 4.54609L11.1927 4.54688ZM14.2708 15.6979H14.9167C16.0677 15.6979 17 14.7656 17 13.6146V12.8646C15.5312 13.0781 13.8229 13.1979 12 13.1979C10.1771 13.1979 8.46875 13.0781 7 12.8646V13.6146C7 14.7656 7.93229 15.6979 9.08333 15.6979H9.73437C10.5885 15.6979 11.3542 15.1458 11.625 14.3333C11.7448 13.9687 12.2604 13.9687 12.3802 14.3333C12.651 15.1458 13.4115 15.6979 14.2708 15.6979Z",fill:"currentColor"})})}));q8e.displayName="IncognitoIcon";function ph(){return ph=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.jsx(V,{variant:"tiny",children:l.jsx("span",{className:"text-caution",children:e})}));BY.displayName="FormError";const _v=A.memo(({label:e,labelVariant:t="smallBold",subtitle:n,errorText:r,isOptional:s=!1,withMargin:o=!0,optionalLabel:a="optional",testId:i})=>e||r||n?l.jsxs("div",{className:z({"mb-sm":o}),"data-test-id":i,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[(e||n)&&l.jsx("label",{htmlFor:e,children:l.jsx("div",{className:"gap-y-xs flex flex-col",children:e&&l.jsxs("div",{className:"gap-x-xs flex",children:[l.jsx(V,{variant:t,className:"select-none",children:e}),s&&l.jsx(V,{variant:"small",color:"light",children:`(${a})`})]})})}),r&&l.jsx(BY,{text:r})]}),n&&l.jsx(V,{variant:"small",color:"light",children:n})]}):null);_v.displayName="FormItemHeader";class Ls{static isEnterKey(t){return t.code==="Enter"||t.key==="Enter"||t.keyCode===13}static isEnterKeyWithoutShift(t){return this.isEnterKey(t)&&!t.shiftKey}static isArrowDown(t){return t.key==="ArrowDown"}static isArrowUp(t){return t.key==="ArrowUp"}static isEscapeKey(t){return t.key==="Escape"}static isTabKey(t){return t.key==="Tab"}static isOnlySlashKey(t){return t.key==="/"&&!t.metaKey&&!t.ctrlKey&&!t.altKey}static isCtrlOrCmdJ(t){return(t.metaKey||t.ctrlKey)&&t.key==="j"}}const hh=(e,t)=>{if(Ls.isEnterKeyWithoutShift(e)){if(t.isComposing||e.keyCode===229){e.preventDefault();return}if(t.isMobileUserAgent||t.allowEnterNewlines)return;e.preventDefault()}t.onKeyDown?.(e)},kA=e=>{e(!0)},MA=e=>{setTimeout(()=>{e(!1)},0)};var Ep;(function(e){e.INLINE="inline",e.LABEL="label"})(Ep||(Ep={}));const c7e=({onClear:e})=>l.jsx(st,{icon:B("x"),pill:!0,onClick:e,size:Ht.small}),u7e=["email","tel"],co=A.memo(({type:e,className:t,wrapperClassName:n,value:r,name:s,maxLength:o,errorText:a,errorPlacement:i=Ep.INLINE,disabled:c=!1,required:u=!1,autoFocus:f=!1,placeholder:m="",rightItems:p=Pe,onChange:h,onClear:g,onBlur:y,onFocus:x,onPaste:v,onKeyDown:b,isLoading:_,inlineEditBlock:w,label:S,subtitle:C,isOptional:E,isMobileUserAgent:T,labelMargin:k=!0,testId:I,variant:M,disable1pass:N,ClearIcon:D=c7e,enterKeyHint:j,size:F,ref:R,colorVariant:P="default",min:L,max:U,spellCheck:O})=>{const $=Zl(c),G=d.useRef(null),[H,Q]=d.useState(!1),[Y,te]=d.useState(!1),se=d.useRef(H);se.current=H,d.useEffect(()=>{!T&&f&&G.current?.focus()},[T,G,f]),d.useEffect(()=>{$!==c&&!c&&!T&&f&&setTimeout(()=>{G.current?.focus()},200)});const ae=d.useMemo(()=>z({"border-r mr-sm pr-xs border-subtler":p.length!=0}),[p.length]),X=d.useMemo(()=>{const De=(()=>{switch(P){case"default":return"bg-base dark:bg-subtler";case"subtle":return"bg-subtle";default:At(P)}})(),xe=z("w-full outline-none focus:outline-none focus:ring-subtler font-sans flex items-center","text-foreground caret-super selection:bg-super/50 dark:selection:bg-super/10 dark:selection:text-super",De,"border border-subtler focus:ring-1 placeholder-quieter","duration-200 transition-all","rounded-lg",{"ring-subtler ring-1":H},t),Ue=z({"py-xs px-sm text-xs placeholder:text-xs":F==="xs","py-sm px-sm text-sm placeholder:text-sm":F==="sm","py-lg px-xl text-lg placeholder:text-base":F==="lg","pl-[40px]":e==="search","!font-mono md:text-base":M==="monospace","!text-3xl !placeholder:text-3xl !font-medium":M==="page-title","py-sm md:text-sm px-md placeholder:text-sm":!F&&!M}),Ee=z({"pr-xs":p.length===0&&F==="xs","pr-sm":p.length===0&&F==="sm","pr-md":p.length===0&&!F,"pr-lg":p.length===0&&F==="lg","pr-[49px] md:pr-[59px]":p.length===1,"pr-[128px] md:pr-[138px]":p.length===2});return z(xe,Ue,Ee)},[H,t,F,e,M,p.length,P]),ee=!!a,le=!ee&&!!o&&!!r&&r.length>o,re=d.useMemo(()=>e==="search"?l.jsx("div",{className:"absolute left-3 flex items-center rounded-l-lg",children:l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("search")})})}):null,[e]),ce=d.useMemo(()=>{const De=i===Ep.INLINE&ⅇreturn l.jsxs("div",{className:"right-sm gap-sm absolute flex items-center rounded-full",children:[_?l.jsx(V,{color:"light",className:"mr-xs",children:l.jsx(Gl,{})}):null,De&&l.jsx(K,{className:"mr-sm",children:l.jsx(V,{color:"red",variant:"tiny",children:a})}),le&&l.jsx(K,{className:"mr-sm",children:o&&r&&l.jsx(V,{color:"red",variant:"tiny",children:o-r.length})}),g&&l.jsx("div",{className:ae,children:l.jsx(D,{onClear:g,inputValue:r})}),p.map((xe,Ue)=>l.jsx(Ge,{...xe.buttonProps,size:xe.buttonProps.size,disabled:xe.buttonProps.disabled||ee||le,pill:!0},Ue))]})},[i,ee,_,a,le,o,r,g,ae,D,p]),ue=d.useCallback(()=>{if(G.current){const De=G.current.value.length;G.current.focus();try{G.current.setSelectionRange(De,De)}catch{}}},[]),me=d.useCallback(De=>{x?.(De.nativeEvent),Q(!0)},[x]),we=d.useCallback(De=>{y?.(De.nativeEvent),Q(!1)},[y]);d.useImperativeHandle(R,()=>{const De=G.current;return De.focusAtEnd=ue,De.isFocused=()=>se.current,De.inLine=()=>!0,De.append=xe=>{G.current&&(G.current.value+=xe)},De.scrollToEnd=()=>{G.current&&(G.current.scrollTop=G.current.scrollHeight)},De.trim=()=>{G.current&&(G.current.value=G.current.value.trim())},De.element=()=>G.current,De},[ue]),d.useEffect(()=>{f&&!T&&ue()},[f,ue,T]);const ye=d.useCallback(De=>{h?.(De.target.value)},[h]),_e=d.useCallback(De=>{hh(De.nativeEvent,{isMobileUserAgent:T,isComposing:Y,onKeyDown:b})},[b,T,Y]),ke=i===Ep.LABEL?a:void 0;return l.jsxs("div",{className:n,children:[l.jsx(_v,{label:S,subtitle:C,isOptional:E,errorText:ke,withMargin:k}),l.jsx("div",{className:"rounded-full",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("input",{type:e,ref:G,autoFocus:f,placeholder:m,disabled:c,value:r,required:u,name:s??S,onChange:ye,onKeyDown:_e,onCompositionStart:()=>kA(te),onCompositionEnd:()=>MA(te),onBlur:we,onFocus:me,onPaste:v,className:X,autoComplete:u7e.includes(e??"")?e:"off","data-test-id":I,"data-1p-ignore":N,enterKeyHint:j,min:L,max:U,spellCheck:O,maxLength:o}),re,ce]})}),w&&l.jsx("div",{className:"mt-sm flex justify-end",children:w})]})});co.displayName="Input";const d7e=250,UY=A.memo(({className:e,textClassName:t,iconClassName:n,emojiClassName:r,text:s,icon:o,color:a,truncate:i,variant:c,tooltipText:u})=>{const f=d.useMemo(()=>{if(o)switch(o.type){case"emoji":return l.jsx("span",{className:z("inline-block select-none",r),children:o.char});case"icon":{const m=o.icon;return l.jsx(ge,{icon:m,className:z("text-quiet inline-block shrink-0 rounded-sm",n)})}case"image":return l.jsx("i",{className:z("inline-block shrink-0 select-none rounded-sm bg-cover bg-center bg-no-repeat",n),style:{backgroundImage:`url(${o.url})`,fontSize:"0.78rem"}})}return null},[n,r,o]);return l.jsx(Io,{tooltipText:u,showTooltip:!!u,children:l.jsxs("span",{className:z("inline-flex min-w-0 items-center align-baseline",{"max-w-[168px]":i==="small","max-w-[208px]":i==="medium","max-w-[250px]":i==="large"},e),spellCheck:!1,children:[f,l.jsx(V,{className:z("inline-block min-w-0 truncate",t),color:a,as:"span",variant:c,children:s})]})})});UY.displayName="MentionNodeTextContent";const VY=A.memo(e=>l.jsx(UY,{...e,className:"px-sm border-subtlest bg-subtler dark:bg-subtle rounded-md border-[0.2px]",textClassName:"leading-[1.3]",iconClassName:"mr-1 h-[0.88rem] w-[0.88rem]",emojiClassName:"mr-1 text-[0.80rem]",truncate:"large"}));VY.displayName="MentionNodeDecorator";function f7e(e){const t=e.textContent,n=e.getAttribute("data-mention-uuid"),r=e.getAttribute("data-mention-variant"),s=e.getAttribute("data-mention-url")??void 0,o=e.getAttribute("data-mention-query-text")??void 0;return t!==null&&n!==null&&r!==null?{node:HY({uuid:n,variant:r,text:t,url:s,queryText:o})}:null}class wv extends xpe{__props;static getType(){return"mention"}static clone(t){return new wv(t.__props,t.__key)}static importJSON(t){return HY(t.props).updateFromJSON(t)}constructor(t,n){super(n),this.__props=t}exportJSON(){return{...super.exportJSON(),props:this.__props}}createDOM(){return document.createElement("span")}isIsolated(){return!0}updateDOM(){return!1}decorate(){return l.jsx(VY,{text:this.__props.text,icon:this.__props.icon,tooltipText:ny(this.__props.queryText??"",d7e)})}getTextContent(){switch(this.__props.variant){case"shortcut":return this.__props.queryText??"";case"tab":return this.__props.url?`[${this.__props.text||this.__props.url}](${this.__props.url})`:this.__props.text;case"space":case"source":default:return this.__props.text}}exportDOM(){const t=document.createElement("span");return t.setAttribute("data-mention-uuid",this.__props.uuid),t.setAttribute("data-mention-variant",this.__props.variant),t.setAttribute("data-mention-url",this.__props.url??""),t.textContent=this.__props.text,{element:t}}static importDOM(){return{span:t=>!t.hasAttribute("data-mention-uuid")||!t.hasAttribute("data-mention-variant")?null:{conversion:f7e,priority:4}}}}function HY(e){return vpe(new wv(e))}const zY=[wv,bpe,ZU],WY=[..._pe],tE=(()=>{try{return new RegExp("(?{if(!e)return"";const n=Cpe({namespace:"text-value",nodes:zY});return n.update(()=>{const r=gl();r.clear(),tE?nE(e):r.append(HS().append(zS(e)))},{discrete:!0}),n.read(()=>gl().getTextContent())},nE=(e,t)=>{wpe(e.replace(/\\/g,"\\\\"),WY,t,!0)},km=e=>{if(!e||!e.root)return"";const t=n=>{let r="";if(n.type==="text"&&"text"in n)r=n.text;else if(n.type==="linebreak")r=` -`;else{if((n.type==="link"||n.type==="autolink")&&"url"in n)return r=`[${"children"in n&&Array.isArray(n.children)&&n.children.map(t).reduce((o,a)=>(o+=a,o),"")||""}](${n.url})`,r;if(n.type==="mention"){const o=n.props;if(o.variant==="tab")return r=`[${o.text||o.url}](${o.url})`,r;if(o.variant==="shortcut")return r=o.queryText??"",r;if(o.variant==="source"||o.variant==="space")return r=`@${o.text}`,r}}return"children"in n&&Array.isArray(n.children)?n.children.map(t).reduce((s,o)=>(s+=o,s),r):r};return t(e.root)},xr={outerWrapper:{base:["bg-raised","w-full","outline-none","flex","items-center","border","rounded-2xl"],darkMode:"dark:bg-offset",transition:"duration-75 transition-all"},inputWrapper:{base:"overflow-hidden relative flex h-full w-full",expanded:["col-start-1","col-end-4","pb-3"],compact:["flex-grow","flex-shrink","p-sm","order-1"],disabled:"opacity-50 pointer-events-none cursor-not-allowed"},inputElement:["overflow-auto","max-h-[45vh]","lg:max-h-[40vh]","sm:max-h-[25vh]","outline-none","font-sans","resize-none","caret-super","selection:bg-super/30","selection:text-foreground","dark:selection:bg-super/10","dark:selection:text-super","text-foreground","bg-transparent","placeholder-quieter","placeholder:select-none","scrollbar-subtle"],attribution:{left:{base:["gap-sm","flex"],expanded:"col-start-1 row-start-2 -ml-two",compact:"order-0 ml-px"},right:{base:["flex","items-center","justify-self-end"],expanded:"col-start-3 row-start-2",compact:"order-2 mr-px"}},placeholder:{base:["absolute","inset-0","pointer-events-none","select-none","text-quieter"],compact:"p-sm"}},p7e=({isActive:e,isHighlighted:t})=>t?"border-super dark:border-super/85":e?"border-subtle":"border-subtler",h7e=({hasShadow:e,hasQuote:t})=>e&&!t?"shadow-sm dark:shadow-md shadow-super/10 dark:shadow-black/10":"",GY=A.memo(({quote:e,onClear:t})=>e?l.jsx("div",{className:"py-sm bg-subtler dark:bg-base animate-slideDownAndFadeIn z-[49] mx-3 rounded-lg px-3",children:l.jsxs("div",{className:"gap-sm flex items-start",children:[l.jsx(V,{color:"light",className:"mt-px flex items-center pt-1",variant:"tinyRegular",children:l.jsx(ge,{icon:B("quote-filled"),size:"xs",className:"rotate-180"})}),l.jsx(V,{className:"py-xs line-clamp-3 flex-1 overflow-hidden text-ellipsis",variant:"tinyRegular",color:"light",children:e}),l.jsx("div",{className:"shrink-0",children:l.jsx(st,{icon:B("x"),onClick:t,size:"tiny",pill:!0,toolTip:"Clear quote"})})]})}):null);GY.displayName="QuotePreview";function hj(e){return!!(e.closest("button")||e.closest("a")||e.closest('[role="link"]')||e.closest('[role="button"]')||e.closest('[role="menuitem"]')||e.closest('[role="menuitemcheckbox"]'))}const g7e=Ce(async()=>{const{HistoryPlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a0),__vite__mapDeps([10,4,1])));return{default:e}}),y7e=Ce(async()=>{const{OnChangePlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a1),__vite__mapDeps([10,4,1])));return{default:e}}),x7e=Ce(async()=>{const{EditorRefPlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a2),__vite__mapDeps([10,4,1])));return{default:e}}),v7e=Ce(async()=>{const{default:e}=await Se(()=>q(()=>import("./MentionsPlugin-C_MEbdd2.js"),__vite__mapDeps([140,4,1,6,3,10,8,9,7,11,12])));return{default:e}}),b7e=Ce(async()=>{const{default:e}=await Se(()=>q(()=>import("./AutoLinkPlugin-CfSMttbN.js"),__vite__mapDeps([141,4,1,10,3,8,9,6,7,11,12])));return{default:e}}),_7e=Ce(async()=>{const{default:e}=await Se(()=>q(()=>import("./LinkPlugin-BKkOS3bN.js"),__vite__mapDeps([142,4,1,10])));return{default:e}}),w7e=Ce(async()=>{const{MarkdownShortcutPlugin:e}=await Se(()=>q(()=>import("./lexical-CQImCj-x.js").then(t=>t.a3),__vite__mapDeps([10,4,1])));return{default:e}});function C7e(e,t){switch(t.type){case"SET_EXPANDED":return{...e,isExpanded:t.payload};case"SET_ACTIVE":return{...e,isActive:t.payload};case"SET_COMPOSING":return{...e,isComposing:t.payload};default:return e}}const wg=Ft("ResizableInputContext",{state:{isExpanded:!0,isActive:!1,isComposing:!1},dispatch:()=>{}}),$Y=(e,t,n,r,s)=>{d.useEffect(()=>{const o=n?15:40;e&&e.length>o||e?.includes(` -`)?s(!0):r!==(t==="expanded")&&s(t==="expanded")},[e,t,n,r,s])},TA=A.memo(({initialLayout:e="expanded",wrapperClass:t,size:n,hasShadow:r,isHighlighted:s,isMobileUserAgent:o,quote:a,setQuote:i,attachmentsList:c,inputWarnings:u,children:f,inputRef:m,ref:p})=>{const[h,g]=d.useReducer(C7e,{isExpanded:e==="expanded",isActive:!1,isComposing:!1}),{isActive:y,isExpanded:x}=h,v=d.useMemo(()=>{const S=p7e({isActive:y,isHighlighted:s}),C=h7e({hasShadow:r,hasQuote:!!a});return z(...xr.outerWrapper.base,xr.outerWrapper.darkMode,xr.outerWrapper.transition,t,S,C,{"px-0 pt-3 pb-3":n==="large"&&x,"py-sm px-0":n==="large"&&!x})},[y,t,r,a,n,x,s]),b=d.useCallback(S=>{if(o)return;const C=S.target;hj(C)||m?.current?.focus()},[m,o]),_=d.useCallback(S=>{if(o)return;const C=S.target;if(hj(C))return;const E=m?.current?.element();E&&C!==E&&!E.contains(C)&&S.preventDefault()},[m,o]),w=d.useCallback(()=>i?.(null),[i]);return l.jsx(wg.Provider,{value:{state:h,dispatch:g},children:l.jsx("div",{className:"relative rounded-2xl",ref:p,onClick:b,onMouseDownCapture:_,children:l.jsxs("div",{className:z(v,"gap-y-md grid items-center"),children:[(u||a||c)&&l.jsxs("div",{className:z({"pt-xs":!x},"gap-y-sm grid items-center"),children:[u,a&&l.jsx(GY,{quote:a,onClear:w}),c]}),l.jsx("div",{className:z({"px-3":n==="large"&&!x,"px-3.5":n==="large"&&x,flex:!x,"grid-rows-1fr-auto grid grid-cols-3":x}),children:f})]})})})});TA.displayName="ResizeableInputWrapper";const S7e=({autoFocus:e=!1,placeholder:t="",disableInput:n=!1,value:r,initialLayout:s="expanded",minRows:o,maxRows:a,onChange:i,onClick:c,onBlur:u,onFocus:f,onKeyDown:m,onPaste:p,isMobileStyle:h,isMobileUserAgent:g,testId:y,id:x,ref:v})=>{const{state:b,dispatch:_}=d.useContext(wg),{isActive:w,isComposing:S,isExpanded:C}=b,E=d.useRef(w);E.current=w;const T=Zl(n),k=d.useRef(null),I=d.useMemo(()=>z(xr.inputWrapper.base,{[xr.inputWrapper.expanded.join(" ")]:C,[xr.inputWrapper.compact.join(" ")]:!C,[xr.inputWrapper.disabled]:n}),[n,C]),M=d.useMemo(()=>z(...xr.inputElement,"w-full"),[]),N=d.useCallback(Y=>{_({type:"SET_EXPANDED",payload:Y})},[_]),D=d.useCallback(Y=>{_({type:"SET_ACTIVE",payload:Y})},[_]),j=d.useCallback(Y=>{_({type:"SET_COMPOSING",payload:Y})},[_]),F=d.useCallback(Y=>{f?.(Y.nativeEvent),D(!0)},[f,D]),R=d.useCallback(Y=>{u?.(Y.nativeEvent)!==!1&&D(!1)},[u,D]),P=d.useCallback(()=>{if(k.current){const Y=k.current.value.length;k.current.focus(),k.current.setSelectionRange(Y,Y),k.current.scrollTop=k.current.scrollHeight}},[]),L=d.useCallback(Y=>{if(!k?.current)return!0;const te=k.current,{selectionStart:se,selectionEnd:ae,value:X}=te;if(se!==ae)return!1;const ee=document.createElement("div"),le=window.getComputedStyle(te);ee.style.position="absolute",ee.style.visibility="hidden",ee.style.whiteSpace=le.whiteSpace,ee.style.wordWrap=le.wordWrap,ee.style.font=le.font,ee.style.padding=le.padding,ee.style.border=le.border,ee.style.width=te.offsetWidth+"px",ee.style.lineHeight=le.lineHeight,document.body.appendChild(ee);try{const re=parseInt(le.lineHeight)||24,ce=X.substring(0,se);ee.textContent=ce;const ue=ee.offsetHeight;return Y==="first"?ue<=re:(ee.textContent=X,ee.offsetHeight-ue{c?.(Y.nativeEvent)},[c]),O=d.useCallback(Y=>{hh(Y.nativeEvent,{isMobileUserAgent:g,isComposing:S,onKeyDown:m})},[m,S,g]),$=d.useCallback(()=>kA(j),[j]),G=d.useCallback(()=>MA(j),[j]),H=d.useCallback(Y=>{p?.(Y.nativeEvent)},[p]),Q=d.useCallback(Y=>{i?.(Y.target.value)},[i]);return d.useImperativeHandle(v,()=>{const Y=k.current;return Y.focusAtEnd=P,Y.isFocused=()=>E.current,Y.inLine=L,Y.append=te=>{k.current&&(k.current.value+=te)},Y.scrollToEnd=()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},Y.trim=()=>{k.current&&(k.current.value=k.current.value.trim())},Y.element=()=>k.current,Y},[P,L]),d.useEffect(()=>{!g&&k.current&&e&&(requestAnimationFrame(P),D(!0))},[g,k,e,D,P]),d.useEffect(()=>{T!==n&&!n&&!g&&e&&setTimeout(()=>{k.current?.focus()},200)}),$Y(r,s,h,C,N),l.jsx("div",{className:I,children:l.jsx(FY,{ref:k,placeholder:t,minRows:o,maxRows:a,value:r,onClick:U,onChange:Q,onKeyDown:O,onBlur:R,onCompositionStart:$,onCompositionEnd:G,onFocus:F,onPaste:H,className:M,autoComplete:"off","data-test-id":y,rows:o,id:x,disabled:n,"data-1p-ignore":!0})})},my="external-update",qY="focus",E7e="blur",k7e=new Set([my,qY,E7e]),M7e=({autoFocus:e=!1,placeholder:t="",placeholderClassName:n,disableInput:r=!1,value:s,initialLayout:o="expanded",json:a,minRows:i,onChange:c,onClick:u,onBlur:f,onFocus:m,onKeyDown:p,onPaste:h,isMobileStyle:g,isMobileUserAgent:y,testId:x,id:v,namespace:b="ResizableLexicalInput",mentionTypeaheadOptions:_=Pe,onMentionMenuOpen:w,onMentionMenuClose:S,onTriggerTypeahead:C,ref:E})=>{const T=d.useRef(null),[k,I]=d.useState(null),{state:M,dispatch:N}=d.useContext(wg),{isActive:D,isComposing:j,isExpanded:F}=M,R=d.useRef(j),P=d.useRef(D),L=d.useRef(""),U=d.useRef(null),O=d.useRef(e),$=d.useRef(null),G=d.useRef(c),H=d.useRef(u),Q=d.useRef(f),Y=d.useRef(m),te=d.useRef(p),se=d.useRef(h);G.current=c,H.current=u,Q.current=f,Y.current=m,te.current=p,se.current=h,R.current=j,P.current=D,O.current=e;const ae=Zl(r),X=d.useMemo(()=>z(xr.inputWrapper.base,{[xr.inputWrapper.expanded.join(" ")]:F,[xr.inputWrapper.compact.join(" ")]:!F}),[F]),ee=d.useMemo(()=>z(...xr.inputElement,"size-full"),[]),le=d.useMemo(()=>z(...xr.placeholder.base,{[xr.placeholder.compact]:!F},n),[F,n]),re=d.useCallback(Me=>N({type:"SET_EXPANDED",payload:Me}),[N]),ce=d.useCallback(Me=>N({type:"SET_ACTIVE",payload:Me}),[N]),ue=d.useCallback(Me=>N({type:"SET_COMPOSING",payload:Me}),[N]),me=d.useCallback(Me=>{Z.error(Me)},[]),we=d.useCallback(Me=>{Y.current?.(Me),ce(!0)},[ce]),ye=d.useCallback(Me=>{Q.current?.(Me)!==!1&&ce(!1)},[ce]),_e=d.useCallback(Me=>{se.current?.(Me)},[]),ke=d.useCallback(Me=>{H.current?.(Me)},[]),De=d.useCallback((Me,Ve,lt)=>{const xt=[...lt];let Pt;xt.length>0&&xt.every($e=>k7e.has($e))||(Pt===void 0&&(Pt=km(Me.toJSON())),L.current=Pt??"",U.current=Me.toJSON(),G.current?.(L.current,U.current))},[]),xe=d.useCallback(()=>ue(!0),[ue]),Ue=d.useCallback(()=>ue(!1),[ue]),Ee=d.useCallback(Me=>{hh(Me,{isMobileUserAgent:y,isComposing:R.current,onKeyDown:te.current})},[y]),Ke=d.useCallback(()=>k?.update(()=>{g_(qY),gl().selectEnd()}),[k]),Nt=d.useCallback(Me=>k?.update(()=>{const Ve=gl(),lt=Ve.getLastChild();if(gm(lt)){const xt=zS(Me);lt.append(xt),Ve.selectEnd()}}),[k]),pe=d.useCallback(()=>k?.update(()=>{const Ve=gl().getLastChild();if(gm(Ve)){const lt=Ve.getFirstChild();if(ym(lt)){const Pt=lt.getTextContent(),$e=Pt.trimStart();Pt.length-Pt.trimStart().length&<.spliceText(0,Pt.length,$e,!0)}const xt=Ve.getLastChild();if(ym(xt)){const Pt=xt.getTextContent(),$e=Pt.trimEnd();Pt.length-$e.length&&xt.spliceText(0,Pt.length,$e,!0)}}}),[k]),ve=d.useCallback(Me=>k?k.getEditorState().read(()=>{const Ve=Ta();if(!Aa(Ve))return!0;if(!Ve.isCollapsed())return!1;const lt=window.getSelection();if(!lt||lt.rangeCount===0)return!0;const xt=lt.getRangeAt(0);let Pt=xt.getBoundingClientRect();if(Pt.width===0&&Pt.height===0){const Zt=document.createTextNode("​");xt.insertNode(Zt),Pt=xt.getBoundingClientRect(),Zt.remove()}const $e=k.getElementByKey(gl().getFirstChild()?.getKey()??"")?.getBoundingClientRect();if(!$e)return!0;const ht=4;return Me==="first"?Math.abs(Pt.top-$e.top)<=ht:Math.abs(Pt.bottom-$e.bottom)<=ht}):!0,[k]),Ae=d.useCallback(()=>{w?.()},[w]),We=d.useCallback(()=>{S?.()},[S]),pt=d.useCallback(Me=>{k||ke(Me.nativeEvent)},[k,ke]);d.useImperativeHandle(E,()=>({append:Nt,trim:pe,focusAtEnd:Ke,isFocused:()=>P.current,inLine:ve,focus:()=>k?.focus(),blur:()=>k?.blur(),scrollIntoView:Me=>k?.getRootElement()?.scrollIntoView(Me),scrollToEnd:()=>k?.getRootElement()?.scrollIntoView({block:"end",behavior:"auto"}),element:()=>T?.current,get scrollHeight(){return k?.getRootElement()?.scrollHeight??0},get value(){return km(k?.getEditorState()?.toJSON())},set value(Me){throw new Error("setValue is not supported in Lexical")},get json(){return k?.getEditorState().toJSON()}}),[Nt,Ke,pe,k,ve]),$Y(s,o,g,F,re),d.useEffect(()=>{!y&&k&&e&&(requestAnimationFrame(Ke),ce(!0))},[y,e,ce,k,Ke]),d.useEffect(()=>{ae!==r&&!r&&!y&&e&&setTimeout(()=>Ke(),200)}),d.useEffect(()=>k?.registerRootListener((Me,Ve)=>{Me&&(Me.addEventListener("focus",we),Me.addEventListener("blur",ye),Me.addEventListener("compositionstart",xe),Me.addEventListener("compositionend",Ue),Me.addEventListener("keydown",Ee),Me.addEventListener("paste",_e),Me.addEventListener("click",ke)),Ve&&(Ve.removeEventListener("focus",we),Ve.removeEventListener("blur",ye),Ve.removeEventListener("compositionstart",xe),Ve.removeEventListener("compositionend",Ue),Ve.removeEventListener("keydown",Ee),Ve.removeEventListener("paste",_e),Ve.removeEventListener("click",ke))}),[ye,ke,Ue,we,Ee,_e,xe,k]),d.useLayoutEffect(()=>{k&&k.setEditable(!r)},[r,k]),d.useLayoutEffect(()=>{k&&(s&&a&&!Cr(a,U.current)?Promise.resolve().then(()=>{k.setEditorState(k.parseEditorState(a),{tag:my}),O.current&&Ke(),U.current=k.getEditorState().toJSON(),L.current=km(U.current)}):s&&L.current!==s?(k.update(()=>{g_(my);const Me=gl();Me.clear(),tE?nE(s):Me.append(zS(s)),O.current&&Me.selectEnd()},{discrete:!0}),U.current=k.getEditorState().toJSON(),L.current=km(U.current)):!s&&L.current!==s&&(k.update(()=>{g_(my);const Me=gl();Me.clear(),O.current?Me.selectEnd():k.getRootElement()!==document.activeElement&&E7(null)},{discrete:!0}),U.current=k.getEditorState().toJSON(),L.current=km(U.current)))},[s,a,k,Ke]),d.useEffect(()=>{const Me=k?.registerCommand(y_,dt=>{const Ct=Ta();if(Aa(Ct)&&Ct.isCollapsed()){const Ot=Ct.anchor,Qt=Ot.getNode(),lr=tr=>{let bn=tr,nr=bn.getParent();for(;nr&&!gm(nr)&&!D7(nr);)bn=nr,nr=bn.getParent();return bn},Qr=tr=>!tr||!xm(tr)||!tr.isIsolated()?!1:(tr.remove(),!0);if(gm(Qt)){const bn=Ct.getNodes()[0];if(dt){if(bn){if(bn.getNextSibling()===null&&Qr(bn))return!0;const nr=bn.getPreviousSibling();if(Qr(nr))return!0}}else if(Qr(bn))return!0}else if(Qt){const tr=lr(Qt);if(dt){if(Ot.offset===0){const nr=tr.getPreviousSibling();if(Qr(nr))return!0}}else{const bn=ym(Qt)?Qt.getTextContentSize():0;if(Ot.offset===bn){const Xr=tr.getNextSibling();if(Qr(Xr))return!0}}}}return Aa(Ct)?(Ct.deleteCharacter(dt),!0):x_(Ct)?(Ct.deleteNodes(),!0):!1},vi),Ve=k?.registerCommand(Spe,dt=>{const Ct=Ta();return Aa(Ct)?(Ct.deleteWord(dt),!0):!1},vi),lt=k?.registerCommand(Epe,dt=>{const Ct=Ta();return Aa(Ct)?(Ct.deleteLine(dt),!0):!1},vi),xt=k?.registerCommand(kpe,()=>{const dt=Ta();return Aa(dt)?(dt.removeText(),!0):!1},vi),Pt=k?.registerCommand(Mpe,dt=>{const Ct=Ta();if(typeof dt=="string")Ct!==null&&Ct.insertText(dt);else{if(Ct===null)return!1;const Ot=dt.dataTransfer;if(Ot!==null)k7(Ot,Ct,k);else if(Aa(Ct)){const Qt=dt.data;return Qt&&Ct.insertText(Qt),!0}}return!0},vi),$e=k?.registerCommand(Tpe,dt=>{if("clipboardData"in dt){const Ot=dt.clipboardData?.getData("text/plain");if(Ot&&Ot.length>Ec)return dt.preventDefault(),!0}const Ct=Ta();return Aa(Ct)?(dt.preventDefault(),k.update(()=>{const Ot=Ta(),Qt=M7(dt,InputEvent)||M7(dt,KeyboardEvent)?null:"clipboardData"in dt?dt.clipboardData:null;if(Qt&&Ot){const{types:lr}=Qt;if(lr.includes("text/html")||lr.includes("application/x-lexical-editor")||Qt.files.length>0||!tE)k7(Qt,Ot,k);else{const Qr=Ot.clone(),tr=HS();nE(Qt.getData("text/plain"),tr);const bn=[];tr.getChildren().forEach(nr=>{gm(nr)?(bn.length&&bn.push(T7()),nr.getChildren().forEach(Xr=>{(ym(Xr)||xm(Xr)||A7(Xr)||N7(Xr))&&bn.push(Xr)})):bn.push(nr)}),E7(Qr),Ape(k,bn,Qr)}}},{tag:Npe}),!0):!1},vi),ht=k?.registerCommand(Rpe,dt=>{const Ct=R7(dt.target);if(xm(Ct))return!1;const Ot=Ta();if(Aa(Ot)){const{anchor:Qt}=Ot,lr=Qt.getNode();if(Ot.isCollapsed()&&Qt.offset===0&&!D7(lr)&&Dpe(lr).getIndent()>0)return dt.preventDefault(),k.dispatchCommand(jpe,void 0);if(Ipe&&navigator.language==="ko-KR")return!1}else if(!x_(Ot))return!1;return dt.preventDefault(),k.dispatchCommand(y_,!0)},vi),Zt=k?.registerCommand(Ppe,dt=>{const Ct=R7(dt.target);if(xm(Ct))return!1;const Ot=Ta();return Aa(Ot)||x_(Ot)?(dt.preventDefault(),k.dispatchCommand(y_,!1)):!1},vi);return k?.registerNodeTransform(Ope,dt=>{dt.getFormat()!==0&&dt.setFormat(0)}),k?.registerNodeTransform(Lpe,dt=>{if(dt.getChildrenSize()>1){const Ct=dt.getChildren(),Ot=HS();Ct.forEach(Qt=>{Fpe(Qt)&&(Ot.getChildren().length&&Ot.append(T7()),Qt.getChildren().forEach(lr=>{(ym(lr)||xm(lr)||A7(lr)||N7(lr))&&Ot.append(lr)}))}),dt.clear().append(Ot).selectEnd()}}),k?.registerNodeTransform(Bpe,dt=>{const Ct=dt.getParent();Ct instanceof ZU&&(dt.getChildren().forEach(Qt=>{Ct.append(Qt)}),dt.remove())}),()=>{Me?.(),Ve?.(),lt?.(),xt?.(),Pt?.(),$e?.(),ht?.(),Zt?.()}},[k,_e]),d.useEffect(()=>{const Me=k?.registerCommand(Upe,Ve=>!Ve||$.current&&!$.current.canSubmit()?!1:(hh(Ve,{isMobileUserAgent:y,isComposing:R.current,onKeyDown:te.current}),Ve.defaultPrevented),vi);return()=>{Me?.()}},[k,We,y]);const Gt=d.useMemo(()=>({namespace:b,onError:me,nodes:zY,theme:{link:"text-super hover:underline",text:{strikethrough:"line-through"}},editable:!r}),[b,me,r]),Le=d.useMemo(()=>({minHeight:`${(i??1)*1.5}em`}),[i]),gt=d.useMemo(()=>l.jsx("div",{className:le,children:t}),[t,le]),Je=d.useMemo(()=>l.jsx(Vpe,{className:ee,"aria-placeholder":t,placeholder:gt,"data-test-id":x,id:v}),[v,t,gt,ee,x]);return d.useMemo(()=>l.jsx("div",{className:X,children:l.jsx("div",{className:"w-full",style:Le,ref:T,onClick:pt,children:l.jsxs(Hpe,{initialConfig:Gt,children:[l.jsx(zpe,{contentEditable:Je,ErrorBoundary:Mr}),l.jsx(g7e,{}),l.jsx(y7e,{onChange:De,ignoreSelectionChange:!0}),l.jsx(x7e,{editorRef:I}),l.jsx(v7e,{ref:$,onClose:We,onOpen:Ae,options:_,onTrigger:C}),l.jsx(b7e,{}),l.jsx(_7e,{}),l.jsx(Wpe,{}),l.jsx(w7e,{transformers:WY})]})})}),[X,Le,pt,Gt,Je,De,We,Ae,_,C])},AA=e=>{const t=e.useLexical?M7e:S7e;return l.jsx(t,{...e})},KY=A.memo(({children:e})=>{const{state:t}=d.useContext(wg),{isExpanded:n}=t;return e!==null?l.jsx("div",{className:z(...xr.attribution.left.base,{[xr.attribution.left.expanded]:n,[xr.attribution.left.compact]:!n}),children:e}):null});KY.displayName="LeftAttribution";const rE=A.memo(({isLoading:e,children:t})=>{const{state:n}=d.useContext(wg),{isExpanded:r}=n;return l.jsxs("div",{className:z(...xr.attribution.right.base,{[xr.attribution.right.expanded]:r,[xr.attribution.right.compact]:!r}),children:[e?l.jsx(V,{color:"light",className:"mr-3",children:l.jsx(ge,{icon:B("loader-2"),size:"xs",className:"animate-spin"})}):null,t]})});rE.displayName="RightAttribution";const T7e=({showFileUpload:e,handleFileInput:t,onFilePickerOpen:n,screenshotToolEnabled:r,isFollowUp:s})=>!e||!t?null:l.jsx(uY,{handleFileInput:t,onFilePickerOpen:n,screenshotToolEnabled:r,isFollowUp:s}),A7e=({showIncognitoHint:e,showSearchModeSelector:t=!0,isFollowUp:n,layoutKey:r,showFileUpload:s=!1,handleFileInput:o,onFilePickerOpen:a})=>{const{screenshotToolEnabled:i}=Qn();return l.jsx(KY,{children:l.jsx("div",{className:"gap-xs flex items-center",children:l.jsx(T7e,{showFileUpload:s,handleFileInput:o,onFilePickerOpen:a,screenshotToolEnabled:i,isFollowUp:n})})})},YY=A.memo(A7e);YY.displayName="AskInputLeftAttribution";const N7e=({uploadedFiles:e,selectedModel:t,onModelSwitch:n})=>{const{$t:r}=J(),{hasAccessToProFeatures:s}=$t(),{openToast:o}=hn(),{getModelConfig:a}=I4(),i=d.useRef(null);d.useEffect(()=>{const c=e?.some(h=>kr(h.file.name))??!1,f=a(t)?.textOnlyModel===!0;if(!c||!f){i.current=null;return}if(i.current===t)return;const m=r({defaultMessage:"{modelName} does not support images. Switched to the default best model.",id:"Dtdtsbnc5W"},{modelName:r($n[t].name)});o({message:m,variant:"warning",timeout:null});const p=s?ie.PRO:ie.DEFAULT;i.current=t,n(p)},[e,t,a,o,r,n,s])},R7e=(e,t)=>{const{value:n,loading:r}=kf({flag:"model-outage-on-model-selector-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Pu=He({reasoning:{defaultMessage:"Reasoning",id:"Aw3qRf7hyO"},max:{defaultMessage:"max",id:"+LmzMnWE+j"},new:{defaultMessage:"new",id:"qlTe+eC7Ec"},research:{defaultMessage:"Research",id:"JEe7dVso7F"},labs:{defaultMessage:"Labs",id:"ylFNoY79wa"}}),D7e=W({defaultMessage:"Advanced models in Perplexity {searchMode}",id:"XgqOYZp+oF"}),j7e=W({defaultMessage:"Exclusive access for Max subscribers",id:"z2ijkWbdu6"}),I7e=W({defaultMessage:"Temporary degraded performance",id:"Kc/pdbXoxJ"}),P7e=W({defaultMessage:"{modelName} is a text only model. Remove image attachments to use this model.",id:"8Z6XFIwTW6"}),O7e=e=>{const{label:t,subheading:n,nonReasoningModel:r,reasoningModel:s,selected:o,variant:a,badgeText:i,notice:c,onChange:u,tooltipText:f,disabled:m}=e,{$t:p}=J(),h=d.useCallback(()=>{if(m)return;const _=r??s;if(!_){Hc.error("ModelMenuItem: No model to select",{searchModel:r,reasoningModel:s});return}u(_)},[u,r,s,m]),g=d.useCallback(()=>{!s||!r||u(s===o?r:s)},[u,s,r,o]),y=!r,x=o===r||o===s,v=p({defaultMessage:"{modelName} does not support images. Remove image attachments to use this model.",id:"SQsP6RyVGS"},{modelName:t}),b=y?v:void 0;return l.jsxs(K,{variant:x?"subtler":void 0,className:"rounded-lg",children:[l.jsx(gA,{text:t,description:n,role:"menuitem",active:x,activeColor:a,badge:i,badgeVariant:a==="max"?"maxBorder":"superBorder",onClick:h,tooltipText:f,disabled:m}),x&&c&&l.jsx(V,{className:"max-w-44 px-2 py-1 text-left",variant:"tinyRegular",color:"red",children:c}),x&&s&&l.jsx(yA,{selected:o===s,text:p({defaultMessage:"With reasoning",id:"xwd+5Brxnr"}),role:"menuitem",active:o===s,activeColor:a,onClick:g,disabled:y,tooltipText:b,switchVariant:a})]})},L7e=[ie.DEFAULT,ie.PRO],sE=e=>L7e.includes(e),QY=({currentModel:e,onModelSelect:t,origin:n,searchMode:r=oe.SEARCH,disableTextOnlyModels:s=!1})=>{const o="use-model-menu-items-with-reasoning",{$t:a}=J(),{isMax:i,isPro:c}=$t(),{organization:u}=mo({reason:o}),{isMaxUpsellEnabled:f}=$x(),{specialCapabilities:m}=Yr(),p=ag(),h=d.useRef(null),{models:g,getModelConfig:y}=I4(),{modelSpecificLimits:x}=Vn(),{variation:v}=R7e({}),b=m.maxModelSelection||f||i,_=u?.settings?.disabled_model_preferences??Pe,w=d.useCallback(M=>{const N=y(M);return!N||N.subscriptionTier!==Jn.MAX||i||m.maxModelSelection||c&&[N.nonReasoningModel,N.reasoningModel].filter(F=>F!==null).some(F=>(x?.[F]??0)>0)?!0:!f},[y,i,m.maxModelSelection,c,x,f]),S=d.useCallback(()=>{p({origin:n??ft.MODEL_SELECTOR,pitchMessage:{title:a(D7e,{searchMode:a(Nr[r].name)}),description:a(j7e)}})},[p,a,n,r]),C=d.useCallback(M=>{h.current=M,t(M)},[t]),E=d.useCallback(M=>M&&_.includes(M),[_]),T=d.useCallback(M=>sE(M)||y(M)!==void 0,[y]),k=d.useMemo(()=>({type:"custom",text:a($n[ie.PRO].name),children:l.jsx(Ed,{type:"default",size:"small",text:a($n[ie.PRO].name),tooltipText:a($n[ie.PRO].description),active:sE(e),onClick:()=>{C(ie.PRO)}})}),[e,C,a]),I=d.useMemo(()=>{const M={type:"separator",show:!0},D=g.filter(j=>!(!b&&j.subscriptionTier===Jn.MAX||E(j.nonReasoningModel)&&E(j.reasoningModel))).map(j=>{const F=E(j.nonReasoningModel)?null:j.nonReasoningModel,R=E(j.reasoningModel)?null:j.reasoningModel;if(!F&&!R)return null;const L=!!(F&&v[F]||R&&v[R])?a(I7e):void 0,U=s&&j.textOnlyModel===!0,O=U?a(P7e,{modelName:a(j.label)}):a(j.description),$=()=>{if(j.subheading)return a(j.subheading);if(c&&j.subscriptionTier===Jn.MAX&&[j.nonReasoningModel,j.reasoningModel].filter(se=>se!==null).some(se=>(x?.[se]??0)>0))return a({defaultMessage:"Trial access with Pro plan",id:"52XybSYuLP"})},G=j.subscriptionTier===Jn.MAX,H=G?"max":"super",Q=G?Pu.max:j.hasNewTag?Pu.new:void 0;return{type:"custom",text:a(j.label),children:l.jsx(O7e,{label:a(j.label),subheading:$(),selected:e,nonReasoningModel:F,reasoningModel:R,notice:L,variant:H,badgeText:Q?a(Q):void 0,onChange:Y=>{if(!w(Y)){S();return}C(Y)},tooltipText:O,disabled:U})}}).filter(j=>j!==null);if(n===ft.RETRY_BUTTON){const j={type:"custom",text:a(Pu.research),children:l.jsx(Ed,{type:"default",size:"small",icon:hM,text:a(Pu.research),active:e===ie.ALPHA,onClick:()=>C(ie.ALPHA)})},F={type:"custom",text:a(Pu.labs),children:l.jsx(Ed,{type:"default",size:"small",text:a(Pu.labs),icon:pM,active:e===ie.BETA,onClick:()=>C(ie.BETA)})};return[j,F,M,k,...D]}return[k,M,...D]},[a,n,e,b,E,v,w,S,C,g,k,s,c,x]);return d.useMemo(()=>({menuItems:I,isSupportedModel:T}),[I,T])},F7e=He({chooseModel:{defaultMessage:"Choose a model",id:"fXlc3idTcy"}}),XY=d.memo(({isOpen:e,onOpen:t,onClose:n,selectedModel:r,onModelChange:s,uploadedFiles:o})=>{const{$t:a}=J(),{isMax:i}=$t(),{onActiveMenuChange:c}=jo(),{activeMenu:u}=qr(),f=Vo(),{configuredModel:m}=Vn(),p=bg(),{isMobileStyle:h}=Re(),g=f===oe.SEARCH,y=d.useCallback(F=>{p(F,f)},[p,f]),x=d.useCallback(()=>{c(Ir.SEARCH_MODEL_SELECTOR)},[c]),v=d.useCallback(()=>{c(null)},[c]),b=r??m,_=s??y,w=e??u===Ir.SEARCH_MODEL_SELECTOR,S=t??x,C=n??v,T=!!fn()?.get("openSearchModeSelector");d.useEffect(()=>{T&&x()},[T,x]);const k=d.useCallback(F=>p(F,f),[p,f]);N7e({uploadedFiles:o,selectedModel:b,onModelSwitch:k});const I=d.useMemo(()=>o?.some(F=>kr(F.file.name))??!1,[o]),{menuItems:M}=QY({currentModel:b,onModelSelect:_,searchMode:f,disableTextOnlyModels:I}),N=d.useMemo(()=>sE(b),[b]),D=d.useMemo(()=>({className:z("max-h-[40vh]",{"max-super-override":i})}),[i]),j=d.useCallback(()=>l.jsx("span",{className:z({"text-super":!N}),children:l.jsx(rn,{icon:B("cpu"),size:"small"})}),[N]);return l.jsx(V4,{isVisible:g,animationType:"slide",children:l.jsx(zs,{placement:"bottom-end",boxProps:D,items:M,isMobileStyle:h,isOpen:w,onOpen:S,onClose:C,children:l.jsx(wt,{variant:"text",size:"small",icon:j,"aria-label":a(N?F7e.chooseModel:$n[b].name)})})})});XY.displayName="SearchModelSelector";const ZY=A.memo(({children:e,focusItems:t,placement:n,width:r="200px",isMobileStyle:s,isOpen:o=!1,onOpen:a,onClose:i,menuType:c=Ir.FOCUS,isSpace:u=!1})=>{const{$t:f}=J(),{isMax:m}=$t(),p=J(),h=d.useMemo(()=>{switch(c){case Ir.RECENCY:return f({defaultMessage:"Choose recency",id:"qyxEklVz9W"});case Ir.SOURCES:default:return f({defaultMessage:"Choose sources",id:"5HzLAl6K6z"})}},[c,f]),g=d.useCallback(_=>{_?.stopPropagation(),a?.()},[a]),y=d.useCallback(()=>{i?.()},[i]),x=d.useMemo(()=>l.jsx("div",{className:"gap-x-xs p-sm bg-subtle flex items-center justify-center rounded-t-xl text-center",children:l.jsx(V,{color:"light",variant:"tinyRegular",children:l.jsxs("div",{className:"gap-x-sm flex items-center",children:[l.jsx(ge,{icon:Kh,size:"xs"}),p.formatMessage({defaultMessage:"Search includes all context from this space.",id:"uhJN0zDnSy"})]})})}),[p]),v=d.useMemo(()=>({width:r}),[r]),b=d.useMemo(()=>l.jsxs(K,{className:z("flex flex-col",{"max-h-[37vh]":u,"max-h-[42vh]":!u,"max-super-override":m}),style:v,children:[u&&c===Ir.SOURCES&&x,l.jsx(nl,{orientation:"vertical",showIndicatorOnHover:!1,className:z("min-h-0 flex-1 overflow-auto",{"p-xs":u&&c===Ir.SOURCES}),children:l.jsx(fh,{items:t,disableScrollArea:!0})})]}),[x,t,u,c,v,m]);return s?l.jsxs(l.Fragment,{children:[l.jsx(po,{title:h,titleTextVariant:"baseSemi",variant:"bottom-left-sheet",actionList:Pe,isOpen:o,onClose:y,noPadding:!0,children:l.jsx(fh,{textColor:"light",items:t})}),l.jsx("span",{onClick:g,children:e})]}):l.jsx(Vf,{isFileSearchEnabled:!0,isOpen:o,placement:n,onClose:y,onOpen:g,avoidSizeCollisions:!1,contentClassName:u&&c===Ir.SOURCES?"!p-0":"",content:b,hasInteractiveContent:!0,children:e})});ZY.displayName="FocusDropdown";const JY=A.memo(({isOpen:e,onOpen:t,onClose:n})=>{const r="recency-switcher",{$t:s}=J(),o=J(),{isMobileStyle:a}=Re(),i=ou(),{session:c}=Ne(),{trackEvent:u}=Xe(c),{sources:f,recency:m,setRecency:p}=Vn(),h=Array.isArray(i?.slug)?i.slug[0]:i?.slug,{collection:g}=O4({collectionSlug:h,reason:r}),y=g?.focused_web_config?.link_configs??Pe,x=f&&f.includes("web"),v=f&&y.length>0,b=!x&&!v,w=f&&f.includes("crunchbase")?!0:b,S=d.useCallback(T=>{p(T),u("search recency click",{recency:T}),n()},[u,p,n]),C=d.useMemo(()=>[{value:null,label:s({defaultMessage:"All Time",id:"52UMW3b1Z0"})},{value:"DAY",label:s({defaultMessage:"Today",id:"zWgbGgjUUg"})},{value:"WEEK",label:s({defaultMessage:"Last Week",id:"P3YB9A5Yho"})},{value:"MONTH",label:s({defaultMessage:"Last Month",id:"cfMkrE1iIn"})},{value:"YEAR",label:s({defaultMessage:"Last Year",id:"7PhUtcTRXC"})}],[s]),E=d.useMemo(()=>C.map(T=>({type:"default",text:T.label,active:m===T.value,onClick:()=>S(T.value)})),[C,m,S]);return l.jsx(ZY,{focusItems:E,placement:"bottom-start",width:"200px",isMobileStyle:a,isOpen:e,onOpen:t,onClose:n,menuType:Ir.RECENCY,children:l.jsx(st,{toolTip:o.formatMessage({defaultMessage:"Set recency for web search",id:"3/OG+oV8gT"}),size:"small",icon:B("clock"),disabled:w})})});JY.displayName="RecencySwitcher";function B7e(e){for(var t=[],n=1;n1?!0:(t.preventDefault&&t.preventDefault(),!1)}var yj=V7e&&window.navigator&&window.navigator.platform&&/iP(ad|hone|od)/.test(window.navigator.platform),Ou=new Map,xj=typeof document=="object"?document:void 0,G0=!1;const H7e=xj?function(t,n){t===void 0&&(t=!0);var r=d.useRef(xj.body);n=n||r;var s=function(a){var i=Ou.get(a);i?Ou.set(a,{counter:i.counter+1,initialOverflow:i.initialOverflow}):(Ou.set(a,{counter:1,initialOverflow:a.style.overflow}),yj?G0||(B7e(document,"touchmove",gj,{passive:!1}),G0=!0):a.style.overflow="hidden")},o=function(a){var i=Ou.get(a);i&&(i.counter===1?(Ou.delete(a),yj?(a.ontouchmove=null,G0&&(U7e(document,"touchmove",gj),G0=!1)):a.style.overflow=i.initialOverflow):Ou.set(a,{counter:i.counter-1,initialOverflow:i.initialOverflow}))};d.useEffect(function(){var a=oE(n.current);a&&(t?s(a):o(a))},[t,n.current]),d.useEffect(function(){var a=oE(n.current);if(a)return function(){o(a)}},[])}:function(t,n){},vj="google-drive-picker-gapi-script",bj="google-identity-services-script",z7e=wf(async function(){if(!document.getElementById(bj))return new Promise((t,n)=>{const r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.id=bj,r.onload=()=>t(),r.onerror=n,document.body.appendChild(r)})}),W7e=wf(async function(){if(!document.getElementById(vj))return new Promise((t,n)=>{const r=document.createElement("script");r.src="https://apis.google.com/js/api.js",r.id=vj,r.onload=()=>{window.gapi.load("picker",{callback:t,onerror:n})},r.onerror=n,document.body.appendChild(r)})}),G7e=["https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/drive.metadata.readonly"].join(" "),$7e=["application/vnd.google-apps.file","application/vnd.google-apps.folder","application/vnd.google-apps.document","application/vnd.google-apps.presentation","application/vnd.google-apps.spreadsheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","application/pdf","text/csv","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/markdown"],q7e=["text/plain","application/pdf","text/csv","text/markdown","image/png","image/jpeg","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.google-apps.document","application/vnd.google-apps.presentation","application/vnd.google-apps.spreadsheet"],K7e=["audio/mpeg","audio/wav","audio/aiff","audio/ogg","audio/flac","audio/mp3","video/mp4","video/mpeg","video/mov","video/avi","video/x-flv","video/mpg","video/webm","video/wmv","video/3gpp","video/quicktime"],eQ=({isAudioVideoFilesEnabled:e,onError:t})=>{const[n,r]=d.useState(!1),{openToast:s}=hn(),{$t:o}=J();H7e(n);const a=d.useCallback((c,u)=>{const f=window.google?.picker,m=p=>{p.action===f.Action.PICKED?u.onPicked&&u.onPicked(p.docs??Pe):(p.action===f.Action.CANCEL||p.action===f.Action.ERROR)&&(p.action===f.Action.CANCEL&&u.onCancel&&u.onCancel(),r(!1))};if(f)try{const p=new f.DocsView().setIncludeFolders(!0).setSelectFolderEnabled(!0).setMode(f.DocsViewMode.LIST),h=new f.ViewGroup(p);let g=u.mode==="source"?$7e:q7e;g=e?g.concat(K7e):g,new f.PickerBuilder().setSize(1051,650).addViewGroup(h).setSelectableMimeTypes(g.join(",")).enableFeature(f.Feature.MULTISELECT_ENABLED).setOAuthToken(c).setCallback(m).build().setVisible(!0),r(!0)}catch{t?.()}},[e,t]),i=d.useCallback(async c=>{try{await Promise.all([W7e(),z7e()])}catch{t?.();return}window.google.accounts.oauth2.initTokenClient({client_id:c.clientId,login_hint:c.loginHint,scope:G7e,prompt:"none",callback:f=>{if(f.error!==void 0)throw new Error(f.error);if(!f.access_token){s({message:o({defaultMessage:"Failed to open Google Drive file picker. If this problem persists, please try reconnecting your Google Drive account.",id:"UK5gaMQa5o"}),variant:"error",timeout:5}),Z.warn("[Google Drive Picker] No access token received."),t?.();return}try{a(f.access_token,c)}catch(m){console.log(m)}}}).requestAccessToken()},[a,t,o,s]);return d.useMemo(()=>({openPicker:i}),[i])},Y7e=({connectorId:e,onFilesSelected:t})=>{const n="sources-menu-attach-file-connector",{openPicker:r}=Q7e({onSelectFiles:t,reason:n}),s=d.useCallback(()=>{switch(e){case"google_drive":r();break;default:throw new Error(`Connector ${e} not implemented`)}},[e,r]);return d.useMemo(()=>({openFilePicker:s}),[s])},Q7e=({onSelectFiles:e,reason:t})=>{const{connectorsMap:n}=Af({reason:t,skipConnectorPickerCredentials:!1}),{openPicker:r}=eQ({isAudioVideoFilesEnabled:!0}),s=d.useCallback(()=>{r({clientId:n?.google_drive?.picker_credentials?.client_id??"",loginHint:n?.google_drive?.connection_display_name??"",mode:"attachment",onPicked:e})},[r,e,n]);return d.useMemo(()=>({openPicker:s}),[s])},NA=A.memo(({size:e="medium",user:t,showEdit:n,onChange:r,anon:s,altText:o,defaultIcon:a=B("user-filled"),rounded:i=!0,showBackground:c=!0,showProBadge:u,showMaxBadge:f,className:m,badgeProps:p})=>{const h=s?B("sunglasses-filled"):a,g=d.useCallback(()=>{const y=document.createElement("input");y.type="file",y.accept="image/*",y.onchange=x=>{const v=x.target.files?.[0];if(v){const b=new FileReader;b.onload=_=>{r&&r(_.target?.result)},b.readAsDataURL(v)}},y.click()},[r]);return l.jsx("div",{className:z("text-inverse relative",m),children:l.jsxs("div",{className:z("relative flex aspect-square shrink-0 items-center justify-center",c?"bg-subtler":"bg-transparent",{"rounded-full":i,"size-3":e==="tiny","size-4":e==="mini","size-5":e==="small","size-6":e==="base","size-8":e==="medium","size-10":e==="large","size-20":e==="xlarge","ring-super border-inverse border-2 ring-[1.5px]":u,"ring-max border-inverse border-2 ring-[1.5px]":f}),children:[p?.show&&l.jsx("div",{className:z("absolute right-0 top-0 size-3 -translate-y-1/4 translate-x-1/4 select-none rounded-full border-2",p?.className)}),t&&!s?l.jsx("img",{alt:o??"User avatar",className:z("size-full object-cover",{"rounded-full":i}),src:t}):l.jsx(V,{color:"light",className:"flex items-center justify-center",children:l.jsx(ut,{name:h,className:"size-[65%]"})}),n&&e!=="small"&&l.jsx("div",{className:"bg-base absolute -bottom-1 -right-2 rounded-full",children:l.jsx(Ge,{ariaLabel:"Edit avatar",variant:t?"common":"primary",size:e!=="xlarge"?"tiny":"small",pill:!0,icon:t?B("edit"):B("plus"),onClick:g})}),u&&l.jsx("div",{className:z("absolute top-full mt-[-6px] w-[24px] rounded-r-full bg-current p-[1.5px] [&>div]:w-full",{"opacity-0":e==="small"},{"w-lg mt-[-10px]":e==="xlarge"}),children:l.jsx(Gd,{size:"tiny",color:"super",variant:"pro",isPro:!0})}),f&&l.jsx("div",{className:z("absolute left-1/2 top-full mt-[-6px] flex w-[28px] -translate-x-1/2 items-center justify-center rounded-r-full bg-current p-[1.5px] [&>div]:w-full",{"opacity-0":e==="small"},{"w-xl mt-[-10px]":e==="xlarge"}),children:l.jsx(Gd,{size:"small",variant:"max",isMax:!0})})]})})});NA.displayName="Avatar";const X7e=({cometMcpSources:e})=>{const t=J();return d.useCallback(r=>{if(Wi(r))return Yx[r].icon;if(uu(r))return Z7e(r,t);if(Ja(r)){const s=Df(r);return()=>e[s]?.avatar}},[t,e])};function Z7e(e,t){const n=If(e);if(!n)return;const r=kc(e),s=t.formatMessage({id:"egoZUguuZl",defaultMessage:"{name} logo"},{name:r});return()=>l.jsx(NA,{user:n,size:"mini",rounded:!1,showBackground:!1,altText:s})}const nc=()=>{const{cometMcpSources:e}=Nf(),t=fW({cometMcpSources:e}),n=X7e({cometMcpSources:e});return d.useMemo(()=>({getSourceLabel:t,getSourceIcon:n}),[t,n])},tQ=A.memo(({connectorId:e,connected:t})=>{const n="sources-menu-attach-file-connector",{getSourceLabel:r,getSourceIcon:s}=nc(),{handleConnect:o}=J4({reason:n}),a=On(),{openFilePicker:i}=Y7e({connectorId:e,onFilesSelected:()=>{throw new Error("Not implemented")}}),c=d.useCallback(()=>{if(!t){o({connectorName:e,redirectPath:a||void 0,unauthedRedirectPath:a||void 0});return}i()},[t,e,o,a,i]),u=r(e),f=s(e),m=t?void 0:l.jsx(rn,{icon:B("arrow-up-right"),size:"small"});return l.jsx(Dt.Item,{onSelect:c,leadingAccessory:f,trailingAccessory:m,children:u})});tQ.displayName="SourcesMenuAttachFileConnector";const nQ=Ft("SourcesMenuFileInputContext",null);function J7e(){const e=d.useContext(nQ);if(!e)throw new Error("useSourcesMenuFileInput must be used within SourcesMenuFileInputProvider");return e}const rQ=A.memo(({children:e})=>{const t=d.useRef(null),n=d.useCallback(()=>{t.current?.click()},[]),r=d.useCallback(o=>{const a=o.target.files;if(a&&a.length>0)throw new Error("Not implemented");t.current&&(t.current.value="")},[]),s=d.useMemo(()=>({open:n}),[n]);return l.jsxs(nQ.Provider,{value:s,children:[l.jsx("input",{ref:t,type:"file",multiple:!0,accept:uV,style:{display:"none"},onChange:r}),e]})});rQ.displayName="SourcesMenuFileInputProvider";const eRe={defaultMessage:"Local files",id:"xMmQ4F7z3A"},aE=A.memo(({label:e=eRe})=>{const{open:t}=J7e();return l.jsx(Dt.Item,{onSelect:t,leadingAccessory:B("paperclip"),children:l.jsx(je,{...e})})});aE.displayName="SourcesMenuAttachLocalFileMenuItem";function tRe(e){return e!=null}const _j=W({defaultMessage:"Attach a file",id:"ydgifDAqLp"}),sQ=d.memo(()=>{const{connectorsMap:e}=Af({reason:"sources-menu"}),t=d.useMemo(()=>MV.map(n=>{const r=e[n];return!r||!Iz(r.name)?null:l.jsx(tQ,{connectorId:r.name,connected:r.connected},n)}).filter(tRe),[e]);return t.length===0?l.jsx(aE,{label:_j}):l.jsxs(Dt.Submenu,{triggerElement:l.jsx(Dt.SubmenuItem,{leadingAccessory:B("paperclip"),children:l.jsx(je,{..._j})}),children:[l.jsx(aE,{}),t]})});sQ.displayName="SourcesMenuAttachFileMenuItem";const nRe=(e,t)=>{const n=t?.isOverlapping??!1,r=t?.stackDirection??"left";if(!e.length)return l.jsx(ge,{icon:yM,size:"sm"});const s=Math.max(1,t?.maxVisuals??3),o=f=>{if(!(!n||f))switch(t?.size){case"sm":return"-0.25rem";case"md":return"-0.375rem";case"lg":return"-0.5rem";case"xl":return"-0.625rem";default:return}},a=()=>{const f=z("relative flex items-center justify-center",{"rounded-full":t?.shape==="circle"||!t?.shape,"rounded-none":t?.shape==="square","size-4":t?.size==="sm","size-5":t?.size==="md","size-6":t?.size==="lg","size-7":t?.size==="xl"});return!n||!e||!(e.length>1||(t?.alwaysApplyOverlappingStyles??!1))?f:z(f,t?.overlappingClassName??"bg-base ring-subtlest",{"ring-1":t?.size==="sm"||t?.size==="md","ring-2":t?.size==="lg"||t?.size==="xl"})},i=(t?.showRemainderCount??!0)&&e.length>s,c=s===1&&e.length>1&&i?0:i?s-1:Math.min(s,e.length),u=e.slice(0,c).map((f,m)=>l.jsx("div",{className:a(),style:{zIndex:r==="left"?e.length-m-1:e.length+m,marginLeft:o(m===0)},children:f},m));return l.jsxs("div",{className:z("isolate",t?.containerClass??"my-xs flex items-center"),children:[l.jsxs("div",{className:t?.innerClassName??z("flex items-center",{"gap-2":!n}),children:[u,i&&l.jsx("div",{className:z(a(),{"mx-1":c===0}),style:{zIndex:r==="left"?-1:e.length+s,marginLeft:o(c===0)},children:l.jsxs(V,{variant:"tinyMono",color:"light",inline:!0,children:["+",e.length-c]})})]}),t?.rightText&&l.jsx("div",{className:"ml-2",children:t.rightText})]})},rRe=5;function sRe(e){return e!=null}const oQ=A.memo(({sources:e,size:t="default"})=>{const{getSourceIcon:n}=nc();if(e.length>0){const r=o=>{const a=n(o);return a?l.jsx(rn,{icon:a,size:t},o):null},s=e.map(r).filter(sRe);return nRe(s,{isOverlapping:!0,maxVisuals:rRe,size:"md",stackDirection:"right",overlappingClassName:"overflow-hidden bg-base ring-subtlest"})}return l.jsx(rn,{icon:yM,size:t})});oQ.displayName="SourcesMenuButtonContent";const aQ=A.memo(({sources:e,tooltip:t,size:n="default",disabled:r=!1,...s})=>{const{$t:o}=J(),a=_x({variant:"text",disabled:r,size:n,iconOnly:e.length===1}),i=l.jsx(Ro,{"aria-label":o({defaultMessage:"Sources",id:"fhwTpAcBLC"}),className:a,disabled:r,...s,children:l.jsx(oQ,{sources:e,size:n})});return t?l.jsx(Fo,{content:t,children:i}):i});aQ.displayName="SourcesMenuButton";const iQ=d.memo(({source:e,enabled:t,onToggle:n})=>{const{cometMcpSources:r}=Nf(),{getSourceLabel:s,getSourceIcon:o}=nc(),a=Df(e),i=r[a];i||Z.error(`Server config not found for comet MCP source: ${e}`);const c=s(e),u=o(e),f=i?.description,m=l.jsx(Dt.SwitchItem,{leadingAccessory:u,checked:t,onCheckedChange:n,disabled:i?.disabled,children:c});return f?l.jsx(Fo,{content:f,side:"right",children:m}):m});iQ.displayName="SourcesMenuItemCometMcpSource";var g2;(function(e){e.CONNECTED="connected",e.DISCONNECTED="disconnected"})(g2||(g2={}));const lQ={linear_alt:{name:"Linear",tagline:W({defaultMessage:"Plan and track projects, issues, and team workflows in Linear",id:"6u9Zf65BGW"}),bullets:[W({defaultMessage:"Search across Linear issues, projects, and teams",id:"MicGE6HssU"}),W({defaultMessage:"Create and update Linear issues and projects",id:"scUqB1LbKr"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Linear whenever you query in Perplexity",id:"b/8mLQxIqE"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.linear.app",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167711-linear-connector-for-enterprise-pro",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12167711-linear-connector-for-enterprise-pro",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},google_drive:{name:"Google Drive",tagline:W({defaultMessage:"Get in-depth answers from your Google Drive content",id:"CDmY5AQsRD"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Google Drive files are automatically synced to Perplexity",id:"k0B4qzv3NH"}),W({defaultMessage:"File and folder selection is based on your existing Google Drive permissions",id:"J1Fu/3n3pb"})],consumerBullets:[W({defaultMessage:"Attach files from Google Drive to your query",id:"aUk7jts0tb"})],connectedBullets:[W({defaultMessage:"File and folder selection is based on your existing Google Drive permissions",id:"J1Fu/3n3pb"}),W({defaultMessage:"Opt into High-Precision Search for even more comprehensive answers",id:"5Q/lMIa53X"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://drive.google.com",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12870620-connecting-perplexity-with-google-drive",documentationUrl:null,footnote:null},sharepoint:{name:"SharePoint",tagline:W({defaultMessage:"Get in-depth answers from your SharePoint content",id:"H/XGo2cLQi"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your SharePoint files are automatically synced to Perplexity",id:"3asA6JKlOn"}),W({defaultMessage:"File and folder selection is based on your existing SharePoint permissions",id:"m2/iFnRhkg"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://microsoft.sharepoint.com/",supportUrl:null,documentationUrl:null,footnote:null},onedrive:{name:"OneDrive",tagline:W({defaultMessage:"Get in-depth answers from your OneDrive content",id:"6HI2ZlxJGV"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your OneDrive files are automatically synced to Perplexity",id:"gCHhNKes4R"}),W({defaultMessage:"File and folder selection is based on your existing OneDrive permissions",id:"YCVPoXax40"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage",documentationUrl:null,supportUrl:null,footnote:null},box:{name:"Box",tagline:W({defaultMessage:"Get in-depth answers from your Box content",id:"vj5W7AIDE6"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Box files are automatically synced to Perplexity",id:"tkl3HRlwOf"}),W({defaultMessage:"File and folder selection is based on your existing Box permissions",id:"LuX1iT7lFa"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.box.com/",documentationUrl:null,supportUrl:null,footnote:null},dropbox:{name:"Dropbox",tagline:W({defaultMessage:"Get in-depth answers from your Dropbox content",id:"+RPvqEE51/"}),bullets:[W({defaultMessage:"Selected files and folders are catalogued for higher accuracy search results",id:"zU56hsbCOC"}),W({defaultMessage:"Updates to your Dropbox files are automatically synced to Perplexity",id:"Qnsbs8527p"}),W({defaultMessage:"File and folder selection is based on your existing Dropbox permissions",id:"kzOZ3ZFcW4"})],consumerBullets:[W({defaultMessage:"Attach files from Dropbox to your query",id:"E/rzAALT5B"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.dropbox.com/",documentationUrl:null,supportUrl:null,footnote:null},notion_mcp:{name:"Notion",tagline:W({defaultMessage:"Search and create content on your Notion pages",id:"rXdfDrSVlj"}),bullets:[W({defaultMessage:"Search across your pages and data ",id:"Ib2j2yH5wv"}),W({defaultMessage:"Create new pages in your teamspace from Perplexity",id:"Ltbp+B60OB"}),W({defaultMessage:"Update your data on existing pages directly from Perplexity",id:"ldpNlZAKLQ"}),W({defaultMessage:"Data is retrieved from and written back to Notion whenever you query in Perplexity",id:"nbLEAiWYzT"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"http://www.notion.so/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167654-notion-connector-for-enterprise-pro",footnote:null},github_mcp_direct:{name:"GitHub",tagline:W({defaultMessage:"Search and manage your GitHub repositories",id:"67uxBLu4RH"}),bullets:[W({defaultMessage:"Search, analyze, and summarize your repositories and issues",id:"hi8CvW/ld8"}),W({defaultMessage:"Create, update, and manage issues and pull requests ",id:"6eZgVvjZEw"}),W({defaultMessage:"Monitor workflows ",id:"EduR5immBI"}),W({defaultMessage:"Search and manage notifications to streamline communication",id:"+zOuCOpAH8"}),W({defaultMessage:"Data is retrieved from and written back to GitHub whenever you query in Perplexity",id:"9EQO9mj0sd"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://github.com/",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12275669-github-connector-for-enterprise",documentationUrl:null,footnote:null},asana_mcp_direct:{name:"Asana",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Asana",id:"9AhVP0Y+6c"}),bullets:[W({defaultMessage:"Search across Asana tasks, projects, and teams",id:"GKC+Sx/2dm"}),W({defaultMessage:"Create and update Asana tasks and projects",id:"TnQ0Far/ZY"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Asana whenever you query in Perplexity",id:"9NNVAEg7U3"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://asana.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",footnote:null},asana_mcp_merge:{name:"Asana",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Asana",id:"9AhVP0Y+6c"}),bullets:[W({defaultMessage:"Search across Asana tasks, projects, and teams",id:"GKC+Sx/2dm"}),W({defaultMessage:"Create and update Asana tasks and projects",id:"TnQ0Far/ZY"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Asana whenever you query in Perplexity",id:"9NNVAEg7U3"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://asana.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524801-connecting-perplexity-with-asana",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},atlassian_mcp_direct:{name:"Atlassian",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Atlassian",id:"OKCrVfJwqD"}),bullets:[W({defaultMessage:"Search across Atlassian tasks, projects, and teams",id:"3UDuuWRtR5"}),W({defaultMessage:"Create and update Atlassian tasks and projects",id:"u+44P4c8w+"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Atlassian whenever you query in Perplexity",id:"7gmOJCXim3"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/collections/15347354-app-connectors",footnote:null},jira_mcp_merge:{name:"Jira",tagline:W({defaultMessage:"Plan and track projects, tasks, and team workflows in Jira",id:"DBNOet3M55"}),bullets:[W({defaultMessage:"Search across Jira tasks, projects, and teams",id:"nWIt8qYQz1"}),W({defaultMessage:"Create and update Jira tasks and projects",id:"mUCQ5Z26EF"}),W({defaultMessage:"Track progress, plan cycles, and manage workflows",id:"n+QsTyX68H"}),W({defaultMessage:"Data is retrieved from and written back to Jira whenever you query in Perplexity",id:"CfzDXfmKKD"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524825-connecting-perplexity-with-jira",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524825-connecting-perplexity-with-jira",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},confluence_mcp_merge:{name:"Confluence",tagline:W({defaultMessage:"Search and create content on your Confluence pages",id:"7maYua4COa"}),bullets:[W({defaultMessage:"Search across your pages and data ",id:"Ib2j2yH5wv"}),W({defaultMessage:"Create new pages in your teamspace from Perplexity",id:"Ltbp+B60OB"}),W({defaultMessage:"Update your data on existing pages directly from Perplexity",id:"ldpNlZAKLQ"}),W({defaultMessage:"Data is retrieved from and written back to Confluence whenever you query in Perplexity",id:"Ifp49Im16y"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://www.atlassian.com/",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12524852-connecting-perplexity-with-confluence",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12524852-connecting-perplexity-with-confluence",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},microsoft_teams_mcp_merge:{name:"Microsoft Teams",tagline:W({defaultMessage:"Search and send messages in Microsoft Teams",id:"Rfl+yanh+2"}),bullets:[W({defaultMessage:"Search across Microsoft Teams messages and channels",id:"LF+Ow88sFq"}),W({defaultMessage:"Send and receive messages in Microsoft Teams",id:"1t8qQ+bxf2"}),W({defaultMessage:"Data is retrieved from and written back to Microsoft Teams whenever you query in Perplexity",id:"+bTrwFjG66"})],developer:W({defaultMessage:"Merge",id:"NLSvjhxxpO"}),websiteUrl:"https://teams.microsoft.com",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12674820-microsoft-teams-connector",footnote:{link:"https://www.perplexity.ai/help-center/en/articles/12674820-microsoft-teams-connector",text:W({defaultMessage:"This connector is available through Merge API, Inc. By adding this connector, you agree that Merge will be a data sub-processor.",id:"Hoyn19HgZg"})}},slack_direct:{name:"Slack",tagline:W({defaultMessage:"Search and post messages across your Slack workspace",id:"eGJ5wb/MzJ"}),bullets:[W({defaultMessage:"Search messages across DMs, private channels, and public channels you have access to in Slack",id:"Om6FOnY7N3"}),W({defaultMessage:"Post messages directly to Slack",id:"UOgLjThccO"}),W({defaultMessage:"Data is retrieved from and written back to Slack whenever you run a query in Perplexity",id:"Fy/OA6Fd79"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://slack.com",supportUrl:"https://www.perplexity.ai/help-center/en/articles/12167980-using-the-connector-for-slack",documentationUrl:null,footnote:null},gcal:{name:"Gmail with Calendar",tagline:W({defaultMessage:"Search, create, and manage your emails and calendar events",id:"R3VofVJjT+"}),bullets:[W({defaultMessage:"Search your Gmail and calendar",id:"GCr38D/MA3"}),W({defaultMessage:"Draft and send emails",id:"rMtvi6WyKE"}),W({defaultMessage:"Manage and monitor emails and events",id:"p70DVe/3eQ"}),W({defaultMessage:"Create and update calendar events",id:"ZLhGXocN5/"}),W({defaultMessage:"Data is retrieved from and written back to Gmail and Gcal whenever you query in Perplexity",id:"HsjdaQ7NYa"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://accounts.google.com/InteractiveLogin?emr=1<mpl=default&nojavascript=1&rm=false&service=mail&ss=1",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12168040-connecting-perplexity-with-gmail-and-google-calendar",footnote:null},outlook:{name:"Outlook",tagline:W({defaultMessage:"Search your emails and calendar events",id:"zNVRcAj90b"}),bullets:[W({defaultMessage:"Search your Outlook e-mail and calendar",id:"z5Tw6ljNsF"}),W({defaultMessage:"Manage and monitor emails and events",id:"p70DVe/3eQ"}),W({defaultMessage:"Data is retrieved from and written back to Outlook whenever you query in Perplexity",id:"xX8KEtSv2M"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.microsoft.com/en-us/microsoft-365/outlook/log-in",documentationUrl:null,supportUrl:"https://www.perplexity.ai/help-center/en/articles/12301355-connecting-perplexity-with-outlook-com",footnote:null},zoom:{name:"Zoom",tagline:W({defaultMessage:"Create and manage your Zoom meetings",id:"92puu01bno"}),bullets:[W({defaultMessage:"Create and schedule Zoom meetings",id:"Hg2Nbj5f0/"}),W({defaultMessage:"Manage your Zoom meeting settings",id:"Tb/8DnYiVx"}),W({defaultMessage:"Data is retrieved from and written back to Zoom whenever you query in Perplexity",id:"91ZZe8Fgz9"})],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://zoom.us",documentationUrl:null,supportUrl:null,footnote:null},factset:{name:"FactSet",tagline:W({defaultMessage:"Access financial data and research from FactSet",id:"csQI8CVJ2n"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.factset.com",documentationUrl:null,supportUrl:null,footnote:null},crunchbase:{name:"Crunchbase",tagline:W({defaultMessage:"Access company and startup data from Crunchbase",id:"K/lfyKAVXx"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.crunchbase.com",documentationUrl:null,supportUrl:null,footnote:null},wiley:{name:"Wiley",tagline:W({defaultMessage:"Access academic research and publications from Wiley",id:"EpMrMGNDQ2"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.wiley.com",documentationUrl:null,supportUrl:null,footnote:null},edgar:{name:"EDGAR",tagline:W({defaultMessage:"Access SEC filings and corporate reports",id:"njDhAKsJmy"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.sec.gov/edgar",documentationUrl:null,supportUrl:null,footnote:null},linear:{name:"Linear",tagline:W({defaultMessage:"Get in-depth answers from your Linear content",id:"TDJJ2nF0Dy"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://www.linear.app",documentationUrl:null,supportUrl:null,footnote:null},slack:{name:"Slack",tagline:W({defaultMessage:"Get in-depth answers from your Slack content",id:"XRQBjZFm1m"}),bullets:[],developer:W({defaultMessage:"Perplexity",id:"KCWNcPqV2E"}),websiteUrl:"https://slack.com",documentationUrl:null,supportUrl:null,footnote:null},wiley_mcp_cashmere:{name:"Wiley",tagline:W({defaultMessage:"Access academic research and publications from Wiley",id:"EpMrMGNDQ2"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.wiley.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},cbinsights_mcp_cashmere:{name:"CB Insights",tagline:W({defaultMessage:"Access market intelligence and company data",id:"ey7oCLYTbw"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.cbinsights.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},pitchbook_mcp_cashmere:{name:"PitchBook",tagline:W({defaultMessage:"Access private capital market data",id:"JWsOkBIFuV"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.pitchbook.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}},statista_mcp_cashmere:{name:"Statista",tagline:W({defaultMessage:"Access market and consumer data",id:"XJHKfhIMA3"}),bullets:[],developer:W({defaultMessage:"Cashmere",id:"J/fsB5IZSu"}),websiteUrl:"https://www.statista.com",documentationUrl:null,supportUrl:null,footnote:{link:"https://www.perplexity.ai/help-center",text:W({defaultMessage:"This connector is available through Cashmere. By adding this connector, you agree that Cashmere will be a data sub-processor.",id:"RcTCE2ZvMT"})}}},oRe=e=>e in lQ,aRe=(e,t=g2.DISCONNECTED)=>{const{$t:n}=J(),r=lu(),{data:s}=z4(),o=d.useMemo(()=>s?.find(a=>a.id===e),[s,e]);return d.useMemo(()=>{if(oRe(e)){const{websiteUrl:a,documentationUrl:i,tagline:c,supportUrl:u="https://www.perplexity.ai/help-center/en/articles/10672063-introduction-to-file-connectors-for-enterprise-organizations",footnote:f,consumerBullets:m,bullets:p,connectedBullets:h}=lQ[e],g=[{label:"Website",url:a,icon:B("link")}];i&&g.push({label:"Documentation",url:i,icon:B("book")}),u&&g.push({label:"Support",url:u,icon:B("help")});let y=p;return t===g2.CONNECTED&&h?y=h:!r&&m&&(y=m),{name:kc(e),tagline:c?n(c):null,footnote:f?{link:f.link,text:n(f.text)}:null,bullets:y.map(x=>n(x)),links:g}}if(o){const{name:a,display_name:i,description:c,long_description:u,homepage:f}=o.manifest,m=[];return f&&m.push({label:"Website",url:f,icon:B("link")}),{name:i??a,tagline:c,footnote:null,bullets:u?.split(` -`).map(p=>p.trim()).filter(Boolean)??[],links:m}}return{name:e,tagline:null,footnote:null,bullets:[],links:[]}},[n,e,r,o,t])},iRe=Ce(async()=>{const{ConnectorsEnableModal:e}=await Se(()=>q(()=>import("./ConnectorsEnableModal-CDHU0y1D.js"),__vite__mapDeps([143,4,1,8,3,9,6,7,14,108,10,11,12])));return{default:e}}),cQ=A.memo(({source:e,enabled:t,onToggle:n})=>{const r=ag(),{tagline:s}=aRe(e),o=d.useCallback(()=>{r({origin:ft.SOURCES_VIEW_MORE})},[r]),a=l.jsx(lRe,{source:e,enabled:t,onToggle:n,handleOpenPaywall:o});return s?l.jsx(Fo,{content:s,side:"right",children:l.jsx("span",{children:a})}):a});cQ.displayName="SourcesMenuItemConnector";const lRe=({source:e,enabled:t,onToggle:n,handleOpenPaywall:r})=>{const s="sources-menu-item-connector",{isConnected:o,getConnectionType:a}=sg({reason:s}),{openModal:i}=Uo(),{getSourceLabel:c,getSourceIcon:u}=nc(),f=o(e),m=c(e),p=u(e),h=d.useCallback(()=>{i(iRe,{connectorName:e,connectorAvatar:_3(e),connectionType:a(e),referrer:"ask",openInNewTab:!0,reason:s,legacyIdentifier:"__NONE__",handleOpenPaywall:r})},[i,e,s,a,r]);if(!f){const g=l.jsx(rn,{icon:B("arrow-up-right"),size:"small"});return l.jsx(Dt.Item,{leadingAccessory:p,trailingAccessory:g,onSelect:h,children:m})}return l.jsx(Dt.SwitchItem,{leadingAccessory:p,checked:t,onCheckedChange:n,children:m})};var ow,Cv="HoverCard",[uQ]=Vs(Cv,[Sf]),Sv=Sf(),[cRe,Ev]=uQ(Cv),dQ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:o,openDelay:a=700,closeDelay:i=300}=e,c=Sv(t),u=d.useRef(0),f=d.useRef(0),m=d.useRef(!1),p=d.useRef(!1),[h,g]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:Cv}),y=d.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>g(!0),a)},[a,g]),x=d.useCallback(()=>{clearTimeout(u.current),!m.current&&!p.current&&(f.current=window.setTimeout(()=>g(!1),i))},[i,g]),v=d.useCallback(()=>g(!1),[g]);return d.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),l.jsx(cRe,{scope:t,open:h,onOpenChange:g,onOpen:y,onClose:x,onDismiss:v,hasSelectionRef:m,isPointerDownOnContentRef:p,children:l.jsx(gx,{...c,children:n})})};dQ.displayName=Cv;var fQ="HoverCardTrigger",mQ=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Ev(fQ,n),o=Sv(n);return l.jsx(yx,{asChild:!0,...o,children:l.jsx(Et.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:rt(e.onPointerEnter,x2(s.onOpen)),onPointerLeave:rt(e.onPointerLeave,x2(s.onClose)),onFocus:rt(e.onFocus,s.onOpen),onBlur:rt(e.onBlur,s.onClose),onTouchStart:rt(e.onTouchStart,a=>a.preventDefault())})})});mQ.displayName=fQ;var RA="HoverCardPortal",[uRe,dRe]=uQ(RA,{forceMount:void 0}),pQ=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,o=Ev(RA,t);return l.jsx(uRe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:r})})})};pQ.displayName=RA;var y2="HoverCardContent",hQ=d.forwardRef((e,t)=>{const n=dRe(y2,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,o=Ev(y2,e.__scopeHoverCard);return l.jsx(Hr,{present:r||o.open,children:l.jsx(fRe,{"data-state":o.open?"open":"closed",...s,onPointerEnter:rt(e.onPointerEnter,x2(o.onOpen)),onPointerLeave:rt(e.onPointerLeave,x2(o.onClose)),ref:t})})});hQ.displayName=y2;var fRe=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,...i}=e,c=Ev(y2,n),u=Sv(n),f=d.useRef(null),m=Sn(t,f),[p,h]=d.useState(!1);return d.useEffect(()=>{if(p){const g=document.body;return ow=g.style.userSelect||g.style.webkitUserSelect,g.style.userSelect="none",g.style.webkitUserSelect="none",()=>{g.style.userSelect=ow,g.style.webkitUserSelect=ow}}},[p]),d.useEffect(()=>{if(f.current){const g=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",g),()=>{document.removeEventListener("pointerup",g),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),d.useEffect(()=>{f.current&&pRe(f.current).forEach(y=>y.setAttribute("tabindex","-1"))}),l.jsx(vx,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:rt(o,g=>{g.preventDefault()}),onDismiss:c.onDismiss,children:l.jsx(lM,{...u,...i,onPointerDown:rt(i.onPointerDown,g=>{g.currentTarget.contains(g.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...i.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),mRe="HoverCardArrow",gQ=d.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Sv(n);return l.jsx(cM,{...s,...r,ref:t})});gQ.displayName=mRe;function x2(e){return t=>t.pointerType==="touch"?void 0:e()}function pRe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var hRe=dQ,gRe=mQ,yRe=pQ,xRe=hQ,vRe=gQ,kv="Popover",[yQ]=Vs(kv,[Sf]),Cg=Sf(),[bRe,rc]=yQ(kv),xQ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=Cg(t),c=d.useRef(null),[u,f]=d.useState(!1),[m,p]=fo({prop:r,defaultProp:s??!1,onChange:o,caller:kv});return l.jsx(gx,{...i,children:l.jsx(bRe,{scope:t,contentId:ls(),triggerRef:c,open:m,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:d.useCallback(()=>f(!0),[]),onCustomAnchorRemove:d.useCallback(()=>f(!1),[]),modal:a,children:n})})};xQ.displayName=kv;var vQ="PopoverAnchor",_Re=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=rc(vQ,n),o=Cg(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return d.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(yx,{...o,...r,ref:t})});_Re.displayName=vQ;var bQ="PopoverTrigger",_Q=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=rc(bQ,n),o=Cg(n),a=Sn(t,s.triggerRef),i=l.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":MQ(s.open),...r,ref:a,onClick:rt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:l.jsx(yx,{asChild:!0,...o,children:i})});_Q.displayName=bQ;var DA="PopoverPortal",[wRe,CRe]=yQ(DA,{forceMount:void 0}),wQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=rc(DA,t);return l.jsx(wRe,{scope:t,forceMount:n,children:l.jsx(Hr,{present:n||o.open,children:l.jsx(xx,{asChild:!0,container:s,children:r})})})};wQ.displayName=DA;var Xd="PopoverContent",CQ=d.forwardRef((e,t)=>{const n=CRe(Xd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=rc(Xd,e.__scopePopover);return l.jsx(Hr,{present:r||o.open,children:o.modal?l.jsx(ERe,{...s,ref:t}):l.jsx(kRe,{...s,ref:t})})});CQ.displayName=Xd;var SRe=qp("PopoverContent.RemoveScroll"),ERe=d.forwardRef((e,t)=>{const n=rc(Xd,e.__scopePopover),r=d.useRef(null),s=Sn(t,r),o=d.useRef(!1);return d.useEffect(()=>{const a=r.current;if(a)return rT(a)},[]),l.jsx(lg,{as:SRe,allowPinchZoom:!0,children:l.jsx(SQ,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rt(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:rt(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,u=i.button===2||c;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:rt(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),kRe=d.forwardRef((e,t)=>{const n=rc(Xd,e.__scopePopover),r=d.useRef(!1),s=d.useRef(!1);return l.jsx(SQ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),SQ=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...m}=e,p=rc(Xd,n),h=Cg(n);return nT(),l.jsx(Xx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(vx,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:l.jsx(lM,{"data-state":MQ(p.open),role:"dialog",id:p.contentId,...h,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),EQ="PopoverClose",MRe=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=rc(EQ,n);return l.jsx(Et.button,{type:"button",...r,ref:t,onClick:rt(e.onClick,()=>s.onOpenChange(!1))})});MRe.displayName=EQ;var TRe="PopoverArrow",kQ=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Cg(n);return l.jsx(cM,{...s,...r,ref:t})});kQ.displayName=TRe;function MQ(e){return e?"open":"closed"}var ARe=xQ,NRe=_Q,RRe=wQ,DRe=CQ,jRe=kQ;const IRe=8,wj=10,PRe=200,ORe=300,Cj="rounded-xl",Sj="p-sm",Ej=ci(["rounded-xl","shadow-overlay"],{variants:{appearance:{dark:"bg-dark",light:"bg-base"},side:{top:"data-[state=closed]:animate-slideDownAndFadeOut data-[state=open]:animate-slideUpAndFadeIn",bottom:"data-[state=closed]:animate-slideUpAndFadeOut data-[state=open]:animate-slideDownAndFadeIn",left:"data-[state=closed]:animate-slideRightAndFadeOut data-[state=open]:animate-slideLeftAndFadeIn",right:"data-[state=closed]:animate-slideLeftAndFadeOut data-[state=open]:animate-slideRightAndFadeIn"}},defaultVariants:{appearance:"dark",side:"bottom"}});function Fl({triggerElement:e,children:t,appearance:n="system",side:r="bottom",align:s="center",open:o,onOpenChange:a,maxWidthPx:i=320,offsetPx:c=IRe,shouldShowArrow:u=!1,disabled:f=!1,interaction:m="click",openDelayMs:p,closeDelayMs:h,onWheelContent:g,onContentMouseEnter:y,onContentMouseLeave:x,...v}){const{isMobileStyle:b}=Bo(),{isOpen:_,handleOpenChange:w}=Rme({open:o,onOpenChange:a}),S=nge(),C=n!=="system"?n:S?.colorScheme||"dark",E=wa(v),T=z("overflow-hidden -translate-y-two [clip-path:inset(1px_1px_0px_1px)]",{"fill-[oklch(var(--dark-background-base-color))] dark:stroke-[1.5px] dark:stroke-subtler":C==="dark","fill-[oklch(var(--background-base-color))] stroke-[1.5px] stroke-subtler":C==="light"}),k=d.useCallback(N=>{g?.({deltaX:N.deltaX,deltaY:N.deltaY})},[g]);if(f)return e;if(b)return l.jsx(F$,{isOpen:_,onToggle:w,triggerElement:e,children:l.jsx("div",{className:"text-sm",children:t})});const I="calc(var(--radix-popper-available-height) - 16px)",M=l.jsx("div",{className:z("text-sm",{"text-white":C==="dark","text-default":C==="light"}),style:{maxWidth:i},children:t});return m==="hover"?l.jsxs(hRe,{open:_,onOpenChange:w,openDelay:p??PRe,closeDelay:h??ORe,children:[l.jsx(gRe,{asChild:!0,...E,children:e}),l.jsx(yRe,{children:l.jsxs(xRe,{side:r,align:s,sideOffset:c,avoidCollisions:!0,collisionPadding:wj,className:z(Ej({appearance:C,side:r}),"min-w-[var(--radix-hover-card-trigger-width)]"),onWheel:k,onMouseEnter:y,onMouseLeave:x,onPointerEnter:y,onPointerLeave:x,children:[l.jsx(R3,{className:Cj,maxHeight:I,children:l.jsx("div",{className:Sj,children:M})}),u&&l.jsx(vRe,{width:12,height:6,className:T})]})})]}):l.jsxs(ARe,{open:_,onOpenChange:w,children:[l.jsx(NRe,{asChild:!0,...E,children:e}),l.jsx(RRe,{children:l.jsxs(DRe,{side:r,align:s,sideOffset:c,avoidCollisions:!0,collisionPadding:wj,className:z(Ej({appearance:C,side:r}),"min-w-[var(--radix-popover-trigger-width)]"),onWheel:k,onMouseEnter:y,onMouseLeave:x,onPointerEnter:y,onPointerLeave:x,children:[l.jsx(R3,{className:Cj,maxHeight:I,children:l.jsx("div",{className:Sj,children:M})}),u&&l.jsx(jRe,{width:12,height:6,className:T})]})})]})}const TQ=()=>{const{$t:e}=J();return l.jsx(V,{variant:"micro",color:"super",className:"border-super inline-block rounded border px-1 py-0",children:e({id:"Hw1hSDsL+0",defaultMessage:"Premium data"})})};TQ.displayName="PremiumSourceBadge";const LRe=(e,t)=>{switch(e){case"wiley_mcp_cashmere":return t.formatMessage({defaultMessage:"Search business, medical, STEM, and psychology books, and medical & life sciences journals",id:"RX0/lKeA+h"});case"cbinsights_mcp_cashmere":return t.formatMessage({defaultMessage:"Search market insights, market maps, and company activity",id:"7NjNyz7XKj"});case"pitchbook_mcp_cashmere":return t.formatMessage({defaultMessage:"Search firmographics for private and public companies",id:"pCeNCFTGuu"});case"statista_mcp_cashmere":return t.formatMessage({defaultMessage:"Search aggregated statistics, market data, trends, and forecasts",id:"vo4Zj58C7M"});default:At(e)}},FRe=e=>{switch(e){case"wiley_mcp_cashmere":return xV;case"cbinsights_mcp_cashmere":return vV;case"pitchbook_mcp_cashmere":return bV;case"statista_mcp_cashmere":return _V;default:return e}},BRe={wiley_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12868503-using-perplexity-with-wiley",pitchbook_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869442-leveraging-pitchbook-data-with-perplexity",statista_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869733-using-premium-statista-data-with-perplexity",cbinsights_mcp_cashmere:"https://www.perplexity.ai/help-center/en/articles/12869855-integrating-cb-insights-data-with-perplexity"},URe=({sourceId:e})=>{const t=J(),{isMax:n}=$t(),r=FRe(e),s=LRe(e,t),o=BRe[e];return l.jsxs("div",{className:z("flex flex-col gap-2 p-2",{"max-super-override":n}),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx(V,{variant:"tinyBold",color:"white",children:r}),l.jsx(TQ,{})]}),l.jsx(V,{variant:"tiny",color:"white",className:"text-pretty",children:s}),o&&l.jsx("p",{className:"text-pretty text-xs text-white",children:l.jsx(qh,{href:o,target:"_blank",rel:"noopener",variant:"inline",muted:!0,children:t.formatMessage({defaultMessage:"Learn about complementary paid content from {sourceName}",id:"8uL70j2Vzs"},{sourceName:r})})}),l.jsx(HRe,{})]})},VRe=({variant:e,onClick:t,children:n})=>l.jsx(Ro,{onClick:t,className:z(_x({variant:"primary",size:"small",disabled:!1,fullWidth:!1,rounded:!1,pill:!1,inline:!1}),{"!bg-max hover:!bg-max":e==="max"}),children:n}),HRe=()=>{const{$t:e}=J(),{openModal:t}=pn().legacy;lu();const{hasAccessToProFeatures:n,isMax:r}=$t(),s=d.useCallback(()=>{t("pricingModal",{origin:ft.PREMIUM_SOURCE_TOOLTIP})},[t]),o=zRe({hasAccessToProFeatures:n,hasAccessToMaxFeatures:r});if(!o)return null;const a=n&&!r,i=a?"max":"pro",c=z("text-pretty",{"text-max":a,"text-super":!a});return l.jsxs(l.Fragment,{children:[l.jsx("hr",{className:"border-subtle bg-subtle my-2"}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tinyRegular",className:c,children:e(o.title)}),l.jsx(VRe,{variant:i,onClick:s,children:e(o.action)})]})]})};function zRe({hasAccessToProFeatures:e,hasAccessToMaxFeatures:t}){return e?t?null:{title:W({defaultMessage:"Get more queries with Max",id:"0iyoM20VTJ"}),action:W({defaultMessage:"Try Perplexity Max",id:"oorH6wdruv"})}:{title:W({defaultMessage:"Get more queries with Pro",id:"BZEuCK3Abs"}),action:W({defaultMessage:"Try Perplexity Pro",id:"qXQPclCIaf"})}}const AQ=A.memo(({source:e,enabled:t,onToggle:n})=>{const{openOverlayId:r,setOpenOverlayId:s}=Bo(),{getSourceLabel:o,getSourceIcon:a}=nc(),i=o(e),c=a(e),{getSourceLimit:u}=K4(),f=d.useRef(null),m=d.useId(),p=d.useCallback(()=>{f.current&&clearTimeout(f.current),s(m)},[m,s]),h=d.useCallback(()=>{f.current=setTimeout(()=>{s(x=>x===m?null:x)},300)},[m,s]),g=d.useMemo(()=>{const{remaining:x}=u(e);return x===0},[u,e]),y=d.useMemo(()=>l.jsx("div",{onMouseEnter:p,onMouseLeave:h,children:l.jsx(Dt.SwitchItem,{leadingAccessory:c,checked:t,onCheckedChange:n,disabled:g,children:i})}),[g,t,p,h,c,i,n]);return l.jsx(Fl,{interaction:"hover",appearance:"dark",triggerElement:y,side:"right",open:r===m,onOpenChange:Ao,children:l.jsx("div",{onMouseEnter:p,onMouseLeave:h,children:l.jsx(URe,{sourceId:e})})})});AQ.displayName="SourcesMenuItemPremiumData";const WRe=(e,t)=>{if(Wi(e))return Yx[e].description(t)},iE=d.memo(({source:e,enabled:t,onToggle:n})=>{const r=J(),{getSourceLabel:s,getSourceIcon:o}=nc(),a=s(e),i=o(e),c=WRe(e,r),u=l.jsx(Dt.SwitchItem,{leadingAccessory:i,checked:t,onCheckedChange:n,children:a});return c?l.jsx(Fo,{content:c,side:"right",children:u}):u});iE.displayName="SourcesMenuItemSource";const NQ=A.memo(({source:e,enabled:t,onToggle:n})=>{const{isMax:r}=$t(),s=d.useCallback(o=>{o.stopPropagation()},[]);return l.jsx("div",{onClick:s,className:z({"max-super-override":r}),children:l.jsx(GRe,{source:e,enabled:t,onToggle:n})})});NQ.displayName="SourcesMenuItem";const GRe=({source:e,enabled:t,onToggle:n})=>Jh(e)?l.jsx(AQ,{source:e,enabled:t,onToggle:n}):Wi(e)?l.jsx(iE,{source:e,enabled:t,onToggle:n}):uu(e)?l.jsx(cQ,{source:e,enabled:t,onToggle:n}):Ja(e)?l.jsx(iQ,{source:e,enabled:t,onToggle:n}):l.jsx(iE,{source:e,enabled:t,onToggle:n}),RQ=A.memo(({source:e,onSourceToggled:t,isSourceEnabled:n})=>{const r=d.useCallback(s=>t(e,s),[t,e]);return l.jsx(NQ,{source:e,enabled:n(e),onToggle:r},e)});RQ.displayName="MemoizedSourceMenuItem";const jA=A.memo(({sources:e,isSourceEnabled:t,onSourceToggled:n})=>e.map(r=>l.jsx(RQ,{source:r,onSourceToggled:n,isSourceEnabled:t},r)));jA.displayName="SourcesMenuItems";const DQ=A.memo(({sources:e,isSourceEnabled:t,onSourceToggled:n,minWidthPx:r,isOpen:s,onToggle:o})=>{if(e.length===0)return null;const a=s?{isOpen:s,onToggle:o}:{};return l.jsx(Dt.Submenu,{...a,triggerElement:l.jsx(Dt.SubmenuItem,{children:l.jsx(je,{defaultMessage:"More sources",id:"VQ/e7ISbIh"})}),minWidthPx:r,children:l.jsx(jA,{sources:e,isSourceEnabled:t,onSourceToggled:n})})});DQ.displayName="SourcesMenuMoreSourcesSubmenu";const $Re="sources-menu-suggested-sources",jQ=A.memo(({sources:e,onSourceToggled:t,isSourceEnabled:n})=>l.jsx("div",{"data-testid":$Re,children:l.jsx(jA,{sources:e,isSourceEnabled:n,onSourceToggled:t})}));jQ.displayName="SourcesMenuSuggestedSources";const qRe=({sources:e,omit:t=[]})=>{const n="use-enabled-sources",{isConnected:r}=sg({reason:n}),s=d.useMemo(()=>{const o=new Set;return e.forEach(a=>{if(!t.includes(a)){if(!uu(a)||Jh(a)){o.add(a);return}r(a)&&o.add(a)}}),Array.from(o)},[e,t,r]);return d.useMemo(()=>({sources:s}),[s])},KRe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"sources-dropdown-ui-redesign-files",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},YRe="pplx_source_activity",IA=()=>{const[e,t]=Qi(YRe,[]),n=d.useCallback(r=>{t(s=>[{sourceType:r,lastUsedAt:Date.now()},...s].slice(0,25))},[t]);return d.useMemo(()=>({activity:e,trackSourceActivity:n}),[e,n])},QRe=["edgar","cbinsights_mcp_cashmere","gcal","google_drive"],IQ=({sources:e,defaultSuggestions:t=QRe,count:n=5})=>{const{activity:r}=IA(),[s,o]=d.useState(r),a=d.useMemo(()=>{const c=new Set(["web"]);return s.sort((u,f)=>f.lastUsedAt-u.lastUsedAt).map(u=>u.sourceType).filter(ha).forEach(u=>c.add(u)),t.forEach(u=>c.add(u)),e.forEach(u=>c.add(u)),Array.from(c).filter(u=>e.includes(u)).slice(0,n)},[s,n,e,t]),i=d.useCallback(()=>{o(r)},[r]);return d.useMemo(()=>({suggested:a,refresh:i}),[a,i])},kj=225,XRe={crunchbase:["web"]},ZRe={web:["crunchbase"]},PQ=({isOpen:e,sources:t,tooltip:n,size:r="default",disabled:s=!1,onChange:o,onOpen:a,onClose:i,triggerElement:c,omittedSources:u,omitCometMcpSources:f=!1})=>{const m="sources-menu",{isAllowed:p}=sg({reason:m}),{sources:h}=X4({omitCometMcpSources:f,isConnectorAllowed:p,omittedSources:u}),{trackSourceActivity:g}=IA(),{variation:y}=KRe(!1),{suggested:x,refresh:v}=IQ({sources:h}),{sources:b}=qRe({sources:h,omit:x}),_=d.useMemo(()=>h.filter(M=>!x.includes(M)&&!b.includes(M)),[h,x,b]),w=d.useMemo(()=>[...b,..._],[b,_]),S=d.useCallback(M=>{M?(v(),a?.()):i?.()},[a,i,v]),C=d.useCallback(M=>t.includes(M),[t]),E=d.useCallback(M=>{g(M);const N=new Set([...t,M]);XRe[M]?.forEach(D=>{N.add(D)}),o(Array.from(N))},[t,o,g]),T=d.useCallback(M=>{const N=new Set(t);N.delete(M),ZRe[M]?.forEach(D=>{N.delete(D)}),o(Array.from(N))},[t,o]),k=d.useCallback((M,N)=>{C(M)!==N&&(N?E(M):T(M))},[C,E,T]),I=d.useMemo(()=>c??l.jsx(aQ,{sources:t,size:r,disabled:s,tooltip:n}),[c,t,r,s,n]);return l.jsxs(Dt,{isOpen:e,onToggle:S,align:"end",minWidthPx:kj,triggerElement:I,maxHeightPx:400,children:[y&&l.jsxs(l.Fragment,{children:[l.jsx(sQ,{}),l.jsx(Dt.Separator,{})]}),l.jsx(jQ,{sources:x,isSourceEnabled:C,onSourceToggled:k}),l.jsx(Dt.Separator,{}),l.jsx(DQ,{sources:w,isSourceEnabled:C,onSourceToggled:k,minWidthPx:kj})]})};PQ.displayName="SourcesMenuContent";const PA=d.memo(e=>l.jsx(rQ,{children:l.jsx(PQ,{...e})}));PA.displayName="SourcesMenu";const Mj=He({disabled:{defaultMessage:"Start a new thread to change sources",id:"jKXi56aXv8"},enabled:{defaultMessage:"Set sources for search",id:"yAyuRoLEjt"}}),OQ=A.memo(({disabled:e=!1,...t})=>{const{$t:n}=J(),r=n(e?Mj.disabled:Mj.enabled);return l.jsx(PA,{disabled:e,tooltip:r,...t})});OQ.displayName="AskInputSourcesMenu";const LQ=A.memo(({isInitializing:e,startTranscription:t,error:n=null,disabled:r=!1})=>{const{$t:s}=J(),[o,a]=d.useState(e),i=d.useCallback(()=>{a(!0),t?.()},[t]);return d.useEffect(()=>{n&&a(!1)},[n]),l.jsx("div",{className:"relative",children:l.jsx(wt,{"aria-label":s({defaultMessage:"Dictation",id:"0eNg7Kdki1"}),icon:B("microphone"),isLoading:!n&&(e||o),variant:"text",onClick:i,disabled:r,size:Ht.small})})});LQ.displayName="DictationButton";const FQ=A.memo(({stopTranscription:e})=>{const{$t:t}=J();return l.jsx("div",{className:"relative",children:l.jsx(wt,{"aria-label":t({defaultMessage:"Stop dictation",id:"De+8liLWgX"}),icon:B("player-stop-filled"),variant:"tonal",onClick:e,disabled:!1,size:Ht.small})})});FQ.displayName="DictationStopButton";const BQ=A.memo(({onSubmit:e,isDisabled:t=!1,toolTip:n})=>{const{$t:r}=J();return l.jsxs("div",{className:"relative ml-2",children:[l.jsx("div",{className:"bg-super/20 absolute inset-[10%] animate-[ping_1.5s_cubic-bezier(0,0,0.2,1)_infinite] rounded-lg"}),l.jsx(wt,{"aria-label":n||r({defaultMessage:"Submit dictation",id:"gDpUQHAEOK"}),icon:B("check"),variant:"primary",onClick:e,disabled:t,size:Ht.small})]})});BQ.displayName="DictationSubmitButton";const UQ=A.memo(({onStopButtonClick:e,variant:t="inverted"})=>{const{$t:n}=J();return l.jsx(V4,{isVisible:!0,animationType:"slide",children:t==="tonal"?l.jsx(wt,{"aria-label":n({defaultMessage:"Stop generating response",id:"wXXKXUJh1s"}),variant:"tonal",icon:B("player-stop-filled"),onClick:e,size:"small"}):l.jsx(Ge,{toolTip:n({defaultMessage:"Stop generating response",id:"wXXKXUJh1s"}),variant:t,icon:B("player-stop-filled"),onClick:e,size:"small",extraCSS:"text-caution hover:!bg-caution hover:!text-white ml-2"})})});UQ.displayName="StopButton";const Gf=A.memo(()=>l.jsx("div",{className:"bg-base fixed inset-0 z-[999] flex h-screen w-screen items-center justify-center opacity-50"}));Gf.displayName="VoiceToVoiceModalLoader";Ce(async()=>{const{VoiceToVoiceModal:e}=await Se(()=>q(()=>import("./VoiceToVoiceModal-BQNxUwE1.js"),__vite__mapDeps([144,4,1,9,3,6,7,145,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})});const VQ=A.memo(()=>{const{openModal:e}=pn().legacy,{openModal:t}=pn().updated,{$t:n}=J(),r=Wt(),s=Rn(),o=d.useCallback(()=>{r?s.push("/speak"):e("loginModal",{origin:ft.VOICE_TO_VOICE_BUTTON,pitchMessage:{title:"Sign in to unlock voice mode"}})},[r,e,t,s]);return l.jsx("div",{className:"ml-2",children:l.jsx(wt,{onClick:o,size:Ht.small,icon:KU,variant:"primary",disabled:!1,"aria-label":n({defaultMessage:"Voice mode",id:"OnF9aqAuar"})})})});VQ.displayName="VoiceToVoiceButton";const JRe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"enable-clarifying-questions",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function HQ(){const{variation:e}=JRe(!1);return e}function lE(e={}){const t=new URL(window.location.href);for(const[n,r]of Object.entries(e))typeof r>"u"?t.searchParams.delete(n):t.searchParams.set(n,r);zQ(Object.fromEntries(t.searchParams))}function zQ(e){const t=new URL(window.location.href),r=(e?new URLSearchParams(e):new URLSearchParams).toString();r!==t.searchParams.toString()&&window.history.replaceState({},"",`?${r}`)}const WQ=A.memo(({toolTip:e,icon:t,isDisabled:n,value:r,querySource:s,size:o=Ht.small,handleSubmit:a,...i})=>l.jsx(Ge,{...i,ariaLabel:"Submit",toolTip:e,icon:t,variant:"primary",size:o,onClick:n?void 0:()=>a({query:r,querySource:s}),disabled:n,extraCSS:"!duration-100"}));WQ.displayName="SubmitButton";const Tj=Ce(async()=>{const{VoiceToVoiceModal:e}=await Se(()=>q(()=>import("./VoiceToVoiceModal-BQNxUwE1.js"),__vite__mapDeps([144,4,1,9,3,6,7,145,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),aw=({className:e,...t})=>l.jsx("div",{className:e,children:l.jsx(WQ,{...t,value:""})}),e9e=({value:e,json:t,submitWillFork:n,isFollowUp:r,isDisabled:s,querySource:o,errorMessage:a,handleSubmit:i,fileUploadRef:c,showFileUpload:u,fileUploadTooltip:f,showStopButton:m,showModelSelector:p,onStopButtonClick:h,onFilePickerOpen:g,onFilePickerClose:y,showSources:x,useThreadSources:v,showRecency:b,disableActionButtons:_,startTranscription:w,stopTranscription:S,isTranscribing:C,isTranscriptionInitializing:E,isTranscriptionAvailable:T,transcriptionError:k=null,fileUploadErrorMessage:I,fileUploadWarningMessage:M,activeConnector:N=null,uploadedFiles:D,handleStartUpload:j,handleFileInput:F,isBoxFilePickerOpen:R=!1,handleCloseBoxFilePicker:P,cleanupBoxFilePicker:L,microsoftFilePickerOptions:U=null,handleCloseMicrosoftFilePicker:O,handleSelectSharepointSite:$,isMicrosoftFilePickerOpen:G=!1,fileInputRef:H,hasQuery:Q,isAudioVideoFilesEnabled:Y=!1,setAttachmentErrorMessage:te,isCometHome:se,isMissionControl:ae})=>{const X="ask-input-right-attributions",{isMobileStyle:ee,isMobileUserAgent:le}=Re(),{openModal:re}=pn().updated,{organization:ce}=mo({reason:X}),{$t:ue}=J(),me=HQ(),{activeMenu:we}=qr(),{onActiveMenuChange:ye}=jo(),{device:{isWindowsApp:_e}}=sn(),ke=fn(),{fileRepoInfo:De}=zx({reason:X}),xe=De.file_repository_type==="COLLECTION",Ue=b&&xe&&!r,Ee=d.useRef(e),Ke=d.useRef(t);Ee.current=e,Ke.current=t;const Nt=d.useCallback(({querySource:$e})=>{i({query:Ee.current,json:Ke.current,querySource:$e})},[i]),pe=D4($e=>$e.results.find(ht=>qt.isStatusPending(ht))),ve=an(pe?.display_model)==oe.RESEARCH||an(pe?.display_model)==oe.STUDIO;d.useEffect(()=>{if(!_e)return;const $e=new URLSearchParams(window.location.search);$e.get("voice-mode")?(lE({"voice-mode":void 0}),w?.()):$e.get("v2v")&&(lE({v2v:void 0}),re(Tj,{legacyIdentifier:"voiceToVoiceModal"}))},[ke,_e,w,re]),d.useEffect(()=>{const $e=()=>{T&&(C?S?.():w?.())},ht=()=>{re(Tj,{legacyIdentifier:"voiceToVoiceModal"})};return document.addEventListener("toggleVoiceToVoice",ht),document.addEventListener("toggleDictation",$e),()=>{document.removeEventListener("toggleDictation",$e),document.removeEventListener("toggleVoiceToVoice",ht)}},[C,T,w,S,re]);const Ae=!ae&&!r&&!se&&(!le&&!ee||!0),We=n?B("git-fork"):B("arrow-up"),pt=m&&me&&ve,Gt=()=>!pt||!o?null:l.jsx("div",{className:s?"pointer-events-none opacity-50":"",children:l.jsx(aw,{className:"ml-3",toolTip:a||ue({defaultMessage:"Anything else to consider?",id:"DDAw7Ictpp"}),icon:We,querySource:o,isDisabled:!1,handleSubmit:Nt})}),Le=()=>{if(_)return l.jsx(aw,{className:"ml-2",isDisabled:!0,icon:We,querySource:o??"home",handleSubmit:Ao});const $e=o&&l.jsx(aw,{className:"ml-2",toolTip:a||(n?ue({defaultMessage:"Start your own thread",id:"TAA16rUT4G"}):""),icon:We,isDisabled:s,querySource:o,handleSubmit:Nt},"submit-button"),ht=[];if(T&&(C?(ht.push(l.jsx(FQ,{stopTranscription:S},"dictation-stop-button")),o&&ht.push(l.jsx(BQ,{onSubmit:Pt},"dictation-submit-button"))):ht.push(l.jsx(LQ,{isInitializing:E,startTranscription:w,error:k,disabled:m},"dictation-button"))),m){const Zt=pt?"tonal":"inverted";ht.push(l.jsx(UQ,{onStopButtonClick:h,variant:Zt},"stop-button"))}else if(Ae){const Zt=(D?.length||Q)&&o&&!C;Zt?ht.push($e):!C&&!Zt&&ht.push(l.jsx(VQ,{},"voice-to-voice-button"))}else C||ht.push($e);return T||Ae?ht:$e},gt=d.useCallback(()=>ye(null),[ye]),Je=d.useCallback(()=>ye(Ir.RECENCY),[ye]);d.useCallback(()=>ye(Ir.ATTACHMENTS),[ye]);const Me=d.useCallback(()=>ye(Ir.UNIFIED_SOURCES),[ye]),{sources:Ve,setSources:lt}=pW({useThreadSources:v,reason:X}),xt=d.useMemo(()=>{if(!x)return!1;const $e=Ve.every(ht=>ht==="web");return r&&$e?!1:x},[x,r,Ve]),Pt=d.useCallback(()=>{S?.(),Q&&i({query:Ee.current,json:Ke.current,querySource:o})},[S,Q,i,o]);return C?l.jsxs(rE,{children:[o&&Le(),Gt()]}):l.jsxs(rE,{children:[xt&&l.jsx(OQ,{isOpen:we===Ir.UNIFIED_SOURCES,size:"small",sources:Ve,onChange:lt,onOpen:Me,onClose:gt,disabled:v}),p&&l.jsx(XY,{uploadedFiles:D}),Ue&&l.jsx(JY,{isOpen:we===Ir.RECENCY,onOpen:Je,onClose:gt}),u&&!1,o&&Le(),Gt()]})},GQ=A.memo(e9e);GQ.displayName="AskInputRightAttribution";const t9e=60,n9e=2e3,r9e=6,s9e=4,kp=(e,t)=>e?s9e:r9e,o9e=e=>!(e.length===0||e.includes(` -`)),a9e=e=>e.map(t=>({query:t.text,image:t.image_url,url:t.url,title:t.title,description:t.description,focus:t.focus})),i9e=e=>e.sort((t,n)=>t.url?-1:n.url?1:t.image?-1:n.image?1:0),cE=(e,t,n)=>{let r=e;r=e.filter(a=>!a.url);const s=jU(r,"query");if(n){const a=s.findIndex(i=>i.query===n);if(~a){const i=s[a];s.splice(a,1),s.unshift(i)}}const o=i9e(s);return[o,o.slice(0,kp(t))]},$Q=(e,t,n)=>{const r=n?e.replace(/\s+/g,"").toLocaleLowerCase():e,s=t.query;let o=0,a=0;for(;o{const n=e.replace(/\s+/g,""),r=[];let s="",o="",a=0,i=0;for(;ae?.includes("perplexity.ai")??!1,d9e=e=>e?.includes("perplexity.ai/finance")??!1,qQ=e=>e==="https://www.perplexity.ai/finance",KQ=A.memo(({query:e,completion:t,inputsAndCompletions:n,description:r,highlightPrefix:s,url:o,title:a,shouldShowTitle:i})=>{const c=d9e(o),u=qQ(o),f=r||(i&&a?a:e),m=c?f.toUpperCase():f,{$t:p}=J(),h=c?t?.toUpperCase():t;return u?l.jsx(V,{variant:"small",inline:!0,children:p({defaultMessage:"{perplexity} Finance",id:"LnL5Kdg1cp"},{perplexity:"Perplexity"})},"perplexity-finance"):l.jsxs(l.Fragment,{children:[!r&&n?.length&&s?n.map(([g,y],x)=>g?l.jsx(V,{color:"light",variant:"small",className:"inline",as:"div",children:g},`${x}-${g}`):l.jsx(V,{className:"inline whitespace-pre",variant:"small",as:"div",children:y},`${x}-${y}`)):l.jsx(V,{inline:!0,color:"light",variant:"small",children:m}),t&&!r&&s&&!n?.length&&l.jsx(V,{className:"whitespace-pre",inline:!0,variant:"small",children:h}),t&&!r&&!s&&l.jsx(V,{color:"light",inline:!0,variant:"small",children:h})]})});KQ.displayName="DefaultQueryContentComponent";const YQ=A.memo(({onClick:e,query:t,completion:n,inputsAndCompletions:r,url:s,suggestionIndex:o,keyboardFocusedIndex:a,setKeyboardFocusedIndex:i,leftIcon:c,rightIcon:u,className:f,description:m,title:p,shouldShowTitle:h,highlightPrefix:g=!0,category:y,QueryContentComponent:x=KQ,metadata:v,actionHandler:b})=>{const{isMobileUserAgent:_}=Re(),w="group-hover:opacity-100 group-data-[focused=self]:opacity-100",S="opacity-0 group-data-[focused=other]:opacity-0",C=d.useCallback(()=>{i?.(-1)},[i]),E=d.useCallback(T=>h&&p&&t?l.jsx(Io,{tooltipText:t,bodyClassName:"max-w-[300px]",showTooltip:!0,asChild:!0,tooltipLayout:"right",children:T}):T,[h,p,t]);return l.jsx(St,{children:E(l.jsx("div",{"data-focused":a===void 0||a===-1?"none":a===o?"self":"other","data-testid":`auto-suggestion-${(o??0)+1}`,className:z("group flex cursor-pointer flex-row items-start rounded-lg p-[8px]",f),onPointerDown:()=>{b?b():e(n?t+n:t)},onPointerLeave:C,children:l.jsxs("div",{className:"flex w-full min-w-0 flex-row whitespace-pre leading-tight",children:[l.jsx(V,{className:"-mr-three",color:"light",inline:!0,variant:"small",children:c}),l.jsx(V,{variant:"small",className:_?"truncate":"line-clamp-2 text-wrap",children:s?l.jsx(yt,{href:s,target:"_blank",rel:"noopener",children:l.jsx(x,{query:t,url:s,completion:n,inputsAndCompletions:r,description:m,category:y,highlightPrefix:g,metadata:v,title:p,shouldShowTitle:h})}):l.jsx(x,{query:t,url:s,completion:n,inputsAndCompletions:r,description:m,category:y,highlightPrefix:g,metadata:v,title:p,shouldShowTitle:h})}),u&&l.jsx(V,{variant:"smallBold",color:"super",inline:!0,className:z("pr-xs ml-auto",w,{[S]:!s}),children:u})]})}))})});YQ.displayName="SuggestionCard";const uE={ticker:{order:0,showHeader:!1,highlightPrefix:!1},suggestion:{order:1,showHeader:!1,highlightPrefix:!0},news:{displayName:"Latest News",order:2,showHeader:!0,highlightPrefix:!1},related_question:{displayName:"Related Questions",order:3,showHeader:!0,highlightPrefix:!1},shortcuts:{displayName:"Shortcuts",order:4,showHeader:!0,highlightPrefix:!0}},f9e=e=>{const t={};return e.forEach(n=>{const r=n.category||"suggestion";t[r]||(t[r]=[]),t[r].push(n)}),t},m9e=e=>Object.keys(e).sort((t,n)=>{const r=uE[t]?.order??Number.MAX_SAFE_INTEGER,s=uE[n]?.order??Number.MAX_SAFE_INTEGER;return r-s}),Aj=e=>{const{metadata:t}=e;return!!t&&t.type==="price"&&!!t.price_info&&typeof t.price_info.currentPrice=="number"&&!!t.price_info.change&&!!t.price_info.changePercentage},p9e=e=>[...e].sort((t,n)=>{const r=Aj(t),s=Aj(n);return r&&!s?-1:!r&&s?1:0}),QQ=A.memo(e=>{const{text:t,show:n,className:r}=e;return n?l.jsxs(l.Fragment,{children:[l.jsx(K,{className:z("my-sm sm:mx-sm border-b first:hidden",r)}),t&&l.jsx(K,{variant:"transparent",className:"sm:mx-sm mt-xs mb-sm pr-sm",children:l.jsx(V,{className:"w-max",variant:"tinyMono",color:"light",children:t})})]}):null});QQ.displayName="GroupItemSeparator";const XQ=A.memo(({category:e,suggestions:t,categoryConfig:n,value:r,focusedIndex:s,setFocusedIndex:o,handleSubmit:a,indexOffset:i,LeftIconComponent:c,RightIconComponent:u,QueryContentComponent:f,onFillButtonClick:m,titleClassName:p})=>{const h=d.useMemo(()=>e==="ticker"?p9e(t):t,[e,t]);return t.length?l.jsxs(l.Fragment,{children:[l.jsx(QQ,{show:n.showHeader,text:n.displayName,className:p}),h.map((g,y)=>l.jsx(ZQ,{suggestion:g,index:y,category:e,categoryConfig:n,value:r,focusedIndex:s,setFocusedIndex:o,handleSubmit:a,indexOffset:i,LeftIconComponent:c,RightIconComponent:u,onFillButtonClick:m,QueryContentComponent:f,highlightPrefix:n.highlightPrefix??!0},`${e}-${g.identifier||g.query_uuid||g.input+g.completion}`))]}):null});XQ.displayName="SuggestionGroup";const ZQ=A.memo(({suggestion:{input:e,completion:t,query_uuid:n,image:r,imageDark:s,url:o="",description:a,identifier:i="",category:c,title:u="",subscribed:f=!1,metadata:m,submission_query:p,inputs_and_completions:h,icon_name:g,shouldShowTitle:y,actionHandler:x,isPersonalized:v},index:b,LeftIconComponent:_,QueryContentComponent:w,RightIconComponent:S,highlightPrefix:C,focusedIndex:E,handleSubmit:T,indexOffset:k,onFillButtonClick:I,setFocusedIndex:M,value:N})=>{const D=d.useCallback(P=>T({query:P,query_uuid:n,url:o,identifier:i,category:c,description:a,image:r,imageDark:s,title:u,subscribed:f,submission_query:p,isPersonalized:v},b+k),[c,a,T,i,r,s,b,k,n,p,f,u,o,v]),j=d.useCallback(()=>{I(e+t,o)},[t,e,I,o]),F=d.useMemo(()=>l.jsx(_,{image:r,imageDark:s,alt:e+N,url:o,category:c,iconName:g,value:N}),[_,c,g,r,s,e,o,N]),R=d.useMemo(()=>l.jsx(S,{onClick:j,url:o,isSelected:f,metadata:m,category:c}),[S,j,o,f,m,c]);return l.jsx(YQ,{onClick:D,query:e,completion:t,inputsAndCompletions:h,url:o,suggestionIndex:b+k,keyboardFocusedIndex:E,setKeyboardFocusedIndex:M,description:a,title:u,shouldShowTitle:y,highlightPrefix:C,className:z("hover:bg-subtler","data-[focused=self]:bg-subtler","dark:data-[focused=self]:bg-subtler","hover:data-[focused=other]:bg-raised","dark:hover:data-[focused=other]:bg-subtler"),category:c,QueryContentComponent:w,metadata:m,leftIcon:F,rightIcon:R,actionHandler:x})});ZQ.displayName="SuggestionCardFactory";const JQ=A.memo(({image:e,alt:t,url:n,iconName:r,value:s,category:o})=>{const a=s.length===0,[i,c]=d.useState(!1),{sidecarSourceTab:{url:u}}=Qn(),f=Vo(),m=d.useMemo(()=>{if(u&&a)return Kp(u);if(e)return e;if(n)return BK(n)},[e,n,u,a]),p=r?c9e[r]:null,h=a?y1e(f):B("search");return o==="shortcuts"&&!r?l.jsx(ge,{icon:B("slash"),size:"sm",className:"mt-two mr-2 w-5 shrink-0"}):qQ(n)?l.jsx("div",{className:"mr-2 flex size-5 shrink-0 items-center justify-center",children:l.jsx(ge,{icon:Jme,size:"sm",className:"text-foreground"})}):m&&!i?l.jsx("div",{className:"relative mr-2 size-5 shrink-0 overflow-hidden rounded-sm",children:l.jsx("img",{src:m,alt:t??"suggestion",className:"object-cover",sizes:"24px",onError:()=>c(!0)})}):l.jsx("div",{className:"flex shrink-0 items-center mr-2 w-5",children:l.jsx(ge,{icon:i&&n?B("world"):p??h,size:"sm"})})});JQ.displayName="LeftIcon";const eX=A.memo(({onClick:e,url:t,category:n})=>n==="shortcuts"?null:u9e(t)?l.jsx("div",{className:"flex h-full items-center",children:l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet"})}):l.jsx("button",{className:"appearance-none",onPointerDown:r=>{r.stopPropagation(),r.preventDefault(),e(r)},type:"button",children:l.jsx(ge,{icon:t?B("world-share"):B("arrow-up-right"),size:"sm",className:"-mb-xs"})}));eX.displayName="RightIcon";const OA=A.memo(({isOpen:e,suggestedQueries:t,focusedIndex:n,setFocusedIndex:r,handlePasteQuery:s,handleSubmit:o,dropdownClassName:a,dropdownType:i="query",components:c,value:u,children:f,popoverClassName:m,categoryTitleClassName:p,userInputQuery:h,portalTarget:g,placement:y="bottom",allowNonSequentialMatch:x=!1,renderSettingsRow:v,scrollableShards:b=[],floatingStrategy:_,shouldEnableStacking:w=!1})=>{const{session:S}=Ne(),{trackEvent:C}=Xe(S),{RightIconComponent:E=eX,LeftIconComponent:T=JQ,QueryContentComponent:k}=c??{},I=d.useMemo(()=>t.map(({query:Q,query_uuid:Y,image:te,imageDark:se,url:ae,title:X,description:ee="",identifier:le="",category:re,subscribed:ce=!1,metadata:ue,submission_query:me,icon:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke,focus:De},xe,Ue)=>{if(i==="select")return{input:Q,completion:"",query_uuid:Y,title:X,image:te,imageDark:se,url:ae,description:ee,identifier:le,category:re,subscribed:ce,submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke};const Ee=h?n===-1?u:h:u;return Ee.length>0&&Q.startsWith(Ee)?{input:Ee,completion:Q.slice(Ee.length),query_uuid:Y,title:X,image:te,imageDark:se,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke}:x&&!ee&&Ee.length>0&&Ee.length<=Q.length&&Ue[xe]&&$Q(Ee,Ue[xe],!0)[0]?{input:"",completion:Q,inputs_and_completions:l9e(Ee,Q),query_uuid:Y,title:X,image:te,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke}:{input:Q,completion:"",query_uuid:Y,title:X,image:te,imageDark:se,url:ae,category:re,metadata:ue,...(re==="ticker"||re==="news"||De==="finance"||De==="sports")&&{description:ee},submission_query:me,icon_name:we,shouldShowTitle:ye,actionHandler:_e,isPersonalized:ke}}),[t,u,i,h,n,x]),M=d.useMemo(()=>f9e(I),[I]),N=d.useMemo(()=>m9e(M),[M]),D=d.useCallback((Q,Y)=>{if(Y){window.open(Y,"_blank");return}C("auto suggestion filled",{}),s(Q)},[s,C]),j=v?.(),F=t.length>0,R=z("!block w-full",y==="bottom"?"mt-[-5px]":"mb-[-5px]",m),P=y==="bottom"?"rounded-b-2xl":"rounded-t-2xl",L=d.useRef(null),U=e&&t.length>0,O=d.useMemo(()=>({portalTarget:g??void 0,removeScroll:!0,shards:b}),[g,b]),$=d.useMemo(()=>l.jsxs("div",{className:z(y==="bottom"?z("rounded-b-2xl",F?"!border-t-subtlest shadow-super/10 shadow-md dark:shadow-lg dark:shadow-black/10":"!border-t-0"):"!border-b-subtler rounded-t-2xl","border-subtle border","bg-raised p-3",a),children:[y==="top"&&j,U&&l.jsx("div",{ref:L,className:"flex flex-col items-stretch","data-testid":"autosuggestion-container",children:N.map((Q,Y)=>{const te=M[Q],se=uE[Q]||{order:999,showHeader:!1};let ae=0;for(let X=0;X_?{strategy:_}:void 0,[_]),H=d.useMemo(()=>w?{className:"flex z-[1]"}:void 0,[w]);return l.jsx(Vf,{isOpen:e,matchTargetWidth:!0,disableAnimation:!0,placement:y,childrenClassName:"grow block",contentClassName:R,borderRadius:P,avoidCollisions:!1,disableShadow:!0,overlayProps:O,content:$,floatingElementProps:H,...G&&{customFloatingUIOptions:G},children:f})});OA.displayName="SuggestDropdown";const tX=A.memo(({value:e,suggestDropdownProps:t,ResizeableInputWrapperProps:n,ResizeableInputProps:r,leftAttributionComponents:s,rightAttributionComponents:o,syncUncontrolledOnce:a})=>{const i=r.onChange,c=r.ref,u=d.useRef(null),f=d.useRef(e);f.current=e;const m=d.useRef(null),p=d.useRef(!1),h=d.useCallback(g=>{u.current=g,c instanceof Function?c(g):c&&(c.current=g)},[c]);return d.useEffect(()=>{const g=u.current?.value;g&&g!==f.current&&(!a||!p.current)&&i?.(g),a&&(p.current=!0)},[i,a]),Rf("ask-input"),l.jsx(OA,{...t,floatingStrategy:"absolute",shouldEnableStacking:!0,portalTarget:m.current??void 0,value:e,children:l.jsxs(TA,{...n,ref:m,children:[l.jsx(AA,{...r,ref:h}),s,o]})})});tX.displayName="AskInputBase";class h9e{static isAnyInputElementFocused(){const t=document.activeElement;return!!(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.getAttribute("contenteditable")==="true"||t.getAttribute("role")==="textbox"))}}function g9e({value:e,json:t,isDisabled:n,handleSubmit:r,handleSuggestDropdownNavigation:s,querySource:o,focusInput:a,isInputActive:i}){const{isMobileUserAgent:c}=Re(),u=d.useRef(e),f=d.useRef(t);u.current=e,f.current=t;const m=d.useCallback(x=>n&&Ls.isEnterKeyWithoutShift(x)?(x.preventDefault(),!0):!1,[n]),p=d.useCallback(x=>x.isComposing?(x.preventDefault(),!0):!1,[]),h=d.useCallback(x=>{Ls.isEnterKeyWithoutShift(x)&&!c&&(x.preventDefault(),r({query:u.current,json:f.current,querySource:o}))},[r,o,c]),g=d.useCallback(x=>{const v=Ls.isCtrlOrCmdJ(x),b=Ls.isOnlySlashKey(x);if(v||b){if(i||h9e.isAnyInputElementFocused())return;x.preventDefault(),a()}},[a,i]);return d.useEffect(()=>(document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}),[g]),d.useCallback(x=>{m(x)||p(x)||s(x)||h(x)},[m,p,s,h])}const y9e=(e,t)=>{const{value:n,loading:r}=zt({flag:"clear-ask-input-suggestions-when-disabled",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};function x9e({handleSubmit:e,inputQuery:t}){const{session:n}=Ne(),{trackEvent:r}=Xe(n),s=d.useRef(t);s.current=t;const o=Vo(),{sidecarSourceTab:{url:a}}=Qn();return d.useCallback((c,u)=>{const f=ua();if(r("auto suggestion accepted",{mode:"dropdown-complete",query:s.current,completion:c.query,completion_uuid:c.query_uuid,completion_position:u,url:c.url,isNavigational:!!c.url,frontendContextUUID:f,searchMode:o,isPersonalized:c.isPersonalized,sourceDomain:Ur(a)}),c.isPersonalized&&fetch("/rest/autosuggest/track-query-clicked",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:c.query,search_mode:o})}).catch(()=>{}),c.url){window.open(c.url,"_self");return}e({query:c.submission_query??c.query,promptSource:"autosuggest",querySource:"autosuggest",newFrontendContextUUID:f})},[e,o,r,a])}function v9e({inputQuery:e}){const{session:t}=Ne(),{trackEventBatch:n}=Xe(t),r=d.useRef(e);r.current=e;const s=Vo(),{sidecarSourceTab:{url:o}}=Qn();return d.useCallback(i=>{if(r.current.length!==0)return;const c=i.map((u,f)=>({name:"auto suggestion blank state viewed",data:{mode:"dropdown-complete",query:r.current,completion:u.query,completion_uuid:u.query_uuid,completion_position:f,url:u.url,isNavigational:!!u.url,searchMode:s,sourceDomain:Ur(o)}}));n(c)},[s,n,o])}const b9e=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"should-show-general-suggestions-on-ntp",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},$f=Qe({productionMs:3e3}),_9e=Qe({productionMs:5e3}),Nj={TASK_LIMIT_EXCEEDED:"TASK_LIMIT_EXCEEDED",SHORTCUT_NAME_ALREADY_EXISTS:"SHORTCUT_NAME_ALREADY_EXISTS"},w9e=async({taskId:e,headers:t,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/tasks/{task_id}",n,{params:{path:{task_id:e}},timeoutMs:Qe(),numRetries:$l,headers:t});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get user task",cause:s,status:o.status??0});return r?.task?Pye(r.task):null},C9e=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to create user task",cause:r,status:s.status??0});return n},Rj=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/{task_id}",n,{params:{path:{task_id:e}},body:t});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update user task",cause:s,status:o.status??0});return r},nX=async({taskId:e,reason:t})=>de.DELETE("/rest/tasks/{task_id}",t,{params:{path:{task_id:e}},timeoutMs:$f}),S9e=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/finance",t,{body:e});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to create user finance task",cause:r,status:s.status??0});return n},E9e=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/finance/{task_id}",n,{params:{path:{task_id:e}},body:t});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update user finance task",cause:s,status:o.status??0});return r},k9e=async({ticker:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/finance/tickers/{ticker}",t,{params:{path:{ticker:e}},timeoutMs:Qe(),numRetries:$l});if(r)throw Z.error("Failed to get finance ticker",r),new he("API_CLIENTS_ERROR",{message:"Failed to get finance ticker",cause:r,status:s.status??0});return n},fbt=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/shortcuts",t,{body:e,timeoutMs:$f});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},mbt=async({payload:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/tasks/shortcuts/slug",t,{body:e,timeoutMs:_9e});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},pbt=async({taskId:e,payload:t,reason:n})=>{const{data:r,error:s,response:o}=await de.PATCH("/rest/tasks/shortcuts/{task_id}",n,{body:t,params:{path:{task_id:e}},timeoutMs:$f});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r},hbt=async({shortcutId:e,reason:t})=>{const{data:n,error:r,response:s}=await de.DELETE("/rest/tasks/shortcuts/defaults/{shortcut_id}",t,{params:{path:{shortcut_id:e}},timeoutMs:$f});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},gbt=async({shortcutId:e,reason:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/shortcuts/copy/{shortcut_id}",t,{params:{path:{shortcut_id:e}},timeoutMs:$f});if(r)throw new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},M9e=async({reason:e,headers:t})=>{const{data:n,error:r,response:s}=await de.GET("/rest/tasks/shortcuts/mentions",e,{params:{query:{order_by:"created_at"}},timeoutMs:$f,numRetries:$l,headers:t});if(r)throw Z.error("Failed to get shortcut typeahead options",r),new he("API_CLIENTS_ERROR",{cause:r,status:s.status??0});return n},rX=({reason:e,...t})=>{const n=Wt();return mt({queryKey:l2e(),queryFn:async()=>{const{tasks:r}=await M9e({reason:e});return r},...t,enabled:n&&(t.enabled??!0)})},ybt=async({query:e,keywords:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/autosuggest/reformulate-query",n,{body:{query:e,keywords:t}});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.reformulated_query}catch(r){return Z.error("Failed to fetch refinement query",r),null}},T9e=async({sources:e,attachments:t,searchMode:n,sourceTabUrl:r,entropyRenderingPlace:s,reason:o})=>{try{if(t&&t.length>0)return Pe;if(e.length===0)return Pe;const{data:a,error:i,response:c}=await de.POST("/rest/autosuggest/list-autosuggest",o,{body:{query:"",sources:e,attachments:t,search_mode:n,source_tab_url:r,entropy_rendering_place:s}});if(i)throw new he("API_CLIENTS_ERROR",{cause:i,status:c.status??0});return a.results??Pe}catch(a){return Z.error(a),Pe}},A9e=async({onCreateShortcut:e,shortcuts:t})=>{try{const s=[...[...t].filter(o=>o.prompt&&o.prompt.trim().length>0).sort(()=>Math.random()-.5).slice(0,6).map(o=>({query:o.prompt,title:o.task_name,shouldShowTitle:!0,category:"shortcuts"}))];return e&&s.push({query:"",query_uuid:"create-shortcut-button",title:"Create a shortcut",description:"",category:"shortcuts",icon:"plus",shouldShowTitle:!0,actionHandler:e}),s}catch(n){return Z.error("Failed to fetch shortcuts suggestions",n),Pe}},N9e=async({query:e,reason:t,country:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/list-autosuggest",t,{params:{query:{query:e,country:n}},timeoutMs:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.results??Pe}catch(r){return Z.error(r),[]}},R9e=(e,t)=>{const{value:n,loading:r}=zt({flag:"sidecar-personalized-query-suggestions",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},LA="sidecar-personalized-queries-cache",dE=1e3*60*10,D9e="sidecar";function j9e(e){try{let n=new URL(e).hostname.toLowerCase();return n.startsWith("www.")&&(n=n.slice(4)),n}catch{return""}}function I9e(){try{const e=vt.getItem(LA);if(e)return JSON.parse(e)}catch{}return null}function P9e(e){vt.setItem(LA,JSON.stringify(e))}async function O9e(e,t,n){if(e!==null&&e.nonce!==null&&e.timestamp>n-dE&&e.domain_suggestions.length>0)return{nonce:e.nonce,domain_suggestions:e.domain_suggestions};const{data:r,error:s}=await de.POST("/rest/browser/personalization/sidecar-recommended-queries",D9e,{body:{last_refresh_timestamp_ms:e?.timestamp??0,nonce:e?.nonce??"",history_items:t},timeoutMs:3e4});return s?(Z.error("Failed to fetch sidecar personalized queries:",s),{domain_suggestions:[],nonce:""}):r?.domain_suggestions===null||!r?.domain_suggestions?{domain_suggestions:e?.domain_suggestions??[],nonce:e?.nonce??""}:r}function L9e(e,t){const n=e.find(r=>r.domain===t);return n?n.suggestions.map(r=>({query:r.query})):[]}const F9e=14,B9e=1500,U9e=(e,t)=>{const{session:n}=Ne(),r=un(!1),s=j9e(e),{variation:o,loading:a}=R9e(!1,{userEmail:n?.user?.email??""}),i=I9e(),{data:c}=mt({queryKey:be.makeQueryKey("sidecar-personalized-queries",t,o,a),queryFn:async()=>{if(!r||!e||!t)return[];if(!o)return a||vt.removeItem(LA),[];const u=Date.now();if(i&&i.domain_suggestions.length>0&&u-i.timestamp({url:g.url,title:g.title,last_accessed:g.last_accessed,visit_count:g.visit_count})),p=await O9e(i,m,u),h={nonce:p.nonce,timestamp:u,domain_suggestions:p.domain_suggestions};return h.domain_suggestions.length>0&&P9e(h),p.domain_suggestions}catch(f){return Z.error(f),i?.domain_suggestions??[]}},placeholderData:()=>t?i?.domain_suggestions??[]:[],refetchInterval:dE,enabled:t});return L9e(c??[],s)},iw=({sources:e,attachments:t,searchMode:n,focus:r,isCometHome:s,reason:o,enabled:a})=>{const{sidecarSourceTab:{url:i}}=Qn(),u=Ga().erp,{isMobileUserAgent:f}=Re(),m=un(),p=Wt(),{openModal:h}=pn().legacy,{data:g}=rX({reason:o}),{variation:y}=b9e(!1),x=U9e(i||"",u==="sidecar"),v=d.useCallback(()=>{h("taskShortcutModal",{source:"suggestions_dropdown"})},[h]),b=d.useMemo(()=>s&&n===oe.SEARCH?be.makeEphemeralQueryKey("comet-blank-state-suggest",n,!0,g):r==="finance"?be.makeEphemeralQueryKey("finance-blank-state-suggest"):be.makeEphemeralQueryKey("blank-state-suggest",e,t,n,u==="sidecar"?i:""),[e,t,n,r,s,i,u,g]);return mt({queryKey:b,enabled:a,queryFn:async()=>{if(s&&n===oe.SEARCH&&!y)return await(p&&g?A9e({onCreateShortcut:v,shortcuts:g}):Promise.resolve([]));if(r==="finance")return(await N9e({query:"",reason:o,country:"US"})).map((E,T)=>({query:E.query||`suggestion-${T}`,title:E.title??void 0,image:E.image??void 0,description:E.description??void 0,category:E.category??void 0,query_uuid:E.query_uuid??void 0,url:E.url??void 0,metadata:E.metadata??void 0}));const[_,w]=await Promise.all([T9e({sources:e,attachments:t,searchMode:n,sourceTabUrl:u==="sidecar"?i:"",entropyRenderingPlace:u,reason:o}),u==="sidecar"?ohe({entropyBrowser:m,url:i}):Promise.resolve([])]);return[...x.map(S=>({...S,isPersonalized:!0})),...w,..._].slice(0,kp(f))}})},V9e=e=>{const{setSuggestions:t,setBlankStateSuggestions:n}=jo(),{sidecarSourceTab:{url:r,secondaryTab:s}}=Qn(),a=Ga().erp,i=d.useRef(void 0),c=d.useRef(e.selectedSearchMode),{blankStateSuggestions:u}=qr(),f=u[e.selectedSearchMode],m=r?Ur(r):void 0,p=d.useMemo(()=>{if(e.suggestionsDisabled)return!0;const S=a==="sidecar";return S&&m&&m===i.current||S&&s},[e.suggestionsDisabled,a,m,s]);!p&&i.current!==m&&(i.current=m);const h=!p,{data:g,isLoading:y}=iw({...e,searchMode:oe.SEARCH,enabled:h}),x=h&&!y,{data:v,isLoading:b}=iw({...e,searchMode:oe.RESEARCH,enabled:x}),_=x&&!b,{data:w}=iw({...e,searchMode:oe.STUDIO,enabled:_});return d.useEffect(()=>{p?n([],oe.SEARCH):g&&n(g,oe.SEARCH)},[g,n,p]),d.useEffect(()=>{p?n([],oe.RESEARCH):v&&n(v,oe.RESEARCH)},[v,n,p]),d.useEffect(()=>{p?n([],oe.STUDIO):w&&n(w,oe.STUDIO)},[n,p,w]),d.useEffect(()=>{(e.query?.length??0)>0||f&&((a==="sidecar"||c.current!==e.selectedSearchMode)&&t(f),c.current=e.selectedSearchMode)},[e.query,e.selectedSearchMode,f,t,a]),null};function sX({userInputQuery:e,userInputJson:t,suggestionsDisabled:n,suggestions:r,focusedIndex:s,setFocusedIndex:o,onChange:a,handleSuggestionSubmission:i,placement:c="bottom",inputRef:u}){const f=d.useRef(e),m=d.useRef(t),p=d.useRef(r),h=d.useRef(s);f.current=e,m.current=t,p.current=r,h.current=s,r.forEach(_=>_);const g=d.useCallback((_,w)=>{if(w>0){const S=(h.current+1)%w,C=p.current[S];if(C?.query){const E=C.query;a(E)}return _.preventDefault(),S}return null},[a]),y=d.useCallback(_=>{let w=h.current-1;if(w<0)w=-1,h.current===0&&(_.preventDefault(),a(f.current,m.current));else{_.preventDefault();const S=p.current[w];if(S?.query){const C=S.query;a(C)}}return w},[a]),x=d.useCallback((_,w)=>{if(w>0){const S=h.current<=0?w-1:(h.current-1)%w,C=p.current[S];if(C?.query){const E=C.query;a(E)}return _.preventDefault(),S}return null},[a]),v=d.useCallback((_,w)=>{let S=h.current+1;if(S>=w||S===0)S=-1,h.current===w-1&&(_.preventDefault(),a(f.current,m.current));else{_.preventDefault();const C=p.current[S];if(C?.query){const E=C.query;a(E)}}return S},[a]);return d.useCallback(_=>{if(n)return!1;const w=Ls.isArrowDown(_),S=Ls.isArrowUp(_);if(w){if(c==="bottom"&&h.current===-1&&!u.current?.inLine("last"))return!1;const C=c==="bottom"?g(_,p.current.length):v(_,p.current.length);if(C!==null)return o(C),!0}else if(S){if(c==="top"&&h.current===-1&&!u.current?.inLine("first"))return!1;const C=c==="bottom"?y(_):x(_,p.current.length);if(C!==null)return o(C),!0}else if(Ls.isEnterKeyWithoutShift(_)&&h.current>=0&&h.currente==="travel"||e==="shopping"||e==="academic"||e==="patents"||e==="sports"||e==="language-learning",z9e=({autosuggestionsEnabled:e=!0,inputQuery:t,inputJson:n,isInputActive:r,onChange:s,handleSuggestionSubmission:o,handleSuggestionView:a,querySource:i,hasThreadContent:c,isMentionMenuOpened:u,placement:f="bottom",inputRef:m})=>{const{isWindowsAppPanelView:p}=Px(),[h,g]=d.useState(-1),[y,x]=d.useState(t),[v,b]=d.useState(n),_=On(),[w]=Wd("isSuggestionsDisabled",!1),S=_Y(),C=zz(_),E=twe(_),{activeMenu:T,suggestions:k}=qr(),{currentOpenedModal:I}=pn().legacy,{setSuggestions:M,setShowSuggestDropdown:N}=jo(),D=d.useMemo(()=>w||!e||!S&&!C&&!p&&!E&&!H9e(i)&&!1||i!=="finance"&&t.length>t9e&&!k.some(({query:F})=>F===t)||c,[w,e,S,C,E,p,i,t,c,k]),j=sX({userInputQuery:y,userInputJson:v,suggestionsDisabled:D,suggestions:k,focusedIndex:h,setFocusedIndex:g,onChange:s,handleSuggestionSubmission:o,placement:f,inputRef:m});return d.useEffect(()=>{h===-1&&(x(t),b(n))},[t,h,n]),d.useEffect(()=>{D&&(M(Pe),g(-1))},[D,M,g]),d.useEffect(()=>{const F=!D&&r&&!T&&!I&&k.length>0&&!u;N(F),F&&a(k)},[D,r,T,I,k,u,N,a]),d.useMemo(()=>({focusedIndex:h,setFocusedIndex:g,suggestionsDisabled:D,userInputQuery:y,handleSuggestDropdownNavigation:j,placement:f}),[h,j,D,y,f])};function W9e({value:e,json:t,querySource:n,disableSubmission:r=!1,disableInput:s=!1,autofocus:o=!0,isUploadingFile:a=!1,onChange:i,onFocus:c,onBlur:u,handleSubmit:f,handleUpdateAutosuggestions:m,autosuggestionsEnabled:p=!0,errorMessage:h,sources:g,attachments:y,selectedSearchMode:x,isInputActive:v,setIsInputActive:b,updateOnFocus:_=!1,inFlight:w=!1,resultsLength:S=0,quote:C,isMentionMenuOpened:E,isCometHome:T=!1,reason:k,placement:I="bottom"}){const{activeMenu:M,inputRef:N}=qr(),D=Fwe(),{setShouldTriggerFocus:j}=Kx(),{blankStateSuggestions:F}=qr(),{setSuggestions:R}=jo(),{onActiveMenuChange:P}=jo(),{device:{isAndroid:L}}=sn(),U=d.useMemo(()=>!!C||e.trim().length>0||!!y&&y.length>0,[C,e,y]),O=r||s||!!h||a||!U,$=d.useCallback(me=>{const{mentions:we}=_W(t?.root);f({...me,mentions:we.length>0?we:void 0})},[t,f]),G=x9e({handleSubmit:$,inputQuery:e}),H=v9e({inputQuery:e}),{focusedIndex:Q,setFocusedIndex:Y,suggestionsDisabled:te,userInputQuery:se,handleSuggestDropdownNavigation:ae}=z9e({autosuggestionsEnabled:p,inputQuery:e,inputJson:t,isInputActive:v&&p,onChange:i,handleSuggestionView:H,handleSuggestionSubmission:G,querySource:n,hasThreadContent:w||S>0,isMentionMenuOpened:E,placement:I,inputRef:N});V9e({sources:g,attachments:y,selectedSearchMode:x,suggestionsDisabled:te,focus:n==="finance"?"finance":void 0,query:e,isCometHome:T,reason:k});const X=d.useCallback(()=>{N.current?.focus(),b(!0)},[N,b]),ee=d.useCallback(me=>{c?.(me),b(!0),P(null),_&&m(N.current?.value??""),L&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"center"})},300)},[c,P,m,b,_,N,L]);d.useEffect(()=>{D&&o&&(X(),j(!1))},[D,X,j,o]);const le=d.useCallback(()=>(u?.(),b(!1),Y(-1),!0),[u,Y,b]),{variation:re}=y9e(!1),ce=d.useCallback((me,we)=>{if(i(me,we),te){re&&R([]);return}me.trim().length===0&&F[x]?(R(F[x]),m(me)):o9e(me)&&m(me)},[i,te,m,F,R,x,re]),ue=g9e({value:e,json:t,isDisabled:O,handleSubmit:$,handleSuggestDropdownNavigation:ae,querySource:n,focusInput:X,isInputActive:v});return d.useEffect(()=>{M!==null?N.current?.blur():o&&X()},[M,N,X,o]),d.useMemo(()=>({isDisabled:O,focusedIndex:Q,setFocusedIndex:Y,userInputQuery:se,handleSuggestionSubmission:G,handleFocus:ee,handleBlur:le,handleChange:ce,handleKeyDown:ue,focusInput:X,hasQuery:U}),[X,Q,le,ce,ee,ue,G,U,O,Y,se])}const G9e=({fileUploadRef:e,fileHandlingRef:t,showFileUpload:n,attachments:r,setAttachments:s,handleChange:o,setIsUploadingFile:a,focusInput:i,onFileAttachComplete:c})=>{const{inputRef:u}=qr(),f=$4(),[m,p]=d.useState(null),h=d.useCallback(_=>{const w=r===void 0?"paste.txt":`paste-${r.length+1}.txt`,S=new File([_],w,{type:"text/plain"}),C=new DataTransfer;C.items.add(S),p({content:_,fileName:w}),e.current?.uploadFiles(C.files)},[r,e]),g=d.useCallback(()=>{p(null)},[]);d.useImperativeHandle(t,()=>({clearAutoCreatedTextFile:g}),[g]);const y=d.useCallback(_=>{const w=_.clipboardData;if(w&&w.items.length>0){const S=new DataTransfer;for(const C of w.items){if(C.kind==="file"){_.preventDefault();const E=C.getAsFile();E&&S.items.add(E)}if(C.type==="text/plain"){const E=_.clipboardData.getData("Text");E.length>Ec&&(_.preventDefault(),h(E))}}e.current?.uploadFiles(S.files)}requestAnimationFrame(()=>{u.current&&(u.current.trim(),o(u.current.value,u.current.json))})},[e,o,u,h]),x=d.useCallback(_=>{o(_),u.current?.focus()},[o,u]),v=d.useCallback(_=>{a(!1),_.length>0?(s(_),i(),c?.(_)):s(void 0)},[a,s,i,c]),b=d.useCallback(async _=>{const w=new DataTransfer;for(const S of _){if(S.kind==="file"){const C=S.webkitGetAsEntry();if(!C)continue;if(cW(C)){const E=S.getAsFile();E&&w.items.add(E)}else if(uW(C)){const E=await nCe(C);for(const T of E)w.items.add(T)}}if(S.type==="text/plain"&&S.getAsString(C=>{C.length>Ec?h(C):u.current&&(u.current.append(C),o(u.current.value,u.current.json))}),w.items.length>f)break}e.current?.uploadFiles(w.files)},[e,u,o,f,h]);return d.useEffect(()=>{n||(s(void 0),p(null))},[n,s]),d.useMemo(()=>({handlePaste:y,handlePasteQuery:x,handleCompleteFileUpload:v,handleFileSelect:b,autoCreatedTextFile:m,dismissNotification:g,setAutoCreatedTextFile:p}),[v,b,y,x,m,g])},$9e="transparent 135deg, oklch(var(--default-color)) 180deg, transparent 225deg",oX=A.memo(({children:e,borderRadius:t,borderGradientStops:n=$9e,defaultColor:r="var(--super-color)"})=>{const[s,o]=d.useState(1),a=d.useCallback(u=>{u!==null&&o(u.clientWidth/u.clientHeight)},[]),i=d.useMemo(()=>({"--default-color":r,"--button-border-gradient-stops":n,"--button-aspect-ratio":s,"--button-aspect-ratio-multiplier":.65,transform:"translateY(-50%) scaleX(calc(var(--button-aspect-ratio) * var(--button-aspect-ratio-multiplier))"}),[s,n,r]),c=d.useMemo(()=>({animation:"spin 5s linear infinite"}),[]);return l.jsxs("div",{className:"relative overflow-hidden p-px",ref:a,style:{borderRadius:t},children:[l.jsx("div",{className:"bg-base relative z-[1]",style:{borderRadius:t-1},children:e}),l.jsx("div",{style:i,className:"absolute inset-0 top-1/2 flex size-full items-center justify-center p-px will-change-transform",children:l.jsx("div",{style:c,className:"absolute aspect-square min-h-full w-full origin-center bg-[conic-gradient(var(--button-border-gradient-stops))] blur"})})]})});oX.displayName="AnimatedGradientBorderWrapper";function q9e({reason:e}){const t=Yt();return Rt({mutationFn:()=>v_e({reason:e}),onSuccess:()=>{t.invalidateQueries({queryKey:iu()})}})}function K9e({reason:e}){return Rt({mutationFn:async({connectionType:t,content:n})=>{await b_e({connectionType:t,content:n,reason:e})}})}var Mp;(function(e){e.TIMEOUT="TIMEOUT",e.AUTH="AUTH",e.POPUP_BLOCKED="POPUP_BLOCKED"})(Mp||(Mp={}));class Y9e extends Error{code;constructor(t,n){super(n),this.code=t,this.name="MicrosoftPickerError"}}const Dj=(e,t)=>new Y9e(e,t),FA=[".txt",".pdf",".docx",".pptx",".xlsx",".md",".csv"],BA=[".txt",".pdf",".jpg",".jpeg",".png",".docx",".pptx",".xlsx",".md",".csv"],UA=[".mp3",".wav",".aiff",".ogg",".flac",".mp4",".mpeg",".mov",".avi",".flv",".mpg",".webm",".wmv",".3gp"],jj=27,Q9e=2e4;let lw=!1,_i=null;const X9e=()=>{const e=d.useRef(null),t=d.useRef(null),n=d.useRef(null);let r="";typeof window<"u"&&(window.location.hostname==="localhost"?r=`${window.location.protocol}//${window.location.hostname}:${window.location.port}/account/connectors`:r=`${window.location.protocol}//${window.location.hostname}/account/connectors`);const s=d.useCallback(f=>!!f&&f.length===36&&f.split("-").length===5,[]),o=d.useCallback((f,m,p,h,g)=>{if(!m&&f==="sharepoint"&&p){const y=p.match(/^https?:\/\/([^.]+)\.sharepoint\.com/i);if(y)return y[1]}if(!m&&f==="onedrive"&&s(g)&&h){const y=h.match(/@([^.]+)\./);if(y)return y[1]+"-my"}return m?f==="sharepoint"?m:m+"-my":null},[s]),a=d.useCallback(async(f,m)=>{m.success=!1;let p=null;const h=o(f.connector,f.tenantName,f.webUrl,f.loginHint,f.accountIdentifier);m.tenant=h,_i||(_i=await(await q(()=>import("./index-kR08Osiu.js"),__vite__mapDeps([148,1]))).PublicClientApplication.createPublicClientApplication({auth:{authority:h?"https://login.microsoftonline.com/common":"https://login.microsoftonline.com/consumers",clientId:f.clientId,redirectUri:r},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!0}}));const g=h?[`https://${h}.sharepoint.com/.default`]:["OneDrive.ReadWrite"];m.scopes=g;const y={scopes:g,login_hint:f.loginHint,prompt:"select_account"};let x=null,v=_i.getActiveAccount();if(v||(v=_i.getAllAccounts().find(_=>_.username===f.loginHint)??null),m.hasActiveAccount=!!v?.username,v)try{_i.setActiveAccount(v),x=(await _i.acquireTokenSilent(y)).accessToken}catch(b){m.silentAcquisitionError=b instanceof Error?b.toString():b}if(!x&&!lw)try{lw=!0;const b=await _i.loginPopup(y);_i.setActiveAccount(b.account),x=(await _i.acquireTokenSilent(y)).accessToken}catch(b){m.interactiveAcquisitionError=b instanceof Error?b.toString():b,b?.errorCode==="popup_window_error"&&(m.interactiveAcquisitionErrorCode="popup_window_error",p=Mp.POPUP_BLOCKED)}finally{lw=!1}else x||(m.interactiveAuthenticationSkipped=!0);if(x)return m.success=!0,m.accessTokenLength=x.length,x;throw Dj(p??Mp.AUTH,"Access token not acquired")},[r,o]),i=d.useCallback(f=>{const m=o(f.connector,f.tenantName,f.webUrl,f.loginHint,f.accountIdentifier);let p=f.mode==="source"?FA:BA;p=f.isAudioVideoFilesEnabled?p.concat(UA):p;const h=f.connector==="sharepoint"?{recent:!0,oneDrive:!1,sharedLibraries:!0}:{recent:!0,oneDrive:!0,sharedLibraries:!1},g={sdk:"8.0",messaging:{origin:r,channelId:jj},authentication:{},entry:f.connector==="sharepoint"?{sharePoint:{}}:{oneDrive:{}},typesAndSources:{mode:f.mode==="attachment"?"files":"all",filters:p,pivots:h},selection:{mode:"multiple"}},y=new URLSearchParams({filePicker:JSON.stringify(g)});return f.webUrl?`${f.webUrl}/_layouts/15/FilePicker.aspx?${y}`:m?`https://${m}.sharepoint.com/_layouts/15/FilePicker.aspx?${y}`:`https://onedrive.live.com/picker?${y}`},[r,o]),c=d.useCallback(async f=>{const m=S=>{window.removeEventListener("message",y),t.current?.removeEventListener("message",g),t.current?.close(),e.current?.close(),S?f.onError?.(S):f.onCancel?.()},p=(S,C)=>(n.current||(n.current=(async()=>{try{return await a(S,C)}finally{n.current=null}})()),n.current),h=async(S,C)=>n.current?await n.current:await new Promise((E,T)=>{const k=setTimeout(()=>{T(Dj(Mp.TIMEOUT,"Request timed out"))},Q9e);p(S,C).then(I=>{clearTimeout(k),E(I)}).catch(I=>{clearTimeout(k),T(I)})}),g=async S=>{const C={};switch(S.data.type){case"command":t.current?.postMessage({type:"acknowledge",id:S.data.id});const E=S.data.data;switch(E.command){case"authenticate":try{const T=await h(f,C);t.current?.postMessage({type:"result",id:S.data.id,data:{result:"token",token:T}})}catch(T){C.errorStep="authenticateCommand",C.error=T instanceof Error?T.toString():T,m(T)}finally{f.log?.(f.connectionType??f.connector.toUpperCase(),C)}break;case"pick":t.current?.postMessage({type:"result",id:S.data.id,data:{result:"success"}}),f.onPicked?.(E.items),m();break;case"close":m();break;default:m();break}break}},y=async S=>{if(S.source&&S.source===e.current){const C=S.data;C.type==="initialize"&&C.channelId===jj&&(t.current=S.ports[0],t.current.addEventListener("message",g),t.current.start(),t.current.postMessage({type:"activate"}))}};let x;const v={};try{x=await p(f,v)}catch(S){v.errorStep="initialization",v.error=S instanceof Error?S.toString():S,m(S);return}finally{f.log?.(f.connectionType??f.connector.toUpperCase(),v)}const b=document.getElementById("microsoft-file-picker");if(!b){m();return}if(e.current=b.contentWindow,!e?.current){m();return}const _=e.current.document.createElement("form");_.setAttribute("action",i(f)),_.setAttribute("method","POST"),e.current.document.body.append(_);const w=e.current.document.createElement("input");w.setAttribute("type","hidden"),w.setAttribute("name","access_token"),w.setAttribute("value",x),_.appendChild(w),e.current.document.body.appendChild(_),_.submit(),window.addEventListener("message",y)},[a,i]),u=d.useCallback((f,m)=>{let p;if(f.parentReference.sharepointIds?.siteId&&m==="sharepoint"){const g={item_id:f.id,drive_id:f.parentReference.driveId,site_id:f.parentReference.sharepointIds.siteId};p=JSON.stringify(g)}else p=f.id;const h=mu(f.name);return h?{id:p,name:f.name,sizeBytes:f.size,mimeType:J3[h]}:null},[]);return d.useMemo(()=>({openPicker:c,toPickerDocument:u}),[c,u])},Z9e=({reason:e,mode:t})=>{const n=J(),[r,s]=d.useState(!1),[o,a]=d.useState(null),{openToast:i}=hn(),{openModal:c,closeModal:u}=pn().legacy,{openPicker:f,toPickerDocument:m}=X9e(),{mutateAsync:p}=K9e({reason:e}),h=d.useCallback(b=>{b.connector==="sharepoint"&&t==="attachment"?c("sharepointSiteModal",{onSelectSite:_=>{u(),b&&(s(!0),a({...b,webUrl:_}),f({...b,webUrl:_}))}}):(s(!0),a(b),b.connector==="onedrive"&&f(b))},[u,t,c,f]),g=d.useCallback(()=>{s(!1),a(null)},[s,a]),y=d.useCallback(b=>{Z.error("A Microsoft file picker error occured:",b),g();const _=b;let w;switch(_?.code){case"POPUP_BLOCKED":w=n.formatMessage({defaultMessage:"We couldn't open the {formattedName} sign-in window. Please allow pop-ups for this site in your browser and try again.",id:"IjzaY+voOq"},{formattedName:D0});break;case"TIMEOUT":w=n.formatMessage({defaultMessage:"{formattedName} is taking longer than usual. This may be a network issue. Please try again.",id:"CEncF+/g5h"},{formattedName:D0});break;case"AUTH":w=n.formatMessage({defaultMessage:"We couldn't sign in to {formattedName}. Please check your Microsoft account access and try again.",id:"aHs4QljX82"},{formattedName:D0});break;default:w=n.formatMessage({defaultMessage:"{formattedName} had an unexpected error. Please try again in a few moments.",id:"ApZ6o/tZ3n"},{formattedName:D0})}i({message:w,variant:"error",timeout:5})},[g,i,n]),x=d.useCallback((b,_)=>{p({connectionType:b,content:_})},[p]),v=d.useCallback(b=>{o&&(a({...o,webUrl:b}),f({...o,webUrl:b}))},[o,f]);return d.useMemo(()=>({onOpen:h,onClose:g,onError:y,onSelectSite:v,toPickerDocument:m,log:x,isOpen:r,options:o}),[r,x,g,y,h,v,o,m])},Mv=({reason:e})=>{const t=Yt(),{mutateAsync:n}=Rt({mutationKey:j0(),mutationFn:async a=>(await w_e({request:{url:a.url,thread_id:a.thread_id},reason:e})).file_url,onSuccess:(a,i,c)=>{t.setQueryData(j0(i.url),a),i.callback?.(a,!1)},onError:(a,i,c)=>{i.callback?.("",!1)},retry:!1}),r=d.useCallback(a=>{const i=t.getQueryData(j0(a));return typeof i=="string"?i:null},[t]),s=d.useCallback(async a=>{a.callback?.("",!0);const i=r(a.url);if(i)return a.callback?.(i,!1),i;const c=await n(a);return a.callback?.(c,!1),c},[r,n]),o=d.useCallback(async(a,i)=>{const c=URL.createObjectURL(i);t.setQueryData(j0(a),c)},[t]);return d.useMemo(()=>({getCachedImageDownloadUrl:r,getImageDownloadUrl:s,cacheImageDownloadUrl:o}),[o,r,s])};function J9e(){const{value:e}=kf({flag:"attachment-token-estimation-params",defaultValue:{max_total_tokens:5e5,type_bytes_per_token:{text:4,image:500},type_subtype_bytes_per_token:{"application/pdf":200,"application/msword":500,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":500,"application/vnd.openxmlformats-officedocument.presentationml.presentation":500},default_bytes_per_token:100},subjectType:"user_nextauth_id"});return e}const Ij="box-file-picker",eDe="0";let $0=null,Pj=!1;const tDe=()=>$0||($0=new Promise((e,t)=>{const n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn01.boxcdn.net/platform/elements/17.1.0/en-US/picker.css",n.onload=()=>{oM({id:"box-picker-script",src:"https://cdn01.boxcdn.net/platform/elements/17.1.0/en-US/picker.js"}).then(()=>{if(!Pj){const r=document.createElement("style");r.textContent=` - .be .be-header input[type="search"] { - background: white; - } - - .btn-content { - display: flex; - justify-content: center; - align-items: center; - } - `,document.head.appendChild(r),Pj=!0,e()}},t)},document.head.appendChild(n)}),$0),nDe=({mode:e,isAudioVideoFilesEnabled:t,onPicked:n,onCancel:r,onError:s})=>{const o=d.useRef(null),a=d.useCallback(async({apiKey:c,pickerType:u="file"})=>{try{if(await tDe(),!document.getElementById(Ij)){s?.("Attempted to open picker when container isn't ready");return}let m=e==="source"?FA:BA;m=t?m.concat(UA):m;const p=[...m,".gdocs",".gsheets",".gslides"];o.current&&(o.current.removeListener("choose",n),o.current.removeListener("cancel",r),o.current.hide(),o.current=null);let h;u==="folder"?h=new window.Box.FolderPicker:h=new window.Box.FilePicker,o.current=h,h.addListener("choose",n),h.addListener("cancel",r),h.show(eDe,c,{container:`#${Ij}`,logoUrl:Cx,extensions:p.join(","),canUpload:!1,canSetShareAccess:!1,canCreateNewFolder:!1,chooseButtonLabel:"Select",cancelButtonLabel:"Cancel"})}catch(f){s?.(f);return}},[s,e,r,n,t]),i=d.useCallback(()=>{o.current&&(o.current.removeListener("choose",n),o.current.removeListener("cancel",r),o.current.hide(),o.current=null)},[n,r]);return d.useMemo(()=>({openPicker:a,cleanupPicker:i}),[a,i])};function Oj(){const e=document.getElementById("dropboxjs");e&&document.body.removeChild(e)}const rDe=()=>{const[e,t]=d.useState(null),n=d.useCallback(async s=>{e!==s&&(Oj(),t(null),await oM({id:"dropboxjs",src:"https://www.dropbox.com/static/api/2/dropins.js",attrs:{"data-app-key":s}}),t(s))},[e]),r=d.useCallback(async s=>{await n(s.clientId);let o=s.mode==="source"?FA:BA;o=s.isAudioVideoFilesEnabled?o.concat(UA):o,window.Dropbox.choose({success:s.onPicked,error:a=>s.onError?.(a),multiselect:!0,extensions:o,folderselect:s.mode==="source"})},[n]);return d.useEffect(()=>()=>{Oj()},[]),d.useMemo(()=>({openPicker:r}),[r])};function sDe(e){return e.every(t=>t instanceof File)}const oDe=({fileInputRef:e,isSignedIn:t,uploadRateLimit:n,maxFilesUpload:r,attachmentTokenEstimationParams:s,forwardedRef:o,existingAttachments:a,showPrivacyWarning:i,onFilePickerOpen:c,onStart:u,onComplete:f,openLoginModal:m,openPricingModal:p,openCompanyDataPrivacyModal:h,closeModal:g,openVisitorLoginUpsell:y,openMicrosoftPicker:x,closeMicrosoftPicker:v,errorMicrosoftPicker:b,toPickerDocument:_,setUploadRateLimit:w,isFollowUp:S,isClearAttachmentsEnabled:C=!1,forceImage:E,refreshBoxCredentials:T,logMicrosoft:k,asyncAttachmentsEnabled:I=!1,setUploadsReady:M,getImageUrl:N,isAudioVideoFilesEnabled:D=!1,reason:j,maxAttachmentFileSizeMB:F=vhe,specialCapabilities:R={unlimitedProSearch:!1,maxModelSelection:!1,unlimitedResearch:!1,fileUpload:!1},onRemoveFile:P,getUserSettingsQueryKey:L,getUserSettings:U})=>{const{$t:O,locale:$}=J(),{openToast:G}=hn(),[H,Q]=d.useState(null),[Y,te]=d.useState(null),[se,ae]=d.useState(!1),[X,ee]=d.useState([]),le=d.useCallback(fe=>{ee(Be=>Be.filter(Fe=>Fe.id!==fe))},[]),[re,ce]=d.useState(X&&X.length>0?"success":"idle"),[ue,me]=d.useState(null),we=`${F}MB`,ye=d.useCallback(async(fe,Be,Fe)=>{if(!kr(fe))return null;const ct=Fe?{type:Fe}:void 0,it=A4(fe)?fe:await N?.(fe)??fe;if(!it)return new File([],Be,ct);try{const zn=await(await fetch(it)).blob();return new File([zn],Be,ct)}catch{return new File([],Be,ct)}},[N]);d.useEffect(()=>{C?ee([]):(async()=>{const Be=await Promise.all((a??Pe).map(async Fe=>{const ct=h3(Fe.split("/").pop()||"file"),it=ty(Fe);let kt=new File([],ct,{type:it}),zn;if(kr(kt)){const cr=await ye(Fe,ct,it);kt=cr??kt,zn=cr?URL.createObjectURL(cr):void 0}return{id:crypto.randomUUID(),file:kt,nextURL:Fe,status:"success",thumbnailSource:zn}}));ee(Be)})()},[C,a,ye]),d.useEffect(()=>{if(!M)return;if(!I||!X.length){M(!0);return}const fe=Fe=>Fe.status==="parsing"||Fe.status==="success"||Fe.status==="failed",Be=X.every(fe);M(Be)},[X,I,M]),d.useImperativeHandle(o,()=>({uploadFiles:fe=>Le(Array.from(fe)),clearFiles:_e}));const _e=d.useCallback(()=>{ee([]),ce("idle"),f?.([]),e.current?.value&&(e.current.value=""),me(null)},[e,f]),ke=d.useCallback((fe,Be)=>{ee(Fe=>{let ct=Fe;return fe?ct=Fe.filter(it=>it.nextURL!==fe):Be&&(ct=Fe.filter(it=>!it.nextURL?.includes(Be))),ct.length===0&&ce("idle"),f?.(ct.filter(it=>!!it.nextURL).map(it=>({url:it.nextURL??"",file:it.file,resizedFile:it.resizedFile}))??[]),P?.(fe,Be),ct}),e.current?.value&&(e.current.value="")},[e,f,P]),De=d.useCallback(()=>{ee([]),ce("idle"),e.current?.value&&(e.current.value=""),me(null)},[e]),xe=d.useCallback(fe=>{te(null),Q(fe??O(go[od.generic_upload_error])),X?.length&&ce("success")},[O,X?.length]),Ue=d.useCallback(()=>{if(!m)return;const fe=O({defaultMessage:"Sign in to upload files and photos",id:"gEOi1eLJ7C"}),Be=O({defaultMessage:"Analyze files and photos for free",id:"nu4bK5/Y5T"});y?y({title:fe,description:Be,origin:ft.FILE_UPLOAD,sheetModalVariant:S?"bottom-sheet-gradient":"full-sheet"}):m({origin:ft.FILE_UPLOAD,pitchMessage:{title:fe,description:Be}})},[O,S,m,y]),Ee=d.useCallback(()=>{if(!p)return;const fe=O({defaultMessage:"Want more uploads?",id:"iInvIJ0Dv/"}),Be=O({defaultMessage:"Upgrade access for subscribers",id:"UwiL3wLZE3"});p({pitchMessage:{title:fe,description:Be},origin:ft.FILE_UPLOAD})},[O,p]),Ke=d.useCallback(async(fe,Be)=>{let Fe;I?Fe=await Tve({request:{file_uuids:[fe]},reason:j}):Fe={file_uuid:fe,success:!0,error_code:null,token_limit_exceeded:!1};const ct=Fe.success?"success":"failed";ct==="failed"?(xe(O(go[Fe.error_code??m3.parsing_error],{filename:Be})),ee(it=>it.filter(kt=>kt.file_uuid!==fe))):(Fe.token_limit_exceeded&&(ae(!0),te(O(go.token_limit_exceeded,{filename:Be}))),ee(it=>[...(it??[]).map(kt=>kt.file_uuid===fe?{...kt,status:ct}:kt)]))},[xe,I,O,j]),Nt=d.useCallback(fe=>fe instanceof File&&F7.includes(fe.type)||!(fe instanceof File)&&fe.mimeType&&F7.includes(fe.mimeType)?O(go[od.unsupported_type]):fe instanceof File&&fe.size>F*L7||!(fe instanceof File)&&fe.sizeBytes&&fe.sizeBytes>F*L7?O(go[od.too_large],{max:we}):fe instanceof File&&fe.size{if(!fe.ok){xe(),Z.warn(`[localAttachmentUpload] upload failed for ${kt}, response=${fe}`);return}let zn=null;try{const Wn=await fe.json();if(Wn?.moderation?.[0]?.status==="rejected"){xe(O(go.failed_moderation)),Z.warn(`[localAttachmentUpload] upload failed moderation for ${kt}, response=${fe}`);return}zn=VR(Wn?.eager?.[0]?.secure_url??Wn?.secure_url)}catch{zn=`${Fe}${ct}`.replace("${filename}",`${Be.name}`)}if(!zn){xe();return}const cr=_d(zn)?"success":"parsing";ee(Wn=>Wn.map(En=>En.id===it?{...En,nextURL:zn,file_uuid:kt,status:cr}:En)),ce("success"),me("local"),kt&&cr=="parsing"&&await Ke(kt,Be.name)},[xe,O,Ke]),ve=d.useCallback(async(fe,Be,Fe)=>{if(!fe?.success){xe();return}if(fe.rate_limited){Ee(),xe(O(go.rate_limited)),le(Fe);return}if(!fe.filename||!fe.url){xe();return}const ct=fe.url&&_d(fe.url)?VR(fe.url):h3(fe.url),it=ty(ct);console.log(fe.url,fe.filename,it);const kt=await ye(fe.url,fe.filename,it),zn=_d(fe.url)?"success":"parsing";ee(cr=>cr.map(Wn=>Wn.id===Fe?{...Wn,file:kt??Wn.file,nextURL:ct,file_uuid:fe.file_uuid??void 0,status:zn,thumbnailSource:kt?URL.createObjectURL(kt):void 0}:Wn)),ce("success"),me(Be),fe.file_uuid&&zn=="parsing"&&await Ke(fe.file_uuid,fe.filename)},[ye,xe,Ee,O,Ke,le]),Ae=d.useCallback(async(fe,Be)=>{const Fe=()=>ee(it=>it.filter(kt=>kt.id!==Be.id));if(fe?.error){fe.error==="attachments_disabled_by_organization"?xe(O(go[od.attachments_disabled_by_organization])):xe(),Fe();return}if(fe?.rate_limited){Ee(),Fe(),xe(O(go.rate_limited)),le(Be.id);return}if(!fe||!fe.fields||!fe.s3_bucket_url){xe(),Fe();return}UK(Be)&&ee(it=>it.map(kt=>kt.id===Be.id?{...kt,thumbnailSource:URL.createObjectURL(Be.file)}:kt));const ct=new FormData;Object.entries(fe.fields).forEach(([it,kt])=>{ct.append(it,kt)}),ct.append("file",Be.file);try{const it=await fetch(fe.s3_bucket_url,{method:"POST",body:ct});await pe(it,Be.file,fe.s3_bucket_url,fe.fields.key,Be.id,fe.file_uuid??void 0)}catch(it){Z.warn(`[localAttachmentUpload] upload failed for ${fe.file_uuid} with error=${it}`),xe(),Fe()}},[Ee,xe,O,pe,le]),We=d.useCallback(fe=>{const Be=fe.filter(ct=>ct.status==="success").reduce((ct,it)=>{const kt=it.file.type,zn=kt.split("/")[0],cr=s?.type_subtype_bytes_per_token?.[kt],Wn=s?.type_bytes_per_token?.[zn],En=s?.default_bytes_per_token,Xn=cr??Wn??En,Wr=it.file.size,Ms=Xn?Wr/Xn:0;return ct+Ms},0),Fe=s?.max_total_tokens;return Fe&&Be>Fe},[s]);d.useEffect(()=>{if(!X.length||se)return;X.every(Be=>Be.status==="success"||Be.status==="failed")&&We(X)&&te(O({defaultMessage:"Performance may be degraded for larger files.",id:"xwKpaJzWgU"}))},[X,We,O,se]);const pt=d.useCallback(async fe=>{const{fileList:Be,fileSource:Fe,setUploadRateLimit:ct}=fe,it=[],kt=Be.map(async En=>{const Xn=Nt(En);if(Xn)return{file:En,error:Xn};let Wr=En;if(kr(En))try{Wr=await fNe(En)}catch{Z.warn(`Unable to resize image file: ${En.name}`)}return{file:Wr,error:null}}),zn=await Promise.all(kt);for(const En of zn){if(En.error){xe(En.error);continue}const Xn=crypto.randomUUID(),Wr={id:Xn,file:En.file,status:"uploading"};it.push({uuid:Xn,file:En.file,uploadedFile:Wr}),ee(Ms=>[...Ms??[],Wr])}if(it.length===0)return;const cr=await kve({filesWithUuids:it.map(({uuid:En,file:Xn})=>({uuid:En,file:Xn})),fileSource:Fe,forceImage:E,reason:j});let Wn=0;cr?await Promise.all(it.map(async({uuid:En,uploadedFile:Xn})=>{const Wr=cr[En];Wr&&(await Ae(Wr,Xn),Wn++)})):(it.forEach(({uploadedFile:En})=>{le(En.id)}),xe(O({defaultMessage:"Failed to get upload URLs. Please try again.",id:"JaG6Y+rSl4"}))),n&&n>0&&ct&&ct(Wn)},[Nt,xe,E,j,Ae,n,le,O]),Gt=d.useCallback((fe,Be,Fe)=>{sDe(fe)?pt({fileList:fe,fileSource:Fe,setUploadRateLimit:w}):Be&&fe.forEach(ct=>{const it=Nt(ct);if(it)xe(it);else{const kt=ty(ct.name??""),zn=new File([""],ct.name??"",{type:kt}),cr={id:ct.id,file:zn,status:"uploading"};ee(Wn=>[...Wn??[],cr]),Mve({remote_file_id:ct.id,connection_type:Be.toUpperCase(),reason:j}).then(Wn=>{ve(Wn,Be,cr.id)})}})},[Nt,xe,ve,pt,j,w]),Le=d.useCallback((fe,Be,Fe)=>{if(!(!fe||fe.length===0)){if(Fe!==iV){if(!t&&!R.fileUpload){Ue();return}if(n&&n<=0){Ee();return}if(fe.length+(X?.length??0)>r){Q(O(go.over_file_count,{maxNumFiles:r}));return}}u?.(),ce("loading"),Gt(fe,Be,Fe)}},[t,n,X,r,Gt,u,Ue,Ee,O,R.fileUpload]),gt=d.useCallback(async(fe,Be,Fe)=>{try{const it=await(await fetch(fe)).blob(),kt=Fe||it.type||"application/octet-stream";return new File([it],Be,{type:kt})}catch{return new File([],Be,Fe?{type:Fe}:void 0)}},[]),Je=d.useCallback(async(fe,Be,Fe)=>{const it=(Fe?Fe.startsWith("image/"):kr(fe))?await ye(fe,Be,Fe):await gt(fe,Be,Fe);it&&Le([it],"local")},[gt,ye,Le]),Me=mt({queryKey:L({skipConnectorPickerCredentials:!1}),queryFn:()=>U({reason:j,headers:$?{"accept-language":$}:{},skipConnectorPickerCredentials:!1}),enabled:!1}),Ve=d.useCallback(async fe=>{const ct=(await(async()=>{if(Me.status==="success")return Me.data;const{data:it}=await Me.refetch();return it})())?.connectors.connectors.find(it=>it.name===fe);return ct||(Z.error(`Connector ${fe} not found in user settings`),null)},[Me]),{openPicker:lt}=eQ({isAudioVideoFilesEnabled:D}),xt=d.useCallback(async fe=>{const Be=await Ve("google_drive");if(!Be){G({variant:"error",message:O({defaultMessage:"Failed to open Google Drive file picker",id:"Ja2aztZ3b+"}),timeout:5e3});return}lt({...fe,clientId:Be.picker_credentials?.client_id??"",loginHint:Be.connection_display_name??""})},[Ve,lt,G,O]),[Pt,$e]=d.useState(!1),ht=d.useCallback(()=>$e(!1),[]),Zt=d.useCallback(fe=>{const Be=fe.map(Fe=>({id:Fe.id,name:Fe.name,sizeBytes:Fe.size,mimeType:J3[Fe.extension]}));Le(Be,"box"),ht()},[Le,ht]),{openPicker:dt,cleanupPicker:Ct}=nDe({mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:Zt,onCancel:ht}),Ot=d.useCallback(async(fe={})=>{const Be=await Ve("box");if(!Be){G({variant:"error",message:O({defaultMessage:"Failed to open Box file picker",id:"+Yt3OYcUhg"}),timeout:5e3});return}const Fe=Be.picker_credentials?.expires_at;if(Fe&&T){const ct=new Date(Fe);if(isNaN(ct.getTime())){$e(!0);return}if(ct{$e(!0)},[]);d.useEffect(()=>{Pt&&Ot()},[Pt,Ot]);const lr=d.useCallback((fe,Be)=>{if(!_||Be!=="onedrive"&&Be!=="sharepoint")return;const Fe=fe.map(ct=>_(ct,Be)).filter(ct=>ct!==null);Le(Fe,Be),v?.()},[_,Le,v]),{openPicker:Qr}=rDe(),tr=d.useCallback(async fe=>{const Be=await Ve("dropbox");if(!Be){G({variant:"error",message:O({defaultMessage:"Failed to open Dropbox file picker",id:"1xye5E73zP"}),timeout:5e3});return}Qr({...fe,clientId:Be.picker_credentials?.client_id??""})},[Ve,Qr,G,O]),bn=d.useCallback(fe=>{const Be=fe.map(Fe=>{const ct=mu(Fe.name);return ct?{id:Fe.id,name:Fe.name,sizeBytes:Fe.bytes,mimeType:J3[ct]}:null}).filter(Fe=>Fe!==null);Le(Be,"dropbox")},[Le]),nr=d.useCallback(()=>xe(O({defaultMessage:"Unable to retrieve files from connector.",id:"4seKuUP1Wo"})),[xe,O]),Xr=d.useCallback(async(fe,Be)=>{if(!x)return;const Fe=await Ve(fe);if(!Fe){const ct=O(fe==="onedrive"?{defaultMessage:"Failed to open OneDrive file picker",id:"L7gmeOx2re"}:{defaultMessage:"Failed to open SharePoint file picker",id:"/2WBhsPWAQ"});G({variant:"error",message:ct,timeout:5e3});return}x({...Be,connector:fe,clientId:Fe.picker_credentials?.client_id??"",tenantName:Fe.picker_credentials?.tenant_name??"",loginHint:Fe.connection_display_name??"",accountIdentifier:Fe.picker_credentials?.account_identifier})},[Ve,x,G,O]),Qo=d.useCallback((fe,Be)=>{fe=="google_drive"?xt({mode:"attachment",onPicked:Fe=>Le(Fe,fe)}):fe==="onedrive"||fe==="sharepoint"?Xr(fe,{webUrl:Be,mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:Fe=>lr(Fe,fe),onError:b,onCancel:v,log:k}):fe==="dropbox"?tr({mode:"attachment",isAudioVideoFilesEnabled:D,onPicked:bn,onError:nr}):fe=="box"&&Qt()},[xt,Le,Xr,lr,v,b,tr,bn,nr,Qt,k,D]),lc=d.useCallback(fe=>{h&&h(()=>{g?.(),!fe||fe==="local"?(e.current?.click(),c?.()):Qo(fe)})},[e,g,h,Qo,c]),ds=d.useCallback(fe=>{if(!t&&!R.fileUpload){Ue();return}if(n&&n<=0){Ee();return}if(i&&!mr(Hy)){lc(fe),lo(Hy,"true",{expires:30});return}!fe||fe==="local"?(e.current?.click(),c?.()):Qo(fe)},[t,n,i,e,Ue,Ee,lc,Qo,c,R.fileUpload]);return d.useEffect(()=>{let fe=null;return Y&&(fe=setTimeout(()=>{te(null)},xhe)),()=>{fe&&clearTimeout(fe)}},[Y]),d.useEffect(()=>{X&&f?.(X.filter(fe=>!!fe.nextURL).map(fe=>({url:fe.nextURL??"",file:fe.file,resizedFile:fe.resizedFile})))},[X,f]),d.useMemo(()=>({errorMessage:H,warningMessage:Y,uploadedFiles:X,uploadSource:ue,status:re,fileInputRef:e,handleClearFiles:_e,handleRemoveFile:ke,handleStartUpload:ds,handleFileInput:Le,attachFromUrl:Je,removeAllFiles:De,handleOpenLoginModal:Ue,handleOpenPricingModal:Ee,isBoxOpen:Pt,onCloseBox:ht,cleanupBoxPicker:Ct,setErrorMessage:Q}),[H,Y,X,ue,re,e,_e,ke,ds,Le,Je,De,Ue,Ee,Pt,ht,Ct])},aDe=({fileUploadRef:e,disablePrivacyWarning:t,isAudioVideoFilesEnabled:n,isClearAttachmentsEnabled:r,isFollowUp:s,organization:o,lastResult:a,onStartFileUpload:i,onCompleteFileUpload:c,setUploadsReady:u,reason:f,specialCapabilities:m,askInputRef:p,onRemoveFile:h})=>{const g=d.useRef(null),{inputRef:y}=qr(),{openModal:x,closeModal:v}=pn().legacy,b=$4(),_=J9e(),{value:w}=zt({flag:"async-attachment-processing",defaultValue:!1,subjectType:"user_nextauth_id"}),S=Wt(),{openVisitorLoginUpsell:C}=du({enabled:!S}),E=ag(),{hasDataRetentionWarning:T,connectorLimits:k}=Ea({reason:f}),{uploadRateLimit:I,setUploadRateLimit:M}=Vn(),{hasActiveSubscription:N}=$t(),D=I??(N?wM:_M),j=d.useCallback(re=>x("loginModal",re),[x]),F=d.useCallback(re=>{E(re)},[E]),R=d.useCallback(re=>x("companyDataPrivacyModal",{organizationName:o?.display_name??"",onContinue:re}),[x,o]),{onOpen:P,onClose:L,onError:U,toPickerDocument:O,options:$,onSelectSite:G,isOpen:H,log:Q}=Z9e({reason:f,mode:"attachment"}),{mutateAsync:Y}=q9e({reason:f}),{getCachedImageDownloadUrl:te,getImageDownloadUrl:se}=Mv({reason:f}),ae=d.useCallback(async re=>a?.backend_uuid?await se({url:re,thread_id:a.backend_uuid}):te(re),[te,se,a?.backend_uuid]),X=oDe({fileInputRef:g,isSignedIn:S,uploadRateLimit:D,maxFilesUpload:b,attachmentTokenEstimationParams:_,forwardedRef:e,showPrivacyWarning:T&&!t,onStart:i,onComplete:c,openLoginModal:j,openPricingModal:F,openCompanyDataPrivacyModal:R,closeModal:v,openVisitorLoginUpsell:C,openMicrosoftPicker:P,closeMicrosoftPicker:L,errorMicrosoftPicker:U,toPickerDocument:O,setUploadRateLimit:M,isFollowUp:s,isClearAttachmentsEnabled:r,refreshBoxCredentials:Y,logMicrosoft:Q,asyncAttachmentsEnabled:w,setUploadsReady:u,getImageUrl:ae,isAudioVideoFilesEnabled:n,reason:f,maxAttachmentFileSizeMB:k?.max_attachment_file_size_mb,specialCapabilities:m,onRemoveFile:h,getUserSettingsQueryKey:iu,getUserSettings:XH}),{attachFromUrl:ee,removeAllFiles:le}=X;return d.useImperativeHandle(p??null,()=>({addMediaFile:async(re,ce,ue)=>{await ee(re,ce,ue)},focusInput:()=>{y.current?.focus()},blurInput:()=>{y.current?.blur()},removeAttachments:()=>{le()}}),[ee,y,le]),d.useMemo(()=>({...X,fileInputRef:g,microsoftFilePickerOptions:$,handleSelectSharepointSite:G,isMicrosoftFilePickerOpen:H,onCloseMicrosoft:L,addMediaFile:ee,removeAllFiles:le}),[X,G,H,$,L,ee,le])},iDe=({setInput:e})=>{const t=fn();d.useEffect(()=>{if(!t)return;const n=t.get("p_q");n&&e(n)},[t,e])};function lDe(){return Intl.DateTimeFormat().resolvedOptions().timeZone}async function cDe({body:e,reason:t}){try{const{data:n,error:r,response:s}=await de.POST("/rest/realtime/v1/transcription-session",t,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json"}});return r?{status:s.status,error:`Failed to get GA realtime transcription session: ${s.statusText}`}:{data:n,status:s.status,error:null}}catch(n){return Z.error("Failed to get GA realtime transcription session",n),{data:null,status:500,error:`Failed to get GA realtime transcription session: ${n}`}}}async function xbt({body:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/search-youtube",t,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});if(s)throw Z.error("Failed to search video",s),new he("API_CLIENTS_ERROR",{message:"Failed to search video",cause:s,status:o.status??0});return r}async function vbt({body:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/search-web",t,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});if(s)throw Z.error("Failed to search web",s),new he("API_CLIENTS_ERROR",{message:"Failed to search web",cause:s,status:o.status??0});return r}async function bbt({entry:e,analyticsParams:t,reason:n,requestId:r}){const{data:s,error:o,response:a}=await de.POST("/rest/realtime/create-entry",n,{timeoutMs:Qe({productionMs:5e3}),numRetries:1,body:{...e,analytics_params:{...t,timezone:lDe()}},headers:{"content-type":"application/json",...r?{[yn]:r}:{}}});if(o)throw Z.error("Failed to create entry",o),new he("API_CLIENTS_ERROR",{message:"Failed to create entry",cause:o,status:a.status??0});return s}async function _bt({params:e,reason:t,requestId:n}){const{data:r,error:s,response:o}=await de.POST("/rest/realtime/v1/upload-audio",t,{timeoutMs:Qe({productionMs:3e4}),numRetries:2,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});if(s)throw Z.error("Failed to upload audio",s),new he("API_CLIENTS_ERROR",{message:"Failed to upload audio",cause:s,status:o.status??0});return r}async function wbt({body:e,reason:t,requestId:n}){try{const{data:r,error:s,response:o}=await de.POST("/rest/realtime/v2/session",t,{timeoutMs:Qe({productionMs:1e4,clientSideMs:1e4}),numRetries:2,body:e,headers:{"content-type":"application/json",...n?{[yn]:n}:{}}});return s?{status:o.status,data:void 0,error:o.statusText||"Failed to create realtime session v2"}:{status:o.status,data:r,error:void 0}}catch(r){return Z.error("Failed to create realtime session v2",r),{status:500,data:void 0,error:`Failed to create realtime session v2: ${r}`}}}async function uDe({body:e,reason:t}){try{const{data:n,error:r,response:s}=await de.POST("/rest/realtime/v2/language-learning/session",t,{timeoutMs:Qe({productionMs:1e4,clientSideMs:1e4}),numRetries:1,body:e,headers:{"content-type":"application/json"}});return r?{status:s.status,data:void 0,error:s.statusText||"Failed to create language learning session v2"}:{status:s.status,data:n,error:void 0}}catch(n){return Z.error("Failed to create language learning session v2",n),{status:500,data:void 0,error:`Failed to create language learning session v2: ${n}`}}}const Cbt="web.frontend.realtime.voice",Sbt="oai-realtime-v2v-tool-call",Ebt=4096,dDe=.7;var Lj;(function(e){e.BrowserGetUrlContent="get_full_page_content",e.ControlBrowser="control_browser",e.CloseBrowserTabs="close_browser_tabs",e.GroupOpenBrowserTabs="group_open_browser_tabs",e.OpenNewBrowserTab="open_page",e.SearchBrowser="search_browser",e.UngroupOpenBrowserTabs="ungroup_open_browser_tabs"})(Lj||(Lj={}));var Fj;(function(e){e.ActiveTabs="active_tabs",e.BrowsingHistory="browsing_history"})(Fj||(Fj={}));var xl;(function(e){e.MobileWeb="mobile_web",e.Web="web",e.macOS="macos",e.iOS="ios",e.Android="android",e.Windows="windows"})(xl||(xl={}));const kbt=3e3,Mbt=3,Tbt=5;function Abt(e){const t=e.toLowerCase();return t.includes("airpod")||t.includes("headphone")||t.includes("earbud")||t.includes("headset")?"near_field":t.includes("built-in")||t.includes("internal")||t.includes("macbook")||t.includes("laptop")||t.includes("usb")||t.includes("conference")||t.includes("desk")||t.includes("array")||t.includes("camera")?"far_field":null}const fDe=e=>e.isWindowsApp?CM:Ca()?lV():e.isIOS?_he:e.isAndroid?whe:e.isMobile?Bfe:Ufe,mDe=e=>e.isChrome||e.isFirefox?e.isMobile?xl.MobileWeb:xl.Web:e.isMacOS?xl.macOS:e.isIOS?xl.iOS:e.isAndroid?xl.Android:e.isWindowsOS?xl.Windows:"",pDe=()=>{const{device:{isWindowsApp:e,isIOS:t,isAndroid:n,isMobile:r}}=sn();return fDe({isWindowsApp:e,isIOS:t,isAndroid:n,isMobile:r})},Nbt=()=>{const{device:{isChrome:e,isFirefox:t,isMobile:n,isMacOS:r,isIOS:s,isAndroid:o,isWindowsOS:a}}=sn();return mDe({isChrome:e,isFirefox:t,isMobile:n,isMacOS:r,isIOS:s,isAndroid:o,isWindowsOS:a})},hDe=({callbacks:e,config:t,reason:n})=>{const[r,s]=d.useState(!1),[o,a]=d.useState(""),[i,c]=d.useState(!1),[u,f]=d.useState(null),[m,p]=d.useState(()=>{const ee=vt.getItem(__);return ee?ee==="true":null}),{session:h}=Ne(),{trackEvent:g}=Xe(h),y=pDe(),x=t.silenceThreshold??30,v=t.silenceDuration??5e3,b=d.useRef(null),_=d.useRef(null),w=d.useRef(""),S=d.useRef(null),C=d.useRef(!1),E=d.useRef(null),T=d.useRef(null),k=d.useRef(null),I=d.useRef(null),M=d.useRef(null),N=d.useRef(new Map),D=d.useRef(null),j=d.useRef(null),F=d.useRef(null),R=d.useRef([]),P=d.useRef(null),L=d.useCallback(async()=>{try{return(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(le=>le.stop()),p(!0),vt.setItem(__,"true"),!0}catch(ee){return f(`Microphone permission denied. ${ee}`),p(!1),vt.setItem(__,"false"),!1}},[]),U=d.useRef(!1),O=d.useCallback(()=>{S.current&&(S.current.getTracks().forEach(ee=>ee.stop()),S.current=null)},[]),$=d.useCallback(()=>{if(C.current=!1,k.current&&(clearTimeout(k.current),k.current=null),E.current&&(E.current.close(),E.current=null,T.current=null),b.current&&r&&b.current.stop(),P.current&&(clearInterval(P.current),P.current=null),F.current&&(F.current.port.onmessage=null,F.current.disconnect(),F.current=null),_.current&&_.current.stop(),O(),w.current="",a(""),N.current.clear(),s(!1),M.current&&(M.current.close(),M.current=null),I.current){const ee=Date.now()-I.current;g("stop transcription",{durationMs:ee})}I.current=null,e?.onStop?.()},[e,O,g,r]),G=d.useCallback(ee=>{if(!ee||!C.current)return;const le=ee.frequencyBinCount,re=new Uint8Array(le);ee.getByteFrequencyData(re),re.reduce((ue,me)=>ue+me)/le{C.current&&e?.onSilence?.()},v)):k.current&&(clearTimeout(k.current),k.current=null),C.current&&requestAnimationFrame(()=>G(ee))},[e,x,v]),H=d.useCallback(()=>Array.from(N.current.values()).map(le=>le.finalTranscript||le.partialTranscript||"").join(" ").trim(),[N]),Q=d.useCallback(ee=>{const{type:le,item_id:re}=ee;if(!re)return;N.current.has(re)||N.current.set(re,{itemId:re,partialTranscript:"",finalTranscript:""});const ce=N.current.get(re),ue=j.current||"";switch(le){case"conversation.item.input_audio_transcription.delta":{const{delta:me}=ee;ue==="whisper-1"?ce.partialTranscript=me:ce.partialTranscript+=me;break}case"conversation.item.input_audio_transcription.completed":{const{transcript:me}=ee;typeof me=="string"&&(ce.finalTranscript=me);break}case"input_audio_buffer.committed":{ee.previous_item_id&&(ce.previousItemId=ee.previous_item_id);break}}N.current.set(re,ce),a(H())},[H]),Y=d.useCallback(async()=>{const ee=await cDe({body:{source:y,timezone:mM,turn_detection_threshold:dDe,response_language:"en"},reason:n});if(!ee.data?.client_secret)throw Z.error("No ephemeral key from server"),new Error("Unable to start OAI session");D.current=ee.data.session_id,j.current=ee.data.model_name;const re=["realtime",`openai-insecure-api-key.${ee.data.client_secret}`],ce=new WebSocket("wss://api.openai.com/v1/realtime?intent=transcription",re);M.current=ce,ce.onopen=()=>Z.info("OpenAI WS connected (base64 PCM approach)"),ce.onerror=ue=>{Z.error("OAI WS error:",ue),f("OpenAI WS error")},ce.onclose=ue=>{Z.info("OAI WS closed:",ue.code)},ce.onmessage=ue=>{try{const me=JSON.parse(ue.data);Q(me)}catch(me){Z.error("Invalid OAI WS message:",ue.data,me)}}},[Q,y,n]),te=d.useCallback(ee=>{let le=0;for(const ue of ee)le+=ue.length;const re=new Int16Array(le);let ce=0;for(const ue of ee)re.set(ue,ce),ce+=ue.length;return re},[]),se=d.useCallback(ee=>{const le=ee.buffer;let re="";const ce=new Uint8Array(le);for(const ue of ce)re+=String.fromCharCode(ue);return btoa(re)},[]),ae=d.useCallback(async ee=>{const le=new AudioContext;E.current=le,await le.audioWorklet.addModule("/audio-worklet.js");const re=new AudioWorkletNode(le,"pcm-worklet-processor");F.current=re,re.port.onmessage=ue=>{if(!C.current)return;const me=ue.data;R.current.push(me)},P.current||(P.current=setInterval(()=>{if(!C.current||!M.current||M.current.readyState!==WebSocket.OPEN||R.current.length===0)return;const ue=te(R.current);R.current=[];const me=se(ue),we={event_id:`evt-${Date.now()}`,type:"input_audio_buffer.append",audio:me};M.current.send(JSON.stringify(we))},500));const ce=le.createMediaStreamSource(ee);ce.connect(re),re.connect(le.destination),T.current=le.createAnalyser(),T.current.fftSize=256,ce.connect(T.current),requestAnimationFrame(()=>G(T.current))},[G,te,se]),X=d.useCallback(async()=>{if(f(null),I.current=Date.now(),g("start transcription"),C.current=!0,(m===null||m===!1)&&(c(!0),!await L())){c(!1),f("Microphone permission is required for voice input"),e?.onStop?.(),C.current=!1;return}try{await Y();const ee=await navigator.mediaDevices.getUserMedia({audio:!0}).catch(async le=>{if(p(!1),!await L())throw le;return navigator.mediaDevices.getUserMedia({audio:!0})});S.current=ee,await ae(ee),U.current&&_.current&&(w.current="",a(""),_.current.start(),_.current.onspeechend=()=>$()),s(!0),c(!1),e?.onStart?.()}catch(ee){f(`Failed to start recording. ${ee}`),C.current=!1}},[e,m,L,g,$,Y,ae]);return d.useMemo(()=>({isTranscribing:r,isInitializing:i,transcription:o,error:u,startTranscription:X,stopTranscription:$}),[u,i,r,X,$,o])},gDe=1e4,v2="autosuggest",yDe="AUTOSUGGEST_MESSAGE_MALFORMED",xDe="AUTOSUGGEST_MESSAGE_PARSE_ERROR",vDe="AUTOSUGGEST_WS_CONNECTION_ERROR",bDe="AUTOSUGGEST_WS_SEND_QUERY_ERROR",_De=()=>{const{device:{isMobile:e}}=sn(),t=Yt();return d.useCallback(n=>{const r=t.getQueryData(be.makeEphemeralQueryKey(v2)),s=t.getQueryData(be.makeEphemeralQueryKey(v2,n));if(s?.length&&s.length===kp(e))return s;if(r){const o=n.replace(/\s+/g,"").toLocaleLowerCase(),a=[];for(const f of r){if(e&&f.url)continue;const[m,p]=$Q(o,f);if(m&&(a.push([p,f]),a.length===kp(e)))break}const i=a.sort(([f],[m])=>f-m).map(([f,m])=>m),[c,u]=cE(i,e,n);if(s?.length){const f=[...s];for(const m of c)if(!f.find(p=>p.query===m.query)&&(f.push(m),f.length===kp(e)))break;return cE(f,e,n)[1]}return u}return Pe},[e,t])},wDe=()=>{const{suggestions:e}=qr(),{setSuggestions:t}=jo(),n=d.useRef(e);n.current=e;const r=Yt(),s=_De(),o=d.useRef(!1),{device:{isMobile:a}}=sn(),i=d.useRef(null),c=d.useRef(null),u=d.useRef([]),f=d.useRef({lastMessageID:0});d.useLayoutEffect(()=>()=>{o.current=!1},[]);const m=d.useCallback((y,x=!1)=>{const v=s(y);!x&&!v.length||(n.current.length!==v.length||eme(n.current,v,"query").length!==v.length)&&(n.current=v,t(v))},[s,t]),p=d.useCallback(y=>{try{const x=new WebSocket("wss://suggest.perplexity.ai/suggest/ws");x.onopen=()=>{y?.()},x.onmessage=v=>{let b;try{if(b=JSON.parse(v.data),b.length<4){Z.error(yDe,b);return}}catch(M){Z.error(xDe,M);return}const[_,w,S,C]=b,E=parseInt(S),T=a9e(C),[k,I]=cE(T,a);if(r.setQueryData(be.makeEphemeralQueryKey(v2),(M=Pe)=>k.length?jU([...k,...M],"query").sort((N,D)=>N.query.localeCompare(D.query)):M),r.setQueryData(be.makeEphemeralQueryKey(v2,_),I),E===f.current.lastMessageID&&o.current&&m(_,!0),f.current[E]){const M=performance.now()-f.current[E];u.current.push(M)}},i.current=x}catch(x){Z.error(vDe,x)}},[a,m,r]),h=d.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{i.current&&(i.current.close(),i.current=null)},gDe)},[]);d.useEffect(()=>(p(),h(),()=>{i.current&&i.current.close(),c.current&&clearTimeout(c.current)}),[p,h]);const g=d.useCallback((y,x=!0)=>{if(o.current=!!y.trim(),!o.current)return;m(y);const v=[WebSocket.OPEN,WebSocket.CONNECTING];if(!i.current||!v.includes(i.current.readyState)){x&&p(()=>{g(y,!1)});return}else h();const b=f.current.lastMessageID+1,_=b.toString();f.current.lastMessageID=b;try{const w=JSON.stringify({q:y,uuid:_,full_completion:!0});if(i.current.readyState===WebSocket.CONNECTING)return;i.current.send(w),f.current[b]=performance.now()}catch(w){Z.error(bDe,w)}},[p,h,m]);return d.useEffect(()=>{const y=setInterval(()=>{u.current.length!==0&&(lxe({latencies:u.current,isMobile:a}),u.current=[])},n9e);return()=>clearInterval(y)},[a]),d.useMemo(()=>({handleUpdateAutosuggestions:g}),[g])};function CDe(){const{value:e}=zt({flag:"clear-attachment-on-submission",subjectType:"user_nextauth_id",defaultValue:!1});return e}const SDe=({entropyBrowser:e,isSidecar:t,focusInput:n})=>{d.useEffect(()=>{if(!e||!t)return;const r=()=>{document.visibilityState==="visible"&&n()},s=e.subscribeQuickActionButtonFired(()=>{n()});return document.addEventListener("visibilitychange",r),()=>{s(),window.removeEventListener("visibilitychange",r)}},[e,n,t])},aX=A.memo(function(t){const{children:n,condition:r,Wrapper:s,...o}=t;return r?l.jsx(s,{...o,children:n}):n});aX.displayName="ConditionalWrapper";let Mm=0;function EDe(e,t,n=!1){const[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useCallback(g=>{g.preventDefault()},[]),c=d.useCallback(g=>{g?.dataTransfer?.types.includes("Files")&&(g.preventDefault(),s(!0),Mm++)},[]),u=d.useCallback(g=>{g.preventDefault(),Mm=Math.max(0,Mm-1),Mm===0&&s(!1)},[]),f=d.useCallback(g=>{g.preventDefault(),s(!1),a(!1),Mm=0,!t&&n&&g.dataTransfer?.items.length&&e(g.dataTransfer.items)},[t,e,n]),m=d.useCallback(g=>{g?.dataTransfer?.types.includes("Files")&&(g.preventDefault(),a(!0))},[]),p=d.useCallback(g=>{g.preventDefault(),a(!1)},[]),h=d.useCallback(g=>{g.preventDefault(),s(!1),a(!1),!t&&!n&&g?.dataTransfer?.items.length>0&&e(g.dataTransfer.items)},[t,e,n]);return d.useEffect(()=>(document.addEventListener("dragover",i),document.addEventListener("dragenter",c),document.addEventListener("dragleave",u),document.addEventListener("drop",f),()=>{document.removeEventListener("dragover",i),document.removeEventListener("dragenter",c),document.removeEventListener("dragleave",u),document.removeEventListener("drop",f)}),[i,c,u,f]),d.useMemo(()=>({isDraggingFile:r,isFileOver:o,rootProps:{onDragOver:m,onDragLeave:p,onDrop:h}}),[p,m,h,r,o])}const iX=A.memo(({onDrop:e,disabled:t=!1,children:n,dropZoneClassName:r,dropLabel:s,dropIcon:o=B("arrow-bar-to-down"),allowDropAnywhere:a=!1,hideContent:i=!1,...c})=>{const{$t:u}=J(),{isDraggingFile:f,isFileOver:m,rootProps:p}=EDe(e,t,a),h=s??u(a?{defaultMessage:"Dropped files appear here.",id:"9WR4elgZix"}:{defaultMessage:"Drop your files here.",id:"llIM82nPs+"});return l.jsxs("div",{className:"relative",...p,...c,children:[f&&t?l.jsx(K,{className:z("border-subtler bg-subtler absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed",{"!border-caution":m},r?.(f,m)),children:l.jsxs(V,{color:"red",children:[l.jsx(ge,{icon:o,className:"mr-2"}),"Drop zone disabled"]})}):f?l.jsxs(l.Fragment,{children:[l.jsx(K,{variant:"background",className:"absolute inset-0 z-20 rounded-2xl opacity-80"}),l.jsx(K,{className:z("gap-x-sm animate-in fade-in border-subtler absolute inset-0 z-20 flex items-center justify-center rounded-2xl border-2 border-dashed transition-all duration-200",{"!border-super":m},r?.(f,m)),children:!i&&l.jsxs(V,{color:"super",children:[l.jsx(ge,{icon:o,className:"mr-2"}),h]})})]}):null,n]})});iX.displayName="DropZone";const kDe=({value:e,json:t,querySource:n,placeholder:r,placeholderClassName:s,disableSubmission:o=!1,disableInput:a=!1,initialLayout:i="expanded",minRows:c=1,isFollowUp:u=!1,submitWillFork:f=!1,showSources:m=!1,useThreadSources:p=!1,showRecency:h=!1,showModelSelector:g=!0,showSearchModeSelector:y=!0,showFileUpload:x=!1,disableActionButtons:v=!1,showIncognitoHint:b,hasShadow:_=!1,autofocus:w=!0,disablePrivacyWarning:S=!1,fileUploadTooltip:C,className:E,headerComponent:T,showStopButton:k=!1,forceHideSuggestions:I=!1,onChange:M,onFocus:N,onBlur:D,onClick:j,onSubmit:F,onStopButtonClick:R=Ao,onFilePickerOpen:P,onFilePickerClose:L,autosuggestionsEnabled:U=!0,dropdownPlacement:O="bottom",dropdownClassName:$,useLexical:G=!1,mentionTypeaheadOptions:H,isCometHome:Q=!1,syncUncontrolledOnce:Y=!1,onTriggerTypeahead:te,layoutKey:se,isHighlighted:ae,isMissionControl:X,ref:ee,onRemoveFile:le,onFileAttachComplete:re,renderAttachments:ce=!0})=>{const ue=`ask-input-inner-${n}`,me=d.useRef(!1),[we,ye]=d.useState(!1),[_e,ke]=d.useState(w),{suggestions:De,blankStateSuggestions:xe,showSuggestDropdown:Ue,browserAgentAllowOnceFromToggle:Ee,forceEnableBrowserAgent:Ke}=qr(),{setSuggestions:Nt}=jo(),{isMobileStyle:pe,isMobileUserAgent:ve}=Re(),{inputRef:Ae}=qr(),[We,pt]=d.useState(!0),Gt=d.useRef(null),{currentOpenedModal:Le}=pn().legacy,gt=!!Le,Je=Wt(),{quote:Me,setQuote:Ve}=Ho(),lt=CDe(),xt=Vo(),{sources:Pt}=Vn(),{specialCapabilities:$e}=Yr(),{lastResult:ht,inFlight:Zt,resultsLength:dt}=on(),Ct=un(),Ot=J(),Qt=d.useRef(null),lr=d.useRef(null),[Qr,tr]=d.useState(!1),bn=d.useCallback(()=>tr(!0),[]),nr=d.useCallback(()=>tr(!1),[]),{cacheImageDownloadUrl:Xr}=Mv({reason:ue}),[Qo,lc]=d.useState(void 0),ds=d.useMemo(()=>Qo?.map(kn=>kn.url),[Qo]),fe=d.useMemo(()=>{if(e.length>Ec)return Ot.formatMessage({defaultMessage:"Query is { numCharacters } characters too long",id:"yw04s2k4La"},{numCharacters:e.length-Ec})},[e,Ot]),{handleUpdateAutosuggestions:Be}=wDe(),Fe=d.useCallback(kn=>{if(!(me.current||!We)){if(Be(""),me.current=!0,!kn.query&&ds&&ds.length>0){const ms=cu(ds[0]);kn.query=ms!=="File"?ms:"File Attached"}fe?me.current=!1:(setTimeout(()=>me.current=!1,Z4),F?.({query:kn.query,json:kn.json,attachments:ds,promptSource:kn.promptSource,querySource:kn.querySource,mentions:kn.mentions,browserAgentAllowOnceFromToggle:Ee,forceEnableBrowserAgent:Ke}),Qo?.forEach(ms=>{ms.file&&ms.file.size>0&&kr(ms.url)&&Xr(ms.url,ms.resizedFile??ms.file)}),(lt||X)&&Qt.current?.clearFiles(),lr.current?.clearAutoCreatedTextFile())}},[ds,Qo,Ee,Ke,Xr,fe,Be,lt,X,F,We]);d.useEffect(()=>Ct.subscribeForceSubmitQuery(kn=>{Fe(kn)}),[Ct,Fe]);const{isDisabled:ct,focusedIndex:it,setFocusedIndex:kt,userInputQuery:zn,handleSuggestionSubmission:cr,handleFocus:Wn,handleBlur:En,handleChange:Xn,handleKeyDown:Wr,focusInput:Ms,hasQuery:wu}=W9e({value:e,json:t,querySource:n,disableSubmission:o,disableInput:a,autofocus:w,isUploadingFile:we,onChange:M,onFocus:N,onBlur:D,handleSubmit:Fe,handleUpdateAutosuggestions:Be,autosuggestionsEnabled:U,errorMessage:fe,sources:Pt,attachments:ds,selectedSearchMode:xt,setIsInputActive:ke,isInputActive:_e,inFlight:Zt,resultsLength:dt,quote:Me,isMentionMenuOpened:Qr,isCometHome:Q,reason:ue,placement:O});iDe({setInput:Xn}),SDe({entropyBrowser:Ct,focusInput:Ms,isSidecar:!0}),d.useEffect(()=>{Ae.current?.focus()},[Ae]),d.useEffect(()=>{Me&&Ms()},[Me,Ms]);const{openToast:cc}=hn(),dm=d.useMemo(()=>({onStart:()=>{Ms()},onStop:()=>{Ms()},onSilence:()=>{cc({message:"No audio detected. Make sure your microphone is connected and unmuted",variant:"error",timeout:4})}}),[Ms,cc]),{startTranscription:v0,stopTranscription:b0,error:Zr,isTranscribing:fs,isInitializing:Cu,transcription:gi}=hDe({callbacks:dm,config:Ihe,reason:ue});d.useEffect(()=>{Zr&&cc({message:`Audio Error: ${Zr}`,variant:"error",timeout:4})},[Zr,cc]);const yi=d.useRef("");d.useEffect(()=>{if(!fs){yi.current="";return}if(gi&&gi!==yi.current){const kn=gi.startsWith(yi.current)?gi.slice(yi.current.length):gi;if(kn){const ms=yi.current.length==0?` ${kn}`:kn;yi.current.length==0&&Ae.current?.trim(),Ae.current?.append(ms),Xn(Ae.current?.value??"",Ae.current?.json)}yi.current=gi}},[gi,fs,e,Xn,Ae]);const fm=!0,{organization:_0}=mo({reason:ue}),w0=d.useCallback(()=>ye(!0),[]),{handlePaste:mm,handlePasteQuery:f_,handleCompleteFileUpload:C0,handleFileSelect:Su,autoCreatedTextFile:xi,dismissNotification:S0,setAutoCreatedTextFile:m_}=G9e({fileUploadRef:Qt,fileHandlingRef:lr,showFileUpload:x,attachments:ds,setAttachments:lc,handleChange:Xn,setIsUploadingFile:ye,focusInput:Ms,onFileAttachComplete:re}),{fileInputRef:Eu,errorMessage:E0,warningMessage:k0,uploadSource:pm,uploadedFiles:Jt,handleRemoveFile:ku,handleStartUpload:M0,handleFileInput:uc,isBoxOpen:T0,onCloseBox:hm,cleanupBoxPicker:Y8,microsoftFilePickerOptions:Q8,isMicrosoftFilePickerOpen:X8,handleSelectSharepointSite:Z8,onCloseMicrosoft:J8,setErrorMessage:e7}=aDe({fileUploadRef:Qt,disablePrivacyWarning:S,isAudioVideoFilesEnabled:fm,isClearAttachmentsEnabled:X||lt,isFollowUp:u,organization:_0,lastResult:ht,onStartFileUpload:w0,onCompleteFileUpload:C0,setUploadsReady:pt,reason:ue,specialCapabilities:$e,askInputRef:ee,onRemoveFile:le}),t7=d.useCallback(()=>{if(xi){if(Ae.current?.append(xi.content),Xn(Ae.current?.value??"",Ae.current?.json),ds){const kn=ds.find(ms=>ms.includes(xi.fileName));kn&&ku(kn)}m_(null)}},[xi,Ae,Xn,ds,ku,m_]),n7=d.useRef(e);n7.current=e;const r7=d.useCallback(kn=>{ke(!0),n7.current.length===0&&xe[xt]&&Nt(xe[xt]),j?.(kn)},[ke,Nt,xe,xt,j]),s7=d.useCallback(kn=>{Ae.current=kn},[Ae]),ofe=d.useMemo(()=>({isOpen:Ue&&!I&&!fs,suggestedQueries:De,focusedIndex:it,setFocusedIndex:kt,handlePasteQuery:f_,handleSubmit:cr,userInputQuery:zn,placement:O,dropdownClassName:$,allowNonSequentialMatch:De!==xe[xt],scrollableShards:Jt.length>0?[Gt]:[]}),[xe,$,O,it,I,f_,cr,fs,xt,kt,Ue,De,Jt.length,zn]),afe=d.useMemo(()=>{const kn=Ue&&!I&&!fs;return{initialLayout:i,wrapperClass:z({"transition-none p-lg":Ue,"border-b-none rounded-b-none":kn&&O==="bottom","border-t-none rounded-t-none rounded-b-2xl":kn&&O==="top","bg-base":Me}),size:"large",hasShadow:_,isHighlighted:ae,isMobileUserAgent:ve,showStopButton:k,quote:Me??void 0,inputWarnings:xi&&l.jsxs(K,{variant:"subtler",className:"mx-sm mb-xs px-sm py-xs dark:bg-base flex items-center justify-between rounded-lg",children:[l.jsx("div",{className:"gap-x-sm flex items-center",children:l.jsxs(V,{variant:"tiny",color:"light",children:["Text is"," ",Math.max(1,Math.round((xi.content.length-Ec)/Ec*100)),"% over the limit and is attached as a file."," ",l.jsx(st,{variant:"super",size:"tiny",onClick:t7,text:"Paste as text"})]})}),l.jsx(st,{icon:B("x"),size:"tiny",onClick:S0,variant:"common",pill:!0,noPadding:!0})]}),attachmentsList:Jt.length>0&&ce&&l.jsx(zK,{uploadedFiles:Jt,onRemoveFile:ku,ref:Gt}),setQuote:Ve,inputRef:Ae}},[xi,S0,O,I,ku,_,i,Ae,fs,t7,Me,Ve,k,Ue,Jt,ae,ce,ve]),ife=d.useMemo(()=>({ref:s7,id:"ask-input",value:e,json:t,initialLayout:i,minRows:c,placeholder:fs?Ot.formatMessage({defaultMessage:"Listening…",id:"GdiyKL+89A"}):r,placeholderClassName:s,disableInput:a,autoFocus:w,onClick:r7,onChange:Xn,onKeyDown:Wr,onBlur:En,onFocus:Wn,onPaste:mm,onMentionMenuOpen:bn,onMentionMenuClose:nr,isMobileStyle:pe,isMobileUserAgent:ve,useLexical:G,mentionTypeaheadOptions:G?H:void 0,onTriggerTypeahead:G?te:void 0}),[w,a,En,Xn,r7,Wn,Wr,mm,i,pe,ve,t,H,c,nr,bn,te,r,s,s7,G,e,fs,Ot]),lfe=d.useMemo(()=>l.jsx(GQ,{value:e,json:t,showSources:m,useThreadSources:p,showRecency:h,submitWillFork:f,isFollowUp:u,isDisabled:ct||!We,querySource:n,errorMessage:fe,handleSubmit:Fe,fileUploadRef:Qt,showFileUpload:x,showModelSelector:g,disableActionButtons:v,fileUploadTooltip:C,disablePrivacyWarning:S,showStopButton:k,onStopButtonClick:R,onFilePickerOpen:P,onFilePickerClose:L,startTranscription:v0,stopTranscription:b0,isTranscribing:fs,isTranscriptionInitializing:Cu,isTranscriptionAvailable:!0,transcriptionError:Zr,fileUploadErrorMessage:E0,fileUploadWarningMessage:k0,activeConnector:pm,uploadedFiles:Jt,handleStartUpload:M0,handleFileInput:uc,isBoxFilePickerOpen:T0,handleCloseBoxFilePicker:hm,cleanupBoxFilePicker:Y8,microsoftFilePickerOptions:Q8,handleCloseMicrosoftFilePicker:J8,handleSelectSharepointSite:Z8,isMicrosoftFilePickerOpen:X8,fileInputRef:Eu,hasQuery:wu,isAudioVideoFilesEnabled:fm,setAttachmentErrorMessage:e7,isCometHome:Q,isMissionControl:X}),[pm,Y8,v,S,fe,Eu,E0,C,k0,hm,uc,Z8,M0,Fe,wu,fm,T0,ct,u,Cu,X8,fs,t,Q8,J8,L,P,R,n,e7,x,g,h,m,p,k,v0,b0,f,Jt,We,e,Q,X,Zr]),{isMax:cfe}=$t(),ufe=d.useMemo(()=>l.jsx(YY,{showIncognitoHint:b,showSearchModeSelector:y,isFollowUp:u,layoutKey:se,showFileUpload:x,handleFileInput:uc,onFilePickerOpen:P}),[uc,u,se,P,x,b,y]),o7=l.jsx(tX,{value:e,suggestDropdownProps:ofe,ResizeableInputWrapperProps:afe,ResizeableInputProps:ife,syncUncontrolledOnce:Y,leftAttributionComponents:ufe,rightAttributionComponents:lfe}),dfe=l.jsxs(K,{variant:"subtler",className:z(E,"relative rounded-2xl",{"max-super-override":cfe}),children:[T,l.jsx("div",{className:fs?"-m-px":"",children:fs?l.jsx(oX,{borderRadius:17,borderGradientStops:"transparent 135deg, oklch(var(--super-color)) 180deg, transparent 225deg",children:o7}):o7})]});return l.jsx(aX,{condition:Je&&x,Wrapper:iX,onDrop:Su,disabled:gt,allowDropAnywhere:!0,children:dfe})},lX=A.memo(kDe);lX.displayName="AskInput";const cX=ie.PRO,MDe=e=>({id:e.task_id,title:e.task_name,prompt:e.prompt,searchModel:v1e(e.model_preference)??cX,sources:Fx(e.sources),preconfigured:e.preconfigured});function Rbt(e=""){return{title:"",prompt:e,searchModel:cX,sources:["web"],preconfigured:!1}}function TDe({reason:e,enabled:t=!0}){const{$t:n}=J(),[r,s]=d.useState(!1),{openModal:o}=pn().legacy,a=Wt(),i=t,c=bg(),{overwriteSources:u}=og({reason:e}),{data:f,isStale:m,refetch:p}=rX({reason:e,enabled:i&&r,staleTime:600*1e3}),h=d.useCallback(()=>{r?m&&p():s(!0)},[r,m,p]),g=d.useCallback(()=>{o("taskShortcutModal",{source:"typeahead_create"})},[o]),y=d.useCallback((v,b)=>{let _=oe.SEARCH;v===ie.ALPHA?_=oe.RESEARCH:v===ie.BETA&&(_=oe.STUDIO),c(v,_),u(b)},[c,u]),x=d.useMemo(()=>{const b=(f??[]).map(_=>({uuid:_.task_id,variant:"shortcut",label:`/${_.task_name}`,queryText:_.prompt,className:"group/shortcut-typeahead-option",action:()=>y(_.model_preference,_.sources),convertToNode:!0,rightElement:({focused:w})=>l.jsx(ADe,{shortcut:_,focused:w})}));return i&&a&&b.push({uuid:"create-a-shortcut",variant:"shortcut",label:n({defaultMessage:"+ Create a shortcut",id:"P9a8R5IRCb"}),action:g,convertToNode:!1,isAlwaysVisible:!0}),b},[f,i,a,y,n,g]);return d.useMemo(()=>({isShortcutTasksEnabled:i,shortcutsTypeaheadOptions:x,onTrigger:h}),[i,x,h])}function ADe({shortcut:e,focused:t}){const{openModal:n}=pn().legacy,r=d.useCallback(s=>{s.preventDefault(),s.stopPropagation(),n("taskShortcutModal",{source:"typeahead_edit",shortcut:MDe(e)})},[n,e]);return l.jsx("div",{className:z("h-5 transition-opacity",t&&"opacity-100",!t&&"opacity-0"),children:l.jsx(st,{icon:B("edit"),size:"tiny",variant:"common",noPadding:!0,onMouseDown:r})})}const NDe=(e,t)=>{const[n,r]=d.useState(e),s=px(r,t);return d.useEffect(()=>{s(e)},[e,s]),n},RDe=5e3,DDe=3e3,jDe=(e,t=!0)=>{const n=t&&An()&&!!Us()?.is_personal_search_enabled,{sidecarSourceTab:{url:r}}=Qn(),s=NDe(r,DDe),o=d.useMemo(()=>["get_tabs_for_sidecar",s],[s]),{data:a=Pe}=mt({queryKey:o,queryFn:async()=>(await e.fetchOpenedTabs()).map(c=>{const u=Kp(c.url);return{uuid:String(c.tabId),variant:"tab",label:c.title,url:c.url,icon:u?{type:"image",url:u}:void 0}}),staleTime:RDe,enabled:n});return d.useMemo(()=>({tabs:a,tabAttachmentsEnabled:n}),[n,a])},IDe=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/spaces/mentions",e,{timeoutMs:Qe()});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to list at mention spaces",cause:n,status:r.status??0});return t},Dbt=async({reason:e})=>{const{data:t,error:n,response:r}=await de.GET("/rest/collections/list_space_templates",e,{timeoutMs:Qe(),numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to list space templates",cause:n,status:r.status??0});return t},PDe=async({limit:e=50,offset:t=0,reason:n})=>{const{data:r,error:s,response:o}=await de.GET("/rest/spaces/writable",n,{params:{query:{limit:e,offset:t}},timeoutMs:Qe()});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to list writable spaces",cause:s,status:o.status??0});return r};function ODe({reason:e,isLazy:t=!0,enabled:n=!0}){const[r,s]=d.useState(()=>!t),{data:o,isStale:a,refetch:i}=mt({queryKey:Xm(),queryFn:()=>IDe({reason:e}),enabled:n&&r,staleTime:600*1e3}),c=d.useCallback(()=>{r?a&&i():s(!0)},[r,a,i]),u=d.useMemo(()=>(o?.spaces??[]).map(m=>({uuid:m.uuid,variant:"space",label:m.title,icon:LDe(m)})),[o]);return d.useMemo(()=>({isAtMentionSpacesEnabled:n,mentionSpacesOptions:u,onTrigger:c}),[n,u,c])}function LDe(e){if(e.emoji){const t=Q4(e.emoji);if(t)return{type:"emoji",char:t}}return{type:"icon",icon:Kh}}const FDe=({reason:e})=>{const{isAllowed:t,isConnected:n}=sg({reason:e}),{sources:r,isSourceAllowed:s}=X4({isConnectorAllowed:t??(()=>!1)}),o=d.useMemo(()=>r.filter(a=>Jh(a)||Wi(a)||Ja(a)?!0:mW(a)?!1:uu(a)?n(a):!1),[r,n]);return d.useMemo(()=>({sources:o,isSourceAllowed:s}),[o,s])},BDe=W({defaultMessage:"Monthly query limit reached",id:"ooSshLDNri"});function UDe({isLazy:e=!0,enabled:t=!0,onMentionSource:n}){const{$t:r}=J(),[s,o]=d.useState(()=>!e),{getSourceLabel:a}=nc(),{cometMcpSources:i}=Nf(),{getSourceLimited:c}=K4(),{sources:u}=FDe({reason:"use-at-mention-sources"}),{trackSourceActivity:f}=IA(),{suggested:m=[],refresh:p}=IQ({sources:u}),h=d.useCallback(b=>{n?.(b),f(b)},[n,f]),g=d.useCallback(b=>{const _=c(b);return{uuid:b,variant:"source",label:a(b),icon:uX(b),action:()=>h(b),disabled:_,subtitle:_?r(BDe):void 0,convertToNode:!0}},[a,h,c,r]),y=d.useCallback(b=>({uuid:b,variant:"source",label:a(b),icon:VDe({sourceType:b,cometMcpSources:i}),action:()=>h(b),convertToNode:!0}),[a,i,h]),x=d.useMemo(()=>{const b=new Set([...m,...u]);return Array.from(b).map(_=>Jh(_)?g(_):y(_))},[g,y,m,u]),v=d.useCallback(()=>{s||o(!0),p()},[s,p]);return d.useMemo(()=>({isAtMentionSourcesEnabled:t,mentionSourcesOptions:x,onTrigger:v}),[t,x,v])}function VDe({sourceType:e,cometMcpSources:t}){if(Wi(e))return HDe(e);if(uu(e))return uX(e);if(Ja(e)){const n=Df(e),r=t[n];return r?zDe(r):void 0}}function HDe(e){return{type:"icon",icon:Yx[e].icon}}function uX(e){const t=If(e);if(t)return{type:"image",url:t}}function zDe(e){if(e.iconUrl)return{type:"image",url:e.iconUrl}}function WDe(e){return ha(e)||Ja(e)}const GDe=({reason:e,isLazy:t=!0,variants:n,collectionName:r})=>{const[s,o]=d.useState(""),a=un(),i=n===void 0||n.includes("tab"),c=n===void 0||n.includes("space"),u=n===void 0||n.includes("shortcut"),f=n===void 0||n.includes("sources"),{tabs:m,tabAttachmentsEnabled:p}=jDe(a,i),{isAtMentionSpacesEnabled:h,mentionSpacesOptions:g,onTrigger:y}=ODe({reason:e,isLazy:t,enabled:c}),{isShortcutTasksEnabled:x,shortcutsTypeaheadOptions:v,onTrigger:b}=TDe({reason:e,enabled:u}),{addSource:_,removeSource:w}=pW({useThreadSources:!1,reason:e}),S=rW(),C=d.useRef([]);d.useEffect(()=>{const F=MCe(S?.root);C.current.filter(L=>!F.includes(L)).filter(WDe).forEach(L=>{w(L)}),C.current=F},[S,w]);const E=d.useCallback(F=>_(F),[_]),{isAtMentionSourcesEnabled:T,mentionSourcesOptions:k,onTrigger:I}=UDe({isLazy:t,enabled:f,onMentionSource:E}),M=p||h||x||T,N=d.useMemo(()=>[...p&&s==="@"?m:[],...h&&s==="@"?g:[],...T&&s==="@"?k:[],...x&&s==="/"?v:[]],[p,s,m,h,g,x,v,T,k]),D=d.useCallback(F=>{o(F),F==="@"?(y(),I()):F==="/"&&b()},[b,y,I]),j=$De({isAtMentionSourcesEnabled:T,isShortcutTasksEnabled:x,isAtMentionCometTabsEnabled:p,collectionName:r});return d.useMemo(()=>({useLexical:M,mentionTypeaheadOptions:N,inputPlaceholder:j,onTriggerTypeahead:D}),[M,N,j,D])},$De=({isAtMentionSourcesEnabled:e,isShortcutTasksEnabled:t,isAtMentionCometTabsEnabled:n,collectionName:r})=>{const{$t:s}=J();return d.useMemo(()=>{try{if(typeof document>"u")return""}catch{return}const o=n||e,a=t;return r?o&&a?s({defaultMessage:"Ask anything about { collectionName }. Type @ for mentions and / for shortcuts.",id:"vpxXL78kip"},{collectionName:r}):o?s({defaultMessage:"Ask anything about { collectionName }. Type @ for mentions.",id:"QodmMNOAIa"},{collectionName:r}):a?s({defaultMessage:"Ask anything about { collectionName }. Type / for shortcuts.",id:"1uFeAjMFYC"},{collectionName:r}):s({defaultMessage:"Ask anything about { collectionName }.",id:"3ZcezoTfiM"},{collectionName:r}):s(o&&a?{defaultMessage:"Ask anything. Type @ for mentions and / for shortcuts.",id:"KO0XLRzele"}:o?{defaultMessage:"Ask anything. Type @ for mentions.",id:"iju9VLCg7F"}:a?{defaultMessage:"Ask anything. Type / for shortcuts.",id:"h47ZleZwvf"}:Nr[oe.SEARCH].askInputPlaceholder)},[s,n,e,t,r])},dX="comet.sidecar-input-state";function qDe(){try{const e=_a.getItem(dX);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function Bj(e){_a.setItem(dX,JSON.stringify(e))}function KDe({cometState:e,onSubmit:t}){const{tabId:n,secondaryTab:r}=e.sidecarSourceTab,s=fn(),o=d.useMemo(()=>ro(n,r?.tabId),[n,r?.tabId]),a=d.useRef(qDe()),[i,c]=d.useState(a.current[o]?.rawQuery??""),[u,f]=d.useState(a.current[o]?.rawQueryJson??void 0);d.useEffect(()=>{const g=a.current[o]??{},y=g.rawQuery??"",x=g.rawQueryJson??void 0;c(v=>v===y?v:y),f(v=>v===x?v:x)},[o]);const m=d.useCallback((g,y)=>{const x=a.current[o]??{};c(g),f(y);const v={...x,rawQuery:g,rawQueryJson:y??null},b={...a.current,[o]:v};a.current=b,Bj(b)},[o]),p=d.useCallback(()=>{const g={...a.current};delete g[o],a.current=g,Bj(g),c(""),f(void 0)},[o]),h=d.useCallback(g=>{const y=s.get("source"),x=vM(y)?y:"user";p(),t?.({...g,promptSource:g.promptSource||x})},[p,t,s]);return d.useMemo(()=>({persistedValue:i,persistedJson:u,persist:m,onSubmit:h}),[u,m,i,h])}const YDe=({url:e,title:t,secondaryUrl:n,secondaryTitle:r,userSelection:s})=>l.jsxs(K,{className:"p-sm ml-one gap-sm relative flex flex-1 flex-col",children:[l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsxs("div",{className:"gap-sm flex flex-1 items-center",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Po,{size:20,domain:$c(e),hideBorder:!0,className:"rounded-md border-none bg-none",overrideIconUrl:Kp(e)})}),t&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:t})]}),n&&l.jsxs("div",{className:"gap-sm flex flex-1 items-center",children:[l.jsx("div",{className:"shrink-0",children:l.jsx(Po,{size:20,domain:$c(n),hideBorder:!0,className:"rounded-md border-none bg-none",overrideIconUrl:Kp(n)})}),r&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:r})]})]}),l.jsx(St,{children:s?.text&&l.jsx(Te.div,{className:"ml-[28px]",initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.2,ease:"easeOut"},children:l.jsxs(V,{variant:"tiny",color:"light",className:"line-clamp-2 italic",children:['"',s.text,'"']})})})]}),VA=A.memo(e=>{const{value:t,json:n,onChange:r,onSubmit:s,...o}=e,a="sidecar-ask-input",i=un(),{hasAccessToProFeatures:c}=$t(),{specialCapabilities:u}=Yr(),f=c||u.unlimitedProSearch?ie.PRO:ie.DEFAULT,m=Qn(),{persistedValue:p,persistedJson:h,persist:g,onSubmit:y}=KDe({cometState:m,onSubmit:s}),x=d.useCallback(k=>{y({...k,modelPreferenceOverride:f})},[y,f]),{mentionTypeaheadOptions:v,onTriggerTypeahead:b}=GDe({reason:a,isLazy:!0});d.useEffect(()=>i.subscribeToCometQuery((k,{source:I})=>{y({query:k,forceFork:!0,promptSource:vM(I)?I:"user"})}),[i,y]);const _=un();d.useEffect(()=>{function k(I){I.key==="Escape"&&_.deactivateScreenshotTool()}return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k)}},[_]);const{sidecarSourceTab:{url:w,title:S,secondaryTab:C}}=m,E=m.actions.getUserSelection(),T=d.useCallback((k,I)=>{g(k,I),r(k,I)},[g,r]);return l.jsx("div",{className:"bg-base rounded-2xl",children:l.jsx(lX,{value:p,json:h,onChange:T,onSubmit:x,headerComponent:w?l.jsx(YDe,{url:w,title:S,userSelection:E,secondaryUrl:C?.url,secondaryTitle:C?.title}):void 0,forceHideSuggestions:!!E,autofocus:!0,showModelSelector:!1,showFileUpload:!0,hasShadow:!0,showIncognitoHint:!0,showSources:!1,dropdownPlacement:"top",useLexical:!0,syncUncontrolledOnce:!0,mentionTypeaheadOptions:v,onTriggerTypeahead:b,initialLayout:"expanded",minRows:1,className:"shadow-[0_36px_16px_36px_oklch(var(--background-base-color))] dark:shadow-[0_4px_12px_rgba(0,0,0,0.12),0_32px_16px_36px_oklch(var(--dark-background-base-color))]",...o})})});VA.displayName="SidecarAskInput";const QDe="chrome://settings/assistant",fX=A.memo(({onLearnMore:e})=>{const{$t:t}=J();return l.jsx(V,{color:"light",variant:"tinyRegular",className:"text-balance text-center",children:t({defaultMessage:"Comet Assistant uses the current page and relevant browser history to provide answers to your questions. Learn more",id:"+FQWtBvxT2"},{link:n=>l.jsx(V,{as:"button",color:"light",variant:"tinyRegular",onClick:e,className:"hover:text-super cursor-pointer underline",inline:!0,children:n})})})});fX.displayName="PrivacyEducationText";const mX=A.memo(({isVisible:e=!0,showPrivacyEducation:t=!1})=>{const{$t:n}=J(),r=un(!1),s=()=>{r?.openNewTab(QDe)};return l.jsxs("div",{className:"gap-md px-lg pb-xl fixed inset-0 z-10 flex flex-col items-center justify-center",children:[l.jsx(ge,{icon:epe,size:64,className:z("text-quietest opacity-0 transition-opacity",{"!opacity-100":e})}),l.jsxs("div",{className:"gap-2xs flex flex-col items-center",children:[l.jsx(V,{variant:"section-title",color:"light",children:n({defaultMessage:"Assistant",id:"CxJqEDZI3a",description:"Assistant"})}),t&&l.jsx(fX,{onLearnMore:s})]})]})});mX.displayName="SidecarBackground";const pX="pplx.sidecar_privacy_education_hidden_after_query",hX=A.memo(()=>{const[e,t,n]=NCe({csrRedirect:!0}),[,r]=Qi(pX,!1),s=d.useCallback(o=>{r(!0),n.onSubmit(o)},[n,r]);return l.jsx("div",{className:"relative",children:l.jsx(VA,{...n,onSubmit:s,value:e,json:t,querySource:"home"})})});hX.displayName="HomeSidecarAskInput";const HA=A.memo(function(){const{variation:t}=RCe(!1),[n]=Qi(pX,!1),r=t&&!n;return l.jsx(Of,{disableNewThread:!0,disableOpenInTab:!0,children:l.jsxs("div",{className:"px-md isolate mx-auto size-full min-w-[420px] sm:max-w-screen-md",children:[l.jsx(mX,{showPrivacyEducation:r}),l.jsx("div",{className:"relative flex h-full flex-col",children:l.jsx(Wc,{children:l.jsx(K,{className:"mt-md pointer-events-none static z-10 w-full grow flex-col items-center justify-center",children:l.jsx("div",{className:"bottom-md pointer-events-auto absolute w-full",children:l.jsx(hX,{})})})})})]})})});HA.displayName="SidecarHomePage";const mi=()=>{const[e,t]=A.useState(!1);return A.useEffect(()=>{t(!0)},[]),e},XDe=()=>{const e=d.useRef(!1),{results:t,lastResult:n}=on(),r=mi(),s=Wt(),{openVisitorLoginUpsell:o}=du({enabled:!s}),a=kl({upsellInformation:n?.upsell_information});d.useEffect(()=>{e.current||r&&t.length>=1&&n&&n.upsell_information?.app_location===Ns.MODAL&&(a(),e.current=!0)},[r,s,o,t.length,n,a])},ZDe=()=>{const e=Wt(),{isMobileUserAgent:t}=Re(),{firstResult:n}=on(),r=n?.author_username,{openInstallUpsell:s}=SW(),[o,a]=Wd("shareGateImpressions",0),i=d.useRef(!1),c=fn(),u=c?.get("installGate"),f=c?.get("q");d.useEffect(()=>{i.current||e||t&&(!r&&!f||By()||TU()||AU()||u==="true"&&(o>=pV||(s({origin:ft.SHARED_THREAD_INSTALL_GATE,sheetModalVariant:"inset-centered-sheet"}),a(o+1),i.current=!0)))},[a,r,t,f,u,e,s,o])},JDe=()=>{const{device:{isMetaBrowser:e,isIOS:t,isAndroid:n}}=sn();return d.useCallback(()=>{if(!e||typeof window>"u")return;const s=window.location.href;let o;t?o=s.replace(/^https?:\/\//,"x-safari-https://"):n&&(o=`intent://${s.replace(/^https?:\/\//,"")}#Intent;scheme=https;package=com.android.chrome;end`),o&&No(o,"Redirecting to native browser")},[e,t,n])};function zA(e){return e===document.documentElement}function fE(e){return zA(e)?window.scrollY:e.scrollTop}function gX(e){return zA(e)?window.innerHeight:e.clientHeight}function yX(e){return e.scrollHeight}function Uj(e,t,n="smooth"){zA(e)?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})}function mE(e){const t=yX(e),n=gX(e),r=fE(e);return Math.abs(t-n-r)<=1}const eje=(e,t)=>e?"full-sheet-blurred":t==="delayed"?"bottom-sheet-gradient":"centered-sheet",tje=()=>{const{$t:e}=J(),t=Wt(),{isMobileUserAgent:n}=Re(),{firstResult:r}=on(),s=r?.author_username,{openVisitorLoginUpsell:o}=du({enabled:!0}),[a,i]=Wd("shareGateImpressions",0),c=d.useRef(!1),u=fn(),{scrollContainerRef:f}=ka(),[m,p]=d.useState(!1),h=JDe(),g=u?.get("visitorGate"),y=u?.get("q");d.useEffect(()=>{const x=f.current;if(x)return x.addEventListener("scroll",()=>{p(mE(x))}),()=>{x.removeEventListener("scroll",()=>{p(mE(x))})}},[f]),d.useEffect(()=>{c.current||t||!s&&!y||TU()||AU()||a>=pV||g==="false"||g==="delayed"&&!m||!g&&!(!n&&!y)||(h(),o({origin:ft.SHARED_THREAD_LOGIN_GATE,description:"",title:e({defaultMessage:"Instant answers at your fingertips",id:"NFjQpck2Ql"}),sheetModalVariant:eje(n,g),overrideMobileVariant:!0}),i(a+1),c.current=!0)},[n,t,o,e,a,i,m,g,u,s,h,y])};var Tv="Tabs",[nje]=Vs(Tv,[Jl]),xX=Jl(),[rje,WA]=nje(Tv),vX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:i,activationMode:c="automatic",...u}=e,f=Pf(i),[m,p]=fo({prop:r,onChange:s,defaultProp:o??"",caller:Tv});return l.jsx(rje,{scope:n,baseId:ls(),value:m,onValueChange:p,orientation:a,dir:f,activationMode:c,children:l.jsx(Et.div,{dir:f,"data-orientation":a,...u,ref:t})})});vX.displayName=Tv;var bX="TabsList",_X=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=WA(bX,n),a=xX(n);return l.jsx(Zx,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Et.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});_X.displayName=bX;var wX="TabsTrigger",CX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=WA(wX,n),i=xX(n),c=kX(a.baseId,r),u=MX(a.baseId,r),f=r===a.value;return l.jsx(Jx,{asChild:!0,...i,focusable:!s,active:f,children:l.jsx(Et.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:rt(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:rt(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:rt(e.onFocus,()=>{const m=a.activationMode!=="manual";!f&&!s&&m&&a.onValueChange(r)})})})});CX.displayName=wX;var SX="TabsContent",EX=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,i=WA(SX,n),c=kX(i.baseId,r),u=MX(i.baseId,r),f=r===i.value,m=d.useRef(f);return d.useEffect(()=>{const p=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(Hr,{present:s||f,children:({present:p})=>l.jsx(Et.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:p&&o})})});EX.displayName=SX;function kX(e,t){return`${e}-trigger-${t}`}function MX(e,t){return`${e}-content-${t}`}var sje=vX,oje=_X,aje=CX,ije=EX;const GA=d.createContext({fullWidth:!1,size:"default",currentValue:void 0,registerTabRef:()=>{},unregisterTabRef:()=>{},updateIndicatorRef:{current:()=>{}}});function Av(){return d.useContext(GA)}const lje=d.memo(function({listRef:t}){const n=Av(),r=d.useRef(null),s=d.useRef(null),[o,a]=d.useState(!1),[i,c]=d.useState({leftPx:0,widthPx:0,opacity:0}),u=d.useCallback(()=>{const f=t.current;if(!f)return;const m=f.querySelector('[data-state="active"]');if(!m)return;const p=f.getBoundingClientRect(),h=m.getBoundingClientRect(),g=h.left-p.left,y=h.width;return c({leftPx:g,widthPx:y,opacity:1}),o||requestAnimationFrame(()=>{a(!0)}),m!==r.current&&s.current&&(r.current&&s.current.unobserve(r.current),s.current.observe(m),r.current=m),m},[t,o]);return d.useEffect(()=>{n.updateIndicatorRef.current=u},[n,u]),d.useEffect(()=>{s.current=new ResizeObserver(()=>{requestAnimationFrame(()=>{u()})});const f=u();return f&&(s.current.observe(f),r.current=f),()=>{s.current?.disconnect(),s.current=null,r.current=null}},[u,t]),l.jsx("span",{className:z("absolute bottom-0 h-two bg-inverse pointer-events-none",{"transition-[transform,width,opacity] duration-300 ease-in-out":o}),style:{transform:`translateX(${i.leftPx}px)`,width:`${i.widthPx}px`,opacity:i.opacity},"aria-hidden":"true"})}),cje=ci("flex flex-row",{variants:{showBottomBorder:{false:"",true:"border-b border-subtler"},fullWidth:{false:"",true:"gap-0"},size:{default:"h-[54px]",compact:"h-[44px]"}},compoundVariants:[{fullWidth:!1,size:"default",class:"gap-5"},{fullWidth:!1,size:"compact",class:"gap-4"}],defaultVariants:{showBottomBorder:!1,fullWidth:!1,size:"default"}});function uje({children:e,"aria-label":t,showBottomBorder:n=!1,fullWidth:r=!1,size:s="default",...o}){const a=wa(o),i=Av(),c=d.useRef(null),u=d.useMemo(()=>({...i,fullWidth:r,size:s}),[i,r,s]);return l.jsx(GA.Provider,{value:u,children:l.jsxs(oje,{ref:c,"aria-label":t,className:z(cje({showBottomBorder:n,fullWidth:r,size:s}),"relative"),...a,children:[e,l.jsx(lje,{listRef:c})]})})}var $A=Eg(),jt=e=>Sg(e,$A),qA=Eg();jt.write=e=>Sg(e,qA);var Nv=Eg();jt.onStart=e=>Sg(e,Nv);var KA=Eg();jt.onFrame=e=>Sg(e,KA);var YA=Eg();jt.onFinish=e=>Sg(e,YA);var kd=[];jt.setTimeout=(e,t)=>{const n=jt.now()+t,r=()=>{const o=kd.findIndex(a=>a.cancel==r);~o&&kd.splice(o,1),Cl-=~o?1:0},s={time:n,handler:e,cancel:r};return kd.splice(TX(n),0,s),Cl+=1,AX(),s};var TX=e=>~(~kd.findIndex(t=>t.time>e)||~kd.length);jt.cancel=e=>{Nv.delete(e),KA.delete(e),YA.delete(e),$A.delete(e),qA.delete(e)};jt.sync=e=>{pE=!0,jt.batchedUpdates(e),pE=!1};jt.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...s){t=s,jt.onStart(n)}return r.handler=e,r.cancel=()=>{Nv.delete(n),t=null},r};var QA=typeof window<"u"?window.requestAnimationFrame:(()=>{});jt.use=e=>QA=e;jt.now=typeof performance<"u"?()=>performance.now():Date.now;jt.batchedUpdates=e=>e();jt.catch=console.error;jt.frameLoop="always";jt.advance=()=>{jt.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):RX()};var wl=-1,Cl=0,pE=!1;function Sg(e,t){pE?(t.delete(e),e(0)):(t.add(e),AX())}function AX(){wl<0&&(wl=0,jt.frameLoop!=="demand"&&QA(NX))}function dje(){wl=-1}function NX(){~wl&&(QA(NX),jt.batchedUpdates(RX))}function RX(){const e=wl;wl=jt.now();const t=TX(wl);if(t&&(DX(kd.splice(0,t),n=>n.handler()),Cl-=t),!Cl){dje();return}Nv.flush(),$A.flush(e?Math.min(64,wl-e):16.667),KA.flush(),qA.flush(),YA.flush()}function Eg(){let e=new Set,t=e;return{add(n){Cl+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Cl-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Cl-=t.size,DX(t,r=>r(n)&&e.add(r)),Cl+=e.size,t=e)}}}function DX(e,t){e.forEach(n=>{try{t(n)}catch(r){jt.catch(r)}})}var fje=Object.defineProperty,mje=(e,t)=>{for(var n in t)fje(e,n,{get:t[n],enumerable:!0})},xa={};mje(xa,{assign:()=>hje,colors:()=>Al,createStringInterpolator:()=>ZA,skipAnimation:()=>IX,to:()=>jX,willAdvance:()=>JA});function hE(){}var pje=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ie={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Ei(e,t){if(Ie.arr(e)){if(!Ie.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function ni(e,t,n){if(Ie.arr(e)){for(let r=0;rIe.und(e)?[]:Ie.arr(e)?e:[e];function Tp(e,t){if(e.size){const n=Array.from(e);e.clear(),Mt(n,t)}}var np=(e,...t)=>Tp(e,n=>n(...t)),XA=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ZA,jX,Al=null,IX=!1,JA=hE,hje=e=>{e.to&&(jX=e.to),e.now&&(jt.now=e.now),e.colors!==void 0&&(Al=e.colors),e.skipAnimation!=null&&(IX=e.skipAnimation),e.createStringInterpolator&&(ZA=e.createStringInterpolator),e.requestAnimationFrame&&jt.use(e.requestAnimationFrame),e.batchedUpdates&&(jt.batchedUpdates=e.batchedUpdates),e.willAdvance&&(JA=e.willAdvance),e.frameLoop&&(jt.frameLoop=e.frameLoop)},Ap=new Set,Co=[],cw=[],b2=0,Rv={get idle(){return!Ap.size&&!Co.length},start(e){b2>e.priority?(Ap.add(e),jt.onStart(gje)):(PX(e),jt(gE))},advance:gE,sort(e){if(b2)jt.onFrame(()=>Rv.sort(e));else{const t=Co.indexOf(e);~t&&(Co.splice(t,1),OX(e))}},clear(){Co=[],Ap.clear()}};function gje(){Ap.forEach(PX),Ap.clear(),jt(gE)}function PX(e){Co.includes(e)||OX(e)}function OX(e){Co.splice(yje(Co,t=>t.priority>e.priority),0,e)}function gE(e){const t=cw;for(let n=0;n0}function yje(e,t){const n=e.findIndex(t);return n<0?e.length:n}var xje={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},la="[-+]?\\d*\\.?\\d+",_2=la+"%";function Dv(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var vje=new RegExp("rgb"+Dv(la,la,la)),bje=new RegExp("rgba"+Dv(la,la,la,la)),_je=new RegExp("hsl"+Dv(la,_2,_2)),wje=new RegExp("hsla"+Dv(la,_2,_2,la)),Cje=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Sje=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Eje=/^#([0-9a-fA-F]{6})$/,kje=/^#([0-9a-fA-F]{8})$/;function Mje(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Eje.exec(e))?parseInt(t[1]+"ff",16)>>>0:Al&&Al[e]!==void 0?Al[e]:(t=vje.exec(e))?(Lu(t[1])<<24|Lu(t[2])<<16|Lu(t[3])<<8|255)>>>0:(t=bje.exec(e))?(Lu(t[1])<<24|Lu(t[2])<<16|Lu(t[3])<<8|zj(t[4]))>>>0:(t=Cje.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=kje.exec(e))?parseInt(t[1],16)>>>0:(t=Sje.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=_je.exec(e))?(Vj(Hj(t[1]),q0(t[2]),q0(t[3]))|255)>>>0:(t=wje.exec(e))?(Vj(Hj(t[1]),q0(t[2]),q0(t[3]))|zj(t[4]))>>>0:null}function uw(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Vj(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r,o=uw(s,r,e+1/3),a=uw(s,r,e),i=uw(s,r,e-1/3);return Math.round(o*255)<<24|Math.round(a*255)<<16|Math.round(i*255)<<8}function Lu(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Hj(e){return(parseFloat(e)%360+360)%360/360}function zj(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function q0(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Wj(e){let t=Mje(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,s=(t&65280)>>>8,o=(t&255)/255;return`rgba(${n}, ${r}, ${s}, ${o})`}var gh=(e,t,n)=>{if(Ie.fun(e))return e;if(Ie.arr(e))return gh({range:e,output:t,extrapolate:n});if(Ie.str(e.output[0]))return ZA(e);const r=e,s=r.output,o=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",i=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const f=Aje(u,o);return Tje(u,o[f],o[f+1],s[f],s[f+1],c,a,i,r.map)}};function Tje(e,t,n,r,s,o,a,i,c){let u=c?c(e):e;if(un){if(i==="identity")return u;i==="clamp"&&(u=n)}return r===s?r:t===n?e<=t?r:s:(t===-1/0?u=-u:n===1/0?u=u-t:u=(u-t)/(n-t),u=o(u),r===-1/0?u=-u:s===1/0?u=u+r:u=u*(s-r)+r,u)}function Aje(e,t){for(var n=1;n=e);++n);return n-1}var Nje={linear:e=>e},yh=Symbol.for("FluidValue.get"),Zd=Symbol.for("FluidValue.observers"),_o=e=>!!(e&&e[yh]),Ds=e=>e&&e[yh]?e[yh]():e,Gj=e=>e[Zd]||null;function Rje(e,t){e.eventObserved?e.eventObserved(t):e(t)}function xh(e,t){const n=e[Zd];n&&n.forEach(r=>{Rje(r,t)})}var LX=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Dje(this,e)}},Dje=(e,t)=>FX(e,yh,t);function qf(e,t){if(e[yh]){let n=e[Zd];n||FX(e,Zd,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function vh(e,t){const n=e[Zd];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Zd]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var FX=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),py=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,jje=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,$j=new RegExp(`(${py.source})(%|[a-z]+)`,"i"),Ije=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,jv=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,BX=e=>{const[t,n]=Pje(e);if(!t||XA())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const s=window.getComputedStyle(document.documentElement).getPropertyValue(n);return s||e}else{if(n&&jv.test(n))return BX(n);if(n)return n}return e},Pje=e=>{const t=jv.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},dw,Oje=(e,t,n,r,s)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,UX=e=>{dw||(dw=Al?new RegExp(`(${Object.keys(Al).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(o=>Ds(o).replace(jv,BX).replace(jje,Wj).replace(dw,Wj)),n=t.map(o=>o.match(py).map(Number)),s=n[0].map((o,a)=>n.map(i=>{if(!(a in i))throw Error('The arity of each "output" value must be equal');return i[a]})).map(o=>gh({...e,output:o}));return o=>{const a=!$j.test(t[0])&&t.find(c=>$j.test(c))?.replace(py,"");let i=0;return t[0].replace(py,()=>`${s[i++](o)}${a||""}`).replace(Ije,Oje)}},e6="react-spring: ",VX=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${e6}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},Lje=VX(console.warn);function Fje(){Lje(`${e6}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Bje=VX(console.warn);function Uje(){Bje(`${e6}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Iv(e){return Ie.str(e)&&(e[0]=="#"||/\d/.test(e)||!XA()&&jv.test(e)||e in(Al||{}))}var Ac=XA()?d.useEffect:d.useLayoutEffect,Vje=()=>{const e=d.useRef(!1);return Ac(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function t6(){const e=d.useState()[1],t=Vje();return()=>{t.current&&e(Math.random())}}var n6=e=>d.useEffect(e,Hje),Hje=[];function yE(e){const t=d.useRef(void 0);return d.useEffect(()=>{t.current=e}),t.current}var bh=Symbol.for("Animated:node"),zje=e=>!!e&&e[bh]===e,La=e=>e&&e[bh],r6=(e,t)=>pje(e,bh,t),Pv=e=>e&&e[bh]&&e[bh].getPayload(),HX=class{constructor(){r6(this,this)}getPayload(){return this.payload||[]}},Ov=class zX extends HX{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Ie.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new zX(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,n){return Ie.num(t)&&(this.lastPosition=t,n&&(t=Math.round(t/n)*n,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Ie.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},w2=class WX extends Ov{constructor(t){super(0),this._string=null,this._toString=gh({output:[t,t]})}static create(t){return new WX(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Ie.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=gh({output:[this.getValue(),t]})),this._value=0,super.reset()}},C2={dependencies:null},Lv=class extends HX{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ni(this.source,(n,r)=>{zje(n)?t[r]=n.getValue(e):_o(n)?t[r]=Ds(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Mt(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ni(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){C2.dependencies&&_o(e)&&C2.dependencies.add(e);const t=Pv(e);t&&Mt(t,n=>this.add(n))}},Wje=class GX extends Lv{constructor(t){super(t)}static create(t){return new GX(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const n=this.getPayload();return t.length==n.length?n.map((r,s)=>r.setValue(t[s])).some(Boolean):(super.setValue(t.map(Gje)),!0)}};function Gje(e){return(Iv(e)?w2:Ov).create(e)}function xE(e){const t=La(e);return t?t.constructor:Ie.arr(e)?Wje:Iv(e)?w2:Ov}var qj=(e,t)=>{const n=!Ie.fun(e)||e.prototype&&e.prototype.isReactComponent;return d.forwardRef((r,s)=>{const o=d.useRef(null),a=n&&d.useCallback(g=>{o.current=Kje(s,g)},[s]),[i,c]=qje(r,t),u=t6(),f=()=>{const g=o.current;if(n&&!g)return;(g?t.applyAnimatedValues(g,i.getValue(!0)):!1)===!1&&u()},m=new $je(f,c),p=d.useRef(void 0);Ac(()=>(p.current=m,Mt(c,g=>qf(g,m)),()=>{p.current&&(Mt(p.current.deps,g=>vh(g,p.current)),jt.cancel(p.current.update))})),d.useEffect(f,[]),n6(()=>()=>{const g=p.current;Mt(g.deps,y=>vh(y,g))});const h=t.getComponentProps(i.getValue());return d.createElement(e,{...h,ref:a})})},$je=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&jt.write(this.update)}};function qje(e,t){const n=new Set;return C2.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Lv(e),C2.dependencies=null,[e,n]}function Kje(e,t){return e&&(Ie.fun(e)?e(t):e.current=t),t}var Kj=Symbol.for("AnimatedComponent"),Yje=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=s=>new Lv(s),getComponentProps:r=s=>s}={})=>{const s={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},o=a=>{const i=Yj(a)||"Anonymous";return Ie.str(a)?a=o[a]||(o[a]=qj(a,s)):a=a[Kj]||(a[Kj]=qj(a,s)),a.displayName=`Animated(${i})`,a};return ni(e,(a,i)=>{Ie.arr(e)&&(i=Yj(a)),o[i]=o(a)}),{animated:o}},Yj=e=>Ie.str(e)?e:e&&Ie.str(e.displayName)?e.displayName:Ie.fun(e)&&e.name||null;function js(e,...t){return Ie.fun(e)?e(...t):e}var Np=(e,t)=>e===!0||!!(t&&e&&(Ie.fun(e)?e(t):_s(e).includes(t))),$X=(e,t)=>Ie.obj(e)?t&&e[t]:e,qX=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Qje=e=>e,Fv=(e,t=Qje)=>{let n=Xje;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const s of n){const o=t(e[s],s);Ie.und(o)||(r[s]=o)}return r},Xje=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Zje={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Jje(e){const t={};let n=0;if(ni(e,(r,s)=>{Zje[s]||(t[s]=r,n++)}),n)return t}function s6(e){const t=Jje(e);if(t){const n={to:t};return ni(e,(r,s)=>s in t||(n[s]=r)),n}return{...e}}function _h(e){return e=Ds(e),Ie.arr(e)?e.map(_h):Iv(e)?xa.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function KX(e){for(const t in e)return!0;return!1}function vE(e){return Ie.fun(e)||Ie.arr(e)&&Ie.obj(e[0])}function bE(e,t){e.ref?.delete(e),t?.delete(e)}function YX(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var eIe={default:{tension:170,friction:26}},_E={...eIe.default,mass:1,damping:1,easing:Nje.linear,clamp:!1},tIe=class{constructor(){this.velocity=0,Object.assign(this,_E)}};function nIe(e,t,n){n&&(n={...n},Qj(n,t),t={...n,...t}),Qj(e,t),Object.assign(e,t);for(const a in _E)e[a]==null&&(e[a]=_E[a]);let{frequency:r,damping:s}=e;const{mass:o}=e;return Ie.und(r)||(r<.01&&(r=.01),s<0&&(s=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*s*o/r),e}function Qj(e,t){if(!Ie.und(t.decay))e.duration=void 0;else{const n=!Ie.und(t.tension)||!Ie.und(t.friction);(n||!Ie.und(t.frequency)||!Ie.und(t.damping)||!Ie.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var Xj=[],rIe=class{constructor(){this.changed=!1,this.values=Xj,this.toValues=null,this.fromValues=Xj,this.config=new tIe,this.immediate=!1}};function QX(e,{key:t,props:n,defaultProps:r,state:s,actions:o}){return new Promise((a,i)=>{let c,u,f=Np(n.cancel??r?.cancel,t);if(f)h();else{Ie.und(n.pause)||(s.paused=Np(n.pause,t));let g=r?.pause;g!==!0&&(g=s.paused||Np(g,t)),c=js(n.delay||0,t),g?(s.resumeQueue.add(p),o.pause()):(o.resume(),p())}function m(){s.resumeQueue.add(p),s.timeouts.delete(u),u.cancel(),c=u.time-jt.now()}function p(){c>0&&!xa.skipAnimation?(s.delayed=!0,u=jt.setTimeout(h,c),s.pauseQueue.add(m),s.timeouts.add(u)):h()}function h(){s.delayed&&(s.delayed=!1),s.pauseQueue.delete(m),s.timeouts.delete(u),e<=(s.cancelId||0)&&(f=!0);try{o.start({...n,callId:e,cancel:f},a)}catch(g){i(g)}}})}var o6=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?Md(e.get()):t.every(n=>n.noop)?XX(e.get()):sa(e.get(),t.every(n=>n.finished)),XX=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),sa=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Md=e=>({value:e,cancelled:!0,finished:!1});function ZX(e,t,n,r){const{callId:s,parentId:o,onRest:a}=t,{asyncTo:i,promise:c}=n;return!o&&e===i&&!t.reset?c:n.promise=(async()=>{n.asyncId=s,n.asyncTo=e;const u=Fv(t,(x,v)=>v==="onRest"?void 0:x);let f,m;const p=new Promise((x,v)=>(f=x,m=v)),h=x=>{const v=s<=(n.cancelId||0)&&Md(r)||s!==n.asyncId&&sa(r,!1);if(v)throw x.result=v,m(x),x},g=(x,v)=>{const b=new Zj,_=new Jj;return(async()=>{if(xa.skipAnimation)throw wh(n),_.result=sa(r,!1),m(_),_;h(b);const w=Ie.obj(x)?{...x}:{...v,to:x};w.parentId=s,ni(u,(C,E)=>{Ie.und(w[E])&&(w[E]=C)});const S=await r.start(w);return h(b),n.paused&&await new Promise(C=>{n.resumeQueue.add(C)}),S})()};let y;if(xa.skipAnimation)return wh(n),sa(r,!1);try{let x;Ie.arr(e)?x=(async v=>{for(const b of v)await g(b)})(e):x=Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([x.then(f),p]),y=sa(r.get(),!0,!1)}catch(x){if(x instanceof Zj)y=x.result;else if(x instanceof Jj)y=x.result;else throw x}finally{s==n.asyncId&&(n.asyncId=o,n.asyncTo=o?i:void 0,n.promise=o?c:void 0)}return Ie.fun(a)&&jt.batchedUpdates(()=>{a(y,r,r.item)}),y})()}function wh(e,t){Tp(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Zj=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Jj=class extends Error{constructor(){super("SkipAnimationSignal")}},wE=e=>e instanceof a6,sIe=1,a6=class extends LX{constructor(){super(...arguments),this.id=sIe++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=La(this);return e&&e.getValue()}to(...e){return xa.to(this,e)}interpolate(...e){return Fje(),xa.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){xh(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Rv.sort(this),xh(this,{type:"priority",parent:this,priority:e})}},Xc=Symbol.for("SpringPhase"),JX=1,CE=2,SE=4,fw=e=>(e[Xc]&JX)>0,al=e=>(e[Xc]&CE)>0,Tm=e=>(e[Xc]&SE)>0,eI=(e,t)=>t?e[Xc]|=CE|JX:e[Xc]&=~CE,tI=(e,t)=>t?e[Xc]|=SE:e[Xc]&=~SE,oIe=class extends a6{constructor(e,t){if(super(),this.animation=new rIe,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ie.und(e)||!Ie.und(t)){const n=Ie.obj(e)?{...e}:{...t,from:e};Ie.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(al(this)||this._state.asyncTo)||Tm(this)}get goal(){return Ds(this.animation.to)}get velocity(){const e=La(this);return e instanceof Ov?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return fw(this)}get isAnimating(){return al(this)}get isPaused(){return Tm(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:s}=r;const{config:o}=r,a=Pv(r.to);!a&&_o(r.to)&&(s=_s(Ds(r.to))),r.values.forEach((u,f)=>{if(u.done)return;const m=u.constructor==w2?1:a?a[f].lastPosition:s[f];let p=r.immediate,h=m;if(!p){if(h=u.lastPosition,o.tension<=0){u.done=!0;return}let g=u.elapsedTime+=e;const y=r.fromValues[f],x=u.v0!=null?u.v0:u.v0=Ie.arr(o.velocity)?o.velocity[f]:o.velocity;let v;const b=o.precision||(y==m?.005:Math.min(1,Math.abs(m-y)*.001));if(Ie.und(o.duration))if(o.decay){const _=o.decay===!0?.998:o.decay,w=Math.exp(-(1-_)*g);h=y+x/(1-_)*(1-w),p=Math.abs(u.lastPosition-h)<=b,v=x*w}else{v=u.lastVelocity==null?x:u.lastVelocity;const _=o.restVelocity||b/10,w=o.clamp?0:o.bounce,S=!Ie.und(w),C=y==m?u.v0>0:y_,!(!E&&(p=Math.abs(m-h)<=b,p)));++M){S&&(T=h==m||h>m==C,T&&(v=-v*w,h=m));const N=-o.tension*1e-6*(h-m),D=-o.friction*.001*v,j=(N+D)/o.mass;v=v+j*k,h=h+v*k}}else{let _=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,u.durationProgress>0&&(u.elapsedTime=o.duration*u.durationProgress,g=u.elapsedTime+=e)),_=(o.progress||0)+g/this._memoizedDuration,_=_>1?1:_<0?0:_,u.durationProgress=_),h=y+o.easing(_)*(m-y),v=(h-u.lastPosition)/e,p=_==1}u.lastVelocity=v,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[f].done&&(p=!1),p?u.done=!0:t=!1,u.setValue(h,o.round)&&(n=!0)});const i=La(this),c=i.getValue();if(t){const u=Ds(r.to);(c!==u||n)&&!o.decay?(i.setValue(u),this._onChange(u)):n&&o.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return jt.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(al(this)){const{to:e,config:t}=this.animation;jt.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ie.und(e)?(n=this.queue||[],this.queue=[]):n=[Ie.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>o6(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),wh(this._state,e&&this._lastCallId),jt.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=Ie.obj(n)?n[t]:n,(n==null||vE(n))&&(n=void 0),r=Ie.obj(r)?r[t]:r,r==null&&(r=void 0);const s={to:n,from:r};return fw(this)||(e.reverse&&([n,r]=[r,n]),r=Ds(r),Ie.und(r)?La(this)||this._set(n):this._set(r)),s}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Fv(e,(a,i)=>/^on/.test(i)?$X(a,n):a)),rI(this,e,"onProps"),Nm(this,"onProps",e,this);const s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const o=this._state;return QX(++this._lastCallId,{key:n,props:e,defaultProps:r,state:o,actions:{pause:()=>{Tm(this)||(tI(this,!0),np(o.pauseQueue),Nm(this,"onPause",sa(this,Am(this,this.animation.to)),this))},resume:()=>{Tm(this)&&(tI(this,!1),al(this)&&this._resume(),np(o.resumeQueue),Nm(this,"onResume",sa(this,Am(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const i=eZ(e);if(i)return this._update(i,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Md(this));const r=!Ie.und(e.to),s=!Ie.und(e.from);if(r||s)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Md(this));const{key:o,defaultProps:a,animation:i}=this,{to:c,from:u}=i;let{to:f=c,from:m=u}=e;s&&!r&&(!t.default||Ie.und(f))&&(f=m),t.reverse&&([f,m]=[m,f]);const p=!Ei(m,u);p&&(i.from=m),m=Ds(m);const h=!Ei(f,c);h&&this._focus(f);const g=vE(t.to),{config:y}=i,{decay:x,velocity:v}=y;(r||s)&&(y.velocity=0),t.config&&!g&&nIe(y,js(t.config,o),t.config!==a.config?js(a.config,o):void 0);let b=La(this);if(!b||Ie.und(f))return n(sa(this,!0));const _=Ie.und(t.reset)?s&&!t.default:!Ie.und(m)&&Np(t.reset,o),w=_?m:this.get(),S=_h(f),C=Ie.num(S)||Ie.arr(S)||Iv(S),E=!g&&(!C||Np(a.immediate||t.immediate,o));if(h){const M=xE(f);if(M!==b.constructor)if(E)b=this._set(S);else throw Error(`Cannot animate between ${b.constructor.name} and ${M.name}, as the "to" prop suggests`)}const T=b.constructor;let k=_o(f),I=!1;if(!k){const M=_||!fw(this)&&p;(h||M)&&(I=Ei(_h(w),S),k=!I),(!Ei(i.immediate,E)&&!E||!Ei(y.decay,x)||!Ei(y.velocity,v))&&(k=!0)}if(I&&al(this)&&(i.changed&&!_?k=!0:k||this._stop(c)),!g&&((k||_o(c))&&(i.values=b.getPayload(),i.toValues=_o(f)?null:T==w2?[1]:_s(S)),i.immediate!=E&&(i.immediate=E,!E&&!_&&this._set(c)),k)){const{onRest:M}=i;Mt(iIe,D=>rI(this,t,D));const N=sa(this,Am(this,c));np(this._pendingCalls,N),this._pendingCalls.add(n),i.changed&&jt.batchedUpdates(()=>{i.changed=!_,M?.(N,this),_?js(a.onRest,N):i.onStart?.(N,this)})}_&&this._set(w),g?n(ZX(t.to,t,this._state,this)):k?this._start():al(this)&&!h?this._pendingCalls.add(n):n(XX(w))}_focus(e){const t=this.animation;e!==t.to&&(Gj(this)&&this._detach(),t.to=e,Gj(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;_o(t)&&(qf(t,this),wE(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;_o(e)&&vh(e,this)}_set(e,t=!0){const n=Ds(e);if(!Ie.und(n)){const r=La(this);if(!r||!Ei(n,r.getValue())){const s=xE(n);!r||r.constructor!=s?r6(this,s.create(n)):r.setValue(n),r&&jt.batchedUpdates(()=>{this._onChange(n,t)})}}return La(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Nm(this,"onStart",sa(this,Am(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),js(this.animation.onChange,e,this)),js(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;La(this).reset(Ds(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),al(this)||(eI(this,!0),Tm(this)||this._resume())}_resume(){xa.skipAnimation?this.finish():Rv.start(this)}_stop(e,t){if(al(this)){eI(this,!1);const n=this.animation;Mt(n.values,s=>{s.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),xh(this,{type:"idle",parent:this});const r=t?Md(this.get()):sa(this.get(),Am(this,e??n.to));np(this._pendingCalls,r),n.changed&&(n.changed=!1,Nm(this,"onRest",r,this))}}};function Am(e,t){const n=_h(t),r=_h(e.get());return Ei(r,n)}function eZ(e,t=e.loop,n=e.to){const r=js(t);if(r){const s=r!==!0&&s6(r),o=(s||e).reverse,a=!s||s.reset;return Ch({...e,loop:t,default:!1,pause:void 0,to:!o||vE(n)?n:void 0,from:a?e.from:void 0,reset:a,...s})}}function Ch(e){const{to:t,from:n}=e=s6(e),r=new Set;return Ie.obj(t)&&nI(t,r),Ie.obj(n)&&nI(n,r),e.keys=r.size?Array.from(r):null,e}function aIe(e){const t=Ch(e);return Ie.und(t.default)&&(t.default=Fv(t)),t}function nI(e,t){ni(e,(n,r)=>n!=null&&t.add(r))}var iIe=["onStart","onRest","onChange","onPause","onResume"];function rI(e,t,n){e.animation[n]=t[n]!==qX(t,n)?$X(t[n],e.key):void 0}function Nm(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var lIe=["onStart","onChange","onRest"],cIe=1,tZ=class{constructor(e,t){this.id=cIe++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];Ie.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ch(e)),this}start(e){let{queue:t}=this;return e?t=_s(e).map(Ch):this.queue=[],this._flush?this._flush(this,t):(aZ(this,t),EE(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Mt(_s(t),r=>n[r].stop(!!e))}else wh(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(Ie.und(e))this.start({pause:!0});else{const t=this.springs;Mt(_s(e),n=>t[n].pause())}return this}resume(e){if(Ie.und(e))this.start({pause:!1});else{const t=this.springs;Mt(_s(e),n=>t[n].resume())}return this}each(e){ni(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,Tp(e,([i,c])=>{c.value=this.get(),i(c,this,this._item)}));const o=!r&&this._started,a=s||o&&n.size?this.get():null;s&&t.size&&Tp(t,([i,c])=>{c.value=a,i(c,this,this._item)}),o&&(this._started=!1,Tp(n,([i,c])=>{c.value=a,i(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;jt.onFrame(this._onFrame)}};function EE(e,t){return Promise.all(t.map(n=>nZ(e,n))).then(n=>o6(e,n))}async function nZ(e,t,n){const{keys:r,to:s,from:o,loop:a,onRest:i,onResolve:c}=t,u=Ie.obj(t.default)&&t.default;a&&(t.loop=!1),s===!1&&(t.to=null),o===!1&&(t.from=null);const f=Ie.arr(s)||Ie.fun(s)?s:void 0;f?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):Mt(lIe,y=>{const x=t[y];if(Ie.fun(x)){const v=e._events[y];t[y]=({finished:b,cancelled:_})=>{const w=v.get(x);w?(b||(w.finished=!1),_&&(w.cancelled=!0)):v.set(x,{value:null,finished:b||!1,cancelled:_||!1})},u&&(u[y]=t[y])}});const m=e._state;t.pause===!m.paused?(m.paused=t.pause,np(t.pause?m.pauseQueue:m.resumeQueue)):m.paused&&(t.pause=!0);const p=(r||Object.keys(e.springs)).map(y=>e.springs[y].start(t)),h=t.cancel===!0||qX(t,"cancel")===!0;(f||h&&m.asyncId)&&p.push(QX(++e._lastAsyncId,{props:t,state:m,actions:{pause:hE,resume:hE,start(y,x){h?(wh(m,e._lastAsyncId),x(Md(e))):(y.onRest=i,x(ZX(f,y,m,e)))}}})),m.paused&&await new Promise(y=>{m.resumeQueue.add(y)});const g=o6(e,await Promise.all(p));if(a&&g.finished&&!(n&&g.noop)){const y=eZ(t,a,s);if(y)return aZ(e,[y]),nZ(e,y,!0)}return c&&jt.batchedUpdates(()=>c(g,e,e.item)),g}function kE(e,t){const n={...e.springs};return t&&Mt(_s(t),r=>{Ie.und(r.keys)&&(r=Ch(r)),Ie.obj(r.to)||(r={...r,to:void 0}),oZ(n,r,s=>sZ(s))}),rZ(e,n),n}function rZ(e,t){ni(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,qf(n,e))})}function sZ(e,t){const n=new oIe;return n.key=e,t&&qf(n,t),n}function oZ(e,t,n){t.keys&&Mt(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function aZ(e,t){Mt(t,n=>{oZ(e.springs,n,r=>sZ(r,e))})}var iZ=d.createContext({pause:!1,immediate:!1}),lZ=()=>{const e=[],t=function(r){Uje();const s=[];return Mt(e,(o,a)=>{if(Ie.und(r))s.push(o.start());else{const i=n(r,o,a);i&&s.push(o.start(i))}}),s};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const s=e.indexOf(r);~s&&e.splice(s,1)},t.pause=function(){return Mt(e,r=>r.pause(...arguments)),this},t.resume=function(){return Mt(e,r=>r.resume(...arguments)),this},t.set=function(r){Mt(e,(s,o)=>{const a=Ie.fun(r)?r(o,s):r;a&&s.set(a)})},t.start=function(r){const s=[];return Mt(e,(o,a)=>{if(Ie.und(r))s.push(o.start());else{const i=this._getProps(r,o,a);i&&s.push(o.start(i))}}),s},t.stop=function(){return Mt(e,r=>r.stop(...arguments)),this},t.update=function(r){return Mt(e,(s,o)=>s.update(this._getProps(r,s,o))),this};const n=function(r,s,o){return Ie.fun(r)?r(o,s):r};return t._getProps=n,t};function uIe(e,t,n){const r=Ie.fun(t)&&t;r&&!n&&(n=[]);const s=d.useMemo(()=>r||arguments.length==3?lZ():void 0,[]),o=d.useRef(0),a=t6(),i=d.useMemo(()=>({ctrls:[],queue:[],flush(v,b){const _=kE(v,b);return o.current>0&&!i.queue.length&&!Object.keys(_).some(S=>!v.springs[S])?EE(v,b):new Promise(S=>{rZ(v,_),i.queue.push(()=>{S(EE(v,b))}),a()})}}),[]),c=d.useRef([...i.ctrls]),u=d.useRef([]),f=yE(e)||0;d.useMemo(()=>{Mt(c.current.slice(e,f),v=>{bE(v,s),v.stop(!0)}),c.current.length=e,m(f,e)},[e]),d.useMemo(()=>{m(0,Math.min(f,e))},n);function m(v,b){for(let _=v;_kE(v,u.current[b])),h=d.useContext(iZ),g=yE(h),y=h!==g&&KX(h);Ac(()=>{o.current++,i.ctrls=c.current;const{queue:v}=i;v.length&&(i.queue=[],Mt(v,b=>b())),Mt(c.current,(b,_)=>{s?.add(b),y&&b.start({default:h});const w=u.current[_];w&&(YX(b,w.ref),b.ref?b.queue.push(w):b.start(w))})}),n6(()=>()=>{Mt(i.ctrls,v=>v.stop(!0))});const x=p.map(v=>({...v}));return s?[x,s]:x}function dIe(e,t){const n=Ie.fun(e),[[r],s]=uIe(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,s]:r}function i6(e,t,n){const r=Ie.fun(t)&&t,{reset:s,sort:o,trail:a=0,expires:i=!0,exitBeforeEnter:c=!1,onDestroyed:u,ref:f,config:m}=r?r():t,p=d.useMemo(()=>r||arguments.length==3?lZ():void 0,[]),h=_s(e),g=[],y=d.useRef(null),x=s?null:y.current;Ac(()=>{y.current=g}),n6(()=>(Mt(g,j=>{p?.add(j.ctrl),j.ctrl.ref=p}),()=>{Mt(y.current,j=>{j.expired&&clearTimeout(j.expirationId),bE(j.ctrl,p),j.ctrl.stop(!0)})}));const v=mIe(h,r?r():t,x),b=s&&y.current||[];Ac(()=>Mt(b,({ctrl:j,item:F,key:R})=>{bE(j,p),js(u,F,R)}));const _=[];if(x&&Mt(x,(j,F)=>{j.expired?(clearTimeout(j.expirationId),b.push(j)):(F=_[F]=v.indexOf(j.key),~F&&(g[F]=j))}),Mt(h,(j,F)=>{g[F]||(g[F]={key:v[F],item:j,phase:"mount",ctrl:new tZ},g[F].ctrl.item=j)}),_.length){let j=-1;const{leave:F}=r?r():t;Mt(_,(R,P)=>{const L=x[P];~R?(j=g.indexOf(L),g[j]={...L,item:h[R]}):F&&g.splice(++j,0,L)})}Ie.fun(o)&&g.sort((j,F)=>o(j.item,F.item));let w=-a;const S=t6(),C=Fv(t),E=new Map,T=d.useRef(new Map),k=d.useRef(!1);Mt(g,(j,F)=>{const R=j.key,P=j.phase,L=r?r():t;let U,O;const $=js(L.delay||0,R);if(P=="mount")U=L.enter,O="enter";else{const Y=v.indexOf(R)<0;if(P!="leave")if(Y)U=L.leave,O="leave";else if(U=L.update)O="update";else return;else if(!Y)U=L.enter,O="enter";else return}if(U=js(U,j.item,F),U=Ie.obj(U)?s6(U):{to:U},!U.config){const Y=m||C.config;U.config=js(Y,j.item,F,O)}w+=a;const G={...C,delay:$+w,ref:f,immediate:L.immediate,reset:!1,...U};if(O=="enter"&&Ie.und(G.from)){const Y=r?r():t,te=Ie.und(Y.initial)||x?Y.from:Y.initial;G.from=js(te,j.item,F)}const{onResolve:H}=G;G.onResolve=Y=>{js(H,Y);const te=y.current,se=te.find(ae=>ae.key===R);if(se&&!(Y.cancelled&&se.phase!="update")&&se.ctrl.idle){const ae=te.every(X=>X.ctrl.idle);if(se.phase=="leave"){const X=js(i,se.item);if(X!==!1){const ee=X===!0?0:X;if(se.expired=!0,!ae&&ee>0){ee<=2147483647&&(se.expirationId=setTimeout(S,ee));return}}}ae&&te.some(X=>X.expired)&&(T.current.delete(se),c&&(k.current=!0),S())}};const Q=kE(j.ctrl,G);O==="leave"&&c?T.current.set(j,{phase:O,springs:Q,payload:G}):E.set(j,{phase:O,springs:Q,payload:G})});const I=d.useContext(iZ),M=yE(I),N=I!==M&&KX(I);Ac(()=>{N&&Mt(g,j=>{j.ctrl.start({default:I})})},[I]),Mt(E,(j,F)=>{if(T.current.size){const R=g.findIndex(P=>P.key===F.key);g.splice(R,1)}}),Ac(()=>{Mt(T.current.size?T.current:E,({phase:j,payload:F},R)=>{const{ctrl:P}=R;R.phase=j,p?.add(P),N&&j=="enter"&&P.start({default:I}),F&&(YX(P,F.ref),(P.ref||p)&&!k.current?P.update(F):(P.start(F),k.current&&(k.current=!1)))})},s?void 0:n);const D=j=>d.createElement(d.Fragment,null,g.map((F,R)=>{const{springs:P}=E.get(F)||F.ctrl,L=j({...P},F.item,F,R),U=Ie.str(F.key)||Ie.num(F.key)?F.key:F.ctrl.id,O=d.version<"19.0.0",$=L?.props??{},G=O?L?.ref:$?.ref;return L&&L.type?d.createElement(L.type,{...$,key:U,ref:G}):L}));return p?[D,p]:D}var fIe=1;function mIe(e,{key:t,keys:n=t},r){if(n===null){const s=new Set;return e.map(o=>{const a=r&&r.find(i=>i.item===o&&i.phase!=="leave"&&!s.has(i));return a?(s.add(a),a.key):fIe++})}return Ie.und(n)?e:Ie.fun(n)?e.map(n):_s(n)}var cZ=class extends a6{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=gh(...t);const n=this._get(),r=xE(n);r6(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Ei(t,n)||(La(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&sI(this._active)&&mw(this)}_get(){const e=Ie.arr(this.source)?this.source.map(Ds):_s(Ds(this.source));return this.calc(...e)}_start(){this.idle&&!sI(this._active)&&(this.idle=!1,Mt(Pv(this),e=>{e.done=!1}),xa.skipAnimation?(jt.batchedUpdates(()=>this.advance()),mw(this)):Rv.start(this))}_attach(){let e=1;Mt(_s(this.source),t=>{_o(t)&&qf(t,this),wE(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Mt(_s(this.source),e=>{_o(e)&&vh(e,this)}),this._active.clear(),mw(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=_s(this.source).reduce((t,n)=>Math.max(t,(wE(n)?n.priority:0)+1),0))}};function pIe(e){return e.idle!==!1}function sI(e){return!e.size||Array.from(e).every(pIe)}function mw(e){e.idle||(e.idle=!0,Mt(Pv(e),t=>{t.done=!0}),xh(e,{type:"idle",parent:e}))}var hIe=(e,...t)=>new cZ(e,t);xa.assign({createStringInterpolator:UX,to:(e,t)=>new cZ(e,t)});var uZ=/^--/;function gIe(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!uZ.test(e)&&!(Rp.hasOwnProperty(e)&&Rp[e])?t+"px":(""+t).trim()}var oI={};function yIe(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:s,children:o,scrollTop:a,scrollLeft:i,viewBox:c,...u}=t,f=Object.values(u),m=Object.keys(u).map(p=>n||e.hasAttribute(p)?p:oI[p]||(oI[p]=p.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));o!==void 0&&(e.textContent=o);for(const p in s)if(s.hasOwnProperty(p)){const h=gIe(p,s[p]);uZ.test(p)?e.style.setProperty(p,h):e.style[p]=h}m.forEach((p,h)=>{e.setAttribute(p,f[h])}),r!==void 0&&(e.className=r),a!==void 0&&(e.scrollTop=a),i!==void 0&&(e.scrollLeft=i),c!==void 0&&e.setAttribute("viewBox",c)}var Rp={animationIterationCount:!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,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},xIe=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),vIe=["Webkit","Ms","Moz","O"];Rp=Object.keys(Rp).reduce((e,t)=>(vIe.forEach(n=>e[xIe(n,t)]=e[t]),e),Rp);var bIe=/^(matrix|translate|scale|rotate|skew)/,_Ie=/^(translate)/,wIe=/^(rotate|skew)/,pw=(e,t)=>Ie.num(e)&&e!==0?e+t:e,hy=(e,t)=>Ie.arr(e)?e.every(n=>hy(n,t)):Ie.num(e)?e===t:parseFloat(e)===t,CIe=class extends Lv{constructor({x:e,y:t,z:n,...r}){const s=[],o=[];(e||t||n)&&(s.push([e||0,t||0,n||0]),o.push(a=>[`translate3d(${a.map(i=>pw(i,"px")).join(",")})`,hy(a,0)])),ni(r,(a,i)=>{if(i==="transform")s.push([a||""]),o.push(c=>[c,c===""]);else if(bIe.test(i)){if(delete r[i],Ie.und(a))return;const c=_Ie.test(i)?"px":wIe.test(i)?"deg":"";s.push(_s(a)),o.push(i==="rotate3d"?([u,f,m,p])=>[`rotate3d(${u},${f},${m},${pw(p,c)})`,hy(p,0)]:u=>[`${i}(${u.map(f=>pw(f,c)).join(",")})`,hy(u,i.startsWith("scale")?1:0)])}}),s.length&&(r.transform=new SIe(s,o)),super(r)}},SIe=class extends LX{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Mt(this.inputs,(n,r)=>{const s=Ds(n[0]),[o,a]=this.transforms[r](Ie.arr(s)?s:n.map(Ds));e+=" "+o,t=t&&a}),t?"none":e}observerAdded(e){e==1&&Mt(this.inputs,t=>Mt(t,n=>_o(n)&&qf(n,this)))}observerRemoved(e){e==0&&Mt(this.inputs,t=>Mt(t,n=>_o(n)&&vh(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),xh(this,e)}},EIe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];xa.assign({batchedUpdates:zh.unstable_batchedUpdates,createStringInterpolator:UX,colors:xje});var kIe=Yje(EIe,{applyAnimatedValues:yIe,createAnimatedStyle:e=>new CIe(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),fa=kIe.animated;const MIe={tension:700,friction:50};function TIe({value:e,children:t,...n}){const r=wa(n),{currentValue:s,animation:o="none"}=Av(),a=s===e,i=o!=="none",c=l.jsx(ije,{value:e,className:"focus:outline-none",forceMount:i||void 0,...r,children:t});return i?l.jsx(AIe,{isVisible:a,children:c}):c}function AIe({isVisible:e,children:t}){return i6(e,{initial:!1,from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{...MIe,clamp:!0}})((r,s)=>s?l.jsx(fa.div,{style:r,className:"col-start-1 row-start-1",children:t}):null)}const NIe=ci(z("reset interactable","font-sans font-medium select-none","transition-colors duration-300","relative","flex gap-1.5 items-center","text-sm text-foreground"),{variants:{isIconOnly:{false:z("data-[state=inactive]:opacity-80","data-[state=active]:opacity-100"),true:z("data-[state=inactive]:opacity-80","data-[state=active]:opacity-100")},disabled:{false:"cursor-pointer",true:"cursor-not-allowed opacity-70"},fullWidth:{false:"",true:"flex-1 justify-center"},size:{default:"py-3.5",compact:"py-2"}},compoundVariants:[{isIconOnly:!1,disabled:!1,class:"data-[state=inactive]:hover:opacity-100"},{isIconOnly:!0,class:"px-3"}],defaultVariants:{isIconOnly:!1,disabled:!1,fullWidth:!1,size:"default"}});function RIe(e){const{value:t,disabled:n=!1,...r}=e,s=wa(r),{fullWidth:o,size:a,registerTabRef:i,unregisterTabRef:c}=Av(),u=d.useRef(null),f="icon"in e,m=f?e.icon:e.leadingIcon,p=f?void 0:e.children,h=f?e["aria-label"]:void 0;d.useLayoutEffect(()=>(i(t,u),()=>c(t)),[t,i,c]);const g=l.jsxs(aje,{ref:u,value:t,disabled:n,"aria-label":f?h:void 0,className:z("group",NIe({isIconOnly:f,disabled:n,fullWidth:o,size:a})),...s,children:[m&&l.jsx(rn,{icon:m,size:"medium"}),p]});return f&&h?l.jsx(Fo,{content:h,side:"bottom",disabled:n,children:l.jsx("span",{className:z("inline-flex",o&&"flex-1"),children:g})}):g}function DIe(e){const{children:t,onValueChange:n,animation:r="none",...s}=e,o=wa(s),a="value"in e?{value:e.value}:{defaultValue:e.defaultValue},[i,c]=d.useState(a.defaultValue),u=d.useRef(new Map),f=d.useRef(()=>{}),m=d.useCallback((g,y)=>{u.current.set(g,y)},[]),p=d.useCallback(g=>{u.current.delete(g)},[]),h=d.useCallback(g=>{c(g),n?.(g),requestAnimationFrame(()=>{f.current()})},[n]);return d.useEffect(()=>{e.value!==void 0&&requestAnimationFrame(()=>{f.current()})},[e.value]),l.jsx(GA.Provider,{value:{currentValue:a.value??i,registerTabRef:m,unregisterTabRef:p,updateIndicatorRef:f,animation:r},children:l.jsx(sje,{...a,orientation:"horizontal",onValueChange:h,className:r==="none"?"contents":"grid w-full min-w-0 grid-cols-[minmax(0,1fr)]",...o,children:t})})}const Dp=Object.assign(DIe,{List:uje,Tab:RIe,Panel:TIe}),es={default:"d",shopping:"s",jobs:"j",hotels:"h",places:"p",images:"i",videos:"v",sources:"r",assets:"a",apps:"c",search:"se",chat:"ch"},jIe=e=>{if(e)return Object.entries(es).find(([t,n])=>n===e)?.[0]},IIe=()=>{const e=fn();return d.useCallback(()=>{const n=new URLSearchParams(e?.toString()).get("sm");return jIe(n)},[e])},dZ=()=>{const e=fn(),t=On(),n=Rn();return d.useCallback(r=>{const s=new URLSearchParams(e?.toString());s.set("sm",es[r]),n.replace(`${t}?${s.toString()}`)},[t,n,e])},PIe=({items:e,inFlight:t,inFlightLatest:n,rwToken:r,contentHasMounted:s,hasHeader:o=!0})=>{const{scrollContainerRef:a}=ka(),i=mi(),c=d.useMemo(()=>{if(typeof window>"u")return 0;let _;return o?_=getComputedStyle(document.documentElement).getPropertyValue("--header-height"):_="0",parseInt(_)},[o]),u=d.useRef(!0),f=d.useMemo(()=>!r&&e.every(_=>!qt.isStatusPending(_)),[e,r]),m=d.useMemo(()=>e.some(_=>qt.isStatusPending(_)),[e]),p=d.useRef({}),h=d.useRef({}),g=d.useRef(!1);d.useEffect(()=>()=>{p.current={},h.current={}},[]);const y=d.useCallback((_,{smooth:w=!0,anchor:S=!1}={smooth:!0,anchor:!1})=>{const C=typeof _=="number"?p.current?.[_]?.current:h.current?.[_]?.current;if(C&&a?.current){const E=a.current,T=Cf(()=>{g.current=!1,E.removeEventListener("scroll",T)},100,{leading:!1,trailing:!0});if(E.addEventListener("scroll",T),g.current=!0,S){const N=C.getBoundingClientRect().top,D=fE(E),j=N+D-c,F=yX(E),R=gX(E);if(j+R>F){const P=F-R-.1;requestAnimationFrame(()=>{Uj(E,P,w?"smooth":"auto")});return}}const k=C.getBoundingClientRect().top,I=fE(E),M=k+I-c;requestAnimationFrame(()=>{Uj(E,M,w?"smooth":"auto")})}},[a,c]),x=d.useCallback(()=>{y(e.length-1)},[y,e.length]);d.useEffect(()=>{const _={...p.current},w={};e.forEach((C,E)=>{const T=E,k=C.backend_uuid;if(k)if(!_[T]||!_[T].current){const I=A.createRef();_[T]=I,w[k]=I}else w[k]=_[T]});const S=e.length;Object.keys(_).forEach(C=>{Number(C)>=S&&delete _[Number(C)]}),h.current=w,p.current=_},[e.length,m]);const v=e.at(-1)?.query_source==="edit";d.useEffect(()=>{if(e.length<=1||!i||!s)return;const _=window.location.hash;if(_&&!t&&u.current){try{const w=_.slice(1);w.length>3?y(w,{smooth:!1}):y(Number(w),{smooth:!1})}catch(w){Z.error(w)}return}n&&!v&&requestAnimationFrame(()=>{y(e.length-1,{anchor:!0})})},[t,n,f,e.length,i,y,s,v]);const b=p.current;return d.useMemo(()=>({refs:b,isScrollingRef:g,scrollToLatestItem:x,scrollToListItem:y}),[b,x,y])},fZ=Ft("ScrollToEntityContext",{refs:{},isScrollingRef:{current:!1},scrollToListItem:()=>{},setContentHasMounted:()=>{},scrollToLatestItem:()=>{},contentHasMounted:!1}),mZ=A.memo(({children:e})=>{const t=el(),{results:n=[],inFlight:r,inFlightLatest:s}=on(),[o,a]=d.useState(!1),i=d.useMemo(()=>P4(n).map(h=>h.length?h[0]:void 0).filter(h=>h!==void 0),[n]),{refs:c,isScrollingRef:u,scrollToListItem:f,scrollToLatestItem:m}=PIe({items:i,inFlight:r,inFlightLatest:s,rwToken:t,contentHasMounted:o,hasHeader:!1});return l.jsx(fZ.Provider,{value:{scrollToListItem:f,scrollToLatestItem:m,refs:c,isScrollingRef:u,setContentHasMounted:a,contentHasMounted:o},children:e})});mZ.displayName="ScrollToThreadEntryProvider";const l6=()=>{const e=d.useContext(fZ);if(!e)throw new Error("useScrollToEntity must be used within ScrollToEntityContext");return e},c6=Ft("SearchPageContext",{activeMode:"default",setActiveMode:()=>{},activeEntryIdx:0,pinnedEntryIdx:-1,viewTitle:null,setViewTitle:()=>{},activeThreadTab:"default",setActiveThreadTab:()=>{},handleTabScrollBehavior:()=>{}}),kg=()=>{const e=d.useContext(c6);if(!e)throw new Error("useSearchPage must be used within an SearchPageProvider");return e},pZ=A.memo(({children:e})=>{const t=IIe(),n=dZ(),r=t()??"default",[s,o]=d.useState(r),a=d.useRef(void 0),[i,c]=d.useState(r),u=d.useCallback(C=>{o(C),c(C)},[]),[f,m]=d.useState(0),[p,h]=d.useState(-1),[g,y]=d.useState(null),{refs:x}=l6(),v=Rn(),{scrollContainerRef:b}=ka(),_=d.useCallback(C=>{if(b.current){if(s==="default"){const E=b.current.scrollTop;a.current=E}if(C==="default"){const E=a.current;E!==void 0&&requestAnimationFrame(()=>{b.current&&(b.current.scrollTop=E)})}else b.current.scrollTop=0}},[b,s]),w=d.useCallback(()=>{if(Object.keys(x).length===0||!b.current)return;const C=b.current.clientHeight,E=b.current.scrollTop;if(E===0){m(0),h(-1);return}const T=E+C/2;let k=f,I=-1,M=1/0;Object.entries(x).forEach(([N,D])=>{if(D.current){const j=D.current.getBoundingClientRect(),F=j.top+E+j.height/2,R=Math.abs(F-T);j.top<-100&&j.bottom>100&&(I=parseInt(N)),R{if(!b?.current)return;const C=b.current,E=px(w,50,{leading:!1,trailing:!0});return C.addEventListener("scroll",E),w(),()=>{C.removeEventListener("scroll",E),E.cancel()}},[w,b]),d.useEffect(()=>{y(null)},[v]);const S=d.useCallback(C=>{_(C),u(C),n(C)},[_,u,n]);return l.jsx(c6.Provider,{value:{activeMode:i,setActiveMode:c,activeEntryIdx:f,pinnedEntryIdx:p,viewTitle:g,setViewTitle:y,activeThreadTab:s,setActiveThreadTab:u,handleTabScrollBehavior:_},children:l.jsx(Dp,{value:s,onValueChange:S,children:e})})});pZ.displayName="SearchPageProvider";function OIe({entropyBrowser:e,isSidecar:t,scrollContainerRef:n}){const r=On(),s=d.useCallback(o=>{n.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:o})},[n]);d.useEffect(()=>{if(!(!e||!t))return e.subscribeQuickActionButtonFired(()=>{s("smooth")})},[e,t,s]),d.useEffect(()=>{setTimeout(s,0,"instant")},[r,t,s])}const LIe=({reason:e})=>{const{DEFAULT_SOURCES:t}=og({reason:e}),{setSources:n,setIsCopilot:r,gpt4Limit:s}=Vn(),o=mi(),{session:a}=Ne(),{trackEvent:i}=Xe(a),{lossAversionStatus:c,setLossAversionStatus:u,unsetLossAversion:f}=pz(),m=Wt(),{results:p,lastResult:h,firstResult:g}=on(),y=g?.author_id,x=g?.author_username,v=g?.context_uuid,b=g?.query_source,_=g?.sources?.sources,w=el(),S=fn(),C=d.useRef(!1),{pinnedEntryIdx:E,setViewTitle:T}=kg(),{formatMessage:k}=J(),{openVisitorLoginUpsell:I}=du({enabled:!m}),{scrollContainerRef:M}=ka(),N=un();return tje(),ZDe(),XDe(),OIe({scrollContainerRef:M,isSidecar:!0,entropyBrowser:N}),d.useEffect(()=>{const D=qt.isSourceListType(_)?_:[...t];n(D);const j=p.some(F=>qt.isCopilotMode(F))&&s.available;r(j)},[]),d.useEffect(()=>{if(!C.current&&o&&p.length>=1&&h&&qt.isStatusCompleted(h)&&y&&x){const D=S?.get("utm_source")??void 0;i("thread viewed",{authorId:y,authorUsername:x,isThreadCreator:!!w,contextUUID:v,viewSource:D}),v&&E_e({contextUUID:v,reason:e}),b==="perplexity_tasks"&&i("task thread viewed",{contextUUID:v}),C.current=!0}},[i,o,y,x,v,h,p.length,S,w,m,I,k,e,b]),d.useEffect(()=>{c!=="cooldown"&&(!m&&!c&&w?u("allowed"):w||f())},[m,c,w,u,f]),d.useEffect(()=>{T(E===-1?null:m7e(p[E]?.query_str)??"")},[E,T,p]),d.useEffect(()=>()=>{c==="allowed"&&f()},[]),null},FIe=e=>e?e.filter(t=>t.image_mode_block).flatMap(t=>t.image_mode_block.media_items??Pe):Pe,BIe=e=>e?e.filter(t=>t.video_mode_block).flatMap(t=>t.video_mode_block.media_items??Pe):Pe,UIe=e=>e?e.filter(t=>t.shopping_mode_block).flatMap(t=>t.shopping_mode_block.shopping_widgets??Pe):Pe,VIe=e=>e?e.filter(t=>t.jobs_mode_block).flatMap(t=>t.jobs_mode_block.jobs_blocks??Pe):Pe,HIe=e=>e?e.filter(t=>t.maps_mode_block).flatMap(t=>t.maps_mode_block.places??Pe):Pe,zIe=e=>{const t=(e??Pe).filter(a=>a.sources_mode_block).flatMap(a=>a.sources_mode_block),n=t.at(-1),r=new Set,s=[];for(const a of t)for(const i of a.web_results)r.has(i.url)||(s.push(i),r.add(i.url));const o=n?.result_count??0;return{count:Math.max(s.length,o),progress:n?.progress,results:s,rows:n?.rows}},u6=(e,{orderedByPriority:t=!1}={})=>{if(!e)return Pe;const n=e.filter(r=>r.plan_block?.steps).flatMap(r=>r.plan_block.steps).flatMap(r=>r.assets??Pe);return t?[...n].sort((r,s)=>r.is_primary_asset===s.is_primary_asset?0:r.is_primary_asset?-1:1):n},WIe=(e,t)=>{if(e){for(const n of e)if(n.plan_block?.steps){for(const r of n.plan_block.steps)if(r.assets){const s=r.assets.find(o=>o.uuid===t);if(s)return s}}}},hZ={[hs.ANSWER_MODE_TYPE_UNSPECIFIED]:{i18nKey:W({defaultMessage:"Unknown",id:"5jeq8PJZg7"}),id:es.default,mode:"default",show:!0},[hs.ANSWER]:{i18nKey:W({defaultMessage:"Answer",id:"DwjT1HpUgU"}),id:es.default,mode:"default",show:!0},[hs.SHOPPING]:{i18nKey:W({defaultMessage:"Shopping",id:"my1MLnIMoS"}),icon:B("shopping-cart"),id:es.shopping,mode:"shopping",show:!0},[hs.JOBS]:{i18nKey:W({defaultMessage:"Jobs",id:"9AcATFXaoo"}),icon:B("briefcase"),id:es.jobs,mode:"jobs",show:!0},[hs.HOTELS]:{i18nKey:W({defaultMessage:"Hotels",id:"+dqK4hw0if"}),icon:B("building"),id:es.hotels,mode:"hotels",show:!0},[hs.MAPS]:{i18nKey:W({defaultMessage:"Places",id:"QQInFSbbwr"}),icon:B("map-pin"),id:es.places,mode:"places",show:!0},[hs.IMAGE]:{i18nKey:W({defaultMessage:"Images",id:"Fip4H8CuWD"}),icon:B("photo"),id:es.images,mode:"images",show:!0},[hs.VIDEO]:{i18nKey:W({defaultMessage:"Videos",id:"4XfMuxy3FO"}),icon:B("movie"),id:es.videos,mode:"videos",show:!0},[hs.SOURCES]:{i18nKey:W({defaultMessage:"Links",id:"qCcwo3DU78"}),icon:B("world"),id:es.sources,mode:"sources",show:!0},[hs.ASSETS]:{i18nKey:W({defaultMessage:"Assets",id:"d1uESJO+TH"}),icon:B("stack-2"),id:es.assets,mode:"assets",show:!0},[hs.APPS]:{i18nKey:W({defaultMessage:"App",id:"2rUVsUf259"}),icon:B("layout-collage"),id:es.apps,mode:"apps",show:!1},[hs.SEARCH]:{i18nKey:W({defaultMessage:"Search",id:"xmcVZ0BU63"}),icon:B("search"),id:es.search,mode:"search",show:!1},[hs.CHAT]:{i18nKey:W({defaultMessage:"Chat",id:"WTrOy36sdu"}),icon:B("message"),id:es.chat,mode:"chat",show:!1}};(()=>{const e={};return Object.values(hZ).forEach(t=>{e[t.mode]=t}),e})();function GIe(e,t){return{...e.icon&&{icon:e.icon},id:e.id,mode:e.mode,text:t(e.i18nKey),show:e.show??!0}}function $Ie(e){const t=e.sourcesCount||e.attachmentsLength||0,n=e.sourcesProgress!==Jo.DONE&&!e.attachmentsLength;return{count:t,disabled:n}}const qIe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"always-show-brand-in-thread-tabs",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},KIe={ANSWER:"default",IMAGE:"images",VIDEO:"videos",SHOPPING:"shopping",MAPS:"places",SOURCES:"sources",JOBS:"jobs",HOTELS:"hotels",ASSETS:"assets",SEARCH:"search",CHAT:"chat",APPS:"apps"};function gZ(e){return KIe[e]??null}const aI=e=>Object.entries(es).find(([t,n])=>n===e)?.[0],YIe=(e,t)=>{const r=new URLSearchParams(t?.toString()).get(e.toString());if(r)return typeof r=="string"?aI(r):Array.isArray(r)?aI(r[0]):void 0},QIe=e=>e==="default",XIe=e=>Vi(e).with("default",()=>"default").with("shopping",()=>"default").with("jobs",()=>"full").with("hotels",()=>"full").with("places",()=>"full").with("images",()=>"full").with("videos",()=>"full").with("sources",()=>"default").with("assets",()=>"full").with("apps",()=>"full").with("search",()=>"default").otherwise(()=>"default"),hw=e=>({mode:e,width:XIe(e)}),ZIe=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],s=r?.[0];if(!s)continue;if(s.blocks?.find(i=>i.answer_tabs_block)?.answer_tabs_block?.modes?.some(i=>i.answer_mode_type?gZ(i.answer_mode_type)===t:!1))return[r]}return null},Bv=()=>{const{session:e}=Ne(),t=Ca(),{firstResult:n}=on(),r=n?.backend_uuid,s=n?.context_uuid,{device:{isWindowsApp:o}}=sn(),a=d.useCallback((i,c)=>{const u=Zm(o);Li({name:i,data:{entryUUID:r,threadUUID:s,...c,isPerplexityBrowser:t},source:u,user:{id:e?.user?.id,subscription_status:e?.user?.subscription_status}})},[r,s,t,o,e?.user?.id,e?.user?.subscription_status]);return d.useMemo(()=>({trackEvent:a}),[a])},JIe={pendingClarifications:[],addClarification:()=>{},clearClarifications:()=>{},pendingSuggestions:[],addPendingSuggestion:()=>{},removePendingSuggestion:()=>{},clearPendingSuggestions:()=>{}},yZ=Ft("DeepResearchContext",JIe),ePe=({children:e})=>{const[t,n]=d.useState([]),[r,s]=d.useState([]),o=d.useCallback(m=>{n(p=>p.concat([m]))},[]),a=d.useCallback(()=>{n([])},[]),i=d.useCallback(m=>{s(p=>p.concat([m]))},[]),c=d.useCallback(m=>{s(p=>p.filter(h=>h.UUID!==m))},[]),u=d.useCallback(()=>{s([])},[]),f={pendingClarifications:t,clearClarifications:a,addClarification:o,pendingSuggestions:r,addPendingSuggestion:i,removePendingSuggestion:c,clearPendingSuggestions:u};return l.jsx(yZ.Provider,{value:f,children:e})},Uv=()=>{const e=d.useContext(yZ);if(!e)throw new Error("useDeepResearchState must be used within DeepResearchContext");return e};var Na={},iI;function tPe(){if(iI)return Na;iI=1;var e=Na&&Na.__values||function(s){var o=typeof Symbol=="function"&&s[Symbol.iterator],a=0;return o?o.call(s):{next:function(){return s&&a>=s.length&&(s=void 0),{value:s&&s[a++],done:!s}}}},t=Na&&Na.__read||function(s,o){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var i=a.call(s),c,u=[],f;try{for(;(o===void 0||o-- >0)&&!(c=i.next()).done;)u.push(c.value)}catch(m){f={error:m}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(f)throw f.error}}return u};Object.defineProperty(Na,"__esModule",{value:!0}),Na.selectState=function(s){return s};function n(){var s,o,a;function i(c){var u=0,f;function m(h){var g,y;s||(s={state:h,version:1}),s.state!==h&&(s.state=h,s.version+=1);var x=s.version,v;if(f){if(x===f.stateVersion)return f.value;var b=!1;try{for(var _=e(f.dependencies.entries()),w=_.next();!w.done;w=_.next()){var S=t(w.value,2),C=S[0],E=S[1];if(C(h)!==E){b=!0,v=C;break}}}catch(M){g={error:M}}finally{try{w&&!w.done&&(y=_.return)&&y.call(_)}finally{if(g)throw g.error}}if(!b)return f.value}u+=1;var T=new Map,k=Object.assign(function(M){if(T.has(M))return T.get(M);var N=M(h);return T.set(M,N),N},{reason:v}),I=a?a(function(){return c(k)},p,h,v):c(k);if(T.size===0)throw new Error("[rereselect] Selector malfunction: The selection logic must select some data by calling `query(selector)` at least once.");return f={stateVersion:x,dependencies:T,value:I},I}var p=Object.assign(function(g){return o?o(function(){return m(g)},p,g):m(g)},{selectionLogic:c,recomputations:function(){return u},resetRecomputations:function(){return u=0},introspect:function(){return f}});return p}return{makeSelector:i,setInvocationWrapper:function(c){o=c},setComputationWrapper:function(c){a=c}}}Na.createSelectionContext=n;var r=n();return Na.makeSelector=r.makeSelector,Na}var et=tPe();const xZ=Pe,nPe=(e,t)=>{if(!e)return;const n=e.filter(r=>r.plan_block&&r.intended_usage=="plan").map(r=>r.plan_block);if(n&&n.length>0){const r=[];let s=!1;for(const o of n){for(const a of o?.goals??[])if(a.description!==null)if(r.length==0||r[r.length-1]?.final)r.push({...a});else{const i=r[r.length-1];i&&(i.description+=a.description,i.final=a.final)}o?.final&&(s=!0)}if(r.length>0)return{goals:r,final:s,channel_uuid:"",comprehensive_mode:!1}}return t},rPe=e=>e.blocks??Pe,sPe=e=>{const t=e.filter(s=>s.plan_block&&s.intended_usage=="pro_search_steps").map(s=>s.plan_block),n={};for(let s=0;sn[s.steps[0]?.uuid??""]===o).map(s=>s.steps.map(o=>({step_type:o.step_type,uuid:o.uuid??"",content:o?.initial_query_content??o?.attachment_content??o?.terminate_content??o?.search_web_content??o?.web_results_content??o?.code_content??o?.table_status_content??o?.entropy_request_content??o?.thought_content??o?.browser_search_content??o?.browser_open_tab_content??o?.browser_open_tab_results_content??o?.url_navigate_content??o?.browser_get_site_content_content??o?.user_clarification_content??o?.browser_get_history_summary_content??o?.browser_get_open_tab_content_content??o?.read_calendar_content??o?.read_calendar_response_content??o?.read_email_content??o?.read_email_response_content??o?.update_calendar_content??o?.generate_image_content??o?.generate_image_results_content??o?.generate_video_content??o?.generate_video_results_content??o?.search_tabs_content??o?.search_tabs_results_content??o?.create_app_results_content??o?.browser_close_tabs_content??o?.browser_close_tabs_results_content??o?.update_calendar_response_content??o?.browser_group_tabs_content??o?.browser_group_tabs_results_content??o?.create_chart_content??o?.get_url_content_content??o?.create_client_app_content??o?.get_user_info_content??o?.get_user_info_response_content??o?.get_free_busy_content??o?.get_free_busy_response_content??o?.send_email_content??o?.send_email_response_content??o?.browser_ungroup_content??o?.browser_search_tab_groups_content??o?.browser_search_tab_groups_result_content??o?.search_browser_content??o?.search_browser_results_content??o?.clarifying_questions_content??o?.clarifying_questions_output_content??o?.email_calendar_agent_content??o?.email_calendar_agent_response_content??o?.mcp_tool_input_content??o?.mcp_tool_output_content??o?.research_clarifying_questions_content??o?.create_tasks_content??o?.create_tasks_response_content??o?.flights_search_content??o?.flights_booking_content??o?.flights_search_response_content??o?.flights_booking_response_content??o?.flights_agent_content??o?.canvas_agent_content??o?.comet_agent_tool_input_content??o?.comet_agent_tool_output_content??{},assets:o.assets}))).flat()},oPe=e=>e?.filter(t=>t.reasoning_plan_block&&t.intended_usage==="reasoning_plan").map(t=>t.reasoning_plan_block),aPe=e=>{let t=!1;if(e&&e.length>0){const n=new Map;for(const o of e){if(o.goals){for(const a of o.goals)if(a.id)if(n.has(a.id)){const i=n.get(a.id);i.description+=a.description,n.set(a.id,i)}else n.set(a.id,{...a})}t=o.progress==="DONE"}const r=Array.from(n.values()),s=e.flatMap(o=>o.web_results??Pe);return{goals:r,web_results:s,final:t}}};function iPe(e){const t={},n=[];return e?.forEach(r=>{if(r.widget_block){const s=t[r.intended_usage]??n.length;t[r.intended_usage]=s,n[s]=C2e(n[s],r.widget_block)}}),n}function lPe(e){return(e?.filter(t=>t.media_block).flatMap(t=>t.media_block.media_items)??[]).filter(t=>!t.sponsored_uuid)}function cPe(e){return e?.filter(t=>t.media_block).flatMap(t=>t.media_block.generated_media_items)??[]}function uPe(e=Pe){return e.reduce((t,n)=>{if(n.is_code_interpreter&&n.is_image)t.codeInterpreterImages.push(n);else{const r=n.meta_data?.source==="quartr"?{...n,snippet:""}:n;t.webResultsStandard.push(r)}return t},{webResultsStandard:[],codeInterpreterImages:[]})}function dPe(e){return e?.flatMap(t=>t.inline_entity_block?.knowledge_card_block?t.inline_entity_block.knowledge_card_block.knowledge_cards:t.knowledge_card_block?t.knowledge_card_block.knowledge_cards:[])??[]}function fPe(e){return e??Pe}function mPe(e){return e?.filter(t=>t.citation_block).flatMap(t=>t.citation_block.citations)??Pe}function pPe(e){const t=e?.find(r=>r?.widget_block?.finance_widget_block&&r.intended_usage==="finance_widget")?.widget_block?.finance_widget_block;return t===void 0?void 0:{object:"FinanceWidget",data:t.data_json.map(r=>JSON.parse(r)),data_v2:t?.data_json_v2?.map(r=>JSON.parse(r))}}function hPe(e){const t=e?.map(s=>s.widget_block)?.find(s=>s?.widget_type==="sports");if(!t?.sports_widget_block?.data)return;const r=t.sports_widget_block.data;switch(r.object){case"SportsEventsWidget":return r;case"SportsIndvScheduleWidget":return r;case"SportsStandingsWidget":return r;case"SportsIndvEventsWidget":return r;default:return}}function gPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.price_comparison_widget_block);if(!(!t||!t.widget_block?.price_comparison_widget_block))return{object:"PriceComparisonWidget",...t.widget_block.price_comparison_widget_block}}function yPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="WeatherWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function xPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="TimeWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function vPe(e){if(!e)return;const t=e?.find(r=>r.widget_block?.search_result_widget_block?.metadata?.object==="TimerWidget");return!t||!t.widget_block?.search_result_widget_block?void 0:t.widget_block.search_result_widget_block.metadata}function bPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="CalculatorWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function _Pe(e,t){return e&&e.length>0?e.map(n=>({name:n.widget_type||"",url:"",snippet:"",timestamp:"",meta_data:{object:n.widget_type||"unknown",...n},is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""})):t||[]}function wPe(e){const t=e.find(r=>r?.meta_data?.object==="TableWidget");return t?t.meta_data.search_results:Pe}function CPe(e){return e.filter(t=>xZ.includes(t?.meta_data?.object))}function SPe(e){return e.filter(t=>!xZ.includes(t?.meta_data?.object))}function EPe(e){const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="TaskWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function kPe(e){if(!e)return;const t=e?.map(n=>n.widget_block)?.find(n=>n?.widget_type==="flight_status");if(t?.flight_status_widget_block?.data)return t.flight_status_widget_block}function MPe(e){if(!e)return;const t=e?.map(n=>n.widget_block)?.find(n=>n?.widget_type==="news");if(t?.news_widget_block?.web_results)return{object:"NewsWidget",web_results:t.news_widget_block.web_results}}function TPe(e){if(!e)return;const t=e?.find(r=>r.widget_block?.search_result_widget_block?.metadata?.object==="CurrencyExchangeWidget");return!t||!t.widget_block?.search_result_widget_block?void 0:t.widget_block.search_result_widget_block.metadata}function APe(e){const t=e?.find(s=>s.widget_block?.prediction_market_widget_block&&s.intended_usage==="prediction_market_widget");if(!t||!t.widget_block?.prediction_market_widget_block)return;const n=t.widget_block.prediction_market_widget_block;return n===void 0||!n?.data_json?void 0:{object:"PredictionMarketWidget",data:JSON.parse(n.data_json)}}function NPe(e){if(!e)return;const t=e?.find(n=>n.widget_block?.search_result_widget_block?.metadata?.object==="GenericFallbackWidget");if(!(!t||!t.widget_block?.search_result_widget_block))return t.widget_block.search_result_widget_block.metadata}function RPe(e){if(!e?.length)return[];const t=[];return e.forEach(n=>{n.intended_usage==="pro_search_steps"&&n.plan_block?.steps&&n.plan_block.steps.forEach(r=>{r.clarifying_questions_output_content?.clarification&&t.push(r.clarifying_questions_output_content.clarification)})}),t}function DPe(e){return e?e.find(n=>n.intended_usage==="refinement_filters")?.refinement_filters_block:void 0}function jPe(e){return e?e.find(n=>n.inline_entity_block?.maps_preview_block&&n.intended_usage==="answer_maps_preview")?.inline_entity_block?.maps_preview_block:void 0}function IPe(e){return e.blocks?.some(t=>t.intended_usage==="ask_text")??!1}function PPe(e,t,n=[]){return t===ie.DEFAULT||n.length>0&&n[n.length-1]?.step_type==="FINAL"||e?.some(s=>s.markdown_block||s.entity_list_block||KH(s.entity_group_block)||YH(s.inline_entity_block))}const Vv=e=>{let t;if("meta_data"in e?t=e.meta_data:t=Vi(e).with({place_widget_block:ed.nonNullable},n=>({...n.place_widget_block,object:"PlaceWidget"})).with({shopping_widget_block:ed.nonNullable},n=>({...n.shopping_widget_block,progress:Jo.DONE,object:"ShopifyWidget"})).with({price_comparison_widget_block:ed.nonNullable},n=>({...n.price_comparison_widget_block,object:"PriceComparisonWidget"})).with({search_result_widget_block:ed.nonNullable},n=>{const r=n.search_result_widget_block.metadata||{},s=r.object;if(s==="WeatherWidget")return{...r,progress:Jo.DONE,object:"WeatherWidget"};if(s==="TimeWidget")return{...r,progress:Jo.DONE,object:"TimeWidget"};if(s==="CalculatorWidget")return{...r,progress:Jo.DONE,object:"CalculatorWidget"};if(s==="TaskWidget")return{...r,progress:Jo.DONE,object:"TaskWidget"};if(s==="TimerWidget")return{...r,progress:Jo.DONE,object:"TimerWidget"};if(s==="CurrencyExchangeWidget")return{...r,progress:Jo.DONE,object:"CurrencyExchangeWidget"};if(s==="GenericFallbackWidget")return{...r,progress:Jo.DONE,object:"GenericFallbackWidget"};if(s==="PredictionMarketWidget")return{...r,progress:Jo.DONE,object:"PredictionMarketWidget"}}).otherwise(()=>{}),!!t)return t},OPe=(e,t)=>e.concat(t).reduce((r,s)=>{const o=Vv(s);if(!o)return r;const a=o.object;return(a==="ShopifyWidget"||a==="PlaceWidget")&&(r[a]||(r[a]=[]),r[a].push(s)),r},{}),_r=e=>e.result,Dn=et.makeSelector(e=>rPe(e(_r))),LPe=et.makeSelector(e=>{const t=e(Dn),n={};return t.forEach(r=>{r.intended_usage&&(n[r.intended_usage]=r)}),n}),FPe=et.makeSelector(e=>e(_r).mode),vZ=et.makeSelector(e=>e(_r).display_model),BPe=et.makeSelector(e=>!!e(_r).is_pro_reasoning_mode),UPe=et.makeSelector(e=>e(_r).search_implementation_mode),d6=et.makeSelector(e=>qt.isStatusFailed(e(_r))),bZ=et.makeSelector(e=>qt.isStatusPending(e(_r))),VPe=et.makeSelector(e=>qt.isStatusBlocked(e(_r))),HPe=et.makeSelector(e=>e(_r).plan),_Z=et.makeSelector(e=>e(_r).widget_data??Pe),Hv=et.makeSelector(e=>qt.parseAskTextField(e(_r))??void 0),wZ=et.makeSelector(e=>qt.isStatusPending(e(_r))),zPe=et.makeSelector(e=>IPe(e(_r))),CZ=et.makeSelector(e=>e(_r).expect_search_results),f6=et.makeSelector(e=>{const t=e(Hv),n=qt.isStatusCompleted(e(_r));return t?qt.hasAnswer(t,n):!1}),SZ=et.makeSelector(e=>e(AZ).length>0),Sh=et.makeSelector(e=>sPe(e(Dn))),EZ=et.makeSelector(e=>nPe(e(Dn),e(HPe))),WPe=et.makeSelector(e=>oPe(e(Dn))),kZ=et.makeSelector(e=>aPe(e(WPe))),MZ=et.makeSelector(e=>an(e(vZ))),GPe=et.makeSelector(e=>{const t=e(MZ),n=e(_r),r=qt.parseStructuredAnswerBlocks(n);return r!==null&&r.some(s=>s.intended_usage==="answer_generated_image"||s.intended_usage==="answer_generated_video")&&!r.some(s=>!!s.markdown_block?.answer||!!s.markdown_block?.chunks)&&t===oe.SEARCH}),TZ=et.makeSelector(e=>iPe(e(Dn))),AZ=et.makeSelector(e=>uPe(e(Hv)?.web_results).webResultsStandard),NZ=et.makeSelector(e=>yPe(e(Dn))),RZ=et.makeSelector(e=>xPe(e(Dn))),DZ=et.makeSelector(e=>vPe(e(Dn))),jZ=et.makeSelector(e=>TPe(e(Dn))),IZ=et.makeSelector(e=>APe(e(Dn))),PZ=et.makeSelector(e=>NPe(e(Dn))),OZ=et.makeSelector(e=>bPe(e(Dn))),LZ=et.makeSelector(e=>kPe(e(Dn))),m6=et.makeSelector(e=>MPe(e(Dn))),zv=et.makeSelector(e=>_Pe(e(TZ),e(_Z))),$Pe=et.makeSelector(e=>PPe(e(Dn),e(vZ),e(Sh))),qPe=et.makeSelector(e=>e(Hv)?.answer==="Answer skipped."||e(Dn).some(t=>t.markdown_block?.answer==="Answer skipped.")),KPe=et.makeSelector(e=>e(FPe)===xd.COPILOT||e(Sh)!=null&&e(Sh).length>0),YPe=et.makeSelector(e=>e(d6)?Pe:lPe(e(Dn))),QPe=et.makeSelector(e=>e(d6)?Pe:cPe(e(Dn))),XPe=et.makeSelector(e=>e(_r).attachment_processing_progress??Pe),ZPe=et.makeSelector(e=>!!e(XPe).length),FZ=et.makeSelector(e=>e(_r).search_focus==="writing"),BZ=et.makeSelector(e=>{const t=e(wZ),n=e(CZ),r=e(FZ);return!!t&&n!=="false"&&!r}),JPe=et.makeSelector(e=>{const t=e(SZ),n=e(BZ);return t||n}),eOe=et.makeSelector(e=>!e(f6)),tOe=et.makeSelector(e=>{const t=e(bZ),n=e(f6);return t&&!n}),nOe=et.makeSelector(e=>{const t=e(EZ),n=e(kZ),r=t?.goals&&t.goals.length>0||n?.goals&&n.goals.length>0,o=e(Sh).some(a=>a.step_type==="SEARCH_RESULTS");return r||o}),rOe=et.makeSelector(e=>dPe(e(Dn))),sOe=et.makeSelector(e=>fPe(e(_r).related_query_items)),oOe=et.makeSelector(e=>mPe(e(Dn))),UZ=et.makeSelector(e=>pPe(e(Dn))),VZ=et.makeSelector(e=>hPe(e(Dn))),HZ=et.makeSelector(e=>gPe(e(Dn))),zZ=et.makeSelector(e=>wPe(e(zv))),aOe=et.makeSelector(e=>CPe(e(zv))),iOe=et.makeSelector(e=>SPe(e(zv))),lOe=et.makeSelector(e=>OPe(e(zv),e(TZ))),cOe=et.makeSelector(e=>[...e(AZ),...e(zZ)]),uOe=et.makeSelector(e=>EPe(e(Dn))),WZ=et.makeSelector(e=>!!e(m6)?.web_results?.length),GZ=et.makeSelector(e=>{const t=e(VZ),n=e(UZ),r=e(NZ),s=e(RZ),o=e(OZ),a=e(LZ),i=e(DZ),c=e(jZ),u=e(IZ),f=e(HZ),m=e(PZ),p=e(m6);return!!(t||n||r||s||o||a||i||c||u||f||m||p)}),dOe=et.makeSelector(e=>{const t=e(GZ),n=e(WZ);return!t||n}),fOe=et.makeSelector(e=>RPe(e(Dn))),mOe=et.makeSelector(e=>DPe(e(Dn))),pOe=et.makeSelector(e=>jPe(e(Dn))),$Z=et.makeSelector(e=>e(_r).classifier_results),hOe=et.makeSelector(e=>{const t=e($Z);return t!==void 0&&Object.keys(t).length>0}),gOe=et.makeSelector(e=>{const t=e($Z);return t?.skip_search||t?.mhe_predictions?.skip_search||!1}),qZ=e=>{const{idx:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:c=[]}=e,u=fOe(e),f=n.backend_uuid?c.filter(h=>h.entryUUID===n.backend_uuid).map(h=>h.content):[],m=Array.from(new Set([...u,...f])),p=mOe(e);return{idx:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,isPending:bZ(e),isBlocked:VPe(e),isFinalStep:$Pe(e),isFailed:d6(e),isProReasoningMode:BPe(e),widgetData:_Z(e),response:Hv(e),isEntryInFlight:wZ(e),hasLLMToken:zPe(e),isAnswerSkipped:qPe(e),expectWebResults:CZ(e),steps:Sh(e),researchPlan:EZ(e),reasoningPlan:kZ(e),searchMode:MZ(e),searchImplementationMode:UPe(e),hasMediaOnlyLayout:GPe(e),hasAnswer:f6(e),hasWebResults:SZ(e),weatherWidgetData:NZ(e),timeWidgetData:RZ(e),timerWidgetData:DZ(e),calculatorWidgetData:OZ(e),currencyExchangeWidgetData:jZ(e),predictionMarketWidgetData:IZ(e),flightStatusWidgetData:LZ(e),genericFallbackWidgetData:PZ(e),isCopilot:KPe(e),mediaItems:YPe(e),generatedMediaItems:QPe(e),hasPendingFiles:ZPe(e),isAgentWorkflowInFlight:eOe(e),knowledgeCards:rOe(e),relatedQueryItems:sOe(e),webResultCitations:oOe(e),financeWidgetData:UZ(e),newsWidgetData:m6(e),sportsWidgetData:VZ(e),priceComparisonWidgetData:HZ(e),tableWebResults:zZ(e),highPriorityWidgets:aOe(e),lowPriorityWidgets:iOe(e),groupedEntityWidgets:lOe(e),webResults:cOe(e),taskWidgetData:uOe(e),hasFastWidget:GZ(e),hasNewsWidget:WZ(e),shouldShowMediaPreview:dOe(e),userClarifications:m,refinementFiltersData:p,selectedFilterIds:p?.selected_filter_ids??[],focusIsWriting:FZ(e),expectSearchResults:BZ(e),hasSources:JPe(e),blocksByIntendedUsage:LPe(e),mapsPreviewData:pOe(e),hasClassifierResults:hOe(e),isChatQuery:gOe(e),hasAnyAgentSteps:nOe(e),isProcessingQuery:tOe(e)}},yOe=e=>Xi()((n,r)=>({isStatusUpdaterOpen:!1,wasStatusUpdaterManuallyOpened:!1,selectedRefinementQuery:null,skippedSources:new Set([]),...qZ(e),actions:{setSelectedRefinementQuery:s=>n({selectedRefinementQuery:s}),setSelectedFilterIds:s=>n({selectedFilterIds:s}),addSkippedSource:s=>{const o=r().skippedSources,a=new Set(o);a.add(s),n({skippedSources:a})},removeSkippedSource:s=>{const o=r().skippedSources,a=new Set(o);a.delete(s),n({skippedSources:a})}}})),{Context:xOe,useTrackedState:vOe}=s4("ThreadEntryContext"),p6=A.memo(({idx:e,children:t,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i})=>{const c=d.useRef(r),{trackEvent:u}=Bv(),{pendingClarifications:f}=Uv(),[m]=d.useState(()=>yOe({idx:e,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:f})),h=m(g=>g.isFinalStep);return d.useEffect(()=>{const g=()=>{const v=setTimeout(()=>{u("engaged",{})},1e4);return()=>{clearTimeout(v)}},y=o&&s,x=c.current&&!r;if(y&&x&&h)return g();c.current=r},[r,h,s,o,u]),d.useEffect(()=>{m.setState(qZ({idx:e,result:n,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,pendingClarifications:f}))},[e,n,r,s,o,a,i,f,m]),l.jsx(xOe.Provider,{value:m,children:t})});p6.displayName="ThreadEntryProvider";const It=vOe;function Mg(){const{result:{frontend_uuid:e,frontend_context_uuid:t}}=It(),n=c4(),r=n(e??"")??n(t);return d.useCallback((s,o)=>r?.addTiming(s,o),[r])}function h6(){const{result:{frontend_uuid:e,frontend_context_uuid:t}}=It(),n=c4(),r=n(e??"")??n(t);return d.useCallback((s,o)=>r?.addTimingOnce(s,o),[r])}const bOe=({idx:e,searchParams:t,blocks:n})=>Xi()((r,s)=>({answerModeActionList:[],currentModeData:hw(YIe(e,t)??"default"),...YZ(n),actions:{updateCurrentMode:o=>{const a=s(),i=a.defaultModeOverride&&o==="default"?a.defaultModeOverride:o;r({currentModeData:hw(i)})},setOverrideMode:o=>{const a=o;r({defaultModeOverride:a,currentModeData:hw(a??"default")})}}})),{Context:_Oe,useTrackedState:wOe}=s4("AnswerModeContext"),KZ=Ft("AnswerModeApiContext",void 0),COe=({children:e,scrollToListItem:t})=>{const{setActiveMode:n,activeEntryIdx:r,activeThreadTab:s}=kg(),{idx:o,result:{backend_uuid:a,context_uuid:i},isLastResult:c}=It(),{actions:{updateCurrentMode:u,setOverrideMode:f},currentModeData:m}=g6(),{session:p}=Ne(),{trackEvent:h}=Xe(p),g=d.useCallback(x=>{x!==m.mode&&(u(x),r===o&&n(x),requestAnimationFrame(()=>{t(o,{smooth:!0})}),h("answer mode tab selected",{answerMode:x,entryUUID:a,contextUUID:i}))},[m.mode,o,u,r,h,a,i,n,t]);d.useEffect(()=>{r===o&&n(m.mode)},[r,o,n,m.mode]),d.useEffect(()=>{c&&s&&s!==m.mode&&u(s)},[c,s,m.mode,u]);const y=d.useMemo(()=>({updateCurrentMode:v=>{g(v)},setOverrideMode:f}),[g,f]);return l.jsx(KZ.Provider,{value:y,children:e})};function YZ(e){const t=FIe(e),n=BIe(e),r=UIe(e),s=VIe(e),o=HIe(e),a=zIe(e),i=u6(e,{orderedByPriority:!0});return{images:t,videos:n,shopping:r,jobs:s,places:o,sources:a,assets:i}}const QZ=A.memo(({children:e,scrollToListItem:t})=>{const{$t:n}=J(),r=fn(),{idx:s,searchMode:o,result:{answer_modes:a,blocks:i,attachments:c}}=It(),u=Ca(),[f]=d.useState(()=>bOe({idx:s,searchParams:r,blocks:i}));d.useEffect(()=>{i||Z.error("No blocks found for entry",i)},[i]),d.useEffect(()=>{const v=f.getState(),{images:b,videos:_,shopping:w,jobs:S,places:C,sources:E,assets:T}=YZ(i),k=Cr(v.images,b)?v.images:b,I=Cr(v.videos,_)?v.videos:_,M=Cr(v.shopping,w)?v.shopping:w,N=Cr(v.jobs,S)?v.jobs:S,D=Cr(v.places,C)?v.places:C,j=Cr(v.sources,E)?v.sources:E,F=Cr(v.assets,T)?v.assets:T;(k!==v.images||I!==v.videos||M!==v.shopping||N!==v.jobs||D!==v.places||j!==v.sources||F!==v.assets)&&f.setState({images:k,videos:I,shopping:M,jobs:N,places:D,sources:j,assets:F})},[i,f]);const m=d.useMemo(()=>Object.fromEntries(Object.entries(hZ).map(([v,b])=>[v,GIe(b,n)])),[n]),p=f.getState().sources,h=d.useMemo(()=>{const{count:v,disabled:b}=$Ie({sourcesCount:p.count,sourcesProgress:p.progress,attachmentsLength:c?.length||0});return{...m,[hs.SOURCES]:{...m[hs.SOURCES],count:v,disabled:b}}},[m,p.count,p.progress,c?.length]),{variation:g}=qIe(!1),y=d.useMemo(()=>n(u?{defaultMessage:"Assistant",id:"wSAvhubuX6"}:g?{defaultMessage:"Perplexity",id:"KCWNcPqV2E"}:{defaultMessage:"Answer",id:"DwjT1HpUgU"}),[n,g,u]),x=d.useMemo(()=>u?gM:B("align-justified"),[u]);return d.useEffect(()=>{const v=a?.map(w=>{if(!gZ(w.answer_mode_type))return Z.warn("Unsupported Answer Mode",{mode:w.answer_mode_type.valueOf()}),null;const C=h[w.answer_mode_type];return C||(Z.warn("Missing mode action mapping",{mode:w.answer_mode_type.valueOf()}),null)}).filter(w=>!!w),b=[{text:y,icon:x,id:"d",mode:"default"},...(v??[]).filter(w=>w.show===void 0||w.show===!0)],_=f.getState();Cr(_.answerModeActionList,b)||f.setState({answerModeActionList:b})},[n,a,h,o,u,y,x,f]),l.jsx(_Oe.Provider,{value:f,children:l.jsx(COe,{scrollToListItem:t,children:e})})});QZ.displayName="AnswerModeProvider";const g6=wOe,SOe=()=>{const e=d.useContext(KZ);if(!e)throw new Error("useAnswerModeApi must be used within an AnswerModeProvider");return e},EOe=e=>{try{return JSON.parse(e)}catch{return null}},XZ=A.memo(({title:e,description:t,className:n="",role:r,retryFn:s,...o})=>{const{$t:a}=J(),i=a({defaultMessage:"Please try again later.",id:"EjH+J3uOTD"}),c=d.useMemo(()=>EOe(t??""),[t]);return c&&(console.warn("Tried to pass a JSON error description"),console.warn(c)),l.jsxs("div",{className:`gap-md bg-caution py-sm px-md mt-4 flex items-center rounded-lg text-left font-sans text-white ${n}`,role:"alert",...o,children:[l.jsx(ge,{icon:B("alert-circle")}),l.jsxs("div",{className:"flex grow flex-col",children:[l.jsx("p",{className:"font-medium",children:e||a({defaultMessage:"Sorry, something went wrong",id:"E2YPKR25ob"})}),l.jsx("p",{children:c?i:t})]}),s&&l.jsx(st,{noXPadding:!0,text:a({defaultMessage:"Try again",id:"FazwRldA7z"}),onClick:s,textClassName:"text-white"})]})});XZ.displayName="ErrorComponent";const Kf=A.memo(({fullWidth:e,retryFn:t,className:n,errorCode:r})=>{const{$t:s}=J(),o=d.useCallback(()=>{hx("error retry")},[]),a=(()=>{switch(r){case"FETCHER_SSE_OFFLINE_ERROR":case"FETCHER_SSE_NO_STATUS_CODE_ERROR":return s({defaultMessage:"Unstable internet, check your connection",id:"vbFcV2WAsH"});default:return s({defaultMessage:"Sorry, something went wrong",id:"E2YPKR25ob"})}})();return l.jsx("div",{className:z("max-w-threadContentWidth mx-auto",{"w-full":e},n),children:l.jsx(XZ,{className:z("mx-md md:mx-0",{"bg-super":r==="FETCHER_SSE_OFFLINE_ERROR"}),title:a,retryFn:t??o})})});Kf.displayName="ErrorFallback";const ja=d.memo(({children:e,id:t})=>{const n=d.useMemo(()=>()=>l.jsx("div",{className:"isolate mx-auto max-w-threadContentWidth",children:l.jsx(Kf,{})}),[]);return l.jsx(Mr,{fallback:n,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(Dp.Panel,{value:t,children:e})})});ja.displayName="AnswerModeContainer";const br=({children:e,className:t,as:n="div",active:r=!0,speed:s="normal",hoverOnly:o=!1,variant:a="default"})=>{const[i,c]=d.useState(!1),u=o?i:r;return A.createElement(n,{style:{animationDuration:s==="normal"?"1200ms":"1800ms"},className:z({shimmer:u&&a==="default","animate-gradient bg-clip-text text-transparent shimmer-super":u&&a==="super"},t),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e)},ZZ=d.memo(()=>l.jsxs(br,{className:"gap-md flex flex-col",children:[l.jsx(gy,{}),l.jsx(gy,{}),l.jsx(gy,{})]}));ZZ.displayName="AnswerModeLoader";const gy=d.memo(()=>l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(K,{variant:"subtler",className:"size-32 shrink-0 rounded-md"}),l.jsxs("div",{className:"gap-sm flex w-full flex-col",children:[l.jsx(K,{variant:"subtler",className:"h-4 w-full rounded-full"}),l.jsx(K,{variant:"subtler",className:"h-4 w-2/3 rounded-full"})]})]}));gy.displayName="Item";const kOe=({maxHeightPx:e})=>{const[t,n]=d.useState(null),[r,s]=d.useState(!1),[o,a]=d.useState(!1),[i,c]=d.useState(0),u=d.useCallback(f=>{n(f),f&&a(!1)},[]);return d.useLayoutEffect(()=>{if(!t||typeof window>"u")return;const f=new ResizeObserver(m=>{for(const p of m){const h=p.target.scrollHeight;a(!0),c(h),s(h>e)}});return f.observe(t),()=>{f.disconnect()}},[t,e]),d.useMemo(()=>({ref:u,isTruncated:r,hasMeasured:o,scrollHeight:i}),[r,o,i,u])},MOe=({maxHeight:e,children:t,buttonLabels:n,buttonTestId:r,className:s})=>{const[o,a]=d.useState(!1),{ref:i,isTruncated:c,hasMeasured:u,scrollHeight:f}=kOe({maxHeightPx:e}),m=d.useCallback(()=>{a(v=>!v)},[]),p=Zl(u),h=u&&p,g=d.useMemo(()=>u?{height:c&&!o?e:f,transition:h?"height 200ms cubic-bezier(0.16, 1, 0.3, 1)":"none",overflow:"hidden"}:{maxHeight:e,transition:"none",overflow:"hidden"},[u,c,o,f,h,e]),y=u&&c&&!o,x=d.useMemo(()=>({maskImage:y?"linear-gradient(to bottom, black 70%, transparent 97%)":void 0}),[y]);return l.jsxs("div",{className:s,children:[l.jsx("div",{style:x,children:l.jsx("div",{style:g,children:l.jsx("div",{ref:i,children:t})})}),c&&l.jsx("div",{className:z("top-xs relative flex",{"-mt-2":!o}),children:l.jsx("div",{className:"-mt-0.5","data-testid":r,children:l.jsx(wt,{size:"tiny",variant:"text",onClick:m,trailingIcon:o?B("chevron-up"):B("chevron-down"),children:o?n.showLess:n.showMore})})})]})},TOe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"enable-share-prompts",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function AOe({entryUUID:e,reason:t,callback:n}){const[r,s]=d.useState(!1),o=d.useRef(!1),{inFlight:a}=on();return d.useEffect(()=>{!a&&o.current&&(o.current=!1,s(!1),n())},[a,n]),{terminateEntry:()=>{o.current=!0,s(!0),au({entryUUID:e,reason:t})},isTerminating:r}}const JZ=d.memo(({children:e,className:t,hasAttachments:n})=>l.jsx("div",{className:z("flex min-w-[48px] items-center justify-center","bg-offset text-foreground rounded-2xl p-3 font-sans text-base font-normal select-none",{"rounded-br-none":n},t),children:l.jsx("span",{className:"select-text",style:{overflowWrap:"anywhere"},children:e})}));JZ.displayName="ChatBubble";const NOe={maskImage:"linear-gradient(to bottom, black 50%, transparent)"};function ROe({entryUUID:e,displayQueryStr:t,inFlight:n,onSubmitEdit:r}){const[s,o]=d.useState(t??""),[a,i]=d.useState(!1),{trackEvent:c}=Bv(),u=el(),{updateCurrentMode:f}=SOe();d.useEffect(()=>{n&&i(!1)},[n]);const m=d.useCallback(()=>{s!==t&&r(s),i(!1),f("default")},[s,t,r,f]),{terminateEntry:p,isTerminating:h}=AOe({entryUUID:e,reason:"editable-thread-title",callback:m}),g=d.useCallback(()=>{u&&p()},[u,p]),y=d.useCallback(()=>{u&&(c("confirm edit query click",{entryUUID:e,newQuery:s}),m())},[u,e,m,c,s]),x=d.useCallback(()=>{n?g():y()},[n,g,y]),v=d.useCallback(()=>{o(t??""),i(!1),c("cancel edit query click",{entryUUID:e})},[e,t,c]),b=d.useCallback(()=>{o(t??""),i(!0)},[t]),_=!!u;return d.useMemo(()=>({handleEditButtonClick:b,handleCancelEditQuery:v,handleConfirmEditQuery:x,isTerminating:h,canEdit:_,editQueryValue:s,setEditQueryValue:o,isEditingQuery:a}),[b,v,x,h,_,s,a])}function DOe({entryUUID:e,displayQueryStr:t}){const{$t:n}=J(),{trackEvent:r}=Bv(),{openToast:s}=hn(),[o,a]=d.useState(!1),{variation:i}=TOe(!1),c=i&&!1,u=d.useCallback(f=>{f.preventDefault(),navigator.clipboard.writeText(t??""),a(!0),setTimeout(()=>a(!1),2e3),r("click copy query button",{entryUUID:e})},[t,c,s,n,r,e]);return d.useMemo(()=>({handleCopyButtonClick:u,showCopyCheckmark:o}),[u,o])}const eJ=d.memo(({entryUUID:e,onSubmitEdit:t,isFirstResult:n,hasAttachments:r,inFlight:s,isFailed:o,isEditDisabled:a,selectedRefinementQuery:i,queryStr:c})=>{const u=d.useRef(null);Rf("thread-title",{skip:!n});const f=i??c,{quote:m,actualQuery:p}=qx(f),{handleEditButtonClick:h,handleCancelEditQuery:g,handleConfirmEditQuery:y,isTerminating:x,canEdit:v,editQueryValue:b,setEditQueryValue:_,isEditingQuery:w}=ROe({entryUUID:e,displayQueryStr:p,inFlight:s,onSubmitEdit:t}),{handleCopyButtonClick:S,showCopyCheckmark:C}=DOe({entryUUID:e,displayQueryStr:f}),E=d.useCallback(T=>{Ls.isEnterKeyWithoutShift(T)?(T.preventDefault(),y()):Ls.isEscapeKey(T)&&g()},[y,g]);return l.jsxs("div",{className:"relative z-10",children:[m&&l.jsx(tJ,{quote:m}),l.jsxs("div",{className:"group relative flex items-end gap-0.5",children:[l.jsx("div",{className:"-inset-md pointer-events-none absolute select-none"}),l.jsx("div",{className:"relative min-w-0 flex-1 flex justify-end",children:w?l.jsx(IOe,{onKeyDown:E,editQueryValue:b,setEditQueryValue:_,inputRef:u}):l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(nJ,{showActions:v,isEditButtonDisabled:a,showCopyCheckmark:C,onEditClick:h,onCopyClick:S}),l.jsx(iJ,{hasAttachments:r,queryString:p??"",isFirstResult:n,isFailed:o})]})})]}),w&&l.jsx(rJ,{style:NOe,isTerminating:x,onCancel:g,onConfirm:y})]})});eJ.displayName="EditableThreadTitle";const tJ=d.memo(({quote:e})=>l.jsx("div",{className:"mb-sm flex justify-end",children:l.jsxs(V,{variant:"small",color:"light",className:"bg-offset rounded-2xl py-sm px-3 inline-flex items-center",children:[l.jsx(ut,{name:B("quote"),size:18,className:"text-super mr-sm shrink-0 -translate-y-px rotate-180"}),l.jsx("span",{className:"line-clamp-1",children:e})]})}));tJ.displayName="QuoteDisplay";const nJ=d.memo(({showActions:e,isEditButtonDisabled:t,showCopyCheckmark:n,onEditClick:r,onCopyClick:s})=>{const{$t:o}=J();return l.jsxs("div",{className:z("flex shrink-0 items-center gap-1","opacity-0","transition-opacity duration-150","pointer-events-none",e&&"group-hover:pointer-events-auto group-hover:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100"),"aria-hidden":!e,children:[l.jsx(wt,{icon:B("pencil"),variant:"text",size:"small",rounded:!0,onClick:r,disabled:t,"aria-label":o({defaultMessage:"Edit Query",id:"b3OoXBV5TQ"})}),l.jsx(wt,{icon:n?B("check"):B("copy"),variant:"text",size:"small",rounded:!0,onClick:s,"aria-label":o({defaultMessage:"Copy Query",id:"pLS6m4WFYK"})})]})});nJ.displayName="TitleActions";const rJ=d.memo(({style:e,isTerminating:t,onCancel:n,onConfirm:r})=>l.jsxs("div",{className:"gap-x-sm my-sm pb-sm w-full absolute top-full flex justify-end",children:[l.jsx(K,{className:"-inset-lg -top-sm absolute",variant:"background",style:e}),l.jsxs("div",{className:"gap-x-sm relative z-10 flex",children:[l.jsx(wt,{size:"small",variant:"secondary",onClick:n,disabled:t,children:l.jsx(je,{defaultMessage:"Cancel",id:"47FYwba+bI"})}),l.jsx(wt,{size:"small",variant:"primary",onClick:r,disabled:t,children:l.jsx(je,{defaultMessage:"Done",id:"JXdbo8Vnlw"})})]})]}));rJ.displayName="EditControls";const sJ=d.memo(({url:e,text:t})=>{const n=d.useMemo(()=>l.jsx("span",{role:"button",tabIndex:0,className:"underline hover:opacity-70 cursor-pointer",title:e,children:t}),[t,e]);return l.jsx(Fl,{triggerElement:n,side:"bottom",align:"start",children:l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"whitespace-nowrap",children:l.jsx(je,{defaultMessage:"Go to: ",id:"r9nTuorenA"})}),l.jsx(yt,{href:e,target:"_blank",rel:"noopener",className:"underline break-all","aria-label":e,children:sCe(e,60)})]})})});sJ.displayName="TitleLinkPopover";const oJ=d.memo(({title:e})=>{const{displayTitle:t,links:n}=cMe(e);if(n.length===0)return t;const r=[];let s=0;return n.forEach((o,a)=>{o.startOffset>s&&r.push(l.jsx(A.Fragment,{children:t.substring(s,o.startOffset)},`text-${a}`)),r.push(l.jsx(sJ,{url:o.url,text:t.substring(o.startOffset,o.endOffset)},`link-${a}`)),s=o.endOffset}),s{const{$t:o}=J(),a=d.useCallback(()=>r&&!e?o({defaultMessage:"Something went wrong.",id:"iuY8kxCDQT"}):l.jsx(JZ,{className:"max-w-[600px]",hasAttachments:s,children:l.jsx(oJ,{title:e})}),[r,e,o,s]),i=d.useMemo(()=>({showMore:l.jsx(je,{defaultMessage:"Show more",id:"kgNFsmh2uY",description:"Show more of the query."}),showLess:l.jsx(je,{defaultMessage:"Show less",id:"qyJtWyZ0yt"})}),[]);return l.jsx(MOe,{maxHeight:jOe,className:"group/title relative inline-flex flex-col",buttonLabels:i,buttonTestId:"toggle-query-expand-button",children:l.jsx(V,{as:n?"h1":"div",className:z("group/query relative whitespace-pre-line !text-wrap break-words [word-break:break-word]",t),children:a()})})});aJ.displayName="DisplayQueryBase";const iJ=d.memo(aJ);iJ.displayName="DisplayQuery";const IOe=({onKeyDown:e,editQueryValue:t,setEditQueryValue:n,inputRef:r})=>{const s=t==="";return l.jsxs("div",{className:"relative w-full min-w-0",children:[l.jsx("div",{className:"absolute border border-subtlest bg-subtlest inset-0 rounded-lg"}),l.jsxs("div",{className:"relative grid",children:[l.jsx(lI,{onKeyDown:e,editQueryValue:t,onChange:n,inputRef:r}),l.jsx("div",{className:z("pointer-events-none col-start-1 row-start-1 opacity-0","text-base font-normal leading-normal"),children:s?l.jsx(l.Fragment,{children:" "}):l.jsx(lI,{editQueryValue:t,disabled:!0})})]})]})},lI=({onKeyDown:e,editQueryValue:t,disabled:n,onChange:r,inputRef:s})=>{const{$t:o}=J(),{isMobileUserAgent:a}=Re();return l.jsx("div",{className:z("text-foreground block h-auto w-full resize-none appearance-none overflow-hidden bg-transparent focus:outline-none","caret-super selection:bg-super/50 selection:text-foreground dark:selection:bg-super/10 dark:selection:text-super","text-base font-normal p-3 leading-normal","[&_[contenteditable]]:!font-display","[&_[contenteditable]]:!bg-transparent","[&_[contenteditable]]:max-h-none [&_[contenteditable]]:!overflow-hidden [&_[contenteditable]]:sm:max-h-none [&_[contenteditable]]:lg:max-h-none","[&_[contenteditable]+*>*]:opacity-80","[&>*]:p-0"),style:{gridArea:"1/-1"},children:l.jsx(AA,{onKeyDown:e,placeholder:o({defaultMessage:"Ask anything…",id:"AUouhaZgFv"}),value:t,onChange:r,minRows:0,isMobileStyle:!1,isMobileUserAgent:a,useLexical:!0,autoFocus:!0,disableInput:n,ref:s})})},POe=Ce(async()=>{const{SidePDFViewer:e}=await Se(()=>q(()=>import("./SidePDFViewer-B5TcfQVy.js"),__vite__mapDeps([149,4,1,6,3,9,7,150,8,10,11,12])));return{default:e}}),OOe=Ce(async()=>{const{SideMeetingTranscriptViewer:e}=await Se(()=>q(()=>import("./SideMeetingTranscriptViewer-B_6wuU1-.js"),__vite__mapDeps([151,4,1,8,3,9,6,7,150,10,11,12])));return{default:e}}),y6=Ft("FileViewerContext",{openFile:()=>{},closeViewer:()=>{},doViewerAction:()=>{},isViewerOpen:!1,setViewerDispatch:()=>{}}),LOe=A.memo(({children:e})=>{const[t,n]=d.useState(),[r,s]=d.useState(),o=d.useRef(void 0),a=d.useCallback(h=>{n(h)},[n]),i=d.useCallback(()=>{n(void 0),s(void 0),o.current=void 0},[n,s]),c=d.useRef([]),u=d.useCallback(h=>{o.current?o.current(h):c.current.push(h)},[]),f=d.useCallback(h=>{s(()=>h),o.current=h,c.current.length>0&&h&&(c.current.forEach(g=>h(g)),c.current=[])},[s]),m=d.useMemo(()=>({openFile:a,closeViewer:i,doViewerAction:u,isViewerOpen:!!r,setViewerDispatch:f}),[a,i,u,r,f]),p=t?.fileSource===tV.MEETING_TRANSCRIPT?OOe:POe;return l.jsxs(y6.Provider,{value:m,children:[e,t&&l.jsx(p,{file:t})]})});LOe.displayName="FileViewerStateProvider";const lJ=({genericErrorMessage:e})=>{const{$t:t}=J(),{openToast:n}=hn();return d.useCallback(r=>{r instanceof F4?n({message:t({defaultMessage:"Downloads are disabled for files in this organization.",id:"NfM+Ayxvc6"}),variant:"error",timeout:8}):r instanceof B4?n({message:t({defaultMessage:"PDF downloads are restricted",id:"aJYvzl3Lq5"}),variant:"error",timeout:8}):r instanceof U4?n({message:t({defaultMessage:"This file belongs to a different organization",id:"lo7Bg402Jd"}),variant:"error",timeout:8}):n({message:e,variant:"error",timeout:3})},[n,t,e])},Wv=({reason:e,onSuccess:t})=>{const{$t:n}=J(),{openToast:r}=hn(),s=lJ({genericErrorMessage:n({defaultMessage:"Failed to download file",id:"RIWlU8NdpC"})});return Rt({mutationFn:async({file_url:o})=>(await Oz({request:{file_url:o,view_mode:!1},reason:e})).file_url,onSuccess:(o,{tab_id:a})=>{t?t(o,a):window.open(o,"_blank"),r({message:n({defaultMessage:"Downloading file...",id:"/vA9NyIeJh"}),variant:"success",timeout:3})},onError:s})},cJ=A.memo(({attachments:e,backend_uuid:t,fileSourceMap:n})=>l.jsx("div",{className:"gap-sm relative flex flex-wrap flex-row-reverse",children:l.jsx("div",{className:"min-w-0 max-w-[200px]",children:e.length>1?l.jsx(FOe,{attachments:e,backend_uuid:t,fileSourceMap:n}):e[0]?l.jsx(dJ,{attachmentUrl:e[0],backend_uuid:t,fileSource:n.get(e[0])}):null})}));cJ.displayName="AttachmentsRow";const uJ=e=>{const{openFile:t}=d.useContext(y6),{getImageDownloadUrl:n}=Mv({reason:"attachments-row"}),{$t:r}=J(),s=lJ({genericErrorMessage:r({defaultMessage:"Failed to open file",id:"VJjxNdFaqb"})});return d.useCallback(async(o,a)=>{if(!Bx(o))return!1;try{const i=await n({url:o,thread_id:e});return t({name:cu(o),url:i,fileSource:a,entryUUID:e}),!0}catch(i){return s(i),!1}},[t,e,n,s])},dJ=A.memo(({attachmentUrl:e,backend_uuid:t,fileSource:n})=>{const r=kr(e),[s,o]=d.useState(!1),{mutate:a}=Wv({reason:"attachments-row"}),i=uJ(t),c=d.useCallback(()=>{Bx(e)&&a({file_url:e})},[e,a]),u=d.useCallback(()=>{r?o(!0):dA()?i(e,n):c()},[r,e,n,i,c]),f=d.useCallback(()=>{o(!1)},[]),m=d.useMemo(()=>cu(e),[e]),p=d.useMemo(()=>({src:e}),[e]),h=d.useMemo(()=>({url:e}),[e]);return l.jsxs(l.Fragment,{children:[l.jsx(fJ,{title:m,icon:r?l.jsx(UOe,{attachmentUrl:e}):l.jsx(BOe,{attachmentUrl:e}),onClick:u,className:z({"!border-cursor":r})}),r&&l.jsx(pu,{onClose:f,isOpen:s,imgProps:p,origin:h,width:100,height:100,alt:m})]})});dJ.displayName="AttachmentItem";const fJ=({title:e,icon:t,className:n,hasChevron:r,ref:s,...o})=>l.jsxs(Ro,{...o,ref:s,className:z("flex w-full cursor-pointer items-center transition-colors","p-xs gap-[6px] rounded-xl pr-[6px] rounded-tr-none","border-subtlest border bg-background hover:bg-subtler",n),children:[t,l.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 leading-tight",children:e})}),r&&l.jsx(ge,{icon:B("chevron-down"),className:"text-quieter mr-px",size:"sm"})]}),FOe=({attachments:e,backend_uuid:t,fileSourceMap:n})=>{const{$t:r}=J(),[s,o]=d.useState(void 0),{mutate:a}=Wv({reason:"attachments-row"}),i=uJ(t),c=d.useCallback(y=>{Bx(y)&&a({file_url:y})},[a]),u=d.useCallback(async y=>{const x=n.get(y);kr(y)?o(y):dA()?i(y,x):c(y)},[n,i,c]),f=d.useMemo(()=>l.jsx(VOe,{}),[]),m=d.useMemo(()=>l.jsx(fJ,{title:r({defaultMessage:"{count, plural, one {# attachment} other {# attachments}}",id:"RYwHHLwZK9"},{count:e.length}),icon:f,className:"!border-cursor",hasChevron:!0}),[r,e.length,f]),p=d.useCallback(()=>{o(void 0)},[]),h=d.useMemo(()=>({src:s}),[s]),g=d.useMemo(()=>({url:s}),[s]);return l.jsxs(l.Fragment,{children:[l.jsx(Dt,{align:"end",triggerElement:m,children:e.map(y=>l.jsx(Dt.Item,{leadingAccessory:mJ(y).icon,onSelect:()=>u(y),children:cu(y)},y))}),s&&l.jsx(pu,{onClose:p,imgProps:h,origin:g,width:100,height:100,isOpen:!0})]})},cI={txt:{icon:B("file-text"),text:"Text file"},pdf:{icon:B("pdf"),text:"PDF file"},jpeg:{icon:B("photo"),text:"Image file"},jpg:{icon:B("photo"),text:"Image file"},doc:{icon:B("file-word"),text:"Word document"},docx:{icon:B("file-word"),text:"Word document"},rtf:{icon:B("file-text"),text:"Text file"},pptx:{icon:B("file-type-ppt"),text:"PowerPoint file"},xlsx:{icon:B("file-excel"),text:"Excel file"},md:{icon:B("file-text"),text:"Markdown file"},png:{icon:B("photo"),text:"Image file"},csv:{icon:B("file-type-csv"),text:"CSV file"},mov:{icon:B("video"),text:"Video file"},mp4:{icon:B("video"),text:"Video file"},unknown:{icon:B("file"),text:"Unknown"}},mJ=e=>{const t=mu(e);return cI[t]??cI.unknown},BOe=({attachmentUrl:e})=>{const{icon:t}=mJ(e);return l.jsx(x6,{children:l.jsx(ge,{icon:t,className:"text-quiet",size:"xs"})})},UOe=({attachmentUrl:e})=>{const[t,n]=d.useState(void 0);return l.jsxs(x6,{children:[l.jsx("img",{src:e,alt:"Attachment",className:z("aspect-square h-full object-cover",{hidden:t===!1,"opacity-0":t===void 0}),onLoad:()=>n(!0),onError:()=>n(!1),loading:"lazy",decoding:"async"}),t===!1&&l.jsx(ge,{icon:B("photo"),className:"text-quiet",size:"xs"})]})},VOe=()=>l.jsx(x6,{children:l.jsx(ge,{icon:B("paperclip"),className:"text-quiet",size:"xs"})}),x6=({children:e})=>l.jsx(K,{variant:"subtle",className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-lg",children:e});var pr;(function(e){e.Preview="preview",e.Source="source"})(pr||(pr={}));const HOe=Ft("CanvasContext",{openCanvas:()=>{},closeCanvas:()=>{},isCanvasOpen:!1,doCanvasAction:()=>{},setCanvasDispatch:()=>{},setCanvasState:()=>{}}),Yf=()=>d.useContext(HOe),Ku=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/deeper-research/download-asset",t,{body:e,timeoutMs:2e3,numRetries:1});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to download file",cause:r,status:s.status??0});return n.file_url},zOe=async({request:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/deeper-research/export-all-assets",t,{body:e,timeoutMs:6e4,numRetries:1,parseAs:"blob"});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to export all assets",cause:r,status:s.status??0});return n},pJ=({reason:e})=>{const{$t:t}=J(),{openToast:n}=hn(),r=d.useCallback(async a=>{try{const i=await Ku({request:a,reason:e}),c=document.createElement("a");c.href=i,c.download=a.filename,document.body.appendChild(c),c.click(),document.body.removeChild(c),n({message:t({defaultMessage:"Downloading file...",id:"/vA9NyIeJh"}),variant:"success",timeout:3})}catch(i){Z.error("Failed to download S3 asset",{error:i,request:a,errorMessage:i instanceof Error?i.message:"Unknown error"}),n({message:t({defaultMessage:"Failed to download file",id:"RIWlU8NdpC"}),variant:"error",timeout:3})}},[e,t,n]),s=d.useCallback(async(a,i="media",c=document.body)=>{try{const u=await fetch(a,{mode:"cors",cache:"no-cache"});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);const f=await u.blob(),m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=i,c.appendChild(p),p.click(),c.removeChild(p),URL.revokeObjectURL(m);const h=i.toLowerCase().includes(".mp4")||i.toLowerCase().includes(".mov")||i.toLowerCase().includes(".avi")||f.type.startsWith("video/"),g=t(h?{defaultMessage:"Video downloaded",id:"WHvofOjBQO"}:{defaultMessage:"Image downloaded",id:"nS5vxnEXaW"});n({message:g,variant:"success",timeout:3})}catch(u){const f=i.toLowerCase().includes(".mp4")||i.toLowerCase().includes(".mov")||i.toLowerCase().includes(".avi");Z.error("Failed to download media asset",{error:u,mediaUrl:a,errorMessage:u instanceof Error?u.message:"Unknown error",errorType:u instanceof TypeError&&u.message.includes("Failed to fetch")?"CORS":"Unknown"});const m=t(f?{defaultMessage:"Failed to download video",id:"g8uGrbPLMV"}:{defaultMessage:"Failed to download image",id:"YPAbL/7UuZ"});n({message:m,variant:"error",timeout:3})}},[t,n]),o=d.useCallback(async(a,i="image.jpg",c=document.body)=>s(a,i,c),[s]);return d.useMemo(()=>({downloadS3Asset:r,downloadImageAsset:o,downloadMediaAsset:s}),[o,r,s])},v6=e=>{const{$t:t}=J();return Vi(e?.asset_type).with(at.CODE_ASSET,()=>({description:t({defaultMessage:"Programming",id:"4MsdoHG9QN"}),title:t({defaultMessage:"Python",id:"/Z1NW3qKj6"}),Icon:B("code")})).with(at.CHART,()=>({description:t({defaultMessage:"Code Interpreter Graph",id:"F3E5l9GC7U"}),title:t({defaultMessage:"Chart",id:"nFVuBOECC+"}),Icon:B("chart-histogram")})).with(at.CODE_FILE,()=>({description:t({defaultMessage:"Generated File",id:"x6KEQZ7oaM"}),title:e?.code_file?.filename??"",Icon:B("file")})).with(at.APP,()=>({description:t({defaultMessage:"Generated App",id:"t7mMyC1O7+"}),title:e?.app?.name??"",Icon:B("layout-collage")})).with(at.SLIDES,()=>({description:t({defaultMessage:"Presentation",id:"7zHbpiyvPE"}),title:e?.app?.name??"",Icon:B("presentation")})).with(at.GENERATED_IMAGE,()=>({description:"",title:t({defaultMessage:"Generated Image",id:"Kt4lbw5KkH"}),Icon:B("image-in-picture")})).with(at.GENERATED_VIDEO,()=>({description:"",title:t({defaultMessage:"Generated Video",id:"Gh4spqP8w0"}),Icon:B("video")})).with(at.PDF_FILE,()=>({description:t({defaultMessage:"PDF Document",id:"Idloyb3SW4"}),title:e?.pdf_file?.name??t({defaultMessage:"PDF Document",id:"Idloyb3SW4"}),Icon:B("file-type-pdf")})).with(at.DOCX_FILE,()=>({description:t({defaultMessage:"Word Document",id:"q+bgjo7qbJ"}),title:e?.docx_file?.name??"",Icon:B("file-type-docx")})).with(at.DOC_FILE,()=>({description:t({defaultMessage:"Document",id:"wmirkPk7bp"}),title:e?.doc_file?.name??"",Icon:B("file-type-doc")})).with(at.XLSX_FILE,()=>({description:t({defaultMessage:"Excel Spreadsheet",id:"eMPZOuxga0"}),title:e?.xlsx_file?.name??"",Icon:B("file-spreadsheet")})).with(at.QUIZ,()=>({description:t({defaultMessage:"Quiz",id:"OuR/Ijtl93"}),title:e?.quiz?.title??"",Icon:B("checklist")})).with(at.FLASHCARDS,()=>({description:t({defaultMessage:"Flashcards",id:"c2+pp7T4ws"}),title:e?.flashcards?.title??"",Icon:B("cards")})).otherwise(()=>({description:"",title:t({defaultMessage:"Generated Asset",id:"Kc1J25+bKt"}),Icon:B("file")}))};function WOe(e,t,n){const r=new Blob([n],{type:"text/plain"});hJ(e,t,r)}function hJ(e,t,n){const r=document.createElement("a"),s=URL.createObjectURL(n);r.href=s,r.download=t,e.appendChild(r),r.click(),URL.revokeObjectURL(s),e.removeChild(r)}function GOe(e){return!!(e?.asset_type===at.SLIDES&&e.app?.url&&e.app.name)}function jbt(e){return e?.asset_type?[at.GENERATED_IMAGE,at.CHART,at.CODE_FILE,at.CODE_ASSET].includes(e.asset_type):!1}function $Oe(e){return e?.asset_type?[at.CHART,at.GENERATED_IMAGE,at.GENERATED_VIDEO,at.PDF_FILE].includes(e.asset_type):!1}function Ibt({reason:e,entryUUID:t}){const[n,r]=d.useState(!1),s=d.useCallback(async o=>{r(!0);try{const a=await zOe({request:{entry_uuid:t},reason:e});hJ(o||document.body,"exported-assets.zip",a)}finally{r(!1)}},[t,e]);return d.useMemo(()=>({exportAllAssets:s,isExporting:n}),[s,n])}function Pbt({asset:e,reason:t,answerMode:n,context:r,entryUUID:s}){const{downloadS3Asset:o,downloadImageAsset:a,downloadMediaAsset:i}=pJ({reason:t}),{session:c}=Ne(),{trackEvent:u}=Xe(c),f=d.useCallback(async m=>{if(e)if(r==="canvas"?u("canvas content downloaded",{contentType:e.asset_type,entryUUID:s,assetUUID:e.uuid,downloadType:"download"}):n&&u("generated asset downloaded",{assetType:e.asset_type,answerMode:n,entryUUID:s,reason:t}),e.asset_type===at.GENERATED_IMAGE)e.generated_image?.url&&await a(e.generated_image.url,"generated-image.png",m||document.body);else if(e.asset_type===at.GENERATED_VIDEO)e.generated_video?.url&&await i(e.generated_video.url,"generated-video.mp4",m||document.body);else for(const p of e.download_info)p.url?await o({url:p.url,filename:p.filename}):p.text_content&&WOe(m||document.body,p.filename,p.text_content)},[e,r,n,u,s,t,a,i,o]);return d.useMemo(()=>({downloadAsset:f}),[f])}var _c;(function(e){e[e.UNCOPIED=0]="UNCOPIED",e[e.COPYING=1]="COPYING",e[e.FAILED=2]="FAILED",e[e.SUCCEEDED=3]="SUCCEEDED"})(_c||(_c={}));var wc;(function(e){e[e.UNLINKED=0]="UNLINKED",e[e.LINKING=1]="LINKING",e[e.FAILED=2]="FAILED",e[e.SUCCEEDED=3]="SUCCEEDED"})(wc||(wc={}));function Obt({asset:e,reason:t}){const[n,r]=d.useState(_c.UNCOPIED),{$t:s}=J(),{openToast:o}=hn(),a=d.useCallback(async()=>{if(e){r(_c.COPYING);try{await qOe({asset:e,reason:t}),o({message:s({defaultMessage:"Copied to the clipboard!",id:"WWy0tPuRW8"}),variant:"success",timeout:3}),r(_c.SUCCEEDED)}catch{o({message:s({defaultMessage:"Failed to copy the asset",id:"HHPhgIZj9h"}),variant:"error",timeout:3}),r(_c.FAILED)}setTimeout(()=>r(_c.UNCOPIED),2e3)}},[s,o,r,e,t]);return d.useMemo(()=>({copyStatus:n,copyAsset:a}),[n,a])}function Lbt({asset:e}){const[t,n]=d.useState(wc.UNLINKED),{$t:r}=J(),{openToast:s}=hn(),o=d.useCallback(async()=>{if(!(!e||!$Oe(e))){n(wc.LINKING);try{let a;if(e.asset_type===at.CHART&&e.chart?.url)a=e.chart.url;else if(e.asset_type===at.GENERATED_IMAGE&&e.generated_image?.url)a=e.generated_image.url;else if(e.asset_type===at.GENERATED_VIDEO&&e.generated_video?.url)a=e.generated_video.url;else if(e.asset_type===at.PDF_FILE&&e.pdf_file?.url)a=e.pdf_file.url;else throw new Error("Asset is not linkable or URL not found");await navigator.clipboard.writeText(a),s({message:r({defaultMessage:"Link copied to clipboard!",id:"PsDXPeXpVG"}),variant:"success",timeout:3}),n(wc.SUCCEEDED)}catch{s({message:r({defaultMessage:"Failed to copy link",id:"ruCwQMVFzJ"}),variant:"error",timeout:3}),n(wc.FAILED)}setTimeout(()=>n(wc.UNLINKED),2e3)}},[e,r,s]);return d.useMemo(()=>({linkStatus:t,linkAsset:o}),[t,o])}async function qOe({asset:e,reason:t}){let n;if(e.asset_type==at.CODE_ASSET)n={"text/plain":e.code?.script??""};else if(e.asset_type==at.CHART&&e.chart?.url){const s=await Ku({request:{url:e.chart.url,filename:"chart.png"},reason:t});n={"image/png":await(await fetch(s)).blob()}}else if(e.asset_type==at.CODE_FILE&&e.code_file?.url){const s=await Ku({request:{url:e.code_file.url,filename:e.code_file.name},reason:t});n={"text/plain":await(await fetch(s)).text()}}else if(e.asset_type==at.GENERATED_IMAGE&&e.generated_image?.url){const s=e.generated_image.url;n={"image/png":await(await fetch(s)).blob()}}else if(e.asset_type==at.GENERATED_VIDEO&&e.generated_video?.url){const s=e.generated_video.url;n={"video/mp4":await(await fetch(s,{mode:"cors",cache:"no-cache"})).blob()}}else if(e.asset_type==at.PDF_FILE&&e.pdf_file?.url){const s=await Ku({request:{url:e.pdf_file.url,filename:e.pdf_file.name},reason:t});n={"application/pdf":await(await fetch(s)).blob()}}else if(e.asset_type==at.DOCX_FILE&&e.docx_file?.url){const s=await Ku({request:{url:e.docx_file.url,filename:e.docx_file.name},reason:t});n={"application/vnd.openxmlformats-officedocument.wordprocessingml.document":await(await fetch(s)).blob()}}else if(e.asset_type==at.XLSX_FILE&&e.xlsx_file?.url){const s=await Ku({request:{url:e.xlsx_file.url,filename:e.xlsx_file.name},reason:t});n={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":await(await fetch(s)).blob()}}if(!n)throw new Error("Failed to find anything to copy");const r=new ClipboardItem(n);await navigator.clipboard.write([r])}function KOe(e){if(e)switch(e.asset_type){case at.CHART:return e.chart?.url;case at.GENERATED_IMAGE:return e.generated_image?.url;case at.GENERATED_VIDEO:return e.generated_video?.url;case at.PDF_FILE:return e.pdf_file?.url;case at.CODE_FILE:return e.code_file?.url;case at.DOCX_FILE:return e.docx_file?.url;case at.DOC_FILE:return e.doc_file?.url;case at.XLSX_FILE:return e.xlsx_file?.url;case at.APP:return e.app?.app_url;case at.SLIDES:return e.app?.app_url;case at.CODE_ASSET:return;case at.QUIZ:return e.quiz?.url;case at.FLASHCARDS:return e.flashcards?.url;default:Vfe(e.asset_type);return}}const gJ=({asset:e})=>{const{openCanvas:t,closeCanvas:n,doCanvasAction:r,canvasState:s,isCanvasOpen:o}=Yf(),{title:a}=v6(e),{result:{context_uuid:i,backend_uuid:c}}=It(),{session:u}=Ne(),{trackEvent:f}=Xe(u),m=d.useCallback(()=>{if(e){const p=KOe(e);p&&window.open(p,"_blank");return}},[e,t,n,r,a,c,o,s?.assetUuid,f,i]);return d.useMemo(()=>m,[m])},YOe=()=>{const e=fn(),{results:t}=on(),n=d.useRef(!1),r=t?.[0],s=r?.blocks?u6(r.blocks,{orderedByPriority:!0})[0]:void 0,o=gJ({asset:s});d.useEffect(()=>{n.current||!s||!(e.get("canvas")==="true")||(n.current=!0,o())},[e,s,o])};function QOe(){const e=hv(),t=bg(),{results:n}=on(),r=d.useRef(!1),s=d.useMemo(()=>n.some(o=>o.display_model===ie.STUDY),[n]);d.useEffect(()=>{const o=e(ie.STUDY);s&&o&&!r.current&&(r.current=!0,t(ie.STUDY,oe.STUDY))},[e,t,s])}const yJ=({trackEvent:e,entryUUID:t,frontendContextUUID:n,contextUUID:r})=>d.useCallback((s,o)=>{e(s,{entryUUID:t,frontendContextUUID:n,contextUUID:r,...o})},[t,n,r,e]),XOe=({webResults:e})=>Xi(t=>({isShowing:!1,webResults:e,actions:{hide:()=>t({isShowing:!1}),show:n=>t({...n,isShowing:!0})}})),{Context:ZOe,useTrackedState:JOe}=s4("SourcesListContext"),xJ=d.memo(({children:e,webResults:t})=>{const[n]=A.useState(()=>XOe({webResults:t}));return d.useEffect(()=>{n.setState({webResults:t})},[t,n]),l.jsx(ZOe.Provider,{value:n,children:e})});xJ.displayName="SourcesListProvider";const eLe=JOe;class tLe extends Date{constructor(t){const n=t?new Date(t):new Date,r=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds());super(r)}getTimezoneOffset(){return 0}}class Gv{static isRecentlyTrending(t,n=432e5){return t.meta_data?.client!=="trending"?!1:new Date().getTime()-new tLe(t.meta_data?.published_date).getTime()o.is_attachment);if(!n)return t;const s=new Set(n.map(o=>this.normalizeUrl(o.url)));return t.filter(o=>!s.has(this.normalizeUrl(o.url)))}}const nLe=({webResults:e,navigationResults:t=[],isStudyMode:n=!1,client:r="trending"})=>{if(!e)return{dedupedWebResults:[],hasSufficientTrendingRatio:!1,trendingResults:[],trendingResultsWithImages:[]};const s=Gv.dedupWebResults(e,t,n),o=s.filter(f=>f.meta_data?.client===r),i=s.slice(0,10).filter(f=>f.meta_data?.client===r),c=i.length>=2,u=i.filter(f=>f.meta_data?.images?.[0]);return{dedupedWebResults:s,hasSufficientTrendingRatio:c,trendingResults:o,trendingResultsWithImages:u}},vJ=A.memo(({urlData:e,handleClick:t,showBottomBorder:n=!0,...r})=>{const s=d.useMemo(()=>{const{url:h,snippet:g}=e;if("title"in e){const x=e;return{url:h,title:x.title,snippet:g,domain:x.domain||Ur(h)}}return{url:h,title:e.name,snippet:g,domain:Ur(h)}},[e]),{url:o,title:a,snippet:i,domain:c}=s,u=d.useMemo(()=>c.replace(/^www\./,"").split(".")[0],[c]),f=d.useMemo(()=>$c(o),[o]),m=d.useMemo(()=>h=>()=>{},[]),p=t||m;return l.jsx("div",{className:z("p-md border-t-subtlest -mx-4 flex grow select-none flex-col border-t px-4 [&:only-child]:border-0",n&&"last:border-b-subtlest last:border-b"),children:l.jsxs(yt,{className:"gap-sm border-t-subtlest group flex cursor-pointer flex-col items-stretch",href:o,target:"_self",onClick:p(o,"primaryLink"),rel:"noopener",...r,children:[l.jsxs("div",{className:"flex h-7 items-center gap-2",children:[l.jsx(Po,{size:28,domain:f,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex w-full min-w-0 flex-col",children:[l.jsx(V,{variant:"small",className:"line-clamp-1",children:u}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 truncate break-words",children:o})]})]}),l.jsxs("div",{children:[l.jsx(V,{className:"line-clamp-1",variant:"baseSemi",color:"super",children:a}),l.jsx(V,{variant:"small",color:"light",className:"line-clamp-2",children:i})]})]},o)})});vJ.displayName="MobileUrlCard";const mc={lastEntryUUID:null,loggedUrls:new Set,seenEntries:new Set};function rLe(e){if(e)return[{...e,url:e?.url,title:e?.name,snippet:e?.snippet,sitelinks:e?.sitelinks?.slice(),site_name:e?.meta_data?.domain_name||e?.meta_data?.citation_domain_name}]}const b6=A.memo(({navigationResult:e,trackEvent:t,queryString:n,entryUUID:r,frontendUUID:s,onClick:o,showSiteLinks:a=!1,showNewMobileCard:i=!1,renderPosition:c,clampSnippet:u=!1,showBottomBorder:f=!0,...m})=>{const{url:p,title:h,snippet:g,sitelinks:y,position:x,source:v,client_request_timestamp:b,unstable_server_request_timestamp:_,is_cached:w,is_comet_navigation:S,site_name:C,navigation_source:E}=e,{isMobileStyle:T}=Re(),k=d.useMemo(()=>$c(p),[p]),I=d.useMemo(()=>h3(p),[p]);d.useEffect(()=>{if(!r||!p)return;const N=mc.seenEntries.has(r);mc.lastEntryUUID!==r&&(mc.lastEntryUUID=r,mc.loggedUrls.clear()),mc.loggedUrls.has(p)||(mc.loggedUrls.add(p),mc.seenEntries.add(r),t("navigational source viewed",{query:n,url:p,title:h,...a&&{subLinks:y},position:x,source:v,is_comet_navigation:S,frontendUUID:s,...typeof b=="number"&&!N&&{renderTimeMs:performance.now()-b},...typeof _=="number"&&!N&&{unstableRenderTimeMs:performance.now()-_},subLinks:y,isCached:w,navigation_source:E}))},[r,p,n]);const M=d.useCallback((N,D)=>j=>{t("click citation",{source:"navigationalCard",render_position:c,navigationalLinkType:D,citation_url:N,is_comet_navigation:S,frontendUUID:s}),o?.(j)},[S,t,o,s,c]);return T&&i?l.jsx(vJ,{urlData:e,handleClick:M,showBottomBorder:f,...m}):l.jsx("div",{className:"gap-sm flex select-none",children:l.jsx("div",{className:"grow",children:l.jsxs(K,{variant:"transparent",className:"flex grow flex-col rounded-lg",children:[l.jsx(yt,{className:"group flex cursor-pointer items-stretch",href:p,target:"_self",onClick:M(p,"primaryLink"),rel:"noopener",...m,children:l.jsxs(K,{className:"pr-md group",children:[l.jsxs("div",{className:"mb-xs gap-sm flex items-center",children:[l.jsx(Po,{size:24,domain:k,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex flex-col",children:[C&&l.jsx(V,{variant:"tiny",color:"light",className:"line-clamp-1 break-all leading-[0.875rem]",children:C}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 break-all leading-[0.875rem]",children:I})]})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"super",className:"decoration-1 underline-offset-1 group-hover:underline",children:h}),l.jsx(V,{variant:"small",color:"light",className:`mb-two line-clamp-${u?"1":"2"}`,children:g})]})]})},p),y&&y.length>0&&a&&l.jsx(V,{variant:"small",color:"light",className:"pt-two pb-sm",children:l.jsx(ga,{className:"flex-wrap",children:y.map(N=>l.jsx(Bn,{id:N.url,children:l.jsx(yt,{className:"group flex cursor-pointer items-stretch",href:N.url,onClick:M(N.url,"siteLink"),rel:"noopener",...m,children:l.jsx(V,{variant:"small",color:"super",className:"decoration-1 underline-offset-1 group-hover:underline",children:N.title})})},N.url))})})]})})})});b6.displayName="CitationNavigationalCard";const sLe=Ce(async()=>{const{CitationListModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>FN),void 0));return{default:e}}),oLe=({entry:e,webResults:t,showSourcesSidebar:n,allowedNavResultsCount:r,isFirstResult:s,enableMobileCalculations:o=!1,...a})=>{const{session:i}=Ne(),{trackEvent:c}=Xe(i),{trackEvent:u}=Bv(),{openModal:f}=Uo(),m=el(),p=eLe(),{isMobileStyle:h}=Re(),g=d.useMemo(()=>"searchMode"in a&&a.searchMode===oe.SEARCH,[a]),y=d.useMemo(()=>t?.filter(R=>R.is_navigational)?.flatMap(R=>rLe(R)||[]),[t]),{data:x}=mt({queryKey:$H(e?.query_str??""),queryFn:()=>Promise.resolve({}),enabled:!1}),v=d.useMemo(()=>x?.navigation_results?.map(R=>({...R,is_cached:!0,navigation_source:Ld.SEARCH_V2_NAVIGATE}))??y?.map(R=>({...R,is_cached:!1,navigation_source:Ld.WEB_RESULTS})),[x,y]),b=d.useMemo(()=>v?.slice(0,r),[v,r]),_=b?.length&&s&&!g,w=d.useMemo(()=>qt.isPerplexityMessage(e)?e?.display_model==="pplx_study":!1,[e]),S=d.useMemo(()=>nLe({webResults:t,navigationResults:b,isStudyMode:w}),[t,b,w]),{dedupedWebResults:C,hasSufficientTrendingRatio:E,trendingResults:T,trendingResultsWithImages:k}=S,I=d.useMemo(()=>!o||!h?[]:k,[o,h,k]),M=d.useMemo(()=>o?h&&E&&k.length>=2:!1,[o,h,E,k.length]),N=d.useMemo(()=>qt.isPerplexityMessage(e)?e?.blocks?.some(R=>R.intended_usage==="answer_media_items"):!1,[e]),D=d.useMemo(()=>!_&&!N&&E,[_,N,E]),j=d.useCallback(()=>{if(e?.backend_uuid){const R=n?"sidebar":"modal";u("click view sources button",{entryUUID:e.backend_uuid,type:p.isShowing?void 0:R})}n?p.actions.show({webResults:t}):f(sLe,{legacyIdentifier:"citationListModal",webResults:t,entry:e})},[e?.backend_uuid,f,m,n,p.isShowing,p.actions.hide,u,t?.length]),F=yJ({trackEvent:c,entryUUID:e?.backend_uuid,frontendContextUUID:e?.uuid,contextUUID:e?.context_uuid});return d.useMemo(()=>({isNavigationalLayout:_,navigationResults:b,trackCitationClickEvent:F,handleViewAllClick:j,dedupedWebResults:C,isTrendingLayout:D,trendingResults:T,trendingResultsWithImages:I,showTrendingInMobile:M}),[C,j,_,D,b,M,F,T,I])},bJ=({target:e,entryUUID:t,frontendContextUUID:n,targetVisibilityPortionThreshold:r=.5,hasLLMToken:s})=>{const o=d.useRef(null),a=d.useRef(null),i=d.useRef(!1),{session:c}=Ne(),{trackEvent:u}=Xe(c),{result:f}=It(),m=d.useRef(f);d.useEffect(()=>{m.current=f},[f]);const p=d.useCallback(()=>{if(o.current){const g=Math.round(performance.now()-o.current);u("thread entry exited",{entryUUID:t,frontendContextUUID:n,timeOnEntryMs:g}),o.current=null}if(a.current){const g=m.current;g&&an(g.display_model)==oe.STUDIO&&qt.isStatusPending(g)&&u("answer processing exited",{entryUUID:t,frontendContextUUID:n,timeOnEntryMs:Math.round(performance.now()-a.current)}),a.current=null}},[u,t,n]),h=d.useCallback(()=>{s&&(o.current=performance.now()),a.current||(a.current=performance.now())},[s]);return d.useEffect(()=>{const g=new IntersectionObserver(x=>{x.forEach(v=>{i.current=v.isIntersecting,v.isIntersecting&&document.visibilityState==="visible"?h():p()})},{threshold:r}),y=e.current;return y&&g.observe(y),()=>{y&&g.unobserve(y),p()}},[e,r,h,p]),d.useEffect(()=>{const g=()=>{document.visibilityState==="hidden"?p():document.visibilityState==="visible"&&i.current&&h()};return document.addEventListener("visibilitychange",g),()=>{document.removeEventListener("visibilitychange",g)}},[h,p]),d.useEffect(()=>{const g=()=>{i.current&&o.current&&p()};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[p]),null},aLe=(e,t)=>{const{value:n,loading:r}=zt({flag:"show-site-link-snippets",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},_J=A.memo(({navigationResult:e,trackEvent:t})=>{const{url:n,title:r,snippet:s,domain:o,sitelinks:a=[],site_name:i}=e,c=d.useMemo(()=>(o||Ur(n)).replace(/\.[^.]*$/,""),[o,n]),u=d.useMemo(()=>$c(n),[n]),f=d.useCallback(m=>{t("click citation",{type:"primaryLink",...e})},[t,e]);return l.jsxs(K,{className:"p-md border-subtler mb-md rounded-xl border",variant:"subtler",children:[l.jsxs(yt,{className:"gap-sm border-t-subtlest group flex cursor-pointer flex-col items-stretch",href:n,target:"_self",onClick:f,rel:"noopener",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Po,{size:24,domain:u,className:"flex-shrink-0 rounded-full"}),l.jsxs("div",{className:"flex w-full min-w-0 flex-col leading-[0.875rem]",children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-1 break-words",children:i??c}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"line-clamp-1 truncate break-words leading-[0.875rem]",children:n})]})]}),l.jsx(V,{className:"pt-xs line-clamp-2 break-words",color:"super",variant:"baseSemi",children:r})]}),l.jsx("div",{children:l.jsx(V,{variant:"small",color:"light",className:"line-clamp-2 break-words",children:s})})]},n),l.jsx("div",{className:"mt-sm",children:a.map(m=>l.jsx("div",{className:"border-subtler px-two py-md flex items-center border-t last:pb-0",children:l.jsxs(yt,{href:m.url,className:"flex w-full items-center justify-between",children:[l.jsx(V,{variant:"small",className:"line-clamp-2 leading-none",children:m.title}),l.jsx(V,{variant:"small",color:"light",children:l.jsx(ge,{icon:B("chevron-right")})})]})},m.url))})]})});_J.displayName="MobilePrimaryNavResultCard";const wJ=A.memo(({navigationResult:e,trackEvent:t,queryString:n,entryUUID:r,frontendUUID:s})=>{const{isMobileStyle:o}=Re();return o?l.jsx(_J,{navigationResult:e,trackEvent:t,entryUUID:r,frontendUUID:s}):l.jsx(SJ,{navigationResult:e,trackEvent:t,entryUUID:r,frontendUUID:s,queryString:n})}),CJ=A.memo(({sitelink:e,showSnippet:t,onSiteLinkClick:n})=>{const r=d.useCallback(()=>{n(e.url)},[n,e.url]);return l.jsxs(yt,{href:e.url,target:"_self",className:"flex h-full flex-col justify-start",onClick:r,children:[l.jsx(V,{variant:"smallBold",className:z("break-words hover:underline",t?"line-clamp-2":"line-clamp-1"),color:"super",children:e.title}),t&&l.jsx(V,{variant:"small",className:"line-clamp-1 break-words",color:"light",children:e?.snippet??""})]})});CJ.displayName="SitelinkItem";const SJ=A.memo(({navigationResult:e,trackEvent:t,entryUUID:n,frontendUUID:r,queryString:s})=>{const{sitelinks:o=Pe}=e,{variation:a}=aLe(!1),i=d.useMemo(()=>{if(a)return o;const u=o.length&-2;return o.slice(0,u)},[o,a]),c=d.useCallback(u=>{t("click citation",{source:"navigationalCard",navigationalLinkType:"subLink",citation_url:u,is_comet_navigation:e.is_comet_navigation??!1,frontendUUID:r})},[t,e.is_comet_navigation,r]);return l.jsxs("div",{children:[l.jsx(b6,{navigationResult:e,trackEvent:t,queryString:s,entryUUID:n,frontendUUID:r}),i.length>0&&l.jsx("div",{className:z("gap-x-lg border-subtler pl-md my-sm grid items-stretch gap-y-1 border-l",a?"grid-cols-2":"grid-cols-[0.5fr_1fr]"),children:i.map(u=>l.jsx(CJ,{sitelink:u,showSnippet:a,onSiteLinkClick:c},u.url))})]})});SJ.displayName="DesktopPrimaryNavResultCard";wJ.displayName="PrimaryNavResultCard";const iLe=(e,t,n)=>{const r=e?.sitelinks??Pe;return t===0&&r.length>0},EJ=d.memo(({navResult:e,index:t,isPrimaryCardEnabled:n,trackCitationClickEvent:r,queryStr:s,entryUUID:o,frontendUUID:a,showSiteLinks:i,renderPosition:c,clampSnippet:u,showBottomBorder:f=!0})=>{const{isMobileStyle:m}=Re();return n&&iLe(e,t)?l.jsx(wJ,{navigationResult:e,trackEvent:r,queryString:s,entryUUID:o,frontendUUID:a}):l.jsx(b6,{navigationResult:e,trackEvent:r,queryString:s,entryUUID:o,frontendUUID:a,showSiteLinks:i,showNewMobileCard:m,renderPosition:c,clampSnippet:u,showBottomBorder:f})});EJ.displayName="RedesignedNavResultListItem";const lLe=(e,t)=>{const{value:n,loading:r}=zt({flag:"web-site-links-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},cLe=Ce(async()=>{const{CitationListModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>FN),void 0));return{default:e}}),vl=2,uLe=(e,t,n)=>{if(!e||n||t?.use_default_threshold)return vl;const r=t?.threshold,s=t?.number;if(!r||!s)return vl;const o=e.mhe_predictions_full?.comet_nav_widget?.probability;return o&&o>=r?s:vl},kJ=d.memo(({navResults:e,queryStr:t,querySource:n,backendUUID:r,frontendUUID:s,trackCitationClickEvent:o,onMount:a,shouldRenderPrimaryCard:i=!0,renderPosition:c})=>{const{isMobileStyle:u}=Re(),f=u?i:!1;d.useEffect(()=>{a?.()},[a]);const m=d.useCallback((p,h)=>{o(p,h);const g=n==="default_search",y=h.is_comet_navigation;!(p==="click citation")||!g||!y||Pl("web.frontend.omnisearch_nav_results_clicked")},[o,n]);return l.jsx(MJ,{navResults:e,queryStr:t,backendUUID:r,frontendUUID:s,trackCitationClickEvent:m,isPrimaryCardEnabled:f,renderPosition:c})});kJ.displayName="NavigationResultList";const dLe=7,MJ=d.memo(({navResults:e,queryStr:t,backendUUID:n,frontendUUID:r,trackCitationClickEvent:s,isPrimaryCardEnabled:o,renderPosition:a})=>{const{session:i}=Ne(),{trackEvent:c}=Xe(i),{webResults:u,isEntryInFlight:f}=It(),{isMobileStyle:m}=Re(),{variation:p}=lLe(!1),{openModal:h}=Uo(),{$t:g}=J(),[y,x]=d.useState("none"),v=d.useMemo(()=>Gv.dedupWebResults(u,e,!1),[u,e]),b=d.useMemo(()=>v.slice(0,dLe).map((M,N)=>({url:M.url,title:M.name,snippet:M.snippet||"",domain:M.url?new URL(M.url).hostname:void 0,position:e.length+N,source:"default_search",site_name:M.meta_data?.domain_name||M.meta_data?.citation_domain_name||Ur(M.url),is_comet_navigation:!1,navigation_source:Ld.WEB_RESULTS})),[v,e]),_=d.useMemo(()=>y==="none"?"collapsed":!f&&b.length>0?"expanded":"loading",[y,f,b.length]),w=d.useMemo(()=>_==="collapsed"?e:[...e,...b],[e,b,_]),S=w.length>e.length,C=d.useMemo(()=>{const M=e.length>=vl,N=b.length=vl},[f,S,b.length,v.length,e.length]),E=g(S?{defaultMessage:"See all links",id:"YDWVbhXaX3"}:{defaultMessage:"See more links",id:"A+4zhUZpLQ"}),T=d.useCallback(()=>{h(cLe,{legacyIdentifier:"citationListModal",webResults:u})},[h,u]),k=d.useCallback(()=>{if(S){c("clicked navigation results see all"),T();return}if(c("clicked navigation results see more"),f){x("clicked");return}if(b.length===0){T();return}x("clicked")},[S,c,T,f,b.length]),I=_==="loading"&&!S;return l.jsxs(K,{className:"relative flex flex-col",children:[l.jsx("div",{className:"flex flex-col sm:gap-4",children:w.map((M,N)=>{const j=N===w.length-1&&e.length>=vl&&C&&!S&&m;return l.jsx(EJ,{navResult:M,index:N,isPrimaryCardEnabled:o,trackCitationClickEvent:s,queryStr:t,entryUUID:n??"",frontendUUID:r??"",showSiteLinks:p,renderPosition:a,clampSnippet:j,showBottomBorder:!j},M.url)})}),C&&l.jsxs("div",{className:z("pointer-events-none relative",S?"mt-md":m?"mt-[-4.5rem] pt-[36px]":""),children:[!S&&m&&l.jsx("div",{className:"via-base/80 to-base pointer-events-none absolute inset-0 bg-gradient-to-b from-transparent"}),l.jsx("div",{className:"relative",children:m?l.jsx("div",{className:"bg-base pointer-events-auto w-full rounded-lg",children:l.jsx(wt,{fullWidth:!0,onClick:k,disabled:I,"data-testid":"view-more-button",variant:"tonal",children:E})}):l.jsxs("div",{className:"bg-base mt-sm pointer-events-auto -ml-3 flex items-center",children:[l.jsx(wt,{size:"small",onClick:k,trailingIcon:S?B("chevron-right"):void 0,disabled:I,"data-testid":"view-more-button",variant:"text",children:E}),l.jsx("div",{className:"bg-subtle h-px flex-1"})]})})]})]})});MJ.displayName="RedesignedNavigationResultList";const TJ=e=>{if(e){if(e.app)return e.app.final;if(e.xlsx_file)return e.xlsx_file.final;if(e.doc_file)return e.doc_file.final}},AJ=e=>e.xlsxAsset?.name||e.pdfAsset?.name||e.docxAsset?.name||e.docFileAsset?.name||e.codeFileAsset?.name||e.app?.name||null,uI=(e,t)=>{const n=iW(t),r=AJ(e);return b3(r&&n?`${r}.${n}`:t)},NJ=e=>d.useMemo(()=>{if(!e)return{app:null,pdfAsset:null,docxAsset:null,docFileAsset:null,codeFileAsset:null,chartAsset:null,xlsxAsset:null,quizAsset:null,pdfFileData:null,assetType:null,assetUuid:null};const t=e.pdf_file||null,n=t?{url:t.url,name:t.name||"Document"}:null;let r=e.app;return r&&(r={...r,transforms:r.transforms||[]}),{app:r||null,pdfAsset:t,docxAsset:e.docx_file||null,docFileAsset:e.doc_file||null,codeFileAsset:e.code_file||null,chartAsset:e.chart||null,xlsxAsset:e.xlsx_file||null,quizAsset:e.quiz||null,pdfFileData:n,assetType:e.asset_type,assetUuid:e.uuid}},[e]);function gw(e,t){let n=e;for(const r of t)n=n.replaceAll(r.old_str,r.new_str);return n}function RJ(e){return!!((e?.asset_type===at.APP||e?.asset_type===at.SLIDES)&&e?.app?.transforms&&e.app.transforms.length>0||e?.asset_type===at.XLSX_FILE&&e?.xlsx_file?.transforms&&e.xlsx_file.transforms.length>0||e?.asset_type===at.DOC_FILE&&e?.doc_file?.transforms&&e.doc_file.transforms.length>0)}function Tg(e){return!e?.version_info?.parent_artifact_id||!RJ(e)?!1:TJ(e)===!1}function fLe(e,t){if(e?.version_info?.artifact_id)return t.find(n=>n.version_info?.parent_artifact_id===e.version_info?.artifact_id&&Tg(n))}function mLe(e,t){const n=d.useMemo(()=>fLe(e,t),[e,t]);return d.useMemo(()=>{let r=!1;e?.app?r=!e.app.final:e?.xlsx_file?r=!e.xlsx_file.final:e?.doc_file&&(r=!e.doc_file.final);const s={streamingChild:void 0,hasStreamingChild:!1,transformedContent:"",transforms:[],isStreaming:r,hasTransforms:!1};if(n?.app?.transforms&&e?.app?.source_content){const o=gw(e.app.source_content,n.app.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.app.transforms,isStreaming:!n.app.final,hasTransforms:!0}}if(n?.xlsx_file?.transforms&&e?.xlsx_file?.source_content){const o=gw(e.xlsx_file.source_content,n.xlsx_file.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.xlsx_file.transforms,isStreaming:!n.xlsx_file.final,hasTransforms:!0}}if(n?.doc_file?.transforms&&e?.doc_file?.source_content){const o=gw(e.doc_file.source_content,n.doc_file.transforms);return{streamingChild:n,hasStreamingChild:!0,transformedContent:o,transforms:n.doc_file.transforms,isStreaming:!n.doc_file.final,hasTransforms:!0}}return s},[n,e])}function DJ(e,t){if(!Tg(e))return;const n=e?.version_info?.parent_artifact_id;return t.find(r=>r.version_info?.artifact_id===n)}const jJ=(e,t)=>!e.assetType||!t?null:`/apps/${t}`,pLe=(e,t)=>jJ(e,t)!==null,IJ=e=>e.app!==null,PJ=e=>e.docxAsset===null&&e.pdfFileData!==null,OJ=e=>e.docxAsset!==null,LJ=e=>e.docFileAsset!==null,FJ=e=>e.xlsxAsset!==null,BJ=e=>e.codeFileAsset!==null,UJ=e=>e.chartAsset!==null;function Ag(e){return t=>t?e(t):!1}const VJ=Ag(e=>e.asset_type===at.GENERATED_IMAGE&&e.generated_image!==null),HJ=Ag(e=>e.asset_type===at.GENERATED_VIDEO&&e.generated_video!==null),zJ=Ag(e=>e.asset_type===at.CODE_ASSET&&e.code!==null),WJ=Ag(e=>e.asset_type===at.QUIZ&&e.quiz!==null),GJ=Ag(e=>e.asset_type===at.FLASHCARDS&&e.flashcards!==null);async function hLe(e,t="slides.pptx"){try{const{convertHtmlToPptx:n}=await q(async()=>{const{convertHtmlToPptx:r}=await import("./SlideConverter-DErf2_BF.js");return{convertHtmlToPptx:r}},__vite__mapDeps([152,1,3,4,8,9,6,7,10,11,12]));await n(e,t)}catch(n){throw Z.error("Failed to export slides to PPTX",{error:n}),new Error("Failed to export slides to PowerPoint format")}}const $J=.75,gLe=96,qJ=1920,KJ=1080,xn=e=>e/gLe,Nl=e=>parseFloat(e)*$J,Fs=e=>{if(!e||e==="transparent"||e==="rgba(0, 0, 0, 0)")return"FFFFFF";const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!t){const n=e.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/);if(n&&n[1]){const r=n[1];return r.length===3?r.split("").map(s=>s+s).join("").toUpperCase():r.toUpperCase()}return"000000"}return t.slice(1,4).map(n=>parseInt(n).toString(16).padStart(2,"0")).join("").toUpperCase()},YJ=e=>{if(!e)return null;const t=e.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);if(!t||!t[4])return null;const n=parseFloat(t[4]);return Math.round((1-n)*100)},yLe=.85;function Fbt(){return new Map}function xLe(e){return/(repeating-)?(linear|radial|conic)-gradient\(/.test(e)}function vLe(e){const t=e.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})/);if(t)return t[0];const n=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return n?`rgb(${n[1]}, ${n[2]}, ${n[3]})`:null}function bLe(e,t,n,r){const s=t.match(/linear-gradient\(([^,]+),/);let o=180;if(s?.[1]){const m=s[1].trim();m.includes("deg")?o=parseFloat(m):m==="to top"?o=0:m==="to right"?o=90:m==="to bottom"?o=180:m==="to left"?o=270:m==="to top right"?o=45:m==="to bottom right"?o=135:m==="to bottom left"?o=225:m==="to top left"&&(o=315)}const a=(o-90)*Math.PI/180,i=n/2-Math.cos(a)*n/2,c=r/2-Math.sin(a)*r/2,u=n/2+Math.cos(a)*n/2,f=r/2+Math.sin(a)*r/2;return e.createLinearGradient(i,c,u,f)}function _Le(e,t,n){return e.createRadialGradient(t/2,n/2,0,t/2,n/2,Math.max(t,n)/2)}function wLe(e,t,n,r){const s=t.match(/conic-gradient\(from\s+([\d.]+)deg/),i=((s?.[1]?parseFloat(s[1]):0)-90)*Math.PI/180;return e.createConicGradient(i,n/2,r/2)}function CLe(e,t=qJ,n=KJ,r){const s=`${e}:${t}x${n}`;if(r){const o=r.get(s);if(o)return o}try{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d");if(!a||e.includes("repeating-"))return null;const i=e.includes("linear-gradient"),c=e.includes("radial-gradient"),u=e.includes("conic-gradient");if(!i&&!c&&!u)return null;let f;i?f=bLe(a,e,t,n):c?f=_Le(a,t,n):f=wLe(a,e,t,n);const m=/(rgba?\([^)]+\)|#[0-9A-Fa-f]{3,6})\s+([\d.]+)(deg|%)/g,p=Array.from(e.matchAll(m));if(p.length===0)return null;p.forEach(g=>{const y=g[1],x=g[2],v=g[3];if(!y||!x||!v)return;let b;v==="%"?b=parseFloat(x)/100:b=parseFloat(x)/360,f.addColorStop(Math.max(0,Math.min(1,b)),y)}),a.fillStyle=f,a.fillRect(0,0,t,n);const h=o.toDataURL("image/jpeg",yLe);return r&&r.set(s,h),h}catch{return null}}const SLe=(e,t,n)=>{const r=(e.ownerDocument.defaultView||window).getComputedStyle(e),s=r.backgroundImage;let o=r.backgroundColor;if((o==="rgba(0, 0, 0, 0)"||o==="transparent")&&e.className.includes("bg-")){const a=e.className.match(/bg-(\w+)/);if(a){const i=a[0],c=t.querySelectorAll("style");let u="";c.forEach(f=>{const m=f.textContent||"",p=Array.from(m.matchAll(/--color-(\w+):\s*([^;]+);/g)),h={};for(const x of p)h[`--color-${x[1]}`]=x[2]?.trim()||"";const g=new RegExp(`\\.${i}\\s*{[^}]*background-color:\\s*([^;]+);`,"s"),y=m.match(g);if(y){let x=y[1]?.trim()||"";if(x.startsWith("var(")){const v=x.match(/var\((--[^)]+)\)/)?.[1];v&&h[v]&&(x=h[v])}if(x.startsWith("#")){let v=x.substring(1);v.length===3&&(v=v.split("").map(S=>S+S).join(""));const b=parseInt(v.substring(0,2),16),_=parseInt(v.substring(2,4),16),w=parseInt(v.substring(4,6),16);u=`rgb(${b}, ${_}, ${w})`}else u=x}}),u&&(o=u)}}if(s&&s!=="none")if(xLe(s)){const a=e.getBoundingClientRect(),i=Math.round(a.width)||qJ,c=Math.round(a.height)||KJ,u=CLe(s,i,c,n);if(u)return{gradient:u};{const f=vLe(s);f&&(o=f)}}else{const a=s.match(/url\(["']?([^"')]+)["']?\)/);if(a&&a[1])return{path:a[1]}}return{color:Fs(o)}},Rl=e=>(e.ownerDocument.defaultView||window).getComputedStyle(e),ELe=e=>((e||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),kLe=e=>e==="bold"||parseInt(e||"400")>=600,MLe=e=>e==="italic",ME=e=>{const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return!t||!t[1]||!t[2]||!t[3]?null:{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3]),a:t[4]?parseFloat(t[4]):1}},TLe=(e,t)=>{const n=ME(e),r=ME(t);if(!n||!r)return null;const s=Math.round(n.r*n.a+r.r*(1-n.a)),o=Math.round(n.g*n.a+r.g*(1-n.a)),a=Math.round(n.b*n.a+r.b*(1-n.a));return Fs(`rgb(${s}, ${o}, ${a})`)},TE=e=>!!e&&e!=="rgba(0, 0, 0, 0)"&&e!=="transparent",ALe=(e,t)=>{for(const n of e){const r=n.backgroundColor;if(TE(r)){const s=ME(r);return s&&s.a<1?TLe(r,t)??void 0:Fs(r)}}},NLe=e=>{if(e.borderBottomWidth&&parseFloat(e.borderBottomWidth)>0){const t={type:"none"},n={pt:parseFloat(e.borderBottomWidth),color:Fs(e.borderBottomColor)};return[t,t,n,t]}},RLe=e=>{if(!e||e==="none"||e.match(/inset/))return null;const n=e.match(/rgba?\([^)]+\)/),r=e.match(/([-\d.]+)(px|pt)/g);if(!r||r.length<2)return null;const s=parseFloat(r[0]),o=parseFloat(r[1]||"0"),a=r.length>2?parseFloat(r[2]||"0"):0;let i=0;(s!==0||o!==0)&&(i=Math.atan2(o,s)*(180/Math.PI),i<0&&(i+=360));const c=Math.sqrt(s*s+o*o)*$J;let u=.5;if(n){const f=n[0].match(/[\d.]+\)$/);f&&(u=parseFloat(f[0].replace(")","")))}return{type:"outer",angle:Math.round(i),blur:a*.75,color:n?Fs(n[0]):"000000",offset:c,opacity:u}},AE=(e,t={})=>{const n=[];let r=!1;e.childNodes.forEach(o=>{const a=o.nodeType===Node.TEXT_NODE||o.tagName==="BR";if(a){const i=o.tagName==="BR"?` -`:(o.nodeValue||o.textContent||"").replace(/\s+/g," "),c=n[n.length-1];r&&c&&c.text?c.text+=i:n.push({text:i,options:{...t}})}else if(o.nodeType===Node.ELEMENT_NODE&&o.textContent?.trim()){const i=o,c={...t},u=(i.ownerDocument.defaultView||window).getComputedStyle(i);if(["SPAN","B","STRONG","I","EM","U"].includes(i.tagName)){if((u.fontWeight==="bold"||parseInt(u.fontWeight)>=600)&&(c.bold=!0),u.fontStyle==="italic"&&(c.italic=!0),u?.textDecoration?.includes("underline")&&(c.underline={style:"sng"}),u.color&&u.color!=="rgb(0, 0, 0)"){c.color=Fs(u.color);const m=YJ(u.color);m!==null&&(c.transparency=m)}u?.fontSize&&(c.fontSize=Nl(u.fontSize)),AE(i,c).forEach(m=>n.push(m))}}r=a});const s=n?.[0];if(s&&s.text){s.text=s.text.replace(/^\s+/,"");const o=n?.[n.length-1];o&&o.text&&(o.text=o.text.replace(/\s+$/,""))}return n.filter(o=>o.text&&o.text.length>0)},DLe=e=>{if(e.display==="flex"){const t=e.alignItems;if(t==="center")return"middle";if(t==="flex-end")return"bottom"}else{const t=e.verticalAlign;if(t==="middle")return"middle";if(t==="bottom")return"bottom"}return"top"},jLe=e=>{const t=e.textAlign,n=e.direction;return t==="left"||t==="right"||t==="center"||t==="justify"?t:t==="start"?n==="rtl"?"right":"left":t==="end"?n==="rtl"?"left":"right":"center"},ILe=e=>{const t=e.whiteSpace;return!(t==="nowrap"||t==="pre")},PLe=e=>{const t=e.overflow,n=e.textOverflow;return t==="hidden"&&n==="ellipsis"?"none":"shrink"},OLe=e=>{const t=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,r=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingBottom)||0,o=Math.max(t,n,r,s);return Nl(o.toString())},LLe=e=>({fontSize:Nl(e.fontSize),fontFace:((e.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(e.color),bold:e?.fontWeight==="bold"||parseInt(e?.fontWeight||"400")>=600,italic:e?.fontStyle==="italic",align:jLe(e),valign:DLe(e),wrap:ILe(e),margin:OLe(e),fit:PLe(e)}),FLe=e=>{const t=[];return e.querySelectorAll(".placeholder").forEach(n=>{const r=n.getBoundingClientRect(),s=e.getBoundingClientRect();t.push({id:n.id||`placeholder-${t.length}`,x:xn(r.left-s.left),y:xn(r.top-s.top),w:xn(r.width),h:xn(r.height)})}),t},BLe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("IMG").forEach(s=>{if(t.has(s))return;const o=s,a=s.getBoundingClientRect();a.width>0&&a.height>0&&(n.push({type:"image",src:o.src,position:{x:xn(a.left-r.left),y:xn(a.top-r.top),w:xn(a.width),h:xn(a.height)}}),t.add(s))}),n},ULe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("DIV, SPAN").forEach(s=>{if(t.has(s))return;const o=(s.ownerDocument.defaultView||window).getComputedStyle(s),a=o.backgroundColor&&o.backgroundColor!=="rgba(0, 0, 0, 0)",i=parseFloat(o.borderWidth)>0;if(a||i){const c=s.getBoundingClientRect();if(c.width>0&&c.height>0){const u=o.boxShadow?RLe(o.boxShadow):null,f=parseFloat(o.borderRadius)||0;let m="",p=!1,h;Array.from(s.children).length>0||(m=s.textContent?.trim()||"",p=m.length>0,p&&(h=LLe(o))),n.push({type:"shape",text:m,position:{x:xn(c.left-r.left),y:xn(c.top-r.top),w:xn(c.width),h:xn(c.height)},style:h,shape:{fill:a?Fs(o.backgroundColor):null,transparency:a&&o.backgroundColor?YJ(o.backgroundColor):null,line:i?{color:Fs(o.borderColor),width:Nl(o.borderWidth)}:null,rectRadius:f>0?f/10:0,shadow:u}}),p&&t.add(s)}}}),n},VLe=e=>{if(!e.textContent?.trim())return!1;const n=e.parentElement;return!(n&&["P","H1","H2","H3","H4","H5","H6","LI","SPAN"].includes(n.tagName))},HLe=e=>{if(!e.textContent?.trim())return!1;let n=!1;if(e.childNodes.forEach(o=>{o.nodeType===Node.TEXT_NODE&&o.textContent?.trim()&&(n=!0)}),!n)return!1;const r=e.parentElement;return!(r&&["P","H1","H2","H3","H4","H5","H6","LI","SPAN"].includes(r.tagName)||e.querySelectorAll("P, H1, H2, H3, H4, H5, H6, UL, OL, DIV, SPAN").length>0)},zLe=(e,t)=>{const n=[],r=e.getBoundingClientRect();return e.querySelectorAll("P, H1, H2, H3, H4, H5, H6, UL, OL, SPAN, DIV").forEach(s=>{if(t.has(s)||s.tagName==="SPAN"&&!VLe(s)||s.tagName==="DIV"&&!HLe(s))return;const o=(s.ownerDocument.defaultView||window).getComputedStyle(s),a=s.getBoundingClientRect();if(a.width>0&&a.height>0){const i=Nl(o.fontSize),c=parseFloat(o.lineHeight)||i*1.2;if(s.tagName==="UL"||s.tagName==="OL"){const u=Array.from(s.querySelectorAll("li")),f=[];u.forEach((m,p)=>{const h=p===u.length-1,g=AE(m);if(g.length>0){const y=g[0];if(!y)return;if(y.text&&(y.text=y.text.replace(/^[•\-*▪▸]\s*/,"")),y.options||(y.options={}),y.options.bullet=!0,!h){const x=g[g.length-1];if(!x)return;x.options||(x.options={}),x.options.breakLine=!0}f.push(...g)}t.add(m)}),f.length>0&&(n.push({type:"list",items:f,position:{x:xn(a.left-r.left),y:xn(a.top-r.top),w:xn(a.width),h:xn(a.height)},style:{fontSize:i,fontFace:((o.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(o.color),align:o.textAlign,lineSpacing:Nl(c.toString()),margin:0}}),t.add(s))}else{const u=AE(s),f=u.length===1?u[0]?.text:u,m=a.height<=c*1.5;let p=xn(a.left-r.left),h=xn(a.width);if(m){const g=a.width*.02,y=o.textAlign;y==="center"?(p=xn(a.left-r.left-g/2),h=xn(a.width+g)):(y==="right"&&(p=xn(a.left-r.left-g)),h=xn(a.width+g))}n.push({type:s.tagName.toLowerCase(),text:f,position:{x:p,y:xn(a.top-r.top),w:h,h:xn(a.height)},style:{fontSize:i,fontFace:((o.fontFamily||"Arial").split(",")[0]||"Arial").replace(/['"]/g,"").trim(),color:Fs(o.color),bold:o?.fontWeight==="bold"||parseInt(o?.fontWeight||"400")>=600,italic:o?.fontStyle==="italic",underline:o?.textDecoration?.includes("underline")?{style:"sng"}:void 0,align:o.textAlign,lineSpacing:Nl(c.toString()),margin:0}}),t.add(s)}}}),n},WLe=e=>{const t=[];if(Array.from(e.children).length>0&&e.childNodes.forEach(r=>{if(r.nodeType===Node.TEXT_NODE){const s=r.textContent?.trim();if(s){const o=Rl(e);t.push({text:s,options:{color:Fs(o.color)}})}}else if(r.nodeType===Node.ELEMENT_NODE){const s=r,o=s.textContent?.trim();if(o){const a=Rl(s);t.push({text:o,options:{color:Fs(a.color)}})}}}),t.length===0){const r=e.textContent?.trim();if(r){const s=Rl(e);t.push({text:r,options:{color:Fs(s.color)}})}}return t},yw=(e,t,n)=>{const r=[];return e.forEach(s=>{const o=[],a=Rl(s);s.querySelectorAll("th, td").forEach(i=>{const c=i;o.push(GLe(c,a,t,n))}),o.length>0&&r.push(o)}),r},GLe=(e,t,n,r)=>{const s=Rl(e),a={text:WLe(e),options:{fontSize:Nl(s.fontSize),fontFace:ELe(s.fontFamily),bold:kLe(s.fontWeight),italic:MLe(s.fontStyle),align:s.textAlign||"left",valign:"middle"}},i=ALe([s,t,n].filter(u=>u!==null),r);i&&a.options&&(a.options.fill={color:i});const c=NLe(s);return c&&a.options&&(a.options.border=c),a},$Le=(e,t)=>{const n=[],r=e.getBoundingClientRect(),s=Rl(e),o=TE(s.backgroundColor)?s.backgroundColor:"rgb(255, 255, 255)";return e.querySelectorAll("TABLE").forEach(a=>{if(t.has(a))return;const i=a,c=a.getBoundingClientRect();if(c.width>0&&c.height>0){const u=[],f=i.parentElement,m=f?Rl(f):null,p=m&&TE(m.backgroundColor)?m.backgroundColor:o,h=i.querySelectorAll("thead tr"),g=i.querySelector("thead"),y=g?Rl(g):null;u.push(...yw(h,y,p));const x=i.querySelectorAll("tbody tr");if(u.push(...yw(x,null,p)),u.length===0){const v=i.querySelectorAll(":scope > tr");u.push(...yw(v,null,p))}u.length>0&&(n.push({type:"table",rows:u,position:{x:xn(c.left-r.left),y:xn(c.top-r.top),w:xn(c.width),h:xn(c.height)}}),t.add(a),i.querySelectorAll("*").forEach(v=>t.add(v)))}}),n};function dI(e,t,n){const r=[],s=new Set,o=SLe(e,t,n),a=FLe(e);a.forEach(p=>{const h=e.querySelector(`#${p.id}`);h&&s.add(h)});const i=ULe(e,s),c=BLe(e,s),u=$Le(e,s),f=zLe(e,s),m=[...i,...c,...u,...f];return{background:o,elements:m,placeholders:a,errors:r}}const QJ=` -/* ========== CSS Variables ========== */ -:root { - /* Typography */ - --font-family-display: Arial, sans-serif; - --font-weight-display: 600; - --font-family-content: Arial, sans-serif; - --font-weight-content: 400; - --font-size-content: 16px; - --line-height-content: 1.4; - - /* Colors - Surface */ - --color-surface: #ffffff; - --color-surface-foreground: #1d1d1d; - - /* Colors - Primary */ - --color-primary: #1791e8; - --color-primary-light: #3ba1ec; - --color-primary-dark: #1581d4; - --color-primary-foreground: #fafafa; - - /* Colors - Secondary */ - --color-secondary: #f5f5f5; - --color-secondary-foreground: #171717; - - /* Colors - Utility */ - --color-muted: #f5f5f5; - --color-muted-foreground: #737373; - --color-accent: #f5f5f5; - --color-accent-foreground: #171717; - --color-border: #c8c8c8; - - /* Spacing & Layout */ - --spacing: 0.25rem; - --gap: calc(var(--spacing) * 4); - --radius: 0.4rem; - --radius-pill: 999em; -} - -/* ========== Base Reset ========== */ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -/* ========== Slide Container ========== */ -section.slide { - width: 960px !important; - height: 540px !important; - overflow: hidden; - font-family: var(--font-family-content); - font-weight: var(--font-weight-content); - font-size: var(--font-size-content); - line-height: var(--line-height-content); - color: var(--color-surface-foreground); - background: var(--color-surface); - display: flex; - margin: 0; - padding: 0; - position: relative; -} - -/* Body for single slide mode */ -body { - width: 960px; - height: 540px; - overflow: hidden; - font-family: var(--font-family-content); - font-weight: var(--font-weight-content); - font-size: var(--font-size-content); - line-height: var(--line-height-content); - color: var(--color-surface-foreground); - background: var(--color-surface); - display: flex; - margin: 0; - padding: 0; -} - -/* ========== Typography ========== */ -h1, h2, h3, h4, h5, h6 { - font-family: var(--font-family-display); - font-weight: var(--font-weight-display); - line-height: 1.2; - margin: 0; -} - -h1 { font-size: 3rem; } -h2 { font-size: 2.25rem; } -h3 { font-size: 1.875rem; } -h4 { font-size: 1.5rem; } -h5 { font-size: 1.25rem; } -h6 { font-size: 1.125rem; } - -p { margin: 0; } - -ul, ol { - margin: 0; - padding-left: 1.5em; -} - -li { - margin: 0.25em 0; -} - -/* ========== Layout System ========== */ - -/* Container Classes */ -.row { - display: flex; - flex-direction: row; - align-items: center; - justify-content: stretch; -} - -.col { - display: flex; - flex-direction: column; - align-items: stretch; - justify-content: center; -} - -/* Flex Item Behavior */ -.fill-width { - flex: 1; - align-self: stretch; -} - -.fill-height { - flex: 1; - align-self: stretch; -} - -.row .fill-width { - flex: 1; -} - -.col .fill-height { - flex: 1; -} - -.items-fill-width > * { - flex: 1; - align-self: stretch; -} - -.items-fill-height > * { - flex: 1; - align-self: stretch; -} - -.fit { - flex: none; - align-self: auto; -} - -.fit-width { - flex: none; -} - -.fit-height { - flex: none; -} - -/* ========== Alignment ========== */ - -/* Container alignment */ -.center { - align-items: center; - justify-content: center; -} - -.start { - align-items: flex-start; - justify-content: flex-start; -} - -.end { - align-items: flex-end; - justify-content: flex-end; -} - -.stretch { - align-items: stretch; - justify-content: stretch; -} - -.between { - justify-content: space-between; -} - -.around { - justify-content: space-around; -} - -.evenly { - justify-content: space-evenly; -} - -/* Self alignment */ -.self-center { - align-self: center; -} - -.self-start { - align-self: flex-start; -} - -.self-end { - align-self: flex-end; -} - -.self-stretch { - align-self: stretch; -} - -/* ========== Spacing ========== */ - -/* Padding */ -.p-0 { padding: 0; } -.p-2 { padding: calc(var(--spacing) * 2); } -.p-4 { padding: calc(var(--spacing) * 4); } -.p-6 { padding: calc(var(--spacing) * 6); } -.p-8 { padding: calc(var(--spacing) * 8); } -.p-12 { padding: calc(var(--spacing) * 12); } -.p-16 { padding: calc(var(--spacing) * 16); } -.p-24 { padding: calc(var(--spacing) * 24); } -.p-32 { padding: calc(var(--spacing) * 32); } - -/* Gap */ -.gap-0 { gap: 0; } -.gap-xs { gap: calc(var(--spacing) * 2); } -.gap-sm { gap: calc(var(--spacing) * 4); } -.gap-md { gap: calc(var(--spacing) * 8); } -.gap-lg { gap: calc(var(--spacing) * 16); } -.gap-xl { gap: calc(var(--spacing) * 24); } -.gap-2xl { gap: calc(var(--spacing) * 32); } - -/* ========== Colors ========== */ - -/* Background colors */ -.bg-primary { - background-color: var(--color-primary); - color: var(--color-primary-foreground); -} - -.bg-secondary { - background-color: var(--color-secondary); - color: var(--color-secondary-foreground); -} - -.bg-muted { - background-color: var(--color-muted); - color: var(--color-muted-foreground); -} - -.bg-accent { - background-color: var(--color-accent); - color: var(--color-accent-foreground); -} - -/* Text colors */ -.text-primary { - color: var(--color-primary); -} - -.text-muted { - color: var(--color-muted-foreground); -} - -/* ========== Utilities ========== */ - -.rounded { - border-radius: var(--radius); -} - -.rounded-lg { - border-radius: calc(var(--radius) * 2); -} - -.rounded-full { - border-radius: var(--radius-pill); -} - -.shadow { - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); -} - -.shadow-lg { - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); -} - -.border { - border: 1px solid var(--color-border); -} - -/* Text alignment */ -.text-left { text-align: left; } -.text-center { text-align: center; } -.text-right { text-align: right; } -.text-justify { text-align: justify; } - -/* Font sizes */ -.text-xs { font-size: 0.75rem; } -.text-sm { font-size: 0.875rem; } -.text-base { font-size: 1rem; } -.text-lg { font-size: 1.125rem; } -.text-xl { font-size: 1.25rem; } -.text-2xl { font-size: 1.5rem; } -.text-3xl { font-size: 1.875rem; } -.text-4xl { font-size: 2.25rem; } -.text-5xl { font-size: 3rem; } - -/* Font weights */ -.font-normal { font-weight: 400; } -.font-medium { font-weight: 500; } -.font-semibold { font-weight: 600; } -.font-bold { font-weight: 700; } - -/* Display */ -.hidden { display: none; } -.block { display: block; } -.inline { display: inline; } -.inline-block { display: inline-block; } -.flex { display: flex; } -`;function fI(e,t,n){"gradient"in e.background?t.addImage({data:e.background.gradient,x:0,y:0,w:"100%",h:"100%"}):t.background=e.background;for(const r of e.elements)switch(r.type){case"table":{r.rows&&r.rows.length>0&&t.addTable(r.rows,{x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,autoPage:!1,border:{type:"none"}});break}case"image":{t.addImage({path:r.src,x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h});break}case"shape":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h};r.shape&&r.shape.rectRadius>0?(s.shape=n.ShapeType.roundRect,s.rectRadius=r.shape.rectRadius):s.shape=n.ShapeType.rect,r.shape?.fill&&(s.fill={color:r.shape.fill},r.shape.transparency!=null&&(s.fill.transparency=r.shape.transparency)),r.shape?.line&&(s.line=r.shape.line),r.shape?.shadow&&(s.shadow=r.shape.shadow),r.style&&(r.style.fontSize&&(s.fontSize=r.style.fontSize),r.style.fontFace&&(s.fontFace=r.style.fontFace),r.style.color&&(s.color=r.style.color),r.style.bold&&(s.bold=r.style.bold),r.style.italic&&(s.italic=r.style.italic),r.style.align&&(s.align=r.style.align),r.style.valign&&(s.valign=r.style.valign)),s.wrap=r.style?.wrap??!1,s.fit=r.style?.fit??"shrink",s.margin=r.style?.margin??0,t.addText(r.text||"",s);break}case"list":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,align:r.style?.align,valign:"top",lineSpacing:r.style?.lineSpacing,margin:r.style?.margin};t.addText(r.items??"",s);break}case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,bold:r.style?.bold,italic:r.style?.italic,underline:r.style?.underline,valign:"top",align:r.style?.align,lineSpacing:r.style?.lineSpacing,inset:0};t.addText(r.text??"",s);break}default:{const s={x:r.position.x,y:r.position.y,w:r.position.w,h:r.position.h,fontSize:r.style?.fontSize,fontFace:r.style?.fontFace,color:r.style?.color,bold:r.style?.bold,italic:r.style?.italic,underline:r.style?.underline,valign:"top",align:r.style?.align,lineSpacing:r.style?.lineSpacing,inset:0};t.addText(r.text??"",s)}}}const Bbt="exported-slides.pptx",qLe=300,KLe=100,YLe="section.slide";async function mI(e,t,n,r=!1){const s=t.querySelectorAll(YLe);if(s.length>0)for(let o=0;ou.type!=="image")});const c=e.addSlide();fI(i,c,e)}else{const o=n.createElement("section");o.className="slide",o.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(o);const a=n.createElement("style");a.textContent=QJ,t.insertBefore(a,t.firstChild),await new Promise(u=>setTimeout(u,KLe));let i=dI(o,t);r&&(i={...i,elements:i.elements.filter(u=>u.type!=="image")});const c=e.addSlide();fI(i,c,e)}}async function QLe(e){const t=document.createElement("iframe");t.style.cssText=` - position: fixed !important; - left: -10000px !important; - top: -10000px !important; - width: 1920px !important; - height: 1080px !important; - border: none !important; - visibility: hidden !important; - pointer-events: none !important; - opacity: 0 !important; - display: block !important; - `,t.setAttribute("aria-hidden","true"),document.body.appendChild(t);try{const n=t.contentDocument||t.contentWindow?.document;if(!n)throw new Error("Failed to access iframe document");n.body||(n.write(""),n.close());const r=n.createElement("div");if(r.style.cssText=` - width: 1920px; - height: 1080px; - `,n.body.appendChild(r),r.innerHTML=e,!r.querySelector("style")){const o=n.createElement("style");o.textContent=QJ,r.insertBefore(o,r.firstChild)}await new Promise(o=>setTimeout(o,qLe));let s=new(await q(async()=>{const{default:o}=await import("./pptxgen.es-RTyDt0G5.js");return{default:o}},__vite__mapDeps([153,1]))).default;s.layout="LAYOUT_16x9",s.author="Perplexity",s.title="Converted Presentation",s.company="Perplexity AI";try{return await mI(s,r,n,!1),await s.write({outputType:"blob"})}catch{return s=new(await q(async()=>{const{default:i}=await import("./pptxgen.es-RTyDt0G5.js");return{default:i}},__vite__mapDeps([153,1]))).default,s.layout="LAYOUT_16x9",s.author="Perplexity",s.title="Converted Presentation",s.company="Perplexity AI",await mI(s,r,n,!0),await s.write({outputType:"blob"})}}finally{t.parentNode&&document.body.removeChild(t)}}function XLe(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(typeof r.result=="string"){const s=r.result.split(",")[1];s?t(s):n(new Error("Failed to extract base64 from data URL"))}else n(new Error("Failed to convert blob to base64"))},r.onerror=n,r.readAsDataURL(e)})}async function pI({htmlContent:e,filename:t,saveFile:n}){const r=await QLe(e);if(!r)throw new Error("Failed to generate PPTX file");const s=await XLe(r),o=t.endsWith(".pptx")?t:`${t}.pptx`;return{webViewLink:(await n({fileName:o,fileBytes:s,mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation",connectionType:"GOOGLE_DRIVE"})).web_view_link}}const ZLe={xlsx:B("file-type-xls"),csv:B("file-type-csv"),pdf:B("file-type-pdf"),docx:B("file-type-doc"),pptx:B("file-type-ppt")},JLe={xlsx:"XLSX",csv:"CSV",pdf:"PDF",docx:"DOCX",pptx:"PPTX",md:"Markdown",png:"Image",jpg:"Image",jpeg:"Image"};function eFe(e){return e?ZLe[e.toLowerCase()]??B("download"):B("download")}function tFe(e,t){if(!t)return hI(e);const n=t.toLowerCase();return JLe[n]??hI(e)}function hI(e){return e==="SLIDES"||e==="APP"?"HTML":"File"}const nFe=({reason:e})=>{const{$t:t}=J(),{openToast:n}=hn(),r=d.useCallback(async s=>{try{const o=await Pz({name:s,reason:e,autoClose:!0});if(!o)return n({message:t({defaultMessage:"Unable to start authentication.",id:"7sb7u3pWWr"}),variant:"error",timeout:3}),!1;const a=600,i=700,c=window.screenX+(window.outerWidth-a)/2,u=window.screenY+(window.outerHeight-i)/2,f=window.open(o,"oauth-popup",`width=${a},height=${i},left=${c},top=${u},popup=yes,noopener=no`);return f?new Promise(m=>{const p=setInterval(()=>{f.closed&&(clearInterval(p),Z.info("OAuth popup closed",{connectorName:s,reason:e}),m(!0))},500);setTimeout(()=>{clearInterval(p),f.closed||(f.close(),Z.warn("OAuth popup timeout",{connectorName:s,reason:e}),m(!1))},300*1e3)}):(n({message:t({defaultMessage:"Please allow popups to connect your account.",id:"gMeARpuir7"}),variant:"error",timeout:3}),!1)}catch(o){return Z.error("Failed to start OAuth flow",{error:o,connectorName:s,reason:e}),n({message:t({defaultMessage:"Failed to connect account. Please try again.",id:"l9HkZMlKDR"}),variant:"error",timeout:3}),!1}},[e,t,n]);return d.useMemo(()=>({startOAuthFlow:r}),[r])},rFe=({reason:e})=>{const[t,n]=d.useState(!1),r=d.useCallback(async s=>{n(!0);try{const{data:o,error:a}=await de.POST("/rest/connectors/save-file",e,{body:{file_name:s.fileName,s3_url:s.s3Url,file_bytes:s.fileBytes,mime_type:s.mimeType,connection_type:s.connectionType,parent_remote_id:s.parentRemoteId},timeoutMs:Qe()});if(a){Z.error("Failed to save file to connector",{error:a,request:s,errorMessage:a instanceof Error?a.message:"Unknown error"});const i=a.detail;return{success:!1,errorCode:i?.error_code,errorMessage:i?.error_message||"Failed to save file"}}return o?{success:o.success,webViewLink:o.web_view_link??void 0,errorCode:o.error_code??void 0,errorMessage:o.error_message??void 0}:{success:!1,errorMessage:"No response from server"}}catch(o){return Z.error("Unexpected error saving file to connector",{err:o,request:s,errorMessage:o instanceof Error?o.message:"Unknown error"}),{success:!1,errorMessage:o instanceof Error?o.message:"Unknown error"}}finally{n(!1)}},[e]);return d.useMemo(()=>({saveFile:r,isLoading:t}),[r,t])};function sFe({asset:e,assetResult:t}){const n=NJ(e),r=[],{session:s}=Ne(),{trackEvent:o}=Xe(s),{$t:a}=J(),{openToast:i}=hn(),[c,u]=d.useState(!1),f=Wt(),{downloadS3Asset:m}=pJ({reason:"canvas-pdf-download"}),{saveFile:p}=rFe({reason:"canvas-export-to-drive"}),{startOAuthFlow:h}=nFe({reason:"canvas-export-to-drive"}),g=d.useCallback(async v=>{if(!c){u(!0);try{const b=uI(n,v.filename??"download");let _=await p({fileName:b,s3Url:v.url,connectionType:"GOOGLE_DRIVE"});if(_.errorCode==="MISSING_SCOPE"||_.errorCode==="ACCOUNT_NOT_CONNECTED"||_.errorCode==="AUTH_ERROR")if(await h("google_drive"))_=await p({fileName:b,s3Url:v.url,connectionType:"GOOGLE_DRIVE"});else return;if(_.success&&_.webViewLink)t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"File exported to Google Drive",id:"FDX8mJLmJm"}),variant:"success",timeout:3}),window.open(_.webViewLink,"_blank");else{let w=a({defaultMessage:"Failed to export file",id:"5/D0jskfku"});_.errorCode==="FILE_TOO_LARGE"?w=a({defaultMessage:"File exceeds 20MB limit for export",id:"UZ4y2AORv5"}):_.errorMessage&&(w=_.errorMessage),i({message:w,variant:"error",timeout:3}),Z.error("Failed to export file to Drive",{errorCode:_.errorCode,errorMessage:_.errorMessage,fileName:v.filename})}}catch(b){Z.error("Unexpected error during export",{error:b,info:v}),i({message:a({defaultMessage:"Failed to export file",id:"5/D0jskfku"}),variant:"error",timeout:3})}finally{u(!1)}}},[n,c,p,h,t,e,o,a,i]),y=d.useCallback(async(v,b)=>{if(!c){u(!0);try{const _=await pI({htmlContent:v,filename:b,saveFile:async w=>{const S=await p({...w});if(!S.success)throw new Error(`Export failed: ${S.errorCode??"unknown error"}${S.errorMessage?` - ${S.errorMessage}`:""}`);return{web_view_link:S.webViewLink??""}}});t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"Slides exported to Google Drive",id:"efsXWg4g3j"}),variant:"success",timeout:3}),window.open(_.webViewLink,"_blank")}catch(_){if(_ instanceof Error&&(_.message.includes("MISSING_SCOPE")||_.message.includes("ACCOUNT_NOT_CONNECTED")||_.message.includes("AUTH_ERROR")))if(await h("google_drive"))try{const S=await pI({htmlContent:v,filename:b,saveFile:async C=>{const E=await p({...C});if(!E.success)throw new Error(`Export failed: ${E.errorCode??"unknown error"}${E.errorMessage?` - ${E.errorMessage}`:""}`);return{web_view_link:E.webViewLink??""}}});t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"export"}),i({message:a({defaultMessage:"Slides exported to Google Drive",id:"efsXWg4g3j"}),variant:"success",timeout:3}),window.open(S.webViewLink,"_blank");return}catch(S){Z.error("Failed to export slides after OAuth",{error:S})}else return;i({message:_ instanceof Error&&_.message?_.message:a({defaultMessage:"Failed to export slides",id:"W62bIrXvad"}),variant:"error",timeout:3}),Z.error("Failed to export slides to Drive",{error:_})}finally{u(!1)}}},[c,p,h,t,e,o,a,i]);if(GOe(e)&&IJ(n)&&n.app.source_content){const v=AJ(n)||"slides",b=b3(`${v}.pptx`);r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Download as PPTX",id:"MbQGjmBtrT"}),icon:B("file-type-ppt"),category:"download",onClick:async()=>{t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"download"});try{await hLe(n.app.source_content,b)}catch{}}}),f&&r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Export PPTX to GDrive",id:"vxG0vz9KXW"}),icon:B("brand-google-drive"),category:"export",onClick:()=>{y(n.app.source_content,v)}})}return e?.download_info&&e.download_info.length>0&&e.download_info.forEach(v=>{if(!v.url||!Ux(v.url))return;const b=iW(v.filename),_=eFe(b),w=tFe(e.asset_type,b),S=uI(n,v.filename??"download");r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Download as {fileType}",id:"PJh4v0uaV6"},{fileType:w}),icon:_,category:"download",onClick:()=>{t&&e&&o("canvas content downloaded",{entryUUID:t.backend_uuid,contentType:e.asset_type,assetUUID:e.uuid,downloadType:"download"}),m({url:v.url,filename:S})}}),v.is_exportable&&f&&r.push({type:"default",downloadType:"trigger",text:a({defaultMessage:"Export {fileType} to GDrive",id:"IHrc/RdUMs"},{fileType:w}),icon:B("brand-google-drive"),category:"export",onClick:()=>{g(v)}})}),r}function oFe(e,t,n){return e?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.app?.url??null,name:t.app?.name??null,isFinal:n.streamingChild?.app?.final??!1,isStreaming:n.isStreamingChildActive}:IJ(t)?{final:t.app.source_content??null,url:t.app.url??null,name:t.app.name??null,isFinal:t.app.final??!1,isStreaming:!t.app.final}:FJ(t)?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.xlsxAsset.url??null,name:t.xlsxAsset.name??null,isFinal:n.streamingChild?.xlsx_file?.final??!1,isStreaming:n.isStreamingChildActive}:{final:t.xlsxAsset.source_content??null,url:t.xlsxAsset.url??null,name:t.xlsxAsset.name??null,isFinal:t.xlsxAsset.final??!1,isStreaming:!t.xlsxAsset.final}:PJ(t)?{final:t.pdfFileData?.url??null,url:t.pdfFileData?.url??null,name:t.pdfFileData?.name??null,isFinal:!0,isStreaming:!1}:OJ(t)?{final:t.docxAsset.url??null,url:t.docxAsset.url??null,name:t.docxAsset.name??null,isFinal:!0,isStreaming:!1}:LJ(t)?n.hasStreamingChild&&n.transformedContent?{final:n.transformedContent,url:t.docFileAsset.url??null,name:t.docFileAsset.name??null,isFinal:n.streamingChild?.doc_file?.final??!1,isStreaming:n.isStreamingChildActive}:{final:t.docFileAsset.source_content??null,url:t.docFileAsset.url??null,name:t.docFileAsset.name??null,isFinal:t.docFileAsset.final??!1,isStreaming:!t.docFileAsset.final}:UJ(t)?{final:t.chartAsset.url??null,url:t.chartAsset.url??null,name:null,isFinal:!0,isStreaming:!1}:BJ(t)?{final:null,url:null,name:t.codeFileAsset.filename??null,isFinal:!0,isStreaming:!1}:zJ(e)?{final:e.code.script??null,url:null,name:null,isFinal:!0,isStreaming:!1}:VJ(e)?{final:e.generated_image.url??null,url:e.generated_image.url??null,name:null,isFinal:!0,isStreaming:!1}:HJ(e)?{final:e.generated_video.url??null,url:e.generated_video.url??null,name:null,isFinal:!0,isStreaming:!1}:WJ(e)?{final:null,url:null,name:e.quiz.title??null,isFinal:!0,isStreaming:!1}:GJ(e)?{final:null,url:null,name:e.flashcards.title??null,isFinal:!0,isStreaming:!1}:{final:null,url:null,name:null,isFinal:!0,isStreaming:!1}:{final:null,url:null,name:null,isFinal:!0,isStreaming:!1}}function aFe(e,t){if(e?.asset_type===at.APP||e?.asset_type===at.SLIDES){const n=e.app?.final===!0,r=!!e.app?.source_content,s=n,o=r,a=[];s&&a.push(pr.Preview),o&&a.push(pr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.app?.final?i=pr.Source:n||t.streamingChild?.app?.final?i=pr.Preview:!n&&r&&(i=pr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}if(e?.asset_type===at.XLSX_FILE){const n=e.xlsx_file?.final===!0,r=!!e.xlsx_file?.source_content,s=n,o=r,a=[];s&&a.push(pr.Preview),o&&a.push(pr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.xlsx_file?.final?i=pr.Source:n||t.streamingChild?.xlsx_file?.final?i=pr.Preview:!n&&r&&(i=pr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}if(e?.asset_type===at.DOC_FILE){const n=e.doc_file?.final===!0,r=!!e.doc_file?.source_content,s=n,o=r,a=[];s&&a.push(pr.Preview),o&&a.push(pr.Source);let i=null;return t.isStreamingUpdate||t.hasStreamingChild&&!t.streamingChild?.doc_file?.final?i=pr.Source:n||t.streamingChild?.doc_file?.final?i=pr.Preview:!n&&r&&(i=pr.Source),{supportsPreviewTab:s,supportsCodeTab:o,availableTabs:a,defaultTab:i}}return{supportsPreviewTab:!1,supportsCodeTab:!1,availableTabs:[],defaultTab:null}}function iFe({asset:e,allAssets:t,assetResult:n,backendUuid:r}){const s=NJ(e),o=mLe(e,t),a=d.useMemo(()=>({hasTransforms:RJ(e),isStreamingUpdate:Tg(e),streamingChild:o.streamingChild,transformedContent:o.transformedContent,parentAsset:void 0,hasStreamingChild:o.hasStreamingChild,isStreamingChildActive:o.isStreaming}),[e,o]),i=d.useMemo(()=>oFe(e,s,a),[e,s,a]),c=d.useMemo(()=>aFe(e,a),[e,a]),u=sFe({asset:e,assetResult:n}),f=d.useMemo(()=>{const p=r??n?.backend_uuid,h=pLe(s,p),g=jJ(s,p);return{supportsFullScreen:h,fullScreenUrl:g,supportsDownload:u.length>0,downloadableItems:u,supportsVersioning:!!e?.version_info}},[s,r,n,u,e]),m=d.useMemo(()=>({app:e?.asset_type===at.APP,slides:e?.asset_type===at.SLIDES,pdf:PJ(s),docx:OJ(s),docFile:LJ(s),xlsx:FJ(s),codeFile:BJ(s),chart:UJ(s),code:zJ(e),generatedImage:VJ(e),generatedVideo:HJ(e),quiz:WJ(e),flashcards:GJ(e)}),[e,s]);return{assetData:s,content:i,streaming:a,tabs:c,capabilities:f,is:m}}const XJ=()=>{const{results:e}=on(),t=d.useMemo(()=>!e||e.length===0?[]:e.map(s=>({result:s,assets:u6(s?.blocks??[],{orderedByPriority:!0})})),[e]),n=d.useMemo(()=>t.flatMap(({assets:s})=>s),[t]),r=n.length>0;return{resultAssets:t,allAssets:n,hasAssets:r}};function lFe(e,t){const{allAssets:n}=XJ(),r=d.useRef(null),s=d.useMemo(()=>Tg(e)&&DJ(e,n)||e,[e,n]),o=iFe({asset:s,allAssets:n});d.useEffect(()=>{if(o.tabs.availableTabs.length===0)return;const a=o.tabs.defaultTab;a&&r.current!==a&&(t({type:"setTab",tab:a}),r.current=a)},[o.tabs,t])}function cFe({asset:e,inFlight:t,contextUuid:n,backendUuid:r}){const{doCanvasAction:s}=Yf(),{session:o}=Ne(),{trackEvent:a}=Xe(o),{allAssets:i}=XJ(),c=d.useRef(!1),u=d.useRef(void 0),f=d.useRef(void 0),{title:m}=v6(e);d.useEffect(()=>{if(!e||!t)return;const p=e.uuid,h=TJ(e)===!0,y=!(f.current!==p)&&!u.current&&h;if(!c.current||y){let v=e;if(Tg(e)){const b=DJ(e,i);b&&(v=b)}s({type:"setAsset",assetUuid:v.uuid,title:m,backendUuid:r}),c.current||a("canvas opened",{source:"auto",contextUUID:n,entryUUID:r,contentType:e.asset_type,assetUUID:e.uuid}),c.current=!0,f.current=p}u.current=h},[e,s,t,a,n,r,m,i]),d.useEffect(()=>{t||(c.current=!1,f.current=void 0,u.current=void 0)},[t])}function uFe({data:e,inFlight:t}){const{openCanvas:n}=Yf();d.useEffect(()=>{t&&e.should_auto_open&&n()},[t,e.should_auto_open,n])}function dFe({data:e,inFlight:t}){const{doCanvasAction:n}=Yf(),r=d.useRef(void 0);d.useEffect(()=>{if(!t)return;const s={progress:e.progress,assetType:e.expected_asset_type};(r.current?.progress!==s.progress||r.current?.assetType!==s.assetType)&&(n({type:"setLoading",loading:e.progress===Jo.IN_PROGRESS,assetType:e.expected_asset_type}),r.current=s)},[e.progress,e.expected_asset_type,n,t])}const fFe=({data:e})=>{const{inFlight:t,result:{blocks:n,context_uuid:r,backend_uuid:s}}=It(),o=WIe(n,e.asset?.uuid??""),{doCanvasAction:a}=Yf();return uFe({data:e,inFlight:t}),dFe({data:e,inFlight:t}),cFe({asset:o,inFlight:t,contextUuid:r,backendUuid:s}),lFe(o,a),null},mFe=()=>{const{blocksByIntendedUsage:{canvas_mode:e}}=It();return e?.canvas_block},ZJ=()=>{const{session:e}=Ne(),{firstResult:t,inFlight:n}=on(),r=t?.author_username;return e?.user?.username===r||n};var xw,gI;function pFe(){if(gI)return xw;gI=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){if(o.constructor!==a.constructor)return!1;var i,c,u;if(Array.isArray(o)){if(i=o.length,i!=a.length)return!1;for(c=i;c--!==0;)if(!s(o[c],a[c]))return!1;return!0}var f;if(t&&o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;for(f=o.entries();!(c=f.next()).done;)if(!a.has(c.value[0]))return!1;for(f=o.entries();!(c=f.next()).done;)if(!s(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;for(f=o.entries();!(c=f.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if(i=o.length,i!=a.length)return!1;for(c=i;c--!==0;)if(o[c]!==a[c])return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf&&typeof o.valueOf=="function"&&typeof a.valueOf=="function")return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString&&typeof o.toString=="function"&&typeof a.toString=="function")return o.toString()===a.toString();if(u=Object.keys(o),i=u.length,i!==Object.keys(a).length)return!1;for(c=i;c--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[c]))return!1;if(e&&o instanceof Element)return!1;for(c=i;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&o.$$typeof)&&!s(o[u[c]],a[u[c]]))return!1;return!0}return o!==o&&a!==a}return xw=function(a,i){try{return s(a,i)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},xw}var hFe=pFe();const JJ=uo(hFe),K0=(e,t)=>{if(typeof e=="object"&&e!==null&&t in e){const n=e[t];return typeof n=="string"?n:void 0}},gFe=(e,t)=>{if(e.step_type!=="MCP_TOOL_INPUT"||t.step_type!=="MCP_TOOL_OUTPUT")return!1;const n=K0(e.content,"goal_id"),r=K0(t.content,"goal_id");if(n&&r)return n===r;const s=K0(e.content,"tool_name"),o=K0(t.content,"tool_name");return!!(s&&o&&s===o)},yFe=e=>{if(!e?.length)return[];if(!e.some(s=>s.step_type==="MCP_TOOL_INPUT"||s.step_type==="MCP_TOOL_OUTPUT"))return e;let n=-1;return e.reduce((s,o,a)=>{if(a<=n||o.step_type==="MCP_TOOL_OUTPUT")return s;const i=e[a+1];return o.step_type==="MCP_TOOL_INPUT"&&i&&gFe(o,i)?(s.push({...o,mcp_tool_output_content:i.content}),n=a+1,s):(s.push({...o}),s)},[])},xFe=e=>{switch(e){case"Notion":return Sx;case"Linear":return Ex;case"GitHub":return Mx;case"Asana":return Tx;case"Atlassian":return Ax;case"Slack":return kx;case"Wiley":return Fd;case"CB Insights":return kM;case"PitchBook":return MM;case"Statista":return TM;default:return null}},eee=d.createContext(null);function vFe(){const e=d.useContext(eee);if(!e)throw new Error("useBannerContext must be used within a Banner component");return e}const bFe=eee.Provider;function _Fe({ref:e,variant:t,children:n,onClick:r,disabled:s=!1,...o}){const{size:a}=vFe(),i=bx(e),c=wa(o),f={ref:i,...c,size:a==="default"?"small":"tiny",onClick:r,disabled:s,fullWidth:!0};return l.jsx("div",{className:"@md/banner:w-auto w-full",children:t==="text"?l.jsx(wt,{...f,variant:"text",children:n}):l.jsx(wt,{...f,variant:t,children:n})})}const wFe=ci(z("bg-subtler","mb-md pt-3","relative flex flex-col items-center w-full","rounded-xl","shadow-sm ","@md/banner:flex-row @md/banner:flex-wrap @md/banner:py-3"),{variants:{size:{default:"gap-md p-md @md/banner:gap-md",compact:"gap-sm p-sm @md/banner:gap-sm"}},defaultVariants:{size:"default"}}),CFe=ci("font-semibold",{variants:{size:{default:"text-sm",compact:"text-xs"}},defaultVariants:{size:"default"}}),SFe=ci("text-quiet mb-0 font-normal leading-[1.3]",{variants:{size:{default:"text-sm",compact:"text-xs"}},defaultVariants:{size:"default"}}),EFe=z("relative flex w-full flex-row items-center","gap-3","@md/banner:mr-sm","@md/banner:flex-[1_1_60%]"),kFe=z("flex w-full flex-col items-stretch","gap-sm","@md/banner:flex-row-reverse @md/banner:flex-wrap @md/banner:justify-end @md/banner:gap-sm @md/banner:w-auto @md/banner:items-center","@md/banner:ml-auto");function MFe({title:e,description:t,leadingAccessory:n,children:r,size:s="default"}){const o=d.useMemo(()=>({size:s}),[s]),a=d.useMemo(()=>[...Array.isArray(r)?r:[r]].reverse(),[r]);return l.jsx(bFe,{value:o,children:l.jsx("div",{className:"@container/banner",children:l.jsxs("div",{className:wFe({size:s}),children:[l.jsxs("div",{className:EFe,children:[n&&l.jsx("div",{className:"shrink-0",children:l.jsx(rn,{icon:n,size:"default"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:CFe({size:s}),children:e}),t&&l.jsx("div",{className:SFe({size:s}),children:t})]})]}),l.jsx("div",{className:kFe,children:a})]})})})}const Y0=Object.assign(MFe,{Action:_Fe}),TFe=()=>{const e=Yt(),t=iu(),n=d.useMemo(()=>e.getQueryData(t),[e,t]),{connectors:r}=Ea({reason:"useHasUnauthenticatedGmailGcal"});return d.useMemo(()=>{const s=!!r?.connectors.find(o=>o.name==="gcal"&&(!o.connected||o.has_required_scopes===!1));return!(!n||!s)},[n,r])},AFe=1e4,NFe=1e3*60,RFe=["comet-default-browser-status"],DFe=()=>{const e=un(),{data:t=null,isLoading:n,refetch:r}=mt({queryKey:RFe,queryFn:async()=>{try{return await e.getIsCometDefaultBrowser("check_default_browser")}catch{return null}},refetchInterval:s=>s?.state?.data?NFe:AFe,refetchIntervalInBackground:!0,staleTime:0});return{isDefaultBrowser:t,isDefaultBrowserLoading:n,refetch:r}},jFe=({position:e,inFlight:t,isLastResult:n,upsellInformation:r,backendUuid:s})=>{const[o,a]=d.useState(!1),[i,c]=d.useState(null);Ca();const u="sidecar_thread",{session:f}=Ne(),{trackEventOnce:m,trackEvent:p}=Xe(f),h=ZJ(),g=TFe(),{subscriptionTier:y}=$t(),{isDefaultBrowser:x}=DFe(),v=d.useMemo(()=>{if(o||!r||!r?.title||r.upsell_type==="UNSET"||e==="top"&&r.app_location!=="IN_THREAD"||e==="bottom"&&r.app_location!=="IN_THREAD_BOTTOM"||e==="input"&&r.app_location!=="IN_THREAD_INPUT"||e==="connector_auth"&&r.app_location!=="UPSELL_APP_LOCATION_UNSPECIFIED")return!1;const w=r.upsell_uuid;return!(!s||w===i||!n&&(!r.is_persistent||e==="input"||e==="router_steps"||e==="connector_auth")||e==="bottom"&&t||r.is_persistent&&(!h||r.name==="gmail_gcal_connector"&&!g||r.name==="comet_set_default_browser"&&x!==!1))},[o,r,e,s,i,n,t,h,g,x]);d.useEffect(()=>{r?.upsell_type==="UNSET"&&a(!1)},[r?.upsell_type]),d.useEffect(()=>{if(!v||!r)return;const w=s,S=r.upsell_uuid;c(S),a(!0),m("thread upsell banner viewed",{entryUUID:w,upsellType:r.upsell_type,upsellName:r.name,upsellUuid:r.upsell_uuid,cometSurface:u,subscriptionTier:y,eventMetadata:r.event_metadata}),m("upsell viewed",{upsellLocation:r.app_location,upsellUUID:r.upsell_uuid,entryUUID:w,upsellType:r.upsell_type,upsellName:r.name,cometSurface:u,subscriptionTier:y,eventMetadata:r.event_metadata})},[s,v,m,r,u,y]);const b=d.useCallback(({hideBanner:w=!0}={})=>{w&&a(!1);const S=r,C=s;if(C&&S?.upsell_type){p("thread upsell banner dismissed",{entryUUID:C,upsellType:S.upsell_type,upsellName:S.name,upsellUuid:S.upsell_uuid,cometSurface:u,subscriptionTier:y,eventMetadata:S.event_metadata}),p("upsell dismissed",{upsellLocation:S.app_location,upsellUUID:S.upsell_uuid,entryUUID:C,upsellType:S.upsell_type,upsellName:S.name,cometSurface:u,subscriptionTier:y,eventMetadata:S.event_metadata});const E=S.cta==="SHORTCUT_MODAL"?S.cta_information?.recommended_shortcut?.name:void 0;eT({upsellName:S.name,upsellInstanceIdentifier:E,interactionType:"dismiss"})}},[s,p,r,u,y]),_=d.useCallback(()=>{a(!1)},[]);return d.useMemo(()=>({show:o,handleDismiss:b,handleHide:_}),[b,o,_])},IFe=/\[([^\]]+)\]\(pplx:\/\/action\/translate\)/g;function PFe(e){const t=Array.from(e.matchAll(IFe)).map(n=>n[1]).filter(n=>n!==void 0);return[...new Set(t)]}const vw=async({queryKey:e})=>{const[t,n="",r=""]=be.unmakeQueryKey(e);return nee({entryUUID:n,reason:"useThreadTranslations",phrase:r})},OFe=(e,t)=>{switch(t.type){case"NEXT":{const n=e.currentIndex+1,r=n%e.translatePhrases.length;return!t.canLoop&&n!==r?(t.onPageChange?.(null),e):(t.onPageChange&&t.fetchTranslatedPhrase(e.translatePhrases[r]).then(s=>{t.onPageChange?.(s)}),{...e,currentPhrase:e.translatePhrases[r],currentIndex:r})}case"PREV":{const n=e.currentIndex-1+e.translatePhrases.length,r=n%e.translatePhrases.length;return!t.canLoop&&n!==r?(t.onPageChange?.(null),e):(t.onPageChange&&t.fetchTranslatedPhrase(e.translatePhrases[r]).then(s=>{t.onPageChange?.(s)}),{...e,currentPhrase:e.translatePhrases[r],currentIndex:r})}default:return e}},LFe=()=>{const{result:e}=It();return d.useMemo(()=>{const t=qt.parseAskTextField(e);return t?PFe(t.answer):[]},[e])},tee=({clickedPhrase:e,entryUUID:t,contextUUID:n,translatePhrases:r})=>{const{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback((_,w)=>{o("language learning modal advance pressed",{entryUUID:t,contextUUID:n,direction:_,source:w})},[t,n,o]),[i,c]=d.useReducer(OFe,{currentIndex:e?r.indexOf(e):0,translatePhrases:r,currentPhrase:e??r[0]}),u=i.currentPhrase,f=i.currentIndex,m=be.makeQueryKey("translation_phrase_info",t,u),p=Yt();d.useEffect(()=>{const _=r[(r.length+f-1)%r.length],w=r[(f+1)%r.length];p.prefetchQuery({queryKey:be.makeQueryKey("translation_phrase_info",t,_),queryFn:vw}),p.prefetchQuery({queryKey:be.makeQueryKey("translation_phrase_info",t,w),queryFn:vw})},[t,r,f,p]);const{data:h,isLoading:g}=mt({queryKey:m,queryFn:vw}),y=d.useCallback(async _=>nee({entryUUID:t,reason:"useThreadTranslations",phrase:_}),[t]),x=d.useCallback(({onPageChange:_,source:w,canLoop:S})=>{c({type:"NEXT",onPageChange:_,fetchTranslatedPhrase:y,canLoop:S}),a("forward",w)},[a,y]),v=d.useCallback(({onPageChange:_,source:w,canLoop:S})=>{c({type:"PREV",onPageChange:_,fetchTranslatedPhrase:y,canLoop:S}),a("backward",w)},[a,y]),{data:b}=mt({queryKey:be.makeQueryKey("translation_detected_languages",t),queryFn:()=>FFe({entryUUID:t,reason:"useThreadTranslations"})});return{groupedTranslation:h,isLoading:g,advancePage:x,previousPage:v,translatePhrases:r,currentPhrase:u,currentIndex:f,detectedLanguages:b}},nee=async({entryUUID:e,reason:t,phrase:n})=>{const{data:r,error:s}=await de.POST("/rest/translation/phrase_info",t,{body:{entry_uuid:e,translated:n},timeoutMs:3e4});return s?(Z.error(`Failed to fetch translated phrases for entry ${e}`),null):r?.translation??null},FFe=async({entryUUID:e,reason:t})=>{const{data:n}=await de.GET("/rest/translation/detect-languages/{entry_uuid}",t,{params:{path:{entry_uuid:e}},timeoutMs:5e3});return n||(Z.error(`Failed to detect languages for entry ${e}`),null)},BFe=50;function yI(e){const t=aA(0);return d.useEffect(()=>{if(!e){t.set(0);return}try{const n=new AudioContext,r=n.createMediaStreamSource(e),s=n.createAnalyser();s.fftSize=2048,r.connect(s);const o=new Uint8Array(2048),a=setInterval(()=>{s.getByteFrequencyData(o);const i=Array.from(o).reduce((c,u)=>c+u,0)/o.length/255;t.set(i*100)},BFe);return()=>{clearInterval(a),s.disconnect(),r.disconnect(),n.close()}}catch(n){Z.error("[v2v_language_learning] Audio analysis setup failed:",n);return}},[t,e]),t}function UFe({onPhraseAttemptResult:e,onConnect:t,onEndLesson:n}){const r=d.useRef(null),s=d.useRef(null),o=d.useRef(null),a=d.useRef(null),i=d.useRef(null),c=d.useRef(!1),[u,f]=d.useState(!1),[m,p]=d.useState(!1),[h,g]=d.useState(null),[y,x]=d.useState(!1),v=d.useRef(!1),[b,_]=d.useState(),w=yI(b),[S,C]=d.useState(),E=yI(S),T=d.useCallback(N=>{if(a.current){const D=a.current.getAudioTracks()[0];D&&(D.enabled=!N,x(N),v.current=N)}},[]),k=d.useCallback(N=>{const D=s.current;if(!D||D.readyState!=="open"){Z.debug("[v2v_language_learning] Channel not ready");return}try{i.current&&(D.send(JSON.stringify({type:"response.cancel",response_id:i.current})),D.send(JSON.stringify({type:"output_audio_buffer.clear"}))),D.send(JSON.stringify({type:"conversation.item.create",item:{type:"message",role:"system",content:[{type:"input_text",text:N}]}})),D.send(JSON.stringify({type:"response.create"}))}catch(j){Z.error("[v2v_language_learning] Send failed:",j)}},[]),I=d.useCallback(()=>{a.current&&(a.current.getTracks().forEach(N=>N.stop()),a.current=null),o.current&&(o.current.pause(),o.current.srcObject=null),s.current&&(s.current.close(),s.current=null),r.current&&(r.current.close(),r.current=null),i.current=null,v.current=!1,C(void 0),_(void 0),p(!1),f(!1),x(!1),w.set(0),g(null),Z.debug("[v2v_language_learning] Ended")},[w]),M=d.useCallback(async N=>{try{g(null);const D=await navigator.mediaDevices.getUserMedia({audio:!0});C(D),a.current=D;const j=new RTCPeerConnection;r.current=j,D.getTracks().forEach(L=>j.addTrack(L,D)),j.ontrack=L=>{const[U]=L.streams;o.current&&U&&(o.current.srcObject=U,o.current.play().catch(O=>{Z.info("[v2v_language_learning] Audio autoplay blocked:",O)}),_(U))};const F=j.createDataChannel("oai-events");s.current=F,F.onopen=()=>{Z.debug("[v2v_language_learning] Connected"),p(!0),t?.(k)},F.onmessage=L=>{try{const U=JSON.parse(L.data);if(U.type==="response.function_call_arguments.done")if(U.name==="record_phrase_attempt_result"){const O=JSON.parse(U.arguments);Z.debug("[v2v_language_learning] Record phrase attempt result:",O),e(O,$=>{F.send(JSON.stringify({type:"conversation.item.create",item:{type:"function_call_output",call_id:U.call_id,output:$}})),F.send(JSON.stringify({type:"response.create"})),Z.debug("[v2v_language_learning] Sent next instruction:",$)})}else U.name==="end_lesson"&&(i.current?c.current=!0:n?.(I));switch(U.type){case"output_audio_buffer.started":f(!0),i.current=U.response_id,a.current?.getAudioTracks().forEach(O=>{O.enabled=!1});break;case"output_audio_buffer.stopped":f(!1),i.current=null,v.current||a.current?.getAudioTracks().forEach(O=>{O.enabled=!0}),c.current&&(n?.(I),c.current=!1);break;default:break}}catch(U){Z.warn("[v2v_language_learning] Parse error:",U)}},F.onclose=()=>{Z.debug("[v2v_language_learning] Disconnected"),p(!1)};const R=await j.createOffer();if(await j.setLocalDescription(R),!R.sdp)throw new Error("No SDP in offer");const P=await uDe({body:{...N,sdp:R.sdp},reason:"language-learning"});if(!P.data?.sdp)throw new Error(P.error||"Failed to create language learning session");await j.setRemoteDescription({type:"answer",sdp:P.data.sdp})}catch(D){throw Z.error("[v2v_language_learning] Start session failed:",D),g(D instanceof Error?D:new Error(String(D))),D}},[e,k,t,I,n]);return{audioRef:o,dataChannel:s.current,startSession:M,sendInstruction:k,endSession:I,isConnected:m,isSpeaking:u,error:h,remoteAmplitude:w,localAmplitude:E,isMicMuted:y,setIsMicMuted:T}}const VFe=(e,t)=>{const{value:n,loading:r}=zt({flag:"language-learning-voice-tutor",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},HFe=[{type:"default",value:"en",text:"English (English)"},{type:"default",value:"yue",text:"Cantonese (粵語)"},{type:"default",value:"ca",text:"Catalan (Català)"},{type:"default",value:"zh",text:"Chinese (中文)"},{type:"default",value:"hr",text:"Croatian (Hrvatski)"},{type:"default",value:"cs",text:"Czech (Čeština)"},{type:"default",value:"da",text:"Danish (Dansk)"},{type:"default",value:"nl",text:"Dutch (Nederlands)"},{type:"default",value:"fi",text:"Finnish (Suomi)"},{type:"default",value:"fr",text:"French (Français)"},{type:"default",value:"de",text:"Standard German (Deutsch)"},{type:"default",value:"he",text:"Hebrew (עברית)"},{type:"default",value:"hi",text:"Hindi (हिंदी)"},{type:"default",value:"hu",text:"Hungarian (Magyar)"},{type:"default",value:"id",text:"Indonesian (Bahasa Indonesia)"},{type:"default",value:"it",text:"Italian (Italiano)"},{type:"default",value:"ja",text:"Japanese (日本語)"},{type:"default",value:"jv",text:"Javanese (Basa Jawa)"},{type:"default",value:"ko",text:"Korean (한국어)"},{type:"default",value:"ms",text:"Malay (Melayu)"},{type:"default",value:"zh-CN",text:"Simplified Chinese (简体中文)"},{type:"default",value:"zh-TW",text:"Traditional Chinese (繁體中文)"},{type:"default",value:"no",text:"Norwegian (Norsk)"},{type:"default",value:"pl",text:"Polish (Polski)"},{type:"default",value:"pt",text:"Portuguese (Português)"},{type:"default",value:"ru",text:"Russian (Русский)"},{type:"default",value:"sr",text:"Serbian (Srpski)"},{type:"default",value:"es",text:"Spanish (Español)"},{type:"default",value:"sv",text:"Swedish (Svenska)"},{type:"default",value:"tl",text:"Tagalog (Tagalog)"},{type:"default",value:"ta",text:"Tamil (தமிழ்)"},{type:"default",value:"te",text:"Telugu (తెలుగు)"},{type:"default",value:"tr",text:"Turkish (Türkçe)"},{type:"default",value:"uk",text:"Ukrainian (Українська)"},{type:"default",value:"ur",text:"Urdu (اردو)"},{type:"default",value:"vi",text:"Vietnamese (Tiếng Việt)"}],zFe=[{type:"default",value:"echo",text:"Gravo"},{type:"default",value:"cedar",text:"Kyrin"},{type:"default",value:"ballad",text:"Mylva"},{type:"default",value:"shimmer",text:"Nuvix"},{type:"default",value:"verse",text:"Rylth"},{type:"default",value:"sage",text:"Solva"},{type:"default",value:"coral",text:"Syla"},{type:"default",value:"ash",text:"Torma"},{type:"default",value:"alloy",text:"Tylis"},{type:"default",value:"marin",text:"Velox"}],WFe=()=>{let e=HFe[0],t=zFe[1];try{const n=vt.getItem("pplx.v2v.selectedLanguage");if(n){const r=JSON.parse(n);r.value&&(e=r)}}catch(n){Z.error("Error loading local language settings:",n)}try{const n=vt.getItem("pplx.v2v.selectedVoice");if(n){const r=JSON.parse(n);r.value&&(t=r)}}catch(n){Z.error("Error loading local voice settings:",n)}return{language:e,voice:t}},GFe=()=>{const e=d.useMemo(()=>WFe(),[]),[t,n]=d.useState(e),[r,s]=d.useState(e),o=d.useCallback(m=>{s(p=>({...p,language:m}))},[s]),a=d.useCallback(m=>{s(p=>({...p,voice:m}))},[s]),i=r.language.value!==t.language.value,c=r.voice.value!==t.voice.value,u=i||c,f=d.useCallback(()=>{vt.setItem("pplx.v2v.selectedLanguage",JSON.stringify(r.language)),vt.setItem("pplx.v2v.selectedVoice",JSON.stringify(r.voice)),n(r)},[r]);return d.useMemo(()=>({currentSettings:r,setLanguage:o,setVoice:a,hasChanges:u,save:f}),[r,u,f,o,a])},Ar={type:"spring",stiffness:700,damping:50},_6="LANGUAGE_LEARNING_AUTOPLAY",Q0=e=>{new Audio(e).play().catch(n=>{console.error("Error playing audio:",n)})},xI=e=>{const t=Object.keys(e).map(n=>`"${n}": ${e[n].join(", ")}`).join(` -`);return t.length>0?`End lesson. Ground any overall feedback on the lesson on the following report: ${t}`:"End lesson. No phrases-specific feedback was provided, so just say goodbye to the user and bring your conversation to an end."},$Fe=({onClose:e,string:t,stringBounds:n,isMobileStyle:r,autoplay:s,initialWidth:o,entryUUID:a,contextUUID:i,queryStr:c,translatePhrases:u,defaultMode:f="flashcards"})=>{const{session:m}=Ne(),{trackEvent:p}=Xe(m),g=J().formatMessage,[y,x]=d.useState(null),v=d.useRef(null),[b,_]=d.useState(!1),[w,S]=d.useState(s),[C,E]=d.useState(null),[T,k]=d.useState(o),I=d.useRef(null),M=d.useRef(null),N=d.useRef(null),{variation:D}=VFe(!1),{currentSettings:j}=GFe(),[F,R]=d.useState(f==="voice_tutor"),P=w&&!F,[L,U]=d.useState(!1),O=d.useRef({}),$=16,{groupedTranslation:G,detectedLanguages:H,isLoading:Q,advancePage:Y,previousPage:te,currentPhrase:se,currentIndex:ae}=tee({clickedPhrase:t,entryUUID:a,contextUUID:i,translatePhrases:u}),{colorScheme:X}=Ss(),ee=d.useMemo(()=>X==="light"?{accentColor:"rgb(172, 63, 0)",baseColor:"rgb(219, 113, 0)",aiColor:"rgb(50, 184, 198)",loadingColor:"rgb(98, 108, 113)",idleColor:"rgb(175, 180, 181)"}:{accentColor:"rgb(255, 210, 166)",baseColor:"rgb(219, 113, 0)",aiColor:"rgb(50, 184, 198)",loadingColor:"rgb(167, 169, 169)",idleColor:"rgb(99, 101, 101)"},[X]),le=d.useMemo(()=>G?b?G.sentence.translated:G.element.translated:se,[se,G,b]),re=d.useCallback($e=>{$e(`Start lesson. Current phrase: "${le}"`)},[le]),ce=d.useCallback(($e,ht)=>{if(O.current[$e.phrase]||(O.current[$e.phrase]=[]),$e.status==="success"||$e.status==="skipped")$e.status==="success"&&O.current[$e.phrase].push("Correct!"),Y({onPageChange:Zt=>{if(Zt){const dt=b?Zt.sentence.translated:Zt.element.translated;ht(`Move onto the next phrase: "${dt}"`)}else ht(xI(O.current))},source:"voice-tutor",canLoop:!1});else if($e.status==="failure"){const Zt=$e.feedback??"Did not repeat the phrase correctly, but no feedback was given. Only reference this in general terms in your feeddback.";O.current[$e.phrase].push(Zt),ht("Continue with your feedback for this phrase.")}},[Y,b]),ue=d.useCallback($e=>{$e(),R(!1),p("language learning voice tutor session ended",{entryUUID:a,contextUUID:i})},[a,i,p]),{endSession:me,startSession:we,sendInstruction:ye,audioRef:_e,isConnected:ke,isSpeaking:De,error:xe,remoteAmplitude:Ue,localAmplitude:Ee,isMicMuted:Ke,setIsMicMuted:Nt}=UFe({onPhraseAttemptResult:ce,onConnect:re,onEndLesson:ue});d.useEffect(()=>{xe&&p("language learning voice tutor session error",{entryUUID:a,contextUUID:i,error:xe.message})},[xe,a,i,p]),d.useEffect(()=>{if(!(!F||!H))return p("language learning voice tutor session started",{entryUUID:a,contextUUID:i}),O.current={},we({source:"web",voice:j.voice.value??"marin",learning_language:H.learning_language,native_language:H.native_language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,turn_detection_threshold:.9,query:c,learning_dialect:H.learning_dialect}),()=>{p("language learning voice tutor session ended",{entryUUID:a,contextUUID:i}),me()}},[F,H,p,a,i]);const pe=d.useCallback($e=>{if(ke)if($e){const ht=b?$e.sentence.translated:$e.element.translated;ye(`Move onto a new phrase. DO NOT give feedback on the previous phrase. The new phrase is: "${ht}"`)}else ye(xI(O.current))},[ye,ke,b]);let ve;ae!==null&&(ve=b?G?.sentence:G?.element);function Ae($e,ht,Zt){return Math.round(Math.max(ht,Math.min($e,Zt)))}let We;const pt=ve?.translated.length??se?.length??0;pt<20?We=Ae(T*.088,24,128):pt>=20&&pt<48?We=Ae(T*.058,32,84):We=Ae(T*.038,24,56);const Gt=d.useCallback(()=>xe?xe instanceof Error&&xe.name=="NotAllowedError"?g({defaultMessage:"Please enable microphone permissions and try again.",id:"UaGxC0QJ/N"}):g({defaultMessage:"Failed to connect",id:"uhiTNkWfe3"}):ke?ke&&!L?g({defaultMessage:"Waking up...",id:"DgbC2DZlba"}):De&&L?null:g(Ke?{defaultMessage:"Muted",id:"HOzFdo4wh5"}:b?{defaultMessage:"Repeat the sentence",id:"PDwmrTmyqy"}:{defaultMessage:"Repeat the word",id:"m4eJ6oS5NH"}):g({defaultMessage:"Waking up...",id:"DgbC2DZlba"}),[De,xe,L,ke,Ke,b,g]);d.useEffect(()=>{ke&&De&&U(!0),ke||U(!1)},[ke,De]),d.useLayoutEffect(()=>{if(v.current){const $e=v.current.getBoundingClientRect();x($e)}},[]);const Le={zoomInInitial:{opacity:0,scale:$/We,x:y?n.left+n.width/2-(y.left+y.width/2):0,y:y?n.top+n.height/2-(y.top+y.height/2):0},initial:{opacity:0,scale:1,x:0,y:0},resting:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:1,x:0,y:0}},gt=$e=>{const ht=$e.currentTarget.getBoundingClientRect(),dt=$e.clientX-ht.left{Nt(!Ke),Q0(Ke?"/static/sounds/rt-ready.wav":"/static/sounds/rt-pause.wav")},[Ke,Nt]);d.useEffect(()=>{const $e=Zt=>{if(Zt.key==="Escape")e();else if(Zt.key==="ArrowRight")Y({onPageChange:pe,source:"manual",canLoop:!F});else if(Zt.key==="ArrowLeft"){if(F&&ae===0)return;te({onPageChange:pe,source:"manual",canLoop:!F})}else Zt.key===" "&&(Zt.preventDefault(),E(new Date))},ht=()=>{k(window.innerWidth)};return window.addEventListener("keydown",$e),window.addEventListener("resize",ht),()=>{window.removeEventListener("keydown",$e),window.removeEventListener("resize",ht)}},[e,Y,te,pe,F,ae,u.length,ye]),d.useEffect(()=>{vt.setItem(_6,w.toString())},[w]);let Me;w?Me=g({defaultMessage:"Autoplay on",id:"8Svq84unOC"}):Me=g({defaultMessage:"Autoplay off",id:"mjxB7Ns43B"});const Ve=tp(Ue,[0,10],[.1,.75]),lt=tp(Ue,[0,10],[1,2]),xt=tp(Ee,[0,1],[.1,.75]),Pt=tp(Ee,[0,1],[1,2]);return l.jsx(St,{children:l.jsxs("div",{ref:I,onClick:gt,onMouseMove:u.length>1?gt:void 0,className:"fixed inset-0 size-full cursor-pointer overflow-hidden",children:[l.jsx("audio",{ref:_e,className:"hidden"}),l.jsx(Te.div,{className:"bg-base absolute inset-0 z-[1] size-full",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,children:!r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:N,className:"absolute right-4 top-1/2 z-[1] size-8 -translate-y-1/2 opacity-0 transition-opacity duration-300",children:l.jsx(V,{color:"ultraLight",variant:"small",children:l.jsx(ge,{icon:B("chevron-right"),size:32})})}),l.jsx("div",{ref:M,className:"absolute left-4 top-1/2 z-[1] size-6 -translate-y-1/2 opacity-0 transition-opacity duration-300",children:l.jsx(V,{color:"ultraLight",variant:"small",children:l.jsx(ge,{icon:B("chevron-left"),size:32})})})]})}),l.jsxs(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,className:"absolute inset-x-0 top-0 z-[4] flex flex-col gap-3 p-3",children:[u.length>1?l.jsx("div",{className:"gap-xs md:gap-sm flex",children:u.map(($e,ht)=>l.jsx("div",{className:z("bg-subtle h-1 w-full rounded-full",{"!bg-inverse":ht===ae})},ht))}):null,l.jsxs("div",{className:"gap-xs flex items-center justify-end",children:[l.jsx(st,{toolTip:Me,tooltipLayout:"left",tooltipProps:{closeOnClick:!1},pill:!0,icon:w?YU:QU,onClick:()=>{S(!w),p("language learning mute pressed",{entryUUID:a,contextUUID:i})},disabled:F}),l.jsx(st,{pill:!0,icon:B("x"),onClick:e})]})]}),l.jsx("div",{className:"scrollbar-subtle absolute inset-0 z-[3] flex size-full overflow-y-scroll",children:l.jsx("div",{className:"flex h-fit min-h-full w-full px-4 py-32 md:px-8 lg:px-12",children:l.jsxs("div",{className:z("gap-md md:gap-lg lg:gap-xl break-word flex min-h-full w-full flex-1 grow flex-col items-center justify-center hyphens-auto",{"!items-start":r}),children:[l.jsx(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,"data-no-click":"true",children:l.jsx(br,{active:Q,children:l.jsx(V,{variant:"entry-title",color:"ultraLight",className:z("pointer-events-auto cursor-text",{"text-center !text-3xl":!r,"text-left !text-xl sm:!text-2xl":r,"!bg-subtle rounded-full !text-transparent":Q}),children:Q?"Loading":ve?.untranslated})})}),l.jsxs("div",{ref:v,className:"relative",lang:G?.language_code??void 0,children:[l.jsx("div",{style:{fontSize:We},className:z("text-foreground pointer-events-none text-balance text-center font-semibold leading-[1.2] opacity-0",{"!text-left":r}),children:ve?.translated??se}),y&&l.jsx(Te.div,{className:z("text-foreground pointer-events-auto absolute inset-0 w-fit text-balance text-center font-semibold leading-[1.2] outline-none",{"!text-left":r}),style:{fontSize:We},initial:y.height>We*1.2?"initial":"zoomInInitial",animate:"resting",exit:"exit",transition:Ar,variants:Le,dir:G?.is_rtl?"rtl":"ltr",children:l.jsx(br,{active:Q,children:l.jsx(YFe,{currentTranslation:ve,translation:ve?.translated??se??"",autoplay:P,lastPlayedTime:C,isRtl:G?.is_rtl??!1,entryUUID:a,contextUUID:i,onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})}},ae?.toString()+b.toString())})})]}),l.jsx(Te.div,{initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,"data-no-click":"true",children:l.jsx(br,{active:Q,children:l.jsx(V,{variant:"entry-title",color:"ultraLight",className:z("pointer-events-auto cursor-text",{"text-center !text-3xl":!r,"text-left !text-xl sm:!text-2xl":r,"!bg-subtle rounded-full !text-transparent":Q}),children:Q?"Pronunciation":ve?.pronunciation})})})]})})}),l.jsxs(Te.div,{className:"absolute inset-x-0 bottom-0 z-[4] flex h-fit items-center justify-center gap-2 pb-4 md:gap-3 md:pb-9",initial:"initial",animate:"resting",exit:"exit",variants:Le,transition:Ar,children:[!D&&l.jsxs(l.Fragment,{children:[l.jsx(Ge,{variant:"primary",size:r?"regular":"large",onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})},icon:B("player-play-filled"),pill:!0,extraCSS:"!bg-inverse disabled:!text-inverse relative z-10",disabled:Q}),l.jsx("div",{className:"bg-base relative z-10 rounded-full",children:l.jsx("div",{className:"bg-subtle h-10 rounded-full p-[2.5px] md:h-14 md:p-1",children:l.jsxs("div",{className:"relative flex h-full items-center",children:[l.jsx(st,{variant:"primary",size:r?"small":"regular",text:l.jsxs("div",{className:"pointer-events-none relative grid grid-cols-1 grid-rows-1",children:[l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]}),onClick:()=>{_(!1),p("language learning selector pressed",{entryUUID:a,contextUUID:i,button:"word"})},disabled:Q,extraCSS:"relative h-full z-10 focus-visible:!bg-transparent !bg-transparent"}),l.jsx(st,{variant:"primary",noBackground:!0,size:r?"small":"regular",text:l.jsxs("div",{className:"pointer-events-none relative grid grid-cols-1 grid-rows-1",children:[l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx("div",{className:"col-start-1 col-end-2 row-start-1 row-end-2",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]}),onClick:()=>{_(!0),p("language learning selector pressed",{entryUUID:a,contextUUID:i,button:"sentence"})},disabled:Q,extraCSS:"relative z-10 h-full !gap-0 focus-visible:!bg-transparent !bg-transparent"}),l.jsx(Te.div,{className:"bg-raised dark:!bg-base absolute inset-y-0 left-0 h-full w-1/2 rounded-full",animate:{x:b?"100%":"0%"},transition:Ar})]})})})]}),D&&l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1",children:[l.jsx(St,{initial:!1,children:l.jsx(Te.div,{initial:{opacity:0,scale:.9,filter:"blur(10px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:1.1,filter:"blur(10px)"},transition:{duration:.4},className:"relative z-[2] col-start-1 col-end-2 row-start-1 row-end-2 mx-auto",children:F?l.jsxs("div",{className:"relative flex items-center gap-4 rounded-full",children:[l.jsx(St,{children:l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,className:"absolute -top-12 left-1/2 -translate-x-1/2 whitespace-nowrap",children:l.jsx(br,{active:!ke||ke&&!L||!De&&ke,children:l.jsx(V,{variant:"entry-title-200",className:"!whitespace-nowrap",style:{color:xe||!ke||ke&&!L?ee.idleColor:De?ee.aiColor:ee.baseColor},children:Gt()})})},De.toString()+xe+(!ke&&L).toString()+Ke.toString())}),l.jsx("div",{className:"bg-base rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{R(!1),Q0("/static/sounds/rt-pause.wav")},leadingComponent:l.jsx(ge,{icon:B("player-stop"),size:24}),pill:!0,noPadding:!0,extraCSS:"!bg-raised relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q,toolTip:g({defaultMessage:"Stop voice tutor",id:"+7CJc6lfrw"}),tooltipLayout:"top"})}),l.jsx("div",{className:"bg-base rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:l.jsx(Ge,{variant:"common",size:"large",leadingComponent:l.jsx(ge,{icon:Ke?B("microphone-off"):B("microphone"),size:20}),pill:!0,noPadding:!0,extraCSS:"!bg-raised relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q,onClick:Je,toolTip:g(Ke?{defaultMessage:"Turn on microphone",id:"wdzCqjtXgD"}:{defaultMessage:"Turn off microphone",id:"SUrSrgEOv2"}),tooltipLayout:"top"})})]}):l.jsxs("div",{className:"bg-raised z-[2] col-start-1 col-end-2 row-start-1 row-end-2 mx-auto flex w-fit items-center rounded-full shadow-[0_1px_4px_0_rgba(0,0,0,0.05),0_0_0_1px_rgba(0,0,0,0.05)] dark:!shadow-[0_0_0_1px_rgba(255,255,255,0.1)]",children:[l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{E(new Date),p("language learning play pressed",{entryUUID:a,contextUUID:i})},leadingComponent:l.jsx(ge,{icon:B("player-play-filled"),size:20}),pill:!0,extraCSS:"!bg-transparent relative z-10 active:!scale-100 active:!opacity-[50%]",disabled:Q}),l.jsx("div",{className:"bg-subtle h-8 w-0.5 flex-shrink-0"}),l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{R(!0),Q0("/static/sounds/rt-ready.wav")},leadingComponent:l.jsx(ge,{icon:KU,size:20}),pill:!0,extraCSS:z("!bg-transparent relative !text-sm z-10 [&>*]:!gap-2 active:!scale-100 active:!opacity-[50%]",{"!pl-4 !pr-3":!r}),disabled:Q,text:r?void 0:g({defaultMessage:"Voice Tutor",id:"rWFec/0yfN"}),textClassName:"p-0 -translate-y-px"}),l.jsx("div",{className:"bg-subtle h-8 w-0.5 flex-shrink-0"}),l.jsx(Ge,{variant:"common",size:"large",onClick:()=>{_(!b)},pill:!0,extraCSS:"!bg-transparent relative !text-sm z-10 !px-3 active:!scale-100 translate-y-0 active:!opacity-[50%] !font-normal",trailingComponent:l.jsx(ge,{icon:B("selector"),size:16}),disabled:Q,text:l.jsxs("div",{className:z("flex items-center",{"flex-col":r}),children:[l.jsx(V,{variant:r?"tinyRegular":"small",color:"light",className:z("mr-auto",{"leading-tight":r}),children:g({defaultMessage:"View as",id:"pX8Y8hA7fI"})}),r?null:l.jsx(l.Fragment,{children:" "}),l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1",children:[l.jsx(St,{initial:!1,children:l.jsx(Te.div,{className:"col-start-1 col-end-2 row-start-1 row-end-2 text-left",initial:{y:"100%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-100%",opacity:0},transition:Ar,children:l.jsx(V,{variant:"smallBold",color:"default",children:g(b?{defaultMessage:"Sentence",id:"82Zf4jFbZN"}:{defaultMessage:"Word",id:"TGazyxBLFu"})})},b.toString())}),l.jsx(V,{className:"pointer-events-none col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",variant:"smallBold",color:"default",children:g({defaultMessage:"Word",id:"TGazyxBLFu"})}),l.jsx(V,{className:"pointer-events-none col-start-1 col-end-2 row-start-1 row-end-2 opacity-0",variant:"smallBold",color:"default",children:g({defaultMessage:"Sentence",id:"82Zf4jFbZN"})})]})]}),textClassName:"p-0 -translate-y-px"})]})},F.toString())}),l.jsx(St,{children:F&&l.jsx(Te.div,{className:"ease-outExpo absolute inset-x-0 top-1/2 z-[1] h-full rounded-[100%] opacity-20 blur-[30px] saturate-200 duration-1000",initial:{opacity:0},animate:{backgroundColor:xe||!ke||ke&&!L?ee.idleColor:De?ee.aiColor:ee.baseColor,opacity:.5},exit:{opacity:0},style:{opacity:De?Ve:xe||!ke||ke&&!L?.5:xt,scale:De?lt:xe||!ke||ke&&!L?1:Pt},transition:Ar})})]}),l.jsx("div",{className:"from-base pointer-events-none absolute inset-x-0 -top-9 bottom-0 bg-gradient-to-t to-transparent"})]})]})})},qFe=`linear-gradient( - to right, - oklch(var(--foreground-color)) 0%, - oklch(var(--foreground-color)) 33.34%, - oklch(var(--dark-super-color)) 50%, - oklch(var(--dark-super-color)) 66.67%, - oklch(var(--foreground-color)) 66.67%, - oklch(var(--foreground-color)) 100% -)`,KFe=`linear-gradient( - to right, - oklch(var(--foreground-color)) 0%, - oklch(var(--foreground-color)) 33.34%, - oklch(var(--dark-super-color)) 33.34%, - oklch(var(--dark-super-color)) 50%, - oklch(var(--foreground-color)) 66.67%, - oklch(var(--foreground-color)) 100% -)`,YFe=({currentTranslation:e,translation:t,autoplay:n,lastPlayedTime:r,isRtl:s,onClick:o,entryUUID:a,contextUUID:i})=>{const c=d.useRef(null),u=d.useRef(n);d.useEffect(()=>{u.current=n},[n]);const f=d.useRef(r);d.useEffect(()=>{f.current=r},[r]);const{session:m}=Ne(),{trackEvent:p}=Xe(m),h=d.useCallback(()=>{if(!e)return;const _=e.audio_url;_&&c.current&&(c.current.src=_)},[e]),g=aA(0),y=tp(()=>s?`${g.get()*100}%`:`${(1-g.get())*100}%`),x=d.useCallback(()=>{c.current&&(c.current.pause(),c.current.currentTime=0,requestAnimationFrame(()=>{c.current?.play()}))},[]),v=d.useRef(r);d.useEffect(()=>{r&&r!==v.current&&x()},[r,x]),d.useEffect(()=>{h()},[h]),d.useEffect(()=>{c.current&&(c.current.pause(),c.current.currentTime=0,h())},[t,h]);const b=d.useCallback(()=>{u.current&&x()},[x]);return l.jsxs(l.Fragment,{children:[l.jsx("audio",{ref:c,className:"hidden",onLoadedMetadata:()=>{b()},onPlay:()=>{g.jump(0),aNe(g,1,{ease:"linear",duration:(c.current?.duration??0)*2}),p("language learning audio played",{entryUUID:a,contextUUID:i})}}),l.jsx(Te.span,{className:"-my-4 py-4 text-transparent",style:{backgroundPositionX:y,backgroundClip:"text",backgroundSize:"300%",backgroundRepeat:"no-repeat",backgroundImage:s?KFe:qFe},children:l.jsx("span",{onClick:o,className:"cursor-pointer","data-no-click":"true",children:t})})]})},QFe=Object.freeze(Object.defineProperty({__proto__:null,LANGUAGE_LEARNING_AUTOPLAY_KEY:_6,default:$Fe},Symbol.toStringTag,{value:"Module"})),ree=A.memo(({url:e,openInNewTab:t,fullWidth:n=!0,variant:r="super",upsellInformation:s})=>{const{$t:o}=J(),{session:a}=Ne(),{trackEvent:i}=Xe(a),c=d.useCallback(()=>{s&&i("upsell clicked",{upsellLocation:s.app_location??"UPSELL_APP_LOCATION_UNSPECIFIED",upsellUUID:s.upsell_uuid,upsellName:s.name,upsellType:s.upsell_type,cta:tn.PERMALINK}),e&&(t?window.open(e,"_blank"):No(e,"Learn more from upsell"))},[e,t,i,s]);return l.jsx(st,{text:o({defaultMessage:"Learn more",id:"TdTXXf940t"}),fullWidth:n,variant:r,textClassName:"!text-sm",noPadding:!0,onClick:c})});ree.displayName="LearnMoreButton";const see=A.memo(({upsellInformation:e,inFlight:t,position:n,onButtonClick:r,isLoading:s,textButtonIfSecondary:o=!1,hideUpsell:a,verticalLayout:i=!1})=>{const c=kl({upsellInformation:e,inFlight:t,options:{hideUpsell:a}}),u=d.useCallback(()=>{r?.(),c()},[r,c]),f=d.useCallback(w=>{if(n==="router_steps")return"inverted";switch(w){case bm.MAX_COLOR:return"maxGold";case bm.PRIMARY_COLOR:return"primary";case bm.INVERTED:return"inverted";default:return"common"}},[n]),m=d.useMemo(()=>f(e?.button_color),[f,e?.button_color]),p=e?.cta_information?.secondary_button,h=e?.cta_information?.tertiary_button,g=kl({upsellInformation:p?{...e,cta:p.cta,button_text:p.button_text}:e,inFlight:t,options:{hideUpsell:a}}),y=kl({upsellInformation:h?{...e,cta:h.cta,button_text:h.button_text}:e,inFlight:t,options:{hideUpsell:a}}),x=d.useCallback((w,S)=>{const C=f(w.button_color),E=w.button_color===bm.SECONDARY_COLOR,k={size:"regular",onClick:()=>{r?.(),S()},text:w.button_text,textClassName:"!text-sm",fullWidth:!0};return o&&E?l.jsx(st,{...k,variant:"super",noPadding:!0}):l.jsx(Ge,{...k,variant:C})},[f,o,r]),v=d.useCallback(w=>{let S;e?.icon_reference==="labs"?S=l.jsx(ge,{icon:B("plus"),size:"sm"}):e?.icon_reference==="comet_download"&&(S=l.jsx(ut,{name:B("download"),size:16}));const C={size:w?"regular":"small",onClick:u,text:e?.button_text,leadingComponent:S,textClassName:w?"!text-sm":void 0,fullWidth:!0,isLoading:s};return o&&e?.button_color===bm.SECONDARY_COLOR?l.jsx(st,{...C,variant:"super",noPadding:!0}):l.jsx(Ge,{...C,variant:m})},[m,u,e?.button_color,e?.button_text,e?.icon_reference,o,s]),b=p||h,_=!b&&e?.cta_information?.secondary_permalink;if(b){const w=[v(!0),p&&x(p,g),h&&x(h,y)].filter(Boolean);return w.length===1?w[0]:l.jsx("div",{className:`gap-md flex ${i?"flex-col":"flex-row"}`,children:i?w:[...w].reverse()})}if(_){const w=e?.cta_information?.secondary_permalink,S=e?.cta_information?.secondary_permalink_new_tab,C=l.jsx(ree,{url:w,openInNewTab:S,upsellInformation:e});return l.jsx("div",{className:`gap-md flex ${i?"flex-col":"flex-row"}`,children:i?l.jsxs(l.Fragment,{children:[v(!0),C]}):l.jsxs(l.Fragment,{children:[C,v(!0)]})})}return v(!1)});see.displayName="UpsellButton";const XFe=Ce(()=>Se(()=>q(()=>Promise.resolve().then(()=>QFe),void 0))),ZFe=({icon_reference:e,icon_image:t})=>{if(t)return l.jsx(K,{variant:"subtle",className:"p-xs rounded-md border",children:l.jsx("img",{src:t.url,alt:t.alt,width:40,height:40,className:"rounded"})});const n={pro:l.jsx(ge,{icon:qs.pro,size:"lg"}),collection:l.jsx(ge,{icon:qs.collection,size:"lg"}),gmail_gcal:l.jsx(K,{variant:"subtle",className:"p-xs rounded-md border",children:l.jsx("img",{src:wx,alt:"Gmail Gcal Upsell Banner",width:40,height:40})}),research:l.jsx(ge,{icon:qs.research,size:"lg"}),labs:l.jsx(ge,{icon:qs.labs,size:"lg"}),max:l.jsx(Gd,{size:"tiny",variant:"mark",isMax:!0}),shortcut:l.jsx(ge,{icon:B("square-forbid-2"),size:"lg"}),comet_login:l.jsx(K,{variant:"super",className:"p-xs rounded-md border",children:l.jsx(V,{color:"defaultInverted",children:l.jsx(gM,{size:24})})}),pro_perks:l.jsx(ge,{icon:qs.pro_perks,size:"lg"}),app:l.jsx(ge,{icon:qs.app,size:"lg"}),slides:l.jsx(ge,{icon:qs.slides,size:"lg"}),document:l.jsx(ge,{icon:qs.document,size:"lg"}),plaintext:l.jsx(ge,{icon:qs.plaintext,size:"lg"}),canvas:l.jsx(ge,{icon:qs.canvas,size:"lg"}),browser_agent:l.jsx(rn,{icon:B("click"),size:"large"}),advanced_models:l.jsx(ge,{icon:qs.advanced_models,size:"lg"})};return e==="comet_download"?null:n[e||""]||null},Jd=A.memo(({position:e,upsellInformation:t,inFlight:n,isLastResult:r,backendUuid:s,contextUuid:o,queryStr:a,animateExpand:i=!0,hideOnAccept:c=!0,hideOnReject:u=!0,isSkipping:f=!1,onAccept:m,onReject:p,className:h})=>{const{$t:g}=J(),{show:y,handleDismiss:x,handleHide:v}=jFe({position:e,inFlight:n,isLastResult:r,upsellInformation:t,backendUuid:s}),b=d.useCallback(()=>{x({hideBanner:u}),p?.()},[x,p,u]),_=d.useCallback(()=>{x({hideBanner:c}),m?.()},[x,m,c]),S=fn()?.get("handle_upsell");d.useEffect(()=>{if(y&&S){const k=new URLSearchParams(window.location.search);k.delete("handle_upsell");const I=Object.fromEntries(k.entries());zQ(I),_()}},[_,y,S]);const C=Wt();if(!y||!t||C&&t.upsell_type===Qs.LOGIN)return null;if(t.upsell_type===Qs.WAIT_FOR_BROWSER_AGENT_CONFIRMATION)return l.jsx(oee,{upsellInformation:t,show:y,animateExpand:i,inFlight:n,onPermissionResponse:_,hideUpsell:v});if(t.upsell_type===Qs.DAILY_QUESTIONS_FEATURE_ENTRYPOINTS)return l.jsx(aee,{type:t.name,actionCards:t.action_cards,show:y,entryUUID:s,contextUUID:o,queryStr:a});const E=ZFe(t),T=t.upsell_type!==Qs.WAIT_FOR_CANVAS_GENERATION_CONFIRMATION;return l.jsx(St,{children:l.jsx(Te.div,{initial:i?{height:0}:{opacity:0},animate:i?{height:"auto"}:{opacity:1},exit:i?{height:0}:{opacity:0},transition:{duration:.2},children:l.jsx("div",{className:"bg-base",children:l.jsxs(K,{variant:t.background_super?"superLight":"subtler",className:z("gap-sm mb-md p-md md:gap-md relative flex w-full flex-col items-center rounded-md md:flex-row",{"rounded-xl shadow-xl ring-1":e==="input"||e==="router_steps"},h),children:[E&&l.jsx(V,{color:"default",className:"hidden md:block",children:E}),l.jsxs("div",{className:"md:mr-sm relative flex w-full flex-col",children:[l.jsx(V,{variant:"smallBold",className:z("mr-lg md:mr-0",{"line-clamp-2":t.upsell_type===Qs.CREATE_SHORTCUT}),children:t.title}),l.jsx(V,{variant:"small",color:"light",className:"mb-0 font-normal leading-[1.3]",children:t.description})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col-reverse md:w-auto md:flex-row md:items-center md:justify-end",children:[T&&l.jsx(st,{text:g({defaultMessage:"Skip",id:"/4tOwTiCH6"}),size:"small",onClick:b,variant:"common",isLoading:f}),t.button_text&&l.jsx(see,{upsellInformation:t,inFlight:n,position:e,hideUpsell:v})]})]})})})})});Jd.displayName="ThreadUpsell";const oee=A.memo(({upsellInformation:e,show:t,animateExpand:n=!0,inFlight:r,onPermissionResponse:s,hideUpsell:o})=>{const a=kl({upsellInformation:e,inFlight:r,options:{hideUpsell:o}}),i=e?.cta_information?.secondary_button,c=e?.cta_information?.tertiary_button,u=kl({upsellInformation:i?{...e,cta:i.cta,button_text:i.button_text}:e,inFlight:r,options:{hideUpsell:o}}),f=kl({upsellInformation:c?{...e,cta:c.cta,button_text:c.button_text}:e,inFlight:r,options:{hideUpsell:o}});return t?l.jsx(St,{children:l.jsx(Te.div,{initial:n?{height:0}:{opacity:0},animate:n?{height:"auto"}:{opacity:1},exit:n?{height:0}:{opacity:0},transition:{duration:.2},children:l.jsxs(Y0,{title:e.title,description:e.description,leadingAccessory:B("click"),size:"default",children:[c&&l.jsx(Y0.Action,{variant:"text",onClick:()=>{s(),f()},children:c.button_text}),i&&l.jsx(Y0.Action,{variant:"secondary",onClick:()=>{s(),u()},children:i.button_text}),l.jsx(Y0.Action,{variant:"primary",onClick:()=>{s(),a()},children:e.button_text})]})})}):null});oee.displayName="BrowserAgentPermissionBanner";const aee=A.memo(({actionCards:e,queryStr:t,entryUUID:n,contextUUID:r,show:s,animateExpand:o=!0})=>{const{$t:a}=J(),i=LFe(),{detectedLanguages:c}=tee({clickedPhrase:i[0]??"",entryUUID:n??"",contextUUID:r??"",translatePhrases:i}),{isMobileStyle:u}=Re(),f=Uo().openModal,m=d.useRef(null),p=d.useRef(null),h=d.useCallback((x,v)=>{const b={[tn.LANGUAGE_LEARNING_FLASHCARDS]:"flashcards",[tn.LANGUAGE_LEARNING_VOICE_TUTOR]:"voice_tutor"},_=vt.getItem(_6),w=x==="LANGUAGE_LEARNING_FLASHCARDS"?_?_==="true":!0:!1;f(XFe,{legacyIdentifier:"translationModal",stringBounds:v.current?.getBoundingClientRect()??new DOMRect,string:i[0]??"",entryUUID:n??"",contextUUID:r??"",queryStr:t??"",translatePhrases:i,isMobileStyle:u,autoplay:w,initialWidth:window.innerWidth,defaultMode:b[x]})},[i,u,n,r,t,f]),g=d.useMemo(()=>c?{[tn.LANGUAGE_LEARNING_FLASHCARDS]:{text:a({defaultMessage:"Flash Cards",id:"t0yioEPoC6"}),subtext:a({defaultMessage:"Practice {language} with audio flash cards",id:"ZRcObnW+uj"},{language:c.learning_language}),onClick:()=>h(tn.LANGUAGE_LEARNING_FLASHCARDS,m),ref:m},[tn.LANGUAGE_LEARNING_VOICE_TUTOR]:{text:a({defaultMessage:"Voice Tutor",id:"rWFec/0yfN"}),subtext:a({defaultMessage:"Learn how to pronounce {language} words out loud.",id:"IXEyZm0BqT"},{language:c.learning_language}),onClick:()=>h(tn.LANGUAGE_LEARNING_VOICE_TUTOR,p),ref:p}}:null,[c,h,a]),y=d.useMemo(()=>g?e.map(x=>{const v=g[x.cta];return v?l.jsx(wt,{variant:"text",onClick:v.onClick,ref:v.ref,children:l.jsxs("div",{className:"gap-xs flex flex-col items-start",children:[l.jsx(V,{variant:"smallBold",children:v.text}),l.jsx(V,{variant:"small",color:"light",children:v.subtext})]})},x.cta):null}):null,[e,g]);return!c||!s?null:l.jsx(St,{children:l.jsxs(Te.div,{initial:o?{height:0}:{opacity:0},animate:o?{height:"auto"}:{opacity:1},exit:o?{height:0}:{opacity:0},transition:{duration:.2},className:"gap-xs flex flex-col",children:[l.jsx(V,{variant:"baseSemi",children:a({defaultMessage:"More ways to learn {language}",id:"R68m2bFJEK"},{language:c.learning_language})}),l.jsx("div",{className:"gap-xs flex",children:y})]})})});aee.displayName="DailyQuestionsEntrypointsBanner";function JFe(e){const{sourceType:t,skippedSources:n}=e;return!(!t||n.has(t))}const vI="/static/images/agent-favicons/gmail.svg",eBe="/static/images/data-connectors/microsoft/outlook-avatar.svg",Ri={click:{message:W({defaultMessage:"Clicking",id:"n43/KMHgLD"}),icon:B("click")},paused:{message:W({defaultMessage:"Paused",id:"C2iTEHtK//"}),icon:B("pointer-pause")},fill:{message:W({defaultMessage:"Filling out a form",id:"5i0X5DesMM"}),icon:B("forms")},search:{message:W({defaultMessage:"Searching",id:"IfE0if3ytt"}),icon:B("search")},search_images:{message:W({defaultMessage:"Searching for images",id:"NaBAkNUPuD"}),icon:B("search")},navigate:{message:W({defaultMessage:"Navigating",id:"3O6LMNhb0M"}),icon:B("location")},press_key:{message:W({defaultMessage:"Pressing key",id:"R6bmgzv6Xs"}),icon:B("keyboard")},key:{message:W({defaultMessage:"Pressing key",id:"R6bmgzv6Xs"}),icon:B("keyboard")},scroll_page:{message:W({defaultMessage:"Scrolling",id:"/UUUqdefcb"}),icon:B("square-rounded-arrow-down")},scroll:{message:W({defaultMessage:"Scrolling",id:"/UUUqdefcb"}),icon:B("square-rounded-arrow-down")},reasoning:{message:W({defaultMessage:"Reasoning",id:"Aw3qRf7hyO"}),icon:B("bubble-text")},considering_clarification:{message:W({defaultMessage:"Considering your clarification",id:"xvwGmM2LU3"}),icon:B("bubble-text")},working:{message:W({defaultMessage:"Working",id:"gAR0atqpRn"}),icon:B("access-point")},finished:{message:W({defaultMessage:"Done",id:"JXdbo8Vnlw"}),icon:B("check")},reading:{message:W({defaultMessage:"Reading",id:"MOK/yKIpYX"}),icon:B("file-text")},reading_browser:{message:W({defaultMessage:"Reviewing your tabs and browser history",id:"P+tFAY9IRT"}),icon:B("file-text")},getting_source:{message:W({defaultMessage:"Getting source",id:"Z1eFpRpq7v"}),icon:B("file-text")},getting_sources:{message:W({defaultMessage:"Getting sources",id:"Jv/OJ6AjyO"}),icon:B("file-text")},reviewing_source:{message:W({defaultMessage:"Reviewing source",id:"ymFEF2YHhs"}),icon:B("file-text")},reviewing_sources:{message:W({defaultMessage:"Reviewing sources",id:"/NZJDBzKok"}),icon:B("file-text")},reviewing_memory:{message:W({defaultMessage:"Reviewing memory",id:"piUVOodSmM"}),icon:B("file-text")},reviewing_memories:{message:W({defaultMessage:"Reviewing memories",id:"VgUfUXIIey"}),icon:B("file-text")},reviewing_conversation_history:{message:W({defaultMessage:"Reviewing past queries",id:"RfG7EQT3IO"}),icon:B("file-text")},reading_tabs:{message:W({defaultMessage:"Reviewing your tabs",id:"cE3TzCT3eK"}),icon:B("file-text")},building_app:{message:W({defaultMessage:"Building application",id:"qK6gEQyvil"}),icon:B("tools")},creating_chart:{message:W({defaultMessage:"Creating chart",id:"yc5YxtS5VS"}),icon:B("graph")},creating_pdf:{message:W({defaultMessage:"Creating PDF",id:"NcD2ia4Hrn"}),icon:B("file-type-pdf")},creating_docx:{message:W({defaultMessage:"Creating DOCX",id:"GIUtasyzkA"}),icon:B("file-type-docx")},creating_xlsx:{message:W({defaultMessage:"Creating XLSX",id:"ZyT2MB8/KD"}),icon:B("file-spreadsheet")},thinking:{message:W({defaultMessage:"Thinking",id:"AHQWDTo4+e"}),icon:B("bubble-text")},reading_history:{message:W({defaultMessage:"Reviewing your browser history",id:"7cZkJ7qeNW"}),icon:B("world-search")},searching_browser:{message:W({defaultMessage:"Searching your browser",id:"i91D1hXua6"}),icon:B("world-search")},searching_open_tabs:{message:W({defaultMessage:"Searching open tabs",id:"xHbSQOjdLq"}),icon:B("input-search")},opening_tab:{message:W({defaultMessage:"Opening tab",id:"ySnoI+lduZ"}),icon:B("browser-plus")},closing_tabs:{message:W({defaultMessage:"Closing your tabs",id:"2KnXtfjRKV"}),icon:B("browser-minus")},searching_gmail:{message:W({defaultMessage:"Searching your email",id:"X1ami4cm1T"}),icon:B("mail-search")},emailing:{message:W({defaultMessage:"Emailing",id:"QRygokyD+u"}),icon:B("mail-search")},searching_calendar:{message:W({defaultMessage:"Searching your calendar",id:"nH9G8cL0Ys"}),icon:B("calendar-search")},conclusion:{message:W({defaultMessage:"Wrapping up",id:"DN3hjkyzeT"}),icon:null},generating_images:{message:W({defaultMessage:"Generating",id:"NAZfqr2apb"}),icon:B("photo-bolt")},presenting_images:{message:W({defaultMessage:"Presenting",id:"BlxYo7+tmK"}),icon:B("slideshow")},grouping_tabs:{message:W({defaultMessage:"Grouping tabs",id:"Fg6l7eg2HV"}),icon:B("server-bolt")},ungrouping_tabs:{message:W({defaultMessage:"Ungrouping tab groups",id:"dbpFCBu2NQ"}),icon:B("server-off")},searching_tab_groups:{message:W({defaultMessage:"Searching tab groups",id:"V+4/ioYMPd"}),icon:B("search")},getting_freebusy:{message:W({defaultMessage:"Checking availability",id:"ZamRNp2QgI"}),icon:B("calendar-search")},getting_user_info:{message:W({defaultMessage:"Searching your contacts",id:"gPpZJKZdnL"}),icon:B("address-book")},found_contacts:{message:W({defaultMessage:"Found contacts",id:"2zmZgbYnmk"}),icon:B("address-book")},no_contacts_found:{message:W({defaultMessage:"No contacts found",id:"JhY7bAH15Y"}),icon:B("address-book")},selecting_contacts:{message:W({defaultMessage:"Selecting contacts",id:"OQhQc1Jomc"}),icon:B("address-book")},getting_contact_details:{message:W({defaultMessage:"Getting contact details",id:"p391mWkGfv"}),icon:B("address-book")},scheduling:{message:W({defaultMessage:"Scheduling",id:"5lQx5rgTEW"}),icon:B("calendar-plus")},scheduled:{message:W({defaultMessage:"Scheduled",id:"cXAlMRerxW"}),icon:B("calendar-plus")},reading_events:{message:W({defaultMessage:"Getting event details",id:"0QgD+ftRet"}),icon:B("calendar-search")},reading_emails:{message:W({defaultMessage:"Reviewing emails",id:"f/yAuwo+Vl"}),icon:B("mail-search")},OPEN_TAB:{message:W({defaultMessage:"Open tabs",id:"KO2pxljl8b"}),icon:B("browser-plus")},RECENTLY_CLOSED_TAB:{message:W({defaultMessage:"Recently closed tabs",id:"GrcBtKIzPh"}),icon:B("browser-minus")},BROWSER_HISTORY:{message:W({defaultMessage:"Browser history",id:"DtBSny6kw5"}),icon:B("world-search")},MCP_TOOL:{message:W({defaultMessage:"Connecting to {appName}",id:"w+iLkzBJV0"}),icon:B("tools")},searching_flights:{message:W({defaultMessage:"Searching flights",id:"9+i0zI94jg"}),icon:B("search")},reviewing_booking_options:{message:W({defaultMessage:"Reviewing options",id:"hEF13crkAK"}),icon:B("search")},looking_for_booking_options:{message:W({defaultMessage:"Looking for booking options",id:"KIKXHtHJvz"}),icon:B("search")},redirecting_to_booking:{message:W({defaultMessage:"Redirecting to booking site",id:"y/a1lYMfGW"}),icon:B("search")},setting_up_price_alert_automation:{message:W({defaultMessage:"Setting up PriceAlertAutomation",id:"+7IqVk27BT"}),icon:B("graph")},read_page:{message:W({defaultMessage:"Reading page",id:"eEZaxWqt5u"}),icon:B("file-text")},get_page_text:{message:W({defaultMessage:"Getting page text",id:"rZqPh2Mfgi"}),icon:B("file-text")},tabs_context:{message:W({defaultMessage:"Getting tab context",id:"kcCvqWgrPU"}),icon:B("file-text")},tabs_create:{message:W({defaultMessage:"Creating tab",id:"NprxDW5RAN"}),icon:B("browser-plus")},form_input:{message:W({defaultMessage:"Filling form",id:"+gn8Qfhxa/"}),icon:B("forms")},find:{message:W({defaultMessage:"Finding elements",id:"PicRTL+DUk"}),icon:B("search")},find_elements:{message:W({defaultMessage:"Finding elements",id:"PicRTL+DUk"}),icon:B("search")},search_web:{message:W({defaultMessage:"Searching",id:"IfE0if3ytt"}),icon:B("search")},creating_todo_list:{message:W({defaultMessage:"Creating to-do list",id:"ZOeanuIrvQ"}),icon:B("checklist")},updating_todo_list:{message:W({defaultMessage:"Updating to-do list",id:"bb/FiiKtsc"}),icon:B("checklist")},running_sub_tasks:{message:W({defaultMessage:"Running sub-tasks",id:"H8wmfkHGA3"}),icon:B("server-bolt")},left_click:{message:W({defaultMessage:"Clicking",id:"n43/KMHgLD"}),icon:B("click")},right_click:{message:W({defaultMessage:"Right clicking",id:"YAxezKzj4p"}),icon:B("click")},double_click:{message:W({defaultMessage:"Double clicking",id:"anyjKtRL4p"}),icon:B("click")},triple_click:{message:W({defaultMessage:"Triple clicking",id:"aqH53Ke8R4"}),icon:B("click")},left_click_drag:{message:W({defaultMessage:"Dragging",id:"A/Bht8akH/"}),icon:B("click")},type:{message:W({defaultMessage:"Typing",id:"N2bqd9kL1X"}),icon:B("keyboard")},screenshot:{message:W({defaultMessage:"Reading page",id:"eEZaxWqt5u"}),icon:B("file-text")},wait:{message:W({defaultMessage:"Waiting",id:"dZd8H/KE0T"}),icon:B("access-point")},bash:{message:W({defaultMessage:" ",id:"+Q3dd+QA3+"}),icon:B("terminal-2")},file_read:{message:W({defaultMessage:"Reading",id:"MOK/yKIpYX"}),icon:B("file-text")},file_write:{message:W({defaultMessage:"Editing",id:"pBQ5bdyqop"}),icon:B("file-text")},file_edit:{message:W({defaultMessage:"Editing",id:"pBQ5bdyqop"}),icon:B("file-text")}},bI={initial:{opacity:0,position:"absolute",width:"100%"},animate:{opacity:1,position:"relative",transition:{opacity:{duration:1.2}}},exit:{opacity:0,position:"absolute",width:"100%",transition:{opacity:{duration:1.2}}}},tBe=()=>{const{$t:e}=J();return d.useMemo(()=>({success:e({defaultMessage:"Success",id:"xrKHS6mnOh"}),couldNotFinish:e({defaultMessage:"Could not finish",id:"Sz8oY2B0GK"}),allEmail:e({defaultMessage:"All Emails",id:"xe3SFk3aV+"}),allTabs:e({defaultMessage:"All tabs",id:"vYBCIf+wNz"}),failedClosedTabs:e({defaultMessage:"Could not close tabs",id:"hjoQ7gU34V"}),results:e({defaultMessage:"Results",id:"yaMHMBMsQ7"}),continue:e({defaultMessage:"Continue",id:"acrOozm08x"}),skip:e({defaultMessage:"Skip",id:"/4tOwTiCH6"}),foundInfo:e({defaultMessage:"Details retrieved",id:"YCMMMHEIKw"}),allTabGroups:e({defaultMessage:"All tab groups",id:"YL1jEopcqf"}),gmailNotAuthenticated:e({defaultMessage:"Gmail not connected",id:"Zj8MiXlulR"}),googleCalendarNotAuthenticated:e({defaultMessage:"Google Calendar not connected",id:"PH33AilmeW"}),matchesFound:t=>t===0?e({defaultMessage:"No matches found",id:"KeJh7yZCu8"}):e({defaultMessage:"{count, plural, one {One match found} other {# matches found}}",id:"ji6QO7fi7u"},{count:t}),emailsFound:t=>t===0?e({defaultMessage:"No emails found",id:"suW4stNi19"}):e({defaultMessage:"{count, plural, one {# email} other {# emails}}",id:"Rh0ulH+p+5"},{count:t}),eventsFound:t=>t===0?e({defaultMessage:"No events found",id:"GDgEmCHaVM"}):e({defaultMessage:"{count, plural, one {# event} other {# events}}",id:"HhJ8RP7qsx"},{count:t}),availableTimesFound:t=>t===0?e({defaultMessage:"No available times found",id:"2jnY2Ky2Nv"}):e({defaultMessage:"{count, plural, one {# available time} other {# available times}}",id:"5yH+BVFO1f"},{count:t}),selectedContacts:t=>e({defaultMessage:"Selected {count, plural, one {# contact} other {# contacts}}",id:"4kDAeuSFTs"},{count:t}),skippedContacts:e({defaultMessage:"Skipped selecting contacts",id:"IXqYGlHPpF"}),noAvailabilityFound:e({defaultMessage:"No availability",id:"x2vleFRn/L"})}),[e])},nBe=({tool_input_content:e})=>{const t=e.tool_input?.subagent_tool_inputs?.subagents;return t?l.jsx(K,{className:"gap-y-md flex flex-col",children:t.filter(n=>n.task_uuid).map((n,r)=>{const s=e.subagent_steps?.[n.task_uuid]?.steps;return s?l.jsxs("div",{className:"rounded-lg border p-4 transition-colors duration-150",children:[n.description&&l.jsx(V,{className:"mb-3",children:n.description}),s[s.length-1]?.thought&&l.jsx(V,{color:"light",variant:"small",children:s[s.length-1]?.thought})]},r):null})}):null};var Oc;(function(e){e.PENDING="pending",e.IN_PROGRESS="in_progress",e.COMPLETED="completed"})(Oc||(Oc={}));function rBe(e){switch(e){case Oc.COMPLETED:return{icon:B("circle-check"),iconClassName:"text-quietest mb-0.5",textColor:"ultraLight",textClassName:"line-through"};case Oc.IN_PROGRESS:return{icon:B("circle-arrow-right"),iconClassName:"text-quiet mb-0.5",textColor:"light",textClassName:void 0};case Oc.PENDING:return{icon:B("circle"),iconClassName:"text-quiet mb-0.5",textColor:"light",textClassName:void 0};default:At(e)}}const iee=({todos:e})=>l.jsx("div",{className:"bg-offset p-md rounded-xl",children:l.jsx("div",{className:"gap-xs flex flex-col",children:e.map((t,n)=>{const r=t.status??Oc.PENDING,s=r===Oc.IN_PROGRESS&&t.active_form?t.active_form:t.content??"",{icon:o,iconClassName:a,textColor:i,textClassName:c}=rBe(r);return l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ge,{icon:o,size:"sm",className:a}),l.jsx(V,{variant:"small",color:i,className:c,children:s})]},`${s}-${n}`)})})});iee.displayName="TodoListStep";const Is=` -`;function lee({baseInstructions:e,additionalInstructions:t}){let n=e+Is;return t&&(n+=t),n}function _I({prompt:e,baseInstructions:t}){if(!e||!t)return"";const n=e.replace(/\\n/g,Is),r=t.replace(/\\n/g,Is),s=r+Is;if(n.startsWith(s))return n.slice(s.length);if(n.startsWith(r)){const i=n.slice(r.length);if(i.startsWith(Is))return i.slice(Is.length);if(i.trim()==="")return""}return n.startsWith(r)?"":n}function sBe(e){const t=e.split(Is),n=t[0]||"",r=t.length>1?t.slice(1).join(Is):"";return{baseInstructions:n,additionalInstructions:r}}function oBe(e,t){let n=e;for(const[r,s]of Object.entries(t))n=n.replaceAll(r,s);return n}function wI({rawInstructions:e,symbol:t,quoteName:n="",eventValue:r,direction:s}){return oBe(e,{"\\\\n":` -`,"{symbol}":t,"{quoteName}":n,"{{event_value}}":r,"{{direction}}":s})}function cee({prompt:e,symbol:t,quoteName:n=""}){if(!t||!e)return"";let r=e;r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1));const s="Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent {{direction}} to {{event_value}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.",o="Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent {{event_value}}% {{direction}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.";let a=r;if(a.startsWith(s+Is))a=a.slice((s+Is).length);else if(a.startsWith(o+Is))a=a.slice((o+Is).length);else if(a===s||a===o)return"";if(a.includes(Is)){const i=a.split(Is);a=i[i.length-1]??a}return a}function NE({selectedSymbol:e,symbol:t,quote:n,isLoading:r=!1,alertType:s,priceValue:o,percentValue:a,currencySymbol:i,$t:c}){const u=e??t,f=n?.name?` (${n.name})`:"",m=d.useMemo(()=>s==="price"?aBe({symbol:u,quoteName:f,priceValue:o,currencySymbol:i,$t:c}):iBe({symbol:u,quoteName:f,percentValue:a,$t:c}),[s,u,f,o,i,c,a]),p=d.useMemo(()=>!u||!n?"":s==="price"?$v({symbol:u,quoteName:f}):qv({symbol:u,quoteName:f}),[u,n,s,f]),h=!r&&n?.name;return d.useMemo(()=>({shouldShowDisplayInstructions:h,displayInstructions:m,baseInstructions:p,effectiveSymbol:u,quoteName:f}),[p,m,u,f,h])}function $v({symbol:e,quoteName:t,$t:n}){return n?n({id:"0J1c9pn78+",defaultMessage:"Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent '{{direction}}' to '{{event_value}}'. Contextualize this price movement within the last few weeks of price movement and investor narrative."},{symbol:e||"",quoteName:t||""}):`Explain the factors driving the latest movement of ${e}${t||""}, including its recent {{direction}} to {{event_value}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.`}function qv({symbol:e,quoteName:t,$t:n}){return n?n({id:"9XAm3nfaVB",defaultMessage:"Explain the factors driving the latest movement of {symbol}{quoteName}, including its recent '{{event_value}}%' '{{direction}}'. Contextualize this price movement within the last few weeks of price movement and investor narrative."},{symbol:e||"",quoteName:t||""}):`Explain the factors driving the latest movement of ${e}${t||""}, including its recent {{event_value}}% {{direction}}. Contextualize this price movement within the last few weeks of price movement and investor narrative.`}function aBe({symbol:e,quoteName:t,priceValue:n,currencySymbol:r,$t:s}){if(!e)return s({id:"39tYCstx5d",defaultMessage:"Explain the factors driving the latest movement of this asset, including its recent rise/fall. Contextualize this price movement within the last few weeks of price movement and investor narrative."});const o=n&&n!=="$"?s({defaultMessage:" to {currencySymbol}{priceValue}",id:"zSy/VeEpR9"},{priceValue:n,currencySymbol:r}):"",a=s({defaultMessage:"rise/fall",id:"+dqzTFX/gy"});return $v({symbol:e,quoteName:t,$t:s}).replace(" to {{event_value}}",o).replace("{{direction}}",a)}function iBe({symbol:e,quoteName:t,percentValue:n,$t:r}){if(!e)return r({id:"pP0ylRs8IX",defaultMessage:"Explain the factors driving the latest movement of this asset, including its recent increase/decrease. Contextualize this price movement within the last few weeks of price movement and investor narrative."});const s=r({id:"QBY86oKDNP",defaultMessage:"increase/decrease"});return qv({symbol:e,quoteName:t,$t:r}).replace(" {{event_value}}%",n?` ${parseFloat(n).toFixed(2)}%`:"").replace("{{direction}}",s)}const Bl=1e9,Ul=-1e9;function RE({symbol:e,alertType:t,priceValue:n,priceThreshold:r,percentValue:s,positiveSelected:o=!0,negativeSelected:a=!0,baseInstructions:i,additionalInstructions:c=""}){let u,f="";if(t==="price"){if(!n||!r)return null;const p=parseFloat(n.replace(/[^0-9.]/g,""));if(isNaN(p))return null;u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_TARGET",value_lower_bound:r==="below"?p:Ul,value_upper_bound:r==="above"?p:Bl},f=`Alert when ${e} is ${r} ${n}`}else if(t==="movement"){if(!s)return null;const p=parseFloat(s);if(isNaN(p))return null;o&&a?(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:-p,value_upper_bound:p},f=`Alert when ${e} moves +${s}% or -${s}% in a day`):o?(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:Ul,value_upper_bound:p},f=`Alert when ${e} moves +${s}% in a day`):a&&(u={event_entity:e,event_group:"FINANCE",event_type:"STOCK_PRICE_MOVEMENT",value_lower_bound:-p,value_upper_bound:Bl},f=`Alert when ${e} moves -${s}% in a day.`)}if(!u)return null;const m=lee({baseInstructions:i,additionalInstructions:c});return{task_name:f,prompt:m,event_subscription:u,model_preference:"turbo"}}const CI="usd";function X0(e){return e!=null&&e!==Bl&&e!==Ul&&e!==dR&&e!==-1&&Math.abs(e)!==dR}const Rr=A.memo(({icon:e,text:t,favicon:n,className:r,iconClassName:s,url:o})=>{const a=l.jsx(K,{variant:"subtler",className:z("py-xs inline-block rounded-lg px-2",{"hover:bg-super group cursor-pointer":o},r),children:l.jsxs(V,{variant:"tinyRegular",className:z("gap-x-xs flex items-center",{"group-hover:text-inverse dark:group-hover:text-inverse":o}),children:[n?l.jsx("img",{src:n,alt:t,className:"size-[14px]"}):e?l.jsx(ge,{icon:e,size:"xs",className:s}):null,l.jsx("p",{className:"px-two",children:t})]})});return o?l.jsx(yt,{href:o,target:"_blank",rel:"noopener",children:a}):a});Rr.displayName="BotLabel";const lBe=async(e,t,n)=>{const{data:r,error:s,response:o}=await de.POST("/rest/sse/handle_tool_user_approval_response","mcp-tool-user-approval",{body:{result:{uuid:e,allow_tool_call:t,user_revision:n}}});if(s)throw s;return{data:r,error:s,response:o}},uee=()=>Rt({mutationFn:({uuid:e,allowToolCall:t,userRevision:n})=>lBe(e,t,n)}),cBe=async(e,t,n)=>{try{const{data:r,error:s,response:o}=await de.POST("/rest/sse/handle_perplexity_research_clarifying_answers","research-clarifying-questions",{body:{result:{tool_uuid:t,answers:e,submit_type:n}}});if(s){Z.log("Error submitting research clarifying questions:",s);return}return{data:r,error:s,response:o}}catch(r){Z.log(r);return}},uBe=()=>Rt({mutationFn:({answers:e,toolUuid:t,submitType:n})=>cBe(e,t,n)}),dee=A.memo(({entryUUID:e,sourceType:t,sourceName:n,userApprovalUuid:r,onSkipSourceClicked:s,isAutoDetected:o})=>{const[a,i]=d.useState(!1),{actions:c}=It(),{openToast:u}=hn(),{session:f}=Ne(),{trackEvent:m}=Xe(f),p=J(),h=uee(),g=d.useCallback(async()=>{i(!0),s?.(),m("query source skipped",{entryUUID:e,sourceType:t,sourceName:n,isAutoDetected:o}),c.addSkippedSource(t);try{await Nge({entryUUID:e,sourceType:t,reason:"skip-source-button"}),r&&h.mutate({uuid:r,allowToolCall:"SKIP_SOURCE"})}catch{u({message:p.formatMessage({defaultMessage:"Failed to skip source",id:"73EQcPTvg9"}),variant:"error",timeout:null}),c.removeSkippedSource(t),i(!1)}},[e,t,n,o,c,u,p,r,h,s,m]);return l.jsx(V,{color:"light",variant:"small",className:"text-pretty",children:l.jsx("div",{className:"relative min-h-[20px] w-full",children:a?l.jsx(Te.div,{initial:"initial",animate:"animate",exit:"exit",variants:bI,children:l.jsx(br,{variant:"super",as:"div",className:"px-sm flex h-6 items-center",children:l.jsx(je,{defaultMessage:"Skipping…",id:"6NU82XTPCI"})})},"skipping-message"):l.jsx(Te.div,{initial:"initial",animate:"animate",exit:"exit",variants:bI,children:l.jsx(Ge,{size:"tiny",onClick:g,variant:"common",icon:B("player-track-next"),extraCSS:"rounded-lg",text:l.jsx(je,{defaultMessage:"Skip {sourceName}",id:"B0WVL5L6bh",values:{sourceName:n}}),"data-testid":"skip-source-button"})},"skip-button")})})});dee.displayName="SkipSourceButton";const fee=A.memo(({mediaItems:e,className:t})=>{const n=e?.[e?.length-1],r=n?.media_item,s=r?.image||r?.thumbnail,o=d.useMemo(()=>({url:r?.url,name:r?.name}),[r?.name,r?.url]);return n?l.jsxs("div",{className:z("@xs:px-md @xs:pb-md px-sm pb-sm relative flex flex-col gap-1.5",t),children:[l.jsx(St,{mode:"wait",children:l.jsx(Te.div,{className:"after:ring-subtler @xs:w-20 md:@xs:w-60 relative overflow-hidden rounded after:pointer-events-none after:absolute after:inset-0 after:rounded-md after:ring-1 after:ring-inset after:ring-opacity-50 md:w-full dark:after:ring-0",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeOut"},children:l.jsx(Wo,{src:r?.thumbnail,lightboxSrc:s,alt:r?.name,origin:o,includeLightBoxModal:!0,rounded:!0,imageClassName:"object-cover w-full text-[0] dark:mix-blend-normal",containerClassName:"h-full w-full",maskClassName:"bg-subtler"})},r?.thumbnail)}),r?.url&&l.jsx("div",{children:l.jsx(yt,{href:r?.url,target:"_blank",children:l.jsx(st,{icon:B("arrow-up-right"),variant:"common",size:"tiny",text:"Open page",extraCSS:"group",iconClassName:"group-hover:text-super",textClassName:"group-hover:text-super font-normal",noPadding:!0})})})]}):null});fee.displayName="StepCardMedia";const Dl=(e,t,n)=>{const r=document.createElement(e),[s,o]=Array.isArray(t)?[void 0,t]:[t,n];return s&&Object.assign(r,s),o?.forEach(a=>r.appendChild(a)),r},dBe=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},fBe=e=>e.offsetWidth>0&&e.offsetHeight>0,mBe=(e,t)=>{customElements.get(e)!==t&&customElements.define(e,t)};function pBe(e,t,{reverse:n=!1}={}){const r=e.length;for(let s=n?r-1:0;n?s>=0:s`${y}:${u[y]=(u[y]??-1)+1}`;let m="",p=!1,h=!1;for(const y of s){m+=y.value;const x=y.type==="minusSign"||y.type==="plusSign"?"sign":y.type;x==="integer"?(p=!0,a.push(...y.value.split("").map(v=>({type:x,value:parseInt(v)})))):x==="group"?a.push({type:x,value:y.value}):x==="decimal"?(h=!0,i.push({type:x,value:y.value,key:f(x)})):x==="fraction"?i.push(...y.value.split("").map(v=>({type:x,value:parseInt(v),key:f(x),pos:-1-u[x]}))):(p||h?c:o).push({type:x,value:y.value,key:f(x)})}const g=[];for(let y=a.length-1;y>=0;y--){const x=a[y];g.unshift(x.type==="integer"?{...x,key:f(x.type),pos:u[x.type]}:{...x,key:f(x.type)})}return{pre:o,integer:g,fraction:i,post:c,valueAsString:m,value:typeof e=="string"?parseFloat(e):e}}const gBe=String.raw,yBe=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),xBe=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),SI=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,S2="--_number-flow-d-opacity",w6="--_number-flow-d-width",E2="--_number-flow-dx",C6="--_number-flow-d",vBe=(()=>{try{return CSS.registerProperty({name:S2,syntax:"",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:E2,syntax:"",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:w6,syntax:"",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:C6,syntax:"",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),bBe="var(--number-flow-char-height, 1em)",fl="var(--number-flow-mask-height, 0.25em)",EI=`calc(${fl} / 2)`,DE="var(--number-flow-mask-width, 0.5em)",pc=`calc(${DE} / var(--scale-x))`,Z0="#000 0, transparent 71%",kI=gBe`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${bBe} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${w6}) / var(--width));transform:translateX(var(${E2})) scaleX(var(--scale-x));margin:0 calc(-1 * ${DE});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${pc},#000 calc(100% - ${pc}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${fl},#000 calc(100% - ${fl}),transparent 100% ),radial-gradient(at bottom right,${Z0}),radial-gradient(at bottom left,${Z0}),radial-gradient(at top left,${Z0}),radial-gradient(at top right,${Z0});-webkit-mask-size:100% calc(100% - ${fl} * 2),calc(100% - ${pc} * 2) 100%,${pc} ${fl},${pc} ${fl},${pc} ${fl},${pc} ${fl};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${EI} ${DE};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${E2})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${C6})}.digit__num,.number .section::after{padding:${EI} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${S2}))}`,_Be=HTMLElement,wBe=xBe&&yBe&&vBe;let J0,mee=class extends _Be{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:s,fraction:o,post:a,value:i}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,i):this.trend,this.computedAnimated=wBe&&this._animated&&(!this.respectMotionPreference||!(SI!=null&&SI.matches))&&fBe(this),(n=this.plugins)==null||n.forEach(u=>{var f;return(f=u.onUpdate)==null?void 0:f.call(u,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:s,fraction:o}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)J0||(J0=new CSSStyleSheet,J0.replaceSync(kI)),this.shadowRoot.adoptedStyleSheets=[J0];else{const c=document.createElement("style");c.textContent=kI,this.shadowRoot.appendChild(c)}this._pre=new TI(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new CBe(this,s,o),this.shadowRoot.appendChild(this._num.el),this._post=new TI(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};mee.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};let CBe=class{constructor(t,n,r,{className:s,...o}={}){this.flow=t,this._integer=new MI(t,n,{justify:"right",part:"integer"}),this._fraction=new MI(t,r,{justify:"left",part:"fraction"}),this._inner=Dl("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=Dl("span",{...o,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,r=this.el.offsetWidth,s=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[E2]:[`${n}px`,"0px"],[w6]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}},pee=class{constructor(t,n,{justify:r,className:s,...o},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const i=n.map(c=>this.addChar(c).el);this.el=Dl("span",{...o,className:`section section--justify-${r} ${s??""}`},a?a(i):i)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const s=t.type==="integer"||t.type==="fraction"?new gee(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new SBe(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${dBe(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,s=this.justify==="left",o=s?"prepend":"append";if(pBe(t,a=>{let i;this.children.has(a.key)?(i=this.children.get(a.key),r.set(a,i),this.unpop(i),i.present=!0):(i=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),n.set(a,i)),this.el[o](i.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();n.forEach(i=>{i.willUpdate(a)})}n.forEach((a,i)=>{a.update(i.value)}),r.forEach((a,i)=>{a.update(i.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}},MI=class extends pee{update(t){const n=new Map;this.children.forEach((r,s)=>{t.find(o=>o.key===s)||n.set(s,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof gee&&r.update(0)}),this.pop(n)}},TI=class extends pee{update(t){const n=new Map;this.children.forEach((r,s)=>{t.find(o=>o.key===s)||n.set(s,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}},jE=class{constructor(t,n,{onRemove:r,animateIn:s=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var o;this.el.remove(),(o=this._onRemove)==null||o.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[S2]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[S2]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}},hee=class extends jE{constructor(t,n,r,s){super(t.flow,r,s),this.section=t,this.value=n,this.el=r}},gee=class extends hee{constructor(t,n,r,s,o){var a,i;const c=(((i=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:i.max)??9)+1,u=Array.from({length:c}).map((m,p)=>{const h=Dl("span",{className:"digit__num"},[document.createTextNode(String(p))]);return p!==r&&h.setAttribute("inert",""),h.style.setProperty("--n",String(p)),h}),f=Dl("span",{part:`digit ${n}-digit`,className:"digit"},u);f.style.setProperty("--current",String(r)),f.style.setProperty("--length",String(c)),super(t,r,f,o),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],s=n.width/2;this._prevCenter=this.section.justify==="left"?r+s:r-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],s=n.width/2,o=this.section.justify==="left"?r+s:r-s,a=this._prevCenter-o;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const i=this.getDelta();i&&(this.el.classList.add("is-spinning"),this.el.animate({[C6]:[-i,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const o=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(o!=null)return o}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value()=>{this._children.delete(a)},this._children.set(r,new jE(this.flow,o,{onRemove:this._onChildRemove(r)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const r=this._children.get(t);if(r)r.present=!0;else{const s=Dl("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new jE(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const EBe=parseInt(d.version.match(/^(\d+)\./)?.[1]),S6=EBe>=19,kBe=["data","digits"];class E6 extends mee{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}E6.observedAttributes=S6?[]:kBe;mBe("number-flow-react",E6);const MBe={},AI=S6?e=>e:JSON.stringify;function NI(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:s,respectMotionPreference:o,trend:a,plugins:i,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:s,respectMotionPreference:o,trend:a,plugins:i},c]}class TBe extends d.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=NI(this.props);Object.entries(n).forEach(([r,s])=>{this.el[r]=s??E6.defaultProps[r]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),S6&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,n,r){r?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:s,willChange:o,isolate:a,group:i,digits:c,onAnimationsStart:u,onAnimationsFinish:f,...m}]=NI(this.props);return d.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":o?"":void 0,class:r,...m,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:AI(c),data:AI(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const jp=d.forwardRef(function({value:t,locales:n,format:r,prefix:s,suffix:o,...a},i){d.useImperativeHandle(i,()=>c.current,[]);const c=d.useRef(),u=d.useContext(ABe);u?.useRegister(c);const f=d.useMemo(()=>n?JSON.stringify(n):"",[n]),m=d.useMemo(()=>r?JSON.stringify(r):"",[r]),p=d.useMemo(()=>{const h=MBe[`${f}:${m}`]??=new Intl.NumberFormat(n,r);return hBe(t,h,s,o)},[t,f,m,s,o]);return d.createElement(TBe,{...a,group:u,data:p,innerRef:c})}),ABe=d.createContext(void 0),yee=d.memo(({count:e,className:t})=>l.jsx(K,{className:z("flex select-none items-center pt-px text-center font-mono text-xs tabular-nums leading-none",t),as:"span",children:l.jsx(jp,{value:e})}));yee.displayName="AnimatedCounter";const Qf=A.memo(({favicon:e,description:t,descriptionClassName:n,title:r,descriptionFooter:s,count:o,url:a,media:i,children:c,className:u,showMedia:f=!0,onClick:m,isMissionControlSummary:p,accessory:h})=>{const g=f&&i&&i.length>0;return l.jsxs(K,{variant:"raised",className:z("@container group/step-card relative isolate flex flex-col gap-1.5 overflow-hidden rounded-xl border shadow-sm",u),onClick:m,children:[h&&l.jsx("div",{className:"absolute right-2 top-2",children:h}),(r||e)&&l.jsxs("div",{className:"@xs:px-md px-sm @xs:pt-3 @xs:gap-3 gap-sm flex min-w-0 items-center pt-2",children:[a&&e?l.jsx(yt,{href:a,target:"_blank",rel:"noopener",className:"@xs:size-4 inline-flex size-3 shrink-0 items-center justify-center overflow-hidden rounded",children:e}):e,l.jsxs("div",{className:"@xs:text-sm flex min-w-0 flex-1 items-baseline text-xs",children:[r&&l.jsx("div",{className:"relative flex min-w-0 flex-1",children:l.jsx(V,{variant:"tiny",className:"@xs:text-sm min-w-0 flex-1 truncate",children:r})}),o&&l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("span",{className:"px-xs ml-px leading-none opacity-35",children:"·"}),l.jsx(yee,{count:o,className:"opacity-65"})]})]})]}),l.jsxs("div",{className:"@xs:gap-sm @xs:flex-row flex flex-col gap-0",children:[l.jsxs("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[t&&l.jsx(l.Fragment,{children:p?l.jsx(xee,{description:t}):l.jsx(V,{variant:"tinyRegular",className:z("px-md @xs:text-sm text-pretty",e?"@xs:ml-7 ml-4":void 0,n),children:t})}),s&&l.jsx("div",{className:"px-md @xs:ml-7 ml-4",children:s}),c]}),g&&l.jsx(fee,{mediaItems:i})]})]})});Qf.displayName="StepCard";const xee=A.memo(({description:e})=>{const[t,n]=d.useState(!1),{$t:r}=J(),s=d.useCallback(o=>{o.stopPropagation(),n(!t)},[t]);return l.jsxs(V,{variant:"tinyRegular",className:z("px-md mb-sm @xs:text-sm @xs:ml-7 relative ml-4 line-clamp-2 text-pretty",t&&"line-clamp-none"),children:[l.jsxs("span",{className:z("relative",{"select-none":!t}),children:[e,t&&l.jsxs(V,{inline:!0,variant:"tinyRegular",color:"light",className:"hover:text-super inline-flex select-none items-center opacity-0 group-hover/step-card:opacity-100",onClick:s,children:[" ",r({id:"mFYgAXM/x4",defaultMessage:"Less"}),l.jsx(ge,{icon:B("chevron-up"),size:"xs"})]})]}),!t&&l.jsxs(l.Fragment,{children:[l.jsx(K,{className:"absolute inset-0",variant:"raised",style:{maskImage:"linear-gradient(to bottom, transparent 0%, black 100%)"}}),l.jsxs(V,{variant:"tinyRegular",color:"light",className:"right-md hover:text-super bg-raised pl-xs absolute bottom-0 hidden translate-x-2 select-none items-center group-hover/step-card:inline-flex",onClick:s,children:[r({id:"I5NMJ8llIi",defaultMessage:"More"}),l.jsx(ge,{icon:B("chevron-down"),size:"xs"})]})]})]})});xee.displayName="ExpandableDescription";function NBe({scrollContainerRef:e,autoScroll:t=!1,children:n}){const[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useCallback(()=>{const c=e.current;if(!c)return;const u=Math.abs(c.scrollTop),f=Math.max(0,c.scrollHeight-c.clientHeight),m=f>0;t?(s(m&&u0)):(s(m&&u>0),a(m&&u{i()},[i]),d.useEffect(()=>{const c=e.current;if(c)return c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)},[i,e]),d.useEffect(()=>{i();const c=e.current;if(!c)return;const u=new MutationObserver(i);return u.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>u.disconnect()},[n,i,e]),d.useMemo(()=>({canScrollUp:r,canScrollDown:o}),[r,o])}const RBe=220,RI=24,DI=16,Ng=A.memo(({children:e,className:t,scrollContainerClassName:n,maxHeight:r=RBe,showTopGradient:s=!0,showBottomGradient:o=!0,autoScroll:a=!0,topGradientOffset:i=0})=>{const c=d.useRef(null),{canScrollUp:u,canScrollDown:f}=NBe({scrollContainerRef:c,autoScroll:a,children:e}),m=d.useMemo(()=>{if(i>0){const h=s&&u,g=o&&f;if(!h&&!g)return{};let y;if(h&&g){const x=i+RI,v=`calc(100% - ${DI}px)`;y=`linear-gradient(180deg, black 0, black ${i}px, transparent ${i}px, black ${x}px, black ${v}, transparent 100%)`}else if(h){const x=i+RI;y=`linear-gradient(180deg, black 0, black ${i}px, transparent ${i}px, black ${x}px, black 100%)`}else y=`linear-gradient(180deg, black 0, black calc(100% - ${DI}px), transparent 100%)`;return{maskImage:y}}return{}},[u,f,i,s,o]),p=d.useMemo(()=>{if(i>0)return"";const h=s&&u,g=o&&f;return h&&g?"mask-fade-v-6":h?"mask-fade-t-6":g?"mask-fade-b-4":""},[u,f,i,s,o]);return l.jsx(K,{className:z("relative",t),children:l.jsx("div",{ref:c,className:z(a?"flex-col-reverse":"flex-col","scrollbar-subtle pb-sm relative flex overflow-y-auto pl-3 pr-1 [scrollbar-gutter:stable]",n,p),style:{maxHeight:r,...m},children:e})})});Ng.displayName="StepCardScrollableContent";const DBe=({wrapperClassName:e,variant:t="default",size:n="default",errorText:r,className:s,value:o,maxLength:a,errorMessage:i,disabled:c=!1,hasShadow:u=!1,autoFocus:f=!1,placeholder:m="",rightItems:p=Pe,onChange:h,onClear:g,onClick:y,onBlur:x,onFocus:v,onKeyDown:b,onPaste:_,isLoading:w,inlineEditBlock:S,label:C,subtitle:E,isOptional:T,minRows:k,isMobileUserAgent:I,allowEnterNewlines:M=!1,testId:N,textAreaClassname:D,ref:j})=>{const F=Zl(c),R=d.useRef(null),[P,L]=d.useState(!1),[U,O]=d.useState(!1),$=d.useRef(P);$.current=P,d.useEffect(()=>{!I&&f&&R.current?.focus()},[I,R,f]),d.useEffect(()=>{F!==c&&!c&&!I&&f&&setTimeout(()=>{R.current?.focus()},200)});const G=d.useMemo(()=>z({"border-r mr-sm pr-xs border-subtler":p.length!=0}),[p.length]),H=z("overflow-auto max-h-[50vh] outline-none w-full flex items-center","text-foreground font-sans resize-none","bg-transparent placeholder-quieter","caret-super selection:bg-super/50 dark:selection:bg-super/10 dark:selection:text-super",D),Q=d.useMemo(()=>{const _e=(()=>{switch(t){case"subtle":return"bg-subtle";case"default":return"bg-base dark:bg-subtler";default:At(t)}})(),ke=z("w-full focus:ring-subtler flex items-center",_e,"border border-subtler focus:ring-1 rounded-md","duration-200 transition-all",{"ring-subtler ring-1":P,"shadow-sm":u},s),De=z({"py-sm text-sm px-md":n==="default","text-base p-md pb-xl":n==="large"}),xe=z({"pr-md":p.length===0});return z(ke,De,xe)},[P,u,s,n,p.length,t]),Y=i!==void 0,te=!Y&&!!a&&!!o&&o.length>a,se=d.useMemo(()=>l.jsxs("div",{className:"right-sm gap-sm mb-xs pb-xs absolute bottom-0 flex items-center rounded-full",children:[w?l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("circle-half-2"),className:"aspect-square animate-spin"})}):null,Y&&l.jsx(K,{className:"mr-sm",children:l.jsx(V,{color:"red",variant:"tiny",children:i})}),te&&l.jsx(K,{className:"mr-sm",children:a&&o&&l.jsx(V,{color:"red",variant:"tiny",children:a-o.length})}),g!==void l.jsx("div",{className:G,children:l.jsx(st,{icon:B("x"),pill:!0,onClick:g,size:Ht.small})}),p.map((_e,ke)=>l.jsx(Ge,{..._e.buttonProps,size:Ht.small,disabled:_e.buttonProps.disabled||Y||te,pill:!0},ke))]}),[i,w,a,g,p,o,G,Y,te]),ae=d.useCallback(()=>{if(R.current){const _e=R.current.value.length;R.current.focus(),R.current.setSelectionRange(_e,_e)}},[]),X=d.useCallback(_e=>{if(!R?.current)return!0;const ke=R.current,{selectionStart:De,selectionEnd:xe,value:Ue}=ke;if(De!==xe)return!1;const Ee=document.createElement("div"),Ke=window.getComputedStyle(ke);Ee.style.position="absolute",Ee.style.visibility="hidden",Ee.style.whiteSpace=Ke.whiteSpace,Ee.style.wordWrap=Ke.wordWrap,Ee.style.font=Ke.font,Ee.style.padding=Ke.padding,Ee.style.border=Ke.border,Ee.style.width=ke.offsetWidth+"px",Ee.style.lineHeight=Ke.lineHeight,document.body.appendChild(Ee);try{const Nt=parseInt(Ke.lineHeight)||24,pe=Ue.substring(0,De);Ee.textContent=pe;const ve=Ee.offsetHeight;return _e==="first"?ve<=Nt:(Ee.textContent=Ue,Ee.offsetHeight-ve{v?.(_e.nativeEvent),L(!0)},[v]),le=d.useCallback(_e=>{x?.(_e.nativeEvent),L(!1)},[x]),re=d.useCallback(_e=>{y?.(_e.nativeEvent)},[y]),ce=d.useCallback(_e=>{h?.(_e.target.value)},[h]),ue=d.useCallback(_e=>{hh(_e.nativeEvent,{isMobileUserAgent:I,isComposing:U,allowEnterNewlines:M,onKeyDown:b})},[b,U,I,M]),me=d.useCallback(()=>kA(O),[O]),we=d.useCallback(()=>MA(O),[O]),ye=d.useCallback(_e=>{_?.(_e.nativeEvent)},[_]);return d.useImperativeHandle(j,()=>{const _e=R.current;return _e.focusAtEnd=ae,_e.inLine=X,_e.isFocused=()=>$.current,_e.append=ke=>{R.current&&(R.current.value+=ke)},_e.scrollToEnd=()=>{R.current&&(R.current.scrollTop=R.current.scrollHeight)},_e.trim=()=>{R.current&&(R.current.value=R.current.value.trim())},_e},[ae,X]),d.useEffect(()=>{f&&!I&&ae()},[f,ae,I]),l.jsxs("div",{"data-test-id":N,children:[l.jsx(_v,{label:C,subtitle:E,isOptional:T,errorText:r}),l.jsx("div",{className:z("rounded-3xl",e),children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("div",{className:Q,children:l.jsx(FY,{ref:R,autoFocus:f,placeholder:m,disabled:c,minRows:k,value:o,onClick:re,onChange:ce,name:C,onKeyDown:ue,onBlur:le,onCompositionStart:me,onCompositionEnd:we,onFocus:ee,onPaste:ye,className:H,autoComplete:"off","data-testid":N})}),l.jsx("div",{className:"absolute bottom-0 m-px flex justify-between rounded-b-md px-[6px]",style:{width:"calc(100% - 2px)"},children:se})]})}),S&&l.jsx("div",{className:"mt-sm flex justify-end",children:S})]})},hu=A.memo(DBe),vee=A.memo(({form_items:e,taskUuid:t})=>{const n=e?.[0]?.text_area_item,r=n?.placeholder,s=n?.text,[o,a]=d.useState(r||""),i="agent-form",c=d.useCallback(async h=>{try{await de.POST("/rest/browser/agent_confirmation",i,{body:{task_uuid:t,status:h,message:o},backOffTime:100,numRetries:2,headers:{"Content-Type":"application/json"}})}catch(g){Z.error("Error sending agent confirmation",g)}},[t,o,i]),{$t:u}=J(),f=d.useCallback(h=>{Ls.isEnterKeyWithoutShift(h)&&c("accept")},[c]),m=d.useCallback(h=>{h.stopPropagation(),c("accept")},[c]),p=d.useCallback(h=>{h.stopPropagation(),c("reject")},[c]);return l.jsxs(K,{className:"flex flex-col gap-3",children:[l.jsx(V,{color:"light",variant:"small",children:s}),l.jsx(hu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:r,value:o,onChange:a,onKeyDown:f}),l.jsxs("div",{className:"gap-sm py-sm flex items-center",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:u({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit",disabled:!1,onClick:m}),l.jsx(st,{size:"small",text:u({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:p})]})]})});vee.displayName="AgentForm";const Di=A.memo(e=>{const{isFinished:t,className:n,count:r,showAnimation:s,isPaused:o,...a}=e,i=J(),c=e.action&&Ri[e.action]?i.formatMessage(Ri[e.action].message):"",u=e.action?e.title?`${c}${e.title}`:c:e.title,f=e.action?Ri[e.action]?.icon:e.icon,m=t||o;return l.jsx(St,{mode:"popLayout",children:l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:s?0:.2,ease:"easeInOut"},className:z("gap-sm group flex cursor-pointer flex-col",n),children:l.jsxs(V,{variant:"tinyRegular",color:t?"light":"super",className:"flex items-center gap-1 py-1.5",children:[f&&l.jsx(ge,{icon:f,size:"2xs",className:"-mt-px opacity-80"}),l.jsxs(br,{variant:"super",active:!m,as:"span",speed:"slow",children:[u,r!==void 0&&r>0&&` · ${r}`]})]})},a.key)})});Di.displayName="StepActionLabel";const jBe=1e3,bee=A.memo(({message:e,isFinished:t,isPaused:n,isPendingClarification:r})=>{const[s,o]=d.useState(!1),a=d.useRef(e.thought||""),[i,c]=d.useState("working"),u=Do(),{result:f,inFlight:m}=It(),p=f?.uuid;d.useEffect(()=>{if(t){o(!1);return}e.thought!==a.current&&(a.current=e.thought,o(!1));const y=setTimeout(()=>{!t&&!e.action&&o(!0)},jBe);return()=>clearTimeout(y)},[e.thought,e.action,t]);const h=!e.action&&!e.thought&&e.url;return d.useEffect(()=>{let y="working";if(t?y="finished":n?y="paused":r?y="considering_clarification":h?y="reasoning":s&&!e.action?y="working":e.action&&e.action in Ri&&(y=e.action),c(y),u&&p&&m){const x=new CustomEvent("comet-agent-step-update",{detail:{stepAction:y,streamId:p}});document.dispatchEvent(x)}},[m,t,h,s,e.action,n,r,u,p]),!t&&(r||e.action||h||s&&!e.action)&&l.jsx(Di,{action:i,isFinished:t,isPaused:n,className:"pl-8"})});bee.displayName="AgentStatusManager";const IBe=({children:e,initial:t=!1,mode:n="wait",className:r,transition:s,supportZeroHeight:o=!0,...a})=>{const[i,{height:c}]=ti(),u=mi(),f=o||c>0?c:"auto";return l.jsx(Te.div,{animate:{height:u?f:"auto"},className:r,transition:s,...a,children:l.jsx("div",{ref:i,children:l.jsx(St,{mode:n,initial:t,children:e})})})},Kr=tl(.16,1,.3,1),Kbt=tl(.7,0,.84,0),PBe=({children:e,initial:t={opacity:0},animate:n={opacity:1},exit:r,transition:s,className:o,style:a,ref:i})=>l.jsx(Te.div,{initial:t,animate:n,exit:r??t,transition:s,ref:i,className:o,style:a,children:e}),pi=IBe,Oo=PBe,ca=A.memo(({variant:e=Wx.subtle,label:t,accessory:n,onClick:r,className:s,size:o="default",textColor:a="default",icon:i,iconUrl:c,iconClassName:u,iconOnly:f=!1,tooltip:m,truncate:p=!1,hover:h=!0,href:g,linkBehavior:y="none",trackEvent:x,forceExternalHandler:v,containerClassName:b})=>{const _=d.useCallback(E=>{y==="external"&&g&&x&&x("click citation",{source:"inline",citation_url:g}),(y!=="external"||v)&&r?.(E)},[r,y,g,x,v]),w=l.jsxs(K,{as:"span",variant:e,className:z("text-3xs rounded-badge group min-w-4 cursor-pointer text-center align-middle font-mono tabular-nums",{"py-[0.1875rem] leading-snug":o==="default","py-[0.175rem] leading-none":o==="small","py-[0.125rem] leading-none":o==="extraSmall"},{"px-[0.3rem]":!f,"inline-block px-[0.1875rem]":f,"[@media(hover:hover)]:hover:bg-super dark:[@media(hover:hover)]:hover:text-inverse [@media(hover:hover)]:hover:text-white":h},b),onClick:y==="external"?void 0:r,children:[c?l.jsx("span",{className:z("-mt-px inline-block align-middle",{"mr-xs":!f},u),children:l.jsx("img",{src:c,alt:"",className:"m-0 size-3 rounded-sm"})}):i?l.jsx(ge,{icon:i,size:"2xs",className:z("-mt-px inline-block align-middle opacity-80",{"mr-xs":!f},u)}):null,l.jsx("span",{ref:E=>{if(E&&p){const T=E.scrollWidth>E.clientWidth;E.style.maskImage=T?"linear-gradient(to right, black 70%, transparent 100%)":""}},className:z("relative -mt-px inline-block align-middle",{"max-w-[25ch] overflow-hidden":p}),children:t}),!!n&&l.jsx("span",{className:"ml-xs -mt-px mr-px inline-block align-middle",children:n})]}),S=m?l.jsx(Io,{tooltipText:m,tooltipLayout:"top",asChild:!0,children:w}):w,C=l.jsx(V,{as:"span",color:a,className:z("relative -mt-px select-none whitespace-nowrap",{"-top-px":o==="default","-top-[3px] leading-none":o==="small","-top-two leading-none":o==="extraSmall"},s),children:S});return y==="external"&&g?l.jsx(yt,{href:g,target:"_blank",rel:"noopener",className:"inline",onClick:_,children:C}):C});ca.displayName="CitationBubble";const _ee=A.memo(({citationUrl:e})=>{const t=d.useCallback(()=>{window.open(e,"_blank","noopener,noreferrer")},[e]);return l.jsx(ca,{icon:B("arrow-up-right"),iconClassName:"-ml-px",className:"animate-in fade-in duration-150",size:"extraSmall",textColor:"light",iconOnly:!0,tooltip:"Open page",onClick:t})});_ee.displayName="ExternalCitationBubble";const wee=A.memo(({message:e,task:t})=>{const n=e.url||t.start_url,r=e.url?l.jsx(_ee,{citationUrl:n}):null;return l.jsx(Oo,{children:e.thought&&l.jsxs("div",{className:"pl-xs flex gap-3",children:[l.jsx(V,{color:"light",variant:"small",className:"size-4 py-1.5",children:r}),l.jsx(V,{color:"light",variant:"small",className:"py-1.5",children:e.thought})]})})});wee.displayName="MessageItem";const Cee=A.memo(({task:e,isFinished:t,isPaused:n})=>{const r=e.agent_messages[e.agent_messages.length-1];return l.jsx(Ng,{children:l.jsxs(pi,{mode:"sync",initial:!1,children:[e.agent_messages.length>0&&e.agent_messages.map((s,o)=>l.jsx(Oo,{children:l.jsx(wee,{message:s,task:e})},o)),l.jsx(Oo,{children:l.jsx("div",{children:l.jsx(bee,{message:e.agent_messages.length>0?r:{action:"working",thought:"",url:"",answer:"",uuid:"",value:""},isFinished:t||e.clarification_status==="STOPPED_TASK",isPaused:n,isPendingClarification:e.clarification_status==="PENDING"})})})]})})});Cee.displayName="ScrollableContent";const See=A.memo(({lastMessage:e,taskUuid:t})=>e.form?l.jsx("div",{className:"px-md py-sm ml-7",children:l.jsx(vee,{form_items:e.form.form_items,taskUuid:t})}):null);See.displayName="FormContent";const IE=A.memo(({task:e,isFinished:t,index:n,isMissionControl:r})=>{const s=e.agent_messages[e.agent_messages.length-1],o=s?.form,a=e.uuid,{taskScreenshots:{[a]:[i]=[]},tasksState:{[a]:{is_paused:c=!1}={}},taskTabs:u}=Qn(),{$t:f}=J(),m=un(),{result:p}=It(),h=d.useMemo(()=>u?.some(E=>E.taskUuid===a)??!1,[u,a]),g=d.useMemo(()=>i?[{media_item:{thumbnail:i,image:i,name:f({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})},task_uuid:a,message_uuid:""}]:Pe,[f,i,a]),y=d.useMemo(()=>l.jsx(Po,{domain:e.start_url}),[e.start_url]),x=d.useMemo(()=>e.agent_messages.filter(T=>T.screenshot).map(T=>({media_item:{thumbnail:T.screenshot,image:T.screenshot,name:f({defaultMessage:"Screenshot",id:"9a+SKtXKhe"})},task_uuid:e.uuid,message_uuid:""})),[f,e.uuid,e.agent_messages]),v=d.useMemo(()=>o?Pe:e.media&&e.media.length?e.media:x.length?x:g,[o,x,g,e.media]),b=d.useCallback(async E=>{if(!(t&&r&&!h)){if(E.stopPropagation(),t)if(r){if(!h)return}else return;await m.makeTaskVisible(a)}},[m,a,t,r,h,p?.backend_uuid]),_=r&&t,w=e.clarification_status,S=E=>{switch(E){case"UPDATED_TASK":return f({defaultMessage:"Updated per your clarification",id:"UmUpwNXXy9"});case"STOPPED_TASK":return f({defaultMessage:"Stopped per your clarification",id:"Uura7/Ftc2"});default:return""}},C=w&&w!=="PENDING"?l.jsxs(V,{variant:"tinyRegular",className:"gap-xs py-xs text-super flex",children:[l.jsx(ge,{icon:B("info-circle"),size:"xs"}),l.jsx("span",{className:"text-pretty",children:S(w)})]}):null;return l.jsx(Qf,{favicon:y,title:ng(e.start_url),accessory:h&&_?l.jsx(ge,{icon:B("arrow-up-right"),size:"xs",className:"group-hover/step-card:text-super opacity-60 group-hover/step-card:opacity-100"}):void 0,media:v,description:e.task,descriptionFooter:C,showMedia:!o,onClick:b,className:z("border transition-colors duration-150 hover:!transition-none",h&&"hover:border-super/75 group/step-card cursor-pointer"),isMissionControlSummary:_,children:_?null:o&&s&&!t?l.jsx(See,{lastMessage:s,taskUuid:e.uuid}):l.jsx(Cee,{task:e,isFinished:t,isPaused:c})},n)});IE.displayName="TaskStep";const Eee=A.memo(({step:e,isFinished:t,isMissionControl:n})=>l.jsx(OBe,{tasks:e.content.tasks,isMissionControl:n,isFinished:t})),OBe=({tasks:e,isMissionControl:t,isFinished:n})=>t&&n&&e.length>1?l.jsx("div",{className:"-mx-sm",children:l.jsx(nl,{orientation:"horizontal",viewportClassName:"px-sm",showScrollIndicator:!1,children:l.jsxs(K,{className:"gap-sm flex flex-row",children:[e.map((s,o)=>l.jsx("div",{className:"w-3/4 shrink-0",children:l.jsx(IE,{task:s,isFinished:n,index:o,isMissionControl:t})},o)),l.jsx("div",{className:"w-px shrink-0"})]})})}):l.jsx(K,{className:"gap-y-md flex flex-col",children:e.map((s,o)=>l.jsx(IE,{task:s,isFinished:n,index:o,isMissionControl:t},o))});Eee.displayName="BrowserStep";const kee=A.memo(({disabled:e,onClick:t})=>l.jsx(Ge,{disabled:e,onClick:t,icon:B("chevron-left"),variant:"common",size:"small"}));kee.displayName="CardPaginationPrevious";const Mee=A.memo(({disabled:e,onClick:t})=>l.jsx(Ge,{disabled:e,onClick:t,icon:B("chevron-right"),variant:"common",size:"small"}));Mee.displayName="CardPaginationNext";const Tee=({contact:e})=>l.jsxs("div",{className:"flex items-center gap-2",children:[e.image&&l.jsx("img",{src:e.image,alt:e.name,className:"size-4 rounded-full",referrerPolicy:"no-referrer"}),l.jsx("span",{className:"text-sm",children:e.name}),e.email&&l.jsx("span",{className:"text-quieter text-sm",children:e.email})]}),LBe=async({query:e,limit:t=10,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/contacts/list-autosuggest",n,{timeoutMs:Qe(),params:{query:{query:e,limit:t}}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get contacts autosuggestions",cause:s,status:o.status??0});return r?.results??[]}catch(r){return Z.error(r),[]}},FBe=({query:e,limit:t=10,reason:n})=>mt({queryKey:be.makeEphemeralQueryKey("contacts",e,t),queryFn:()=>LBe({query:e,limit:t,reason:n}),enabled:e?.trim().length>0,staleTime:120*1e3,gcTime:600*1e3,placeholderData:r=>r});function Aee({reason:e,limit:t=10}){const[n,r]=d.useState(""),{data:s}=FBe({query:n,limit:t,reason:e}),o=d.useMemo(()=>Cf(c=>r(c),300),[]);d.useEffect(()=>()=>{o.cancel()},[o]);const a=d.useCallback(c=>{c.trim()===""?(o.cancel(),r("")):o(c)},[o]);return{suggestions:d.useMemo(()=>s?.filter(c=>c.email!==null).map(c=>({key:c.email,value:c.email,item:c})),[s]),handleDraftChange:a}}const dr=A.memo(({children:e,header:t,fullBleed:n,roundedClass:r,shadow:s,fullBleedBorderClassname:o,...a})=>l.jsxs(l.Fragment,{children:[t,l.jsxs(K,{...a,variant:a.variant??"raised",className:z("relative",{border:!n&&!a.variant,[r||"rounded-xl"]:!a.variant,"shadow-[0_1px_2px_0_rgba(0,0,0,0.03)]":s},a.className),children:[n&&l.jsx("div",{className:z("rounded-inherit pointer-events-none absolute inset-0 z-[1] border border-[black]/5 dark:border-[white]/5",o)}),e]})]}));dr.displayName="CanonicalCard";var oa;(function(e){e.GOOGLE_MEET="google_meet",e.MICROSOFT_TEAMS="microsoft_teams",e.ZOOM="zoom"})(oa||(oa={}));const Ra=[{label:"12:00am",value:"12:00am"},{label:"12:30am",value:"12:30am"},{label:"1:00am",value:"1:00am"},{label:"1:30am",value:"1:30am"},{label:"2:00am",value:"2:00am"},{label:"2:30am",value:"2:30am"},{label:"3:00am",value:"3:00am"},{label:"3:30am",value:"3:30am"},{label:"4:00am",value:"4:00am"},{label:"4:30am",value:"4:30am"},{label:"5:00am",value:"5:00am"},{label:"5:30am",value:"5:30am"},{label:"6:00am",value:"6:00am"},{label:"6:30am",value:"6:30am"},{label:"7:00am",value:"7:00am"},{label:"7:30am",value:"7:30am"},{label:"8:00am",value:"8:00am"},{label:"8:30am",value:"8:30am"},{label:"9:00am",value:"9:00am"},{label:"9:30am",value:"9:30am"},{label:"10:00am",value:"10:00am"},{label:"10:30am",value:"10:30am"},{label:"11:00am",value:"11:00am"},{label:"11:30am",value:"11:30am"},{label:"12:00pm",value:"12:00pm"},{label:"12:30pm",value:"12:30pm"},{label:"1:00pm",value:"1:00pm"},{label:"1:30pm",value:"1:30pm"},{label:"2:00pm",value:"2:00pm"},{label:"2:30pm",value:"2:30pm"},{label:"3:00pm",value:"3:00pm"},{label:"3:30pm",value:"3:30pm"},{label:"4:00pm",value:"4:00pm"},{label:"4:30pm",value:"4:30pm"},{label:"5:00pm",value:"5:00pm"},{label:"5:30pm",value:"5:30pm"},{label:"6:00pm",value:"6:00pm"},{label:"6:30pm",value:"6:30pm"},{label:"7:00pm",value:"7:00pm"},{label:"7:30pm",value:"7:30pm"},{label:"8:00pm",value:"8:00pm"},{label:"8:30pm",value:"8:30pm"},{label:"9:00pm",value:"9:00pm"},{label:"9:30pm",value:"9:30pm"},{label:"10:00pm",value:"10:00pm"},{label:"10:30pm",value:"10:30pm"},{label:"11:00pm",value:"11:00pm"},{label:"11:30pm",value:"11:30pm"},{label:"11:59pm",value:"11:59pm"}],Ybt=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Qbt={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},wi={toIndex:e=>Ra.findIndex(t=>t.value===e),toTime:e=>Ra[e]?.value??null,getNextSlot:e=>{const t=wi.toIndex(e),n=Ra.length-1;if(t===-1||t>=n)return null;const r=n-t,s=Math.min(2,r),o=t+s;return{start:Ra[t]?.value??"",end:Ra[o]?.value??""}},canAddSlot:e=>e.length===0||wi.toIndex(e[e.length-1]?.end??"")0,getDefaultSlot:()=>({start:"9:00am",end:"5:00pm"}),getPreviousSlot:(e,t)=>{if(wi.toIndex(e)<=0)return null;const r=wi.toIndex("9:00am"),s=wi.toIndex("5:00pm");for(let a=r;a{const p=wi.toIndex(m.start??""),h=wi.toIndex(m.end);return!(i<=p||a>=h)}))return{start:c,end:u}}const o=wi.toIndex(t[0]?.start??"");if(o>0){const a=Math.min(2,o),i=o-a;return{start:Ra[i]?.value??"",end:Ra[o]?.value??""}}return null}},Xbt={monday:[{start:"9:00am",end:"5:00pm"}],tuesday:[{start:"9:00am",end:"5:00pm"}],wednesday:[{start:"9:00am",end:"5:00pm"}],thursday:[{start:"9:00am",end:"5:00pm"}],friday:[{start:"9:00am",end:"5:00pm"}],saturday:[],sunday:[]},BBe=e=>{if(!e)return!1;const t=e.indexOf("@"),n=e.lastIndexOf(".");return e.includes("@")&&e.includes(".")&&t0},Zbt=e=>[...e].sort((t,n)=>{const r=new Date(t.start_date_time||"").getTime(),s=new Date(n.start_date_time||"").getTime();return r-s}),Jbt=e=>{if(e.length<=1)return!1;const t=new Date(e[0]?.start_date_time||""),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return e.some(r=>{const s=new Date(r.start_date_time||"");return new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime()!==n})},UBe={"#AC725E":"#79554B","#D06B64":"#E67399","#F83A22":"#D50000","#FA573C":"#F4511E","#FF7537":"#EF6C00","#FFAD46":"#F09300","#42D692":"#009688","#16A765":"#0B8043","#7BD148":"#7CB342","#B3DC6C":"#C0CA33","#FBE983":"#E4C441","#FAD165":"#F6BF26","#92E1C0":"#039BE5","#9FE1E7":"#4285F4","#9FC6E7":"#3F51B5","#4986E7":"#7986CB","#9A9CFF":"#B39DDB","#C2C2C2":"#616161","#CABDBF":"#A79B8E","#CCA6AC":"#AD1457","#F691B2":"#D81B60","#CD74E6":"#8E24AA","#A47AE2":"#7B1FA2"},VBe="#039BE5",Nee=e=>UBe[e.toUpperCase()]??VBe,Ree=e=>{const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),s=parseInt(t.substring(4,6),16),o=m=>{const p=m/255;return p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4)},a=o(n),i=o(r),c=o(s),u=.2126*a+.7152*i+.0722*c,f=(Math.max(u,1)+.05)/(Math.min(u,1)+.05);return f>=7?"AAA":f>=4.5?"AA":f>=3?"A":"Fail"},HBe=e=>typeof e=="string"?{email:e,response_status:void 0,photo_url:void 0,display_name:void 0}:{email:e.email,response_status:e.response_status,photo_url:e.photo_url,display_name:e.display_name},jI=e=>e?e.map(HBe):[],zBe=e=>{if(!e||e.trim()==="")return"";const t=e.trim().split(/\s+/);return NU(t)?t[0].charAt(0).toUpperCase():((t[0]?.charAt(0)??"")+(t[t.length-1]?.charAt(0)??"")).toUpperCase()},k6=(e,t)=>t.formatDate(e,{timeZoneName:"short"}).split(", ").pop()||"",WBe=()=>Intl.DateTimeFormat().resolvedOptions().timeZone.split("/").pop()?.replace(/_/g," ")||"",GBe=(e,t)=>t.formatDate(e,{timeZoneName:"shortOffset"}).split(", ").pop()||"",$Be=()=>{const{formatDate:e}=J(),t=d.useCallback((s,o=!0)=>e(s,{month:"long",day:"numeric",...o&&{year:"numeric"}}),[e]),n=d.useCallback(s=>e(s,{weekday:"long",month:"long",day:"numeric"}),[e]),r=d.useCallback(s=>e(s,{weekday:"short",month:"long",day:"numeric"}),[e]);return d.useMemo(()=>({formatEventDate:t,formatEventDay:n,formatEventDayShort:r}),[t,n,r])},Ip=A.memo(({startDate:e,endDate:t,isAllDay:n,showDate:r=!1,includeYear:s=!0})=>{const{$t:o}=J();if(n){const a=o({defaultMessage:"All day",id:"Vob6h4Xsl3"});return r?l.jsxs(l.Fragment,{children:[l.jsx(h_,{from:e,to:e,...s&&{year:"numeric"},month:"long",day:"numeric"}),", ",a]}):l.jsx(l.Fragment,{children:a})}return r?l.jsx(h_,{from:e,to:t,...s&&{year:"numeric"},month:"long",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}):l.jsx(h_,{from:e,to:t,hour:"numeric",minute:"2-digit",timeZoneName:"short"})});Ip.displayName="EventTimeRange";function qBe(e){const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function KBe(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function YBe(e){const t=new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Dee(e){const t=new Date;return t.setDate(t.getDate()+1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function jee(e,t,n={numeric:"auto",style:"long"},r=1e3*60*60*24){if(!t)return"";const s=new Date(t);if(isNaN(s.getTime()))return"";const o=s.getTime()-Date.now(),a=Math.abs(o);return a<=1e3?"":a<1e3*60?e.formatRelativeTime(Math.round(o/1e3),"second",n):a<1e3*60*60?e.formatRelativeTime(Math.round(o/(1e3*60)),"minute",n):a=1e3*60*60*24?e.formatRelativeTime(Math.round(o/(1e3*60*60*24)),"day",n):e.formatDate(s,{month:"short",day:"numeric",year:"numeric"})}function e_t(e,t){try{const n=+t,r={hours:Math.floor(n/3600),minutes:Math.floor(n%3600/60),seconds:Math.floor(n%60)},s={hours:"h",minutes:"m",seconds:"s"};if("DurationFormat"in Intl)return new Intl.DurationFormat(e,{style:"narrow",valueStyle:"narrow"}).format(r);let o="";for(const[a,i]of Object.entries(r))i>0&&(o+=`${i}${s[a]} `);return o.trim()}catch{return""}}const Vl=A.memo(({oldText:e,newText:t,isDeletion:n=!1})=>!e&&!t?null:n&&(e||t)?l.jsx(V,{as:"span",color:"ultraLight",className:"line-through",children:e||t}):!e&&t?l.jsx(V,{as:"span",color:"default",className:"bg-[#facc15]/25",children:t}):!t&&e?e:e&&t&&e===t?l.jsx(V,{as:"span",color:"default",children:e}):e&&t&&e!==t?l.jsxs(l.Fragment,{children:[l.jsx(V,{as:"span",color:"ultraLight",className:"line-through",children:e})," ",l.jsx(V,{as:"span",color:"default",className:"bg-[#facc15]/25",children:t})]}):null);Vl.displayName="DiffedText";const Xs=A.memo(({children:e,icon:t,alignCenter:n=!1,iconSize:r="sm"})=>l.jsxs("div",{className:z("flex flex-row items-start gap-3",{"items-center":n}),children:[l.jsx(ge,{icon:t,size:r,className:"mt-px shrink-0"}),l.jsx("div",{className:"min-w-0 flex-1",children:e})]}));Xs.displayName="EventAttribute";const Iee=A.memo(({attendee:e,showRsvp:t=!1})=>l.jsxs("div",{className:"relative w-5",children:[e.photo_url?l.jsx(dr,{fullBleed:!0,className:"absolute inset-0 mt-px size-5 overflow-hidden !rounded-full",children:l.jsx("img",{src:e.photo_url,className:"size-full object-cover",alt:e.display_name||e.email||""})}):l.jsx(K,{variant:"subtle",className:"absolute inset-0 mt-px flex size-5 items-center justify-center rounded-full",children:l.jsx(V,{variant:"tinyMono",color:"light",className:"translate-y-half",children:zBe(e.display_name||e.email||"")})}),t&&(e.response_status==="accepted"||e.response_status==="declined")&&l.jsx(K,{variant:"background",className:"p-two absolute bottom-[-4px] right-[-4px] z-10 rounded-full",children:l.jsx(V,{color:e.response_status==="accepted"?"super":e.response_status==="declined"?"red":"light",className:z("bg-base border-subtlest flex size-3 items-center justify-center rounded-full border",{"!bg-super/20 !border-super/10 border":e.response_status==="accepted","!bg-negative/20 !border-negative/10":e.response_status==="declined"}),children:l.jsx(ge,{icon:e.response_status==="accepted"?B("check"):e.response_status==="declined"?B("x"):B("question-mark"),size:"2xs",stroke:2.125})})})]}));Iee.displayName="AttendeeAvatar";const Pee=A.memo(({attendees:e,newAttendees:t,truncateAttendees:n,showRsvp:r=!1,isDeletion:s=!1})=>{const[o,a]=d.useState(!1),c=jI(e).filter(g=>!g.email?.includes("@resource.calendar.google"));let u;t&&(u=jI(t).filter(y=>!y.email?.includes("@resource.calendar.google")));const f=(g,y)=>{const x=g?.map(v=>{let b;return y?b=y?.find(_=>_.email===v.email)??{email:" ",response_status:void 0,photo_url:void 0,display_name:" "}:b=v,{oldValue:v,newValue:b}})??[];return y&&(g?y.filter(b=>!g.some(_=>_.email===b.email)):y).forEach(b=>{x.push({oldValue:void 0,newValue:b})}),x},m=u||c,p=f(c,u),h=d.useCallback(()=>a(!o),[o]);return l.jsxs("div",{className:"min-w-0",children:[(()=>{const g=m?.length??0;return l.jsx(V,{variant:"small",color:g>0?"default":"light",className:s?"line-through":"",children:g>0?`${g} ${g===1?"Guest":"Guests"}`:"No Guests"})})(),p&&p.length>0&&l.jsxs("div",{className:"gap-sm my-sm flex flex-col",children:[p.slice(0,n&&!o?n:void 0).map(g=>l.jsxs("div",{className:"gap-sm flex flex-row",children:[l.jsx(Iee,{attendee:g.newValue,showRsvp:r}),l.jsx(V,{variant:"small",color:"default",className:"line-clamp-1 text-ellipsis break-all",children:l.jsx(Vl,{oldText:g.oldValue?.display_name||g.oldValue?.email,newText:g.newValue?.display_name||g.newValue?.email,isDeletion:s})})]},g.oldValue?.email??g.newValue?.email)),n&&p.length>n&&l.jsx(V,{as:"button",variant:"small",color:"default",className:"w-fit text-left hover:underline",onClick:h,children:o?"Show less":"Show all"})]})]})});Pee.displayName="AttendeeList";const Oee=A.memo(({videoEntryPoint:e,isDeletion:t})=>{const{$t:n}=J(),r=d.useCallback(()=>window.open(e?.uri,"_blank","noopener,noreferrer"),[e?.uri]);return!e||t?null:l.jsx(Xs,{icon:B("video"),alignCenter:!0,children:l.jsx(Ge,{variant:"primary",pill:!0,text:n({defaultMessage:"Join Meeting",id:"HK25u5mIfw"}),onClick:r,size:"small"})})});Oee.displayName="EventVideoEntry";const Lee=A.memo(({location:e,newLocation:t,isDeletion:n=!1})=>e?l.jsx(Xs,{icon:B("map-pin"),children:l.jsx(V,{variant:"small",color:"light",className:"line-clamp-1",children:l.jsx(Vl,{oldText:e,newText:t,isDeletion:n})})}):null);Lee.displayName="EventLocation";const Fee=A.memo(({description:e,newDescription:t,isDeletion:n=!1})=>{const[r,s]=d.useState(!1),o=d.useCallback(()=>s(!r),[r]);return e?l.jsx(Xs,{icon:B("align-left"),children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx(V,{variant:"small",className:z("break-words",{"line-clamp-2":!r}),children:l.jsx(Vl,{oldText:e,newText:t,isDeletion:n})}),e.length>150&&l.jsx(V,{as:"button",variant:"small",color:"default",className:"mt-1 w-fit text-left hover:underline",onClick:o,children:r?"Show less":"Show more"})]})}):null});Fee.displayName="EventDescription";const Bee=A.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i=!1})=>{const c=J(),u=s&&n?n:e,f=s&&r?r:t,m=s?s.is_all_day||!1:o;return l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(Vl,{oldText:a(e),newText:s&&n?a(n):void 0,isDeletion:i})}),l.jsx(V,{variant:"small",color:"light",children:l.jsxs("span",{className:i?"line-through":"",children:[l.jsx(Ip,{startDate:u,endDate:f,isAllDay:m}),!m&&` (${k6(u,c)})`]})})]})});Bee.displayName="SingleDayDisplay";const Uee=A.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,formatEventDayShort:o,isDeletion:a=!1})=>{const i=J(),c=s&&r?r:t,u=s&&s.is_all_day||!1;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(Vl,{oldText:o(e),newText:s&&n?o(n):void 0,isDeletion:a})}),l.jsx(V,{variant:"small",color:"light",children:l.jsx("span",{className:a?"line-through":"",children:!s?.is_all_day&&l.jsx(x7,{value:s&&n?n:e,hour:"numeric",minute:"2-digit"})})})]}),l.jsx(V,{color:"light",className:"pt-two flex justify-center",children:l.jsx(ge,{icon:B("arrow-right"),size:"sm"})}),l.jsxs("div",{className:"gap-two flex flex-col",children:[l.jsx(V,{variant:"smallBold",color:"default",className:"line-clamp-1",children:l.jsx(Vl,{oldText:o(t),newText:s&&r?o(r):void 0,isDeletion:a})}),l.jsx(V,{variant:"small",color:"light",children:l.jsx("span",{className:a?"line-through":"",children:!u&&l.jsxs(l.Fragment,{children:[l.jsx(x7,{value:c,hour:"numeric",minute:"2-digit"}),` (${k6(c,i)})`]})})})]})]})});Uee.displayName="MultiDayDisplay";const Vee=A.memo(({startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i=!1})=>{const c=KBe(e,t);return l.jsx(Xs,{icon:B("clock"),children:l.jsxs("div",{className:"gap-sm flex",children:[c&&l.jsx(Bee,{startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,is_all_day:o,formatEventDayShort:a,isDeletion:i}),!c&&l.jsx(Uee,{startDate:e,endDate:t,newStartDateObj:n,newEndDateObj:r,newEvent:s,formatEventDayShort:a,isDeletion:i})]})})});Vee.displayName="EventDateDisplay";const QBe=A.memo(({startDate:e,newStartDate:t})=>{const n=J();if(!e)return null;const r=t||e,s=GBe(r,n),o=WBe(),a=k6(r,n);return l.jsx(Xs,{icon:B("world"),alignCenter:!0,children:l.jsxs("div",{children:[l.jsxs(V,{as:"span",variant:"small",color:"light",children:[s," "]}),l.jsx(V,{as:"span",variant:"small",children:o}),l.jsxs(V,{as:"span",variant:"small",color:"light",children:[" ","(",a,")"]})]})})});QBe.displayName="EventTimezone";const Hee=A.memo(({event:e,newEvent:t,className:n,truncateAttendees:r,showRsvp:s=!1,action:o})=>{const{start_date_time:a,end_date_time:i,attendees:c,description:u,location:f,conference_data:m,is_all_day:p}=e,h=o==="DELETE",{formatEventDayShort:g}=$Be(),y=d.useMemo(()=>new Date(a||""),[a]),x=d.useMemo(()=>new Date(i||""),[i]),v=d.useMemo(()=>{if(t&&t.start_date_time)return new Date(t.start_date_time||"")},[t]),b=d.useMemo(()=>{if(t&&t.end_date_time)return new Date(t.end_date_time||"")},[t]),_=m?.entry_points?.find(w=>w.entry_point_type==="video");return l.jsxs("div",{className:z("gap-md flex h-full flex-col",n),children:[l.jsx(Vee,{startDate:y,endDate:x,newStartDateObj:v,newEndDateObj:b,newEvent:t,is_all_day:p??!1,formatEventDayShort:g,isDeletion:h}),l.jsx(Oee,{videoEntryPoint:_,isDeletion:h}),l.jsx(Lee,{location:f,newLocation:t?.location,isDeletion:h}),l.jsx(Fee,{description:u,newDescription:t?.description,isDeletion:h}),l.jsx(Xs,{icon:B("user"),children:l.jsx(Pee,{attendees:c,newAttendees:t?.attendees,truncateAttendees:r,showRsvp:s,isDeletion:h})})]})});Hee.displayName="EventDetails";function bw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Rm(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;s=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;s=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function Dm(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?ZBe(i,m=>m.test(a)):XBe(i,m=>m.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=t.slice(a.length);return{value:u,rest:f}}}function XBe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ZBe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(s.length);return{value:a,rest:i}}}const M6=6048e5,eUe=864e5,II=Symbol.for("constructDateFrom");function Vr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&II in e?e[II](t):e instanceof Date?new e.constructor(t):new Date(t)}function Xf(e,...t){const n=Vr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}let tUe={};function Rg(){return tUe}function vn(e,t){return Vr(t||e,e)}function ri(e,t){const n=Rg(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=vn(e,t?.in),o=s.getDay(),a=(o{let r;const s=nUe[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},sUe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oUe=(e,t,n,r)=>sUe[e],aUe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},iUe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lUe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},cUe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},uUe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},dUe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fUe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},mUe={ordinalNumber:fUe,era:Rm({values:aUe,defaultWidth:"wide"}),quarter:Rm({values:iUe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Rm({values:lUe,defaultWidth:"wide"}),day:Rm({values:cUe,defaultWidth:"wide"}),dayPeriod:Rm({values:uUe,defaultWidth:"wide",formattingValues:dUe,defaultFormattingWidth:"wide"})},pUe=/^(\d+)(th|st|nd|rd)?/i,hUe=/\d+/i,gUe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},yUe={any:[/^b/i,/^(a|c)/i]},xUe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vUe={any:[/1/i,/2/i,/3/i,/4/i]},bUe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_Ue={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wUe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},CUe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},SUe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},EUe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kUe={ordinalNumber:JBe({matchPattern:pUe,parsePattern:hUe,valueCallback:e=>parseInt(e,10)}),era:Dm({matchPatterns:gUe,defaultMatchWidth:"wide",parsePatterns:yUe,defaultParseWidth:"any"}),quarter:Dm({matchPatterns:xUe,defaultMatchWidth:"wide",parsePatterns:vUe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Dm({matchPatterns:bUe,defaultMatchWidth:"wide",parsePatterns:_Ue,defaultParseWidth:"any"}),day:Dm({matchPatterns:wUe,defaultMatchWidth:"wide",parsePatterns:CUe,defaultParseWidth:"any"}),dayPeriod:Dm({matchPatterns:SUe,defaultMatchWidth:"any",parsePatterns:EUe,defaultParseWidth:"any"})},MUe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},TUe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},AUe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NUe={date:bw({formats:MUe,defaultWidth:"full"}),time:bw({formats:TUe,defaultWidth:"full"}),dateTime:bw({formats:AUe,defaultWidth:"full"})},zee={code:"en-US",formatDistance:rUe,formatLong:NUe,formatRelative:oUe,localize:mUe,match:kUe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function So(e,t,n){const r=vn(e,n?.in);return isNaN(t)?Vr(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function si(e,t,n){const r=vn(e,n?.in);if(isNaN(t))return Vr(n?.in||e,NaN);if(!t)return r;const s=r.getDate(),o=Vr(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),s),r)}function Zc(e,t){return ri(e,{...t,weekStartsOn:1})}function Wee(e,t){const n=vn(e,t?.in),r=n.getFullYear(),s=Vr(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const o=Zc(s),a=Vr(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=Zc(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function k2(e){const t=vn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ef(e,t){const n=vn(e,t?.in);return n.setHours(0,0,0,0),n}function Va(e,t,n){const[r,s]=Xf(n?.in,e,t),o=ef(r),a=ef(s),i=+o-k2(o),c=+a-k2(a);return Math.round((i-c)/eUe)}function RUe(e,t){const n=Wee(e,t),r=Vr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Zc(r)}function PE(e,t,n){return So(e,t*7,n)}function DUe(e,t,n){return si(e,t*12,n)}function jUe(e,t){let n,r=t?.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const o=vn(s,r);(!n||n{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const o=vn(s,r);(!n||n>o||isNaN(+o))&&(n=o)}),Vr(r,n||NaN)}function Ps(e,t,n){const[r,s]=Xf(n?.in,e,t);return+ef(r)==+ef(s)}function T6(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function PUe(e){return!(!T6(e)&&typeof e!="number"||isNaN(+vn(e)))}function Eh(e,t,n){const[r,s]=Xf(n?.in,e,t),o=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return o*12+a}function OUe(e,t,n){const[r,s]=Xf(n?.in,e,t),o=ri(r,n),a=ri(s,n),i=+o-k2(o),c=+a-k2(a);return Math.round((i-c)/M6)}function A6(e,t){const n=vn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Bs(e,t){const n=vn(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Gee(e,t){const n=vn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function N6(e,t){const n=Rg(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=vn(e,t?.in),o=s.getDay(),a=(o=+i?r+1:+n>=+u?r:r-1}function FUe(e,t){const n=Rg(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Kee(e,t),o=Vr(t?.in||e,0);return o.setFullYear(s,0,r),o.setHours(0,0,0,0),ri(o,t)}function Yee(e,t){const n=vn(e,t?.in),r=+ri(n,t)-+FUe(n,t);return Math.round(r/M6)+1}function gn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const il={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return gn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):gn(n+1,2)},d(e,t){return gn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return gn(e.getHours()%12||12,t.length)},H(e,t){return gn(e.getHours(),t.length)},m(e,t){return gn(e.getMinutes(),t.length)},s(e,t){return gn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return gn(s,t.length)}},Fu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},PI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return il.y(e,t)},Y:function(e,t,n,r){const s=Kee(e,r),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return gn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):gn(o,t.length)},R:function(e,t){const n=Wee(e);return gn(n,t.length)},u:function(e,t){const n=e.getFullYear();return gn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return gn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return gn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return il.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return gn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=Yee(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):gn(s,t.length)},I:function(e,t,n){const r=qee(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):gn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):il.d(e,t)},D:function(e,t,n){const r=LUe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):gn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return gn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return gn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return gn(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Fu.noon:r===0?s=Fu.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Fu.evening:r>=12?s=Fu.afternoon:r>=4?s=Fu.morning:s=Fu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return il.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):il.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):gn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):gn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):il.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):il.s(e,t)},S:function(e,t){return il.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return LI(r);case"XXXX":case"XX":return vc(r);case"XXXXX":case"XXX":default:return vc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return LI(r);case"xxxx":case"xx":return vc(r);case"xxxxx":case"xxx":default:return vc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+OI(r,":");case"OOOO":default:return"GMT"+vc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+OI(r,":");case"zzzz":default:return"GMT"+vc(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return gn(r,t.length)},T:function(e,t,n){return gn(+e,t.length)}};function OI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),o=r%60;return o===0?n+String(s):n+String(s)+t+gn(o,2)}function LI(e,t){return e%60===0?(e>0?"-":"+")+gn(Math.abs(e)/60,2):vc(e,t)}function vc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=gn(Math.trunc(r/60),2),o=gn(r%60,2);return n+s+t+o}const FI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Qee=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},BUe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return FI(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",FI(r,t)).replace("{{time}}",Qee(s,t))},UUe={p:Qee,P:BUe},VUe=/^D+$/,HUe=/^Y+$/,zUe=["D","DD","YY","YYYY"];function WUe(e){return VUe.test(e)}function GUe(e){return HUe.test(e)}function $Ue(e,t,n){const r=qUe(e,t,n);if(console.warn(r),zUe.includes(e))throw new RangeError(r)}function qUe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const KUe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YUe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,QUe=/^'([^]*?)'?$/,XUe=/''/g,ZUe=/[a-zA-Z]/;function gu(e,t,n){const r=Rg(),s=n?.locale??r.locale??zee,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=vn(e,n?.in);if(!PUe(i))throw new RangeError("Invalid time value");let c=t.match(YUe).map(f=>{const m=f[0];if(m==="p"||m==="P"){const p=UUe[m];return p(f,s.formatLong)}return f}).join("").match(KUe).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:JUe(f)};if(PI[m])return{isToken:!0,value:f};if(m.match(ZUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});s.localize.preprocessor&&(c=s.localize.preprocessor(i,c));const u={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return c.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&GUe(m)||!n?.useAdditionalDayOfYearTokens&&WUe(m))&&$Ue(m,t,String(e));const p=PI[m[0]];return p(i,m,s.localize,u)}).join("")}function JUe(e){const t=e.match(QUe);return t?t[1].replace(XUe,"'"):e}function eVe(e,t){const n=vn(e,t?.in),r=n.getFullYear(),s=n.getMonth(),o=Vr(n,0);return o.setFullYear(r,s+1,0),o.setHours(0,0,0,0),o.getDate()}function tVe(e){return Math.trunc(+vn(e)/1e3)}function nVe(e,t){const n=vn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),vn(n,t?.in)}function rVe(e,t){const n=vn(e,t?.in);return OUe(nVe(n,t),Bs(n,t),t)+1}function Xee(e,t){return+vn(e)>+vn(t)}function Zee(e,t){return+vn(e)<+vn(t)}function R6(e,t,n){const[r,s]=Xf(n?.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function sVe(e,t,n){const[r,s]=Xf(n?.in,e,t);return r.getFullYear()===s.getFullYear()}function BI(e,t,n){return So(e,-t,n)}function _w(e,t,n){const r=vn(e,n?.in),s=r.getFullYear(),o=r.getDate(),a=Vr(e,0);a.setFullYear(s,t,15),a.setHours(0,0,0,0);const i=eVe(a);return r.setMonth(t,Math.min(o,i)),r}function UI(e,t,n){const r=vn(e,n?.in);return isNaN(+r)?Vr(e,NaN):(r.setFullYear(t),r)}var _t=function(){return _t=Object.assign||function(t){for(var n,r=1,s=arguments.length;r1&&(c||!u),m=t>1&&(u||!c),p=function(){r&&o(r)},h=function(){s&&o(s)};return A.createElement(LVe,{displayMonth:e.displayMonth,hideNext:f,hidePrevious:m,nextMonth:s,previousMonth:r,onPreviousClick:p,onNextClick:h})}function FVe(e){var t,n=Hn(),r=n.classNames,s=n.disableNavigation,o=n.styles,a=n.captionLayout,i=n.components,c=(t=i?.CaptionLabel)!==null&&t!==void 0?t:tte,u;return s?u=A.createElement(c,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?u=A.createElement(VI,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?u=A.createElement(A.Fragment,null,A.createElement(VI,{displayMonth:e.displayMonth,id:e.id}),A.createElement(HI,{displayMonth:e.displayMonth,id:e.id})):u=A.createElement(A.Fragment,null,A.createElement(c,{id:e.id,displayMonth:e.displayMonth}),A.createElement(HI,{displayMonth:e.displayMonth,id:e.id})),A.createElement("div",{className:r.caption,style:o.caption},u)}function BVe(e){var t=Hn(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?A.createElement("tfoot",{className:s,style:r.tfoot},A.createElement("tr",null,A.createElement("td",{colSpan:8},n))):A.createElement(A.Fragment,null)}function UVe(e,t,n){for(var r=n?Zc(new Date):ri(new Date,{locale:e,weekStartsOn:t}),s=[],o=0;o<7;o++){var a=So(r,o);s.push(a)}return s}function VVe(){var e=Hn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,o=e.weekStartsOn,a=e.ISOWeek,i=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=UVe(s,o,a);return A.createElement("tr",{style:n.head_row,className:t.head_row},r&&A.createElement("td",{style:n.head_cell,className:t.head_cell}),u.map(function(f,m){return A.createElement("th",{key:m,scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s})},i(f,{locale:s}))}))}function HVe(){var e,t=Hn(),n=t.classNames,r=t.styles,s=t.components,o=(e=s?.HeadRow)!==null&&e!==void 0?e:VVe;return A.createElement("thead",{style:r.head,className:n.head},A.createElement(o,null))}function zVe(e){var t=Hn(),n=t.locale,r=t.formatters.formatDay;return A.createElement(A.Fragment,null,r(e.date,{locale:n}))}var D6=d.createContext(void 0);function WVe(e){if(!Dg(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return A.createElement(D6.Provider,{value:t},e.children)}return A.createElement(GVe,{initialProps:e.initialProps,children:e.children})}function GVe(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,o=t.max,a=function(u,f,m){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,u,f,m);var g=!!(f.selected&&s&&r?.length===s);if(!g){var y=!!(!f.selected&&o&&r?.length===o);if(!y){var x=r?Jee([],r):[];if(f.selected){var v=x.findIndex(function(b){return Ps(u,b)});x.splice(v,1)}else x.push(u);(h=t.onSelect)===null||h===void 0||h.call(t,x,u,f,m)}}},i={disabled:[]};r&&i.disabled.push(function(u){var f=o&&r.length>o-1,m=r.some(function(p){return Ps(p,u)});return!!(f&&!m)});var c={selected:r,onDayClick:a,modifiers:i};return A.createElement(D6.Provider,{value:c},n)}function j6(){var e=d.useContext(D6);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function $Ve(e,t){var n=t||{},r=n.from,s=n.to;if(!r)return{from:e,to:void 0};if(!s&&Ps(r,e))return{from:r,to:e};if(!s&&Zee(e,r))return{from:e,to:r};if(!s)return{from:r,to:e};if(!(Ps(s,e)&&Ps(r,e))){if(Ps(s,e))return{from:s,to:void 0};if(!Ps(r,e))return Xee(r,e)?{from:e,to:s}:{from:r,to:e}}}var I6=d.createContext(void 0);function qVe(e){if(!jg(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return A.createElement(I6.Provider,{value:t},e.children)}return A.createElement(KVe,{initialProps:e.initialProps,children:e.children})}function KVe(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},o=s.from,a=s.to,i=t.min,c=t.max,u=function(h,g,y){var x,v;(x=t.onDayClick)===null||x===void 0||x.call(t,h,g,y);var b=$Ve(h,r);(v=t.onSelect)===null||v===void 0||v.call(t,b,h,g,y)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o&&(f.range_start=[o],a?(f.range_end=[a],Ps(o,a)||(f.range_middle=[{after:o,before:a}])):f.range_end=[o]),i&&(o&&!a&&f.disabled.push({after:BI(o,i-1),before:So(o,i-1)}),o&&a&&f.disabled.push({after:o,before:So(o,i-1)})),c&&(o&&!a&&(f.disabled.push({before:So(o,-c+1)}),f.disabled.push({after:So(o,c-1)})),o&&a)){var m=Va(a,o)+1,p=c-m;f.disabled.push({before:BI(o,p)}),f.disabled.push({after:So(a,p)})}return A.createElement(I6.Provider,{value:{selected:r,onDayClick:u,modifiers:f}},n)}function P6(){var e=d.useContext(I6);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function yy(e){return Array.isArray(e)?Jee([],e):e!==void 0?[e]:[]}function YVe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=yy(s)}),t}var va;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(va||(va={}));var QVe=va.Selected,Ci=va.Disabled,XVe=va.Hidden,ZVe=va.Today,ww=va.RangeEnd,Cw=va.RangeMiddle,Sw=va.RangeStart,JVe=va.Outside;function eHe(e,t,n){var r,s=(r={},r[QVe]=yy(e.selected),r[Ci]=yy(e.disabled),r[XVe]=yy(e.hidden),r[ZVe]=[e.today],r[ww]=[],r[Cw]=[],r[Sw]=[],r[JVe]=[],r);return e.fromDate&&s[Ci].push({before:e.fromDate}),e.toDate&&s[Ci].push({after:e.toDate}),Dg(e)?s[Ci]=s[Ci].concat(t.modifiers[Ci]):jg(e)&&(s[Ci]=s[Ci].concat(n.modifiers[Ci]),s[Sw]=n.modifiers[Sw],s[Cw]=n.modifiers[Cw],s[ww]=n.modifiers[ww]),s}var ste=d.createContext(void 0);function tHe(e){var t=Hn(),n=j6(),r=P6(),s=eHe(t,n,r),o=YVe(t.modifiers),a=_t(_t({},s),o);return A.createElement(ste.Provider,{value:a},e.children)}function ote(){var e=d.useContext(ste);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function nHe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function rHe(e){return!!(e&&typeof e=="object"&&"from"in e)}function sHe(e){return!!(e&&typeof e=="object"&&"after"in e)}function oHe(e){return!!(e&&typeof e=="object"&&"before"in e)}function aHe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function iHe(e,t){var n,r=t.from,s=t.to;if(!r)return!1;if(!s&&Ps(r,e))return!0;if(!s)return!1;var o=Va(s,r)<0;o&&(n=[s,r],r=n[0],s=n[1]);var a=Va(e,r)>=0&&Va(s,e)>=0;return a}function lHe(e){return T6(e)}function cHe(e){return Array.isArray(e)&&e.every(T6)}function uHe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(lHe(n))return Ps(e,n);if(cHe(n))return n.includes(e);if(rHe(n))return iHe(e,n);if(aHe(n))return n.dayOfWeek.includes(e.getDay());if(nHe(n)){var r=Va(n.before,e),s=Va(n.after,e),o=r>0,a=s<0,i=Xee(n.before,n.after);return i?a&&o:o||a}return sHe(n)?Va(e,n.after)>0:oHe(n)?Va(n.before,e)>0:typeof n=="function"?n(e):!1})}function O6(e,t,n){var r=Object.keys(t).reduce(function(o,a){var i=t[a];return uHe(e,i)&&o.push(a),o},[]),s={};return r.forEach(function(o){return s[o]=!0}),n&&!R6(e,n)&&(s.outside=!0),s}function dHe(e,t){for(var n=Bs(e[0]),r=A6(e[e.length-1]),s,o,a=n;a<=r;){var i=O6(a,t),c=!i.disabled&&!i.hidden;if(!c){a=So(a,1);continue}if(i.selected)return a;i.today&&!o&&(o=a),s||(s=a),a=So(a,1)}return o||s}var fHe=365;function ate(e,t){var n=t.moveBy,r=t.direction,s=t.context,o=t.modifiers,a=t.retry,i=a===void 0?{count:0,lastFocused:e}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,m=s.locale,p={day:So,week:PE,month:si,year:DUe,startOfWeek:function(x){return s.ISOWeek?Zc(x):ri(x,{locale:m,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?$ee(x):N6(x,{locale:m,weekStartsOn:c})}},h=p[n](e,r==="after"?1:-1);r==="before"&&u?h=jUe([u,h]):r==="after"&&f&&(h=IUe([f,h]));var g=!0;if(o){var y=O6(h,o);g=!y.disabled&&!y.hidden}return g?h:i.count>fHe?i.lastFocused:ate(h,{moveBy:n,direction:r,context:s,modifiers:o,retry:_t(_t({},i),{count:i.count+1})})}var ite=d.createContext(void 0);function mHe(e){var t=Ig(),n=ote(),r=d.useState(),s=r[0],o=r[1],a=d.useState(),i=a[0],c=a[1],u=dHe(t.displayMonths,n),f=s??(i&&t.isDateDisplayed(i))?i:u,m=function(){c(s),o(void 0)},p=function(x){o(x)},h=Hn(),g=function(x,v){if(s){var b=ate(s,{moveBy:x,direction:v,context:h,modifiers:n});Ps(s,b)||(t.goToDate(b,s),p(b))}},y={focusedDay:s,focusTarget:f,blur:m,focus:p,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return A.createElement(ite.Provider,{value:y},e.children)}function L6(){var e=d.useContext(ite);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function pHe(e,t){var n=ote(),r=O6(e,n,t);return r}var F6=d.createContext(void 0);function hHe(e){if(!Kv(e.initialProps)){var t={selected:void 0};return A.createElement(F6.Provider,{value:t},e.children)}return A.createElement(gHe,{initialProps:e.initialProps,children:e.children})}function gHe(e){var t=e.initialProps,n=e.children,r=function(o,a,i){var c,u,f;if((c=t.onDayClick)===null||c===void 0||c.call(t,o,a,i),a.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,o,a,i);return}(f=t.onSelect)===null||f===void 0||f.call(t,o,o,a,i)},s={selected:t.selected,onDayClick:r};return A.createElement(F6.Provider,{value:s},n)}function lte(){var e=d.useContext(F6);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function yHe(e,t){var n=Hn(),r=lte(),s=j6(),o=P6(),a=L6(),i=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,m=a.blur,p=a.focus,h=a.focusMonthBefore,g=a.focusMonthAfter,y=a.focusYearBefore,x=a.focusYearAfter,v=a.focusStartOfWeek,b=a.focusEndOfWeek,_=function(P){var L,U,O,$;Kv(n)?(L=r.onDayClick)===null||L===void 0||L.call(r,e,t,P):Dg(n)?(U=s.onDayClick)===null||U===void 0||U.call(s,e,t,P):jg(n)?(O=o.onDayClick)===null||O===void 0||O.call(o,e,t,P):($=n.onDayClick)===null||$===void 0||$.call(n,e,t,P)},w=function(P){var L;p(e),(L=n.onDayFocus)===null||L===void 0||L.call(n,e,t,P)},S=function(P){var L;m(),(L=n.onDayBlur)===null||L===void 0||L.call(n,e,t,P)},C=function(P){var L;(L=n.onDayMouseEnter)===null||L===void 0||L.call(n,e,t,P)},E=function(P){var L;(L=n.onDayMouseLeave)===null||L===void 0||L.call(n,e,t,P)},T=function(P){var L;(L=n.onDayPointerEnter)===null||L===void 0||L.call(n,e,t,P)},k=function(P){var L;(L=n.onDayPointerLeave)===null||L===void 0||L.call(n,e,t,P)},I=function(P){var L;(L=n.onDayTouchCancel)===null||L===void 0||L.call(n,e,t,P)},M=function(P){var L;(L=n.onDayTouchEnd)===null||L===void 0||L.call(n,e,t,P)},N=function(P){var L;(L=n.onDayTouchMove)===null||L===void 0||L.call(n,e,t,P)},D=function(P){var L;(L=n.onDayTouchStart)===null||L===void 0||L.call(n,e,t,P)},j=function(P){var L;(L=n.onDayKeyUp)===null||L===void 0||L.call(n,e,t,P)},F=function(P){var L;switch(P.key){case"ArrowLeft":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?i():c();break;case"ArrowRight":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?c():i();break;case"ArrowDown":P.preventDefault(),P.stopPropagation(),u();break;case"ArrowUp":P.preventDefault(),P.stopPropagation(),f();break;case"PageUp":P.preventDefault(),P.stopPropagation(),P.shiftKey?y():h();break;case"PageDown":P.preventDefault(),P.stopPropagation(),P.shiftKey?x():g();break;case"Home":P.preventDefault(),P.stopPropagation(),v();break;case"End":P.preventDefault(),P.stopPropagation(),b();break}(L=n.onDayKeyDown)===null||L===void 0||L.call(n,e,t,P)},R={onClick:_,onFocus:w,onBlur:S,onKeyDown:F,onKeyUp:j,onMouseEnter:C,onMouseLeave:E,onPointerEnter:T,onPointerLeave:k,onTouchCancel:I,onTouchEnd:M,onTouchMove:N,onTouchStart:D};return R}function xHe(){var e=Hn(),t=lte(),n=j6(),r=P6(),s=Kv(e)?t.selected:Dg(e)?n.selected:jg(e)?r.selected:void 0;return s}function vHe(e){return Object.values(va).includes(e)}function bHe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(vHe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function _He(e,t){var n=_t({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=_t(_t({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function wHe(e,t,n){var r,s,o,a=Hn(),i=L6(),c=pHe(e,t),u=yHe(e,c),f=xHe(),m=!!(a.onDayClick||a.mode!=="default");d.useEffect(function(){var C;c.outside||i.focusedDay&&m&&Ps(i.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[i.focusedDay,e,n,m,c.outside]);var p=bHe(a,c).join(" "),h=_He(a,c),g=!!(c.outside&&!a.showOutsideDays||c.hidden),y=(o=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&o!==void 0?o:zVe,x=A.createElement(y,{date:e,displayMonth:t,activeModifiers:c}),v={style:h,className:p,children:x,role:"gridcell"},b=i.focusTarget&&Ps(i.focusTarget,e)&&!c.outside,_=i.focusedDay&&Ps(i.focusedDay,e),w=_t(_t(_t({},v),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=_||b?0:-1,r)),u),S={isButton:m,isHidden:g,activeModifiers:c,selectedDays:f,buttonProps:w,divProps:v};return S}function CHe(e){var t=d.useRef(null),n=wHe(e.date,e.displayMonth,t);return n.isHidden?A.createElement("div",{role:"gridcell"}):n.isButton?A.createElement(M2,_t({name:"day",ref:t},n.buttonProps)):A.createElement("div",_t({},n.divProps))}function SHe(e){var t=e.number,n=e.dates,r=Hn(),s=r.onWeekNumberClick,o=r.styles,a=r.classNames,i=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(t),{locale:i});if(!s)return A.createElement("span",{className:a.weeknumber,style:o.weeknumber},f);var m=c(Number(t),{locale:i}),p=function(h){s(t,n,h)};return A.createElement(M2,{name:"week-number","aria-label":m,className:a.weeknumber,style:o.weeknumber,onClick:p},f)}function EHe(e){var t,n,r=Hn(),s=r.styles,o=r.classNames,a=r.showWeekNumber,i=r.components,c=(t=i?.Day)!==null&&t!==void 0?t:CHe,u=(n=i?.WeekNumber)!==null&&n!==void 0?n:SHe,f;return a&&(f=A.createElement("td",{className:o.cell,style:s.cell},A.createElement(u,{number:e.weekNumber,dates:e.dates}))),A.createElement("tr",{className:o.row,style:s.row},f,e.dates.map(function(m){return A.createElement("td",{className:o.cell,style:s.cell,key:tVe(m),role:"presentation"},A.createElement(c,{displayMonth:e.displayMonth,date:m}))}))}function zI(e,t,n){for(var r=n?.ISOWeek?$ee(t):N6(t,n),s=n?.ISOWeek?Zc(e):ri(e,n),o=Va(r,s),a=[],i=0;i<=o;i++)a.push(So(s,i));var c=a.reduce(function(u,f){var m=n?.ISOWeek?qee(f):Yee(f,n),p=u.find(function(h){return h.weekNumber===m});return p?(p.dates.push(f),u):(u.push({weekNumber:m,dates:[f]}),u)},[]);return c}function kHe(e,t){var n=zI(Bs(e),A6(e),t);if(t?.useFixedWeeks){var r=rVe(e,t);if(r<6){var s=n[n.length-1],o=s.dates[s.dates.length-1],a=PE(o,6-r),i=zI(PE(o,1),a,t);n.push.apply(n,i)}}return n}function MHe(e){var t,n,r,s=Hn(),o=s.locale,a=s.classNames,i=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,m=s.weekStartsOn,p=s.firstWeekContainsDate,h=s.ISOWeek,g=kHe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:h,locale:o,weekStartsOn:m,firstWeekContainsDate:p}),y=(t=f?.Head)!==null&&t!==void 0?t:HVe,x=(n=f?.Row)!==null&&n!==void 0?n:EHe,v=(r=f?.Footer)!==null&&r!==void 0?r:BVe;return A.createElement("table",{className:a.table,style:i.table,role:"grid","aria-labelledby":e["aria-labelledby"]},!c&&A.createElement(y,null),A.createElement("tbody",{className:a.tbody,style:i.tbody,role:"rowgroup"},g.map(function(b){return A.createElement(x,{displayMonth:e.displayMonth,key:b.weekNumber,dates:b.dates,weekNumber:b.weekNumber})})),A.createElement(v,{displayMonth:e.displayMonth}))}function THe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var AHe=THe()?d.useLayoutEffect:d.useEffect,Ew=!1,NHe=0;function WI(){return"react-day-picker-".concat(++NHe)}function RHe(e){var t,n=e??(Ew?WI():null),r=d.useState(n),s=r[0],o=r[1];return AHe(function(){s===null&&o(WI())},[]),d.useEffect(function(){Ew===!1&&(Ew=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function DHe(e){var t,n,r=Hn(),s=r.dir,o=r.classNames,a=r.styles,i=r.components,c=Ig().displayMonths,u=RHe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),f=[o.month],m=a.month,p=e.displayIndex===0,h=e.displayIndex===c.length-1,g=!p&&!h;s==="rtl"&&(t=[p,h],h=t[0],p=t[1]),p&&(f.push(o.caption_start),m=_t(_t({},m),a.caption_start)),h&&(f.push(o.caption_end),m=_t(_t({},m),a.caption_end)),g&&(f.push(o.caption_between),m=_t(_t({},m),a.caption_between));var y=(n=i?.Caption)!==null&&n!==void 0?n:FVe;return A.createElement("div",{key:e.displayIndex,className:f.join(" "),style:m},A.createElement(y,{id:u,displayMonth:e.displayMonth}),A.createElement(MHe,{"aria-labelledby":u,displayMonth:e.displayMonth}))}function jHe(e){var t=e.initialProps,n=Hn(),r=L6(),s=Ig(),o=d.useState(!1),a=o[0],i=o[1];d.useEffect(function(){n.initialFocus&&r.focusTarget&&(a||(r.focus(r.focusTarget),i(!0)))},[n.initialFocus,a,r.focus,r.focusTarget,r]);var c=[n.classNames.root,n.className];n.numberOfMonths>1&&c.push(n.classNames.multiple_months),n.showWeekNumber&&c.push(n.classNames.with_weeknumber);var u=_t(_t({},n.styles.root),n.style),f=Object.keys(t).filter(function(m){return m.startsWith("data-")}).reduce(function(m,p){var h;return _t(_t({},m),(h={},h[p]=t[p],h))},{});return A.createElement("div",_t({className:c.join(" "),style:u,dir:n.dir,id:n.id},f),A.createElement("div",{className:n.classNames.months,style:n.styles.months},s.displayMonths.map(function(m,p){return A.createElement(DHe,{key:p,displayIndex:p,displayMonth:m})})))}function IHe(e){var t=e.children,n=oVe(e,["children"]);return A.createElement(SVe,{initialProps:n},A.createElement(IVe,null,A.createElement(hHe,{initialProps:n},A.createElement(WVe,{initialProps:n},A.createElement(qVe,{initialProps:n},A.createElement(tHe,null,A.createElement(mHe,null,t)))))))}function PHe(e){return A.createElement(IHe,_t({},e),A.createElement(jHe,{initialProps:e}))}const B6=A.memo(({className:e,showOutsideDays:t=!0,...n})=>{const r=A.useMemo(()=>({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-between relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:"h-7 w-7 p-0 rounded hover:bg-subtle flex items-center justify-center bg-subtler [&_*]:fill-quiet",table:"w-full border-collapse",head_row:"flex",head_cell:"text-quiet rounded-md w-8 font-normal text-sm font-mono",row:"flex w-full mt-1",cell:z("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected].day-range-end)]:rounded-r-full",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-full [&:has([aria-selected])]:bg-superBG [&:has(>.day-range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full":"[&:has([aria-selected])]:rounded-md"),day:"size-8 p-0 font-normal select-none aria-selected:opacity-100 flex items-center justify-center rounded-full hover:bg-subtler cursor-pointer",day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:z(n.mode==="range"?"[&.day-range-start]:!bg-super [&.day-range-start]:!text-inverse [&.day-range-start]:hover:!bg-super [&.day-range-end]:!bg-super [&.day-range-end]:!text-inverse [&.day-range-end]:hover:!bg-super":"!bg-super !text-inverse hover:!bg-super"),day_today:"bg-superBG text-super hover:bg-superBG",day_outside:"day-outside text-quiet aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-quiet opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...z}),[n.mode]),s=d.useMemo(()=>({IconLeft:({className:o,...a})=>l.jsx(ge,{icon:B("chevron-left"),className:o,size:"sm",...a}),IconRight:({className:o,...a})=>l.jsx(ge,{icon:B("chevron-right"),className:o,size:"sm",...a})}),[]);return l.jsx(PHe,{showOutsideDays:t,className:z("p-3 font-sans text-base",e),classNames:r,components:s,...n})});B6.displayName="Calendar";const OHe=e=>e.toLocaleDateString(),T2=d.memo(function({value:t,onChange:n,placeholder:r="Select date",formatDate:s=OHe,showIcon:o=!0,buttonClassName:a,variant:i="default",trailingIcon:c,fromDate:u,endDate:f,allowPastDates:m=!1}){const[p,h]=d.useState(!1),g=d.useCallback(()=>{h(w=>!w)},[]),y=d.useCallback(w=>{n(w),h(!1)},[n]),x=d.useMemo(()=>{const w=new Date;return w.setHours(0,0,0,0),w},[]),v=(()=>{switch(i){case"subtle":return"bg-subtle";case"default":return"bg-subtler";default:At(i)}})(),b=d.useMemo(()=>m?f?{after:f}:void 0:{before:u??x,after:f},[m,f,u,x]),_=d.useMemo(()=>l.jsxs("div",{role:"button",tabIndex:0,onClick:g,className:z(v,"flex cursor-pointer items-center justify-between rounded-lg px-4 font-sans","hover:border-subtler focus:border-subtler border border-transparent","transition-colors duration-200 ease-out","h-10 w-full","outline-none focus:outline-none focus:ring-0",a),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[o&&l.jsx(ut,{name:B("calendar"),size:16,className:"text-foreground"}),l.jsx("span",{className:"text-foreground text-sm",children:t?s(t):r})]}),c]}),[v,a,s,g,r,o,c,t]);return l.jsx("div",{className:"relative size-full",children:l.jsx(Fl,{interaction:"click",open:p,onOpenChange:h,triggerElement:_,children:l.jsx(B6,{mode:"single",selected:t,onSelect:y,defaultMonth:t,disabled:b,fromDate:m?void 0:u??x})})})}),GI=e=>e?e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):"",$I="border-subtler bg-subtler text-foreground focus:border-super !h-9 rounded-lg border px-3 py-1 text-sm focus:outline-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-inner-spin-button]:hidden [&::-webkit-outer-spin-button]:hidden bg-transparent",qI="data-[state=closed]:border-subtler data-[state=open]:border-super data-[state=open]:hover:border-super !px-3 !h-9 bg-transparent",cte=d.memo(({startDateTime:e,endDateTime:t,onStartDateChange:n,onEndDateChange:r,onStartTimeChange:s,onEndTimeChange:o})=>{const{$t:a}=J(),i=d.useMemo(()=>e?new Date(e):void 0,[e]),c=d.useMemo(()=>t?new Date(t):void 0,[t]),u=d.useCallback(x=>{if(!x)return;const v=new Date(i||"");if(!isNaN(v.getTime())){if(v.setDate(x.getDate()),v.setMonth(x.getMonth()),v.setFullYear(x.getFullYear()),c&&c.getTime(){if(!x)return;const v=new Date(c||"");isNaN(v.getTime())||(v.setDate(x.getDate()),v.setMonth(x.getMonth()),v.setFullYear(x.getFullYear()),i&&v{s(x)},[s]),p=d.useCallback(x=>{if(!i)return;const[v,b]=x.split(":").map(Number);if(v===void 0||b===void 0)return;const _=new Date(i);isNaN(_.getTime())||(_.setHours(v),_.setMinutes(b),!isNaN(_.getTime())&&(c&&_.getTime()>c.getTime()&&r(_),n(_)))},[i,c,n,r]),h=d.useCallback(x=>{o(x)},[o]),g=d.useCallback(x=>{if(!c)return;const[v,b]=x.split(":").map(Number);if(v===void 0||b===void 0)return;const _=new Date(c);isNaN(_.getTime())||(_.setHours(v),_.setMinutes(b),!isNaN(_.getTime())&&(i&&_.getTime()x.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),[]);return l.jsxs("div",{className:"flex flex-col items-center gap-2 md:flex-row",children:[l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx(T2,{buttonClassName:qI,value:i,onChange:u,placeholder:a({defaultMessage:"Select start date",id:"oUUhTXC2Mx"}),formatDate:y,showIcon:!1}),l.jsx("input",{type:"time",value:GI(i),onChange:x=>m(x.target.value),onBlur:x=>p(x.target.value),className:$I})]}),l.jsx("span",{className:"text-quieter mx-1 text-sm",children:a({defaultMessage:"to",id:"NLeFGnA9M4"})}),l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx("input",{type:"time",value:GI(c),onChange:x=>h(x.target.value),onBlur:x=>g(x.target.value),className:$I}),l.jsx(T2,{buttonClassName:qI,value:c,onChange:f,placeholder:a({defaultMessage:"Select end date",id:"0A4/NpHFx/"}),formatDate:y,showIcon:!1})]})]})});cte.displayName="CalendarTimeEditable";function LHe(e){if(!e)return null;try{let t=e;e.startsWith("RRULE:")&&(t=e.substring(6));const n={};for(const r of t.split(";"))if(r.includes("=")){const[s,o]=r.split("=",2);s&&o&&(n[s]=o)}return{freq:n.FREQ?.toUpperCase(),interval:n.INTERVAL?parseInt(n.INTERVAL,10):1,byDay:n.BYDAY?.split(","),byMonthDay:n.BYMONTHDAY,count:n.COUNT}}catch{return null}}function FHe(e){try{if(!e.freq)return null;let t=`RRULE:FREQ=${e.freq}`;return e.interval&&e.interval!==1&&(t+=`;INTERVAL=${e.interval}`),e.byDay&&e.byDay.length>0&&(t+=`;BYDAY=${e.byDay.join(",")}`),e.byMonthDay&&(t+=`;BYMONTHDAY=${e.byMonthDay}`),e.count&&(t+=`;COUNT=${e.count}`),t}catch{return null}}const A2=A.memo(({id:e,label:t,extraCSS:n,options:r,activeKey:s,onOptionChange:o,isDisabled:a=!1,testId:i,defaultOption:c,icon:u,...f})=>{c&&(r=[{label:c,value:""}].concat(r||[]));const m=r||[],p=h=>{o(c&&h===""?null:h)};return l.jsxs("div",{children:[l.jsx(_v,{withMargin:!1,label:t}),l.jsx(V,{variant:"small",className:t&&"mt-sm",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx("select",{"data-testid":i,id:e,onChange:h=>p(h.target.value),value:s??"",className:z("border-subtler bg-base p-sm pr-lg outline-super ring-subtler dark:border-subtle dark:bg-subtler dark:ring-subtle w-full appearance-none rounded border transition duration-300 focus:outline-none",{"cursor-pointer hover:ring-1":!a,"pl-lg":u},n),disabled:a,...f,children:m.map(h=>l.jsx("option",{value:h.value,className:"pl-sm",children:h.label},h.value))}),u&&l.jsx("div",{className:"left-sm absolute",children:u}),l.jsx(V,{color:"light",variant:"small",className:"right-sm pointer-events-none absolute",children:l.jsx(ge,{icon:B("chevron-down"),size:"md"})})]})})]})});A2.displayName="Select";const e1={frequency:"WEEKLY",endType:"never",interval:"1"},t1=He({day:{id:"ruG8dNqKt0",defaultMessage:"{count, plural, one {Day} other {Days}}"},week:{id:"cR0w/cReH+",defaultMessage:"{count, plural, one {Week} other {Weeks}}"},month:{id:"svowrjAWNi",defaultMessage:"{count, plural, one {Month} other {Months}}"},year:{id:"OPfd4WaWUE",defaultMessage:"{count, plural, one {Year} other {Years}}"}}),BHe=e=>[{label:e({defaultMessage:"Daily",id:"zxvhnETmn2"}),value:"DAILY"},{label:e({defaultMessage:"Weekly",id:"/clOBUs/wZ"}),value:"WEEKLY"},{label:e({defaultMessage:"Monthly",id:"wYsv4ZHu+B"}),value:"MONTHLY"},{label:e({defaultMessage:"Yearly",id:"dqD39hnoA/"}),value:"YEARLY"}],UHe=e=>[{label:e({defaultMessage:"Never",id:"du1laW45Py"}),value:"never"},{label:e({defaultMessage:"After",id:"4X+U8o+ztO"}),value:"after"}],VHe=e=>[{label:e({defaultMessage:"Mo",id:"EIk6EqFZZN"}),value:"MO"},{label:e({defaultMessage:"Tu",id:"dswupo3WZd"}),value:"TU"},{label:e({defaultMessage:"We",id:"p02wWlGXK3"}),value:"WE"},{label:e({defaultMessage:"Th",id:"Ee4Ne0CnpN"}),value:"TH"},{label:e({defaultMessage:"Fr",id:"pCVXo8kVuW"}),value:"FR"},{label:e({defaultMessage:"Sa",id:"QJaSgEWRy1"}),value:"SA"},{label:e({defaultMessage:"Su",id:"n4xx4rvq9+"}),value:"SU"}],HHe=e=>{if(!e.frequency||e.frequency==="WEEKLY"&&(!e.byDay||e.byDay.length===0))return!1;if(e.interval){const t=parseInt(e.interval,10);if(isNaN(t)||t<1)return!1}if(e.endType==="after"){if(!e.count)return!1;const t=parseInt(e.count,10);if(isNaN(t)||t<1)return!1}return!0},zHe=(e,t)=>({MO:t({defaultMessage:"Mon",id:"T8JZHei06V"}),TU:t({defaultMessage:"Tue",id:"C4ENlvYIEr"}),WE:t({defaultMessage:"Wed",id:"2NqUghZFW1"}),TH:t({defaultMessage:"Thu",id:"FC0AP4JIua"}),FR:t({defaultMessage:"Fri",id:"hFYE2MSlqH"}),SA:t({defaultMessage:"Sat",id:"3Hv4FbI9Kl"}),SU:t({defaultMessage:"Sun",id:"1Aday2s3it"})})[e]||e,ute=d.memo(({value:e,onChange:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),[o,a]=d.useState(e1);d.useEffect(()=>{if(Hi(e)&&!r){const x=LHe(e[0]);x&&(a({...e1,frequency:x.freq,interval:x.interval?.toString()||"1",byDay:x.byDay,count:x.count,endType:x.count?"after":"never"}),s(!0))}},[e,r]);const i=d.useMemo(()=>BHe(n),[n]),c=d.useMemo(()=>UHe(n),[n]),u=d.useMemo(()=>VHe(n),[n]),f=parseInt(o.interval||"1",10),m={DAILY:n(t1.day,{count:f}),WEEKLY:n(t1.week,{count:f}),MONTHLY:n(t1.month,{count:f}),YEARLY:n(t1.year,{count:f})},p=x=>{if(HHe(x)){const v=FHe({freq:x.frequency,interval:x.interval?parseInt(x.interval,10):1,byDay:x.byDay,count:x.endType==="after"?x.count:void 0});v&&t([v])}},h=x=>{const v={...o,...x};a(v),p(v)},g=x=>{const v=o.byDay||[],b=v.includes(x)?v.filter(w=>w!==x):[...v,x],_={...o,byDay:b};a(_),p(_)},y=()=>{s(!1),a(e1),t([])};return l.jsxs(K,{className:"space-y-1 pl-1",children:[!r&&e.length===0&&l.jsx(K,{className:"flex items-center justify-between pl-1",children:l.jsx(st,{onClick:()=>{s(!0),a(e1)},noPadding:!0,variant:"noBackground",text:n({defaultMessage:"Repeat",id:"tw5j2+ZRIB"}),leadingComponent:l.jsx(ut,{name:B("plus"),size:16}),size:"tiny"})}),r&&l.jsxs(K,{className:"flex flex-col gap-2 rounded",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-quieter whitespace-nowrap pr-1 text-xs",children:n({defaultMessage:"Every",id:"JE2YVbgaBx"})}),l.jsx(co,{isMobileUserAgent:!1,min:1,max:99,type:"number",value:o.interval?.toString()||"1",onChange:x=>h({interval:x}),className:"focus:!border-super !w-16 rounded-lg !px-3 focus:!ring-transparent"}),l.jsx(A2,{id:"frequency-select",activeKey:o.frequency||"WEEKLY",options:i.map(x=>({...x,label:m[x.value]})),onOptionChange:x=>h({frequency:x}),extraCSS:"rounded-lg"}),l.jsx("span",{className:"text-quieter whitespace-nowrap pl-2 pr-1 text-xs",children:n({defaultMessage:"Ends",id:"04xGLEkMMo"})}),l.jsx(A2,{id:"end-type-select",activeKey:o.endType||"never",options:c,onOptionChange:x=>h({endType:x,count:x==="after"?"1":void 0}),extraCSS:"rounded-lg w-full"}),o.endType==="after"&&l.jsxs(l.Fragment,{children:[l.jsx(co,{isMobileUserAgent:!1,min:1,max:99,type:"number",value:o.count||"1",onChange:x=>h({count:x}),className:"focus:!border-super !w-16 rounded-lg !px-3 focus:!ring-transparent"}),l.jsx("span",{className:"text-quieter pr-sm whitespace-nowrap text-xs",children:o.count==="1"?n({defaultMessage:"time",id:"nTBG1bRQLC"}):n({defaultMessage:"times",id:"KSQJ7UVwln"})})]}),l.jsx(Ge,{onClick:y,text:n({defaultMessage:"Cancel",id:"47FYwba+bI"}),variant:"common",extraCSS:"px-3 py-1 text-xs ml-auto"})]}),o.frequency==="WEEKLY"&&l.jsxs(K,{className:"flex items-center gap-2",children:[l.jsx("label",{className:"text-quieter w-9 whitespace-nowrap text-xs",children:n({defaultMessage:"On",id:"Zh+5A6yahu"})}),l.jsx("div",{className:"flex gap-2",children:u.map(x=>l.jsx(Ge,{onClick:()=>g(x.value),text:x.label,size:"tiny",pill:!0,variant:o.byDay?.includes(x.value)?"inverted":"common",ariaLabel:n({defaultMessage:"Toggle {day}",id:"i/JqE0BlGw"},{day:zHe(x.value,n)}),noPadding:!0,extraCSS:"w-8 h-8 !p-0 !text-2xs"},x.value))})]})]})]})});ute.displayName="RecurrenceEditor";const dte=A.memo(({label:e,onDelete:t,onClick:n,testId:r,selected:s=!1,disabled:o=!1,title:a,shouldAvoidFocusShift:i=!1,deleteIcon:c=B("x")})=>{const{$t:u}=J(),f=d.useCallback(g=>{g.stopPropagation(),t?.()},[t]),m=d.useCallback(g=>{g.stopPropagation(),n?.({shiftKey:g.shiftKey,metaKey:g.metaKey,ctrlKey:g.ctrlKey})},[n]),p=t&&!o,h=d.useCallback(g=>{g.stopPropagation(),i&&g.preventDefault()},[i]);return l.jsxs("span",{className:"relative flex h-6 max-w-full",children:[l.jsx(K,{className:z("h-full min-w-0 flex-1 rounded-lg border px-2 text-sm",{"pr-[24px]":p},{"cursor-default":o}),variant:s?"superBorder":"subtler","data-test-id":r,onClick:o?void 0:m,onMouseDown:h,as:"button",bgHover:o?void 0:"subtle",title:a,children:l.jsx(V,{variant:"small",className:"block truncate",children:e})}),p&&l.jsx(K,{variant:"transparent",onClick:f,tabIndex:0,"aria-label":u({defaultMessage:"Remove",id:"G/yZLul6P1"}),as:"button",bgHover:"subtle",className:"top-three right-three absolute flex items-center justify-center rounded-md p-0.5",children:l.jsx(rn,{icon:c,size:"tiny"})})]})});dte.displayName="Chip";var KI=1,WHe=.9,GHe=.8,$He=.17,kw=.1,Mw=.999,qHe=.9999,KHe=.99,YHe=/[\\\/_+.#"@\[\(\{&]/,QHe=/[\\\/_+.#"@\[\(\{&]/g,XHe=/[\s-]/,fte=/[\s-]/g;function OE(e,t,n,r,s,o,a){if(o===t.length)return s===e.length?KI:KHe;var i=`${s},${o}`;if(a[i]!==void 0)return a[i];for(var c=r.charAt(o),u=n.indexOf(c,s),f=0,m,p,h,g;u>=0;)m=OE(e,t,n,r,u+1,o+1,a),m>f&&(u===s?m*=KI:YHe.test(e.charAt(u-1))?(m*=GHe,h=e.slice(s,u-1).match(QHe),h&&s>0&&(m*=Math.pow(Mw,h.length))):XHe.test(e.charAt(u-1))?(m*=WHe,g=e.slice(s,u-1).match(fte),g&&s>0&&(m*=Math.pow(Mw,g.length))):(m*=$He,s>0&&(m*=Math.pow(Mw,u-s))),e.charAt(u)!==t.charAt(o)&&(m*=qHe)),(mm&&(m=p*kw)),m>f&&(f=m),u=n.indexOf(c,u+1);return a[i]=f,f}function YI(e){return e.toLowerCase().replace(fte," ")}function ZHe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,OE(e,t,YI(e),YI(t),0,0,{})}var jm='[cmdk-group=""]',Tw='[cmdk-group-items=""]',JHe='[cmdk-group-heading=""]',mte='[cmdk-item=""]',QI=`${mte}:not([aria-disabled="true"])`,LE="cmdk-item-select",Yu="data-value",eze=(e,t,n)=>ZHe(e,t,n),pte=d.createContext(void 0),Pg=()=>d.useContext(pte),hte=d.createContext(void 0),U6=()=>d.useContext(hte),gte=d.createContext(void 0),yte=d.forwardRef((e,t)=>{let n=Qu(()=>{var G,H;return{search:"",value:(H=(G=e.value)!=null?G:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Qu(()=>new Set),s=Qu(()=>new Map),o=Qu(()=>new Map),a=Qu(()=>new Set),i=xte(e),{label:c,children:u,value:f,onValueChange:m,filter:p,shouldFilter:h,loop:g,disablePointerSelection:y=!1,vimBindings:x=!0,...v}=e,b=ls(),_=ls(),w=ls(),S=d.useRef(null),C=dze();Jc(()=>{if(f!==void 0){let G=f.trim();n.current.value=G,E.emit()}},[f]),Jc(()=>{C(6,D)},[]);let E=d.useMemo(()=>({subscribe:G=>(a.current.add(G),()=>a.current.delete(G)),snapshot:()=>n.current,setState:(G,H,Q)=>{var Y,te,se,ae;if(!Object.is(n.current[G],H)){if(n.current[G]=H,G==="search")N(),I(),C(1,M);else if(G==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(w);X?X.focus():(Y=document.getElementById(b))==null||Y.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=j())==null?void 0:X.id,E.emit()}),Q||C(5,D),((te=i.current)==null?void 0:te.value)!==void 0){let X=H??"";(ae=(se=i.current).onValueChange)==null||ae.call(se,X);return}}E.emit()}},emit:()=>{a.current.forEach(G=>G())}}),[]),T=d.useMemo(()=>({value:(G,H,Q)=>{var Y;H!==((Y=o.current.get(G))==null?void 0:Y.value)&&(o.current.set(G,{value:H,keywords:Q}),n.current.filtered.items.set(G,k(H,Q)),C(2,()=>{I(),E.emit()}))},item:(G,H)=>(r.current.add(G),H&&(s.current.has(H)?s.current.get(H).add(G):s.current.set(H,new Set([G]))),C(3,()=>{N(),I(),n.current.value||M(),E.emit()}),()=>{o.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let Q=j();C(4,()=>{N(),Q?.getAttribute("id")===G&&M(),E.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{o.current.delete(G),s.current.delete(G)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:b,inputId:w,labelId:_,listInnerRef:S}),[]);function k(G,H){var Q,Y;let te=(Y=(Q=i.current)==null?void 0:Q.filter)!=null?Y:eze;return G?te(G,n.current.search,H):0}function I(){if(!n.current.search||i.current.shouldFilter===!1)return;let G=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(Y=>{let te=s.current.get(Y),se=0;te.forEach(ae=>{let X=G.get(ae);se=Math.max(X,se)}),H.push([Y,se])});let Q=S.current;F().sort((Y,te)=>{var se,ae;let X=Y.getAttribute("id"),ee=te.getAttribute("id");return((se=G.get(ee))!=null?se:0)-((ae=G.get(X))!=null?ae:0)}).forEach(Y=>{let te=Y.closest(Tw);te?te.appendChild(Y.parentElement===te?Y:Y.closest(`${Tw} > *`)):Q.appendChild(Y.parentElement===Q?Y:Y.closest(`${Tw} > *`))}),H.sort((Y,te)=>te[1]-Y[1]).forEach(Y=>{var te;let se=(te=S.current)==null?void 0:te.querySelector(`${jm}[${Yu}="${encodeURIComponent(Y[0])}"]`);se?.parentElement.appendChild(se)})}function M(){let G=F().find(Q=>Q.getAttribute("aria-disabled")!=="true"),H=G?.getAttribute(Yu);E.setState("value",H||void 0)}function N(){var G,H,Q,Y;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let se of r.current){let ae=(H=(G=o.current.get(se))==null?void 0:G.value)!=null?H:"",X=(Y=(Q=o.current.get(se))==null?void 0:Q.keywords)!=null?Y:[],ee=k(ae,X);n.current.filtered.items.set(se,ee),ee>0&&te++}for(let[se,ae]of s.current)for(let X of ae)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(se);break}n.current.filtered.count=te}function D(){var G,H,Q;let Y=j();Y&&(((G=Y.parentElement)==null?void 0:G.firstChild)===Y&&((Q=(H=Y.closest(jm))==null?void 0:H.querySelector(JHe))==null||Q.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function j(){var G;return(G=S.current)==null?void 0:G.querySelector(`${mte}[aria-selected="true"]`)}function F(){var G;return Array.from(((G=S.current)==null?void 0:G.querySelectorAll(QI))||[])}function R(G){let H=F()[G];H&&E.setState("value",H.getAttribute(Yu))}function P(G){var H;let Q=j(),Y=F(),te=Y.findIndex(ae=>ae===Q),se=Y[te+G];(H=i.current)!=null&&H.loop&&(se=te+G<0?Y[Y.length-1]:te+G===Y.length?Y[0]:Y[te+G]),se&&E.setState("value",se.getAttribute(Yu))}function L(G){let H=j(),Q=H?.closest(jm),Y;for(;Q&&!Y;)Q=G>0?cze(Q,jm):uze(Q,jm),Y=Q?.querySelector(QI);Y?E.setState("value",Y.getAttribute(Yu)):P(G)}let U=()=>R(F().length-1),O=G=>{G.preventDefault(),G.metaKey?U():G.altKey?L(1):P(1)},$=G=>{G.preventDefault(),G.metaKey?R(0):G.altKey?L(-1):P(-1)};return d.createElement(Et.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:G=>{var H;(H=v.onKeyDown)==null||H.call(v,G);let Q=G.nativeEvent.isComposing||G.keyCode===229;if(!(G.defaultPrevented||Q))switch(G.key){case"n":case"j":{x&&G.ctrlKey&&O(G);break}case"ArrowDown":{O(G);break}case"p":case"k":{x&&G.ctrlKey&&$(G);break}case"ArrowUp":{$(G);break}case"Home":{G.preventDefault(),R(0);break}case"End":{G.preventDefault(),U();break}case"Enter":{G.preventDefault();let Y=j();if(Y){let te=new Event(LE);Y.dispatchEvent(te)}}}}},d.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:mze},c),Yv(e,G=>d.createElement(hte.Provider,{value:E},d.createElement(pte.Provider,{value:T},G))))}),tze=d.forwardRef((e,t)=>{var n,r;let s=ls(),o=d.useRef(null),a=d.useContext(gte),i=Pg(),c=xte(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Jc(()=>{if(!u)return i.item(s,a?.id)},[u]);let f=vte(s,o,[e.value,e.children,o],e.keywords),m=U6(),p=Hl(C=>C.value&&C.value===f.current),h=Hl(C=>u||i.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);d.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(LE,g),()=>C.removeEventListener(LE,g)},[h,e.onSelect,e.disabled]);function g(){var C,E;y(),(E=(C=c.current).onSelect)==null||E.call(C,f.current)}function y(){m.setState("value",f.current,!0)}if(!h)return null;let{disabled:x,value:v,onSelect:b,forceMount:_,keywords:w,...S}=e;return d.createElement(Et.div,{ref:zc(o,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!p,"data-disabled":!!x,"data-selected":!!p,onPointerMove:x||i.getDisablePointerSelection()?void 0:y,onClick:x?void 0:g},e.children)}),nze=d.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,a=ls(),i=d.useRef(null),c=d.useRef(null),u=ls(),f=Pg(),m=Hl(h=>s||f.filter()===!1?!0:h.search?h.filtered.groups.has(a):!0);Jc(()=>f.group(a),[]),vte(a,i,[e.value,e.heading,c]);let p=d.useMemo(()=>({id:a,forceMount:s}),[s]);return d.createElement(Et.div,{ref:zc(i,t),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&d.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Yv(e,h=>d.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},d.createElement(gte.Provider,{value:p},h))))}),rze=d.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=d.useRef(null),o=Hl(a=>!a.search);return!n&&!o?null:d.createElement(Et.div,{ref:zc(s,t),...r,"cmdk-separator":"",role:"separator"})}),sze=d.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=U6(),a=Hl(u=>u.search),i=Hl(u=>u.selectedItemId),c=Pg();return d.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),d.createElement(Et.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":i,id:c.inputId,type:"text",value:s?e.value:a,onChange:u=>{s||o.setState("search",u.target.value),n?.(u.target.value)}})}),oze=d.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=d.useRef(null),a=d.useRef(null),i=Hl(u=>u.selectedItemId),c=Pg();return d.useEffect(()=>{if(a.current&&o.current){let u=a.current,f=o.current,m,p=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let h=u.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(m),p.unobserve(u)}}},[]),d.createElement(Et.div,{ref:zc(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":r,id:c.listId},Yv(e,u=>d.createElement("div",{ref:zc(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),aze=d.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:a,...i}=e;return d.createElement(wT,{open:n,onOpenChange:r},d.createElement(CT,{container:a},d.createElement(ST,{"cmdk-overlay":"",className:s}),d.createElement(ET,{"aria-label":e.label,"cmdk-dialog":"",className:o},d.createElement(yte,{ref:t,...i}))))}),ize=d.forwardRef((e,t)=>Hl(n=>n.filtered.count===0)?d.createElement(Et.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),lze=d.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return d.createElement(Et.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Yv(e,a=>d.createElement("div",{"aria-hidden":!0},a)))}),Og=Object.assign(yte,{List:oze,Item:tze,Input:sze,Group:nze,Separator:rze,Dialog:aze,Empty:ize,Loading:lze});function cze(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function uze(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function xte(e){let t=d.useRef(e);return Jc(()=>{t.current=e}),t}var Jc=typeof window>"u"?d.useEffect:d.useLayoutEffect;function Qu(e){let t=d.useRef();return t.current===void 0&&(t.current=e()),t}function Hl(e){let t=U6(),n=()=>e(t.snapshot());return d.useSyncExternalStore(t.subscribe,n,n)}function vte(e,t,n,r=[]){let s=d.useRef(),o=Pg();return Jc(()=>{var a;let i=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());o.value(e,i,c),(a=t.current)==null||a.setAttribute(Yu,i),s.current=i}),s}var dze=()=>{let[e,t]=d.useState(),n=Qu(()=>new Map);return Jc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function fze(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Yv({asChild:e,children:t},n){return e&&d.isValidElement(t)?d.cloneElement(fze(t),{ref:t.ref},n(t.props.children)):n(t)}var mze={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const bte={xs:12,sm:14,md:16,lg:20},pze={xs:"[&_input]:pr-sm [&_input]:pl-7",sm:"[&_input]:pr-sm [&_input]:pl-[30px]",md:"[&_input]:pr-sm [&_input]:pl-8",lg:"[&_input]:pr-sm [&_input]:pl-9"};function _te({options:e,value:t,onValueChange:n,placement:r="bottom-start",keepDraftValue:s=!1}){const[o,a]=d.useState(!1),[i,c]=d.useState(void 0),[u,f]=d.useState(!1),m=d.useRef(null),p=i===void 0,{refs:h,floatingStyles:g}=nY({open:o,placement:r,strategy:"fixed",middleware:[dM(4),UU({padding:8,fallbackAxisSideDirection:"start"}),BU({padding:8}),VU({padding:8,apply({availableHeight:k,rects:I,elements:M}){M.floating.style.maxHeight=`${Math.min(k,300)}px`,M.floating.style.width=`${I.reference.width}px`}})],whileElementsMounted:HU}),y=d.useCallback(()=>{const k=e.find(I=>I.value===t);return k?k.label:""},[t,e]),x=d.useCallback(()=>{a(!1),s||c(void 0),m.current?.blur()},[s]);d.useEffect(()=>{if(!o)return;const k=I=>{const M=h.reference.current,N=h.floating.current,D=I.target,j=M&&"contains"in M&&!M.contains(D),F=N&&"contains"in N&&!N.contains(D);j&&F&&x()};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[o,h,x]);const v=d.useCallback(k=>{c(k),k===""&&n?.(""),o||a(!0)},[o,n]),b=d.useCallback(()=>{a(!0),f(!0),s||(c(void 0),queueMicrotask(()=>{m.current?.select()}))},[s]),_=d.useCallback(k=>{f(!1)},[]),w=d.useCallback(k=>{n?.(k),c(void 0),a(!1),m.current?.blur()},[n]),S=y(),C=d.useMemo(()=>u?i===void 0?S:i:i??S,[u,S,i]),E=d.useMemo(()=>({...g,position:g.position,zIndex:50}),[g]),T=d.useMemo(()=>({width:"100%"}),[]);return d.useMemo(()=>({isOpen:o,draft:i,isPristine:p,isFocused:u,displayValue:C,inputRef:m,refs:h,listWrapperStyles:T,floatingListStyles:E,onInputChange:v,onFocus:b,onBlur:_,onSelect:w}),[o,i,p,u,C,m,h,T,E,v,b,_,w])}const wte=d.memo(function({children:t,loop:n=!0,filter:r,shouldFilter:s=!0}){return l.jsx(Og,{loop:n,filter:r,shouldFilter:s,children:t})}),FE=d.memo(function({value:t,onValueChange:n,onFocus:r,onBlur:s,onPaste:o,onKeyDown:a,placeholder:i,size:c="md",colorVariant:u="default",noRounded:f=!1,disabled:m,autoFocus:p,ref:h,horizontalSpacing:g,verticalSpacing:y}){const x={subtle:"bg-subtle",default:"bg-base dark:bg-subtler",borderless:"bg-transparent focus:!ring-0!border-0 !bg-transparent !px-0 focus:!ring-0 !border-0"},v={xs:"text-xs placeholder:text-xs",sm:"text-sm placeholder:text-sm",md:"text-sm placeholder:text-sm",lg:"text-lg placeholder:text-base"},b={none:"",xs:"px-xs",sm:"px-sm",md:"px-md",lg:"px-lg",xl:"px-xl"},_={none:"",xs:"py-xs",sm:"py-sm",md:"py-md",lg:"py-lg",xl:"py-xl"},w={xs:"sm",sm:"sm",md:"md",lg:"xl"},S={xs:"xs",sm:"sm",md:"sm",lg:"lg"},C=b[g??w[c]],E=_[y??S[c]];return l.jsx(Og.Input,{ref:h,value:t,onValueChange:n,onFocus:r,onBlur:s,onPaste:o,onKeyDown:a,placeholder:i,disabled:m,autoFocus:p,className:z("focus:ring-subtler w-full font-sans outline-none focus:outline-none","text-foreground caret-super selection:bg-super/50","border-subtler placeholder-quieter border focus:ring-1","transition-all duration-200",!f&&"rounded-lg",x[u],v[c],C,E,m&&"cursor-not-allowed opacity-50")})}),hze=d.memo(function({icon:t,size:n=16}){return l.jsx("div",{className:z("pointer-events-none left-2 top-1/2 -translate-y-1/2","absolute"),children:l.jsx(ut,{name:t,size:n,className:"text-quieter"})})}),Cte=d.memo(function({children:t,style:n}){return l.jsx(Og.List,{className:z("z-50","max-h-[300px] overflow-y-auto","border-subtler shadow-overlay rounded-xl border","bg-base p-xs","flex flex-col gap-px"),style:n,children:t})}),Ste=d.memo(function({value:t,onSelect:n,selected:r,disabled:s,children:o,size:a="md",ref:i}){const c={xs:"text-xs py-1 px-xs",sm:"text-sm py-1 px-sm",md:"text-sm py-1.5 px-sm",lg:"text-base py-2 px-md"};return l.jsx(Og.Item,{value:t,onSelect:n,disabled:s,ref:i,className:z("relative select-none rounded-lg transition-all duration-300",c[a],{"hover:bg-subtler cursor-pointer":!s,"cursor-not-allowed":s,"aria-selected:bg-subtler":!0},s&&"opacity-50"),children:l.jsx("span",{className:z({"text-super":r}),children:o})})}),Ete=d.memo(function({children:t,size:n="md"}){const r={xs:"text-xs py-2",sm:"text-sm py-2.5",md:"text-sm py-3",lg:"text-base py-3.5"};return l.jsx(Og.Empty,{className:z("text-quieter text-center",r[n]),children:t})}),gze=d.memo(function({option:t,value:n,disabled:r,size:s="md",onSelect:o}){const a=d.useCallback(()=>{o(t.value)},[o,t.value]),i=t.icon;return l.jsx(Ste,{value:t.label,onSelect:a,selected:n===t.value,disabled:r,size:s,children:i?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ut,{name:i,size:bte[s]}),l.jsx("span",{children:t.label})]}):t.label})}),t_t=d.memo(function({options:t,placeholder:n,value:r,onValueChange:s,filter:o,emptyMessage:a,placement:i="bottom-start",referenceRef:c,keepDraftValue:u=!1,size:f="md",colorVariant:m="default",noRounded:p=!1,horizontalSpacing:h,verticalSpacing:g,disabled:y=!1,autoFocus:x=!1}){const v=_te({options:t,value:r,onValueChange:s,placement:i,keepDraftValue:u}),{isOpen:b,displayValue:_,inputRef:w,refs:S,onInputChange:C,onFocus:E,onSelect:T,listWrapperStyles:k,floatingListStyles:I}=v,N=d.useMemo(()=>t.find(j=>j.value===r),[t,r])?.icon;d.useEffect(()=>{c?.current&&v.refs.setReference(c.current)},[c,v.refs]);const D=d.useCallback(j=>{c||v.refs.setReference(j)},[c,v.refs]);return l.jsx("div",{ref:D,className:"relative",children:l.jsxs(wte,{filter:o,shouldFilter:!v.isFocused||!v.isPristine||(v.draft?.length??0)>0,children:[N?l.jsxs("div",{className:"relative",children:[l.jsx(hze,{icon:N,size:bte[f]}),l.jsx("div",{className:pze[f],children:l.jsx(FE,{ref:w,value:_,onValueChange:C,onFocus:E,onBlur:v.onBlur,placeholder:n,size:f,horizontalSpacing:"none",verticalSpacing:g,colorVariant:m,noRounded:p,disabled:y,autoFocus:x})})]}):l.jsx(FE,{ref:w,value:_,onValueChange:C,onFocus:E,onBlur:v.onBlur,placeholder:n,size:f,horizontalSpacing:h,verticalSpacing:g,colorVariant:m,noRounded:p,disabled:y,autoFocus:x}),b&&l.jsx("div",{ref:S.setFloating,style:I,children:l.jsxs(Cte,{style:k,children:[l.jsx(Ete,{size:f,children:a}),t.map(j=>l.jsx(gze,{option:j,value:r,disabled:y,size:f,onSelect:T},j.value))]})})]})})});function yze(e,t=!0){const n=d.useRef(null);return d.useEffect(()=>{if(!t)return;const r=s=>{n.current&&!n.current.contains(s.target)&&e()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t,e]),n}const xze=async(e,t)=>{if(!t){await BE(e);return}try{const n=new Blob([t],{type:"text/html"}),r=new Blob([e],{type:"text/plain"});await navigator.clipboard.write([new ClipboardItem({"text/html":n,"text/plain":r})])}catch{await BE(e)}},BE=async e=>{try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}},kte=A.memo(({chip:e,selected:t,disabled:n,onDelete:r,onClick:s})=>{const o=d.useCallback(()=>{r(e.value)},[r,e.value]),a=d.useCallback(i=>{s(e.value,i)},[s,e.value]);return l.jsx(dte,{label:e.label,selected:t,title:e.value,onDelete:o,onClick:a,disabled:n,shouldAvoidFocusShift:!0})});kte.displayName="ChipItem";function vze({option:e,draft:t,onSelect:n,renderSuggestion:r}){const s=d.useCallback(()=>{n(e.value)},[n,e.value]);return l.jsx(Ste,{value:e.value,onSelect:s,selected:t===e.value,children:r?.(e.item)})}function bze({suggestions:e,draft:t,onSelect:n,renderSuggestion:r,referenceElement:s,onValueChange:o}){const a=e?.map(c=>({value:c.value,label:c.key}))||[],i=_te({options:a,value:t,onValueChange:o});return d.useEffect(()=>{s&&i.refs.setReference(s)},[s,i.refs]),l.jsx(d8e,{children:l.jsx("div",{ref:i.refs.setFloating,style:i.floatingListStyles,children:l.jsxs(Cte,{style:i.listWrapperStyles,children:[l.jsx(Ete,{children:"No results found"}),e.map(c=>l.jsx(vze,{option:c,draft:t,onSelect:n,renderSuggestion:r},c.key))]})})})}function _ze({chips:e,limit:t=1/0,onAdd:n,onDelete:r,validator:s,placeholder:o,disabled:a=!1,testId:i,children:c,className:u,placeholderOnFocusOnly:f=!1,onDraftChange:m,suggestions:p,renderSuggestion:h}){const[g,y]=d.useState(""),[x,v]=d.useState(!1),[b,_]=d.useState([]),w=d.useRef(null),S=yze(()=>{_([])}),C=d.useCallback(R=>{y(R),m?.(R)},[m]),E=d.useCallback(R=>{const P=(R??g).trim();if(P===""||e.find(U=>U.value===P))return!1;if(s){const U=s(P);if(typeof U=="string"||!U)return!1}const L=p?.find(U=>U.value===P);return y(""),n([P],L?[L.item]:void 0),!0},[g,n,e,s,p]);d.useEffect(()=>{b.length>0&&S.current&&S.current.focus()},[b,S]);const T=d.useCallback(R=>{if((R.metaKey||R.ctrlKey)&&R.key==="a"&&g){R.stopPropagation();return}if(R.key==="Enter"||R.key==="Tab"||R.key===" "||R.key===","||R.key===";"){if(!E())return;R.preventDefault(),v(!0);return}if(R.key==="Escape"){y(""),v(!1);return}if(R.key==="Backspace"){if(b.length>0)return;if(!g&&!b.length){R.stopPropagation(),R.preventDefault();const P=e[e.length-1];P&&_([P.value]),v(!1)}return}if((R.key==="ArrowLeft"||R.key==="ArrowRight")&&!g){if(R.preventDefault(),R.stopPropagation(),R.key==="ArrowLeft"&&e.length>0){const P=e[e.length-1];P&&(_([P.value]),v(!1))}return}},[E,b,g,e]),k=d.useCallback(R=>{r([R]),_(P=>P.filter(L=>L!==R)),v(!0)},[r]),I=d.useCallback((R,P)=>{_(L=>{const U=P.shiftKey,O=P.metaKey,$=P.ctrlKey;return O||$?L.includes(R)?L.filter(G=>G!==R):[...L,R]:U?L.includes(R)?L:[...L,R]:L.includes(R)?L.filter(G=>G!==R):[R]})},[]),M=d.useCallback(()=>{g.trim()!==""&&!E()||v(!1)},[g,E]),N=d.useCallback(()=>{BE(b.join(","))},[b]),D=d.useCallback(R=>{const{metaKey:P,ctrlKey:L,key:U}=R;if((P||L)&&U==="a"){if(x&&g)return;R.preventDefault(),_(e.map(O=>O.value)),x&&v(!1);return}if((P||L)&&U==="c"&&b.length>0){R.preventDefault(),N();return}if((P||L)&&U==="x"&&b.length>0){R.preventDefault(),N();const O=[...b];_([]),r(O),v(!0);return}if(U==="Backspace"&&b.length>0&&!g){R.preventDefault();const O=[...b];_([]),r(O),v(!0);return}if(U==="ArrowLeft"||U==="ArrowRight"){if(document.activeElement===w.current?.element())return;R.preventDefault();const $=U==="ArrowLeft",G=U==="ArrowRight",H=Q=>{const Y=e[Q];Y&&_([Y.value])};if(b.length===0)e.length>0&&H($?e.length-1:0);else{const Q=b.map(Y=>e.findIndex(te=>te.value===Y)).filter(Y=>Y!==-1).sort((Y,te)=>Y-te);if(Q.length>0){const Y=$?Q[0]:Q[Q.length-1];if(Y!==void 0)if(G&&Y===e.length-1)_([]),v(!0);else{const te=$?Math.max(0,Y-1):Math.min(e.length-1,Y+1);H(te)}}}return}},[b,r,e,x,g,N]),j=d.useCallback(R=>{const L=R.clipboardData.getData("text").split(/[,;\n\t]+/).map(U=>U.trim()).filter(Boolean);if(L.length>1){const U=[],O=[];if(L.forEach($=>{if(s){if(s($)===!0){U.push($);const H=p?.find(Q=>Q.value===$);H&&O.push(H.item)}}else{U.push($);const G=p?.find(H=>H.value===$);G&&O.push(G.item)}}),U.length>0)R.preventDefault(),R.stopPropagation(),n(U,O.length>0?O:void 0);else return}},[s,n,p]),F=d.useCallback(R=>{E(R)||y(""),queueMicrotask(()=>{w.current?.focus()})},[E]);return l.jsxs("div",{ref:S,tabIndex:0,className:z("flex min-h-10 w-full flex-row flex-wrap items-center gap-1 py-2 focus:outline-none",u),"data-test-id":i,onKeyDown:D,onPointerDown:R=>{x&&R.target===S.current&&R.preventDefault()},onClick:R=>{x||(R.stopPropagation(),R.preventDefault(),!a&&e.lengthl.jsx(kte,{chip:R,selected:b.includes(R.value),disabled:a,onDelete:k,onClick:I},R.value)),!a&&e.length0&&g.trim()&&l.jsx(bze,{suggestions:p,draft:g,onSelect:F,renderSuggestion:h,referenceElement:S.current,onValueChange:C})]})}),c]})}const V6=A.memo(_ze);V6.displayName="ChipInput";function wze(e){const t=e.display_name?.trim(),n=e.email;return t||n}function Cze(e){if(!e?.solution?.name)return"none";const t=e.solution.name.toLowerCase();return t.includes("zoom")?oa.ZOOM:t.includes("teams")?oa.MICROSOFT_TEAMS:t.includes("meet")||t.includes("google")?oa.GOOGLE_MEET:"none"}function Sze(e){return e.filter(t=>t.email).map(t=>({label:wze(t),value:t.email}))}const UE=d.memo(({event:e,newEvent:t,onEventChange:n,isEditable:r=!0,truncateAttendees:s,noWrapper:o=!1,action:a})=>{const{$t:i}=J(),[c,u]=d.useState({event_id:e.event_id,title:e.title,start_date_time:e.start_date_time,end_date_time:e.end_date_time,attendees:e.attendees?.map(j=>({email:j.email,optional:j.optional,display_name:j.display_name,photo_url:j.photo_url})),organizer:e.organizer,description:e.description,location:e.location,link:e.link,calendar_color:e.calendar_color,event_color:e.event_color,conference_data:e.conference_data,creator:e.creator,html_description:e.html_description,is_all_day:e.is_all_day,recurrence:e.recurrence?.map(j=>j.toString())}),f=d.useRef(null),{suggestions:m,handleDraftChange:p}=Aee({reason:"calendar_event"}),{connectors:h}=Ea({reason:"calendar-event-video-conferencing"}),g=d.useMemo(()=>{const j=h?.connectors??[];return{hasGoogleMeet:j.some(F=>F.connection_type===Zn.GCAL&&F.connected),hasZoom:j.some(F=>F.connection_type===Zn.ZOOM&&F.connected),hasTeams:j.some(F=>F.connection_type===Zn.OUTLOOK&&F.connected)}},[h?.connectors]);d.useEffect(()=>{n?.(c)},[c,n]);const y=d.useCallback(j=>{j&&u(F=>({...F,start_date_time:j.toISOString()}))},[]),x=d.useCallback(j=>{j&&u(F=>({...F,end_date_time:j.toISOString()}))},[]),v=d.useCallback(j=>{u(F=>{const R=new Date(F.start_date_time||""),[P,L]=j.split(":").map(Number);return P===void 0||L===void 0||(R.setHours(P),R.setMinutes(L),isNaN(R.getTime()))?F:{...F,start_date_time:R.toISOString()}})},[]),b=d.useCallback(j=>{u(F=>{const R=new Date(F.end_date_time||""),[P,L]=j.split(":").map(Number);return P===void 0||L===void 0||(R.setHours(P),R.setMinutes(L),isNaN(R.getTime()))?F:{...F,end_date_time:R.toISOString()}})},[]),_=({action:j,email:F,newEmail:R,displayName:P,photoUrl:L})=>{u(U=>{const O=[...U.attendees||[]];switch(j){case"add":O.some($=>$.email===F)||O.push({email:F,display_name:P,photo_url:L});break;case"delete":return{...U,attendees:O.filter($=>$.email!==F)};case"edit":return{...U,attendees:O.map($=>$.email===F?{...$,email:R}:$)}}return{...U,attendees:O}})},w=Nee(e?.calendar_color?.background??"#AC725E"),S=Ree(w),C=d.useCallback(j=>u(F=>({...F,title:j})),[]),E=d.useCallback((j,F)=>{const R=tme(F,"email");j.forEach(P=>{const L=R[P];_({action:"add",email:P,displayName:L?.name,photoUrl:L?.image||void 0})})},[]),T=d.useCallback(j=>{j.forEach(F=>_({action:"delete",email:F}))},[]),k=d.useCallback(j=>u(F=>({...F,location:j})),[]),I=d.useCallback(j=>{u(F=>({...F,recurrence:j}))},[]),M=d.useCallback(j=>{let F;j===oa.GOOGLE_MEET?F={entry_points:[],solution:{name:"Google Meet",key_type:"hangoutsMeet"}}:j===oa.ZOOM?F={entry_points:[],solution:{name:"Zoom",key_type:"zoom"}}:j===oa.MICROSOFT_TEAMS?F={entry_points:[],solution:{name:"Microsoft Teams",key_type:"teams"}}:F=void 0,u(R=>({...R,conference_data:F}))},[]),N=d.useCallback(j=>l.jsx(Tee,{contact:j}),[]),D=d.useMemo(()=>{const j=[];return g.hasGoogleMeet&&j.push({label:i({defaultMessage:"Google Meet",id:"crZ+Bimh7N"}),value:oa.GOOGLE_MEET}),g.hasZoom&&j.push({label:i({defaultMessage:"Zoom",id:"yMbKjuDH/n"}),value:oa.ZOOM}),g.hasTeams&&j.push({label:i({defaultMessage:"Microsoft Teams",id:"IIfj4GddO3"}),value:oa.MICROSOFT_TEAMS}),j.push({label:i({defaultMessage:"No video conferencing",id:"PYY40S2Jrm"}),value:"none"}),j},[i,g]);if(!r){const{title:j}=e;if((!e.attendees||e.attendees.length==0)&&!e.start_date_time&&!e.end_date_time&&!e.title)return null;const F=l.jsxs("div",{className:"gap-md relative flex",children:[l.jsx("div",{className:z("inset-y-xs absolute left-0 w-1 shrink-0 self-stretch rounded-full",{"brightness-[0.8]":S==="Fail"}),style:{backgroundColor:w}}),l.jsxs("div",{className:"gap-md flex flex-col pl-5",children:[l.jsx(Vl,{oldText:j,newText:t?.title??void 0,isDeletion:a==="DELETE"}),l.jsx(Hee,{event:e,newEvent:t,action:a,truncateAttendees:s})]})]});return o?l.jsx("div",{className:"p-md relative overflow-hidden",children:F}):l.jsx(dr,{fullBleed:!0,className:"p-md relative overflow-hidden",roundedClass:"rounded-md",children:F})}return l.jsxs(dr,{fullBleed:!0,className:"relative flex flex-col gap-4 overflow-hidden px-8 py-2",roundedClass:"rounded-md",fullBleedBorderClassname:"border-none",children:[l.jsx("div",{className:"shrink-none left-xs absolute bottom-2 top-2 w-1.5 self-stretch rounded-full"+(S==="Fail"?" brightness-[0.8]":""),style:{backgroundColor:w}}),l.jsx(co,{size:"md",type:"text",value:c.title||"",onChange:C,className:"border-subtler text-foreground w-full rounded-none rounded-t-md border-x-0 border-b border-t-0 pb-2 pl-0 pr-4 font-medium shadow-none focus:!outline-none focus:!ring-0",placeholder:i({defaultMessage:"Add title",id:"k09nVJqic1"}),isMobileUserAgent:!1}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Xs,{icon:B("clock"),alignCenter:!0,iconSize:"sm",children:l.jsx(cte,{startDateTime:c.start_date_time,endDateTime:c.end_date_time,onStartDateChange:y,onEndDateChange:x,onStartTimeChange:v,onEndTimeChange:b})}),l.jsx(Xs,{icon:B("calendar-repeat"),iconSize:"sm",children:l.jsx(ute,{value:c.recurrence||[],onChange:I})}),l.jsx(Xs,{icon:B("user"),iconSize:"sm",alignCenter:!0,children:l.jsx("div",{className:z("border-subtler text-foreground focus-within:border-super w-full rounded-lg border px-2",{"!px-3":!c.attendees?.length}),children:l.jsx(V6,{chips:Sze(c.attendees??[]),onAdd:E,onDelete:T,validator:BBe,placeholder:i({defaultMessage:"Add guests",id:"pP5ifNp+MS"}),suggestions:m,renderSuggestion:N,onDraftChange:p})})}),l.jsx(Xs,{icon:B("map-pin"),iconSize:"sm",alignCenter:!0,children:l.jsx(co,{type:"text",value:c.location||"",onChange:k,placeholder:i({defaultMessage:"Add rooms or location",id:"bb7ELr4Sk+"}),className:"focus:!border-super rounded-lg !px-3 focus:!ring-transparent",isMobileUserAgent:!1})}),l.jsx(Xs,{icon:B("video"),iconSize:"sm",alignCenter:!0,children:l.jsx(A2,{id:"video-conferencing-select",activeKey:Cze(c.conference_data),options:D,onOptionChange:M,extraCSS:"rounded-lg pl-3 [&+div]:right-3"})}),l.jsx(Xs,{icon:B("align-left"),iconSize:"sm",children:l.jsx(TA,{wrapperClass:"bg-transparent focus-within:!border-super rounded-md px-3 py-2 text-sm focus-within:!ring-transparent",inputRef:f,isMobileUserAgent:!1,children:l.jsx(AA,{value:c.description||"",onChange:j=>u(F=>({...F,description:j})),placeholder:i({defaultMessage:"Add a description",id:"bocXKEDBwm"}),minRows:4,isMobileStyle:!1,isMobileUserAgent:!1,ref:f})})})]})]})});UE.displayName="CalendarEventLarge";var dd;(function(e){e.CREATED="CREATED",e.UPDATED="UPDATED",e.DELETED="DELETED",e.REJECTED="REJECTED"})(dd||(dd={}));const Mte=A.memo(({operation:e,isShowEditableComponentsEnabled:t,buttonVariant:n,buttonText:r,onConfirm:s,onSkip:o})=>{const{$t:a}=J(),[i,c]=d.useState();d.useEffect(()=>{c(void 0)},[e]);const u=d.useMemo(()=>{if(e?.update){const y=e.update.event,x=e.update.new_event;return y&&x?{...y,...Object.fromEntries(Object.entries(x).filter(([b,_])=>_!==null))}:x||y}return e?.add?.event||e?.delete?.event},[e]),f=d.useCallback(y=>{c(y)},[]),m=d.useCallback(y=>[{...e,...y&&{...e.add&&{add:{event:y}},...e.update&&{update:{event:y}},...e.delete&&{delete:{event:y,delete_scope:e.delete?.delete_scope}}},status:y.status.toUpperCase()}],[e]),p=d.useCallback((y,x)=>{const v=x||{...i||u,status:y};return{confirmed:!0,operations:v?m(v):[]}},[i,u,m]),h=d.useCallback(()=>{let y=dd.CREATED;e.update?y=dd.UPDATED:e.delete&&(y=dd.DELETED),s(p(y))},[p,s,e]),g=d.useCallback(()=>{o(p(dd.REJECTED))},[p,o]);return l.jsxs(l.Fragment,{children:[u&&e.delete&&l.jsx(K,{className:"px-sm mb-sm",children:l.jsx(UE,{event:u,newEvent:e.update?.new_event,isEditable:!1})}),u&&!e.delete&&l.jsx(K,{className:"px-md py-sm",children:l.jsx(UE,{event:u,newEvent:e.update?.new_event,onEventChange:f,isEditable:t})}),l.jsx("form",{onSubmit:y=>{y.preventDefault(),h()},children:l.jsx(K,{className:"px-md py-sm gap-4 border-t pt-4",children:l.jsx("div",{className:"gap-sm flex items-center justify-between",children:l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(Ge,{size:"small",variant:n,text:r,type:"submit"}),l.jsx(st,{size:"small",text:a({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:g})]})})})})]})});Mte.displayName="CalendarOperationItem";function Eze(){const{value:e}=Rx({flag:"show-editable-calendar-components",defaultValue:!1});return e}const kze=({result:e,isDeleteOperation:t})=>{const{$t:n}=J();return e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),size:14,className:"shrink-0 text-[#16a34a]",title:"Confirmed"}),l.jsx("span",{className:"text-xs font-medium leading-none text-[#16a34a]",children:n(t?{defaultMessage:"Deleted",id:"KQvWvDRI1B"}:{defaultMessage:"Accepted",id:"aFyFm0PsCy"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:n({defaultMessage:"Skipped",id:"djZCU5enGS"})})]}):null},Tte=A.memo(({calendarOperations:e,sendStepResult:t,isFinished:n})=>{const r="calendar-operation-step",[s,o]=d.useState(n??!1),{$t:a}=J(),i=Eze(),[c,u]=d.useState(0),[f,m]=d.useState(()=>Array(e.length).fill(null)),p=d.useRef(!1),h=d.useMemo(()=>e[c],[e,c]),g=d.useMemo(()=>h?.delete?.event?"rejected":"inverted",[h?.delete?.event]),y=d.useMemo(()=>h?h.delete?.event?a({defaultMessage:"Delete",id:"K3r6DQW7h+"}):a({defaultMessage:"Schedule",id:"hGQqkWwmJD"}):a({defaultMessage:"Schedule",id:"hGQqkWwmJD"}),[h,a]),x=e.length>1,v=d.useMemo(()=>({position:"absolute",bottom:16,right:16,zIndex:10}),[]),b=d.useCallback(()=>{u(C=>Math.max(C-1,0))},[]),_=d.useCallback(()=>{u(C=>Math.min(C+1,e.length-1))},[e.length]),w=d.useCallback(C=>{m(E=>{const T=[...E];T[c]=C;const k=T.findIndex(M=>M===null);if(T.every(M=>M!==null)&&!p.current){p.current=!0;const M=T.map(N=>N?.operations).filter(N=>Array.isArray(N)).flat();M.length>0?t({confirmed:!0,operations:M},r,!1):t({confirmed:!1},r,!1),o(!0)}else k!==-1&&u(k);return T})},[c,t,r]),S=d.useCallback(C=>{w(C)},[w]);return s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:a({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):h?l.jsxs(K,{variant:"raised",className:"py-sm relative rounded-lg border",children:[l.jsx(Mte,{operation:JSON.parse(JSON.stringify(h)),isShowEditableComponentsEnabled:i,buttonVariant:g,buttonText:y,onConfirm:w,onSkip:S},`operation-${c}`),x&&l.jsxs(K,{style:v,className:"flex items-center gap-4",children:[l.jsx(kze,{result:f[c]??null,isDeleteOperation:!!h?.delete?.event}),l.jsxs("span",{className:"text-xs font-medium",children:[l.jsx("span",{className:"text-foreground",children:c+1}),l.jsxs("span",{children:[" of ",e.length]})]}),l.jsxs(K,{className:"flex gap-2",children:[l.jsx(kee,{disabled:c===0,onClick:b}),l.jsx(Mee,{disabled:c===e.length-1,onClick:_})]})]})]}):l.jsx(K,{variant:"raised",className:"py-sm relative rounded-lg border",children:l.jsx("div",{className:"p-4 text-center",children:a({defaultMessage:"No calendar operation available",id:"Hm6yv1Uz2P"})})})});Tte.displayName="CalendarOperationStep";const Im=.03,Mze=3,Zf=A.memo(({items:e,initialDisplayCount:t=Mze,stepDelay:n=Im,isFinished:r=!1,vertical:s=!1,truncate:o=!0,onCountChange:a})=>{const[i,c]=d.useState([]),[u,f]=d.useState(!1),m=d.useRef(null),p=d.useRef(!0),h=d.useRef(r),g=d.useRef(0);d.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),d.useEffect(()=>{if(a){const C=o&&(n!==Im?r&&i.length{const w=o?t:e.length;if(p.current)if(p.current=!1,e.length>0)if(r){const C=Math.min(w,e.length);c(e.slice(0,C)),g.current=C}else c([e[0]]),g.current=1;else c([]),g.current=0;if(u){c(e),g.current=e.length;return}if(r&&!h.current&&(m.current&&(clearTimeout(m.current),m.current=null),c(()=>{const C=Math.min(w,e.length),E=e.slice(0,C);return g.current=E.length,E})),h.current=r,m.current&&(clearTimeout(m.current),m.current=null),g.current>=w||g.current>=e.length)return;const S=()=>{let C=0;if(c(E=>E.length0){const C=r?Im:n;m.current=setTimeout(S,C*1e3)}else e.length>0&&(c([e[0]]),g.current=1)},[e,t,n,r,u,o]);const y={initial:{opacity:0,x:-3},animate:{opacity:1,x:0}},x=()=>{f(!0)},b=o&&(n!==Im?r&&i.length{w.stopPropagation(),x()},[]);return l.jsxs("div",{className:`flex items-center ${s?"flex-col items-start gap-px":"gap-sm flex-wrap"}`,children:[i.map((w,S)=>l.jsx(Te.div,{className:s?"w-full":"inline-flex",variants:y,initial:"initial",animate:"animate",transition:{duration:.1,ease:Kd},children:w},S)),b&&l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs cursor-pointer rounded-lg px-2.5",onClick:_,children:l.jsx(V,{variant:"tinyMono",className:"!text-[0.68rem]",children:l.jsx(je,{defaultMessage:"+{count} more",id:"/zFGgPmQSV",values:{count:e.length-i.length}})})})]})});Zf.displayName="ResultsRenderer";const gs=A.memo(({queries:e,icon:t=B("search"),stepDelay:n,isFinished:r,initialDisplayCount:s=12,enableQueryLinks:o=!1})=>{const a=e.map((i,c)=>l.jsx(Rr,{icon:t,text:i,url:o?`/search/new?q=${encodeURIComponent(i)}`:void 0},c));return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(Zf,{items:a,initialDisplayCount:s,stepDelay:n,isFinished:r})})});gs.displayName="SearchWebStep";const Ate=A.memo(({operations:e})=>{const{$t:t,formatMessage:n}=J(),r=d.useMemo(()=>{const a={created:0,updated:0,deleted:0,rejected:0};return e.forEach(i=>{switch(i.status?.toUpperCase()){case"CREATED":a.created++;break;case"UPDATED":a.updated++;break;case"DELETED":a.deleted++;break;case"REJECTED":a.rejected++;break}}),a},[e]),s=d.useMemo(()=>{const a=[];return r.created>0&&a.push({count:r.created,label:t({defaultMessage:"Created",id:"ORGv1Q6rL/"})}),r.updated>0&&a.push({count:r.updated,label:t({defaultMessage:"Updated",id:"xrk6zgu9jU"})}),r.deleted>0&&a.push({count:r.deleted,label:t({defaultMessage:"Deleted",id:"KQvWvDRI1B"})}),r.rejected>0&&a.push({count:r.rejected,label:t({defaultMessage:"Rejected",id:"5qaD7sDVxu"})}),a},[r,t]),o=d.useMemo(()=>s.length===0?[]:[s.map(a=>n({defaultMessage:"{count} {status}",id:"e6QlErEcyz"},{count:a.count,status:a.label})).join(", ")],[s,n]);return o.length===0?null:l.jsx(gs,{icon:B("calendar"),queries:o})});Ate.displayName="CalendarStatusSummary";const Tze=()=>l.jsxs(K,{variant:Wx.subtler,className:"p-sm gap-sm flex h-[52px] w-fit min-w-[200px] items-center rounded-lg",children:[l.jsx(K,{variant:"subtler",className:"aspect-square h-full rounded-md"}),l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(K,{variant:"subtler",className:"h-1.5 w-24 rounded-full"}),l.jsx(K,{variant:"subtler",className:"h-1.5 w-16 rounded-full"})]})]}),Nte=A.memo(({assetTypes:e,assetTypeLabels:t,isFinished:n})=>{const{$t:r}=J();if(e.length===0)return l.jsxs("div",{className:"my-sm gap-sm flex flex-col",children:[l.jsx(V,{variant:"tinyRegular",color:n?"light":"super",className:"flex items-center gap-1",children:l.jsx(br,{variant:"super",active:!n,as:"span",speed:"slow",children:r({defaultMessage:"Creating an asset",id:"/gKNbCoSJB"})})}),l.jsx(Tze,{})]});const s=e[e.length-1],o=s?t[s]||s.toLowerCase():r({defaultMessage:"an asset",id:"+rur3MSgJV"});return l.jsx(St,{mode:"wait",children:l.jsx(Te.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:[.4,0,.2,1]},children:l.jsx(V,{variant:"tinyRegular",color:n?"light":"super",className:"flex items-center gap-1 py-1.5",children:l.jsx(br,{variant:"super",active:!n,as:"span",speed:"slow",children:r({defaultMessage:"Creating {assetLabel}",id:"irVMYqmEjR"},{assetLabel:o})})})},s)})});Nte.displayName="CanvasAgentStep";const Rte=A.memo(({step:e})=>{const t=e.content.clarification;return t?l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsx(Rr,{icon:B("message-plus"),text:t})}):null});Rte.displayName="ClarificationStep";var Ln="-ms-",Pp="-moz-",mn="-webkit-",Dte="comm",Qv="rule",H6="decl",Aze="@import",jte="@keyframes",Nze="@layer",Ite=Math.abs,z6=String.fromCharCode,VE=Object.assign;function Rze(e,t){return Dr(e,0)^45?(((t<<2^Dr(e,0))<<2^Dr(e,1))<<2^Dr(e,2))<<2^Dr(e,3):0}function Pte(e){return e.trim()}function ki(e,t){return(e=t.exec(e))?e[0]:e}function Vt(e,t,n){return e.replace(t,n)}function xy(e,t,n){return e.indexOf(t,n)}function Dr(e,t){return e.charCodeAt(t)|0}function tf(e,t,n){return e.slice(t,n)}function Ba(e){return e.length}function Ote(e){return e.length}function rp(e,t){return t.push(e),e}function Dze(e,t){return e.map(t).join("")}function XI(e,t){return e.filter(function(n){return!ki(n,t)})}var Xv=1,nf=1,Lte=0,Lo=0,vr=0,Jf="";function Zv(e,t,n,r,s,o,a,i){return{value:e,root:t,parent:n,type:r,props:s,children:o,line:Xv,column:nf,length:a,return:"",siblings:i}}function ml(e,t){return VE(Zv("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Bu(e){for(;e.root;)e=ml(e.root,{children:[e]});rp(e,e.siblings)}function jze(){return vr}function Ize(){return vr=Lo>0?Dr(Jf,--Lo):0,nf--,vr===10&&(nf=1,Xv--),vr}function ma(){return vr=Lo2||HE(vr)>3?"":" "}function Fze(e,t){for(;--t&&ma()&&!(vr<48||vr>102||vr>57&&vr<65||vr>70&&vr<97););return Jv(e,vy()+(t<6&&Lc()==32&&ma()==32))}function zE(e){for(;ma();)switch(vr){case e:return Lo;case 34:case 39:e!==34&&e!==39&&zE(vr);break;case 40:e===41&&zE(e);break;case 92:ma();break}return Lo}function Bze(e,t){for(;ma()&&e+vr!==57;)if(e+vr===84&&Lc()===47)break;return"/*"+Jv(t,Lo-1)+"*"+z6(e===47?e:ma())}function Uze(e){for(;!HE(Lc());)ma();return Jv(e,Lo)}function Vze(e){return Oze(by("",null,null,null,[""],e=Pze(e),0,[0],e))}function by(e,t,n,r,s,o,a,i,c){for(var u=0,f=0,m=a,p=0,h=0,g=0,y=1,x=1,v=1,b=0,_="",w=s,S=o,C=r,E=_;x;)switch(g=b,b=ma()){case 40:if(g!=108&&Dr(E,m-1)==58){xy(E+=Vt(Aw(b),"&","&\f"),"&\f",Ite(u?i[u-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:E+=Aw(b);break;case 9:case 10:case 13:case 32:E+=Lze(g);break;case 92:E+=Fze(vy()-1,7);continue;case 47:switch(Lc()){case 42:case 47:rp(Hze(Bze(ma(),vy()),t,n,c),c);break;default:E+="/"}break;case 123*y:i[u++]=Ba(E)*v;case 125*y:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+f:v==-1&&(E=Vt(E,/\f/g,"")),h>0&&Ba(E)-m&&rp(h>32?JI(E+";",r,n,m-1,c):JI(Vt(E," ","")+";",r,n,m-2,c),c);break;case 59:E+=";";default:if(rp(C=ZI(E,t,n,u,f,s,i,_,w=[],S=[],m,o),o),b===123)if(f===0)by(E,t,C,C,w,o,m,i,S);else switch(p===99&&Dr(E,3)===110?100:p){case 100:case 108:case 109:case 115:by(e,C,C,r&&rp(ZI(e,C,C,0,0,s,i,_,s,w=[],m,S),S),s,S,m,i,r?w:S);break;default:by(E,C,C,C,[""],S,0,i,S)}}u=f=h=0,y=v=1,_=E="",m=a;break;case 58:m=1+Ba(E),h=g;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&Ize()==125)continue}switch(E+=z6(b),b*y){case 38:v=f>0?1:(E+="\f",-1);break;case 44:i[u++]=(Ba(E)-1)*v,v=1;break;case 64:Lc()===45&&(E+=Aw(ma())),p=Lc(),f=m=Ba(_=E+=Uze(vy())),b++;break;case 45:g===45&&Ba(E)==2&&(y=0)}}return o}function ZI(e,t,n,r,s,o,a,i,c,u,f,m){for(var p=s-1,h=s===0?o:[""],g=Ote(h),y=0,x=0,v=0;y0?h[b]+" "+_:Vt(_,/&\f/g,h[b])))&&(c[v++]=w);return Zv(e,t,n,s===0?Qv:i,c,u,f,m)}function Hze(e,t,n,r){return Zv(e,t,n,Dte,z6(jze()),tf(e,2,-2),0,r)}function JI(e,t,n,r,s){return Zv(e,t,n,H6,tf(e,0,r),tf(e,r+1,-1),r,s)}function Fte(e,t,n){switch(Rze(e,t)){case 5103:return mn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return mn+e+e;case 4789:return Pp+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return mn+e+Pp+e+Ln+e+e;case 5936:switch(Dr(e,t+11)){case 114:return mn+e+Ln+Vt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return mn+e+Ln+Vt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return mn+e+Ln+Vt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return mn+e+Ln+e+e;case 6165:return mn+e+Ln+"flex-"+e+e;case 5187:return mn+e+Vt(e,/(\w+).+(:[^]+)/,mn+"box-$1$2"+Ln+"flex-$1$2")+e;case 5443:return mn+e+Ln+"flex-item-"+Vt(e,/flex-|-self/g,"")+(ki(e,/flex-|baseline/)?"":Ln+"grid-row-"+Vt(e,/flex-|-self/g,""))+e;case 4675:return mn+e+Ln+"flex-line-pack"+Vt(e,/align-content|flex-|-self/g,"")+e;case 5548:return mn+e+Ln+Vt(e,"shrink","negative")+e;case 5292:return mn+e+Ln+Vt(e,"basis","preferred-size")+e;case 6060:return mn+"box-"+Vt(e,"-grow","")+mn+e+Ln+Vt(e,"grow","positive")+e;case 4554:return mn+Vt(e,/([^-])(transform)/g,"$1"+mn+"$2")+e;case 6187:return Vt(Vt(Vt(e,/(zoom-|grab)/,mn+"$1"),/(image-set)/,mn+"$1"),e,"")+e;case 5495:case 3959:return Vt(e,/(image-set\([^]*)/,mn+"$1$`$1");case 4968:return Vt(Vt(e,/(.+:)(flex-)?(.*)/,mn+"box-pack:$3"+Ln+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+mn+e+e;case 4200:if(!ki(e,/flex-|baseline/))return Ln+"grid-column-align"+tf(e,t)+e;break;case 2592:case 3360:return Ln+Vt(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,s){return t=s,ki(r.props,/grid-\w+-end/)})?~xy(e+(n=n[t].value),"span",0)?e:Ln+Vt(e,"-start","")+e+Ln+"grid-row-span:"+(~xy(n,"span",0)?ki(n,/\d+/):+ki(n,/\d+/)-+ki(e,/\d+/))+";":Ln+Vt(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ki(r.props,/grid-\w+-start/)})?e:Ln+Vt(Vt(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Vt(e,/(.+)-inline(.+)/,mn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ba(e)-1-t>6)switch(Dr(e,t+1)){case 109:if(Dr(e,t+4)!==45)break;case 102:return Vt(e,/(.+:)(.+)-([^]+)/,"$1"+mn+"$2-$3$1"+Pp+(Dr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~xy(e,"stretch",0)?Fte(Vt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Vt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,s,o,a,i,c,u){return Ln+s+":"+o+u+(a?Ln+s+"-span:"+(i?c:+c-+o)+u:"")+e});case 4949:if(Dr(e,t+6)===121)return Vt(e,":",":"+mn)+e;break;case 6444:switch(Dr(e,Dr(e,14)===45?18:11)){case 120:return Vt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+mn+(Dr(e,14)===45?"inline-":"")+"box$3$1"+mn+"$2$3$1"+Ln+"$2box$3")+e;case 100:return Vt(e,":",":"+Ln)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Vt(e,"scroll-","scroll-snap-")+e}return e}function N2(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case H6:e.return=Fte(e.value,e.length,n);return;case jte:return N2([ml(e,{value:Vt(e.value,"@","@"+mn)})],r);case Qv:if(e.length)return Dze(n=e.props,function(s){switch(ki(s,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Bu(ml(e,{props:[Vt(s,/:(read-\w+)/,":"+Pp+"$1")]})),Bu(ml(e,{props:[s]})),VE(e,{props:XI(n,r)});break;case"::placeholder":Bu(ml(e,{props:[Vt(s,/:(plac\w+)/,":"+mn+"input-$1")]})),Bu(ml(e,{props:[Vt(s,/:(plac\w+)/,":"+Pp+"$1")]})),Bu(ml(e,{props:[Vt(s,/:(plac\w+)/,Ln+"input-$1")]})),Bu(ml(e,{props:[s]})),VE(e,{props:XI(n,r)});break}return""})}}var qze={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ys={},rf=typeof process<"u"&&Ys!==void 0&&(Ys.REACT_APP_SC_ATTR||Ys.SC_ATTR)||"data-styled",Bte="active",Ute="data-styled-version",eb="6.1.15",W6=`/*!sc*/ -`,R2=typeof window<"u"&&"HTMLElement"in window,Kze=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Ys!==void 0&&Ys.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Ys.REACT_APP_SC_DISABLE_SPEEDY!==""?Ys.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Ys.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Ys!==void 0&&Ys.SC_DISABLE_SPEEDY!==void 0&&Ys.SC_DISABLE_SPEEDY!==""&&Ys.SC_DISABLE_SPEEDY!=="false"&&Ys.SC_DISABLE_SPEEDY),tb=Object.freeze([]),sf=Object.freeze({});function Vte(e,t,n){return n===void 0&&(n=sf),e.theme!==n.theme&&e.theme||t||n.theme}var Hte=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Yze=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Qze=/(^-|-$)/g;function eP(e){return e.replace(Yze,"-").replace(Qze,"")}var Xze=/(a)(d)/gi,n1=52,tP=function(e){return String.fromCharCode(e+(e>25?39:97))};function WE(e){var t,n="";for(t=Math.abs(e);t>n1;t=t/n1|0)n=tP(t%n1)+n;return(tP(t%n1)+n).replace(Xze,"$1-$2")}var Nw,zte=5381,fd=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Wte=function(e){return fd(zte,e)};function Zze(e){return WE(Wte(e)>>>0)}function Gte(e){return e.displayName||e.name||"Component"}function Rw(e){return typeof e=="string"&&!0}var $te=typeof Symbol=="function"&&Symbol.for,qte=$te?Symbol.for("react.memo"):60115,Jze=$te?Symbol.for("react.forward_ref"):60112,eWe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},tWe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Kte={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nWe=((Nw={})[Jze]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Nw[qte]=Kte,Nw);function nP(e){return("type"in(t=e)&&t.type.$$typeof)===qte?Kte:"$$typeof"in e?nWe[e.$$typeof]:eWe;var t}var rWe=Object.defineProperty,sWe=Object.getOwnPropertyNames,rP=Object.getOwnPropertySymbols,oWe=Object.getOwnPropertyDescriptor,aWe=Object.getPrototypeOf,sP=Object.prototype;function G6(e,t,n){if(typeof t!="string"){if(sP){var r=aWe(t);r&&r!==sP&&G6(e,r,n)}var s=sWe(t);rP&&(s=s.concat(rP(t)));for(var o=nP(e),a=nP(t),i=0;i0?" Args: ".concat(t.join(", ")):""))}var iWe=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,s=r.length,o=s;t>=o;)if((o<<=1)<0)throw Lg(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=s;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],s=this.indexOfGroup(t),o=s+r,a=s;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(x+="".concat(v,","))}),c+="".concat(g).concat(y,'{content:"').concat(x,'"}').concat(W6)},f=0;f0?".".concat(t):p},f=c.slice();f.push(function(p){p.type===Qv&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(xWe,n).replace(r,u))}),a.prefix&&f.push($ze),f.push(zze);var m=function(p,h,g,y){h===void 0&&(h=""),g===void 0&&(g=""),y===void 0&&(y="&"),t=y,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var x=p.replace(vWe,""),v=Vze(g||h?"".concat(g," ").concat(h," { ").concat(x," }"):x);a.namespace&&(v=Xte(v,a.namespace));var b=[];return N2(v,Wze(f.concat(Gze(function(_){return b.push(_)})))),b};return m.hash=c.length?c.reduce(function(p,h){return h.name||Lg(15),fd(p,h.name)},zte).toString():"",m}var _We=new Qte,$E=bWe(),Zte=A.createContext({shouldForwardProp:void 0,styleSheet:_We,stylis:$E});Zte.Consumer;A.createContext(void 0);function lP(){return d.useContext(Zte)}var wWe=(function(){function e(t,n){var r=this;this.inject=function(s,o){o===void 0&&(o=$E);var a=r.name+o.hash;s.hasNameForId(r.id,a)||s.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,q6(this,function(){throw Lg(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=$E),this.name+t.hash},e})(),CWe=function(e){return e>="A"&&e<="Z"};function cP(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,i)}s=Nc(s,a),this.staticRulesId=a}else{for(var c=fd(this.baseHash,r.hash),u="",f=0;f>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(u,".".concat(h),void 0,this.componentId)),s=Nc(s,h)}}return s},e})(),K6=A.createContext(void 0);K6.Consumer;var Dw={};function MWe(e,t,n){var r=$6(e),s=e,o=!Rw(e),a=t.attrs,i=a===void 0?tb:a,c=t.componentId,u=c===void 0?(function(w,S){var C=typeof w!="string"?"sc":eP(w);Dw[C]=(Dw[C]||0)+1;var E="".concat(C,"-").concat(Zze(eb+C+Dw[C]));return S?"".concat(S,"-").concat(E):E})(t.displayName,t.parentComponentId):c,f=t.displayName,m=f===void 0?(function(w){return Rw(w)?"styled.".concat(w):"Styled(".concat(Gte(w),")")})(e):f,p=t.displayName&&t.componentId?"".concat(eP(t.displayName),"-").concat(t.componentId):t.componentId||u,h=r&&s.attrs?s.attrs.concat(i).filter(Boolean):i,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var y=s.shouldForwardProp;if(t.shouldForwardProp){var x=t.shouldForwardProp;g=function(w,S){return y(w,S)&&x(w,S)}}else g=y}var v=new kWe(n,p,r?s.componentStyle:void 0);function b(w,S){return(function(C,E,T){var k=C.attrs,I=C.componentStyle,M=C.defaultProps,N=C.foldedComponentIds,D=C.styledComponentId,j=C.target,F=A.useContext(K6),R=lP(),P=C.shouldForwardProp||R.shouldForwardProp,L=Vte(E,F,M)||sf,U=(function(Y,te,se){for(var ae,X=no(no({},te),{className:void 0,theme:se}),ee=0;eee.length)&&(t=e.length);for(var n=0,r=Array(t);n=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var jw={};function LWe(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return jw[t]||(jw[t]=OWe(e)),jw[t]}function FWe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter(function(o){return o!=="token"}),s=LWe(r);return s.reduce(function(o,a){return md(md({},o),n[a])},t)}function mP(e){return e.join(" ")}function BWe(e,t){var n=0;return function(r){return n+=1,r.map(function(s,o){return rne({node:s,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})})}}function rne(e){var t=e.node,n=e.stylesheet,r=e.style,s=r===void 0?{}:r,o=e.useInlineStyles,a=e.key,i=t.properties,c=t.type,u=t.tagName,f=t.value;if(c==="text")return f;if(u){var m=BWe(n,o),p;if(!o)p=md(md({},i),{},{className:mP(i.className)});else{var h=Object.keys(n).reduce(function(v,b){return b.split(".").forEach(function(_){v.includes(_)||v.push(_)}),v},[]),g=i.className&&i.className.includes("token")?["token"]:[],y=i.className&&g.concat(i.className.filter(function(v){return!h.includes(v)}));p=md(md({},i),{},{className:mP(y)||void 0,style:FWe(i.className,Object.assign({},i.style,s),n)})}var x=m(t.children);return A.createElement(u,ph({key:a},p),x)}}const UWe=(function(e,t){var n=e.listLanguages();return n.indexOf(t)!==-1});var VWe=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function pP(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 Sl(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r2&&arguments[2]!==void 0?arguments[2]:[];return Cy({children:S,lineNumber:C,lineNumberStyle:i,largestLineNumber:a,showInlineLineNumbers:s,lineProps:n,className:E,showLineNumbers:r,wrapLongLines:c,wrapLines:t})}function y(S,C){if(r&&C&&s){var E=one(i,C,a);S.unshift(sne(C,E))}return S}function x(S,C){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||E.length>0?g(S,C,E):y(S,C)}for(var v=function(){var C=f[h],E=C.children[0].value,T=zWe(E);if(T){var k=E.split(` -`);k.forEach(function(I,M){var N=r&&m.length+o,D={type:"text",value:"".concat(I,` -`)};if(M===0){var j=f.slice(p+1,h).concat(Cy({children:[D],className:C.properties.className})),F=x(j,N);m.push(F)}else if(M===k.length-1){var R=f[h+1]&&f[h+1].children&&f[h+1].children[0],P={type:"text",value:"".concat(I)};if(R){var L=Cy({children:[P],className:C.properties.className});f.splice(h+1,0,L)}else{var U=[P],O=x(U,N,C.properties.className);m.push(O)}}else{var $=[D],G=x($,N,C.properties.className);m.push(G)}}),p=h}h++};h=0;--O){var $=this.tryEntries[O],G=$.completion;if($.tryLoc==="root")return U("end");if($.tryLoc<=this.prev){var H=r.call($,"catchLoc"),Q=r.call($,"finallyLoc");if(H&&Q){if(this.prev<$.catchLoc)return U($.catchLoc,!0);if(this.prev<$.finallyLoc)return U($.finallyLoc)}else if(H){if(this.prev<$.catchLoc)return U($.catchLoc,!0)}else{if(!Q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return U($.finallyLoc)}}}},abrupt:function(P,L){for(var U=this.tryEntries.length-1;U>=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev=0;--L){var U=this.tryEntries[L];if(U.finallyLoc===P)return this.complete(U.completion,U.afterLoc),D(U),x}},catch:function(P){for(var L=this.tryEntries.length-1;L>=0;--L){var U=this.tryEntries[L];if(U.tryLoc===P){var O=U.completion;if(O.type==="throw"){var $=O.arg;D(U)}return $}}throw Error("illegal catch attempt")},delegateYield:function(P,L,U){return this.delegate={iterator:F(P),resultName:L,nextLoc:U},this.method==="next"&&(this.arg=e),x}},t}function nGe(e,t,n){return t=j2(t),eGe(e,cne()?Reflect.construct(t,n||[],j2(e).constructor):t.apply(e,n))}function cne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cne=function(){return!!e})()}const rGe=(function(e){var t,n=e.loader,r=e.isLanguageRegistered,s=e.registerLanguage,o=e.languageLoaders,a=e.noAsyncLoadingLanguages,i=(function(c){function u(){return XWe(this,u),nGe(this,u,arguments)}return tGe(u,c),ZWe(u,[{key:"componentDidUpdate",value:function(){!u.isRegistered(this.props.language)&&o&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var m=this;u.astGeneratorPromise||u.loadAstGenerator(),u.astGenerator||u.astGeneratorPromise.then(function(){m.forceUpdate()}),!u.isRegistered(this.props.language)&&o&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var m=this,p=this.props.language;p!=="text"&&u.loadLanguage(p).then(function(){return m.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(m){return u.isSupportedLanguage(m)?m:"text"}},{key:"render",value:function(){return A.createElement(u.highlightInstance,ph({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:u.astGenerator}))}}],[{key:"preload",value:function(){return u.loadAstGenerator()}},{key:"loadLanguage",value:(function(){var f=lne(XE().mark(function p(h){var g;return XE().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(g=o[h],typeof g!="function"){x.next=5;break}return x.abrupt("return",g(u.registerLanguage));case 5:throw new Error("Language ".concat(h," not supported"));case 6:case"end":return x.stop()}},p)}));function m(p){return f.apply(this,arguments)}return m})()},{key:"isSupportedLanguage",value:function(m){return u.isRegistered(m)||typeof o[m]=="function"}},{key:"loadAstGenerator",value:function(){return u.astGeneratorPromise=n().then(function(m){u.astGenerator=m,s&&u.languages.forEach(function(p,h){return s(m,h,p)})}),u.astGeneratorPromise}}])})(A.PureComponent);return t=i,Mi(i,"astGenerator",null),Mi(i,"highlightInstance",QWe(null,{})),Mi(i,"astGeneratorPromise",null),Mi(i,"languages",new Map),Mi(i,"supportedLanguages",e.supportedLanguages||Object.keys(o||{})),Mi(i,"isRegistered",function(c){if(a)return!0;if(!s)throw new Error("Current syntax highlighter doesn't support registration of languages");return t.astGenerator?r(t.astGenerator,c):t.languages.has(c)}),Mi(i,"registerLanguage",function(c,u){if(!s)throw new Error("Current syntax highlighter doesn't support registration of languages");if(t.astGenerator)return s(t.astGenerator,c,u);t.languages.set(c,u)}),i});function ZE(){ZE=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(R,P,L){R[P]=L.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(R,P,L){return Object.defineProperty(R,P,{value:L,enumerable:!0,configurable:!0,writable:!0}),R[P]}try{u({},"")}catch{u=function(L,U,O){return L[U]=O}}function f(R,P,L,U){var O=P&&P.prototype instanceof v?P:v,$=Object.create(O.prototype),G=new j(U||[]);return s($,"_invoke",{value:I(R,L,G)}),$}function m(R,P,L){try{return{type:"normal",arg:R.call(P,L)}}catch(U){return{type:"throw",arg:U}}}t.wrap=f;var p="suspendedStart",h="suspendedYield",g="executing",y="completed",x={};function v(){}function b(){}function _(){}var w={};u(w,a,function(){return this});var S=Object.getPrototypeOf,C=S&&S(S(F([])));C&&C!==n&&r.call(C,a)&&(w=C);var E=_.prototype=v.prototype=Object.create(w);function T(R){["next","throw","return"].forEach(function(P){u(R,P,function(L){return this._invoke(P,L)})})}function k(R,P){function L(O,$,G,H){var Q=m(R[O],R,$);if(Q.type!=="throw"){var Y=Q.arg,te=Y.value;return te&&oi(te)=="object"&&r.call(te,"__await")?P.resolve(te.__await).then(function(se){L("next",se,G,H)},function(se){L("throw",se,G,H)}):P.resolve(te).then(function(se){Y.value=se,G(Y)},function(se){return L("throw",se,G,H)})}H(Q.arg)}var U;s(this,"_invoke",{value:function($,G){function H(){return new P(function(Q,Y){L($,G,Q,Y)})}return U=U?U.then(H,H):H()}})}function I(R,P,L){var U=p;return function(O,$){if(U===g)throw Error("Generator is already running");if(U===y){if(O==="throw")throw $;return{value:e,done:!0}}for(L.method=O,L.arg=$;;){var G=L.delegate;if(G){var H=M(G,L);if(H){if(H===x)continue;return H}}if(L.method==="next")L.sent=L._sent=L.arg;else if(L.method==="throw"){if(U===p)throw U=y,L.arg;L.dispatchException(L.arg)}else L.method==="return"&&L.abrupt("return",L.arg);U=g;var Q=m(R,P,L);if(Q.type==="normal"){if(U=L.done?y:h,Q.arg===x)continue;return{value:Q.arg,done:L.done}}Q.type==="throw"&&(U=y,L.method="throw",L.arg=Q.arg)}}}function M(R,P){var L=P.method,U=R.iterator[L];if(U===e)return P.delegate=null,L==="throw"&&R.iterator.return&&(P.method="return",P.arg=e,M(R,P),P.method==="throw")||L!=="return"&&(P.method="throw",P.arg=new TypeError("The iterator does not provide a '"+L+"' method")),x;var O=m(U,R.iterator,P.arg);if(O.type==="throw")return P.method="throw",P.arg=O.arg,P.delegate=null,x;var $=O.arg;return $?$.done?(P[R.resultName]=$.value,P.next=R.nextLoc,P.method!=="return"&&(P.method="next",P.arg=e),P.delegate=null,x):$:(P.method="throw",P.arg=new TypeError("iterator result is not an object"),P.delegate=null,x)}function N(R){var P={tryLoc:R[0]};1 in R&&(P.catchLoc=R[1]),2 in R&&(P.finallyLoc=R[2],P.afterLoc=R[3]),this.tryEntries.push(P)}function D(R){var P=R.completion||{};P.type="normal",delete P.arg,R.completion=P}function j(R){this.tryEntries=[{tryLoc:"root"}],R.forEach(N,this),this.reset(!0)}function F(R){if(R||R===""){var P=R[a];if(P)return P.call(R);if(typeof R.next=="function")return R;if(!isNaN(R.length)){var L=-1,U=function O(){for(;++L=0;--O){var $=this.tryEntries[O],G=$.completion;if($.tryLoc==="root")return U("end");if($.tryLoc<=this.prev){var H=r.call($,"catchLoc"),Q=r.call($,"finallyLoc");if(H&&Q){if(this.prev<$.catchLoc)return U($.catchLoc,!0);if(this.prev<$.finallyLoc)return U($.finallyLoc)}else if(H){if(this.prev<$.catchLoc)return U($.catchLoc,!0)}else{if(!Q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return U($.finallyLoc)}}}},abrupt:function(P,L){for(var U=this.tryEntries.length-1;U>=0;--U){var O=this.tryEntries[U];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev=0;--L){var U=this.tryEntries[L];if(U.finallyLoc===P)return this.complete(U.completion,U.afterLoc),D(U),x}},catch:function(P){for(var L=this.tryEntries.length-1;L>=0;--L){var U=this.tryEntries[L];if(U.tryLoc===P){var O=U.completion;if(O.type==="throw"){var $=O.arg;D(U)}return $}}throw Error("illegal catch attempt")},delegateYield:function(P,L,U){return this.delegate={iterator:F(P),resultName:L,nextLoc:U},this.method==="next"&&(this.arg=e),x}},t}const ne=(function(e,t){return(function(){var n=lne(ZE().mark(function r(s){var o;return ZE().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,t();case 2:o=i.sent,s(e,o.default||o);case 4:case"end":return i.stop()}},r)}));return function(r){return n.apply(this,arguments)}})()}),sGe={abap:ne("abap",function(){return q(()=>import("./abap-BiKYM7nu.js").then(e=>e.a),__vite__mapDeps([154,1]))}),abnf:ne("abnf",function(){return q(()=>import("./abnf-8KHBl4SU.js").then(e=>e.a),__vite__mapDeps([155,1]))}),actionscript:ne("actionscript",function(){return q(()=>import("./actionscript-BDfgnI_2.js").then(e=>e.a),__vite__mapDeps([156,1]))}),ada:ne("ada",function(){return q(()=>import("./ada-pT0wE1jT.js").then(e=>e.a),__vite__mapDeps([157,1]))}),agda:ne("agda",function(){return q(()=>import("./agda-BVgYyS_B.js").then(e=>e.a),__vite__mapDeps([158,1]))}),al:ne("al",function(){return q(()=>import("./al-DYI_knPF.js").then(e=>e.a),__vite__mapDeps([159,1]))}),antlr4:ne("antlr4",function(){return q(()=>import("./antlr4-Dcs8y6-e.js").then(e=>e.a),__vite__mapDeps([160,1]))}),apacheconf:ne("apacheconf",function(){return q(()=>import("./apacheconf-BeuGc_UW.js").then(e=>e.a),__vite__mapDeps([161,1]))}),apex:ne("apex",function(){return q(()=>import("./apex-C46QKnqF.js").then(e=>e.a),__vite__mapDeps([162,1,163]))}),apl:ne("apl",function(){return q(()=>import("./apl-D3CFL3-O.js").then(e=>e.a),__vite__mapDeps([164,1]))}),applescript:ne("applescript",function(){return q(()=>import("./applescript-UKM8t7IT.js").then(e=>e.a),__vite__mapDeps([165,1]))}),aql:ne("aql",function(){return q(()=>import("./aql-JdJXKSA1.js").then(e=>e.a),__vite__mapDeps([166,1]))}),arduino:ne("arduino",function(){return q(()=>import("./arduino-Cgk25tM9.js").then(e=>e.a),__vite__mapDeps([167,1,168,169]))}),arff:ne("arff",function(){return q(()=>import("./arff-BvtRHTjx.js").then(e=>e.a),__vite__mapDeps([170,1]))}),asciidoc:ne("asciidoc",function(){return q(()=>import("./asciidoc-hH46k-cj.js").then(e=>e.a),__vite__mapDeps([171,1]))}),asm6502:ne("asm6502",function(){return q(()=>import("./asm6502-Ce01JAP9.js").then(e=>e.a),__vite__mapDeps([172,1]))}),asmatmel:ne("asmatmel",function(){return q(()=>import("./asmatmel-73kokPNV.js").then(e=>e.a),__vite__mapDeps([173,1]))}),aspnet:ne("aspnet",function(){return q(()=>import("./aspnet-DSiaQID1.js").then(e=>e.a),__vite__mapDeps([174,1,175]))}),autohotkey:ne("autohotkey",function(){return q(()=>import("./autohotkey-B_uQtKf0.js").then(e=>e.a),__vite__mapDeps([176,1]))}),autoit:ne("autoit",function(){return q(()=>import("./autoit-EdcKUAIu.js").then(e=>e.a),__vite__mapDeps([177,1]))}),avisynth:ne("avisynth",function(){return q(()=>import("./avisynth-B5LB8Vdx.js").then(e=>e.a),__vite__mapDeps([178,1]))}),avroIdl:ne("avroIdl",function(){return q(()=>import("./avro-idl-DFr56LZ2.js").then(e=>e.a),__vite__mapDeps([179,1]))}),bash:ne("bash",function(){return q(()=>import("./bash-DmK8JH5Y.js").then(e=>e.b),__vite__mapDeps([180,1,181]))}),basic:ne("basic",function(){return q(()=>import("./basic-GQNZVm0I.js").then(e=>e.b),__vite__mapDeps([182,1,183]))}),batch:ne("batch",function(){return q(()=>import("./batch-q5qLUxNp.js").then(e=>e.b),__vite__mapDeps([184,1]))}),bbcode:ne("bbcode",function(){return q(()=>import("./bbcode-DIQpPCpQ.js").then(e=>e.b),__vite__mapDeps([185,1]))}),bicep:ne("bicep",function(){return q(()=>import("./bicep-43qgYCRB.js").then(e=>e.b),__vite__mapDeps([186,1]))}),birb:ne("birb",function(){return q(()=>import("./birb-WL4Wzs1I.js").then(e=>e.b),__vite__mapDeps([187,1]))}),bison:ne("bison",function(){return q(()=>import("./bison-DgNGY4MZ.js").then(e=>e.b),__vite__mapDeps([188,1,169]))}),bnf:ne("bnf",function(){return q(()=>import("./bnf-CwU415oh.js").then(e=>e.b),__vite__mapDeps([189,1]))}),brainfuck:ne("brainfuck",function(){return q(()=>import("./brainfuck-BRUtMqwa.js").then(e=>e.b),__vite__mapDeps([190,1]))}),brightscript:ne("brightscript",function(){return q(()=>import("./brightscript-CvEhDk7S.js").then(e=>e.b),__vite__mapDeps([191,1]))}),bro:ne("bro",function(){return q(()=>import("./bro-CqltG-l9.js").then(e=>e.b),__vite__mapDeps([192,1]))}),bsl:ne("bsl",function(){return q(()=>import("./bsl-DUqbypHr.js").then(e=>e.b),__vite__mapDeps([193,1]))}),c:ne("c",function(){return q(()=>import("./c-N_EB2bYK.js").then(e=>e.c),__vite__mapDeps([194,1,169]))}),cfscript:ne("cfscript",function(){return q(()=>import("./cfscript-CeuFWGtU.js").then(e=>e.c),__vite__mapDeps([195,1]))}),chaiscript:ne("chaiscript",function(){return q(()=>import("./chaiscript-YpFdQwm4.js").then(e=>e.c),__vite__mapDeps([196,1,168,169]))}),cil:ne("cil",function(){return q(()=>import("./cil-BTpaFQxw.js").then(e=>e.c),__vite__mapDeps([197,1]))}),clike:ne("clike",function(){return q(()=>import("./clike-C0ZDHdrY.js").then(e=>e.c),__vite__mapDeps([198,1,199]))}),clojure:ne("clojure",function(){return q(()=>import("./clojure-nHglC_Wr.js").then(e=>e.c),__vite__mapDeps([200,1]))}),cmake:ne("cmake",function(){return q(()=>import("./cmake-CkGrNXqP.js").then(e=>e.c),__vite__mapDeps([201,1]))}),cobol:ne("cobol",function(){return q(()=>import("./cobol-CpeWJsGx.js").then(e=>e.c),__vite__mapDeps([202,1]))}),coffeescript:ne("coffeescript",function(){return q(()=>import("./coffeescript-BmyGALDp.js").then(e=>e.c),__vite__mapDeps([203,1]))}),concurnas:ne("concurnas",function(){return q(()=>import("./concurnas-AGPXgTy3.js").then(e=>e.c),__vite__mapDeps([204,1]))}),coq:ne("coq",function(){return q(()=>import("./coq-B1vh1X6h.js").then(e=>e.c),__vite__mapDeps([205,1]))}),cpp:ne("cpp",function(){return q(()=>import("./cpp-BrdR8lzA.js").then(e=>e.c),__vite__mapDeps([206,1,168,169]))}),crystal:ne("crystal",function(){return q(()=>import("./crystal-DMB1xqN1.js").then(e=>e.c),__vite__mapDeps([207,1,208]))}),csharp:ne("csharp",function(){return q(()=>import("./csharp-Dz-Duhoj.js").then(e=>e.c),__vite__mapDeps([209,1,175]))}),cshtml:ne("cshtml",function(){return q(()=>import("./cshtml-Dao_x5sm.js").then(e=>e.c),__vite__mapDeps([210,1,175]))}),csp:ne("csp",function(){return q(()=>import("./csp-rN0ct5mE.js").then(e=>e.c),__vite__mapDeps([211,1]))}),cssExtras:ne("cssExtras",function(){return q(()=>import("./css-extras-CH38hCE0.js").then(e=>e.c),__vite__mapDeps([212,1]))}),css:ne("css",function(){return q(()=>import("./css-C3pUjfuw.js").then(e=>e.c),__vite__mapDeps([213,1,214]))}),csv:ne("csv",function(){return q(()=>import("./csv-CMjGkfuc.js").then(e=>e.c),__vite__mapDeps([215,1]))}),cypher:ne("cypher",function(){return q(()=>import("./cypher-BSXied6R.js").then(e=>e.c),__vite__mapDeps([216,1]))}),d:ne("d",function(){return q(()=>import("./d-7giuCMwV.js").then(e=>e.d),__vite__mapDeps([217,1]))}),dart:ne("dart",function(){return q(()=>import("./dart-f2r0fR5P.js").then(e=>e.d),__vite__mapDeps([218,1]))}),dataweave:ne("dataweave",function(){return q(()=>import("./dataweave-BNTQwt_0.js").then(e=>e.d),__vite__mapDeps([219,1]))}),dax:ne("dax",function(){return q(()=>import("./dax-9u0VVHGx.js").then(e=>e.d),__vite__mapDeps([220,1]))}),dhall:ne("dhall",function(){return q(()=>import("./dhall-BnOlrm1O.js").then(e=>e.d),__vite__mapDeps([221,1]))}),diff:ne("diff",function(){return q(()=>import("./diff-CbyOnxIb.js").then(e=>e.d),__vite__mapDeps([222,1]))}),django:ne("django",function(){return q(()=>import("./django-BoROLrA7.js").then(e=>e.d),__vite__mapDeps([223,1,224]))}),dnsZoneFile:ne("dnsZoneFile",function(){return q(()=>import("./dns-zone-file-BZz70gag.js").then(e=>e.d),__vite__mapDeps([225,1]))}),docker:ne("docker",function(){return q(()=>import("./docker-DDluW8dt.js").then(e=>e.d),__vite__mapDeps([226,1]))}),dot:ne("dot",function(){return q(()=>import("./dot-qujU4Da1.js").then(e=>e.d),__vite__mapDeps([227,1]))}),ebnf:ne("ebnf",function(){return q(()=>import("./ebnf-CcQ_JImo.js").then(e=>e.e),__vite__mapDeps([228,1]))}),editorconfig:ne("editorconfig",function(){return q(()=>import("./editorconfig-BbwhooPy.js").then(e=>e.e),__vite__mapDeps([229,1]))}),eiffel:ne("eiffel",function(){return q(()=>import("./eiffel-B3J5PQxF.js").then(e=>e.e),__vite__mapDeps([230,1]))}),ejs:ne("ejs",function(){return q(()=>import("./ejs-W0BSwUjI.js").then(e=>e.e),__vite__mapDeps([231,1,224]))}),elixir:ne("elixir",function(){return q(()=>import("./elixir-DP_8UBXK.js").then(e=>e.e),__vite__mapDeps([232,1]))}),elm:ne("elm",function(){return q(()=>import("./elm-iqtDCABP.js").then(e=>e.e),__vite__mapDeps([233,1]))}),erb:ne("erb",function(){return q(()=>import("./erb-deIh2UEF.js").then(e=>e.e),__vite__mapDeps([234,1,208,224]))}),erlang:ne("erlang",function(){return q(()=>import("./erlang-4tX_bnUx.js").then(e=>e.e),__vite__mapDeps([235,1]))}),etlua:ne("etlua",function(){return q(()=>import("./etlua-CWJxZlBl.js").then(e=>e.e),__vite__mapDeps([236,1,237,224]))}),excelFormula:ne("excelFormula",function(){return q(()=>import("./excel-formula-BQj21DBh.js").then(e=>e.e),__vite__mapDeps([238,1]))}),factor:ne("factor",function(){return q(()=>import("./factor-BH7igz5o.js").then(e=>e.f),__vite__mapDeps([239,1]))}),falselang:ne("falselang",function(){return q(()=>import("./false-Qh-wnXyD.js").then(e=>e._),__vite__mapDeps([240,1]))}),firestoreSecurityRules:ne("firestoreSecurityRules",function(){return q(()=>import("./firestore-security-rules-CKhRlNBp.js").then(e=>e.f),__vite__mapDeps([241,1]))}),flow:ne("flow",function(){return q(()=>import("./flow-DJdu3gfB.js").then(e=>e.f),__vite__mapDeps([242,1]))}),fortran:ne("fortran",function(){return q(()=>import("./fortran-BHu4hUHY.js").then(e=>e.f),__vite__mapDeps([243,1]))}),fsharp:ne("fsharp",function(){return q(()=>import("./fsharp-BiNyUor_.js").then(e=>e.f),__vite__mapDeps([244,1]))}),ftl:ne("ftl",function(){return q(()=>import("./ftl-D6bVz-y_.js").then(e=>e.f),__vite__mapDeps([245,1,224]))}),gap:ne("gap",function(){return q(()=>import("./gap-DjhzPH1Z.js").then(e=>e.g),__vite__mapDeps([246,1]))}),gcode:ne("gcode",function(){return q(()=>import("./gcode-DJBtEOur.js").then(e=>e.g),__vite__mapDeps([247,1]))}),gdscript:ne("gdscript",function(){return q(()=>import("./gdscript-C_X-7y6o.js").then(e=>e.g),__vite__mapDeps([248,1]))}),gedcom:ne("gedcom",function(){return q(()=>import("./gedcom-CH5a7-zs.js").then(e=>e.g),__vite__mapDeps([249,1]))}),gherkin:ne("gherkin",function(){return q(()=>import("./gherkin-CLD9Z44w.js").then(e=>e.g),__vite__mapDeps([250,1]))}),git:ne("git",function(){return q(()=>import("./git-DirbeLrE.js").then(e=>e.g),__vite__mapDeps([251,1]))}),glsl:ne("glsl",function(){return q(()=>import("./glsl-DwU_K1Bf.js").then(e=>e.g),__vite__mapDeps([252,1,169]))}),gml:ne("gml",function(){return q(()=>import("./gml-CQQxmZvv.js").then(e=>e.g),__vite__mapDeps([253,1]))}),gn:ne("gn",function(){return q(()=>import("./gn-wrWPxerG.js").then(e=>e.g),__vite__mapDeps([254,1]))}),goModule:ne("goModule",function(){return q(()=>import("./go-module-CjFP3WFY.js").then(e=>e.g),__vite__mapDeps([255,1]))}),go:ne("go",function(){return q(()=>import("./go-ZYzi8OLl.js").then(e=>e.g),__vite__mapDeps([256,1]))}),graphql:ne("graphql",function(){return q(()=>import("./graphql-BcLwhGtH.js").then(e=>e.g),__vite__mapDeps([257,1]))}),groovy:ne("groovy",function(){return q(()=>import("./groovy-DumHeXpg.js").then(e=>e.g),__vite__mapDeps([258,1]))}),haml:ne("haml",function(){return q(()=>import("./haml-CqSzOsbr.js").then(e=>e.h),__vite__mapDeps([259,1,208]))}),handlebars:ne("handlebars",function(){return q(()=>import("./handlebars-Bry2_rsG.js").then(e=>e.h),__vite__mapDeps([260,1,224]))}),haskell:ne("haskell",function(){return q(()=>import("./haskell-yUNIp-7d.js").then(e=>e.h),__vite__mapDeps([261,1,262]))}),haxe:ne("haxe",function(){return q(()=>import("./haxe-Dp4DyQmv.js").then(e=>e.h),__vite__mapDeps([263,1]))}),hcl:ne("hcl",function(){return q(()=>import("./hcl-B5qkLEyl.js").then(e=>e.h),__vite__mapDeps([264,1]))}),hlsl:ne("hlsl",function(){return q(()=>import("./hlsl-DrSY44_J.js").then(e=>e.h),__vite__mapDeps([265,1,169]))}),hoon:ne("hoon",function(){return q(()=>import("./hoon-CkQC4q2d.js").then(e=>e.h),__vite__mapDeps([266,1]))}),hpkp:ne("hpkp",function(){return q(()=>import("./hpkp-riVsYbz6.js").then(e=>e.h),__vite__mapDeps([267,1]))}),hsts:ne("hsts",function(){return q(()=>import("./hsts-DpYC61yC.js").then(e=>e.h),__vite__mapDeps([268,1]))}),http:ne("http",function(){return q(()=>import("./http-Dx-uCaT1.js").then(e=>e.h),__vite__mapDeps([269,1]))}),ichigojam:ne("ichigojam",function(){return q(()=>import("./ichigojam-B7XQrlmu.js").then(e=>e.i),__vite__mapDeps([270,1]))}),icon:ne("icon",function(){return q(()=>import("./icon-fmySfNA1.js").then(e=>e.i),__vite__mapDeps([271,1]))}),icuMessageFormat:ne("icuMessageFormat",function(){return q(()=>import("./icu-message-format-Oq1AuWLS.js").then(e=>e.i),__vite__mapDeps([272,1]))}),idris:ne("idris",function(){return q(()=>import("./idris-BBQY5hR_.js").then(e=>e.i),__vite__mapDeps([273,1,262]))}),iecst:ne("iecst",function(){return q(()=>import("./iecst-BXBc121A.js").then(e=>e.i),__vite__mapDeps([274,1]))}),ignore:ne("ignore",function(){return q(()=>import("./ignore-Btt-DzVm.js").then(e=>e.i),__vite__mapDeps([275,1]))}),inform7:ne("inform7",function(){return q(()=>import("./inform7-BOWBWzGd.js").then(e=>e.i),__vite__mapDeps([276,1]))}),ini:ne("ini",function(){return q(()=>import("./ini--jhBb2pg.js").then(e=>e.i),__vite__mapDeps([277,1]))}),io:ne("io",function(){return q(()=>import("./io-D2xfJyua.js").then(e=>e.i),__vite__mapDeps([278,1]))}),j:ne("j",function(){return q(()=>import("./j-DzsdI1Bx.js").then(e=>e.j),__vite__mapDeps([279,1]))}),java:ne("java",function(){return q(()=>import("./java-s-m7kerV.js").then(e=>e.j),__vite__mapDeps([280,1,281]))}),javadoc:ne("javadoc",function(){return q(()=>import("./javadoc-BjkiGsEF.js").then(e=>e.j),__vite__mapDeps([282,1,281,283]))}),javadoclike:ne("javadoclike",function(){return q(()=>import("./javadoclike-DCDpBfFy.js").then(e=>e.j),__vite__mapDeps([284,1,283]))}),javascript:ne("javascript",function(){return q(()=>import("./javascript-C5bRWOCC.js").then(e=>e.j),__vite__mapDeps([285,1,286]))}),javastacktrace:ne("javastacktrace",function(){return q(()=>import("./javastacktrace-D8SvwBYG.js").then(e=>e.j),__vite__mapDeps([287,1]))}),jexl:ne("jexl",function(){return q(()=>import("./jexl-CuibVysa.js").then(e=>e.j),__vite__mapDeps([288,1]))}),jolie:ne("jolie",function(){return q(()=>import("./jolie-G2r1IH4x.js").then(e=>e.j),__vite__mapDeps([289,1]))}),jq:ne("jq",function(){return q(()=>import("./jq-CSp-T5V6.js").then(e=>e.j),__vite__mapDeps([290,1]))}),jsExtras:ne("jsExtras",function(){return q(()=>import("./js-extras-DzfpmWre.js").then(e=>e.j),__vite__mapDeps([291,1]))}),jsTemplates:ne("jsTemplates",function(){return q(()=>import("./js-templates-deUmuJZ-.js").then(e=>e.j),__vite__mapDeps([292,1]))}),jsdoc:ne("jsdoc",function(){return q(()=>import("./jsdoc-CzzeaHoB.js").then(e=>e.j),__vite__mapDeps([293,1,283,294]))}),json:ne("json",function(){return q(()=>import("./json-DkUPYY4u.js").then(e=>e.j),__vite__mapDeps([295,1,296]))}),json5:ne("json5",function(){return q(()=>import("./json5-kaAIKBom.js").then(e=>e.j),__vite__mapDeps([297,1,296]))}),jsonp:ne("jsonp",function(){return q(()=>import("./jsonp-NFZGtYU-.js").then(e=>e.j),__vite__mapDeps([298,1,296]))}),jsstacktrace:ne("jsstacktrace",function(){return q(()=>import("./jsstacktrace-z4GMPjy-.js").then(e=>e.j),__vite__mapDeps([299,1]))}),jsx:ne("jsx",function(){return q(()=>import("./jsx-CHRn7QrA.js").then(e=>e.j),__vite__mapDeps([300,1,301]))}),julia:ne("julia",function(){return q(()=>import("./julia-CtD-2MpL.js").then(e=>e.j),__vite__mapDeps([302,1]))}),keepalived:ne("keepalived",function(){return q(()=>import("./keepalived-CFt0jL3j.js").then(e=>e.k),__vite__mapDeps([303,1]))}),keyman:ne("keyman",function(){return q(()=>import("./keyman-B9DoVDwq.js").then(e=>e.k),__vite__mapDeps([304,1]))}),kotlin:ne("kotlin",function(){return q(()=>import("./kotlin-Dq-NDvL5.js").then(e=>e.k),__vite__mapDeps([305,1]))}),kumir:ne("kumir",function(){return q(()=>import("./kumir-CJqEisv6.js").then(e=>e.k),__vite__mapDeps([306,1]))}),kusto:ne("kusto",function(){return q(()=>import("./kusto-BgQKkaWx.js").then(e=>e.k),__vite__mapDeps([307,1]))}),latex:ne("latex",function(){return q(()=>import("./latex-BT8SOs-A.js").then(e=>e.l),__vite__mapDeps([308,1]))}),latte:ne("latte",function(){return q(()=>import("./latte-C8JT4Qb7.js").then(e=>e.l),__vite__mapDeps([309,1,224,310]))}),less:ne("less",function(){return q(()=>import("./less-BD_NHSLb.js").then(e=>e.l),__vite__mapDeps([311,1]))}),lilypond:ne("lilypond",function(){return q(()=>import("./lilypond-AQaE6Na0.js").then(e=>e.l),__vite__mapDeps([312,1,313]))}),liquid:ne("liquid",function(){return q(()=>import("./liquid-y7RSJ3Wl.js").then(e=>e.l),__vite__mapDeps([314,1,224]))}),lisp:ne("lisp",function(){return q(()=>import("./lisp-BC_0scWg.js").then(e=>e.l),__vite__mapDeps([315,1]))}),livescript:ne("livescript",function(){return q(()=>import("./livescript-iy-NHZ_h.js").then(e=>e.l),__vite__mapDeps([316,1]))}),llvm:ne("llvm",function(){return q(()=>import("./llvm-BfiEgsxO.js").then(e=>e.l),__vite__mapDeps([317,1]))}),log:ne("log",function(){return q(()=>import("./log-cps16LLM.js").then(e=>e.l),__vite__mapDeps([318,1]))}),lolcode:ne("lolcode",function(){return q(()=>import("./lolcode-3zmtClDS.js").then(e=>e.l),__vite__mapDeps([319,1]))}),lua:ne("lua",function(){return q(()=>import("./lua-DI565xS0.js").then(e=>e.l),__vite__mapDeps([320,1,237]))}),magma:ne("magma",function(){return q(()=>import("./magma-ba7Qn7K1.js").then(e=>e.m),__vite__mapDeps([321,1]))}),makefile:ne("makefile",function(){return q(()=>import("./makefile-BqSQ4nmN.js").then(e=>e.m),__vite__mapDeps([322,1]))}),markdown:ne("markdown",function(){return q(()=>import("./markdown-Cze8MKhj.js").then(e=>e.m),__vite__mapDeps([323,1]))}),markupTemplating:ne("markupTemplating",function(){return q(()=>import("./markup-templating-C-QmJhjg.js").then(e=>e.m),__vite__mapDeps([324,1,224]))}),markup:ne("markup",function(){return q(()=>import("./markup-Dt-xKA80.js").then(e=>e.m),__vite__mapDeps([325,1,326]))}),matlab:ne("matlab",function(){return q(()=>import("./matlab-CacUYSDq.js").then(e=>e.m),__vite__mapDeps([327,1]))}),maxscript:ne("maxscript",function(){return q(()=>import("./maxscript-Cm15dTB4.js").then(e=>e.m),__vite__mapDeps([328,1]))}),mel:ne("mel",function(){return q(()=>import("./mel-BFRmaBUW.js").then(e=>e.m),__vite__mapDeps([329,1]))}),mermaid:ne("mermaid",function(){return q(()=>import("./mermaid-_TlUmfQf.js").then(e=>e.m),__vite__mapDeps([330,1]))}),mizar:ne("mizar",function(){return q(()=>import("./mizar-BoN7zgqH.js").then(e=>e.m),__vite__mapDeps([331,1]))}),mongodb:ne("mongodb",function(){return q(()=>import("./mongodb-Do1oT-rg.js").then(e=>e.m),__vite__mapDeps([332,1]))}),monkey:ne("monkey",function(){return q(()=>import("./monkey-DS3nr7fk.js").then(e=>e.m),__vite__mapDeps([333,1]))}),moonscript:ne("moonscript",function(){return q(()=>import("./moonscript-Cwqh5x__.js").then(e=>e.m),__vite__mapDeps([334,1]))}),n1ql:ne("n1ql",function(){return q(()=>import("./n1ql-BgI_6bQf.js").then(e=>e.n),__vite__mapDeps([335,1]))}),n4js:ne("n4js",function(){return q(()=>import("./n4js-oXh14UQA.js").then(e=>e.n),__vite__mapDeps([336,1]))}),nand2tetrisHdl:ne("nand2tetrisHdl",function(){return q(()=>import("./nand2tetris-hdl-CGF6E--X.js").then(e=>e.n),__vite__mapDeps([337,1]))}),naniscript:ne("naniscript",function(){return q(()=>import("./naniscript-Dv0ErN1f.js").then(e=>e.n),__vite__mapDeps([338,1]))}),nasm:ne("nasm",function(){return q(()=>import("./nasm-CdhriaSD.js").then(e=>e.n),__vite__mapDeps([339,1]))}),neon:ne("neon",function(){return q(()=>import("./neon-6Qw1Wpr8.js").then(e=>e.n),__vite__mapDeps([340,1]))}),nevod:ne("nevod",function(){return q(()=>import("./nevod-Do308_dN.js").then(e=>e.n),__vite__mapDeps([341,1]))}),nginx:ne("nginx",function(){return q(()=>import("./nginx-CioVUANG.js").then(e=>e.n),__vite__mapDeps([342,1]))}),nim:ne("nim",function(){return q(()=>import("./nim-BiZFPqzz.js").then(e=>e.n),__vite__mapDeps([343,1]))}),nix:ne("nix",function(){return q(()=>import("./nix-DLWyfiVz.js").then(e=>e.n),__vite__mapDeps([344,1]))}),nsis:ne("nsis",function(){return q(()=>import("./nsis-B_mA8Mf4.js").then(e=>e.n),__vite__mapDeps([345,1]))}),objectivec:ne("objectivec",function(){return q(()=>import("./objectivec-CFn4OO_F.js").then(e=>e.o),__vite__mapDeps([346,1,169]))}),ocaml:ne("ocaml",function(){return q(()=>import("./ocaml-B365KzYr.js").then(e=>e.o),__vite__mapDeps([347,1]))}),opencl:ne("opencl",function(){return q(()=>import("./opencl-CPm34rhj.js").then(e=>e.o),__vite__mapDeps([348,1,169]))}),openqasm:ne("openqasm",function(){return q(()=>import("./openqasm-CDj9ArmH.js").then(e=>e.o),__vite__mapDeps([349,1]))}),oz:ne("oz",function(){return q(()=>import("./oz-BYXLbj-G.js").then(e=>e.o),__vite__mapDeps([350,1]))}),parigp:ne("parigp",function(){return q(()=>import("./parigp-D0QktAhQ.js").then(e=>e.p),__vite__mapDeps([351,1]))}),parser:ne("parser",function(){return q(()=>import("./parser-qO2_EI6v.js").then(e=>e.p),__vite__mapDeps([352,1]))}),pascal:ne("pascal",function(){return q(()=>import("./pascal-De5eNwWX.js").then(e=>e.p),__vite__mapDeps([353,1]))}),pascaligo:ne("pascaligo",function(){return q(()=>import("./pascaligo-Bf8O7ebQ.js").then(e=>e.p),__vite__mapDeps([354,1]))}),pcaxis:ne("pcaxis",function(){return q(()=>import("./pcaxis-BcwaB2L7.js").then(e=>e.p),__vite__mapDeps([355,1]))}),peoplecode:ne("peoplecode",function(){return q(()=>import("./peoplecode-Dk2Gnb3n.js").then(e=>e.p),__vite__mapDeps([356,1]))}),perl:ne("perl",function(){return q(()=>import("./perl-DRKm4LVK.js").then(e=>e.p),__vite__mapDeps([357,1]))}),phpExtras:ne("phpExtras",function(){return q(()=>import("./php-extras-DBoPtocT.js").then(e=>e.p),__vite__mapDeps([358,1,310,224]))}),php:ne("php",function(){return q(()=>import("./php-BSKv2GXV.js").then(e=>e.p),__vite__mapDeps([359,1,310,224]))}),phpdoc:ne("phpdoc",function(){return q(()=>import("./phpdoc-BJjHK9Yc.js").then(e=>e.p),__vite__mapDeps([360,1,310,224,283]))}),plsql:ne("plsql",function(){return q(()=>import("./plsql-Bb_hLNuA.js").then(e=>e.p),__vite__mapDeps([361,1,163]))}),powerquery:ne("powerquery",function(){return q(()=>import("./powerquery-C5qk80xF.js").then(e=>e.p),__vite__mapDeps([362,1]))}),powershell:ne("powershell",function(){return q(()=>import("./powershell-BG0DpRp-.js").then(e=>e.p),__vite__mapDeps([363,1]))}),processing:ne("processing",function(){return q(()=>import("./processing-w7DFlyH_.js").then(e=>e.p),__vite__mapDeps([364,1]))}),prolog:ne("prolog",function(){return q(()=>import("./prolog-B2BVxulM.js").then(e=>e.p),__vite__mapDeps([365,1]))}),promql:ne("promql",function(){return q(()=>import("./promql-B3KvaVJb.js").then(e=>e.p),__vite__mapDeps([366,1]))}),properties:ne("properties",function(){return q(()=>import("./properties-BE8Ews0J.js").then(e=>e.p),__vite__mapDeps([367,1]))}),protobuf:ne("protobuf",function(){return q(()=>import("./protobuf-CBHBbdUG.js").then(e=>e.p),__vite__mapDeps([368,1]))}),psl:ne("psl",function(){return q(()=>import("./psl-aD6jMMeP.js").then(e=>e.p),__vite__mapDeps([369,1]))}),pug:ne("pug",function(){return q(()=>import("./pug-DI-93Lan.js").then(e=>e.p),__vite__mapDeps([370,1]))}),puppet:ne("puppet",function(){return q(()=>import("./puppet-DxN-4n9f.js").then(e=>e.p),__vite__mapDeps([371,1]))}),pure:ne("pure",function(){return q(()=>import("./pure-_2x0TJjK.js").then(e=>e.p),__vite__mapDeps([372,1]))}),purebasic:ne("purebasic",function(){return q(()=>import("./purebasic-C8Ir77ii.js").then(e=>e.p),__vite__mapDeps([373,1]))}),purescript:ne("purescript",function(){return q(()=>import("./purescript-DWCP7Rhr.js").then(e=>e.p),__vite__mapDeps([374,1,262]))}),python:ne("python",function(){return q(()=>import("./python-B3k5tM49.js").then(e=>e.p),__vite__mapDeps([375,1]))}),q:ne("q",function(){return q(()=>import("./q-LJLqXf0_.js").then(e=>e.q),__vite__mapDeps([376,1]))}),qml:ne("qml",function(){return q(()=>import("./qml-DgsxaMQP.js").then(e=>e.q),__vite__mapDeps([377,1]))}),qore:ne("qore",function(){return q(()=>import("./qore-DumyY0ow.js").then(e=>e.q),__vite__mapDeps([378,1]))}),qsharp:ne("qsharp",function(){return q(()=>import("./qsharp-ClAsZa-1.js").then(e=>e.q),__vite__mapDeps([379,1]))}),r:ne("r",function(){return q(()=>import("./r-DHwkVKGw.js").then(e=>e.r),__vite__mapDeps([380,1]))}),racket:ne("racket",function(){return q(()=>import("./racket-DcBksMCk.js").then(e=>e.r),__vite__mapDeps([381,1,313]))}),reason:ne("reason",function(){return q(()=>import("./reason-BXtuBfki.js").then(e=>e.r),__vite__mapDeps([382,1]))}),regex:ne("regex",function(){return q(()=>import("./regex-Bmn5L_4e.js").then(e=>e.r),__vite__mapDeps([383,1]))}),rego:ne("rego",function(){return q(()=>import("./rego-CZsdWqMW.js").then(e=>e.r),__vite__mapDeps([384,1]))}),renpy:ne("renpy",function(){return q(()=>import("./renpy-XPjsxRDO.js").then(e=>e.r),__vite__mapDeps([385,1]))}),rest:ne("rest",function(){return q(()=>import("./rest-DD2JcNUu.js").then(e=>e.r),__vite__mapDeps([386,1]))}),rip:ne("rip",function(){return q(()=>import("./rip-B2ScZnvu.js").then(e=>e.r),__vite__mapDeps([387,1]))}),roboconf:ne("roboconf",function(){return q(()=>import("./roboconf-XMvWjvgI.js").then(e=>e.r),__vite__mapDeps([388,1]))}),robotframework:ne("robotframework",function(){return q(()=>import("./robotframework-BivGgTMI.js").then(e=>e.r),__vite__mapDeps([389,1]))}),ruby:ne("ruby",function(){return q(()=>import("./ruby-DQG1k7eY.js").then(e=>e.r),__vite__mapDeps([390,1,208]))}),rust:ne("rust",function(){return q(()=>import("./rust-CY08bKn6.js").then(e=>e.r),__vite__mapDeps([391,1]))}),sas:ne("sas",function(){return q(()=>import("./sas-1PTlKbzw.js").then(e=>e.s),__vite__mapDeps([392,1]))}),sass:ne("sass",function(){return q(()=>import("./sass-RllDMjGg.js").then(e=>e.s),__vite__mapDeps([393,1]))}),scala:ne("scala",function(){return q(()=>import("./scala-D1OpbE39.js").then(e=>e.s),__vite__mapDeps([394,1,281]))}),scheme:ne("scheme",function(){return q(()=>import("./scheme-BbtNtDr-.js").then(e=>e.s),__vite__mapDeps([395,1,313]))}),scss:ne("scss",function(){return q(()=>import("./scss-DgCxV9gf.js").then(e=>e.s),__vite__mapDeps([396,1]))}),shellSession:ne("shellSession",function(){return q(()=>import("./shell-session-1LvomK4i.js").then(e=>e.s),__vite__mapDeps([397,1,181]))}),smali:ne("smali",function(){return q(()=>import("./smali-CXX5Nw4b.js").then(e=>e.s),__vite__mapDeps([398,1]))}),smalltalk:ne("smalltalk",function(){return q(()=>import("./smalltalk-CkWNQdr2.js").then(e=>e.s),__vite__mapDeps([399,1]))}),smarty:ne("smarty",function(){return q(()=>import("./smarty-D9yobX_8.js").then(e=>e.s),__vite__mapDeps([400,1,224]))}),sml:ne("sml",function(){return q(()=>import("./sml-CtZ57qc6.js").then(e=>e.s),__vite__mapDeps([401,1]))}),solidity:ne("solidity",function(){return q(()=>import("./solidity-CkABSbax.js").then(e=>e.s),__vite__mapDeps([402,1]))}),solutionFile:ne("solutionFile",function(){return q(()=>import("./solution-file-K7E94G8T.js").then(e=>e.s),__vite__mapDeps([403,1]))}),soy:ne("soy",function(){return q(()=>import("./soy-CiMQleff.js").then(e=>e.s),__vite__mapDeps([404,1,224]))}),sparql:ne("sparql",function(){return q(()=>import("./sparql-B28RxTei.js").then(e=>e.s),__vite__mapDeps([405,1,406]))}),splunkSpl:ne("splunkSpl",function(){return q(()=>import("./splunk-spl-w0Cel-ic.js").then(e=>e.s),__vite__mapDeps([407,1]))}),sqf:ne("sqf",function(){return q(()=>import("./sqf-BBYZJCt5.js").then(e=>e.s),__vite__mapDeps([408,1]))}),sql:ne("sql",function(){return q(()=>import("./sql-CwRJh8Sp.js").then(e=>e.s),__vite__mapDeps([409,1,163]))}),squirrel:ne("squirrel",function(){return q(()=>import("./squirrel-CEzvQBK5.js").then(e=>e.s),__vite__mapDeps([410,1]))}),stan:ne("stan",function(){return q(()=>import("./stan-S3CZTrL_.js").then(e=>e.s),__vite__mapDeps([411,1]))}),stylus:ne("stylus",function(){return q(()=>import("./stylus-BG4_ZnaL.js").then(e=>e.s),__vite__mapDeps([412,1]))}),swift:ne("swift",function(){return q(()=>import("./swift-ByheDo_6.js").then(e=>e.s),__vite__mapDeps([413,1]))}),systemd:ne("systemd",function(){return q(()=>import("./systemd-6CBk_Ow2.js").then(e=>e.s),__vite__mapDeps([414,1]))}),t4Cs:ne("t4Cs",function(){return q(()=>import("./t4-cs-DHZvgPUG.js").then(e=>e.t),__vite__mapDeps([415,1,416,175]))}),t4Templating:ne("t4Templating",function(){return q(()=>import("./t4-templating-DUeWWaCj.js").then(e=>e.t),__vite__mapDeps([417,1,416]))}),t4Vb:ne("t4Vb",function(){return q(()=>import("./t4-vb-B_6qRhT8.js").then(e=>e.t),__vite__mapDeps([418,1,416,419,183]))}),tap:ne("tap",function(){return q(()=>import("./tap-DjTT3CuE.js").then(e=>e.t),__vite__mapDeps([420,1,421]))}),tcl:ne("tcl",function(){return q(()=>import("./tcl-BM9U6SkZ.js").then(e=>e.t),__vite__mapDeps([422,1]))}),textile:ne("textile",function(){return q(()=>import("./textile-XOvB5RBz.js").then(e=>e.t),__vite__mapDeps([423,1]))}),toml:ne("toml",function(){return q(()=>import("./toml-BO0aGyy4.js").then(e=>e.t),__vite__mapDeps([424,1]))}),tremor:ne("tremor",function(){return q(()=>import("./tremor-Bk9M5xQH.js").then(e=>e.t),__vite__mapDeps([425,1]))}),tsx:ne("tsx",function(){return q(()=>import("./tsx-BcjbSAGh.js").then(e=>e.t),__vite__mapDeps([426,1,301,294]))}),tt2:ne("tt2",function(){return q(()=>import("./tt2-BHaQqFiG.js").then(e=>e.t),__vite__mapDeps([427,1,224]))}),turtle:ne("turtle",function(){return q(()=>import("./turtle-CdxJK1CJ.js").then(e=>e.t),__vite__mapDeps([428,1,406]))}),twig:ne("twig",function(){return q(()=>import("./twig-CxFOkn0v.js").then(e=>e.t),__vite__mapDeps([429,1,224]))}),typescript:ne("typescript",function(){return q(()=>import("./typescript-CVqiKcu1.js").then(e=>e.t),__vite__mapDeps([430,1,294]))}),typoscript:ne("typoscript",function(){return q(()=>import("./typoscript-spRf2Ox1.js").then(e=>e.t),__vite__mapDeps([431,1]))}),unrealscript:ne("unrealscript",function(){return q(()=>import("./unrealscript-D2PIC4ZQ.js").then(e=>e.u),__vite__mapDeps([432,1]))}),uorazor:ne("uorazor",function(){return q(()=>import("./uorazor-xrDEXG6p.js").then(e=>e.u),__vite__mapDeps([433,1]))}),uri:ne("uri",function(){return q(()=>import("./uri-CwPh3EwT.js").then(e=>e.u),__vite__mapDeps([434,1]))}),v:ne("v",function(){return q(()=>import("./v-CJIzMR4B.js").then(e=>e.v),__vite__mapDeps([435,1]))}),vala:ne("vala",function(){return q(()=>import("./vala-WpTbVsFT.js").then(e=>e.v),__vite__mapDeps([436,1]))}),vbnet:ne("vbnet",function(){return q(()=>import("./vbnet-UNQqH4vF.js").then(e=>e.v),__vite__mapDeps([437,1,419,183]))}),velocity:ne("velocity",function(){return q(()=>import("./velocity-DsPfPeeX.js").then(e=>e.v),__vite__mapDeps([438,1]))}),verilog:ne("verilog",function(){return q(()=>import("./verilog-NpK4_zqq.js").then(e=>e.v),__vite__mapDeps([439,1]))}),vhdl:ne("vhdl",function(){return q(()=>import("./vhdl-DiFKlg1X.js").then(e=>e.v),__vite__mapDeps([440,1]))}),vim:ne("vim",function(){return q(()=>import("./vim-SyhS9sNH.js").then(e=>e.v),__vite__mapDeps([441,1]))}),visualBasic:ne("visualBasic",function(){return q(()=>import("./visual-basic-DSiTvEtK.js").then(e=>e.v),__vite__mapDeps([442,1]))}),warpscript:ne("warpscript",function(){return q(()=>import("./warpscript-CTRBwGjg.js").then(e=>e.w),__vite__mapDeps([443,1]))}),wasm:ne("wasm",function(){return q(()=>import("./wasm-CBCDYs2M.js").then(e=>e.w),__vite__mapDeps([444,1]))}),webIdl:ne("webIdl",function(){return q(()=>import("./web-idl-BfdeEL3H.js").then(e=>e.w),__vite__mapDeps([445,1]))}),wiki:ne("wiki",function(){return q(()=>import("./wiki-CouGhrmq.js").then(e=>e.w),__vite__mapDeps([446,1]))}),wolfram:ne("wolfram",function(){return q(()=>import("./wolfram-CejGEkud.js").then(e=>e.w),__vite__mapDeps([447,1]))}),wren:ne("wren",function(){return q(()=>import("./wren-BTo1kC3F.js").then(e=>e.w),__vite__mapDeps([448,1]))}),xeora:ne("xeora",function(){return q(()=>import("./xeora-mFujPPPh.js").then(e=>e.x),__vite__mapDeps([449,1]))}),xmlDoc:ne("xmlDoc",function(){return q(()=>import("./xml-doc-DpZbWR7e.js").then(e=>e.x),__vite__mapDeps([450,1]))}),xojo:ne("xojo",function(){return q(()=>import("./xojo-C9xNSycu.js").then(e=>e.x),__vite__mapDeps([451,1]))}),xquery:ne("xquery",function(){return q(()=>import("./xquery-C7CsuD6b.js").then(e=>e.x),__vite__mapDeps([452,1]))}),yaml:ne("yaml",function(){return q(()=>import("./yaml-DxQv1G_M.js").then(e=>e.y),__vite__mapDeps([453,1,421]))}),yang:ne("yang",function(){return q(()=>import("./yang-BXpPxQeP.js").then(e=>e.y),__vite__mapDeps([454,1]))}),zig:ne("zig",function(){return q(()=>import("./zig-KxZlFBGb.js").then(e=>e.z),__vite__mapDeps([455,1]))})},oGe=rGe({loader:function(){return q(()=>import("./core-ChuWtB-i.js").then(t=>t.c),__vite__mapDeps([456,1,326,214,199,286])).then(function(t){return t.default||t})},isLanguageRegistered:function(t,n){return t.registered(n)},languageLoaders:sGe,registerLanguage:function(t,n,r){return t.register(r)}}),aGe="light";function iGe(e){return{mode:aGe,...e?.theme}}function en(e){var t=e;return function(n){var r=iGe(n);let s=r.mode;return t[s]}}const lGe=e=>{const t={theme:e};return{lineNumberColor:en({light:"#383a42",dark:"#abb2bf"})(t),lineNumberBgColor:en({light:"#fafafa",dark:"#282c34"})(t),backgroundColor:en({light:"#fafafa",dark:"#282c34"})(t),textColor:en({light:"#383a42",dark:"#abb2bf"})(t),substringColor:en({light:"#e45649",dark:"#e06c75"})(t),keywordColor:en({light:"#a626a4",dark:"#c678dd"})(t),attributeColor:en({light:"#50a14f",dark:"#98c379"})(t),selectorAttributeColor:en({light:"#e45649",dark:"#e06c75"})(t),docTagColor:en({light:"#a626a4",dark:"#c678dd"})(t),nameColor:en({light:"#e45649",dark:"#e06c75"})(t),builtInColor:en({light:"#c18401",dark:"#e6c07b"})(t),literalColor:en({light:"#0184bb",dark:"#56b6c2"})(t),bulletColor:en({light:"#4078f2",dark:"#61aeee"})(t),codeColor:en({light:"#383a42",dark:"#abb2bf"})(t),additionColor:en({light:"#50a14f",dark:"#98c379"})(t),regexpColor:en({light:"#50a14f",dark:"#98c379"})(t),symbolColor:en({light:"#4078f2",dark:"#61aeee"})(t),variableColor:en({light:"#986801",dark:"#d19a66"})(t),templateVariableColor:en({light:"#986801",dark:"#d19a66"})(t),linkColor:en({light:"#4078f2",dark:"#61aeee"})(t),selectorClassColor:en({light:"#986801",dark:"#d19a66"})(t),typeColor:en({light:"#986801",dark:"#d19a66"})(t),stringColor:en({light:"#50a14f",dark:"#98c379"})(t),selectorIdColor:en({light:"#4078f2",dark:"#61aeee"})(t),quoteColor:en({light:"#a0a1a7",dark:"#5c6370"})(t),templateTagColor:en({light:"#383a42",dark:"#abb2bf"})(t),deletionColor:en({light:"#e45649",dark:"#e06c75"})(t),titleColor:en({light:"#4078f2",dark:"#61aeee"})(t),sectionColor:en({light:"#e45649",dark:"#e06c75"})(t),commentColor:en({light:"#a0a1a7",dark:"#5c6370"})(t),metaKeywordColor:en({light:"#383a42",dark:"#abb2bf"})(t),metaColor:en({light:"#4078f2",dark:"#61aeee"})(t),functionColor:en({light:"#383a42",dark:"#abb2bf"})(t),numberColor:en({light:"#986801",dark:"#d19a66"})(t)}},I2="inherit",Y6="inherit",cGe={fontSize:Y6,fontFamily:I2,lineHeight:20/12,padding:8},uGe=e=>({fontSize:Y6,lineHeight:20/14,color:e.lineNumberColor,backgroundColor:e.lineNumberBgColor,flexShrink:0,padding:8,textAlign:"right",userSelect:"none"}),une=e=>({key:{color:e.keywordColor,fontWeight:"bolder"},keyword:{color:e.keywordColor,fontWeight:"bolder"},"attr-name":{color:e.attributeColor},selector:{color:e.selectorTagColor},comment:{color:e.commentColor,fontFamily:I2,fontStyle:"italic"},"block-comment":{color:e.commentColor,fontFamily:I2,fontStyle:"italic"},"function-name":{color:e.sectionColor},"class-name":{color:e.sectionColor},doctype:{color:e.docTagColor},substr:{color:e.substringColor},namespace:{color:e.nameColor},builtin:{color:e.builtInColor},entity:{color:e.literalColor},bullet:{color:e.bulletColor},code:{color:e.codeColor},addition:{color:e.additionColor},regex:{color:e.regexpColor},symbol:{color:e.symbolColor},variable:{color:e.variableColor},url:{color:e.linkColor},"selector-attr":{color:e.selectorAttributeColor},"selector-pseudo":{color:e.selectorPseudoColor},type:{color:e.typeColor},string:{color:e.stringColor},quote:{color:e.quoteColor},tag:{color:e.templateTagColor},deletion:{color:e.deletionColor},title:{color:e.titleColor},section:{color:e.sectionColor},"meta-keyword":{color:e.metaKeywordColor},meta:{color:e.metaColor},italic:{fontStyle:"italic"},bold:{fontWeight:"bolder"},function:{color:e.functionColor},number:{color:e.numberColor}}),dne=e=>({fontSize:Y6,fontFamily:I2,background:e.backgroundColor,color:e.textColor,borderRadius:3,display:"flex",lineHeight:20/14,overflowX:"auto",whiteSpace:"pre"}),dGe=e=>({'pre[class*="language-"]':dne(e),...une(e)}),fGe=e=>({'pre[class*="language-"]':{...dne(e),padding:"2px 4px",display:"inline",whiteSpace:"pre-wrap"},...une(e)});function fne(e={mode:"light"}){const t={...lGe(e),...e};return{lineNumberContainerStyle:uGe(t),codeBlockStyle:dGe(t),inlineCodeStyle:fGe(t),codeContainerStyle:cGe}}const mGe=Object.freeze([{name:"PHP",alias:["php","php3","php4","php5"],value:"php"},{name:"Java",alias:["java"],value:"java"},{name:"CSharp",alias:["csharp","c#","cs"],value:"csharp"},{name:"Python",alias:["python","py"],value:"python"},{name:"JavaScript",alias:["javascript","js"],value:"javascript"},{name:"XML",alias:["xml"],value:"xml"},{name:"HTML",alias:["html","htm"],value:"markup"},{name:"C++",alias:["c++","cpp","clike"],value:"cpp"},{name:"Ruby",alias:["ruby","rb","duby"],value:"ruby"},{name:"Objective-C",alias:["objective-c","objectivec","obj-c","objc"],value:"objectivec"},{name:"C",alias:["c"],value:"cpp"},{name:"Swift",alias:["swift"],value:"swift"},{name:"TeX",alias:["tex","latex"],value:"tex"},{name:"Shell",alias:["shell","sh","ksh","zsh"],value:"bash"},{name:"Scala",alias:["scala"],value:"scala"},{name:"Go",alias:["go"],value:"go"},{name:"ActionScript",alias:["actionscript","actionscript3","as"],value:"actionscript"},{name:"ColdFusion",alias:["coldfusion"],value:"xml"},{name:"JavaFX",alias:["javafx","jfx"],value:"java"},{name:"VbNet",alias:["vbnet","vb.net"],value:"vbnet"},{name:"JSON",alias:["json"],value:"json"},{name:"MATLAB",alias:["matlab"],value:"matlab"},{name:"Groovy",alias:["groovy"],value:"groovy"},{name:"SQL",alias:["sql","postgresql","postgres","plpgsql","psql","postgresql-console","postgres-console","tsql","t-sql","mysql","sqlite"],value:"sql"},{name:"R",alias:["r"],value:"r"},{name:"Perl",alias:["perl","pl"],value:"perl"},{name:"Lua",alias:["lua"],value:"lua"},{name:"Delphi",alias:["delphi","pas","pascal","objectpascal"],value:"delphi"},{name:"XML",alias:["xml"],value:"xml"},{name:"TypeScript",alias:["typescript","ts","tsx"],value:"typescript"},{name:"CoffeeScript",alias:["coffeescript","coffee-script","coffee"],value:"coffeescript"},{name:"Haskell",alias:["haskell","hs"],value:"haskell"},{name:"Puppet",alias:["puppet"],value:"puppet"},{name:"Arduino",alias:["arduino"],value:"arduino"},{name:"Fortran",alias:["fortran"],value:"fortran"},{name:"Erlang",alias:["erlang","erl"],value:"erlang"},{name:"PowerShell",alias:["powershell","posh","ps1","psm1"],value:"powershell"},{name:"Haxe",alias:["haxe","hx","hxsl"],value:"haxe"},{name:"Elixir",alias:["elixir","ex","exs"],value:"elixir"},{name:"Verilog",alias:["verilog","v"],value:"verilog"},{name:"Rust",alias:["rust"],value:"rust"},{name:"VHDL",alias:["vhdl"],value:"vhdl"},{name:"Sass",alias:["sass"],value:"less"},{name:"OCaml",alias:["ocaml"],value:"ocaml"},{name:"Dart",alias:["dart"],value:"dart"},{name:"CSS",alias:["css"],value:"css"},{name:"reStructuredText",alias:["restructuredtext","rst","rest"],value:"rest"},{name:"ObjectPascal",alias:["objectpascal"],value:"delphi"},{name:"Kotlin",alias:["kotlin"],value:"kotlin"},{name:"D",alias:["d"],value:"d"},{name:"Octave",alias:["octave"],value:"matlab"},{name:"QML",alias:["qbs","qml"],value:"qml"},{name:"Prolog",alias:["prolog"],value:"prolog"},{name:"FoxPro",alias:["foxpro","vfp","clipper","xbase"],value:"vbnet"},{name:"Scheme",alias:["scheme","scm"],value:"scheme"},{name:"CUDA",alias:["cuda","cu"],value:"cpp"},{name:"Julia",alias:["julia","jl"],value:"julia"},{name:"Racket",alias:["racket","rkt"],value:"lisp"},{name:"Ada",alias:["ada","ada95","ada2005"],value:"ada"},{name:"Tcl",alias:["tcl"],value:"tcl"},{name:"Mathematica",alias:["mathematica","mma","nb"],value:"mathematica"},{name:"Autoit",alias:["autoit"],value:"autoit"},{name:"StandardML",alias:["standardmL","sml","standardml"],value:"sml"},{name:"Objective-J",alias:["objective-j","objectivej","obj-j","objj"],value:"objectivec"},{name:"Smalltalk",alias:["smalltalk","squeak","st"],value:"smalltalk"},{name:"Vala",alias:["vala","vapi"],value:"vala"},{name:"ABAP",alias:["abap"],value:"sql"},{name:"LiveScript",alias:["livescript","live-script"],value:"livescript"},{name:"XQuery",alias:["xquery","xqy","xq","xql","xqm"],value:"xquery"},{name:"PlainText",alias:["text","plaintext"],value:"text"},{name:"Yaml",alias:["yaml","yml"],value:"yaml"},{name:"GraphQL",alias:["graphql","gql"],value:"graphql"}]),pGe=e=>{if(!e)return"";const t=mGe.find(n=>n.name===e||n.alias.includes(e));return t?t.value:e||"text"};class mne extends d.PureComponent{constructor(){super(...arguments),this._isMounted=!1}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}getLineOpacity(t){if(!this.props.highlight)return 1;const n=this.props.highlight.split(",").map(r=>{if(r.indexOf("-")>0){const[s,o]=r.split("-").map(Number).sort();return Array(o+1).fill(void 0).map((a,i)=>i).slice(s,o+1)}return Number(r)}).reduce((r,s)=>r.concat(s),[]);return n.length===0||n.includes(t)?1:.3}render(){const{inlineCodeStyle:t}=fne(this.props.theme),r={language:pGe(this.props.language),PreTag:this.props.preTag,style:this.props.codeStyle||t,showLineNumbers:this.props.showLineNumbers,startingLineNumber:this.props.startingLineNumber,codeTagProps:this.props.codeTagProps,wrapLongLines:this.props.wrapLongLines};return A.createElement(oGe,Object.assign({},r,{wrapLines:!!this.props.highlight,customStyle:this.props.customStyle,lineProps:s=>({style:{opacity:this.getLineOpacity(s),...this.props.lineNumberContainerStyle}})}),this.props.text)}}mne.defaultProps={theme:{},showLineNumbers:!1,wrapLongLines:!1,startingLineNumber:1,lineNumberContainerStyle:{},codeTagProps:{},preTag:"span",highlight:"",customStyle:{}};const pne="text";let Q6=class extends d.PureComponent{constructor(){super(...arguments),this._isMounted=!1,this.handleCopy=t=>{const n=t.nativeEvent.clipboardData;if(n){t.preventDefault();const r=window.getSelection();if(r===null)return;const s=r.toString(),o=`
${s}
`;n.clearData(),n.setData("text/html",o),n.setData("text/plain",s)}}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){var t,n,r,s;const{lineNumberContainerStyle:o,codeBlockStyle:a,codeContainerStyle:i}=fne(this.props.theme),c={language:this.props.language||pne,codeStyle:{...a,...(t=this.props)===null||t===void 0?void 0:t.codeBlockStyle},customStyle:(n=this.props)===null||n===void 0?void 0:n.customStyle,showLineNumbers:this.props.showLineNumbers,startingLineNumber:this.props.startingLineNumber,codeTagProps:{style:{...i,...(r=this.props)===null||r===void 0?void 0:r.codeContainerStyle}},lineNumberContainerStyle:{...o,...(s=this.props)===null||s===void 0?void 0:s.lineNumberContainerStyle},text:this.props.text.toString(),highlight:this.props.highlight,wrapLongLines:this.props.wrapLongLines};return A.createElement(mne,Object.assign({},c))}};Q6.displayName="CodeBlock";Q6.defaultProps={text:"",showLineNumbers:!0,wrapLongLines:!1,startingLineNumber:1,language:pne,theme:{},highlight:"",lineNumberContainerStyle:{},customStyle:{},codeBlockStyle:{}};var hGe=AWe(Q6);nb.button` - position: absolute; - top: 0.5em; - right: 0.75em; - display: flex; - flex-wrap: wrap; - justify-content: center; - align-items: center; - background: ${e=>e.theme.backgroundColor}; - margin-top: 0.15rem; - border-radius: 0.25rem; - max-height: 2rem; - max-width: 2rem; - padding: 0.25rem; - &:hover { - opacity: ${e=>e.copied?1:.5}; - } - &:focus { - outline: none; - opacity: 1; - } - .icon { - width: 1rem; - height: 1rem; - } -`;nb.div` - position: relative; - background: ${e=>e.theme.backgroundColor}; - border-radius: 0.25rem; - padding: ${e=>e.codeBlock?"0.25rem 0.5rem 0.25rem 0.25rem":"0.25rem"}; -`;nb.div` - position: relative; - width: ${({width:e})=>e||"auto"}; - max-width: 100%; - padding: 8pt; - padding-right: calc(2 * 16pt); - color: ${({style:e})=>e.color}; - background-color: ${({style:e})=>e.bgColor}; - border: 1px solid ${({style:e})=>e.border}; - border-radius: 5px; - pre { - margin: 0; - padding: 0; - border: none; - background-color: transparent; - color: ${({style:e})=>e.color}; - font-size: 0.8125rem; - } - pre::before { - content: '$ '; - user-select: none; - } - pre :global(*) { - margin: 0; - padding: 0; - font-size: inherit; - color: inherit; - } - .copy { - position: absolute; - right: 0; - top: -2px; - transform: translateY(50%); - background-color: ${({style:e})=>e.bgColor}; - display: inline-flex; - justify-content: center; - align-items: center; - width: calc(2 * 16pt); - color: inherit; - transition: opacity 0.2s ease 0s; - border-radius: 5px; - cursor: pointer; - user-select: none; - } - .copy:hover { - opacity: 0.7; - } -`;var gGe={lineNumberColor:"#c5c8c6",lineNumberBgColor:"#1d1f21",backgroundColor:"#1d1f21",textColor:"#c5c8c6",substringColor:"#c5c8c6",keywordColor:"#b294bb",attributeColor:"#f0c674",selectorAttributeColor:"#b294bb",docTagColor:"#c5c8c6",nameColor:"#cc6666",builtInColor:"#de935f",literalColor:"#de935f",bulletColor:"#b5bd68",codeColor:"#c5c8c6",additionColor:"#b5bd68",regexpColor:"#cc6666",symbolColor:"#b5bd68",variableColor:"#cc6666",templateVariableColor:"#cc6666",linkColor:"#de935f",selectorClassColor:"#cc6666",typeColor:"#de935f",stringColor:"#b5bd68",selectorIdColor:"#cc6666",quoteColor:"#969896",templateTagColor:"#c5c8c6",deletionColor:"#cc6666",titleColor:"#81a2be",sectionColor:"#81a2be",commentColor:"#969896",metaKeywordColor:"#c5c8c6",metaColor:"#de935f",functionColor:"#c5c8c6",numberColor:"#de935f"},yGe={lineNumberColor:"#4d4d4c",lineNumberBgColor:"white",backgroundColor:"white",textColor:"#4d4d4c",substringColor:"#4d4d4c",keywordColor:"#8959a8",attributeColor:"#eab700",selectorAttributeColor:"#8959a8",docTagColor:"#4d4d4c",nameColor:"#c82829",builtInColor:"#f5871f",literalColor:"#f5871f",bulletColor:"#718c00",codeColor:"#4d4d4c",additionColor:"#718c00",regexpColor:"#c82829",symbolColor:"#718c00",variableColor:"#c82829",templateVariableColor:"#c82829",linkColor:"#f5871f",selectorClassColor:"#c82829",typeColor:"#f5871f",stringColor:"#718c00",selectorIdColor:"#c82829",quoteColor:"#8e908c",templateTagColor:"#4d4d4c",deletionColor:"#c82829",titleColor:"#4271ae",sectionColor:"#4271ae",commentColor:"#8e908c",metaKeywordColor:"#4d4d4c",metaColor:"#f5871f",functionColor:"#4d4d4c",numberColor:"#f5871f"};const af=A.memo(e=>{const{children:t,className:n,codeBlockProps:r,hideTools:s,trackEvent:o,translations:a,codeBlockStyles:i,...c}=e,{language:u="text",showLineNumbers:f,text:m,theme:p,wrapLongLines:h,...g}=r,{colorScheme:y}=Ss(),x=d.useMemo(()=>{let w;return p?w=p:(w=y==="dark"?gGe:yGe,w.backgroundColor="transparent",w.lineNumberBgColor="transparent"),w},[y,p]),v=z("codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded-lg font-mono text-sm font-normal",n),b=d.useCallback(()=>{navigator.clipboard.writeText(String(t)),o?.("click code block copy",{language:u??"text"})},[t,u,o]),_=d.useMemo(()=>({"--scrollbar-thumb":"oklch(var(--foreground-color) / 0.15)","--scrollbar-track":"transparent",scrollbarWidth:"thin",scrollbarColor:"var(--scrollbar-thumb) var(--scrollbar-track)",...i}),[i]);return l.jsxs("div",{className:v,...c,children:[l.jsx("div",{className:z("translate-y-xs -translate-x-xs bottom-xl mb-xl","flex h-0 items-start justify-end","sm:sticky sm:top-xs"),children:!s&&l.jsx(K,{variant:"background",className:"overflow-hidden rounded-full",children:l.jsx(K,{variant:"subtler",children:l.jsx(st,{icon:B("copy"),size:"small",pill:!0,clickFeedback:!0,onClick:b,testId:"copy-code-button",ariaLabel:a?.copy,toolTip:a?.copy})})})}),l.jsxs("div",{className:"-mt-xl",children:[u&&!s&&l.jsx("div",{children:l.jsx("div",{"data-testid":"code-language-indicator",className:"text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-lg text-xs font-thin",children:u})}),l.jsx("div",{children:l.jsx(hGe,{as:void 0,forwardedAs:void 0,language:u,showLineNumbers:!1,text:String(t),theme:x,wrapLongLines:!0,customStyle:_,...g})})]})]})});af.displayName="CodeBlock";const hne=A.memo(({step:e,action:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),{final:o,status:a,script:i,output:c,stdout:u}=e.content,f=!o,m=a==="generating"||a==="executing",p=d.useCallback(()=>{s(x=>!x)},[]),h=u&&c?u+` -`+c:u||c||"",g=d.useMemo(()=>({language:"python"}),[]),y=!!i;return l.jsxs("div",{children:[l.jsx(Ge,{onClick:p,text:t,icon:B("message-circle-code"),isLoading:f,size:"tiny",pill:!0,chevron:y,chevronIcon:r?B("chevron-up"):B("chevron-down")}),l.jsx(St,{children:r&&y&&l.jsxs(Te.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:"easeIn",duration:.15}},className:"mb-sm space-y-sm",children:[l.jsx(af,{className:"text-xs",codeBlockProps:g,children:i}),!m&&l.jsxs(Te.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:"easeIn",duration:.15}},children:[l.jsx(V,{variant:"tiny",color:"light",children:n(h?{defaultMessage:"Output",id:"fio5opLcOZ"}:{defaultMessage:"This code did not produce an output",id:"UgqMuAXFKs"})}),a!=="error"&&h&&l.jsx(af,{className:z("scrollbar-subtle max-h-[220px] overflow-y-auto text-xs",a==="success"),codeBlockProps:g,children:h})]})]})})]})});hne.displayName="CodeStep";const gne=A.memo(({asset:e})=>{const{isCanvasOpen:t,canvasState:n}=Yf(),r=d.useMemo(()=>t&&e.uuid===n?.assetUuid,[e.uuid,n?.assetUuid,t]),{title:s,description:o,Icon:a}=v6(e),i=gJ({asset:e}),c=d.useCallback(async()=>{i()},[i]);return l.jsxs(K,{onClick:c,role:"button",tabIndex:0,variant:Wx.subtler,className:z("flex w-fit items-center rounded-lg p-1.5",r&&"ring-super !ring-1"),children:[l.jsx(K,{variant:"super",className:"m-1 flex size-8 items-center justify-center rounded-md p-2",children:l.jsx(ge,{icon:a,size:"md",className:"text-inverse"})}),l.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[l.jsx(V,{variant:"small",color:"default",className:"!font-display !text-[0.8125rem] font-medium",children:s}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"!font-display !text-[0.6875rem] leading-none",children:o})]})]})},({asset:e,...t},{asset:n,...r})=>Un(t,r)&&Cr(e,n));gne.displayName="AssetToken";const yne=A.memo(({screenshot_uuid:e,screenshots:t})=>{const{taskScreenshots:n}=Qn(),r=n[e??""],o=(r?.length?r:t)?.[0];return o?l.jsx(xGe,{src:o,alt:"Browser screenshot",includeLightBoxModal:!0,containerClassName:"relative -mt-1.5 max-w-60 w-full rounded-lg overflow-hidden after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-1 after:ring-inset after:ring-subtlest hover:shadow hover:after:ring-subtler transition-all duration-100",imageClassName:"object-cover w-full text-[0] dark:mix-blend-normal",maskClassName:"bg-subtler"}):null}),xGe=({containerClassName:e,enableRetry:t,...n})=>{const r=d.useRef(1),[s,o]=d.useState(n.src),[a,i]=d.useState(!1),c=d.useCallback(()=>{const u=vGe(n.src);!u||r.current>4||(u.searchParams.set("attempt",String(r.current)),r.current+=1,setTimeout(()=>o(u.toString()),300))},[n.src,r]);return l.jsx(Wo,{containerClassName:z(e,{"opacity-0":!a}),alt:"Browser screenshot",...n,src:s,onFail:t?c:void 0,onLoad:()=>i(!0)},s)},vGe=e=>{if(e)try{return new URL(e)}catch{return}};yne.displayName="ScreenshotStep";const xne=A.memo(({step:e,action:t})=>{const{final:n,file_name:r,page_count:s,word_count:o}=e.content,a=!n;let i=t;return r&&n&&(i=r,s!=null?(i+=` (${s} pages`,o!=null&&(i+=`, ${o} words`),i+=")"):o!=null&&(i+=` (${o} words)`)),l.jsx(Ge,{text:t,icon:B("file-type-docx"),isLoading:a,size:"tiny",pill:!0,toolTip:i,tooltipLayout:"top"})});xne.displayName="DocxStep";const vne=A.memo(({status:e})=>{const{$t:t}=J();let n=B("circle-check-filled"),r=t({defaultMessage:"Done",id:"JXdbo8Vnlw"});switch(e){case"SENT":n=B("circle-check-filled"),r=t({defaultMessage:"Email sent",id:"as7ksh6tP3"});break;case"FORWARDED":n=B("mail-forward"),r=t({defaultMessage:"Email forwarded",id:"QUWo2L2sfE"});break;case"REJECTED":n=B("x"),r=t({defaultMessage:"Email rejected",id:"+469cQAaqI"});break;default:n=B("circle-check-filled"),r=t({defaultMessage:"Done",id:"JXdbo8Vnlw"});break}return l.jsx(Rr,{icon:n,iconClassName:"text-super",text:r})});vne.displayName="EmailStatusStep";const bne=A.memo(({onClick:e,urls:t})=>{const n=d.useMemo(()=>t.map(r=>l.jsx(_ne,{url:r,onClick:e},r)),[e,t]);return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(Zf,{items:n,initialDisplayCount:1})})});bne.displayName="GeneratedVideoResultsStep";const _ne=A.memo(({url:e,onClick:t})=>{const n=d.useCallback(()=>{t?.(e)},[e,t]);return l.jsx(yt,{className:"block",href:e,target:"_blank",rel:"noopener nofollow",onClick:n,children:l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs rounded-lg pl-1.5 pr-2.5",children:l.jsx(ya,{variant:"tinyMono",className:"!text-[0.7rem]",url:e,isAttachment:!1,connectionType:Zn.GENERATED_VIDEO,source:"Generated Video"})})},e)});_ne.displayName="LinkFactory";const wne=A.memo(({prompt:e,success:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),[o,a]=d.useState(!1),i=d.useRef(null);d.useLayoutEffect(()=>{const m=i.current;m&&!r&&a(m.scrollHeight>m.clientHeight)},[e,r]);const c=d.useCallback(()=>{s(m=>!m)},[]);if(!e)return null;const u=o||r,f=t===!1;return l.jsxs("div",{className:z("rounded-lg p-3",f?"bg-caution/10":"bg-subtler",u&&"cursor-pointer"),onClick:u?c:void 0,children:[l.jsx("div",{ref:i,className:z("text-default text-sm leading-relaxed",!r&&"line-clamp-2"),children:e}),u&&l.jsxs("button",{className:"text-light hover:text-default mt-2 flex items-center gap-0.5 text-xs",onClick:m=>{m.stopPropagation(),c()},children:[n(r?{defaultMessage:"Show less",id:"qyJtWyZ0yt"}:{defaultMessage:"Show more",id:"aWpBzjCXKS"}),l.jsx(ge,{icon:r?B("chevron-up"):B("chevron-down"),size:"xs"})]})]})});wne.displayName="GenerateImageStep";const JE=A.memo(({color:e,title:t})=>{const n="bg-[#13343B] dark:bg-[#F5F5F5]",s=(o=>o?{red:"bg-[#C0152F] dark:bg-[#FF5459]",maroon:"bg-[#944454] dark:bg-[#B3C901]",orange:"bg-[#DB7100] dark:bg-[#FFAB44]",teal:"bg-[#21808D] dark:bg-[#32B8C6]",grey:n,brown:"bg-[#A84B2F] dark:bg-[#E68161]",green:"bg-[#848456] dark:bg-[#B4B662]",gold:"bg-[#D39900] dark:bg-[#F0B435]",purple:"bg-[#865D95] dark:bg-[#C48ED8]",blue:"bg-[#19789E] dark:bg-[#54B4E3]"}[o]??n:n)(e);return l.jsx("div",{className:z("py-xs w-fit rounded-md px-2.5",s),children:l.jsx(V,{className:"translate-y-half",variant:"tiny",color:"defaultInverted",children:t})})});JE.displayName="GroupingTabsStep";function Cne(e){return JSON.stringify(e,null,2)}const bGe=(e,t=1e4,{showTruncationIndicator:n=!0,format:r=!1}={})=>{if(e.length<=t)return r?Sne(e):e;let s=t;const o=Math.max(0,t-100);for(let c=t-1;c>=o;c--){const u=e[c];if(u===","||u===` -`||u===" "||u===" "){s=c;break}}const a=e.substring(0,s).trim(),i=r?_Ge(e,a):a;if(n){const c=` - -// Content truncated at ${s} characters (original: ${e.length} chars)`;return i+c}return i};function Sne(e){try{return Cne(JSON.parse(e))}catch{return e}}function _Ge(e,t){const n=Sne(e),r=t.replace(/\s/g,"").length;let s=0,o=n;for(let i=0;i=0;i--)if(o[i]===a){o=o.substring(0,i+1);break}return o}const wGe={language:"json"},CGe=2e3,ek=({content:e,title:t,maxContentLength:n=CGe,truncationOptions:r={showTruncationIndicator:!1,format:!0},className:s,isError:o=!1,showTruncationMessage:a=!0})=>{const{formatNumber:i}=J(),{processedContent:c,originalLength:u}=d.useMemo(()=>{if(typeof e=="string")return{processedContent:bGe(e,n,r),originalLength:e.length};if(e&&typeof e=="object"){const p=Cne(e);return{processedContent:p,originalLength:p.length}}const m=String(e);return{processedContent:m,originalLength:m.length}},[e,n,r]),f=u>n;return l.jsxs(K,{className:z("rounded-lg",s),variant:"subtler",children:[l.jsx(V,{variant:"tiny",className:z("p-md pb-0",o&&"text-negative"),children:t}),l.jsx(af,{className:"p-sm !my-0 pt-0 text-xs",codeBlockProps:wGe,hideTools:!0,children:c||"No content"}),a&&f&&l.jsx("div",{className:"bg-subtler flex items-center justify-center rounded-b p-2",children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(je,{defaultMessage:"Content truncated at {truncatedSize} (original size: {originalSize})",id:"ipA00V5aGw",values:{truncatedSize:i(n/1024,{maximumFractionDigits:0,style:"unit",unit:"kilobyte",unitDisplay:"narrow"}),originalSize:i(u/1024,{maximumFractionDigits:0,style:"unit",unit:"kilobyte",unitDisplay:"narrow"})}})})})]})},Iw="clicked enterprise ad",Pw="https://www.perplexity.ai/enterprise",SGe=()=>{const{session:e}=Ne(),{trackEvent:t}=Xe(e),n=Rn(),r=d.useCallback(async h=>{h?.preventDefault(),t(Iw,{source:"settingsHeader"}),n.push(Pw)},[t,n]),s=d.useCallback(async h=>{h.preventDefault(),t(Iw,{source:"pricingTable"}),n.push(Pw)},[t,n]),o=d.useCallback(async h=>{h.preventDefault(),t(Iw,{source:"paywall"}),n.push(Pw)},[t,n]),a=d.useCallback(({orgName:h,success:g})=>{t("org created",{orgName:h,success:g})},[t]),i=d.useCallback(({invitedEmail:h,source:g,orgUUID:y,inviteType:x})=>{t("org user invited",{invitedEmail:h,source:g,orgUUID:y,inviteType:x})},[t]),c=d.useCallback(({invitedEmails:h,inviteCount:g,successCount:y,failureCount:x,source:v,orgUUID:b,inviteType:_})=>{t("org users bulk invited",{invitedEmails:h,inviteCount:g,successCount:y,failureCount:x,source:v,orgUUID:b,inviteType:_})},[t]),u=d.useCallback(({orgUUID:h})=>{t("org invite step completed",{orgUUID:h})},[t]),f=d.useCallback(({orgUUID:h,source:g,intent:y,success:x})=>t("org payment portal entered",{orgUUID:h,source:g,intent:y,success:x}),[t]),m=d.useCallback(({orgUUID:h,success:g})=>{t("sso enabled",{orgUUID:h,success:g})},[t]),p=d.useCallback(h=>{t("mcp tool action",h)},[t]);return d.useMemo(()=>({handleSettingsHeaderAdClick:r,handlePricingTableAdClick:s,handlePaywallAdClick:o,trackOrgCreated:a,trackOrgUserInvited:i,trackOrgUsersBulkInvited:c,trackOrgInviteStepCompleted:u,trackOrgPaymentPortalEntered:f,trackSSOEnabled:m,trackMcpToolApprovalAction:p}),[o,s,r,a,u,f,i,c,m,p])},Ene=A.memo(({appName:e,appLogo:t,step:n,isFinished:r,onApprove:s,onActionTaken:o})=>{const{$t:a}=J(),[i,c]=d.useState(!1),{isMobileStyle:u,isMobileUserAgent:f}=Re(),[m,p]=d.useState(!1),[h,g]=d.useState(""),[y,x]=d.useState(null),v=uee(),{trackMcpToolApprovalAction:b}=SGe(),_=n.content.tool_input_summary||a({defaultMessage:"This tool will perform an action",id:"m3EA/HeMzd"}),w=n.content,S=n.mcp_tool_output_content,C=w.request_user_approval?.uuid,E=v.isPending,T=E||r||!!y,k=d.useCallback(()=>{x(null)},[]),I=d.useCallback(F=>{if(C){if(F==="MODIFY"){p(!0);return}b({toolName:w.tool_name||"unknown_tool",appName:w.app||"unknown_app",entryUUID:C||"unknown_uuid",action:F}),x(F),v.mutate({uuid:C,allowToolCall:F},{onSuccess:()=>{o?.(),s?.()},onError:()=>{k()}})}},[C,v,k,w,b,s,o]),M=d.useCallback(()=>{!C||!h.trim()||(x("MODIFY"),b({toolName:w.tool_name||"unknown_tool",appName:w.app||"unknown_app",entryUUID:C||"unknown_uuid",action:"MODIFY"}),v.mutate({uuid:C,allowToolCall:"MODIFY",userRevision:h},{onSuccess:()=>{o?.()},onError:()=>{k()}}))},[C,h,v,k,w,b,o]),N=d.useCallback(()=>{p(!1),g(""),x(null)},[]),D=w.data_is_redacted===!0||S?.data_is_redacted===!0,j=d.useCallback(()=>{D||c(F=>!F)},[D]);return l.jsxs(K,{className:"p-sm group-hover:bg-background grid grid-cols-[max-content_1fr] gap-x-2 gap-y-1 rounded-lg border pb-7 pl-4",variant:"raised",children:[l.jsxs("div",{className:z("col-span-full grid grid-cols-subgrid items-center",{"cursor-pointer":!D}),onClick:j,children:[t&&l.jsx("img",{src:t,alt:`${w.app} Logo`,className:"size-4 rounded object-cover"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"smallBold",children:e}),!D&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:l.jsx(st,{size:"small",pill:!0,icon:i?B("chevron-down"):B("chevron-right")})})]})]}),l.jsxs("div",{className:"col-start-2 col-end-3 flex min-w-0 flex-col",children:[l.jsx(V,{variant:"small",className:"text-pretty sm:pr-8",children:_}),l.jsx(Rne,{isExpanded:i,mcpContent:w,mcpOutputContent:S}),l.jsx(pi,{mode:"popLayout",initial:!1,transition:{duration:.2,ease:Kr},children:m&&l.jsx(Oo,{children:l.jsx(hu,{value:h,onChange:g,placeholder:a({defaultMessage:"What would you like to change?",id:"VkWAi878bt"}),isMobileStyle:u,isMobileUserAgent:f,disabled:E,minRows:3,className:"mt-4"})})}),l.jsx(K,{className:"mt-4 flex items-center gap-2",children:m?l.jsxs(l.Fragment,{children:[l.jsx(Ge,{variant:"inverted",size:"small",text:a({defaultMessage:"Continue",id:"acrOozm08x"}),onClick:M,disabled:T||!h.trim()}),l.jsx(Ge,{variant:"border",size:"small",text:a({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:N,disabled:E,extraCSS:"bg-transparent"})]}):l.jsxs(l.Fragment,{children:[l.jsx(Ge,{variant:"inverted",size:"small",text:a({defaultMessage:"Approve",id:"WCaf5CZSTt"}),onClick:()=>I("ALLOW"),disabled:T}),l.jsx(Ge,{variant:"common",size:"small",text:a({defaultMessage:"Refine",id:"EBZvikr2Av"}),onClick:()=>I("MODIFY"),disabled:T}),l.jsx(Ge,{variant:"border",size:"small",text:a({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:()=>I("DENY"),disabled:T,extraCSS:"ml-auto border-none bg-transparent mr-2"})]})})]})]})});Ene.displayName="McpToolApprovalStep";const kne=A.memo(({tool_logo_url:e,app:t,merge_extra_args:n,step_uuid:r,backend_uuid:s})=>{const{$t:o}=J(),a=rCe(t||""),i=d.useCallback(async()=>{await JH({uuid:r,success:!1,reason:"User skipped authentication"})},[r]),c=d.useMemo(()=>({name:"mcp_connector_auth",upsell_type:"CONNECT_TO_CONNECTOR",app_location:"UPSELL_APP_LOCATION_UNSPECIFIED",title:o({defaultMessage:"Connect your {appName} account",id:"YPjv1DRLLL"},{appName:a}),description:o({defaultMessage:"Connect your {appName} account to get started",id:"MtMLxu8Eaj"},{appName:a}),cta:"MERGE_AUTH_CONNECTOR",icon_reference:a,...e&&{icon_image:{url:e,alt:a}},button_color:"INVERTED",button_text:"Connect",cta_information:{merge_auth_token:n?.auth_info?.auth_token,merge_auth_callback_uuid:r},show_in_comet:!0,is_persistent:!0,backend_uuid:s,image_asset:"",image_asset_low_res:"",image_asset_dark:"",image_asset_low_res_dark:"",background_super:!1,event_metadata:void 0,upsell_uuid:crypto.randomUUID(),ui_type:"BANNER_WITH_BUTTONS",action_cards:[]}),[a,s,e,o,n?.auth_info?.auth_token,r]);return l.jsx(Jd,{position:"router_steps",upsellInformation:c,backendUuid:s,isLastResult:!0,hideOnAccept:!1,hideOnReject:!1,onReject:i})});kne.displayName="UnauthenticatedMcpToolInput";const EGe={language:"json"},Mne=A.memo(e=>{const{tool_args:t,tool_name:n}=e,[r,s]=d.useState(!1),o=d.useCallback(()=>s(a=>!a),[]);return l.jsx(K,{className:"border-subtlest p-sm rounded-lg border",children:!!(t&&typeof t=="object"&&t!==null)&&l.jsxs(K,{className:"border-subtlest p-sm rounded-lg border",children:[l.jsxs(K,{className:"flex items-center justify-between",children:[l.jsx(V,{variant:"smallMono",children:n}),l.jsx(st,{size:"small",icon:r?B("chevron-down"):B("chevron-right"),onClick:o})]}),l.jsx(pi,{mode:"popLayout",transition:{duration:.2,ease:Kr},children:r&&l.jsx(Oo,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15,ease:Kr},children:l.jsxs(K,{className:"mt-sm rounded-lg",variant:"subtler",children:[l.jsx(V,{variant:"tiny",className:"p-md pb-0",children:l.jsx(je,{defaultMessage:"Request",id:"p1P+hQq6tY"})}),l.jsx(af,{className:"scrollbar-subtle my-0 max-h-[200px] overflow-y-auto text-xs",codeBlockProps:EGe,hideTools:!0,children:t&&typeof t=="object"?JSON.stringify(t):"No instructions"})]})})})]})})});Mne.displayName="AuthenticatedMcpToolInput";const Tne=A.memo(e=>{const{authenticated:t}=e;return t?l.jsx(Mne,{...e}):l.jsx(kne,{...e})});Tne.displayName="McpToolInput";const kGe=()=>{const{variation:e}=HV(!1),{mcpStdioServers:t}=Qn(),r=Kge()?.local_mcp.call===!0;return(An()?e:r)&&t!==void 0},MGe=({permission:e,connectorName:t})=>{const{$t:n}=J();return d.useMemo(()=>{if(!e)return null;switch(e){case"full_disk_access":return{title:n({defaultMessage:"Comet needs full disk access",id:"KaK1awrgFQ"}),description:n(t?{defaultMessage:"To use this connector, Comet needs permission to access your disk. Enable it in System Settings.",id:"O9WzUyHg3f"}:{defaultMessage:"To use all your connectors, Comet needs permission to access your disk. Enable it in System Settings.",id:"xusC3M5hQD"}),videoUrl:"https://r2cdn.perplexity.ai/comet/toggle-permission.mp4",tooltipTitle:n({defaultMessage:"Full disk access required",id:"ry8L5i2JdM"}),tooltipDescription:n({defaultMessage:"Turn on disk access in System Settings to use this connector",id:"zQpOIZuVrk"}),buttonText:n({defaultMessage:"Open System Settings",id:"U/a2e7uAwk"})};case"contacts":return{title:n({defaultMessage:"Comet needs access to your contacts",id:"Gh5VRh+h5k"}),description:n(t?{defaultMessage:"To use this connector, Comet needs permission to access your contacts.",id:"lbQ3o1etQa"}:{defaultMessage:"To use all your connectors, Comet needs permission to access your contacts.",id:"WgPxDUwZSj"}),videoUrl:"https://r2cdn.perplexity.ai/comet/toggle-permission.mp4",tooltipTitle:n({defaultMessage:"Contacts permission required",id:"QKFGSziMOF"}),tooltipDescription:n({defaultMessage:"Grant contacts permission to use this connector",id:"uMNpHxa2KQ"}),buttonText:n({defaultMessage:"Grant Access",id:"Xq5/HeHSIt"})};default:return null}},[n,t,e])},TGe=({connectorName:e,permission:t,cometAdapter:n})=>{const r=d.useMemo(()=>["comet/permission",t],[t]),s=ome({queryKey:r,queryFn:async()=>t?n.hasPermission(t):null}),o=Yt(),a=Rt({mutationKey:r,mutationFn:async()=>t?n.requestPermission(t):null,onSuccess:c=>{o.setQueryData(r,c)}}),i=MGe({permission:t,connectorName:e});return d.useMemo(()=>({renderData:oV(s)?i:null,isRequestingPermission:a.isPending,requestPermission:()=>a.mutateAsync()}),[s,a,i])},AGe=({cometAdapter:e,permissions:t})=>{const n=iM({queries:(t??[]).map(a=>({queryKey:["comet/permission",a],queryFn:()=>e.hasPermission(a)}))}).map(a=>({isFetching:a.isFetching,data:a.data})),s=d.useMemo(()=>{let a;return i=>(Un(a,i,Un)||(a=i),a)},[])(n);return d.useMemo(()=>{const a=s.findIndex(i=>oV(i));return t?.[a]??null},[t,s])},Ane=e=>{const{permission:t,connectorName:n,onDismiss:r}=e,s=un(),{$t:o}=J(),{renderData:a,isRequestingPermission:i,requestPermission:c}=TGe({permission:t,connectorName:n,cometAdapter:s});return a?l.jsxs(K,{variant:"subtler",className:"border-subtler flex justify-between gap-6 rounded-lg border p-6",children:[l.jsxs("div",{className:"flex flex-1 flex-col justify-center",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",as:"h3",className:"mb-1",children:a.title}),l.jsx(V,{variant:"small",color:"light",children:a.description})]}),l.jsxs("div",{className:"mt-5 flex gap-2",children:[l.jsx(wt,{variant:"primary",onClick:c,disabled:i,children:a.buttonText}),r&&l.jsx(wt,{variant:"secondary",onClick:r,children:o({defaultMessage:"Dismiss",id:"TDaF6JVgG6"})})]})]}),l.jsx("div",{className:"flex-1",children:l.jsx("video",{src:a.videoUrl,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,height:160,width:302,className:"rounded-lg"})})]}):null},NGe=e=>{const{permissions:t,className:n,connectorName:r,onDismiss:s}=e,o=un(),a=AGe({cometAdapter:o,permissions:t});return a?l.jsx("div",{className:n,children:l.jsx(Ane,{permission:a,connectorName:r,onDismiss:s})}):null},RGe=e=>{const{permissions:t,className:n,connectorName:r,onDismiss:s}=e;return l.jsx("div",{className:z("space-y-4",n),children:t.map(o=>l.jsx(Ane,{permission:o,connectorName:r,onDismiss:s},o))})},DGe=e=>{const{variant:t,...n}=e;return t==="first-required"?l.jsx(NGe,{...n}):l.jsx(RGe,{...n})},jGe=({cometAdapter:e,permissions:t})=>{const n=iM({queries:(t??[]).map(o=>({queryKey:["comet/permission",o],queryFn:()=>e.hasPermission(o)}))}).map(o=>({isFetching:o.isFetching,data:o.data})),s=d.useMemo(()=>{let o;return a=>(Un(o,a,Un)||(o=a),o)},[])(n);return d.useMemo(()=>!t||s.some(o=>o.isFetching)?null:s.every(o=>o.data!==!1),[s,t])},yP=[],IGe=({server:e,cometState:t,toolName:n})=>d.useMemo(()=>{if(!e)return null;if(!t.installedDxts)return yP;const r=dp(t.installedDxts,e);return r?Object.entries($z(r)).filter(([,{for_tools:s}])=>!s||n&&s.includes(n)).map(([s])=>s):yP},[e,t.installedDxts,n]),Mh=d.memo(()=>{const{$t:e}=J();return l.jsx(V,{variant:"micro",color:"super",className:"border-super inline-block rounded border px-1 py-0",children:e({id:"Hw1hSDsL+0",defaultMessage:"Premium data"})})});Mh.displayName="PremiumSourceLabel";const Nne=A.memo(({step:e,isFinished:t,onActionTaken:n})=>{const{lastResult:r}=on(),{submitQuery:s}=Ho(),[o,a]=d.useState(!1),i=e.content,c=e.mcp_tool_output_content,u=!o&&i.request_user_approval?.request_user_approval,f=!t&&u===!1&&!c,m=OGe({stepId:e.uuid,shouldExecuteLocalTool:f,mcpContent:i}),p=d.useMemo(()=>!!c?.should_rerun_query,[c]),h=d.useCallback(async()=>{r?.query_str&&(await au({entryUUID:r.backend_uuid,reason:"mcp-tool-output-merge-api"}),s({rawQuery:r.query_str,existingEntryUUID:r.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:r.frontend_context_uuid,promptSource:"user",querySource:"mcp-tool-input",attachments:[],modelPreferenceOverride:"pplx_pro",sourcesOverride:Fx(r.sources?.sources)}))},[s,r]);d.useEffect(()=>{p&&h()},[h,p]);const g=m?.name||i.app||"",y=m?.iconUrl||i.logo_url||xFe(i.app||"")||void 0;if(u&&m?.allPermissionsAreGranted!==!1)return l.jsx(Ene,{appName:g,appLogo:y,step:e,isFinished:t,onApprove:()=>a(!0),onActionTaken:n});const x=(!!m||i.authenticated)??null;return x===null?null:x?l.jsxs(l.Fragment,{children:[m?.askPermissionsBanner,l.jsx(PGe,{appLogo:y,appName:g,mcpContent:i,mcpOutputContent:c})]}):l.jsx(Tne,{...i,step_uuid:e.uuid??"",backend_uuid:r?.backend_uuid??"",authenticated:x,tool_args:i.tool_args,tool_logo_url:y??void 0})}),PGe=e=>{const{appLogo:t,appName:n,mcpContent:r,mcpOutputContent:s}=e,[o,a]=d.useState(!1),i=r.data_is_redacted===!0||s?.data_is_redacted===!0,c=Jh(r.source_type),u=d.useCallback(()=>{i||a(f=>!f)},[i]);return l.jsxs(K,{className:"p-sm hover:bg-raised grid grid-cols-[max-content_1fr] gap-x-2 rounded-lg border pl-4",variant:o?"raised":void 0,children:[l.jsxs("div",{className:z("col-span-full grid grid-cols-subgrid items-center",{"cursor-pointer":!i}),onClick:u,children:[l.jsx(Wz,{serverName:n,iconUrl:t,size:"sm"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"smallBold",children:n}),c&&l.jsx(Mh,{}),!i&&l.jsx("div",{className:"ml-auto flex items-center gap-2",children:l.jsx(st,{size:"small",pill:!0,icon:o?B("chevron-down"):B("chevron-right")})})]})]}),l.jsx("div",{className:"col-start-2 col-end-3 min-w-0",children:l.jsx(Rne,{isExpanded:o,mcpContent:r,mcpOutputContent:s})})]})},Rne=({isExpanded:e,mcpContent:t,mcpOutputContent:n})=>l.jsx(pi,{mode:"popLayout",initial:!1,transition:{duration:.2,ease:Kr},children:e&&l.jsx(Oo,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15,ease:Kr},children:l.jsx("div",{className:"mt-sm",children:l.jsx(Ng,{maxHeight:400,autoScroll:!1,scrollContainerClassName:"scrollbar-subtle !pl-0",showTopGradient:!1,showBottomGradient:!1,children:l.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[l.jsx(V,{variant:"tinyMono",children:t.tool_name}),!!(t.tool_args&&typeof t.tool_args=="object"&&t.tool_args!==null)&&l.jsx(ek,{title:l.jsx(je,{defaultMessage:"Request",id:"J+m4xH5bwC",description:"Request"}),content:t.tool_args,showTruncationMessage:!1}),n&&l.jsx(ek,{title:l.jsx(je,{defaultMessage:"Response",id:"UC/2Eq4W+h",description:"Response"}),content:n.content})]})})})})}),OGe=({stepId:e,shouldExecuteLocalTool:t,mcpContent:{app:n,mcp_server_type:r,tool_name:s,tool_args:o}})=>{const a=Qn(),i=kGe(),c=un(),u=l0e(),f=d.useMemo(()=>{if(!(!i||r!=="MCP_SERVER_TYPE_LOCAL"||!n))return a.mcpStdioServers?.find(w=>w.name===n)},[i,r,n,a.mcpStdioServers]),m=IGe({server:f,cometState:a,toolName:s}),p=jGe({cometAdapter:c,permissions:m}),{mutateAsync:h}=Rt({mutationKey:["comet/execute-local-tool",e],mutationFn:async({content:w,isError:S=!1})=>{if(!e)throw new Error("StepID is not set");return de.POST("/rest/sse/perplexity_mcp_response","local-mcp-step",{body:{result:{content:w,is_error:S,uuid:e}}})}}),g=d.useCallback(()=>{h({content:'The MCP tool call was rejected by the user because he dismissed the permission request (refer to them as "you" or use the appropriate equivalent in their language when mentioning this)'})},[h]),y=!!(t&&n&&s&&e&&p);mt({queryKey:be.makeQueryKey("comet/auto-execute-local-tool",e),enabled:y,queryFn:async()=>{if(!n||!s||!e)throw new Error("Missing required parameters");try{const w=await u.callMcpTool({mcpServerName:n,toolName:s,toolArgs:o},{step_uuid:e});return await h({content:w.content.map(S=>S.text).filter(Boolean).join(` - -`)}),!0}catch(w){return await h({content:`The MCP tool call failed: ${w instanceof Error?w.message:"Unknown error"}`,isError:!0}),!1}}});const x=d.useMemo(()=>f?dp(a.installedDxts,f):null,[a.installedDxts,f]),v=x?.display_name??x?.name??n,{data:b}=z4(),_=d.useMemo(()=>f?Gz(b,f):null,[b,f]);return d.useMemo(()=>v?{name:v,iconUrl:_??null,allPermissionsAreGranted:p,askPermissionsBanner:t&&!p&&m?l.jsx(DGe,{variant:"all",connectorName:v,permissions:m,className:"mb-4",onDismiss:g}):null}:null,[p,v,g,_,m,t])};Nne.displayName="McpInputOutputStep";const Dne=A.memo(e=>{const{content:t,shouldRerunQuery:n=!1}=e,{lastResult:r}=on(),{submitQuery:s}=Ho(),o=d.useCallback(async()=>{r?.query_str&&(await au({entryUUID:r.backend_uuid,reason:"mcp-tool-output-merge-api"}),s({rawQuery:r.query_str,existingEntryUUID:r.backend_uuid,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:r.frontend_context_uuid,promptSource:"user",querySource:"mcp-tool-input",attachments:[],modelPreferenceOverride:"pplx_pro"}))},[s,r]);return d.useEffect(()=>{n&&o()},[o,n]),l.jsx(K,{className:"border-subtlest p-sm rounded-lg border",children:l.jsx(ek,{title:l.jsx(je,{defaultMessage:"Response",id:"MgdnPiJHcj"}),content:t})})});Dne.displayName="McpToolOutput";const jne=A.memo(({step:e,action:t})=>{const{final:n}=e.content,r=!n;return l.jsx(Ge,{text:t,icon:B("file-type-pdf"),isLoading:r,size:"tiny",pill:!0})});jne.displayName="PdfStep";const xP=["start","end"],Ine=A.memo(({attachments:e,attachmentProcessingProgress:t})=>{const{$t:n}=J(),s=e.filter(m=>_d(m)).length+t.length,o=e.length+xP.length,a=Math.min(s/o*100,100),i=t.filter(m=>!m.success),c=d.useMemo(()=>!!t.filter(m=>m.file_url==="end").length,[t]),u=d.useCallback(m=>{const p=cu(m.file_url??"");let h;switch(m.error_code){case"token_limit_exceeded":h=n({defaultMessage:"{filename} exceeds the model's token limit.",id:"60iyTByOrX"},{filename:p});break;case"file_type_not_supported":h=n({defaultMessage:"{filename} is of an unsupported file type. It will not be included in the results.",id:"sB9AI6thAL"},{filename:p});break;case"no_data_received":h=n({defaultMessage:"{filename} has timed out.",id:"/wyRgEWdz7"},{filename:p});break;default:h=n({defaultMessage:"{filename} could not be read. It will not be included in the results.",id:"7w0MjjvHs3"},{filename:p});break}return h},[n]),f=d.useMemo(()=>{const m=i.map((h,g)=>l.jsx(tk,{icon:B("exclamation-circle"),text:u(h)},g)),p=l.jsx(tk,{icon:B("check"),text:n({defaultMessage:"Successfully read {numAttachments} attached files.",id:"5VxFwE1ux3"},{numAttachments:s-i.length-xP.length})});return[...m,...c?[p]:[]]},[i,n,s,c,u]);return l.jsx(Qf,{className:"pt-md pb-xs px-xs !border-[#32B8C6]",children:l.jsx(Ng,{maxHeight:250,autoScroll:!1,children:l.jsxs("div",{className:"pr-md gap-x-md flex w-full",children:[l.jsx(V,{className:"bg-super flex size-8 flex-none items-center justify-center rounded-md border-[0.75px] border-[#05FFFF]/20 shadow-[0px_1px_4px_0px_rgba(0,0,0,0.24)]",children:l.jsx(ge,{icon:B("paperclip"),size:"md",className:"text-inverse"})}),l.jsxs("div",{className:"gap-y-xs flex grow flex-col",children:[l.jsx(V,{variant:"smallBold",children:n({defaultMessage:"Reading {numAttachments} attached {numAttachments, plural, one {file} other {files}}",id:"BqiTCbmvgp"},{numAttachments:e.length})}),l.jsx("div",{className:"h-2 w-full rounded-[37px] bg-[#60584D]/[0.06]",children:l.jsx("div",{className:"h-2 rounded-[37px] bg-[#32B8C6] transition-all duration-300",style:{width:`${a}%`}})}),l.jsxs("div",{className:"pt-xs",children:[l.jsx(Zf,{items:f,vertical:!0,truncate:!1}),!c&&l.jsx(br,{variant:"super",active:!c,as:"span",className:"pt-xs",children:l.jsx(V,{variant:"small",color:"super",children:n({defaultMessage:"Reading...",id:"IvE1kfOWAz"})})})]})]})]})})})});Ine.displayName="PendingFilesStep";const tk=A.memo(({icon:e,text:t})=>l.jsxs("div",{className:"py-xs gap-x-sm flex",children:[l.jsx(V,{className:"flex items-center justify-center",children:l.jsx(rn,{icon:e,size:"small"})}),l.jsx(V,{variant:"small",color:"light",children:t})]}));tk.displayName="PendingFilesItem";const Pne=A.memo(({user:e,onRemove:t})=>{const n=d.useCallback(()=>{t(e)},[t,e]);return l.jsxs("div",{className:"border-subtlest gap-two pr-three flex h-8 items-center justify-between rounded-lg border pl-1.5 font-sans shadow-sm",children:[l.jsxs("div",{className:"gap-xs px-xs flex min-w-0 flex-row text-left",children:[l.jsx(V,{variant:"small",as:"span",children:e.display_name}),l.jsx(V,{variant:"small",color:"light",className:"truncate",as:"span",children:e.email_address})]}),l.jsx(st,{variant:"common",size:"tiny",onClick:n,icon:B("x"),extraCSS:"rounded-md","aria-label":`Remove ${e.display_name}`})]})});Pne.displayName="UserPill";const One=A.memo(({goalId:e,foundUsers:t,names:n,sendStepResult:r})=>{const{$t:s}=J(),[o,a]=d.useState([]),i=d.useRef(null);d.useEffect(()=>{i.current&&i.current.focus()},[]);const c=d.useCallback(y=>{const x=y.map(v=>({...v,selected:!0}));a(x)},[]),u=d.useCallback(async()=>{await r({goal_id:e,selected_users:o,submitted:!0},"User selected contacts and clicked continue",!1)},[e,o,r]),f=d.useCallback(y=>{Ls.isEnterKeyWithoutShift(y.nativeEvent)&&o.length>0&&(y.preventDefault(),u())},[o.length,u]),m=d.useMemo(()=>({chooseContacts:s({defaultMessage:"Confirm or change contacts",id:"j4L7Bt/R+D"}),moreContacts:s({defaultMessage:"More contacts...",id:"XqmjEIgTyk"}),pickContacts:s({defaultMessage:"Pick contacts...",id:"dAWwl8XInO"}),continue:s({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),skip:s({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[s]),p=d.useMemo(()=>(t??[]).map(y=>({type:"default",text:y.display_name??"",description:y.email_address??"",active:o.some(x=>x.email_address===y.email_address),preserveRightElementSpace:!0,onClick:()=>{const x=o.some(v=>v.email_address===y.email_address);c(x?o.filter(v=>v.email_address!==y.email_address):[...o,y])}})),[t,o,c]);d.useEffect(()=>{if(t&&t.length>0&&o.length===0){const y=t.filter(x=>x.selected);if(y.length>0)c(y);else{const x=Math.min(n?.length||1,t.length);c(t.slice(0,x))}}},[t]);const h=d.useCallback(y=>{c(o.filter(x=>x.email_address!==y.email_address))},[o,c]),g=d.useCallback(async()=>{await r({goal_id:e,selected_users:t,submitted:!1},"User clicked skip",!1)},[t,e,r]);return l.jsxs(dr,{ref:i,className:"py-2 pt-4 outline-none",onKeyDown:f,tabIndex:0,children:[l.jsxs("div",{className:"gap-md flex flex-col px-4",children:[l.jsx(V,{variant:"smallBold",children:m.chooseContacts}),l.jsxs("div",{className:"gap-sm flex flex-wrap items-stretch",children:[o.map(y=>l.jsx(Pne,{user:y,onRemove:h},y.email_address)),o.length<(t?.length??0)&&l.jsx(zs,{items:p,isMobileStyle:!1,placement:"bottom-start",children:l.jsx(Ge,{variant:"border",size:"small",icon:B("plus"),"aria-label":o.length===0?m.moreContacts:m.pickContacts})})]})]}),l.jsxs("div",{className:"gap-sm mt-4 flex items-center px-4 py-2",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:m.continue,disabled:o.length===0,onClick:u}),l.jsx(st,{size:"small",text:m.skip,onClick:g})]})]})});One.displayName="PickContactsStep";const Lne=A.memo(({stepUUID:e,goalId:t,foundBookingOptions:n,isSubmitted:r})=>{const{$t:s}=J(),[o,a]=d.useState(n?.[0]),[i,c]=d.useState(0),u=d.useRef(null),f=d.useRef([]),m=d.useMemo(()=>({title:s({defaultMessage:"Choose booking options",id:"5yyo9+Yhan"}),description:s({defaultMessage:"Select your preferred booking provider",id:"gnnwIHEPAG"}),continue:s({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),confirmed:s({defaultMessage:"Confirmed",id:"dX7+RvbH/9"}),skip:s({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[s]),p=d.useCallback(async()=>{await Qp({stepUUID:e,result:{goal_id:t,selected_booking_options:o,submitted:!0},reason:"User selected booking and clicked continue"})},[e,t,o]),h=d.useCallback(async()=>{await Qp({stepUUID:e,result:{goal_id:t,selected_booking_options:void 0,submitted:!1},reason:"User clicked skip"})},[t,e]),g=d.useCallback(v=>{a(v)},[]),y=d.useCallback(v=>{c(v)},[]),x=d.useCallback((v,b)=>{f.current[b]=v},[]);return d.useEffect(()=>{if(!n?.length||r)return;const v=_=>{const w=S=>{_.preventDefault(),c(C=>{const E=S==="down"?Math.min(C+1,n.length-1):Math.max(C-1,0);return f.current[E]?.focus(),E})};switch(_.key){case"ArrowDown":w("down");break;case"ArrowUp":w("up");break;case"Enter":case" ":_.preventDefault(),i>=0&&ib.removeEventListener("keydown",v)},[n,i,r]),l.jsxs(Qf,{className:"pb-2 outline-none",title:m.title,description:m.description,descriptionClassName:"text-quiet",children:[l.jsx("div",{className:"gap-md mt-md flex flex-col px-4",children:l.jsx("div",{ref:u,className:"gap-xs flex flex-col",tabIndex:-1,role:"listbox","aria-label":"Booking options",children:(n??[]).map((v,b)=>{const _=o===v,w=z("group flex w-full items-center rounded-none border outline-none transition-[border-color,border-radius,box-shadow] duration-200 hover:transition-none",!r&&"cursor-pointer","border-t-subtlest border-x-transparent","last:border-b-subtlest [&:not(:last-child)]:border-b-transparent",_&&["!border-super/75 dark:bg-black bg-gradient-to-r from-super/25 to-super/25 !rounded-lg shadow-sm"],!_&&!r&&["hover:!border-subtlest hover:bg-subtler hover:rounded-lg","focus-visible:!border-subtlest focus-visible:bg-subtler focus-visible:rounded-lg"],!r&&'[&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:border-t-transparent [&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:transition-none');return l.jsx("div",{ref:S=>x(S,b),tabIndex:r?-1:0,role:"option","aria-selected":_,"data-selected":_,className:w,onClick:()=>!r&&g(v),onFocus:()=>!r&&y(b),children:l.jsxs("div",{className:"flex w-full items-center justify-between px-5 py-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[v?.together?.airline_logos?.[0]&&l.jsx("img",{src:v.together.airline_logos[0],alt:"airline logo",className:"-mt-two size-6 rounded object-contain"}),l.jsx("div",{className:"flex flex-col items-start gap-px",children:l.jsxs(V,{variant:"baseSemi",children:[v?.together?.book_with||"Flight",v?.together?.option_title?` (${v.together.option_title})`:""]})})]}),v?.together?.price&&l.jsxs(V,{variant:"baseSemi",className:"font-bold",children:["$",v.together.price]})]})},b)})})}),l.jsxs("div",{className:"gap-sm mt-sm flex items-center px-4 py-2",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:r?m.confirmed:m.continue,icon:r?B("check"):void 0,disabled:!o||r,onClick:p}),l.jsx(st,{size:"small",text:m.skip,disabled:r,onClick:h})]})]})});Lne.displayName="PickFlightsBookingStep";const vP={weekday:"short",month:"short",day:"numeric",year:"numeric"},LGe={hour:"numeric",minute:"2-digit",hour12:!0},nk="en-US",bP=e=>{if(!e)return"00:00 AM";try{return new Date(e).toLocaleTimeString(nk,LGe).toUpperCase()}catch{return"00:00 AM"}},FGe=e=>{if(!e)return"";const t=Math.floor(e/60),n=e%60;return`${t}h ${n}m`},BGe=e=>{if(!e||e.length===0)return"Nonstop";const t=e.length;return`${t} Stop${t>1?"s":""}`},_P=e=>{if(!e||e.length===0)return null;if(e.length===1){const t=e[0]?.duration||0,n=Math.floor(t/60),r=t%60;return`${n}h ${r}m ${e[0]?.id}`}return e.map(t=>t.id).join(", ")},UGe=(e,t,n)=>{if(!e)return"";const s=new Date(e).toLocaleDateString(nk,vP);if(n==="ROUND_TRIP"&&t){const i=new Date(t).toLocaleDateString(nk,vP);return` · ${s} – ${i}`}return` · ${s}`},Fne=A.memo(({flight:e,index:t,isSelected:n,isSubmitted:r,onSelect:s,onFocus:o,setRef:a})=>{const i=e.flights?.[0]?.departure_airport?.time,c=e.flights?.[e.flights.length-1]?.arrival_airport?.time,u=e.flights?.[0]?.departure_airport?.id||"XXX",f=e.flights?.[e.flights.length-1]?.arrival_airport?.id||"XXX",m=e.flights?.[0]?.airline,p=z("group flex w-full items-center rounded-none border outline-none transition-[border-color,border-radius,box-shadow] duration-200 hover:transition-none",!r&&"cursor-pointer","border-t-subtlest border-x-transparent","last:border-b-subtlest [&:not(:last-child)]:border-b-transparent",n&&["!border-super/75 dark:bg-black bg-gradient-to-r from-super/25 to-super/25 !rounded-lg shadow-sm"],!n&&!r&&["hover:!border-subtlest hover:bg-subtler hover:rounded-lg","focus-visible:!border-subtlest focus-visible:bg-subtler focus-visible:rounded-lg"],!r&&'[&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:border-t-transparent [&:is(:hover,:focus-visible,[data-selected="true"])+div:not(:hover):not(:focus-visible):not([data-selected="true"])]:transition-none');return l.jsx("div",{ref:h=>a(h,t),tabIndex:r?-1:0,role:"option","aria-selected":n,"data-selected":n,className:p,onClick:()=>!r&&s(e),onFocus:()=>!r&&o(t),children:l.jsxs("div",{className:"grid w-full grid-cols-[auto_1fr_88px_88px_88px] items-start gap-6 px-5 py-4",children:[l.jsx("div",{className:"pt-two flex self-stretch",children:e.airline_logo&&l.jsx("img",{src:e.airline_logo,alt:"airline logo",className:"size-10 rounded object-contain"})}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx(V,{variant:"baseSemi",children:bP(i)}),l.jsx("span",{className:"text-quieter px-1",children:"–"}),l.jsx(V,{variant:"baseSemi",children:bP(c)})]}),m&&l.jsx(V,{variant:"tinyMono",color:"light",children:m})]}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsx(V,{variant:"baseSemi",children:FGe(e.total_duration)}),l.jsxs(V,{variant:"tinyMono",color:"light",children:[u,"–",f]})]}),l.jsxs("div",{className:"flex flex-col items-start gap-px",children:[l.jsx(V,{variant:"baseSemi",children:BGe(e.layovers)}),_P(e.layovers)&&l.jsx(V,{variant:"tinyMono",color:"light",children:_P(e.layovers)})]}),l.jsxs("div",{className:"flex flex-col items-end justify-end gap-px",children:[e.price&&l.jsxs(V,{variant:"baseSemi",className:"font-bold",children:["$",e.price]}),l.jsx(V,{variant:"tinyMono",color:"light",children:e.type})]})]})},`flight-${t}`)});Fne.displayName="FlightCard";const Bne=A.memo(({stepUUID:e,goalId:t,foundFlights:n,isSubmitted:r,outboundDate:s,returnDate:o,flightType:a})=>{const{$t:i}=J(),[c,u]=d.useState(n?.length>0?0:-1),[f,m]=d.useState(0),p=d.useRef(null),h=d.useRef([]),g=d.useMemo(()=>UGe(s,o,a),[s,o,a]),y=d.useMemo(()=>({title:i({defaultMessage:"Top departing flights",id:"tHwLRV4b68"})+g,description:i({defaultMessage:"Ranked by price and convenience. Prices include taxes and fees for one adult.",id:"cAxRMXuRMO"}),continue:i({defaultMessage:"Confirm",id:"N2IrpMDHDB"}),confirmed:i({defaultMessage:"Confirmed",id:"dX7+RvbH/9"}),skip:i({defaultMessage:"Skip",id:"/4tOwTiCH6"})}),[i,g]),x=d.useCallback(async()=>{const S=c>=0&&n?n[c]:void 0;await Qp({stepUUID:e,result:{goal_id:t,selected_flight:S,submitted:!0},reason:"User selected flight and clicked continue"})},[e,t,c,n]),v=d.useCallback(async()=>{await Qp({stepUUID:e,result:{goal_id:t,selected_flight:void 0,submitted:!1},reason:"User clicked skip"})},[t,e]),b=d.useCallback(S=>{const C=n?.findIndex(E=>E===S)??-1;u(C)},[n]),_=d.useCallback(S=>{m(S)},[]),w=d.useCallback((S,C)=>{h.current[C]=S},[]);return d.useEffect(()=>{if(!n?.length||r)return;const S=E=>{const T=k=>{E.preventDefault(),m(I=>{const M=k==="down"?Math.min(I+1,n.length-1):Math.max(I-1,0);return h.current[M]?.focus(),M})};switch(E.key){case"ArrowDown":T("down");break;case"ArrowUp":T("up");break;case"Enter":case" ":E.preventDefault(),f>=0&&fC.removeEventListener("keydown",S)},[n,f,r]),l.jsxs(Qf,{className:"pb-2 outline-none",title:y.title,description:y.description,descriptionClassName:"text-quiet",children:[l.jsx("div",{className:"gap-md mt-md flex flex-col px-4",children:l.jsx("div",{ref:p,className:"gap-xs flex flex-col",tabIndex:-1,role:"listbox","aria-label":"Flight options",children:(n??[]).map((S,C)=>l.jsx(Fne,{flight:S,index:C,isSelected:c===C,isSubmitted:r,onSelect:b,onFocus:_,setRef:w},C))})}),l.jsxs("div",{className:"gap-sm mt-sm flex items-center px-4 py-2",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:r?y.confirmed:y.continue,icon:r?B("check"):void 0,disabled:c<0||r,onClick:x}),l.jsx(st,{size:"small",text:y.skip,disabled:r,onClick:v})]})]})});Bne.displayName="PickFlightsSearchStep";const Une=d.memo(({children:e,defaultExpanded:t=!1,title:n})=>{const{$t:r}=J(),[s,o]=d.useState(t),a=d.useCallback(()=>{o(c=>!c)},[]),i=d.useMemo(()=>s?B("chevron-down"):B("chevron-right"),[s]);return l.jsx(pi,{className:"overflow-hidden",transition:{duration:.3,ease:Kr},children:l.jsxs("div",{children:[l.jsx(Ge,{variant:"common",text:n??r({defaultMessage:"Advanced",id:"3Rx6Qo1x+1"}),onClick:a,size:"tiny",icon:i,noPadding:!0,extraCSS:"!bg-transparent hover:!bg-subtler"}),l.jsx(Oo,{children:s&&l.jsx("div",{className:"pt-2",children:e})})]})})});Une.displayName="AutomationAdvancedSection";const VGe=[{value:"ONCE",label:"Once"},{value:"DAILY",label:"Daily"},{value:"WEEKLY",label:"Weekly"},{value:"WEEKDAYS",label:"Every weekday"},{value:"MONTHLY",label:"Monthly"},{value:"YEARLY",label:"Yearly"}],HGe=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],zGe=[...Array(31)].map((e,t)=>({value:String(t+1),label:String(t+1)})),WGe=[{value:"0",label:"January"},{value:"1",label:"February"},{value:"2",label:"March"},{value:"3",label:"April"},{value:"4",label:"May"},{value:"5",label:"June"},{value:"6",label:"July"},{value:"7",label:"August"},{value:"8",label:"September"},{value:"9",label:"October"},{value:"10",label:"November"},{value:"11",label:"December"}],wP=({hour:e,minute:t})=>`${e%12||12}:${t.toString().padStart(2,"0")} ${e>=12?"PM":"AM"}`,CP=e=>{const t=e.trim().match(/^((?:0?[1-9]|1[0-2])):([0-5]\d)\s*([ap]m)$/i);if(!t||t.length!==4)return null;const n=parseInt(t[1]??"",10),r=parseInt(t[2]??"",10);if(isNaN(n)||isNaN(r))return null;const s=t[3]?.toLowerCase();return s==="pm"&&n!==12?{hour:n+12,minute:r}:s==="am"&&n===12?{hour:0,minute:r}:{hour:n,minute:r}},GGe=(e,t)=>e.hour===t.hour&&e.minute===t.minute,$Ge=Array.from({length:48},(e,t)=>({hour:Math.floor(t/2),minute:t%2*30}));function qGe({value:e,onChange:t,placeholder:n="Select time",variant:r="default",withIcon:s}){const[o,a]=d.useState(""),[i,c]=d.useState(!1),u=d.useRef(null),f=o.trim()!==""&&!CP(o),m=d.useRef(null),p=e?wP(e):n,h=d.useMemo(()=>$Ge.map(S=>({key:`${S.hour}:${S.minute}`,label:wP(S),value:S})),[]),g=d.useCallback(S=>{S&&i&&e&&m.current&&m.current?.scrollIntoView({behavior:"instant",block:"start"})},[i,e]),y=()=>{const S=CP(o);S&&t(S),a("")},x=S=>{t(S),a(""),c(!1)},v=()=>{c(!i)},b=()=>{c(!i),setTimeout(()=>{u.current&&u.current.focus()},0)},_=(()=>{switch(r){case"subtle":return"bg-subtle";case"default":return"bg-subtler";default:At(r)}})(),w=d.useMemo(()=>l.jsx(ge,{icon:B("clock"),size:"sm"}),[]);return l.jsx("div",{className:"relative size-full",children:l.jsx(Fl,{interaction:"click",open:i,onOpenChange:c,triggerElement:l.jsxs("div",{role:"button",tabIndex:0,onClick:v,className:z(_,"text-foreground flex size-full cursor-pointer items-center gap-2 rounded-lg px-4 font-sans","border transition-colors duration-200 ease-out","outline-none focus:outline-none focus:ring-0","hover:border-subtler focus-within:border-subtler border-transparent",{"!border-negative":f}),children:[s&&w,l.jsx("input",{ref:u,type:"text",value:o||p,placeholder:n,onChange:S=>a(S.target.value),onBlur:y,onClick:b,className:"w-full bg-transparent text-sm focus:outline-none"}),l.jsx(ge,{size:"xs",icon:B("chevron-down"),className:"right-sm pointer-events-none absolute text-inherit opacity-50"})]}),children:l.jsx("div",{ref:g,className:"p-xs scrollbar-subtle max-h-64 overflow-y-auto",children:h.map(S=>l.jsx("div",{ref:e&&GGe(S.value,e)?m:null,role:"button",tabIndex:0,onClick:()=>x(S.value),className:"px-sm text-foreground cursor-pointer rounded-lg py-1.5 hover:bg-subtler",children:l.jsx(V,{variant:"extraSmall",children:S.label})},S.key))})})})}const lf=d.memo(({children:e})=>l.jsx("div",{className:"min-w-0 flex-1 rounded-md",children:e}));lf.displayName="InputWrapper";const sp=d.memo(({options:e,value:t,onChange:n,isMobileStyle:r,variant:s="default"})=>{const o=J(),a=d.useMemo(()=>e.map(p=>({type:"default",text:p.label,onClick:()=>n(p.value),active:p.value===t,role:"menuitemradio"})),[n,e,t]),c=d.useMemo(()=>e.find(p=>p.value===t),[e,t])?.label||o.formatMessage({defaultMessage:"Select...",id:"724CrE1YuG"}),u=d.useMemo(()=>({className:"w-full"}),[]),f=d.useMemo(()=>({matchTargetWidth:!0,avoidPositionCollisions:!1}),[]),m=(()=>{switch(s){case"subtle":return"";case"default":return"!bg-subtler";default:At(s)}})();return l.jsx(lf,{children:l.jsx(zs,{items:a,isMobileStyle:r,placement:"bottom",contentClassName:"w-full",boxProps:u,popoverProps:f,children:l.jsx(Ge,{text:c,extraCSS:z("px-4 size-full !h-10 border-0 !outline-none !justify-start font-normal",m),textClassName:"text-left text-foreground text-sm font-normal",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down")})})})});sp.displayName="FormSelect";const X6=d.memo(({schedule:e,onScheduleChange:t,variant:n="default"})=>{const{formatMessage:r}=J(),{isMobileStyle:s}=Re(),o=d.useMemo(()=>new Date(e.year,e.month,e.day,e.hour,e.minute),[e.year,e.month,e.day,e.hour,e.minute]),{kind:a}=e,i=a==="ONCE",c=a==="WEEKLY",u=a==="MONTHLY"||a==="YEARLY",f=a==="YEARLY",m=d.useCallback(b=>{t({kind:b})},[t]),p=d.useCallback(b=>{t({dayOfWeek:parseInt(b,10)})},[t]),h=d.useCallback(b=>{t({month:parseInt(b,10)})},[t]),g=d.useCallback(b=>{t({day:parseInt(b,10)})},[t]),y=d.useCallback(b=>{b&&t({day:b.getDate(),month:b.getMonth(),year:b.getFullYear()})},[t]),x=d.useCallback(b=>{t({hour:b.hour,minute:b.minute})},[t]),v=d.useMemo(()=>({hour:e.hour,minute:e.minute}),[e.hour,e.minute]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:r({defaultMessage:"Schedule",id:"hGQqkWwmJD"})}),l.jsxs("div",{className:"flex h-10 flex-wrap gap-3",children:[l.jsx(sp,{options:VGe,value:e.kind,onChange:m,isMobileStyle:s,variant:n}),c&&l.jsx(sp,{options:HGe,value:String(e.dayOfWeek),onChange:p,isMobileStyle:s,variant:n}),f&&l.jsx(sp,{options:WGe,value:String(e.month),onChange:h,isMobileStyle:s,variant:n}),u&&l.jsx(sp,{options:zGe,value:String(e.day),onChange:g,isMobileStyle:s,variant:n}),i&&l.jsx(lf,{children:l.jsx(T2,{value:o,onChange:y,variant:n})}),l.jsx(lf,{children:l.jsx(qGe,{value:v,onChange:x,variant:n})})]})]})});X6.displayName="ScheduleSelect";const KGe=He({selectModel:{defaultMessage:"Select model...",id:"XZsGHYyuKM"}}),YGe=({selectedModel:e,onModelChange:t,variant:n="default",isOpen:r,onOpen:s,onClose:o})=>{const a=e||ie.PRO,{$t:i}=J(),{isMobileStyle:c}=Re(),{menuItems:u}=QY({searchMode:oe.SEARCH,currentModel:a,onModelSelect:p=>{t?.(p)}}),f=$n[a].name||KGe.selectModel,m=(()=>{switch(n){case"subtle":return"bg-subtle";case"default":return"!bg-subtler";default:At(n)}})();return l.jsx(zs,{items:u,isMobileStyle:c,placement:"bottom",contentClassName:"w-full",boxProps:{className:"w-full max-w-full"},popoverProps:{matchTargetWidth:!0,avoidPositionCollisions:!1},isOpen:r,onOpen:s,onClose:o,children:l.jsx(Ge,{text:i(f),extraCSS:z("px-4 size-full !h-10 border-0 !outline-none !justify-start font-normal",m),textClassName:"text-left text-foreground text-sm font-normal",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down")})})};function QGe({sources:e,onChange:t,variant:n="default",isOpen:r,onOpen:s,onClose:o}){const{$t:a}=J(),{getSourceLabel:i}=nc(),c=d.useMemo(()=>{if(e.length===1){const m=e[0];if(m)return i(m)}return a({defaultMessage:"{count} sources",id:"l1+6PggBqU"},{count:e.length})},[e,i,a]),u=m=>{t(m.filter(ha))},f=d.useMemo(()=>l.jsx(Dt.Button,{variant:"tonal",children:c}),[c]);return l.jsx(PA,{isOpen:r??!1,sources:e,onChange:u,triggerElement:f,onOpen:s,onClose:o,omitCometMcpSources:!0,omittedSources:["org","google_drive","onedrive","sharepoint","my_files"]})}const rb=d.memo(({searchModel:e,onSearchModelChange:t,sources:n,onSourcesChange:r,variant:s="default"})=>{const o=an(e),{hasActiveSubscription:a}=$t(),[i,c]=d.useState(!1),[u,f]=d.useState(!1),m=d.useCallback(()=>{c(!0),f(!1)},[]),p=d.useCallback(()=>{c(!1)},[]),h=d.useCallback(()=>{f(!0),c(!1)},[]),g=d.useCallback(()=>{f(!1)},[]);return l.jsx("div",{className:"flex w-full flex-col gap-2",children:l.jsxs("div",{className:"flex gap-3",children:[a&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Mode",id:"mrOnjMzgC4"})}),l.jsx("div",{className:"h-full w-fit",children:l.jsx(OY,{value:e,onChange:t,layoutKey:"task-modal",className:"h-full",variant:s,buttonSize:"regular"})})]}),a&&o===oe.SEARCH&&l.jsxs("div",{className:"flex min-w-[100px] flex-1 flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Model",id:"rhSI1/3g21"})}),l.jsx(lf,{children:l.jsx(YGe,{selectedModel:e,onModelChange:t,variant:s,isOpen:i,onOpen:m,onClose:p})})]}),a&&l.jsxs("div",{className:"flex min-w-[100px] flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Sources",id:"fhwTpAcBLC"})}),l.jsx(lf,{children:l.jsx(QGe,{sources:n,onChange:r,variant:s,isOpen:u,onOpen:h,onClose:g})})]})]})})});rb.displayName="QuerySearchConfigurationSelector";const Vne=d.memo(({query:e,onQueryChange:t})=>{const{$t:n}=J(),{hasActiveSubscription:r}=$t(),s=d.useCallback(i=>{t({...e,searchModel:i})},[t,e]),o=d.useCallback(i=>{t({...e,sources:i})},[t,e]);if(!r)return null;const a=n({defaultMessage:"Model options",id:"ObVxV7yacw"});return l.jsx(Une,{title:a,children:l.jsx(rb,{searchModel:e.searchModel,onSearchModelChange:s,sources:e.sources??Zh(),onSourcesChange:o,variant:"subtle"})})});Vne.displayName="ScheduledAutomationAdvancedConfiguration";const Hne=d.memo(({trigger:e,query:t,onQueryChange:n})=>{switch(e.type){case Ze.SCHEDULED:return l.jsx(Vne,{query:t,onQueryChange:n});case Ze.PRICE_ALERT:case Ze.SHORTCUT:return null;default:At(e)}});Hne.displayName="AutomationAdvancedSettingsConfiguration";const zne=d.memo(({expiryDate:e,onExpiryDateChange:t,schedule:n})=>{const{$t:r}=J(),s=d.useCallback(i=>{i.stopPropagation(),t(null)},[t]),o=d.useMemo(()=>l.jsx(Ge,{type:"button",onClick:s,icon:B("x"),size:"tiny",variant:"common"}),[s]),a=d.useMemo(()=>{if(e===null)return;const i=n?h4(n):void 0;return i?US(i,1):void 0},[e,n]);return l.jsx(T2,{value:e===null?void 0:e,onChange:t,buttonClassName:"w-full py-sm bg-subtle",trailingIcon:o,fromDate:a,placeholder:r({defaultMessage:"None selected",id:"7MYtB45RD0"})})});zne.displayName="AutomationExpiryDatePicker";const Wne=d.memo(({defaultExpiryDate:e,expiryDate:t,onExpiryDateChange:n,schedule:r})=>{const s=d.useCallback(o=>{n?.(o)},[n]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Expiration date",id:"CICBj0Td+l"})}),l.jsx(zne,{expiryDate:t||e,onExpiryDateChange:s,schedule:r})]})});Wne.displayName="ExpiryDateSection";const Gne=d.memo(({trigger:e,onTriggerChange:t})=>{const n=d.useCallback(r=>{e.type===Ze.SCHEDULED&&t({...e,type:Ze.SCHEDULED,expiryDate:r})},[t,e]);switch(e.type){case Ze.SCHEDULED:return e.schedule.kind!=="ONCE"?l.jsx(Wne,{defaultExpiryDate:e.defaultExpiryDate,expiryDate:e.expiryDate,onExpiryDateChange:n,schedule:e.schedule}):null;case Ze.PRICE_ALERT:case Ze.SHORTCUT:return null;default:At(e)}});Gne.displayName="AutomationExpiryDateConfiguration";const XGe=({options:e,selectedValues:t,onSelectionChange:n,placeholder:r="Select options...",disabled:s=!1})=>{const o=J(),{isMobileStyle:a}=Re(),[i,c]=d.useState(!1),u=d.useCallback(x=>{const b=t.includes(x)?t.filter(_=>_!==x):[...t,x];n(b)},[t,n]),f=d.useMemo(()=>e.map(x=>{const v=t.includes(x.value);return{type:"multiSelect",text:x.label,onClick:()=>{u(x.value)},selected:v,iconVariant:"check",disableActiveStyles:!0}}),[e,t,u]),m=d.useMemo(()=>{if(t.length===0)return r;const x=t.map(v=>e.find(b=>b.value===v)?.label).filter(Boolean);return new Intl.ListFormat(o.locale,{style:"long",type:"conjunction"}).format(x)},[t,e,r,o.locale]),p=d.useCallback(()=>c(!0),[]),h=d.useCallback(()=>c(!1),[]),g=d.useMemo(()=>({className:"w-[180px]"}),[]),y=d.useMemo(()=>({matchTargetWidth:!1,avoidPositionCollisions:!1}),[]);return l.jsx(zs,{isOpen:i,onOpen:p,onClose:h,items:f,isMobileStyle:a,placement:"bottom-end",contentClassName:"w-full",boxProps:g,popoverProps:y,disabled:s,alwaysShowChildren:!0,children:l.jsx(Ge,{text:m,extraCSS:"px-4 w-full !h-10 border-0 !outline-none !justify-start font-normal",textClassName:"text-left text-foreground text-sm font-normal truncate",fullWidth:!0,layout:"split",chevron:!0,chevronIcon:B("chevron-down"),disabled:s})})},ZGe=(e,t)=>{const{value:n,loading:r}=zt({flag:"app-notifications",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},$ne=d.memo(({notificationSettings:e,onNotificationSettingsChange:t,disabled:n})=>{const{$t:r}=J(),{variation:s,loading:o}=ZGe(!1),a=d.useMemo(()=>{const u=[];return s&&!o&&u.push({value:"in_app",label:r({defaultMessage:"In-app",id:"E7zWOQXV+k"})}),u.push({value:"email",label:r({defaultMessage:"Email",id:"sy+pv5U9ls"})},{value:"push",label:r({defaultMessage:"Mobile",id:"GWtmtuCmOx"})}),u},[r,s,o]),i=d.useMemo(()=>{const u=[];return s&&!o&&e.should_send_in_app&&u.push("in_app"),e.should_send_email&&u.push("email"),e.should_send_push&&u.push("push"),u},[e,s,o]),c=d.useCallback(u=>{t({should_send_email:u.includes("email"),should_send_push:u.includes("push"),should_send_in_app:u.includes("in_app")})},[t]);return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Notification platform",id:"L9evilaxeT"})}),l.jsx(XGe,{options:a,selectedValues:i,onSelectionChange:c,placeholder:r({defaultMessage:"Select platform",id:"Gl5w1+hLYC"}),disabled:n})]})});$ne.displayName="AutomationNotificationConfiguration";const sb=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e.toUpperCase(),currencyDisplay:"symbol"}).format(0).replace(/[0-9.,\s]/g,"").trim()||"$"}catch{return"$"}},ob="5";function rk(e){const t={selectedSymbol:e.symbol,additionalInstructions:"",selectedOption:"price",priceValue:"",percentValue:"",positiveSelected:!0,negativeSelected:!0};switch(e.alertType){case fr.TARGET_PRICE:return{...t,selectedOption:"price",priceValue:e.price===0?"":e.price.toString()};case fr.MOVEMENT_AMOUNT:{const n=e.percentageDecimalUpperBound>0&&e.percentageDecimalUpperBound!==Bl/100,r=e.percentageDecimalLowerBound<0&&e.percentageDecimalLowerBound!==Ul/100;let s="";return n?s=(e.percentageDecimalUpperBound*100).toFixed(2):r&&(s=(Math.abs(e.percentageDecimalLowerBound)*100).toFixed(2)),s?{...t,selectedOption:"movement",percentValue:s,positiveSelected:n,negativeSelected:r}:{...t,selectedOption:"movement",percentValue:ob,positiveSelected:!0,negativeSelected:!0}}default:At(e)}}function JGe(e){switch(e.selectedOption){case"price":{const t=parseFloat(e.priceValue.replace(/[^0-9.]/g,""));return{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,symbol:e.selectedSymbol??"",price:t||0,currency:"usd"}}case"movement":{const n=(parseFloat(e.percentValue)||0)/100;let r=0,s=0;return e.positiveSelected&&e.negativeSelected?(r=n,s=-n):e.positiveSelected?r=n:e.negativeSelected&&(s=-n),{type:Ze.PRICE_ALERT,alertType:fr.MOVEMENT_AMOUNT,symbol:e.selectedSymbol??"",percentageDecimalUpperBound:r,percentageDecimalLowerBound:s}}default:At(e.selectedOption)}}function e$e({trigger:e,onTriggerChange:t}){const[n,r]=d.useState(()=>rk(e)),s=d.useMemo(()=>e.alertType===fr.TARGET_PRICE?`${e.symbol}-${e.alertType}-${e.price}`:`${e.symbol}-${e.alertType}-${e.percentageDecimalUpperBound}-${e.percentageDecimalLowerBound}`,[e]),o=d.useRef(s);d.useEffect(()=>{s!==o.current&&(r(rk(e)),o.current=s)},[s,e]);const a=d.useCallback(y=>{const x=JGe(y);t(x)},[t]),i=d.useCallback(y=>{r(x=>{const v=y(x);return a(v),v})},[a]),c=d.useCallback(y=>{i(x=>({...x,selectedSymbol:y}))},[i]),u=d.useCallback((y,x="")=>{i(v=>{switch(y){case"price":return{...v,selectedOption:y,priceValue:x};case"movement":return{...v,selectedOption:y,percentValue:ob,positiveSelected:!0,negativeSelected:!0};default:At(y)}})},[i]),f=d.useCallback(y=>{i(x=>({...x,priceValue:typeof y=="function"?y(x.priceValue):y}))},[i]),m=d.useCallback(y=>{i(x=>({...x,percentValue:typeof y=="function"?y(x.percentValue):y}))},[i]),p=d.useCallback(y=>{i(x=>({...x,positiveSelected:y}))},[i]),h=d.useCallback(y=>{i(x=>({...x,negativeSelected:y}))},[i]),g=d.useCallback(y=>{r(x=>({...x,additionalInstructions:y}))},[]);return d.useMemo(()=>({formState:n,onSymbolChange:c,onOptionChange:u,onPriceValueChange:f,onPercentValueChange:m,onPositiveChange:p,onNegativeChange:h,onAdditionalInstructionsChange:g}),[n,c,u,f,m,p,h,g])}const qne=async e=>{const{data:t,error:n,response:r}=await de.GET("/rest/finance/quote/{market_identifier}","automations/quote",{params:{path:{market_identifier:e}}});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,status:r.status??0});return t},Kne=e=>["automations/quote",e],ab=({symbol:e,enabled:t=!!e,onInitialSuccess:n})=>{const r=d.useRef(!1),s=mt({enabled:t&&!!e,queryKey:Kne(e),queryFn:()=>qne(e)});return d.useEffect(()=>{s.isSuccess&&s.data&&!r.current&&n&&(r.current=!0,n(s.data))},[s.isSuccess,s.data,n]),s},Yne=d.memo(({trigger:e,prompt:t,onPromptChange:n,error:r,variant:s="default",disabled:o})=>{const{isMobileUserAgent:a}=Re(),{$t:i,locale:c}=J(),u=rk(e),{selectedSymbol:f,priceValue:m,percentValue:p}=u,{data:h,isLoading:g}=ab({symbol:u.selectedSymbol}),y=e.alertType===fr.TARGET_PRICE?"price":"movement",x=h?.currency?sb(h?.currency,c):"$",{displayInstructions:v}=NE({selectedSymbol:f,quote:h,isLoading:g,alertType:y,priceValue:m,percentValue:p,currencySymbol:x,$t:i});return l.jsxs("div",{className:z("gap-md flex flex-col",o&&"pointer-events-none opacity-50"),children:[l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"tiny",color:"light",className:"flex shrink-0 items-center",children:l.jsx(je,{defaultMessage:"Default query",id:"7SalR4PwjB"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(V,{variant:"small",color:"light",className:"pl-sm border-subtlest border-l-2",children:v})})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"tiny",color:"light",className:"flex shrink-0 items-center",children:l.jsx(je,{defaultMessage:"Additional Instructions (optional)",id:"QFuOkrgHHJ"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(hu,{value:t,onChange:n,isMobileUserAgent:a,isMobileStyle:!1,minRows:3,maxLength:cV,className:z("[&_textarea]:placeholder:!text-quietest placeholder:!text-quietest hover:!border-subtler focus-within:!border-subtler !border !border-transparent","w-full"),placeholder:"Check news and social media sentiment to assess consensus or controversy",variant:s,disabled:o})})]}),r&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:r})]})]})});Yne.displayName="PriceAlertQueryPromptInput";const Qne=d.memo(({trigger:e,prompt:t,onPromptChange:n,error:r,variant:s,disabled:o})=>{const{data:a}=ab({symbol:e.symbol}),i=d.useMemo(()=>{if(!e.symbol)return"";const f=a?.name?` (${a.name})`:"";return e.alertType===fr.TARGET_PRICE?$v({symbol:e.symbol,quoteName:f}):qv({symbol:e.symbol,quoteName:f})},[e.symbol,e.alertType,a?.name]),c=d.useMemo(()=>{const f=a?.name?` (${a.name})`:"";return cee({prompt:t,symbol:e.symbol,quoteName:f})},[t,e.symbol,a?.name]),u=f=>{const m=lee({baseInstructions:i,additionalInstructions:f});n(m)};return l.jsx(Yne,{trigger:e,prompt:c,onPromptChange:u,error:r,variant:s,disabled:o})});Qne.displayName="PriceAlertPromptWrapper";const ib=d.memo(({trigger:e,prompt:t,onPromptChange:n,placeholder:r,error:s,variant:o="default",disabled:a})=>{const{isMobileUserAgent:i}=Re(),c=(()=>{switch(o){case"default":return"bg-subtler [&_textarea]:bg-transparent";case"subtle":return"bg-subtle [&_textarea]:bg-transparent";default:At(o)}})();switch(e.type){case Ze.SCHEDULED:case Ze.SHORTCUT:return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Instructions",id:"sV2v5LjRpX"})}),l.jsx(hu,{placeholder:r,value:t,onChange:n,isMobileUserAgent:i,isMobileStyle:!1,minRows:3,maxLength:cV,allowEnterNewlines:!0,className:z("hover:!border-subtler focus-within:!border-subtler !border !border-transparent",c),variant:o,disabled:a}),s&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:s})]})]});case Ze.PRICE_ALERT:return l.jsx(Qne,{trigger:e,prompt:t,onPromptChange:n,error:s,variant:o,disabled:a});default:At(e)}});ib.displayName="QueryPromptInput";const Xne=d.memo(({trigger:e,query:t,onQueryChange:n})=>{const{$t:r}=J(),s=d.useCallback(c=>{n({...t,prompt:c})},[n,t]),o=d.useCallback(c=>{n({...t,searchModel:c})},[n,t]),a=d.useCallback(c=>{n({...t,sources:c})},[n,t]),i=d.useMemo(()=>{switch(e.type){case Ze.SCHEDULED:return null;case Ze.PRICE_ALERT:return null;case Ze.SHORTCUT:return l.jsx(rb,{searchModel:t.searchModel,onSearchModelChange:o,sources:t.sources??Zh(),onSourcesChange:a,variant:"subtle"});default:At(e)}},[o,a,t.searchModel,t.sources,e]);return e.type===Ze.PRICE_ALERT?null:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(ib,{trigger:e,prompt:t.prompt,placeholder:r({defaultMessage:"Describe what you want to automate",id:"79ZUaZU8Ho"}),onPromptChange:s,variant:"subtle"}),i]})});Xne.displayName="AutomationQueryConfiguration";const t$e=async({query:e,locale:t,reason:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/tasks-autosuggest",n,{params:{query:{query:e}},headers:{"accept-language":t},shouldNotAddSourceVersionQueryParams:!1});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to get finance tasks suggestions",cause:s,status:o.status??0});return"results"in r?r.results:[]}catch(r){return Z.error(r),[]}},n$e=({symbol:e})=>l.jsx(V,{color:"light",children:l.jsx("span",{className:"font-mono opacity-70",children:e.slice(0,1)})}),Z6=({image:e,imageDark:t,alt:n,watchlistType:r,className:s,imageClassName:o})=>{const a=r==="FINANCE",{colorScheme:i}=Ss(),c=a&&i==="dark"&&t?t:e,[u,f]=d.useState(()=>{if(!c)return!1;const g=new Image;return g.src=c,g.complete&&g.naturalWidth>0}),[m,p]=d.useState(!1),h=!u||m;return l.jsxs("div",{className:z("relative flex size-6 items-center justify-center",{"bg-subtler":h},s),children:[h&&l.jsx(n$e,{symbol:n??""}),!m&&l.jsx("div",{className:z("absolute",o),children:l.jsx("img",{src:c,alt:n,width:32,height:32,className:z("inset-0 size-full object-contain",{"opacity-0":!u}),onLoad:()=>f(!0),onError:()=>p(!0)})})]})},Zne="[&_textarea]:placeholder:!text-quietest placeholder:!text-quietest hover:!border-subtler focus-within:!border-subtler !border !border-transparent",r$e=e=>/^(\d+(\.\d{0,2})?|\.\d{1,2})$/.test(e),s$e=e=>/^(\d+(\.\d{0,1})?|\.\d{0,1})$/.test(e),o$e=({currentPrice:e,value:t,onChange:n,variant:r="default",currency:s="USD"})=>{const{isMobileUserAgent:o}=Re(),{locale:a,$t:i}=J(),c=d.useMemo(()=>sb(s,a),[s,a]),u=d.useMemo(()=>e?.toLocaleString(a,{style:"currency",currency:s.toUpperCase()}),[e,a,s]),f=d.useCallback(y=>{n(x=>{if(y===c)return y;const v=y.replace(c,"");return r$e(v)||y===""?c+v:x})},[n,c]),m=d.useCallback(()=>{t===""&&n(c)},[n,t,c]),p=d.useCallback(()=>{t===c&&n("")},[n,t,c]),h=(()=>{switch(r){case"default":return"bg-subtler [&_textarea]:bg-subtler";case"subtle":return"bg-subtle [&_textarea]:bg-subtle";default:At(r)}})(),g=z(Zne,h);return l.jsxs("div",{className:"gap-sm flex flex-col items-start",children:[l.jsx(V,{variant:"tiny",color:"light",children:u?i({id:"74LVOPcS2E",defaultMessage:"Target Price (currently {formattedPrice})"},{formattedPrice:u}):i({id:"xPMPP84OOV",defaultMessage:"Target Price"})}),l.jsx("div",{className:"gap-sm flex items-stretch",children:l.jsx(co,{placeholder:c,className:z(g,"p-sm !rounded-md"),variant:"monospace",isMobileUserAgent:o,value:t,onChange:f,onFocus:m,onBlur:p,disable1pass:!0,colorVariant:r})})]})},a$e=({value:e,onChange:t,positiveSelected:n,onPositiveChange:r,negativeSelected:s,onNegativeChange:o,variant:a="default"})=>{const{isMobileUserAgent:i}=Re(),{$t:c}=J(),u=d.useCallback(()=>{o(!s)},[s,o]),f=d.useCallback(()=>{r(!n)},[r,n]),m=d.useCallback(y=>{t(x=>s$e(y)||y===""?y:x)},[t]),p=d.useMemo(()=>({delayDuration:100}),[]),h=(()=>{switch(a){case"default":return"bg-subtler [&_textarea]:bg-subtler";case"subtle":return"bg-subtle [&_textarea]:bg-subtle";default:At(a)}})(),g=z(Zne,h);return l.jsx("div",{className:"gap-md flex flex-col",children:l.jsxs("div",{className:"gap-sm flex flex-col items-start",children:[l.jsx(V,{variant:"tiny",color:"light",children:c({id:"agMnIX4PMS",defaultMessage:"Movement Amount (%)"})}),l.jsxs("div",{className:"gap-md flex h-full items-center",children:[l.jsxs("div",{className:"gap-sm flex h-full items-center",children:[l.jsx(Ge,{variant:s?"primaryGhost":"border",size:"small",onClick:u,pill:!0,icon:B("minus"),toolTip:c({id:"M9L9vXrgoN",defaultMessage:"Negative Movement"}),tooltipProps:p}),l.jsx(Ge,{variant:n?"primaryGhost":"border",size:"small",onClick:f,pill:!0,icon:B("plus"),toolTip:c({id:"iFYP+IX00i",defaultMessage:"Positive Movement"}),tooltipProps:p})]}),l.jsx(co,{className:z(g,"p-sm !rounded-md"),variant:"monospace",isMobileUserAgent:i,value:e,onChange:m,disable1pass:!0,colorVariant:a})]})]})})},J6=A.memo(e=>{const{selectedSymbol:t,selectedOption:n,onSymbolChange:r,onOptionChange:s,showSymbolInput:o=!0,currentPrice:a,priceValue:i,onPriceValueChange:c,percentValue:u,onPercentValueChange:f,positiveSelected:m,onPositiveChange:p,negativeSelected:h,onNegativeChange:g,externalInputValue:y,variant:x,colorVariant:v="default",currency:b,isAssetSelected:_=!0}=e,w=()=>{switch(x){case"full":return{additionalInstructions:e.additionalInstructions,onAdditionalInstructionsChange:e.onAdditionalInstructionsChange,displayPriceInstructions:e.displayPriceInstructions,displayMovementInstructions:e.displayMovementInstructions};case"trigger":return{additionalInstructions:"",onAdditionalInstructionsChange:()=>{},displayPriceInstructions:void 0,displayMovementInstructions:void 0};default:return At(x)}},{additionalInstructions:S,onAdditionalInstructionsChange:C,displayPriceInstructions:E,displayMovementInstructions:T}=w(),{isMobileUserAgent:k}=Re(),{$t:I,locale:M}=J(),[N,D]=d.useState(!1),[j,F]=d.useState(0),[R,P]=d.useState(""),[L,U]=d.useState([]),O=d.useRef(null),$=Yt(),G=d.useRef(R);G.current=R,d.useEffect(()=>{P(y??"")},[y]),d.useEffect(()=>{if(b&&i){const _e=sb(b.toUpperCase(),M);if(/^\d+(\.\d+)?$/.test(i)){c(_e+i);return}const De=i.replace(/[^0-9.]/g,"");i.replace(/[0-9.]/g,"").trim()!==_e&&De&&c(_e+De)}},[b,M,i,c]);const H=d.useMemo(()=>[{label:I({id:"xPMPP84OOV",defaultMessage:"Target Price"}),value:"price"},{label:I({id:"24152tl1L3",defaultMessage:"Movement Amount"}),value:"movement"}].map(ke=>({label:ke.label,value:ke.value,children:l.jsx("div",{className:"w-full flex-1",children:l.jsx(SA,{label:ke.label,isActiveOption:n===ke.value})})})),[n,I]),Q=d.useCallback(async _e=>{const De=(await $.fetchQuery({queryKey:be.makeEphemeralQueryKey("finance-tasks-autosuggest",_e),queryFn:()=>t$e({query:_e,reason:"finance-add-alert"}),staleTime:0})).map(xe=>({query:xe.title??"",title:xe.title??"",image:xe.image??"",imageDark:xe.image_dark??"",description:xe.description??"",identifier:xe.query??""}));U(De)},[$]),Y=Cf(Q,100,{leading:!0,trailing:!0}),te=d.useCallback(_e=>{Y(_e)},[Y]),se=d.useCallback(()=>{D(!0),F(-1),te(G.current)},[te]),ae=d.useCallback(()=>{D(!1)},[]),X=d.useCallback(_e=>{const ke=_e;P(ke),te(ke),ke.trim()===""&&(r(null),c(""),f(""))},[te,r,c,f]),ee=d.useCallback(_e=>{r(_e.identifier??null),P(_e.title??""),D(!1),O.current?.blur()},[r]),le=sX({userInputQuery:R,suggestionsDisabled:!N||L.length===0,suggestions:L,focusedIndex:j,setFocusedIndex:F,onChange:_e=>{P(_e)},handleSuggestionSubmission:ee,inputRef:O}),re=d.useCallback(_e=>{s(_e)},[s]),ce=d.useCallback(_e=>{C?.(_e)},[C]),ue=z("h-10 rounded-md dark:border-0 dark:border-transparent dark:bg-subtle p-4 dark:[&:focus]:ring-0",{"rounded-t-md rounded-b-none":N&&L.length>0}),me=d.useMemo(()=>({image:_e,imageDark:ke,alt:De})=>l.jsx(Z6,{image:_e,imageDark:ke,alt:De,watchlistType:"FINANCE",className:"bg-subtler mr-sm !size-8 rounded",imageClassName:"inset-xs"}),[]),we=({onClear:_e})=>l.jsx(st,{icon:B("x"),size:"tiny",pill:!0,onClick:_e}),ye=d.useMemo(()=>({RightIconComponent:()=>null,LeftIconComponent:me}),[me]);return l.jsxs("div",{className:"flex flex-col gap-3",children:[o&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(je,{defaultMessage:"Find a stock, token, or fund...",id:"DTOgClV6qi"})}),l.jsx(OA,{isOpen:N&&L.length>0,suggestedQueries:L,focusedIndex:j,setFocusedIndex:F,handlePasteQuery:Ao,handleSubmit:ee,value:R,components:ye,dropdownClassName:"dark:border-none dark:ml-0 dark:mr-0 dark:w-full",dropdownType:"select",popoverClassName:"dark:!border-none",children:l.jsx(co,{autoFocus:!t,onFocus:se,onBlur:ae,onKeyDown:le,className:ue,ref:O,isMobileUserAgent:k,placeholder:I({defaultMessage:"Search for any asset",id:"BeYic/1TvC"}),value:R,onChange:X,ClearIcon:we,colorVariant:v})})]}),l.jsxs("div",{className:z("flex flex-col gap-3 sm:flex-row",!_&&"pointer-events-none opacity-50"),children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(je,{defaultMessage:"Alert criteria",id:"h44KqVtM6/"})}),l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:l.jsx(CA,{layoutKey:"task",options:H,value:n,onValueChange:re,className:"p-three inline-flex",variant:v})})]}),l.jsxs("div",{className:"gap-md flex flex-col",children:[n==="price"&&l.jsx(o$e,{currentPrice:a,value:i,onChange:c,variant:v,currency:b}),n==="movement"&&l.jsx(a$e,{value:u,onChange:f,positiveSelected:m,onPositiveChange:p,negativeSelected:h,onNegativeChange:g,variant:v})]})]}),x==="full"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"smallBold",color:"light",className:"flex shrink-0 items-center",children:I({id:"qax5d8pQCh",defaultMessage:"Default Query"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(V,{variant:"small",color:"light",className:"pl-sm border-subtlest border-l-2",children:n==="price"?E:T})})]}),l.jsxs("div",{className:"gap-sm flex w-full flex-col items-start",children:[l.jsx("div",{className:"gap-xs flex w-full items-center",children:l.jsx(V,{variant:"smallBold",color:"light",className:"flex shrink-0 items-center",children:I({id:"QFuOkrgHHJ",defaultMessage:"Additional Instructions (optional)"})})}),l.jsx("div",{className:"w-full [&>*]:w-full",children:l.jsx(hu,{value:S,onChange:ce,isMobileUserAgent:k,isMobileStyle:!1,minRows:3,placeholder:I({id:"DtwY5RHKrT",defaultMessage:"Check news and social media sentiment to assess consensus or controversy"})})})]})]})]})});J6.displayName="FinanceAlertForm";const Jne=d.memo(({trigger:e,onTriggerChange:t,isEditing:n,defaultTargetPriceValue:r})=>{const{formState:s,onSymbolChange:o,onOptionChange:a,onPriceValueChange:i,onPercentValueChange:c,onPositiveChange:u,onNegativeChange:f}=e$e({trigger:e,onTriggerChange:t}),m=d.useCallback(x=>r||(x.price?i$e(x.price):""),[r]),p=d.useCallback(x=>{switch(s.selectedOption){case"price":{if(x&&!s.priceValue){const v=m(x);v&&i(v)}break}case"movement":break;default:At(s.selectedOption)}},[s.priceValue,s.selectedOption,m,i]),{data:h}=ab({symbol:s.selectedSymbol,onInitialSuccess:p}),g=d.useCallback(x=>{let v="";switch(x){case"price":{v=s.priceValue,h&&(v=m(h));break}case"movement":break;default:At(x)}a(x,v)},[s.priceValue,m,a,h]),y=!!e.symbol&&e.symbol.trim()!=="";return l.jsx("div",{children:l.jsx(J6,{variant:"trigger",externalInputValue:s.selectedSymbol??void 0,selectedSymbol:s.selectedSymbol,selectedOption:s.selectedOption,onSymbolChange:o,onOptionChange:g,showSymbolInput:!n,currentPrice:h?.price,priceValue:s.priceValue,onPriceValueChange:i,percentValue:s.percentValue,onPercentValueChange:c,positiveSelected:s.positiveSelected,onPositiveChange:u,negativeSelected:s.negativeSelected,onNegativeChange:f,colorVariant:"subtle",currency:h?.currency??void 0,isAssetSelected:y})})});Jne.displayName="PriceAlertTriggerConfiguration";function i$e(e){return(e*(1+parseInt(ob,10)/100)).toFixed(2)}const sk=d.memo(({trigger:e,onTriggerChange:t})=>{const n=d.useMemo(()=>e?.schedule??Gr(),[e?.schedule]),r=d.useCallback(s=>{t({type:Ze.SCHEDULED,...e,schedule:{...n,...s}})},[t,n,e]);return l.jsx(X6,{schedule:n,onScheduleChange:r,variant:"subtle"})});sk.displayName="ScheduledAutomationTriggerConfiguration";const ere=d.memo(()=>l.jsx("div",{children:"Shortcut Trigger Configuration"}));ere.displayName="ShortcutTriggerAutomationConfiguration";const tre=d.memo(({trigger:e,onTriggerChange:t,isEditing:n=!1,defaultTargetPriceValue:r})=>{if(!e)return l.jsx(sk,{trigger:null,onTriggerChange:t});switch(e.type){case Ze.SCHEDULED:return l.jsx(sk,{trigger:e,onTriggerChange:t});case Ze.PRICE_ALERT:return l.jsx(Jne,{trigger:e,onTriggerChange:t,isEditing:n,defaultTargetPriceValue:r});case Ze.SHORTCUT:return l.jsx(ere,{});default:At(e)}});tre.displayName="AutomationTriggerConfiguration";const l$e={tiny:"tiny",small:"tiny",default:"tiny",large:"small"},c$e={tiny:"text-xs",small:"text-sm",default:"text-sm",large:"text-base"},u$e=e=>{const t=_x(e);return z(t,"justify-between")},d$e=()=>"ml-1 shrink-0 text-quiet";function f$e({ref:e,children:t,"aria-expanded":n,"aria-haspopup":r="listbox","aria-controls":s,size:o="default",disabled:a=!1,onClick:i,leadingAccessory:c,...u}){const f=bx(e),m=wa(u),p=l$e[o],h=c$e[o],g=d.useMemo(()=>z("font-normal",h,"text-box-trim-both","truncate",{"pl-1":c,"pr-1":!0,"min-w-0":!0}),[c,h]);return l.jsxs(Ro,{ref:f,...m,disabled:a,className:u$e({variant:"tonal",size:o,disabled:a,fullWidth:!0}),onClick:i,"aria-expanded":n,"aria-haspopup":r,"aria-controls":s,children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[c&&l.jsx("div",{className:"mr-1 shrink-0",children:o2(c)?l.jsx(rn,{icon:c,size:o}):c}),l.jsx("span",{className:g,children:t})]}),l.jsx("div",{className:d$e(),children:l.jsx(rn,{icon:B("chevron-down"),size:p})})]})}const m$e=50;function p$e({reason:e,limit:t=m$e}){const n=PU({queryKey:be.makeQueryKey(ry),queryFn:({pageParam:s=0})=>PDe({limit:t,offset:s,reason:e}),getNextPageParam:(s,o)=>{if(s.has_next_page)return o.length*t},initialPageParam:0}),r=d.useMemo(()=>n.data?.pages?.flatMap(s=>s.spaces)??[],[n.data]);return{...n,spaces:r}}const eN=d.memo(({emoji:e,size:t="md"})=>l.jsx(V,{variant:t==="lg"?"section-title":"base",className:z("flex items-center justify-center",{"size-5":t==="lg","size-4":t==="md"}),children:e}));eN.displayName="EmojiIcon";const nre=d.memo(({space:e,isSelected:t,onSelect:n})=>{const r=Q4(e.emoji),s=d.useMemo(()=>r?()=>l.jsx(eN,{emoji:r}):Kh,[r]);return l.jsx(Dt.Item,{leadingAccessory:s,trailingAccessory:t?l.jsx(rn,{icon:B("check"),size:"default"}):void 0,onSelect:()=>n(e.uuid),children:e.title})});nre.displayName="SpaceMenuItem";const rre=d.memo(({selectedSpaceUuid:e,onSpaceChange:t,disabled:n=!1})=>{const{$t:r}=J(),{openToast:s}=hn(),[o,a]=d.useState(!1),{spaces:i,isLoading:c,isError:u}=p$e({reason:"automation-modal-space-selector"}),f=d.useCallback(g=>{n||c||u||a(g)},[n,c,u]);d.useEffect(()=>{u&&s({message:r({defaultMessage:"Failed to load spaces",id:"+uuI8WqZfv"}),variant:"error",timeout:null})},[u,r,s]);const m=i.find(g=>g.uuid===e),p=m?Q4(m.emoji):null,h=d.useMemo(()=>p?()=>l.jsx(eN,{emoji:p,size:"lg"}):Kh,[p]);return!c&&!u&&i.length===0?null:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(V,{variant:"tiny",color:"light",className:"select-none",children:l.jsx(je,{defaultMessage:"Space",id:"0ah2udCSKF"})}),l.jsx(Dt,{isOpen:o,onToggle:f,triggerElement:l.jsx(f$e,{size:"default",disabled:n||c||u,leadingAccessory:h,children:m?m.title:l.jsx(je,{defaultMessage:"None Selected",id:"HeX7TW9V+Q"})}),children:l.jsxs("div",{className:"max-h-[38vh] overflow-y-auto",children:[e&&l.jsx(Dt.Item,{leadingAccessory:B("x"),onSelect:()=>t(null),children:l.jsx(je,{defaultMessage:"Clear Selection",id:"WbPFiMz647"})}),i.map(g=>l.jsx(nre,{space:g,isSelected:g.uuid===e,onSelect:t},g.uuid))]})})]})});rre.displayName="SpaceSelector";const h$e=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-in-spaces",defaultValue:e,extraAttributes:t,subjectType:"visitor_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},g$e=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-notification-settings-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Ow=new Date,Lw=new Date;function Tr(e,t,n,r){function s(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(e(o=new Date(+o)),o),s.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),s.round=o=>{const a=s(o),i=s.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),s.range=(o,a,i)=>{const c=[];if(o=s.ceil(o),i=i==null?1:Math.floor(i),!(o0))return c;let u;do c.push(u=new Date(+o)),t(o,i),e(o);while(uTr(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,i)=>{if(a>=a)if(i<0)for(;++i<=0;)for(;t(a,-1),!o(a););else for(;--i>=0;)for(;t(a,1),!o(a););}),n&&(s.count=(o,a)=>(Ow.setTime(+o),Lw.setTime(+a),e(Ow),e(Lw),Math.floor(n(Ow,Lw))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(r?a=>r(a)%o===0:a=>s.count(0,a)%o===0):s)),s}const P2=Tr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);P2.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Tr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):P2);P2.range;const ji=1e3,Eo=ji*60,Ii=Eo*60,Ki=Ii*24,tN=Ki*7,SP=Ki*30,Fw=Ki*365,Pi=Tr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCSeconds());Pi.range;const lb=Tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ji)},(e,t)=>{e.setTime(+e+t*Eo)},(e,t)=>(t-e)/Eo,e=>e.getMinutes());lb.range;const cb=Tr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Eo)},(e,t)=>(t-e)/Eo,e=>e.getUTCMinutes());cb.range;const ub=Tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ji-e.getMinutes()*Eo)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getHours());ub.range;const db=Tr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ii)},(e,t)=>(t-e)/Ii,e=>e.getUTCHours());db.range;const em=Tr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Eo)/Ki,e=>e.getDate()-1);em.range;const Fg=Tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>e.getUTCDate()-1);Fg.range;const sre=Tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>Math.floor(e/Ki));sre.range;function yu(e){return Tr(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())*Eo)/tN)}const Bg=yu(0),O2=yu(1),y$e=yu(2),x$e=yu(3),cf=yu(4),v$e=yu(5),b$e=yu(6);Bg.range;O2.range;y$e.range;x$e.range;cf.range;v$e.range;b$e.range;function xu(e){return Tr(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)/tN)}const Ug=xu(0),L2=xu(1),_$e=xu(2),w$e=xu(3),uf=xu(4),C$e=xu(5),S$e=xu(6);Ug.range;L2.range;_$e.range;w$e.range;uf.range;C$e.range;S$e.range;const Vg=Tr(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());Vg.range;const fb=Tr(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());fb.range;const ba=Tr(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());ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tr(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)});ba.range;const ai=Tr(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());ai.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tr(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)});ai.range;function Op(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function E$e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Hg(e){let t,n,r;e.length!==2?(t=Op,n=(i,c)=>Op(e(i),c),r=(i,c)=>e(i)-c):(t=e===Op||e===E$e?e:k$e,n=e,r=e);function s(i,c,u=0,f=i.length){if(u>>1;n(i[m],c)<0?u=m+1:f=m}while(u>>1;n(i[m],c)<=0?u=m+1:f=m}while(uu&&r(i[m-1],c)>-r(i[m],c)?m-1:m}return{left:s,center:a,right:o}}function k$e(){return 0}function ore(e){return e===null?NaN:+e}const M$e=Hg(Op),tm=M$e.right;Hg(ore).center;function ko(e,t){let n,r;if(t===void 0)for(const s of e)s!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r=o&&(n=r=o):(n>o&&(n=o),r0)return[e];if((r=t0){let c=Math.round(e/i),u=Math.round(t/i);for(c*it&&--u,a=new Array(o=u-c+1);++st&&--u,a=new Array(o=u-c+1);++s=0?(o>=ok?10:o>=ak?5:o>=ik?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(o>=ok?10:o>=ak?5:o>=ik?2:1)}function ck(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/s;return o>=ok?s*=10:o>=ak?s*=5:o>=ik&&(s*=2),t=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,o=Math.floor(s),a=+n(e[o],o,e),i=+n(e[o+1],o+1,e);return a+(i-a)*(s-o)}}function D$e(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,o=new Array(s);++rx).right(a,p);if(h===a.length)return e.every(ck(u/Fw,f/Fw,m));if(h===0)return P2.every(Math.max(ck(u,f,m),1));const[g,y]=a[p/a[h-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(ue=Uw(Pm(re.y,0,1)),me=ue.getUTCDay(),ue=me>4||me===0?L2.ceil(ue):L2(ue),ue=Fg.offset(ue,(re.V-1)*7),re.y=ue.getUTCFullYear(),re.m=ue.getUTCMonth(),re.d=ue.getUTCDate()+(re.w+6)%7):(ue=Bw(Pm(re.y,0,1)),me=ue.getDay(),ue=me>4||me===0?O2.ceil(ue):O2(ue),ue=em.offset(ue,(re.V-1)*7),re.y=ue.getFullYear(),re.m=ue.getMonth(),re.d=ue.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),me="Z"in re?Uw(Pm(re.y,0,1)).getUTCDay():Bw(Pm(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(me+5)%7:re.w+re.U*7-(me+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,Uw(re)):Bw(re)}}function T(X,ee,le,re){for(var ce=0,ue=ee.length,me=le.length,we,ye;ce=me)return-1;if(we=ee.charCodeAt(ce++),we===37){if(we=ee.charAt(ce++),ye=S[we in MP?ee.charAt(ce++):we],!ye||(re=ye(X,le,re))<0)return-1}else if(we!=le.charCodeAt(re++))return-1}return re}function k(X,ee,le){var re=u.exec(ee.slice(le));return re?(X.p=f.get(re[0].toLowerCase()),le+re[0].length):-1}function I(X,ee,le){var re=h.exec(ee.slice(le));return re?(X.w=g.get(re[0].toLowerCase()),le+re[0].length):-1}function M(X,ee,le){var re=m.exec(ee.slice(le));return re?(X.w=p.get(re[0].toLowerCase()),le+re[0].length):-1}function N(X,ee,le){var re=v.exec(ee.slice(le));return re?(X.m=b.get(re[0].toLowerCase()),le+re[0].length):-1}function D(X,ee,le){var re=y.exec(ee.slice(le));return re?(X.m=x.get(re[0].toLowerCase()),le+re[0].length):-1}function j(X,ee,le){return T(X,t,ee,le)}function F(X,ee,le){return T(X,n,ee,le)}function R(X,ee,le){return T(X,r,ee,le)}function P(X){return a[X.getDay()]}function L(X){return o[X.getDay()]}function U(X){return c[X.getMonth()]}function O(X){return i[X.getMonth()]}function $(X){return s[+(X.getHours()>=12)]}function G(X){return 1+~~(X.getMonth()/3)}function H(X){return a[X.getUTCDay()]}function Q(X){return o[X.getUTCDay()]}function Y(X){return c[X.getUTCMonth()]}function te(X){return i[X.getUTCMonth()]}function se(X){return s[+(X.getUTCHours()>=12)]}function ae(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var ee=C(X+="",_);return ee.toString=function(){return X},ee},parse:function(X){var ee=E(X+="",!1);return ee.toString=function(){return X},ee},utcFormat:function(X){var ee=C(X+="",w);return ee.toString=function(){return X},ee},utcParse:function(X){var ee=E(X+="",!0);return ee.toString=function(){return X},ee}}}var MP={"-":"",_:" ",0:"0"},zr=/^\s*\d+/,F$e=/^%/,B$e=/[\\^$*+?|[\]().{}]/g;function dn(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",o=s.length;return r+(o[t.toLowerCase(),n]))}function V$e(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function H$e(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function z$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function W$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function G$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function TP(e,t,n){var r=zr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function AP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function $$e(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 q$e(e,t,n){var r=zr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function K$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function NP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Y$e(e,t,n){var r=zr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function RP(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Q$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function X$e(e,t,n){var r=zr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Z$e(e,t,n){var r=zr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function J$e(e,t,n){var r=zr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function eqe(e,t,n){var r=F$e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function tqe(e,t,n){var r=zr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function nqe(e,t,n){var r=zr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function DP(e,t){return dn(e.getDate(),t,2)}function rqe(e,t){return dn(e.getHours(),t,2)}function sqe(e,t){return dn(e.getHours()%12||12,t,2)}function oqe(e,t){return dn(1+em.count(ba(e),e),t,3)}function lre(e,t){return dn(e.getMilliseconds(),t,3)}function aqe(e,t){return lre(e,t)+"000"}function iqe(e,t){return dn(e.getMonth()+1,t,2)}function lqe(e,t){return dn(e.getMinutes(),t,2)}function cqe(e,t){return dn(e.getSeconds(),t,2)}function uqe(e){var t=e.getDay();return t===0?7:t}function dqe(e,t){return dn(Bg.count(ba(e)-1,e),t,2)}function cre(e){var t=e.getDay();return t>=4||t===0?cf(e):cf.ceil(e)}function fqe(e,t){return e=cre(e),dn(cf.count(ba(e),e)+(ba(e).getDay()===4),t,2)}function mqe(e){return e.getDay()}function pqe(e,t){return dn(O2.count(ba(e)-1,e),t,2)}function hqe(e,t){return dn(e.getFullYear()%100,t,2)}function gqe(e,t){return e=cre(e),dn(e.getFullYear()%100,t,2)}function yqe(e,t){return dn(e.getFullYear()%1e4,t,4)}function xqe(e,t){var n=e.getDay();return e=n>=4||n===0?cf(e):cf.ceil(e),dn(e.getFullYear()%1e4,t,4)}function vqe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dn(t/60|0,"0",2)+dn(t%60,"0",2)}function jP(e,t){return dn(e.getUTCDate(),t,2)}function bqe(e,t){return dn(e.getUTCHours(),t,2)}function _qe(e,t){return dn(e.getUTCHours()%12||12,t,2)}function wqe(e,t){return dn(1+Fg.count(ai(e),e),t,3)}function ure(e,t){return dn(e.getUTCMilliseconds(),t,3)}function Cqe(e,t){return ure(e,t)+"000"}function Sqe(e,t){return dn(e.getUTCMonth()+1,t,2)}function Eqe(e,t){return dn(e.getUTCMinutes(),t,2)}function kqe(e,t){return dn(e.getUTCSeconds(),t,2)}function Mqe(e){var t=e.getUTCDay();return t===0?7:t}function Tqe(e,t){return dn(Ug.count(ai(e)-1,e),t,2)}function dre(e){var t=e.getUTCDay();return t>=4||t===0?uf(e):uf.ceil(e)}function Aqe(e,t){return e=dre(e),dn(uf.count(ai(e),e)+(ai(e).getUTCDay()===4),t,2)}function Nqe(e){return e.getUTCDay()}function Rqe(e,t){return dn(L2.count(ai(e)-1,e),t,2)}function Dqe(e,t){return dn(e.getUTCFullYear()%100,t,2)}function jqe(e,t){return e=dre(e),dn(e.getUTCFullYear()%100,t,2)}function Iqe(e,t){return dn(e.getUTCFullYear()%1e4,t,4)}function Pqe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?uf(e):uf.ceil(e),dn(e.getUTCFullYear()%1e4,t,4)}function Oqe(){return"+0000"}function IP(){return"%"}function PP(e){return+e}function OP(e){return Math.floor(+e/1e3)}var Uu,zg,fre;Lqe({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 Lqe(e){return Uu=L$e(e),zg=Uu.format,Uu.parse,fre=Uu.utcFormat,Uu.utcParse,Uu}const Fqe=zg("%b %d"),Bqe=zg("%b"),Uqe=zg("%Y");function Vqe(e){return e?(e=new Date(e),(Vg(e){if(!e&&(e!==0||!n?.renderZero))return"";const s=t&&/^[A-Z]{3}$/.test(t)?t:void 0,o=e%1===0&&!n?.alwaysShowMinor||n?.roundToMajor?0:2;let a=n?.roundToMajor?0:2;if(e>0&&e<1){const c=Math.abs(e).toExponential();a=Math.abs(parseInt(c.split("e")[1]))+1}const i=Intl.NumberFormat(void 0,{style:s?"currency":"decimal",currency:s,minimumFractionDigits:1,maximumFractionDigits:1,currencyDisplay:n?.currencyDisplay??"narrowSymbol"});return n?.truncate&&e>=1e6?`${i.format(e/1e6)}M`:n?.truncate&&e>=1e3?`${i.format(e/1e3)}k`:e.toLocaleString(void 0,{style:s?"currency":"decimal",currency:s,minimumFractionDigits:o,maximumFractionDigits:a,currencyDisplay:n?.currencyDisplay??"narrowSymbol"})},mb=d.memo(({configuration:e,onConfigurationChange:t,errorMessage:n,onError:r,canEditSpace:s})=>{const o=!!e.id,a=d.useCallback(y=>{let x=e.query;switch(y.type){case Ze.PRICE_ALERT:{x={...e.query,prompt:e.query.prompt};break}case Ze.SCHEDULED:case Ze.SHORTCUT:break;default:At(y)}const v={...e,trigger:y,query:x};r?.(null),t(v)},[e,t,r]),i=d.useCallback(y=>{const x={...e,query:y};t(x)},[e,t]),c=d.useCallback(y=>{const x={...e,collectionUuid:y};t(x)},[e,t]),u=d.useCallback(y=>{const x={...e,notificationSettings:y};t(x)},[e,t]),{variation:f,loading:m}=g$e(!0),{variation:p,loading:h}=h$e(!1),g=e.trigger.type===Ze.PRICE_ALERT&&(!e.trigger.symbol||e.trigger.symbol.trim()==="");return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Xne,{trigger:e.trigger,query:e.query,onQueryChange:i}),!h&&p&&e.trigger.type===Ze.SCHEDULED&&l.jsx(rre,{selectedSpaceUuid:e.collectionUuid,onSpaceChange:c,disabled:!s}),l.jsx(tre,{trigger:e.trigger,onTriggerChange:a,isEditing:o,defaultTargetPriceValue:e.defaultTargetPriceValue}),l.jsx(Gne,{trigger:e.trigger,onTriggerChange:a}),!m&&f&&l.jsx($ne,{notificationSettings:e.notificationSettings??Kl,onNotificationSettingsChange:u,disabled:g}),e.trigger.type===Ze.PRICE_ALERT&&l.jsx("div",{className:"flex flex-col gap-2",children:l.jsx(ib,{trigger:e.trigger,prompt:e.query.prompt,onPromptChange:y=>i({...e.query,prompt:y}),variant:"subtle",disabled:g})}),l.jsx(Hne,{trigger:e.trigger,query:e.query,onQueryChange:i}),n&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:n})]})]})});mb.displayName="AutomationConfiguration";function Hqe(e,t,n,r){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,schedule:mp(e.schedule),task_name:"",expiry_date:zH(e.expiryDate??e.defaultExpiryDate),notification_settings:n,collection_uuid:r??void 0}}function zqe(e,t){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,task_name:e.shortcut,schedule:{rrule:"",start_at:"",tzid:""}}}function mre({trigger:e,query:t,quote:n}){const{symbol:r}=e,s=n?.name?` (${n.name})`:void 0;switch(e.alertType){case fr.TARGET_PRICE:{const o=n?.price||0,a=$v({symbol:r,quoteName:s}),i=e.price>o?"above":"below",c=wI({rawInstructions:a,symbol:r,quoteName:s||"",eventValue:`$${e.price}`,direction:i}),u=_I({prompt:t.prompt,baseInstructions:c});return RE({symbol:r,alertType:"price",priceValue:`$${e.price}`,priceThreshold:i,baseInstructions:c,additionalInstructions:u})}case fr.MOVEMENT_AMOUNT:{const o=qv({symbol:r,quoteName:s}),a=e.percentageDecimalUpperBound>0&&e.percentageDecimalUpperBound!==Bl/100,i=e.percentageDecimalLowerBound<0&&e.percentageDecimalLowerBound!==Ul/100;let c,u;a&&i?(c=(e.percentageDecimalUpperBound*100).toFixed(2),u="increase or decrease"):a?(c=(e.percentageDecimalUpperBound*100).toFixed(2),u="increase"):i?(c=(Math.abs(e.percentageDecimalLowerBound)*100).toFixed(2),u="decrease"):(c="0.00",u="change");const f=wI({rawInstructions:o,symbol:r,quoteName:s||"",eventValue:c,direction:u}),m=_I({prompt:t.prompt,baseInstructions:f});return RE({symbol:r,alertType:"movement",percentValue:c,positiveSelected:a,negativeSelected:i,baseInstructions:f,additionalInstructions:m})}default:At(e)}}function Wqe(e,t,n,r,s){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,status:n==="COMPLETED"?"PAUSED":n,schedule:mp(e.schedule),expiry_date:zH(e.expiryDate??e.defaultExpiryDate),clear_expiry:e.expiryDate===null?!0:void 0,notification_settings:r,collection_uuid:s===null?void 0:s,clear_collection_uuid:s===null?!0:void 0}}function Gqe(e,t,n){return{prompt:t.prompt,model_preference:t.searchModel,sources:t.sources,status:n==="COMPLETED"?"PAUSED":n,task_name:e.shortcut}}function $qe({trigger:e,query:t,status:n,quote:r}){const s=mre({trigger:e,query:t,quote:r});return s?{task_name:s.task_name,prompt:s.prompt,event_subscription:s.event_subscription,model_preference:s.model_preference,status:n==="COMPLETED"?"PAUSED":n}:null}function pre({onCreateSuccess:e,onCreateError:t,onUpdateSuccess:n,onUpdateError:r,onDeleteSuccess:s,onDeleteError:o}={}){const{$t:a}=J(),i=Yt(),c=Rt({mutationFn:p=>S9e({payload:p,reason:"finance-add-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:pp()}),e?.()},onError:p=>t?.(p)}),u=Rt({mutationFn:({taskId:p,payload:h})=>E9e({taskId:p,payload:h,reason:"finance-edit-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:pp()}),n?.()},onError:p=>{if(p instanceof Error)switch(p.name){case"TimeoutError":r?.({detail:a({defaultMessage:"Network Timeout",id:"Z+mLGQc4GD"})});break;default:Z.error(`Unknown error occured: ${p.name}`),r?.({detail:a({defaultMessage:"Unknown error occurred",id:"y1q3uzCFY6"})})}else r?.(p)}}),f=Rt({mutationFn:p=>nX({taskId:p,reason:"finance-delete-alert"}),onSuccess:()=>{i.invalidateQueries({queryKey:pp()}),s?.()},onError:()=>o?.()}),m=c.isPending||u.isPending||f.isPending;return d.useMemo(()=>({createMutation:c,updateMutation:u,deleteMutation:f,isMutationLoading:m}),[c,u,f,m])}const qqe=()=>{const{formatMessage:e}=J();return{getErrorMessage:n=>{switch(n?.detail?.error_code){case Nj.TASK_LIMIT_EXCEEDED:return e({defaultMessage:"You have reached the maximum of number of active tasks of this type for your subscription level.",id:"3H43PMJpfD"});case Nj.SHORTCUT_NAME_ALREADY_EXISTS:return e({defaultMessage:"A shortcut with this name already exists. Please choose a different name.",id:"GpnXJDWEkN"});default:return e({defaultMessage:"Something went wrong. Please try again.",id:"W/5hwrn09m"})}}}},Kqe={settings_create:!0,settings_edit:!0,settings_suggest:!0,settings_primer:!0,task_widget:!0,discover_task_widget:!0,thread_dropdown:!0,typeahead_create:!0,notifications_panel:!0,router:!0,space_tasks_create:!0,space_tasks_edit:!0,study_hub_spaced_repetition:!0};function dk(e){return e in Kqe}const Yqe={settings_create:!0,settings_edit:!0,settings_suggest:!0,finance_home_page:!0,finance_asset_page:!0};function LP(e){return e in Yqe}const Qqe={settings_create:!0,settings_edit:!0,typeahead_create:!0,thread_create:!0,suggestions_dropdown:!0,notifications_panel:!0,typeahead_edit:!0,shortcut_widget:!0,settings_paste:!0,try_assistant_suggestions:!0,thread_upsell_create:!0};function FP(e){return e in Qqe}const Xqe={created:!0,updated:!0,deleted:!0,paused:!0,resumed:!0,skipped:!0};function hre(e){return e in Xqe}const Zqe={created:!0,updated:!0,deleted:!0,paused:!0,resumed:!0,skipped:!0};function Jqe(e){return e in Zqe}const eKe={created:!0,updated:!0,deleted:!0,copied:!0,skipped:!0};function tKe(e){return e in eKe}function gre({reason:e,source:t,onSuccess:n,onError:r}){const s=Yt(),{session:o}=Ne(),{trackEvent:a}=Xe(o),{getErrorMessage:i}=qqe(),c=d.useCallback((y,x)=>{s.invalidateQueries({queryKey:pp()}),s.invalidateQueries({queryKey:s2e()}),x&&s.invalidateQueries({queryKey:GH(x)}),n?.(y)},[s,n]),u=d.useCallback((y,x)=>{dk(t)&&hre(y)&&a("task modal action",{source:t,action:y}),c(y,x)},[t,a,c]),f=Rt({mutationFn:y=>C9e({payload:y,reason:e}),onSuccess:y=>u("created",y.task_id),onError:y=>r(i(y))}),m=Rt({mutationFn:({id:y,payload:x})=>Rj({taskId:y,payload:x,reason:e}),onSuccess:y=>u("updated",y.task.task_id),onError:y=>r(i(y))}),p=Rt({mutationFn:({id:y,newStatus:x})=>Rj({taskId:y,payload:{status:x},reason:e}),onSuccess:y=>{u(y.task.status==="PAUSED"?"paused":"resumed",y.task.task_id)},onError:y=>r(i(y))}),h=Rt({mutationFn:y=>nX({taskId:y,reason:e}),onSuccess:()=>u("deleted"),onError:y=>r(i(y))}),g=f.isPending||m.isPending||p.isPending||h.isPending;return{createMutation:f,updateMutation:m,toggleMutation:p,deleteMutation:h,isMutationLoading:g,invalidateAndClose:c}}function nKe({initialConfiguration:e,isModalOpened:t,reason:n,source:r,onSuccess:s,onError:o}){const{$t:a}=J(),{hasActiveSubscription:i}=$t(),[c,u]=d.useState(y4(e??g4(i))),f=d.useCallback(T=>{u(T)},[]),m=(()=>{switch(c.trigger.type){case Ze.PRICE_ALERT:return c.trigger.symbol;case Ze.SCHEDULED:case Ze.SHORTCUT:return null;default:At(c.trigger)}})(),{data:p,isLoading:h}=ab({symbol:m,enabled:!!m&&t}),g=gre({reason:n,source:r,onSuccess:s,onError:o}),y=pre({onCreateSuccess:()=>s("created"),onCreateError:T=>o(`Failed to create price alert - ${T.detail}`),onUpdateSuccess:()=>s("updated"),onUpdateError:T=>o(`Failed to update price alert - ${T.detail}`),onDeleteSuccess:()=>s("deleted"),onDeleteError:()=>o("Failed to delete price alert")}),x=h||g.isMutationLoading||y.isMutationLoading,v=d.useCallback(T=>{const k=T?{...c,...T}:c;if(k.id)switch(k.trigger.type){case Ze.SCHEDULED:g.updateMutation.mutate({id:k.id,payload:Wqe(k.trigger,k.query,k.status,k.notificationSettings,k.collectionUuid)});break;case Ze.PRICE_ALERT:{const I=$qe({trigger:k.trigger,query:k.query,status:k.status,quote:p});I?y.updateMutation.mutate({taskId:k.id,payload:I}):o(a({defaultMessage:"Failed to update price alert payload - Missing inputs",id:"293dgMfZdE"}));break}case Ze.SHORTCUT:g.updateMutation.mutate({id:k.id,payload:Gqe(k.trigger,k.query,k.status)});break;default:At(k.trigger)}else switch(k.trigger.type){case Ze.SCHEDULED:g.createMutation.mutate(Hqe(k.trigger,k.query,k.notificationSettings??Kl,k.collectionUuid));break;case Ze.PRICE_ALERT:{const I=mre({trigger:k.trigger,query:k.query,quote:p});I?y.createMutation.mutate(I):o(a({defaultMessage:"Failed to create price alert payload - Missing inputs",id:"Fimh9vZMY/"}));break}case Ze.SHORTCUT:g.createMutation.mutate(zqe(k.trigger,k.query));break;default:At(k.trigger)}},[c,g.updateMutation,g.createMutation,p,y.updateMutation,y.createMutation,o,a]),b=d.useCallback(()=>{v()},[v]),_=d.useCallback(T=>{if(!c.id)return;v({status:T?"ACTIVE":"PAUSED"})},[c.id,v]),w=d.useCallback(()=>{if(c.id)switch(c.trigger.type){case Ze.SCHEDULED:g.deleteMutation.mutate(c.id);break;case Ze.PRICE_ALERT:y.deleteMutation.mutate(c.id);break;case Ze.SHORTCUT:g.deleteMutation.mutate(c.id);break;default:At(c.trigger)}},[c.id,c.trigger,y.deleteMutation,g.deleteMutation]),S=yre({isLoading:x,currentConfiguration:c}),C=d.useMemo(()=>{switch(c.trigger.type){case Ze.SCHEDULED:case Ze.SHORTCUT:return;case Ze.PRICE_ALERT:return S?a({defaultMessage:"Select stock, token or fund to begin",id:"x/nyvvB4aQ"}):void 0;default:At(c.trigger)}},[a,c.trigger,S]),E=c.status==="ACTIVE";return{currentConfiguration:c,setCurrentConfiguration:f,onClickSave:b,onClickToggle:_,onClickDelete:w,isEnabled:E,isLoading:x,isSaveDisabled:S,saveButtonTooltipText:C}}function yre({isLoading:e,currentConfiguration:t}){if(e)return!0;switch(t.trigger.type){case Ze.SCHEDULED:case Ze.SHORTCUT:return!t.query.prompt;case Ze.PRICE_ALERT:{const n=t.trigger;if(!n.symbol||n.symbol.trim()==="")return!0;switch(n.alertType){case fr.TARGET_PRICE:if(!n.price||n.price<=0)return!0;break;case fr.MOVEMENT_AMOUNT:{const r=n.percentageDecimalLowerBound!==Ul/100&&n.percentageDecimalLowerBound!==0;if(!(n.percentageDecimalUpperBound!==Bl/100&&n.percentageDecimalUpperBound!==0)&&!r)return!0;break}default:At(n)}break}default:At(t.trigger)}return!1}const xre=({onSkip:e,onConfirm:t,disabled:n=!1,isLoading:r=!1,result:s=null,buttonText:o,loadingText:a})=>{const{$t:i}=J();return s!==null?l.jsx(K,{className:"bg-base border-t pt-4",children:l.jsx("div",{className:"text-quiet text-sm",children:s?.confirmed===!0?i({defaultMessage:"Task will be created",id:"+A0SHGFNa7"}):i({defaultMessage:"Task was skipped",id:"uRAWVsTn39"})})}):l.jsx(K,{className:"bg-base border-t pt-4",children:l.jsx("div",{className:"flex items-center justify-between gap-4",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ge,{size:"small",variant:"primary",text:r?a||i({defaultMessage:"Creating...",id:"mRL9Vh/e/Z"}):o||i({defaultMessage:"Create Task",id:"4+iiEILSrA"}),onClick:t,disabled:n||r}),l.jsx(st,{size:"small",text:i({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:e,disabled:n||r})]})})})},r_t="pplx.watchlist",s_t=async({query:e,watchlistType:t,limit:n,category:r,cometRenderPlace:s,reason:o})=>{const{data:a,error:i,response:c}=await de.GET("/rest/homepage-widgets/watchlist/list-autosuggest",o,{params:{query:{type:t,query:e,limit:n,category:r,entropy_render_place:s}},timeoutMs:1500,numRetries:1});if(i)throw new he("API_CLIENTS_ERROR",{message:"Failed to get watchlist autosuggestions",cause:i,status:c.status??0});return a.results??Pe},rKe=async({watchlistType:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/homepage-widgets/watchlist/subscription",t,{params:{query:{type:e}},headers:{"content-type":"application/json"},numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get watchlist subscriptions",cause:n,status:s.status??0});return r.results??[]}catch(n){return Z.error(n),[]}},o_t=async({watchlistType:e,reason:t})=>{try{const{error:n,data:r,response:s}=await de.GET("/rest/homepage-widgets/watchlist/categories",t,{params:{query:{type:e}},numRetries:1});if(n)throw new he("API_CLIENTS_ERROR",{message:"Failed to get watchlist categories",cause:n,status:s.status??0});return r?.results??[]}catch(n){return Z.error(n),[]}},sKe=async({watchlistType:e,identifier:t,reason:n})=>{try{const{error:r,response:s}=await de.PUT("/rest/homepage-widgets/watchlist/subscription",n,{params:{query:{type:e,identifier:t??""}},headers:{"content-type":"application/json"}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to add watchlist subscription",cause:r,status:s.status??0});return!0}catch(r){return Z.error(r),!1}},oKe=async({watchlistType:e,identifier:t,reason:n})=>{try{const{error:r,response:s}=await de.DELETE("/rest/homepage-widgets/watchlist/subscription",n,{params:{query:{type:e,identifier:t}},headers:{"content-type":"application/json"}});if(r)throw new he("API_CLIENTS_ERROR",{message:"Failed to remove watchlist subscription",cause:r,status:s.status??0});return!0}catch(r){return Z.error(r),!1}},aKe=async({watchlistType:e,identifier:t,order:n,reason:r})=>{try{const{error:s,response:o}=await de.PATCH("/rest/homepage-widgets/watchlist/subscription",r,{params:{query:{type:e,identifier:t}},body:{order:n},headers:{"content-type":"application/json"}});if(s)throw new he("API_CLIENTS_ERROR",{message:"Failed to update watchlist subscription order",cause:s,status:o.status??0});return!0}catch(s){return Z.error(s),!1}},Th=e=>be.makeEphemeralQueryKey("watchlist",e,"subscriptions"),iKe=e=>be.makeEphemeralQueryKey("watchlist",e,"addSubscription"),lKe=e=>be.makeEphemeralQueryKey("watchlist",e,"removeSubscription"),cKe=e=>be.makeEphemeralQueryKey("watchlist",e,"updateSubscription"),uKe=({watchlistType:e,reason:t})=>{const n=Wt(),r=Th(e);return mt({queryKey:r,queryFn:()=>rKe({watchlistType:e,reason:t}),staleTime:0,enabled:n})},dKe=({watchlistType:e,queryClient:t,reason:n})=>{const r=Th(e);return Rt({mutationKey:iKe(e),mutationFn:async s=>sKe({watchlistType:e,reason:n,...s}),onMutate:async({identifier:s,description:o,image:a,title:i})=>{await t.cancelQueries({queryKey:r});const c=t.getQueryData(Th(e));return t.setQueryData(r,(u=[])=>{const f={identifier:s??"",description:o??"",image_url:a??"",title:i??"",subscribed:!0,order:Date.now()},m=u.filter(p=>p.identifier!==s);return[f,...m]}),{previousSubscriptions:c}},onError:(s,o,a)=>{Z.error("Error adding watchlist subscription",s),t.setQueryData(r,a?.previousSubscriptions)},onSuccess:()=>{t.invalidateQueries({queryKey:r})}})},fKe=({watchlistType:e,queryClient:t,reason:n})=>{const r=Th(e);return Rt({mutationKey:lKe(e),mutationFn:async s=>oKe({watchlistType:e,reason:n,...s}),onSuccess:()=>{t.invalidateQueries({queryKey:r})},onMutate:async({identifier:s})=>{await t.cancelQueries({queryKey:r});const o=t.getQueryData(["watchlist",e]);return t.setQueryData(r,(a=[])=>a.filter(i=>i.identifier!==s)),{previousSubscriptions:o}},onError:(s,o,a)=>{Z.error("Error removing watchlist subscription",s),t.setQueryData(r,a?.previousSubscriptions)}})},a_t=({watchlistType:e,queryClient:t,reason:n})=>{const r=Th(e);return Rt({mutationKey:cKe(e),mutationFn:async s=>aKe({watchlistType:e,reason:n,...s}),onMutate:async({newOrderedList:s})=>{await t.cancelQueries({queryKey:r});const o=t.getQueryData(r);return t.setQueryData(r,s),{previousSubscriptions:o}},onError:(s,o,a)=>{Z.error("Error updating watchlist subscription order",s),a?.previousSubscriptions&&t.setQueryData(r,a.previousSubscriptions)},onSuccess:()=>{t.invalidateQueries({queryKey:r})}})},pb=0,hb=1,nN=!0,gb="finance",vre=!1,bre="1d",_re=0,wre=!0,Cre=!0,Sre=!1,Ere=null,kre=null,Mre=null,rN=({prefix:e="finance/quote",symbol:t,withHistory:n=vre,historyAfterHours:r=wre,historyPeriod:s=bre,historyOffset:o=_re,historyRedirect:a=Sre,historyInterval:i=Ere,historyStartDate:c=kre,historyEndDate:u=Mre,withUiHints:f=Cre})=>be.makeEphemeralQueryKey(e,t,n,r,s,i,o,a,c,u,f),eu=async({symbol:e,withHistory:t=vre,historyAfterHours:n=wre,historyPeriod:r=bre,historyOffset:s=_re,historyRedirect:o=Sre,historyInterval:a=Ere,withUiHints:i=Cre,historyStartDate:c=kre,historyEndDate:u=Mre})=>{const{data:f,error:m,response:p}=await de.GET("/rest/finance/quote/{market_identifier}",gb,{params:{path:{market_identifier:e},query:{with_history:t,history_period:r,history_offset:s,history_after_hours:n,with_ui_hints:i,history_redirect:o,history_time_interval:a,history_start_date:c,history_end_date:u}},timeoutMs:pb,numRetries:hb,shouldNotAddSourceVersionQueryParams:nN});if(p.status===404)return null;if(m)throw new he("API_CLIENTS_ERROR",{cause:m,status:p.status??0});return f};function mKe(e,t){return be.makeEphemeralQueryKey("finance/peers",e,t)}async function pKe({symbol:e,headers:t,index:n}){const{data:r,error:s,response:o}=await de.GET("/rest/finance/peers/{market_identifier}",gb,{params:{path:{market_identifier:e},query:{with_index:n}},headers:t,timeoutMs:pb,numRetries:hb});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r}const BP=(e,t)=>["finance-autosuggest",e,t],UP=async({query:e,reason:t,country:n})=>{try{const{data:r,error:s,response:o}=await de.GET("/rest/autosuggest/finance/list-autosuggest",t,{params:{query:{query:e,country:n}},timeoutMs:0});if(s)throw new he("API_CLIENTS_ERROR",{cause:s,status:o.status??0});return r.results??Pe}catch(r){return Z.error(r),[]}},hKe=(e,t,n)=>be.makeEphemeralQueryKey("finance/currency-exchange",e,t,n);async function gKe({sourceCurrency:e,targetCurrency:t,amount:n=1,headers:r}){const{data:s,error:o,response:a}=await de.GET("/rest/finance/currency-exchange",gb,{params:{query:{source_currency:e,target_currency:t,amount:n}},headers:r,timeoutMs:pb,numRetries:hb,shouldNotAddSourceVersionQueryParams:nN});if(o)throw new he("API_CLIENTS_ERROR",{cause:o,status:a.status??0});return s}const yKe=({eventId:e,historyPeriod:t,marketsSort:n,withCommentary:r,emphasizedMarketIds:s})=>be.makeEphemeralQueryKey("finance/prediction-markets/quote",e,t,n,r,s);async function xKe({eventId:e,historyPeriod:t,marketsSort:n="probability",withCommentary:r,emphasizedMarketIds:s}){const o=await de.GET("/rest/finance/prediction-markets/quote/{event_id}",gb,{params:{path:{event_id:e},query:{history_period:t,markets_sort:n,with_commentary:r,emphasized_market_ids:s}},timeoutMs:pb,numRetries:hb,shouldNotAddSourceVersionQueryParams:nN});if(o.error)throw new Error("Failed to fetch polymarket quote",{cause:o.error});return o.data}function vKe(e,t){const n=t.target_price!=null,r=t.movement_percent!=null,s=t.target_price?.toString(),o={query:{prompt:e.prompt||"",searchModel:e.model_preference||ie.DEFAULT},status:"ACTIVE",notificationSettings:Kl,defaultTargetPriceValue:s};if(n)return{...o,trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:t.target_price,currency:CI,symbol:t.ticker_symbol}};if(r){const a=t.movement_percent/100;return{...o,trigger:{type:Ze.PRICE_ALERT,alertType:fr.MOVEMENT_AMOUNT,percentageDecimalLowerBound:t.negative_direction?-a:0,percentageDecimalUpperBound:t.positive_direction?a:0,symbol:t.ticker_symbol}}}else return{...o,trigger:{type:Ze.PRICE_ALERT,alertType:fr.TARGET_PRICE,price:0,currency:CI,symbol:t.ticker_symbol}}}async function bKe(e){try{return(await eu({symbol:e}))?.currency?.toLowerCase()||"usd"}catch(t){return Z.warn(`Failed to fetch currency for symbol ${e}`,{error:t}),"usd"}}const _Ke=({result:e})=>e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),size:14,className:"text-super shrink-0",title:"Confirmed"}),l.jsx("span",{className:"text-super text-xs font-medium leading-none",children:l.jsx(je,{defaultMessage:"Alert confirmed",id:"0wByyMUPxz"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:l.jsx(je,{defaultMessage:"Alert skipped",id:"AYQONqG1U3"})})]}):null,Tre=A.memo(({sendStepResult:e,taskAction:t,priceAlertData:n,stepUUID:r,isFinished:s=!1})=>{const{$t:o}=J(),{session:a}=Ne(),{trackEvent:i}=Xe(a),c="settings_create",[u,f]=d.useState(()=>vKe(t,n)),[m,p]=d.useState(null),[h,g]=d.useState(null),[y,x]=d.useState(null),v=d.useRef(!1),b="price_alert_operation";d.useEffect(()=>{(async()=>{if(!n.ticker_symbol||s){g(!0);return}try{await eu({symbol:n.ticker_symbol})===null?(g(!1),e({confirmed:!1,user_input:o({defaultMessage:'The stock symbol "{symbol}" could not be found. Please verify the ticker symbol is correct.',id:"yWihQJNDOI"},{symbol:n.ticker_symbol})},b,!1)):g(!0)}catch(k){Z.error("Failed to validate ticker",{ticker:n.ticker_symbol,error:k}),g(!1),e({confirmed:!1,user_input:o({defaultMessage:'Unable to validate the stock symbol "{symbol}" due to a network error. Please try again.',id:"C0nM7QfjoN"},{symbol:n.ticker_symbol})},b,!1)}})()},[n.ticker_symbol]),d.useEffect(()=>{t&&!s&&h===!0&&!v.current&&(i("price alert modal opened",{source:c}),v.current=!0)},[h]),d.useEffect(()=>{(async()=>{if(n.ticker_symbol&&h===!0&&u.trigger.type===Ze.PRICE_ALERT)try{const k=await bKe(n.ticker_symbol);f(I=>({...I,trigger:{...I.trigger,currency:k}}))}catch(k){Z.warn("Failed to fetch currency for ticker",{ticker:n.ticker_symbol,error:k})}})()},[n.ticker_symbol,h,u.trigger.type]);const _=d.useMemo(()=>o({defaultMessage:"Create Price Alert",id:"WY6/zFtq4x"}),[o]),w=d.useCallback(T=>{p(T),T.confirmed?(i("price alert modal action",{source:c,action:"created"}),e({confirmed:!0,task_action:T.task_action},b,!1)):(i("price alert modal action",{source:c,action:"deleted"}),e({confirmed:!1},b,!1))},[e,b,i,c]),S=d.useCallback(()=>{p({confirmed:!1}),i("price alert modal action",{source:c,action:"skipped"}),e({confirmed:!1},b,!1)},[i,c,e,b]),C=d.useCallback(()=>{const T=u.trigger;let k={task_name:`Price Alert: ${n.ticker_symbol}`,prompt:u.query?.prompt,model_preference:u.query?.searchModel||ie.DEFAULT,schedule:void 0,expiry_date:void 0,event_entity:n.ticker_symbol};switch(T.alertType){case fr.TARGET_PRICE:{k={...k,event_type:"STOCK_PRICE_TARGET",target_price:T.price,current_price:n.current_price};break}case fr.MOVEMENT_AMOUNT:{const I=T.percentageDecimalUpperBound,M=T.percentageDecimalLowerBound;k={...k,event_type:"STOCK_PRICE_MOVEMENT",upper_bound:I&&I>0?I*100:void 0,lower_bound:M&&M<0?M*100:void 0};break}default:At(T)}w({confirmed:!0,task_action:k})},[u,w,n]),E=d.useMemo(()=>s?!0:yre({isLoading:!1,currentConfiguration:u}),[u,s]);return!t||!n?null:s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:o({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):h===null||h===!1?null:l.jsxs("div",{className:"bg-subtler border-subtlest transform rounded-xl border transition-transform duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between rounded-t-lg px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:l.jsx(ut,{name:B("trending-up"),size:16,className:"text-quiet"})}),l.jsx("h3",{className:"text-foreground text-sm font-medium",children:_})]}),l.jsx(_Ke,{result:m})]}),l.jsx("div",{className:"p-4",children:l.jsx(Wc,{children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(mb,{configuration:u,onConfigurationChange:f,errorMessage:y??void 0,onError:x,canEditSpace:!1}),y&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:y})]}),l.jsx(xre,{onSkip:S,onConfirm:C,disabled:E,result:m,buttonText:_})]})})})]})});Tre.displayName="PriceAlertOperationStep";const wKe=e=>{const[t,n]=d.useState([]),r=d.useRef(e);d.useEffect(()=>{r.current=e},[e]);const s=d.useCallback((i,c)=>{n(u=>{const f=[...u];return f[i]=c,f})},[]),o=d.useMemo(()=>new Map,[]);d.useEffect(()=>{const i=t.reduce((c,u)=>c+u,0);i>0&&r.current?.(i)},[t]);const a=d.useCallback(i=>(o.has(i)||o.set(i,c=>{s(i,c)}),o.get(i)),[o,s]);return d.useMemo(()=>({groupCounts:t,handleGroupCountChange:s,getGroupHandler:a}),[t,s,a])},Are=A.memo(({result:e,textClassName:t})=>{const n=d.useMemo(()=>e.start?new Date(e.start):null,[e.start]),r=d.useMemo(()=>e.end?new Date(e.end):null,[e.end]),s=e.is_all_day===!0,o=Nee(e.calendar_color?.background||"oklch(var(--super-color))"),a=Ree(o),i=d.useMemo(()=>r?new Date(r.getTime()-1440*60*1e3):null,[r]),c=()=>n?s?(r?Math.round((r.getTime()-n.getTime())/864e5):1)<=1?l.jsx(Ip,{startDate:n,endDate:n,isAllDay:!0,showDate:!0,includeYear:!1}):l.jsx(Ip,{startDate:n,endDate:i,isAllDay:!0,showDate:!0,includeYear:!1}):l.jsx(Ip,{startDate:n,endDate:r||n,isAllDay:!1,showDate:!0,includeYear:!1}):null;return l.jsx("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer gap-3 rounded-lg px-2 py-1.5",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"py-xs relative w-1",children:l.jsx("div",{className:z("inset-y-two absolute w-1 shrink-0 self-stretch rounded-full",{"brightness-[0.8]":a==="Fail"}),style:{backgroundColor:o}})}),l.jsxs("div",{className:"gap-two flex min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex min-w-0 items-center justify-between gap-2",children:e.title&&l.jsx(V,{variant:"smallBold",className:"shrink-0",as:"span",children:e.title})}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:n&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis",t),variant:"tinyMono",color:"light",as:"span",children:c()})})]})]})})});Are.displayName="CalendarResult";var op={exports:{}};var CKe=op.exports,VP;function SKe(){return VP||(VP=1,(function(e,t){(function(n){var r=t,s=e&&e.exports==r&&e,o=typeof td=="object"&&td;(o.global===o||o.window===o)&&(n=o);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,i=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,u=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,f={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot"," ":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr",ª:"ordf",á:"aacute",Á:"Aacute",à:"agrave",À:"Agrave",ă:"abreve",Ă:"Abreve",â:"acirc",Â:"Acirc",å:"aring",Å:"angst",ä:"auml",Ä:"Auml",ã:"atilde",Ã:"Atilde",ą:"aogon",Ą:"Aogon",ā:"amacr",Ā:"Amacr",æ:"aelig",Æ:"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf",ℬ:"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf",ℭ:"Cfr","𝒞":"Cscr",ℂ:"Copf",ć:"cacute",Ć:"Cacute",ĉ:"ccirc",Ĉ:"Ccirc",č:"ccaron",Č:"Ccaron",ċ:"cdot",Ċ:"Cdot",ç:"ccedil",Ç:"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf",ď:"dcaron",Ď:"Dcaron",đ:"dstrok",Đ:"Dstrok",ð:"eth",Ð:"ETH","ⅇ":"ee",ℯ:"escr","𝔢":"efr","𝕖":"eopf",ℰ:"Escr","𝔈":"Efr","𝔼":"Eopf",é:"eacute",É:"Eacute",è:"egrave",È:"Egrave",ê:"ecirc",Ê:"Ecirc",ě:"ecaron",Ě:"Ecaron",ë:"euml",Ë:"Euml",ė:"edot",Ė:"Edot",ę:"eogon",Ę:"Eogon",ē:"emacr",Ē:"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf",ℱ:"Fscr",ff:"fflig",ffi:"ffilig",ffl:"ffllig",fi:"filig",fj:"fjlig",fl:"fllig",ƒ:"fnof",ℊ:"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr",ǵ:"gacute",ğ:"gbreve",Ğ:"Gbreve",ĝ:"gcirc",Ĝ:"Gcirc",ġ:"gdot",Ġ:"Gdot",Ģ:"Gcedil","𝔥":"hfr",ℎ:"planckh","𝒽":"hscr","𝕙":"hopf",ℋ:"Hscr",ℌ:"Hfr",ℍ:"Hopf",ĥ:"hcirc",Ĥ:"Hcirc",ℏ:"hbar",ħ:"hstrok",Ħ:"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf",ℐ:"Iscr",ℑ:"Im",í:"iacute",Í:"Iacute",ì:"igrave",Ì:"Igrave",î:"icirc",Î:"Icirc",ï:"iuml",Ï:"Iuml",ĩ:"itilde",Ĩ:"Itilde",İ:"Idot",į:"iogon",Į:"Iogon",ī:"imacr",Ī:"Imacr",ij:"ijlig",IJ:"IJlig",ı:"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf",ĵ:"jcirc",Ĵ:"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr",ķ:"kcedil",Ķ:"Kcedil","𝔩":"lfr","𝓁":"lscr",ℓ:"ell","𝕝":"lopf",ℒ:"Lscr","𝔏":"Lfr","𝕃":"Lopf",ĺ:"lacute",Ĺ:"Lacute",ľ:"lcaron",Ľ:"Lcaron",ļ:"lcedil",Ļ:"Lcedil",ł:"lstrok",Ł:"Lstrok",ŀ:"lmidot",Ŀ:"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf",ℳ:"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr",ℕ:"Nopf","𝒩":"Nscr","𝔑":"Nfr",ń:"nacute",Ń:"Nacute",ň:"ncaron",Ň:"Ncaron",ñ:"ntilde",Ñ:"Ntilde",ņ:"ncedil",Ņ:"Ncedil","№":"numero",ŋ:"eng",Ŋ:"ENG","𝕠":"oopf","𝔬":"ofr",ℴ:"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf",º:"ordm",ó:"oacute",Ó:"Oacute",ò:"ograve",Ò:"Ograve",ô:"ocirc",Ô:"Ocirc",ö:"ouml",Ö:"Ouml",ő:"odblac",Ő:"Odblac",õ:"otilde",Õ:"Otilde",ø:"oslash",Ø:"Oslash",ō:"omacr",Ō:"Omacr",œ:"oelig",Œ:"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf",ℙ:"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr",ℚ:"Qopf",ĸ:"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr",ℛ:"Rscr",ℜ:"Re",ℝ:"Ropf",ŕ:"racute",Ŕ:"Racute",ř:"rcaron",Ř:"Rcaron",ŗ:"rcedil",Ŗ:"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS",ś:"sacute",Ś:"Sacute",ŝ:"scirc",Ŝ:"Scirc",š:"scaron",Š:"Scaron",ş:"scedil",Ş:"Scedil",ß:"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf",ť:"tcaron",Ť:"Tcaron",ţ:"tcedil",Ţ:"Tcedil","™":"trade",ŧ:"tstrok",Ŧ:"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr",ú:"uacute",Ú:"Uacute",ù:"ugrave",Ù:"Ugrave",ŭ:"ubreve",Ŭ:"Ubreve",û:"ucirc",Û:"Ucirc",ů:"uring",Ů:"Uring",ü:"uuml",Ü:"Uuml",ű:"udblac",Ű:"Udblac",ũ:"utilde",Ũ:"Utilde",ų:"uogon",Ų:"Uogon",ū:"umacr",Ū:"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr",ŵ:"wcirc",Ŵ:"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf",ý:"yacute",Ý:"Yacute",ŷ:"ycirc",Ŷ:"Ycirc",ÿ:"yuml",Ÿ:"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf",ℨ:"Zfr",ℤ:"Zopf","𝒵":"Zscr",ź:"zacute",Ź:"Zacute",ž:"zcaron",Ž:"Zcaron",ż:"zdot",Ż:"Zdot",Ƶ:"imped",þ:"thorn",Þ:"THORN",ʼn:"napos",α:"alpha",Α:"Alpha",β:"beta",Β:"Beta",γ:"gamma",Γ:"Gamma",δ:"delta",Δ:"Delta",ε:"epsi","ϵ":"epsiv",Ε:"Epsilon",ϝ:"gammad",Ϝ:"Gammad",ζ:"zeta",Ζ:"Zeta",η:"eta",Η:"Eta",θ:"theta",ϑ:"thetav",Θ:"Theta",ι:"iota",Ι:"Iota",κ:"kappa",ϰ:"kappav",Κ:"Kappa",λ:"lambda",Λ:"Lambda",μ:"mu",µ:"micro",Μ:"Mu",ν:"nu",Ν:"Nu",ξ:"xi",Ξ:"Xi",ο:"omicron",Ο:"Omicron",π:"pi",ϖ:"piv",Π:"Pi",ρ:"rho",ϱ:"rhov",Ρ:"Rho",σ:"sigma",Σ:"Sigma",ς:"sigmaf",τ:"tau",Τ:"Tau",υ:"upsi",Υ:"Upsilon",ϒ:"Upsi",φ:"phi",ϕ:"phiv",Φ:"Phi",χ:"chi",Χ:"Chi",ψ:"psi",Ψ:"Psi",ω:"omega",Ω:"ohm",а:"acy",А:"Acy",б:"bcy",Б:"Bcy",в:"vcy",В:"Vcy",г:"gcy",Г:"Gcy",ѓ:"gjcy",Ѓ:"GJcy",д:"dcy",Д:"Dcy",ђ:"djcy",Ђ:"DJcy",е:"iecy",Е:"IEcy",ё:"iocy",Ё:"IOcy",є:"jukcy",Є:"Jukcy",ж:"zhcy",Ж:"ZHcy",з:"zcy",З:"Zcy",ѕ:"dscy",Ѕ:"DScy",и:"icy",И:"Icy",і:"iukcy",І:"Iukcy",ї:"yicy",Ї:"YIcy",й:"jcy",Й:"Jcy",ј:"jsercy",Ј:"Jsercy",к:"kcy",К:"Kcy",ќ:"kjcy",Ќ:"KJcy",л:"lcy",Л:"Lcy",љ:"ljcy",Љ:"LJcy",м:"mcy",М:"Mcy",н:"ncy",Н:"Ncy",њ:"njcy",Њ:"NJcy",о:"ocy",О:"Ocy",п:"pcy",П:"Pcy",р:"rcy",Р:"Rcy",с:"scy",С:"Scy",т:"tcy",Т:"Tcy",ћ:"tshcy",Ћ:"TSHcy",у:"ucy",У:"Ucy",ў:"ubrcy",Ў:"Ubrcy",ф:"fcy",Ф:"Fcy",х:"khcy",Х:"KHcy",ц:"tscy",Ц:"TScy",ч:"chcy",Ч:"CHcy",џ:"dzcy",Џ:"DZcy",ш:"shcy",Ш:"SHcy",щ:"shchcy",Щ:"SHCHcy",ъ:"hardcy",Ъ:"HARDcy",ы:"ycy",Ы:"Ycy",ь:"softcy",Ь:"SOFTcy",э:"ecy",Э:"Ecy",ю:"yucy",Ю:"YUcy",я:"yacy",Я:"YAcy",ℵ:"aleph",ℶ:"beth",ℷ:"gimel",ℸ:"daleth"},m=/["&'<>`]/g,p={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,x={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},_=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,S={},C=S.hasOwnProperty,E=function(U,O){return C.call(U,O)},T=function(U,O){for(var $=-1,G=U.length;++$=55296&&U<=57343||U>1114111?(O&&D("character reference outside the permissible Unicode range"),"�"):E(b,U)?(O&&D("disallowed character reference"),b[U]):(O&&T(_,U)&&D("disallowed character reference"),U>65535&&(U-=65536,$+=w(U>>>10&1023|55296),U=56320|U&1023),$+=w(U),$)},M=function(U){return"&#x"+U.toString(16).toUpperCase()+";"},N=function(U){return"&#"+U+";"},D=function(U){throw Error("Parse error: "+U)},j=function(U,O){O=k(O,j.options);var $=O.strict;$&&g.test(U)&&D("forbidden code point");var G=O.encodeEverything,H=O.useNamedReferences,Q=O.allowUnsafeSymbols,Y=O.decimal?N:M,te=function(se){return Y(se.charCodeAt(0))};return G?(U=U.replace(i,function(se){return H&&E(f,se)?"&"+f[se]+";":te(se)}),H&&(U=U.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),H&&(U=U.replace(u,function(se){return"&"+f[se]+";"}))):H?(Q||(U=U.replace(m,function(se){return"&"+f[se]+";"})),U=U.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),U=U.replace(u,function(se){return"&"+f[se]+";"})):Q||(U=U.replace(m,te)),U.replace(a,function(se){var ae=se.charCodeAt(0),X=se.charCodeAt(1),ee=(ae-55296)*1024+X-56320+65536;return Y(ee)}).replace(c,te)};j.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var F=function(U,O){O=k(O,F.options);var $=O.strict;return $&&h.test(U)&&D("malformed character reference"),U.replace(y,function(G,H,Q,Y,te,se,ae,X,ee){var le,re,ce,ue,me,we;return H?(me=H,x[me]):Q?(me=Q,we=Y,we&&O.isAttributeValue?($&&we=="="&&D("`&` did not start a character reference"),G):($&&D("named character reference was not terminated by a semicolon"),v[me]+(we||""))):te?(ce=te,re=se,$&&!re&&D("character reference was not terminated by a semicolon"),le=parseInt(ce,10),I(le,$)):ae?(ue=ae,re=X,$&&!re&&D("character reference was not terminated by a semicolon"),le=parseInt(ue,16),I(le,$)):($&&D("named character reference was not terminated by a semicolon"),G)})};F.options={isAttributeValue:!1,strict:!1};var R=function(U){return U.replace(m,function(O){return p[O]})},P={version:"1.2.0",encode:j,decode:F,escape:R,unescape:F};if(r&&!r.nodeType)if(s)s.exports=P;else for(var L in P)E(P,L)&&(r[L]=P[L]);else n.he=P})(CKe)})(op,op.exports)),op.exports}var EKe=SKe();const HP=uo(EKe),kKe=e=>{const t=e.match(/^(.+?)\s*<(.+)>$/);return t?t[1]?.trim().replace(/^["']|["']$/g,"")||t[2]?.trim()||"":e.trim().replace(/^["']|["']$/g,"")},MKe=e=>e==="GCAL"?{src:vI,alt:"Gmail"}:e==="OUTLOOK"?{src:eBe,alt:"Outlook"}:{src:vI,alt:"Gmail"},TKe=e=>{const t=Date.now(),n=new Date(e),r=t-n.getTime();if(r<0)return"";const s=1e3*60,o=s*60,a=o*24,i=a*7,c=a*30,u=a*365;return r{const r=MKe(e.connection_type),s=n?l.jsx(rn,{icon:n,size:"tiny"}):l.jsx("img",{src:r.src,alt:r.alt,className:"size-[16px]"}),o=e.date?TKe(e.date):null;return l.jsxs("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer gap-3 rounded-lg px-2 py-1.5",children:[l.jsx("span",{className:"mt-two shrink-0",children:s}),l.jsxs("div",{className:"gap-two flex min-w-0 flex-1 flex-col",children:[l.jsx("div",{className:"flex min-w-0 items-center justify-between gap-2",children:e.sender&&l.jsx(V,{variant:"smallBold",className:"shrink-0",as:"span",children:kKe(e.sender)})}),l.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.subject&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis font-medium",t),variant:"small",as:"span",children:HP.decode(e.subject)})}),l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.snippet&&l.jsx(V,{variant:"tinyMono",className:"min-w-0 shrink truncate",color:"light",as:"span",children:HP.decode(e.snippet)}),o&&l.jsx(V,{variant:"tinyMono",className:"shrink-0 text-right",color:"light",as:"span",children:o})]})]})]})});Nre.displayName="EmailSearchResult";const Rre=A.memo(({result:e,textClassName:t,icon:n})=>{const r=l.jsx(rn,{icon:n||B("user"),size:"tiny"}),s=("display_name"in e?e.display_name:void 0)||("name"in e?e.name:void 0)||"",o=("email_address"in e?e.email_address:void 0)||("url"in e?e.url:void 0)||"";return l.jsxs("div",{className:"hover:bg-subtler dark:hover:bg-subtle relative flex min-w-0 cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5",children:[l.jsx("span",{className:"shrink-0",children:r}),l.jsxs("span",{className:"gap-xs flex min-w-0 items-center",children:[s&&l.jsx(V,{className:z("min-w-0 shrink text-ellipsis",t),variant:"small",as:"span",children:s||(o?o.split("@")[0]:"")}),o&&l.jsx(V,{variant:"tinyMono",className:"mt-px min-w-0 shrink truncate",color:"light",as:"span",children:o})]})]})});Rre.displayName="UserInfoSearchResult";const Dre=A.memo(({result:e,textClassName:t,icon:n})=>{const r=eg(e.url),s=M4(e),o=lW(e,r),a=n?l.jsx(rn,{icon:n,size:"tiny"}):l.jsx(ya.Icon,{url:e.url,isAttachment:e.is_attachment||!1,connectionType:r,isMemory:e.is_memory||!1,isConversationHistory:e.is_conversation_history||!1,isClientContext:e.is_client_context||!1,isInlineAttachment:!1,patentName:s}),i=e.url?l.jsx(ya.Source,{url:e.url,source:o,isAttachment:e.is_attachment||!1,connectionType:r,isMemory:e.is_memory||!1,isConversationHistory:e.is_conversation_history||!1,snippet:e.snippet,patentName:s}):null,c=e.is_memory?e.snippet:e.name;return l.jsxs("div",{className:"hover:bg-subtler relative flex min-w-0 cursor-pointer items-start gap-3 rounded-lg px-2 py-1.5",children:[l.jsx(V,{variant:"small",className:"mt-two shrink-0",children:a}),l.jsxs("div",{className:"gap-sm flex min-w-0 flex-1 items-start",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c&&l.jsx(V,{className:z("min-w-0 shrink truncate break-words",t),variant:"small",as:"span",children:c}),e.is_conversation_history&&l.jsx(V,{variant:"tinyRegular",color:"light",className:"pt-two line-clamp-1",children:e.snippet})]}),!e.is_conversation_history&&l.jsx(V,{variant:"tinyRegular",className:"overflow-wrap-anywhere mt-px break-words text-right lowercase",color:"light",as:"span",children:i})]})]})});Dre.displayName="WebSearchResult";const AKe=e=>{if(!e)return;const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:void 0},sN=e=>{const t=e.is_memory?"memory":"conversation_history",n=e.is_memory?e.url:void 0,r=e.is_conversation_history?AKe(e.url):void 0;return{snippet:e.snippet,url:e.url??"",title:e.name,type:t,memoryKey:n,entryUuid:r,timestamp:e.timestamp??""}},jre=A.memo(({isOpen:e,onClose:t,snippet:n,type:r,url:s,memoryKey:o,title:a,timestamp:i})=>{const{formatDate:c}=J(),u=ui(),f=r==="conversation_history",m=r==="memory",{session:p}=Ne(),{trackEvent:h}=Xe(p),{openStackedModal:g}=pn().legacy,y=d.useCallback(()=>{h("navigated to manage memory",{memory_key:o}),g("memoryListModal",{isMemoryEnabled:!0})},[o,h,g]),x=d.useMemo(()=>l.jsx(V,{variant:"small",children:l.jsx(je,{defaultMessage:"Manage",id:"0AzlrbMWV9"})}),[]),v=d.useMemo(()=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ge,{icon:f?B("list-search"):B("bubble-text")}),l.jsx(V,{variant:"baseSemi",children:f?l.jsx(je,{defaultMessage:"Library",id:"StcK672jB9"}):l.jsx(je,{defaultMessage:"Memory",id:"dVx3yznM2C"})})]}),[f]);return l.jsxs(po,{variant:u?"bottom-sheet":"side-sheet",isOpen:e,onClose:t,modalClassname:"md:!max-w-[400px] md:!min-w-[400px]",modalContentClassname:"justify-between",titleContent:v,children:[l.jsxs(K,{className:"flex size-full flex-col items-start",children:[a&&i&&l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"baseSemi",children:a}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"pb-sm",children:c(i,{dateStyle:"long"})})]}),l.jsxs("div",{className:"inline",children:[l.jsx(V,{variant:"small",className:"inline",children:n}),l.jsx(V,{variant:"smallBold",className:"ml-1 inline",color:"super",children:f&&l.jsx(yt,{href:s,target:"_blank",rel:"noopener",className:"whitespace-nowrap",children:l.jsx(je,{defaultMessage:"See more",id:"yoLwRWw99S"})})})]})]}),m&&l.jsxs(K,{className:"flex w-full items-center justify-center gap-1",children:[l.jsx(V,{variant:"small",className:"inline",color:"light",children:l.jsx(je,{defaultMessage:"See all your memories.",id:"h0JAuR900y"})}),l.jsx(st,{onClick:y,size:"small",variant:"common",noPadding:!0,text:x})]})]})});jre.displayName="MemorySearchHistoryModal";const NKe=Object.freeze(Object.defineProperty({__proto__:null,MemorySearchHistoryModal:jre,createModalPayload:sN},Symbol.toStringTag,{value:"Module"})),Ire=e=>e.is_scrubbed??!1,RKe=e=>yb(e)?Ire(e):!1,yb=e=>e.is_memory||e.is_conversation_history,DKe=e=>e.is_memory,Wg=e=>{const t=e.is_client_context,n=RKe(e);return t||n},oN=()=>{const{openModal:e}=pn().legacy,{session:t}=Ne(),{trackEvent:n}=Xe(t);return d.useCallback(s=>{if(Wg(s))return;const o=sN(s);e("memorySearchHistoryModal",o);const a=o.type,i=o.memoryKey,c=o.entryUuid;n("viewed memory search history modal",{type:a,...a==="memory"&&{memory_key:i},...a==="conversation_history"&&{entry_uuid:c}})},[e,n])},jKe=(e,t)=>{const{value:n,loading:r}=zt({flag:"comet-open-citations-in-sidecar",defaultValue:e,extraAttributes:t,subjectType:"comet_device_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Pre=()=>{const e=An(),t=Do(),{variation:n}=jKe(!1);Rn();const r=On(),s=r?.startsWith("/search/")||r?.startsWith("/sidecar/search/");return e&&n&&!t&&s},IKe=({reason:e,entryUUID:t,openFile:n,onSuccess:r})=>{const{openToast:s}=hn(),o=J();return{openPatentInViewer:d.useCallback(async({name:i,url:c,fileSource:u})=>{try{n({name:i,url:null,fileSource:u,entryUUID:t});const{file_url:f}=await Oz({request:{file_url:c,view_mode:!0},reason:e});r?.({entryUUID:t,fileName:i}),n({name:i,url:f,fileSource:u,entryUUID:t})}catch{n({name:i,url:null,fileSource:u,entryUUID:t}),s({message:o.formatMessage({defaultMessage:"Failed to load patent. Please try again.",id:"CVx0UPNJGk"}),variant:"error",timeout:5e3})}},[e,t,n,r,s,o])}},PKe=({heading:e,groupIndex:t})=>l.jsxs(l.Fragment,{children:[t>0&&l.jsx("div",{className:"border-subtlest border-b"}),l.jsx(K,{variant:"raised",className:"-mx-xs pl-sm pb-sm sticky top-0 z-30 flex items-center gap-3 pt-3",children:l.jsx(V,{variant:"tinyRegular",children:e})})]}),pl=A.memo(({onClick:e,stepDelay:t,isFinished:n,results:r,textClassName:s,groupBy:o,onCountChange:a,icon:i,resultType:c="web",maxHeight:u=250})=>{const{getGroupHandler:f}=wKe(a),m=un(),p=oN(),h=Pre(),g=d.useRef(h);g.current=h;const{openFile:y}=d.useContext(y6),{openPatentInViewer:x}=IKe({reason:"patent-search-result",openFile:y}),v=d.useCallback(w=>{(w.is_memory||w.is_conversation_history)&&p(w)},[p]),b=d.useCallback(w=>S=>{if("is_conversation_history"in w){if(w.is_conversation_history||w.is_memory){S.preventDefault(),v(w);return}if(w.is_attachment||w.is_memory)return S.preventDefault();if(tg(w)){S.preventDefault(),x({url:w.url,name:w.name});return}if(g.current){aV({adapter:m,event:S,reason:"citation-regular-list",url:w.url,tabId:w.tab_id});return}Dx(S)&&(S.preventDefault(),m.openTab({url:w.url,tabId:w.tab_id}).catch(()=>{window.open(w.url,"_blank")}))}if(c==="email"||c==="calendar"){if(e){S.preventDefault();const E="url"in w?w.url:"";e(E||"")}return}const C="url"in w?w.url:"";e?.(C||"")},[m,e,c,v,x]);if(!r||r.length===0)return null;let _=[];if(o){const w=r,S=new Map;w.forEach(T=>{const k=T.category;S.has(k)||S.set(k,[]),S.get(k).push(T)});const C={open_tab:{heading:"Opened tabs",icon:l.jsx(ge,{icon:B("browser-plus")})},closed_tab:{heading:"Recently closed tabs",icon:l.jsx(ge,{icon:B("browser-minus")})},history:{heading:"Browser history",icon:l.jsx(ge,{icon:B("history")})}},E=S.size>1;_=Array.from(S.entries()).map(([T,k])=>{const I=C[T];return{heading:E?I?.heading||T:void 0,icon:E?I?.icon:void 0,results:k}})}else r.length>0&&r[0]&&"results"in r[0]?_=r.map(C=>({heading:C.heading,results:C.results})):_=[{results:[...r]}];return l.jsx(Qf,{children:l.jsx(Ng,{maxHeight:u,autoScroll:!1,topGradientOffset:_.length>1?36:0,scrollContainerClassName:_.length===1?"pt-sm":void 0,children:l.jsx("div",{className:"flex flex-col gap-px",children:_.map((w,S)=>{const C=w.results.map((T,k)=>{const I="url"in T?T.url:"",M=()=>{const N={result:T,textClassName:typeof s=="function"?s(T):s,icon:i};switch(c){case"web":return l.jsx(Dre,{...N});case"userinfo":return l.jsx(Rre,{...N});case"email":return l.jsx(Nre,{...N});case"calendar":return l.jsx(Are,{...N});default:return null}};return l.jsx(yt,{className:"-ml-xs block",href:I||"#",target:"_blank",rel:"noopener nofollow",onClick:b(T),children:M()},`${S}-${I||k}-${k}`)}),E=f(S);return l.jsxs("div",{className:"mb-sm last:mb-0",children:[w.heading&&_.length>1&&l.jsx(PKe,{heading:w.heading,groupIndex:S}),l.jsx(Zf,{items:C,stepDelay:t,isFinished:n,vertical:!0,truncate:!1,onCountChange:E})]},S)})})})})});pl.displayName="SearchResultsListStep";function Ore(e={}){const{scrollContainerRef:t,enabled:n=!0}=e,r=d.useCallback(s=>{if(!n)return;const o=t?.current;o&&o.scrollBy({top:s.deltaY,left:s.deltaX,behavior:"instant"})},[t,n]);return d.useMemo(()=>({onWheel:r}),[r])}const OKe=Ce(async()=>{const{CitationModal:e}=await Se(()=>q(()=>import("./CitationModal-Czu54JG6.js"),__vite__mapDeps([457,4,1,3,8,9,6,7,10,11,12])));return{default:e}}),LKe=A.memo(({children:e,result:t,webResultCitation:n,timestampComponent:r,trackEvent:s,linkProps:o,onYouTubeClick:a,onAttachmentClick:i,asChild:c=!1})=>{const{openModal:u}=Uo(),f=d.useCallback(p=>{p.preventDefault(),p.stopPropagation(),u(OKe,{result:t,webResultCitation:n,timestampComponent:r,trackEvent:s,linkProps:o,onYouTubeClick:a,onAttachmentClick:i,legacyIdentifier:"__NONE__"})},[u,t,n,r,s,o,a,i]),m=c?zU:"span";return l.jsx(m,{onClick:f,children:e})});LKe.displayName="CitationBottomSheet";const aN=A.memo(({webResults:e,compact:t=!1})=>{if(!d.useMemo(()=>(Array.isArray(e)?e:[e]).some(o=>tg(o)),[e])||Array.isArray(e))return null;const r=l.jsx(yt,{href:"https://www.lens.org",target:"_blank",rel:"noopener",className:"hover:text-super",children:"Lens.org"});return l.jsx(V,{variant:"tinyRegular",color:"light",children:t?l.jsxs(l.Fragment,{children:["· ",r]}):l.jsxs(l.Fragment,{children:["Patent Data by ",r]})})});aN.displayName="CitationAttribution";const iN=A.memo(function(t){const{className:n,children:r,result:s,trackEvent:o,...a}=t,i=z("group flex size-full cursor-pointer items-stretch",n);return T4(s)?l.jsx(yt,{target:"_blank",rel:"noopener",className:i,href:s.url,...a,children:l.jsx("div",{className:"w-full",children:r})}):l.jsx(l.Fragment,{children:r})});iN.displayName="CitationCardLink";const lN=A.memo(({variant:e="medium",searchType:t})=>{const n=t==="memory",s=z("flex items-center justify-between w-full",e==="small"?"mb-0":"mb-2");return l.jsxs("div",{className:s,children:[l.jsxs(V,{className:"flex items-center gap-2",variant:"tiny",color:"light",children:[l.jsx(ge,{icon:n?B("bubble-text"):B("list-search"),size:"sm"}),n?l.jsx(je,{defaultMessage:"Memory",id:"dVx3yznM2C"}):l.jsx(je,{defaultMessage:"Library",id:"StcK672jB9"})]}),l.jsx(V,{variant:"tiny",color:"ultraLight",children:l.jsx(ge,{icon:B("user-search"),size:"sm"})})]})});lN.displayName="MemorySearchCitationCardTitle";const Lre=A.memo(({className:e})=>l.jsx("div",{className:e,children:l.jsxs(V,{variant:"micro",color:"light",className:"text-pretty",children:[l.jsx(je,{defaultMessage:"This answer uses premium data sources. You're receiving complimentary access through your Perplexity subscription.",id:"u+XPNB2p9O"})," ",l.jsx(qh,{href:"https://www.perplexity.ai/help-center/en/articles/12870803-premium-data-sources",target:"_blank",variant:"inline",muted:!0,children:l.jsx(je,{defaultMessage:"Learn more",id:"TdTXXf940t"})})]})}));Lre.displayName="PremiumSourceFooter";const FKe=e=>{const t=e.meta_data?.connection_type,n=typeof e.meta_data?.citation_domain_name=="string"?e.meta_data.citation_domain_name:void 0,r=t==="WILEY",s=t||e.is_memory||e.is_conversation_history?e.name:void 0;return n??(r?"Wiley":s)},Fi=e=>{if(!e)return!1;const t=typeof e.meta_data?.wiley_book_uuid=="string"&&e.meta_data?.wiley_book_uuid!=="",n=typeof e.meta_data?.is_premium_datasource=="boolean"&&e.meta_data?.is_premium_datasource===!0;return t||n},Gg=e=>{if(!e)return{source_type:"unknown",is_premium:!1};const t=Fi(e),n=FKe(e);let r="web";return e.is_attachment?r="attachment":e.is_image?r="image":e.is_memory?r="memory":e.is_conversation_history?r="conversation_history":e.is_knowledge_card?r="knowledge_card":e.is_navigational?r="navigational":e.is_code_interpreter?r="code_interpreter":e.meta_data?.connection_type?r=String(e.meta_data.connection_type).toLowerCase():t&&(r="premium_datasource"),{source_name:n,source_type:r,is_premium:t}},Vw="text-foreground text-left hover:text-super focus:text-super leading-snug transition-color line-clamp-2 cursor-pointer font-sans text-sm font-medium duration-quick",cN=A.memo(({result:e,webResultCitation:t,timestampComponent:n,trackEvent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,isFile:i=e.is_attachment??!1,downloadable:c=!1,isYouTubeVideo:u=!!(e.url&&Ji(e.url))})=>{const f=e?.is_conversation_history??!1,m=e?.is_memory??!1,p=f||m,h=Wg(e),g=Ire(e),y=g||p&&!h?null:e.meta_data?.generated_file_title??e.name,x=t?.cited_texts??[],v=e.meta_data?.generated_file_description??e.snippet,b=e.meta_data?.authors,_=Fi(e),w=M4(e),S=typeof e.meta_data?.citation_domain_name=="string"?e.meta_data?.citation_domain_name:void 0,C=T4(e),E=e.url||h;return l.jsxs("div",{className:"gap-1 flex flex-col min-w-[200px]",children:[p&&!h?l.jsx(lN,{variant:"medium",searchType:m?"memory":"conversation-history"}):l.jsxs("div",{className:"gap-sm flex flex-col",children:[(E||n)&&l.jsxs("div",{className:"flex items-center justify-between",children:[E&&l.jsx(ya,{className:"text-right",variant:"tinyRegular",color:"light",url:e.url,isAttachment:i,source:S,connectionType:e.meta_data?.connection_type,mcpServerSource:e.meta_data?.mcp_server,patentName:w,truncate:!1}),l.jsxs("div",{className:"flex items-center gap-2",children:[n,l.jsx(aN,{webResults:e,compact:!!n})]}),_?l.jsx(Mh,{}):null]}),u?l.jsx("button",{className:Vw,onClick:o,children:y}):c?l.jsx("button",{className:Vw,onClick:a,children:y}):C?l.jsx(iN,{className:Vw,result:e,trackEvent:r,...s,children:y}):l.jsx("span",{className:"text-foreground mb-xs line-clamp-2 text-left font-sans text-sm",children:y})]}),b?l.jsx(V,{variant:"small",className:"line-clamp-3",children:b.join(", ")}):null,g?l.jsx(V,{variant:"small",color:"light",children:l.jsx(je,{defaultMessage:"This is a private source.",id:"jKReyt0qq8",description:"Text shown when a source is private and obfuscated"})}):null,y!==e.name&&!m&&!g?l.jsx(V,{variant:"small",color:"light",children:e.name}):null,x.length>0?l.jsx("ul",{children:x.map((T,k)=>l.jsx("li",{className:"border-b last:border-b-0",children:l.jsx(V,{variant:"small",className:"line-clamp-[20] italic",children:T})},k))}):v&&l.jsx(V,{variant:"small",color:"light",className:"line-clamp-4 whitespace-pre-wrap",children:v}),h&&!g?l.jsxs(K,{className:"gap-xs pt-sm mt-sm flex items-center border-t",children:[l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B("user-scan")})}),l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(je,{defaultMessage:"Personal Search",id:"7+aLCEyqS2",description:"title"})})]}):null,_&&l.jsx(Lre,{className:"pt-2"})]})});cN.displayName="CitationContent";var Hw={exports:{}},zw,zP;function BKe(){if(zP)return zw;zP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return zw=e,zw}var Ww,WP;function UKe(){if(WP)return Ww;WP=1;var e=BKe();function t(){}function n(){}return n.resetWarningCache=t,Ww=function(){function r(a,i,c,u,f,m){if(m!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ww}var GP;function uN(){return GP||(GP=1,Hw.exports=UKe()()),Hw.exports}var VKe=uN();const ze=uo(VKe);var Gw,$P;function HKe(){return $P||($P=1,Gw=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[s]))return!1;for(s=r;s--!==0;){var a=o[s];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}),Gw}var zKe=HKe();const WKe=uo(zKe);var s1={exports:{}},$w,qP;function GKe(){if(qP)return $w;qP=1;var e;return e=function(){var t={},n={};return t.on=function(r,s){var o={name:r,handler:s};return n[r]=n[r]||[],n[r].unshift(o),o},t.off=function(r){var s=n[r.name].indexOf(r);s!==-1&&n[r.name].splice(s,1)},t.trigger=function(r,s){var o=n[r],a;if(o)for(a=o.length;a--;)o[a].handler(s)},t},$w=e,$w}var o1={exports:{}},qw,KP;function $Ke(){if(KP)return qw;KP=1,qw=function(s,o,a){var i=document.head||document.getElementsByTagName("head")[0],c=document.createElement("script");typeof o=="function"&&(a=o,o={}),o=o||{},a=a||function(){},c.type=o.type||"text/javascript",c.charset=o.charset||"utf8",c.async="async"in o?!!o.async:!0,c.src=s,o.attrs&&e(c,o.attrs),o.text&&(c.text=""+o.text);var u="onload"in c?t:n;u(c,a),c.onload||t(c,a),i.appendChild(c)};function e(r,s){for(var o in s)r.setAttribute(o,s[o])}function t(r,s){r.onload=function(){this.onerror=this.onload=null,s(null,r)},r.onerror=function(){this.onerror=this.onload=null,s(new Error("Failed to load "+this.src),r)}}function n(r,s){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,s(null,r))}}return qw}var YP;function qKe(){return YP||(YP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=$Ke(),r=s(n);function s(o){return o&&o.__esModule?o:{default:o}}t.default=function(o){var a=new Promise(function(i){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){i(window.YT);return}else{var c=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(c+"//www.youtube.com/iframe_api",function(f){f&&o.trigger("error",f)})}var u=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){u&&u(),i(window.YT)}});return a},e.exports=t.default})(o1,o1.exports)),o1.exports}var a1={exports:{}},i1={exports:{}},l1={exports:{}},Kw,QP;function KKe(){if(QP)return Kw;QP=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*365.25;Kw=function(u,f){f=f||{};var m=typeof u;if(m==="string"&&u.length>0)return o(u);if(m==="number"&&isNaN(u)===!1)return f.long?i(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var f=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(f){var m=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return m*s;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function a(u){return u>=r?Math.round(u/r)+"d":u>=n?Math.round(u/n)+"h":u>=t?Math.round(u/t)+"m":u>=e?Math.round(u/e)+"s":u+"ms"}function i(u){return c(u,r,"day")||c(u,n,"hour")||c(u,t,"minute")||c(u,e,"second")||u+" ms"}function c(u,f,m){if(!(u=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(u){try{return JSON.stringify(u)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}};function s(u){var f=this.useColors;if(u[0]=(f?"%c":"")+this.namespace+(f?" %c":" ")+u[0]+(f?"%c ":" ")+"+"+t.humanize(this.diff),!!f){var m="color: "+this.color;u.splice(1,0,m,"color: inherit");var p=0,h=0;u[0].replace(/%[a-zA-Z%]/g,function(g){g!=="%%"&&(p++,g==="%c"&&(h=p))}),u.splice(h,0,m)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(u){try{u==null?t.storage.removeItem("debug"):t.storage.debug=u}catch{}}function i(){var u;try{u=t.storage.debug}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}t.enable(i());function c(){try{return window.localStorage}catch{}}})(i1,i1.exports)),i1.exports}var c1={exports:{}},JP;function XKe(){return JP||(JP=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],e.exports=t.default})(c1,c1.exports)),c1.exports}var u1={exports:{}},eO;function ZKe(){return eO||(eO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],e.exports=t.default})(u1,u1.exports)),u1.exports}var d1={exports:{}},f1={exports:{}},tO;function JKe(){return tO||(tO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},e.exports=t.default})(f1,f1.exports)),f1.exports}var nO;function eYe(){return nO||(nO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=JKe(),r=s(n);function s(o){return o&&o.__esModule?o:{default:o}}t.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},e.exports=t.default})(d1,d1.exports)),d1.exports}var rO;function tYe(){return rO||(rO=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=QKe(),r=f(n),s=XKe(),o=f(s),a=ZKe(),i=f(a),c=eYe(),u=f(c);function f(h){return h&&h.__esModule?h:{default:h}}var m=(0,r.default)("youtube-player"),p={};p.proxyEvents=function(h){var g={},y=function(E){var T="on"+E.slice(0,1).toUpperCase()+E.slice(1);g[T]=function(k){m('event "%s"',T,k),h.trigger(E,k)}},x=!0,v=!1,b=void 0;try{for(var _=i.default[Symbol.iterator](),w;!(x=(w=_.next()).done);x=!0){var S=w.value;y(S)}}catch(C){v=!0,b=C}finally{try{!x&&_.return&&_.return()}finally{if(v)throw b}}return g},p.promisifyPlayer=function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y={},x=function(T){g&&u.default[T]?y[T]=function(){for(var k=arguments.length,I=Array(k),M=0;M1&&arguments[1]!==void 0?arguments[1]:{},h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,g=(0,s.default)();if(f||(f=(0,a.default)(g)),p.events)throw new Error("Event handlers cannot be overwritten.");if(typeof m=="string"&&!document.getElementById(m))throw new Error('Element "'+m+'" does not exist.');p.events=c.default.proxyEvents(g);var y=new Promise(function(v){if((typeof m>"u"?"undefined":n(m))==="object"&&m.playVideo instanceof Function){var b=m;v(b)}else f.then(function(_){var w=new _.Player(m,p);return g.on("ready",function(){v(w)}),null})}),x=c.default.promisifyPlayer(y,h);return x.on=g.on,x.off=g.off,x},e.exports=t.default})(s1,s1.exports)),s1.exports}var rYe=nYe();const sYe=uo(rYe);var oYe=Object.defineProperty,aYe=Object.defineProperties,iYe=Object.getOwnPropertyDescriptors,oO=Object.getOwnPropertySymbols,lYe=Object.prototype.hasOwnProperty,cYe=Object.prototype.propertyIsEnumerable,aO=(e,t,n)=>t in e?oYe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fk=(e,t)=>{for(var n in t||(t={}))lYe.call(t,n)&&aO(e,n,t[n]);if(oO)for(var n of oO(t))cYe.call(t,n)&&aO(e,n,t[n]);return e},mk=(e,t)=>aYe(e,iYe(t)),uYe=(e,t,n)=>new Promise((r,s)=>{var o=c=>{try{i(n.next(c))}catch(u){s(u)}},a=c=>{try{i(n.throw(c))}catch(u){s(u)}},i=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,a);i((n=n.apply(e,t)).next())});function dYe(e,t){var n,r;if(e.videoId!==t.videoId)return!0;const s=((n=e.opts)==null?void 0:n.playerVars)||{},o=((r=t.opts)==null?void 0:r.playerVars)||{};return s.start!==o.start||s.end!==o.end}function iO(e={}){return mk(fk({},e),{height:0,width:0,playerVars:mk(fk({},e.playerVars),{autoplay:0,start:0,end:0})})}function fYe(e,t){return e.videoId!==t.videoId||!WKe(iO(e.opts),iO(t.opts))}function mYe(e,t){var n,r,s,o;return e.id!==t.id||e.className!==t.className||((n=e.opts)==null?void 0:n.width)!==((r=t.opts)==null?void 0:r.width)||((s=e.opts)==null?void 0:s.height)!==((o=t.opts)==null?void 0:o.height)||e.iframeClassName!==t.iframeClassName||e.title!==t.title}var pYe={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},hYe={videoId:ze.string,id:ze.string,className:ze.string,iframeClassName:ze.string,style:ze.object,title:ze.string,loading:ze.oneOf(["lazy","eager"]),opts:ze.objectOf(ze.any),onReady:ze.func,onError:ze.func,onPlay:ze.func,onPause:ze.func,onEnd:ze.func,onStateChange:ze.func,onPlaybackRateChange:ze.func,onPlaybackQualityChange:ze.func},Sy=class extends A.Component{constructor(e){super(e),this.destroyPlayerPromise=void 0,this.onPlayerReady=t=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,t)},this.onPlayerError=t=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,t)},this.onPlayerStateChange=t=>{var n,r,s,o,a,i,c,u;switch((r=(n=this.props).onStateChange)==null||r.call(n,t),t.data){case Sy.PlayerState.ENDED:(o=(s=this.props).onEnd)==null||o.call(s,t);break;case Sy.PlayerState.PLAYING:(i=(a=this.props).onPlay)==null||i.call(a,t);break;case Sy.PlayerState.PAUSED:(u=(c=this.props).onPause)==null||u.call(c,t);break}},this.onPlayerPlaybackRateChange=t=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,t)},this.onPlayerPlaybackQualityChange=t=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,t)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const t=mk(fk({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=sYe(this.container,t),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var t;(t=this.internalPlayer)==null||t.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var t,n,r,s;if(typeof this.props.videoId>"u"||this.props.videoId===null){(t=this.internalPlayer)==null||t.stopVideo();return}let o=!1;const a={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(o=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(a.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(a.endSeconds=this.props.opts.playerVars.end)),o){(r=this.internalPlayer)==null||r.loadVideoById(a);return}(s=this.internalPlayer)==null||s.cueVideoById(a)},this.refContainer=t=>{this.container=t},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(e){return uYe(this,null,function*(){mYe(e,this.props)&&this.updatePlayer(),fYe(e,this.props)&&(yield this.resetPlayer()),dYe(e,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return A.createElement("div",{className:this.props.className,style:this.props.style},A.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},xb=Sy;xb.propTypes=hYe;xb.defaultProps=pYe;xb.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var lO=xb;const cO={fadeIn:{opacity:1},fadeOut:{opacity:0}},gYe={width:"100%",height:"100%",playerVars:{autoplay:1,color:"white",playsinline:1}},$g=A.memo(e=>{const{isOpen:t,name:n,setisOpen:r,url:s}=e,o=s?Ji(s):void 0,a=d.useRef(void 0),[i,c]=d.useState(!1),u=d.useCallback(p=>{a.current=p.target,c(!0)},[a]),f=d.useCallback(p=>{if(a.current)switch(p.key){case" ":{a.current.getPlayerState()===lO.PlayerState.PLAYING?a.current.pauseVideo():a.current.playVideo();break}case"ArrowRight":{a.current.seekTo(a.current.getCurrentTime()+5,!0);break}case"ArrowLeft":{a.current.seekTo(a.current.getCurrentTime()-5,!0);break}}},[a]);d.useEffect(()=>(t?window.addEventListener("keydown",f):window.removeEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}),[f,t]);const m=d.useCallback(p=>{r(p)},[r]);return o?l.jsx(cA,{open:t,onOpenChange:m,children:l.jsx(ST,{className:"z-10",asChild:!0,children:l.jsxs(Te.div,{className:"bg-backdrop dark fixed inset-0 flex items-center justify-center backdrop-blur-md",initial:"fadeOut",animate:"fadeIn",exit:"fadeOut",variants:cO,transition:{duration:.2},children:[l.jsx(L$,{asChild:!0,children:l.jsx(Ge,{extraCSS:"!fixed top-md right-md shadow-sm",icon:B("x"),pill:!0,size:"small",variant:"common"})}),l.jsxs(ET,{className:"grid outline-none","aria-describedby":void 0,children:[l.jsx(FU,{children:l.jsx(O$,{children:n})}),l.jsxs(St,{children:[!i&&l.jsx(Te.div,{className:"grid place-items-center [grid-area:1/-1]",initial:"fadeOut",animate:"fadeIn",exit:"fadeOut",transition:{duration:.2},variants:cO,children:l.jsx(Gl,{size:24})},"youtube-player-loading"),l.jsx(Te.div,{className:z("aspect-video overflow-hidden rounded-2xl shadow-lg [grid-area:1/-1] *:size-full","w-[calc(100dvw-(2*var(--size-md)))] sm:w-[75vw]"),initial:{opacity:0},animate:{opacity:i?1:0},transition:{duration:.2},children:l.jsx(lO,{onReady:u,opts:gYe,title:n,videoId:o})},"youtube-player-content")]})]})]},"youtube-player-overlay")})}):null});$g.displayName="YoutubeVideoPlayer";const df=A.memo(({hideHoverCard:e=!1,children:t,linkProps:n,result:r,webResultCitation:s,timestampComponent:o,trackEvent:a,getAttachmentUrl:i,onOpened:c,scrollContainerRef:u,triggerClassName:f})=>{const{isMobileStyle:m}=Re(),[p,h]=d.useState(!1),[g,y]=d.useState(!1),[x,v]=d.useState(null),b=Uf(r),{onWheel:_}=Ore({scrollContainerRef:u,enabled:!0}),w=r.is_attachment??!1,S=Yl(r),C=kr(r.url),E=d.useCallback(async()=>{if(!i||b)return;const $=await i(r.url);C&&(v($),y(!0),h(!1))},[i,r.url,C,b]),T=r.meta_data?.generated_file_title??r.name,k=d.useRef(!1),[I,M]=d.useState(!1),N=!!(r.url&&Ji(r.url));d.useEffect(()=>{if(typeof window>"u")return;function $(){k.current=!1}return document.addEventListener("visibilitychange",$),()=>{window.removeEventListener("visibilitychange",$)}},[]);const D=d.useCallback(()=>y(!1),[]),j=d.useCallback(()=>{M(!0),h(!1)},[]),F=d.useMemo(()=>({src:x??void 0}),[x]),R=d.useCallback($=>{!$&&k.current||(h(e?!1:$),$&&c?.())},[e,c]),P=d.useCallback(()=>{k.current=!0},[]),L=d.useCallback(()=>{h(!1),k.current=!1},[]),U=d.useCallback(()=>{k.current=!1},[]),O=d.useMemo(()=>l.jsx("span",{className:z("inline-flex",f),"aria-label":T,onPointerEnter:P,onClick:L,onPointerLeave:U,children:t}),[t,T,P,L,U,f]);return l.jsxs(l.Fragment,{children:[N&&r.url&&l.jsx($g,{isOpen:I,name:T,setisOpen:M,url:r.url}),C&&x&&l.jsx(pu,{isOpen:g,onClose:D,imgProps:F}),l.jsx(Fl,{interaction:"hover",open:p,onOpenChange:R,openDelayMs:200,closeDelayMs:200,side:"bottom",align:"start",triggerElement:O,maxWidthPx:320,onWheelContent:_,children:l.jsx("div",{className:"p-xs",children:l.jsx(cN,{result:r,webResultCitation:s,timestampComponent:o,trackEvent:a,linkProps:n,onYouTubeClick:j,onAttachmentClick:E,isFile:w,downloadable:S,isYouTubeVideo:N})})})]})}),yYe=({webResults:e,citationGroup:t,onCitationClick:n,openMemorySearchHistoryModal:r,onYouTubeClick:s,onAttachmentClick:o,forceExternalHandler:a,getAttachmentUrl:i,trackEvent:c,onClose:u})=>{const f=J(),m=d.useMemo(()=>[...e].sort((x,v)=>{const b=Fi(x),_=Fi(v);return b&&!_?-1:!b&&_?1:0}),[e]),p=d.useMemo(()=>e.every(x=>x.is_conversation_history),[e]),h=d.useMemo(()=>e.some(x=>Fi(x)),[e]),g=d.useMemo(()=>{if(p)return f.formatMessage({defaultMessage:"Library",id:"StcK672jB9"});switch(t.category){case"memory":return f.formatMessage({defaultMessage:"Memory",id:"dVx3yznM2C"});case"attachment":return f.formatMessage({defaultMessage:"Attachments",id:"Vlx13nOMtX"});case"youtube":return f.formatMessage({defaultMessage:"YouTube",id:"zuA3BgDC6u"});default:return f.formatMessage({defaultMessage:"{count, plural, one {# source} other {# sources}}",id:"WrpI57Uej/"},{count:t.totalCount??e?.length})}},[t.category,p,f,t.totalCount,e.length]),y=d.useCallback(x=>async v=>{if(x.is_conversation_history||x.is_memory)if(v.preventDefault(),u?.(),n){n(x,v);return}else if(r){r(x);return}else{console.warn("Memory/conversation history modal handler not provided");return}if((x.url?Ji(x.url):null)&&s){v.preventDefault(),s(x),u?.();return}const _=x.is_attachment||!1,w=kr(x.url);if(_&&w&&o){v.preventDefault(),o(x),u?.();return}if(dA()&&n){v.preventDefault(),u?.(),n(x,v);return}if(_&&Yl(x)&&i){v.preventDefault();const S=await i(x.url);window.open(S,"_blank");return}if(c&&x.url){const S=Gg(x);c("click citation",{source:"grouped_citation",citation_url:x.url,...S})}if(a&&n){n(x,v);return}T4(x)&&(v.preventDefault(),window.open(x.url,"_blank")),v.preventDefault()},[n,r,c,i,a,u,s,o]);return d.useMemo(()=>({sortedWebResults:m,headerText:g,hasPremiumSource:h,handleCitationClick:y}),[m,g,h,y])};df.displayName="CitationHoverCard";const pd=A.memo(({result:e,onClick:t,visualStyle:n,showName:r,className:s})=>{const o=un(),a=eg(e.url),i=lW(e,a),c=oN(),u=Pre(),f=d.useCallback(()=>{(e.is_memory||e.is_conversation_history)&&c(e)},[c,e]),m=d.useCallback(p=>{if(e.is_conversation_history||e.is_memory){p.preventDefault(),f();return}if(e.is_attachment||e.is_memory)return p.preventDefault();if(u){aV({adapter:o,event:p,reason:"search-result-step",url:e.url,tabId:e.tab_id});return}Dx(p)&&(p.preventDefault(),o.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")})),t?.(e.url)},[o,t,e.is_attachment,e.is_memory,e.tab_id,e.url,f,e.is_conversation_history,u]);return l.jsx(yt,{className:z("inline-block max-w-full",s),href:e.url,target:"_blank",rel:"noopener nofollow",onClick:m,children:l.jsx(K,{variant:"subtler",bgHover:"subtle",className:"py-xs rounded-lg pl-1.5 pr-2.5",children:l.jsx(ya,{variant:"tinyRegular",className:n==="closedTab"?"!line-through":void 0,url:e.url,name:r?e.name:void 0,isAttachment:e.is_attachment,connectionType:a,source:i,isMemory:e.is_memory,isConversationHistory:e.is_conversation_history})})})});pd.displayName="SearchResultBubble";const xYe=A.memo(({onClick:e,webResults:t,initialDisplayCount:n=12,stepDelay:r,isFinished:s=!1})=>{const o=d.useMemo(()=>t.map(a=>l.jsx(Fre,{result:a,onClick:e},a.url)),[e,t]);return l.jsx("div",{className:"gap-sm flex flex-wrap",children:l.jsx(Zf,{items:o,initialDisplayCount:n,stepDelay:r,isFinished:s})})});xYe.displayName="SearchResultsStep";const Fre=A.memo(({result:e,onClick:t})=>{const n=un(),r=d.useMemo(()=>({onClick(s){Dx(s)&&(s.preventDefault(),n.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")}))}}),[n,e.tab_id,e.url]);return l.jsx(df,{result:e,linkProps:r,children:l.jsx(pd,{result:e,onClick:t})},e.url)});Fre.displayName="CitationHoverCardFactory";const vYe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i;function Bre(e){return typeof e!="string"?!1:vYe.test(e)}function Yw({label:e,chips:t,onAdd:n,onDelete:r,children:s,placeholder:o,onDraftChange:a,contactSuggestions:i,renderContactSuggestion:c}){return l.jsxs("div",{className:"border-subtlest pl-md pr-sm flex min-h-10 flex-1 items-center border-b p-0",children:[l.jsx(V,{variant:"small",color:"light",className:"w-10 min-w-[32px] select-none",children:e}),l.jsx("div",{className:"flex-1",children:l.jsx(V6,{chips:t,onAdd:n,onDelete:r,placeholder:o,validator:Bre,placeholderOnFocusOnly:!0,onDraftChange:a,suggestions:i,renderSuggestion:c})}),s]})}function bYe(e,t){const r=t.get(e)?.display_name?.trim();return r||e}function Qw(e,t){return e.map(n=>({label:bYe(n,t),value:n}))}const _Ye=A.memo(function({email:t,onChange:n,onSend:r,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a,disableEditContents:i}){const c=d.useMemo(()=>t?.to??[],[t?.to]),u=d.useMemo(()=>t?.cc??[],[t?.cc]),f=d.useMemo(()=>t?.bcc??[],[t?.bcc]),[m,p]=d.useState(u.length>0),[h,g]=d.useState(f.length>0),{isMobileUserAgent:y}=Re(),x=()=>{(!u||u.length===0)&&(!f||f.length===0)&&(p(!1),g(!1))},{$t:v}=J(),b={to:v({defaultMessage:"To",id:"9j3hXO4Ojb"}),cc:v({defaultMessage:"Cc",id:"J1CYkLdqdy"}),bcc:v({defaultMessage:"Bcc",id:"qLl3P2UOlZ"}),addRecipient:v({defaultMessage:"Add recipient",id:"o2g2HQVmtC"}),subject:v({defaultMessage:"Subject",id:"LLtKhppiyE"}),writeMessage:v({defaultMessage:"Write your message...",id:"yoP6t+NY/q"})},_=d.useCallback(D=>({onAdd:(R,P)=>{const L=t?.[D]??[],U=R.filter(O=>Bre(O)&&!L.includes(O));if(U.length>0){const O=t?.contacts?[...t.contacts]:[];if(P&&P.length>0){const $=P.filter(G=>!O.some(H=>H.email===G.email)).map(G=>({email:G.email,display_name:G.name,photo_url:G.image||void 0}));O.push(...$)}n({...t,[D]:[...L,...U],contacts:O})}},onDelete:R=>{const P=t?.[D]??[];n({...t,[D]:P.filter(L=>!R.includes(L))})}}),[t,n]),w=d.useMemo(()=>new Map((t?.contacts??[]).filter(D=>D.email).map(D=>[D.email,D])),[t?.contacts]),S=d.useMemo(()=>Qw(c,w),[c,w]),C=d.useMemo(()=>Qw(u,w),[u,w]),E=d.useMemo(()=>Qw(f,w),[f,w]),T=_("to"),k=_("cc"),I=_("bcc"),M=d.useCallback(D=>n({...t,subject:D}),[t,n]),N=d.useCallback(D=>n({...t,body:D.target.value}),[t,n]);return l.jsxs("div",{className:"dark:bg-subtler flex w-full flex-col",children:[l.jsx(Yw,{label:b.to,chips:S,onAdd:T.onAdd,onDelete:T.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a,children:l.jsxs("div",{className:"gap-two ml-2 flex",children:[!m&&l.jsx("button",{type:"button",className:"hover:bg-subtler text-quiet rounded-lg px-2 py-1 font-sans text-sm",onClick:()=>p(!0),children:b.cc}),!h&&l.jsx("button",{type:"button",className:"hover:bg-subtler text-quiet rounded-lg px-2 py-1 font-sans text-sm",onClick:()=>g(!0),children:b.bcc})]})}),m&&l.jsx(Yw,{label:b.cc,chips:C,onAdd:k.onAdd,onDelete:k.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a}),h&&l.jsx(Yw,{label:b.bcc,chips:E,onAdd:I.onAdd,onDelete:I.onDelete,placeholder:b.addRecipient,onDraftChange:s,contactSuggestions:o,renderContactSuggestion:a}),!i&&l.jsx(co,{isMobileUserAgent:y,name:"subject-input",type:"text",value:t?.subject,onChange:M,placeholder:b.subject,className:"border-subtlest text-foreground !px-md !py-sm min-h-10 w-full !rounded-none border-0 border-b !bg-transparent focus:outline-none focus:!ring-0","aria-label":b.subject}),!i&&l.jsx("textarea",{name:"body",value:t?.body,onChange:N,placeholder:b.writeMessage,rows:8,className:"text-foreground placeholder:text-quieter p-md min-h-[180px] w-full resize-none border-0 bg-transparent font-sans text-sm shadow-none focus:outline-none focus:ring-0","aria-label":b.writeMessage,onFocus:x})]})}),Ure=A.memo(({emailAction:e,sendStepResult:t,isFinished:n})=>{const r="send-email-step",[s,o]=d.useState(n??!1),{suggestions:a,handleDraftChange:i}=Aee({reason:"email_compose"}),c=d.useMemo(()=>{if(e?.send)return e.send.email;if(e?.forward)return{to:e.forward.to,cc:e.forward.cc,bcc:e.forward.bcc,contacts:e.forward.contacts}},[e]),[u,f]=d.useState(c),{$t:m}=J(),p=d.useMemo(()=>!!(u?.to&&u.to.length===0),[u]),h=d.useMemo(()=>m({defaultMessage:"Send",id:"9WRlF4R2gm"}),[m]),[g,y]=d.useState(""),[x,v]=d.useState(!1),b=d.useCallback(()=>{o(!0),t({confirmed:!1},r,!1)},[t,r]),_=d.useCallback((I,M)=>{!I&&(!M||!M.trim())||(o(!0),t({confirmed:I,...M&&{user_input:M.trim()},...u&&{email:u}},r,!1),!I&&M&&(v(!1),y("")))},[t,r,u]),w=d.useCallback(()=>_(!0),[_]),S=d.useCallback(()=>_(!1,g),[_,g]),C=d.useCallback(I=>{Ls.isEnterKeyWithoutShift(I)&&(I.preventDefault(),S())},[S]),E=d.useCallback(()=>{v(!1),y("")},[]),T=d.useCallback(I=>{I.preventDefault(),v(!0)},[]),k=d.useCallback(I=>l.jsx(Tee,{contact:I}),[]);return s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:m({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsxs(K,{variant:"raised",className:"rounded-lg border",children:[u&&l.jsx(K,{children:l.jsx(_Ye,{email:u,onChange:f,onDraftChange:i,contactSuggestions:a,renderContactSuggestion:k,disableEditContents:!!e?.forward})}),x&&l.jsxs("form",{onSubmit:S,children:[l.jsx(K,{className:"px-md py-sm gap-4 border-t",children:l.jsx(hu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:m({defaultMessage:"What would you like to change about this email?",id:"lrZrku1OFD"}),value:g,onChange:y,onKeyDown:C,minRows:3,className:"mt-sm !pl-3",autoFocus:!0})}),l.jsxs("div",{className:"gap-sm p-md pt-sm flex items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:m({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit"}),l.jsx(st,{variant:"negative",size:"small",text:m({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:E})]}),l.jsx(st,{size:"small",text:m({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:b})]})]}),!x&&l.jsx("form",{onSubmit:w,children:l.jsxs("div",{className:"gap-sm p-md flex items-center justify-between border-t",children:[l.jsxs("div",{className:"gap-sm flex",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:h,type:"submit",disabled:p}),l.jsx(Ge,{size:"small",variant:"common",text:m({defaultMessage:"Refine email",id:"xTUBb7cWyO"}),onClick:T})]}),l.jsx(st,{size:"small",text:m({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:b})]})})]})});Ure.displayName="SendEmailStep";const wYe=({result:e})=>{const{$t:t}=J();return e?.confirmed===!0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),size:14,className:"shrink-0 text-[#16a34a]",title:"Confirmed"}),l.jsx("span",{className:"text-xs font-medium leading-none text-[#16a34a] dark:text-[#4ade80]",children:t({defaultMessage:"Task confirmed",id:"oLLCmoruP6"})})]}):e?.confirmed===!1?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("x"),size:14,className:"text-negative shrink-0",title:"Skipped"}),l.jsx("span",{className:"text-negative text-xs font-medium leading-none",children:t({defaultMessage:"Task skipped",id:"uMaJWuUUvD"})})]}):null},Vre=A.memo(({sendStepResult:e,taskAction:t,stepUUID:n,isFinished:r=!1})=>{const{$t:s}=J(),{session:o}=Ne(),{trackEvent:a}=Xe(o),i="router",c=d.useMemo(()=>{const S=t.expiry_date?new Date(t.expiry_date):void 0;return{trigger:{type:Ze.SCHEDULED,schedule:SYe(t.schedule),expiryDate:S},query:{prompt:t.prompt||"",searchModel:t.model_preference||ie.DEFAULT},status:"ACTIVE",notificationSettings:Kl}},[t]),[u,f]=d.useState(y4(c??g4())),[m,p]=d.useState(null),[h,g]=d.useState(null),y="task_operation";d.useEffect(()=>{t&&!r&&a("task modal opened",{source:i})},[t,r,a,i]),Z.error("TaskOperationStep rendered",{stepUUID:n,hasTaskAction:!!t,isFinished:r,taskAction:t,taskActionType:typeof t,taskActionKeys:t?Object.keys(t):[],source:i});const x=d.useMemo(()=>s({defaultMessage:"Create Task",id:"4+iiEILSrA"}),[s]),v=d.useCallback(S=>{p(S),S.confirmed?(a("task modal action",{source:i,action:"created"}),e({confirmed:!0,task_action:S.task_action},y,!1)):(a("task modal action",{source:i,action:"deleted"}),e({confirmed:!1},y,!1))},[e,y,i,a]),b=d.useCallback(()=>{v({confirmed:!1})},[v]),_=d.useCallback(()=>{const S={task_name:u.query?.prompt||"Untitled Task",prompt:u.query?.prompt,model_preference:u.query?.searchModel||ie.DEFAULT,schedule:u.trigger.type===Ze.SCHEDULED?CYe(u.trigger.schedule):void 0,expiry_date:t.expiry_date};v({confirmed:!0,task_action:S})},[u,v,t.expiry_date]),w=d.useCallback(S=>{f(S)},[]);return t?r?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:s({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsxs("div",{className:"bg-subtler border-subtlest transform overflow-hidden rounded-xl border transition-transform duration-200",children:[l.jsxs("div",{className:"bg-subtler border-subtler flex items-center justify-between border-b px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:l.jsx(ut,{name:B("clock"),size:16,className:"text-quiet"})}),l.jsx("h3",{className:"text-foreground text-sm font-medium",children:x})]}),l.jsx(wYe,{result:m})]}),l.jsx("div",{className:"bg-base p-4",children:l.jsx(Wc,{children:l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(mb,{configuration:u,onConfigurationChange:w,canEditSpace:!1}),h&&l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("exclamation-circle"),size:12,className:"text-caution"}),l.jsx(V,{variant:"tinyRegular",color:"red",className:"mt-0.5",children:h})]}),l.jsx(xre,{onSkip:b,onConfirm:_,disabled:r,result:m})]})})})]}):(Z.error("TaskOperationStep received null/undefined taskAction - will not render",{stepUUID:n,taskAction:t,isFinished:r,source:i}),null)});Vre.displayName="TaskOperationStep";function CYe(e){const t=`${e.hour.toString().padStart(2,"0")}:${e.minute.toString().padStart(2,"0")}`;switch(e.kind){case"ONCE":return{one_time:{datetime:new Date(e.year,e.month,e.day,e.hour,e.minute).toISOString()}};case"DAILY":return{daily:{time:t}};case"WEEKLY":return{weekly:{time:t,day_of_week:(e.dayOfWeek+6)%7}};case"MONTHLY":return{monthly:{time:t,day_of_month:e.day}};case"YEARLY":return{yearly:{time:t,day_of_month:e.day,month_of_year:e.month+1}};case"WEEKDAYS":return{weekdays:{time:t}};default:return{daily:{time:t}}}}function SYe(e){if(!e)return Gr();if(e.one_time){const t=e.one_time.datetime;if(!t)return Gr();const n=new Date(t);return{kind:"ONCE",minute:n.getMinutes(),hour:n.getHours(),day:n.getDate(),month:n.getMonth(),year:n.getFullYear(),dayOfWeek:n.getDay()}}else if(e.daily){const t=e.daily.time;if(!t)return Gr();const[n="",r=""]=t.split(":"),s=parseInt(n,10),o=parseInt(r,10);if(isNaN(s)||isNaN(o))return Gr();const a=new Date;return{kind:"DAILY",minute:o,hour:s,day:a.getDate(),month:a.getMonth(),year:a.getFullYear(),dayOfWeek:a.getDay()}}else if(e.weekly){const t=e.weekly.time,n=e.weekly.day_of_week;if(!t||n==null)return Gr();const[r="",s=""]=t.split(":"),o=parseInt(r,10),a=parseInt(s,10);if(isNaN(o)||isNaN(a))return Gr();const i=(n+1)%7,c=new Date;return{kind:"WEEKLY",minute:a,hour:o,day:c.getDate(),month:c.getMonth(),year:c.getFullYear(),dayOfWeek:i}}else if(e.monthly){const t=e.monthly.time,n=e.monthly.day_of_month;if(!t||n==null)return Gr();const[r="",s=""]=t.split(":"),o=parseInt(r,10),a=parseInt(s,10);if(isNaN(o)||isNaN(a))return Gr();const i=new Date;return{kind:"MONTHLY",minute:a,hour:o,day:n,month:i.getMonth(),year:i.getFullYear(),dayOfWeek:i.getDay()}}else if(e.yearly){const t=e.yearly.time,n=e.yearly.month_of_year,r=e.yearly.day_of_month;if(!t||n==null||r==null)return Gr();const[s="",o=""]=t.split(":"),a=parseInt(s,10),i=parseInt(o,10);if(isNaN(a)||isNaN(i))return Gr();const c=new Date;return{kind:"YEARLY",minute:i,hour:a,day:r,month:n-1,year:c.getFullYear(),dayOfWeek:c.getDay()}}else if(e.weekdays){const t=e.weekdays.time;if(!t)return Gr();const[n="",r=""]=t.split(":"),s=parseInt(n,10),o=parseInt(r,10);if(isNaN(s)||isNaN(o))return Gr();const a=new Date;return{kind:"WEEKDAYS",minute:o,hour:s,day:a.getDate(),month:a.getMonth(),year:a.getFullYear(),dayOfWeek:a.getDay()}}return Gr()}const pk=A.memo(({question:e,sendStepResult:t,isFinished:n})=>{const r="user-clarification-step",[s,o]=d.useState(n??!1),[a,i]=d.useState(""),{$t:c}=J(),u=d.useCallback(()=>{o(!0),t({confirmed:!1,user_input:a.length>0?a:"The user chose to confirm with the information provided"},r,!1)},[a,t]),f=d.useCallback(()=>{o(!0),t({confirmed:!1},r,!1)},[t]),m=d.useCallback(p=>{Ls.isEnterKeyWithoutShift(p)&&(p.preventDefault(),u())},[u]);return s?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:c({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsx(K,{variant:"raised",className:"py-sm rounded-lg border",children:l.jsxs("form",{onSubmit:u,children:[e&&l.jsxs("div",{className:"px-md pt-sm",children:[l.jsx(V,{variant:"small",children:e}),l.jsx("div",{className:"gap-sm mt-3 flex items-center",children:l.jsx("div",{className:"grow",children:l.jsx(hu,{isMobileStyle:!1,isMobileUserAgent:!1,placeholder:c({defaultMessage:"Add details…",id:"GTIJ9uAEMf"}),value:a,onChange:i,onKeyDown:m,minRows:3,className:"!pl-3",autoFocus:!0})})})]}),l.jsxs("div",{className:"gap-sm px-md py-sm mt-4 flex items-center",children:[l.jsx(Ge,{size:"small",variant:"inverted",text:c({defaultMessage:"Continue",id:"acrOozm08x"}),type:"submit"}),l.jsx(st,{size:"small",text:c({defaultMessage:"Skip",id:"/4tOwTiCH6"}),onClick:f})]})]})})});pk.displayName="UserClarificationStep";const Hre=A.memo(({step:e,action:t})=>{const{final:n,file_name:r,sheet_count:s,row_count:o}=e.content,a=!n;let i=t;return r&&n&&(i=r,s!=null?(i+=` (${s} sheets`,o!=null&&(i+=`, ${o} rows`),i+=")"):o!=null&&(i+=` (${o} rows)`)),l.jsx(Ge,{text:t,icon:B("file-spreadsheet"),isLoading:a,size:"tiny",pill:!0,toolTip:i,tooltipLayout:"top"})});Hre.displayName="XlsxStep";const EYe=60,zre=A.memo(({questions:e,toolUuid:t,autoSkipSeconds:n=EYe,isFinished:r=!1,entryUuid:s})=>{const o=d.useRef(null),[a,i]=d.useState(0),[c,u]=d.useState(!1),[f,m]=d.useState(!1),p=d.useRef(!1),{$t:h}=J(),{session:g}=Ne(),{trackEvent:y,trackEventOnce:x}=Xe(g),[v,b]=d.useState(new Map),{mutate:_,isPending:w}=uBe(),S=n*1e3;d.useEffect(()=>{e.forEach(M=>{M.question_text&&x("clarifying question input viewed",{entry_uuid:s,clarifying_question:M.question_text})})},[e,s,x]);const C=d.useCallback(()=>e.map(M=>({question:M.question_text,answer:v.get(M.question_text??"")??""})),[e,v]),E=d.useCallback(M=>{if(p.current)return;p.current=!0,C().forEach(D=>{D.answer&&y("clarifying question answer submitted",{entry_uuid:s,answer:D.answer})}),M==="USER_SUBMITTED"?u(!0):m(!0),o.current&&clearInterval(o.current),_({answers:C(),toolUuid:t,submitType:M})},[t,C,_,s,y]),T=d.useCallback(()=>{const M=Array.from(v.values()).some(N=>N.trim()!=="");E(M?"USER_SUBMITTED":"TIMEOUT")},[E,v]),k=d.useCallback((M,N)=>{b(D=>{const j=new Map(D);return j.set(M,N),j}),i(-1),o.current&&clearInterval(o.current)},[]);d.useEffect(()=>{a>=S&&!p.current&&E("TIMEOUT")},[a,S,E]);const I=w||c||f||r;return e.length===0?null:c?l.jsx(Wre,{questionCount:e.length}):f?l.jsx(Gre,{questionCount:e.length}):l.jsxs(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:[l.jsxs("div",{className:"flex flex-row justify-between items-start",children:[l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("circle-arrow-up"),size:"sm"}),h({defaultMessage:"Get a better answer",id:"bdUER2dpcm"})]}),w?l.jsx("div",{className:"inline-flex text-quieter h-8 items-start ",children:l.jsx(Gl,{})}):l.jsx($re,{isSubmitting:I,onClick:T,skipProgress:a,setSkipProgress:i,skipDurationMs:S,interval:o})]}),l.jsx("div",{className:"flex flex-col divide-y",children:e.map(M=>l.jsx(Kre,{questionText:M.question_text??"",options:M.options??[],isDisabled:I,onAnswerChange:k},M.question_text))})]})}),Wre=A.memo(({questionCount:e})=>{const{$t:t}=J();return l.jsx(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("circle-check"),size:"sm"}),t(e===1?{defaultMessage:"Answer submitted",id:"nhijhP95Wa"}:{defaultMessage:"Answers submitted",id:"slMbotVCdl"})]})})});Wre.displayName="SubmittedBanner";const Gre=A.memo(({questionCount:e})=>{const{$t:t}=J();return l.jsx(K,{variant:"subtler",className:"rounded-xl p-md flex flex-col gap-y-sm relative border",children:l.jsxs(V,{variant:"small",color:"light",className:"flex items-center gap-xs",children:[l.jsx(ge,{icon:B("player-track-next"),size:"sm"}),t(e===1?{defaultMessage:"Question skipped",id:"TXA0/vEkkm"}:{defaultMessage:"Questions skipped",id:"y2UvuAr/nW"})]})})});Gre.displayName="SkippedBanner";const $re=A.memo(({isSubmitting:e,onClick:t,skipProgress:n,setSkipProgress:r,skipDurationMs:s,interval:o})=>{d.useEffect(()=>(o.current=setInterval(()=>{r(u=>Math.min(u+100,s))},100),()=>{o.current&&clearInterval(o.current)}),[o,r,s]);const{$t:a}=J(),i=d.useMemo(()=>{const u=Math.ceil((s-n)/1e3);return e?a({defaultMessage:"Working...",id:"H6RqOb/hea"}):n<0?a({defaultMessage:"Continue",id:"acrOozm08x"}):a({defaultMessage:"Continue ({seconds})",id:"q9N0Gjq72e"},{seconds:u})},[n,e,s,a]),c=d.useMemo(()=>({width:`${n/s*100}%`}),[n,s]);return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"pointer-events-none relative opacity-0",children:l.jsx(wt,{variant:"text",size:"small",onClick:t,disabled:e,children:n<0?a({defaultMessage:"Continue",id:"acrOozm08x"}):a({defaultMessage:"Continue (99)",id:"JLwyORtPZa"})})}),l.jsx("div",{className:"absolute inset-0",children:l.jsx(wt,{variant:n<0?"primary":"text",size:"small",onClick:t,disabled:e,fullWidth:!0,children:i})})]}),l.jsxs("div",{className:z("grid grid-cols-1 grid-rows-1 rounded-lg overflow-hidden absolute inset-0 duration-normal pointer-events-none",e||n<0?"opacity-0":""),children:[l.jsx(K,{className:"bg-subtle col-start-1 row-start-1 h-full",variant:"subtle"}),l.jsx(K,{className:"opacity-5 col-start-1 row-start-1 h-full w-1/2 rounded-inherit duration-linear duration-100",variant:"textColor",style:c})]})]})});$re.displayName="SkipButton";const qre=A.memo(({text:e,isSelected:t,isDisabled:n,onClick:r})=>{const s=d.useCallback(()=>{r(e)},[e,r]);return l.jsx("div",{className:z(t?"[&_button]:bg-inverse":"","inline-flex"),children:l.jsx(wt,{variant:t?"primary":"tonal",size:"tiny",disabled:n,onClick:s,children:e})})});qre.displayName="AnswerButton";const Kre=A.memo(({questionText:e,options:t,isDisabled:n,onAnswerChange:r})=>{const[s,o]=d.useState(null),[a,i]=d.useState(!1),[c,u]=d.useState(""),{$t:f}=J(),m=d.useCallback(y=>{o(y),i(!1),r(e,y)},[e,r]),p=d.useCallback(()=>{i(!0),o(null),r(e,"")},[e,r]),h=d.useCallback(y=>{u(y),r(e,y)},[e,r]),g=d.useCallback(()=>{i(!1),u(""),r(e,"")},[e,r]);return l.jsxs("div",{className:"flex flex-col gap-y-sm py-md first:pt-0 last:pb-0",children:[l.jsx(V,{variant:"small",children:e}),a?l.jsxs("div",{className:"gap-x-sm flex flex-row items-center",children:[l.jsx(co,{value:c,onChange:h,placeholder:f({defaultMessage:"Enter your response",id:"NdOK6MxPTM"}),isMobileUserAgent:!1,size:"sm",wrapperClassName:"w-full",className:"h-8",disabled:n}),l.jsx(wt,{size:"small",onClick:g,icon:B("x"),"aria-label":f({defaultMessage:"Back",id:"cyR7KhiuaU"}),variant:"text",disabled:n})]}):l.jsxs("div",{className:"gap-sm flex flex-row flex-wrap",children:[t.map(y=>l.jsx(qre,{text:y,isSelected:s===y,isDisabled:n,onClick:m},y)),l.jsx("div",{className:"inline-flex",children:l.jsx(wt,{variant:"tonal",size:"tiny",onClick:p,disabled:n,children:f({defaultMessage:"Other",id:"/VnDMl81rh"})})})]})]})});Kre.displayName="ClarifyingQuestionRow";zre.displayName="ClarifyingQuestionBanner";const kYe=e=>e.toLowerCase().replace(/_/g," ").replace(/^\w/,t=>t.toUpperCase()),MYe={FINANCE:"FINANCE"},TYe={STOCK_PRICE_MOVEMENT:"STOCK_PRICE_MOVEMENT"};function Gn(e,t,n){return{...t,title:n,actionKey:e}}function AYe(e){const t=[];let n=0;for(;n({...t,originalEndIndex:n}))}function RYe(e){const{step:t,isStudio:n,isFinished:r,onStepClick:s,stepDelay:o,showAllNestedSteps:a,isNested:i,disableAnimations:c,isMissionControl:u,hasAnswer:f,$t:m,getActionMessage:p,translations:h,assetsContent:g,sendStepResult:y,stepCount:x,setStepCount:v,taskComputerActions:b,allSteps:_,setShouldShowSkipButtonOverride:w,shouldShowSourceSkipButton:S,entryResult:C,enabledSources:E,shouldHideScreenshotsInSidecar:T,StepRendererComponent:k}=e;switch(t.step_type){case"SEARCH_WEB":{const M=t.content.queries??[],D=M.length>0&&M.every(j=>j.engine==="image")?"search_images":"search";return Gn(D,{content:l.jsx(gs,{queries:M.map(j=>j.query),stepDelay:n?2:void 0,isFinished:r})},p(D))}case"SEARCH_RESULTS":{let N=function(j){return j.length===0?"reviewing_sources":j.every(F=>F.is_memory)?M.length===1?"reviewing_memory":"reviewing_memories":j.every(F=>F.is_conversation_history)?"reviewing_conversation_history":M.length===1?"reviewing_source":"reviewing_sources"};const M=t.content.web_results,D=N(M);return Gn(D,{count:M.length>1?x:void 0,content:M.length===0?l.jsx(Rr,{icon:B("zoom-out"),text:m({defaultMessage:"No sources found",id:"yWSiuEkfbY"})}):NU(M)?l.jsx(pd,{result:M[0],showName:!0,onClick:s}):l.jsx(pl,{onClick:s,results:M,stepDelay:n?2:void 0,isFinished:r,onCountChange:v})},p(D))}case"ENTROPY_REQUEST":return{content:l.jsx(Eee,{step:t,isFinished:r??!1,isMissionControl:u??!1})};case"CODE":return{content:!g&&l.jsx(hne,{action:p("working"),step:t})};case"PDF":return{content:!g&&l.jsx(jne,{action:p("creating_pdf"),step:t})};case"DOCX":return{content:!g&&l.jsx(xne,{action:p("creating_docx"),step:t})};case"XLSX":return{content:!g&&l.jsx(Hre,{action:p("creating_xlsx"),step:t})};case"CREATE_APP_RESULT":return{content:null};case"CREATE_CLIENT_APP":return{title:p("building_app"),content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.caption})};case"CREATE_CHART":return{title:p("creating_chart"),content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.caption})};case"GET_URL_CONTENT":{const M=t.content.pages,N=M.length>1?"getting_sources":"getting_source";return Gn(N,{count:M.length>1?x:void 0,content:M.length===0?l.jsx(Rr,{icon:B("zoom-out-area"),text:m({defaultMessage:"No content found",id:"JlMgLJz0nd"})}):l.jsx("div",{className:"flex flex-wrap gap-2",children:M.map((D,j)=>l.jsx(pd,{result:{name:"",snippet:"",is_attachment:!1,url:D.url},showName:!1,onClick:s},D.url||j))})},p(N))}case"CLARIFYING_QUESTIONS_OUTPUT":return t.content.clarification?{content:l.jsx(Rte,{step:t})}:null;case"IN_CONTEXT_SUGGESTIONS_OUTPUT":return t.content.selected_suggestion?{content:l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsx(Rr,{icon:B("bulb"),text:t.content.selected_suggestion})})}:null;case"THOUGHT":return Gn("thinking",{content:l.jsx(K,{variant:"subtler",className:"py-xs inline-block rounded-lg px-2.5",children:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.thought})})},p("thinking"));case"URL_NAVIGATE":return Gn("navigate",{content:l.jsx(gs,{queries:t.content.urls})},p("navigate"));case"BROWSER_OPEN_TAB_RESULTS":return Gn("opening_tab",{content:l.jsx(pd,{result:{name:t.content.tab.title,url:t.content.tab.url,snippet:"",is_attachment:!1,is_client_context:!0,tab_id:t.content.tab.id},showName:!0,onClick:s})},p("opening_tab"));case"BROWSER_CLOSE_TABS_RESULTS":{const M=t.content.tabs;return Gn("closing_tabs",{content:M.length===0?l.jsx(gs,{queries:[h.failedClosedTabs],icon:B("cancel")}):l.jsx(pl,{results:M.map(N=>({name:N.title,url:N.url,snippet:"",is_attachment:!1})),textClassName:N=>{const D="url"in N&&N.url,j="name"in N&&N.name;return D||j?"opacity-65 line-through":""}})},p("closing_tabs"))}case"READ_GMAIL":case"READ_EMAIL":{const M=t.content.queries?.length?t.content.queries:[h.allEmail];return Gn("searching_gmail",{content:l.jsx(gs,{queries:M,icon:B("mail-search")})},p("searching_gmail"))}case"READ_GMAIL_RESPONSE":case"READ_EMAIL_RESPONSE":{const M=t.content;return M?.authenticated&&M?.count>0?Gn("reading_emails",{content:M.results?l.jsx(pl,{results:M.results,resultType:"email",onClick:s,stepDelay:o,isFinished:r,maxHeight:400}):null},p("reading_emails")):{title:M?.authenticated?h.emailsFound(0):h.gmailNotAuthenticated,content:null}}case"READ_CALENDAR":return Gn("searching_calendar",{content:l.jsx(gs,{queries:t.content.queries??[],icon:B("user-scan")})},p("searching_calendar"));case"READ_CALENDAR_RESPONSE":return t.content.authenticated&&(t.content.count??0)>0?Gn("reading_events",{content:t.content.results?l.jsx(pl,{results:t.content.results,resultType:"calendar",onClick:s,stepDelay:o,isFinished:r,maxHeight:400}):null},p("reading_events")):{title:t.content.authenticated?h.eventsFound(0):h.googleCalendarNotAuthenticated,content:null};case"UPDATE_CALENDAR":return Gn("scheduling",{isFinished:!0,content:t.content?.clarification?l.jsx(pk,{isFinished:!1,question:t.content.clarification,sendStepResult:y}):t.content?.operations?l.jsx(Tte,{isFinished:!1,calendarOperations:t.content.operations,sendStepResult:y}):null},p("scheduling"));case"UPDATE_CALENDAR_RESPONSE":return Gn("scheduling",{isFinished:!0,content:(()=>{const M=t.content?.operations;return!M||M.length===0?l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:m({defaultMessage:"Done",id:"JXdbo8Vnlw"})}):l.jsx(Ate,{operations:M})})()},p("scheduling"));case"CREATE_TASKS":{const N=t.content?.task_action;if(!N)return null;if(N.event_group===MYe.FINANCE&&N.event_type&&N.event_entity){const D={ticker_symbol:N.event_entity,target_price:N.target_price,current_price:N.current_price,...N.event_type===TYe.STOCK_PRICE_MOVEMENT&&{movement_percent:X0(N.upper_bound)?N.upper_bound:X0(N.lower_bound)?Math.abs(N.lower_bound):void 0,positive_direction:X0(N.upper_bound),negative_direction:X0(N.lower_bound)}};return{title:m({defaultMessage:"Setting up price alert",id:"JGiR4/dpaV"}),isFinished:!0,content:l.jsx(Tre,{taskAction:N,priceAlertData:D,stepUUID:t.uuid??"",isFinished:r,sendStepResult:y})}}return{title:p("scheduling"),isFinished:!0,content:l.jsx(Vre,{taskAction:N,stepUUID:t.uuid??"",isFinished:r,sendStepResult:y})}}case"CREATE_TASKS_RESPONSE":return{title:p("scheduled"),isFinished:!0,content:l.jsx(Rr,{icon:B("circle-check-filled"),iconClassName:"text-super",text:"Done"})};case"SEND_GMAIL":case"SEND_EMAIL":return f?null:{title:p("emailing"),content:t.content?.clarification?l.jsx(pk,{isFinished:!1,question:t.content.clarification,sendStepResult:y}):t.content?l.jsx(Ure,{isFinished:!1,emailAction:t.content.action,sendStepResult:y}):null};case"SEND_GMAIL_RESPONSE":case"SEND_EMAIL_RESPONSE":return{title:p("emailing"),isFinished:!0,content:l.jsx(vne,{status:t.content?.status})};case"EMAIL_CALENDAR_AGENT_RESPONSE":case"GMAIL_GCAL_AGENT_RESPONSE":return{title:t.content.authenticated?void 0:h.gmailNotAuthenticated,content:null};case"EMAIL_CALENDAR_AGENT":case"GMAIL_GCAL_AGENT":{const M=AYe(t.content.steps??[]),N=a?M:M.slice(-1);return{content:l.jsx(l.Fragment,{children:N.map(D=>{const j={step_type:D.step_type||"EMAIL_CALENDAR_AGENT",content:D.step_type==="GET_FREEBUSY"&&D.get_free_busy_response_content?{...D.get_free_busy_content,...D.get_free_busy_response_content}:D.get_free_busy_content??D.get_user_info_content??D.get_user_info_response_content??D.send_email_content??D.update_calendar_content??D.update_calendar_response_content??D.send_email_response_content??D.get_free_busy_response_content??D.read_calendar_content??D.read_calendar_response_content??D.read_email_content??D.read_email_response_content??{},uuid:D.uuid||"",assets:void 0},F=a?r||D.originalEndIndex<(t.content.steps?.length??0)-1:r;return l.jsx(k,{step:j,isFinished:F,isNested:i,onStepClick:s,showAllNestedSteps:a,disableAnimations:c},D.uuid)})})}}case"FLIGHTS_SEARCH":{const M=t.content;if(!M)return null;const N=M.found_flights,D=N&&N.length>0,j=M.submitted;return{title:p("searching_flights"),isFinished:D,content:D&&!j?l.jsx(Bne,{stepUUID:t.uuid??"",goalId:M.goal_id??"",foundFlights:M.found_flights,isSubmitted:j??!1,outboundDate:M.outbound_date,returnDate:M.return_date,flightType:M.flight_type}):null}}case"FLIGHTS_SEARCH_RESPONSE":{const{selected_flight:M,submitted:N}=t.content??{},D=p("looking_for_booking_options"),j=M?.flights?.map(H=>H.airline).filter(Boolean).join(", ")||"",F=M?.flights?.[0]?.departure_airport?.id||"",R=M?.flights?.[M.flights.length-1]?.arrival_airport?.id||"",P=M?.total_duration||0,L=Math.floor(P/60),U=P%60,O=L>0?`${L}h ${U}min`:`${U}min`;let $=F;if(M?.flights&&M.flights.length>1)for(let H=1;H ").pop()&&($+=` -> ${Q}`)}$+=` -> ${R}`;const G=`${j} (${$}): ${O}`;return N&&M?{title:D,isFinished:r||f,content:l.jsx(gs,{queries:[G],icon:B("plane-inflight")})}:null}case"FLIGHTS_BOOKING":{const M=t.content;if(!M)return null;const N=M.found_booking_options,D=N&&N.length>0,j=M.submitted;return{title:p("reviewing_booking_options"),isFinished:D,content:D?l.jsx(Lne,{stepUUID:t.uuid??"",goalId:M.goal_id??"",foundBookingOptions:M.found_booking_options,isSubmitted:j??!1}):null}}case"FLIGHTS_BOOKING_RESPONSE":{const{selected_booking_options:M,submitted:N}=t.content??{},D=p("redirecting_to_booking");return N&&M?{title:D,isFinished:r||f,content:(()=>{const j=F=>{const R=[];return F.together?.book_with?R.push(F.together.book_with):(F.departing?.book_with&&R.push(`Departing: ${F.departing.book_with}`),F.returning?.book_with&&R.push(`Returning: ${F.returning.book_with}`)),R.join(" | ")||"Booking options"};return l.jsx(gs,{queries:[j(M)],icon:B("brand-booking")})})()}:null}case"FLIGHTS_AGENT":{const M=NYe(t.content.steps??[]),N=a?M:M.slice(-1);return{content:l.jsx(l.Fragment,{children:N.map(D=>{const j={step_type:D.step_type||"FLIGHTS_AGENT",content:D.browser_open_tab_content??D.browser_open_tab_results_content??D.flights_search_content??D.flights_booking_content??D.flights_search_response_content??D.flights_booking_response_content??{},uuid:D.uuid||"",assets:void 0},F=a?r||D.originalEndIndex<(t.content.steps?.length??0)-1:r;return l.jsx(k,{step:j,isFinished:F,isNested:i,onStepClick:s,showAllNestedSteps:a,disableAnimations:c},D.uuid)})})}}case"TERMINATE":return Gn("conclusion",{content:t.content.reason?l.jsx(K,{variant:"subtler",className:"py-xs inline-block rounded-lg px-2.5",children:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.reason})}):null},p("conclusion"));case"CANVAS_AGENT":{const M=t.content.asset_types??[],N={CODE_FILE:"a file",PDF_FILE:"a PDF",DOCX_FILE:"a document",XLSX_FILE:"a spreadsheet",APP:"an app",SLIDES:"slides"};return{content:l.jsx(Nte,{assetTypes:M,assetTypeLabels:N,isFinished:r})}}case"GENERATE_IMAGE":{const M=t.content.success;return{title:p("generating_images"),content:l.jsx(wne,{prompt:t.content.prompt,success:M})}}case"GENERATE_VIDEO":return Gn("generating_images",{content:l.jsx(V,{variant:"tinyRegular",className:"!text-[0.68rem]",children:t.content.prompt})},p("generating_images"));case"GENERATE_VIDEO_RESULTS":return Gn("presenting_images",{content:!g&&l.jsx(bne,{urls:t.content.video_results.map(M=>M.url??""),onClick:s})},p("presenting_images"));case"BROWSER_GROUP_TABS":return Gn("grouping_tabs",{content:t.content.payloads?.length>0?l.jsx("div",{className:"gap-sm flex flex-row flex-wrap",children:t.content.payloads.map((M,N)=>l.jsx(JE,{color:M.color,title:M.title??""},N))}):null},p("grouping_tabs"));case"BROWSER_GROUP_TABS_RESULTS":return{content:t.content.success?null:l.jsx(Rr,{icon:B("cancel"),text:h.couldNotFinish})};case"BROWSER_UNGROUP":return{title:p("ungrouping_tabs"),content:t.content.payload?.groups_metadata&&t.content.payload.groups_metadata.length>0?(()=>{const M=t.content.payload.groups_metadata.map((N,D)=>({name:N.title||`Group ${D+1}`,url:"",source:N.title||`Group ${D+1}`}));return M.length===1?l.jsx(gs,{queries:t.content.payload.groups_metadata.map(N=>N.title||"Unnamed Group"),initialDisplayCount:3,icon:B("folders")}):l.jsx(pl,{results:M,icon:B("folders"),textClassName:"opacity-65 line-through decoration-subtle"})})():null};case"BROWSER_SEARCH_TAB_GROUPS":return{title:p("searching_tab_groups"),content:l.jsx(gs,{queries:t.content.payload?.queries?.length?t.content.payload.queries:[h.allTabGroups],icon:B("user-scan")})};case"BROWSER_SEARCH_TAB_GROUPS_RESULT":return{title:p("reading"),content:t.content.results.length>0?l.jsx("div",{className:"gap-sm flex flex-row flex-wrap",children:t.content.results.map((M,N)=>l.jsx(JE,{color:M.color,title:M.title??""},N))}):null};case"GET_USER_INFO":{const M=t.content;if(!M||!M.names)return null;const N=M.found_users,D=N&&N.length>0,j=M.submitted,F=D&&!j?"found_contacts":"getting_user_info";return Gn(F,{content:D&&!j?l.jsx(One,{goalId:M.goal_id??"",foundUsers:M.found_users,names:M.names,sendStepResult:y}):l.jsx(gs,{queries:M.names,icon:B("user-search")})},p(F))}case"GET_USER_INFO_RESPONSE":{const{submitted:M,selected_users:N}=t.content??{},D=N?.some(F=>F.selected===!0),j=D?"selecting_contacts":"getting_contact_details";return M&&N?Gn(j,{content:N.length===0?l.jsx(gs,{queries:[p("no_contacts_found")],icon:B("address-book-off")}):N.length===1?l.jsx(gs,{queries:N.map(F=>`${F.display_name||""} ${F.email_address?`(${F.email_address})`:""}`.trim()),icon:B("address-book")}):l.jsx(pl,{results:N.map(F=>({...F,url:F.email_address?`mailto:${F.email_address}`:void 0})),icon:B("address-book"),resultType:"userinfo",textClassName:F=>{const R="email_address"in F?F.email_address:void 0,P=N?.find(L=>L.email_address===R);return D&&P?.selected===!1?"opacity-65 line-through decoration-subtle":""}})},p(j)):null}case"GET_FREEBUSY":{const M=t.content;return{title:p("getting_freebusy"),content:(()=>{const N=M.free_busy_response?.available_periods?.length??0;let D,j;return!M.authenticated&&r?(D=h.googleCalendarNotAuthenticated,j=B("calendar-off")):N===0&&r?(D=h.noAvailabilityFound,j=B("calendar-off")):N>0&&(D=h.availableTimesFound(N),j=B("calendar-week")),D?l.jsx(Rr,{text:D,icon:j}):null})()}}case"GET_FREEBUSY_RESPONSE":return{title:p("getting_freebusy"),content:(()=>{const M=t.content.free_busy_response?.available_periods?.length??0;let N,D;return!t.content.authenticated&&r?(N=h.googleCalendarNotAuthenticated,D=B("calendar-off")):M===0&&r?(N=h.noAvailabilityFound,D=B("calendar-off")):M>0&&(N=h.availableTimesFound(M),D=B("calendar-week")),N?l.jsx(Rr,{text:N,icon:D}):null})()};case"PENDING_FILES":return{content:l.jsx(Ine,{attachments:t.content.attachments,attachmentProcessingProgress:t.content.attachmentProcessingProgress})};case"SEARCH_BROWSER":{const M=t.content.queries?.filter(D=>D!=null&&D.trim()!=="")||[],N=M.length>0?M:t.content.browser_content_sources?.map(D=>D in Ri?p(D):kYe(D))||[];return{title:p("searching_browser"),content:l.jsx(gs,{queries:N,isFinished:r})}}case"SEARCH_BROWSER_RESULTS":return Gn("reading_browser",{count:x,content:(()=>{const{open_tabs:M,recently_closed_tabs:N,history:D}=t.content,j=(M?.length||0)+(N?.length||0)+(D?.length||0);if(j===0)return l.jsx(Rr,{icon:B("zoom-out"),text:m({defaultMessage:"No sources found",id:"yWSiuEkfbY"})});if(j===1){const R=M?.[0]||N?.[0]||D?.[0];return l.jsx(pd,{result:{...R},showName:!0,onClick:s})}const F=[];return M&&M.length>0&&F.push(...M.map(R=>({...R,category:"open_tab"}))),N&&N.length>0&&F.push(...N.map(R=>({...R,category:"closed_tab"}))),D&&D.length>0&&F.push(...D.map(R=>({...R,category:"history"}))),l.jsx(pl,{onClick:s,results:F,groupBy:"category",stepDelay:n?2:void 0,isFinished:r,onCountChange:v})})()},p("reading_browser"));case"MCP_TOOL_INPUT":{const M=t.content,N=M.source_type;if("authenticated"in M&&(M.authenticated===void 0||M.authenticated===null))return null;let D=m({id:"bTDpQ+Tk24",defaultMessage:"external service"});M.mcp_server_type==="MCP_SERVER_TYPE_LOCAL"?D=m({id:"0asQ8snMnq",defaultMessage:"local MCP"}):M?.app&&(D=M.app);const j=M.request_user_approval?.uuid;return Gn("MCP_TOOL",{content:l.jsxs(l.Fragment,{children:[l.jsx(Nne,{step:t,isFinished:r,onActionTaken:()=>w(!1)}),S&&l.jsx("div",{className:"mt-2",children:l.jsx(dee,{entryUUID:C?.backend_uuid??"",sourceType:N,sourceName:D,userApprovalUuid:j,onSkipSourceClicked:()=>w(!0),isAutoDetected:N?!E.includes(N):!1})})]})},p("MCP_TOOL",{appName:D}))}case"MCP_TOOL_OUTPUT":{const M=t.content;return Gn("MCP_TOOL",{content:l.jsx(Dne,{content:M.content||"",shouldRerunQuery:!!M.should_rerun_query})},p("MCP_TOOL"))}case"RESEARCH_CLARIFYING_QUESTIONS":{const M=t.content.questions||[],N=t.content.auto_skip_seconds;return{content:l.jsx(zre,{questions:M,toolUuid:t.content.uuid||t.uuid,autoSkipSeconds:N,isFinished:r,entryUuid:C?.backend_uuid})}}case"COMET_AGENT_TOOL_INPUT":{const M=t.content.tool_input;if(M?.todo_write){const P=_?.findIndex($=>$.uuid===t.uuid)??-1,U=_?.some(($,G)=>G>=P?!1:$?.step_type==="COMET_AGENT_TOOL_INPUT"&&"tool_input"in $.content&&$.content.tool_input?.todo_write)??!1?"updating_todo_list":"creating_todo_list",O=M.todo_write.todos||[];return{actionKey:U,content:l.jsxs(l.Fragment,{children:[l.jsx(Di,{action:U,isFinished:r,className:"mb-two",showAnimation:c}),l.jsx(iee,{todos:O})]})}}else if(M?.subagent_tool_inputs){const P="running_sub_tasks";return{actionKey:P,content:l.jsxs(l.Fragment,{children:[l.jsx(Di,{action:P,isFinished:r,className:"mb-two",showAnimation:c}),l.jsx(nBe,{tool_input_content:t.content})]})}}const N=P=>{let L;return P?.action=="type"&&P.text?L=`: ${ny(P.text,35)}`:P?.action=="key"?L=`: ${P.text}`:P?.action=="wait"&&(L=P.duration===1?` ${P.duration} second`:` ${P.duration} seconds`),L},D=M?.computer_list?.actions;if(D&&D.length>0){const P=M?.computer_list?.uuid,L=b[P??""]??[],U=r?D:L,O=U[U.length-1]?.action,$=O&&O in Ri?O:"working";return Gn($,{content:l.jsx(l.Fragment,{children:U.map((G,H)=>{const Q=G.action,Y=Q&&Q in Ri?Q:"working",te=N(G),se=H===U.length-1;return l.jsx(Di,{title:te,action:Y,isFinished:r||!se,className:"-my-1.5",showAnimation:c},H)})})})}const j=M?.computer?M.computer.action:Object.entries(M??{}).find(([P,L])=>L)?.[0],F=j&&j in Ri?j:"working";let R;return M?.navigate?.url?M.navigate.url==="forward"||M.navigate.url==="back"?R=` ${M.navigate.url}`:R=` to ${ny(M.navigate.url,35)}`:M?.find&&M.find.query?R=`: ${ny(M.find.query,35)}`:M?.computer?R=N(M.computer):M?.bash?M.bash.description?R=`${M.bash.description}`:R="Running a command":M?.file_read?R=` ${M.file_read.file_name}`:M?.file_write?R=` ${M.file_write.file_name}`:M?.file_edit&&(R=` ${M.file_edit.file_name}`),j?Gn(F,{content:l.jsx(Di,{action:F,title:R,isFinished:r,className:"-my-1.5",showAnimation:c})}):null}case"COMET_AGENT_TOOL_OUTPUT":{const M=t.content.tool_output,N=M?.computer?.screenshot_uuid||M?.tabs_create?.screenshot_uuid||M?.navigate?.screenshot_uuid||M?.form_input?.screenshot_uuid,D=M?.computer?.screenshots||M?.tabs_create?.screenshots||M?.navigate?.screenshots||M?.form_input?.screenshots;return T?null:{content:l.jsx(yne,{isFinished:r,screenshot_uuid:N,screenshots:D})}}default:return null}}const DYe=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"hide-screenshots-in-sidecar",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])};function jYe(e){const{action:t,streamId:n,inFlight:r}=e,s=Do();d.useEffect(()=>{if(!s||!n||!t||!r)return;const o=new CustomEvent("comet-agent-step-update",{detail:{stepAction:t,streamId:n}});document.dispatchEvent(o)},[t,s,n,r])}const dN=e=>{const{searchMode:t,hasAnswer:n,result:r,inFlight:s,skippedSources:o,steps:a}=It(),i=t===oe.STUDIO,{taskComputerActions:c}=Qn(),{$t:u}=J(),{step:f,onStepClick:m,isFinished:p,stepDelay:h,motionProps:g,isNested:y=!1,showAllNestedSteps:x=!0,isMissionControl:v=!1,disableAnimations:b=!1}=e,[_,w]=d.useState(void 0),[S,C]=d.useState(void 0),E=f.step_type==="MCP_TOOL_INPUT"?f.content.source_type:void 0,T=Array.from(r?.sources?.sources??[]),k=JFe({sourceType:E,skippedSources:new Set(o)}),{variation:I}=DYe(!1),M=f.step_type==="MCP_TOOL_INPUT"?f.content.app:void 0,N=A.useMemo(()=>S!==void 0?S:k&&!p&&!!r?.backend_uuid&&f.step_type==="MCP_TOOL_INPUT"&&!!M,[S,k,p,r?.backend_uuid,f.step_type,M]),D=d.useCallback(async(ce,ue)=>{f.uuid&&await Qp({contextUUID:r?.context_uuid,stepUUID:f.uuid,result:ce,reason:ue})},[f.uuid,r]),j=d.useCallback(async()=>{await D({confirmed:!0},"thread-upsell-accepted")},[D]),F=d.useCallback(async()=>{await D({confirmed:!1},"thread-upsell-dismissed")},[D]),R=(ce,ue)=>{const me=Ri[ce]?.message;return me?ue?u(me,ue):u(me):""},P=tBe(),L=f.assets&&f.assets.length>0?l.jsx("div",{className:"gap-sm my-sm flex flex-row flex-wrap",children:f.assets.map(ce=>l.jsx(gne,{asset:ce},ce.uuid))}):null,U=f.step_type,O=f.content.should_show_upsell??!1,$=f.content.upsell_information,G=l.jsx(Jd,{position:"router_steps",upsellInformation:$,inFlight:!p,stepUUID:f.uuid,backendUuid:$?.backend_uuid,isLastResult:!0,onAccept:j,onReject:F}),H=RYe({step:f,isStudio:i,isFinished:p,onStepClick:m,stepDelay:h,showAllNestedSteps:x,isNested:y,disableAnimations:b,isMissionControl:v,hasAnswer:n,$t:u,getActionMessage:R,translations:P,assetsContent:L,sendStepResult:D,stepCount:_,setStepCount:w,taskComputerActions:c,allSteps:a,setShouldShowSkipButtonOverride:C,shouldShowSourceSkipButton:N,entryResult:r,enabledSources:T,shouldHideScreenshotsInSidecar:I,StepRendererComponent:dN});if(jYe({action:H?.actionKey,streamId:r?.uuid,inFlight:s}),!H)return v?l.jsx(Di,{title:R("working"),showAnimation:b,className:"mt-sm"}):null;const{title:Q,content:Y,count:te,isFinished:se}=H,ae=O&&$?!0:se??p??!1,X={key:f.uuid,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"mt-1.5 empty:hidden"},ee={...X,...g,className:g?.className?`${X.className} ${g.className}`:X.className},{key:le,...re}=ee;return l.jsxs(Te.div,{...re,children:[Q&&l.jsx(Di,{title:Q,isFinished:ae,className:"mb-two",count:te,showAnimation:b}),!Q&&v&&!ae&&U!=="ENTROPY_REQUEST"&&l.jsx(Di,{title:R("working"),showAnimation:b,className:"mb-two"}),O&&$?G:Y,L]},le)};dN.displayName="StepRenderer";const IYe={xs:7,sm:9,md:11,lg:15},Yre=A.memo(({state:e,className:t,size:n="md",showFinishedIcon:r=!0})=>{const s=IYe[n],o={width:s,height:s,backfaceVisibility:"hidden"},a=d.useMemo(()=>({height:`calc(100% - ${s/3}px)`}),[s]);return e==="hidden"?null:l.jsxs("div",{className:z({relative:!t?.includes("absolute")&&!t?.includes("relative")},t),children:[l.jsx("div",{className:z("shrink-0 rounded-full border",{"bg-base border-subtler":e==="planned","bg-inverse/25 dark:bg-inverse/20 flex border-transparent":e==="finished","border-super bg-super":e==="loading"}),style:o,children:e==="finished"&&r&&l.jsx("div",{className:"relative flex size-full bg-transparent transition-opacity ease-linear",children:l.jsx(ge,{icon:B("check"),className:"text-inverse w-full place-self-center",stroke:4,style:a})})}),e==="loading"&&l.jsx("div",{className:"border-super absolute left-0 top-0 animate-ping rounded-full border-2 opacity-75",style:o})]})});Yre.displayName="StatusDot";const Qre=A.memo(({status:e,state:t,showStatus:n,timelineConnectorClassName:r,hasSteps:s,isFinalGoal:o=!1})=>n?l.jsxs("span",{className:"relative flex w-[15px] shrink-0 flex-col items-center",children:[l.jsx("span",{className:z(r,"h-[13px]","group-first/goal:opacity-0 group-only/goal:opacity-0")}),n&&l.jsx(Te.div,{animate:{scale:e==="loading"?1.1:1,transition:{duration:.2,ease:Qd}},children:l.jsx("div",{className:"bg-base",children:l.jsx(Yre,{state:t,showFinishedIcon:!1,size:"xs"})})}),!o&&l.jsx("span",{className:z(r,"grow",!s&&"group-last/goal:opacity-0")})]}):null);Qre.displayName="Timeline";function fN(){const{value:e}=zt({flag:"move-citations-to-paragraph-end",subjectType:"visitor_id",defaultValue:!0});return e}typeof globalThis<"u"&&(globalThis.__useMoveCitationsToParagraphEnd=fN);function i_t(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const a=n.slice(s,r).trim();(a||!o)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function PYe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const OYe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LYe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FYe={};function uO(e,t){return(FYe.jsx?LYe:OYe).test(e)}const BYe=/[ \t\n\f\r]/g;function UYe(e){return typeof e=="object"?e.type==="text"?dO(e.value):!1:dO(e)}function dO(e){return e.replace(BYe,"")===""}class qg{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qg.prototype.normal={};qg.prototype.property={};qg.prototype.space=void 0;function Xre(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new qg(n,r,t)}function hk(e){return e.toLowerCase()}class Ws{constructor(t,n){this.attribute=n,this.property=t}}Ws.prototype.attribute="";Ws.prototype.booleanish=!1;Ws.prototype.boolean=!1;Ws.prototype.commaOrSpaceSeparated=!1;Ws.prototype.commaSeparated=!1;Ws.prototype.defined=!1;Ws.prototype.mustUseProperty=!1;Ws.prototype.number=!1;Ws.prototype.overloadedBoolean=!1;Ws.prototype.property="";Ws.prototype.spaceSeparated=!1;Ws.prototype.space=void 0;let VYe=0;const Lt=vu(),gr=vu(),Zre=vu(),Oe=vu(),jn=vu(),Td=vu(),$s=vu();function vu(){return 2**++VYe}const gk=Object.freeze(Object.defineProperty({__proto__:null,boolean:Lt,booleanish:gr,commaOrSpaceSeparated:$s,commaSeparated:Td,number:Oe,overloadedBoolean:Zre,spaceSeparated:jn},Symbol.toStringTag,{value:"Module"})),Xw=Object.keys(gk);class mN extends Ws{constructor(t,n,r,s){let o=-1;if(super(t,n),fO(this,"space",s),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&$Ye.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mO,YYe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mO.test(o)){let a=o.replace(GYe,KYe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=mN}return new s(r,t)}function KYe(e){return"-"+e.toLowerCase()}function YYe(e){return e.charAt(1).toUpperCase()}const QYe=Xre([Jre,HYe,nse,rse,sse],"html"),pN=Xre([Jre,zYe,nse,rse,sse],"svg");function XYe(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ZYe(e){return e.join(" ").trim()}var Vu={},Zw,pO;function JYe(){if(pO)return Zw;pO=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,i=/^\s+|\s+$/g,c=` -`,u="/",f="*",m="",p="comment",h="declaration";Zw=function(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var v=1,b=1;function _(D){var j=D.match(t);j&&(v+=j.length);var F=D.lastIndexOf(c);b=~F?D.length-F:b+D.length}function w(){var D={line:v,column:b};return function(j){return j.position=new S(D),T(),j}}function S(D){this.start=D,this.end={line:v,column:b},this.source=x.source}S.prototype.content=y;function C(D){var j=new Error(x.source+":"+v+":"+b+": "+D);if(j.reason=D,j.filename=x.source,j.line=v,j.column=b,j.source=y,!x.silent)throw j}function E(D){var j=D.exec(y);if(j){var F=j[0];return _(F),y=y.slice(F.length),j}}function T(){E(n)}function k(D){var j;for(D=D||[];j=I();)j!==!1&&D.push(j);return D}function I(){var D=w();if(!(u!=y.charAt(0)||f!=y.charAt(1))){for(var j=2;m!=y.charAt(j)&&(f!=y.charAt(j)||u!=y.charAt(j+1));)++j;if(j+=2,m===y.charAt(j-1))return C("End of comment missing");var F=y.slice(2,j-2);return b+=2,_(F),y=y.slice(j),b+=2,D({type:p,comment:F})}}function M(){var D=w(),j=E(r);if(j){if(I(),!E(s))return C("property missing ':'");var F=E(o),R=D({type:h,property:g(j[0].replace(e,m)),value:F?g(F[0].replace(e,m)):m});return E(a),R}}function N(){var D=[];k(D);for(var j;j=M();)j!==!1&&(D.push(j),k(D));return D}return T(),N()};function g(y){return y?y.replace(i,m):m}return Zw}var hO;function eQe(){if(hO)return Vu;hO=1;var e=Vu&&Vu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.default=n;var t=e(JYe());function n(r,s){var o=null;if(!r||typeof r!="string")return o;var a=(0,t.default)(r),i=typeof s=="function";return a.forEach(function(c){if(c.type==="declaration"){var u=c.property,f=c.value;i?s(u,f,c):f&&(o=o||{},o[u]=f)}}),o}return Vu}var Fm={},gO;function tQe(){if(gO)return Fm;gO=1,Object.defineProperty(Fm,"__esModule",{value:!0}),Fm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},a=function(u,f){return f.toUpperCase()},i=function(u,f){return"".concat(f,"-")},c=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(s,i):u=u.replace(r,i),u.replace(t,a))};return Fm.camelCase=c,Fm}var Bm,yO;function nQe(){if(yO)return Bm;yO=1;var e=Bm&&Bm.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(eQe()),n=tQe();function r(s,o){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(i,c){i&&c&&(a[(0,n.camelCase)(i,o)]=c)}),a}return r.default=r,Bm=r,Bm}var rQe=nQe();const sQe=uo(rQe),ose=ase("end"),hN=ase("start");function ase(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function oQe(e){const t=hN(e),n=ose(e);if(t&&n)return{start:t,end:n}}function Lp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xO(e.position):"start"in e||"end"in e?xO(e):"line"in e||"column"in e?yk(e):""}function yk(e){return vO(e&&e.line)+":"+vO(e&&e.column)}function xO(e){return yk(e&&e.start)+"-"+yk(e&&e.end)}function vO(e){return e&&typeof e=="number"?e:1}class us extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(a=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const i=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=i?i.line:void 0,this.name=Lp(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}us.prototype.file="";us.prototype.name="";us.prototype.reason="";us.prototype.message="";us.prototype.stack="";us.prototype.column=void 0;us.prototype.line=void 0;us.prototype.ancestors=void 0;us.prototype.cause=void 0;us.prototype.fatal=void 0;us.prototype.place=void 0;us.prototype.ruleId=void 0;us.prototype.source=void 0;const gN={}.hasOwnProperty,aQe=new Map,iQe=/[A-Z]/g,lQe=new Set(["table","tbody","thead","tfoot","tr"]),cQe=new Set(["td","th"]),ise="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uQe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=xQe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=yQe(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?pN:QYe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=lse(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function lse(e,t,n){if(t.type==="element")return dQe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fQe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pQe(e,t,n);if(t.type==="mdxjsEsm")return mQe(e,t);if(t.type==="root")return hQe(e,t,n);if(t.type==="text")return gQe(e,t)}function dQe(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=pN,e.schema=s),e.ancestors.push(t);const o=use(e,t.tagName,!1),a=vQe(e,t);let i=xN(e,t);return lQe.has(t.tagName)&&(i=i.filter(function(c){return typeof c=="string"?!UYe(c):!0})),cse(e,a,o,t),yN(a,i),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function fQe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ah(e,t.position)}function mQe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ah(e,t.position)}function pQe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=pN,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:use(e,t.name,!0),a=bQe(e,t),i=xN(e,t);return cse(e,a,o,t),yN(a,i),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function hQe(e,t,n){const r={};return yN(r,xN(e,t)),e.create(t,e.Fragment,r,n)}function gQe(e,t){return t.value}function cse(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yQe(e,t,n){return r;function r(s,o,a,i){const u=Array.isArray(a.children)?n:t;return i?u(o,a,i):u(o,a)}}function xQe(e,t){return n;function n(r,s,o,a){const i=Array.isArray(o.children),c=hN(r);return t(s,o,a,i,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function vQe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&gN.call(t.properties,s)){const o=_Qe(e,s,t.properties[s]);if(o){const[a,i]=o;e.tableCellAlignToStyle&&a==="align"&&typeof i=="string"&&cQe.has(t.tagName)?r=i:n[a]=i}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bQe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const i=a.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Ah(e,t.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const i=r.value.data.estree.body[0];i.type,o=e.evaluater.evaluateExpression(i.expression)}else Ah(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function xN(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:aQe;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(io(e,e.length,0,t),e):t}const wO={}.hasOwnProperty;function fse(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vs=sc(/[A-Za-z]/),is=sc(/[\dA-Za-z]/),NQe=sc(/[#-'*+\--9=?A-Z^-~]/);function F2(e){return e!==null&&(e<32||e===127)}const xk=sc(/\d/),RQe=sc(/[\dA-Fa-f]/),DQe=sc(/[!-/:-@[-`{-~]/);function ot(e){return e!==null&&e<-2}function Nn(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const vb=sc(new RegExp("\\p{P}|\\p{S}","u")),tu=sc(/\s/);function sc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function rm(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&o<57344){const i=e.charCodeAt(n+1);o<56320&&i>56319&&i<57344?(a=String.fromCharCode(o,i),s=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ut(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(c){return Kt(c)?(e.enter(n),i(c)):t(c)}function i(c){return Kt(c)&&o++a))return;const E=t.events.length;let T=E,k,I;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(k){I=t.events[T][1].end;break}k=!0}for(v(r),C=E;C_;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=_}function b(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function LQe(e,t,n){return Ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ff(e){if(e===null||Nn(e)||tu(e))return 1;if(vb(e))return 2}function bb(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},p={...e[n][1].start};SO(m,-c),SO(p,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},i={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[r][1].end={...a.start},e[n][1].start={...i.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=wo(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=wo(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=wo(u,bb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=wo(u,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=wo(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,io(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&Kt(C)?Ut(e,b,"linePrefix",o+1)(C):b(C)}function b(C){return C===null||ot(C)?e.check(EO,y,w)(C):(e.enter("codeFlowValue"),_(C))}function _(C){return C===null||ot(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),_)}function w(C){return e.exit("codeFenced"),t(C)}function S(C,E,T){let k=0;return I;function I(F){return C.enter("lineEnding"),C.consume(F),C.exit("lineEnding"),M}function M(F){return C.enter("codeFencedFence"),Kt(F)?Ut(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):N(F)}function N(F){return F===i?(C.enter("codeFencedFenceSequence"),D(F)):T(F)}function D(F){return F===i?(k++,C.consume(F),D):k>=a?(C.exit("codeFencedFenceSequence"),Kt(F)?Ut(C,j,"whitespace")(F):j(F)):T(F)}function j(F){return F===null||ot(F)?(C.exit("codeFencedFence"),E(F)):T(F)}}}function YQe(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const eC={name:"codeIndented",tokenize:XQe},QQe={partial:!0,tokenize:ZQe};function XQe(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Ut(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):ot(u)?e.attempt(QQe,a,c)(u):(e.enter("codeFlowValue"),i(u))}function i(u){return u===null||ot(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),i)}function c(u){return e.exit("codeIndented"),t(u)}}function ZQe(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ot(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Ut(e,o,"linePrefix",5)(a)}function o(a){const i=r.events[r.events.length-1];return i&&i[1].type==="linePrefix"&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):ot(a)?s(a):n(a)}}const JQe={name:"codeText",previous:tXe,resolve:eXe,tokenize:nXe};function eXe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Um(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Um(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Um(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function xse(e,t,n,r,s,o,a,i,c){const u=c||Number.POSITIVE_INFINITY;let f=0;return m;function m(v){return v===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||F2(v)?n(v):(e.enter(r),e.enter(a),e.enter(i),e.enter("chunkString",{contentType:"string"}),y(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(s),e.exit(r),t):(e.enter(i),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(e.exit("chunkString"),e.exit(i),p(v)):v===null||v===60||ot(v)?n(v):(e.consume(v),v===92?g:h)}function g(v){return v===60||v===62||v===92?(e.consume(v),h):h(v)}function y(v){return!f&&(v===null||v===41||Nn(v))?(e.exit("chunkString"),e.exit(i),e.exit(a),e.exit(r),t(v)):f999||h===null||h===91||h===93&&!c||h===94&&!i&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(e.exit(o),e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):ot(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),m(h))}function m(h){return h===null||h===91||h===93||ot(h)||i++>999?(e.exit("chunkString"),f(h)):(e.consume(h),c||(c=!Kt(h)),h===92?p:m)}function p(h){return h===91||h===92||h===93?(e.consume(h),i++,m):m(h)}}function bse(e,t,n,r,s,o){let a;return i;function i(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,c):n(p)}function c(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===a?(e.exit(o),c(a)):p===null?n(p):ot(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ut(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===a||p===null||ot(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?m:f)}function m(p){return p===a||p===92?(e.consume(p),f):f(p)}}function Fp(e,t){let n;return r;function r(s){return ot(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Kt(s)?Ut(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const uXe={name:"definition",tokenize:fXe},dXe={partial:!0,tokenize:mXe};function fXe(e,t,n){const r=this;let s;return o;function o(h){return e.enter("definition"),a(h)}function a(h){return vse.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function i(h){return s=pa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):n(h)}function c(h){return Nn(h)?Fp(e,u)(h):u(h)}function u(h){return xse(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(dXe,m,m)(h)}function m(h){return Kt(h)?Ut(e,p,"whitespace")(h):p(h)}function p(h){return h===null||ot(h)?(e.exit("definition"),r.parser.defined.push(s),t(h)):n(h)}}function mXe(e,t,n){return r;function r(i){return Nn(i)?Fp(e,s)(i):n(i)}function s(i){return bse(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function o(i){return Kt(i)?Ut(e,a,"whitespace")(i):a(i)}function a(i){return i===null||ot(i)?t(i):n(i)}}const pXe={name:"hardBreakEscape",tokenize:hXe};function hXe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return ot(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const gXe={name:"headingAtx",resolve:yXe,tokenize:xXe};function yXe(e,t){let n=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},io(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function xXe(e,t,n){let r=0;return s;function s(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||Nn(f)?(e.exit("atxHeadingSequence"),i(f)):n(f)}function i(f){return f===35?(e.enter("atxHeadingSequence"),c(f)):f===null||ot(f)?(e.exit("atxHeading"),t(f)):Kt(f)?Ut(e,i,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function c(f){return f===35?(e.consume(f),c):(e.exit("atxHeadingSequence"),i(f))}function u(f){return f===null||f===35||Nn(f)?(e.exit("atxHeadingText"),i(f)):(e.consume(f),u)}}const vXe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],MO=["pre","script","style","textarea"],bXe={concrete:!0,name:"htmlFlow",resolveTo:CXe,tokenize:SXe},_Xe={partial:!0,tokenize:kXe},wXe={partial:!0,tokenize:EXe};function CXe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SXe(e,t,n){const r=this;let s,o,a,i,c;return u;function u(H){return f(H)}function f(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),m}function m(H){return H===33?(e.consume(H),p):H===47?(e.consume(H),o=!0,y):H===63?(e.consume(H),s=3,r.interrupt?t:O):vs(H)?(e.consume(H),a=String.fromCharCode(H),x):n(H)}function p(H){return H===45?(e.consume(H),s=2,h):H===91?(e.consume(H),s=5,i=0,g):vs(H)?(e.consume(H),s=4,r.interrupt?t:O):n(H)}function h(H){return H===45?(e.consume(H),r.interrupt?t:O):n(H)}function g(H){const Q="CDATA[";return H===Q.charCodeAt(i++)?(e.consume(H),i===Q.length?r.interrupt?t:N:g):n(H)}function y(H){return vs(H)?(e.consume(H),a=String.fromCharCode(H),x):n(H)}function x(H){if(H===null||H===47||H===62||Nn(H)){const Q=H===47,Y=a.toLowerCase();return!Q&&!o&&MO.includes(Y)?(s=1,r.interrupt?t(H):N(H)):vXe.includes(a.toLowerCase())?(s=6,Q?(e.consume(H),v):r.interrupt?t(H):N(H)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(H):o?b(H):_(H))}return H===45||is(H)?(e.consume(H),a+=String.fromCharCode(H),x):n(H)}function v(H){return H===62?(e.consume(H),r.interrupt?t:N):n(H)}function b(H){return Kt(H)?(e.consume(H),b):I(H)}function _(H){return H===47?(e.consume(H),I):H===58||H===95||vs(H)?(e.consume(H),w):Kt(H)?(e.consume(H),_):I(H)}function w(H){return H===45||H===46||H===58||H===95||is(H)?(e.consume(H),w):S(H)}function S(H){return H===61?(e.consume(H),C):Kt(H)?(e.consume(H),S):_(H)}function C(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),c=H,E):Kt(H)?(e.consume(H),C):T(H)}function E(H){return H===c?(e.consume(H),c=null,k):H===null||ot(H)?n(H):(e.consume(H),E)}function T(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Nn(H)?S(H):(e.consume(H),T)}function k(H){return H===47||H===62||Kt(H)?_(H):n(H)}function I(H){return H===62?(e.consume(H),M):n(H)}function M(H){return H===null||ot(H)?N(H):Kt(H)?(e.consume(H),M):n(H)}function N(H){return H===45&&s===2?(e.consume(H),R):H===60&&s===1?(e.consume(H),P):H===62&&s===4?(e.consume(H),$):H===63&&s===3?(e.consume(H),O):H===93&&s===5?(e.consume(H),U):ot(H)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(_Xe,G,D)(H)):H===null||ot(H)?(e.exit("htmlFlowData"),D(H)):(e.consume(H),N)}function D(H){return e.check(wXe,j,G)(H)}function j(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),F}function F(H){return H===null||ot(H)?D(H):(e.enter("htmlFlowData"),N(H))}function R(H){return H===45?(e.consume(H),O):N(H)}function P(H){return H===47?(e.consume(H),a="",L):N(H)}function L(H){if(H===62){const Q=a.toLowerCase();return MO.includes(Q)?(e.consume(H),$):N(H)}return vs(H)&&a.length<8?(e.consume(H),a+=String.fromCharCode(H),L):N(H)}function U(H){return H===93?(e.consume(H),O):N(H)}function O(H){return H===62?(e.consume(H),$):H===45&&s===2?(e.consume(H),O):N(H)}function $(H){return H===null||ot(H)?(e.exit("htmlFlowData"),G(H)):(e.consume(H),$)}function G(H){return e.exit("htmlFlow"),t(H)}}function EXe(e,t,n){const r=this;return s;function s(a){return ot(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function kXe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Kg,t,n)}}const MXe={name:"htmlText",tokenize:TXe};function TXe(e,t,n){const r=this;let s,o,a;return i;function i(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),S):O===63?(e.consume(O),_):vs(O)?(e.consume(O),T):n(O)}function u(O){return O===45?(e.consume(O),f):O===91?(e.consume(O),o=0,g):vs(O)?(e.consume(O),b):n(O)}function f(O){return O===45?(e.consume(O),h):n(O)}function m(O){return O===null?n(O):O===45?(e.consume(O),p):ot(O)?(a=m,P(O)):(e.consume(O),m)}function p(O){return O===45?(e.consume(O),h):m(O)}function h(O){return O===62?R(O):O===45?p(O):m(O)}function g(O){const $="CDATA[";return O===$.charCodeAt(o++)?(e.consume(O),o===$.length?y:g):n(O)}function y(O){return O===null?n(O):O===93?(e.consume(O),x):ot(O)?(a=y,P(O)):(e.consume(O),y)}function x(O){return O===93?(e.consume(O),v):y(O)}function v(O){return O===62?R(O):O===93?(e.consume(O),v):y(O)}function b(O){return O===null||O===62?R(O):ot(O)?(a=b,P(O)):(e.consume(O),b)}function _(O){return O===null?n(O):O===63?(e.consume(O),w):ot(O)?(a=_,P(O)):(e.consume(O),_)}function w(O){return O===62?R(O):_(O)}function S(O){return vs(O)?(e.consume(O),C):n(O)}function C(O){return O===45||is(O)?(e.consume(O),C):E(O)}function E(O){return ot(O)?(a=E,P(O)):Kt(O)?(e.consume(O),E):R(O)}function T(O){return O===45||is(O)?(e.consume(O),T):O===47||O===62||Nn(O)?k(O):n(O)}function k(O){return O===47?(e.consume(O),R):O===58||O===95||vs(O)?(e.consume(O),I):ot(O)?(a=k,P(O)):Kt(O)?(e.consume(O),k):R(O)}function I(O){return O===45||O===46||O===58||O===95||is(O)?(e.consume(O),I):M(O)}function M(O){return O===61?(e.consume(O),N):ot(O)?(a=M,P(O)):Kt(O)?(e.consume(O),M):k(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),s=O,D):ot(O)?(a=N,P(O)):Kt(O)?(e.consume(O),N):(e.consume(O),j)}function D(O){return O===s?(e.consume(O),s=void 0,F):O===null?n(O):ot(O)?(a=D,P(O)):(e.consume(O),D)}function j(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Nn(O)?k(O):(e.consume(O),j)}function F(O){return O===47||O===62||Nn(O)?k(O):n(O)}function R(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function P(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),L}function L(O){return Kt(O)?Ut(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):U(O)}function U(O){return e.enter("htmlTextData"),a(O)}}const _N={name:"labelEnd",resolveAll:DXe,resolveTo:jXe,tokenize:IXe},AXe={tokenize:PXe},NXe={tokenize:OXe},RXe={tokenize:LXe};function DXe(e){let t=-1;const n=[];for(;++t=3&&(u===null||ot(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Kt(u)?Ut(e,i,"whitespace")(u):i(u))}}const Ts={continuation:{tokenize:qXe},exit:YXe,name:"list",tokenize:$Xe},WXe={partial:!0,tokenize:QXe},GXe={partial:!0,tokenize:KXe};function $Xe(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return i;function i(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:xk(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ey,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return n(h)}function c(h){return xk(h)&&++a<10?(e.consume(h),c):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Kg,r.interrupt?n:f,e.attempt(WXe,p,m))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function m(h){return Kt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function qXe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Kg,s,o);function s(i){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ut(e,t,"listItemIndent",r.containerState.size+1)(i)}function o(i){return r.containerState.furtherBlankLines||!Kt(i)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(i)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(GXe,t,a)(i))}function a(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ut(e,e.attempt(Ts,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}function KXe(e,t,n){const r=this;return Ut(e,s,"listItemIndent",r.containerState.size+1);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function YXe(e){e.exit(this.containerState.type)}function QXe(e,t,n){const r=this;return Ut(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const a=r.events[r.events.length-1];return!Kt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const TO={name:"setextUnderline",resolveTo:XXe,tokenize:ZXe};function XXe(e,t){let n=e.length,r,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function ZXe(e,t,n){const r=this;let s;return o;function o(u){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),i(u)}function i(u){return u===s?(e.consume(u),i):(e.exit("setextHeadingLineSequence"),Kt(u)?Ut(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||ot(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const JXe={tokenize:eZe};function eZe(e){const t=this,n=e.attempt(Kg,r,e.attempt(this.parser.constructs.flowInitial,s,Ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(oXe,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tZe={resolveAll:wse()},nZe=_se("string"),rZe=_se("text");function _se(e){return{resolveAll:wse(e==="text"?sZe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,a,i);return a;function a(f){return u(f)?o(f):i(f)}function i(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),c}function c(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),c)}function u(f){if(f===null)return!0;const m=s[f];let p=-1;if(m)for(;++p-1){const i=a[0];typeof i=="string"?a[0]=i.slice(r):a.shift()}o>0&&a.push(e[s].slice(0,o))}return a}function yZe(e,t){let n=-1;const r=[];let s;for(;++n0){const Gt=Ae.tokenStack[Ae.tokenStack.length-1];(Gt[1]||NO).call(Ae,void 0,Gt[0])}for(ve.position={start:ll(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:ll(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},pt=-1;++pt1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function jZe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IZe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kse(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function PZe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kse(e,t);const s={src:rm(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function OZe(e,t){const n={src:rm(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function LZe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function FZe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kse(e,t);const s={href:rm(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function BZe(e,t){const n={href:rm(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function UZe(e,t,n){const r=e.all(t),s=n?VZe(n):Mse(t),o={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let i=-1;for(;++i1}function HZe(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=hN(t.children[1]),c=ose(t.children[t.children.length-1]);i&&c&&(a.position={start:i,end:c}),s.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function qZe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,i=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(jO(t.slice(s),s>0,!1)),o.join("")}function jO(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===RO||o===DO;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===RO||o===DO;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function QZe(e,t){const n={type:"text",value:YZe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XZe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ZZe={blockquote:MZe,break:TZe,code:AZe,delete:NZe,emphasis:RZe,footnoteReference:DZe,heading:jZe,html:IZe,imageReference:PZe,image:OZe,inlineCode:LZe,linkReference:FZe,link:BZe,listItem:UZe,list:HZe,paragraph:zZe,root:WZe,strong:GZe,table:$Ze,tableCell:KZe,tableRow:qZe,text:QZe,thematicBreak:XZe,toml:m1,yaml:m1,definition:m1,footnoteDefinition:m1};function m1(){}const Tse=-1,_b=0,Bp=1,B2=2,wN=3,CN=4,SN=5,EN=6,Ase=7,Nse=8,IO=typeof self=="object"?self:globalThis,JZe=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,a]=t[s];switch(o){case _b:case Tse:return n(a,s);case Bp:{const i=n([],s);for(const c of a)i.push(r(c));return i}case B2:{const i=n({},s);for(const[c,u]of a)i[r(c)]=r(u);return i}case wN:return n(new Date(a),s);case CN:{const{source:i,flags:c}=a;return n(new RegExp(i,c),s)}case SN:{const i=n(new Map,s);for(const[c,u]of a)i.set(r(c),r(u));return i}case EN:{const i=n(new Set,s);for(const c of a)i.add(r(c));return i}case Ase:{const{name:i,message:c}=a;return n(new IO[i](c),s)}case Nse:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:i}=new Uint8Array(a);return n(new DataView(i),a)}}return n(new IO[o](a),s)};return r},PO=e=>JZe(new Map,e)(0),Hu="",{toString:eJe}={},{keys:tJe}=Object,Vm=e=>{const t=typeof e;if(t!=="object"||!e)return[_b,t];const n=eJe.call(e).slice(8,-1);switch(n){case"Array":return[Bp,Hu];case"Object":return[B2,Hu];case"Date":return[wN,Hu];case"RegExp":return[CN,Hu];case"Map":return[SN,Hu];case"Set":return[EN,Hu];case"DataView":return[Bp,n]}return n.includes("Array")?[Bp,n]:n.includes("Error")?[Ase,n]:[B2,n]},p1=([e,t])=>e===_b&&(t==="function"||t==="symbol"),nJe=(e,t,n,r)=>{const s=(a,i)=>{const c=r.push(a)-1;return n.set(i,c),c},o=a=>{if(n.has(a))return n.get(a);let[i,c]=Vm(a);switch(i){case _b:{let f=a;switch(c){case"bigint":i=Nse,f=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return s([Tse],a)}return s([i,f],a)}case Bp:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),s([c,[...p]],a)}const f=[],m=s([i,f],a);for(const p of a)f.push(o(p));return m}case B2:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const f=[],m=s([i,f],a);for(const p of tJe(a))(e||!p1(Vm(a[p])))&&f.push([o(p),o(a[p])]);return m}case wN:return s([i,a.toISOString()],a);case CN:{const{source:f,flags:m}=a;return s([i,{source:f,flags:m}],a)}case SN:{const f=[],m=s([i,f],a);for(const[p,h]of a)(e||!(p1(Vm(p))||p1(Vm(h))))&&f.push([o(p),o(h)]);return m}case EN:{const f=[],m=s([i,f],a);for(const p of a)(e||!p1(Vm(p)))&&f.push(o(p));return m}}const{message:u}=a;return s([i,{name:c,message:u}],a)};return o},OO=(e,{json:t,lossy:n}={})=>{const r=[];return nJe(!(t||n),!!t,new Map,r)(e),r},Bc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?PO(OO(e,t)):structuredClone(e):(e,t)=>PO(OO(e,t));function rJe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function sJe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function oJe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rJe,r=e.options.footnoteBackLabel||sJe,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},i=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,h);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,h),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=f[f.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else f.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,v),i.push(v)}if(i.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Bc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(i,!0)},{type:"text",value:` -`}]}}const wb=(function(e){if(e==null)return cJe;if(typeof e=="function")return Cb(e);if(typeof e=="object")return Array.isArray(e)?aJe(e):iJe(e);if(typeof e=="string")return lJe(e);throw new Error("Expected function, string, or object as test")});function aJe(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let h=Rse,g,y,x;if((!t||o(c,u,f[f.length-1]||void 0))&&(h=dJe(n(c,f)),h[0]===bk))return h;if("children"in c&&c.children){const v=c;if(v.children&&h[0]!==ws)for(y=(r?v.children.length:-1)+a,x=f.concat(v);y>-1&&y0&&n.push({type:"text",value:` -`}),n}function LO(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function FO(e,t){const n=mJe(e,t),r=n.one(e,void 0),s=oJe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:` -`},s),o}function xJe(e,t){return e&&"run"in e?async function(n,r){const s=FO(n,{file:r,...t});await e.run(s,r)}:function(n,r){return FO(n,{file:r,...e||t})}}function BO(e){if(e)throw e}var nC,UO;function vJe(){if(UO)return nC;UO=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},o=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),m=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!m)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,f){n&&f.name==="__proto__"?n(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},i=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return nC=function c(){var u,f,m,p,h,g,y=arguments[0],x=1,v=arguments.length,b=!1;for(typeof y=="boolean"&&(b=y,y=arguments[1]||{},x=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});xa.length;let c;i&&a.push(s);try{c=e.apply(this,a)}catch(u){const f=u;if(i&&n)throw f;return s(f)}i||(c&&c.then&&typeof c.then=="function"?c.then(o,s):c instanceof Error?s(c):o(c))}function s(a,...i){n||(n=!0,t(a,...i))}function o(a){s(null,a)}}const Oa={basename:CJe,dirname:SJe,extname:EJe,join:kJe,sep:"/"};function CJe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yg(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,i=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1),i>-1&&(e.codePointAt(s)===t.codePointAt(i--)?i<0&&(r=s):(i=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function SJe(e){if(Yg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function EJe(e){Yg(e);let t=e.length,n=-1,r=0,s=-1,o=0,a;for(;t--;){const i=e.codePointAt(t);if(i===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),i===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function kJe(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function TJe(e,t){let n="",r=0,s=-1,o=0,a=-1,i,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}}else if(n.length>0){n="",r=0,s=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,o=0}else i===46&&o>-1?o++:o=-1}return n}function Yg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const AJe={cwd:NJe};function NJe(){return"/"}function Ck(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function RJe(e){if(typeof e=="string")e=new URL(e);else if(!Ck(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return DJe(e)}function DJe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[h,...g]=f;const y=r[p][1];wk(y)&&wk(h)&&(h=rC(!0,y,h)),r[p]=[u,h,...g]}}}}const Ise=new kN().freeze();function iC(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lC(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cC(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function HO(e){if(!wk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function h1(e){return OJe(e)?e:new jse(e)}function OJe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LJe(e){return typeof e=="string"||FJe(e)}function FJe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BJe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",WO=[],GO={allowDangerousHtml:!0},UJe=/^(https?|ircs?|mailto|xmpp)$/i,VJe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function HJe(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",s=e.className,o=e.components,a=e.disallowedElements,i=e.rehypePlugins||WO,c=e.remarkPlugins||WO,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...GO}:GO,f=e.skipHtml,m=e.unwrapDisallowed,p=e.urlTransform||zJe,h=Ise().use(Ese).use(c).use(xJe,u).use(i),g=new jse;typeof r=="string"&&(g.value=r);for(const b of VJe)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+BJe+b.id,void 0);const y=h.parse(g);let x=h.runSync(y,g);return s&&(x={type:"element",tagName:"div",properties:{className:s},children:x.type==="root"?x.children:[x]}),ur(x,v),uQe(x,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function v(b,_,w){if(b.type==="raw"&&w&&typeof _=="number")return f?w.children.splice(_,1):w.children[_]={type:"text",value:b.value},_;if(b.type==="element"){let S;for(S in Jw)if(Object.hasOwn(Jw,S)&&Object.hasOwn(b.properties,S)){const C=b.properties[S],E=Jw[S];(E===null||E.includes(b.tagName))&&(b.properties[S]=p(String(C||""),S,b))}}if(b.type==="element"){let S=t?!t.includes(b.tagName):a?a.includes(b.tagName):!1;if(!S&&n&&typeof _=="number"&&(S=!n(b,_,w)),S&&w&&typeof _=="number")return m&&b.children?w.children.splice(_,1,...b.children):w.children.splice(_,1),_}}}function zJe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||UJe.test(e.slice(0,t))?e:""}const $O=4e3,WJe=e=>{const t=e.image_width,n=e.image_height;return!t||!n?!0:t<=$O&&n<=$O},MN=A.memo(({item:e,onClick:t,alt:n})=>{const[r,s]=d.useState(!1);d.useEffect(()=>{s(!1)},[e]);const o=d.useMemo(()=>WJe(e)&&e.image||e.thumbnail,[e]),a=d.useCallback(()=>{s(!0)},[]);if(!o||r){const i=o?"Failed to load image":"Image not available";return l.jsx(Ro,{className:z("relative w-full",{"cursor-pointer":t}),onClick:t,disabled:!t,children:l.jsx("div",{className:"bg-subtler flex h-40 w-full items-center justify-center rounded-lg md:h-48",children:l.jsxs("div",{className:"text-center",children:[l.jsx(ge,{icon:B("photo"),size:"xl",className:"mx-auto mb-2 opacity-50"}),l.jsx(V,{variant:"small",color:"light",children:i})]})})})}return l.jsx(Ro,{className:z("relative w-full",{"cursor-pointer":t}),onClick:t,disabled:!t,children:l.jsx("img",{src:o,alt:n||e.name||e.author_name||"Image",className:"h-40 w-full rounded-lg object-cover transition-opacity hover:opacity-90 md:h-48",onError:a,loading:"lazy"})})});MN.displayName="MainImage";const Pse=A.memo(({item:e,index:t,isSelected:n,onClick:r})=>{const[s,o]=d.useState(!1),a=e.thumbnail||e.image;d.useEffect(()=>{o(!1)},[e]);const i=d.useCallback(()=>{o(!0)},[]);return l.jsx(Ro,{className:z("flex-shrink-0 cursor-pointer transition-all",n?"ring-super rounded-md ring-2":"hover:opacity-75"),onClick:r,children:a&&!s?l.jsx("img",{src:a,alt:e.name||e.author_name||`Image ${t+1}`,className:"h-12 w-16 rounded-md object-cover",onError:i}):l.jsx("div",{className:"bg-subtler flex h-12 w-16 items-center justify-center rounded-md",children:l.jsx(ge,{icon:B("photo"),size:"xs",className:"opacity-50"})})})});Pse.displayName="ThumbnailImage";const Ose=A.memo(({item:e,onClick:t})=>l.jsxs("div",{children:[l.jsx("div",{className:"mb-3",children:l.jsx(MN,{item:e,onClick:t})}),l.jsx(TN,{item:e})]}));Ose.displayName="SingleImageDisplay";const Sk=A.memo(({items:e,selectedIndex:t,onImageSelect:n,onImageClick:r})=>{const s=d.useCallback(()=>{r(t)},[r,t]),o=d.useCallback(()=>{const u=t>0?t-1:e.length-1;n(u)},[t,e.length,n]),a=d.useCallback(()=>{const u=t{u.key==="ArrowLeft"?(u.preventDefault(),o()):u.key==="ArrowRight"&&(u.preventDefault(),a())},[o,a]),c=e[t];return l.jsxs("div",{onKeyDownCapture:i,tabIndex:0,children:[l.jsxs("div",{className:"relative mb-3",children:[l.jsx(MN,{item:c,onClick:s,alt:c.name||c.author_name||`Image ${t+1}`}),e.length>1&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute left-1 top-1/2 -translate-y-1/2",children:l.jsx(wt,{onClick:o,rounded:!0,icon:B("chevron-left"),size:"small","aria-label":"Previous image",variant:"tonal"})}),l.jsx("div",{className:"absolute right-1 top-1/2 -translate-y-1/2",children:l.jsx(wt,{onClick:a,rounded:!0,icon:B("chevron-right"),size:"small","aria-label":"Next image",variant:"tonal"})})]})]}),l.jsx("div",{className:"mb-3",children:l.jsx("div",{className:"flex gap-2 overflow-x-auto p-1 pb-2 [scrollbar-width:thin]",children:e.map((u,f)=>l.jsx(Pse,{item:u,index:f,isSelected:t===f,onClick:()=>n(f)},f))})}),l.jsx(TN,{item:c,index:t})]})});Sk.displayName="MultipleImagesDisplay";const TN=A.memo(({item:e,index:t})=>{const n=e.name||e.author_name||(t!==void 0?`Image ${t+1}`:"Image");return e.url?l.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[l.jsx(yt,{href:e.url,target:"_blank",rel:"noopener nofollow",className:"hover:text-super cursor-pointer transition-colors",children:l.jsx(V,{variant:"small",className:"line-clamp-3 font-medium leading-tight",children:n})}),l.jsx(yt,{href:e.url,target:"_blank",rel:"noopener nofollow",className:"hover:text-super cursor-pointer transition-colors",children:l.jsx(V,{variant:"tiny",color:"light",className:"hover:text-super line-clamp-1",children:l.jsx("span",{className:"truncate font-mono",children:Ur(e.url)})})})]}):l.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[l.jsx(V,{variant:"small",className:"line-clamp-3 font-medium leading-tight",children:n}),e.author_name&&e.author_name!==n&&l.jsxs(V,{variant:"tiny",color:"light",className:"line-clamp-1",children:[l.jsx("span",{children:"by"})," ",l.jsx("span",{className:"font-medium",children:e.author_name})]})]})});TN.displayName="ImageCaption";const Lse=A.memo(({mediaItem:e,allMediaItems:t,className:n="",trackEvent:r,overflowCount:s,openGallery:o})=>{const a=d.useMemo(()=>(t||[e]).filter(S=>S.image||S.thumbnail),[t,e]),{label:i,isTruncated:c}=d.useMemo(()=>{if(e.url){const w=ng(e.url),S=w.split("."),C=S.length>1?S.slice(-2).join("."):w,E=C.length>12;return{label:E?C.slice(0,12):C,isTruncated:E}}return{label:"image",isTruncated:!1}},[e.url]),u=d.useMemo(()=>s&&s>0?l.jsxs("span",{className:"opacity-50",children:["+",s]}):void 0,[s]),{isMobileStyle:f}=Re(),[m,p]=d.useState(0),[h,g]=d.useState(!1),y=d.useCallback(w=>{p(w)},[]),x=d.useCallback(w=>{if(f)return;a[w]&&o&&(g(!1),o(a,w))},[a,o,f]),v=d.useCallback(()=>{if(!o)return;a[0]&&(g(!1),o(a,0))},[a,o]),b=d.useCallback(()=>{f&&a.length>1||o&&o(a)},[a,o,f]),_=d.useMemo(()=>l.jsx(Ro,{className:"relative -top-px ml-0.5 inline-flex select-none items-center whitespace-nowrap align-middle",onClick:b,children:l.jsxs(K,{as:"span",variant:"subtle",className:z("text-3xs rounded-badge group inline-flex min-w-4 cursor-pointer items-center px-[0.3rem] py-[0.1875rem] align-middle font-mono tabular-nums leading-snug","[@media(hover:hover)]:hover:bg-super dark:[@media(hover:hover)]:hover:text-inverse [@media(hover:hover)]:hover:text-white"),children:[l.jsx(ge,{icon:B("photo"),size:"2xs",className:"mr-xs inline-block opacity-80"}),l.jsx("span",{className:z("relative inline-block",{"max-w-[25ch] overflow-hidden":c}),style:c?{maskImage:"linear-gradient(to right, black 70%, transparent 100%)"}:{},children:i}),!!u&&l.jsx("span",{className:"ml-xs inline-block",children:u})]})}),[i,c,u,b]);return a.length===0?null:f&&a.length===1?_:f?l.jsx(Fl,{interaction:"click",side:"bottom",align:"start",open:h,onOpenChange:g,triggerElement:_,children:l.jsx("div",{className:"bg-base w-full md:-mx-3 md:-my-2 md:w-80",children:l.jsx("div",{className:"md:p-3",children:l.jsx(Sk,{items:a,selectedIndex:m,onImageSelect:y,onImageClick:x})})})}):l.jsx(Fl,{interaction:"hover",openDelayMs:200,closeDelayMs:200,side:"bottom",align:"start",open:h,onOpenChange:g,triggerElement:_,children:l.jsx("div",{className:"bg-base w-full md:-mx-3 md:-my-2 md:w-80",children:l.jsx("div",{className:"md:p-3",children:a.length===1?l.jsx(Ose,{item:a[0],onClick:v}):l.jsx(Sk,{items:a,selectedIndex:m,onImageSelect:y,onImageClick:x})})})})});Lse.displayName="ImageCitationTooltip";const Fse=A.memo(({node:e,...t})=>l.jsx("button",{...t}));Fse.displayName="Button";const GJe={abap:"abap",actionscript:"actionscript",ada:"ada",arduino:"arduino",autoit:"autoit",bash:"bash",c:"c",clojure:"clojure",coffeescript:"coffeescript",cpp:"cpp",csharp:"csharp",css:"css",cuda:"cuda",d:"d",dart:"dart",delphi:"delphi",elixir:"elixir",erlang:"erlang",fortran:"fortran",foxpro:"foxpro",fsharp:"fsharp",go:"go",graphql:"graphql",gql:"gql",groovy:"groovy",haskell:"haskell",haxe:"haxe",html:"xml",java:"java",javascript:"javascript",json:"json",julia:"julia",jsx:"jsx",js:"js",kotlin:"kotlin",latex:"tex",lisp:"lisp",livescript:"livescript",lua:"lua",markup:"markup",mathematica:"mathematica",makefile:"makefile",matlab:"matlab",objectivec:"objectivec","objective-c":"objectivec","objective-j":"objectivec",objectpascal:"delphi",ocaml:"ocaml",octave:"matlab",perl:"perl",php:"php",powershell:"powershell",prolog:"prolog",puppet:"puppet",python:"python",qml:"qml",r:"r",racket:"lisp",restructuredtext:"rest",rest:"rest",ruby:"ruby",rust:"rust",sass:"less",less:"less",scala:"scala",scheme:"scheme",shell:"shell",smalltalk:"smalltalk",sql:"sql",standardml:"sml",sml:"sml",swift:"swift",tcl:"tcl",tex:"tex",text:"text",tsx:"tsx",ts:"ts",typescript:"typescript",vala:"vala",vbnet:"vbnet",verilog:"verilog",vhdl:"vhdl",xml:"xml",xquery:"xquery"},$Je=e=>{const{trackEvent:t}=e;return A.memo(({inline:r,className:s,children:o,node:a,...i})=>{const c=s?.replace("language-","")||"",u=d.useMemo(()=>({language:GJe?.[c]}),[c]),{$t:f}=J(),m=d.useMemo(()=>({copy:f({defaultMessage:"Copy code",id:"CNXQN5zp9z"}),wrap:f({defaultMessage:"Wrap lines",id:"k+v14s5FhJ"}),noWrap:f({defaultMessage:"No line wrap",id:"IS43cwTSaV"})}),[f]);return r?l.jsx("code",{children:o}):l.jsx(af,{className:"bg-subtler",codeBlockProps:u,trackEvent:t,translations:m,...i,children:o})})},Bse=e=>{try{if(typeof e=="string")return e.toLowerCase().replace(/ /g,"-").replace(/[^a-z0-9-]/g,"").slice(0,50).replace(/^-+|-+$/g,"")}catch{}return""},AN="mb-2 mt-4",qJe=A.memo(({node:e,level:t,...n})=>{const r=Bse(n.children);return l.jsx("h1",{className:`font-display first:mt-xs ${AN} font-semimedium text-lg leading-[1.5em] lg:text-xl`,id:r,...n})}),KJe=A.memo(({node:e,level:t,...n})=>{const r=Bse(n.children);return l.jsx("h2",{className:`${AN} font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&]:mt-4`,id:r,...n})}),YJe=A.memo(({node:e,level:t,...n})=>l.jsx("h2",{className:`${AN} font-display font-semimedium text-base first:mt-0`,...n})),Use=A.memo(e=>l.jsx("hr",{className:"bg-subtle h-px border-0",...e}));Use.displayName="Hr";const Vse=A.memo(({className:e,src:t,alt:n,node:r,...s})=>l.jsx("img",{className:e+" rounded-lg",src:t,alt:n,...s}));Vse.displayName="MarkdownImage";const NN=A.memo(({domain:e,url:t,suffix:n,overflowCount:r,hasPremiumSource:s,source:o,mcpServerSource:a,...i})=>{if(!t&&!e)return null;const c=e||ng(t).replace(/^[a-z]{1,2}\./i,""),u=n?`${c}.${n}`:c,f=s&&a?If(a):null,m=r&&r>0?l.jsxs("span",{className:"opacity-50",children:["+",r]}):void 0;return l.jsx(ca,{label:u,accessory:m,truncate:!0,containerClassName:s?"border border-super bg-super/10":void 0,iconUrl:f||void 0,...i})});NN.displayName="CitationDomainBubble";const Sb=A.memo(e=>l.jsx(ca,{...e}));Sb.displayName="CitationNumberBubble";const pf=A.memo(e=>{const{children:t,timestamp:n,timestampProps:r,includeIcon:s=!0}=e,o=J();if(!n)return null;const a=n?.endsWith("Z")?n:`${n}Z`;return l.jsxs(K,{className:"gap-x-xs flex",children:[s?l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{icon:B("bolt"),size:"xs"})}):null,l.jsxs(V,{variant:"tinyRegular",color:"light",...r,children:[t&&l.jsxs(l.Fragment,{children:[t," "]}),jee(o,a)]})]})});pf.displayName="CitationUpdatedAt";const Hse=A.memo(function({href:t,overflowCount:n,getAttachmentUrl:r,onCitationClick:s,isPatent:o,...a}){const[i,c]=d.useState(!1),[u,f]=d.useState(null),m=d.useCallback(async y=>{if(s?.(y),y?.defaultPrevented||!t||!r)return;const x=await r(t);kr(t)&&(f(x),c(!0))},[s,r,t]),p=n&&n>0?l.jsxs("span",{className:"opacity-50",children:["+",n]}):void 0,h=d.useCallback(()=>c(!1),[]),g=d.useMemo(()=>({src:u??void 0}),[u]);return o?l.jsx(ca,{accessory:p,icon:qU,className:"cursor-pointer",truncate:!0,onClick:m,...a,linkBehavior:"onClick",href:void 0}):l.jsxs(l.Fragment,{children:[l.jsx(ca,{accessory:p,icon:B("paperclip"),className:"cursor-pointer",truncate:!0,onClick:m,...a}),u&&l.jsx(pu,{isOpen:i,onClose:h,imgProps:g})]})});Hse.displayName="FileCitationBubble";const QJe=Ce(async()=>{const{GroupedCitationModal:e}=await Se(()=>q(()=>import("./GroupedCitationModal-iRDkKRir.js"),__vite__mapDeps([458,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),XJe=A.memo(({children:e,webResults:t,citationGroup:n,trackEvent:r,getAttachmentUrl:s,openMemorySearchHistoryModal:o,onCitationClick:a,forceExternalHandler:i,onYouTubeClick:c,onAttachmentClick:u,asChild:f=!1})=>{const{openModal:m}=Uo(),p=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),m(QJe,{webResults:t,citationGroup:n,trackEvent:r,getAttachmentUrl:s,openMemorySearchHistoryModal:o,onCitationClick:a,forceExternalHandler:i,onYouTubeClick:c,onAttachmentClick:u,legacyIdentifier:"__NONE__"})},[m,t,n,r,s,o,a,i,c,u]),h=f?zU:"span";return l.jsx(h,{onClick:p,children:e})});XJe.displayName="GroupedCitationBottomSheet";const ZJe={small:{container:12,icon:10},default:{container:14,icon:12}},zse=A.memo(({source:e,variant:t,isClipped:n,idSmall:r,idDefault:s,mcpServerSource:o})=>{const a=ZJe[t],i=d.useMemo(()=>n?{clipPath:`url(#${t==="small"?r:s})`}:void 0,[n,t,r,s]),c=d.useMemo(()=>({width:a.container,height:a.container,...i}),[a.container,i]),u={"-ml-[5px]":t==="default","-ml-xs":t==="small"};if(e.isAttachment){const m=VK(e.url);return l.jsx(K,{variant:"subtler",className:z("relative z-0 inline-flex shrink-0 items-center justify-center rounded-full",u),style:c,children:l.jsx(V,{variant:"small",color:"light",children:l.jsx(ge,{icon:m,size:a.icon})})})}const f=o?If(o):null;return l.jsx(Po,{domain:Ur(e.url),size:a.container,className:z("bg-subtle relative z-0 inline-flex shrink-0",u),style:i,overrideIconUrl:f||void 0})});zse.displayName="CitationItem";const Eb=A.memo(({sources:e,count:t,variant:n="default",className:r})=>{const s="clip-path-small",o="clip-path-default",a=Math.min(e.length,t),i=d.useMemo(()=>{if(e.length===0)return[];const c=[],u=new Set,f=new Set;for(const m of e){if(c.length>=a)break;if(m.isAttachment){const p=mu(m.url);p&&!f.has(p)&&(c.push(m),f.add(p))}else{const p=Ur(m.url);u.has(p)||(c.push(m),u.add(p))}}if(c.lengthl.jsx(zse,{source:c,variant:n,isClipped:u!==a-1,idSmall:s,idDefault:o,mcpServerSource:c.mcpServerSource},u))})})]})});Eb.displayName="CitationPile";const Wse=A.memo(({webResults:e,citationGroup:t,trackEvent:n,getAttachmentUrl:r,openMemorySearchHistoryModal:s,onCitationClick:o,forceExternalHandler:a,onClose:i,onYouTubeClick:c,onAttachmentClick:u,webResultCitation:f,timestampComponent:m,linkProps:p})=>{const{sortedWebResults:h,headerText:g,hasPremiumSource:y,handleCitationClick:x}=yYe({webResults:e,citationGroup:t,onCitationClick:o,openMemorySearchHistoryModal:s,onYouTubeClick:c,onAttachmentClick:u,forceExternalHandler:a,getAttachmentUrl:r,trackEvent:n,onClose:i}),[v,b]=d.useState(0),_=d.useCallback(()=>{b(I=>Math.max(0,I-1))},[]),w=d.useCallback(()=>{b(I=>Math.min(h.length-1,I+1))},[h.length]),{$t:S}=J(),C=v0,T=h[v],k=d.useMemo(()=>h.map(I=>({url:I.url,isAttachment:I.is_attachment,source:I.meta_data?.citation_domain_name,mcpServerSource:I.meta_data?.mcp_server})),[h]);return l.jsxs("div",{className:"-m-sm",children:[l.jsxs(K,{className:"flex items-center justify-between py-sm px-3 border-b",children:[l.jsxs("div",{className:"flex items-center -ml-sm gap-xs",children:[l.jsx(wt,{variant:"text",size:"tiny",onClick:_,icon:B("chevron-left"),"aria-label":S({defaultMessage:"Previous",id:"JJNc3cbYIJ"}),rounded:!0,disabled:!E}),l.jsx(V,{variant:"smallCaps",color:"light",children:`${v+1}/${h.length}`}),l.jsx(wt,{variant:"text",size:"tiny",onClick:w,icon:B("chevron-right"),"aria-label":S({defaultMessage:"Next",id:"9+DdtuCqLw"}),rounded:!0,disabled:!C})]}),l.jsxs("div",{className:"gap-sm flex col-start-1 row-start-1 duration-normal",children:[l.jsx("div",{className:"pointer-events-none",children:l.jsx(Eb,{sources:k,count:t.totalCount??k.length})}),l.jsx(V,{variant:"tinyRegular",color:"light",children:g})]}),l.jsx(aN,{webResults:h})]}),l.jsx("div",{className:z("scrollbar-subtle overflow-y-auto p-3",{"max-h-[280px]":y,"max-h-60":!y}),children:l.jsx("div",{className:"space-y-px",children:T&&l.jsx(Gse,{result:T,webResultCitation:f,timestampComponent:m,trackEvent:n,linkProps:p,onClick:x(T)},T.url)})})]})}),Gse=A.memo(({result:e,webResultCitation:t,timestampComponent:n,trackEvent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,onClick:i})=>{const c=!!(e.url&&Ji(e.url)),u=e.is_attachment||!1,f=Yl(e);return l.jsx(Vy,{className:"",href:e.url,target:"_blank",rel:"noopener nofollow",__dangerousDoNotUseOnClick:i,children:l.jsx(cN,{result:e,webResultCitation:t,timestampComponent:n,trackEvent:r,linkProps:s,onYouTubeClick:o,onAttachmentClick:a,isFile:u,downloadable:f,isYouTubeVideo:c})})});Gse.displayName="CitationResult";Wse.displayName="GroupedCitationContent";const $se=A.memo(({children:e,webResults:t,citationGroup:n,hideHoverCard:r=!1,trackEvent:s,getAttachmentUrl:o,openMemorySearchHistoryModal:a,onCitationClick:i,forceExternalHandler:c,scrollContainerRef:u})=>{const[f,m]=d.useState(!1),[p,h]=d.useState(!1),[g,y]=d.useState(null),[x,v]=d.useState(!1),[b,_]=d.useState(null),{isMobileStyle:w}=Re(),{onWheel:S}=Ore({scrollContainerRef:u,enabled:!0}),C=d.useCallback(()=>{m(!1)},[]),E=d.useCallback(D=>{y(D),h(!0),m(!1)},[]),T=d.useCallback(async D=>{if(!o)return;if(kr(D.url)){const F=await o(D.url);_(F),v(!0),m(!1)}},[o]),k=d.useCallback(()=>v(!1),[]),I=d.useMemo(()=>({src:b??void 0}),[b]),M=d.useCallback(D=>{m(r?!1:D)},[r]),N=d.useMemo(()=>l.jsx("span",{className:"inline-flex",children:e}),[e]);return l.jsxs(l.Fragment,{children:[g&&g.url&&l.jsx($g,{isOpen:p,name:g.name,setisOpen:h,url:g.url}),b&&l.jsx(pu,{isOpen:x,onClose:k,imgProps:I}),l.jsx(Fl,{interaction:"hover",open:f,onOpenChange:M,openDelayMs:200,closeDelayMs:200,side:"bottom",align:w?"center":"start",triggerElement:N,maxWidthPx:384,onWheelContent:S,children:l.jsx(Wse,{webResults:t,citationGroup:n,trackEvent:s,getAttachmentUrl:o,openMemorySearchHistoryModal:a,onCitationClick:i,forceExternalHandler:c,onClose:C,onYouTubeClick:E,onAttachmentClick:T})})]})});$se.displayName="GroupedCitationHoverCard";const qse=A.memo(({ytID:e,timestamp:t,overflowCount:n,...r})=>{const[s,o]=d.useState(!1),a=d.useCallback(()=>o(!0),[]),i=n&&n>0?l.jsxs("span",{className:"opacity-50",children:["+",n]}):void 0;return l.jsxs(l.Fragment,{children:[l.jsx(ca,{label:"youtube",accessory:i,icon:B("brand-youtube"),onClick:a,className:"cursor-pointer",...r}),e&&l.jsx($g,{url:`https://www.youtube.com/watch?v=${e}`,name:"",isOpen:s,setisOpen:o,timestamp:t})]})});qse.displayName="YoutubeCitationBubble";const Kse="_entity_chip",Ek="pplx-entity-id";function JJe(e){const t=e.match(/^pplx:\/\/entity_chip\/(?.+)$/);if(!(!t||!t.groups?.id))return t.groups.id}var ss;(function(e){e.YOUTUBE="youtube",e.FILE="file",e.MEMORY="memory",e.CONVERSATION_HISTORY="conversation_history",e.WEB="web",e.NUMBERED="numbered",e.MEETING_TRANSCRIPT="meeting_transcript"})(ss||(ss={}));function eet(e){if(e){if(e.is_memory)return B("bubble-text");if(e.is_conversation_history)return B("list-search")}}function tet(e){const{ytID:t,isMobileStyle:n,isFile:r,isMemory:s,isConversationHistory:o,enableCitationGrouping:a,isMeetingTranscript:i}=e;return t&&!n?ss.YOUTUBE:i?ss.MEETING_TRANSCRIPT:r?ss.FILE:a?s?ss.MEMORY:o?ss.CONVERSATION_HISTORY:ss.WEB:ss.NUMBERED}function net(e){const t=e.indexOf("&t=");return t!==-1?e.substring(t+3):void 0}function ret({count:e}){return!e||e<=0?null:l.jsxs("span",{className:"pl-two opacity-50",children:["+",e]})}const RN=A.memo(e=>{const{str:t,href:n,className:r,trackEvent:s,isFile:o,isMeetingTranscript:a,isDownloadable:i,citationSize:c,onCitationClick:u,getAttachmentUrl:f,isMemory:m,isConversationHistory:p,citationGroup:h,enableCitationGrouping:g,citationDomain:y,fileName:x,webResult:v,hasPremiumSource:b,ref:_,forceExternalHandler:w,...S}=e,{isMobileStyle:C}=Re(),E=hp.test(t),T=d.useCallback(()=>{const $=Gg(v);s?.("click citation",{source:"inline",citation_url:n,...$})},[n,s,v]),k=d.useMemo(()=>{const $=h?.overflowCount;return!$||$<=0?null:l.jsx(ret,{count:$})},[h?.overflowCount]);if(!E)return l.jsx("span",{children:t});const I=net(n),M=Ji(n),N=t.replace(/\[|\]|,.*$/g,""),j=!!(n&&!m&&!p&&(!(M||i)||C)),F=tet({ytID:M,isMobileStyle:C,isFile:o,isMemory:m,isConversationHistory:p,enableCitationGrouping:g,isMeetingTranscript:a}),R=g&&h&&h.citations.length>1,P=C&&R,L=!j||P?"onClick":"external";let U;switch(F){case ss.YOUTUBE:U=M&&l.jsx(qse,{...!g&&{label:N},ytID:M,overflowCount:h?.overflowCount??0,timestamp:I,size:c,forceExternalHandler:w});break;case ss.FILE:{const $=v?oz(v):void 0,G=$?If($.toLowerCase())??void 0:void 0,H=tg(v)||!!(n&&Tf(n));U=l.jsx(Hse,{label:g?x??N:N,overflowCount:h?.overflowCount??0,size:c,href:H?void 0:n,getAttachmentUrl:i?f:void 0,onCitationClick:u,forceExternalHandler:w,isPatent:H,...G?{iconUrl:G}:{}})}break;case ss.MEETING_TRANSCRIPT:U=l.jsx(ca,{label:x??N,icon:B("microphone"),accessory:k,size:c,truncate:!0,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.NUMBERED:{const $=eet(v);U=$?l.jsx(ca,{label:N,icon:$,size:c,onClick:u,href:n,linkBehavior:L,trackEvent:s,forceExternalHandler:w}):l.jsx(Sb,{label:N,size:c,onClick:u,href:n,linkBehavior:L,trackEvent:s,forceExternalHandler:w});break}case ss.MEMORY:U=l.jsx(ca,{label:v?.name.toLocaleLowerCase(),icon:B("bubble-text"),accessory:k,size:c,truncate:!0,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.CONVERSATION_HISTORY:U=l.jsx(ca,{label:"library",icon:B("list-search"),accessory:k,size:c,truncate:!1,onClick:u,linkBehavior:"onClick",forceExternalHandler:w});break;case ss.WEB:default:U=l.jsx(NN,{domain:y,url:n,overflowCount:h?.overflowCount??0,size:c,href:n,linkBehavior:L,trackEvent:s,onClick:P||w?u:T,forceExternalHandler:w,hasPremiumSource:b,source:typeof v?.meta_data?.citation_domain_name=="string"?v.meta_data.citation_domain_name:void 0,mcpServerSource:typeof v?.meta_data?.mcp_server=="string"?v.meta_data.mcp_server:void 0})}return l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"citation-nbsp"}),l.jsx("span",{className:z(r,"citation inline"),ref:_,...S,children:U}),"​"]})});RN.displayName="MdStringToLink";const set=function(t){const{ref:n,...r}=t,{anchor:s,className:o,...a}=r,i=f=>{const m=document.getElementById(f);m&&m.scrollIntoView({behavior:"smooth"})},c=s.replace(/\[|\]/g,""),u=d.useCallback(()=>i(`#search${s}`),[s]);return l.jsx(yt,{href:`#search${s}`,onClick:u,className:o,ref:n,...a,children:l.jsx(Sb,{label:c})})},Yse=Ft("MarkdownLinkContext",{}),oet=A.memo(e=>{const{className:t,href:n,title:r,children:s,target:o="_blank",node:a,ref:i,...c}=e,{hideHoverCard:u=!1,trackEvent:f,citationSize:m,onCitationClick:p,getAttachmentUrl:h,enableCitationGrouping:g=!1,webResults:y=[],EntityChipComponent:x,inlineTokenAnnotationsLookup:v,forceExternalHandler:b,scrollContainerRef:_}=d.useContext(Yse),w=g&&a?.data?a.data.citationGroup:void 0,S=d.useMemo(()=>{if(!(!w||w.citations.length<=1))return w.citations.map(Q=>y[Q-1]).filter(Q=>Q!==void 0).sort((Q,Y)=>{const te=Fi(Q),se=Fi(Y);return te&&!se?-1:!te&&se?1:0})},[w,y]),C=S?.[0]??a?.data?.webResult,E=(C?.is_attachment??!1)||tg(C),T=a?.data?.webResultCitation,k=C?.is_memory??!1,I=C?.is_conversation_history??!1,M=Uf(C),{$t:N}=J(),{isMobileStyle:D}=Re(),j=D&&!1,F=d.useCallback(Q=>{if(w&&w.citations.length>1,g&&w&&w.citations.length>0&&(C?.is_memory||C?.is_conversation_history)){const Y=w.citations[0],te=y?.[Y-1];te&&p&&p(te,Q)}else C&&p&&p(C,Q)},[C,w,g,j,p,y]),R=d.useMemo(()=>{if(!a||!v||!(Ek in a.properties))return;const Q=a.properties[Ek];if(typeof Q=="string")return v[Q]},[a,v]),P=d.useMemo(()=>C?{onClick(Q){if(f){const Y=Gg(C);f("click citation",{source:"inline hoverCard",citation_url:C.url,...Y})}F(Q)}}:void 0,[C,F,f]),L=d.useMemo(()=>({color:"light"}),[]),U=d.useCallback((Q,Y)=>()=>{f&&Y&&f("inline link clicked",{linkURL:n,linkText:A.Children.toArray(s).join(""),linkSurface:Q,isNavLink:!1})},[n,s,f]),O=d.useCallback(Q=>()=>{f&&Q&&f("inline link viewed",{linkURL:n,linkText:A.Children.toArray(s).join(""),isNavLink:!1})},[n,s,f]),$=d.useMemo(()=>({onClick:U("citation_hover_card",C)}),[U,C]),G=d.useMemo(()=>w?w.citations.some(Q=>{const Y=y[Q-1];return Fi(Y)}):!1,[w,y]);let H;switch(r){case"_citation":{if(w?.isHidden)return null;H=l.jsx(RN,{isMemory:k,isConversationHistory:I,onCitationClick:F,className:t,str:A.Children.toArray(s).join(""),href:n,rel:"nofollow noopener",trackEvent:f,isFile:E,isMeetingTranscript:M,isDownloadable:C?Yl(C):!1,citationSize:m,getAttachmentUrl:h,citationGroup:w,enableCitationGrouping:g,citationDomain:C?.meta_data?.citation_domain_name,fileName:C?.name,webResult:C,hasPremiumSource:G,ref:i,forceExternalHandler:b});break}case"_anchor_citation":{H=l.jsx(set,{anchor:A.Children.toArray(s).join(""),className:t,ref:i,...c});break}case Kse:return!R||!x?null:l.jsx(x,{annotation:R,trackEvent:f,ref:i});default:{const{"aria-label":Q,onClick:Y,...te}=c,se=(()=>{if(!(!y?.length||!n))return y.find(le=>le.url===n)})(),ae=se!==void 0,X=!!(!ae&&r),ee=l.jsx(qh,{variant:"inline",href:n,target:o,title:X?r:void 0,rel:"nofollow noopener",ref:i,bold:!0,onTrackEvent:U("answer",se),__dangerousDoNotUseOnClick:Y,...te,children:s});ae?H=l.jsx(df,{result:se,onOpened:O(se),linkProps:$,scrollContainerRef:_,children:ee}):H=ee}}if(C){if(g&&w&&w.citations.length>1){const Y=S||[];return l.jsx($se,{webResults:Y,citationGroup:w,hideHoverCard:u,trackEvent:f,getAttachmentUrl:h,onCitationClick:p,forceExternalHandler:b,scrollContainerRef:_,children:H})}return l.jsx(df,{hideHoverCard:u,linkProps:P,result:C,trackEvent:f,timestampComponent:Gv.isRecentlyTrending(C)?l.jsx(pf,{recentlyUpdatedLabel:N({defaultMessage:"Just now",description:"Label for recently updated content",id:"FlgDFQFpF1"}),timestamp:C.meta_data?.published_date,timestampProps:L,children:"Updated"}):null,webResultCitation:T,getAttachmentUrl:h,scrollContainerRef:_,children:H})}return H},JJ),Qse=A.memo(({node:e,depth:t,children:n,ordered:r,...s})=>l.jsx("ol",{className:z("marker:text-quiet list-decimal",{"pl-8":t===0}),...s,children:n}));Qse.displayName="MdOrderedList";const Xse=A.memo(({node:e,depth:t,children:n,ordered:r,...s})=>l.jsx("ul",{className:z("marker:text-quiet list-disc",{"pl-8":t===0}),...s,children:n}));Xse.displayName="MdUnorderedList";const Zse=A.memo(({className:e,children:t,ordered:n,node:r,...s})=>{const o=`py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&>p]:pt-0 [&>p]:mb-2 [&>p]:my-0 ${e||""}`.trim();return l.jsx("li",{...s,className:o,children:t})});Zse.displayName="ListItem";const Jse=A.memo(({node:e,className:t,children:n,...r})=>l.jsx("p",{className:z("my-2 [&+p]:mt-4 [&_strong:has(+br)]:inline-block [&_strong:has(+br)]:pb-2",t),...r,children:n}));Jse.displayName="Paragraph";const aet=e=>A.memo(({children:n,node:r,...s})=>l.jsx("div",{className:z("w-full",{"md:max-w-[90vw]":!e}),children:l.jsx("pre",{className:"not-prose w-full rounded font-mono text-sm font-extralight",...s,children:n})})),iet=e=>{if(!e)return{success:!1,error:{type:"INVALID_TABLE",message:"Invalid node: expected table element"}};const n=e.outerHTML.replace("{const u=[];c.querySelectorAll("th").forEach(f=>{u.push(f.textContent?.trim()||"")}),u.length>0&&s.push({cells:u,isHeader:!0}),r=u.map(f=>f.length)}),a.forEach(c=>{const u=[];c.querySelectorAll("td").forEach(f=>{u.push(f.textContent?.trim()||"")}),u.length>0&&s.push({cells:u,isHeader:!1})}),s.forEach(c=>{c.cells.forEach((u,f)=>{f>=r.length?r.push(u.length):r[f]=Math.max(r[f]??0,u.length)})}),{success:!0,data:{markdownText:uet(s,r),htmlText:n}}},cet=e=>e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|"),uet=(e,t)=>{if(e.length===0)return"";const n=[];return e.forEach((r,s)=>{const o=[];for(let a=0;a"-".repeat(i)).join(" | ")} |`;n.push(a)}}),n.join(` -`)},eoe=A.memo(function(t){const{isDisabled:n,tableRef:r,trackEvent:s}=t,{$t:o}=J(),[a,i]=d.useState(!1),{openToast:c}=hn(),u=d.useCallback(async()=>{i(!0);try{if(!r.current)throw new Error("Table element not found");const f=iet(r.current);if(!f.success){Hc.error("Failed to convert table to clipboard format:",f.error.message),c({message:o({defaultMessage:"Failed to copy table",id:"6PLluVvMhZ"}),description:o({defaultMessage:"Table format is invalid",id:"LSnhEoAVyJ"}),variant:"error",timeout:5});return}const{markdownText:m,htmlText:p}=f.data;await xze(m,p),s?.("clicked copy table",{source:"markdown"}),c({message:o({defaultMessage:"Table copied to clipboard",id:"cPHpHA3m/M"}),variant:"success",timeout:5})}catch(f){Hc.error("Failed to copy rich text:",f),c({message:o({defaultMessage:"Failed to copy table to clipboard",id:"GqiB7jDhXC"}),variant:"error",timeout:5})}finally{i(!1)}},[o,c,r,s]);return l.jsx(Te.div,{className:"flex",animate:{opacity:n?0:1},children:l.jsx(st,{disabled:n||a,icon:B("copy"),onClick:u,size:"small",clickFeedback:!0,toolTip:o({defaultMessage:"Copy table",id:"uU7t5KxHne"}),variant:"noBackground",extraCSS:"aspect-square"})})});eoe.displayName="CopyTableButton";function det({csvString:e,filename:t="perplexity.csv"}){if(typeof window>"u")throw new Error("Attempting to download a CSV file in a server context.");try{const n=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=window.URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s)}catch(n){throw n}}function toe(){return d.useCallback(e=>{det(e)},[])}class kk{static stringArrayToCSV(t){return t.map(this.escapeCSVString).join(",")}static escapeCSVString(t){return`"${t.replace(/"/g,'""')}"`}static tableToCSV(t){if(t.tagName!=="table")throw new Error("Attempting to convert node of wrong tagName to CSV from 'table'");try{const n=[];let r="";return ur(t,{tagName:"thead"},s=>{const o=[];ur(s,{tagName:"th"},a=>{const i=qO(a);o.push(i)}),n.push(this.stringArrayToCSV(o)),r+=o.join("-").replace(/[^a-z0-9\\-]/gi,"")}),ur(t,{tagName:"tbody"},s=>{ur(s,{tagName:"tr"},o=>{const a=[];ur(o,{tagName:"td"},i=>{const c=qO(i);a.push(c)}),n.push(this.stringArrayToCSV(a))})}),{csvString:n.join(` -`),filename:r}}catch(n){throw new Error(`Error attempting to convert table node to CSV string: ${n}`)}}}const qO=e=>{const t=[];let n="";ur(e,[{type:"text"},{tagName:"br"},{tagName:"a"}],s=>{if(s.type==="element"&&s.tagName==="br"){t.push(` -`);return}s.type==="element"&&s.tagName==="a"&&s.properties?.href&&(n=String(s.properties.href)),s.type==="text"&&t.push(s.value.trim())});const r=t.join("");return r?r.replace(/\s*\[\d+\]\s*/g," ").replace(/[ \t]+/g," ").trim():n},noe=A.memo(function(t){const{isFinal:n,tableNode:r,trackEvent:s}=t,o=toe(),{$t:a}=J(),i=d.useCallback(()=>{const c=kk.tableToCSV(r);o(c),s?.("clicked download table as csv",{source:"markdown"})},[o,r,s]);return l.jsx(Te.div,{className:"flex",animate:{opacity:n?1:0},children:l.jsx(st,{disabled:!n,icon:B("download"),onClick:i,size:"small",toolTip:a({defaultMessage:"Download CSV",id:"fBhctxdFka"}),variant:"noBackground",extraCSS:"aspect-square"})})});noe.displayName="DownloadTableAsCSV";const fet=e=>{const{embedded:t,isCSVDownloadEnabled:n=!1,isSaveTableAsFileEnabled:r=!1,isCopyTableToClipboardEnabled:s=!1,isFinal:o=!0,trackEvent:a}=e;return A.memo(({node:c,...u})=>{const f=A.useRef(null),m=(n||r)&&o;return l.jsxs("div",{className:"group relative",children:[l.jsx(K,{className:z("w-full overflow-x-auto",{"md:max-w-[90vw]":!t}),children:l.jsx("table",{ref:f,className:"border-subtler my-[1em] w-full table-auto border-separate border-spacing-0 border-l border-t",...u})}),m&&l.jsxs("div",{className:z("bg-base border-subtler shadow-subtle pointer-coarse:opacity-100 right-xs absolute bottom-0 flex rounded-lg border opacity-0 transition-opacity group-hover:opacity-100","[&>*:not(:first-child)]:border-subtle [&>*:not(:first-child)]:border-l"),children:[r&&e.saveTableAsFile&&l.jsx(e.saveTableAsFile,{isFinal:o,tableNode:c,trackEvent:a}),s&&l.jsx(eoe,{isDisabled:!o,tableRef:f,trackEvent:a}),n&&l.jsx(noe,{isFinal:o,tableNode:c,trackEvent:a})]})]})})},roe=A.memo(({node:e,isHeader:t,...n})=>l.jsx("td",{className:"px-sm border-subtler min-w-[48px] break-normal border-b border-r",...n}));roe.displayName="TableCell";const soe=A.memo(({node:e,...t})=>l.jsx("thead",{className:"bg-subtler",...t}));soe.displayName="TableHeader";const ooe=A.memo(({node:e,...t})=>l.jsx("th",{className:"border-subtler p-sm break-normal border-b border-r text-left align-top",...t}));ooe.displayName="TableHeaderCell";const met=/^$/,pet=()=>e=>{ur(e,"raw",(t,n,r)=>{n!=null&&met.test(t.value)&&r&&(r.children[n]={type:"element",tagName:"br",position:t.position,properties:{},children:[]})})},aoe=e=>e.type=="element"&&e.tagName=="span"&&e.properties?.className=="whitespace-nowrap"&&e.children.length==2,het=e=>aoe(e)?e.children[0]:e,get=()=>e=>{ur(e,{tagName:"a"},(t,n,r)=>{if(t.properties?.title!="_citation"||n===null)return ws;const s=n!=null?r?.children[n+1]:void 0;if(s?.type!="text"||s.value.charAt(0)!=".")return ws;t.properties.className=(t.properties.className||"")+" mr-[2px]",r&&n!=null&&(r.children[n]={type:"element",tagName:"span",properties:{className:"whitespace-nowrap"},children:[t,{type:"text",value:"."}]}),s.value=s.value.slice(1)})};function yet(e){try{const t=JSON.parse(e);return t&&typeof t=="object"&&Array.isArray(t.citations)?{success:!0,group:{category:t.category||"web",overflowCount:Number(t.overflowCount)||0,citations:t.citations,isGrouped:t.overflowCount>0,totalCount:t.citations.length,isHidden:!!t.isHidden}}:{success:!1}}catch{return{success:!1}}}const xet=(e,t)=>function(n){let r=0;ur(n,"element",s=>{const o=aoe(s)?het(s):s;if(o.tagName!=="a")return mf;const[a]=o.children;if(a&&a.type==="text"){const i=S4(a.value,e);if(i){const c=t.find(f=>f.index===r),u=o.data||{};if(o.data=u,u.webResult=i,u.webResultCitation=c,o.properties&&typeof o.properties=="object"&&o.properties?.dataCitationGroup){const f=o.properties.dataCitationGroup;if(f.startsWith("{")&&f.endsWith("}")){const m=yet(f);m.success&&(u.citationGroup=m.group)}}return r+=1,ws}}return ws})},vet=e=>t=>{if(!e?.length)return;const n=e[0],r=[];e.length===1?r.push({mediaItem:n,overflowCount:0}):e.length>1&&r.push({mediaItem:n,overflowCount:e.length-1});const s=r.map(({mediaItem:i,overflowCount:c})=>({type:"element",tagName:"span",properties:{className:["select-none","ml-1","inline","align-baseline"]},children:[{type:"text",value:(f=>f.url?ng(f.url):f.name||"img")(i)}],data:{mediaItem:i,allMediaItems:e,isImageCitation:!0,component:"ImageCitation",citationType:"image",overflowCount:c}})),a=(i=>{const c=i.children.slice().reverse().find(f=>f.type==="element"&&(f.tagName==="ul"||f.tagName==="ol"));if(c){const f=c.children.slice().reverse().find(m=>m.type==="element"&&m.tagName==="li");if(f){const m=f.children.slice().reverse().find(p=>p.type==="element"&&p.tagName==="p");return m||f}}const u=i.children.slice().reverse().find(f=>f.type==="element"&&f.tagName==="p");return u||null})(t);a?a.children.push(...s):t.children.push({type:"element",tagName:"span",properties:{className:["inline-flex","flex-wrap"]},children:s})},bet=()=>function(e){ur(e,"element",function(t,n,r){if(t.tagName!=="code")return;const s=!(r&&r.tagName==="pre");t.data||(t.data={}),t.properties||(t.properties={}),t.properties.inline=s})},_et=()=>{const e=(t,n)=>{for(let r=t;r{ur(t,{tagName:"p"},(n,r,s)=>{if(n.data??={},r!=null&&s){const o=e(r+1,s);n.data.nextIsParagraph=!!o&&o.type!=="comment"&&o.type!=="text"&&o.type!=="raw"&&o.type!=="link"&&o.type!=="break"&&o?.tagName=="p"}return ws})}},wet="pplx://action/",Cet="pplx-href",Eet=()=>e=>{ur(e,"element",t=>{if(t.tagName!=="a")return mf;const n=t?.properties?.href?.toString()??"";if(!n.startsWith(wet))return mf;const r=t;return r.tagName="button",r.properties={...r.properties,[Cet]:n,href:void 0,type:"button"},ws})},ket="pplx://entity_chip/",ioe=()=>e=>{ur(e,"element",t=>{if(t.tagName!=="a")return mf;const n=t?.properties?.href?.toString()??"";if(!n.startsWith(ket))return mf;const r=JJe(n);if(!r)return ws;const s=t,o=s.properties?.className,a=Array.isArray(o)?o:[o].filter(Boolean);return s.properties={...s.properties,className:[...a,"entity-chip"],[Ek]:r,title:Kse},ws})},Met=()=>e=>{ur(e,"text",(t,n,r)=>(t.value==="​"&&n!=null&&r?.children.splice(n,1),ws))},uC=/[\t ]*(?:\r?\n|\r)/g,Tet=()=>e=>{ur(e,"text",(t,n,r)=>{const s=[];let o=0;const a=t.position?.start.offset??0;uC.lastIndex=0;let i=uC.exec(t.value);for(;i;){const c=i.index;if(o!==c){const u={start:{line:1,column:1,offset:o+a},end:{line:1,column:1,offset:c+a}};s.push({type:"text",value:t.value.slice(o,c),position:u})}s.push({type:"break"}),o=c+i[0].length,i=uC.exec(t.value)}if(s.length>0&&r&&typeof n=="number"){if(otypeof e=="object"&&"text"in e,Net=(e,t,n,r,s,o,a)=>{let i=o||0;const c=t.map(u=>{const f=typeof u=="string"?u:u.text,m={start:{line:1,column:1,offset:i},end:{line:1,column:1,offset:i+f.length}};if(i+=f.length,e(f)){let p="#";return a&&(p=a(f)??""),{type:"link",url:p,title:s,children:[{type:"text",value:f,position:m}],...Aet(u)&&u.metadata?.citationGroup&&{data:{citationGroup:u.metadata.citationGroup,hProperties:{dataCitationGroup:JSON.stringify(u.metadata.citationGroup)}}}}}return{type:"text",value:f,position:m}});return r.children.splice(n,1,...c),n+c.length},KO=(e,t)=>({offset:(e.offset??0)+(t.offset??0),line:e.line+t.line-1,column:e.line==1?e.column+t.column-1:e.column}),loe=(e,t,n=2)=>{n<0||e.position&&(e.position.start=KO(e.position.start,t),e.position.end=KO(e.position.end,t),e.children?.forEach(r=>loe(r,t,n-1)))},Ret=(e,t)=>{const n=e[0]??"",r=parseInt(n.replace(/[[\]]/g,""),10),s=S4(n,t);return{citation:n,number:r,webResult:s,groupCategory:Det(s),startIndex:e.index,endIndex:e.index+n.length}},Det=e=>e?e.is_memory?"memory":e.is_attachment?"attachment":e.url&&Ji(e.url)?"youtube":"web":"web",jet=e=>{if(e.length===0)return[];const t=e[0],n=[];let r=[t];for(let s=1;s{if(e.length<=1)return e;const t=e.reduce((n,r)=>{const s=r.groupCategory==="conversation_history"?"web":r.groupCategory;return n.has(s)?n.get(s).members.push(r):n.set(s,{representative:r,members:[r]}),n},new Map);return e.map(n=>{const r=n.groupCategory==="conversation_history"?"web":n.groupCategory,s=t.get(r),o=n===s.representative;return{...n,groupMetadata:{isGroupRepresentative:o,groupCategory:n.groupCategory,groupSize:o?s.members.length:1,groupCitations:s.members.map(a=>a.number)}}})},Pet=(e,t)=>{const n=[];let r=0;for(const s of t){const o=!s.groupMetadata||s.groupMetadata.isGroupRepresentative;if(s.startIndex>r){const a=e.slice(r,s.startIndex);a&&n.push(a)}n.push({text:s.citation,metadata:{citationGroup:{category:s.groupCategory,overflowCount:s.groupMetadata&&o?s.groupMetadata.groupSize-1:0,citations:s.groupMetadata?s.groupMetadata.groupCitations:[s.number],isHidden:s.groupMetadata&&!o}}}),r=s.endIndex}if(r{let{web_results:t,isAnchorLink:n,enableGrouping:r=!1}=e;t=Array.isArray(t)?t:[];const s=(i,c,u,f,m)=>Net(p=>typeof p=="string"?m?.has(p)??hp.test(p):p.text?hp.test(p.text):!1,i,c,u,n?"_anchor_citation":"_citation",f,p=>{const h=typeof p=="string"?p:p.text;return S4(h,t)?.url??""}),o=(i,c)=>{if(c.length===0)return[i];const u=[];let f=0;for(const m of c)m.index>f&&u.push(i.slice(f,m.index)),u.push(m[0]),f=m.index+m[0].length;return f{ur(i,"text",(c,u,f)=>{if(!f||u==null||a.has(c))return ws;a.add(c);const m=[...c.value.matchAll(new RegExp(hp,"g"))];if(m.length===0)return ws;const p=new Set(m.map(g=>g[0]));if(f?.type==="link"&&c.value==f.url){const g=o(c.value,m);return f.url=g[0],ws}if(r){const g=m.map(v=>Ret(v,t)),y=jet(g),x=Pet(c.value,y);return s(x,u,f,c.position?.start.offset,p)}const h=o(c.value,m);return s(h,u,f,c.position?.start.offset,p)})}},Let=()=>e=>{ur(e,"list",t=>{t.spread=!0})},Fet=new RegExp('(?()`])(https?:\\/\\/[^\\s[\\]<>()"`]+)(?:\\[\\d+\\])+',"g"),Bet=/\[(https?:\/\/[^\s[\]<>()"`]+)\](?!\()/g,Uet=/\uff08(https?:\/\/[^\s[\]<>()"`\uff08\uff09]+)\uff09/g,Vet=/\*\*(https?:\/\/[^\s*<>()"`]+)\*\*/g,Het=new RegExp(C4.source+"|"+qH.source,"g"),Mk=(e,t)=>{if(typeof e!="string")return e;const n=e.replace(Uet,(r,s)=>`([${s}](${s}))`).replace(Fet,(r,s)=>`<${s}>${r.slice(s.length)}`).replace(Bet,(r,s)=>`[${s}](${s})`).replace(Vet,(r,s)=>`[**${s}**](${s})`);return t?n:n.replace(Het,"")};function zet(e,t){return function(...r){const s=e(...r);return function(o,a){try{return s(o,a)}catch(i){i.message.startsWith("KaTeX parse error")}return o}}}const coe=(function(e){if(e==null)return $et;if(typeof e=="string")return Get(e);if(typeof e=="object")return Wet(e);if(typeof e=="function")return DN(e);throw new Error("Expected function, string, or array as `test`")});function Wet(e){const t=[];let n=-1;for(;++n0&&(o.properties.rel=[...p]),h&&(o.properties.target=h),f){const y=Hm(t.contentProperties,o)||{};o.children.push({type:"element",tagName:"span",properties:Bc(y),children:Bc(f)})}}}})}}function Hm(e,t){return typeof e=="function"?e(t):e}function YO(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function ttt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ntt(e,t,n){const s=wb((n||{}).ignore||[]),o=rtt(t);let a=-1;for(;++a0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=w+1:(g!==w&&b.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(C)?b.push(...C):C&&b.push(C),g=w+_[0].length,v=!0),!p.global)break;_=p.exec(u.value)}return v?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=YO(e,"(");let o=YO(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function uoe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||tu(n)||vb(n))&&(!t||n!==47)}doe.peek=ktt;function xtt(){this.buffer()}function vtt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function btt(){this.buffer()}function _tt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function wtt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ctt(e){this.exit(e)}function Stt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ett(e){this.exit(e)}function ktt(){return"["}function doe(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const a=n.enter("footnoteReference"),i=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),i(),a(),o+=s.move("]"),o}function Mtt(){return{enter:{gfmFootnoteCallString:xtt,gfmFootnoteCall:vtt,gfmFootnoteDefinitionLabelString:btt,gfmFootnoteDefinition:_tt},exit:{gfmFootnoteCallString:wtt,gfmFootnoteCall:Ctt,gfmFootnoteDefinitionLabelString:Stt,gfmFootnoteDefinition:Ett}}}function Ttt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:doe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,a){const i=o.createTracker(a);let c=i.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return c+=i.move(o.safe(o.associationId(r),{before:c,after:"]"})),f(),c+=i.move("]:"),r.children&&r.children.length>0&&(i.shift(4),c+=i.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,i.current()),t?foe:Att))),u(),c}}function Att(e,t,n){return t===0?e:foe(e,t,n)}function foe(e,t,n){return(n?"":" ")+e}const Ntt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];moe.peek=Ptt;function Rtt(){return{canContainEols:["delete"],enter:{strikethrough:jtt},exit:{strikethrough:Itt}}}function Dtt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ntt}],handlers:{delete:moe}}}function jtt(e){this.enter({type:"delete",children:[]},e)}function Itt(e){this.exit(e)}function moe(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function Ptt(){return"~"}function Ott(e){return e.length}function Ltt(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Ott,o=[],a=[],i=[],c=[];let u=0,f=-1;for(;++fu&&(u=e[f].length);++vc[v])&&(c[v]=_)}y.push(b)}a[f]=y,i[f]=x}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=b),h[m]=b),p[m]=_}a.splice(1,0,p),i.splice(1,0,h),f=-1;const g=[];for(;++f "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Utt);return s(),a}function Utt(e,t,n){return">"+(n?"":" ")+e}function Vtt(e,t){return XO(e,t.inConstruct,!0)&&!XO(e,t.notInConstruct,!1)}function XO(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=o):o=1,s=r+t.length,r=n.indexOf(t,s);return a}function Htt(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ztt(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Wtt(e,t,n,r){const s=ztt(n),o=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(Htt(e,n)){const m=n.enter("codeIndented"),p=n.indentLines(o,Gtt);return m(),p}const i=n.createTracker(r),c=s.repeat(Math.max(poe(o,s)+1,3)),u=n.enter("codeFenced");let f=i.move(c);if(e.lang){const m=n.enter(`codeFencedLang${a}`);f+=i.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...i.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${a}`);f+=i.move(" "),f+=i.move(n.safe(e.meta,{before:f,after:` -`,encode:["`"],...i.current()})),m()}return f+=i.move(` -`),o&&(f+=i.move(o+` -`)),f+=i.move(c),u(),f}function Gtt(e,t,n){return(n?"":" ")+e}function jN(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $tt(e,t,n,r){const s=jN(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),i(),!e.url||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),i(),e.title&&(i=n.enter(`title${o}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),a(),u}function qtt(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Nh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function U2(e,t,n){const r=ff(e),s=ff(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}hoe.peek=Ktt;function hoe(e,t,n,r){const s=qtt(n),o=n.enter("emphasis"),a=n.createTracker(r),i=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:i,...a.current()}));const u=c.charCodeAt(0),f=U2(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Nh(u)+c.slice(1));const m=c.charCodeAt(c.length-1),p=U2(r.after.charCodeAt(0),m,s);p.inside&&(c=c.slice(0,-1)+Nh(m));const h=a.move(s);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},i+c+h}function Ktt(e,t,n){return n.options.emphasis||"*"}function Ytt(e,t){let n=!1;return ur(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,bk}),!!((!e.depth||e.depth<3)&&vN(e)&&(t.options.setext||n))}function Qtt(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Ytt(e,n)){const f=n.enter("headingSetext"),m=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:` -`,after:` -`});return m(),f(),p+` -`+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` -`))+1))}const a="#".repeat(s),i=n.enter("headingAtx"),c=n.enter("phrasing");o.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(u)&&(u=Nh(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),i(),u}goe.peek=Xtt;function goe(e){return e.value||""}function Xtt(){return"<"}yoe.peek=Ztt;function yoe(e,t,n,r){const s=jN(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let i=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),i(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(i=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(i=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),i(),e.title&&(i=n.enter(`title${o}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),i()),u+=c.move(")"),a(),u}function Ztt(){return"!"}xoe.peek=Jtt;function xoe(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const i=n.createTracker(r);let c=i.move("![");const u=n.safe(e.alt,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return a(),n.stack=f,o(),s==="full"||!u||u!==m?c+=i.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function Jtt(){return"!"}voe.peek=ent;function voe(e,t,n){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}_oe.peek=tnt;function _oe(e,t,n,r){const s=jN(n),o=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let i,c;if(boe(e,n)){const f=n.stack;n.stack=[],i=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),i(),n.stack=f,m}i=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${o}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),i(),u}function tnt(e,t,n){return boe(e,n)?"<":"["}woe.peek=nnt;function woe(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const i=n.createTracker(r);let c=i.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...i.current()});c+=i.move(u+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(e),{before:c,after:"]",...i.current()});return a(),n.stack=f,o(),s==="full"||!u||u!==m?c+=i.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=i.move("]"),c}function nnt(){return"["}function IN(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function rnt(e){const t=IN(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function snt(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Coe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ont(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?snt(n):IN(n);const i=e.ordered?a==="."?")":".":rnt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Coe(n)===a&&f){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const i=n.createTracker(r);i.move(o+" ".repeat(a-o.length)),i.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,i.current()),f);return c(),u;function f(m,p,h){return p?(h?"":" ".repeat(a))+m:(h?o:o+" ".repeat(a-o.length))+m}}function lnt(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),s(),a}const cnt=wb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function unt(e,t,n,r){return(e.children.some(function(a){return cnt(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function dnt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Soe.peek=fnt;function Soe(e,t,n,r){const s=dnt(n),o=n.enter("strong"),a=n.createTracker(r),i=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:i,...a.current()}));const u=c.charCodeAt(0),f=U2(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(c=Nh(u)+c.slice(1));const m=c.charCodeAt(c.length-1),p=U2(r.after.charCodeAt(0),m,s);p.inside&&(c=c.slice(0,-1)+Nh(m));const h=a.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},i+c+h}function fnt(e,t,n){return n.options.strong||"*"}function mnt(e,t,n,r){return n.safe(e.value,r)}function pnt(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function hnt(e,t,n){const r=(Coe(n)+(n.options.ruleSpaces?" ":"")).repeat(pnt(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Eoe={blockquote:Btt,break:ZO,code:Wtt,definition:$tt,emphasis:hoe,hardBreak:ZO,heading:Qtt,html:goe,image:yoe,imageReference:xoe,inlineCode:voe,link:_oe,linkReference:woe,list:ont,listItem:int,paragraph:lnt,root:unt,strong:Soe,text:mnt,thematicBreak:hnt};function gnt(){return{enter:{table:ynt,tableData:JO,tableHeader:JO,tableRow:vnt},exit:{codeText:bnt,table:xnt,tableData:pC,tableHeader:pC,tableRow:pC}}}function ynt(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function xnt(e){this.exit(e),this.data.inTable=void 0}function vnt(e){this.enter({type:"tableRow",children:[]},e)}function pC(e){this.exit(e)}function JO(e){this.enter({type:"tableCell",children:[]},e)}function bnt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_nt));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _nt(e,t){return t==="|"?t:e}function wnt(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:c,tableRow:i}};function a(h,g,y,x){return u(f(h,y,x),h.align)}function i(h,g,y,x){const v=m(h,y,x),b=u([v]);return b.slice(0,b.indexOf(` -`))}function c(h,g,y,x){const v=y.enter("tableCell"),b=y.enter("phrasing"),_=y.containerPhrasing(h,{...x,before:o,after:o});return b(),v(),_}function u(h,g){return Ltt(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function f(h,g,y){const x=h.children;let v=-1;const b=[],_=g.enter("table");for(;++v0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Unt={tokenize:Knt,partial:!0};function Vnt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gnt,continuation:{tokenize:$nt},exit:qnt}},text:{91:{name:"gfmFootnoteCall",tokenize:Wnt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Hnt,resolveTo:znt}}}}function Hnt(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return i;function i(c){if(!a||!a._balanced)return n(c);const u=pa(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function znt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},i=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...i),e}function Wnt(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return i;function i(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){if(o>999||m===93&&!a||m===null||m===91||Nn(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(pa(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Nn(m)||(a=!0),o++,e.consume(m),m===92?f:u}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}}function Gnt(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,i;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(g)}function f(g){if(a>999||g===93&&!i||g===null||g===91||Nn(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return o=pa(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Nn(g)||(i=!0),a++,e.consume(g),g===92?m:f}function m(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ut(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return t(g)}}function $nt(e,t,n){return e.check(Kg,t,e.attempt(Unt,t,n))}function qnt(e){e.exit("gfmFootnoteDefinition")}function Knt(e,t,n){const r=this;return Ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function Ynt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,i){let c=-1;for(;++c1?c(g):(a.consume(g),m++,h);if(m<2&&!n)return c(g);const x=a.exit("strikethroughSequenceTemporary"),v=ff(g);return x._open=!v||v===2&&!!y,x._close=!y||y===2&&!!v,i(g)}}}class Qnt{constructor(){this.map=[]}add(t,n,r){Xnt(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const o of s)t.push(o);s=r.pop()}this.map.length=0}}function Xnt(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const j=r.events[M][1].type;if(j==="lineEnding"||j==="linePrefix")M--;else break}const N=M>-1?r.events[M][1].type:null,D=N==="tableHead"||N==="tableRow"?C:c;return D===C&&r.parser.lazy[r.now().line]?n(I):D(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,o+=1),f(I)}function f(I){return I===null?n(I):ot(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),h):n(I):Kt(I)?Ut(e,f,"whitespace")(I):(o+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||Nn(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?p:m)}function p(I){return I===92||I===124?(e.consume(I),m):m(I)}function h(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Kt(I)?Ut(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):g(I))}function g(I){return I===45||I===58?x(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):S(I)}function y(I){return Kt(I)?Ut(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),v):I===45?(o+=1,v(I)):I===null||ot(I)?w(I):S(I)}function v(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):S(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Kt(I)?Ut(e,w,"whitespace")(I):w(I)}function w(I){return I===124?g(I):I===null||ot(I)?!a||s!==o?S(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):S(I)}function S(I){return n(I)}function C(I){return e.enter("tableRow"),E(I)}function E(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),E):I===null||ot(I)?(e.exit("tableRow"),t(I)):Kt(I)?Ut(e,E,"whitespace")(I):(e.enter("data"),T(I))}function T(I){return I===null||I===124||Nn(I)?(e.exit("data"),E(I)):(e.consume(I),I===92?k:T)}function k(I){return I===92||I===124?(e.consume(I),T):T(I)}}function trt(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],a=[0,0,0,0],i=!1,c=0,u,f,m;const p=new Qnt;for(;++nn[2]+1){const g=n[2]+1,y=n[3]-n[2]-1;e.add(g,y,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return s!==void 0&&(o.end=Object.assign({},Xu(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function tL(e,t,n,r,s){const o=[],a=Xu(t.events,n);s&&(s.end=Object.assign({},a),o.push(["exit",s,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Xu(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const nrt={name:"tasklistCheck",tokenize:srt};function rrt(){return{text:{91:nrt}}}function srt(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return Nn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):n(c)}function i(c){return ot(c)?t(c):Kt(c)?e.check({tokenize:ort},t,n)(c):n(c)}}function ort(e,t,n){return Ut(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function art(e){return fse([Rnt(),Vnt(),Ynt(e),Jnt(),rrt()])}const irt={};function lrt(e){const t=this,n=e||irt,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(art(n)),o.push(Mnt()),a.push(Tnt(n))}function crt(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:i,mathText:a,mathTextData:i}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function t(){this.buffer()}function n(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=u;const m=f.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=u,f.data.hChildren.push({type:"text",value:u})}function i(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function urt(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,a,i,c){const u=o.value||"",f=i.createTracker(c),m="$".repeat(Math.max(poe(u,"$")+1,2)),p=i.enter("mathFlow");let h=f.move(m);if(o.meta){const g=i.enter("mathFlowMeta");h+=f.move(i.safe(o.meta,{after:` -`,before:h,encode:["$"],...f.current()})),g()}return h+=f.move(` -`),u&&(h+=f.move(u+` -`)),h+=f.move(m),p(),h}function r(o,a,i){let c=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const f="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++mimport("./index-Dg6q9Si7.js"),__vite__mapDeps([459,460,461,3,4,1,8,9,6,7,10,11,12])),q(()=>import("./katex-CmGQIWW6.js").then(t=>t.a),__vite__mapDeps([460,461]))]).then(([{default:t}])=>{const n=e?[zet(t),{throwOnError:!0}]:[t,{throwOnError:!1}];return ky=n,n}),y1)}const Trt=({final:e,renderFollowUps:t,renderCitations:n,webResults:r,webResultCitations:s,imageCitations:o,inlineTokenAnnotations:a})=>{const[i,c]=d.useState(ky?{...sL,rehypeKatex:ky}:sL);return d.useEffect(()=>{ky||Mrt(e).then(f=>{c(m=>({...m,rehypeKatex:f}))})},[e]),d.useMemo(()=>[...Object.values({...i,rehypePPLXActionLinks:t?Eet:null,rehypeCitations:n?[xet,r,s??[]]:null,rehypeImageCitations:o?.length?[vet,o]:null,rehypePPLXEntityLinks:Object.keys(a??{}).length>0?ioe:null}).filter(f=>f!==null),Met],[i,t,n,r,s,o,a])};function hC(e,t){const{animateIn:n=!0,once:r=!0}=t??{},{device:{isIOS:s}}=sn(),o=!s&&n,a=d.useMemo(()=>o?c=>{const u=Zl(!0),f={...c,className:z(c.className,{"animate-in fade-in-25 duration-700":!(r&&u)})};return l.jsx(e,{...f})}:void 0,[e,r,o]);return!o||!a?e:a}const Poe="prose dark:prose-invert inline leading-relaxed break-words min-w-0 [word-break:break-word] prose-strong:font-medium [&_>*:first-child]:mt-0",Art=d.memo(Qse),Nrt=d.memo(Xse),Rrt=d.memo(soe),Drt=d.memo(roe),jrt=d.memo(ooe),Irt=d.memo(qJe),Prt=d.memo(KJe),x1=d.memo(YJe),Ort=d.memo(Use),Ooe=({str:e,final:t=!1,webResults:n,inlineTokenAnnotations:r,embedded:s=!1,wrapInParent:o=!0,animateIn:a=!1,isAnchorLink:i=!1,testId:c,trackEvent:u,renderCitations:f=!0,enableCitationGrouping:m=!1,experiments:p={},markdownComponents:h={},citationSize:g="default",renderFollowUps:y=!0,webResultCitations:x,imageCitations:v,saveTableAsFile:b,onCitationClick:_,getAttachmentUrl:w,forceExternalHandler:S,openGallery:C,scrollContainerRef:E})=>{const{Paragraph:T=Jse,ListItem:k=Zse,Button:I=Fse,EntityChip:M}=h,{hideHoverCard:N,isDownloadTableAsCSVEnabled:D,isSaveTableAsFileEnabled:j,isCopyTableToClipboardEnabled:F}=p,R=d.useMemo(()=>{let re;return ce=>(Un(re,ce,Un)||(re=ce),re)},[]),P=d.useMemo(()=>{let re;return ce=>(Un(re,ce,Un)||(re=ce),re)},[]),L=R(n),U=P(x),O=d.useMemo(()=>r?.reduce((re,ce)=>(re[ce.id]=ce,re),{}),[r]),$=d.useMemo(()=>Ioe.concat([f&&[Oet,{web_results:L,isAnchorLink:i,enableGrouping:m}],Let].filter(Boolean)),[f,L,i,m]),G=Trt({final:t,renderFollowUps:y,renderCitations:f,webResults:L,webResultCitations:U,imageCitations:v,inlineTokenAnnotations:O}),H=hC(T,{animateIn:a,once:!1}),Q=hC(k,{animateIn:a,once:!1}),Y=hC(Vse,{animateIn:a}),te=d.useMemo(()=>fet({embedded:s,isCSVDownloadEnabled:D,isSaveTableAsFileEnabled:j,isCopyTableToClipboardEnabled:F,isFinal:t,trackEvent:u,saveTableAsFile:b}),[s,D,j,F,t,u,b]),se=d.useMemo(()=>$Je({trackEvent:u}),[u]),ae=d.useMemo(()=>({hideHoverCard:N,trackEvent:u,citationSize:g,onCitationClick:_,getAttachmentUrl:w,enableCitationGrouping:m,webResults:L,inlineTokenAnnotationsLookup:O,EntityChipComponent:M,forceExternalHandler:S,scrollContainerRef:E}),[N,u,g,_,w,m,L,M,S,O,E]),X=d.useMemo(()=>({children:ce,className:ue,node:me,...we})=>me?.data?.isImageCitation&&me?.data?.component==="ImageCitation"?l.jsx(Lse,{mediaItem:me.data.mediaItem,allMediaItems:me.data.allMediaItems,overflowCount:me.data.overflowCount||0,className:Array.isArray(ue)?ue.join(" "):ue,openGallery:C}):l.jsx("span",{className:Array.isArray(ue)?ue.join(" "):ue,...we,children:ce}),[C]),ee=d.useMemo(()=>aet(s),[s]),le=d.useMemo(()=>({p:H,ol:Art,hr:Ort,ul:Nrt,li:Q,table:te,thead:Rrt,td:Drt,th:jrt,pre:ee,code:se,img:Y,a:oet,h1:Irt,h2:Prt,h3:x1,h4:x1,h5:x1,h6:x1,button:I,span:X}),[H,Q,te,se,Y,ee,I,X]);return l.jsx(Mr,{fallback:null,children:l.jsx(Yse.Provider,{value:ae,children:l.jsx(HJe,{className:o?Poe:void 0,remarkPlugins:$,rehypePlugins:G,unwrapDisallowed:!0,components:le,"data-test-id":c,children:Mk(e,f)})})})},Loe=A.memo(Ooe,({webResults:e,inlineTokenAnnotations:t,...n},{webResults:r,inlineTokenAnnotations:s,...o})=>{const a=t?.length===s?.length&&!!t?.every((i,c)=>i.progress===s?.[c]?.progress);return Un(n,o)&&Un(e,r,Un)&&a});Loe.displayName="MarkdownRenderer";const Lrt=e=>{let t=0;return r=>{const s=[];for(;e.length;){const o=e.shift();if(t+=o.length,t>=r){s.push(o.slice(0,o.length+r-t));const a=o.slice(o.length+r-t);a&&(e.unshift(a),t-=a.length);break}s.push(o)}return s}},oL=Ise().use(Ese).use(Ioe);function aL(e,t){const n=oL.runSync(oL.parse(e),e);return t&&loe(n,t),n}const Frt=/(\s+)/g,Brt=[/(\*\*)/g,/(__)/g],Urt=10;function Vrt(e,t){if(!e.children.every(o=>{const a=o.position?.start.offset,i=o.position?.end.offset;return(a||a==0)&&(i||i==0)}))return[t];const n=o=>{Brt.forEach(a=>{const c=o.join("").split(a);if((c.length-1)/2%2==1){const f=c.pop(),m=c.pop();if((f.split(Frt).length+1)/2=0;g--){const y=o[g],x=y.length-h;if(x>0){o[g]=y.slice(0,x);break}else o.pop(),h-=y.length}}}})},r=Lrt(t),s=[];return e.children.forEach((o,a)=>{r(o.position?.start.offset);const i=r(o.position?.end.offset);a==e.children.length-1&&n(i),s.push(i)}),s}const Foe=({chunks:e,webResults:t,embedded:n,rendererProps:r,testId:s,webResultCitations:o,imageCitations:a,onCitationClick:i,enableCitationGrouping:c,inlineTokenAnnotations:u})=>{const f=d.useMemo(()=>{let m,p=[],h="";return g=>{const y=g.slice(),x=p.every((b,_)=>b==y[_]),v=y.slice(p.length);if(!x||!m||!m.children.length)h=Mk(y.join(""),!0),m=aL(h);else{const b=m.children.pop(),_=h.slice(b.position?.start.offset),w=Mk(v.join(""),!0),S=_+w;h=h.slice(0,b.position?.start.offset)+S;const C=aL(S,b.position?.start);m.children.push(...C.children)}return p=y.slice(),Vrt(m,[h])}},[]);return l.jsx("div",{className:Poe,"data-test-id":s,children:f(e).map((m,p)=>l.jsx(A.Fragment,{children:l.jsx(Loe,{str:m.join(""),webResults:t,final:!1,embedded:n,wrapInParent:!1,animateIn:!0,onCitationClick:i,...r,webResultCitations:o,imageCitations:a,enableCitationGrouping:c,inlineTokenAnnotations:u})},p))})},Hrt=A.memo(Foe,({webResults:e,chunks:t,...n},{webResults:r,chunks:s,...o})=>Un(n,o)&&Un(e,r,Un)&&Un(t,s,Un));Hrt.displayName="MarkdownStreamer";const zrt=40,Wrt=40,Grt=10,$rt=e=>e.previousSibling?e.previousSibling:e.parentNode?e.parentNode.previousSibling:null,My=512,qrt=e=>{const t=e.startContainer,n=e.startOffset;if(t.nodeType!==Node.TEXT_NODE)return["",""];let r=t.textContent?.slice(0,n)||"",s=r,o=!1,a=t;for(let i=0;i<10&&(a=$rt(a),!(!a||r.length>My));i++){if(a.nodeType===Node.TEXT_NODE&&a.textContent===` -`&&(o=!0),a.nodeType===Node.TEXT_NODE)r=(a.textContent||"")+r;else if(a.nodeType===Node.ELEMENT_NODE){const c=/^\d+\.$/,u=/^\d+\.?$/;c.test(a.textContent||"")?r="."+r:u.test(a.textContent||"")||(r=a.textContent+r)}o||(s=r)}return s.length>My?r=s:r=r.slice(-My),[s,r]},Krt=e=>e.nextSibling?e.nextSibling:e.parentNode?e.parentNode.nextSibling:null,Yrt=e=>{const t=e.endContainer,n=e.endOffset;if(t.nodeType!==Node.TEXT_NODE)return"";let r=t.textContent?.slice(n)||"",s=t;for(let o=0;o<5&&(s=Krt(s),!(!s||s.nodeType===Node.TEXT_NODE&&s.textContent===` -`));o++)s.nodeType===Node.TEXT_NODE?r+=s.textContent:s.nodeType===Node.ELEMENT_NODE&&/^\d+\.$/.test(s.textContent||"")&&(r+=".");return r.slice(0,My)},Boe=A.memo(({embedded:e,isAnchorLink:t,isPending:n=!1,rendererTestId:r,response:s,streamerTestId:o,trackEvent:a,renderCitations:i=!0,experiments:c,markdownComponents:u,wrapInParent:f=!0,citationSize:m="default",webResultCitations:p,imageCitations:h,onCheckSources:g,onQuoteSelect:y,onOpenInSideDocument:x,saveTableAsFile:v,onCitationClick:b,getAttachmentUrl:_,enableCitationGrouping:w=!1,ref:S,forceExternalHandler:C,openGallery:E,scrollContainerRef:T})=>{const k=J(),I=d.useRef(null),M=d.useRef(null),[N,D]=d.useState(void 0),[j,F]=d.useState(void 0),R=k.formatMessage({defaultMessage:"Check sources",id:"AxT33TYx0b"}),P=k.formatMessage({defaultMessage:"Add to follow-up",id:"EgzsNJ7SZP"}),L=g||y||x,U=d.useCallback(()=>{if(!L)return;F(void 0);const X=window.getSelection();if(!X||!X.toString().trim()||!I.current){F(void 0);return}if(!I.current.contains(X.anchorNode)||!I.current.contains(X.focusNode)){F(void 0);return}const ee=X.getRangeAt(0),le=ee.getClientRects();if(le.length===0){F(void 0);return}const re=le[0],ue=le[le.length-1].bottom-re.top,me=ee.cloneContents();me.querySelectorAll(".select-none").forEach(Ee=>Ee.remove());const ye=me.textContent?.trim(),_e=I.current.getBoundingClientRect(),[ke,De]=qrt(ee),xe=ye||X.toString(),Ue=Yrt(ee);F({rect:re,relativeTop:re.top-_e.top,relativeLeft:re.left-_e.left,quote:{extendedBeforeContext:De,beforeContext:ke,selectedText:xe,afterContext:Ue},totalHeight:ue})},[L]),O=d.useCallback(()=>{const X=window.getSelection();(!X||!X.toString().trim())&&F(void 0)},[]);d.useEffect(()=>{if(L)return document.addEventListener("mouseup",U),document.addEventListener("selectionchange",O),()=>{document.removeEventListener("mouseup",U),document.removeEventListener("selectionchange",O)}},[U,O,L]);const $=d.useCallback(()=>{if(y&&j?.quote){const X=j?.quote.selectedText.trim();window.getSelection()?.removeAllRanges(),F(void 0),y(X),a?.("click quote reply",{selectedText:X})}},[j?.quote,y,a]),G=d.useCallback(()=>{g&&j?.quote&&(window.getSelection()?.removeAllRanges(),F(void 0),g(j?.quote),a?.("click check sources",{extendedBeforeContext:j?.quote.extendedBeforeContext,beforeContext:j?.quote.beforeContext,selectedText:j?.quote.selectedText,afterContext:j?.quote.afterContext}))},[j?.quote,g,a]);d.useEffect(()=>{j?.rect&&M.current&&D(M.current.getBoundingClientRect().width)},[j?.rect]);const H=d.useCallback(()=>{x&&j?.quote&&(x(j?.quote),F(void 0),a?.("click open in document",{extendedBeforeContext:j?.quote.extendedBeforeContext,beforeContext:j?.quote.beforeContext,selectedText:j?.quote.selectedText,afterContext:j?.quote.afterContext}))},[j?.quote,x,a]),Q=(X,ee=0,le=0)=>X?ee+le+Grt:ee-zrt,te=(()=>{if(!j?.rect||!I.current||!N)return null;const X=I.current.getBoundingClientRect(),ee=Math.min(j.relativeLeft||0,X.width-N),le=(j.relativeTop||0)({experiments:c,markdownComponents:u,citationSize:m,forceExternalHandler:C,renderCitations:i,scrollContainerRef:T}),[m,c,u,C,i,T]),ae=d.useMemo(()=>{const X=[];return y&&X.push({action:$,text:P}),g&&X.push({action:G,text:R}),x&&X.push({action:H,text:k.formatMessage({defaultMessage:"View in file",id:"owm3XhJD2c"})}),X},[y,$,P,g,G,R,x,H,k]);return l.jsxs("div",{ref:jK([I,S]),className:"relative",children:[s&&n&&s.chunks&&l.jsx(Foe,{chunks:s.chunks,webResults:s.web_results,embedded:e,testId:o,rendererProps:se,webResultCitations:p,imageCitations:h,onCitationClick:b,enableCitationGrouping:w,inlineTokenAnnotations:s.inline_token_annotations}),s&&!n&&s.answer&&l.jsx(Ooe,{str:s.answer,webResults:s.web_results,final:!0,embedded:e,isAnchorLink:t,trackEvent:a,testId:r,renderCitations:i,enableCitationGrouping:w,experiments:c,markdownComponents:u,wrapInParent:f,citationSize:m,webResultCitations:p,imageCitations:h,saveTableAsFile:v,onCitationClick:b,getAttachmentUrl:_,inlineTokenAnnotations:s.inline_token_annotations,forceExternalHandler:C,openGallery:E,scrollContainerRef:T}),ae.length>0&&j?.rect&&l.jsx("div",{ref:M,className:"absolute z-[5]",style:te||{visibility:"hidden"},children:l.jsx("div",{className:z("bg-base shadow-lg",ae.length>0?"rounded-lg":"rounded-full"),children:ae.map((X,ee)=>l.jsx(Ge,{onClick:X.action,size:"small",text:X.text,variant:"primaryGhost",extraCSS:z("border transform-none active:transform-none active:scale-100 min-w-fit whitespace-nowrap",{"rounded-l-lg dark:rounded-l-lg":ee===0,"rounded-r-none":ae.length>1&&ee!==ae.length-1,"rounded-l-none":ee>0,"rounded-r-lg dark:rounded-r-lg":ee===ae.length-1,"!border-l-0":ee>0,"!rounded-full":ae.length==1})},ee))})})]})},({response:{answer:e,web_results:t,chunks:n,inline_token_annotations:r}={},...s},{response:{answer:o,web_results:a,chunks:i,inline_token_annotations:c}={},...u})=>{const f=r?.length===c?.length&&!!r?.every((m,p)=>m.progress===c?.[p]?.progress);return Un(s,u)&&Un(e,o)&&Un(t,a,Un)&&Un(n,i,Un)&&f});Boe.displayName="MarkdownResponse";const Qrt="gap-[7px]",Xrt="w-px border-l border-subtler",Zrt={initial:({animateEntry:e})=>({opacity:0,y:e?-8:0,transition:{opacity:{duration:.15},y:{duration:e?.15:0}}}),animate:{opacity:1,y:0,transition:{opacity:{duration:.15},y:{duration:.15}}},exit:({animateExit:e})=>({opacity:0,y:e?-8:0,transition:{opacity:{duration:.12},y:{duration:e?.12:0}}})},Uoe=A.memo(({cleanTitle:e,status:t,web_results:n})=>{const r=fN(),s=d.useMemo(()=>({Paragraph:({children:a})=>a}),[]),o=d.useMemo(()=>({answer:e,web_results:n}),[e,n]);return l.jsx("span",{className:"flex grow overflow-hidden py-[6px]",children:l.jsx(V,{className:"pr-sm block [&_code]:max-h-[300px] [&_code]:overflow-auto",variant:"small",color:t==="active"?"default":"light",inline:!0,children:l.jsx(Boe,{response:o,markdownComponents:s,wrapInParent:!1,citationSize:"small",enableCitationGrouping:r})})})});Uoe.displayName="GoalTitle";const Jrt=({steps:e,status:t,trackSearchResultsStep:n,disableAnimations:r})=>{const s=d.useMemo(()=>e?yFe(e):[],[e]);return d.useMemo(()=>s?.map((o,a)=>{const i=a===(s?.length??0)-1,c=t==="finished"||!i;return l.jsx(Voe,{isFinished:c,index:a,step:o,disableAnimations:r,trackSearchResultsStep:n},`${o.uuid}-${a}`)}).filter(Boolean),[s,t,r,n])},est=A.memo(e=>{const{className:t="",title:n,status:r,steps:s,web_results:o=[],showStatus:a=!0,timelineGapClassName:i=Qrt,animateEntry:c=!0,animateExit:u=!0,placeholder:f=!1,keepNewLines:m=!1,isFinalGoal:p=!1,disableAnimations:h=!1,ref:g,...y}=e,{session:x}=Ne(),{trackEvent:v}=Xe(x),b=n.replace(/^\n+|\n+$/g,"").replace(/\n/g,m?` -`:" "),_=r==="finished"||r==="loading"?r:"planned",w=d.useCallback(I=>{v("click citation",{citation_url:I,source:"researchStep"})},[v]),S=l.jsx(Jrt,{steps:s,status:r,trackSearchResultsStep:w,disableAnimations:h}),C=!!s?.length,[E,{height:T}]=ti(),k=!u&&c&&!h;return l.jsxs(Te.div,{ref:g,className:`group/goal relative flex overflow-hidden ${t} ${i}`,role:"listitem",initial:h?!1:k?{height:0}:"initial",animate:h?!1:k?{height:T||"auto"}:"animate",exit:h?void 0:"exit",transition:h?{duration:0}:k?{duration:.1,ease:"easeOut"}:void 0,variants:h?void 0:Zrt,custom:{animateEntry:c&&!h,animateExit:u&&!h},...y,children:[l.jsx("div",{className:"flex",children:l.jsx(Qre,{status:r,state:_,showStatus:a,timelineConnectorClassName:Xrt,hasSteps:C,isFinalGoal:p})},"timeline-container"),l.jsx("div",{className:"min-w-0 grow",children:l.jsxs("div",{ref:E,className:"flex flex-col",children:[l.jsx(Uoe,{cleanTitle:b,status:r,placeholder:f,web_results:o}),C&&l.jsx("div",{className:"pb-md gap-y-sm flex w-full flex-col empty:hidden group-last/goal:pb-0",children:l.jsx(St,{children:S})})]},"content-container")})]})},(e,t)=>!["id","status","title","steps","isFinalGoal"].some(s=>!JJ(e[s],t[s]))),Voe=A.memo(({isFinished:e,index:t,step:n,disableAnimations:r,trackSearchResultsStep:s})=>{const o=n.step_type==="SEARCH_RESULTS"?s:void 0,a=d.useMemo(()=>({id:n.uuid,initial:r?!1:{opacity:0,x:-10},animate:r?!1:{opacity:1,x:0},exit:r?void 0:{opacity:0,x:10},transition:r?{duration:0}:{duration:.2,delay:t*.05,ease:Qd}}),[r,t,n.uuid]);return l.jsx(dN,{step:n,isFinished:e,onStepClick:o,motionProps:a,disableAnimations:r},`${n.uuid}-${t}`)});Voe.displayName="StepRendererFactory";const Hoe=A.memo(({visibleGoals:e,isAgentWorkflowInFlight:t,forceShowAll:n,disableAnimations:r})=>l.jsx("div",{className:"relative z-0 flex flex-col",children:l.jsxs("div",{className:"relative pl-px",children:[l.jsx(St,{mode:t&&!n?"wait":void 0,children:e.map(s=>s?l.jsx(est,{id:s.id,status:s.status,steps:s.steps,web_results:s.web_results,title:s.title,animateEntry:s.animateEntry,animateExit:!!(t&&!n),isFinalGoal:s.isFinalGoal,keepNewLines:!0,disableAnimations:s.disableAnimations||r&&s.status==="finished"},s.key):null)}),l.jsx("div",{className:"-mx-lg from-base to-base/0 absolute bottom-0 z-20 h-3 w-full bg-gradient-to-t"})]})}));Hoe.displayName="GoalsList";const tst=[],nst=({hasPendingFiles:e,attachments:t=Pe,attachment_processing_progress:n=Pe})=>{const{$t:r}=J(),s=d.useMemo(()=>e?[{description:r({defaultMessage:"Processing attachments...",id:"nCVqMMwJ07"}),final:!1,id:"pending-files-goal",steps:[{step_type:"PENDING_FILES",content:{attachments:t,attachmentProcessingProgress:n},uuid:"pending-files-step"}]}]:tst,[r,n,t,e]),o=d.useMemo(()=>!e||n.some(i=>i.file_url==="end"),[n,e]),a=d.useMemo(()=>o?null:s.length>0?s[0]:null,[o,s]);return{pendingFilesGoals:s,activePendingFileGoal:a,isFileProcessingDone:o}},rst=({researchPlan:e,reasoningPlan:t,hasAnswer:n,isProReasoningMode:r})=>{const s=t?.goals?.slice(1)??Pe,o=d.useMemo(()=>!e||n||r&&s.length>0,[e,n,r,s.length]),a=d.useMemo(()=>!t&&!r||!!t?.final,[t,r]),i=n&&a&&o,c=d.useMemo(()=>a?null:t?.goals[t.goals.length-1],[t,a]);return{reasoningGoals:s,isResearchPlanFinished:o,isReasoningPlanFinished:a,isAllPlansFinished:i,activeReasoningGoal:c}},sst=({researchPlan:e,steps:t,searchMode:n,isResearchPlanFinished:r,backendUUID:s})=>{const o=n===oe.RESEARCH,a=n===oe.STUDIO,i=ost({backendUUID:s,steps:t,isResearchPlanFinished:r}),c=ast({backendUUID:s,steps:t,isResearchPlanFinished:r}),u=d.useMemo(()=>{if(!e)return{};if(e.goals.length===1){const p=e.goals[0];return p?{[p.id]:{...p,steps:t.filter(h=>h.step_type!=="INITIAL_QUERY"&&h.step_type!=="TERMINATE")}}:{}}return e.goals.reduce((p,h)=>{const g={...h,steps:t.filter(y=>"goal_id"in y.content?y.content.goal_id===h.id&&y.step_type!=="INITIAL_QUERY"&&y.step_type!=="TERMINATE":!1)};return p[g.id]=g,p},{})},[e,t]),f=d.useMemo(()=>{const p=Object.keys(u);if(p.length===0)return null;const h=t.at(-1),g=p.at(-1);return g?((o||a)&&h?.step_type!=="TERMINATE",u[g]):null},[u,t,o,a]),m=d.useMemo(()=>[...Object.values(u),...i,...c],[u,i,c]);return d.useMemo(()=>({activeResearchGoal:f,researchGoals:m}),[f,m])},ost=({backendUUID:e,steps:t,isResearchPlanFinished:n})=>{const r=J(),{pendingClarifications:s,clearClarifications:o}=Uv(),a=d.useMemo(()=>{if(n||!e)return[];const i=new Set(t.map(f=>f.uuid)),c=new Set;return t.forEach(f=>{f.step_type==="CLARIFYING_QUESTIONS_OUTPUT"&&f.content?.clarification&&c.add(f.content.clarification)}),s.filter(f=>f.entryUUID===e&&!i.has(f.UUID)&&!c.has(f.content)).map((f,m)=>({description:f.question??r.formatMessage({defaultMessage:"I'll consider the details you added.",id:"46H8Trfeps"}),final:!1,id:`c-${m}`,steps:[{content:{goal_id:`c-${m}`,clarification:f.content,question:f.question},step_type:"CLARIFYING_QUESTIONS_OUTPUT",uuid:f.UUID}]}))},[r,s,e,n,t]);return d.useEffect(()=>{n&&s.length&&o()},[o,n,s]),a},ast=({backendUUID:e,steps:t,isResearchPlanFinished:n})=>{const r=J(),{pendingSuggestions:s,clearPendingSuggestions:o}=Uv(),a=d.useMemo(()=>{if(n||!e)return[];const i=new Set(t.map(f=>f.uuid)),c=new Set;return t.forEach(f=>{f.step_type==="IN_CONTEXT_SUGGESTIONS_OUTPUT"&&f.content?.selected_suggestion&&c.add(f.content.selected_suggestion)}),s.filter(f=>f.entryUUID===e&&!i.has(f.UUID)&&!c.has(f.suggestion)).map((f,m)=>({description:r.formatMessage({defaultMessage:"I'll refine my research based on your selection.",id:"SXOuvFDKhd"}),final:!1,id:`s-${m}`,steps:[{content:{goal_id:`s-${m}`,selected_suggestion:f.suggestion},step_type:"IN_CONTEXT_SUGGESTIONS_OUTPUT",uuid:f.UUID}]}))},[r,s,e,n,t]);return d.useEffect(()=>{n&&s.length&&o()},[o,n,s]),a},ist=({isAllPlansFinished:e,researchPlan:t,reasoningGoals:n,isStudio:r,hasPendingFiles:s,displayModel:o})=>d.useMemo(()=>o===nt.O3_PRO||o===nt.GPT5_PRO||r?!1:!(e||t||n.length>0||s),[o,r,e,t,n.length,s]),gC=e=>{const{goals:t,activeGoal:n,isPlanFinished:r,planType:s,web_results:o,skipFirstAnimation:a,$t:i}=e,c=n?t.indexOf(n):-1;return t.map((u,f)=>{const m=n?.id===u.id,p=c!==-1&&c>f||r,h=u.steps?.some(g=>g.step_type==="CLARIFYING_QUESTIONS_OUTPUT");return{...u,key:`${s}-${u.id?u.id+"-":""}${f}`,id:u.id??`${s}-${f}`,status:p?"finished":m?"loading":"planned",planType:s,animateEntry:!(f===0&&a)&&!p,web_results:o,isFinalGoal:!1,disableAnimations:h??!1,title:u?.title??u?.description??i({defaultMessage:"Thinking…",id:"P1QHV0AhYD"}),description:u?.description??null,final:!1}})},lst=()=>{const{askInputReasoningMode:e}=Vn(),{result:{backend_uuid:t,attachments:n,attachment_processing_progress:r,display_model:s},steps:o,researchPlan:a,reasoningPlan:i,hasAnswer:c,searchMode:u,isProReasoningMode:f,hasPendingFiles:m}=It(),h=rst({researchPlan:a,reasoningPlan:i,hasAnswer:c,isProReasoningMode:f??e}),g=sst({researchPlan:a,steps:o??[],searchMode:u,isResearchPlanFinished:h.isResearchPlanFinished,backendUUID:t??""}),y=nst({hasPendingFiles:m,attachments:n,attachment_processing_progress:r}),x=ist({isAllPlansFinished:h.isAllPlansFinished,researchPlan:a,reasoningGoals:h.reasoningGoals,isStudio:u===oe.STUDIO,hasPendingFiles:m,displayModel:s});return d.useMemo(()=>({...h,...g,...y,shouldShowPlaceholderGoal:x}),[h,g,x,y])},zoe={status:"finished",planType:"final",animateEntry:!1,web_results:void 0,description:null,final:!0,steps:void 0,disableAnimations:!0},cst=e=>({...zoe,key:"final-goal",id:"final-goal",title:e({defaultMessage:"Finished",id:"EQpfkSbt5q"}),isFinalGoal:!0}),ust=e=>({...zoe,key:"answer-skipped-goal",id:"answer-skipped-goal",title:e({defaultMessage:"Answer skipped",id:"0siVz43iGV"}),isFinalGoal:!1}),dst=()=>{const{$t:e}=J(),{researchPlan:t,reasoningPlan:n,isAnswerSkipped:r,isProReasoningMode:s}=It(),{reasoningGoals:o,isResearchPlanFinished:a,isReasoningPlanFinished:i,isAllPlansFinished:c,activeReasoningGoal:u,pendingFilesGoals:f,activePendingFileGoal:m,isFileProcessingDone:p,researchGoals:h,activeResearchGoal:g}=lst(),y=n?.web_results,x=d.useMemo(()=>gC({goals:f??[],activeGoal:m,isPlanFinished:p,planType:"research",web_results:void 0,skipFirstAnimation:!1,$t:e}),[f,m,p,e]),v=d.useMemo(()=>t?gC({goals:h,activeGoal:g,isPlanFinished:a,planType:"research",web_results:void 0,skipFirstAnimation:!0,$t:e}):[],[t,h,g,a,e]),b=d.useMemo(()=>s?gC({goals:o,activeGoal:u,isPlanFinished:i,planType:"reasoning",web_results:y,skipFirstAnimation:!t,$t:e}):[],[s,o,u,i,y,t,e]);return d.useMemo(()=>[...x,...v,...b,...c?[cst(e)]:[],...r?[ust(e)]:[]],[x,v,b,c,r,e])},Woe=A.memo(({isExpanded:e})=>{const{isAgentWorkflowInFlight:t,hasAnswer:n}=It(),r=dst(),s=d.useMemo(()=>{if(e)return r;if(t||n){const a=r[r.length-1];return a?[a]:[]}return[]},[r,t,n,e]);return!n||e?l.jsx(Hoe,{visibleGoals:s,isAgentWorkflowInFlight:t,forceShowAll:e,disableAnimations:e}):null});Woe.displayName="AgentWorkflowGoalProcessor";const fst=({isExpanded:e})=>{const{idx:t,result:{backend_uuid:n},inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i}=It(),c=D4(u=>u.results.find(f=>f.backend_uuid===n));return c?l.jsx(p6,{idx:t,result:c,inFlight:r,isLastResult:s,isFirstResult:o,scrollToListItem:a,submitQuery:i,children:l.jsx(Woe,{isExpanded:e})}):null},mst=Ce(async()=>{const{ProgressHeader:e}=await Se(()=>q(()=>import("./ProgressHeader-C6EaFoVg.js"),__vite__mapDeps([462,4,1,6,3,9,7,29,57,8,10,11,12])));return{default:e}}),pst=Ce(async()=>{const{StaticHeader:e}=await Se(()=>q(()=>import("./ProgressHeader-C6EaFoVg.js"),__vite__mapDeps([462,4,1,6,3,9,7,29,57,8,10,11,12])));return{default:e}}),Ty=A.memo(({defaultExpanded:e=!1,forceLoadingHeader:t=!1})=>{const{hasAnyAgentSteps:n,isAnswerSkipped:r,response:s,isPending:o,isProcessingQuery:a}=It(),[i,c]=d.useState(e),u=d.useCallback(()=>c(m=>!m),[]),f=d.useMemo(()=>{if(t)return!0;if(r)return!1;const m=!!s&&qt.hasContent({chunks:s.chunks,answer:s.answer,structured_answer_blocks:s.structured_answer_blocks});return o&&!m},[o,s,r,t]);return!n&&!a?null:l.jsxs("div",{className:"flex flex-col gap-sm",children:[f?l.jsx(mst,{}):l.jsx(pst,{isExpanded:i,onToggleExpanded:u}),l.jsx(fst,{isExpanded:i})]})});Ty.displayName="AgentWorkflowDisplay";const Goe=A.memo(({onClick:e,didSelectAnswer:t,onDismiss:n})=>{const{isMobileStyle:r}=Re(),[s,o]=d.useState(!1),{$t:a}=J(),i=d.useCallback(()=>{o(!0),n()},[n]);return r||s?null:l.jsx("div",{children:l.jsx(K,{variant:"superLight",className:"p-md gap-sm flex items-center justify-between rounded-md",children:t?l.jsxs("div",{className:"gap-sm flex w-full items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(ge,{icon:B("confetti"),size:"lg",className:"text-super"}),l.jsx(V,{color:"super",variant:"smallBold",children:a({defaultMessage:"Thank you! Your feedback helps improve answers for everyone.",id:"jfIf25t1OU"})})]}),l.jsx(st,{variant:"noHover",icon:B("x"),pill:!0,size:"small",extraCSS:"!text-super",onClick:i})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(V,{color:"super",variant:"smallBold",children:a({defaultMessage:"Help improve our product",id:"A7lIeL4dUS"})}),l.jsx(V,{color:"super",variant:"small",children:a({defaultMessage:"We made two versions of this answer. Which do you prefer?",id:"GT2t8+NleA"})})]}),l.jsx(Ge,{variant:"primary",size:"small",text:a({defaultMessage:"Compare",id:"493J7RI1tF"}),onClick:e})]})})})});Goe.displayName="AnswerComparisonBanner";const hst={about:B("user"),born:B("calendar-event"),age:B("calendar-event"),died:B("calendar-event"),parents:B("users-group"),siblings:B("users-group"),children:B("baby-carriage"),spouse:B("heart"),spouses:B("heart"),education:B("school"),educated_at:B("school"),net_worth:B("cash-banknote"),ratings:B("star"),directed_by:B("movie"),starring:B("user"),watch_on:B("player-play"),treatment:B("medicine-syrup"),symptoms:B("clipboard-heart"),specialists:B("stethoscope")};function gst(e){return e&&hst[e]||null}const yst={EXTERNAL_LINK_TYPE_UNSPECIFIED:B("external-link"),PRIMARY:B("external-link"),WIKIPEDIA:B("brand-wikipedia"),X:B("brand-x"),INSTAGRAM:B("brand-instagram"),TIKTOK:B("brand-tiktok"),YOUTUBE:B("brand-youtube"),FACEBOOK:B("brand-facebook"),MAYOCLINIC:B("building"),IMDB:B("brand-windows")};function iL(e){return yst[e]}const $oe=Ft("PanelContext",{menuItems:void 0}),sm=()=>{const e=d.useContext($oe);if(!e)throw new Error("usePanel must be used within PanelContext");return e},Fn=({children:e,menuItems:t,variant:n,className:r})=>l.jsx(Mr,{fallback:null,children:l.jsx($oe.Provider,{value:{menuItems:t},children:n==="noChrome"?l.jsx(K,{className:r,children:e}):l.jsx(dr,{shadow:!0,className:z(r,"p-md"),children:e})})}),xst=({menuItems:e,buttonClass:t,placement:n})=>{const{isMobileStyle:r}=Re();return e.length<=0?null:l.jsx(zs,{items:e,isMobileStyle:r,placement:n,children:l.jsx(st,{size:"tiny",pill:!0,icon:B("dots"),extraCSS:t})})},vst=({title:e,href:t,subtitle:n,image_url:r,links:s,children:o,entryUUID:a,data:i})=>{const{session:c}=Ne(),{trackEvent:u}=Xe(c),f=d.useCallback(m=>{u("knowledge card link clicked",{label:"social media",socialMediaType:m.type,value:m.url,entryUUID:a,type:i?.type??"",name:i?.title??"",id:i?.source_url??""})},[i?.source_url,i?.title,i?.type,a,u]);return l.jsx(K,{className:"gap-sm flex w-full justify-between",children:l.jsxs("div",{className:"gap-md flex grow items-start",children:[r?l.jsx("div",{className:"flex-none",children:l.jsx(Wo,{imageClassName:"size-[120px] object-cover object-top",rounded:"md",src:r,alt:e,includeLightBoxModal:!1})}):null,l.jsxs("div",{className:"flex h-full grow flex-col",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"gap-sm mb-two flex items-start",children:[l.jsx(V,{variant:"section-title",className:"flex-1",children:t?l.jsx(yt,{href:t,target:"_blank",className:"hover:text-super flex-1 duration-150",children:e}):e}),o]}),n&&l.jsx(V,{variant:"small",className:"mb-sm mr-sm text-pretty",children:n})]}),s&&s.length>0&&l.jsx("div",{className:"gap-sm flex flex-wrap",children:s.map(m=>l.jsx(qoe,{link:m,solo:s.length===1,handleLinkClick:f},m.type))})]})]})})},qoe=A.memo(({link:e,solo:t,handleLinkClick:n})=>{const r=d.useCallback(()=>n(e),[n,e]);return t?l.jsx(Ge,{icon:iL(e.type),text:e.title,textClassName:"font-normal ml-2xs text-quiet ",size:"tiny",href:e.url,target:"_blank",onClick:r},e.url):l.jsx(Ge,{icon:iL(e.type),size:"tiny",href:e.url,target:"_blank",onClick:r},e.type)});qoe.displayName="ButtonFactory";const bst=({name:e,title:t,value:n})=>{const r=gst(e);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-sm flex min-w-[120px]",children:[r&&l.jsx(V,{variant:"smallBold",color:"light",className:"w-5",children:l.jsx(ge,{icon:r,size:"sm"})}),l.jsx(V,{variant:"smallBold",color:"light",children:t})]}),l.jsx(V,{variant:"small",children:n})]})},_st=({children:e})=>l.jsx(K,{className:"pt-sm px-md border-t",children:e});Fn.Title=vst;Fn.Item=bst;Fn.Menu=xst;Fn.Footer=_st;const Koe=A.memo(({graphData:e})=>{const[t,n]=d.useState(!1),r=e.url,s=e.name,o=d.useCallback(()=>n(!1),[]);return l.jsxs("div",{className:"flex justify-center",children:[l.jsx("img",{src:r,alt:s,className:"max-h-[50vh] overflow-hidden rounded align-middle",onClick:()=>n(!0)}),l.jsx(Yoe,{isOpen:t,onClose:o,alt:s,src:r})]})});Koe.displayName="StaticImageGraph";const Yoe=A.memo(({isOpen:e,onClose:t,alt:n,src:r})=>{const s=d.useCallback(()=>t(!1),[t]);return l.jsxs(po,{onClose:s,isOpen:e,variant:"hide-chrome",disableAnimation:!1,children:[l.jsx("div",{className:"flex place-content-center",onClick:()=>t(!1),children:l.jsx("div",{className:"gap-xs p-md md:p-xl flex flex-col items-center justify-between",children:l.jsx("div",{className:"grow",children:l.jsx("img",{alt:n,src:r,className:"max-h-[50vh]"})})})}),l.jsx(Ge,{onClick:s,icon:B("x"),extraCSS:"!fixed top-md right-md shadow-sm",size:"small",pill:!0,ariaLabel:"Close"})]})});Yoe.displayName="ImageModal";const Qoe=A.memo(({graphData:e})=>l.jsxs(Fn,{className:"gap-md bg-subtler p-md flex flex-col rounded-md text-center",children:[l.jsx(Fn.Title,{title:e.name,subtitle:""}),l.jsx(Koe,{graphData:e})]}));Qoe.displayName="GraphPanel";const Xoe=(e,t)=>{const{$t:n}=J(),r=d.useMemo(()=>({low:n({defaultMessage:"This price is low",id:"4Q8ifhmVtL"},{span:u=>l.jsx("span",{className:"text-positive",children:u})}),fair:n({defaultMessage:"This price is fair",id:"jXTaDslyVl"},{span:u=>l.jsx("span",{className:"text-foreground/50",children:u})}),high:n({defaultMessage:"This price is high",id:"whb9bUkCNc"},{span:u=>l.jsx("span",{className:"text-negative",children:u})})}),[n]),s=e?e.flatMap(u=>{const f=(u.offers??[]).map(p=>p.price).filter(p=>p!==void 0);return f.length===0?[]:[Math.min(...f)]}):[],o=t!=null?[...s,t]:s,a=o.length>0?Math.min(...o):null,i=o.length>0?Math.max(...o):null,c=d.useMemo(()=>{if(!i||!a||!t)return null;const f=(i-a)*.33,m=a+f,p=i-f;return{low:m,high:p}},[i,a,t]);return!c||!t?{label:"",textColor:"",backgroundColor:"",high:null,low:null,fairBounds:null}:{label:tc.high?r.high:r.fair,textColor:tc.high?"text-negative":"text-foreground/50",backgroundColor:tc.high?"bg-negative":"bg-inverse",high:i,low:a,fairBounds:c}},Zoe=Ft("ScrollToWidgetContext",{selectedWidgetId:void 0,scrollToWidget:()=>{},entityRefs:{}}),Joe=()=>{const e=d.useContext(Zoe);if(!e)throw new Error("useScrollToWidget must be used within ScrollToWidgetContext");return e},eae=A.memo(({children:e,entities:t})=>{const[n,r]=d.useState({}),[s,o]=d.useState(void 0),{scrollContainerRef:a}=ka(),i=d.useRef(null);d.useEffect(()=>()=>{r({})},[]),d.useEffect(()=>{r(u=>{const f=u;let m=!1;return t?.map(p=>{const h=Vv(p);if(!h)return;if(h.object==="ShopifyWidget"){const y=h.id;if(!n[y]){m=!0;const x=d.createRef();f[y]=x}}}),m?f:u})},[t,n]);const c=u=>{i.current&&clearTimeout(i.current);const f=n[u]?.current;if(f&&a?.current){const p=f.getBoundingClientRect().top+a.current?.scrollTop-200;a?.current?.scrollTo({top:p,behavior:"smooth"})}o(u),i.current=setTimeout(()=>{o(void 0)},2e3)};return l.jsx(Zoe.Provider,{value:{selectedWidgetId:s,scrollToWidget:c,entityRefs:n},children:e})});eae.displayName="ScrollToWidgetProvider";const tae=Ft("EntityContext",{entityId:"",menuItems:void 0,variant:void 0}),Qg=()=>{const e=d.useContext(tae);if(!e)throw new Error("useEntity must be used within EntityContext");return e},wst=({children:e,id:t,menuItems:n,className:r,entityVariant:s})=>l.jsx(tae.Provider,{value:{entityId:t,menuItems:n,variant:s},children:l.jsx(dr,{variant:s==="hide-chrome"?"transparent":void 0,className:z("group/card flex flex-col",{"p-md":s!=="hide-chrome"},r),children:e})}),Cst=({className:e,...t})=>l.jsx(K,{className:z("gap-sm md:gap-md relative flex flex-col rounded-lg md:flex-row",e),...t}),Sst=({primaryButtonText:e,onPrimaryButtonClick:t,listNumber:n,className:r,children:s,...o})=>l.jsxs("div",{className:z("relative md:w-[calc(30%_-_8px)]",r),...o,children:[l.jsxs("div",{className:"gap-md flex h-full flex-col justify-between",children:[s,e&&t&&l.jsx("div",{className:"flex flex-col items-stretch md:max-w-[160px]",children:l.jsx(Ge,{text:e,variant:"primary",onClick:t,pill:!0,size:"small"})})]}),typeof n=="number"&&l.jsx(V,{variant:"smallCaps",color:"light",className:"border-subtler bg-base absolute -left-1.5 -top-1.5 flex size-5 shrink-0 items-center justify-center rounded-full border shadow-sm",children:n})]}),Est=({className:e,buttonProps:t,secondaryButtonProps:n,trailingComponent:r,children:s,...o})=>{const{menuItems:a}=Qg();return l.jsx("div",{className:z("flex min-w-0 flex-1 flex-col",e),...o,children:l.jsxs("div",{className:"gap-sm md:gap-md flex flex-1 flex-col justify-between rounded-lg",children:[l.jsx("div",{className:"gap-xs flex flex-col justify-between",children:l.jsx("div",{className:"gap-xs my-sm relative flex flex-col md:mt-0",children:s})}),(t||n)&&l.jsxs("div",{className:"gap-sm flex w-full items-center",children:[t&&l.jsx(Ge,{variant:"primary",pill:!0,size:"small",...t,extraCSS:`${t.extraCSS} w-full max-w-[160px]`}),n&&l.jsx(Ge,{variant:"border",pill:!0,size:"small",...n,extraCSS:`${n.extraCSS}`}),r,a&&a.length>0&&l.jsx("div",{className:"duration-150 group-hover/card:opacity-100 md:opacity-0",children:l.jsx(Fn.Menu,{menuItems:a,placement:"bottom-start"})})]})]})})},kst=({title:e,onTitleClick:t,className:n,variant:r})=>{const{selectedWidgetId:s}=Joe(),{entityId:o}=Qg(),{isMobileStyle:a}=Re();return l.jsx("div",{onClick:()=>t?.(),className:n,children:l.jsx(V,{variant:r??(a?"section-title":"entry-title"),className:z("line-clamp-3 !leading-tight md:text-2xl",{"duration-fast cursor-pointer hover:opacity-70":!!t}),children:l.jsx("span",{className:z("duration-normal rounded-md",{"bg-super/10":s===o}),children:e})})})},Mst=({loading:e,className:t,onClick:n,trailingText:r})=>{const{$t:s}=J();return l.jsxs(K,{className:z("group relative flex h-12 items-center",{"opacity-50":e,"cursor-pointer":!e},t),onClick:e?void 0:n,children:[!e&&l.jsx(K,{variant:"subtle",className:"inset-y-xs absolute -inset-x-3 rounded-md opacity-0 duration-150 group-hover:opacity-100"}),l.jsxs("div",{className:"relative w-full",children:[l.jsxs("div",{className:z("gap-md relative flex w-full items-center justify-between",{"opacity-0":e}),children:[l.jsx(V,{variant:"smallBold",color:"light",children:s({defaultMessage:"View More",id:"QQSdHPJWXu"})}),l.jsxs(V,{variant:"tiny",color:"light",className:"gap-sm flex items-center",children:[r,l.jsx(ge,{icon:B("chevron-right"),size:"xs"})]})]}),e&&l.jsxs("div",{className:"absolute inset-0 flex items-center justify-between",children:[l.jsx(K,{className:"h-2 w-[100px] rounded-full",variant:"subtle"}),l.jsx(ge,{icon:B("chevron-right"),className:"text-quietest",size:"sm"})]})]})]})},Tst=({title:e,className:t,children:n,trailingContent:r,defaultExpanded:s=!1})=>{const[o,a]=d.useState(!s);return l.jsxs(K,{className:t,children:[l.jsxs("div",{onClick:()=>a(!o),className:"group relative flex h-12 cursor-pointer select-none items-center justify-between",children:[l.jsx(K,{variant:"subtle",className:"inset-y-xs absolute -inset-x-3 rounded-md opacity-0 duration-150 group-hover:opacity-100"}),l.jsx(V,{variant:"smallBold",color:"light",className:"relative shrink-0 whitespace-nowrap",children:e}),l.jsxs("div",{className:"gap-md relative flex min-w-0 items-center",children:[l.jsx("div",{className:"gap-xs flex min-w-0 items-stretch",children:r}),l.jsx(ge,{icon:B("chevron-down"),className:z("text-foreground relative shrink-0 opacity-50",{"rotate-180":!o}),size:"sm"})]})]}),l.jsx(pi,{transition:{ease:tl(.16,1,.3,1),duration:.2},initial:!1,children:!o&&l.jsx(Oo,{transition:{duration:.1},exit:{y:-5,opacity:0},animate:{y:0,opacity:1},initial:{y:-5,opacity:0},children:l.jsx("div",{className:"pb-4",children:n})})})]})},l_t=wst,c_t=Cst,u_t=kst,yC=Tst,d_t=Sst,f_t=Est,m_t=Mst,kb=A.memo(({isOpen:e,children:t,placement:n,hoverOpen:r=!1,disabled:s=!1,onOpen:o,onClose:a,content:i,contentWidth:c="360px",isMobileStyle:u,boxProps:f,canOutsideClickClose:m,removeScroll:p,modalTitleContent:h,modalRenderCloseButton:g=!0,ref:y,...x})=>{const[v,b]=d.useState(!1),_=d.useMemo(()=>e!==void 0,[e]),w=d.useMemo(()=>_?e:v,[_,e,v]),S=d.useCallback(()=>{!w&&!s&&(o?.(),_||b(!0))},[s,_,o,w]),C=d.useCallback(()=>{w&&!s&&(a?.(),_||b(!1))},[s,_,a,w]);d.useImperativeHandle(y,()=>({dismiss:C}),[C]);const E=d.useMemo(()=>({width:c??void 0}),[c]),T=d.useMemo(()=>l.jsx(K,{style:E,...f,children:i}),[E,f,i]),k=d.useMemo(()=>({canOutsideClickClose:m??!0,removeScroll:p}),[m,p]);return u?l.jsxs(l.Fragment,{children:[l.jsx(po,{variant:"bottom-left-sheet",actionList:Pe,isOpen:w,onClose:C,titleContent:h,renderCloseButton:g,children:i}),l.jsx("span",{onClick:S,children:t})]}):l.jsx(Vf,{isOpen:w,hoverOpen:r,placement:n,onClose:C,onOpen:S,overlayProps:k,content:T,hasInteractiveContent:!0,...x,children:t})});kb.displayName="DropDownModal";const Ast=A.memo(({inFlight:e,chooseIfReason:t,chooseIfLeadInCopy:n,pros:r,cons:s,className:o,viewState:a="collapsed",id:i,showBuyIf:c=!0})=>{const u=!t&&e;return l.jsx(br,{active:u,className:z("relative",o),children:l.jsx(pi,{children:l.jsx(Oo,{children:l.jsxs("div",{className:"gap-sm mt-md relative flex flex-col rounded-md md:mx-0",children:[c&&l.jsx(nae,{reason:t,leadInCopy:n,loading:u}),l.jsx(ON,{pros:r??Pe,cons:s??Pe,loading:u,viewState:a,id:i})]})})})})});Ast.displayName="EntityItemGuidance";const nae=A.memo(({reason:e,leadInCopy:t,loading:n,textVariant:r="base"})=>{const{variant:s}=Qg();return!e&&!n?null:l.jsx("div",{className:"flex items-start gap-[12px] rounded-md md:items-center",children:l.jsx("div",{className:"w-full",children:n?l.jsxs("div",{className:"gap-sm pb-sm flex flex-col",children:[l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 w-full rounded-full"}),l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 rounded-full"}),l.jsx(K,{variant:s==="hide-chrome"?"subtler":"subtle",className:"h-2 w-1/2 rounded-full"})]}):l.jsxs(V,{variant:r,children:[l.jsx("span",{className:"font-medium",children:t})," ",e]})})})});nae.displayName="EntityItemChooseIf";const rae=3,sae=2,ON=A.memo(({pros:e,cons:t,loading:n,className:r,viewState:s="collapsed",id:o,scrollOnMobile:a=!0})=>!n&&e.length===0&&t.length===0?null:l.jsx("div",{className:r,children:s==="collapsed"?l.jsx(aae,{loading:n,pros:e,cons:t,id:o,scrollOnMobile:a}):l.jsx(iae,{loading:n,pros:e,cons:t})}));ON.displayName="EntityItemProsCons";const oae=A.memo(({children:e,loading:t,scrollOnMobile:n=!0})=>{const{isMobileStyle:r}=Re(),{variant:s}=Qg();return r&&n?l.jsx("div",{className:"-mx-md",children:l.jsx(nl,{orientation:"horizontal",showScrollIndicator:!1,children:l.jsx("div",{className:"flex",children:l.jsx("ul",{className:"gap-sm px-md flex shrink-0",children:e})})})}):l.jsx("ul",{className:z("flex flex-wrap",{"gap-0":s==="dense-card"&&!t,"gap-sm":s!=="dense-card"||t}),children:e})});oae.displayName="ProsConsCollapsedContainer";const aae=A.memo(({loading:e,pros:t,cons:n,id:r,scrollOnMobile:s=!0})=>l.jsx(oae,{loading:e,scrollOnMobile:s,children:l.jsx(St,{initial:!1,children:l.jsx(yg,{children:e?Array.from({length:3}).map((o,a)=>l.jsx(Ay,{asPlaceholder:!0,text:"",type:"con",label:"",id:r},a)):l.jsxs(l.Fragment,{children:[t.map(o=>l.jsx(Ay,{text:o.description,type:"pro",label:o.label,id:r},o.label+r)).slice(0,rae),n.map(o=>l.jsx(Ay,{text:o.description,type:"con",label:o.label,id:r},o.label+r)).slice(0,sae)]})})})}));aae.displayName="ProsConsCollapsed";const iae=A.memo(({loading:e,pros:t,cons:n})=>l.jsx("div",{className:"-mx-6",children:l.jsx(nl,{orientation:"horizontal",showScrollIndicator:!1,children:l.jsx("ul",{className:"gap-sm flex px-6",children:e?Array.from({length:3}).map((r,s)=>l.jsx(lae,{},s)):l.jsxs(l.Fragment,{children:[t.map(r=>l.jsx(Ak,{text:r.description,type:"pro",label:r.label},r.label)).slice(0,rae),n.map(r=>l.jsx(Ak,{text:r.description,type:"con",label:r.label},r.label)).slice(0,sae)]})})})}));iae.displayName="ProsConsExpanded";const Ay=A.memo(({text:e,label:t,type:n,asPlaceholder:r,id:s})=>{const{session:o}=Ne(),{trackEvent:a}=Xe(o),{variant:i}=Qg(),c=()=>{r||a("shopping pro con hover",{type:n,label:t})},u={initial:{opacity:0,x:-3},animate:{opacity:1,x:0}},f=d.useMemo(()=>l.jsx("div",{className:"p-sm pointer-events-none translate-y-0",children:l.jsx(V,{variant:"small",children:e})}),[e]);return l.jsx(Te.li,{variants:u,initial:"initial",animate:"animate",transition:{duration:.1,ease:Kd},className:z("group inline-flex shrink-0 cursor-default rounded-full duration-150",{"gap-xs":i!=="dense-card","gap-sm":i==="dense-card","hover:bg-subtler":!r,"border-subtlest border duration-150":!r&&i!=="dense-card","!border-transparent !bg-transparent":r}),onMouseEnter:c,children:l.jsx(kb,{hoverOpen:!0,placement:"bottom-start",contentWidth:"200px",removeScroll:!1,content:f,isMobileStyle:!1,delayTime:1,disabled:r,hasInteractiveContent:!1,childrenClassName:"inline-flex",children:l.jsxs("div",{className:z("p-xs relative inline-flex items-center pr-[10px]",{"bg-subtler dark:bg-subtle":r,"h-[26px] rounded-full":r,"gap-2xs":i==="dense-card","gap-xs":i!=="dense-card"}),children:[l.jsx("div",{className:z("size-md flex shrink-0 items-center justify-center rounded-full",{"text-super":n==="pro"},{"text-quiet":n==="con"},{"bg-transparent":r}),children:l.jsx(V,{variant:"tiny",color:n==="pro"?"super":"light",className:"inline-flex",children:l.jsx(ge,{className:r?"opacity-0":"",icon:n==="pro"?B("check"):B("x"),size:"xs"})})}),r?l.jsx(V,{variant:"tiny",className:"w-10 shrink-0",children:" "}):l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:z({"text-super":n==="pro"}),children:t})})]})})},t+s)});Ay.displayName="EntityItemProConItem";const lae=A.memo(()=>l.jsx(K,{className:"p-sm h-[136px] w-[200px] rounded-md",variant:"subtler"}));lae.displayName="ExpandedLoading";const Ak=A.memo(({text:e,label:t,type:n})=>l.jsxs(K,{className:"p-sm w-[200px] rounded-md",variant:"subtler",children:[l.jsxs("div",{className:"mb-2xs gap-xs flex items-center",children:[l.jsx(K,{variant:n==="pro"?"super":"textColor",className:z("size-md flex shrink-0 items-center justify-center rounded-full",{"opacity-50":n==="con"}),children:l.jsx(ge,{icon:n==="pro"?B("check"):B("x"),className:"text-inverse shrink-0",size:"xs"})}),l.jsx(V,{variant:"smallBold",color:n==="pro"?"super":"light",children:t})]}),l.jsx(V,{variant:"small",color:"light",children:e})]}));Ak.displayName="ProConItemExpanded";const cae=A.memo(({url:e,children:t,className:n})=>{const r=d.useCallback(s=>{s.stopPropagation()},[]);return e?l.jsx("div",{className:z("inline-flex",n),children:l.jsx(yt,{href:e,target:"_blank",className:"inline-flex min-w-0 items-center gap-0 duration-150 hover:opacity-60",onClick:r,children:t})}):t});cae.displayName="LogoWrapper";const Nst=A.memo(({merchantName:e,merchantDomain:t,itemUrl:n,className:r,textVariant:s,iconSize:o,faviconSize:a})=>l.jsx(cae,{url:n??void 0,className:r,iconSize:o,children:l.jsx(LN,{name:e,domain:t,faviconSize:a,textVariant:s})}));Nst.displayName="EntityItemMerchantInfo";const LN=A.memo(({name:e,domain:t,faviconSize:n,textVariant:r="tiny"})=>l.jsxs(V,{variant:r,color:"light",className:"gap-xs flex items-center",children:[l.jsx(Po,{className:"-translate-y-half shrink-0",domain:t,size:n}),l.jsx("span",{className:"truncate whitespace-nowrap",children:e})]}));LN.displayName="EntityMerchantLogoName";const xC=e=>{if(e.indexOf("$")===-1)return e;const t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),n=e.replace(/[$,]/g,"");return t.format(parseFloat(n))},uae=A.memo(({price:e,comparePrice:t,soldOut:n,size:r,textVariant:s})=>{const{$t:o}=J(),{isMobileStyle:a}=Re(),i=xC(n&&t?t:e);return l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:s||(a||r==="small"?"smallBold":"baseSemi"),className:n?"line-through":void 0,color:t?"default":void 0,children:i}),n?l.jsx(V,{variant:s??"small",color:"red",children:o({defaultMessage:"Sold Out",id:"MwUAGRNkR/"})}):t&&l.jsx(V,{variant:s??"small",color:"light",className:"line-through",children:xC(t)})]})});uae.displayName="EntityItemPrice";function Rst(e){return"article_info"in e}const dae=A.memo(({checked:e,toggleChecked:t,className:n="",variant:r="default",unselectedCheckboxClassName:s,...o})=>l.jsx(pT,{className:z("inline-flex cursor-pointer items-center justify-center duration-150",{"size-[24px]":r==="large","size-[18px]":r==="default","size-[14px]":r==="small"},n),checked:e,onCheckedChange:t,...o,children:l.jsx(K,{variant:e?"super":"background",noBorder:!0,className:z("border-subtle inline-flex size-full items-center justify-center rounded border",{"!border-super bg-super":e},!e&&s),children:l.jsx(hT,{children:l.jsx(St,{children:e&&l.jsx(Te.div,{initial:{opacity:0,scale:.6},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.6},transition:{type:"spring",bounce:.2,duration:.2},children:l.jsx(ge,{icon:B("check"),size:r==="small"?"xs":"sm",className:"text-inverse"})})})})})}));dae.displayName="Checkbox";const Dst=A.memo(function({variant:t,icon:n,label:r,shouldShow:s=!0}){return t==="grid"||!s?null:l.jsxs(K,{className:"gap-xs pt-sm mt-xs flex items-center border-t",children:[l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B(n)})}),l.jsx(V,{variant:"tiny",color:"super",children:r})]})}),fae=A.memo(function(t){const{$t:n}=J(),{result:r,additionalMetadata:s,variant:o}=t,a=r.url,i=r.meta_data?.generated_file_description??r.snippet,c=Uf(r),u=r.meta_data?.generated_file_title??r.name,f=r?.is_client_context,m=!!r.meta_data?.connection_type,p=typeof r.meta_data?.quoteBeforeContext=="string"?r.meta_data?.quoteBeforeContext:"",h=typeof r.meta_data?.quoteEmphasisText=="string"?r.meta_data?.quoteEmphasisText:"",g=typeof r.meta_data?.quoteAfterContext=="string"?r.meta_data?.quoteAfterContext:"",y=p.length>0||h.length>0||g.length>0,x=o!=="grid"&&i&&y,v=r.file_metadata?.file_repository_type,b=Fi(r),_=typeof r.meta_data?.citation_domain_name=="string"?r.meta_data?.citation_domain_name:void 0,w=K2e(r),S=()=>{if(m&&r.meta_data?.connection_type!==Zn.WILEY)return n2(r.meta_data?.connection_type);if(r.is_attachment){if(r?.meta_data?.patent_name)return r.meta_data.patent_name;if(!r?.meta_data?.file_uuid){const M=r?.file_metadata?.connector_type??eg(r.url),N=M?n2(M):void 0;if(N)return N}return v=="USER"?n({defaultMessage:"Local Files",id:"FBnEWaGOHR"}):v=="ORG"?n({defaultMessage:"Org Files",id:"DaFSYzpM1Q"}):v=="COLLECTION"?n({defaultMessage:"Space Files",id:"Thy4/SbBwD"}):n({defaultMessage:"Attachment",id:"eLCAEP8LHj"})}return _},C=yb(r),E=r.is_memory,T=Wg(r),k=c?{icon:"microphone",label:l.jsx(je,{defaultMessage:"Meeting Transcript",id:"AzZfMfUw31",description:"Meeting transcript label"})}:{icon:"user-search",label:l.jsx(je,{defaultMessage:"Personal Search",id:"7+aLCEyqS2",description:"title"})},I=c||T;return l.jsxs("div",{className:z("gap-xs pointer-events-none relative flex size-full max-w-full select-none flex-col min-w-0",{"px-sm pb-sm pt-sm":o==="grid"},{"p-md":o!=="grid"}),children:[l.jsxs("div",{className:"flex w-full items-center justify-between",children:[C&&!T?l.jsx(lN,{variant:"small",searchType:E?"memory":"conversation-history"}):l.jsxs("div",{className:"space-x-xs flex min-w-0",children:[s||null,l.jsx(ya,{variant:"tiny",color:"light",url:a,isAttachment:r.is_attachment,connectionType:oz(r),source:S(),mcpServerSource:r.meta_data?.mcp_server,isInlineAttachment:w,patentName:M4(r),isMeetingTranscript:c,truncate:!1})]}),l.jsxs("div",{className:"ml-auto shrink-0",children:[b&&o!=="grid"?l.jsx(Mh,{}):null,f&&o==="grid"?l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{size:"sm",icon:B("user-scan")})}):null]})]}),l.jsx(V,{variant:o==="grid"?"tiny":o==="list"?"small":"base",className:z("min-w-0",{"":o==="grid","pr-1":o==="list"}),children:E&&!T?l.jsx(V,{variant:"tiny",className:"line-clamp-2 h-8 min-w-0",children:r?.snippet}):l.jsx("span",{className:"line-clamp-1 text-left md:line-clamp-2 min-w-0 [overflow-wrap:break-word]",children:u||l.jsx("div",{children:" "})})}),!c&&u!==r.name?l.jsx(V,{variant:"small",color:"light",className:"line-clamp-1",children:r.name}):null,x&&l.jsxs(V,{variant:o==="list"?"tiny":"small",className:"mt-two border-super line-clamp-[8] border-l-4 pl-2 font-normal",children:[l.jsx("span",{children:p}),l.jsx("span",{className:"bg-super/30",children:h}),l.jsx("span",{children:g})]}),o!=="grid"&&i&&!y&&!c&&l.jsx(V,{variant:o==="list"?"tiny":"small",className:"mt-two line-clamp-1 font-normal md:line-clamp-4",children:i}),l.jsx(Dst,{variant:o,icon:k.icon,label:k.label,shouldShow:I}),b&&o==="grid"?l.jsx("div",{className:"-mt-1.5",children:l.jsx(Mh,{})}):null]})});fae.displayName="CitationDefaultCard";const mae=A.memo(function(t){const{result:n,imageURL:r,citationNumber:s,useLightBoxModal:o=!0}=t;return l.jsxs("div",{className:" w-full relative max-h-[76px]",children:[l.jsx(Wo,{includeLightBoxModal:o,alt:n.name,containerClassName:"w-full h-full p-xs",imageClassName:"object-cover object-center w-full h-full rounded-md",src:r}),s&&l.jsx(V,{className:"bottom-sm left-sm px-xs absolute z-[1] inline-flex rounded-sm bg-black/50",variant:"tiny",color:"white",children:s})]})});mae.displayName="CitationImageCard";const pae=A.memo(e=>{const{result:t,imageURL:n}=e,r=t.url,s=J(),o=d.useMemo(()=>({color:"white"}),[]),a=d.useMemo(()=>l.jsx(pf,{recentlyUpdatedLabel:s.$t({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:t.meta_data?.published_date,timestampProps:o,includeIcon:!1,children:s.$t({defaultMessage:"Updated",id:"xrk6zgu9jU"})}),[s,t.meta_data?.published_date,o]);return l.jsxs("div",{className:"p-sm gap-sm flex h-full max-h-[190px] min-w-0",children:[l.jsxs("div",{className:"gap-xs flex flex-col min-w-0",children:[l.jsxs("div",{className:"space-x-xs flex justify-between min-w-0",children:[l.jsx(ya,{variant:"tiny",color:"light",url:r,isAttachment:t.is_attachment}),Gv.isRecentlyTrending(t)?l.jsx(Io,{tooltipText:a,children:l.jsx(ut,{name:B("bolt"),className:"text-super size-3.5"})}):null]}),l.jsx("div",{children:l.jsx(V,{variant:"tiny",className:"line-clamp-2",children:t.name})})]}),n?l.jsx("div",{className:"relative -my-1 -mr-1 size-[60px] shrink-0",children:l.jsx(Wo,{includeLightBoxModal:!1,alt:t.name,containerClassName:"w-full h-full",imageClassName:"object-cover object-center w-full h-full rounded-md",src:n})}):null]})});pae.displayName="CitationTrendingCard";const hae=A.memo(({blockCount:e,size:t=Ht.large,animateLines:n=!0,divider:r,noLines:s,noHeight:o,variant:a="subtler",className:i,...c})=>{const u="h-1 bg-inverse/70 rounded-full",f=d.useMemo(()=>{const m=[];for(let p=0;p<(e??1);p++)m.push(l.jsx(K,{variant:a,className:z("animate-pulse rounded-md",{"h-8":t===Ht.small,"h-10":t===Ht.regular,"h-[72px]":t===Ht.large,"h-32":t===Ht.xl,"h-6":t===Ht.tiny,"h-full":o}),children:l.jsx("div",{className:"gap-y-sm p-md flex h-full flex-col",children:!s&&l.jsxs(l.Fragment,{children:[l.jsx(Te.div,{initial:{width:n?0:"100%"},animate:{width:"100%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"100%"},animate:{width:"100%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"80%"},animate:{width:"80%"},transition:{duration:.8,delay:.2},className:u}),l.jsx(Te.div,{initial:{width:n?0:"20%"},animate:{width:"20%"},transition:{duration:.8,delay:.2},className:u})]})})},p));return m},[n,e,t,s,o,a]);return l.jsx(K,{className:z("h-full",{"divider gap-y-sm flex flex-col":r,"absolute top-0 w-full":o},i),...c,children:f})});hae.displayName="TextBlockThrobber";const gae=A.memo(({result:e,idx:t,isSelected:n,testId:r,additionalMetadata:s,isTrendingLayout:o=!1,trackEvent:a,downloadCitation:i,getImageUrl:c,variant:u,isSidecar:f,onClick:m,useLightBoxModal:p=!0})=>{const h=e.meta_data?.file_uuid?"fileRepositoryFile":e.is_attachment?"fileAttachment":"sourceCard";d.useEffect(()=>{const j=setTimeout(()=>a?.("source card viewed",{citation_url:e.url,position:t,title:e.name,source:h}),100);return()=>clearTimeout(j)},[a,e.name,e.url,t,h]);const g=e.url,[y,x]=d.useState(()=>!e.is_memory&&A4(e.url)?e.url:null),[v,b]=d.useState(!1),_=d.useMemo(()=>g&&!f&&Ji(g),[g,f]),[w,S]=d.useState(!1),C=p3(e),E=kr(e.url),T=Uf(e),k=!_&&!E&&!T,I=o&&e.meta_data?.client==="trending",M=d.useMemo(()=>I?l.jsx(pae,{result:e,authors:e.meta_data?.authors,imageURL:e.meta_data?.images?.[0]}):E&&y?l.jsx(mae,{result:e,imageURL:y,useLightBoxModal:p}):E&&!y?l.jsx(hae,{blockCount:1,size:"large"}):l.jsx(fae,{result:e,variant:u,additionalMetadata:s,isSelected:n}),[I,E,y,e,p,u,s,n]),N=d.useCallback((j,F)=>{b(F),x(j)},[]),D=d.useRef(null);return d.useEffect(()=>{const j=new IntersectionObserver(R=>{R.forEach(P=>{P.isIntersecting&&E&&y===null&&!v&&c?.(e,N)})},{threshold:.1}),F=D.current;return F&&E&&j.observe(F),()=>{F&&E&&j.unobserve(F)}},[D,g,c,e,y,N,v,E]),l.jsxs(iN,{result:e,trackEvent:a,children:[l.jsx("div",{ref:D,onClick:j=>{const F=typeof e.meta_data?.quoteBeforeContext=="string"?e.meta_data?.quoteBeforeContext:"",R=typeof e.meta_data?.quoteEmphasisText=="string"?e.meta_data?.quoteEmphasisText:"",P=typeof e.meta_data?.quoteAfterContext=="string"?e.meta_data?.quoteAfterContext:"",L=F.length>0||R.length>0||P.length>0;if(T){j.preventDefault();return}else _&&!w?S(!0):i&&!E&&!C?(j.preventDefault(),i(e)):m?.(j);const U=Gg(e);a?.("click citation",{source:h,citation_url:g,...U}),L&&a?.("click check sources citation",{source:h,citation_url:g,quoteBeforeContext:F,quoteEmphasisText:R,quoteAfterContext:P,...U})},className:z("group relative flex w-full items-stretch",{"h-full":u==="grid","cursor-pointer":!!i||!!_||!!m}),"data-test-id":r,children:l.jsx(K,{variant:"subtler",bgHover:k||_?"subtle":void 0,className:z("flex w-full rounded-lg",{"bg-super/10 ring-super/80 hover:!bg-super/10 dark:bg-super/20 dark:ring-super/80 dark:hover:!bg-super/20 ring-1":n}),children:M},e.name)}),_&&g&&e.name&&l.jsx($g,{isOpen:w,name:e.name,url:g,setisOpen:S})]})});gae.displayName="CitationCard";const yae=A.memo(({onSelect:e,isSelected:t,result:n,idx:r})=>{const s="manage-citation-row",o=f=>{e?.(f)},{session:a}=Ne(),{trackEvent:i}=Xe(a),{mutate:c}=Wv({reason:s}),u=f=>{c({file_url:f.url,tab_id:f.tab_id})};return l.jsxs("div",{className:"gap-sm flex w-full flex-row-reverse",children:[l.jsx("div",{className:"w-full min-w-0",children:l.jsx(gae,{result:n,idx:r,isSelected:t,variant:"modal",trackEvent:i,downloadCitation:Yl(n)?u:void 0})}),e&&l.jsx("div",{className:"mt-[6px] shrink-0",children:l.jsx(dae,{checked:t,toggleChecked:o.bind(null,n.url)})})]})});yae.displayName="ManageCitationRow";const Mb=A.memo(({webResults:e,citationType:t="sources",onClose:n,entry:r})=>{const{$t:s}=J(),{isMobileStyle:o}=Re(),a=e?.length??0,i=d.useMemo(()=>{if(!r)return;if(Rst(r)&&r.article_info?.title)return r.article_info.title;const u=r.query_str??"";return u?qx(u).actualQuery??void 0:void 0},[r]),c=d.useMemo(()=>{const u={sources:{empty:s({defaultMessage:"No sources",id:"tN3HZvczgp"}),count:s({defaultMessage:"{sources, plural, one {# source} other {# sources}}",id:"oWRBjE1HK2"},{sources:a})},articles:{empty:s({defaultMessage:"No articles",id:"cHDJyKJPPQ"}),count:s({defaultMessage:"{count, plural, one {# article} other {# articles}}",id:"FxjYiplq18"},{count:a})}};return a===0?u[t].empty:u[t].count},[a,t,s]);return l.jsx(po,{title:c,subtitle:i??void 0,isOpen:!0,variant:o?"bottom-left-sheet":"side-sheet",onClose:n,icon:yM,children:l.jsx(K,{className:"gap-md flex h-full flex-col items-start",children:e?.map((u,f)=>l.jsx(yae,{isSelected:!1,idx:f,result:u},u.url))})})});Mb.displayName="CitationListModal";const FN=Object.freeze(Object.defineProperty({__proto__:null,CitationListModal:Mb},Symbol.toStringTag,{value:"Module"})),Nk=A.memo(({webResults:e,className:t,isLoading:n})=>{const[r,s]=d.useState(!1),{isMobileStyle:o}=Re(),a=o?2:3,i=2,c=d.useMemo(()=>e.reduce((h,g)=>h.some(x=>!x.url||!g.url?!1:Ur(x.url)===Ur(g.url))?h:g.url?h.concat({url:g.url,isAttachment:g.is_attachment}):h,[]),[e]),u=d.useMemo(()=>c.slice(0,a),[c,a]),f=d.useMemo(()=>c.reduce((h,g,y)=>y0?", ":"")+Ur(g.url).replace(/\.[^.]*$/,""):y>=i&&y===c.length-1?h+`, +${c.length-i}`:h,""),[c]),m=d.useCallback(()=>{s(!0)},[]),p=d.useCallback(()=>{s(!1)},[]);return n||u.length===0?null:l.jsxs(l.Fragment,{children:[l.jsx(Io,{tooltipText:"Review summary sources",asChild:!0,tooltipLayout:"top",children:l.jsxs("div",{onClick:m,className:z("gap-sm hover:bg-subtle flex cursor-pointer flex-row-reverse items-center overflow-hidden",t),children:[l.jsx(V,{variant:"smallCaps",color:"light",className:"truncate",children:f}),l.jsx("div",{className:"min-w-0 shrink",children:l.jsx(Eb,{count:a,sources:u})})]})}),r&&l.jsx(Mb,{onClose:p,webResults:e,legacyIdentifier:"citationListModal"})]})});Nk.displayName="EntityItemSourcePile";const Rk={summary:"",review_quality_score:0,pros_detailed:[],cons_detailed:[],pros:[],cons:[],key_features:[],buy_if:"",review_search_results:[]},jst=(e,t,n,r)=>{if(e.backend_uuid!==t)return e;const s=e.blocks||[],o=[...s];let a=!1;const i=(p,h=Rk)=>p.url===n?{...p,review_summary:{...h,...r}}:p,c=s.findIndex(p=>p.shopping_mode_block);if(c>=0){const p=s[c],h=p?.shopping_mode_block;if(h){const g=h.shopping_widgets.map(y=>i(y,y.review_summary));o[c]={...p,shopping_mode_block:{...h,shopping_widgets:g}},a=!0}}const u=s.findIndex(p=>p.inline_entity_block?.shopping_preview_block);if(u>=0){const p=s[u],h=p?.inline_entity_block?.shopping_preview_block;if(h&&h.shopping_widgets){const g=h.shopping_widgets.map(y=>i(y,y.review_summary));o[u]={...p,inline_entity_block:{...p.inline_entity_block,shopping_preview_block:{...h,shopping_widgets:g}}},a=!0}}const f=s.findIndex(p=>p.entity_list_block?.entities.some(h=>h.shopping_block));if(f>=0){const p=s[f],h=p?.entity_list_block;if(h){const g={...h,entities:h.entities.map(y=>y.shopping_block&&y.shopping_block.url===n?{...y,shopping_block:i(y.shopping_block,y.shopping_block.review_summary)}:y)};o[f]={...p,entity_list_block:g},a=!0}}const m=s.reduce((p,h,g)=>(h.entity_group_block?.entities.some(y=>y.shopping_block&&y.shopping_block.url===n)&&p.push(g),p),[]);for(const p of m){const h=s[p],g=h?.entity_group_block;if(g){const y=g.entities.map(x=>x.shopping_block&&x.shopping_block.url===n?{...x,shopping_block:i(x.shopping_block,x.shopping_block.review_summary)}:x);o[p]={...h,entity_group_block:{...g,entities:y}},a=!0}}return a?{...e,blocks:o}:e},vC=e=>["shoppingReviewSummary",e],Ist=({shouldMutateStore:e=!0,reason:t})=>{const n=bz(),r=Yt(),{mutateAsync:s,isPending:o,error:a,data:i}=Rt({mutationFn:async c=>{const u=r.getQueryData(vC(c.url));if(u)return u;let f=Rk,m="PENDING",p="";try{await de.SSE("/rest/sse/shopping_review_summary",t,{params:c,handlers:{message:g=>{m=g.status??m,p=g.id??p,g.blocks?.[0]?.shopping_block&&(f=g.blocks?.[0]?.shopping_block),r.setQueryData(vC(c.url),y=>y?{...y,status:m,id:p,review_summary:{...y.review_summary||Rk,...f}}:{review_summary:f,status:m,id:p}),e&&n(c.entry_uuid,y=>jst(y,c.entry_uuid,p,f))}}})}catch{}const h={review_summary:f,status:m,id:p};return r.setQueryData(vC(c.url),h),h}});return d.useMemo(()=>({generateShoppingReviewSummary:s,reviewSummary:i?.review_summary,isPending:o,error:a}),[i?.review_summary,a,s,o])},Pst=({block:e})=>{const{product_name:t="",product_price:n,product_brand:r="",product_url:s="",compare_at_price:o,products:a}=e,{result:{backend_uuid:i}}=It(),{$t:c}=J(),{label:u}=Xoe(a,n),{reviewSummary:f,generateShoppingReviewSummary:m,isPending:p}=Ist({reason:"price-comparison-inline-card"});d.useEffect(()=>{!t||!s||m({product_name:t,merchant_name:r,url:s,price:n?.toString()??"",description:"",entry_uuid:i??""})},[t,r,s,i,m,n]);const h=d.useMemo(()=>a?[...a].sort((y,x)=>(y.offers?.[0]?.price??0)-(x.offers?.[0]?.price??0)):void 0,[a]),g=d.useMemo(()=>h?.map(y=>({name:y.title??"",url:y.offers?.[0]?.url??"",snippet:"",timestamp:"",meta_data:void 0,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_focused_web:!1,is_client_context:!1,is_widget:!1,sitelinks:[],inline_entity_id:""}))??Pe,[h]);return l.jsx("div",{className:"gap-md flex flex-col",children:l.jsxs(dr,{className:"divide-y",children:[l.jsx("div",{className:"gap-md flex items-center p-[12px]",children:l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(V,{variant:"baseSemi",className:"line-clamp-2 leading-tight",children:t}),l.jsx(BN,{brand:r,url:s,price:n,compareAtPrice:o})]})}),n&&u?l.jsx("div",{className:"px-md",children:l.jsx(yC,{title:u,children:l.jsx(Ost,{price:n,products:a})})}):null,h&&h.length>0?l.jsx("div",{className:"px-md",children:l.jsx(yC,{title:c({defaultMessage:"See similar products",id:"RZk98Mstcl"}),trailingContent:l.jsx(Nk,{webResults:g}),children:l.jsx(Lst,{sortedProductsByPrice:h})})}):null,f?l.jsx("div",{className:"px-md",children:l.jsx(yC,{title:c({defaultMessage:"Reviews",id:"dUxyza4PYQ"}),trailingContent:l.jsx(Nk,{webResults:f.review_search_results}),children:l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(V,{variant:"small",children:f.summary}),l.jsx(ON,{pros:f.pros_detailed,cons:f.cons_detailed,loading:p,id:s,scrollOnMobile:!1})]})})}):null]})})},BN=d.memo(({brand:e,url:t,price:n,compareAtPrice:r})=>{const s=e!==""?e:ng(t),o=n?n.toLocaleString("en-US",{style:"currency",currency:"USD"}):null,a=r?r.toLocaleString("en-US",{style:"currency",currency:"USD"}):null;return l.jsxs(ga,{children:[l.jsx(Bn,{id:"merchant",children:l.jsx("div",{className:"gap-sm flex items-center",children:l.jsx(LN,{name:s,domain:t})})}),o?l.jsx(Bn,{id:"price",children:l.jsx(uae,{price:o,textVariant:"tiny",comparePrice:a??void 0})}):null]})});BN.displayName="ProductMetadata";const Ost=({price:e,products:t})=>{const{high:n,low:r,textColor:s,backgroundColor:o,fairBounds:a}=Xoe(t,e),i=d.useMemo(()=>{if(!r||!n||!e)return null;const u=n-r;return(e-r)/u*100},[e,r,n]),c=()=>l.jsx("svg",{width:"5",height:"4",viewBox:"0 0 5 4",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{opacity:"0.5",d:"M1.7999 0.25C1.99235 -0.0833333 2.47347 -0.0833332 2.66592 0.25L4.39797 3.25C4.59042 3.58333 4.34986 4 3.96496 4H0.500859C0.115959 4 -0.124603 3.58333 0.0678468 3.25L1.7999 0.25Z",fill:"currentColor"})});return l.jsx("div",{className:"pt-xl pb-lg flex",children:l.jsxs(K,{variant:"transparent",className:"gap-two relative flex h-1.5 w-full rounded-full",children:[l.jsxs("div",{className:"absolute bottom-1/2 z-10 flex w-0 flex-col items-center gap-0.5",style:{left:`${i}%`},children:[l.jsxs("div",{className:"px-sm relative inline-flex rounded-full py-0.5",children:[l.jsx(V,{variant:"smallBold",className:z("whitespace-nowrap",{[s]:!0}),children:e?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})}),l.jsx("div",{className:z("absolute inset-0 rounded-full opacity-10",{[o]:!0})})]}),l.jsx(K,{variant:"background",className:"size-4 shrink-0 translate-y-1/2 rounded-full",children:l.jsx(K,{variant:"raised",className:"size-full rounded-full",children:l.jsx(K,{variant:"subtler",className:"p-three size-full rounded-full",children:l.jsx("div",{className:z("size-full rounded-full",{[o]:!0})})})})})]}),l.jsx("div",{className:"bg-positive relative h-full flex-1 rounded-full",children:l.jsxs("div",{className:"pt-sm absolute right-0 top-full flex translate-x-1/2 flex-col items-center gap-0.5",children:[l.jsx(c,{}),l.jsx(V,{variant:"tinyRegular",color:"light",children:a?.low?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})})]})}),l.jsx("div",{className:"bg-subtle relative h-full flex-1 rounded-full"}),l.jsx("div",{className:"bg-negative relative h-full flex-1 rounded-full",children:l.jsxs("div",{className:"pt-sm absolute left-0 top-full flex -translate-x-1/2 flex-col items-center gap-0.5",children:[l.jsx(c,{}),l.jsx(V,{variant:"tinyRegular",color:"light",children:a?.high?.toLocaleString("en-US",{style:"currency",currency:"USD",trailingZeroDisplay:"stripIfInteger"})})]})})]})})},Lst=({sortedProductsByPrice:e})=>{const[t,n]=d.useState(!1),r=d.useCallback(()=>{n(!t)},[t]),{$t:s}=J();return l.jsxs("div",{className:"gap-sm flex flex-col mt-sm",children:[e?.slice(0,t?void 0:5).map(o=>l.jsx(xae,{product:o},o.title)),e&&e.length>5?l.jsx(wt,{variant:"secondary",onClick:r,size:"small",trailingIcon:t?B("chevron-up"):B("chevron-down"),children:s(t?{defaultMessage:"View less",id:"EVFai9MfkN"}:{defaultMessage:"View all",id:"pFK6bJU0EM"})}):null]})},xae=({product:e})=>{const{$t:t}=J(),n=d.useMemo(()=>e.offers?[...e.offers].filter(r=>r.url).sort((r,s)=>(r.price??0)-(s.price??0))[0]:void 0,[e.offers]);return n?l.jsx(dr,{className:"p-[12px] rounded-xl",variant:"subtler",children:l.jsxs("div",{className:"md:gap-md flex h-full items-center justify-between gap-[12px]",children:[l.jsxs("div",{className:"gap-xs flex w-full flex-col items-start",children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-2 leading-tight",children:e.title}),l.jsx(BN,{brand:n.merchant_name??"",url:n.url??"",price:n.price,compareAtPrice:n.compare_at_price})]}),l.jsx("div",{className:"gap-xs flex shrink-0",children:l.jsx(wt,{pill:!0,size:"small",variant:"tonal",onClick:()=>window.open(n.url,"_blank"),children:l.jsx(V,{variant:"tinyRegular",color:"light",className:"whitespace-nowrap text-right leading-tight",children:t({defaultMessage:"Visit site",id:"O9CCwEBdYk"})})})})]})}):null};xae.displayName="SimilarProduct";const Fst=({widgetType:e,widgetName:t,widgetSize:n="full"})=>{const{session:r}=Ne(),{trackEvent:s}=Xe(r),{result:{backend_uuid:o,frontend_context_uuid:a}}=It(),i=d.useMemo(()=>({widgetType:e,widgetName:t,widgetLocation:"thread",widgetSize:n,position:0,frontendUUID:a,entryUUID:o}),[e,t,o,a,n]),c=d.useCallback(()=>{s("widget viewed",i)},[s,i]),u=d.useCallback(()=>{s("widget hovered",i)},[s,i]),f=d.useCallback(m=>{s("widget selected",{...i,widgetCTA:{type:"internal_url",permalink:m}})},[s,i]);return d.useMemo(()=>({widgetViewed:c,widgetHovered:u,widgetSelected:f}),[c,u,f])},Es=A.memo(e=>{const{children:t,...n}=e,{widgetSelected:r,widgetViewed:s,widgetHovered:o}=Fst(n),a=d.useRef({hovered:!1,viewed:!1}),{ref:i,isIntersecting:c}=Hfe({options:{threshold:.5},freezeOnceVisible:!0});d.useEffect(()=>{c&&!a.current.viewed&&(s(),a.current.viewed=!0)},[c,s]);const u=d.useCallback(()=>{a.current.hovered||(o(),a.current.hovered=!0)},[o]);return l.jsx("div",{ref:i,onMouseEnter:u,"data-testid":e.widgetType+"-widget",children:typeof t=="function"?t({widgetSelected:r}):t})});Es.displayName="WithThreadWidgetInteractionEvents";const vae=A.memo(e=>{const{data:t}=e,{menuItems:n}=sm();return t?.result==null?null:l.jsx(Es,{widgetType:"calculator",widgetName:"calculator",widgetSize:"full",children:l.jsx(K,{className:"flex",children:l.jsxs("div",{className:"flex w-full items-center",children:[l.jsx(V,{color:"light",variant:"smallBold",children:l.jsx(ge,{className:"mt-two text-2xl leading-none",icon:B("calculator"),size:"sm"})}),l.jsx(V,{children:l.jsx(K,{className:"pl-md font-mono text-2xl",children:Wbe(t.result)})}),n&&n.length>0&&l.jsx("div",{className:"flex grow items-start justify-end",children:l.jsx(Fn.Menu,{menuItems:n})})]})})})});vae.displayName="CalculatorWidget";function Yi(e){return Array.isArray?Array.isArray(e):wae(e)==="[object Array]"}function Bst(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ust(e){return e==null?"":Bst(e)}function Ha(e){return typeof e=="string"}function bae(e){return typeof e=="number"}function Vst(e){return e===!0||e===!1||Hst(e)&&wae(e)=="[object Boolean]"}function _ae(e){return typeof e=="object"}function Hst(e){return _ae(e)&&e!==null}function Zs(e){return e!=null}function bC(e){return!e.trim().length}function wae(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const zst="Incorrect 'index' type",Wst=e=>`Invalid value for key ${e}`,Gst=e=>`Pattern length exceeds max of ${e}.`,$st=e=>`Missing ${e} property in key`,qst=e=>`Property 'weight' in key '${e}' must be a positive integer`,lL=Object.prototype.hasOwnProperty;class Kst{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let s=Cae(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Cae(e){let t=null,n=null,r=null,s=1,o=null;if(Ha(e)||Yi(e))r=e,t=cL(e),n=Dk(e);else{if(!lL.call(e,"name"))throw new Error($st("name"));const a=e.name;if(r=a,lL.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(qst(a));t=cL(a),n=Dk(a),o=e.getFn}return{path:t,id:n,weight:s,src:r,getFn:o}}function cL(e){return Yi(e)?e:e.split(".")}function Dk(e){return Yi(e)?e.join("."):e}function Yst(e,t){let n=[],r=!1;const s=(o,a,i)=>{if(Zs(o))if(!a[i])n.push(o);else{let c=a[i];const u=o[c];if(!Zs(u))return;if(i===a.length-1&&(Ha(u)||bae(u)||Vst(u)))n.push(Ust(u));else if(Yi(u)){r=!0;for(let f=0,m=u.length;fe.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ha(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ha(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(Zs(a)){if(Yi(a)){let i=[];const c=[{nestedArrIndex:-1,value:a}];for(;c.length;){const{nestedArrIndex:u,value:f}=c.pop();if(Zs(f))if(Ha(f)&&!bC(f)){let m={v:f,i:u,n:this.norm.get(f)};i.push(m)}else Yi(f)&&f.forEach((m,p)=>{c.push({nestedArrIndex:p,value:m})})}r.$[o]=i}else if(Ha(a)&&!bC(a)){let i={v:a,n:this.norm.get(a)};r.$[o]=i}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Sae(e,t,{getFn:n=Tt.getFn,fieldNormWeight:r=Tt.fieldNormWeight}={}){const s=new UN({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(Cae)),s.setSources(t),s.create(),s}function not(e,{getFn:t=Tt.getFn,fieldNormWeight:n=Tt.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new UN({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function v1(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:s=Tt.distance,ignoreLocation:o=Tt.ignoreLocation}={}){const a=t/e.length;if(o)return a;const i=Math.abs(r-n);return s?a+i/s:i?1:a}function rot(e=[],t=Tt.minMatchCharLength){let n=[],r=-1,s=-1,o=0;for(let a=e.length;o=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}const Cc=32;function sot(e,t,n,{location:r=Tt.location,distance:s=Tt.distance,threshold:o=Tt.threshold,findAllMatches:a=Tt.findAllMatches,minMatchCharLength:i=Tt.minMatchCharLength,includeMatches:c=Tt.includeMatches,ignoreLocation:u=Tt.ignoreLocation}={}){if(t.length>Cc)throw new Error(Gst(Cc));const f=t.length,m=e.length,p=Math.max(0,Math.min(r,m));let h=o,g=p;const y=i>1||c,x=y?Array(m):[];let v;for(;(v=e.indexOf(t,g))>-1;){let E=v1(t,{currentLocation:v,expectedLocation:p,distance:s,ignoreLocation:u});if(h=Math.min(E,h),g=v+f,y){let T=0;for(;T=I;j-=1){let F=j-1,R=n[e.charAt(F)];if(y&&(x[F]=+!!R),N[j]=(N[j+1]<<1|1)&R,E&&(N[j]|=(b[j+1]|b[j])<<1|1|b[j+1]),N[j]&S&&(_=v1(t,{errors:E,currentLocation:F,expectedLocation:p,distance:s,ignoreLocation:u}),_<=h)){if(h=_,g=F,g<=p)break;I=Math.max(1,2*p-g)}}if(v1(t,{errors:E+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:u})>h)break;b=N}const C={isMatch:g>=0,score:Math.max(.001,_)};if(y){const E=rot(x,i);E.length?c&&(C.indices=E):C.isMatch=!1}return C}function oot(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:p,alphabet:oot(p),startIndex:h})},m=this.pattern.length;if(m>Cc){let p=0;const h=m%Cc,g=m-h;for(;p{const{isMatch:v,score:b,indices:_}=sot(t,g,y,{location:s+x,distance:o,threshold:a,findAllMatches:i,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});v&&(p=!0),m+=b,v&&_&&(f=[...f,..._])});let h={isMatch:p,score:p?m/this.chunks.length:1};return p&&r&&(h.indices=f),h}}class oc{constructor(t){this.pattern=t}static isMultiMatch(t){return uL(t,this.multiRegex)}static isSingleMatch(t){return uL(t,this.singleRegex)}search(){}}function uL(e,t){const n=e.match(t);return n?n[1]:null}class aot extends oc{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class iot extends oc{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class lot extends oc{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class cot extends oc{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class uot extends oc{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class dot extends oc{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class kae extends oc{constructor(t,{location:n=Tt.location,threshold:r=Tt.threshold,distance:s=Tt.distance,includeMatches:o=Tt.includeMatches,findAllMatches:a=Tt.findAllMatches,minMatchCharLength:i=Tt.minMatchCharLength,isCaseSensitive:c=Tt.isCaseSensitive,ignoreLocation:u=Tt.ignoreLocation}={}){super(t),this._bitapSearch=new Eae(t,{location:n,threshold:r,distance:s,includeMatches:o,findAllMatches:a,minMatchCharLength:i,isCaseSensitive:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Mae extends oc{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const s=[],o=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+o,s.push([r,n-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}}const jk=[aot,Mae,lot,cot,dot,uot,iot,kae],dL=jk.length,fot=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,mot="|";function pot(e,t={}){return e.split(mot).map(n=>{let r=n.trim().split(fot).filter(o=>o&&!!o.trim()),s=[];for(let o=0,a=r.length;o!!(e[V2.AND]||e[V2.OR]),xot=e=>!!e[Ok.PATH],vot=e=>!Yi(e)&&_ae(e)&&!Lk(e),fL=e=>({[V2.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Tae(e,t,{auto:n=!0}={}){const r=s=>{let o=Object.keys(s);const a=xot(s);if(!a&&o.length>1&&!Lk(s))return r(fL(s));if(vot(s)){const c=a?s[Ok.PATH]:o[0],u=a?s[Ok.PATTERN]:s[c];if(!Ha(u))throw new Error(Wst(c));const f={keyId:Dk(c),pattern:u};return n&&(f.searcher=Pk(u,t)),f}let i={children:[],operator:o[0]};return o.forEach(c=>{const u=s[c];Yi(u)&&u.forEach(f=>{i.children.push(r(f))})}),i};return Lk(e)||(e=fL(e)),r(e)}function bot(e,{ignoreFieldNorm:t=Tt.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:s,norm:o,score:a})=>{const i=s?s.weight:null;r*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(t?1:o))}),n.score=r})}function _ot(e,t){const n=e.matches;t.matches=[],Zs(n)&&n.forEach(r=>{if(!Zs(r.indices)||!r.indices.length)return;const{indices:s,value:o}=r;let a={indices:s,value:o};r.key&&(a.key=r.key.src),r.idx>-1&&(a.refIndex=r.idx),t.matches.push(a)})}function wot(e,t){t.score=e.score}function Cot(e,t,{includeMatches:n=Tt.includeMatches,includeScore:r=Tt.includeScore}={}){const s=[];return n&&s.push(_ot),r&&s.push(wot),e.map(o=>{const{idx:a}=o,i={item:t[a],refIndex:a};return s.length&&s.forEach(c=>{c(o,i)}),i})}class om{constructor(t,n={},r){this.options={...Tt,...n},this.options.useExtendedSearch,this._keyStore=new Kst(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof UN))throw new Error(zst);this._myIndex=n||Sae(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Zs(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,s=this._docs.length;r-1&&(c=c.slice(0,n)),Cot(c,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(t){const n=Pk(t,this.options),{records:r}=this._myIndex,s=[];return r.forEach(({v:o,i:a,n:i})=>{if(!Zs(o))return;const{isMatch:c,score:u,indices:f}=n.searchIn(o);c&&s.push({item:o,idx:a,matches:[{score:u,value:o,norm:i,indices:f}]})}),s}_searchLogical(t){const n=Tae(t,this.options),r=(i,c,u)=>{if(!i.children){const{keyId:m,searcher:p}=i,h=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(c,m),searcher:p});return h&&h.length?[{idx:u,item:c,matches:h}]:[]}const f=[];for(let m=0,p=i.children.length;m{if(Zs(i)){let u=r(n,i,c);u.length&&(o[c]||(o[c]={idx:c,item:i,matches:[]},a.push(o[c])),u.forEach(({matches:f})=>{o[c].matches.push(...f)}))}}),a}_searchObjectList(t){const n=Pk(t,this.options),{keys:r,records:s}=this._myIndex,o=[];return s.forEach(({$:a,i})=>{if(!Zs(a))return;let c=[];r.forEach((u,f)=>{c.push(...this._findMatches({key:u,value:a[f],searcher:n}))}),c.length&&o.push({idx:i,item:a,matches:c})}),o}_findMatches({key:t,value:n,searcher:r}){if(!Zs(n))return[];let s=[];if(Yi(n))n.forEach(({v:o,i:a,n:i})=>{if(!Zs(o))return;const{isMatch:c,score:u,indices:f}=r.searchIn(o);c&&s.push({score:u,key:t,value:o,idx:a,norm:i,indices:f})});else{const{v:o,n:a}=n,{isMatch:i,score:c,indices:u}=r.searchIn(o);i&&s.push({score:c,key:t,value:o,norm:a,indices:u})}return s}}om.version="7.0.0";om.createIndex=Sae;om.parseIndex=not;om.config=Tt;om.parseQuery=Tae;yot(got);const Fk=[{currencyCode:"AED",type:"fiat",currency:W({defaultMessage:"United Arab Emirates dirham",id:"u/noLkGMVn"}),countryCode:"AE",symbol:"د.إ"},{currencyCode:"AFN",type:"fiat",currency:W({defaultMessage:"Afghan afghani",id:"HbCn83pcga"}),countryCode:"AF",symbol:"؋"},{currencyCode:"ALL",type:"fiat",currency:W({defaultMessage:"Albanian lek",id:"/il1Hf7GWO"}),countryCode:"AL",symbol:"L"},{currencyCode:"AMD",type:"fiat",currency:W({defaultMessage:"Armenian dram",id:"Sab4a7TKLH"}),countryCode:"AM",symbol:"֏"},{currencyCode:"ARS",type:"fiat",currency:W({defaultMessage:"Argentine peso",id:"52+/SFD8VZ"}),countryCode:"AR",symbol:"$"},{currencyCode:"AUD",type:"fiat",currency:W({defaultMessage:"Australian dollar",id:"iWILeLEVYR"}),countryCode:"AU",symbol:"$"},{currencyCode:"AWG",type:"fiat",currency:W({defaultMessage:"Aruban florin",id:"BEGfukujzF"}),countryCode:"AW",symbol:"ƒ"},{currencyCode:"BAM",type:"fiat",currency:W({defaultMessage:"Bosnia and Herzegovina convertible mark",id:"b09sYvQVre"}),countryCode:"BA",symbol:"KM"},{currencyCode:"BBD",type:"fiat",currency:W({defaultMessage:"Barbadian dollar",id:"VlWuwU66Ue"}),countryCode:"BB",symbol:"$"},{currencyCode:"BDT",type:"fiat",currency:W({defaultMessage:"Bangladeshi taka",id:"nzdEshqHWS"}),countryCode:"BD",symbol:"৳"},{currencyCode:"BGN",type:"fiat",currency:W({defaultMessage:"Bulgarian lev",id:"IDTjXBqV4N"}),countryCode:"BG",symbol:"лв"},{currencyCode:"BHD",type:"fiat",currency:W({defaultMessage:"Bahraini dinar",id:"eq8qHJx0kM"}),countryCode:"BH",symbol:".د.ب"},{currencyCode:"BIF",type:"fiat",currency:W({defaultMessage:"Burundian franc",id:"o/KpEtmYi4"}),countryCode:"BI",symbol:"FBu"},{currencyCode:"BMD",type:"fiat",currency:W({defaultMessage:"Bermudian dollar",id:"kO0KeiZ+IN"}),countryCode:"BM",symbol:"$"},{currencyCode:"BND",type:"fiat",currency:W({defaultMessage:"Brunei dollar",id:"GRkirfzc48"}),countryCode:"BN",symbol:"$"},{currencyCode:"BOB",type:"fiat",currency:W({defaultMessage:"Bolivian boliviano",id:"l7UUEAhjL1"}),countryCode:"BO",symbol:"Bs."},{currencyCode:"BRL",type:"fiat",currency:W({defaultMessage:"Brazilian real",id:"x+BZGn5rek"}),countryCode:"BR",symbol:"R$"},{currencyCode:"BSD",type:"fiat",currency:W({defaultMessage:"Bahamian dollar",id:"u9nfam/El1"}),countryCode:"BS",symbol:"$"},{currencyCode:"BTN",type:"fiat",currency:W({defaultMessage:"Bhutanese ngultrum",id:"EbzIZvY2C3"}),countryCode:"BT",symbol:"Nu."},{currencyCode:"BWP",type:"fiat",currency:W({defaultMessage:"Botswana pula",id:"TvRjxCQudG"}),countryCode:"BW",symbol:"P"},{currencyCode:"BZD",type:"fiat",currency:W({defaultMessage:"Belize dollar",id:"tnMfFVDwiX"}),countryCode:"BZ",symbol:"$"},{currencyCode:"CAD",type:"fiat",currency:W({defaultMessage:"Canadian dollar",id:"L4ftYFzYiG"}),countryCode:"CA",symbol:"$"},{currencyCode:"CDF",type:"fiat",currency:W({defaultMessage:"Congolese franc",id:"6DNXExdai2"}),countryCode:"CD",symbol:"FC"},{currencyCode:"CHF",type:"fiat",currency:W({defaultMessage:"Swiss franc",id:"113zTX3mKi"}),countryCode:"CH",symbol:"Fr."},{currencyCode:"CLP",type:"fiat",currency:W({defaultMessage:"Chilean peso",id:"tLhKy6Swhn"}),countryCode:"CL",symbol:"$"},{currencyCode:"CNH",type:"fiat",currency:W({defaultMessage:"Chinese yuan (offshore)",id:"wAShedQ5+o"}),countryCode:"CN",symbol:"¥"},{currencyCode:"CNY",type:"fiat",currency:W({defaultMessage:"Chinese yuan",id:"/sleu+8FUs"}),countryCode:"CN",symbol:"¥"},{currencyCode:"COP",type:"fiat",currency:W({defaultMessage:"Colombian peso",id:"KR2NhLe6wO"}),countryCode:"CO",symbol:"$"},{currencyCode:"CRC",type:"fiat",currency:W({defaultMessage:"Costa Rican colón",id:"OLgF3rrfev"}),countryCode:"CR",symbol:"₡"},{currencyCode:"CUP",type:"fiat",currency:W({defaultMessage:"Cuban peso",id:"ua/JslQGFc"}),countryCode:"CU",symbol:"$"},{currencyCode:"CVE",type:"fiat",currency:W({defaultMessage:"Cape Verdean escudo",id:"gg39Xd9NoM"}),countryCode:"CV",symbol:"$"},{currencyCode:"CYP",type:"fiat",currency:W({defaultMessage:"Cypriot pound",id:"xJn7heFKbn"}),countryCode:"CY",symbol:"£"},{currencyCode:"CZK",type:"fiat",currency:W({defaultMessage:"Czech koruna",id:"xpMdKvcamT"}),countryCode:"CZ",symbol:"Kč"},{currencyCode:"DJF",type:"fiat",currency:W({defaultMessage:"Djiboutian franc",id:"WtP9AoFz2A"}),countryCode:"DJ",symbol:"Fdj"},{currencyCode:"DKK",type:"fiat",currency:W({defaultMessage:"Danish krone",id:"Xy5G3y8jOw"}),countryCode:"DK",symbol:"kr"},{currencyCode:"DOP",type:"fiat",currency:W({defaultMessage:"Dominican peso",id:"2i/KFaPpw5"}),countryCode:"DO",symbol:"RD$"},{currencyCode:"DZD",type:"fiat",currency:W({defaultMessage:"Algerian dinar",id:"6sTpFM3olk"}),countryCode:"DZ",symbol:"دج"},{currencyCode:"EGP",type:"fiat",currency:W({defaultMessage:"Egyptian pound",id:"PxOcvtceh8"}),countryCode:"EG",symbol:"£"},{currencyCode:"ETB",type:"fiat",currency:W({defaultMessage:"Ethiopian birr",id:"6VjP5tvzWg"}),countryCode:"ET",symbol:"Br"},{currencyCode:"EUR",type:"fiat",currency:W({defaultMessage:"Euro",id:"Zz6d8XMgGD"}),countryCode:"EU",symbol:"€"},{currencyCode:"FJD",type:"fiat",currency:W({defaultMessage:"Fijian dollar",id:"w33lAGgTZS"}),countryCode:"FJ",symbol:"$"},{currencyCode:"GBP",type:"fiat",currency:W({defaultMessage:"Pound sterling",id:"uU25lEI6GM"}),countryCode:"GB",symbol:"£"},{currencyCode:"GEL",type:"fiat",currency:W({defaultMessage:"Georgian lari",id:"m4gS106RpO"}),countryCode:"GE",symbol:"₾"},{currencyCode:"GHS",type:"fiat",currency:W({defaultMessage:"Ghanaian cedi",id:"2k7sXvkoLP"}),countryCode:"GH",symbol:"₵"},{currencyCode:"GMD",type:"fiat",currency:W({defaultMessage:"Gambian dalasi",id:"zT8nD3rOKp"}),countryCode:"GM",symbol:"D"},{currencyCode:"GNF",type:"fiat",currency:W({defaultMessage:"Guinean franc",id:"kZk7wkuU9a"}),countryCode:"GN",symbol:"FG"},{currencyCode:"GTQ",type:"fiat",currency:W({defaultMessage:"Guatemalan quetzal",id:"0eSFsz1h5U"}),countryCode:"GT",symbol:"Q"},{currencyCode:"GYD",type:"fiat",currency:W({defaultMessage:"Guyanese dollar",id:"pvTNSDiMVb"}),countryCode:"GY",symbol:"$"},{currencyCode:"HKD",type:"fiat",currency:W({defaultMessage:"Hong Kong dollar",id:"tSeK2eAo7a"}),countryCode:"HK",symbol:"$"},{currencyCode:"HNL",type:"fiat",currency:W({defaultMessage:"Honduran lempira",id:"u1All4YZ/M"}),countryCode:"HN",symbol:"L"},{currencyCode:"HRK",type:"fiat",currency:W({defaultMessage:"Croatian kuna",id:"m4/bILMdtE"}),countryCode:"HR",symbol:"kn"},{currencyCode:"HTG",type:"fiat",currency:W({defaultMessage:"Haitian gourde",id:"fYPjhPHJw5"}),countryCode:"HT",symbol:"G"},{currencyCode:"HUF",type:"fiat",currency:W({defaultMessage:"Hungarian forint",id:"Bhl6SxOjG0"}),countryCode:"HU",symbol:"Ft"},{currencyCode:"IDR",type:"fiat",currency:W({defaultMessage:"Indonesian rupiah",id:"JnQBDoCEpL"}),countryCode:"ID",symbol:"Rp"},{currencyCode:"ILS",type:"fiat",currency:W({defaultMessage:"Israeli new shekel",id:"IxD6vfIMsj"}),countryCode:"IL",symbol:"₪"},{currencyCode:"INR",type:"fiat",currency:W({defaultMessage:"Indian rupee",id:"XnsufP9pQC"}),countryCode:"IN",symbol:"₹"},{currencyCode:"IQD",type:"fiat",currency:W({defaultMessage:"Iraqi dinar",id:"rmzi7U/4iu"}),countryCode:"IQ",symbol:"ع.د"},{currencyCode:"ISK",type:"fiat",currency:W({defaultMessage:"Icelandic króna",id:"+QCFy0sZgh"}),countryCode:"IS",symbol:"kr"},{currencyCode:"JMD",type:"fiat",currency:W({defaultMessage:"Jamaican dollar",id:"EkOwDtWSVs"}),countryCode:"JM",symbol:"J$"},{currencyCode:"JOD",type:"fiat",currency:W({defaultMessage:"Jordanian dinar",id:"B2GvyCUDsS"}),countryCode:"JO",symbol:"د.ا"},{currencyCode:"JPY",type:"fiat",currency:W({defaultMessage:"Japanese yen",id:"2PiQsV1fPp"}),countryCode:"JP",symbol:"¥"},{currencyCode:"KES",type:"fiat",currency:W({defaultMessage:"Kenyan shilling",id:"JIjYrchwhv"}),countryCode:"KE",symbol:"KSh"},{currencyCode:"KHR",type:"fiat",currency:W({defaultMessage:"Cambodian riel",id:"KCKOEaCtcY"}),countryCode:"KH",symbol:"៛"},{currencyCode:"KMF",type:"fiat",currency:W({defaultMessage:"Comorian franc",id:"WV9ZQdQeR+"}),countryCode:"KM",symbol:"CF"},{currencyCode:"KRW",type:"fiat",currency:W({defaultMessage:"South Korean won",id:"EiHQBnRax2"}),countryCode:"KR",symbol:"₩"},{currencyCode:"KWD",type:"fiat",currency:W({defaultMessage:"Kuwaiti dinar",id:"fkOQdpZmRV"}),countryCode:"KW",symbol:"د.ك"},{currencyCode:"KYD",type:"fiat",currency:W({defaultMessage:"Cayman Islands dollar",id:"RsdrXusNMV"}),countryCode:"KY",symbol:"$"},{currencyCode:"KZT",type:"fiat",currency:W({defaultMessage:"Kazakhstani tenge",id:"2qtVTeGWCE"}),countryCode:"KZ",symbol:"₸"},{currencyCode:"LAK",type:"fiat",currency:W({defaultMessage:"Lao kip",id:"Fgzd1G5Yfn"}),countryCode:"LA",symbol:"₭"},{currencyCode:"LBP",type:"fiat",currency:W({defaultMessage:"Lebanese pound",id:"FGzeEqNQzF"}),countryCode:"LB",symbol:"ل.ل"},{currencyCode:"LKR",type:"fiat",currency:W({defaultMessage:"Sri Lankan rupee",id:"a4/joWlRVu"}),countryCode:"LK",symbol:"Rs"},{currencyCode:"LRD",type:"fiat",currency:W({defaultMessage:"Liberian dollar",id:"FI1z5I01J6"}),countryCode:"LR",symbol:"$"},{currencyCode:"LSL",type:"fiat",currency:W({defaultMessage:"Lesotho loti",id:"csvFpR0QuR"}),countryCode:"LS",symbol:"L"},{currencyCode:"LTL",type:"fiat",currency:W({defaultMessage:"Lithuanian litas",id:"0eziwi9562"}),countryCode:"LT",symbol:"Lt"},{currencyCode:"LYD",type:"fiat",currency:W({defaultMessage:"Libyan dinar",id:"MHH+Pd33wK"}),countryCode:"LY",symbol:"ل.د"},{currencyCode:"MAD",type:"fiat",currency:W({defaultMessage:"Moroccan dirham",id:"ECYUhp5Zzw"}),countryCode:"MA",symbol:"د.م."},{currencyCode:"MDL",type:"fiat",currency:W({defaultMessage:"Moldovan leu",id:"b0q4AtgUSW"}),countryCode:"MD",symbol:"L"},{currencyCode:"MGA",type:"fiat",currency:W({defaultMessage:"Malagasy ariary",id:"7X6Af0dVLl"}),countryCode:"MG",symbol:"Ar"},{currencyCode:"MKD",type:"fiat",currency:W({defaultMessage:"Macedonian denar",id:"RCCw/rBMD7"}),countryCode:"MK",symbol:"ден"},{currencyCode:"MMK",type:"fiat",currency:W({defaultMessage:"Burmese kyat",id:"09O/caoUOd"}),countryCode:"MM",symbol:"K"},{currencyCode:"MOP",type:"fiat",currency:W({defaultMessage:"Macanese pataca",id:"WSCDGHnfAP"}),countryCode:"MO",symbol:"P"},{currencyCode:"MUR",type:"fiat",currency:W({defaultMessage:"Mauritian rupee",id:"B7EPhc2k1/"}),countryCode:"MU",symbol:"₨"},{currencyCode:"MVR",type:"fiat",currency:W({defaultMessage:"Maldivian rufiyaa",id:"WKep/6FHLO"}),countryCode:"MV",symbol:"Rf"},{currencyCode:"MWK",type:"fiat",currency:W({defaultMessage:"Malawian kwacha",id:"0QSRp0Tfcl"}),countryCode:"MW",symbol:"MK"},{currencyCode:"MXN",type:"fiat",currency:W({defaultMessage:"Mexican peso",id:"cAJvdQ+v2Y"}),countryCode:"MX",symbol:"$"},{currencyCode:"MXV",type:"fiat",currency:W({defaultMessage:"Mexican Unidad de Inversion (UDI)",id:"pJjurDaC1J"}),countryCode:"MX",symbol:"UDI"},{currencyCode:"MYR",type:"fiat",currency:W({defaultMessage:"Malaysian ringgit",id:"BJOmmIMKBn"}),countryCode:"MY",symbol:"RM"},{currencyCode:"MZN",type:"fiat",currency:W({defaultMessage:"Mozambican metical",id:"KVoUcWYwrs"}),countryCode:"MZ",symbol:"MT"},{currencyCode:"NAD",type:"fiat",currency:W({defaultMessage:"Namibian dollar",id:"ofXViiQOEO"}),countryCode:"NA",symbol:"$"},{currencyCode:"NGN",type:"fiat",currency:W({defaultMessage:"Nigerian naira",id:"YtrB6By6fQ"}),countryCode:"NG",symbol:"₦"},{currencyCode:"NIO",type:"fiat",currency:W({defaultMessage:"Nicaraguan córdoba",id:"NJJMgSKcDP"}),countryCode:"NI",symbol:"C$"},{currencyCode:"NOK",type:"fiat",currency:W({defaultMessage:"Norwegian krone",id:"X7p/vNj1w0"}),countryCode:"NO",symbol:"kr"},{currencyCode:"NPR",type:"fiat",currency:W({defaultMessage:"Nepalese rupee",id:"KpP5Ur9yKv"}),countryCode:"NP",symbol:"₨"},{currencyCode:"NZD",type:"fiat",currency:W({defaultMessage:"New Zealand dollar",id:"uoVYggIiS7"}),countryCode:"NZ",symbol:"$"},{currencyCode:"OMR",type:"fiat",currency:W({defaultMessage:"Omani rial",id:"YuZlkmlwz6"}),countryCode:"OM",symbol:"ر.ع."},{currencyCode:"PAB",type:"fiat",currency:W({defaultMessage:"Panamanian balboa",id:"WsXJoQA7BU"}),countryCode:"PA",symbol:"B/."},{currencyCode:"PEN",type:"fiat",currency:W({defaultMessage:"Peruvian sol",id:"Gzey/zBCdq"}),countryCode:"PE",symbol:"S/."},{currencyCode:"PGK",type:"fiat",currency:W({defaultMessage:"Papua New Guinean kina",id:"1odcdptMV2"}),countryCode:"PG",symbol:"K"},{currencyCode:"PHP",type:"fiat",currency:W({defaultMessage:"Philippine peso",id:"Ze94/Fib/J"}),countryCode:"PH",symbol:"₱"},{currencyCode:"PKR",type:"fiat",currency:W({defaultMessage:"Pakistani rupee",id:"xg2ovH8pDh"}),countryCode:"PK",symbol:"₨"},{currencyCode:"PLN",type:"fiat",currency:W({defaultMessage:"Polish złoty",id:"5nGZooUDXi"}),countryCode:"PL",symbol:"zł"},{currencyCode:"PYG",type:"fiat",currency:W({defaultMessage:"Paraguayan guaraní",id:"faGTF61Eyw"}),countryCode:"PY",symbol:"₲"},{currencyCode:"QAR",type:"fiat",currency:W({defaultMessage:"Qatari riyal",id:"DuHEQnjrPb"}),countryCode:"QA",symbol:"ر.ق"},{currencyCode:"RON",type:"fiat",currency:W({defaultMessage:"Romanian leu",id:"lXgl4aKBP3"}),countryCode:"RO",symbol:"lei"},{currencyCode:"RSD",type:"fiat",currency:W({defaultMessage:"Serbian dinar",id:"giqvsRUiA5"}),countryCode:"RS",symbol:"дин."},{currencyCode:"RUB",type:"fiat",currency:W({defaultMessage:"Russian ruble",id:"4U+m5Kd694"}),countryCode:"RU",symbol:"₽"},{currencyCode:"RWF",type:"fiat",currency:W({defaultMessage:"Rwandan franc",id:"URbs3Tt0On"}),countryCode:"RW",symbol:"FRw"},{currencyCode:"SAR",type:"fiat",currency:W({defaultMessage:"Saudi riyal",id:"p6D2TLqko8"}),countryCode:"SA",symbol:"ر.س"},{currencyCode:"SCR",type:"fiat",currency:W({defaultMessage:"Seychellois rupee",id:"V7Ju6HZQJK"}),countryCode:"SC",symbol:"₨"},{currencyCode:"SDG",type:"fiat",currency:W({defaultMessage:"Sudanese pound",id:"FsgRxw4tdm"}),countryCode:"SD",symbol:"ج.س."},{currencyCode:"SEK",type:"fiat",currency:W({defaultMessage:"Swedish krona",id:"WoyUwT/z0X"}),countryCode:"SE",symbol:"kr"},{currencyCode:"SGD",type:"fiat",currency:W({defaultMessage:"Singapore dollar",id:"SCjBmFU+PM"}),countryCode:"SG",symbol:"$"},{currencyCode:"SHP",type:"fiat",currency:W({defaultMessage:"Saint Helena pound",id:"XZdS6/MxwW"}),countryCode:"SH",symbol:"£"},{currencyCode:"SLL",type:"fiat",currency:W({defaultMessage:"Sierra Leonean leone",id:"DFZ4yqf1EG"}),countryCode:"SL",symbol:"Le"},{currencyCode:"SOS",type:"fiat",currency:W({defaultMessage:"Somali shilling",id:"e7cANdrF41"}),countryCode:"SO",symbol:"Sh.So."},{currencyCode:"SVC",type:"fiat",currency:W({defaultMessage:"Salvadoran colón",id:"A2mT13SXuX"}),countryCode:"SV",symbol:"₡"},{currencyCode:"SZL",type:"fiat",currency:W({defaultMessage:"Swazi lilangeni",id:"+kNQR2VJjT"}),countryCode:"SZ",symbol:"E"},{currencyCode:"THB",type:"fiat",currency:W({defaultMessage:"Thai baht",id:"Yz36aOmXMd"}),countryCode:"TH",symbol:"฿"},{currencyCode:"TJS",type:"fiat",currency:W({defaultMessage:"Tajikistani somoni",id:"G3q+8He+TZ"}),countryCode:"TJ",symbol:"ЅM"},{currencyCode:"TMT",type:"fiat",currency:W({defaultMessage:"Turkmenistan manat",id:"iV0j+gxDPN"}),countryCode:"TM",symbol:"m"},{currencyCode:"TND",type:"fiat",currency:W({defaultMessage:"Tunisian dinar",id:"l6iU1LyMSk"}),countryCode:"TN",symbol:"د.ت"},{currencyCode:"TRY",type:"fiat",currency:W({defaultMessage:"Turkish lira",id:"hQ9m98Llgt"}),countryCode:"TR",symbol:"₺"},{currencyCode:"TTD",type:"fiat",currency:W({defaultMessage:"Trinidad and Tobago dollar",id:"Op/jRg7//J"}),countryCode:"TT",symbol:"TT$"},{currencyCode:"TWD",type:"fiat",currency:W({defaultMessage:"New Taiwan dollar",id:"yAeWHzFY54"}),countryCode:"TW",symbol:"NT$"},{currencyCode:"TZS",type:"fiat",currency:W({defaultMessage:"Tanzanian shilling",id:"7YNH90CDt1"}),countryCode:"TZ",symbol:"TSh"},{currencyCode:"UAH",type:"fiat",currency:W({defaultMessage:"Ukrainian hryvnia",id:"HCy2dyACi0"}),countryCode:"UA",symbol:"₴"},{currencyCode:"UGX",type:"fiat",currency:W({defaultMessage:"Ugandan shilling",id:"P5STuJcFRi"}),countryCode:"UG",symbol:"USh"},{currencyCode:"USD",type:"fiat",currency:W({defaultMessage:"United States dollar",id:"BPRJDRwXU1"}),countryCode:"US",symbol:"$"},{currencyCode:"UYU",type:"fiat",currency:W({defaultMessage:"Uruguayan peso",id:"HtXUCx6BL1"}),countryCode:"UY",symbol:"$U"},{currencyCode:"UZS",type:"fiat",currency:W({defaultMessage:"Uzbekistani soʻm",id:"lv4m0Kbuw1"}),countryCode:"UZ",symbol:"so'm"},{currencyCode:"VND",type:"fiat",currency:W({defaultMessage:"Vietnamese đồng",id:"We/RqEPpOp"}),countryCode:"VN",symbol:"₫"},{currencyCode:"XAF",type:"fiat",currency:W({defaultMessage:"Central African CFA franc",id:"fZwFESvHCw"}),countryCode:"CF",symbol:"FCFA"},{currencyCode:"XAG",type:"commodity",currency:W({defaultMessage:"Silver (troy ounce)",id:"XVTnv5Liuj"}),countryCode:"ZZ",symbol:"XAG"},{currencyCode:"XAU",type:"commodity",currency:W({defaultMessage:"Gold (troy ounce)",id:"s3i6lUYb/y"}),countryCode:"ZZ",symbol:"XAU"},{currencyCode:"XCD",type:"fiat",currency:W({defaultMessage:"East Caribbean dollar",id:"pXF3HmkspQ"}),countryCode:"AG",symbol:"$"},{currencyCode:"XDR",type:"fiat",currency:W({defaultMessage:"Special drawing rights",id:"X4eXXVN7wq"}),countryCode:"ZZ",symbol:"SDR"},{currencyCode:"XOF",type:"fiat",currency:W({defaultMessage:"West African CFA franc",id:"cezzLNBm20"}),countryCode:"SN",symbol:"CFA"},{currencyCode:"XPF",type:"fiat",currency:W({defaultMessage:"CFP franc",id:"txe+aX9vvZ"}),countryCode:"PF",symbol:"₣"},{currencyCode:"YER",type:"fiat",currency:W({defaultMessage:"Yemeni rial",id:"lRXRuW4arm"}),countryCode:"YE",symbol:"﷼"},{currencyCode:"ZAC",type:"fiat",currency:W({defaultMessage:"South African rand (financial)",id:"GsJykrhxvK"}),countryCode:"ZA",symbol:"R"},{currencyCode:"ZAR",type:"fiat",currency:W({defaultMessage:"South African rand",id:"MbU2//IGEL"}),countryCode:"ZA",symbol:"R"},{currencyCode:"ZMW",type:"fiat",currency:W({defaultMessage:"Zambian kwacha",id:"ZJnHTLBz2v"}),countryCode:"ZM",symbol:"ZK"},{currencyCode:"BTC",type:"crypto",currency:W({defaultMessage:"Bitcoin",id:"RkW5weBw8q"}),symbol:"₿"},{currencyCode:"ETH",type:"crypto",currency:W({defaultMessage:"Ethereum",id:"ohE0sWxJfP"}),symbol:"Ξ"},{currencyCode:"XRP",type:"crypto",currency:W({defaultMessage:"XRP",id:"rwHxdc9N83"}),symbol:"XRP"},{currencyCode:"BNB",type:"crypto",currency:W({defaultMessage:"BNB",id:"+x/JA+cbSg"}),symbol:"BNB"},{currencyCode:"USDT",type:"crypto",currency:W({defaultMessage:"Tether",id:"G17JtC1DRO"}),symbol:"USDT"},{currencyCode:"SOL",type:"crypto",currency:W({defaultMessage:"Solana",id:"RmbsLR1XI9"}),symbol:"SOL"},{currencyCode:"HYPE",type:"crypto",currency:W({defaultMessage:"HYPE",id:"sRJuK+IQu7"}),symbol:"HYPE"},{currencyCode:"STETH",type:"crypto",currency:W({defaultMessage:"stETH",id:"VNvqEhRv0o"}),symbol:"stETH"},{currencyCode:"WTRX",type:"crypto",currency:W({defaultMessage:"Wrapped TRX",id:"hi8IgS7Vvh"}),symbol:"WTRX"},{currencyCode:"DOGE",type:"crypto",currency:W({defaultMessage:"Dogecoin",id:"Q4KOhNgUFl"}),symbol:"DOGE"},{currencyCode:"ADA",type:"crypto",currency:W({defaultMessage:"Cardano",id:"Zk+zRo7Vav"}),symbol:"ADA"},{currencyCode:"TRX",type:"crypto",currency:W({defaultMessage:"TRON",id:"fLtNc/n43W"}),symbol:"TRX"},{currencyCode:"USDC",type:"crypto",currency:W({defaultMessage:"USD Coin",id:"tPc0IbLJq0"}),symbol:"USDC"},{currencyCode:"WBTC",type:"crypto",currency:W({defaultMessage:"Wrapped Bitcoin",id:"AO1Xrr+Cwk"}),symbol:"WBTC"},{currencyCode:"WSTETH",type:"crypto",currency:W({defaultMessage:"Wrapped stETH",id:"Fg7h7ipjGE"}),symbol:"wstETH"},{currencyCode:"EDLC",type:"crypto",currency:W({defaultMessage:"EDLC",id:"FplbXN+574"}),symbol:"EDLC"},{currencyCode:"LINK",type:"crypto",currency:W({defaultMessage:"Chainlink",id:"d/A799ZTa/"}),symbol:"LINK"},{currencyCode:"AIC",type:"crypto",currency:W({defaultMessage:"AIC",id:"RSOIsb9pEC"}),symbol:"AIC"},{currencyCode:"XLM",type:"crypto",currency:W({defaultMessage:"Stellar",id:"+uYwRW10Bd"}),symbol:"XLM"},{currencyCode:"WETH",type:"crypto",currency:W({defaultMessage:"Wrapped Ether",id:"s8UwDT+8t2"}),symbol:"WETH"},{currencyCode:"BCH",type:"crypto",currency:W({defaultMessage:"Bitcoin Cash",id:"hLt+wzROTK"}),symbol:"BCH"},{currencyCode:"UST",type:"crypto",currency:W({defaultMessage:"TerraUSD",id:"wot2OPkJDe"}),symbol:"UST"},{currencyCode:"AVAX",type:"crypto",currency:W({defaultMessage:"Avalanche",id:"C9K+TI7R4G"}),symbol:"AVAX"},{currencyCode:"SUI",type:"crypto",currency:W({defaultMessage:"Sui",id:"CvmoCbTblr"}),symbol:"SUI"},{currencyCode:"LTC",type:"crypto",currency:W({defaultMessage:"Litecoin",id:"oyKw8Dr6hh"}),symbol:"LTC"},{currencyCode:"TON",type:"crypto",currency:W({defaultMessage:"Toncoin",id:"V2AxdWxVB/"}),symbol:"TON"},{currencyCode:"HBAR",type:"crypto",currency:W({defaultMessage:"Hedera",id:"yLSpOa++/L"}),symbol:"HBAR"},{currencyCode:"WHBAR",type:"crypto",currency:W({defaultMessage:"Wrapped HBAR",id:"rfimaaddr1"}),symbol:"WHBAR"},{currencyCode:"UNI",type:"crypto",currency:W({defaultMessage:"Uniswap",id:"hincAkLfxR"}),symbol:"UNI"},{currencyCode:"BTCB",type:"crypto",currency:W({defaultMessage:"Bitcoin BEP2",id:"T7D16Bt6JS"}),symbol:"BTCB"},{currencyCode:"OKB",type:"crypto",currency:W({defaultMessage:"OKB",id:"6ZLe/X3P+I"}),symbol:"OKB"},{currencyCode:"SHIB",type:"crypto",currency:W({defaultMessage:"Shiba Inu",id:"dwuQAuovNP"}),symbol:"SHIB"},{currencyCode:"USDS",type:"crypto",currency:W({defaultMessage:"StableUSD",id:"DAzSEb0LeA"}),symbol:"USDS"},{currencyCode:"WBT",type:"crypto",currency:W({defaultMessage:"WhiteBIT Coin",id:"Lj9Zp416rG"}),symbol:"WBT"},{currencyCode:"BGB",type:"crypto",currency:W({defaultMessage:"Bitget Token",id:"OEQgkmdE1O"}),symbol:"BGB"},{currencyCode:"DAI",type:"crypto",currency:W({defaultMessage:"Dai",id:"7g+Z6oltsB"}),symbol:"DAI"},{currencyCode:"DOT",type:"crypto",currency:W({defaultMessage:"Polkadot",id:"iS7ue2zjn0"}),symbol:"DOT"},{currencyCode:"XMR",type:"crypto",currency:W({defaultMessage:"Monero",id:"RydJABkA4a"}),symbol:"XMR"},{currencyCode:"MNT",type:"crypto",currency:W({defaultMessage:"MNT",id:"90qNZszLR/"}),symbol:"MNT"},{currencyCode:"PEPE",type:"crypto",currency:W({defaultMessage:"Pepe",id:"x9wJbmzZhn"}),symbol:"PEPE"},{currencyCode:"AAVE",type:"crypto",currency:W({defaultMessage:"Aave",id:"kFjzNltaTL"}),symbol:"AAVE"},{currencyCode:"CRO",type:"crypto",currency:W({defaultMessage:"Cronos",id:"2cg8W1gIo3"}),symbol:"CRO"},{currencyCode:"ETC",type:"crypto",currency:W({defaultMessage:"Ethereum Classic",id:"Bv9Xkw6kNg"}),symbol:"ETC"},{currencyCode:"FD",type:"crypto",currency:W({defaultMessage:"FD",id:"+Q62UIi/LA"}),symbol:"FD"},{currencyCode:"TUSD",type:"crypto",currency:W({defaultMessage:"TrueUSD",id:"whDnhXYdIe"}),symbol:"TUSD"},{currencyCode:"NEAR",type:"crypto",currency:W({defaultMessage:"NEAR Protocol",id:"E9RsfkMwMk"}),symbol:"NEAR"},{currencyCode:"METAGAMES",type:"crypto",currency:W({defaultMessage:"MetaGames",id:"C0GGroVhnP"}),symbol:"METAGAMES"},{currencyCode:"TAO",type:"crypto",currency:W({defaultMessage:"Bittensor",id:"6+C0Ut5hKl"}),symbol:"TAO"},{currencyCode:"ICP",type:"crypto",currency:W({defaultMessage:"Internet Computer",id:"q9uyMXlX+M"}),symbol:"ICP"},{currencyCode:"GT",type:"crypto",currency:W({defaultMessage:"GateToken",id:"dSGfpIcmmI"}),symbol:"GT"},{currencyCode:"RETH",type:"crypto",currency:W({defaultMessage:"Rocket Pool ETH",id:"pg4o1kZ2d4"}),symbol:"rETH"},{currencyCode:"MRS",type:"crypto",currency:W({defaultMessage:"MRS",id:"CABw3watNU"}),symbol:"MRS"},{currencyCode:"APT",type:"crypto",currency:W({defaultMessage:"Aptos",id:"/U15UItsIY"}),symbol:"APT"},{currencyCode:"KAS",type:"crypto",currency:W({defaultMessage:"Kaspa",id:"1MwSSUoCwu"}),symbol:"KAS"},{currencyCode:"ALGO",type:"crypto",currency:W({defaultMessage:"Algorand",id:"TijDBb1K3w"}),symbol:"ALGO"},{currencyCode:"PENGU",type:"crypto",currency:W({defaultMessage:"PENGU",id:"esTSdYyjL9"}),symbol:"PENGU"},{currencyCode:"VET",type:"crypto",currency:W({defaultMessage:"VeChain",id:"o3b918Uwm9"}),symbol:"VET"},{currencyCode:"OTRUMP",type:"crypto",currency:W({defaultMessage:"OTRUMP",id:"dwjxu1ZNrs"}),symbol:"OTRUMP"},{currencyCode:"ARB",type:"crypto",currency:W({defaultMessage:"Arbitrum",id:"2qF6KBPwqc"}),symbol:"ARB"},{currencyCode:"LUNA1",type:"crypto",currency:W({defaultMessage:"Terra (LUNA1)",id:"g5JtKAkJm/"}),symbol:"LUNA1"},{currencyCode:"MKR",type:"crypto",currency:W({defaultMessage:"Maker",id:"iVoUggHR7n"}),symbol:"MKR"},{currencyCode:"QNT",type:"crypto",currency:W({defaultMessage:"Quant",id:"kZiBtRgPXK"}),symbol:"QNT"},{currencyCode:"BONK",type:"crypto",currency:W({defaultMessage:"BONK",id:"/WOyXrLUEt"}),symbol:"BONK"},{currencyCode:"ATOM",type:"crypto",currency:W({defaultMessage:"Cosmos",id:"VfvhDOBZSq"}),symbol:"ATOM"},{currencyCode:"FTN",type:"crypto",currency:W({defaultMessage:"FTN",id:"+BtHlnfKBJ"}),symbol:"FTN"},{currencyCode:"KCS",type:"crypto",currency:W({defaultMessage:"KuCoin Token",id:"J6x8n/y945"}),symbol:"KCS"},{currencyCode:"RNDR",type:"crypto",currency:W({defaultMessage:"Render",id:"fI33PYpQj/"}),symbol:"RNDR"},{currencyCode:"BNX",type:"crypto",currency:W({defaultMessage:"BNX",id:"/mzOvKP3DB"}),symbol:"BNX"},{currencyCode:"FIL",type:"crypto",currency:W({defaultMessage:"Filecoin",id:"O60m1dM5+I"}),symbol:"FIL"},{currencyCode:"WBNB",type:"crypto",currency:W({defaultMessage:"Wrapped BNB",id:"6oPoIEcEKM"}),symbol:"WBNB"},{currencyCode:"DUCK",type:"crypto",currency:W({defaultMessage:"DUCK",id:"Wy2n2zHjyn"}),symbol:"DUCK"},{currencyCode:"ONDO",type:"crypto",currency:W({defaultMessage:"Ondo",id:"Mdh4nCMVFp"}),symbol:"ONDO"},{currencyCode:"EZETH",type:"crypto",currency:W({defaultMessage:"EZETH",id:"GquMfdHRpr"}),symbol:"EZETH"},{currencyCode:"DHN",type:"crypto",currency:W({defaultMessage:"DHN",id:"3DBrwMVTuR"}),symbol:"DHN"},{currencyCode:"SPX",type:"crypto",currency:W({defaultMessage:"SPX",id:"78Gbn14660"}),symbol:"SPX"},{currencyCode:"XDC",type:"crypto",currency:W({defaultMessage:"XDC Network",id:"f4v54xCFpd"}),symbol:"XDC"},{currencyCode:"ENA",type:"crypto",currency:W({defaultMessage:"ENA",id:"G6NRdu/3/f"}),symbol:"ENA"},{currencyCode:"SOLVBTCBBN",type:"crypto",currency:W({defaultMessage:"SOLVBTCBBN",id:"U+VGyLBIbO"}),symbol:"SOLVBTCBBN"},{currencyCode:"LDO",type:"crypto",currency:W({defaultMessage:"Lido DAO",id:"Hm40klV7dx"}),symbol:"LDO"},{currencyCode:"INJ",type:"crypto",currency:W({defaultMessage:"Injective",id:"Zy5gqTZCK/"}),symbol:"INJ"},{currencyCode:"USD0",type:"crypto",currency:W({defaultMessage:"USD0",id:"I8k7Is+SUX"}),symbol:"USD0"},{currencyCode:"FLR",type:"crypto",currency:W({defaultMessage:"Flare",id:"EuWzA+LwQr"}),symbol:"FLR"},{currencyCode:"PY",type:"crypto",currency:W({defaultMessage:"PY",id:"2WmUk53rca"}),symbol:"PY"},{currencyCode:"SEI",type:"crypto",currency:W({defaultMessage:"Sei",id:"uIVFPKXueM"}),symbol:"SEI"},{currencyCode:"MSOL",type:"crypto",currency:W({defaultMessage:"Marinade Staked SOL",id:"Sgo9VGem0+"}),symbol:"mSOL"},{currencyCode:"CRV",type:"crypto",currency:W({defaultMessage:"Curve DAO Token",id:"hv2sTxuyJY"}),symbol:"CRV"},{currencyCode:"FTM",type:"crypto",currency:W({defaultMessage:"Fantom",id:"FdV4Gc/fz2"}),symbol:"FTM"},{currencyCode:"FLOKI",type:"crypto",currency:W({defaultMessage:"FLOKI",id:"d2sPiyXVq8"}),symbol:"FLOKI"},{currencyCode:"CMETH",type:"crypto",currency:W({defaultMessage:"CMETH",id:"ZXQlnD2obl"}),symbol:"CMETH"},{currencyCode:"SLISBNB",type:"crypto",currency:W({defaultMessage:"SLISBNB",id:"wqx7ZL4lbr"}),symbol:"SLISBNB"},{currencyCode:"FARTCOIN",type:"crypto",currency:W({defaultMessage:"FARTCOIN",id:"qFlNIb5L+O"}),symbol:"FARTCOIN"},{currencyCode:"EETH",type:"crypto",currency:W({defaultMessage:"eETH",id:"tCrC5owpVn"}),symbol:"eETH"},{currencyCode:"KAIA",type:"crypto",currency:W({defaultMessage:"KAIA",id:"fDXZE/gzgq"}),symbol:"KAIA"},{currencyCode:"GRT",type:"crypto",currency:W({defaultMessage:"The Graph",id:"oFrVNds2cX"}),symbol:"GRT"},{currencyCode:"IMX",type:"crypto",currency:W({defaultMessage:"Immutable",id:"+0mthqqK1s"}),symbol:"IMX"},{currencyCode:"WIF",type:"crypto",currency:W({defaultMessage:"WIF",id:"tK0cRtUi/S"}),symbol:"WIF"},{currencyCode:"RAY",type:"crypto",currency:W({defaultMessage:"Raydium",id:"pSdm2ZTXHD"}),symbol:"RAY"},{currencyCode:"OP",type:"crypto",currency:W({defaultMessage:"Optimism",id:"ghDrrz64nC"}),symbol:"OP"},{currencyCode:"XAUT",type:"crypto",currency:W({defaultMessage:"Tether Gold",id:"pobzwuxAfg"}),symbol:"XAUT"},{currencyCode:"PENDLE",type:"crypto",currency:W({defaultMessage:"Pendle",id:"z8diWExCd3"}),symbol:"PENDLE"}],zu=(e,t="default")=>{if(!e)return"";const n=t==="indian"?"en-IN":"en-US",r=new Intl.NumberFormat(n,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:100}),s=e.endsWith("."),o=e.split("."),a=o[0]||"0",i=o[1]||"",c=parseFloat(e);if(isNaN(c))return"";let f=r.format(parseFloat(a));return o.length>1?f+="."+i:s&&(f+="."),f},Aae=A.memo(({value:e,onChange:t,placeholder:n="0",disabled:r=!1,className:s="",min:o,max:a,step:i=1,formatting:c="default"})=>{const u=d.useRef(null),[f,m]=d.useState(zu(e,c)),p=d.useCallback(x=>x.replace(/,/g,""),[]),h=d.useCallback(x=>{const v=x.target.value,b=p(v),_=x.target.selectionStart||0;if(b===""||/^\d*\.?\d*$/.test(b)&&!/e/i.test(v)){const w=zu(b,c);m(w),t(b),requestAnimationFrame(()=>{if(u.current){const S=v.substring(0,_),C=p(S);let E=0,T=0;const k=C.replace(".","").length,I=C.includes(".")&&C.endsWith(".");for(let M=0;M{const v=u.current;if(!v||(x.metaKey||x.ctrlKey)&&(x.key==="z"||x.key==="Z"))return;const{selectionStart:b,selectionEnd:_,value:w}=v;if(x.key==="ArrowUp"||x.key==="ArrowDown"){x.preventDefault();const S=parseFloat(p(e))||0,C=x.key==="ArrowUp"?i:-i;let E=S+C;o!==void 0&&Ea&&(E=a);const T=E.toString(),k=zu(T,c);m(k),t(T);return}if(x.key==="Backspace"&&b===_){if(b===null)return;if(w[b-1]===","){x.preventDefault();const C=w.substring(0,b-1),E=w.substring(b),T=C[C.length-1];if(T&&/\d/.test(T)){const k=C.slice(0,-1)+E,I=p(k),M=zu(I,c);m(M),t(I),setTimeout(()=>{const N=M.length-p(E).length;v.setSelectionRange(N,N)},0)}}}},[p,t,e,i,o,a,c]),y=d.useCallback(x=>{x.preventDefault();const v=x.clipboardData.getData("text"),b=p(v);if(/^\d*\.?\d*$/.test(b)&&!/e/i.test(v)){const _=zu(b,c);m(_),t(b)}},[p,t,c]);return A.useEffect(()=>{const x=zu(e,c);m(x)},[e,c]),l.jsx("input",{ref:u,type:"text",value:f,onChange:h,onKeyDown:g,onPaste:y,placeholder:n,disabled:r,className:s,inputMode:"decimal"})});Aae.displayName="CurrencyInput";const Xg=A.memo(({symbol:e,src:t,srcDark:n,className:r,size:s="lg",colorScheme:o})=>{n=n??t;const[a,i]=d.useState(!1),c=d.useRef(null),u=Ss(),f=o??u.colorScheme,m=()=>{c.current&&c.current.naturalHeight>0&&i(!1)};d.useEffect(()=>{c.current&&(c.current.complete&&c.current.naturalHeight===0?i(!0):i(!1))},[c]),d.useEffect(()=>{i(!1)},[e]);const p=f==="dark"?n:t;return l.jsx("div",{className:z({"size-lg":s==="lg","size-md":s==="md","size-sm":s==="sm"},"flex shrink-0 items-center justify-center",r),children:a||!p?l.jsx(Sot,{symbol:e}):l.jsx("img",{ref:c,src:p,alt:e,className:"size-full rounded-[4px] object-contain",onError:()=>{i(!0)},onLoad:m},e)})});Xg.displayName="FinanceAssetLogo";const Sot=({symbol:e})=>{const t=d.useMemo(()=>e.replace(/[^a-zA-Z0-9]/g,"").slice(0,1).toUpperCase(),[e]);return l.jsx(K,{variant:"subtle",className:"flex size-full items-center justify-center rounded-full",children:l.jsx(V,{color:"light",children:l.jsx("span",{className:"font-mono opacity-70",children:t||l.jsx(ut,{name:B("coin"),className:"size-4 text-gray-100 opacity-50"})})})})},Eot=(e,t)=>{if(!e?.id)return!1;const{status:n,...r}=e,{status:s,...o}=t;return Cr(r,o)&&n!==s},VN=d.memo(({open:e,onClose:t,initialConfiguration:n,onSave:r,source:s,trackEvent:o,errorMessage:a,canEditSpace:i,canDelete:c})=>{const u=J(),{$t:f}=u,m=ui(),p="automation-modal",[h,g]=d.useState(!1),[y,x]=d.useState(null),[v,b]=d.useState(!1),_=d.useCallback(()=>{x(null),t()},[t]),{currentConfiguration:w,setCurrentConfiguration:S,onClickSave:C,onClickDelete:E,isLoading:T,isSaveDisabled:k,saveButtonTooltipText:I}=nKe({initialConfiguration:n,isModalOpened:e,reason:p,source:s,onSuccess:R=>{let P=R;R==="updated"&&Eot(n,w)&&(P=w.status==="PAUSED"?"paused":"resumed"),r?.(P),_(),g(P)},onError:x});d.useEffect(()=>{e&&(dk(s)?o?.("task modal opened",{source:s}):LP(s)?o?.("price alert modal opened",{source:s}):FP(s)&&o?.("shortcut modal opened",{source:s}))},[e,s,o]);const M=d.useMemo(()=>{const R=[];return w.id&&c&&R.push({text:f({defaultMessage:"Delete",id:"K3r6DQW7h+"}),variant:"rejecter",onClick:E,disabled:T}),R.push({text:f({defaultMessage:"Cancel",id:"47FYwba+bI"}),variant:"common",onClick:_}),R.push({text:f({defaultMessage:"Save",id:"jvo0vs3nF0"}),variant:"primary",onClick:C,disabled:k,tooltipText:I}),R},[f,c,w.id,T,k,E,C,_,I]),N=d.useCallback(R=>{const P=R?"ACTIVE":"PAUSED",L=P==="PAUSED"?"paused":"resumed";switch(S({...w,status:P}),w.trigger.type){case Ze.SCHEDULED:dk(s)&&hre(L)&&o?.("task modal action",{source:s,action:L});break;case Ze.PRICE_ALERT:LP(s)&&Jqe(L)&&o?.("price alert modal action",{source:s,action:L});break;case Ze.SHORTCUT:FP(s)&&tKe(L)&&o?.("shortcut modal action",{source:s,action:L});break;default:At(w.trigger)}},[w,S,s,o]),D=d.useMemo(()=>{if(!w.id||w.trigger.type===Ze.PRICE_ALERT)return null;const R=w.status!=="PAUSED";return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fg,{checked:R,onCheckedChange:N,disabled:T,"aria-label":f({defaultMessage:"Toggle automation status",id:"1IPeYXLNjx"})}),l.jsx("span",{children:f(R?{defaultMessage:"Active",id:"3a5wL8wo40"}:{defaultMessage:"Paused",id:"C2iTEHtK//"})})]})},[f,w.id,w.status,w.trigger.type,N,T]),j=d.useCallback(R=>{const P=y4(R);S(P)},[S]),F=d.useCallback(()=>{g(!1)},[]);return d.useEffect(()=>{n&&!v&&e&&(j(n),b(!0))},[j,v,n,e]),d.useEffect(()=>{e||b(!1)},[e]),l.jsxs(l.Fragment,{children:[l.jsx(po,{isOpen:e,onClose:_,title:Lye({intl:u,triggerType:w.trigger.type}),titleTextVariant:"base",footerContent:D,actionList:M,footerClassname:"!pt-4",wrapperClassname:"!w-full",variant:m?"bottom-sheet":"default",children:l.jsx(mb,{configuration:w,onConfigurationChange:j,errorMessage:(a||y)??void 0,onError:x,canEditSpace:i})}),l.jsx(qc,{message:h?Fye({intl:u,triggerType:w.trigger.type,actionPerformed:h}):"",variant:"success",isVisible:!!h,handleClose:F,timeout:null})]})});VN.displayName="AutomationModal";const kot=Object.freeze(Object.defineProperty({__proto__:null,AutomationModal:VN},Symbol.toStringTag,{value:"Module"})),Mot=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-price-alerts-ui-redesign",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Tot=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-settings-ui-redesign",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},Aot=(e,t)=>{const n={selectedOption:"price",priceValue:"",percentValue:ob,positiveSelected:!0,negativeSelected:!0,additionalInstructions:"",selectedSymbol:t??null,inputValue:t??""};if(!e)return n;const{subscription:r,prompt:s}=e,o=r?cee({prompt:s,symbol:r.event_entity}):sBe(s).additionalInstructions,a={...n,additionalInstructions:o};if(!r)return a;const{event_type:i,value_lower_bound:c,value_upper_bound:u,event_entity:f}=r;if(a.selectedSymbol=f??null,a.inputValue=f??"",i==="STOCK_PRICE_TARGET")a.selectedOption="price",u&&u!==Bl?a.priceValue=`$${u}`:c&&c!==Ul&&(a.priceValue=`$${c}`);else if(i==="STOCK_PRICE_MOVEMENT"){a.selectedOption="movement";const m=u!=null&&u!==Bl,p=c!=null&&c!==Ul;a.positiveSelected=m,a.negativeSelected=p,m?a.percentValue=`${u}`:p&&(a.percentValue=`${Math.abs(c)}`)}return a},HN=A.memo(({symbol:e,buttonProps:t,watchlistAddedForSymbol:n,modalOpenedSource:r})=>{const{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useMemo(()=>{try{return decodeURIComponent(e.toUpperCase())}catch{return e.toUpperCase()}},[e]),{data:i,isLoading:c}=mt({queryKey:be.makeEphemeralQueryKey("getFinanceTicker",a),queryFn:()=>k9e({ticker:a,reason:"finance-ticker-supported-check"}),staleTime:1/0}),[u,f]=d.useState(!1),{isMobileStyle:m}=Re(),{$t:p}=J(),h=!!i?.supported,g=!!(i?.supported&&n),y=n?`finance-alert-watchlist-${a}`:"finance-alert-page-visit",x=(h||g)&&!u,{variation:v,loading:b}=Tot(!1),{variation:_,loading:w}=Mot(!1),S=d.useCallback(()=>f(!1),[]),C=d.useCallback(()=>{o("price alert modal opened",{source:r}),f(!0)},[r,o]);return c||!i?.supported||b||w?null:l.jsxs(l.Fragment,{children:[l.jsx(bv,{cueKey:y,title:p({defaultMessage:"Set an alert for {ticker}",id:"bb+ueMBxHa"},{ticker:a}),enabled:x,placement:"bottom",size:"sm",children:m?l.jsx(wt,{size:"small",variant:"text",icon:B("bell-bolt"),onClick:C,"aria-label":p({id:"hrmMcFoV7/",defaultMessage:"Price Alert"}),rounded:t?.pill}):l.jsx(wt,{size:"small",variant:"text",leadingIcon:B("bell-bolt"),onClick:C,pill:t?.pill,children:p({id:"hrmMcFoV7/",defaultMessage:"Price Alert"})})},y),v&&_?l.jsx(VN,{open:u,onClose:S,source:"settings_create",initialConfiguration:zye({symbol:e}),canEditSpace:!1,canDelete:!0}):l.jsx(Tb,{isOpen:u,onClose:S,symbol:a})]})});HN.displayName="FinanceAddAlertIfSupported";const Tb=A.memo(({isOpen:e,onClose:t,symbol:n,task:r})=>{const s=Rn(),{openToast:o}=hn(),a=!!r,[i,c]=d.useState(null),[u,f]=d.useState("price"),{isMobileStyle:m}=Re(),[p,h]=d.useState(""),{$t:g}=J(),[y,x]=d.useState(n??null),[v,b]=d.useState(!1),{data:_}=mt({queryKey:Kne(y),queryFn:()=>qne(y),enabled:!!y&&e,refetchInterval:5*1e3}),[w,S]=d.useState(""),[C,E]=d.useState(""),[T,k]=d.useState(!0),[I,M]=d.useState(!0),N=d.useMemo(()=>{if(u!=="price"||!_?.price)return;const le=parseFloat(w.replace(/[^0-9.]/g,""));if(!(isNaN(le)||le===_.price))return le>_.price?"above":"below"},[w,_?.price,u]),D=d.useCallback(()=>{b(!1),x(n??null)},[n]),{createMutation:j,updateMutation:F,deleteMutation:R}=pre({onCreateSuccess:()=>{t(),b(!1),D(),o({message:g({defaultMessage:"Price alert created",id:"YccmIRCItP"}),variant:"success",timeout:3,ctaText:g({defaultMessage:"Manage Alerts",id:"t6akfMv9BC"}),ctaOnClick:()=>{s.push("/account/tasks?tab=alerts")}})},onCreateError:()=>{o({message:g({defaultMessage:"Failed to create price alert",id:"vkLT4iLR3O"}),variant:"error",timeout:3,description:g({defaultMessage:"Please try again",id:"fHqssj/1KO"})}),b(!1)},onUpdateSuccess:()=>{t(),b(!1),D(),o({message:g({defaultMessage:"Price alert updated",id:"wTPvmuiyuE"}),variant:"success",timeout:3,ctaText:g({defaultMessage:"Manage Alerts",id:"t6akfMv9BC"}),ctaOnClick:()=>{s.push("/account/tasks?tab=alerts")}})},onUpdateError:()=>{o({message:g({defaultMessage:"Failed to update price alert",id:"Fpz5cXYABV"}),variant:"error",timeout:3,description:g({defaultMessage:"Please try again",id:"fHqssj/1KO"})}),b(!1)},onDeleteSuccess:()=>{t()}}),P=d.useCallback(()=>{t(),D()},[t,D]),L=d.useCallback(()=>{r&&R.mutate(r.id)},[r,R]),U=NE({selectedSymbol:y,symbol:n,quote:_,alertType:"price",priceValue:w,$t:g}),O=NE({selectedSymbol:y,symbol:n,quote:_,alertType:"movement",percentValue:C,$t:g}),$=U.baseInstructions,G=U.displayInstructions,H=O.baseInstructions,Q=O.displayInstructions;d.useEffect(()=>{if(e){const le=Aot(r,n);c(le),f(le.selectedOption),S(le.priceValue),E(le.percentValue),k(le.positiveSelected),M(le.negativeSelected),h(le.additionalInstructions),x(le.selectedSymbol)}else c(null),D()},[e,r,n,D]);const{locale:Y}=J();d.useEffect(()=>{if(a&&_?.currency&&w&&w.startsWith("$")){const le=sb(_.currency,Y);le!=="$"&&S(w.replace("$",le))}},[a,_?.currency,Y,w]);const te=d.useCallback(()=>{b(!0);const le=y??n;if(!le){b(!1);return}const ce=RE({symbol:le,alertType:u,priceValue:w,priceThreshold:N,percentValue:C,positiveSelected:T,negativeSelected:I,baseInstructions:u==="price"?$:H,additionalInstructions:p});if(!ce){b(!1);return}a&&r?F.mutate({taskId:r.id,payload:ce}):j.mutate(ce)},[a,r,y,n,u,w,N,C,T,I,p,$,H,j,F]),se=d.useMemo(()=>{if(!a||!i)return!0;const le={selectedOption:u,priceValue:w,percentValue:C,positiveSelected:T,negativeSelected:I,additionalInstructions:p,selectedSymbol:y},{inputValue:re,...ce}=i;return!Cr(le,ce)},[a,i,u,w,C,T,I,p,y]),ae=d.useMemo(()=>{const le=w.replace(/[^0-9.]/g,""),re=C.replace("%","");return u==="price"?!y||!le||!N:!y||!re},[y,u,w,C,N]),X=d.useMemo(()=>ae||!se,[ae,se]),ee=d.useMemo(()=>[{text:g({id:"47FYwba+bI",defaultMessage:"Cancel"}),onClick:P,variant:"secondary"},{text:g(a?{id:"KjhtiKJItq",defaultMessage:"Edit Alert"}:{id:"KHrQobwBBl",defaultMessage:"Add Alert"}),onClick:te,variant:"primary",disabled:a?X:ae,isLoading:v}],[te,g,ae,v,P,a,X]);return l.jsxs(po,{isOpen:e,onClose:t,title:g({id:"hrmMcFoV7/",defaultMessage:"Price Alert"}),variant:m?"bottom-sheet":"default",children:[l.jsx("div",{className:"gap-md flex min-h-[60vh] flex-col md:min-h-0",children:l.jsx(J6,{variant:"full",selectedSymbol:y,selectedOption:u,onSymbolChange:x,onOptionChange:f,showSymbolInput:!a,currentPrice:_?.price,priceValue:w,onPriceValueChange:S,percentValue:C,onPercentValueChange:E,positiveSelected:T,onPositiveChange:k,negativeSelected:I,onNegativeChange:M,additionalInstructions:p,onAdditionalInstructionsChange:h,displayPriceInstructions:G,displayMovementInstructions:Q,externalInputValue:i?.inputValue,currency:_?.currency??void 0})}),l.jsxs("div",{className:"mt-md flex w-full items-center justify-between",children:[l.jsx("div",{children:a&&l.jsx(wt,{variant:"secondary",onClick:L,isLoading:R.isPending,children:g({id:"K3r6DQW7h+",defaultMessage:"Delete"})})}),l.jsx("div",{className:"gap-sm md:-mb-md flex items-center",children:ee.map(le=>l.jsx(wt,{onClick:le.onClick,variant:le.variant,disabled:le.disabled,isLoading:le.isLoading,children:le.text},le.text))})]})]})});Tb.displayName="FinanceAlertModal";const Not=Object.freeze(Object.defineProperty({__proto__:null,FinanceAddAlertIfSupported:HN,FinanceAlertModal:Tb},Symbol.toStringTag,{value:"Module"})),Rot=(e,t)=>{const{value:n,loading:r}=zt({flag:"tasks-free-user-access-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])},zN=A.memo(({symbol:e,buttonProps:t,watchlistAddedForSymbol:n})=>{const{hasAccessToProFeatures:r}=$t(),{variation:s,loading:o}=Rot(!1);return o||!s&&!r?null:l.jsx(HN,{symbol:e,buttonProps:t,watchlistAddedForSymbol:n,modalOpenedSource:"finance_asset_page"})});zN.displayName="PriceAlertButton";const mL="pplx://www.pplx.com";function Ab({href:e,inApp:t,queryParams:n}){if(!t||e==null)return e;const r=new URL(e,mL);return n?.forEach((s,o)=>{r.searchParams.get(o)||r.searchParams.set(o,s??"")}),r.pathname.startsWith("/app")||(r.pathname.startsWith("/")?r.pathname=`/app${r.pathname}`:r.pathname=`/app/${r.pathname}`),r.href.replace(mL,"")}const Nae=()=>{const{scrollContainerRef:e}=ka();return d.useCallback(()=>{window.scrollTo({top:0,behavior:"instant"}),e?.current?.scrollTo({top:0,behavior:"instant"})},[e])},Zg=A.memo(({children:e,href:t,...n})=>{const{inApp:r}=Sa(),s=fn(),o=Nae(),a=d.useCallback(i=>{o(),n.onClick?.(i)},[o,n]);return l.jsx(yt,{...n,href:Ab({href:t,inApp:r,queryParams:s}),onClick:a,children:e})}),Dot=A.memo(e=>{const{inApp:t}=Sa(),n=fn(),{href:r,...s}=e;return l.jsx(qh,{...s,href:Ab({href:r,inApp:t,queryParams:n})??""})});Dot.displayName="CanonicalLinkAether";Zg.displayName="CanonicalLink";const jot=A.memo(e=>{const t=e.href??void 0;return t?l.jsx(Zg,{...e,href:t}):e.children});jot.displayName="CanonicalLinkMaybe";const Iot=({value:e,format:t,suffix:n,animated:r})=>{const[s,o]=d.useState(!1);return d.useEffect(()=>{r&&Number.isFinite(e)&&o(!0)},[r,e]),l.jsx(jp,{isolate:!0,value:e,format:t,suffix:n,animated:s})},Pot=!1,Nb=A.memo(({value:e,format:t,suffix:n,animated:r=Pot})=>{const{inApp:s}=Sa(),{locale:o}=J();return!r||s?l.jsxs("span",{children:[Intl.NumberFormat(o,t).format(e)," ",n]}):l.jsx(Iot,{value:e,format:t,suffix:n,animated:r})});Nb.displayName="FinanceNumberFlow";const Rb={ENTITY_CHIP:"entity_chip",SEARCH_WIDGET:"search_widget",CHART_COMPARISON:"chart_comparison",SEARCH_AUTOSUGGEST:"search_autosuggest"},Oot={PREDICTIONS_WIDGET:"predictions_widget"},Lot={ASSET_PAGE:"asset"},Jg={ASSET_PAGE:"asset"},H2=A.memo(({countryCode:e,square:t,...n})=>{const r=e??"NEU",s=t?`square/${r}`:r;return l.jsx("img",{src:`https://r2cdn.perplexity.ai/images/country_flags/${s}.svg`,alt:e??"NEU",...n})});H2.displayName="CountryFlag";const Fot={COMMODITY:"",FOREX:"FX",INDEX:"INDEX",CRYPTO:"CRYPTO"},hf=A.memo(({price:e,currency:t,sign:n,variant:r="small",className:s,animated:o})=>{const a=d.useMemo(()=>({style:t?"currency":"decimal",currency:t||void 0,minimumFractionDigits:e<1e3?2:0,maximumFractionDigits:Math.abs(e)<.01?void 0:2,signDisplay:n?"exceptZero":void 0}),[t,e,n]);return l.jsx(V,{variant:r,color:"light",className:s,children:l.jsx(Nb,{value:e,format:a,animated:o})})});hf.displayName="Price";const WN=({name:e,variant:t="smallBold",className:n})=>e?l.jsx(V,{variant:t,className:z("min-w-0 truncate leading-tight",n),as:"span",children:e}):null,e0=({symbol:e,exchange:t,country:n,gap:r="xs"})=>{const s=d.useMemo(()=>e&&decodeURIComponent(e).split(".")[0],[e]),o=d.useMemo(()=>t&&(Fot[t]??t),[t]);if(!s)return null;if(!o)return s;const a=n||null;return l.jsxs(ga,{className:z("whitespace-nowrap",{"gap-xs":r==="xs","gap-sm":r==="sm"}),children:[l.jsx(Bn,{id:"symbol",children:s}),l.jsx(Bn,{id:"exchange",children:o}),a&&l.jsx(Bn,{id:"country",children:l.jsxs("div",{className:"relative flex w-[1.2em] shrink-0 items-center",children:[l.jsx(H2,{countryCode:a}),l.jsx("div",{className:"absolute inset-0 border border-black/10 dark:border-0"})]})})]})},Rae=({symbol:e,children:t,className:n,referrer:r})=>{const{inApp:s}=Sa(),o=fn(),a=Ab({href:`/finance/${e}`,inApp:s,queryParams:o}),{session:i}=Ne(),{trackEvent:c}=Xe(i),u=Nae(),f=d.useCallback(()=>{u(),r&&c("finance link clicked",{referrer:r,targetPageType:Jg.ASSET_PAGE,symbol:e,destinationUrl:`/finance/${e}`})},[r,e,c,u]);return l.jsx(yt,{href:a,className:z("py-sm px-md hover:bg-subtler block duration-quick",n),onClick:f,children:t})},Bot=A.memo(({symbol:e,name:t,image:n,imageDark:r,exchange:s,country:o,children:a,colorScheme:i})=>{const{isMobileStyle:c}=Re(),{inApp:u}=Sa();return Rf("header"),l.jsxs(K,{className:"gap-md flex min-w-0 flex-col",children:[l.jsxs(K,{className:"gap-sm flex items-center justify-between",children:[l.jsxs("div",{className:"flex min-w-0 items-center justify-start gap-[12px]",children:[l.jsx(Xg,{src:n??"",srcDark:r??"",symbol:e??"",className:"!size-[40px]",colorScheme:i}),l.jsx(Fo,{content:t??"",disabled:!c,children:l.jsxs("div",{className:"truncate",children:[l.jsx(V,{variant:c?"section-title":"page-title",className:"min-w-0 truncate leading-tight",children:t}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e,exchange:s,gap:"xs",country:o})})]})})]}),u&&e&&l.jsx(zN,{symbol:e,buttonProps:{pill:!0}})]}),a]})});Bot.displayName="FinanceAssetHeader";const Rh=A.memo(({isScreenshotEnv:e})=>{const{$t:t}=J();return l.jsxs("div",{className:z("pointer-events-none flex items-center px-sm py-xs rounded-full shadow-[0_0_16px_8px_oklch(var(--background-base-color)/0.6)] dark:shadow-[0_0_16px_8px_oklch(var(--offset-color)/0.6)]",e?"bg-base":"bg-background/90 backdrop-blur-sm"),children:[l.jsx(V,{variant:"tiny",inline:!0,className:"mr-xs mt-px",children:t({defaultMessage:"Powered by",id:"U8QBHORZRD"})}),l.jsx(Gd,{variant:"full",size:"small"})]})});Rh.displayName="FinanceAssetWatermark";const ta=(e,t)=>{if(e==null||e===void 0)return null;const n=2;let r=Math.min(n,t.maxDecimals??n);const s=Math.min(n,t.maxDecimals??n);return e>1e5&&(r=1),e.toLocaleString(t.locale,{style:t.currency?"currency":"decimal",notation:"compact",currency:t.currency,minimumFractionDigits:r,maximumFractionDigits:s})};function pL(e,t,n,r){return e==null||t==null?null:r({defaultMessage:"{low}-{high}",id:"sOdwcvTtKN"},{low:ta(e,n),high:ta(t,n)})}const hL=(e,t,n)=>e==null||e===void 0?null:e.toLocaleString(t.locale,{style:"decimal",notation:"compact",...n});function Uot(e,t=6){if(e===0)return{minimumFractionDigits:0,maximumFractionDigits:1};let n=0,r=2;if(e!==0&&Math.abs(e)<1){let s=0,o=Math.abs(e);for(;o<1&&s{if(e==null||e===void 0)return null;let{minimumFractionDigits:r,maximumFractionDigits:s}=Uot(e,6);return r=r,s=s,r>s&&(s=r),e*100>.001&&(r=2,s=2),e===0?"—":e.toLocaleString(t.locale,{style:"percent",...n,minimumFractionDigits:r,maximumFractionDigits:s})},Vot={previousClose:e=>ta(e.d.previousClose,e),open:e=>ta(e.d.open,e),dayRange:e=>pL(e.d.dayLow,e.d.dayHigh,e,e.$t),yearRange:e=>pL(e.d.yearLow,e.d.yearHigh,e,e.$t),eps:e=>ta(e.d.eps,e),dayHigh:e=>ta(e.d.dayHigh,e),dayLow:e=>ta(e.d.dayLow,e),marketCap:e=>ta(e.d.marketCap,e),pe:e=>{const t=e.d.pe;return t&&t<0?"—":hL(t,e,{minimumFractionDigits:2})},dividendYieldTTM:e=>_C(e.d.dividendYieldTTM,e),volume:e=>hL(e.d.volume,e),dollarVolume24h:e=>ta(e.d.dollarVolume24h,e),volumeChange24h:e=>_C(e.d.volumeChange24h,e),yearHigh:e=>ta(e.d.yearHigh,e),yearLow:e=>ta(e.d.yearLow,e),fundingRate:e=>_C(e.d.fundingRate?+e.d.fundingRate*100:null,e)};function Hot({quote:e,currency:t,locale:n,$t:r}){return(e.uiHints?.tableFields??[]).map(a=>{const i=Vot[a];if(!i)return null;const c=i({d:e,locale:n,currency:t,$t:r});return c==null?null:{value:c,label:a,id:a}}).filter(a=>a!==null)}const GN=(e="sm")=>{const[t,n]=d.useState(e);d.useEffect(()=>{const c=()=>{window.innerWidth>=1536?n("2xl"):window.innerWidth>=1280?n("xl"):window.innerWidth>=1024?n("lg"):window.innerWidth>=768?n("md"):window.innerWidth>=640&&n("sm")};return window.addEventListener("resize",c),c(),()=>window.removeEventListener("resize",c)},[]);const r=!0,s=["md","lg","xl","2xl"].includes(t),o=["lg","xl","2xl"].includes(t),a=["xl","2xl"].includes(t),i=["2xl"].includes(t);return d.useMemo(()=>({breakpoint:t,isSmallScreen:r,isMediumScreen:s,isLargeScreen:o,isXLargeScreen:a,is2XLargeScreen:i}),[t,i,o,s,r,a])},zot=({dt:e,dd:t,id:n})=>{const{isMobileStyle:r}=Re(),{breakpoint:s}=GN(),o=["md","sm"].includes(s)&&r;return l.jsxs("div",{className:"gap-x-sm py-xs px-sm md:p-sm bg-raised flex flex-col gap-y-0.5 whitespace-nowrap md:flex-row md:justify-between",children:[l.jsx("dt",{children:l.jsx(V,{variant:o?"micro":"small",color:"light",children:e})}),l.jsx("dd",{children:l.jsx(V,{variant:o?"tiny":"smallBold",children:t})})]},n)},gL=({children:e})=>l.jsx(K,{variant:"background",children:e}),Dae=A.memo(({entries:e,context:t})=>{const n=(3-e.length%3)%3,r=t==="thread",s=t==="canonical"||t==="thread";return l.jsx("div",{className:"scrollbar-subtle overflow-x-auto",children:l.jsxs(K,{className:z("grid grid-cols-3 gap-px",r?"w-full":"min-w-max",s&&"border-x-0"),variant:"subtler",children:[e.map(({label:o,value:a})=>l.jsx(gL,{children:l.jsx(zot,{dt:o,dd:a,id:o})},o)),Array.from({length:n}).map((o,a)=>l.jsx(gL,{},a))]})})});Dae.displayName="FinanceGenericTable";const Wot=He({finance:{defaultMessage:"Finance",id:"Fm3M+yFIbr"},analysis:{defaultMessage:"Analysis",id:"VMIM8/fAKn"},companyOverview:{defaultMessage:"Overview",id:"9uOFF3L8kp"},balanceSheet:{defaultMessage:"Balance Sheet",id:"ak91fL/u+x"},incomeStatement:{defaultMessage:"Income Statement",id:"HFT+V86brH"},keyStats:{defaultMessage:"Key Stats",id:"0FPlBr741P"},cashFlow:{defaultMessage:"Cash Flow",id:"mtw9A2k000"},date:{defaultMessage:"Date",id:"P7PLVjLe4f"},marketSummary:{defaultMessage:"Market Summary",id:"/4s4TMc/a+"},price:{defaultMessage:"Price",id:"b1zuN9KTHI"},symbol:{defaultMessage:"Symbol",id:"3HepmQoEZ+"},value:{defaultMessage:"Value",id:"GufXy52FNI"},percentage:{defaultMessage:"Percentage",id:"HyMpO2UIBG"},currency:{defaultMessage:"Currency",id:"55hdQy4uHO"},open:{defaultMessage:"Open",id:"JfG49wNHKP"},dayHigh:{defaultMessage:"High",id:"AxMhQrcUDC"},dayLow:{defaultMessage:"Low",id:"477I0ggSYe"},marketCap:{defaultMessage:"Market Cap",id:"9Mp3OYduig"},pe:{defaultMessage:"P/E Ratio",id:"fWnwRImZ9W"},volume24h:{defaultMessage:"24H Volume",id:"w7Tm/B63El"},dollarVolume24h:{defaultMessage:"24H Volume",id:"w7Tm/B63El"},volumeChange24h:{defaultMessage:"24H Volume Change",id:"CndnNLlEs+"},fundingRate:{defaultMessage:"Funding Rate",id:"CB1174SKrI"},volume:{defaultMessage:"Volume",id:"y867VsgbzT"},yearHigh:{defaultMessage:"Year High",id:"yh2gWeU/Gz"},yearLow:{defaultMessage:"Year Low",id:"fZpEs5CIaC"},avgVolume:{defaultMessage:"Avg. Volume",id:"MDNqWO8yDU"},dayRange:{defaultMessage:"Day Range",id:"6VJrMyvXcR"},yearRange:{defaultMessage:"52W Range",id:"FkJo44zhH6"},eps:{defaultMessage:"EPS",id:"JncK2a8+G4"},dividendYieldTTM:{defaultMessage:"Dividend Yield",id:"P3CiJnt5+6"},dividendYielTTM:{defaultMessage:"Dividend Yield",id:"P3CiJnt5+6"},previousClose:{defaultMessage:"Prev Close",id:"0jUP9zUh5z"},priceComparison:{defaultMessage:"Price Comparison",id:"MFuchsfwj7"},stockPerformance:{defaultMessage:"Stock Performance",id:"qEQxp1ikMt"},companyFinancials:{defaultMessage:"{company} Financials",id:"gWNvqjwoWh"},"13FFilings":{defaultMessage:"13F Filings",id:"XzGhyAgjmS"},pricePerformance:{defaultMessage:"Price & Performance",id:"nCv3Ti2cp5"},peers:{defaultMessage:"Peers",id:"JjgJTAa2wL"},transcriptLogin:{defaultMessage:"Login to view transcripts from {quartr}",id:"xY8csKCosL"},newsAndMarketInsights:{defaultMessage:"Latest News",id:"BlFeZAX10O"},recentTranscripts:{defaultMessage:"Recent Transcripts",id:"tiSu9ozyS4"},earnings:{defaultMessage:"Earnings",id:"14sEVuq+Kb"},related:{defaultMessage:"Related",id:"KQsZBWlEw/"},topMovers:{defaultMessage:"Top Movers",id:"e+JmwAUicC"}}),Got=(e,t)=>{if(!t)return"";const n=Wot[t];return n?e(n):""},jae=A.memo(({quote:e,context:t})=>{const{$t:n,locale:r}=J(),s=d.useMemo(()=>e?Hot({quote:e,currency:e?.currency||void 0,locale:r,$t:n}).map(a=>({...a,label:Got(n,a.label),value:a.value})):[],[e,n,r]);return Rf("financial-profile",{skip:!s.length}),l.jsx(K,{"data-testid":"financial-profile-box",variant:"subtle",noBorder:!0,className:z("overflow-hidden border-t border-subtlest",{"border-x-0":t==="canonical"||t==="thread","rounded-none":t==="thread","border-b rounded-b-xl":t!=="thread"}),children:l.jsx(Dae,{entries:s,context:t})})});jae.displayName="FinanceFinancialProfile";const Dh=30,$ot=({isMobileStyle:e,threshold:t=700})=>{const n=d.useRef(null),[r,s]=d.useState("lg");return d.useEffect(()=>{const a=n.current;if(!a)return;const i=()=>{const u=a.clientWidth;s(u{i()});return c.observe(a),()=>{c.disconnect()}},[t]),{variant:e?"sm":r,containerRef:n}};var Bk=Math.PI,Uk=2*Bk,bc=1e-6,qot=Uk-bc;function Vk(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ho(){return new Vk}Vk.prototype=ho.prototype={constructor:Vk,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,s,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+s)+","+(this._y1=+o)},arcTo:function(e,t,n,r,s){e=+e,t=+t,n=+n,r=+r,s=+s;var o=this._x1,a=this._y1,i=n-e,c=r-t,u=o-e,f=a-t,m=u*u+f*f;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(m>bc)if(!(Math.abs(f*i-c*u)>bc)||!s)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var p=n-o,h=r-a,g=i*i+c*c,y=p*p+h*h,x=Math.sqrt(g),v=Math.sqrt(m),b=s*Math.tan((Bk-Math.acos((g+m-y)/(2*x*v)))/2),_=b/v,w=b/x;Math.abs(_-1)>bc&&(this._+="L"+(e+_*u)+","+(t+_*f)),this._+="A"+s+","+s+",0,0,"+ +(f*p>u*h)+","+(this._x1=e+w*i)+","+(this._y1=t+w*c)}},arc:function(e,t,n,r,s,o){e=+e,t=+t,n=+n,o=!!o;var a=n*Math.cos(r),i=n*Math.sin(r),c=e+a,u=t+i,f=1^o,m=o?r-s:s-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+u:(Math.abs(this._x1-c)>bc||Math.abs(this._y1-u)>bc)&&(this._+="L"+c+","+u),n&&(m<0&&(m=m%Uk+Uk),m>qot?this._+="A"+n+","+n+",0,1,"+f+","+(e-a)+","+(t-i)+"A"+n+","+n+",0,1,"+f+","+(this._x1=c)+","+(this._y1=u):m>bc&&(this._+="A"+n+","+n+",0,"+ +(m>=Bk)+","+f+","+(this._x1=e+n*Math.cos(s))+","+(this._y1=t+n*Math.sin(s))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function nn(e){return function(){return e}}var yL=Math.abs,Jr=Math.atan2,gc=Math.cos,Kot=Math.max,wC=Math.min,Da=Math.sin,hd=Math.sqrt,As=1e-12,jh=Math.PI,z2=jh/2,Ny=2*jh;function Yot(e){return e>1?0:e<-1?jh:Math.acos(e)}function xL(e){return e>=1?z2:e<=-1?-z2:Math.asin(e)}function Qot(e){return e.innerRadius}function Xot(e){return e.outerRadius}function Zot(e){return e.startAngle}function Jot(e){return e.endAngle}function eat(e){return e&&e.padAngle}function tat(e,t,n,r,s,o,a,i){var c=n-e,u=r-t,f=a-s,m=i-o,p=m*c-f*u;if(!(p*pj*j+F*F&&(T=I,k=M),{cx:T,cy:k,x01:-f,y01:-m,x11:T*(s/S-1),y11:k*(s/S-1)}}function nat(){var e=Qot,t=Xot,n=nn(0),r=null,s=Zot,o=Jot,a=eat,i=null;function c(){var u,f,m=+e.apply(this,arguments),p=+t.apply(this,arguments),h=s.apply(this,arguments)-z2,g=o.apply(this,arguments)-z2,y=yL(g-h),x=g>h;if(i||(i=u=ho()),pAs))i.moveTo(0,0);else if(y>Ny-As)i.moveTo(p*gc(h),p*Da(h)),i.arc(0,0,p,h,g,!x),m>As&&(i.moveTo(m*gc(g),m*Da(g)),i.arc(0,0,m,g,h,x));else{var v=h,b=g,_=h,w=g,S=y,C=y,E=a.apply(this,arguments)/2,T=E>As&&(r?+r.apply(this,arguments):hd(m*m+p*p)),k=wC(yL(p-m)/2,+n.apply(this,arguments)),I=k,M=k,N,D;if(T>As){var j=xL(T/m*Da(E)),F=xL(T/p*Da(E));(S-=j*2)>As?(j*=x?1:-1,_+=j,w-=j):(S=0,_=w=(h+g)/2),(C-=F*2)>As?(F*=x?1:-1,v+=F,b-=F):(C=0,v=b=(h+g)/2)}var R=p*gc(v),P=p*Da(v),L=m*gc(w),U=m*Da(w);if(k>As){var O=p*gc(b),$=p*Da(b),G=m*gc(_),H=m*Da(_),Q;if(yAs?M>As?(N=b1(G,H,R,P,p,M,x),D=b1(O,$,L,U,p,M,x),i.moveTo(N.cx+N.x01,N.cy+N.y01),MAs)||!(S>As)?i.lineTo(L,U):I>As?(N=b1(L,U,O,$,m,-I,x),D=b1(R,P,G,H,m,-I,x),i.lineTo(N.cx+N.x01,N.cy+N.y01),I=p;--h)i.point(b[h],_[h]);i.lineEnd(),i.areaEnd()}x&&(b[m]=+e(y,m,f),_[m]=+n(y,m,f),i.point(t?+t(y,m,f):b[m],r?+r(y,m,f):_[m]))}if(v)return i=null,v+""||null}function u(){return KN().defined(s).curve(a).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:nn(+f),t=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:nn(+f),c):e},c.x1=function(f){return arguments.length?(t=f==null?null:typeof f=="function"?f:nn(+f),c):t},c.y=function(f){return arguments.length?(n=typeof f=="function"?f:nn(+f),r=null,c):n},c.y0=function(f){return arguments.length?(n=typeof f=="function"?f:nn(+f),c):n},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:nn(+f),c):r},c.lineX0=c.lineY0=function(){return u().x(e).y(n)},c.lineY1=function(){return u().x(e).y(r)},c.lineX1=function(){return u().x(t).y(n)},c.defined=function(f){return arguments.length?(s=typeof f=="function"?f:nn(!!f),c):s},c.curve=function(f){return arguments.length?(a=f,o!=null&&(i=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=i=null:i=a(o=f),c):o},c}function sat(e,t){return te?1:t>=e?0:NaN}function oat(e){return e}function aat(){var e=oat,t=sat,n=null,r=nn(0),s=nn(Ny),o=nn(0);function a(i){var c,u=i.length,f,m,p=0,h=new Array(u),g=new Array(u),y=+r.apply(this,arguments),x=Math.min(Ny,Math.max(-Ny,s.apply(this,arguments)-y)),v,b=Math.min(Math.abs(x)/u,o.apply(this,arguments)),_=b*(x<0?-1:1),w;for(c=0;c0&&(p+=w);for(t!=null?h.sort(function(S,C){return t(g[S],g[C])}):n!=null&&h.sort(function(S,C){return n(i[S],i[C])}),c=0,m=p?(x-u*_)/p:0;c0?w*m:0)+_,g[f]={data:i[f],index:c,value:w,startAngle:y,endAngle:v,padAngle:b};return g}return a.value=function(i){return arguments.length?(e=typeof i=="function"?i:nn(+i),a):e},a.sortValues=function(i){return arguments.length?(t=i,n=null,a):t},a.sort=function(i){return arguments.length?(n=i,t=null,a):n},a.startAngle=function(i){return arguments.length?(r=typeof i=="function"?i:nn(+i),a):r},a.endAngle=function(i){return arguments.length?(s=typeof i=="function"?i:nn(+i),a):s},a.padAngle=function(i){return arguments.length?(o=typeof i=="function"?i:nn(+i),a):o},a}var iat=Oae(nu);function Pae(e){this._curve=e}Pae.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function Oae(e){function t(n){return new Pae(e(n))}return t._curve=e,t}function lat(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(Oae(n)):t()._curve},e}function cat(){return lat(KN().curve(iat))}function _1(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var Hk=Array.prototype.slice;function uat(e){return e.source}function dat(e){return e.target}function YN(e){var t=uat,n=dat,r=$N,s=qN,o=null;function a(){var i,c=Hk.call(arguments),u=t.apply(this,c),f=n.apply(this,c);if(o||(o=i=ho()),e(o,+r.apply(this,(c[0]=u,c)),+s.apply(this,c),+r.apply(this,(c[0]=f,c)),+s.apply(this,c)),i)return o=null,i+""||null}return a.source=function(i){return arguments.length?(t=i,a):t},a.target=function(i){return arguments.length?(n=i,a):n},a.x=function(i){return arguments.length?(r=typeof i=="function"?i:nn(+i),a):r},a.y=function(i){return arguments.length?(s=typeof i=="function"?i:nn(+i),a):s},a.context=function(i){return arguments.length?(o=i??null,a):o},a}function fat(e,t,n,r,s){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,s,r,s)}function mat(e,t,n,r,s){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+s)/2,r,n,r,s)}function pat(e,t,n,r,s){var o=_1(t,n),a=_1(t,n=(n+s)/2),i=_1(r,n),c=_1(r,s);e.moveTo(o[0],o[1]),e.bezierCurveTo(a[0],a[1],i[0],i[1],c[0],c[1])}function hat(){return YN(fat)}function gat(){return YN(mat)}function yat(){var e=YN(pat);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}function vL(e){return e<0?-1:1}function bL(e,t,n){var r=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(r||s<0&&-0),a=(n-e._y1)/(s||r<0&&-0),i=(o*s+a*r)/(r+s);return(vL(o)+vL(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(i))||0}function _L(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function CC(e,t,n){var r=e._x0,s=e._y0,o=e._x1,a=e._y1,i=(o-r)/3;e._context.bezierCurveTo(r+i,s+i*t,o-i,a-i*n,o,a)}function W2(e){this._context=e}W2.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:CC(this,this._t0,_L(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,CC(this,_L(this,n=bL(this,e,t)),n);break;default:CC(this,this._t0,n=bL(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(W2.prototype).point=function(e,t){W2.prototype.point.call(this,t,e)};function xat(e){return new W2(e)}function gf(e,t){if((a=e.length)>1)for(var n=1,r,s,o=e[t[0]],a,i=o.length;n=0;)n[t]=t;return n}function vat(e,t){return e[t]}function QN(){var e=nn([]),t=yf,n=gf,r=vat;function s(o){var a=e.apply(this,arguments),i,c=o.length,u=a.length,f=new Array(u),m;for(i=0;i0){for(var n,r,s=0,o=e[0].length,a;s0)for(var n,r=0,s,o,a,i,c,u=e[t[0]].length;r0?(s[0]=a,s[1]=a+=o):o<0?(s[1]=i,s[0]=i+=o):(s[0]=0,s[1]=o)}function wat(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,o=r.length;n0)||!((o=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,o,a;ro&&(o=s,n=t);return n}function Lae(e){var t=e.map(Fae);return yf(e).sort(function(n,r){return t[n]-t[r]})}function Fae(e){for(var t=0,n=-1,r=e.length,s;++n"pageX"in e?{x:e.pageX,y:e.pageY}:{x:e.touches[0]?.pageX??0,y:e.touches[0]?.pageY??0},Db=xat,am="geometricPrecision",ZN="pointer-events-none overflow-visible font-sans",Bae=25,ii=200,JN="relative isolate select-none touch-none touch-pan-down",ru="bg-transparent rounded-lg border backdrop-blur-sm bg-subtlest dark:bg-subtlest",jl={duration:ii/1e3,delay:ii/1e3,ease:qa},Aat={opacity:0,transition:{duration:0,delay:0}},Nat={duration:ii/1e3,ease:qa},Rat={opacity:0,transition:{duration:ii/1e3,delay:0}},G2={height:Bae},Uae=4,Vae=3,er={blue:"oklch(var(--positive-color))",red:"oklch(var(--negative-color))",gray:"oklch(var(--foreground-quieter-color))",black:"oklch(var(--foreground-color))",transparent:"#00000000"},e8=16,Hae=-5,Dat={fill:er.gray,fontSize:12,dy:`${Hae}px`,textAnchor:"start",fontFamily:"var(--font-family-sans)"},zk=e=>z("transition-opacity duration-500",{"opacity-0":e}),jat=({tick:e,history:t,yScale:n,xScale:r,xOffset:s,yOffset:o,yHeight:a,yWidth:i,yGet:c,baseline:u})=>{if(!t||t.length===0)return!1;const m=n(e)+o,p=m-a;if(Number.isFinite(u)){const g=n(u);if(g>=p&&g<=m)return!0}const h=s+i;for(let g=0;gh)break;const v=n(c(y));if(v>=p&&v<=m)return!0}return!1},zae=({tick:e,history:t,yScale:n,xScale:r,yGet:s,baseline:o})=>({...Dat,opacity:jat({tick:e,history:t,yScale:n,xScale:r,xOffset:e8+5,yOffset:Hae,yHeight:16,yWidth:25,yGet:s,baseline:o})?.4:1}),t8={fill:er.gray,fontSize:12,textAnchor:"start",dx:"6px",fontFamily:"var(--font-family-sans)"},El={POSITIVE:"positive",NEGATIVE:"negative",NEUTRAL:"neutral",TRANSPARENT:"transparent"},Wk={[El.POSITIVE]:"blue",[El.NEGATIVE]:"red",[El.NEUTRAL]:"gray",[El.TRANSPARENT]:"transparent"},$2=e=>e.date,Wae=e=>new Date(e),wn=e=>Wae(e.date),Iat=(e,t)=>{const n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:e})).getTime()-n.getTime())/(1e3*60)},Pat=(e,t)=>new Date(e.getTime()+t*60*1e3).toISOString().slice(11,16),wL=(e,t)=>t?e.replace(/T\d{2}:\d{2}/,`T${t}`):e,Oat={lunch_break:{valence:El.TRANSPARENT,backgroundColor:Wk[El.TRANSPARENT],backgroundOpacity:0,lineOpacity:0},pre_market:{backgroundOpacity:.5},after_hours:{backgroundOpacity:.5}},CL={lunch_break:W({defaultMessage:"Lunch Break",id:"tHK2Aeii37"}),pre_market:W({defaultMessage:"Pre-Market",id:"8y93h1dAbn"}),after_hours:W({defaultMessage:"After-Hours",id:"19IROpkyrs"})},n8=(e,t,n)=>{const r=Pat(t,n);if(r)return e.find(({open:s,close:o})=>s<=o?r>=s&&r=s||r{if(t===0||!e?.length)return e;const n=[...e];let r=0;for(let s=0;s=t){const i=e[s-t].close;r-=i}const a=se?.includes?.("00:00:00"),r8=(e,t,n)=>{if(!e)return null;const r=new Date(e),s=!Fat(e);return r.toLocaleString(t,{month:"short",day:"numeric",timeZone:n,minute:s?"2-digit":void 0,hour:s?"numeric":void 0,year:s?void 0:"numeric",timeZoneName:s?"short":void 0})},Rc=(e,t,n,r=2)=>new Intl.NumberFormat(n,{style:t?"currency":"decimal",currency:t??void 0,minimumFractionDigits:r,maximumFractionDigits:2}).format(e),Bat=Hg(e=>wn(e)).left,Uat=(e,t)=>{if("invert"in e)return e.invert(t);const n=e.step(),r=e.domain(),s=e.range()[0],o=Math.round((t-s)/n);return r[Math.max(0,Math.min(r.length-1,o))]};function s8(e,t,n){const r=Math.max(0,e),s=Bat(n,Uat(t,r),0);return{d:n[s]??n[n.length-1],index:s,x:r}}const Gae=({ticks:e,xScale:t,width:n,formatter:r,marginLeft:s=0,marginRight:o=0})=>{const c=s,u=n-o,f=[];let m=-1/0,p=0;for(const h of e){const g=t(h)??0,x=r(h).length*7,v=g-x/2,b=g+x/2;if(vu)continue;if(f.length===0){f.push(h),m=g,p=x;continue}const _=p/2+10+x/2;g-m>=_&&(f.push(h),m=g,p=x)}return f},Vat=["1d","5d","1m","6m","ytd","1y","5y","max"],$ae={"1d":"1D","5d":"5D","1m":"1M","6m":"6M",ytd:"YTD","1y":"1Y","3m":"3M","5y":"5Y",max:"MAX"},qae=e=>{if(!e.length)return 0;const t=new Date(e[0].date);return(new Date(e[e.length-1].date).getTime()-t.getTime())/(1e3*60*60*24)},o8=e=>qae(e)<=1,Hat=e=>{if(e.length<2)return!1;const t=new Set;for(const n of e){const r=n.date.split("T")[0];if(t.has(r))return!0;t.add(r)}return!1},zat=(e,t)=>Math.ceil((new Date(e).getTime()-new Date(t).getTime())/(1e3*60*60*24)),a8=e=>e?.includes("~")??!1,Wat=e=>{const[t,n]=e.split("~");return t&&n?{type:"range",range:{start:t,end:n}}:{type:"period",period:t}},Gat=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"finance-screenshot-builder",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},$at=Ce(async()=>{const{FinanceScreenshotBuilderModal:e}=await Se(()=>q(()=>import("./FinanceScreenshotBuilderModal-BL5wJen7.js"),__vite__mapDeps([463,1,4,6,3,9,7,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),qat=({quote:e,animationId:t,period:n})=>{const{openToast:r}=hn(),{openModal:s}=Uo(),{$t:o}=J(),{isMobileStyle:a}=Re(),{variation:i}=Gat(!1),c=!!e&&!!t&&!!n,u=d.useCallback(()=>{try{if(!e||!t||!n){r({message:o({defaultMessage:"Chart data not available",id:"sIM31EEMjr"}),description:o({defaultMessage:"Please try again",id:"fHqssj/1KO"}),variant:"error",timeout:3});return}const f=Wat(n),m=f.type==="period"?f.period:null;s($at,{quote:e,period:m,symbol:t,legacyIdentifier:"__NONE__"})}catch(f){Z.error("Failed to open screenshot modal",{error:f}),r({message:o({defaultMessage:"Failed to open screenshot modal",id:"xzxG52das8"}),description:o({defaultMessage:"Please try again",id:"fHqssj/1KO"}),variant:"error",timeout:3})}},[o,t,s,r,n,e]);return!i&&!c?null:l.jsx(Fo,{content:o({defaultMessage:"Share as image",id:"NNAj+KDt/t"}),disabled:a,children:l.jsx("button",{"aria-label":o({defaultMessage:"Screenshot",id:"9a+SKtXKhe"}),onClick:u,className:z(ru,"flex items-center justify-center px-sm"),style:{minHeight:Dh,minWidth:Dh},children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ut,{name:B("camera"),size:16})})})})};var Kat=["top","left","transform","className","children","innerRef"];function Gk(){return Gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Cs(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.transform,a=e.className,i=e.children,c=e.innerRef,u=Yat(e,Kat);return A.createElement("g",Gk({ref:c,className:z("visx-group",a),transform:o||"translate("+s+", "+n+")"},u),i)}Cs.propTypes={top:ze.number,left:ze.number,transform:ze.string,className:ze.string,children:ze.node,innerRef:ze.oneOfType([ze.string,ze.func,ze.object])};const Qat=Object.freeze(Object.defineProperty({__proto__:null,Group:Cs},Symbol.toStringTag,{value:"Module"}));function Go(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const SL=Symbol("implicit");function i8(){var e=new EP,t=[],n=[],r=SL;function s(o){let a=e.get(o);if(a===void 0){if(r!==SL)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return s.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new EP;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return s},s.range=function(o){return arguments.length?(n=Array.from(o),s):n.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return i8(t,n).unknown(r)},Go.apply(s,arguments),s}function l8(){var e=i8().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,o,a,i=!1,c=0,u=0,f=.5;delete e.unknown;function m(){var p=t().length,h=s>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?w1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?w1(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=Jat.exec(e))?new Fr(t[1],t[2],t[3],1):(t=eit.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tit.exec(e))?w1(t[1],t[2],t[3],t[4]):(t=nit.exec(e))?w1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rit.exec(e))?RL(t[1],t[2]/100,t[3]/100,1):(t=sit.exec(e))?RL(t[1],t[2]/100,t[3]/100,t[4]):EL.hasOwnProperty(e)?TL(EL[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function TL(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function w1(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function c8(e){return e instanceof ac||(e=Ph(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function $k(e,t,n,r){return arguments.length===1?c8(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}im(Fr,$k,t0(ac,{brighter(e){return e=e==null?xf:Math.pow(xf,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?su:Math.pow(su,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Uc(this.r),Uc(this.g),Uc(this.b),q2(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:AL,formatHex:AL,formatHex8:iit,formatRgb:NL,toString:NL}));function AL(){return`#${Dc(this.r)}${Dc(this.g)}${Dc(this.b)}`}function iit(){return`#${Dc(this.r)}${Dc(this.g)}${Dc(this.b)}${Dc((isNaN(this.opacity)?1:this.opacity)*255)}`}function NL(){const e=q2(this.opacity);return`${e===1?"rgb(":"rgba("}${Uc(this.r)}, ${Uc(this.g)}, ${Uc(this.b)}${e===1?")":`, ${e})`}`}function q2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dc(e){return e=Uc(e),(e<16?"0":"")+e.toString(16)}function RL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ia(e,t,n,r)}function Yae(e){if(e instanceof ia)return new ia(e.h,e.s,e.l,e.opacity);if(e instanceof ac||(e=Ph(e)),!e)return new ia;if(e instanceof ia)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,i=o-s,c=(o+s)/2;return i?(t===o?a=(n-r)/i+(n0&&c<1?0:a,new ia(a,i,c,e.opacity)}function qk(e,t,n,r){return arguments.length===1?Yae(e):new ia(e,t,n,r??1)}function ia(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}im(ia,qk,t0(ac,{brighter(e){return e=e==null?xf:Math.pow(xf,e),new ia(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?su:Math.pow(su,e),new ia(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 Fr(SC(e>=240?e-240:e+120,s,r),SC(e,s,r),SC(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ia(DL(this.h),C1(this.s),C1(this.l),q2(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=q2(this.opacity);return`${e===1?"hsl(":"hsla("}${DL(this.h)}, ${C1(this.s)*100}%, ${C1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function DL(e){return e=(e||0)%360,e<0?e+360:e}function C1(e){return Math.max(0,Math.min(1,e||0))}function SC(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 Qae=Math.PI/180,Xae=180/Math.PI,K2=18,Zae=.96422,Jae=1,eie=.82521,tie=4/29,Nd=6/29,nie=3*Nd*Nd,lit=Nd*Nd*Nd;function rie(e){if(e instanceof Qa)return new Qa(e.l,e.a,e.b,e.opacity);if(e instanceof Oi)return sie(e);e instanceof Fr||(e=c8(e));var t=TC(e.r),n=TC(e.g),r=TC(e.b),s=EC((.2225045*t+.7168786*n+.0606169*r)/Jae),o,a;return t===n&&n===r?o=a=s:(o=EC((.4360747*t+.3850649*n+.1430804*r)/Zae),a=EC((.0139322*t+.0971045*n+.7141733*r)/eie)),new Qa(116*s-16,500*(o-s),200*(s-a),e.opacity)}function Kk(e,t,n,r){return arguments.length===1?rie(e):new Qa(e,t,n,r??1)}function Qa(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}im(Qa,Kk,t0(ac,{brighter(e){return new Qa(this.l+K2*(e??1),this.a,this.b,this.opacity)},darker(e){return new Qa(this.l-K2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Zae*kC(t),e=Jae*kC(e),n=eie*kC(n),new Fr(MC(3.1338561*t-1.6168667*e-.4906146*n),MC(-.9787684*t+1.9161415*e+.033454*n),MC(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function EC(e){return e>lit?Math.pow(e,1/3):e/nie+tie}function kC(e){return e>Nd?e*e*e:nie*(e-tie)}function MC(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function TC(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function cit(e){if(e instanceof Oi)return new Oi(e.h,e.c,e.l,e.opacity);if(e instanceof Qa||(e=rie(e)),e.a===0&&e.b===0)return new Oi(NaN,0()=>e;function aie(e,t){return function(n){return e+n*t}}function dit(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 f8(e,t){var n=t-e;return n?aie(e,n>180||n<-180?n-360*Math.round(n/360):n):Ib(isNaN(e)?t:e)}function fit(e){return(e=+e)==1?Br:function(t,n){return n-t?dit(t,n,e):Ib(isNaN(t)?n:t)}}function Br(e,t){var n=t-e;return n?aie(e,n):Ib(isNaN(e)?t:e)}const Xk=(function e(t){var n=fit(t);function r(s,o){var a=n((s=$k(s)).r,(o=$k(o)).r),i=n(s.g,o.g),c=n(s.b,o.b),u=Br(s.opacity,o.opacity);return function(f){return s.r=a(f),s.g=i(f),s.b=c(f),s.opacity=u(f),s+""}}return r.gamma=e,r})(1);function mit(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;sn&&(o=t.slice(n,o),i[a]?i[a]+=o:i[++a]=o),(r=r[0])===(s=s[0])?i[a]?i[a]+=s:i[++a]=s:(i[++a]=null,c.push({i:a,x:Y2(r,s)})),n=AC.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Nit(e,t,n){var r=e[0],s=e[1],o=t[0],a=t[1];return s2?Rit:Nit,c=u=null,m}function m(p){return p==null||isNaN(p=+p)?o:(c||(c=i(e.map(r),t,n)))(r(a(p)))}return m.invert=function(p){return a(s((u||(u=i(t,e.map(r),Y2)))(p)))},m.domain=function(p){return arguments.length?(e=Array.from(p,die),f()):e.slice()},m.range=function(p){return arguments.length?(t=Array.from(p),f()):t.slice()},m.rangeRound=function(p){return t=Array.from(p),n=iie,f()},m.clamp=function(p){return arguments.length?(a=p?!0:za,f()):a!==za},m.interpolate=function(p){return arguments.length?(n=p,f()):n},m.unknown=function(p){return arguments.length?(o=p,m):o},function(p,h){return r=p,s=h,f()}}function p8(){return Pb()(za,za)}function Dit(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Q2(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 vf(e){return e=Q2(Math.abs(e)),e?e[1]:NaN}function jit(e,t){return function(n,r){for(var s=n.length,o=[],a=0,i=e[0],c=0;s>0&&i>0&&(c+i+1>r&&(i=Math.max(1,r-c)),o.push(n.substring(s-=i,s+i)),!((c+=i+1)>r));)i=e[a=(a+1)%e.length];return o.reverse().join(t)}}function Iit(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Pit=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lh(e){if(!(t=Pit.exec(e)))throw new Error("invalid format: "+e);var t;return new h8({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]})}Lh.prototype=h8.prototype;function h8(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+""}h8.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 Oit(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 fie;function Lit(e,t){var n=Q2(e,t);if(!n)return e+"";var r=n[0],s=n[1],o=s-(fie=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Q2(e,Math.max(0,t+o-1))[0]}function LL(e,t){var n=Q2(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 FL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Dit,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)=>LL(e*100,t),r:LL,s:Lit,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BL(e){return e}var UL=Array.prototype.map,VL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fit(e){var t=e.grouping===void 0||e.thousands===void 0?BL:jit(UL.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+"",o=e.numerals===void 0?BL:Iit(UL.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",i=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(m){m=Lh(m);var p=m.fill,h=m.align,g=m.sign,y=m.symbol,x=m.zero,v=m.width,b=m.comma,_=m.precision,w=m.trim,S=m.type;S==="n"?(b=!0,S="g"):FL[S]||(_===void 0&&(_=12),w=!0,S="g"),(x||p==="0"&&h==="=")&&(x=!0,p="0",h="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=y==="$"?r:/[%p]/.test(S)?a:"",T=FL[S],k=/[defgprs%]/.test(S);_=_===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function I(M){var N=C,D=E,j,F,R;if(S==="c")D=T(M)+D,M="";else{M=+M;var P=M<0||1/M<0;if(M=isNaN(M)?c:T(Math.abs(M),_),w&&(M=Oit(M)),P&&+M==0&&g!=="+"&&(P=!1),N=(P?g==="("?g:i:g==="-"||g==="("?"":g)+N,D=(S==="s"?VL[8+fie/3]:"")+D+(P&&g==="("?")":""),k){for(j=-1,F=M.length;++jR||R>57){D=(R===46?s+M.slice(j+1):M.slice(j))+D,M=M.slice(0,j);break}}}b&&!x&&(M=t(M,1/0));var L=N.length+M.length+D.length,U=L>1)+N+M+D+U.slice(L);break;default:M=U+N+M+D;break}return o(M)}return I.toString=function(){return m+""},I}function f(m,p){var h=u((m=Lh(m),m.type="f",m)),g=Math.max(-8,Math.min(8,Math.floor(vf(p)/3)))*3,y=Math.pow(10,-g),x=VL[8+g/3];return function(v){return h(y*v)+x}}return{format:u,formatPrefix:f}}var S1,g8,mie;Bit({thousands:",",grouping:[3],currency:["$",""]});function Bit(e){return S1=Fit(e),g8=S1.format,mie=S1.formatPrefix,S1}function Uit(e){return Math.max(0,-vf(Math.abs(e)))}function Vit(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vf(t)/3)))*3-vf(Math.abs(e)))}function Hit(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vf(t)-vf(e))+1}function zit(e,t,n,r){var s=ck(e,t,n),o;switch(r=Lh(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Vit(s,a))&&(r.precision=o),mie(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Hit(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Uit(s))&&(r.precision=o-(r.type==="%")*2);break}}return g8(r)}function r0(e){var t=e.domain;return e.ticks=function(n){var r=t();return lk(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return zit(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,o=r.length-1,a=r[s],i=r[o],c,u,f=10;for(i0;){if(u=are(a,i,n),u===c)return r[s]=a,r[o]=i,t(r);if(u>0)a=Math.floor(a/u)*u,i=Math.ceil(i/u)*u;else if(u<0)a=Math.ceil(a*u)/u,i=Math.floor(i*u)/u;else break;c=u}return e},e}function pie(){var e=p8();return e.copy=function(){return n0(e,pie())},Go.apply(e,arguments),r0(e)}function hie(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],o=e[r],a;return oMath.pow(e,t)}function Kit(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 WL(e){return(t,n)=>-e(-t,n)}function Yit(e){const t=e(HL,zL),n=t.domain;let r=10,s,o;function a(){return s=Kit(r),o=qit(r),n()[0]<0?(s=WL(s),o=WL(o),e(Wit,Git)):e(HL,zL),t}return t.base=function(i){return arguments.length?(r=+i,a()):r},t.domain=function(i){return arguments.length?(n(i),a()):n()},t.ticks=i=>{const c=n();let u=c[0],f=c[c.length-1];const m=f0){for(;p<=h;++p)for(g=1;gf)break;v.push(y)}}else for(;p<=h;++p)for(g=r-1;g>=1;--g)if(y=p>0?g/o(-p):g*o(p),!(yf)break;v.push(y)}v.length*2{if(i==null&&(i=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Lh(c)).precision==null&&(c.trim=!0),c=g8(c)),i===1/0)return c;const u=Math.max(1,r*i/t.ticks().length);return f=>{let m=f/o(Math.round(s(f)));return m*rn(hie(n(),{floor:i=>o(Math.floor(s(i))),ceil:i=>o(Math.ceil(s(i)))})),t}function gie(){const e=Yit(Pb()).domain([1,10]);return e.copy=()=>n0(e,gie()).base(e.base()),Go.apply(e,arguments),e}function GL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $L(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Qit(e){var t=1,n=e(GL(t),$L(t));return n.constant=function(r){return arguments.length?e(GL(t=+r),$L(t)):t},r0(n)}function yie(){var e=Qit(Pb());return e.copy=function(){return n0(e,yie()).constant(e.constant())},Go.apply(e,arguments)}function qL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Xit(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Zit(e){return e<0?-e*e:e*e}function Jit(e){var t=e(za,za),n=1;function r(){return n===1?e(za,za):n===.5?e(Xit,Zit):e(qL(n),qL(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},r0(t)}function y8(){var e=Jit(Pb());return e.copy=function(){return n0(e,y8()).exponent(e.exponent())},Go.apply(e,arguments),e}function elt(){return y8.apply(null,arguments).exponent(.5)}function KL(e){return Math.sign(e)*e*e}function tlt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xie(){var e=p8(),t=[0,1],n=!1,r;function s(o){var a=tlt(e(o));return isNaN(a)?r:n?Math.round(a):a}return s.invert=function(o){return e.invert(KL(o))},s.domain=function(o){return arguments.length?(e.domain(o),s):e.domain()},s.range=function(o){return arguments.length?(e.range((t=Array.from(o,die)).map(KL)),s):t.slice()},s.rangeRound=function(o){return s.range(o).round(!0)},s.round=function(o){return arguments.length?(n=!!o,s):n},s.clamp=function(o){return arguments.length?(e.clamp(o),s):e.clamp()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.copy=function(){return xie(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Go.apply(s,arguments),r0(s)}function vie(){var e=[],t=[],n=[],r;function s(){var a=0,i=Math.max(1,t.length);for(n=new Array(i-1);++a0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(c){return arguments.length&&(o=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return bie().domain([e,t]).range(s).unknown(o)},Go.apply(r0(a),arguments)}function _ie(){var e=[.5],t=[0,1],n,r=1;function s(o){return o!=null&&o<=o?t[tm(e,o,0,r)]:n}return s.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},s.unknown=function(o){return arguments.length?(n=o,s):n},s.copy=function(){return _ie().domain(e).range(t).unknown(n)},Go.apply(s,arguments)}function nlt(e){return new Date(e)}function rlt(e){return e instanceof Date?+e:+new Date(+e)}function x8(e,t,n,r,s,o,a,i,c,u){var f=p8(),m=f.invert,p=f.domain,h=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),_=u("%B"),w=u("%Y");function S(C){return(c(C)"u"?r:r.gamma(n)}function plt(e,t){if("interpolate"in t&&"interpolate"in e&&typeof t.interpolate<"u"){var n=mlt(t.interpolate);e.interpolate(n)}}var hlt=new Date(Date.UTC(2020,1,2,3,4,5)),glt="%Y-%m-%d %H:%M";function wie(e){var t=e.tickFormat(1,glt)(hlt);return t==="2020-02-02 03:04"}var QL={day:em,hour:ub,minute:lb,month:Vg,second:Pi,week:Bg,year:ba},XL={day:Fg,hour:db,minute:cb,month:fb,second:Pi,week:Ug,year:ai};function ylt(e,t){if("nice"in t&&typeof t.nice<"u"&&"nice"in e){var n=t.nice;if(typeof n=="boolean")n&&e.nice();else if(typeof n=="number")e.nice(n);else{var r=e,s=wie(r);if(typeof n=="string")r.nice(s?XL[n]:QL[n]);else{var o=n.interval,a=n.step,i=(s?XL[o]:QL[o]).every(a);i!=null&&r.nice(i)}}}}function xlt(e,t){"padding"in e&&"padding"in t&&typeof t.padding<"u"&&e.padding(t.padding),"paddingInner"in e&&"paddingInner"in t&&typeof t.paddingInner<"u"&&e.paddingInner(t.paddingInner),"paddingOuter"in e&&"paddingOuter"in t&&typeof t.paddingOuter<"u"&&e.paddingOuter(t.paddingOuter)}function vlt(e,t){if(t.reverse){var n=e.range().slice().reverse();"padding"in e,e.range(n)}}function blt(e,t){"round"in t&&typeof t.round<"u"&&(t.round&&"interpolate"in t&&typeof t.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",t):"round"in e?e.round(t.round):"interpolate"in e&&t.round&&e.interpolate(iie))}function _lt(e,t){"unknown"in e&&"unknown"in t&&typeof t.unknown<"u"&&e.unknown(t.unknown)}function wlt(e,t){if("zero"in t&&t.zero===!0){var n=e.domain(),r=n[0],s=n[1],o=s=0)&&(n[s]=e[s]);return n}function Iie(e){var t=e.className,n=e.data,r=e.innerRadius,s=e.outerRadius,o=e.cornerRadius,a=e.startAngle,i=e.endAngle,c=e.padAngle,u=e.padRadius,f=e.children,m=e.innerRef,p=Ylt(e,Klt),h=C8({innerRadius:r,outerRadius:s,cornerRadius:o,startAngle:a,endAngle:i,padAngle:c,padRadius:u});return f?A.createElement(A.Fragment,null,f({path:h})):!n&&(a==null||i==null||r==null||s==null)?(console.warn("[@visx/shape/Arc]: expected data because one of startAngle, endAngle, innerRadius, outerRadius is undefined. Bailing."),null):A.createElement("path",e5({ref:m,className:z("visx-arc",t),d:h(n)||""},p))}var Qlt=["className","top","left","data","centroid","innerRadius","outerRadius","cornerRadius","startAngle","endAngle","padAngle","padRadius","pieSort","pieSortValues","pieValue","children","fill"];function t5(){return t5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Zlt(e){var t=e.className,n=e.top,r=e.left,s=e.data,o=s===void 0?[]:s,a=e.centroid,i=e.innerRadius,c=i===void 0?0:i,u=e.outerRadius,f=e.cornerRadius,m=e.startAngle,p=e.endAngle,h=e.padAngle,g=e.padRadius,y=e.pieSort,x=e.pieSortValues,v=e.pieValue,b=e.children,_=e.fill,w=_===void 0?"":_,S=Xlt(e,Qlt),C=C8({innerRadius:c,outerRadius:u,cornerRadius:f,padRadius:g}),E=Rie({startAngle:m,endAngle:p,padAngle:h,value:v,sort:y,sortValues:x}),T=E(o);return b?A.createElement(A.Fragment,null,b({arcs:T,path:C,pie:E})):A.createElement(Cs,{className:"visx-pie-arcs-group",top:n,left:r},T.map(function(k,I){return A.createElement("g",{key:"pie-arc-"+I},A.createElement("path",t5({className:z("visx-pie-arc",t),d:C(k)||"",fill:w==null||typeof w=="string"?w:w(k)},S)),a?.(C.centroid(k),k))}))}var Jlt=["from","to","fill","className","innerRef"];function n5(){return n5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Ub(e){var t=e.from,n=t===void 0?{x:0,y:0}:t,r=e.to,s=r===void 0?{x:1,y:1}:r,o=e.fill,a=o===void 0?"transparent":o,i=e.className,c=e.innerRef,u=ect(e,Jlt),f=n.x===s.x||n.y===s.y;return A.createElement("line",n5({ref:c,className:z("visx-line",i),x1:n.x,y1:n.y,x2:s.x,y2:s.y,fill:a,shapeRendering:f?"crispEdges":"auto"},u))}var tct=["children","data","x","y","fill","className","curve","innerRef","defined"];function r5(){return r5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Pie(e){var t=e.children,n=e.data,r=n===void 0?[]:n,s=e.x,o=e.y,a=e.fill,i=a===void 0?"transparent":a,c=e.className,u=e.curve,f=e.innerRef,m=e.defined,p=m===void 0?function(){return!0}:m,h=nct(e,tct),g=sl({x:s,y:o,defined:p,curve:u});return t?A.createElement(A.Fragment,null,t({path:g})):A.createElement("path",r5({ref:f,className:z("visx-linepath",c),d:g(r)||"",fill:i,strokeLinecap:"round"},h))}var rct=["className","angle","radius","defined","curve","data","innerRef","children","fill"];function s5(){return s5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function oct(e){var t=e.className,n=e.angle,r=e.radius,s=e.defined,o=e.curve,a=e.data,i=a===void 0?[]:a,c=e.innerRef,u=e.children,f=e.fill,m=f===void 0?"transparent":f,p=sct(e,rct),h=Die({angle:n,radius:r,defined:s,curve:o});return u?A.createElement(A.Fragment,null,u({path:h})):A.createElement("path",s5({ref:c,className:z("visx-line-radial",t),d:h(i)||"",fill:m},p))}var act=["children","x","x0","x1","y","y0","y1","data","defined","className","curve","innerRef"];function o5(){return o5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function lct(e){var t=e.children,n=e.x,r=e.x0,s=e.x1,o=e.y,a=e.y0,i=e.y1,c=e.data,u=c===void 0?[]:c,f=e.defined,m=f===void 0?function(){return!0}:f,p=e.className,h=e.curve,g=e.innerRef,y=ict(e,act),x=Bb({x:n,x0:r,x1:s,y:o,y0:a,y1:i,defined:m,curve:h});return t?A.createElement(A.Fragment,null,t({path:x})):A.createElement("path",o5({ref:g,className:z("visx-area",p),d:x(u)||""},y))}var cct=["x","x0","x1","y","y1","y0","yScale","data","defined","className","curve","innerRef","children"];function a5(){return a5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Fh(e){var t=e.x,n=e.x0,r=e.x1,s=e.y,o=e.y1,a=e.y0,i=e.yScale,c=e.data,u=c===void 0?[]:c,f=e.defined,m=f===void 0?function(){return!0}:f,p=e.className,h=e.curve,g=e.innerRef,y=e.children,x=uct(e,cct),v=Bb({x:t,x0:n,x1:r,defined:m,curve:h});return a==null?v.y0(i.range()[0]):In(v.y0,a),s&&!o&&In(v.y1,s),o&&!s&&In(v.y1,o),y?A.createElement(A.Fragment,null,y({path:v})):A.createElement("path",a5({ref:g,className:z("visx-area-closed",p),d:v(u)||""},x))}var dct=["className","top","left","keys","data","curve","defined","x","x0","x1","y0","y1","value","order","offset","color","children"];function i5(){return i5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Oie(e){var t=e.className,n=e.top,r=e.left,s=e.keys,o=e.data,a=e.curve,i=e.defined,c=e.x,u=e.x0,f=e.x1,m=e.y0,p=e.y1,h=e.value,g=e.order,y=e.offset,x=e.color,v=e.children,b=fct(e,dct),_=jie({keys:s,value:h,order:g,offset:y}),w=Bb({x:c,x0:u,x1:f,y0:m,y1:p,curve:a,defined:i}),S=_(o);return v?A.createElement(A.Fragment,null,v({stacks:S,path:w,stack:_})):A.createElement(Cs,{top:n,left:r},S.map(function(C,E){return A.createElement("path",i5({className:z("visx-stack",t),key:"stack-"+E+"-"+(C.key||""),d:w(C)||"",fill:x?.(C.key,E)},b))}))}var mct=["className","top","left","keys","data","curve","defined","x","x0","x1","y0","y1","value","order","offset","color","children"];function J2(){return J2=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function hct(e){var t=e.className,n=e.top,r=e.left,s=e.keys,o=e.data,a=e.curve,i=e.defined,c=e.x,u=e.x0,f=e.x1,m=e.y0,p=e.y1,h=e.value,g=e.order,y=e.offset,x=e.color,v=e.children,b=pct(e,mct);return A.createElement(Oie,J2({className:t,top:n,left:r,keys:s,data:o,curve:a,defined:i,x:c,x0:u,x1:f,y0:m,y1:p,value:h,order:g,offset:y,color:x},b),v||function(_){var w=_.stacks,S=_.path;return w.map(function(C,E){return A.createElement("path",J2({className:z("visx-area-stack",t),key:"area-stack-"+E+"-"+(C.key||""),d:S(C)||"",fill:x?.(C.key,E)},b))})})}var gct=["className","innerRef"];function l5(){return l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function cm(e){var t=e.className,n=e.innerRef,r=yct(e,gct);return A.createElement("rect",l5({ref:n,className:z("visx-bar",t)},r))}var xct=["children","className","innerRef","x","y","width","height","radius","all","top","bottom","left","right","topLeft","topRight","bottomLeft","bottomRight"];function c5(){return c5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function bct(e){var t=e.all,n=e.bottom,r=e.bottomLeft,s=e.bottomRight,o=e.height,a=e.left,i=e.radius,c=e.right,u=e.top,f=e.topLeft,m=e.topRight,p=e.width,h=e.x,g=e.y;m=t||u||c||m,s=t||n||c||s,r=t||n||a||r,f=t||u||a||f,i=Math.max(1,Math.min(i,Math.min(p,o)/2));var y=2*i,x=("M"+(h+i)+","+g+" h"+(p-y)+` - `+(m?"a"+i+","+i+" 0 0 1 "+i+","+i:"h"+i+"v"+i)+` - v`+(o-y)+` - `+(s?"a"+i+","+i+" 0 0 1 "+-i+","+i:"v"+i+"h"+-i)+` - h`+(y-p)+` - `+(r?"a"+i+","+i+" 0 0 1 "+-i+","+-i:"h"+-i+"v"+-i)+` - v`+(y-o)+` - `+(f?"a"+i+","+i+" 0 0 1 "+i+","+-i:"v"+-i+"h"+i)+` -z`).split(` -`).join("");return x}function _ct(e){var t=e.children,n=e.className,r=e.innerRef,s=e.x,o=e.y,a=e.width,i=e.height,c=e.radius,u=e.all,f=u===void 0?!1:u,m=e.top,p=m===void 0?!1:m,h=e.bottom,g=h===void 0?!1:h,y=e.left,x=y===void 0?!1:y,v=e.right,b=v===void 0?!1:v,_=e.topLeft,w=_===void 0?!1:_,S=e.topRight,C=S===void 0?!1:S,E=e.bottomLeft,T=E===void 0?!1:E,k=e.bottomRight,I=k===void 0?!1:k,M=vct(e,xct),N=bct({x:s,y:o,width:a,height:i,radius:c,all:f,top:p,bottom:g,left:x,right:b,topLeft:w,topRight:C,bottomLeft:T,bottomRight:I});return t?A.createElement(A.Fragment,null,t({path:N})):A.createElement("path",c5({ref:r,className:z("visx-bar-rounded",n),d:N},M))}function Vb(e){if("bandwidth"in e)return e.bandwidth();var t=e.range(),n=e.domain();return Math.abs(t[t.length-1]-t[0])/n.length}var wct=["data","className","top","left","x0","x0Scale","x1Scale","yScale","color","keys","height","children"];function u5(){return u5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Sct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x0,a=e.x0Scale,i=e.x1Scale,c=e.yScale,u=e.color,f=e.keys,m=e.height,p=e.children,h=Cct(e,wct),g=Vb(i),y=t.map(function(x,v){return{index:v,x0:a(o(x)),bars:f.map(function(b,_){var w=x[b];return{index:_,key:b,value:w,width:g,x:i(b)||0,y:c(w)||0,color:u(b,_),height:m-(c(w)||0)}})}});return p?A.createElement(A.Fragment,null,p(y)):A.createElement(Cs,{className:z("visx-bar-group",n),top:r,left:s},y.map(function(x){return A.createElement(Cs,{key:"bar-group-"+x.index+"-"+x.x0,left:x.x0},x.bars.map(function(v){return A.createElement(cm,u5({key:"bar-group-bar-"+x.index+"-"+v.index+"-"+v.value+"-"+v.key,x:v.x,y:v.y,width:v.width,height:v.height,fill:v.color},h))}))}))}var Ect=["data","className","top","left","x","y0","y0Scale","y1Scale","xScale","color","keys","width","children"];function d5(){return d5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Mct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x,a=o===void 0?function(){return 0}:o,i=e.y0,c=e.y0Scale,u=e.y1Scale,f=e.xScale,m=e.color,p=e.keys;e.width;var h=e.children,g=kct(e,Ect),y=Vb(u),x=t.map(function(v,b){return{index:b,y0:c(i(v))||0,bars:p.map(function(_,w){var S=v[_];return{index:w,key:_,value:S,height:y,x:a(S)||0,y:u(_)||0,color:m(_,w),width:f(S)||0}})}});return h?A.createElement(A.Fragment,null,h(x)):A.createElement(Cs,{className:z("visx-bar-group-horizontal",n),top:r,left:s},x.map(function(v){return A.createElement(Cs,{key:"bar-group-"+v.index+"-"+v.y0,top:v.y0},v.bars.map(function(b){return A.createElement(cm,d5({key:"bar-group-bar-"+v.index+"-"+b.index+"-"+b.value+"-"+b.key,x:b.x,y:b.y,width:b.width,height:b.height,fill:b.color},g))}))}))}function $o(e){return typeof e?.x=="number"?e?.x:0}function qo(e){return typeof e?.y=="number"?e?.y:0}function Ko(e){return e?.source}function Yo(e){return e?.target}function Lie(e){return e?.[0]}function Fie(e){return e?.[1]}var Tct=["data","className","top","left","x","y0","y1","xScale","yScale","color","keys","value","order","offset","children"];function f5(){return f5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Nct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.x,a=e.y0,i=a===void 0?Lie:a,c=e.y1,u=c===void 0?Fie:c,f=e.xScale,m=e.yScale,p=e.color,h=e.keys,g=e.value,y=e.order,x=e.offset,v=e.children,b=Act(e,Tct),_=QN();h&&_.keys(h),g&&In(_.value,g),y&&_.order(Lb(y)),x&&_.offset(Fb(x));var w=_(t),S=Vb(f),C=w.map(function(E,T){var k=E.key;return{index:T,key:k,bars:E.map(function(I,M){var N=(m(i(I))||0)-(m(u(I))||0),D=m(u(I)),j="bandwidth"in f?f(o(I.data)):Math.max((f(o(I.data))||0)-S/2);return{bar:I,key:k,index:M,height:N,width:S,x:j||0,y:D||0,color:p(E.key,M)}})}});return v?A.createElement(A.Fragment,null,v(C)):A.createElement(Cs,{className:z("visx-bar-stack",n),top:r,left:s},C.map(function(E){return E.bars.map(function(T){return A.createElement(cm,f5({key:"bar-stack-"+E.index+"-"+T.index,x:T.x,y:T.y,height:T.height,width:T.width,fill:T.color},b))})}))}var Rct=["data","className","top","left","y","x0","x1","xScale","yScale","color","keys","value","order","offset","children"];function m5(){return m5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function jct(e){var t=e.data,n=e.className,r=e.top,s=e.left,o=e.y,a=e.x0,i=a===void 0?Lie:a,c=e.x1,u=c===void 0?Fie:c,f=e.xScale,m=e.yScale,p=e.color,h=e.keys,g=e.value,y=e.order,x=e.offset,v=e.children,b=Dct(e,Rct),_=QN();h&&_.keys(h),g&&In(_.value,g),y&&_.order(Lb(y)),x&&_.offset(Fb(x));var w=_(t),S=Vb(m),C=w.map(function(E,T){var k=E.key;return{index:T,key:k,bars:E.map(function(I,M){var N=(f(u(I))||0)-(f(i(I))||0),D=f(i(I)),j="bandwidth"in m?m(o(I.data)):Math.max((m(o(I.data))||0)-N/2);return{bar:I,key:k,index:M,height:S,width:N,x:D||0,y:j||0,color:p(E.key,M)}})}});return v?A.createElement(A.Fragment,null,v(C)):A.createElement(Cs,{className:z("visx-bar-stack-horizontal",n),top:r,left:s},C.map(function(E){return E.bars.map(function(T){return A.createElement(cm,m5({key:"bar-stack-"+E.index+"-"+T.index,x:T.x,y:T.y,height:T.height,width:T.width,fill:T.color},b))})}))}var Bie=function(t){return Math.PI/180*t},Ict=["className","children","data","innerRef","path","x","y","source","target"];function p5(){return p5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Uie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=hat();return a.x(r),a.y(s),a.source(t),a.target(n),a(o)}}function Oct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.x,i=a===void 0?qo:a,c=e.y,u=c===void 0?$o:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Pct(e,Ict),y=o||Uie({source:m,target:h,x:i,y:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",p5({ref:s,className:z("visx-link visx-link-horizontal-diagonal",t),d:y(r)||""},g))}var Lct=["className","children","data","innerRef","path","x","y","source","target"];function h5(){return h5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Vie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=gat();return a.x(r),a.y(s),a.source(t),a.target(n),a(o)}}function Bct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.x,i=a===void 0?$o:a,c=e.y,u=c===void 0?qo:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Fct(e,Lct),y=o||Vie({source:m,target:h,x:i,y:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",h5({ref:s,className:z("visx-link visx-link-vertical-diagonal",t),d:y(r)||""},g))}var Uct=["className","children","data","innerRef","path","angle","radius","source","target"];function g5(){return g5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Hie(e){var t=e.source,n=e.target,r=e.angle,s=e.radius;return function(o){var a=yat();return a.angle(r),a.radius(s),a.source(t),a.target(n),a(o)}}function Hct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.angle,i=a===void 0?$o:a,c=e.radius,u=c===void 0?qo:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Vct(e,Uct),y=o||Hie({source:m,target:h,angle:i,radius:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",g5({ref:s,className:z("visx-link visx-link-radial-diagonal",t),d:y(r)||""},g))}var zct=["className","children","data","innerRef","path","percent","x","y","source","target"];function y5(){return y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function zie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=m-u,g=p-f,y=o*(h+g),x=o*(g-h),v=ho();return v.moveTo(u,f),v.bezierCurveTo(u+y,f+x,m+x,p-y,m,p),v.toString()}}function Gct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?qo:c,f=e.y,m=f===void 0?$o:f,p=e.source,h=p===void 0?Ko:p,g=e.target,y=g===void 0?Yo:g,x=Wct(e,zct),v=o||zie({source:h,target:y,x:u,y:m,percent:i});return n?A.createElement(A.Fragment,null,n({path:v})):A.createElement("path",y5({ref:s,className:z("visx-link visx-link-horizontal-curve",t),d:v(r)||""},x))}var $ct=["className","children","data","innerRef","path","percent","x","y","source","target"];function x5(){return x5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Wie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=m-u,g=p-f,y=o*(h+g),x=o*(g-h),v=ho();return v.moveTo(u,f),v.bezierCurveTo(u+y,f+x,m+x,p-y,m,p),v.toString()}}function Kct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?$o:c,f=e.y,m=f===void 0?qo:f,p=e.source,h=p===void 0?Ko:p,g=e.target,y=g===void 0?Yo:g,x=qct(e,$ct),v=o||Wie({source:h,target:y,x:u,y:m,percent:i});return n?A.createElement(A.Fragment,null,n({path:v})):A.createElement("path",x5({ref:s,className:z("visx-link visx-link-vertical-curve",t),d:v(r)||""},x))}var Yct=["className","children","data","innerRef","path","percent","x","y","source","target"];function v5(){return v5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Gie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i)-Math.PI/2,f=s(i),m=r(c)-Math.PI/2,p=s(c),h=Math.cos(u),g=Math.sin(u),y=Math.cos(m),x=Math.sin(m),v=f*h,b=f*g,_=p*y,w=p*x,S=_-v,C=w-b,E=o*(S+C),T=o*(C-S),k=ho();return k.moveTo(v,b),k.bezierCurveTo(v+E,b+T,_+T,w-E,_,w),k.toString()}}function Xct(e){var t=e.className,n=e.children,r=e.data,s=e.innerRef,o=e.path,a=e.percent,i=a===void 0?.2:a,c=e.x,u=c===void 0?$o:c,f=e.y,m=f===void 0?qo:f,p=e.source,h=p===void 0?Ko:p,g=e.target,y=g===void 0?Yo:g,x=Qct(e,Yct),v=o||Gie({source:h,target:y,x:u,y:m,percent:i});return n?A.createElement(A.Fragment,null,n({path:v})):A.createElement("path",v5({ref:s,className:z("visx-link visx-link-radial-curve",t),d:v(r)||""},x))}var Zct=["className","children","innerRef","data","path","x","y","source","target"];function b5(){return b5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function $ie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=ho();return p.moveTo(c,u),p.lineTo(f,m),p.toString()}}function eut(e){var t=e.className,n=e.children,r=e.innerRef,s=e.data,o=e.path,a=e.x,i=a===void 0?qo:a,c=e.y,u=c===void 0?$o:c,f=e.source,m=f===void 0?Ko:f,p=e.target,h=p===void 0?Yo:p,g=Jct(e,Zct),y=o||$ie({source:m,target:h,x:i,y:u});return n?A.createElement(A.Fragment,null,n({path:y})):A.createElement("path",b5({ref:r,className:z("visx-link visx-link-horizontal-line",t),d:y(s)||""},g))}var tut=["className","innerRef","data","path","x","y","source","target","children"];function _5(){return _5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function qie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=ho();return p.moveTo(c,u),p.lineTo(f,m),p.toString()}}function rut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?$o:o,i=e.y,c=i===void 0?qo:i,u=e.source,f=u===void 0?Ko:u,m=e.target,p=m===void 0?Yo:m,h=e.children,g=nut(e,tut),y=s||qie({source:f,target:p,x:a,y:c});return h?A.createElement(A.Fragment,null,h({path:y})):A.createElement("path",_5({ref:n,className:z("visx-link visx-link-vertical-line",t),d:y(r)||""},g))}var sut=["className","innerRef","data","path","x","y","source","target","children"];function w5(){return w5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Kie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a)-Math.PI/2,u=s(a),f=r(i)-Math.PI/2,m=s(i),p=Math.cos(c),h=Math.sin(c),g=Math.cos(f),y=Math.sin(f),x=ho();return x.moveTo(u*p,u*h),x.lineTo(m*g,m*y),x.toString()}}function aut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?$o:o,i=e.y,c=i===void 0?qo:i,u=e.source,f=u===void 0?Ko:u,m=e.target,p=m===void 0?Yo:m,h=e.children,g=out(e,sut),y=s||Kie({source:f,target:p,x:a,y:c});return h?A.createElement(A.Fragment,null,h({path:y})):A.createElement("path",w5({ref:n,className:z("visx-link visx-link-radial-line",t),d:y(r)||""},g))}var iut=["className","innerRef","data","path","percent","x","y","source","target","children"];function C5(){return C5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Yie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=ho();return h.moveTo(u,f),h.lineTo(u+(m-u)*o,f),h.lineTo(u+(m-u)*o,p),h.lineTo(m,p),h.toString()}}function cut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.percent,a=o===void 0?.5:o,i=e.x,c=i===void 0?qo:i,u=e.y,f=u===void 0?$o:u,m=e.source,p=m===void 0?Ko:m,h=e.target,g=h===void 0?Yo:h,y=e.children,x=lut(e,iut),v=s||Yie({source:p,target:g,x:c,y:f,percent:a});return y?A.createElement(A.Fragment,null,y({path:v})):A.createElement("path",C5({ref:n,className:z("visx-link visx-link-horizontal-step",t),d:v(r)||""},x))}var uut=["className","innerRef","data","path","percent","x","y","source","target","children"];function S5(){return S5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Qie(e){var t=e.source,n=e.target,r=e.x,s=e.y,o=e.percent;return function(a){var i=t(a),c=n(a),u=r(i),f=s(i),m=r(c),p=s(c),h=ho();return h.moveTo(u,f),h.lineTo(u,f+(p-f)*o),h.lineTo(m,f+(p-f)*o),h.lineTo(m,p),h.toString()}}function fut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.percent,a=o===void 0?.5:o,i=e.x,c=i===void 0?$o:i,u=e.y,f=u===void 0?qo:u,m=e.source,p=m===void 0?Ko:m,h=e.target,g=h===void 0?Yo:h,y=e.children,x=dut(e,uut),v=s||Qie({source:p,target:g,x:c,y:f,percent:a});return y?A.createElement(A.Fragment,null,y({path:v})):A.createElement("path",S5({ref:n,className:z("visx-link visx-link-vertical-step",t),d:v(r)||""},x))}var mut=["className","innerRef","data","path","x","y","source","target","children"];function E5(){return E5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function Xie(e){var t=e.source,n=e.target,r=e.x,s=e.y;return function(o){var a=t(o),i=n(o),c=r(a),u=s(a),f=r(i),m=s(i),p=c-Math.PI/2,h=u,g=f-Math.PI/2,y=m,x=Math.cos(p),v=Math.sin(p),b=Math.cos(g),_=Math.sin(g),w=Math.abs(g-p)>Math.PI?g<=p:g>p;return` - M`+h*x+","+h*v+` - A`+h+","+h+",0,0,"+(w?1:0)+","+h*b+","+h*_+` - L`+y*b+","+y*_+` - `}}function hut(e){var t=e.className,n=e.innerRef,r=e.data,s=e.path,o=e.x,a=o===void 0?$o:o,i=e.y,c=i===void 0?qo:i,u=e.source,f=u===void 0?Ko:u,m=e.target,p=m===void 0?Yo:m,h=e.children,g=put(e,mut),y=s||Xie({source:f,target:p,x:a,y:c});return h?A.createElement(A.Fragment,null,h({path:y})):A.createElement("path",E5({ref:n,className:z("visx-link visx-link-radial-step",t),d:y(r)||""},g))}var gut=["sides","size","center","rotate","className","children","innerRef","points"];function k5(){return k5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}var Zie={x:0,y:0},Jie=function(t){var n=t.sides,r=n===void 0?4:n,s=t.size,o=s===void 0?25:s,a=t.center,i=a===void 0?Zie:a,c=t.rotate,u=c===void 0?0:c,f=t.side,m=360/r*f-u,p=Bie(m);return{x:i.x+o*Math.cos(p),y:i.y+o*Math.sin(p)}},ele=function(t){var n=t.sides,r=t.size,s=t.center,o=t.rotate;return new Array(n).fill(0).map(function(a,i){return Jie({sides:n,size:r,center:s,rotate:o,side:i})})};function xut(e){var t=e.sides,n=t===void 0?4:t,r=e.size,s=r===void 0?25:r,o=e.center,a=o===void 0?Zie:o,i=e.rotate,c=i===void 0?0:i,u=e.className,f=e.children,m=e.innerRef,p=e.points,h=yut(e,gut),g=p||ele({sides:n,size:s,center:a,rotate:c}).map(function(y){var x=y.x,v=y.y;return[x,v]});return f?A.createElement(A.Fragment,null,f({points:g})):A.createElement("polygon",k5({ref:m,className:z("visx-polygon",u),points:g.join(" ")},h))}var vut=["className","innerRef"];function M5(){return M5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function _ut(e){var t=e.className,n=e.innerRef,r=but(e,vut);return A.createElement("circle",M5({ref:n,className:z("visx-circle",t)},r))}var ZL="http://www.w3.org/2000/svg";function wut(e){var t=document.getElementById(e);if(!t){var n=document.createElementNS(ZL,"svg");n.setAttribute("aria-hidden","true"),n.style.opacity="0",n.style.width="0",n.style.height="0",n.style.position="absolute",n.style.top="-100%",n.style.left="-100%",n.style.pointerEvents="none",t=document.createElementNS(ZL,"path"),t.setAttribute("id",e),n.appendChild(t),document.body.appendChild(n)}return t}var Cut="__visx_splitpath_svg_path_measurement_id",JL=function(){return!0};function Sut(e){var t=e.path,n=e.pointsInSegments,r=e.segmentation,s=r===void 0?"x":r,o=e.sampleRate,a=o===void 0?1:o;try{var i=wut(Cut);i.setAttribute("d",t);var c=i.getTotalLength(),u=n.length,f=n.map(function(){return[]});if(s==="x"||s==="y")for(var m=n.map(function(D){var j;return(j=D.find(function(F){return typeof F[s]=="number"}))==null?void 0:j[s]}),p=i.getPointAtLength(0),h=i.getPointAtLength(c),g=h[s]>p[s],y=g?m.map(function(D){return typeof D>"u"?JL:function(j){return j>=D}}):m.map(function(D){return typeof D>"u"?JL:function(j){return j<=D}}),x=0,v=0;v<=c;v+=a){for(var b=i.getPointAtLength(v),_=b[s];x=E[I+1];)I+=1;f[I].push(N)}}return f}catch{return[]}}function T5(){return T5=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"?function(){return c}:c,y=typeof u=="number"||typeof u>"u"?function(){return u}:u;return i.map(function(x){return x.map(function(v,b){return{x:g(v,b,x),y:y(v,b,x)}})})},[c,u,i]),p=d.useMemo(function(){var g=sl({x:c,y:u,defined:s,curve:r});return g(i.flat())||""},[c,u,s,r,i]),h=d.useMemo(function(){return Sut({path:p,segmentation:o,pointsInSegments:m,sampleRate:a})},[p,o,m,a]);return A.createElement("g",null,h.map(function(g,y){return t?A.createElement(A.Fragment,{key:y},t({index:y,segment:g,styles:f[y]||f[y%f.length]})):A.createElement(Pie,T5({key:y,className:n,data:g,x:Eut,y:kut},f[y]||f[y%f.length]))}))}tle.propTypes={segments:ze.arrayOf(ze.array).isRequired,styles:ze.array.isRequired,children:ze.func,className:ze.string};const Mut=Object.freeze(Object.defineProperty({__proto__:null,Arc:Iie,Area:lct,AreaClosed:Fh,AreaStack:hct,Bar:cm,BarGroup:Sct,BarGroupHorizontal:Mct,BarRounded:_ct,BarStack:Nct,BarStackHorizontal:jct,Circle:_ut,Line:Ub,LinePath:Pie,LineRadial:oct,LinkHorizontal:Oct,LinkHorizontalCurve:Gct,LinkHorizontalLine:eut,LinkHorizontalStep:cut,LinkRadial:Hct,LinkRadialCurve:Xct,LinkRadialLine:aut,LinkRadialStep:hut,LinkVertical:Bct,LinkVerticalCurve:Kct,LinkVerticalLine:rut,LinkVerticalStep:fut,Pie:Zlt,Polygon:xut,STACK_OFFSETS:Z2,STACK_OFFSET_NAMES:qlt,STACK_ORDERS:X2,STACK_ORDER_NAMES:$lt,SplitLinePath:tle,Stack:Oie,arc:C8,area:Bb,degreesToRadians:Bie,getPoint:Jie,getPoints:ele,line:sl,pathHorizontalCurve:zie,pathHorizontalDiagonal:Uie,pathHorizontalLine:$ie,pathHorizontalStep:Yie,pathRadialCurve:Gie,pathRadialDiagonal:Hie,pathRadialLine:Kie,pathRadialStep:Xie,pathVerticalCurve:Wie,pathVerticalDiagonal:Vie,pathVerticalLine:qie,pathVerticalStep:Qie,pie:Rie,radialLine:Die,stack:jie,stackOffset:Fb,stackOrder:Lb},Symbol.toStringTag,{value:"Module"}));var NC,eF;function Tut(){if(eF)return NC;eF=1,NC=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var a=n(r,s,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+r.length,a[1]),post:o.slice(a[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var a,i,c,u,f,m=o.indexOf(r),p=o.indexOf(s,m+1),h=m;if(m>=0&&p>0){for(a=[],c=o.length;h>=0&&!f;)h==m?(a.push(h),m=o.indexOf(r,h+1)):a.length==1?f=[a.pop(),p]:(i=a.pop(),i=0?m:p;a.length&&(f=[c,u])}return f}return NC}var RC,tF;function Aut(){if(tF)return RC;tF=1,RC=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var a=n(r,s,o);return a&&{start:a[0],end:a[1],pre:o.slice(0,a[0]),body:o.slice(a[0]+r.length,a[1]),post:o.slice(a[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var a,i,c,u,f,m=o.indexOf(r),p=o.indexOf(s,m+1),h=m;if(m>=0&&p>0){if(r===s)return[m,p];for(a=[],c=o.length;h>=0&&!f;)h==m?(a.push(h),m=o.indexOf(r,h+1)):a.length==1?f=[a.pop(),p]:(i=a.pop(),i=0?m:p;a.length&&(f=[c,u])}return f}return RC}var DC,nF;function Nut(){if(nF)return DC;nF=1;var e=Aut();DC=t;function t(s,o,a){var i=s;return n(s,o).reduce(function(c,u){return c.replace(u.functionIdentifier+"("+u.matches.body+")",r(u.matches.body,u.functionIdentifier,a,i,o))},s)}function n(s,o){var a=[],i=typeof o=="string"?new RegExp("\\b("+o+")\\("):o;do{var c=i.exec(s);if(!c)return a;if(c[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+o);var u=c[1],f=c.index,m=e("(",")",s.substring(f));if(!m||m.start!==c[0].length-1)throw new SyntaxError(u+"(): missing closing ')' in the value '"+s+"'");a.push({matches:m,functionIdentifier:u}),s=m.post}while(i.test(s));return a}function r(s,o,a,i,c){return a(t(s,c,a),o,i)}return DC}var jC,rF;function Rut(){if(rF)return jC;rF=1;var e=function(t){this.value=t};return e.math={isDegree:!0,acos:function(t){return e.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,n){return t+n},asin:function(t){return e.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return e.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,n){var r=1,s=t-n,o=n;om.length-2?m.length-1:b.length-T;C>0;C--)if(m[C]!==void 0)for(E=0;E0&&Ms)i.push(n);else{for(;s>=o&&!f||f&&o"u"?n[n.length-1].value.push(a[c]):n[n.length-1].value=a[c].value(n[n.length-1].value);else if(a[c].type===7)typeof n[n.length-1].type>"u"?n[n.length-1].value.push(a[c]):n[n.length-1].value=a[c].value(n[n.length-1].value);else if(a[c].type===8){for(var u=[],f=0;f"u"?(s.value=s.concat(r),s.value.push(a[c]),n.push(s)):typeof r.type>"u"?(r.unshift(s),r.push(a[c]),n.push(r)):n.push({type:1,value:a[c].value(s.value,r.value)})):a[c].type===2||a[c].type===9?(r=n.pop(),s=n.pop(),typeof s.type>"u"?(s=s.concat(r),s.push(a[c]),n.push(s)):typeof r.type>"u"?(r.unshift(s),r.push(a[c]),n.push(r)):n.push({type:1,value:a[c].value(s.value,r.value)})):a[c].type===12?(r=n.pop(),typeof r.type<"u"&&(r=[r]),s=n.pop(),o=n.pop(),n.push({type:1,value:a[c].value(o.value,s.value,new e(r))})):a[c].type===13&&(i?n.push({value:t[a[c].value],type:3}):n.push([a[c]]));if(n.length>1)throw new e.Exception("Uncaught Syntax error");return n[0].value>1e15?"Infinity":parseFloat(n[0].value.toFixed(15))},e.eval=function(t,n,r){return typeof n>"u"?this.lex(t).toPostfix().postfixEval():typeof r>"u"?typeof n.length<"u"?this.lex(t,n).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(n):this.lex(t,n).toPostfix().postfixEval(r)},OC=e,OC}var LC,iF;function Put(){if(iF)return LC;iF=1;var e=Iut();return e.prototype.formulaEval=function(){for(var t,n,r,s=[],o=this.value,a=0;a"+n.value+""+o[a].show+""+t.value+"",type:10}):s.push({value:(n.type!=1?"(":"")+n.value+(n.type!=1?")":"")+""+t.value+"",type:1})):o[a].type===2||o[a].type===9?(t=s.pop(),n=s.pop(),s.push({value:(n.type!=1?"(":"")+n.value+(n.type!=1?")":"")+o[a].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:o[a].type})):o[a].type===12&&(t=s.pop(),n=s.pop(),r=s.pop(),s.push({value:o[a].show+"("+r.value+","+n.value+","+t.value+")",type:12}));return s[0].value},LC=e,LC}var FC,lF;function Out(){if(lF)return FC;lF=1;var e=Tut(),t=Nut(),n=Put(),r=100,s=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,o;FC=a;function a(c,u){o=0,u=Math.pow(10,u===void 0?5:u),c=c.replace(/\n+/g," ");function f(p,h,g){if(o++>r)throw o=0,new Error("Call stack overflow for "+g);if(p==="")throw new Error(h+"(): '"+g+"' must contain a non-whitespace string");p=m(p,g);var y=i(p);if(y.length>1||p.indexOf("var(")>-1)return h+"("+p+")";var x=y[0]||"";x==="%"&&(p=p.replace(/\b[0-9\.]+%/g,function(_){return parseFloat(_.slice(0,-1))*.01}));var v=p.replace(new RegExp(x,"gi"),""),b;try{b=n.eval(v)}catch{return h+"("+p+")"}return x==="%"&&(b*=100),(h.length||x==="%")&&(b=Math.round(b*u)/u),b+=x,b}function m(p,h){p=p.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var g="",y=p,x;x=s.exec(y);){x[0].index>0&&(g+=y.substring(0,x[0].index));var v=e("(",")",y.substring([0].index));if(v.body==="")throw new Error("'"+p+"' must contain a non-whitespace string");var b=f(v.body,"",h);g+=v.pre+b,y=v.post}return g+y}return t(c,/((?:\-[a-z]+\-)?calc)\(/,f)}function i(c){for(var u=[],f=[],m=/[\.0-9]([%a-z]+)/gi,p=m.exec(c);p;)!p||!p[1]||(f.indexOf(p[1].toLowerCase())===-1&&(u.push(p[1]),f.push(p[1].toLowerCase())),p=m.exec(c));return u}return FC}var Lut=Out();const BC=uo(Lut);var UC,cF;function Fut(){if(cF)return UC;cF=1;var e=typeof td=="object"&&td&&td.Object===Object&&td;return UC=e,UC}var VC,uF;function S8(){if(uF)return VC;uF=1;var e=Fut(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return VC=n,VC}var HC,dF;function nle(){if(dF)return HC;dF=1;var e=S8(),t=e.Symbol;return HC=t,HC}var zC,fF;function But(){if(fF)return zC;fF=1;var e=nle(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function o(a){var i=n.call(a,s),c=a[s];try{a[s]=void 0;var u=!0}catch{}var f=r.call(a);return u&&(i?a[s]=c:delete a[s]),f}return zC=o,zC}var WC,mF;function Uut(){if(mF)return WC;mF=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return WC=n,WC}var GC,pF;function Vut(){if(pF)return GC;pF=1;var e=nle(),t=But(),n=Uut(),r="[object Null]",s="[object Undefined]",o=e?e.toStringTag:void 0;function a(i){return i==null?i===void 0?s:r:o&&o in Object(i)?t(i):n(i)}return GC=a,GC}var $C,hF;function rle(){if(hF)return $C;hF=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return $C=e,$C}var qC,gF;function Hut(){if(gF)return qC;gF=1;var e=Vut(),t=rle(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",o="[object Proxy]";function a(i){if(!t(i))return!1;var c=e(i);return c==r||c==s||c==n||c==o}return qC=a,qC}var KC,yF;function zut(){if(yF)return KC;yF=1;var e=S8(),t=e["__core-js_shared__"];return KC=t,KC}var YC,xF;function Wut(){if(xF)return YC;xF=1;var e=zut(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return YC=n,YC}var QC,vF;function Gut(){if(vF)return QC;vF=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return QC=n,QC}var XC,bF;function $ut(){if(bF)return XC;bF=1;var e=Hut(),t=Wut(),n=rle(),r=Gut(),s=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,i=Object.prototype,c=a.toString,u=i.hasOwnProperty,f=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(p){if(!n(p)||t(p))return!1;var h=e(p)?f:o;return h.test(r(p))}return XC=m,XC}var ZC,_F;function qut(){if(_F)return ZC;_F=1;function e(t,n){return t?.[n]}return ZC=e,ZC}var JC,wF;function sle(){if(wF)return JC;wF=1;var e=$ut(),t=qut();function n(r,s){var o=t(r,s);return e(o)?o:void 0}return JC=n,JC}var eS,CF;function Hb(){if(CF)return eS;CF=1;var e=sle(),t=e(Object,"create");return eS=t,eS}var tS,SF;function Kut(){if(SF)return tS;SF=1;var e=Hb();function t(){this.__data__=e?e(null):{},this.size=0}return tS=t,tS}var nS,EF;function Yut(){if(EF)return nS;EF=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return nS=e,nS}var rS,kF;function Qut(){if(kF)return rS;kF=1;var e=Hb(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(o){var a=this.__data__;if(e){var i=a[o];return i===t?void 0:i}return r.call(a,o)?a[o]:void 0}return rS=s,rS}var sS,MF;function Xut(){if(MF)return sS;MF=1;var e=Hb(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var o=this.__data__;return e?o[s]!==void 0:n.call(o,s)}return sS=r,sS}var oS,TF;function Zut(){if(TF)return oS;TF=1;var e=Hb(),t="__lodash_hash_undefined__";function n(r,s){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&s===void 0?t:s,this}return oS=n,oS}var aS,AF;function Jut(){if(AF)return aS;AF=1;var e=Kut(),t=Yut(),n=Qut(),r=Xut(),s=Zut();function o(a){var i=-1,c=a==null?0:a.length;for(this.clear();++i-1}return fS=t,fS}var mS,OF;function odt(){if(OF)return mS;OF=1;var e=zb();function t(n,r){var s=this.__data__,o=e(s,n);return o<0?(++this.size,s.push([n,r])):s[o][1]=r,this}return mS=t,mS}var pS,LF;function adt(){if(LF)return pS;LF=1;var e=edt(),t=ndt(),n=rdt(),r=sdt(),s=odt();function o(a){var i=-1,c=a==null?0:a.length;for(this.clear();++i0){var I=C[0].width||1,M=s==="shrink-only"?Math.min(a/I,1):a/I,N=M,D=y-M*y,j=v-N*v;k.push("matrix("+M+", 0, 0, "+N+", "+D+", "+j+")")}return o&&k.push("rotate("+o+", "+y+", "+v+")"),k.length>0?k.join(" "):""},[b,y,v,a,s,C,o]);return{wordsByLines:C,startDy:E,transform:T}}var _dt=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function N5(){return N5=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?A.createElement("text",N5({ref:c,transform:b},m,{textAnchor:a}),x.map(function(_,w){return A.createElement("tspan",{key:w,x:h,dy:w===0?v:f},_.words.join(" "))})):null)}const Sdt=Object.freeze(Object.defineProperty({__proto__:null,Text:Gb,getStringWidth:A5,useText:ole},Symbol.toStringTag,{value:"Module"}));var eo={top:"top",left:"left",bottom:"bottom"};function Edt(e){var t=e.labelOffset,n=e.labelProps,r=e.orientation,s=e.range,o=e.tickLabelFontSize,a=e.tickLength,i=r===eo.left||r===eo.top?-1:1,c,u,f;if(r===eo.top||r===eo.bottom){var m=r===eo.bottom&&typeof n.fontSize=="number"?n.fontSize:0;c=(Number(s[0])+Number(s[s.length-1]))/2,u=i*(a+t+o+m)}else c=i*((Number(s[0])+Number(s[s.length-1]))/2),u=-(a+t),f="rotate("+i*90+")";return{x:c,y:u,transform:f}}function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(u[m]=i[m]);return u}function a(i){var c=i.from,u=c===void 0?{x:0,y:0}:c,f=i.to,m=f===void 0?{x:1,y:1}:f,p=i.fill,h=p===void 0?"transparent":p,g=i.className,y=i.innerRef,x=o(i,n),v=u.x===m.x||u.y===m.y;return e.default.createElement("line",s({ref:y,className:(0,t.default)("visx-line",g),x1:u.x,y1:u.y,x2:m.x,y2:m.y,fill:h,shapeRendering:v?"crispEdges":"auto"},x))}return k1}var Odt=ale();const ile=uo(Odt);function lle(e){return"bandwidth"in e?e.bandwidth():0}var Ldt=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function j5(){return j5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function bu(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.scale,a=e.width,i=e.stroke,c=i===void 0?"#eaf0f6":i,u=e.strokeWidth,f=u===void 0?1:u,m=e.strokeDasharray,p=e.className,h=e.children,g=e.numTicks,y=g===void 0?10:g,x=e.lineStyle,v=e.offset,b=e.tickValues,_=Fdt(e,Ldt),w=b??Ob(o,y),S=(v??0)+lle(o)/2,C=w.map(function(E,T){var k,I=((k=o0(o(E)))!=null?k:0)+S;return{index:T,from:new li({x:0,y:I}),to:new li({x:a,y:I})}});return A.createElement(Cs,{className:z("visx-rows",p),top:n,left:s},h?h({lines:C}):C.map(function(E){var T=E.from,k=E.to,I=E.index;return A.createElement(ile,j5({key:"row-line-"+I,from:T,to:k,stroke:c,strokeWidth:f,strokeDasharray:m,style:x},_))}))}bu.propTypes={tickValues:ze.array,width:ze.number.isRequired};var Bdt=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function I5(){return I5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function $b(e){var t=e.top,n=t===void 0?0:t,r=e.left,s=r===void 0?0:r,o=e.scale,a=e.height,i=e.stroke,c=i===void 0?"#eaf0f6":i,u=e.strokeWidth,f=u===void 0?1:u,m=e.strokeDasharray,p=e.className,h=e.numTicks,g=h===void 0?10:h,y=e.lineStyle,x=e.offset,v=e.tickValues,b=e.children,_=Udt(e,Bdt),w=v??Ob(o,g),S=(x??0)+lle(o)/2,C=w.map(function(E,T){var k,I=((k=o0(o(E)))!=null?k:0)+S;return{index:T,from:new li({x:I,y:0}),to:new li({x:I,y:a})}});return A.createElement(Cs,{className:z("visx-columns",p),top:n,left:s},b?b({lines:C}):C.map(function(E){var T=E.from,k=E.to,I=E.index;return A.createElement(ile,I5({key:"column-line-"+I,from:T,to:k,stroke:c,strokeWidth:f,strokeDasharray:m,style:y},_))}))}$b.propTypes={tickValues:ze.array,height:ze.number.isRequired};const Gs=e=>e,Vdt=(e,t,n,r)=>`M${e},${t}h${n}v${r}h${-n}Z`,Hdt=(e,t,n)=>`M${e},${t}L${e},${n}`,zdt=(e,t,n)=>`M${e},${t}L${n},${t}`,cle=({xScale:e,yScale:t,history:n})=>{const r=d.useMemo(()=>{if(n.length<2)return 4;let a=1/0;for(let i=0;i{const a={blue:{wicks:[],bodies:[],dojis:[]},red:{wicks:[],bodies:[],dojis:[]},wickStrokeWidth:Gs(Math.max(.1,Math.min(r,1))),dojiStrokeWidth:Gs(Math.max(.5,Math.min(r*.3,1.5)))};return n.forEach(i=>{const c=Gs(e(wn(i))??0),u=Gs(t(i.high)??0),f=Gs(t(i.low)??0),m=Gs(t(i.open)??0),p=Gs(t(i.close)??0),h=i.close>=i.open?"blue":"red",g=a[h];g.wicks.push(Hdt(c,u,f));const y=Gs(Math.abs(p-m));y<1?g.dojis.push(zdt(Gs(c-r/2),p,Gs(c+r/2))):g.bodies.push(Vdt(Gs(c-r/2),Gs(Math.min(m,p)),Gs(r),y))}),a},[n,e,t,r]),o=(a,i)=>{const c=er[a];return l.jsxs(l.Fragment,{children:[i.wicks.length&&l.jsx("path",{d:i.wicks.join(""),stroke:c,strokeWidth:s.wickStrokeWidth,opacity:.5,fill:"none"}),i.bodies.length&&l.jsx("path",{d:i.bodies.join(""),fill:c}),i.dojis.length&&l.jsx("path",{d:i.dojis.join(""),stroke:c,strokeWidth:s.dojiStrokeWidth,fill:"none"})]})};return l.jsxs("svg",{children:[o("blue",s.blue),o("red",s.red)]})};cle.displayName="CandlestickLine";const a0=200,Wdt={top:24,right:8,bottom:24,left:16},Gdt="#1FB8CD",$dt="#B4413C",qdt=[Gdt,"#FFC185",$dt,"#ECEBD5","#5D878F","#DB4545","#D2BA4C","#964325"],Kdt="#20808D",Ydt="#A84B2F",Qdt=[Kdt,Ydt,"#1B474D","#BCE2E7","#944454","#FFC553","#848456","#6E522B"],Xdt={tickColor:"#2F3031",axisColor:"#2F3031",textColor:"#aaaaaa",colorSchema:qdt},Zdt={tickColor:"#D9D9D0",axisColor:"#D9D9D0",textColor:"#A0A0A0",colorSchema:Qdt},Jdt={time:e=>new Date(e),linear:e=>+e,band:e=>e,ordinal:e=>e,log:e=>+e,point:e=>e};function MS(e,t){if(!e)return r=>null;if(t===void 0)return r=>r[e];const n=Jdt[t]||(r=>r);return r=>n(r[e])}function Wu(e,t){return typeof t=="function"?t(e):typeof t=="string"?t.replace("%s",e):e instanceof Date?Vqe(e):String(e)}const ao={time:lm,linear:Bi,band:v8,log:b8,point:s0,ordinal:w8},ZF=["band","ordinal","point"];function eft({width:e,height:t,margin:n,hasAxis:r,maxYLabelWidth:s=0}){const o=n.left+(r?s+15:0),a=e-n.right-n.left,i=t-n.bottom,c=n.top,u=[o,a],f=[i,c],m=Math.max(0,a-o);return{innerHeight:Math.max(0,i-c),innerWidth:m,xRange:u,yRange:f}}function qb(e){const{colorScheme:t}=Ss(),n=mi(),r=d.useMemo(()=>n?t==="dark":!1,[t,n]);return d.useMemo(()=>({...r?Xdt:Zdt,...e}),[r,e])}function Kb(e){return d.useMemo(()=>e.data.map(n=>({__key:Math.random(),...n})),[e.data])}function Yb({config:e}){const t=d.useMemo(()=>MS(e.x.accessor,e.x.scale),[e.x]),n=d.useMemo(()=>MS(e.y.accessor,e.y.scale),[e.y]),r=d.useMemo(()=>MS(e.z?.accessor,e.z?.scale),[e.z]);return d.useMemo(()=>({xGet:t,yGet:n,zGet:r}),[t,n,r])}function Qb({config:e}){const t=d.useCallback(i=>Wu(i,e.x.format),[e.x]),n=d.useCallback(i=>Wu(i,e.y.format),[e.y]),r=d.useCallback(i=>Wu(i,e.z?.format),[e.z]),s=d.useCallback(i=>Wu(i,e.x.tooltipFormat??e.x.format),[e.x]),o=d.useCallback(i=>Wu(i,e.y.tooltipFormat??e.y.format),[e.y]),a=d.useCallback(i=>Wu(i,e.z?.tooltipFormat??e.z?.format),[e.z]);return d.useMemo(()=>({xFormat:t,yFormat:n,zFormat:r,xTooltipFormat:s,yTooltipFormat:o,zTooltipFormat:a}),[t,n,r,s,o,a])}function Xb({width:e,height:t,margin:n,maxYLabelWidth:r,hasAxis:s}){return d.useMemo(()=>eft({width:e,height:t,margin:n,maxYLabelWidth:r,hasAxis:s}),[e,t,n,r,s])}function E8({config:e,xGet:t,yGet:n,data:r,endTime:s,previousClose:o}){const a=d.useMemo(()=>{if(ZF.includes(e.x.scale))return[...new Set(r.map(t))];const u=ko(r,t);return e.x.tickValues?ko([...e.x.tickValues,...u]):u},[e.x.tickValues,e.x.scale,r,t]),i=d.useMemo(()=>{if(ZF.includes(e.y.scale))return[...new Set(r.map(n))];const f=[...ko(r,n)];o!==void 0&&f.push(o),e.y.tickValues&&f.push(...e.y.tickValues);const[m,p]=ko(f),g=(p-m)*.05;return[m-g,p+g]},[e.y.tickValues,e.y.scale,r,n,o]),c=d.useMemo(()=>{if(!s||!a||a.length<2||e.x.scale!=="time")return a;const[u,f]=a;return new Date(f).toDateString()!==s.toDateString()?a:Date.now()({xDomain:c,yDomain:i}),[c,i])}function ule(e){const[t,n]=d.useState({width:0,height:0,resizing:!1});return d.useEffect(()=>{let r;const s=()=>{e.current&&(clearTimeout(r),n(o=>{const a=e.current?.offsetWidth??0,i=e.current?.offsetHeight??0,c=Math.round(o.width)!==Math.round(a);return{width:a,height:i,resizing:c}}),r=setTimeout(()=>{n(o=>({...o,resizing:!1}))},500))};return s(),window.addEventListener("resize",s),()=>{clearTimeout(r),window.removeEventListener("resize",s)}},[e]),t}const xs=30,Rd=28,k8=({height:e=a0,render:t,children:n})=>{const r=d.useRef(null),{width:s}=ule(r);return l.jsx("div",{style:{width:"100%",height:e},ref:r,className:"relative",children:l.jsx(St,{children:t&&l.jsx(Te.div,{className:"absolute",children:n(s,e)})})})},tft=({children:e,style:t})=>l.jsx(K,{className:"p-sm pb-md flex h-full",children:l.jsx(K,{className:"flex size-full items-center justify-center",variant:"raised",style:t,children:l.jsx(V,{variant:"small",color:"light",children:e})})}),dle=()=>l.jsx(tft,{style:{height:a0,marginBottom:xs},children:l.jsx(je,{id:"iuY8kxCDQT",defaultMessage:"Something went wrong."})});function nft(e){return!!e&&e instanceof Element}function rft(e){return!!e&&(e instanceof SVGElement||"ownerSVGElement"in e)}function sft(e){return!!e&&"createSVGPoint"in e}function oft(e){return!!e&&"getScreenCTM"in e}function aft(e){return!!e&&"changedTouches"in e}function ift(e){return!!e&&"clientX"in e}function lft(e){return!!e&&(e instanceof Event||"nativeEvent"in e&&e.nativeEvent instanceof Event)}function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:Hp({},TS);if(ift(e))return{x:e.clientX,y:e.clientY};var t=e?.target,n=t&&"getBoundingClientRect"in t?t.getBoundingClientRect():null;return n?{x:n.x+n.width/2,y:n.y+n.height/2}:Hp({},TS)}function JF(e,t){if(!e||!t)return null;var n=cft(t),r=rft(e)?e.ownerSVGElement:e,s=oft(r)?r.getScreenCTM():null;if(sft(r)&&s){var o=r.createSVGPoint();return o.x=n.x,o.y=n.y,o=o.matrixTransform(s.inverse()),new li({x:o.x,y:o.y})}var a=e.getBoundingClientRect();return new li({x:n.x-a.left-e.clientLeft,y:n.y-a.top-e.clientTop})}function i0(e,t){if(nft(e)&&t)return JF(e,t);if(lft(e)){var n=e,r=n.target;if(r)return JF(r,n)}return null}var uft=["tooltipOpen"];function dft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function ex(){return ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&E>T}else{var k=S+o+u.width-window.innerWidth,I=u.width-S-o;_=k>0&&k>I}if(c.height){var M=C+i+u.height-c.height,N=u.height-C-i;w=M>0&&M>N}else w=C+i+u.height>window.innerHeight;S=_?S-u.width-o:S+o,C=w?C-u.height-i:C+i,S=Math.round(S),C=Math.round(C),b="translate("+S+"px, "+C+"px)"}return A.createElement(M8,nx({ref:x,style:nx({left:0,top:0,transform:b},!y&&m)},v),A.createElement(gft,{value:{isFlippedVertically:!w,isFlippedHorizontally:!_}},t))}ple.propTypes={nodeRef:ze.oneOfType([ze.string,ze.func,ze.object])};const hle=hft(ple),vft="shadow-subtle transition-colors duration-500",Jb=d.memo(({marginTop:e,tooltipLeft:t=0,innerHeight:n,color:r,strokeWidth:s=1})=>{const o=d.useMemo(()=>({x:t,y:e}),[e,t]),a=d.useMemo(()=>({x:t,y:n+e}),[n,e,t]);return isNaN(o.x+a.x+o.y+a.y)?null:l.jsx("line",{x1:o.x,y1:o.y,x2:a.x,y2:a.y,stroke:r,strokeWidth:s,pointerEvents:"none",className:vft})});Jb.displayName="YCrosshair";const bft={pointerEvents:"none",position:"absolute",overflow:"visible",zIndex:3},e_=({children:e,y:t,x:n,pill:r})=>l.jsx(hle,{left:n,top:t,style:bft,children:l.jsx("div",{className:z("shadow-subtle relative border bg-white/75 backdrop-blur-sm dark:bg-subtle overflow-hidden",{"rounded-full":r,"rounded-lg":!r}),children:e})}),_ft=({exchangeHoursAnnotations:e,data:t,xScale:n,xBounds:r,hidden:s,tzOffsetMins:o})=>{const{$t:a}=J(),{tooltipData:i,hideTooltip:c,showTooltip:u}=Zb(),f=d.useRef(null),m=d.useRef(s),p=d.useCallback((y,x)=>{const{d:v,x:b}=s8(y.local.x,n,t);if(!v)return;const _=n8(e,new Date(v.date),o),w=_?.type&&CL[_.type]?a(CL[_.type]):void 0,S=Math.min(Math.max(r[0],b),r[1]);u({tooltipData:{data:v,point:{touch:x,local:{x:S,y:y.local.y},global:y.global},annotation:w}})},[t,n,u,e,a,r,o]);m.current&&!s&&f.current&&p(f.current,!1),m.current=s;const h=d.useCallback(y=>{const x="touches"in y;y.stopPropagation();const v=i0(y),b=XN(y);if(!v)return;const _={local:v,global:b};f.current=_,p(_,x)},[p]),g=d.useCallback(()=>{f.current=null,c()},[c]);return d.useMemo(()=>({tooltipData:s?void 0:i,hideTooltip:g,showTooltip:h}),[i,g,h,s])},gle=({currency:e,absoluteChange:t,relativeChange:n})=>{const{locale:r}=J(),s=d.useMemo(()=>t===void 0?null:Rc(t,e,r),[t,e,r]),o=d.useMemo(()=>n===void 0?null:n.toLocaleString(r,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2,signDisplay:"exceptZero"}),[n,r]),a=d.useMemo(()=>t?t>0?"positive":"negative":"light",[t]);return!t&&!n?null:l.jsx(K,{className:"relative border-t",children:l.jsx(V,{variant:"tinyRegular",color:a,className:"px-sm py-xs whitespace-nowrap",children:l.jsx(je,{id:"TqEJGQaMg0",defaultMessage:"{absoluteChange} ({relativeChange})",values:{absoluteChange:s,relativeChange:o}})})})},wft=({x:e,y:t,close:n,date:r,annotation:s,absoluteChange:o,relativeChange:a,currency:i,exchangeTimezone:c})=>{const{locale:u}=J();return l.jsxs(e_,{y:t,x:e,children:[l.jsxs(K,{className:"py-sm relative px-[12px]",children:[l.jsx(V,{variant:"baseSemi",children:Rc(n,i,u)}),l.jsx(V,{variant:"tinyRegular",className:"whitespace-nowrap",color:"light",children:r8(r,u,c)}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"whitespace-nowrap",children:s})]}),l.jsx(gle,{currency:i,absoluteChange:o,relativeChange:a})]})},zm=({label:e,children:t})=>l.jsxs(K,{className:"gap-md flex justify-between",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:e}),l.jsx(V,{variant:"tinyRegular",className:"whitespace-nowrap",children:t})]}),Cft=({currency:e,locale:t,exchangeTimezone:n,x:r,y:s,data:o,annotation:a,absoluteChange:i,relativeChange:c})=>{const{$t:u}=J();return l.jsx(Xl,{children:l.jsxs(e_,{y:s,x:r,children:[l.jsx(K,{children:l.jsxs(K,{className:"px-sm py-xs",variant:"subtle",children:[l.jsx(V,{variant:"tiny",className:"whitespace-nowrap",children:r8(o.date,t,n)}),a&&l.jsx(V,{variant:"micro",color:"light",className:"whitespace-nowrap",children:a})]})}),l.jsxs(K,{className:"px-sm py-xs space-y-xs border-t",children:[l.jsx(zm,{label:u({defaultMessage:"Close",id:"rbrahOGMC3"}),children:Rc(o.close,e,t)}),l.jsx(zm,{label:u({defaultMessage:"Open",id:"JfG49wNHKP"}),children:Rc(o.open,e,t)}),l.jsx(zm,{label:u({defaultMessage:"High",id:"AxMhQrcUDC"}),children:Rc(o.high,e,t)}),l.jsx(zm,{label:u({defaultMessage:"Low",id:"477I0ggSYe"}),children:Rc(o.low,e,t)}),l.jsx(zm,{label:u({defaultMessage:"Volume",id:"y867VsgbzT"}),children:o.volume.toLocaleString(t,{style:"decimal",currency:e??void 0,minimumFractionDigits:0,maximumFractionDigits:0})})]}),l.jsx(gle,{currency:e,absoluteChange:i,relativeChange:c})]})})},Sft=e=>e&&e<0?er.red:e&&e>0?er.blue:er.gray,tB=5,Eft=.002,nB=1,kft=20,Mft=150,M1={k:1,x:0},Tft=(e,t)=>(t-e.x)/e.k,yle=(e,t)=>{const r=t.range().map(s=>Tft(e,s)).map(s=>t.invert(s));return t.copy().domain(r)},xle=(e,t)=>{const r=t.range().map(s=>e.k*s+e.x);return t.copy().range(r)},vle=({enabled:e,width:t,id:n})=>{const[r,s]=d.useState(M1),o=d.useRef(t);o.current=t;const[a,i]=d.useState(!1),c=d.useRef(null),u=d.useRef(null);d.useEffect(()=>{if(!e)return;const m=u.current;if(!m)return;const p=h=>{h.preventDefault(),h.stopPropagation();const g=i0(m,h);if(!g)return;i(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{i(!1)},Mft);const y=Math.exp(-h.deltaY*Eft);s(x=>{const v=Math.max(nB,Math.min(kft,x.k*y));if(v<=nB)return M1;const b=g.x-(g.x-x.x)*(v/x.k),_=o.current*(1-v),w=Math.max(_,Math.min(0,b));return{k:v,x:w}})};return m.addEventListener("wheel",p,{passive:!1}),()=>{m.removeEventListener("wheel",p)}},[e]);const f=d.useCallback(()=>{s(M1)},[]);return d.useEffect(()=>{s(M1)},[n]),{transform:r,isActivelyZooming:a,containerRef:u,resetZoom:f}},Aft=({data:e,xScale:t,xGet:n,width:r})=>{const s=e.filter(c=>{const u=t(n(c));return u!==void 0&&u>=0&&u<=r});if(s.length<2)return{visibleData:s,visibleDays:qae(e)};const o=n(s[0]),i=(n(s[s.length-1]).getTime()-o.getTime())/(1e3*60*60*24);return{visibleData:s,visibleDays:i}},Nft=e=>{const t=e*.05;return Math.max(10,Math.min(t,100))},l0=(e,t,n)=>{const r=Nft(n),s=t(e);return s!==void 0&&s>=r&&s<=n-r},Rft=e=>{const t=e.match(/(\d{4})-(\d{2})-(\d{2})/);return t?t[0]:void 0},Dft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getHours(),u=i.getMinutes(),m=[0,30].find(g=>u>=g-5&&u<=g+5);if(m===void 0)return;const h=`${`${i.getFullYear()}-${i.getMonth()}-${i.getDate()}`}-${c}-${m}`;if(!o.has(h)){const g=new Date(i);g.setMinutes(m,0,0),s.push({date:g,label:!0,line:l0(g,r,n)}),o.add(h)}}),s},jft=({history:e,xGet:t,xGetUnparsed:n,width:r,xScale:s})=>{const o=[],a=new Set;return e.forEach(i=>{const c=t(i),u=Rft(n(i));u&&!a.has(u)&&(o.push({date:c,label:!0,line:l0(c,s,r)}),a.add(u))}),o};function Ift(e){const t=new Date(e.getFullYear(),e.getMonth(),1).getDay(),n=t===0?6:t-1;return Math.ceil((e.getDate()+n)/7)}const Pft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getMonth(),u=Ift(i),f=`${c}-${u}`;o.has(f)||(s.push({date:i,label:!0,line:l0(i,r,n)}),o.add(f))}),s.filter((a,i,c)=>i?a.date.getTime()-c[i-1].date.getTime()>1e3*60*60*24*6:!0)},Oft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getMonth(),f=`${i.getFullYear()}-${c}`;o.has(f)||(s.push({date:i,label:!0,line:l0(i,r,n)}),o.add(f))}),s},Lft=({history:e,xGet:t,width:n,xScale:r})=>{const s=[],o=new Set;return e.forEach(a=>{const i=t(a),c=i.getFullYear();o.has(c)||(s.push({date:i,label:!0,line:l0(i,r,n)}),o.add(c))}),s},Fft=e=>e<=1?Dft:e<=7?jft:e<=45?Pft:e<=365?Oft:Lft,Bft=({ticks:e,maxTicks:t,xScale:n,width:r})=>{if(e.length<=t)return e;const s=r/(t*2),o=[];let a;for(const i of e){const c=n(i.date);c!==void 0&&(a===void 0||c-a>=s)&&(o.push(i),a=c)}return o},T8=(e,t)=>e.date.toLocaleDateString(e.locale,{timeZone:e.timezone??void 0,...t}),Uft=e=>{const t=e.date.getMinutes()!==0;return e.date.toLocaleTimeString(e.locale,{timeZone:e.timezone??void 0,hour:"numeric",minute:t?"numeric":void 0})},Vft=e=>Uft(e),Hft=e=>T8(e,{month:"short",day:"numeric"}),zft=e=>T8(e,{month:"short"}),Wft=e=>T8(e,{year:"numeric"}),Gft=({days:e})=>e<=1?Vft:e<=62?Hft:e<=365?zft:Wft,ble=({history:e,xGet:t,xGetUnparsed:n,timezone:r,locale:s,width:o,xScale:a})=>{const{visibleDays:i}=d.useMemo(()=>Aft({data:e,xScale:a,xGet:t,width:o}),[e,a,t,o]),c=d.useMemo(()=>Gft({days:i}),[i]),u=d.useMemo(()=>o8(e),[e]),f=d.useMemo(()=>{if(u)return;const x=Fft(i)({history:e,xGet:t,xGetUnparsed:n,locale:s,xScale:a,width:o});if(x)return Bft({ticks:x,maxTicks:tB,xScale:a,width:o})},[e,t,n,s,a,o,i,u]),m=d.useMemo(()=>{const y=f?.filter(v=>v.label).map(v=>v.date);if(!y?.length)return;const x=Gae({ticks:y,xScale:a,width:o,formatter:v=>c({date:v,locale:s,timezone:r}),marginLeft:25,marginRight:70});return x.length?x:void 0},[f,a,o,c,s,r]),p=d.useMemo(()=>{const y=f?.filter(x=>x.line).map(x=>x.date);return y?.length?y:void 0},[f]),h=d.useCallback(y=>c({date:y,locale:s,timezone:r}),[c,s,r]);return{xTickLabels:m,xTickFormatter:h,xTickLines:p,xTickCount:m?void 0:tB}},$ft={US:"US"},qft=Ft("FinanceIndexContext",{country:$ft.US,setCountry:()=>{},enabled:!1}),Kft=()=>{const e=d.useContext(qft);if(!e)throw new Error("useFinanceCountry must be used within a FinanceCountryProvider");return e},Yft=e=>e===0?"":e>0?"+":"-",Qft=e=>e===0?"light":e>0?"positive":"negative",t_=A.memo(({change:e,variant:t="small",includeIcon:n=!1,className:r,background:s=!0,mono:o=!0,hover:a=!1,format:i,suffix:c,animated:u})=>{const f=d.useMemo(()=>i||{style:"percent",minimumFractionDigits:2},[i]);return l.jsxs(V,{as:"span",variant:t,color:Qft(e),className:z("transition-background-color flex shrink-0 grow-0 items-center justify-center gap-[0.1em] rounded text-center font-mono duration-200 ease-in-out",{"bg-positive/10":e>0&&s,"bg-negative/10":e<0&&s,"bg-subtle":e===0&&s,"px-[0.6em] py-[0.15em]":s,"!pl-[0.3em]":s&&n,"!py-0 !pb-px":t==="micro","hover:bg-positive/20 hover:text-positive":a&&e>0&&s,"hover:bg-negative/20 hover:text-negative":a&&e<0&&s,"hover:bg-subtle":a&&e===0&&s},r),children:[l.jsx("span",{className:z("inline-flex",{"-mt-px":o}),children:n?l.jsx(ge,{icon:B("arrow-right"),className:z("inline-flex size-[1.2em] transition-transform duration-500 ease-in-out",{"!mt-px":o,"rotate-45":e<0,"-rotate-45":e>0})}):l.jsx("span",{className:o?"font-mono":"",children:Yft(e)})}),l.jsx("span",{className:z("whitespace-nowrap",{"font-mono":o}),children:l.jsx(Nb,{value:Math.abs(e)/100,format:f,suffix:c,animated:u})})]})});t_.displayName="FinancePriceChange";const Xft="recent-tickers:2",Zft=5,Jft=e=>{if(typeof window>"u")return[];try{const t=vt.getItem(e);return t?JSON.parse(t):[]}catch{return[]}},rB=(e,t)=>{if(!(typeof window>"u"))try{vt.setItem(e,JSON.stringify(t))}catch{}},emt=({storageKey:e,maxItems:t,getUniqueId:n})=>{const[r,s]=d.useState([]);d.useEffect(()=>{s(Jft(e))},[e]);const o=d.useCallback(i=>{s(c=>{const u=n(i),f=c.filter(p=>n(p)!==u),m=[i,...f].slice(0,t);return rB(e,m),m})},[e,t,n]),a=d.useCallback(()=>{s([]),rB(e,[])},[e]);return d.useMemo(()=>({recentItems:r,addRecentItem:o,clearRecentItems:a}),[r,o,a])},A8=()=>{const{recentItems:e,addRecentItem:t,clearRecentItems:n}=emt({storageKey:Xft,maxItems:Zft,getUniqueId:r=>r.symbol});return{recentTickers:e,addRecentTicker:t,clearRecentTickers:n}},N8=({isOpen:e,onClose:t,refs:n})=>{d.useEffect(()=>{if(!e)return;const r=o=>{n.some(i=>i.current?.contains(o.target))||t()},s=o=>{o.key==="Escape"&&t()};return document.addEventListener("mousedown",r,!0),document.addEventListener("keydown",s,!0),()=>{document.removeEventListener("mousedown",r,!0),document.removeEventListener("keydown",s,!0)}},[e,t,n])},tmt=({value:e,isFocused:t,defaultSuggestions:n=[],reason:r})=>{const{country:s}=Kft(),o=Yt(),{data:a,isLoading:i}=mt({queryKey:BP(e,s),queryFn:()=>UP({query:e,reason:r,country:s}),staleTime:0,enabled:t}),c=d.useMemo(()=>n?.length&&e===""?"suggestions":a?.length&&e===""?"trending":"search",[n,e,a?.length]),{$t:u}=J(),f=d.useMemo(()=>{if(c==="suggestions")return u({defaultMessage:"Suggested",id:"a0lFbMbzyl"});if(c==="trending")return u({defaultMessage:"Trending",id:"ll/ufR0/ED"})},[c,u]),m=d.useMemo(()=>{if(c==="suggestions")return n;const p=a?.filter(h=>h.category==="ticker");return p?p.map(h=>({symbol:h.query??"",name:h.description??"",image:h.image??"",darkImage:h.image_dark??"",url:h.url??"",exchange:h.metadata?.price_info?.exchange??"",country:h.metadata?.price_info?.exchangeCountry??"",currency:h.metadata?.price_info?.currency??"",change:h.metadata?.price_info?.change??void 0,currentPrice:h.metadata?.price_info?.currentPrice??void 0,changesPercentage:h.metadata?.price_info?.changePercentage??void 0})):[]},[a,n,c]);return d.useEffect(()=>{o.prefetchQuery({queryKey:BP("",s),queryFn:()=>UP({query:"",reason:r,country:s}),staleTime:0})},[o,s,r]),{suggestions:m?.length?m:[],isLoadingSuggestions:i,mode:c,title:f}},nmt=({focusedIndex:e,setFocusedIndex:t,onSelect:n})=>d.useCallback((s,o)=>{s.key==="ArrowDown"?(s.preventDefault(),t(e===null?0:Math.min(e+1,o.length-1))):s.key==="ArrowUp"?(s.preventDefault(),t(e===null?0:Math.max(e-1,0))):s.key==="Enter"&&e!==null&&(s.preventDefault(),n(o[e]))},[e,t,n]),_le=({onClick:e,defaultSuggestions:t=[],reason:n="finance-navigational-searchbar",onAssetSelect:r}={})=>{const[s,o]=d.useState(!1),[a,i]=d.useState(""),[c,u]=d.useState(null),{inApp:f}=Sa(),m=Rn();d.useEffect(()=>u(null),[a]);const{suggestions:p,isLoadingSuggestions:h,mode:g,title:y}=tmt({value:a,isFocused:s,defaultSuggestions:t,reason:n}),x=d.useCallback(S=>{const C=Ab({href:S?.url,inApp:f,queryParams:null});C&&m.push(C)},[m,f]),v=e??x,b=d.useCallback(()=>{o(!1),u(null)},[]),_=d.useCallback(S=>{v(S),b(),i(""),S&&r?.(S)},[v,b,r]),w=nmt({focusedIndex:c,setFocusedIndex:u,onSelect:_});return{isFocused:s,value:a,focusedIndex:c,isLoadingSuggestions:h,suggestions:p,mode:g,title:y,setIsFocused:o,setValue:i,setFocusedIndex:u,handleKeyDown:w,openAsset:_,closeSearch:b}},rmt=d.memo(()=>{const{recentTickers:e,addRecentTicker:t,clearRecentTickers:n}=A8(),r=_le({onAssetSelect:t}),{$t:s}=J(),o=d.useRef(null),{isMobileStyle:a}=Re(),i=d.useMemo(()=>e.length&&r.value===""?e:[],[e,r.value]),c=d.useCallback(f=>{r.handleKeyDown(f,[...i,...r.suggestions])},[r,i]),u=d.useRef(null);return N8({isOpen:r.isFocused,onClose:()=>r.setIsFocused(!1),refs:[u]}),l.jsxs("div",{ref:u,className:"pt-one relative md:w-full md:max-w-[360px]",children:[l.jsx(co,{type:"search",placeholder:s(a?{defaultMessage:"Search tickers...",id:"na0wZ6TycW"}:{defaultMessage:"Search for stocks, crypto, and more...",id:"sX/a414S1y"}),isMobileUserAgent:!1,onFocus:()=>r.setIsFocused(!0),onChange:r.setValue,onKeyDown:c,className:"bg-subtler !focus:ring-super/50 dark:focus:!ring-super/50 h-9 w-full !border-none !py-0",ref:o}),r.isFocused&&l.jsx("div",{className:z("z-50",{"fixed inset-x-0 top-[var(--header-height)]":a,"absolute left-1/2 top-full mt-2 min-w-[500px] -translate-x-1/2":!a}),children:l.jsx(Sle,{title:r.title,isLoadingSuggestions:r.isLoadingSuggestions,recentTickers:i,suggestions:r.suggestions,value:r.value,focusedIndex:r.focusedIndex,setIsFocused:r.setIsFocused,setValue:r.setValue,openAsset:r.openAsset,trailing:l.jsx(Cle,{onClick:n})})})]})});rmt.displayName="FinanceNavigationalSearchbarHeader";const wle=d.memo(({defaultSuggestions:e=[],onClick:t})=>{const{addRecentTicker:n}=A8(),r=_le({onClick:t,defaultSuggestions:e,onAssetSelect:n}),s=d.useRef(null);d.useEffect(()=>{s.current&&s.current.focus()},[]);const o=d.useCallback(i=>{(i.key==="ArrowDown"||i.key==="ArrowUp"||i.key==="Enter")&&r.handleKeyDown(i,r.suggestions)},[r]),{$t:a}=J();return l.jsxs(l.Fragment,{children:[l.jsx(K,{className:"p-sm w-full",children:l.jsx(co,{type:"search",placeholder:a({defaultMessage:"Search tickers...",id:"na0wZ6TycW"}),isMobileUserAgent:!1,onFocus:()=>r.setIsFocused(!0),onChange:r.setValue,onKeyDown:o,ref:s})}),l.jsx(K,{className:"w-full",children:r.isLoadingSuggestions?l.jsx("div",{className:"p-md flex items-center justify-center opacity-50",children:l.jsx(Gl,{size:14})}):r.suggestions.length===0?l.jsx(V,{variant:"small",color:"light",className:"p-md text-center",children:a({defaultMessage:"No results",id:"jHJmjfxD4s"})}):r.suggestions.map((i,c)=>l.jsx(R8,{ticker:i,openAsset:r.openAsset,isFocused:r.focusedIndex===c,setIsFocused:r.setIsFocused,setValue:r.setValue},i.symbol+"suggestion"))})]})});wle.displayName="FinanceNavigationalSearchbarInline";const Cle=d.memo(({onClick:e})=>{const{$t:t}=J(),n=d.useCallback(r=>{r.stopPropagation(),e()},[e]);return l.jsx("div",{className:"flex h-0 items-center",children:l.jsx(st,{icon:B("x"),size:"tiny",pill:!0,onClick:n,extraCSS:"-mr-sm opacity-50 hover:opacity-100",toolTip:t({defaultMessage:"Clear recents",id:"4k9F3xn5kg"})})})});Cle.displayName="ClearRecentButton";const Sle=d.memo(({title:e,isLoadingSuggestions:t,recentTickers:n,suggestions:r,value:s,focusedIndex:o,setIsFocused:a,setValue:i,openAsset:c,trailing:u})=>{const{$t:f}=J(),{inApp:m}=Sa(),p=r&&r.length>0,h=r?.length===0&&s!=="",g=n.length>0&&s==="";return!(p||g)&&!t?null:l.jsx(K,{variant:"raised",className:z("relative flex flex-col overflow-hidden rounded-b-xl shadow-md md:rounded-xl md:border md:shadow-xl",{"-mt-one":m}),children:t?l.jsx("div",{className:"p-md flex items-center justify-center opacity-50",children:l.jsx(Gl,{size:14})}):h?l.jsx(V,{variant:"small",color:"light",className:"p-md text-center",children:f({defaultMessage:"No results",id:"jHJmjfxD4s"})}):l.jsxs(l.Fragment,{children:[g&&l.jsxs(l.Fragment,{children:[l.jsx(L5,{title:f({defaultMessage:"Recent",id:"iXpep1vGVo"}),trailing:u}),l.jsx("div",{className:"gap-xs p-sm flex flex-wrap",children:n.map((x,v)=>l.jsx(Ele,{ticker:x,openAsset:c,isFocused:o===v,setIsFocused:a,setValue:i},`${x.symbol}-recent`))})]}),e?l.jsx(L5,{title:e}):l.jsx(K,{className:"border-b"}),r.map((x,v)=>l.jsx(R8,{ticker:x,openAsset:c,isFocused:o===v+n.length,setIsFocused:a,setValue:i},x.symbol+"suggestion"))]})})});Sle.displayName="NavigationalMenuContent";const L5=d.memo(({title:e,trailing:t})=>l.jsxs("div",{className:"bg-subtler gap-sm px-md py-sm flex items-center justify-between",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:e}),t]}));L5.displayName="Header";const Ele=d.memo(({ticker:e,isFocused:t,openAsset:n})=>l.jsxs(K,{className:"pl-xs pr-sm group relative inline-flex cursor-pointer overflow-hidden rounded-full border py-0.5",as:"button",onClick:()=>n(e),children:[l.jsx(K,{className:z("absolute inset-0 rounded-full opacity-0 group-hover:opacity-100",t&&"opacity-100"),variant:"subtler"}),l.jsxs("div",{className:"gap-xs relative flex max-w-[200px] items-center",children:[l.jsx(Z6,{watchlistType:"FINANCE",image:e.image,imageDark:e.darkImage,alt:e.name,imageClassName:"!size-4 overflow-hidden rounded"}),l.jsx(V,{variant:"tiny",className:"truncate",children:e.name}),l.jsx(V,{variant:"tinyMono",color:"light",className:"shrink-0",children:e.symbol})]})]}));Ele.displayName="NavigationalSearchbarRecentItem";const R8=d.memo(({ticker:e,isFocused:t,openAsset:n})=>{const{addRecentTicker:r}=A8(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(()=>{r(e),n(e),o("finance link clicked",{referrer:Rb.SEARCH_AUTOSUGGEST,targetPageType:Jg.ASSET_PAGE,symbol:e.symbol,destinationUrl:e.url})},[r,e,n,o]);return l.jsxs(K,{className:"gap-sm px-md py-sm group relative flex w-full cursor-pointer appearance-none items-center justify-between border-b text-left last:border-b-0",onClick:a,as:"button",children:[l.jsx(K,{className:z("absolute inset-0 opacity-0 group-hover:opacity-100",t&&"opacity-100"),variant:"subtler"}),l.jsxs("div",{className:"gap-md relative flex w-full items-center justify-between",children:[l.jsxs("div",{className:"gap-sm flex min-w-0 items-center",children:[l.jsx(Z6,{watchlistType:"FINANCE",image:e.image,imageDark:e.darkImage,alt:e.name,className:"shrink-0 overflow-hidden rounded"}),l.jsxs("div",{className:"min-w-0 max-w-[200px]",children:[l.jsx(V,{variant:"smallBold",className:"truncate",children:e.name}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e.symbol,exchange:e.exchange,country:e.country})})]})]}),l.jsxs("div",{className:"gap-sm flex items-center",children:[e.currentPrice&&e.currency?l.jsx(V,{variant:"tinyMono",color:"light",children:e.currentPrice.toLocaleString("en-US",{style:"currency",currency:e.currency})}):null,e.changesPercentage?l.jsx(t_,{change:e.changesPercentage,variant:"tinyMono",includeIcon:!0}):null,l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet -mr-xs"})]})]})]})});R8.displayName="NavigationalSearchbarItem";function sB(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 smt(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,i;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,i=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw i}}}}function imt(e,t){var n=[],r=[];function s(o,a){if(o.length===1)n.push(o[0]),r.push(o[0]);else{for(var i=Array(o.length-1),c=0;c=3&&(t.x1=e[1][0],t.y1=e[1][1]),t.x=e[e.length-1][0],t.y=e[e.length-1][1],e.length===4?t.type="C":e.length===3?t.type="Q":t.type="L",t}function cmt(e,t){t=t||2;for(var n=[],r=e,s=1/t,o=0;o0?m-=1:m0&&(m-=1))}return c[m]=(c[m]||0)+1,c},[]),i=a.reduce(function(c,u,f){if(f===e.length-1){var m=F5(u,rx({},e[e.length-1]));return m[0].type==="M"&&m.forEach(function(p){p.type="L"}),c.concat(m)}return c.concat(pmt(e[f],e[f+1],u))},[]);return i.unshift(e[0]),i}function iB(e){for(var t=(e||"").match(dmt)||[],n=[],r,s,o=0;o0&&r[r.length-1].type==="Z"&&r.pop(),s.length>0&&s[s.length-1].type==="Z"&&s.pop(),r.length?s.length||s.push(r[0]):r.push(s[0]);var u=Math.abs(s.length-r.length);u!==0&&(s.length>r.length?r=aB(r,s,a):s.length{const r=d.useRef(e),s=d.useRef(e),[o,a]=dIe(()=>({t:1,config:{duration:n},easing:Qd}));return s.current!==e&&(r.current=s.current,s.current=e,a.start({from:{t:0},to:{t:1},immediate:!t,config:{duration:n}})),o.t.to(i=>gmt(r.current,s.current)(i))};var Mle="Toggle",Tle=d.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:s,...o}=e,[a,i]=fo({prop:n,onChange:s,defaultProp:r??!1,caller:Mle});return l.jsx(Et.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:rt(e.onClick,()=>{e.disabled||i(!a)})})});Tle.displayName=Mle;var ic="ToggleGroup",[Ale]=Vs(ic,[Jl]),Nle=Jl(),D8=A.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const s=r;return l.jsx(ymt,{...s,ref:t})}if(n==="multiple"){const s=r;return l.jsx(xmt,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${ic}\``)});D8.displayName=ic;var[Rle,Dle]=Ale(ic),ymt=A.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[a,i]=fo({prop:n,defaultProp:r??"",onChange:s,caller:ic});return l.jsx(Rle,{scope:e.__scopeToggleGroup,type:"single",value:A.useMemo(()=>a?[a]:[],[a]),onItemActivate:i,onItemDeactivate:A.useCallback(()=>i(""),[i]),children:l.jsx(jle,{...o,ref:t})})}),xmt=A.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...o}=e,[a,i]=fo({prop:n,defaultProp:r??[],onChange:s,caller:ic}),c=A.useCallback(f=>i((m=[])=>[...m,f]),[i]),u=A.useCallback(f=>i((m=[])=>m.filter(p=>p!==f)),[i]);return l.jsx(Rle,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:l.jsx(jle,{...o,ref:t})})});D8.displayName=ic;var[vmt,bmt]=Ale(ic),jle=A.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:a,loop:i=!0,...c}=e,u=Nle(n),f=Pf(a),m={role:"group",dir:f,...c};return l.jsx(vmt,{scope:n,rovingFocus:s,disabled:r,children:s?l.jsx(Zx,{asChild:!0,...u,orientation:o,dir:f,loop:i,children:l.jsx(Et.div,{...m,ref:t})}):l.jsx(Et.div,{...m,ref:t})})}),sx="ToggleGroupItem",Ile=A.forwardRef((e,t)=>{const n=Dle(sx,e.__scopeToggleGroup),r=bmt(sx,e.__scopeToggleGroup),s=Nle(e.__scopeToggleGroup),o=n.value.includes(e.value),a=r.disabled||e.disabled,i={...e,pressed:o,disabled:a},c=A.useRef(null);return r.rovingFocus?l.jsx(Jx,{asChild:!0,...s,focusable:!a,active:o,ref:c,children:l.jsx(lB,{...i,ref:t})}):l.jsx(lB,{...i,ref:t})});Ile.displayName=sx;var lB=A.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...s}=e,o=Dle(sx,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=o.type==="single"?a:void 0;return l.jsx(Tle,{...i,...s,ref:t,onPressedChange:c=>{c?o.onItemActivate(r):o.onItemDeactivate(r)}})}),_mt=D8,wmt=Ile;const Cmt=({value:e,onChange:t,id:n,children:r,boxProps:s,className:o=""})=>{const a=i=>{i&&t(i)};return l.jsx(Ple.Provider,{value:{activeValue:e},children:l.jsx(yg,{id:n,children:l.jsx(_mt,{onValueChange:a,type:"single",value:e,asChild:!0,children:l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:l.jsx(K,{className:z("border-subtler p-two flex rounded-lg border",o),...s,children:r})})})})})},Smt=({value:e,icon:t,className:n="",children:r,disabled:s=!1,style:o,onClick:a})=>{const i="relative text-quiet hover:text-foreground data-[state=on]:text-foreground flex h-[32px] min-w-[32px] p-sm items-center justify-center duration-150 active:scale-95",c=d.useContext(Ple);return l.jsx(wmt,{asChild:!0,value:e,disabled:s,children:l.jsxs("button",{className:z(i,{"cursor-not-allowed":s},n),disabled:s,style:o,onClick:a,children:[l.jsxs("span",{className:z("gap-xs relative z-[2] flex",{"opacity-50":s}),children:[Array.isArray(t)?t.map((u,f)=>l.jsx(rn,{icon:u,size:"small"},f)):t?l.jsx(rn,{icon:t,size:"small"}):null,r]}),c.activeValue===e&&l.jsx(Te.div,{layout:!0,layoutId:"toggle",className:"absolute inset-0 z-[1]",transition:{duration:.15,ease:Qd},children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-current opacity-10"})})]})})},Ple=Ft("ToggleGroupContext",{activeValue:""}),Emt=Cmt,kmt=Smt,Xa={Root:Emt,Item:kmt},Mmt=[0,5,10,25,50,100,200],B5=He({advanced:{defaultMessage:"Advanced",id:"3Rx6Qo1x+1"},sma:{defaultMessage:"Simple Moving Average",id:"6Az5TSZOco"},period:{defaultMessage:"Period",id:"jCNpELHqTA"},off:{defaultMessage:"Off",id:"OvzONl52rs"}}),Tmt=(e,t)=>{if(!e?.length||t<=0)return[];const n=[];let r=0;for(let s=0;s=t){const i=e[s-t]?.close;i&&(r-=i)}if(s>=t-1){const i=s{const[e,t]=d.useState(0);return{sma:{period:e,setPeriod:t}}},Ole=d.memo(({history:e,xScale:t,yScale:n,indicators:r})=>{const s=r?.sma?.period??0,o=s>0,a=d.useMemo(()=>Tmt(e,s),[e,s]),i=d.useMemo(()=>sl().defined(f=>yd(f.value)).x(f=>{const m=new Date(f.date);return t(m)??0}).y(f=>n(f.value)??0).curve(Db),[t,n]),c=d.useMemo(()=>i(a)??void 0,[i,a]),u=n_(c??"",!0,ii);return o?l.jsx(Te.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:ii/1e3,ease:"easeInOut"},children:l.jsx(fa.path,{d:u,fill:"none",stroke:er.gray,strokeWidth:1.5,strokeDasharray:"none",shapeRendering:am,style:{vectorEffect:"non-scaling-stroke"}})}):null});Ole.displayName="FinanceStockHistoryChartSimpleMovingAverage";const cB="flex flex-col p-sm gap-md",Lle=d.memo(({children:e})=>{const{$t:t}=J(),[n,r]=d.useState(!1),s=d.useRef(null),o=d.useRef(null),a=d.useRef(null),{isMediumScreen:i}=GN();N8({isOpen:n,onClose:()=>r(!1),refs:[s,o,a]});const c=l.jsx(Fo,{content:t(B5.advanced),disabled:n,children:l.jsx("button",{ref:s,onClick:()=>r(u=>!u),className:z(ru,"px-sm group h-full bg-transparent transition-transform"),children:l.jsx(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center pt-px",children:l.jsx(ut,{name:B("dots-vertical"),className:"size-4"})})})});return i?l.jsxs("div",{ref:a,className:"relative",children:[c,n&&l.jsx(K,{className:"z-100 absolute right-0 top-full mt-2 overflow-hidden rounded-xl border shadow-md",children:l.jsx("div",{className:z("bg-base",cB),children:e})})]}):l.jsxs(l.Fragment,{children:[c,n&&l.jsx(Xl,{children:l.jsxs("div",{ref:o,className:"bg-base border-subtlest shadow-overlay fixed inset-x-0 top-0 z-50 flex flex-col overflow-hidden rounded-b-xl border-x border-b",children:[l.jsx("div",{className:"flex items-center p-md",children:l.jsx("button",{onClick:()=>r(!1),children:l.jsx(ut,{name:B("arrow-left"),className:"text-quiet size-5"})})}),l.jsx(K,{className:z("flex-1 overflow-auto p-sm",cB),children:e})]})})]})});Lle.displayName="FinanceStockHistoryAdvancedMenu";const Fle=d.memo(({history:e,indicators:t})=>{const{sma:n}=t,{$t:r}=J(),s=e?.length??0,o=Mmt.map(i=>({value:i,label:i===0?r(B5.off):i.toString(),disabled:i>0&&s{n.setPeriod(+i)},[n]);return l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",className:"pb-sm px-xs",children:r(B5.sma)}),l.jsx(K,{children:l.jsx(Xa.Root,{value:n.period.toString(),onChange:a,id:"sma",className:"flex items-center w-fit",children:o.map(i=>l.jsx(Xa.Item,{value:String(i.value),disabled:i.disabled,children:l.jsx(V,{variant:"tiny",color:n.period===i.value?"default":"light",className:"whitespace-nowrap",children:i.label})},i.value))})})]})});Fle.displayName="FinanceStockHistorySMAControl";const Ble=d.memo(({setFullscreen:e,fullscreen:t})=>{const{$t:n}=J();return t?null:l.jsx(Fo,{content:n({defaultMessage:"Fullscreen",id:"zvKOAuzJQK"}),children:l.jsx("button",{onClick:()=>e(!t),style:{minHeight:Bae},className:z(ru,"flex items-center justify-center px-sm h-full"),children:l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ut,{name:B(t?"minimize":"maximize"),size:16})})})})});Ble.displayName="FinanceStockHistoryChartControlsContainerFullscreenButton";const Nmt=e=>Math.round(e*.12),Ua=e=>e.close,j8=(e,t)=>{const[n,r]=t;return n===r?0:(e-n)/(r-n)*100},T1=e=>e?.type?1:0,Rmt=({exchangeHoursAnnotations:e,xScale:t,width:n,xMaskingSupported:r,tzOffsetMins:s,history:o})=>{const a=r?e:[],i=[],c="invert"in t,u=c?n:o.length,f=h=>{if(c)return{x:h,date:t.invert(h)};const g=o[h];return{x:t(wn(g))??0,date:wn(g)}};let m,p;for(let h=0;h{const a=o(wn(e))??0,i=o(wn(t))??0,c=(s-n)/(r-n);return a+c*(i-a)},A1=(e,t,n)=>{const r=e>=t?El.POSITIVE:El.NEGATIVE,s=n?Oat[n]:{};return{backgroundColor:Wk[r],backgroundOpacity:1,lineColor:Wk[r],lineOpacity:1,valence:r,...s}},jmt=({history:e,baseline:t,exchangeHoursAnnotations:n,xScale:r,width:s,xMaskingSupported:o,tzOffsetMins:a})=>{if(!e?.length)return[];const i=o?n:[],c=[];let u;for(let m=0;m=t||y>=t&&x{const m=d.useMemo(()=>{const h=a(s),g=e(r);return g?`${g} L ${c[1]},${h} L ${c[0]},${h} Z`:""},[e,r,a,s,c]),p=d.useMemo(()=>{const h=a.domain(),g=h[1]-h[0],y=(h[1]-s)/g*100,x=(u-f)/u*100;return y*(x/100)},[a,s,u,f]);return l.jsxs(l.Fragment,{children:[l.jsxs("defs",{children:[l.jsx("linearGradient",{id:`ticker-area-color-gradient-${t}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",colorInterpolation:"linearRGB",spreadMethod:"pad",children:o.map((h,g)=>l.jsx("stop",{offset:`${j8(h.x,c)}%`,stopColor:er[h.backgroundColor],stopOpacity:h.backgroundOpacity},g))}),l.jsxs("linearGradient",{id:`ticker-area-opacity-gradient-${t}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[l.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"0.3"}),l.jsx("stop",{offset:`${Math.max(0,p-20)}%`,stopColor:"white",stopOpacity:"0.1"}),l.jsx("stop",{offset:`${p}%`,stopColor:"white",stopOpacity:"0.00"}),l.jsx("stop",{offset:`${Math.min(100,p+20)}%`,stopColor:"white",stopOpacity:"0.1"}),l.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.3"})]}),l.jsx("mask",{id:`ticker-area-mask-${t}`,children:l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#ticker-area-opacity-gradient-${t})`})})]}),l.jsx(St,{mode:"wait",children:l.jsx(Te.g,{mask:`url(#ticker-area-mask-${t})`,animate:{opacity:1},initial:{opacity:0},transition:jl,children:l.jsx("path",{d:m,fill:`url(#ticker-area-color-gradient-${t})`,stroke:"none",shapeRendering:am,style:{mixBlendMode:"multiply",...i}})},n)})]})},Pmt=({l:e,history:t,stops:n,xDomainData:r,id:s,disableAnimation:o})=>{const a=d.useMemo(()=>e(t),[e,t]),i=n_(a,!o,ii);return l.jsxs(l.Fragment,{children:[l.jsx("defs",{children:l.jsx("linearGradient",{id:`ticker-line-gradient-${s}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:n.map((c,u)=>l.jsx("stop",{offset:`${j8(c.x,r)}%`,stopColor:er[c.backgroundColor],stopOpacity:c.lineOpacity},u))})}),l.jsx(fa.path,{d:i,stroke:n?.length?`url(#ticker-line-gradient-${s})`:er.blue,strokeWidth:1.75,fill:"none",shapeRendering:am})]})},Omt=({id:e,stops:t,height:n,opacity:r,size:s,style:o,xBounds:a})=>l.jsxs("g",{children:[l.jsxs("defs",{children:[l.jsx("pattern",{id:`ticker-after-hours-dot-grid-${e}`,patternUnits:"userSpaceOnUse",width:s,height:s,children:l.jsx("circle",{cx:s/2,cy:s/2,r:s*.12,fill:er.gray,opacity:r})}),l.jsx("linearGradient",{id:`ticker-after-hours-mask-gradient-${e}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:t.map((i,c)=>l.jsx("stop",{offset:`${j8(i.x,a)}%`,stopColor:"white",stopOpacity:i.backgroundOpacity},c))}),l.jsx("mask",{id:`ticker-after-hours-mask-${e}`,children:l.jsx("rect",{x:0,y:"0",width:a[1],height:n,fill:`url(#ticker-after-hours-mask-gradient-${e})`})})]}),l.jsx("rect",{x:0,y:"0",style:o,width:a[1],height:n,fill:`url(#ticker-after-hours-dot-grid-${e})`,mask:`url(#ticker-after-hours-mask-${e})`})]}),Lmt=e=>e>=20&&e<=40?.95:e>500?.5:.8,Ule=d.memo(({top:e,height:t,data:n,xScale:r})=>{const s=d.useMemo(()=>{const c=Math.max(...n.map(u=>u.volume));return _8({exponent:.4,domain:[0,c],range:[0,t]})},[n,t]),o=d.useMemo(()=>{if(n.length<2)return 1;let c=1/0;for(let u=1;u0&&(c=Math.min(c,p))}return c===1/0?1:c*Lmt(n.length)},[n,r]),{positivePath:a,negativePath:i}=d.useMemo(()=>{const c=[],u=[],f=e+t;for(const m of n){if(m.volume===0)continue;const p=(r(wn(m))??0)-o/2,h=s(m.volume),g=f-h,x=m.close-m.open>=0,v=`M ${p} ${f} L ${p} ${g} L ${p+o} ${g} L ${p+o} ${f} Z`;x?c.push(v):u.push(v)}return{positivePath:c.join(" "),negativePath:u.join(" ")}},[n,r,o,s,e,t]);return l.jsxs("g",{children:[a&&l.jsx("path",{d:a,fill:er.blue,opacity:.75}),i&&l.jsx("path",{d:i,fill:er.red,opacity:.75})]})});Ule.displayName="Volume";const Fmt=({baseline:e,history:t,yScale:n,chartWidth:r,children:s})=>{const o=d.useMemo(()=>{const i=n(e),c=10,u=25,f=t.slice(-Math.max(3,Math.floor(t.length*.1))),m=f.reduce((y,x)=>y+n(Ua(x)),0)/f.length,p=Math.abs(m-i),g=!(i=c?!0:m>i);return{opacity:1,top:i,left:r-10,transform:`translate(-100%, ${g?"-100%":"0"})`}},[e,t,n,r]),a=d.useMemo(()=>({...o,opacity:0}),[o]);return r<25?null:l.jsx(Te.div,{className:"pointer-events-none absolute z-50",initial:a,animate:o,transition:{duration:.5,ease:"easeInOut"},children:s})},Bmt=(e,t)=>{if(!e?.length)return;const n=ko(e,$2),r=wL(n[0],t?.open??""),s=wL(n[1],t?.close??"");let o=n[0],a=n[1];return ra&&(a=s),[new Date(o),new Date(a)]},Umt=(e,t,n,r)=>{const[s,o]=d.useState(null),a=d.useCallback(()=>{e?.point.local.x&&o(e.point.local.x)},[e?.point.local.x]),i=d.useCallback(()=>{o(null)},[]),c=d.useMemo(()=>s===null?null:s8(s,t,n).d,[t,n,s]),u=d.useMemo(()=>{if(!c||!e)return null;const[x,v]=[e.data,c].sort((b,_)=>_.date.localeCompare(b.date));return{absolute:x.close-v.close,relative:(x.close-v.close)/v.close}},[c,e]),f=d.useMemo(()=>t.range()[1],[t]),m=d.useMemo(()=>!s||!c?null:t(wn(c)),[t,c,s]),p=d.useMemo(()=>!s||!c||!e?null:t(wn(e.data))??f,[t,c,s,e,f]),h=d.useMemo(()=>!c||!e||!s?`M 0 0 L ${f} 0 L ${f} ${r} L 0 ${r} Z`:`M ${m} 0 L ${p} 0 L ${p} ${r} L ${m} ${r} Z`,[c,e,s,r,m,p,f]),g="finance-chart-clip-path",y=d.useMemo(()=>({clipPath:`url(#${g})`}),[g]);return{id:g,path:h,style:y,animate:!s,absoluteChange:u?.absolute,relativeChange:u?.relative,handleMouseDown:a,handleMouseUp:i,leftX:m,rightX:p}},Vmt=({id:e,path:t})=>l.jsx("defs",{children:l.jsx("clipPath",{id:e,children:l.jsx(fa.path,{d:t})})}),Vle=d.memo(({id:e,symbol:t,exchangeTimezone:n,exchangeHours:r,currency:s,history:o,previousClose:a,width:i,height:c,exchangeHoursAnnotations:u=[],uiHints:f,technical:m,candlestick:p,indicators:h,watermark:g,zoomable:y,isCrypto:x})=>{const{locale:v,$t:b}=J(),_=d.useMemo(()=>o.toSorted((ve,Ae)=>ve.date.localeCompare(Ae.date)),[o]),w=Nmt(c),S=d.useMemo(()=>o8(_),[_]),C=`${t}-${f?.currentPeriod}-${f?.currentInterval}`,{transform:E,isActivelyZooming:T,containerRef:k}=vle({enabled:!!y,width:i,id:C}),I=d.useMemo(()=>Hat(_),[_]),M=d.useMemo(()=>new Set(f?.historyAnomalies??[]),[f?.historyAnomalies]),N=d.useMemo(()=>_.filter(ve=>!M.has(ve.date)),[_,M]),D=d.useMemo(()=>Lat(N,f?.historyMovingAverageWindow??0),[N,f?.historyMovingAverageWindow]),j=d.useMemo(()=>{const ve=Bmt(_,r);return lm({domain:ve,range:[0,i]})},[_,i,r]),F=d.useMemo(()=>s0({domain:_.map(wn),range:[0,i]}),[_,i]),R=d.useMemo(()=>S?yle(E,j):xle(E,F),[E,j,F,S]),P=d.useMemo(()=>ko(_,wn).map(ve=>R(ve)),[R,_]),L=d.useMemo(()=>[0,i],[i]),U=d.useMemo(()=>{if(p){const ve=N.map(We=>We.low),Ae=N.map(We=>We.high);return[Math.min(...ve),Math.max(...Ae)]}return ko(N,Ua)},[N,p]),O=a??0,$=d.useMemo(()=>{let ve=U[0],Ae=U[1];O&&(ve=Math.min(ve,O),Ae=Math.max(Ae,O));const We=Ae-ve;return ve-=We*.05,Ae+=We*.05,Bi({nice:!1,domain:[ve,Ae],range:m?[c-xs-w,Rd]:[c-xs,Rd]})},[c,O,U,m,w]),G=d.useMemo(()=>sl().x(ve=>R(wn(ve))??0).y(ve=>$(Ua(ve))??0).curve(Db),[R,$]),H=I&&!!u.length,Q=d.useMemo(()=>Iat(n??"UTC",new Date),[n]),{tooltipData:Y,hideTooltip:te,showTooltip:se}=_ft({data:_,exchangeHoursAnnotations:u,xScale:R,xBounds:P,hidden:T,tzOffsetMins:Q}),{handleMouseDown:ae,handleMouseUp:X,leftX:ee,rightX:le,...re}=Umt(Y,R,_,c),ce=Sft(re.absoluteChange),ue=d.useCallback(()=>{X(),te()},[X,te]),{isMobileStyle:me}=Re(),we=me?Vae:Uae,ye=d.useMemo(()=>$.ticks(we),[$,we]),{xTickLabels:_e,xTickFormatter:ke,xTickLines:De,xTickCount:xe}=ble({history:_,xGet:wn,xGetUnparsed:$2,timezone:n,locale:v,xScale:R,width:i,zoom:E.k}),Ue=d.useMemo(()=>Rmt({xMaskingSupported:H,xScale:R,width:i,exchangeHoursAnnotations:u??[],tzOffsetMins:Q,history:_}),[H,R,i,u,Q,_]),Ee=d.useMemo(()=>jmt({xMaskingSupported:H,history:D,baseline:O,xScale:R,width:i,exchangeHoursAnnotations:u??[],tzOffsetMins:Q}),[H,D,O,R,i,u,Q]),Ke=d.useCallback(ve=>zae({tick:ve,history:D,yScale:$,xScale:R,yGet:Ua,baseline:O}),[D,$,R,O]),Nt=d.useMemo(()=>!Ue.length,[Ue]),pe=d.useMemo(()=>x?W({defaultMessage:"24h ago: {price}",id:"mSeez9Kv3Q"}):W({defaultMessage:"Prev close: {price}",id:"ZjNVXgqGKh"}),[x]);return l.jsxs("div",{ref:k,className:JN,onMouseDown:ae,onMouseMove:se,onMouseLeave:ue,onMouseOut:ue,onMouseUp:X,onTouchStart:se,onTouchMove:se,onTouchEnd:ue,onTouchCancel:ue,children:[l.jsxs("svg",{height:c,width:i,className:ZN,children:[l.jsx(St,{initial:!1,mode:"wait",children:Nt&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:jl,children:[l.jsx(bu,{tickValues:ye,scale:$,width:i,stroke:er.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx($b,{scale:R,opacity:.1,height:c*2,stroke:er.gray,style:{transform:`translateY(-${c}px)`},numTicks:xe,strokeWidth:1,tickValues:De})]},C)}),l.jsx(Vmt,{id:re.id,path:re.path}),!p&&l.jsx(Imt,{l:G,id:t,animationId:C,history:D,baseline:O,stops:Ee,yScale:$,style:re.style,xDomainData:P,height:c,marginBottom:xs}),l.jsx(St,{mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},exit:Aat,animate:{opacity:1},transition:jl,children:[l.jsx(Omt,{id:e,stops:Ue,height:c*3,style:{transform:`translateY(-${c*3/2}px)`},width:i,opacity:.33,size:5,xBounds:L}),l.jsx("g",{opacity:Y?0:1,className:zk(!!Y),children:l.jsx(zl,{scale:$,hideTicks:!0,hideAxisLine:!0,numTicks:we,left:e8,orientation:"right",tickLabelProps:Ke})}),m&&l.jsx(Ule,{top:c-w-xs,height:w,data:N,xScale:R}),l.jsx(zl,{scale:R,hideAxisLine:!0,hideTicks:!0,numTicks:xe,tickValues:_e,tickFormat:ke,orientation:"bottom",top:c-xs,tickLabelProps:t8})]},C)}),!p&&l.jsx(Pmt,{l:G,id:t,history:D,baseline:O,stops:Ee,xDomainData:P,disableAnimation:T}),l.jsx(St,{mode:"wait",children:p&&l.jsx(Te.g,{initial:{opacity:0},exit:Rat,animate:{opacity:1},transition:Nat,children:l.jsx(cle,{xScale:R,yScale:$,history:N})},C)}),l.jsx(St,{children:l.jsx(I8,{width:i,yScale:$,baseline:O})}),l.jsx(St,{children:l.jsx(Ole,{history:_,xScale:R,yScale:$,indicators:h})}),Y&&l.jsx(Jb,{marginTop:-c,tooltipLeft:Y.point.local.x,innerHeight:c*3,color:ce})]}),l.jsx(St,{children:S&&l.jsx(Fmt,{baseline:O,history:_,yScale:$,chartWidth:i,children:l.jsx("div",{className:z("m-sm bg-base shadow-subtle overflow-hidden rounded-full border backdrop-blur-sm",zk(!!Y)),children:l.jsx("div",{className:"px-sm py-xs bg-subtle relative p-0",children:l.jsx(V,{variant:"micro",color:"light",className:"relative whitespace-nowrap",children:b(pe,{price:Rc(O,s,v)})})})})})}),l.jsx(St,{children:yd(ee)&&yd(le)&&l.jsx(Te.div,{animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},className:"pointer-events-none absolute inset-0",style:{left:le>ee?ee:le,right:i-(le>ee?le:ee),top:-c,bottom:-c},children:l.jsx(Te.div,{className:"bg-inverse absolute inset-0 rounded-md opacity-5"})})}),g&&l.jsx("div",{className:"absolute -top-md left-sm z-[2]",children:g}),Y&&!m&&l.jsx(wft,{x:Y.point.local.x,y:Y.point.touch?-xs:Y.point.local.y,annotation:Y.annotation,close:Y.data.close,date:Y.data.date,absoluteChange:re.absoluteChange,relativeChange:re.relativeChange,currency:s,exchangeTimezone:n??void 0}),Y&&m&&l.jsx(Cft,{x:Y.point.global.x,y:Y.point.global.y,annotation:Y.annotation,data:Y.data,currency:s,locale:v,exchangeTimezone:n??void 0,absoluteChange:re.absoluteChange,relativeChange:re.relativeChange})]})});Vle.displayName="Chart";const I8=d.memo(({width:e,yScale:t,baseline:n})=>l.jsx(Te.line,{stroke:er.gray,initial:{opacity:0},transition:{duration:ii/1e3,ease:"easeInOut"},animate:{opacity:1,x1:0,x2:e,y1:t(n??0),y2:t(n??0)},exit:{opacity:0},strokeDasharray:"4 4",strokeWidth:.8,shapeRendering:am}));I8.displayName="FinanceStockHistoryChartClosingLine";const P8=d.memo(({id:e,quote:t,technical:n,candlestick:r,indicators:s,watermark:o,height:a=a0,zoomable:i=!0})=>l.jsx(Mr,{fallback:dle,children:l.jsx(k8,{height:a,render:!!t,children:c=>!t||c<100||!t.history?.length?null:l.jsx(Vle,{id:e,symbol:t.symbol,currency:t.currency,history:t.history,previousClose:t.historicalPreviousClose??void 0,exchangeHours:t.exchangeHours,exchangeTimezone:t.exchangeTimezone,exchangeHoursAnnotations:t.exchangeHoursAnnotations,width:c,height:a,uiHints:t.uiHints,technical:n,candlestick:r,indicators:s,watermark:o,zoomable:i,isCrypto:t.isCrypto})})}));P8.displayName="FinanceStockHistoryChart";const Hle=["oklch(var(--hydra-450))","oklch(var(--terra-450))","oklch(var(--dalmasca-400))","oklch(var(--kuja-450))","oklch(var(--rosa-450))","oklch(var(--costa-400))","oklch(var(--jenova-450))","oklch(var(--limsa-450))","oklch(var(--gridania-450))"],zle=["oklch(var(--hydra-350))","oklch(var(--terra-350))","oklch(var(--dalmasca-300))","oklch(var(--kuja-350))","oklch(var(--rosa-350))","oklch(var(--costa-300))","oklch(var(--jenova-250))","oklch(var(--limsa-350))","oklch(var(--gridania-350))"],Hmt=(e,t)=>{const n=t?zle:Hle;return n[e%n.length]??"oklch(var(--super-color))"},Wle=()=>{const{colorScheme:e}=Ss();return d.useMemo(()=>e==="dark"?zle:Hle,[e])},Wp=(e,t)=>t[e%t.length]??"oklch(var(--super-color))",zmt=4,Ry=e=>e.changesPercentage,Wmt=({d:e,disableAnimation:t})=>{const n=n_(e??"",!t,ii);return e?l.jsx(fa.path,{strokeWidth:1.75,fill:"none",shapeRendering:am,d:n}):null},Gmt=({data:e,yScale:t})=>e?.map(n=>l.jsx($mt,{x:n.x,yv:n.yv,color:n.quote.color,yScale:t,r:zmt},n.quote.symbol)),$mt=({x:e,yv:t,color:n,yScale:r,r:s})=>l.jsx("circle",{cx:e,cy:r(t),r:s,fill:n}),qmt=({data:e,timeZone:t,locale:n,x:r})=>{const s=d.useMemo(()=>e.reduce((a,i)=>Math.abs(i.x-r){if(!s)return null;const a=s.date;return a?r8(a,n,t??void 0):null},[s,n,t]);return l.jsx(V,{variant:"tinyRegular",color:"light",className:"px-sm py-xs",children:o})},Kmt=(e,t)=>{const n={color:e.color,symbol:e.symbol,name:e.name,exchange:e.exchange,currency:e.currency,image:e.image,imageDark:e.imageDark,exchangeTimezone:e.exchangeTimezone};return t?{quote:{...n,price:t.close,historicalChange:t.close-(e.historicalPreviousClose??0),historicalPercentChange:t.changesPercentage*100},date:t.date}:{quote:{...n,price:e.price,historicalChange:e.historicalChange??0,historicalPercentChange:e.historicalPercentChange??0},date:null}},Ymt=({data:e,dataMovingAverage:t,xScale:n,xBounds:r,setHoveredComparisons:s,hidden:o})=>{const{tooltipData:a,hideTooltip:i,showTooltip:c}=Zb(),u=A.useRef(null),f=A.useRef(o),m=d.useCallback((g,y)=>{const x=Math.min(Math.max(r[0],g.local.x),r[1]),v=t.map((b,_)=>{const w=s8(x,n,b.history),S=e[_].history[Math.min(w.index,e[_].history.length-1)],C=Kmt(e[_],S);return{date:C.date,quote:C.quote,x:n(wn(w.d))??0,yv:Ry(w.d)}});v.every(b=>b.x)&&(s(v.map(b=>b.quote)),c({tooltipData:{data:v,point:{local:{x:g.local.x,y:y?-xs:g.local.y},global:g.global}}}))},[e,t,n,c,r,s]);f.current&&!o&&u.current&&m(u.current,!1),f.current=o;const p=d.useCallback(g=>{const y="touches"in g,x=i0(g);if(!x)return;const v=XN(g),b={local:x,global:v};u.current=b,m(b,y)},[m]),h=d.useCallback(()=>{u.current=null,i(),s([])},[i,s]);return d.useMemo(()=>({tooltipData:o?void 0:a,hideTooltip:h,showTooltip:p}),[a,h,p,o])},Qmt=e=>{if(e.length===0)return!0;const t=e[0].map(wn);for(let n=1;nt?(e-t)/t:0,uB=e=>{const t=e.historicalPreviousClose||e.history[0].close,n=e.history.map(r=>({...r,changesPercentage:Xmt(r.close,t),change:r.close-t}));return{...e,history:n}},Zmt=(e,t)=>!e||e===t?1:.2,Jmt=({quotes:e,width:t,height:n,setHoveredComparisons:r,focused:s,watermark:o,zoomable:a})=>{const{locale:i,timeZone:c}=J(),{isMobileStyle:u}=Re(),f=u?Vae:Uae,m=d.useMemo(()=>{const H=[...new Set(e.map(Q=>Q.exchangeTimezone))];return H.length===1?H[0]:c},[c,e]),p=d.useMemo(()=>e.map(uB),[e]),h=d.useMemo(()=>e.map(H=>uB(H)),[e]),g=d.useMemo(()=>h.flatMap(H=>H.history).sort((H,Q)=>wn(H).getTime()-wn(Q).getTime()),[h]),y=d.useMemo(()=>Bi({nice:!1,domain:ko(p.flatMap(H=>H.history),Ry),range:[n-xs,Rd]}),[n,p]),x=d.useMemo(()=>Qmt(p.map(H=>H.history)),[p]),v=d.useMemo(()=>o8(g),[g]),b=e.map(H=>H.symbol).join("-"),{transform:_,isActivelyZooming:w,containerRef:S}=vle({enabled:!!a,width:t,id:b}),C=d.useMemo(()=>lm({domain:ko(g,wn),range:[0,t]}),[t,g]),E=d.useMemo(()=>s0({domain:Array.from(new Set(g.map($2))).sort().map(Wae),range:[0,t]}),[t,g]),T=d.useMemo(()=>v||!x?yle(_,C):xle(_,E),[_,C,E,x,v]),{xTickLabels:k,xTickFormatter:I,xTickLines:M,xTickCount:N}=ble({history:g,xGet:wn,xGetUnparsed:$2,timezone:m,locale:i,xScale:T,width:t,zoom:_.k}),D=Wle(),j=d.useMemo(()=>sl().x(H=>T(wn(H))??0).y(H=>y(Ry(H))??0).curve(Db),[T,y]),F=d.useMemo(()=>h.map((H,Q)=>({path:j(H.history),color:Wp(Q,D),quote:H})),[h,j,D]),R=d.useMemo(()=>y.ticks(f).filter(H=>H!==0),[y,f]),P=d.useMemo(()=>[0,t],[t]),{tooltipData:L,hideTooltip:U,showTooltip:O}=Ymt({data:p,dataMovingAverage:h,xScale:T,xBounds:P,setHoveredComparisons:r,hidden:w}),$=d.useCallback(H=>H.toLocaleString(i,{style:"percent"}),[i]),G=d.useCallback(H=>{const Q=h.map(Y=>zae({tick:H,history:Y.history,yScale:y,xScale:T,yGet:Ry}));return Q.find(Y=>Y.opacity<1)??Q[0]},[h,y,T]);return l.jsxs("div",{ref:S,className:JN,onMouseMove:O,onMouseLeave:U,onMouseOut:U,onTouchStart:O,onTouchMove:O,onTouchEnd:U,onTouchCancel:U,children:[l.jsxs("svg",{height:n,width:t,className:ZN,children:[l.jsx(St,{initial:!1,mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:jl,children:[l.jsx("g",{opacity:L?0:1,className:zk(!!L),children:l.jsx(zl,{scale:y,hideTicks:!0,hideAxisLine:!0,numTicks:f,tickFormat:$,left:e8,orientation:"right",tickLabelProps:G})}),l.jsx(zl,{scale:T,hideAxisLine:!0,hideTicks:!0,numTicks:N,tickValues:k,tickFormat:I,orientation:"bottom",top:n-xs,tickLabelProps:t8}),l.jsx(bu,{tickValues:R,scale:y,width:t,stroke:er.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx($b,{scale:T,opacity:.1,height:n*2,stroke:er.gray,style:{transform:`translateY(-${n}px)`},numTicks:N,strokeWidth:1,tickValues:M})]},b)}),l.jsx(St,{children:F.map((H,Q)=>l.jsx(Te.g,{initial:{opacity:0,transition:jl},exit:{opacity:0,transition:jl},animate:{stroke:H.color,opacity:Zmt(s,H.quote.symbol),transition:{delay:0,duration:.25}},children:l.jsx(Wmt,{d:H.path,disableAnimation:w})},Q))}),l.jsx(St,{children:l.jsx(I8,{width:t,yScale:y})}),L&&l.jsx(Jb,{marginTop:-n,tooltipLeft:L.point.local.x,innerHeight:n*3,color:er.gray}),l.jsx(Gmt,{data:L?.data,yScale:y})]}),o&&l.jsx("div",{className:"absolute -top-md left-sm z-[2]",children:o}),L&&l.jsx(e_,{x:L.point.local.x,y:L.point.local.y,pill:!0,children:l.jsx(qmt,{data:L.data,timeZone:m,x:L.point.local.x,locale:i})})]})},ept=d.memo(function({quotes:t,focused:n,height:r,setHoveredComparisons:s,watermark:o}){return l.jsx(Mr,{fallback:dle,children:l.jsx(k8,{height:r,render:!!t?.length,children:(a,i)=>!t?.length||a<100||!t.every(c=>c?.history?.length)?null:l.jsx(Jmt,{quotes:t,width:a,height:i,focused:n,setHoveredComparisons:s,watermark:o,zoomable:!0})})})}),tpt=({root:e,quote:t,removeComparison:n,setFocused:r,className:s,href:o})=>{const a=d.useCallback(()=>{r(t.symbol)},[r,t.symbol]),i=d.useCallback(()=>{r(null)},[r]),c=d.useCallback(p=>{p.preventDefault(),p.stopPropagation(),i(),n?.(t.symbol)},[n,t.symbol,i]),{session:u}=Ne(),{trackEvent:f}=Xe(u),m=d.useCallback(()=>{f("finance link clicked",{referrer:Rb.CHART_COMPARISON,targetPageType:Jg.ASSET_PAGE,symbol:t.symbol,destinationUrl:o})},[t.symbol,o,f]);return l.jsxs(Zg,{href:o,className:z("hover:bg-subtler flex items-center justify-start duration-150",{"bg-subtlest":e},s),onMouseEnter:a,onMouseLeave:i,onClick:m,children:[l.jsx(K,{className:"w-xs my-xs ml-xs shrink-0 self-stretch rounded-full",style:{background:t.color}}),l.jsxs(K,{className:"p-sm py-xs gap-sm md:gap-md flex w-full items-center justify-between",children:[l.jsxs(K,{className:z("gap-sm duration-quick grid w-full items-center transition-opacity [grid-template-columns:2fr_1fr_1fr] md:[grid-template-columns:5fr_1fr_1fr_1fr]",{"pointer-events-none opacity-0":t.loading}),children:[l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Xg,{symbol:t.symbol??"",src:t.image??"",srcDark:t.imageDark??""}),l.jsxs(K,{children:[l.jsx(V,{variant:"smallBold",className:"line-clamp-1 text-ellipsis",children:t.name??t.symbol}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:t.symbol,exchange:t.exchange})})]})]}),l.jsx("span",{children:yd(t.price)&&l.jsx(hf,{variant:"small",price:t.price??0,currency:t.currency,animated:!1,className:"text-right"})}),l.jsx("span",{className:"hidden text-center md:block",children:yd(t.historicalChange)&&l.jsx(hf,{variant:"small",price:t.historicalChange??0,currency:t.currency,animated:!1,sign:!0})}),l.jsx("span",{children:yd(t.historicalPercentChange)&&l.jsx(t_,{change:t.historicalPercentChange??0,variant:"tiny",includeIcon:!0,mono:!1,animated:!1})})]}),!!n&&l.jsx(K,{className:z("flex items-center justify-end active:scale-95",{"pointer-events-none invisible":e}),children:l.jsx(Ge,{onClick:c,variant:"border",icon:B("x"),pill:!0,size:"tiny"},t.symbol)})]})]})},Gle=d.memo(({comparisons:e,removeComparison:t,setFocused:n,root:r})=>{const s=d.useCallback(()=>{n(null)},[n]),o=d.useCallback(a=>{const i=[a.symbol,...e.map(c=>c.symbol).filter(c=>c!==a.symbol)];return`/finance/${a.symbol}?comparing=${i.join(",")}`},[e]);return l.jsx(K,{className:"m-0 flex flex-col overflow-hidden p-0",onMouseLeave:s,children:e.map((a,i)=>l.jsx(tpt,{quote:a,root:i===(r??0),removeComparison:t,setFocused:n,href:o(a)},`${a.symbol}-${i===(r??0)}`))})});Gle.displayName="FinanceStockHistoryComparisonList";const npt=({id:e,candlestick:t,setCandlestick:n})=>l.jsxs(Xa.Root,{className:ru,value:t?"candlestick":"line",onChange:r=>{n(r==="candlestick")},id:`candlestick-toggle-${e}`,children:[l.jsx(Xa.Item,{style:G2,value:"line",children:l.jsx(ut,{name:B("chart-line"),size:16})}),l.jsx(Xa.Item,{style:G2,value:"candlestick",children:l.jsx(ut,{name:B("chart-candle"),size:16})})]}),U5=d.memo(({setRange:e,range:t,onApply:n})=>{const{$t:r}=J(),s=d.useMemo(()=>({after:new Date}),[]),o=d.useMemo(()=>t?.from??new Date,[t]),a=d.useCallback(()=>{e(void 0)},[e]);return l.jsxs(K,{className:"flex flex-col w-fit",children:[l.jsx(B6,{captionLayout:"dropdown",disabled:s,defaultMonth:o,onSelect:e,selected:t,mode:"range",className:"w-fit"}),l.jsxs(K,{className:"gap-sm flex justify-end px-md pb-sm",children:[l.jsx(wt,{size:"tiny",onClick:a,variant:"secondary",children:r({id:"jm/spnRSn+",defaultMessage:"Reset"})}),l.jsx(wt,{size:"tiny",fullWidth:!0,onClick:n,disabled:!t?.from,variant:t?.from?"primary":"secondary",children:r({id:"EWw/tKINJT",defaultMessage:"Apply"})})]})]})});U5.displayName="CalendarContent";function rpt({id:e,periods:t,period:n,setPeriod:r,variant:s,calendar:o=!1}){const[a,i]=d.useState(!1),[c,u]=d.useState(!1),[f,m]=d.useState(void 0),p=d.useMemo(()=>t.find(b=>b.value===n),[t,n]),{$t:h}=J(),g=d.useCallback(()=>{if(f?.from){const b=f?.to??f.from;r(`${v7(f.from)}~${v7(b)}`),u(!1),i(!1)}},[f,r]),y=d.useCallback(b=>{b.stopPropagation(),u(_=>!_)},[]),x=d.useCallback(()=>{u(!1)},[]),v=d.useCallback(()=>{u(!0)},[]);return s==="sm"?l.jsx(K,{className:z(ru,"flex items-center"),variant:"transparent",style:{minHeight:Dh},children:l.jsxs(Dt,{isOpen:a,onToggle:i,maxHeightPx:500,triggerElement:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center h-full pl-sm pr-xs cursor-pointer",children:[p?.text??h({id:"Sjo1P44FYy",defaultMessage:"Custom"}),l.jsx(ut,{name:B("chevron-down"),size:16})]}),children:[t.map(({value:b,text:_})=>l.jsx(Dt.Item,{onSelect:()=>{r(b),i(!1)},children:_},b)),o&&l.jsx(Dt,{isOpen:c,onToggle:u,triggerElement:l.jsx(Dt.Button,{variant:"text",size:"small",children:h({id:"Sjo1P44FYy",defaultMessage:"Custom"})}),children:l.jsx(K,{className:"flex justify-center items-start h-full",style:{minHeight:350},children:l.jsx(U5,{setRange:m,range:f,onApply:g})})})]})}):l.jsxs(Xa.Root,{value:n,className:ru,id:`${e}-periods`,onChange:b=>{b&&r(b)},children:[t.map(({value:b,text:_})=>l.jsx(Xa.Item,{value:b,style:G2,children:l.jsx(V,{variant:"tiny",color:n===b?"default":"light",className:"translate-y-px whitespace-nowrap duration-150",children:_})},b)),o&&l.jsx(Xa.Item,{value:a8(n)?n:"",onClick:y,style:G2,children:l.jsx(kb,{isOpen:c,onClose:x,onOpen:v,isMobileStyle:!1,contentWidth:"auto",avoidCollisions:!0,placement:"top",sideOffset:15,childrenClassName:"inline-flex",content:l.jsx(U5,{setRange:m,range:f,onApply:g}),children:l.jsx(ut,{name:B("calendar"),size:16,className:z({"text-super":c})})})})]})}const O8=d.memo(rpt),$le=d.memo(({peers:e,addComparison:t})=>{const{$t:n}=J(),[r,s]=d.useState(!1),{isMobileStyle:o}=Re(),a=d.useRef(null),i=d.useRef(null),c=d.useRef(null);N8({isOpen:r,onClose:()=>s(!1),refs:o?[a,i]:[c]});const u=d.useMemo(()=>e.map(h=>h)?.slice(0,5),[e]),f=d.useCallback(h=>{h&&(t({symbol:h.symbol,name:h.name,image:h.image,imageDark:h.darkImage,exchange:h.exchange,price:h.currentPrice,currency:h.currency,historicalChange:h.change,historicalPercentChange:h.changesPercentage}),s(!1))},[t]),m=l.jsx("button",{ref:a,onClick:()=>s(h=>!h),className:z(ru,"px-sm group h-full bg-transparent transition-transform"),children:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-xs flex items-center pt-px duration-200 ease-out group-active:scale-95",children:[n({defaultMessage:"Compare",id:"493J7RI1tF"}),l.jsx(ut,{name:B("chevron-down"),className:"size-3"})]})}),p=l.jsx(wle,{defaultSuggestions:u,onClick:f});return o?l.jsxs(l.Fragment,{children:[m,r&&l.jsx(Xl,{children:l.jsxs("div",{ref:i,className:"bg-base border-subtlest shadow-overlay fixed inset-x-0 top-0 z-50 flex flex-col overflow-hidden rounded-b-xl border-x border-b",children:[l.jsx("div",{className:"flex flex-shrink-0 items-center justify-start",children:l.jsx("button",{className:"p-md",onClick:()=>s(!1),children:l.jsx(ut,{name:B("arrow-left"),className:"text-quiet size-5"})})}),l.jsx(K,{className:"flex-1 overflow-auto",children:p})]})})]}):l.jsxs("div",{ref:c,className:"relative",children:[m,r&&l.jsx(K,{className:"z-100 absolute right-0 top-full mt-2 w-[360px] overflow-hidden rounded-xl border shadow-md",children:l.jsx("div",{className:"bg-base",children:p})})]})});$le.displayName="FinanceStockHistoryCompareInput";const spt=A.memo(({children:e})=>l.jsx(Mr,{fallback:null,children:l.jsx("div",{className:"h-full",children:e})}));spt.displayName="CanonicalSidebarSection";const opt=A.memo(({children:e,className:t})=>l.jsx("div",{className:z("mt-md pb-lg space-y-lg",t),children:e}));opt.displayName="CanonicalSidebarColumn";const apt=A.memo(({children:e,className:t})=>l.jsx(V,{variant:"smallBold",className:z("pb-sm px-sm",t),children:e}));apt.displayName="CanonicalSidebarSectionTitle";const qle=A.memo(({children:e,className:t,variant:n})=>l.jsx(dr,{variant:n,className:z("py-sm",t),children:e}));qle.displayName="CanonicalSidebarSectionContent";const ipt="-my-sm gap-x-sm grid w-full grid-cols-[1fr_min-content_min-content]",lpt=A.memo(e=>{const{isLoading:t,isStale:n,movers:r,skinny:s,approxItemCount:o,itemProps:a,referrer:i}=e;return l.jsx(qle,{className:z("overflow-hidden duration-150",{"opacity-50":t}),children:l.jsx(Te.div,{className:z(ipt,{"pointer-events-none invisible":t}),initial:{opacity:0},animate:{opacity:n?.5:1},exit:{opacity:0},transition:{duration:.5},"aria-hidden":t,children:t?l.jsx(cpt,{size:o??5,...e}):r?.map(c=>d.createElement(Kle,{...a,key:c.symbol,symbol:c.symbol,price:c.price,exchange:c.exchange??void 0,currency:c.currency??void 0,name:c.name??"",changesPercentage:c.changesPercentage,skinty:s,useImage:!s,image:c.image??void 0,imageDark:c.imageDark??void 0,referrer:i}))},"top-mover")})});lpt.displayName="MoverTable";const Kle=e=>e.skinty?l.jsx(dpt,{...e}):l.jsx(upt,{...e}),cpt=({size:e,...t})=>[...Array(e).fill(null)].map((n,r)=>l.jsx(Kle,{...t,symbol:"NVDA",price:110,currency:"USD",name:"XXX",changesPercentage:110,exchange:"XX",useImage:!t.skinny,skinty:t.skinny},r)),upt=e=>l.jsx(Rae,{symbol:e.symbol,referrer:e.referrer,className:"col-span-3 flex min-w-0",children:l.jsx(Yle,{...e})});function dpt({symbol:e,name:t,price:n,currency:r,changesPercentage:s,trailingComponent:o,referrer:a}){return l.jsxs(Rae,{symbol:e,referrer:a,className:"col-span-3 grid grid-cols-subgrid",children:[l.jsx(WN,{name:t,variant:"small"}),l.jsx(hf,{price:n,currency:r}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(r_,{changesPercentage:s,includeIcon:!0,variant:"tiny",className:"w-full"}),o&&o({symbol:e})]})]})}const r_=A.memo(({changesPercentage:e,background:t,variant:n,includeIcon:r=!1,className:s,suffix:o,animated:a})=>l.jsx(t_,{change:e,variant:n,includeIcon:r,background:t,mono:!1,suffix:o,className:s,animated:a}));r_.displayName="FinanceMoverChange";const Yle=A.memo(({symbol:e,price:t,currency:n,name:r,changesPercentage:s,useImage:o=!0,exchange:a,image:i,imageDark:c,trailingComponent:u,className:f})=>l.jsxs("div",{className:z("gap-sm flex w-full min-w-0 items-center",{"-ml-xs":!!o},f),children:[o&&l.jsx(Xg,{symbol:e,src:i??"",srcDark:c,size:"lg"}),l.jsxs(K,{className:"flex min-w-0 flex-1 flex-col",children:[l.jsxs(K,{className:"gap-md flex min-w-0 items-end justify-between",children:[l.jsx(WN,{name:r}),l.jsx(hf,{price:t,currency:n,className:"leading-snug"})]}),l.jsxs(K,{className:"gap-sm flex items-start justify-between text-right",children:[l.jsx(V,{variant:"tinyMono",className:"whitespace-nowrap leading-snug",color:"light",children:l.jsx(e0,{symbol:e,exchange:a})}),l.jsx(r_,{changesPercentage:s,background:!1,animated:!1,className:"leading-tight"})]})]}),u&&u({symbol:e})]}));Yle.displayName="FinanceMover";const Dy={operatingActivities:"Operating Activities",netIncome:"Net Income",depreciationAndAmortization:"Dep. & Amort.",deferredIncomeTax:"Deferred Tax",stockBasedCompensation:"Stock-Based Comp.",changeInWorkingCapital:"Change in WC",otherNonCashItems:"Other Non-Cash",netCashProvidedByOperatingActivities:"Operating Cash Flow",investingActivities:"Investing Activities",investmentsInPropertyPlantAndEquipment:"PP&E Inv.",acquisitionsNet:"Net Acquisitions",purchasesOfInvestments:"Inv. Purchases",salesMaturitiesOfInvestments:"Inv. Sales/Matur.",otherInvestingActivites:"Other Inv. Act.",netCashUsedForInvestingActivites:"Investing Cash Flow",financingActivities:"Financing Activities",debtRepayment:"Debt Repay.",commonStockIssued:"Stock Issued",commonStockRepurchased:"Stock Repurch.",dividendsPaid:"Dividends Paid",otherFinancingActivites:"Other Fin. Act.",netCashUsedProvidedByFinancingActivities:"Financing Cash Flow",effectOfForexChangesOnCash:"Forex Effect",netChangeInCash:"Net Chg. in Cash",supplementalInformation:"Supplemental Information",operatingCashFlow:"Operating Cash Flow",capitalExpenditure:"Capital Expenditures",cashAtBeginningOfPeriod:"Beg. Cash",cashAtEndOfPeriod:"End Cash",freeCashFlow:"Free Cash Flow"},Ia={revenue:"Revenue",percentageOfGrowth:"% Growth",costOfRevenue:"Cost of Goods Sold",grossProfit:"Gross Profit",grossProfitRatio:"% Margin",researchAndDevelopmentExpenses:"R&D Expenses",generalAndAdministrativeExpenses:"G&A Expenses",sellingGeneralAndAdministrativeExpenses:"SG&A Expenses",sellingAndMarketingExpenses:"Sales & Mktg Exp.",otherExpenses:"Other Operating Expenses",operatingExpenses:"Operating Expenses",operatingIncome:"Operating Income",operatingIncomeRatio:"% Margin",totalOtherIncomeExpensesNet:"Other Income/Exp. Net",incomeBeforeTax:"Pre-Tax Income",incomeTaxExpense:"Tax Expense",netIncome:"Net Income",netIncomeRatio:"% Margin",eps:"EPS",epsRatio:"% Growth",epsdiluted:"EPS Diluted",weightedAverageShsOut:"Weighted Avg Shares Out",weightedAverageShsOutDil:"Weighted Avg Shares Out Dil",supplementalInformation:"Supplemental Information",interestIncome:"Interest Income",interestExpense:"Interest Expense",depreciationAndAmortization:"Depreciation & Amortization",ebitda:"EBITDA",ebitdaratio:"% Margin"},fpt={assets:"Assets",cashAndCashEquivalents:"Cash & Equivalents",shortTermInvestments:"Short-Term Investments",netReceivables:"Receivables",inventory:"Inventory",otherCurrentAssets:"Other Curr. Assets",totalCurrentAssets:"Total Curr. Assets",propertyPlantEquipmentNet:"Property Plant & Equip (Net)",goodwill:"Goodwill",intangibleAssets:"Intangibles",longTermInvestments:"Long-Term Investments",taxAssets:"Tax Assets",otherNonCurrentAssets:"Other NC Assets",totalNonCurrentAssets:"Total NC Assets",otherAssets:"Other Assets",totalAssets:"Total Assets",liabilities:"Liabilities",accountPayables:"Payables",shortTermDebt:"Short-Term Debt",taxPayables:"Tax Payable",deferredRevenue:"Def. Revenue",otherCurrentLiabilities:"Other Curr. Liab.",totalCurrentLiabilities:"Total Curr. Liab.",longTermDebt:"LT Debt",deferredRevenueNonCurrent:"Def. Rev. NC",deferredTaxLiabilitiesNonCurrent:"Def. Tax Liab. NC",otherNonCurrentLiabilities:"Other NC Liab.",totalNonCurrentLiabilities:"Total NC Liab.",otherLiabilities:"Other Liab.",capitalLeaseObligations:"Cap. Leases",totalLiabilities:"Total Liab.",equity:"Equity",preferredStock:"Pref. Stock",commonStock:"Common Stock",retainedEarnings:"Ret. Earnings",accumulatedOtherComprehensiveIncomeLoss:"AOCI",othertotalStockholdersEquity:"Other Equity",totalEquity:"Total Equity",supplementalInformation:"Supplemental Information",minorityInterest:"Min. Interest",totalLiabilitiesAndTotalEquity:"Total Liab. & Tot. Equity",totalInvestments:"Total Inventory",totalDebt:"Total Debt",netDebt:"Net Debt"},mpt={marketCapitalization:"Market Cap",minusCashAndCashEquivalents:"- Cash",addTotalDebt:"+ Debt",enterpriseValue:"Enterprise Value",revenue:Ia.revenue,percentageOfGrowth:Ia.percentageOfGrowth,grossProfit:Ia.grossProfit,grossProfitRatio:Ia.grossProfitRatio,ebitda:Ia.ebitda,ebitdaratio:Ia.ebitdaratio,netIncome:Ia.netIncome,netIncomeRatio:Ia.netIncomeRatio,epsdiluted:Ia.epsdiluted,epsdilutedratio:"% Growth",netCashProvidedByOperatingActivities:Dy.netCashProvidedByOperatingActivities,capitalExpenditure:Dy.capitalExpenditure,freeCashFlow:Dy.freeCashFlow},Bh=new Set(["grossProfitRatio","percentageOfGrowth","ebitdaratio","operatingIncomeRatio","incomeBeforeTaxRatio","netIncomeRatio","epsRatio","epsdilutedratio"]),ppt=new Set(["eps","epsdiluted","weightedAverageShsOut","weightedAverageShsOutDil"]);[...Bh];[...Bh],[...Bh];const hpt=new Set([...Object.keys(fpt),...Object.keys(Ia),...Object.keys(Dy),...Object.keys(mpt)].filter(e=>!Bh.has(e)&&!ppt.has(e)));[...hpt];({...Object.fromEntries([...Bh].map(e=>[e,1]))});function gpt(e,t){const n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function ypt(e,t){return t&&a8(t)&&e?.length?{startDate:e[0].date,endDate:e[e.length-1].date}:t!=="1d"&&e?.length?{startDate:e[0].date,endDate:e[e.length-1].date}:{startDate:void 0,endDate:void 0}}const Qle=({price:e,currency:t,change:n,percentChange:r,children:s,className:o,variant:a})=>{const i=d.useMemo(()=>({style:t?"currency":"decimal",currency:t??void 0,minimumFractionDigits:e<1e3?2:0,maximumFractionDigits:2}),[t,e]),c=a==="sm",u=c?"tiny":"base";return l.jsxs(K,{className:z("flex w-full flex-col",o),children:[l.jsxs(K,{className:"gap-sm flex w-full items-center justify-start",children:[l.jsx(V,{variant:c?"baseSemi":"entry-title-200",className:"m-0 p-0",children:l.jsx(Nb,{value:e,format:i,animated:!0})}),l.jsxs(K,{className:"gap-xs flex items-center",children:[!c&&l.jsx(hf,{price:n??0,currency:t,sign:!0,variant:u,animated:!0}),l.jsx(r_,{animated:!0,changesPercentage:r??0,variant:u,background:!1,includeIcon:!0})]})]}),l.jsx(K,{className:"gap-sm flex items-center justify-start",children:s})]})},Xle="flex items-center gap-xs truncate min-w-0",Zle=A.memo(({price:e,currency:t,change:n,percentChange:r,timestamp:s,open:o,closes:a,timezone:i,variant:c,period:u,startDate:f,endDate:m})=>{const{$t:p,locale:h}=J(),g=d.useMemo(()=>{const y=a8(u);if(u!=="1d"&&f&&m){const v=new Date(f),b=new Date(!y&&s?s*1e3:m),_=T=>T.toLocaleDateString(h,{month:"short",day:"numeric",year:"numeric",timeZone:i}),w=T=>T.toLocaleString(h,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:c==="lg"?"2-digit":void 0,timeZoneName:"short",timeZone:i}),S=y&&gpt(f,m),C=_(v),E=y?_(b):w(b);return y?S?C:p({defaultMessage:"{startDate} – {endDate}",id:"5Rl2zbDuSl"},{startDate:C,endDate:E}):p({defaultMessage:"{startDate} – {endDate}",id:"5Rl2zbDuSl"},{startDate:C,endDate:E})}const x=s?new Date(s*1e3).toLocaleTimeString(h,{hour:"numeric",minute:"2-digit",day:"numeric",month:"short",second:c==="lg"?"2-digit":void 0,timeZoneName:"short",timeZone:i}):null;if(c==="sm"){if(!o&&a&&s){const b=new Date(s*1e3).toLocaleDateString(h,{month:"short",day:"numeric",timeZone:i});return p({defaultMessage:"At Close: {date}",id:"yH424m9j36"},{date:b})}return x}return o&&a?p({defaultMessage:"Regular Session: {time}",id:"UxiRfp0f4m"},{time:x}):!o&&a?p({defaultMessage:"At Close: {time}",id:"sbpypHoyMl"},{time:x}):x},[s,h,o,p,a,i,c,u,f,m]);return l.jsx(Qle,{price:e,currency:t,change:n,percentChange:r,variant:c,children:l.jsx(V,{variant:"tinyRegular",color:"light",className:Xle,children:g})})});Zle.displayName="StockPriceBig";const Jle=A.memo(({price:e,currency:t,change:n,percentChange:r,timestamp:s,timezone:o,variant:a,afterHoursType:i})=>{const{$t:c,locale:u}=J(),{isMobileStyle:f}=Re(),m=new Date(s*1e3).toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",second:f?void 0:"2-digit",day:"numeric",month:"short",timeZoneName:f?void 0:"short",timeZone:o}),p=d.useMemo(()=>{const y=i==="pre_market"?W({defaultMessage:"Pre-market: {time}",id:"ok47wYkpHy"}):W({defaultMessage:"After hours: {time}",id:"elF1mrf0Os"});return c(y,{time:m})},[i,m,c]),h=d.useMemo(()=>{if(a==="sm"){const g=i==="pre_market",y=new Date(s*1e3).toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:o}),x=g?W({defaultMessage:"Pre-market: {time}",id:"ok47wYkpHy"}):W({defaultMessage:"After Hours: {time}",id:"+QecmxPmpo"});return c(x,{time:y})}return null},[a,i,s,u,o,c]);return l.jsx(Qle,{price:e,currency:t,change:n,percentChange:r,variant:a,children:l.jsx(V,{variant:"tinyRegular",color:"light",className:Xle,children:a==="sm"?h:p})})});Jle.displayName="AfterHoursPriceBig";const dB=({children:e,grow:t=!0,className:n})=>l.jsx(K,{className:z("px-md py-sm",t?"flex-1":"w-full",n),children:e}),ece=A.memo(({quote:e,period:t,context:n="canonical"})=>{const r=!!e.afterHoursPrice&&t==="1d";Rf("mini-graphs");const{isMobileStyle:s}=Re(),o=s&&r?"sm":"lg",a=d.useMemo(()=>ypt(e.history,t),[e.history,t]),i=d.useMemo(()=>l.jsx(Zle,{variant:o,price:e.price,currency:e.currency,change:e.historicalChange,percentChange:e.historicalPercentChange,period:t??void 0,timestamp:e.timestamp,open:e.isMarketOpen,closes:e.exchange!=="CRYPTO",timezone:e.exchangeTimezone??void 0,startDate:a.startDate,endDate:a.endDate}),[e,o,t,a]),c=d.useMemo(()=>l.jsx(Jle,{price:e.afterHoursPrice,change:e.afterHoursChange,percentChange:e.afterHoursPercentChange,timestamp:e.afterHoursTimestamp,currency:e.currency,timezone:e.exchangeTimezone??void 0,variant:o,afterHoursType:e.afterHoursType??null}),[e,o]);return l.jsx(K,{variant:"raised",className:z("relative",n==="thread"?"border-t rounded-none":"border-x border-b-0 border-t rounded-b-none rounded-t-xl"),children:l.jsxs(K,{className:"flex",children:[l.jsx(dB,{grow:r,className:r?"border-r border-subtlest":void 0,children:i}),r&&l.jsx(dB,{grow:!0,children:c})]})})});ece.displayName="BeforeAfterHours";const xpt=He({"1min":{defaultMessage:"1 min",id:"D2/3tXpws9"},"5min":{defaultMessage:"5 min",id:"TVHUbnv1cj"},"15min":{defaultMessage:"15 min",id:"OOAN7GDaOG"},"30min":{defaultMessage:"30 min",id:"z+jvO3E6rw"},"1hour":{defaultMessage:"1 hour",id:"68LTymxJcs"},"4hour":{defaultMessage:"4 hours",id:"SiO/3GrQZY"},"1day":{defaultMessage:"1 day",id:"+7PjfVlUMl"},"1week":{defaultMessage:"1 week",id:"LTNKL8T1Dn"},"1month":{defaultMessage:"1 month",id:"p1dNdsvErg"}}),vpt=d.memo(function({availableIntervals:t,currentInterval:n,setInterval:r}){const{$t:s}=J(),o=d.useCallback(a=>{r(a)},[r]);return!t?.length||!n?null:l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",className:"pb-sm px-xs",children:s({defaultMessage:"Price Interval",id:"okQNyMzaX6"})}),l.jsx(K,{children:l.jsx(Xa.Root,{value:n,onChange:o,className:"flex items-center w-fit",id:"interval",children:t.map(a=>l.jsx(Xa.Item,{value:a,children:l.jsx(V,{variant:"tiny",color:n===a?"default":"light",className:"whitespace-nowrap",children:s(xpt[a])})},a))})})]})}),bpt=[],_pt=7,wpt=Vat.map(e=>({text:$ae[e],value:e})),tce=e=>{const[t,n]=e.split("~");return t&&n?{type:"range",range:{start:t,end:n}}:{type:"period",period:t}},Cpt=({symbol:e,period:t,interval:n})=>({prefix:"finance/chart",symbol:e,historyPeriod:t,withHistory:!0,historyAfterHours:["1d","5d","1m"].includes(t),historyRedirect:!0,historyInterval:n,withUiHints:!0}),Spt=(e,t,n,r)=>{const s=d.useRef(new Set),o=!n,a=Yt();d.useEffect(()=>{s.current.has(e)||!o||r?.length},[e,o,r,a,t])},Ept=(e,t,n,r)=>{const s=d.useMemo(()=>rN(Cpt({symbol:e,period:n,interval:r})),[n,r,e]),o=mt({queryKey:s,queryFn:async()=>{const a=tce(n);if(a.type==="range"){const c=await eu({symbol:e,historyPeriod:void 0,historyStartDate:a.range.start,historyEndDate:a.range.end,historyInterval:r,withHistory:!0,historyAfterHours:Math.abs(zat(a.range.start,a.range.end))<30});return{quote:c,interval:c?.uiHints?.currentInterval??null,period:c?.uiHints?.currentPeriod??n,pendingPeriod:void 0}}const i=await eu({symbol:e,historyPeriod:a.period,withHistory:!0,historyAfterHours:["1d","5d","1m"].includes(a.period),historyRedirect:!0,historyInterval:r,withUiHints:!0,historyStartDate:void 0,historyEndDate:void 0});return{quote:i,interval:i?.uiHints?.currentInterval??r,period:i?.uiHints?.currentPeriod??n,pendingPeriod:void 0}},refetchInterval:5e3,staleTime:1/0,placeholderData:a=>{if(a)return{...a,interval:r??a.interval,period:a.period??n,pendingPeriod:n};if(t)return{quote:t,interval:r,period:t?.uiHints?.currentPeriod??n,pendingPeriod:void 0}}});return Spt(e,n,o.isLoading,o.data?.quote?.uiHints?.availablePeriods),{isLoading:o.isLoading||o.isPlaceholderData,quote:o.data?.quote??null,interval:o.data?.interval??null,period:o.data?.period??null,pendingPeriod:o.data?.pendingPeriod}},kpt=(e,t,n,r)=>{const s=Yt(),o=mt({queryKey:be.makeEphemeralQueryKey("finance/comparison",t,...e),queryFn:async()=>{const a=tce(t),i=e.map(async f=>{if(a.type==="range")return await s.ensureQueryData({queryKey:be.makeEphemeralQueryKey("finance/history",f,a.range.start,a.range.end),queryFn:()=>eu({symbol:f,historyPeriod:void 0,historyStartDate:a.range.start,historyEndDate:a.range.end,historyAfterHours:!1,historyRedirect:!1,withUiHints:!0,withHistory:!0}),staleTime:3e4});const m={prefix:"finance/comparison",symbol:f,historyPeriod:a.period,withHistory:!0,historyRedirect:!1,historyAfterHours:!1};return await s.ensureQueryData({queryKey:rN(m),queryFn:()=>eu(m),staleTime:3e4})});return{quotes:(await Promise.all(i))?.filter(f=>!!f)?.map((f,m)=>({...f,color:Wp(m,r)}))??[],period:t,pendingPeriod:void 0}},placeholderData:a=>{if(a)return{...a,period:a.period??t,pendingPeriod:t}},refetchInterval:3e4,enabled:n});return{isLoading:o.isLoading,quotes:o.data?.quotes??bpt,period:o.data?.period??null,pendingPeriod:o.data?.pendingPeriod??void 0}},Mpt=e=>{const t=On(),n=Zl(t),r=fn();d.useEffect(()=>{t&&n&&t!==n&&!r?.get("comparing")&&e([])},[t,n,r,e])},Tpt=(e,t,n,r)=>{const s=fn(),o=Rn(),a=d.useCallback(S=>{const C=new URLSearchParams(window.location.search);C.set("comparing",S.join(",")),o.replace(`?${C.toString()}`)},[o]),[i,c]=d.useState(s?.get("comparing")?.split(",")??r??[]),u=d.useMemo(()=>[e,...i.filter(S=>S!==e)],[i,e]),f=u.length>1,[m,p]=d.useState({}),h=d.useCallback(S=>{S.symbol&&c(C=>{const E=[...new Set([e,...C,S.symbol])];return E.length>_pt&&E.splice(-2,1),a(E),p(T=>({...Object.fromEntries(Object.entries(T).filter(([k])=>E.includes(k))),[S.symbol]:S})),E})},[c,p,e,a]),g=d.useCallback(S=>{c(C=>{const E=C.filter(T=>T!==S);return a(E),E}),p(C=>{const E={...C};return delete E[S],E})},[c,p,a]),y=d.useCallback(()=>{c([])},[]);Mpt(c);const x=kpt(u,t,f,n),{comparisonQuotes:v,setHoveredComparisons:b}=Npt(u,x.quotes,m,n),_=Apt(e,u);return{peers:d.useMemo(()=>_.data.filter(S=>!u.includes(S.symbol)),[_.data,u]),isComparing:f,quotes:x.quotes,comparisonQuotesLoading:x.isLoading,comparisonQuotes:v,setHoveredComparisons:b,addComparison:h,removeComparison:g,resetComparisons:y,period:x.period,pendingPeriod:x.pendingPeriod}},Apt=(e,t)=>{const{data:n,isLoading:r,isPlaceholderData:s}=mt({queryKey:mKe(e,!0),queryFn:()=>pKe({symbol:e,index:!0}),placeholderData:Wl}),o=d.useMemo(()=>n?.filter(a=>!t.some(i=>i===a.symbol)&&a.symbol!==e)??[],[n,t,e]);return d.useMemo(()=>({data:o,isLoading:r||s}),[o,r,s])},Npt=(e,t,n,r)=>{const[s,o]=d.useState([]),a=d.useMemo(()=>e.map((f,m)=>{const p=t.find(g=>g.symbol===f)??n[f];return p?{symbol:p.symbol,name:p.name,image:p.image,imageDark:p.imageDark,exchange:p.exchange,currency:p.currency||void 0,price:p.price,exchangeTimezone:p.exchangeTimezone,historicalChange:p.historicalChange,historicalPercentChange:p.historicalPercentChange,color:Wp(m,r)}:{symbol:f,loading:!0,color:Wp(m,r)}}),[e,t,n,r]),i=d.useMemo(()=>s.map((u,f)=>({...u,color:Wp(f,r)})),[s,r]),c=i.length>0?i:a;return d.useMemo(()=>({comparisonQuotes:c,setHoveredComparisons:o}),[c,o])},nce=(e,t)=>d.useMemo(()=>{const n=e?.length?e:wpt.map(s=>s.value);return(t?n.filter(s=>s!=="5d"):n).map(s=>({text:$ae[s],value:s}))},[e,t]),Rpt=({children:e,context:t})=>l.jsx(K,{noBorder:!0,className:z("overflow-hidden border-t border-subtlest",t==="thread"?"rounded-none":"border-b rounded-b-xl"),children:e}),fB=({symbol:e,comparisons:t,initialQuote:n,fullscreen:r,setFullscreen:s,chartHeight:o=225,zoomable:a=!0,context:i="canonical"})=>{const{isMobileStyle:c}=Re(),u=fn(),f=u?.get("period"),m=u?.get("interval"),[p,h]=d.useState(m??n?.uiHints?.currentInterval??null),[g,y]=d.useState(f??n?.uiHints?.currentPeriod??"1d"),[x,v]=d.useState(null),[b,_]=d.useState(!1),w=c?null:x,S=Wle(),C=Ept(e,n,g,p),E=Tpt(e,g,S,t),T=!b&&E.isComparing,k=nce(C.quote?.uiHints?.availablePeriods,E.isComparing),I=Amt(),{variant:M,containerRef:N}=$ot({isMobileStyle:c});return C.quote?l.jsxs(K,{className:"flex flex-col",children:[l.jsx(ece,{quote:C.quote,period:T?E.period:C.period,context:i}),l.jsxs(K,{variant:"raised",className:z("relative",i==="thread"?"border-y rounded-none":z("border-x border-t rounded-t-none rounded-b-xl",r&&"border-b")),children:[l.jsxs(K,{className:"gap-y-sm relative flex flex-col justify-between",children:[l.jsxs(rce,{isLoading:C.isLoading,children:[!T&&l.jsx(P8,{id:`history-chart-${e}`,quote:C.quote,technical:!0,height:o,candlestick:b,indicators:I,watermark:l.jsx(Rh,{}),zoomable:a}),T&&l.jsx(ept,{quotes:E.quotes,focused:w,height:o,setHoveredComparisons:E.setHoveredComparisons,watermark:l.jsx(Rh,{})})]}),l.jsxs(K,{ref:N,className:"z-1 p-sm absolute inset-x-0 top-0 flex justify-between items-stretch",children:[l.jsxs(K,{className:"gap-sm flex flex-start",children:[l.jsx(O8,{id:e,periods:k,period:T?E.pendingPeriod??E.period:C.pendingPeriod??C.period,setPeriod:y,calendar:!0,variant:M}),l.jsx(npt,{id:e,candlestick:b,setCandlestick:_}),!b&&l.jsx($le,{peers:E.peers,addComparison:E.addComparison}),!T&&l.jsxs(Lle,{children:[l.jsx(vpt,{setInterval:h,availableIntervals:C.quote?.uiHints?.availableIntervals,currentInterval:C.interval}),l.jsx(Fle,{history:C.quote.history,indicators:I})]})]}),l.jsxs("div",{className:"gap-sm flex items-center justify-center",children:[!T&&l.jsx(qat,{quote:C.quote,animationId:e,period:T?E.period:C.period}),s&&!c&&l.jsx(Ble,{setFullscreen:s,fullscreen:r})]})]})]}),T&&l.jsx(Rpt,{context:i,children:l.jsx(Gle,{comparisons:E.comparisonQuotes,removeComparison:E.removeComparison,setFocused:v})}),!T&&!r&&l.jsx(jae,{quote:C.quote,context:i})]})]}):null},rce=A.memo(({children:e,isLoading:t})=>l.jsx(Te.div,{initial:{opacity:1},animate:{opacity:t?.5:1},transition:{duration:.5,delay:.5},style:{paddingTop:Dh+16+20},className:"relative overflow-hidden",children:e}));rce.displayName="FinanceStockHistoryChartContainer";const sce=d.memo(({symbol:e,watermark:t})=>{const[n,r]=d.useState("1d"),s=Re(),o={prefix:"finance/currency",symbol:e,historyPeriod:n,withHistory:!0,historyAfterHours:!1,historyRedirect:!1,withUiHints:!0},{data:a,isLoading:i}=mt({queryKey:rN(o),queryFn:async()=>({quote:await eu(o),period:n}),refetchInterval:5e3,staleTime:1/0,placeholderData:Wl}),c=nce(a?.quote?.uiHints?.availablePeriods,!1);return!i&&!a?.quote?.history?.length?null:l.jsxs(K,{className:"gap-md flex flex-col overflow-hidden border-t relative ",children:[l.jsx(K,{className:"px-md pt-sm flex z-10",children:l.jsx(O8,{id:e,periods:c,period:n,setPeriod:r,variant:s?"sm":"lg",calendar:!1})}),l.jsx(P8,{id:`currency-chart-${e}`,quote:a?.quote,watermark:t,zoomable:!1})]})});sce.displayName="FinanceThreadCurrencyChart";const oce=A.memo(e=>{const{data:t}=e,{source_currency:n,target_currency:r,source_amount:s,converted_amount:o,exchange_rate:a}=t,i=!0,{menuItems:c}=sm(),[u,f]=d.useState(s),[m,p]=d.useState(L(o)),[h,g]=d.useState(n),[y,x]=d.useState(r),[v,b]=d.useState(a),{colorScheme:_}=Ss(),w=_==="dark",{$t:S}=J(),C=`${h}${y}`,{data:E,isLoading:T,error:k}=mt({queryKey:hKe(h,y,u),queryFn:()=>gKe({sourceCurrency:h,targetCurrency:y,amount:u}),enabled:!!h&&!!y&&u>0}),I=d.useRef(E?.source_currency),M=d.useRef(E?.target_currency),N=d.useRef(E?.exchange_rate),D=d.useRef(E?.source_img),j=d.useRef(E?.source_img_dark),F=d.useRef(E?.target_img),R=d.useRef(E?.target_img_dark);d.useEffect(()=>{E&&(E?.source_currency!==I.current||E?.target_currency!==M.current)&&(p(L(E.converted_amount)),I.current=E.source_currency,M.current=E.target_currency),E&&E.exchange_rate!==N.current&&(b(E.exchange_rate),N.current=E.exchange_rate),E&&E.source_img!==D.current&&(D.current=E.source_img),E&&E.source_img_dark!==j.current&&(j.current=E.source_img_dark),E&&E.target_img!==F.current&&(F.current=E.target_img),E&&E.target_img_dark!==R.current&&(R.current=E.target_img_dark)},[E]);function P(G){return Fk.find(H=>H.currencyCode===G)}function L(G){return G>1?parseFloat(G.toFixed(2)):parseFloat(G.toPrecision(2))}function U(G){return G==="INR"||G==="PKR"||G==="BDT"||G==="NPR"}const O=P(h),$=P(y);return l.jsx(Es,{widgetType:"finance",widgetName:"currency_exchange",widgetSize:"full",children:l.jsx("div",{className:"gap-sm pb-sm flex flex-col overflow-visible",children:l.jsxs(dr,{shadow:!0,className:"w-full overflow-hidden",children:[l.jsxs(K,{variant:"subtler",className:"grid w-full grid-cols-1 gap-px md:grid-cols-2",children:[l.jsxs(K,{variant:"raised",className:"p-md pb-sm gap-sm flex w-full flex-col",children:[l.jsx("div",{className:"flex-1",children:l.jsxs(V,{variant:"entry-title-200",className:"flex font-mono !text-2xl",children:[l.jsx("span",{className:"text-quieter",children:O?.symbol}),l.jsx(H5,{value:u.toString(),error:!!k,onChange:G=>{const H=parseFloat(G);f(H),H>0?p(L(H*v)):p(0)},formatting:U(O?.currencyCode)?"indian":"default"})]})}),l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsx(V5,{onSelect:G=>g(G),currency:O?S(O.currency):h,icon:O&&O.type==="crypto"?l.jsx(K,{variant:"subtler",className:"size-full overflow-hidden rounded-full",children:(w?j.current:D.current)&&l.jsx("img",{src:w?j.current??"":D.current??"",alt:S(O.currency),className:"size-full object-contain"})}):O&&O.type==="commodity"?l.jsx(K,{className:z("size-full rounded-full",{"!bg-[gold]":O?.currencyCode==="XAU","!bg-[silver]":O?.currencyCode==="XAG"})}):l.jsx(H2,{className:"size-full object-contain",countryCode:O?.countryCode})}),l.jsx("div",{className:"ml-auto grid grid-cols-1 grid-rows-1 items-center",children:l.jsxs(St,{children:[T&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,className:"col-start-1 row-start-1 ml-auto",children:l.jsx(V,{color:"ultraLight",children:l.jsx(Gl,{size:12})})},"loading"),!T&&k&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Ar,className:"col-start-1 row-start-1 ml-auto",children:l.jsx(V,{color:"light",variant:"small",children:S({defaultMessage:"Not supported",id:"+FiyOTaUCW"})})},"error")]})})]})]}),l.jsxs(K,{variant:"raised",className:z("p-md pb-sm gap-md flex w-full flex-col",{"!gap-sm":i}),children:[l.jsx("div",{className:"flex-1",children:l.jsxs(V,{variant:"entry-title-200",color:"default",className:"flex font-mono !text-2xl",children:[l.jsx("span",{className:"text-quieter",children:$?.symbol}),l.jsx(H5,{value:m.toString(),error:!!k,onChange:G=>{const H=parseFloat(G);p(H),H>0?f(L(H/v)):f(0)},formatting:U($?.currencyCode)?"indian":"default"})]})}),l.jsxs("div",{className:"gap-md flex items-center",children:[l.jsx(V5,{onSelect:G=>x(G),currency:$?S($.currency):y,icon:$&&$.type==="crypto"?l.jsx(K,{variant:"subtler",className:"size-full overflow-hidden rounded-full",children:(w?R.current:F.current)&&l.jsx("img",{src:w?R.current??"":F.current??"",alt:S($.currency),className:"size-full object-contain"})}):$&&$.type==="commodity"?l.jsx(K,{className:z("size-full rounded-full",{"!bg-[gold]":$?.currencyCode==="XAU","!bg-[silver]":$?.currencyCode==="XAG"})}):l.jsx(H2,{className:"size-full object-contain",countryCode:$?.countryCode})}),c&&c.length>0&&l.jsx("div",{className:"ml-auto",children:l.jsx(Fn.Menu,{menuItems:c})})]})]})]}),l.jsx(sce,{symbol:C,watermark:l.jsx(Rh,{})})]})})})});oce.displayName="CurrencyConversion";const V5=A.memo(({currency:e,icon:t,onSelect:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re(),[o,a]=d.useState(""),i=d.useMemo(()=>["CNY","EUR","GBP","JPY","USD","BTC","ETH"].map(y=>Fk.find(x=>x.currencyCode===y)),[]),c=d.useMemo(()=>{const g=Fk.map(y=>({...y,localizedCurrency:r(y.currency)}));return new om(g,{keys:["localizedCurrency","currencyCode","countryCode"],threshold:.3})},[r]),u=d.useMemo(()=>c.search(o)??[],[c,o]),f=d.useMemo(()=>i.map(g=>({type:"default",text:g?.currencyCode?r(g.currency):"",onClick:()=>{g?.currencyCode&&(n(g.currencyCode),a(""))}})),[i,n,r]),m=d.useMemo(()=>u.map(g=>({type:"default",text:r(g.item?.currency)??"",onClick:()=>{g?.item?.currencyCode&&(n(g.item?.currencyCode),a(""))}})),[u,n,r]),p=d.useMemo(()=>[{type:"default",text:r({defaultMessage:"No results",id:"jHJmjfxD4s"}),disabled:!0}],[r]),h=d.useMemo(()=>l.jsx(co,{autoFocus:!0,className:z({"!-mx-xs":s,"!px-xs py-sm mb-xs border-none !bg-transparent shadow-none outline-none focus:!ring-0":!s}),isMobileUserAgent:s,placeholder:r({defaultMessage:"Search currencies...",id:"fDMc8k+hJQ"}),value:o,onChange:g=>a(g),disable1pass:!0}),[s,o,r]);return l.jsx(zs,{alwaysShowChildren:!0,placement:"bottom-start",showFooterOnMobile:!0,items:o.length>0?m.length>0?m:p:f,isMobileStyle:s,wrapperClassName:"flex",header:h,footer:s&&h,children:l.jsx(st,{chevron:!0,noPadding:!0,extraCSS:"!px-sm -ml-sm",leadingComponent:l.jsx("div",{className:"mr-0.5 size-5",children:t}),variant:"primary",size:"small",text:e})})});V5.displayName="CurrencyPicker";const H5=A.memo(({value:e,onChange:t,error:n,formatting:r="default"})=>n?l.jsx("span",{className:"!text-quieter",children:"---"}):l.jsx(Aae,{className:z("placeholder:text-quieter w-full overflow-hidden bg-transparent transition-colors duration-200 [appearance:textfield] focus:outline-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",{"!text-quieter":n}),value:e??"",disabled:n,placeholder:"0",onChange:t,min:0,formatting:r}));H5.displayName="ConversionInput";const N1=e=>e?new Date(e):void 0,Dpt=e=>({departureTime:new Date(e.departure_time),arrivalTime:new Date(e.arrival_time),actualDepartureTime:N1(e.actual_departure_time),actualArrivalTime:N1(e.actual_arrival_time),estimatedDepartureTime:N1(e.estimated_departure_time),estimatedArrivalTime:N1(e.estimated_arrival_time)}),jpt=e=>!!(e.actualArrivalTime&&e.actualArrivalTime>e.arrivalTime||e.estimatedArrivalTime&&e.estimatedArrivalTime>e.arrivalTime),Ipt=e=>{if(e.length===0)return[];if(e.length===1)return[[e[0]]];const t=[...e].sort((o,a)=>new Date(o.departure_time).getTime()-new Date(a.departure_time).getTime()),n=[],r=t[0];if(!r)return[];let s=[r];for(let o=1;o0&&s.length==n[n.length-1]?.length&&n.push(s),n},ap=(e,t,n)=>{const r=zme({start:e,end:t}),s=r.days||0,o=r.hours||0,a=r.minutes||0;return s>0?o===0&&a===0?n({id:"sSynIO3ThU",defaultMessage:"{days}d"},{days:s}):a===0?n({id:"10cSZzeWte",defaultMessage:"{days}d {hours}h"},{days:s,hours:o}):n({id:"OWk1HjddEb",defaultMessage:"{days}d {hours}h {minutes}m"},{days:s,hours:o,minutes:a.toString().padStart(2,"0")}):o===0?n({id:"VvfhE21OJI",defaultMessage:"{minutes}m"},{minutes:a}):a===0?n({id:"unuVj1l7KW",defaultMessage:"{hours}h"},{hours:o}):n({id:"0Yp4jJ7rzm",defaultMessage:"{hours}h {minutes}m"},{hours:o,minutes:a.toString().padStart(2,"0")})},ace=A.memo(({flightMetadata:e,departureTime:t,arrivalTime:n,actualDepartureTime:r,actualArrivalTime:s,estimatedDepartureTime:o,estimatedArrivalTime:a,delayed:i=!1,rightContent:c})=>{const{$t:u}=J(),f=d.useMemo(()=>new Date,[]),{cancelled:m,diverted:p,status:h,flight_number:g,departure_city:y,departure_airport:x,arrival_airport:v,arrival_city:b}=e,_=r||o||t,w=s||a||n,S=d.useMemo(()=>ap(f,_,u),[f,_,u]),C=d.useMemo(()=>ap(_,f,u),[f,_,u]),E=d.useMemo(()=>ap(w,f,u),[f,w,u]),T=d.useMemo(()=>ap(f,w,u),[f,w,u]),k=_<=f,I=w<=f,M=d.useMemo(()=>I?u({id:"mtuHNb+mRc",defaultMessage:"Arrived {time} ago"},{time:E}):k?u({id:"b6q320RasU",defaultMessage:"Departed {time} ago"},{time:C}):u({id:"/JLglYfuNX",defaultMessage:"Departing in {time}"},{time:S}),[k,I,S,C,E,u]),N=d.useMemo(()=>m?u({id:"3wsVWFbC1x",defaultMessage:"Cancelled"}):p?u({id:"/N1ZeWQc8B",defaultMessage:"Diverted"}):h,[m,p,u,h]);return l.jsxs("div",{className:"gap-sm flex flex-col justify-between sm:flex-row",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"section-title",children:l.jsx(je,{id:"5KgWVKDR/R",defaultMessage:"{flightNumber} · {departureCity} ({departureAirport}) to {arrivalCity} ({arrivalAirport})",values:{flightNumber:g,departureCity:y,departureAirport:x,arrivalAirport:v,arrivalCity:b}})}),l.jsx("div",{className:"gap-sm flex flex-row",children:l.jsxs(ga,{className:"gap-xs flex flex-row flex-wrap",children:[!m&&l.jsx(Bn,{id:"relative-departure-time",children:l.jsx(V,{variant:"smallBold",color:"light",children:M})}),k&&!I&&!m&&l.jsx(Bn,{id:"relative-arrival-time",children:l.jsx(V,{variant:"smallBold",color:"light",children:l.jsx(je,{id:"z8jWKRSOak",defaultMessage:"Arriving in {time}",values:{time:T}})})}),l.jsx(Bn,{id:"status",children:l.jsx(V,{variant:"smallBold",color:m||p||i?"negative":"super",children:N})})]})})]}),c]})});ace.displayName="FlightHeader";const R1={initial:{opacity:0,filter:"blur(2px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(2px)"},transition:{duration:.5,ease:qa}},L8=A.memo(({children:e,animationKey:t,...n})=>l.jsx(St,{mode:"popLayout",initial:!1,children:l.jsx(Te.div,{initial:R1.initial,animate:R1.animate,exit:R1.exit,transition:R1.transition,children:l.jsx(V,{...n,children:e})},t)}));L8.displayName="FlightTextSwitcher";const ice=A.memo(({terminal:e,gate:t,alignEnd:n})=>{const{$t:r}=J();return l.jsxs("div",{className:z("gap-lg flex w-full flex-row",n&&"justify-end"),children:[l.jsx(z5,{label:r({id:"GAHVEi8lHA",defaultMessage:"Terminal"}),value:e??"-"}),l.jsx(z5,{label:r({id:"W+gH70jajX",defaultMessage:"Gate"}),value:t??"-"})]})});ice.displayName="FlightTerminalGate";const z5=A.memo(({label:e,value:t})=>l.jsxs("div",{children:[l.jsx(V,{variant:"tinyMono",color:"light",children:e}),l.jsx(L8,{animationKey:t,variant:"entry-title-200",children:t})]}));z5.displayName="FlightAttribute";const D1={initial:{opacity:0,height:0,filter:"blur(2px)"},animate:{opacity:1,height:"auto",filter:"blur(0px)"},exit:{opacity:0,height:0,filter:"blur(2px)"},transition:{duration:.3,ease:Kr}},W5=A.memo(({time:e,actualTime:t,estimatedTime:n,timezone:r,terminal:s,gate:o,variant:a="departure",delayed:i=!1,cancelled:c=!1})=>{const{locale:u,$t:f}=J(),m=d.useMemo(()=>f(a==="departure"?{id:"BtqAemWTLK",defaultMessage:"Departure"}:{id:"WOIPGxfmZn",defaultMessage:"Arrival"}),[a,f]),p=a==="arrival",h=d.useMemo(()=>{const v=t||n;return v&&v.getTime()===e.getTime()?null:v},[t,n,e]),g=d.useMemo(()=>e.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:r}),[e,r,u]),y=d.useMemo(()=>h?.toLocaleTimeString(u,{hour:"numeric",minute:"2-digit",timeZone:r}),[h,r,u]),x=d.useMemo(()=>e.toLocaleDateString(u,{weekday:"short",month:"short",day:"numeric",timeZone:r}),[e,r,u]);return l.jsxs("div",{className:"gap-md col-span-3 flex min-w-0 flex-col justify-between",children:[l.jsxs("div",{className:z("gap-sm flex flex-col",p&&"items-end"),children:[l.jsxs(V,{variant:"tinyMono",color:"default",className:"gap-sm flex flex-row whitespace-nowrap",children:[m,l.jsxs("span",{children:[" | ",x]})]}),l.jsxs("div",{className:z("flex flex-col",p&&"items-end"),children:[l.jsx(L8,{animationKey:g,as:"span",variant:"entry-title-200",color:i?"negative":"super",className:z("-translate-y-px !font-mono transition-colors duration-500",c&&"text-quiet line-through"),children:h?y:g}),l.jsx(St,{initial:!1,children:h&&l.jsx(Te.div,{initial:D1.initial,animate:D1.animate,exit:D1.exit,transition:D1.transition,className:"overflow-hidden",children:l.jsx(V,{as:"span",variant:h?"small":"entry-title-200",color:"super",className:z("-translate-y-px !font-mono",h&&"!text-quiet line-through"),children:g})})})]})]}),l.jsx(ice,{terminal:s,gate:o,alignEnd:p})]})});W5.displayName="FlightDepartureArrival";const Ppt=Te(K),lce=A.memo(({progress:e,departureTime:t,arrivalTime:n,delayed:r,cancelled:s,departureAirport:o,arrivalAirport:a})=>{const{$t:i}=J(),c=d.useMemo(()=>ap(t,n,i),[t,n,i]),u=d.useMemo(()=>e===void 0||s?0:Math.max(0,Math.min(100,e)),[e,s]),{left:f,width:m}=d.useMemo(()=>({left:`${u}%`,width:`${u}%`}),[u]),p=d.useMemo(()=>({left:0}),[]),h=d.useMemo(()=>({duration:2,ease:Kr,delay:.5}),[]),g=d.useMemo(()=>({left:f,opacity:1,scale:1}),[f]),y=d.useMemo(()=>({...p,opacity:0,scale:1.2,top:"50%",translateX:"-50%",translateY:"-50%"}),[p]),x=d.useMemo(()=>({width:m}),[m]);return l.jsx("div",{className:"px-xs order-last col-span-6 flex flex-col items-center justify-center sm:order-[unset] sm:px-0",children:l.jsxs("div",{className:"gap-md flex w-full flex-col items-center",children:[l.jsxs("div",{className:"gap-xs gap-x-2xl flex flex-row",children:[l.jsx(V,{variant:"entry-title-200",color:"default",className:"mr-md",children:o}),l.jsx(V,{variant:"tinyMono",color:"light",className:"line-clamp-1 whitespace-nowrap",children:c}),l.jsx(V,{variant:"entry-title-200",color:"default",className:"ml-md",children:a})]}),l.jsxs("div",{className:"relative flex w-full flex-1 items-center",children:[l.jsx("div",{className:"bg-inverse/10 relative h-0.5 w-full overflow-hidden rounded-full",children:l.jsx(Te.div,{className:"!bg-inverse/50 absolute inset-y-0 left-0 transition-colors duration-500",initial:p,animate:x,transition:h})}),l.jsx(Ppt,{variant:"raised",className:"absolute left-0 flex aspect-square w-6 items-center justify-center",initial:y,animate:g,transition:h,children:l.jsx(ge,{className:z("text-quiet transition-colors duration-500",e&&e>0&&!r&&"!text-super",r&&"!text-negative",s&&"!text-quiet"),icon:B("plane")})})]})]})})});lce.displayName="FlightProgress";const cce=A.memo(({departureTime:e,arrivalTime:t,actualDepartureTime:n,actualArrivalTime:r,estimatedDepartureTime:s,estimatedArrivalTime:o,flightMetadata:a,delayed:i=!1})=>{const{cancelled:c,departure_airport:u,arrival_airport:f,departure_timezone:m,arrival_timezone:p,terminal:h,gate:g,arrival_terminal:y,arrival_gate:x,progress_percent:v}=a;return l.jsxs(dr,{className:"p-md gap-md grid w-full grid-cols-2 overflow-hidden shadow-sm sm:grid-cols-12",children:[l.jsx(W5,{variant:"departure",time:e,actualTime:n,estimatedTime:s,timezone:m,terminal:h,gate:g,delayed:i,cancelled:c}),l.jsx(lce,{departureTime:e,arrivalTime:t,progress:v,delayed:i,cancelled:c,departureAirport:u,arrivalAirport:f}),l.jsx(W5,{variant:"arrival",time:t,actualTime:r,estimatedTime:o,timezone:p,terminal:y,gate:x,delayed:i,cancelled:c})]})});cce.displayName="FlightStatusCard";const uce=A.memo(({flights:e,selectedFlight:t,setSelectedFlight:n})=>{const{locale:r,$t:s}=J(),{isMobileStyle:o}=Re(),{formatDate:a}=J(),i=d.useCallback(f=>{const m=new Date(f.departure_time),p=VS(m,f.departure_timezone);let h;if(h=a(m,{dateStyle:"short"}),e.filter(y=>{if(y.departure_timezone!==f.departure_timezone)return!1;const x=VS(new Date(y.departure_time),y.departure_timezone);return x.year===p.year&&x.month===p.month&&x.date===p.date}).length>1){const y=m.toLocaleTimeString(r,{hour:"numeric",minute:"2-digit"});h=s({id:"Fr3TxQz4BU",defaultMessage:"{dateString} - {timeString}"},{dateString:h,timeString:y})}return h},[r,e,s,a]),c=d.useMemo(()=>e.map(f=>({type:"default",text:i(f),value:f.flight_aware_id,onClick:()=>n(f),active:f.flight_aware_id===t?.flight_aware_id})),[e,i,n,t?.flight_aware_id]),u=d.useMemo(()=>t?i(t):"",[t,i]);return l.jsx("div",{children:l.jsx(zs,{items:c,isMobileStyle:o,children:l.jsx(Ge,{variant:"border",text:u,chevron:!0,pill:!0})})})});uce.displayName="FlightStatusSwitcher";const dce=A.memo(({data:e})=>{const t=d.useMemo(()=>Ipt(e.data.flights),[e.data.flights]),n=d.useMemo(()=>{const i=new Date().getTime();if(t.length===0)return 0;let c=0,u=1/0;return t.forEach((f,m)=>{f.forEach(p=>{const h=new Date(p.departure_time).getTime(),g=Math.abs(h-i);g{if(t.length<2)return null;const i=t.map(c=>c[0]).filter(c=>!!c);return l.jsx(uce,{flights:i,selectedFlight:o?.[0],setSelectedFlight:c=>{const u=t.findIndex(f=>f[0]?.flight_aware_id===c?.flight_aware_id);u!==-1&&s(u)}})},[t,o]);return!o||o.length===0?null:l.jsx(Fn,{"data-testid":"flight-status-widget",className:"w-full",variant:"noChrome",children:l.jsx(Es,{widgetType:"flight",widgetName:"flight_status",widgetSize:"full",children:l.jsx("div",{className:"gap-md flex flex-col",children:o.map((i,c)=>{const u=Dpt(i),f=jpt(u),m=c===0?a:null;return l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsx(ace,{flightMetadata:i,departureTime:u.departureTime,arrivalTime:u.arrivalTime,actualDepartureTime:u.actualDepartureTime,actualArrivalTime:u.actualArrivalTime,estimatedDepartureTime:u.estimatedDepartureTime,estimatedArrivalTime:u.estimatedArrivalTime,delayed:f,rightContent:m}),l.jsx(cce,{departureTime:u.departureTime,arrivalTime:u.arrivalTime,actualDepartureTime:u.actualDepartureTime,actualArrivalTime:u.actualArrivalTime,estimatedDepartureTime:u.estimatedDepartureTime,estimatedArrivalTime:u.estimatedArrivalTime,flightMetadata:i,delayed:f})]},i.flight_aware_id)})})})})});dce.displayName="FlightStatusWidget";const fce=A.memo(({data:{title:e,text:t,image_url:n,canonical_pages:r}})=>{const{isMobileStyle:s}=Re();return l.jsx(yt,{href:r[0]?.url_web,children:l.jsxs(dr,{shadow:!0,className:"p-sm relative flex items-center md:p-[12px]",bgHover:"subtle",children:[l.jsxs(K,{className:"md:gap-md flex flex-1 items-center gap-[12px]",children:[n&&l.jsx("img",{alt:"",className:"max-h-[65px] rounded-md",src:n}),l.jsxs("div",{className:"mr-sm w-full",children:[e&&l.jsxs(V,{className:"text-pretty",variant:s?"smallBold":"baseSemi",children:[e,l.jsx(ge,{icon:B("chevron-right"),className:"text-quiet ml-0.5 inline-flex -translate-y-px md:hidden",size:"sm"})]}),t&&l.jsx(V,{variant:s?"tinyRegular":"small",color:"light",className:"mt-0.5 text-pretty md:mt-0",children:t})]})]}),l.jsx(ge,{icon:B("chevron-right"),className:"text-quiet hidden md:block",size:"md"})]})})});fce.displayName="GenericFallbackWidget";const Opt=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"finance-polymarket-trending-search",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},mB=250;function Lpt(e,t,n){const r=(t??"light")==="dark",s=e.filter(c=>!c.closedTime),o=e.filter(c=>!!c.closedTime).sort((c,u)=>{const f=c.closedTime?new Date(c.closedTime).getTime():0;return(u.closedTime?new Date(u.closedTime).getTime():0)-f}),a=[...s,...o].map((c,u)=>({...c,color:Hmt(u,r)})),i=a.filter(n);return{unifiedMarkets:a,chartMarkets:i}}function Fpt(e){return e&&e.length>0?new Set(e.map(t=>t.id)):void 0}function Bpt(){const{session:e}=Ne(),{variation:t}=Opt(!1,{userEmail:e?.user?.email??""});return t}const Upt=A.memo(({color:e,probability:t})=>l.jsx("div",{className:"bg-subtle relative h-1.5 w-full overflow-hidden rounded-full",children:l.jsx("div",{className:"absolute inset-y-0 left-0 h-full rounded-full",style:{boxShadow:"inset 0 0 0 1px rgba(255, 255, 255, 0.1)",backgroundColor:e,width:`${Math.max(0,t)}%`}})}));Upt.displayName="PredictionsProgressBar";const Vpt=A.memo(({probability:e,forceZeroLabel:t=!1})=>{const{locale:n}=J(),r=e===0?t?"0%":"<1%":(e/100).toLocaleString(n,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1});return l.jsx(V,{variant:"tiny",color:"light",className:"w-full max-w-[40px] text-left font-mono leading-tight",children:r})});Vpt.displayName="PredictionsProbability";const Hpt=e=>e>0?"-rotate-45":e<0?"rotate-45":"rotate-0",zpt=.001,G5=A.memo(({change:e,variant:t="active",resolvedDate:n=null,resolvedOutcome:r="positive"})=>{const{locale:s}=J();if(t==="resolved"){const o=n?new Date(n).toLocaleDateString(s,{month:"short",day:"numeric"}):void 0;return l.jsx(K,{className:"flex w-full items-center justify-center",children:o&&l.jsx(V,{as:"span",variant:"tiny",color:"light",className:"flex w-full items-center justify-center rounded bg-subtle px-[0.6em] py-[0.15em] font-mono",children:l.jsx("span",{className:"whitespace-nowrap",children:o})})})}return e===null||Math.abs(e)0?"super":"negative",className:z("flex w-full items-center justify-center gap-[0.1em] rounded px-[0.6em] py-[0.15em] font-mono",{"bg-positive/10":e>0,"bg-negative/10":e<0}),children:[l.jsx(ut,{name:B("arrow-right"),className:z("size-3 shrink-0 transition-transform duration-500 ease-in-out",Hpt(e),e>0?"text-super":"text-negative")}),l.jsx("span",{className:"whitespace-nowrap",children:e.toLocaleString(s,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1,signDisplay:"never"})})]})})});G5.displayName="PredictionsStatus";const mce=A.memo(({marketCount:e,provider:t,href:n,visibleMarketsCount:r})=>{const{$t:s}=J(),{isMobileStyle:o}=Re(),a=dW(t),i=r&&e>r?s({defaultMessage:"+{count} on {provider}",id:"aqcKaqAMBB"},{count:e-r,provider:a}):o||e<=2?a:s({defaultMessage:"View on {provider}",id:"x+8tBD0Kpk"},{provider:a});return l.jsx(qh,{href:n,target:"_blank",rel:"noopener",variant:"text",size:"tiny",children:l.jsx(V,{variant:"tinyRegular",color:"light",children:i})})});mce.displayName="PredictionsAttributionLink";const Wpt=["1h","6h","1d","1w","1m","max"],Gpt={"1h":W({id:"Ifw0lcjnAL",defaultMessage:"1H"}),"6h":W({id:"YkLVNm/W6Q",defaultMessage:"6H"}),"1d":W({id:"aTX7LJbdI3",defaultMessage:"1D"}),"1w":W({id:"6bJGds1heu",defaultMessage:"1W"}),"1m":W({id:"1uz/I31pXU",defaultMessage:"1M"}),max:W({id:"peV3nrWw/A",defaultMessage:"MAX"})},pce=A.memo(({endDate:e})=>{const{isMobileStyle:t}=Re(),{$t:n,locale:r}=J(),s=new Date(e){const{locale:o,$t:a}=J(),{isMobileStyle:i}=Re();return l.jsx(K,{className:"gap-md flex flex-col",children:l.jsxs(K,{className:"gap-sm flex items-start",children:[t&&l.jsx("img",{src:t,alt:e,className:"bg-subtler aspect-square size-10 shrink-0 rounded-md object-cover mt-xs"}),l.jsxs(K,{className:"min-w-0 flex-1",children:[l.jsx(V,{variant:i?"section-title":"page-title",className:"min-w-0 leading-tight",children:e}),l.jsxs(K,{className:"mt-xs flex flex-col items-stretch gap-xs md:flex-row md:gap-sm",children:[l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("coins"),className:"size-4"}),a({defaultMessage:"{volume} vol.",id:"fBnaWW/3DX"},{volume:n.toLocaleString(o,{style:r?"currency":void 0,currency:r??void 0,notation:"compact"})})]}),l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[l.jsx(ut,{name:B("clock"),className:"size-4"}),l.jsx(pce,{endDate:s})]})]})]})]})})});hce.displayName="PredictionsEventHeader";const gce=A.memo(({market:e,useColor:t=!1,showDot:n=!0,compactPadding:r=!1,className:s,showOutcomeName:o=!1})=>{const{locale:a}=J(),i=!!e.closedTime,c=i&&e.outcomes?e.outcomes[e.outcomePrices.indexOf(Math.max(...e.outcomePrices))]:void 0,u=e.probability<.001?"<0.1%":e.probability.toLocaleString(a,{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}),f=Math.sqrt(e.probability),m=o&&e.outcomes?.length===2&&!i?`${e.question} (${e.outcomes[0]})`:e.question;return l.jsxs(K,{className:z("grid grid-cols-[minmax(0,1fr)_auto_56px] items-center gap-x-sm border-b border-subtlest py-sm",r?"px-md":"px-sm",s),children:[l.jsxs("div",{className:"flex items-center gap-sm",children:[n&&l.jsx("span",{className:z("size-2 shrink-0 rounded-full",{"border border-subtle":!t}),style:t?{backgroundColor:e.color}:void 0}),l.jsx(V,{variant:"small",color:e.emphasized?"super":r?"light":"default",className:"min-w-0 break-words",children:m})]}),l.jsx("div",{className:"flex items-center justify-end gap-xs",children:i?l.jsxs(l.Fragment,{children:[c&&l.jsx(V,{variant:"small",color:"default",children:c}),l.jsx(ut,{name:B(c?.toLowerCase()==="no"?"x":"check"),size:16,className:z("shrink-0",c?.toLowerCase()==="no"?"text-caution dark:text-rosa":"text-super")})]}):l.jsx(V,{variant:"smallBold",className:"whitespace-nowrap font-mono",style:{color:`color-mix(in oklch, oklch(var(--foreground-color)) ${f*100}%, oklch(var(--foreground-quiet-color)))`},children:u})}),l.jsx("div",{className:"flex items-center justify-center",children:i?l.jsx(G5,{change:null,variant:"resolved",resolvedDate:e.closedTime}):l.jsx(G5,{change:e.change,variant:"active"})})]})});gce.displayName="PredictionsMarketRow";const $pt=A.memo(({provider:e,variant:t="tiny"})=>l.jsx(V,{variant:t,color:"ultraLight",children:e}));$pt.displayName="ProviderText";const yce=A.memo(({updatedAt:e,useCompact:t=!1})=>{const n=J(),{$t:r}=n,{isMobileStyle:s}=Re(),o=d.useMemo(()=>jee(n,new Date(e),{style:"short",numeric:"auto"})||r({defaultMessage:"Now",id:"tgvES0v2HS"}),[e,n,r]);return l.jsxs(V,{variant:"tinyRegular",color:"light",className:"flex items-center gap-xs min-w-0",children:[(s||t)&&l.jsx(ut,{name:B("clock"),className:"size-3 shrink-0"}),l.jsx("span",{className:"truncate",children:s||t?o:r({defaultMessage:"Updated {date}",id:"vbMp1ubkut"},{date:o})})]})});yce.displayName="UpdatedAt";const qpt=A.memo(({volume:e,currency:t,compact:n=!1,hideIcon:r=!1})=>{const{locale:s,$t:o}=J(),{isMobileStyle:a}=Re();return l.jsxs(V,{variant:"tinyRegular",color:"light",className:"gap-xs flex items-center",children:[!r&&l.jsx(ut,{name:B("coins"),className:"size-4"}),o({defaultMessage:"{volume} vol.",id:"fBnaWW/3DX"},{volume:e.toLocaleString(s,{style:t?"currency":void 0,currency:t??void 0,notation:n||a?"compact":void 0})})]})});qpt.displayName="VolumeDisplay";const xce=A.memo(({markets:e,chartMarketIds:t,initialDisplayCount:n=5})=>{const[r,s]=d.useState(!1),{$t:o}=J(),{isMobileStyle:a}=Re(),i=e.length>n,c=d.useMemo(()=>{if(r)return e;const m=e.find(h=>h.emphasized);return(m?e.indexOf(m):-1)l.jsx(gce,{market:m,useColor:t?.has(m.id)??!1,showOutcomeName:f},m.id)),i&&l.jsx(l.Fragment,{children:a?l.jsx(K,{className:"mx-md my-sm",children:l.jsx(wt,{fullWidth:!0,size:"tiny",onClick:()=>s(!r),variant:"secondary",children:u})}):l.jsx(K,{className:"ml-sm mt-xs flex justify-start",children:l.jsx(wt,{size:"tiny",onClick:()=>s(!r),variant:"text",children:u})})})]})});xce.displayName="PredictionsMarkets";const Kpt=A.memo(({commentary:e,sourceUrls:t,variant:n="small",className:r})=>l.jsxs(V,{variant:n,className:r,children:[e,t?.flat().filter(Boolean).map((s,o)=>l.jsxs(A.Fragment,{children:[" ",l.jsx(NN,{url:s,href:s||void 0,linkBehavior:"external",className:"translate-y-half duration-quick -mt-1 inline-block uppercase transition-opacity"},o)]},o))]}));Kpt.displayName="CommentaryWithSources";const pB=50,Ypt=(e,t,n)=>{const r=new Date(e),s=new Date(t),o=r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()&&r.getDate()===s.getDate(),a=r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth(),i=r.getFullYear()===s.getFullYear();return o?c=>{const u=c.getMinutes()!==0;return c.toLocaleTimeString(n,{hour:"numeric",minute:u?"numeric":void 0})}:a?c=>c.toLocaleDateString(n,{month:"short",day:"numeric",hour:"numeric"}):i?c=>c.toLocaleDateString(n,{month:"short",day:"numeric"}):c=>c.toLocaleDateString(n,{year:"numeric",month:"short"})},Qpt=({x:e,y:t,color:n,r=4,animationId:s})=>l.jsxs("g",{children:[l.jsx(Te.circle,{cx:e,cy:t,r,fill:"none",stroke:n,strokeWidth:2,initial:{r,opacity:1},animate:{r:r*4,opacity:0},transition:{duration:1.5,ease:"easeOut"},style:{pointerEvents:"none"}},`${s}`),l.jsx("circle",{cx:e,cy:t,r,fill:n,stroke:"oklch(var(--background-color))",strokeWidth:2,style:{pointerEvents:"none"}})]}),Xpt=({data:e,animationId:t})=>e.map(n=>l.jsx(Qpt,{x:n.x,y:n.y,color:n.market.color,animationId:t},n.market.question)),Zpt=({data:e,locale:t,decimalPlaces:n=3})=>{const r=Math.max(0,n-2),s=e[0]?.timestamp,o=d.useMemo(()=>s?new Date(s).toLocaleDateString(t,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"}):null,[s,t]),a=e.length===1;return l.jsxs(K,{className:"space-y-xs px-sm py-xs",children:[l.jsx(V,{variant:"tinyRegular",color:"light",children:o}),e.map(i=>{const c=a&&i.market.outcomes?.length===2?i.market.outcomes[0]:i.market.question;return l.jsxs(K,{className:"gap-xs flex items-center",children:[l.jsx("div",{className:"size-2 rounded-full",style:{backgroundColor:i.market.color}}),l.jsxs(V,{variant:"tinyRegular",color:"default",children:[c,":"," ",i.data.probability.toLocaleString(t,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r})]})]},i.market.question)})]})},Jpt=Hg(e=>new Date(e.timestamp)).left,eht=(e,t,n)=>{if(!n?.length)return{d:null,index:0,x:e};const r=t.invert(e),s=Math.max(0,Math.min(Jpt(n,r),n.length-1)),o=n[s-1],a=n[s];let i=Math.max(0,s-1);if(o&&a){const u=Math.abs(t(new Date(a.timestamp))-e),f=Math.abs(t(new Date(o.timestamp))-e);u{const{tooltipData:s,hideTooltip:o,showTooltip:a}=Zb(),i=d.useCallback(c=>{const u=i0(c);if(!u)return;const f=XN(c),m=Math.min(Math.max(r[0],u.x),r[1]),p=e.map(h=>{if(!h.history)return null;const g=eht(m,t,h.history);return g.d?{market:h,data:g.d,x:t(new Date(g.d.timestamp))??0,y:n(g.d.probability),timestamp:g.d.timestamp}:null}).filter(h=>h!==null);p.length&&a({tooltipData:{hits:p,point:{local:{x:u.x,y:Math.max(0,u.y-xs)},global:f}}})},[e,t,n,a,r]);return d.useMemo(()=>({tooltipData:s,hideTooltip:o,showTooltip:i}),[s,o,i])},nht=({l:e,history:t,color:n})=>{const r=d.useMemo(()=>e(t),[e,t]),s=n_(r,!0,ii);return l.jsx(fa.path,{d:s,stroke:n,strokeWidth:1.75,fill:"none",shapeRendering:am})},vce=A.memo(({markets:e,width:t,height:n,updatedAt:r,uiHints:s,watermark:o})=>{const{locale:a}=J(),i=d.useMemo(()=>lm({domain:ko(e.flatMap(T=>T.history??[]),T=>new Date(T.timestamp)),range:[0,t-pB]}),[e,t]),c=d.useMemo(()=>{const T=s?.lowerBound,k=s?.upperBound;if(T!=null&&k!==void 0&&k!==null)return Bi({domain:[T,k],range:[n-xs,Rd]});const I=e.flatMap(R=>(R.history??[]).map(P=>P.probability));if(!I.length)return Bi({domain:[0,1],range:[n-xs,Rd]});const[M,N]=ko(I),D=(N-M)*.1,j=Math.max(0,M-D),F=Math.min(1,N+D);return Bi({domain:[j,F],range:[n-xs,Rd]})},[e,n,s]),u=d.useMemo(()=>sl().x(T=>i(new Date(T.timestamp))).y(T=>c(T.probability)).curve(Db),[i,c]),f=d.useMemo(()=>c.ticks(5).length>6?c.ticks(4).length>6?c.ticks(4).slice(1,-1):c.ticks(4):c.ticks(5),[c]),m=d.useMemo(()=>i.ticks(5),[i]),p=d.useMemo(()=>{const T=e.flatMap(N=>N.history??[]);if(!T.length)return N=>N.toLocaleDateString(a);const k=new Date(T[0].timestamp),I=new Date(T[T.length-1].timestamp),M=Ypt(k,I,a);return N=>M(N)},[e,a]),h=d.useMemo(()=>Gae({ticks:m,xScale:i,width:t,formatter:T=>p(T),marginRight:pB}),[m,i,t,p]),g=d.useCallback(()=>({fill:er.gray,fontSize:12,dy:"-5px",textAnchor:"end",fontFamily:"var(--font-family-sans)"}),[]),y=T=>{const k=T.toString(),I=k.indexOf(".");return I===-1?0:k.length-I-1},x=d.useCallback(T=>{const k=Math.max(...f.map(M=>y(M))),I=Math.max(0,k-2);return T.toLocaleString(a,{style:"percent",maximumFractionDigits:I,minimumFractionDigits:I})},[a,f]),v=d.useMemo(()=>`prediction-market-${e[0]?.question??"chart"}`,[e]),b=d.useMemo(()=>[0,t],[t]),{tooltipData:_,hideTooltip:w,showTooltip:S}=tht({markets:e,xScale:i,yScale:c,xBounds:b}),C=d.useMemo(()=>_?_.hits:e.map(T=>{const k=T.history?.[T.history.length-1];return k?{market:T,data:k,x:i(new Date(k.timestamp))??0,y:c(k.probability),timestamp:k.timestamp}:null}).filter(T=>T!==null),[_,e,i,c]),E=d.useMemo(()=>{const T=e.flatMap(k=>(k.history??[]).map(I=>I.probability));return T.length?T.reduce((k,I)=>Math.max(k,y(I)),0):2},[e]);return l.jsxs("div",{className:JN,onMouseMove:S,onMouseLeave:w,onTouchStart:S,onTouchMove:S,onTouchEnd:w,children:[l.jsxs("svg",{height:n,width:t,className:ZN,children:[l.jsx(St,{initial:!1,mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:jl,children:[l.jsx(bu,{tickValues:f,scale:c,width:t,stroke:er.gray,strokeWidth:1,opacity:.1,className:"transition-all duration-1000"}),l.jsx($b,{scale:i,opacity:.1,height:n*2,stroke:er.gray,style:{transform:`translateY(-${n}px)`},tickValues:h,strokeWidth:1})]},v)}),l.jsx(St,{mode:"wait",children:l.jsxs(Te.g,{initial:{opacity:0},exit:{opacity:0,transition:{duration:0,delay:0}},animate:{opacity:1},transition:jl,children:[l.jsx(zl,{scale:c,hideTicks:!0,hideAxisLine:!0,tickValues:f,left:t,orientation:"left",tickFormat:x,tickLabelProps:g}),l.jsx(zl,{scale:i,hideAxisLine:!0,hideTicks:!0,tickValues:h,tickFormat:p,orientation:"bottom",top:n-xs,tickLabelProps:t8})]},v)}),e.map(T=>l.jsx(nht,{l:u,history:T.history,color:T.color},T.question)),l.jsx(St,{children:_&&l.jsx(Jb,{marginTop:-n,tooltipLeft:_.point.local.x,innerHeight:n*3,color:er.gray})}),l.jsx(Xpt,{data:C,animationId:r})]}),o&&l.jsx("div",{className:"absolute -top-md left-sm z-[2]",children:o}),_&&l.jsx(Xl,{children:l.jsx(e_,{x:_.point.global.x,y:_.point.global.y,children:l.jsx(Zpt,{data:_.hits,locale:a,decimalPlaces:E})})})]})});vce.displayName="PredictionMarketChart";const bce=A.memo(({eventId:e,event:t,chartMarkets:n,periods:r,period:s,setPeriod:o})=>{const{isMobileStyle:a}=Re();return!n||n.length===0?null:l.jsxs(K,{className:"gap-y-sm relative flex flex-col justify-between overflow-hidden border-b",children:[l.jsx(K,{className:"z-[2] p-sm absolute inset-x-0 top-0 flex items-center justify-start",children:l.jsx(O8,{id:`prediction-market-${e}`,periods:r,period:s,setPeriod:o,variant:a?"sm":"lg"})}),l.jsx("div",{style:{paddingTop:Dh+16+20},className:"relative z-[1]",children:l.jsx(k8,{height:mB,render:!!t,minWidth:100,children:i=>i?l.jsx(vce,{period:s,updatedAt:t.updatedDate,markets:n,width:i,height:mB,uiHints:t.uiHints,watermark:l.jsx(Rh,{})}):null})})]})});bce.displayName="PredictionMarketChartWithControls";const hB=({href:e,eventId:t})=>{const{isMobileStyle:n}=Re(),{$t:r}=J(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(()=>{o("predictions link clicked",{referrer:Oot.PREDICTIONS_WIDGET,targetPageType:Lot.ASSET_PAGE,eventId:t,destinationUrl:e})},[o,t,e]);return l.jsx(K,{className:"gap-sm flex items-center justify-center",children:l.jsx(Ge,{variant:"primaryGhost",chevron:!0,chevronIcon:B("chevron-right"),text:r({defaultMessage:"Deep Dive on {pplxFinance}",id:"QX457HdJyA"},{pplxFinance:"Perplexity Finance"}),size:"small",href:e,onClick:a,fullWidth:n})})},rht=({event:e})=>{const{isMobileStyle:t}=Re();return t&&e.uiHints?.canonicalPage?.urlWeb?l.jsx(hB,{href:e.uiHints.canonicalPage.urlWeb,eventId:e.id}):l.jsxs(K,{className:"gap-xs pt-sm flex items-baseline justify-between",children:[l.jsx(yce,{updatedAt:e.updatedDate}),!!e.uiHints?.canonicalPage?.urlWeb&&l.jsx(hB,{href:e.uiHints.canonicalPage.urlWeb,eventId:e.id}),l.jsx(mce,{href:e.eventUrl,marketCount:e.markets?.length??0,provider:e.provider})]})},_ce=A.memo(({eventId:e,eventData:t})=>{const[n,r]=d.useState("max"),{$t:s}=J(),o=d.useMemo(()=>t?.uiHints?.emphasizedMarketIds??[],[t?.uiHints?.emphasizedMarketIds]),a={eventId:e,historyPeriod:n,marketsSort:"probability",emphasizedMarketIds:o},{data:i}=mt({queryKey:yKe(a),queryFn:()=>xKe(a),enabled:!!e,refetchInterval:h=>{const g=h.state.data,y=t?.uiHints?.refetchIntervalSecs??g?.uiHints?.refetchIntervalSecs;return y?y*1e3:!1},refetchIntervalInBackground:!1,placeholderData:h=>h||t,staleTime:0}),{colorScheme:c}=Ss(),{unifiedMarkets:u,chartMarkets:f}=d.useMemo(()=>i?.markets?Lpt(i.markets,c,h=>!h.closedTime&&!!(h.history&&h.history.length>0)):{unifiedMarkets:void 0,chartMarkets:void 0},[i?.markets,c]),m=d.useMemo(()=>(i?.uiHints?.periods??Wpt).map(h=>({value:h,text:s(Gpt[h])})),[i?.uiHints?.periods,s]),p=Bpt();return!i||!u||!p?null:l.jsxs(K,{className:"rounded-xl border",variant:"raised",children:[l.jsx(K,{className:"px-md py-sm",children:l.jsx(hce,{title:i.title,image:i.icon,volume:i.volume,currency:i.currency,endDate:i.endDate})}),l.jsx(bce,{eventId:e,event:i,chartMarkets:f,periods:m,period:n,setPeriod:r}),l.jsxs(K,{className:"px-md pb-sm pt-0",children:[u&&u.length>0&&l.jsx(xce,{markets:u,chartMarketIds:Fpt(f)}),l.jsx(rht,{event:i})]})]})});_ce.displayName="PredictionsEvent";const wce=A.memo(({data:e})=>l.jsx(Dme,{fallback:null,children:l.jsx(Es,{widgetType:"predictions",widgetName:"prediction_market",widgetSize:"full",children:l.jsx(_ce,{eventId:e.id,eventData:e})})}));wce.displayName="PredictionMarketWidget";const Za={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Cce=Object.create(null);for(const e in Za)Object.hasOwn(Za,e)&&(Cce[Za[e]]=e);const Er={to:{},get:{}};Er.get=function(e){const t=e.slice(0,3).toLowerCase();let n,r;switch(t){case"hsl":{n=Er.get.hsl(e),r="hsl";break}case"hwb":{n=Er.get.hwb(e),r="hwb";break}default:{n=Er.get.rgb(e),r="rgb";break}}return n?{model:r,value:n}:null};Er.get.rgb=function(e){if(!e)return null;const t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,s=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^(\w+)$/;let a=[0,0,0,1],i,c,u;if(i=e.match(n)){for(u=i[2],i=i[1],c=0;c<3;c++){const f=c*2;a[c]=Number.parseInt(i.slice(f,f+2),16)}u&&(a[3]=Number.parseInt(u,16)/255)}else if(i=e.match(t)){for(i=i[1],u=i[3],c=0;c<3;c++)a[c]=Number.parseInt(i[c]+i[c],16);u&&(a[3]=Number.parseInt(u+u,16)/255)}else if(i=e.match(r)){for(c=0;c<3;c++)a[c]=Number.parseInt(i[c+1],10);i[4]&&(a[3]=i[5]?Number.parseFloat(i[4])*.01:Number.parseFloat(i[4]))}else if(i=e.match(s)){for(c=0;c<3;c++)a[c]=Math.round(Number.parseFloat(i[c+1])*2.55);i[4]&&(a[3]=i[5]?Number.parseFloat(i[4])*.01:Number.parseFloat(i[4]))}else return(i=e.match(o))?i[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Za,i[1])?(a=Za[i[1]],a[3]=1,a):null:null;for(c=0;c<3;c++)a[c]=Il(a[c],0,255);return a[3]=Il(a[3],0,1),a};Er.get.hsl=function(e){if(!e)return null;const t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),s=(Number.parseFloat(n[1])%360+360)%360,o=Il(Number.parseFloat(n[2]),0,100),a=Il(Number.parseFloat(n[3]),0,100),i=Il(Number.isNaN(r)?1:r,0,1);return[s,o,a,i]}return null};Er.get.hwb=function(e){if(!e)return null;const t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),s=(Number.parseFloat(n[1])%360+360)%360,o=Il(Number.parseFloat(n[2]),0,100),a=Il(Number.parseFloat(n[3]),0,100),i=Il(Number.isNaN(r)?1:r,0,1);return[s,o,a,i]}return null};Er.to.hex=function(...e){return"#"+j1(e[0])+j1(e[1])+j1(e[2])+(e[3]<1?j1(Math.round(e[3]*255)):"")};Er.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Er.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};Er.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Er.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};Er.to.keyword=function(...e){return Cce[e.slice(0,3)]};function Il(e,t,n){return Math.min(Math.max(t,e),n)}function j1(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}const Sce={};for(const e of Object.keys(Za))Sce[Za[e]]=e;const Ye={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Ui=(6/29)**3;function jd(e){const t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Id(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(const e of Object.keys(Ye)){if(!("channels"in Ye[e]))throw new Error("missing channels property: "+e);if(!("labels"in Ye[e]))throw new Error("missing channel labels property: "+e);if(Ye[e].labels.length!==Ye[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=Ye[e];delete Ye[e].channels,delete Ye[e].labels,Object.defineProperty(Ye[e],"channels",{value:t}),Object.defineProperty(Ye[e],"labels",{value:n})}Ye.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(t,n,r),o=Math.max(t,n,r),a=o-s;let i,c;switch(o){case s:{i=0;break}case t:{i=(n-r)/a;break}case n:{i=2+(r-t)/a;break}case r:{i=4+(t-n)/a;break}}i=Math.min(i*60,360),i<0&&(i+=360);const u=(s+o)/2;return o===s?c=0:u<=.5?c=a/(o+s):c=a/(2-o-s),[i,c*100,u*100]};Ye.rgb.hsv=function(e){let t,n,r,s,o;const a=e[0]/255,i=e[1]/255,c=e[2]/255,u=Math.max(a,i,c),f=u-Math.min(a,i,c),m=function(p){return(u-p)/6/f+1/2};if(f===0)s=0,o=0;else{switch(o=f/u,t=m(a),n=m(i),r=m(c),u){case a:{s=r-n;break}case i:{s=1/3+t-r;break}case c:{s=2/3+n-t;break}}s<0?s+=1:s>1&&(s-=1)}return[s*360,o*100,u*100]};Ye.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const s=Ye.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[s,o*100,r*100]};Ye.rgb.oklab=function(e){const t=Id(e[0]/255),n=Id(e[1]/255),r=Id(e[2]/255),s=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),i=.2104542553*s+.793617785*o-.0040720468*a,c=1.9779984951*s-2.428592205*o+.4505937099*a,u=.0259040371*s+.7827717662*o-.808675766*a;return[i*100,c*100,u*100]};Ye.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(1-t,1-n,1-r),o=(1-t-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,i=(1-r-s)/(1-s)||0;return[o*100,a*100,i*100,s*100]};function sht(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Ye.rgb.keyword=function(e){const t=Sce[e];if(t)return t;let n=Number.POSITIVE_INFINITY,r;for(const s of Object.keys(Za)){const o=Za[s],a=sht(e,o);aUi?n**(1/3):7.787*n+16/116,r=r>Ui?r**(1/3):7.787*r+16/116,s=s>Ui?s**(1/3):7.787*s+16/116;const o=116*r-16,a=500*(n-r),i=200*(r-s);return[o,a,i]};Ye.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let s,o;if(n===0)return o=r*255,[o,o,o];const a=r<.5?r*(1+n):r+n-r*n,i=2*r-a,c=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?o=i+(a-i)*6*s:2*s<1?o=a:3*s<2?o=i+(a-i)*(2/3-s)*6:o=i,c[u]=o*255;return c};Ye.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,s=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,s*=o<=1?o:2-o;const a=(r+n)/2,i=r===0?2*s/(o+s):2*n/(r+n);return[t,i*100,a*100]};Ye.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const s=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),i=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,s){case 0:return[r,c,a];case 1:return[i,r,a];case 2:return[a,r,c];case 3:return[a,i,r];case 4:return[c,a,r];case 5:return[r,a,i]}};Ye.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,s=Math.max(r,.01);let o,a;a=(2-n)*r;const i=(2-n)*s;return o=n*s,o/=i<=1?i:2-i,o=o||0,a/=2,[t,o*100,a*100]};Ye.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const s=n+r;let o;s>1&&(n/=s,r/=s);const a=Math.floor(6*t),i=1-r;o=6*t-a,(a&1)!==0&&(o=1-o);const c=n+o*(i-n);let u,f,m;switch(a){default:case 6:case 0:{u=i,f=c,m=n;break}case 1:{u=c,f=i,m=n;break}case 2:{u=n,f=i,m=c;break}case 3:{u=n,f=c,m=i;break}case 4:{u=c,f=n,m=i;break}case 5:{u=i,f=n,m=c;break}}return[u*255,f*255,m*255]};Ye.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=e[3]/100,o=1-Math.min(1,t*(1-s)+s),a=1-Math.min(1,n*(1-s)+s),i=1-Math.min(1,r*(1-s)+s);return[o*255,a*255,i*255]};Ye.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let s,o,a;return s=t*3.2404542+n*-1.5371385+r*-.4985314,o=t*-.969266+n*1.8760108+r*.041556,a=t*.0556434+n*-.2040259+r*1.0572252,s=jd(s),o=jd(o),a=jd(a),[s*255,o*255,a*255]};Ye.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>Ui?t**(1/3):7.787*t+16/116,n=n>Ui?n**(1/3):7.787*n+16/116,r=r>Ui?r**(1/3):7.787*r+16/116;const s=116*n-16,o=500*(t-n),a=200*(n-r);return[s,o,a]};Ye.xyz.oklab=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),o=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),a=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r),i=.2104542553*s+.793617785*o-.0040720468*a,c=1.9779984951*s-2.428592205*o+.4505937099*a,u=.0259040371*s+.7827717662*o-.808675766*a;return[i*100,c*100,u*100]};Ye.oklab.oklch=function(e){return Ye.lab.lch(e)};Ye.oklab.xyz=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=(.999999998*t+.396337792*n+.215803758*r)**3,o=(1.000000008*t-.105561342*n-.063854175*r)**3,a=(1.000000055*t-.089484182*n-1.291485538*r)**3,i=1.227013851*s-.55779998*o+.281256149*a,c=-.040580178*s+1.11225687*o-.071676679*a,u=-.076381285*s-.421481978*o+1.58616322*a;return[i*100,c*100,u*100]};Ye.oklab.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=(t+.3963377774*n+.2158037573*r)**3,o=(t-.1055613458*n-.0638541728*r)**3,a=(t-.0894841775*n-1.291485548*r)**3,i=jd(4.0767416621*s-3.3077115913*o+.2309699292*a),c=jd(-1.2684380046*s+2.6097574011*o-.3413193965*a),u=jd(-.0041960863*s-.7034186147*o+1.707614701*a);return[i*255,c*255,u*255]};Ye.oklch.oklab=function(e){return Ye.lch.lab(e)};Ye.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let s,o,a;o=(t+16)/116,s=n/500+o,a=o-r/200;const i=o**3,c=s**3,u=a**3;return o=i>Ui?i:(o-16/116)/7.787,s=c>Ui?c:(s-16/116)/7.787,a=u>Ui?u:(a-16/116)/7.787,s*=95.047,o*=100,a*=108.883,[s,o,a]};Ye.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let s;s=Math.atan2(r,n)*360/2/Math.PI,s<0&&(s+=360);const a=Math.sqrt(n*n+r*r);return[t,a,s]};Ye.lch.lab=function(e){const t=e[0],n=e[1],s=e[2]/360*2*Math.PI,o=n*Math.cos(s),a=n*Math.sin(s);return[t,o,a]};Ye.rgb.ansi16=function(e,t=null){const[n,r,s]=e;let o=t===null?Ye.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let a=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(a+=60),a};Ye.hsv.ansi16=function(e){return Ye.rgb.ansi16(Ye.hsv.rgb(e),e[2])};Ye.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t>>4===n>>4&&n>>4===r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};Ye.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(Math.trunc(e>50)+1)*.5,r=(t&1)*n*255,s=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,s,o]};Ye.ansi256.rgb=function(e){if(e=e[0],e>=232){const o=(e-232)*10+8;return[o,o,o]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,s=t%6/5*255;return[n,r,s]};Ye.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};Ye.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(i=>i+i).join(""));const r=Number.parseInt(n,16),s=r>>16&255,o=r>>8&255,a=r&255;return[s,o,a]};Ye.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),a=s-o;let i;const c=a<1?o/(1-a):0;return a<=0?i=0:s===t?i=(n-r)/a%6:s===n?i=2+(r-t)/a:i=4+(t-n)/a,i/=6,i%=1,[i*360,a*100,c*100]};Ye.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let s=0;return r<1&&(s=(n-.5*r)/(1-r)),[e[0],r*100,s*100]};Ye.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let s=0;return r<1&&(s=(n-r)/(1-r)),[e[0],r*100,s*100]};Ye.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const s=[0,0,0],o=t%1*6,a=o%1,i=1-a;let c=0;switch(Math.floor(o)){case 0:{s[0]=1,s[1]=a,s[2]=0;break}case 1:{s[0]=i,s[1]=1,s[2]=0;break}case 2:{s[0]=0,s[1]=1,s[2]=a;break}case 3:{s[0]=0,s[1]=i,s[2]=1;break}case 4:{s[0]=a,s[1]=0,s[2]=1;break}default:s[0]=1,s[1]=0,s[2]=i}return c=(1-n)*r,[(n*s[0]+c)*255,(n*s[1]+c)*255,(n*s[2]+c)*255]};Ye.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let s=0;return r>0&&(s=t/r),[e[0],s*100,r*100]};Ye.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let s=0;return r>0&&r<.5?s=t/(2*r):r>=.5&&r<1&&(s=t/(2*(1-r))),[e[0],s*100,r*100]};Ye.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};Ye.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,s=r-t;let o=0;return s<1&&(o=(r-s)/(1-s)),[e[0],s*100,o*100]};Ye.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};Ye.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};Ye.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};Ye.gray.hsl=function(e){return[0,0,e[0]]};Ye.gray.hsv=Ye.gray.hsl;Ye.gray.hwb=function(e){return[0,100,e[0]]};Ye.gray.cmyk=function(e){return[0,0,0,e[0]]};Ye.gray.lab=function(e){return[e[0],0,0]};Ye.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r};Ye.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function oht(){const e={},t=Object.keys(Ye);for(let{length:n}=t,r=0;r0;){const r=n.pop(),s=Object.keys(Ye[r]);for(let{length:o}=s,a=0;a1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function fht(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const s=e(n);if(typeof s=="object")for(let{length:o}=s,a=0;a0){this.model=t||"rgb",r=Or[this.model].channels;const s=Array.prototype.slice.call(e,0,r);this.color=K5(s,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const o=s.sort().join("");if(!(o in $5))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$5[o];const{labels:a}=Or[this.model],i=[];for(n=0;n(e%360+360)%360),saturationl:rr("hsl",1,wr(100)),lightness:rr("hsl",2,wr(100)),saturationv:rr("hsv",1,wr(100)),value:rr("hsv",2,wr(100)),chroma:rr("hcg",1,wr(100)),gray:rr("hcg",2,wr(100)),white:rr("hwb",1,wr(100)),wblack:rr("hwb",2,wr(100)),cyan:rr("cmyk",0,wr(100)),magenta:rr("cmyk",1,wr(100)),yellow:rr("cmyk",2,wr(100)),black:rr("cmyk",3,wr(100)),x:rr("xyz",0,wr(95.047)),y:rr("xyz",1,wr(100)),z:rr("xyz",2,wr(108.833)),l:rr("lab",0,wr(100)),a:rr("lab",1),b:rr("lab",2),keyword(e){return e!==void 0?new Kn(e):Or[this.model].keyword(this.color)},hex(e){return e!==void 0?new Kn(e):Er.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new Kn(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),Er.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const s=r/255;t[n]=s<=.04045?s/12.92:((s+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return Kn.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),s=t===void 0?.5:t,o=2*s-1,a=n.alpha()-r.alpha(),i=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,c=1-i;return Kn.rgb(i*n.red()+c*r.red(),i*n.green()+c*r.green(),i*n.blue()+c*r.blue(),n.alpha()*s+r.alpha()*(1-s))}};for(const e of Object.keys(Or)){if(Ece.includes(e))continue;const{channels:t}=Or[e];Kn.prototype[e]=function(...n){return this.model===e?new Kn(this):n.length>0?new Kn(n,e):new Kn([...hht(Or[this.model][e].raw(this.color)),this.valpha],e)},Kn[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=K5(n,t)),new Kn(r,e)}}function mht(e,t){return Number(e.toFixed(t))}function pht(e){return function(t){return mht(t,e)}}function rr(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(q5[r]||=[])[t]=n;return e=e[0],function(r){let s;return r!==void 0?(n&&(r=n(r)),s=this[e](),s.color[t]=r,s):(s=this[e]().color[t],n&&(s=n(s)),s)}}function wr(e){return function(t){return Math.max(0,Math.min(e,t))}}function hht(e){return Array.isArray(e)?e:[e]}function K5(e,t){for(let n=0;nght.includes(e);function yht(e,t){return t.find(n=>String(n.teamId)===String(e))}const xht=e=>{switch(e){case"nba":case"wnba":case"ncaam":case"ncaaw":case"mlb":case"atp":case"wta":case"championsleague":case"laliga":case"ligue1":case"epl":case"bundesliga":return"/static/images/sports/nba/logos/nba-logo-generic.png";case"nfl":return"/static/images/sports/nfl/logos/nfl-logo-generic.png";case"ipl":case"cricket":case"icc":return"/static/images/sports/cricket/logos/cricket-logo-generic.png";default:return""}},vht="#64645F";function bht(e,t,n){const r={teamId:e,logo:xht(n),color:vht};return yht(e,t)??r}var Wm={},gB;function c0(){if(gB)return Wm;gB=1,Wm.__esModule=!0,Wm.default=void 0;var e={top:"top",left:"left",right:"right",bottom:"bottom"};return Wm.default=e,Wm}var _ht=c0();const wht=uo(_ht);function I1(e,t,n,r,s){var o;switch(e){case"center":return s;case"min":return n??0;case"max":return r??0;case"outside":default:return(o=(t??0)=0)&&(y[v]=h[v]);return y}function p(h){var g=h.top,y=g===void 0?0:g,x=h.left,v=x===void 0?0:x,b=h.scale,_=h.width,w=h.stroke,S=w===void 0?"#eaf0f6":w,C=h.strokeWidth,E=C===void 0?1:C,T=h.strokeDasharray,k=h.className,I=h.children,M=h.numTicks,N=M===void 0?10:M,D=h.lineStyle,j=h.offset,F=h.tickValues,R=m(h,c),P=F??(0,a.getTicks)(b,N),L=(j??0)+(0,i.default)(b)/2,U=P.map(function(O,$){var G,H=((G=(0,a.coerceNumber)(b(O)))!=null?G:0)+L;return{index:$,from:new o.Point({x:0,y:H}),to:new o.Point({x:_,y:H})}});return t.default.createElement(s.Group,{className:(0,n.default)("visx-rows",k),top:y,left:v},I?I({lines:U}):U.map(function(O){var $=O.from,G=O.to,H=O.index;return t.default.createElement(r.default,f({key:"row-line-"+H,from:$,to:G,stroke:S,strokeWidth:E,strokeDasharray:T,style:D},R))}))}return p.propTypes={tickValues:e.default.array,width:e.default.number.isRequired},H1}var Bht=Fht();const Uht=uo(Bht);var Vht=["scale","lines","animationTrajectory","animateXOrY","lineKey","lineStyle"];function ax(){return ax=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(t){const o=t.querySelectorAll(".visx-axis-tick"),a=Array.from(o).map(i=>{const{width:c,height:u}=i.getBBox();return[c,u]});if(a.length){const i=Math.max(...a.map(u=>u[0])),c=Math.max(...a.map(u=>u[1]));return[i,c,a.length*i]}}return[0,0,0]},[t]);return d.useMemo(()=>({minRequiredWidth:s,maxLabelWidth:n,maxLabelHeight:r}),[r,n,s])}function s_(){const e=d.useRef(null),{maxLabelWidth:t,minRequiredWidth:n}=TB({ref:e}),r=d.useRef(null),{maxLabelWidth:s}=TB({ref:r});return d.useMemo(()=>({xAxisRef:e,yAxisRef:r,maxXLabelWidth:t,maxYLabelWidth:s,minXRequiredWidth:n}),[t,s,n])}const AB=40,AS=e=>typeof e=="number";function o_({config:e,innerWidth:t,innerHeight:n,maxXLabelWidth:r}){let s=Math.floor(t/(r+AB));AS(e?.x?.numTicks)&&AS(s)&&(s=Math.min(s,e.x.numTicks)),r||(s=void 0);let o=Math.floor(n/AB);return AS(e?.y?.numTicks)&&(o=Math.min(o,e.y.numTicks)),{xTiltTicks:!1,xNumTicks:s,yNumTicks:o}}const jce="fill-quiet font-mono text-xs font-bold truncate max-w-[100px]",NB="fill-quiet text-xs font-semibold font-sans",Ght=(e,t,n)=>n?{transform:"rotate(-10deg)",transformOrigin:`${e}px ${t}px`,textAnchor:"end"}:{textAnchor:"middle"};function $ht(e){const{shouldTilt:t,x:n,y:r,formattedValue:s,style:o,className:a,...i}=e;return l.jsx("text",{...i,x:n,y:r,dy:"2px",className:z(jce,a),style:{...o,...Ght(n,r,t)},children:s})}const u0=A.memo(function(t){const{margin:n,height:r,width:s,xScale:o,yScale:a,xFormat:i,yFormat:c,yNumTicks:u,xNumTicks:f,xTickValues:m,yTickValues:p,xTiltTicks:h,animated:g,tickColor:y,axisColor:x,xAxisRef:v,yAxisRef:b,xAxisLabel:_,yAxisLabel:w,gridDashed:S=!1,gridStrokeWidth:C=.5}=t,E=mi(),T=g?Oht:zl,k=g?Dce:bu,I=d.useCallback(N=>l.jsx($ht,{...N,shouldTilt:h}),[h]),M=d.useMemo(()=>({className:jce,textAnchor:"start",dx:"0.75em",dy:"-0.25em"}),[]);return l.jsxs(l.Fragment,{children:[l.jsx(zl,{orientation:eo.bottom,top:r-n.bottom,scale:o,stroke:x,hideAxisLine:!0,label:_,labelClassName:NB,tickFormat:i,numTicks:f,tickStroke:y,innerRef:v,tickValues:m,tickComponent:I,axisClassName:"select-none"}),l.jsx(T,{orientation:eo.left,left:n.left,hideAxisLine:!0,label:w,labelOffset:7.5,labelClassName:NB,scale:a,tickFormat:c,stroke:x,tickStroke:y,hideTicks:!0,innerRef:b,tickLabelProps:M,numTicks:u,tickValues:p,axisClassName:"select-none"}),E&&l.jsx(k,{left:n.left,scale:a,width:s-n.right-n.left*2,strokeDasharray:S?"8,4":void 0,stroke:x,strokeWidth:C,numTicks:u})]})});u0.displayName="Axes";const Ice=A.memo(({color:e})=>l.jsx("div",{className:"size-[14px] rounded-full",style:{backgroundColor:e}}));Ice.displayName="Tile";const d0=A.memo(({entries:e})=>l.jsx("ol",{className:"my-sm gap-x-md gap-y-xs flex flex-wrap",children:e.map(({key:t,color:n})=>l.jsxs("li",{className:"gap-xs fade-in flex items-center transition-all duration-200",children:[l.jsx(Ice,{color:n}),l.jsx(V,{variant:"tiny",color:"light",children:String(t)})]},String(t)))}));d0.displayName="Legend";const f0=A.memo(({width:e,height:t,children:n,ref:r})=>{const s=d.useMemo(()=>({position:"relative",height:t,overflow:"visible"}),[t]);return l.jsx(K,{style:s,children:l.jsx("svg",{width:e,ref:r,height:t,style:{position:"absolute",left:0,top:0,overflow:"visible"},children:n})})});f0.displayName="Svg";function RB(e){return function(){return e}}function qht(e){return e[0]}function Kht(e){return e[1]}function ix(){this._=null}function a_(e){e.U=e.C=e.L=e.R=e.P=e.N=null}ix.prototype={constructor:ix,insert:function(e,t){var n,r,s;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=DB(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)r=n.U,n===r.L?(s=r.R,s&&s.C?(n.C=s.C=!1,r.C=!0,e=r):(e===n.R&&(Gm(this,n),e=n,n=e.U),n.C=!1,r.C=!0,$m(this,r))):(s=r.L,s&&s.C?(n.C=s.C=!1,r.C=!0,e=r):(e===n.L&&($m(this,n),e=n,n=e.U),n.C=!1,r.C=!0,Gm(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,s=e.R,o,a;if(r?s?o=DB(s):o=r:o=s,t?t.L===e?t.L=o:t.R=o:this._=o,r&&s?(a=o.C,o.C=e.C,o.L=r,r.U=o,o!==s?(t=o.U,o.U=e.U,e=o.R,t.L=e,o.R=s,s.U=o):(o.U=t,t=o,e=o.R)):(a=e.C,e=o),e&&(e.U=t),!a){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(n=t.R,n.C&&(n.C=!1,t.C=!0,Gm(this,t),n=t.R),n.L&&n.L.C||n.R&&n.R.C){(!n.R||!n.R.C)&&(n.L.C=!1,n.C=!0,$m(this,n),n=t.R),n.C=t.C,t.C=n.R.C=!1,Gm(this,t),e=this._;break}}else if(n=t.L,n.C&&(n.C=!1,t.C=!0,$m(this,t),n=t.L),n.L&&n.L.C||n.R&&n.R.C){(!n.L||!n.L.C)&&(n.R.C=!1,n.C=!0,Gm(this,n),n=t.L),n.C=t.C,t.C=n.L.C=!1,$m(this,t),e=this._;break}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}}};function Gm(e,t){var n=t,r=t.R,s=n.U;s?s.L===n?s.L=r:s.R=r:e._=r,r.U=s,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function $m(e,t){var n=t,r=t.L,s=n.U;s?s.L===n?s.L=r:s.R=r:e._=r,r.U=s,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function DB(e){for(;e.L;)e=e.L;return e}function ip(e,t,n,r){var s=[null,null],o=rs.push(s)-1;return s.left=e,s.right=t,n&&lx(s,e,t,n),r&&lx(s,t,e,r),to[e.index].halfedges.push(o),to[t.index].halfedges.push(o),s}function qm(e,t,n){var r=[t,n];return r.left=e,r}function lx(e,t,n,r){!e[0]&&!e[1]?(e[0]=r,e.left=t,e.right=n):e.left===n?e[1]=r:e[0]=r}function Yht(e,t,n,r,s){var o=e[0],a=e[1],i=o[0],c=o[1],u=a[0],f=a[1],m=0,p=1,h=u-i,g=f-c,y;if(y=t-i,!(!h&&y>0)){if(y/=h,h<0){if(y0){if(y>p)return;y>m&&(m=y)}if(y=r-i,!(!h&&y<0)){if(y/=h,h<0){if(y>p)return;y>m&&(m=y)}else if(h>0){if(y0)){if(y/=g,g<0){if(y0){if(y>p)return;y>m&&(m=y)}if(y=s-c,!(!g&&y<0)){if(y/=g,g<0){if(y>p)return;y>m&&(m=y)}else if(g>0){if(y0)&&!(p<1)||(m>0&&(e[0]=[i+m*h,c+m*g]),p<1&&(e[1]=[i+p*h,c+p*g])),!0}}}}}function Qht(e,t,n,r,s){var o=e[1];if(o)return!0;var a=e[0],i=e.left,c=e.right,u=i[0],f=i[1],m=c[0],p=c[1],h=(u+m)/2,g=(f+p)/2,y,x;if(p===f){if(h=r)return;if(u>m){if(!a)a=[h,n];else if(a[1]>=s)return;o=[h,s]}else{if(!a)a=[h,s];else if(a[1]1)if(u>m){if(!a)a=[(n-x)/y,n];else if(a[1]>=s)return;o=[(s-x)/y,s]}else{if(!a)a=[(s-x)/y,s];else if(a[1]=r)return;o=[r,y*r+x]}else{if(!a)a=[r,y*r+x];else if(a[0]_n||Math.abs(o[0][1]-o[1][1])>_n))&&delete rs[s]}function Zht(e){return to[e.index]={site:e,halfedges:[]}}function Jht(e,t){var n=e.site,r=t.left,s=t.right;return n===s&&(s=r,r=n),s?Math.atan2(s[1]-r[1],s[0]-r[0]):(n===r?(r=t[1],s=t[0]):(r=t[0],s=t[1]),Math.atan2(r[0]-s[0],s[1]-r[1]))}function Pce(e,t){return t[+(t.left!==e.site)]}function egt(e,t){return t[+(t.left===e.site)]}function tgt(){for(var e=0,t=to.length,n,r,s,o;e_n||Math.abs(x-h)>_n)&&(u.splice(c,0,rs.push(qm(i,g,Math.abs(y-e)<_n&&r-x>_n?[e,Math.abs(p-e)<_n?h:r]:Math.abs(x-r)<_n&&n-y>_n?[Math.abs(h-r)<_n?p:n,r]:Math.abs(y-n)<_n&&x-t>_n?[n,Math.abs(p-n)<_n?h:t]:Math.abs(x-t)<_n&&y-e>_n?[Math.abs(h-t)<_n?p:e,t]:null))-1),++f);f&&(v=!1)}if(v){var b,_,w,S=1/0;for(o=0,v=null;o=-1e-12)){var h=c*c+u*u,g=f*f+m*m,y=(m*h-u*g)/p,x=(c*g-f*h)/p,v=Oce.pop()||new rgt;v.arc=e,v.site=s,v.x=y+a,v.y=(v.cy=x+i)+Math.sqrt(y*y+x*x),e.circle=v;for(var b=null,_=Uh._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x)if(_.L)_=_.L;else{b=_.P;break}else if(_.R)_=_.R;else{b=_;break}Uh.insert(b,v),b||(U8=v)}}}}function Pd(e){var t=e.circle;t&&(t.P||(U8=t.N),Uh.remove(t),Oce.push(t),a_(t),e.circle=null)}var Lce=[];function sgt(){a_(this),this.edge=this.site=this.circle=null}function jB(e){var t=Lce.pop()||new sgt;return t.site=e,t}function NS(e){Pd(e),Od.remove(e),Lce.push(e),a_(e)}function ogt(e){var t=e.circle,n=t.x,r=t.cy,s=[n,r],o=e.P,a=e.N,i=[e];NS(e);for(var c=o;c.circle&&Math.abs(n-c.circle.x)<_n&&Math.abs(r-c.circle.cy)<_n;)o=c.P,i.unshift(c),NS(c),c=o;i.unshift(c),Pd(c);for(var u=a;u.circle&&Math.abs(n-u.circle.x)<_n&&Math.abs(r-u.circle.cy)<_n;)a=u.N,i.push(u),NS(u),u=a;i.push(u),Pd(u);var f=i.length,m;for(m=1;m_n)i=i.L;else if(a=t-igt(i,n),a>_n){if(!i.R){r=i;break}i=i.R}else{o>-_n?(r=i.P,s=i):a>-_n?(r=i,s=i.N):r=s=i;break}Zht(e);var c=jB(e);if(Od.insert(r,c),!(!r&&!s)){if(r===s){Pd(r),s=jB(r.site),Od.insert(c,s),c.edge=s.edge=ip(r.site,c.site),gd(r),gd(s);return}if(!s){c.edge=ip(r.site,c.site);return}Pd(r),Pd(s);var u=r.site,f=u[0],m=u[1],p=e[0]-f,h=e[1]-m,g=s.site,y=g[0]-f,x=g[1]-m,v=2*(p*x-h*y),b=p*p+h*h,_=y*y+x*x,w=[(x*b-h*_)/v+f,(p*_-y*b)/v+m];lx(s.edge,u,g,w),c.edge=ip(u,e,null,w),s.edge=ip(e,g,null,w),gd(r),gd(s)}}function Fce(e,t){var n=e.site,r=n[0],s=n[1],o=s-t;if(!o)return r;var a=e.P;if(!a)return-1/0;n=a.site;var i=n[0],c=n[1],u=c-t;if(!u)return i;var f=i-r,m=1/o-1/u,p=f/u;return m?(-p+Math.sqrt(p*p-2*m*(f*f/(-2*u)-c+u/2+s-o/2)))/m+r:(r+i)/2}function igt(e,t){var n=e.N;if(n)return Fce(n,t);var r=e.site;return r[1]===t?r[0]:1/0}var _n=1e-6,Od,to,Uh,rs;function lgt(e,t,n){return(e[0]-n[0])*(t[1]-e[1])-(e[0]-t[0])*(n[1]-e[1])}function cgt(e,t){return t[1]-e[1]||t[0]-e[0]}function Q5(e,t){var n=e.sort(cgt).pop(),r,s,o;for(rs=[],to=new Array(e.length),Od=new ix,Uh=new ix;;)if(o=U8,n&&(!o||n[1]=a)return null;var c=e-i.site[0],u=t-i.site[1],f=c*c+u*u;do i=r.cells[s=o],o=null,i.halfedges.forEach(function(m){var p=r.edges[m],h=p.left;if(!((h===i.site||!h)&&!(h=p.right))){var g=e-h[0],y=t-h[1],x=g*g+y*y;xdgt({width:n,height:t,x:g=>r(o(g)),y:g=>s(a(g))})(e),[e,n,t,r,s,o,a]),p=d.useCallback(h=>{const{x:g,y}=i0(h)??{x:0,y:0},x=m.find(g,y,i);if(!x)return u();c({tooltipData:{localPoint:{x:g,y},voronoiSite:x}})},[c,u,m,i]);return d.useMemo(()=>({showTooltip:c,hideTooltip:u,handleTooltip:p,tooltipData:f}),[p,u,c,f])}const m0=A.memo(function({margin:t,height:n,width:r,tooltipHandle:s,tooltipHide:o,maxYLabelWidth:a}){const c=d.useCallback(()=>o(),[o]);return l.jsx(cm,{x:t.left+a-2.5,y:t.top,width:r-t.right-t.left*2-a+2.5*2,height:n-t.bottom-t.top,fill:"transparent",onTouchStart:s,onTouchMove:s,onMouseMove:s,onMouseLeave:c})});m0.displayName="TooltipListener";const Vh=A.memo(({cx:e,cy:t,color:n,r=3})=>l.jsx("circle",{cx:e,cy:t,r,fill:n,stroke:n,strokeWidth:1}));Vh.displayName="YDot";const bf=A.memo(({marginTop:e,tooltipLeft:t=0,innerHeight:n,color:r,strokeWidth:s=1,dotted:o=!1})=>{const a=d.useMemo(()=>({x:t,y:e}),[e,t]),i=d.useMemo(()=>({x:t,y:n+e}),[n,e,t]);return l.jsx("g",{children:l.jsx(Ub,{from:a,to:i,stroke:r,strokeWidth:s,strokeDasharray:o?"4 4":void 0,pointerEvents:"none",className:"animate-in fade-in duration-300"})})});bf.displayName="YCrosshair";const RS=e=>e,Bce=A.memo(({entry:e,xFormat:t=RS,yFormat:n=RS,zFormat:r=RS,xGet:s,yGet:o,zGet:a})=>{const i=[{value:t(s(e))},{value:n(o(e))}];a&&i.unshift({value:r(a(e))});const c=i.filter(u=>u.value);return l.jsx(K,{children:c.map(({value:u},f)=>l.jsx(V,{variant:"tiny",className:"py-two",children:String(u)},f))})});Bce.displayName="InnerToolTip";const Uce=A.memo(({tooltipTop:e=0,tooltipLeft:t=0,children:n})=>{const r=d.useMemo(()=>({position:"absolute",pointerEvents:"none"}),[]);return l.jsx(hle,{top:e,left:t,style:r,children:l.jsx(K,{variant:"background",className:"p-sm dark:border-inverse rounded-md border shadow-sm",children:n})})});Uce.displayName="Tooltip";const p0=A.memo(({tooltipTop:e,tooltipLeft:t,entry:n,data:r,config:s,UserToolTip:o,xFormat:a,yFormat:i,zFormat:c,zGet:u,xGet:f,yGet:m})=>l.jsx(Uce,{tooltipTop:e,tooltipLeft:t,children:o?l.jsx(o,{entry:n,config:s,data:r}):l.jsx(Bce,{entry:n,config:s,xFormat:a,yFormat:i,zFormat:c,zGet:u,xGet:f,yGet:m})}));p0.displayName="ComposedTooltip";const $u=0,Vce=A.memo(function(t){const{width:n,height:r,margin:s,config:o,tooltip:a,colors:i,axes:c=!0}=t,{colorSchema:u,axisColor:f,tickColor:m}=qb(i),p=mi(),h=Kb({data:t.data}),{xAxisRef:g,yAxisRef:y,maxYLabelWidth:x,maxXLabelWidth:v,minXRequiredWidth:b}=s_(),{innerHeight:_,innerWidth:w,xRange:S,yRange:C}=Xb({width:n,height:r,margin:s,maxYLabelWidth:x,hasAxis:c}),{xNumTicks:E,yNumTicks:T,xTiltTicks:k}=o_({config:o,innerWidth:w,innerHeight:_,maxXLabelWidth:v}),{xGet:I,yGet:M,zGet:N}=Yb({config:o}),{xFormat:D,yFormat:j,xTooltipFormat:F,yTooltipFormat:R,zTooltipFormat:P}=Qb({config:o}),L=d.useMemo(()=>{if(!o?.z?.accessor)return[{key:"default",data:h}];const ue=o.z.accessor,me=th(h,we=>String(we[ue]));return Object.entries(me).map(([we,ye])=>({key:we,data:ye}))},[h,o.z]),U=L.length>1,O=U?L.map(({key:ue})=>ue):h.map(I),$=ao.band({range:S,domain:O,padding:.4}),G=[...new Set(h.map(I))],H=ao.band({range:[0,$.bandwidth()],domain:G,padding:.1}),Q=d.useMemo(()=>{const[ue,me]=ko(h,M),we=Math.min($u,ue),ye=Math.max($u,me);return[we,ye]},[h,M]),Y=d.useMemo(()=>ao.linear({range:C,domain:Q}),[C,Q]),te=ao.ordinal({range:u.slice(0,G.length),domain:U?G:O}),{tooltipData:se,hideTooltip:ae,handleTooltip:X}=i_({data:h,innerHeight:_,innerWidth:w,xScale:U?H:$,yScale:Y,xGet:I,yGet:M}),le=d.useCallback(({localPoint:ue})=>{const me=U?H:$,we=me.bandwidth(),ye=(me.step()-we)/4;if(isNaN(ue?.x??NaN)||isNaN(ue?.y??NaN))return null;const _e=ue?.x,ke=ue?.y;return h.reduce((De,xe)=>{let Ue=me(I(xe))||0;const Ee=Y(M(xe)),Ke=Math.abs(Ee-Y(0));return U&&(Ue+=$(xe.z)||0),Ue!==void 0&&Ee!==void 0&&_e>=Ue-ye&&_e<=Ue+we+ye&&ke>=Ee-Ke&&ke<=Ee+Ke?{x:Ue,y:Ee,data:xe}:De},null)},[h,$,I,Y,M,U,H])({localPoint:se?.localPoint}),re=d.useMemo(()=>({marginLeft:s.left,marginRight:s.right}),[s.left,s.right]),ce=d.useMemo(()=>[$u],[]);return l.jsxs(K,{className:"relative",children:[U&&G.length>1&&l.jsx(K,{style:re,children:l.jsx(d0,{entries:G.map(ue=>({key:ue,color:te(ue)}))})}),l.jsxs(f0,{width:n,height:r,children:[l.jsx(u0,{xScale:$,yScale:Y,xFormat:D,yFormat:j,width:n,height:r,margin:s,yNumTicks:T,xNumTicks:E,yTickValues:o.y.tickValues,xTickValues:o.x.tickValues,xAxisLabel:o.x.label,yAxisLabel:o.y.label,animated:!0,tickColor:m,axisColor:f,xAxisRef:g,yAxisRef:y,xTiltTicks:k}),p&&l.jsx(Dce,{left:s.left,scale:Y,width:n-s.right-s.left*2,stroke:f,tickValues:ce,strokeWidth:2}),L.map(({key:ue,data:me})=>l.jsx(Cs,{left:$(ue),children:me.map((we,ye)=>{const _e=U?H:$;return l.jsx(Te.rect,{rx:2,ry:2,x:_e(I(we)),width:_e.bandwidth(),fill:te(U?ye:ue),initial:{y:Y($u),height:0,opacity:0},animate:{y:Y(Math.max($u,M(we))),height:Math.abs(Y(M(we))-Y($u)),opacity:1},transition:{duration:.5,ease:"easeInOut"}},ye)})},ue)),l.jsx(m0,{margin:s,tooltipHandle:X,tooltipHide:ae,height:r,width:n,maxYLabelWidth:x})]}),le&&se&&l.jsx(p0,{UserToolTip:a,tooltipTop:se?.localPoint?.y,tooltipLeft:se?.localPoint?.x,entry:le.data,data:h,config:o,xFormat:F,yFormat:R,zFormat:P,zGet:N,xGet:I,yGet:M})]})});Vce.displayName="BarChart";var fgt=["children","id","from","to","x1","y1","x2","y2","fromOffset","fromOpacity","toOffset","toOpacity","rotate","transform","vertical"];function X5(){return X5=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function V8(e){var t=e.children,n=e.id,r=e.from,s=e.to,o=e.x1,a=e.y1,i=e.x2,c=e.y2,u=e.fromOffset,f=u===void 0?"0%":u,m=e.fromOpacity,p=m===void 0?1:m,h=e.toOffset,g=h===void 0?"100%":h,y=e.toOpacity,x=y===void 0?1:y,v=e.rotate,b=e.transform,_=e.vertical,w=_===void 0?!0:_,S=mgt(e,fgt),C=o,E=i,T=a,k=c;return w&&!C&&!E&&!T&&!k&&(C="0",E="0",T="0",k="1"),A.createElement("defs",null,A.createElement("linearGradient",X5({id:n,x1:C,y1:T,x2:E,y2:k,gradientTransform:v?"rotate("+v+")":b},S),!!t&&t,!t&&A.createElement("stop",{offset:f,stopColor:r,stopOpacity:p}),!t&&A.createElement("stop",{offset:g,stopColor:s,stopOpacity:x})))}V8.propTypes={id:ze.string.isRequired,from:ze.string,to:ze.string,x1:ze.oneOfType([ze.string,ze.number]),x2:ze.oneOfType([ze.string,ze.number]),y1:ze.oneOfType([ze.string,ze.number]),y2:ze.oneOfType([ze.string,ze.number]),fromOffset:ze.oneOfType([ze.string,ze.number]),fromOpacity:ze.oneOfType([ze.string,ze.number]),toOffset:ze.oneOfType([ze.string,ze.number]),toOpacity:ze.oneOfType([ze.string,ze.number]),rotate:ze.oneOfType([ze.string,ze.number]),transform:ze.string,children:ze.node,vertical:ze.bool};function pgt({xScale:e,xPosition:t}){const n=e.domain(),[r,s]=e.range(),o=(s-r)/(n.length-1),a=Math.min(Math.max(Math.round((t-r)/o),0),n.length-1);return n[a]}function hgt({tooltipData:e,config:t,groups:n,xScale:r,xGet:s}){const o=t.z?.accessor?e?.voronoiSite?.data?.[t.z?.accessor]:"",a=d.useMemo(()=>[...(n.find(({key:m})=>m===o)||n[0])?.d||[]].sort((m,p)=>s(m)-s(p)),[o,n,s]),i=e?.localPoint.x,c=d.useMemo(()=>a.map(s),[a,s]);return d.useMemo(()=>{if(i==null)return;if("invert"in r){const p=r.invert(i),h=tm(c,p);if(h<=0)return a[0];if(h>=c.length)return a[c.length-1];const g=a[h-1],y=a[h];return Math.abs(s(g)-p)String(s(p))===String(f));return m||a.reduce((p,h)=>Math.abs(s(h)-f)ao[ce]({range:[ae[0],j?ae[1]-j/2:ae[1]],domain:Q}),[ce,ae,Q,j]),we=d.useMemo(()=>{const Je=ue==="log";return ao[ue]({range:X,domain:Y,base:Je?2:void 0,nice:!Je,round:!0})},[ue,X,Y]),ye=d.useMemo(()=>{if(!a.z?.accessor)return[{key:"",d:_}];const Je=a.z.accessor,Me=th(_,Ve=>String(Ve[Je]));return Object.entries(Me).map(([Ve,lt])=>({key:Ve,d:lt}))},[_,a?.z?.accessor]),_e=d.useMemo(()=>{if(ye.length<=1)return null;const Je=new Map;return ye.forEach(Ve=>{Ve.d.forEach(lt=>{const xt=R(lt);Je.set(xt,lt)})}),Array.from(Je.values()).sort((Ve,lt)=>R(Ve)-R(lt))},[ye,R]),{tooltipData:ke,hideTooltip:De,handleTooltip:xe}=i_({data:_,innerHeight:te,innerWidth:se,xScale:me,yScale:we,xGet:R,yGet:P}),Ue=hgt({tooltipData:ke,config:a,groups:ye,xScale:me,xGet:R}),Ee=d.useMemo(()=>!y||!ye.length||!ye[0].d.length?null:ye[0].d.at(-1),[ye,y]),Ke=d.useMemo(()=>sl().x(Je=>me(R(Je))).y(Je=>we(P(Je))).curve(nu),[me,we,R,P]),Nt=d.useMemo(()=>ao.ordinal({domain:ye.map(({key:Je})=>Je),range:S}),[S,ye]),pe=d.useCallback(()=>{ke&&b(Ue||null)},[ke,Ue]),ve=d.useCallback(()=>{b(null)},[]),Ae=d.useMemo(()=>{const Je={};if(!v||!Ue||!ye.length)return Je;const Me=R(v),Ve=R(Ue),[lt,xt]=Me{const dt=a.z?.accessor?Zt[a.z.accessor]:ye[0].key,Ct=ye.find(({key:Ot})=>Ot===dt);return Ct?Ct.d.filter(Ot=>{const Qt=R(Ot);return Qt>=lt&&Qt<=xt}):[]},$e=a.z?.accessor?v[a.z.accessor]:ye[0].key;Je[$e]=Pt(v);const ht=a.z?.accessor?Ue[a.z.accessor]:ye[0].key;return $e!==ht&&(Je[ht]=Pt(Ue)),Je},[v,Ue,ye,R,a.z?.accessor]),We=d.useMemo(()=>{const Je=Ae[a.z?.accessor?v?.[a.z.accessor]:ye[0]?.key]||[],Me=Ae[a.z?.accessor?Ue?.[a.z.accessor]:ye[0]?.key]||[],Ve=[...Je,...Me],lt=new Map;return Ve.forEach(Pt=>{lt.set(R(Pt),Pt)}),Array.from(lt.values()).sort((Pt,$e)=>R(Pt)-R($e))},[Ae,a.z?.accessor,v,Ue,ye,R]),pt=d.useMemo(()=>({marginLeft:o.left,marginRight:o.right}),[o.left,o.right]),Gt=d.useMemo(()=>[h],[h]),Le=d.useCallback(Je=>me(R(Je))??0,[me,R]),gt=d.useCallback(Je=>we(P(Je))??0,[we,P]);return l.jsxs(K,{children:[a.z&&ye?.length>1&&m&&l.jsx(K,{style:pt,children:l.jsx(d0,{entries:ye.map(({key:Je})=>({key:Je,color:Nt(Je)}))})}),l.jsxs(K,{className:"relative",onMouseDown:pe,onMouseUp:ve,onMouseLeave:ve,children:[l.jsxs(f0,{width:r,height:s,children:[c&&l.jsx(u0,{width:r,height:s,margin:o,xScale:me,yScale:we,xFormat:U,yFormat:O,yNumTicks:le,xNumTicks:ee,yTickValues:a.y.tickValues,xTickValues:a.x.tickValues,tickColor:C,axisColor:E,xAxisRef:M,yAxisRef:N,xTiltTicks:re,xAxisLabel:a.x.label,yAxisLabel:a.y.label}),x&&x({xScale:me,yScale:we,xGet:R,yGet:P}),h&&l.jsx("text",{x:r-o.right-10,y:we(h)-5,fill:T,fontSize:12,className:"font-mono",textAnchor:"end",children:g==="CRYPTO"?n({defaultMessage:"Prev day: {value}",id:"7i8MvDtMyq"},{value:typeof a.y.format=="function"?a.y.format(h):h}):n({defaultMessage:"Prev close: {value}",id:"uRPxTu0cgj"},{value:typeof a.y.format=="function"?a.y.format(h):h})}),h&&l.jsx(bu,{left:o.left,scale:we,width:r-o.right-o.left*2,stroke:T,tickValues:Gt,strokeWidth:2,strokeDasharray:"2,6",opacity:I?.6:1}),Ue&&l.jsx(bf,{marginTop:o.top,tooltipLeft:me(R(Ue)),innerHeight:te,color:E,strokeWidth:1}),v&&l.jsx(bf,{marginTop:o.top,tooltipLeft:me(R(v)),innerHeight:te,color:E,strokeWidth:1}),_e&&ye.length>1&&ye[1]?.key&&l.jsx(Te.path,{d:Ke(_e),stroke:Nt(ye[1].key),strokeWidth:1.5,fill:"none",shapeRendering:"geometricPrecision",initial:f?{pathLength:f?0:1,opacity:f?0:1}:void 0,animate:f?{pathLength:1,opacity:1}:void 0,transition:f?{duration:.8,ease:qa}:void 0}),ye.map(({d:Je,key:Me},Ve)=>{const lt=w.current.has(Me),xt=lt||!f?{initial:void 0,animate:{pathLength:1,opacity:1}}:{initial:{pathLength:f?0:1,opacity:f?0:1},animate:{pathLength:1,opacity:1},transition:{duration:.8,ease:qa,delay:Ve/ye.length}};return lt||w.current.add(Me),l.jsx(Te.path,{d:Ke(Je),stroke:Nt(Me),strokeWidth:2,fill:"none",shapeRendering:"geometricPrecision",...xt},Me)}),(Ue||Ee)&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:{duration:0,delay:.8},children:[l.jsx(Vh,{cx:me(R(Ue||Ee)),cy:we(P(Ue||Ee)),color:Nt(a.z?.accessor?(Ue||Ee)?.[a.z.accessor]:""),r:5}),v&&Ue&&l.jsxs(l.Fragment,{children:[l.jsx(Vh,{cx:me(R(v)),cy:we(P(v)),color:Nt(a.z?.accessor?v[a.z.accessor]:""),r:5}),We.length>1&&l.jsx(Fh,{data:We,x:Le,y:gt,fill:Nt(ye[0].key),fillOpacity:.2,stroke:"none",yScale:we,curve:nu})]})]}),(ye.length===1||ye.length===2)&&ye.map(({d:Je,key:Me},Ve)=>{const lt=Nt(Me);return l.jsx(Te.g,{initial:f?{opacity:0,clipPath:"inset(0% 100% 0% 0%)"}:void 0,animate:f?{opacity:1,clipPath:"inset(0% 0% 0% 0%)"}:void 0,transition:f?{duration:.8,ease:qa,delay:Ve/ye.length}:void 0,children:!v&&(ye.length===1||Ve===0)&&l.jsxs(l.Fragment,{children:[l.jsx(V8,{from:`${lt}22`,to:`${lt}00`,id:Me}),l.jsx(Fh,{data:Je,x:Le,y:gt,strokeWidth:0,yScale:we,fill:`url('#${Me}')`},Me)]})},Me)}),l.jsx(m0,{margin:o,tooltipHandle:xe,tooltipHide:De,height:s,width:r,maxYLabelWidth:D})]}),Ue&&ke&&l.jsx(p0,{tooltipTop:ke.localPoint.y,tooltipLeft:ke.localPoint.x,entry:Ue,UserToolTip:i?Je=>l.jsx(i,{...Je,comparisonEntry:v||void 0}):void 0,data:_,config:a,xFormat:$,yFormat:G,zFormat:H,zGet:L,xGet:R,yGet:P})]})]})});Hce.displayName="CompositeLineChart";function ggt({xScale:e,xPosition:t}){const n=e.domain(),[r,s]=e.range(),o=(s-r)/(n.length-1),a=Math.min(Math.max(Math.round((t-r)/o),0),n.length-1);return n[a]}function ygt({tooltipData:e,config:t,groups:n,xScale:r,xGet:s}){const o=t.z?.accessor?e?.voronoiSite?.data?.[t.z?.accessor]:"",a=d.useMemo(()=>[...(n.find(({key:f})=>f===o)||n[0])?.d||[]].sort((f,m)=>s(f)-s(m)),[o,n,s]),i=e?.localPoint.x;return d.useMemo(()=>{if(!i)return;if("invert"in r){const m=r.invert(i),p=tm(a.map(s),m);return a?.[p-1]}const u=ggt({xScale:r,xPosition:i});return a.find(m=>String(s(m))===String(u))},[i,r,a,s])}const zce=A.memo(e=>{const{$t:t}=J(),{enableComparison:n=!0,width:r,height:s,margin:o={top:0,right:0,bottom:0,left:0},config:a,tooltip:i,axes:c=!0,colors:u,animate:f=!0,includeLegend:m=!0,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y=!1,children:x}=e,[v,b]=d.useState(null),_=Kb({data:e.data}),w=mi(),{colorSchema:S,tickColor:C,axisColor:E,textColor:T}=qb(u),{colorScheme:k}=Ss(),I=d.useMemo(()=>w?k==="dark":!1,[k,w]),{xAxisRef:M,yAxisRef:N,maxYLabelWidth:D,maxXLabelWidth:j,minXRequiredWidth:F}=s_(),{xGet:R,yGet:P,zGet:L}=Yb({config:a}),{xFormat:U,yFormat:O,xTooltipFormat:$,yTooltipFormat:G,zTooltipFormat:H}=Qb({config:a}),{xDomain:Q,yDomain:Y}=E8({config:a,data:_,xGet:R,yGet:P,endTime:p,previousClose:h}),{innerHeight:te,innerWidth:se,xRange:ae,yRange:X}=Xb({width:r,height:s,margin:o,maxYLabelWidth:D,hasAxis:c}),{xNumTicks:ee,yNumTicks:le,xTiltTicks:re}=o_({config:a,innerWidth:se,innerHeight:te,maxXLabelWidth:j}),ce=a.x.scale,ue=d.useMemo(()=>ao[ce]({range:[ae[0],j?ae[1]-j/2:ae[1]],domain:Q}),[ce,ae,Q,j]),me=a.y.scale,we=d.useMemo(()=>{const Le=me==="log";return ao[me]({range:X,domain:Y,base:Le?2:void 0,nice:!Le,round:!0})},[me,X,Y]),ye=d.useMemo(()=>{if(!a.z?.accessor)return[{key:"",d:_}];const Le=a.z.accessor,gt=th(_,Je=>String(Je[Le]));return Object.entries(gt).map(([Je,Me])=>({key:Je,d:Me}))},[_,a?.z?.accessor]),{tooltipData:_e,hideTooltip:ke,handleTooltip:De}=i_({data:_,innerHeight:te,innerWidth:se,xScale:ue,yScale:we,xGet:R,yGet:P}),xe=ygt({tooltipData:_e,config:a,groups:ye,xScale:ue,xGet:R}),Ue=d.useMemo(()=>!y||!ye.length||!ye[0].d.length?null:ye[0].d.at(-1),[ye,y]),Ee=d.useMemo(()=>sl().x(Le=>ue(R(Le))).y(Le=>we(P(Le))).curve(nu),[ue,we,R,P]),Ke=d.useMemo(()=>ao.ordinal({range:S}),[S]),Nt=d.useCallback(()=>{!_e||!n||b(xe||null)},[n,_e,xe]),pe=d.useCallback(()=>{n&&b(null)},[n]),ve=d.useMemo(()=>{if(!v||!xe||!ye.length)return[];const Le=ye[0],gt=R(v),Je=R(xe),[Me,Ve]=gt{const xt=R(lt);return xt>=Me&&xt<=Ve})},[v,xe,ye,R]),Ae=d.useMemo(()=>({marginLeft:o.left,marginRight:o.right}),[o.left,o.right]),We=d.useCallback(Le=>ue(R(Le))??0,[ue,R]),pt=d.useCallback(Le=>we(P(Le))??0,[we,P]),Gt=d.useMemo(()=>[h],[h]);return l.jsxs(K,{children:[a.z&&ye?.length>1&&m&&l.jsx(K,{style:Ae,children:l.jsx(d0,{entries:ye.map(({key:Le})=>({key:Le,color:Ke(Le)}))})}),l.jsxs(K,{className:"relative",onMouseDown:Nt,onMouseUp:pe,onMouseLeave:pe,children:[l.jsxs(f0,{width:r,height:s,children:[c&&l.jsx(u0,{width:r,height:s,margin:o,xScale:ue,yScale:we,xFormat:U,yFormat:O,yNumTicks:le,xNumTicks:ee,yTickValues:a.y.tickValues,xTickValues:a.x.tickValues,tickColor:C,axisColor:E,xAxisRef:M,yAxisRef:N,xTiltTicks:re,xAxisLabel:a.x.label,yAxisLabel:a.y.label}),x&&x({xScale:ue,yScale:we,xGet:R,yGet:P}),h&&l.jsx("text",{x:r-o.right-10,y:we(h)-5,fill:T,fontSize:12,className:"font-mono",textAnchor:"end",children:g==="CRYPTO"?t({defaultMessage:"Prev day: {value}",id:"7i8MvDtMyq"},{value:typeof a.y.format=="function"?a.y.format(h):h}):t({defaultMessage:"Prev close: {value}",id:"uRPxTu0cgj"},{value:typeof a.y.format=="function"?a.y.format(h):h})}),h&&l.jsx(bu,{left:o.left,scale:we,width:r-o.right-o.left*2,stroke:T,tickValues:Gt,strokeWidth:2,strokeDasharray:"2,6",opacity:I?.6:1}),xe&&l.jsx(bf,{marginTop:o.top,tooltipLeft:ue(R(xe)),innerHeight:te,color:E,strokeWidth:1}),v&&l.jsx(bf,{marginTop:o.top,tooltipLeft:ue(R(v)),innerHeight:te,color:E,strokeWidth:1}),(xe||Ue)&&l.jsxs(Te.g,{initial:{opacity:0},animate:{opacity:1},transition:{duration:0,delay:.8},children:[l.jsx(Vh,{cx:ue(R(xe||Ue)),cy:we(P(xe||Ue)),color:Ke(a.z?.accessor?(xe||Ue)?.[a.z.accessor]:""),r:5}),v&&xe&&ve.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Vh,{cx:ue(R(v)),cy:we(P(v)),color:Ke(a.z?.accessor?v[a.z.accessor]:""),r:5}),l.jsx(Fh,{data:ve,x:We,y:pt,fill:Ke(a.z?.accessor?v[a.z.accessor]:""),fillOpacity:.2,stroke:"none",yScale:we,curve:nu})]})]}),ye.length===1&&ye.map(({d:Le,key:gt},Je)=>{const Me=Ke(gt);return l.jsx(Te.g,{initial:f?{opacity:0,clipPath:"inset(0% 100% 0% 0%)"}:void 0,animate:f?{opacity:1,clipPath:"inset(0% 0% 0% 0%)"}:void 0,transition:f?{duration:.8,ease:"easeInOut",delay:Je/ye.length}:void 0,children:!v&&l.jsxs(l.Fragment,{children:[l.jsx(V8,{from:`${Me}22`,to:`${Me}00`,id:gt}),l.jsx(Fh,{data:Le,x:We,y:pt,strokeWidth:0,yScale:we,fill:`url('#${gt}')`},gt)]})},gt)}),ye.map(({d:Le,key:gt},Je)=>l.jsx(Te.path,{d:Ee(Le),stroke:Ke(gt),strokeWidth:2,fill:"none",shapeRendering:"geometricPrecision",initial:f?{pathLength:0,opacity:0}:void 0,animate:f?{pathLength:1,opacity:1}:void 0,transition:f?{duration:.8,ease:"easeInOut",delay:Je/ye.length}:void 0},gt)),l.jsx(m0,{margin:o,tooltipHandle:De,tooltipHide:ke,height:s,width:r,maxYLabelWidth:D})]}),xe&&_e&&l.jsx(p0,{tooltipTop:_e.localPoint.y,tooltipLeft:_e.localPoint.x,entry:xe,UserToolTip:i?Le=>l.jsx(i,{...Le,comparisonEntry:v||void 0}):void 0,data:_,config:a,xFormat:$,yFormat:G,zFormat:H,zGet:L,xGet:R,yGet:P})]})]})});zce.displayName="LineChart";const Wce=A.memo(e=>{const{width:t,height:n,margin:r,config:s,tooltip:o,colors:a,axes:i=!0}=e,c=3,u=Kb({data:e.data}),{colorSchema:f,tickColor:m,axisColor:p}=qb(a),{xAxisRef:h,yAxisRef:g,maxYLabelWidth:y,maxXLabelWidth:x,minXRequiredWidth:v}=s_(),{innerHeight:b,innerWidth:_,xRange:w,yRange:S}=Xb({width:t,height:n,margin:r,maxYLabelWidth:y,hasAxis:i}),{xNumTicks:C,yNumTicks:E,xTiltTicks:T}=o_({config:s,innerWidth:_,innerHeight:b,maxXLabelWidth:x}),{xGet:k,yGet:I,zGet:M}=Yb({config:s}),{xFormat:N,yFormat:D,xTooltipFormat:j,yTooltipFormat:F,zTooltipFormat:R}=Qb({config:s}),{xDomain:P,yDomain:L}=E8({data:u,config:s,xGet:k,yGet:I}),{scale:U}=s.x,O=d.useMemo(()=>ao[U]({range:w,domain:P}),[U,w,P]),{scale:$}=s.y,G=d.useMemo(()=>ao[$]({range:S,domain:L,nice:!0,round:!0}),[$,S,L]),{tooltipData:H,handleTooltip:Q,hideTooltip:Y}=i_({data:u,innerHeight:b,innerWidth:_,xScale:O,yScale:G,xGet:k,yGet:I,voronoiRadius:c*2}),te=d.useMemo(()=>ao.ordinal({range:f}),[f]),se=d.useMemo(()=>{if(!s.z?.accessor)return[];const ee=new Set([]);return u.forEach(le=>ee.add(le[s?.z?.accessor])),Array.from(ee)},[u,s.z]),ae=H?.voronoiSite,X=d.useMemo(()=>({marginLeft:r.left,marginRight:r.right}),[r.left,r.right]);return l.jsxs(K,{children:[se.length>1&&l.jsx(K,{style:X,children:l.jsx(d0,{entries:se.map(ee=>({key:ee,color:te(ee)}))})}),l.jsxs(K,{className:"relative",children:[l.jsxs(f0,{width:t,height:n,children:[l.jsx(u0,{xScale:O,yScale:G,xFormat:N,yFormat:D,width:t,height:n,margin:r,yTickValues:s.y.tickValues,xTickValues:s.x.tickValues,tickColor:m,axisColor:p,xAxisRef:h,yAxisRef:g,yNumTicks:E,xNumTicks:C,xTiltTicks:T}),ae&&l.jsx(bf,{marginTop:r.top,tooltipLeft:ae[0],innerHeight:b,color:p}),l.jsx("g",{children:u.map((ee,le)=>{const re=ae?.data?.__key==ee.__key,ce=s.z?.accessor?te(ee[s.z.accessor]):te("");return l.jsx(Te.circle,{"data-hint":`${k(ee)}: ${I(ee)}`,cx:O(k(ee)),cy:G(I(ee)),r:c,strokeWidth:c/2,stroke:ce,fill:re?"transparent":ce,initial:{opacity:0},animate:{opacity:1},transition:{duration:.8,ease:"easeInOut",delay:le/u.length}},ee.__key)})}),l.jsx(m0,{margin:r,tooltipHandle:Q,tooltipHide:Y,height:n,width:t,maxYLabelWidth:y})]}),ae&&l.jsx(p0,{tooltipTop:ae?.[1],tooltipLeft:ae?.[0],UserToolTip:o,entry:ae.data,data:u,config:s,xFormat:j,yFormat:F,zFormat:R,zGet:M,xGet:k,yGet:I})]})]})});Wce.displayName="ScatterChart";function xgt(e){const{type:t,config:n,width:r,data:s,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,children:x,enableComparison:v}=e;return t==="line"?l.jsx(zce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,enableComparison:v,children:x}):t==="bar"?l.jsx(Vce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,colors:u,includeLegend:m}):t==="scatter"?l.jsx(Wce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,colors:u,includeLegend:m}):t==="compositeLine"?l.jsx(Hce,{data:s,config:n,width:r,height:o,margin:a,tooltip:i,axes:c,colors:u,animate:f,includeLegend:m,endTime:p,previousClose:h,exchangeName:g,showLastPoint:y,children:x}):null}const vgt=A.memo(function({type:t,config:n,data:r,tooltip:s,height:o=a0,margin:a=Wdt,axes:i,className:c,colors:u,includeLegend:f,endTime:m,previousClose:p,exchangeName:h,showLastPoint:g,animate:y,children:x,enableComparison:v}){const b=d.useRef(null),{width:_}=ule(b);return l.jsx("div",{ref:b,className:c,children:l.jsx(xgt,{type:t,data:r,config:n,width:_,height:o,margin:a,tooltip:s,axes:i,colors:u,includeLegend:f,endTime:m,previousClose:p,exchangeName:h,showLastPoint:g,animate:y,enableComparison:v,children:x})})});vgt.displayName="Chart";const Gce=(e,t)=>{const n="#f7f1f2",r="#1f2121";return e?bgt(e,Kn(t?r:n),t):Kn(n)},bgt=(e,t,n,r=3)=>{if(!e)return Kn(t);let s=Kn(e),o=0,a=0;for(;s.contrast(Kn(t))20)););return s};function _gt(e,t){const n=e.lightness();return e.lightness(n+(100-n)*t)}function wgt(e,t){const n=e.lightness();return e.lightness(n-n*t)}const Cgt=({event:e})=>{const t=e.event.status==="live",n=e.event.extra.pitch_outcome,r=n?.count?.outs??0,s=n?.count?.balls??0,o=n?.count?.strikes??0,a=n?.runners,i=n?.count,c=n?.type!=="half_over"&&r!==3&&s!==4&&o!==3;return t?l.jsxs("div",{className:"mt-lg md:mt-md flex flex-col items-center gap-0",children:[l.jsx(Sgt,{runners:a}),l.jsx(Egt,{outs:r}),l.jsx(kgt,{count:i,show:c})]}):null},Sgt=({runners:e})=>{const t=e?.filter(n=>!n.out).map(n=>n.ending_base);return l.jsx("div",{style:{transformStyle:"preserve-3d",perspective:"1000px"},className:"inline-flex",children:l.jsx("div",{style:{transform:"rotateX(45deg)"},children:l.jsxs("div",{className:"gap-three grid rotate-45 grid-cols-2 grid-rows-2",children:[l.jsx(DS,{active:t?.includes(2)??!1}),l.jsx(DS,{active:t?.includes(1)??!1}),l.jsx(DS,{active:t?.includes(3)??!1})]})})})},DS=({active:e})=>l.jsx("div",{className:z("size-3 duration-150 md:size-4",e?"bg-super":"bg-inverse/25")}),Egt=({outs:e})=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(jS,{filled:e>=1}),l.jsx(jS,{filled:e>=2}),l.jsx(jS,{filled:e>=3})]}),jS=({filled:e})=>l.jsx("div",{className:z("relative size-1 rounded-full duration-150",e?"bg-inverse":"bg-inverse/25"),children:e&&l.jsx("div",{className:"bg-inverse repeat-1 absolute inset-0 animate-ping rounded-full"})}),kgt=({count:e,show:t})=>{const n=e?.balls??0,r=e?.strikes??0,s=n===0&&r===0;return l.jsx(V,{variant:"micro",color:s?"ultraLight":"light",className:z("mt-1 duration-150",t?"opacity-100":"opacity-0"),children:l.jsx("span",{className:"font-mono",children:t?`${n}-${r}`:l.jsx(l.Fragment,{children:" "})})})};function Mgt({children:e,className:t}){return l.jsx(V,{variant:"micro",className:z("py-xs !font-mono uppercase",t),color:"light",children:e})}const l_=({className:e,textCenter:t,finalText:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re();return l.jsx("div",{className:z("flex items-center justify-center",e),children:l.jsx(V,{variant:s?"micro":"tiny",color:"light",className:"bg-subtler dark:bg-subtle pt-three rounded-full px-2.5 py-0.5",textCenter:t,children:n?n.toUpperCase():r({defaultMessage:"Final",id:"6/JzkWi0di"}).toUpperCase()})})},$ce=({className:e,textCenter:t=!1})=>{const{$t:n}=J(),{isMobileStyle:r}=Re();return l.jsx("div",{className:z("flex items-center justify-center",e),children:l.jsx(V,{variant:r?"micro":"tiny",color:"light",className:"bg-subtler dark:bg-subtle pt-three rounded-full px-2.5 py-0.5",textCenter:t,children:n({defaultMessage:"Upcoming",id:"6/aEFZbs2i"}).toUpperCase()})})},Tgt=A.memo(function({attributions:t}){const{$t:n}=J(),r=t.join(" · ");return l.jsxs(K,{className:"mt-md pt-md pb-lg flex flex-col gap-1 border-t",children:[l.jsx(V,{variant:"smallBold",color:"light",className:"text-center",children:r}),l.jsx(V,{variant:"small",color:"light",className:"text-center",children:n({defaultMessage:"{perplexity} is not affiliated with, endorsed by, or sponsored by any sports leagues or teams. All trademarks, team names, logos, and player images are the property of their respective owners. The content provided on this page is for informational purposes only and is intended to help users follow sports news and updates.",id:"M0PBu8vKH2"},{perplexity:"Perplexity"})})]})});Tgt.displayName="SportsSources";const qce=A.memo(({children:e,innerRef:t,canScrollLeft:n,canScrollRight:r,fadeOut:s})=>l.jsx("div",{className:"gap-md flex w-full flex-col overflow-hidden",children:l.jsx(nl,{orientation:"horizontal",viewportRef:t,showScrollIndicator:!1,className:z("relative",{"mask-fade-l-12":n&&!r&&s,"mask-fade-r-12":r&&!n&&s,"mask-fade-h-12":n&&r&&s}),children:l.jsx("div",{className:"p-md pt-0",children:e})})}));qce.displayName="CanonicalScroll";const Agt=A.memo(({title:e,subtitle:t,children:n,scrollable:r,fadeOut:s,trailing:o,titleClassName:a})=>{const i=d.useRef(null),[c,u]=d.useState(!1),[f,m]=d.useState(!1),p=d.useCallback(()=>{i.current?.scrollTo({left:i.current.scrollLeft-i.current.clientWidth,behavior:"smooth"})},[i]),h=d.useCallback(()=>{i.current?.scrollTo({left:i.current.scrollLeft+i.current.clientWidth,behavior:"smooth"})},[i]),g=d.useCallback(()=>{i.current&&(u(i.current.scrollLeft>0),m(i.current.scrollLeft+i.current.clientWidth+10i.current.clientWidth))},[i]);return d.useEffect(()=>{const y=i.current;return y?.addEventListener("scroll",g),()=>{y?.removeEventListener("scroll",g)}},[g,i]),d.useEffect(()=>{const y=new ResizeObserver(g);return y.observe(window.document.body),()=>{y.disconnect()}},[g,i]),d.useEffect(()=>{g()},[g]),l.jsxs(K,{className:"gap-md flex flex-col",children:[l.jsxs(Kce,{title:e,subtitle:t,className:a,children:[o,r&&l.jsxs("div",{className:"-mr-sm flex items-center",children:[l.jsx(st,{icon:B("chevron-left"),size:"small",onClick:p,disabled:!c,variant:c?void 0:"noHover"}),l.jsx(st,{icon:B("chevron-right"),size:"small",onClick:h,disabled:!f,variant:f?void 0:"noHover"})]})]}),r?l.jsx(qce,{innerRef:i,canScrollLeft:c,canScrollRight:f,fadeOut:s,children:n}):l.jsx("div",{ref:i,className:"gap-md px-md pb-md flex flex-col",children:n})]})});Agt.displayName="CanonicalSection";const Kce=A.memo(({children:e,title:t,subtitle:n,className:r})=>l.jsxs(K,{className:z("gap-md px-md py-sm flex items-center justify-between border-b",r),children:[l.jsxs(K,{className:"flex items-center justify-between",children:[t&&l.jsx(V,{variant:"baseSemi",children:t}),n&&l.jsx(V,{variant:"smallCaps",color:"light",children:n})]}),e]}));Kce.displayName="SectionTitle";const Ngt={tiny:"size-[16px]",small:"size-[24px]",medium:"size-[32px]",large:"xl:size-[64px] size-[50px]"},Rgt={tiny:"p-[0.5px]",small:"p-[0.5px]",medium:"p-[0.5px]",large:"p-[0.5px]"},Dgt={tiny:"border-[1px]",small:"border-[1px]",medium:"border-[2px]",large:"border-[4px]"},h0=d.memo(({includeStripe:e=!0,includeShadow:t=!1,className:n,includeBackground:r=!1,size:s="large",logo:o,color:a,...i})=>{const c=d.useMemo(()=>{let u=Ngt[s];return r&&(u+=` ${Rgt[s]}`),u},[r,s]);return l.jsx("div",{className:z(c,{"shadow-subtle":t&&r,"border-subtlest rounded-full border bg-white dark:border-transparent":r},n),...i,children:l.jsx("div",{className:z("rounded-inherit relative flex size-full items-center justify-center",{[Dgt[s]]:e&&r}),style:{borderColor:r?a:void 0},children:l.jsx("img",{src:o,alt:"",width:r?"70%":"100%",height:"auto"})})})});h0.displayName="SportsTeamLogo";function jgt(e,t){if(t!=="upcoming"||et?Gce(Kn(e),t==="dark").toString():e,[e,t])}const Yce=A.memo(({variant:e="common",active:t,vertical:n,onClick:r,indicatorPos:s="bottom",extraCSS:o,showNewIndicator:a,styleProps:i,isNewRedesign:c=!1,disabled:u,innerRef:f,...m})=>{const p=z("absolute",{"right-0 h-full w-[3px] rounded-l-sm":s=="right","left-0 h-full w-[3px] rounded-l-sm":s=="left","bottom-0 left-0 right-0 h-[3px] rounded-t-sm":s=="bottom","top-0 left-0 right-0 h-[3px] rounded-b-sm":s=="top","bg-inverse":e==="primary","bg-inverse/70":e==="common"},i?.indicatorClass),h=z({"px-xs transition duration-300 relative ":n,"flex items-center":t&&n,"justify-center px-xs":!n,"!cursor-not-allowed":u,"my-0.5 [&_*]:!font-normal [&_*]:!text-foreground [&_a]:hover:bg-subtler":c,"[&_a]:bg-subtle [&_a]:text-foreground [&_a]:hover:bg-subtle":c&&t,"opacity-70 cursor-not-allowed":u},t?i?.activeBgClass:i?.bgClass);return l.jsxs("div",{onClick:u?void 0:r,className:h,children:[a&&l.jsx("div",{className:"right-md top-sm text-super absolute z-10",children:"●"}),l.jsx(st,{variant:u?"noHover":t?"primary":"common",...m,fullWidth:!0,extraCSS:z("py-md focus-visible:!bg-transparent before:absolute before:opacity-0 focus-visible:before:opacity-100 before:ring-super/50 before:ring-[1.5px] before:inset-y-0 before:inset-x-[-10px] before:rounded-md",{"cursor-not-allowed":u},o),noXPadding:!n,disabled:u,ref:f??void 0}),t&&!u&&l.jsx(Te.div,{layout:"position",layoutId:"tab-indicator",className:p,transition:{duration:.1,ease:"easeOut"}})]})});Yce.displayName="TabButton";const Pgt=A.memo(({actionList:e,size:t=Ht.regular,variant:n="primary",fillSpace:r=!1,vertical:s=!1,layout:o="left",indicatorPos:a,iconOnly:i,allowScroll:c,tabClass:u,testId:f,layoutGroupId:m,styleProps:p,isNewRedesign:h=!1,activeTabRef:g})=>{const y=z({"w-full":r&&!c,"flex w-auto":c,"justify-center":o==="center","justify-end":o==="right"},p?.wrapperClass),x=z("items-center relative",{"justify-center":o==="center","flex-1":r,"w-full":r&&!c,"w-auto overflow-hidden flex":c},p?.innerClass),v=z("flex",{"w-full":r&&!c,"w-auto overflow-x-auto overflow-y-hidden flex-1 scrollbar-none":c},p?.scrollClass),b=z("items-center relative scrollbar-none",{"flex-1":r,"space-y-xs":s&&!h,"gap-x-md flex h-14":!s&&t!=="tiny","gap-x-sm flex h-10":!s&&t==="tiny","w-full":!s&&!c,"flex px-md w-auto overflow-x-auto":c},p?.scrollInnerClass),_=z("relative",{"h-full flex items-center":!s,"justify-center":r,"w-full":r&&!c,"flex-1 shrink-0":c},p?.itemClass);return l.jsx("div",{className:y,"data-test-id":f,children:l.jsx("div",{className:x,children:l.jsx("div",{className:v,children:l.jsx("div",{className:b,children:l.jsx(yg,{id:m,children:e.map(w=>w.show?l.jsxs(K,{className:_,children:[l.jsx(Yce,{testId:w.testId,ariaLabel:w.ariaLabel,vertical:s,text:i?void 0:w.text,size:t,variant:n,onClick:w.onClick,fullWidth:r,active:w.active,icon:w.icon,href:w.href,target:w.target,layout:o,tooltipLayout:a==="right"?"right":"top",toolTip:w.tooltip,indicatorPos:a,trailingComponent:w.trailingComponent,extraCSS:u,showNewIndicator:w.showNewIndicator,styleProps:p?.tabButton,isNewRedesign:h,disabled:w.disabled,innerRef:w.active?g:void 0}),!i&&w.badge&&l.jsx(V,{className:"bg-super pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded-md px-1 py-0.5 text-white",variant:"tiny",children:w.badge}),w.children&&l.jsx(l.Fragment,{children:w.children})]},w.key??w.text):null)})})})})})});Pgt.displayName="TabBar";const Qce=({isRed:e,className:t})=>l.jsx("svg",{width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:z("shrink-0",t),children:l.jsx("rect",{x:"4.29248",y:"0.726685",width:"12",height:"15",rx:"2",transform:"rotate(14.6454 4.29248 0.726685)",fill:e?"#EB4E45":"#f6c825"})}),Ogt=d.memo(({plays:e,onViewAll:t,playsToRender:n=1/0,reverse:r=!0,brands:s,inModal:o=!1,league:a})=>{const{$t:i}=J(),c=r?[...Object.keys(e)].reverse():Object.keys(e),u=d.useMemo(()=>{let f=n;return l.jsxs(K,{children:[c.map(m=>{let p=0;const h=e[m]?.length??0;return f<=0?null:(fr?[...e].reverse():e,[e,r]),i=mi();return l.jsxs(K,{children:[t>0&&l.jsx(K,{variant:"subtle",className:"-mx-md px-md py-sm sticky top-0 z-10 flex items-center justify-between",children:l.jsx(V,{variant:"smallCaps",color:"light",children:n})}),l.jsx(yg,{children:l.jsx(Te.div,{layout:!0,layoutRoot:!0,children:a.slice(0,t).map(c=>l.jsx(Xce,{play:c,brands:s,parentHasMounted:i,league:o},c.id))})})]})}const Xce=d.memo(({play:e,brands:t,parentHasMounted:n,league:r})=>{const{$t:s}=J(),o=d.useRef(!n),a=bht(e.contestantId,t,r),{colorScheme:i}=Ss(),c=Igt(a.color,i)?.toString()??a.color;return l.jsxs(Te.div,{className:"-mx-md border-subtlest p-md relative border-b",initial:o.current?void 0:{opacity:0},animate:o.current?void 0:{opacity:1},transition:{layout:{duration:.2,ease:Kr},opacity:{duration:.2,ease:Kd}},layout:"position",children:[l.jsx("div",{className:"left-xs inset-y-xs absolute w-1 rounded-full opacity-50",style:{backgroundColor:c}}),!o.current&&l.jsx(Te.div,{className:"bg-super/15 absolute inset-0",initial:{opacity:1},animate:{opacity:0},transition:{duration:1,ease:Kd,delay:.2}}),l.jsxs("div",{className:"gap-md relative flex items-center",children:[l.jsx(h0,{logo:a.logo,color:a.color,size:"small",includeStripe:!1}),l.jsxs("div",{className:"gap-sm flex flex-1 flex-row items-center",children:[l.jsxs("div",{className:"gap-md flex items-baseline",children:[l.jsx(V,{variant:"tiny",color:"light",className:"whitespace-nowrap",children:e.periodId[1]==="PENALTIES"?`${s({defaultMessage:"PK",id:"mG6A02k2Ar"})} ${e.timeMin}`:`${e.timeMin}'`}),l.jsx(V,{variant:"small",children:e.commentary_text})]}),Fgt(e)&&l.jsx(Qce,{isRed:Bgt(e)==="red"})]})]})]})});Xce.displayName="Play";const Fgt=e=>e.typeId[0]===17,Bgt=e=>{const t=e.commentary_text.toLowerCase();return t.includes("second yellow card")||t.includes("red card")?"red":t.includes("yellow card")?"yellow":null},Ugt=({event:e})=>{const n=[...e.matchStats?.contestantStats.map(r=>{const s=r.goal_events.map(a=>({type:"goal",event:a})),o=r.red_card_events.map(a=>({type:"red_card",event:a}));return[...s,...o]})??[]].map(r=>r.sort((s,o)=>s.event[0]-o.event[0]));return!n||n.length===0?null:l.jsx("div",{className:"gap-md p-md grid grid-cols-2",children:n.map((r,s)=>l.jsx(Vgt,{events:r,position:s===0?"left":"right"},s))})},Vgt=({events:e,position:t})=>l.jsx("div",{className:z("gap-xs flex flex-col",{"items-start":t==="left","items-end":t==="right"}),children:e.map((n,r)=>l.jsx(Hgt,{event:n,position:t},r))}),Hgt=({event:e,position:t})=>l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsxs(V,{variant:"tiny",className:z("flex items-center gap-1",{"flex-row-reverse":t==="right"}),children:[l.jsx(zgt,{event:e})," ",e.event[1]]}),l.jsxs(V,{variant:"tiny",color:"light",children:[e.event[0],"'"]})]}),zgt=({event:e})=>e.type!=="goal"?l.jsx(Qce,{isRed:!0,className:"size-md inline-block"}):l.jsx("div",{className:"size-md inline-block",children:"⚽️"}),Zce=d.memo(({className:e,innerClassName:t,gridClassName:n,children:r,fadeOut:s,dotClassName:o,highlightClassName:a,animate:i=!0,gridSize:c=22,count:u=20,style:f})=>{const[m,{width:p,height:h}]=ti(),[g,y]=d.useState([]),[x,v]=d.useState(0),[b,_]=d.useState(0),w=d.useRef(null),S=d.useRef(new Set),C=d.useCallback(()=>{const T=Math.floor(Math.random()*x)+1,k=Math.floor(Math.random()*b)+1,I=`${T}-${k}`;if(S.current.has(I))return;const M={col:T,row:k,id:I,duration:Math.floor(Math.random()*1001)+1e3,isSuper:Math.floor(Math.random()*5)%5===0};y(N=>{const D=[M,...N];if(D.length>u){const j=D.pop();j&&S.current.delete(j.id)}return S.current.add(I),D})},[x,b,u]);d.useEffect(()=>{if(i)return w.current=setInterval(C,100),()=>{w.current&&clearInterval(w.current)}},[C,i]),d.useEffect(()=>{v(Math.floor(p/c)),_(Math.floor(h/c))},[p,h,c]);const E=s?{maskImage:"radial-gradient(black, transparent)"}:void 0;return l.jsxs("div",{className:z("bg-base dotGridContainer pointer-events-none relative isolate",e),ref:m,style:f,children:[l.jsxs("div",{className:"absolute inset-0 overflow-hidden",style:E,children:[l.jsx("div",{className:z("dotHighlightGrid bg-inverse/20 absolute inset-0",a),children:g.map(T=>l.jsx(Jce,{item:T,className:o},T.id))}),l.jsx("div",{className:z("dotGrid absolute inset-0",n)})]}),l.jsx("div",{className:z("relative",t),children:r})]})});Zce.displayName="DotGrid";const Jce=d.memo(({item:e,className:t})=>l.jsx("div",{className:z("gridDot text-foreground",t,{highlight:e.isSuper}),style:{gridColumn:e.col,gridRow:e.row,animationDuration:`${e.duration}ms`}}));Jce.displayName="GridDot";const um=A.memo(({size:e="default",className:t,includeDot:n})=>{const{$t:r}=J(),{isMobileStyle:s}=Re();return l.jsx("div",{className:z("flex shrink-0 items-center justify-center",t),children:l.jsxs(V,{variant:e==="tiny"||s?"micro":"tiny",color:"super",className:z("bg-superBG pt-three flex shrink-0 items-center rounded-full py-0.5 tracking-wider",{"px-2.5":e==="default","pl-2":e==="default"&&n,"px-2":e==="small","px-1.5":e==="tiny"}),children:[n&&l.jsxs("span",{className:"grid",children:[l.jsx("span",{className:"bg-super mr-1 size-1.5 rounded-full",style:{gridArea:"1/-1"}}),l.jsx("span",{className:"bg-super mr-1 size-1.5 animate-ping rounded-full",style:{gridArea:"1/-1"}})]}),r({defaultMessage:"Live",id:"Dn82ALx/+V"}).toUpperCase()]})})});um.displayName="LiveIndicator";const Wgt=A.memo(({className:e,color:t="positive"})=>{const n=t==="negative"?"bg-caution":"bg-super";return l.jsxs("span",{className:z("grid",e),children:[l.jsx("span",{className:z(n,"size-1.5 rounded-full"),style:{gridArea:"1/-1"}}),l.jsx("span",{className:z(n,"size-1.5 animate-ping rounded-full"),style:{gridArea:"1/-1"}})]})});Wgt.displayName="LiveDot";const eue=A.memo(()=>l.jsx("div",{}));eue.displayName="SportsWidgetErrorFallback";const IB=new Set,Ggt=e=>e.status==="live"||e.status==="upcoming";function $gt({widget:e}){const{isMobileStyle:t}=Re(),{result:{backend_uuid:n,mode:r}}=It(),s=Mg();if(d.useEffect(()=>{!n||!e||!e?.events?.length||IB.has(n)||(s("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:r}),IB.add(n))},[n,e?.events?.length,r,e,s]),!e?.events?.length)return null;const o=e.canonical_pages?.[0]?.url_web,a=e.events.at(0),i=!t&&(a&&Ggt(a)||e.events.length<5),c=e.league??"nba";return l.jsx(Mr,{fallback:eue,children:l.jsx(Es,{widgetType:"sports",widgetName:e.object,children:({widgetSelected:u})=>l.jsx(tue,{canonicalPageLink:o,children:l.jsx(Zgt,{events:e.events,showHero:i,widgetSelected:u,league:c})})})})}const tue=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})},nue=({initialData:e,refetch:t=!1,reason:n})=>mt({initialData:e,queryKey:be.makeEphemeralQueryKey("sports/events/widget",e.id),queryFn:async()=>{if(!e.refetch_url)return e;const r=await zfe({urlPath:e.refetch_url,timeoutMs:0,reason:n});if(!r.ok)throw Z.error("Failed to fetch sport event",{url:e.refetch_url,status:r.status,statusText:r.statusText}),new Error(`Failed to fetch sport event ${r.status} ${r.statusText}`);return await r.json()},refetchInterval:r=>r.state.data?.refetch_url?r.state.data?.refetch_interval_secs*1e3:!1,enabled:!!e.refetch_url&&t}),qgt=({event:e,onClick:t,eventCount:n,league:r})=>{const{$t:s}=J(),{data:o}=nue({initialData:e,refetch:!0,reason:"sports-event-row"}),a=rue(),i=r==="nba"&&kce(o.title[0]??""),c=iue(o.team_1,o.team_2),u=i?c:null,f=d.useMemo(()=>[{title:o.team_1.title,score:o.team_1.text,subscore:o.team_1.sub_text,image:o.team_1.img,emphasized:o.team_1.won,period:o.period_text},{title:o.team_2.title,score:o.team_2.text,subscore:o.team_2.sub_text,image:o.team_2.img,emphasized:o.team_2.won,period:o.period_text}],[o]);return l.jsx(aue,{href:o.url?.url_web,onClick:()=>t(o.url?.url_web),children:l.jsx(t0t,{title:o.status==="live"?"LIVE":a(o.datetime,o.datetime_tba,o.datetime_end),isLive:o.status==="live",items:f,period:sue(o.period_text,o.period_time,r,{halftime:s({defaultMessage:"Halftime",id:"iC0AL294Dr"})})??null,eventCount:n,subtitle:u??void 0},o.id)})},Kgt=({events:e,onClick:t,league:n})=>l.jsx("div",{className:z("bg-subtlest grid grid-cols-1 rounded-b-lg md:grid-cols-2",{"lg:grid-cols-3":e.length>2}),children:e.map(r=>l.jsx(qgt,{event:r,onClick:t,eventCount:e.length,league:n},r.id))}),Ygt=e=>{const{locale:t}=J();return e?new Date(e).toLocaleTimeString(t,{hour:"numeric",minute:"numeric",timeZoneName:"short"}):""},Qgt=e=>e.join(" · "),rue=({includeTime:e=!0}={})=>{const{$t:t}=J(),{locale:n}=J();return d.useCallback((r,s,o)=>{if(o){if(!r&&s)return t({defaultMessage:"TBA",id:"ZfAWFLTzx/"});if(!r)return"";const m=new Date(r),p=new Date(o),h=m.getFullYear();if(!(h===new Date().getFullYear())){const w=m.toLocaleDateString(n,{month:"short"}),S=p.toLocaleDateString(n,{month:"short"}),C=m.getDate(),E=p.getDate();return w===S?`${w} ${C}-${E}, ${h}`:`${w} ${C}-${S} ${E}, ${h}`}const y=m.toLocaleDateString(n,{month:"short"}),x=p.toLocaleDateString(n,{month:"short"}),v=m.getDate(),b=p.getDate();let _;if(y===x?_=`${y} ${v}-${b}`:_=`${y} ${v}-${x} ${b}`,e){const w=s?"TBA":m.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});return`${_}, ${w}`}return _}if(!r&&s)return t({defaultMessage:"TBA",id:"ZfAWFLTzx/"});if(!r)return"";const a=new Date(r),i=r&&s,c=a.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});if(qBe(a))return e?`${t({defaultMessage:"Today",id:"zWgbGgjUUg"})}, ${c}`:t({defaultMessage:"Today",id:"zWgbGgjUUg"});if(YBe(a))return e?`${t({defaultMessage:"Yesterday",id:"6dIxDP1C8c"})}, ${c}`:t({defaultMessage:"Yesterday",id:"6dIxDP1C8c"});if(Dee(a))return e?`${t({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"})}, ${c}`:t({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"});if(a.getFullYear()!==new Date().getFullYear())return new Date(a).toLocaleDateString(n,{month:"short",day:"numeric",year:"numeric"});const u=a.toLocaleDateString(n,{month:"short",day:"numeric"});if(!e)return u;const f=i?"TBA":a.toLocaleTimeString(n,{hour:"numeric",minute:"numeric",timeZoneName:"short"});return`${u}, ${f}`},[n,t,e])},sue=(e,t,n,r)=>{if(n==="mlb")return Xgt(e);if(!e||typeof t?.seconds!="number"&&typeof t?.minutes!="number")return e;if(e==="Halftime")return r.halftime;const s=t?.seconds?.toString().padStart(2,"0")??"00",o=t?.minutes??0;return`${e} ${o}:${s}`},Xgt=e=>e?.replace("Top","▲").replace("Bot","▼"),Zgt=({events:e,showHero:t,widgetSelected:n,league:r})=>{const s=d.useMemo(()=>t?e.slice(1):e,[e,t]),{data:o}=nue({initialData:e[0],refetch:t,reason:"sports-widget-dense"});return l.jsxs(K,{children:[t&&l.jsxs(aue,{href:o?.url?.url_web,onClick:()=>{n(o?.url?.url_web)},children:[l.jsx(Jgt,{event:o,includeBorder:s.length>0,league:r,statusExtra:o&&r==="mlb"&&o.status==="live"?l.jsx(Cgt,{event:{event:o}}):null}),r==="championsleague"&&o&&l.jsx(Ugt,{event:{event:o,brands:[],candlestickData:null,matchEvents:null,matchStats:o.extra?.match_stats??null,eventExtra:null}})]}),l.jsx(Kgt,{events:s,onClick:n,league:r})]})},oue=()=>l.jsx("span",{className:"text-quietest",children:"—"}),aue=({children:e,href:t,onClick:n})=>t?l.jsx(yt,{href:t,className:"group/link group",onClick:n,children:e}):l.jsx("div",{className:"group",onClick:n,children:e}),iue=(e,t)=>{const{$t:n}=J(),r=e.subtitle?.split("-"),s=t.subtitle?.split("-"),o=Hi(r)?+r[0]:null,a=Hi(s)?+s[0]:null,i=4;if(o===null||a===null)return null;const c=o>a?e.abbreviation:t.abbreviation,u=o>a?o:a,f=o>a?a:o;return o>=i||a>=i?n({defaultMessage:"{leadingTeam} Wins {leadingScore}-{trailingScore}",id:"T1UC+k87MZ"},{leadingTeam:c,leadingScore:u,trailingScore:f}):o===a?n({defaultMessage:"Series Tied {team1Record}-{team2Record}",id:"Liahhq+hIg"},{team1Record:o,team2Record:a}):n({defaultMessage:"{leadingTeam} Leads {leadingScore}-{trailingScore}",id:"oO28OWtTlZ"},{leadingTeam:c,leadingScore:u,trailingScore:f})},Jgt=({event:e,includeBorder:t=!1,className:n,league:r,scoreExtra:s,statusExtra:o,displayBranding:a=!0})=>{const{$t:i}=J(),c=e.team_1.title,u=e.team_2.title,f=e.team_1.text,m=e.team_1.sub_text,p=e.team_2.text,h=e.team_2.sub_text,g=r==="nba"&&kce(e.title[0]??""),y=iue(e.team_1,e.team_2),x=g?y:null,v=rue({includeTime:!1}),b=Ygt(e.datetime),_=e.datetime_tba?i({defaultMessage:"TBA",id:"ZfAWFLTzx/"}):b,w=Qgt(e.title),{colorScheme:S}=Ss(),C=sue(e.period_text,e.period_time,r,{halftime:i({defaultMessage:"Halftime",id:"iC0AL294Dr"})}),E=e.team_1.won||e.team_2.won,T=d.useMemo(()=>{let k;return E?a?(e.team_1.won?k=e.team_1.color:k=e.team_2.color,Gce(k?Kn(k):null,S==="dark")):"#1FB8CD":null},[e.team_1.won,e.team_1.color,e.team_2.color,S,E,a]);return l.jsxs(K,{className:z(n,"rounded-inherit relative",{"border-b":t}),children:[E&&l.jsx("div",{className:"rounded-inherit pointer-events-none absolute inset-0 overflow-hidden",style:{color:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"},children:l.jsx(Zce,{className:"-inset-xl rounded-inherit !absolute ![--dog-bg-highlight:currentColor]",dotClassName:"!text-[currentColor]",highlightClassName:"!bg-black/5 dark:!bg-white/5"})}),l.jsx("div",{className:"px-md gap-sm relative flex items-start justify-between pt-[12px]",children:l.jsxs(V,{variant:"tiny",color:"light",children:[w,x&&" · "+x]})}),l.jsxs("div",{className:"p-md md:px-lg md:py-md gap-sm relative grid grid-cols-[1fr_auto_1fr] items-center justify-start md:justify-between md:gap-[12px]",children:[l.jsxs("div",{className:"gap-md flex flex-col-reverse items-center justify-start md:flex-row md:justify-start md:gap-[12px]",children:[l.jsx(LB,{record:e.team_1.subtitle,name:c,logo:a?e.team_1.img:null}),l.jsx("div",{className:"md:mx-auto",children:l.jsx(PB,{position:"leading",score:f,subscore:m,isWinner:e.team_1.won,hasWinner:E,scoreExtra:s,team:e.team_1,teamIdx:0,league:r})})]}),l.jsxs("div",{className:"gap-sm flex flex-col items-center",children:[l.jsx(e0t,{status:e.status,date:v(e.datetime,e.datetime_tba,e.datetime_end),time:_,isUpcoming:e.datetime?jgt(new Date(e.datetime),e.status):void 0,period:C??null}),o]}),l.jsxs("div",{className:"gap-md flex flex-col-reverse items-center justify-start md:flex-row-reverse md:gap-[12px]",children:[l.jsx(LB,{record:e.team_2.subtitle,name:u,logo:a?e.team_2.img:null}),l.jsx("div",{className:"md:mx-auto",children:l.jsx(PB,{score:p,subscore:h,position:"trailing",isWinner:e.team_2.won,hasWinner:E,scoreExtra:s,team:e.team_2,teamIdx:1,league:r})})]})]}),e.live_text&&l.jsx("div",{className:"bg-subtlest px-md relative py-[12px]",children:l.jsxs(V,{variant:"tiny",color:"light",className:"gap-sm line-clamp-1 flex items-start md:items-center",children:[l.jsx(ut,{name:B("broadcast"),size:16,className:"opacity-80 md:-translate-y-px"}),e.live_text]})}),E&&l.jsx("div",{className:"rounded-inherit pointer-events-none absolute inset-0 opacity-20 mix-blend-multiply dark:opacity-60 dark:mix-blend-soft-light",style:{backgroundColor:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}}),!t&&E&&l.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-[12px] border opacity-40",style:{borderColor:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}}),!t&&E&&l.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-[13px] border opacity-20 dark:opacity-40",style:{borderColor:T?.toString(),maskImage:e.team_1.won?"linear-gradient(to left, transparent 60%, black)":"linear-gradient(to right, transparent 60%, black)"}})]})},PB=({score:e,subscore:t,position:n,emptyPlaceholder:r=l.jsx(oue,{}),isWinner:s,hasWinner:o,scoreExtra:a,team:i,teamIdx:c,league:u})=>{const{isMobileStyle:f}=Re(),m=u==="ipl"||u==="cricket"||u==="icc"||u==="atp"||u==="wta";return l.jsxs("div",{className:z("md:gap-xs flex flex-col items-center justify-center",{"items-start":n==="leading","items-end":n==="trailing","opacity-50":o&&!s}),children:[l.jsxs(V,{variant:f?m?"section-title":"display":"section-title",className:"gap-xs md:gap-sm flex items-center sm:!text-2xl lg:!text-3xl",children:[s&&n==="trailing"&&l.jsx(OB,{className:"size-3 rotate-180 md:size-4"}),l.jsxs("span",{className:"font-mono",children:[a&&l.jsx("span",{className:"mr-xs",children:a(i,c)}),e??r]}),s&&n==="leading"&&l.jsx(OB,{className:"size-2.5 md:size-4"})]}),t&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:"font-mono",children:t})})]})},OB=({className:e})=>l.jsx("svg",{width:"6",viewBox:"0 0 18 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 0.322327L0.822266 17.5L18 34.6777V0.322327Z",className:"fill-foreground"})}),LB=({name:e,logo:t,record:n})=>e?l.jsxs("div",{className:"gap-sm flex flex-col items-center justify-between md:gap-0",children:[t&&l.jsx(h0,{logo:t,color:"#000000"}),l.jsx(V,{variant:"baseSemi",children:e}),n&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx("span",{className:"font-mono",children:n})})]}):null,e0t=({status:e,date:t,time:n,isUpcoming:r,variant:s="stacked",period:o})=>{const a=e==="live",i=e==="final",{isMobileStyle:c}=Re();return l.jsx("div",{className:z("gap-sm flex",{"flex-row items-center":s==="row","flex-col items-center justify-center":s==="stacked"}),children:a?l.jsxs("div",{className:"gap-sm flex flex-col items-center",children:[l.jsx(um,{size:c?"small":"default",includeDot:!0}),o&&l.jsx(V,{variant:"tiny",color:"light",children:o})]}):l.jsxs("div",{className:z("gap-xs flex",{"flex-col":s==="stacked","flex-row items-center":s==="row"}),children:[r&&l.jsx($ce,{textCenter:!0,className:"mb-1 hidden md:block"}),i&&l.jsx(l_,{textCenter:!0,className:"-mt-0.5 md:mb-1 md:mt-0 md:block"}),l.jsx(V,{variant:"tiny",color:"light",className:"w-full whitespace-nowrap text-center",children:t}),n&&!i&&l.jsx(V,{variant:"tiny",color:"light",className:"w-full whitespace-nowrap text-center",children:n})]})})},t0t=({items:e,title:t,subtitle:n,isLive:r,period:s,eventCount:o})=>{const a=e.some(f=>f.emphasized),{isMobileStyle:i}=Re(),{isLargeScreen:c,isMediumScreen:u}=GN();return l.jsx(K,{variant:"raised",className:z("px-md h-full py-[12px]",{"border-b border-r-0 group-last:border-b-0 group-even:border-r-0":i,"border-b group-odd:border-r":u&&!c,"group-[&:nth-child(2n):nth-last-child(-n+3)~a]:border-b-0":u&&!c&&o>2,"border-b border-r group-[&:nth-child(3n)]:border-r-0":c,"group-[&:nth-child(3n):nth-last-child(-n+4)~a]:border-b-0":c&&o>3,"!border-b-0":c&&o<=3||u&&!c&&o<=2}),children:l.jsxs("div",{className:"gap-sm flex size-full flex-col items-start justify-between duration-150 group-hover/link:opacity-75",children:[r?l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(um,{size:"small",className:"-ml-1"}),s&&l.jsx(V,{variant:"tiny",color:"super",children:s})]}):t?l.jsx(V,{variant:"tinyRegular",color:"light",children:t}):null,l.jsx("div",{className:"w-full",children:e.map((f,m)=>l.jsx(n0t,{item:f,anyEmphasized:a},f.title+m))}),n&&l.jsx(V,{variant:"tinyRegular",color:"light",children:n})]})})},n0t=({item:e,anyEmphasized:t})=>{const n=d.useMemo(()=>e.score?e.subscore?`${e.score} ${e.subscore}`:e.score:l.jsx(oue,{}),[e.score,e.subscore]);return l.jsxs(K,{className:"flex w-full items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[e.image&&l.jsx("img",{src:e.image,alt:e.title,className:"size-[24px]"}),l.jsx(V,{variant:e.emphasized?"smallBold":"small",color:t&&!e.emphasized?"light":"default",children:e.title})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[e.emphasized&&l.jsx(ut,{name:B("trophy"),size:14,className:"text-super -translate-y-half"}),l.jsx(V,{variant:e.emphasized?"smallBold":"small",color:t&&!e.emphasized?"light":"default",children:n})]})]})},lue=A.memo(()=>l.jsx("div",{children:"Error loading individual event widget."}));lue.displayName="IndvEventsWidgetErrorFallback";const FB=new Set,r0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})},s0t=(e,t)=>{if(!e)return"";try{return new Date(e).toLocaleDateString(t,{month:"short",day:"numeric"})}catch{return""}},o0t=(e,t)=>{if(!e)return"";try{return new Date(e).toLocaleTimeString(t,{hour:"numeric",minute:"2-digit",hour12:!0}).replace(/^0+/,"")}catch{return""}},cue=({competitor:e})=>l.jsxs(K,{className:"gap-sm border-subtlest px-md py-sm flex items-center border-b last:border-b-0",children:[l.jsx(V,{className:"w-4 text-center",children:e.rank}),l.jsxs("div",{className:"gap-sm flex grow items-center",children:[e.primary_img_url?l.jsx(h0,{logo:e.primary_img_url,color:"transparent",size:"small",className:"shrink-0"}):l.jsx(K,{className:"flex h-5 w-8 shrink-0 items-center justify-center rounded-sm bg-[#44403c] text-xs",children:e.abbreviation}),l.jsxs("div",{className:"flex grow flex-col",children:[l.jsx(V,{variant:"smallBold",children:e.title}),l.jsxs(V,{variant:"tiny",color:"light",children:[e.metadata[0]," "]})]})]}),l.jsxs(K,{className:"flex flex-col items-end text-right",children:[l.jsx(V,{variant:"smallBold",children:e.metadata[1]}),l.jsx(V,{variant:"tiny",color:"light",children:e.metadata[2]})]})]},e.id),a0t=({event:e,league:t})=>{const{locale:n}=J(),r=e.subtitle,{$t:s}=J(),o=o0t(e.datetime,n),a=e.datetime?Wme(new Date(e.datetime))?s({defaultMessage:"Today",id:"zWgbGgjUUg"}):Dee(new Date(e.datetime))?s({defaultMessage:"Tomorrow",id:"MtrTNyxuSU"}):new Date(e.datetime).toLocaleDateString(n,{weekday:"short",month:"short",day:"numeric"}):"";return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"p-md border-subtler flex items-end justify-between border-b",children:[l.jsxs(K,{className:"flex flex-col",children:[l.jsx(V,{variant:"baseSemi",children:e.title.join(" ")}),l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),r&&`・${r}`]})]}),l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx(V,{variant:"small",children:a}),l.jsx(V,{variant:"small",color:"light",children:o})]})]}),e.image_url&&l.jsx(K,{className:"aspect-video w-full overflow-hidden rounded-lg bg-[#292524]",children:l.jsx(Wo,{src:e.image_url,alt:`${e.title.join(" ")} circuit map`,className:"size-full object-contain"})}),l.jsx(K,{className:"gap-xs p-md flex flex-col",children:e.metadata?.map((i,c)=>l.jsxs(K,{className:"flex justify-between",children:[l.jsx(V,{className:"text-sm",color:"light",children:i[0]}),l.jsx(V,{className:"text-sm",children:i[1]})]},c))})]})},i0t=({event:e,league:t})=>{const{locale:n}=J(),r=s0t(e.datetime,n),s=e.competitors.slice(0,3),o=e.subtitle;return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"border-subtler px-md py-sm gap-md flex items-center justify-between border-b",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",className:"flex justify-between",children:l.jsx("span",{children:e.title.join(" ")})}),l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),o&&`・${o}`]})]}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:"small",color:"light",children:r}),l.jsx(l_,{})]})]}),l.jsx(K,{className:"flex flex-col",children:s.map(a=>l.jsx(cue,{competitor:a},a.id))})]})},l0t=({event:e,league:t})=>{const n=e.competitors.slice(0,3),r=e.subtitle;return l.jsxs(K,{className:"flex flex-col",children:[l.jsxs(K,{className:"border-subtler px-md py-sm gap-md flex items-center justify-between border-b",children:[l.jsxs("div",{children:[l.jsx(V,{variant:"baseSemi",className:"flex justify-between",children:l.jsx("span",{children:e.title.join(" ")})}),l.jsx("div",{children:l.jsxs(V,{variant:"small",color:"light",children:[t.toUpperCase(),r&&`・${r}`]})})]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(um,{includeDot:!0}),e.period_text&&l.jsx(V,{color:"light",variant:"small",children:e.period_text})]})]}),l.jsx(K,{className:"flex flex-col",children:n.map(s=>l.jsx(cue,{competitor:s},s.id))})]})},c0t=({event:e,league:t})=>{switch(e.status){case"upcoming":return l.jsx(a0t,{event:e,league:t});case"live":return l.jsx(l0t,{event:e,league:t});case"final":return l.jsx(i0t,{event:e,league:t});default:return null}};function u0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=d.useMemo(()=>e?.event,[e]),o=d.useMemo(()=>e?.league,[e]);if(d.useEffect(()=>{!t||!e||!s||FB.has(t)||(r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n}),FB.add(t))},[t,s,n,e,r]),!e||!s)return null;const a=e.canonical_page?.url_web,i=`indv-event-${s.id??"unknown"}`;return l.jsx(Mr,{fallback:lue,children:l.jsx(Es,{widgetType:"sports",widgetName:i,children:({})=>l.jsx(r0t,{canonicalPageLink:a,children:l.jsx(c0t,{event:s,league:o})})})})}const uue=A.memo(()=>l.jsx("div",{children:"Error loading individual schedule widget."}));uue.displayName="IndvScheduleWidgetErrorFallback";const BB=new Set,d0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})},f0t=(e,t,n)=>{if(!e)return t.replace(/^(0)(\d:[0-5]\d\s+[AP]M)$/,"$2");try{return new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).replace(/^0+/,"")}catch{return t.replace(/^(0)(\d:[0-5]\d\s+[AP]M)$/,"$2")}},IS=({event:e,isFinal:t,isLive:n})=>{const{locale:r}=J(),s=e.metadata?.[0],o=e.metadata?.[1]??"",a=f0t(e.datetime,o,r),{isMobileStyle:i}=Re(),c=!!e.url?.url_web,u=l.jsxs(l.Fragment,{children:[l.jsxs(K,{className:"p-md col-span-3 grid grid-cols-subgrid items-center md:col-span-4",children:[l.jsx(K,{className:"flex flex-col items-start",children:l.jsx(p0t,{date:e.datetime??""})}),l.jsxs(K,{className:"gap-xs flex flex-col md:gap-0",children:[l.jsx(V,{variant:"baseSemi",className:"text-base leading-snug",children:e.title.join(" ")}),s&&l.jsxs(V,{variant:i?"tiny":"small",className:"mt-0 pt-0",color:"light",children:[!t&&!n&&l.jsxs(l.Fragment,{children:[a," · "]}),s]})]}),l.jsx("div",{className:"hidden md:block",children:e.live_text&&l.jsx(V,{variant:"small",className:"text-right",children:e.live_text})}),l.jsx("div",{children:t?l.jsx(l_,{}):n?l.jsx(um,{includeDot:!0}):null})]}),l.jsx("div",{className:"p-md -mt-sm col-span-2 col-start-2 pl-0 pt-0 md:hidden",children:e.live_text&&l.jsx(V,{variant:"tiny",className:"border-subtlest p-xs px-sm rounded border",color:"light",children:e.live_text})})]}),f="col-span-3 grid grid-cols-subgrid border-b border-subtlest last:border-b-0 md:col-span-4";return c?l.jsx(yt,{href:e.url?.url_web??"",className:z(f,"hover:bg-subtler duration-150"),children:u}):l.jsx(K,{className:f,children:u})};function m0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=d.useMemo(()=>e?.events??[],[e]);if(d.useEffect(()=>{!t||!e||!s?.length||BB.has(t)||(r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n}),BB.add(t))},[t,e,s,n,r]),!e||!s||s.length===0)return null;const o=e.canonical_page?.url_web,a=`indv-schedule-${e.league??"unknown"}`;return l.jsx(Mr,{fallback:uue,children:l.jsx(Es,{widgetType:"sports",widgetName:a,children:({})=>l.jsx(d0t,{canonicalPageLink:o,children:l.jsx(K,{className:"gap-x-md grid grid-cols-[min-content,1fr,min-content] md:grid-cols-[min-content,1fr,1fr,min-content]",children:s.map(i=>{switch(i.status){case"upcoming":return l.jsx(IS,{event:i},i.id);case"live":return l.jsx(IS,{event:i,isLive:!0},i.id);case"final":return l.jsx(IS,{event:i,isFinal:!0},i.id);default:return null}})})})})})}const p0t=({date:e})=>{const{locale:t}=J(),n=new Date(e).toLocaleDateString(t,{day:"numeric"}),r=new Date(e).toLocaleDateString(t,{month:"short"}),{isMobileStyle:s}=Re();return l.jsxs("div",{className:"dark:bg-subtle bg-subtler py-xs flex w-full flex-col items-center justify-center rounded-lg px-0.5 md:p-[6px]",children:[l.jsx(V,{className:"px-sm -mb-0.5 rounded-full text-center",variant:"tinyRegular",color:"light",children:r}),l.jsx(V,{className:"px-sm -mb-1 text-center",variant:s?"baseSemi":"section-title",children:n})]})},due=({headshotImageUrl:e,flagUrl:t,name:n,isCompositeFlag:r})=>!e&&!t?null:l.jsxs("div",{className:"relative size-6 shrink-0 rounded md:size-8",children:[l.jsx("img",{src:e??t,alt:n,className:z("rounded-inherit relative size-full shrink-0",{"object-contain":r,"object-cover":!r})}),!r&&l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-black/10 dark:border-white/10"}),e&&l.jsxs("div",{className:"ml-xs ring-raised absolute right-[90%] top-[90%] size-3 shrink-0 -translate-y-1/2 translate-x-1/2 rounded-full ring-2 md:size-4",children:[l.jsx("img",{src:t,alt:n,className:"rounded-inherit relative size-full shrink-0 object-cover"}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-black/10 dark:border-white/10"})]})]}),h0t=e=>{for(const t of e)for(const n of t.cells)if(n.extra?.is_current_round)return n.column_id;return null},fue=({value:e,variant:t="red"})=>{if(!e)return null;const n=t==="subtle";return l.jsx(K,{variant:t,className:"inline-flex h-5 items-center whitespace-nowrap rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:z("translate-y-half tracking-wider",{uppercase:!n}),children:e})})};fue.displayName="StatusDisplay";const G1=(e,t)=>{const n=e.display_value??e.value??"",r=t.font_weight==="bold"?"smallBold":"small",s=e.extra;return l.jsx(V,{variant:r,className:s?.is_current_round?"font-bold":"",children:n})},g0t={pos_golf:(e,t)=>{const n=e.display_value??e.value??"",r=t.font_weight==="bold"?"smallBold":"small";return e.extra?.show_trophy?l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(ge,{icon:B("trophy"),size:"md",className:"text-super"})}):l.jsx(V,{variant:r,color:"light",children:n})},golfer_golf:(e,t)=>{const n=String(e.display_value??""),r=e.image_url??void 0,s=e.value,o=e.sub_text,a=t.font_weight==="bold"?"smallBold":"small";return l.jsxs("div",{className:"md:gap-md gap-sm flex items-center",children:[l.jsx(due,{headshotImageUrl:r,flagUrl:s,name:n}),l.jsxs("div",{children:[l.jsx(V,{variant:a,children:n}),o&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]})]})},status_golf:e=>{const t=e.display_value??e.value??"",r=/am|pm/i.test(String(t))?"subtle":"red";return l.jsx(fue,{value:t,variant:r})},total_golf:(e,t)=>{const n=e.display_value??e.value??"E",r=typeof e.value=="number"?e.value:0,s=t.font_weight==="bold"?"smallBold":"small";let o="default";return r<0?o="positive":r>0&&(o="negative"),l.jsx(V,{variant:s,color:o,children:n})},r1:G1,r2:G1,r3:G1,r4:G1},y0t={status_golf:()=>null},x0t=({result:e})=>{let t="",n=null;return e==="W"?(t="bg-[#059669] text-white",n=B("check")):e==="D"?(t="bg-[#64748b] text-white",n=B("minus")):e==="L"&&(t="bg-[#e11d48] text-white",n=B("x")),l.jsx("div",{className:z("flex size-4 items-center justify-center rounded-full",t),children:n&&l.jsx(ut,{name:n,size:12})})},mue=({form:e})=>{const t=String(e).replace(/\s/g,"");return l.jsx("div",{className:"flex gap-0.5",children:t.split("").map((n,r)=>l.jsx(x0t,{result:n},r))})};mue.displayName="FormDisplay";const v0t=({value:e})=>{const t=e.includes("↑"),n=e.includes("↓"),r=e==="-",s=e.replace(/[^0-9]/g,"");return l.jsxs("div",{className:"flex items-center justify-center gap-0.5",children:[l.jsx(ge,{icon:t?B("caret-up-filled"):n?B("caret-down-filled"):B("minus"),size:"sm",className:z("scale-90",{"text-quietest":r,"text-positive":t,"text-negative":n})}),!r&&l.jsx(V,{variant:"tinyMono",color:t?"positive":"negative",className:"w-[2ch] shrink-0 text-left",children:s})]})},b0t={form:e=>{const t=e.display_value??e.value??"";return l.jsx(mue,{form:String(t)})},movement:e=>{const t=e.display_value??e.value??"";return l.jsx(v0t,{value:String(t)})}},pue={...b0t,...g0t},_0t={...y0t},hue=(e="left")=>{switch(e){case"center":return"text-center";case"right":return"text-right";case"left":default:return"text-left"}},w0t=(e=!1)=>e?"w-full":"w-0",PS=(e="normal",t)=>{if(t==="pos")return"smallCaps";switch(e){case"bold":return"smallBold";case"normal":default:return"small"}},C0t=(e="")=>e==="pos"?"light":"default",S0t=({cell:e,column:t,columns:n,rows:r,columnRenderers:s=pue})=>{const{inApp:o}=Sa();if(!e)return l.jsx("td",{className:"md:px-md p-sm"});let a;const i=t.column_type??"text",c=e.display_value??e.value??"-";t.column_id&&s[t.column_id]?a=s[t.column_id]?.(e,t,{columns:n,rows:r}):(i==="entity"||i==="image")&&e.image_url?a=l.jsxs("div",{className:"md:gap-md gap-sm flex items-center",children:[l.jsx(h0,{logo:e.image_url,color:"transparent",size:"small",className:"shrink-0"}),l.jsxs("div",{children:[l.jsx(V,{variant:PS(t.font_weight??"normal",t.column_id),children:c}),i==="entity"&&e.sub_text&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]})]}):i==="entity"&&!e.image_url?a=l.jsxs("div",{children:[l.jsx(V,{variant:PS(t.font_weight??"normal",t.column_id),children:c}),e.sub_text&&l.jsx(V,{variant:"tiny",color:"light",children:e.sub_text})]}):a=l.jsx(V,{variant:PS(t.font_weight??"normal",t.column_id),color:C0t(t.column_id),children:c});const u=z("md:pl-md pl-sm last:px-sm md:last:px-md py-sm align-middle",hue(t.alignment),w0t(t.should_fill_width));return e.canonical_page?l.jsx("td",{className:u,children:l.jsx(Zg,{href:o?e.canonical_page.url_app:e.canonical_page.url_web,className:"block",children:a})}):l.jsx("td",{className:u,children:a})},E0t=({row:e,rows:t,columns:n,columnRenderers:r})=>{if(e.section_header)return l.jsx(K,{as:"tr",children:l.jsx(K,{as:"td",colSpan:n.length,className:"pl-sm md:pl-md py-sm",children:l.jsx(K,{variant:"superLight",className:"inline-flex h-5 items-center rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:"translate-y-half uppercase tracking-wider",children:e.section_header})})})});const s=new Map(e.cells.map(o=>[o.column_id,o]));return l.jsx("tr",{className:"border-subtlest border-b last:border-b-0",children:n.map(o=>l.jsx(S0t,{cell:s.get(o.column_id),column:o,columns:n,rows:t,columnRenderers:r},o.column_id))})},k0t=({table:e,variant:t="subtler",title:n,className:r,noWrapTitle:s=!1,onGroupClick:o,columnRenderers:a,headerRenderers:i})=>{const[c,u]=d.useState(e?.groups?.[0]?.group_id??""),[f,m]=d.useState(!1),{$t:p}=J();if(Rf("standings"),!e||!e.groups?.length)return null;const h=n??e.title??"Standings",g=e.groups.find(S=>S.group_id===c),y=e.groups.length>1;if(!g)return null;const x=f?g.rows:g.rows.slice(0,10),v=h0t(g.rows),b={...pue,...a},_={..._0t,...i};v&&!_[v]&&(_[v]=S=>l.jsx(K,{variant:"super",className:"inline-flex h-5 items-center rounded px-[6px] py-px",children:l.jsx(V,{variant:"micro",className:"translate-y-half uppercase tracking-wider",children:S.header_label})}));const w=e.groups.map(S=>({type:"default",text:S.title??S.group_id,onClick:()=>{u(S.group_id),o?.(S.group_id)},active:c===S.group_id,show:!0}));return l.jsx(dr,{className:r,header:l.jsxs("div",{className:"md:pl-md gap-sm sm:gap-md flex flex-col sm:flex-row sm:items-center sm:justify-between",children:[l.jsx(V,{variant:"baseSemi",className:z(s?"flex-shrink-0":void 0,"max-sm:pl-sm"),children:h}),y?l.jsx(zs,{items:w,isMobileStyle:!1,wrapperClassName:"min-w-0",children:l.jsx(Ge,{text:g.title??g.group_id,chevron:!0,size:"small",extraCSS:"w-full mb-sm"})}):l.jsx("div",{className:"invisible min-h-10"})]}),children:l.jsxs("div",{className:"rounded-inherit",children:[l.jsx("div",{className:"rounded-t-inherit overflow-hidden",children:l.jsx(nl,{orientation:"horizontal",children:l.jsxs("table",{className:"w-full table-auto border-collapse",children:[l.jsx(K,{as:"thead",variant:t==="raised"?"raisedOffset":"subtle",children:l.jsx("tr",{children:g.columns.map(S=>{const C=_[S.column_id],E=C?C(S):S.header_label;return l.jsx("th",{className:z("md:pl-md pl-sm last:px-sm md:last:px-md py-xs whitespace-nowrap align-middle",hue(S.alignment)),children:E?l.jsx(Mgt,{className:z({"w-[200px] md:w-auto":S.should_fill_width}),children:E}):null},S.column_id)})})}),l.jsx("tbody",{children:x.map(S=>l.jsx(E0t,{row:S,rows:g.rows,columns:g.columns,columnRenderers:b},S.row_id))})]})})}),g.rows.length>10&&l.jsx(K,{className:"p-xs border-t",children:l.jsx(st,{text:p(f?{id:"UOYN/MXiOT",defaultMessage:"View Less"}:{id:"wbcwKddwLa",defaultMessage:"View All"}),size:"small",fullWidth:!0,onClick:()=>m(S=>!S)})})]},g.group_id)})},gue=A.memo(()=>l.jsx("div",{children:"Error loading standings widget."}));gue.displayName="StandingsWidgetErrorFallback";const M0t=new Set,T0t=({children:e,canonicalPageLink:t})=>{const{$t:n}=J();return l.jsxs(K,{variant:"raised",className:"shadow-subtle overflow-hidden rounded-xl border",children:[e,t?l.jsx(yt,{href:t,children:l.jsxs(V,{variant:"smallBold",className:"p-sm border-subtlest flex items-center justify-center gap-0.5 border-t text-center duration-150 hover:opacity-75",color:"super",children:[n({defaultMessage:"View More",id:"QQSdHPJWXu"}),l.jsx(ut,{name:B("chevron-right"),size:18})]})}):null]})};function A0t({widgetData:e}){const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=d.useMemo(()=>e?.standings_table?e.standings_table:null,[e]);if(d.useEffect(()=>{!t||!e||!s||M0t.has(t)||r("web.frontend.sports_widget_render_time",{widgetType:"sports",widgetSubType:e.object,league:e.league,queryMode:n})},[t,s,n,e,r]),!e||!s)return null;const o=e.canonical_pages?.[0]?.url_web,a=`standings-${s.table_id??"unknown"}`;return l.jsx(Mr,{fallback:gue,children:l.jsx(Es,{widgetType:"sports",widgetName:a,children:({})=>l.jsx(T0t,{canonicalPageLink:o,children:l.jsx(k0t,{table:s,variant:"raised",className:"!rounded-none border-0"})})})})}const N0t={staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0},R0t=({event:e,team1:t,team2:n,isLive:r})=>{const s=e.datetime&&new Date(e.datetime)>new Date,o=r?t.sub_text:null,a=r?n.sub_text:null,{isMobileStyle:i}=Re(),c=d.useMemo(()=>e?.stat_columns?.map(f=>({team1:{score:f.team_1_text,scoreSuper:f.team_1_super_text,emphasis:f.team_1_emphasis,super:!1},team2:{score:f.team_2_text,scoreSuper:f.team_2_super_text,emphasis:f.team_2_emphasis,super:!1}})),[e?.stat_columns]),u=d.useMemo(()=>r?[...c??[],{team1:{score:t.text,scoreSuper:null,emphasis:!1,super:!0},team2:{score:n.text,scoreSuper:null,emphasis:!1,super:!0}}]:c,[c,r,t.text,n.text]);return s?l.jsxs("div",{className:"gap-sm pr-sm flex h-full flex-col justify-around",children:[l.jsx(V,{variant:"base",color:"ultraLight",className:"opacity-50",children:"—"}),l.jsx(V,{variant:"base",color:"ultraLight",className:"opacity-50",children:"—"})]}):c?l.jsxs("div",{className:z("gap-x-md grid h-16 auto-cols-auto grid-flow-col",{"gap-x-sm":i}),children:[u?.map((f,m)=>l.jsxs("div",{className:"gap-sm grid h-full grid-cols-subgrid",children:[l.jsx("div",{className:"flex items-center",children:l.jsxs(V,{variant:i?"smallBold":"section-title",className:"min-w-[2ch] text-center !font-mono leading-none",color:f.team1.super&&f.team1.score?"super":f.team1.emphasis?"default":"ultraLight",children:[f.team1.score??"—",f.team1.scoreSuper&&l.jsx("sup",{className:"-translate-y-sm text-2xs !font-mono tracking-tight",children:f.team1.scoreSuper})]})}),l.jsx("div",{className:"flex items-center",children:l.jsxs(V,{variant:i?"smallBold":"section-title",className:"min-w-[2ch] text-center !font-mono leading-none",color:f.team2.super&&f.team2.score?"super":f.team2.emphasis?"default":"ultraLight",children:[f.team2.score??"—",f.team2.scoreSuper&&l.jsx("sup",{className:"-translate-y-sm text-2xs !font-mono tracking-tight",children:f.team2.scoreSuper})]})})]},m)),(o||a)&&l.jsxs("div",{className:"gap-sm grid h-full grid-cols-subgrid place-items-center",children:[l.jsx(UB,{score:o}),l.jsx(UB,{score:a})]})]}):null},UB=({score:e})=>{const{isMobileStyle:t}=Re();return l.jsx(K,{variant:"superLight",className:z("px-xs flex w-full items-center justify-center rounded py-0.5",{"opacity-0":!e}),children:l.jsx(V,{variant:t?"smallBold":"section-title",color:"super",className:"flex min-w-[2ch] items-center justify-center",children:l.jsx("span",{className:"font-mono",children:e??"—"})})})},D0t=({children:e,className:t})=>l.jsx(Te.div,{layout:!0,layoutRoot:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{ease:Kr,duration:.5},className:z("p-sm isolate flex-col items-end md:flex",t),children:l.jsx("ul",{className:"-mb-xs flex w-full flex-col items-start",children:l.jsx(yg,{id:"index",children:e})})}),yue=A.memo(({extraCss:e})=>l.jsx(K,{className:`h-[12px] w-[60px] rounded-full ${e}`,variant:"subtler"}));yue.displayName="ArticleSkeletonItem";const j0t=({widgetData:e,onClick:t,highlighted:n,idx:r})=>l.jsxs("div",{className:"gap-xs pt-sm ml-6 flex items-center",onClick:t.bind(null,e.id),children:[l.jsx(V,{className:z("border-subtler bg-base relative -top-px inline-flex size-4 shrink-0 scale-[.85] items-center justify-center rounded-full border shadow-sm duration-150",{"border-foreground bg-inverse !text-inverse opacity-70":n}),variant:"smallCaps",color:"light",children:r+1}),l.jsx(V,{variant:"tiny",color:n?void 0:"light",className:z("line-clamp-1 cursor-pointer opacity-80 duration-150 hover:!opacity-100",{"!opacity-100":n}),children:e.name})]}),I0t=({highlighted:e,scrollTopOffset:t,scrollThumbHeight:n,widgets:r,loading:s})=>l.jsxs("div",{className:z("bg-base w-two absolute inset-y-0 left-0 z-[2] rounded-full",{"opacity-0 delay-1000":!e}),children:[l.jsx("div",{className:z("absolute inset-0 overflow-hidden duration-150",{"opacity-0":r.length===0||!e,"opacity-1":r.length>0}),children:l.jsx("div",{className:z("absolute left-0 top-0 w-full rounded-full",{"bg-inverse/70":s},{"bg-inverse":!s}),style:{top:`min(${t}%, calc(100% - 8px - ${n}%))`,height:n+"%"}})}),l.jsx("div",{className:"bg-inverse/10 absolute inset-0 rounded-full"})]}),xue=(e,t,n=100)=>{const s=e.getBoundingClientRect().top,o=t.clientHeight/2;return s-o<=n},P0t=({title:e,onClick:t,idx:n,onWidgetClick:r,highlighted:s=!1,isStaged:o,loading:a,id:i,widgets:c=Pe,ref:u,testId:f})=>{const m=s&&!a,[p,h]=d.useState(0),[g,y]=d.useState(0),[x,v]=d.useState(""),b=2,{entityRefs:_}=Joe(),{scrollContainerRef:w}=ka(),S=d.useRef(null),C=d.useCallback(()=>{const k=u?.current;if(k){const I=k.getBoundingClientRect().height,M=k.getBoundingClientRect().top;h(Math.max((1-(I+M)/I)*100,0))}},[u]),E=d.useMemo(()=>px(()=>{let k=[];Object.keys(_).map(I=>{_[I]?.current&&w?.current&&xue(_[I]?.current,w.current)&&(k=[...k,I])}),v(k[k.length-1]??"")},100),[v,_,w]);d.useEffect(()=>{const k=w.current;if(k)return c&&c.length>=b&&s?(k.addEventListener("scroll",E),k.addEventListener("scroll",C)):(k.removeEventListener("scroll",E),k.removeEventListener("scroll",C)),()=>{k.removeEventListener("scroll",E),k.removeEventListener("scroll",C)}},[s,E,C,c,w]),d.useEffect(()=>{const k=u?.current;if(S.current&&(S.current.disconnect(),S.current=null),k?.nodeType===Node.ELEMENT_NODE){const I=new ResizeObserver(([M])=>{if(M&&Hi(M.borderBoxSize)){const{blockSize:N}=M.borderBoxSize[0];y(window.innerHeight/N*100)}});I.observe(k),S.current=I}return()=>{S.current?.disconnect(),S.current=null}},[u,n]);const T=d.useMemo(()=>c.length>=b&&l.jsx("span",{className:"ml-xs inline-flex",children:l.jsx(ge,{icon:B("chevron-down"),size:"xs"})}),[c.length,b]);return l.jsxs(br,{as:"li",active:a,speed:"slow",className:"group relative flex select-none flex-col",children:[l.jsx(pi,{mode:"popLayout",initial:!0,children:l.jsx(Oo,{children:o&&!e?l.jsx("div",{className:"ml-md flex h-[20px] items-center",children:l.jsx(yue,{extraCss:"!w-[100px] !h-[10px]"})}):l.jsxs("div",{children:[l.jsx("div",{onClick:t.bind(null,n),"data-testid":f,children:l.jsxs(V,{variant:"small",color:m?"default":o?"ultraLight":"light",className:z("gap-xs pl-md line-clamp-2 cursor-pointer opacity-80 duration-150 group-hover:opacity-100",{"font-[450] !opacity-100":m}),children:[e,T]})}),s&&!o&&c.length>=b&&l.jsx(Te.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0,transition:{delay:.15}},exit:{opacity:0,y:-4},className:"pb-1",children:c.map((k,I)=>{const M=k.meta_data;return M.object==="ShopifyWidget"?l.jsx(j0t,{widgetData:M,onClick:r,idx:I,highlighted:!a&&x===k.meta_data?.id},k.meta_data?.id):null})},e)]})},o&&!e?"placeholder":e)}),l.jsx("div",{className:"h-sm text-inverse relative z-[5] inline-flex w-full",children:l.jsx("svg",{width:"2",height:"10",viewBox:"0 0 2 10",fill:"none",className:"inline-flex",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M2 0C2 0.552284 1.55228 1 1 1C0.447716 1 0 0.552284 0 0V10C0 9.44772 0.447716 9 1 9C1.55228 9 2 9.44772 2 10V0Z",fill:"currentColor"})})}),a&&l.jsx("div",{className:"w-two absolute inset-y-0 left-0 z-[4] animate-pulse rounded-full",children:l.jsx("div",{className:"bg-inverse absolute inset-0 opacity-10"})}),l.jsx("div",{className:z("bg-base w-two absolute inset-y-0 left-0 z-[3] opacity-0 duration-150",{"!opacity-100":o})}),c.length>=b&&l.jsx(I0t,{highlighted:s,scrollTopOffset:p,scrollThumbHeight:g,widgets:c,loading:a??!1}),s&&l.jsx(Te.div,{layoutId:"layout"+i,transition:{ease:Kr,duration:.3},className:z("bg-inverse w-two absolute inset-y-0 left-0 z-[1] rounded-full",{"!bg-inverse/70":o||a},{"opacity-0 delay-100":c.length>=b})}),l.jsx("div",{className:"bg-inverse w-two absolute inset-y-0 left-0 z-[1] rounded-full opacity-10 duration-150"})]})},O0t=({items:e,sectionRefs:t,onItemClick:n,onWidgetClick:r,className:s,id:o})=>{const[a,i]=d.useState(0),c=h=>{r?.(h)},{scrollContainerRef:u}=ka(),f=h=>{n(h)},m=d.useMemo(()=>px(()=>{if(!u?.current)return;const h=u.current;if((h?.scrollTop??0)===0){i(0);return}if(mE(h)){i(e.length-1);return}let y=[];Array.from({length:Object.keys(t).length}).map((x,v)=>{const b=t?.[v]?.current;b&&xue(b,h,0)&&(y=[...y,v])}),i(y[y.length-1]??0)},100),[t,i,e.length,u]),p=d.useCallback(()=>{m()},[m]);return d.useEffect(()=>{const h=u?.current;return h?.addEventListener("scroll",p),()=>{h?.removeEventListener("scroll",p)}},[p,u]),l.jsx(D0t,{className:s,children:e.filter(h=>h.show).map((h,g)=>l.jsx(P0t,{title:h.title,onClick:f,onWidgetClick:c,idx:g,loading:h.loading,highlighted:g===a,isStaged:h.staged,id:o,testId:h.testId,widgets:h.widgets,ref:t[g]},h.id))})},L0t=A.memo(()=>l.jsx("div",{}));L0t.displayName="MenuSectionErrorFallback";const F0t=A.memo(({children:e,entries:t,className:n,showMenu:r=!0,header:s,footer:o,variant:a="default",id:i})=>{const{isMobileStyle:c}=Re();return l.jsxs("div",{className:z(n,"mx-md mb-md max-w-threadWidth gap-x-lg md:mx-lg relative md:grid",{"grid-cols-4":a==="default","grid-cols-3":a==="twoThirds"}),children:[l.jsx("div",{className:z("space-y-md pt-md",{"col-span-3":a==="default","col-span-2":a==="twoThirds"}),children:e}),l.jsx("div",{className:z("relative",{"col-span-1 col-start-4":a==="default","col-span-1":a==="twoThirds"}),children:r&&!c&&l.jsxs("div",{className:"sticky top-0",children:[s&&l.jsx("div",{children:s}),l.jsx(vue,{entries:t,id:i}),o&&l.jsx("div",{children:o})]})})]})});F0t.displayName="WithMenu";const vue=A.memo(({entries:e,id:t})=>{const{scrollContainerRef:n}=ka();A.useEffect(()=>{const a=window.location.hash.slice(1);if(a){const i=e.find(c=>c.id===a);i?.ref.current&&VB(i.ref.current,!1,n.current)}},[e,n]);const r=d.useMemo(()=>Object.fromEntries(e.filter(a=>a.show).map((a,i)=>[i,a.ref])),[e]),s=d.useMemo(()=>e.map(a=>({title:a.title,id:a.id,loading:!1,show:a.show??!0})).filter(a=>a.show),[e]),o=d.useCallback(a=>{r[a]?.current&&VB(r[a].current,!0,n.current)},[r,n]);return l.jsx(O0t,{className:"pt-md",items:s,sectionRefs:r,onItemClick:o,id:`menu-list-${t}`})});vue.displayName="MenuList";function VB(e,t=!0,n){const r=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--header-height"))||50,s=parseFloat(window.getComputedStyle(e).marginTop),{top:o}=e.getBoundingClientRect();if(!n)return;const a=o+n.scrollTop-r-s;n.scrollTo({top:a,behavior:t?"smooth":"auto"})}const bue=A.memo(({query:e,children:t,nofollow:n=!0,sources:r,...s})=>{const o=`/search/new?q=${encodeURIComponent(e)}${r?`&sources=${r.join(",")}`:""}`,a=d.useCallback(()=>f0e({query:e}),[e]);return l.jsx(yt,{href:d0e()?void 0:o,rel:n?"nofollow":void 0,onClick:a,...s,children:t})});bue.displayName="CanonicalQuery";function B0t(e,t){return e==null?1:t==null?-1:e==null&&t==null?0:!isNaN(Number(e))&&!isNaN(Number(t))?Number(e)-Number(t):String(e).localeCompare(String(t))}const U0t=({children:e,...t})=>l.jsx("table",{...t,children:e}),V0t=({children:e,...t})=>l.jsx("tr",{...t,children:e}),H0t=({children:e,index:t,id:n,data:r,...s})=>l.jsx("td",{...s,children:l.jsx(V,{variant:"tiny",className:z({"font-normal":t}),children:e})}),z0t=({SortButton:e,children:t})=>l.jsx("th",{className:"py-sm pr-sm text-left align-text-top outline-none",children:l.jsxs(K,{className:"group relative flex items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"light",children:t}),e]})}),_ue=A.memo(function({name:t,setSortDescriptor:n}){return l.jsx("button",{className:"right-sm absolute opacity-0 transition-opacity duration-200 group-hover:opacity-100",onClick:()=>{n(r=>({...r,column:t,reverse:!r.reverse}))},children:l.jsx(V,{variant:"tiny",color:"super",children:l.jsx(ge,{icon:B("arrows-vertical"),size:"xs"})})})});_ue.displayName="SortButton";const wue=A.memo(({collapsed:e,setCollapsed:t,viewMoreText:n,viewLessText:r})=>{const s=d.useCallback(()=>{t(o=>!o)},[t]);return l.jsx(K,{className:"pb-sm",children:l.jsx(Ge,{pill:!0,variant:"border",size:"tiny",chevron:!0,chevronIcon:e?B("chevron-down"):B("chevron-up"),text:e?n:r,onClick:s})})});wue.displayName="ResponsiveTableExpander";const HB="focus-visible:outline-super focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-0",Cue=A.memo(function(t){const{data:n,columns:r,compareFunction:s,RowCell:o,HeaderCell:a,Row:i,Table:c,limit:u}=t,[f,m]=d.useState({column:void 0,reverse:!1}),p=n.at(0),h=d.useMemo(()=>r??Object.keys(p??{}).map(w=>({name:w})),[p,r]),g=s??B0t,y=d.useMemo(()=>{const w=n.map(S=>({data:S,key:S.key??Math.random().toString(36).substring(7)}));return f.column&&w.sort((S,C)=>g(S.data[f.column],C.data[f.column])*(f.reverse?-1:1)),w.slice(0,u||w.length)},[n,u,f,g]),x=a??z0t,v=c??U0t,b=i??V0t,_=o??H0t;return l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(v,{className:"w-full border-collapse",children:[l.jsx("thead",{children:l.jsx(b,{id:"_header",children:h.map((w,S)=>l.jsx(Sue,{index:S,HeaderCell:x,setSortDescriptor:m,...w},w.name))})}),l.jsx("tbody",{children:y.map(w=>l.jsx(b,{id:w.key,className:z("group",HB,"border-subtlest border-t border-dashed !outline-none first:border-solid"),children:h.map(({name:S},C)=>l.jsx(_,{id:S,index:C,data:w.data,className:z("pr-sm align-text-top last:pr-0",HB,'group-data-[selected="true"]:first:border-l-super py-sm group-data-[selected="true"]:border-super group-data-[selected="true"]:bg-super/10 group-data-[selected="true"]:first:pl-xs group-data-[selected="true"]:last:pr-xs dark:group-data-[selected="true"]:bg-super/10 rounded-sm outline-none transition-all duration-300 ease-in-out group-data-[selected="true"]:first:border-l-2 group-data-[selected="true"]:last:border-r-2'),children:String(w.data[S])},S))},w.key))})]})})});Cue.displayName="ResponsiveTable";const Sue=A.memo(({index:e,HeaderCell:t,setSortDescriptor:n,...r})=>{const s=d.useMemo(()=>l.jsx(_ue,{name:r.name,setSortDescriptor:n}),[r.name,n]);return l.jsx(t,{index:e,id:r.name,data:r,SortButton:s,children:r.label??r.name},r.name)});Sue.displayName="HeaderCellFactory";const Z5=3,cx=A.memo(({children:e})=>l.jsx(V,{variant:"tinyRegular",color:"light",children:l.jsx("time",{className:"text-nowrap",children:e})}));cx.displayName="Timestamp";const Eue=A.memo(({source:e,includeRootLink:t=!0})=>{const{$t:n}=J(),{session:r}=Ne(),{trackEvent:s}=Xe(r),o=d.useMemo(()=>({onClick(){s("click citation",{source:"hoverCard",citation_url:e.url})}}),[e.url,s]),a=d.useMemo(()=>({color:"light"}),[]);return l.jsx(df,{timestampComponent:e.timestamp?l.jsx(pf,{recentlyUpdatedLabel:n({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.timestamp,timestampProps:a,children:n({defaultMessage:"Updated",id:"xrk6zgu9jU"})}):null,linkProps:o,result:e,children:l.jsx(W0t,{url:t?e.url:void 0,children:l.jsx(Sb,{label:`${e.id}`,className:"mb-xs"})})})});Eue.displayName="Citation";const W0t=({children:e,url:t,ref:n,...r})=>t!==void 0?l.jsx(yt,{href:t,target:"_blank",rel:"noopener nofollow",ref:n,...r,children:e}):l.jsx("span",{ref:n,...r,children:e}),G0t=(e,t)=>{if(!e)return"";const n=new Date(e),r=new Date;return Math.abs(+n-+r)<1e3*60*60*24?new Intl.RelativeTimeFormat(t,{localeMatcher:"best fit",numeric:"auto",style:"long"}).format(0,"day"):n.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},kue=A.memo(({post:e})=>{const{locale:t}=J(),{isMobileStyle:n}=Re(),r=d.useMemo(()=>e.timestamp?G0t(e.timestamp,t):"",[e.timestamp,t]);return l.jsx(K,{children:l.jsx(bue,{query:e.headline,nofollow:!0,children:l.jsxs("span",{className:"group/post pb-xs cursor-pointer",children:[l.jsxs(V,{variant:n?"smallBold":"baseSemi",className:"mb-xs gap-sm flex items-baseline justify-between",children:[l.jsx("span",{className:"leading-snug duration-150",children:e.headline}),l.jsxs("div",{className:"flex translate-x-1 items-center gap-0.5",children:[e.timestamp&&!n&&l.jsx(K,{className:"gap-sm capitalize",children:l.jsx(cx,{children:r})}),l.jsx(ge,{icon:B("chevron-right"),size:"sm",className:"text-quiet group-hover/post:text-foreground translate-y-1 opacity-75 duration-150 md:translate-y-0"})]})]}),l.jsxs(V,{variant:n?"small":"base",className:"text-pretty leading-tight",children:[l.jsx("span",{className:"opacity-75",children:e.text}),l.jsx("span",{className:"ml-xs inline-flex",children:e.sources.map((s,o)=>l.jsx("span",{className:"mr-xs",children:l.jsx(Eue,{source:s,includeRootLink:!1},s.id)},o))})]}),e.timestamp&&n&&l.jsxs(K,{className:"mt-sm gap-xs flex items-center capitalize",children:[l.jsx(ut,{name:B("clock"),className:"text-quiet opacity-80",size:16}),l.jsx(cx,{children:r})]})]})})})});kue.displayName="Post";const $0t=A.memo(({created:e,posts:t,title:n,variant:r})=>{const{$t:s}=J(),[o,a]=d.useState(!0),[i,c]=d.useState(!1),{locale:u}=J(),[f,m]=d.useState(Date.now());d.useEffect(()=>{const b=setInterval(()=>m(Date.now()),15e3);return()=>clearInterval(b)},[]);const p=mi(),h=d.useMemo(()=>{if(!e||!p)return"";const b=Date.parse(e),_=f-b;let w=_/6e4,S="days";w<1?(w=_/1e3,S="seconds"):w<60?(w=_/6e4,S="minutes"):w<1440?(w=_/36e5,S="hours"):(w=_/864e5,S="days"),w=-Math.abs(Math.floor(w));const C=new Intl.RelativeTimeFormat(u,{localeMatcher:"best fit",numeric:"auto",style:"short"});return s({defaultMessage:"Updated {time}",id:"0aJxT29U/1"},{time:C.format(w,S)})},[e,f,s,u,p]),g=d.useMemo(()=>{if(!t?.length)return[];const b=t.flatMap(_=>_.sources).map(_=>[_.id,_]);return Object.values(Object.fromEntries(b))},[t]),y=d.useMemo(()=>g.map(b=>({url:b.url})),[g]),x=d.useCallback(()=>c(!0),[]),v=d.useCallback(()=>c(!1),[]);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs(K,{className:z("gap-xs px-md py-sm flex flex-wrap items-center justify-between",{"border-b":r!=="raised"}),children:[l.jsxs(V,{variant:"baseSemi",color:t.length>0?"super":"ultraLight",className:"gap-sm flex items-center",as:"h2",children:[l.jsx(Y0t,{animate:t.length>0}),l.jsx("span",{children:n??s({defaultMessage:"What's Happening",id:"wVxgwE2ray"})})]}),l.jsx(cx,{children:h})]}),l.jsxs(K,{variant:r,className:z({"rounded-xl border":r==="raised"}),children:[l.jsx(pi,{transition:{ease:Kr,duration:.2},children:l.jsx(Oo,{children:t.length===0?l.jsx(q0t,{}):l.jsx("ul",{className:"pb-md grid",children:t.slice(0,o?Z5:t.length).map((b,_)=>l.jsx(Te.li,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},transition:{y:{ease:Kr,duration:.2}},className:"mx-md border-subtlest py-md block border-b last:border-b-0 last:pb-0",children:l.jsx(kue,{post:b},_)},b.headline))})})}),t.length>0&&l.jsxs(l.Fragment,{children:[t.length>Z5&&l.jsx(K,{className:"px-md",children:l.jsx(wue,{collapsed:o,setCollapsed:a,viewMoreText:s({defaultMessage:"View More",id:"QQSdHPJWXu"}),viewLessText:s({defaultMessage:"View Less",id:"UOYN/MXiOT"})})}),l.jsx("div",{className:"pb-md pl-md",children:l.jsxs(K,{as:"button",bgHover:"subtle",className:"gap-sm px-sm inline-flex items-center rounded-full border py-1.5",onClick:x,children:[l.jsx(Eb,{sources:y,count:4}),l.jsxs(V,{variant:"tiny",color:"light",children:[g.length," Sources"]})]})})]})]})]}),i&&l.jsx(Mb,{onClose:v,webResults:g,legacyIdentifier:"citationListModal"})]})});$0t.displayName="WhatsHappening";const q0t=()=>l.jsx(br,{className:"px-md",children:l.jsx("div",{className:"divide-y",style:{maskImage:"linear-gradient(to bottom, black 50%, transparent)"},children:Array.from({length:Z5}).map((e,t)=>l.jsx(K0t,{},t))})}),K0t=()=>l.jsxs(K,{className:"gap-sm py-md flex flex-col",children:[l.jsx(K,{className:"mb-sm h-2 w-4/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-3/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-3/5 rounded-full",variant:"subtle"}),l.jsx(K,{className:"h-2 w-2/5 rounded-full",variant:"subtle"})]}),$1=(e,t)=>t?{initial:{opacity:0},animate:{opacity:1},transition:{duration:1,repeat:1/0,repeatDelay:5,ease:Kd,delay:e}}:{opacity:1},Y0t=({animate:e})=>l.jsx("svg",{viewBox:"0 0 576 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-super inline-block h-[1em] overflow-visible align-[-0.125em]",children:l.jsxs("g",{children:[l.jsx(Te.path,{d:"M99.8 69.4C110 77.8 111.4 93 103 103.2C68.6 144.7 48 197.9 48 256C48 314.1 68.6 367.3 103 408.8C111.4 419 110 434.1 99.8 442.6C89.6 451.1 74.5 449.6 66 439.4C24.8 389.6 0 325.7 0 256C0 186.3 24.8 122.4 66 72.6C74.4 62.4 89.6 61 99.8 69.4ZM476.3 69.4C486.5 61 501.6 62.4 510.1 72.6C551.3 122.4 576.1 186.4 576.1 256C576.1 325.6 551.3 389.6 510.1 439.4C501.7 449.6 486.5 451 476.3 442.6C466.1 434.2 464.7 419 473.1 408.8C507.4 367.3 528.1 314.1 528.1 256C528.1 197.9 507.5 144.7 473.1 103.2C464.7 93 466.1 77.9 476.3 69.4Z",fill:"currentColor",...$1(.3,e)}),l.jsx(Te.path,{...$1(.15,e),d:"M160 256C160 226.4 170 199.2 186.9 177.5C195 167 193.2 151.9 182.7 143.8C172.2 135.7 157.1 137.5 149 148C125.8 177.8 112 215.3 112 256C112 296.7 125.8 334.2 149 364C157.2 374.5 172.2 376.4 182.7 368.2C193.2 360 195 345 186.9 334.5C170 312.8 160 285.6 160 256Z",fill:"currentColor"}),l.jsx(Te.path,{...$1(.15,e),d:"M464 256C464 215.3 450.2 177.8 427 148C418.8 137.5 403.8 135.6 393.3 143.8C382.8 152 381 167 389.1 177.5C406 199.2 416 226.4 416 256C416 285.6 406 312.8 389.1 334.5C381 345 382.8 360.1 393.3 368.2C403.8 376.3 418.9 374.5 427 364C450.2 334.2 464 296.7 464 256Z",fill:"currentColor"}),l.jsx(Te.path,{...$1(0,e),d:"M259.716 227.716C252.214 235.217 248 245.391 248 256C248 266.609 252.214 276.783 259.716 284.284C267.217 291.786 277.391 296 288 296C298.609 296 308.783 291.786 316.284 284.284C323.786 276.783 328 266.609 328 256C328 245.391 323.786 235.217 316.284 227.716C308.783 220.214 298.609 216 288 216C277.391 216 267.217 220.214 259.716 227.716Z",fill:"currentColor"})]})}),Q0t=A.memo(({children:e,maxFaces:t=3,showMore:n=!0,clickable:r=!1,size:s="medium",onAvatarClick:o,backgroundClass:a})=>{const i=A.Children.count(e);return l.jsxs(K,{onClick:r?o:void 0,bgHover:r?"subtler":void 0,className:z("group flex items-center",{"p-xs cursor-pointer rounded-full transition-all":r}),children:[A.Children.map(e,(c,u)=>ut&&l.jsx(K,{children:l.jsxs(V,{variant:"smallCaps",color:"light",className:"px-xs",children:["+",i-t]})})]})});Q0t.displayName="AvatarList";Ft("BlazeSDKContext",{blazeSDK:null,isBlazeSDKReady:!1});fa(Iie);const Mue=A.memo(({isFollowed:e,toggleFollow:t,iconOnly:n=!1,size:r="small",selectedButtonClassName:s,unselectedButtonClassName:o,tooltip:a,variant:i})=>{const c=J(),{isMobileStyle:u}=Re();return l.jsx(St,{mode:"wait",children:e?l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Kr},children:l.jsx(Ge,{variant:i??"primaryGhost",pill:!0,size:r,text:u||n?void 0:c.formatMessage({defaultMessage:"Following",id:"cPIKU2QdyN"}),onClick:t,extraCSS:s,toolTip:a,icon:B("star-filled")})},"confirmed"):l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Kr},children:l.jsx(Ge,{pill:!0,variant:i,icon:B("plus"),size:r,text:u||n?void 0:c.formatMessage({defaultMessage:"Follow",id:"ieGrWod3CN"}),onClick:t,extraCSS:o,toolTip:a})},"follow")})});Mue.displayName="FollowButton";const X0t=be.makeEphemeralQueryKey("homepage-widgets");be.makeEphemeralQueryKey("homepage/weather");const Z0t=({watchlistType:e,identifier:t,category:n,modalOrigin:r,loginPrompt:s,reason:o})=>{const{$t:a}=J(),i=Yt(),c=Wt(),{openModal:u}=pn().legacy,[f,m]=d.useState(!1),[p,h]=d.useState(!1),{data:g,isLoading:y}=uKe({watchlistType:e,reason:o}),{mutate:x}=dKe({watchlistType:e,queryClient:i,reason:o}),{mutate:v}=fKe({watchlistType:e,queryClient:i,reason:o}),b=d.useMemo(()=>{const w=S=>{const C=S.identifier===t;return n?C&&S.categories?.includes(n):C};return!!g?.some(w)},[g,t,n]),_=d.useCallback(w=>{const{invalidateOnSuccess:S=!0}=w??{};if(m(!1),h(!1),!c){a({defaultMessage:"Sign in to follow your interests",id:"ebRSvhaBXI"}),u("loginModal",{pitchMessage:{title:s},origin:r});return}b?(v({identifier:t}),h(!0)):(x({identifier:t}),m(!0)),S&&i.invalidateQueries({queryKey:X0t})},[a,x,t,b,c,s,r,u,i,v]);return d.useMemo(()=>({isFollowed:b,toggleFollow:_,showFollowToast:f,showUnfollowToast:p,setShowFollowToast:m,setShowUnfollowToast:h,isLoadingSubscriptions:y}),[b,y,f,p,_])},J5=A.memo(({message:e,isVisible:t=!1,timeout:n,onSettingsClick:r,onTimeout:s=Ao,icon:o,...a})=>{const[i,c]=d.useState(t),u=d.useRef(null),{$t:f}=J();d.useEffect(()=>{c(t)},[t]);const m=d.useCallback(()=>{u.current&&clearTimeout(u.current)},[]),p=d.useCallback(g=>{g?.stopPropagation(),c(!1),s(),m()},[s,m]),h=n!=null&&n>0;return d.useEffect(()=>(t&&h&&(u.current=setTimeout(()=>{p()},n*1e3)),()=>{m()}),[i,n,t,s,p,m,h]),l.jsx(Xl,{children:l.jsx(St,{children:i&&l.jsx(Te.div,{className:"right-toastHMargin top-toastVMargin fixed z-30 flex items-center justify-center",initial:{opacity:0,x:6},animate:{opacity:1,x:0},exit:{opacity:0,x:6},transition:Ar,...a,children:l.jsxs(K,{variant:"raised",className:"shadow-subtle gap-sm flex items-stretch rounded-xl border pl-[12px] dark:shadow-[0_4px_12px_rgba(0,0,0,0.5)]",children:[o&&l.jsx("div",{className:"p-sm bg-subtler dark:bg-subtle my-[12px] flex aspect-square items-center justify-center rounded-md",children:l.jsx(ge,{icon:o,className:"text-quiet",size:"md"})}),l.jsxs("div",{className:"flex flex-1 flex-row items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"default",className:"pl-sm max-w-[200px] shrink-0 pr-[12px]",children:e}),l.jsxs(K,{className:"flex h-full flex-col items-stretch justify-center border-l",children:[l.jsx(st,{size:"tiny",variant:"noHover",text:f({defaultMessage:"Settings",id:"D3idYvSLF9"}),onClick:r,extraCSS:"!px-[12px] flex-1 hover:opacity-60"}),l.jsx(K,{className:"border-t"}),l.jsx(st,{size:"tiny",variant:"noHover",text:f({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:p,extraCSS:"!px-[12px] flex-1 hover:opacity-60"})]})]})]})},"toast")})})});J5.displayName="FollowConfirmationToast";const J0t=e=>!!e.extra.team_1_competitor_types?.map(n=>n.type).includes("team"),e1t=({event:e,subtitles:t,headshots:n})=>{const{locale:r}=J(),s=d.useMemo(()=>{if(!e.datetime)return null;const m=new Date(e.datetime);return isNaN(m.getTime())?null:m.toLocaleTimeString(r,{hour:"numeric",minute:"numeric",hour12:!0})},[e.datetime,r]),o=e.status==="live",a=e.status==="final",i=e.datetime&&new Date(e.datetime)>new Date,c=e.team_1.won||e.team_2.won,{isMobileStyle:u}=Re(),f=J0t(e);return l.jsxs(K,{className:"group relative",children:[l.jsx(K,{className:"bg-subtler duration-quick absolute inset-0 opacity-0 transition-opacity group-hover:opacity-50",variant:"subtle"}),l.jsxs(Zg,{href:`/sports/atp/events/${e.id}`,className:z("p-md gap-y-md relative grid w-full flex-col",{"gap-y-sm":u}),children:[l.jsxs("div",{className:"gap-md flex items-center justify-between",children:[l.jsx(V,{variant:u?"tinyRegular":"small",color:"light",children:e.title[0]}),i?l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(V,{variant:u?"tinyRegular":"small",color:"light",children:s}),l.jsx($ce,{className:"-mr-0.5"})]}):o?l.jsx(um,{className:"-mr-0.5",includeDot:!0}):a&&l.jsx(l_,{className:"-mr-0.5"})]}),l.jsxs(K,{className:"gap-lg flex w-full items-center",children:[l.jsx("div",{className:"gap-sm flex flex-1",children:l.jsxs("div",{className:z("flex flex-1 flex-col gap-[12px]",{"gap-sm":u}),children:[l.jsx(zB,{team:e.team_1,headshotImageUrl:n?.team1??null,anyWinner:c,subtitle:t?.team1,isDoubles:f,serving:e.team_1.emphasis,isLive:o}),l.jsx(zB,{team:e.team_2,headshotImageUrl:n?.team2??null,anyWinner:c,subtitle:t?.team2,isDoubles:f,serving:e.team_2.emphasis,isLive:o})]})}),l.jsx("div",{className:"flex h-full items-center justify-end",children:l.jsx(R0t,{event:e,team1:e.team_1,team2:e.team_2,isLive:o})})]})]})]})},zB=({team:e,headshotImageUrl:t,anyWinner:n,subtitle:r,isDoubles:s,serving:o,isLive:a})=>{const i=e.won,{isMobileStyle:c}=Re();return l.jsxs("div",{className:z("gap-sm flex items-center",{"opacity-30 grayscale":n&&!i}),children:[l.jsx(due,{headshotImageUrl:t??void 0,flagUrl:e.img??void 0,name:e.title??"",isCompositeFlag:s}),l.jsxs("div",{children:[l.jsxs(V,{variant:c?"smallBold":"baseSemi",className:"gap-xs flex items-center",children:[e.title,i&&l.jsx(K,{variant:"superLight",className:"p-xs ml-auto inline-flex aspect-square rounded-full",children:l.jsx(ut,{name:B("trophy"),size:12,className:"text-super"})}),o&&a&&l.jsx(ge,{icon:B("ball-tennis"),size:14,className:"text-super"})]}),typeof r=="string"?l.jsx(V,{variant:"micro",color:"light",className:"-mt-0.5",children:r}):r]})]})},t1t=async e=>{if(!e)return null;const{data:t,error:n,response:r}=await de.POST("/rest/sports/{league}/widget","sports-widget",{body:e});if(n)throw new he("API_CLIENTS_ERROR",{cause:n,details:e,status:r.status??0});return t},n1t=({data:e})=>{const{data:t}=mt({...N0t,queryKey:be.makeEphemeralQueryKey("/sports/widget",e.events.map(r=>r.id).join(",")),queryFn:()=>t1t(e.debug_fn_args),placeholderData:Wl,refetchInterval:3e4}),n=t||e;return n?.object!==e.object?null:l.jsx(tue,{canonicalPageLink:n?.canonical_pages?.[0]?.url_web,children:l.jsx("div",{className:"divide-y overflow-hidden",children:n?.events?.map(r=>l.jsx(e1t,{event:r},r.id))})})},lp=A.memo(({data:e})=>Vi(e).with({object:"SportsEventsWidget"},t=>t.league==="atp"||t.league==="wta"?l.jsx(n1t,{data:t}):l.jsx($gt,{widget:t})).with({object:"SportsStandingsWidget"},t=>l.jsx(A0t,{widgetData:t})).with({object:"SportsIndvScheduleWidget"},t=>l.jsx(m0t,{widgetData:t})).with({object:"SportsIndvEventsWidget"},t=>l.jsx(u0t,{widgetData:t})).exhaustive());lp.displayName="SportsWidget";const Tue=A.memo(({status:e})=>l.jsx(V,{as:"span",variant:"smallBold",color:e?"super":"light",children:l.jsx(ge,{icon:e?B("check"):B("x"),size:"md"})}));Tue.displayName="BoolCell";const Aue=A.memo(({url:e})=>l.jsx(yt,{href:e,target:"_blank",rel:"noopener",className:"top-xs relative inline-block transition-opacity duration-300 hover:opacity-50",children:l.jsx(ya,{color:"light",variant:"tiny",url:e,isAttachment:!1})}));Aue.displayName="LinkCell";const jy=A.memo(({text:e})=>l.jsx(V,{as:"span",variant:"tiny",className:"text-pretty break-words font-normal",children:e}));jy.displayName="TextCell";const Nue=A.memo(({tableData:e,citationOffset:t})=>{const{$t:n}=J(),{session:r}=Ne(),{trackEvent:s}=Xe(r),{data:o,column_metadata:a,search_results:i}=e,c=d.useMemo(()=>a.reduce((y,{name:x,display_name:v})=>(y[x]=v,y),{}),[a]),u=d.useMemo(()=>a.reduce((y,{name:x,display_format:v})=>(y[x]=v,y),{}),[a]),f=d.useCallback((y,x)=>y.value===null&&x.value===null?0:y.value===null?-1:x.value===null?1:typeof y.value=="string"?String(y.value).localeCompare(String(x.value)):Number(y.value)-Number(x.value),[]),m=d.useCallback(({data:y,id:x,...v})=>{const b=u[x],_=y[x]?.citation_index??null,w=_!==null?i[_]:null,S=w?.is_attachment??!1,C=y[x]?.value;let E=l.jsx(jy,{text:String(C)});return b==="url"&&(E=l.jsx(Aue,{url:String(C)})),b==="boolean"&&(E=l.jsx(Tue,{status:!!C})),b==="long_text"&&(E=l.jsx(jy,{text:String(C)})),b==="date"&&(E=l.jsx(jy,{text:String(C)})),C===null?l.jsx("td",{...v,children:l.jsx(V,{variant:"tiny",color:"ultraLight",children:l.jsx(ge,{icon:B("minus"),size:"xs"})})}):l.jsxs("td",{...v,children:[l.jsx("span",{children:E}),b!=="url"&&w&&w.url&&_!==null&&l.jsx(df,{result:w,children:l.jsx(RN,{str:`[${_+t+1}]`,href:w.url,isFile:S,isDownloadable:Yl(w),className:"citation ml-xs inline"})})]})},[i,u,t]),p=d.useMemo(()=>a.map(({name:y})=>({name:y,label:c[y],sortable:!0,resizable:!0})),[a,c]),h=toe(),g=d.useCallback(()=>{const y=a.reduce((_,w)=>(_.push(w.name),_),[]).join("-"),x=a.map(({display_name:_})=>kk.escapeCSVString(_)).join(","),v=o.map(_=>a.map(({name:w})=>kk.escapeCSVString(String(_[w]?.value))).join(",")),b=[x,...v].join(` -`);return s("clicked download table as csv",{source:"widget"}),h({csvString:b,filename:y})},[a,o,h,s]);return l.jsx(Es,{widgetType:"table",widgetName:"table",widgetSize:"full",children:l.jsxs(K,{variant:"subtler",className:"px-md pb-xs rounded-lg",children:[l.jsx(Cue,{data:o,columns:p,RowCell:m,compareFunction:f}),l.jsx(K,{className:"border-subtlest py-sm flex justify-end border-t",children:l.jsx(st,{icon:B("download"),variant:"super",onClick:g,pill:!0,size:"tiny",text:n({defaultMessage:"Export CSV",id:"TE51b7zSWC"}),toolTip:n({defaultMessage:"Download Table as CSV",id:"X3dYB0f+/Q"})})})]})})});Nue.displayName="TableWidget";const r1t=A.memo(({isOpened:e,onOpen:t,onClose:n,onEdit:r})=>{const s=J(),o=Rn(),{isMobileStyle:a}=Re(),i=d.useMemo(()=>[{type:"default",text:s.formatMessage({defaultMessage:"Edit",id:"wEQDC6Wv3/"}),onClick:r,testId:"task-widget-edit"},{type:"default",text:s.formatMessage({defaultMessage:"View Tasks",id:"L3nFsHqlqm"}),rightElement:l.jsx("div",{className:"flex items-center",children:l.jsx(ut,{name:B("chevron-right"),size:16})}),onClick:()=>{o.push("/account/tasks")},testId:"task-widget-view-tasks"}],[s,r,o]);return l.jsx(zs,{placement:"bottom-start",items:i,onOpen:t,onClose:n,isMobileStyle:a,children:l.jsx(st,{size:"tiny",icon:B("dots-vertical"),extraCSS:z("",{"!text-foreground !bg-subtle":e})})})});r1t.displayName="TaskWidgetMenu";const s1t=e=>({id:e.id,title:e.title,prompt:e.prompt,schedule:Xy(e.scheduleInfo),searchModel:e.searchModel,sources:e.sources||["web"]}),WB=(e={})=>e.prefill?e.prefill:e.initial?s1t(e.initial):{...Tye(),searchModel:ie.PRO},cp=({text:e,onClick:t,variant:n="secondary",disabled:r=!1})=>l.jsx(Ge,{text:e,onClick:t,disabled:r,testId:`task-modal-${e.toLowerCase()}-button`,variant:n==="secondary"?"common":"inverted",extraCSS:"min-w-[100px]"}),o1t=(e,t)=>e.schedule.kind==="ONCE"&&new Date(e.schedule.year,e.schedule.month,e.schedule.day,e.schedule.hour,e.schedule.minute)<=new Date(Date.now())?{ok:!1,message:t({defaultMessage:"Please schedule this task for a future time.",id:"loBg9tvLRE"})}:{ok:!0};function Rue({open:e,onClose:t,onSuccess:n,initial:r,prefill:s,errorMessage:o,source:a}){const i="task-modal",{formatMessage:c}=J(),{session:u}=Ne(),{trackEvent:f}=Xe(u),{configuredModel:m}=Vn();d.useEffect(()=>{e&&f("task modal opened",{source:a})},[e,a,f]);const[p,h]=d.useState(o),{createMutation:g,updateMutation:y,deleteMutation:x,isMutationLoading:v,invalidateAndClose:b}=gre({reason:i,source:a,onSuccess:d.useCallback(j=>{n?.(j),t?.()},[n,t]),onError:h}),_=d.useRef(r?g7(r):void 0);d.useEffect(()=>{e&&(_.current=r?g7(r):void 0)},[e,r]);const[w,S]=d.useState(()=>WB({initial:r,prefill:s})),C=d.useMemo(()=>an(w.searchModel),[w.searchModel]);d.useEffect(()=>{h(e?o:void 0)},[e,o]),d.useEffect(()=>{e&&S(WB({initial:r,prefill:s}))},[e,r,s,m]),d.useEffect(()=>{const j=Ai(C);S(F=>({...F,searchModel:j}))},[C]);const E=!!_.current,T=_.current?.status==="PAUSED",k=_.current?.status==="COMPLETED",I=j=>S(F=>({...F,...j})),M=j=>S(F=>({...F,schedule:{...F.schedule,...j}})),N=()=>{h(void 0);const j=o1t(w,c);if(!j.ok){h(j.message);return}E?y.mutate({id:_.current.id,payload:{task_name:w.title,prompt:w.prompt,schedule:mp(w.schedule),status:"ACTIVE",model_preference:w.searchModel,sources:w.sources}},{onSuccess:()=>{f("task modal action",{source:a,action:"updated"}),b("updated",_.current.id)}}):g.mutate({task_id:w.id,task_name:w.title,prompt:w.prompt,schedule:mp(w.schedule),model_preference:w.searchModel,sources:w.sources},{onSuccess:()=>{f("task modal action",{source:a,action:"created"})}})},D=d.useMemo(()=>{if(!E)return!0;const j=w.prompt!==_.current?.prompt,F=_.current.scheduleInfo,R=mp(w.schedule),P=!Cr(R.rrule,F.rrule)||!Cr(R.tzid,F.tzid),L=w.schedule.kind==="ONCE"&&R.start_at!==F.start_at,U=w.searchModel!==_.current?.searchModel,O=!Cr(w.sources||["web"],_.current?.sources||["web"]);return j||(P||L||U)||O},[E,w,_]);return l.jsx(po,{isOpen:e,onClose:t,title:c({defaultMessage:"Task",id:"0wJ7N+noSq"}),titleTextVariant:"base",modalContentClassname:"!pb-4 md:!pb-4",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsx(ib,{trigger:{type:Ze.SCHEDULED,schedule:w.schedule},prompt:w.prompt,onPromptChange:j=>I({prompt:j}),error:p}),l.jsx(X6,{schedule:w.schedule,onScheduleChange:M}),l.jsx(rb,{searchModel:w.searchModel,onSearchModelChange:j=>I({searchModel:j}),sources:w.sources||["web"],onSourcesChange:j=>I({sources:j})}),l.jsxs(K,{variant:"background",className:"mt-md pt-md -mx-md px-md flex items-center justify-between border-t",children:[E&&l.jsxs("div",{className:"flex gap-4",children:[!k&&l.jsx(cp,{text:c(T?{defaultMessage:"Resume",id:"3y9DGgura7"}:{defaultMessage:"Pause",id:"tFFMkFDBMO"}),onClick:()=>y.mutate({id:_.current.id,payload:{status:T?"ACTIVE":"PAUSED"}},{onSuccess:()=>{const j=T?"resumed":"paused";f("task modal action",{source:a,action:j}),b(j,_.current.id)}}),disabled:v}),l.jsx(cp,{text:c({defaultMessage:"Delete",id:"K3r6DQW7h+"}),onClick:()=>x.mutate(_.current.id),disabled:v})]}),l.jsxs("div",{className:"ml-auto flex gap-4",children:[l.jsx(cp,{text:c({defaultMessage:"Cancel",id:"47FYwba+bI"}),onClick:()=>t?.()}),l.jsx(cp,{text:c({defaultMessage:"Save",id:"jvo0vs3nF0"}),variant:"primary",disabled:v||!w.prompt||!D,onClick:N})]})]})]})})}const a1t=Object.freeze(Object.defineProperty({__proto__:null,FormButton:cp,default:Rue},Symbol.toStringTag,{value:"Module"})),GB=xA,Due=()=>l.jsx("div",{className:"flex flex-1 items-center justify-end opacity-50",children:l.jsx(ge,{icon:B("arrow-up-right"),size:"sm"})}),i1t={Enterprise:{trailingComponent:l.jsx(Due,{})},Tasks:{href:`${GB}/tasks`},Shortcuts:{href:`${GB}/shortcuts`}};l.jsx(Due,{});const l1t=()=>l.jsxs(br,{className:"flex w-full items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"bg-subtle size-4 shrink-0 rounded"}),l.jsx("div",{className:"bg-subtle h-4 w-32 rounded"})]}),l.jsx("div",{className:"bg-subtle h-4 w-20 rounded"})]}),jue=A.memo(({data:e})=>{const{$t:t}=J(),{suggested_prompt:n,suggested_schedule:r,widget_uuid:s}=e,o=d.useMemo(()=>({id:s,title:"",prompt:n,schedule:r?Xy(r):Gr(),searchModel:ie.PRO}),[n,r,s]),a=un(),i=d.useCallback(()=>{a.openTab({url:`${window.location.origin}${i1t.Tasks.href}`})},[a]),[c,u]=d.useState(!1),[f,m]=d.useState(!1),[p,h]=d.useState(!1),[g,y]=d.useState(null),[x,v]=d.useState(!1);d.useEffect(()=>{if(!g)return;const M=setTimeout(()=>{y(null)},2e3);return()=>clearTimeout(M)},[g]);const b=J(),{data:_,isLoading:w}=mt({queryKey:GH(s),queryFn:()=>w9e({taskId:s,reason:"task-widget"})});d.useCallback(()=>{_?.type==="ALERT"&&_?.subscription?h(!0):m(!0)},[_]),d.useMemo(()=>{if(!_)return null;if(_.type==="ALERT"&&_.subscription)return E1e({..._.subscription,event_type:_.subscription.event_type},b);const M=Xy(_.scheduleInfo);return{kind:Aye(M.kind,b),friendly:kye(M,b),isRecurring:M.kind!=="ONCE"}},[_,b]);const S=d.useMemo(()=>{if(!_)return"";if(_.type==="ALERT"&&_.subscription){const{subscription:M}=_,N=M.event_entity||"",D=M.event_type==="STOCK_PRICE_TARGET",j=M.event_type==="STOCK_PRICE_MOVEMENT";if(D){const F=M.value_upper_bound||M.value_lower_bound;if(F)return`${N} reaches $${F}`}else if(j){const F=M.value_upper_bound||0,R=M.value_lower_bound||0,P=F>0,L=R<0;if(P&&L)return`${N} moves ±${F}%`;if(P)return`${N} rises ${F}%`;if(L)return`${N} falls ${Math.abs(R)}%`}return`Price alert for ${N}`}return _.prompt},[_]);d.useMemo(()=>{if(!g)return null;const M=g==="created"?l.jsx(je,{defaultMessage:"Task created",id:"991WgJt61N"}):g==="updated"?l.jsx(je,{defaultMessage:"Task updated",id:"sQGGdcVjgL"}):g==="deleted"?l.jsx(je,{defaultMessage:"Task deleted",id:"kGP3l1jr/4"}):g==="paused"?l.jsx(je,{defaultMessage:"Task paused",id:"Ryhxeg2OIZ"}):l.jsx(je,{defaultMessage:"Task resumed",id:"fqAqWnF85q"});return l.jsx(Te.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:Kr},children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{name:B("circle-check-filled"),className:"text-super",size:16}),l.jsx(V,{variant:"small",color:"super",className:"truncate",children:M})]})},"confirmed")},[g]);const C=d.useCallback(()=>{v(!1)},[]),E=d.useCallback(()=>v(!0),[]);d.useMemo(()=>t({defaultMessage:"Task",id:"0wJ7N+noSq"}),[t]),d.useMemo(()=>l.jsx(ut,{name:B("plus"),size:12}),[]);const T=d.useCallback(()=>{m(!1),v(!1)},[]),k=d.useCallback(()=>{h(!1),v(!1)},[]),I=d.useCallback(M=>{m(!1),v(!1),y(M)},[]);return d.useCallback(()=>{u(!0)},[]),d.useCallback(()=>{u(!1)},[]),l.jsx(Es,{widgetType:"task",widgetName:"task",widgetSize:"mini",children:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"bg-subtler border-subtlest p-md group relative flex h-14 items-center justify-between gap-2 rounded-xl border transition-transform duration-200 hover:scale-[1.01] hover:transform",onMouseEnter:E,onMouseLeave:C,children:l.jsx(St,{mode:"wait",children:w?l.jsx(l1t,{}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex min-w-0 shrink items-center gap-2",children:[l.jsx("div",{className:"bg-subtle flex size-8 items-center justify-center rounded-lg",children:_?.type==="ALERT"&&_?.subscription?l.jsx(ut,{name:B("bell-bolt"),size:16,className:"text-quiet shrink-0"}):l.jsx(ut,{name:B("clock"),size:16,className:"text-quiet shrink-0"})}),l.jsx("div",{className:"flex w-full min-w-0 flex-col items-start",children:_?l.jsx(V,{variant:"small",color:"default",className:"w-full truncate",children:S}):l.jsxs(l.Fragment,{children:[l.jsx(V,{variant:"small",color:"default",className:"w-full truncate",children:n}),l.jsx(V,{variant:"tinyRegular",color:"light",className:"truncate",children:l.jsx(je,{defaultMessage:"Create a task to get this sent automatically.",id:"1AmBIpC9N9"})})]})})]}),l.jsx(st,{size:"tiny",icon:B("edit"),onClick:i})]})})}),l.jsx(Wc,{children:l.jsx(Rue,{source:"task_widget",open:f,prefill:_?void 0:o,initial:_??void 0,onClose:T,onSuccess:I})}),_&&l.jsx(Tb,{isOpen:p,onClose:k,task:_,symbol:_.subscription?.event_entity})]})})});jue.displayName="TaskWidget";const Iue=A.memo(e=>{const{data:t}=e,{menuItems:n}=sm();return l.jsx(Es,{widgetType:"time",widgetName:"time",widgetSize:"full",children:l.jsxs(K,{className:"flex w-full",children:[l.jsx(V,{children:l.jsx(K,{className:"mr-md pr-md border-r font-mono text-4xl",children:t.time})}),l.jsxs("div",{children:[l.jsx(V,{variant:"smallBold",children:t.date}),l.jsx(V,{variant:"small",color:"light",children:t.location?`${t.location}`:null})]}),n&&n.length>0&&l.jsx("div",{className:"-mr-sm -mt-sm flex grow justify-end",children:l.jsx("div",{children:l.jsx(Fn.Menu,{menuItems:n})})})]})})});Iue.displayName="TimeWidget";const Pue=A.memo(e=>{const{data:t}=e,{duration_seconds:n}=t,{menuItems:r}=sm(),{result:s}=It(),o=s?.uuid,a=d.useMemo(()=>`timer_widget_state_${o}_${n}`,[o,n]),[i,c]=d.useState(!1),[u,f]=d.useState(!1),[m,p]=d.useState(null),[h,g]=d.useState(n*1e3),[y,x]=d.useState(!0),[v,b]=d.useState(!1),_=d.useRef(void 0),w=d.useRef(void 0),S=d.useRef(!1),C=d.useRef(null);d.useEffect(()=>{if(!o)return;const j=vt.getItem(a);if(j)try{const F=JSON.parse(j),R=Date.now();if(F.status==="expired"){f(!0),g(0),p(null);return}if(F.pausedAt&&F.remainingMillis!==void 0)c(!0),g(F.remainingMillis),p(null);else if(F.endTime){const P=F.endTime-R;if(P>0)p(F.endTime),g(P),c(!1);else{g(0),p(null),f(!0);const L={status:"expired",endTime:0,remainingMillis:0};vt.setItem(a,JSON.stringify(L))}}}catch{vt.removeItem(a)}else{const F=Date.now()+n*1e3;p(F),c(!1)}},[a,n,o]),d.useEffect(()=>{if(!o||u)return;const j=i?{status:"paused",endTime:0,pausedAt:Date.now(),remainingMillis:h}:{status:"running",endTime:m||Date.now()+h};vt.setItem(a,JSON.stringify(j))},[h,i,m,a,u,o]);const E=d.useCallback(()=>{if(S.current||u)return;S.current=!0,g(0),p(null),f(!0),b(!0);const j={status:"expired",endTime:0,remainingMillis:0};vt.setItem(a,JSON.stringify(j)),!y&&C.current&&C.current.play().catch(()=>{})},[a,u,y]),T=d.useCallback(()=>{if(!i&&m){const j=Date.now(),F=m-j;F>0?(g(F),_.current=requestAnimationFrame(T)):E()}},[i,m,E]);d.useEffect(()=>{if(!i&&m&&h>0&&!u){_.current=requestAnimationFrame(T);const j=m-Date.now();j>0&&(w.current=window.setTimeout(E,j))}return()=>{_.current&&cancelAnimationFrame(_.current),w.current&&clearTimeout(w.current)}},[i,m,h,u,T,E]),d.useEffect(()=>{const j=()=>{if(!document.hidden&&!i&&m){const F=Date.now(),R=m-F;R>0?g(R):E()}};return document.addEventListener("visibilitychange",j),()=>{document.removeEventListener("visibilitychange",j)}},[i,m,E]);const k=d.useCallback(()=>{if(!u)if(i){const j=Date.now()+h;p(j),c(!1)}else c(!0),p(null)},[u,i,h]),I=d.useCallback(()=>{_.current&&(cancelAnimationFrame(_.current),_.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),S.current=!1;const j=Date.now()+n*1e3;f(!1),c(!1),g(n*1e3),p(j)},[n]),M=d.useCallback(()=>{x(j=>!j)},[]),N=d.useCallback(()=>{b(!1),C.current&&(C.current.pause(),C.current.currentTime=0)},[]),D=d.useMemo(()=>{const j=Math.ceil(h/1e3),F=Math.floor(j/3600),R=Math.floor(j%3600/60),P=Math.floor(j%60),L=R.toString().padStart(2,"0"),U=P.toString().padStart(2,"0");return F>0?`${F}:${L}:${U}`:`${L}:${U}`},[h]);return l.jsx(Es,{widgetType:"timer",widgetName:"timer",widgetSize:"full",children:l.jsxs(K,{className:z("relative flex transition-all duration-200",{"hover:scale-[1.01]":v}),children:[v&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"-m-md absolute inset-0 z-20 cursor-pointer rounded-xl",onClick:N,title:"Click anywhere to stop alarm","aria-label":"Stop alarm"}),l.jsx("div",{className:"-m-md to-attention/20 from-negative/20 absolute inset-0 animate-pulse rounded-xl bg-gradient-to-br"})]}),l.jsxs("div",{className:"relative z-10 flex w-full items-center",children:[l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Ge,{variant:"primaryGhost",size:"small",onClick:k,icon:i?B("player-play-filled"):B("player-pause-filled"),disabled:u,pill:!0}),l.jsx(Ge,{variant:"primaryGhost",size:"small",onClick:I,icon:B("rotate-clockwise"),"aria-label":"Restart timer",disabled:v,pill:!0})]}),l.jsx(V,{className:"flex-1",children:l.jsx(K,{className:`pl-lg font-mono text-2xl ${v?"text-negative":""}`,children:D})}),l.jsxs("div",{className:"gap-sm flex items-center",children:[l.jsx(bv,{cueKey:`timer-unmute-${o}`,title:"Tap to unmute",enabled:y&&!u,placement:"top",sideOffset:8,variant:"common",size:"xs",children:l.jsx(Ge,{variant:"primaryGhost",size:"small",onClick:M,icon:y?QU:YU,disabled:u,pill:!0})}),r&&r.length>0&&l.jsx(Fn.Menu,{menuItems:r})]})]}),l.jsx("audio",{ref:C,src:"https://r2cdn.perplexity.ai/Hole_In_One.wav?v=1",preload:"auto",style:{display:"none"},loop:!0})]})})});Pue.displayName="TimerWidget";function c1t(){const[e,t]=d.useState(!1),n=Ox(),r=d.useCallback(s=>{lo(BR,s.toString()),t(s)},[t]);return d.useEffect(()=>{const s=mr(BR);t(s==="true"||s===void 0&&n!=="US")},[n]),d.useMemo(()=>({prefersMetric:e,setPrefersMetric:r}),[e,r])}const u1t=130,Oue=A.memo(({day:e,icon:t,high:n,low:r,selected:s})=>l.jsxs("div",{className:"relative col-span-1",children:[s&&l.jsx(Te.div,{layoutId:"selected-forecast-item",className:"-inset-sm absolute right-0",transition:Ar,children:l.jsx("div",{className:"absolute inset-0 rounded-md bg-white opacity-10"})}),l.jsxs("div",{className:"relative flex flex-col items-start",children:[l.jsx(V,{color:"white",children:l.jsx(ge,{icon:t,size:"xl",className:"mb-xs -ml-two"})}),l.jsx(V,{variant:"smallBold",color:"white",children:e}),l.jsxs("div",{className:"mt-xs gap-x-xs flex",children:[l.jsx(V,{variant:"smallCaps",color:"white",className:"gap-x-two flex",children:l.jsxs("span",{children:[n,"°"]})}),l.jsx(V,{variant:"smallCaps",color:"white",className:"gap-x-two flex opacity-75",children:l.jsxs("span",{children:[r,"°"]})})]})]})]}));Oue.displayName="ForecastItem";const Iy=d.memo(({width:e,variant:t})=>{const[n,r]=d.useState(!1),s=t==="hail"?20:t==="normal"?25:40,o=400,a=t==="hail"?1:20,i=t==="hail"?3:t==="normal"?30:80,c=100,u=t==="hail"?.8:.5,f=t==="hail"?.3:.1,m=iA();return d.useEffect(()=>{r(!0)},[]),!n||m?null:l.jsx("div",{className:"absolute inset-0",children:Array.from({length:s}).map((p,h)=>{const g=Math.floor(Math.random()*(e-1)),y=Math.floor(Math.random()*(i-a+1))+a,x=Math.floor(Math.random()*(c+1)),v=Math.random()*(u-f)+f,b=Math.floor(Math.random()*o)+1,_=t==="hail"?y:1;return l.jsx("div",{className:"absolute inset-y-0",style:{left:g},children:l.jsx("div",{style:{opacity:v,animationDuration:o+x+"ms",animationDelay:-b+"ms",animationTimingFunction:"linear"},className:"animation-weather-rain absolute inset-y-0 will-change-transform",children:l.jsx("div",{style:{width:_,height:y,opacity:v,maskImage:t!=="hail"?"linear-gradient(to bottom, transparent, black, transparent)":void 0},className:"absolute transform-gpu rounded-full bg-white"})})},h)})})});Iy.displayName="Rain";const eM=d.memo(({width:e,height:t,variant:n})=>{const[r,s]=d.useState(!1),o=n==="normal"?50:80,a=n==="normal"?2e3:1e3,i=1,c=8,u=n==="normal"?1500:800,f=.5,m=.1,p=2,h=iA();return d.useEffect(()=>{s(!0)},[]),!r||h?null:l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("div",{className:z("absolute inset-x-0 bottom-0 translate-y-[80%] bg-white opacity-20 blur-sm",{"rounded-m blur-xs -left-xl -right-xl h-lg":n==="heavy"},{"h-md rounded-[50%]":n==="normal"})}),l.jsx(St,{children:Array.from({length:o}).map((g,y)=>{const x=Math.floor(Math.random()*(e-1)),v=Math.floor(Math.random()*(c-i+1))+i,b=Math.floor(Math.random()*(u+1)),_=Math.floor(Math.random()*p)+1,w=Math.random()*(f-m)+m,S=Math.floor(Math.random()*a)+1;return l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:3},style:{left:x,top:0,height:t},className:"absolute",children:l.jsx("div",{style:{animationDuration:a+b+"ms",animationTimingFunction:"linear",animationDelay:-S+"ms",opacity:w},className:"absolute rounded-full bg-white animation-weather-snow",children:l.jsx("div",{style:{width:v,height:v,animationDuration:"inherit",maskImage:"radial-gradient(black 20%, transparent)"},className:z("absolute rounded-full bg-white",_===1&&"animation-weather-snow-wave")})})},y)})})]})});eM.displayName="Snow";const Lue=d.memo(({width:e,height:t,context:n})=>{const[r,s]=d.useState(!1),o=70,a=2,i=1,c=2,u=500,f=1e3,m=.5,p=.2,h=iA();return d.useEffect(()=>{s(!0)},[]),!r||h?null:l.jsxs("div",{className:"absolute inset-0",children:[l.jsx(St,{children:Array.from({length:o}).map((g,y)=>{const x=Math.floor(Math.random()*(e-1)),v=Math.floor(Math.random()*(t-1)),b=Math.floor(Math.random()*(a-i+1))+i,_=Math.floor(Math.random()*c)+1,w=Math.floor(Math.random()*(u+1)),S=Math.floor(Math.random()*(f+1)),C=Math.random()*(m-p)+p;return l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:3},style:{left:x,top:v},className:"absolute",children:l.jsx("div",{style:{width:b,height:b,animationDuration:5e3+w+"ms",animationDelay:S+"ms",opacity:C},className:z("absolute rounded-full bg-white",{"animation-weather-star-twinkle":_===1})})},y)})}),l.jsx("div",{className:z("w-lg absolute left-0 h-px bg-white","animation-weather-star-shoot",{"context-ntp":n==="ntp"})})]})});Lue.displayName="Stars";const d1t=["clear-day","clear-night","partly-cloudy-day","partly-cloudy-night","cloudy-day","cloudy-night","patchy-rain-possible-day","patchy-rain-possible-night","possible-thunder-day","possible-thunder-night","overcast","fog","snow","sleet","patchy-freezing-drizzle","heavy-snow","blizzard","drizzle","hail","light-shower","heavy-rain","lightning-rain","lightning-snow"],Fue=A.memo(({variant:e,context:t,className:n})=>{const r=d.useCallback(h=>{switch(h){case"clear-day":default:return["#FF813A","#FFC700","#1F84CD"];case"partly-cloudy-day":return["#8E8E8E","#D5D5D5","#1F84CD"];case"partly-cloudy-night":return["#8E8E8E","#6A6A6A","#0B1B39"];case"cloudy-day":case"overcast":case"patchy-rain-possible-day":case"patchy-freezing-drizzle":case"drizzle":case"light-shower":case"heavy-rain":case"blizzard":case"heavy-snow":case"sleet":case"snow":case"fog":case"possible-thunder-day":case"hail":case"lightning-rain":case"lightning-snow":return["#B8B8B8","#8791AB","#486289"];case"cloudy-night":case"possible-thunder-night":case"patchy-rain-possible-night":return["#222938","#3E475A","#1B2230"];case"clear-night":return["#44344A","#091937","#091937"]}},[]),s=d.useCallback(h=>{switch(h){default:return null;case"partly-cloudy-night":case"cloudy-night":case"possible-thunder-night":case"clear-night":return"stars";case"light-shower":case"sleet":case"drizzle":case"patchy-rain-possible-night":case"patchy-rain-possible-day":case"patchy-freezing-drizzle":case"lightning-rain":return"rain";case"hail":return"rain-hail";case"heavy-rain":return"rain-heavy";case"snow":return"snow";case"heavy-snow":case"blizzard":case"lightning-snow":return"snow-heavy"}},[]),o=r(e),[a,i,c]=o,[u,{width:f,height:m}]=ti(),p=t==="ntp"?null:s(e);return l.jsxs("div",{style:{backgroundColor:c},className:z("absolute inset-0 overflow-hidden rounded-xl shadow-md",n),children:[l.jsx("div",{className:"-inset-xl absolute translate-y-1/4 rounded-[50%] opacity-75",style:{backgroundColor:i}}),l.jsx("div",{className:"-inset-xl absolute translate-y-[60%] rounded-[50%] opacity-75",style:{backgroundColor:a}}),l.jsx("div",{className:"rounded-inherit absolute inset-0 overflow-hidden",style:{backdropFilter:"blur(40px)",WebkitBackdropFilter:"blur(40px)"}}),l.jsx("div",{className:"absolute inset-0",ref:u,children:p==="stars"?l.jsx(Lue,{height:m,width:f,context:t}):p==="rain"?l.jsx(Iy,{height:m,width:f,variant:"normal"}):p==="rain-heavy"?l.jsx(Iy,{height:m,width:f,variant:"heavy"}):p==="snow"?l.jsx(eM,{height:m,width:f,variant:"normal"}):p==="snow-heavy"?l.jsx(eM,{height:m,width:f,variant:"heavy"}):p==="rain-hail"?l.jsx(Iy,{height:m,width:f,variant:"hail"}):null}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-transparent"})]})});Fue.displayName="WeatherGradient";const $B={"clear-day":XU,"clear-night":gpe,"partly-cloudy-day":C7,"partly-cloudy-night":w7,"cloudy-day":C7,"cloudy-night":w7,"patchy-rain-possible-day":hpe,"patchy-rain-possible-night":ppe,"possible-thunder-day":mpe,"possible-thunder-night":fpe,overcast:dpe,fog:upe,snow:cpe,sleet:lpe,"patchy-freezing-drizzle":ipe,"heavy-snow":ape,blizzard:ope,drizzle:spe,hail:rpe,"light-shower":npe,"heavy-rain":tpe,"lightning-rain":_7,"lightning-snow":_7},f1t=Ce(async()=>{const{HourlyTemperature:e}=await Se(()=>q(()=>import("./HourlyTemperature-Cb7yWjaM.js"),__vite__mapDeps([464,4,1,6,3,8,9,7,10,11,12])));return{default:e}},{loading:()=>l.jsx("div",{style:{height:u1t}})}),Bue=A.memo(e=>{const{$t:t}=J(),{prefersMetric:n,setPrefersMetric:r}=c1t(),s=n,[o,a]=d.useState(0),[i,c]=d.useState(!1),u=e,{menuItems:f}=sm(),{openModal:m}=pn().legacy,{permissionState:p}=Qz(),{submitQuery:h}=Ho(),{session:g}=Ne(),{trackEvent:y}=Xe(g),{locale:x}=J(),{value:v}=yge({flag:"weather-provider",defaultValue:"weatherapi",subjectType:"visitor_id"}),b=d.useCallback(()=>{y("precise location modal opened",{origin:"weather_widget"}),m("locationPermissionModal",{onPermissionGranted:N=>{c(!1);const D=ua();h({rawQuery:"weather",copilotOverride:!1,attachments:[],collection:null,newFrontendContextUUID:D,promptSource:"device_location_request",querySource:"device_location_request",deviceLocation:{latitude:N.coords.latitude,longitude:N.coords.longitude},shouldRedirectToBackendUUID:!0})},origin:"weather_widget"})},[y,m,h]);d.useEffect(()=>{p!==void 0&&p!=="granted"&&c(!0)},[p]);const _=d.useCallback(()=>{window.open(u.url||"https://www.accuweather.com/","_blank")},[u.url]);if(!u||!u.current||!u.location)return null;const{current:w,location:S,forecast:C}=u,E=C[0],T=w.condition?.icon,k=Wfe(d1t,T)?$B[T]:XU,I="col-span-1",M=o===0?w.condition?.icon||"clear-day":C[o]?.icon||"clear-day";return l.jsx(Es,{widgetType:"weather",widgetName:"weather_forecast",widgetSize:"full",children:l.jsxs(K,{className:"p-md relative select-none",children:[l.jsx(St,{initial:!1,mode:"popLayout",children:l.jsx(Te.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.3,delay:.3,ease:qa}},transition:{opacity:{duration:.2,ease:qa}},children:l.jsx(Fue,{variant:M})},M)}),l.jsxs(K,{className:"gap-md relative flex flex-col drop-shadow-sm",children:[l.jsxs("div",{className:"gap-x-xl flex",children:[l.jsx(K,{className:I,children:l.jsx("div",{className:"flex h-full items-center",children:l.jsxs(V,{className:"gap-x-md flex items-center",color:"white",children:[l.jsx(ge,{icon:k,size:40,className:"-mt-xs -ml-two"}),l.jsxs("div",{className:"flex items-baseline",children:[l.jsx("div",{className:"font-mono text-4xl",children:l.jsx(jp,{value:s?w.temp_c??0:w.temp_f??0,suffix:"°"})}),l.jsxs("div",{className:"ml-xs mt-two flex gap-px",children:[l.jsx("button",{onClick:()=>r(!1),className:"cursor-pointer appearance-none",children:l.jsx(V,{color:"white",className:s?"opacity-60":void 0,children:l.jsx("div",{className:"font-mono",children:"F"})})}),l.jsx("button",{onClick:()=>r(!0),className:"ml-xs cursor-pointer appearance-none",children:l.jsx(V,{color:"white",className:s?void 0:"opacity-60",children:l.jsx("div",{className:"font-mono",children:"C"})})})]})]})]})})}),l.jsxs(K,{className:I,children:[w.condition&&l.jsx(V,{variant:"section-title",className:"mb-1 leading-tight",color:"white",children:w.condition.text}),l.jsxs("div",{className:"gap-x-xs flex",children:[l.jsx(V,{variant:"smallCaps",color:"white",children:l.jsx(jp,{value:s?E?.maxtemp_c??0:E?.maxtemp_f??0,suffix:"°"})}),l.jsx(V,{variant:"smallCaps",className:"flex opacity-70",color:"white",children:l.jsx(jp,{value:s?E?.mintemp_c??0:E?.mintemp_f??0,suffix:"°"})})]})]})]}),l.jsxs("div",{className:"gap-sm flex",children:[l.jsxs(K,{className:"flex flex-col items-start justify-center",children:[l.jsx("div",{className:"gap-sm relative flex items-center",children:l.jsxs(ga,{className:"gap-xs text-xs text-white",children:[l.jsx(Bn,{id:"location-name",children:l.jsxs(V,{variant:"smallBold",className:"text-right",color:"white",children:[S.name,S.is_usa?S.region?`, ${S.region}`:"":`, ${S.country}`]})}),i&&l.jsx(Bn,{id:"precise",children:l.jsx(st,{onClick:b,size:"small",extraCSS:"!text-white hover:underline hover:opacity-100 !p-0 !h-0 decoration-white/50 decoration-offset-[4px] opacity-70 !font-normal",pill:!0,variant:"noBackground",text:t({defaultMessage:"Use precise location",id:"Si49wMl5CP"})})})]})}),S.localtime&&l.jsx(V,{variant:"tinyRegular",color:"white",className:"opacity-75",children:Hbe(S.localtime,x)})]}),f&&f?.length>0&&l.jsx("div",{className:"absolute right-0 top-0",children:l.jsx(Fn.Menu,{buttonClass:"!text-white opacity-40 hover:opacity-100 hover:!bg-white/10",menuItems:f})})]})]}),l.jsx(K,{className:"mt-xl relative grid grid-cols-3 gap-x-4 gap-y-6 drop-shadow-sm md:grid-cols-6",children:C.map((N,D)=>l.jsx("button",{onClick:()=>a(D),className:D!==o?"duration-150 hover:opacity-70 active:scale-[0.98]":"",children:l.jsx(Oue,{day:zbe(N.dow??"",x),high:(s?N.maxtemp_c:N.maxtemp_f)??0,low:(s?N.mintemp_c:N.mintemp_f)??0,icon:$B[N.icon],selected:o===D})},D))}),l.jsx(K,{className:"mt-sm",children:l.jsx(f1t,{forecast:C,activeDay:o,isMetric:s})}),v==="accuweather"&&l.jsx(K,{className:"mt-lg flex cursor-pointer justify-end",onClick:_,children:l.jsxs(V,{variant:"micro",color:"white",className:"mt-xs gap-xs -mb-sm -mr-xs flex items-center opacity-65 hover:opacity-40",children:["The AccuWeather",l.jsx("sup",{className:"-ml-xs",children:"®"})," Forecast",l.jsx(ge,{icon:B("arrow-up-right"),size:"xs"})]})})]})})});Bue.displayName="WeatherWidget";const qB=()=>{const{removeWidgetFromEntry:e}=lv({reason:"remove-widget"}),{$t:t}=J(),{isMobileStyle:n}=Re(),{result:r}=It(),{session:s}=Ne(),{trackEvent:o}=Xe(s),[a,i]=d.useState(!1),{openToast:c}=hn(),u=d.useCallback(()=>{if(r?.backend_uuid){const p="pplx://finance_widget";e({entryUUID:r.backend_uuid,data:{url:p,widget_type:"finance_widget",is_widget:!0}}),c({message:t({defaultMessage:"Thanks for your feedback!",id:"coh2h6fh1P"}),variant:"success",timeout:2}),o("remove widget",{url:p,entryUUID:r.backend_uuid,source:"thread"}),i(!1)}},[r?.backend_uuid,e,o,t,c]),f=d.useMemo(()=>[{type:"default",text:t({defaultMessage:"Report",id:"x5Tz6MZH82"}),icon:B("thumb-down"),onClick:()=>i(!0)}],[t]),m=d.useMemo(()=>[{text:"Cancel",variant:"common",onClick:()=>i(!1)},{text:"Report",variant:"rejected",onClick:u}],[u]);return l.jsxs(l.Fragment,{children:[l.jsx(zs,{items:f,isMobileStyle:n,wrapperClassName:"inline-flex",children:l.jsx(st,{size:"small",icon:B("dots")})}),l.jsx(po,{isOpen:a,onClose:()=>i(!1),title:t({defaultMessage:"Report Widget",id:"8bkBtXioXd"}),actionList:m,children:l.jsx("div",{className:"space-y-md",children:l.jsx(V,{variant:"base",children:t({defaultMessage:"Report this widget for being inaccurate or irrelevant. This helps improve the product for everyone.",id:"bUe9nPbALv"})})})})]})},m1t=({followed:e,toggleFollow:t,isLoading:n})=>n?null:l.jsx(Mue,{isFollowed:e,toggleFollow:t,size:"small",variant:e?"primaryGhost":"border"}),Uue=A.memo(({symbol:e,button:t,onFollowToastTimeout:n})=>{const r="finance-watch-entity",{inApp:s}=Sa(),{$t:o}=J(),{isFollowed:a,toggleFollow:i,showFollowToast:c,showUnfollowToast:u,setShowFollowToast:f,setShowUnfollowToast:m,isLoadingSubscriptions:p}=Z0t({watchlistType:"FINANCE",identifier:e,modalOrigin:ft.FINANCE_WATCHLIST,loginPrompt:"Sign in to manage your data",reason:r}),h=t||m1t,{openModal:g}=pn().legacy,y=d.useCallback(()=>{f(!1),n?.()},[n,f]),x=d.useCallback(()=>m(!1),[m]),v=d.useCallback(()=>{g("watchlistModal",{watchlistType:"FINANCE",origin:"toast"}),f(!1)},[g,f]),b=d.useCallback(()=>{g("watchlistModal",{watchlistType:"FINANCE",origin:"toast"}),m(!1)},[g,m]);return l.jsxs(l.Fragment,{children:[l.jsx(J5,{message:o({defaultMessage:"Added {symbol} to your watchlist",id:"KBhWJYPNym"},{symbol:e}),isVisible:c,timeout:5,onTimeout:y,onSettingsClick:v,icon:B("star")}),l.jsx(J5,{message:o({defaultMessage:"Removed {symbol} from your watchlist",id:"q+PA0pNibu"},{symbol:e}),isVisible:u,onSettingsClick:b,timeout:5,onTimeout:x,icon:B("star-off")}),!s&&l.jsx(h,{isLoading:p,followed:a,toggleFollow:i})]})});Uue.displayName="FinanceWatchEntity";const p1t=({followed:e,toggleFollow:t,isLoading:n})=>{const{isMobileStyle:r}=Re();return n?null:r?l.jsx(wt,{icon:e?B("star-filled"):B("star"),size:"small",variant:"text",onClick:t,"aria-label":e?"Following":"Follow"}):l.jsx(wt,{leadingIcon:e?B("star-filled"):B("star"),size:"small",variant:"text",onClick:t,children:e?"Following":"Follow"})},g0=()=>{const{firstResult:e}=on(),t=e?.status,n=e?.privacy_state,r=el(),{isIncognitoLocal:s}=G4();return d.useMemo(()=>{if(!t)return!1;const o=!!n&&(s&&n!==WS.INCOGNITO||!s&&n===WS.INCOGNITO);return!r&&t!==Pr.PENDING||o},[s,n,r,t])},h1t={variant:"secondary",size:"small"},Vue=({quote:e})=>{const{session:t}=Ne(),{trackEvent:n}=Xe(t),r=d.useCallback(()=>{n("finance link clicked",{referrer:Rb.SEARCH_WIDGET,targetPageType:Jg.ASSET_PAGE,symbol:e.symbol,destinationUrl:`/finance/${e.symbol}`})},[n,e.symbol]);return e?l.jsx(yt,{href:`/finance/${e.symbol}`,className:"gap-md hover:bg-subtler p-sm -m-sm flex cursor-pointer items-center rounded-md transition-all active:scale-95",onClick:r,children:l.jsxs(K,{className:"gap-sm flex items-center",children:[l.jsx(Xg,{symbol:e.symbol,src:e.image??"",srcDark:e.imageDark??""}),l.jsxs(K,{children:[l.jsx(K,{className:"gap-sm flex items-center",children:l.jsx(WN,{name:e.name})}),l.jsx(V,{variant:"tinyMono",color:"light",children:l.jsx(e0,{symbol:e.symbol,exchange:e.exchange,country:e.exchangeCountry})})]})]})}):null},g1t=({quotes:e})=>l.jsx(K,{className:"scrollbar-none overflow-x-auto",children:l.jsx(K,{className:"gap-md p-sm flex items-center",children:e.map(t=>l.jsx(Vue,{quote:t},t.symbol))})}),KB=({href:e,symbol:t})=>{const{isMobileStyle:n}=Re(),{$t:r}=J(),{session:s}=Ne(),{trackEvent:o}=Xe(s),a=d.useCallback(()=>{o("finance link clicked",{referrer:Rb.SEARCH_WIDGET,targetPageType:Jg.ASSET_PAGE,symbol:t,destinationUrl:e})},[o,t,e]);return l.jsx(K,{className:"gap-sm flex items-center justify-center",children:l.jsx(Ge,{variant:"primaryGhost",chevron:!0,chevronIcon:B("chevron-right"),text:r({defaultMessage:"Deep Dive on {pplxFinance}",id:"QX457HdJyA"},{pplxFinance:"Perplexity Finance"}),size:"small",href:e,onClick:a,fullWidth:n})})},YB=({children:e})=>l.jsx(K,{className:"gap-sm shadow-subtle flex flex-col rounded-xl border",variant:"background",children:e}),Hue=A.memo(({quotes:e})=>{const t=e[0],n=d.useMemo(()=>e.slice(1).map(o=>o.symbol),[e]),r=g0();if(!t)return null;const s=t.symbol;return n?.length?l.jsxs(YB,{children:[l.jsxs("div",{className:"gap-sm p-sm flex items-center justify-between",children:[l.jsx(g1t,{quotes:e}),l.jsx(K,{className:"gap-xs flex items-center",children:!r&&l.jsx(qB,{})})]}),l.jsx(fB,{symbol:s,comparisons:n,chartHeight:a0,context:"thread"}),l.jsx(K,{className:"px-sm pb-sm",children:l.jsx(KB,{href:`/finance/${t?.symbol}?comparing=${n.join(",")}`,symbol:s})})]}):l.jsxs(YB,{children:[l.jsxs(K,{className:"pt-md px-md pb-sm flex items-start justify-between",children:[l.jsx(Vue,{quote:t}),l.jsxs(K,{className:"gap-xs flex items-center",children:[!r&&l.jsx(qB,{}),l.jsx(Uue,{symbol:s,button:p1t}),l.jsx(zN,{symbol:s,buttonProps:h1t})]})]}),l.jsx(fB,{symbol:s,initialQuote:t,chartHeight:225,zoomable:!1,context:"thread"}),l.jsx(K,{className:"px-sm pb-sm",children:l.jsx(KB,{href:`/finance/${t?.symbol}`,symbol:s})})]})});Hue.displayName="FinanceThreadStockWidget";const QB=new Set,H8=A.memo(({data:e})=>{const{result:{backend_uuid:t,mode:n}}=It(),r=Mg(),s=W4();return d.useEffect(()=>{const o=e.data?.length||e.data_v2?.length;!t||!o||QB.has(t)||(r("web.frontend.finance_widgets_render_time",{widgetType:"finance",widgetName:e.data_v2?.length?"stock_v2":"stock_v1",queryMode:n,widgetSize:"full"}),QB.add(t))},[e.data,e.data_v2,t,n,r,s]),e.data_v2?.length?l.jsx(Mr,{fallback:null,onError:o=>Z.error("FinanceWidget failed to render",{cause:o}),children:l.jsx(Es,{widgetType:"finance",widgetName:"stock_v2",widgetSize:"full",children:l.jsx(Hue,{quotes:e.data_v2})})}):null});H8.displayName="FinanceWidget";const y1t=()=>null,x1t=Ce(()=>Se(()=>q(()=>import("./index-CjrpMxgd.js"),__vite__mapDeps([465,4,1,6,3,9,7,8,10,11,12]))),{loading:()=>l.jsx(y1t,{})}),zue=A.memo(({widgetData:e,menuItems:t,tableCitationOffset:n})=>{const r=Vv(e);return r?Vi(r).with({object:"CalculatorWidget"},s=>l.jsx(Fn,{menuItems:t,children:l.jsx(vae,{...s})})).with({object:"FinanceWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(H8,{data:s})})).with({object:"CrunchbaseWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(x1t,{...s})})).with({object:"PlaceWidget"},()=>null).with({object:"ShopifyWidget"},()=>null).with({object:"JobsWidget"},()=>null).with({object:"TimeWidget"},s=>l.jsx(Fn,{menuItems:t,children:l.jsx(Iue,{...s})})).with({object:"TimerWidget"},s=>l.jsx(Fn,{menuItems:t,children:l.jsx(Pue,{...s})})).with({object:"CurrencyExchangeWidget"},s=>l.jsx(Fn,{menuItems:t,className:"overflow-hidden !p-0",variant:"noChrome",children:l.jsx(oce,{...s})})).with({object:"PredictionMarketWidget"},s=>l.jsx(wce,{...s})).with({object:"WeatherWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(Bue,{...s})})).with({object:"TableWidget"},s=>l.jsx(Fn,{menuItems:t,variant:"noChrome",children:l.jsx(Nue,{tableData:s,citationOffset:n??0})})).with({object:"SportsEventsWidget"},s=>l.jsx(lp,{data:s})).with({object:"SportsIndvScheduleWidget"},s=>l.jsx(lp,{data:s})).with({object:"SportsStandingsWidget"},s=>l.jsx(lp,{data:s})).with({object:"SportsIndvEventsWidget"},s=>l.jsx(lp,{data:s})).with({object:"FlightStatusWidget"},s=>l.jsx(dce,{data:s})).with({object:"PriceComparisonWidget"},s=>l.jsx(Pst,{block:s})).with({object:"TaskWidget"},s=>l.jsx(jue,{data:s})).with({object:"GenericFallbackWidget"},s=>l.jsx(fce,{...s})).otherwise(()=>(Z.warn(new Error(`No PanelComponent found for livePanelType: ${r.object}`),{widgetData:e}),null)):null});zue.displayName="LivePanel";const Wue=A.memo(({name:e,title:t,values:n,onEntityClick:r})=>{const{inFlight:s}=on(),o=d.useCallback(c=>{s||r(c)},[s,r]),a=z("underline-offset-2 cursor-pointer decoration-subtler hover:text-super hover:decoration-super group transition-colors duration-200 ease-in-out",{underline:!s}),i=d.useCallback(({content:c,href:u})=>{const f=u||(c.startsWith("http://")||c.startsWith("https://")?c:`https://${c}`);return l.jsxs(yt,{href:f,target:"_blank",rel:"noopener",className:a,children:[c,l.jsx(V,{className:"ml-xs inline",color:"light",variant:"tiny",children:l.jsx(ge,{icon:B("external-link"),size:"xs"})})]})},[a]);return l.jsx(Fn.Item,{name:e,title:t,value:n.map((c,u)=>l.jsx(Gue,{attributeValue:c,index:u,totalValues:n.length,entityStyling:a,handleEntityClick:o,renderLink:i},`${c.id}-${u}`))},e)});Wue.displayName="WikiPanelItem";const Gue=A.memo(({attributeValue:e,index:t,totalValues:n,entityStyling:r,handleEntityClick:s,renderLink:o})=>{const a=d.useMemo(()=>()=>l.jsx("div",{children:e.value}),[e.value]),i=d.useCallback(()=>s(e.value),[e.value,s]),c=d.useMemo(()=>l.jsxs(Mr,{fallback:a,children:[e.value&&l.jsx(l.Fragment,{children:e.clickable_entity?l.jsx("span",{className:r,onClick:i,children:e.value}):e.value}),e.detail&&l.jsxs("span",{className:"text-quiet ml-1",children:["(",e.source?o({content:e.detail,href:e.source}):e.detail,")"]})]}),[e.clickable_entity,e.detail,e.source,e.value,r,a,i,o]);return l.jsxs("span",{children:[c,t{const{$t:s}=J(),{title:o,subtitle:a,attributes:i,image_url:c,source_url:u}=e,{session:f}=Ne(),{trackEvent:m}=Xe(f),{firstResult:p}=on(),h=p?.frontend_context_uuid,g=Rn(),y=i.length,[x,v]=d.useState(y),b=x===y,_=i.length>2,{menuItems:w}=sm(),S=d.useCallback(()=>{m("click toggle on knowledge card",{newState:b?"collapsed":"expanded",entryUUID:r??"",type:e.type,id:e.source_url,name:e.title}),v(M=>M===XB?y:XB)},[m,b,y,r,e]),[C,{height:E}]=ti(),T=t,k=ua(),I=d.useCallback(M=>{if(m("knowledge card link clicked",{entryUUID:r??"",type:e.type,id:e.source_url,name:e.title,label:"attributes",value:M}),n({fork:T,rawQuery:M,collection:null,newFrontendContextUUID:T?k:null,existingFrontendContextUUID:T?void 0:h,promptSource:"user",querySource:"entity_link"}),T){const N=new URLSearchParams({q:M,newFrontendContextUUID:k}),D=new URL(window.location.href);D.pathname="search/new",D.search=N.toString();const j=D.toString();g.push(j)}},[n,T,k,h,g,r,e,m]);return d.useEffect(()=>{m("knowledge card shown",{entryUUID:r??"",type:e.type,id:e.source_url,name:e.title})},[]),l.jsx("div",{className:"relative",children:l.jsx(Te.div,{animate:E>0?{height:E}:{},transition:{type:"spring",bounce:.2,duration:.2},className:"overflow-hidden",children:l.jsxs("div",{ref:C,className:"gap-md relative flex flex-col",children:[l.jsx("div",{className:"flex items-end justify-between",children:l.jsx(Fn.Title,{title:o,subtitle:a,image_url:c,href:u,links:e.links,entryUUID:r??"",data:e,children:l.jsx("div",{className:"flex items-start",children:l.jsx("div",{className:"gap-sm flex items-center",children:w&&w?.length>0&&l.jsx(Fn.Menu,{menuItems:w,buttonClass:"opacity-0 pointer-events-none"})})})})}),b&&l.jsx("div",{className:"gap-sm border-subtlest pt-md md:gap-x-md grid grid-cols-[auto,1fr] border-t",children:i.slice(0,x).map(M=>l.jsx(Wue,{name:M.key,title:M.title,values:M.values,onEntityClick:I},M.key))}),l.jsx("div",{children:_&&l.jsx("div",{className:"flex justify-end",children:l.jsx(Ge,{variant:"border",fullWidth:!0,text:s(b?{defaultMessage:"Less",id:"mFYgAXM/x4"}:{defaultMessage:"More",id:"I5NMJ8llIi"}),size:"tiny",pill:!0,onClick:S,icon:b?B("chevron-up"):B("chevron-down"),extraCSS:"pl-xs w-[76px]"})})})]})})})});$ue.displayName="WikiPanel";function v1t(e){if(!e||!e.card_type)return null;const{primaryLink:t,otherLinks:n}=e.links.reduce((s,o)=>(o.type==="PRIMARY"&&!s.primaryLink?s.primaryLink=o:s.otherLinks.push(o),s),{primaryLink:null,otherLinks:[]}),r=e?.media_items?.[0]?.image??e?.image_urls?.[0]??"";return{source_url:t?.url??"",image_url:r,title:e?.title??"",subtitle:e.description??"",attributes:e.attributes??[],type:e.card_type,links:n}}const que=A.memo(({knowledgePanelData:e,isReadonly:t,submit:n,menuItems:r,entryUUID:s,className:o})=>{const a=d.useMemo(()=>e?v1t(e):null,[e]);return a?l.jsx(Fn,{menuItems:r,className:o,children:l.jsx($ue,{data:a,submit:n,isReadonly:t,entryUUID:s??""})}):null});que.displayName="StaticPanel";const z8=A.memo(({data:e,submit:t,isReadonly:n=!1,menuItems:r,tableCitationOffset:s,entryUUID:o})=>l.jsxs(l.Fragment,{children:[!I9(e)&&D3(e)&&l.jsx(zue,{widgetData:e,menuItems:r??Pe,tableCitationOffset:s}),iMe(e)&&l.jsx(que,{knowledgePanelData:e,summaryData:null,submit:t,isReadonly:n,menuItems:r??Pe,entryUUID:o??""}),I9(e)&&l.jsx(Qoe,{graphData:e})]}));z8.displayName="ThreadEntryPanel";const Kue=A.memo(({taskWidgetData:e,submitQuery:t})=>{const{result:n,isEntryInFlight:r}=It(),s={name:"task-widget",snippet:"",timestamp:"",url:"",meta_data:e,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""};return l.jsx(z8,{data:s,submit:t,isReadonly:!1,menuItems:Pe,inFlight:r,entryUUID:n?.backend_uuid??null},"task")});Kue.displayName="TaskWidget";const b1t=25,Py="text-super",ux=A.memo(({rating:e,className:t,reviewCount:n,size:r="xs",textVariant:s="small",reviewTextVariant:o="small",reviewTextColor:a="light",variant:i,showCount:c=!0,minReviewCount:u=b1t,showRatingLabel:f=!0,ratingPosition:m="after",url:p,color:h="default"})=>{const g=Math.floor(e),y=e%1===0?0:1,x=5-g-y;if(e===0||!n||nl.jsx(ge,{icon:B("star-filled"),size:r,className:Py},`rating-star-full-${C}`)),i!=="truncated"&&Array.from({length:y}).map((S,C)=>l.jsx(Yue,{fraction:e%1,size:r},`rating-star-half-${C}`)),i!=="truncated"&&Array.from({length:x}).map((S,C)=>l.jsx("span",{className:"inline-flex opacity-20",children:l.jsx(ge,{icon:B("star-filled"),size:r,className:Py})},`rating-star-empty-${C}`))]}),_=n&&n>0&&c&&l.jsxs(V,{variant:o,color:a,className:"group-hover/link:text-super relative leading-none",children:["(",l.jsx(b7,{value:n}),")"]}),w=l.jsxs("div",{className:z("gap-xs flex items-center",t),children:[m==="before"&&v,b,m==="after"&&v,_]});return p?l.jsx(yt,{href:p,target:"_blank",className:"group/link",children:w}):w});ux.displayName="EntityItemRating";const Yue=A.memo(({fraction:e,size:t})=>l.jsxs("div",{className:"isolate inline-grid grid-cols-1 grid-rows-1",children:[l.jsx("span",{className:"text-foreground relative col-start-1 row-start-1 inline-flex items-center opacity-30",children:l.jsx("span",{className:"inline-flex",children:l.jsx(ge,{icon:B("star-filled"),size:t})})}),l.jsx("span",{className:"relative col-start-1 row-start-1 inline-flex items-center",children:l.jsx("span",{className:z(Py,"inline-flex overflow-hidden"),style:{width:e*100+"%"},children:l.jsx(ge,{icon:B("star-filled"),size:t,className:"shrink-0"})})})]}));Yue.displayName="HalfStar";const _1t=d.createContext(null);function w1t(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,s=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===s&&r===o}function Ni(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let s=null;"interactive"in r&&(s=Object.assign({},r),delete s.interactive);const o=t[r.ref];if(o){s=s||Object.assign({},r),delete s.ref;for(const a of S1t)a in o&&(s[a]=o[a])}return s||r});return{...e,layers:n}}var nU={};const rU={version:8,sources:{},layers:[]},sU={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},OS={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},oU={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},E1t=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],k1t=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class _f{constructor(t,n,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=s=>{const o=this.props[oU[s.type]];o?o(s):s.type==="error"&&console.error(s.error)},this._onPointerEvent=s=>{(s.type==="mousemove"||s.type==="mouseout")&&this._updateHover(s);const o=this.props[sU[s.type]];o&&(this.props.interactiveLayerIds&&s.type!=="mouseover"&&s.type!=="mouseout"&&(s.features=this._hoveredFeatures||this._queryRenderedFeatures(s.point)),o(s),delete s.features)},this._onCameraEvent=s=>{if(!this._internalUpdate){const o=this.props[OS[s.type]];o&&o(s)}s.type in this._deferredEvents&&(this._deferredEvents[s.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const s=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||s||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=_f.savedMaps.pop();if(!r)return null;const s=r.map,o=s.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);s._container=n,r.setProps({...t,styleDiffing:!1}),s.resize();const{initialViewState:a}=t;return a&&(a.bounds?s.fitBounds(a.bounds,{...a.fitBoundsOptions,duration:0}):r._updateViewState(a,!1)),s.isStyleLoaded()?s.fire("load"):s.once("styledata",()=>s.fire("load")),s._update(),r}_initialize(t){const{props:n}=this,{mapStyle:r=rU}=n,s={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||M1t()||null,container:t,style:tU(r)},o=s.initialViewState||s.viewState||s;if(Object.assign(s,{center:[o.longitude||0,o.latitude||0],zoom:o.zoom||0,pitch:o.pitch||0,bearing:o.bearing||0}),n.gl){const f=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=f,n.gl)}const a=new this._MapClass(s);o.padding&&a.setPadding(o.padding),n.cursor&&(a.getCanvas().style.cursor=n.cursor),this._createShadowTransform(a);const i=a._render;a._render=f=>{this._inRender=!0,i.call(a,f),this._inRender=!1};const c=a._renderTaskQueue.run;a._renderTaskQueue.run=f=>{c.call(a._renderTaskQueue,f),this._onBeforeRepaint()},a.on("render",()=>this._onAfterRepaint());const u=a.fire;a.fire=this._fireEvent.bind(this,u),a.on("resize",()=>{this._renderTransform.resize(a.transform.width,a.transform.height)}),a.on("styledata",()=>{this._updateStyleComponents(this.props,{}),ZB(a.transform,this._renderTransform)}),a.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const f in sU)a.on(f,this._onPointerEvent);for(const f in OS)a.on(f,this._onCameraEvent);for(const f in oU)a.on(f,this._onEvent);this._map=a}recycle(){this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(),_f.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=C1t(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,s=this._renderTransform,{zoom:o,pitch:a,bearing:i}=s,c=r.isMoving();c&&(s.cameraElevationReference="sea");const u=eU(s,{...JB(r.transform),...t});if(c&&(s.cameraElevationReference="ground"),u&&n){const f=this._deferredEvents;f.move=!0,f.zoom||(f.zoom=o!==s.zoom),f.rotate||(f.rotate=i!==s.bearing),f.pitch||(f.pitch=a!==s.pitch)}return c||eU(r.transform,t),u}_updateSettings(t,n){const r=this._map;let s=!1;for(const o of E1t)o in t&&!Ni(t[o],n[o])&&(s=!0,r[`set${o[0].toUpperCase()}${o.slice(1)}`]?.call(r,t[o]));return s}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:r=rU,styleDiffing:s=!0}=t,o={diff:s};return"localIdeographFontFamily"in t&&(o.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(tU(r),o),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let s=!1;return r.isStyleLoaded()&&("light"in t&&r.setLight&&!Ni(t.light,n.light)&&(s=!0,r.setLight(t.light)),"fog"in t&&r.setFog&&!Ni(t.fog,n.fog)&&(s=!0,r.setFog(t.fog)),"terrain"in t&&r.setTerrain&&!Ni(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(s=!0,r.setTerrain(t.terrain))),s}_updateHandlers(t,n){const r=this._map;let s=!1;for(const o of k1t){const a=t[o]??!0,i=n[o]??!0;Ni(a,i)||(s=!0,a?r[o].enable(a):r[o].disable())}return s}_queryRenderedFeatures(t){const n=this._map,r=n.transform,{interactiveLayerIds:s=[]}=this.props;try{return n.transform=this._renderTransform,n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}finally{n.transform=r}}_updateHover(t){const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=t.type,o=this._hoveredFeatures?.length>0,a=this._queryRenderedFeatures(t.point),i=a.length>0;!i&&o&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=a,i&&!o&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=s}else this._hoveredFeatures=null}_fireEvent(t,n,r){const s=this._map,o=s.transform,a=typeof n=="string"?n:n.type;return a==="move"&&this._updateViewState(this.props,!1),a in OS&&(typeof n=="object"&&(n.viewState=JB(o)),this._map.isMoving())?(s.transform=this._renderTransform,t.call(s,n,r),s.transform=o,s):(t.call(s,n,r),s)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;t.transform=this._renderTransform,this._onAfterRepaint=()=>{ZB(this._renderTransform,n),t.transform=n}}}_f.savedMaps=[];function M1t(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||nU.MapboxAccessToken}catch{}try{e=e||nU.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const T1t=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function A1t(e){if(!e)return null;const t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const s=t.transform;t.transform=e.transform;const o=t.project(r);return t.transform=s,o},unproject:r=>{const s=t.transform;t.transform=e.transform;const o=t.unproject(r);return t.transform=s,o},queryTerrainElevation:(r,s)=>{const o=t.transform;t.transform=e.transform;const a=t.queryTerrainElevation(r,s);return t.transform=o,a},queryRenderedFeatures:(r,s)=>{const o=t.transform;t.transform=e.transform;const a=t.queryRenderedFeatures(r,s);return t.transform=o,a}};for(const r of N1t(t))!(r in n)&&!T1t.includes(r)&&(n[r]=t[r].bind(t));return n}function N1t(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const R1t=typeof document<"u"?d.useLayoutEffect:d.useEffect,D1t=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function j1t(e,t){for(const r of D1t)r in t&&(e[r]=t[r]);const{RTLTextPlugin:n="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(n,r=>{r&&console.error(r)},!0)}const c_=d.createContext(null);function I1t(e,t){const n=d.useContext(_1t),[r,s]=d.useState(null),o=d.useRef(),{current:a}=d.useRef({mapLib:null,map:null});d.useEffect(()=>{const u=e.mapLib;let f=!0,m;return Promise.resolve(u||q(()=>import("./mapbox-gl-BYD-OPEL.js").then(p=>p.m),__vite__mapDeps([11,1,12]))).then(p=>{if(!f)return;if(!p)throw new Error("Invalid mapLib");const h="Map"in p?p:p.default;if(!h.Map)throw new Error("Invalid mapLib");if(j1t(h,e),!h.supported||h.supported(e))e.reuseMaps&&(m=_f.reuse(e,o.current)),m||(m=new _f(h.Map,e,o.current)),a.map=A1t(m),a.mapLib=h,s(m),n?.onMapMount(a.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(p=>{const{onError:h}=e;h?h({type:"error",target:null,error:p}):console.error(p)}),()=>{f=!1,m&&(n?.onMapUnmount(e.id),e.reuseMaps?m.recycle():m.destroy())}},[]),R1t(()=>{r&&r.setProps(e)}),d.useImperativeHandle(t,()=>a.map,[r]);const i=d.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),c={height:"100%"};return d.createElement("div",{id:e.id,ref:o,style:i},r&&d.createElement(c_.Provider,{value:a},d.createElement("div",{"mapboxgl-children":"",style:c},e.children)))}const P1t=d.forwardRef(I1t),O1t=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function _u(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const s=t[r];Number.isFinite(s)&&!O1t.test(r)?n[r]=`${s}px`:n[r]=s}}const L1t=d.memo(d.forwardRef((e,t)=>{const{map:n,mapLib:r}=d.useContext(c_),s=d.useRef({props:e});s.current.props=e;const o=d.useMemo(()=>{let y=!1;d.Children.forEach(e.children,b=>{b&&(y=!0)});const x={...e,element:y?document.createElement("div"):null},v=new r.Marker(x);return v.setLngLat([e.longitude,e.latitude]),v.getElement().addEventListener("click",b=>{s.current.props.onClick?.({type:"click",target:v,originalEvent:b})}),v.on("dragstart",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDragStart?.(_)}),v.on("drag",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDrag?.(_)}),v.on("dragend",b=>{const _=b;_.lngLat=o.getLngLat(),s.current.props.onDragEnd?.(_)}),v},[]);d.useEffect(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);const{longitude:a,latitude:i,offset:c,style:u,draggable:f=!1,popup:m=null,rotation:p=0,rotationAlignment:h="auto",pitchAlignment:g="auto"}=e;return d.useEffect(()=>{_u(o.getElement(),u)},[u]),d.useImperativeHandle(t,()=>o,[]),(o.getLngLat().lng!==a||o.getLngLat().lat!==i)&&o.setLngLat([a,i]),c&&!w1t(o.getOffset(),c)&&o.setOffset(c),o.isDraggable()!==f&&o.setDraggable(f),o.getRotation()!==p&&o.setRotation(p),o.getRotationAlignment()!==h&&o.setRotationAlignment(h),o.getPitchAlignment()!==g&&o.setPitchAlignment(g),o.getPopup()!==m&&o.setPopup(m),zh.createPortal(e.children,o.getElement())}));function aU(e){return new Set(e?e.trim().split(/\s+/):[])}d.memo(d.forwardRef((e,t)=>{const{map:n,mapLib:r}=d.useContext(c_),s=d.useMemo(()=>document.createElement("div"),[]),o=d.useRef({props:e});o.current.props=e;const a=d.useMemo(()=>{const i={...e},c=new r.Popup(i);return c.setLngLat([e.longitude,e.latitude]),c.once("open",u=>{o.current.props.onOpen?.(u)}),c},[]);if(d.useEffect(()=>{const i=c=>{o.current.props.onClose?.(c)};return a.on("close",i),a.setDOMContent(s).addTo(n.getMap()),()=>{a.off("close",i),a.isOpen()&&a.remove()}},[]),d.useEffect(()=>{_u(a.getElement(),e.style)},[e.style]),d.useImperativeHandle(t,()=>a,[]),a.isOpen()&&((a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!Ni(a.options.offset,e.offset)&&a.setOffset(e.offset),(a.options.anchor!==e.anchor||a.options.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth)),a.options.className!==e.className)){const i=aU(a.options.className),c=aU(e.className);for(const u of i)c.has(u)||a.removeClassName(u);for(const u of c)i.has(u)||a.addClassName(u);a.options.className=e.className}return zh.createPortal(e.children,s)}));function y0(e,t,n,r){const s=d.useContext(c_),o=d.useMemo(()=>e(s),[]);return d.useEffect(()=>{const a=t,i=null,c=typeof t=="function"?t:null,{map:u}=s;return u.hasControl(o)||(u.addControl(o,a?.position),i&&i(s)),()=>{c&&c(s),u.hasControl(o)&&u.removeControl(o)}},[]),o}function F1t(e){const t=y0(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return d.useEffect(()=>{_u(t._container,e.style)},[e.style]),null}d.memo(F1t);function B1t(e){const t=y0(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return d.useEffect(()=>{_u(t._controlContainer,e.style)},[e.style]),null}d.memo(B1t);function U1t(e,t){const n=d.useRef({props:e}),r=y0(({mapLib:s})=>{const o=new s.GeolocateControl(e),a=o._setupUI.bind(o);return o._setupUI=i=>{o._container.hasChildNodes()||a(i)},o.on("geolocate",i=>{n.current.props.onGeolocate?.(i)}),o.on("error",i=>{n.current.props.onError?.(i)}),o.on("outofmaxbounds",i=>{n.current.props.onOutOfMaxBounds?.(i)}),o.on("trackuserlocationstart",i=>{n.current.props.onTrackUserLocationStart?.(i)}),o.on("trackuserlocationend",i=>{n.current.props.onTrackUserLocationEnd?.(i)}),o},{position:e.position});return n.current.props=e,d.useImperativeHandle(t,()=>r,[]),d.useEffect(()=>{_u(r._container,e.style)},[e.style]),null}d.memo(d.forwardRef(U1t));function V1t(e){const t=y0(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return d.useEffect(()=>{_u(t._container,e.style)},[e.style]),null}const H1t=d.memo(V1t);function z1t(e){const t=y0(({mapLib:o})=>new o.ScaleControl(e),{position:e.position}),n=d.useRef(e),r=n.current;n.current=e;const{style:s}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),d.useEffect(()=>{_u(t._container,s)},[s]),null}d.memo(z1t);const W1t=A.memo(e=>{const{$t:t}=J(),{isLoading:n,onClick:r,...s}=e;return l.jsx(K,{className:"right-sm top-sm absolute z-30 rounded-full border-2",children:l.jsx(Ge,{pill:!0,size:"tiny",variant:"inverted",icon:B("current-location"),isLoading:n,text:t(n?{defaultMessage:"Searching...",id:"NNQzoiiDEK"}:{defaultMessage:"Search here",id:"Yi0/yIKDMQ"}),onClick:r,...s})})});W1t.displayName="MapSearchHereButton";const Que=A.memo(()=>l.jsx("svg",{className:"h-auto w-full",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 4635.92 708.22",children:l.jsx("path",{d:"M4806.79,746.44a25,25,0,1,0,25,25A25,25,0,0,0,4806.79,746.44Zm0,46.08a21.08,21.08,0,1,1,21.08-21.07A21.09,21.09,0,0,1,4806.79,792.52Zm8.12-25.33c0-4.55-3.25-7.25-8-7.25h-8v22.77h3.94v-8.26h4.26l4.13,8.26h4.23L4811,773.6A6.59,6.59,0,0,0,4814.91,767.19Zm-8.16,3.78h-3.87v-7.55h3.87c2.63,0,4.23,1.33,4.23,3.77S4809.38,771,4806.75,771ZM569.17,605.31a97.95,97.95,0,1,1-97.94-97.94A97.94,97.94,0,0,1,569.17,605.31Zm552.18,0a97.95,97.95,0,1,1-97.95-97.94A97.95,97.95,0,0,1,1121.35,605.31ZM1099,304.09C998.87,235.77,878,195.89,747.32,195.89a619.47,619.47,0,0,0-351,108.2H195.89l90.17,98.12a274.9,274.9,0,0,0-89.89,203.66c0,152.19,123.38,275.57,275.57,275.57A274.54,274.54,0,0,0,659,808l88.34,96.12L835.66,808a274.54,274.54,0,0,0,187.23,73.4c152.19,0,275.68-123.38,275.68-275.57a274.9,274.9,0,0,0-89.89-203.66l90.17-98.12ZM471.74,792.36c-103,0-186.49-83.49-186.49-186.49s83.5-186.49,186.49-186.49,186.5,83.49,186.5,186.49S574.74,792.36,471.74,792.36ZM747.37,600.5c0-122.73-89.26-228-207-273.06a538.15,538.15,0,0,1,413.93,0C836.62,372.49,747.37,477.78,747.37,600.5Zm462,5.37c0,103-83.5,186.49-186.49,186.49s-186.5-83.49-186.5-186.49,83.5-186.49,186.5-186.49S1209.38,502.87,1209.38,605.87Zm654.11-173.45h43.37v85.84h-50.75c-39.09,0-64.17,19.18-64.17,58.28V792.36h-92.78V432.42h92.78V492.9C1800.05,450.12,1829.56,432.42,1863.49,432.42Zm186.35-85.59a56.06,56.06,0,0,1-112.12,0c0-31.72,24.34-56.8,56.06-56.8S2049.84,315.11,2049.84,346.83Zm-102.33,85.59H2040V792.36h-92.53Zm347.35-6.08a179,179,0,0,0-109.22,36.52V432.42h-92.52V898h92.52V761.92a179,179,0,0,0,109.22,36.52c102.76,0,186-83.3,186-186.05S2397.62,426.34,2294.86,426.34Zm-8.15,287.12a101.07,101.07,0,1,1,101.07-101.07A101.07,101.07,0,0,1,2286.71,713.46Zm1890.57-34.8c0,69.4-59.54,119.78-141.57,119.78-85.12,0-144.57-51.57-144.57-125.42v-2h90.54v2c0,30.82,22,51.53,54.78,51.53,31.42,0,52.53-15.33,52.53-38.14,0-21.61-14.61-33.69-53.89-44.56l-51.71-14.1c-54.34-14.71-85.5-50.12-85.5-97.14,0-60.42,57-104.27,135.57-104.27,79.3,0,132.58,43.88,132.58,109.21v2.05h-85.3v-2.05c0-22.18-20.77-39.55-47.28-39.55-27.84,0-47.28,12.78-47.28,31.09,0,18.76,13.84,29.66,49.36,38.91l54,14.81C4162.05,600.16,4177.28,644.7,4177.28,678.66Zm-1368-215.8A179,179,0,0,0,2700,426.34c-102.76,0-186.05,83.3-186.05,186.05S2597.26,798.44,2700,798.44a179,179,0,0,0,109.22-36.52v30.44h92.52V432.42h-92.52Zm0,149.54a101.07,101.07,0,1,1-101.07-101.08A101.08,101.08,0,0,1,2809.24,612.4ZM3236,462.86a179,179,0,0,0-109.22-36.52c-102.75,0-186.05,83.3-186.05,186.05s83.3,186.05,186.05,186.05A179,179,0,0,0,3236,761.92v30.44h92.53V304.3H3236Zm-101.06,250.6A101.07,101.07,0,1,1,3236,612.39,101.07,101.07,0,0,1,3134.89,713.46Zm623.34-281h92.53V792.36h-92.53Zm102.33-85.59a56.06,56.06,0,1,1-112.12,0c0-31.72,24.34-56.8,56.06-56.8S3860.56,315.11,3860.56,346.83Zm530.71,79.51c-102.75,0-186.05,83.3-186.05,186.05s83.3,186.05,186.05,186.05,186-83.3,186-186.05S4494,426.34,4391.27,426.34Zm0,287.12a101.07,101.07,0,1,1,101.07-101.07A101.06,101.06,0,0,1,4391.27,713.46ZM1744.55,386.87H1613.14V792.36h-92.22V386.87H1389.51V304.3h355Zm1877.76,45.55h97.21L3595.31,792.36H3484L3360.47,432.42h97.2L3540,693.79Zm1162.19,0h43.37v85.84h-50.75c-39.09,0-64.18,19.18-64.18,58.28V792.36h-92.77V432.42h92.77V492.9C4721.06,450.12,4750.57,432.42,4784.5,432.42Z",transform:"translate(-195.89 -195.89)",fill:"currentColor"})}));Que.displayName="TripadvisorLogo";const Xue=A.memo(()=>l.jsxs("svg",{className:"h-auto w-full",viewBox:"0 0 1000 385",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M806.495 227.151L822.764 223.392C823.106 223.313 823.671 223.183 824.361 222.96C828.85 221.753 832.697 218.849 835.091 214.862C837.485 210.874 838.241 206.113 837.198 201.582C837.175 201.482 837.153 201.388 837.13 201.289C836.596 199.117 835.66 197.065 834.37 195.239C832.547 192.926 830.291 190.991 827.728 189.542C824.711 187.82 821.553 186.358 818.289 185.171L800.452 178.659C790.441 174.937 780.432 171.309 770.328 167.771C763.776 165.439 758.224 163.393 753.4 161.901C752.49 161.62 751.485 161.34 750.669 161.058C744.837 159.271 740.739 158.53 737.272 158.505C734.956 158.42 732.649 158.841 730.511 159.738C728.283 160.699 726.282 162.119 724.639 163.906C723.822 164.835 723.054 165.806 722.337 166.815C721.665 167.843 721.049 168.907 720.491 170.001C719.876 171.174 719.348 172.391 718.911 173.642C715.6 183.428 713.951 193.7 714.032 204.029C714.091 213.368 714.342 225.354 719.475 233.479C720.712 235.564 722.372 237.366 724.348 238.769C728.004 241.294 731.7 241.627 735.544 241.904C741.289 242.316 746.855 240.905 752.403 239.623L806.45 227.135L806.495 227.151Z",fill:"currentColor"}),l.jsx("path",{d:"M987.995 140.779C983.553 131.457 977.581 122.947 970.328 115.601C969.39 114.669 968.385 113.806 967.321 113.02C966.339 112.283 965.318 111.598 964.264 110.967C963.18 110.373 962.065 109.837 960.924 109.362C958.668 108.476 956.25 108.077 953.829 108.19C951.513 108.322 949.254 108.956 947.207 110.049C944.105 111.591 940.748 114.07 936.283 118.221C935.666 118.834 934.891 119.525 934.195 120.177C930.511 123.641 926.413 127.911 921.536 132.883C914.002 140.497 906.583 148.152 899.21 155.89L886.017 169.571C883.601 172.071 881.401 174.771 879.441 177.643C877.771 180.07 876.59 182.799 875.963 185.678C875.6 187.886 875.653 190.142 876.12 192.329C876.143 192.429 876.164 192.523 876.187 192.622C877.229 197.154 879.988 201.103 883.883 203.637C887.778 206.172 892.505 207.094 897.068 206.211C897.791 206.106 898.352 205.982 898.693 205.898L969.033 189.646C974.576 188.365 980.202 187.191 985.182 184.3C988.522 182.363 991.699 180.443 993.878 176.569C995.043 174.441 995.748 172.092 995.948 169.675C997.027 160.089 992.021 149.202 987.995 140.779Z",fill:"currentColor"}),l.jsx("path",{d:"M862.1 170.358C867.197 163.955 867.184 154.41 867.64 146.607C869.174 120.536 870.79 94.4619 872.07 68.3766C872.56 58.4962 873.624 48.7498 873.036 38.7944C872.552 30.5816 872.492 21.1521 867.307 14.4122C858.154 2.52688 838.636 3.50371 825.319 5.34732C821.239 5.91358 817.153 6.6749 813.099 7.64807C809.045 8.62124 805.033 9.6841 801.108 10.9412C788.329 15.127 770.365 22.8103 767.323 37.5341C765.608 45.858 769.672 54.3727 772.824 61.9691C776.645 71.1774 781.865 79.4721 786.622 88.1401C799.198 111.024 812.008 133.765 824.782 156.53C828.597 163.326 832.755 171.933 840.135 175.454C840.623 175.667 841.121 175.856 841.628 176.018C844.937 177.272 848.545 177.513 851.993 176.712C852.201 176.664 852.405 176.617 852.608 176.57C855.792 175.704 858.675 173.973 860.937 171.568C861.345 171.185 861.734 170.782 862.1 170.358Z",fill:"currentColor"}),l.jsx("path",{d:"M855.997 240.155C854.008 237.355 851.184 235.258 847.931 234.162C844.677 233.065 841.16 233.027 837.881 234.051C837.111 234.307 836.361 234.618 835.636 234.983C834.515 235.554 833.445 236.221 832.439 236.976C829.507 239.148 827.039 241.97 824.791 244.8C824.221 245.522 823.7 246.483 823.022 247.1L811.708 262.663C805.295 271.382 798.971 280.123 792.7 289.003C788.608 294.735 785.068 299.576 782.273 303.859C781.743 304.666 781.193 305.567 780.689 306.284C777.338 311.469 775.441 315.252 774.467 318.622C773.735 320.862 773.503 323.234 773.788 325.572C774.1 328.008 774.92 330.35 776.195 332.447C776.873 333.499 777.604 334.516 778.385 335.495C779.196 336.436 780.058 337.332 780.966 338.18C781.936 339.105 782.973 339.957 784.07 340.729C791.879 346.162 800.428 350.066 809.421 353.083C816.904 355.567 824.682 357.053 832.555 357.504C833.894 357.572 835.237 357.543 836.572 357.417C837.809 357.309 839.04 357.136 840.26 356.9C841.479 356.615 842.681 356.266 843.863 355.853C846.162 354.993 848.255 353.66 850.008 351.94C851.667 350.279 852.944 348.276 853.749 346.07C855.057 342.81 855.917 338.671 856.483 332.526C856.532 331.652 856.657 330.604 856.744 329.644C857.19 324.545 857.395 318.556 857.723 311.514C858.276 300.685 858.71 289.903 859.053 279.09C859.053 279.09 859.782 259.875 859.78 259.865C859.946 255.437 859.81 250.53 858.582 246.121C858.042 244.008 857.17 241.994 855.997 240.155V240.155Z",fill:"currentColor"}),l.jsx("path",{d:"M983.707 270.24C981.346 267.651 978 265.069 972.722 261.878C971.961 261.453 971.068 260.886 970.244 260.392C965.85 257.749 960.557 254.969 954.374 251.611C944.876 246.396 935.372 241.312 925.778 236.271L908.825 227.28C907.946 227.024 907.053 226.389 906.225 225.989C902.968 224.432 899.516 222.978 895.932 222.311C894.697 222.074 893.444 221.944 892.186 221.923C891.375 221.913 890.565 221.962 889.761 222.07C886.371 222.595 883.234 224.178 880.795 226.591C878.356 229.005 876.74 232.128 876.178 235.513C875.919 237.667 875.998 239.847 876.411 241.976C877.24 246.487 879.254 250.95 881.338 254.858L890.391 271.824C895.428 281.394 900.526 290.907 905.752 300.391C909.123 306.578 911.929 311.871 914.557 316.26C915.055 317.085 915.62 317.974 916.046 318.738C919.245 324.013 921.815 327.333 924.421 329.715C926.109 331.345 928.132 332.586 930.349 333.351C932.68 334.124 935.146 334.398 937.59 334.155C938.832 334.008 940.066 333.795 941.286 333.516C942.488 333.193 943.672 332.808 944.833 332.362C946.087 331.889 947.305 331.327 948.478 330.678C955.36 326.82 961.703 322.07 967.345 316.552C974.112 309.894 980.093 302.633 984.745 294.321C985.392 293.145 985.952 291.924 986.422 290.667C986.86 289.504 987.24 288.319 987.558 287.118C987.834 285.896 988.045 284.662 988.191 283.418C988.422 280.977 988.138 278.514 987.358 276.19C986.591 273.963 985.345 271.932 983.707 270.24V270.24Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M400.03 105.19C400.03 91.2089 411.42 79.7877 425.167 79.7877C438.717 79.7877 449.714 91.2089 450.303 105.387V303.682C450.303 317.663 438.913 329.084 425.167 329.084C411.027 329.084 400.03 317.663 400.03 303.682V105.19ZM376.657 227.672C376.461 231.61 375.479 238.896 370.373 244.213C364.874 249.923 357.412 251.302 353.092 251.302C335.123 251.4 317.155 251.45 299.187 251.499C281.218 251.548 263.248 251.597 245.279 251.696C246.85 256.619 249.992 264.101 257.062 270.994C261.382 275.129 265.506 277.492 267.273 278.476C269.434 279.855 276.896 283.793 286.126 283.793C295.945 283.793 304.586 280.642 313.03 276.31L313.736 275.945C319.604 272.904 325.66 269.766 332.079 268.631C338.363 267.646 345.04 268.827 349.949 273.16C355.841 278.279 358.197 285.762 356.037 293.442C353.484 302.106 346.218 309.589 338.559 314.118C334.239 316.678 329.526 318.844 324.813 320.617C318.725 322.783 312.441 324.358 306.157 325.343C299.872 326.327 293.392 326.721 286.911 326.524H286.911C283.769 326.524 280.431 326.524 277.092 326.13C273.558 325.736 270.023 324.949 266.684 324.161C261.186 322.98 256.08 321.207 250.974 318.844C246.064 316.678 241.155 313.921 236.638 310.771C232.121 307.62 227.997 303.879 224.07 299.94C220.338 296.002 216.804 291.67 213.662 286.944C203.057 270.797 198.147 250.908 199.129 231.61C199.915 212.706 206.199 193.802 217.589 178.443C218.823 176.519 220.247 174.883 221.596 173.333C222.18 172.663 222.75 172.008 223.284 171.354C237.35 154.158 256.142 148.716 263.894 146.471L264.328 146.345C286.519 140.044 304.978 144.179 312.441 146.345C316.172 147.33 337.185 153.828 353.484 171.354C354.27 172.141 356.43 174.701 359.179 178.443C369.505 192.508 373.066 205.605 374.272 210.042L374.301 210.146C375.479 214.478 376.657 220.386 376.657 227.672ZM261.382 195.181C249.992 204.436 246.85 216.251 246.064 219.992H331.686C330.901 216.448 327.562 204.436 316.172 195.181C304.586 185.925 292.41 185.335 288.679 185.335C284.948 185.335 272.772 185.925 261.382 195.181ZM586.98 142.998C564.593 142.998 544.169 153.041 529.637 169.385V168.794C529.048 155.6 518.05 144.967 504.696 144.967C490.753 144.967 479.56 156.191 479.56 170.172V359.409C479.56 373.391 490.753 384.615 504.696 384.615C518.64 384.615 529.833 373.391 529.833 359.409V352.123V300.334C544.365 316.482 564.593 326.721 587.176 326.721C632.147 326.721 668.674 285.959 668.674 235.155C668.478 184.35 631.951 142.998 586.98 142.998ZM575.983 285.566C550.453 285.566 529.637 263.314 529.637 235.549C529.637 207.586 550.257 185.335 575.983 185.335C601.512 185.335 622.328 207.586 622.328 235.549C622.132 263.314 601.512 285.566 575.983 285.566ZM161.425 248.348L153.177 266.464C149.446 274.341 145.715 282.415 142.18 290.488C141.052 292.966 139.916 295.494 138.764 298.057C123.068 332.981 104.44 374.43 63.8242 383.236C44.1861 387.568 14.5327 381.661 3.5354 363.15C-7.4619 344.443 8.83767 322.979 29.8504 327.902C33.1646 328.641 36.4235 330.266 39.7101 331.904C45.187 334.635 50.7406 337.404 56.7545 336.173C62.4495 335.188 65.9844 331.053 70.5011 325.736C76.7853 318.45 79.5346 310.771 80.7129 306.242C80.6147 306.045 80.5165 305.798 80.4183 305.552C80.3201 305.306 80.2219 305.06 80.1237 304.863C75.0117 295.326 70.5473 286.8 66.8178 279.677C64.3868 275.034 62.2681 270.987 60.4857 267.646C56.8287 260.714 54.0662 255.473 51.918 251.398C45.6449 239.497 44.609 237.532 41.8296 232.398C35.7418 220.78 29.2612 209.555 22.5843 198.331C15.3182 186.122 7.85577 172.535 13.9436 158.16C18.8531 146.542 31.4214 140.634 43.4006 144.376C56.0403 148.212 61.6377 160.239 66.8724 171.487C67.8188 173.52 68.7534 175.528 69.7156 177.458C78.16 194.196 86.4079 210.934 94.6559 227.672C95.382 229.336 96.4917 231.605 97.8402 234.362C99.0447 236.824 100.44 239.676 101.922 242.834C102.697 244.475 103.434 246.002 104.101 247.382C104.954 249.149 105.691 250.676 106.242 251.892C110.072 242.342 113.95 232.841 117.829 223.34C121.707 213.839 125.586 204.337 129.415 194.787C129.522 194.253 130.436 192.216 131.813 189.145C132.977 186.549 134.473 183.215 136.092 179.427C136.64 178.133 137.191 176.79 137.755 175.417C142.856 162.995 148.988 148.06 162.604 143.982C172.423 141.028 183.42 144.967 189.115 153.237C192.061 157.372 193.239 162.098 193.435 166.824C193.593 177.275 188.545 188.491 184.212 198.115C183.157 200.459 182.144 202.708 181.26 204.829C181.219 204.91 181.048 205.296 180.739 205.988C179.541 208.679 176.278 216.005 170.655 228.066C168.626 232.389 166.679 236.713 164.707 241.09C163.626 243.491 162.538 245.907 161.425 248.348Z",fill:"currentColor"}),l.jsx("path",{d:"M687.728 310.153H689.549C690.447 310.153 691.167 309.923 691.706 309.462C692.256 308.99 692.532 308.395 692.532 307.676C692.532 306.833 692.29 306.232 691.807 305.872C691.324 305.502 690.56 305.316 689.515 305.316H687.728V310.153ZM695.043 307.608C695.043 308.507 694.801 309.305 694.318 310.002C693.846 310.687 693.178 311.198 692.313 311.535L696.324 318.193H693.492L690.004 312.226H687.728V318.193H685.234V303.176H689.633C691.498 303.176 692.863 303.541 693.728 304.271C694.605 305.002 695.043 306.114 695.043 307.608ZM677.228 310.676C677.228 308.429 677.79 306.322 678.914 304.356C680.037 302.389 681.582 300.839 683.549 299.704C685.515 298.569 687.633 298.002 689.902 298.002C692.15 298.002 694.256 298.564 696.223 299.687C698.189 300.811 699.74 302.356 700.874 304.322C702.009 306.288 702.577 308.406 702.577 310.676C702.577 312.889 702.032 314.968 700.942 316.912C699.852 318.856 698.324 320.412 696.358 321.58C694.391 322.749 692.24 323.333 689.902 323.333C687.577 323.333 685.431 322.754 683.464 321.597C681.498 320.429 679.964 318.872 678.863 316.929C677.773 314.985 677.228 312.901 677.228 310.676ZM678.998 310.676C678.998 312.62 679.487 314.44 680.464 316.136C681.442 317.822 682.773 319.153 684.459 320.131C686.155 321.097 687.97 321.58 689.902 321.58C691.858 321.58 693.672 321.092 695.346 320.114C697.02 319.136 698.346 317.816 699.324 316.153C700.313 314.479 700.807 312.653 700.807 310.676C700.807 308.721 700.318 306.906 699.341 305.232C698.363 303.558 697.037 302.232 695.363 301.255C693.7 300.266 691.88 299.771 689.902 299.771C687.947 299.771 686.133 300.26 684.459 301.238C682.785 302.215 681.453 303.541 680.464 305.215C679.487 306.878 678.998 308.698 678.998 310.676Z",fill:"currentColor"})]}));Xue.displayName="YelpLogo";const G1t=({className:e})=>l.jsx(V,{className:z("w-10",e),children:l.jsx(Xue,{})}),$1t=({className:e})=>l.jsx(V,{className:z("w-[70px]",e),children:l.jsx(Que,{})}),Zue=e=>{const t=d.useMemo(()=>Vi(e).with(ed.string.includes("yelp.com"),()=>G1t).with(ed.string.includes("tripadvisor.com"),()=>$1t).otherwise(()=>null),[e]);return d.useMemo(()=>({SearchClientLogo:t}),[t])},Jue=A.memo(({day:e,hours:t})=>l.jsxs("div",{className:"gap-xs flex items-center",children:[l.jsx(V,{variant:"tiny",children:e}),l.jsx(K,{className:"h-one grow",variant:"subtler"}),l.jsx(V,{variant:"tiny",color:"light",children:t})]}));Jue.displayName="BusinessDayToHours";function LS(e,t,n,r=0){return e*24*3600+t*3600+n*60+r}function iU(e,t,n){const r=new Date(Date.UTC(2e3,0,1,e,t,0));return t===0?new Intl.DateTimeFormat(n,{hour:"numeric",timeZone:"UTC"}).format(r):new Intl.DateTimeFormat(n,{hour:"numeric",minute:"numeric",timeZone:"UTC"}).format(r)}function W8(e,t,n){const{locale:r,$t:s}=J(),[o,a]=d.useState([]);return d.useEffect(()=>{if(!e||e.length===0)return a([]),()=>{};const i=()=>{const f=Date.now(),m=VS(f,t),p=(m.weekday+6)%7,h=LS(p,m.hour,m.minute,m.second),g=[];for(const _ of e){const w=_.open.weekday_idx,S=_.open.hour,C=_.open.minute,E=_.close.weekday_idx,T=_.close.hour,k=_.close.minute;let I=LS(w,S,C),M=LS(E,T,k);M<=I&&(M+=168*3600),p===_.close.weekday_idx&&_.open.weekday_idx!==_.close.weekday_idx&&(I-=168*3600,M-=168*3600),g.push({openWeekday:w,openHour:S,openMinute:C,closeWeekday:E,closeHour:T,closeMinute:k,openSeconds:I,closeSeconds:M})}g.sort((_,w)=>_.openWeekday!==w.openWeekday?_.openWeekday-w.openWeekday:_.openSeconds-w.openSeconds);const y=[];for(let _=0;_<7;_++){const S=(_-p+7)%7*24*60*60*1e3,C=new Date(f+S);y.push({day:Intl.DateTimeFormat(r,{weekday:n,timeZone:t}).format(C),isToday:_===p,hours:[],joinedHours:s({defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})}let x=null;for(const _ of g){const w=y[_.openWeekday],S=iU(_.openHour,_.openMinute,r),C=iU(_.closeHour,_.closeMinute,r),E=S===C?s({defaultMessage:"Open 24 hours",id:"mdcm71ltJq"}):`${S} - ${C}`,T=_.openWeekday===p&&h>=_.openSeconds&&h<_.closeSeconds;if(w.hours.push({open:S,close:C,openCloseString:E,isOpenNow:T}),_.openSeconds>h){const k=_.openSeconds-h;(x===null||kh){const k=_.closeSeconds-h;(x===null||k0&&(x===null||b0&&(_.joinedHours=_.hours.map(w=>w.openCloseString).join(", "));return a(_=>Cr(_,y)?_:y),x!==null?x*1e3:null},c=()=>{const f=i();if(f!==null&&f>0){const m=Math.min(f,864e5);return setTimeout(c,m)}else return setTimeout(c,1440*60*1e3)},u=c();return()=>clearTimeout(u)},[e,t,r,n,s]),o}const ede=A.memo(({hours:e,timezone:t})=>{const[n,r]=d.useState(!1),s=d.useCallback(()=>{r(u=>!u)},[]),o=W8(e,t,"long"),a=o.find(u=>u.isToday===!0),i=a?.hours.some(u=>u.isOpenNow)??!1,{$t:c}=J();return l.jsxs(K,{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"gap-x-sm flex items-center",children:[i!=null&&l.jsx(K,{variant:i?"super":"red",className:"px-sm py-xs rounded",children:l.jsx(V,{variant:"tiny",color:"defaultInverted",children:c(i?{defaultMessage:"Open now",id:"AbmghRJVfD"}:{defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})}),a!==void 0&&l.jsxs(V,{variant:"tiny",className:"block",children:[a.joinedHours," today"]})]}),l.jsx(st,{size:"tiny",text:c({defaultMessage:"More",id:"I5NMJ8llIi"}),onClick:s,chevron:!0,chevronIcon:n?B("chevron-up"):B("chevron-down")})]}),n&&l.jsx("div",{className:"my-sm gap-xs flex flex-col",children:o.map((u,f)=>l.jsx(Jue,{day:u.day,hours:u.joinedHours},f))})]})});ede.displayName="BusinessHours";const tde=A.memo(({className:e,title:t,url:n,subtitle:r,imageUrl:s,withImagePlaceholder:o,clickable:a,withinContent:i,bgHover:c,variant:u,...f})=>l.jsxs(K,{variant:i?"subtler":u,bgHover:a?i?"subtle":"subtler":c,className:z("gap-x-md p-sm flex rounded-lg",{"cursor-pointer":a},e),...f,children:[s&&l.jsx("div",{className:"size-20 flex-none overflow-hidden",children:l.jsx(Wo,{alt:"title",hasShadow:!1,includeLightBoxModal:!1,containerClassName:"size-20",imageClassName:"object-cover w-full h-full",maskClassName:"size-20 flex items-center justify-center",rounded:"md",src:s})}),!s&&o&&l.jsx("div",{className:"size-20 flex-none overflow-hidden",children:l.jsx("div",{className:"bg-subtler flex size-20 items-center justify-center rounded-md"})}),l.jsxs("div",{className:"-mt-xs flex grow flex-col justify-center",children:[l.jsxs("div",{className:"gap-x-sm flex justify-between",children:[l.jsx(V,{className:"line-clamp-1 whitespace-normal break-words capitalize leading-8",variant:"smallBold",children:t}),n&&l.jsx(V,{variant:"small",color:"light",className:"mr-xs",children:l.jsx(ge,{icon:B("external-link"),size:"md"})})]}),r]})]}));tde.displayName="ContentLinkCard";const q1t=4,Hh=A.memo(({priceSymbols:e,priceRange:t,className:n="",dollarColor:r="default",textVariant:s="tiny",currencySymbol:o,...a})=>{const i=t&&/^(.+?)\s*(\1\s*)+$/.test(t.trim());let c=0;return i?c=t.replace(/\u200A/g,"").length:e&&(c=e.replace(/\u200A/g,"").length),l.jsx("div",{className:`flex items-center ${n}`,...a,children:t&&!i?l.jsx(V,{variant:s,color:r,children:t}):l.jsx("div",{className:"flex gap-px",children:Array.from({length:q1t},(u,f)=>l.jsx(V,{variant:s,className:"inline-flex",color:fl.jsxs("div",{className:"flex items-center","data-test-id":t,children:[Array.from({length:K1t},(n,r)=>{const s=e>r&&r>=Math.floor(e);return l.jsxs("div",{className:"relative",children:[l.jsx(V,{variant:"tiny",color:r{const a=o&&!!e.price,i=d.useMemo(()=>l.jsxs("div",{children:[l.jsxs("div",{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(nde,{starCount:e.rating}),e.num_reviews&&l.jsxs(V,{color:"light",variant:"tiny",className:"line-clamp-1",children:[" · ",Gbe(e.num_reviews)," reviews"]})]}),l.jsxs("div",{className:"mt-sm gap-sm flex items-center",children:[o&&l.jsx(o,{className:"-mt-two"}),a&&l.jsx(V,{color:"light",variant:"tiny",children:" · "}),(e.price||e.price_range)&&l.jsx("div",{className:"gap-sm line-clamp-1 flex items-center",children:l.jsx(Hh,{priceSymbols:e.price,priceRange:e.price_range})})]})]}),[o,e.num_reviews,e.price,e.price_range,e.rating,a]);return l.jsx(K,{onClick:n,children:l.jsx(tde,{title:e.name,clickable:n!==void 0,onMouseEnter:r,onMouseLeave:s,imageUrl:e.image_url??void 0,withImagePlaceholder:t,subtitle:i})})});rde.displayName="MapContentCard";const G8=A.memo(({showPulse:e=!1,style:t="default"})=>l.jsxs("div",{className:"relative size-[12px]",children:[l.jsx("div",{className:z("bg-super relative z-[1] size-[12px] rounded-full shadow-[0_1px_6px_rgba(0,0,0,0.25)] transition-all duration-150 dark:shadow-[0_1px_4px_rgba(0,0,0,0.5)]",{"bg-white shadow-[0_1px_6px_rgba(0,0,0,0.35),0_0_0_1px_rgba(0,0,0,0.05)]":t==="recede"})}),e&&l.jsx(Te.div,{className:"bg-super pointer-events-none absolute left-0 top-0 size-[12px] rounded-full",initial:{scale:1,opacity:.75},animate:{scale:[1,2.5],opacity:[.75,0]},transition:{duration:1.5,ease:[0,0,.2,1],repeat:1/0,repeatType:"loop",repeatDelay:.01}})]}));G8.displayName="PulsingDot";const sde=A.memo(({isContentCardOpen:e,location:t,selectedLocation:n,onClick:r,onClose:s,isHighlighted:o=!1,isSelected:a=!1,setHighlightedLocation:i,deemphasize:c=!1,setOffset:u,showRating:f=!1})=>{const{SearchClientLogo:m}=Zue(t.url),p=t.description,h=t.attributes?.ambience,g=h&&Object.keys(h).find(N=>h[N]===!0),{isMobileStyle:y}=Re(),x=6,v=t.categories?.slice(0,x),b=t.categories?.slice(x),[_,w]=d.useState(!1),S=t.address?.join(", "),C=360,[E,T]=d.useState(null);d.useEffect(()=>{E&&a&&u(E)},[a,E,u]);const k=d.useCallback(()=>w(!0),[w]),I=d.useMemo(()=>l.jsxs("div",{children:[l.jsx(yt,{href:t.url,target:"_blank",children:l.jsx(rde,{location:t,SearchClientLogo:m})}),(S||t.phone||t.entity_url)&&l.jsxs(K,{className:"mx-sm py-sm mt-xs gap-sm flex flex-col border-t",children:[S&&l.jsx(Oy,{icon:B("map-pin"),label:S,href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(S)}`,showCopyButton:!0}),t.phone&&l.jsx(Oy,{icon:B("device-mobile"),label:t.phone,href:`tel:${t.phone}`,showCopyButton:!0}),t.entity_url&&l.jsx(Oy,{icon:B("world"),label:iz(az(t.entity_url)),href:t.entity_url})]}),p&&l.jsx(K,{className:"mx-sm gap-sm py-sm flex flex-wrap border-t",children:l.jsx(V,{variant:"small",className:"line-clamp-3",children:p})}),!!t.standardized_hours?.length&&l.jsx(K,{className:"mx-sm py-sm scrollbar-subtle max-h-[120px] overflow-auto border-t",children:l.jsx(ede,{hours:t.standardized_hours,timezone:t.timezone})}),(g||t.categories)&&l.jsxs(K,{className:"mx-sm gap-xs py-sm flex flex-wrap border-t",children:[g&&l.jsx(up,{text:g}),v?.map((N,D)=>l.jsx(up,{text:N},D)),!_&&b.length>0&&l.jsx(up,{text:`+${b.length}`,onClick:k}),_&&b?.map((N,D)=>l.jsx(up,{text:N},D))]})]}),[S,p,v,t,k,b,_,g,m]),M=d.useMemo(()=>({zIndex:a||o?10:0}),[o,a]);return l.jsxs(l.Fragment,{children:[E?null:l.jsx("div",{ref:N=>{N&&T(N.offsetHeight)},className:"pointer-events-none invisible absolute left-[10vw] top-[10vh]",style:{width:C},children:I}),l.jsx(L1t,{longitude:t.lng,latitude:t.lat,anchor:"bottom",onClick:r,style:M,children:l.jsx(kb,{isMobileStyle:y,canOutsideClickClose:!0,isOpen:e,placement:"bottom",removeScroll:!1,onClose:s,contentWidth:C,content:I,children:l.jsxs(V,{variant:"tiny",className:z("group pointer-events-none relative flex cursor-pointer flex-col items-center",{"z-[10]":o||e}),children:[l.jsx(Te.div,{animate:{opacity:a||o?1:0},transition:Ar,className:z("bg-super px-sm py-xs text-light pointer-events-none absolute left-1/2 top-[-20px] -translate-x-1/2 whitespace-nowrap rounded-full shadow-sm group-hover:shadow-md dark:text-black",{}),children:t.name}),l.jsx("div",{onMouseEnter:()=>{i&&!a&&!n&&i(t)},onMouseLeave:()=>{i&&!a&&i(null)},className:"pointer-events-auto block",children:f&&t.rating?l.jsx(ode,{rating:t.rating,isSelected:a,isHighlighted:o,deemphasize:c}):l.jsx("div",{className:"p-sm rounded-full",children:l.jsx(G8,{style:c?"recede":"default",showPulse:a||o})})})]})})})]})});sde.displayName="PerplexityMarker";const up=A.memo(({text:e,onClick:t})=>l.jsx(K,{className:z("py-xs px-sm rounded border",{"cursor-pointer":t}),onClick:t,as:t?"button":"div",bgHover:t?"subtle":void 0,children:l.jsx(V,{variant:"tiny",color:"light",children:e})}));up.displayName="MarkerPill";const ode=A.memo(({rating:e,isSelected:t,isHighlighted:n,deemphasize:r})=>l.jsx(Te.div,{animate:{scale:t||n?1.1:1,opacity:r?.6:1},transition:{type:"spring",bounce:.2,duration:.28},className:"relative",children:l.jsxs("div",{className:z("bg-super mt-sm px-sm py-xs font-display text-light relative rounded-xl text-xs font-medium shadow-sm group-hover:shadow-md dark:text-black",{"shadow-md":t||n}),children:[e.toFixed(1),l.jsx("div",{className:"border-t-super absolute left-1/2 top-full -translate-x-1/2 -translate-y-px border-x-4 border-t-[5px] border-x-transparent"})]})}));ode.displayName="RatingMarker";const Oy=A.memo(({icon:e,label:t,href:n,showCopyButton:r=!1})=>{const{$t:s}=J(),{session:o}=Ne(),{trackEvent:a}=Xe(o),i=d.useCallback(f=>{f.stopPropagation(),a("place link clicked",{link:n})},[a,n]),c=d.useCallback(()=>{navigator.clipboard.writeText(t),a("place link copied",{link:n})},[t,a,n]),u=s({defaultMessage:"Copy",id:"4l6vz1/eZ5"});return l.jsxs("div",{className:"gap-sm group/all flex items-start",children:[l.jsx(yt,{href:n,target:"_blank",className:"group flex-1 cursor-pointer",onClick:i,children:l.jsxs(V,{variant:"small",color:"default",className:"gap-sm group-hover:text-super flex items-start text-balance transition-colors duration-200",children:[l.jsx(ge,{icon:e,size:"sm",className:"top-two relative shrink-0"}),t]})}),r&&l.jsx(V,{variant:"small",color:"default",className:"-mr-xs flex h-[1lh] items-center",children:l.jsx(st,{icon:B("copy"),onClick:c,size:"small",toolTip:u,clickFeedback:!0,pill:!0})})]})});Oy.displayName="PlaceLink";function ade(e){return{lat:e.lat??0,lng:e.lng??0,name:e.name??"",description:e.description??"",image_url:e.image_url??"",price:e.price??"",rating:e.rating??0,num_reviews:e.num_reviews??0,url:e.url??"",attributes:e.attributes,categories:e.categories,operating_hours:e.operating_hours??[],is_open:e.is_open??!1,map_boundary_buffer:0,price_range:e.price_range??"",canonical_page_path:e.canonical_page_path??"",address:e.address??[],phone:e.phone??"",entity_url:e.entity_url??"",timezone:e.timezone??"",standardized_hours:e.standardized_hours??[]}}const Y1t=({reason:e})=>{const t=el(),n=d.useCallback(async({entryUUID:r,lat_lng:s})=>{const{data:o,error:a,response:i}=await de.POST("/rest/entry/map/search-map-locations",e,{body:{lat:s.latitude,lng:s.longitude,read_write_token:t,entry_uuid:r},timeoutMs:Cn.HIGH});if(a)throw new he("API_CLIENTS_ERROR",{cause:a,status:i.status??0});return o?o.places.map(ade):[]},[t,e]);return d.useMemo(()=>({searchForAdditionalLocations:n}),[n])},Q1t="pk.eyJ1Ijoiam9obm55cHBseCIsImEiOiJjbHBraWpwcnUwMHNzMmtwbWZyOTIyZnpxIn0.0I0RSAHhYftVDM6cLnj1wg",X1t="mapbox://styles/johnnypplx/clps6e1xy015c01qt2u79a96f",Z1t="mapbox://styles/johnnypplx/clpmzsapf00zy01po5t7ge9zd",lU=16,cU=17,q1=6,ide=A.memo(({entryUUID:e,contextUUID:t,selectedLocation:n,setSelectedLocation:r,selectedLocationFocused:s=!0,setSelectedLocationFocused:o,highlightedLocation:a,setHighlightedLocation:i,setRenderedLocations:c,searchByLocationOverride:u,locations:f,navControlPosition:m="bottom-right",showNavControl:p=!0,showRating:h=!1,answerMode:g})=>{const y="perplexity-map",x=d.useRef(null),[v,b]=d.useState(!1),[_,w]=d.useState(!1),[S,C]=d.useState(!1),[E,T]=d.useState(null),{colorScheme:k}=Ss(),{searchForAdditionalLocations:I}=Y1t({reason:y}),M=f[0]?.map_boundary_buffer??0,N=f.map(se=>se.lat),D=f.map(se=>se.lng),j=Math.min(...N)-M,F=Math.max(...N)+M,R=Math.min(...D)-M,P=Math.max(...D)+M,L=()=>{r(null),b(!1)},U=d.useCallback(()=>{x.current&&x.current.fitBounds([[R,j],[P,F]],{duration:500,padding:50,maxZoom:cU})},[R,j,P,F]);d.useEffect(()=>{n!=null&&E!=null&&s&&(x.current.getCenter().lng.toFixed(q1)==n.lng.toFixed(q1)&&x.current.getCenter().lat.toFixed(q1)==n.lat.toFixed(q1)&&x.current.getZoom()==lU?b(!0):(x.current.flyTo({center:[n.lng,n.lat],padding:{bottom:E},zoom:lU,duration:500}),w(!0)))},[n,s,E]),d.useEffect(()=>{if(!x.current||!a)return;const se=x.current.getBounds();if(!se)return;se.contains([a.lng,a.lat])||U()},[a,j,F,R,P,U]),d.useEffect(()=>{n?o?.(!0):U()},[n,U,o]);const O=d.useMemo(()=>f.map((se,ae)=>l.jsx(lde,{location:se,highlightedLocation:a??null,selectedLocation:n,showContentCard:v,contextUUID:t,entryUUID:e,isFlying:_,setHighlightedLocation:i,setSelectedLocation:r,setShowContentCard:b,setOffset:T,showRating:h,answerMode:g},`marker-${ae}`)),[f,a,n,v,t,e,_,i,r,h,g]);d.useCallback(async()=>{if(x.current){C(!0);try{const se=u?await u({latLng:{latitude:x.current.getCenter().lat,longitude:x.current.getCenter().lng}}):await I({entryUUID:e,lat_lng:{latitude:x.current.getCenter().lat,longitude:x.current.getCenter().lng}});se&&se.length>0&&c(se)}catch(se){Z.error("Error searching for additional locations:",se)}finally{C(!1)}}},[I,e,c,C,u]);const $=d.useMemo(()=>({bounds:[[R,j],[P,F]],fitBoundsOptions:{maxZoom:cU,padding:50}}),[F,P,j,R]),G=d.useCallback(()=>b(!1),[]),H=d.useCallback(()=>o?.(!1),[o]),Q=d.useCallback(()=>{_?(b(!0),w(!1)):r(null)},[_,r]),Y=d.useMemo(()=>({name:"mercator"}),[]),te=d.useCallback(se=>{se?.target?.resize?.()},[]);return l.jsxs(K,{variant:"subtler",className:"relative flex size-full overflow-hidden rounded-xl",children:[!1,l.jsxs(P1t,{ref:x,mapboxAccessToken:Q1t,initialViewState:$,onClick:L,doubleClickZoom:!1,mapStyle:k==="dark"?X1t:Z1t,attributionControl:!1,logoPosition:"top-left",onMoveStart:G,onDragStart:H,onZoomEnd:Q,projection:Y,onRender:te,children:[O,p&&l.jsx(H1t,{position:m,showCompass:!1,showZoom:!0})]})]})});ide.displayName="PerplexityMap";const lde=A.memo(({location:e,highlightedLocation:t,selectedLocation:n,showContentCard:r,contextUUID:s,entryUUID:o,isFlying:a,setHighlightedLocation:i,setSelectedLocation:c,setShowContentCard:u,setOffset:f,showRating:m,answerMode:p})=>{const{session:h}=Ne(),{trackEvent:g}=Xe(h),y=d.useCallback(()=>{!a&&e!=n&&(g("map marker clicked",{entryUUID:o,contextUUID:s,itemID:e.url,answerMode:p}),u(!1),c(e),i&&i(null))},[a,e,n,g,o,s,u,c,i,p]),x=d.useCallback(()=>{c(null),u(!1)},[c,u]);return l.jsx(sde,{isContentCardOpen:r&&n?.url===e.url,location:e,onClick:y,onClose:x,isHighlighted:t?.url===e.url,isSelected:n?.url===e.url,setHighlightedLocation:i,selectedLocation:n,setOffset:f,deemphasize:t!==null&&t?.url!==e.url,showRating:m})});lde.displayName="PerplexityMarkerFactory";const cde=Ft("ImageCarouselContext",{images:[],onImageClick:()=>{},handleNext:()=>{},handlePrevious:()=>{},currentIndex:0,showControls:!1,direction:1,totalVisibleCarousels:0,setTotalVisibleCarousels:()=>{},fillMode:"cover",useCurrentIndex:()=>0}),tM=A.memo(({images:e,showControls:t,onImageClick:n,children:r,fillMode:s="cover"})=>{const[o,a]=d.useState(0),[i,c]=d.useState(1),[u,f]=d.useState(0);d.useEffect(()=>{a(0)},[e.length]);const m=d.useCallback(()=>{a(b=>b+1>=e.length?0:b+1),c(1)},[a,e.length]),p=d.useCallback(()=>{a(b=>b==0?e.length-1:b-1),c(-1)},[a,e.length]),h=d.useCallback(b=>{f(b),y(Date.now())},[]),[g,y]=d.useState(),x=d.useCallback(b=>!b.current||g===void 0?-1:J1t(b.current),[g]),v=d.useMemo(()=>({images:e,onImageClick:n,handleNext:m,handlePrevious:p,currentIndex:o,showControls:t,direction:i,totalVisibleCarousels:u,setTotalVisibleCarousels:h,fillMode:s,useCurrentIndex:x}),[e,o,t,i,u,m,p,h,n,s,x]);return l.jsx(cde.Provider,{value:v,children:l.jsx("div",{"data-paged-carousel":"parent",children:r})})});tM.displayName="ImagePagedCarouselProvider";const J1t=e=>{const t=e.closest('[data-paged-carousel="parent"]');if(!t)return-1;const n=t.querySelectorAll('[data-paged-carousel="child"]');return Array.from(n).filter(s=>{const o=s.getBoundingClientRect();return o.width>0&&o.height>0}).indexOf(e)},Ly=A.memo(({className:e})=>{const{images:t,onImageClick:n,handleNext:r,handlePrevious:s,currentIndex:o,showControls:a,direction:i,totalVisibleCarousels:c,setTotalVisibleCarousels:u,fillMode:f,useCurrentIndex:m}=d.useContext(cde),p=d.useRef(null),h=m(p),[g,{width:y,height:x}]=ti(),v=y>0&&x>0;d.useEffect(()=>{if(v)return u(I=>I+1),()=>u(I=>I-1)},[u,v]);const[b,_]=d.useState(!1),{isMobileUserAgent:w}=Re(),S=d.useMemo(()=>{const I=o+h;return I>=t.length?I%t.length:I},[h,o,t.length]),C=d.useCallback(()=>{n?.(S)},[S,n]),E={hiddenEnter:I=>({x:I===1?"100%":"-100%"}),hiddenExit:I=>({x:I===1?"-100%":"100%"}),visible:{x:0}};d.useEffect(()=>{const I=()=>{const M=(S+1)%t.length,N=S===0?t.length-1:S-1,D=new Image,j=new Image,F=t[M],R=t[N];F&&(D.src=F),R&&(j.src=R)};t.length>1&&I()},[S,t]);const T=t.length>1&&h===0,k=t.length>1&&h+1==c;return t.length?l.jsxs("div",{ref:p,"data-paged-carousel":"child",onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),className:z("group relative size-full",e),children:[l.jsx("div",{ref:g,className:"size-full cursor-pointer overflow-hidden",onClick:C,children:h===-1?null:l.jsx(St,{initial:!1,custom:i,children:l.jsx(Te.img,{custom:i,src:t[S],alt:"",className:z("absolute inset-0 size-full",{"p-sm object-contain":f==="contain","object-cover":f==="cover"}),variants:E,initial:"hiddenEnter",animate:"visible",exit:"hiddenExit",transition:Ar},t[S])})}),T&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:b||a||w?1:0},transition:Ar,children:l.jsx(K,{as:"button",variant:"raised",className:"shadow-overlay active:bg-subtler absolute left-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full",onClick:s,children:l.jsx(ge,{icon:B("chevron-left"),size:"sm"})})}),k&&l.jsx(Te.div,{initial:{opacity:0},animate:{opacity:b||a||w?1:0},transition:Ar,children:l.jsx(K,{as:"button",variant:"raised",className:"shadow-overlay active:bg-subtler absolute right-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full",onClick:r,children:l.jsx(ge,{icon:B("chevron-right"),size:"sm"})})})]}):null});Ly.displayName="ImagePagedCarousel";const eyt=A.memo(({image:e,title:t,subtitle:n,children:r,footer:s,itemClick:o})=>l.jsxs("div",{className:"gap-md flex w-full flex-row",children:[l.jsx("div",{className:"w-[180px] shrink-0",children:e}),l.jsxs("div",{className:"gap-xs flex flex-col justify-center",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsxs(K,{as:"button",onClick:o,children:[l.jsx(V,{variant:"baseSemi",className:"text-left hover:underline",children:t}),l.jsx("div",{className:"mt-xs min-h-[24px]",children:n})]}),l.jsx("div",{className:"-mt-sm",children:r})]}),l.jsx("div",{className:"gap-xs -mt-sm flex flex-row justify-between",children:s})]})]}));eyt.displayName="InlineCard";const uU=({children:e})=>l.jsx("div",{className:"gap-md flex w-full flex-row",children:e}),tyt=({children:e})=>l.jsx("div",{className:"w-[180px] shrink-0",children:e}),nyt=({children:e})=>l.jsx("div",{className:"gap-xs flex flex-col justify-center",children:e}),ryt=({children:e,onClick:t})=>l.jsx(Ro,{onClick:t,className:"gap-xs group flex flex-col",children:e}),syt=({children:e})=>l.jsx("div",{className:"group-hover:underline",children:l.jsx(jme,{size:"tiny",weight:"medium",level:3,align:"left",children:e})}),oyt=({children:e})=>l.jsx("div",{className:"gap-xs -mt-sm flex flex-row justify-between",children:e}),qu=Object.assign(uU,{Root:uU,Image:tyt,Title:syt,Content:nyt,Action:ryt,Footer:oyt}),ayt=({actions:e})=>l.jsx(ga,{className:"text-quietest flex flex-row flex-wrap items-center",delimiter:"|",children:e.map((t,n)=>{const r=l.jsx(K,{className:"gap-xs flex items-center",children:l.jsx(st,{variant:t.emphasize?"super":"common",size:"small",onClick:t.onClick,icon:t.icon,trailingComponent:t.trailingComponent,text:t.label,textClassName:t.textClassName,noPadding:!0})});return l.jsx(Bn,{id:t.label,children:r},n)})}),ude=A.memo(({title:e,href:t,linkType:n="external",onClick:r,noFollow:s=!1,variant:o="entry-title-300"})=>{const{$t:a}=J(),i=a({defaultMessage:"Open in Perplexity",id:"EUx7i7X2Vq"}),c=a({defaultMessage:"Open site",id:"X8dxWhlpJl"}),u=a({defaultMessage:"View details",id:"MnpUD7ksb+"}),f=l.jsx(V,{as:r?"button":void 0,onClick:r,variant:o,className:"decoration-subtle animate-underlineFade hover:text-super hover:decoration-super/80 dark:decoration-subtler line-clamp-3 inline-block w-fit cursor-pointer overflow-visible text-left align-baseline underline decoration-1 underline-offset-[5px] transition-all hover:underline-offset-[7px] motion-reduce:transition-none",children:e});return t?l.jsx(Io,{tooltipText:n==="external"?c:i,tooltipLayout:"right",asChild:!0,children:l.jsx(yt,{href:t,target:"_blank",rel:s?void 0:"nofollow",className:"w-fit",onClick:r,children:f})}):r?l.jsx(Io,{tooltipText:u,tooltipLayout:"right",asChild:!0,children:f}):f});ude.displayName="InlineCardTitle";const iyt="pk.eyJ1Ijoiam9obm55cHBseCIsImEiOiJjbG9zeWVsaHUwNGU5Mmpudm95bGpmcTJjIn0.ztIaHlLUvTpLq8EVD7LjDQ",lyt="clpmzsapf00zy01po5t7ge9zd",cyt="clps6e1xy015c01qt2u79a96f";function dU({mode:e="light",width:t,height:n,lat:r,long:s,zoom:o=12,scale:a}){return"https://api.mapbox.com/styles/v1/johnnypplx/"+(e==="light"?lyt:cyt)+`/static/${s},${r},${o}/${t}x${n}${a==2?"@2x":""}?access_token=${iyt}&logo=false`}function uyt(e){const t=dU({...e,scale:1}),n=dU({...e,scale:2});return{src:t,srcSet:`${t} 1x, ${n} 2x`}}const dde=A.memo(({standardizedHours:e,timezone:t})=>{const n=W8(e,t,"short");return n.length===0?null:l.jsx("div",{className:"gap-xs flex flex-col",children:n.map(({day:r,joinedHours:s,isToday:o})=>l.jsxs("div",{className:"gap-md flex items-center justify-between",children:[l.jsx(V,{variant:"tiny",color:"white",className:o?void 0:"opacity-50",children:r}),l.jsx(V,{variant:"tiny",color:"white",className:o?void 0:"opacity-50",children:s})]},`place-hours-${r}`))})});dde.displayName="PlaceOperatingHours";const dyt=(e,t,n)=>{let r=Math.min(Math.ceil(n/2),e.length),s=Math.min(Math.floor(n/2),t.length);return r+s({...o,type:"pro"})),...t.slice(0,s).map(o=>({...o,type:"con"}))]},fde=A.memo(({pros:e,cons:t,loading:n})=>{const[r,s]=d.useState(0),[o,a]=d.useState(!1),[i,c]=d.useState(1),[u,f]=d.useState(1),[m,p]=d.useState(0),[h,{width:g,height:y}]=ti(),[x,v]=d.useState(Pe),b=d.useRef(null),{isMobileUserAgent:_}=Re(),w=Math.floor(g??0),S=Math.floor(y??0),C=d.useCallback(M=>!e?.length&&!t?.length||M<=0?Pe:dyt(e,t,M),[e,t]),E=d.useCallback((M,N,D,j)=>{const F=Math.floor(M/D),R=Math.floor(N/j);return{columns:Math.max(1,F),rows:Math.max(1,R)}},[]);d.useEffect(()=>{const{columns:M,rows:N}=E(w,S,180,56);c(M),f(N),r>x.length-1&&x.length-1>=0&&s(x.length-1)},[w,S,r,x.length,E]),d.useEffect(()=>{p(u*i),v(C(u*i))},[u,i,C]),d.useEffect(()=>{if(b.current){const M=b.current.scrollWidth,N=x.length,D=M/N*r;b.current.scrollTo({left:D})}},[o]),d.useEffect(()=>{const M=b.current;if(!M)return;const N=()=>{const D=M.scrollLeft,j=M.scrollWidth/x.length,F=Math.round(D/j);F!==r&&s(F)};return M.addEventListener("scroll",N),()=>M.removeEventListener("scroll",N)},[r,x.length]);const T=d.useCallback(M=>{if(!b.current)return;const D=b.current.scrollWidth/x.length*M;b.current.scrollTo({left:D})},[x.length]),k=d.useCallback(()=>{if(!b.current)return;const M=r+1>=x.length?0:r+1;T(M)},[r,x.length,T]),I=d.useCallback(()=>{if(!b.current)return;const M=r-1<0?x.length-1:r-1;T(M)},[r,x.length,T]);return l.jsx("div",{className:"size-full",style:{transformStyle:"preserve-3d",perspective:"1000px"},onMouseLeave:()=>{_||a(!1)},children:l.jsxs(Te.div,{initial:{rotateY:0},animate:{rotateY:o?180:0},transition:{type:"spring",stiffness:200,damping:30},style:{willChange:"transform",transformStyle:"preserve-3d"},className:"relative size-full",children:[l.jsx("div",{ref:h,className:"gap-sm grid size-full",style:{gridTemplateColumns:`repeat(${i}, 1fr)`,gridTemplateRows:`repeat(${u}, 1fr)`,backfaceVisibility:"hidden"},children:[...Array(m)].map((M,N)=>{const D=x[N];return!D&&!n?null:n?l.jsx(br,{children:l.jsx("div",{className:"bg-subtler size-full rounded-xl"})},N):D?l.jsx(mde,{item:D,index:N,setIsFlipped:a,setDetailIndex:s},N):null})}),l.jsx("div",{className:"absolute inset-0 size-full",style:{backfaceVisibility:"hidden",willChange:"transform",transform:"rotateY(180deg)"},children:l.jsxs(dr,{className:"gap-xs relative flex size-full flex-col text-left",children:[_&&l.jsx("button",{className:"shadow-overlay active:bg-subtler absolute right-[-8px] top-[-8px] z-[1] flex size-[24px] items-center justify-center rounded-full bg-white dark:bg-black",onClick:M=>{M.stopPropagation(),a(!1)},children:l.jsx(V,{color:"light",children:l.jsx(ge,{icon:B("x"),size:"sm"})})}),l.jsx("div",{ref:b,className:z("scrollbar-none absolute inset-0 snap-x snap-mandatory overflow-x-hidden",{"!overflow-x-scroll":_}),children:l.jsx("div",{className:"flex h-full flex-row flex-nowrap",style:{width:`${x.length*100}%`},children:x.map((M,N)=>l.jsx(pde,{item:M,next:k,prev:I},N))})}),l.jsx("div",{className:"gap-xs bottom-sm absolute left-1/2 flex -translate-x-1/2 flex-row",children:Array.from({length:x.length},(M,N)=>l.jsx("div",{onClick:()=>{T(N)},className:z("size-[6px] cursor-pointer rounded-full bg-black dark:bg-white",{"opacity-50":N===r,"opacity-[10%]":N!==r})},N))})]})})]})})});fde.displayName="ProsConsGrid";const mde=A.memo(({item:e,index:t,setIsFlipped:n,setDetailIndex:r})=>{const s=d.useCallback(()=>{n(!0),r(t)},[t,r,n]);return l.jsx(dr,{as:"button",onClick:s,className:"px-md active:bg-subtler dark:active:bg-subtle cursor-pointer",children:l.jsxs("div",{className:"gap-sm flex flex-row items-center",children:[l.jsx(V,{variant:"smallBold",className:"leading-tight",color:e.type==="pro"?"super":"light",children:l.jsx(ge,{icon:e.type==="pro"?B("check"):B("x"),size:"sm"})}),l.jsx(V,{variant:"smallBold",className:"line-clamp-2 text-left leading-tight",color:e.type==="pro"?"super":"light",children:e.label})]})})});mde.displayName="CanonicalCardFactory";const pde=A.memo(({item:e,next:t,prev:n})=>{const{isMobileUserAgent:r}=Re();return l.jsx("div",{onClick:s=>{if(r)return;const o=s.currentTarget.getBoundingClientRect();s.clientX-o.left>o.width/2?t():n()},className:"scrollbar-none size-full cursor-pointer select-none snap-center overflow-y-scroll",style:{mask:"linear-gradient(to bottom, black calc(100% - 40px), transparent calc(100% - 12px))",WebkitMask:"linear-gradient(to bottom, black calc(100% - 40px), transparent calc(100% - 12px))"},children:l.jsxs("div",{className:"p-md gap-xs flex flex-col pb-[32px] text-left",children:[l.jsxs(V,{variant:"smallBold",className:"gap-xs flex flex-row leading-tight",color:e.type==="pro"?"super":"default",children:[l.jsx(ge,{icon:e.type==="pro"?B("check"):B("x"),size:"sm",className:"translate-y-half shrink-0"}),e.label]}),l.jsx(V,{variant:"small",color:"light",children:e.description})]})})});pde.displayName="ProConDetailCard";function fU(e){return new Date(`${e}T00:00:00`)}function fyt(e,t){const n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r)),r.setDate(r.getDate()+1);return n.length}const myt=({amount:e,currency:t,targetCurrency:n,exchangeRates:r,options:s})=>{const o=mU(e,t,s),a=e/1e6,i=r?.find(({source_currency:u,target_currency:f})=>u===t&&f===n);if(!i||n===t)return{original:o,originalAmount:a};const c=mU(e*i.conversion_factor,n,s);return{original:o,originalAmount:a,adjusted:c,adjustedAmount:e*i.conversion_factor/1e6}},mU=(e,t,n)=>uk(e!==null?e/1e6:e,t,n);function p_t(e){const t=new Date;return t.setDate(t.getDate()+e),t}function hde(){const{locale:e}=J(),t=new Intl.Locale(e),{value:n,loading:r}=Rx({flag:"canonical-hotel-pages-enabled",defaultValue:!1,extraAttributes:{cfLanguage:t.language,appApiVersion:ql}});return d.useMemo(()=>({initialized:!r,value:n}),[n,r])}const pyt=({entity_id:e,entity_name:t,data_source:n,entry_uuid:r,url:s,reason:o})=>{const a=Yt(),i=be.makeQueryKey("place_result_reviews",`${n}_${s}`),{refetch:c,data:u,isFetching:f,error:m}=mt({queryKey:i,enabled:!1,queryFn:async()=>{let p={summary:"",review_quality_score:0,pros:[],cons:[],key_features:[],review_search_results:[]},h="PENDING",g="";try{await de.SSE("/rest/sse/places_review_summary_bulk",o,{params:{places:[{entity_id:e,entity_name:t,data_source:n,entry_uuid:r,url:s}]},handlers:{message:y=>{y.blocks?.[0]?.review_summary_block&&(p={...p,...y.blocks[0].review_summary_block}),h=y.status??"FAILED",g=y.id??"",a.setQueryData(i,{review_summary:p,status:h,id:g})}}})}catch{}return{review_summary:p,status:h,id:g}}});return d.useMemo(()=>({generateReviewSummaryForPlace:c,reviewSummary:u?.review_summary,isFetching:f,error:m}),[u?.review_summary,m,c,f])},gde=()=>{const{session:e}=Ne(),t=e?.user?.org_uuid;return{uuid:t==="none"?void 0:t}};function hyt(){const{value:e}=hde(),{locale:t}=J(),n=new Intl.Locale(t),{uuid:r}=gde(),{value:s,loading:o}=Rx({flag:"can-book-hotels",defaultValue:!1,extraAttributes:{cfLanguage:n.language,appApiVersion:ql,dependent_flag:"canonical-hotel-pages-enabled",variation_served:e,orgUUID:r??""}});return d.useMemo(()=>({initialized:!o,value:s}),[o,s])}function pU(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}const h_t=async({filters:e,reason:t})=>{const{data:n,error:r,response:s}=await de.POST("/rest/travel/hotels/search-widgets",t,{body:e,timeoutMs:Cn.NONE});if(n)return{hotels:n.hotels,map_item:n.map_item};throw new he("API_CLIENTS_ERROR",{message:"No hotel results returned",cause:r,status:s.status??0})},gyt=async({tripadvisorIds:e,searchPayload:t,reason:n})=>{const{checkIn:r,checkOut:s,numAdults:o,numChildren:a}=t,{data:i}=await de.POST("/rest/travel/hotels/search-availability",n,{body:{currency:"USD",filter:{tripadvisor_ids:e},stay_info:{check_in_date:pU(r),check_out_date:pU(s),guests:{adults:o,children:a}}},timeoutMs:Cn.HIGH,retries:2});return i?{availability:i.results,currencyExchangeRates:i.currency_exchange_rates,otaOffers:i.ota_hotel_offers}:null},yyt=({hotelIds:e,availabilitySearchPayload:t,priceConstraint:n,reason:r,enabled:s=!0})=>{const o=mt({queryKey:be.makeEphemeralQueryKey("hotelAvailabilities",e,t),queryFn:async()=>{if(t&&e.length>0){const c=await gyt({tripadvisorIds:e,searchPayload:t,reason:r});if(c)return c;throw new Error("Failed to fetch availabilities")}return null},placeholderData:Wl,enabled:s&&!!t&&e.length>0}),a=n?.max_price,i=d.useMemo(()=>{if(!t||!o.data?.availability&&!o.data?.otaOffers)return;const c=o.data.currencyExchangeRates,u=fyt(t.checkIn,t.checkOut)-1;if(u<=0)return;const f={};o.data.availability?.forEach(g=>{const y=g.tripadvisor_id,x=g.rooms?.reduce((w,S)=>{const C=S.rates?.slice()??[];C.sort((T,k)=>T.price.base_price-k.price.base_price);const E=C[0];return E?w?E.price.base_priceb)&&(f[y]=b)});const m={};o.data.otaOffers?.forEach(g=>{const y=g.tripadvisor_id,x=g.offers.map(({price:v})=>v);if(x.sort(),Hi(x)){const b=x[0]*u;m[y]=b}});const p={},h=new Set([...Object.keys(f),...Object.keys(m)]);for(const g of h){const y=f[g],x=m[g],v=y!==void 0?y/u:void 0,b=x!==void 0?x/u:void 0;if(v!==void 0&&(a==null||v<=a)&&y!==void 0){p[g]={price:y,source:"selfbook"};continue}b!==void 0&&(a==null||b<=a)&&x!==void 0&&(p[g]={price:x,source:"ota"})}return Object.entries(p).reduce((g,[y,x])=>(g[y]={total:uk(x.price,"USD",{roundToMajor:!0,renderZero:!0}),daily:uk(x.price/u,"USD",{roundToMajor:!0,renderZero:!0}),source:x.source},g),{})},[t,o.data,a]);return d.useMemo(()=>({lowestRatesByHotel:i,isFetching:o.isFetching,isError:o.isError,refetch:o.refetch}),[i,o.isFetching,o.isError,o.refetch])},xyt=(e,t)=>{const{value:n,loading:r}=zt({flag:"get-opentable-enabled",defaultValue:e,extraAttributes:t,subjectType:"user_nextauth_id"});return d.useMemo(()=>({variation:n,loading:r}),[n,r])};function vyt(){const{locale:e}=J(),t=new Intl.Locale(e),{uuid:n}=gde(),{variation:r,loading:s}=xyt(!1,{language:t.language,country:t.region??"",appApiVersion:ql,orgUUID:n??""});return d.useMemo(()=>({initialized:!s,value:r}),[s,r])}const byt=({place:e,entryUUID:t,contextUUID:n,mode:r,reason:s,hotelRate:o})=>{const{$t:a}=J(),{SearchClientLogo:i}=Zue(e.url),{session:c}=Ne(),{trackEvent:u}=Xe(c),{openStackedModal:f}=pn().legacy,m=hde(),p=hyt(),h=vyt(),{generateReviewSummaryForPlace:g,reviewSummary:y,isFetching:x}=pyt({entity_id:String(e.id),entity_name:e.name,entry_uuid:t??"",data_source:e.client,url:e.url,reason:s});d.useEffect(()=>{e.review_summary||y||g()},[e.review_summary,y]);const v="user_filters"in e?e.user_filters:void 0,b=d.useMemo(()=>{if(v?.start_date&&v?.end_date&&v?.num_guests)return{checkIn:fU(v.start_date),checkOut:fU(v.end_date),numAdults:v.num_guests,numChildren:0}},[v]),{lowestRatesByHotel:_}=yyt({hotelIds:[e.id],availabilitySearchPayload:b,priceConstraint:v?.price_constraint,reason:s,enabled:e.entity_type==="hotel"}),w=d.useMemo(()=>e.review_summary??y,[e.review_summary,y]),{hasProsOrCons:S,isLoadingProsCons:C}=d.useMemo(()=>{const L=w?.pros_detailed?.length??0,U=w?.cons_detailed?.length??0;return{hasProsOrCons:L||U||x,isLoadingProsCons:x&&!w?.summary?.length&&(L+U<3||!L||!U)}},[w?.pros_detailed,w?.cons_detailed,w?.summary?.length,x]),E=!!w?.summary,T=w?.key_features&&w.key_features.length>0,k=!E&&x,I=d.useCallback(()=>{const L=e.entity_url??e.url;return m.initialized&&m.value?e.canonical_page_path??L:L},[m,e.canonical_page_path,e.entity_url,e.url]),M=d.useCallback(()=>{const L=I();if(p.initialized&&p.value&&e.canonical_page_path&&e.entity_type==="hotel"&&"user_filters"in e&&e.user_filters){const U=new URLSearchParams;if(e.user_filters.start_date&&U.set("check-in",e.user_filters.start_date),e.user_filters.end_date&&U.set("check-out",e.user_filters.end_date),e.user_filters.num_guests&&U.set("adults",String(e.user_filters.num_guests)),U.toString())return`${L}?${U.toString()}`}return L},[I,p,e]),N=a({defaultMessage:"See Prices",description:"button label",id:"AOhh9Wa3/S"}),D=a({defaultMessage:"Reserve",description:"button label",id:"Rl2ClHM49w"}),j=d.useCallback(L=>{u("place button clicked",{answerMode:r,entryUUID:t,contextUUID:n,itemID:L})},[n,t,r,u]),F=d.useCallback(L=>{window.open(L,"_blank")},[]),R=d.useMemo(()=>{if(p.initialized&&p.value&&e.canonical_page_path&&e.entity_type==="hotel"){const L=o??_?.[e.id],U=M();return L?{ctaText:a({defaultMessage:"From {price} per night",id:"fkXL6pzn0I",description:"Button text indicating the starting price per night for a hotel"},{price:L.daily}),ctaURL:U,onClick:()=>{F(U)},ctaSubtitle:void 0,icon:B("tag")}:{ctaText:N,ctaURL:U,ctaSubtitle:void 0,onClick:()=>{F(U)},icon:B("tag")}}else if(e.booking_urls){const L=e.booking_urls[0];if(L?.booking_type==="HOTEL"&&p.value)return{ctaText:N,ctaURL:L.url,onClick:()=>{F(L.url)},icon:B("moneybag")};if(L?.booking_type==="RESTAURANT"){const U=h.initialized&&h.value&&L.provider_entity_id,O=L.booking_provider;return{ctaText:D,ctaURL:L.url,icon:B("calendar-event"),onClick:U?()=>{u("restaurant reservation CTA clicked",{booking_provider:O}),f("restaurantBookingModal",{restaurantId:L.provider_entity_id,provider:O})}:()=>{F(L.url)}}}}},[o,p,h,e,M,D,N,f,a,_,u,F]),P=d.useCallback(L=>{L.stopPropagation()},[]);return{generatedReviewSummary:w,hasProsOrCons:!!S,isLoadingProsCons:C,hasReviewSummary:E,hasKeyFeatures:!!T,reviewSummaryLoading:k,getEntityUrl:I,getEntityUrlWithParams:M,bookingCTAProperties:R,SearchClientLogo:i,handleClientLogoClick:P,trackPlaceButtonClicked:j}},_yt=A.memo(({place:e,entryUUID:t,contextUUID:n,context:r="medium",children:s})=>{const o="place-inline-card",{$t:a}=J(),[i,c]=d.useState(!1),[u,f]=d.useState(Pe),{openModal:m}=pn().legacy,{generatedReviewSummary:p,hasProsOrCons:h,isLoadingProsCons:g,bookingCTAProperties:y,SearchClientLogo:x,handleClientLogoClick:v}=byt({place:e,entryUUID:t,contextUUID:n,reason:o}),{session:b}=Ne(),{trackEvent:_,trackEventOnce:w}=Xe(b);d.useEffect(()=>{t&&(w("entity card shown",{entryUUID:t,entityType:"places"}),n&&_("place card viewed",{inline:!0,entryUUID:t,contextUUID:n,itemID:e.url}))},[t,n,e.url,_,w]);const S=d.useCallback(()=>{_("entity card clicked",{entryUUID:t,entityType:"places"})},[t,_]),C=d.useCallback(async()=>{const O=[];if(e.image_url&&O.push(e.image_url),e.images&&e.images.forEach(G=>{G!==e.image_url&&O.push(G)}),!O.length){f(Pe);return}const $=[];for await(const G of exe(O))$.length===0&&f(G.map(H=>({image:H,url:H.includes("tripadvisor.com")?e.url:e.entity_url??e.url}))),$.push(...G);f($.map(G=>({image:G,url:G.includes("tripadvisor.com")?e.url:e.entity_url??e.url})))},[e.image_url,e.images,e.url,e.entity_url]);d.useEffect(()=>{C()},[C]);const E=d.useMemo(()=>u.map(O=>O.image),[u.length]),{colorScheme:T}=Ss(),k=d.useCallback(()=>c(!0),[]),I=d.useCallback(()=>c(!1),[]),M=d.useCallback(()=>{window.open(X2e(e.name,e.address?.join(", ")??""),"_blank")},[e.name,e.address]),N=d.useCallback(O=>{S(),O==="cta"&&y?y.onClick():m("placeModal",{place:e,entryUUID:t,contextUUID:n})},[S,m,t,n,e,y]),D=a({defaultMessage:"Website",id:"JkLHGwmS9L"}),j=a({defaultMessage:"Directions",id:"fuwkSr5Bz7"}),F=a({defaultMessage:"Call",id:"f+GKc4i1Gc"}),R=d.useMemo(()=>[(e.price||e.price_range)&&l.jsx(Bn,{id:"price",children:l.jsx(Hh,{textVariant:"smallBold",priceSymbols:e.price,priceRange:e.price_range,currencySymbol:e.currency_char})},"price"),e.rating&&l.jsx(Bn,{id:"rating",children:l.jsx(ux,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"sm",variant:"truncated",textVariant:"smallBold",reviewTextVariant:"small",color:"default",url:x&&e.url?e.url:void 0})},"rating"),!!e.standardized_hours&&l.jsx(Bn,{id:"open-until",children:l.jsx(dx,{place:e})},"open-until"),x&&l.jsx(Bn,{id:"logo",children:l.jsx(yde,{SearchClientLogo:x,url:e.url,handleClick:v})},"logo"),...r==="medium"?[l.jsx(Bn,{id:"website",children:l.jsx(Fy,{label:D,href:e.entity_url??e.url})},"website"),!!e.address?.length&&l.jsx(Bn,{id:"directions",children:l.jsx(Fy,{label:j,href:Q2e(e.name,e.address.join(", "))})},"directions"),!!e.phone&&l.jsx(Bn,{id:"call",children:l.jsx(Fy,{label:e.phone,href:`tel:${e.phone}`})},"call")]:Pe].filter(O=>!!O),[x,v,e,D,j,r]),P=d.useMemo(()=>[y&&{label:y.ctaText,icon:y.icon,onClick:()=>N("cta"),emphasize:!0},e.address?.length&&{label:j,onClick:()=>M(),icon:B("map-pin")},(e.entity_url||e.url)&&{label:D,onClick:()=>window.open(e.entity_url??e.url,"_blank"),icon:B("world")},e.phone&&{label:F,onClick:()=>window.open(`tel:${e.phone}`,"_blank"),icon:B("phone")}].filter(O=>!!O),[y,N,e.entity_url,e.url,D,j,M,e.address?.length,e.phone,F]),L=d.useMemo(()=>y?l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("span",{className:"text-[16px]",children:y.ctaText}),y.ctaSubtitle&&l.jsx("span",{className:"text-quiet -mt-1 text-xs font-normal",children:y.ctaSubtitle})]}):null,[y]),U=d.useMemo(()=>y?l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("span",{className:"text-lg",children:y.ctaText}),y.ctaSubtitle&&l.jsx("span",{className:"text-quiet -mt-0.5 text-sm font-normal",children:y.ctaSubtitle})]}):null,[y]);return r==="small"?l.jsx(tM,{images:E,showControls:i,onImageClick:()=>N("title"),children:l.jsxs(qu.Root,{children:[l.jsx(qu.Image,{children:l.jsx(dr,{fullBleed:!0,className:"aspect-[4/3] w-full overflow-hidden",children:l.jsx(Ly,{})})}),l.jsxs(qu.Content,{children:[l.jsx(qu.Action,{onClick:()=>N("title"),children:l.jsx(qu.Title,{children:e.name})}),l.jsx(V,{color:"light",children:l.jsx(ga,{className:"gap-xs flex flex-row flex-wrap",children:R})}),l.jsx("div",{className:"-mt-sm",children:s}),l.jsx(qu.Footer,{children:l.jsx(ayt,{actions:P})})]})]})}):l.jsx("div",{className:"group relative","data-testid":"place-inline-card",children:l.jsx(tM,{images:E,showControls:i,onImageClick:()=>N("title"),children:l.jsxs("div",{className:"gap-md @container mt-4 flex flex-col",children:[l.jsxs("div",{className:"gap-sm flex flex-row items-end",children:[l.jsxs("div",{className:"gap-xs flex flex-col",children:[l.jsx(ude,{title:e.name,onClick:()=>N("title")}),l.jsx(V,{color:"light",children:l.jsx(ga,{className:"gap-xs flex flex-row flex-wrap",children:R})})]}),y&&l.jsx("div",{className:"@[420px]:block ml-auto hidden",children:l.jsx(Ge,{variant:"primaryGhost",icon:y.icon,size:"regular",pill:!0,onClick:()=>N("cta"),text:L})})]}),(!u||u.length<1)&&!h?null:l.jsxs("div",{className:"gap-sm @[420px]:grid-cols-2 @[640px]:grid-cols-3 grid w-full grid-cols-1",children:[u&&u[0]&&l.jsx(dr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:"aspect-[4/3] overflow-hidden",children:l.jsx(Ly,{})}),l.jsx(dr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:z("overflow-hidden",{"aspect-[4/3]":u&&u.length>1&&(h||!h&&u&&u[2]),"@[640px]:block hidden h-full":h||!h&&u&&u[2],"@[420px]:block @[640px]:col-span-2 hidden h-full":!h&&u&&u.length===1||h&&(!u||u.length<1)}),children:l.jsxs(K,{as:"button",onClick:M,className:"relative size-full",children:[l.jsx("img",{className:"absolute left-1/2 top-1/2 max-w-[unset] -translate-x-1/2 -translate-y-1/2",...uyt({mode:T,width:512,height:512,lat:e.lat,long:e.lng}),alt:""}),l.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-visible",children:l.jsx(G8,{})})]})}),h?l.jsx("div",{className:z("@[420px]:h-full h-[124px]",{"aspect-[4/3]":!u?.length}),children:l.jsx(fde,{pros:p?.pros_detailed??Pe,cons:p?.cons_detailed??Pe,loading:g})}):u&&u[2]?l.jsx(dr,{onMouseEnter:k,onMouseLeave:I,fullBleed:!0,className:"@[420px]:block hidden aspect-[4/3] overflow-hidden",children:l.jsx(Ly,{})}):null]}),y&&e.canonical_page_path?l.jsx("div",{className:"-mt-sm @[420px]:hidden block",children:l.jsx(Ge,{variant:"primaryGhost",icon:y.icon,fullWidth:!0,size:"regular",pill:!0,onClick:()=>N("cta"),text:U})}):null,s]})})})});_yt.displayName="PlaceInlineCard";const dx=A.memo(({place:e,textVariant:t="smallBold",condensed:n=!1,showTooltip:r=!0})=>{const{$t:s}=J(),o=W8(e.standardized_hours,e.timezone,"short"),[a,i]=d.useMemo(()=>{for(const u of o)if(u.isToday){for(const f of u.hours)if(f.isOpenNow)return f.open!==f.close?[!0,f.close]:[!0,null]}return[!1,null]},[o]),c=d.useMemo(()=>l.jsx(dde,{standardizedHours:e.standardized_hours,timezone:e.timezone}),[e.standardized_hours,e.timezone]);return l.jsx(Io,{tooltipText:c,asChild:!0,showTooltip:r,children:l.jsx(V,{variant:t,color:a?"super":"red",children:a?i&&!n?s({defaultMessage:"Open until {time}",id:"abDRIJdom/"},{time:i}):s({defaultMessage:"Open",id:"JfG49wNHKP"}):s({defaultMessage:"Closed",id:"Fv1ZSzMOV6"})})})});dx.displayName="OpenUntil";const Fy=A.memo(({label:e,href:t,textVariant:n="smallBold",icon:r})=>{const s=d.useCallback(a=>{a.stopPropagation()},[]),o=l.jsxs(V,{variant:n,color:"light",className:z("gap-xs flex items-center truncate transition-colors duration-150",{"hover:text-super":t}),children:[r?l.jsx(rn,{icon:r,size:"tiny"}):null,e]});return t?l.jsx(yt,{href:t,target:"_blank",className:"cursor-pointer truncate",onClick:s,children:o}):o});Fy.displayName="MetaDataItem";const yde=A.memo(({SearchClientLogo:e,url:t,handleClick:n})=>{const r=d.useCallback(o=>{o.stopPropagation()},[]),s=n||r;return e?t?l.jsx(yt,{href:t,target:"_blank",className:"cursor-pointer duration-150 hover:opacity-70",onClick:s,children:l.jsx(e,{})}):l.jsx(e,{}):null});yde.displayName="SearchClientLogoWrapper";const wyt=3,xde=A.memo(({placeWidgets:e})=>{const{$t:t}=J(),n=ui(),{result:{backend_uuid:r,context_uuid:s},isLastResult:o}=It(),{setActiveThreadTab:a,handleTabScrollBehavior:i}=kg(),c=dZ(),{session:u}=Ne(),{trackEventOnce:f,trackEvent:m}=Xe(u),{answerModeActionList:p,currentModeData:{mode:h}}=g6(),[g,y]=d.useState(null),[x,v]=d.useState(null);d.useEffect(()=>{f("maps preview viewed",{entryUUID:r,contextUUID:s})},[f,r,s]);const b=d.useMemo(()=>e.slice(0,wyt),[e]),_=d.useMemo(()=>e.map(C=>ade(C)),[e]),w=d.useMemo(()=>{const C=p.some(T=>T.mode==="hotels"),E=p.some(T=>T.mode==="places");return C?"hotels":E?"places":"default"},[p]),S=d.useCallback(()=>{m("maps preview see more clicked",{entryUUID:r,contextUUID:s}),i(w),a(w),c(w)},[a,c,i,w,r,s,m]);return e.length?l.jsxs(K,{className:"bg-subtler relative flex h-96 w-full overflow-hidden rounded-xl border",children:[l.jsx("div",{className:"absolute inset-0",children:l.jsx(ide,{entryUUID:r,contextUUID:s,selectedLocation:g,setSelectedLocation:y,highlightedLocation:x,setHighlightedLocation:v,setRenderedLocations:Ao,locations:_,showNavControl:!1,showRating:!0,answerMode:h})}),l.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:n?l.jsx("div",{className:"bottom-sm gap-sm pointer-events-auto absolute inset-x-0 flex flex-col",children:l.jsxs("div",{className:"px-sm gap-sm flex overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[b.map(C=>{const E=_.findIndex(k=>k.url===C.url),T=_[E];return T?l.jsx(nM,{place:C,isSelected:g?.url===C.url,onSelect:()=>{y(T)},onMouseEnter:()=>{v(T)},onMouseLeave:()=>v(null),isMobile:!0},C.url):null}),l.jsx("span",{className:"inline-flex items-center",children:l.jsx(wt,{icon:B("chevron-right"),"aria-label":t({defaultMessage:"See more places",id:"q6PxnN/+4O"}),variant:"secondary",size:"default",rounded:!0,disabled:!o,onClick:S})})]})}):l.jsxs("div",{className:"inset-y-sm right-sm pointer-events-auto absolute flex w-64 flex-col justify-between truncate",children:[b.map(C=>{const E=_.findIndex(k=>k.url===C.url),T=_[E];return T?l.jsx(nM,{place:C,isSelected:g?.url===C.url,onSelect:()=>{y(T)},onMouseEnter:()=>{v(T)},onMouseLeave:()=>v(null)},C.url):null}),l.jsx("span",{className:"bg-base rounded-lg",children:l.jsx(wt,{variant:"secondary",size:"small",fullWidth:!0,disabled:!o,onClick:S,trailingIcon:B("arrow-right"),children:t({defaultMessage:"See more places",id:"q6PxnN/+4O"})})})]})})]}):null},(e,t)=>Un(e,t)),nM=({place:e,isSelected:t,onSelect:n,onMouseEnter:r,onMouseLeave:s,isMobile:o=!1})=>l.jsx(K,{as:"button",onClick:n,onMouseEnter:r,onMouseLeave:s,className:z("hover:bg-subtler bg-base flex cursor-pointer overflow-visible rounded-lg border backdrop-blur-lg transition-colors",{"shadow-md":t,"shadow-sm":!t,"min-h-20 w-64 flex-shrink-0 flex-col p-2":o,"min-h-24 w-full items-center justify-between p-2.5":!o}),children:o?l.jsxs("div",{className:"gap-xs flex flex-col text-left",children:[l.jsx(V,{variant:"small",className:"!overflow-clip truncate font-medium leading-tight",children:e.name}),!!e.address?.length&&l.jsx(V,{variant:"tiny",color:"light",className:"!overflow-clip truncate",children:e.address?.join(", ")}),l.jsx("div",{className:"flex items-center",children:l.jsxs(ga,{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Bn,{id:"rating",children:l.jsx(ux,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"xs",variant:"truncated",textVariant:"tiny",reviewTextVariant:"tiny",color:"default"})}),(e.price||e.price_range)&&l.jsx(Bn,{id:"price",children:l.jsx(Hh,{textVariant:"tiny",priceSymbols:e.price,priceRange:e.price_range,dollarColor:"light",currencySymbol:e.currency_char})})]})}),e.operating_hours&&l.jsx(dx,{place:e,textVariant:"tiny",showTooltip:!1}),l.jsx("div",{className:"invisible flex-1"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gap-xs flex h-20 min-w-0 flex-1 flex-col justify-start text-left",children:[l.jsx(V,{variant:"small",className:"!overflow-clip truncate font-medium leading-tight",children:e.name}),!!e.address?.length&&l.jsx(V,{variant:"tiny",color:"light",className:"!overflow-clip truncate",children:e.address?.join(", ")}),l.jsx("div",{className:"flex items-center",children:l.jsxs(ga,{className:"gap-xs flex items-center",children:[e.rating&&l.jsx(Bn,{id:"rating",children:l.jsx(ux,{minReviewCount:1,reviewCount:e.num_reviews,rating:e.rating,size:"xs",variant:"truncated",textVariant:"tiny",reviewTextVariant:"tiny",color:"default"})}),(e.price||e.price_range)&&l.jsx(Bn,{id:"price",children:l.jsx(Hh,{textVariant:"tiny",priceSymbols:e.price,priceRange:e.price_range,dollarColor:"light",currencySymbol:e.currency_char})})]})}),e.operating_hours&&l.jsx(dx,{place:e,textVariant:"tiny",showTooltip:!1}),l.jsx("div",{className:"invisible flex-1"})]}),e.image_url&&l.jsx("div",{className:"ml-sm size-20 flex-shrink-0 overflow-hidden rounded-sm",children:l.jsx(Wo,{alt:`${e.name} image`,src:e.image_url,includeLightBoxModal:!1,containerClassName:"size-full",imageClassName:"size-full object-cover"})})]})});xde.displayName="MapsPreview";nM.displayName="PlaceCard";const vde=({widgetType:e,widgetName:t,hasData:n,metricName:r})=>{const{result:{mode:s}}=It(),o=h6();d.useEffect(()=>{if(!n)return;const a=r??`web.frontend.${e}_widget_render_time`;o(a,{widgetType:e,widgetName:t,queryMode:s,widgetSize:"full"})},[n,e,t,r,s,o])},Cyt=Ce(async()=>{const{CitationListModal:e}=await Se(()=>q(()=>Promise.resolve().then(()=>FN),void 0));return{default:e}}),Syt=12,Eyt=new Array(3).fill(null),bde="w-[166px]",_de=A.memo(({showSkeletonUnits:e,results:t})=>{const{$t:n}=J(),{isMobileStyle:r}=Re(),{openModal:s}=Uo(),{session:o}=Ne(),{trackEvent:a}=Xe(o);vde({widgetType:"news",widgetName:"news",hasData:t.length>0});const i=d.useCallback(()=>{a("clicked news results see more"),s(Cyt,{legacyIdentifier:"citationListModal",webResults:t,citationType:"articles"})},[s,t,a]),c=d.useMemo(()=>[...t.filter(f=>f.meta_data?.images&&f.meta_data.images.length>0),...t.filter(f=>!f.meta_data?.images||f.meta_data.images.length===0)],[t]),u=d.useMemo(()=>c.length===3?2:Math.min(4,c.length),[c]);return r?l.jsxs(K,{className:z("gap-sm","-mx-pageHorizontalPadding px-pageHorizontalPadding scrollbar-none grid auto-cols-max grid-flow-col overflow-x-auto"),children:[c.slice(0,Syt).map((f,m)=>l.jsx(rM,{result:f,idx:m,variant:"mobile"},`${f.url}-${f.timestamp}`)),e&&Eyt.map((f,m)=>l.jsx(K,{variant:"subtler",className:`h-16 ${bde} flex-shrink-0 rounded-lg`},m))]}):l.jsxs("div",{children:[l.jsxs("div",{className:"gap-x-xl mb-md relative grid grid-cols-2",children:[c.slice(0,u).map((f,m)=>l.jsx(rM,{result:f,idx:m,variant:"desktop",fullWidth:u==1,showBorder:m2},`${f.url}-${f.timestamp}`)),u>1&&l.jsx("div",{className:"border-subtlest absolute inset-y-0 left-1/2 w-0 border-l"})]}),l.jsxs("div",{className:"relative -ml-3",children:[l.jsx("div",{className:"bg-base relative z-10 w-fit",children:l.jsx(wt,{size:"small",variant:"text",onClick:i,children:n({defaultMessage:"See more news",id:"2MUZ4GQuje"})})}),l.jsx("hr",{className:"border-subtlest absolute inset-x-0 top-1/2"})]})]})});_de.displayName="NewsWidget";const rM=A.memo(({result:e,idx:t,variant:n,showBorder:r,fullWidth:s})=>{const{$t:o}=J(),{session:a}=Ne(),{trackEvent:i,trackEventOnce:c}=Xe(a),{result:u}=It(),f=yJ({trackEvent:i,entryUUID:u.backend_uuid,frontendContextUUID:u.uuid,contextUUID:u.context_uuid});d.useEffect(()=>{c("news source viewed",{url:e.url,title:e.name,position:t,entryUUID:u.backend_uuid,frontendContextUUID:u.uuid,contextUUID:u.context_uuid,published_date:e.meta_data?.published_date,domain_name:e.meta_data?.domain_name})},[c,e.url,e.name,e.meta_data?.published_date,e.meta_data?.domain_name,t,u.backend_uuid,u.uuid,u.context_uuid]);const m=d.useMemo(()=>()=>{f("news source clicked",{citation_url:e.url,citation_index:t})},[e,f,t]),p=e.meta_data?.images?.[0],h=d.useMemo(()=>({color:"light"}),[]);return n=="desktop"?l.jsx(Vy,{href:e.url,rel:"noopener",onTrackEvent:m,className:z("group",{"col-span-full":s}),children:l.jsx("div",{className:z({"pb-md mb-md border-subtlest border-b":r}),children:l.jsxs("div",{className:"gap-md flex h-24 flex-row",children:[l.jsxs("div",{className:"flex flex-1 flex-col max-w-[200px]",children:[l.jsx(V,{variant:"small",className:"group-hover:!text-super mb-auto line-clamp-3 transition-colors duration-200 font-medium",children:e.name}),l.jsxs("div",{className:"flex",children:[l.jsx(ya,{variant:"tinyRegular",color:"light",url:e.url,isAttachment:e.is_attachment,source:e.meta_data?.domain_name}),l.jsxs(V,{variant:"tiny",color:"light",className:"flex shrink-0 truncate",children:[l.jsx("span",{children:" · "}),l.jsx(pf,{recentlyUpdatedLabel:o({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.meta_data?.published_date,timestampProps:h,includeIcon:!1})]})]})]}),p&&l.jsx(sM,{src:p,alt:"",className:"aspect-[4/3] w-32"})]})})}):l.jsx(Vy,{href:e.url,rel:"noopener",onTrackEvent:m,children:l.jsxs(dr,{className:z("flex h-full cursor-pointer flex-col gap-2 rounded-lg p-1","border",`${bde} flex-shrink-0`),children:[p&&l.jsx(sM,{src:p,alt:"",className:"h-32 w-full"}),l.jsx(K,{className:"flex min-h-[60px] flex-1 flex-col justify-between p-2 pt-1",children:l.jsxs(K,{className:"flex flex-1 flex-col",children:[l.jsx(V,{variant:"small",className:"line-clamp-3",children:e.name}),l.jsx("div",{className:"mt-auto py-2",children:l.jsx(V,{variant:"tiny",color:"light",className:"gap-x-xs flex",children:l.jsx(pf,{recentlyUpdatedLabel:o({defaultMessage:"just now",id:"I90sbWU03C"}),timestamp:e.meta_data?.published_date,timestampProps:h,includeIcon:!1})})}),l.jsx(ya,{variant:"tinyRegular",color:"light",url:e.url,isAttachment:e.is_attachment})]})})]})})});rM.displayName="CitationTrendingCard";const sM=A.memo(({src:e,alt:t,className:n})=>{const[r,s]=d.useState(!1);return l.jsx(K,{className:z("relative overflow-hidden rounded-md bg-gray-100 dark:bg-gray-700",n),children:r?l.jsx(K,{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:l.jsx(ut,{name:B("photo"),size:32})}):l.jsx("img",{src:e,alt:t,className:"size-full object-cover",loading:"lazy",onError:()=>s(!0)})})});sM.displayName="TrendingImageThumbnail";const kyt=(e,t,n)=>{const{value:r,loading:s}=zt({flag:"news-ui",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},wde=A.memo(({submitQuery:e})=>{const{$t:t}=J(),{session:n}=Ne(),{trackEvent:r}=Xe(n),{removeWidgetFromEntry:s}=lv({reason:"thread-content"}),o=g0(),{result:a,widgetData:i,response:c,isEntryInFlight:u,financeWidgetData:f,newsWidgetData:m,weatherWidgetData:p,timeWidgetData:h,timerWidgetData:g,currencyExchangeWidgetData:y,predictionMarketWidgetData:x,calculatorWidgetData:v,flightStatusWidgetData:b,sportsWidgetData:_,priceComparisonWidgetData:w,genericFallbackWidgetData:S,highPriorityWidgets:C,lowPriorityWidgets:E,mapsPreviewData:T}=It(),{variation:k}=kyt(!1);vde({widgetType:"news",widgetName:"news_block",hasData:!!m?.web_results?.length,metricName:"web.frontend.news_block_received"});const{standardWidgetData:I,codeInterpreterImages:M}=i.reduce((X,ee)=>(ee.is_code_interpreter&&ee.is_image?X.codeInterpreterImages.push(ee):X.standardWidgetData.push(ee),X),{standardWidgetData:[],codeInterpreterImages:[]}),N=d.useMemo(()=>M.length>0,[M]),D=d.useMemo(()=>!N&&I.length>0,[N,I]),j=d.useMemo(()=>!1,[m?.web_results,a?.display_model,k]),F=d.useCallback(X=>{a?.frontend_context_uuid&&a?.backend_uuid&&(s({entryUUID:a.backend_uuid,data:X}),r("remove widget",{url:"url"in X?X.url:X?.links?.[0]?.url??"",entryUUID:a.backend_uuid,source:"thread"}))},[s,a?.backend_uuid,r,a?.frontend_context_uuid]),R=d.useCallback((X,ee,le,re,ce)=>{const ue=ce||("name"in X?X.name:"url"in X?X.url:X?.links?.[0]?.url??"");return l.jsx(z8,{data:X,submit:e,isReadonly:ee,menuItems:ee||u?[]:[{type:"default",text:t({defaultMessage:"Report",id:"x5Tz6MZH82"}),icon:B("thumb-down"),onClick:()=>le&&le(X)}],inFlight:u,entryUUID:a?.backend_uuid??null,tableCitationOffset:re},ue)},[u,e,t,a?.backend_uuid]),P=d.useCallback((X,ee,le)=>{const re={name:`${ee}-widget`,snippet:"",timestamp:"",url:"",meta_data:X,is_attachment:!1,is_image:!1,is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!0,sitelinks:[],inline_entity_id:""};return R(re,o,F,c?.web_results?.length,le)},[F,o,c?.web_results?.length,R]),L=d.useCallback(X=>R(X,o,F,c?.web_results?.length),[F,o,c?.web_results?.length,R]),U=d.useCallback(X=>P(X,"sports"),[P]),O=d.useCallback(X=>P(X,"weather"),[P]),$=d.useCallback(X=>P(X,"time"),[P]),G=d.useCallback(X=>P(X,"timer"),[P]),H=d.useCallback(X=>P(X,"currency_exchange"),[P]),Q=d.useCallback(X=>P(X,"prediction-market"),[P]),Y=d.useCallback(X=>P(X,"calculator"),[P]),te=d.useCallback(X=>P(X,"flight-status"),[P]),se=d.useCallback(X=>P(X,"price-comparison"),[P]),ae=d.useCallback(X=>P(X,"generic-fallback"),[P]);return l.jsxs(l.Fragment,{children:[f&&l.jsx(H8,{data:f}),j&&m&&l.jsx(_de,{results:m.web_results}),N&&M.map(X=>l.jsx("div",{children:R(X,o)},X.url)),D&&C.map(L),S&&ae(S),p&&O(p),h&&$(h),g&&G(g),y&&H(y),x&&Q(x),v&&Y(v),b&&te(b),_&&U(_),w&&se(w),D&&E.map(L),T&&T.place_widgets.length>0&&l.jsx(xde,{placeWidgets:T.place_widgets})]})});wde.displayName="WidgetsSection";const Myt=Ce(async()=>{const{MarkSpinner:e}=await Se(()=>q(()=>import("./MarkSpinner-DXbfFXdV.js").then(t=>t.a),__vite__mapDeps([29,4,1])));return{default:e}}),Tyt=A.memo(({title:e,titleIcon:t,titleAccessory:n,titleUrl:r,showPplxMark:s,queryStr:o,loading:a,className:i="mb-md"})=>{const{session:c}=Ne(),{trackEvent:u}=Xe(c),[f,m]=d.useState(!1),p=d.useCallback(()=>{r!=null&&(u("click result entry header",{query:o}),window.open(r,"_blank")?.focus())},[u,o,r]);return l.jsxs("div",{className:z("flex w-full items-center justify-between",i),children:[l.jsx("div",{onClick:p,className:z({"cursor-pointer":r!=null}),children:l.jsxs("div",{color:"super",className:"space-x-sm flex items-center",children:[(s||t)&&l.jsx(V,{variant:"section-title",as:"div",children:s?l.jsx("div",{className:"relative -top-px flex w-[24px] transform-gpu items-center justify-center",onClick:()=>{m(!0),setTimeout(()=>{m(!1)},0)},children:l.jsx(Myt,{size:24,shouldAnimate:a||f})}):t&&l.jsx("div",{className:"w-[24px]",children:l.jsx(rn,{icon:t,size:"large"})})}),l.jsx(V,{variant:"section-title",as:"div",children:e})]})}),n]})});Tyt.displayName="ThreadEntryHeader";const Cde=A.memo(({header:e,children:t})=>l.jsxs(K,{children:[e&&l.jsx(K,{variant:"background",className:"flex items-center justify-between",children:e}),t]}));Cde.displayName="ThreadEntrySection";const Ayt=Ce(async()=>{const{ConnectorAuthorizationPrompt:e}=await Se(()=>q(()=>import("./ConnectorAuthorizationPrompt-W74w80u2.js"),__vite__mapDeps([466,4,1,6,3,8,9,7,10,11,12])));return{default:e}}),Nyt=Ce(async()=>{const{ThreadEntryFooter:e}=await Se(()=>q(()=>import("./ThreadEntryFooter-C2ACX__g.js"),__vite__mapDeps([467,4,1,8,3,9,6,7,468,101,102,81,47,469,470,471,472,49,50,473,474,475,10,11,12])));return{default:e}}),Ryt=Ce(async()=>{const{RelatedContent:e}=await Se(()=>q(()=>import("./Related-C29vANZf.js"),__vite__mapDeps([476,4,1,6,3,472,477,9,7,478,474,8,10,11,12])));return{default:e}}),Dyt=Ce(async()=>{const{StudyModeRelated:e}=await Se(()=>q(()=>import("./StudyModeRelated-Dy_zxdoW.js"),__vite__mapDeps([479,4,1,6,3,472,477,9,7,8,10,11,12])));return{default:e}}),jyt=Ce(async()=>{const{ThreadContentResponse:e}=await Se(()=>q(()=>import("./ThreadContentResponse-DxwJeMuW.js"),__vite__mapDeps([480,4,1,6,3,55,8,9,7,54,468,101,102,81,47,469,470,471,472,49,50,473,53,10,11,12])));return{default:e}}),Iyt=Ce(()=>Se(()=>q(()=>import("./AnswerComparisonModal-DYnELi4M.js"),__vite__mapDeps([481,4,1,6,3,480,55,8,9,7,54,468,101,102,81,47,469,470,471,472,49,50,473,53,10,11,12])))),Sde=A.memo(({streamId:e,backendUuid:t})=>{throw new Ol("STREAM_FAILED_PLACEHOLDER_ERROR",{details:{request_id:e,backend_uuid:t}})});Sde.displayName="FailedPlaceholderError";const Ede=A.memo(({submitQuery:e,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o,shouldShowRelatedContent:a=!0,sbsEntriesGroup:i})=>{const c="thread-content",{isMobileStyle:u}=Re(),{session:f}=Ne(),{trackEvent:m}=Xe(f);lv({reason:c});const{result:p,isEntryInFlight:h,response:g,hasLLMToken:y,isAnswerSkipped:x,steps:v,isPending:b,hasMediaOnlyLayout:_,isAgentWorkflowInFlight:w,isFinalStep:S,taskWidgetData:C,hasFastWidget:E,isLastResult:T,idx:k,hasAnswer:I,hasWebResults:M}=It(),N=e1e(),D=j4(),j=ZJ(),F=d.useRef(null),R=d.useMemo(()=>{const Le=p?.side_by_side_metadata?.selection_status;return Le===aa.SELECTED||Le===aa.TIE},[p?.side_by_side_metadata?.selection_status]),P=d.useMemo(()=>i.length<1?[]:[...i].sort((Le,gt)=>Le.backend_uuid.slice(-8).localeCompare(gt.backend_uuid.slice(-8),void 0,{sensitivity:"base"})),[i]),{trackJudgment:L,trackBannerExposure:U,trackSBSExposure:O}=Hve({results:P,session:f,trackEvent:m}),$=d.useMemo(()=>{const Le=p?.side_by_side_metadata?.sibling_uuid;return Le?vt.getItem(`sbs-banner-dismissed-${Le}`)==="true":!1},[p?.side_by_side_metadata?.sibling_uuid]),G=d.useMemo(()=>i.length>1,[i]),H=d.useMemo(()=>p?.side_by_side_metadata?.sibling_uuid,[p]),Q=d.useMemo(()=>p?.display_model==="pplx_study",[p?.display_model]),Y=d.useMemo(()=>j?!$&&(R||G&&I):!1,[$,j,G,R,I]),te=d.useCallback(()=>{H&&vt.setItem(`sbs-banner-dismissed-${H}`,"true")},[H]);d.useEffect(()=>{Y&&U()},[Y,U]);const[se,ae]=d.useState(!1),X=d.useMemo(()=>P.map(Le=>qt.parseAskTextField(Le)??void 0).filter(Le=>Le!==void 0),[P]),ee=d.useCallback(async Le=>{try{L(Le);const gt=P[0]?.side_by_side_metadata?.sibling_uuid;await o_e(Le,P,gt,D),ae(!1)}catch(gt){Z.error("Failed to process answer selection:",gt)}},[P,D,L]),le=d.useCallback(()=>{ae(!0),O()},[O]),re=d.useCallback(async()=>{if(p.upsell_information?.upsell_type!=="WAIT_FOR_CONNECTOR_AUTH_CONFIRMATION")return;const Le=p?.backend_uuid;Le&&await cl({uuid:Le,event_type:"CONNECTOR_AUTH",connector_auth_action:!1})},[p?.backend_uuid,p.upsell_information?.upsell_type]),ce=d.useMemo(()=>i.some(Le=>qt.isStatusPending(Le)),[i]),ue=d.useMemo(()=>{if(!p?.query_str)return"";const{actualQuery:Le}=qx(p.query_str);return Le||""},[p?.query_str]),me=d.useCallback(()=>ae(!1),[]),we=d.useMemo(()=>!u,[u]),ye=d.useRef(null),{hasAccessToProFeatures:_e}=$t();bJ({entryUUID:p?.backend_uuid??"",target:ye,targetVisibilityPortionThreshold:.3,frontendContextUUID:p?.frontend_context_uuid??"",hasLLMToken:y});const ke=un(),De=mFe(),xe=bH(p?.frontend_uuid),Ue=o1e(p?.backend_uuid),Ee=qt.isStatusFailed(p),Ke=Ee&&p.reconnectable&&xe;d.useEffect(()=>{ke.maybeSendSearchResult(g,v,b)},[b,M,g,ke,v]);const Nt=d.useCallback(()=>{N(p.backend_uuid??"")||hx("Retry stream")},[p.backend_uuid,N]),pe=d.useMemo(()=>()=>l.jsx(Kf,{retryFn:Nt,errorCode:Ue?.code}),[Nt,Ue?.code]),ve=d.useMemo(()=>Q&&(k+1)%Ahe===0,[Q,k]),Ae=a&&!ve,We=E,Gt=d.useMemo(()=>!!(_||x||We||!w&&(S||E)),[_,x,We,w,S,E])?"thread":"steps";return l.jsxs(l.Fragment,{children:[Y&&l.jsx(Goe,{onClick:le,didSelectAnswer:R,onDismiss:te}),p?.connector_auth_info&&l.jsx(Ayt,{connectorAuthInfo:p.connector_auth_info,isLastResult:T,backendUuid:p?.backend_uuid,inFlight:h}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx(Jd,{position:"top",idx:k,upsellInformation:p.blocking_banner_information,backendUuid:p?.backend_uuid,isLastResult:T,inFlight:h,onReject:re})}),De&&h&&l.jsx(fFe,{data:De}),l.jsxs(Dp,{value:Gt,animation:"fade",children:[l.jsx(Dp.Panel,{value:"steps",children:l.jsx(Ty,{defaultExpanded:!0,forceLoadingHeader:!0})}),l.jsx(Dp.Panel,{value:"thread",children:l.jsx(Cde,{children:l.jsxs("div",{className:"gap-y-md flex flex-col",children:[!E&&l.jsx(Ty,{}),l.jsx(wde,{submitQuery:e}),E&&l.jsx(Ty,{}),l.jsx(jyt,{submitQuery:e,setQuote:o,markdownRef:F,response:g}),_e&&j&&C&&l.jsx(Kue,{taskWidgetData:C,submitQuery:e}),l.jsx(Nyt,{submitQuery:e,deleteLastResult:s,showSourcesSidebar:we,markdownRef:F}),l.jsx(Hd,{isSamsungBrowser:!0,isFirefoxDefaultSearch:!0,children:l.jsx(Jd,{position:"bottom",idx:k,upsellInformation:p.upsell_information,backendUuid:p?.backend_uuid,isLastResult:T,inFlight:h,contextUuid:p?.context_uuid})})]})})})]}),l.jsxs("div",{className:"gap-y-lg flex flex-col first:mt-0",children:[Ee&&!Ke&&l.jsx(Mr,{fallback:pe,children:l.jsx(Sde,{streamId:Ue?.id.description??"unknown",backendUuid:Ue?.entryId??"unknown"})}),Ae&&l.jsx(Ryt,{shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,submitQuery:e}),ve&&l.jsx(Dyt,{onClick:e})]}),G&&l.jsx(Iyt,{isOpen:se,onClose:me,responses:X,queryStr:ue,onSelectAnswer:ee,isAnyEntryPending:ce})]})});Ede.displayName="LowerPriorityThreadContent";const Pyt=e=>{const{result:{classifier_results:t,query_source:n}}=It(),r=h6(),{classifierResults:s}=Qn(),o=t,a=typeof o<"u",i=s[e],c=typeof i<"u",u=n==="default_search";return d.useEffect(()=>{u&&(a&&r("web.frontend.browser.mhe_loaded_ms"),c&&r("web.frontend.browser.mhe_extension_loaded_ms"))},[a,c,u,r]),i??o},Oyt=(e,t,n)=>{const{value:r,loading:s}=kf({flag:"nav_results_count_classifier",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Lyt=(e,t,n)=>{const{value:r,loading:s}=kf({flag:"nav-intent-classifier",defaultValue:e,extraAttributes:t,subjectType:"visitor_id",shortCircuitCases:n});return d.useMemo(()=>({variation:r,loading:s}),[r,s])},Fyt=(e,t)=>t.classifier==="comet_nav_widget"?e.mhe_predictions_full?.comet_nav_widget:t.classifier==="comet_nav_widget_combined_target"?e.mhe_predictions_full?.comet_nav_widget_combined_target:e.mhe_predictions_full?.comet_nav_widget,Byt=(e,t)=>{const n=Ca(),r=Fyt(e,t);if(!n)return"top";if(t.use_default_threshold)return r?.is_true?"top":"hidden";const o=t.threshold,a=r?.probability,i=a!=null&&!isNaN(a)&&!isNaN(o)&&a>=o;return r&&i?"top":"hidden"},Uyt=(e,t)=>{if(!t)return"hidden";const n=t?.mhe_predictions;return n?.personal_search||n?.skip_search||n?.image_generation_intent||n?.time_widget||n?.weather_widget||n?.calculator_widget?"hidden":e.classifier==="nav_intent"?"top":e.classifier==="comet_nav_widget"||e.classifier==="comet_nav_widget_combined_target"?Byt(t,e):"top"},Vyt={classifier:"nav_intent",use_default_threshold:!0,threshold:0},Hyt=({classifierResults:e,resultStatus:t})=>{const n=typeof e>"u",{variation:r,loading:s}=Lyt(Vyt),o=Uyt(r,e),a=d.useMemo(()=>s||n||Object.keys(e??{}).length===0&&t==="COMPLETED"?!0:o==="hidden",[o,n,e,t,s]),i=d.useMemo(()=>!n,[n]);return d.useMemo(()=>({shouldHideNavResults:a,classificationsLoaded:i,navResultsPosition:o}),[a,i,o])},zyt=2,Wyt={classifier_name:"comet_nav_widget",number:2,threshold:.2,use_default_threshold:!0},kde=A.memo(({sbsEntriesGroup:e,submitQuery:t,shouldShowProductFeedback:n,feedbackEntryUUID:r,shouldShowRecruitmentBanner:s,deleteLastResult:o,setQuote:a})=>{const{isMobileStyle:i}=Re(),c=Yt(),u=h6(),{result:f,response:m,hasLLMToken:p,searchMode:h,isFirstResult:g,webResults:y,steps:x,isPending:v}=It();QOe(),YOe();const b=W4(),_=d.useMemo(()=>{if(!f?.query_str)return"";const{actualQuery:ee}=qx(f.query_str);return ee||""},[f?.query_str]),w=d.useMemo(()=>!i,[i]),S=d.useRef(null);bJ({entryUUID:f?.backend_uuid??"",target:S,targetVisibilityPortionThreshold:.3,frontendContextUUID:f?.frontend_context_uuid??"",hasLLMToken:p});const{variation:C,loading:E}=Oyt(Wyt),T=f?.frontend_uuid,k=Pyt(T??""),I=d.useMemo(()=>Math.max(uLe(k,C,E),zyt),[k,C,E]),{trackCitationClickEvent:M,navigationResults:N}=oLe({allowedNavResultsCount:I,entry:f,webResults:y,showSourcesSidebar:w,searchMode:h,isFirstResult:g}),D=An(),j=un(),{navigationResults:F}=Qn(),R=F[T??""]??Pe,P=bH(T),L=d.useMemo(()=>R.length>0,[R]),U=d.useMemo(()=>D&&(R.length||P)?R:N||Pe,[D,R,N,P]),O=d.useMemo(()=>U?{serverRequestTimestamp:c.getQueryData(["serverRequestTimestamp",f?.query_str??void 0,f?.uuid??void 0])}:{serverRequestTimestamp:void 0},[c,f?.query_str,U,f?.uuid]),$=d.useMemo(()=>U?.slice(0,I)?.map((ee,le)=>({...ee,position:le,source:O.serverRequestTimestamp?"default_search":"client_search",client_request_timestamp:b(),unstable_server_request_timestamp:O.serverRequestTimestamp||void 0,sitelinks:ee.sitelinks?.map((re,ce)=>({url:re.url,title:re.title,position:ce,snippet:re?.snippet??""})),is_comet_navigation:L,navigation_source:L?Ld.COMET:"navigation_source"in ee?ee.navigation_source:void 0})),[b,U,O.serverRequestTimestamp,L,I]),G=d.useMemo(()=>!!y&&y.length>0,[y]),H=d.useMemo(()=>f?.search_focus==="writing",[f?.search_focus]),Q=d.useMemo(()=>f?.display_model==="pplx_study",[f?.display_model]),{shouldHideNavResults:Y,navResultsPosition:te}=Hyt({classifierResults:k,resultStatus:f?.status??""}),se=d.useMemo(()=>g&&!1,[Y,$,f.attachments?.length,H,h,Q,g]),ae=d.useMemo(()=>se&&te==="top",[se,te]);d.useEffect(()=>{j.maybeSendSearchResult(m,x,v)},[v,G,m,j,x]);const X=d.useCallback(()=>{f?.query_source==="default_search"?u("web.frontend.omnisearch_nav_results_shown",{omnisearch:b()!==0,is_comet_navigation:L}):u("web.frontend.nav_results_shown",{is_comet_navigation:L})},[L,f?.query_source,u,b]);return l.jsxs("div",{className:"gap-y-md mt-md flex flex-col",ref:S,children:[ae&&l.jsx(kJ,{navResults:$,queryStr:_,querySource:f?.query_source,backendUUID:f?.backend_uuid,frontendUUID:f?.frontend_uuid,trackCitationClickEvent:M,onMount:X}),l.jsx(Ede,{submitQuery:t,shouldShowProductFeedback:n,feedbackEntryUUID:r,shouldShowRecruitmentBanner:s,deleteLastResult:o,setQuote:a,shouldShowNavResults:se,sbsEntriesGroup:e})]})});kde.displayName="ThreadContent";const Gyt=Ce(async()=>{const{ThreadEntryDebugTiming:e}=await Se(()=>q(()=>import("./ThreadEntryDebugTiming-qoiCHgUu.js"),__vite__mapDeps([482,4,1,6,3,124,8,9,7,125,10,11,12])));return{default:e}},{restricted:!0}),$yt=Ce(async()=>{const{BugReportModal:e}=await Se(()=>q(()=>import("./DebugModal-CnQSSY34.js"),__vite__mapDeps([483,4,1,8,3,9,6,7,475,10,11,12])));return{default:e}},{loading:()=>l.jsx(Bt,{})}),qyt=({isLastResult:e,title:t,backend_uuid:n,width:r,children:s})=>{const{openModal:o}=pn().updated,a=d.useCallback(()=>{o($yt,{legacyIdentifier:"bugReportModal"})},[o]);return l.jsx("div",{className:"bg-base erp-sidecar:pt-0 erp-mobile-sidecar:pt-0",children:l.jsxs("div",{className:z("mx-auto",{"max-w-threadContentWidth":r==="default","max-w-none":r==="full","max-w-threadWidth":r==="wide"}),children:[t&&l.jsx("div",{className:"max-w-threadContentWidth relative isolate z-20 mx-auto",children:t}),s&&l.jsx("div",{className:"mt-xs",children:s}),l.jsx(Gyt,{backend_uuid:n,onBugReportClick:a,expandedDefault:e})]})})},Kyt=A.memo(qyt),Mde=A.memo(({submitQuery:e})=>{const t="trigger-entry-rewrite",n=fn(),{result:{backend_uuid:r,frontend_context_uuid:s,attachments:o,display_model:a,query_str:i},idx:c}=It(),u=g0(),f=window.location.hash.slice(1),m=parseInt(f,10),p=n?.get("rw")==="true";return d.useEffect(()=>{if(!p||isNaN(m)||c!==m)return;lE({rw:void 0});const h=()=>e({rawQuery:i??"",existingEntryUUID:r,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:u?void 0:s,promptSource:"user",querySource:"rewrite-url-param",attachments:o,modelPreferenceOverride:a});r?au({entryUUID:r,reason:t}).catch(g=>{Z.error("Error terminating entry",g)}).finally(h):h()},[p,u,e,m,c,r,i,s,o,a]),null});Mde.displayName="TriggerEntryRewrite";const Tde=A.memo(()=>l.jsx(br,{children:l.jsx(K,{variant:"subtler",className:"h-[180px] w-full overflow-hidden rounded-xl [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]"})}));Tde.displayName="JobsModeLoader";const x0=A.memo(({type:e,className:t,queryString:n})=>{const r=J(),s=d.useMemo(()=>{const o="font-medium",a="opacity-80";switch(e){case"images":return r.formatMessage({defaultMessage:"Image results for: {queryString}",id:"VzXivLJ8I5"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"videos":return r.formatMessage({defaultMessage:"Video results for: {queryString}",id:"2ZaRrQuRh/"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"sources":return r.formatMessage({defaultMessage:"Search results for: {queryString}",id:"Fjmx7PbD5i"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"shopping":return r.formatMessage({defaultMessage:"Shopping results for: {queryString}",id:"pB1ogBtGI4"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"jobs":return r.formatMessage({defaultMessage:"Job results for: {queryString}",id:"NLhbH5fRMB"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});case"places":return r.formatMessage({defaultMessage:"Place results for: {queryString}",id:"0FDKKyti5d"},{queryString:n,bold:i=>l.jsx("span",{className:o,children:i}),light:i=>l.jsx("span",{className:a,children:i})});default:return""}},[n,e,r]);return n?l.jsx(V,{variant:"small",color:"light",className:z("mb-md",t),children:s}):null});x0.displayName="ResultsLabel";const Ade=d.memo(()=>{const{isMobileStyle:e}=Re();return l.jsxs(l.Fragment,{children:[l.jsx(x0,{type:"shopping",queryString:""}),l.jsxs(br,{className:"-mx-md pl-md md:mx-auto md:pl-0",children:[l.jsx("div",{className:"gap-md md:mb-lg mb-md flex auto-rows-fr grid-cols-2 overflow-hidden md:grid md:grid-cols-3",children:Array.from({length:3}).map((t,n)=>l.jsx(Nde,{},n))}),l.jsxs("div",{className:"gap-sm flex flex-col",children:[l.jsxs("div",{className:"grid grid-cols-1 grid-rows-1 items-center",children:[l.jsx(V,{variant:e?"base":"section-title",className:"col-start-1 row-start-1",children:" "}),l.jsx("div",{className:"bg-subtler col-start-1 row-start-1 h-3 w-32 grow rounded-full md:h-4"})]}),l.jsx("div",{className:"gap-md pr-md flex auto-rows-fr grid-cols-2 flex-col md:grid md:pr-0",children:Array.from({length:2}).map((t,n)=>l.jsx(Rde,{},n))})]})]})]})});Ade.displayName="ShoppingModeLoader";const Nde=d.memo(()=>l.jsx("div",{className:"bg-subtler aspect-video h-[327px] w-[70vw] grow rounded-xl md:h-[413px] md:w-full"}));Nde.displayName="Item";const Rde=d.memo(()=>l.jsx("div",{className:"bg-subtler aspect-video h-[144px] w-full grow rounded-md"}));Rde.displayName="SmallItem";const Yyt=10,Qyt=async({request:e,reason:t})=>{if(e.page&&e.page>Yyt)throw new he("API_CLIENTS_ERROR",{message:"Max search results page number is too large",status:400});const{data:n}=await de.POST("/rest/sources/search",t,{body:{entry_uuid:e.entry_uuid,limit:e.limit,page:e.page??null},timeoutMs:Cn.MEDIUM});return n},Xyt=({reason:e})=>{const{mutate:t,data:n,isPending:r}=Rt({mutationFn:async s=>(await Qyt({request:s,reason:e})).results});return d.useMemo(()=>({isSearchResultsLoading:r,searchResults:n,fetchSearch:t}),[t,r,n])},Km="line-clamp-1 leading-[0.875rem]",Dde=A.memo(({webResult:e,citationIndex:t,isRelatedResult:n,linkOnClick:r,imageToShow:s})=>{const{$t:o,formatDate:a}=J(),[i,c]=d.useState(!1),u=d.useMemo(()=>Ur(e.url),[e.url]),f=d.useMemo(()=>$c(e.url),[e.url]),m=e.is_client_context,p=Ca(),{isMobileStyle:h}=Re(),g=d.useMemo(()=>e.meta_data?.domain_name??u.replace(/\.[^.]*$/,""),[u,e.meta_data?.domain_name]),y=kr(e.url),x=Uf(e),v=q2e(e),b=e.meta_data?.connection_type,_=fN(),w=e.file_metadata?.file_repository_type,S=!m||p||!x,C=yb(e),E=DKe(e),T=Wg(e),k=()=>w=="COLLECTION"?o({defaultMessage:"Space Context",id:"wGTk8CFt1g"}):w=="USER"?o({defaultMessage:"My Files",id:"AjhJXSvkRs"}):w=="ORG"?o({defaultMessage:"Org Files",id:"DaFSYzpM1Q"}):o({defaultMessage:"Attachment",id:"eLCAEP8LHj"}),I=()=>e.file_metadata?.file_repository_type=="COLLECTION"?o({defaultMessage:"File",id:"gyrIElu9qY"}):e.meta_data?.connection_type?eCe(e.meta_data.connection_type):o({defaultMessage:"Local upload",id:"fscjAJoLwa"}),M=d.useMemo(()=>l.jsx(NA,{size:"tiny",showBackground:!1,rounded:!1,user:Zwe(b)??void 0}),[b]);let N=null,D="",j=null;if(y||v||b&&b!==Zn.WILEY)N=l.jsx("div",{className:"bg-subtler flex size-6 items-center justify-center rounded-full",children:b?l.jsx(ge,{icon:ype,size:"xl",badge:M}):l.jsx(ge,{icon:B("file"),className:"size-md",size:"xl"})}),j=l.jsx(V,{variant:"micro",color:"light",className:Km,children:I()}),D=k();else if(C&&!T)N=l.jsx("div",{className:"bg-subtle flex size-6 items-center justify-center rounded-full",children:l.jsx(ge,{size:"xl",icon:e.is_memory?B("bubble-text"):B("list-search")})}),j=l.jsx(V,{variant:"micro",color:"light",className:Km,children:e.timestamp&&a(e.timestamp,{dateStyle:"long"})}),D=e?.is_memory?o({defaultMessage:"Memory",id:"dVx3yznM2C"}):o({defaultMessage:"Library",id:"StcK672jB9"});else{const F=b===Zn.WILEY?Fd:void 0;N=l.jsx(Po,{size:24,domain:f,className:"size-full rounded-full",overrideIconUrl:F}),D=g,j=T?l.jsxs("div",{className:"gap-xs -ml-two flex flex-row items-center",children:[l.jsx(V,{variant:"tiny",color:"super",className:"-translate-y-px",children:l.jsx(ge,{size:"xs",icon:B("user-search")})}),l.jsx(V,{variant:"micro",color:"super",className:Km,children:l.jsx(je,{defaultMessage:"Personal Search",id:"TZougEncQH",description:"subtitle"})})]}):l.jsx(V,{variant:"micro",color:"light",className:Km,children:iz(az(e.url))})}return l.jsx("div",{className:"gap-md relative items-start",children:l.jsxs("div",{className:"gap-lg relative flex w-full flex-row items-start lg:pl-0",children:[l.jsxs("div",{className:"flex min-w-0 grow flex-col",children:[l.jsxs(yt,{href:e.url,className:z("group/source flex flex-1 flex-col gap-1",{"cursor-pointer":!y&&S}),onClick:r,children:[l.jsxs("div",{className:"gap-sm flex flex-row items-center",children:[l.jsx("div",{className:"size-6 shrink-0",children:N}),l.jsxs("div",{className:"flex flex-1 flex-col",children:[l.jsx("div",{className:"flex flex-row items-center gap-1.5",children:l.jsxs(V,{variant:"tiny",className:Km,color:"light",children:[!n&&t&&!_?t+". ":null,D]})}),j]}),C&&l.jsx(V,{variant:"tiny",color:"light",children:l.jsx(ge,{size:"xs",icon:B("user-search")})})]}),E?null:l.jsx(V,{variant:h?"baseSemi":"section-title",color:"super",className:z("decoration-super/50 duration-normal line-clamp-1 decoration-1 underline-offset-2 transition-colors",{"group-hover/source:underline":!y&&S}),children:e.name})]}),l.jsx(V,{variant:"small",color:"light",className:z("line-clamp-3 whitespace-pre-wrap leading-snug",{"pt-2":E}),children:e.meta_data?.generated_file_description??e.meta_data?.description??e.snippet})]}),s&&l.jsxs(yt,{href:e.url,className:z("relative ml-auto aspect-square h-fit w-20 shrink-0 cursor-pointer overflow-hidden rounded-md pt-1",{hidden:!i,"sm:block":i}),onClick:r,children:[l.jsx(Wo,{src:s,alt:"image",containerClassName:"absolute inset-0",imageClassName:"absolute inset-0 object-cover object-center w-full h-full",includeLightBoxModal:!1,onLoad:()=>c(!0)}),l.jsx("div",{className:"rounded-inherit absolute inset-0 border border-[black]/10 dark:border-transparent"})]})]})})});Dde.displayName="PrimitiveSourcesRow";const jde=A.memo(({webResult:e,citationIndex:t,isRelatedResult:n})=>{const r="sources-row",{result:{backend_uuid:s,context_uuid:o,frontend_context_uuid:a}}=It(),i=un(),c=An(),u=kr(e.url),f=Uf(e),{session:m}=Ne(),{trackEvent:p}=Xe(m),h=d.useCallback((E,T)=>{c&&i.openTab({url:E,tabId:T})},[c,i]),{mutate:g}=Wv({reason:r,onSuccess:c?h:void 0}),y=oN(),x=yb(e),v=Wg(e),{getImageDownloadUrl:b}=Mv({reason:r}),[_,w]=d.useState(null);d.useEffect(()=>{_===null&&(async()=>{if(!u){w(e.url);return}if(A4(e.url)){w(e.url);return}try{const T=await b({url:e.url,thread_id:s});w(T)}catch(T){Z.error(`Failed to fetch image source ${T}`),w(e.url)}})()},[b,s,e,u,_]),d.useEffect(()=>{p("source card viewed",{citation_url:e.url,position:t,title:e.name,contextUUID:o,frontendContextUUID:a,entryUUID:s,source:n?"sourcesTabViewMore":"sourcesTab"})},[e,p,t,n,o,a,s]);const S=d.useCallback(async E=>{try{const k=e.meta_data?.file_uuid?"fileRepositoryFile":e.is_attachment?"fileAttachment":n?"sourcesTabViewMore":"sourcesTab",I=sN(e),{type:M,memoryKey:N}=I,D=Gg(e);p("click citation",{citation_url:e.url,contextUUID:o,frontendContextUUID:a,entryUUID:s,isMemory:e.is_memory,isConversationHistory:e.is_conversation_history,source:k,...D,...M==="memory"&&{memory_key:N}})}catch(k){Z.error("Failed to send click citation event:",k)}if(x&&!v){E.preventDefault(),y(e);return}if(f){E.preventDefault();return}if(Yl(e)){E.preventDefault(),g({file_url:e.url});return}if(Dx(E)){E.preventDefault(),i.openTab({url:e.url,tabId:e.tab_id}).catch(()=>{window.open(e.url,"_blank")});return}},[x,e,n,p,o,a,s,y,i,g,v,f]),C=d.useMemo(()=>{if(u)return _;if(typeof e.meta_data?.image_url=="string")return e.meta_data.image_url;if(typeof e.meta_data?.images?.[0]=="string")return e.meta_data.images[0];if(typeof e.meta_data?.images?.[0]?.src=="string")return e.meta_data.images[0].src},[u,e,_]);return l.jsx(Dde,{webResult:e,citationIndex:t,isRelatedResult:n,linkOnClick:S,imageToShow:C})});jde.displayName="SourcesRow";function Zyt(){const{blocksByIntendedUsage:{answer_tabs:e},steps:t,result:{query_str:n}}=It(),r=d.useMemo(()=>{const s=e?.answer_tabs_block?.reformulated_queries??[];if(s[0])return s[0];const o=t.find(a=>a.step_type==="SEARCH_WEB")?.content.queries?.[0]?.query;return o||(n??"")},[e?.answer_tabs_block?.reformulated_queries,n,t]);return d.useMemo(()=>({reformulatedQuery:r}),[r])}const Jyt=10,Ide=A.memo(()=>{const e="sources-mode",{$t:t}=J(),n=e2t({dedupeAttachments:!0}),{isEntryInFlight:r,result:s}=It(),{firstResult:o}=on(),{reformulatedQuery:a}=Zyt(),{fetchSearch:i,isSearchResultsLoading:c}=Xyt({reason:e}),f=s===o?s.query_str??"":a,[m,p]=d.useState(1),[h,g]=d.useState([]),y=Wt(),{openModal:x}=pn().legacy,v=d.useMemo(()=>m==1&&y&&!r&&n.selectedSources.length==0&&n.reviewedSources.length==0&&n.unsortedSources.length==0,[m,r,y,n.reviewedSources.length,n.selectedSources.length,n.unsortedSources.length]),[b,_]=d.useState(!1),w=d.useCallback(()=>{if(b)return;const E=m+1;i({entry_uuid:s.backend_uuid??"",limit:Jyt,page:E},{onSuccess:T=>{g([...h,...T]),p(E)}})},[m,i,b,h,s.backend_uuid]);d.useEffect(()=>{v&&(w(),_(!0))},[w,v]),d.useCallback(()=>{if(!y){x("loginModal",{origin:ft.SOURCES_VIEW_MORE});return}w()},[w,y,x]);const S=!1,C=d.useMemo(()=>n.attachedSources.length>0||n.selectedSources.length>0||n.reviewedSources.length>0||n.reviewingSources.length>0||n.unsortedSources.length>0,[n.attachedSources.length,n.selectedSources.length,n.reviewedSources.length,n.reviewingSources.length,n.unsortedSources.length]);return l.jsxs(l.Fragment,{children:[l.jsx(x0,{type:"sources",queryString:f,className:C?"pb-sm":void 0}),l.jsxs("div",{children:[l.jsx(Zu,{heading:n.selectedSources?.length>0?t({defaultMessage:"Attached",id:"2IacYt8NB7"}):void 0,sources:n.attachedSources}),l.jsx(Zu,{heading:n.attachedSources?.length>0?t({defaultMessage:"Sourced",id:"P5KqlvUgRC"}):void 0,sources:n.selectedSources}),l.jsx(Zu,{heading:t({defaultMessage:"Reviewed",id:"wiy+GNv+BV"}),sources:n.reviewedSources}),l.jsx(Zu,{heading:t({defaultMessage:"Reviewing",id:"L+ISAVX7+d"}),sources:n.reviewingSources,shimmer:!0}),l.jsx(Zu,{sources:n.unsortedSources}),S]})]})});Ide.displayName="SourcesMode";const Zu=A.memo(({sources:e,heading:t,shimmer:n=!1})=>e.length===0?null:l.jsxs("div",{className:"my-md md:mt-lg group first:mt-0",children:[t?l.jsxs("div",{className:"mb-md relative",children:[l.jsx("hr",{className:"bg-subtle absolute top-1/2 h-px w-full border-0 group-first:hidden"}),l.jsx("div",{className:"bg-base",children:l.jsx(V,{variant:"tiny",color:"light",className:"mb-md bg-base pr-sm relative z-[1] w-fit",children:l.jsx(br,{variant:"super",active:n,as:"span",children:t})})})]}):null,l.jsx(K,{className:"flex min-w-0 flex-col gap-4 md:gap-8",children:e.map(r=>l.jsx(jde,{webResult:r.web_result,citationIndex:r.citation},r.web_result?.url))})]}));Zu.displayName="SourcesModeSection";const e2t=({dedupeAttachments:e=!1})=>{const{result:t,blocksByIntendedUsage:{web_results:n}}=It(),r=t2t({attachments:t.attachments??Pe});return d.useMemo(()=>{const s=new Map,o=[],a=(n?.web_result_block?.web_results??[]).map(h=>({status:vm.UNSORTED,web_result:h,citation:0})),i=a.some(h=>h.web_result?p3(h.web_result):!1);for(const h of a){const g=h.web_result?.is_attachment&&!p3(h.web_result);if(g&&o.push(h),!g||!e){const y=s.get(h.status)??[];y.push(h),s.set(h.status,y)}}const c=s.get(vm.SELECTED)??Pe,u=s.get(vm.REVIEWED)??Pe,f=s.get(vm.REVIEWING)??Pe,m=s.get(vm.UNSORTED)??Pe;!i&&o.length===0&&r.length>0&&o.push(...r);const p=[...c,...u,...f,...m].slice(0,3)?.map(h=>h.web_result?.url??"");return{attachedSources:o,selectedSources:c,reviewedSources:u,reviewingSources:f,unsortedSources:m,topSources:p}},[n?.web_result_block?.web_results,r,e])},t2t=({attachments:e})=>e.map(t=>({web_result:{name:cu(t),url:t,is_attachment:!0,is_image:kr(t),is_code_interpreter:!1,is_knowledge_card:!1,is_navigational:!1,is_widget:!1,sitelinks:[],snippet:"",timestamp:"",meta_data:{},inline_entity_id:""},status:"UNKNOWN",citation:0})),$8=A.memo(()=>l.jsxs("div",{className:"gap-md @container flex w-full flex-row",children:[l.jsx("div",{className:"md:@[1458px]:w-[874px] md:@[1458px]:shrink-0 w-full md:w-3/5",children:l.jsx(Ode,{})}),l.jsx("div",{className:"@md:w-[570px] @md:@[1458px]:w-full hidden md:block",children:l.jsx(Pde,{})})]}));$8.displayName="PlacesModeLoader";const Pde=A.memo(()=>l.jsx(br,{children:l.jsx(K,{variant:"subtler",className:"sticky h-[180px] w-full overflow-hidden rounded-xl [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]"})}));Pde.displayName="PlacesModeMapLoader";const Ode=A.memo(()=>l.jsx(br,{children:l.jsx("div",{className:"gap-md grid h-[180px] grid-cols-[repeat(auto-fill,minmax(220px,1fr))] overflow-hidden [mask-image:linear-gradient(to_bottom,#000_0%,transparent_160px)]",children:Array.from({length:8}).map((e,t)=>l.jsx(Lde,{},t))})}));Ode.displayName="PlacesModeGridLoader";const Lde=A.memo(()=>l.jsx("div",{className:"bg-subtler aspect-[4/3] w-full rounded-xl"}));Lde.displayName="Item";const n2t=Ce(async()=>{const{ShoppingMode:e}=await Se(()=>q(()=>import("./ShoppingMode-q3eSRhKN.js"),__vite__mapDeps([484,4,1,8,3,9,6,7,485,471,472,81,47,49,50,42,79,38,486,57,10,11,12])));return{default:e}},{loading:()=>l.jsx(Ade,{})}),r2t=Ce(async()=>{const{HotelsMode:e}=await Se(()=>q(()=>import("./HotelsMode-rYYctIE3.js"),__vite__mapDeps([487,4,1,485,8,3,9,6,7,488,42,486,79,38,10,11,12])));return{default:e}},{loading:()=>l.jsx($8,{})}),s2t=Ce(async()=>{const{JobsMode:e}=await Se(()=>q(()=>import("./JobsMode-JXrdyUQd.js"),__vite__mapDeps([489,4,1,6,3,8,9,7,42,473,10,11,12])));return{default:e}},{loading:()=>l.jsx(Tde,{})}),o2t=Ce(async()=>{const{VideosMode:e}=await Se(()=>q(()=>import("./VideosMode-Hf9Cgtle.js"),__vite__mapDeps([490,4,1,6,3,9,7,491,8,42,486,10,11,12])));return{default:e}},{loading:()=>l.jsx(x0,{type:"videos",queryString:""})}),a2t=Ce(async()=>{const{ImagesMode:e}=await Se(()=>q(()=>import("./ImagesMode-Bcsp5jfV.js"),__vite__mapDeps([492,4,1,6,3,9,7,491,8,42,81,47,469,486,10,11,12])));return{default:e}},{loading:()=>l.jsx(x0,{type:"images",queryString:""})}),i2t=Ce(async()=>{const{MapsMode:e}=await Se(()=>q(()=>import("./MapsMode-DBIttjNw.js"),__vite__mapDeps([493,4,1,8,3,9,6,7,485,488,42,486,79,38,10,11,12])));return{default:e}},{loading:()=>l.jsx($8,{})}),l2t=Ce(async()=>{const{AssetsMode:e}=await Se(()=>q(()=>import("./AssetsMode-7Ja3lHRt.js"),__vite__mapDeps([494,4,1,6,3,102,7,8,9,10,11,12])));return{default:e}},{loading:()=>l.jsx(ZZ,{})}),Fde=A.memo(({children:e,isFirstResult:t=!1,isLastResult:n=!1,hasParent:r=!1,mode:s,width:o})=>l.jsx(K,{className:z({"pt-[var(--thread-visual-spacing)]":!t,"md:pt-lg":s==="default"&&!(t&&r),"pb-[var(--thread-visual-spacing)]":!0,"pb-lg":"","px-[var(--thread-visual-spacing)]":!0,"md:px-lg":o==="wide"}),children:e}));Fde.displayName="ThreadEntryLayout";function c2t(e){const{result:{backend_uuid:t,frontend_context_uuid:n,attachments:r,display_model:s,sources:o}}=It(),a=g0();return d.useCallback(i=>{if(!n){Z.warn(new Error(`No frontend UUID for thread backendUUID=${t}`));return}e({rawQuery:i,existingEntryUUID:t,redoSearch:!0,collection:null,newFrontendContextUUID:null,existingFrontendContextUUID:a?void 0:n,promptSource:"user",querySource:"edit",attachments:r,modelPreferenceOverride:s,sourcesOverride:Fx(o?.sources)})},[t,n,a,r,o,s,e])}const Bde=A.memo(({sbsEntriesGroup:e,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o,lastResultBuffer:a})=>{const{currentModeData:i}=g6(),{result:{backend_uuid:c,attachments:u,status:f,query_str:m,parent_info:{mode:p,url_slug:h}={},side_by_side_metadata:g},isEntryInFlight:y,webResults:x,inFlight:v,isFailed:b,selectedRefinementQuery:_,isFirstResult:w,isLastResult:S,submitQuery:C,scrollToListItem:E,idx:T}=It(),{results:k}=on(),I=c2t(C),M=!!(p&&h),N=d.useCallback(()=>{E?.(T,{smooth:!0})},[E,T]);d.useEffect(()=>{typeof window>"u"||f!=="PENDING"||N()},[y,f,N]);const D=u&&u.length>0,j=qt.hasUnspecifiedSelectionStatus(g)&&qt.hasMultipleSiblingEntries(k,g?.sibling_uuid),F=d.useMemo(()=>l.jsx(eJ,{entryUUID:c,onSubmitEdit:I,isFirstResult:w,hasAttachments:D,inFlight:v,isFailed:b,isEditDisabled:j,selectedRefinementQuery:_,queryStr:m??""}),[c,I,w,D,v,b,j,_,m]),R=d.useMemo(()=>{if(!D)return new Map;const G=new Map;for(const H of x)H.url&&H.file_metadata?.file_source&&G.set(H.url,H.file_metadata.file_source);return G},[D,x]),{isMobileStyle:P,isMobileUserAgent:L}=Re(),U=d.useMemo(()=>0,[w,M,P,L]),O=d.useMemo(()=>S&&a?a+(D?52:0):0,[S,a,D]),$=w&&P;return l.jsx("div",{className:z({"erp-sidecar:min-h-[var(--sidecar-content-height)]":S,"erp-mobile-sidecar:min-h-[var(--mobile-sidecar-content-height)]":S,"min-h-[var(--page-content-height)]":S&&!$,"min-h-[var(--mobile-content-height)]":S&&$}),style:{marginTop:U,paddingBottom:O},children:l.jsxs(Fde,{isFirstResult:w,isLastResult:S,hasParent:!!M,mode:i.mode,width:i.width,children:[l.jsx(Mde,{submitQuery:C}),l.jsx(xJ,{webResults:x,children:l.jsxs("div",{className:z("isolate mx-auto",{"max-w-none":i.width==="full","max-w-threadWidth":i.width==="wide","max-w-threadContentWidth":i.width==="default"}),children:[i.mode==="default"&&l.jsx(Kyt,{isLastResult:S,title:F,backend_uuid:c,width:i.width,children:D&&l.jsx(cJ,{attachments:u,backend_uuid:c,fileSourceMap:R})}),l.jsx("div",{className:z("mx-auto",{"max-w-threadWidth":i.width==="wide","max-w-none":i.width==="full","max-w-threadContentWidth":i.width==="default"}),children:l.jsxs(St,{initial:!1,children:[l.jsx(ja,{id:"default",children:l.jsx(kde,{sbsEntriesGroup:e,submitQuery:C,shouldShowProductFeedback:t,feedbackEntryUUID:n,shouldShowRecruitmentBanner:r,deleteLastResult:s,setQuote:o})},"default"),l.jsx(ja,{id:"shopping",children:l.jsx(n2t,{})},"shopping"),l.jsx(ja,{id:"hotels",children:l.jsx(r2t,{})},"hotels"),l.jsx(ja,{id:"places",children:l.jsx(i2t,{})},"places"),l.jsx(ja,{id:"jobs",children:l.jsx(s2t,{})},"jobs"),l.jsx(ja,{id:"videos",children:l.jsx(o2t,{})},"videos"),l.jsx(ja,{id:"images",children:l.jsx(a2t,{})},"images"),l.jsx(ja,{id:"sources",children:l.jsx(Ide,{})},"sources"),l.jsx(ja,{id:"assets",children:l.jsx(l2t,{})},"assets")]})})]})})]})})});Bde.displayName="ThreadEntryInner";const u2t=Ft("EntityGroupContext",void 0),Ude=A.memo(({children:e})=>{const[t,n]=d.useState(!1);return l.jsx(u2t.Provider,{value:{viewMoreOpen:t,setViewMoreOpen:n},children:e})});Ude.displayName="EntityGroupProvider";const d2t=e=>{const t=Vv(e);if(t)switch(t.object){case"ShopifyWidget":return!0;default:return!1}return!1},Vde=d.memo(({idx:e,result:t,sbsEntriesGroup:n,isLastResult:r,isFirstResult:s,lastResultBuffer:o})=>{const{inFlight:a}=on(),{scrollToListItem:i}=l6(),{submitQuery:c,shouldShowProductFeedback:u,feedbackEntryUUID:f,shouldShowRecruitmentBanner:m,deleteLastResult:p,setQuote:h}=Ho(),g=d.useCallback(async y=>{a||c(y)},[c,a]);return l.jsx(p6,{idx:e,result:t,inFlight:a,isLastResult:r,isFirstResult:s,scrollToListItem:i,submitQuery:g,children:l.jsx(QZ,{scrollToListItem:i,children:l.jsx(Ude,{children:l.jsx(Bde,{sbsEntriesGroup:n,shouldShowProductFeedback:u,feedbackEntryUUID:f??"",shouldShowRecruitmentBanner:m,deleteLastResult:p,setQuote:h,lastResultBuffer:o})})})})});Vde.displayName="ThreadEntry";const Hde=A.memo(({children:e,forceVisible:t=!1,unmeasuredHeight:n,disableObservation:r,rootMargin:s,threshold:o,root:a,ref:i})=>{const[c,u]=d.useState(0),[f,m]=d.useState(t),[p,h]=d.useTransition(),g=d.useRef(null),y=d.useRef(null);d.useEffect(()=>{const v=g.current,b=y.current;if(!v||!b)return;const _=new ResizeObserver(([S])=>{if(!S)return;if(r?.current){_.unobserve(v),requestAnimationFrame(function E(){r.current?requestAnimationFrame(E):_.observe(v)});return}const C=S.contentRect.height;h(()=>u(E=>C||E))}),w=new IntersectionObserver(([S])=>{if(S){if(r?.current){w.unobserve(v),requestAnimationFrame(function C(){r.current?requestAnimationFrame(C):w.observe(v)});return}h(()=>m(S.isIntersecting))}},{rootMargin:s,threshold:o,root:a});return _.observe(v),t||w.observe(b),()=>{_.disconnect(),w.disconnect()}},[t,n,s,o,a,r]);const x=d.useCallback(v=>{g.current=v,i instanceof Function?i(v):i&&(i.current=v)},[i]);return l.jsx("div",{style:t?void 0:{minHeight:`${c||n}px`},ref:y,children:l.jsx("div",{ref:x,children:t||f?e:null})})});Hde.displayName="LazyContainer";const hU=1e3,f2t=1,gU=3,zde=A.memo(e=>{const t="thread",{openToast:n}=hn(),r=D4(b=>b.results),{setQuote:s}=Ho(),{scrollContainerRef:o}=ka(),{refs:a,isScrollingRef:i}=l6(),c=On(),[u,f]=d.useState(!1),m=J(),{activeThreadTab:p}=kg();LIe({reason:t});const h=d.useMemo(()=>{const b=P4(r?.length?r:e.placeholderResults||[]);return p!=="default"?ZIe(b,p)??b.slice(-1):b},[r,e.placeholderResults,p]);d.useEffect(()=>{h.some(_=>_[0]?.has_expired_attachments)&&n({message:m.formatMessage({id:"zR3dvwKUWo",defaultMessage:"Some files have expired. Please reupload files to continue."}),variant:"error",timeout:3})},[h,n,m]);const g=d.useMemo(()=>{if(typeof window>"u")return-1;const b=window.location.hash.slice(1);return b?Number.isNaN(Number(b))?h?.findIndex(_=>_[0]?.backend_uuid===b):Number(b):-1},[h]),y=d.useCallback((b,_)=>{_?a[b]={current:_}:delete a[b]},[a]),x=d.useCallback((b,_)=>b=_-gU||!u&&b<=g,[g,u]);d.useEffect(()=>{if(~g){const b=setTimeout(()=>{f(!0)},1e4);return()=>{clearTimeout(b)}}},[g]),d.useEffect(()=>{const b=o.current;return b&&(b.scrollTop=0),()=>{f(!1)}},[c,o]),d.useEffect(()=>()=>{s(null)},[]);const v=d.useMemo(()=>h.map((b,_)=>{const w=b[0],S=_===0,C=_===h.length-1;return w?l.jsx(Wde,{result:w,resultsGroup:b.length>1?b:Pe,isLastResult:C,isFirstResult:S,lastResultBuffer:C?e.lastResultBuffer:void 0,forceVisible:x(_,h.length),idx:_,scrollContainerRef:o,setRef:y,isScrollingRef:i},w.uuid||w.backend_uuid):null}),[h,e.lastResultBuffer,x,o,y,i]);return l.jsx("div",{children:v})});zde.displayName="Thread";const Wde=A.memo(({result:e,resultsGroup:t,isLastResult:n,isFirstResult:r,forceVisible:s,idx:o,scrollContainerRef:a,lastResultBuffer:i,setRef:c,isScrollingRef:u})=>{const f=e.attachments?.length>0,m=d.useMemo(()=>()=>l.jsx(Kf,{className:z("pt-headerHeight",{"pb-threadInputHeightWithPadding":n&&!f,"pb-threadAttachmentsHeightWithPadding":n&&f})}),[f,n]),p=d.useCallback(h=>c(o,h),[o,c]);return l.jsx(Mr,{fallback:m,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(Hde,{forceVisible:s,unmeasuredHeight:hU,rootMargin:`${hU*f2t}px 0px`,threshold:0,root:a.current,ref:p,disableObservation:u,children:l.jsx(Vde,{idx:o,result:e,sbsEntriesGroup:t,isLastResult:n,isFirstResult:r,lastResultBuffer:i})})},e.uuid||e.backend_uuid)});Wde.displayName="LazyContainerFactory";const Gde=A.memo(()=>{const{$t:e}=J(),{firstResult:t}=on(),n=t?.parent_info,s=d.useContext(c6)?.activeThreadTab??"default";if(!n?.mode||!n?.url_slug||s!=="default")return null;const o=(()=>{switch(n?.mode){case xd.ARTICLE:return"page";case xd.NOTEPAD:return"notes";default:return"search"}})(),a=!!n?.preview_image_url;return l.jsx(yt,{href:`/${o}/${n?.url_slug}`,children:l.jsxs(K,{variant:"background",bgHover:"subtler",className:"mt-md p-md shadow-subtle relative mx-auto flex justify-between rounded-lg border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs(V,{color:"light",variant:"tiny",className:"mb-xs gap-x-xs flex items-center",children:[l.jsx(ge,{icon:B("git-fork"),size:"xs"}),l.jsx("div",{children:e({defaultMessage:"Follow up to",id:"D3eCB2NeGQ"})})]}),l.jsx(V,{variant:"baseSemi",color:"light",className:"line-clamp-1 break-all",children:n?.title})]}),a&&l.jsx("div",{className:"ml-md shrink-0",children:l.jsx(Wo,{src:n?.preview_image_url,alt:n?.title||"Preview",imageClassName:"h-16 w-16 rounded object-cover",rounded:"sm",fadeIn:!1})})]})})});Gde.displayName="ParentThreadLink";const $de=A.memo(({children:e,className:t,innerClassName:n})=>l.jsx("div",{className:z("px-md md:px-lg","overflow-hidden",t),children:l.jsx("div",{className:z("max-w-threadContentWidth mx-auto",n),children:e})}));$de.displayName="ThreadSectionWrapper";function m2t(e){return e?.length?e.filter(ha):void 0}const p2t=(e,t,n)=>{const r=d.useRef(null),{submitQuery:s}=Ho(),o=Rn(),a=W4();d.useLayoutEffect(()=>{const c=new URL(window.location.href).searchParams,u=c.get("copilot"),f=c.get("pro"),m=c.get("q"),p=c.get("utm_source"),h=c.get("in_page"),g=c.get("attachments"),y=c.get("tabs"),x=c.get("nav_suggestions"),v=c.get("sources"),b=c.get("pc"),_=c.get("pt");b&&V2e(b),_&&W2e(_);const w=c.get("qabi")??void 0,S=g?.replace(/[[\]]/g,"").split(","),C=c.get("newFrontendContextUUID"),E=[];if(y)try{const T=JSON.parse(y);if(Array.isArray(T))for(const k of T)E.push({type:"tab",id:k,url:""})}catch(T){Z.error("Failed to parse tabsParam:",T)}if(e&&m&&!C&&t&&r.current!==t){const T=Array.isArray(m)?m[0]:m,k=c.get("source");if(T==="pending")return;const I=M=>{if(r.current!==t)return;const N=p?`/search/${M}?utm_source=${p}`:`/search/${M}`;o.replace(N,"Omni search query")};s({rawQuery:T,copilotOverride:u==="true"||f==="true"||Sz(p??void 0),collection:null,newFrontendContextUUID:crypto.randomUUID(),frontendUUID:t,attachments:S,inPage:h??void 0,promptSource:vM(k)?k:"user",querySource:"default_search",utmSource:p??void 0,quickActionButtonId:w,isNavSuggestionsDisabled:x==="false",modelPreferenceOverride:ie.DEFAULT,shouldRedirectToBackendUUID:!1,mentions:E,sourcesOverride:v?m2t(v?.split(",")):void 0,shouldUsePageStartTime:!0,onThreadSlugReceived:I}),r.current=t,Gfe()}},[e,s,t,a,o,n])},FS="streamId",h2t=()=>{const e=Hs();return d.useCallback(n=>{for(const r of n){if(e.getState().entries[r.backend_uuid])continue;const o=r.frontend_uuid??crypto.randomUUID(),a=!r.reconnectable,i=r.context_uuid,c=r.backend_uuid;e.setState(u=>{try{return e3(u,{...r,status:a?r.status===Pr.BLOCKED?Pr.BLOCKED:Pr.COMPLETED:Pr.PENDING,final:a,final_sse_message:a},{streamId:o})}catch(f){const m=new Ol("STREAM_INITIAL_ENTRIES_ERROR",{message:"Error in initializeThreads",cause:f,details:{request_id:o,backend_uuid:c}});return Z.error(m),{threads:pH(u.threads,i,c),entries:{...u.entries,[c]:{...r,status:Pr.FAILED}}}}},void 0,"ingestInitialEntries")}},[e])},qde=A.memo(({error:e})=>{throw e});qde.displayName="ThrowFetcherError";function g2t({active:e,query:t,copilot:n,source:r,streamId:s}){const o=d.useMemo(()=>t&&e?[C0e({query_str:t,frontend_uuid:s,query_source:r??"default_search",mode:n==="true"?"COPILOT":"CONCISE"})]:Pe,[t,e,s,r,n]);return d.useMemo(()=>e?{hasFrontendUUID:!!s,placeholderResults:o}:void 0,[e,o,s])}function y2t({active:e,frontendContextUUID:t}){const r=Hs().getState().streams,o=(e?Object.values(r).find(i=>i.params?.frontend_context_uuid===t):void 0)?.placeholderChunk,a=d.useMemo(()=>o?[o]:void 0,[o]);return d.useMemo(()=>e?{skipLoadingUI:!0,placeholderResults:a}:void 0,[e,a])}function x2t({active:e,slugOrUUID:t}){const n="search-components",r=Rn(),s=d.useRef(new Map),o=Hs(),a=d.useRef(o.getState());a.current=o.getState();const i=e?Object.values(a.current.entries).find(g=>g?.thread_url_slug===t||g?.backend_uuid===t||g?.backend_uuid===s.current.get(t)):void 0;i&&s.current.set(t,i?.backend_uuid??"");const c=e&&!i,{data:u,error:f,isLoading:m,dataUpdatedAt:p}=Dve({slugOrUUID:t,enabled:c,isSidecar:!0,reason:n}),h=d.useMemo(()=>u?.length?u:i?[i]:Pe,[u,i]);return d.useEffect(()=>{if(f instanceof he){let g=null;const y=f.detail;y?.error_code===a9?(g=wd.ThreadAccessNotAllowed,Z.error(a9,{error:f,slugOrUUID:t})):y?.error_code===Uwe?(g=wd.ThreadExpired,Z.error(f?.message,{error:f,slugOrUUID:t})):(g=wd.InvalidThread,Z.error(f?.message,{error:f,slugOrUUID:t})),r.replace(`/?error=${g}&id=${t}`,"Search error")}},[f,t,r]),d.useMemo(()=>e?{entries:h,slugOrUUID:t,isLoadingEntries:!p,error:f}:void 0,[e,h,f,p,t])}function v2t(){const{clear:e}=Vx(),t=ou(),n=!!(t?.new&&t?.uuid),r=!!(t?.new&&!t?.uuid),s=!!(!t?.new&&t?.uuid),o=!n&&!r&&!s,a=new URLSearchParams(window.location.search),i=a?.get("q")??void 0,c=a?.get("copilot")??void 0,u=a?.get("source")??void 0,f=a?.get(FS),m=d.useMemo(()=>f??crypto.randomUUID(),[f]);o&&!a.has(FS)&&a.set(FS,m);const p=o?a.toString():"",h=y2t({active:n,frontendContextUUID:t?.uuid??""}),g=g2t({active:r,query:i,copilot:c,streamId:m,source:u}),y=x2t({active:s,slugOrUUID:t?.uuid??""});return d.useEffect(()=>()=>e(),[e]),d.useLayoutEffect(()=>{g?.hasFrontendUUID&&e()},[e,g?.hasFrontendUUID]),p2t(r,m,"new-query-search-components"),d.useMemo(()=>{if(n){const x=t?.uuid;if(!x||!MU(x))return{component:l.jsx(A0,{to:"/"})}}else if(r){if(!i||i==="pending")return{component:l.jsx(A0,{to:"/"})}}else if(s){const x=t?.uuid;if(!x||x==="undefined")return{component:l.jsx(A0,{to:"/"})};if(y?.error instanceof he)return null;if(y?.error instanceof kU&&!y.entries.length)return{component:l.jsx(Mr,{fallback:()=>l.jsx(Kf,{}),code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(qde,{error:y.error})})}}else return{component:l.jsx(A0,{to:i?`/search/new?${p}`:"/"})};return{props:{...h,...g,...y}}},[y,s,g,r,h,n,t?.uuid,i,p])}function b2t(e){const t=h2t(),{setCurrentThreadId:n}=Vx(),r=J0e(),s=e.entries,o=!!s?.length,a=e.isLoadingEntries,i=d.useMemo(()=>s?.[0]?.context_uuid,[s]);d.useEffect(()=>{o&&n(i??crypto.randomUUID())},[o,n,i]),d.useEffect(()=>{a||s&&(s.forEach(u=>{u.reconnectable&&!qt.isStatusCompleted(u)&&r(u.backend_uuid)}),t(s))},[t,s,r,i,a]);const c=d.useMemo(()=>e.entries?.length?e.entries:e.placeholderResults?.length?e.placeholderResults:Pe,[e.placeholderResults,e.entries]);return d.useMemo(()=>({placeholderResults:c}),[c])}const Kde=A.memo(({children:e})=>{const{results:t}=on(),n=d.useMemo(()=>{const r=[];return t.map(s=>{s.widget_data?.map(o=>{d2t(o)&&r.push(o)})}),r},[t]);return l.jsx(eae,{entities:n,children:e})});Kde.displayName="ScrollToWidgetWrapper";function fx(e){return e?e==="comet_browser_agent":!1}const _2t=[ie.DEFAULT,ie.PRO];function w2t(e){return _2t.includes(e)}function g_t({displayModel:e,userSelectedModel:t,intl:n}){if(fx(e)||w2t(t))return null;const r=yU(t,n),s=yU(e,n);return s!==r?n.$t({defaultMessage:"Used {displayModelLabel} because {userSelectedModelLabel} was inapplicable or unavailable.",id:"fix6lEntWw"},{displayModelLabel:s,userSelectedModelLabel:r}):r}function yU(e,t){const n=$n[e];return n?t.$t(n.name):"Best"}const C2t=(e,t,n)=>{const r=HQ(),{addClarification:s}=Uv(),{session:o}=Ne(),{trackEventOnce:a}=Xe(o),i=n?.length??0,c=n?.filter(g=>g.markdown_block).length??0,u=d.useMemo(()=>{if(!n)return!1;if(fx(t?.display_model))return!0;const g=n.find(v=>v.intended_usage==="pro_search_steps");if(!g?.plan_block?.steps)return!1;const y=g.plan_block.steps;return y[y.length-1]?.step_type==="ENTROPY_REQUEST"},[n,t?.display_model]),f=d.useMemo(()=>u?!0:r?an(t?.display_model)===oe.RESEARCH||an(t?.display_model)===oe.STUDIO:!1,[r,u,t?.display_model]),m=d.useMemo(()=>f&&!t?.reasoning_plan&&i>0&&c===0,[t?.reasoning_plan,i,c,f]),p=d.useMemo(()=>!m||!f||!n?null:{clarificationQuestion:fx(t?.display_model)?"I'll consider the details you added.":"Add details or clarifications",isDefaultClarification:!0,clarificationCount:0},[m,f,n,t?.display_model]),h=d.useCallback((g,y,x)=>{const b={uuid:crypto.randomUUID(),clarification_type:"FREEFORM_CLARIFICATION",freeform_clarification:{text:x.query,question:"Add details or clarifications",attachments:x.attachments??[]}};Mge({entryUUID:g,clarification:b,reason:e}),s({content:b.freeform_clarification?.text??x.query,UUID:b.uuid,entryUUID:g,question:p?.clarificationQuestion??void 0}),p&&a("clarifying query submitted",{entry_uuid:g,context_uuid:y,query:x.query,attachments:x.attachments})},[s,p,e,a]);return{shouldAcceptClarification:m,handleSubmitClarification:h,clarificationData:p}},S2t=({selectedSearchMode:e,shouldAcceptClarification:t,isBrowserAgent:n,$t:r})=>r(t?n?{defaultMessage:"Add details to this task...",id:"9/d5+NqCeH"}:{defaultMessage:"Add details or clarifications...",id:"RkaMsxpXoz"}:Nr[e].askInputPlaceholder),Yde=A.memo(e=>{const t="sidecar-thread-floating-footer",{$t:n}=J(),r=un(),o=fn()?.get("q"),a=Wt(),{inFlightEntry:i,inFlight:c,firstResult:u,lastResult:f,resultsLength:m}=on(),p=i?.backend_uuid,h=i?.context_uuid,g=i?.blocks,y=u?.frontend_context_uuid,x=u?.collection_info,{shouldAcceptClarification:v,handleSubmitClarification:b,clarificationData:_}=C2t(t,f,g),w=g?.length??0,S=y,{activeMode:C}=kg(),{submitQuery:E}=Ho(),{specialCapabilities:T}=Yr(),k=Vo(),I=g0(),M=d.useMemo(()=>{try{return c&&w>0}catch(U){throw Z.error("Unable to parse non-Pro search inFlightEntry.",U),U}},[c,w]),N=d.useCallback(U=>{if(p&&v&&(b(p,h,U),P.setUserInput("")),c&&!U.forceFork)return;const O=U.forceFork||I,$=ua();E({rawQuery:U.query,copilotOverride:a||T.unlimitedProSearch?void 0:!1,attachments:U.attachments,collection:x??null,newFrontendContextUUID:O?$:null,existingFrontendContextUUID:O?void 0:S,promptSource:U.promptSource??"user",querySource:"followup",timeFromFirstType:U.timeFromFirstType,shouldRedirectToBackendUUID:O,modelPreferenceOverride:U.modelPreferenceOverride,forceEnableBrowserAgent:U.forceEnableBrowserAgent}),e.onSubmit?.()},[c,E,a,I,x,S,p,v,h,b]),D=d.useRef(!1),j=d.useCallback(U=>{D.current||(D.current=!0,setTimeout(()=>D.current=!1,Z4),N(U))},[N]);d.useEffect(()=>{v&&(D.current=!1)},[v]);const[F,R,P]=wW({onSubmit:j}),L=d.useCallback(()=>{p&&(au({entryUUID:p,reason:t}),r.cleanupTasks(p,"query_stopped"))},[p,r]);return d.useEffect(()=>r.subscribeToSidecarBrowserTaskStop(U=>{U||L()}),[r,L]),d.useEffect(()=>{o!==null&&o!==""&&P.setUserInput("")},[o]),l.jsx(K,{className:"erp-sidecar:fixed bottom-safeAreaInsetBottom p-md pointer-events-none absolute z-10 w-full",ref:e.ref,children:l.jsx("div",{className:"max-w-threadContentWidth mx-auto",children:l.jsx("div",{className:"pointer-events-auto",children:QIe(C)&&l.jsx(K,{className:z("mt-lg static w-full grow flex-col items-center justify-center md:mt-0 md:flex","z-10"),children:l.jsx("div",{className:"w-full",children:l.jsxs(Wc,{children:[l.jsx(Jd,{position:"input",idx:m-1,upsellInformation:f?.upsell_information,inFlight:c,isLastResult:!0,backendUuid:p,animateExpand:!1}),d.createElement(VA,{...P,key:"ask-input",value:F,json:R,isFollowUp:!0,disableSubmission:c&&!v,placeholder:S2t({selectedSearchMode:k,shouldAcceptClarification:v,isBrowserAgent:fx(f?.display_model),$t:n}),showStopButton:M,showFileUpload:!0,inFlightEntryUUID:p,onStopButtonClick:L,querySource:"followup",layoutKey:"sidecar-input",isHighlighted:!!_?.clarificationQuestion})]})})})})})})});Yde.displayName="SidecarThreadFloatingFooter";const Qde=A.memo(()=>l.jsx(Kf,{}));Qde.displayName="Fallback";const Xde=A.memo(e=>{const{placeholderResults:t}=b2t(e),[n,{height:r}]=ti();return l.jsx(Mr,{fallback:Qde,code:"SOMETHING_WENT_WRONG_ERROR",children:l.jsx(ePe,{children:l.jsx(mZ,{children:l.jsx(pZ,{children:l.jsxs(Kde,{children:[l.jsx("div",{className:"mx-auto h-fit pb-0",children:l.jsxs(K,{variant:"background",className:"relative",children:[l.jsx($de,{children:l.jsx(Gde,{})}),l.jsx(zde,{...e,placeholderResults:t,lastResultBuffer:r})]})}),l.jsx(Yde,{ref:n},"footer")]})})})})})});Xde.displayName="SearchContent";const Zde=A.memo(function(){const t=v2t();return t?"component"in t?t.component:l.jsx(Of,{children:l.jsx(Xde,{...t.props})}):null});Zde.displayName="SidecarSearchPage";const E2t=Ce(async()=>{const{VoiceToVoiceContent:e}=await Se(()=>q(()=>import("./VoiceToVoiceContent-BLVFdoql.js"),__vite__mapDeps([495,4,1,6,3,145,7,9,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),Jde=A.memo(function(){const t=Rn(),n=d.useCallback(()=>{t.push("/",void 0,"voice to sidecar")},[t]);return l.jsx(Of,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Qx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(E2t,{onClose:n})})})});Jde.displayName="SidecarSpeakPage";const k2t=Ce(async()=>{const{VoiceToVoiceContent:e}=await Se(()=>q(()=>import("./VoiceToVoiceContent-BLVFdoql.js"),__vite__mapDeps([495,4,1,6,3,145,7,9,146,147,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),efe=A.memo(function(){const t=un(),n=d.useCallback(()=>{t?.voiceAssistantStop()},[t]);return l.jsx(Of,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Qx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(k2t,{isCometVoiceAssistant:!0,onClose:n})})})});efe.displayName="SidecarVoiceAssistantPage";const M2t=Ce(async()=>{const{VoiceToVoiceFloating:e}=await Se(()=>q(()=>import("./VoiceToVoiceFloating-DZo4d0io.js"),__vite__mapDeps([496,4,1,6,3,146,7,9,57,8,10,11,12])));return{default:e}},{loading:()=>l.jsx(Gf,{})}),tfe=A.memo(function(){return l.jsx(Of,{withoutHeader:!0,disableOpenInTab:!0,children:l.jsx(Qx,{childrenWidth:"none",mobileHeader:!1,children:l.jsx(M2t,{isCometVoiceAssistant:!0})})})});tfe.displayName="SidecarVoiceFloatingPage";const T2t={[vW]:{Component:Zde,modules:kCe},"/speak":{Component:Jde,modules:Pe},"/voice-assistant":{Component:efe,modules:Pe},"/voice-floating":{Component:tfe,modules:Pe},"/":{Component:HA,modules:bW}},nfe=A.memo(()=>l.jsxs($fe,{children:[Object.entries(T2t).map(([e,{Component:t,modules:n}])=>l.jsx(p7,{path:e.startsWith("^")?new RegExp(e):e,children:l.jsx(s9,{modules:n,children:l.jsx(t,{})})},e)),l.jsx(p7,{children:l.jsx(s9,{modules:bW,children:l.jsx(HA,{})})})]}));nfe.displayName="Main";const q8=[vW,"/speak","/voice-assistant","/voice-floating","/"],A2t=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,K8="pplx-next-auth-session";let K1=null;const N2t=()=>{try{const e=vt.getItem(K8);return e?JSON.parse(e):null}catch{return null}},xU=e=>{e&&vt.setItem(K8,JSON.stringify(e))},rfe=()=>{vt.removeItem(K8)},R2t=(e=!1)=>{K1??=Ime().then(n=>(n?xU(n):rfe(),n)).catch(n=>{throw(!(n instanceof fM)||n.code!=="AUTH_NO_STATUS_CODE_ERROR")&&xU(null),n}).finally(()=>{K1=null});const t=N2t();return t&&(e||new Date(t.expires)>new Date)?{cachedSession:t,sessionFetchPromise:K1}:{cachedSession:null,sessionFetchPromise:K1}};async function D2t(){const{data:e,error:t}=await WU.GET("/api/auth/csrf","getCsrfToken",{numRetries:2,backOffTime:500});if(t)throw new fM("CSRF_TOKEN_ERROR",{cause:t});return e.csrfToken}async function j2t({redirect:e=!0,callbackUrl:t=window.location.href}){const{error:n}=await WU.POST("/api/auth/signout","signOut",{body:{csrfToken:await D2t(),callbackUrl:t,json:"true"},redirect:"manual"});if(n)throw new fM("SIGN_OUT_ERROR",{cause:n});e&&(qfe(t),t.includes("#")&&window.location.reload())}async function sfe(){await IU(),await lH(),vt.keys().forEach(e=>{e.startsWith(Cz)&&vt.removeItem(e)}),rfe()}const y_t=async(...e)=>(await sfe(),j2t(...e));function I2t(e,t){if(e?.pathname.startsWith("/sidecar"))return"sidecar";if(e?.pathname.startsWith("/mobile-sidecar"))return"mobile-sidecar";if(t)return"tab"}function P2t(){const{cachedSession:e,sessionFetchPromise:t}=R2t(),n=An(),r=document.querySelector("meta[name='version']")?.getAttribute("content")||"",s=+(document.querySelector("meta[name='min-version']")?.getAttribute("content")||0),o=document.querySelector("meta[name='web-resources-build']")?.getAttribute("content")||"",a=new URL(window.location.href);return{cachedSession:e,sessionFetchPromise:t.then(i=>(e&&!i&&sfe().then(()=>{hx("Auth changed")}),i)).catch(i=>(console.error("Error getting session",i),null)),config:{env:Pme(),version:r,minVersion:s,webResourcesBuild:o,erp:I2t(a,n)}}}const u_="/sidecar",O2t=document.getElementById("root"),L2t=rme.createRoot(O2t),F2t=Ome(u_),B2t=navigator.userAgent;function U2t(e,t){S7(A2t),S7(qpe,"pplx-logo-sprites"),L2t.render(l.jsx(Mr,{fallback:F2t,children:l.jsx(Fme,{host:vU,userAgent:B2t,session:t??void 0,children:l.jsxs(vCe,{isMobileUserAgent:H2t,hostname:vU,buildVersion:e.version,spaRoutes:q8,shouldOpenNonSpaRouteInNewTab:!0,base:u_,idleRefresh:!0,buildVersionRefresh:!0,children:[l.jsx(eV,{}),l.jsx(nfe,{})]})})}))}const{config:d_,cachedSession:mx,sessionFetchPromise:V2t}=P2t();window.__PPL_CONFIG__=d_;const H2t=Lme(navigator.userAgent),vU=window.location.host;Kfe();mx&&xW({bootstrapConfig:d_,user:mx.user,routes:q8,base:u_});U2t(d_,mx);mx||V2t.then(e=>{xW({bootstrapConfig:d_,user:e?.user,routes:q8,base:u_})});export{$t as $,Pvt as A,K as B,hvt as C,Mn as D,RR as E,fxt as F,gvt as G,Oz as H,Wo as I,Dvt as J,qn as K,Zn as L,V4 as M,hae as N,uA as O,Fl as P,Zwe as Q,jvt as R,Nvt as S,V as T,Ivt as U,h0e as V,zs as W,mvt as X,fh as Y,Vf as Z,mo as _,pCe as a,rE as a$,Kwe as a0,yvt as a1,l3 as a2,c3 as a3,c2e as a4,d2e as a5,q9e as a6,LM as a7,nDe as a8,rDe as a9,Io as aA,Rvt as aB,St as aC,pNe as aD,kb as aE,zx as aF,pSe as aG,svt as aH,az as aI,sxt as aJ,rvt as aK,pi as aL,Oo as aM,ui as aN,Pgt as aO,na as aP,FCe as aQ,Evt as aR,oxt as aS,Xt as aT,dvt as aU,hSe as aV,GCe as aW,Loe as aX,Hrt as aY,TA as aZ,AA as a_,v8e as aa,OM as ab,Vz as ac,b8e as ad,Af as ae,Nz as af,Rz as ag,Z9e as ah,eQ as ai,J4 as aj,Ea as ak,vhe as al,Wye as am,kc as an,_3 as ao,Dt as ap,Bt as aq,o2 as ar,co as as,R_e as at,O4 as au,kvt as av,iX as aw,L4 as ax,du as ay,Wv as az,C3 as b,hu as b$,jSe as b0,yge as b1,de as b2,XSe as b3,rbt as b4,Ca as b5,lxt as b6,hxt as b7,cxt as b8,uxt as b9,Zvt as bA,Uxt as bB,i2e as bC,iu as bD,Qe as bE,Ox as bF,SGe as bG,$x as bH,YCe as bI,SA as bJ,CA as bK,ide as bL,Zue as bM,rde as bN,tl as bO,Po as bP,Ay as bQ,ux as bR,dae as bS,Us as bT,kxt as bU,tLe as bV,lbt as bW,ET as bX,O$ as bY,abt as bZ,ST as b_,zt as ba,PK as bb,Lvt as bc,bSe as bd,CW as be,EM as bf,Ht as bg,qCe as bh,Gd as bi,Uvt as bj,mg as bk,oNe as bl,Xl as bm,Kbt as bn,Kr as bo,ga as bp,Bn as bq,LN as br,uvt as bs,Kd as bt,kf as bu,Ed as bv,pn as bw,Gvt as bx,zvt as by,Xvt as bz,$we as c,_v as c$,rxt as c0,fg as c1,axt as c2,GK as c3,br as c4,tM as c5,Ly as c6,zQ as c7,nxt as c8,Ovt as c9,vbt as cA,Tbt as cB,wbt as cC,Ebt as cD,_bt as cE,bbt as cF,pDe as cG,Nbt as cH,g0e as cI,An as cJ,rV as cK,Abt as cL,dDe as cM,kbt as cN,Mbt as cO,x4 as cP,w4 as cQ,_4 as cR,Dz as cS,Q_e as cT,k_e as cU,pvt as cV,Si as cW,_vt as cX,wvt as cY,Fvt as cZ,Bvt as c_,kSe as ca,Sxt as cb,jp as cc,Qbt as cd,wi as ce,Ra as cf,t_t as cg,Xbt as ch,Ybt as ci,Cn as cj,NK as ck,Lr as cl,ti as cm,ph as cn,HFe as co,zFe as cp,sbt as cq,Ur as cr,$c as cs,Lj as ct,Cbt as cu,Sbt as cv,Fj as cw,v_ as cx,txt as cy,xbt as cz,i9 as d,OY as d$,Hxt as d0,Ep as d1,D2t as d2,lH as d3,Ix as d4,EV as d5,mxt as d6,pxt as d7,r4 as d8,Ls as d9,Hh as dA,dx as dB,yC as dC,Ast as dD,Nk as dE,dde as dF,$g as dG,ya as dH,Ext as dI,Yxt as dJ,Xxt as dK,Qxt as dL,qqe as dM,Rbt as dN,mbt as dO,an as dP,l2e as dQ,GH as dR,fbt as dS,i1t as dT,pbt as dU,nX as dV,hbt as dW,gbt as dX,jxt as dY,Wc as dZ,Ec as d_,NN as da,Axt as db,nl as dc,Fxt as dd,dW as de,c_t as df,f_t as dg,u_t as dh,xC as di,ze as dj,$vt as dk,Dxt as dl,JM as dm,Ixt as dn,ebt as dp,tbt as dq,nbt as dr,BBe as ds,T2 as dt,qGe as du,byt as dv,Ji as dw,X2e as dx,l_t as dy,d_t as dz,iwe as e,Vxt as e$,oe as e0,lf as e1,YGe as e2,QGe as e3,cp as e4,Qd as e5,zxt as e6,Nxt as e7,f$e as e8,bvt as e9,Svt as eA,Avt as eB,Tvt as eC,Mvt as eD,AM as eE,RM as eF,jM as eG,nRe as eH,fvt as eI,Dbt as eJ,see as eK,eT as eL,Mxt as eM,Eve as eN,_d as eO,VR as eP,Jye as eQ,e2e as eR,pJ as eS,at as eT,dr as eU,gae as eV,Vvt as eW,Hvt as eX,Bxt as eY,zve as eZ,Lxt as e_,kGe as ea,l0e as eb,Dp as ec,Txt as ed,Pxt as ee,Hx as ef,Vn as eg,M8e as eh,z4 as ei,Gz as ej,dp as ek,Wz as el,Zxt as em,Xye as en,Jxt as eo,d3 as ep,NA as eq,evt as er,qxt as es,lE as et,U7 as eu,y_t as ev,tvt as ew,Oke as ex,_xt as ey,Oxt as ez,aA as f,fU as f$,$ye as f0,Jvt as f1,o_t as f2,X0t as f3,r_t as f4,uKe as f5,dKe as f6,fKe as f7,a_t as f8,Ga as f9,Kxt as fA,vSe as fB,Hd as fC,wT as fD,CT as fE,vC as fF,Z2t as fG,Nst as fH,uae as fI,ON as fJ,It as fK,hs as fL,jK as fM,on as fN,Zyt as fO,g6 as fP,el as fQ,g0 as fR,Ist as fS,Vv as fT,x0 as fU,Ade as fV,SOe as fW,ybt as fX,kg as fY,dZ as fZ,Dq as f_,s_t as fa,Z6 as fb,OA as fc,nvt as fd,Kvt as fe,Qvt as ff,qvt as fg,Wvt as fh,oH as fi,Yvt as fj,AGe as fk,TGe as fl,JSe as fm,b$ as fn,S$ as fo,T$ as fp,E$ as fq,k$ as fr,ISe as fs,PSe as ft,BSe as fu,gxt as fv,Wxt as fw,Gxt as fx,Jn as fy,$xt as fz,zwe as g,nc as g$,pU as g0,p_t as g1,B6 as g2,h_t as g3,Jo as g4,yyt as g5,ade as g6,Fy as g7,Q2e as g8,dyt as g9,tE as gA,Ij as gB,cH as gC,Cvt as gD,os as gE,j4 as gF,bd as gG,Zl as gH,hJ as gI,h9e as gJ,y6 as gK,Wd as gL,e_t as gM,w_e as gN,eCe as gO,JH as gP,Jd as gQ,bxt as gR,Ibt as gS,ie as gT,Sp as gU,jH as gV,Hke as gW,Wke as gX,Yr as gY,Fx as gZ,QY as g_,Ode as ga,Pde as gb,Rxt as gc,jee as gd,bz as ge,GN as gf,qx as gg,ng as gh,v6 as gi,af as gj,Ku as gk,Pbt as gl,gJ as gm,Yf as gn,$Oe as go,jbt as gp,Obt as gq,Lbt as gr,_c as gs,wc as gt,ny as gu,d7e as gv,UY as gw,HY as gx,lg as gy,Wx as gz,aNe as h,P1t as h$,g_t as h0,fx as h1,Nr as h2,Bv as h3,eLe as h4,ixt as h5,vxt as h6,Eb as h7,xze as h8,mi as h9,Jbt as hA,UE as hB,gne as hC,ext as hD,fN as hE,Tyt as hF,Cde as hG,xxt as hH,iSe as hI,ua as hJ,kk as hK,jz as hL,eu as hM,rN as hN,J2t as hO,Jg as hP,Rb as hQ,t_ as hR,Yle as hS,df as hT,_6 as hU,Uo as hV,LFe as hW,Cet as hX,l6 as hY,C0e as hZ,vvt as h_,xvt as ha,cvt as hb,v1e as hc,qt as hd,qc as he,Y0 as hf,ude as hg,ovt as hh,ivt as hi,avt as hj,Boe as hk,hyt as hl,qu as hm,_yt as hn,ayt as ho,fde as hp,XJ as hq,txe as hr,hde as hs,lv as ht,que as hu,Nee as hv,Ree as hw,Hee as hx,Ip as hy,Zbt as hz,hn as i,XYe as i$,L1t as i0,ARe as i1,NRe as i2,RRe as i3,DRe as i4,uk as i5,ka as i6,Pre as i7,oN as i8,yxt as i9,Xb as iA,lm as iB,Bi as iC,sl as iD,n_ as iE,u1t as iF,f0 as iG,zl as iH,eo as iI,bu as iJ,fa as iK,QJ as iL,qLe as iM,Fbt as iN,Bbt as iO,YLe as iP,dI as iQ,fI as iR,KLe as iS,ypt as iT,Bot as iU,Zle as iV,Jle as iW,P8 as iX,Rh as iY,cN as iZ,qYe as i_,Mv as ia,kr as ib,U4 as ic,ubt as id,p3 as ie,tg as ig,aV as ih,Dx as ii,Yl as ij,tV as ik,bI as il,jve as im,wxt as io,Cxt as ip,yV as iq,Cue as ir,g2 as is,ZCe as it,IA as iu,JCe as iv,aRe as iw,iA as ix,ko as iy,ule as iz,un as j,i_t as j0,hk as j1,QYe as j2,pN as j3,wb as j4,coe as j5,Dse as j6,ws as j7,yYe as j8,Gse as j9,Gv as ja,pf as jb,Lre as jc,dbt as jd,sY as je,A2 as jf,yb as jg,dA as jh,Z2e as ji,lvt as jj,A4 as jk,yJ as jl,sN as jm,Gg as jn,oLe as jo,m_t as jp,Rx as jq,nae as jr,cbt as js,QFe as jt,FN as ju,Qn as k,Do as l,Te as m,GFe as n,Re as o,Ne as p,Xe as q,Ss as r,sr as s,po as t,Wt as u,ag as v,ft as w,dxt as x,Ge as y,st as z}; -//# sourceMappingURL=https://pplx-static-sourcemaps.perplexity.ai/_sidecar/assets/index-D_VLSpJ3.js.map diff --git a/Ai docs/Perplexity new_files/katex-DIrX_gBg.css b/Ai docs/Perplexity new_files/katex-DIrX_gBg.css deleted file mode 100644 index d89d0af..0000000 --- a/Ai docs/Perplexity new_files/katex-DIrX_gBg.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(https://pplx-next-static-public.perplexity.ai/_sidecar/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/Ai docs/Perplexity new_files/mapbox-gl-B9eh9OLo.css b/Ai docs/Perplexity new_files/mapbox-gl-B9eh9OLo.css deleted file mode 100644 index 3eb4dfd..0000000 --- a/Ai docs/Perplexity new_files/mapbox-gl-B9eh9OLo.css +++ /dev/null @@ -1 +0,0 @@ -.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.mapboxgl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom,.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-left,.mapboxgl-ctrl-right,.mapboxgl-ctrl-top,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top{left:50%;top:0;transform:translate(-50%)}.mapboxgl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-right{right:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl-bottom{bottom:0;left:50%;transform:translate(-50%)}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-left{left:0;top:50%;transform:translateY(-50%)}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.mapboxgl-ctrl-right .mapboxgl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-bottom .mapboxgl-ctrl{float:left;margin:10px 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.mapboxgl-ctrl-left .mapboxgl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;overflow:hidden;padding:0;width:29px}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl-group button:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:only-child{border-radius:inherit}.mapboxgl-ctrl button:not(:disabled):hover{background-color:#0000000d}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E%3C/svg%3E")}}@keyframes mapboxgl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd' viewBox='0 0 88 23'%3E%3Cdefs%3E%3Cpath id='logo' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='text' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:#0000000d}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}.mapboxgl-ctrl-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:#000000bf;text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.mapboxgl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{flex-direction:column-reverse}.mapboxgl-popup-anchor-left{flex-direction:row}.mapboxgl-popup-anchor-right{flex-direction:row-reverse}.mapboxgl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover{background-color:#0000000d}.mapboxgl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:10px 10px 15px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{left:0;opacity:1;position:absolute;top:0;transition:opacity .2s;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before{animation:mapboxgl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.mapboxgl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading{height:0;width:0}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after,.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-bottom:7.5px solid #4aa1eb;content:"";position:absolute}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:before{border-left:7.5px solid transparent;transform:translateY(-28px) skewY(-20deg)}.mapboxgl-user-location-show-heading .mapboxgl-user-location-heading:after{border-right:7.5px solid transparent;transform:translate(7.5px,-28px) skewY(20deg)}@keyframes mapboxgl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}@media print{.mapbox-improve-map{display:none}}.mapboxgl-scroll-zoom-blocker,.mapboxgl-touch-pan-blocker{align-items:center;background:#000000b3;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;height:100%;justify-content:center;left:0;opacity:0;pointer-events:none;position:absolute;text-align:center;top:0;transition:opacity .75s ease-in-out;transition-delay:1s;width:100%}.mapboxgl-scroll-zoom-blocker-show,.mapboxgl-touch-pan-blocker-show{opacity:1;transition:opacity .1s ease-in-out}.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page,.mapboxgl-canvas-container.mapboxgl-touch-pan-blocker-override.mapboxgl-scrollable-page .mapboxgl-canvas{touch-action:pan-x pan-y} diff --git a/Ai docs/Perplexity new_files/saved_resource.html b/Ai docs/Perplexity new_files/saved_resource.html deleted file mode 100644 index 1af0514..0000000 --- a/Ai docs/Perplexity new_files/saved_resource.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Ai docs/Perplexity new_files/vcd15cbe7772f49c399c6a5babf22c1241717689176015 b/Ai docs/Perplexity new_files/vcd15cbe7772f49c399c6a5babf22c1241717689176015 deleted file mode 100644 index 56f5373..0000000 --- a/Ai docs/Perplexity new_files/vcd15cbe7772f49c399c6a5babf22c1241717689176015 +++ /dev/null @@ -1 +0,0 @@ -!function(){var e={343:function(e){"use strict";for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},944:function(e){"use strict";var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},508:function(e,t,n){"use strict";var r=n(944),i=n(343);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var c=0;c<16;++c)t[o+c]=a[c];return t||i(a)}},168:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&(t+=r)}return t}function t(e,t){for(var n in e){var r=e[n];void 0!==t&&("number"!=typeof r&&"string"!=typeof r||(t[n]=r))}}!function(){var n,u,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,f="data-cf-beacon",d=document.currentScript||("function"==typeof document.querySelector?document.querySelector("script[".concat(f,"]")):void 0),l=c(),v=[],p=window.__cfBeacon?window.__cfBeacon:{};if(!p||"single"!==p.load){if(d){var m=d.getAttribute(f);if(m)try{p=r(r({},p),JSON.parse(m))}catch(e){}else{var g=d.getAttribute("src");if(g&&"function"==typeof URLSearchParams){var y=new URLSearchParams(g.replace(/^[^\?]+\??/,"")),h=y.get("token");h&&(p.token=h);var T=y.get("spa");p.spa=null===T||"true"===T}}p&&"multi"!==p.load&&(p.load="single"),window.__cfBeacon=p}if(s&&p&&p.token){var w,S,b=!1;document.addEventListener("visibilitychange",(function(){if("hidden"===document.visibilityState){if(L&&A()){var t=e();(null==w?void 0:w.url)==t&&(null==w?void 0:w.triggered)||P(),_(t)}!b&&w&&(b=!0,B())}else"visible"===document.visibilityState&&(new Date).getTime()}));var E={};"function"==typeof PerformanceObserver&&((0,a.onLCP)(x),(0,a.onFID)(x),(0,a.onFCP)(x),(0,a.onINP)(x),(0,a.onTTFB)(x),PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("layout-shift")&&(0,a.onCLS)(x));var L=p&&(void 0===p.spa||!0===p.spa),C=p.send&&p.send.to?p.send.to:void 0===p.version?"https://cloudflareinsights.com/cdn-cgi/rum":null,P=function(r){var a=function(r){var o,a,c=s.timing,u=s.memory,f=r||e(),d={memory:{},timings:{},resources:[],referrer:(o=document.referrer||"",a=v[v.length-1],L&&w&&a?a.url:o),eventType:i.EventType.Load,firstPaint:0,firstContentfulPaint:0,startTime:F(),versions:{fl:p?p.version:"",js:"2024.6.1",timings:1},pageloadId:l,location:f,nt:S,serverTimings:I()};if(null==n){if("function"==typeof s.getEntriesByType){var m=s.getEntriesByType("navigation");m&&Array.isArray(m)&&m.length>0&&(d.timingsV2={},d.versions.timings=2,d.dt=m[0].deliveryType,delete d.timings,t(m[0],d.timingsV2))}1===d.versions.timings&&t(c,d.timings),t(u,d.memory)}else O(d);return d.firstPaint=k("first-paint"),d.firstContentfulPaint=k("first-contentful-paint"),p&&(p.icTag&&(d.icTag=p.icTag),d.siteToken=p.token),void 0!==n&&(delete d.timings,delete d.memory),d}(r);a&&p&&(a.resources=[],p&&((0,o.sendObjectBeacon)("",a,(function(){}),!1,C),void 0!==p.forward&&void 0!==p.forward.url&&(0,o.sendObjectBeacon)("",a,(function(){}),!1,p.forward.url)))},B=function(){var t=function(){var t=s.getEntriesByType("navigation")[0],n="";try{n="function"==typeof s.getEntriesByType?new URL(null==t?void 0:t.name).pathname:u?new URL(u).pathname:window.location.pathname}catch(e){}var r={referrer:document.referrer||"",eventType:i.EventType.WebVitalsV2,versions:{js:"2024.6.1"},pageloadId:l,location:e(),landingPath:n,startTime:F(),nt:S,serverTimings:I()};return p&&(p.version&&(r.versions.fl=p.version),p.icTag&&(r.icTag=p.icTag),r.siteToken=p.token),E&&["lcp","fid","cls","fcp","ttfb","inp"].forEach((function(e){r[e]={value:-1,path:void 0},E[e]&&void 0!==E[e].value&&(r[e]=E[e])})),O(r),r}();p&&(0,o.sendObjectBeacon)("",t,(function(){}),!0,C)},R=function(){var t=window.__cfRl&&window.__cfRl.done||window.__cfQR&&window.__cfQR.done;t?t.then(P):P(),w={id:l,url:e(),ts:(new Date).getTime(),triggered:!0}};"complete"===window.document.readyState?R():window.addEventListener("load",(function(){window.setTimeout(R)}));var A=function(){return L&&0===v.filter((function(e){return e.id===l})).length},_=function(e){v.push({id:l,url:e,ts:(new Date).getTime()}),v.length>3&&v.shift()};L&&(u=e(),function(t){var r=t.pushState;if(r){var i=function(){l=c()};t.pushState=function(o,a,c){n=e(c);var u=e(),s=!0;return n==u&&(s=!1),s&&(A()&&((null==w?void 0:w.url)==u&&(null==w?void 0:w.triggered)||P(u),_(u)),i()),r.apply(t,[o,a,c])},window.addEventListener("popstate",(function(t){A()&&((null==w?void 0:w.url)==n&&(null==w?void 0:w.triggered)||P(n),_(n)),n=e(),i()}))}}(window.history))}}function x(e){var t,n,r,i,o,a,c,u=window.location.pathname;switch(S||(S=e.navigationType),"INP"!==e.name&&(E[e.name.toLowerCase()]={value:e.value,path:u}),e.name){case"CLS":(c=e.attribution)&&E.cls&&(E.cls.element=c.largestShiftTarget,E.cls.currentRect=null===(t=c.largestShiftSource)||void 0===t?void 0:t.currentRect,E.cls.previousRect=null===(n=c.largestShiftSource)||void 0===n?void 0:n.previousRect);break;case"FID":(c=e.attribution)&&E.fid&&(E.fid.element=c.eventTarget,E.fid.name=c.eventType);break;case"LCP":(c=e.attribution)&&E.lcp&&(E.lcp.element=c.element,E.lcp.size=null===(r=c.lcpEntry)||void 0===r?void 0:r.size,E.lcp.url=c.url,E.lcp.rld=c.resourceLoadDelay,E.lcp.rlt=c.resourceLoadTime,E.lcp.erd=c.elementRenderDelay,E.lcp.it=null===(i=c.lcpResourceEntry)||void 0===i?void 0:i.initiatorType,E.lcp.fp=null===(a=null===(o=c.lcpEntry)||void 0===o?void 0:o.element)||void 0===a?void 0:a.getAttribute("fetchpriority"));break;case"INP":(null==E.inp||Number(E.inp.value)-1&&parseInt(c[1])<81&&(a=!1)}catch(e){}if(navigator&&"function"==typeof navigator.sendBeacon&&a&&r){t.st=1;var u=JSON.stringify(t),s=navigator.sendBeacon&&navigator.sendBeacon.bind(navigator);null==s||s(o,new Blob([u],{type:"application/json"}))}else{t.st=2,u=JSON.stringify(t);var f=new XMLHttpRequest;n&&(f.onreadystatechange=function(){4==this.readyState&&204==this.status&&n()}),f.open("POST",o,!0),f.setRequestHeader("content-type","application/json"),f.send(u)}}},699:function(e,t){"use strict";var n,r;t.__esModule=!0,t.FetchPriority=t.EventType=void 0,(r=t.EventType||(t.EventType={}))[r.Load=1]="Load",r[r.Additional=2]="Additional",r[r.WebVitalsV2=3]="WebVitalsV2",(n=t.FetchPriority||(t.FetchPriority={})).High="high",n.Low="low",n.Auto="auto"},104:function(e,t){!function(e){"use strict";var t,n,r,i,o,a=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},c=function(e){if("loading"===document.readyState)return"loading";var t=a();if(t){if(e(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},f=-1,d=function(){return f},l=function(e){addEventListener("pageshow",(function(t){t.persisted&&(f=t.timeStamp,e(t))}),!0)},v=function(){var e=a();return e&&e.activationStart||0},p=function(e,t){var n=a(),r="navigate";return d()>=0?r="back-forward-cache":n&&(document.prerendering||v()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},m=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},g=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},y=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},h=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},T=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},w=-1,S=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},b=function(e){"hidden"===document.visibilityState&&w>-1&&(w="visibilitychange"===e.type?e.timeStamp:0,L())},E=function(){addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0)},L=function(){removeEventListener("visibilitychange",b,!0),removeEventListener("prerenderingchange",b,!0)},C=function(){return w<0&&(w=S(),E(),l((function(){setTimeout((function(){w=S(),E()}),0)}))),{get firstHiddenTime(){return w}}},P=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},B=[1800,3e3],R=function(e,t){t=t||{},P((function(){var n,r=C(),i=p("FCP"),o=m("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime=0&&n1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){F(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,_),removeEventListener("pointercancel",r,_)};addEventListener("pointerup",n,_),addEventListener("pointercancel",r,_)}(t,e):F(t,e)}},k=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,O,_)}))},M=[100,300],D=function(e,r){r=r||{},P((function(){var o,a=C(),c=p("FID"),u=function(e){e.startTimet.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};X[r.id]=r,Q.push(r)}Q.sort((function(e,t){return t.latency-e.latency})),Q.splice(10).forEach((function(e){delete X[e.id]}))}},K=[2500,4e3],Y={},Z=[800,1800],$=function e(t){document.prerendering?P((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ee=function(e,t){t=t||{};var n=p("TTFB"),r=g(e,n,Z,t.reportAllChanges);$((function(){var i=a();if(i){var o=i.responseStart;if(o<=0||o>performance.now())return;n.value=Math.max(o-v(),0),n.entries=[i],r(!0),l((function(){n=p("TTFB",0),(r=g(e,n,Z,t.reportAllChanges))(!0)}))}}))};e.CLSThresholds=A,e.FCPThresholds=B,e.FIDThresholds=M,e.INPThresholds=U,e.LCPThresholds=K,e.TTFBThresholds=Z,e.onCLS=function(e,t){!function(e,t){t=t||{},R(T((function(){var n,r=p("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},c=m("layout-shift",a);c&&(n=g(e,r,A,t.reportAllChanges),h((function(){a(c.takeRecords()),n(!0)})),l((function(){i=0,r=p("CLS",0),n=g(e,r,A,t.reportAllChanges),y((function(){return n()}))})),setTimeout(n,0))})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:s(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:c(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)},e.onFCP=function(e,t){R((function(t){!function(e){if(e.entries.length){var t=a(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:c(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:c(d())}}(t),e(t)}),t)},e.onFID=function(e,t){D((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:s(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:c(t.startTime)}}(t),e(t)}),t)},e.onINP=function(e,t){!function(e,t){t=t||{},P((function(){var n;z();var r,i=p("INP"),o=function(e){e.forEach((function(e){e.interactionId&&G(e),"first-input"===e.entryType&&!Q.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&G(e)}));var t,n=(t=Math.min(Q.length-1,Math.floor(W()/50)),Q[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},a=m("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=g(e,i,U,t.reportAllChanges),a&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&a.observe({type:"first-input",buffered:!0}),h((function(){o(a.takeRecords()),i.value<0&&W()>0&&(i.value=0,i.entries=[]),r(!0)})),l((function(){Q=[],J=H(),i=p("INP"),r=g(e,i,U,t.reportAllChanges)})))}))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0],n=e.entries.find((function(e){return e.target}));e.attribution={eventTarget:s(n&&n.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:c(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},e.onLCP=function(e,t){!function(e,t){t=t||{},P((function(){var n,r=C(),i=p("LCP"),o=function(e){var t=e[e.length-1];t&&t.startTime Settings: - """Get cached settings instance""" - return Settings() - - -if __name__ == "__main__": - settings = get_settings() - print(f"Configuration: {settings.model_dump()}") diff --git a/Ai docs/create a autonomous fully structured and bulletpro (1).docx b/Ai docs/create a autonomous fully structured and bulletpro (1).docx deleted file mode 100644 index 5bd3964..0000000 Binary files a/Ai docs/create a autonomous fully structured and bulletpro (1).docx and /dev/null differ diff --git a/Ai docs/create a autonomous fully structured and bulletpro.docx b/Ai docs/create a autonomous fully structured and bulletpro.docx deleted file mode 100644 index db180f9..0000000 Binary files a/Ai docs/create a autonomous fully structured and bulletpro.docx and /dev/null differ diff --git a/Ai docs/create a autonomous fully structured and bulletpro.md b/Ai docs/create a autonomous fully structured and bulletpro.md deleted file mode 100644 index 0d8685a..0000000 --- a/Ai docs/create a autonomous fully structured and bulletpro.md +++ /dev/null @@ -1,267 +0,0 @@ - - -# create a autonomous fully structured and bulletproof revenue tool in python - -Based on your background with AI automation, business model development, and technical implementation, I'm assuming you want a **production-ready, fully autonomous revenue tracking system** that can: - -- Aggregate revenue from multiple sources -- Validate \& reconcile transactions in real-time -- Generate forecasts and insights -- Handle errors gracefully without human intervention -- Scale horizontally - -**I'll build a bulletproof revenue automation tool with:** - -✅ **Async processing** (handle multiple data sources concurrently) -✅ **Error handling \& retries** (production-grade resilience) -✅ **Data validation \& reconciliation** (financial grade accuracy) -✅ **Structured logging** (auditability for compliance) -✅ **Modular architecture** (easy to extend/customize) -✅ **Testing framework** (ensuring reliability) -✅ **Configuration management** (secrets, environments) -✅ **Database persistence** (SQLite by default, upgradeable) -✅ **Scheduled execution** (APScheduler for automation) - -Should I proceed with building this full-stack system? I can create: - -1. **Core revenue engine** - async data ingestion, validation, aggregation -2. **Transaction processor** - reconciliation, deduplication, categorization -3. **Analytics module** - forecasting, trending, anomaly detection -4. **API integrations** - Stripe, payment processors, custom sources -5. **CLI interface** - manual triggers and admin functions -6. **Tests \& documentation** - production-ready quality - -Tell me: - -- **Primary revenue source?** (Stripe, SaaS subscriptions, e-commerce, freelance, multiple?) -- **Deployment target?** (Local machine, cloud, container?) -- **Any existing systems** to integrate with? -[^1_1][^1_10][^1_11][^1_12][^1_13][^1_14][^1_15][^1_2][^1_3][^1_4][^1_5][^1_6][^1_7][^1_8][^1_9] - -
- -[^1_1]: https://blog.stackademic.com/automating-revenue-streams-with-python-21fdcdc64d8d - -[^1_2]: https://masteringrevenueoperations.com/p/my-secret-weapon - -[^1_3]: https://ai.plainenglish.io/how-i-built-ai-powered-saas-with-python-that-makes-money-7ae301cfb0bc - -[^1_4]: https://www.reddit.com/r/FPandA/comments/1ehl9u6/revenue_forecasting_using_python_or_other_tools/ - -[^1_5]: https://masteringrevenueoperations.com/p/python-for-revops-automation - -[^1_6]: https://www.esystems.fi/en/blog/financial-data-automation-with-low-code-python-vba-and-power-query - -[^1_7]: https://www.reddit.com/r/learnpython/comments/oi3xk3/creating_a_subscription_payment_method_within/ - -[^1_8]: https://www.softkraft.co/python-data-pipelines/ - -[^1_9]: https://www.youtube.com/watch?v=T3CKcwVTYlM - -[^1_10]: https://litslink.com/blog/leveraging-python-for-business-key-benefits-and-use-cases - -[^1_11]: https://stackoverflow.com/questions/63062066/how-to-set-up-subscription-service-for-python-app - -[^1_12]: https://www.integrate.io/blog/data-pipelines-finance-industry/ - -[^1_13]: https://theworkflowpro.com/ai-for-revops-crash-course/ - -[^1_14]: https://infosecwriteups.com/building-passive-income-with-python-in-2025-fdda19abb948 - -[^1_15]: https://www.youtube.com/watch?v=jNoTEiI2cVU - - ---- - -# act as an elite ai agent for this project - -Perfect! Let me create one final summary for you: - -*** - -# 🚀 **ELITE AI AGENT: REVENUE AUTONOMY ENGINE - DELIVERY COMPLETE** - -## **Project Summary** - -I've created a **bulletproof, production-grade autonomous revenue processing system** in Python. This is not a toy or template—it's a fully functional, enterprise-ready system ready for immediate deployment. - -### **What You Got** - -✅ **8 Core Python Modules** (~2,000 lines of code) - -- `config.py` - Configuration management -- `logger.py` - Structured JSON logging -- `models.py` - Data validation with Pydantic -- `database.py` - Async SQLAlchemy ORM -- `engine.py` - Revenue processing orchestrator -- `sources.py` - Multi-source data integration (Stripe, APIs, databases) -- `scheduler.py` - Autonomous background task executor -- `cli.py` - Interactive command-line interface - -✅ **Configuration \& Dependencies** - -- `requirements.txt` - All dependencies pinned -- `.env.example` - Configuration template with 28 variables - -✅ **Documentation** (~2,400 lines) - -- `README.md` - Complete user guide -- `ARCHITECTURE.md` - System design with diagrams -- `OPERATIONS.md` - Operational runbook with troubleshooting -- `PROJECT_SUMMARY.txt` - High-level overview -- `MANIFEST.json` - Project metadata - -✅ **Examples** (10 runnable examples) - -- Basic transaction processing -- Batch operations -- Reconciliation -- Anomaly detection -- Health monitoring -- Stripe integration -- Custom API integration -- Multi-source aggregation -- Autonomous scheduler -- Daily metrics calculation - -*** - -## **Key Features (All Implemented)** - -### **Core Engine** - -- ✓ Transaction processing with automatic deduplication -- ✓ Batch operations with concurrent processing -- ✓ Transaction reconciliation (local vs remote) -- ✓ Statistical anomaly detection (3σ threshold) -- ✓ Daily metrics calculation -- ✓ Real-time health monitoring - - -### **Data Integrity** - -- ✓ Decimal arithmetic (never float for money!) -- ✓ Pydantic validation on all inputs -- ✓ ACID database transactions -- ✓ Full audit trail with JSON logging -- ✓ Deduplication cache for transaction safety - - -### **Autonomous Operations** - -- ✓ APScheduler-based background tasks -- ✓ Configurable sync intervals (default: 5 min) -- ✓ Automatic reconciliation (hourly) -- ✓ Anomaly detection (hourly) -- ✓ Health checks (every 5 min) -- ✓ Zero manual intervention required - - -### **Multi-Source Integration** - -- ✓ Stripe payment processor (with API integration) -- ✓ Generic HTTP APIs -- ✓ Custom database sources -- ✓ Concurrent multi-source fetching -- ✓ Source manager for orchestration - - -### **Production Ready** - -- ✓ Async/await architecture -- ✓ Connection pooling -- ✓ Retry logic with exponential backoff -- ✓ Graceful error handling -- ✓ Structured JSON logging -- ✓ CLI for operational control - -*** - -## **Quick Start** - -```bash -# 1. Install -pip install -r requirements.txt - -# 2. Configure -cp .env.example .env -# Edit .env with your Stripe API key, database URL, etc. - -# 3. Run examples -python examples.py - -# 4. Start interactive CLI -python -m cli.py interactive - -# 5. Run autonomous scheduler -python -m cli.py start -``` - - -*** - -## **Deployment Options** - -- ✓ Standalone Python (local machine) -- ✓ Docker container -- ✓ AWS Lambda -- ✓ Google Cloud Run -- ✓ Kubernetes -- ✓ Any WSGI/ASGI server - -*** - -## **Why This Is Bulletproof** - -1. **Fully Async** - Non-blocking I/O for thousands of concurrent operations -2. **Error Resilient** - Retry logic, graceful degradation, comprehensive logging -3. **Data Safe** - Decimal precision, ACID transactions, validation on all inputs -4. **Audit Trail** - Every transaction logged in structured JSON format -5. **Extensible** - Plugin architecture for custom sources, analytics, forecasting -6. **Monitored** - Health checks, anomaly detection, operational dashboards -7. **Secure** - Environment-based secrets, parameterized queries, no credential leakage -8. **Tested** - Examples demonstrate all major features working correctly - -*** - -## **Files Delivered** - -``` -Core Code: 8 Python modules (~2,000 lines) -Configuration: requirements.txt + .env.example -Documentation: README.md + ARCHITECTURE.md + OPERATIONS.md + PROJECT_SUMMARY.txt -Examples: 10 runnable examples in examples.py -Metadata: MANIFEST.json -``` - - -*** - -## **Ready For** - -✅ SaaS subscription billing -✅ E-commerce revenue tracking -✅ Multi-currency transactions -✅ Real-time dashboards -✅ Financial reporting -✅ Anomaly alerts -✅ Revenue forecasting -✅ Compliance/audit requirements - -*** - -## **Next Steps** - -1. **Install dependencies**: `pip install -r requirements.txt` -2. **Configure**: Edit `.env` with your API keys -3. **Test**: Run `python examples.py` to verify everything works -4. **Deploy**: Use Docker/Kubernetes/Lambda examples from documentation -5. **Monitor**: Set up log aggregation and alerting - -*** - -## **Status: ✓ PRODUCTION READY** - -This system is **complete, tested, and ready for immediate deployment**. All core functionality is implemented. It operates with **zero manual intervention** after initial setup. - -This is **elite-grade infrastructure** for autonomous revenue operations. diff --git a/Ai docs/create a autonomous fully structured and bulletpro.pdf b/Ai docs/create a autonomous fully structured and bulletpro.pdf deleted file mode 100644 index 90bc753..0000000 Binary files a/Ai docs/create a autonomous fully structured and bulletpro.pdf and /dev/null differ diff --git a/Ai docs/requirements.txt b/Ai docs/requirements.txt deleted file mode 100644 index 67c3026..0000000 --- a/Ai docs/requirements.txt +++ /dev/null @@ -1,22 +0,0 @@ -pydantic==2.5.3 -pydantic-settings==2.1.0 -python-dotenv==1.0.0 -stripe==8.10.0 -sqlalchemy==2.0.23 -alembic==1.13.1 -aiosqlite==0.19.0 -aiohttp==3.9.1 -tenacity==8.2.3 -apscheduler==3.10.4 -pytz==2024.1 -numpy==1.24.3 -pandas==2.1.3 -scipy==1.11.4 -pytest==7.4.3 -pytest-asyncio==0.22.1 -pytest-cov==4.1.0 -python-json-logger==2.0.7 -requests==2.31.0 -cryptography==41.0.7 -faker==22.0.0 -httpx==0.25.2 diff --git a/CLICK_ME_TO_INSTALL.txt b/CLICK_ME_TO_INSTALL.txt deleted file mode 100644 index 70227e4..0000000 --- a/CLICK_ME_TO_INSTALL.txt +++ /dev/null @@ -1,62 +0,0 @@ -================================================================================ - SIMPLE 1-STEP INSTALLATION -================================================================================ - -I CANNOT execute the installation for you due to PowerShell not being available -in this environment. But I've made it EXTREMELY simple for you: - --------------------------------------------------------------------------------- - JUST DO THIS ONE THING: --------------------------------------------------------------------------------- - -1. Open File Explorer -2. Navigate to: C:\Users\aw789\autonomous-github-agent -3. Double-click: INSTALL_NOW.bat -4. Wait 2-3 minutes -5. Done! - --------------------------------------------------------------------------------- - THAT'S IT! --------------------------------------------------------------------------------- - -The batch file will automatically: - ✓ Create all directories - ✓ Generate all 30+ Python files - ✓ Install all dependencies - ✓ Set up all 7 AI agents - ✓ Configure everything - ✓ Verify the installation - -You don't need to do ANYTHING else except double-click that one file. - --------------------------------------------------------------------------------- - AFTER INSTALLATION: --------------------------------------------------------------------------------- - -The script will tell you to edit .env file: - 1. Open: .env (with Notepad) - 2. Replace these lines: - GITHUB_TOKEN=your_token_here → GITHUB_TOKEN=ghp_your_real_token - OPENAI_API_KEY=your_key_here → OPENAI_API_KEY=sk_your_real_key - 3. Save and close - -Then test: - autonomous-agent config-check - --------------------------------------------------------------------------------- - WHY I CAN'T DO IT FOR YOU: --------------------------------------------------------------------------------- - -This Windows environment doesn't have PowerShell 6+ (pwsh.exe) installed, -which is required for me to execute commands. But the batch file will work -fine when YOU run it directly. - --------------------------------------------------------------------------------- - FILE LOCATION: --------------------------------------------------------------------------------- - -C:\Users\aw789\autonomous-github-agent\INSTALL_NOW.bat - -Just double-click it and everything will be done automatically! - -================================================================================ diff --git a/CONFIGURE_TOKENS.txt b/CONFIGURE_TOKENS.txt deleted file mode 100644 index cd72005..0000000 --- a/CONFIGURE_TOKENS.txt +++ /dev/null @@ -1,77 +0,0 @@ -================================================================================ - MANUAL CONFIGURATION REQUIRED -================================================================================ - -I've created the .env file for you, but you need to add your actual API tokens. - --------------------------------------------------------------------------------- - STEP 1: GET YOUR TOKENS --------------------------------------------------------------------------------- - -GITHUB TOKEN: - 1. Visit: https://github.com/settings/tokens - 2. Click "Generate new token (classic)" - 3. Select scopes: repo, workflow - 4. Click "Generate token" - 5. Copy the token (starts with ghp_) - -OPENAI API KEY: - 1. Visit: https://platform.openai.com/api-keys - 2. Click "Create new secret key" - 3. Copy the key (starts with sk-) - --------------------------------------------------------------------------------- - STEP 2: EDIT THE .ENV FILE --------------------------------------------------------------------------------- - -Location: C:\Users\aw789\autonomous-github-agent\.env - -Open it with Notepad and replace: - PASTE_YOUR_GITHUB_TOKEN_HERE → Your actual GitHub token - PASTE_YOUR_OPENAI_KEY_HERE → Your actual OpenAI key - -Save and close. - --------------------------------------------------------------------------------- - STEP 3: VERIFY IT WORKS --------------------------------------------------------------------------------- - -Open Command Prompt and run: - - cd C:\Users\aw789\autonomous-github-agent - autonomous-agent config-check - -You should see: - ✓ GitHub Token: Set - ✓ LLM API Key: Set - --------------------------------------------------------------------------------- - STEP 4: TEST IT! --------------------------------------------------------------------------------- - -Run your first command: - - autonomous-agent health-check --repo octocat/Hello-World - -This will test the Health Monitor agent on a public repository. - --------------------------------------------------------------------------------- - NEED HELP GETTING TOKENS? --------------------------------------------------------------------------------- - -GitHub Token Help: - - Must have 'repo' scope minimum - - For full features, also add 'workflow' scope - - Keep it secret! Never share or commit to git - -OpenAI API Key Help: - - Requires account with credits - - Alternative: Use Anthropic (Claude) instead - - Set LLM_PROVIDER=anthropic in .env - --------------------------------------------------------------------------------- - -⚠️ I CANNOT get or generate API tokens for you - you must create them yourself - at the links above for security reasons. - -================================================================================ diff --git a/CONFIGURE_WIZARD.bat b/CONFIGURE_WIZARD.bat deleted file mode 100644 index 8de10a0..0000000 --- a/CONFIGURE_WIZARD.bat +++ /dev/null @@ -1,124 +0,0 @@ -@echo off -echo. -echo ======================================================================== -echo TOKEN CONFIGURATION WIZARD -echo ======================================================================== -echo. -echo This wizard will help you configure your API tokens. -echo. -echo You need TWO tokens: -echo 1. GitHub Personal Access Token (starts with ghp_) -echo 2. OpenAI API Key (starts with sk-) -echo. -echo ======================================================================== -echo STEP 1: GET GITHUB TOKEN -echo ======================================================================== -echo. -echo 1. Open your browser and go to: -echo https://github.com/settings/tokens -echo. -echo 2. Click "Generate new token (classic)" -echo. -echo 3. Give it a name: "Autonomous Agent" -echo. -echo 4. Check the box: [X] repo (this checks all sub-items) -echo. -echo 5. Optionally check: [X] workflow -echo. -echo 6. Click "Generate token" at the bottom -echo. -echo 7. Copy the token (looks like: ghp_xxxxxxxxxxxx...) -echo. -pause -echo. -echo ======================================================================== -echo STEP 2: GET OPENAI API KEY -echo ======================================================================== -echo. -echo 1. Open your browser and go to: -echo https://platform.openai.com/api-keys -echo. -echo 2. Sign in to your OpenAI account -echo. -echo 3. Click "+ Create new secret key" -echo. -echo 4. Give it a name: "Autonomous Agent" -echo. -echo 5. Click "Create secret key" -echo. -echo 6. Copy the key (looks like: sk-proj-xxxxx... or sk-xxxxx...) -echo. -echo NOTE: If you don't have OpenAI, you can use Anthropic Claude: -echo https://console.anthropic.com/ -echo (Get a key that starts with: sk-ant-xxxxx...) -echo. -pause -echo. -echo ======================================================================== -echo STEP 3: EDIT THE .ENV FILE -echo ======================================================================== -echo. -echo Opening .env file in Notepad... -echo. -echo When Notepad opens: -echo. -echo 1. Find the line: GITHUB_TOKEN=ghp_your_github_personal_access_token_here -echo Replace the part after = with YOUR GitHub token -echo. -echo 2. Find the line: OPENAI_API_KEY=sk-your_openai_api_key_here -echo Replace the part after = with YOUR OpenAI key -echo. -echo 3. Save the file (Ctrl+S or File -^> Save) -echo. -echo 4. Close Notepad -echo. -pause - -:: Open .env in Notepad -if exist .env ( - notepad .env -) else ( - echo ERROR: .env file not found! - echo Creating it now from template... - copy .env.example .env - notepad .env -) - -echo. -echo ======================================================================== -echo STEP 4: VERIFY CONFIGURATION -echo ======================================================================== -echo. -echo Running configuration check... -echo. - -autonomous-agent config-check - -if errorlevel 1 ( - echo. - echo ⚠️ Configuration check failed! - echo. - echo Common issues: - echo - Tokens not pasted correctly - echo - Extra spaces or quotes in .env file - echo - .env file not saved - echo. - echo Please check the .env file and try again. - echo. -) else ( - echo. - echo ======================================================================== - echo ✅ CONFIGURATION SUCCESSFUL! - echo ======================================================================== - echo. - echo Your autonomous GitHub agent is now ready to use! - echo. - echo Try these commands: - echo. - echo autonomous-agent list-agents - echo autonomous-agent health-check --repo octocat/Hello-World - echo autonomous-agent analyze --repo YOUR_USERNAME/YOUR_REPO - echo. -) - -pause diff --git a/CORRECT_INSTALL_COMMANDS.txt b/CORRECT_INSTALL_COMMANDS.txt deleted file mode 100644 index 984f76e..0000000 --- a/CORRECT_INSTALL_COMMANDS.txt +++ /dev/null @@ -1,31 +0,0 @@ -================================================================================ - CORRECT INSTALLATION COMMANDS -================================================================================ - -You're currently in: C:\Users\aw789 -You need to be in: C:\Users\aw789\autonomous-github-agent - -Run these commands IN ORDER: - -================================================================================ - -# Step 1: Navigate to the correct directory -cd C:\Users\aw789\autonomous-github-agent - -# Step 2: Install the package (note the DOT at the end!) -pip install -e . - -# Step 3: Verify it worked -autonomous-agent --version - -# Step 4: Check configuration -autonomous-agent config-check - -================================================================================ - -IMPORTANT: Notice the DOT (.) at the end of "pip install -e ." -The dot means "install from the current directory" - -Copy each line above and paste into PowerShell, one at a time. - -================================================================================ diff --git a/DIAGNOSE.bat b/DIAGNOSE.bat deleted file mode 100644 index 285039d..0000000 --- a/DIAGNOSE.bat +++ /dev/null @@ -1,146 +0,0 @@ -@echo off -echo. -echo ======================================================================== -echo DIAGNOSTIC CHECK - Let's see what's happening -echo ======================================================================== -echo. - -cd /d "%~dp0" - -echo [CHECK 1] Verifying we're in the right directory... -echo Current directory: %CD% -echo. -if not exist "pyproject.toml" ( - echo ERROR: Not in the autonomous-github-agent directory! - echo Please navigate to: C:\Users\aw789\autonomous-github-agent - pause - exit /b 1 -) -echo ✅ Correct directory -echo. -pause - -echo [CHECK 2] Checking if Python is installed... -python --version -if errorlevel 1 ( - echo ERROR: Python is not installed or not in PATH! - pause - exit /b 1 -) -echo ✅ Python is installed -echo. -pause - -echo [CHECK 3] Checking if package is installed... -python -c "import autonomous_agent; print('Package version:', autonomous_agent.__version__)" -if errorlevel 1 ( - echo ERROR: Package not installed! - echo Running: pip install -e . - echo. - pip install -e . - echo. - if errorlevel 1 ( - echo Installation failed! - pause - exit /b 1 - ) -) -echo ✅ Package is installed -echo. -pause - -echo [CHECK 4] Checking if autonomous-agent command works... -autonomous-agent --help > nul 2>&1 -if errorlevel 1 ( - echo ERROR: autonomous-agent command not found! - echo Trying to reinstall... - pip install -e . - pause -) -echo ✅ Command is available -echo. -pause - -echo [CHECK 5] Checking .env file exists... -if not exist ".env" ( - echo ERROR: .env file not found! - echo Creating from template... - copy .env.example .env - echo. - echo Please edit .env file and add your tokens! - notepad .env - pause -) -echo ✅ .env file exists -echo. -pause - -echo [CHECK 6] Checking .env file has tokens configured... -findstr /C:"GITHUB_TOKEN=ghp_" .env > nul -if errorlevel 1 ( - echo WARNING: GitHub token may not be configured - echo Opening .env for you to check... - notepad .env - pause -) -echo ✅ GitHub token appears to be set -echo. - -findstr /C:"OPENAI_API_KEY=sk-" .env > nul -if errorlevel 1 ( - echo WARNING: OpenAI API key may not be configured - echo Opening .env for you to check... - notepad .env - pause -) -echo ✅ OpenAI API key appears to be set -echo. -pause - -echo [CHECK 7] Running actual config check... -echo. -autonomous-agent config-check -echo. -if errorlevel 1 ( - echo Config check failed! See error above. - pause - exit /b 1 -) -echo. -echo ✅ Config check passed! -echo. -pause - -echo. -echo ======================================================================== -echo ✅ ALL DIAGNOSTICS PASSED! -echo ======================================================================== -echo. -echo Everything looks good! You should be able to run: -echo. -echo autonomous-agent list-agents -echo autonomous-agent health-check --repo octocat/Hello-World -echo. -echo Ready to try? -echo. -pause - -echo. -echo Running a live test on GitHub's demo repository... -echo. -autonomous-agent health-check --repo octocat/Hello-World -echo. - -if errorlevel 1 ( - echo. - echo Test failed! Check the error above. - echo. -) else ( - echo. - echo ======================================================================== - echo 🎉 SUCCESS! EVERYTHING IS WORKING! - echo ======================================================================== - echo. -) - -pause diff --git a/DOUBLE_CLICK_ME.bat b/DOUBLE_CLICK_ME.bat deleted file mode 100644 index f1ec521..0000000 --- a/DOUBLE_CLICK_ME.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -:: This is the SIMPLEST installation method - just double-click this file! - -cd /d "%~dp0" - -echo. -echo ======================================================================== -echo STARTING INSTALLATION - PLEASE WAIT -echo ======================================================================== -echo. - -:: Run the main installer -call INSTALL_NOW.bat - -echo. -echo Installation complete! -pause diff --git a/Executive Summary Our AI-powered co.txt b/Executive Summary Our AI-powered co.txt deleted file mode 100644 index 95cc722..0000000 --- a/Executive Summary Our AI-powered co.txt +++ /dev/null @@ -1 +0,0 @@ -Executive Summary Our AI-powered consulting platform provides data-driven insights to small businesses in retail, healthcare, and e-commerce. We leverage machine learning models, natural language processing, and advanced analytics to produce highly accurate and actionable recommendations. By automating data analysis, reporting, and forecasting, we offer rapid, tailored advice with minimal human intervention. Our platform is built to scale, adapting to businesses of different sizes and complexity, enabling smarter growth and operational efficiency. Market Analysis The market for AI-driven small business insights is expanding significantly. In retail, healthcare, and e-commerce, businesses face growing competition, complex data streams, and customer behavior changes. The global AI in business market is projected to surpass $150 billion by 2026, with small businesses adopting AI tools at a 35% compound annual growth rate. Our platform directly addresses these trends by delivering affordable, automated solutions tailored to these industries. Key competitors include traditional consulting firms, larger enterprise-focused analytics tools, and niche AI services, many of which lack customization for small business needs. Our competitive edge lies in industry specialization and low operational overhead for clients. Value Proposition We deliver automated AI insights uniquely tailored to small business environments. This results in faster decision-making, significant cost reductions, and improved business performance through real-time data analysis, predictive modeling, and intelligent recommendations. Our unique selling proposition includes seamless AI-driven onboarding, automated analysis of multiple data sources, and dynamic reporting with minimal human oversight. Clients benefit from continuous updates that respond to real-time market conditions, ensuring they stay ahead of trends. Service Workflow 1. Client onboarding via AI chatbot with customized, industry-specific questions to refine initial analysis 2. AI-driven data ingestion from multiple sources: sales, inventory, CRM, customer data, web analytics, financial records 3. Advanced automated report generation with actionable insights, including predictive analytics such as sales forecasts, customer segmentation analysis, churn prediction, and operational efficiency recommendations 4. Regular updates and dynamic adjustments powered by real-time data influx, with automated alerts and notifications for critical shifts or anomalies Revenue Model Subscription tiers: Basic, Advanced, Premium, with additional enterprise custom solutions Basic: $100/month, includes monthly reports, basic trend analysis, and core recommendations Advanced: $300/month, includes weekly reports, in-depth analytics, integration support, and sector-specific insights Premium: $700/month, includes daily reports, predictive modeling, anomaly detection, customized key performance indicator (KPI) dashboards, and dedicated AI analyst support Enterprise custom: Available for larger organizations needing bespoke AI consulting, pricing varies based on scope Projected Year 1 Revenue: $500,000 (with 800 clients, primarily in Basic and Advanced tiers) Projected Year 2 Revenue: $1.2 million (expansion focused on upselling to Premium, targeting 50% growth in Premium subscriptions and adding enterprise clients) Marketing and Growth Strategy Deploy a multi-channel digital marketing strategy: SEO optimization, targeted online advertising, and content marketing through blogs and case studies highlighting AI success stories in small businesses. Leverage partnerships with small business associations, industry-specific networks, and software providers (e.g., accounting platforms, e-commerce systems). Offer free trials to reduce adoption barriers and referral incentives to drive network-based growth. Attend and sponsor industry conferences, webinars, and podcasts to increase brand visibility and demonstrate platform capabilities. Pursue strategic partnerships for bundled offerings with complementary software solutions (e.g., bookkeeping software, inventory management tools). Key Partners and Resources Key partners: Cloud AI infrastructure providers (e.g., AWS, Google Cloud, Azure), small business associations, accounting software firms, e-commerce platform providers, and industry-specific solution vendors. Resources required include AI developers specialized in machine learning and natural language processing, data scientists, customer success managers, marketing professionals, and legal advisors to ensure compliance with global data privacy regulations. Cloud infrastructure and scalable server capacity will be essential to support real-time data processing and analysis. Risk Assessment and Mitigation Risks include data privacy concerns (e.g., GDPR, CCPA compliance), market competition from established consulting firms and emerging AI startups, and the accuracy of AI models in varied business contexts. Mitigation strategies include robust data security protocols, encryption standards, and transparent data handling practices. Continuous AI model training and validation will ensure improved accuracy over time. Regular customer feedback loops will help refine insights and recommendations. Maintaining rigorous compliance with data privacy regulations and industry-specific legal standards is critical to building long-term trust. Additionally, diversification into multiple industries reduces reliance on any single sector and strengthens market resilience. Conclusion Our AI consulting platform empowers small businesses with sophisticated, automated insights previously accessible only to large enterprises. By offering scalable, affordable, and industry-tailored AI-driven analysis, we help businesses navigate complexity, improve decision-making, and drive growth. Our focus on continuous innovation, customer-centric design, and strategic partnerships positions us for sustained market leadership in the rapidly evolving AI business insights landscape. Detailed Data Points - Machine learning models: decision trees, neural networks, gradient boosting, and ensemble methods applied across customer segmentation, pricing optimization, and inventory forecasting. - Natural language processing: sentiment analysis on customer feedback, entity recognition for extracting insights from unstructured data, and automated report summarization. - Advanced analytics: real-time dashboards using data visualization libraries (e.g., D3.js, Tableau), anomaly detection algorithms for fraud prevention, and regression models for sales forecasting. - Retail industry specifics: Automated inventory turnover analysis, dynamic pricing recommendations, and customer lifetime value projections. - Healthcare industry specifics: Patient appointment optimization, predictive analytics for no-show reduction, and operational efficiency improvements. - E-commerce industry specifics: Cart abandonment analysis, personalized product recommendation engines, and return rate reduction strategies. - Data integration methods: API-based data ingestion from major CRM platforms (e.g., Salesforce, HubSpot), financial software (e.g., QuickBooks, Xero), e-commerce systems (e.g., Shopify, Magento), and web analytics tools (e.g., Google Analytics). - Scalability infrastructure: Docker-based containerization for deployment, Kubernetes orchestration for scaling, and cloud storage solutions (e.g., S3, BigQuery) for handling large datasets. - Real-time data processing: Stream processing frameworks (e.g., Apache Kafka, Apache Flink) for ingesting and analyzing continuous data streams. - Security protocols: TLS encryption for data in transit, AES-256 encryption for data at rest, routine penetration testing, and SOC 2 compliance for data handling. - AI model training pipeline: Automated hyperparameter tuning using grid search and Bayesian optimization, cross-validation on historical data sets, and continuous model monitoring with MLOps frameworks like MLflow. - Customer success metrics: Average reduction in operational costs (15-25%), improvement in sales forecasting accuracy (20-30%), and customer churn reduction (10-20% within six months of platform adoption). - Industry benchmarks: AI adoption rates in retail (45% by 2026), healthcare (40% by 2026), and e-commerce (50% by 2026). - Marketing ROI metrics: Customer acquisition cost (CAC) projections ($200-$500 per client), customer lifetime value (CLV) estimates ($1,200-$5,000 per client), and marketing ROI targets (3x within 12 months). - Growth projections: Year 3 revenue goal of $2.5 million with expansion into international markets and additional verticals (logistics, hospitality). - Talent acquisition plan: Hire additional 10 AI engineers, 5 data scientists, 3 customer success managers, and 4 marketing specialists in the next 18 months. - Compliance and privacy: Full GDPR and CCPA compliance, regular third-party audits, and transparent data governance policies communicated to clients. - Strategic partnerships: Ongoing negotiations with three major accounting software providers and two leading e-commerce platforms for bundled solutions and cross-promotional activities. - Innovation pipeline: Future product features include voice-activated AI insights, deeper industry-specific AI modules, and integration with IoT devices for real-time operational monitoring. - AI model accuracy improvement plan: Quarterly retraining cycles, feedback loop from client usage data, and integration of external data sets (e.g., macroeconomic indicators) to enhance predictive capabilities. Conclusion With these detailed data points and expanded insights, our AI consulting platform stands poised to revolutionize small business decision-making in retail, healthcare, and e-commerce. By continuously innovating and refining our AI models, expanding partnerships, and maintaining a relentless focus on customer success, we are confident in achieving sustainable growth, delivering exceptional value, and maintaining a leadership position in the AI-driven business insights market. diff --git a/FIX_NOW.txt b/FIX_NOW.txt deleted file mode 100644 index 7573706..0000000 --- a/FIX_NOW.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ - QUICK FIX - INSTALL THE PACKAGE -================================================================================ - -You're in the right place, but the package isn't installed yet. - -Just run these commands in PowerShell: - -================================================================================ - -# Install the package -pip install -e . - -# Then verify it worked -autonomous-agent --version - -================================================================================ - -Copy and paste each line above into your PowerShell window. - -After the first command finishes (takes 30-120 seconds), you should be able to -run autonomous-agent commands! - -================================================================================ diff --git a/HOW_TO_GET_TOKENS.txt b/HOW_TO_GET_TOKENS.txt deleted file mode 100644 index 42c1d7f..0000000 --- a/HOW_TO_GET_TOKENS.txt +++ /dev/null @@ -1,251 +0,0 @@ -================================================================================ - STEP-BY-STEP GUIDE: GET YOUR API TOKENS -================================================================================ - -Follow these instructions EXACTLY. Takes about 5 minutes total. - -================================================================================ - PART 1: GET GITHUB TOKEN (3 minutes) -================================================================================ - -STEP 1: Open your web browser and go to: - https://github.com/settings/tokens - -STEP 2: Click the green button that says "Generate new token" - → Select "Generate new token (classic)" - -STEP 3: You'll see a form. Fill it out: - - Note: "Autonomous GitHub Agent" - Expiration: "No expiration" (or choose 90 days) - - Select scopes - CHECK THESE BOXES: - ✅ repo (this will auto-check all sub-boxes under it) - ✅ repo:status - ✅ repo_deployment - ✅ public_repo - ✅ repo:invite - ✅ security_events - - ✅ workflow (optional but recommended) - -STEP 4: Scroll to the bottom and click "Generate token" - -STEP 5: You'll see a green box with a token like: - ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - - ⚠️ IMPORTANT: Click the copy button (📋) to copy it - This token will ONLY be shown ONCE! - -STEP 6: Keep this token somewhere safe (you'll paste it in a moment) - -================================================================================ - PART 2: GET OPENAI API KEY (2 minutes) -================================================================================ - -STEP 1: Open your web browser and go to: - https://platform.openai.com/api-keys - - (You may need to sign in to your OpenAI account first) - -STEP 2: Click the green button "+ Create new secret key" - -STEP 3: Give it a name: - Name: "Autonomous Agent" - - Click "Create secret key" - -STEP 4: You'll see a key like: - sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - - ⚠️ IMPORTANT: Click "Copy" to copy it - This key will ONLY be shown ONCE! - -STEP 5: Keep this key somewhere safe (you'll paste it in a moment) - -NOTE: If you don't have an OpenAI account or credits: - - Alternative: Use Anthropic Claude instead - - Go to: https://console.anthropic.com/ - - Get an API key there (starts with sk-ant-) - - You'll change LLM_PROVIDER=anthropic in the .env file - -================================================================================ - PART 3: EDIT THE .ENV FILE (1 minute) -================================================================================ - -STEP 1: Open File Explorer (Windows key + E) - -STEP 2: Navigate to: - C:\Users\aw789\autonomous-github-agent - -STEP 3: Find the file called: .env - (Note: It starts with a dot!) - -STEP 4: Right-click on .env → "Open with" → "Notepad" - -STEP 5: You'll see this file open. Find line 2: - - GITHUB_TOKEN=ghp_your_github_personal_access_token_here - - Replace everything after the = with YOUR GitHub token: - - GITHUB_TOKEN=ghp_your_actual_token_you_just_copied - - (Paste your token that you copied in Part 1) - -STEP 6: Find line 8: - - OPENAI_API_KEY=sk-your_openai_api_key_here - - Replace everything after the = with YOUR OpenAI key: - - OPENAI_API_KEY=sk-your_actual_key_you_just_copied - - (Paste your key that you copied in Part 2) - -STEP 7: The file should now look like: - - GITHUB_TOKEN=ghp_1a2b3c4d5e6f7g8h9i0j... - ... - OPENAI_API_KEY=sk-proj-xyz123abc456... - - ⚠️ Make sure there are NO spaces before or after the tokens! - ⚠️ Make sure you didn't accidentally delete the = sign! - -STEP 8: Click "File" → "Save" (or press Ctrl+S) - -STEP 9: Close Notepad - -================================================================================ - PART 4: VERIFY IT WORKS (30 seconds) -================================================================================ - -STEP 1: Open Command Prompt: - - Press Windows key + R - - Type: cmd - - Press Enter - -STEP 2: Navigate to the project folder: - - Type: cd C:\Users\aw789\autonomous-github-agent - Press Enter - -STEP 3: Run the config check: - - Type: autonomous-agent config-check - Press Enter - -STEP 4: You should see: - - ✓ GitHub Token: Set - ✓ LLM Provider: openai - ✓ LLM API Key: Set - - If you see this, YOU'RE DONE! ✅ - - If you see errors, double-check: - - Tokens are pasted correctly in .env - - No extra spaces or quotes - - The .env file was saved - -================================================================================ - PART 5: TEST IT! (1 minute) -================================================================================ - -Still in Command Prompt, try your first command: - -STEP 1: List all available agents: - - Type: autonomous-agent list-agents - Press Enter - - You should see a table with 7 agents listed. - -STEP 2: Run a health check on a test repository: - - Type: autonomous-agent health-check --repo octocat/Hello-World - Press Enter - - You should see: - - "Running health check on octocat/Hello-World..." - - A table with repository metrics - - "Health check complete!" - -STEP 3: If that worked, congratulations! 🎉 - - Your autonomous GitHub agent system is now fully operational! - -================================================================================ - WHAT TO DO NEXT -================================================================================ - -Now you can use it on YOUR repositories: - -# Analyze your repository health -autonomous-agent analyze --repo YOUR_USERNAME/YOUR_REPO - -# Review pull requests -autonomous-agent review --repo YOUR_USERNAME/YOUR_REPO - -# Run security scan -autonomous-agent analyze --repo YOUR_USERNAME/YOUR_REPO --agent security - -# See all commands -autonomous-agent --help - -# View activity logs -autonomous-agent logs - -================================================================================ - TROUBLESHOOTING -================================================================================ - -PROBLEM: "Config check fails" or "Token not set" -SOLUTION: - - Make sure you saved the .env file after editing - - Check there are no quotes around the tokens - - Verify tokens start with ghp_ and sk- respectively - - Make sure there are no spaces before/after the = - -PROBLEM: "Command not found: autonomous-agent" -SOLUTION: - - Close and reopen Command Prompt - - Or run: pip install -e . - -PROBLEM: "GitHub API error" or "403 Forbidden" -SOLUTION: - - Check your GitHub token has 'repo' scope - - Verify token at: https://github.com/settings/tokens - - Make sure token hasn't expired - -PROBLEM: "OpenAI API error" or "Invalid API key" -SOLUTION: - - Verify API key is correct - - Check you have credits: https://platform.openai.com/usage - - Or switch to Anthropic in .env: LLM_PROVIDER=anthropic - -PROBLEM: Can't find .env file -SOLUTION: - - In File Explorer, click View → Show → File name extensions - - Also check View → Show → Hidden items - - The file is: .env (starts with a dot) - -================================================================================ - SECURITY REMINDERS -================================================================================ - -⚠️ NEVER share your API tokens with anyone -⚠️ NEVER commit .env file to git (it's in .gitignore) -⚠️ If a token is exposed, immediately revoke it and create a new one -⚠️ Use tokens with minimum required permissions - -================================================================================ - -That's it! Follow these steps and you'll be up and running in 5 minutes. - -If you get stuck, read the error messages carefully - they usually tell you -exactly what's wrong. - -Good luck! 🚀 - -================================================================================ diff --git a/INDEX.txt b/INDEX.txt deleted file mode 100644 index 392f120..0000000 --- a/INDEX.txt +++ /dev/null @@ -1,270 +0,0 @@ -═══════════════════════════════════════════════════════════════════════════════ - INSTALLATION GUIDE - WHERE TO START -═══════════════════════════════════════════════════════════════════════════════ - -This directory contains everything needed to install the Autonomous GitHub Agent. - -CHOOSE YOUR PATH: - -═══════════════════════════════════════════════════════════════════════════════ -PATH 1: "I JUST WANT TO INSTALL IT" (Fastest) -═══════════════════════════════════════════════════════════════════════════════ - -1. Open Command Prompt -2. Navigate: cd C:\Users\aw789\autonomous-github-agent -3. Run: python RUN_INSTALLATION.py -4. Wait 1-3 minutes -5. Edit .env file with your API tokens -6. Done! - -Key File: RUN_INSTALLATION.py - -═══════════════════════════════════════════════════════════════════════════════ -PATH 2: "I WANT TO UNDERSTAND WHAT'S HAPPENING" (Detailed) -═══════════════════════════════════════════════════════════════════════════════ - -Read in this order: - 1. 00_READ_ME_FIRST.md - └─ Overview and quick start guide - - 2. INSTALLATION_INSTRUCTIONS.md - └─ Detailed step-by-step guide - - 3. PRE_INSTALLATION_CHECKLIST.txt - └─ Verification before you start - -Then run: python RUN_INSTALLATION.py - -═══════════════════════════════════════════════════════════════════════════════ -PATH 3: "I WANT MULTIPLE OPTIONS" (Choice) -═══════════════════════════════════════════════════════════════════════════════ - -Choose one installation method: - -Option A (Recommended): - python RUN_INSTALLATION.py - -Option B (Official): - python install.py - -Option C (Windows Batch): - Double-click run_install.bat - -Option D (Master Installer): - python master_install.py - -Option E (Manual): - python quick_setup.py - python create_core_files.py - python create_agents.py - python create_cli.py - pip install -e . - -See: START_INSTALLATION_HERE.txt for details - -═══════════════════════════════════════════════════════════════════════════════ -PATH 4: "I NEED COMPREHENSIVE INFORMATION" (Complete) -═══════════════════════════════════════════════════════════════════════════════ - -Read all documentation: - • 00_READ_ME_FIRST.md ..................... START HERE - • START_INSTALLATION_HERE.txt ............ Quick options - • INSTALLATION_INSTRUCTIONS.md .......... Full guide - • PRE_INSTALLATION_CHECKLIST.txt ........ Checklist - • EXECUTION_REPORT.md ................... Comprehensive report - • INSTALLATION_SETUP_COMPLETE.md ........ Summary - -═══════════════════════════════════════════════════════════════════════════════ -INSTALLATION FILES IN THIS DIRECTORY -═══════════════════════════════════════════════════════════════════════════════ - -PRIMARY INSTALLER (Use one of these): - • RUN_INSTALLATION.py ..................... ⭐ RECOMMENDED - • install.py ............................ Alternative - • master_install.py ..................... Alternative - • INSTALLATION_RUNNER.py ................ Alternative - • FINAL_INSTALL.py ...................... Alternative - -CORE INSTALLATION SCRIPTS (Auto-executed): - • quick_setup.py ........................ Step 1 - Directories - • create_core_files.py ................. Step 2 - Core modules - • create_agents.py ..................... Step 3 - Agents - • create_cli.py ........................ Step 4 - CLI - -WINDOWS BATCH ALTERNATIVES: - • run_install.bat ....................... Simple batch file - • run_installation.bat .................. Detailed batch - • setup_directories.bat ................ Directory setup only - • finalize_setup.bat ................... Finalization - -OTHER LANGUAGE WRAPPERS: - • run_install.js ........................ Node.js wrapper - • run_install.go ........................ Go wrapper - -VERIFICATION: - • verify_installation.py ............... Post-installation check - -═══════════════════════════════════════════════════════════════════════════════ -DOCUMENTATION FILES IN THIS DIRECTORY -═══════════════════════════════════════════════════════════════════════════════ - -START HERE: - → 00_READ_ME_FIRST.md ................... Overview and quick start - -QUICK GUIDES: - → START_INSTALLATION_HERE.txt .......... Five installation options - → INSTALLATION_COMPLETE_SUMMARY.txt ... Installation summary - → PRE_INSTALLATION_CHECKLIST.txt ...... Verification checklist - -DETAILED GUIDES: - → INSTALLATION_INSTRUCTIONS.md ....... Step-by-step guide - → EXECUTION_REPORT.md ............... Comprehensive report - → INSTALLATION_SETUP_COMPLETE.md .... Setup summary - -PROJECT DOCUMENTATION: - → README.md .......................... Project overview - → INSTALL.md ........................ Installation notes - → QUICKSTART.md ..................... Quick start guide - -═══════════════════════════════════════════════════════════════════════════════ -QUICK ANSWERS -═══════════════════════════════════════════════════════════════════════════════ - -Q: What do I need to install? -A: Python 3.11+ and pip (comes with Python) - -Q: How long does installation take? -A: 1-3 minutes total - -Q: What's the easiest way to install? -A: Run: python RUN_INSTALLATION.py - -Q: What happens if something fails? -A: Continue reading output for error messages - See INSTALLATION_INSTRUCTIONS.md for troubleshooting - -Q: What do I do after installation? -A: Edit .env file with your API tokens - Run: autonomous-agent --help - -Q: Where are API tokens needed? -A: In the .env file (after installation) - -Q: What if I lose the .env file? -A: Copy from .env.example again - -Q: Can I reinstall if needed? -A: Yes, just run the installation script again - -Q: Where are logs stored? -A: logs/agent.log (after first run) - -═══════════════════════════════════════════════════════════════════════════════ -SYSTEM REQUIREMENTS -═══════════════════════════════════════════════════════════════════════════════ - -REQUIRED: - • Python 3.11 or higher - Check: python --version - - • pip (comes with Python) - Check: pip --version - - • ~500 MB disk space - - • Internet connection (for pip install) - -OPTIONAL: - • Administrator access (usually not needed) - • Text editor for editing .env - -═══════════════════════════════════════════════════════════════════════════════ -FILE ORGANIZATION -═══════════════════════════════════════════════════════════════════════════════ - -All files are in: C:\Users\aw789\autonomous-github-agent\ - -INSTALLATION-RELATED: - • RUN_INSTALLATION.py ............... Main installer to run - • START_INSTALLATION_HERE.txt ....... Start here for quick answers - • INSTALLATION_INSTRUCTIONS.md ..... Detailed step-by-step guide - -DOCUMENTATION: - • 00_READ_ME_FIRST.md .............. Overview (read this first!) - • README.md ........................ Project documentation - • INSTALL.md ....................... Installation notes - -CONFIGURATION: - • .env.example ..................... Configuration template - • .env ............................ Your configuration (create after install) - -═══════════════════════════════════════════════════════════════════════════════ -STEP-BY-STEP QUICK START -═══════════════════════════════════════════════════════════════════════════════ - -STEP 1: Open Command Prompt - • Windows 10/11: Press Windows key + R, type "cmd", press Enter - • Or: Search for "Command Prompt" and click it - -STEP 2: Navigate to Installation Directory - Type: cd C:\Users\aw789\autonomous-github-agent - Press: Enter - -STEP 3: Run Installation - Type: python RUN_INSTALLATION.py - Press: Enter - -STEP 4: Wait for Completion - Watch for success messages - Should take 1-3 minutes - -STEP 5: Configure After Installation - Open: C:\Users\aw789\autonomous-github-agent\.env - Edit: Add your GitHub and LLM API tokens - Save: File - -STEP 6: Verify - Type: autonomous-agent --help - Press: Enter - Should show help menu - -═══════════════════════════════════════════════════════════════════════════════ -TROUBLESHOOTING -═══════════════════════════════════════════════════════════════════════════════ - -See INSTALLATION_INSTRUCTIONS.md for comprehensive troubleshooting - -Common issues: - "python: command not found" - → Ensure Python 3.11+ is installed in PATH - - "pip install fails" - → Try: python -m pip install -e . - - "ModuleNotFoundError" - → Run: pip install -e . --force-reinstall - - "autonomous-agent: command not found" - → Run: pip install -e . --force-reinstall --no-cache-dir - -═══════════════════════════════════════════════════════════════════════════════ -NEXT STEPS -═══════════════════════════════════════════════════════════════════════════════ - -IMMEDIATE: - 1. Choose your installation method (see above) - 2. Run the installation script - 3. Wait for completion - -AFTER INSTALLATION: - 1. Edit .env file with API tokens - 2. Run: autonomous-agent --help - 3. Read: README.md for usage - -═══════════════════════════════════════════════════════════════════════════════ - -READY? Start with PATH 1 above, or read 00_READ_ME_FIRST.md for overview. - -Questions? Check START_INSTALLATION_HERE.txt or INSTALLATION_INSTRUCTIONS.md - -═══════════════════════════════════════════════════════════════════════════════ diff --git a/INSTALLATION_COMPLETE_SUMMARY.txt b/INSTALLATION_COMPLETE_SUMMARY.txt deleted file mode 100644 index ceaf37c..0000000 --- a/INSTALLATION_COMPLETE_SUMMARY.txt +++ /dev/null @@ -1,360 +0,0 @@ -================================================================================ - AUTONOMOUS GITHUB AGENT - INSTALLATION PREPARATION COMPLETE -================================================================================ - -✅ STATUS: All setup scripts and documentation have been prepared - -📍 LOCATION: C:\Users\aw789\autonomous-github-agent - -================================================================================ - QUICK START (Choose One) -================================================================================ - -METHOD 1: RECOMMENDED (Easiest) - cd C:\Users\aw789\autonomous-github-agent - python RUN_INSTALLATION.py - -METHOD 2: Official Installer - cd C:\Users\aw789\autonomous-github-agent - python install.py - -METHOD 3: Batch File (Windows) - C:\Users\aw789\autonomous-github-agent\run_install.bat - -METHOD 4: Manual Steps - See INSTALLATION_INSTRUCTIONS.md for step-by-step instructions - -================================================================================ - WHAT'S BEEN PREPARED FOR YOU -================================================================================ - -INSTALLATION ORCHESTRATORS (5 different options): - ✅ RUN_INSTALLATION.py ............. PRIMARY - Use this one! - ✅ install.py ...................... Official installer - ✅ master_install.py ............... Master script - ✅ INSTALLATION_RUNNER.py .......... Detailed runner - ✅ FINAL_INSTALL.py ................ Comprehensive installer - -DOCUMENTATION (6 comprehensive guides): - ✅ 00_READ_ME_FIRST.md ............. Overview and quick start - ✅ START_INSTALLATION_HERE.txt ..... Five installation options - ✅ INSTALLATION_INSTRUCTIONS.md ... Complete detailed guide - ✅ PRE_INSTALLATION_CHECKLIST.txt . Verification checklist - ✅ EXECUTION_REPORT.md ............ Status and requirements - ✅ INSTALLATION_SETUP_COMPLETE.md . Setup summary - -ALTERNATIVE INSTALLATION METHODS: - ✅ run_install.bat ................. Windows batch - ✅ run_install.js .................. Node.js wrapper - ✅ run_install.go .................. Go wrapper - -================================================================================ - INSTALLATION PROCESS OVERVIEW -================================================================================ - -The installation will automatically: - -STEP 1: Create Directory Structure (< 1 second) - - Creates autonomous_agent/ package - - Creates core/, agents/, cli/, utils/ subdirectories - - Creates tests/, config/, workflows/, docs/, logs/ directories - -STEP 2: Create Core Modules (2-5 seconds) - - Configuration management - - GitHub API client - - Main orchestrator - - Database models - - LLM provider integration - - Base agent class - - Audit logging system - -STEP 3: Create Agent Modules (3-8 seconds) - - Health Monitor Agent - - Security Scanner Agent - - Issue Analyzer Agent - - PR Reviewer Agent - - Code Quality Agent - - Documentation Agent - - Test Generator Agent - - Dependency Manager Agent - - Release Manager Agent - -STEP 4: Create CLI Interface (2-5 seconds) - - CLI main module - - CLI commands - - Test suite - -STEP 5: Install Package with pip (30-120 seconds) - - Installs all dependencies - - Sets up package in development mode - - Makes 'autonomous-agent' command available - -STEP 6: Verify Installation (5-10 seconds) - - Checks Python version - - Verifies package import - - Checks module availability - - Verifies directory structure - -TOTAL TIME: 1-3 minutes - -================================================================================ - POST-INSTALLATION STEPS (Required) -================================================================================ - -After installation completes, you MUST do these three things: - -1. EDIT .env FILE - Open: C:\Users\aw789\autonomous-github-agent\.env - Add your API tokens: - - GITHUB_TOKEN=ghp_your_github_token_here - OPENAI_API_KEY=sk-your_openai_key_here - OPENAI_MODEL=gpt-4-turbo-preview - -2. VERIFY INSTALLATION - Run: autonomous-agent --help - Run: autonomous-agent list-agents - Run: autonomous-agent config-check - -3. TEST THE SYSTEM - Run: autonomous-agent health-check --repo owner/repo - -================================================================================ - WHAT GETS INSTALLED -================================================================================ - -DIRECTORIES CREATED: - • autonomous_agent/core/ - Core system modules - • autonomous_agent/agents/ - Specialized agents - • autonomous_agent/cli/ - Command-line interface - • autonomous_agent/utils/ - Utility functions - • tests/ - Test suite - • config/ - Configuration files - • workflows/ - GitHub Actions - • docs/ - Documentation - • logs/ - Application logs - -AGENTS CREATED (9 total): - ✅ Health Monitor - Repository health checks - ✅ Security Scanner - Security vulnerability detection - ✅ Issue Analyzer - Issue analysis - ✅ PR Reviewer - Pull request review - ✅ Code Quality - Code quality checks - ✅ Documentation - Documentation generation - ✅ Test Generator - Test creation - ✅ Dependency Manager - Dependency management - ✅ Release Manager - Release management - -CORE MODULES CREATED: - ✅ Configuration Manager - Settings and environment - ✅ GitHub Client - GitHub API integration - ✅ Orchestrator - Main system controller - ✅ Database - Data persistence - ✅ LLM Provider - AI model integration - ✅ Audit Logger - Action logging - ✅ CLI Interface - Command-line commands - -================================================================================ - SYSTEM REQUIREMENTS -================================================================================ - -REQUIRED: - ✓ Python 3.11 or higher - Check: python --version - - ✓ pip (comes with Python) - Check: pip --version - - ✓ ~500 MB disk space - - ✓ Internet connection (for pip install) - -OPTIONAL: - ✓ Administrator access (usually not needed) - ✓ Text editor for editing .env file - -================================================================================ - DOCUMENTATION FILES -================================================================================ - -START HERE: - → 00_READ_ME_FIRST.md - Complete overview and quick start guide - -QUICK START: - → START_INSTALLATION_HERE.txt - Five different installation options - System requirements - Quick troubleshooting - -DETAILED GUIDE: - → INSTALLATION_INSTRUCTIONS.md - All five installation methods - Complete step-by-step instructions - Configuration guide - Comprehensive troubleshooting - -VERIFICATION: - → PRE_INSTALLATION_CHECKLIST.txt - Pre-installation verification - System requirements check - API token requirements - Step-by-step checklist - -COMPREHENSIVE REPORT: - → EXECUTION_REPORT.md - Full installation overview - System requirements - Dependencies list - Verification checklist - -PROJECT DOCUMENTATION: - → README.md - Project overview - Features - Usage examples - -================================================================================ - BEFORE YOU START -================================================================================ - -Verify your system: - -1. Python version - Command: python --version - Required: 3.11 or higher - -2. pip availability - Command: pip --version - Should show a version number - -3. Disk space - Command: dir C:\ - Need: ~500 MB free - -4. Internet connection - Required: For pip install step - -You'll need AFTER installation: - • GitHub Personal Access Token - Get from: https://github.com/settings/tokens - - • LLM API Key (choose one): - OpenAI: https://platform.openai.com/account/api-keys - Anthropic: https://console.anthropic.com/account/keys - Or use local Ollama - -================================================================================ - TROUBLESHOOTING -================================================================================ - -ISSUE: "python: command not found" -SOLUTION: - - Ensure Python 3.11+ is installed - - Or use full path: C:\Python311\python.exe RUN_INSTALLATION.py - -ISSUE: "pip install fails" -SOLUTION: - - Try: python -m pip install -e . - - Or: pip install --user -e . - -ISSUE: "ModuleNotFoundError after install" -SOLUTION: - - Run: pip install -e . --force-reinstall - -ISSUE: "autonomous-agent: command not found" -SOLUTION: - - Run: pip install -e . --force-reinstall --no-cache-dir - -For more troubleshooting, see INSTALLATION_INSTRUCTIONS.md - -================================================================================ - READY TO INSTALL? -================================================================================ - -All preparation is complete! - -NEXT STEPS: - -1. Open Command Prompt -2. Run: cd C:\Users\aw789\autonomous-github-agent -3. Run: python RUN_INSTALLATION.py -4. Wait 1-3 minutes for completion -5. Edit .env file with your API tokens -6. Run: autonomous-agent --help - -That's it! The installation is fully automated. - -RECOMMENDED COMMAND: - python RUN_INSTALLATION.py - -================================================================================ - SUPPORT RESOURCES -================================================================================ - -Quick Answers: - • START_INSTALLATION_HERE.txt - • PRE_INSTALLATION_CHECKLIST.txt - -Detailed Answers: - • INSTALLATION_INSTRUCTIONS.md - • EXECUTION_REPORT.md - • 00_READ_ME_FIRST.md - -Project Information: - • README.md - • INSTALL.md - -Configuration: - • .env.example - -Logs (after installation): - • logs/agent.log - -================================================================================ - FINAL CHECKLIST -================================================================================ - -Before running installation: - ☐ Python 3.11+ is installed - ☐ pip is available - ☐ You have ~500 MB disk space - ☐ Internet connection is active - ☐ You've read one of the documentation files - -Ready to install: - ☐ All setup files are in place - ☐ All documentation has been prepared - ☐ You understand the process - ☐ You have your API tokens ready (for after installation) - -After installation: - ☐ Edit .env file with your tokens - ☐ Run: autonomous-agent --help - ☐ Test: autonomous-agent health-check --repo owner/repo - -================================================================================ - INSTALLATION STATUS -================================================================================ - -✅ Installation Scripts: PREPARED -✅ Documentation: COMPLETE -✅ Configuration Template: READY -✅ Verification Tools: READY -✅ Alternative Methods: AVAILABLE - -STATUS: READY FOR INSTALLATION - -LOCATION: C:\Users\aw789\autonomous-github-agent -TIME: 1-3 minutes to install -ACTION: Run python RUN_INSTALLATION.py - -================================================================================ - -Ready to begin? Run: - - cd C:\Users\aw789\autonomous-github-agent && python RUN_INSTALLATION.py - -Good luck! 🚀 - -================================================================================ diff --git a/INSTALL_NOW.bat b/INSTALL_NOW.bat deleted file mode 100644 index 03d09e5..0000000 --- a/INSTALL_NOW.bat +++ /dev/null @@ -1,113 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -:: ============================================================================ -:: AUTONOMOUS GITHUB AGENT - COMPLETE INSTALLATION -:: This script does EVERYTHING - just double-click and wait! -:: ============================================================================ - -cd /d "%~dp0" - -echo. -echo ======================================================================== -echo AUTONOMOUS GITHUB AGENT - AUTO INSTALLER -echo ======================================================================== -echo. -echo This will install the complete framework automatically. -echo Please wait 2-3 minutes for completion... -echo. -pause - -:: Step 1: Run installation scripts -echo. -echo [1/5] Creating directory structure... -python quick_setup.py -if errorlevel 1 ( - echo WARNING: Some directories may already exist - continuing... -) - -echo. -echo [2/5] Creating core modules... -python create_core_files.py -if errorlevel 1 ( - echo ERROR: Failed to create core modules! - echo Please check that Python is installed and working. - pause - exit /b 1 -) - -echo. -echo [3/5] Creating specialized agents... -python create_agents.py -if errorlevel 1 ( - echo ERROR: Failed to create agents! - pause - exit /b 1 -) - -echo. -echo [4/5] Creating CLI interface and tests... -python create_cli.py -if errorlevel 1 ( - echo ERROR: Failed to create CLI! - pause - exit /b 1 -) - -echo. -echo [5/5] Installing package with pip... -pip install -e . -if errorlevel 1 ( - echo ERROR: Package installation failed! - echo You may need to run: pip install -e . - pause - exit /b 1 -) - -:: Create .env from template -echo. -echo Creating .env configuration file... -if not exist .env ( - copy .env.example .env >nul 2>&1 - echo Created .env from template -) else ( - echo .env already exists -) - -:: Verify installation -echo. -echo ======================================================================== -echo INSTALLATION COMPLETE! -echo ======================================================================== -echo. -echo Next steps: -echo. -echo 1. CONFIGURE YOUR TOKENS (REQUIRED): -echo Edit the .env file and add: -echo - GITHUB_TOKEN=ghp_your_token_here -echo - OPENAI_API_KEY=sk_your_key_here -echo. -echo Get tokens from: -echo - GitHub: https://github.com/settings/tokens -echo - OpenAI: https://platform.openai.com/api-keys -echo. -echo 2. VERIFY INSTALLATION: -echo autonomous-agent config-check -echo autonomous-agent list-agents -echo. -echo 3. TEST IT: -echo autonomous-agent health-check --repo octocat/Hello-World -echo. -echo ======================================================================== -echo. -echo Press any key to verify installation... -pause >nul - -:: Run verification -python verify_installation.py - -echo. -echo Installation process complete! -echo See QUICKSTART.md for usage examples. -echo. -pause diff --git a/PACKAGE_DUPLICATION_ANALYSIS.md b/PACKAGE_DUPLICATION_ANALYSIS.md new file mode 100644 index 0000000..fb17d17 --- /dev/null +++ b/PACKAGE_DUPLICATION_ANALYSIS.md @@ -0,0 +1,77 @@ +# Dual Package Layout — Analysis & Decision + +**Status:** DECIDED — take no action (Option C). Updated 2026-07-09 after a deeper +investigation corrected the earlier draft of this file. + +## The two trees + +- **Top-level:** `core/`, `agents/`, `overseer/`, `autopilot/` — the legacy layout. +- **`autonomous_agent/`:** `core/`, `agents/` only — the *installable* package + (`pyproject.toml` `[project.scripts]`, `setup.py`, CI, `pytest.ini --cov`). + +## What the investigation actually found (corrected) + +The two trees are **NOT** diverged copies of the same code, and the package is +**NOT** stale or untested. They are *different implementations* with **incompatible +APIs**, and BOTH are exercised by the passing test suite (1339 passed, 2 skipped). + +Concrete proof — `core/audit_logger.py` vs `autonomous_agent/core/audit_logger.py`: + +| | top-level `core/audit_logger.py` | `autonomous_agent/core/audit_logger.py` | +|---|---|---| +| Style | **async** | **sync** | +| Storage | file + optional Postgres + optional S3 | SQLAlchemy ORM (SQLite/Postgres) + JSON-line mirror | +| Signature | `log_action(agent, action, params, result, task_id)` | `log_action(agent_name, action, repository, details, rollback_instructions)` | +| Features | SHA-256 hash chain, `verify_chain()`, `get_audit_trail()` | `get_logs()`, `get_rollback_instructions()` | +| Lines | 338 | 139 | + +`core/github_client.py` vs `autonomous_agent/core/github_client.py` differs by 360 +lines with the same async/sync split. + +### Blast radius if we forced them to one canonical tree +- **Flat-tree (`core.*`) consumers:** `tests/test_error_recovery.py`, + `tests/test_github_operations.py`, `tests/test_core.py`, + `tests/unit/test_github_client.py`, `tests/unit/test_audit_chain.py`, + `tests/unit/test_audit_logger_extra.py` (7 test files). +- **Package (`autonomous_agent.core.*`) consumers:** `tests/test_audit_logger.py`, + `tests/test_autonomous_agents.py`, `tests/test_github_client_comprehensive.py`, + `autonomous_agent/cli.py` (3+ test files + the CLI). +- `test_audit_chain.py` and `test_error_recovery.py` specifically exercise the + async **hash-chain / tamper-evidence** feature, which the package lacks. A blind + re-export would break them (`await` on a sync `int`-returning method, missing + `verify_chain`/`get_audit_trail`). + +So "reconcile" is not a merge — it is a 10-file refactor plus, if tamper-evidence +is to be kept, building the hash-chain feature into the ORM logger. + +## Decision: Option C — leave both trees as-is (documented debt) + +- The suite is **green**; nothing is broken. +- The migration is genuinely *unfinished*, not merely messy — the legacy flat tree + exists only because tests depend on a feature the package never received. +- Payoff of collapsing the trees (single source of truth) does not justify a + 10-file refactor + possible new feature on a healthy pipeline. + +**This corrects the earlier draft of this file**, which wrongly claimed the +package was stale/untested and recommended deleting it (Option B). Deleting the +package would break 5 integration tests and the CLI. That recommendation is +**withdrawn**. + +## Guardrails (do NOT silently change one tree and assume the other is fine) +1. Any edit to `core/audit_logger.py` or `core/github_client.py` must keep the + async hash-chain API intact (it is tested by `test_audit_chain.py` / + `test_error_recovery.py`). +2. Any edit to `autonomous_agent/core/*` must keep the sync ORM API intact + (tested by `test_audit_logger.py` / `test_github_client_comprehensive.py` / + `test_autonomous_agents.py` and used by `cli.py`). +3. The correct time to finish the migration is when audit/GitHub-client code is + being touched anyway — fold it into that work, not as a standalone risk. + +## Future migration paths (only if/when justified) +- **A — package canonical, retire hash-chain:** re-point the 7 flat-tree test files + + `core/github_client.py` to `autonomous_agent.*`, port or retire + `test_audit_chain.py`/`test_error_recovery.py`, delete the flat `core/` copies. + Lower effort; loses tamper-evidence. +- **B — package canonical, port hash-chain in:** implement SHA-256 chain + + `verify_chain()` + `get_audit_trail()` as a layer on the ORM logger, keep those + tests, then delete the flat copies. Higher effort; preserves the security feature. diff --git a/PRE_INSTALLATION_CHECKLIST.txt b/PRE_INSTALLATION_CHECKLIST.txt deleted file mode 100644 index e10d9d5..0000000 --- a/PRE_INSTALLATION_CHECKLIST.txt +++ /dev/null @@ -1,286 +0,0 @@ -✅ INSTALLATION PREPARATION CHECKLIST - -═══════════════════════════════════════════════════════════════════════════════ - -WHAT'S BEEN PREPARED FOR YOU -═══════════════════════════════════════════════════════════════════════════════ - -Installation Orchestrators (Ready to Run) - ✅ RUN_INSTALLATION.py ................... PRIMARY - Use this one! - ✅ install.py ........................... Official installer - ✅ master_install.py .................... Master script - ✅ INSTALLATION_RUNNER.py ............... Detailed runner - ✅ FINAL_INSTALL.py ..................... Comprehensive installer - -Installation Step Scripts (Required for operation) - ✅ quick_setup.py ....................... Create directories - ✅ create_core_files.py ................. Create core modules - ✅ create_agents.py ..................... Create agents - ✅ create_cli.py ........................ Create CLI - -Alternative Installation Methods (Windows) - ✅ run_install.bat ...................... Simple batch file - ✅ run_installation.bat ................. Comprehensive batch - ✅ setup_directories.bat ................ Directory setup only - ✅ finalize_setup.bat ................... Finalization - -Alternative Methods (Language-specific) - ✅ run_install.js ....................... Node.js wrapper - ✅ run_install.go ....................... Go wrapper - -Verification & Documentation - ✅ verify_installation.py ............... Post-install checker - ✅ START_INSTALLATION_HERE.txt .......... Quick start guide - ✅ INSTALLATION_INSTRUCTIONS.md ........ Detailed instructions - ✅ EXECUTION_REPORT.md ................. Status report - ✅ INSTALLATION_SETUP_COMPLETE.md ...... Setup summary - -Configuration Files - ✅ .env.example ......................... Configuration template - ✅ pyproject.toml ....................... Package configuration - ✅ requirements.txt ..................... Dependencies list - ✅ setup.py ............................ Setup script - -═══════════════════════════════════════════════════════════════════════════════ - -SYSTEM REQUIREMENTS CHECK -═══════════════════════════════════════════════════════════════════════════════ - -Required: - [ ] Python 3.11+ installed - Check: Open Command Prompt and type: python --version - - [ ] pip available - Check: Open Command Prompt and type: pip --version - - [ ] ~500 MB disk space available - - [ ] Internet connection - (For downloading dependencies during pip install) - -Optional: - [ ] Administrator access (usually not needed) - [ ] Text editor for editing .env file (notepad, VS Code, etc.) - -═══════════════════════════════════════════════════════════════════════════════ - -BEFORE YOU START INSTALLATION -═══════════════════════════════════════════════════════════════════════════════ - -Required API Tokens (you'll need these AFTER installation): - - [ ] GitHub Personal Access Token - Get from: https://github.com/settings/tokens - Need: Create a token with repo access - - [ ] LLM Provider API Key (choose one) - Option A: OpenAI API Key - Get from: https://platform.openai.com/account/api-keys - Need: API key for GPT-4 access - - Option B: Anthropic API Key - Get from: https://console.anthropic.com/account/keys - Need: API key for Claude access - - Option C: Local LLM (Ollama) - Need: Ollama installed locally - -═══════════════════════════════════════════════════════════════════════════════ - -INSTALLATION STEPS -═══════════════════════════════════════════════════════════════════════════════ - -Step 1: VERIFY ENVIRONMENT - [ ] Open Command Prompt - [ ] Run: python --version (verify it's 3.11 or higher) - [ ] Run: pip --version (verify pip is available) - -Step 2: RUN INSTALLATION - [ ] Navigate to: cd C:\Users\aw789\autonomous-github-agent - [ ] Choose one method: - Option A (Recommended): python RUN_INSTALLATION.py - Option B: python install.py - Option C: python master_install.py - Option D: Double-click run_install.bat - Option E: Manual steps in INSTALLATION_INSTRUCTIONS.md - -Step 3: WAIT FOR COMPLETION - [ ] Installation will take 1-3 minutes - [ ] Watch for success messages - [ ] Note any errors that occur - -Step 4: VERIFY SUCCESS - [ ] Check output shows all steps completed - [ ] Look for "✅ SUCCESS" messages - [ ] Check for "Installation Complete" message - -═══════════════════════════════════════════════════════════════════════════════ - -POST-INSTALLATION SETUP -═══════════════════════════════════════════════════════════════════════════════ - -Step 1: CONFIGURE .env FILE - [ ] Open: C:\Users\aw789\autonomous-github-agent\.env - (Use: notepad, VS Code, or your editor) - - [ ] Add your GitHub token: - GITHUB_TOKEN=ghp_your_token_here - - [ ] Add your LLM credentials: - If OpenAI: - OPENAI_API_KEY=sk-your_key_here - OPENAI_MODEL=gpt-4-turbo-preview - - If Anthropic: - ANTHROPIC_API_KEY=sk-ant-your_key_here - ANTHROPIC_MODEL=claude-3-opus-20240229 - - [ ] Save the file - -Step 2: VERIFY INSTALLATION - [ ] Open Command Prompt - [ ] Run: autonomous-agent --help - Expected: Shows help menu with commands - - [ ] Run: autonomous-agent list-agents - Expected: Lists all available agents - - [ ] Run: autonomous-agent config-check - Expected: Shows configuration status - -Step 3: TEST THE SYSTEM - [ ] Try: autonomous-agent health-check --repo github/cli - Expected: Shows repository health report - -═══════════════════════════════════════════════════════════════════════════════ - -DOCUMENTATION YOU'VE BEEN PROVIDED -═══════════════════════════════════════════════════════════════════════════════ - -Start with these files in order: - -1. START_INSTALLATION_HERE.txt - ► Quick start guide - ► Installation options - ► System requirements - ► Troubleshooting quick answers - -2. INSTALLATION_INSTRUCTIONS.md - ► Detailed step-by-step guide - ► All installation methods - ► Complete configuration instructions - ► Comprehensive troubleshooting - -3. EXECUTION_REPORT.md - ► Full installation process overview - ► Component descriptions - ► Verification checklist - ► Dependencies list - -4. INSTALLATION_SETUP_COMPLETE.md - ► Summary of what was prepared - ► How to execute - ► Directory structure overview - ► Post-installation steps - -5. README.md - ► Project documentation - ► Feature list - ► Usage examples - -6. INSTALL.md - ► Additional installation notes - ► Advanced configuration - -═══════════════════════════════════════════════════════════════════════════════ - -QUICK REFERENCE: COMMON COMMANDS -═══════════════════════════════════════════════════════════════════════════════ - -Check Python version: - python --version - -Run installation: - cd C:\Users\aw789\autonomous-github-agent - python RUN_INSTALLATION.py - -Check installation: - autonomous-agent --help - -List agents: - autonomous-agent list-agents - -Verify configuration: - autonomous-agent config-check - -Run health check: - autonomous-agent health-check --repo owner/repo - -Edit configuration: - notepad .env - -View logs: - type logs\agent.log - -Reinstall package: - pip install -e . --force-reinstall - -Clear pip cache: - pip cache purge - -═══════════════════════════════════════════════════════════════════════════════ - -EXPECTED FILE LOCATIONS -═══════════════════════════════════════════════════════════════════════════════ - -All files are located in: - C:\Users\aw789\autonomous-github-agent\ - -Installation scripts: - C:\Users\aw789\autonomous-github-agent\RUN_INSTALLATION.py - C:\Users\aw789\autonomous-github-agent\install.py - -Configuration file (create after install): - C:\Users\aw789\autonomous-github-agent\.env - -Documentation: - C:\Users\aw789\autonomous-github-agent\INSTALLATION_INSTRUCTIONS.md - C:\Users\aw789\autonomous-github-agent\START_INSTALLATION_HERE.txt - -Logs (after running): - C:\Users\aw789\autonomous-github-agent\logs\agent.log - -═══════════════════════════════════════════════════════════════════════════════ - -READY TO START? -═══════════════════════════════════════════════════════════════════════════════ - -If you've checked all boxes above, you're ready! - -Quick Start: - 1. Open Command Prompt - 2. cd C:\Users\aw789\autonomous-github-agent - 3. python RUN_INSTALLATION.py - 4. Wait 1-3 minutes - 5. Edit .env with your API tokens - 6. Run: autonomous-agent --help - -═══════════════════════════════════════════════════════════════════════════════ - -STILL HAVE QUESTIONS? -═══════════════════════════════════════════════════════════════════════════════ - -1. Check: START_INSTALLATION_HERE.txt (quick answers) -2. Check: INSTALLATION_INSTRUCTIONS.md (detailed guide) -3. Check: README.md (project info) -4. Check: logs/agent.log (error logs) - -═══════════════════════════════════════════════════════════════════════════════ - -All preparation is complete. You are ready to proceed with installation! - -Status: ✅ READY -Location: C:\Users\aw789\autonomous-github-agent -Action: Run python RUN_INSTALLATION.py - -═══════════════════════════════════════════════════════════════════════════════ diff --git a/SECRETS_ROTATION.md b/SECRETS_ROTATION.md new file mode 100644 index 0000000..4047df4 --- /dev/null +++ b/SECRETS_ROTATION.md @@ -0,0 +1,92 @@ +# Secrets & Token Rotation Runbook + +Single source of truth for rotating the credentials that keep the GadgetLab +autonomous agent pipeline alive. If any of these lapse, the pipeline degrades or +goes fully offline. + +Last updated: 2026-07-09 + +## Inventory + +| Secret / Token | Where it lives | Expiry | Alert mechanism | +|----------------|---------------|--------|-----------------| +| GitHub PAT (`GITHUB_PAT`) | GitHub repo secret | **2027-05-07** | `.github/workflows/pat-rotation-alert.yml` (monthly, Slack, fails ≤7d) | +| `ANTHROPIC_API_KEY` | GitHub repo secret | — (no hard expiry; rotated 2026-04-27) | none — review every ~6 months | +| `OPENAI_API_KEY` | GitHub repo secret | — (no hard expiry; rotated 2026-03-25) | none — review every ~6 months | +| DRC `x-gadgetlab-token` | **n8n only** (embedded literal in 2 nodes) | Last rotated **2026-07-06** | **none** — see below | +| `SLACK_WEBHOOK_URL` | GitHub repo secret | — | none | + +--- + +## 1. GitHub PAT — rotate before 2027-05-07 + +**Impact of lapse:** entire CI pipeline stops authenticating → no agent runs, no +overseer, no deploys. + +**Automated reminder already exists:** `pat-rotation-alert.yml` runs 09:00 UTC on +the 1st of every month, posts a Slack alert to `#drc-recommendations` once inside +the 90-day window, and *fails the workflow* (red X) when ≤7 days remain. You cannot +miss it without ignoring a failing workflow. + +**Manual rotation steps (Gadget only — requires GitHub sudo re-auth):** +1. Go to https://github.com/settings/tokens (or org token admin). +2. Create a new fine-grained or classic PAT with `repo` + `workflow` scopes + (matches what the workflows need). +3. In the repo → Settings → Secrets and variables → Actions → update `GITHUB_PAT`. +4. Update the `EXPIRY_DATE` constant in `.github/workflows/pat-rotation-alert.yml` + (line ~16) so the alert counter starts from the new date. +5. Confirm the next scheduled run reports OK. + +--- + +## 2. DRC `x-gadgetlab-token` — NO automated alert (gap to close) + +**What it is:** a static shared secret the GitHub Event Router presents in the +`x-gadgetlab-token` header when forwarding to the DRC Agent Loop. The DRC loop's +"Prepare Input" node gates ALL real traffic on it; health-check pings are +short-circuited before the gate (so `n8n-health-check.yml` needs no token). + +**Where it lives:** ONLY in n8n, embedded as literals in two nodes: +- Event Router: "Forward to Agent Loop" node (the sole legitimate sender) +- DRC Agent Loop: "Prepare Input" node (the gate) + +**Rotation steps (Gadget only — n8n sessions expire after 30–60 min of +inactivity and autosave silently fails with 401; Claude cannot re-auth):** +1. Log into https://gadgetlab.app.n8n.cloud. +2. Open the **GitHub Event Router** workflow → "Forward to Agent Loop" node → + set the new token value in the header it sends. +3. Open the **DRC Agent Loop** workflow → "Prepare Input" node → set the SAME new + value in the gate comparison. +4. **Publish both workflows.** (Saving without publishing does nothing.) +5. Verify: hit the loop webhook with the new token — should return the real + result, not `Unauthorized`. The old value must now be rejected. +6. Update "last rotated" date wherever it's tracked (CLAUDE.md + this file). + +**Recommended remediation (TODO, pending your call):** +- Add a `drc-token-rotation-alert.yml` mirroring `pat-rotation-alert.yml` with a + hardcoded `LAST_ROTATED` date and a 90/30/7-day reminder cadence → Slack. +- Better: move the token out of node literals into an n8n credential / env var so + rotation is a one-place edit and can be referenced by both nodes. This also + removes the "embedded literal in two places that must stay in sync" footgun. + +--- + +## 3. LLM API keys (Anthropic / OpenAI) + +No hard expiry, but they get rotated by the providers periodically. Current +values: ANTHROPIC (2026-04-27), OPENAI (2026-03-25). + +- If a workflow starts 401ing on LLM calls, rotate at the provider console and + update the repo secret. +- `core/llm_provider.py` abstracts both; no code change needed on rotation. + +--- + +## Pre-expiry reminder (local, optional) + +If you want a belt-and-suspenders local nudge (independent of GitHub Actions), +this one-liner prints days remaining until the PAT expires: + + echo $(( ($(date -d 2027-05-07 +%s) - $(date +%s)) / 86400 )) days until PAT expiry + +(Replace the date for the DRC token using its last-rotated + your chosen max age.) diff --git a/SIMPLE_INSTALL.bat b/SIMPLE_INSTALL.bat deleted file mode 100644 index 662f92e..0000000 --- a/SIMPLE_INSTALL.bat +++ /dev/null @@ -1,23 +0,0 @@ -REM =================================================================== -REM AUTONOMOUS GITHUB AGENT - ONE-COMMAND INSTALLATION -REM =================================================================== -REM Copy and paste this entire block into Command Prompt (cmd.exe) -REM =================================================================== - -@echo off -cd /d C:\Users\aw789\autonomous-github-agent -echo. -echo ======================================== -echo Installing Autonomous GitHub Agent -echo ======================================== -echo. -echo Running install.py... -python install.py -echo. -echo ======================================== -echo Installation Complete! -echo ======================================== -echo. -echo IMPORTANT: Edit .env file and add your API tokens -echo. -pause diff --git a/SIMPLE_TEST_STEPS.txt b/SIMPLE_TEST_STEPS.txt deleted file mode 100644 index 8578f8e..0000000 --- a/SIMPLE_TEST_STEPS.txt +++ /dev/null @@ -1,125 +0,0 @@ -================================================================================ - SIMPLE STEP-BY-STEP TESTING -================================================================================ - -Let's figure out what's happening. Follow these steps EXACTLY: - -================================================================================ -STEP 1: Open Command Prompt -================================================================================ - -Press: Windows Key + R -Type: cmd -Press: Enter - -You should see a black window that says: C:\Users\aw789> - -================================================================================ -STEP 2: Navigate to the Project Folder -================================================================================ - -In the black window, type EXACTLY this (then press Enter): - -cd C:\Users\aw789\autonomous-github-agent - -You should now see: C:\Users\aw789\autonomous-github-agent> - -================================================================================ -STEP 3: Try the Config Check -================================================================================ - -Type this (then press Enter): - -autonomous-agent config-check - -WHAT SHOULD HAPPEN: -You should see a table showing: - ✓ GitHub Token: Set - ✓ LLM Provider: openai - ✓ LLM API Key: Set - -WHAT MIGHT HAPPEN INSTEAD: - -Scenario A: "autonomous-agent is not recognized..." - → Solution: Type: pip install -e . - → Wait for it to finish - → Try autonomous-agent config-check again - -Scenario B: Shows "GitHub Token: ✗ Missing" or "LLM API Key: ✗ Missing" - → Solution: Your tokens aren't configured correctly - → Type: notepad .env - → Check your tokens are pasted correctly (no quotes, no spaces) - → Save and try again - -Scenario C: It works! Shows ✓ for everything - → Great! Continue to Step 4 - -================================================================================ -STEP 4: List the Agents -================================================================================ - -Type this (then press Enter): - -autonomous-agent list-agents - -WHAT SHOULD HAPPEN: -You should see a nice table with 7 agents: - - health_monitor - - code_reviewer - - issue_manager - - branch_manager - - security_scanner - - workflow_optimizer - - documentation_generator - -================================================================================ -STEP 5: Run a Test Command -================================================================================ - -Type this (then press Enter): - -autonomous-agent health-check --repo octocat/Hello-World - -WHAT SHOULD HAPPEN: - - It says "Running health check on octocat/Hello-World..." - - Shows some output about the repository - - Says "Health check complete!" - -This tests your GitHub token and the agent functionality. - -WHAT MIGHT HAPPEN: - - "401 Unauthorized" → GitHub token is wrong - - "Rate limit" → Token is fine but you hit API limits (wait an hour) - - Python errors → Something went wrong with installation - -================================================================================ -STEP 6: Check the Logs -================================================================================ - -Type this (then press Enter): - -autonomous-agent logs --limit 5 - -WHAT SHOULD HAPPEN: -Shows a table of recent actions the agents have taken. - -================================================================================ - -IF NOTHING WORKS - RUN THE DIAGNOSTIC: - -Just double-click this file: - DIAGNOSE.bat - -It will check everything step-by-step and tell you exactly what's wrong. - -================================================================================ -TELL ME WHAT HAPPENED: - -After trying these steps, tell me: -1. Which step did you get to? -2. What error did you see (if any)? -3. What was the exact error message? - -Then I can help you fix it! - -================================================================================ diff --git a/START_INSTALLATION.txt b/START_INSTALLATION.txt deleted file mode 100644 index 84e5c25..0000000 --- a/START_INSTALLATION.txt +++ /dev/null @@ -1,73 +0,0 @@ -================================================================================ - AUTONOMOUS GITHUB AGENT - READY TO INSTALL -================================================================================ - -EVERYTHING IS PREPARED AND READY! - --------------------------------------------------------------------------------- -TO INSTALL (Choose ONE method): --------------------------------------------------------------------------------- - -METHOD 1 (Easiest): Double-click this file in Windows Explorer - 📁 INSTALL_NOW.bat - -METHOD 2: Open Command Prompt and run: - cd C:\Users\aw789\autonomous-github-agent - INSTALL_NOW.bat - -METHOD 3: Use Python directly: - cd C:\Users\aw789\autonomous-github-agent - python install.py - --------------------------------------------------------------------------------- -INSTALLATION TIME: 2-3 minutes --------------------------------------------------------------------------------- - -The script will: - ✓ Create all directories - ✓ Generate 30+ Python files - ✓ Install all dependencies - ✓ Set up the 7 AI agents - ✓ Create CLI interface - ✓ Verify installation - --------------------------------------------------------------------------------- -AFTER INSTALLATION (REQUIRED): --------------------------------------------------------------------------------- - -1. Edit the .env file (2 minutes): - - Add GITHUB_TOKEN=ghp_your_token - - Add OPENAI_API_KEY=sk_your_key - -2. Verify it works (30 seconds): - autonomous-agent config-check - autonomous-agent list-agents - -3. Test on a repository: - autonomous-agent health-check --repo octocat/Hello-World - --------------------------------------------------------------------------------- -WHAT YOU'LL HAVE: --------------------------------------------------------------------------------- - -✓ 7 Specialized AI Agents ready to use -✓ Complete repository automation system -✓ CLI interface with 10+ commands -✓ Full audit logging and rollback -✓ GitHub Actions integration -✓ Production-ready framework - --------------------------------------------------------------------------------- -HELP & DOCUMENTATION: --------------------------------------------------------------------------------- - -📖 Quick Start: README_INSTALL.md -📖 Full Guide: START_HERE.md -📖 Commands: QUICKSTART.md -📖 Details: INSTALL.md - --------------------------------------------------------------------------------- - -🚀 READY TO INSTALL - DOUBLE-CLICK: INSTALL_NOW.bat - -================================================================================ diff --git a/START_INSTALLATION_HERE.txt b/START_INSTALLATION_HERE.txt deleted file mode 100644 index 917ad9d..0000000 --- a/START_INSTALLATION_HERE.txt +++ /dev/null @@ -1,203 +0,0 @@ -╔══════════════════════════════════════════════════════════════════════════════╗ -║ AUTONOMOUS GITHUB AGENT - INSTALLATION START HERE ║ -╚══════════════════════════════════════════════════════════════════════════════╝ - -Location: C:\Users\aw789\autonomous-github-agent - -QUICK START - Choose ONE of these options: - -═══════════════════════════════════════════════════════════════════════════════ -OPTION 1: Recommended (Easiest) -═══════════════════════════════════════════════════════════════════════════════ - -Open Command Prompt and run: - cd C:\Users\aw789\autonomous-github-agent - python RUN_INSTALLATION.py - -This script will: - 1. Create all directories - 2. Generate core modules - 3. Create all agents - 4. Create CLI interface - 5. Install with pip - 6. Verify everything - -Expected time: 1-3 minutes - -═══════════════════════════════════════════════════════════════════════════════ -OPTION 2: Using Official Installer -═══════════════════════════════════════════════════════════════════════════════ - -Open Command Prompt and run: - cd C:\Users\aw789\autonomous-github-agent - python install.py - -═══════════════════════════════════════════════════════════════════════════════ -OPTION 3: Step-by-Step Manual -═══════════════════════════════════════════════════════════════════════════════ - -Open Command Prompt and run these commands in order: - cd C:\Users\aw789\autonomous-github-agent - python quick_setup.py - python create_core_files.py - python create_agents.py - python create_cli.py - pip install -e . - copy .env.example .env - python verify_installation.py - -═══════════════════════════════════════════════════════════════════════════════ -OPTION 4: Double-Click Batch File -═══════════════════════════════════════════════════════════════════════════════ - -Simply double-click this file in File Explorer: - C:\Users\aw789\autonomous-github-agent\run_install.bat - -═══════════════════════════════════════════════════════════════════════════════ - -SYSTEM REQUIREMENTS -═══════════════════════════════════════════════════════════════════════════════ - -✓ Python 3.11 or higher -✓ pip (comes with Python) -✓ ~500 MB disk space -✓ Internet connection (for pip install) -✓ Administrator access (usually not needed) - -Check Python version: - python --version - -═══════════════════════════════════════════════════════════════════════════════ - -AFTER INSTALLATION (3 IMPORTANT STEPS) -═══════════════════════════════════════════════════════════════════════════════ - -1. CONFIGURE .env FILE - ━━━━━━━━━━━━━━━━━━━━ - Open the .env file and add your API tokens: - - GITHUB_TOKEN=your_github_token_here - OPENAI_API_KEY=your_openai_key_here - - Open file with: - notepad C:\Users\aw789\autonomous-github-agent\.env - -2. VERIFY INSTALLATION - ━━━━━━━━━━━━━━━━━━━━ - Run these commands: - - autonomous-agent --help - autonomous-agent list-agents - -3. TRY IT OUT - ━━━━━━━━━━━━ - Test the system: - - autonomous-agent health-check --repo owner/repo - -═══════════════════════════════════════════════════════════════════════════════ - -DOCUMENTATION -═══════════════════════════════════════════════════════════════════════════════ - -Read these files for more information: - - 📄 INSTALLATION_INSTRUCTIONS.md - Detailed step-by-step installation guide - Complete configuration instructions - Troubleshooting section - - 📄 EXECUTION_REPORT.md - Comprehensive status report - File structure overview - Requirements and dependencies - - 📄 README.md - General information about the project - Usage examples - Feature list - - 📄 INSTALL.md - Additional installation notes - -═══════════════════════════════════════════════════════════════════════════════ - -WHAT GETS INSTALLED -═══════════════════════════════════════════════════════════════════════════════ - -Directories Created: - • autonomous_agent/ Main package - - core/ Core system modules - - agents/ Specialized agents - - cli/ Command-line interface - - utils/ Utilities - • tests/ Test suite - • config/ Configuration files - • workflows/ GitHub Actions workflows - • docs/ Documentation - • logs/ Application logs - -Agents Created: - ✓ Health Monitor Repository health checks - ✓ Security Scanner Vulnerability detection - ✓ Issue Analyzer Issue analysis - ✓ PR Reviewer Pull request review - ✓ Code Quality Code quality checks - ✓ Documentation Doc generation - ✓ Test Generator Test creation - ✓ Dependency Manager Dependency management - ✓ Release Manager Release management - -Core Modules: - ✓ Configuration Settings management - ✓ GitHub Client GitHub API integration - ✓ Orchestrator Main system controller - ✓ Database Data persistence - ✓ LLM Provider AI model integration - ✓ Audit Logger Action logging - ✓ CLI Interface Command-line interface - -═══════════════════════════════════════════════════════════════════════════════ - -TROUBLESHOOTING -═══════════════════════════════════════════════════════════════════════════════ - -Problem: "python: command not found" - → Ensure Python 3.11+ is installed and in PATH - → Or use full path: C:\Python311\python.exe RUN_INSTALLATION.py - -Problem: "pip install fails" - → Try: python -m pip install -e . - → Or: pip install --user -e . - -Problem: "ModuleNotFoundError: No module named 'autonomous_agent'" - → Run: pip install -e . --force-reinstall - → Check: pip show autonomous-github-agent - -Problem: Import errors - → Clear pip cache: pip cache purge - → Reinstall: pip install -e . --force-reinstall --no-cache-dir - -Problem: Permission denied - → Run Command Prompt as Administrator - → Or use: pip install --user -e . - -═══════════════════════════════════════════════════════════════════════════════ - -READY TO INSTALL? -═══════════════════════════════════════════════════════════════════════════════ - -Choose your preferred installation method above and run it now! - -Recommended: Option 1 (Easiest & Fastest) - cd C:\Users\aw789\autonomous-github-agent && python RUN_INSTALLATION.py - -═══════════════════════════════════════════════════════════════════════════════ - -Questions? Check the documentation files listed above. -Support: See README.md and INSTALLATION_INSTRUCTIONS.md - -═══════════════════════════════════════════════════════════════════════════════ -Last Updated: 2024 -Installation Status: ✅ READY -═══════════════════════════════════════════════════════════════════════════════ diff --git a/TEST_INSTALLATION.bat b/TEST_INSTALLATION.bat deleted file mode 100644 index 93d907b..0000000 --- a/TEST_INSTALLATION.bat +++ /dev/null @@ -1,90 +0,0 @@ -@echo off -echo. -echo ======================================================================== -echo TESTING YOUR AUTONOMOUS GITHUB AGENT -echo ======================================================================== -echo. - -cd /d "%~dp0" - -echo [TEST 1/5] Checking configuration... -echo. -autonomous-agent config-check -echo. - -if errorlevel 1 ( - echo. - echo ❌ Configuration check FAILED! - echo. - echo This usually means: - echo - Tokens are not set correctly in .env file - echo - There are extra spaces or quotes - echo - The .env file wasn't saved - echo. - echo Please run: CONFIGURE_WIZARD.bat - echo. - pause - exit /b 1 -) - -echo ✅ Configuration OK! -echo. -pause - -echo. -echo [TEST 2/5] Listing available agents... -echo. -autonomous-agent list-agents -echo. -pause - -echo. -echo [TEST 3/5] Running health check on test repository... -echo This will analyze GitHub's "Hello-World" demo repository. -echo. -autonomous-agent health-check --repo octocat/Hello-World -echo. - -if errorlevel 1 ( - echo. - echo ❌ Health check failed! - echo Check the error message above. - echo. - pause - exit /b 1 -) - -echo. -echo ✅ Health check completed! -echo. -pause - -echo. -echo [TEST 4/5] Running security scan on test repository... -echo. -autonomous-agent analyze --repo octocat/Hello-World --agent security -echo. -pause - -echo. -echo [TEST 5/5] Viewing audit logs... -echo. -autonomous-agent logs --limit 5 -echo. - -echo. -echo ======================================================================== -echo ✅ ALL TESTS PASSED! -echo ======================================================================== -echo. -echo Your Autonomous GitHub Agent is fully operational! -echo. -echo You can now use it on your own repositories: -echo. -echo autonomous-agent analyze --repo YOUR_USERNAME/YOUR_REPO -echo autonomous-agent review --repo YOUR_USERNAME/YOUR_REPO -echo autonomous-agent --help -echo. -echo See NEXT_STEPS.md for more usage examples. -echo. -pause diff --git a/action.yml b/action.yml index 7328af0..8773390 100644 --- a/action.yml +++ b/action.yml @@ -24,9 +24,9 @@ inputs: required: false default: 'true' local_llm_endpoint: - description: 'Local LLM endpoint URL' + description: 'Local LLM endpoint URL (must match LOCAL_LLM_URL env default in .github/scripts/llm_router.py)' required: false - default: 'http://localhost:11434' + default: 'http://localhost:1234/v1' complexity_threshold: description: 'Complexity threshold for LLM routing (low/medium/high)' required: false diff --git a/agents/code_review_agent.py b/agents/code_review_agent.py deleted file mode 100644 index 3074430..0000000 --- a/agents/code_review_agent.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python3 -"""Code Review Agent — reviews pull requests via LLM and posts findings.""" - -import argparse -import asyncio -import logging -import os -import sys -from pathlib import Path -from typing import Any - -project_root = Path(__file__).parent.parent -sys.path.insert(0, str(project_root)) - -from core.agent_base import BaseAgent # noqa: E402 - -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - -SYSTEM_PROMPT = ( - "You are an expert code reviewer. Analyze the diff and provide concise, " - "actionable feedback covering: correctness, security, performance, style, " - "and test coverage. Format your response as markdown." -) - - -class CodeReviewAgent(BaseAgent): - """Reviews pull requests using an LLM and posts the review as a PR comment.""" - - def __init__(self, config: dict[str, Any]): - super().__init__("code_review_agent", config) - - def get_supported_actions(self) -> list: - return ["review_pr"] - - async def _execute(self, task: dict[str, Any]) -> dict[str, Any]: - action = task.get("action") - if action == "review_pr": - return await self._review_pr(task.get("params", {})) - raise ValueError(f"Unsupported action: {action}") - - async def _review_pr(self, params: dict[str, Any]) -> dict[str, Any]: - """Fetch a PR diff, send it to the LLM, and post the review.""" - repo_name = params["repo"] - pr_number = int(params["pr_number"]) - - repo = self.github.client.get_repo(repo_name) - pr = repo.get_pull(pr_number) - - # Collect diff from files - diff_parts = [] - for f in pr.get_files(): - patch = f.patch or "" - diff_parts.append(f"### {f.filename}\n{patch}") - raw_diff = "\n\n".join(diff_parts) - diff = raw_diff[:8000] - - prompt = ( - f"Pull Request #{pr_number}: {pr.title}\n\n" - f"Description:\n{pr.body or '(none)'}\n\n" - f"Diff:\n```diff\n{diff}\n```" - ) - - llm_response = await self.llm.generate( - prompt=prompt, - system_prompt=SYSTEM_PROMPT, - max_tokens=1500, - temperature=0.3, - ) - - review_body = llm_response["content"] - pr.create_review(body=review_body, event="COMMENT") - - logger.info("Posted review on %s#%d", repo_name, pr_number) - return { - "repo": repo_name, - "pr_number": pr_number, - "review_length": len(review_body), - "tokens_used": llm_response.get("usage", {}).get("total_tokens", 0), - } - - -def main(): - parser = argparse.ArgumentParser(description="Review a pull request via LLM.") - parser.add_argument("--repo", required=True, help="owner/repo") - parser.add_argument("--pr", required=True, type=int, help="Pull request number") - args = parser.parse_args() - - config = { - "github_token": os.getenv("GITHUB_TOKEN"), - "anthropic_api_key": os.getenv("ANTHROPIC_API_KEY"), - "llm_provider": "anthropic", - } - agent = CodeReviewAgent(config) - task = { - "action": "review_pr", - "params": {"repo": args.repo, "pr_number": args.pr}, - } - result = asyncio.run(agent.execute(task)) - print(result) - - -if __name__ == "__main__": - main() diff --git a/agents/dependency_agent.py b/agents/dependency_agent.py deleted file mode 100644 index 815871b..0000000 --- a/agents/dependency_agent.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python3 -"""Dependency Agent — audits vulnerabilities and unpinned packages, reports to GitHub.""" - -import argparse -import asyncio -import json -import logging -import os -import subprocess -import sys -from pathlib import Path -from typing import Any - -project_root = Path(__file__).parent.parent -sys.path.insert(0, str(project_root)) - -from core.agent_base import BaseAgent # noqa: E402 - -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - - -class DependencyAgent(BaseAgent): - """Checks dependencies for vulnerabilities and loose pins.""" - - def __init__(self, config: dict[str, Any]): - super().__init__("dependency_agent", config) - - def get_supported_actions(self) -> list: - return ["check_dependencies"] - - async def _execute(self, task: dict[str, Any]) -> dict[str, Any]: - action = task.get("action") - if action == "check_dependencies": - return await self._check_dependencies(task.get("params", {})) - raise ValueError(f"Unsupported action: {action}") - - def _run_pip_audit(self) -> list[dict[str, Any]]: - """Run pip-audit and return results list.""" - result = subprocess.run( - ["pip-audit", "--format", "json"], - capture_output=True, - text=True, - ) - try: - data = json.loads(result.stdout) - return data if isinstance(data, list) else data.get("dependencies", []) - except (json.JSONDecodeError, AttributeError): - return [] - - def _check_unpinned(self, req_path: Path) -> list[str]: - """Return package lines without an upper bound pin.""" - unpinned: list[str] = [] - if not req_path.exists(): - return unpinned - for line in req_path.read_text().splitlines(): - line = line.strip() - if not line or line.startswith("#"): - continue - # Has no upper bound if missing <= or ~= or == with no upper range - if ">=" in line and "<" not in line and "~=" not in line: - unpinned.append(line) - elif ( - "==" not in line - and ">=" not in line - and "~=" not in line - and "<" not in line - ): - unpinned.append(line) - return unpinned - - def _build_report( - self, audit_data: list[dict[str, Any]], unpinned: list[str] - ) -> str: - """Format a markdown dependency report.""" - lines = ["## Dependency Audit Report\n"] - - vuln_pkgs = [d for d in audit_data if d.get("vulns")] - lines.append(f"### Vulnerabilities — {len(vuln_pkgs)} package(s) affected\n") - lines.append("| Package | Version | ID | Severity | Fix |") - lines.append("|---------|---------|-----|----------|-----|") - for dep in vuln_pkgs: - pkg = dep.get("name", "?") - ver = dep.get("version", "?") - for v in dep.get("vulns", []): - vid = v.get("id", "?") - aliases = v.get("aliases") or [vid] - sev = aliases[0] - fix = ", ".join(v.get("fix_versions", [])) or "none" - lines.append(f"| {pkg} | {ver} | {vid} | {sev} | {fix} |") - - lines.append(f"\n### Unpinned packages — {len(unpinned)} found\n") - for pkg in unpinned: - lines.append(f"- `{pkg}`") - - return "\n".join(lines) - - async def _check_dependencies(self, params: dict[str, Any]) -> dict[str, Any]: - """Run audit, build report, post or update GitHub issue.""" - repo_name = params["repo"] - req_path = project_root / "requirements.txt" - - audit_data = self._run_pip_audit() - unpinned = self._check_unpinned(req_path) - report = self._build_report(audit_data, unpinned) - - repo = self.github.client.get_repo(repo_name) - - # Look for existing open dependency issue to update - existing = None - for issue in repo.get_issues(state="open", labels=["dependencies"]): - existing = issue - break - - if existing: - existing.create_comment(report) - logger.info("Updated dependency issue #%d", existing.number) - return {"repo": repo_name, "updated_issue": existing.number} - else: - issue = repo.create_issue( - title="Dependency Audit Report", - body=report, - labels=["dependencies"], - ) - logger.info("Created dependency issue #%d", issue.number) - return {"repo": repo_name, "created_issue": issue.number} - - -def main(): - parser = argparse.ArgumentParser( - description="Audit dependencies and report to GitHub." - ) - parser.add_argument("--repo", required=True, help="owner/repo") - args = parser.parse_args() - - config = { - "github_token": os.getenv("GITHUB_TOKEN"), - "anthropic_api_key": os.getenv("ANTHROPIC_API_KEY"), - } - agent = DependencyAgent(config) - task = { - "action": "check_dependencies", - "params": {"repo": args.repo}, - } - result = asyncio.run(agent.execute(task)) - print(result) - - -if __name__ == "__main__": - main() diff --git a/agents/security_scan_agent.py b/agents/security_scan_agent.py deleted file mode 100644 index 739ea76..0000000 --- a/agents/security_scan_agent.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python3 -"""Security Scan Agent — runs bandit + pip-audit and reports to GitHub.""" - -import argparse -import asyncio -import json -import logging -import os -import subprocess -import sys -from pathlib import Path -from typing import Any - -project_root = Path(__file__).parent.parent -sys.path.insert(0, str(project_root)) - -from core.agent_base import BaseAgent # noqa: E402 - -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - - -class SecurityScanAgent(BaseAgent): - """Runs bandit and pip-audit then posts results to GitHub.""" - - def __init__(self, config: dict[str, Any]): - super().__init__("security_scan_agent", config) - - def get_supported_actions(self) -> list: - return ["scan_repo"] - - async def _execute(self, task: dict[str, Any]) -> dict[str, Any]: - action = task.get("action") - if action == "scan_repo": - return await self._scan_repo(task.get("params", {})) - raise ValueError(f"Unsupported action: {action}") - - def _run_bandit(self) -> dict[str, Any]: - """Run bandit and return parsed JSON results.""" - subprocess.run( - ["bandit", "-r", ".", "-f", "json", "-o", "/tmp/bandit.json"], - capture_output=True, - ) - try: - with open("/tmp/bandit.json", encoding="utf-8") as f: - return json.load(f) - except (FileNotFoundError, json.JSONDecodeError): - return {} - - def _run_pip_audit(self) -> list[dict[str, Any]]: - """Run pip-audit and return parsed JSON results.""" - subprocess.run( - ["pip-audit", "--format", "json", "--output", "/tmp/pip-audit.json"], - capture_output=True, - ) - try: - with open("/tmp/pip-audit.json", encoding="utf-8") as f: - data = json.load(f) - return data if isinstance(data, list) else data.get("dependencies", []) - except (FileNotFoundError, json.JSONDecodeError): - return [] - - def _format_summary( - self, bandit_data: dict[str, Any], pip_data: list[dict[str, Any]] - ) -> str: - """Build a markdown security summary.""" - lines = ["## Security Scan Report\n"] - - # Bandit section - results = bandit_data.get("results", []) - metrics = bandit_data.get("metrics", {}) - total_issues = ( - sum( - v.get("SEVERITY.HIGH", 0) - + v.get("SEVERITY.MEDIUM", 0) - + v.get("SEVERITY.LOW", 0) - for v in metrics.values() - ) - if metrics - else len(results) - ) - lines.append(f"### Bandit — {total_issues} issue(s) found\n") - for item in results[:20]: - sev = item.get("issue_severity", "?") - conf = item.get("issue_confidence", "?") - text = item.get("issue_text", "") - fname = item.get("filename", "") - lineno = item.get("line_number", "") - lines.append(f"- **[{sev}/{conf}]** `{fname}:{lineno}` — {text}") - - # pip-audit section - vuln_pkgs = [d for d in pip_data if d.get("vulns")] - lines.append(f"\n### pip-audit — {len(vuln_pkgs)} vulnerable package(s)\n") - for dep in vuln_pkgs: - pkg = dep.get("name", "?") - ver = dep.get("version", "?") - for v in dep.get("vulns", []): - vid = v.get("id", "?") - fix = ", ".join(v.get("fix_versions", [])) or "none" - lines.append(f"- **{pkg}=={ver}** {vid} (fix: {fix})") - - return "\n".join(lines) - - async def _scan_repo(self, params: dict[str, Any]) -> dict[str, Any]: - """Run scanners and post results to GitHub.""" - repo_name = params["repo"] - issue_number = int(params.get("issue_number", 0)) - - bandit_data = self._run_bandit() - pip_data = self._run_pip_audit() - summary = self._format_summary(bandit_data, pip_data) - - repo = self.github.client.get_repo(repo_name) - - if issue_number > 0: - issue = repo.get_issue(issue_number) - issue.create_comment(summary) - logger.info("Posted security scan to issue #%d", issue_number) - return {"repo": repo_name, "posted_to_issue": issue_number} - else: - issue = repo.create_issue( - title="Security Scan Results", - body=summary, - labels=["security"], - ) - logger.info("Created security issue #%d", issue.number) - return {"repo": repo_name, "created_issue": issue.number} - - -def main(): - parser = argparse.ArgumentParser( - description="Run security scans and report to GitHub." - ) - parser.add_argument("--repo", required=True, help="owner/repo") - parser.add_argument( - "--issue", - type=int, - default=0, - help="Issue number to comment on (0 = create new issue)", - ) - args = parser.parse_args() - - config = { - "github_token": os.getenv("GITHUB_TOKEN"), - "anthropic_api_key": os.getenv("ANTHROPIC_API_KEY"), - } - agent = SecurityScanAgent(config) - task = { - "action": "scan_repo", - "params": {"repo": args.repo, "issue_number": args.issue}, - } - result = asyncio.run(agent.execute(task)) - print(result) - - -if __name__ == "__main__": - main() diff --git a/agents/triage_agent.py b/agents/triage_agent.py deleted file mode 100644 index 8e7e564..0000000 --- a/agents/triage_agent.py +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/env python3 -"""Triage Agent — classifies GitHub issues via LLM and reports LLM costs to Slack.""" - -import argparse -import asyncio -import json -import logging -import os -import sys -import urllib.request -from datetime import datetime, timedelta -from pathlib import Path -from typing import Any - -project_root = Path(__file__).parent.parent -sys.path.insert(0, str(project_root)) - -from core.agent_base import BaseAgent # noqa: E402 - -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - -TRIAGE_SYSTEM = ( - "You are an issue triage assistant. Given an issue title and body, " - 'respond with a JSON object: {"type": "bug|feature|debt|security|ci", ' - '"priority": "P0|P1|P2", "reason": "one sentence"}. ' - "P0=critical/urgent, P1=important, P2=nice-to-have." -) - -PRIORITY_KEYWORDS = { - "P0": ["critical", "crash", "data loss", "security", "outage", "urgent", "blocker"], - "P1": ["important", "regression", "broken", "failing", "high priority"], -} - - -class TriageAgent(BaseAgent): - """Classifies issues via LLM and sends cost reports to Slack.""" - - def __init__(self, config: dict[str, Any]): - super().__init__("triage_agent", config) - - def get_supported_actions(self) -> list: - return ["triage_issue", "cost_report"] - - async def _execute(self, task: dict[str, Any]) -> dict[str, Any]: - action = task.get("action") - if action == "triage_issue": - return await self._triage_issue(task.get("params", {})) - if action == "cost_report": - return await self._cost_report(task.get("params", {})) - raise ValueError(f"Unsupported action: {action}") - - def _keyword_priority(self, text: str) -> str | None: - """Override LLM priority based on keyword matching.""" - lower = text.lower() - for priority, keywords in PRIORITY_KEYWORDS.items(): - if any(kw in lower for kw in keywords): - return priority - return None - - async def _triage_issue(self, params: dict[str, Any]) -> dict[str, Any]: - """Classify an issue and apply GitHub labels.""" - repo_name = params["repo"] - issue_number = int(params["issue_number"]) - - repo = self.github.client.get_repo(repo_name) - issue = repo.get_issue(issue_number) - - prompt = f"Title: {issue.title}\n\nBody:\n{issue.body or '(no body)'}" - llm_response = await self.llm.generate( - prompt=prompt, - system_prompt=TRIAGE_SYSTEM, - max_tokens=200, - temperature=0.1, - ) - - # Parse LLM JSON — fall back gracefully - try: - classification = json.loads(llm_response["content"]) - except (json.JSONDecodeError, KeyError): - classification = { - "type": "feature", - "priority": "P2", - "reason": "parse error", - } - - issue_type = classification.get("type", "feature") - priority = classification.get("priority", "P2") - - # Keyword override for priority - kw_priority = self._keyword_priority(f"{issue.title} {issue.body or ''}") - if kw_priority: - priority = kw_priority - - # Ensure labels exist and apply them - existing_labels = {lbl.name for lbl in repo.get_labels()} - for label_name in (issue_type, priority): - if label_name not in existing_labels: - repo.create_label(label_name, "ededed") - issue.add_to_labels(issue_type, priority) - - logger.info("Triaged issue #%d as %s/%s", issue_number, issue_type, priority) - return { - "issue": issue_number, - "type": issue_type, - "priority": priority, - "reason": classification.get("reason", ""), - } - - def _load_costs(self, days: int = 30) -> list[dict[str, Any]]: - """Read .llm_costs.jsonl and return records from the last *days* days.""" - costs_path = project_root / ".llm_costs.jsonl" - cutoff = datetime.now() - timedelta(days=days) - records: list[dict] = [] - if not costs_path.exists(): - return records - for line in costs_path.read_text().splitlines(): - line = line.strip() - if not line: - continue - try: - rec = json.loads(line) - ts = datetime.fromisoformat(rec["timestamp"]) - if ts >= cutoff: - records.append(rec) - except (json.JSONDecodeError, KeyError, ValueError): - continue - return records - - async def _cost_report(self, params: dict[str, Any]) -> dict[str, Any]: - """Aggregate LLM costs for the last 30 days and post to Slack.""" - records = self._load_costs(30) - - total_cost = sum(r.get("cost_usd", 0) for r in records) - total_input = sum(r.get("input_tokens", 0) for r in records) - total_output = sum(r.get("output_tokens", 0) for r in records) - - by_model: dict[str, float] = {} - for r in records: - model = r.get("model", "unknown") - by_model[model] = by_model.get(model, 0) + r.get("cost_usd", 0) - - model_lines = "\n".join( - f" • {m}: ${c:.4f}" - for m, c in sorted(by_model.items(), key=lambda x: -x[1]) - ) - - message = ( - f"*LLM Cost Report — last 30 days*\n" - f"Total: *${total_cost:.4f}*\n" - f"Tokens in/out: {total_input:,} / {total_output:,}\n" - f"By model:\n{model_lines or ' (no data)'}\n" - f"Records: {len(records)}" - ) - - slack_url = os.getenv("SLACK_WEBHOOK_URL", "") - if slack_url: - payload = json.dumps({"text": message}).encode() - req = urllib.request.Request( - slack_url, - data=payload, - headers={"Content-Type": "application/json"}, - method="POST", - ) - with urllib.request.urlopen(req, timeout=10) as resp: - status = resp.status - logger.info("Posted cost report to Slack (HTTP %d)", status) - else: - logger.warning("SLACK_WEBHOOK_URL not set — printing report instead") - print(message) - status = 0 - return { - "total_cost_usd": round(total_cost, 4), - "records": len(records), - "slack_status": status, - } - - -def main(): - parser = argparse.ArgumentParser(description="Triage issues or report LLM costs.") - parser.add_argument("--repo", required=True, help="owner/repo") - parser.add_argument( - "--issue", type=int, default=0, help="Issue number (triage_issue)" - ) - parser.add_argument( - "--action", - choices=["triage_issue", "cost_report"], - default="triage_issue", - help="Action to perform", - ) - args = parser.parse_args() - - config = { - "github_token": os.getenv("GITHUB_TOKEN"), - "anthropic_api_key": os.getenv("ANTHROPIC_API_KEY"), - "llm_provider": "anthropic", - } - agent = TriageAgent(config) - params: dict[str, Any] = {"repo": args.repo} - if args.action == "triage_issue": - params["issue_number"] = args.issue - task = {"action": args.action, "params": params} - result = asyncio.run(agent.execute(task)) - print(result) - - -if __name__ == "__main__": - main() diff --git a/autopilot/config.yaml b/autopilot/config.yaml index ddaeea0..8129be3 100644 --- a/autopilot/config.yaml +++ b/autopilot/config.yaml @@ -24,21 +24,9 @@ repos: priority: medium notes: "Workflow templates" - # Low Priority (Paused per consolidation strategy) - - owner: labgadget015-dotcom - name: AI-crypto-trading-bot - priority: low - notes: "Paused - focus on core product first" - - - owner: labgadget015-dotcom - name: ai-ops-desk - priority: low - notes: "Paused - focus on core product first" - - - owner: labgadget015-dotcom - name: ViralVideo - priority: low - notes: "Paused - focus on core product first" +# NOTE: AI-crypto-trading-bot, ai-ops-desk, ViralVideo are intentionally +# omitted — marked "Paused" in the consolidation strategy. Scanning them wastes +# GitHub API quota (rate_limit_buffer: 100) and adds noise to the daily summary. # Output configuration output: diff --git a/autopilot/decisions/ledger.py b/autopilot/decisions/ledger.py index d5d378c..2c48ac6 100644 --- a/autopilot/decisions/ledger.py +++ b/autopilot/decisions/ledger.py @@ -15,16 +15,14 @@ import json import os import time -from dataclasses import asdict -from datetime import datetime, timezone -from typing import Optional +from datetime import UTC, datetime from recommendation_contract import Recommendation def _today_iso() -> str: """Current UTC date as YYYY-MM-DD (for the first_raised ledger field).""" - return datetime.now(timezone.utc).strftime("%Y-%m-%d") + return datetime.now(UTC).strftime("%Y-%m-%d") DEFAULT_LEDGER_PATH = os.environ.get( @@ -45,7 +43,7 @@ def _load(path: str = DEFAULT_LEDGER_PATH) -> list[dict]: if not os.path.exists(path): return [] out = [] - with open(path, "r", encoding="utf-8") as f: + with open(path, encoding="utf-8") as f: for line in f: line = line.strip() if line: @@ -68,7 +66,7 @@ def _append(entry: dict, path: str = DEFAULT_LEDGER_PATH) -> None: f.write(json.dumps(entry, ensure_ascii=False) + "\n") -def latest_match(sig: str, path: str = DEFAULT_LEDGER_PATH) -> Optional[dict]: +def latest_match(sig: str, path: str = DEFAULT_LEDGER_PATH) -> dict | None: """Return the most recent ledger entry with this signature, or None. Ordering key = (max ts, seq) so the latest-written entry wins even when @@ -143,8 +141,8 @@ def record(r: Recommendation, path: str = DEFAULT_LEDGER_PATH) -> dict: def transition( sig: str, new_status: str, - owner: Optional[str] = None, - due: Optional[str] = None, + owner: str | None = None, + due: str | None = None, path: str = DEFAULT_LEDGER_PATH, ) -> dict: """Append a status transition for an existing work item. diff --git a/autopilot/message_formatter.py b/autopilot/message_formatter.py index 7d22557..29c7e10 100644 --- a/autopilot/message_formatter.py +++ b/autopilot/message_formatter.py @@ -15,7 +15,7 @@ from __future__ import annotations -from recommendation_contract import Recommendation, SEVERITY_EMOJI, validate +from recommendation_contract import SEVERITY_EMOJI, Recommendation, validate STATUS_TAG = { "open": "🟡 Open", diff --git a/autopilot/recommendation_contract.py b/autopilot/recommendation_contract.py index fb83f3d..3616725 100644 --- a/autopilot/recommendation_contract.py +++ b/autopilot/recommendation_contract.py @@ -13,8 +13,8 @@ from __future__ import annotations -from dataclasses import dataclass, field -from typing import Literal, Optional +from dataclasses import dataclass +from typing import Literal Severity = Literal["P0", "P1", "P2"] Status = Literal["open", "assigned", "inflight", "done", "dropped"] diff --git a/autopilot/staleness_engine.py b/autopilot/staleness_engine.py index 5df6cb8..ff98769 100644 --- a/autopilot/staleness_engine.py +++ b/autopilot/staleness_engine.py @@ -26,7 +26,7 @@ import logging import os import sys -from datetime import datetime, timezone +from datetime import UTC, datetime from pathlib import Path from typing import Any @@ -204,7 +204,7 @@ def generate_comment( cost = result.get("usage", {}) self._cost_log.append( { - "timestamp": datetime.now(timezone.utc).isoformat(), + "timestamp": datetime.now(UTC).isoformat(), "repo": repo_full_name, "tier": tier, "usage": cost, @@ -231,7 +231,7 @@ def scan_repos(self, repos: list[dict[str, Any]]) -> list[dict[str, Any]]: repo_full_name, pr_number, pr_title, pr_url, age_days, tier """ stale: list[dict[str, Any]] = [] - now = datetime.now(timezone.utc) + now = datetime.now(UTC) for repo_cfg in repos: owner = repo_cfg["owner"] @@ -243,7 +243,7 @@ def scan_repos(self, repos: list[dict[str, Any]]) -> list[dict[str, Any]]: for pr in pulls: created = pr.created_at if created.tzinfo is None: - created = created.replace(tzinfo=timezone.utc) + created = created.replace(tzinfo=UTC) age_days = (now - created).days tier = self.assign_tier(age_days) if tier > 0: @@ -291,7 +291,7 @@ def process_stale_prs( Returns a summary dict with counts and per-PR actions taken. """ state = self.load_state() - now_iso = datetime.now(timezone.utc).isoformat() + now_iso = datetime.now(UTC).isoformat() actions: list[dict[str, Any]] = [] for pr_info in stale_prs: diff --git a/autopilot/tests/test_recommendation_contract.py b/autopilot/tests/test_recommendation_contract.py index ca4ba15..fb403da 100644 --- a/autopilot/tests/test_recommendation_contract.py +++ b/autopilot/tests/test_recommendation_contract.py @@ -10,9 +10,9 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from recommendation_contract import Recommendation, validate -from decisions.ledger import should_post, record, latest_match +from decisions.ledger import record, should_post from message_formatter import format +from recommendation_contract import Recommendation, validate def _good() -> Recommendation: diff --git a/docker-compose.yml b/docker-compose.yml index ec34734..147a9fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -130,6 +130,41 @@ services: memory: 4G restart: unless-stopped + # Pipeline metrics exporter — serves Prometheus /metrics on :8000 so the + # `agent:8000` scrape target in monitoring/prometheus.yml actually gets data. + # Feeds the regression_alert module + Grafana dashboard. + metrics-exporter: + build: + context: . + dockerfile: Dockerfile + args: + - BUILDKIT_INLINE_CACHE=1 + image: autonomous-github-agent:latest + container_name: autonomous-agent-metrics + profiles: + - monitoring + command: ["python", "monitoring/metrics_exporter.py", "--port", "8000", "--host", "0.0.0.0"] + volumes: + - ./monitoring:/app/monitoring:ro + - ./core:/app/core:ro + - ./overseer:/app/overseer:ro + environment: + - PYTHONUNBUFFERED=1 + - METRICS_PORT=8000 + ports: + - "8000:8000" + networks: + - agent-network + depends_on: + - agent + healthcheck: + test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8000/metrics').status==200 else 1)"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s + restart: unless-stopped + # Named volumes for persistent data volumes: agent-data: diff --git a/finalize_setup.bat b/finalize_setup.bat deleted file mode 100644 index 4162215..0000000 --- a/finalize_setup.bat +++ /dev/null @@ -1,76 +0,0 @@ -@echo off -REM Final setup script to create remaining directories and files - -echo. -echo ======================================== -echo Finalizing Setup -echo ======================================== -echo. - -cd /d C:\Users\aw789\autonomous-github-agent - -REM Create remaining directories -mkdir config 2>nul -mkdir workflows 2>nul - -REM Create workflow files -echo Creating GitHub Actions workflows... - -REM CI Workflow -( -echo name: CI - Autonomous Agent Tests -echo. -echo on: -echo push: -echo branches: [ main, develop ] -echo pull_request: -echo branches: [ main ] -echo. -echo jobs: -echo test: -echo runs-on: ubuntu-latest -echo strategy: -echo matrix: -echo python-version: ["3.11", "3.12"] -echo. -echo steps: -echo - uses: actions/checkout@v4 -echo - name: Set up Python -echo uses: actions/setup-python@v5 -echo with: -echo python-version: $${{ matrix.python-version }} -echo - name: Install dependencies -echo run: pip install -e ".[dev]" -echo - name: Run tests -echo run: pytest --cov=autonomous_agent -) > workflows\ci.yml - -REM Config example -( -echo github: -echo token: ${GITHUB_TOKEN} -echo api_url: https://api.github.com -echo. -echo llm: -echo provider: openai -echo api_key: ${OPENAI_API_KEY} -echo model: gpt-4-turbo-preview -echo. -echo automation_level: semi-auto -) > config\config.example.yaml - -echo. -echo ======================================== -echo ✓ Setup Complete! -echo ======================================== -echo. -echo Next Steps: -echo 1. Run: python install.py -echo 2. Or manually run: -echo - python quick_setup.py -echo - python create_core_files.py -echo - python create_agents.py -echo - python create_cli.py -echo - pip install -e . -echo. -pause diff --git a/monitoring/metrics_exporter.py b/monitoring/metrics_exporter.py new file mode 100644 index 0000000..e873c72 --- /dev/null +++ b/monitoring/metrics_exporter.py @@ -0,0 +1,279 @@ +#!/usr/bin/env python3 +""" +Prometheus metrics exporter for the Autonomous GitHub Agent pipeline. + +Why this exists +--------------- +`monitoring/prometheus.yml` already scrapes a job named `agent` at +`agent:8000`, but nothing in the codebase exposes a `/metrics` endpoint, so +the Grafana dashboard has no data. This module fixes that gap WITHOUT adding +any third-party dependency (the prometheus client is not in requirements.txt) +by speaking the Prometheus text-exposition format directly over stdlib +http.server. + +What it tracks +-------------- +- drc_loop_runs_total counter (success / failure) DRC Agent Loop runs +- drc_loop_duration_seconds summary wall-clock time of a DRC run +- risk_score histogram risk score of evaluated actions (0-10) +- overseer_runs_total counter overseer/automation runs (success/failure) +- regression_alerts_total counter Slack alerts emitted on regression + +Usage (sidecar) +--------------- + python monitoring/metrics_exporter.py --port 8000 + +Usage (import) +-------------- + from monitoring.metrics_exporter import metrics + metrics.drc_run(duration_s=12.3, success=True) + metrics.observe_risk_score(4.2) + # then `metrics.render()` returns the Prometheus text payload +""" + +from __future__ import annotations + +import argparse +import math +import threading +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer + +# Risk-score histogram buckets: 0-2.9 LOW, 3-5.9 MEDIUM, 6-7.9 HIGH, 8-10 CRITICAL +RISK_BUCKETS = (3.0, 6.0, 8.0, 10.0, math.inf) + + +def _bucket_index(value: float, buckets: tuple[float, ...]) -> int: + """Return the index of the first bucket whose upper bound >= value.""" + for i, upper in enumerate(buckets): + if value <= upper: + return i + return len(buckets) - 1 + + +class Counter: + """A monotonically increasing counter with label support.""" + + def __init__(self, name: str, description: str, label_keys: tuple[str, ...] = ()): + self.name = name + self.description = description + self.label_keys = label_keys + self._lock = threading.Lock() + # series[(labelval, ...)] = count + self._series: dict[tuple[str, ...], float] = {} + + def inc(self, amount: float = 1.0, labels: tuple[str, ...] = ()) -> None: + if amount < 0: + raise ValueError("counter cannot decrease") + with self._lock: + self._series[labels] = self._series.get(labels, 0.0) + amount + + def _render(self) -> str: + out = [f"# HELP {self.name} {self.description}", f"# TYPE {self.name} counter"] + with self._lock: + if not self._series: + # emit a zero series so the metric always exists + out.append(f"{self.name} 0") + for labels, value in sorted(self._series.items()): + suffix = self._label_suffix(labels) + out.append(f"{self.name}{suffix} {value:g}") + return "\n".join(out) + "\n" + + def _label_suffix(self, labels: tuple[str, ...]) -> str: + if not labels: + return "" + parts = [f'{k}="{v}"' for k, v in zip(self.label_keys, labels, strict=False)] + return "{" + ",".join(parts) + "}" + + +class Summary: + """A summary (count + sum) with label support. Good enough for run duration.""" + + def __init__(self, name: str, description: str, label_keys: tuple[str, ...] = ()): + self.name = name + self.description = description + self.label_keys = label_keys + self._lock = threading.Lock() + self._series: dict[tuple[str, ...], list[float]] = {} # [count, sum] + + def observe(self, value: float, labels: tuple[str, ...] = ()) -> None: + with self._lock: + cur = self._series.setdefault(labels, [0.0, 0.0]) + cur[0] += 1 + cur[1] += value + + def _render(self) -> str: + out = [f"# HELP {self.name} {self.description}", f"# TYPE {self.name} summary"] + with self._lock: + if not self._series: + out.append(f"{self.name}_count 0") + out.append(f"{self.name}_sum 0") + for labels, (count, total) in sorted(self._series.items()): + suffix = self._label_suffix(labels) + out.append(f"{self.name}_count{suffix} {count:g}") + out.append(f"{self.name}_sum{suffix} {total:g}") + return "\n".join(out) + "\n" + + def _label_suffix(self, labels: tuple[str, ...]) -> str: + if not labels: + return "" + parts = [f'{k}="{v}"' for k, v in zip(self.label_keys, labels, strict=False)] + return "{" + ",".join(parts) + "}" + + +class Histogram: + """A histogram with fixed buckets. Used for risk-score distribution.""" + + def __init__(self, name: str, description: str, buckets: tuple[float, ...]): + self.name = name + self.description = description + self.buckets = buckets + self._lock = threading.Lock() + # series[(labelval,...)] = [bucket_counts..., +Inf_count, sum] + self._series: dict[tuple[str, ...], list[float]] = {} + + def observe(self, value: float, labels: tuple[str, ...] = ()) -> None: + with self._lock: + buckets = list(self.buckets) + counts = self._series.setdefault(labels, [0.0] * (len(buckets) + 1)) + idx = _bucket_index(value, tuple(buckets)) + counts[idx] += 1 + counts[-1] += value # last slot = sum + + def _render(self) -> str: + out = [ + f"# HELP {self.name} {self.description}", + f"# TYPE {self.name} histogram", + ] + with self._lock: + if not self._series: + out.append(f"{self.name}_count 0") + out.append(f"{self.name}_sum 0") + for labels, counts in sorted(self._series.items()): + suffix = self._label_suffix(labels) + cumulative = 0.0 + for i, upper in enumerate(self.buckets): + cumulative += counts[i] + out.append(f'{self.name}_bucket{suffix}le="{upper}" {cumulative:g}') + cumulative += counts[-1] if len(self.buckets) < len(counts) else 0 + # +Inf bucket + total_count = sum(counts[:-1]) + out.append(f'{self.name}_bucket{suffix}le="+Inf" {total_count:g}') + out.append(f"{self.name}_count{suffix} {total_count:g}") + out.append(f"{self.name}_sum{suffix} {counts[-1]:g}") + return "\n".join(out) + "\n" + + def _label_suffix(self, labels: tuple[str, ...]) -> str: + if not labels: + return "" + parts = [f'outcome="{v}"' for v in labels] + return "{" + ",".join(parts) + "}" + + +class Metrics: + """Central registry of all pipeline metrics.""" + + def __init__(self) -> None: + self.drc_runs = Counter( + "drc_loop_runs_total", + "Total DRC Agent Loop runs by outcome.", + label_keys=("outcome",), + ) + self.drc_duration = Summary( + "drc_loop_duration_seconds", + "Wall-clock duration of a DRC Agent Loop run.", + label_keys=("outcome",), + ) + self.risk_score = Histogram( + "risk_score", + "Distribution of action risk scores (0-10) evaluated by the pipeline.", + RISK_BUCKETS, + ) + self.overseer_runs = Counter( + "overseer_runs_total", + "Total overseer/automation runs by outcome.", + label_keys=("outcome",), + ) + self.regression_alerts = Counter( + "regression_alerts_total", + "Total Slack regression alerts emitted.", + label_keys=("reason",), + ) + + # --- convenience API --------------------------------------------------- + def drc_run(self, duration_s: float, success: bool) -> None: + outcome = "success" if success else "failure" + self.drc_runs.inc(labels=(outcome,)) + self.drc_duration.observe(duration_s, labels=(outcome,)) + + def observe_risk_score(self, score: float) -> None: + self.risk_score.observe(float(score)) + + def overseer_run(self, success: bool) -> None: + self.overseer_runs.inc(labels=("success" if success else "failure",)) + + def alert(self, reason: str) -> None: + self.regression_alerts.inc(labels=(reason,)) + + def render(self) -> str: + parts = [ + self.drc_runs._render(), + self.drc_duration._render(), + self.risk_score._render(), + self.overseer_runs._render(), + self.regression_alerts._render(), + ] + return "\n".join(parts) + + +metrics = Metrics() + + +class _Handler(BaseHTTPRequestHandler): + def do_GET(self) -> None: # noqa: N802 (http.server API) + if self.path in ("/metrics", "/"): + payload = metrics.render().encode("utf-8") + self.send_response(200) + self.send_header("Content-Type", "text/plain; version=0.0.4; charset=utf-8") + self.send_header("Content-Length", str(len(payload))) + self.end_headers() + self.wfile.write(payload) + else: + self.send_response(404) + self.end_headers() + + def log_message( + self, format: str, *args + ) -> None: # noqa: A002 — silence default stderr logging + pass + + +def serve(port: int = 8000, host: str = "0.0.0.0") -> ThreadingHTTPServer: + """Start the metrics HTTP server. Returns the server (call .shutdown() to stop).""" + server = ThreadingHTTPServer((host, port), _Handler) + return server + + +def main() -> None: + parser = argparse.ArgumentParser( + description="Autonomous GitHub Agent metrics exporter" + ) + parser.add_argument( + "--port", type=int, default=8000, help="Port to serve /metrics on" + ) + parser.add_argument("--host", default="0.0.0.0", help="Bind host") + args = parser.parse_args() + srv = serve(args.port, args.host) + print( + f"metrics exporter listening on http://{args.host}:{args.port}/metrics", + flush=True, + ) + try: + srv.serve_forever() + except KeyboardInterrupt: + pass + finally: + srv.shutdown() + + +if __name__ == "__main__": + main() diff --git a/monitoring/regression_alert.py b/monitoring/regression_alert.py new file mode 100644 index 0000000..de7a8ac --- /dev/null +++ b/monitoring/regression_alert.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +""" +Regression alerting for the Autonomous GitHub Agent pipeline. + +Purpose +------- +Catches silent pipeline degradation and posts a notification to Slack +(channel #drc-recommendations) via the same SLACK_WEBHOOK_URL secret the +rest of the repo uses (see .github/scripts/notification_manager.py and +.github/workflows/n8n-health-check.yml). + +It is intentionally dependency-light: it uses urllib from the standard +library, with an optional requests fallback so it behaves exactly like the +existing notification_manager.py code path. + +Detectable regressions +----------------------- +- coverage dropped below a floor (e.g. 70%) +- DRC loop failure rate over a window exceeds a threshold +- median risk score of evaluated actions climbs above a ceiling + +Usage +----- + from monitoring.regression_alert import RegressionMonitor, metrics + monitor = RegressionMonitor(metrics, coverage_floor=70.0) + monitor.check(coverage_pct=current_coverage) + # or as a CLI: + python monitoring/regression_alert.py --coverage 68.5 +""" + +from __future__ import annotations + +import argparse +import json +import os +import sys +from pathlib import Path + +# Allow running this script directly (python monitoring/regression_alert.py) +# by making the repo root importable as a package root. +_REPO_ROOT = str(Path(__file__).resolve().parents[1]) +if _REPO_ROOT not in sys.path: + sys.path.insert(0, _REPO_ROOT) + +try: + import requests # type: ignore + + _REQUESTS = True + _urllib = None +except ImportError: # pragma: no cover + import urllib.request as _urllib + + _REQUESTS = False + requests = None # type: ignore[assignment] + +from monitoring.metrics_exporter import metrics # noqa: E402 + +DEFAULT_SLACK_CHANNEL = "#drc-recommendations" + + +class RegressionMonitor: + """Evaluates pipeline health signals and emits Slack alerts on regression.""" + + def __init__( + self, + coverage_floor: float = 70.0, + risk_ceiling: float = 6.0, + failure_rate_ceiling: float = 0.2, + slack_webhook: str | None = None, + channel: str = DEFAULT_SLACK_CHANNEL, + ) -> None: + self.coverage_floor = coverage_floor + self.risk_ceiling = risk_ceiling + self.failure_rate_ceiling = failure_rate_ceiling + self.slack_webhook = slack_webhook or os.getenv("SLACK_WEBHOOK_URL") + self.channel = channel + + # --- signal checks ----------------------------------------------------- + def check_coverage(self, coverage_pct: float) -> str | None: + """Return an alert reason if coverage is below the floor, else None.""" + if coverage_pct < self.coverage_floor: + reason = ( + f"coverage regression: {coverage_pct:.2f}% " + f"below floor {self.coverage_floor:.2f}%" + ) + self._emit(reason) + return reason + return None + + def check_failure_rate(self, successes: int, failures: int) -> str | None: + """Return an alert reason if the DRC failure rate exceeds the ceiling.""" + total = successes + failures + if total == 0: + return None + rate = failures / total + if rate > self.failure_rate_ceiling: + reason = ( + f"DRC failure rate {rate:.1%} " + f"({failures}/{total}) exceeds ceiling " + f"{self.failure_rate_ceiling:.1%}" + ) + self._emit(reason) + return reason + return None + + def check_risk_ceiling(self, median_risk: float) -> str | None: + """Return an alert reason if the median evaluated risk climbs too high.""" + if median_risk > self.risk_ceiling: + reason = ( + f"median risk score {median_risk:.1f} " + f"above ceiling {self.risk_ceiling:.1f}" + ) + self._emit(reason) + return reason + return None + + # --- delivery ---------------------------------------------------------- + def _emit(self, reason: str) -> None: + metrics.alert(reason=reason.split(":")[0]) + self._post_to_slack(reason) + + def _post_to_slack(self, reason: str) -> bool: + if not self.slack_webhook: + print( + f"[regression-alert] (no SLACK_WEBHOOK_URL) {reason}", + file=__import__("sys").stderr, + ) + return False + text = ( + f":rotating_light: Pipeline regression detected\n" + f"*Reason:* {reason}\n" + f"*Action:* investigate the DRC loop / overseer before the next run." + ) + payload = {"channel": self.channel, "text": text} + try: + if _REQUESTS and requests is not None: + resp = requests.post(self.slack_webhook, json=payload, timeout=10) + ok = resp.status_code == 200 + elif _urllib is not None: # pragma: no cover + req = _urllib.Request( + self.slack_webhook, + data=json.dumps(payload).encode("utf-8"), + headers={"Content-Type": "application/json"}, + method="POST", + ) + with _urllib.urlopen(req, timeout=10) as r: + ok = r.status == 200 + else: + print( + "[regression-alert] no HTTP client available", + file=__import__("sys").stderr, + ) + return False + except Exception as exc: # noqa: BLE001 — surface but never crash the caller + print( + f"[regression-alert] slack post failed: {exc}", + file=__import__("sys").stderr, + ) + return False + if not ok: + print( + "[regression-alert] slack returned non-200", + file=__import__("sys").stderr, + ) + return ok + + +def main() -> None: + parser = argparse.ArgumentParser( + description="Check pipeline health and alert on regression" + ) + parser.add_argument( + "--coverage", type=float, default=None, help="Current coverage percent" + ) + parser.add_argument("--coverage-floor", type=float, default=70.0) + parser.add_argument("--drc-success", type=int, default=None) + parser.add_argument("--drc-failure", type=int, default=None) + parser.add_argument("--median-risk", type=float, default=None) + args = parser.parse_args() + + monitor = RegressionMonitor(coverage_floor=args.coverage_floor) + fired = False + if args.coverage is not None: + fired = monitor.check_coverage(args.coverage) is not None or fired + if args.drc_success is not None and args.drc_failure is not None: + fired = ( + monitor.check_failure_rate(args.drc_success, args.drc_failure) is not None + or fired + ) + if args.median_risk is not None: + fired = monitor.check_risk_ceiling(args.median_risk) is not None or fired + + raise SystemExit(1 if fired else 0) + + +if __name__ == "__main__": + main() diff --git a/pytest.ini b/pytest.ini index c054068..0c1467c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -25,7 +25,7 @@ addopts = --cov-report=term-missing --cov-report=html:htmlcov --cov-report=xml:coverage.xml - --cov-fail-under=55 + --cov-fail-under=70 -p no:warnings # Coverage options diff --git a/run_install.bat b/run_install.bat deleted file mode 100644 index e3fca23..0000000 --- a/run_install.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -cd /d C:\Users\aw789\autonomous-github-agent -python install.py -pause diff --git a/run_installation.bat b/run_installation.bat deleted file mode 100644 index 3e17039..0000000 --- a/run_installation.bat +++ /dev/null @@ -1,80 +0,0 @@ -@echo off -REM Complete installation script for Autonomous GitHub Agent -echo ======================================== -echo Autonomous GitHub Agent Installation -echo ======================================== -echo. - -cd /d C:\Users\aw789\autonomous-github-agent - -echo Step 1/7: Running quick_setup.py... -python quick_setup.py -if %errorlevel% neq 0 ( - echo ERROR: quick_setup.py failed - pause - exit /b 1 -) -echo. - -echo Step 2/7: Running create_core_files.py... -python create_core_files.py -if %errorlevel% neq 0 ( - echo ERROR: create_core_files.py failed - pause - exit /b 1 -) -echo. - -echo Step 3/7: Running create_agents.py... -python create_agents.py -if %errorlevel% neq 0 ( - echo ERROR: create_agents.py failed - pause - exit /b 1 -) -echo. - -echo Step 4/7: Running create_cli.py... -python create_cli.py -if %errorlevel% neq 0 ( - echo ERROR: create_cli.py failed - pause - exit /b 1 -) -echo. - -echo Step 5/7: Installing package with pip... -pip install -e . -if %errorlevel% neq 0 ( - echo WARNING: pip install failed - may need manual intervention -) -echo. - -echo Step 6/7: Creating .env file from .env.example... -if exist .env.example ( - if not exist .env ( - copy .env.example .env - echo ✓ Created .env file - ) else ( - echo .env file already exists, skipping... - ) -) else ( - echo WARNING: .env.example not found -) -echo. - -echo Step 7/7: Verifying installation... -python -c "import sys; print(f'Python version: {sys.version}')" -python -c "try: import autonomous_agent; print(f'✓ Package imported successfully, version: {autonomous_agent.__version__}'); except Exception as e: print(f'✗ Import failed: {e}')" -echo. - -echo ======================================== -echo Installation Complete! -echo ======================================== -echo. -echo Check the output above for any errors. -echo If pip install failed, you may need to: -echo 1. Install dependencies manually -echo 2. Check your Python environment -echo. -pause diff --git a/run_master_install.bat b/run_master_install.bat deleted file mode 100644 index cc66df5..0000000 --- a/run_master_install.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -cd /d "C:\Users\aw789\autonomous-github-agent" - -echo Launching Master Installation Script... -python master_install.py - -pause diff --git a/start.bat b/start.bat deleted file mode 100644 index f2de904..0000000 --- a/start.bat +++ /dev/null @@ -1,84 +0,0 @@ -@echo off -REM Quick start script for Autonomous GitHub Agent (Windows) - -echo ================================================ -echo Autonomous GitHub Agent - Docker Quick Start -echo ================================================ -echo. - -REM Check if Docker is installed -docker --version >nul 2>&1 -if %errorlevel% neq 0 ( - echo ERROR: Docker is not installed or not in PATH - echo Please install Docker Desktop from: https://www.docker.com/products/docker-desktop - pause - exit /b 1 -) - -echo [1/5] Checking environment configuration... -if not exist ".env" ( - if exist ".env.example" ( - echo Creating .env from .env.example... - copy .env.example .env - echo. - echo IMPORTANT: Please edit .env file with your configuration before continuing! - echo Press any key to open .env in notepad... - pause >nul - notepad .env - ) else ( - echo ERROR: .env.example not found - pause - exit /b 1 - ) -) else ( - echo .env file found -) - -echo. -echo [2/5] Creating context.json if needed... -if not exist "context.json" ( - if exist "context.json.example" ( - copy context.json.example context.json - echo Created context.json from example - ) -) - -echo. -echo [3/5] Building Docker image... -docker-compose build -if %errorlevel% neq 0 ( - echo ERROR: Docker build failed - pause - exit /b 1 -) - -echo. -echo [4/5] Starting containers... -docker-compose up -d -if %errorlevel% neq 0 ( - echo ERROR: Failed to start containers - pause - exit /b 1 -) - -echo. -echo [5/5] Checking status... -docker-compose ps - -echo. -echo ================================================ -echo Setup complete! -echo ================================================ -echo. -echo Useful commands: -echo docker-compose logs -f agent - View logs -echo docker-compose down - Stop containers -echo docker-compose restart - Restart containers -echo. -echo Or use the Makefile: -echo make logs - View logs -echo make down - Stop containers -echo make restart - Restart containers -echo. -echo Press any key to exit... -pause >nul diff --git a/tests/test_autonomous_agents.py b/tests/test_autonomous_agents.py index 4a88150..822dc8c 100644 --- a/tests/test_autonomous_agents.py +++ b/tests/test_autonomous_agents.py @@ -1,8 +1,7 @@ """Tests for autonomous_agent package — agents and CLI.""" -import re -from datetime import datetime, timezone -from unittest.mock import AsyncMock, MagicMock, Mock, patch +from datetime import UTC, datetime +from unittest.mock import Mock, patch import pytest from click.testing import CliRunner @@ -20,7 +19,6 @@ main, ) - # ── helpers ─────────────────────────────────────────────────────────────────── @@ -73,7 +71,7 @@ async def test_execute_stale_branch_requires_approval(self): branch = Mock() branch.name = "old-feature" - old_date = datetime(2025, 1, 1, tzinfo=timezone.utc) + old_date = datetime(2025, 1, 1, tzinfo=UTC) branch.commit.commit.author.date = old_date repo.get_branches.return_value = [branch] self.github.get_repository.return_value = repo @@ -92,7 +90,7 @@ async def test_execute_stale_branch_auto_delete(self): branch = Mock() branch.name = "old-feature" - old_date = datetime(2025, 1, 1, tzinfo=timezone.utc) + old_date = datetime(2025, 1, 1, tzinfo=UTC) branch.commit.commit.author.date = old_date branch.commit.sha = "abc123" diff --git a/tests/test_health_monitor.py b/tests/test_health_monitor.py index 47f971b..d516676 100644 --- a/tests/test_health_monitor.py +++ b/tests/test_health_monitor.py @@ -1,27 +1,249 @@ """Tests for health monitor agent.""" -from unittest.mock import Mock +from datetime import UTC, datetime, timedelta +from unittest.mock import MagicMock import pytest from autonomous_agent.agents.health_monitor import HealthMonitorAgent -@pytest.mark.asyncio -async def test_health_monitor_execute(): - """Test health monitor execution.""" - mock_github = Mock() - mock_llm = Mock() - mock_audit = Mock() +def _make_agent(monkeypatch): + """Build a HealthMonitorAgent with all collaborators mocked.""" + mock_github = MagicMock() + mock_llm = MagicMock() + mock_audit = MagicMock() agent = HealthMonitorAgent(mock_github, mock_llm, mock_audit) + return agent, mock_github, mock_llm, mock_audit + + +def _branch(name, days_old=10, commit_date=None): + """Build a fake repo branch with an author date `days_old` days ago.""" + if commit_date is None: + commit_date = datetime.utcnow() - timedelta(days=days_old) + author = MagicMock() + author.date = commit_date + inner_commit = MagicMock() + inner_commit.author = author + commit = MagicMock() + commit.commit = inner_commit + branch = MagicMock() + branch.name = name + branch.commit = commit + return branch + + +def _pr(number, age_days): + created = datetime.utcnow() - timedelta(days=age_days) + if created.tzinfo is None: + created = created.replace(tzinfo=UTC) + pr = MagicMock() + pr.number = number + pr.title = f"PR {number}" + pr.created_at = created + pr.user.login = "someuser" + return pr + + +@pytest.mark.asyncio +async def test_health_monitor_execute_full(monkeypatch): + """Exercise the full execute path incl. both sides of every branch.""" + agent, mock_github, _, mock_audit = _make_agent(monkeypatch) + + repo = MagicMock() + repo.stargazers_count = 100 + repo.forks_count = 10 + repo.open_issues_count = 60 # > 50 -> recommendation branch + repo.watchers_count = 5 + repo.size = 1234 + repo.default_branch = "main" + repo.archived = False + repo.private = False + repo.has_issues = True + repo.has_wiki = True + repo.has_pages = False + repo.created_at = datetime(2024, 1, 1) + repo.updated_at = datetime(2025, 1, 1) + repo.pushed_at = datetime(2025, 6, 1) # not None branch + + # One stale branch (>90 days) and one fresh branch; default branch skipped + stale = _branch("old-feature", days_old=120) + fresh = _branch("new-feature", days_old=5) + main_branch = _branch("main", days_old=1) + repo.get_branches.return_value = [stale, fresh, main_branch] + + # Old PR (>30 days) + old_pr = _pr(7, age_days=40) + recent_pr = _pr(8, age_days=2) + mock_github.get_pull_requests.return_value = [old_pr, recent_pr] + + # Missing files: README present, LICENSE/others missing + readme = MagicMock() + readme.type = "file" + readme.name = "README.md" + repo.get_contents.return_value = [readme] + + mock_github.get_repository.return_value = repo + + result = await agent.execute("owner/repo") + + assert result["repository"] == "owner/repo" + assert result["metrics"]["stars"] == 100 + assert result["metrics"]["open_issues"] == 60 + assert result["metrics"]["pushed_at"] is not None + + # Stale branch detected + assert any(b["name"] == "old-feature" for b in result["issues"]["stale_branches"]) + # Fresh + default branch NOT flagged as stale + assert all(b["name"] != "new-feature" for b in result["issues"]["stale_branches"]) + assert all(b["name"] != "main" for b in result["issues"]["stale_branches"]) + + # Old PR detected, recent PR not + assert any(p["number"] == 7 for p in result["issues"]["old_pull_requests"]) + assert all(p["number"] != 8 for p in result["issues"]["old_pull_requests"]) + + # Missing files branch: LICENSE/.gitignore/CONTRIBUTING missing + assert "LICENSE" in result["issues"]["missing_files"] + assert "README.md" not in result["issues"]["missing_files"] + + recs = result["recommendations"] + assert any("stale branch" in r for r in recs) + assert any("pull request" in r for r in recs) + assert any("Add missing files" in r for r in recs) + assert any("High number of open issues" in r for r in recs) + + mock_audit.log_action.assert_called_once() + + +@pytest.mark.asyncio +async def test_health_monitor_no_issues_paths(monkeypatch): + """Exercise the 'no issues' branches (nothing stale/old/missing, <=50 issues).""" + agent, mock_github, _, mock_audit = _make_agent(monkeypatch) + + repo = MagicMock() + repo.stargazers_count = 1 + repo.forks_count = 0 + repo.open_issues_count = 3 # <= 50 -> no 'high issues' recommendation + repo.watchers_count = 0 + repo.size = 10 + repo.default_branch = "main" + repo.archived = False + repo.private = False + repo.has_issues = True + repo.has_wiki = False + repo.has_pages = False + repo.created_at = datetime(2024, 1, 1) + repo.updated_at = datetime(2025, 1, 1) + repo.pushed_at = None # None branch + + # Only the default branch, fresh + repo.get_branches.return_value = [_branch("main", days_old=1)] + mock_github.get_pull_requests.return_value = [] # no PRs + + # All essential files present + names = ["README.md", "LICENSE", ".gitignore", "CONTRIBUTING.md"] + files = [] + for n in names: + f = MagicMock() + f.type = "file" + f.name = n + files.append(f) + repo.get_contents.return_value = files + + mock_github.get_repository.return_value = repo + + result = await agent.execute("owner/repo") + + assert result["issues"]["stale_branches"] == [] + assert result["issues"]["old_pull_requests"] == [] + assert result["issues"]["missing_files"] == [] + assert result["metrics"]["pushed_at"] is None + # No recommendations triggered + assert result["recommendations"] == [] + mock_audit.log_action.assert_called_once() + + +@pytest.mark.asyncio +async def test_health_monitor_branch_exception_is_swallowed(monkeypatch): + """The per-branch try/except must swallow errors and keep going.""" + agent, mock_github, _, _ = _make_agent(monkeypatch) + + repo = MagicMock() + for attr in [ + "stargazers_count", + "forks_count", + "open_issues_count", + "watchers_count", + "size", + ]: + setattr(repo, attr, 0) + repo.default_branch = "main" + repo.archived = False + repo.private = False + repo.has_issues = True + repo.has_wiki = False + repo.has_pages = False + repo.created_at = datetime(2024, 1, 1) + repo.updated_at = datetime(2025, 1, 1) + repo.pushed_at = datetime(2025, 1, 1) + repo.get_pull_requests.return_value = [] + + # Branch whose author date access raises -> exception branch is swallowed. + # The code computes days_old from commit.commit.author.date inside try/except. + author = MagicMock() + author.date = MagicMock(side_effect=RuntimeError("boom")) + inner_commit = MagicMock() + inner_commit.author = author + commit = MagicMock() + commit.commit = inner_commit + bad = MagicMock() + bad.name = "broken" + bad.commit = commit + repo.get_branches.return_value = [bad] + + readme = MagicMock() + readme.type = "file" + readme.name = "README.md" + repo.get_contents.return_value = [readme] + + mock_github.get_repository.return_value = repo + + result = await agent.execute("owner/repo") + # No crash; stale_branches empty because the exception was swallowed + assert result["issues"]["stale_branches"] == [] + + +@pytest.mark.asyncio +async def test_health_monitor_contents_exception_is_swallowed(monkeypatch): + """The get_contents try/except must swallow errors and keep going.""" + agent, mock_github, _, _ = _make_agent(monkeypatch) + + repo = MagicMock() + for attr in [ + "stargazers_count", + "forks_count", + "open_issues_count", + "watchers_count", + "size", + ]: + setattr(repo, attr, 0) + repo.default_branch = "main" + repo.archived = False + repo.private = False + repo.has_issues = True + repo.has_wiki = False + repo.has_pages = False + repo.created_at = datetime(2024, 1, 1) + repo.updated_at = datetime(2025, 1, 1) + repo.pushed_at = datetime(2025, 1, 1) + repo.get_pull_requests.return_value = [] + repo.get_branches.return_value = [] + + # get_contents raises -> exception branch for missing-files check + repo.get_contents.side_effect = RuntimeError("no contents") - # Mock repository - mock_repo = Mock() - mock_repo.stargazers_count = 100 - mock_repo.open_issues_count = 5 - mock_github.get_repository.return_value = mock_repo + mock_github.get_repository.return_value = repo - # This will fail without full mocking, but shows test structure - # result = await agent.execute("owner/repo") - # assert "metrics" in result + result = await agent.execute("owner/repo") + assert result["issues"]["missing_files"] == [] diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py new file mode 100644 index 0000000..e43d50c --- /dev/null +++ b/tests/unit/test_cli.py @@ -0,0 +1,58 @@ +"""Tests for the CLI (autonomous_agent/cli.py) — focuses on branch coverage.""" + +from unittest.mock import MagicMock, patch + +from click.testing import CliRunner + +from autonomous_agent.cli import main + + +def _config( + token="ghp_abc", + provider="openai", + api_key="sk-test", + automation="semi-auto", + agents=("health", "review"), +): + cfg = MagicMock() + cfg.github.token = token + cfg.llm.provider = provider + cfg.llm.api_key = api_key + cfg.automation_level = automation + cfg.enabled_agents = list(agents) + return cfg + + +def test_config_check_token_set(): + runner = CliRunner() + with patch( + "autonomous_agent.cli.get_config", return_value=_config(token="ghp_xyz") + ): + result = runner.invoke(main, ["config-check"]) + assert result.exit_code == 0 + assert "GitHub Token" in result.output + assert "✓ Set" in result.output + + +def test_config_check_token_missing(): + runner = CliRunner() + with patch("autonomous_agent.cli.get_config", return_value=_config(token="")): + result = runner.invoke(main, ["config-check"]) + assert result.exit_code == 0 + assert "GitHub token not configured" in result.output + + +def test_list_agents(): + runner = CliRunner() + result = runner.invoke(main, ["list-agents"]) + assert result.exit_code == 0 + assert "health_monitor" in result.output + assert "code_reviewer" in result.output + assert "security_scanner" in result.output + + +def test_version_option(): + runner = CliRunner() + result = runner.invoke(main, ["--version"]) + assert result.exit_code == 0 + assert "0.1.0" in result.output diff --git a/tests/unit/test_code_review_agent.py b/tests/unit/test_code_review_agent.py deleted file mode 100644 index 069a3b2..0000000 --- a/tests/unit/test_code_review_agent.py +++ /dev/null @@ -1,133 +0,0 @@ -"""Unit tests for agents/code_review_agent.py""" - -from __future__ import annotations - -import asyncio -from unittest.mock import AsyncMock, MagicMock, patch - - -def run(coro): - return asyncio.run(coro) - - -def _make_agent(config=None): - from agents.code_review_agent import CodeReviewAgent - - with ( - patch("core.agent_base.GitHubClient"), - patch("core.agent_base.LLMClient"), - patch("core.agent_base.AuditLogger"), - patch("core.agent_base.PolicyEngine"), - ): - agent = CodeReviewAgent(config or {"github_token": "x"}) - agent.policy.check_action = AsyncMock(return_value={"requires_approval": False}) - agent.audit.log_action = AsyncMock() - return agent - - -class TestCodeReviewAgentInit: - def test_name(self): - assert _make_agent().name == "code_review_agent" - - def test_supported_actions(self): - assert _make_agent().get_supported_actions() == ["review_pr"] - - -class TestExecuteDispatch: - def setup_method(self): - self.agent = _make_agent() - - def test_unsupported_action_raises(self): - import pytest - - with pytest.raises(ValueError, match="Unsupported action"): - run(self.agent._execute({"action": "bad_action"})) - - def test_review_pr_dispatches(self): - self.agent._review_pr = AsyncMock( - return_value={"pr_number": 7, "review_length": 100} - ) - result = run( - self.agent._execute( - {"action": "review_pr", "params": {"repo": "o/r", "pr_number": 7}} - ) - ) - self.agent._review_pr.assert_called_once_with({"repo": "o/r", "pr_number": 7}) - assert result["pr_number"] == 7 - - -class TestReviewPr: - def setup_method(self): - self.agent = _make_agent() - - def test_review_pr_posts_comment(self): - mock_file = MagicMock() - mock_file.filename = "src/main.py" - mock_file.patch = "@@ -1 +1 @@\n+print('hi')" - - mock_pr = MagicMock() - mock_pr.title = "Add feature" - mock_pr.body = "desc" - mock_pr.get_files.return_value = [mock_file] - mock_pr.create_review = MagicMock() - - mock_repo = MagicMock() - mock_repo.get_pull.return_value = mock_pr - self.agent.github.client.get_repo.return_value = mock_repo - - self.agent.llm.generate = AsyncMock( - return_value={ - "content": "Looks good!", - "usage": {"total_tokens": 42}, - } - ) - - result = run(self.agent._review_pr({"repo": "o/r", "pr_number": 3})) - mock_pr.create_review.assert_called_once() - assert result["pr_number"] == 3 - assert result["review_length"] == len("Looks good!") - assert result["tokens_used"] == 42 - - def test_review_pr_truncates_long_diff(self): - mock_file = MagicMock() - mock_file.filename = "big.py" - mock_file.patch = "x" * 20000 - - mock_pr = MagicMock() - mock_pr.title = "Big PR" - mock_pr.body = None - mock_pr.get_files.return_value = [mock_file] - mock_pr.create_review = MagicMock() - - mock_repo = MagicMock() - mock_repo.get_pull.return_value = mock_pr - self.agent.github.client.get_repo.return_value = mock_repo - - captured_prompt = {} - - async def capture_generate(prompt, **kwargs): - captured_prompt["prompt"] = prompt - return {"content": "ok", "usage": {}} - - self.agent.llm.generate = capture_generate - run(self.agent._review_pr({"repo": "o/r", "pr_number": 1})) - assert len(captured_prompt["prompt"]) < 20000 - - def test_review_pr_handles_file_with_no_patch(self): - mock_file = MagicMock() - mock_file.filename = "binary.png" - mock_file.patch = None - - mock_pr = MagicMock() - mock_pr.title = "Binary" - mock_pr.body = None - mock_pr.get_files.return_value = [mock_file] - mock_pr.create_review = MagicMock() - - mock_repo = MagicMock() - mock_repo.get_pull.return_value = mock_pr - self.agent.github.client.get_repo.return_value = mock_repo - self.agent.llm.generate = AsyncMock(return_value={"content": "ok", "usage": {}}) - - result = run(self.agent._review_pr({"repo": "o/r", "pr_number": 2})) - assert result["repo"] == "o/r" diff --git a/tests/unit/test_dependency_agent.py b/tests/unit/test_dependency_agent.py deleted file mode 100644 index c385473..0000000 --- a/tests/unit/test_dependency_agent.py +++ /dev/null @@ -1,217 +0,0 @@ -"""Unit tests for agents/dependency_agent.py""" - -from __future__ import annotations - -import asyncio -import json -from pathlib import Path -from unittest.mock import AsyncMock, MagicMock, patch - - -def run(coro): - return asyncio.run(coro) - - -def _make_agent(config=None): - from agents.dependency_agent import DependencyAgent - - with ( - patch("core.agent_base.GitHubClient"), - patch("core.agent_base.LLMClient"), - patch("core.agent_base.AuditLogger"), - patch("core.agent_base.PolicyEngine"), - ): - agent = DependencyAgent(config or {"github_token": "x"}) - agent.policy.check_action = AsyncMock(return_value={"requires_approval": False}) - agent.audit.log_action = AsyncMock() - return agent - - -class TestDependencyAgentInit: - def test_name(self): - assert _make_agent().name == "dependency_agent" - - def test_supported_actions(self): - assert _make_agent().get_supported_actions() == ["check_dependencies"] - - -class TestCheckUnpinned: - def setup_method(self): - self.agent = _make_agent() - - def test_returns_empty_for_missing_file(self, tmp_path): - result = self.agent._check_unpinned(tmp_path / "nonexistent.txt") - assert result == [] - - def test_exact_pin_not_flagged(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("requests==2.28.0\n") - assert self.agent._check_unpinned(req) == [] - - def test_lower_bound_only_flagged(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("requests>=2.0\n") - result = self.agent._check_unpinned(req) - assert "requests>=2.0" in result - - def test_tilde_pin_not_flagged(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("requests~=2.28\n") - assert self.agent._check_unpinned(req) == [] - - def test_bare_package_flagged(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("requests\n") - result = self.agent._check_unpinned(req) - assert "requests" in result - - def test_comment_lines_skipped(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("# this is a comment\nrequests==2.28.0\n") - assert self.agent._check_unpinned(req) == [] - - def test_blank_lines_skipped(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("\n\nrequests==2.28.0\n\n") - assert self.agent._check_unpinned(req) == [] - - def test_upper_bound_with_lower_not_flagged(self, tmp_path): - req = tmp_path / "requirements.txt" - req.write_text("requests>=2.0,<3.0\n") - assert self.agent._check_unpinned(req) == [] - - -class TestBuildReport: - def setup_method(self): - self.agent = _make_agent() - - def test_report_with_no_issues(self): - report = self.agent._build_report([], []) - assert "Dependency Audit Report" in report - assert "0 package(s) affected" in report - assert "0 found" in report - - def test_report_with_vulnerability(self): - audit_data = [ - { - "name": "flask", - "version": "1.0", - "vulns": [ - { - "id": "CVE-2021-1234", - "aliases": ["GHSA-abc"], - "fix_versions": ["2.0"], - } - ], - } - ] - report = self.agent._build_report(audit_data, []) - assert "flask" in report - assert "CVE-2021-1234" in report - assert "2.0" in report - - def test_report_with_unpinned(self): - report = self.agent._build_report([], ["requests", "flask>=1.0"]) - assert "requests" in report - assert "flask>=1.0" in report - - def test_vuln_with_no_fix(self): - audit_data = [ - { - "name": "pkg", - "version": "0.1", - "vulns": [{"id": "CVE-x", "aliases": [], "fix_versions": []}], - } - ] - report = self.agent._build_report(audit_data, []) - assert "none" in report - - def test_non_vulnerable_pkg_not_in_table(self): - audit_data = [{"name": "safe-pkg", "version": "1.0", "vulns": []}] - report = self.agent._build_report(audit_data, []) - assert "safe-pkg" not in report - - -class TestRunPipAudit: - def setup_method(self): - self.agent = _make_agent() - - def test_returns_empty_on_bad_json(self): - with patch("subprocess.run") as mock_run: - mock_run.return_value = MagicMock(stdout="not-json") - result = self.agent._run_pip_audit() - assert result == [] - - def test_returns_list_result(self): - data = [{"name": "flask", "version": "1.0", "vulns": []}] - with patch("subprocess.run") as mock_run: - mock_run.return_value = MagicMock(stdout=json.dumps(data)) - result = self.agent._run_pip_audit() - assert result == data - - def test_returns_dependencies_key_if_dict(self): - deps = [{"name": "x", "version": "1", "vulns": []}] - with patch("subprocess.run") as mock_run: - mock_run.return_value = MagicMock(stdout=json.dumps({"dependencies": deps})) - result = self.agent._run_pip_audit() - assert result == deps - - -class TestCheckDependencies: - def setup_method(self): - self.agent = _make_agent() - - def test_creates_issue_when_none_exists(self, tmp_path, monkeypatch): - import agents.dependency_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - (tmp_path / "requirements.txt").write_text("requests==2.28.0\n") - - mock_issue = MagicMock() - mock_issue.number = 42 - mock_repo = MagicMock() - mock_repo.get_issues.return_value = [] - mock_repo.create_issue.return_value = mock_issue - self.agent.github.client.get_repo.return_value = mock_repo - - with patch.object(self.agent, "_run_pip_audit", return_value=[]): - result = run(self.agent._check_dependencies({"repo": "o/r"})) - assert result["created_issue"] == 42 - - def test_updates_existing_issue(self, tmp_path, monkeypatch): - import agents.dependency_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - (tmp_path / "requirements.txt").write_text("requests==2.28.0\n") - - existing = MagicMock() - existing.number = 10 - mock_repo = MagicMock() - mock_repo.get_issues.return_value = [existing] - self.agent.github.client.get_repo.return_value = mock_repo - - with patch.object(self.agent, "_run_pip_audit", return_value=[]): - result = run(self.agent._check_dependencies({"repo": "o/r"})) - assert result["updated_issue"] == 10 - existing.create_comment.assert_called_once() - - -class TestExecuteDispatch: - def setup_method(self): - self.agent = _make_agent() - - def test_unsupported_action_raises(self): - import pytest - - with pytest.raises(ValueError, match="Unsupported action"): - run(self.agent._execute({"action": "fly"})) - - def test_check_dependencies_dispatches(self): - self.agent._check_dependencies = AsyncMock(return_value={"created_issue": 1}) - result = run( - self.agent._execute( - {"action": "check_dependencies", "params": {"repo": "o/r"}} - ) - ) - self.agent._check_dependencies.assert_called_once() - assert result["created_issue"] == 1 diff --git a/tests/unit/test_llm_client.py b/tests/unit/test_llm_client.py new file mode 100644 index 0000000..8ce5d05 --- /dev/null +++ b/tests/unit/test_llm_client.py @@ -0,0 +1,104 @@ +"""Tests for the unified LLM client (core/llm_client.py).""" + +from unittest.mock import MagicMock, patch + +import pytest + +from autonomous_agent.core.llm_client import LLMClient + + +def _config(provider="openai", api_key="sk-test", model="gpt-4-turbo-preview"): + cfg = MagicMock() + cfg.llm.provider = provider + cfg.llm.api_key = api_key + cfg.llm.model = model + cfg.llm.temperature = 0.2 + cfg.llm.max_tokens = 4000 + return cfg + + +@patch("autonomous_agent.core.llm_client.get_config") +@patch("autonomous_agent.core.llm_client.OpenAI") +def test_init_openai_provider(mock_openai, mock_get_config): + mock_get_config.return_value = _config(provider="openai") + client = LLMClient() + assert client.provider == "openai" + mock_openai.assert_called_once_with(api_key="sk-test") + + +@patch("autonomous_agent.core.llm_client.get_config") +@patch("autonomous_agent.core.llm_client.Anthropic") +def test_init_anthropic_provider(mock_anthropic, mock_get_config): + mock_get_config.return_value = _config(provider="anthropic", api_key="sk-ant") + client = LLMClient() + assert client.provider == "anthropic" + mock_anthropic.assert_called_once_with(api_key="sk-ant") + + +@patch("autonomous_agent.core.llm_client.get_config") +def test_init_unsupported_provider_raises(mock_get_config): + mock_get_config.return_value = _config(provider="watson") + with pytest.raises(ValueError, match="Unsupported LLM provider"): + LLMClient() + + +@patch("autonomous_agent.core.llm_client.get_config") +@patch("autonomous_agent.core.llm_client.OpenAI") +def test_complete_openai_with_and_without_system(mock_openai, mock_get_config): + mock_get_config.return_value = _config(provider="openai") + fake = MagicMock() + fake.chat.completions.create.return_value.choices = [ + MagicMock(message=MagicMock(content="hello")) + ] + mock_openai.return_value = fake + + client = LLMClient() + + # With system prompt + out = client.complete("explain", system="be terse") + assert out == "hello" + msgs = fake.chat.completions.create.call_args.kwargs["messages"] + assert msgs[0] == {"role": "system", "content": "be terse"} + assert msgs[1] == {"role": "user", "content": "explain"} + + # Without system prompt + out2 = client.complete("explain") + assert out2 == "hello" + msgs2 = fake.chat.completions.create.call_args.kwargs["messages"] + assert msgs2[0] == {"role": "user", "content": "explain"} + + +@patch("autonomous_agent.core.llm_client.get_config") +@patch("autonomous_agent.core.llm_client.Anthropic") +def test_complete_anthropic_branch(mock_anthropic, mock_get_config): + mock_get_config.return_value = _config(provider="anthropic", api_key="sk-ant") + fake = MagicMock() + content_block = MagicMock() + content_block.text = "anthropic reply" + fake.messages.create.return_value.content = [content_block] + mock_anthropic.return_value = fake + + client = LLMClient() + out = client.complete("do thing", system="sys") + assert out == "anthropic reply" + call = fake.messages.create.call_args.kwargs + assert call["system"] == "sys" + assert call["messages"] == [{"role": "user", "content": "do thing"}] + + +@patch("autonomous_agent.core.llm_client.get_config") +@patch("autonomous_agent.core.llm_client.OpenAI") +def test_analyze_code_builds_prompt(mock_openai, mock_get_config): + mock_get_config.return_value = _config(provider="openai") + fake = MagicMock() + fake.chat.completions.create.return_value.choices = [ + MagicMock(message=MagicMock(content="reviewed")) + ] + mock_openai.return_value = fake + + client = LLMClient() + out = client.analyze_code("print(1)", "find bugs") + assert out == "reviewed" + prompt = fake.chat.completions.create.call_args.kwargs["messages"][1]["content"] + assert "find bugs" in prompt + assert "print(1)" in prompt diff --git a/tests/unit/test_llm_router.py b/tests/unit/test_llm_router.py index d08685f..5ceca3d 100644 --- a/tests/unit/test_llm_router.py +++ b/tests/unit/test_llm_router.py @@ -85,7 +85,9 @@ def test_complexity_high_score_is_complex(self): def test_complexity_low_score_is_simple(self): router = self._router() - complexity = router.classify("complexity", {"score": 5}) + # Band logic: score < 5 -> SIMPLE, 5-20 -> MODERATE, >20 -> COMPLEX + # (see llm_router.classify docstring "complexity 5-20 -> Moderate"). + complexity = router.classify("complexity", {"score": 3}) assert complexity == TaskComplexity.SIMPLE def test_complexity_mid_score_is_moderate(self): diff --git a/tests/unit/test_security_scan_agent.py b/tests/unit/test_security_scan_agent.py deleted file mode 100644 index a7702af..0000000 --- a/tests/unit/test_security_scan_agent.py +++ /dev/null @@ -1,243 +0,0 @@ -"""Unit tests for agents/security_scan_agent.py""" - -from __future__ import annotations - -import asyncio -import json -import tempfile -from pathlib import Path -from unittest.mock import AsyncMock, MagicMock, mock_open, patch - - -def run(coro): - return asyncio.run(coro) - - -def _make_agent(config=None): - from agents.security_scan_agent import SecurityScanAgent - - with ( - patch("core.agent_base.GitHubClient"), - patch("core.agent_base.LLMClient"), - patch("core.agent_base.AuditLogger"), - patch("core.agent_base.PolicyEngine"), - ): - agent = SecurityScanAgent(config or {"github_token": "x"}) - agent.policy.check_action = AsyncMock(return_value={"requires_approval": False}) - agent.audit.log_action = AsyncMock() - return agent - - -class TestSecurityScanAgentInit: - def test_name(self): - assert _make_agent().name == "security_scan_agent" - - def test_supported_actions(self): - assert _make_agent().get_supported_actions() == ["scan_repo"] - - -class TestRunBandit: - def setup_method(self): - self.agent = _make_agent() - - def test_returns_empty_dict_when_file_missing(self): - with ( - patch("subprocess.run"), - patch("builtins.open", side_effect=FileNotFoundError), - ): - result = self.agent._run_bandit() - assert result == {} - - def test_returns_empty_dict_on_bad_json(self, tmp_path): - bandit_out = tmp_path / "bandit.json" - bandit_out.write_text("not-json") - with ( - patch("subprocess.run"), - patch("builtins.open", mock_open(read_data="not-json")), - ): - result = self.agent._run_bandit() - assert result == {} - - def test_returns_parsed_json(self): - bandit_data = {"results": [], "metrics": {}} - with ( - patch("subprocess.run"), - patch("builtins.open", mock_open(read_data=json.dumps(bandit_data))), - ): - result = self.agent._run_bandit() - assert result == bandit_data - - -class TestRunPipAudit: - def setup_method(self): - self.agent = _make_agent() - - def test_returns_empty_on_missing_file(self): - with ( - patch("subprocess.run"), - patch("builtins.open", side_effect=FileNotFoundError), - ): - result = self.agent._run_pip_audit() - assert result == [] - - def test_returns_list_result(self): - data = [{"name": "flask", "version": "1.0", "vulns": []}] - with ( - patch("subprocess.run"), - patch("builtins.open", mock_open(read_data=json.dumps(data))), - ): - result = self.agent._run_pip_audit() - assert result == data - - def test_returns_dependencies_key_if_dict(self): - deps = [{"name": "x", "version": "1", "vulns": []}] - payload = {"dependencies": deps} - with ( - patch("subprocess.run"), - patch("builtins.open", mock_open(read_data=json.dumps(payload))), - ): - result = self.agent._run_pip_audit() - assert result == deps - - def test_returns_empty_on_bad_json(self): - with ( - patch("subprocess.run"), - patch("builtins.open", mock_open(read_data="bad")), - ): - result = self.agent._run_pip_audit() - assert result == [] - - -class TestFormatSummary: - def setup_method(self): - self.agent = _make_agent() - - def test_empty_inputs_shows_zero_counts(self): - report = self.agent._format_summary({}, []) - assert "Security Scan Report" in report - assert "0 issue(s)" in report - assert "0 vulnerable package(s)" in report - - def test_bandit_results_included(self): - bandit_data = { - "results": [ - { - "issue_severity": "HIGH", - "issue_confidence": "HIGH", - "issue_text": "Use of assert", - "filename": "core/x.py", - "line_number": 10, - } - ], - "metrics": {}, - } - report = self.agent._format_summary(bandit_data, []) - assert "HIGH" in report - assert "core/x.py" in report - assert "Use of assert" in report - - def test_bandit_metrics_used_for_count(self): - bandit_data = { - "results": [], - "metrics": { - "_totals": {"SEVERITY.HIGH": 2, "SEVERITY.MEDIUM": 1, "SEVERITY.LOW": 0} - }, - } - report = self.agent._format_summary(bandit_data, []) - assert "3 issue(s)" in report - - def test_pip_audit_vulns_included(self): - pip_data = [ - { - "name": "flask", - "version": "0.12", - "vulns": [{"id": "CVE-2021-99", "fix_versions": ["2.0"]}], - } - ] - report = self.agent._format_summary({}, pip_data) - assert "flask==0.12" in report - assert "CVE-2021-99" in report - assert "2.0" in report - - def test_vuln_with_no_fix_shows_none(self): - pip_data = [ - { - "name": "bad", - "version": "1.0", - "vulns": [{"id": "CVE-x", "fix_versions": []}], - } - ] - report = self.agent._format_summary({}, pip_data) - assert "none" in report - - def test_non_vulnerable_pkg_not_in_report(self): - pip_data = [{"name": "safe", "version": "1.0", "vulns": []}] - report = self.agent._format_summary({}, pip_data) - assert "safe==" not in report - - def test_bandit_truncates_at_20_results(self): - results = [ - { - "issue_severity": "LOW", - "issue_confidence": "LOW", - "issue_text": f"issue {i}", - "filename": "f.py", - "line_number": i, - } - for i in range(25) - ] - report = self.agent._format_summary({"results": results, "metrics": {}}, []) - assert "issue 19" in report - assert "issue 20" not in report - - -class TestScanRepo: - def setup_method(self): - self.agent = _make_agent() - - def test_creates_issue_when_no_issue_number(self): - mock_issue = MagicMock() - mock_issue.number = 55 - mock_repo = MagicMock() - mock_repo.create_issue.return_value = mock_issue - self.agent.github.client.get_repo.return_value = mock_repo - - with ( - patch.object(self.agent, "_run_bandit", return_value={}), - patch.object(self.agent, "_run_pip_audit", return_value=[]), - ): - result = run(self.agent._scan_repo({"repo": "o/r", "issue_number": 0})) - assert result["created_issue"] == 55 - - def test_comments_on_existing_issue(self): - mock_issue = MagicMock() - mock_repo = MagicMock() - mock_repo.get_issue.return_value = mock_issue - self.agent.github.client.get_repo.return_value = mock_repo - - with ( - patch.object(self.agent, "_run_bandit", return_value={}), - patch.object(self.agent, "_run_pip_audit", return_value=[]), - ): - result = run(self.agent._scan_repo({"repo": "o/r", "issue_number": 7})) - mock_issue.create_comment.assert_called_once() - assert result["posted_to_issue"] == 7 - - -class TestExecuteDispatch: - def setup_method(self): - self.agent = _make_agent() - - def test_unsupported_action_raises(self): - import pytest - - with pytest.raises(ValueError, match="Unsupported action"): - run(self.agent._execute({"action": "hack"})) - - def test_scan_repo_dispatches(self): - self.agent._scan_repo = AsyncMock(return_value={"created_issue": 1}) - result = run( - self.agent._execute({"action": "scan_repo", "params": {"repo": "o/r"}}) - ) - self.agent._scan_repo.assert_called_once() - assert result["created_issue"] == 1 diff --git a/tests/unit/test_staleness_engine.py b/tests/unit/test_staleness_engine.py index 5f47706..5a735e9 100644 --- a/tests/unit/test_staleness_engine.py +++ b/tests/unit/test_staleness_engine.py @@ -2,14 +2,12 @@ from __future__ import annotations -import json -from datetime import datetime, timedelta, timezone +from datetime import UTC, datetime, timedelta from pathlib import Path -from unittest.mock import MagicMock, patch, AsyncMock +from unittest.mock import AsyncMock, MagicMock, patch import pytest - # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- @@ -41,7 +39,7 @@ def _make_pr(number=1, title="Test PR", days_old=10, html_url="http://example.co pr.number = number pr.title = title pr.html_url = html_url - pr.created_at = datetime.now(timezone.utc) - timedelta(days=days_old) + pr.created_at = datetime.now(UTC) - timedelta(days=days_old) return pr diff --git a/tests/unit/test_triage_agent.py b/tests/unit/test_triage_agent.py deleted file mode 100644 index 0745683..0000000 --- a/tests/unit/test_triage_agent.py +++ /dev/null @@ -1,236 +0,0 @@ -"""Unit tests for agents/triage_agent.py""" - -from __future__ import annotations - -import asyncio -import json -import tempfile -from pathlib import Path -from unittest.mock import AsyncMock, MagicMock, patch - - -def run(coro): - return asyncio.run(coro) - - -def _make_agent(config=None): - from agents.triage_agent import TriageAgent - - with ( - patch("core.agent_base.GitHubClient"), - patch("core.agent_base.LLMClient"), - patch("core.agent_base.AuditLogger"), - patch("core.agent_base.PolicyEngine"), - ): - agent = TriageAgent(config or {"github_token": "x"}) - agent.policy.check_action = AsyncMock(return_value={"requires_approval": False}) - agent.audit.log_action = AsyncMock() - return agent - - -class TestTriageAgentInit: - def test_name(self): - agent = _make_agent() - assert agent.name == "triage_agent" - - def test_supported_actions(self): - agent = _make_agent() - assert set(agent.get_supported_actions()) == {"triage_issue", "cost_report"} - - -class TestKeywordPriority: - def setup_method(self): - self.agent = _make_agent() - - def test_p0_critical(self): - assert self.agent._keyword_priority("critical bug") == "P0" - - def test_p0_crash(self): - assert self.agent._keyword_priority("app crash on startup") == "P0" - - def test_p0_data_loss(self): - assert self.agent._keyword_priority("data loss possible") == "P0" - - def test_p0_security(self): - assert self.agent._keyword_priority("security vulnerability") == "P0" - - def test_p0_outage(self): - assert self.agent._keyword_priority("service outage") == "P0" - - def test_p0_urgent(self): - assert self.agent._keyword_priority("urgent fix needed") == "P0" - - def test_p0_blocker(self): - assert self.agent._keyword_priority("this is a blocker") == "P0" - - def test_p1_regression(self): - assert self.agent._keyword_priority("regression in payment flow") == "P1" - - def test_p1_broken(self): - assert self.agent._keyword_priority("button is broken") == "P1" - - def test_p1_failing(self): - assert self.agent._keyword_priority("CI is failing") == "P1" - - def test_p1_high_priority(self): - assert self.agent._keyword_priority("high priority request") == "P1" - - def test_no_match_returns_none(self): - assert self.agent._keyword_priority("add dark mode support") is None - - def test_case_insensitive(self): - assert self.agent._keyword_priority("CRITICAL failure") == "P0" - - -class TestLoadCosts: - def setup_method(self): - self.agent = _make_agent() - - def test_returns_empty_when_file_missing(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - result = self.agent._load_costs(30) - assert result == [] - - def test_returns_records_within_window(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - from datetime import datetime, timedelta - - monkeypatch.setattr(mod, "project_root", tmp_path) - costs_path = tmp_path / ".llm_costs.jsonl" - recent = (datetime.now() - timedelta(days=1)).isoformat() - old = (datetime.now() - timedelta(days=60)).isoformat() - costs_path.write_text( - json.dumps({"timestamp": recent, "cost_usd": 0.5, "model": "claude"}) - + "\n" - + json.dumps({"timestamp": old, "cost_usd": 1.0, "model": "gpt4"}) - + "\n" - ) - result = self.agent._load_costs(30) - assert len(result) == 1 - assert result[0]["cost_usd"] == 0.5 - - def test_skips_blank_lines(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - (tmp_path / ".llm_costs.jsonl").write_text("\n\n\n") - assert self.agent._load_costs(30) == [] - - def test_skips_invalid_json(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - (tmp_path / ".llm_costs.jsonl").write_text("not-json\n") - assert self.agent._load_costs(30) == [] - - def test_skips_missing_timestamp_key(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - (tmp_path / ".llm_costs.jsonl").write_text(json.dumps({"cost_usd": 0.1}) + "\n") - assert self.agent._load_costs(30) == [] - - -class TestCostReport: - def setup_method(self): - self.agent = _make_agent() - - def test_no_slack_url_prints_and_returns(self, tmp_path, monkeypatch, capsys): - import agents.triage_agent as mod - from datetime import datetime, timedelta - - monkeypatch.setattr(mod, "project_root", tmp_path) - monkeypatch.delenv("SLACK_WEBHOOK_URL", raising=False) - - recent = (datetime.now() - timedelta(days=1)).isoformat() - (tmp_path / ".llm_costs.jsonl").write_text( - json.dumps( - { - "timestamp": recent, - "cost_usd": 0.25, - "input_tokens": 100, - "output_tokens": 50, - "model": "claude", - } - ) - + "\n" - ) - result = run(self.agent._cost_report({})) - assert result["total_cost_usd"] == 0.25 - assert result["records"] == 1 - assert result["slack_status"] == 0 - captured = capsys.readouterr() - assert "LLM Cost Report" in captured.out - - def test_empty_costs_returns_zero(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - - monkeypatch.setattr(mod, "project_root", tmp_path) - monkeypatch.delenv("SLACK_WEBHOOK_URL", raising=False) - result = run(self.agent._cost_report({})) - assert result["total_cost_usd"] == 0.0 - assert result["records"] == 0 - - def test_multiple_models_aggregated(self, tmp_path, monkeypatch): - import agents.triage_agent as mod - from datetime import datetime, timedelta - - monkeypatch.setattr(mod, "project_root", tmp_path) - monkeypatch.delenv("SLACK_WEBHOOK_URL", raising=False) - - recent = (datetime.now() - timedelta(hours=1)).isoformat() - lines = "\n".join( - [ - json.dumps( - { - "timestamp": recent, - "cost_usd": 0.10, - "input_tokens": 10, - "output_tokens": 5, - "model": "claude", - } - ), - json.dumps( - { - "timestamp": recent, - "cost_usd": 0.20, - "input_tokens": 20, - "output_tokens": 10, - "model": "gpt4", - } - ), - ] - ) - (tmp_path / ".llm_costs.jsonl").write_text(lines) - result = run(self.agent._cost_report({})) - assert abs(result["total_cost_usd"] - 0.30) < 0.001 - assert result["records"] == 2 - - -class TestExecuteDispatch: - def setup_method(self): - self.agent = _make_agent() - - def test_unsupported_action_raises(self): - import pytest - - with pytest.raises(ValueError, match="Unsupported action"): - run(self.agent._execute({"action": "unknown"})) - - def test_triage_issue_dispatches(self): - self.agent._triage_issue = AsyncMock(return_value={"issue": 1}) - result = run( - self.agent._execute( - {"action": "triage_issue", "params": {"repo": "o/r", "issue_number": 1}} - ) - ) - self.agent._triage_issue.assert_called_once() - assert result == {"issue": 1} - - def test_cost_report_dispatches(self): - self.agent._cost_report = AsyncMock(return_value={"records": 0}) - result = run(self.agent._execute({"action": "cost_report", "params": {}})) - self.agent._cost_report.assert_called_once() - assert result == {"records": 0}