@optifye/dashboard-core 6.5.5 → 6.5.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.d.mts CHANGED
@@ -387,7 +387,7 @@ interface AuthUser {
387
387
  id: string;
388
388
  email?: string;
389
389
  role?: string;
390
- role_level?: number;
390
+ role_level?: 'owner' | 'plant_head' | 'supervisor' | 'optifye';
391
391
  }
392
392
 
393
393
  /**
@@ -2281,6 +2281,7 @@ interface LineMetrics {
2281
2281
  underperforming_workspace_names: string[];
2282
2282
  underperforming_workspace_uuids: string[];
2283
2283
  output_array: number[];
2284
+ output_hourly?: Record<string, number[]>;
2284
2285
  line_threshold: number;
2285
2286
  threshold_pph: number;
2286
2287
  shift_start: string;
@@ -2790,6 +2791,12 @@ interface UseSKUsReturn {
2790
2791
  }
2791
2792
  declare const useSKUs: (companyId: string) => UseSKUsReturn;
2792
2793
 
2794
+ /**
2795
+ * Hook to check if the current user can save targets
2796
+ * Only users with 'owner' role can save targets
2797
+ */
2798
+ declare const useCanSaveTargets: () => boolean;
2799
+
2793
2800
  interface SupportTicketHistory {
2794
2801
  id: string;
2795
2802
  title: string;
@@ -4319,6 +4326,7 @@ interface HourlyOutputChartProps {
4319
4326
  data: number[];
4320
4327
  pphThreshold: number;
4321
4328
  shiftStart: string;
4329
+ shiftEnd?: string;
4322
4330
  showIdleTime?: boolean;
4323
4331
  idleTimeHourly?: Record<string, string[]>;
4324
4332
  className?: string;
@@ -6184,4 +6192,4 @@ interface ThreadSidebarProps {
6184
6192
  }
6185
6193
  declare const ThreadSidebar: React__default.FC<ThreadSidebarProps>;
6186
6194
 
6187
- export { ACTION_NAMES, AIAgentView, type Action, type ActionName, type ActionService, type ActionThreshold, type ActiveBreak, type AnalyticsConfig, AudioService, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, BackButton, BackButtonMinimal, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, BreakNotificationPopup, type BreakNotificationPopupProps, type BreakRowProps, type CacheEntryWithPrefetch, CachePrefetchStatus, type CachePrefetchStatusCallback, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatThread, type CleanupFunction, type ClipCounts, type ClipCountsWithIndex, CompactWorkspaceHealthCard, type ComponentOverride, CongratulationsOverlay, type CongratulationsOverlayProps, type CoreComponents, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, 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, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, DetailedHealthStatus, EmptyStateMessage, type EmptyStateMessageProps, EncouragementOverlay, type EndpointsConfig, type EntityConfig, type ErrorCallback$1 as ErrorCallback, type ExtendedCacheMetrics, type FactoryOverviewData, FactoryView, type FactoryViewProps, type FormatNumberOptions, type FullyIndexedCallback$1 as FullyIndexedCallback, GaugeChart, type GaugeChartProps, GridComponentsPlaceholder, HamburgerButton, type HamburgerButtonProps, Header, type HeaderProps, type HealthAlertConfig, type HealthAlertHistory, type HealthFilterOptions, type HealthMetrics, type HealthStatus, HealthStatusGrid, HealthStatusIndicator, type HealthSummary, HelpView, type HelpViewProps, type HistoryCalendarProps, HomeView, type HookOverride, type HourlyAchievement, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type IPrefetchManager, type ISTDateProps, ISTTimer, type ISTTimerProps, InlineEditableText, KPICard, type KPICardProps, KPIDetailViewWithDisplayNames as KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, KPIsOverviewView, type KPIsOverviewViewProps, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailViewWithDisplayNames as LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, Legend, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LiveTimer, LoadingInline, LoadingInline as LoadingInlineProps, LoadingOverlay, LoadingPage, LoadingSkeleton, LoadingSkeleton as LoadingSkeletonProps, LoadingState, LoadingState as LoadingStateProps, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, type NavItem, type NavItemTrackingEvent, type NavigationMethod, NoWorkspaceData, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OptifyeLogoLoader, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, PieChart, type PieChartProps, type PoorPerformingWorkspace, PrefetchConfigurationError, PrefetchError, PrefetchEvents, type PrefetchKey, type PrefetchManagerConfig, type PrefetchManagerStats, type PrefetchOptions, type PrefetchParams$1 as PrefetchParams, type PrefetchRequest, type PrefetchResult, PrefetchStatus$1 as PrefetchStatus, type PrefetchStatusResult, type PrefetchSubscriptionCallbacks, PrefetchTimeoutError, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RenderReadyCallback$1 as RenderReadyCallback, type RoutePath, type S3ClipsAPIParams, S3ClipsService, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, type SKU, type SKUConfig, type SKUCreateInput, type SKUListProps, SKUManagementView, type SKUModalProps, type SKUSelectorProps, type SKUUpdateInput, type SOPCategory, SOPComplianceChart, type SOPComplianceChartProps, SSEChatClient, type SSEEvent, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$2 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StatusChangeCallback$1 as StatusChangeCallback, type StreamProxyConfig, type SubscriberId, SubscriptionManager, SubscriptionManagerProvider, type SupabaseClient, SupabaseProvider, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsViewWithDisplayNames as TargetsView, type TargetsViewProps, type ThemeColorValue, type ThemeConfig, ThreadSidebar, TicketHistory, TicketHistoryService, TimeDisplay, TimePickerDropdown, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UptimeDetails, type UseActiveBreaksResult, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseMessagesResult, type UsePrefetchClipCountsOptions$1 as UsePrefetchClipCountsOptions, type UsePrefetchClipCountsResult$1 as UsePrefetchClipCountsResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseThreadsResult, type UseTicketHistoryReturn, type UseWorkspaceOperatorsOptions, type UserProfileConfig, VideoCard, type VideoConfig, type VideoCroppingConfig, type VideoCroppingRect, VideoGridView, type VideoIndex, type VideoIndexEntry, type VideoMetadata, VideoPlayer, type VideoPlayerEventData, type VideoPlayerProps, type VideoPlayerRef, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, type WorkspaceHealth, WorkspaceHealthCard, type WorkspaceHealthInfo, _default as WorkspaceHealthView, type WorkspaceHealthWithStatus, WorkspaceHistoryCalendar, WorkspaceMetricCards, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, 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, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAudioService, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPrefetchManager, videoPreloader, whatsappService, withAuth, withRegistry, workspaceHealthService, workspaceService };
6195
+ export { ACTION_NAMES, AIAgentView, type Action, type ActionName, type ActionService, type ActionThreshold, type ActiveBreak, type AnalyticsConfig, AudioService, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, BackButton, BackButtonMinimal, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, BreakNotificationPopup, type BreakNotificationPopupProps, type BreakRowProps, type CacheEntryWithPrefetch, CachePrefetchStatus, type CachePrefetchStatusCallback, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatThread, type CleanupFunction, type ClipCounts, type ClipCountsWithIndex, CompactWorkspaceHealthCard, type ComponentOverride, CongratulationsOverlay, type CongratulationsOverlayProps, type CoreComponents, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, 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, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, DetailedHealthStatus, EmptyStateMessage, type EmptyStateMessageProps, EncouragementOverlay, type EndpointsConfig, type EntityConfig, type ErrorCallback$1 as ErrorCallback, type ExtendedCacheMetrics, type FactoryOverviewData, FactoryView, type FactoryViewProps, type FormatNumberOptions, type FullyIndexedCallback$1 as FullyIndexedCallback, GaugeChart, type GaugeChartProps, GridComponentsPlaceholder, HamburgerButton, type HamburgerButtonProps, Header, type HeaderProps, type HealthAlertConfig, type HealthAlertHistory, type HealthFilterOptions, type HealthMetrics, type HealthStatus, HealthStatusGrid, HealthStatusIndicator, type HealthSummary, HelpView, type HelpViewProps, type HistoryCalendarProps, HomeView, type HookOverride, type HourlyAchievement, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type IPrefetchManager, type ISTDateProps, ISTTimer, type ISTTimerProps, InlineEditableText, KPICard, type KPICardProps, KPIDetailViewWithDisplayNames as KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, KPIsOverviewView, type KPIsOverviewViewProps, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailViewWithDisplayNames as LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, Legend, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LiveTimer, LoadingInline, LoadingInline as LoadingInlineProps, LoadingOverlay, LoadingPage, LoadingSkeleton, LoadingSkeleton as LoadingSkeletonProps, LoadingState, LoadingState as LoadingStateProps, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, type NavItem, type NavItemTrackingEvent, type NavigationMethod, NoWorkspaceData, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OptifyeLogoLoader, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, PieChart, type PieChartProps, type PoorPerformingWorkspace, PrefetchConfigurationError, PrefetchError, PrefetchEvents, type PrefetchKey, type PrefetchManagerConfig, type PrefetchManagerStats, type PrefetchOptions, type PrefetchParams$1 as PrefetchParams, type PrefetchRequest, type PrefetchResult, PrefetchStatus$1 as PrefetchStatus, type PrefetchStatusResult, type PrefetchSubscriptionCallbacks, PrefetchTimeoutError, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RenderReadyCallback$1 as RenderReadyCallback, type RoutePath, type S3ClipsAPIParams, S3ClipsService, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, type SKU, type SKUConfig, type SKUCreateInput, type SKUListProps, SKUManagementView, type SKUModalProps, type SKUSelectorProps, type SKUUpdateInput, type SOPCategory, SOPComplianceChart, type SOPComplianceChartProps, SSEChatClient, type SSEEvent, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$2 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StatusChangeCallback$1 as StatusChangeCallback, type StreamProxyConfig, type SubscriberId, SubscriptionManager, SubscriptionManagerProvider, type SupabaseClient, SupabaseProvider, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsViewWithDisplayNames as TargetsView, type TargetsViewProps, type ThemeColorValue, type ThemeConfig, ThreadSidebar, TicketHistory, TicketHistoryService, TimeDisplay, TimePickerDropdown, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UptimeDetails, type UseActiveBreaksResult, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseMessagesResult, type UsePrefetchClipCountsOptions$1 as UsePrefetchClipCountsOptions, type UsePrefetchClipCountsResult$1 as UsePrefetchClipCountsResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseThreadsResult, type UseTicketHistoryReturn, type UseWorkspaceOperatorsOptions, type UserProfileConfig, VideoCard, type VideoConfig, type VideoCroppingConfig, type VideoCroppingRect, VideoGridView, type VideoIndex, type VideoIndexEntry, type VideoMetadata, VideoPlayer, type VideoPlayerEventData, type VideoPlayerProps, type VideoPlayerRef, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, type WorkspaceHealth, WorkspaceHealthCard, type WorkspaceHealthInfo, _default as WorkspaceHealthView, type WorkspaceHealthWithStatus, WorkspaceHistoryCalendar, WorkspaceMetricCards, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, 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, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAudioService, useAuth, useAuthConfig, useCanSaveTargets, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPrefetchManager, videoPreloader, whatsappService, withAuth, withRegistry, workspaceHealthService, workspaceService };
package/dist/index.d.ts CHANGED
@@ -387,7 +387,7 @@ interface AuthUser {
387
387
  id: string;
388
388
  email?: string;
389
389
  role?: string;
390
- role_level?: number;
390
+ role_level?: 'owner' | 'plant_head' | 'supervisor' | 'optifye';
391
391
  }
392
392
 
393
393
  /**
@@ -2281,6 +2281,7 @@ interface LineMetrics {
2281
2281
  underperforming_workspace_names: string[];
2282
2282
  underperforming_workspace_uuids: string[];
2283
2283
  output_array: number[];
2284
+ output_hourly?: Record<string, number[]>;
2284
2285
  line_threshold: number;
2285
2286
  threshold_pph: number;
2286
2287
  shift_start: string;
@@ -2790,6 +2791,12 @@ interface UseSKUsReturn {
2790
2791
  }
2791
2792
  declare const useSKUs: (companyId: string) => UseSKUsReturn;
2792
2793
 
2794
+ /**
2795
+ * Hook to check if the current user can save targets
2796
+ * Only users with 'owner' role can save targets
2797
+ */
2798
+ declare const useCanSaveTargets: () => boolean;
2799
+
2793
2800
  interface SupportTicketHistory {
2794
2801
  id: string;
2795
2802
  title: string;
@@ -4319,6 +4326,7 @@ interface HourlyOutputChartProps {
4319
4326
  data: number[];
4320
4327
  pphThreshold: number;
4321
4328
  shiftStart: string;
4329
+ shiftEnd?: string;
4322
4330
  showIdleTime?: boolean;
4323
4331
  idleTimeHourly?: Record<string, string[]>;
4324
4332
  className?: string;
@@ -6184,4 +6192,4 @@ interface ThreadSidebarProps {
6184
6192
  }
6185
6193
  declare const ThreadSidebar: React__default.FC<ThreadSidebarProps>;
6186
6194
 
6187
- export { ACTION_NAMES, AIAgentView, type Action, type ActionName, type ActionService, type ActionThreshold, type ActiveBreak, type AnalyticsConfig, AudioService, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, BackButton, BackButtonMinimal, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, BreakNotificationPopup, type BreakNotificationPopupProps, type BreakRowProps, type CacheEntryWithPrefetch, CachePrefetchStatus, type CachePrefetchStatusCallback, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatThread, type CleanupFunction, type ClipCounts, type ClipCountsWithIndex, CompactWorkspaceHealthCard, type ComponentOverride, CongratulationsOverlay, type CongratulationsOverlayProps, type CoreComponents, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, 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, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, DetailedHealthStatus, EmptyStateMessage, type EmptyStateMessageProps, EncouragementOverlay, type EndpointsConfig, type EntityConfig, type ErrorCallback$1 as ErrorCallback, type ExtendedCacheMetrics, type FactoryOverviewData, FactoryView, type FactoryViewProps, type FormatNumberOptions, type FullyIndexedCallback$1 as FullyIndexedCallback, GaugeChart, type GaugeChartProps, GridComponentsPlaceholder, HamburgerButton, type HamburgerButtonProps, Header, type HeaderProps, type HealthAlertConfig, type HealthAlertHistory, type HealthFilterOptions, type HealthMetrics, type HealthStatus, HealthStatusGrid, HealthStatusIndicator, type HealthSummary, HelpView, type HelpViewProps, type HistoryCalendarProps, HomeView, type HookOverride, type HourlyAchievement, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type IPrefetchManager, type ISTDateProps, ISTTimer, type ISTTimerProps, InlineEditableText, KPICard, type KPICardProps, KPIDetailViewWithDisplayNames as KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, KPIsOverviewView, type KPIsOverviewViewProps, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailViewWithDisplayNames as LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, Legend, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LiveTimer, LoadingInline, LoadingInline as LoadingInlineProps, LoadingOverlay, LoadingPage, LoadingSkeleton, LoadingSkeleton as LoadingSkeletonProps, LoadingState, LoadingState as LoadingStateProps, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, type NavItem, type NavItemTrackingEvent, type NavigationMethod, NoWorkspaceData, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OptifyeLogoLoader, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, PieChart, type PieChartProps, type PoorPerformingWorkspace, PrefetchConfigurationError, PrefetchError, PrefetchEvents, type PrefetchKey, type PrefetchManagerConfig, type PrefetchManagerStats, type PrefetchOptions, type PrefetchParams$1 as PrefetchParams, type PrefetchRequest, type PrefetchResult, PrefetchStatus$1 as PrefetchStatus, type PrefetchStatusResult, type PrefetchSubscriptionCallbacks, PrefetchTimeoutError, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RenderReadyCallback$1 as RenderReadyCallback, type RoutePath, type S3ClipsAPIParams, S3ClipsService, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, type SKU, type SKUConfig, type SKUCreateInput, type SKUListProps, SKUManagementView, type SKUModalProps, type SKUSelectorProps, type SKUUpdateInput, type SOPCategory, SOPComplianceChart, type SOPComplianceChartProps, SSEChatClient, type SSEEvent, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$2 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StatusChangeCallback$1 as StatusChangeCallback, type StreamProxyConfig, type SubscriberId, SubscriptionManager, SubscriptionManagerProvider, type SupabaseClient, SupabaseProvider, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsViewWithDisplayNames as TargetsView, type TargetsViewProps, type ThemeColorValue, type ThemeConfig, ThreadSidebar, TicketHistory, TicketHistoryService, TimeDisplay, TimePickerDropdown, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UptimeDetails, type UseActiveBreaksResult, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseMessagesResult, type UsePrefetchClipCountsOptions$1 as UsePrefetchClipCountsOptions, type UsePrefetchClipCountsResult$1 as UsePrefetchClipCountsResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseThreadsResult, type UseTicketHistoryReturn, type UseWorkspaceOperatorsOptions, type UserProfileConfig, VideoCard, type VideoConfig, type VideoCroppingConfig, type VideoCroppingRect, VideoGridView, type VideoIndex, type VideoIndexEntry, type VideoMetadata, VideoPlayer, type VideoPlayerEventData, type VideoPlayerProps, type VideoPlayerRef, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, type WorkspaceHealth, WorkspaceHealthCard, type WorkspaceHealthInfo, _default as WorkspaceHealthView, type WorkspaceHealthWithStatus, WorkspaceHistoryCalendar, WorkspaceMetricCards, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, 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, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAudioService, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPrefetchManager, videoPreloader, whatsappService, withAuth, withRegistry, workspaceHealthService, workspaceService };
6195
+ export { ACTION_NAMES, AIAgentView, type Action, type ActionName, type ActionService, type ActionThreshold, type ActiveBreak, type AnalyticsConfig, AudioService, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, BackButton, BackButtonMinimal, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, BreakNotificationPopup, type BreakNotificationPopupProps, type BreakRowProps, type CacheEntryWithPrefetch, CachePrefetchStatus, type CachePrefetchStatusCallback, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatThread, type CleanupFunction, type ClipCounts, type ClipCountsWithIndex, CompactWorkspaceHealthCard, type ComponentOverride, CongratulationsOverlay, type CongratulationsOverlayProps, type CoreComponents, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, 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, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, DetailedHealthStatus, EmptyStateMessage, type EmptyStateMessageProps, EncouragementOverlay, type EndpointsConfig, type EntityConfig, type ErrorCallback$1 as ErrorCallback, type ExtendedCacheMetrics, type FactoryOverviewData, FactoryView, type FactoryViewProps, type FormatNumberOptions, type FullyIndexedCallback$1 as FullyIndexedCallback, GaugeChart, type GaugeChartProps, GridComponentsPlaceholder, HamburgerButton, type HamburgerButtonProps, Header, type HeaderProps, type HealthAlertConfig, type HealthAlertHistory, type HealthFilterOptions, type HealthMetrics, type HealthStatus, HealthStatusGrid, HealthStatusIndicator, type HealthSummary, HelpView, type HelpViewProps, type HistoryCalendarProps, HomeView, type HookOverride, type HourlyAchievement, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type IPrefetchManager, type ISTDateProps, ISTTimer, type ISTTimerProps, InlineEditableText, KPICard, type KPICardProps, KPIDetailViewWithDisplayNames as KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, KPIsOverviewView, type KPIsOverviewViewProps, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailViewWithDisplayNames as LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, Legend, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LiveTimer, LoadingInline, LoadingInline as LoadingInlineProps, LoadingOverlay, LoadingPage, LoadingSkeleton, LoadingSkeleton as LoadingSkeletonProps, LoadingState, LoadingState as LoadingStateProps, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, type NavItem, type NavItemTrackingEvent, type NavigationMethod, NoWorkspaceData, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OptifyeLogoLoader, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, PieChart, type PieChartProps, type PoorPerformingWorkspace, PrefetchConfigurationError, PrefetchError, PrefetchEvents, type PrefetchKey, type PrefetchManagerConfig, type PrefetchManagerStats, type PrefetchOptions, type PrefetchParams$1 as PrefetchParams, type PrefetchRequest, type PrefetchResult, PrefetchStatus$1 as PrefetchStatus, type PrefetchStatusResult, type PrefetchSubscriptionCallbacks, PrefetchTimeoutError, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RenderReadyCallback$1 as RenderReadyCallback, type RoutePath, type S3ClipsAPIParams, S3ClipsService, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, type SKU, type SKUConfig, type SKUCreateInput, type SKUListProps, SKUManagementView, type SKUModalProps, type SKUSelectorProps, type SKUUpdateInput, type SOPCategory, SOPComplianceChart, type SOPComplianceChartProps, SSEChatClient, type SSEEvent, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$2 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StatusChangeCallback$1 as StatusChangeCallback, type StreamProxyConfig, type SubscriberId, SubscriptionManager, SubscriptionManagerProvider, type SupabaseClient, SupabaseProvider, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsViewWithDisplayNames as TargetsView, type TargetsViewProps, type ThemeColorValue, type ThemeConfig, ThreadSidebar, TicketHistory, TicketHistoryService, TimeDisplay, TimePickerDropdown, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UptimeDetails, type UseActiveBreaksResult, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseMessagesResult, type UsePrefetchClipCountsOptions$1 as UsePrefetchClipCountsOptions, type UsePrefetchClipCountsResult$1 as UsePrefetchClipCountsResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseThreadsResult, type UseTicketHistoryReturn, type UseWorkspaceOperatorsOptions, type UserProfileConfig, VideoCard, type VideoConfig, type VideoCroppingConfig, type VideoCroppingRect, VideoGridView, type VideoIndex, type VideoIndexEntry, type VideoMetadata, VideoPlayer, type VideoPlayerEventData, type VideoPlayerProps, type VideoPlayerRef, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, type WorkspaceHealth, WorkspaceHealthCard, type WorkspaceHealthInfo, _default as WorkspaceHealthView, type WorkspaceHealthWithStatus, WorkspaceHistoryCalendar, WorkspaceMetricCards, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, 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, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAudioService, useAuth, useAuthConfig, useCanSaveTargets, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPrefetchManager, videoPreloader, whatsappService, withAuth, withRegistry, workspaceHealthService, workspaceService };
package/dist/index.js CHANGED
@@ -893,15 +893,19 @@ var dashboardService = {
893
893
  const shiftStart = data.shift_start || (isNightShift ? "22:00" : "06:00");
894
894
  const shiftEnd = data.shift_end || (isNightShift ? "06:00" : "14:00");
895
895
  const startHour = parseInt(shiftStart.split(":")[0]);
896
+ const startMinute = parseInt(shiftStart.split(":")[1] || "0");
897
+ const endHour = parseInt(shiftEnd.split(":")[0]);
898
+ const endMinute = parseInt(shiftEnd.split(":")[1] || "0");
899
+ let shiftDuration = endHour - startHour;
900
+ if (endMinute > startMinute) {
901
+ shiftDuration += 1;
902
+ }
903
+ if (shiftDuration <= 0) {
904
+ shiftDuration += 24;
905
+ }
896
906
  let expectedHours = [];
897
- if (isNightShift) {
898
- for (let i = 0; i < 9; i++) {
899
- expectedHours.push((startHour + i) % 24);
900
- }
901
- } else {
902
- for (let i = 0; i < 9; i++) {
903
- expectedHours.push((startHour + i) % 24);
904
- }
907
+ for (let i = 0; i < shiftDuration; i++) {
908
+ expectedHours.push((startHour + i) % 24);
905
909
  }
906
910
  console.log("Expected shift hours:", expectedHours);
907
911
  console.log("Available data hours:", Object.keys(outputHourly));
@@ -5702,15 +5706,19 @@ var useWorkspaceDetailedMetrics = (workspaceId, date, shiftId) => {
5702
5706
  const shiftStart = recentData.shift_start || (isNightShift ? "22:00" : "06:00");
5703
5707
  const shiftEnd = recentData.shift_end || (isNightShift ? "06:00" : "14:00");
5704
5708
  const startHour = parseInt(shiftStart.split(":")[0]);
5709
+ const startMinute = parseInt(shiftStart.split(":")[1] || "0");
5710
+ const endHour = parseInt(shiftEnd.split(":")[0]);
5711
+ const endMinute = parseInt(shiftEnd.split(":")[1] || "0");
5712
+ let shiftDuration = endHour - startHour;
5713
+ if (endMinute > startMinute) {
5714
+ shiftDuration += 1;
5715
+ }
5716
+ if (shiftDuration <= 0) {
5717
+ shiftDuration += 24;
5718
+ }
5705
5719
  let expectedHours = [];
5706
- if (isNightShift) {
5707
- for (let i = 0; i < 9; i++) {
5708
- expectedHours.push((startHour + i) % 24);
5709
- }
5710
- } else {
5711
- for (let i = 0; i < 9; i++) {
5712
- expectedHours.push((startHour + i) % 24);
5713
- }
5720
+ for (let i = 0; i < shiftDuration; i++) {
5721
+ expectedHours.push((startHour + i) % 24);
5714
5722
  }
5715
5723
  console.log("Expected shift hours (fallback):", expectedHours);
5716
5724
  console.log("Available data hours (fallback):", Object.keys(outputHourly2));
@@ -5814,15 +5822,19 @@ var useWorkspaceDetailedMetrics = (workspaceId, date, shiftId) => {
5814
5822
  const shiftStart = data.shift_start || (isNightShift ? "22:00" : "06:00");
5815
5823
  const shiftEnd = data.shift_end || (isNightShift ? "06:00" : "14:00");
5816
5824
  const startHour = parseInt(shiftStart.split(":")[0]);
5825
+ const startMinute = parseInt(shiftStart.split(":")[1] || "0");
5826
+ const endHour = parseInt(shiftEnd.split(":")[0]);
5827
+ const endMinute = parseInt(shiftEnd.split(":")[1] || "0");
5828
+ let shiftDuration = endHour - startHour;
5829
+ if (endMinute > startMinute) {
5830
+ shiftDuration += 1;
5831
+ }
5832
+ if (shiftDuration <= 0) {
5833
+ shiftDuration += 24;
5834
+ }
5817
5835
  let expectedHours = [];
5818
- if (isNightShift) {
5819
- for (let i = 0; i < 9; i++) {
5820
- expectedHours.push((startHour + i) % 24);
5821
- }
5822
- } else {
5823
- for (let i = 0; i < 9; i++) {
5824
- expectedHours.push((startHour + i) % 24);
5825
- }
5836
+ for (let i = 0; i < shiftDuration; i++) {
5837
+ expectedHours.push((startHour + i) % 24);
5826
5838
  }
5827
5839
  console.log("Expected shift hours:", expectedHours);
5828
5840
  console.log("Available data hours:", Object.keys(outputHourly));
@@ -8602,6 +8614,12 @@ var useSKUs = (companyId) => {
8602
8614
  refetch: fetchSKUs
8603
8615
  };
8604
8616
  };
8617
+
8618
+ // src/lib/hooks/useCanSaveTargets.ts
8619
+ var useCanSaveTargets = () => {
8620
+ const { user } = useAuth();
8621
+ return user?.role_level === "owner";
8622
+ };
8605
8623
  function useTicketHistory(companyId) {
8606
8624
  const [tickets, setTickets] = React19.useState([]);
8607
8625
  const [loading, setLoading] = React19.useState(false);
@@ -21240,6 +21258,7 @@ var HourlyOutputChartComponent = ({
21240
21258
  data,
21241
21259
  pphThreshold,
21242
21260
  shiftStart,
21261
+ shiftEnd,
21243
21262
  showIdleTime = false,
21244
21263
  idleTimeHourly,
21245
21264
  className = ""
@@ -21254,10 +21273,32 @@ var HourlyOutputChartComponent = ({
21254
21273
  return { hour, minute, decimalHour };
21255
21274
  };
21256
21275
  const shiftStartTime = getTimeFromTimeString(shiftStart);
21257
- const SHIFT_DURATION = 11;
21258
- const [animatedData, setAnimatedData] = React19__namespace.default.useState(Array(SHIFT_DURATION).fill(0));
21276
+ const calculateShiftDuration = React19__namespace.default.useMemo(() => {
21277
+ if (!shiftEnd) {
21278
+ return 11;
21279
+ }
21280
+ const endTime = getTimeFromTimeString(shiftEnd);
21281
+ let duration = endTime.decimalHour - shiftStartTime.decimalHour;
21282
+ if (duration <= 0) {
21283
+ duration += 24;
21284
+ }
21285
+ return Math.round(duration);
21286
+ }, [shiftEnd, shiftStartTime.decimalHour]);
21287
+ const SHIFT_DURATION = calculateShiftDuration;
21288
+ const [animatedData, setAnimatedData] = React19__namespace.default.useState(
21289
+ () => Array(SHIFT_DURATION).fill(0)
21290
+ );
21259
21291
  const prevDataRef = React19__namespace.default.useRef(Array(SHIFT_DURATION).fill(0));
21260
21292
  const animationFrameRef = React19__namespace.default.useRef(null);
21293
+ React19__namespace.default.useEffect(() => {
21294
+ setAnimatedData((prev) => {
21295
+ if (prev.length !== SHIFT_DURATION) {
21296
+ return Array(SHIFT_DURATION).fill(0);
21297
+ }
21298
+ return prev;
21299
+ });
21300
+ prevDataRef.current = Array(SHIFT_DURATION).fill(0);
21301
+ }, [SHIFT_DURATION]);
21261
21302
  const [idleBarState, setIdleBarState] = React19__namespace.default.useState({
21262
21303
  visible: showIdleTime,
21263
21304
  key: 0,
@@ -33811,7 +33852,8 @@ var BottomSection = React19.memo(({
33811
33852
  {
33812
33853
  data: hourlyOutputData,
33813
33854
  pphThreshold: hourlyThreshold,
33814
- shiftStart: lineInfo.metrics.shift_start || "06:00"
33855
+ shiftStart: lineInfo.metrics.shift_start || "06:00",
33856
+ shiftEnd: lineInfo.metrics.shift_end
33815
33857
  }
33816
33858
  ) })
33817
33859
  ] })
@@ -34061,14 +34103,40 @@ var KPIDetailView = ({
34061
34103
  };
34062
34104
  }, [metrics2, lineDetails, companyId]);
34063
34105
  const hourlyOutputData = React19.useMemo(() => {
34064
- if (!metrics2 || !metrics2.output_array) return [];
34065
- return metrics2.output_array.reduce((acc, val, i) => {
34066
- const hourIndex = Math.floor(i / 60);
34067
- if (!acc[hourIndex]) acc[hourIndex] = 0;
34068
- acc[hourIndex] += val;
34069
- return acc;
34070
- }, []);
34071
- }, [metrics2?.output_array]);
34106
+ if (!metrics2) return [];
34107
+ if (metrics2.output_hourly && Object.keys(metrics2.output_hourly).length > 0) {
34108
+ console.log("Using new output_hourly format in KPIDetailView");
34109
+ const isNightShift = metrics2.shift_id === 1;
34110
+ const shiftStart = metrics2.shift_start || (isNightShift ? "22:00" : "06:00");
34111
+ const shiftEnd = metrics2.shift_end || (isNightShift ? "06:00" : "14:00");
34112
+ const startHour = parseInt(shiftStart.split(":")[0]);
34113
+ const endHour = parseInt(shiftEnd.split(":")[0]);
34114
+ let shiftDuration = endHour - startHour;
34115
+ if (shiftDuration <= 0) {
34116
+ shiftDuration += 24;
34117
+ }
34118
+ let expectedHours = [];
34119
+ for (let i = 0; i < shiftDuration; i++) {
34120
+ expectedHours.push((startHour + i) % 24);
34121
+ }
34122
+ return expectedHours.map((hour) => {
34123
+ const hourData = metrics2.output_hourly[hour.toString()];
34124
+ if (hourData && Array.isArray(hourData)) {
34125
+ return hourData.reduce((sum, val) => sum + (val || 0), 0);
34126
+ }
34127
+ return 0;
34128
+ });
34129
+ }
34130
+ if (metrics2.output_array) {
34131
+ return metrics2.output_array.reduce((acc, val, i) => {
34132
+ const hourIndex = Math.floor(i / 60);
34133
+ if (!acc[hourIndex]) acc[hourIndex] = 0;
34134
+ acc[hourIndex] += val;
34135
+ return acc;
34136
+ }, []);
34137
+ }
34138
+ return [];
34139
+ }, [metrics2]);
34072
34140
  const hourlyThreshold = React19.useMemo(() => metrics2 ? metrics2.threshold_pph || 0 : 0, [metrics2]);
34073
34141
  const sortedByEfficiency = React19.useMemo(() => {
34074
34142
  if (!workspaces) return [];
@@ -37007,6 +37075,7 @@ var TargetsViewUI = ({
37007
37075
  isBulkConfigureOpen,
37008
37076
  navItems = [],
37009
37077
  currentPathname = "/targets",
37078
+ canSaveTargets = true,
37010
37079
  onBack,
37011
37080
  onToggleLineDropdown,
37012
37081
  onUpdateProductId,
@@ -37126,9 +37195,10 @@ var TargetsViewUI = ({
37126
37195
  "button",
37127
37196
  {
37128
37197
  onClick: () => onSaveLine(lineId),
37129
- disabled: savingLines[lineId],
37198
+ disabled: savingLines[lineId] || !canSaveTargets,
37199
+ title: !canSaveTargets ? "You do not have permission to save targets" : "",
37130
37200
  className: `inline-flex items-center px-3 sm:px-4 py-1.5 sm:py-2 text-xs sm:text-sm font-medium rounded-lg transition-all duration-200
37131
- ${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"}`,
37201
+ ${savingLines[lineId] || !canSaveTargets ? "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"}`,
37132
37202
  children: savingLines[lineId] ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
37133
37203
  /* @__PURE__ */ jsxRuntime.jsx(OptifyeLogoLoader_default, { size: "sm", className: "mr-1.5 sm:mr-2" }),
37134
37204
  "Saving..."
@@ -37414,6 +37484,7 @@ var TargetsView = ({
37414
37484
  const [isBulkConfigureOpen, setIsBulkConfigureOpen] = React19.useState(false);
37415
37485
  const [selectedWorkspaces, setSelectedWorkspaces] = React19.useState([]);
37416
37486
  const [selectedShift, setSelectedShift] = React19.useState(0);
37487
+ const canSaveTargets = useCanSaveTargets();
37417
37488
  const [dbValues, setDbValues] = React19.useState({ 0: {}, 1: {} });
37418
37489
  const [userEditedFields, setUserEditedFields] = React19.useState(/* @__PURE__ */ new Set());
37419
37490
  const lineWorkspaces = allShiftsData[selectedShift] || initialLineWorkspaces;
@@ -37880,6 +37951,10 @@ var TargetsView = ({
37880
37951
  }, [actionIds]);
37881
37952
  const handleSaveLine = React19.useCallback(async (lineId) => {
37882
37953
  console.log(`[handleSaveLine] Attempting to save line: ${lineId}`);
37954
+ if (!canSaveTargets) {
37955
+ sonner.toast.error("You do not have permission to save targets. Contact your administrator.");
37956
+ return;
37957
+ }
37883
37958
  const hardcodedUserId = "6bf6f271-1e55-4a95-9b89-1c3820b58739";
37884
37959
  const currentEffectiveUserId = hardcodedUserId;
37885
37960
  console.log(`[handleSaveLine] effectiveUserId: ${currentEffectiveUserId}`);
@@ -37988,7 +38063,7 @@ var TargetsView = ({
37988
38063
  setSavingLines((prev) => ({ ...prev, [lineId]: false }));
37989
38064
  console.log(`[handleSaveLine] Set savingLines to false for ${lineId} in finally block`);
37990
38065
  }
37991
- }, [supabase, lineWorkspaces, selectedShift, lineNames, onSaveChanges, skuEnabled, dashboardConfig]);
38066
+ }, [canSaveTargets, supabase, lineWorkspaces, selectedShift, lineNames, onSaveChanges, skuEnabled, dashboardConfig]);
37992
38067
  const handleBulkConfigure = async (updates) => {
37993
38068
  if (!actionIds) return;
37994
38069
  if (updates.productId !== void 0) {
@@ -38054,6 +38129,7 @@ var TargetsView = ({
38054
38129
  isBulkConfigureOpen,
38055
38130
  navItems: [],
38056
38131
  currentPathname: "/targets",
38132
+ canSaveTargets,
38057
38133
  onBack: handleNavigateBack,
38058
38134
  onToggleLineDropdown: toggleLineDropdown,
38059
38135
  onUpdateProductId: updateProductId,
@@ -38714,6 +38790,7 @@ var WorkspaceDetailView = ({
38714
38790
  data: workspace.hourly_action_counts || [],
38715
38791
  pphThreshold: workspace.pph_threshold || 0,
38716
38792
  shiftStart: workspace.shift_start || "",
38793
+ shiftEnd: workspace.shift_end,
38717
38794
  showIdleTime,
38718
38795
  idleTimeHourly: workspace.idle_time_hourly
38719
38796
  }
@@ -38832,6 +38909,7 @@ var WorkspaceDetailView = ({
38832
38909
  data: workspace.hourly_action_counts || [],
38833
38910
  pphThreshold: workspace.pph_threshold || 0,
38834
38911
  shiftStart: workspace.shift_start || "",
38912
+ shiftEnd: workspace.shift_end,
38835
38913
  showIdleTime,
38836
38914
  idleTimeHourly: workspace.idle_time_hourly
38837
38915
  }
@@ -40131,6 +40209,7 @@ exports.useAnalyticsConfig = useAnalyticsConfig;
40131
40209
  exports.useAudioService = useAudioService;
40132
40210
  exports.useAuth = useAuth;
40133
40211
  exports.useAuthConfig = useAuthConfig;
40212
+ exports.useCanSaveTargets = useCanSaveTargets;
40134
40213
  exports.useComponentOverride = useComponentOverride;
40135
40214
  exports.useCustomConfig = useCustomConfig;
40136
40215
  exports.useDashboardConfig = useDashboardConfig;
package/dist/index.mjs CHANGED
@@ -863,15 +863,19 @@ var dashboardService = {
863
863
  const shiftStart = data.shift_start || (isNightShift ? "22:00" : "06:00");
864
864
  const shiftEnd = data.shift_end || (isNightShift ? "06:00" : "14:00");
865
865
  const startHour = parseInt(shiftStart.split(":")[0]);
866
+ const startMinute = parseInt(shiftStart.split(":")[1] || "0");
867
+ const endHour = parseInt(shiftEnd.split(":")[0]);
868
+ const endMinute = parseInt(shiftEnd.split(":")[1] || "0");
869
+ let shiftDuration = endHour - startHour;
870
+ if (endMinute > startMinute) {
871
+ shiftDuration += 1;
872
+ }
873
+ if (shiftDuration <= 0) {
874
+ shiftDuration += 24;
875
+ }
866
876
  let expectedHours = [];
867
- if (isNightShift) {
868
- for (let i = 0; i < 9; i++) {
869
- expectedHours.push((startHour + i) % 24);
870
- }
871
- } else {
872
- for (let i = 0; i < 9; i++) {
873
- expectedHours.push((startHour + i) % 24);
874
- }
877
+ for (let i = 0; i < shiftDuration; i++) {
878
+ expectedHours.push((startHour + i) % 24);
875
879
  }
876
880
  console.log("Expected shift hours:", expectedHours);
877
881
  console.log("Available data hours:", Object.keys(outputHourly));
@@ -5672,15 +5676,19 @@ var useWorkspaceDetailedMetrics = (workspaceId, date, shiftId) => {
5672
5676
  const shiftStart = recentData.shift_start || (isNightShift ? "22:00" : "06:00");
5673
5677
  const shiftEnd = recentData.shift_end || (isNightShift ? "06:00" : "14:00");
5674
5678
  const startHour = parseInt(shiftStart.split(":")[0]);
5679
+ const startMinute = parseInt(shiftStart.split(":")[1] || "0");
5680
+ const endHour = parseInt(shiftEnd.split(":")[0]);
5681
+ const endMinute = parseInt(shiftEnd.split(":")[1] || "0");
5682
+ let shiftDuration = endHour - startHour;
5683
+ if (endMinute > startMinute) {
5684
+ shiftDuration += 1;
5685
+ }
5686
+ if (shiftDuration <= 0) {
5687
+ shiftDuration += 24;
5688
+ }
5675
5689
  let expectedHours = [];
5676
- if (isNightShift) {
5677
- for (let i = 0; i < 9; i++) {
5678
- expectedHours.push((startHour + i) % 24);
5679
- }
5680
- } else {
5681
- for (let i = 0; i < 9; i++) {
5682
- expectedHours.push((startHour + i) % 24);
5683
- }
5690
+ for (let i = 0; i < shiftDuration; i++) {
5691
+ expectedHours.push((startHour + i) % 24);
5684
5692
  }
5685
5693
  console.log("Expected shift hours (fallback):", expectedHours);
5686
5694
  console.log("Available data hours (fallback):", Object.keys(outputHourly2));
@@ -5784,15 +5792,19 @@ var useWorkspaceDetailedMetrics = (workspaceId, date, shiftId) => {
5784
5792
  const shiftStart = data.shift_start || (isNightShift ? "22:00" : "06:00");
5785
5793
  const shiftEnd = data.shift_end || (isNightShift ? "06:00" : "14:00");
5786
5794
  const startHour = parseInt(shiftStart.split(":")[0]);
5795
+ const startMinute = parseInt(shiftStart.split(":")[1] || "0");
5796
+ const endHour = parseInt(shiftEnd.split(":")[0]);
5797
+ const endMinute = parseInt(shiftEnd.split(":")[1] || "0");
5798
+ let shiftDuration = endHour - startHour;
5799
+ if (endMinute > startMinute) {
5800
+ shiftDuration += 1;
5801
+ }
5802
+ if (shiftDuration <= 0) {
5803
+ shiftDuration += 24;
5804
+ }
5787
5805
  let expectedHours = [];
5788
- if (isNightShift) {
5789
- for (let i = 0; i < 9; i++) {
5790
- expectedHours.push((startHour + i) % 24);
5791
- }
5792
- } else {
5793
- for (let i = 0; i < 9; i++) {
5794
- expectedHours.push((startHour + i) % 24);
5795
- }
5806
+ for (let i = 0; i < shiftDuration; i++) {
5807
+ expectedHours.push((startHour + i) % 24);
5796
5808
  }
5797
5809
  console.log("Expected shift hours:", expectedHours);
5798
5810
  console.log("Available data hours:", Object.keys(outputHourly));
@@ -8572,6 +8584,12 @@ var useSKUs = (companyId) => {
8572
8584
  refetch: fetchSKUs
8573
8585
  };
8574
8586
  };
8587
+
8588
+ // src/lib/hooks/useCanSaveTargets.ts
8589
+ var useCanSaveTargets = () => {
8590
+ const { user } = useAuth();
8591
+ return user?.role_level === "owner";
8592
+ };
8575
8593
  function useTicketHistory(companyId) {
8576
8594
  const [tickets, setTickets] = useState([]);
8577
8595
  const [loading, setLoading] = useState(false);
@@ -21210,6 +21228,7 @@ var HourlyOutputChartComponent = ({
21210
21228
  data,
21211
21229
  pphThreshold,
21212
21230
  shiftStart,
21231
+ shiftEnd,
21213
21232
  showIdleTime = false,
21214
21233
  idleTimeHourly,
21215
21234
  className = ""
@@ -21224,10 +21243,32 @@ var HourlyOutputChartComponent = ({
21224
21243
  return { hour, minute, decimalHour };
21225
21244
  };
21226
21245
  const shiftStartTime = getTimeFromTimeString(shiftStart);
21227
- const SHIFT_DURATION = 11;
21228
- const [animatedData, setAnimatedData] = React19__default.useState(Array(SHIFT_DURATION).fill(0));
21246
+ const calculateShiftDuration = React19__default.useMemo(() => {
21247
+ if (!shiftEnd) {
21248
+ return 11;
21249
+ }
21250
+ const endTime = getTimeFromTimeString(shiftEnd);
21251
+ let duration = endTime.decimalHour - shiftStartTime.decimalHour;
21252
+ if (duration <= 0) {
21253
+ duration += 24;
21254
+ }
21255
+ return Math.round(duration);
21256
+ }, [shiftEnd, shiftStartTime.decimalHour]);
21257
+ const SHIFT_DURATION = calculateShiftDuration;
21258
+ const [animatedData, setAnimatedData] = React19__default.useState(
21259
+ () => Array(SHIFT_DURATION).fill(0)
21260
+ );
21229
21261
  const prevDataRef = React19__default.useRef(Array(SHIFT_DURATION).fill(0));
21230
21262
  const animationFrameRef = React19__default.useRef(null);
21263
+ React19__default.useEffect(() => {
21264
+ setAnimatedData((prev) => {
21265
+ if (prev.length !== SHIFT_DURATION) {
21266
+ return Array(SHIFT_DURATION).fill(0);
21267
+ }
21268
+ return prev;
21269
+ });
21270
+ prevDataRef.current = Array(SHIFT_DURATION).fill(0);
21271
+ }, [SHIFT_DURATION]);
21231
21272
  const [idleBarState, setIdleBarState] = React19__default.useState({
21232
21273
  visible: showIdleTime,
21233
21274
  key: 0,
@@ -33781,7 +33822,8 @@ var BottomSection = memo(({
33781
33822
  {
33782
33823
  data: hourlyOutputData,
33783
33824
  pphThreshold: hourlyThreshold,
33784
- shiftStart: lineInfo.metrics.shift_start || "06:00"
33825
+ shiftStart: lineInfo.metrics.shift_start || "06:00",
33826
+ shiftEnd: lineInfo.metrics.shift_end
33785
33827
  }
33786
33828
  ) })
33787
33829
  ] })
@@ -34031,14 +34073,40 @@ var KPIDetailView = ({
34031
34073
  };
34032
34074
  }, [metrics2, lineDetails, companyId]);
34033
34075
  const hourlyOutputData = useMemo(() => {
34034
- if (!metrics2 || !metrics2.output_array) return [];
34035
- return metrics2.output_array.reduce((acc, val, i) => {
34036
- const hourIndex = Math.floor(i / 60);
34037
- if (!acc[hourIndex]) acc[hourIndex] = 0;
34038
- acc[hourIndex] += val;
34039
- return acc;
34040
- }, []);
34041
- }, [metrics2?.output_array]);
34076
+ if (!metrics2) return [];
34077
+ if (metrics2.output_hourly && Object.keys(metrics2.output_hourly).length > 0) {
34078
+ console.log("Using new output_hourly format in KPIDetailView");
34079
+ const isNightShift = metrics2.shift_id === 1;
34080
+ const shiftStart = metrics2.shift_start || (isNightShift ? "22:00" : "06:00");
34081
+ const shiftEnd = metrics2.shift_end || (isNightShift ? "06:00" : "14:00");
34082
+ const startHour = parseInt(shiftStart.split(":")[0]);
34083
+ const endHour = parseInt(shiftEnd.split(":")[0]);
34084
+ let shiftDuration = endHour - startHour;
34085
+ if (shiftDuration <= 0) {
34086
+ shiftDuration += 24;
34087
+ }
34088
+ let expectedHours = [];
34089
+ for (let i = 0; i < shiftDuration; i++) {
34090
+ expectedHours.push((startHour + i) % 24);
34091
+ }
34092
+ return expectedHours.map((hour) => {
34093
+ const hourData = metrics2.output_hourly[hour.toString()];
34094
+ if (hourData && Array.isArray(hourData)) {
34095
+ return hourData.reduce((sum, val) => sum + (val || 0), 0);
34096
+ }
34097
+ return 0;
34098
+ });
34099
+ }
34100
+ if (metrics2.output_array) {
34101
+ return metrics2.output_array.reduce((acc, val, i) => {
34102
+ const hourIndex = Math.floor(i / 60);
34103
+ if (!acc[hourIndex]) acc[hourIndex] = 0;
34104
+ acc[hourIndex] += val;
34105
+ return acc;
34106
+ }, []);
34107
+ }
34108
+ return [];
34109
+ }, [metrics2]);
34042
34110
  const hourlyThreshold = useMemo(() => metrics2 ? metrics2.threshold_pph || 0 : 0, [metrics2]);
34043
34111
  const sortedByEfficiency = useMemo(() => {
34044
34112
  if (!workspaces) return [];
@@ -36977,6 +37045,7 @@ var TargetsViewUI = ({
36977
37045
  isBulkConfigureOpen,
36978
37046
  navItems = [],
36979
37047
  currentPathname = "/targets",
37048
+ canSaveTargets = true,
36980
37049
  onBack,
36981
37050
  onToggleLineDropdown,
36982
37051
  onUpdateProductId,
@@ -37096,9 +37165,10 @@ var TargetsViewUI = ({
37096
37165
  "button",
37097
37166
  {
37098
37167
  onClick: () => onSaveLine(lineId),
37099
- disabled: savingLines[lineId],
37168
+ disabled: savingLines[lineId] || !canSaveTargets,
37169
+ title: !canSaveTargets ? "You do not have permission to save targets" : "",
37100
37170
  className: `inline-flex items-center px-3 sm:px-4 py-1.5 sm:py-2 text-xs sm:text-sm font-medium rounded-lg transition-all duration-200
37101
- ${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"}`,
37171
+ ${savingLines[lineId] || !canSaveTargets ? "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"}`,
37102
37172
  children: savingLines[lineId] ? /* @__PURE__ */ jsxs(Fragment, { children: [
37103
37173
  /* @__PURE__ */ jsx(OptifyeLogoLoader_default, { size: "sm", className: "mr-1.5 sm:mr-2" }),
37104
37174
  "Saving..."
@@ -37384,6 +37454,7 @@ var TargetsView = ({
37384
37454
  const [isBulkConfigureOpen, setIsBulkConfigureOpen] = useState(false);
37385
37455
  const [selectedWorkspaces, setSelectedWorkspaces] = useState([]);
37386
37456
  const [selectedShift, setSelectedShift] = useState(0);
37457
+ const canSaveTargets = useCanSaveTargets();
37387
37458
  const [dbValues, setDbValues] = useState({ 0: {}, 1: {} });
37388
37459
  const [userEditedFields, setUserEditedFields] = useState(/* @__PURE__ */ new Set());
37389
37460
  const lineWorkspaces = allShiftsData[selectedShift] || initialLineWorkspaces;
@@ -37850,6 +37921,10 @@ var TargetsView = ({
37850
37921
  }, [actionIds]);
37851
37922
  const handleSaveLine = useCallback(async (lineId) => {
37852
37923
  console.log(`[handleSaveLine] Attempting to save line: ${lineId}`);
37924
+ if (!canSaveTargets) {
37925
+ toast.error("You do not have permission to save targets. Contact your administrator.");
37926
+ return;
37927
+ }
37853
37928
  const hardcodedUserId = "6bf6f271-1e55-4a95-9b89-1c3820b58739";
37854
37929
  const currentEffectiveUserId = hardcodedUserId;
37855
37930
  console.log(`[handleSaveLine] effectiveUserId: ${currentEffectiveUserId}`);
@@ -37958,7 +38033,7 @@ var TargetsView = ({
37958
38033
  setSavingLines((prev) => ({ ...prev, [lineId]: false }));
37959
38034
  console.log(`[handleSaveLine] Set savingLines to false for ${lineId} in finally block`);
37960
38035
  }
37961
- }, [supabase, lineWorkspaces, selectedShift, lineNames, onSaveChanges, skuEnabled, dashboardConfig]);
38036
+ }, [canSaveTargets, supabase, lineWorkspaces, selectedShift, lineNames, onSaveChanges, skuEnabled, dashboardConfig]);
37962
38037
  const handleBulkConfigure = async (updates) => {
37963
38038
  if (!actionIds) return;
37964
38039
  if (updates.productId !== void 0) {
@@ -38024,6 +38099,7 @@ var TargetsView = ({
38024
38099
  isBulkConfigureOpen,
38025
38100
  navItems: [],
38026
38101
  currentPathname: "/targets",
38102
+ canSaveTargets,
38027
38103
  onBack: handleNavigateBack,
38028
38104
  onToggleLineDropdown: toggleLineDropdown,
38029
38105
  onUpdateProductId: updateProductId,
@@ -38684,6 +38760,7 @@ var WorkspaceDetailView = ({
38684
38760
  data: workspace.hourly_action_counts || [],
38685
38761
  pphThreshold: workspace.pph_threshold || 0,
38686
38762
  shiftStart: workspace.shift_start || "",
38763
+ shiftEnd: workspace.shift_end,
38687
38764
  showIdleTime,
38688
38765
  idleTimeHourly: workspace.idle_time_hourly
38689
38766
  }
@@ -38802,6 +38879,7 @@ var WorkspaceDetailView = ({
38802
38879
  data: workspace.hourly_action_counts || [],
38803
38880
  pphThreshold: workspace.pph_threshold || 0,
38804
38881
  shiftStart: workspace.shift_start || "",
38882
+ shiftEnd: workspace.shift_end,
38805
38883
  showIdleTime,
38806
38884
  idleTimeHourly: workspace.idle_time_hourly
38807
38885
  }
@@ -39838,4 +39916,4 @@ var streamProxyConfig = {
39838
39916
  }
39839
39917
  };
39840
39918
 
39841
- export { ACTION_NAMES, AIAgentView_default as AIAgentView, AudioService, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, BackButton, BackButtonMinimal, BarChart, BaseHistoryCalendar, BottlenecksContent, BreakNotificationPopup, CachePrefetchStatus, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, CompactWorkspaceHealthCard, CongratulationsOverlay, 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, DetailedHealthStatus, EmptyStateMessage, EncouragementOverlay, FactoryView_default as FactoryView, GaugeChart, GridComponentsPlaceholder, HamburgerButton, Header, HealthStatusGrid, HealthStatusIndicator, HelpView_default as HelpView, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, ISTTimer_default as ISTTimer, InlineEditableText, 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, PrefetchConfigurationError, PrefetchError, PrefetchEvents, PrefetchStatus, PrefetchTimeoutError, ProfileView_default as ProfileView, RegistryProvider, S3ClipsService, 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, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, TargetWorkspaceGrid, TargetsView_default as TargetsView, ThreadSidebar, TicketHistory_default as TicketHistory, TicketHistoryService, TimeDisplay_default as TimeDisplay, TimePickerDropdown, VideoCard, VideoGridView, VideoPlayer, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHealthCard, WorkspaceHealthView_default as WorkspaceHealthView, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, 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, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAudioService, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPrefetchManager, videoPreloader, whatsappService, withAuth, withRegistry, workspaceHealthService, workspaceService };
39919
+ export { ACTION_NAMES, AIAgentView_default as AIAgentView, AudioService, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, BackButton, BackButtonMinimal, BarChart, BaseHistoryCalendar, BottlenecksContent, BreakNotificationPopup, CachePrefetchStatus, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, CompactWorkspaceHealthCard, CongratulationsOverlay, 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, DetailedHealthStatus, EmptyStateMessage, EncouragementOverlay, FactoryView_default as FactoryView, GaugeChart, GridComponentsPlaceholder, HamburgerButton, Header, HealthStatusGrid, HealthStatusIndicator, HelpView_default as HelpView, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, ISTTimer_default as ISTTimer, InlineEditableText, 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, PrefetchConfigurationError, PrefetchError, PrefetchEvents, PrefetchStatus, PrefetchTimeoutError, ProfileView_default as ProfileView, RegistryProvider, S3ClipsService, 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, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, TargetWorkspaceGrid, TargetsView_default as TargetsView, ThreadSidebar, TicketHistory_default as TicketHistory, TicketHistoryService, TimeDisplay_default as TimeDisplay, TimePickerDropdown, VideoCard, VideoGridView, VideoPlayer, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHealthCard, WorkspaceHealthView_default as WorkspaceHealthView, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, 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, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAudioService, useAuth, useAuthConfig, useCanSaveTargets, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPrefetchManager, videoPreloader, whatsappService, withAuth, withRegistry, workspaceHealthService, workspaceService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.5.5",
3
+ "version": "6.5.7",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",