chordia-ui 3.3.8 → 3.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/AgentLiftCard.cjs.js.map +1 -1
  2. package/dist/AgentLiftCard.es.js +5 -3
  3. package/dist/AgentLiftCard.es.js.map +1 -1
  4. package/dist/CustomFilterChips.cjs.js.map +1 -1
  5. package/dist/CustomFilterChips.es.js +2 -1
  6. package/dist/CustomFilterChips.es.js.map +1 -1
  7. package/dist/FileUploadingState.cjs.js.map +1 -1
  8. package/dist/FileUploadingState.es.js +16 -10
  9. package/dist/FileUploadingState.es.js.map +1 -1
  10. package/dist/IntegrationCard.cjs.js.map +1 -1
  11. package/dist/IntegrationCard.es.js +3 -3
  12. package/dist/IntegrationCard.es.js.map +1 -1
  13. package/dist/SectionLabel.cjs.js.map +1 -1
  14. package/dist/SectionLabel.es.js.map +1 -1
  15. package/dist/SmallButton.cjs.js.map +1 -1
  16. package/dist/SmallButton.es.js +16 -16
  17. package/dist/SmallButton.es.js.map +1 -1
  18. package/dist/SummarySection.cjs.js.map +1 -1
  19. package/dist/SummarySection.es.js +11 -9
  20. package/dist/SummarySection.es.js.map +1 -1
  21. package/dist/TextInput.cjs.js.map +1 -1
  22. package/dist/TextInput.es.js.map +1 -1
  23. package/dist/Timeline.cjs.js.map +1 -1
  24. package/dist/Timeline.es.js +14 -8
  25. package/dist/Timeline.es.js.map +1 -1
  26. package/dist/Tooltip.cjs.js +1 -1
  27. package/dist/Tooltip.cjs.js.map +1 -1
  28. package/dist/Tooltip.es.js +31 -20
  29. package/dist/Tooltip.es.js.map +1 -1
  30. package/dist/TourGuideTooltip.cjs.js.map +1 -1
  31. package/dist/TourGuideTooltip.es.js +2 -1
  32. package/dist/TourGuideTooltip.es.js.map +1 -1
  33. package/dist/UpdatedInteractionRecording.cjs.js +1 -1
  34. package/dist/UpdatedInteractionRecording.cjs.js.map +1 -1
  35. package/dist/UpdatedInteractionRecording.es.js +79 -97
  36. package/dist/UpdatedInteractionRecording.es.js.map +1 -1
  37. package/dist/UploadInteraction.cjs.js.map +1 -1
  38. package/dist/UploadInteraction.es.js.map +1 -1
  39. package/dist/colors.cjs.js +2 -0
  40. package/dist/colors.cjs.js.map +1 -0
  41. package/dist/colors.es.js +2 -0
  42. package/dist/colors.es.js.map +1 -0
  43. package/dist/components/UpdatedInteractionDetails.cjs.js +10 -1
  44. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  45. package/dist/components/UpdatedInteractionDetails.es.js +1531 -9
  46. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  47. package/dist/components/chat.cjs.js +30 -1
  48. package/dist/components/chat.cjs.js.map +1 -1
  49. package/dist/components/chat.es.js +2222 -7
  50. package/dist/components/chat.es.js.map +1 -1
  51. package/dist/components/common.cjs.js +1 -1
  52. package/dist/components/common.es.js +32 -25
  53. package/dist/components/common.es.js.map +1 -1
  54. package/dist/components/data.cjs.js +1 -1
  55. package/dist/components/data.cjs.js.map +1 -1
  56. package/dist/components/data.es.js +1033 -4
  57. package/dist/components/data.es.js.map +1 -1
  58. package/dist/components/layout.cjs.js +3 -1
  59. package/dist/components/layout.cjs.js.map +1 -1
  60. package/dist/components/layout.es.js +1533 -8
  61. package/dist/components/layout.es.js.map +1 -1
  62. package/dist/components/login.cjs.js +1 -1
  63. package/dist/components/login.es.js +6 -2
  64. package/dist/components/login.es.js.map +1 -1
  65. package/dist/components/media.cjs.js +1 -1
  66. package/dist/components/media.cjs.js.map +1 -1
  67. package/dist/components/media.es.js +220 -6
  68. package/dist/components/media.es.js.map +1 -1
  69. package/dist/components/models.cjs.js +1 -1
  70. package/dist/components/models.cjs.js.map +1 -1
  71. package/dist/components/models.es.js +91 -2
  72. package/dist/components/models.es.js.map +1 -1
  73. package/dist/components/navigation.cjs.js +1 -1
  74. package/dist/components/navigation.cjs.js.map +1 -1
  75. package/dist/components/navigation.es.js +766 -7
  76. package/dist/components/navigation.es.js.map +1 -1
  77. package/dist/components/notifications.cjs.js +1 -1
  78. package/dist/components/notifications.cjs.js.map +1 -1
  79. package/dist/components/notifications.es.js +368 -3
  80. package/dist/components/notifications.es.js.map +1 -1
  81. package/dist/components/onboarding.cjs.js +1 -1
  82. package/dist/components/onboarding.cjs.js.map +1 -1
  83. package/dist/components/onboarding.es.js +985 -7
  84. package/dist/components/onboarding.es.js.map +1 -1
  85. package/dist/components/primitives.cjs.js +1 -1
  86. package/dist/components/primitives.cjs.js.map +1 -1
  87. package/dist/components/primitives.es.js +635 -25
  88. package/dist/components/primitives.es.js.map +1 -1
  89. package/dist/debugger-wc.cjs.js +4 -4
  90. package/dist/debugger-wc.cjs.js.map +1 -1
  91. package/dist/debugger-wc.es.js +15 -11
  92. package/dist/debugger-wc.es.js.map +1 -1
  93. package/dist/index.cjs.js +1 -1
  94. package/dist/index.cjs2.js +2 -49
  95. package/dist/index.cjs2.js.map +1 -1
  96. package/dist/index.cjs3.js +50 -0
  97. package/dist/index.cjs3.js.map +1 -0
  98. package/dist/index.es.js +104 -99
  99. package/dist/index.es.js.map +1 -1
  100. package/dist/index.es2.js +2632 -1776
  101. package/dist/index.es2.js.map +1 -1
  102. package/dist/index.es3.js +1944 -0
  103. package/dist/index.es3.js.map +1 -0
  104. package/dist/pages/interactionDetails.cjs.js +1 -1
  105. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  106. package/dist/pages/interactionDetails.es.js +70 -47
  107. package/dist/pages/interactionDetails.es.js.map +1 -1
  108. package/dist/sortable.esm.cjs.js +1 -1
  109. package/dist/sortable.esm.cjs.js.map +1 -1
  110. package/dist/sortable.esm.es.js +55 -53
  111. package/dist/sortable.esm.es.js.map +1 -1
  112. package/dist/{chordia-ui.css → style.css} +1 -1
  113. package/package.json +1 -1
  114. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +318 -77
  115. package/src/components/UpdatedInteractionDetails/UpdatedInteractionRecording.jsx +7 -17
  116. package/dist/ChartRenderer.cjs.js +0 -31
  117. package/dist/ChartRenderer.cjs.js.map +0 -1
  118. package/dist/ChartRenderer.es.js +0 -2210
  119. package/dist/ChartRenderer.es.js.map +0 -1
  120. package/dist/GettingStarted.cjs.js +0 -2
  121. package/dist/GettingStarted.cjs.js.map +0 -1
  122. package/dist/GettingStarted.es.js +0 -983
  123. package/dist/GettingStarted.es.js.map +0 -1
  124. package/dist/InlineConfirm.cjs.js +0 -2
  125. package/dist/InlineConfirm.cjs.js.map +0 -1
  126. package/dist/InlineConfirm.es.js +0 -618
  127. package/dist/InlineConfirm.es.js.map +0 -1
  128. package/dist/InteractionSummaryCard.cjs.js +0 -2
  129. package/dist/InteractionSummaryCard.cjs.js.map +0 -1
  130. package/dist/InteractionSummaryCard.es.js +0 -216
  131. package/dist/InteractionSummaryCard.es.js.map +0 -1
  132. package/dist/LoginPage.cjs.js +0 -3
  133. package/dist/LoginPage.cjs.js.map +0 -1
  134. package/dist/LoginPage.es.js +0 -2618
  135. package/dist/LoginPage.es.js.map +0 -1
  136. package/dist/NavigationBar.cjs.js +0 -2
  137. package/dist/NavigationBar.cjs.js.map +0 -1
  138. package/dist/NavigationBar.es.js +0 -762
  139. package/dist/NavigationBar.es.js.map +0 -1
  140. package/dist/NotificationPanel.cjs.js +0 -2
  141. package/dist/NotificationPanel.cjs.js.map +0 -1
  142. package/dist/NotificationPanel.es.js +0 -371
  143. package/dist/NotificationPanel.es.js.map +0 -1
  144. package/dist/OverlayPanel.cjs.js +0 -2
  145. package/dist/OverlayPanel.cjs.js.map +0 -1
  146. package/dist/OverlayPanel.es.js +0 -93
  147. package/dist/OverlayPanel.es.js.map +0 -1
  148. package/dist/SplitPane.cjs.js +0 -4
  149. package/dist/SplitPane.cjs.js.map +0 -1
  150. package/dist/SplitPane.es.js +0 -1531
  151. package/dist/SplitPane.es.js.map +0 -1
  152. package/dist/SummaryStatsPanel.cjs.js +0 -2
  153. package/dist/SummaryStatsPanel.cjs.js.map +0 -1
  154. package/dist/SummaryStatsPanel.es.js +0 -1027
  155. package/dist/SummaryStatsPanel.es.js.map +0 -1
  156. package/dist/UpdatedInteractionDetails.cjs.js +0 -11
  157. package/dist/UpdatedInteractionDetails.cjs.js.map +0 -1
  158. package/dist/UpdatedInteractionDetails.es.js +0 -1310
  159. package/dist/UpdatedInteractionDetails.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.es.js","sources":["../src/components/media/ConversationTurn.jsx","../src/components/media/TranscriptCard.jsx","../src/components/media/Timeline.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect } from \"react\";\n\n/**\n * Actor configuration — rail color + subtle card tint per role.\n * Colors reference CSS custom properties from the Chordia design system.\n */\nconst ACTOR_DEFAULTS = {\n customer: {\n label: \"Customer\",\n railColor: \"var(--rail-discovery)\",\n cardBg: \"var(--card-customer)\",\n cardBgHighlight: \"rgba(94, 136, 176, 0.12)\",\n borderColor: \"var(--border-subtle)\",\n },\n agent: {\n label: \"Agent\",\n railColor: \"var(--rail-outcome)\",\n cardBg: \"var(--card-agent)\",\n cardBgHighlight: \"rgba(107, 124, 147, 0.10)\",\n borderColor: \"var(--border-subtle)\",\n },\n assistant: {\n label: \"AI Assistant\",\n railColor: \"var(--rail-purple)\",\n cardBg: \"var(--card-assistant)\",\n cardBgHighlight: \"rgba(155, 122, 168, 0.10)\",\n borderColor: \"var(--border-subtle)\",\n },\n system: {\n label: \"System\",\n railColor: \"var(--text-faint)\",\n cardBg: \"transparent\",\n cardBgHighlight: \"transparent\",\n borderColor: \"transparent\",\n },\n};\n\n/**\n * ConversationTurn Component\n * Displays a single turn in a live conversation stream.\n * Uses the TranscriptCard design language: left actor rail, uppercase label,\n * subtle per-actor card tinting.\n *\n * @param {Object} props\n * @param {string} props.role - \"customer\" | \"agent\" | \"assistant\" | \"system\"\n * @param {string} props.text - Message content\n * @param {string} [props.actorLabel] - Override the default actor label\n * @param {string} [props.actorRailColor] - Override the rail color for this turn\n * @param {string} [props.actionKicker] - NBA action label above message\n * @param {Array} [props.toolBadges] - [{name, success, pending}] tool call results\n * @param {boolean} [props.streaming] - Whether this message is actively streaming\n * @param {string} [props.meta] - Timing info, turn number, etc.\n * @param {string} [props.timeRange] - Time range label (e.g., \"00:03–00:07\")\n * @param {boolean} [props.isHighlighted] - Extra emphasis on this turn\n * @param {string} [props.highlightRailColor] - Color for the right highlight rail (when highlighted)\n * @param {React.ReactNode} [props.children] - Additional content below the message text\n */\nconst KEYFRAMES_ID = \"conversation-turn-keyframes\";\nfunction ensureKeyframes() {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(KEYFRAMES_ID)) return;\n const style = document.createElement(\"style\");\n style.id = KEYFRAMES_ID;\n style.textContent = `\n @keyframes turn-playing-pulse {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 0.9; }\n }\n `;\n document.head.appendChild(style);\n}\n\nexport default function ConversationTurn({\n role = \"agent\",\n text,\n actorLabel,\n actorRailColor,\n actionKicker,\n toolBadges,\n streaming = false,\n meta,\n timeRange,\n isHighlighted = false,\n highlightRailColor,\n observations,\n onObservationClick,\n children,\n}) {\n useEffect(() => { ensureKeyframes(); }, []);\n const actor = ACTOR_DEFAULTS[role] || ACTOR_DEFAULTS.agent;\n const label = actorLabel || actor.label;\n const railColor = actorRailColor || actor.railColor;\n const highlighted = isHighlighted || streaming;\n\n // System messages: minimal centered text, no card\n if (role === \"system\") {\n return (\n <div\n style={{\n textAlign: \"center\",\n padding: \"6px 0\",\n flexShrink: 0,\n fontSize: \"var(--text-sm, 11px)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n fontWeight: 500,\n letterSpacing: \"0.02em\",\n }}\n >\n {text}\n </div>\n );\n }\n\n return (\n <div\n style={{\n position: \"relative\",\n padding: \"10px 14px 10px 18px\",\n borderRadius: 10,\n overflow: \"hidden\",\n flexShrink: 0,\n background: highlighted ? actor.cardBgHighlight : actor.cardBg,\n border: `1px solid ${streaming ? railColor : actor.borderColor}`,\n boxShadow: streaming\n ? `0 0 8px ${actor.cardBgHighlight}`\n : \"none\",\n transition: \"background 0.2s, border-color 0.2s, box-shadow 0.2s\",\n }}\n >\n {/* Left actor rail */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: \"var(--rail-width-thin, 4px)\",\n backgroundColor: railColor,\n borderRadius: \"10px 0 0 10px\",\n }}\n />\n\n {/* Header row: actor label left, tool badges right */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n gap: 8,\n marginBottom: 4,\n }}\n >\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n {/* Action kicker (NBA label) */}\n {actionKicker ? (\n <div\n style={{\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n fontWeight: 650,\n textTransform: \"uppercase\",\n letterSpacing: \"var(--tracking-label, 0.16em)\",\n color: railColor,\n }}\n >\n {actionKicker}\n </div>\n ) : null}\n\n {/* Actor label */}\n <div\n style={{\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n fontWeight: 650,\n textTransform: \"uppercase\",\n letterSpacing: \"var(--tracking-label, 0.16em)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n }}\n >\n {label}\n </div>\n </div>\n\n {/* Tool badges — top right pills, uniform neutral with status dot */}\n {toolBadges && toolBadges.length > 0 ? (\n <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 4, flexShrink: 0, justifyContent: \"flex-end\" }}>\n {toolBadges.map((t, i) => {\n const isPending = t.pending;\n const isError = !isPending && t.success === false;\n // Dot color only — rail colors for categorization, not judgment\n const dotColor = isPending\n ? \"var(--rail-discovery, #5E88B0)\"\n : isError\n ? \"var(--rail-compliance, #C98A5A)\"\n : \"var(--text-xfaint, rgba(30,33,37,0.28))\";\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 5,\n fontSize: \"var(--text-xs, 10px)\",\n padding: \"2px 8px 2px 6px\",\n borderRadius: 999,\n background: \"var(--paper, rgba(255,255,255,0.78))\",\n border: \"1px solid var(--border-subtle, rgba(52,58,64,0.08))\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n fontWeight: 500,\n fontFamily: \"var(--font-fira-code, var(--font-mono, monospace))\",\n letterSpacing: \"0.01em\",\n lineHeight: 1.4,\n whiteSpace: \"nowrap\",\n }}\n >\n <span\n style={{\n width: 5,\n height: 5,\n borderRadius: \"50%\",\n backgroundColor: dotColor,\n flexShrink: 0,\n }}\n />\n {t.name}\n </span>\n );\n })}\n </div>\n ) : null}\n </div>\n\n {/* Message text */}\n <div\n style={{\n fontSize: \"var(--text-md, 13px)\",\n lineHeight: \"var(--leading-normal, 1.5)\",\n color: streaming\n ? \"var(--text-strong, rgba(30,33,37,0.92))\"\n : \"var(--text-base, rgba(30,33,37,0.78))\",\n fontWeight: streaming ? 550 : 400,\n }}\n >\n {text}\n {streaming ? (\n <span\n style={{\n display: \"inline-block\",\n width: 6,\n height: 14,\n background: railColor,\n marginLeft: 2,\n borderRadius: 1,\n animation: \"cursorBlink 0.8s ease-in-out infinite\",\n verticalAlign: \"text-bottom\",\n }}\n />\n ) : null}\n </div>\n\n {/* Time range + play button + observation pills — single row */}\n {timeRange || children || (observations && observations.length > 0) ? (\n <div style={{ marginTop: 6, display: \"flex\", alignItems: \"center\", gap: 6 }}>\n {children}\n {timeRange ? (\n <span\n style={{\n fontSize: \"var(--text-sm, 11px)\",\n padding: \"2px 8px\",\n borderRadius: 999,\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n background: \"var(--timestamp-bg, rgba(255,255,255,0.70))\",\n color: \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontFamily: \"var(--font-mono, monospace)\",\n }}\n >\n {timeRange}\n </span>\n ) : null}\n {observations && observations.length > 0 ? (\n <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 4, marginLeft: \"auto\" }}>\n {observations.map((obs, i) => (\n <span\n key={i}\n onClick={obs.onClick || (onObservationClick ? () => onObservationClick(obs) : undefined)}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n fontSize: \"var(--text-xs, 10px)\",\n padding: \"2px 8px\",\n borderRadius: 999,\n background: `color-mix(in srgb, ${obs.color || \"var(--state-present)\"} 12%, transparent)`,\n border: `1px solid color-mix(in srgb, ${obs.color || \"var(--state-present)\"} 25%, transparent)`,\n color: obs.color || \"var(--state-present)\",\n fontWeight: 550,\n lineHeight: 1.4,\n whiteSpace: \"nowrap\",\n cursor: obs.onClick || onObservationClick ? \"pointer\" : \"default\",\n transition: \"background 0.15s\",\n }}\n title={obs.reason || obs.label}\n >\n <span style={{\n width: 4, height: 4, borderRadius: \"50%\",\n backgroundColor: obs.color || \"var(--state-present)\",\n flexShrink: 0, opacity: 0.7,\n }} />\n {obs.label}\n </span>\n ))}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {/* Meta / timestamp */}\n {meta ? (\n <div\n style={{\n marginTop: 6,\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n fontFamily: \"var(--font-mono, monospace)\",\n }}\n >\n {meta}\n </div>\n ) : null}\n\n {/* Right highlight rail (used by TranscriptCard for active/highlighted turns) */}\n {highlighted && highlightRailColor ? (\n <div\n style={{\n position: \"absolute\",\n right: 8,\n top: 8,\n bottom: 8,\n width: 6,\n borderRadius: 4,\n backgroundColor: highlightRailColor,\n opacity: 0.7,\n animation: \"turn-playing-pulse 1.5s ease-in-out infinite\",\n }}\n />\n ) : null}\n </div>\n );\n}\n","\"use client\";\n\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { Play, Pause } from \"lucide-react\";\nimport ConversationTurn from \"./ConversationTurn\";\n\n/**\n * Helper function to parse time range string (e.g., \"00:03–00:07\") to seconds\n */\nconst parseTimeRange = (timeRange) => {\n const [start, end] = timeRange.split(\"–\").map((time) => {\n const [minutes, seconds] = time.split(\":\").map(Number);\n return minutes * 60 + seconds;\n });\n return { start, end };\n};\n\n/**\n * Map TranscriptCard actorType values to ConversationTurn role values.\n * ConversationTurn uses: \"customer\" | \"agent\" | \"assistant\" | \"system\"\n * TranscriptCard uses: \"customer\" | \"agent\" | \"third_party\" | \"system\"\n */\nconst mapActorTypeToRole = (actorType) => {\n const map = {\n customer: \"customer\",\n agent: \"agent\",\n third_party: \"agent\",\n system: \"system\",\n assistant: \"assistant\",\n };\n return map[actorType] || \"agent\";\n};\n\n/**\n * TranscriptCard Component\n * Displays a complete transcript with multiple turns, audio playback,\n * highlighting, and per-turn play buttons. Composes ConversationTurn\n * for individual turn rendering.\n *\n * @param {Object} props - Component props\n * @param {Array} props.turns - Array of transcript turn objects\n * @param {string} props.turns[].actor - Display name (e.g., \"Agent\", \"Customer\")\n * @param {string} props.turns[].actorType - \"agent\" | \"customer\" | \"third_party\" | \"system\" | \"assistant\"\n * @param {string} [props.turns[].actorColor] - Override rail color for this turn\n * @param {string} props.turns[].text - Transcript text\n * @param {string} [props.turns[].timeRange] - Time range (e.g., \"00:03–00:07\")\n * @param {boolean} [props.turns[].isHighlighted] - Whether this turn is highlighted\n * @param {string} [props.turns[].highlightColor] - Color for the right highlight rail\n * @param {Array} [props.turns[].toolBadges] - Tool badge data [{name, success, pending}]\n * @param {string} [props.audioUrl] - Audio URL for segment playback\n * @param {number} [props.activeTurnIndex=-1] - Index of the externally active turn\n * @param {boolean} [props.autoScrollActiveTurn=false] - Auto-scroll to active turn\n * @param {boolean} [props.isExternalPlaying=false] - External playback state\n * @param {Function} [props.onTurnPlayPause] - External playback handler (turn, index) => void\n */\nexport default function TranscriptCard({\n turns,\n audioUrl,\n activeTurnIndex = -1,\n autoScrollActiveTurn = false,\n isExternalPlaying = false,\n onTurnPlayPause,\n}) {\n const [playingSegment, setPlayingSegment] = useState(null);\n const [isPlaying, setIsPlaying] = useState(false);\n const audioRef = useRef(null);\n const endTimeListenerRef = useRef(null);\n const turnRefs = useRef([]);\n const containerRef = useRef(null);\n const lastAutoScrolledIndexRef = useRef(-1);\n const useExternalPlaybackControl = typeof onTurnPlayPause === \"function\";\n const hasExternalPlaybackState = isExternalPlaying !== undefined;\n\n // Initialize audio element\n useEffect(() => {\n if (audioUrl) {\n audioRef.current = new Audio(audioUrl);\n audioRef.current.preload = \"auto\";\n return () => {\n if (audioRef.current) {\n audioRef.current.pause();\n audioRef.current = null;\n }\n };\n }\n }, [audioUrl]);\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n if (audioRef.current) {\n audioRef.current.pause();\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n }\n }\n };\n }, []);\n\n // Auto-scroll to active turn\n useEffect(() => {\n if (!autoScrollActiveTurn || activeTurnIndex < 0) return;\n const container = containerRef.current;\n const activeNode = turnRefs.current[activeTurnIndex];\n if (!activeNode || !container) return;\n\n const containerRect = container.getBoundingClientRect();\n const activeRect = activeNode.getBoundingClientRect();\n const topPadding = 12;\n const isFullyVisible =\n activeRect.top >= containerRect.top + topPadding &&\n activeRect.bottom <= containerRect.bottom - 8;\n const didScrollForThisTurn = lastAutoScrolledIndexRef.current === activeTurnIndex;\n\n if (!didScrollForThisTurn || !isFullyVisible) {\n const activeTopInContainer = activeRect.top - containerRect.top + container.scrollTop;\n container.scrollTop = Math.max(activeTopInContainer - topPadding, 0);\n }\n lastAutoScrolledIndexRef.current = activeTurnIndex;\n }, [activeTurnIndex, autoScrollActiveTurn]);\n\n const handlePlayPause = (timeRange, index) => {\n if (useExternalPlaybackControl) {\n onTurnPlayPause(turns[index], index);\n return;\n }\n\n if (playingSegment === index && isPlaying) {\n // Pause current segment\n if (audioRef.current) {\n audioRef.current.pause();\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n endTimeListenerRef.current = null;\n }\n }\n setIsPlaying(false);\n } else {\n // Start/switch segment\n const previousSegment = playingSegment;\n setPlayingSegment(index);\n\n if (audioUrl && audioRef.current) {\n const { start, end } = parseTimeRange(timeRange);\n\n if (previousSegment !== null && previousSegment !== index) {\n audioRef.current.pause();\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n endTimeListenerRef.current = null;\n }\n }\n\n const playSegment = () => {\n if (!audioRef.current) return;\n audioRef.current.currentTime = start;\n\n if (end) {\n const checkEndTime = () => {\n if (audioRef.current && audioRef.current.currentTime >= end) {\n audioRef.current.pause();\n setIsPlaying(false);\n setPlayingSegment(null);\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n endTimeListenerRef.current = null;\n }\n }\n };\n endTimeListenerRef.current = checkEndTime;\n audioRef.current.addEventListener(\"timeupdate\", checkEndTime);\n }\n\n audioRef.current.play()\n .then(() => setIsPlaying(true))\n .catch((err) => {\n // Ignore AbortError which occurs when play() is interrupted by pause()\n if (err && err.name === \"AbortError\") {\n return;\n }\n setIsPlaying(false);\n setPlayingSegment(null);\n });\n };\n\n if (audioRef.current.readyState >= 2) {\n playSegment();\n } else {\n audioRef.current.addEventListener(\"loadedmetadata\", playSegment, { once: true });\n audioRef.current.load();\n }\n } else {\n setIsPlaying(true);\n }\n }\n };\n\n return (\n <div\n ref={containerRef}\n className=\"custom-thin-scrollbar-library\"\n style={{\n maxHeight: 560,\n overflowY: \"auto\",\n scrollBehavior: \"smooth\",\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n // borderRadius: \"var(--radius-lg, 12px)\",\n borderRadius: \"12px 0px 0px 12px\",\n background: \"var(--paper-elevated, rgba(255,255,255,0.82))\",\n padding: 16,\n }}\n >\n {/* Section label */}\n <div\n style={{\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n fontWeight: 650,\n textTransform: \"uppercase\",\n letterSpacing: \"var(--tracking-label, 0.16em)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n marginBottom: 12,\n }}\n >\n Transcript\n </div>\n\n {/* Turns */}\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 8 }}>\n {turns.map((turn, index) => {\n const isTurnPlaying = (useExternalPlaybackControl || hasExternalPlaybackState)\n ? Boolean(isExternalPlaying) && activeTurnIndex === index\n : playingSegment === index && isPlaying;\n const isTurnHighlighted = Boolean(turn.isHighlighted) || isTurnPlaying;\n const role = mapActorTypeToRole(turn.actorType);\n\n return (\n <div\n key={index}\n ref={(el) => { turnRefs.current[index] = el; }}\n >\n <ConversationTurn\n role={role}\n text={turn.text}\n actorLabel={turn.actor}\n actorRailColor={turn.actorColor}\n timeRange={turn.timeRange}\n isHighlighted={isTurnHighlighted}\n highlightRailColor={isTurnPlaying \n ? (turn.highlightColor || (role === 'agent' ? 'var(--rail-outcome)' : 'var(--rail-discovery)'))\n : turn.highlightColor}\n toolBadges={turn.toolBadges}\n observations={turn.observations}\n onObservationClick={turn.onObservationClick}\n >\n {/* Play/pause button — rendered inline left of time range */}\n {turn.timeRange ? (\n <button\n onClick={() => handlePlayPause(turn.timeRange, index)}\n style={{\n width: 24,\n height: 24,\n borderRadius: \"50%\",\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n background: isTurnPlaying\n ? \"var(--rail-discovery, #5E88B0)\"\n : \"var(--paper, rgba(255,255,255,0.78))\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n padding: 0,\n transition: \"all 0.15s\",\n }}\n aria-label={isTurnPlaying ? `Pause segment ${turn.timeRange}` : `Play segment ${turn.timeRange}`}\n >\n {isTurnPlaying ? (\n <Pause\n style={{ width: 12, height: 12, color: \"var(--paper, #fff)\", fill: \"var(--paper, #fff)\" }}\n strokeWidth={0}\n />\n ) : (\n <Play\n style={{ width: 12, height: 12, color: \"var(--text-muted, rgba(30,33,37,0.56))\", fill: \"var(--text-muted, rgba(30,33,37,0.56))\", marginLeft: 1 }}\n strokeWidth={0}\n />\n )}\n </button>\n ) : null}\n </ConversationTurn>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { useEffect, useMemo, useState } from \"react\";\nimport { Play, Pause, RotateCcw, RotateCw } from \"lucide-react\";\n\nexport default function Timeline({\n segments = [],\n durationSeconds = 0,\n actorRows = [],\n currentTimeSeconds = 0,\n onSeek,\n showControls = false,\n hasRecording = false,\n timelinePlaying = false,\n playbackRate = 1,\n speedOptions = [1, 1.25, 1.5, 2],\n onTogglePlay,\n onSeekBack,\n onSeekForward,\n onSetPlaybackRate,\n totalDurationLabel,\n}) {\n const [activeControl, setActiveControl] = useState(null);\n\n useEffect(() => {\n if (!activeControl) return;\n const timer = setTimeout(() => setActiveControl(null), 220);\n return () => clearTimeout(timer);\n }, [activeControl]);\n\n const timelineDuration = Math.max(\n Number(durationSeconds) || 0,\n ...segments.map((segment) => Number(segment.endTime) || 0),\n 1\n );\n const clampedCurrent = Math.max(0, Math.min(Number(currentTimeSeconds) || 0, timelineDuration));\n const playheadPercent = timelineDuration > 0 ? (clampedCurrent / timelineDuration) * 100 : 0;\n const playheadLeft = `calc(${playheadPercent}% + ${(5 * (1 - playheadPercent / 100)).toFixed(4)}rem)`;\n\n const formatTime = (seconds) => {\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins.toString().padStart(2, \"0\")}:${secs.toString().padStart(2, \"0\")}`;\n };\n\n const rows = useMemo(() => {\n if (actorRows.length) {\n return actorRows.map((actor) => ({\n ...actor,\n segments: segments.filter((segment) => segment.actor === actor.key),\n }));\n }\n const actors = Array.from(new Set(segments.map((segment) => segment.actor)));\n const actorColors = new Map(segments.map((segment) => [segment.actor, segment.actorColor]));\n return actors.map((actor) => ({\n key: actor,\n label: actor,\n color: actorColors.get(actor) || \"#6B7C93\",\n segments: segments.filter((segment) => segment.actor === actor),\n }));\n }, [actorRows, segments]);\n\n const timeMarkers = [];\n const interval = 120;\n for (let marker = 0; marker <= timelineDuration; marker += interval) {\n timeMarkers.push(marker);\n }\n if (!timeMarkers.length || timeMarkers[timeMarkers.length - 1] < timelineDuration) {\n timeMarkers.push(timelineDuration);\n }\n\n const handleSeekClick = (event) => {\n if (!onSeek) return;\n const rect = event.currentTarget.getBoundingClientRect();\n if (!rect.width) return;\n const ratio = Math.max(0, Math.min((event.clientX - rect.left) / rect.width, 1));\n onSeek(ratio * timelineDuration);\n };\n\n return (\n <div style={{\n padding: \"10px 0\",\n }}>\n {showControls && (\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", marginBottom: 8 }}>\n <div style={{\n fontSize: \"var(--text-sm, 11px)\",\n fontFamily: \"var(--font-mono, monospace)\",\n color: \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontWeight: 500,\n minWidth: 70,\n }}>\n {formatTime(clampedCurrent)} <span style={{ color: \"var(--text-faint, rgba(30,33,37,0.36))\" }}>/ {formatTime(timelineDuration)}</span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 6 }}>\n <button\n type=\"button\"\n onClick={() => { setActiveControl(\"rewind\"); onSeekBack?.(); }}\n disabled={!hasRecording}\n title=\"Rewind 15s\"\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n width: 28, height: 28, borderRadius: \"50%\",\n border: `1px solid ${activeControl === \"rewind\" ? \"var(--rail-discovery, #5E88B0)\" : \"var(--border, rgba(52,58,64,0.12))\"}`,\n background: \"var(--paper, rgba(255,255,255,0.78))\", cursor: \"pointer\", padding: 0,\n }}\n >\n <RotateCcw size={13} stroke=\"var(--rail-discovery, #5E88B0)\" />\n </button>\n\n <button\n type=\"button\"\n onClick={onTogglePlay}\n disabled={!hasRecording}\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n width: 32, height: 32, borderRadius: \"50%\",\n background: \"var(--rail-discovery, #5E88B0)\", color: \"#fff\",\n border: \"none\", cursor: \"pointer\", padding: 0,\n }}\n aria-label={timelinePlaying ? \"Pause recording\" : \"Play recording\"}\n >\n {timelinePlaying ? <Pause size={14} /> : <Play size={14} style={{ marginLeft: 1 }} />}\n </button>\n\n <button\n type=\"button\"\n onClick={() => { setActiveControl(\"forward\"); onSeekForward?.(); }}\n disabled={!hasRecording}\n title=\"Forward 15s\"\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n width: 28, height: 28, borderRadius: \"50%\",\n border: `1px solid ${activeControl === \"forward\" ? \"var(--rail-discovery, #5E88B0)\" : \"var(--border, rgba(52,58,64,0.12))\"}`,\n background: \"var(--paper, rgba(255,255,255,0.78))\", cursor: \"pointer\", padding: 0,\n }}\n >\n <RotateCw size={13} stroke=\"var(--rail-discovery, #5E88B0)\" />\n </button>\n\n <div style={{ display: \"inline-flex\", alignItems: \"center\", gap: 4, borderRadius: 999, border: \"1px solid var(--border, rgba(52,58,64,0.12))\", padding: \"2px 3px\", background: \"var(--paper, rgba(255,255,255,0.78))\", marginLeft: 4 }}>\n {speedOptions.map((speed) => {\n const isActive = playbackRate === speed;\n return (\n <button\n key={speed}\n type=\"button\"\n onClick={() => onSetPlaybackRate?.(speed)}\n disabled={!hasRecording}\n title={`Speed: ${speed}x`}\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n height: 24, minWidth: 38, padding: \"0 6px\", borderRadius: 999,\n border: `1px solid ${isActive ? \"var(--rail-discovery, #5E88B0)\" : \"transparent\"}`,\n background: isActive ? \"var(--rail-discovery, #5E88B0)\" : \"transparent\",\n color: isActive ? \"#fff\" : \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontSize: \"var(--text-xs, 10px)\", fontWeight: 600, cursor: \"pointer\",\n }}\n >\n {speed === 1.5 ? \"1.50x\" : `${speed}x`}\n </button>\n );\n })}\n </div>\n </div>\n </div>\n )}\n\n <div style={{\n background: \"var(--paper, rgba(255,255,255,0.78))\",\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n borderRadius: 10,\n padding: \"12px 16px 10px\",\n }}>\n <div style={{ position: \"relative\" }}>\n {/* Time markers row */}\n <div style={{ display: \"flex\", alignItems: \"center\", marginBottom: 6, height: 16 }}>\n <div style={{ width: \"5rem\", flexShrink: 0 }} />\n <div style={{ position: \"relative\", flex: 1 }}>\n {timeMarkers.map((time) => {\n const percentage = timelineDuration > 0 ? (time / timelineDuration) * 100 : 0;\n return (\n <div\n key={time}\n style={{\n position: \"absolute\",\n fontSize: \"var(--text-xs, 10px)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n left: `${percentage}%`,\n transform: \"translateX(-50%)\",\n fontFamily: \"var(--font-mono, monospace)\",\n whiteSpace: \"nowrap\",\n }}\n >\n {formatTime(time)}\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Vertical gridlines */}\n <div\n style={{\n position: \"absolute\",\n pointerEvents: \"none\",\n top: 0,\n bottom: 0,\n left: \"5rem\",\n width: \"calc(100% - 5rem)\",\n zIndex: 20,\n }}\n >\n {timeMarkers.map((time) => {\n const percentage = timelineDuration > 0 ? (time / timelineDuration) * 100 : 0;\n return (\n <div\n key={time}\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: `${percentage}%`,\n borderLeft: \"1px dashed var(--border, rgba(52,58,64,0.12))\",\n transform: \"translateX(-1px)\",\n }}\n />\n );\n })}\n </div>\n\n {/* Swim lanes */}\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10, marginTop: 8 }}>\n {rows.map((row) => {\n const isSystem = row.key === \"system\" || row.label === \"System\";\n return (\n <div key={row.key} style={{ display: \"flex\", alignItems: \"center\" }}>\n <div\n style={{\n width: \"5rem\",\n flexShrink: 0,\n fontSize: \"var(--text-sm, 11px)\",\n fontWeight: 600,\n color: \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontFamily: \"var(--font-sans, system-ui, sans-serif)\",\n paddingRight: 8,\n }}\n >\n {row.label}\n </div>\n\n <div\n style={{\n position: \"relative\",\n borderRadius: 4,\n flex: 1,\n height: 18,\n backgroundColor: \"var(--paper-secondary, rgba(244,241,230,0.6))\",\n border: \"1px solid var(--border-subtle, rgba(52,58,64,0.08))\",\n }}\n >\n {row.segments.map((segment, idx) => {\n let leftPercent = timelineDuration > 0 ? (segment.startTime / timelineDuration) * 100 : 0;\n let widthPercent =\n timelineDuration > 0\n ? ((segment.endTime - segment.startTime) / timelineDuration) * 100\n : 0;\n leftPercent = Math.max(0, Math.min(100, leftPercent));\n const rightPercent = leftPercent + widthPercent;\n if (rightPercent > 100) widthPercent = 100 - leftPercent;\n widthPercent = Math.max(0, widthPercent);\n const segmentDuration = segment.endTime - segment.startTime;\n\n if (isSystem && segmentDuration <= 5) {\n return (\n <div\n key={idx}\n style={{\n position: \"absolute\",\n cursor: \"pointer\",\n left: `${leftPercent}%`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n backgroundColor: row.color,\n opacity: 0.85,\n }}\n title={`${row.label}: ${formatTime(segment.startTime)}-${formatTime(segment.endTime)}`}\n />\n );\n }\n\n return (\n <div\n key={idx}\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: `${leftPercent}%`,\n width: `${Math.max(widthPercent, 0.7)}%`,\n maxWidth: `${100 - leftPercent}%`,\n backgroundColor: row.color,\n opacity: 0.85,\n borderRadius: 2,\n cursor: \"pointer\",\n transition: \"opacity 0.15s\",\n }}\n title={`${row.label}: ${formatTime(segment.startTime)}-${formatTime(segment.endTime)}`}\n />\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n\n {/* Playhead */}\n <div\n style={{\n pointerEvents: \"none\",\n position: \"absolute\",\n top: 0,\n bottom: 0,\n width: 2,\n borderRadius: 1,\n backgroundColor: \"var(--rail-discovery, #5E88B0)\",\n opacity: 0.55,\n boxShadow: \"0 0 0 1px rgba(94,136,176,0.10)\",\n left: playheadLeft,\n transform: \"translateX(-50%)\",\n }}\n />\n\n {/* Seek overlay */}\n {onSeek ? (\n <button\n type=\"button\"\n onClick={handleSeekClick}\n style={{\n position: \"absolute\",\n cursor: \"pointer\",\n background: \"transparent\",\n border: \"none\",\n padding: 0,\n margin: 0,\n appearance: \"none\",\n top: 0,\n bottom: 0,\n left: \"5rem\",\n width: \"calc(100% - 5rem)\",\n zIndex: 25,\n }}\n title=\"Click timeline to play from that point\"\n aria-label=\"Click timeline to play from that point\"\n />\n ) : null}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["ACTOR_DEFAULTS","KEYFRAMES_ID","ensureKeyframes","style","ConversationTurn","role","text","actorLabel","actorRailColor","actionKicker","toolBadges","streaming","meta","timeRange","isHighlighted","highlightRailColor","observations","onObservationClick","children","useEffect","actor","label","railColor","highlighted","jsx","jsxs","t","i","isPending","isError","obs","parseTimeRange","start","end","time","minutes","seconds","mapActorTypeToRole","actorType","TranscriptCard","turns","audioUrl","activeTurnIndex","autoScrollActiveTurn","isExternalPlaying","onTurnPlayPause","playingSegment","setPlayingSegment","useState","isPlaying","setIsPlaying","audioRef","useRef","endTimeListenerRef","turnRefs","containerRef","lastAutoScrolledIndexRef","useExternalPlaybackControl","hasExternalPlaybackState","container","activeNode","containerRect","activeRect","topPadding","isFullyVisible","activeTopInContainer","handlePlayPause","index","previousSegment","playSegment","checkEndTime","err","turn","isTurnPlaying","isTurnHighlighted","el","Pause","Play","Timeline","segments","durationSeconds","actorRows","currentTimeSeconds","onSeek","showControls","hasRecording","timelinePlaying","playbackRate","speedOptions","onTogglePlay","onSeekBack","onSeekForward","onSetPlaybackRate","totalDurationLabel","activeControl","setActiveControl","timer","timelineDuration","segment","clampedCurrent","playheadPercent","playheadLeft","formatTime","mins","secs","rows","useMemo","actors","actorColors","timeMarkers","interval","marker","handleSeekClick","event","rect","ratio","RotateCcw","RotateCw","speed","isActive","percentage","row","isSystem","idx","leftPercent","widthPercent","segmentDuration"],"mappings":";;;AAQA,MAAMA,IAAiB;AAAA,EACrB,UAAU;AAAA,IACR,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,aAAa;AAAA,EAAA;AAAA,EAEf,OAAO;AAAA,IACL,OAAO;AA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ACf,UAAU;AAAA,YACV,KAAK;AAAA,YACL,QAAQ;AAAA,YACR,OAAO;AAAA,YACP,cAAc;AAAA,YACd,iBAAiB;AAAA,YACjB,SAAS;AAAA,YACT,WAAW;AAAA,YACX,MAAM6E;AAAA,YACN,WAAW;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,MAIDlB,IACC,gBAAA3D;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAASwF;AAAA,UACT,OAAO;AAAA,YACL,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,YAAY;AAAA,YACZ,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,QAAQ;AAAA,YACR,YAAY;AAAA,YACZ,KAAK;AAAA,YACL,QAAQ;AAAA,YACR,MAAM;AAAA,YACN,OAAO;AAAA,YACP,QAAQ;AAAA,UAAA;AAAA,UAEV,OAAM;AAAA,UACN,cAAW;AAAA,QAAA;AAAA,MAAA,IAEX;AAAA,IAAA,EAAA,CACN,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Timeline.es.js","sources":["../src/components/media/ConversationTurn.jsx","../src/components/media/TranscriptCard.jsx","../src/components/media/Timeline.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect } from \"react\";\n\n/**\n * Actor configuration — rail color + subtle card tint per role.\n * Colors reference CSS custom properties from the Chordia design system.\n */\nconst ACTOR_DEFAULTS = {\n customer: {\n label: \"Customer\",\n railColor: \"var(--rail-discovery)\",\n cardBg: \"var(--card-customer)\",\n cardBgHighlight: \"rgba(94, 136, 176, 0.12)\",\n borderColor: \"var(--border-subtle)\",\n },\n agent: {\n label: \"Agent\",\n railColor: \"var(--rail-outcome)\",\n cardBg: \"var(--card-agent)\",\n cardBgHighlight: \"rgba(107, 124, 147, 0.10)\",\n borderColor: \"var(--border-subtle)\",\n },\n assistant: {\n label: \"AI Assistant\",\n railColor: \"var(--rail-purple)\",\n cardBg: \"var(--card-assistant)\",\n cardBgHighlight: \"rgba(155, 122, 168, 0.10)\",\n borderColor: \"var(--border-subtle)\",\n },\n system: {\n label: \"System\",\n railColor: \"var(--text-faint)\",\n cardBg: \"transparent\",\n cardBgHighlight: \"transparent\",\n borderColor: \"transparent\",\n },\n};\n\n/**\n * ConversationTurn Component\n * Displays a single turn in a live conversation stream.\n * Uses the TranscriptCard design language: left actor rail, uppercase label,\n * subtle per-actor card tinting.\n *\n * @param {Object} props\n * @param {string} props.role - \"customer\" | \"agent\" | \"assistant\" | \"system\"\n * @param {string} props.text - Message content\n * @param {string} [props.actorLabel] - Override the default actor label\n * @param {string} [props.actorRailColor] - Override the rail color for this turn\n * @param {string} [props.actionKicker] - NBA action label above message\n * @param {Array} [props.toolBadges] - [{name, success, pending}] tool call results\n * @param {boolean} [props.streaming] - Whether this message is actively streaming\n * @param {string} [props.meta] - Timing info, turn number, etc.\n * @param {string} [props.timeRange] - Time range label (e.g., \"00:03–00:07\")\n * @param {boolean} [props.isHighlighted] - Extra emphasis on this turn\n * @param {string} [props.highlightRailColor] - Color for the right highlight rail (when highlighted)\n * @param {React.ReactNode} [props.children] - Additional content below the message text\n */\nconst KEYFRAMES_ID = \"conversation-turn-keyframes\";\nfunction ensureKeyframes() {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(KEYFRAMES_ID)) return;\n const style = document.createElement(\"style\");\n style.id = KEYFRAMES_ID;\n style.textContent = `\n @keyframes turn-playing-pulse {\n 0%, 100% { opacity: 0.4; }\n 50% { opacity: 0.9; }\n }\n `;\n document.head.appendChild(style);\n}\n\nexport default function ConversationTurn({\n role = \"agent\",\n text,\n actorLabel,\n actorRailColor,\n actionKicker,\n toolBadges,\n streaming = false,\n meta,\n timeRange,\n isHighlighted = false,\n highlightRailColor,\n observations,\n onObservationClick,\n children,\n}) {\n useEffect(() => { ensureKeyframes(); }, []);\n const actor = ACTOR_DEFAULTS[role] || ACTOR_DEFAULTS.agent;\n const label = actorLabel || actor.label;\n const railColor = actorRailColor || actor.railColor;\n const highlighted = isHighlighted || streaming;\n\n // System messages: minimal centered text, no card\n if (role === \"system\") {\n return (\n <div\n style={{\n textAlign: \"center\",\n padding: \"6px 0\",\n flexShrink: 0,\n fontSize: \"var(--text-sm, 11px)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n fontWeight: 500,\n letterSpacing: \"0.02em\",\n }}\n >\n {text}\n </div>\n );\n }\n\n return (\n <div\n style={{\n position: \"relative\",\n padding: \"10px 14px 10px 18px\",\n borderRadius: 10,\n overflow: \"hidden\",\n flexShrink: 0,\n background: highlighted ? actor.cardBgHighlight : actor.cardBg,\n border: `1px solid ${streaming ? railColor : actor.borderColor}`,\n boxShadow: streaming\n ? `0 0 8px ${actor.cardBgHighlight}`\n : \"none\",\n transition: \"background 0.2s, border-color 0.2s, box-shadow 0.2s\",\n }}\n >\n {/* Left actor rail */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: \"var(--rail-width-thin, 4px)\",\n backgroundColor: railColor,\n borderRadius: \"10px 0 0 10px\",\n }}\n />\n\n {/* Header row: actor label left, tool badges right */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n gap: 8,\n marginBottom: 4,\n }}\n >\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n {/* Action kicker (NBA label) */}\n {actionKicker ? (\n <div\n style={{\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n fontWeight: 650,\n textTransform: \"uppercase\",\n letterSpacing: \"var(--tracking-label, 0.16em)\",\n color: railColor,\n }}\n >\n {actionKicker}\n </div>\n ) : null}\n\n {/* Actor label */}\n <div\n style={{\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n fontWeight: 650,\n textTransform: \"uppercase\",\n letterSpacing: \"var(--tracking-label, 0.16em)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n }}\n >\n {label}\n </div>\n </div>\n\n {/* Tool badges — top right pills, uniform neutral with status dot */}\n {toolBadges && toolBadges.length > 0 ? (\n <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 4, flexShrink: 0, justifyContent: \"flex-end\" }}>\n {toolBadges.map((t, i) => {\n const isPending = t.pending;\n const isError = !isPending && t.success === false;\n // Dot color only — rail colors for categorization, not judgment\n const dotColor = isPending\n ? \"var(--rail-discovery, #5E88B0)\"\n : isError\n ? \"var(--rail-compliance, #C98A5A)\"\n : \"var(--text-xfaint, rgba(30,33,37,0.28))\";\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 5,\n fontSize: \"var(--text-xs, 10px)\",\n padding: \"2px 8px 2px 6px\",\n borderRadius: 999,\n background: \"var(--paper, rgba(255,255,255,0.78))\",\n border: \"1px solid var(--border-subtle, rgba(52,58,64,0.08))\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n fontWeight: 500,\n fontFamily: \"var(--font-fira-code, var(--font-mono, monospace))\",\n letterSpacing: \"0.01em\",\n lineHeight: 1.4,\n whiteSpace: \"nowrap\",\n }}\n >\n <span\n style={{\n width: 5,\n height: 5,\n borderRadius: \"50%\",\n backgroundColor: dotColor,\n flexShrink: 0,\n }}\n />\n {t.name}\n </span>\n );\n })}\n </div>\n ) : null}\n </div>\n\n {/* Message text */}\n <div\n style={{\n fontSize: \"var(--text-md, 13px)\",\n lineHeight: \"var(--leading-normal, 1.5)\",\n color: streaming\n ? \"var(--text-strong, rgba(30,33,37,0.92))\"\n : \"var(--text-base, rgba(30,33,37,0.78))\",\n fontWeight: streaming ? 550 : 400,\n }}\n >\n {text}\n {streaming ? (\n <span\n style={{\n display: \"inline-block\",\n width: 6,\n height: 14,\n background: railColor,\n marginLeft: 2,\n borderRadius: 1,\n animation: \"cursorBlink 0.8s ease-in-out infinite\",\n verticalAlign: \"text-bottom\",\n }}\n />\n ) : null}\n </div>\n\n {/* Time range + play button + observation pills — single row */}\n {timeRange || children || (observations && observations.length > 0) ? (\n <div style={{ marginTop: 6, display: \"flex\", alignItems: \"center\", gap: 6 }}>\n {children}\n {timeRange ? (\n <span\n style={{\n fontSize: \"var(--text-sm, 11px)\",\n padding: \"2px 8px\",\n borderRadius: 999,\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n background: \"var(--timestamp-bg, rgba(255,255,255,0.70))\",\n color: \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontFamily: \"var(--font-mono, monospace)\",\n }}\n >\n {timeRange}\n </span>\n ) : null}\n {observations && observations.length > 0 ? (\n <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 4, marginLeft: \"auto\" }}>\n {observations.map((obs, i) => (\n <span\n key={i}\n onClick={obs.onClick || (onObservationClick ? () => onObservationClick(obs) : undefined)}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n fontSize: \"var(--text-xs, 10px)\",\n padding: \"2px 8px\",\n borderRadius: 999,\n background: `color-mix(in srgb, ${obs.color || \"var(--state-present)\"} 12%, transparent)`,\n border: `1px solid color-mix(in srgb, ${obs.color || \"var(--state-present)\"} 25%, transparent)`,\n color: obs.color || \"var(--state-present)\",\n fontWeight: 550,\n lineHeight: 1.4,\n whiteSpace: \"nowrap\",\n cursor: obs.onClick || onObservationClick ? \"pointer\" : \"default\",\n transition: \"background 0.15s\",\n }}\n title={obs.reason || obs.label}\n >\n <span style={{\n width: 4, height: 4, borderRadius: \"50%\",\n backgroundColor: obs.color || \"var(--state-present)\",\n flexShrink: 0, opacity: 0.7,\n }} />\n {obs.label}\n </span>\n ))}\n </div>\n ) : null}\n </div>\n ) : null}\n\n {/* Meta / timestamp */}\n {meta ? (\n <div\n style={{\n marginTop: 6,\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n fontFamily: \"var(--font-mono, monospace)\",\n }}\n >\n {meta}\n </div>\n ) : null}\n\n {/* Right highlight rail (used by TranscriptCard for active/highlighted turns) */}\n {highlighted && highlightRailColor ? (\n <div\n style={{\n position: \"absolute\",\n right: 8,\n top: 8,\n bottom: 8,\n width: 6,\n borderRadius: 4,\n backgroundColor: highlightRailColor,\n opacity: 0.7,\n animation: \"turn-playing-pulse 1.5s ease-in-out infinite\",\n }}\n />\n ) : null}\n </div>\n );\n}\n","\"use client\";\n\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { Play, Pause } from \"lucide-react\";\nimport ConversationTurn from \"./ConversationTurn\";\n\n/**\n * Helper function to parse time range string (e.g., \"00:03–00:07\") to seconds\n */\nconst parseTimeRange = (timeRange) => {\n const [start, end] = timeRange.split(\"–\").map((time) => {\n const [minutes, seconds] = time.split(\":\").map(Number);\n return minutes * 60 + seconds;\n });\n return { start, end };\n};\n\n/**\n * Map TranscriptCard actorType values to ConversationTurn role values.\n * ConversationTurn uses: \"customer\" | \"agent\" | \"assistant\" | \"system\"\n * TranscriptCard uses: \"customer\" | \"agent\" | \"third_party\" | \"system\"\n */\nconst mapActorTypeToRole = (actorType) => {\n const map = {\n customer: \"customer\",\n agent: \"agent\",\n third_party: \"agent\",\n system: \"system\",\n assistant: \"assistant\",\n };\n return map[actorType] || \"agent\";\n};\n\n/**\n * TranscriptCard Component\n * Displays a complete transcript with multiple turns, audio playback,\n * highlighting, and per-turn play buttons. Composes ConversationTurn\n * for individual turn rendering.\n *\n * @param {Object} props - Component props\n * @param {Array} props.turns - Array of transcript turn objects\n * @param {string} props.turns[].actor - Display name (e.g., \"Agent\", \"Customer\")\n * @param {string} props.turns[].actorType - \"agent\" | \"customer\" | \"third_party\" | \"system\" | \"assistant\"\n * @param {string} [props.turns[].actorColor] - Override rail color for this turn\n * @param {string} props.turns[].text - Transcript text\n * @param {string} [props.turns[].timeRange] - Time range (e.g., \"00:03–00:07\")\n * @param {boolean} [props.turns[].isHighlighted] - Whether this turn is highlighted\n * @param {string} [props.turns[].highlightColor] - Color for the right highlight rail\n * @param {Array} [props.turns[].toolBadges] - Tool badge data [{name, success, pending}]\n * @param {string} [props.audioUrl] - Audio URL for segment playback\n * @param {number} [props.activeTurnIndex=-1] - Index of the externally active turn\n * @param {boolean} [props.autoScrollActiveTurn=false] - Auto-scroll to active turn\n * @param {boolean} [props.isExternalPlaying=false] - External playback state\n * @param {Function} [props.onTurnPlayPause] - External playback handler (turn, index) => void\n */\nexport default function TranscriptCard({\n turns,\n audioUrl,\n activeTurnIndex = -1,\n autoScrollActiveTurn = false,\n isExternalPlaying = false,\n onTurnPlayPause,\n}) {\n const [playingSegment, setPlayingSegment] = useState(null);\n const [isPlaying, setIsPlaying] = useState(false);\n const audioRef = useRef(null);\n const endTimeListenerRef = useRef(null);\n const turnRefs = useRef([]);\n const containerRef = useRef(null);\n const lastAutoScrolledIndexRef = useRef(-1);\n const useExternalPlaybackControl = typeof onTurnPlayPause === \"function\";\n const hasExternalPlaybackState = isExternalPlaying !== undefined;\n\n // Initialize audio element\n useEffect(() => {\n if (audioUrl) {\n audioRef.current = new Audio(audioUrl);\n audioRef.current.preload = \"auto\";\n return () => {\n if (audioRef.current) {\n audioRef.current.pause();\n audioRef.current = null;\n }\n };\n }\n }, [audioUrl]);\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n if (audioRef.current) {\n audioRef.current.pause();\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n }\n }\n };\n }, []);\n\n // Auto-scroll to active turn\n useEffect(() => {\n if (!autoScrollActiveTurn || activeTurnIndex < 0) return;\n const container = containerRef.current;\n const activeNode = turnRefs.current[activeTurnIndex];\n if (!activeNode || !container) return;\n\n const containerRect = container.getBoundingClientRect();\n const activeRect = activeNode.getBoundingClientRect();\n const topPadding = 12;\n const isFullyVisible =\n activeRect.top >= containerRect.top + topPadding &&\n activeRect.bottom <= containerRect.bottom - 8;\n const didScrollForThisTurn = lastAutoScrolledIndexRef.current === activeTurnIndex;\n\n if (!didScrollForThisTurn || !isFullyVisible) {\n const activeTopInContainer = activeRect.top - containerRect.top + container.scrollTop;\n container.scrollTop = Math.max(activeTopInContainer - topPadding, 0);\n }\n lastAutoScrolledIndexRef.current = activeTurnIndex;\n }, [activeTurnIndex, autoScrollActiveTurn]);\n\n const handlePlayPause = (timeRange, index) => {\n if (useExternalPlaybackControl) {\n onTurnPlayPause(turns[index], index);\n return;\n }\n\n if (playingSegment === index && isPlaying) {\n // Pause current segment\n if (audioRef.current) {\n audioRef.current.pause();\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n endTimeListenerRef.current = null;\n }\n }\n setIsPlaying(false);\n } else {\n // Start/switch segment\n const previousSegment = playingSegment;\n setPlayingSegment(index);\n\n if (audioUrl && audioRef.current) {\n const { start, end } = parseTimeRange(timeRange);\n\n if (previousSegment !== null && previousSegment !== index) {\n audioRef.current.pause();\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n endTimeListenerRef.current = null;\n }\n }\n\n const playSegment = () => {\n if (!audioRef.current) return;\n audioRef.current.currentTime = start;\n\n if (end) {\n const checkEndTime = () => {\n if (audioRef.current && audioRef.current.currentTime >= end) {\n audioRef.current.pause();\n setIsPlaying(false);\n setPlayingSegment(null);\n if (endTimeListenerRef.current) {\n audioRef.current.removeEventListener(\"timeupdate\", endTimeListenerRef.current);\n endTimeListenerRef.current = null;\n }\n }\n };\n endTimeListenerRef.current = checkEndTime;\n audioRef.current.addEventListener(\"timeupdate\", checkEndTime);\n }\n\n audioRef.current.play()\n .then(() => setIsPlaying(true))\n .catch((err) => {\n // Ignore AbortError which occurs when play() is interrupted by pause()\n if (err && err.name === \"AbortError\") {\n return;\n }\n setIsPlaying(false);\n setPlayingSegment(null);\n });\n };\n\n if (audioRef.current.readyState >= 2) {\n playSegment();\n } else {\n audioRef.current.addEventListener(\"loadedmetadata\", playSegment, { once: true });\n audioRef.current.load();\n }\n } else {\n setIsPlaying(true);\n }\n }\n };\n\n return (\n <div\n ref={containerRef}\n className=\"custom-thin-scrollbar-library\"\n style={{\n maxHeight: 560,\n overflowY: \"auto\",\n scrollBehavior: \"smooth\",\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n // borderRadius: \"var(--radius-lg, 12px)\",\n borderRadius: \"12px 0px 0px 12px\",\n background: \"var(--paper-elevated, rgba(255,255,255,0.82))\",\n padding: 16,\n }}\n >\n {/* Section label */}\n <div\n style={{\n fontSize: \"var(--text-xs-plus, 10.5px)\",\n fontWeight: 650,\n textTransform: \"uppercase\",\n letterSpacing: \"var(--tracking-label, 0.16em)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n marginBottom: 12,\n }}\n >\n Transcript\n </div>\n\n {/* Turns */}\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 8 }}>\n {turns.map((turn, index) => {\n const isTurnPlaying = (useExternalPlaybackControl || hasExternalPlaybackState)\n ? Boolean(isExternalPlaying) && activeTurnIndex === index\n : playingSegment === index && isPlaying;\n const isTurnHighlighted = Boolean(turn.isHighlighted) || isTurnPlaying;\n const role = mapActorTypeToRole(turn.actorType);\n\n return (\n <div\n key={index}\n ref={(el) => { turnRefs.current[index] = el; }}\n >\n <ConversationTurn\n role={role}\n text={turn.text}\n actorLabel={turn.actor}\n actorRailColor={turn.actorColor}\n timeRange={turn.timeRange}\n isHighlighted={isTurnHighlighted}\n highlightRailColor={isTurnPlaying \n ? (turn.highlightColor || (role === 'agent' ? 'var(--rail-outcome)' : 'var(--rail-discovery)'))\n : turn.highlightColor}\n toolBadges={turn.toolBadges}\n observations={turn.observations}\n onObservationClick={turn.onObservationClick}\n >\n {/* Play/pause button — rendered inline left of time range */}\n {turn.timeRange ? (\n <button\n onClick={() => handlePlayPause(turn.timeRange, index)}\n style={{\n width: 24,\n height: 24,\n borderRadius: \"50%\",\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n background: isTurnPlaying\n ? \"var(--rail-discovery, #5E88B0)\"\n : \"var(--paper, rgba(255,255,255,0.78))\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n padding: 0,\n transition: \"all 0.15s\",\n }}\n aria-label={isTurnPlaying ? `Pause segment ${turn.timeRange}` : `Play segment ${turn.timeRange}`}\n >\n {isTurnPlaying ? (\n <Pause\n style={{ width: 12, height: 12, color: \"var(--paper, #fff)\", fill: \"var(--paper, #fff)\" }}\n strokeWidth={0}\n />\n ) : (\n <Play\n style={{ width: 12, height: 12, color: \"var(--text-muted, rgba(30,33,37,0.56))\", fill: \"var(--text-muted, rgba(30,33,37,0.56))\", marginLeft: 1 }}\n strokeWidth={0}\n />\n )}\n </button>\n ) : null}\n </ConversationTurn>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { useEffect, useMemo, useState } from \"react\";\nimport { Play, Pause, RotateCcw, RotateCw } from \"lucide-react\";\n\nexport default function Timeline({\n segments = [],\n durationSeconds = 0,\n actorRows = [],\n currentTimeSeconds = 0,\n onSeek,\n showControls = false,\n hasRecording = false,\n timelinePlaying = false,\n playbackRate = 1,\n speedOptions = [1, 1.25, 1.5, 2],\n onTogglePlay,\n onSeekBack,\n onSeekForward,\n onSetPlaybackRate,\n totalDurationLabel,\n}) {\n const [activeControl, setActiveControl] = useState(null);\n\n useEffect(() => {\n if (!activeControl) return;\n const timer = setTimeout(() => setActiveControl(null), 220);\n return () => clearTimeout(timer);\n }, [activeControl]);\n\n const timelineDuration = Math.max(\n Number(durationSeconds) || 0,\n ...segments.map((segment) => Number(segment.endTime) || 0),\n 1\n );\n const clampedCurrent = Math.max(0, Math.min(Number(currentTimeSeconds) || 0, timelineDuration));\n const playheadPercent = timelineDuration > 0 ? (clampedCurrent / timelineDuration) * 100 : 0;\n const playheadLeft = `calc(${playheadPercent}% + ${(5 * (1 - playheadPercent / 100)).toFixed(4)}rem)`;\n\n const formatTime = (seconds) => {\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins.toString().padStart(2, \"0\")}:${secs.toString().padStart(2, \"0\")}`;\n };\n\n const rows = useMemo(() => {\n if (actorRows.length) {\n return actorRows.map((actor) => ({\n ...actor,\n segments: segments.filter((segment) => segment.actor === actor.key),\n }));\n }\n const actors = Array.from(new Set(segments.map((segment) => segment.actor)));\n const actorColors = new Map(segments.map((segment) => [segment.actor, segment.actorColor]));\n return actors.map((actor) => ({\n key: actor,\n label: actor,\n color: actorColors.get(actor) || \"#6B7C93\",\n segments: segments.filter((segment) => segment.actor === actor),\n }));\n }, [actorRows, segments]);\n\n const timeMarkers = [];\n const interval = 120;\n for (let marker = 0; marker <= timelineDuration; marker += interval) {\n timeMarkers.push(marker);\n }\n if (!timeMarkers.length || timeMarkers[timeMarkers.length - 1] < timelineDuration) {\n timeMarkers.push(timelineDuration);\n }\n\n const handleSeekClick = (event) => {\n if (!onSeek) return;\n const rect = event.currentTarget.getBoundingClientRect();\n if (!rect.width) return;\n const ratio = Math.max(0, Math.min((event.clientX - rect.left) / rect.width, 1));\n onSeek(ratio * timelineDuration);\n };\n\n return (\n <div style={{\n padding: \"10px 0\",\n }}>\n {showControls && (\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", marginBottom: 8 }}>\n <div style={{\n fontSize: \"var(--text-sm, 11px)\",\n fontFamily: \"var(--font-mono, monospace)\",\n color: \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontWeight: 500,\n minWidth: 70,\n }}>\n {formatTime(clampedCurrent)} <span style={{ color: \"var(--text-faint, rgba(30,33,37,0.36))\" }}>/ {formatTime(timelineDuration)}</span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 6 }}>\n <button\n type=\"button\"\n onClick={() => { setActiveControl(\"rewind\"); onSeekBack?.(); }}\n disabled={!hasRecording}\n title=\"Rewind 15s\"\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n width: 28, height: 28, borderRadius: \"50%\",\n border: `1px solid ${activeControl === \"rewind\" ? \"var(--rail-discovery, #5E88B0)\" : \"var(--border, rgba(52,58,64,0.12))\"}`,\n background: \"var(--paper, rgba(255,255,255,0.78))\", cursor: \"pointer\", padding: 0,\n }}\n >\n <RotateCcw size={13} stroke=\"var(--rail-discovery, #5E88B0)\" />\n </button>\n\n <button\n type=\"button\"\n onClick={onTogglePlay}\n disabled={!hasRecording}\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n width: 32, height: 32, borderRadius: \"50%\",\n background: \"var(--rail-discovery, #5E88B0)\", color: \"#fff\",\n border: \"none\", cursor: \"pointer\", padding: 0,\n }}\n aria-label={timelinePlaying ? \"Pause recording\" : \"Play recording\"}\n >\n {timelinePlaying ? <Pause size={14} /> : <Play size={14} style={{ marginLeft: 1 }} />}\n </button>\n\n <button\n type=\"button\"\n onClick={() => { setActiveControl(\"forward\"); onSeekForward?.(); }}\n disabled={!hasRecording}\n title=\"Forward 15s\"\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n width: 28, height: 28, borderRadius: \"50%\",\n border: `1px solid ${activeControl === \"forward\" ? \"var(--rail-discovery, #5E88B0)\" : \"var(--border, rgba(52,58,64,0.12))\"}`,\n background: \"var(--paper, rgba(255,255,255,0.78))\", cursor: \"pointer\", padding: 0,\n }}\n >\n <RotateCw size={13} stroke=\"var(--rail-discovery, #5E88B0)\" />\n </button>\n\n <div style={{ display: \"inline-flex\", alignItems: \"center\", gap: 4, borderRadius: 999, border: \"1px solid var(--border, rgba(52,58,64,0.12))\", padding: \"2px 3px\", background: \"var(--paper, rgba(255,255,255,0.78))\", marginLeft: 4 }}>\n {speedOptions.map((speed) => {\n const isActive = playbackRate === speed;\n return (\n <button\n key={speed}\n type=\"button\"\n onClick={() => onSetPlaybackRate?.(speed)}\n disabled={!hasRecording}\n title={`Speed: ${speed}x`}\n style={{\n display: \"inline-flex\", alignItems: \"center\", justifyContent: \"center\",\n height: 24, minWidth: 38, padding: \"0 6px\", borderRadius: 999,\n border: `1px solid ${isActive ? \"var(--rail-discovery, #5E88B0)\" : \"transparent\"}`,\n background: isActive ? \"var(--rail-discovery, #5E88B0)\" : \"transparent\",\n color: isActive ? \"#fff\" : \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontSize: \"var(--text-xs, 10px)\", fontWeight: 600, cursor: \"pointer\",\n }}\n >\n {speed === 1.5 ? \"1.50x\" : `${speed}x`}\n </button>\n );\n })}\n </div>\n </div>\n </div>\n )}\n\n <div style={{\n background: \"var(--paper, rgba(255,255,255,0.78))\",\n border: \"1px solid var(--border, rgba(52,58,64,0.12))\",\n borderRadius: 10,\n padding: \"12px 16px 10px\",\n }}>\n <div style={{ position: \"relative\" }}>\n {/* Time markers row */}\n <div style={{ display: \"flex\", alignItems: \"center\", marginBottom: 6, height: 16 }}>\n <div style={{ width: \"5rem\", flexShrink: 0 }} />\n <div style={{ position: \"relative\", flex: 1 }}>\n {timeMarkers.map((time) => {\n const percentage = timelineDuration > 0 ? (time / timelineDuration) * 100 : 0;\n return (\n <div\n key={time}\n style={{\n position: \"absolute\",\n fontSize: \"var(--text-xs, 10px)\",\n color: \"var(--text-faint, rgba(30,33,37,0.36))\",\n left: `${percentage}%`,\n transform: \"translateX(-50%)\",\n fontFamily: \"var(--font-mono, monospace)\",\n whiteSpace: \"nowrap\",\n }}\n >\n {formatTime(time)}\n </div>\n );\n })}\n </div>\n </div>\n\n {/* Vertical gridlines */}\n <div\n style={{\n position: \"absolute\",\n pointerEvents: \"none\",\n top: 0,\n bottom: 0,\n left: \"5rem\",\n width: \"calc(100% - 5rem)\",\n zIndex: 20,\n }}\n >\n {timeMarkers.map((time) => {\n const percentage = timelineDuration > 0 ? (time / timelineDuration) * 100 : 0;\n return (\n <div\n key={time}\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: `${percentage}%`,\n borderLeft: \"1px dashed var(--border, rgba(52,58,64,0.12))\",\n transform: \"translateX(-1px)\",\n }}\n />\n );\n })}\n </div>\n\n {/* Swim lanes */}\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10, marginTop: 8 }}>\n {rows.map((row) => {\n const isSystem = row.key === \"system\" || row.label === \"System\";\n return (\n <div key={row.key} style={{ display: \"flex\", alignItems: \"center\" }}>\n <div\n style={{\n width: \"5rem\",\n flexShrink: 0,\n fontSize: \"var(--text-sm, 11px)\",\n fontWeight: 600,\n color: \"var(--text-muted, rgba(30,33,37,0.56))\",\n fontFamily: \"var(--font-sans, system-ui, sans-serif)\",\n paddingRight: 8,\n }}\n >\n {row.label}\n </div>\n\n <div\n style={{\n position: \"relative\",\n borderRadius: 4,\n flex: 1,\n height: 18,\n backgroundColor: \"var(--paper-secondary, rgba(244,241,230,0.6))\",\n border: \"1px solid var(--border-subtle, rgba(52,58,64,0.08))\",\n }}\n >\n {row.segments.map((segment, idx) => {\n let leftPercent = timelineDuration > 0 ? (segment.startTime / timelineDuration) * 100 : 0;\n let widthPercent =\n timelineDuration > 0\n ? ((segment.endTime - segment.startTime) / timelineDuration) * 100\n : 0;\n leftPercent = Math.max(0, Math.min(100, leftPercent));\n const rightPercent = leftPercent + widthPercent;\n if (rightPercent > 100) widthPercent = 100 - leftPercent;\n widthPercent = Math.max(0, widthPercent);\n const segmentDuration = segment.endTime - segment.startTime;\n\n if (isSystem && segmentDuration <= 5) {\n return (\n <div\n key={idx}\n style={{\n position: \"absolute\",\n cursor: \"pointer\",\n left: `${leftPercent}%`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n backgroundColor: row.color,\n opacity: 0.85,\n }}\n title={`${row.label}: ${formatTime(segment.startTime)}-${formatTime(segment.endTime)}`}\n />\n );\n }\n\n return (\n <div\n key={idx}\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: `${leftPercent}%`,\n width: `${Math.max(widthPercent, 0.7)}%`,\n maxWidth: `${100 - leftPercent}%`,\n backgroundColor: row.color,\n opacity: 0.85,\n borderRadius: 2,\n cursor: \"pointer\",\n transition: \"opacity 0.15s\",\n }}\n title={`${row.label}: ${formatTime(segment.startTime)}-${formatTime(segment.endTime)}`}\n />\n );\n })}\n </div>\n </div>\n );\n })}\n </div>\n\n {/* Playhead */}\n <div\n style={{\n pointerEvents: \"none\",\n position: \"absolute\",\n top: 0,\n bottom: 0,\n width: 2,\n borderRadius: 1,\n backgroundColor: \"var(--rail-discovery, #5E88B0)\",\n opacity: 0.55,\n boxShadow: \"0 0 0 1px rgba(94,136,176,0.10)\",\n left: playheadLeft,\n transform: \"translateX(-50%)\",\n }}\n />\n\n {/* Seek overlay */}\n {onSeek ? (\n <button\n type=\"button\"\n onClick={handleSeekClick}\n style={{\n position: \"absolute\",\n cursor: \"pointer\",\n background: \"transparent\",\n border: \"none\",\n padding: 0,\n margin: 0,\n appearance: \"none\",\n top: 0,\n bottom: 0,\n left: \"5rem\",\n width: \"calc(100% - 5rem)\",\n zIndex: 25,\n }}\n title=\"Click timeline to play from that point\"\n aria-label=\"Click timeline to play from that point\"\n />\n ) : null}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["ACTOR_DEFAULTS","KEYFRAMES_ID","ensureKeyframes","style","ConversationTurn","role","text","actorLabel","actorRailColor","actionKicker","toolBadges","streaming","meta","timeRange","isHighlighted","highlightRailColor","observations","onObservationClick","children","useEffect","actor","label","railColor","highlighted","jsx","jsxs","t","i","isPending","isError","obs","parseTimeRange","start","end","time","minutes","seconds","mapActorTypeToRole","actorType","TranscriptCard","turns","audioUrl","activeTurnIndex","autoScrollActiveTurn","isExternalPlaying","onTurnPlayPause","playingSegment","setPlayingSegment","useState","isPlaying","setIsPlaying","audioRef","useRef","endTimeListenerRef","turnRefs","containerRef","lastAutoScrolledIndexRef","useExternalPlaybackControl","hasExternalPlaybackState","container","activeNode","containerRect","activeRect","topPadding","isFullyVisible","activeTopInContainer","handlePlayPause","index","previousSegment","playSegment","checkEndTime","err","turn","isTurnPlaying","isTurnHighlighted","el","Pause","Play","Timeline","segments","durationSeconds","actorRows","currentTimeSeconds","onSeek","showControls","hasRecording","timelinePlaying","playbackRate","speedOptions","onTogglePlay","onSeekBack","onSeekForward","onSetPlaybackRate","totalDurationLabel","activeControl","setActiveControl","timer","timelineDuration","segment","clampedCurrent","playheadPercent","playheadLeft","formatTime","mins","secs","rows","useMemo","actors","actorColors","timeMarkers","interval","marker","handleSeekClick","event","rect","ratio","RotateCcw","RotateCw","speed","isActive","percentage","row","isSystem","idx","leftPercent","widthPercent","segmentDuration"],"mappings":";;;AAQA,MAAMA,IAAiB;AAAA,EACrB,UAAU;AAAA,IACR,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AAAA,EACA,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,aAAa;AAAA,EACf;AACF,GAsBMC,IAAe;AACrB,SAASC,IAAkB;AAErB,MADA,OAAO,WAAa,OACpB,SAAS,eAAeD,CAAY;AAAG;AACrC,QAAAE,IAAQ,SAAS,cAAc,OAAO;AAC5C,EAAAA,EAAM,KAAKF,GACXE,EAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,KAMX,SAAA,KAAK,YAAYA,CAAK;AACjC;AAEA,SAAwBC,EAAiB;AAAA,EACvC,MAAAC,IAAO;AAAA,EACP,MAAAC;AAAA,EACA,YAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,oB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nB,EAAWJ,EAAQ,SAAS,CAAC,IAAII,EAAWJ,EAAQ,OAAO,CAAC;AAAA,kBAAA;AAAA,kBAd/EyB;AAAA,gBAAA;AAAA,cAeP,CAEH;AAAA,YAAA;AAAA,UACH;AAAA,QAAA,KA9EQF,EAAI,GA+Ed;AAAA,MAEH,CAAA,GACH;AAAA,MAGA,gBAAAjG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAO;AAAA,YACL,eAAe;AAAA,YACf,UAAU;AAAA,YACV,KAAK;AAAA,YACL,QAAQ;AAAA,YACR,OAAO;AAAA,YACP,cAAc;AAAA,YACd,iBAAiB;AAAA,YACjB,SAAS;AAAA,YACT,WAAW;AAAA,YACX,MAAM6E;AAAA,YACN,WAAW;AAAA,UACb;AAAA,QAAA;AAAA,MACF;AAAA,MAGClB,IACC,gBAAA3D;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAASwF;AAAA,UACT,OAAO;AAAA,YACL,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,YAAY;AAAA,YACZ,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,QAAQ;AAAA,YACR,YAAY;AAAA,YACZ,KAAK;AAAA,YACL,QAAQ;AAAA,YACR,MAAM;AAAA,YACN,OAAO;AAAA,YACP,QAAQ;AAAA,UACV;AAAA,UACA,OAAM;AAAA,UACN,cAAW;AAAA,QAAA;AAAA,MAAA,IAEX;AAAA,IAAA,EAAA,CACN,EACF,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const R=require("react/jsx-runtime"),gt=require("react"),yt=require("react-dom");function vt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=vt(gt),xt=vt(yt);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function nt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wt(...e){return t=>{let n=!1;const o=e.map(r=>{const i=nt(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():nt(e[r],null)}}}}function ne(...e){return f.useCallback(wt(...e),e)}function bt(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),l=n.length;n=[...n,s];const a=d=>{var v;const{scope:h,children:p,...m}=d,g=((v=h==null?void 0:h[e])==null?void 0:v[l])||c,y=f.useMemo(()=>m,Object.values(m));return R.jsx(g.Provider,{value:y,children:p})};a.displayName=i+"Provider";function u(d,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[l])||c,m=f.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[a,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const l=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,gn(r,...t)]}function gn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:l,scopeName:a})=>{const d=l(i)[`__scope${a}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function yn(e){const t=vn(e),n=f.forwardRef((o,r)=>{const{children:i,...s}=o,c=f.Children.toArray(i),l=c.find(wn);if(l){const a=l.props.children,u=c.map(d=>d===l?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:d);return R.jsx(t,{...s,ref:r,children:f.isValidElement(a)?f.cloneElement(a,void 0,u):null})}return R.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function vn(e){const t=f.forwardRef((n,o)=>{const{children:r,...i}=n;if(f.isValidElement(r)){const s=Cn(r),c=bn(i,r.props);return r.type!==f.Fragment&&(c.ref=o?wt(o,s):s),f.cloneElement(r,c)}return f.Children.count(r)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ct=Symbol("radix.slottable");function xn(e){const t=({children:n})=>R.jsx(R.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ct,t}function wn(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ct}function bn(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const l=i(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Cn(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=Rn.reduce((e,t)=>{const n=yn(`Primitive.${t}`),o=f.forwardRef((r,i)=>{const{asChild:s,...c}=r,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(l,{...c,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function En(e,t){e&&xt.flushSync(()=>e.dispatchEvent(t))}function Ce(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function Pn(e,t=globalThis==null?void 0:globalThis.document){const n=Ce(e);f.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var An="DismissableLayer",Ne="dismissableLayer.update",On="dismissableLayer.pointerDownOutside",Tn="dismissableLayer.focusOutside",ot,Rt=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Et=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...l}=e,a=f.useContext(Rt),[u,d]=f.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),m=ne(t,C=>d(C)),g=Array.from(a.layers),[y]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),x=u?g.indexOf(u):-1,b=a.layersWithOutsidePointerEventsDisabled.size>0,w=x>=v,P=Ln(C=>{const O=C.target,M=[...a.branches].some(T=>T.contains(O));!w||M||(r==null||r(C),s==null||s(C),C.defaultPrevented||c==null||c())},h),E=Nn(C=>{const O=C.target;[...a.branches].some(T=>T.contains(O))||(i==null||i(C),s==null||s(C),C.defaultPrevented||c==null||c())},h);return Pn(C=>{x===a.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},h),f.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(ot=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),rt(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ot)}},[u,h,n,a]),f.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),rt())},[u,a]),f.useEffect(()=>{const C=()=>p({});return document.addEventListener(Ne,C),()=>document.removeEventListener(Ne,C)},[]),R.jsx(Q.div,{...l,ref:m,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,P.onPointerDownCapture)})});Et.displayName=An;var Sn="DismissableLayerBranch",Dn=f.forwardRef((e,t)=>{const n=f.useContext(Rt),o=f.useRef(null),r=ne(t,o);return f.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),R.jsx(Q.div,{...e,ref:r})});Dn.displayName=Sn;function Ln(e,t=globalThis==null?void 0:globalThis.document){const n=Ce(e),o=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const i=c=>{if(c.target&&!o.current){let l=function(){Pt(On,n,a,{discrete:!0})};const a={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Nn(e,t=globalThis==null?void 0:globalThis.document){const n=Ce(e),o=f.useRef(!1);return f.useEffect(()=>{const r=i=>{i.target&&!o.current&&Pt(Tn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function rt(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}function Pt(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?En(r,i):r.dispatchEvent(i)}var K=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Mn=f[" useId ".trim().toString()]||(()=>{}),_n=0;function kn(e){const[t,n]=f.useState(Mn());return K(()=>{n(o=>o??String(_n++))},[e]),t?`radix-${t}`:""}const jn=["top","right","bottom","left"],Z=Math.min,I=Math.max,ve=Math.round,me=Math.floor,V=e=>({x:e,y:e}),$n={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e,t,n){return I(e,Z(t,n))}function X(e,t){return typeof e=="function"?e(t):e}function q(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function Ie(e){return e==="x"?"y":"x"}function We(e){return e==="y"?"height":"width"}function z(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Fe(e){return Ie(z(e))}function In(e,t,n){n===void 0&&(n=!1);const o=se(e),r=Fe(e),i=We(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xe(s)),[s,xe(s)]}function Wn(e){const t=xe(e);return[_e(e),t,_e(t)]}function _e(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const it=["left","right"],st=["right","left"],Fn=["top","bottom"],Hn=["bottom","top"];function Bn(e,t,n){switch(e){case"top":case"bottom":return n?t?st:it:t?it:st;case"left":case"right":return t?Fn:Hn;default:return[]}}function zn(e,t,n,o){const r=se(e);let i=Bn(q(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(_e)))),i}function xe(e){const t=q(e);return $n[t]+e.slice(t.length)}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function At(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function we(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ct(e,t,n){let{reference:o,floating:r}=e;const i=z(t),s=Fe(t),c=We(s),l=q(t),a=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(se(t)){case"start":p[s]-=h*(n&&a?-1:1);break;case"end":p[s]+=h*(n&&a?-1:1);break}return p}async function Un(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=X(t,e),m=At(p),y=c[h?d==="floating"?"reference":"floating":d],v=we(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:l})),x=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},P=we(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:l}):x);return{top:(v.top-P.top+m.top)/w.y,bottom:(P.bottom-v.bottom+m.bottom)/w.y,left:(v.left-P.left+m.left)/w.x,right:(P.right-v.right+m.right)/w.x}}const Yn=50,Xn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:Un},l=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=ct(a,o,l),h=o,p=0;const m={};for(let g=0;g<i.length;g++){const y=i[g];if(!y)continue;const{name:v,fn:x}=y,{x:b,y:w,data:P,reset:E}=await x({x:u,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:m,rects:a,platform:c,elements:{reference:e,floating:t}});u=b??u,d=w??d,m[v]={...m[v],...P},E&&p<Yn&&(p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(a=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):E.rects),{x:u,y:d}=ct(a,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:m}},qn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:a,padding:u=0}=X(e,t)||{};if(a==null)return{};const d=At(u),h={x:n,y:o},p=Fe(r),m=We(p),g=await s.getDimensions(a),y=p==="y",v=y?"top":"left",x=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-h[p]-i.floating[m],P=h[p]-i.reference[p],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let C=E?E[b]:0;(!C||!await(s.isElement==null?void 0:s.isElement(E)))&&(C=c.floating[b]||i.floating[m]);const O=w/2-P/2,M=C/2-g[m]/2-1,T=Z(d[v],M),k=Z(d[x],M),j=T,D=C-g[m]-k,S=C/2-g[m]/2+O,$=Me(j,S,D),L=!l.arrow&&se(r)!=null&&S!==$&&i.reference[m]/2-(S<j?T:k)-g[m]/2<0,N=L?S<j?S-j:S-D:0;return{[p]:h[p]+N,data:{[p]:$,centerOffset:S-$-N,...L&&{alignmentOffset:N}},reset:L}}}),Gn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=X(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=q(r),x=z(c),b=q(c)===c,w=await(l.isRTL==null?void 0:l.isRTL(a.floating)),P=h||(b||!g?[xe(c)]:Wn(c)),E=m!=="none";!h&&E&&P.push(...zn(c,g,m,w));const C=[c,...P],O=await l.detectOverflow(t,y),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[v]),d){const S=In(r,s,w);M.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(S=>S<=0)){var k,j;const S=(((k=i.flip)==null?void 0:k.index)||0)+1,$=C[S];if($&&(!(d==="alignment"?x!==z($):!1)||T.every(A=>z(A.placement)===x?A.overflows[0]>0:!0)))return{data:{index:S,overflows:T},reset:{placement:$}};let L=(j=T.filter(N=>N.overflows[0]<=0).sort((N,A)=>N.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!L)switch(p){case"bestFit":{var D;const N=(D=T.filter(A=>{if(E){const _=z(A.placement);return _===x||_==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(_=>_>0).reduce((_,B)=>_+B,0)]).sort((A,_)=>A[1]-_[1])[0])==null?void 0:D[0];N&&(L=N);break}case"initialPlacement":L=c;break}if(r!==L)return{reset:{placement:L}}}return{}}}};function lt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function at(e){return jn.some(t=>e[t]>=0)}const Kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=X(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),c=lt(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:at(c)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),c=lt(s,n.floating);return{data:{escapedOffsets:c,escaped:at(c)}}}default:return{}}}}},Ot=new Set(["left","top"]);async function Zn(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=q(n),c=se(n),l=z(n)==="y",a=Ot.has(s)?-1:1,u=i&&l?-1:1,d=X(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),l?{x:p*u,y:h*a}:{x:h*a,y:p*u}}const Jn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await Zn(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},Qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:v=>{let{x,y:b}=v;return{x,y:b}}},...a}=X(e,t),u={x:n,y:o},d=await i.detectOverflow(t,a),h=z(q(r)),p=Ie(h);let m=u[p],g=u[h];if(s){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=m+d[v],w=m-d[x];m=Me(b,m,w)}if(c){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=g+d[v],w=g-d[x];g=Me(b,g,w)}const y=l.fn({...t,[p]:m,[h]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:s,[h]:c}}}}}},eo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:l=!0,crossAxis:a=!0}=X(e,t),u={x:n,y:o},d=z(r),h=Ie(d);let p=u[h],m=u[d];const g=X(c,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=h==="y"?"height":"width",w=i.reference[h]-i.floating[b]+y.mainAxis,P=i.reference[h]+i.reference[b]-y.mainAxis;p<w?p=w:p>P&&(p=P)}if(a){var v,x;const b=h==="y"?"width":"height",w=Ot.has(q(r)),P=i.reference[d]-i.floating[b]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:y.crossAxis),E=i.reference[d]+i.reference[b]+(w?0:((x=s.offset)==null?void 0:x[d])||0)-(w?y.crossAxis:0);m<P?m=P:m>E&&(m=E)}return{[h]:p,[d]:m}}}},to=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:c}=t,{apply:l=()=>{},...a}=X(e,t),u=await s.detectOverflow(t,a),d=q(r),h=se(r),p=z(r)==="y",{width:m,height:g}=i.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=h===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,y=h==="end"?"top":"bottom");const x=g-u.top-u.bottom,b=m-u.left-u.right,w=Z(g-u[y],x),P=Z(m-u[v],b),E=!t.middlewareData.shift;let C=w,O=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=x),E&&!h){const T=I(u.left,0),k=I(u.right,0),j=I(u.top,0),D=I(u.bottom,0);p?O=m-2*(T!==0||k!==0?T+k:I(u.left,u.right)):C=g-2*(j!==0||D!==0?j+D:I(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:C});const M=await s.getDimensions(c.floating);return m!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Re(){return typeof window<"u"}function ce(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return Re()?e instanceof Node||e instanceof W(e).Node:!1}function F(e){return Re()?e instanceof Element||e instanceof W(e).Element:!1}function G(e){return Re()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function ut(e){return!Re()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function no(e){return/^(table|td|th)$/.test(ce(e))}function Ee(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const oo=/transform|translate|scale|rotate|perspective|filter/,ro=/paint|layout|strict|content/,ee=e=>!!e&&e!=="none";let Se;function He(e){const t=F(e)?H(e):e;return ee(t.transform)||ee(t.translate)||ee(t.scale)||ee(t.rotate)||ee(t.perspective)||!Be()&&(ee(t.backdropFilter)||ee(t.filter))||oo.test(t.willChange||"")||ro.test(t.contain||"")}function io(e){let t=J(e);for(;G(t)&&!re(t);){if(He(t))return t;if(Ee(t))return null;t=J(t)}return null}function Be(){return Se==null&&(Se=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Se}function re(e){return/^(html|body|#document)$/.test(ce(e))}function H(e){return W(e).getComputedStyle(e)}function Pe(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ut(e)&&e.host||U(e);return ut(t)?t.host:t}function St(e){const t=J(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&fe(t)?t:St(t)}function ae(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=St(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=W(r);if(i){const c=ke(s);return t.concat(s,s.visualViewport||[],fe(r)?r:[],c&&n?ae(c):[])}else return t.concat(r,ae(r,[],n))}function ke(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dt(e){const t=H(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=G(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=ve(n)!==i||ve(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function ze(e){return F(e)?e:e.contextElement}function oe(e){const t=ze(e);if(!G(t))return V(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Dt(t);let s=(i?ve(n.width):n.width)/o,c=(i?ve(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const so=V(0);function Lt(e){const t=W(e);return!Be()||!t.visualViewport?so:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function co(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function te(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ze(e);let s=V(1);t&&(o?F(o)&&(s=oe(o)):s=oe(e));const c=co(i,n,o)?Lt(i):V(0);let l=(r.left+c.x)/s.x,a=(r.top+c.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const h=W(i),p=o&&F(o)?W(o):o;let m=h,g=ke(m);for(;g&&o&&p!==m;){const y=oe(g),v=g.getBoundingClientRect(),x=H(g),b=v.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,w=v.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,a*=y.y,u*=y.x,d*=y.y,l+=b,a+=w,m=W(g),g=ke(m)}}return we({width:u,height:d,x:l,y:a})}function Ae(e,t){const n=Pe(e).scrollLeft;return t?t.left+n:te(U(e)).left+n}function Nt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ae(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function lo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=U(o),c=t?Ee(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=V(1);const u=V(0),d=G(o);if((d||!d&&!i)&&((ce(o)!=="body"||fe(s))&&(l=Pe(o)),d)){const p=te(o);a=oe(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}const h=s&&!d&&!i?Nt(s,l):V(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+h.x,y:n.y*a.y-l.scrollTop*a.y+u.y+h.y}}function ao(e){return Array.from(e.getClientRects())}function uo(e){const t=U(e),n=Pe(e),o=e.ownerDocument.body,r=I(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=I(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ae(e);const c=-n.scrollTop;return H(o).direction==="rtl"&&(s+=I(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}const ft=25;function fo(e,t){const n=W(e),o=U(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,l=0;if(r){i=r.width,s=r.height;const u=Be();(!u||u&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const a=Ae(o);if(a<=0){const u=o.ownerDocument,d=u.body,h=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-d.clientWidth-p);m<=ft&&(i-=m)}else a<=ft&&(i+=a);return{width:i,height:s,x:c,y:l}}function po(e,t){const n=te(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=G(e)?oe(e):V(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,a=o*i.y;return{width:s,height:c,x:l,y:a}}function dt(e,t,n){let o;if(t==="viewport")o=fo(e,n);else if(t==="document")o=uo(U(e));else if(F(t))o=po(t,n);else{const r=Lt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return we(o)}function Mt(e,t){const n=J(e);return n===t||!F(n)||re(n)?!1:H(n).position==="fixed"||Mt(n,t)}function ho(e,t){const n=t.get(e);if(n)return n;let o=ae(e,[],!1).filter(c=>F(c)&&ce(c)!=="body"),r=null;const i=H(e).position==="fixed";let s=i?J(e):e;for(;F(s)&&!re(s);){const c=H(s),l=He(s);!l&&c.position==="fixed"&&(r=null),(i?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||fe(s)&&!l&&Mt(e,s))?o=o.filter(u=>u!==s):r=c,s=J(s)}return t.set(e,o),o}function mo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Ee(t)?[]:ho(t,this._c):[].concat(n),o],c=dt(t,s[0],r);let l=c.top,a=c.right,u=c.bottom,d=c.left;for(let h=1;h<s.length;h++){const p=dt(t,s[h],r);l=I(p.top,l),a=Z(p.right,a),u=Z(p.bottom,u),d=I(p.left,d)}return{width:a-d,height:u-l,x:d,y:l}}function go(e){const{width:t,height:n}=Dt(e);return{width:t,height:n}}function yo(e,t,n){const o=G(t),r=U(t),i=n==="fixed",s=te(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=V(0);function a(){l.x=Ae(r)}if(o||!o&&!i)if((ce(t)!=="body"||fe(r))&&(c=Pe(t)),o){const p=te(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else r&&a();i&&!o&&r&&a();const u=r&&!o&&!i?Nt(r,c):V(0),d=s.left+c.scrollLeft-l.x-u.x,h=s.top+c.scrollTop-l.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function De(e){return H(e).position==="static"}function pt(e,t){if(!G(e)||H(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){const n=W(e);if(Ee(e))return n;if(!G(e)){let r=J(e);for(;r&&!re(r);){if(F(r)&&!De(r))return r;r=J(r)}return n}let o=pt(e,t);for(;o&&no(o)&&De(o);)o=pt(o,t);return o&&re(o)&&De(o)&&!He(o)?n:o||io(e)||n}const vo=async function(e){const t=this.getOffsetParent||_t,n=this.getDimensions,o=await n(e.floating);return{reference:yo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xo(e){return H(e).direction==="rtl"}const wo={convertOffsetParentRelativeRectToViewportRelativeRect:lo,getDocumentElement:U,getClippingRect:mo,getOffsetParent:_t,getElementRects:vo,getClientRects:ao,getDimensions:go,getScale:oe,isElement:F,isRTL:xo};function kt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bo(e,t){let n=null,o;const r=U(e);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const a=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=a;if(c||t(),!h||!p)return;const m=me(d),g=me(r.clientWidth-(u+h)),y=me(r.clientHeight-(d+p)),v=me(u),b={rootMargin:-m+"px "+-g+"px "+-y+"px "+-v+"px",threshold:I(0,Z(1,l))||1};let w=!0;function P(E){const C=E[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!kt(a,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(P,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(e)}return s(!0),i}function Co(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ze(e),u=r||i?[...a?ae(a):[],...t?ae(t):[]]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=a&&c?bo(a,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===a&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),a&&!l&&p.observe(a),t&&p.observe(t));let m,g=l?te(e):null;l&&y();function y(){const v=te(e);g&&!kt(g,v)&&n(),g=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Ro=Jn,Eo=Qn,Po=Gn,Ao=to,Oo=Kn,ht=qn,To=eo,So=(e,t,n)=>{const o=new Map,r={platform:wo,...n},i={...r.platform,_c:o};return Xn(e,t,{...r,platform:i})};var Do=typeof document<"u",Lo=function(){},ye=Do?gt.useLayoutEffect:Lo;function be(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!be(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!be(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mt(e,t){const n=jt(e);return Math.round(t*n)/n}function Le(e){const t=f.useRef(e);return ye(()=>{t.current=e}),t}function No(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(o);be(h,o)||p(o);const[m,g]=f.useState(null),[y,v]=f.useState(null),x=f.useCallback(A=>{A!==E.current&&(E.current=A,g(A))},[]),b=f.useCallback(A=>{A!==C.current&&(C.current=A,v(A))},[]),w=i||m,P=s||y,E=f.useRef(null),C=f.useRef(null),O=f.useRef(u),M=l!=null,T=Le(l),k=Le(r),j=Le(a),D=f.useCallback(()=>{if(!E.current||!C.current)return;const A={placement:t,strategy:n,middleware:h};k.current&&(A.platform=k.current),So(E.current,C.current,A).then(_=>{const B={..._,isPositioned:j.current!==!1};S.current&&!be(O.current,B)&&(O.current=B,xt.flushSync(()=>{d(B)}))})},[h,t,n,k,j]);ye(()=>{a===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[a]);const S=f.useRef(!1);ye(()=>(S.current=!0,()=>{S.current=!1}),[]),ye(()=>{if(w&&(E.current=w),P&&(C.current=P),w&&P){if(T.current)return T.current(w,P,D);D()}},[w,P,D,T,M]);const $=f.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:b}),[x,b]),L=f.useMemo(()=>({reference:w,floating:P}),[w,P]),N=f.useMemo(()=>{const A={position:n,left:0,top:0};if(!L.floating)return A;const _=mt(L.floating,u.x),B=mt(L.floating,u.y);return c?{...A,transform:"translate("+_+"px, "+B+"px)",...jt(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:B}},[n,c,L.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:D,refs:$,elements:L,floatingStyles:N}),[u,D,$,L,N])}const Mo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ht({element:o.current,padding:r}).fn(n):{}:o?ht({element:o,padding:r}).fn(n):{}}}},_o=(e,t)=>{const n=Ro(e);return{name:n.name,fn:n.fn,options:[e,t]}},ko=(e,t)=>{const n=Eo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>({fn:To(e).fn,options:[e,t]}),$o=(e,t)=>{const n=Po(e);return{name:n.name,fn:n.fn,options:[e,t]}},Io=(e,t)=>{const n=Ao(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wo=(e,t)=>{const n=Oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fo=(e,t)=>{const n=Mo(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ho="Arrow",$t=f.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return R.jsx(Q.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:R.jsx("polygon",{points:"0,0 30,0 15,10"})})});$t.displayName=Ho;var Bo=$t;function zo(e){const[t,n]=f.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const l=i.borderBoxSize,a=Array.isArray(l)?l[0]:l;s=a.inlineSize,c=a.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Ve="Popper",[It,Wt]=bt(Ve),[Vo,Ft]=It(Ve),Ht=e=>{const{__scopePopper:t,children:n}=e,[o,r]=f.useState(null);return R.jsx(Vo,{scope:t,anchor:o,onAnchorChange:r,children:n})};Ht.displayName=Ve;var Bt="PopperAnchor",zt=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Ft(Bt,n),s=f.useRef(null),c=ne(t,s),l=f.useRef(null);return f.useEffect(()=>{const a=l.current;l.current=(o==null?void 0:o.current)||s.current,a!==l.current&&i.onAnchorChange(l.current)}),o?null:R.jsx(Q.div,{...r,ref:c})});zt.displayName=Bt;var Ue="PopperContent",[Uo,Yo]=It(Ue),Vt=f.forwardRef((e,t)=>{var Ge,Ke,Ze,Je,Qe,et;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:a=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,y=Ft(Ue,n),[v,x]=f.useState(null),b=ne(t,le=>x(le)),[w,P]=f.useState(null),E=zo(w),C=(E==null?void 0:E.width)??0,O=(E==null?void 0:E.height)??0,M=o+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(a)?a:[a],j=k.length>0,D={padding:T,boundary:k.filter(qo),altBoundary:j},{refs:S,floatingStyles:$,placement:L,isPositioned:N,middlewareData:A}=No({strategy:"fixed",placement:M,whileElementsMounted:(...le)=>Co(...le,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[_o({mainAxis:r+O,alignmentAxis:s}),l&&ko({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?jo():void 0,...D}),l&&$o({...D}),Io({...D,apply:({elements:le,rects:tt,availableWidth:dn,availableHeight:pn})=>{const{width:hn,height:mn}=tt.reference,he=le.floating.style;he.setProperty("--radix-popper-available-width",`${dn}px`),he.setProperty("--radix-popper-available-height",`${pn}px`),he.setProperty("--radix-popper-anchor-width",`${hn}px`),he.setProperty("--radix-popper-anchor-height",`${mn}px`)}}),w&&Fo({element:w,padding:c}),Go({arrowWidth:C,arrowHeight:O}),h&&Wo({strategy:"referenceHidden",...D})]}),[_,B]=Xt(L),pe=Ce(m);K(()=>{N&&(pe==null||pe())},[N,pe]);const cn=(Ge=A.arrow)==null?void 0:Ge.x,ln=(Ke=A.arrow)==null?void 0:Ke.y,an=((Ze=A.arrow)==null?void 0:Ze.centerOffset)!==0,[un,fn]=f.useState();return K(()=>{v&&fn(window.getComputedStyle(v).zIndex)},[v]),R.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:N?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:un,"--radix-popper-transform-origin":[(Je=A.transformOrigin)==null?void 0:Je.x,(Qe=A.transformOrigin)==null?void 0:Qe.y].join(" "),...((et=A.hide)==null?void 0:et.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:R.jsx(Uo,{scope:n,placedSide:_,onArrowChange:P,arrowX:cn,arrowY:ln,shouldHideArrow:an,children:R.jsx(Q.div,{"data-side":_,"data-align":B,...g,ref:b,style:{...g.style,animation:N?void 0:"none"}})})})});Vt.displayName=Ue;var Ut="PopperArrow",Xo={top:"bottom",right:"left",bottom:"top",left:"right"},Yt=f.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Yo(Ut,o),s=Xo[i.placedSide];return R.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:R.jsx(Bo,{...r,ref:n,style:{...r.style,display:"block"}})})});Yt.displayName=Ut;function qo(e){return e!==null}var Go=e=>({name:"transformOrigin",options:e,fn(t){var y,v,x;const{placement:n,rects:o,middlewareData:r}=t,s=((y=r.arrow)==null?void 0:y.centerOffset)!==0,c=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[a,u]=Xt(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((v=r.arrow)==null?void 0:v.x)??0)+c/2,p=(((x=r.arrow)==null?void 0:x.y)??0)+l/2;let m="",g="";return a==="bottom"?(m=s?d:`${h}px`,g=`${-l}px`):a==="top"?(m=s?d:`${h}px`,g=`${o.floating.height+l}px`):a==="right"?(m=`${-l}px`,g=s?d:`${p}px`):a==="left"&&(m=`${o.floating.width+l}px`,g=s?d:`${p}px`),{data:{x:m,y:g}}}});function Xt(e){const[t,n="center"]=e.split("-");return[t,n]}var Ko=Ht,Zo=zt,Jo=Vt,Qo=Yt,er="Portal",qt=f.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,i]=f.useState(!1);K(()=>i(!0),[]);const s=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?yt.createPortal(R.jsx(Q.div,{...o,ref:t}),s):null});qt.displayName=er;function tr(e,t){return f.useReducer((n,o)=>t[n][o]??n,e)}var Ye=e=>{const{present:t,children:n}=e,o=nr(t),r=typeof n=="function"?n({present:o.isPresent}):f.Children.only(n),i=ne(o.ref,or(r));return typeof n=="function"||o.isPresent?f.cloneElement(r,{ref:i}):null};Ye.displayName="Presence";function nr(e){const[t,n]=f.useState(),o=f.useRef(null),r=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[c,l]=tr(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const a=ge(o.current);i.current=c==="mounted"?a:"none"},[c]),K(()=>{const a=o.current,u=r.current;if(u!==e){const h=i.current,p=ge(a);e?l("MOUNT"):p==="none"||(a==null?void 0:a.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),K(()=>{if(t){let a;const u=t.ownerDocument.defaultView??window,d=p=>{const g=ge(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(l("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",a=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=ge(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(a),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:f.useCallback(a=>{o.current=a?getComputedStyle(a):null,n(a)},[])}}function ge(e){return(e==null?void 0:e.animationName)||"none"}function or(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rr=f[" useInsertionEffect ".trim().toString()]||K;function ir({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,s]=sr({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const d=u.current;d!==c&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=c},[c,o])}const a=f.useCallback(u=>{var d;if(c){const h=cr(u)?u(e):u;h!==e&&((d=s.current)==null||d.call(s,h))}else i(u)},[c,e,i,s]);return[l,a]}function sr({defaultProp:e,onChange:t}){const[n,o]=f.useState(e),r=f.useRef(n),i=f.useRef(t);return rr(()=>{i.current=t},[t]),f.useEffect(()=>{var s;r.current!==n&&((s=i.current)==null||s.call(i,n),r.current=n)},[n,r]),[n,o,i]}function cr(e){return typeof e=="function"}var lr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ar="VisuallyHidden",Gt=f.forwardRef((e,t)=>R.jsx(Q.span,{...e,ref:t,style:{...lr,...e.style}}));Gt.displayName=ar;var ur=Gt,[Oe]=bt("Tooltip",[Wt]),Te=Wt(),Kt="TooltipProvider",fr=700,je="tooltip.open",[dr,Xe]=Oe(Kt),Zt=e=>{const{__scopeTooltip:t,delayDuration:n=fr,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,s=f.useRef(!0),c=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const a=l.current;return()=>window.clearTimeout(a)},[]),R.jsx(dr,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:f.useCallback(a=>{c.current=a},[]),disableHoverableContent:r,children:i})};Zt.displayName=Kt;var ue="Tooltip",[pr,de]=Oe(ue),Jt=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,l=Xe(ue,e.__scopeTooltip),a=Te(t),[u,d]=f.useState(null),h=kn(),p=f.useRef(0),m=s??l.disableHoverableContent,g=c??l.delayDuration,y=f.useRef(!1),[v,x]=ir({prop:o,defaultProp:r??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(je))):l.onClose(),i==null||i(C)},caller:ue}),b=f.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),w=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),P=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},g)},[g,x]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),R.jsx(Ko,{...a,children:R.jsx(pr,{scope:t,contentId:h,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayedRef.current?E():w()},[l.isOpenDelayedRef,E,w]),onTriggerLeave:f.useCallback(()=>{m?P():(window.clearTimeout(p.current),p.current=0)},[P,m]),onOpen:w,onClose:P,disableHoverableContent:m,children:n})})};Jt.displayName=ue;var $e="TooltipTrigger",Qt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=de($e,n),i=Xe($e,n),s=Te(n),c=f.useRef(null),l=ne(t,c,r.onTriggerChange),a=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>a.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),R.jsx(Zo,{asChild:!0,...s,children:R.jsx(Q.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:Y(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{r.open&&r.onClose(),a.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Y(e.onFocus,()=>{a.current||r.onOpen()}),onBlur:Y(e.onBlur,r.onClose),onClick:Y(e.onClick,r.onClose)})})});Qt.displayName=$e;var qe="TooltipPortal",[hr,mr]=Oe(qe,{forceMount:void 0}),en=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=de(qe,t);return R.jsx(hr,{scope:t,forceMount:n,children:R.jsx(Ye,{present:n||i.open,children:R.jsx(qt,{asChild:!0,container:r,children:o})})})};en.displayName=qe;var ie="TooltipContent",tn=f.forwardRef((e,t)=>{const n=mr(ie,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=de(ie,e.__scopeTooltip);return R.jsx(Ye,{present:o||s.open,children:s.disableHoverableContent?R.jsx(nn,{side:r,...i,ref:t}):R.jsx(gr,{side:r,...i,ref:t})})}),gr=f.forwardRef((e,t)=>{const n=de(ie,e.__scopeTooltip),o=Xe(ie,e.__scopeTooltip),r=f.useRef(null),i=ne(t,r),[s,c]=f.useState(null),{trigger:l,onClose:a}=n,u=r.current,{onPointerInTransitChange:d}=o,h=f.useCallback(()=>{c(null),d(!1)},[d]),p=f.useCallback((m,g)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},x=wr(v,y.getBoundingClientRect()),b=br(v,x),w=Cr(g.getBoundingClientRect()),P=Er([...b,...w]);c(P),d(!0)},[d]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&u){const m=y=>p(y,u),g=y=>p(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",g)}}},[l,u,p,h]),f.useEffect(()=>{if(s){const m=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},x=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),b=!Rr(v,s);x?h():b&&(h(),a())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,a,h]),R.jsx(nn,{...e,ref:i})}),[yr,vr]=Oe(ue,{isInside:!1}),xr=xn("TooltipContent"),nn=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,l=de(ie,n),a=Te(n),{onClose:u}=l;return f.useEffect(()=>(document.addEventListener(je,u),()=>document.removeEventListener(je,u)),[u]),f.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),R.jsx(Et,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:R.jsxs(Jo,{"data-state":l.stateAttribute,...a,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[R.jsx(xr,{children:o}),R.jsx(yr,{scope:n,isInside:!0,children:R.jsx(ur,{id:l.contentId,role:"tooltip",children:r||o})})]})})});tn.displayName=ie;var on="TooltipArrow",rn=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Te(n);return vr(on,n).isInside?null:R.jsx(Qo,{...r,...o,ref:t})});rn.displayName=on;function wr(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function br(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Cr(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Rr(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],l=t[s],a=c.x,u=c.y,d=l.x,h=l.y;u>o!=h>o&&n<(d-a)*(o-u)/(h-u)+a&&(r=!r)}return r}function Er(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Pr(t)}function Pr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ar=Zt,Or=Jt,Tr=Qt,Sr=en,Dr=tn,Lr=rn;function sn({delayDuration:e=0,...t}){return R.jsx(Ar,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Nr({...e}){return R.jsx(sn,{children:R.jsx(Or,{"data-slot":"tooltip",...e})})}function Mr({...e}){return R.jsx(Tr,{"data-slot":"tooltip-trigger",...e})}function _r({sideOffset:e=8,children:t,style:n,...o}){return R.jsx(Sr,{children:R.jsxs(Dr,{"data-slot":"tooltip-content",sideOffset:e,style:{background:"rgba(30, 33, 37, 0.96)",color:"white",fontSize:"var(--text-xs, 10px)",lineHeight:1.4,padding:"6px 12px",borderRadius:"var(--radius-lg, 8px)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.2)",zIndex:50,width:"fit-content",textWrap:"balance",animationDuration:"0.15s",...n},...o,children:[t,R.jsx(Lr,{style:{fill:"rgba(30, 33, 37, 0.96)",width:10,height:5}})]})})}exports.Tooltip=Nr;exports.TooltipContent=_r;exports.TooltipProvider=sn;exports.TooltipTrigger=Mr;
1
+ "use strict";const R=require("react/jsx-runtime"),gt=require("react"),yt=require("react-dom");function vt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=vt(gt),xt=vt(yt);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function nt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wt(...e){return t=>{let n=!1;const o=e.map(r=>{const i=nt(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():nt(e[r],null)}}}}function ne(...e){return f.useCallback(wt(...e),e)}function bt(e,t=[]){let n=[];function o(i,s){const c=f.createContext(s),l=n.length;n=[...n,s];const a=d=>{var v;const{scope:h,children:p,...m}=d,g=((v=h==null?void 0:h[e])==null?void 0:v[l])||c,y=f.useMemo(()=>m,Object.values(m));return R.jsx(g.Provider,{value:y,children:p})};a.displayName=i+"Provider";function u(d,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[l])||c,m=f.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[a,u]}const r=()=>{const i=n.map(s=>f.createContext(s));return function(c){const l=(c==null?void 0:c[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,gn(r,...t)]}function gn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((c,{useScope:l,scopeName:a})=>{const d=l(i)[`__scope${a}`];return{...c,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function yn(e){const t=vn(e),n=f.forwardRef((o,r)=>{const{children:i,...s}=o,c=f.Children.toArray(i),l=c.find(wn);if(l){const a=l.props.children,u=c.map(d=>d===l?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:d);return R.jsx(t,{...s,ref:r,children:f.isValidElement(a)?f.cloneElement(a,void 0,u):null})}return R.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function vn(e){const t=f.forwardRef((n,o)=>{const{children:r,...i}=n;if(f.isValidElement(r)){const s=Cn(r),c=bn(i,r.props);return r.type!==f.Fragment&&(c.ref=o?wt(o,s):s),f.cloneElement(r,c)}return f.Children.count(r)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ct=Symbol("radix.slottable");function xn(e){const t=({children:n})=>R.jsx(R.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ct,t}function wn(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ct}function bn(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...c)=>{const l=i(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Cn(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=Rn.reduce((e,t)=>{const n=yn(`Primitive.${t}`),o=f.forwardRef((r,i)=>{const{asChild:s,...c}=r,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(l,{...c,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function En(e,t){e&&xt.flushSync(()=>e.dispatchEvent(t))}function Ce(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function Pn(e,t=globalThis==null?void 0:globalThis.document){const n=Ce(e);f.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var An="DismissableLayer",Ne="dismissableLayer.update",On="dismissableLayer.pointerDownOutside",Tn="dismissableLayer.focusOutside",ot,Rt=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Et=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...l}=e,a=f.useContext(Rt),[u,d]=f.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),m=ne(t,C=>d(C)),g=Array.from(a.layers),[y]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),x=u?g.indexOf(u):-1,b=a.layersWithOutsidePointerEventsDisabled.size>0,w=x>=v,P=Ln(C=>{const O=C.target,M=[...a.branches].some(T=>T.contains(O));!w||M||(r==null||r(C),s==null||s(C),C.defaultPrevented||c==null||c())},h),E=Nn(C=>{const O=C.target;[...a.branches].some(T=>T.contains(O))||(i==null||i(C),s==null||s(C),C.defaultPrevented||c==null||c())},h);return Pn(C=>{x===a.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},h),f.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(ot=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),rt(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ot)}},[u,h,n,a]),f.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),rt())},[u,a]),f.useEffect(()=>{const C=()=>p({});return document.addEventListener(Ne,C),()=>document.removeEventListener(Ne,C)},[]),R.jsx(Q.div,{...l,ref:m,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,P.onPointerDownCapture)})});Et.displayName=An;var Sn="DismissableLayerBranch",Dn=f.forwardRef((e,t)=>{const n=f.useContext(Rt),o=f.useRef(null),r=ne(t,o);return f.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),R.jsx(Q.div,{...e,ref:r})});Dn.displayName=Sn;function Ln(e,t=globalThis==null?void 0:globalThis.document){const n=Ce(e),o=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const i=c=>{if(c.target&&!o.current){let l=function(){Pt(On,n,a,{discrete:!0})};const a={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Nn(e,t=globalThis==null?void 0:globalThis.document){const n=Ce(e),o=f.useRef(!1);return f.useEffect(()=>{const r=i=>{i.target&&!o.current&&Pt(Tn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function rt(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}function Pt(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?En(r,i):r.dispatchEvent(i)}var K=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Mn=f[" useId ".trim().toString()]||(()=>{}),_n=0;function kn(e){const[t,n]=f.useState(Mn());return K(()=>{e||n(o=>o??String(_n++))},[e]),e||(t?`radix-${t}`:"")}const jn=["top","right","bottom","left"],Z=Math.min,I=Math.max,ve=Math.round,me=Math.floor,V=e=>({x:e,y:e}),$n={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e,t,n){return I(e,Z(t,n))}function X(e,t){return typeof e=="function"?e(t):e}function q(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function Ie(e){return e==="x"?"y":"x"}function We(e){return e==="y"?"height":"width"}function z(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Fe(e){return Ie(z(e))}function In(e,t,n){n===void 0&&(n=!1);const o=se(e),r=Fe(e),i=We(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xe(s)),[s,xe(s)]}function Wn(e){const t=xe(e);return[_e(e),t,_e(t)]}function _e(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const it=["left","right"],st=["right","left"],Fn=["top","bottom"],Hn=["bottom","top"];function Bn(e,t,n){switch(e){case"top":case"bottom":return n?t?st:it:t?it:st;case"left":case"right":return t?Fn:Hn;default:return[]}}function zn(e,t,n,o){const r=se(e);let i=Bn(q(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(_e)))),i}function xe(e){const t=q(e);return $n[t]+e.slice(t.length)}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function At(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function we(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ct(e,t,n){let{reference:o,floating:r}=e;const i=z(t),s=Fe(t),c=We(s),l=q(t),a=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(se(t)){case"start":p[s]-=h*(n&&a?-1:1);break;case"end":p[s]+=h*(n&&a?-1:1);break}return p}async function Un(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=X(t,e),m=At(p),y=c[h?d==="floating"?"reference":"floating":d],v=we(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:l})),x=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},P=we(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:l}):x);return{top:(v.top-P.top+m.top)/w.y,bottom:(P.bottom-v.bottom+m.bottom)/w.y,left:(v.left-P.left+m.left)/w.x,right:(P.right-v.right+m.right)/w.x}}const Yn=50,Xn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:Un},l=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=ct(a,o,l),h=o,p=0;const m={};for(let g=0;g<i.length;g++){const y=i[g];if(!y)continue;const{name:v,fn:x}=y,{x:b,y:w,data:P,reset:E}=await x({x:u,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:m,rects:a,platform:c,elements:{reference:e,floating:t}});u=b??u,d=w??d,m[v]={...m[v],...P},E&&p<Yn&&(p++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(a=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):E.rects),{x:u,y:d}=ct(a,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:m}},qn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:a,padding:u=0}=X(e,t)||{};if(a==null)return{};const d=At(u),h={x:n,y:o},p=Fe(r),m=We(p),g=await s.getDimensions(a),y=p==="y",v=y?"top":"left",x=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-h[p]-i.floating[m],P=h[p]-i.reference[p],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let C=E?E[b]:0;(!C||!await(s.isElement==null?void 0:s.isElement(E)))&&(C=c.floating[b]||i.floating[m]);const O=w/2-P/2,M=C/2-g[m]/2-1,T=Z(d[v],M),k=Z(d[x],M),j=T,D=C-g[m]-k,S=C/2-g[m]/2+O,$=Me(j,S,D),L=!l.arrow&&se(r)!=null&&S!==$&&i.reference[m]/2-(S<j?T:k)-g[m]/2<0,N=L?S<j?S-j:S-D:0;return{[p]:h[p]+N,data:{[p]:$,centerOffset:S-$-N,...L&&{alignmentOffset:N}},reset:L}}}),Gn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=X(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=q(r),x=z(c),b=q(c)===c,w=await(l.isRTL==null?void 0:l.isRTL(a.floating)),P=h||(b||!g?[xe(c)]:Wn(c)),E=m!=="none";!h&&E&&P.push(...zn(c,g,m,w));const C=[c,...P],O=await l.detectOverflow(t,y),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push(O[v]),d){const S=In(r,s,w);M.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(S=>S<=0)){var k,j;const S=(((k=i.flip)==null?void 0:k.index)||0)+1,$=C[S];if($&&(!(d==="alignment"?x!==z($):!1)||T.every(A=>z(A.placement)===x?A.overflows[0]>0:!0)))return{data:{index:S,overflows:T},reset:{placement:$}};let L=(j=T.filter(N=>N.overflows[0]<=0).sort((N,A)=>N.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!L)switch(p){case"bestFit":{var D;const N=(D=T.filter(A=>{if(E){const _=z(A.placement);return _===x||_==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(_=>_>0).reduce((_,B)=>_+B,0)]).sort((A,_)=>A[1]-_[1])[0])==null?void 0:D[0];N&&(L=N);break}case"initialPlacement":L=c;break}if(r!==L)return{reset:{placement:L}}}return{}}}};function lt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function at(e){return jn.some(t=>e[t]>=0)}const Kn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=X(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),c=lt(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:at(c)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),c=lt(s,n.floating);return{data:{escapedOffsets:c,escaped:at(c)}}}default:return{}}}}},Ot=new Set(["left","top"]);async function Zn(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=q(n),c=se(n),l=z(n)==="y",a=Ot.has(s)?-1:1,u=i&&l?-1:1,d=X(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),l?{x:p*u,y:h*a}:{x:h*a,y:p*u}}const Jn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await Zn(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},Qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:v=>{let{x,y:b}=v;return{x,y:b}}},...a}=X(e,t),u={x:n,y:o},d=await i.detectOverflow(t,a),h=z(q(r)),p=Ie(h);let m=u[p],g=u[h];if(s){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=m+d[v],w=m-d[x];m=Me(b,m,w)}if(c){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=g+d[v],w=g-d[x];g=Me(b,g,w)}const y=l.fn({...t,[p]:m,[h]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:s,[h]:c}}}}}},eo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:l=!0,crossAxis:a=!0}=X(e,t),u={x:n,y:o},d=z(r),h=Ie(d);let p=u[h],m=u[d];const g=X(c,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=h==="y"?"height":"width",w=i.reference[h]-i.floating[b]+y.mainAxis,P=i.reference[h]+i.reference[b]-y.mainAxis;p<w?p=w:p>P&&(p=P)}if(a){var v,x;const b=h==="y"?"width":"height",w=Ot.has(q(r)),P=i.reference[d]-i.floating[b]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:y.crossAxis),E=i.reference[d]+i.reference[b]+(w?0:((x=s.offset)==null?void 0:x[d])||0)-(w?y.crossAxis:0);m<P?m=P:m>E&&(m=E)}return{[h]:p,[d]:m}}}},to=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:c}=t,{apply:l=()=>{},...a}=X(e,t),u=await s.detectOverflow(t,a),d=q(r),h=se(r),p=z(r)==="y",{width:m,height:g}=i.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=h===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,y=h==="end"?"top":"bottom");const x=g-u.top-u.bottom,b=m-u.left-u.right,w=Z(g-u[y],x),P=Z(m-u[v],b),E=!t.middlewareData.shift;let C=w,O=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=x),E&&!h){const T=I(u.left,0),k=I(u.right,0),j=I(u.top,0),D=I(u.bottom,0);p?O=m-2*(T!==0||k!==0?T+k:I(u.left,u.right)):C=g-2*(j!==0||D!==0?j+D:I(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:C});const M=await s.getDimensions(c.floating);return m!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Re(){return typeof window<"u"}function ce(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return Re()?e instanceof Node||e instanceof W(e).Node:!1}function F(e){return Re()?e instanceof Element||e instanceof W(e).Element:!1}function G(e){return Re()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function ut(e){return!Re()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function no(e){return/^(table|td|th)$/.test(ce(e))}function Ee(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const oo=/transform|translate|scale|rotate|perspective|filter/,ro=/paint|layout|strict|content/,ee=e=>!!e&&e!=="none";let Se;function He(e){const t=F(e)?H(e):e;return ee(t.transform)||ee(t.translate)||ee(t.scale)||ee(t.rotate)||ee(t.perspective)||!Be()&&(ee(t.backdropFilter)||ee(t.filter))||oo.test(t.willChange||"")||ro.test(t.contain||"")}function io(e){let t=J(e);for(;G(t)&&!re(t);){if(He(t))return t;if(Ee(t))return null;t=J(t)}return null}function Be(){return Se==null&&(Se=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Se}function re(e){return/^(html|body|#document)$/.test(ce(e))}function H(e){return W(e).getComputedStyle(e)}function Pe(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ut(e)&&e.host||U(e);return ut(t)?t.host:t}function St(e){const t=J(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&fe(t)?t:St(t)}function ae(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=St(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=W(r);if(i){const c=ke(s);return t.concat(s,s.visualViewport||[],fe(r)?r:[],c&&n?ae(c):[])}else return t.concat(r,ae(r,[],n))}function ke(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dt(e){const t=H(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=G(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=ve(n)!==i||ve(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function ze(e){return F(e)?e:e.contextElement}function oe(e){const t=ze(e);if(!G(t))return V(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Dt(t);let s=(i?ve(n.width):n.width)/o,c=(i?ve(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const so=V(0);function Lt(e){const t=W(e);return!Be()||!t.visualViewport?so:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function co(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function te(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ze(e);let s=V(1);t&&(o?F(o)&&(s=oe(o)):s=oe(e));const c=co(i,n,o)?Lt(i):V(0);let l=(r.left+c.x)/s.x,a=(r.top+c.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const h=W(i),p=o&&F(o)?W(o):o;let m=h,g=ke(m);for(;g&&o&&p!==m;){const y=oe(g),v=g.getBoundingClientRect(),x=H(g),b=v.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,w=v.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,a*=y.y,u*=y.x,d*=y.y,l+=b,a+=w,m=W(g),g=ke(m)}}return we({width:u,height:d,x:l,y:a})}function Ae(e,t){const n=Pe(e).scrollLeft;return t?t.left+n:te(U(e)).left+n}function Nt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ae(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function lo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=U(o),c=t?Ee(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=V(1);const u=V(0),d=G(o);if((d||!d&&!i)&&((ce(o)!=="body"||fe(s))&&(l=Pe(o)),d)){const p=te(o);a=oe(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}const h=s&&!d&&!i?Nt(s,l):V(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+h.x,y:n.y*a.y-l.scrollTop*a.y+u.y+h.y}}function ao(e){return Array.from(e.getClientRects())}function uo(e){const t=U(e),n=Pe(e),o=e.ownerDocument.body,r=I(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=I(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ae(e);const c=-n.scrollTop;return H(o).direction==="rtl"&&(s+=I(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}const ft=25;function fo(e,t){const n=W(e),o=U(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,l=0;if(r){i=r.width,s=r.height;const u=Be();(!u||u&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const a=Ae(o);if(a<=0){const u=o.ownerDocument,d=u.body,h=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-d.clientWidth-p);m<=ft&&(i-=m)}else a<=ft&&(i+=a);return{width:i,height:s,x:c,y:l}}function po(e,t){const n=te(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=G(e)?oe(e):V(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,a=o*i.y;return{width:s,height:c,x:l,y:a}}function dt(e,t,n){let o;if(t==="viewport")o=fo(e,n);else if(t==="document")o=uo(U(e));else if(F(t))o=po(t,n);else{const r=Lt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return we(o)}function Mt(e,t){const n=J(e);return n===t||!F(n)||re(n)?!1:H(n).position==="fixed"||Mt(n,t)}function ho(e,t){const n=t.get(e);if(n)return n;let o=ae(e,[],!1).filter(c=>F(c)&&ce(c)!=="body"),r=null;const i=H(e).position==="fixed";let s=i?J(e):e;for(;F(s)&&!re(s);){const c=H(s),l=He(s);!l&&c.position==="fixed"&&(r=null),(i?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||fe(s)&&!l&&Mt(e,s))?o=o.filter(u=>u!==s):r=c,s=J(s)}return t.set(e,o),o}function mo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Ee(t)?[]:ho(t,this._c):[].concat(n),o],c=dt(t,s[0],r);let l=c.top,a=c.right,u=c.bottom,d=c.left;for(let h=1;h<s.length;h++){const p=dt(t,s[h],r);l=I(p.top,l),a=Z(p.right,a),u=Z(p.bottom,u),d=I(p.left,d)}return{width:a-d,height:u-l,x:d,y:l}}function go(e){const{width:t,height:n}=Dt(e);return{width:t,height:n}}function yo(e,t,n){const o=G(t),r=U(t),i=n==="fixed",s=te(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=V(0);function a(){l.x=Ae(r)}if(o||!o&&!i)if((ce(t)!=="body"||fe(r))&&(c=Pe(t)),o){const p=te(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else r&&a();i&&!o&&r&&a();const u=r&&!o&&!i?Nt(r,c):V(0),d=s.left+c.scrollLeft-l.x-u.x,h=s.top+c.scrollTop-l.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function De(e){return H(e).position==="static"}function pt(e,t){if(!G(e)||H(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){const n=W(e);if(Ee(e))return n;if(!G(e)){let r=J(e);for(;r&&!re(r);){if(F(r)&&!De(r))return r;r=J(r)}return n}let o=pt(e,t);for(;o&&no(o)&&De(o);)o=pt(o,t);return o&&re(o)&&De(o)&&!He(o)?n:o||io(e)||n}const vo=async function(e){const t=this.getOffsetParent||_t,n=this.getDimensions,o=await n(e.floating);return{reference:yo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xo(e){return H(e).direction==="rtl"}const wo={convertOffsetParentRelativeRectToViewportRelativeRect:lo,getDocumentElement:U,getClippingRect:mo,getOffsetParent:_t,getElementRects:vo,getClientRects:ao,getDimensions:go,getScale:oe,isElement:F,isRTL:xo};function kt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bo(e,t){let n=null,o;const r=U(e);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const a=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=a;if(c||t(),!h||!p)return;const m=me(d),g=me(r.clientWidth-(u+h)),y=me(r.clientHeight-(d+p)),v=me(u),b={rootMargin:-m+"px "+-g+"px "+-y+"px "+-v+"px",threshold:I(0,Z(1,l))||1};let w=!0;function P(E){const C=E[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!kt(a,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(P,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(e)}return s(!0),i}function Co(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ze(e),u=r||i?[...a?ae(a):[],...t?ae(t):[]]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=a&&c?bo(a,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===a&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),a&&!l&&p.observe(a),t&&p.observe(t));let m,g=l?te(e):null;l&&y();function y(){const v=te(e);g&&!kt(g,v)&&n(),g=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Ro=Jn,Eo=Qn,Po=Gn,Ao=to,Oo=Kn,ht=qn,To=eo,So=(e,t,n)=>{const o=new Map,r={platform:wo,...n},i={...r.platform,_c:o};return Xn(e,t,{...r,platform:i})};var Do=typeof document<"u",Lo=function(){},ye=Do?gt.useLayoutEffect:Lo;function be(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!be(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!be(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mt(e,t){const n=jt(e);return Math.round(t*n)/n}function Le(e){const t=f.useRef(e);return ye(()=>{t.current=e}),t}function No(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(o);be(h,o)||p(o);const[m,g]=f.useState(null),[y,v]=f.useState(null),x=f.useCallback(A=>{A!==E.current&&(E.current=A,g(A))},[]),b=f.useCallback(A=>{A!==C.current&&(C.current=A,v(A))},[]),w=i||m,P=s||y,E=f.useRef(null),C=f.useRef(null),O=f.useRef(u),M=l!=null,T=Le(l),k=Le(r),j=Le(a),D=f.useCallback(()=>{if(!E.current||!C.current)return;const A={placement:t,strategy:n,middleware:h};k.current&&(A.platform=k.current),So(E.current,C.current,A).then(_=>{const B={..._,isPositioned:j.current!==!1};S.current&&!be(O.current,B)&&(O.current=B,xt.flushSync(()=>{d(B)}))})},[h,t,n,k,j]);ye(()=>{a===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[a]);const S=f.useRef(!1);ye(()=>(S.current=!0,()=>{S.current=!1}),[]),ye(()=>{if(w&&(E.current=w),P&&(C.current=P),w&&P){if(T.current)return T.current(w,P,D);D()}},[w,P,D,T,M]);const $=f.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:b}),[x,b]),L=f.useMemo(()=>({reference:w,floating:P}),[w,P]),N=f.useMemo(()=>{const A={position:n,left:0,top:0};if(!L.floating)return A;const _=mt(L.floating,u.x),B=mt(L.floating,u.y);return c?{...A,transform:"translate("+_+"px, "+B+"px)",...jt(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:B}},[n,c,L.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:D,refs:$,elements:L,floatingStyles:N}),[u,D,$,L,N])}const Mo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ht({element:o.current,padding:r}).fn(n):{}:o?ht({element:o,padding:r}).fn(n):{}}}},_o=(e,t)=>{const n=Ro(e);return{name:n.name,fn:n.fn,options:[e,t]}},ko=(e,t)=>{const n=Eo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>({fn:To(e).fn,options:[e,t]}),$o=(e,t)=>{const n=Po(e);return{name:n.name,fn:n.fn,options:[e,t]}},Io=(e,t)=>{const n=Ao(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wo=(e,t)=>{const n=Oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fo=(e,t)=>{const n=Mo(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ho="Arrow",$t=f.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return R.jsx(Q.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:R.jsx("polygon",{points:"0,0 30,0 15,10"})})});$t.displayName=Ho;var Bo=$t;function zo(e){const[t,n]=f.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,c;if("borderBoxSize"in i){const l=i.borderBoxSize,a=Array.isArray(l)?l[0]:l;s=a.inlineSize,c=a.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Ve="Popper",[It,Wt]=bt(Ve),[Vo,Ft]=It(Ve),Ht=e=>{const{__scopePopper:t,children:n}=e,[o,r]=f.useState(null);return R.jsx(Vo,{scope:t,anchor:o,onAnchorChange:r,children:n})};Ht.displayName=Ve;var Bt="PopperAnchor",zt=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Ft(Bt,n),s=f.useRef(null),c=ne(t,s),l=f.useRef(null);return f.useEffect(()=>{const a=l.current;l.current=(o==null?void 0:o.current)||s.current,a!==l.current&&i.onAnchorChange(l.current)}),o?null:R.jsx(Q.div,{...r,ref:c})});zt.displayName=Bt;var Ue="PopperContent",[Uo,Yo]=It(Ue),Vt=f.forwardRef((e,t)=>{var Ge,Ke,Ze,Je,Qe,et;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:a=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,y=Ft(Ue,n),[v,x]=f.useState(null),b=ne(t,le=>x(le)),[w,P]=f.useState(null),E=zo(w),C=(E==null?void 0:E.width)??0,O=(E==null?void 0:E.height)??0,M=o+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(a)?a:[a],j=k.length>0,D={padding:T,boundary:k.filter(qo),altBoundary:j},{refs:S,floatingStyles:$,placement:L,isPositioned:N,middlewareData:A}=No({strategy:"fixed",placement:M,whileElementsMounted:(...le)=>Co(...le,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[_o({mainAxis:r+O,alignmentAxis:s}),l&&ko({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?jo():void 0,...D}),l&&$o({...D}),Io({...D,apply:({elements:le,rects:tt,availableWidth:dn,availableHeight:pn})=>{const{width:hn,height:mn}=tt.reference,he=le.floating.style;he.setProperty("--radix-popper-available-width",`${dn}px`),he.setProperty("--radix-popper-available-height",`${pn}px`),he.setProperty("--radix-popper-anchor-width",`${hn}px`),he.setProperty("--radix-popper-anchor-height",`${mn}px`)}}),w&&Fo({element:w,padding:c}),Go({arrowWidth:C,arrowHeight:O}),h&&Wo({strategy:"referenceHidden",...D})]}),[_,B]=Xt(L),pe=Ce(m);K(()=>{N&&(pe==null||pe())},[N,pe]);const cn=(Ge=A.arrow)==null?void 0:Ge.x,ln=(Ke=A.arrow)==null?void 0:Ke.y,an=((Ze=A.arrow)==null?void 0:Ze.centerOffset)!==0,[un,fn]=f.useState();return K(()=>{v&&fn(window.getComputedStyle(v).zIndex)},[v]),R.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:N?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:un,"--radix-popper-transform-origin":[(Je=A.transformOrigin)==null?void 0:Je.x,(Qe=A.transformOrigin)==null?void 0:Qe.y].join(" "),...((et=A.hide)==null?void 0:et.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:R.jsx(Uo,{scope:n,placedSide:_,onArrowChange:P,arrowX:cn,arrowY:ln,shouldHideArrow:an,children:R.jsx(Q.div,{"data-side":_,"data-align":B,...g,ref:b,style:{...g.style,animation:N?void 0:"none"}})})})});Vt.displayName=Ue;var Ut="PopperArrow",Xo={top:"bottom",right:"left",bottom:"top",left:"right"},Yt=f.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Yo(Ut,o),s=Xo[i.placedSide];return R.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:R.jsx(Bo,{...r,ref:n,style:{...r.style,display:"block"}})})});Yt.displayName=Ut;function qo(e){return e!==null}var Go=e=>({name:"transformOrigin",options:e,fn(t){var y,v,x;const{placement:n,rects:o,middlewareData:r}=t,s=((y=r.arrow)==null?void 0:y.centerOffset)!==0,c=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[a,u]=Xt(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((v=r.arrow)==null?void 0:v.x)??0)+c/2,p=(((x=r.arrow)==null?void 0:x.y)??0)+l/2;let m="",g="";return a==="bottom"?(m=s?d:`${h}px`,g=`${-l}px`):a==="top"?(m=s?d:`${h}px`,g=`${o.floating.height+l}px`):a==="right"?(m=`${-l}px`,g=s?d:`${p}px`):a==="left"&&(m=`${o.floating.width+l}px`,g=s?d:`${p}px`),{data:{x:m,y:g}}}});function Xt(e){const[t,n="center"]=e.split("-");return[t,n]}var Ko=Ht,Zo=zt,Jo=Vt,Qo=Yt,er="Portal",qt=f.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,i]=f.useState(!1);K(()=>i(!0),[]);const s=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?yt.createPortal(R.jsx(Q.div,{...o,ref:t}),s):null});qt.displayName=er;function tr(e,t){return f.useReducer((n,o)=>t[n][o]??n,e)}var Ye=e=>{const{present:t,children:n}=e,o=nr(t),r=typeof n=="function"?n({present:o.isPresent}):f.Children.only(n),i=ne(o.ref,or(r));return typeof n=="function"||o.isPresent?f.cloneElement(r,{ref:i}):null};Ye.displayName="Presence";function nr(e){const[t,n]=f.useState(),o=f.useRef(null),r=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[c,l]=tr(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const a=ge(o.current);i.current=c==="mounted"?a:"none"},[c]),K(()=>{const a=o.current,u=r.current;if(u!==e){const h=i.current,p=ge(a);e?l("MOUNT"):p==="none"||(a==null?void 0:a.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),K(()=>{if(t){let a;const u=t.ownerDocument.defaultView??window,d=p=>{const g=ge(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(l("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",a=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=p=>{p.target===t&&(i.current=ge(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(a),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:f.useCallback(a=>{o.current=a?getComputedStyle(a):null,n(a)},[])}}function ge(e){return(e==null?void 0:e.animationName)||"none"}function or(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rr=f[" useInsertionEffect ".trim().toString()]||K;function ir({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,s]=sr({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const d=u.current;d!==c&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=c},[c,o])}const a=f.useCallback(u=>{var d;if(c){const h=cr(u)?u(e):u;h!==e&&((d=s.current)==null||d.call(s,h))}else i(u)},[c,e,i,s]);return[l,a]}function sr({defaultProp:e,onChange:t}){const[n,o]=f.useState(e),r=f.useRef(n),i=f.useRef(t);return rr(()=>{i.current=t},[t]),f.useEffect(()=>{var s;r.current!==n&&((s=i.current)==null||s.call(i,n),r.current=n)},[n,r]),[n,o,i]}function cr(e){return typeof e=="function"}var lr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ar="VisuallyHidden",Gt=f.forwardRef((e,t)=>R.jsx(Q.span,{...e,ref:t,style:{...lr,...e.style}}));Gt.displayName=ar;var ur=Gt,[Oe,kr]=bt("Tooltip",[Wt]),Te=Wt(),Kt="TooltipProvider",fr=700,je="tooltip.open",[dr,Xe]=Oe(Kt),Zt=e=>{const{__scopeTooltip:t,delayDuration:n=fr,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,s=f.useRef(!0),c=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const a=l.current;return()=>window.clearTimeout(a)},[]),R.jsx(dr,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:f.useCallback(a=>{c.current=a},[]),disableHoverableContent:r,children:i})};Zt.displayName=Kt;var ue="Tooltip",[pr,de]=Oe(ue),Jt=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,l=Xe(ue,e.__scopeTooltip),a=Te(t),[u,d]=f.useState(null),h=kn(),p=f.useRef(0),m=s??l.disableHoverableContent,g=c??l.delayDuration,y=f.useRef(!1),[v,x]=ir({prop:o,defaultProp:r??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(je))):l.onClose(),i==null||i(C)},caller:ue}),b=f.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),w=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),P=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},g)},[g,x]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),R.jsx(Ko,{...a,children:R.jsx(pr,{scope:t,contentId:h,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayedRef.current?E():w()},[l.isOpenDelayedRef,E,w]),onTriggerLeave:f.useCallback(()=>{m?P():(window.clearTimeout(p.current),p.current=0)},[P,m]),onOpen:w,onClose:P,disableHoverableContent:m,children:n})})};Jt.displayName=ue;var $e="TooltipTrigger",Qt=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=de($e,n),i=Xe($e,n),s=Te(n),c=f.useRef(null),l=ne(t,c,r.onTriggerChange),a=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>a.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),R.jsx(Zo,{asChild:!0,...s,children:R.jsx(Q.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:Y(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{r.open&&r.onClose(),a.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Y(e.onFocus,()=>{a.current||r.onOpen()}),onBlur:Y(e.onBlur,r.onClose),onClick:Y(e.onClick,r.onClose)})})});Qt.displayName=$e;var qe="TooltipPortal",[hr,mr]=Oe(qe,{forceMount:void 0}),en=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=de(qe,t);return R.jsx(hr,{scope:t,forceMount:n,children:R.jsx(Ye,{present:n||i.open,children:R.jsx(qt,{asChild:!0,container:r,children:o})})})};en.displayName=qe;var ie="TooltipContent",tn=f.forwardRef((e,t)=>{const n=mr(ie,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=de(ie,e.__scopeTooltip);return R.jsx(Ye,{present:o||s.open,children:s.disableHoverableContent?R.jsx(nn,{side:r,...i,ref:t}):R.jsx(gr,{side:r,...i,ref:t})})}),gr=f.forwardRef((e,t)=>{const n=de(ie,e.__scopeTooltip),o=Xe(ie,e.__scopeTooltip),r=f.useRef(null),i=ne(t,r),[s,c]=f.useState(null),{trigger:l,onClose:a}=n,u=r.current,{onPointerInTransitChange:d}=o,h=f.useCallback(()=>{c(null),d(!1)},[d]),p=f.useCallback((m,g)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},x=wr(v,y.getBoundingClientRect()),b=br(v,x),w=Cr(g.getBoundingClientRect()),P=Er([...b,...w]);c(P),d(!0)},[d]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(l&&u){const m=y=>p(y,u),g=y=>p(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",g)}}},[l,u,p,h]),f.useEffect(()=>{if(s){const m=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},x=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),b=!Rr(v,s);x?h():b&&(h(),a())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,a,h]),R.jsx(nn,{...e,ref:i})}),[yr,vr]=Oe(ue,{isInside:!1}),xr=xn("TooltipContent"),nn=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,l=de(ie,n),a=Te(n),{onClose:u}=l;return f.useEffect(()=>(document.addEventListener(je,u),()=>document.removeEventListener(je,u)),[u]),f.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),R.jsx(Et,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:R.jsxs(Jo,{"data-state":l.stateAttribute,...a,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[R.jsx(xr,{children:o}),R.jsx(yr,{scope:n,isInside:!0,children:R.jsx(ur,{id:l.contentId,role:"tooltip",children:r||o})})]})})});tn.displayName=ie;var on="TooltipArrow",rn=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Te(n);return vr(on,n).isInside?null:R.jsx(Qo,{...r,...o,ref:t})});rn.displayName=on;function wr(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function br(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Cr(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Rr(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],l=t[s],a=c.x,u=c.y,d=l.x,h=l.y;u>o!=h>o&&n<(d-a)*(o-u)/(h-u)+a&&(r=!r)}return r}function Er(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Pr(t)}function Pr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ar=Zt,Or=Jt,Tr=Qt,Sr=en,Dr=tn,Lr=rn;function sn({delayDuration:e=0,...t}){return R.jsx(Ar,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Nr({...e}){return R.jsx(sn,{children:R.jsx(Or,{"data-slot":"tooltip",...e})})}function Mr({...e}){return R.jsx(Tr,{"data-slot":"tooltip-trigger",...e})}function _r({sideOffset:e=8,children:t,style:n,...o}){return R.jsx(Sr,{children:R.jsxs(Dr,{"data-slot":"tooltip-content",sideOffset:e,style:{background:"rgba(30, 33, 37, 0.96)",color:"white",fontSize:"var(--text-xs, 10px)",lineHeight:1.4,padding:"6px 12px",borderRadius:"var(--radius-lg, 8px)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.2)",zIndex:50,width:"fit-content",textWrap:"balance",animationDuration:"0.15s",...n},...o,children:[t,R.jsx(Lr,{style:{fill:"rgba(30, 33, 37, 0.96)",width:10,height:5}})]})})}exports.Tooltip=Nr;exports.TooltipContent=_r;exports.TooltipProvider=sn;exports.TooltipTrigger=Mr;
2
2
  //# sourceMappingURL=Tooltip.cjs.js.map