@burdenoff/microfe-adaptercloud 2026.614.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +12 -0
  2. package/dist/adaptercloud/AdapterCloudRoot.js +177 -0
  3. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -0
  4. package/dist/adaptercloud/AdapterCloudRoutes.js +215 -0
  5. package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -0
  6. package/dist/adaptercloud/components/EmptyState.js +28 -0
  7. package/dist/adaptercloud/components/EmptyState.js.map +1 -0
  8. package/dist/adaptercloud/components/InvestmentCard.js +96 -0
  9. package/dist/adaptercloud/components/InvestmentCard.js.map +1 -0
  10. package/dist/adaptercloud/components/MetricsCard.js +46 -0
  11. package/dist/adaptercloud/components/MetricsCard.js.map +1 -0
  12. package/dist/adaptercloud/components/PageLayout.js +26 -0
  13. package/dist/adaptercloud/components/PageLayout.js.map +1 -0
  14. package/dist/adaptercloud/components/RatingDisplay.js +35 -0
  15. package/dist/adaptercloud/components/RatingDisplay.js.map +1 -0
  16. package/dist/adaptercloud/components/StatusBadge.js +45 -0
  17. package/dist/adaptercloud/components/StatusBadge.js.map +1 -0
  18. package/dist/adaptercloud/context/AdapterCloudContext.js +93 -0
  19. package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -0
  20. package/dist/adaptercloud/context/index.js +1 -0
  21. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -0
  22. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -0
  23. package/dist/adaptercloud/index.js +7 -0
  24. package/dist/adaptercloud/mocks/data.js +1517 -0
  25. package/dist/adaptercloud/mocks/data.js.map +1 -0
  26. package/dist/adaptercloud/mocks/users.js +34 -0
  27. package/dist/adaptercloud/mocks/users.js.map +1 -0
  28. package/dist/adaptercloud/pages/HomePage.js +921 -0
  29. package/dist/adaptercloud/pages/HomePage.js.map +1 -0
  30. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +645 -0
  31. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -0
  32. package/dist/adaptercloud/pages/admin/AdminDashboard.js +639 -0
  33. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -0
  34. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +421 -0
  35. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -0
  36. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +660 -0
  37. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -0
  38. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +259 -0
  39. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -0
  40. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +649 -0
  41. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -0
  42. package/dist/adaptercloud/pages/admin/CartManagementPage.js +869 -0
  43. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -0
  44. package/dist/adaptercloud/pages/admin/UserManagementPage.js +893 -0
  45. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -0
  46. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +834 -0
  47. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -0
  48. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +700 -0
  49. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -0
  50. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +760 -0
  51. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -0
  52. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +886 -0
  53. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -0
  54. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +631 -0
  55. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -0
  56. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +913 -0
  57. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -0
  58. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +881 -0
  59. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -0
  60. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +833 -0
  61. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -0
  62. package/dist/adaptercloud/pages/common/HelpSupportPage.js +1325 -0
  63. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -0
  64. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +665 -0
  65. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -0
  66. package/dist/adaptercloud/pages/common/SettingsPage.js +964 -0
  67. package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -0
  68. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +593 -0
  69. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -0
  70. package/dist/adaptercloud/pages/customer/CartDetailPage.js +620 -0
  71. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -0
  72. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +547 -0
  73. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -0
  74. package/dist/adaptercloud/pages/customer/CheckoutPage.js +532 -0
  75. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -0
  76. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +496 -0
  77. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -0
  78. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +621 -0
  79. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -0
  80. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +623 -0
  81. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -0
  82. package/dist/adaptercloud/pages/customer/FavoritesPage.js +477 -0
  83. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -0
  84. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +438 -0
  85. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -0
  86. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +388 -0
  87. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -0
  88. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +488 -0
  89. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -0
  90. package/dist/adaptercloud/pages/customer/ReviewsPage.js +606 -0
  91. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -0
  92. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +443 -0
  93. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -0
  94. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +849 -0
  95. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -0
  96. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +939 -0
  97. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -0
  98. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +681 -0
  99. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -0
  100. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +419 -0
  101. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -0
  102. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +399 -0
  103. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -0
  104. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +569 -0
  105. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -0
  106. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +1065 -0
  107. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -0
  108. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +496 -0
  109. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -0
  110. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +634 -0
  111. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -0
  112. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +675 -0
  113. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -0
  114. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +687 -0
  115. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -0
  116. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +578 -0
  117. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -0
  118. package/dist/adaptercloud/store/adaptercloudStore.js +38 -0
  119. package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -0
  120. package/dist/adaptercloud/store/index.js +1 -0
  121. package/dist/adaptercloud/utils/cn.js +10 -0
  122. package/dist/adaptercloud/utils/cn.js.map +1 -0
  123. package/dist/adaptercloud/utils/formatters.js +51 -0
  124. package/dist/adaptercloud/utils/formatters.js.map +1 -0
  125. package/dist/adaptercloud/utils/navigation.js +9 -0
  126. package/dist/adaptercloud/utils/navigation.js.map +1 -0
  127. package/dist/index.js +7 -0
  128. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
  129. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  130. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  131. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  132. package/package.json +106 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DirectServiceBookingPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/customer/DirectServiceBookingPage.tsx"],"sourcesContent":["/**\n * Direct Service Booking Page\n * @module adaptercloud/pages/customer\n *\n * 4-step wizard: Location > Details > Payment > Confirmation.\n * Progress indicator, step validation, geolocation button,\n * address fields, preferred time slot selector (30-min slots),\n * urgent booking checkbox, payment method selection,\n * payment summary, confirmation step with checkmark/IDs/next steps.\n */\n\nimport { useState, useMemo } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n ArrowRight,\n MapPin,\n Calendar,\n Clock,\n CreditCard,\n Smartphone,\n Wallet,\n CheckCircle2,\n AlertCircle,\n Navigation,\n Phone,\n Home,\n Loader2,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { getCartById } from '../../mocks/data';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency } from '../../utils/formatters';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype Step = 'location' | 'details' | 'payment' | 'confirmation';\nconst STEPS: Step[] = ['location', 'details', 'payment', 'confirmation'];\nconst STEP_LABELS: Record<Step, string> = {\n location: 'Location',\n details: 'Details',\n payment: 'Payment',\n confirmation: 'Confirmation',\n};\n\ninterface ServiceLocation {\n address: string;\n landmark: string;\n instructions: string;\n phoneNumber: string;\n}\n\ninterface BookingDetails {\n preferredTime: string;\n specialInstructions: string;\n isUrgent: boolean;\n}\n\ninterface ConfirmationData {\n bookingId: string;\n transactionId: string;\n estimatedArrival: string;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction generateTimeSlots(): { value: string; label: string }[] {\n const slots: { value: string; label: string }[] = [];\n const now = new Date();\n const start = new Date(now.getTime() + 30 * 60000); // 30 min from now\n\n for (let i = 0; i < 8; i++) {\n const time = new Date(start.getTime() + i * 30 * 60000);\n const val = time.toTimeString().slice(0, 5);\n const lbl = time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n slots.push({ value: val, label: lbl });\n }\n\n return slots;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function DirectServiceBookingPage() {\n const { cartId } = useParams<{ cartId: string }>();\n const { navigateTo } = useAdapterCloud();\n\n const cart = useMemo(() => (cartId ? getCartById(cartId) : undefined), [cartId]);\n\n const [step, setStep] = useState<Step>('location');\n const [submitting, setSubmitting] = useState(false);\n\n // Location step\n const [location, setLocation] = useState<ServiceLocation>({\n address: '',\n landmark: '',\n instructions: '',\n phoneNumber: '',\n });\n\n // Details step\n const [details, setDetails] = useState<BookingDetails>({\n preferredTime: '',\n specialInstructions: '',\n isUrgent: false,\n });\n\n // Payment step\n const [paymentMethod, setPaymentMethod] = useState<'upi' | 'card' | 'wallet'>('upi');\n\n // Confirmation data\n const [confirmation, setConfirmation] = useState<ConfirmationData | null>(null);\n\n // Mock pricing\n const advancePayment = 100;\n const serviceFee = 50;\n const balancePayment = serviceFee;\n const totalAmount = advancePayment + serviceFee;\n\n // --- Not found ---\n if (!cart) {\n return (\n <PageLayout title=\"Cart Not Found\">\n <EmptyState\n icon={<Home className=\"h-12 w-12\" />}\n title=\"Service not available\"\n description=\"Direct service is not available for this cart.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Browse Carts\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n const timeSlots = generateTimeSlots();\n const stepIndex = STEPS.indexOf(step);\n\n // --- Geolocation ---\n const handleGetLocation = () => {\n if (!navigator.geolocation) {\n alert('Geolocation is not supported by this browser.');\n return;\n }\n navigator.geolocation.getCurrentPosition(\n () => {\n setLocation((p) => ({ ...p, address: p.address || 'Current location detected' }));\n alert('Location detected successfully!');\n },\n () => {\n alert('Failed to get your location. Please enter address manually.');\n }\n );\n };\n\n // --- Validation ---\n const validateLocation = (): boolean => {\n if (!location.address.trim()) {\n alert('Please enter your address.');\n return false;\n }\n if (!location.phoneNumber.trim()) {\n alert('Please enter your phone number.');\n return false;\n }\n return true;\n };\n\n const validateDetails = (): boolean => {\n if (!details.preferredTime) {\n alert('Please select a preferred time slot.');\n return false;\n }\n return true;\n };\n\n // --- Navigation ---\n const nextStep = () => {\n if (step === 'location' && validateLocation()) setStep('details');\n else if (step === 'details' && validateDetails()) setStep('payment');\n else if (step === 'payment') handleBookingSubmit();\n };\n\n const prevStep = () => {\n if (step === 'details') setStep('location');\n else if (step === 'payment') setStep('details');\n };\n\n // --- Submit ---\n const handleBookingSubmit = () => {\n setSubmitting(true);\n setTimeout(() => {\n const bookingId = `BK-${Date.now()}`;\n const transactionId = `TXN-${Date.now()}`;\n const estimatedArrival = new Date(Date.now() + 30 * 60000).toISOString();\n setConfirmation({ bookingId, transactionId, estimatedArrival });\n setStep('confirmation');\n setSubmitting(false);\n }, 1500);\n };\n\n return (\n <PageLayout\n title={\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground transition-colors\"\n >\n <ArrowLeft className=\"h-5 w-5\" />\n </button>\n <div>\n <span>Book Direct Service</span>\n <p className=\"text-xs font-normal text-muted-foreground\">{cart.name}</p>\n </div>\n </div>\n }\n >\n {/* Progress Indicator */}\n <div className=\"flex items-center justify-between mb-6 px-2\">\n {STEPS.map((s, i) => {\n const isCompleted = i < stepIndex;\n const isCurrent = s === step;\n return (\n <div key={s} className=\"flex items-center\">\n <div className=\"flex flex-col items-center\">\n <div\n className={cn(\n 'flex h-8 w-8 items-center justify-center rounded-full text-xs font-medium',\n isCompleted\n ? 'bg-green-500/20 text-green-600 dark:text-green-400'\n : isCurrent\n ? 'bg-foreground text-background'\n : 'bg-muted text-muted-foreground'\n )}\n >\n {isCompleted ? <CheckCircle2 className=\"h-4 w-4\" /> : i + 1}\n </div>\n <span\n className={cn(\n 'mt-1 text-[10px]',\n isCurrent ? 'font-medium text-foreground' : 'text-muted-foreground'\n )}\n >\n {STEP_LABELS[s]}\n </span>\n </div>\n {i < STEPS.length - 1 && (\n <div\n className={cn(\n 'mx-2 h-0.5 w-8 sm:w-16',\n isCompleted ? 'bg-green-500/30' : 'bg-border'\n )}\n />\n )}\n </div>\n );\n })}\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n {/* Main Content */}\n <div className=\"lg:col-span-2\">\n {/* Step 1: Location */}\n {step === 'location' && (\n <div className=\"rounded-lg border border-border bg-card p-5\">\n <h2 className=\"text-base font-semibold text-foreground mb-1 flex items-center gap-2\">\n <MapPin className=\"h-4 w-4\" />\n Service Location\n </h2>\n <p className=\"text-xs text-muted-foreground mb-5\">Where should the cart come?</p>\n\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1.5\">\n Your Address <span className=\"text-red-500\">*</span>\n </label>\n <div className=\"flex gap-2\">\n <input\n type=\"text\"\n placeholder=\"Enter your full address\"\n value={location.address}\n onChange={(e) => setLocation((p) => ({ ...p, address: e.target.value }))}\n className=\"flex-1 rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n <button\n type=\"button\"\n onClick={handleGetLocation}\n className=\"flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-xs font-medium text-foreground hover:bg-accent transition-colors whitespace-nowrap\"\n >\n <Navigation className=\"h-3.5 w-3.5\" />\n Use Current Location\n </button>\n </div>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1.5\">\n Nearby Landmark\n </label>\n <input\n type=\"text\"\n placeholder=\"e.g., Near Metro Station, Opposite Mall\"\n value={location.landmark}\n onChange={(e) => setLocation((p) => ({ ...p, landmark: e.target.value }))}\n className=\"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1.5\">\n Instructions for Cart Owner\n </label>\n <textarea\n rows={3}\n placeholder=\"Any specific instructions to help us find you...\"\n value={location.instructions}\n onChange={(e) => setLocation((p) => ({ ...p, instructions: e.target.value }))}\n className=\"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none\"\n />\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1.5\">\n Phone Number <span className=\"text-red-500\">*</span>\n </label>\n <div className=\"relative\">\n <Phone className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <input\n type=\"tel\"\n placeholder=\"Enter your phone number\"\n value={location.phoneNumber}\n onChange={(e) => setLocation((p) => ({ ...p, phoneNumber: e.target.value }))}\n className=\"w-full rounded-lg border border-border bg-card py-2 pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Step 2: Details */}\n {step === 'details' && (\n <div className=\"rounded-lg border border-border bg-card p-5\">\n <h2 className=\"text-base font-semibold text-foreground mb-1 flex items-center gap-2\">\n <Calendar className=\"h-4 w-4\" />\n Booking Details\n </h2>\n <p className=\"text-xs text-muted-foreground mb-5\">Choose your preferred timing</p>\n\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1.5\">\n Preferred Time Slot <span className=\"text-red-500\">*</span>\n </label>\n <div className=\"grid grid-cols-4 gap-2\">\n {timeSlots.map((slot) => (\n <button\n key={slot.value}\n type=\"button\"\n onClick={() => setDetails((p) => ({ ...p, preferredTime: slot.value }))}\n className={cn(\n 'rounded-lg border py-2 px-2 text-xs font-medium transition-colors',\n details.preferredTime === slot.value\n ? 'border-foreground bg-accent text-foreground'\n : 'border-border text-muted-foreground hover:bg-accent hover:text-foreground'\n )}\n >\n {slot.label}\n </button>\n ))}\n </div>\n </div>\n\n <div>\n <label className=\"block text-sm font-medium text-foreground mb-1.5\">\n Special Instructions\n </label>\n <textarea\n rows={3}\n placeholder=\"Any special requests or dietary preferences...\"\n value={details.specialInstructions}\n onChange={(e) =>\n setDetails((p) => ({ ...p, specialInstructions: e.target.value }))\n }\n className=\"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none\"\n />\n </div>\n\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={details.isUrgent}\n onChange={(e) => setDetails((p) => ({ ...p, isUrgent: e.target.checked }))}\n className=\"h-4 w-4 rounded border-border\"\n />\n <span className=\"text-sm text-muted-foreground\">\n This is urgent (additional charges may apply)\n </span>\n </label>\n </div>\n </div>\n )}\n\n {/* Step 3: Payment */}\n {step === 'payment' && (\n <div className=\"rounded-lg border border-border bg-card p-5\">\n <h2 className=\"text-base font-semibold text-foreground mb-1 flex items-center gap-2\">\n <CreditCard className=\"h-4 w-4\" />\n Advance Payment\n </h2>\n <p className=\"text-xs text-muted-foreground mb-5\">Select your payment method</p>\n\n <div className=\"space-y-4\">\n {/* Info callout */}\n <div className=\"flex items-start gap-2 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3\">\n <AlertCircle className=\"h-4 w-4 text-blue-600 dark:text-blue-400 shrink-0 mt-0.5\" />\n <p className=\"text-xs text-blue-700 dark:text-blue-300\">\n You need to pay {formatCurrency(advancePayment, { minimumFractionDigits: 0 })}{' '}\n in advance to confirm your booking. Pay the remaining when the cart arrives.\n </p>\n </div>\n\n {/* Payment methods */}\n <div className=\"grid grid-cols-1 sm:grid-cols-3 gap-3\">\n {[\n {\n value: 'upi' as const,\n label: 'UPI',\n sub: 'Instant payment',\n Icon: Smartphone,\n },\n {\n value: 'card' as const,\n label: 'Card',\n sub: 'Secure payment',\n Icon: CreditCard,\n },\n {\n value: 'wallet' as const,\n label: 'Wallet',\n sub: 'Quick payment',\n Icon: Wallet,\n },\n ].map(({ value, label, sub, Icon }) => (\n <button\n key={value}\n type=\"button\"\n onClick={() => setPaymentMethod(value)}\n className={cn(\n 'rounded-lg border p-3 text-center transition-colors',\n paymentMethod === value\n ? 'border-foreground bg-accent'\n : 'border-border hover:bg-accent'\n )}\n >\n <Icon className=\"mx-auto h-5 w-5 text-muted-foreground mb-1\" />\n <p className=\"text-sm font-medium text-foreground\">{label}</p>\n <p className=\"text-[10px] text-muted-foreground\">{sub}</p>\n </button>\n ))}\n </div>\n\n {/* Payment Summary */}\n <div className=\"rounded-lg bg-muted p-4\">\n <h3 className=\"text-sm font-medium text-foreground mb-2\">Payment Summary</h3>\n <div className=\"space-y-2 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Advance Payment:</span>\n <span className=\"text-foreground\">\n {formatCurrency(advancePayment, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Service Fee:</span>\n <span className=\"text-foreground\">\n {formatCurrency(serviceFee, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between text-muted-foreground\">\n <span>Balance Payment (at arrival):</span>\n <span>{formatCurrency(balancePayment, { minimumFractionDigits: 0 })}</span>\n </div>\n <div className=\"flex justify-between border-t border-border pt-2 font-semibold\">\n <span className=\"text-foreground\">Total Amount:</span>\n <span className=\"text-foreground\">\n {formatCurrency(totalAmount, { minimumFractionDigits: 0 })}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Step 4: Confirmation */}\n {step === 'confirmation' && confirmation && (\n <div className=\"rounded-lg border border-border bg-card p-5\">\n {/* Success header */}\n <div className=\"text-center mb-6\">\n <div className=\"mx-auto mb-3 flex h-14 w-14 items-center justify-center rounded-full bg-green-500/10\">\n <CheckCircle2 className=\"h-7 w-7 text-green-600 dark:text-green-400\" />\n </div>\n <h2 className=\"text-lg font-semibold text-foreground mb-1\">Booking Confirmed!</h2>\n <p className=\"text-sm text-muted-foreground\">\n Your direct service booking has been confirmed and payment processed.\n </p>\n </div>\n\n {/* Booking details */}\n <div className=\"rounded-lg bg-muted p-4 mb-4\">\n <h3 className=\"text-sm font-medium text-foreground mb-3\">Booking Details</h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm\">\n <div>\n <span className=\"text-xs text-muted-foreground\">Booking ID</span>\n <p className=\"font-mono text-xs text-foreground\">{confirmation.bookingId}</p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Est. Arrival</span>\n <p className=\"text-foreground\">\n {new Date(confirmation.estimatedArrival).toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n })}\n </p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Location</span>\n <p className=\"text-foreground truncate\">{location.address}</p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Phone</span>\n <p className=\"text-foreground\">{location.phoneNumber}</p>\n </div>\n </div>\n </div>\n\n {/* Payment details */}\n <div className=\"rounded-lg border border-green-500/20 bg-green-500/5 p-4 mb-4\">\n <h3 className=\"text-sm font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4\" />\n Payment Processed\n </h3>\n <div className=\"grid grid-cols-2 gap-3 text-sm\">\n <div>\n <span className=\"text-xs text-muted-foreground\">Transaction ID</span>\n <p className=\"font-mono text-xs text-foreground\">\n {confirmation.transactionId}\n </p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Advance Paid</span>\n <p className=\"font-medium text-foreground\">\n {formatCurrency(advancePayment, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Method</span>\n <p className=\"capitalize text-foreground\">{paymentMethod}</p>\n </div>\n <div>\n <span className=\"text-xs text-muted-foreground\">Status</span>\n <p className=\"font-medium text-green-600 dark:text-green-400\">Paid</p>\n </div>\n </div>\n </div>\n\n {/* Next Steps */}\n <div className=\"rounded-lg border border-blue-500/20 bg-blue-500/5 p-4 mb-6\">\n <h3 className=\"text-sm font-medium text-blue-600 dark:text-blue-400 mb-2\">\n Next Steps\n </h3>\n <div className=\"space-y-2 text-xs text-blue-700 dark:text-blue-300\">\n <div className=\"flex items-start gap-2\">\n <CheckCircle2 className=\"h-3.5 w-3.5 text-green-600 mt-0.5 shrink-0\" />\n <span>\n Payment confirmed -{' '}\n {formatCurrency(advancePayment, { minimumFractionDigits: 0 })} paid\n </span>\n </div>\n <div className=\"flex items-start gap-2\">\n <Clock className=\"h-3.5 w-3.5 mt-0.5 shrink-0\" />\n <span>\n Cart will arrive around{' '}\n {new Date(confirmation.estimatedArrival).toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n })}\n </span>\n </div>\n <div className=\"flex items-start gap-2\">\n <CreditCard className=\"h-3.5 w-3.5 mt-0.5 shrink-0\" />\n <span>\n Pay remaining {formatCurrency(balancePayment, { minimumFractionDigits: 0 })}{' '}\n when cart arrives\n </span>\n </div>\n </div>\n </div>\n\n {/* Action buttons */}\n <div className=\"flex gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/bookings/${confirmation.bookingId}`)}\n className=\"flex-1 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n View Booking\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"flex-1 rounded-lg border border-border px-4 py-2.5 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n Browse More\n </button>\n </div>\n </div>\n )}\n\n {/* Navigation Buttons */}\n {step !== 'confirmation' && (\n <div className=\"flex justify-between mt-5\">\n <button\n type=\"button\"\n onClick={prevStep}\n disabled={step === 'location'}\n className={cn(\n 'flex items-center gap-2 rounded-lg border border-border px-4 py-2.5 text-sm font-medium text-foreground transition-colors',\n step === 'location' ? 'opacity-40 cursor-not-allowed' : 'hover:bg-accent'\n )}\n >\n <ArrowLeft className=\"h-4 w-4\" />\n Previous\n </button>\n <button\n type=\"button\"\n onClick={nextStep}\n disabled={submitting}\n className={cn(\n 'flex items-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background transition-opacity',\n submitting ? 'opacity-60 cursor-not-allowed' : 'hover:opacity-90'\n )}\n >\n {submitting ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n {step === 'payment' ? 'Processing Payment...' : 'Processing...'}\n </>\n ) : (\n <>\n {step === 'payment' ? 'Confirm & Pay' : 'Next'}\n <ArrowRight className=\"h-4 w-4\" />\n </>\n )}\n </button>\n </div>\n )}\n </div>\n\n {/* Sidebar: Service Summary */}\n <div className=\"lg:col-span-1\">\n <div className=\"sticky top-6 rounded-lg border border-border bg-card p-5\">\n <h3 className=\"text-base font-semibold text-foreground mb-4\">Service Summary</h3>\n\n <div className=\"flex items-center gap-3 mb-4\">\n <img src={cart.image} alt={cart.name} className=\"h-12 w-12 rounded-lg object-cover\" />\n <div>\n <p className=\"text-sm font-medium text-foreground\">{cart.name}</p>\n <p className=\"text-xs text-muted-foreground\">{cart.category}</p>\n </div>\n </div>\n\n <div className=\"space-y-2 text-sm border-t border-border pt-3\">\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Service Fee:</span>\n <span className=\"text-foreground\">\n {formatCurrency(serviceFee, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Advance Payment:</span>\n <span className=\"font-medium text-foreground\">\n {formatCurrency(advancePayment, { minimumFractionDigits: 0 })}\n </span>\n </div>\n </div>\n\n <div className=\"flex items-center gap-2 mt-3 pt-3 border-t border-border text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3.5 w-3.5\" />\n <span className=\"text-xs\">Pay remaining amount at cart</span>\n </div>\n </div>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AAyCA,IAAM,IAAgB;CAAC;CAAY;CAAW;CA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;kBAAU;QAAmC,CAAA,CACzD;;MACF;;IACF,CAAA,CACF;KACK"}
@@ -0,0 +1,477 @@
1
+ import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
2
+ import { cn as t } from "../../utils/cn.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { EmptyState as r } from "../../components/EmptyState.js";
5
+ import { useOrders as i, useProviders as a } from "../../hooks/useAdapterCloudApi.js";
6
+ import { formatCurrency as o, formatDate as s } from "../../utils/formatters.js";
7
+ import { useCallback as c, useState as l } from "react";
8
+ import { Clock as u, Heart as d, Leaf as f, RotateCcw as p, Search as m, ShoppingCart as h, Star as g, Utensils as _, X as v } from "lucide-react";
9
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
10
+ //#region src/adaptercloud/pages/customer/FavoritesPage.tsx
11
+ function x() {
12
+ let { navigateTo: x, currentUser: S } = e(), { data: C = [], isLoading: w } = a(), { data: T = [], isLoading: E } = i({ customerId: S?.id }), D = C.slice(0, 2).map((e) => ({
13
+ id: e.id,
14
+ name: e.name,
15
+ description: "Authentic services from AdapterCloud",
16
+ category: e.category,
17
+ image: e.image,
18
+ rating: e.rating,
19
+ reviewCount: e.totalRatings,
20
+ isOpen: e.isOpen,
21
+ isVerified: e.isVerified || !1,
22
+ distance: e.distance,
23
+ estimatedTime: e.estimatedTime,
24
+ addedToFavorites: (/* @__PURE__ */ new Date()).toISOString(),
25
+ totalOrders: T.filter((t) => t.cartId === e.id).length,
26
+ totalSpent: T.filter((t) => t.cartId === e.id).reduce((e, t) => e + t.total, 0)
27
+ })), O = [{
28
+ id: "prod-001",
29
+ name: "Masala Dosa",
30
+ description: "Crispy rice crepe with spiced potato filling",
31
+ price: 120,
32
+ category: "South Indian",
33
+ image: "https://images.unsplash.com/photo-1630383249896-424e482df921?w=300",
34
+ cartId: C[0]?.id || "FOOD-001",
35
+ cartName: C[0]?.name || "Dosa Express",
36
+ isVegetarian: !0,
37
+ isVegan: !1,
38
+ preparationTime: 15,
39
+ rating: 4.7,
40
+ addedToFavorites: "2024-02-20T12:30:00Z",
41
+ orderCount: 8
42
+ }], [k, A] = l({
43
+ searchQuery: "",
44
+ type: "all",
45
+ category: "",
46
+ sortBy: "recent"
47
+ }), j = w || E, { carts: M, products: N } = c(() => {
48
+ let e = [...D], t = [...O];
49
+ if (k.searchQuery) {
50
+ let n = k.searchQuery.toLowerCase();
51
+ e = e.filter((e) => e.name.toLowerCase().includes(n) || e.description.toLowerCase().includes(n) || e.category.toLowerCase().includes(n)), t = t.filter((e) => e.name.toLowerCase().includes(n) || e.description.toLowerCase().includes(n) || e.category.toLowerCase().includes(n) || e.cartName.toLowerCase().includes(n));
52
+ }
53
+ switch (k.category && (e = e.filter((e) => e.category === k.category), t = t.filter((e) => e.category === k.category)), k.sortBy) {
54
+ case "recent":
55
+ e.sort((e, t) => new Date(t.addedToFavorites).getTime() - new Date(e.addedToFavorites).getTime()), t.sort((e, t) => new Date(t.addedToFavorites).getTime() - new Date(e.addedToFavorites).getTime());
56
+ break;
57
+ case "name":
58
+ e.sort((e, t) => e.name.localeCompare(t.name)), t.sort((e, t) => e.name.localeCompare(t.name));
59
+ break;
60
+ case "rating":
61
+ e.sort((e, t) => t.rating - e.rating), t.sort((e, t) => t.rating - e.rating);
62
+ break;
63
+ case "orders":
64
+ e.sort((e, t) => t.totalOrders - e.totalOrders), t.sort((e, t) => t.orderCount - e.orderCount);
65
+ break;
66
+ }
67
+ return k.type === "carts" ? {
68
+ carts: e,
69
+ products: []
70
+ } : k.type === "products" ? {
71
+ carts: [],
72
+ products: t
73
+ } : {
74
+ carts: e,
75
+ products: t
76
+ };
77
+ }, [
78
+ D,
79
+ O,
80
+ k
81
+ ])(), P = (e) => {
82
+ console.log("Remove cart:", e);
83
+ }, F = (e) => {
84
+ console.log("Remove product:", e);
85
+ }, I = D.reduce((e, t) => e + t.totalSpent, 0) + O.reduce((e, t) => e + t.price * t.orderCount, 0);
86
+ return j ? /* @__PURE__ */ y(n, {
87
+ title: "My Favorites",
88
+ children: /* @__PURE__ */ y("div", {
89
+ className: "flex items-center justify-center py-20",
90
+ children: /* @__PURE__ */ y("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-foreground" })
91
+ })
92
+ }) : /* @__PURE__ */ b(n, {
93
+ title: "My Favorites",
94
+ description: `${D.length} carts, ${O.length} products`,
95
+ children: [
96
+ /* @__PURE__ */ b("div", {
97
+ className: "flex flex-wrap items-center gap-4 text-sm text-muted-foreground mb-6",
98
+ children: [
99
+ /* @__PURE__ */ b("span", {
100
+ className: "flex items-center gap-1.5",
101
+ children: [
102
+ /* @__PURE__ */ y(h, { className: "h-3.5 w-3.5" }),
103
+ D.length,
104
+ " carts"
105
+ ]
106
+ }),
107
+ /* @__PURE__ */ b("span", {
108
+ className: "flex items-center gap-1.5",
109
+ children: [
110
+ /* @__PURE__ */ y(_, { className: "h-3.5 w-3.5" }),
111
+ O.length,
112
+ " products"
113
+ ]
114
+ }),
115
+ /* @__PURE__ */ b("span", {
116
+ className: "flex items-center gap-1.5",
117
+ children: [
118
+ /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" }),
119
+ "Total saved: ",
120
+ o(I, { minimumFractionDigits: 0 })
121
+ ]
122
+ })
123
+ ]
124
+ }),
125
+ /* @__PURE__ */ y("div", {
126
+ className: "rounded-lg border border-border bg-card p-4 mb-6",
127
+ children: /* @__PURE__ */ b("div", {
128
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
129
+ children: [
130
+ /* @__PURE__ */ b("div", {
131
+ className: "relative",
132
+ children: [/* @__PURE__ */ y(m, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ y("input", {
133
+ type: "text",
134
+ placeholder: "Search favorites...",
135
+ value: k.searchQuery,
136
+ onChange: (e) => A((t) => ({
137
+ ...t,
138
+ searchQuery: e.target.value
139
+ })),
140
+ className: "w-full rounded-lg border border-border bg-card py-2 pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
141
+ })]
142
+ }),
143
+ /* @__PURE__ */ b("select", {
144
+ value: k.type,
145
+ onChange: (e) => A((t) => ({
146
+ ...t,
147
+ type: e.target.value
148
+ })),
149
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
150
+ children: [
151
+ /* @__PURE__ */ y("option", {
152
+ value: "all",
153
+ children: "All Favorites"
154
+ }),
155
+ /* @__PURE__ */ y("option", {
156
+ value: "carts",
157
+ children: "Favorite Carts"
158
+ }),
159
+ /* @__PURE__ */ y("option", {
160
+ value: "products",
161
+ children: "Favorite Products"
162
+ })
163
+ ]
164
+ }),
165
+ /* @__PURE__ */ b("select", {
166
+ value: k.category,
167
+ onChange: (e) => A((t) => ({
168
+ ...t,
169
+ category: e.target.value
170
+ })),
171
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
172
+ children: [
173
+ /* @__PURE__ */ y("option", {
174
+ value: "",
175
+ children: "All Categories"
176
+ }),
177
+ /* @__PURE__ */ y("option", {
178
+ value: "Food & Beverage",
179
+ children: "Food & Beverage"
180
+ }),
181
+ /* @__PURE__ */ y("option", {
182
+ value: "Street Food",
183
+ children: "Street Food"
184
+ }),
185
+ /* @__PURE__ */ y("option", {
186
+ value: "South Indian",
187
+ children: "South Indian"
188
+ }),
189
+ /* @__PURE__ */ y("option", {
190
+ value: "Beverages",
191
+ children: "Beverages"
192
+ })
193
+ ]
194
+ }),
195
+ /* @__PURE__ */ b("select", {
196
+ value: k.sortBy,
197
+ onChange: (e) => A((t) => ({
198
+ ...t,
199
+ sortBy: e.target.value
200
+ })),
201
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
202
+ children: [
203
+ /* @__PURE__ */ y("option", {
204
+ value: "recent",
205
+ children: "Recently Added"
206
+ }),
207
+ /* @__PURE__ */ y("option", {
208
+ value: "name",
209
+ children: "Name A-Z"
210
+ }),
211
+ /* @__PURE__ */ y("option", {
212
+ value: "rating",
213
+ children: "Highest Rated"
214
+ }),
215
+ /* @__PURE__ */ y("option", {
216
+ value: "orders",
217
+ children: "Most Ordered"
218
+ })
219
+ ]
220
+ })
221
+ ]
222
+ })
223
+ }),
224
+ M.length === 0 && N.length === 0 ? /* @__PURE__ */ y(r, {
225
+ icon: /* @__PURE__ */ y(d, { className: "h-12 w-12" }),
226
+ title: "No favorites yet",
227
+ description: "Browse carts and tap the heart icon to add them to your favorites.",
228
+ action: /* @__PURE__ */ y("button", {
229
+ type: "button",
230
+ onClick: () => x("/customer/carts"),
231
+ className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
232
+ children: "Discover Carts"
233
+ })
234
+ }) : /* @__PURE__ */ b("div", {
235
+ className: "space-y-8",
236
+ children: [M.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
237
+ className: "text-base font-semibold text-foreground mb-4 flex items-center gap-2",
238
+ children: [
239
+ /* @__PURE__ */ y(h, { className: "h-4 w-4 text-muted-foreground" }),
240
+ "Favorite Carts (",
241
+ M.length,
242
+ ")"
243
+ ]
244
+ }), /* @__PURE__ */ y("div", {
245
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
246
+ children: M.map((e) => /* @__PURE__ */ b("div", {
247
+ className: "rounded-lg border border-border bg-card shadow-sm overflow-hidden",
248
+ children: [/* @__PURE__ */ b("div", {
249
+ className: "relative h-36 bg-muted",
250
+ children: [
251
+ /* @__PURE__ */ y("button", {
252
+ type: "button",
253
+ onClick: () => x(`/customer/carts/${e.id}`),
254
+ className: "block h-full w-full",
255
+ children: /* @__PURE__ */ y("img", {
256
+ src: e.image,
257
+ alt: e.name,
258
+ className: "h-full w-full object-cover"
259
+ })
260
+ }),
261
+ /* @__PURE__ */ y("button", {
262
+ type: "button",
263
+ onClick: () => P(e.id),
264
+ title: "Remove from favorites",
265
+ className: "absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-card/80 backdrop-blur-sm text-red-500 hover:bg-card transition-colors",
266
+ children: /* @__PURE__ */ y(d, { className: "h-4 w-4 fill-current" })
267
+ }),
268
+ /* @__PURE__ */ y("div", {
269
+ className: "absolute top-2 left-2",
270
+ children: /* @__PURE__ */ y("span", {
271
+ className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", e.isOpen ? "bg-green-500/20 text-green-600 dark:text-green-400" : "bg-destructive/20 text-destructive"),
272
+ children: e.isOpen ? "Open" : "Closed"
273
+ })
274
+ })
275
+ ]
276
+ }), /* @__PURE__ */ b("div", {
277
+ className: "p-4",
278
+ children: [
279
+ /* @__PURE__ */ b("div", {
280
+ className: "flex items-start justify-between gap-2 mb-2",
281
+ children: [/* @__PURE__ */ y("h4", {
282
+ className: "text-sm font-semibold text-foreground truncate",
283
+ children: e.name
284
+ }), /* @__PURE__ */ b("div", {
285
+ className: "flex items-center gap-1 shrink-0",
286
+ children: [
287
+ /* @__PURE__ */ y(g, { className: "h-3.5 w-3.5 fill-yellow-400 text-yellow-400" }),
288
+ /* @__PURE__ */ y("span", {
289
+ className: "text-xs font-medium text-foreground",
290
+ children: e.rating
291
+ }),
292
+ /* @__PURE__ */ b("span", {
293
+ className: "text-xs text-muted-foreground",
294
+ children: [
295
+ "(",
296
+ e.reviewCount,
297
+ ")"
298
+ ]
299
+ })
300
+ ]
301
+ })]
302
+ }),
303
+ /* @__PURE__ */ y("p", {
304
+ className: "text-xs text-muted-foreground line-clamp-2 mb-3",
305
+ children: e.description
306
+ }),
307
+ /* @__PURE__ */ b("div", {
308
+ className: "space-y-1.5 text-xs text-muted-foreground",
309
+ children: [
310
+ /* @__PURE__ */ b("div", {
311
+ className: "flex justify-between",
312
+ children: [/* @__PURE__ */ y("span", { children: "Added:" }), /* @__PURE__ */ y("span", { children: s(e.addedToFavorites, {
313
+ hour: void 0,
314
+ minute: void 0,
315
+ hour12: void 0
316
+ }) })]
317
+ }),
318
+ /* @__PURE__ */ b("div", {
319
+ className: "flex justify-between",
320
+ children: [/* @__PURE__ */ y("span", { children: "Total orders:" }), /* @__PURE__ */ y("span", { children: e.totalOrders })]
321
+ }),
322
+ /* @__PURE__ */ b("div", {
323
+ className: "flex justify-between",
324
+ children: [/* @__PURE__ */ y("span", { children: "Total spent:" }), /* @__PURE__ */ y("span", {
325
+ className: "font-medium",
326
+ children: o(e.totalSpent, { minimumFractionDigits: 0 })
327
+ })]
328
+ }),
329
+ e.lastOrdered && /* @__PURE__ */ b("div", {
330
+ className: "flex justify-between",
331
+ children: [/* @__PURE__ */ y("span", { children: "Last ordered:" }), /* @__PURE__ */ y("span", { children: s(e.lastOrdered, {
332
+ hour: void 0,
333
+ minute: void 0,
334
+ hour12: void 0
335
+ }) })]
336
+ })
337
+ ]
338
+ }),
339
+ /* @__PURE__ */ b("div", {
340
+ className: "flex gap-2 mt-4",
341
+ children: [/* @__PURE__ */ b("button", {
342
+ type: "button",
343
+ onClick: () => x(`/customer/carts/${e.id}`),
344
+ className: "flex-1 flex items-center justify-center gap-1.5 rounded-lg bg-foreground px-3 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity",
345
+ children: [/* @__PURE__ */ y(p, { className: "h-3 w-3" }), "Order Again"]
346
+ }), /* @__PURE__ */ y("button", {
347
+ type: "button",
348
+ onClick: () => x(`/customer/carts/${e.id}`),
349
+ className: "flex-1 rounded-lg border border-border px-3 py-2 text-xs font-medium text-foreground hover:bg-accent transition-colors",
350
+ children: "View Menu"
351
+ })]
352
+ })
353
+ ]
354
+ })]
355
+ }, e.id))
356
+ })] }), N.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
357
+ className: "text-base font-semibold text-foreground mb-4 flex items-center gap-2",
358
+ children: [
359
+ /* @__PURE__ */ y(_, { className: "h-4 w-4 text-muted-foreground" }),
360
+ "Favorite Products (",
361
+ N.length,
362
+ ")"
363
+ ]
364
+ }), /* @__PURE__ */ y("div", {
365
+ className: "space-y-3",
366
+ children: N.map((e) => /* @__PURE__ */ y("div", {
367
+ className: "rounded-lg border border-border bg-card p-4",
368
+ children: /* @__PURE__ */ b("div", {
369
+ className: "flex flex-col sm:flex-row sm:items-center gap-4",
370
+ children: [
371
+ /* @__PURE__ */ y("img", {
372
+ src: e.image,
373
+ alt: e.name,
374
+ className: "w-20 h-20 rounded-lg object-cover shrink-0 mx-auto sm:mx-0"
375
+ }),
376
+ /* @__PURE__ */ b("div", {
377
+ className: "flex-1 min-w-0",
378
+ children: [
379
+ /* @__PURE__ */ b("div", {
380
+ className: "flex items-start justify-between gap-2 mb-1",
381
+ children: [/* @__PURE__ */ y("h4", {
382
+ className: "text-sm font-semibold text-foreground",
383
+ children: e.name
384
+ }), /* @__PURE__ */ b("div", {
385
+ className: "flex items-center gap-2 shrink-0",
386
+ children: [/* @__PURE__ */ y("span", {
387
+ className: "text-base font-bold text-foreground",
388
+ children: o(e.price, { minimumFractionDigits: 0 })
389
+ }), /* @__PURE__ */ y("button", {
390
+ type: "button",
391
+ onClick: () => F(e.id),
392
+ title: "Remove from favorites",
393
+ className: "rounded-md p-1 text-red-500 hover:bg-destructive/10 transition-colors",
394
+ children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
395
+ })]
396
+ })]
397
+ }),
398
+ /* @__PURE__ */ y("p", {
399
+ className: "text-xs text-muted-foreground mb-2",
400
+ children: e.description
401
+ }),
402
+ /* @__PURE__ */ b("div", {
403
+ className: "flex flex-wrap items-center gap-2 text-xs text-muted-foreground mb-2",
404
+ children: [
405
+ /* @__PURE__ */ b("span", { children: [
406
+ "From:",
407
+ " ",
408
+ /* @__PURE__ */ y("span", {
409
+ className: "font-medium text-foreground",
410
+ children: e.cartName
411
+ })
412
+ ] }),
413
+ /* @__PURE__ */ b("span", { children: [
414
+ "Ordered ",
415
+ e.orderCount,
416
+ " times"
417
+ ] }),
418
+ /* @__PURE__ */ b("span", { children: [
419
+ "Added:",
420
+ " ",
421
+ s(e.addedToFavorites, {
422
+ hour: void 0,
423
+ minute: void 0,
424
+ hour12: void 0
425
+ })
426
+ ] })
427
+ ]
428
+ }),
429
+ /* @__PURE__ */ b("div", {
430
+ className: "flex flex-wrap items-center gap-2",
431
+ children: [
432
+ e.isVegetarian && /* @__PURE__ */ b("span", {
433
+ className: "inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",
434
+ children: [/* @__PURE__ */ y(f, { className: "h-3 w-3" }), "Veg"]
435
+ }),
436
+ e.isVegan && /* @__PURE__ */ b("span", {
437
+ className: "inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",
438
+ children: [/* @__PURE__ */ y(f, { className: "h-3 w-3" }), "Vegan"]
439
+ }),
440
+ /* @__PURE__ */ b("span", {
441
+ className: "inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",
442
+ children: [
443
+ /* @__PURE__ */ y(u, { className: "h-3 w-3" }),
444
+ e.preparationTime,
445
+ " min"
446
+ ]
447
+ })
448
+ ]
449
+ })
450
+ ]
451
+ }),
452
+ /* @__PURE__ */ b("div", {
453
+ className: "flex sm:flex-col gap-2 shrink-0",
454
+ children: [/* @__PURE__ */ y("button", {
455
+ type: "button",
456
+ onClick: () => x(`/customer/carts/${e.cartId}`),
457
+ className: "flex-1 sm:flex-none rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity whitespace-nowrap",
458
+ children: "Add to Cart"
459
+ }), /* @__PURE__ */ y("button", {
460
+ type: "button",
461
+ onClick: () => x(`/customer/carts/${e.cartId}`),
462
+ className: "flex-1 sm:flex-none rounded-lg border border-border px-4 py-2 text-xs font-medium text-foreground hover:bg-accent transition-colors whitespace-nowrap",
463
+ children: "View Cart"
464
+ })]
465
+ })
466
+ ]
467
+ })
468
+ }, e.id))
469
+ })] })]
470
+ })
471
+ ]
472
+ });
473
+ }
474
+ //#endregion
475
+ export { x as FavoritesPage };
476
+
477
+ //# sourceMappingURL=FavoritesPage.js.map