{"version":3,"file":"AvailabilityCalendar_1.CQdDaUl2.mjs","names":["useState","months"],"sources":["https:/framerusercontent.com/modules/LSYNS6ykJGoY7GKuzdCz/xxDTBTkB40YschrdGGdE/AvailabilityCalendar_1.js"],"sourcesContent":["// import React, { useState, useEffect } from \"react\"\n// import { addPropertyControls, ControlType } from \"framer\"\n// interface AvailabilityCalendarProps {\n//     roomTypeId?: string\n//     apiUrl?: string\n//     backgroundColor?: string\n//     textColor?: string\n//     borderRadius?: number\n//     width?: number\n//     height?: number\n//     showPricing?: boolean\n//     monthsToShow?: number\n//     showBookingButton?: boolean\n//     propertyId?: string\n//     bookingUrl?: string\n//     selectedColor?: string\n//     selectedTextColor?: string\n//     rangeColor?: string\n//     rangeTextColor?: string\n//     rangePriceTextColor?: string\n//     priceTextColor?: string\n//     onBookingClick?: (checkIn: Date, checkOut: Date) => void\n// }\n// interface CalendarDay {\n//     date: Date\n//     available: boolean\n//     price?: number\n//     isToday: boolean\n//     isSelected: boolean\n//     isInRange: boolean\n// }\n// // Add a timeout helper\n// function fetchWithTimeout(\n//     resource: RequestInfo,\n//     options: RequestInit & { timeout?: number } = {}\n// ): Promise<Response> {\n//     const { timeout = 10000, ...rest } = options\n//     return Promise.race([\n//         fetch(resource, rest),\n//         new Promise<Response>((_, reject) =>\n//             setTimeout(() => reject(new Error(\"Request timed out\")), timeout)\n//         ),\n//     ])\n// }\n// export default function AvailabilityCalendar({\n//     roomTypeId = \"\",\n//     apiUrl = \"https://framer-cloudbeds-proxy.danieladebimpe.workers.dev\",\n//     backgroundColor = \"#ffffff\",\n//     textColor = \"#111827\",\n//     borderRadius = 8,\n//     width = 600,\n//     height = 400,\n//     showPricing = true,\n//     monthsToShow = 2,\n//     showBookingButton = true,\n//     propertyId = \"316344\",\n//     bookingUrl = \"https://hotels.cloudbeds.com/reservation/t1NtrrThe\",\n//     selectedColor = \"#111827\",\n//     selectedTextColor = \"#ffffff\",\n//     rangeColor = \"#e5e7eb\",\n//     rangeTextColor = \"#374151\",\n//     rangePriceTextColor = \"#374151\",\n//     priceTextColor = \"#6b7280\",\n//     onBookingClick,\n// }: AvailabilityCalendarProps) {\n//     const [currentDate, setCurrentDate] = useState(new Date())\n//     const [selectedCheckIn, setSelectedCheckIn] = useState<Date | null>(null)\n//     const [selectedCheckOut, setSelectedCheckOut] = useState<Date | null>(null)\n//     const [availabilityData, setAvailabilityData] = useState<any>({})\n//     const [loading, setLoading] = useState(false)\n//     const [timeoutError, setTimeoutError] = useState<string | null>(null)\n//     // Helper to compare dates (ignoring time)\n//     const isSameDay = (date1: Date, date2: Date): boolean => {\n//         return (\n//             date1.getFullYear() === date2.getFullYear() &&\n//             date1.getMonth() === date2.getMonth() &&\n//             date1.getDate() === date2.getDate()\n//         )\n//     }\n//     // Generate calendar days for the specified number of months\n//     const generateCalendarDays = (\n//         startDate: Date,\n//         months: number\n//     ): CalendarDay[] => {\n//         const days: CalendarDay[] = []\n//         const today = new Date()\n//         today.setHours(0, 0, 0, 0)\n//         for (let month = 0; month < months; month++) {\n//             const monthDate = new Date(\n//                 startDate.getFullYear(),\n//                 startDate.getMonth() + month,\n//                 1\n//             )\n//             const daysInMonth = new Date(\n//                 monthDate.getFullYear(),\n//                 monthDate.getMonth() + 1,\n//                 0\n//             ).getDate()\n//             for (let day = 1; day <= daysInMonth; day++) {\n//                 const date = new Date(\n//                     monthDate.getFullYear(),\n//                     monthDate.getMonth(),\n//                     day\n//                 )\n//                 date.setHours(0, 0, 0, 0)\n//                 const dateStr = date.toISOString().split(\"T\")[0]\n//                 days.push({\n//                     date,\n//                     available: true, // Force all dates to be available\n//                     // available: availabilityData[dateStr]?.available || false,\n//                     price: availabilityData[dateStr]?.price,\n//                     isToday: isSameDay(date, today),\n//                     isSelected: Boolean(\n//                         (selectedCheckIn && isSameDay(date, selectedCheckIn)) ||\n//                             (selectedCheckOut &&\n//                                 isSameDay(date, selectedCheckOut))\n//                     ),\n//                     isInRange: Boolean(\n//                         selectedCheckIn &&\n//                             selectedCheckOut &&\n//                             date > selectedCheckIn &&\n//                             date < selectedCheckOut\n//                     ),\n//                 })\n//             }\n//         }\n//         return days\n//     }\n//     // Handle day selection\n//     const handleDayClick = (date: Date) => {\n//         // Don't allow past dates (normalize to start of day for comparison)\n//         const today = new Date()\n//         today.setHours(0, 0, 0, 0)\n//         const clickedDate = new Date(date)\n//         clickedDate.setHours(0, 0, 0, 0)\n//         if (clickedDate < today) return\n//         // Since all dates are now available, no need to check availability\n//         // Range selection mode only\n//         if (!selectedCheckIn || (selectedCheckIn && selectedCheckOut)) {\n//             // Start new selection\n//             setSelectedCheckIn(date)\n//             setSelectedCheckOut(null)\n//         } else if (date.getTime() === selectedCheckIn.getTime()) {\n//             // Clicking the same date as check-in - allow extending the range\n//             setSelectedCheckOut(null)\n//         } else if (date > selectedCheckIn) {\n//             // Set check-out date (all dates are available now)\n//             setSelectedCheckOut(date)\n//         } else {\n//             // Reset if clicked date is before check-in\n//             setSelectedCheckIn(date)\n//             setSelectedCheckOut(null)\n//         }\n//     }\n//     // Handle booking button click\n//     const handleBookingClick = (e?: React.MouseEvent) => {\n//         // Prevent any default behavior and stop propagation\n//         if (e) {\n//             e.preventDefault()\n//             e.stopPropagation()\n//         }\n//         if (!selectedCheckIn || !selectedCheckOut) {\n//             console.warn(\n//                 \"AvailabilityCalendar: Missing check-in or check-out date\"\n//             )\n//             return\n//         }\n//         console.log(\"AvailabilityCalendar: Booking button clicked\", {\n//             checkIn: selectedCheckIn,\n//             checkOut: selectedCheckOut,\n//             bookingUrl,\n//             onBookingClick: !!onBookingClick,\n//         })\n//         if (onBookingClick) {\n//             // Use custom callback if provided\n//             onBookingClick(selectedCheckIn, selectedCheckOut)\n//         } else if (bookingUrl && bookingUrl.trim() !== \"\") {\n//             // If bookingUrl is provided, redirect to it with dates as query parameters\n//             const checkInStr = selectedCheckIn.toISOString().split(\"T\")[0]\n//             const checkOutStr = selectedCheckOut.toISOString().split(\"T\")[0]\n//             const nights = Math.ceil(\n//                 (selectedCheckOut.getTime() - selectedCheckIn.getTime()) /\n//                     (1000 * 60 * 60 * 24)\n//             )\n//             try {\n//                 // Build URL with query parameters\n//                 const url = new URL(bookingUrl)\n//                 url.searchParams.set(\"checkin\", checkInStr)\n//                 url.searchParams.set(\"checkout\", checkOutStr)\n//                 url.searchParams.set(\"nights\", nights.toString())\n//                 if (roomTypeId) {\n//                     url.searchParams.set(\"roomTypeId\", roomTypeId)\n//                 }\n//                 if (propertyId) {\n//                     url.searchParams.set(\"propertyId\", propertyId)\n//                 }\n//                 console.log(\n//                     \"AvailabilityCalendar: Redirecting to:\",\n//                     url.toString()\n//                 )\n//                 // Use window.open for better Framer compatibility\n//                 window.open(url.toString(), \"_blank\")\n//             } catch (error) {\n//                 console.error(\n//                     \"AvailabilityCalendar: Invalid booking URL:\",\n//                     bookingUrl,\n//                     error\n//                 )\n//                 alert(\"Invalid booking URL. Please contact support.\")\n//             }\n//         } else {\n//             // Default behavior - show booking information\n//             const checkInStr = selectedCheckIn.toLocaleDateString()\n//             const checkOutStr = selectedCheckOut.toLocaleDateString()\n//             const nights = Math.ceil(\n//                 (selectedCheckOut.getTime() - selectedCheckIn.getTime()) /\n//                     (1000 * 60 * 60 * 24)\n//             )\n//             alert(\n//                 `Booking Request:\\n\\nCheck-in: ${checkInStr}\\nCheck-out: ${checkOutStr}\\nNights: ${nights}\\n\\nPlease contact us to complete your reservation.`\n//             )\n//         }\n//     }\n//     // Fetch availability data for visible months + buffer for cross-month selections\n//     useEffect(() => {\n//         const fetchAvailability = async () => {\n//             setLoading(true)\n//             setTimeoutError(null)\n//             try {\n//                 // Extend range to allow selections beyond visible months\n//                 const startDate = new Date(\n//                     currentDate.getFullYear(),\n//                     currentDate.getMonth() - 1,\n//                     1\n//                 )\n//                 const endDate = new Date(\n//                     currentDate.getFullYear(),\n//                     currentDate.getMonth() + monthsToShow + 2,\n//                     0\n//                 )\n//                 const startDateStr = startDate.toISOString().split(\"T\")[0]\n//                 const endDateStr = endDate.toISOString().split(\"T\")[0]\n//                 // Try to fetch real availability data from Cloudbed API\n//                 let availabilityMap: any = {}\n//                 try {\n//                     // Use a range approach - check availability for each potential stay period\n//                     const response = await fetchWithTimeout(\n//                         `${apiUrl}/availability?checkin=${startDateStr}&checkout=${endDateStr}&adults=2&children=0`,\n//                         { timeout: 10000 }\n//                     )\n//                     if (response.ok) {\n//                         const data = await response.json()\n//                         if (data.success && data.availableRooms) {\n//                             // Process real availability data\n//                             // If roomTypeId is specified, filter for that room type\n//                             const relevantRooms = roomTypeId\n//                                 ? data.availableRooms.filter(\n//                                       (room: any) =>\n//                                           room.roomTypeID === roomTypeId\n//                                   )\n//                                 : data.availableRooms\n//                             // For simplicity, if any room is available for the period, mark dates as available\n//                             // In a real implementation, you'd want more granular day-by-day availability\n//                             if (relevantRooms.length > 0) {\n//                                 for (\n//                                     let d = new Date(startDate);\n//                                     d <= endDate;\n//                                     d.setDate(d.getDate() + 1)\n//                                 ) {\n//                                     const dateStr = d\n//                                         .toISOString()\n//                                         .split(\"T\")[0]\n//                                     availabilityMap[dateStr] = {\n//                                         available: true,\n//                                         price:\n//                                             relevantRooms[0]?.rates?.[0]\n//                                                 ?.rate || 200, // Use first available rate\n//                                     }\n//                                 }\n//                             }\n//                         }\n//                     }\n//                 } catch (apiError) {\n//                     console.warn(\n//                         \"Failed to fetch real availability, falling back to mock data:\",\n//                         apiError\n//                     )\n//                 }\n//                 // If no real data was fetched, use mock data as fallback\n//                 if (Object.keys(availabilityMap).length === 0) {\n//                     for (\n//                         let d = new Date(startDate);\n//                         d <= endDate;\n//                         d.setDate(d.getDate() + 1)\n//                     ) {\n//                         const dateStr = d.toISOString().split(\"T\")[0]\n//                         availabilityMap[dateStr] = {\n//                             available: true, // All dates available\n//                             price: Math.floor(Math.random() * 200) + 150, // $150-350 range\n//                         }\n//                     }\n//                 }\n//                 setAvailabilityData(availabilityMap)\n//             } catch (error) {\n//                 if (\n//                     error instanceof Error &&\n//                     error.message === \"Request timed out\"\n//                 ) {\n//                     setTimeoutError(\"The request timed out. Please try again.\")\n//                 }\n//             } finally {\n//                 setLoading(false)\n//             }\n//         }\n//         fetchAvailability()\n//     }, [currentDate, monthsToShow, roomTypeId, apiUrl])\n//     const calendarDays = generateCalendarDays(currentDate, monthsToShow)\n//     const months = Array.from(\n//         { length: monthsToShow },\n//         (_, i) =>\n//             new Date(currentDate.getFullYear(), currentDate.getMonth() + i, 1)\n//     )\n//     // Force re-render when selection changes\n//     useEffect(() => {\n//         // This effect will trigger a re-render when selection changes\n//     }, [selectedCheckIn, selectedCheckOut])\n//     const containerStyle = {\n//         width: `${width}px`,\n//         height: `${height}px`,\n//         backgroundColor,\n//         color: textColor,\n//         borderRadius: `${borderRadius}px`,\n//         padding: \"20px\",\n//         fontFamily:\n//             \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",\n//         overflow: \"auto\",\n//     }\n//     const headerStyle = {\n//         display: \"flex\",\n//         justifyContent: \"space-between\",\n//         alignItems: \"center\",\n//         marginBottom: \"20px\",\n//     }\n//     const monthGridStyle = {\n//         display: \"grid\",\n//         gridTemplateColumns: `repeat(${monthsToShow}, 1fr)`,\n//         gap: \"20px\",\n//     }\n//     const monthStyle = {\n//         minWidth: \"250px\",\n//     }\n//     const monthHeaderStyle = {\n//         textAlign: \"center\" as const,\n//         fontWeight: \"600\",\n//         fontSize: \"16px\",\n//         marginBottom: \"10px\",\n//         color: textColor,\n//     }\n//     const weekHeaderStyle = {\n//         display: \"grid\",\n//         gridTemplateColumns: \"repeat(7, 1fr)\",\n//         gap: \"2px\",\n//         marginBottom: \"5px\",\n//     }\n//     const weekDayStyle = {\n//         textAlign: \"center\" as const,\n//         fontSize: \"12px\",\n//         fontWeight: \"500\",\n//         color: \"#6b7280\",\n//         padding: \"5px\",\n//     }\n//     const daysGridStyle = {\n//         display: \"grid\",\n//         gridTemplateColumns: \"repeat(7, 1fr)\",\n//         gap: \"2px\",\n//     }\n//     const getDayStyle = (day: CalendarDay) => {\n//         const baseStyle = {\n//             padding: \"8px 4px\",\n//             textAlign: \"center\" as const,\n//             fontSize: \"12px\",\n//             cursor: day.date >= new Date() ? \"pointer\" : \"not-allowed\", // Always pointer for future dates\n//             borderRadius: \"6px\",\n//             transition: \"all 0.2s ease\",\n//             opacity: day.date < new Date() ? 0.4 : 1,\n//             position: \"relative\" as const,\n//             fontWeight: \"500\",\n//         }\n//         if (day.isSelected) {\n//             return {\n//                 ...baseStyle,\n//                 backgroundColor: selectedColor,\n//                 color: selectedTextColor,\n//                 fontWeight: \"600\",\n//             }\n//         }\n//         if (day.isInRange) {\n//             return {\n//                 ...baseStyle,\n//                 backgroundColor: rangeColor,\n//                 color: rangeTextColor,\n//                 border: \"1px solid #d1d5db\",\n//             }\n//         }\n//         if (day.isToday) {\n//             return {\n//                 ...baseStyle,\n//                 border: \"2px solid #111827\",\n//                 fontWeight: \"600\",\n//                 color: \"#111827\",\n//             }\n//         }\n//         if (day.available) {\n//             return {\n//                 ...baseStyle,\n//                 backgroundColor: \"#ffffff\",\n//                 color: \"#374151\",\n//                 border: \"1px solid #e5e7eb\",\n//             }\n//         }\n//         return {\n//             ...baseStyle,\n//             backgroundColor: \"#f9fafb\",\n//             color: \"#9ca3af\",\n//             border: \"1px solid #f3f4f6\",\n//         }\n//     }\n//     const selectionInfoStyle = {\n//         backgroundColor: \"#f9fafb\",\n//         padding: \"15px\",\n//         borderRadius: `${borderRadius}px`,\n//         marginTop: \"20px\",\n//         fontSize: \"14px\",\n//     }\n//     return (\n//         <div style={containerStyle}>\n//             <div style={headerStyle}>\n//                 <div\n//                     style={{\n//                         display: \"flex\",\n//                         justifyContent: \"space-between\",\n//                         alignItems: \"center\",\n//                         width: \"100%\",\n//                     }}\n//                 >\n//                     <button\n//                         onClick={() =>\n//                             setCurrentDate(\n//                                 new Date(\n//                                     currentDate.getFullYear(),\n//                                     currentDate.getMonth() - 1,\n//                                     1\n//                                 )\n//                             )\n//                         }\n//                         style={{\n//                             padding: \"12px\",\n//                             backgroundColor: \"#ffffff\",\n//                             color: \"#6b7280\",\n//                             border: \"1px solid #e5e7eb\",\n//                             borderRadius: \"12px\",\n//                             cursor: \"pointer\",\n//                             display: \"flex\",\n//                             alignItems: \"center\",\n//                             justifyContent: \"center\",\n//                             transition: \"all 0.2s ease\",\n//                             width: \"44px\",\n//                             height: \"44px\",\n//                         }}\n//                         title=\"Previous month\"\n//                         aria-label=\"Previous month\"\n//                         onMouseEnter={(e) => {\n//                             e.currentTarget.style.backgroundColor = \"#e5e7eb\"\n//                             e.currentTarget.style.color = \"#374151\"\n//                         }}\n//                         onMouseLeave={(e) => {\n//                             e.currentTarget.style.backgroundColor = \"#f3f4f6\"\n//                             e.currentTarget.style.color = \"#6b7280\"\n//                         }}\n//                     >\n//                         <svg\n//                             width=\"18\"\n//                             height=\"18\"\n//                             viewBox=\"0 0 24 24\"\n//                             fill=\"none\"\n//                             stroke=\"currentColor\"\n//                             strokeWidth=\"2\"\n//                             strokeLinecap=\"round\"\n//                             strokeLinejoin=\"round\"\n//                         >\n//                             <path d=\"m15 18-6-6 6-6\" />\n//                         </svg>\n//                     </button>\n//                     <div\n//                         style={{\n//                             textAlign: \"center\",\n//                             flex: \"1\",\n//                         }}\n//                     >\n//                         <h3\n//                             style={{\n//                                 margin: \"0\",\n//                                 fontSize: \"18px\",\n//                                 fontWeight: \"600\",\n//                                 color: textColor,\n//                                 lineHeight: \"1.2\",\n//                             }}\n//                         >\n//                             {(() => {\n//                                 if (monthsToShow === 1) {\n//                                     return currentDate.toLocaleDateString(\n//                                         \"en-US\",\n//                                         { month: \"long\" }\n//                                     )\n//                                 }\n//                                 const startDate = currentDate\n//                                 const endDate = new Date(\n//                                     currentDate.getFullYear(),\n//                                     currentDate.getMonth() + monthsToShow - 1,\n//                                     1\n//                                 )\n//                                 // Show month range without year\n//                                 return `${startDate.toLocaleDateString(\"en-US\", { month: \"long\" })} - ${endDate.toLocaleDateString(\"en-US\", { month: \"long\" })}`\n//                             })()}\n//                         </h3>\n//                         <div\n//                             style={{\n//                                 fontSize: \"14px\",\n//                                 color: \"#6b7280\",\n//                                 fontWeight: \"400\",\n//                                 marginTop: \"2px\",\n//                             }}\n//                         >\n//                             {(() => {\n//                                 if (monthsToShow === 1) {\n//                                     return currentDate.getFullYear()\n//                                 }\n//                                 const startDate = currentDate\n//                                 const endDate = new Date(\n//                                     currentDate.getFullYear(),\n//                                     currentDate.getMonth() + monthsToShow - 1,\n//                                     1\n//                                 )\n//                                 // If same year, show year once\n//                                 if (\n//                                     startDate.getFullYear() ===\n//                                     endDate.getFullYear()\n//                                 ) {\n//                                     return startDate.getFullYear()\n//                                 }\n//                                 // If different years, show both years\n//                                 return `${startDate.getFullYear()} - ${endDate.getFullYear()}`\n//                             })()}\n//                         </div>\n//                     </div>\n//                     <button\n//                         onClick={() =>\n//                             setCurrentDate(\n//                                 new Date(\n//                                     currentDate.getFullYear(),\n//                                     currentDate.getMonth() + 1,\n//                                     1\n//                                 )\n//                             )\n//                         }\n//                         style={{\n//                             padding: \"12px\",\n//                             backgroundColor: \"#ffffff\",\n//                             color: \"#6b7280\",\n//                             border: \"1px solid #e5e7eb\",\n//                             borderRadius: \"12px\",\n//                             cursor: \"pointer\",\n//                             display: \"flex\",\n//                             alignItems: \"center\",\n//                             justifyContent: \"center\",\n//                             transition: \"all 0.2s ease\",\n//                             width: \"44px\",\n//                             height: \"44px\",\n//                         }}\n//                         title=\"Next month\"\n//                         aria-label=\"Next month\"\n//                         onMouseEnter={(e) => {\n//                             e.currentTarget.style.backgroundColor = \"#e5e7eb\"\n//                             e.currentTarget.style.color = \"#374151\"\n//                         }}\n//                         onMouseLeave={(e) => {\n//                             e.currentTarget.style.backgroundColor = \"#f3f4f6\"\n//                             e.currentTarget.style.color = \"#6b7280\"\n//                         }}\n//                     >\n//                         <svg\n//                             width=\"18\"\n//                             height=\"18\"\n//                             viewBox=\"0 0 24 24\"\n//                             fill=\"none\"\n//                             stroke=\"currentColor\"\n//                             strokeWidth=\"2\"\n//                             strokeLinecap=\"round\"\n//                             strokeLinejoin=\"round\"\n//                         >\n//                             <path d=\"m9 18 6-6-6-6\" />\n//                         </svg>\n//                     </button>\n//                 </div>\n//             </div>\n//             {loading && (\n//                 <div\n//                     style={{\n//                         textAlign: \"center\",\n//                         padding: \"20px\",\n//                         color: \"#6b7280\",\n//                     }}\n//                 >\n//                     <span>Loading availability...</span>\n//                 </div>\n//             )}\n//             {timeoutError && (\n//                 <div style={{ color: \"#dc2626\", marginTop: 8 }}>\n//                     ⏱️ {timeoutError}\n//                 </div>\n//             )}\n//             <div style={monthGridStyle}>\n//                 {months.map((month, monthIndex) => (\n//                     <div key={monthIndex} style={monthStyle}>\n//                         {/* Month header hidden to avoid repetition with main header */}\n//                         <div style={weekHeaderStyle}>\n//                             {[\n//                                 \"Sun\",\n//                                 \"Mon\",\n//                                 \"Tue\",\n//                                 \"Wed\",\n//                                 \"Thu\",\n//                                 \"Fri\",\n//                                 \"Sat\",\n//                             ].map((day) => (\n//                                 <div key={day} style={weekDayStyle}>\n//                                     {day}\n//                                 </div>\n//                             ))}\n//                         </div>\n//                         <div style={daysGridStyle}>\n//                             {/* Empty cells for days before month starts */}\n//                             {Array.from({ length: month.getDay() }, (_, i) => (\n//                                 <div\n//                                     key={`empty-${i}`}\n//                                     style={{ padding: \"8px\" }}\n//                                 ></div>\n//                             ))}\n//                             {/* Calendar days for this month */}\n//                             {calendarDays\n//                                 .filter(\n//                                     (day) =>\n//                                         day.date.getMonth() ===\n//                                             month.getMonth() &&\n//                                         day.date.getFullYear() ===\n//                                             month.getFullYear()\n//                                 )\n//                                 .map((day, dayIndex) => (\n//                                     <div\n//                                         key={dayIndex}\n//                                         style={getDayStyle(day)}\n//                                         onClick={() => handleDayClick(day.date)}\n//                                     >\n//                                         <div>{day.date.getDate()}</div>\n//                                         {/* {showPricing && day.price && day.available && (\n//                       <div style={{\n//                         fontSize: \"10px\",\n//                         color: day.isSelected ? selectedTextColor : (day.isInRange ? rangePriceTextColor : priceTextColor),\n//                         opacity: day.isSelected || day.isInRange ? 0.9 : 1\n//                       }}>\n//                         ${day.price}\n//                       </div>\n//                     )} */}\n//                                     </div>\n//                                 ))}\n//                         </div>\n//                     </div>\n//                 ))}\n//             </div>\n//             {/* Selection Info */}\n//             {(selectedCheckIn || selectedCheckOut) && (\n//                 <div style={selectionInfoStyle}>\n//                     <div style={{ fontWeight: \"600\", marginBottom: \"8px\" }}>\n//                         Selected Dates:\n//                     </div>\n//                     <div\n//                         style={{\n//                             display: \"flex\",\n//                             justifyContent: \"space-between\",\n//                             marginBottom: \"12px\",\n//                         }}\n//                     >\n//                         <span>\n//                             Check-in:{\" \"}\n//                             {selectedCheckIn\n//                                 ? selectedCheckIn.toLocaleDateString()\n//                                 : \"Not selected\"}\n//                         </span>\n//                         <span>\n//                             Check-out:{\" \"}\n//                             {selectedCheckOut\n//                                 ? selectedCheckOut.toLocaleDateString()\n//                                 : \"Not selected\"}\n//                         </span>\n//                     </div>\n//                     {selectedCheckIn && selectedCheckOut && (\n//                         <div style={{ marginBottom: \"12px\" }}>\n//                             <div\n//                                 style={{\n//                                     fontSize: \"12px\",\n//                                     color: \"#6b7280\",\n//                                     marginBottom: \"8px\",\n//                                 }}\n//                             >\n//                                 {Math.ceil(\n//                                     (selectedCheckOut.getTime() -\n//                                         selectedCheckIn.getTime()) /\n//                                         (1000 * 60 * 60 * 24)\n//                                 )}{\" \"}\n//                                 nights\n//                             </div>\n//                             {showBookingButton && (\n//                                 <button\n//                                     onClick={(e) => handleBookingClick(e)}\n//                                     style={{\n//                                         width: \"100%\",\n//                                         padding: \"12px 16px\",\n//                                         backgroundColor: selectedColor,\n//                                         color: selectedTextColor,\n//                                         border: \"none\",\n//                                         borderRadius: `${borderRadius}px`,\n//                                         fontSize: \"14px\",\n//                                         fontWeight: \"600\",\n//                                         cursor: \"pointer\",\n//                                         transition: \"all 0.2s ease\",\n//                                     }}\n//                                     onMouseEnter={(e) => {\n//                                         e.currentTarget.style.opacity = \"0.8\"\n//                                     }}\n//                                     onMouseLeave={(e) => {\n//                                         e.currentTarget.style.opacity = \"1\"\n//                                     }}\n//                                 >\n//                                     Book Selected Dates\n//                                 </button>\n//                             )}\n//                         </div>\n//                     )}\n//                 </div>\n//             )}\n//             {/* Legend */}\n//             <div\n//                 style={{\n//                     display: \"flex\",\n//                     gap: \"15px\",\n//                     marginTop: \"15px\",\n//                     fontSize: \"12px\",\n//                     flexWrap: \"wrap\" as const,\n//                     color: \"#6b7280\",\n//                 }}\n//             >\n//                 <div\n//                     style={{\n//                         display: \"flex\",\n//                         alignItems: \"center\",\n//                         gap: \"5px\",\n//                     }}\n//                 >\n//                     <div\n//                         style={{\n//                             width: \"12px\",\n//                             height: \"12px\",\n//                             backgroundColor: \"#ffffff\",\n//                             border: \"1px solid #e5e7eb\",\n//                             borderRadius: \"3px\",\n//                         }}\n//                     ></div>\n//                     <span>Available</span>\n//                 </div>\n//                 <div\n//                     style={{\n//                         display: \"flex\",\n//                         alignItems: \"center\",\n//                         gap: \"5px\",\n//                     }}\n//                 >\n//                     <div\n//                         style={{\n//                             width: \"12px\",\n//                             height: \"12px\",\n//                             backgroundColor: \"#f9fafb\",\n//                             border: \"1px solid #f3f4f6\",\n//                             borderRadius: \"3px\",\n//                         }}\n//                     ></div>\n//                     <span>Unavailable</span>\n//                 </div>\n//                 <div\n//                     style={{\n//                         display: \"flex\",\n//                         alignItems: \"center\",\n//                         gap: \"5px\",\n//                     }}\n//                 >\n//                     <div\n//                         style={{\n//                             width: \"12px\",\n//                             height: \"12px\",\n//                             backgroundColor: selectedColor,\n//                             borderRadius: \"3px\",\n//                         }}\n//                     ></div>\n//                     <span>Selected</span>\n//                 </div>\n//                 <div\n//                     style={{\n//                         display: \"flex\",\n//                         alignItems: \"center\",\n//                         gap: \"5px\",\n//                     }}\n//                 >\n//                     <div\n//                         style={{\n//                             width: \"12px\",\n//                             height: \"12px\",\n//                             border: \"2px solid #111827\",\n//                             borderRadius: \"3px\",\n//                         }}\n//                     ></div>\n//                     <span>Today</span>\n//                 </div>\n//             </div>\n//         </div>\n//     )\n// }\n// // Framer property controls\n// addPropertyControls(AvailabilityCalendar, {\n//     roomTypeId: {\n//         type: ControlType.String,\n//         title: \"Room Type ID\",\n//         defaultValue: \"\",\n//         placeholder: \"Leave empty for all rooms\",\n//     },\n//     apiUrl: {\n//         type: ControlType.String,\n//         title: \"API URL\",\n//         defaultValue:\n//             \"https://framer-cloudbeds-proxy.danieladebimpe.workers.dev\",\n//         placeholder: \"Enter API endpoint URL\",\n//     },\n//     propertyId: {\n//         type: ControlType.String,\n//         title: \"Property ID\",\n//         defaultValue: \"\",\n//         placeholder:\n//             \"Leave empty unless you have a valid Cloudbeds property ID\",\n//     },\n//     bookingUrl: {\n//         type: ControlType.String,\n//         title: \"Booking URL\",\n//         defaultValue: \"https://hotels.cloudbeds.com/reservation/t1NtrrThe\",\n//         placeholder:\n//             \"URL to redirect to when booking (e.g., https://yoursite.com/booking)\",\n//     },\n//     showPricing: {\n//         type: ControlType.Boolean,\n//         title: \"Show Pricing\",\n//         defaultValue: true,\n//     },\n//     showBookingButton: {\n//         type: ControlType.Boolean,\n//         title: \"Show Booking Button\",\n//         defaultValue: true,\n//     },\n//     monthsToShow: {\n//         type: ControlType.Number,\n//         title: \"Months to Show\",\n//         defaultValue: 2,\n//         min: 1,\n//         max: 6,\n//         step: 1,\n//     },\n//     backgroundColor: {\n//         type: ControlType.Color,\n//         title: \"Background Color\",\n//         defaultValue: \"#ffffff\",\n//     },\n//     textColor: {\n//         type: ControlType.Color,\n//         title: \"Text Color\",\n//         defaultValue: \"#111827\",\n//     },\n//     selectedColor: {\n//         type: ControlType.Color,\n//         title: \"Check-in/out Background\",\n//         defaultValue: \"#111827\",\n//     },\n//     selectedTextColor: {\n//         type: ControlType.Color,\n//         title: \"Check-in/out Text\",\n//         defaultValue: \"#ffffff\",\n//     },\n//     rangeColor: {\n//         type: ControlType.Color,\n//         title: \"In-Between Dates Background\",\n//         defaultValue: \"#e5e7eb\",\n//     },\n//     rangeTextColor: {\n//         type: ControlType.Color,\n//         title: \"In-Between Dates Text\",\n//         defaultValue: \"#374151\",\n//     },\n//     rangePriceTextColor: {\n//         type: ControlType.Color,\n//         title: \"In-Between Price Text\",\n//         defaultValue: \"#374151\",\n//     },\n//     priceTextColor: {\n//         type: ControlType.Color,\n//         title: \"Price Text Color\",\n//         defaultValue: \"#6b7280\",\n//     },\n//     borderRadius: {\n//         type: ControlType.Number,\n//         title: \"Border Radius\",\n//         defaultValue: 8,\n//         min: 0,\n//         max: 20,\n//         step: 1,\n//     },\n//     width: {\n//         type: ControlType.Number,\n//         title: \"Width\",\n//         defaultValue: 600,\n//         min: 400,\n//         max: 1000,\n//         step: 10,\n//     },\n//     height: {\n//         type: ControlType.Number,\n//         title: \"Height\",\n//         defaultValue: 400,\n//         min: 300,\n//         max: 600,\n//         step: 10,\n//     },\n// })\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Add a timeout helper\nfunction fetchWithTimeout(resource,options={}){const{timeout=1e4,...rest}=options;return Promise.race([fetch(resource,rest),new Promise((_,reject)=>setTimeout(()=>reject(new Error(\"Request timed out\")),timeout))]);}export default function AvailabilityCalendar({roomTypeId=\"\",apiUrl=\"https://framer-cloudbeds-proxy.danieladebimpe.workers.dev\",backgroundColor=\"#ffffff\",textColor=\"#111827\",borderRadius=8,width=600,height=400,showPricing=true,monthsToShow=2,showBookingButton=true,propertyId=\"316344\",bookingUrl=\"https://hotels.cloudbeds.com/reservation/t1NtrrThe\",selectedColor=\"#111827\",selectedTextColor=\"#ffffff\",rangeColor=\"#e5e7eb\",rangeTextColor=\"#374151\",rangePriceTextColor=\"#374151\",priceTextColor=\"#6b7280\",onBookingClick}){const[currentDate,setCurrentDate]=useState(new Date);const[selectedCheckIn,setSelectedCheckIn]=useState(null);const[selectedCheckOut,setSelectedCheckOut]=useState(null);const[originalCheckIn,setOriginalCheckIn]=useState(null);const[availabilityData,setAvailabilityData]=useState({});const[loading,setLoading]=useState(false);const[timeoutError,setTimeoutError]=useState(null);// Helper to compare dates (ignoring time)\nconst isSameDay=(date1,date2)=>{return date1.getFullYear()===date2.getFullYear()&&date1.getMonth()===date2.getMonth()&&date1.getDate()===date2.getDate();};// Generate calendar days for the specified number of months\nconst generateCalendarDays=(startDate,months)=>{const days=[];const today=new Date;today.setHours(0,0,0,0);for(let month=0;month<months;month++){const monthDate=new Date(startDate.getFullYear(),startDate.getMonth()+month,1);const daysInMonth=new Date(monthDate.getFullYear(),monthDate.getMonth()+1,0).getDate();for(let day=1;day<=daysInMonth;day++){const date=new Date(monthDate.getFullYear(),monthDate.getMonth(),day);date.setHours(0,0,0,0);const dateStr=date.toISOString().split(\"T\")[0];days.push({date,available:true,// available: availabilityData[dateStr]?.available || false,\nprice:availabilityData[dateStr]?.price,isToday:isSameDay(date,today),isSelected:Boolean(selectedCheckIn&&isSameDay(date,selectedCheckIn)||selectedCheckOut&&isSameDay(date,selectedCheckOut)),isInRange:Boolean(selectedCheckIn&&selectedCheckOut&&date>selectedCheckIn&&date<selectedCheckOut)});}}return days;};// Handle day selection\nconst handleDayClick=date=>{// Don't allow past dates (normalize to start of day for comparison)\nconst today=new Date;today.setHours(0,0,0,0);const clickedDate=new Date(date);clickedDate.setHours(0,0,0,0);if(clickedDate<today)return;console.log(\"AvailabilityCalendar: Day clicked\",{clickedDate:clickedDate.toISOString().split(\"T\")[0],selectedCheckIn:selectedCheckIn?.toISOString().split(\"T\")[0],selectedCheckOut:selectedCheckOut?.toISOString().split(\"T\")[0],originalCheckIn:originalCheckIn?.toISOString().split(\"T\")[0]});// If no check-in selected, start new selection\nif(!selectedCheckIn){setSelectedCheckIn(date);setOriginalCheckIn(date);setSelectedCheckOut(null);return;}// If clicking on the original check-in date, reset everything\nif(originalCheckIn&&isSameDay(clickedDate,originalCheckIn)){setSelectedCheckIn(null);setSelectedCheckOut(null);setOriginalCheckIn(null);return;}// If we have check-in but no check-out, set check-out (extend range)\nif(selectedCheckIn&&!selectedCheckOut){if(clickedDate>=selectedCheckIn){// Extend the range - set as check-out\nsetSelectedCheckOut(date);}else{// Clicked before check-in - start new selection\nsetSelectedCheckIn(date);setOriginalCheckIn(date);setSelectedCheckOut(null);}return;}// If we have both check-in and check-out, extend the check-out\nif(selectedCheckIn&&selectedCheckOut){if(clickedDate>selectedCheckOut){// Extend the range further\nsetSelectedCheckOut(date);}else if(clickedDate<selectedCheckIn){// Start new selection\nsetSelectedCheckIn(date);setOriginalCheckIn(date);setSelectedCheckOut(null);}else if(isSameDay(clickedDate,selectedCheckOut)){// Clicking on current check-out - remove check-out (back to check-in only)\nsetSelectedCheckOut(null);}else{// Clicking within the range - extend check-out to this date\nsetSelectedCheckOut(date);}return;}};// Handle booking button click\nconst handleBookingClick=e=>{// Prevent any default behavior and stop propagation\nif(e){e.preventDefault();e.stopPropagation();}if(!selectedCheckIn||!selectedCheckOut){console.warn(\"AvailabilityCalendar: Missing check-in or check-out date\");return;}console.log(\"AvailabilityCalendar: Booking button clicked\",{checkIn:selectedCheckIn,checkOut:selectedCheckOut,bookingUrl,onBookingClick:!!onBookingClick});if(onBookingClick){// Use custom callback if provided\nonBookingClick(selectedCheckIn,selectedCheckOut);}else if(bookingUrl&&bookingUrl.trim()!==\"\"){// If bookingUrl is provided, redirect to it with dates as query parameters\nconst checkInStr=selectedCheckIn.toISOString().split(\"T\")[0];const checkOutStr=selectedCheckOut.toISOString().split(\"T\")[0];const nights=Math.ceil((selectedCheckOut.getTime()-selectedCheckIn.getTime())/(1e3*60*60*24));try{// Build URL with query parameters\nconst url=new URL(bookingUrl);url.searchParams.set(\"checkin\",checkInStr);url.searchParams.set(\"checkout\",checkOutStr);url.searchParams.set(\"nights\",nights.toString());if(roomTypeId){url.searchParams.set(\"roomTypeId\",roomTypeId);}if(propertyId){url.searchParams.set(\"propertyId\",propertyId);}console.log(\"AvailabilityCalendar: Redirecting to:\",url.toString());// Use window.open for better Framer compatibility\nwindow.open(url.toString(),\"_blank\");}catch(error){console.error(\"AvailabilityCalendar: Invalid booking URL:\",bookingUrl,error);alert(\"Invalid booking URL. Please contact support.\");}}else{// Default behavior - show booking information\nconst checkInStr=selectedCheckIn.toLocaleDateString();const checkOutStr=selectedCheckOut.toLocaleDateString();const nights=Math.ceil((selectedCheckOut.getTime()-selectedCheckIn.getTime())/(1e3*60*60*24));alert(`Booking Request:\n\nCheck-in: ${checkInStr}\nCheck-out: ${checkOutStr}\nNights: ${nights}\n\nPlease contact us to complete your reservation.`);}};// Fetch availability data for visible months + buffer for cross-month selections\nuseEffect(()=>{const fetchAvailability=async()=>{setLoading(true);setTimeoutError(null);try{// Extend range to allow selections beyond visible months\nconst startDate=new Date(currentDate.getFullYear(),currentDate.getMonth()-1,1);const endDate=new Date(currentDate.getFullYear(),currentDate.getMonth()+monthsToShow+2,0);const startDateStr=startDate.toISOString().split(\"T\")[0];const endDateStr=endDate.toISOString().split(\"T\")[0];// Try to fetch real availability data from Cloudbed API\nlet availabilityMap={};try{// Use a range approach - check availability for each potential stay period\nconst response=await fetchWithTimeout(`${apiUrl}/availability?checkin=${startDateStr}&checkout=${endDateStr}&adults=2&children=0`,{timeout:1e4});if(response.ok){const data=await response.json();if(data.success&&data.availableRooms){// Process real availability data\n// If roomTypeId is specified, filter for that room type\nconst relevantRooms=roomTypeId?data.availableRooms.filter(room=>room.roomTypeID===roomTypeId):data.availableRooms;// For simplicity, if any room is available for the period, mark dates as available\n// In a real implementation, you'd want more granular day-by-day availability\nif(relevantRooms.length>0){for(let d=new Date(startDate);d<=endDate;d.setDate(d.getDate()+1)){const dateStr=d.toISOString().split(\"T\")[0];availabilityMap[dateStr]={available:true,price:relevantRooms[0]?.rates?.[0]?.rate||200};}}}}}catch(apiError){console.warn(\"Failed to fetch real availability, falling back to mock data:\",apiError);}// If no real data was fetched, use mock data as fallback\nif(Object.keys(availabilityMap).length===0){for(let d=new Date(startDate);d<=endDate;d.setDate(d.getDate()+1)){const dateStr=d.toISOString().split(\"T\")[0];availabilityMap[dateStr]={available:true,price:Math.floor(Math.random()*200)+150};}}setAvailabilityData(availabilityMap);}catch(error){if(error instanceof Error&&error.message===\"Request timed out\"){setTimeoutError(\"The request timed out. Please try again.\");}}finally{setLoading(false);}};fetchAvailability();},[currentDate,monthsToShow,roomTypeId,apiUrl]);const calendarDays=generateCalendarDays(currentDate,monthsToShow);const months=Array.from({length:monthsToShow},(_,i)=>new Date(currentDate.getFullYear(),currentDate.getMonth()+i,1));// Force re-render when selection changes\nuseEffect(()=>{// This effect will trigger a re-render when selection changes\n},[selectedCheckIn,selectedCheckOut]);const containerStyle={width:`${width}px`,height:`${height}px`,backgroundColor,color:textColor,borderRadius:`${borderRadius}px`,padding:\"20px\",fontFamily:\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",overflow:\"auto\"};const headerStyle={display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",marginBottom:\"20px\"};const monthGridStyle={display:\"grid\",gridTemplateColumns:`repeat(${monthsToShow}, 1fr)`,gap:\"20px\"};const monthStyle={minWidth:\"250px\"};const monthHeaderStyle={textAlign:\"center\",fontWeight:\"600\",fontSize:\"16px\",marginBottom:\"10px\",color:textColor};const weekHeaderStyle={display:\"grid\",gridTemplateColumns:\"repeat(7, 1fr)\",gap:\"2px\",marginBottom:\"5px\"};const weekDayStyle={textAlign:\"center\",fontSize:\"12px\",fontWeight:\"500\",color:\"#6b7280\",padding:\"5px\"};const daysGridStyle={display:\"grid\",gridTemplateColumns:\"repeat(7, 1fr)\",gap:\"2px\"};const getDayStyle=day=>{const baseStyle={padding:\"8px 4px\",textAlign:\"center\",fontSize:\"12px\",cursor:day.date>=new Date?\"pointer\":\"not-allowed\",borderRadius:\"6px\",transition:\"all 0.2s ease\",opacity:day.date<new Date?.4:1,position:\"relative\",fontWeight:\"500\"};if(day.isSelected){return{...baseStyle,backgroundColor:selectedColor,color:selectedTextColor,fontWeight:\"600\"};}if(day.isInRange){return{...baseStyle,backgroundColor:rangeColor,color:rangeTextColor,border:\"1px solid #d1d5db\"};}if(day.isToday){return{...baseStyle,border:\"2px solid #111827\",fontWeight:\"600\",color:\"#111827\"};}if(day.available){return{...baseStyle,backgroundColor:\"#ffffff\",color:\"#374151\",border:\"1px solid #e5e7eb\"};}return{...baseStyle,backgroundColor:\"#f9fafb\",color:\"#9ca3af\",border:\"1px solid #f3f4f6\"};};const selectionInfoStyle={backgroundColor:\"#f9fafb\",padding:\"15px\",borderRadius:`${borderRadius}px`,marginTop:\"20px\",fontSize:\"14px\"};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:headerStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>setCurrentDate(new Date(currentDate.getFullYear(),currentDate.getMonth()-1,1)),style:{padding:\"12px\",backgroundColor:\"#ffffff\",color:\"#6b7280\",border:\"1px solid #e5e7eb\",borderRadius:\"12px\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"all 0.2s ease\",width:\"44px\",height:\"44px\"},title:\"Previous month\",\"aria-label\":\"Previous month\",onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"#e5e7eb\";e.currentTarget.style.color=\"#374151\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"#f3f4f6\";e.currentTarget.style.color=\"#6b7280\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"m15 18-6-6 6-6\"})})}),/*#__PURE__*/_jsxs(\"div\",{style:{textAlign:\"center\",flex:\"1\"},children:[/*#__PURE__*/_jsx(\"h3\",{style:{margin:\"0\",fontSize:\"18px\",fontWeight:\"600\",color:textColor,lineHeight:\"1.2\"},children:(()=>{if(monthsToShow===1){return currentDate.toLocaleDateString(\"en-US\",{month:\"long\"});}const startDate=currentDate;const endDate=new Date(currentDate.getFullYear(),currentDate.getMonth()+monthsToShow-1,1);// Show month range without year\nreturn`${startDate.toLocaleDateString(\"en-US\",{month:\"long\"})} - ${endDate.toLocaleDateString(\"en-US\",{month:\"long\"})}`;})()}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"14px\",color:\"#6b7280\",fontWeight:\"400\",marginTop:\"2px\"},children:(()=>{if(monthsToShow===1){return currentDate.getFullYear();}const startDate=currentDate;const endDate=new Date(currentDate.getFullYear(),currentDate.getMonth()+monthsToShow-1,1);// If same year, show year once\nif(startDate.getFullYear()===endDate.getFullYear()){return startDate.getFullYear();}// If different years, show both years\nreturn`${startDate.getFullYear()} - ${endDate.getFullYear()}`;})()})]}),/*#__PURE__*/_jsx(\"button\",{onClick:()=>setCurrentDate(new Date(currentDate.getFullYear(),currentDate.getMonth()+1,1)),style:{padding:\"12px\",backgroundColor:\"#ffffff\",color:\"#6b7280\",border:\"1px solid #e5e7eb\",borderRadius:\"12px\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"all 0.2s ease\",width:\"44px\",height:\"44px\"},title:\"Next month\",\"aria-label\":\"Next month\",onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"#e5e7eb\";e.currentTarget.style.color=\"#374151\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"#f3f4f6\";e.currentTarget.style.color=\"#6b7280\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"m9 18 6-6-6-6\"})})})]})}),loading&&/*#__PURE__*/_jsx(\"div\",{style:{textAlign:\"center\",padding:\"20px\",color:\"#6b7280\"},children:/*#__PURE__*/_jsx(\"span\",{children:\"Loading availability...\"})}),timeoutError&&/*#__PURE__*/_jsxs(\"div\",{style:{color:\"#dc2626\",marginTop:8},children:[\"⏱️ \",timeoutError]}),/*#__PURE__*/_jsx(\"div\",{style:monthGridStyle,children:months.map((month,monthIndex)=>/*#__PURE__*/_jsxs(\"div\",{style:monthStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:weekHeaderStyle,children:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"].map(day=>/*#__PURE__*/_jsx(\"div\",{style:weekDayStyle,children:day},day))}),/*#__PURE__*/_jsxs(\"div\",{style:daysGridStyle,children:[Array.from({length:month.getDay()},(_,i)=>/*#__PURE__*/_jsx(\"div\",{style:{padding:\"8px\"}},`empty-${i}`)),calendarDays.filter(day=>day.date.getMonth()===month.getMonth()&&day.date.getFullYear()===month.getFullYear()).map((day,dayIndex)=>/*#__PURE__*/_jsx(\"div\",{style:getDayStyle(day),onClick:()=>handleDayClick(day.date),children:/*#__PURE__*/_jsx(\"div\",{children:day.date.getDate()})},dayIndex))]})]},monthIndex))}),(selectedCheckIn||selectedCheckOut)&&/*#__PURE__*/_jsxs(\"div\",{style:selectionInfoStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{fontWeight:\"600\",marginBottom:\"8px\"},children:\"Selected Dates:\"}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"space-between\",marginBottom:\"12px\"},children:[/*#__PURE__*/_jsxs(\"span\",{children:[\"Check-in:\",\" \",selectedCheckIn?selectedCheckIn.toLocaleDateString():\"Not selected\"]}),/*#__PURE__*/_jsxs(\"span\",{children:[\"Check-out:\",\" \",selectedCheckOut?selectedCheckOut.toLocaleDateString():\"Not selected\"]})]}),selectedCheckIn&&selectedCheckOut&&/*#__PURE__*/_jsxs(\"div\",{style:{marginBottom:\"12px\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{fontSize:\"12px\",color:\"#6b7280\",marginBottom:\"8px\"},children:[Math.ceil((selectedCheckOut.getTime()-selectedCheckIn.getTime())/(1e3*60*60*24)),\" \",\"nights\"]}),showBookingButton&&/*#__PURE__*/_jsx(\"button\",{onClick:e=>handleBookingClick(e),style:{width:\"100%\",padding:\"12px 16px\",backgroundColor:selectedColor,color:selectedTextColor,border:\"none\",borderRadius:`${borderRadius}px`,fontSize:\"14px\",fontWeight:\"600\",cursor:\"pointer\",transition:\"all 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.8\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},children:\"Book Selected Dates\"})]})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:\"15px\",marginTop:\"15px\",fontSize:\"12px\",flexWrap:\"wrap\",color:\"#6b7280\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"5px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"12px\",height:\"12px\",backgroundColor:\"#ffffff\",border:\"1px solid #e5e7eb\",borderRadius:\"3px\"}}),/*#__PURE__*/_jsx(\"span\",{children:\"Available\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"5px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"12px\",height:\"12px\",backgroundColor:\"#f9fafb\",border:\"1px solid #f3f4f6\",borderRadius:\"3px\"}}),/*#__PURE__*/_jsx(\"span\",{children:\"Unavailable\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"5px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"12px\",height:\"12px\",backgroundColor:selectedColor,borderRadius:\"3px\"}}),/*#__PURE__*/_jsx(\"span\",{children:\"Selected\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"5px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"12px\",height:\"12px\",border:\"2px solid #111827\",borderRadius:\"3px\"}}),/*#__PURE__*/_jsx(\"span\",{children:\"Today\"})]})]})]});}// Framer property controls\naddPropertyControls(AvailabilityCalendar,{roomTypeId:{type:ControlType.String,title:\"Room Type ID\",defaultValue:\"\",placeholder:\"Leave empty for all rooms\"},apiUrl:{type:ControlType.String,title:\"API URL\",defaultValue:\"https://framer-cloudbeds-proxy.danieladebimpe.workers.dev\",placeholder:\"Enter API endpoint URL\"},propertyId:{type:ControlType.String,title:\"Property ID\",defaultValue:\"\",placeholder:\"Leave empty unless you have a valid Cloudbeds property ID\"},bookingUrl:{type:ControlType.String,title:\"Booking URL\",defaultValue:\"https://hotels.cloudbeds.com/reservation/t1NtrrThe\",placeholder:\"URL to redirect to when booking (e.g., https://yoursite.com/booking)\"},showPricing:{type:ControlType.Boolean,title:\"Show Pricing\",defaultValue:true},showBookingButton:{type:ControlType.Boolean,title:\"Show Booking Button\",defaultValue:true},monthsToShow:{type:ControlType.Number,title:\"Months to Show\",defaultValue:2,min:1,max:6,step:1},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#ffffff\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#111827\"},selectedColor:{type:ControlType.Color,title:\"Check-in/out Background\",defaultValue:\"#111827\"},selectedTextColor:{type:ControlType.Color,title:\"Check-in/out Text\",defaultValue:\"#ffffff\"},rangeColor:{type:ControlType.Color,title:\"In-Between Dates Background\",defaultValue:\"#e5e7eb\"},rangeTextColor:{type:ControlType.Color,title:\"In-Between Dates Text\",defaultValue:\"#374151\"},rangePriceTextColor:{type:ControlType.Color,title:\"In-Between Price Text\",defaultValue:\"#374151\"},priceTextColor:{type:ControlType.Color,title:\"Price Text Color\",defaultValue:\"#6b7280\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:20,step:1},width:{type:ControlType.Number,title:\"Width\",defaultValue:600,min:400,max:1e3,step:10},height:{type:ControlType.Number,title:\"Height\",defaultValue:400,min:300,max:600,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvailabilityCalendar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AvailabilityCalendar_1.map"],"mappings":"sMAo7BA,SAAS,EAAiB,EAAS,EAAQ,EAAE,CAAC,CAAC,GAAK,CAAC,UAAQ,IAAI,GAAG,GAAM,EAAQ,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAS,EAAK,CAAC,IAAI,SAAS,EAAE,IAAS,eAAe,EAAW,MAAM,oBAAoB,CAAC,CAAC,EAAQ,CAAC,CAAC,CAAC,CAAE,SAAwB,EAAqB,CAAC,aAAW,GAAG,SAAO,4DAA4D,kBAAgB,UAAU,YAAU,UAAU,eAAa,EAAE,QAAM,IAAI,SAAO,IAAI,cAAY,GAAK,eAAa,EAAE,oBAAkB,GAAK,aAAW,SAAS,aAAW,qDAAqD,gBAAc,UAAU,oBAAkB,UAAU,aAAW,UAAU,iBAAe,UAAU,sBAAoB,UAAU,iBAAe,UAAU,kBAAgB,CAAC,GAAK,CAAC,EAAY,GAAgBA,EAAS,IAAI,KAAK,CAAM,CAAC,EAAgB,GAAoBA,EAAS,KAAK,CAAM,CAAC,EAAiB,GAAqBA,EAAS,KAAK,CAAM,CAAC,EAAgB,GAAoBA,EAAS,KAAK,CAAM,CAAC,EAAiB,GAAqBA,EAAS,EAAE,CAAC,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,KAAK,CAC9kC,GAAW,EAAM,IAAgB,EAAM,aAAa,GAAG,EAAM,aAAa,EAAE,EAAM,UAAU,GAAG,EAAM,UAAU,EAAE,EAAM,SAAS,GAAG,EAAM,SAAS,CAClJ,GAAsB,EAAU,IAAS,CAAC,IAAM,EAAK,EAAE,C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