@optifye/dashboard-core 6.0.5 → 6.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import { noop, warning, invariant, progress, secondsToMilliseconds, milliseconds
12
12
  import { getValueTransition, hover, press, isPrimaryPointer, GroupPlaybackControls, setDragLock, supportsLinearEasing, attachTimeline, isGenerator, calcGeneratorDuration, isWaapiSupportedEasing, mapEasingToNativeEasing, maxGeneratorDuration, generateLinearEasing, isBezierDefinition } from 'motion-dom';
13
13
  import { BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, Tooltip, Legend, Bar, LabelList, ResponsiveContainer, LineChart as LineChart$1, Line, PieChart, Pie, Cell, ReferenceLine, ComposedChart, Area, ScatterChart, Scatter } from 'recharts';
14
14
  import { Slot } from '@radix-ui/react-slot';
15
- import { Camera, ChevronDown, ChevronUp, Check, ShieldCheck, Star, Award, X, Coffee, Plus, Clock, Minus, ArrowDown, ArrowUp, Search, CheckCircle, AlertTriangle, Info, Share2, Download, User, XCircle, ChevronLeft, ChevronRight, AlertCircle, Sun, Moon, MessageSquare, Trash2, ArrowLeft, RefreshCw, Menu, Send, Copy, Edit2, UserCheck, Save, LogOut, Calendar, Package, Settings, LifeBuoy, Loader2, ArrowLeftIcon as ArrowLeftIcon$1, Settings2, CheckCircle2, EyeOff, Eye, Zap, UserCircle } from 'lucide-react';
15
+ import { Camera, ChevronDown, ChevronUp, Check, ShieldCheck, Star, Award, X, Coffee, Plus, Clock, Minus, ArrowDown, ArrowUp, Search, CheckCircle, AlertTriangle, Info, Share2, Download, User, XCircle, ChevronLeft, ChevronRight, AlertCircle, Sun, Moon, MessageSquare, Trash2, ArrowLeft, RefreshCw, Menu, Send, Copy, Edit2, UserCheck, Save, LogOut, Calendar, Package, Settings, LifeBuoy, ArrowLeftIcon as ArrowLeftIcon$1, Settings2, CheckCircle2, EyeOff, Eye, Zap, UserCircle } from 'lucide-react';
16
16
  import { DayPicker, useNavigation as useNavigation$1 } from 'react-day-picker';
17
17
  import html2canvas from 'html2canvas';
18
18
  import jsPDF, { jsPDF as jsPDF$1 } from 'jspdf';
@@ -349,24 +349,6 @@ function createMemoizedFunction(fn, getCacheKey) {
349
349
  return result;
350
350
  };
351
351
  }
352
- var memoizedEfficiencyFilter = createMemoizedFunction(
353
- (data, minEfficiency, maxEfficiency) => {
354
- return data.filter((item) => {
355
- const eff = item.efficiency ?? 0;
356
- return eff >= minEfficiency && (maxEfficiency === void 0 || eff < maxEfficiency);
357
- });
358
- },
359
- (data, min, max = void 0) => `${data.length}-${min}-${max}`
360
- );
361
- var memoizedAverageEfficiency = createMemoizedFunction(
362
- (data, minThreshold = 10) => {
363
- const validItems = data.filter((item) => (item.efficiency ?? 0) >= minThreshold);
364
- if (validItems.length === 0) return 0;
365
- const sum = validItems.reduce((acc, item) => acc + (item.efficiency ?? 0), 0);
366
- return sum / validItems.length;
367
- },
368
- (data, threshold) => `${data.length}-${threshold}`
369
- );
370
352
  var memoizedOutputArrayAggregation = createMemoizedFunction(
371
353
  (arrays) => {
372
354
  if (arrays.length === 0) return [];
@@ -577,7 +559,7 @@ var dashboardService = {
577
559
  const lineMetricsTable = getTable2(dbConfig, "lineMetrics");
578
560
  const companyId = entityConfig.companyId;
579
561
  const metricsTablePrefixStr = getMetricsTablePrefix();
580
- const metricsTable = `${metricsTablePrefixStr}_${companyId ? companyId.replace(/-/g, "_") : "unknown_company"}`;
562
+ `${metricsTablePrefixStr}_${companyId ? companyId.replace(/-/g, "_") : "unknown_company"}`;
581
563
  const configuredLineIds = getConfiguredLineIds(entityConfig);
582
564
  const defaultLineId = configuredLineIds[0];
583
565
  const factoryViewId = entityConfig.factoryViewId ?? "factory";
@@ -588,7 +570,7 @@ var dashboardService = {
588
570
  if (!isValidFactoryViewConfiguration(entityConfig) || !companyId) {
589
571
  throw new Error("Factory View requires at least one configured line and companyId to be configured.");
590
572
  }
591
- const [lineResult, metricsResult, performanceResult] = await Promise.all([
573
+ const [lineResult, metricsResult] = await Promise.all([
592
574
  // Get Line 1's info for general factory details
593
575
  supabase.from(linesTable).select(`
594
576
  id,
@@ -599,28 +581,29 @@ var dashboardService = {
599
581
  companies!lines_company_id_fkey(company_name:name)
600
582
  `).eq("id", defaultLineId).maybeSingle(),
601
583
  // Get metrics from line_metrics table for all configured lines
602
- supabase.from(lineMetricsTable).select("*").in("line_id", configuredLineIds).eq("shift_id", shiftId).eq("date", date),
603
- // Get performance data from the dynamic metrics table for all configured lines
604
- supabase.from(metricsTable).select("efficiency").in("line_id", configuredLineIds).eq("shift_id", shiftId).eq("date", date)
584
+ supabase.from(lineMetricsTable).select("*").in("line_id", configuredLineIds).eq("shift_id", shiftId).eq("date", date)
605
585
  ]);
606
586
  if (lineResult.error) throw lineResult.error;
607
587
  if (!lineResult.data) throw new Error(`Configured default line (${defaultLineId}) not found`);
608
588
  if (metricsResult.error) throw metricsResult.error;
609
- if (performanceResult.error) throw performanceResult.error;
610
589
  const lineData2 = lineResult.data;
611
590
  const metricsData = metricsResult.data;
612
- const performanceData2 = performanceResult.data;
613
- const underperformingWorkspaces2 = memoizedEfficiencyFilter(performanceData2 || [], 10, 70);
614
- const validWorkspaces2 = memoizedEfficiencyFilter(performanceData2 || [], 10);
615
- const underperformingCount2 = underperformingWorkspaces2.length;
616
- validWorkspaces2.length;
617
591
  const combinedMetrics = (metricsData || []).reduce((acc, m) => {
618
- acc.avg_efficiency += m.efficiency ?? 0;
619
592
  acc.current_output += m.current_output ?? 0;
620
593
  acc.ideal_output += m.ideal_output ?? m.line_threshold ?? 0;
594
+ acc.total_workspaces += m.total_workspaces ?? 0;
595
+ acc.underperforming_workspaces += m.underperforming_workspaces ?? 0;
596
+ acc.weightedEfficiencySum += (m.avg_efficiency ?? 0) * (m.total_workspaces ?? 0);
621
597
  return acc;
622
- }, { avg_efficiency: 0, current_output: 0, ideal_output: 0 });
598
+ }, {
599
+ current_output: 0,
600
+ ideal_output: 0,
601
+ total_workspaces: 0,
602
+ underperforming_workspaces: 0,
603
+ weightedEfficiencySum: 0
604
+ });
623
605
  metricsData?.length || 1;
606
+ const avgEfficiency = combinedMetrics.total_workspaces > 0 ? combinedMetrics.weightedEfficiencySum / combinedMetrics.total_workspaces : 0;
624
607
  return {
625
608
  line_id: factoryViewId,
626
609
  // Use configured factory view ID
@@ -633,15 +616,13 @@ var dashboardService = {
633
616
  shift_id: shiftId,
634
617
  date,
635
618
  metrics: {
636
- avg_efficiency: memoizedAverageEfficiency(performanceData2 || [], 10),
637
- // Use memoized calculation for efficiency
619
+ avg_efficiency: avgEfficiency,
638
620
  avg_cycle_time: 0,
639
621
  // Needs calculation logic if required for factory view
640
622
  current_output: combinedMetrics.current_output,
641
623
  ideal_output: combinedMetrics.ideal_output,
642
- total_workspaces: 0,
643
- // SRC ALIGNMENT: Use hardcoded 44 for factory view total_workspaces
644
- underperforming_workspaces: underperformingCount2,
624
+ total_workspaces: combinedMetrics.total_workspaces || 0,
625
+ underperforming_workspaces: combinedMetrics.underperforming_workspaces,
645
626
  underperforming_workspace_names: [],
646
627
  // Populate if needed
647
628
  underperforming_workspace_uuids: [],
@@ -675,13 +656,6 @@ var dashboardService = {
675
656
  } catch (err) {
676
657
  console.error(`Error fetching line metrics for ${lineId}:`, err);
677
658
  }
678
- const { data: performanceData, error: performanceError } = await supabase.from(metricsTable).select("efficiency").eq("line_id", lineId).eq("shift_id", shiftId).eq("date", date);
679
- if (performanceError) throw performanceError;
680
- const underperformingWorkspaces = memoizedEfficiencyFilter(performanceData || [], 10, 70);
681
- const validWorkspaces = memoizedEfficiencyFilter(performanceData || [], 10);
682
- const underperformingCount = underperformingWorkspaces.length;
683
- validWorkspaces.length;
684
- const avgEfficiencyFromPerf = memoizedAverageEfficiency(performanceData || [], 10);
685
659
  const useFallbackMetrics = !metricsFromDb;
686
660
  let metricsForReturn;
687
661
  if (useFallbackMetrics) {
@@ -691,7 +665,7 @@ var dashboardService = {
691
665
  current_output: 0,
692
666
  ideal_output: 0,
693
667
  total_workspaces: 42,
694
- underperforming_workspaces: underperformingCount,
668
+ underperforming_workspaces: 0,
695
669
  underperforming_workspace_names: [],
696
670
  underperforming_workspace_uuids: [],
697
671
  output_array: [],
@@ -704,12 +678,12 @@ var dashboardService = {
704
678
  };
705
679
  } else {
706
680
  metricsForReturn = {
707
- avg_efficiency: metricsFromDb.efficiency ?? avgEfficiencyFromPerf,
681
+ avg_efficiency: metricsFromDb.avg_efficiency ?? 0,
708
682
  avg_cycle_time: metricsFromDb.avg_cycle_time || 0,
709
683
  current_output: metricsFromDb.current_output || 0,
710
684
  ideal_output: metricsFromDb.ideal_output || metricsFromDb.line_threshold || 0,
711
685
  total_workspaces: metricsFromDb.total_workspaces ?? workspaceConfig.totalWorkspaces ?? 42,
712
- underperforming_workspaces: underperformingCount,
686
+ underperforming_workspaces: metricsFromDb.underperforming_workspaces ?? 0,
713
687
  underperforming_workspace_names: metricsFromDb.underperforming_workspace_names || [],
714
688
  underperforming_workspace_uuids: metricsFromDb.underperforming_workspace_uuids || [],
715
689
  output_array: metricsFromDb.output_array || [],
@@ -720,9 +694,6 @@ var dashboardService = {
720
694
  last_updated: metricsFromDb.last_updated || (/* @__PURE__ */ new Date()).toISOString(),
721
695
  poorest_performing_workspaces: metricsFromDb.poorest_performing_workspaces || []
722
696
  };
723
- if (metricsFromDb.efficiency === null || metricsFromDb.efficiency === void 0) {
724
- metricsForReturn.avg_efficiency = avgEfficiencyFromPerf;
725
- }
726
697
  }
727
698
  return {
728
699
  line_id: lineData.id,
@@ -985,7 +956,7 @@ var dashboardService = {
985
956
  const lineMetricsTable = getTable2(dbConfig, "lineMetrics");
986
957
  const companyId = entityConfig.companyId;
987
958
  const metricsTablePrefixStr = getMetricsTablePrefix();
988
- const metricsTable = `${metricsTablePrefixStr}_${companyId ? companyId.replace(/-/g, "_") : "unknown_company"}`;
959
+ `${metricsTablePrefixStr}_${companyId ? companyId.replace(/-/g, "_") : "unknown_company"}`;
989
960
  const configuredLineIds = getConfiguredLineIds(entityConfig);
990
961
  const defaultLineId = configuredLineIds[0];
991
962
  const factoryViewId = entityConfig.factoryViewId ?? "factory";
@@ -1000,25 +971,17 @@ var dashboardService = {
1000
971
  throw new Error("Factory View requires at least one configured line and companyId to be configured.");
1001
972
  }
1002
973
  const lineIdsToQuery = configuredLineIds;
1003
- const [line1Result, metricsResult2, performanceResult2] = await Promise.all([
974
+ const [line1Result, metricsResult2] = await Promise.all([
1004
975
  supabase.from(linesTable).select("id, line_name, factory_id, factories!lines_factory_id_fkey(factory_name), company_id, companies!lines_company_id_fkey(company_name:name)").eq("id", defaultLineId).single(),
1005
- supabase.from(lineMetricsTable).select("*").in("line_id", lineIdsToQuery).eq("shift_id", queryShiftId).eq("date", queryDate),
1006
- supabase.from(metricsTable).select("efficiency").in("line_id", lineIdsToQuery).eq("shift_id", queryShiftId).eq("date", queryDate)
976
+ supabase.from(lineMetricsTable).select("*").in("line_id", lineIdsToQuery).eq("shift_id", queryShiftId).eq("date", queryDate)
1007
977
  ]);
1008
978
  if (line1Result.error) throw line1Result.error;
1009
979
  if (!line1Result.data) {
1010
980
  throw new Error(`Default line ${defaultLineId} for Factory View not found.`);
1011
981
  }
1012
982
  if (metricsResult2.error) throw metricsResult2.error;
1013
- if (performanceResult2.error) throw performanceResult2.error;
1014
983
  const line1Data = line1Result.data;
1015
984
  const metricsData = metricsResult2.data;
1016
- const performanceData2 = performanceResult2.data;
1017
- const underperformingWorkspaces2 = memoizedEfficiencyFilter(performanceData2 || [], 10, 70);
1018
- const validWorkspaces2 = memoizedEfficiencyFilter(performanceData2 || [], 10);
1019
- const underperformingCount2 = underperformingWorkspaces2.length;
1020
- const totalValidWorkspaces2 = validWorkspaces2.length;
1021
- const avgEfficiencyFromPerf2 = memoizedAverageEfficiency(performanceData2 || [], 10);
1022
985
  const initialAccumulator = {
1023
986
  avg_cycle_time: 0,
1024
987
  current_output: 0,
@@ -1026,6 +989,10 @@ var dashboardService = {
1026
989
  line_threshold: 0,
1027
990
  threshold_pph: 0,
1028
991
  total_workspaces: 0,
992
+ underperforming_workspaces: 0,
993
+ weightedEfficiencySum: 0,
994
+ underperforming_workspace_names: [],
995
+ underperforming_workspace_uuids: [],
1029
996
  output_array: [],
1030
997
  outputArrays: []
1031
998
  };
@@ -1036,13 +1003,21 @@ var dashboardService = {
1036
1003
  acc.line_threshold += m.line_threshold ?? 0;
1037
1004
  acc.threshold_pph += m.threshold_pph ?? 0;
1038
1005
  acc.total_workspaces += m.total_workspaces ?? 0;
1006
+ acc.underperforming_workspaces += m.underperforming_workspaces ?? 0;
1007
+ acc.weightedEfficiencySum += (m.avg_efficiency ?? 0) * (m.total_workspaces ?? 0);
1008
+ if (m.underperforming_workspace_names) {
1009
+ acc.underperforming_workspace_names.push(...m.underperforming_workspace_names);
1010
+ }
1011
+ if (m.underperforming_workspace_uuids) {
1012
+ acc.underperforming_workspace_uuids.push(...m.underperforming_workspace_uuids);
1013
+ }
1039
1014
  if (m.output_array && m.output_array.length > 0) {
1040
1015
  acc.outputArrays.push(m.output_array);
1041
1016
  }
1042
1017
  return acc;
1043
1018
  }, initialAccumulator);
1044
1019
  const numLines = Math.max(metricsData?.length || 0, 1);
1045
- const avgEfficiencyFromLineMetrics = (metricsData?.reduce((sum, m) => sum + (m.avg_efficiency || 0), 0) || 0) / numLines;
1020
+ const avgEfficiency = combinedMetricsData.total_workspaces > 0 ? combinedMetricsData.weightedEfficiencySum / combinedMetricsData.total_workspaces : 0;
1046
1021
  return {
1047
1022
  line_id: factoryViewId,
1048
1023
  line_name: "Factory View",
@@ -1053,22 +1028,20 @@ var dashboardService = {
1053
1028
  date: queryDate,
1054
1029
  shift_id: queryShiftId,
1055
1030
  metrics: {
1056
- avg_efficiency: avgEfficiencyFromPerf2 > 0 ? avgEfficiencyFromPerf2 : avgEfficiencyFromLineMetrics,
1057
- // Use performance data first, fallback to line metrics
1031
+ avg_efficiency: avgEfficiency,
1058
1032
  avg_cycle_time: combinedMetricsData.avg_cycle_time / numLines,
1059
1033
  current_output: combinedMetricsData.current_output,
1060
1034
  ideal_output: combinedMetricsData.ideal_output,
1061
1035
  total_workspaces: combinedMetricsData.total_workspaces || 0,
1062
- // Use combined or default
1063
- underperforming_workspaces: underperformingCount2,
1036
+ underperforming_workspaces: combinedMetricsData.underperforming_workspaces,
1064
1037
  line_threshold: combinedMetricsData.line_threshold,
1065
1038
  threshold_pph: combinedMetricsData.threshold_pph / numLines,
1066
1039
  shift_start: metricsData?.[0]?.shift_start || shiftConfig.dayShift?.startTime || "06:00",
1067
1040
  shift_end: metricsData?.[0]?.shift_end || shiftConfig.dayShift?.endTime || "18:00",
1068
1041
  last_updated: (/* @__PURE__ */ new Date()).toISOString(),
1069
1042
  output_array: combinedMetricsData.outputArrays.length > 0 ? memoizedOutputArrayAggregation(combinedMetricsData.outputArrays) : [],
1070
- underperforming_workspace_names: [],
1071
- underperforming_workspace_uuids: [],
1043
+ underperforming_workspace_names: combinedMetricsData.underperforming_workspace_names,
1044
+ underperforming_workspace_uuids: combinedMetricsData.underperforming_workspace_uuids,
1072
1045
  poorest_performing_workspaces: []
1073
1046
  }
1074
1047
  };
@@ -1076,25 +1049,17 @@ var dashboardService = {
1076
1049
  if (!companyId) {
1077
1050
  throw new Error("Company ID must be configured for detailed line requests.");
1078
1051
  }
1079
- const [lineResult, metricsResult, performanceResult] = await Promise.all([
1052
+ const [lineResult, metricsResult] = await Promise.all([
1080
1053
  supabase.from(linesTable).select("id, line_name, factory_id, factories!lines_factory_id_fkey(factory_name), company_id, companies!lines_company_id_fkey(company_name:name)").eq("id", lineIdToQuery).single(),
1081
- supabase.from(lineMetricsTable).select("*").eq("line_id", lineIdToQuery).eq("shift_id", queryShiftId).eq("date", queryDate).maybeSingle(),
1082
- supabase.from(metricsTable).select("efficiency").eq("line_id", lineIdToQuery).eq("shift_id", queryShiftId).eq("date", queryDate)
1054
+ supabase.from(lineMetricsTable).select("*").eq("line_id", lineIdToQuery).eq("shift_id", queryShiftId).eq("date", queryDate).maybeSingle()
1083
1055
  ]);
1084
1056
  if (lineResult.error) throw lineResult.error;
1085
1057
  if (!lineResult.data) {
1086
1058
  throw new Error(`Line ${lineIdToQuery} not found.`);
1087
1059
  }
1088
1060
  if (metricsResult.error) throw metricsResult.error;
1089
- if (performanceResult.error) throw performanceResult.error;
1090
1061
  const lineData = lineResult.data;
1091
1062
  const metrics2 = metricsResult.data;
1092
- const performanceData = performanceResult.data;
1093
- const underperformingWorkspaces = memoizedEfficiencyFilter(performanceData || [], 10, 70);
1094
- const validWorkspaces = memoizedEfficiencyFilter(performanceData || [], 10);
1095
- const underperformingCount = underperformingWorkspaces.length;
1096
- const totalValidWorkspaces = validWorkspaces.length;
1097
- const avgEfficiencyFromPerf = memoizedAverageEfficiency(performanceData || [], 10);
1098
1063
  return {
1099
1064
  line_id: lineData.id,
1100
1065
  line_name: lineData.line_name,
@@ -1105,13 +1070,12 @@ var dashboardService = {
1105
1070
  date: queryDate,
1106
1071
  shift_id: queryShiftId,
1107
1072
  metrics: {
1108
- avg_efficiency: avgEfficiencyFromPerf > 0 ? avgEfficiencyFromPerf : metrics2?.avg_efficiency ?? 0,
1109
- // Use performance data first, fallback to line metrics
1073
+ avg_efficiency: metrics2?.avg_efficiency ?? 0,
1110
1074
  avg_cycle_time: metrics2?.avg_cycle_time || 0,
1111
1075
  current_output: metrics2?.current_output || 0,
1112
1076
  ideal_output: metrics2?.ideal_output || metrics2?.line_threshold || 0,
1113
1077
  total_workspaces: metrics2?.total_workspaces ?? workspaceConfig.totalWorkspaces ?? 42,
1114
- underperforming_workspaces: underperformingCount,
1078
+ underperforming_workspaces: metrics2?.underperforming_workspaces ?? 0,
1115
1079
  line_threshold: metrics2?.line_threshold || 0,
1116
1080
  threshold_pph: metrics2?.threshold_pph || 0,
1117
1081
  shift_start: metrics2?.shift_start || shiftConfig.dayShift?.startTime || "06:00",
@@ -1996,14 +1960,17 @@ var authOTPService = {
1996
1960
  const { error } = await supabase.auth.signInWithOtp({
1997
1961
  email,
1998
1962
  options: {
1999
- shouldCreateUser: true,
2000
- // Creates user if doesn't exist
1963
+ shouldCreateUser: false,
1964
+ // Only allow existing users to log in
2001
1965
  emailRedirectTo: void 0
2002
1966
  // Disable magic link redirect
2003
1967
  }
2004
1968
  });
2005
1969
  if (error) {
2006
1970
  console.error("Error sending OTP:", error);
1971
+ if (error.message.toLowerCase().includes("signups not allowed") || error.message.toLowerCase().includes("signup") || error.message.toLowerCase().includes("not allowed")) {
1972
+ error.message = "You don't have an account with us. Please contact the Optifye team for more details.";
1973
+ }
2007
1974
  }
2008
1975
  return { error };
2009
1976
  },
@@ -2078,7 +2045,7 @@ var authRateLimitService = {
2078
2045
  };
2079
2046
  var isMixpanelInitialized = false;
2080
2047
  var currentUserProperties;
2081
- var initializeCoreMixpanel = (token, debug, trackPageView) => {
2048
+ var initializeCoreMixpanel = (token, debugOrOptions, trackPageViewArg) => {
2082
2049
  if (!token) {
2083
2050
  console.warn("Mixpanel token not provided for initialization. Mixpanel will not be enabled.");
2084
2051
  return;
@@ -2087,15 +2054,51 @@ var initializeCoreMixpanel = (token, debug, trackPageView) => {
2087
2054
  console.warn("Mixpanel already initialized. Ignoring subsequent initialization.");
2088
2055
  return;
2089
2056
  }
2090
- mixpanel.init(token, {
2057
+ let debug;
2058
+ let trackPageView;
2059
+ let sessionOpts = {};
2060
+ if (typeof debugOrOptions === "boolean" || debugOrOptions === void 0) {
2061
+ debug = debugOrOptions;
2062
+ trackPageView = trackPageViewArg;
2063
+ } else {
2064
+ const opts = debugOrOptions;
2065
+ ({ debug, trackPageView, ...sessionOpts } = opts);
2066
+ }
2067
+ const initOptions = {
2091
2068
  debug: debug ?? process.env.NODE_ENV === "development",
2092
- // Keep env var as fallback if not explicitly passed
2093
2069
  track_pageview: trackPageView ?? true,
2094
- // Default to true if not specified in config
2095
2070
  persistence: "localStorage"
2071
+ };
2072
+ if (sessionOpts.recordSessionsPercent !== void 0) {
2073
+ initOptions.record_sessions_percent = sessionOpts.recordSessionsPercent;
2074
+ } else {
2075
+ initOptions.record_sessions_percent = 1;
2076
+ }
2077
+ if (sessionOpts.recordIdleTimeoutMs !== void 0) {
2078
+ initOptions.record_idle_timeout_ms = sessionOpts.recordIdleTimeoutMs;
2079
+ }
2080
+ if (sessionOpts.recordHeatmapData !== void 0) {
2081
+ initOptions.record_heatmap_data = sessionOpts.recordHeatmapData;
2082
+ } else {
2083
+ initOptions.record_heatmap_data = true;
2084
+ }
2085
+ if (sessionOpts.recordCanvas !== void 0) {
2086
+ initOptions.record_canvas = sessionOpts.recordCanvas;
2087
+ }
2088
+ if (sessionOpts.recordBlockSelector !== void 0) {
2089
+ initOptions.record_block_selector = sessionOpts.recordBlockSelector;
2090
+ }
2091
+ if (sessionOpts.recordMaskTextSelector !== void 0) {
2092
+ initOptions.record_mask_text_selector = sessionOpts.recordMaskTextSelector;
2093
+ }
2094
+ Object.keys(sessionOpts).forEach((key) => {
2095
+ if (!(key in initOptions)) {
2096
+ initOptions[key] = sessionOpts[key];
2097
+ }
2096
2098
  });
2099
+ mixpanel.init(token, initOptions);
2097
2100
  isMixpanelInitialized = true;
2098
- console.log("Mixpanel initialized in dashboard-core.");
2101
+ console.log("Mixpanel initialized in dashboard-core with Session Replay support.");
2099
2102
  };
2100
2103
  var trackCorePageView = (pageName, properties) => {
2101
2104
  if (!isMixpanelInitialized) return;
@@ -2111,6 +2114,46 @@ var trackCoreEvent = (eventName, properties) => {
2111
2114
  };
2112
2115
  mixpanel.track(eventName, mergedProps);
2113
2116
  };
2117
+ var startCoreSessionRecording = () => {
2118
+ try {
2119
+ if (!isMixpanelInitialized) return;
2120
+ if (typeof mixpanel.start_session_recording === "function") {
2121
+ mixpanel.start_session_recording();
2122
+ }
2123
+ } catch (err) {
2124
+ console.error("[Mixpanel] Unable to start session recording:", err);
2125
+ }
2126
+ };
2127
+ var stopCoreSessionRecording = () => {
2128
+ try {
2129
+ if (!isMixpanelInitialized) return;
2130
+ if (typeof mixpanel.stop_session_recording === "function") {
2131
+ mixpanel.stop_session_recording();
2132
+ }
2133
+ } catch (err) {
2134
+ console.error("[Mixpanel] Unable to stop session recording:", err);
2135
+ }
2136
+ };
2137
+ var getCoreSessionRecordingProperties = () => {
2138
+ try {
2139
+ if (!isMixpanelInitialized) return {};
2140
+ if (typeof mixpanel.get_session_recording_properties === "function") {
2141
+ return mixpanel.get_session_recording_properties() || {};
2142
+ }
2143
+ } catch {
2144
+ }
2145
+ return {};
2146
+ };
2147
+ var getCoreSessionReplayUrl = () => {
2148
+ try {
2149
+ if (!isMixpanelInitialized) return null;
2150
+ if (typeof mixpanel.get_session_replay_url === "function") {
2151
+ return mixpanel.get_session_replay_url();
2152
+ }
2153
+ } catch {
2154
+ }
2155
+ return null;
2156
+ };
2114
2157
  var identifyCoreUser = (userId, userProperties) => {
2115
2158
  if (!isMixpanelInitialized) return;
2116
2159
  mixpanel.identify(userId);
@@ -2162,8 +2205,9 @@ var SSEChatClient = class {
2162
2205
  thread_id: threadId,
2163
2206
  user_id: userId,
2164
2207
  company_id: context.companyId,
2165
- line_id: context.lineId,
2166
- shift_id: context.shiftId
2208
+ shift_id: context.shiftId,
2209
+ // Send all_lines if available, otherwise fall back to single line_id
2210
+ ...context.allLines && context.allLines.length > 0 ? { all_lines: context.allLines } : { line_id: context.lineId }
2167
2211
  }),
2168
2212
  signal: controller.signal,
2169
2213
  // Don't include credentials since the API returns Access-Control-Allow-Origin: *
@@ -16665,25 +16709,40 @@ var createMotionComponent = /* @__PURE__ */ createMotionComponentFactory({
16665
16709
 
16666
16710
  // ../../node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs
16667
16711
  var motion = /* @__PURE__ */ createDOMMotionComponentProxy(createMotionComponent);
16668
- var LoadingSpinner = ({
16712
+ var OptifyeLogoLoader = ({
16669
16713
  size = "md",
16670
16714
  message,
16671
16715
  className
16672
16716
  }) => {
16673
16717
  const sizeClasses = {
16674
- sm: "w-5 h-5",
16675
- md: "w-8 h-8",
16676
- lg: "w-12 h-12"
16718
+ sm: "w-10",
16719
+ // 40px
16720
+ md: "w-16",
16721
+ // 64px
16722
+ lg: "w-24"
16723
+ // 96px
16677
16724
  };
16678
- return /* @__PURE__ */ jsxs("div", { className: `flex flex-col items-center justify-center p-4 ${className || ""}`, children: [
16679
- /* @__PURE__ */ jsx("div", { className: `${sizeClasses[size]} animate-spin`, children: /* @__PURE__ */ jsxs("svg", { className: "w-full h-full text-[var(--primary-DEFAULT)]", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
16680
- /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
16681
- /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
16682
- ] }) }),
16683
- message && /* @__PURE__ */ jsx("div", { className: "mt-3 text-gray-600 text-sm font-medium", children: message })
16684
- ] });
16725
+ return /* @__PURE__ */ jsxs(
16726
+ "div",
16727
+ {
16728
+ role: "status",
16729
+ "aria-label": "Loading",
16730
+ className: `flex flex-col items-center justify-center p-4 ${className || ""}`.trim(),
16731
+ children: [
16732
+ /* @__PURE__ */ jsx(
16733
+ "img",
16734
+ {
16735
+ src: "/optifye-logo.png",
16736
+ alt: "Optifye Logo",
16737
+ className: `${sizeClasses[size]} h-auto animate-pulse select-none pointer-events-none`
16738
+ }
16739
+ ),
16740
+ message && /* @__PURE__ */ jsx("div", { className: "mt-3 text-gray-600 text-sm font-medium text-center", children: message })
16741
+ ]
16742
+ }
16743
+ );
16685
16744
  };
16686
- var LoadingSpinner_default = LoadingSpinner;
16745
+ var OptifyeLogoLoader_default = OptifyeLogoLoader;
16687
16746
  var LoadingPage = ({
16688
16747
  message = "Loading Dashboard...",
16689
16748
  subMessage = "Please wait while we prepare your data",
@@ -16697,29 +16756,17 @@ var LoadingPage = ({
16697
16756
  return () => clearTimeout(timeout);
16698
16757
  }, [message]);
16699
16758
  return /* @__PURE__ */ jsx("div", { className: `flex h-full w-full items-center justify-center bg-slate-50 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center space-y-6 text-center", children: [
16700
- /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "lg", message: void 0 }),
16701
- /* @__PURE__ */ jsxs("div", { children: [
16702
- /* @__PURE__ */ jsx(
16703
- motion.h3,
16704
- {
16705
- className: "text-xl font-semibold text-gray-800",
16706
- initial: { opacity: 0, y: 10 },
16707
- animate: { opacity: 1, y: 0 },
16708
- transition: { delay: 0.1, duration: 0.3 },
16709
- children: message
16710
- }
16711
- ),
16712
- subMessage && /* @__PURE__ */ jsx(
16713
- motion.p,
16714
- {
16715
- className: "mt-2 text-base text-gray-600",
16716
- initial: { opacity: 0 },
16717
- animate: { opacity: 1 },
16718
- transition: { delay: 0.2, duration: 0.3 },
16719
- children: subMessage
16720
- }
16721
- )
16722
- ] })
16759
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "lg", message }),
16760
+ subMessage && /* @__PURE__ */ jsx(
16761
+ motion.p,
16762
+ {
16763
+ className: "mt-2 text-base text-gray-600",
16764
+ initial: { opacity: 0 },
16765
+ animate: { opacity: 1 },
16766
+ transition: { delay: 0.2, duration: 0.3 },
16767
+ children: subMessage
16768
+ }
16769
+ )
16723
16770
  ] }) });
16724
16771
  };
16725
16772
  var LoadingPage_default = LoadingPage;
@@ -18564,7 +18611,7 @@ var VideoGridView = React19__default.memo(({
18564
18611
  }, [cropping]);
18565
18612
  const veryLowEfficiencyWorkspaces = useMemo(() => {
18566
18613
  return new Set(
18567
- workspaces.filter((w) => w.efficiency < 50 && w.efficiency >= 10).map((w) => w.workspace_name)
18614
+ workspaces.filter((w) => w.efficiency < 50 && w.efficiency >= 10).map((w) => `${w.line_id}_${w.workspace_name}`)
18568
18615
  );
18569
18616
  }, [workspaces]);
18570
18617
  const filteredWorkspaces = useMemo(() => {
@@ -18700,7 +18747,7 @@ var VideoGridView = React19__default.memo(({
18700
18747
  }).map((workspace) => {
18701
18748
  const workspaceId = workspace.workspace_uuid || workspace.workspace_name;
18702
18749
  const isVisible = visibleWorkspaces.has(workspaceId);
18703
- const isVeryLowEfficiency = veryLowEfficiencyWorkspaces.has(workspace.workspace_name);
18750
+ const isVeryLowEfficiency = veryLowEfficiencyWorkspaces.has(`${workspace.line_id}_${workspace.workspace_name}`);
18704
18751
  const workspaceCropping = getWorkspaceCropping(workspace.workspace_name);
18705
18752
  return /* @__PURE__ */ jsx(
18706
18753
  "div",
@@ -19870,20 +19917,23 @@ var LineHistoryCalendar = ({
19870
19917
  } else {
19871
19918
  calendar.push({
19872
19919
  date: currentDate,
19873
- dayShift: { avg_efficiency: 0, underperforming_workspaces: 0, total_workspaces: 0 },
19874
- nightShift: { avg_efficiency: 0, underperforming_workspaces: 0, total_workspaces: 0 }
19920
+ dayShift: { avg_efficiency: 0, underperforming_workspaces: 0, total_workspaces: 0, hasData: false },
19921
+ nightShift: { avg_efficiency: 0, underperforming_workspaces: 0, total_workspaces: 0, hasData: false }
19875
19922
  });
19876
19923
  }
19877
19924
  }
19878
19925
  return calendar;
19879
19926
  }, [data, month, year, configuredTimezone]);
19880
- const getPerformanceColor = (efficiency, date) => {
19927
+ const hasRealData = (shift) => {
19928
+ if (shift.hasData !== void 0) return shift.hasData;
19929
+ return shift.total_workspaces > 0 || shift.avg_efficiency > 0 || shift.underperforming_workspaces > 0;
19930
+ };
19931
+ const getPerformanceColor = (efficiency, date, hasData) => {
19881
19932
  const istNow = todayInZone;
19882
19933
  const nowString = `${istNow.getFullYear()}-${String(istNow.getMonth() + 1).padStart(2, "0")}-${String(istNow.getDate()).padStart(2, "0")}`;
19883
19934
  const dateString = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
19884
- if (date.getDay() === 0) return "bg-gray-300 dark:bg-gray-600";
19885
19935
  if (dateString > nowString) return "bg-gray-200 dark:bg-gray-700";
19886
- if (efficiency < 10) return "bg-gray-300 dark:bg-gray-600";
19936
+ if (!hasData) return "bg-gray-300 dark:bg-gray-600";
19887
19937
  return efficiency >= 75 ? "bg-green-500 dark:bg-green-600" : "bg-red-500 dark:bg-red-600";
19888
19938
  };
19889
19939
  const isCurrentDate = (date) => {
@@ -19902,7 +19952,7 @@ var LineHistoryCalendar = ({
19902
19952
  const istNow = todayInZone;
19903
19953
  const nowString = `${istNow.getFullYear()}-${String(istNow.getMonth() + 1).padStart(2, "0")}-${String(istNow.getDate()).padStart(2, "0")}`;
19904
19954
  const dateString = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
19905
- if (dateString > nowString || date.getDay() === 0) return null;
19955
+ if (dateString > nowString) return null;
19906
19956
  return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/80 rounded-lg p-2 text-white opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxs("div", { className: "text-xs space-y-1", children: [
19907
19957
  /* @__PURE__ */ jsxs("div", { children: [
19908
19958
  "Efficiency: ",
@@ -19923,14 +19973,14 @@ var LineHistoryCalendar = ({
19923
19973
  if (!shiftData) return /* @__PURE__ */ jsx("div", { className: "h-full border border-gray-100 dark:border-gray-700 rounded-lg bg-gray-50 dark:bg-gray-800" });
19924
19974
  const isToday = isCurrentDate(day.date instanceof Date ? day.date : new Date(day.date));
19925
19975
  const isFuture = isFutureDate(day.date instanceof Date ? day.date : new Date(day.date));
19926
- const isInactive = (shiftData.avg_efficiency || 0) < 10;
19976
+ const hasData = hasRealData(shiftData);
19927
19977
  const dateObj = day.date instanceof Date ? day.date : new Date(day.date);
19928
19978
  return /* @__PURE__ */ jsx(
19929
19979
  "div",
19930
19980
  {
19931
- className: `group h-full ${isFuture || isInactive ? "cursor-not-allowed" : "cursor-pointer hover:opacity-90"}`,
19981
+ className: `group h-full ${isFuture || !hasData ? "cursor-not-allowed" : "cursor-pointer hover:opacity-90"}`,
19932
19982
  onClick: () => {
19933
- if (!isFuture && !isInactive) {
19983
+ if (!isFuture && hasData) {
19934
19984
  const dateObj2 = day.date instanceof Date ? day.date : new Date(day.date);
19935
19985
  const year2 = dateObj2.getFullYear();
19936
19986
  const month2 = String(dateObj2.getMonth() + 1).padStart(2, "0");
@@ -19955,15 +20005,15 @@ var LineHistoryCalendar = ({
19955
20005
  }
19956
20006
  },
19957
20007
  children: /* @__PURE__ */ jsxs("div", { className: `
19958
- ${getPerformanceColor(shiftData.avg_efficiency || 0, dateObj)}
20008
+ ${getPerformanceColor(shiftData.avg_efficiency || 0, dateObj, hasData)}
19959
20009
  rounded-lg h-full p-2 relative
19960
20010
  ${isToday ? "ring-2 ring-blue-500 dark:ring-blue-400 ring-offset-2 dark:ring-offset-gray-800 shadow-md" : ""}
19961
20011
  `, children: [
19962
20012
  /* @__PURE__ */ jsx("div", { className: `
19963
- text-base font-medium text-white flex items-center
20013
+ text-base font-medium ${hasData ? "text-white" : "text-gray-500"} flex items-center
19964
20014
  ${isToday ? "bg-blue-500 dark:bg-blue-600 rounded-full w-7 h-7 justify-center" : ""}
19965
20015
  `, children: dateObj.getDate() }),
19966
- !isFuture && !isInactive && renderStats(shiftData, dateObj)
20016
+ !isFuture && hasData && renderStats(shiftData, dateObj)
19967
20017
  ] })
19968
20018
  }
19969
20019
  );
@@ -21061,6 +21111,10 @@ var WorkspaceHistoryCalendar = ({
21061
21111
  const { dateTimeConfig } = useDashboardConfig();
21062
21112
  const configuredTimezone = dateTimeConfig?.defaultTimezone || "Asia/Kolkata";
21063
21113
  const [animationComplete, setAnimationComplete] = useState(false);
21114
+ const hasRealData = (shift) => {
21115
+ if (shift.hasData !== void 0) return shift.hasData;
21116
+ return shift.efficiency > 0 || shift.output > 0 || shift.cycleTime > 0 || shift.pph > 0 || shift.idealOutput > 0 || shift.idleTime > 0;
21117
+ };
21064
21118
  useEffect(() => {
21065
21119
  setAnimationComplete(false);
21066
21120
  const timer = setTimeout(() => {
@@ -21113,10 +21167,14 @@ var WorkspaceHistoryCalendar = ({
21113
21167
  istNow.setHours(0, 0, 0, 0);
21114
21168
  const compareDate = new Date(date);
21115
21169
  compareDate.setHours(0, 0, 0, 0);
21116
- if (date.getDay() === 0 || compareDate > istNow) {
21170
+ if (compareDate > istNow) {
21117
21171
  return [];
21118
21172
  }
21119
- return [day.dayShift, day.nightShift];
21173
+ const shiftData = selectedShift === "day" ? day.dayShift : day.nightShift;
21174
+ if (hasRealData(shiftData)) {
21175
+ return [shiftData];
21176
+ }
21177
+ return [];
21120
21178
  });
21121
21179
  if (validShifts.length === 0) return null;
21122
21180
  const badShiftsCount = validShifts.filter((shift) => shift.efficiency < 75).length;
@@ -21129,7 +21187,7 @@ var WorkspaceHistoryCalendar = ({
21129
21187
  badDaysCount: badShiftsCount,
21130
21188
  totalDays: validShifts.length
21131
21189
  };
21132
- }, [data, month, year, configuredTimezone]);
21190
+ }, [data, month, year, configuredTimezone, selectedShift]);
21133
21191
  const handleDayClick = useCallback((day, shift) => {
21134
21192
  if (!day || isFutureDate(day.date)) return;
21135
21193
  const year2 = day.date.getFullYear();
@@ -21168,13 +21226,13 @@ var WorkspaceHistoryCalendar = ({
21168
21226
  compareDate.setHours(0, 0, 0, 0);
21169
21227
  return compareDate > istNow;
21170
21228
  }, [configuredTimezone]);
21171
- const getPerformanceColor = useCallback((efficiency, date) => {
21229
+ const getPerformanceColor = useCallback((efficiency, date, hasData) => {
21172
21230
  const istNow = getTimeInZoneAsDate(configuredTimezone);
21173
21231
  istNow.setHours(0, 0, 0, 0);
21174
21232
  const compareDate = toZonedTime(date, configuredTimezone);
21175
21233
  compareDate.setHours(0, 0, 0, 0);
21176
- if (compareDate.getDay() === 0) return "bg-gray-300";
21177
21234
  if (compareDate > istNow) return "bg-gray-200";
21235
+ if (!hasData) return "bg-gray-300";
21178
21236
  if (efficiency >= 80) return "bg-[#00AB45]/90";
21179
21237
  if (efficiency >= 70) return "bg-[#FFB020]/90";
21180
21238
  return "bg-[#E34329]/90";
@@ -21183,7 +21241,7 @@ var WorkspaceHistoryCalendar = ({
21183
21241
  const istNow = getTimeInZoneAsDate(configuredTimezone);
21184
21242
  const compareDate = toZonedTime(date, configuredTimezone);
21185
21243
  compareDate.setHours(0, 0, 0, 0);
21186
- if (compareDate > istNow || compareDate.getDay() === 0) return null;
21244
+ if (compareDate > istNow || !hasRealData(shift)) return null;
21187
21245
  return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/80 rounded-lg p-2 text-white opacity-0 group-hover:opacity-100 transition-all duration-200 ease-in-out", children: /* @__PURE__ */ jsxs("div", { className: "text-xs space-y-1", children: [
21188
21246
  /* @__PURE__ */ jsxs("div", { children: [
21189
21247
  "Efficiency: ",
@@ -21235,25 +21293,26 @@ var WorkspaceHistoryCalendar = ({
21235
21293
  return /* @__PURE__ */ jsx("div", { className: `h-full border border-gray-200 rounded-lg ${bgColor} ${animationComplete ? "transition-all duration-300 ease-in-out" : ""} cursor-not-allowed opacity-60`, children: /* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsx("div", { className: `text-base font-medium ${textColor} ${isToday ? "text-blue-500" : ""}`, children: dayNumber }) }) });
21236
21294
  }
21237
21295
  const shiftData = selectedShift === "day" ? day.dayShift : day.nightShift;
21296
+ const hasData = hasRealData(shiftData);
21238
21297
  return /* @__PURE__ */ jsx(
21239
21298
  "div",
21240
21299
  {
21241
- className: `group h-full ${animationComplete ? "transition-all duration-300 ease-in-out" : ""} ${!isFuture && animationComplete ? "cursor-pointer hover:opacity-90 hover:scale-105" : "cursor-not-allowed"}`,
21242
- onClick: () => !isFuture && handleDayClick(day, selectedShift),
21300
+ className: `group h-full ${animationComplete ? "transition-all duration-300 ease-in-out" : ""} ${!isFuture && hasData && animationComplete ? "cursor-pointer hover:opacity-90 hover:scale-105" : "cursor-not-allowed"}`,
21301
+ onClick: () => !isFuture && hasData && handleDayClick(day, selectedShift),
21243
21302
  children: /* @__PURE__ */ jsxs("div", { className: `
21244
- ${getPerformanceColor(shiftData.efficiency, day.date)}
21303
+ ${getPerformanceColor(shiftData.efficiency, day.date, hasData)}
21245
21304
  rounded-lg h-full p-2 relative ${animationComplete ? "transition-all duration-300 ease-in-out" : ""} shadow-sm
21246
21305
  ${isToday ? "ring-2 ring-blue-500 ring-offset-2 shadow-md" : ""}
21247
21306
  `, children: [
21248
21307
  /* @__PURE__ */ jsx("div", { className: `
21249
- text-base font-medium text-white flex items-center ${animationComplete ? "transition-all duration-300 ease-in-out" : ""}
21308
+ text-base font-medium ${hasData ? "text-white" : "text-gray-500"} flex items-center ${animationComplete ? "transition-all duration-300 ease-in-out" : ""}
21250
21309
  ${isToday ? "bg-blue-500 rounded-full w-7 h-7 justify-center" : ""}
21251
21310
  `, children: day.date.getDate() }),
21252
- !isFuture && animationComplete && renderStats(shiftData, day.date)
21311
+ !isFuture && hasData && animationComplete && renderStats(shiftData, day.date)
21253
21312
  ] })
21254
21313
  }
21255
21314
  );
21256
- }, [selectedShift, isCurrentDate, isFutureDate, getPerformanceColor, handleDayClick, year, month, configuredTimezone, animationComplete]);
21315
+ }, [selectedShift, isCurrentDate, isFutureDate, getPerformanceColor, handleDayClick, year, month, configuredTimezone, animationComplete, hasRealData]);
21257
21316
  return /* @__PURE__ */ jsxs("div", { className: `calendar-wrapper space-y-6 ${className || ""} ${animationComplete ? "animation-complete" : ""}`, children: [
21258
21317
  /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: styles } }),
21259
21318
  /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1 border border-gray-200 rounded-lg p-1 bg-gray-50", children: [
@@ -21291,7 +21350,10 @@ var WorkspaceHistoryCalendar = ({
21291
21350
  ] }),
21292
21351
  /* @__PURE__ */ jsxs("div", { className: "calendar-container bg-white rounded-xl shadow-sm border border-gray-100 p-6 transition-all duration-200 ease-in-out", children: [
21293
21352
  /* @__PURE__ */ jsxs("div", { className: "mb-6", children: [
21294
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-gray-900 text-lg", children: "Monthly Summary" }),
21353
+ /* @__PURE__ */ jsxs("h3", { className: "font-semibold text-gray-900 text-lg", children: [
21354
+ "Monthly Summary - ",
21355
+ selectedShift === "day" ? "Day Shift" : "Night Shift"
21356
+ ] }),
21295
21357
  /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 mt-1", children: "Overview of monthly performance metrics" })
21296
21358
  ] }),
21297
21359
  monthlyMetrics ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
@@ -22027,10 +22089,7 @@ var LoadingOverlay = ({
22027
22089
  className: `fixed inset-0 z-[100] flex items-center justify-center bg-black/30 backdrop-blur-sm ${className || ""}`,
22028
22090
  "aria-modal": "true",
22029
22091
  role: "dialog",
22030
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center space-y-3 rounded-lg bg-white p-8 shadow-xl", children: [
22031
- /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "md" }),
22032
- /* @__PURE__ */ jsx("p", { className: "text-base font-medium text-gray-700", children: message })
22033
- ] })
22092
+ children: /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center space-y-3 rounded-lg bg-white p-8 shadow-xl", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "md", message }) })
22034
22093
  }
22035
22094
  );
22036
22095
  };
@@ -22855,20 +22914,6 @@ var S3ClipsService = class {
22855
22914
  return videos;
22856
22915
  }
22857
22916
  };
22858
- var LoadingSpinner2 = ({
22859
- size = "md",
22860
- message = "Loading..."
22861
- }) => {
22862
- const sizeClasses = {
22863
- sm: "w-4 h-4",
22864
- md: "w-6 h-6",
22865
- lg: "w-8 h-8"
22866
- };
22867
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
22868
- /* @__PURE__ */ jsx("div", { className: `${sizeClasses[size]} border-2 border-t-blue-500 border-r-blue-500 border-b-gray-200 border-l-gray-200 rounded-full animate-spin mb-2` }),
22869
- message && /* @__PURE__ */ jsx("span", { className: "text-gray-600 text-sm", children: message })
22870
- ] });
22871
- };
22872
22917
  var BottlenecksContent = ({
22873
22918
  workspaceId,
22874
22919
  workspaceName,
@@ -23387,7 +23432,7 @@ var BottlenecksContent = ({
23387
23432
  ] });
23388
23433
  }
23389
23434
  if (isLoading && allVideos.length === 0) {
23390
- return /* @__PURE__ */ jsx("div", { className: "flex-grow p-4 flex items-center justify-center h-[calc(100vh-12rem)]", children: /* @__PURE__ */ jsx(LoadingSpinner2, { size: "lg", message: "Loading clips..." }) });
23435
+ return /* @__PURE__ */ jsx("div", { className: "flex-grow p-4 flex items-center justify-center h-[calc(100vh-12rem)]", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "lg", message: "Loading clips..." }) });
23391
23436
  }
23392
23437
  if (error) {
23393
23438
  return /* @__PURE__ */ jsxs("div", { className: "flex-grow p-4 flex flex-col items-center justify-center h-[calc(100vh-12rem)] text-center", children: [
@@ -23565,7 +23610,7 @@ var BottlenecksContent = ({
23565
23610
  }
23566
23611
  )
23567
23612
  ] }),
23568
- isLoading && allVideos.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[calc(100%-4rem)]", children: /* @__PURE__ */ jsx(LoadingSpinner2, { size: "md", message: "Loading clips..." }) }) : allVideos.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[calc(100%-4rem)]", children: /* @__PURE__ */ jsxs("div", { className: "text-center p-8", children: [
23613
+ isLoading && allVideos.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[calc(100%-4rem)]", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "md", message: "Loading clips..." }) }) : allVideos.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[calc(100%-4rem)]", children: /* @__PURE__ */ jsxs("div", { className: "text-center p-8", children: [
23569
23614
  /* @__PURE__ */ jsx("svg", { className: "w-16 h-16 text-gray-300 mx-auto mb-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" }) }),
23570
23615
  /* @__PURE__ */ jsx("h3", { className: "text-xl font-medium text-gray-700 mb-2", children: "No Clips Found" }),
23571
23616
  /* @__PURE__ */ jsx("p", { className: "text-gray-500", children: "There were no video clips found for this workspace today." })
@@ -25255,11 +25300,8 @@ var LoadingState = ({
25255
25300
  className = ""
25256
25301
  }) => {
25257
25302
  return /* @__PURE__ */ jsx("div", { className: `flex h-full w-full items-center justify-center bg-gray-50/50 ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center space-y-4 text-center", children: [
25258
- /* @__PURE__ */ jsx(LoadingSpinner_default, { size }),
25259
- /* @__PURE__ */ jsxs("div", { children: [
25260
- /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium text-gray-900", children: message }),
25261
- subMessage && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-gray-600", children: subMessage })
25262
- ] })
25303
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size, message }),
25304
+ subMessage && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-gray-600", children: subMessage })
25263
25305
  ] }) });
25264
25306
  };
25265
25307
  var LoadingSkeleton = ({
@@ -25286,10 +25328,7 @@ var LoadingSkeleton = ({
25286
25328
  /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-1/3" }),
25287
25329
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
25288
25330
  /* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full" }),
25289
- showLoadingIndicator && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "bg-white/80 rounded-lg p-3 shadow-sm", children: /* @__PURE__ */ jsxs("svg", { className: "animate-spin h-6 w-6 text-blue-500", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
25290
- /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
25291
- /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
25292
- ] }) }) })
25331
+ showLoadingIndicator && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "bg-white/80 rounded-lg p-3 shadow-sm", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm" }) }) })
25293
25332
  ] })
25294
25333
  ] });
25295
25334
  case "table":
@@ -25340,10 +25379,7 @@ var LoadingInline = ({
25340
25379
  size = "sm",
25341
25380
  className = ""
25342
25381
  }) => {
25343
- return /* @__PURE__ */ jsxs("div", { className: `inline-flex items-center space-x-2 ${className}`, children: [
25344
- /* @__PURE__ */ jsx(LoadingSpinner_default, { size }),
25345
- message && /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-600", children: message })
25346
- ] });
25382
+ return /* @__PURE__ */ jsx("div", { className: `inline-flex items-center space-x-2 ${className}`, children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size, message }) });
25347
25383
  };
25348
25384
  var DEFAULT_HLS_CONFIG = {
25349
25385
  maxBufferLength: 15,
@@ -25572,7 +25608,7 @@ var ThreadSidebar = ({
25572
25608
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "Chat History" }),
25573
25609
  /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 mt-1", children: "Your previous conversations" })
25574
25610
  ] }),
25575
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto min-h-0", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center p-8", children: /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "sm" }) }) : threads.length === 0 ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-gray-500 text-sm", children: "No conversations yet" }) : /* @__PURE__ */ jsx("div", { className: "py-2", children: threads.map((thread) => /* @__PURE__ */ jsxs(
25611
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto min-h-0", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center p-8", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm" }) }) : threads.length === 0 ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-gray-500 text-sm", children: "No conversations yet" }) : /* @__PURE__ */ jsx("div", { className: "py-2", children: threads.map((thread) => /* @__PURE__ */ jsxs(
25576
25612
  "div",
25577
25613
  {
25578
25614
  onClick: () => onSelectThread(thread.id),
@@ -25583,7 +25619,7 @@ var ThreadSidebar = ({
25583
25619
  /* @__PURE__ */ jsx("h3", { className: `text-sm font-medium truncate ${activeThreadId === thread.id ? "text-blue-900" : "text-gray-900"}`, children: thread.title || "Untitled Chat" }),
25584
25620
  /* @__PURE__ */ jsx("p", { className: `text-xs mt-0.5 ${activeThreadId === thread.id ? "text-blue-700" : "text-gray-500"}`, children: formatDate(thread.created_at) })
25585
25621
  ] }),
25586
- deletingId === thread.id ? /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(
25622
+ deletingId === thread.id ? /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(
25587
25623
  "button",
25588
25624
  {
25589
25625
  onClick: (e) => handleDelete(e, thread.id),
@@ -25741,6 +25777,12 @@ var AIAgentView = () => {
25741
25777
  const lineId = getLineIdFromPath();
25742
25778
  const { shiftId } = getCurrentShift(dateTimeConfig.defaultTimezone || "Asia/Kolkata", shiftConfig);
25743
25779
  const companyId = entityConfig.companyId || "default-company-id";
25780
+ const configuredLineIds = getConfiguredLineIds(entityConfig);
25781
+ const lineDisplayNames = getAllLineDisplayNames(entityConfig);
25782
+ const allLines = configuredLineIds.map((id3) => ({
25783
+ id: id3,
25784
+ name: lineDisplayNames[id3] || `Line ${id3.substring(0, 8)}`
25785
+ }));
25744
25786
  const ACTIVE_THREAD_STORAGE_KEY = `ai-agent-active-thread-${lineId}`;
25745
25787
  useLayoutEffect(() => {
25746
25788
  const savedThreadId = localStorage.getItem(ACTIVE_THREAD_STORAGE_KEY);
@@ -25911,7 +25953,8 @@ var AIAgentView = () => {
25911
25953
  {
25912
25954
  companyId,
25913
25955
  lineId,
25914
- shiftId
25956
+ shiftId,
25957
+ allLines
25915
25958
  },
25916
25959
  {
25917
25960
  onThreadCreated: (threadId) => {
@@ -26558,6 +26601,13 @@ var AIAgentView = () => {
26558
26601
  console.error("Bar chart missing required parameters:", { data: !!args.data, x_field: !!args.x_field, y_field: !!args.y_field });
26559
26602
  return null;
26560
26603
  }
26604
+ if (!Array.isArray(args.data)) {
26605
+ console.error("Bar chart data must be an array, got:", typeof args.data, args.data);
26606
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26607
+ "Error: Chart data must be an array. Received: ",
26608
+ typeof args.data
26609
+ ] }) }, `bar-error-${key}`);
26610
+ }
26561
26611
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-64", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(BarChart$1, { data: args.data, margin: CHART_STYLES.margin, children: [
26562
26612
  /* @__PURE__ */ jsx(CartesianGrid, { ...CHART_STYLES.grid }),
26563
26613
  /* @__PURE__ */ jsx(
@@ -26595,6 +26645,13 @@ var AIAgentView = () => {
26595
26645
  console.error("Line chart missing required parameters:", { data: !!args.data, x_field: !!args.x_field, y_field: !!args.y_field });
26596
26646
  return null;
26597
26647
  }
26648
+ if (!Array.isArray(args.data)) {
26649
+ console.error("Line chart data must be an array, got:", typeof args.data, args.data);
26650
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26651
+ "Error: Chart data must be an array. Received: ",
26652
+ typeof args.data
26653
+ ] }) }, `line-error-${key}`);
26654
+ }
26598
26655
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-64", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(LineChart$1, { data: args.data, margin: CHART_STYLES.margin, children: [
26599
26656
  /* @__PURE__ */ jsx(CartesianGrid, { ...CHART_STYLES.grid }),
26600
26657
  /* @__PURE__ */ jsx(
@@ -26636,6 +26693,13 @@ var AIAgentView = () => {
26636
26693
  console.error("Available args:", Object.keys(args));
26637
26694
  return null;
26638
26695
  }
26696
+ if (!Array.isArray(args.data)) {
26697
+ console.error("Pie chart data must be an array, got:", typeof args.data, args.data);
26698
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26699
+ "Error: Chart data must be an array. Received: ",
26700
+ typeof args.data
26701
+ ] }) }, `pie-error-${key}`);
26702
+ }
26639
26703
  const pieData = args.data.map((item) => ({
26640
26704
  name: item[args.label_field],
26641
26705
  value: item[args.value_field]
@@ -26655,6 +26719,13 @@ var AIAgentView = () => {
26655
26719
  console.error("Comparison table missing required data");
26656
26720
  return null;
26657
26721
  }
26722
+ if (!Array.isArray(args.data)) {
26723
+ console.error("Comparison table data must be an array, got:", typeof args.data, args.data);
26724
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26725
+ "Error: Table data must be an array. Received: ",
26726
+ typeof args.data
26727
+ ] }) }, `table-error-${key}`);
26728
+ }
26658
26729
  const columns = args.columns || Object.keys(args.data[0] || {});
26659
26730
  let sortedData = [...args.data];
26660
26731
  if (args.sort_by && columns.includes(args.sort_by)) {
@@ -26694,6 +26765,13 @@ var AIAgentView = () => {
26694
26765
  });
26695
26766
  return null;
26696
26767
  }
26768
+ if (!Array.isArray(args.data)) {
26769
+ console.error("Multi-line chart data must be an array, got:", typeof args.data, args.data);
26770
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26771
+ "Error: Chart data must be an array. Received: ",
26772
+ typeof args.data
26773
+ ] }) }, `multi-line-error-${key}`);
26774
+ }
26697
26775
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-80", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(LineChart$1, { data: args.data, margin: CHART_STYLES.margin, children: [
26698
26776
  /* @__PURE__ */ jsx(CartesianGrid, { ...CHART_STYLES.grid }),
26699
26777
  /* @__PURE__ */ jsx(
@@ -26747,6 +26825,13 @@ var AIAgentView = () => {
26747
26825
  });
26748
26826
  return null;
26749
26827
  }
26828
+ if (!Array.isArray(args.data)) {
26829
+ console.error("Stacked bar chart data must be an array, got:", typeof args.data, args.data);
26830
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26831
+ "Error: Chart data must be an array. Received: ",
26832
+ typeof args.data
26833
+ ] }) }, `stacked-bar-error-${key}`);
26834
+ }
26750
26835
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-80", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(BarChart$1, { data: args.data, margin: CHART_STYLES.margin, children: [
26751
26836
  /* @__PURE__ */ jsx(CartesianGrid, { ...CHART_STYLES.grid }),
26752
26837
  /* @__PURE__ */ jsx(
@@ -26799,6 +26884,13 @@ var AIAgentView = () => {
26799
26884
  });
26800
26885
  return null;
26801
26886
  }
26887
+ if (!Array.isArray(args.data)) {
26888
+ console.error("Dual-axis chart data must be an array, got:", typeof args.data, args.data);
26889
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26890
+ "Error: Chart data must be an array. Received: ",
26891
+ typeof args.data
26892
+ ] }) }, `dual-axis-error-${key}`);
26893
+ }
26802
26894
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-80", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(ComposedChart, { data: args.data, margin: { ...CHART_STYLES.margin, bottom: 80 }, children: [
26803
26895
  /* @__PURE__ */ jsx(CartesianGrid, { ...CHART_STYLES.grid }),
26804
26896
  /* @__PURE__ */ jsx(
@@ -26886,6 +26978,13 @@ var AIAgentView = () => {
26886
26978
  });
26887
26979
  return null;
26888
26980
  }
26981
+ if (!Array.isArray(args.data)) {
26982
+ console.error("Scatter plot data must be an array, got:", typeof args.data, args.data);
26983
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
26984
+ "Error: Chart data must be an array. Received: ",
26985
+ typeof args.data
26986
+ ] }) }, `scatter-error-${key}`);
26987
+ }
26889
26988
  const groupedData = args.data.reduce((acc, item) => {
26890
26989
  const group = item[args.group_field];
26891
26990
  if (!acc[group]) {
@@ -26949,6 +27048,13 @@ var AIAgentView = () => {
26949
27048
  });
26950
27049
  return null;
26951
27050
  }
27051
+ if (!Array.isArray(args.data)) {
27052
+ console.error("Combo chart data must be an array, got:", typeof args.data, args.data);
27053
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
27054
+ "Error: Chart data must be an array. Received: ",
27055
+ typeof args.data
27056
+ ] }) }, `combo-error-${key}`);
27057
+ }
26952
27058
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-80", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(ComposedChart, { data: args.data, margin: { ...CHART_STYLES.margin, bottom: 80 }, children: [
26953
27059
  /* @__PURE__ */ jsx(CartesianGrid, { ...CHART_STYLES.grid }),
26954
27060
  /* @__PURE__ */ jsx(
@@ -27023,6 +27129,13 @@ var AIAgentView = () => {
27023
27129
  });
27024
27130
  return null;
27025
27131
  }
27132
+ if (!Array.isArray(args.data)) {
27133
+ console.error("Area chart data must be an array, got:", typeof args.data, args.data);
27134
+ return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsxs("div", { className: "text-red-500 text-sm", children: [
27135
+ "Error: Chart data must be an array. Received: ",
27136
+ typeof args.data
27137
+ ] }) }, `area-error-${key}`);
27138
+ }
27026
27139
  return /* @__PURE__ */ jsx(ChartWrapper, { title: args.title, children: /* @__PURE__ */ jsx("div", { className: "w-full h-80", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(ComposedChart, { data: args.data, margin: { ...CHART_STYLES.margin, bottom: 80 }, children: [
27027
27140
  /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "colorGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
27028
27141
  /* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: CHART_COLORS.primary, stopOpacity: 0.8 }),
@@ -27267,7 +27380,13 @@ var AIAgentView = () => {
27267
27380
  {
27268
27381
  className: `relative px-5 py-4 rounded-2xl shadow-sm ${message.role === "user" ? "bg-blue-600 text-white max-w-[85%] ml-auto" : "bg-white border border-gray-200/80 max-w-full"}`,
27269
27382
  children: /* @__PURE__ */ jsxs("div", { className: `${message.role === "user" ? "text-white" : "text-gray-800"}`, children: [
27270
- message.role === "assistant" ? renderAssistantContent(message.content) : /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap leading-relaxed", children: message.content }),
27383
+ message.role === "assistant" ? message.id === -1 ? /* @__PURE__ */ jsx(
27384
+ "div",
27385
+ {
27386
+ className: "formatted-content",
27387
+ dangerouslySetInnerHTML: { __html: formatMessage(message.content) }
27388
+ }
27389
+ ) : renderAssistantContent(message.content) : /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap leading-relaxed", children: message.content }),
27271
27390
  message.id === -1 && /* @__PURE__ */ jsx("span", { className: "inline-block w-0.5 h-4 bg-gray-400 animate-pulse ml-0.5" })
27272
27391
  ] })
27273
27392
  }
@@ -27297,7 +27416,13 @@ var AIAgentView = () => {
27297
27416
  className: `relative px-5 py-4 rounded-2xl shadow-sm ${message.role === "user" ? "bg-blue-600 text-white max-w-[85%] ml-auto" : "bg-white border border-gray-200/80 max-w-full"}`,
27298
27417
  children: [
27299
27418
  /* @__PURE__ */ jsxs("div", { className: `${message.role === "user" ? "text-white" : "text-gray-800"}`, children: [
27300
- message.role === "assistant" ? renderAssistantContent(message.content) : /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap leading-relaxed", children: message.content }),
27419
+ message.role === "assistant" ? message.id === -1 ? /* @__PURE__ */ jsx(
27420
+ "div",
27421
+ {
27422
+ className: "formatted-content",
27423
+ dangerouslySetInnerHTML: { __html: formatMessage(message.content) }
27424
+ }
27425
+ ) : renderAssistantContent(message.content) : /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap leading-relaxed", children: message.content }),
27301
27426
  message.id === -1 && /* @__PURE__ */ jsx("span", { className: "inline-block w-0.5 h-4 bg-gray-400 animate-pulse ml-0.5" })
27302
27427
  ] }),
27303
27428
  message.role === "assistant" && message.id !== -1 && /* @__PURE__ */ jsx(
@@ -28319,7 +28444,7 @@ var HelpView = ({
28319
28444
  disabled: isSubmitting,
28320
28445
  className: "px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 shadow-sm text-sm",
28321
28446
  children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
28322
- /* @__PURE__ */ jsx(LoadingSpinner_default, { className: "h-4 w-4" }),
28447
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm" }),
28323
28448
  "Submitting..."
28324
28449
  ] }) : "Submit Ticket"
28325
28450
  }
@@ -28504,7 +28629,7 @@ function HomeView({
28504
28629
  ) }) }),
28505
28630
  /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto sm:overflow-hidden relative", children: [
28506
28631
  lineSelectorComponent && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-2 sm:right-6 sm:top-3 z-30", children: lineSelectorComponent }),
28507
- /* @__PURE__ */ jsx("div", { className: "h-full sm:h-full min-h-[calc(100vh-80px)] sm:min-h-0", children: isDataLoading && hasInitialDataLoaded && memoizedWorkspaceMetrics.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 sm:px-6 lg:px-8 py-4", children: /* @__PURE__ */ jsx(LoadingSkeleton, { type: "workspace-card", count: 8, className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4" }) }) : memoizedWorkspaceMetrics.length > 0 ? /* @__PURE__ */ jsx(
28632
+ /* @__PURE__ */ jsx("div", { className: "h-full sm:h-full min-h-[calc(100vh-80px)] sm:min-h-0", children: isDataLoading || !hasInitialDataLoaded ? /* @__PURE__ */ jsx("div", { className: "px-3 sm:px-6 lg:px-8 py-4", children: /* @__PURE__ */ jsx(LoadingSkeleton, { type: "workspace-card", count: 8, className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4" }) }) : memoizedWorkspaceMetrics.length > 0 ? /* @__PURE__ */ jsx(
28508
28633
  motion.div,
28509
28634
  {
28510
28635
  initial: { opacity: 0, scale: 0.98 },
@@ -30131,7 +30256,7 @@ var ProfileView = () => {
30131
30256
  }
30132
30257
  };
30133
30258
  if (authLoading || loading) {
30134
- return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "lg" }) });
30259
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "lg" }) });
30135
30260
  }
30136
30261
  if (!user) {
30137
30262
  return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
@@ -30288,7 +30413,7 @@ var ProfileView = () => {
30288
30413
  ] })
30289
30414
  ] }),
30290
30415
  isEditing && /* @__PURE__ */ jsx("div", { className: "mt-6 flex gap-3", children: /* @__PURE__ */ jsx(Button2, { variant: "outline", onClick: handleSaveProfile, disabled: loading, children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
30291
- /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "sm", className: "mr-2" }),
30416
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm", className: "mr-2" }),
30292
30417
  "Saving..."
30293
30418
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
30294
30419
  /* @__PURE__ */ jsx(Save, { className: "h-4 w-4 mr-2" }),
@@ -30352,7 +30477,7 @@ var ProfileView = () => {
30352
30477
  disabled: loading,
30353
30478
  className: "flex items-center gap-2 text-red-600 hover:text-red-700 border-red-200 hover:border-red-300",
30354
30479
  children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
30355
- /* @__PURE__ */ jsx(LoadingSpinner_default, { size: "sm", className: "mr-2" }),
30480
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm", className: "mr-2" }),
30356
30481
  "Signing out..."
30357
30482
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
30358
30483
  /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
@@ -31799,7 +31924,7 @@ var SKUList = ({
31799
31924
  }) => {
31800
31925
  if (isLoading) {
31801
31926
  return /* @__PURE__ */ jsx("div", { className: "bg-white rounded-xl shadow-sm border border-gray-200 p-8", children: /* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center", children: [
31802
- /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" }),
31927
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "md" }),
31803
31928
  /* @__PURE__ */ jsx("span", { className: "ml-3 text-gray-600", children: "Loading SKUs..." })
31804
31929
  ] }) });
31805
31930
  }
@@ -31885,7 +32010,7 @@ var TargetsViewUI = ({
31885
32010
  skuRequired = false
31886
32011
  }) => {
31887
32012
  if (isLoading) {
31888
- return /* @__PURE__ */ jsx("div", { className: "flex h-screen bg-gray-50", children: /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "w-8 h-8 animate-spin text-blue-600" }) }) });
32013
+ return /* @__PURE__ */ jsx("div", { className: "flex h-screen bg-gray-50", children: /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "lg", message: "Loading targets..." }) }) });
31889
32014
  }
31890
32015
  return /* @__PURE__ */ jsxs("main", { className: "min-h-screen flex-1 bg-gray-50", children: [
31891
32016
  /* @__PURE__ */ jsx("div", { className: "bg-white px-8 py-6 shadow-sm border-b border-gray-200/80", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between relative", children: [
@@ -31987,7 +32112,7 @@ var TargetsViewUI = ({
31987
32112
  className: `ml-6 inline-flex items-center px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200
31988
32113
  ${savingLines[lineId] ? "bg-gray-100 text-gray-400 cursor-not-allowed" : "bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"}`,
31989
32114
  children: savingLines[lineId] ? /* @__PURE__ */ jsxs(Fragment, { children: [
31990
- /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 mr-2 animate-spin" }),
32115
+ /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm", className: "mr-2" }),
31991
32116
  "Saving..."
31992
32117
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
31993
32118
  /* @__PURE__ */ jsx(Save, { className: "w-4 h-4 mr-2" }),
@@ -33125,13 +33250,7 @@ var WorkspaceDetailView = ({
33125
33250
  ] }) }, i)) }),
33126
33251
  /* @__PURE__ */ jsx("div", { className: "bg-white rounded-lg p-6 shadow-sm", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse", children: [
33127
33252
  /* @__PURE__ */ jsx("div", { className: "h-6 w-40 bg-gray-200 rounded mb-4" }),
33128
- /* @__PURE__ */ jsx("div", { className: "h-64 bg-gray-100 rounded relative overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "bg-white/80 rounded-lg p-4 shadow-sm", children: [
33129
- /* @__PURE__ */ jsxs("svg", { className: "animate-spin h-8 w-8 text-blue-500", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
33130
- /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
33131
- /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
33132
- ] }),
33133
- /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mt-2", children: "Loading chart data..." })
33134
- ] }) }) })
33253
+ /* @__PURE__ */ jsx("div", { className: "h-64 bg-gray-100 rounded relative overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "bg-white/80 rounded-lg p-4 shadow-sm", children: /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "md", message: "Loading chart data..." }) }) }) })
33135
33254
  ] }) })
33136
33255
  ] })
33137
33256
  ] })
@@ -33952,4 +34071,4 @@ var S3Service = class {
33952
34071
  }
33953
34072
  };
33954
34073
 
33955
- export { ACTION_NAMES, AIAgentView_default as AIAgentView, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedTargetsView, BarChart, BaseHistoryCalendar, BottlenecksContent, BreakNotificationPopup, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, CycleTimeChart, CycleTimeOverTimeChart, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, EmptyStateMessage, FactoryView_default as FactoryView, GaugeChart, GridComponentsPlaceholder, Header, HelpView_default as HelpView, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, ISTTimer_default as ISTTimer, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend6 as Legend, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LiveTimer, LoadingInline, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSkeleton, LoadingSpinner_default as LoadingSpinner, LoadingState, LoginPage, LoginView_default as LoginView, MainLayout, MetricCard_default as MetricCard, NoWorkspaceData, OptifyeAgentClient, OutputProgressChart, PageHeader, PieChart4 as PieChart, ProfileView_default as ProfileView, RegistryProvider, S3Service, SKUManagementView, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SingleVideoStream_default as SingleVideoStream, Skeleton, SlackAPI, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, TargetWorkspaceGrid, TargetsView_default as TargetsView, ThreadSidebar, TimeDisplay_default as TimeDisplay, TimePickerDropdown, VideoCard, VideoGridView, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, cacheService, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createStreamProxyHandler, createSupabaseClient, createThrottledReload, dashboardService, deleteThread, forceRefreshWorkspaceDisplayNames, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUserThreads, getUserThreadsPaginated, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isLegacyConfiguration, isTransitionPeriod, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetSubscriptionManager, s3VideoPreloader, skuService, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPreloader, whatsappService, withAuth, withRegistry, workspaceService };
34074
+ export { ACTION_NAMES, AIAgentView_default as AIAgentView, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedTargetsView, BarChart, BaseHistoryCalendar, BottlenecksContent, BreakNotificationPopup, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, CycleTimeChart, CycleTimeOverTimeChart, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, EmptyStateMessage, FactoryView_default as FactoryView, GaugeChart, GridComponentsPlaceholder, Header, HelpView_default as HelpView, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, ISTTimer_default as ISTTimer, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend6 as Legend, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LiveTimer, LoadingInline, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSkeleton, LoadingState, LoginPage, LoginView_default as LoginView, MainLayout, MetricCard_default as MetricCard, NoWorkspaceData, OptifyeAgentClient, OptifyeLogoLoader_default as OptifyeLogoLoader, OutputProgressChart, PageHeader, PieChart4 as PieChart, ProfileView_default as ProfileView, RegistryProvider, S3Service, SKUManagementView, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SingleVideoStream_default as SingleVideoStream, Skeleton, SlackAPI, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, TargetWorkspaceGrid, TargetsView_default as TargetsView, ThreadSidebar, TimeDisplay_default as TimeDisplay, TimePickerDropdown, VideoCard, VideoGridView, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, cacheService, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createStreamProxyHandler, createSupabaseClient, createThrottledReload, dashboardService, deleteThread, forceRefreshWorkspaceDisplayNames, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUserThreads, getUserThreadsPaginated, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isLegacyConfiguration, isTransitionPeriod, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetSubscriptionManager, s3VideoPreloader, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPreloader, whatsappService, withAuth, withRegistry, workspaceService };