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 +0,0 @@
1
- {"version":3,"file":"SplitPane.es.js","sources":["../src/components/layout/FirstCallScreen.jsx","../src/components/layout/OnboardingChecklist.jsx","../src/components/layout/DemoProjectBanner.jsx","../src/components/layout/LoginForm.jsx","../src/components/layout/SplitPane.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useRef } from \"react\";\nimport { Upload, Link, Sparkles, CheckCircle2, X } from \"lucide-react\";\n\n/**\n * FirstCallScreen Component\n * Displays an onboarding screen with three options for getting started:\n * Upload an interaction, Explore a demonstration project, or Connect a data source.\n */\nexport default function FirstCallScreen({\n onUploadCall,\n onConnectSource,\n onUseSample,\n showExamples = false,\n}) {\n const [hoveredCard, setHoveredCard] = useState(null);\n const [uploadedFile, setUploadedFile] = useState(null);\n const [connectedSource, setConnectedSource] = useState(null);\n const [selectedProject, setSelectedProject] = useState(null);\n const fileInputRef = useRef(null);\n\n // Dummy data sources for testing\n const dummyDataSources = [\n { id: \"five9\", name: \"Five9\", status: \"available\", description: \"Cloud contact center platform\" },\n { id: \"twilio\", name: \"Twilio Flex\", status: \"available\", description: \"Programmable contact center\" },\n { id: \"genesys\", name: \"Genesys Cloud\", status: \"available\", description: \"All-in-one cloud contact center\" },\n { id: \"zoom\", name: \"Zoom Phone\", status: \"coming-soon\", description: \"Cloud phone system\" },\n ];\n\n // Dummy demo projects for testing\n const dummyProjects = [\n {\n id: \"retail-support\",\n name: \"Retail Customer Support\",\n description: \"Sample interactions from retail customer service team\",\n interactions: 24,\n dateRange: \"Last 30 days\",\n },\n {\n id: \"healthcare-billing\",\n name: \"Healthcare Billing Inquiries\",\n description: \"Patient billing and insurance verification calls\",\n interactions: 18,\n dateRange: \"Last 2 weeks\",\n },\n {\n id: \"financial-services\",\n name: \"Financial Services Compliance\",\n description: \"Banking and financial advisory interactions\",\n interactions: 32,\n dateRange: \"Last 45 days\",\n },\n ];\n\n const handleFileUpload = (event) => {\n const file = event.target.files?.[0];\n if (file) {\n // Check if file is audio or video\n const isAudio = file.type.startsWith(\"audio/\");\n const isVideo = file.type.startsWith(\"video/\");\n \n if (isAudio || isVideo) {\n setUploadedFile({\n name: file.name,\n type: file.type,\n size: file.size,\n lastModified: new Date(file.lastModified),\n });\n if (onUploadCall) {\n onUploadCall(file);\n } else {\n console.log(\"File uploaded:\", file.name, file.type, `(${(file.size / 1024 / 1024).toFixed(2)} MB)`);\n }\n } else {\n alert(\"Please select an audio or video file.\");\n }\n }\n // Reset input so the same file can be selected again\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n };\n\n const handleConnectSource = (sourceId) => {\n const source = dummyDataSources.find((s) => s.id === sourceId);\n if (source && source.status === \"available\") {\n setConnectedSource(source);\n if (onConnectSource) {\n onConnectSource(source);\n } else {\n console.log(\"Connected to:\", source.name);\n }\n }\n };\n\n const handleSelectProject = (projectId) => {\n const project = dummyProjects.find((p) => p.id === projectId);\n if (project) {\n setSelectedProject(project);\n if (onUseSample) {\n onUseSample(project);\n } else {\n console.log(\"Selected project:\", project.name);\n }\n }\n };\n\n const handleUploadClick = () => {\n if (fileInputRef.current) {\n fileInputRef.current.click();\n }\n };\n\n const handleSampleClick = () => {\n if (showExamples && !selectedProject) {\n // Show project selection if examples are enabled\n return;\n }\n if (onUseSample) {\n onUseSample(selectedProject || { id: \"default\", name: \"Demo Project\" });\n }\n };\n\n const handleConnectClick = () => {\n if (showExamples && !connectedSource) {\n // Show data source selection if examples are enabled\n return;\n }\n if (onConnectSource) {\n onConnectSource(connectedSource || { id: \"default\", name: \"Data Source\" });\n }\n };\n\n const options = [\n {\n id: \"upload\",\n icon: Upload,\n title: \"Upload an interaction\",\n description:\n \"Drop an audio or video recording to see what Compass surfaces\",\n recommended: false,\n onClick: handleUploadClick,\n },\n {\n id: \"sample\",\n icon: Sparkles,\n title: \"Explore a demonstration project\",\n description:\n \"See how Chordia Compass surfaces insights from real interaction data\",\n recommended: true,\n onClick: handleSampleClick,\n },\n {\n id: \"connect\",\n icon: Link,\n title: \"Connect a data source\",\n description:\n \"Link your existing system to automatically analyze interactions\",\n recommended: false,\n onClick: handleConnectClick,\n },\n ];\n\n return (\n <div\n style={{\n minHeight: \"100vh\",\n background: \"var(--surface-warm)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"32px\",\n }}\n >\n {/* Hidden file input */}\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"audio/*,video/*\"\n onChange={handleFileUpload}\n style={{ display: \"none\" }}\n />\n <div style={{ maxWidth: \"680px\", width: \"100%\" }}>\n {/* Header */}\n <div style={{ textAlign: \"center\", marginBottom: \"48px\" }}>\n <h1\n style={{\n fontSize: \"32px\",\n fontWeight: 760,\n letterSpacing: \"-0.02em\",\n color: \"rgba(30, 33, 37, 0.92)\",\n marginBottom: \"12px\",\n lineHeight: 1.2,\n }}\n >\n Experience Compass with one interaction\n </h1>\n <p\n style={{\n fontSize: \"15px\",\n color: \"rgba(30, 33, 37, 0.65)\",\n lineHeight: 1.5,\n maxWidth: \"520px\",\n margin: \"0 auto\",\n }}\n >\n Compass surfaces evidence, signals, and actionable insights from\n customer interactions. Start by exploring what it reveals.\n </p>\n </div>\n\n {/* Options */}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n }}\n >\n {options.map((option) => {\n const Icon = option.icon;\n const isHovered = hoveredCard === option.id;\n\n return (\n <button\n key={option.id}\n type=\"button\"\n onClick={option.onClick}\n onMouseEnter={() => setHoveredCard(option.id)}\n onMouseLeave={() => setHoveredCard(null)}\n style={{\n position: \"relative\",\n width: \"100%\",\n padding: \"24px 28px\",\n background: isHovered\n ? \"rgba(255, 255, 255, 0.95)\"\n : \"rgba(255, 255, 255, 0.85)\",\n border: option.recommended\n ? \"2px solid rgba(184, 156, 106, 0.35)\"\n : isHovered\n ? \"1px solid rgba(52, 58, 64, 0.20)\"\n : \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"16px\",\n cursor: \"pointer\",\n textAlign: \"left\",\n transition: \"all 0.2s ease\",\n transform: isHovered ? \"translateY(-2px)\" : \"translateY(0)\",\n boxShadow: isHovered\n ? \"0 12px 28px rgba(30, 33, 37, 0.12)\"\n : \"0 4px 12px rgba(30, 33, 37, 0.06)\",\n }}\n >\n {/* Recommended badge */}\n {option.recommended && (\n <div\n style={{\n position: \"absolute\",\n top: \"16px\",\n right: \"20px\",\n fontSize: \"10px\",\n fontWeight: 650,\n letterSpacing: \"0.06em\",\n textTransform: \"uppercase\",\n color: \"rgba(184, 156, 106, 0.75)\",\n background: \"rgba(184, 156, 106, 0.12)\",\n padding: \"4px 8px\",\n borderRadius: \"6px\",\n border: \"1px solid rgba(184, 156, 106, 0.2)\",\n }}\n >\n Recommended\n </div>\n )}\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: \"18px\",\n }}\n >\n {/* Icon */}\n <div\n style={{\n width: \"48px\",\n height: \"48px\",\n borderRadius: \"12px\",\n background: option.recommended\n ? \"rgba(184, 156, 106, 0.12)\"\n : \"rgba(231, 212, 162, 0.20)\",\n border: option.recommended\n ? \"1px solid rgba(184, 156, 106, 0.25)\"\n : \"1px solid rgba(231, 212, 162, 0.35)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n <Icon\n size={22}\n style={{\n color: option.recommended\n ? \"rgba(184, 156, 106, 0.75)\"\n : \"rgba(30, 33, 37, 0.52)\",\n }}\n />\n </div>\n\n {/* Content */}\n <div style={{ flex: 1, paddingTop: \"2px\" }}>\n <div\n style={{\n fontSize: \"17px\",\n fontWeight: 680,\n letterSpacing: \"-0.01em\",\n color: \"rgba(30, 33, 37, 0.92)\",\n marginBottom: \"6px\",\n lineHeight: 1.3,\n }}\n >\n {option.title}\n </div>\n <div\n style={{\n fontSize: \"13.5px\",\n color: \"rgba(30, 33, 37, 0.62)\",\n lineHeight: 1.5,\n }}\n >\n {option.description}\n </div>\n </div>\n </div>\n </button>\n );\n })}\n </div>\n\n {/* Footer note */}\n <div\n style={{\n marginTop: \"32px\",\n textAlign: \"center\",\n fontSize: \"12px\",\n color: \"rgba(30, 33, 37, 0.52)\",\n lineHeight: 1.5,\n }}\n >\n Your workspace has been created automatically. You can configure\n settings and add teammates later.\n </div>\n\n {/* Testing Examples Section */}\n {showExamples && (\n <div style={{ marginTop: \"48px\", paddingTop: \"32px\", borderTop: \"1px solid rgba(52, 58, 64, 0.12)\" }}>\n <h2\n style={{\n fontSize: \"20px\",\n fontWeight: 680,\n letterSpacing: \"-0.01em\",\n color: \"rgba(30, 33, 37, 0.92)\",\n marginBottom: \"24px\",\n }}\n >\n Testing Examples\n </h2>\n\n {/* Uploaded File Example */}\n {uploadedFile && (\n <div\n style={{\n marginBottom: \"24px\",\n padding: \"16px\",\n background: \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"12px\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", marginBottom: \"8px\" }}>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\" }}>\n <CheckCircle2 size={18} style={{ color: \"#1F8F5A\" }} />\n <span style={{ fontSize: \"14px\", fontWeight: 650, color: \"rgba(30, 33, 37, 0.92)\" }}>\n File Uploaded\n </span>\n </div>\n <button\n onClick={() => setUploadedFile(null)}\n style={{\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n padding: \"4px\",\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <X size={16} style={{ color: \"rgba(30, 33, 37, 0.42)\" }} />\n </button>\n </div>\n <div style={{ fontSize: \"13px\", color: \"rgba(30, 33, 37, 0.65)\", lineHeight: 1.5 }}>\n <div><strong>Name:</strong> {uploadedFile.name}</div>\n <div><strong>Type:</strong> {uploadedFile.type}</div>\n <div><strong>Size:</strong> {(uploadedFile.size / 1024 / 1024).toFixed(2)} MB</div>\n <div><strong>Uploaded:</strong> {uploadedFile.lastModified.toLocaleString()}</div>\n </div>\n </div>\n )}\n\n {/* Demo Projects Selection */}\n {!selectedProject && (\n <div style={{ marginBottom: \"24px\" }}>\n <h3\n style={{\n fontSize: \"15px\",\n fontWeight: 650,\n color: \"rgba(30, 33, 37, 0.82)\",\n marginBottom: \"12px\",\n }}\n >\n Select a Demonstration Project:\n </h3>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"8px\" }}>\n {dummyProjects.map((project) => (\n <button\n key={project.id}\n onClick={() => handleSelectProject(project.id)}\n style={{\n padding: \"12px 16px\",\n background: \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"8px\",\n textAlign: \"left\",\n cursor: \"pointer\",\n transition: \"all 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"rgba(255, 255, 255, 0.95)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.20)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"rgba(255, 255, 255, 0.85)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.12)\";\n }}\n >\n <div style={{ fontSize: \"14px\", fontWeight: 650, color: \"rgba(30, 33, 37, 0.92)\", marginBottom: \"4px\" }}>\n {project.name}\n </div>\n <div style={{ fontSize: \"12px\", color: \"rgba(30, 33, 37, 0.62)\", marginBottom: \"4px\" }}>\n {project.description}\n </div>\n <div style={{ fontSize: \"11px\", color: \"rgba(30, 33, 37, 0.52)\" }}>\n {project.interactions} interactions · {project.dateRange}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Selected Project Example */}\n {selectedProject && (\n <div\n style={{\n marginBottom: \"24px\",\n padding: \"16px\",\n background: \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"12px\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", marginBottom: \"8px\" }}>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\" }}>\n <CheckCircle2 size={18} style={{ color: \"#1F8F5A\" }} />\n <span style={{ fontSize: \"14px\", fontWeight: 650, color: \"rgba(30, 33, 37, 0.92)\" }}>\n Project Selected: {selectedProject.name}\n </span>\n </div>\n <button\n onClick={() => setSelectedProject(null)}\n style={{\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n padding: \"4px\",\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <X size={16} style={{ color: \"rgba(30, 33, 37, 0.42)\" }} />\n </button>\n </div>\n <div style={{ fontSize: \"13px\", color: \"rgba(30, 33, 37, 0.65)\", lineHeight: 1.5 }}>\n <div>{selectedProject.description}</div>\n <div style={{ marginTop: \"4px\" }}>\n <strong>{selectedProject.interactions}</strong> interactions · <strong>{selectedProject.dateRange}</strong>\n </div>\n </div>\n </div>\n )}\n\n {/* Data Sources Selection */}\n {!connectedSource && (\n <div style={{ marginBottom: \"24px\" }}>\n <h3\n style={{\n fontSize: \"15px\",\n fontWeight: 650,\n color: \"rgba(30, 33, 37, 0.82)\",\n marginBottom: \"12px\",\n }}\n >\n Connect a Data Source:\n </h3>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"8px\" }}>\n {dummyDataSources.map((source) => (\n <button\n key={source.id}\n onClick={() => handleConnectSource(source.id)}\n disabled={source.status === \"coming-soon\"}\n style={{\n padding: \"12px 16px\",\n background: source.status === \"coming-soon\" \n ? \"rgba(255, 255, 255, 0.5)\" \n : \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"8px\",\n textAlign: \"left\",\n cursor: source.status === \"coming-soon\" ? \"not-allowed\" : \"pointer\",\n transition: \"all 0.15s ease\",\n opacity: source.status === \"coming-soon\" ? 0.6 : 1,\n }}\n onMouseEnter={(e) => {\n if (source.status !== \"coming-soon\") {\n e.currentTarget.style.background = \"rgba(255, 255, 255, 0.95)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.20)\";\n }\n }}\n onMouseLeave={(e) => {\n if (source.status !== \"coming-soon\") {\n e.currentTarget.style.background = \"rgba(255, 255, 255, 0.85)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.12)\";\n }\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\" }}>\n <div>\n <div style={{ fontSize: \"14px\", fontWeight: 650, color: \"rgba(30, 33, 37, 0.92)\", marginBottom: \"4px\" }}>\n {source.name}\n </div>\n <div style={{ fontSize: \"12px\", color: \"rgba(30, 33, 37, 0.62)\" }}>\n {source.description}\n </div>\n </div>\n {source.status === \"coming-soon\" && (\n <span\n style={{\n fontSize: \"10px\",\n fontWeight: 600,\n color: \"rgba(30, 33, 37, 0.42)\",\n background: \"rgba(30, 33, 37, 0.08)\",\n padding: \"4px 8px\",\n borderRadius: \"4px\",\n }}\n >\n Coming Soon\n </span>\n )}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Connected Source Example */}\n {connectedSource && (\n <div\n style={{\n marginBottom: \"24px\",\n padding: \"16px\",\n background: \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"12px\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", marginBottom: \"8px\" }}>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"8px\" }}>\n <CheckCircle2 size={18} style={{ color: \"#1F8F5A\" }} />\n <span style={{ fontSize: \"14px\", fontWeight: 650, color: \"rgba(30, 33, 37, 0.92)\" }}>\n Connected: {connectedSource.name}\n </span>\n </div>\n <button\n onClick={() => setConnectedSource(null)}\n style={{\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n padding: \"4px\",\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <X size={16} style={{ color: \"rgba(30, 33, 37, 0.42)\" }} />\n </button>\n </div>\n <div style={{ fontSize: \"13px\", color: \"rgba(30, 33, 37, 0.65)\", lineHeight: 1.5 }}>\n {connectedSource.description}\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n","\"use client\";\n\nimport React, { useState } from \"react\";\nimport {\n X,\n CheckCircle2,\n Circle,\n ChevronRight,\n Sparkles,\n Users,\n FolderOpen,\n Link,\n Settings,\n BookOpen,\n} from \"lucide-react\";\n\n/**\n * OnboardingChecklist Component\n * Displays a collapsible checklist of onboarding tasks with progress tracking.\n * Shows completed items with checkmarks and allows interaction with incomplete items.\n */\nexport default function OnboardingChecklist({\n onDismiss,\n onItemClick,\n completedItems = [],\n}) {\n const [isCollapsed, setIsCollapsed] = useState(false);\n const [hoveredItem, setHoveredItem] = useState(null);\n\n const checklistItems = [\n {\n id: \"name-project\",\n title: \"Name your workspace\",\n description: \"Give your default project a meaningful name\",\n icon: FolderOpen,\n completed: completedItems.includes(\"name-project\"),\n optional: true,\n },\n {\n id: \"evaluate-second-interaction\",\n title: \"Evaluate another interaction\",\n description: \"Upload or connect a second interaction to see patterns\",\n icon: Sparkles,\n completed: completedItems.includes(\"evaluate-second-interaction\"),\n },\n {\n id: \"connect-source\",\n title: \"Connect a data source\",\n description: \"Link your system or platform for automatic evaluation\",\n icon: Link,\n completed: completedItems.includes(\"connect-source\"),\n },\n {\n id: \"invite-team\",\n title: \"Add teammates\",\n description: \"Invite managers or QA team members to collaborate\",\n icon: Users,\n completed: completedItems.includes(\"invite-team\"),\n optional: true,\n },\n {\n id: \"learn-concepts\",\n title: \"Understand Chordia concepts\",\n description: \"Learn how conditions, evidence, and confidence work\",\n icon: BookOpen,\n completed: completedItems.includes(\"learn-concepts\"),\n optional: true,\n },\n {\n id: \"configure-scope\",\n title: \"Clarify evaluation scope\",\n description: \"Customize which signals and conditions matter for your team\",\n icon: Settings,\n completed: completedItems.includes(\"configure-scope\"),\n optional: true,\n },\n ];\n\n const completedCount = checklistItems.filter((item) => item.completed).length;\n const totalCount = checklistItems.length;\n const progressPercent = (completedCount / totalCount) * 100;\n\n if (isCollapsed) {\n return (\n <button\n type=\"button\"\n onClick={() => setIsCollapsed(false)}\n style={{\n width: \"100%\",\n padding: \"14px 16px\",\n background: \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"12px\",\n cursor: \"pointer\",\n textAlign: \"left\",\n transition: \"all 0.15s ease\",\n boxShadow: \"0 2px 8px rgba(30, 33, 37, 0.04)\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"rgba(255, 255, 255, 0.95)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.18)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"rgba(255, 255, 255, 0.85)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.12)\";\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: \"12px\",\n }}\n >\n <div\n style={{\n fontSize: \"13px\",\n fontWeight: 600,\n color: \"rgba(30, 33, 37, 0.75)\",\n }}\n >\n Getting started ({completedCount}/{totalCount})\n </div>\n <ChevronRight size={16} style={{ color: \"rgba(30, 33, 37, 0.42)\" }} />\n </div>\n </button>\n );\n }\n\n return (\n <div\n style={{\n background: \"rgba(255, 255, 255, 0.85)\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n borderRadius: \"16px\",\n overflow: \"hidden\",\n boxShadow: \"0 4px 16px rgba(30, 33, 37, 0.06)\",\n }}\n >\n {/* Header */}\n <div\n style={{\n padding: \"18px 20px 16px\",\n borderBottom: \"1px solid rgba(52, 58, 64, 0.08)\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n gap: \"12px\",\n }}\n >\n <div style={{ flex: 1 }}>\n <div\n style={{\n fontSize: \"15px\",\n fontWeight: 680,\n letterSpacing: \"-0.01em\",\n color: \"rgba(30, 33, 37, 0.92)\",\n marginBottom: \"6px\",\n lineHeight: 1.3,\n }}\n >\n Getting started with Chordia\n </div>\n <div\n style={{\n fontSize: \"12px\",\n color: \"rgba(30, 33, 37, 0.58)\",\n lineHeight: 1.4,\n }}\n >\n {completedCount} of {totalCount} completed\n </div>\n </div>\n <div style={{ display: \"flex\", gap: \"4px\" }}>\n {/* Collapse button */}\n <button\n type=\"button\"\n onClick={() => setIsCollapsed(true)}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"6px\",\n background: \"transparent\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transition: \"all 0.15s ease\",\n color: \"rgba(30, 33, 37, 0.52)\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"rgba(231, 212, 162, 0.12)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.18)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.12)\";\n }}\n title=\"Collapse\"\n >\n <ChevronRight size={14} />\n </button>\n {/* Dismiss button */}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"6px\",\n background: \"transparent\",\n border: \"1px solid rgba(52, 58, 64, 0.12)\",\n cursor: \"pointer\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transition: \"all 0.15s ease\",\n color: \"rgba(30, 33, 37, 0.52)\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"rgba(231, 212, 162, 0.12)\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.18)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n e.currentTarget.style.borderColor = \"rgba(52, 58, 64, 0.12)\";\n }}\n title=\"Dismiss checklist\"\n >\n <X size={14} />\n </button>\n )}\n </div>\n </div>\n {/* Progress bar */}\n <div\n style={{\n marginTop: \"14px\",\n height: \"6px\",\n background: \"rgba(30, 33, 37, 0.08)\",\n borderRadius: \"999px\",\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n height: \"100%\",\n width: `${progressPercent}%`,\n background:\n \"linear-gradient(90deg, rgba(184, 156, 106, 0.75) 0%, rgba(139, 157, 127, 0.75) 100%)\",\n borderRadius: \"999px\",\n transition: \"width 0.4s ease\",\n }}\n />\n </div>\n </div>\n\n {/* Checklist items */}\n <div style={{ padding: \"8px\" }}>\n {checklistItems.map((item, index) => {\n const Icon = item.icon;\n const isHovered = hoveredItem === item.id;\n\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={() => onItemClick?.(item.id)}\n onMouseEnter={() => setHoveredItem(item.id)}\n onMouseLeave={() => setHoveredItem(null)}\n disabled={item.completed}\n style={{\n width: \"100%\",\n padding: \"12px 14px\",\n background: item.completed\n ? \"rgba(139, 157, 127, 0.06)\"\n : isHovered\n ? \"rgba(231, 212, 162, 0.12)\"\n : \"transparent\",\n border: \"none\",\n borderRadius: \"10px\",\n cursor: item.completed ? \"default\" : \"pointer\",\n textAlign: \"left\",\n transition: \"all 0.15s ease\",\n marginBottom: index < checklistItems.length - 1 ? \"4px\" : \"0\",\n opacity: item.completed ? 0.7 : 1,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: \"12px\",\n }}\n >\n {/* Icon/Checkbox */}\n <div\n style={{\n width: \"20px\",\n height: \"20px\",\n marginTop: \"1px\",\n flexShrink: 0,\n }}\n >\n {item.completed ? (\n <CheckCircle2\n size={20}\n style={{ color: \"rgba(139, 157, 127, 0.75)\" }}\n />\n ) : (\n <Circle\n size={20}\n style={{ color: \"rgba(30, 33, 37, 0.24)\" }}\n />\n )}\n </div>\n {/* Content */}\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n marginBottom: \"3px\",\n }}\n >\n <Icon\n size={14}\n style={{ color: \"rgba(30, 33, 37, 0.52)\", flexShrink: 0 }}\n />\n <span\n style={{\n fontSize: \"13px\",\n fontWeight: 600,\n color: item.completed\n ? \"rgba(30, 33, 37, 0.52)\"\n : \"rgba(30, 33, 37, 0.85)\",\n textDecoration: item.completed ? \"line-through\" : \"none\",\n lineHeight: 1.3,\n }}\n >\n {item.title}\n </span>\n {item.optional && !item.completed && (\n <span\n style={{\n fontSize: \"9px\",\n fontWeight: 600,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: \"rgba(30, 33, 37, 0.42)\",\n background: \"rgba(30, 33, 37, 0.06)\",\n padding: \"2px 5px\",\n borderRadius: \"4px\",\n }}\n >\n Optional\n </span>\n )}\n </div>\n <div\n style={{\n fontSize: \"11.5px\",\n color: \"rgba(30, 33, 37, 0.52)\",\n lineHeight: 1.4,\n paddingLeft: \"22px\",\n }}\n >\n {item.description}\n </div>\n </div>\n {/* Arrow indicator (only for incomplete items on hover) */}\n {!item.completed && isHovered && (\n <ChevronRight\n size={16}\n style={{\n color: \"rgba(30, 33, 37, 0.32)\",\n marginTop: \"2px\",\n flexShrink: 0,\n }}\n />\n )}\n </div>\n </button>\n );\n })}\n </div>\n\n {/* Footer note */}\n <div\n style={{\n padding: \"12px 20px 16px\",\n borderTop: \"1px solid rgba(52, 58, 64, 0.08)\",\n }}\n >\n <div\n style={{\n fontSize: \"11px\",\n color: \"rgba(30, 33, 37, 0.52)\",\n lineHeight: 1.5,\n fontStyle: \"italic\",\n }}\n >\n You can dismiss this checklist anytime. These steps help you get the\n most from Chordia, but {'aren\\'t'} required.\n </div>\n </div>\n </div>\n );\n}\n\n","\"use client\";\n\nimport React from \"react\";\n\n/**\n * DemoProjectBanner Component\n * Displays a diagonal banner in the top-right corner indicating a demo project.\n * Creates a triangular ribbon effect with rotated text.\n */\nexport default function DemoProjectBanner({\n text = \"Demo Project\",\n accentColor = \"#B89C6A\",\n textColor = \"rgba(255, 255, 255, 0.95)\",\n size = \"medium\",\n position = \"fixed\",\n}) {\n // Size configurations\n const sizeConfig = {\n small: {\n width: 140,\n height: 140,\n fontSize: \"11px\",\n letterSpacing: \"0.08em\",\n fontWeight: 650,\n },\n medium: {\n width: 180,\n height: 180,\n fontSize: \"12px\",\n letterSpacing: \"0.1em\",\n fontWeight: 680,\n },\n large: {\n width: 220,\n height: 220,\n fontSize: \"13px\",\n letterSpacing: \"0.12em\",\n fontWeight: 700,\n },\n };\n\n const config = sizeConfig[size];\n\n return (\n <div\n style={{\n position: position,\n top: 0,\n right: 0,\n width: config.width,\n height: config.height,\n overflow: \"hidden\",\n zIndex: position === \"fixed\" ? 9999 : 1,\n pointerEvents: \"none\",\n }}\n >\n {/* Triangle background */}\n <div\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n width: 0,\n height: 0,\n borderStyle: \"solid\",\n borderWidth: `0 ${config.width}px ${config.height}px 0`,\n borderColor: `transparent ${accentColor} transparent transparent`,\n opacity: 0.92,\n }}\n />\n\n {/* Diagonal stripe for depth */}\n <div\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n width: 0,\n height: 0,\n borderStyle: \"solid\",\n borderWidth: `0 ${config.width}px ${config.height}px 0`,\n borderColor: \"transparent rgba(0, 0, 0, 0.08) transparent transparent\",\n }}\n />\n\n {/* Text container - rotated 45deg */}\n <div\n style={{\n position: \"absolute\",\n top:\n size === \"small\"\n ? \"28px\"\n : size === \"medium\"\n ? \"38px\"\n : \"48px\",\n right:\n size === \"small\"\n ? \"-32px\"\n : size === \"medium\"\n ? \"-42px\"\n : \"-52px\",\n width:\n size === \"small\" ? \"160px\" : size === \"medium\" ? \"200px\" : \"240px\",\n transform: \"rotate(45deg)\",\n transformOrigin: \"center\",\n textAlign: \"center\",\n }}\n >\n <div\n style={{\n fontSize: config.fontSize,\n fontWeight: config.fontWeight,\n letterSpacing: config.letterSpacing,\n textTransform: \"uppercase\",\n color: textColor,\n textShadow: \"0 1px 2px rgba(0, 0, 0, 0.15)\",\n whiteSpace: \"nowrap\",\n userSelect: \"none\",\n }}\n >\n {text}\n </div>\n </div>\n\n {/* Subtle shadow for depth */}\n <div\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n width: config.width,\n height: config.height,\n background:\n \"linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.04) 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n\n","\"use client\";\nimport React, { useState } from 'react';\nimport { Lock, Mail, Eye, EyeOff, ArrowRight } from 'lucide-react';\n\n// Logo asset — concentric circles + wordmark\n// const LOGO_URL = new URL('../../assets/chordia-logo.png', import.meta.url).href;\nconst LOGO_URL = \"../../assets/chordia-logo.png\";\n\n/**\n * LoginForm — Chordia design system login component.\n *\n * Warm parchment aesthetic. Gold accents on focus, earth-tone CTA.\n * Purple is intentionally avoided — it's reserved for AI presence.\n *\n * Props:\n * - title: string (default: \"Chordia\") — only shown if no logo\n * - subtitle: string (default: \"Sign in to continue\")\n * - logo: ReactNode (optional — replaces the default logo image + subtitle)\n * - onLogin: (email, password) => Promise<void> | void\n * - loading: boolean\n * - error: string | null\n * - footer: ReactNode (optional — e.g. links, version info)\n * - showLabels: boolean (default: true)\n * - emailPlaceholder: string\n * - passwordPlaceholder: string\n * - onForgotPassword: () => void (optional — shows \"Forgot password?\" link)\n * - compact: boolean (default: false — skips the full-page centering wrapper)\n */\nexport default function LoginForm({\n title = 'Chordia',\n subtitle = 'Sign in to continue',\n logo,\n onLogin,\n loading = false,\n error = null,\n footer,\n showLabels = true,\n emailPlaceholder = 'you@company.com',\n passwordPlaceholder = 'Password',\n onForgotPassword,\n compact = false,\n}) {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [focused, setFocused] = useState(null);\n\n const handleSubmit = (e) => {\n e.preventDefault();\n if (!email || !password || loading) return;\n onLogin?.(email, password);\n };\n\n const canSubmit = email && password && !loading;\n\n // Warm earth accent — compliance orange, used for focus/CTA (not purple)\n const accentColor = 'var(--rail-compliance)';\n const accentRgba = '201, 138, 90'; // --rail-compliance raw\n\n const card = (\n <div style={{\n width: '100%',\n maxWidth: 400,\n background: 'var(--paper-elevated)',\n border: '1px solid var(--border)',\n borderRadius: 'var(--radius-lg)',\n padding: '44px 36px 36px',\n boxShadow: '0 8px 32px rgba(30, 33, 37, 0.06), 0 1px 3px rgba(30, 33, 37, 0.04)',\n position: 'relative',\n overflow: 'hidden',\n }}>\n {/* Decorative top rail — warm gold gradient */}\n <div style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n height: 3,\n background: `linear-gradient(90deg, var(--state-unknown), ${accentColor})`,\n opacity: 0.6,\n }} />\n\n {/* Logo / Title area */}\n <div style={{ textAlign: 'center', marginBottom: 32 }}>\n {logo || (\n <>\n {/* Logo on a dark pill so the light-colored asset is visible */}\n <div style={{\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '12px 24px',\n borderRadius: 'var(--radius-lg)',\n background: 'rgba(30, 33, 37, 0.92)',\n marginBottom: 16,\n }}>\n <img\n src={LOGO_URL}\n alt={title}\n style={{ height: 28, display: 'block' }}\n />\n </div>\n {subtitle && (\n <p style={{\n fontSize: 'var(--text-sm)',\n color: 'var(--text-muted)',\n marginTop: 4,\n marginBottom: 0,\n }}>{subtitle}</p>\n )}\n </>\n )}\n </div>\n\n <form onSubmit={handleSubmit}>\n {/* Email field */}\n <div style={{ marginBottom: 18 }}>\n {showLabels && (\n <label style={{\n display: 'block',\n fontSize: 'var(--text-sm)',\n fontWeight: 550,\n color: 'var(--text-strong)',\n marginBottom: 6,\n fontFamily: 'var(--font-sans)',\n }}>Email</label>\n )}\n <div style={{ position: 'relative', display: 'flex', alignItems: 'center' }}>\n <Mail size={15} style={{\n position: 'absolute',\n left: 12,\n color: focused === 'email' ? `rgba(${accentRgba}, 0.7)` : 'var(--text-faint)',\n pointerEvents: 'none',\n transition: 'color 0.2s ease',\n }} />\n <input\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder={emailPlaceholder}\n required\n autoFocus\n autoComplete=\"email\"\n style={{\n width: '100%',\n padding: '11px 12px 11px 38px',\n fontSize: 'var(--text-md)',\n border: '1px solid',\n borderColor: focused === 'email' ? accentColor : 'var(--border)',\n borderRadius: 'var(--radius)',\n backgroundColor: focused === 'email' ? 'rgba(255,255,255,0.95)' : 'var(--paper)',\n color: 'var(--text-ink)',\n fontFamily: 'var(--font-sans)',\n outline: 'none',\n transition: 'border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease',\n boxShadow: focused === 'email' ? `0 0 0 3px rgba(${accentRgba}, 0.1)` : 'none',\n }}\n onFocus={() => setFocused('email')}\n onBlur={() => setFocused(null)}\n />\n </div>\n </div>\n\n {/* Password field */}\n <div style={{ marginBottom: 6 }}>\n {showLabels && (\n <label style={{\n display: 'block',\n fontSize: 'var(--text-sm)',\n fontWeight: 550,\n color: 'var(--text-strong)',\n marginBottom: 6,\n fontFamily: 'var(--font-sans)',\n }}>Password</label>\n )}\n <div style={{ position: 'relative', display: 'flex', alignItems: 'center' }}>\n <Lock size={15} style={{\n position: 'absolute',\n left: 12,\n color: focused === 'password' ? `rgba(${accentRgba}, 0.7)` : 'var(--text-faint)',\n pointerEvents: 'none',\n transition: 'color 0.2s ease',\n }} />\n <input\n type={showPassword ? 'text' : 'password'}\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder={passwordPlaceholder}\n required\n autoComplete=\"current-password\"\n style={{\n width: '100%',\n padding: '11px 42px 11px 38px',\n fontSize: 'var(--text-md)',\n border: '1px solid',\n borderColor: focused === 'password' ? accentColor : 'var(--border)',\n borderRadius: 'var(--radius)',\n backgroundColor: focused === 'password' ? 'rgba(255,255,255,0.95)' : 'var(--paper)',\n color: 'var(--text-ink)',\n fontFamily: 'var(--font-sans)',\n outline: 'none',\n transition: 'border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease',\n boxShadow: focused === 'password' ? `0 0 0 3px rgba(${accentRgba}, 0.1)` : 'none',\n }}\n onFocus={() => setFocused('password')}\n onBlur={() => setFocused(null)}\n />\n <button\n type=\"button\"\n onClick={() => setShowPassword(!showPassword)}\n style={{\n position: 'absolute',\n right: 8,\n background: 'none',\n border: 'none',\n padding: 4,\n cursor: 'pointer',\n color: 'var(--text-faint)',\n display: 'flex',\n alignItems: 'center',\n transition: 'color 0.15s ease',\n borderRadius: 'var(--radius-sm)',\n }}\n tabIndex={-1}\n onMouseEnter={(e) => { e.currentTarget.style.color = 'var(--text-muted)'; }}\n onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--text-faint)'; }}\n >\n {showPassword ? <EyeOff size={16} /> : <Eye size={16} />}\n </button>\n </div>\n </div>\n\n {/* Forgot password link */}\n {onForgotPassword && (\n <div style={{ textAlign: 'right', marginBottom: 4 }}>\n <button\n type=\"button\"\n onClick={onForgotPassword}\n style={{\n background: 'none',\n border: 'none',\n padding: '2px 0',\n fontSize: 'var(--text-xs)',\n color: 'var(--text-muted)',\n cursor: 'pointer',\n fontFamily: 'var(--font-sans)',\n transition: 'color 0.15s ease',\n }}\n onMouseEnter={(e) => { e.currentTarget.style.color = 'var(--text-strong)'; }}\n onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--text-muted)'; }}\n >\n Forgot password?\n </button>\n </div>\n )}\n\n {/* Error message — gold warning tint, no red */}\n {error && (\n <div style={{\n fontSize: 'var(--text-sm)',\n color: 'var(--text-strong)',\n marginTop: 12,\n padding: '8px 12px',\n background: 'color-mix(in srgb, var(--state-unknown) 10%, transparent)',\n border: '1px solid color-mix(in srgb, var(--state-unknown) 25%, transparent)',\n borderRadius: 'var(--radius-sm)',\n textAlign: 'center',\n fontWeight: 500,\n }}>{error}</div>\n )}\n\n {/* Submit button — dark ink, warm and authoritative */}\n <button\n type=\"submit\"\n disabled={!canSubmit}\n style={{\n width: '100%',\n padding: '11px 0',\n marginTop: 20,\n background: canSubmit ? 'var(--text-ink)' : 'var(--text-xfaint)',\n color: '#ffffff',\n border: 'none',\n borderRadius: 'var(--radius)',\n fontSize: 'var(--text-md)',\n fontWeight: 600,\n fontFamily: 'var(--font-sans)',\n cursor: canSubmit ? 'pointer' : 'not-allowed',\n transition: 'opacity 0.15s ease, transform 0.1s ease',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n }}\n onMouseEnter={(e) => {\n if (canSubmit) {\n e.currentTarget.style.opacity = '0.85';\n e.currentTarget.style.transform = 'translateY(-1px)';\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.opacity = '1';\n e.currentTarget.style.transform = 'translateY(0)';\n }}\n onMouseDown={(e) => {\n if (canSubmit) e.currentTarget.style.transform = 'translateY(0)';\n }}\n onMouseUp={(e) => {\n if (canSubmit) e.currentTarget.style.transform = 'translateY(-1px)';\n }}\n >\n {loading ? 'Signing in…' : (\n <>\n Sign In\n <ArrowRight size={16} />\n </>\n )}\n </button>\n </form>\n\n {/* Divider + Footer */}\n {footer && (\n <>\n <div style={{\n display: 'flex',\n alignItems: 'center',\n gap: 12,\n margin: '24px 0 16px',\n }}>\n <div style={{ flex: 1, height: 1, background: 'var(--border)' }} />\n <span style={{ fontSize: 'var(--text-xs)', color: 'var(--text-faint)' }}>or</span>\n <div style={{ flex: 1, height: 1, background: 'var(--border)' }} />\n </div>\n <div style={{\n textAlign: 'center',\n fontSize: 'var(--text-xs)',\n color: 'var(--text-faint)',\n }}>{footer}</div>\n </>\n )}\n </div>\n );\n\n if (compact) return card;\n\n return (\n <div style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '100vh',\n background: 'var(--bg-chordia)',\n padding: 'var(--spacing-6)',\n }}>\n {card}\n </div>\n );\n}\n","\"use client\";\n\nimport React, { useState, useRef, useCallback, useEffect, useLayoutEffect } from \"react\";\n\n/**\n * SplitPane Component\n * Resizable two-pane layout with draggable divider and collapsible panels.\n *\n * Props:\n * left - React node for left pane\n * right - React node for right pane\n * defaultWidth - Initial left pane width in px (default: 260). Ignored if defaultRatio is set.\n * defaultRatio - Initial left pane width as ratio 0-1 (e.g. 0.5 for 50%). Overrides defaultWidth.\n * minWidth - Minimum left pane width in px (default: 180)\n * maxWidth - Maximum left pane width in px (default: 450)\n * minRatio - Minimum left pane width as ratio 0-1. Overrides minWidth when set.\n * maxRatio - Maximum left pane width as ratio 0-1. Overrides maxWidth when set.\n * collapsedWidth - Width of the collapsed strip in px (default: 0)\n * collapsed - Controlled collapsed state (optional)\n * onCollapsedChange - (collapsed: boolean) => void (optional)\n * collapseSide - Which side(s) can collapse: \"left\" | \"right\" | \"both\" | \"none\" (default: \"left\")\n * collapseThreshold - Drag below this px to auto-collapse left (default: minWidth - 40)\n * dividerWidth - Divider hit area width in px (default: 7)\n * style - Style for the outer container\n */\nexport default function SplitPane({\n left,\n right,\n defaultWidth = 260,\n defaultRatio,\n minWidth = 180,\n maxWidth = 450,\n minRatio,\n maxRatio,\n collapsedWidth = 0,\n collapsed: controlledCollapsed,\n onCollapsedChange,\n collapseSide = \"left\",\n collapseThreshold,\n dividerWidth = 7,\n style,\n}) {\n const isControlled = controlledCollapsed !== undefined;\n const [internalCollapsed, setInternalCollapsed] = useState(false);\n const collapsed = isControlled ? controlledCollapsed : internalCollapsed;\n\n const setCollapsed = useCallback(\n (val) => {\n const next = typeof val === \"function\" ? val(collapsed) : val;\n if (!isControlled) setInternalCollapsed(next);\n onCollapsedChange?.(next);\n },\n [isControlled, collapsed, onCollapsedChange]\n );\n\n const containerRef = useRef(null);\n const [containerWidth, setContainerWidth] = useState(0);\n const [width, setWidth] = useState(defaultWidth);\n const [dragging, setDragging] = useState(false);\n const [initialized, setInitialized] = useState(false);\n const startXRef = useRef(0);\n const startWidthRef = useRef(0);\n\n // Measure container and set initial width from ratio\n useLayoutEffect(() => {\n if (!containerRef.current) return;\n const w = containerRef.current.offsetWidth;\n setContainerWidth(w);\n if (!initialized && w > 0) {\n if (defaultRatio != null) {\n setWidth(Math.round(w * defaultRatio));\n }\n setInitialized(true);\n }\n }, []);\n\n // Observe container resize\n useEffect(() => {\n if (!containerRef.current) return;\n const ro = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setContainerWidth(entry.contentRect.width);\n }\n });\n ro.observe(containerRef.current);\n return () => ro.disconnect();\n }, []);\n\n // Compute effective min/max from ratios if provided\n const effectiveMin = minRatio != null ? Math.round(containerWidth * minRatio) : minWidth;\n const effectiveMax = maxRatio != null ? Math.round(containerWidth * maxRatio) : maxWidth;\n const effectiveCollapseThreshold =\n collapseThreshold ?? (collapseSide === \"none\" ? 0 : effectiveMin - 40);\n\n const handleMouseDown = useCallback(\n (e) => {\n e.preventDefault();\n startXRef.current = e.clientX;\n startWidthRef.current = collapsed ? collapsedWidth : width;\n setDragging(true);\n },\n [width, collapsed, collapsedWidth]\n );\n\n useEffect(() => {\n if (!dragging) return;\n\n const handleMouseMove = (e) => {\n const delta = e.clientX - startXRef.current;\n const newWidth = startWidthRef.current + delta;\n\n const canCollapseLeft = collapseSide === \"left\" || collapseSide === \"both\";\n const canCollapseRight = collapseSide === \"right\" || collapseSide === \"both\";\n\n // Collapse left: dragged too far left\n if (canCollapseLeft && newWidth < effectiveCollapseThreshold) {\n if (!collapsed) setCollapsed(true);\n return;\n }\n\n // Collapse right: dragged too far right (right pane too narrow)\n const rightRemaining = containerWidth - newWidth - dividerWidth;\n if (canCollapseRight && containerWidth > 0 && rightRemaining < effectiveCollapseThreshold) {\n // Don't collapse right in this version — just clamp at max\n }\n\n if (collapsed) setCollapsed(false);\n setWidth(Math.min(Math.max(newWidth, effectiveMin), effectiveMax));\n };\n\n const handleMouseUp = () => setDragging(false);\n\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n document.body.style.userSelect = \"none\";\n document.body.style.cursor = \"col-resize\";\n\n return () => {\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n document.body.style.userSelect = \"\";\n document.body.style.cursor = \"\";\n };\n }, [\n dragging, collapsed, effectiveMin, effectiveMax, effectiveCollapseThreshold,\n containerWidth, dividerWidth, collapseSide, setCollapsed,\n ]);\n\n const handleDoubleClick = useCallback(() => {\n if (collapseSide !== \"none\") {\n setCollapsed((c) => !c);\n }\n }, [setCollapsed, collapseSide]);\n\n const actualLeftWidth = collapsed ? collapsedWidth : width;\n\n return (\n <div\n ref={containerRef}\n style={{\n display: \"flex\",\n height: \"100%\",\n overflow: \"hidden\",\n position: \"relative\",\n ...style,\n }}\n >\n {/* Left pane */}\n {(actualLeftWidth > 0 || !collapsed) && (\n <div\n style={{\n width: actualLeftWidth,\n flexShrink: 0,\n overflow: \"hidden\",\n transition: dragging ? \"none\" : \"width 0.2s ease\",\n height: \"100%\",\n border: \"1px solid\",\n borderColor: \"var(--border-subtle)\",\n }}\n >\n {!collapsed && left}\n </div>\n )}\n\n {/* Divider */}\n <div\n onMouseDown={handleMouseDown}\n onDoubleClick={handleDoubleClick}\n style={{\n width: `${dividerWidth}px`,\n flexShrink: 0,\n cursor: \"col-resize\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n position: \"relative\",\n zIndex: 2,\n }}\n >\n {/* Visual line */}\n {/* <div\n style={{\n width: \"1px\",\n height: \"100%\",\n background: dragging\n ? \"var(--rail-discovery, #5E88B0)\"\n : \"var(--border, rgba(52,58,64,0.12))\",\n transition: \"background 0.15s ease\",\n }}\n /> */}\n {/* Hover grip */}\n <div\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"5px\",\n height: \"28px\",\n borderRadius: \"3px\",\n background: dragging\n ? \"var(--rail-discovery, #5E88B0)\"\n : \"var(--border, rgba(52,58,64,0.12))\",\n opacity: dragging ? 1 : 0,\n transition: \"opacity 0.15s ease, background 0.15s ease\",\n }}\n className=\"splitpane-grip\"\n />\n <style>{`\n div:hover > .splitpane-grip { opacity: 0.7 !important; }\n `}</style>\n </div>\n\n {/* Right pane */}\n <div\n style={{\n flex: 1,\n minWidth: 0,\n overflow: \"hidden\",\n height: \"100%\",\n }}\n >\n {right}\n </div>\n </div>\n );\n}\n"],"names":["FirstCallScreen","onUploadCall","onConnectSource","onUseSample","showExamples","hoveredCard","setHoveredCard","useState","uploadedFile","setUploadedFile","connectedSource","setConnectedSource","selectedProject","setSelectedProject","fileInputRef","useRef","dummyDataSources","dummyProjects","handleFileUpload","event","file","_a","isAudio","isVideo","handleConnectSource","sourceId","source","s","handleSelectProject","projectId","project","p","jsxs","jsx","Upload","Sparkles","Link","option","Icon","isHovered","CheckCircle2","X","e","OnboardingChecklist","onDismiss","onItemClick","completedItems","isCollapsed","setIsCollapsed","hoveredItem","setHoveredItem","checklistItems","FolderOpen","Users","BookOpen","Settings","completedCount","item","totalCount","progressPercent","ChevronRight","index","Circle","DemoProjectBanner","text","accentColor","textColor","size","position","config","LOGO_URL","LoginForm","title","subtitle","logo","onLogin","loading","error","footer","showLabels","emailPlaceholder","passwordPlaceholder","onForgotPassword","compact","email","setEmail","password","setPassword","showPassword","setShowPassword","focused","setFocused","handleSubmit","canSubmit","accentRgba","card","Fragment","Mail","Lock","EyeOff","Eye","ArrowRight","SplitPane","left","right","defaultWidth","defaultRatio","minWidth","maxWidth","minRatio","maxRatio","collapsedWidth","controlledCollapsed","onCollapsedChange","collapseSide","collapseThreshold","dividerWidth","style","isControlled","internalCollapsed","setInternalCollapsed","collapsed","setCollapsed","useCallback","val","next","containerRef","containerWidth","setContainerWidth","width","setWidth","dragging","setDragging","initialized","setInitialized","startXRef","startWidthRef","useLayoutEffect","w","useEffect","ro","entries","entry","effectiveMin","effectiveMax","effectiveCollapse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A,oBACP,QAAQ;AAAA,oBACR,cAAc;AAAA,oBACd,YAAYkG,IACR,mCACA;AAAA,oBACJ,SAASA,IAAW,IAAI;AAAA,oBACxB,YAAY;AAAA,kBAAA;AAAA,kBAEd,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,gCAEX,SAAA,EAAO,UAAA;AAAA;AAAA,UAAA,CAEN;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAIJ,gBAAAlG;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,cACL,MAAM;AAAA,cACN,UAAU;AAAA,cACV,UAAU;AAAA,cACV,QAAQ;AAAA,YAAA;AAAA,YAGT,UAAAuE;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),a=require("react"),g=require("./sortable.esm.cjs.js"),v=require("lucide-react"),nt=require("react-dom"),ze=require("./CustomFilterChips.cjs.js");require("./TourGuideTooltip.cjs.js");function Oe({dateRangePicker:p,onWeekToDate:c,exportConfig:y,filterChipsConfig:f,trailingActions:C}){const[_,A]=a.useState(!1),w=a.useRef(null),M=a.useRef(null);a.useEffect(()=>{const d=z=>{M.current&&!M.current.contains(z.target)&&w.current&&!w.current.contains(z.target)&&A(!1)};if(_)return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[_]);const K=()=>{A(d=>!d)},G=d=>{A(!1),y!=null&&y.onExport&&y.onExport(d)},S=(()=>{if(!(f!=null&&f.filters))return!1;const d=f.filters,z=f.customFilters||[],O=Object.entries(d).some(([m,j])=>!!(Array.isArray(j)&&j.length||typeof j=="string"&&j.trim()!==""||j&&typeof j=="object"&&(j.min!=null||j.max!=null))),U=z.some(m=>m.active);return O||U})();return t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c&&t.jsxs("button",{onClick:c,className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900",style:{fontFamily:"var(--font-sans)"},children:[t.jsx(v.CalendarClock,{size:16}),t.jsx("span",{children:"Week to Date"})]}),p&&t.jsx(a.Suspense,{fallback:t.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400",children:[t.jsx(v.CalendarClock,{size:16}),t.jsx("span",{children:"Loading..."})]}),children:p}),y&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{ref:w,onClick:K,disabled:y.isExporting,className:"inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]",style:{fontFamily:"var(--font-sans)"},children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(v.Download,{size:16}),t.jsx("span",{children:y.isExporting?"Exporting...":"Export"})]}),t.jsx(v.ChevronDown,{size:16})]}),_&&t.jsx("div",{ref:M,className:"absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]",children:(y.types||["csv"]).map(d=>t.jsxs("button",{onClick:()=>G(d),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",style:{fontFamily:"var(--font-sans)"},children:["Export ",d.toUpperCase()]},d))})]}),(S||C)&&t.jsxs(t.Fragment,{children:[S&&t.jsx("div",{className:"h-9 mt-1 w-px bg-gray-300 flex-shrink-0"}),t.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[S&&f&&t.jsx(ze.CustomFilterChips,{filters:f.filters,onChange:f.onChange,onClear:f.onClear,customFilters:f.customFilters||[],fieldOptions:f.fieldOptions||{}}),C&&t.jsx("div",{className:"flex-shrink-0",children:C})]})]})]})}function pe(){return t.jsx("div",{style:{height:1,background:"rgba(52,58,64,0.08)"}})}const st=()=>({userData:{email:"anonymous"}}),ot=p=>t.jsx("img",{...p});function at({children:p}){return p}function lt({data:p=[],columns:c=[],initialPageSize:y=10,onRowClick:f,totalCount:C=null,page:_=null,pageSize:A=null,onPageChange:w=null,onPageSizeChange:M=null,onFilterChange:K=null,onMaxColumnsError:G=null,onSort:Y=null,sortFields:S=[],tableId:d=null,isLoading:z=!1,filtersConfig:O=null}){var Fe;const{userData:U}=st(),m=U==null?void 0:U.email,j=a.memo(({children:e,content:r,className:n=""})=>{const s=a.useRef(null),[o,l]=a.useState(!1);a.useEffect(()=>{const u=()=>{if(s.current){const J=s.current.scrollWidth>s.current.clientWidth;l(J)}};u();const H=setTimeout(u,0);return window.addEventListener("resize",u),()=>{clearTimeout(H),window.removeEventListener("resize",u)}},[e,r]);const i=t.jsx("span",{className:`truncate block ${n}`,ref:s,children:e});return o&&r?t.jsx(at,{content:r,styling:"bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal",indicatorColor:"bg-green-2",direction:"top",children:i}):i});j.displayName="TruncatedCell";const X=C!==null&&w!==null,le=K!==null,I=Y!==null,[Ee,ie]=a.useState(1),[Me,Le]=a.useState(y),ce=_!==null?_:Ee,Q=A!==null?A:Me,Z=e=>{w?w(e):ie(e)},ge=e=>{M?M(e):Le(e)},D=9,b="action",L=a.useRef(!1),P=a.useMemo(()=>d?`dataTable_columns_${d}:${m}`:`dataTable_columns_${c.map(r=>r.id||r.key).sort().join("_")}:${m}`,[d,c,m]),B=a.useMemo(()=>d?`dataTable_manual_change_${d}:${m}`:null,[d,m]);a.useCallback((e,r)=>{if(typeof window>"u"||!e||!r||r.length===0)return null;try{const n=localStorage.getItem(e);if(n){const o=JSON.parse(n).filter(l=>r.some(i=>(i.id||i.key)===l));if(o.length>0)return o}}catch(n){console.warn("Failed to load saved columns from localStorage:",n)}return null},[]);const[T,Te]=a.useState({}),[me,Re]=a.useState(null),[he,ye]=a.useState("asc");a.useCallback((e,r)=>e==="csat_score"&&r==="evaluation.csat_score"?r:e,[]);const q=I&&S.length>0?S[0][0]:me,ee=I&&S.length>0?S[0][1]:he,[ct,be]=a.useState(()=>c.map(e=>e.id||e.key)),E=a.useCallback(e=>{if(!e||e.length===0)return e;let r=Array.from(new Set(e));r.length>D&&(r=r.slice(0,D));const s=c.map(i=>i.id||i.key).includes(b);return!r.includes(b)&&s&&(r.length>=D?r=[...r.slice(0,D-1),b]:r=[...r,b]),[...r.filter(i=>i!==b),b]},[c]),[x,R]=a.useState(()=>{if(typeof window<"u"&&d)try{if(localStorage.getItem(`dataTable_manual_change_${d}:${m}`)==="true"){const s=localStorage.getItem(`dataTable_columns_${d}:${m}`);if(s){const o=JSON.parse(s);if(Array.isArray(o)&&o.length>0){L.current=!0;const l=o.filter(i=>c.some(u=>(u.id||u.key)===i));if(l.length>0)return l.slice(0,D)}}}}catch(n){console.warn("Failed to load saved columns from localStorage:",n)}const r=c.map(n=>n.id||n.key).slice(0,D);return E(r)}),[k,ve]=a.useState(!1),[de,$e]=a.useState({top:0,left:0,width:0}),[_e,we]=a.useState(new Set),[je,Se]=a.useState(new Set),[N,ue]=a.useState(null),[Ae,te]=a.useState(null),W=a.useRef(null),fe=a.useRef(null),V=a.useRef(null),[ke,Ce]=a.useState(null),Ie=a.useRef(null),h=e=>e.id||e.key,Pe=g.useSensors(g.useSensor(g.PointerSensor),g.useSensor(g.KeyboardSensor,{coordinateGetter:g.sortableKeyboardCoordinates})),Be=e=>{const{active:r,over:n}=e;n&&r.id!==n.id&&(L.current=!0,R(s=>{const o=s.indexOf(r.id),l=s.indexOf(n.id);if(o!==-1&&l!==-1){const i=g.arrayMove(s,o,l);return oe(i),i}return s}),be(s=>{const o=s.indexOf(r.id),l=s.indexOf(n.id);return g.arrayMove(s,o,l)})),Ce(null)},We=e=>{Ce(e.active.id)},re=a.useMemo(()=>le?p||[]:!p||p.length===0?[]:p.filter(e=>Object.keys(T).every(r=>{const n=T[r];if(!n||n.trim()==="")return!0;const s=e[r];if(s==null)return!1;const o=String(s).toLowerCase();return n.toLowerCase().trim().split(/\s+/).filter(u=>u.length>0).every(u=>o.includes(u))})),[p,T,le]),ne=a.useMemo(()=>I||!q?re:[...re].sort((e,r)=>{const n=e[q],s=r[q];if(n==null)return 1;if(s==null)return-1;if(typeof n=="number"&&typeof s=="number")return ee==="asc"?n-s:s-n;const o=String(n).toLowerCase(),l=String(s).toLowerCase();return ee==="asc"?o.localeCompare(l):l.localeCompare(o)}),[re,q,ee,I]),se=a.useMemo(()=>{if(X)return p||[];{const e=(ce-1)*Q,r=e+Q;return ne.slice(e,r)}},[p,ne,ce,Q,X]),Ve=e=>{I&&Y?(Y(e),w?w(1):ie(1)):(me===e?ye(he==="asc"?"desc":"asc"):(Re(e),ye("asc")),Z(1))},De=(e,r)=>{const n=r&&r.trim()!==""?{...T,[e]:r}:Object.fromEntries(Object.entries(T).filter(([s])=>s!==e));Te(n),le&&K&&K(n),w?w(1):ie(1)},He=e=>{V.current||(typeof G=="function"&&G(e),V.current=setTimeout(()=>{V.current=null},3e3))},oe=a.useCallback(e=>{if(typeof window<"u"&&P&&e.length>0&&L.current)try{localStorage.setItem(P,JSON.stringify(e)),B&&localStorage.setItem(B,"true")}catch(r){console.warn("Failed to save columns to localStorage:",r)}},[P,B]),xe=e=>{e!==b&&(L.current=!0,R(r=>r.includes(e)?(V.current&&(clearTimeout(V.current),V.current=null),r.length===1||(Se(n=>new Set(n).add(e)),setTimeout(()=>{R(n=>{const s=n.filter(l=>l!==e),o=E(s);return oe(o),o}),Se(n=>{const s=new Set(n);return s.delete(e),s})},200)),r):r.length>=D?(He("Maximum 9 column selection allowed"),r):(we(n=>new Set(n).add(e)),setTimeout(()=>{R(n=>{const s=n.includes(e)?n:[...n,e],o=E(s);return oe(o),o}),we(n=>{const s=new Set(n);return s.delete(e),s})},200),r)))},Ke=(e,r)=>{x[r]!==b&&ue(r)},Ue=()=>{ue(null),te(null)},qe=(e,r)=>{e.preventDefault(),N!==null&&N!==r&&te(r)},Je=()=>{te(null)},Ge=(e,r)=>{e.preventDefault(),N!==null&&N!==r&&x[r]!==b&&x[N]!==b&&(L.current=!0,R(n=>{const s=g.arrayMove(n,N,r),o=E(s);return oe(o),o})),ue(null),te(null)};a.useEffect(()=>{be(e=>{const r=x.filter(o=>e.includes(o)),n=x.filter(o=>!e.includes(o)),s=e.filter(o=>!x.includes(o));return[...r,...n,...s]})},[x]),a.useEffect(()=>{if(typeof window<"u"&&P&&x.length>0&&L.current)try{const e=E(x);localStorage.setItem(P,JSON.stringify(e)),B&&localStorage.setItem(B,"true")}catch(e){console.warn("Failed to save columns to localStorage:",e)}},[x,P,B]),a.useEffect(()=>{if(c.length>0&&x.length===0){if(typeof window<"u"&&d)try{if(localStorage.getItem(`dataTable_manual_change_${d}:${m}`)==="true"){const n=localStorage.getItem(`dataTable_columns_${d}:${m}`);if(n){const s=JSON.parse(n);if(Array.isArray(s)&&s.length>0){const o=s.filter(l=>c.some(i=>(i.id||i.key)===l));if(o.length>0){L.current=!0,R(o.slice(0,D));return}}}}}catch(r){console.warn("Failed to load saved columns from localStorage:",r)}const e=c.map(r=>r.id||r.key);R(E(e.slice(0,D)))}},[c,d,m,E]);const $=a.useMemo(()=>{const e=x.map(r=>c.find(n=>h(n)===r)).filter(Boolean);return E(e.map(h)).map(r=>c.find(n=>h(n)===r)).filter(Boolean)},[c,x]),Ye=a.useMemo(()=>$.some(e=>e.filterable===!0),[$]);a.useEffect(()=>{if(!k||!W.current)return;const e=()=>{if(W.current){const r=W.current.getBoundingClientRect();$e({top:r.bottom,left:r.left,width:Math.max(r.width||220,220)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[k]),a.useEffect(()=>{const e=r=>{k&&W.current&&!W.current.contains(r.target)&&fe.current&&!fe.current.contains(r.target)&&ve(!1)};if(k)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[k]);const Xe=x.length===1?((Fe=c.find(e=>(e.id||e.key)===x[0]))==null?void 0:Fe.label)||"1 selected":`${x.length} selected`;function Qe({column:e,isHeaderRow:r=!0}){const n=h(e),s=n===b,{attributes:o,listeners:l,setNodeRef:i,transform:u,transition:H,isDragging:J}=g.useSortable({id:n}),et={transform:g.CSS.Transform.toString(u),transition:H,opacity:J?.5:1,width:e.width||"auto",minWidth:e.width||"auto"};let ae=!1;if(I&&S.length>0){const F=S[0][0];(F===n||F==="csat_score"&&n==="evaluation.csat_score")&&(ae=!0)}else ae=q===n;const tt=ee==="asc",rt=e.filterable===!0;return r?t.jsx("th",{ref:i,style:{...et,padding:"12px 14px",textAlign:s?"center":"left",fontWeight:650,fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.62)",cursor:e.sortable!==!1?"pointer":"default",width:e.width||"auto",borderRight:"1px solid rgba(52, 58, 64, 0.06)",userSelect:"none",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",position:"sticky",top:0,zIndex:10,fontFamily:"var(--font-sans)"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",justifyContent:s?"center":"flex-start"},children:[!s&&t.jsx("div",{...o,...l,style:{cursor:"grab",color:"rgba(30, 33, 37, 0.32)"},children:t.jsx(v.GripVertical,{size:12})}),t.jsx("span",{onClick:()=>e.sortable!==!1&&Ve(n),style:{cursor:e.sortable!==!1?"pointer":"default"},children:e.label.toUpperCase()}),e.sortable!==!1&&ae&&t.jsx("span",{children:tt?t.jsx(v.ChevronUp,{size:12}):t.jsx(v.ChevronDown,{size:12})})]})}):t.jsx("th",{style:{width:e.width||"auto",minWidth:e.width||"auto",backgroundColor:"var(--primary-foreground)"},className:"sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",children:rt?t.jsxs("div",{className:"relative",children:[t.jsx(v.Filter,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"}),t.jsx("input",{type:"text",placeholder:"Filter...",value:T[n]||"",onChange:F=>{F.stopPropagation(),De(n,F.target.value)},onKeyDown:F=>F.stopPropagation(),onMouseDown:F=>F.stopPropagation(),className:"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors",style:{fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)"},autoComplete:"off"})]}):t.jsx("div",{className:"h-[34px]"})})}const Ne=ke?c.find(e=>h(e)===ke):null,Ze=k?t.jsxs("div",{ref:fe,className:"flex flex-col overflow-auto z-[49] min-w-[220px]",style:{position:"fixed",top:`${de.top}px`,left:`${de.left}px`,width:de.width||220,maxHeight:"400px",fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)",borderRadius:"0 0 8px 8px",boxShadow:"4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A",border:"1px solid rgba(52, 58, 64, 0.12)",borderTop:"none"},children:[x.map((e,r)=>{const n=c.find(u=>h(u)===e);if(!n)return null;const s=x.indexOf(e),o=N===s,l=Ae===s,i=e===b;return t.jsxs(a.Fragment,{children:[t.jsxs("div",{draggable:!i,onDragStart:i?void 0:u=>Ke(u,s),onDragEnd:i?void 0:Ue,onDragOver:i?void 0:u=>qe(u,s),onDragLeave:i?void 0:Je,onDrop:i?void 0:u=>Ge(u,s),className:`flex items-center gap-2 px-3 py-2 rounded transition-all ${i?"cursor-default opacity-100":"cursor-move"} ${!i&&o?"opacity-50":""} ${!i&&l&&N!==null&&N!==s?"ring-2 ring-green-2 ring-offset-1":""}`,children:[!i&&t.jsx("svg",{className:"h-4 w-4 text-gray-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8h16M4 12h16M4 16h16"})}),t.jsx("button",{type:"button",onClick:u=>{u.preventDefault(),u.stopPropagation(),i||xe(e)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${i?"bg-green-2 border-green-2 cursor-default":je.has(e)?"bg-white border-gray-300":"bg-green-2 border-green-2"}`,children:!je.has(e)&&t.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.jsx("span",{className:"text-sm text-gray-900 flex-1",style:{fontFamily:"var(--font-sans)"},children:n.label})]}),r<x.length-1&&t.jsx(pe,{})]},`selected-${e}-${r}`)}),c.filter(e=>!x.includes(h(e))).map((e,r)=>{const n=h(e),s=_e.has(n),o=c.filter(l=>!x.includes(h(l))).indexOf(e);return t.jsxs(a.Fragment,{children:[x.length>0&&o===0&&t.jsx(pe,{}),t.jsxs("label",{className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors",onClick:l=>{l.preventDefault(),xe(n)},children:[t.jsx("button",{type:"button",onClick:l=>{l.preventDefault(),l.stopPropagation(),xe(n)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${s?"bg-green-2 border-green-2":"bg-white border-gray-300"}`,children:s&&t.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.jsx("span",{className:"text-sm text-gray-900 flex-1",children:e.label})]}),o<c.filter(l=>!x.includes(h(l))).length-1&&t.jsx(pe,{})]},`unselected-${n}`)})]}):null;return t.jsxs("div",{className:"w-full",style:{top:"130px",position:"sticky",zIndex:35,backgroundColor:"var(--primary-foreground)"},children:[c.length>0&&t.jsx("div",{className:"pt-2 pb-1",style:{position:"sticky",zIndex:35,backgroundColor:"var(--primary-foreground)"},children:t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx("div",{className:"mb-1 ml-1.5",children:t.jsx("p",{className:"text-xs font-medium text-gray-600",style:{fontFamily:"var(--font-sans)"},children:"Select Columns"})}),t.jsxs("div",{ref:W,className:"inline-flex items-center justify-between gap-2 px-4 py-2.5 cursor-pointer transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]",onClick:()=>ve(!k),style:{fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)",borderRadius:k?"8px 8px 0 0":"8px"},children:[t.jsx("span",{children:Xe}),k?t.jsx(v.ChevronUp,{size:16}):t.jsx(v.ChevronDown,{size:16})]}),k&&nt.createPortal(Ze,document.body)]}),O&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0"}),t.jsx("div",{className:"flex-shrink-0 mt-[1.5rem]",children:t.jsx(Oe,{dateRangePicker:O.dateRangePicker,onWeekToDate:O.onWeekToDate,exportConfig:O.exportConfig,filterChipsConfig:O.filterChipsConfig,trailingActions:O.trailingActions})})]})]})}),c.length>0&&$.length>0?t.jsxs(g.DndContext,{sensors:Pe,collisionDetection:g.closestCenter,onDragStart:We,onDragEnd:Be,children:[t.jsxs("div",{className:"rounded-t-[14px]",style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",overflow:"hidden",background:"var(--primary-foreground)",position:"relative",top:"0.5rem"},children:[z&&t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(2px)",zIndex:20,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"14px"},children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[t.jsx("p",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.6)",margin:0},children:"Loading..."}),t.jsx(ot,{src:"/BrandLoading.gif",alt:"Loading",width:50,height:50,unoptimized:!0,className:"mt-1"})]})}),t.jsx("div",{className:"overflow-x-auto custom-thin-scrollbar-hidden",ref:Ie,style:{maxHeight:"500px",overflowY:"auto",position:"relative",zIndex:1},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px",fontFamily:"var(--font-sans)"},children:[t.jsxs("thead",{children:[t.jsx("tr",{children:t.jsx(g.SortableContext,{items:x,strategy:g.horizontalListSortingStrategy,children:$.map(e=>t.jsx(Qe,{column:e,isHeaderRow:!0},`header-${h(e)}`))})}),Ye&&t.jsx("tr",{children:$.map(e=>{const r=h(e),n=e.filterable===!0;return t.jsx("th",{style:{padding:"8px 14px",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.10)",position:"sticky",top:"41px",zIndex:10,width:e.width||"auto",fontFamily:"var(--font-sans)"},children:n?t.jsxs("div",{style:{position:"relative"},children:[t.jsx("input",{type:"text",placeholder:"Filter...",value:T[r]||"",onChange:s=>{s.stopPropagation(),De(r,s.target.value)},onKeyDown:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),style:{width:"100%",padding:"4px 8px 4px 26px",fontSize:"11.5px",border:"1px solid rgba(52, 58, 64, 0.16)",borderRadius:"6px",background:"var(--primary-foreground)",color:"rgba(30, 33, 37, 0.78)",outline:"none",fontFamily:"var(--font-sans)"},onFocus:s=>{s.target.style.borderColor="rgba(231, 212, 162, 0.65)",s.target.style.background="var(--primary-foreground)"},onBlur:s=>{s.target.style.borderColor="rgba(52, 58, 64, 0.16)",s.target.style.background="var(--primary-foreground)"},autoComplete:"off"}),t.jsx(v.Filter,{size:11,style:{position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",color:"rgba(30, 33, 37, 0.42)",pointerEvents:"none"}})]}):t.jsx("div",{className:"h-[34px]"})},`filter-${r}`)})})]}),t.jsx("tbody",{children:!z&&se.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:$.length,style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"12px",fontFamily:"var(--font-sans)"},children:"No results found"})}):!z&&se.length>0?se.map((e,r)=>t.jsx("tr",{"data-row-id":e.id||r,style:{borderBottom:"1px solid rgba(52, 58, 64, 0.08)",cursor:f?"pointer":"default",transition:"background 0.15s ease"},onClick:f?n=>{n.stopPropagation(),f(e,r)}:void 0,onMouseEnter:n=>{n.currentTarget.style.background="rgba(231, 212, 162, 0.12)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent"},children:$.map(n=>{const s=h(n),o=e[s],l=n.render?n.render(o,e):o,i=n.width&&n.width!=="auto",u=typeof l=="string"&&l.trim()!=="",H=i&&u,J=H?t.jsx(j,{content:l,children:l}):l;return t.jsx("td",{style:{padding:"10px 14px",color:"rgba(30, 33, 37, 0.78)",fontSize:"13px",borderRight:"1px solid rgba(52, 58, 64, 0.04)",width:n.width||"auto",fontFamily:"var(--font-sans)",...H&&{maxWidth:n.width||"200px",overflow:"hidden"}},children:J},s)})},r)):null})]})})]}),t.jsx(g.DragOverlay,{children:Ne?t.jsx("div",{className:"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(v.GripVertical,{size:14,className:"text-[var(--text-faint)]"}),t.jsx("span",{className:"text-sm font-semibold text-[var(--text-ink)]",children:Ne.label})]})}):null})]}):null,(X?C>0:ne.length>0)&&t.jsx("div",{className:"border-t border-gray-200 rounded-b-[14px]",style:{backgroundColor:"var(--primary-foreground)"},children:t.jsx(ze.Pagination,{page:ce,pageSizeOptions:[5,10,20,50,100],pageSize:Q,totalCount:X?C:ne.length,currentDataLength:se.length,onPageChange:Z,onPageSizeChange:M?e=>{ge(e),Z(1)}:e=>{ge(e),Z(1)},showPageSizeSelector:!0})})]})}function it({title:p="Summary stats",stats:c=[],columns:y=2}){return t.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:[t.jsx("div",{className:"text-[11px] tracking-[0.14em] uppercase mb-[10px]",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650},children:p}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${y}, minmax(0, 1fr))`,gap:"10px"},children:c.map((f,C)=>t.jsxs("div",{style:{position:"relative",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",background:"rgba(255, 255, 255, 0.72)",padding:f.accentColor?"10px 10px 10px 14px":"10px",minHeight:"62px",display:"flex",flexDirection:"column",justifyContent:"center",gap:"5px",overflow:"hidden"},children:[f.accentColor&&t.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"4px",background:f.accentColor,borderTopLeftRadius:"12px",borderBottomLeftRadius:"12px"}}),t.jsx("div",{className:"text-[10px] tracking-[0.14em] uppercase",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650,lineHeight:1.1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:f.label}),t.jsx("div",{style:{fontSize:"13px",color:f.valueStyle==="muted"?"rgba(30, 33, 37, 0.56)":"rgba(30, 33, 37, 0.78)",fontWeight:700,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:f.valueStyle==="mono"?"ui-monospace, monospace":"inherit"},children:f.value}),f.subtext&&t.jsx("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:f.subtext})]},C))})]})}exports.DataTable=lt;exports.DataTableFilters=Oe;exports.SummaryStatsPanel=it;
2
- //# sourceMappingURL=SummaryStatsPanel.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SummaryStatsPanel.cjs.js","sources":["../src/components/data/DataTableFilters.jsx","../src/components/data/DataTable.jsx","../src/components/data/SummaryStatsPanel.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useEffect, useRef, Suspense } from \"react\";\nimport { Download, ChevronDown, CalendarClock, CalendarDays } from \"lucide-react\";\nimport { createPortal } from \"react-dom\";\nimport { CustomFilterChips } from \"../common\";\n\n/**\n * DataTableFilters Component\n * Displays filter buttons (Week to Date, Select Date Range, Export) and filter chips\n * \n * @param {Object} props\n * @param {React.ReactNode} props.dateRangePicker - DateRangePicker component (wrapped in Suspense)\n * @param {Function} props.onWeekToDate - Handler for \"Week to Date\" button\n * @param {Object} props.exportConfig - Export configuration\n * @param {boolean} props.exportConfig.isExporting - Whether export is in progress\n * @param {Function} props.exportConfig.onExport - Export handler (type) => void\n * @param {Array} props.exportConfig.types - Export types array (default: ['csv'])\n * @param {Object} props.filterChipsConfig - Filter chips configuration\n * @param {Object} props.filterChipsConfig.filters - Current filter values\n * @param {Function} props.filterChipsConfig.onChange - Filter chips change handler\n * @param {Function} props.filterChipsConfig.onClear - Clear all filters handler\n * @param {Array} props.filterChipsConfig.customFilters - Custom filter chips (e.g., date range)\n */\nexport default function DataTableFilters({\n dateRangePicker,\n onWeekToDate,\n exportConfig,\n filterChipsConfig,\n trailingActions, // Optional extra actions rendered after Export (e.g., Add Users button)\n}) {\n const [showExportMenu, setShowExportMenu] = useState(false);\n const exportButtonRef = useRef(null);\n const exportMenuRef = useRef(null);\n\n // Handle click outside to close export menu\n useEffect(() => {\n const handleClickOutside = (event) => {\n if (\n exportMenuRef.current &&\n !exportMenuRef.current.contains(event.target) &&\n exportButtonRef.current &&\n !exportButtonRef.current.contains(event.target)\n ) {\n setShowExportMenu(false);\n }\n };\n\n if (showExportMenu) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }\n }, [showExportMenu]);\n\n const openExportMenu = () => {\n setShowExportMenu((prev) => !prev);\n };\n\n const handleExport = (type) => {\n setShowExportMenu(false);\n if (exportConfig?.onExport) {\n exportConfig.onExport(type);\n }\n };\n\n // Check if there are any filter chips to display\n const hasFilterChips = () => {\n if (!filterChipsConfig?.filters) return false;\n \n const filters = filterChipsConfig.filters;\n const customFilters = filterChipsConfig.customFilters || [];\n \n // Check if any regular filters have values\n const hasRegularFilters = Object.entries(filters).some(([key, value]) => {\n if (Array.isArray(value) && value.length) return true;\n if (typeof value === \"string\" && value.trim() !== \"\") return true;\n if (value && typeof value === \"object\" && (value.min != null || value.max != null)) return true;\n return false;\n });\n \n // Check if any custom filters are active\n const hasCustomFilters = customFilters.some(filterObj => filterObj.active);\n \n return hasRegularFilters || hasCustomFilters;\n };\n\n const shouldShowChips = hasFilterChips();\n\n return (\n <div className=\"flex items-center gap-3 flex-wrap\">\n {/* Week to Date Button */}\n {onWeekToDate && (\n <button\n onClick={onWeekToDate}\n className=\"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900\"\n style={{ fontFamily: 'var(--font-sans)' }}\n >\n <CalendarClock size={16} />\n <span>Week to Date</span>\n </button>\n )}\n\n {/* Select Date Range */}\n {dateRangePicker && (\n <Suspense\n fallback={\n <div className=\"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400\">\n <CalendarClock size={16} />\n <span>Loading...</span>\n </div>\n }\n >\n {dateRangePicker}\n </Suspense>\n )}\n\n {/* Export Button */}\n {exportConfig && (\n <div className=\"relative\">\n <button\n ref={exportButtonRef}\n onClick={openExportMenu}\n disabled={exportConfig.isExporting}\n className=\"inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]\"\n style={{ fontFamily: 'var(--font-sans)' }}\n >\n <div className=\"flex items-center gap-2\">\n <Download size={16} />\n <span>{exportConfig.isExporting ? \"Exporting...\" : \"Export\"}</span>\n </div>\n <ChevronDown size={16} />\n </button>\n {showExportMenu && (\n <div\n ref={exportMenuRef}\n className=\"absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]\"\n >\n {(exportConfig.types || [\"csv\"]).map((type) => (\n <button\n key={type}\n onClick={() => handleExport(type)}\n className=\"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors\"\n style={{ fontFamily: 'var(--font-sans)' }}\n >\n Export {type.toUpperCase()}\n </button>\n ))}\n </div>\n )}\n </div>\n )}\n\n {/* Filter chips + optional trailing actions (e.g., Add Users / Add Agent) */}\n {(shouldShowChips || trailingActions) && (\n <>\n {/* Vertical line only when there are actual chips; this avoids double lines\n when we only show trailingActions (like Add Agent) with no chips. */}\n {shouldShowChips && (\n <div className=\"h-9 mt-1 w-px bg-gray-300 flex-shrink-0\"></div>\n )}\n\n {/* Filter Chips + trailing actions */}\n <div className=\"flex items-center gap-3 justify-end\">\n {shouldShowChips && filterChipsConfig && (\n <CustomFilterChips\n filters={filterChipsConfig.filters}\n onChange={filterChipsConfig.onChange}\n onClear={filterChipsConfig.onClear}\n customFilters={filterChipsConfig.customFilters || []}\n fieldOptions={filterChipsConfig.fieldOptions || {}}\n />\n )}\n {trailingActions && (\n <div className=\"flex-shrink-0\">\n {trailingActions}\n </div>\n )}\n </div>\n </>\n )}\n </div>\n );\n}\n\n","\"use client\";\n\nimport React, { useState, useMemo, useRef, useEffect, useCallback } from \"react\";\nimport {\n DndContext,\n closestCenter,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n DragOverlay,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n horizontalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { GripVertical, ChevronUp, ChevronDown, Filter, ArrowUp, ArrowDown } from \"lucide-react\";\nimport { createPortal } from \"react-dom\";\nimport Pagination from \"../common/Pagination.jsx\";\n// TODO: surface column limit errors via callback prop (onMaxColumnsError)\n// TODO: replace with framework-agnostic component\nfunction OpenCloseArrow({ isOpen, iconSize }) { return null; }\n// TODO: replace with framework-agnostic component\nfunction Separator() { return <div style={{ height: 1, background: \"rgba(52,58,64,0.08)\" }} />; }\n// TODO: replace with framework-agnostic context\nconst useUserContext = () => ({ userData: { email: \"anonymous\" } });\n// TODO: replace with framework-agnostic image\nconst Image = (props) => <img {...props} />;\nimport DataTableFilters from \"./DataTableFilters\";\n// TODO: replace with framework-agnostic tooltip\nfunction HoverBalloon({ children }) { return children; }\n\n/**\n * DataTable Component\n * Interactive table with column reordering, filtering, sorting, sticky headers, and pagination\n * Follows \"No Judgment\" principle - scores and counts displayed uniformly\n */\nexport default function DataTable({ \n data = [], \n columns = [], \n initialPageSize = 10, \n onRowClick,\n // Server-side pagination props (optional)\n totalCount = null, // Total count from server (null = use client-side pagination)\n page: controlledPage = null, // Controlled page (null = use internal state)\n pageSize: controlledPageSize = null, // Controlled pageSize (null = use internal state)\n onPageChange = null, // Callback for page changes (null = use internal state)\n onPageSizeChange = null, // Callback for pageSize changes (null = use internal state)\n onFilterChange = null, // Callback for filter changes (null = use client-side filtering)\n // Optional callback to surface column limit errors to host app\n onMaxColumnsError = null,\n // Server-side sorting props (optional)\n onSort = null, // Callback for sort changes (null = use client-side sorting)\n sortFields = [], // Array of [field, direction] tuples from parent (null = use internal state)\n tableId = null, // Optional unique identifier for localStorage persistence (e.g., \"history\", \"agents\")\n isLoading = false, // Loading state to show overlay inside table\n // Filter props (optional)\n filtersConfig = null, // Configuration for filters (dateRangePicker, onWeekToDate, exportConfig, filterChipsConfig)\n}) {\n // Get user email for user-specific storage\n const { userData } = useUserContext();\n const userId = userData?.email || 'anonymous';\n\n // Component to show tooltip only when text is actually truncated\n const TruncatedCell = React.memo(({ children, content, className = \"\" }) => {\n const textRef = useRef(null);\n const [isTruncated, setIsTruncated] = useState(false);\n\n useEffect(() => {\n const checkTruncation = () => {\n if (textRef.current) {\n const isOverflowing = textRef.current.scrollWidth > textRef.current.clientWidth;\n setIsTruncated(isOverflowing);\n }\n };\n\n checkTruncation();\n const timeoutId = setTimeout(checkTruncation, 0);\n\n window.addEventListener('resize', checkTruncation);\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('resize', checkTruncation);\n };\n }, [children, content]);\n\n const textElement = (\n <span className={`truncate block ${className}`} ref={textRef}>\n {children}\n </span>\n );\n\n if (isTruncated && content) {\n return (\n <HoverBalloon\n content={content}\n styling=\"bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal\"\n indicatorColor=\"bg-green-2\"\n direction=\"top\"\n >\n {textElement}\n </HoverBalloon>\n );\n }\n\n return textElement;\n });\n TruncatedCell.displayName = 'TruncatedCell';\n\n // Use controlled pagination if props provided, otherwise use internal state\n const isServerSidePagination = totalCount !== null && onPageChange !== null;\n // Use server-side filtering if onFilterChange is provided\n const isServerSideFiltering = onFilterChange !== null;\n // Use server-side sorting if onSort is provided\n const isServerSideSorting = onSort !== null;\n const [internalPage, setInternalPage] = useState(1);\n const [internalPageSize, setInternalPageSize] = useState(initialPageSize);\n \n const page = controlledPage !== null ? controlledPage : internalPage;\n const pageSize = controlledPageSize !== null ? controlledPageSize : internalPageSize;\n \n const setPage = (newPage) => {\n if (onPageChange) {\n onPageChange(newPage);\n } else {\n setInternalPage(newPage);\n }\n };\n \n const setPageSize = (newSize) => {\n if (onPageSizeChange) {\n onPageSizeChange(newSize);\n } else {\n setInternalPageSize(newSize);\n }\n };\n \n const MAX_COLUMNS = 9;\n \n const ACTION_COLUMN_ID = 'action';\n\n // Refs for localStorage persistence\n const userHasManuallyChangedColumns = useRef(false);\n \n // Generate unique storage key for this table (includes userId)\n const storageKey = useMemo(() => {\n if (tableId) {\n return `dataTable_columns_${tableId}:${userId}`;\n }\n // Fallback: use column keys to create unique identifier\n const columnKeys = columns.map(col => (col.id || col.key)).sort().join('_');\n return `dataTable_columns_${columnKeys}:${userId}`;\n }, [tableId, columns, userId]);\n \n const manualChangeFlagKey = useMemo(() => {\n if (tableId) {\n return `dataTable_manual_change_${tableId}:${userId}`;\n }\n return null;\n }, [tableId, userId]);\n \n // Load saved column visibility from localStorage\n const loadSavedColumns = useCallback((key, cols) => {\n if (typeof window === 'undefined' || !key || !cols || cols.length === 0) return null;\n try {\n const saved = localStorage.getItem(key);\n if (saved) {\n const savedColumns = JSON.parse(saved);\n // Validate that saved columns still exist in current columns\n const validColumns = savedColumns.filter(colId => \n cols.some(col => (col.id || col.key) === colId)\n );\n if (validColumns.length > 0) {\n return validColumns;\n }\n }\n } catch (error) {\n console.warn('Failed to load saved columns from localStorage:', error);\n }\n return null;\n }, []);\n \n const [filters, setFilters] = useState({});\n // Internal sorting state (only used for client-side sorting)\n const [internalSortField, setInternalSortField] = useState(null);\n const [internalSortDirection, setInternalSortDirection] = useState(\"asc\");\n \n // Sync internal filters when filterChipsConfig.filters changes (when chips are removed)\n// useEffect(() => {\n// if (isServerSideFiltering && filtersConfig?.filterChipsConfig?.filters) {\n// // Sync DataTable's internal filters with parent's filter chips\n// // This ensures input fields clear when chips are removed\n// setFilters(filtersConfig.filterChipsConfig.filters);\n// }\n// }, [filtersConfig?.filterChipsConfig?.filters, isServerSideFiltering]);\n \n // Get current sort state (from props if server-side, otherwise from internal state)\n // For server-side sorting, we need to map the sortField back to the column key\n // because History.js's handleSort maps some keys (e.g., \"evaluation.csat_score\" -> \"csat_score\")\n // but we need to compare against the original column key\n const getSortFieldForComparison = useCallback((sortFieldFromProps, columnId) => {\n // Reverse mapping: if sortField is \"csat_score\", it should match column \"evaluation.csat_score\"\n if (sortFieldFromProps === \"csat_score\" && columnId === \"evaluation.csat_score\") {\n return columnId;\n }\n // For other fields, use as-is (they should match)\n return sortFieldFromProps;\n }, []);\n \n const sortField = isServerSideSorting && sortFields.length > 0 ? sortFields[0][0] : internalSortField;\n const sortDirection = isServerSideSorting && sortFields.length > 0 ? sortFields[0][1] : internalSortDirection;\n // Support both 'id' and 'key' for column identifiers\n const [columnOrder, setColumnOrder] = useState(() => \n columns.map((col) => col.id || col.key)\n );\n const enforceActionPosition = useCallback((cols) => {\n if (!cols || cols.length === 0) return cols;\n\n // De-duplicate and enforce max column limit first\n let result = Array.from(new Set(cols));\n if (result.length > MAX_COLUMNS) {\n result = result.slice(0, MAX_COLUMNS);\n }\n\n const allColumnIds = columns.map((col) => col.id || col.key);\n const tableHasActionColumn = allColumnIds.includes(ACTION_COLUMN_ID);\n const hasAction = result.includes(ACTION_COLUMN_ID);\n\n // If the table defines an action column, always include it in the visible set,\n // counting toward the MAX_COLUMNS cap.\n if (!hasAction && tableHasActionColumn) {\n if (result.length >= MAX_COLUMNS) {\n // Replace the last non-action entry with the action column\n result = [...result.slice(0, MAX_COLUMNS - 1), ACTION_COLUMN_ID];\n } else {\n result = [...result, ACTION_COLUMN_ID];\n }\n }\n\n // Ensure the action column is always rendered last\n const withoutAction = result.filter((id) => id !== ACTION_COLUMN_ID);\n return [...withoutAction, ACTION_COLUMN_ID];\n }, [columns]);\n\n // Column selection state - load persisted columns if they exist, otherwise default to first 9\n const [visibleColumns, setVisibleColumns] = useState(() => {\n // Try to load persisted columns immediately on mount\n if (typeof window !== 'undefined' && tableId) {\n try {\n // Check if user has manually changed columns before\n const hasManualChange = localStorage.getItem(`dataTable_manual_change_${tableId}:${userId}`) === 'true';\n \n if (hasManualChange) {\n // User has manually changed columns, load persisted selection immediately\n const saved = localStorage.getItem(`dataTable_columns_${tableId}:${userId}`);\n if (saved) {\n const savedColumns = JSON.parse(saved);\n if (Array.isArray(savedColumns) && savedColumns.length > 0) {\n userHasManuallyChangedColumns.current = true;\n // Validate saved columns exist in current columns\n const validColumns = savedColumns.filter(colId => \n columns.some(col => (col.id || col.key) === colId)\n );\n if (validColumns.length > 0) {\n return validColumns.slice(0, MAX_COLUMNS);\n }\n }\n }\n }\n } catch (error) {\n console.warn('Failed to load saved columns from localStorage:', error);\n }\n }\n \n // If no persisted columns, default to first 9 columns\n const columnIds = columns.map((col) => col.id || col.key);\n const initial = columnIds.slice(0, MAX_COLUMNS);\n return enforceActionPosition(initial);\n });\n const [isColumnDropdownOpen, setIsColumnDropdownOpen] = useState(false);\n const [columnDropdownPosition, setColumnDropdownPosition] = useState({ top: 0, left: 0, width: 0 });\n const [pendingSelection, setPendingSelection] = useState(new Set());\n const [pendingDeselection, setPendingDeselection] = useState(new Set());\n const [draggedColumnIndex, setDraggedColumnIndex] = useState(null);\n const [dragOverColumnIndex, setDragOverColumnIndex] = useState(null);\n const columnDropdownRef = useRef(null);\n const columnDropdownMenuRef = useRef(null);\n const toastTimeoutRef = useRef(null);\n const [activeId, setActiveId] = useState(null);\n const tableRef = useRef(null);\n\n // Helper to get column identifier (id or key)\n const getColumnId = (col) => col.id || col.key;\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n\n // Handle column drag end (table-level drag and drop)\n const handleDragEnd = (event) => {\n const { active, over } = event;\n if (over && active.id !== over.id) {\n // Mark that user has manually changed columns\n userHasManuallyChangedColumns.current = true;\n \n // Update visibleColumns order when dragging in table header\n setVisibleColumns((prev) => {\n const oldIndex = prev.indexOf(active.id);\n const newIndex = prev.indexOf(over.id);\n if (oldIndex !== -1 && newIndex !== -1) {\n const reordered = arrayMove(prev, oldIndex, newIndex);\n // Save immediately after drag\n saveColumnsToStorage(reordered);\n return reordered;\n }\n return prev;\n });\n \n // Also update columnOrder for consistency\n setColumnOrder((items) => {\n const oldIndex = items.indexOf(active.id);\n const newIndex = items.indexOf(over.id);\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n setActiveId(null);\n };\n\n // Handle column drag start\n const handleDragStart = (event) => {\n setActiveId(event.active.id);\n };\n\n // Filter data based on filter inputs - supports multiple keywords\n // For server-side filtering, skip client-side filtering (data is already filtered by server)\n const filteredData = useMemo(() => {\n if (isServerSideFiltering) {\n // Server-side filtering: data is already filtered, use as-is\n return data || [];\n }\n \n // Client-side filtering: filter the data locally\n if (!data || data.length === 0) return [];\n \n return data.filter((row) => {\n return Object.keys(filters).every((key) => {\n const filterValue = filters[key];\n if (!filterValue || filterValue.trim() === \"\") return true;\n \n const cellValue = row[key];\n if (cellValue === null || cellValue === undefined) return false;\n \n const cellValueStr = String(cellValue).toLowerCase();\n const filterValueLower = filterValue.toLowerCase().trim();\n \n // Support multiple keywords separated by spaces\n // All keywords must be present in the cell value\n const keywords = filterValueLower.split(/\\s+/).filter(k => k.length > 0);\n \n return keywords.every(keyword => cellValueStr.includes(keyword));\n });\n });\n }, [data, filters, isServerSideFiltering]);\n\n // Sort filtered data\n // For server-side sorting, skip client-side sorting (data is already sorted by server)\n const sortedData = useMemo(() => {\n if (isServerSideSorting) {\n // Server-side sorting: data is already sorted, use as-is\n return filteredData;\n }\n \n // Client-side sorting: sort the filtered data locally\n if (!sortField) return filteredData;\n \n return [...filteredData].sort((a, b) => {\n const aVal = a[sortField];\n const bVal = b[sortField];\n \n // Handle null/undefined\n if (aVal === null || aVal === undefined) return 1;\n if (bVal === null || bVal === undefined) return -1;\n \n // Handle numbers\n if (typeof aVal === \"number\" && typeof bVal === \"number\") {\n return sortDirection === \"asc\" ? aVal - bVal : bVal - aVal;\n }\n \n // Handle strings\n const aStr = String(aVal).toLowerCase();\n const bStr = String(bVal).toLowerCase();\n \n if (sortDirection === \"asc\") {\n return aStr.localeCompare(bStr);\n } else {\n return bStr.localeCompare(aStr);\n }\n });\n }, [filteredData, sortField, sortDirection, isServerSideSorting]);\n\n // Paginate sorted data\n // For server-side pagination, use data as-is (already paginated by server)\n // For client-side pagination, paginate the sorted data\n const paginatedData = useMemo(() => {\n if (isServerSidePagination) {\n // Server-side: data is already paginated, use as-is\n // Use data directly (not sortedData) since server handles sorting\n return data || [];\n } else {\n // Client-side: paginate the sorted data\n const startIndex = (page - 1) * pageSize;\n const endIndex = startIndex + pageSize;\n return sortedData.slice(startIndex, endIndex);\n }\n }, [data, sortedData, page, pageSize, isServerSidePagination]);\n\n // Handle header click for sorting\n const handleSort = (field) => {\n if (isServerSideSorting && onSort) {\n // Server-side sorting: call parent's onSort callback\n onSort(field);\n // Reset to first page on sort (if pagination is controlled)\n if (onPageChange) {\n onPageChange(1);\n } else {\n setInternalPage(1);\n }\n } else {\n // Client-side sorting: update internal state\n if (internalSortField === field) {\n setInternalSortDirection(internalSortDirection === \"asc\" ? \"desc\" : \"asc\");\n } else {\n setInternalSortField(field);\n setInternalSortDirection(\"asc\");\n }\n setPage(1); // Reset to first page on sort\n }\n };\n\n // Handle filter change\n const handleFilterChange = (id, value) => {\n // Remove filter if value is empty, otherwise update it\n const newFilters = value && value.trim() !== \"\"\n ? { ...filters, [id]: value }\n : Object.fromEntries(Object.entries(filters).filter(([key]) => key !== id));\n \n // Update local filter state\n setFilters(newFilters);\n \n // If server-side filtering, notify parent component\n if (isServerSideFiltering && onFilterChange) {\n onFilterChange(newFilters);\n }\n \n // Reset to first page on filter (works for both client and server-side pagination)\n if (onPageChange) {\n onPageChange(1);\n } else {\n setInternalPage(1);\n }\n };\n\n // Surface max columns limit error via callback, throttled to once per 3s\n const showMaxColumnsError = (message) => {\n if (toastTimeoutRef.current) return;\n if (typeof onMaxColumnsError === 'function') {\n onMaxColumnsError(message);\n }\n toastTimeoutRef.current = setTimeout(() => {\n toastTimeoutRef.current = null;\n }, 3000);\n };\n\n // Save columns to localStorage\n const saveColumnsToStorage = useCallback((cols) => {\n if (typeof window !== 'undefined' && storageKey && cols.length > 0 && userHasManuallyChangedColumns.current) {\n try {\n localStorage.setItem(storageKey, JSON.stringify(cols));\n if (manualChangeFlagKey) {\n localStorage.setItem(manualChangeFlagKey, 'true');\n }\n } catch (error) {\n console.warn('Failed to save columns to localStorage:', error);\n }\n }\n }, [storageKey, manualChangeFlagKey]);\n\n // Toggle column selection with smooth transitions\n const toggleColumnSelection = (columnId) => {\n // Prevent toggling the action column visibility; it should always be shown\n if (columnId === ACTION_COLUMN_ID) {\n return;\n }\n // Mark that user has manually changed columns\n userHasManuallyChangedColumns.current = true;\n \n setVisibleColumns(prev => {\n // Unselecting: show unchecked state first, then remove from selected list\n if (prev.includes(columnId)) {\n // Clear any pending throttling timeout when unselecting\n if (toastTimeoutRef.current) {\n clearTimeout(toastTimeoutRef.current);\n toastTimeoutRef.current = null;\n }\n // toast.dismiss(\"max-columns-toast\");\n\n // Don't allow deselecting all columns\n if (prev.length === 1) return prev;\n \n // Show unchecked state first, then remove after delay\n setPendingDeselection(prevSet => new Set(prevSet).add(columnId));\n setTimeout(() => {\n setVisibleColumns(current => {\n const updated = current.filter(id => id !== columnId);\n const constrained = enforceActionPosition(updated);\n // Save immediately after user change\n saveColumnsToStorage(constrained);\n return constrained;\n });\n setPendingDeselection(prevSet => {\n const next = new Set(prevSet);\n next.delete(columnId);\n return next;\n });\n }, 200); // 200ms delay for smooth transition\n \n return prev; // Return current state, actual removal happens in setTimeout\n }\n \n // Selecting: check if we're at the maximum limit\n if (prev.length >= MAX_COLUMNS) {\n showMaxColumnsError(\"Maximum 9 column selection allowed\");\n return prev;\n }\n \n // Show checked state first, then add to selected list after delay\n setPendingSelection(prevSet => new Set(prevSet).add(columnId));\n setTimeout(() => {\n setVisibleColumns(current => {\n const updated = !current.includes(columnId) ? [...current, columnId] : current;\n const constrained = enforceActionPosition(updated);\n // Save immediately after user change\n saveColumnsToStorage(constrained);\n return constrained;\n });\n setPendingSelection(prevSet => {\n const next = new Set(prevSet);\n next.delete(columnId);\n return next;\n });\n }, 200); // 200ms delay for smooth transition\n \n return prev; // Return current state, actual addition happens in setTimeout\n });\n };\n\n // Column drag handlers for reordering in dropdown\n const handleColumnDragStart = (e, index) => {\n if (visibleColumns[index] === ACTION_COLUMN_ID) return;\n setDraggedColumnIndex(index);\n };\n\n const handleColumnDragEnd = () => {\n setDraggedColumnIndex(null);\n setDragOverColumnIndex(null);\n };\n\n const handleColumnDragOver = (e, index) => {\n e.preventDefault();\n if (draggedColumnIndex !== null && draggedColumnIndex !== index) {\n setDragOverColumnIndex(index);\n }\n };\n\n const handleColumnDragLeave = () => {\n setDragOverColumnIndex(null);\n };\n\n const handleColumnDrop = (e, dropIndex) => {\n e.preventDefault();\n if (\n draggedColumnIndex !== null &&\n draggedColumnIndex !== dropIndex &&\n visibleColumns[dropIndex] !== ACTION_COLUMN_ID &&\n visibleColumns[draggedColumnIndex] !== ACTION_COLUMN_ID\n ) {\n // Mark that user has manually changed columns\n userHasManuallyChangedColumns.current = true;\n \n setVisibleColumns(prev => {\n const reordered = arrayMove(prev, draggedColumnIndex, dropIndex);\n const constrained = enforceActionPosition(reordered);\n // Save immediately after drag\n saveColumnsToStorage(constrained);\n return constrained;\n });\n }\n setDraggedColumnIndex(null);\n setDragOverColumnIndex(null);\n };\n\n // Update columnOrder when visibleColumns changes\n useEffect(() => {\n setColumnOrder(prev => {\n // Keep visible columns in their current order, append any new ones\n const visibleOrder = visibleColumns.filter(id => prev.includes(id));\n const newColumns = visibleColumns.filter(id => !prev.includes(id));\n const hiddenColumns = prev.filter(id => !visibleColumns.includes(id));\n return [...visibleOrder, ...newColumns, ...hiddenColumns];\n });\n }, [visibleColumns]);\n\n // Save to localStorage whenever visibleColumns changes (only if user has manually changed columns)\n useEffect(() => {\n if (typeof window !== 'undefined' && storageKey && visibleColumns.length > 0 && userHasManuallyChangedColumns.current) {\n try {\n const constrained = enforceActionPosition(visibleColumns);\n localStorage.setItem(storageKey, JSON.stringify(constrained));\n if (manualChangeFlagKey) {\n localStorage.setItem(manualChangeFlagKey, 'true');\n }\n } catch (error) {\n console.warn('Failed to save columns to localStorage:', error);\n }\n }\n }, [visibleColumns, storageKey, manualChangeFlagKey]);\n\n // Initialize visibleColumns when columns become available (if not already initialized)\n useEffect(() => {\n // Only initialize if columns are available and visibleColumns is empty\n if (columns.length > 0 && visibleColumns.length === 0) {\n // Check if user has manually changed columns before\n if (typeof window !== 'undefined' && tableId) {\n try {\n const hasManualChange = localStorage.getItem(`dataTable_manual_change_${tableId}:${userId}`) === 'true';\n if (hasManualChange) {\n const saved = localStorage.getItem(`dataTable_columns_${tableId}:${userId}`);\n if (saved) {\n const savedColumns = JSON.parse(saved);\n if (Array.isArray(savedColumns) && savedColumns.length > 0) {\n // Validate saved columns exist in current columns\n const validColumns = savedColumns.filter(colId => \n columns.some(col => (col.id || col.key) === colId)\n );\n if (validColumns.length > 0) {\n userHasManuallyChangedColumns.current = true;\n setVisibleColumns(validColumns.slice(0, MAX_COLUMNS));\n return;\n }\n }\n }\n }\n } catch (error) {\n console.warn('Failed to load saved columns from localStorage:', error);\n }\n }\n \n // Default to first 9 columns if no saved columns\n const columnIds = columns.map((col) => col.id || col.key);\n setVisibleColumns(enforceActionPosition(columnIds.slice(0, MAX_COLUMNS)));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [columns, tableId, userId, enforceActionPosition]);\n\n // Get ordered columns based on visibleColumns and columnOrder\n const orderedColumns = useMemo(() => {\n // Filter to only show visible columns, maintaining their order\n const cols = visibleColumns\n .map((id) => columns.find((col) => getColumnId(col) === id))\n .filter(Boolean);\n return enforceActionPosition(cols.map(getColumnId))\n .map((id) => columns.find((col) => getColumnId(col) === id))\n .filter(Boolean);\n }, [columns, visibleColumns]);\n\n // Check if any columns are filterable\n const hasFilterableColumns = useMemo(() => {\n return orderedColumns.some((col) => col.filterable === true);\n }, [orderedColumns]);\n\n // Column dropdown position management\n useEffect(() => {\n if (!isColumnDropdownOpen || !columnDropdownRef.current) return;\n\n const updatePosition = () => {\n if (columnDropdownRef.current) {\n const rect = columnDropdownRef.current.getBoundingClientRect();\n // For position: fixed, use viewport coordinates directly (no scroll offset needed)\n // This ensures the dropdown scrolls with the button\n // Connect menu directly to button (no gap)\n setColumnDropdownPosition({\n top: rect.bottom, // No gap - connect directly\n left: rect.left,\n width: Math.max(rect.width || 220, 220),\n });\n }\n };\n\n updatePosition();\n \n // Use simple scroll listeners like Dropdown component for smooth scrolling\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isColumnDropdownOpen]);\n\n // Close dropdown when clicking outside\n useEffect(() => {\n const handleClickOutside = (event) => {\n if (\n isColumnDropdownOpen &&\n columnDropdownRef.current &&\n !columnDropdownRef.current.contains(event.target) &&\n columnDropdownMenuRef.current &&\n !columnDropdownMenuRef.current.contains(event.target)\n ) {\n setIsColumnDropdownOpen(false);\n }\n };\n\n if (isColumnDropdownOpen) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }\n }, [isColumnDropdownOpen]);\n\n // Display text for dropdown button\n const displayText = visibleColumns.length === 1 \n ? columns.find(col => (col.id || col.key) === visibleColumns[0])?.label || \"1 selected\"\n : `${visibleColumns.length} selected`;\n\n // Sortable header cell component\n function SortableHeader({ column, isHeaderRow = true }) {\n const columnId = getColumnId(column);\n const isActionColumn = columnId === ACTION_COLUMN_ID;\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id: columnId });\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n opacity: isDragging ? 0.5 : 1,\n width: column.width || \"auto\",\n minWidth: column.width || \"auto\",\n };\n\n // For server-side sorting, check if the sortField matches this column\n // Handle reverse mapping (e.g., \"csat_score\" matches \"evaluation.csat_score\")\n let isSorted = false;\n if (isServerSideSorting && sortFields.length > 0) {\n const sortFieldFromProps = sortFields[0][0];\n // Direct match\n if (sortFieldFromProps === columnId) {\n isSorted = true;\n }\n // Reverse mapping: \"csat_score\" matches \"evaluation.csat_score\"\n else if (sortFieldFromProps === \"csat_score\" && columnId === \"evaluation.csat_score\") {\n isSorted = true;\n }\n } else {\n // Client-side sorting: direct comparison\n isSorted = sortField === columnId;\n }\n \n const isAsc = sortDirection === \"asc\";\n const isFilterable = column.filterable === true; // Only filterable if explicitly set to true\n\n // Filter row\n if (!isHeaderRow) {\n return (\n <th\n style={{\n width: column.width || \"auto\",\n minWidth: column.width || \"auto\",\n backgroundColor: \"var(--primary-foreground)\",\n }}\n className=\"sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left\"\n >\n {isFilterable ? (\n <div className=\"relative\">\n <Filter\n size={12}\n className=\"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none\"\n />\n <input\n type=\"text\"\n placeholder=\"Filter...\"\n value={filters[columnId] || \"\"}\n onChange={(e) => {\n e.stopPropagation();\n handleFilterChange(columnId, e.target.value);\n }}\n onKeyDown={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.stopPropagation()}\n className=\"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors\"\n style={{ fontFamily: 'var(--font-sans)', backgroundColor: \"var(--primary-foreground)\" }}\n autoComplete=\"off\"\n />\n </div>\n ) : (\n <div className=\"h-[34px]\"></div>\n )}\n </th>\n );\n }\n\n // Header row\n return (\n <th\n ref={setNodeRef}\n style={{\n ...style,\n padding: '12px 14px',\n textAlign: isActionColumn ? 'center' : 'left',\n fontWeight: 650,\n fontSize: '11px',\n letterSpacing: '0.14em',\n textTransform: 'uppercase',\n color: 'rgba(30, 33, 37, 0.62)',\n cursor: column.sortable !== false ? 'pointer' : 'default',\n width: column.width || 'auto',\n borderRight: '1px solid rgba(52, 58, 64, 0.06)',\n userSelect: 'none',\n background: 'var(--primary-foreground)',\n borderBottom: '1px solid rgba(52, 58, 64, 0.12)',\n position: 'sticky',\n top: 0,\n zIndex: 10,\n fontFamily: 'var(--font-sans)',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n justifyContent: isActionColumn ? 'center' : 'flex-start',\n }}\n >\n {!isActionColumn && (\n <div\n {...attributes}\n {...listeners}\n style={{ cursor: 'grab', color: 'rgba(30, 33, 37, 0.32)' }}\n >\n <GripVertical size={12} />\n </div>\n )}\n <span \n onClick={() => column.sortable !== false && handleSort(columnId)}\n style={{ cursor: column.sortable !== false ? 'pointer' : 'default' }}\n >\n {column.label.toUpperCase()}\n </span>\n {column.sortable !== false && isSorted && (\n <span>\n {isAsc ? <ChevronUp size={12} /> : <ChevronDown size={12} />}\n </span>\n )}\n </div>\n </th>\n );\n }\n\n // Drag overlay for column header\n const activeColumn = activeId ? columns.find((col) => getColumnId(col) === activeId) : null;\n\n // Column dropdown menu\n const columnDropdownMenu = isColumnDropdownOpen ? (\n <div\n ref={columnDropdownMenuRef}\n className=\"flex flex-col overflow-auto z-[49] min-w-[220px]\"\n style={{\n position: \"fixed\",\n top: `${columnDropdownPosition.top}px`,\n left: `${columnDropdownPosition.left}px`,\n width: columnDropdownPosition.width || 220,\n maxHeight: `400px`,\n fontFamily: 'var(--font-sans)',\n backgroundColor: \"var(--primary-foreground)\",\n borderRadius: '0 0 8px 8px', // Rounded corners only on bottom\n boxShadow: '4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A',\n border: '1px solid rgba(52, 58, 64, 0.12)',\n borderTop: 'none', // No top border to connect seamlessly\n }}\n >\n {/* Render selected columns first, in their current order */}\n {visibleColumns.map((columnId, index) => {\n const col = columns.find(c => getColumnId(c) === columnId);\n if (!col) return null;\n const actualIndex = visibleColumns.indexOf(columnId);\n const isDragging = draggedColumnIndex === actualIndex;\n const isDragOver = dragOverColumnIndex === actualIndex;\n const isAction = columnId === ACTION_COLUMN_ID;\n \n return (\n <React.Fragment key={`selected-${columnId}-${index}`}>\n <div\n draggable={!isAction}\n onDragStart={isAction ? undefined : (e) => handleColumnDragStart(e, actualIndex)}\n onDragEnd={isAction ? undefined : handleColumnDragEnd}\n onDragOver={isAction ? undefined : (e) => handleColumnDragOver(e, actualIndex)}\n onDragLeave={isAction ? undefined : handleColumnDragLeave}\n onDrop={isAction ? undefined : (e) => handleColumnDrop(e, actualIndex)}\n className={`flex items-center gap-2 px-3 py-2 rounded transition-all ${\n isAction ? 'cursor-default opacity-100' : 'cursor-move'\n } ${\n !isAction && isDragging ? 'opacity-50' : ''\n } ${\n !isAction && isDragOver && draggedColumnIndex !== null && draggedColumnIndex !== actualIndex\n ? 'ring-2 ring-green-2 ring-offset-1'\n : ''\n }`}\n >\n {/* Drag icon (hidden for action column) */}\n {!isAction && (\n <svg\n className=\"h-4 w-4 text-gray-600 flex-shrink-0\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 8h16M4 12h16M4 16h16\"\n />\n </svg>\n )}\n {/* Checkbox */}\n <button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n if (!isAction) {\n toggleColumnSelection(columnId);\n }\n }}\n className={`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${\n isAction\n ? 'bg-green-2 border-green-2 cursor-default'\n : pendingDeselection.has(columnId)\n ? 'bg-white border-gray-300'\n : 'bg-green-2 border-green-2'\n }`}\n >\n {!pendingDeselection.has(columnId) && (\n <svg\n className=\"h-3 w-3\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n strokeWidth={3}\n style={{ color: '#1E2125' }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M5 13l4 4L19 7\"\n />\n </svg>\n )}\n </button>\n {/* Label */}\n <span className=\"text-sm text-gray-900 flex-1\" style={{ fontFamily: 'var(--font-sans)' }}>\n {col.label}\n </span>\n </div>\n {index < visibleColumns.length - 1 && <Separator />}\n </React.Fragment>\n );\n })}\n \n {/* Render unselected columns */}\n {columns\n .filter(col => !visibleColumns.includes(getColumnId(col)))\n .map((col, index) => {\n const columnId = getColumnId(col);\n const isPending = pendingSelection.has(columnId);\n const unselectedIndex = columns.filter(c => !visibleColumns.includes(getColumnId(c))).indexOf(col);\n return (\n <React.Fragment key={`unselected-${columnId}`}>\n {visibleColumns.length > 0 && unselectedIndex === 0 && <Separator />}\n <label\n className=\"flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors\"\n onClick={(e) => {\n e.preventDefault();\n toggleColumnSelection(columnId);\n }}\n >\n <button\n type=\"button\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n toggleColumnSelection(columnId);\n }}\n className={`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${\n isPending ? 'bg-green-2 border-green-2' : 'bg-white border-gray-300'\n }`}\n >\n {isPending && (\n <svg\n className=\"h-3 w-3\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n strokeWidth={3}\n style={{ color: '#1E2125' }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M5 13l4 4L19 7\"\n />\n </svg>\n )}\n </button>\n {/* Label */}\n <span className=\"text-sm text-gray-900 flex-1\">{col.label}</span>\n </label>\n {unselectedIndex < columns.filter(c => !visibleColumns.includes(getColumnId(c))).length - 1 && <Separator />}\n </React.Fragment>\n );\n })}\n </div>\n ) : null;\n\n return (\n <div className=\"w-full\" style={{top:'130px', position: 'sticky', zIndex: 35, backgroundColor: \"var(--primary-foreground)\"}}>\n {/* Column Visibility Dropdown and Filters */}\n {columns.length > 0 && (\n <div \n className=\"pt-2 pb-1\"\n style={{\n position: \"sticky\",\n zIndex: 35,\n backgroundColor: \"var(--primary-foreground)\",\n }}\n >\n <div className=\"flex items-center gap-3 flex-wrap\">\n {/* Select Columns Dropdown */}\n <div className=\"flex-shrink-0\">\n {/* Dropdown Title */}\n <div className=\"mb-1 ml-1.5\">\n <p className=\"text-xs font-medium text-gray-600\" style={{ fontFamily: 'var(--font-sans)' }}>Select Columns</p>\n </div>\n <div\n ref={columnDropdownRef}\n className=\"inline-flex items-center justify-between gap-2 px-4 py-2.5 cursor-pointer transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]\"\n onClick={() => setIsColumnDropdownOpen(!isColumnDropdownOpen)}\n style={{ \n fontFamily: 'var(--font-sans)',\n backgroundColor: \"var(--primary-foreground)\",\n borderRadius: isColumnDropdownOpen ? '8px 8px 0 0' : '8px', // Rounded top corners when open, all corners when closed\n }}\n >\n <span>{displayText}</span>\n {/* <OpenCloseArrow isOpen={isColumnDropdownOpen} iconSize={16} /> */}\n {isColumnDropdownOpen ? <ChevronUp size={16} /> : <ChevronDown size={16} />}\n </div>\n {isColumnDropdownOpen && createPortal(columnDropdownMenu, document.body)}\n </div>\n\n {/* Vertical Line */}\n {filtersConfig && (\n <>\n <div className=\"h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0\"></div>\n <div className=\"flex-shrink-0 mt-[1.5rem]\">\n {/* Filters Component (Export, chips, Add Users, etc.) */}\n <DataTableFilters\n dateRangePicker={filtersConfig.dateRangePicker}\n onWeekToDate={filtersConfig.onWeekToDate}\n exportConfig={filtersConfig.exportConfig}\n filterChipsConfig={filtersConfig.filterChipsConfig}\n trailingActions={filtersConfig.trailingActions}\n />\n </div>\n </>\n )}\n </div>\n </div>\n )}\n {/* Only render table if we have columns */}\n {columns.length > 0 && orderedColumns.length > 0 ? (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <div className=\"rounded-t-[14px]\" style={{\n border: '1px solid rgba(52, 58, 64, 0.12)',\n borderBottom: '1px solid rgba(52, 58, 64, 0.12)',\n overflow: 'hidden',\n background: 'var(--primary-foreground)',\n position: 'relative',\n top:'0.5rem'\n }}>\n {/* Loading overlay */}\n {isLoading && (\n <div style={{\n position: 'absolute',\n inset: 0,\n background: 'rgba(255, 255, 255, 0.9)',\n backdropFilter: 'blur(2px)',\n zIndex: 20,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '14px'\n }}>\n <div style={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: '12px'\n }}>\n <p style={{\n fontSize: '13px',\n color: 'rgba(30, 33, 37, 0.6)',\n margin: 0\n }}>Loading...</p>\n <Image\n src=\"/BrandLoading.gif\"\n alt=\"Loading\"\n width={50}\n height={50}\n unoptimized\n className=\"mt-1\"\n />\n </div>\n </div>\n )}\n <div className=\"overflow-x-auto custom-thin-scrollbar-hidden\" ref={tableRef} style={{ maxHeight: '500px', overflowY: 'auto', position: 'relative', zIndex: 1 }}>\n <table style={{\n width: '100%',\n borderCollapse: 'collapse',\n fontSize: '13px',\n fontFamily: 'var(--font-sans)'\n }}>\n <thead>\n {/* Header row with column labels */}\n <tr>\n <SortableContext\n items={visibleColumns}\n strategy={horizontalListSortingStrategy}\n >\n {orderedColumns.map((column) => (\n <SortableHeader key={`header-${getColumnId(column)}`} column={column} isHeaderRow={true} />\n ))}\n </SortableContext>\n </tr>\n {/* Filter row - only show if there are filterable columns */}\n {hasFilterableColumns && (\n <tr>\n {orderedColumns.map((column) => {\n const columnId = getColumnId(column);\n const isFilterable = column.filterable === true;\n return (\n <th\n key={`filter-${columnId}`}\n style={{\n padding: '8px 14px',\n background: 'var(--primary-foreground)',\n borderBottom: '1px solid rgba(52, 58, 64, 0.10)',\n position: 'sticky',\n top: '41px',\n zIndex: 10,\n width: column.width || 'auto',\n fontFamily: 'var(--font-sans)',\n }}\n >\n {isFilterable ? (\n <div style={{ position: 'relative' }}>\n <input\n type=\"text\"\n placeholder=\"Filter...\"\n value={filters[columnId] || \"\"}\n onChange={(e) => {\n e.stopPropagation();\n handleFilterChange(columnId, e.target.value);\n }}\n onKeyDown={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.stopPropagation()}\n style={{\n width: '100%',\n padding: '4px 8px 4px 26px',\n fontSize: '11.5px',\n border: '1px solid rgba(52, 58, 64, 0.16)',\n borderRadius: '6px',\n background: 'var(--primary-foreground)',\n color: 'rgba(30, 33, 37, 0.78)',\n outline: 'none',\n fontFamily: 'var(--font-sans)',\n }}\n onFocus={(e) => {\n e.target.style.borderColor = 'rgba(231, 212, 162, 0.65)';\n e.target.style.background = 'var(--primary-foreground)';\n }}\n onBlur={(e) => {\n e.target.style.borderColor = 'rgba(52, 58, 64, 0.16)';\n e.target.style.background = 'var(--primary-foreground)';\n }}\n autoComplete=\"off\"\n />\n <Filter\n size={11}\n style={{\n position: 'absolute',\n left: '8px',\n top: '50%',\n transform: 'translateY(-50%)',\n color: 'rgba(30, 33, 37, 0.42)',\n pointerEvents: 'none'\n }}\n />\n </div>\n ) : (\n <div className=\"h-[34px]\"></div>\n )}\n </th>\n );\n })}\n </tr>\n )}\n </thead>\n <tbody>\n {!isLoading && paginatedData.length === 0 ? (\n <tr>\n <td\n colSpan={orderedColumns.length}\n style={{\n padding: '32px',\n textAlign: 'center',\n color: 'rgba(30, 33, 37, 0.42)',\n fontSize: '12px',\n fontFamily: 'var(--font-sans)',\n }}\n >\n No results found\n </td>\n </tr>\n ) : !isLoading && paginatedData.length > 0 ? (\n paginatedData.map((row, rowIndex) => (\n <tr\n key={rowIndex}\n data-row-id={row.id || rowIndex}\n style={{\n borderBottom: '1px solid rgba(52, 58, 64, 0.08)',\n cursor: onRowClick ? 'pointer' : 'default',\n transition: 'background 0.15s ease'\n }}\n onClick={onRowClick ? (e) => {\n e.stopPropagation();\n onRowClick(row, rowIndex);\n } : undefined}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = 'rgba(231, 212, 162, 0.12)';\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = 'transparent';\n }}\n >\n {orderedColumns.map((column) => {\n const columnId = getColumnId(column);\n const cellValue = row[columnId];\n const renderValue = column.render\n ? column.render(cellValue, row)\n : cellValue;\n\n // Only show tooltip for string values that might be truncated\n const hasWidthConstraint = column.width && column.width !== 'auto';\n const isStringValue = typeof renderValue === 'string' && renderValue.trim() !== '';\n const shouldUseTruncatedCell = hasWidthConstraint && isStringValue;\n\n const displayValue = shouldUseTruncatedCell ? (\n <TruncatedCell content={renderValue}>\n {renderValue}\n </TruncatedCell>\n ) : renderValue;\n\n return (\n <td\n key={columnId}\n style={{\n padding: '10px 14px',\n color: 'rgba(30, 33, 37, 0.78)',\n fontSize: '13px',\n borderRight: '1px solid rgba(52, 58, 64, 0.04)',\n width: column.width || 'auto',\n fontFamily: 'var(--font-sans)',\n ...(shouldUseTruncatedCell && { maxWidth: column.width || '200px', overflow: 'hidden' }),\n }}\n >\n {displayValue}\n </td>\n );\n })}\n </tr>\n ))\n ) : null}\n </tbody>\n </table>\n </div>\n </div>\n\n <DragOverlay>\n {activeColumn ? (\n <div className=\"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg\">\n <div className=\"flex items-center gap-2\">\n <GripVertical size={14} className=\"text-[var(--text-faint)]\" />\n <span className=\"text-sm font-semibold text-[var(--text-ink)]\">\n {activeColumn.label}\n </span>\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n ) : null}\n\n {(isServerSidePagination ? totalCount > 0 : sortedData.length > 0) && (\n <div className=\"border-t border-gray-200 rounded-b-[14px]\" style={{ backgroundColor: \"var(--primary-foreground)\" }}>\n <Pagination\n page={page}\n pageSizeOptions={[5,10, 20, 50, 100]}\n pageSize={pageSize}\n totalCount={isServerSidePagination ? totalCount : sortedData.length}\n currentDataLength={paginatedData.length}\n onPageChange={setPage}\n onPageSizeChange={onPageSizeChange ? (newSize) => {\n setPageSize(newSize);\n setPage(1);\n } : (newSize) => {\n setPageSize(newSize);\n setPage(1);\n }}\n showPageSizeSelector={true}\n />\n </div>\n )}\n </div>\n );\n}\n\n","\"use client\";\n\n/**\n * SummaryStatsPanel component\n * Displays key interaction metrics in a compact grid layout.\n * Designed for right or left rails with 2-column default.\n * Optional left accent bar draws attention to specific metrics without judgment.\n */\n\nexport default function SummaryStatsPanel({\n title = 'Summary stats',\n stats = [],\n columns = 2\n}) {\n return (\n <div style={{ fontFamily: 'system-ui, -apple-system, sans-serif' }}>\n {/* Header */}\n <div\n className=\"text-[11px] tracking-[0.14em] uppercase mb-[10px]\"\n style={{ color: 'rgba(30, 33, 37, 0.42)', fontWeight: 650 }}\n >\n {title}\n </div>\n\n {/* Grid */}\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,\n gap: '10px'\n }}\n >\n {stats.map((stat, i) => (\n <div\n key={i}\n style={{\n position: 'relative',\n border: '1px solid rgba(52, 58, 64, 0.12)',\n borderRadius: '12px',\n background: 'rgba(255, 255, 255, 0.72)',\n padding: stat.accentColor ? '10px 10px 10px 14px' : '10px',\n minHeight: '62px',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n gap: '5px',\n overflow: 'hidden'\n }}\n >\n {/* Optional accent indicator */}\n {stat.accentColor && (\n <div\n style={{\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n width: '4px',\n background: stat.accentColor,\n borderTopLeftRadius: '12px',\n borderBottomLeftRadius: '12px'\n }}\n />\n )}\n\n {/* Label */}\n <div\n className=\"text-[10px] tracking-[0.14em] uppercase\"\n style={{\n color: 'rgba(30, 33, 37, 0.42)',\n fontWeight: 650,\n lineHeight: 1.1,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n }}\n >\n {stat.label}\n </div>\n\n {/* Value */}\n <div\n style={{\n fontSize: '13px',\n color: stat.valueStyle === 'muted' \n ? 'rgba(30, 33, 37, 0.56)' \n : 'rgba(30, 33, 37, 0.78)',\n fontWeight: 700,\n lineHeight: 1.15,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n fontFamily: stat.valueStyle === 'mono' \n ? 'ui-monospace, monospace' \n : 'inherit'\n }}\n >\n {stat.value}\n </div>\n\n {/* Subtext */}\n {stat.subtext && (\n <div\n style={{\n fontSize: '11px',\n color: 'rgba(30, 33, 37, 0.52)',\n lineHeight: 1.15,\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n }}\n >\n {stat.subtext}\n </div>\n )}\n </div>\n ))}\n </div>\n </div>\n );\n}\n\n"],"names":["DataTableFilters","dateRangePicker","onWeekToDate","exportConfig","filterChipsConfig","trailingActions","showExportMenu","setShowExportMenu","useState","exportButtonRef","useRef","exportMenuRef","useEffect","handleClickOutside","event","openExportMenu","prev","handleExport","type","shouldShowChips","filters","customFilters","hasRegularFilters","key","value","hasCustomFilters","filterObj","jsxs","jsx","CalendarClock","Suspense","Download","ChevronDown","Fragment","CustomFilterChips","Separator","useUserContext","Image","props","HoverBalloon","children","DataTable","data","columns","initialPageSize","onRowClick","totalCount","controlledPage","controlledPageSize","onPageChange","onPageSizeChange","onFilterChange","onMaxColumnsError","onSort","sortFields","tableId","isLoading","filtersConfig","userData","userId","TruncatedCell","React","content","className","textRef","isTruncated","setIsTruncated","checkTruncation","isOverflowing","timeoutId","textElement","isServerSidePagination","isServerSideFiltering","isServerSideSorting","internalPage","setInternalPage","internalPageSize","setInternalPageSize","page","pageSize","setPage","newPage","setPageSize","newSize","MAX_COLUMNS","ACTION_COLUMN_ID","userHasManuallyChangedColumns","storageKey","useMemo","col","manualChangeFlagKey","useCallback","cols","saved","validColumns","colId","error","setFilters","internalSortField","setInternalSortField","internalSortDirection","setInternalSortDirection","sortFieldFromProps","columnId","sortField","sortDirection","columnOrder","setColumnOrder","enforceActionPosition","result","tableHasActionColumn","id","visibleColumns","setVisibleColumns","savedColumns","initial","isColumnDropdownOpen","setIsColumnDropdownOpen","columnDropdownPosition","setColumnDropdownPosition","pendingSelection","setPendingSelection","pendingDeselection","setPendingDeselection","draggedColumnIndex","setDraggedColumnIndex","dragOverColumnIndex","setDragOverColumnIndex","columnDropdownRef","columnDropdownMenuRef","toastTimeoutRef","activeId","setActiveId","tableRef","getColumnId","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","handleDragEnd","active","over","oldIndex","newIndex","reordered","arrayMove","saveColumnsToStorage","items","handleDragStart","filteredData","row","filterValue","cellValue","cellValueStr","k","keyword","sortedData","a","b","aVal","bVal","aStr","bStr","paginatedData","startIndex","endIndex","handleSort","field","handleFilterChange","newFilters","showMaxColumnsError","message","toggleColumnSelection","prevSet","current","updated","constrained","next","handleColumnDragStart","index","handleColumnDragEnd","handleColumnDragOver","handleColumnDragLeave","handleColumnDrop","dropIndex","visibleOrder","newColumns","hiddenColumns","columnIds","orderedColumns","hasFilterableColumns","updatePosition","rect","displayText","_a","SortableHeader","column","isHeaderRow","isActionColumn","attributes","listeners","setNodeRef","transform","transition","isDragging","useSortable","style","CSS","isSorted","isAsc","isFilterable","GripVertical","ChevronUp","Filter","e","activeColumn","columnDropdownMenu","c","actualIndex","isDragOver","isAction","isPending","unselectedIndex","createPortal","DndContext","closestCenter","SortableContext","horizontalListSortingStrategy","rowIndex","renderValue","hasWidthConstraint","isStringValue","shouldUseTruncatedCell","displayValue","DragOverlay","Pagination","SummaryStatsPanel","title","stats","stat","i"],"mappings":"wOAwBA,SAAwBA,GAAiB,CACvC,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,gBAAAC,CACF,EAAG,CACD,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,EAAAA,SAAS,EAAK,EACpDC,EAAkBC,EAAAA,OAAO,IAAI,EAC7BC,EAAgBD,EAAAA,OAAO,IAAI,EAGjCE,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAsBC,GAAU,CAElCH,EAAc,SACd,CAACA,EAAc,QAAQ,SAASG,EAAM,MAAM,GAC5CL,EAAgB,SAChB,CAACA,EAAgB,QAAQ,SAASK,EAAM,MAAM,GAE9CP,EAAkB,EAAK,CAE3B,EAEA,GAAID,EACF,gBAAS,iBAAiB,YAAaO,CAAkB,EAClD,IAAM,CACX,SAAS,oBAAoB,YAAaA,CAAkB,CAC9D,CAEJ,EAAG,CAACP,CAAc,CAAC,EAEnB,MAAMS,EAAiB,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